@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,302 @@
|
|
|
1
|
+
import { createRaster, getPixel, opaqueBox, parseHex, setPixel, toHex } from "./image/raster.js";
|
|
2
|
+
import { matteFigure } from "./sheet/matte.js";
|
|
3
|
+
import { wholeImageFigure } from "./sheet/slice.js";
|
|
4
|
+
import { resampleTo } from "./image/resample.js";
|
|
5
|
+
import { runOperation } from "./transform/run.js";
|
|
6
|
+
function distance(a, b) {
|
|
7
|
+
return Math.hypot((a[0] ?? 0) - (b[0] ?? 0), (a[1] ?? 0) - (b[1] ?? 0), (a[2] ?? 0) - (b[2] ?? 0));
|
|
8
|
+
}
|
|
9
|
+
/** Stage's default background tolerance (the matte's slice tolerance for an opaque image). */
|
|
10
|
+
export const STAGE_BACKGROUND_TOLERANCE = 48;
|
|
11
|
+
/** Share of a frame's border pixels that must be transparent for it to count as already cut out. */
|
|
12
|
+
const STRAY_BORDER = 0.02;
|
|
13
|
+
/** The style stage mattes at: binary alpha at 128, full colour (the palette is snapped after). */
|
|
14
|
+
const STAGE_MATTE_STYLE = {
|
|
15
|
+
alpha: { mode: "binary", threshold: 128 },
|
|
16
|
+
color: { rule: "full", palette: [] },
|
|
17
|
+
edges: "crisp",
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Whether an image is already cut out: its border holds real transparency, more than a stray
|
|
21
|
+
* pixel's worth (over 2% of its border pixels, and at least two, below alpha 128). A subject that
|
|
22
|
+
* covers part of the border, even most of it, still counts; a stray semi-transparent pixel in or on
|
|
23
|
+
* the edge of an opaque image does not.
|
|
24
|
+
*/
|
|
25
|
+
export function isCutOut(src) {
|
|
26
|
+
const { width, height } = src;
|
|
27
|
+
let border = 0;
|
|
28
|
+
let clear = 0;
|
|
29
|
+
const visit = (x, y) => {
|
|
30
|
+
border++;
|
|
31
|
+
if ((src.data[(y * width + x) * 4 + 3] ?? 255) < 128)
|
|
32
|
+
clear++;
|
|
33
|
+
};
|
|
34
|
+
for (let x = 0; x < width; x++) {
|
|
35
|
+
visit(x, 0);
|
|
36
|
+
if (height > 1)
|
|
37
|
+
visit(x, height - 1);
|
|
38
|
+
}
|
|
39
|
+
for (let y = 1; y < height - 1; y++) {
|
|
40
|
+
visit(0, y);
|
|
41
|
+
if (width > 1)
|
|
42
|
+
visit(width - 1, y);
|
|
43
|
+
}
|
|
44
|
+
return clear >= 2 && clear > STRAY_BORDER * border;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A copy whose alpha is strictly 0 or 255. An image already cut out keeps its own alpha,
|
|
48
|
+
* thresholded at 128, so its transparent pixels stay background whatever colour hides under them;
|
|
49
|
+
* only an image whose border is opaque has its alpha ignored, and it is matted as opaque by the sheet path's matte
|
|
50
|
+
* (`wholeImageFigure` then `matteFigure`): background is what is connected to the border and is the
|
|
51
|
+
* border's colour, so a pale part of the subject next to a light background stays the subject's.
|
|
52
|
+
*/
|
|
53
|
+
function toTrueAlpha(src, tolerance) {
|
|
54
|
+
const out = createRaster(src.width, src.height);
|
|
55
|
+
out.data.set(src.data);
|
|
56
|
+
if (isCutOut(src)) {
|
|
57
|
+
for (let i = 3; i < out.data.length; i += 4)
|
|
58
|
+
out.data[i] = (out.data[i] ?? 0) < 128 ? 0 : 255;
|
|
59
|
+
return { image: out };
|
|
60
|
+
}
|
|
61
|
+
for (let i = 3; i < out.data.length; i += 4)
|
|
62
|
+
out.data[i] = 255;
|
|
63
|
+
const figure = wholeImageFigure(out, tolerance);
|
|
64
|
+
return { image: matteFigure(figure, STAGE_MATTE_STYLE).image, background: figure.background };
|
|
65
|
+
}
|
|
66
|
+
/** Frames side by side on a transparent canvas, top-aligned: a strip's source as one image. */
|
|
67
|
+
export function sideBySide(frames) {
|
|
68
|
+
const width = frames.reduce((w, f) => w + f.width, 0);
|
|
69
|
+
const height = Math.max(1, ...frames.map((f) => f.height));
|
|
70
|
+
const out = createRaster(Math.max(1, width), height);
|
|
71
|
+
let ox = 0;
|
|
72
|
+
for (const f of frames) {
|
|
73
|
+
for (let y = 0; y < f.height; y++) {
|
|
74
|
+
const row = f.data.subarray(y * f.width * 4, (y + 1) * f.width * 4);
|
|
75
|
+
out.data.set(row, (y * out.width + ox) * 4);
|
|
76
|
+
}
|
|
77
|
+
ox += f.width;
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
/** Colours a cut-out is shown over: the one farthest from every colour it shows is used. */
|
|
82
|
+
const CONTRAST_COLOURS = ["#000000", "#ffffff", "#ff00ff", "#00ff00", "#00ffff", "#0000ff"];
|
|
83
|
+
/**
|
|
84
|
+
* The cut-out composited over a contrasting colour (the one of CONTRAST_COLOURS farthest from every
|
|
85
|
+
* colour it shows), so missing parts and attached background both show.
|
|
86
|
+
*/
|
|
87
|
+
export function overContrast(cutout) {
|
|
88
|
+
const shown = new Set();
|
|
89
|
+
for (let i = 0; i < cutout.data.length; i += 4) {
|
|
90
|
+
if ((cutout.data[i + 3] ?? 0) === 0)
|
|
91
|
+
continue;
|
|
92
|
+
shown.add(((cutout.data[i] ?? 0) << 16) | ((cutout.data[i + 1] ?? 0) << 8) | (cutout.data[i + 2] ?? 0));
|
|
93
|
+
}
|
|
94
|
+
const colours = [...shown].map((n) => [(n >> 16) & 255, (n >> 8) & 255, n & 255]);
|
|
95
|
+
let colour = CONTRAST_COLOURS[0];
|
|
96
|
+
let best = -1;
|
|
97
|
+
for (const hex of CONTRAST_COLOURS) {
|
|
98
|
+
const c = parseHex(hex);
|
|
99
|
+
const nearest = Math.min(Infinity, ...colours.map((o) => distance(o, c)));
|
|
100
|
+
if (nearest > best) {
|
|
101
|
+
best = nearest;
|
|
102
|
+
colour = hex;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const bg = parseHex(colour);
|
|
106
|
+
const image = createRaster(cutout.width, cutout.height);
|
|
107
|
+
for (let i = 0; i < cutout.data.length; i += 4) {
|
|
108
|
+
const a = (cutout.data[i + 3] ?? 0) / 255;
|
|
109
|
+
for (let k = 0; k < 3; k++) {
|
|
110
|
+
image.data[i + k] = Math.round((cutout.data[i + k] ?? 0) * a + (bg[k] ?? 0) * (1 - a));
|
|
111
|
+
}
|
|
112
|
+
image.data[i + 3] = 255;
|
|
113
|
+
}
|
|
114
|
+
return { image, colour };
|
|
115
|
+
}
|
|
116
|
+
/** Resamples the box to dw x dh: area averaging when shrinking, nearest neighbour when growing. */
|
|
117
|
+
function resample(src, box, dw, dh) {
|
|
118
|
+
const out = createRaster(dw, dh);
|
|
119
|
+
const sx = box.width / dw;
|
|
120
|
+
const sy = box.height / dh;
|
|
121
|
+
for (let y = 0; y < dh; y++) {
|
|
122
|
+
for (let x = 0; x < dw; x++) {
|
|
123
|
+
if (sx <= 1 && sy <= 1) {
|
|
124
|
+
const px = box.x + Math.min(box.width - 1, Math.floor((x + 0.5) * sx));
|
|
125
|
+
const py = box.y + Math.min(box.height - 1, Math.floor((y + 0.5) * sy));
|
|
126
|
+
setPixel(out, x, y, getPixel(src, px, py));
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
const x0 = x * sx;
|
|
130
|
+
const x1 = (x + 1) * sx;
|
|
131
|
+
const y0 = y * sy;
|
|
132
|
+
const y1 = (y + 1) * sy;
|
|
133
|
+
let r = 0;
|
|
134
|
+
let g = 0;
|
|
135
|
+
let b = 0;
|
|
136
|
+
let a = 0;
|
|
137
|
+
let area = 0;
|
|
138
|
+
for (let py = Math.floor(y0); py < Math.ceil(y1); py++) {
|
|
139
|
+
for (let px = Math.floor(x0); px < Math.ceil(x1); px++) {
|
|
140
|
+
const w = (Math.min(px + 1, x1) - Math.max(px, x0)) * (Math.min(py + 1, y1) - Math.max(py, y0));
|
|
141
|
+
const [pr, pg, pb, pa] = getPixel(src, box.x + px, box.y + py);
|
|
142
|
+
area += w;
|
|
143
|
+
const wa = w * (pa / 255);
|
|
144
|
+
a += wa;
|
|
145
|
+
r += pr * wa;
|
|
146
|
+
g += pg * wa;
|
|
147
|
+
b += pb * wa;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (area > 0 && a / area >= 0.5) {
|
|
151
|
+
setPixel(out, x, y, [Math.round(r / a), Math.round(g / a), Math.round(b / a), 255]);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return out;
|
|
156
|
+
}
|
|
157
|
+
export function postprocessFrames(frames, options) {
|
|
158
|
+
const { frame, frameCount, anchor } = options;
|
|
159
|
+
const tolerance = options.backgroundTolerance ?? STAGE_BACKGROUND_TOLERANCE;
|
|
160
|
+
const margin = options.margin ?? 1;
|
|
161
|
+
if (frames.length !== frameCount) {
|
|
162
|
+
throw new Error(`expected ${frameCount} frames but got ${frames.length}`);
|
|
163
|
+
}
|
|
164
|
+
if (options.palette.length === 0)
|
|
165
|
+
throw new Error("palette is empty");
|
|
166
|
+
const palette = options.palette.map(parseHex);
|
|
167
|
+
const matted = frames.map((f) => toTrueAlpha(f, tolerance));
|
|
168
|
+
const keyed = matted.map((m) => m.image);
|
|
169
|
+
const boxes = keyed.map((f, i) => {
|
|
170
|
+
const box = opaqueBox(f);
|
|
171
|
+
if (!box)
|
|
172
|
+
throw new Error(`frame ${i} has no subject after background removal`);
|
|
173
|
+
return box;
|
|
174
|
+
});
|
|
175
|
+
const availW = Math.max(1, frame.width - 2 * margin);
|
|
176
|
+
const availH = Math.max(1, frame.height - 2 * margin);
|
|
177
|
+
const maxW = Math.max(...boxes.map((b) => b.width));
|
|
178
|
+
const maxH = Math.max(...boxes.map((b) => b.height));
|
|
179
|
+
const scale = Math.min(availW / maxW, availH / maxH);
|
|
180
|
+
const strip = createRaster(frame.width * frameCount, frame.height);
|
|
181
|
+
const used = new Set();
|
|
182
|
+
let union;
|
|
183
|
+
keyed.forEach((src, i) => {
|
|
184
|
+
const box = boxes[i];
|
|
185
|
+
const dw = Math.min(frame.width, Math.max(1, Math.round(box.width * scale)));
|
|
186
|
+
const dh = Math.min(frame.height, Math.max(1, Math.round(box.height * scale)));
|
|
187
|
+
const scaled = resample(src, box, dw, dh);
|
|
188
|
+
const ox = Math.min(frame.width - dw, Math.max(0, Math.round(anchor.x - dw / 2)));
|
|
189
|
+
// The feet's row is the anchor's row, the ground line animation QA measures contact against.
|
|
190
|
+
const oy = Math.min(frame.height - dh, Math.max(0, Math.round(anchor.y) + 1 - dh));
|
|
191
|
+
for (let y = 0; y < dh; y++) {
|
|
192
|
+
for (let x = 0; x < dw; x++) {
|
|
193
|
+
const px = getPixel(scaled, x, y);
|
|
194
|
+
if (px[3] === 0)
|
|
195
|
+
continue;
|
|
196
|
+
let bestIdx = 0;
|
|
197
|
+
let bestDist = Infinity;
|
|
198
|
+
palette.forEach((p, idx) => {
|
|
199
|
+
const dr = px[0] - p[0];
|
|
200
|
+
const dg = px[1] - p[1];
|
|
201
|
+
const db = px[2] - p[2];
|
|
202
|
+
const d = 2 * dr * dr + 4 * dg * dg + 3 * db * db;
|
|
203
|
+
if (d < bestDist) {
|
|
204
|
+
bestDist = d;
|
|
205
|
+
bestIdx = idx;
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
used.add(bestIdx);
|
|
209
|
+
setPixel(strip, i * frame.width + ox + x, oy + y, [...palette[bestIdx], 255]);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const placed = opaqueBox(strip, { x: i * frame.width, y: 0, ...frame });
|
|
213
|
+
if (!placed)
|
|
214
|
+
throw new Error(`frame ${i} has no subject after scaling`);
|
|
215
|
+
if (!union)
|
|
216
|
+
union = placed;
|
|
217
|
+
else {
|
|
218
|
+
const x = Math.min(union.x, placed.x);
|
|
219
|
+
const y = Math.min(union.y, placed.y);
|
|
220
|
+
union = {
|
|
221
|
+
x,
|
|
222
|
+
y,
|
|
223
|
+
width: Math.max(union.x + union.width, placed.x + placed.width) - x,
|
|
224
|
+
height: Math.max(union.y + union.height, placed.y + placed.height) - y,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
return {
|
|
229
|
+
strip,
|
|
230
|
+
bounds: union,
|
|
231
|
+
palette: options.palette
|
|
232
|
+
.map((_hex, idx) => ({ hex: toHex(palette[idx]), idx }))
|
|
233
|
+
.filter((p) => used.has(p.idx))
|
|
234
|
+
.map((p) => p.hex),
|
|
235
|
+
backgrounds: matted.map((m) => (m.background ? toHex(m.background) : null)),
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Stage's matte input under a style (#364): an image already cut out ({@link isCutOut}) keeps its
|
|
240
|
+
* own alpha; any other has its alpha ignored, so a stray semi-transparent pixel does not turn the
|
|
241
|
+
* sheet matte to source alpha, and is measured against its border's colour at `tolerance`.
|
|
242
|
+
*/
|
|
243
|
+
function stageFigure(src, tolerance) {
|
|
244
|
+
if (isCutOut(src))
|
|
245
|
+
return wholeImageFigure(src, tolerance);
|
|
246
|
+
const out = createRaster(src.width, src.height);
|
|
247
|
+
out.data.set(src.data);
|
|
248
|
+
for (let i = 3; i < out.data.length; i += 4)
|
|
249
|
+
out.data[i] = 255;
|
|
250
|
+
return wholeImageFigure(out, tolerance);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Fits generated frames into a strip under a resolved style: each is matted, cropped to its
|
|
254
|
+
* subject, scaled by one common factor, run through the `apply-style` operation, and placed with
|
|
255
|
+
* its feet on the anchor. With `backgroundTolerance` (stage), frames are prepared for the matte as
|
|
256
|
+
* {@link postprocessFrames} prepares them: only an image already cut out keeps its alpha. Undefined
|
|
257
|
+
* when a frame has no opaque subject after matting, or the styled strip has none left. `backgrounds`
|
|
258
|
+
* is each frame's matte background colour, as {@link Processed.backgrounds}.
|
|
259
|
+
*/
|
|
260
|
+
export function styleFrames(frames, options) {
|
|
261
|
+
const { frame, anchor, style, backgroundTolerance } = options;
|
|
262
|
+
// Matte before measuring so an opaque plain background does not become the subject.
|
|
263
|
+
const figures = frames.map((f) => backgroundTolerance === undefined ? wholeImageFigure(f) : stageFigure(f, backgroundTolerance));
|
|
264
|
+
const cleaned = figures.map((figure) => matteFigure(figure, style).image);
|
|
265
|
+
// The colour the matte removed, per frame; null where the frame kept its own alpha (#548).
|
|
266
|
+
const backgrounds = figures.map((figure) => figure.crop.data.every((v, i) => i % 4 !== 3 || v === 255) ? toHex(figure.background) : null);
|
|
267
|
+
const boxes = cleaned.map((f) => opaqueBox(f));
|
|
268
|
+
if (boxes.some((box) => !box))
|
|
269
|
+
return undefined;
|
|
270
|
+
const found = boxes;
|
|
271
|
+
const scale = Math.min(Math.max(1, frame.width - 2) / Math.max(...found.map((box) => box.width)), Math.max(1, frame.height - 2) / Math.max(...found.map((box) => box.height)));
|
|
272
|
+
const items = cleaned.map((source, f) => {
|
|
273
|
+
const box = found[f];
|
|
274
|
+
const cropped = createRaster(box.width, box.height);
|
|
275
|
+
for (let y = 0; y < box.height; y++)
|
|
276
|
+
for (let x = 0; x < box.width; x++)
|
|
277
|
+
setPixel(cropped, x, y, getPixel(source, box.x + x, box.y + y));
|
|
278
|
+
const width = Math.min(frame.width, Math.max(1, Math.round(box.width * scale)));
|
|
279
|
+
const height = Math.min(frame.height, Math.max(1, Math.round(box.height * scale)));
|
|
280
|
+
return {
|
|
281
|
+
name: `frame-${f + 1}`,
|
|
282
|
+
raster: resampleTo(cropped, scale, { x: 0, y: 0 }, { width, height }, style.edges),
|
|
283
|
+
mediaType: "image/png",
|
|
284
|
+
meta: {},
|
|
285
|
+
};
|
|
286
|
+
});
|
|
287
|
+
const styled = runOperation(items, { op: "apply-style" }, { style });
|
|
288
|
+
const strip = createRaster(frame.width * frames.length, frame.height);
|
|
289
|
+
styled.items.forEach((item, f) => {
|
|
290
|
+
const { width, height } = item.raster;
|
|
291
|
+
const ox = Math.min(frame.width - width, Math.max(0, Math.round(anchor.x - width / 2)));
|
|
292
|
+
// The feet's row is the anchor's row, the ground line animation QA measures contact against.
|
|
293
|
+
const oy = Math.min(frame.height - height, Math.max(0, Math.round(anchor.y) + 1 - height));
|
|
294
|
+
for (let y = 0; y < height; y++)
|
|
295
|
+
for (let x = 0; x < width; x++)
|
|
296
|
+
setPixel(strip, f * frame.width + ox + x, oy + y, getPixel(item.raster, x, y));
|
|
297
|
+
});
|
|
298
|
+
const bounds = opaqueBox(strip);
|
|
299
|
+
if (!bounds)
|
|
300
|
+
return undefined;
|
|
301
|
+
return { strip, bounds, step: styled.step, backgrounds };
|
|
302
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TargetProfile } from "./types.ts";
|
|
2
|
+
/** The top-level fields a target profile may carry. */
|
|
3
|
+
export declare const PROFILE_FIELDS: string[];
|
|
4
|
+
/** Checks a target profile's top-level fields; `source` names the file in the message. */
|
|
5
|
+
export declare function validateProfile(value: Record<string, unknown>, source: string): TargetProfile;
|
package/dist/profile.js
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The target profile's top-level validator. A profile is a shared file: it travels between
|
|
3
|
+
* developers, so an unknown or mistyped top-level field is refused (exit 2 `invalid_input`)
|
|
4
|
+
* instead of being silently ignored. Nested sections keep their own validators where they are read.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { InputError } from "./errors.js";
|
|
8
|
+
import { checkKindLayoutPaths } from "./paths.js";
|
|
9
|
+
import { refuseSettingsBlocks } from "./shared-settings.js";
|
|
10
|
+
import { texturesSchema } from "./image/ktx2.js";
|
|
11
|
+
import { projectRulesSchema } from "./project-rules.js";
|
|
12
|
+
import { releasePolicySchema } from "./release-policy.js";
|
|
13
|
+
const section = z.record(z.string(), z.unknown());
|
|
14
|
+
const finite = z.number().finite();
|
|
15
|
+
/** The camera `render-sprite` draws a 3D model at (docs/rendered-sprites.md). */
|
|
16
|
+
const cameraSchema = z.strictObject({
|
|
17
|
+
projection: z.literal("parallel"),
|
|
18
|
+
yawDeg: finite,
|
|
19
|
+
elevationDeg: finite.min(0).max(90),
|
|
20
|
+
pixelsPerUnit: finite.positive(),
|
|
21
|
+
light: z
|
|
22
|
+
.strictObject({
|
|
23
|
+
direction: z
|
|
24
|
+
.tuple([finite, finite, finite])
|
|
25
|
+
.refine((d) => d.some((c) => c !== 0), "the light direction must not be all zero"),
|
|
26
|
+
ambient: finite.min(0).max(1),
|
|
27
|
+
})
|
|
28
|
+
.optional(),
|
|
29
|
+
});
|
|
30
|
+
const profileSchema = z.strictObject({
|
|
31
|
+
format: z.string(),
|
|
32
|
+
name: z.string().optional(),
|
|
33
|
+
rules: projectRulesSchema.optional(),
|
|
34
|
+
release: releasePolicySchema.optional(),
|
|
35
|
+
license: z.string().optional(),
|
|
36
|
+
acceptedLicenses: z.array(z.string()).optional(),
|
|
37
|
+
style: section.optional(),
|
|
38
|
+
values: section.optional(),
|
|
39
|
+
frames: section.optional(),
|
|
40
|
+
camera: cameraSchema.optional(),
|
|
41
|
+
layout: section.optional(),
|
|
42
|
+
manifest: z.unknown().optional(),
|
|
43
|
+
review: section.optional(),
|
|
44
|
+
validator: section.optional(),
|
|
45
|
+
identity: section.optional(),
|
|
46
|
+
spend: section.optional(),
|
|
47
|
+
model3d: section.optional(),
|
|
48
|
+
animation: section.optional(),
|
|
49
|
+
// Checked by its own schema where an audio kind reads it (src/audio/profile.ts).
|
|
50
|
+
audio: section.optional(),
|
|
51
|
+
kinds: z.record(z.string(), section).optional(),
|
|
52
|
+
textures: texturesSchema.optional(),
|
|
53
|
+
// Each preset's options are checked against its own schema at hand-off (src/handoff/presets).
|
|
54
|
+
library: z
|
|
55
|
+
.strictObject({
|
|
56
|
+
root: z.string().optional(),
|
|
57
|
+
game: z.string().optional(),
|
|
58
|
+
log: z.boolean().optional(),
|
|
59
|
+
})
|
|
60
|
+
.optional(),
|
|
61
|
+
handoff: z.array(z.strictObject({ preset: z.string(), options: section.optional() })).optional(),
|
|
62
|
+
});
|
|
63
|
+
/** The top-level fields a target profile may carry. */
|
|
64
|
+
export const PROFILE_FIELDS = Object.keys(profileSchema.shape);
|
|
65
|
+
/** Checks a target profile's top-level fields; `source` names the file in the message. */
|
|
66
|
+
export function validateProfile(value, source) {
|
|
67
|
+
refuseSettingsBlocks(value, `target profile ${source}`);
|
|
68
|
+
const parsed = profileSchema.safeParse(value);
|
|
69
|
+
if (!parsed.success) {
|
|
70
|
+
const issues = parsed.error.issues.map((issue) => {
|
|
71
|
+
if (issue.code === "unrecognized_keys")
|
|
72
|
+
return `unknown top-level field${issue.keys.length > 1 ? "s" : ""} ${issue.keys
|
|
73
|
+
.map((key) => `"${key}"`)
|
|
74
|
+
.join(", ")} (known: ${PROFILE_FIELDS.join(", ")})`;
|
|
75
|
+
const path = issue.path.join(".");
|
|
76
|
+
return path ? `${path}: ${issue.message}` : issue.message;
|
|
77
|
+
});
|
|
78
|
+
throw new InputError(`target profile ${source} is invalid: ${issues.join("; ")}`, {
|
|
79
|
+
cause: parsed.error,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const profile = parsed.data;
|
|
83
|
+
for (const [kind, block] of Object.entries(profile.kinds ?? {})) {
|
|
84
|
+
if (block.layout === undefined)
|
|
85
|
+
continue;
|
|
86
|
+
const layout = z
|
|
87
|
+
.strictObject({ media: z.string(), manifest: z.string().optional() })
|
|
88
|
+
.safeParse(block.layout);
|
|
89
|
+
if (!layout.success) {
|
|
90
|
+
const issues = layout.error.issues.map((issue) => `kinds.${kind}.layout${issue.path.length ? `.${issue.path.join(".")}` : ""}: ${issue.message}`);
|
|
91
|
+
throw new InputError(`target profile ${source} is invalid: ${issues.join("; ")}`, {
|
|
92
|
+
cause: layout.error,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
checkKindLayoutPaths(profile, kind);
|
|
96
|
+
}
|
|
97
|
+
return profile;
|
|
98
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const projectRulesSchema: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
kind: z.ZodLiteral<"required">;
|
|
4
|
+
source: z.ZodEnum<{
|
|
5
|
+
spec: "spec";
|
|
6
|
+
card: "card";
|
|
7
|
+
}>;
|
|
8
|
+
field: z.ZodString;
|
|
9
|
+
values: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
severity: z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
error: "error";
|
|
13
|
+
warning: "warning";
|
|
14
|
+
}>>;
|
|
15
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
16
|
+
kind: z.ZodLiteral<"labels">;
|
|
17
|
+
required: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
18
|
+
allowed: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
severity: z.ZodDefault<z.ZodEnum<{
|
|
21
|
+
error: "error";
|
|
22
|
+
warning: "warning";
|
|
23
|
+
}>>;
|
|
24
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
25
|
+
kind: z.ZodLiteral<"media">;
|
|
26
|
+
metric: z.ZodEnum<{
|
|
27
|
+
width: "width";
|
|
28
|
+
height: "height";
|
|
29
|
+
bytes: "bytes";
|
|
30
|
+
}>;
|
|
31
|
+
max: z.ZodNumber;
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
severity: z.ZodDefault<z.ZodEnum<{
|
|
34
|
+
error: "error";
|
|
35
|
+
warning: "warning";
|
|
36
|
+
}>>;
|
|
37
|
+
}, z.core.$strict>], "kind">>;
|
|
38
|
+
export type ProjectRule = z.infer<typeof projectRulesSchema>[number];
|
|
39
|
+
export interface RuleFinding {
|
|
40
|
+
rule: string;
|
|
41
|
+
asset: string;
|
|
42
|
+
severity: "error" | "warning";
|
|
43
|
+
evidence: "spec" | "card" | "media";
|
|
44
|
+
status: "passed" | "failed" | "unavailable";
|
|
45
|
+
}
|
|
46
|
+
export declare function evaluateProjectRules(input: {
|
|
47
|
+
rules?: ProjectRule[];
|
|
48
|
+
asset: string;
|
|
49
|
+
spec?: Record<string, unknown>;
|
|
50
|
+
card?: Record<string, unknown>;
|
|
51
|
+
media?: Partial<Record<"bytes" | "width" | "height", number>>;
|
|
52
|
+
}): RuleFinding[];
|
|
53
|
+
export declare function enforceProjectRules(findings: RuleFinding[]): void;
|
|
54
|
+
export declare function measuredRuleMedia(bytes: Uint8Array): Partial<Record<"bytes" | "width" | "height", number>>;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { measureMediaBytes } from "./library/media-metadata.js";
|
|
2
|
+
import { sha256Hex } from "./library/canonical.js";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { InputError } from "./errors.js";
|
|
5
|
+
const base = { id: z.string().min(1), severity: z.enum(["error", "warning"]).default("error") };
|
|
6
|
+
const field = z.string().regex(/^[A-Za-z][A-Za-z0-9_]*(\.[A-Za-z][A-Za-z0-9_]*)*$/);
|
|
7
|
+
export const projectRulesSchema = z
|
|
8
|
+
.array(z.discriminatedUnion("kind", [
|
|
9
|
+
z.strictObject({
|
|
10
|
+
...base,
|
|
11
|
+
kind: z.literal("required"),
|
|
12
|
+
source: z.enum(["spec", "card"]),
|
|
13
|
+
field,
|
|
14
|
+
values: z.array(z.union([z.string(), z.number(), z.boolean()])).optional(),
|
|
15
|
+
}),
|
|
16
|
+
z.strictObject({
|
|
17
|
+
...base,
|
|
18
|
+
kind: z.literal("labels"),
|
|
19
|
+
required: z.array(z.string()).default([]),
|
|
20
|
+
allowed: z.array(z.string()).optional(),
|
|
21
|
+
}),
|
|
22
|
+
z.strictObject({
|
|
23
|
+
...base,
|
|
24
|
+
kind: z.literal("media"),
|
|
25
|
+
metric: z.enum(["bytes", "width", "height"]),
|
|
26
|
+
max: z.number().finite().nonnegative(),
|
|
27
|
+
}),
|
|
28
|
+
]))
|
|
29
|
+
.superRefine((rules, ctx) => {
|
|
30
|
+
const ids = new Set();
|
|
31
|
+
rules.forEach((rule, index) => {
|
|
32
|
+
if (ids.has(rule.id))
|
|
33
|
+
ctx.addIssue({ code: "custom", path: [index, "id"], message: "duplicate rule id" });
|
|
34
|
+
ids.add(rule.id);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
function at(value, path) {
|
|
38
|
+
let current = value;
|
|
39
|
+
for (const key of path.split(".")) {
|
|
40
|
+
if (current === null || typeof current !== "object" || !Object.hasOwn(current, key))
|
|
41
|
+
return undefined;
|
|
42
|
+
current = current[key];
|
|
43
|
+
}
|
|
44
|
+
return current;
|
|
45
|
+
}
|
|
46
|
+
export function evaluateProjectRules(input) {
|
|
47
|
+
return (input.rules ?? []).map((rule) => {
|
|
48
|
+
let evidence;
|
|
49
|
+
let pass;
|
|
50
|
+
if (rule.kind === "required") {
|
|
51
|
+
evidence = rule.source;
|
|
52
|
+
const source = input[rule.source];
|
|
53
|
+
if (source !== undefined) {
|
|
54
|
+
const value = at(source, rule.field);
|
|
55
|
+
pass =
|
|
56
|
+
value !== undefined &&
|
|
57
|
+
value !== null &&
|
|
58
|
+
value !== "" &&
|
|
59
|
+
(rule.values === undefined || rule.values.some((allowed) => Object.is(allowed, value)));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else if (rule.kind === "labels") {
|
|
63
|
+
evidence = "card";
|
|
64
|
+
if (input.card !== undefined) {
|
|
65
|
+
const tags = input.card["tags"] ?? [];
|
|
66
|
+
pass =
|
|
67
|
+
Array.isArray(tags) &&
|
|
68
|
+
tags.every((tag) => typeof tag === "string") &&
|
|
69
|
+
rule.required.every((tag) => tags.includes(tag)) &&
|
|
70
|
+
(rule.allowed === undefined ||
|
|
71
|
+
tags.every((tag) => rule.allowed.includes(tag)));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
evidence = "media";
|
|
76
|
+
const value = input.media?.[rule.metric];
|
|
77
|
+
if (value !== undefined)
|
|
78
|
+
pass = value <= rule.max;
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
rule: rule.id,
|
|
82
|
+
asset: input.asset,
|
|
83
|
+
severity: rule.severity,
|
|
84
|
+
evidence,
|
|
85
|
+
status: pass === undefined ? "unavailable" : pass ? "passed" : "failed",
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
export function enforceProjectRules(findings) {
|
|
90
|
+
const errors = findings.filter((finding) => finding.status === "failed" && finding.severity === "error");
|
|
91
|
+
if (errors.length)
|
|
92
|
+
throw new InputError(errors
|
|
93
|
+
.map((finding) => `project rule ${finding.rule}: ${finding.asset} (${finding.evidence})`)
|
|
94
|
+
.join("; "));
|
|
95
|
+
}
|
|
96
|
+
export function measuredRuleMedia(bytes) {
|
|
97
|
+
const evidence = measureMediaBytes(bytes, sha256Hex(bytes));
|
|
98
|
+
return {
|
|
99
|
+
bytes: bytes.byteLength,
|
|
100
|
+
...(evidence.status === "available" &&
|
|
101
|
+
evidence.width !== undefined && { width: evidence.width }),
|
|
102
|
+
...(evidence.status === "available" &&
|
|
103
|
+
evidence.height !== undefined && { height: evidence.height }),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { InputError } from "./errors.ts";
|
|
2
|
+
import { callsSha256 } from "./library/canonical.ts";
|
|
3
|
+
import type { Provenance, ProvenanceBinding } from "./types.ts";
|
|
4
|
+
/** A provenance file that is not the record of the media it is named with: exit 2. */
|
|
5
|
+
export declare class ProvenanceError extends InputError {
|
|
6
|
+
readonly code = "provenance_mismatch";
|
|
7
|
+
constructor(message: string, options?: ErrorOptions);
|
|
8
|
+
}
|
|
9
|
+
/** The sha256 of a record's canonical JSON without its `binding`. */
|
|
10
|
+
export declare function recordSha256(record: Provenance): string;
|
|
11
|
+
/** The binding of a record to the media bytes it describes. */
|
|
12
|
+
export declare function bindingOf(record: Provenance, bytes: Uint8Array): ProvenanceBinding;
|
|
13
|
+
/** The record bound to `bytes`, with any earlier binding replaced. */
|
|
14
|
+
export declare function bindProvenance<T extends Provenance>(record: T, bytes: Uint8Array): T;
|
|
15
|
+
export interface ProvenanceOptions {
|
|
16
|
+
/** Also match the run record's rejected candidates (those that kept a model), not only staged ones. */
|
|
17
|
+
rejected?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface NamedProvenance {
|
|
20
|
+
/** The media as given: its path, bytes and media type. */
|
|
21
|
+
media: {
|
|
22
|
+
path: string;
|
|
23
|
+
bytes: Uint8Array;
|
|
24
|
+
mediaType: string;
|
|
25
|
+
};
|
|
26
|
+
/** The provenance file as given: its path, bytes and parsed value. */
|
|
27
|
+
provenance: {
|
|
28
|
+
path: string;
|
|
29
|
+
bytes: Uint8Array | string;
|
|
30
|
+
value: Provenance;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export { callsSha256 };
|
|
34
|
+
/**
|
|
35
|
+
* The record, checked as the record of the media against the evidence outside the file (the
|
|
36
|
+
* media's mark and content credentials, and the library review record and run record beside the
|
|
37
|
+
* media) and against its own binding. Returns the record (for a staged candidate given by its `--json` view, the run
|
|
38
|
+
* record's own copy), with `madeOutsideAssetgrove: true` when it records no call and nothing outside
|
|
39
|
+
* the file records calls or names a model (and `modelMadeOutsideAssetgrove` when the media's mark
|
|
40
|
+
* or credentials say a model made it, derived from the media, not the file). Throws a ProvenanceError naming both files otherwise.
|
|
41
|
+
* The run record's rejected candidates vouch for their model only when `options.rejected` is set
|
|
42
|
+
* (a command that accepts a rejected candidate's model, such as rig); otherwise a rejected
|
|
43
|
+
* candidate's model is an unbound file like any other.
|
|
44
|
+
*/
|
|
45
|
+
export declare function checkProvenance(named: NamedProvenance, options?: ProvenanceOptions): Promise<Provenance>;
|
|
46
|
+
/**
|
|
47
|
+
* The one command that hands the media of an unbound record off again, so its record is written
|
|
48
|
+
* and bound (docs/decisions.md, "Provenance is bound to its media").
|
|
49
|
+
*/
|
|
50
|
+
export declare function upToDateCommand(record: Pick<Provenance, "generator">): string;
|
|
51
|
+
/**
|
|
52
|
+
* Reads a provenance file named with media and checks it is that media's record
|
|
53
|
+
* (`checkProvenance`, with its `options`). Throws an InputError when it is not JSON.
|
|
54
|
+
*/
|
|
55
|
+
export declare function readNamedProvenance(provenancePath: string, media: NamedProvenance["media"], options?: ProvenanceOptions): Promise<Provenance>;
|