@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,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The target profile's `audio` block (docs/PRD-audio.md, "Media" and "Loudness"): the sample rate,
|
|
3
|
+
* bit depth and channel layout of each audio kind's master, the tolerances its exact checks use, and
|
|
4
|
+
* the `loudness` block, which has no default. An audio kind on a profile without `audio.loudness`
|
|
5
|
+
* is refused at plan, naming the block.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
import { InputError } from "../errors.js";
|
|
9
|
+
/** Core's audio kinds. */
|
|
10
|
+
export const AUDIO_KINDS = ["sfx", "ambience", "music"];
|
|
11
|
+
export const AUDIO_DEFAULTS = {
|
|
12
|
+
sampleRate: 44100,
|
|
13
|
+
bitDepth: "16",
|
|
14
|
+
channels: { sfx: "mono", ambience: "stereo", music: "stereo" },
|
|
15
|
+
durationToleranceS: 0.5,
|
|
16
|
+
silenceLimitMs: 50,
|
|
17
|
+
setSpreadLu: 2,
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* The EBU R128 reference `init` offers for `audio.loudness`: −23 LUFS integrated and a −1 dBTP
|
|
21
|
+
* true-peak ceiling (EBU R 128, "Loudness normalisation and permitted maximum level of audio
|
|
22
|
+
* signals"; EBU Tech 3343 for production practice). Offered, never written as a default.
|
|
23
|
+
*/
|
|
24
|
+
export const EBU_R128_REFERENCE = {
|
|
25
|
+
target: -23,
|
|
26
|
+
truePeakCeiling: -1,
|
|
27
|
+
source: "EBU R 128 (loudness normalisation and permitted maximum level of audio signals), https://tech.ebu.ch/publications/r128",
|
|
28
|
+
};
|
|
29
|
+
const finite = z.number().finite();
|
|
30
|
+
/** The `loudness` block's schema, shared by the profile and the developer settings. */
|
|
31
|
+
const kindLoudnessSchema = z.strictObject({
|
|
32
|
+
target: finite.max(0).optional(),
|
|
33
|
+
tolerance: finite.min(0).optional(),
|
|
34
|
+
truePeakCeiling: finite.max(0).optional(),
|
|
35
|
+
});
|
|
36
|
+
export const audioLoudnessSchema = z.strictObject({
|
|
37
|
+
target: finite.max(0),
|
|
38
|
+
tolerance: finite.min(0),
|
|
39
|
+
truePeakCeiling: finite.max(0),
|
|
40
|
+
encoderHeadroom: finite.min(0),
|
|
41
|
+
music: kindLoudnessSchema.optional(),
|
|
42
|
+
ambience: kindLoudnessSchema.optional(),
|
|
43
|
+
sfx: kindLoudnessSchema.optional(),
|
|
44
|
+
});
|
|
45
|
+
/** What a kind's masters aim for and are judged by: its own values, each falling back to the block's. */
|
|
46
|
+
export function loudnessFor(loudness, kind) {
|
|
47
|
+
const own = loudness[kind];
|
|
48
|
+
return {
|
|
49
|
+
target: own?.target ?? loudness.target,
|
|
50
|
+
tolerance: own?.tolerance ?? loudness.tolerance,
|
|
51
|
+
truePeakCeiling: own?.truePeakCeiling ?? loudness.truePeakCeiling,
|
|
52
|
+
encoderHeadroom: loudness.encoderHeadroom,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** The formats a target may ship. */
|
|
56
|
+
export const DELIVERY_FORMATS = ["wav", "vorbis", "opus", "aac"];
|
|
57
|
+
/** The profile's `audio.delivery` block's schema. */
|
|
58
|
+
export const audioDeliverySchema = z
|
|
59
|
+
.strictObject({
|
|
60
|
+
formats: z.array(z.enum(DELIVERY_FORMATS)).min(1).optional(),
|
|
61
|
+
masterInSourceOnly: z.boolean().optional(),
|
|
62
|
+
})
|
|
63
|
+
.superRefine((block, context) => {
|
|
64
|
+
const formats = block.formats ?? ["wav"];
|
|
65
|
+
if (new Set(formats).size !== formats.length)
|
|
66
|
+
context.addIssue({ code: "custom", path: ["formats"], message: "lists a format twice" });
|
|
67
|
+
if (block.masterInSourceOnly === true && formats.includes("wav"))
|
|
68
|
+
context.addIssue({
|
|
69
|
+
code: "custom",
|
|
70
|
+
path: ["masterInSourceOnly"],
|
|
71
|
+
message: "keeps the master WAV out of the hand-off, so formats must list only renditions (vorbis, opus, aac)",
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
const layout = z.enum(["mono", "stereo"]);
|
|
75
|
+
/** The profile's `audio` block's schema. */
|
|
76
|
+
export const audioProfileSchema = z.strictObject({
|
|
77
|
+
sampleRate: z.number().int().min(1000).optional(),
|
|
78
|
+
bitDepth: z.enum(["8", "16", "24", "32", "32f", "64"]).optional(),
|
|
79
|
+
channels: z
|
|
80
|
+
.strictObject({ sfx: layout.optional(), ambience: layout.optional(), music: layout.optional() })
|
|
81
|
+
.optional(),
|
|
82
|
+
loudness: audioLoudnessSchema.optional(),
|
|
83
|
+
durationToleranceS: finite.min(0).optional(),
|
|
84
|
+
silenceLimitMs: finite.min(0).optional(),
|
|
85
|
+
setSpreadLu: finite.min(0).optional(),
|
|
86
|
+
delivery: audioDeliverySchema.optional(),
|
|
87
|
+
});
|
|
88
|
+
/**
|
|
89
|
+
* The profile's `audio` block with its defaults; throws an InputError naming `audio.loudness` when
|
|
90
|
+
* the profile has no loudness block, and naming the field when the block is invalid.
|
|
91
|
+
*/
|
|
92
|
+
export function audioSettings(profile) {
|
|
93
|
+
const parsed = audioProfileSchema.safeParse(profile.audio ?? {});
|
|
94
|
+
if (!parsed.success)
|
|
95
|
+
throw new InputError(`the target profile "${profile.name}" has an invalid audio block: ${parsed.error.issues
|
|
96
|
+
.flatMap((issue) => issue.code === "unrecognized_keys"
|
|
97
|
+
? issue.keys.map((key) => `audio.${[...issue.path, key].join(".")}: ${issue.message}`)
|
|
98
|
+
: [`audio.${issue.path.join(".")}: ${issue.message}`])
|
|
99
|
+
.join("; ")}`);
|
|
100
|
+
const block = parsed.data;
|
|
101
|
+
if (block.loudness === undefined)
|
|
102
|
+
throw new InputError(`the target profile "${profile.name}" has no audio.loudness block (target, tolerance, truePeakCeiling, encoderHeadroom), which audio kinds need and which has no default; set it in the profile, or in the developer settings' audio.loudness for a headless setup (EBU R128's reference is ${EBU_R128_REFERENCE.target} LUFS and ${EBU_R128_REFERENCE.truePeakCeiling} dBTP)`);
|
|
103
|
+
return {
|
|
104
|
+
sampleRate: block.sampleRate ?? AUDIO_DEFAULTS.sampleRate,
|
|
105
|
+
bitDepth: block.bitDepth ?? AUDIO_DEFAULTS.bitDepth,
|
|
106
|
+
channels: { ...AUDIO_DEFAULTS.channels, ...block.channels },
|
|
107
|
+
loudness: block.loudness,
|
|
108
|
+
durationToleranceS: block.durationToleranceS ?? AUDIO_DEFAULTS.durationToleranceS,
|
|
109
|
+
silenceLimitMs: block.silenceLimitMs ?? AUDIO_DEFAULTS.silenceLimitMs,
|
|
110
|
+
setSpreadLu: block.setSpreadLu ?? AUDIO_DEFAULTS.setSpreadLu,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/** The profile's variant-set loudness spread, LU, which needs no `audio.loudness` block. */
|
|
114
|
+
export function audioSetSpread(profile) {
|
|
115
|
+
const parsed = audioProfileSchema.safeParse(profile.audio ?? {});
|
|
116
|
+
return (parsed.success ? parsed.data.setSpreadLu : undefined) ?? AUDIO_DEFAULTS.setSpreadLu;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The profile with the developer settings' `audio.loudness` filled in where the profile has none:
|
|
120
|
+
* how a headless setup sets the block. A profile's own block wins; the profile given is unchanged.
|
|
121
|
+
*/
|
|
122
|
+
export function withSettingsLoudness(profile, settingsLoudness) {
|
|
123
|
+
if (settingsLoudness === undefined || profile.audio?.loudness !== undefined)
|
|
124
|
+
return profile;
|
|
125
|
+
return { ...profile, audio: { ...profile.audio, loudness: settingsLoudness } };
|
|
126
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { DigitalSourceType, SourceDeclaration } from "../metadata.ts";
|
|
2
|
+
import type { Recipe, RecipeStep, TransformStep } from "../transform/types.ts";
|
|
3
|
+
import type { AudioItem } from "./engine.ts";
|
|
4
|
+
export interface AudioRunOptions {
|
|
5
|
+
digitalSourceType?: DigitalSourceType;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Runs one audio operation over the items and returns the new items and its one provenance step.
|
|
9
|
+
* The items given are not changed.
|
|
10
|
+
*/
|
|
11
|
+
export declare function runAudioOperation(items: AudioItem[], step: RecipeStep, options?: AudioRunOptions): Promise<{
|
|
12
|
+
items: AudioItem[];
|
|
13
|
+
step: TransformStep;
|
|
14
|
+
}>;
|
|
15
|
+
/** Runs a recipe's steps in order over audio items. */
|
|
16
|
+
export declare function runAudioRecipe(recipe: Recipe, items: AudioItem[], options?: AudioRunOptions): Promise<{
|
|
17
|
+
items: AudioItem[];
|
|
18
|
+
steps: TransformStep[];
|
|
19
|
+
}>;
|
|
20
|
+
export interface AudioSourceFile {
|
|
21
|
+
digitalSourceType: DigitalSourceType;
|
|
22
|
+
name: string;
|
|
23
|
+
path: string;
|
|
24
|
+
sha256: string;
|
|
25
|
+
mediaType: "audio/wav";
|
|
26
|
+
samples: string;
|
|
27
|
+
decodedBy: {
|
|
28
|
+
name: string;
|
|
29
|
+
version: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface AudioOutputFile {
|
|
33
|
+
digitalSourceType: DigitalSourceType;
|
|
34
|
+
name: string;
|
|
35
|
+
path: string;
|
|
36
|
+
sha256: string;
|
|
37
|
+
/** A WAV master, or an Ogg Vorbis rendition when the recipe ends in `encode`. */
|
|
38
|
+
mediaType: "audio/wav" | "audio/ogg";
|
|
39
|
+
sampleRate: number;
|
|
40
|
+
channels: number;
|
|
41
|
+
frames: number;
|
|
42
|
+
bitDepth: string;
|
|
43
|
+
samples: string;
|
|
44
|
+
/** The encoder that wrote the bytes; for an Ogg, the libvorbis build, its vendor and licence. */
|
|
45
|
+
encodedBy: {
|
|
46
|
+
name: string;
|
|
47
|
+
version: string;
|
|
48
|
+
vendor?: string;
|
|
49
|
+
license?: string;
|
|
50
|
+
};
|
|
51
|
+
/** For an Ogg: the libvorbis quality it was encoded at. */
|
|
52
|
+
quality?: number;
|
|
53
|
+
meta?: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
/** The provenance record of an audio transformation: sources, every step, outputs. */
|
|
56
|
+
export interface AudioTransformRecord {
|
|
57
|
+
generator: "transform";
|
|
58
|
+
sourceDeclaration?: SourceDeclaration;
|
|
59
|
+
recipe?: {
|
|
60
|
+
name?: string;
|
|
61
|
+
description?: string;
|
|
62
|
+
};
|
|
63
|
+
sources: AudioSourceFile[];
|
|
64
|
+
steps: TransformStep[];
|
|
65
|
+
outputs: AudioOutputFile[];
|
|
66
|
+
}
|
|
67
|
+
export interface TransformAudioFilesOptions extends AudioRunOptions {
|
|
68
|
+
dryRun?: boolean;
|
|
69
|
+
inputName?: string;
|
|
70
|
+
recipe: Recipe;
|
|
71
|
+
inputs: string[];
|
|
72
|
+
/** A `.wav` (`.ogg` for a recipe ending in `encode`) file path for one output; otherwise a directory. */
|
|
73
|
+
out: string;
|
|
74
|
+
}
|
|
75
|
+
/** Reads WAV inputs, runs the recipe, writes the WAV outputs and the provenance record. */
|
|
76
|
+
export declare function transformAudioFiles(options: TransformAudioFilesOptions): Promise<{
|
|
77
|
+
record: AudioTransformRecord;
|
|
78
|
+
provenancePath: string;
|
|
79
|
+
plannedFiles: {
|
|
80
|
+
path: string;
|
|
81
|
+
bytes: Uint8Array;
|
|
82
|
+
}[];
|
|
83
|
+
}>;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Running audio operations and recipes. `runAudioOperation` and `runAudioRecipe` work on items in
|
|
3
|
+
* memory; `transformAudioFiles` reads WAV files, runs a recipe and writes the outputs with their
|
|
4
|
+
* provenance record, as `transformFiles` does for images.
|
|
5
|
+
*/
|
|
6
|
+
import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
7
|
+
import { basename, dirname, extname, join, resolve } from "node:path";
|
|
8
|
+
import { InputError } from "../errors.js";
|
|
9
|
+
import { DIGITAL_SOURCE_TYPES, embedDigitalSourceType, metadataStep, readDigitalSourceType, sourceDeclaration, } from "../metadata.js";
|
|
10
|
+
import { sha256 } from "../request.js";
|
|
11
|
+
import { operationSpec } from "../transform/operations.js";
|
|
12
|
+
import { checkStep } from "../transform/run.js";
|
|
13
|
+
import { AUDIO_ENGINE, decodeAudio, encodeWav, frameCount, sampleHash } from "./engine.js";
|
|
14
|
+
import { encodeOgg, oggEncoder } from "./ogg.js";
|
|
15
|
+
import { AUDIO_IMPLEMENTATIONS } from "./operations.js";
|
|
16
|
+
/**
|
|
17
|
+
* Runs one audio operation over the items and returns the new items and its one provenance step.
|
|
18
|
+
* The items given are not changed.
|
|
19
|
+
*/
|
|
20
|
+
export async function runAudioOperation(items, step, options = {}) {
|
|
21
|
+
const spec = operationSpec(step.op);
|
|
22
|
+
const params = checkStep(step);
|
|
23
|
+
const impl = AUDIO_IMPLEMENTATIONS[step.op];
|
|
24
|
+
if (spec?.media !== "audio" || !impl)
|
|
25
|
+
throw new InputError(`${step.op} is an image operation and cannot run on audio`);
|
|
26
|
+
if (step.engine !== undefined && step.engine !== AUDIO_ENGINE.name)
|
|
27
|
+
throw new InputError(`${step.op} runs on "${AUDIO_ENGINE.name}", not "${step.engine}"`);
|
|
28
|
+
if (items.some((item) => item.encoding !== undefined))
|
|
29
|
+
throw new InputError(`${step.op} comes after encode, which is the last step: an encoded rendition is not changed`);
|
|
30
|
+
const context = {};
|
|
31
|
+
const reports = [];
|
|
32
|
+
const out = [];
|
|
33
|
+
for (const item of items) {
|
|
34
|
+
const result = await impl(item, params, context);
|
|
35
|
+
if (result.report)
|
|
36
|
+
reports.push(result.report);
|
|
37
|
+
for (const output of result.items)
|
|
38
|
+
out.push({
|
|
39
|
+
...output,
|
|
40
|
+
digitalSourceType: output.digitalSourceType ??
|
|
41
|
+
item.digitalSourceType ??
|
|
42
|
+
options.digitalSourceType ??
|
|
43
|
+
DIGITAL_SOURCE_TYPES.undeclared,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const report = reports.length === 0 ? undefined : reports.length === 1 ? reports[0] : { perInput: reports };
|
|
47
|
+
return {
|
|
48
|
+
items: out,
|
|
49
|
+
step: {
|
|
50
|
+
op: step.op,
|
|
51
|
+
params,
|
|
52
|
+
engine: { name: AUDIO_ENGINE.name, version: AUDIO_ENGINE.version },
|
|
53
|
+
inputs: items.map(sampleHash),
|
|
54
|
+
outputs: out.map(sampleHash),
|
|
55
|
+
...(report !== undefined && { report }),
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/** Runs a recipe's steps in order over audio items. */
|
|
60
|
+
export async function runAudioRecipe(recipe, items, options = {}) {
|
|
61
|
+
const steps = [];
|
|
62
|
+
let current = items;
|
|
63
|
+
for (const s of recipe.steps) {
|
|
64
|
+
const result = await runAudioOperation(current, s, options);
|
|
65
|
+
current = result.items;
|
|
66
|
+
steps.push(result.step);
|
|
67
|
+
}
|
|
68
|
+
return { items: current, steps };
|
|
69
|
+
}
|
|
70
|
+
/** Reads WAV inputs, runs the recipe, writes the WAV outputs and the provenance record. */
|
|
71
|
+
export async function transformAudioFiles(options) {
|
|
72
|
+
if (options.inputs.length === 0)
|
|
73
|
+
throw new InputError("no input audio given");
|
|
74
|
+
if (options.inputName !== undefined &&
|
|
75
|
+
(options.inputs.length !== 1 || !/^[A-Za-z0-9][A-Za-z0-9_.-]*$/.test(options.inputName)))
|
|
76
|
+
throw new InputError("inputName requires one input and a safe file stem");
|
|
77
|
+
const sources = [];
|
|
78
|
+
const items = [];
|
|
79
|
+
const seen = new Set();
|
|
80
|
+
for (const path of options.inputs) {
|
|
81
|
+
let bytes;
|
|
82
|
+
try {
|
|
83
|
+
bytes = new Uint8Array(await readFile(path));
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
throw new InputError(`cannot read ${path}: ${error.message}`, { cause: error });
|
|
87
|
+
}
|
|
88
|
+
let name = options.inputName ?? basename(path, extname(path));
|
|
89
|
+
for (let n = 2; seen.has(name); n++)
|
|
90
|
+
name = `${basename(path, extname(path))}-${n}`;
|
|
91
|
+
seen.add(name);
|
|
92
|
+
let item;
|
|
93
|
+
try {
|
|
94
|
+
item = decodeAudio(bytes, name);
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
throw new InputError(`cannot decode ${path}: ${error.message}`, { cause: error });
|
|
98
|
+
}
|
|
99
|
+
const digitalSourceType = readDigitalSourceType(bytes, "audio/wav") ??
|
|
100
|
+
options.digitalSourceType ??
|
|
101
|
+
DIGITAL_SOURCE_TYPES.undeclared;
|
|
102
|
+
item.digitalSourceType = digitalSourceType;
|
|
103
|
+
items.push(item);
|
|
104
|
+
sources.push({
|
|
105
|
+
name,
|
|
106
|
+
path,
|
|
107
|
+
sha256: sha256(bytes),
|
|
108
|
+
mediaType: "audio/wav",
|
|
109
|
+
samples: sampleHash(item),
|
|
110
|
+
digitalSourceType,
|
|
111
|
+
decodedBy: { name: AUDIO_ENGINE.name, version: AUDIO_ENGINE.version },
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
const { items: results, steps } = await runAudioRecipe(options.recipe, items, options);
|
|
115
|
+
if (results.length === 0)
|
|
116
|
+
throw new InputError("the recipe produced no output");
|
|
117
|
+
const out = resolve(options.out);
|
|
118
|
+
const isDir = await stat(out).then((s) => s.isDirectory(), () => false);
|
|
119
|
+
const single = results.length === 1 && extname(out) !== "" && !isDir;
|
|
120
|
+
const extension = (item) => (item.encoding ? ".ogg" : ".wav");
|
|
121
|
+
if (single && extname(out).toLowerCase() !== extension(results[0]))
|
|
122
|
+
throw new InputError(`refused: ${out} names a ${extname(out)} file but the output is ${results[0].encoding?.mediaType ?? "audio/wav"}; use a ${extension(results[0])} path`);
|
|
123
|
+
const dir = single ? dirname(out) : out;
|
|
124
|
+
const inputs = new Set(options.inputs.map((p) => resolve(p)));
|
|
125
|
+
const planned = results.map((item) => {
|
|
126
|
+
const path = single ? out : join(dir, `${item.name}${extension(item)}`);
|
|
127
|
+
if (inputs.has(path))
|
|
128
|
+
throw new InputError(`refused: ${path} is an input; sources are never overwritten`);
|
|
129
|
+
return { item, path };
|
|
130
|
+
});
|
|
131
|
+
if (new Set(planned.map((p) => p.path)).size !== planned.length)
|
|
132
|
+
throw new InputError("two outputs share a name");
|
|
133
|
+
const provenancePath = single ? `${out}.provenance.json` : join(dir, "provenance.json");
|
|
134
|
+
if (inputs.has(provenancePath))
|
|
135
|
+
throw new InputError(`refused: ${provenancePath} is an input`);
|
|
136
|
+
if (!options.dryRun)
|
|
137
|
+
await mkdir(dir, { recursive: true });
|
|
138
|
+
const plannedFiles = [];
|
|
139
|
+
const outputs = [];
|
|
140
|
+
for (const { item, path } of planned) {
|
|
141
|
+
const digitalSourceType = item.digitalSourceType ?? DIGITAL_SOURCE_TYPES.undeclared;
|
|
142
|
+
const samples = sampleHash(item);
|
|
143
|
+
const mediaType = item.encoding?.mediaType ?? "audio/wav";
|
|
144
|
+
// An Ogg's stream serial comes from its samples, so the same sound encodes to the same bytes.
|
|
145
|
+
const encoded = item.encoding
|
|
146
|
+
? await encodeOgg(item, item.encoding.quality, Number.parseInt(samples.slice(0, 8), 16))
|
|
147
|
+
: encodeWav(item);
|
|
148
|
+
const bytes = embedDigitalSourceType(encoded, mediaType, digitalSourceType);
|
|
149
|
+
steps.push(metadataStep(digitalSourceType, [samples]));
|
|
150
|
+
plannedFiles.push({ path, bytes });
|
|
151
|
+
if (!options.dryRun)
|
|
152
|
+
await writeFile(path, bytes);
|
|
153
|
+
const meta = Object.keys(item.meta).length === 0 ? undefined : structuredClone(item.meta);
|
|
154
|
+
outputs.push({
|
|
155
|
+
name: item.name,
|
|
156
|
+
digitalSourceType,
|
|
157
|
+
path,
|
|
158
|
+
sha256: sha256(bytes),
|
|
159
|
+
mediaType,
|
|
160
|
+
sampleRate: item.sampleRate,
|
|
161
|
+
channels: item.channels.length,
|
|
162
|
+
frames: frameCount(item),
|
|
163
|
+
bitDepth: item.bitDepth,
|
|
164
|
+
samples,
|
|
165
|
+
encodedBy: item.encoding
|
|
166
|
+
? await oggEncoder()
|
|
167
|
+
: { name: AUDIO_ENGINE.name, version: AUDIO_ENGINE.version },
|
|
168
|
+
...(item.encoding && { quality: item.encoding.quality }),
|
|
169
|
+
...(meta !== undefined && { meta }),
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
const record = {
|
|
173
|
+
generator: "transform",
|
|
174
|
+
...(options.digitalSourceType !== undefined && {
|
|
175
|
+
sourceDeclaration: sourceDeclaration(options.digitalSourceType),
|
|
176
|
+
}),
|
|
177
|
+
...((options.recipe.name !== undefined || options.recipe.description !== undefined) && {
|
|
178
|
+
recipe: {
|
|
179
|
+
...(options.recipe.name !== undefined && { name: options.recipe.name }),
|
|
180
|
+
...(options.recipe.description !== undefined && {
|
|
181
|
+
description: options.recipe.description,
|
|
182
|
+
}),
|
|
183
|
+
},
|
|
184
|
+
}),
|
|
185
|
+
sources,
|
|
186
|
+
steps,
|
|
187
|
+
outputs,
|
|
188
|
+
};
|
|
189
|
+
if (!options.dryRun)
|
|
190
|
+
await writeFile(provenancePath, `${JSON.stringify(record, null, 2)}\n`);
|
|
191
|
+
return { record, provenancePath, plannedFiles };
|
|
192
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** The codec of an Ogg: Vorbis or Opus, from its first packet. */
|
|
2
|
+
export declare function oggCodec(bytes: Uint8Array): "vorbis" | "opus";
|
|
3
|
+
/** A packet of an Ogg stream and the granule position of the page it ends on. */
|
|
4
|
+
export interface OggPacket {
|
|
5
|
+
data: Uint8Array;
|
|
6
|
+
granule: number;
|
|
7
|
+
}
|
|
8
|
+
/** Every packet of an Ogg, in order, each with the granule position of the page that completes it. */
|
|
9
|
+
export declare function oggPackets(bytes: Uint8Array): OggPacket[];
|
|
10
|
+
/** A Vorbis comment header: the encoder's vendor string and its `NAME=value` fields, in order. */
|
|
11
|
+
export interface VorbisComments {
|
|
12
|
+
vendor: string;
|
|
13
|
+
comments: string[];
|
|
14
|
+
}
|
|
15
|
+
/** The comment header of an Ogg Vorbis or Ogg Opus file. */
|
|
16
|
+
export declare function readVorbisComments(bytes: Uint8Array): VorbisComments;
|
|
17
|
+
/** The value of the first comment named `name` (case-insensitive, as Vorbis field names are). */
|
|
18
|
+
export declare function vorbisComment(comments: VorbisComments, name: string): string | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Sets Vorbis comments: every existing field with one of `fields`' names is removed, and each
|
|
21
|
+
* defined value is added. The vendor string and the other fields stay; the audio is untouched.
|
|
22
|
+
*/
|
|
23
|
+
export declare function setVorbisComments(bytes: Uint8Array, fields: Record<string, string | undefined>): Uint8Array;
|
|
24
|
+
/** Sets the stream serial number of every page and recomputes the CRCs. */
|
|
25
|
+
export declare function setOggSerial(bytes: Uint8Array, serial: number): Uint8Array;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The comment header of an Ogg Vorbis or Ogg Opus file, where the AI mark of an Ogg rendition
|
|
3
|
+
* lives (docs/PRD-audio.md, "Marks"). Core never decodes an Ogg: this reads and rewrites only the
|
|
4
|
+
* header packets (Vorbis: identification, comment, setup; Opus: `OpusHead` and `OpusTags`, whose
|
|
5
|
+
* comments share the Vorbis layout without the framing bit, RFC 7845 §5.2) and renumbers the audio
|
|
6
|
+
* pages after them, leaving the audio untouched.
|
|
7
|
+
* `@audio/encode-ogg/meta` writes a fixed set of tags and drops every other field, and
|
|
8
|
+
* music-metadata only reads, so this rewrite is a recorded exception (docs/decisions.md).
|
|
9
|
+
*/
|
|
10
|
+
import { InputError } from "../errors.js";
|
|
11
|
+
function pages(bytes) {
|
|
12
|
+
const out = [];
|
|
13
|
+
let at = 0;
|
|
14
|
+
while (at < bytes.length) {
|
|
15
|
+
if (at + 27 > bytes.length ||
|
|
16
|
+
bytes[at] !== 0x4f ||
|
|
17
|
+
bytes[at + 1] !== 0x67 ||
|
|
18
|
+
bytes[at + 2] !== 0x67 ||
|
|
19
|
+
bytes[at + 3] !== 0x53)
|
|
20
|
+
throw new InputError(`not an Ogg file: no page at byte ${at}`);
|
|
21
|
+
const count = bytes[at + 26];
|
|
22
|
+
const segments = [...bytes.subarray(at + 27, at + 27 + count)];
|
|
23
|
+
const payloadStart = at + 27 + count;
|
|
24
|
+
const end = payloadStart + segments.reduce((a, b) => a + b, 0);
|
|
25
|
+
if (end > bytes.length)
|
|
26
|
+
throw new InputError("not an Ogg file: a page is cut short");
|
|
27
|
+
out.push({ start: at, end, flags: bytes[at + 5], segments, payloadStart });
|
|
28
|
+
at = end;
|
|
29
|
+
}
|
|
30
|
+
return out;
|
|
31
|
+
}
|
|
32
|
+
let crcTable;
|
|
33
|
+
/** Ogg's CRC-32: polynomial 0x04C11DB7, initial value 0, no reflection, no final XOR. */
|
|
34
|
+
function oggCrc(data) {
|
|
35
|
+
if (crcTable === undefined) {
|
|
36
|
+
crcTable = new Uint32Array(256);
|
|
37
|
+
for (let i = 0; i < 256; i++) {
|
|
38
|
+
let r = i << 24;
|
|
39
|
+
for (let j = 0; j < 8; j++)
|
|
40
|
+
r = r & 0x80000000 ? (r << 1) ^ 0x04c11db7 : r << 1;
|
|
41
|
+
crcTable[i] = r >>> 0;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
let crc = 0;
|
|
45
|
+
for (const byte of data)
|
|
46
|
+
crc = ((crc << 8) ^ crcTable[((crc >>> 24) ^ byte) & 0xff]) >>> 0;
|
|
47
|
+
return crc;
|
|
48
|
+
}
|
|
49
|
+
/** Sets a page's serial and sequence number and recomputes its CRC, in place. */
|
|
50
|
+
function stamp(page, serial, sequence) {
|
|
51
|
+
const view = new DataView(page.buffer, page.byteOffset, page.byteLength);
|
|
52
|
+
view.setUint32(14, serial, true);
|
|
53
|
+
view.setUint32(18, sequence, true);
|
|
54
|
+
view.setUint32(22, 0, true);
|
|
55
|
+
view.setUint32(22, oggCrc(page), true);
|
|
56
|
+
return page;
|
|
57
|
+
}
|
|
58
|
+
/** Laces whole packets into header pages (granule 0); the first page gets `firstFlags`. */
|
|
59
|
+
function lace(packets, firstFlags) {
|
|
60
|
+
const lengths = [];
|
|
61
|
+
for (const p of packets) {
|
|
62
|
+
for (let n = Math.floor(p.length / 255); n > 0; n--)
|
|
63
|
+
lengths.push(255);
|
|
64
|
+
lengths.push(p.length % 255);
|
|
65
|
+
}
|
|
66
|
+
const data = Buffer.concat(packets);
|
|
67
|
+
const out = [];
|
|
68
|
+
let segment = 0;
|
|
69
|
+
let offset = 0;
|
|
70
|
+
let continued = false;
|
|
71
|
+
while (segment < lengths.length) {
|
|
72
|
+
const table = lengths.slice(segment, segment + 255);
|
|
73
|
+
const size = table.reduce((a, b) => a + b, 0);
|
|
74
|
+
const page = new Uint8Array(27 + table.length + size);
|
|
75
|
+
page.set([0x4f, 0x67, 0x67, 0x53], 0);
|
|
76
|
+
page[5] = (out.length === 0 ? firstFlags : 0) | (continued ? 0x01 : 0);
|
|
77
|
+
page[26] = table.length;
|
|
78
|
+
page.set(table, 27);
|
|
79
|
+
page.set(data.subarray(offset, offset + size), 27 + table.length);
|
|
80
|
+
out.push(page);
|
|
81
|
+
continued = table.at(-1) === 255;
|
|
82
|
+
segment += table.length;
|
|
83
|
+
offset += size;
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
/** The codec of an Ogg: Vorbis or Opus, from its first packet. */
|
|
88
|
+
export function oggCodec(bytes) {
|
|
89
|
+
const [first] = pages(bytes);
|
|
90
|
+
if (first === undefined)
|
|
91
|
+
throw new InputError("not an Ogg file: it has no pages");
|
|
92
|
+
const packet = Buffer.from(bytes.subarray(first.payloadStart, first.end));
|
|
93
|
+
if (packet.toString("latin1", 0, 8) === "OpusHead")
|
|
94
|
+
return "opus";
|
|
95
|
+
if (isVorbisHeader(packet, 1))
|
|
96
|
+
return "vorbis";
|
|
97
|
+
throw new InputError("unsupported Ogg: it is neither Vorbis nor Opus");
|
|
98
|
+
}
|
|
99
|
+
/** Every packet of an Ogg, in order, each with the granule position of the page that completes it. */
|
|
100
|
+
export function oggPackets(bytes) {
|
|
101
|
+
const out = [];
|
|
102
|
+
let current = [];
|
|
103
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
104
|
+
for (const page of pages(bytes)) {
|
|
105
|
+
const granule = Number(view.getBigInt64(page.start + 6, true));
|
|
106
|
+
let at = page.payloadStart;
|
|
107
|
+
for (const length of page.segments) {
|
|
108
|
+
current.push(bytes.subarray(at, at + length));
|
|
109
|
+
at += length;
|
|
110
|
+
if (length < 255) {
|
|
111
|
+
out.push({ data: Buffer.concat(current), granule });
|
|
112
|
+
current = [];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return out;
|
|
117
|
+
}
|
|
118
|
+
function headers(bytes) {
|
|
119
|
+
const all = pages(bytes);
|
|
120
|
+
const codec = oggCodec(bytes);
|
|
121
|
+
const wanted = codec === "opus" ? 2 : 3;
|
|
122
|
+
const packets = [];
|
|
123
|
+
let current = [];
|
|
124
|
+
for (const [index, page] of all.entries()) {
|
|
125
|
+
let at = page.payloadStart;
|
|
126
|
+
for (const [s, length] of page.segments.entries()) {
|
|
127
|
+
current.push(bytes.subarray(at, at + length));
|
|
128
|
+
at += length;
|
|
129
|
+
if (length < 255) {
|
|
130
|
+
packets.push(Buffer.concat(current));
|
|
131
|
+
current = [];
|
|
132
|
+
if (packets.length === wanted) {
|
|
133
|
+
if (s !== page.segments.length - 1)
|
|
134
|
+
throw new InputError(`unsupported Ogg: audio shares a page with the ${codec} headers`);
|
|
135
|
+
const [id, comment, setup] = packets;
|
|
136
|
+
const valid = codec === "opus"
|
|
137
|
+
? Buffer.from(comment.subarray(0, 8)).toString("latin1") === "OpusTags"
|
|
138
|
+
: isVorbisHeader(id, 1) && isVorbisHeader(comment, 3) && isVorbisHeader(setup, 5);
|
|
139
|
+
if (!valid)
|
|
140
|
+
throw new InputError(`not an Ogg ${codec} file: its first packets are not its headers`);
|
|
141
|
+
return { codec, packets, audioPage: index + 1, pages: all };
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
throw new InputError(`not an Ogg ${codec} file: its headers are incomplete`);
|
|
147
|
+
}
|
|
148
|
+
function isVorbisHeader(packet, type) {
|
|
149
|
+
return packet[0] === type && Buffer.from(packet.subarray(1, 7)).toString("latin1") === "vorbis";
|
|
150
|
+
}
|
|
151
|
+
function parseComment(packet, codec) {
|
|
152
|
+
const b = Buffer.from(packet.buffer, packet.byteOffset, packet.byteLength);
|
|
153
|
+
let at = codec === "opus" ? 8 : 7;
|
|
154
|
+
const take = () => {
|
|
155
|
+
if (at + 4 > b.length)
|
|
156
|
+
throw new InputError("Vorbis comment header is cut short");
|
|
157
|
+
const length = b.readUInt32LE(at);
|
|
158
|
+
at += 4;
|
|
159
|
+
if (at + length > b.length)
|
|
160
|
+
throw new InputError("Vorbis comment header is cut short");
|
|
161
|
+
const text = b.toString("utf8", at, at + length);
|
|
162
|
+
at += length;
|
|
163
|
+
return text;
|
|
164
|
+
};
|
|
165
|
+
const vendor = take();
|
|
166
|
+
if (at + 4 > b.length)
|
|
167
|
+
throw new InputError("Vorbis comment header is cut short");
|
|
168
|
+
const count = b.readUInt32LE(at);
|
|
169
|
+
at += 4;
|
|
170
|
+
const comments = [];
|
|
171
|
+
for (let i = 0; i < count; i++)
|
|
172
|
+
comments.push(take());
|
|
173
|
+
return { vendor, comments };
|
|
174
|
+
}
|
|
175
|
+
function buildComment({ vendor, comments }, codec) {
|
|
176
|
+
const parts = codec === "opus"
|
|
177
|
+
? [Buffer.from("OpusTags", "latin1")]
|
|
178
|
+
: [Buffer.from([3]), Buffer.from("vorbis", "latin1")];
|
|
179
|
+
const field = (text) => {
|
|
180
|
+
const bytes = Buffer.from(text, "utf8");
|
|
181
|
+
const length = Buffer.alloc(4);
|
|
182
|
+
length.writeUInt32LE(bytes.length);
|
|
183
|
+
parts.push(length, bytes);
|
|
184
|
+
};
|
|
185
|
+
field(vendor);
|
|
186
|
+
const count = Buffer.alloc(4);
|
|
187
|
+
count.writeUInt32LE(comments.length);
|
|
188
|
+
parts.push(count);
|
|
189
|
+
for (const c of comments)
|
|
190
|
+
field(c);
|
|
191
|
+
if (codec === "vorbis")
|
|
192
|
+
parts.push(Buffer.from([1])); // the framing bit
|
|
193
|
+
return Buffer.concat(parts);
|
|
194
|
+
}
|
|
195
|
+
/** The comment header of an Ogg Vorbis or Ogg Opus file. */
|
|
196
|
+
export function readVorbisComments(bytes) {
|
|
197
|
+
const { codec, packets } = headers(bytes);
|
|
198
|
+
return parseComment(packets[1], codec);
|
|
199
|
+
}
|
|
200
|
+
/** The value of the first comment named `name` (case-insensitive, as Vorbis field names are). */
|
|
201
|
+
export function vorbisComment(comments, name) {
|
|
202
|
+
const key = `${name.toUpperCase()}=`;
|
|
203
|
+
const found = comments.comments.find((c) => c.slice(0, key.length).toUpperCase() === key);
|
|
204
|
+
return found?.slice(key.length);
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Rewrites the header pages: the identification packet alone on the first page, the comment and
|
|
208
|
+
* setup packets after it, then the audio pages renumbered and re-CRC'd. `edit` changes the
|
|
209
|
+
* comments; `serial` replaces the stream serial number.
|
|
210
|
+
*/
|
|
211
|
+
function rewriteHeaders(bytes, edit, serial) {
|
|
212
|
+
const parsed = headers(bytes);
|
|
213
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
214
|
+
const stream = serial ?? view.getUint32(parsed.pages[0].start + 14, true);
|
|
215
|
+
const [id, comment, ...rest] = parsed.packets;
|
|
216
|
+
const newComment = edit
|
|
217
|
+
? buildComment(edit(parseComment(comment, parsed.codec)), parsed.codec)
|
|
218
|
+
: comment;
|
|
219
|
+
const out = [...lace([id], 0x02), ...lace([newComment, ...rest], 0)];
|
|
220
|
+
for (const page of parsed.pages.slice(parsed.audioPage))
|
|
221
|
+
out.push(bytes.slice(page.start, page.end));
|
|
222
|
+
return Buffer.concat(out.map((page, sequence) => stamp(page, stream, sequence)));
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Sets Vorbis comments: every existing field with one of `fields`' names is removed, and each
|
|
226
|
+
* defined value is added. The vendor string and the other fields stay; the audio is untouched.
|
|
227
|
+
*/
|
|
228
|
+
export function setVorbisComments(bytes, fields) {
|
|
229
|
+
const names = new Set(Object.keys(fields).map((n) => n.toUpperCase()));
|
|
230
|
+
return rewriteHeaders(bytes, ({ vendor, comments }) => ({
|
|
231
|
+
vendor,
|
|
232
|
+
comments: [
|
|
233
|
+
...comments.filter((c) => !names.has(c.split("=", 1)[0].toUpperCase())),
|
|
234
|
+
...Object.entries(fields)
|
|
235
|
+
.filter((entry) => entry[1] !== undefined)
|
|
236
|
+
.map(([name, value]) => `${name.toUpperCase()}=${value}`),
|
|
237
|
+
],
|
|
238
|
+
}));
|
|
239
|
+
}
|
|
240
|
+
/** Sets the stream serial number of every page and recomputes the CRCs. */
|
|
241
|
+
export function setOggSerial(bytes, serial) {
|
|
242
|
+
return rewriteHeaders(bytes, undefined, serial);
|
|
243
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The waveform cell of an audio candidate on the contact sheet: one lane per channel, each pixel
|
|
3
|
+
* column a vertical line from the lowest to the highest sample it covers. Samples only, no text,
|
|
4
|
+
* so the sheet stays numbers-only; the measured numbers are in the stage JSON.
|
|
5
|
+
*/
|
|
6
|
+
import type { AudioContext } from "../media.ts";
|
|
7
|
+
import type { Raster } from "../image/raster.ts";
|
|
8
|
+
/**
|
|
9
|
+
* A `size` px square raster of the audio's waveform. The height is split into one lane per
|
|
10
|
+
* channel with a one-pixel separator between lanes; a lane's centre line is sample 0, its top and
|
|
11
|
+
* bottom are 1 and -1. An empty channel draws only its centre line.
|
|
12
|
+
*/
|
|
13
|
+
export declare function waveformRaster(audio: AudioContext, size?: number): Raster;
|