@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,17 @@
|
|
|
1
|
+
import type { ConfirmationRecord, RunBinding } from "../types.ts";
|
|
2
|
+
export type { ConfirmationMethod, ConfirmationRecord, RunBinding } from "../types.ts";
|
|
3
|
+
/** sha256 hex of a value's canonical JSON: the id of a pick or write request. */
|
|
4
|
+
export declare function digestOf(body: unknown): string;
|
|
5
|
+
/** Where the record of a digest lives. */
|
|
6
|
+
export declare function confirmationPath(configDir: string, digest: string): string;
|
|
7
|
+
/** Writes a record; returns its path. */
|
|
8
|
+
export declare function writeConfirmation(configDir: string, record: ConfirmationRecord): Promise<string>;
|
|
9
|
+
/** The record of a digest when one exists, names that digest and is of that kind. */
|
|
10
|
+
export declare function readConfirmation(configDir: string, kind: ConfirmationRecord["kind"], digest: string): Promise<ConfirmationRecord | undefined>;
|
|
11
|
+
/** Whether a run in `runDir` may use a binding's confirmation: unbound, or bound there and unconsumed. */
|
|
12
|
+
export declare function bindingAllows(binding: RunBinding | undefined, runDir: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Rewrites the stored spend record of `digest` with `field` bound to `runDir`; `consume` marks
|
|
15
|
+
* that run finished. A record bound to another run, consumed or absent is left as it is.
|
|
16
|
+
*/
|
|
17
|
+
export declare function bindConfirmation(configDir: string, digest: string, field: "run" | "coveredRun", runDir: string, consume?: boolean): Promise<void>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Confirmation records (design section 7): `<configDir>/confirmations/<hex>.json`, one per
|
|
3
|
+
* confirmed spend, pick or write request, named by the request's digest. Every method writes one.
|
|
4
|
+
* A spend confirmation pays for one run: its first run binds it to that run's directory, and it
|
|
5
|
+
* is consumed when that run finishes.
|
|
6
|
+
*/
|
|
7
|
+
import { createHash } from "node:crypto";
|
|
8
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
9
|
+
import { dirname, join } from "node:path";
|
|
10
|
+
import { InputError } from "../errors.js";
|
|
11
|
+
import { canonicalJson } from "../runs/plan.js";
|
|
12
|
+
const HEX = /^[0-9a-f]{64}$/;
|
|
13
|
+
/** sha256 hex of a value's canonical JSON: the id of a pick or write request. */
|
|
14
|
+
export function digestOf(body) {
|
|
15
|
+
return createHash("sha256").update(canonicalJson(body)).digest("hex");
|
|
16
|
+
}
|
|
17
|
+
/** Where the record of a digest lives. */
|
|
18
|
+
export function confirmationPath(configDir, digest) {
|
|
19
|
+
if (!HEX.test(digest))
|
|
20
|
+
throw new InputError(`"${digest}" is not a request digest (64 hex)`);
|
|
21
|
+
return join(configDir, "confirmations", `${digest}.json`);
|
|
22
|
+
}
|
|
23
|
+
/** Writes a record; returns its path. */
|
|
24
|
+
export async function writeConfirmation(configDir, record) {
|
|
25
|
+
const path = confirmationPath(configDir, record.digest);
|
|
26
|
+
await mkdir(dirname(path), { recursive: true });
|
|
27
|
+
await writeFile(path, `${JSON.stringify(record, null, 2)}\n`);
|
|
28
|
+
return path;
|
|
29
|
+
}
|
|
30
|
+
/** The record of a digest when one exists, names that digest and is of that kind. */
|
|
31
|
+
export async function readConfirmation(configDir, kind, digest) {
|
|
32
|
+
let record;
|
|
33
|
+
try {
|
|
34
|
+
record = JSON.parse(await readFile(confirmationPath(configDir, digest), "utf8"));
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
if (record === null || typeof record !== "object")
|
|
40
|
+
return undefined;
|
|
41
|
+
if (record.digest !== digest || record.kind !== kind)
|
|
42
|
+
return undefined;
|
|
43
|
+
if (typeof record.forecastUsd !== "number" || typeof record.method !== "string")
|
|
44
|
+
return undefined;
|
|
45
|
+
return record;
|
|
46
|
+
}
|
|
47
|
+
/** Whether a run in `runDir` may use a binding's confirmation: unbound, or bound there and unconsumed. */
|
|
48
|
+
export function bindingAllows(binding, runDir) {
|
|
49
|
+
return binding === undefined || (binding.runDir === runDir && binding.consumedAt === undefined);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Rewrites the stored spend record of `digest` with `field` bound to `runDir`; `consume` marks
|
|
53
|
+
* that run finished. A record bound to another run, consumed or absent is left as it is.
|
|
54
|
+
*/
|
|
55
|
+
export async function bindConfirmation(configDir, digest, field, runDir, consume = false) {
|
|
56
|
+
const record = await readConfirmation(configDir, "spend", digest);
|
|
57
|
+
if (record === undefined || !bindingAllows(record[field], runDir))
|
|
58
|
+
return;
|
|
59
|
+
await writeConfirmation(configDir, {
|
|
60
|
+
...record,
|
|
61
|
+
[field]: { runDir, ...(consume && { consumedAt: new Date().toISOString() }) },
|
|
62
|
+
});
|
|
63
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { KindTraits } from "./frames.ts";
|
|
2
|
+
import type { Raster } from "./image/raster.ts";
|
|
3
|
+
import type { AssetSpec, TargetProfile } from "./types.ts";
|
|
4
|
+
export declare const CONTACT_SHEET_FILE = "contact.png";
|
|
5
|
+
/** The edge of the square every image cell fits in, in pixels. */
|
|
6
|
+
export declare const CELL_PX = 96;
|
|
7
|
+
/** The most key frames shown for a strip. */
|
|
8
|
+
export declare const MAX_KEY_FRAMES = 6;
|
|
9
|
+
/** One candidate's row: its number, its images (the candidate, key frames or turntable frames). */
|
|
10
|
+
export interface ContactRow {
|
|
11
|
+
number: number;
|
|
12
|
+
images: Raster[];
|
|
13
|
+
}
|
|
14
|
+
export interface ContactCellBox {
|
|
15
|
+
kind: "number" | "image" | "reference";
|
|
16
|
+
/** The row's candidate number (0 for a reference row). */
|
|
17
|
+
number: number;
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ContactSheet {
|
|
24
|
+
raster: Raster;
|
|
25
|
+
cells: ContactCellBox[];
|
|
26
|
+
}
|
|
27
|
+
export declare function fit(image: Raster): Raster;
|
|
28
|
+
export declare function fill(r: Raster, x: number, y: number, w: number, h: number, rgba: number[]): void;
|
|
29
|
+
/**
|
|
30
|
+
* Renders the rows with the references repeated beside each: the number, then the row's images,
|
|
31
|
+
* then the references in a tinted cell each. Returns the raster and where every cell is.
|
|
32
|
+
*/
|
|
33
|
+
export declare function renderContact(rows: ContactRow[], references: Raster[]): ContactSheet;
|
|
34
|
+
/**
|
|
35
|
+
* The indexes of the key frames shown for `length` items: every `flagged` index (the frames a
|
|
36
|
+
* check flagged, which the person must see to judge the strip), then the rest of `count` spread
|
|
37
|
+
* evenly over the frames not flagged, first and last included. Sorted; more than `count` only when
|
|
38
|
+
* more frames are flagged.
|
|
39
|
+
*/
|
|
40
|
+
export declare function keyIndexes(length: number, count?: number, flagged?: Iterable<number>): number[];
|
|
41
|
+
/** The 0-based frames a strip's reasons flagged: every frame a failing reason names. */
|
|
42
|
+
export declare function flaggedFrames(reasons: ContactCandidate["reasons"]): number[];
|
|
43
|
+
/**
|
|
44
|
+
* The 0-based frames animation QA's deterministic checks flag on a staged strip, under the run's
|
|
45
|
+
* profile: the frames a person must see on the contact sheet. None when the checks cannot run
|
|
46
|
+
* (no profile, or a profile whose animation thresholds are invalid). When the family's template
|
|
47
|
+
* is undecided (no call is made here), its contact, footprint and loop-seam checks are pending, so
|
|
48
|
+
* no frame they would flag can be ruled out: every frame is flagged, and the sheet shows them all.
|
|
49
|
+
*/
|
|
50
|
+
export declare function stripQaFlags(frames: Raster[], spec: AssetSpec, profile: TargetProfile | undefined): number[];
|
|
51
|
+
/** What a run's contact sheet needs of a staged candidate. */
|
|
52
|
+
export interface ContactCandidate {
|
|
53
|
+
id: string;
|
|
54
|
+
file: string;
|
|
55
|
+
mediaType: string;
|
|
56
|
+
fields: Record<string, unknown>;
|
|
57
|
+
artifacts?: string[];
|
|
58
|
+
/** The candidate's QA reasons; a failing one's 1-based `frames` are always shown for a strip. */
|
|
59
|
+
reasons?: Array<{
|
|
60
|
+
passed: boolean;
|
|
61
|
+
frames?: number[];
|
|
62
|
+
}>;
|
|
63
|
+
}
|
|
64
|
+
/** A candidate's number: the digits of its id (`c3` is 3). */
|
|
65
|
+
export declare function candidateNumber(id: string, fallback: number): number;
|
|
66
|
+
/** Writes `<runDir>/contact.png` for rows and references; returns the file name and the layout. */
|
|
67
|
+
export declare function writeContactRows(runDir: string, rows: ContactRow[], references: Raster[]): Promise<{
|
|
68
|
+
file: string;
|
|
69
|
+
cells: ContactCellBox[];
|
|
70
|
+
} | undefined>;
|
|
71
|
+
/**
|
|
72
|
+
* Writes the contact sheet of a run's staged candidates: stills beside `references` (image
|
|
73
|
+
* bytes), a row of key frames per strip, turntable frames per 3D character. Returns the file
|
|
74
|
+
* name, or undefined when no candidate has an image to show.
|
|
75
|
+
*/
|
|
76
|
+
export declare function writeContact(runDir: string, spec: AssetSpec, candidates: ContactCandidate[], references: Uint8Array[],
|
|
77
|
+
/** The run's profile: a staged strip's row then always shows the frames animation QA flags. */
|
|
78
|
+
profile?: TargetProfile,
|
|
79
|
+
/** The kinds' `media` and `frames` traits: a strip kind's candidate is shown as its key frames. */
|
|
80
|
+
traits?: KindTraits): Promise<string | undefined>;
|
package/dist/contact.js
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contact sheet of a run (design section 10): `<run>/contact.png`, one numbered row per staged
|
|
3
|
+
* candidate. A still sits beside its references, a sprite strip shows a row of key frames (every
|
|
4
|
+
* frame QA flagged, then frames spread evenly), a 3D character its turntable frames and an audio
|
|
5
|
+
* candidate its waveform, one lane per channel. Numbers only: no text from any shared file or
|
|
6
|
+
* request input is drawn, so the sheet changes only when an image or a sample does. It reuses the
|
|
7
|
+
* raster code of the sheet import (src/sheet/import.ts).
|
|
8
|
+
*/
|
|
9
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
import { animationQa } from "./animation/qa.js";
|
|
12
|
+
import { splitStrip } from "./animation/strip.js";
|
|
13
|
+
import { CORE_REGISTRY } from "./extensions/registry.js";
|
|
14
|
+
import { frameLayoutOf, isStripKind } from "./frames.js";
|
|
15
|
+
import { waveformRaster } from "./audio/waveform.js";
|
|
16
|
+
import { decodeWav, mediaOf } from "./media.js";
|
|
17
|
+
import { drawDigits, textWidth } from "./image/digits.js";
|
|
18
|
+
import { createRaster, decodeImage, encodePng } from "./image/raster.js";
|
|
19
|
+
import { resampleTo } from "./image/resample.js";
|
|
20
|
+
import { blit } from "./sheet/import.js";
|
|
21
|
+
import { resolveStyle } from "./style.js";
|
|
22
|
+
export const CONTACT_SHEET_FILE = "contact.png";
|
|
23
|
+
/** The edge of the square every image cell fits in, in pixels. */
|
|
24
|
+
export const CELL_PX = 96;
|
|
25
|
+
/** The most key frames shown for a strip. */
|
|
26
|
+
export const MAX_KEY_FRAMES = 6;
|
|
27
|
+
const PAD = 8;
|
|
28
|
+
const GAP = 16;
|
|
29
|
+
const DIGIT_SCALE = 3;
|
|
30
|
+
const BACKDROP = [236, 236, 236, 255];
|
|
31
|
+
const CELL = [248, 248, 248, 255];
|
|
32
|
+
const REFERENCE_CELL = [214, 220, 232, 255];
|
|
33
|
+
const INK = [30, 30, 36, 255];
|
|
34
|
+
export function fit(image) {
|
|
35
|
+
const scale = Math.min(CELL_PX / image.width, CELL_PX / image.height);
|
|
36
|
+
const size = {
|
|
37
|
+
width: Math.max(1, Math.round(image.width * scale)),
|
|
38
|
+
height: Math.max(1, Math.round(image.height * scale)),
|
|
39
|
+
};
|
|
40
|
+
return resampleTo(image, scale, { x: 0, y: 0 }, size, "crisp");
|
|
41
|
+
}
|
|
42
|
+
export function fill(r, x, y, w, h, rgba) {
|
|
43
|
+
for (let j = y; j < y + h; j++)
|
|
44
|
+
for (let i = x; i < x + w; i++)
|
|
45
|
+
r.data.set(rgba, (j * r.width + i) * 4);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Renders the rows with the references repeated beside each: the number, then the row's images,
|
|
49
|
+
* then the references in a tinted cell each. Returns the raster and where every cell is.
|
|
50
|
+
*/
|
|
51
|
+
export function renderContact(rows, references) {
|
|
52
|
+
const numberW = Math.max(...rows.map((r) => textWidth(String(r.number), DIGIT_SCALE)), 0);
|
|
53
|
+
const columns = Math.max(0, ...rows.map((r) => r.images.length));
|
|
54
|
+
const imageX = PAD + numberW + PAD;
|
|
55
|
+
const referenceX = imageX + columns * (CELL_PX + PAD) + (references.length > 0 ? GAP : 0);
|
|
56
|
+
const width = references.length > 0
|
|
57
|
+
? referenceX + references.length * (CELL_PX + PAD)
|
|
58
|
+
: imageX + Math.max(columns, 1) * (CELL_PX + PAD);
|
|
59
|
+
const rowH = CELL_PX + PAD;
|
|
60
|
+
const out = createRaster(Math.max(width, 1), Math.max(PAD + rows.length * rowH, 1));
|
|
61
|
+
for (let i = 0; i < out.data.length; i += 4)
|
|
62
|
+
out.data.set(BACKDROP, i);
|
|
63
|
+
const cells = [];
|
|
64
|
+
const place = (image, kind, number, x, y) => {
|
|
65
|
+
fill(out, x, y, CELL_PX, CELL_PX, kind === "image" ? CELL : REFERENCE_CELL);
|
|
66
|
+
const scaled = fit(image);
|
|
67
|
+
blit(out, scaled, x + Math.floor((CELL_PX - scaled.width) / 2), y + Math.floor((CELL_PX - scaled.height) / 2));
|
|
68
|
+
cells.push({ kind, number, x, y, width: CELL_PX, height: CELL_PX });
|
|
69
|
+
};
|
|
70
|
+
rows.forEach((row, index) => {
|
|
71
|
+
const y = PAD + index * rowH;
|
|
72
|
+
const label = String(row.number);
|
|
73
|
+
const labelH = 5 * DIGIT_SCALE;
|
|
74
|
+
drawDigits(out, label, PAD, y + Math.floor((CELL_PX - labelH) / 2), DIGIT_SCALE, INK);
|
|
75
|
+
cells.push({
|
|
76
|
+
kind: "number",
|
|
77
|
+
number: row.number,
|
|
78
|
+
x: PAD,
|
|
79
|
+
y: y + Math.floor((CELL_PX - labelH) / 2),
|
|
80
|
+
width: textWidth(label, DIGIT_SCALE),
|
|
81
|
+
height: labelH,
|
|
82
|
+
});
|
|
83
|
+
row.images.forEach((image, i) => place(image, "image", row.number, imageX + i * (CELL_PX + PAD), y));
|
|
84
|
+
references.forEach((reference, i) => place(reference, "reference", row.number, referenceX + i * (CELL_PX + PAD), y));
|
|
85
|
+
});
|
|
86
|
+
return { raster: out, cells };
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The indexes of the key frames shown for `length` items: every `flagged` index (the frames a
|
|
90
|
+
* check flagged, which the person must see to judge the strip), then the rest of `count` spread
|
|
91
|
+
* evenly over the frames not flagged, first and last included. Sorted; more than `count` only when
|
|
92
|
+
* more frames are flagged.
|
|
93
|
+
*/
|
|
94
|
+
export function keyIndexes(length, count = MAX_KEY_FRAMES, flagged = []) {
|
|
95
|
+
const shown = new Set([...flagged].filter((i) => Number.isInteger(i) && i >= 0 && i < length));
|
|
96
|
+
const rest = Array.from({ length }, (_, i) => i).filter((i) => !shown.has(i));
|
|
97
|
+
const slots = Math.max(0, count - shown.size);
|
|
98
|
+
if (rest.length <= slots)
|
|
99
|
+
rest.forEach((i) => shown.add(i));
|
|
100
|
+
else if (slots === 1)
|
|
101
|
+
shown.add(rest[0]);
|
|
102
|
+
else
|
|
103
|
+
for (let k = 0; k < slots; k++)
|
|
104
|
+
shown.add(rest[Math.round((k * (rest.length - 1)) / (slots - 1))]);
|
|
105
|
+
return [...shown].sort((a, b) => a - b);
|
|
106
|
+
}
|
|
107
|
+
/** The 0-based frames a strip's reasons flagged: every frame a failing reason names. */
|
|
108
|
+
export function flaggedFrames(reasons) {
|
|
109
|
+
return [...new Set((reasons ?? []).filter((r) => !r.passed).flatMap((r) => r.frames ?? []))].map((f) => f - 1);
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The 0-based frames animation QA's deterministic checks flag on a staged strip, under the run's
|
|
113
|
+
* profile: the frames a person must see on the contact sheet. None when the checks cannot run
|
|
114
|
+
* (no profile, or a profile whose animation thresholds are invalid). When the family's template
|
|
115
|
+
* is undecided (no call is made here), its contact, footprint and loop-seam checks are pending, so
|
|
116
|
+
* no frame they would flag can be ruled out: every frame is flagged, and the sheet shows them all.
|
|
117
|
+
*/
|
|
118
|
+
export function stripQaFlags(frames, spec, profile) {
|
|
119
|
+
const first = frames[0];
|
|
120
|
+
if (!profile || !first)
|
|
121
|
+
return [];
|
|
122
|
+
const frame = { width: first.width, height: first.height };
|
|
123
|
+
try {
|
|
124
|
+
const report = animationQa({
|
|
125
|
+
frames,
|
|
126
|
+
frame,
|
|
127
|
+
// The spec's anchor, else the bottom centre of the frame, as animation-qa takes it.
|
|
128
|
+
anchor: spec.anchor ?? { x: Math.floor(frame.width / 2), y: frame.height - 1 },
|
|
129
|
+
family: spec.animationFamily ?? "strip",
|
|
130
|
+
...((spec.frames?.durationMs ?? profile.frames.durationMs) !== undefined && {
|
|
131
|
+
durationMs: (spec.frames?.durationMs ?? profile.frames.durationMs),
|
|
132
|
+
}),
|
|
133
|
+
...(spec.gait !== undefined && { gait: spec.gait }),
|
|
134
|
+
...(spec.template !== undefined && { template: spec.template }),
|
|
135
|
+
}, profile,
|
|
136
|
+
// QA measures alpha only, so the palette rule plays no part.
|
|
137
|
+
resolveStyle(profile.style && { ...profile.style, color: { rule: "full" } }));
|
|
138
|
+
if (report.pending?.length)
|
|
139
|
+
return frames.map((_, i) => i);
|
|
140
|
+
return flaggedFrames(report.reasons);
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function tryDecode(bytes) {
|
|
147
|
+
try {
|
|
148
|
+
return decodeImage(bytes);
|
|
149
|
+
}
|
|
150
|
+
catch {
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/** A candidate's number: the digits of its id (`c3` is 3). */
|
|
155
|
+
export function candidateNumber(id, fallback) {
|
|
156
|
+
const n = Number.parseInt(id.replace(/\D/g, ""), 10);
|
|
157
|
+
return Number.isFinite(n) ? n : fallback;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* The images of one staged candidate, by its kind's media trait: a model kind's turntable, a strip
|
|
161
|
+
* kind's key frames, an image, an audio kind's waveform (one lane per channel; none when the
|
|
162
|
+
* file does not decode).
|
|
163
|
+
*/
|
|
164
|
+
async function candidateImages(runDir, spec, candidate, profile, traits) {
|
|
165
|
+
const media = mediaOf(spec.kind, traits);
|
|
166
|
+
if (media === "audio") {
|
|
167
|
+
try {
|
|
168
|
+
const audio = decodeWav(new Uint8Array(await readFile(join(runDir, candidate.file))));
|
|
169
|
+
return [waveformRaster(audio, CELL_PX)];
|
|
170
|
+
}
|
|
171
|
+
catch {
|
|
172
|
+
return [];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
if (media === "model") {
|
|
176
|
+
// Turntable frames are the view renders; the clip frames are not part of the turntable.
|
|
177
|
+
const views = (candidate.artifacts ?? []).filter((a) => a.endsWith(".png") && !(a.split("/").pop() ?? "").startsWith("clip-"));
|
|
178
|
+
const images = await Promise.all(views.map(async (a) => tryDecode(new Uint8Array(await readFile(join(runDir, a))))));
|
|
179
|
+
return images.filter((i) => i !== undefined);
|
|
180
|
+
}
|
|
181
|
+
if (!candidate.mediaType.startsWith("image/"))
|
|
182
|
+
return [];
|
|
183
|
+
const image = tryDecode(new Uint8Array(await readFile(join(runDir, candidate.file))));
|
|
184
|
+
if (!image)
|
|
185
|
+
return [];
|
|
186
|
+
if (!isStripKind(spec.kind, traits))
|
|
187
|
+
return [image];
|
|
188
|
+
// The frame layout the strip kind's output carries; a record without one is cut by its spec.
|
|
189
|
+
const layout = frameLayoutOf(candidate.fields);
|
|
190
|
+
const width = layout?.width ?? spec.frames?.width;
|
|
191
|
+
const height = layout?.height ?? spec.frames?.height ?? image.height;
|
|
192
|
+
if (width === undefined || height !== image.height || image.width % width !== 0)
|
|
193
|
+
return [image];
|
|
194
|
+
const all = splitStrip(image, { width, height });
|
|
195
|
+
const flagged = [...flaggedFrames(candidate.reasons), ...stripQaFlags(all, spec, profile)];
|
|
196
|
+
return keyIndexes(all.length, MAX_KEY_FRAMES, flagged).map((i) => all[i]);
|
|
197
|
+
}
|
|
198
|
+
/** Writes `<runDir>/contact.png` for rows and references; returns the file name and the layout. */
|
|
199
|
+
export async function writeContactRows(runDir, rows, references) {
|
|
200
|
+
if (rows.length === 0)
|
|
201
|
+
return undefined;
|
|
202
|
+
const sheet = renderContact(rows, references);
|
|
203
|
+
await writeFile(join(runDir, CONTACT_SHEET_FILE), encodePng(sheet.raster));
|
|
204
|
+
return { file: CONTACT_SHEET_FILE, cells: sheet.cells };
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Writes the contact sheet of a run's staged candidates: stills beside `references` (image
|
|
208
|
+
* bytes), a row of key frames per strip, turntable frames per 3D character. Returns the file
|
|
209
|
+
* name, or undefined when no candidate has an image to show.
|
|
210
|
+
*/
|
|
211
|
+
export async function writeContact(runDir, spec, candidates, references,
|
|
212
|
+
/** The run's profile: a staged strip's row then always shows the frames animation QA flags. */
|
|
213
|
+
profile,
|
|
214
|
+
/** The kinds' `media` and `frames` traits: a strip kind's candidate is shown as its key frames. */
|
|
215
|
+
traits = CORE_REGISTRY) {
|
|
216
|
+
const rows = [];
|
|
217
|
+
for (const [index, candidate] of candidates.entries()) {
|
|
218
|
+
const images = await candidateImages(runDir, spec, candidate, profile, traits);
|
|
219
|
+
if (images.length > 0)
|
|
220
|
+
rows.push({ number: candidateNumber(candidate.id, index + 1), images });
|
|
221
|
+
}
|
|
222
|
+
const refs = references.map(tryDecode).filter((r) => r !== undefined);
|
|
223
|
+
return (await writeContactRows(runDir, rows, refs))?.file;
|
|
224
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import type { KeyObject } from "node:crypto";
|
|
2
|
+
import "./pure-cbor.ts";
|
|
3
|
+
import type { DigitalSourceType } from "./metadata.ts";
|
|
4
|
+
/** The assertion that names the sha256 of the bytes a manifest was signed over. */
|
|
5
|
+
export declare const INPUT_ASSERTION = "org.clockgrove.assetgrove.input";
|
|
6
|
+
/** The development certificate's directory under the state directory. */
|
|
7
|
+
export declare const DEVELOPMENT_DIR = "content-credentials";
|
|
8
|
+
/** What a result says when the local development certificate signed. */
|
|
9
|
+
export declare const DEVELOPMENT_SIGNER_WARNING = "signed with Assetgrove's local development certificate, which no C2PA trust list holds; set contentCredentials in the developer settings to sign with your own certificate";
|
|
10
|
+
/** Whether a media type is one C2PA credentials are written into. */
|
|
11
|
+
export declare function canCarryCredentials(mediaType: string): boolean;
|
|
12
|
+
type Alg = "es256" | "es384" | "ps256" | "ed25519";
|
|
13
|
+
/** Which certificate signs, as recorded in provenance and results. */
|
|
14
|
+
export interface SignerRecord {
|
|
15
|
+
/** True for the local development certificate, which no C2PA trust list holds. */
|
|
16
|
+
development: boolean;
|
|
17
|
+
/** The sha256 of the signing (leaf) certificate's DER bytes. */
|
|
18
|
+
certificateSha256: string;
|
|
19
|
+
subject: string;
|
|
20
|
+
issuer: string;
|
|
21
|
+
serialNumber: string;
|
|
22
|
+
alg: Alg;
|
|
23
|
+
}
|
|
24
|
+
/** A signer: its record, key and certificate chain (leaf first, DER). */
|
|
25
|
+
export interface ContentSigner {
|
|
26
|
+
record: SignerRecord;
|
|
27
|
+
key: KeyObject;
|
|
28
|
+
chain: Uint8Array[];
|
|
29
|
+
}
|
|
30
|
+
/** The developer settings' content credentials: absolute paths to a PEM chain and a PEM key. */
|
|
31
|
+
export interface CredentialSettings {
|
|
32
|
+
certificate: string;
|
|
33
|
+
privateKey: string;
|
|
34
|
+
}
|
|
35
|
+
/** The developer's signer, read from the files the developer settings name. */
|
|
36
|
+
export declare function settingsSigner(settings: CredentialSettings): ContentSigner;
|
|
37
|
+
/**
|
|
38
|
+
* The local development signer: a CA and a signer certificate (c2pa-rs refuses a self-signed
|
|
39
|
+
* signer), ECDSA P-256, created once under `<stateDir>/content-credentials/` and reused. The CA's
|
|
40
|
+
* certificate is written beside them as `ca.pem`, so a reader can be told to trust it.
|
|
41
|
+
*/
|
|
42
|
+
export declare function developmentSigner(stateDir: string): Promise<ContentSigner>;
|
|
43
|
+
/** The signer the developer settings choose: their certificate, else the development one. */
|
|
44
|
+
export declare function resolveSigner(settings: {
|
|
45
|
+
stateDir: string;
|
|
46
|
+
contentCredentials?: CredentialSettings;
|
|
47
|
+
}): Promise<ContentSigner>;
|
|
48
|
+
/**
|
|
49
|
+
* The signer `resolveSigner` would give, without creating anything: undefined when the settings
|
|
50
|
+
* name none and the development certificate does not exist yet. For a preview, which never writes.
|
|
51
|
+
*/
|
|
52
|
+
export declare function existingSigner(settings: {
|
|
53
|
+
stateDir: string;
|
|
54
|
+
contentCredentials?: CredentialSettings;
|
|
55
|
+
}): Promise<ContentSigner | undefined>;
|
|
56
|
+
/** What a manifest says: how the file was made, and from what. */
|
|
57
|
+
export interface CredentialClaim {
|
|
58
|
+
digitalSourceType: DigitalSourceType;
|
|
59
|
+
models: readonly string[];
|
|
60
|
+
/** The file's name, for the manifest's title. */
|
|
61
|
+
title: string;
|
|
62
|
+
/** For an adopted hand edit: the AI-made original, carried as the `parentOf` ingredient. */
|
|
63
|
+
original?: {
|
|
64
|
+
bytes: Uint8Array;
|
|
65
|
+
mediaType: string;
|
|
66
|
+
title: string;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/** An ingredient for `signManifest`: its JSON definition and the bytes it was made from. */
|
|
70
|
+
export interface ManifestIngredient {
|
|
71
|
+
definition: Record<string, unknown>;
|
|
72
|
+
mediaType: string;
|
|
73
|
+
bytes: Uint8Array;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Signs `bytes` with the manifest `definition` and `ingredients` (a C2PA manifest definition as
|
|
77
|
+
* the SDK's builder takes it); returns the signed bytes. `signCredentials` is Assetgrove's own
|
|
78
|
+
* manifest; this is the primitive under it.
|
|
79
|
+
*/
|
|
80
|
+
export declare function signManifest(bytes: Uint8Array, mediaType: string, definition: Record<string, unknown>, signer: ContentSigner, ingredients?: ManifestIngredient[], options?: {
|
|
81
|
+
sidecar?: boolean;
|
|
82
|
+
}): Promise<Uint8Array>;
|
|
83
|
+
/** Signs `bytes` (already IPTC-marked) with a manifest for `claim`; returns the signed bytes. */
|
|
84
|
+
export declare function signCredentials(bytes: Uint8Array, mediaType: string, claim: CredentialClaim, signer: ContentSigner, version: string): Promise<Uint8Array>;
|
|
85
|
+
/** A manifest as read back and validated. */
|
|
86
|
+
export interface ReadCredentials {
|
|
87
|
+
/** The SDK's validation state: `Invalid`, `Valid` or `Trusted`. */
|
|
88
|
+
state: string;
|
|
89
|
+
/** Validation failures, other than an untrusted signing credential. */
|
|
90
|
+
failures: {
|
|
91
|
+
code: string;
|
|
92
|
+
explanation?: string;
|
|
93
|
+
}[];
|
|
94
|
+
/** Whether the signing credential is on a trust list the reader was given. */
|
|
95
|
+
trusted: boolean;
|
|
96
|
+
actions: {
|
|
97
|
+
action: string;
|
|
98
|
+
digitalSourceType?: string;
|
|
99
|
+
softwareAgent?: string;
|
|
100
|
+
}[];
|
|
101
|
+
/** The sha256 the manifest names for the bytes it was signed over. */
|
|
102
|
+
inputSha256?: string;
|
|
103
|
+
/** The sha256 of the signing certificate, as the manifest names it. */
|
|
104
|
+
certificateSha256?: string;
|
|
105
|
+
/** Whether the manifest says Assetgrove's development certificate signed it. */
|
|
106
|
+
development?: boolean;
|
|
107
|
+
ingredients: {
|
|
108
|
+
title?: string;
|
|
109
|
+
relationship?: string;
|
|
110
|
+
validationState?: string;
|
|
111
|
+
}[];
|
|
112
|
+
signer: {
|
|
113
|
+
subject?: string;
|
|
114
|
+
issuer?: string;
|
|
115
|
+
serialNumber?: string;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Reads and validates the active manifest of `bytes`; undefined when there is none. Offline: no
|
|
120
|
+
* OCSP or remote manifest fetch. `trustAnchors` (PEM) are certificates to trust.
|
|
121
|
+
*/
|
|
122
|
+
export declare function readCredentials(bytes: Uint8Array, mediaType: string, trustAnchors?: string): Promise<ReadCredentials | undefined>;
|
|
123
|
+
/** The problem codes of a file's credentials. */
|
|
124
|
+
export type CredentialProblemCode = "credentials_missing" | "credentials_invalid" | "credentials_mismatch";
|
|
125
|
+
/** What a file's manifest must say. */
|
|
126
|
+
export interface ExpectedCredentials {
|
|
127
|
+
digitalSourceType: DigitalSourceType;
|
|
128
|
+
models: readonly string[];
|
|
129
|
+
/** True for an adopted hand edit, whose manifest records the edit of an original. */
|
|
130
|
+
adopted?: boolean;
|
|
131
|
+
}
|
|
132
|
+
/** One problem with a written file's credentials; undefined when they hold. */
|
|
133
|
+
export declare function credentialProblem(path: string, bytes: Uint8Array, mediaType: string, expected: ExpectedCredentials): Promise<{
|
|
134
|
+
code: CredentialProblemCode;
|
|
135
|
+
problem: string;
|
|
136
|
+
} | undefined>;
|
|
137
|
+
/**
|
|
138
|
+
* The bytes to write for a file: `existing` (the file already at the destination) when its
|
|
139
|
+
* manifest validates, was signed over these same `bytes` by the same certificate and records the
|
|
140
|
+
* same claim, so an unchanged asset keeps its bytes; else `bytes` newly signed.
|
|
141
|
+
*/
|
|
142
|
+
export declare function credentialed(bytes: Uint8Array, mediaType: string, claim: CredentialClaim, signer: ContentSigner, version: string, existing?: Uint8Array): Promise<Uint8Array>;
|
|
143
|
+
/** Whether a media type's credentials are a sidecar manifest rather than embedded. */
|
|
144
|
+
export declare function takesSidecar(mediaType: string): boolean;
|
|
145
|
+
/** The C2PA sidecar's file name for an asset's: its stem and `.c2pa`. */
|
|
146
|
+
export declare function sidecarName(assetName: string): string;
|
|
147
|
+
/** Signs a sidecar manifest store for `bytes` (already marked), which stay as they are. */
|
|
148
|
+
export declare function signSidecarCredentials(bytes: Uint8Array, mediaType: string, claim: CredentialClaim, signer: ContentSigner, version: string): Promise<Uint8Array>;
|
|
149
|
+
/**
|
|
150
|
+
* Reads and validates a sidecar manifest store for the asset `bytes`; undefined when `manifest`
|
|
151
|
+
* holds none. c2pa-wasm reads a manifest store only on its own, so it checks the data hash over
|
|
152
|
+
* the store itself, not the asset; that result is set aside. The store binds the asset through
|
|
153
|
+
* Assetgrove's signed input assertion instead, whose sha256 must be the asset's
|
|
154
|
+
* (docs/decisions.md).
|
|
155
|
+
*/
|
|
156
|
+
export declare function readSidecarCredentials(manifest: Uint8Array, bytes: Uint8Array, trustAnchors?: string): Promise<ReadCredentials | undefined>;
|
|
157
|
+
/** One problem with an asset's sidecar credentials; undefined when they hold. */
|
|
158
|
+
export declare function sidecarCredentialProblem(path: string, manifest: Uint8Array | undefined, bytes: Uint8Array, expected: ExpectedCredentials): Promise<{
|
|
159
|
+
code: CredentialProblemCode;
|
|
160
|
+
problem: string;
|
|
161
|
+
} | undefined>;
|
|
162
|
+
/** Whether an existing sidecar still holds for these bytes, this claim and this signer's certificate. */
|
|
163
|
+
export declare function sidecarHolds(bytes: Uint8Array, claim: CredentialClaim, signer: ContentSigner, existing: Uint8Array): Promise<boolean>;
|
|
164
|
+
/**
|
|
165
|
+
* The sidecar to write for an asset: `existing` when it validates, was signed over these same
|
|
166
|
+
* `bytes` by the same certificate and records the same claim, so an unchanged rendition keeps
|
|
167
|
+
* its sidecar; else a newly signed one.
|
|
168
|
+
*/
|
|
169
|
+
export declare function sidecarCredentialed(bytes: Uint8Array, mediaType: string, claim: CredentialClaim, signer: ContentSigner, version: string, existing?: Uint8Array): Promise<Uint8Array>;
|
|
170
|
+
export {};
|