@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,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The audio engine of the transform core (docs/PRD-audio.md, core change 2), beside the raster
|
|
3
|
+
* engine: it decodes and writes PCM WAV through `wavefile` and gives an exact sample hash. Samples
|
|
4
|
+
* are held as 64-bit floats from −1 to 1, scaled from the file's integers by a power of two, so a
|
|
5
|
+
* decoded file written back at its own bit depth has the same samples to the bit.
|
|
6
|
+
*/
|
|
7
|
+
import { createHash } from "node:crypto";
|
|
8
|
+
import wavefile from "wavefile";
|
|
9
|
+
import { InputError } from "../errors.js";
|
|
10
|
+
const { WaveFile } = wavefile;
|
|
11
|
+
/** The engine's name and version, recorded on every step it runs and every file it writes. */
|
|
12
|
+
export const AUDIO_ENGINE = { name: "assetgrove-audio", version: "1.0.0" };
|
|
13
|
+
/** The bit depths the engine reads and writes, as wavefile names them. */
|
|
14
|
+
export const AUDIO_BIT_DEPTHS = ["8", "16", "24", "32", "32f", "64"];
|
|
15
|
+
/** The number of sample frames (samples per channel) of an item. */
|
|
16
|
+
export function frameCount(item) {
|
|
17
|
+
return item.channels[0]?.length ?? 0;
|
|
18
|
+
}
|
|
19
|
+
const FLOAT_DEPTHS = new Set(["32f", "64"]);
|
|
20
|
+
/** WAVE_FORMAT_PCM, WAVE_FORMAT_IEEE_FLOAT and WAVE_FORMAT_EXTENSIBLE. */
|
|
21
|
+
const PCM_FORMATS = new Set([1, 3, 0xfffe]);
|
|
22
|
+
/** The scale of an integer depth: a sample of value `v` is `v / scale`. */
|
|
23
|
+
function scaleOf(bitDepth) {
|
|
24
|
+
return 2 ** (Number.parseInt(bitDepth, 10) - 1);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Decodes a PCM or IEEE-float WAV. Throws an InputError when the bytes are not a WAV, or are a
|
|
28
|
+
* compressed or unsupported one.
|
|
29
|
+
*/
|
|
30
|
+
export function decodeAudio(bytes, name = "audio") {
|
|
31
|
+
let wav;
|
|
32
|
+
try {
|
|
33
|
+
wav = new WaveFile(bytes);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
throw new InputError(`not a WAV file: ${error.message}`, { cause: error });
|
|
37
|
+
}
|
|
38
|
+
const fmt = wav.fmt;
|
|
39
|
+
const bitDepth = wav.bitDepth;
|
|
40
|
+
if (!PCM_FORMATS.has(fmt.audioFormat) ||
|
|
41
|
+
!AUDIO_BIT_DEPTHS.includes(bitDepth)) {
|
|
42
|
+
throw new InputError(`unsupported WAV: format ${fmt.audioFormat}, bit depth ${bitDepth}; ` +
|
|
43
|
+
`the audio engine reads PCM at ${AUDIO_BIT_DEPTHS.join(", ")} bits`);
|
|
44
|
+
}
|
|
45
|
+
if (fmt.numChannels < 1 || fmt.sampleRate < 1)
|
|
46
|
+
throw new InputError("WAV has no channels");
|
|
47
|
+
const raw = wav.getSamples(false, Float64Array);
|
|
48
|
+
const planes = fmt.numChannels === 1 ? [raw] : raw;
|
|
49
|
+
const channels = planes.map((plane) => {
|
|
50
|
+
const out = new Float64Array(plane.length);
|
|
51
|
+
if (FLOAT_DEPTHS.has(bitDepth))
|
|
52
|
+
out.set(plane);
|
|
53
|
+
else if (bitDepth === "8")
|
|
54
|
+
for (let i = 0; i < plane.length; i++)
|
|
55
|
+
out[i] = (plane[i] - 128) / 128;
|
|
56
|
+
else {
|
|
57
|
+
const scale = scaleOf(bitDepth);
|
|
58
|
+
for (let i = 0; i < plane.length; i++)
|
|
59
|
+
out[i] = plane[i] / scale;
|
|
60
|
+
}
|
|
61
|
+
return out;
|
|
62
|
+
});
|
|
63
|
+
return { name, channels, sampleRate: fmt.sampleRate, bitDepth, meta: {} };
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The item's samples interleaved as the file's data chunk holds them: little-endian, at its bit
|
|
67
|
+
* depth. Integer depths round to the nearest step and clamp to the range.
|
|
68
|
+
*/
|
|
69
|
+
export function pcmBytes(item) {
|
|
70
|
+
return toWave(item).data.samples;
|
|
71
|
+
}
|
|
72
|
+
function toWave(item) {
|
|
73
|
+
if (!AUDIO_BIT_DEPTHS.includes(item.bitDepth))
|
|
74
|
+
throw new InputError(`unsupported bit depth ${item.bitDepth}`);
|
|
75
|
+
const count = item.channels.length;
|
|
76
|
+
const frames = frameCount(item);
|
|
77
|
+
if (count < 1)
|
|
78
|
+
throw new InputError("audio has no channels");
|
|
79
|
+
const float = FLOAT_DEPTHS.has(item.bitDepth);
|
|
80
|
+
const interleaved = new Float64Array(frames * count);
|
|
81
|
+
const scale = float ? 1 : scaleOf(item.bitDepth);
|
|
82
|
+
const lo = -scale;
|
|
83
|
+
const hi = scale - 1;
|
|
84
|
+
for (let c = 0; c < count; c++) {
|
|
85
|
+
const plane = item.channels[c];
|
|
86
|
+
if (plane.length !== frames)
|
|
87
|
+
throw new Error("audio channels differ in length");
|
|
88
|
+
for (let i = 0; i < frames; i++) {
|
|
89
|
+
const x = plane[i];
|
|
90
|
+
let v;
|
|
91
|
+
if (float)
|
|
92
|
+
v = item.bitDepth === "32f" ? Math.fround(x) : x;
|
|
93
|
+
else {
|
|
94
|
+
v = Math.min(hi, Math.max(lo, Math.round(x * scale)));
|
|
95
|
+
if (item.bitDepth === "8")
|
|
96
|
+
v += 128;
|
|
97
|
+
}
|
|
98
|
+
interleaved[i * count + c] = v;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const wav = new WaveFile();
|
|
102
|
+
wav.fromScratch(count, item.sampleRate, item.bitDepth, interleaved);
|
|
103
|
+
return wav;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Writes the item as a WAV holding its `fmt ` and `data` chunks and, with a loop, a RIFF `smpl`
|
|
107
|
+
* chunk: one forward loop from frame `start` to `end` (the loop length in frames, exclusive, as
|
|
108
|
+
* Godot reads it).
|
|
109
|
+
*/
|
|
110
|
+
export function encodeWav(item, options = {}) {
|
|
111
|
+
const wav = toWave(item);
|
|
112
|
+
const { loop } = options;
|
|
113
|
+
if (loop !== undefined) {
|
|
114
|
+
Object.assign(wav.smpl, {
|
|
115
|
+
chunkId: "smpl",
|
|
116
|
+
dwManufacturer: 0,
|
|
117
|
+
dwProduct: 0,
|
|
118
|
+
dwSamplePeriod: Math.round(1e9 / item.sampleRate),
|
|
119
|
+
dwMIDIUnityNote: 60,
|
|
120
|
+
dwMIDIPitchFraction: 0,
|
|
121
|
+
dwSMPTEFormat: 0,
|
|
122
|
+
dwSMPTEOffset: 0,
|
|
123
|
+
dwNumSampleLoops: 1,
|
|
124
|
+
dwSamplerData: 0,
|
|
125
|
+
loops: [
|
|
126
|
+
{
|
|
127
|
+
dwName: 0,
|
|
128
|
+
dwType: 0,
|
|
129
|
+
dwStart: loop.start,
|
|
130
|
+
dwEnd: loop.end,
|
|
131
|
+
dwFraction: 0,
|
|
132
|
+
dwPlayCount: 0,
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
return wav.toBuffer();
|
|
138
|
+
}
|
|
139
|
+
/** The first forward loop of a WAV's `smpl` chunk; undefined without one or when the bytes are no WAV. */
|
|
140
|
+
export function readWavLoop(bytes) {
|
|
141
|
+
try {
|
|
142
|
+
const { loops } = new WaveFile(bytes).smpl;
|
|
143
|
+
const found = loops.find((l) => l.dwType === 0);
|
|
144
|
+
return found === undefined ? undefined : { start: found.dwStart, end: found.dwEnd };
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* SHA-256 over `pcm <bitDepth> <channels>x<sampleRate>\n` and the samples as `pcmBytes` gives
|
|
152
|
+
* them: a hash of the sound, not of the file, so other chunks (marks, loop points, credentials)
|
|
153
|
+
* never change it.
|
|
154
|
+
*/
|
|
155
|
+
export function sampleHash(item) {
|
|
156
|
+
return createHash("sha256")
|
|
157
|
+
.update(`pcm ${item.bitDepth} ${item.channels.length}x${item.sampleRate}\n`)
|
|
158
|
+
.update(pcmBytes(item))
|
|
159
|
+
.digest("hex");
|
|
160
|
+
}
|
|
161
|
+
/** A new item from `item` with new samples (and optionally a new rate); meta is merged. */
|
|
162
|
+
export function deriveAudio(item, channels, meta = {}, sampleRate = item.sampleRate) {
|
|
163
|
+
return { ...item, channels, sampleRate, meta: { ...item.meta, ...meta } };
|
|
164
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { ApprovalGate } from "../approvals.ts";
|
|
2
|
+
import type { AssetSpec, TargetProfile } from "../types.ts";
|
|
3
|
+
/** A file the hand-off writes beside the media (`TargetWrite.output.sidecars`). */
|
|
4
|
+
export interface AudioSidecar {
|
|
5
|
+
name: string;
|
|
6
|
+
bytes: Uint8Array;
|
|
7
|
+
mediaType: string;
|
|
8
|
+
field: string;
|
|
9
|
+
extra?: Record<string, unknown>;
|
|
10
|
+
mediaSha256Field?: string;
|
|
11
|
+
/** An Ogg rendition: a C2PA sidecar manifest `<name>.c2pa` is signed beside it. */
|
|
12
|
+
credentials?: true;
|
|
13
|
+
/** A rendition of the media: its entry is also recorded in the provenance's `renditions`. */
|
|
14
|
+
rendition?: true;
|
|
15
|
+
}
|
|
16
|
+
/** `output.loudness`: integrated for ambience and music, maximum momentary for an sfx. */
|
|
17
|
+
export interface ContractLoudness {
|
|
18
|
+
measure: "integrated" | "momentary-max";
|
|
19
|
+
/** LUFS; null when undefined (silence, or an sfx shorter than the 400 ms window). */
|
|
20
|
+
lufs: number | null;
|
|
21
|
+
/** dBTP; null for silence. */
|
|
22
|
+
truePeak: number | null;
|
|
23
|
+
}
|
|
24
|
+
/** One member of a variant set, as `output.variantSet.members` lists it. */
|
|
25
|
+
export interface VariantSetMember {
|
|
26
|
+
assetId: string;
|
|
27
|
+
/**
|
|
28
|
+
* The member's maximum momentary loudness, LUFS; null under the 400 ms window, or when the
|
|
29
|
+
* member could not be measured (then listed in `unmeasured`).
|
|
30
|
+
*/
|
|
31
|
+
lufs: number | null;
|
|
32
|
+
}
|
|
33
|
+
/** `output.variantSet`. */
|
|
34
|
+
export interface ContractVariantSet {
|
|
35
|
+
subject: string;
|
|
36
|
+
/** Every member handed off so far, this one included, ordered by asset id. */
|
|
37
|
+
members: VariantSetMember[];
|
|
38
|
+
/** The sfx kind's loudness target and tolerance the members are normalised to. */
|
|
39
|
+
target: number;
|
|
40
|
+
tolerance: number;
|
|
41
|
+
/** The asset ids of the members whose loudness is outside target ± tolerance. */
|
|
42
|
+
outside: string[];
|
|
43
|
+
/** The asset ids of the members whose master could not be read or decoded, so were not judged. */
|
|
44
|
+
unmeasured: string[];
|
|
45
|
+
}
|
|
46
|
+
/** The set file beside the master that every member's hand-off rewrites (docs/audio.md). */
|
|
47
|
+
export declare const variantSetFileName: (subject: string) => string;
|
|
48
|
+
/**
|
|
49
|
+
* Whether an asset id is a member of `subject`'s variant set: the `sfx` spec schema fixes a member's
|
|
50
|
+
* id to `<subject>-NN` with NN from 01 to 99 (src/audio/kinds.ts), so a plain sfx whose id or
|
|
51
|
+
* subject is the subject itself is no member.
|
|
52
|
+
*/
|
|
53
|
+
export declare function isVariantId(subject: string, assetId: string): boolean;
|
|
54
|
+
/** What `pick` hands off for an audio candidate: the contract fields and the rendition files. */
|
|
55
|
+
export interface ShapedAudio {
|
|
56
|
+
fields: Record<string, unknown>;
|
|
57
|
+
sidecars: AudioSidecar[];
|
|
58
|
+
/** One line per variant-set member outside the set's loudness; empty otherwise. */
|
|
59
|
+
warnings: string[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The contract fields of a picked audio master and the renditions its target asks for. `fields`
|
|
63
|
+
* keeps the candidate's own (`audio`, …) and adds the contract's; each rendition becomes a sidecar
|
|
64
|
+
* whose entry the hand-off completes with its `path`, `sha256` and `masterSha256`.
|
|
65
|
+
*/
|
|
66
|
+
export declare function shapeAudioHandoff(input: {
|
|
67
|
+
profile: TargetProfile;
|
|
68
|
+
spec: AssetSpec;
|
|
69
|
+
targetDir: string;
|
|
70
|
+
/** The gate an `aac` rendition's FFmpeg run is approved through; the developer settings' when absent. */
|
|
71
|
+
gate?: ApprovalGate;
|
|
72
|
+
bytes: Uint8Array;
|
|
73
|
+
fields: Record<string, unknown>;
|
|
74
|
+
sidecars: AudioSidecar[];
|
|
75
|
+
}): Promise<ShapedAudio>;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The audio hand-off contract (docs/audio.md, "Contract"): what `pick` of an audio candidate adds
|
|
3
|
+
* to the hand-off's `output`, so any engine can read a picked sound without a preset. The master's
|
|
4
|
+
* format, loudness and loop points; for a member of a variant set, the set and each member's
|
|
5
|
+
* loudness against the kind's target; and one entry per rendition the profile's `audio.delivery`
|
|
6
|
+
* asks for, with the encoder padding a decoder must drop. Renditions are written beside the master;
|
|
7
|
+
* the hand-off fills their path, hash and `masterSha256` once the master's bytes are final.
|
|
8
|
+
*/
|
|
9
|
+
import { join } from "node:path";
|
|
10
|
+
import { defaultGate } from "../approvals.js";
|
|
11
|
+
import { InputError } from "../errors.js";
|
|
12
|
+
import { libraryConfig, scanCards } from "../library/write.js";
|
|
13
|
+
import { readMedia } from "../library/lfs.js";
|
|
14
|
+
import { audioDelivery, makeRenditions } from "./delivery.js";
|
|
15
|
+
import { decodeAudio, frameCount, readWavLoop } from "./engine.js";
|
|
16
|
+
import { measureLoudness } from "./loudness.js";
|
|
17
|
+
import { OGG_MEDIA_TYPE } from "./ogg.js";
|
|
18
|
+
import { AUDIO_KINDS, audioSettings, loudnessFor } from "./profile.js";
|
|
19
|
+
/** The set file beside the master that every member's hand-off rewrites (docs/audio.md). */
|
|
20
|
+
export const variantSetFileName = (subject) => `${subject}.variant-set.json`;
|
|
21
|
+
const finite = (value) => value !== null && Number.isFinite(value) ? value : null;
|
|
22
|
+
const field = (spec, name) => spec[name];
|
|
23
|
+
function loudnessOf(item, kind) {
|
|
24
|
+
const measured = measureLoudness(item.channels, item.sampleRate);
|
|
25
|
+
return kind === "sfx"
|
|
26
|
+
? {
|
|
27
|
+
measure: "momentary-max",
|
|
28
|
+
lufs: finite(measured.momentaryMax),
|
|
29
|
+
truePeak: finite(measured.truePeak),
|
|
30
|
+
}
|
|
31
|
+
: {
|
|
32
|
+
measure: "integrated",
|
|
33
|
+
lufs: finite(measured.integrated),
|
|
34
|
+
truePeak: finite(measured.truePeak),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Whether an asset id is a member of `subject`'s variant set: the `sfx` spec schema fixes a member's
|
|
39
|
+
* id to `<subject>-NN` with NN from 01 to 99 (src/audio/kinds.ts), so a plain sfx whose id or
|
|
40
|
+
* subject is the subject itself is no member.
|
|
41
|
+
*/
|
|
42
|
+
export function isVariantId(subject, assetId) {
|
|
43
|
+
if (!assetId.startsWith(`${subject}-`))
|
|
44
|
+
return false;
|
|
45
|
+
return /^(0[1-9]|[1-9][0-9])$/.test(assetId.slice(subject.length + 1));
|
|
46
|
+
}
|
|
47
|
+
/** The library's other members of the set, read from their cards and WAV masters. */
|
|
48
|
+
async function libraryMembers(profile, targetDir, subject, assetId) {
|
|
49
|
+
const { root } = libraryConfig(profile, targetDir);
|
|
50
|
+
const members = [];
|
|
51
|
+
for (const card of scanCards(root)) {
|
|
52
|
+
if (card.kind !== "sfx" || card.subject !== subject || card.id === assetId)
|
|
53
|
+
continue;
|
|
54
|
+
if (!isVariantId(subject, card.id))
|
|
55
|
+
continue;
|
|
56
|
+
let lufs = null;
|
|
57
|
+
let unmeasured;
|
|
58
|
+
if (card.resource === undefined)
|
|
59
|
+
unmeasured = "its card names no media";
|
|
60
|
+
else {
|
|
61
|
+
const read = await readMedia(join(card.dir, card.resource)).catch((error) => error);
|
|
62
|
+
if (read instanceof Error)
|
|
63
|
+
unmeasured = `its WAV cannot be read (${read.message})`;
|
|
64
|
+
else if (read.kind === "lfs-pointer")
|
|
65
|
+
unmeasured = "its WAV is a Git LFS pointer (run git lfs pull)";
|
|
66
|
+
else {
|
|
67
|
+
try {
|
|
68
|
+
lufs = loudnessOf(decodeAudio(read.bytes), "sfx").lufs;
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
if (!(error instanceof InputError))
|
|
72
|
+
throw error;
|
|
73
|
+
unmeasured = `its WAV does not decode (${error.message})`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
members.push({ assetId: card.id, lufs, ...(unmeasured !== undefined && { unmeasured }) });
|
|
78
|
+
}
|
|
79
|
+
return members;
|
|
80
|
+
}
|
|
81
|
+
async function variantSetOf(profile, spec, targetDir, own) {
|
|
82
|
+
const subject = spec.subject;
|
|
83
|
+
if (spec.kind !== "sfx" || field(spec, "variant") === undefined || subject === undefined)
|
|
84
|
+
return undefined;
|
|
85
|
+
const { target, tolerance } = loudnessFor(audioSettings(profile).loudness, "sfx");
|
|
86
|
+
const measured = [
|
|
87
|
+
...(await libraryMembers(profile, targetDir, subject, spec.assetId)),
|
|
88
|
+
{ assetId: spec.assetId, lufs: own.lufs },
|
|
89
|
+
].sort((a, b) => (a.assetId < b.assetId ? -1 : a.assetId > b.assetId ? 1 : 0));
|
|
90
|
+
// A member under the 400 ms window has no momentary loudness: true peak alone judges it, so it
|
|
91
|
+
// is never outside the set's loudness. A member that could not be measured is named apart.
|
|
92
|
+
const outside = measured
|
|
93
|
+
.filter((m) => m.lufs !== null && Math.abs(m.lufs - target) > tolerance + 1e-9)
|
|
94
|
+
.map((m) => m.assetId);
|
|
95
|
+
const reasons = new Map(measured.flatMap((m) => (m.unmeasured === undefined ? [] : [[m.assetId, m.unmeasured]])));
|
|
96
|
+
const members = measured.map(({ assetId, lufs }) => ({ assetId, lufs }));
|
|
97
|
+
return {
|
|
98
|
+
set: { subject, members, target, tolerance, outside, unmeasured: [...reasons.keys()] },
|
|
99
|
+
reasons,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The contract fields of a picked audio master and the renditions its target asks for. `fields`
|
|
104
|
+
* keeps the candidate's own (`audio`, …) and adds the contract's; each rendition becomes a sidecar
|
|
105
|
+
* whose entry the hand-off completes with its `path`, `sha256` and `masterSha256`.
|
|
106
|
+
*/
|
|
107
|
+
export async function shapeAudioHandoff(input) {
|
|
108
|
+
const { profile, spec } = input;
|
|
109
|
+
const kind = spec.kind;
|
|
110
|
+
if (!AUDIO_KINDS.includes(kind))
|
|
111
|
+
return { fields: input.fields, sidecars: input.sidecars, warnings: [] };
|
|
112
|
+
const delivery = audioDelivery(profile);
|
|
113
|
+
const master = decodeAudio(input.bytes, spec.assetId);
|
|
114
|
+
const frames = frameCount(master);
|
|
115
|
+
const loudness = loudnessOf(master, kind);
|
|
116
|
+
const wavLoop = readWavLoop(input.bytes);
|
|
117
|
+
const tempo = field(spec, "loop");
|
|
118
|
+
const loop = wavLoop === undefined
|
|
119
|
+
? undefined
|
|
120
|
+
: {
|
|
121
|
+
startFrame: wavLoop.start,
|
|
122
|
+
endFrame: wavLoop.end,
|
|
123
|
+
...(kind === "music" &&
|
|
124
|
+
tempo !== undefined && {
|
|
125
|
+
bpm: tempo.bpm,
|
|
126
|
+
bars: tempo.bars,
|
|
127
|
+
beatsPerBar: tempo.beatsPerBar,
|
|
128
|
+
}),
|
|
129
|
+
};
|
|
130
|
+
const judged = await variantSetOf(profile, spec, input.targetDir, loudness);
|
|
131
|
+
const variantSet = judged?.set;
|
|
132
|
+
const renditions = await makeRenditions(master, delivery, {
|
|
133
|
+
gate: input.gate ?? defaultGate(),
|
|
134
|
+
projectDir: input.targetDir,
|
|
135
|
+
});
|
|
136
|
+
const stem = spec.animationFamily ? `${spec.assetId}-${spec.animationFamily}` : spec.assetId;
|
|
137
|
+
const sidecars = renditions.map((r, i) => ({
|
|
138
|
+
name: `${stem}.${r.extension}`,
|
|
139
|
+
bytes: r.bytes,
|
|
140
|
+
mediaType: r.mediaType,
|
|
141
|
+
field: `renditions.${i}`,
|
|
142
|
+
extra: {
|
|
143
|
+
format: r.format,
|
|
144
|
+
mediaType: r.mediaType,
|
|
145
|
+
codec: r.codec,
|
|
146
|
+
sampleRate: r.sampleRate,
|
|
147
|
+
channels: r.channels,
|
|
148
|
+
paddingStartFrames: r.paddingStartFrames,
|
|
149
|
+
paddingEndFrames: r.paddingEndFrames,
|
|
150
|
+
recipe: r.recipe,
|
|
151
|
+
encoder: r.encoder,
|
|
152
|
+
...(r.tool !== undefined && { tool: r.tool }),
|
|
153
|
+
},
|
|
154
|
+
mediaSha256Field: "masterSha256",
|
|
155
|
+
...(r.mediaType === OGG_MEDIA_TYPE && { credentials: true }),
|
|
156
|
+
rendition: true,
|
|
157
|
+
}));
|
|
158
|
+
// Every member's hand-off rewrites the set file, so it lists the whole set handed off so far
|
|
159
|
+
// whichever member an engine reads it from.
|
|
160
|
+
if (variantSet !== undefined)
|
|
161
|
+
sidecars.push({
|
|
162
|
+
name: variantSetFileName(variantSet.subject),
|
|
163
|
+
bytes: new TextEncoder().encode(`${JSON.stringify(variantSet, null, 2)}\n`),
|
|
164
|
+
mediaType: "application/json",
|
|
165
|
+
field: "variantSet.file",
|
|
166
|
+
});
|
|
167
|
+
const fields = {
|
|
168
|
+
...input.fields,
|
|
169
|
+
sampleRate: master.sampleRate,
|
|
170
|
+
channels: master.channels.length,
|
|
171
|
+
durationS: frames / master.sampleRate,
|
|
172
|
+
frames,
|
|
173
|
+
loudness,
|
|
174
|
+
...(loop !== undefined && { loop }),
|
|
175
|
+
...(variantSet !== undefined && { variantSet: { ...variantSet } }),
|
|
176
|
+
masterInSourceOnly: delivery.masterInSourceOnly,
|
|
177
|
+
renditions: [],
|
|
178
|
+
};
|
|
179
|
+
const warnings = [];
|
|
180
|
+
if (variantSet !== undefined && variantSet.outside.length > 0)
|
|
181
|
+
warnings.push(`variant set "${variantSet.subject}": ${variantSet.outside.join(", ")} ${variantSet.outside.length === 1 ? "is" : "are"} outside ${variantSet.target} ± ${variantSet.tolerance} LUFS (maximum momentary loudness)`);
|
|
182
|
+
for (const [id, reason] of judged?.reasons ?? [])
|
|
183
|
+
warnings.push(`variant set "${variantSet.subject}": ${id} could not be measured, so its loudness was not judged: ${reason}`);
|
|
184
|
+
return { fields, sidecars: [...input.sidecars, ...sidecars], warnings };
|
|
185
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Generator } from "../generators/generator.ts";
|
|
2
|
+
export declare const sfxGenerator: Generator;
|
|
3
|
+
export declare const ambienceGenerator: Generator;
|
|
4
|
+
export declare const musicGenerator: Generator;
|
|
5
|
+
/** Core's audio kinds, in the order the registry lists them. */
|
|
6
|
+
export declare const audioGenerators: Generator[];
|