@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,431 @@
|
|
|
1
|
+
import { mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
|
+
import { DIGITAL_SOURCE_TYPES, combineDigitalSourceTypes, embedDigitalSourceType, readDigitalSourceType, metadataStep, requireDeclared, sourceDeclaration, } from "../metadata.js";
|
|
4
|
+
import { InputError } from "../errors.js";
|
|
5
|
+
import { commandIdentity, defaultGate, requireApproval, resolveProgram } from "../approvals.js";
|
|
6
|
+
import { licenseFields } from "../license.js";
|
|
7
|
+
import { decodeImage, encodePng } from "../image/raster.js";
|
|
8
|
+
import { sha256, sniffMediaType } from "../request.js";
|
|
9
|
+
import { applyStability, MATERIAL_FLICKER_CHECK, MATERIAL_LIT_CHECKS, mergeFiltering, } from "../qa/stability.js";
|
|
10
|
+
import { CORE_METHODS, temporalPairs, temporalReason, validateMaterialMap } from "./core.js";
|
|
11
|
+
import { judgeMapFlicker, needsDecision } from "./flicker.js";
|
|
12
|
+
import { checkCompressed } from "./rendition.js";
|
|
13
|
+
import { resolveMaterialProfile } from "./profile.js";
|
|
14
|
+
import { targetCommand } from "./engine.js";
|
|
15
|
+
import { pixelHash, runRecipeAsync } from "../transform/run.js";
|
|
16
|
+
const LIT_CHECKS = MATERIAL_LIT_CHECKS.map((c) => c.id);
|
|
17
|
+
function imageReference(bytes, role, path) {
|
|
18
|
+
return { bytes, mediaType: "image/png", role, path, sha256: sha256(bytes) };
|
|
19
|
+
}
|
|
20
|
+
function parseLit(text) {
|
|
21
|
+
let checks;
|
|
22
|
+
try {
|
|
23
|
+
checks = JSON.parse(text).checks;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
checks = undefined;
|
|
27
|
+
}
|
|
28
|
+
return LIT_CHECKS.map((check) => {
|
|
29
|
+
const matches = Array.isArray(checks)
|
|
30
|
+
? checks.filter((c) => c?.check === check)
|
|
31
|
+
: [];
|
|
32
|
+
const c = matches.length === 1 ? matches[0] : undefined;
|
|
33
|
+
return {
|
|
34
|
+
check,
|
|
35
|
+
passed: c?.passed === true,
|
|
36
|
+
reason: typeof c?.reason === "string" ? c.reason : "missing or unreadable lit QA verdict",
|
|
37
|
+
source: "vision",
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export async function runMaterials(options) {
|
|
42
|
+
const startedAt = new Date().toISOString();
|
|
43
|
+
const outDir = resolve(options.outDir);
|
|
44
|
+
await mkdir(outDir, { recursive: true });
|
|
45
|
+
const reportPath = join(outDir, "materials.json");
|
|
46
|
+
await rm(reportPath, { force: true });
|
|
47
|
+
const { spec, profile, derivation, call } = options;
|
|
48
|
+
const config = resolveMaterialProfile(profile.style?.materials);
|
|
49
|
+
// Before any paid call: every command the profile style names runs only with an approval.
|
|
50
|
+
const commandDir = options.profileDir ?? options.baseDir;
|
|
51
|
+
const gate = options.gate ?? defaultGate();
|
|
52
|
+
const approve = async (kind, argv) => {
|
|
53
|
+
if (argv[0])
|
|
54
|
+
resolveProgram(argv[0], commandDir);
|
|
55
|
+
return requireApproval(commandIdentity(kind, argv, commandDir), gate);
|
|
56
|
+
};
|
|
57
|
+
const compressionStep = config.compression
|
|
58
|
+
? await approve("material-compression", config.compression.command)
|
|
59
|
+
: undefined;
|
|
60
|
+
const previewStep = config.preview
|
|
61
|
+
? await approve("material-preview", config.preview.command)
|
|
62
|
+
: undefined;
|
|
63
|
+
const commands = [compressionStep, previewStep].filter((s) => s !== undefined);
|
|
64
|
+
const steps = [];
|
|
65
|
+
const commandResults = [];
|
|
66
|
+
const origins = new WeakMap();
|
|
67
|
+
const recipeItem = (raster, name) => ({
|
|
68
|
+
name,
|
|
69
|
+
raster,
|
|
70
|
+
mediaType: "image/png",
|
|
71
|
+
meta: {},
|
|
72
|
+
digitalSourceType: origins.get(raster) ?? DIGITAL_SOURCE_TYPES.undeclared,
|
|
73
|
+
});
|
|
74
|
+
const recipe = async (op, params, raster) => {
|
|
75
|
+
const result = await runRecipeAsync({ steps: [{ op, params }] }, [recipeItem(raster, op)], {
|
|
76
|
+
materialCall: call,
|
|
77
|
+
...(options.digitalSourceType !== undefined && {
|
|
78
|
+
digitalSourceType: options.digitalSourceType,
|
|
79
|
+
}),
|
|
80
|
+
});
|
|
81
|
+
steps.push(...result.steps);
|
|
82
|
+
const item = result.items[0];
|
|
83
|
+
origins.set(item.raster, item.digitalSourceType ?? DIGITAL_SOURCE_TYPES.undeclared);
|
|
84
|
+
return item.raster;
|
|
85
|
+
};
|
|
86
|
+
if (!derivation || !derivation.maps)
|
|
87
|
+
throw new InputError("material derivation maps are required");
|
|
88
|
+
const grid = {
|
|
89
|
+
width: spec.frames?.width ?? profile.frames.width,
|
|
90
|
+
height: spec.frames?.height ?? profile.frames.height,
|
|
91
|
+
count: spec.frames?.count ?? 1,
|
|
92
|
+
};
|
|
93
|
+
if (Object.values(grid).some((n) => !Number.isInteger(n) || n < 1))
|
|
94
|
+
throw new InputError("invalid material frame grid");
|
|
95
|
+
const albedoBytes = new Uint8Array(await readFile(options.albedoPath));
|
|
96
|
+
const albedo = decodeImage(albedoBytes);
|
|
97
|
+
origins.set(albedo, readDigitalSourceType(albedoBytes, sniffMediaType(albedoBytes)) ??
|
|
98
|
+
options.digitalSourceType ??
|
|
99
|
+
DIGITAL_SOURCE_TYPES.undeclared);
|
|
100
|
+
const native = albedo.height / grid.height;
|
|
101
|
+
if (!Number.isInteger(native) ||
|
|
102
|
+
albedo.width !== grid.width * grid.count * native ||
|
|
103
|
+
native < Math.max(...config.scales))
|
|
104
|
+
throw new InputError("albedo native resolution cannot support requested renditions without upscaling");
|
|
105
|
+
const nativeGrid = {
|
|
106
|
+
width: grid.width * native,
|
|
107
|
+
height: grid.height * native,
|
|
108
|
+
count: grid.count,
|
|
109
|
+
};
|
|
110
|
+
const mapSources = new Map();
|
|
111
|
+
const ref = imageReference(albedoBytes, "neutral-key-light albedo", resolve(options.albedoPath));
|
|
112
|
+
const sources = await Promise.all((derivation.lightSources ?? []).map(async (s) => ({
|
|
113
|
+
name: s.name,
|
|
114
|
+
mask: decodeImage(new Uint8Array(await readFile(resolve(options.baseDir, s.mask)))),
|
|
115
|
+
})));
|
|
116
|
+
const names = spec.fields?.["lightSources"];
|
|
117
|
+
if (names !== undefined && (!Array.isArray(names) || names.some((n) => typeof n !== "string")))
|
|
118
|
+
throw new InputError("spec.fields.lightSources must be source names");
|
|
119
|
+
const namedLightSources = (names ?? []);
|
|
120
|
+
for (const source of sources)
|
|
121
|
+
if (!namedLightSources.includes(source.name))
|
|
122
|
+
throw new InputError(`emissive source is not named in the spec: ${source.name}`);
|
|
123
|
+
const derive = async (channel) => {
|
|
124
|
+
const existing = mapSources.get(channel);
|
|
125
|
+
if (existing)
|
|
126
|
+
return existing.raster;
|
|
127
|
+
const input = derivation.maps[channel];
|
|
128
|
+
if (!input || !input.version?.trim())
|
|
129
|
+
throw new InputError(`missing declared method/version for ${channel}`);
|
|
130
|
+
if (input.method === "height-derived-normal" && channel !== "normal")
|
|
131
|
+
throw new InputError("height-derived-normal is only valid for normals");
|
|
132
|
+
const source = input.method === "height-derived-normal" ? await derive("height") : albedo;
|
|
133
|
+
const params = {
|
|
134
|
+
grid: nativeGrid,
|
|
135
|
+
method: input.method,
|
|
136
|
+
version: input.version,
|
|
137
|
+
component: input.component ?? "red",
|
|
138
|
+
strength: (input.strength ?? 1) * native,
|
|
139
|
+
lightSources: namedLightSources,
|
|
140
|
+
...(input.path ? { path: resolve(options.baseDir, input.path) } : {}),
|
|
141
|
+
};
|
|
142
|
+
const raster = await recipe(`material-${channel}`, params, source);
|
|
143
|
+
const inputHash = steps.at(-1).report["inputHash"];
|
|
144
|
+
mapSources.set(channel, {
|
|
145
|
+
raster,
|
|
146
|
+
method: input.method,
|
|
147
|
+
version: input.version,
|
|
148
|
+
inputHash,
|
|
149
|
+
parameters: {
|
|
150
|
+
component: input.component ?? "red",
|
|
151
|
+
strength: input.strength ?? 1,
|
|
152
|
+
strengthUnits: "per-base-pixel",
|
|
153
|
+
nativeStrength: (input.strength ?? 1) * native,
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
return raster;
|
|
157
|
+
};
|
|
158
|
+
for (const channel of config.channels)
|
|
159
|
+
await derive(channel);
|
|
160
|
+
const reasons = [];
|
|
161
|
+
for (const channel of config.channels) {
|
|
162
|
+
const map = mapSources.get(channel).raster;
|
|
163
|
+
const encoding = config.encoding?.[channel];
|
|
164
|
+
if (encoding && encoding.encoding !== "unorm8")
|
|
165
|
+
throw new InputError(`unsupported material encoding for ${channel}`);
|
|
166
|
+
const bound = typeof config.flickerBound === "number"
|
|
167
|
+
? config.flickerBound
|
|
168
|
+
: config.flickerBound?.[channel];
|
|
169
|
+
if (bound === undefined)
|
|
170
|
+
throw new InputError(`missing flicker bound for ${channel}`);
|
|
171
|
+
// Pixels clear each frame pair whose map holds still where the albedo is unchanged; a pair they
|
|
172
|
+
// cannot clear is judged by one map-flicker decision, and only "flickers" fails (#364).
|
|
173
|
+
const temporal = [];
|
|
174
|
+
for (const pair of temporalPairs(albedo, map, nativeGrid, bound)) {
|
|
175
|
+
temporal.push(needsDecision(pair)
|
|
176
|
+
? await judgeMapFlicker(call, {
|
|
177
|
+
albedo,
|
|
178
|
+
map,
|
|
179
|
+
grid: nativeGrid,
|
|
180
|
+
channel,
|
|
181
|
+
pair,
|
|
182
|
+
bound,
|
|
183
|
+
subject: spec.subject ?? spec.assetId,
|
|
184
|
+
})
|
|
185
|
+
: temporalReason(pair, bound));
|
|
186
|
+
}
|
|
187
|
+
reasons.push(...[
|
|
188
|
+
...validateMaterialMap(albedo, map, nativeGrid, channel, {
|
|
189
|
+
range: encoding?.range,
|
|
190
|
+
emissiveSources: sources,
|
|
191
|
+
namedLightSources,
|
|
192
|
+
}),
|
|
193
|
+
...temporal,
|
|
194
|
+
].map((r) => ({ ...r, reason: `${channel}: ${r.reason}` })));
|
|
195
|
+
}
|
|
196
|
+
// A flicker decision filters only where the map-flicker model is measured stable; otherwise advisory.
|
|
197
|
+
const judged = applyStability(reasons, reasons.some((r) => r.source === "decision")
|
|
198
|
+
? { "map-flicker": call.route("map-flicker") }
|
|
199
|
+
: {}, { checks: [MATERIAL_FLICKER_CHECK], ...(options.stability && { entries: options.stability }) });
|
|
200
|
+
reasons.splice(0, reasons.length, ...judged.reasons);
|
|
201
|
+
const flickerFiltering = judged.filtering;
|
|
202
|
+
const outputs = [];
|
|
203
|
+
const sidecars = new Map();
|
|
204
|
+
let litComplete = false;
|
|
205
|
+
let filtering = flickerFiltering.length
|
|
206
|
+
? flickerFiltering
|
|
207
|
+
: undefined;
|
|
208
|
+
const common = {
|
|
209
|
+
startedAt,
|
|
210
|
+
profileHash: sha256(Buffer.from(JSON.stringify(profile))),
|
|
211
|
+
specHash: sha256(Buffer.from(JSON.stringify(spec))),
|
|
212
|
+
derivationHash: sha256(Buffer.from(JSON.stringify(derivation))),
|
|
213
|
+
lightSources: sources.map((s) => ({ name: s.name, sha256: sha256(encodePng(s.mask)) })),
|
|
214
|
+
generator: "assetgrove-materials",
|
|
215
|
+
...(options.digitalSourceType !== undefined && {
|
|
216
|
+
sourceDeclaration: sourceDeclaration(options.digitalSourceType),
|
|
217
|
+
}),
|
|
218
|
+
version: "1",
|
|
219
|
+
assetId: spec.assetId,
|
|
220
|
+
source: { path: resolve(options.albedoPath), sha256: sha256(albedoBytes), nativeScale: native },
|
|
221
|
+
grid,
|
|
222
|
+
upscalerUsed: false,
|
|
223
|
+
review: "pending",
|
|
224
|
+
calls: call.records,
|
|
225
|
+
commands,
|
|
226
|
+
};
|
|
227
|
+
const writeReport = async () => {
|
|
228
|
+
const qa = {
|
|
229
|
+
passed: litComplete && reasons.some((r) => !r.shadow) && reasons.every((r) => r.passed || r.shadow),
|
|
230
|
+
reasons,
|
|
231
|
+
};
|
|
232
|
+
const finishedAt = new Date().toISOString();
|
|
233
|
+
const costUsd = call.records.reduce((sum, c) => sum + c.costUsd, 0);
|
|
234
|
+
// The licence is derived once every call (including material-qa) has been recorded.
|
|
235
|
+
const licensing = licenseFields(profile, call.records);
|
|
236
|
+
for (const [path, record] of sidecars)
|
|
237
|
+
await writeFile(path, JSON.stringify({ ...record, ...licensing, calls: call.records, finishedAt, costUsd }, null, 2) + "\n");
|
|
238
|
+
await writeFile(reportPath, JSON.stringify({
|
|
239
|
+
...common,
|
|
240
|
+
...licensing,
|
|
241
|
+
finishedAt,
|
|
242
|
+
costUsd,
|
|
243
|
+
derivations: Object.fromEntries([...mapSources].map(([channel, m]) => [
|
|
244
|
+
channel,
|
|
245
|
+
{
|
|
246
|
+
method: m.method,
|
|
247
|
+
version: m.version,
|
|
248
|
+
inputHash: m.inputHash,
|
|
249
|
+
parameters: m.parameters,
|
|
250
|
+
engine: channel === "normal" && m.method === "height-derived-normal"
|
|
251
|
+
? CORE_METHODS.normals
|
|
252
|
+
: m.method === "mask-extraction"
|
|
253
|
+
? CORE_METHODS.extraction
|
|
254
|
+
: { method: "gateway-model", version: m.version },
|
|
255
|
+
},
|
|
256
|
+
])),
|
|
257
|
+
outputs,
|
|
258
|
+
steps,
|
|
259
|
+
commandResults,
|
|
260
|
+
lightRig: config.lightRig,
|
|
261
|
+
qa,
|
|
262
|
+
...(filtering && { filtering }),
|
|
263
|
+
}, null, 2) + "\n");
|
|
264
|
+
return { passed: qa.passed, reportPath, outputs, qa, ...(filtering && { filtering }) };
|
|
265
|
+
};
|
|
266
|
+
if (reasons.some((r) => !r.passed && !r.shadow))
|
|
267
|
+
return writeReport();
|
|
268
|
+
try {
|
|
269
|
+
for (const channel of ["albedo", ...config.channels])
|
|
270
|
+
for (const scale of config.scales) {
|
|
271
|
+
const source = channel === "albedo" ? albedo : mapSources.get(channel).raster;
|
|
272
|
+
const rendition = await recipe("material-rendition", { grid, scale, native, normal: channel === "normal" }, source);
|
|
273
|
+
if (channel !== "albedo") {
|
|
274
|
+
const checks = validateMaterialMap(rendition, rendition, { width: grid.width * scale, height: grid.height * scale, count: grid.count }, channel, { range: config.encoding?.[channel]?.range }).filter((r) => r.check === "material-range");
|
|
275
|
+
reasons.push(...checks.map((r) => ({ ...r, reason: `${channel}@${scale}x: ${r.reason}` })));
|
|
276
|
+
if (checks.some((r) => !r.passed))
|
|
277
|
+
return writeReport();
|
|
278
|
+
}
|
|
279
|
+
const path = join(outDir, `${channel}@${scale}x.png`);
|
|
280
|
+
const digitalSourceType = origins.get(rendition) ?? DIGITAL_SOURCE_TYPES.undeclared;
|
|
281
|
+
const bytes = embedDigitalSourceType(encodePng(rendition), "image/png", digitalSourceType);
|
|
282
|
+
steps.push(metadataStep(digitalSourceType, [pixelHash(rendition)]));
|
|
283
|
+
await writeFile(path, bytes);
|
|
284
|
+
const output = {
|
|
285
|
+
digitalSourceType,
|
|
286
|
+
channel,
|
|
287
|
+
scale,
|
|
288
|
+
path,
|
|
289
|
+
sha256: sha256(bytes),
|
|
290
|
+
mediaType: "image/png",
|
|
291
|
+
width: rendition.width,
|
|
292
|
+
height: rendition.height,
|
|
293
|
+
};
|
|
294
|
+
outputs.push(output);
|
|
295
|
+
const derived = channel === "albedo"
|
|
296
|
+
? { method: "native-albedo", version: "1", inputHash: sha256(albedoBytes) }
|
|
297
|
+
: mapSources.get(channel);
|
|
298
|
+
const provenance = {
|
|
299
|
+
...common,
|
|
300
|
+
...output,
|
|
301
|
+
steps: [...steps],
|
|
302
|
+
derivation: {
|
|
303
|
+
method: derived.method,
|
|
304
|
+
version: derived.version,
|
|
305
|
+
inputHash: derived.inputHash,
|
|
306
|
+
parameters: "parameters" in derived ? derived.parameters : {},
|
|
307
|
+
},
|
|
308
|
+
encoding: channel === "normal" ? "tangent-space-positive-y-unorm8" : "unorm8",
|
|
309
|
+
range: channel === "albedo" ? [0, 1] : (config.encoding?.[channel]?.range ?? [0, 1]),
|
|
310
|
+
};
|
|
311
|
+
sidecars.set(`${path}.provenance.json`, {
|
|
312
|
+
...provenance,
|
|
313
|
+
engine: channel === "normal" && derived.method === "height-derived-normal"
|
|
314
|
+
? CORE_METHODS.normals
|
|
315
|
+
: derived.method === "mask-extraction"
|
|
316
|
+
? CORE_METHODS.extraction
|
|
317
|
+
: { method: derived.method, version: derived.version },
|
|
318
|
+
});
|
|
319
|
+
if (config.compression && compressionStep) {
|
|
320
|
+
if (!config.compression.version?.trim())
|
|
321
|
+
throw new InputError("compression version required");
|
|
322
|
+
requireDeclared(digitalSourceType);
|
|
323
|
+
const compressed = path.replace(/\.png$/, ".ktx2");
|
|
324
|
+
const execution = await targetCommand(config.compression.command, { input: path, output: compressed }, commandDir);
|
|
325
|
+
const packed = new Uint8Array(await readFile(compressed));
|
|
326
|
+
checkCompressed(packed, rendition.width, rendition.height);
|
|
327
|
+
commandResults.push({
|
|
328
|
+
...execution,
|
|
329
|
+
version: config.compression.version,
|
|
330
|
+
sha256: sha256(packed),
|
|
331
|
+
path: compressed,
|
|
332
|
+
mediaType: "image/ktx2",
|
|
333
|
+
approval: compressionStep,
|
|
334
|
+
});
|
|
335
|
+
const compressedOutput = {
|
|
336
|
+
...output,
|
|
337
|
+
path: compressed,
|
|
338
|
+
sha256: sha256(packed),
|
|
339
|
+
mediaType: "image/ktx2",
|
|
340
|
+
};
|
|
341
|
+
outputs.push(compressedOutput);
|
|
342
|
+
sidecars.set(`${compressed}.provenance.json`, {
|
|
343
|
+
...sidecars.get(`${path}.provenance.json`),
|
|
344
|
+
...compressedOutput,
|
|
345
|
+
steps: [...steps],
|
|
346
|
+
compression: {
|
|
347
|
+
version: config.compression.version,
|
|
348
|
+
command: config.compression.command,
|
|
349
|
+
hash: compressionStep.hash,
|
|
350
|
+
method: compressionStep.method,
|
|
351
|
+
},
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
await writeReport();
|
|
356
|
+
if (!config.preview?.version?.trim() || !previewStep)
|
|
357
|
+
throw new InputError("target preview command and version are required");
|
|
358
|
+
const previews = [ref];
|
|
359
|
+
for (const scene of ["dusk-rain", "night"]) {
|
|
360
|
+
const path = join(outDir, `${scene}.png`);
|
|
361
|
+
const execution = await targetCommand(config.preview.command, {
|
|
362
|
+
materials: reportPath,
|
|
363
|
+
output: path,
|
|
364
|
+
scene,
|
|
365
|
+
lightRig: JSON.stringify(config.lightRig ?? {}),
|
|
366
|
+
}, commandDir);
|
|
367
|
+
commandResults.push({ ...execution, approval: previewStep });
|
|
368
|
+
const sourceBytes = new Uint8Array(await readFile(path));
|
|
369
|
+
const raster = decodeImage(sourceBytes);
|
|
370
|
+
const digitalSourceType = combineDigitalSourceTypes(outputs.map((o) => o.digitalSourceType));
|
|
371
|
+
const bytes = embedDigitalSourceType(sourceBytes, "image/png", digitalSourceType);
|
|
372
|
+
await writeFile(path, bytes);
|
|
373
|
+
const step = metadataStep(digitalSourceType, [pixelHash(raster)]);
|
|
374
|
+
steps.push(step);
|
|
375
|
+
if (raster.width < 1 || raster.height < 1)
|
|
376
|
+
throw new InputError("target preview returned an empty image");
|
|
377
|
+
previews.push(imageReference(bytes, `target render ${scene}`, path));
|
|
378
|
+
sidecars.set(`${path}.provenance.json`, {
|
|
379
|
+
...common,
|
|
380
|
+
digitalSourceType,
|
|
381
|
+
steps: [...steps],
|
|
382
|
+
path,
|
|
383
|
+
sha256: sha256(bytes),
|
|
384
|
+
preview: {
|
|
385
|
+
scene,
|
|
386
|
+
version: config.preview.version,
|
|
387
|
+
command: config.preview.command,
|
|
388
|
+
hash: previewStep.hash,
|
|
389
|
+
method: previewStep.method,
|
|
390
|
+
lightRig: config.lightRig,
|
|
391
|
+
execution,
|
|
392
|
+
},
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
const text = await call.vision("material-qa", `Image 1 is the flat albedo under neutral key light; image 2 is the target renderer at dusk in rain; image 3 is the target renderer at night. Compare all frames and reject inverted normals, misaligned edges, incorrect wetness/flow response and misplaced glow. Only these spec-named sources may emit: ${namedLightSources.join(", ") || "none"}. Return ONLY JSON {"checks":[{"check":"flat-albedo","passed":true,"reason":"..."},...]} with exactly one verdict for each: ${LIT_CHECKS.join(", ")}.`, previews);
|
|
396
|
+
// A lit verdict filters only where the material-qa model is measured stable; otherwise advisory.
|
|
397
|
+
const lit = applyStability(parseLit(text), { "material-qa": call.route("material-qa") }, {
|
|
398
|
+
checks: MATERIAL_LIT_CHECKS,
|
|
399
|
+
...(options.stability && { entries: options.stability }),
|
|
400
|
+
});
|
|
401
|
+
filtering = mergeFiltering(flickerFiltering, lit.filtering);
|
|
402
|
+
reasons.push(...lit.reasons);
|
|
403
|
+
litComplete = true;
|
|
404
|
+
await writeFile(join(outDir, "preview.html"), '<!doctype html><meta charset="utf-8"><title>Material review</title><p>Review pending</p><div style="display:flex;gap:1em">' +
|
|
405
|
+
["albedo@1x.png", "dusk-rain.png", "night.png"]
|
|
406
|
+
.map((name) => `<figure><img src="${name}"><figcaption>${name}</figcaption></figure>`)
|
|
407
|
+
.join("") +
|
|
408
|
+
"</div>");
|
|
409
|
+
const htmlPath = join(outDir, "preview.html");
|
|
410
|
+
sidecars.set(`${htmlPath}.provenance.json`, {
|
|
411
|
+
...common,
|
|
412
|
+
path: htmlPath,
|
|
413
|
+
sha256: sha256(new Uint8Array(await readFile(htmlPath))),
|
|
414
|
+
method: "material-review-html",
|
|
415
|
+
version: "1",
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
catch (error) {
|
|
419
|
+
if (error && typeof error === "object" && "commandRecord" in error)
|
|
420
|
+
commandResults.push(error.commandRecord);
|
|
421
|
+
reasons.push({
|
|
422
|
+
check: "material-delivery",
|
|
423
|
+
passed: false,
|
|
424
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
425
|
+
source: "deterministic",
|
|
426
|
+
});
|
|
427
|
+
await writeReport();
|
|
428
|
+
throw error;
|
|
429
|
+
}
|
|
430
|
+
return writeReport();
|
|
431
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ParamSchema } from "../transform/schema.ts";
|
|
2
|
+
import type { MaterialChannel } from "./core.ts";
|
|
3
|
+
export declare const MATERIAL_CHANNELS: MaterialChannel[];
|
|
4
|
+
export interface MaterialProfile {
|
|
5
|
+
channels?: MaterialChannel[];
|
|
6
|
+
scales?: (1 | 2 | 4)[];
|
|
7
|
+
flickerBound?: number | Partial<Record<MaterialChannel, number>>;
|
|
8
|
+
encoding?: Partial<Record<MaterialChannel, {
|
|
9
|
+
range: [number, number];
|
|
10
|
+
encoding: "unorm8";
|
|
11
|
+
}>>;
|
|
12
|
+
compression?: {
|
|
13
|
+
command: string[];
|
|
14
|
+
version: string;
|
|
15
|
+
format?: "ktx2" | "basis";
|
|
16
|
+
};
|
|
17
|
+
preview?: {
|
|
18
|
+
command: string[];
|
|
19
|
+
version: string;
|
|
20
|
+
};
|
|
21
|
+
lightRig?: Record<string, unknown>;
|
|
22
|
+
}
|
|
23
|
+
export interface ResolvedMaterialProfile extends MaterialProfile {
|
|
24
|
+
channels: MaterialChannel[];
|
|
25
|
+
scales: (1 | 2 | 4)[];
|
|
26
|
+
flickerBound: number | Partial<Record<MaterialChannel, number>>;
|
|
27
|
+
}
|
|
28
|
+
export declare const MATERIAL_PROFILE_SCHEMA: ParamSchema;
|
|
29
|
+
export declare function resolveMaterialProfile(value: unknown): ResolvedMaterialProfile;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { InputError } from "../errors.js";
|
|
2
|
+
import { validate } from "../transform/schema.js";
|
|
3
|
+
export const MATERIAL_CHANNELS = [
|
|
4
|
+
"normal",
|
|
5
|
+
"height",
|
|
6
|
+
"emissive",
|
|
7
|
+
"roughness",
|
|
8
|
+
"wind",
|
|
9
|
+
];
|
|
10
|
+
const bound = { type: "number", minimum: 0, maximum: 1 };
|
|
11
|
+
const command = {
|
|
12
|
+
type: "object",
|
|
13
|
+
properties: {
|
|
14
|
+
command: { type: "array", items: { type: "string" }, minItems: 1 },
|
|
15
|
+
version: { type: "string" },
|
|
16
|
+
},
|
|
17
|
+
required: ["command", "version"],
|
|
18
|
+
};
|
|
19
|
+
const encoding = {
|
|
20
|
+
type: "object",
|
|
21
|
+
properties: {
|
|
22
|
+
encoding: { type: "string", enum: ["unorm8"], default: "unorm8" },
|
|
23
|
+
range: { type: "array", items: bound, minItems: 2, default: [0, 1] },
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
export const MATERIAL_PROFILE_SCHEMA = {
|
|
27
|
+
type: "object",
|
|
28
|
+
properties: {
|
|
29
|
+
channels: {
|
|
30
|
+
type: "array",
|
|
31
|
+
items: { type: "string", enum: MATERIAL_CHANNELS },
|
|
32
|
+
default: MATERIAL_CHANNELS,
|
|
33
|
+
},
|
|
34
|
+
scales: { type: "array", items: { type: "integer", minimum: 1, maximum: 4 }, default: [1, 2] },
|
|
35
|
+
encoding: {
|
|
36
|
+
type: "object",
|
|
37
|
+
properties: Object.fromEntries(MATERIAL_CHANNELS.map((c) => [c, encoding])),
|
|
38
|
+
},
|
|
39
|
+
compression: {
|
|
40
|
+
...command,
|
|
41
|
+
properties: {
|
|
42
|
+
...command.properties,
|
|
43
|
+
format: { type: "string", enum: ["ktx2", "basis"], default: "ktx2" },
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
preview: command,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
function jsonData(value) {
|
|
50
|
+
if (value === null || typeof value === "string" || typeof value === "boolean")
|
|
51
|
+
return true;
|
|
52
|
+
if (typeof value === "number")
|
|
53
|
+
return Number.isFinite(value);
|
|
54
|
+
if (Array.isArray(value))
|
|
55
|
+
return value.every(jsonData);
|
|
56
|
+
return typeof value === "object" && Object.values(value).every(jsonData);
|
|
57
|
+
}
|
|
58
|
+
export function resolveMaterialProfile(value) {
|
|
59
|
+
if (value === undefined)
|
|
60
|
+
value = {};
|
|
61
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
62
|
+
throw new InputError("style.materials must be an object");
|
|
63
|
+
const { flickerBound, lightRig, ...rest } = value;
|
|
64
|
+
const resolved = validate(MATERIAL_PROFILE_SCHEMA, rest, "style.materials");
|
|
65
|
+
if (new Set(resolved.channels).size !== resolved.channels.length)
|
|
66
|
+
throw new InputError("material channels must be unique");
|
|
67
|
+
if (!resolved.scales.includes(1) ||
|
|
68
|
+
!resolved.scales.includes(2) ||
|
|
69
|
+
resolved.scales.some((s) => ![1, 2, 4].includes(s)) ||
|
|
70
|
+
new Set(resolved.scales).size !== resolved.scales.length)
|
|
71
|
+
throw new InputError("material scales require 1 and 2, optionally 4");
|
|
72
|
+
resolved.flickerBound =
|
|
73
|
+
flickerBound === undefined
|
|
74
|
+
? 0.03
|
|
75
|
+
: typeof flickerBound === "number"
|
|
76
|
+
? validate(bound, flickerBound, "style.materials.flickerBound")
|
|
77
|
+
: validate({
|
|
78
|
+
type: "object",
|
|
79
|
+
properties: Object.fromEntries(MATERIAL_CHANNELS.map((c) => [c, bound])),
|
|
80
|
+
required: resolved.channels,
|
|
81
|
+
}, flickerBound, "style.materials.flickerBound");
|
|
82
|
+
for (const item of Object.values(resolved.encoding ?? {}))
|
|
83
|
+
if (item.range.length !== 2 || item.range[0] > item.range[1])
|
|
84
|
+
throw new InputError("material encoding range must be an ordered pair");
|
|
85
|
+
for (const item of [resolved.compression, resolved.preview])
|
|
86
|
+
if (item && (!item.version.trim() || item.command.some((arg) => !arg.trim())))
|
|
87
|
+
throw new InputError("material command and version must be nonempty");
|
|
88
|
+
if (lightRig !== undefined) {
|
|
89
|
+
if (typeof lightRig !== "object" ||
|
|
90
|
+
lightRig === null ||
|
|
91
|
+
Array.isArray(lightRig) ||
|
|
92
|
+
!jsonData(lightRig))
|
|
93
|
+
throw new InputError("style.materials.lightRig must be a JSON object");
|
|
94
|
+
resolved.lightRig = structuredClone(lightRig);
|
|
95
|
+
}
|
|
96
|
+
return resolved;
|
|
97
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Raster } from "../image/raster.ts";
|
|
2
|
+
import type { MaterialGrid } from "./core.ts";
|
|
3
|
+
export declare function downsample(source: Raster, grid: MaterialGrid, scale: number, native: number, normal: boolean): Raster;
|
|
4
|
+
/** Validate a KTX2 container and its level data; the target is responsible for the actual codec. */
|
|
5
|
+
export declare function checkCompressed(bytes: Uint8Array, width: number, height: number): void;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { InputError } from "../errors.js";
|
|
2
|
+
import { createRaster, getPixel, setPixel } from "../image/raster.js";
|
|
3
|
+
export function downsample(source, grid, scale, native, normal) {
|
|
4
|
+
if (!Number.isInteger(native) ||
|
|
5
|
+
![1, 2, 4].includes(scale) ||
|
|
6
|
+
scale > native ||
|
|
7
|
+
source.width !== grid.width * grid.count * native ||
|
|
8
|
+
source.height !== grid.height * native)
|
|
9
|
+
throw new InputError("material rendition cannot exceed native resolution or change frame grid");
|
|
10
|
+
const factor = native / scale;
|
|
11
|
+
const out = createRaster(grid.width * grid.count * scale, grid.height * scale);
|
|
12
|
+
for (let y = 0; y < out.height; y++)
|
|
13
|
+
for (let x = 0; x < out.width; x++) {
|
|
14
|
+
const sums = [0, 0, 0];
|
|
15
|
+
let alpha = 0;
|
|
16
|
+
for (let sy = Math.floor(y * factor); sy < Math.ceil((y + 1) * factor); sy++)
|
|
17
|
+
for (let sx = Math.floor(x * factor); sx < Math.ceil((x + 1) * factor); sx++) {
|
|
18
|
+
const weight = (Math.min((x + 1) * factor, sx + 1) - Math.max(x * factor, sx)) *
|
|
19
|
+
(Math.min((y + 1) * factor, sy + 1) - Math.max(y * factor, sy));
|
|
20
|
+
const p = getPixel(source, sx, sy);
|
|
21
|
+
alpha += p[3] * weight;
|
|
22
|
+
for (let c = 0; c < 3; c++)
|
|
23
|
+
sums[c] =
|
|
24
|
+
(sums[c] ?? 0) +
|
|
25
|
+
(normal ? p[c] / 127.5 - 1 : p[c]) * p[3] * weight;
|
|
26
|
+
}
|
|
27
|
+
if (!alpha)
|
|
28
|
+
continue;
|
|
29
|
+
let rgb = sums.map((v) => v / alpha);
|
|
30
|
+
if (normal) {
|
|
31
|
+
const length = Math.hypot(...rgb);
|
|
32
|
+
rgb = length ? rgb.map((v) => (v / length + 1) * 127.5) : [128, 128, 255];
|
|
33
|
+
}
|
|
34
|
+
setPixel(out, x, y, [...rgb.map(Math.round), Math.round(alpha / (factor * factor))]);
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
|
38
|
+
/** Validate a KTX2 container and its level data; the target is responsible for the actual codec. */
|
|
39
|
+
export function checkCompressed(bytes, width, height) {
|
|
40
|
+
const signature = [0xab, 0x4b, 0x54, 0x58, 0x20, 0x32, 0x30, 0xbb, 0x0d, 0x0a, 0x1a, 0x0a];
|
|
41
|
+
if (bytes.length < 104 || signature.some((v, i) => bytes[i] !== v))
|
|
42
|
+
throw new InputError("compressor did not produce KTX2");
|
|
43
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
44
|
+
const vk = view.getUint32(12, true), scheme = view.getUint32(44, true);
|
|
45
|
+
if (view.getUint32(20, true) !== width ||
|
|
46
|
+
view.getUint32(24, true) !== height ||
|
|
47
|
+
view.getUint32(28, true) !== 0 ||
|
|
48
|
+
view.getUint32(32, true) !== 0 ||
|
|
49
|
+
view.getUint32(36, true) !== 1 ||
|
|
50
|
+
!view.getUint32(40, true))
|
|
51
|
+
throw new InputError("KTX2 dimensions or levels do not match rendition");
|
|
52
|
+
// KTX 2.0 §3.10: BasisLZ uses ETC1S (163); UASTC (166) permits optional Zstandard.
|
|
53
|
+
const blockCompressed = ((vk >= 131 && vk <= 184) || (vk >= 1000066000 && vk <= 1000066013)) &&
|
|
54
|
+
[0, 2, 3].includes(scheme);
|
|
55
|
+
const dfdOffset = view.getUint32(48, true), dfdLength = view.getUint32(52, true);
|
|
56
|
+
const basisDfd = dfdLength >= 28 && dfdOffset >= 104 && dfdOffset + dfdLength <= bytes.length;
|
|
57
|
+
const model = basisDfd ? bytes[dfdOffset + 12] : undefined;
|
|
58
|
+
if (!(blockCompressed ||
|
|
59
|
+
(vk === 0 &&
|
|
60
|
+
basisDfd &&
|
|
61
|
+
((scheme === 1 && model === 163) || ([0, 2].includes(scheme) && model === 166)))))
|
|
62
|
+
throw new InputError("KTX2 is not GPU-compressed/Basis");
|
|
63
|
+
const levels = view.getUint32(40, true);
|
|
64
|
+
if (80 + levels * 24 > bytes.length)
|
|
65
|
+
throw new InputError("truncated KTX2 level index");
|
|
66
|
+
for (let i = 0; i < levels; i++) {
|
|
67
|
+
const offset = Number(view.getBigUint64(80 + i * 24, true));
|
|
68
|
+
const length = Number(view.getBigUint64(88 + i * 24, true));
|
|
69
|
+
if (!Number.isSafeInteger(offset) ||
|
|
70
|
+
!Number.isSafeInteger(length) ||
|
|
71
|
+
length < 1 ||
|
|
72
|
+
offset < 80 + levels * 24 ||
|
|
73
|
+
offset + length > bytes.length)
|
|
74
|
+
throw new InputError("truncated KTX2 level data");
|
|
75
|
+
}
|
|
76
|
+
}
|