@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,44 @@
|
|
|
1
|
+
import type { Caller } from "../calls.ts";
|
|
2
|
+
import type { DecisionQuestion } from "../gateway/provider.ts";
|
|
3
|
+
import { type Raster } from "../image/raster.ts";
|
|
4
|
+
import type { Routes } from "../routes.ts";
|
|
5
|
+
import type { LoadedReference } from "../types.ts";
|
|
6
|
+
import type { AnimationReason, FlickerDecision } from "./types.ts";
|
|
7
|
+
/** Consecutive 1-based frame pairs, plus the seam (last, first) for a loop of more than two frames. */
|
|
8
|
+
export declare function flickerPairs(count: number, loop: boolean): Array<[number, number]>;
|
|
9
|
+
export declare function buildFlickerPrompt(input: {
|
|
10
|
+
subject: string;
|
|
11
|
+
family: string;
|
|
12
|
+
pair: [number, number];
|
|
13
|
+
subjectDescription?: string;
|
|
14
|
+
}): string;
|
|
15
|
+
/** The question each pair is asked: a typed Boolean, so its probability is the model's own. */
|
|
16
|
+
export declare function flickerQuestion(pair: [number, number]): DecisionQuestion;
|
|
17
|
+
export declare function planFlicker(count: number, loop: boolean, routes: Routes): {
|
|
18
|
+
calls: number;
|
|
19
|
+
model: string;
|
|
20
|
+
estimatedCostUsd: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The frame as the model sees it: flattened over the loop preview's neutral backdrop, so how a
|
|
24
|
+
* provider treats transparent pixels (often dropping alpha and showing the colour left under a
|
|
25
|
+
* matte's holes) cannot pass for a marking. A frame under `MIN_DECISION_EDGE` on a side is
|
|
26
|
+
* enlarged with crisp edges first, as the identity call does: some decision models reject small
|
|
27
|
+
* images (#27).
|
|
28
|
+
*/
|
|
29
|
+
export declare function frameReference(raster: Raster, n: number): LoadedReference;
|
|
30
|
+
export declare function checkFlicker(options: {
|
|
31
|
+
frames: Raster[];
|
|
32
|
+
family: string;
|
|
33
|
+
subject: string;
|
|
34
|
+
subjectDescription?: string;
|
|
35
|
+
loop: boolean;
|
|
36
|
+
cutoff: number;
|
|
37
|
+
call: Caller;
|
|
38
|
+
now?: () => Date;
|
|
39
|
+
}): Promise<{
|
|
40
|
+
reasons: AnimationReason[];
|
|
41
|
+
decisions: FlickerDecision[];
|
|
42
|
+
}>;
|
|
43
|
+
/** Appends one JSON line per decision: the logged data a later cutoff is chosen from. */
|
|
44
|
+
export declare function appendDecisionLog(path: string, decisions: FlickerDecision[]): Promise<void>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { mkdir, appendFile } from "node:fs/promises";
|
|
2
|
+
import { dirname } from "node:path";
|
|
3
|
+
import { ProviderError } from "../errors.js";
|
|
4
|
+
import { encodePng } from "../image/raster.js";
|
|
5
|
+
import { sha256 } from "../request.js";
|
|
6
|
+
import { forDecision } from "../identity.js";
|
|
7
|
+
import { flattenFrame } from "./preview.js";
|
|
8
|
+
/** Consecutive 1-based frame pairs, plus the seam (last, first) for a loop of more than two frames. */
|
|
9
|
+
export function flickerPairs(count, loop) {
|
|
10
|
+
const pairs = [];
|
|
11
|
+
for (let i = 1; i < count; i++)
|
|
12
|
+
pairs.push([i, i + 1]);
|
|
13
|
+
if (loop && count > 2)
|
|
14
|
+
pairs.push([count, 1]);
|
|
15
|
+
return pairs;
|
|
16
|
+
}
|
|
17
|
+
export function buildFlickerPrompt(input) {
|
|
18
|
+
const [a, b] = input.pair;
|
|
19
|
+
return [
|
|
20
|
+
`Image 1 is frame ${a} and image 2 is frame ${b} of the same "${input.family}" animation of ${input.subject}.`,
|
|
21
|
+
...(input.subjectDescription ? [`The character: ${input.subjectDescription}`] : []),
|
|
22
|
+
"Both frames are shown over the same plain light grey backdrop. The pose is expected to change between frames. Ignore the pose.",
|
|
23
|
+
"Each frame may be painted on its own, so brush strokes, fur strands, texture grain, single small strokes or specks, and the fine, ragged edges of markings can differ between frames. That is texture, not identity.",
|
|
24
|
+
"The character's identity is which markings it has, where they sit and their overall shape; its colours; its proportions; its accessories.",
|
|
25
|
+
].join("\n");
|
|
26
|
+
}
|
|
27
|
+
/** The question each pair is asked: a typed Boolean, so its probability is the model's own. */
|
|
28
|
+
export function flickerQuestion(pair) {
|
|
29
|
+
const [a, b] = pair;
|
|
30
|
+
return {
|
|
31
|
+
type: "boolean",
|
|
32
|
+
instructions: `Does the character's identity change between frame ${a} and frame ${b}, setting aside pose and brush texture?`,
|
|
33
|
+
whenTrue: "a marking appears, disappears, moves or takes a clearly different overall shape, a colour changes, the proportions change, or an accessory changes",
|
|
34
|
+
whenFalse: "the identity is the same; at most the pose, painterly texture or the fine edges of markings differ",
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function planFlicker(count, loop, routes) {
|
|
38
|
+
const calls = flickerPairs(count, loop).length;
|
|
39
|
+
return {
|
|
40
|
+
calls,
|
|
41
|
+
model: routes.flicker.model,
|
|
42
|
+
estimatedCostUsd: calls * routes.flicker.estimatedCostUsd,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The frame as the model sees it: flattened over the loop preview's neutral backdrop, so how a
|
|
47
|
+
* provider treats transparent pixels (often dropping alpha and showing the colour left under a
|
|
48
|
+
* matte's holes) cannot pass for a marking. A frame under `MIN_DECISION_EDGE` on a side is
|
|
49
|
+
* enlarged with crisp edges first, as the identity call does: some decision models reject small
|
|
50
|
+
* images (#27).
|
|
51
|
+
*/
|
|
52
|
+
export function frameReference(raster, n) {
|
|
53
|
+
const bytes = encodePng(flattenFrame(raster));
|
|
54
|
+
return forDecision({
|
|
55
|
+
role: `frame ${n}`,
|
|
56
|
+
path: `frame-${n}.png`,
|
|
57
|
+
mediaType: "image/png",
|
|
58
|
+
bytes,
|
|
59
|
+
sha256: sha256(bytes),
|
|
60
|
+
}, "crisp");
|
|
61
|
+
}
|
|
62
|
+
export async function checkFlicker(options) {
|
|
63
|
+
const now = options.now ?? (() => new Date());
|
|
64
|
+
const reasons = [];
|
|
65
|
+
const decisions = [];
|
|
66
|
+
for (const pair of flickerPairs(options.frames.length, options.loop)) {
|
|
67
|
+
const [a, b] = pair;
|
|
68
|
+
const first = options.frames[a - 1];
|
|
69
|
+
const second = options.frames[b - 1];
|
|
70
|
+
if (!first || !second)
|
|
71
|
+
continue;
|
|
72
|
+
const prompt = buildFlickerPrompt({
|
|
73
|
+
subject: options.subject,
|
|
74
|
+
family: options.family,
|
|
75
|
+
pair,
|
|
76
|
+
...(options.subjectDescription !== undefined && {
|
|
77
|
+
subjectDescription: options.subjectDescription,
|
|
78
|
+
}),
|
|
79
|
+
});
|
|
80
|
+
const { result, record } = await options.call.decide("flicker", prompt, [frameReference(first, a), frameReference(second, b)], flickerQuestion(pair));
|
|
81
|
+
if (result.answer.type !== "boolean") {
|
|
82
|
+
throw new ProviderError("the flicker decision gave no true or false");
|
|
83
|
+
}
|
|
84
|
+
const probability = Math.min(1, Math.max(0, result.answer.probability));
|
|
85
|
+
const label = probability >= 0.5 ? "flicker" : "same";
|
|
86
|
+
const flagged = probability >= options.cutoff;
|
|
87
|
+
const said = label === "flicker"
|
|
88
|
+
? "the identity changes, setting aside pose and brush texture"
|
|
89
|
+
: "the identity holds, setting aside pose and brush texture";
|
|
90
|
+
decisions.push({
|
|
91
|
+
pair,
|
|
92
|
+
model: record.model,
|
|
93
|
+
requestId: record.requestId,
|
|
94
|
+
label,
|
|
95
|
+
probability,
|
|
96
|
+
cutoff: options.cutoff,
|
|
97
|
+
flagged,
|
|
98
|
+
reason: said,
|
|
99
|
+
costUsd: record.costUsd,
|
|
100
|
+
at: now().toISOString(),
|
|
101
|
+
});
|
|
102
|
+
const p = probability.toFixed(2);
|
|
103
|
+
reasons.push({
|
|
104
|
+
check: "identity-flicker",
|
|
105
|
+
passed: !flagged,
|
|
106
|
+
source: "decision",
|
|
107
|
+
frames: [a, b],
|
|
108
|
+
reason: `frame ${a} → frame ${b}: ${label === "flicker" ? "flicker" : "same"} (probability ${p} ${flagged ? "≥" : "<"} cutoff ${options.cutoff}): ${said}`,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return { reasons, decisions };
|
|
112
|
+
}
|
|
113
|
+
/** Appends one JSON line per decision: the logged data a later cutoff is chosen from. */
|
|
114
|
+
export async function appendDecisionLog(path, decisions) {
|
|
115
|
+
await mkdir(dirname(path), { recursive: true });
|
|
116
|
+
await appendFile(path, decisions.map((d) => `${JSON.stringify(d)}\n`).join(""));
|
|
117
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Raster } from "../image/raster.ts";
|
|
2
|
+
import type { Rgb, Transform } from "../types.ts";
|
|
3
|
+
import type { AnimationReason, AnimationThresholds } from "./types.ts";
|
|
4
|
+
export interface FrameHalo {
|
|
5
|
+
/** Soft edge pixels (0 < alpha < 255) with a fully opaque pixel within HALO_RADIUS px. */
|
|
6
|
+
edgePixels: number;
|
|
7
|
+
/** Of those, the ones whose colour is far from every opaque colour within reach. */
|
|
8
|
+
haloPixels: number;
|
|
9
|
+
/** Fully transparent pixels that still carry a colour. */
|
|
10
|
+
colouredTransparent: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The colour halo of one frame. A soft edge pixel should carry the colour of the figure it fades
|
|
14
|
+
* from, so its colour must be near one of the fully opaque pixels within HALO_RADIUS px. A
|
|
15
|
+
* transparent pixel that keeps a colour shows wherever a renderer or provider drops alpha.
|
|
16
|
+
*/
|
|
17
|
+
export declare function frameHalo(frame: Raster): FrameHalo;
|
|
18
|
+
/**
|
|
19
|
+
* The share of a frame's soft edge that is halo: soft edge pixels whose colour is far from every
|
|
20
|
+
* opaque colour near them, over all soft edge pixels. Transparent pixels that keep a colour are a
|
|
21
|
+
* separate, exactly fixable matter (see `transparentColourNotes`) and are not counted here.
|
|
22
|
+
*/
|
|
23
|
+
export declare function haloShare(h: FrameHalo): number;
|
|
24
|
+
/** Px within which an edge pixel finds the figure's interior colours it is compared with. */
|
|
25
|
+
export declare const FRINGE_RADIUS = 4;
|
|
26
|
+
export interface FrameFringe {
|
|
27
|
+
/**
|
|
28
|
+
* Edge pixels: visible pixels (alpha > 0) that are soft or have a fully transparent 4-neighbour
|
|
29
|
+
* (outside the frame counts as transparent), with an interior pixel within FRINGE_RADIUS px.
|
|
30
|
+
*/
|
|
31
|
+
edgePixels: number;
|
|
32
|
+
/** Of those, the ones strictly closer to the matte's background than to every interior colour near them. */
|
|
33
|
+
fringePixels: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The background fringe of one frame against the matte's background colour. An edge pixel should
|
|
37
|
+
* carry the figure's colour, so it is fringe when its colour is closer to the background than to
|
|
38
|
+
* each interior pixel (fully opaque, not an edge pixel) within FRINGE_RADIUS px; a tie is the
|
|
39
|
+
* figure's. An edge pixel with no interior near it (a strand of fur) is not counted. Exact: the
|
|
40
|
+
* same pixels and background give the same answer.
|
|
41
|
+
*/
|
|
42
|
+
export declare function frameFringe(frame: Raster, background: Rgb): FrameFringe;
|
|
43
|
+
/** The share of a frame's edge that is background fringe. */
|
|
44
|
+
export declare function fringeShare(f: FrameFringe): number;
|
|
45
|
+
/**
|
|
46
|
+
* The matte's background colour a provenance record's transforms name: the last `matte` step that
|
|
47
|
+
* unmixed the figure from a background colour, unless a model edited the frame after it. A `source-alpha` matte (the image had real alpha)
|
|
48
|
+
* names an estimate that means nothing, and an image never matted has none.
|
|
49
|
+
*/
|
|
50
|
+
export declare function matteBackground(transforms: readonly Transform[] | undefined): string | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* The `edge-halo` reasons of a strip (or a still, one frame): one passing reason per measure used,
|
|
53
|
+
* or one failing reason per frame over its limit. A frame whose matte background is known
|
|
54
|
+
* (`backgrounds[i]`, "#rrggbb", read from its provenance) is measured by its fringe share against
|
|
55
|
+
* `edgeFringeShare`; any other frame by its soft edge share of halo against `edgeHaloShare`. Each
|
|
56
|
+
* frame whose fully transparent pixels keep a colour adds a passing `transparent-colour` note: that
|
|
57
|
+
* colour shows only where a renderer drops alpha, and the sheet path and fix-frame clear it
|
|
58
|
+
* (apply-style), so it never fails the strip. With `fringeOnly` (stage and planned stills and
|
|
59
|
+
* strips), a frame with no known background is not measured: it came already cut out, so no matte
|
|
60
|
+
* left a fringe on it, and the old measure is not applied there.
|
|
61
|
+
*/
|
|
62
|
+
export declare function edgeHaloReasons(frames: Raster[], thresholds: Pick<AnimationThresholds, "edgeHaloShare" | "edgeFringeShare">, backgrounds?: ReadonlyArray<string | undefined>, options?: {
|
|
63
|
+
fringeOnly?: boolean;
|
|
64
|
+
}): AnimationReason[];
|
|
65
|
+
/**
|
|
66
|
+
* One passing note per frame whose fully transparent pixels keep a colour. The colour is invisible
|
|
67
|
+
* where alpha is honoured and is cleared when the strip is written (apply-style), so it is reported,
|
|
68
|
+
* never failed.
|
|
69
|
+
*/
|
|
70
|
+
export declare function transparentColourNotes(halos: FrameHalo[]): AnimationReason[];
|
|
71
|
+
/** A copy of the frame with every fully transparent pixel's colour cleared to 0. */
|
|
72
|
+
export declare function clearTransparentColour(frame: Raster): Raster;
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The deterministic edge-halo check of a strip or a still: an edge that carries a colour the
|
|
3
|
+
* figure does not have there (a tint or fringe left by a removed background). Where the matte's
|
|
4
|
+
* background colour is known (from the candidate's provenance), an edge pixel is fringe when it is
|
|
5
|
+
* closer to that background than to the figure's interior beside it, so a pale fringe on a pale
|
|
6
|
+
* subject is caught and a painterly edge in a colour of its own is not. Where it is not known, a
|
|
7
|
+
* soft edge pixel is halo when it is far from every opaque colour near it. Transparent pixels that
|
|
8
|
+
* keep a colour are counted apart and reported as a note. Nothing here assumes a style.
|
|
9
|
+
*/
|
|
10
|
+
import { parseHex } from "../image/raster.js";
|
|
11
|
+
/** Px within which a soft edge pixel finds the figure colours it fades from. */
|
|
12
|
+
const HALO_RADIUS = 3;
|
|
13
|
+
/** RGB distance from every nearby opaque colour beyond which a soft edge pixel is a halo. */
|
|
14
|
+
const HALO_DISTANCE = 64;
|
|
15
|
+
/**
|
|
16
|
+
* The colour halo of one frame. A soft edge pixel should carry the colour of the figure it fades
|
|
17
|
+
* from, so its colour must be near one of the fully opaque pixels within HALO_RADIUS px. A
|
|
18
|
+
* transparent pixel that keeps a colour shows wherever a renderer or provider drops alpha.
|
|
19
|
+
*/
|
|
20
|
+
export function frameHalo(frame) {
|
|
21
|
+
const { width, height, data } = frame;
|
|
22
|
+
let edgePixels = 0;
|
|
23
|
+
let haloPixels = 0;
|
|
24
|
+
let colouredTransparent = 0;
|
|
25
|
+
for (let y = 0; y < height; y++) {
|
|
26
|
+
for (let x = 0; x < width; x++) {
|
|
27
|
+
const i = (y * width + x) * 4;
|
|
28
|
+
const a = data[i + 3] ?? 0;
|
|
29
|
+
if (a === 0) {
|
|
30
|
+
if (data[i] || data[i + 1] || data[i + 2])
|
|
31
|
+
colouredTransparent++;
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
if (a === 255)
|
|
35
|
+
continue;
|
|
36
|
+
let best = Infinity;
|
|
37
|
+
for (let dy = -HALO_RADIUS; dy <= HALO_RADIUS; dy++) {
|
|
38
|
+
for (let dx = -HALO_RADIUS; dx <= HALO_RADIUS; dx++) {
|
|
39
|
+
const xx = x + dx;
|
|
40
|
+
const yy = y + dy;
|
|
41
|
+
if (xx < 0 || yy < 0 || xx >= width || yy >= height)
|
|
42
|
+
continue;
|
|
43
|
+
const j = (yy * width + xx) * 4;
|
|
44
|
+
if (data[j + 3] !== 255)
|
|
45
|
+
continue;
|
|
46
|
+
const d = Math.hypot((data[i] ?? 0) - (data[j] ?? 0), (data[i + 1] ?? 0) - (data[j + 1] ?? 0), (data[i + 2] ?? 0) - (data[j + 2] ?? 0));
|
|
47
|
+
if (d < best)
|
|
48
|
+
best = d;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (best === Infinity)
|
|
52
|
+
continue;
|
|
53
|
+
edgePixels++;
|
|
54
|
+
if (best > HALO_DISTANCE)
|
|
55
|
+
haloPixels++;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return { edgePixels, haloPixels, colouredTransparent };
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* The share of a frame's soft edge that is halo: soft edge pixels whose colour is far from every
|
|
62
|
+
* opaque colour near them, over all soft edge pixels. Transparent pixels that keep a colour are a
|
|
63
|
+
* separate, exactly fixable matter (see `transparentColourNotes`) and are not counted here.
|
|
64
|
+
*/
|
|
65
|
+
export function haloShare(h) {
|
|
66
|
+
return h.edgePixels === 0 ? 0 : h.haloPixels / h.edgePixels;
|
|
67
|
+
}
|
|
68
|
+
/** Px within which an edge pixel finds the figure's interior colours it is compared with. */
|
|
69
|
+
export const FRINGE_RADIUS = 4;
|
|
70
|
+
/**
|
|
71
|
+
* The background fringe of one frame against the matte's background colour. An edge pixel should
|
|
72
|
+
* carry the figure's colour, so it is fringe when its colour is closer to the background than to
|
|
73
|
+
* each interior pixel (fully opaque, not an edge pixel) within FRINGE_RADIUS px; a tie is the
|
|
74
|
+
* figure's. An edge pixel with no interior near it (a strand of fur) is not counted. Exact: the
|
|
75
|
+
* same pixels and background give the same answer.
|
|
76
|
+
*/
|
|
77
|
+
export function frameFringe(frame, background) {
|
|
78
|
+
const { width, height, data } = frame;
|
|
79
|
+
const n = width * height;
|
|
80
|
+
const alphaAt = (x, y) => x < 0 || y < 0 || x >= width || y >= height ? 0 : (data[(y * width + x) * 4 + 3] ?? 0);
|
|
81
|
+
// 1: edge pixel, 2: interior pixel, 0: transparent.
|
|
82
|
+
const role = new Uint8Array(n);
|
|
83
|
+
for (let y = 0; y < height; y++) {
|
|
84
|
+
for (let x = 0; x < width; x++) {
|
|
85
|
+
const a = alphaAt(x, y);
|
|
86
|
+
if (a === 0)
|
|
87
|
+
continue;
|
|
88
|
+
const edge = a < 255 ||
|
|
89
|
+
alphaAt(x - 1, y) === 0 ||
|
|
90
|
+
alphaAt(x + 1, y) === 0 ||
|
|
91
|
+
alphaAt(x, y - 1) === 0 ||
|
|
92
|
+
alphaAt(x, y + 1) === 0;
|
|
93
|
+
role[y * width + x] = edge ? 1 : 2;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const dist = (i, c) => Math.hypot((data[i] ?? 0) - (c[0] ?? 0), (data[i + 1] ?? 0) - (c[1] ?? 0), (data[i + 2] ?? 0) - (c[2] ?? 0));
|
|
97
|
+
let edgePixels = 0;
|
|
98
|
+
let fringePixels = 0;
|
|
99
|
+
for (let y = 0; y < height; y++) {
|
|
100
|
+
for (let x = 0; x < width; x++) {
|
|
101
|
+
if (role[y * width + x] !== 1)
|
|
102
|
+
continue;
|
|
103
|
+
const i = (y * width + x) * 4;
|
|
104
|
+
let nearest = Infinity;
|
|
105
|
+
for (let dy = -FRINGE_RADIUS; dy <= FRINGE_RADIUS; dy++) {
|
|
106
|
+
const yy = y + dy;
|
|
107
|
+
if (yy < 0 || yy >= height)
|
|
108
|
+
continue;
|
|
109
|
+
for (let dx = -FRINGE_RADIUS; dx <= FRINGE_RADIUS; dx++) {
|
|
110
|
+
const xx = x + dx;
|
|
111
|
+
if (xx < 0 || xx >= width || role[yy * width + xx] !== 2)
|
|
112
|
+
continue;
|
|
113
|
+
const j = (yy * width + xx) * 4;
|
|
114
|
+
const d = dist(i, [data[j] ?? 0, data[j + 1] ?? 0, data[j + 2] ?? 0]);
|
|
115
|
+
if (d < nearest)
|
|
116
|
+
nearest = d;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (nearest === Infinity)
|
|
120
|
+
continue;
|
|
121
|
+
edgePixels++;
|
|
122
|
+
if (dist(i, background) < nearest)
|
|
123
|
+
fringePixels++;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return { edgePixels, fringePixels };
|
|
127
|
+
}
|
|
128
|
+
/** The share of a frame's edge that is background fringe. */
|
|
129
|
+
export function fringeShare(f) {
|
|
130
|
+
return f.edgePixels === 0 ? 0 : f.fringePixels / f.edgePixels;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* The matte's background colour a provenance record's transforms name: the last `matte` step that
|
|
134
|
+
* unmixed the figure from a background colour, unless a model edited the frame after it. A `source-alpha` matte (the image had real alpha)
|
|
135
|
+
* names an estimate that means nothing, and an image never matted has none.
|
|
136
|
+
*/
|
|
137
|
+
export function matteBackground(transforms) {
|
|
138
|
+
// A frame edited by a model since its matte is a new image: the matte after the edit, if any.
|
|
139
|
+
const last = (transforms ?? []).findLast((t) => t.op === "matte" || t.op === "edit-frame");
|
|
140
|
+
const matte = last?.op === "matte" ? last : undefined;
|
|
141
|
+
if (!matte || matte["mode"] !== "unmix" || typeof matte["background"] !== "string")
|
|
142
|
+
return undefined;
|
|
143
|
+
return /^#[0-9a-f]{6}$/i.test(matte["background"]) ? matte["background"] : undefined;
|
|
144
|
+
}
|
|
145
|
+
const pct = (v) => `${(v * 100).toFixed(1)}%`;
|
|
146
|
+
/**
|
|
147
|
+
* The `edge-halo` reasons of a strip (or a still, one frame): one passing reason per measure used,
|
|
148
|
+
* or one failing reason per frame over its limit. A frame whose matte background is known
|
|
149
|
+
* (`backgrounds[i]`, "#rrggbb", read from its provenance) is measured by its fringe share against
|
|
150
|
+
* `edgeFringeShare`; any other frame by its soft edge share of halo against `edgeHaloShare`. Each
|
|
151
|
+
* frame whose fully transparent pixels keep a colour adds a passing `transparent-colour` note: that
|
|
152
|
+
* colour shows only where a renderer drops alpha, and the sheet path and fix-frame clear it
|
|
153
|
+
* (apply-style), so it never fails the strip. With `fringeOnly` (stage and planned stills and
|
|
154
|
+
* strips), a frame with no known background is not measured: it came already cut out, so no matte
|
|
155
|
+
* left a fringe on it, and the old measure is not applied there.
|
|
156
|
+
*/
|
|
157
|
+
export function edgeHaloReasons(frames, thresholds, backgrounds = [], options = {}) {
|
|
158
|
+
const haloLimit = thresholds.edgeHaloShare;
|
|
159
|
+
const fringeLimit = thresholds.edgeFringeShare;
|
|
160
|
+
const halos = frames.map(frameHalo);
|
|
161
|
+
const fringes = frames.map((f, i) => {
|
|
162
|
+
const hex = backgrounds[i];
|
|
163
|
+
if (hex === undefined)
|
|
164
|
+
return undefined;
|
|
165
|
+
const fringe = frameFringe(f, parseHex(hex));
|
|
166
|
+
return { hex, fringe, share: fringeShare(fringe) };
|
|
167
|
+
});
|
|
168
|
+
const failing = [];
|
|
169
|
+
const haloShares = [];
|
|
170
|
+
const fringeShares = [];
|
|
171
|
+
const hexes = new Set();
|
|
172
|
+
frames.forEach((_, i) => {
|
|
173
|
+
const h = halos[i];
|
|
174
|
+
const f = fringes[i];
|
|
175
|
+
if (f) {
|
|
176
|
+
fringeShares.push(f.share);
|
|
177
|
+
hexes.add(f.hex);
|
|
178
|
+
if (f.share > fringeLimit) {
|
|
179
|
+
failing.push({
|
|
180
|
+
check: "edge-halo",
|
|
181
|
+
passed: false,
|
|
182
|
+
reason: `frame ${i + 1}: ${f.fringe.fringePixels} of ${f.fringe.edgePixels} edge pixels are closer to the matte's background ${f.hex} than to the figure's interior within ${FRINGE_RADIUS} px (${pct(f.share)}, limit ${pct(fringeLimit)})`,
|
|
183
|
+
source: "deterministic",
|
|
184
|
+
frames: [i + 1],
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
// A still's frame that came already cut out has no matte to have left a fringe (#548).
|
|
190
|
+
if (options.fringeOnly)
|
|
191
|
+
return;
|
|
192
|
+
const s = haloShare(h);
|
|
193
|
+
haloShares.push(s);
|
|
194
|
+
if (s > haloLimit) {
|
|
195
|
+
failing.push({
|
|
196
|
+
check: "edge-halo",
|
|
197
|
+
passed: false,
|
|
198
|
+
reason: `frame ${i + 1}: ${h.haloPixels} of ${h.edgePixels} soft edge pixels carry a colour more than ${HALO_DISTANCE} from every opaque colour within ${HALO_RADIUS} px (${pct(s)}, limit ${pct(haloLimit)})`,
|
|
199
|
+
source: "deterministic",
|
|
200
|
+
frames: [i + 1],
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
const passing = [];
|
|
205
|
+
if (failing.length === 0 && fringeShares.length > 0) {
|
|
206
|
+
passing.push({
|
|
207
|
+
check: "edge-halo",
|
|
208
|
+
passed: true,
|
|
209
|
+
reason: `every ${fringeShares.length < frames.length ? "matted " : ""}frame's edge keeps the figure's colours: at most ${pct(Math.max(...fringeShares))} of its edge pixels are closer to the matte's background ${[...hexes].join(", ")} than to the figure's interior within ${FRINGE_RADIUS} px (limit ${pct(fringeLimit)})`,
|
|
210
|
+
source: "deterministic",
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
if (failing.length === 0 &&
|
|
214
|
+
(haloShares.length > 0 || (frames.length === 0 && !options.fringeOnly))) {
|
|
215
|
+
passing.push({
|
|
216
|
+
check: "edge-halo",
|
|
217
|
+
passed: true,
|
|
218
|
+
reason: `every ${fringeShares.length > 0 ? "other " : ""}frame's soft edge carries the figure's own colours: at most ${pct(Math.max(0, ...haloShares))} of it is more than ${HALO_DISTANCE} from every opaque colour within ${HALO_RADIUS} px (limit ${pct(haloLimit)})`,
|
|
219
|
+
source: "deterministic",
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
return [...passing, ...failing, ...transparentColourNotes(halos)];
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* One passing note per frame whose fully transparent pixels keep a colour. The colour is invisible
|
|
226
|
+
* where alpha is honoured and is cleared when the strip is written (apply-style), so it is reported,
|
|
227
|
+
* never failed.
|
|
228
|
+
*/
|
|
229
|
+
export function transparentColourNotes(halos) {
|
|
230
|
+
return halos.flatMap((h, i) => h.colouredTransparent === 0
|
|
231
|
+
? []
|
|
232
|
+
: [
|
|
233
|
+
{
|
|
234
|
+
check: "transparent-colour",
|
|
235
|
+
passed: true,
|
|
236
|
+
reason: `frame ${i + 1}: ${h.colouredTransparent} fully transparent pixels keep a colour, shown only where alpha is dropped; write-families and fix-frame clear it, and the vision checks and previews use the cleared frame`,
|
|
237
|
+
source: "deterministic",
|
|
238
|
+
frames: [i + 1],
|
|
239
|
+
},
|
|
240
|
+
]);
|
|
241
|
+
}
|
|
242
|
+
/** A copy of the frame with every fully transparent pixel's colour cleared to 0. */
|
|
243
|
+
export function clearTransparentColour(frame) {
|
|
244
|
+
const data = new Uint8Array(frame.data);
|
|
245
|
+
for (let i = 0; i < data.length; i += 4) {
|
|
246
|
+
if (data[i + 3] === 0) {
|
|
247
|
+
data[i] = 0;
|
|
248
|
+
data[i + 1] = 0;
|
|
249
|
+
data[i + 2] = 0;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return { ...frame, data };
|
|
253
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The holes check of a strip: did background removal cut away part of the figure? The commonest
|
|
3
|
+
* failure is a border flood that eats a pale belly or muzzle open to the outside, so where the
|
|
4
|
+
* image before removal exists (a sheet import keeps each frame's crop), one typed Boolean decision
|
|
5
|
+
* per frame sees the frame before and after removal, the removed parts over magenta, and answers
|
|
6
|
+
* "Is any part of the character missing after background removal?". Where it does not (a strip
|
|
7
|
+
* given on its own), pixels find the see-through areas the figure's outline encloses, at least a
|
|
8
|
+
* share of the figure's area, and one decision per frame with such an area asks whether any of
|
|
9
|
+
* them is a hole cut into the character rather than a natural opening between two parts.
|
|
10
|
+
*/
|
|
11
|
+
import type { Caller } from "../calls.ts";
|
|
12
|
+
import type { DecisionQuestion } from "../gateway/provider.ts";
|
|
13
|
+
import type { Raster } from "../image/raster.ts";
|
|
14
|
+
import type { Routes } from "../routes.ts";
|
|
15
|
+
import type { LoadedReference } from "../types.ts";
|
|
16
|
+
import type { AnimationReason, HoleDecision } from "./types.ts";
|
|
17
|
+
export interface EnclosedArea {
|
|
18
|
+
/** Pixels below the alpha cut. */
|
|
19
|
+
area: number;
|
|
20
|
+
/** Bounding box, in frame px. */
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The see-through areas the figure's outline encloses: runs of pixels below the alpha cut
|
|
28
|
+
* (8-connected) that do not reach the frame's edge, each at least `minPx` big. `marked` is 1 on
|
|
29
|
+
* every pixel of those areas.
|
|
30
|
+
*/
|
|
31
|
+
export declare function enclosedAreas(frame: Raster, options: {
|
|
32
|
+
threshold: number;
|
|
33
|
+
minPx: number;
|
|
34
|
+
}): {
|
|
35
|
+
areas: EnclosedArea[];
|
|
36
|
+
marked: Uint8Array;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* The frame as the model sees it: enlarged over a green backdrop, the marked pixels (enclosed areas)
|
|
40
|
+
* over magenta. `under` sets the backdrop of every pixel instead (magenta, for the frame after removal).
|
|
41
|
+
*/
|
|
42
|
+
export declare function holeView(frame: Raster, marked: Uint8Array, under?: readonly number[]): Raster;
|
|
43
|
+
export declare function buildHolesPrompt(input: {
|
|
44
|
+
subject: string;
|
|
45
|
+
family: string;
|
|
46
|
+
frame: number;
|
|
47
|
+
areas: number;
|
|
48
|
+
}): string;
|
|
49
|
+
/** The enclosed-area view's question. */
|
|
50
|
+
export declare const ENCLOSED_QUESTION: DecisionQuestion;
|
|
51
|
+
/** The prompt of the before-and-after view. */
|
|
52
|
+
export declare function buildBeforeAfterPrompt(input: {
|
|
53
|
+
subject: string;
|
|
54
|
+
family: string;
|
|
55
|
+
frame: number;
|
|
56
|
+
}): string;
|
|
57
|
+
/** The before-and-after view's question (#376). */
|
|
58
|
+
export declare const BEFORE_AFTER_QUESTION: DecisionQuestion;
|
|
59
|
+
/** The pixels at or above the alpha cut: the frame's figure area. */
|
|
60
|
+
export declare function figureArea(frame: Raster, threshold: number): number;
|
|
61
|
+
/** The smallest enclosed area judged on a frame: `minShare` of its figure area, at least 1 px. */
|
|
62
|
+
export declare function holeMinPx(frame: Raster, options: {
|
|
63
|
+
threshold: number;
|
|
64
|
+
minShare: number;
|
|
65
|
+
}): number;
|
|
66
|
+
/** A frame's image before background removal and the same crop after it (sheet resolution). */
|
|
67
|
+
export interface HoleSource {
|
|
68
|
+
before: Raster;
|
|
69
|
+
after: Raster;
|
|
70
|
+
}
|
|
71
|
+
/** One frame a holes check sends to the model, and how it is shown. */
|
|
72
|
+
export type HoleCandidate = {
|
|
73
|
+
frame: number;
|
|
74
|
+
view: "before-after";
|
|
75
|
+
source: HoleSource;
|
|
76
|
+
} | {
|
|
77
|
+
frame: number;
|
|
78
|
+
view: "enclosed";
|
|
79
|
+
areas: EnclosedArea[];
|
|
80
|
+
marked: Uint8Array;
|
|
81
|
+
minPx: number;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* The frames (1-based) a holes check would send to the model. A frame with its image before
|
|
85
|
+
* removal is always sent; any other only with an enclosed see-through area of at least its
|
|
86
|
+
* share of the figure's area.
|
|
87
|
+
*/
|
|
88
|
+
export declare function holeCandidates(frames: Raster[], options: {
|
|
89
|
+
threshold: number;
|
|
90
|
+
minShare: number;
|
|
91
|
+
sources?: ReadonlyArray<HoleSource | undefined>;
|
|
92
|
+
}): HoleCandidate[];
|
|
93
|
+
export declare function planHoles(frames: Raster[], options: {
|
|
94
|
+
threshold: number;
|
|
95
|
+
minShare: number;
|
|
96
|
+
sources?: ReadonlyArray<HoleSource | undefined>;
|
|
97
|
+
}, routes: Routes): {
|
|
98
|
+
calls: number;
|
|
99
|
+
model: string;
|
|
100
|
+
estimatedCostUsd: number;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* A view as the model receives it: `holeView` enlarges by the longer side, so a tall narrow crop
|
|
104
|
+
* is still enlarged (crisp edges) until its shorter side reaches `MIN_DECISION_EDGE`, as the
|
|
105
|
+
* identity call does: some decision models reject small images (#27).
|
|
106
|
+
*/
|
|
107
|
+
export declare function viewReference(view: Raster, role: string, path: string): LoadedReference;
|
|
108
|
+
export declare function checkHoles(options: {
|
|
109
|
+
frames: Raster[];
|
|
110
|
+
family: string;
|
|
111
|
+
subject: string;
|
|
112
|
+
threshold: number;
|
|
113
|
+
minShare: number;
|
|
114
|
+
cutoff: number;
|
|
115
|
+
call: Caller;
|
|
116
|
+
/** Per strip frame, its image before background removal, where one exists. */
|
|
117
|
+
sources?: ReadonlyArray<HoleSource | undefined>;
|
|
118
|
+
now?: () => Date;
|
|
119
|
+
}): Promise<{
|
|
120
|
+
reasons: AnimationReason[];
|
|
121
|
+
decisions: HoleDecision[];
|
|
122
|
+
}>;
|