@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,65 @@
|
|
|
1
|
+
import type { AudioTransformRecord } from "../audio/run.ts";
|
|
2
|
+
import type { ContentSigner, SignerRecord } from "../credentials.ts";
|
|
3
|
+
import type { DigitalSourceType } from "../metadata.ts";
|
|
4
|
+
import type { RunOptions, TransformRecord } from "./run.ts";
|
|
5
|
+
export interface RenditionOptions extends Pick<RunOptions, "style" | "frame" | "engines"> {
|
|
6
|
+
recipes: string;
|
|
7
|
+
recipe: string;
|
|
8
|
+
source: string;
|
|
9
|
+
sourceSha256: string;
|
|
10
|
+
sourceProvenance?: string;
|
|
11
|
+
out: string;
|
|
12
|
+
preview?: boolean;
|
|
13
|
+
digitalSourceType?: DigitalSourceType;
|
|
14
|
+
/** Output file stem (default `rendition`); names only, not part of the digest. */
|
|
15
|
+
name?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Signs the C2PA sidecar of an Ogg rendition; by default the developer settings'
|
|
18
|
+
* `contentCredentials`, else the development certificate, as hand-off signs.
|
|
19
|
+
*/
|
|
20
|
+
signer?: ContentSigner;
|
|
21
|
+
/**
|
|
22
|
+
* The sidecar already at the destination, by file name, for a preview whose caller writes
|
|
23
|
+
* elsewhere (delivery): kept when it still holds for the same bytes. A real build reads its own
|
|
24
|
+
* rendition directory.
|
|
25
|
+
*/
|
|
26
|
+
existingSidecar?: (name: string) => Promise<Uint8Array | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Sign a sidecar that does not hold even in a preview (default: only a real build signs).
|
|
29
|
+
* Delivery plans in preview and writes the planned bytes itself, so its real delivery signs.
|
|
30
|
+
* Without it a preview writes nothing, the development certificate included: it reports a
|
|
31
|
+
* sidecar already there that still holds, else the sidecar's path alone.
|
|
32
|
+
*/
|
|
33
|
+
sign?: boolean;
|
|
34
|
+
/** Make no sidecar at all, reading no settings and creating no signer (default true). */
|
|
35
|
+
sidecars?: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** An Ogg rendition's C2PA sidecar manifest, as its output records it. */
|
|
38
|
+
export interface RenditionSidecar {
|
|
39
|
+
/** The sidecar's file name, beside the rendition: its stem and `.c2pa`. */
|
|
40
|
+
name: string;
|
|
41
|
+
path: string;
|
|
42
|
+
/** Absent in a preview that would sign a new sidecar: a signature is not byte-stable. */
|
|
43
|
+
sha256?: string;
|
|
44
|
+
/** Absent in a preview with no signer yet (the development certificate not made). */
|
|
45
|
+
signer?: SignerRecord;
|
|
46
|
+
}
|
|
47
|
+
/** Resolves and encodes before any write, including in the CLI and MCP preview path. */
|
|
48
|
+
export declare function buildRendition(options: RenditionOptions): Promise<{
|
|
49
|
+
record: (TransformRecord | AudioTransformRecord) & {
|
|
50
|
+
rendition: unknown;
|
|
51
|
+
sourceProvenance?: unknown;
|
|
52
|
+
};
|
|
53
|
+
provenancePath: string;
|
|
54
|
+
digest: string;
|
|
55
|
+
preview: boolean;
|
|
56
|
+
files: {
|
|
57
|
+
path: string;
|
|
58
|
+
bytes: Uint8Array;
|
|
59
|
+
}[];
|
|
60
|
+
sidecars: {
|
|
61
|
+
output: number;
|
|
62
|
+
path: string;
|
|
63
|
+
bytes: Uint8Array<ArrayBufferLike> | undefined;
|
|
64
|
+
}[];
|
|
65
|
+
}>;
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project-owned, pinned, deterministic renditions of an image or an audio master. No provider
|
|
3
|
+
* calls or target activation. An audio recipe ending in `encode` makes an Ogg Vorbis rendition,
|
|
4
|
+
* which carries the AI mark as Vorbis comments and a C2PA sidecar manifest (docs/PRD-audio.md).
|
|
5
|
+
*/
|
|
6
|
+
import { lstat, mkdir, readFile, realpath, stat, writeFile } from "node:fs/promises";
|
|
7
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
8
|
+
import { transformAudioFiles } from "../audio/run.js";
|
|
9
|
+
import { existingSigner, resolveSigner, sidecarCredentialed, sidecarHolds, sidecarName, takesSidecar, } from "../credentials.js";
|
|
10
|
+
import { InputError } from "../errors.js";
|
|
11
|
+
import { canonicalJson, sha256Hex } from "../library/canonical.js";
|
|
12
|
+
import { DIGITAL_SOURCE_TYPES, readDigitalSourceType, readMarkedModels, embedDigitalSourceType, parseDigitalSourceType, requireDeclared, sourceDeclaration, } from "../metadata.js";
|
|
13
|
+
import { checkProvenance } from "../provenance-binding.js";
|
|
14
|
+
import { sniffMediaType } from "../request.js";
|
|
15
|
+
import { assetgroveVersion } from "../library/write.js";
|
|
16
|
+
import { checkWrites } from "../paths.js";
|
|
17
|
+
import { loadSettings } from "../settings.js";
|
|
18
|
+
import { operationSpec } from "./operations.js";
|
|
19
|
+
import { readRecipe, transformFiles } from "./run.js";
|
|
20
|
+
import { rasterEngine } from "./raster-engine.js";
|
|
21
|
+
async function read(path) {
|
|
22
|
+
try {
|
|
23
|
+
return new Uint8Array(await readFile(path));
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
throw new InputError(`cannot read ${path}: ${error.message}`, { cause: error });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function json(bytes, path) {
|
|
30
|
+
try {
|
|
31
|
+
const value = JSON.parse(Buffer.from(bytes).toString("utf8"));
|
|
32
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
33
|
+
throw new Error("expected an object");
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
throw new InputError(`invalid JSON in ${path}: ${error.message}`, { cause: error });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Resolves and encodes before any write, including in the CLI and MCP preview path. */
|
|
41
|
+
export async function buildRendition(options) {
|
|
42
|
+
if (!/^[A-Za-z0-9][A-Za-z0-9_-]*$/.test(options.recipe)) {
|
|
43
|
+
throw new InputError("recipe must be a safe file stem (letters, digits, _ or -)");
|
|
44
|
+
}
|
|
45
|
+
if (!/^[a-fA-F0-9]{64}$/.test(options.sourceSha256)) {
|
|
46
|
+
throw new InputError("sourceSha256 must be the full source SHA-256");
|
|
47
|
+
}
|
|
48
|
+
const expected = options.sourceSha256.toLowerCase();
|
|
49
|
+
const source = resolve(options.source);
|
|
50
|
+
const sourceBytes = await read(source);
|
|
51
|
+
if (sha256Hex(sourceBytes) !== expected)
|
|
52
|
+
throw new InputError("source SHA-256 mismatch");
|
|
53
|
+
const recipePath = resolve(options.recipes, `${options.recipe}.json`);
|
|
54
|
+
const recipeBytes = await read(recipePath);
|
|
55
|
+
if (dirname(await realpath(recipePath)) !== (await realpath(resolve(options.recipes)))) {
|
|
56
|
+
throw new InputError("recipe file must stay inside the project recipe directory");
|
|
57
|
+
}
|
|
58
|
+
// Only the deterministic raster adapter is available by default. Explicit injected adapters
|
|
59
|
+
// must implement the same synchronous raster operations; async overrides are rejected too.
|
|
60
|
+
const engines = options.engines ?? [rasterEngine];
|
|
61
|
+
const recipe = readRecipe(json(recipeBytes, recipePath), recipePath, engines);
|
|
62
|
+
const audio = sniffMediaType(sourceBytes) === "audio/wav";
|
|
63
|
+
for (const step of recipe.steps) {
|
|
64
|
+
const media = operationSpec(step.op)?.media;
|
|
65
|
+
if (audio) {
|
|
66
|
+
if (media !== "audio")
|
|
67
|
+
throw new InputError(`the source is a WAV master, so its rendition takes only audio operations: ${step.op}`);
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (media === "audio")
|
|
71
|
+
throw new InputError(`${step.op} is an audio operation; the source is not a WAV master`);
|
|
72
|
+
const engine = step.engine === undefined
|
|
73
|
+
? engines.find((e) => e.operations[step.op] || e.asyncOperations?.[step.op])
|
|
74
|
+
: engines.find((e) => e.name === step.engine);
|
|
75
|
+
if (!rasterEngine.operations[step.op] ||
|
|
76
|
+
!engine?.operations[step.op] ||
|
|
77
|
+
engine.asyncOperations?.[step.op]) {
|
|
78
|
+
throw new InputError(`rendition requires a synchronous deterministic raster operation: ${step.op}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const sidecar = resolve(options.sourceProvenance ?? `${source}.provenance.json`);
|
|
82
|
+
let provenanceBytes;
|
|
83
|
+
try {
|
|
84
|
+
provenanceBytes = new Uint8Array(await readFile(sidecar));
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
if (options.sourceProvenance !== undefined ||
|
|
88
|
+
error.code !== "ENOENT") {
|
|
89
|
+
throw new InputError(`cannot read source provenance ${sidecar}`, { cause: error });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
let sourceProvenance;
|
|
93
|
+
let disclosure = readDigitalSourceType(sourceBytes, sniffMediaType(sourceBytes));
|
|
94
|
+
if (provenanceBytes !== undefined) {
|
|
95
|
+
sourceProvenance = json(provenanceBytes, sidecar);
|
|
96
|
+
if (sourceProvenance.generator === "transform") {
|
|
97
|
+
const outputs = sourceProvenance.outputs;
|
|
98
|
+
const matched = Array.isArray(outputs)
|
|
99
|
+
? outputs.find((o) => typeof o === "object" &&
|
|
100
|
+
o !== null &&
|
|
101
|
+
o.sha256 === expected)
|
|
102
|
+
: undefined;
|
|
103
|
+
if (!matched) {
|
|
104
|
+
throw new InputError("source provenance does not identify the selected source SHA-256");
|
|
105
|
+
}
|
|
106
|
+
if (disclosure === undefined && typeof matched.digitalSourceType === "string") {
|
|
107
|
+
disclosure = parseDigitalSourceType(matched.digitalSourceType);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
// Generation provenance has stronger, existing media/record/mark binding checks.
|
|
112
|
+
sourceProvenance = (await checkProvenance({
|
|
113
|
+
media: { path: source, bytes: sourceBytes, mediaType: sniffMediaType(sourceBytes) },
|
|
114
|
+
provenance: {
|
|
115
|
+
path: sidecar,
|
|
116
|
+
bytes: provenanceBytes,
|
|
117
|
+
value: sourceProvenance,
|
|
118
|
+
},
|
|
119
|
+
}));
|
|
120
|
+
const binding = sourceProvenance.binding;
|
|
121
|
+
if (binding?.mediaSha256 !== expected) {
|
|
122
|
+
throw new InputError("source provenance must bind the selected source SHA-256");
|
|
123
|
+
}
|
|
124
|
+
if (Array.isArray(sourceProvenance.calls) && sourceProvenance.calls.length > 0) {
|
|
125
|
+
if (disclosure !== undefined &&
|
|
126
|
+
disclosure !== DIGITAL_SOURCE_TYPES.generated &&
|
|
127
|
+
disclosure !== DIGITAL_SOURCE_TYPES.composite) {
|
|
128
|
+
throw new InputError("source generation provenance contradicts the embedded disclosure");
|
|
129
|
+
}
|
|
130
|
+
disclosure =
|
|
131
|
+
disclosure === DIGITAL_SOURCE_TYPES.composite
|
|
132
|
+
? disclosure
|
|
133
|
+
: DIGITAL_SOURCE_TYPES.generated;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
disclosure ??= options.digitalSourceType;
|
|
138
|
+
requireDeclared(disclosure);
|
|
139
|
+
const plan = audio
|
|
140
|
+
? await transformAudioFiles({
|
|
141
|
+
recipe,
|
|
142
|
+
inputs: [source],
|
|
143
|
+
inputName: options.name ?? "rendition",
|
|
144
|
+
out: join(resolve(options.out), "planned"),
|
|
145
|
+
digitalSourceType: disclosure,
|
|
146
|
+
dryRun: true,
|
|
147
|
+
})
|
|
148
|
+
: await transformFiles({
|
|
149
|
+
...options,
|
|
150
|
+
recipe,
|
|
151
|
+
inputs: [source],
|
|
152
|
+
inputName: options.name ?? "rendition",
|
|
153
|
+
out: join(resolve(options.out), "planned"),
|
|
154
|
+
digitalSourceType: disclosure,
|
|
155
|
+
dryRun: true,
|
|
156
|
+
engines,
|
|
157
|
+
});
|
|
158
|
+
// transformFiles reads the source itself. Refuse a source changed during planning as well.
|
|
159
|
+
if (plan.record.sources[0]?.sha256 !== expected)
|
|
160
|
+
throw new InputError("source SHA-256 changed during planning");
|
|
161
|
+
for (const output of plan.record.outputs)
|
|
162
|
+
requireDeclared(output.digitalSourceType);
|
|
163
|
+
if (options.digitalSourceType === undefined)
|
|
164
|
+
delete plan.record.sourceDeclaration;
|
|
165
|
+
else
|
|
166
|
+
plan.record.sourceDeclaration = sourceDeclaration(options.digitalSourceType);
|
|
167
|
+
const markedModels = readMarkedModels(sourceBytes, sniffMediaType(sourceBytes));
|
|
168
|
+
const models = markedModels
|
|
169
|
+
?.split(";")
|
|
170
|
+
.map((name) => name.trim())
|
|
171
|
+
.filter(Boolean);
|
|
172
|
+
if (models?.length) {
|
|
173
|
+
for (const [index, file] of plan.plannedFiles.entries()) {
|
|
174
|
+
const output = plan.record.outputs[index];
|
|
175
|
+
file.bytes = embedDigitalSourceType(file.bytes, output.mediaType, output.digitalSourceType, {
|
|
176
|
+
models,
|
|
177
|
+
});
|
|
178
|
+
output.sha256 = sha256Hex(file.bytes);
|
|
179
|
+
}
|
|
180
|
+
for (const step of plan.record.steps.filter((step) => step.op === "embed-digital-source-type")) {
|
|
181
|
+
step.params.models = models;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
const resolvedRecipe = plan.record.steps.map(({ op, params, engine }) => ({
|
|
185
|
+
op,
|
|
186
|
+
params,
|
|
187
|
+
engine,
|
|
188
|
+
}));
|
|
189
|
+
const build = {
|
|
190
|
+
version: "assetgrove-rendition/1",
|
|
191
|
+
sourceSha256: expected,
|
|
192
|
+
recipe: resolvedRecipe,
|
|
193
|
+
style: "style" in plan.record ? plan.record.style : undefined,
|
|
194
|
+
decoder: plan.record.sources[0].decodedBy,
|
|
195
|
+
encoders: plan.record.outputs.map((o) => ({ mediaType: o.mediaType, encodedBy: o.encodedBy })),
|
|
196
|
+
digitalSourceTypes: plan.record.outputs.map((o) => o.digitalSourceType),
|
|
197
|
+
};
|
|
198
|
+
const digest = sha256Hex(canonicalJson(build));
|
|
199
|
+
const directory = join(resolve(options.out), digest);
|
|
200
|
+
const outputs = plan.record.outputs.map((output) => {
|
|
201
|
+
if (output.name.includes("/") ||
|
|
202
|
+
output.name.includes("\\") ||
|
|
203
|
+
[".", "..", ""].includes(output.name))
|
|
204
|
+
throw new InputError(`refused: unsafe rendition output name: ${output.name}`);
|
|
205
|
+
return { ...output, path: join(directory, basename(output.path)) };
|
|
206
|
+
});
|
|
207
|
+
// An Ogg's C2PA manifest is a sidecar beside it; the Ogg's bytes, and so the digest, stay.
|
|
208
|
+
const sidecars = [];
|
|
209
|
+
const sign = options.sign ?? !options.preview;
|
|
210
|
+
for (const [index, output] of outputs.entries()) {
|
|
211
|
+
if (options.sidecars === false || !takesSidecar(output.mediaType))
|
|
212
|
+
continue;
|
|
213
|
+
const signer = options.signer ??
|
|
214
|
+
(sign ? await resolveSigner(loadSettings()) : await existingSigner(loadSettings()));
|
|
215
|
+
const name = sidecarName(basename(output.path));
|
|
216
|
+
const path = join(directory, name);
|
|
217
|
+
const existing = (options.existingSidecar && (await options.existingSidecar(name))) ??
|
|
218
|
+
(await readFile(path).then((b) => new Uint8Array(b), () => undefined));
|
|
219
|
+
const claim = {
|
|
220
|
+
digitalSourceType: output.digitalSourceType,
|
|
221
|
+
models: models ?? [],
|
|
222
|
+
title: basename(output.path),
|
|
223
|
+
};
|
|
224
|
+
const fileBytes = plan.plannedFiles[index].bytes;
|
|
225
|
+
let bytes;
|
|
226
|
+
if (sign) {
|
|
227
|
+
bytes = await sidecarCredentialed(fileBytes, output.mediaType, claim, signer, assetgroveVersion(), existing);
|
|
228
|
+
}
|
|
229
|
+
else if (signer !== undefined && existing !== undefined) {
|
|
230
|
+
// Keep-or-sign without the signing: a sidecar that still holds is what the build keeps.
|
|
231
|
+
if (await sidecarHolds(fileBytes, claim, signer, existing))
|
|
232
|
+
bytes = existing;
|
|
233
|
+
}
|
|
234
|
+
const sidecar = {
|
|
235
|
+
name,
|
|
236
|
+
path,
|
|
237
|
+
...(bytes !== undefined && { sha256: sha256Hex(bytes) }),
|
|
238
|
+
...(signer !== undefined && { signer: signer.record }),
|
|
239
|
+
};
|
|
240
|
+
Object.assign(output, { contentCredentials: sidecar });
|
|
241
|
+
sidecars.push({ ...sidecar, ...(bytes !== undefined && { bytes }), output: index });
|
|
242
|
+
}
|
|
243
|
+
checkWrites([
|
|
244
|
+
...outputs.map((output) => basename(output.path)),
|
|
245
|
+
...sidecars.map((s) => s.name),
|
|
246
|
+
"provenance.json",
|
|
247
|
+
]);
|
|
248
|
+
const provenancePath = join(directory, "provenance.json");
|
|
249
|
+
const record = {
|
|
250
|
+
...plan.record,
|
|
251
|
+
outputs: outputs,
|
|
252
|
+
...(sourceProvenance !== undefined && {
|
|
253
|
+
sourceProvenance: {
|
|
254
|
+
path: sidecar,
|
|
255
|
+
sha256: sha256Hex(provenanceBytes),
|
|
256
|
+
record: sourceProvenance,
|
|
257
|
+
},
|
|
258
|
+
}),
|
|
259
|
+
rendition: {
|
|
260
|
+
digest,
|
|
261
|
+
recipe: { name: options.recipe, path: recipePath, sha256: sha256Hex(recipeBytes) },
|
|
262
|
+
resolvedRecipe,
|
|
263
|
+
build,
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
const files = plan.plannedFiles.map((file, i) => ({ ...file, path: outputs[i].path }));
|
|
267
|
+
if (!options.preview) {
|
|
268
|
+
const protectedPaths = [source, recipePath, ...(provenanceBytes ? [sidecar] : [])];
|
|
269
|
+
const protectedStats = await Promise.all(protectedPaths.map((p) => stat(p)));
|
|
270
|
+
// Check all existing targets before writing anything, including links to an input.
|
|
271
|
+
for (const file of [
|
|
272
|
+
...files,
|
|
273
|
+
...sidecars.map((s) => ({ path: s.path, bytes: new Uint8Array() })),
|
|
274
|
+
{ path: provenancePath, bytes: new Uint8Array() },
|
|
275
|
+
]) {
|
|
276
|
+
const existing = await lstat(file.path).catch((error) => {
|
|
277
|
+
if (error.code === "ENOENT")
|
|
278
|
+
return undefined;
|
|
279
|
+
throw error;
|
|
280
|
+
});
|
|
281
|
+
if (existing &&
|
|
282
|
+
(existing.isSymbolicLink() ||
|
|
283
|
+
protectedStats.some((s) => s.dev === existing.dev && s.ino === existing.ino))) {
|
|
284
|
+
throw new InputError(`refused: rendition target aliases an input: ${file.path}`);
|
|
285
|
+
}
|
|
286
|
+
if (existing &&
|
|
287
|
+
files.includes(file) &&
|
|
288
|
+
sha256Hex(await read(file.path)) !== sha256Hex(file.bytes)) {
|
|
289
|
+
throw new InputError(`refused: existing rendition bytes differ: ${file.path}`);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
await mkdir(directory, { recursive: true });
|
|
293
|
+
for (const file of files) {
|
|
294
|
+
try {
|
|
295
|
+
await writeFile(file.path, file.bytes, { flag: "wx" });
|
|
296
|
+
}
|
|
297
|
+
catch (error) {
|
|
298
|
+
if (error.code !== "EEXIST" ||
|
|
299
|
+
sha256Hex(await read(file.path)) !== sha256Hex(file.bytes))
|
|
300
|
+
throw error;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
// A sidecar is replaced when it no longer held for these bytes; `sidecarCredentialed` kept it
|
|
304
|
+
// otherwise, so an unchanged rendition keeps its bytes.
|
|
305
|
+
for (const sidecar of sidecars)
|
|
306
|
+
await writeFile(sidecar.path, sidecar.bytes);
|
|
307
|
+
await writeFile(provenancePath, `${JSON.stringify(record, null, 2)}\n`);
|
|
308
|
+
}
|
|
309
|
+
return {
|
|
310
|
+
record,
|
|
311
|
+
provenancePath,
|
|
312
|
+
digest,
|
|
313
|
+
preview: options.preview ?? false,
|
|
314
|
+
files,
|
|
315
|
+
sidecars: sidecars.map(({ output, path, bytes }) => ({ output, path, bytes })),
|
|
316
|
+
};
|
|
317
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { DigitalSourceType } from "../metadata.ts";
|
|
2
|
+
import type { OriginRecord } from "../origin.ts";
|
|
3
|
+
import type { Raster } from "../image/raster.ts";
|
|
4
|
+
import type { ResolvedStyle } from "../style.ts";
|
|
5
|
+
import type { Size } from "../types.ts";
|
|
6
|
+
import type { ImageEngine, ImageItem, Recipe, RecipeStep, TransformStep } from "./types.ts";
|
|
7
|
+
/** The engines available by default, in preference order. */
|
|
8
|
+
export declare const DEFAULT_ENGINES: ImageEngine[];
|
|
9
|
+
export declare const RECIPE_FORMAT: string;
|
|
10
|
+
/** SHA-256 over `rgba8 <width>x<height>\n` and the RGBA bytes: a hash of the pixels, not a file. */
|
|
11
|
+
export declare function pixelHash(r: Raster): string;
|
|
12
|
+
export interface RunOptions {
|
|
13
|
+
digitalSourceType?: DigitalSourceType;
|
|
14
|
+
/** The style profile, defaults filled in; defaults to soft alpha, full colour, antialiased. */
|
|
15
|
+
style?: ResolvedStyle;
|
|
16
|
+
/** The target profile's frame size, which `register` defaults to. */
|
|
17
|
+
frame?: Size;
|
|
18
|
+
engines?: ImageEngine[];
|
|
19
|
+
materialCall?: import("../calls.ts").Caller;
|
|
20
|
+
}
|
|
21
|
+
/** Validates a step's parameters against its operation's schema (defaults filled). */
|
|
22
|
+
export declare function checkStep(step: RecipeStep, path?: string): Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Runs one operation over the items and returns the new items and its one provenance step. The
|
|
25
|
+
* items given are not changed.
|
|
26
|
+
*/
|
|
27
|
+
export declare function runOperation(items: ImageItem[], step: RecipeStep, options?: RunOptions): {
|
|
28
|
+
items: ImageItem[];
|
|
29
|
+
step: TransformStep;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Reads a recipe file's value: its format line must be `assetgrove-recipe/<n>` (a refusal is exit 2
|
|
33
|
+
* `format_unsupported`), then it is parsed as `parseRecipe` does. `source` names the file.
|
|
34
|
+
*/
|
|
35
|
+
export declare function readRecipe(value: unknown, source: string, engines?: ImageEngine[]): Recipe;
|
|
36
|
+
/** Parses and validates a recipe: its shape, every operation's name and parameters, and engines. */
|
|
37
|
+
export declare function parseRecipe(value: unknown, engines?: ImageEngine[]): Recipe;
|
|
38
|
+
/** Runs a recipe's steps in order; deterministic for the same items, recipe and engine versions. */
|
|
39
|
+
export declare function runRecipe(recipe: Recipe, items: ImageItem[], options?: RunOptions): {
|
|
40
|
+
items: ImageItem[];
|
|
41
|
+
steps: TransformStep[];
|
|
42
|
+
};
|
|
43
|
+
/** A source file as recorded in a transform provenance record. */
|
|
44
|
+
export interface SourceFile {
|
|
45
|
+
digitalSourceType: DigitalSourceType;
|
|
46
|
+
name: string;
|
|
47
|
+
path: string;
|
|
48
|
+
sha256: string;
|
|
49
|
+
mediaType: string;
|
|
50
|
+
pixels: string;
|
|
51
|
+
/** The engine that decoded the file. */
|
|
52
|
+
decodedBy: {
|
|
53
|
+
name: string;
|
|
54
|
+
version: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export interface OutputFile {
|
|
58
|
+
digitalSourceType: DigitalSourceType;
|
|
59
|
+
name: string;
|
|
60
|
+
path: string;
|
|
61
|
+
sha256: string;
|
|
62
|
+
mediaType: string;
|
|
63
|
+
width: number;
|
|
64
|
+
height: number;
|
|
65
|
+
pixels: string;
|
|
66
|
+
/** The engine whose encoder wrote the file's bytes. */
|
|
67
|
+
encodedBy: {
|
|
68
|
+
name: string;
|
|
69
|
+
version: string;
|
|
70
|
+
};
|
|
71
|
+
/** What the operations measured for this output (matte checks, jitter, placement). */
|
|
72
|
+
meta?: Record<string, unknown>;
|
|
73
|
+
}
|
|
74
|
+
/** The provenance record of a transformation: sources, every step, outputs. No clock, no randomness. */
|
|
75
|
+
export interface TransformRecord {
|
|
76
|
+
generator: "transform";
|
|
77
|
+
sourceDeclaration?: import("../metadata.ts").SourceDeclaration;
|
|
78
|
+
/**
|
|
79
|
+
* The third-party origin a source's own provenance (`<source>.provenance.json`) records, so its
|
|
80
|
+
* supplier's terms still apply to what is made from the outputs (issue #683).
|
|
81
|
+
*/
|
|
82
|
+
origin?: OriginRecord;
|
|
83
|
+
recipe?: {
|
|
84
|
+
name?: string;
|
|
85
|
+
description?: string;
|
|
86
|
+
};
|
|
87
|
+
style: ResolvedStyle;
|
|
88
|
+
sources: SourceFile[];
|
|
89
|
+
steps: TransformStep[];
|
|
90
|
+
outputs: OutputFile[];
|
|
91
|
+
}
|
|
92
|
+
export interface TransformFilesOptions extends RunOptions {
|
|
93
|
+
/** Plan encoded outputs without creating directories or writing files. */
|
|
94
|
+
dryRun?: boolean;
|
|
95
|
+
/** Stable item name for a single input, independent of the source file's basename. */
|
|
96
|
+
inputName?: string;
|
|
97
|
+
recipe: Recipe;
|
|
98
|
+
inputs: string[];
|
|
99
|
+
/**
|
|
100
|
+
* A file path when the recipe yields one output and the path has an extension; otherwise a
|
|
101
|
+
* directory, which receives `<name>.<extension>` per output and `provenance.json`.
|
|
102
|
+
*/
|
|
103
|
+
out: string;
|
|
104
|
+
}
|
|
105
|
+
/** Reads the inputs, runs the recipe, writes the outputs and the provenance record beside them. */
|
|
106
|
+
export declare function transformFiles(options: TransformFilesOptions): Promise<{
|
|
107
|
+
record: TransformRecord;
|
|
108
|
+
provenancePath: string;
|
|
109
|
+
plannedFiles: {
|
|
110
|
+
path: string;
|
|
111
|
+
bytes: Uint8Array;
|
|
112
|
+
}[];
|
|
113
|
+
}>;
|
|
114
|
+
/** The operations with their schemas and the engines implementing each, for `assetgrove ops`. */
|
|
115
|
+
export declare function describeOperations(engines?: ImageEngine[]): {
|
|
116
|
+
recipeFormat: string;
|
|
117
|
+
engines: {
|
|
118
|
+
name: string;
|
|
119
|
+
version: string;
|
|
120
|
+
operations: string[];
|
|
121
|
+
encodes: {
|
|
122
|
+
mediaType: string;
|
|
123
|
+
extension: string | undefined;
|
|
124
|
+
}[];
|
|
125
|
+
}[];
|
|
126
|
+
operations: {
|
|
127
|
+
name: string;
|
|
128
|
+
summary: string;
|
|
129
|
+
scope: "all" | "each";
|
|
130
|
+
params: import("./schema.ts").ParamSchema;
|
|
131
|
+
engines: string[];
|
|
132
|
+
}[];
|
|
133
|
+
};
|
|
134
|
+
/** Runs recipes that include bounded external or model-assisted material operations. */
|
|
135
|
+
export declare function runRecipeAsync(recipe: Recipe, items: ImageItem[], options?: RunOptions): Promise<{
|
|
136
|
+
items: ImageItem[];
|
|
137
|
+
steps: TransformStep[];
|
|
138
|
+
}>;
|