@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,89 @@
|
|
|
1
|
+
import type { ReleaseFinding, ReleasePolicy } from "./release-policy.ts";
|
|
2
|
+
import type { ContentSigner } from "./credentials.ts";
|
|
3
|
+
import type { RunOptions } from "./transform/run.ts";
|
|
4
|
+
export interface DeliveryOptions extends Pick<RunOptions, "style" | "frame" | "engines"> {
|
|
5
|
+
/** The selection JSON file. */
|
|
6
|
+
selection: string;
|
|
7
|
+
/** The delivery root directory. */
|
|
8
|
+
out: string;
|
|
9
|
+
/** A dry run: never writes and never creates a directory. */
|
|
10
|
+
preview?: boolean;
|
|
11
|
+
/** A draft: written like a release but never refused on, or presented as, a release. */
|
|
12
|
+
draft?: boolean;
|
|
13
|
+
/** The target profile's `release` section; the placeholder check applies without one. */
|
|
14
|
+
policy?: ReleasePolicy;
|
|
15
|
+
/** The time licence windows are checked at; now by default. */
|
|
16
|
+
now?: Date;
|
|
17
|
+
/** Signs an Ogg rendition's C2PA sidecar; by default as `buildRendition` signs. */
|
|
18
|
+
signer?: ContentSigner;
|
|
19
|
+
}
|
|
20
|
+
export type DeliveryProblemCode = "asset_missing" | "version_missing" | "object_missing" | "recipe_missing" | "item_invalid" | "output_collision" | "placeholder_selected" | "origin_terms" | "version_unapproved" | "license_window";
|
|
21
|
+
export interface DeliveryProblem {
|
|
22
|
+
/** The 0-based index of the selection item. */
|
|
23
|
+
item: number;
|
|
24
|
+
file?: string;
|
|
25
|
+
code: DeliveryProblemCode;
|
|
26
|
+
message: string;
|
|
27
|
+
}
|
|
28
|
+
export interface DeliveryOutput {
|
|
29
|
+
path: string;
|
|
30
|
+
sha256: string;
|
|
31
|
+
mediaType: string;
|
|
32
|
+
size: number;
|
|
33
|
+
digitalSourceType: string;
|
|
34
|
+
/** An Ogg rendition's C2PA sidecar manifest, written beside it. */
|
|
35
|
+
/** In a preview, `sha256` and `size` are absent for a sidecar the delivery would newly sign. */
|
|
36
|
+
contentCredentials?: {
|
|
37
|
+
path: string;
|
|
38
|
+
sha256?: string;
|
|
39
|
+
size?: number;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface DeliveryItem {
|
|
43
|
+
asset: string;
|
|
44
|
+
version: number;
|
|
45
|
+
mezzanine: {
|
|
46
|
+
sha256: string;
|
|
47
|
+
mediaType: string;
|
|
48
|
+
};
|
|
49
|
+
recipe: {
|
|
50
|
+
name: string;
|
|
51
|
+
sha256: string;
|
|
52
|
+
};
|
|
53
|
+
digest: string;
|
|
54
|
+
build: unknown;
|
|
55
|
+
outputs: DeliveryOutput[];
|
|
56
|
+
}
|
|
57
|
+
export interface DeliveryManifest {
|
|
58
|
+
format: "assetgrove-delivery-manifest/1";
|
|
59
|
+
/** Present on a draft delivery, which is not a release. */
|
|
60
|
+
draft?: true;
|
|
61
|
+
items: DeliveryItem[];
|
|
62
|
+
}
|
|
63
|
+
/** An item as far as it resolved; complete items carry everything the manifest lists. */
|
|
64
|
+
export type DeliveryResultItem = (DeliveryItem & {
|
|
65
|
+
item: number;
|
|
66
|
+
}) | PartialItem;
|
|
67
|
+
interface PartialItem {
|
|
68
|
+
item: number;
|
|
69
|
+
asset?: string;
|
|
70
|
+
version?: number;
|
|
71
|
+
sha256?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface DeliveryResult {
|
|
74
|
+
preview: boolean;
|
|
75
|
+
draft: boolean;
|
|
76
|
+
/** True only for a release delivery that passed every check and was written. */
|
|
77
|
+
release: boolean;
|
|
78
|
+
/** Every release check of every item whose version resolved, passed or failed. */
|
|
79
|
+
policy: ReleaseFinding[];
|
|
80
|
+
out: string;
|
|
81
|
+
manifestPath: string;
|
|
82
|
+
manifest: DeliveryManifest;
|
|
83
|
+
items: DeliveryResultItem[];
|
|
84
|
+
problems: DeliveryProblem[];
|
|
85
|
+
written: boolean;
|
|
86
|
+
}
|
|
87
|
+
/** Plans a delivery and, unless `preview`, writes it when no problem was found. */
|
|
88
|
+
export declare function planDelivery(options: DeliveryOptions): Promise<DeliveryResult>;
|
|
89
|
+
export {};
|
package/dist/delivery.js
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delivery planning and writing (issue #478): a selection file names picked asset versions and the
|
|
3
|
+
* recipes that turn each into project renditions. The plan resolves every item to its exact
|
|
4
|
+
* mezzanine bytes (the media file, a Git LFS pointer's object or the local LFS store, never a fetch
|
|
5
|
+
* and never Git), plans the renditions through `buildRendition` in preview, and checks the whole
|
|
6
|
+
* set for missing objects and output collisions before a single file is written. A real delivery
|
|
7
|
+
* writes the outputs and then `delivery.json`, which links each output to its mezzanine and
|
|
8
|
+
* recipe. The manifest holds no time and no absolute path, so repeating a selection reproduces
|
|
9
|
+
* the same files. The library and its review records are only read; a version is staged in a
|
|
10
|
+
* temporary folder so no sidecar of the current pick is applied to an older version.
|
|
11
|
+
* A release delivery (neither `preview` nor `draft`) is also the release gate (issue #479): a
|
|
12
|
+
* selected placeholder, a third-party asset whose supplier's terms do not allow it, and what the
|
|
13
|
+
* profile's `release` policy refuses, is a problem; a preview or a draft reports the same release findings without refusing on them.
|
|
14
|
+
*/
|
|
15
|
+
import { existsSync } from "node:fs";
|
|
16
|
+
import { lstat, mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
17
|
+
import { tmpdir } from "node:os";
|
|
18
|
+
import { basename, dirname, join, posix, resolve } from "node:path";
|
|
19
|
+
import { InputError } from "./errors.js";
|
|
20
|
+
import { readFormat } from "./formats.js";
|
|
21
|
+
import { locateAsset, loadAsset, selectVersion } from "./library/actions.js";
|
|
22
|
+
import { sha256Hex } from "./library/canonical.js";
|
|
23
|
+
import { findGitDir, lfsObjectPath, readMedia } from "./library/lfs.js";
|
|
24
|
+
import { parseDigitalSourceType } from "./metadata.js";
|
|
25
|
+
import { checkWrites } from "./paths.js";
|
|
26
|
+
import { evaluateRelease } from "./release-policy.js";
|
|
27
|
+
import { buildRendition } from "./transform/rendition.js";
|
|
28
|
+
/** The problem a failed release check is, in a release delivery. */
|
|
29
|
+
const RELEASE_PROBLEMS = {
|
|
30
|
+
placeholder: "placeholder_selected",
|
|
31
|
+
"origin-terms": "origin_terms",
|
|
32
|
+
approval: "version_unapproved",
|
|
33
|
+
"license-window": "license_window",
|
|
34
|
+
};
|
|
35
|
+
function text(value, field, where) {
|
|
36
|
+
if (typeof value !== "string" || value === "") {
|
|
37
|
+
throw new InputError(`${where}: "${field}" must be a non-empty string`);
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
function safeTo(to, where) {
|
|
42
|
+
if (to === ".")
|
|
43
|
+
return ".";
|
|
44
|
+
if (to.startsWith("/") ||
|
|
45
|
+
/^[A-Za-z]:/.test(to) ||
|
|
46
|
+
to.includes("\\") ||
|
|
47
|
+
to.split("/").some((s) => s === "" || s === "." || s === "..")) {
|
|
48
|
+
throw new InputError(`${where}: "to" must be a relative folder without "..": ${to}`);
|
|
49
|
+
}
|
|
50
|
+
return to;
|
|
51
|
+
}
|
|
52
|
+
function parseSelection(value, source) {
|
|
53
|
+
const { value: selection } = readFormat("delivery", value, source);
|
|
54
|
+
const recipes = text(selection["recipes"], "recipes", source);
|
|
55
|
+
const raw = selection["items"];
|
|
56
|
+
if (!Array.isArray(raw) || raw.length === 0) {
|
|
57
|
+
throw new InputError(`${source}: "items" must be a non-empty array`);
|
|
58
|
+
}
|
|
59
|
+
const items = raw.map((entry, i) => {
|
|
60
|
+
const where = `${source} item ${i + 1}`;
|
|
61
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
62
|
+
throw new InputError(`${where} must be an object`);
|
|
63
|
+
}
|
|
64
|
+
const e = entry;
|
|
65
|
+
const version = e["version"];
|
|
66
|
+
if (!(typeof version === "number" && Number.isInteger(version) && version > 0) &&
|
|
67
|
+
!(typeof version === "string" && version !== "")) {
|
|
68
|
+
throw new InputError(`${where}: "version" must be a stack number or a sha256`);
|
|
69
|
+
}
|
|
70
|
+
const item = {
|
|
71
|
+
asset: text(e["asset"], "asset", where),
|
|
72
|
+
version: String(version),
|
|
73
|
+
recipe: text(e["recipe"], "recipe", where),
|
|
74
|
+
to: safeTo(text(e["to"], "to", where), where),
|
|
75
|
+
};
|
|
76
|
+
if (e["name"] !== undefined)
|
|
77
|
+
item.name = text(e["name"], "name", where);
|
|
78
|
+
if (e["digitalSourceType"] !== undefined) {
|
|
79
|
+
item.digitalSourceType = parseDigitalSourceType(text(e["digitalSourceType"], "digitalSourceType", where));
|
|
80
|
+
}
|
|
81
|
+
return item;
|
|
82
|
+
});
|
|
83
|
+
return { recipes, items };
|
|
84
|
+
}
|
|
85
|
+
async function lstatOrUndefined(path) {
|
|
86
|
+
try {
|
|
87
|
+
return await lstat(path);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
const code = error.code;
|
|
91
|
+
if (code === "ENOENT" || code === "ENOTDIR")
|
|
92
|
+
return undefined;
|
|
93
|
+
throw error;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** The exact bytes of a version when they are here: the media file or the local LFS store. */
|
|
97
|
+
async function versionBytes(mediaPath, dir, sha256) {
|
|
98
|
+
try {
|
|
99
|
+
const media = await readMedia(mediaPath);
|
|
100
|
+
if ((media.kind === "file" || media.kind === "lfs-object") && media.sha256 === sha256) {
|
|
101
|
+
return media.bytes;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
// Fall through to the LFS store.
|
|
106
|
+
}
|
|
107
|
+
const gitDir = findGitDir(dir);
|
|
108
|
+
if (gitDir === undefined)
|
|
109
|
+
return undefined;
|
|
110
|
+
const bytes = await readFile(lfsObjectPath(gitDir, sha256)).catch(() => undefined);
|
|
111
|
+
return bytes !== undefined && sha256Hex(bytes) === sha256 ? new Uint8Array(bytes) : undefined;
|
|
112
|
+
}
|
|
113
|
+
/** Plans a delivery and, unless `preview`, writes it when no problem was found. */
|
|
114
|
+
export async function planDelivery(options) {
|
|
115
|
+
const selectionPath = resolve(options.selection);
|
|
116
|
+
let value;
|
|
117
|
+
try {
|
|
118
|
+
value = JSON.parse(await readFile(selectionPath, "utf8"));
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
throw new InputError(`cannot read selection ${options.selection}: ${error.message}`, {
|
|
122
|
+
cause: error,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
const { recipes, items } = parseSelection(value, options.selection);
|
|
126
|
+
const base = dirname(selectionPath);
|
|
127
|
+
const recipesDir = resolve(base, recipes);
|
|
128
|
+
const out = resolve(options.out);
|
|
129
|
+
const problems = [];
|
|
130
|
+
const policy = [];
|
|
131
|
+
const now = options.now ?? new Date();
|
|
132
|
+
const gated = options.preview !== true && options.draft !== true;
|
|
133
|
+
const resultItems = [];
|
|
134
|
+
const entries = [];
|
|
135
|
+
const stage = await mkdtemp(join(tmpdir(), "assetgrove-delivery-"));
|
|
136
|
+
try {
|
|
137
|
+
for (const [index, item] of items.entries()) {
|
|
138
|
+
const problem = (code, message, file) => problems.push({ item: index, ...(file !== undefined && { file }), code, message });
|
|
139
|
+
const partial = { item: index };
|
|
140
|
+
resultItems.push(partial);
|
|
141
|
+
const cardPath = resolve(base, item.asset);
|
|
142
|
+
let loaded;
|
|
143
|
+
try {
|
|
144
|
+
loaded = await loadAsset(locateAsset(cardPath));
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
problem("asset_missing", error.message, item.asset);
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
partial.asset = loaded.assetId;
|
|
151
|
+
let version;
|
|
152
|
+
try {
|
|
153
|
+
version = selectVersion(loaded.record, item.version);
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
problem("version_missing", `${item.asset}: ${error.message}`, item.asset);
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
const stack = loaded.record.versions.indexOf(version) + 1;
|
|
160
|
+
partial.version = stack;
|
|
161
|
+
partial.sha256 = version.sha256;
|
|
162
|
+
for (const finding of evaluateRelease({
|
|
163
|
+
item: index,
|
|
164
|
+
asset: loaded.assetId,
|
|
165
|
+
version: stack,
|
|
166
|
+
sha256: version.sha256,
|
|
167
|
+
record: loaded.record,
|
|
168
|
+
card: loaded.card.data,
|
|
169
|
+
}, options.policy, now)) {
|
|
170
|
+
policy.push(finding);
|
|
171
|
+
if (gated && finding.status === "failed") {
|
|
172
|
+
problem(RELEASE_PROBLEMS[finding.check], finding.message, item.asset);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const bytes = await versionBytes(loaded.mediaPath, loaded.dir, version.sha256);
|
|
176
|
+
if (bytes === undefined) {
|
|
177
|
+
problem("object_missing", `${item.asset} version ${stack} (${version.sha256}): its bytes are not in the library or the local LFS store`, item.asset);
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
const recipeFile = join(recipesDir, `${item.recipe}.json`);
|
|
181
|
+
if (!existsSync(recipeFile)) {
|
|
182
|
+
problem("recipe_missing", `recipe ${item.recipe} not found at ${recipeFile}`, item.recipe);
|
|
183
|
+
continue;
|
|
184
|
+
}
|
|
185
|
+
const staged = join(stage, `${index}-mezzanine.bin`);
|
|
186
|
+
await writeFile(staged, bytes);
|
|
187
|
+
let built;
|
|
188
|
+
try {
|
|
189
|
+
built = await buildRendition({
|
|
190
|
+
recipes: recipesDir,
|
|
191
|
+
recipe: item.recipe,
|
|
192
|
+
source: staged,
|
|
193
|
+
sourceSha256: version.sha256,
|
|
194
|
+
out: join(stage, "out"),
|
|
195
|
+
preview: true,
|
|
196
|
+
name: item.name ?? loaded.assetId,
|
|
197
|
+
// A sidecar already delivered is kept while it still holds for the same bytes, so a
|
|
198
|
+
// repeated delivery writes the same files.
|
|
199
|
+
existingSidecar: async (name) => {
|
|
200
|
+
const rel = item.to === "." ? name : posix.join(item.to, name);
|
|
201
|
+
const path = join(out, ...rel.split("/"));
|
|
202
|
+
const found = await lstat(path).catch(() => undefined);
|
|
203
|
+
return found?.isFile() ? new Uint8Array(await readFile(path)) : undefined;
|
|
204
|
+
},
|
|
205
|
+
// A preview delivery signs nothing and so writes nothing, the certificate included.
|
|
206
|
+
sign: options.preview !== true,
|
|
207
|
+
...(options.signer !== undefined && { signer: options.signer }),
|
|
208
|
+
...(item.digitalSourceType !== undefined && {
|
|
209
|
+
digitalSourceType: item.digitalSourceType,
|
|
210
|
+
}),
|
|
211
|
+
...(options.style !== undefined && { style: options.style }),
|
|
212
|
+
...(options.frame !== undefined && { frame: options.frame }),
|
|
213
|
+
...(options.engines !== undefined && { engines: options.engines }),
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
if (!(error instanceof InputError))
|
|
218
|
+
throw error;
|
|
219
|
+
problem("item_invalid", error.message, item.asset);
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
const destination = (path) => item.to === "." ? basename(path) : posix.join(item.to, basename(path));
|
|
223
|
+
const outputs = built.record.outputs.map((output, i) => {
|
|
224
|
+
const rel = destination(output.path);
|
|
225
|
+
entries.push({ item: index, rel, bytes: built.files[i].bytes });
|
|
226
|
+
const sidecar = built.sidecars.find((s) => s.output === i);
|
|
227
|
+
// A preview's sidecar has no bytes when it would be newly signed; its path is still checked.
|
|
228
|
+
if (sidecar !== undefined)
|
|
229
|
+
entries.push({
|
|
230
|
+
item: index,
|
|
231
|
+
rel: destination(sidecar.path),
|
|
232
|
+
bytes: sidecar.bytes ?? new Uint8Array(),
|
|
233
|
+
});
|
|
234
|
+
return {
|
|
235
|
+
path: rel,
|
|
236
|
+
sha256: output.sha256,
|
|
237
|
+
mediaType: output.mediaType,
|
|
238
|
+
size: built.files[i].bytes.length,
|
|
239
|
+
digitalSourceType: output.digitalSourceType,
|
|
240
|
+
...(sidecar !== undefined && {
|
|
241
|
+
contentCredentials: {
|
|
242
|
+
path: destination(sidecar.path),
|
|
243
|
+
...(sidecar.bytes !== undefined && {
|
|
244
|
+
sha256: sha256Hex(sidecar.bytes),
|
|
245
|
+
size: sidecar.bytes.length,
|
|
246
|
+
}),
|
|
247
|
+
},
|
|
248
|
+
}),
|
|
249
|
+
};
|
|
250
|
+
});
|
|
251
|
+
const rendition = built.record.rendition;
|
|
252
|
+
resultItems[index] = {
|
|
253
|
+
item: index,
|
|
254
|
+
asset: loaded.assetId,
|
|
255
|
+
version: stack,
|
|
256
|
+
mezzanine: { sha256: version.sha256, mediaType: built.record.sources[0].mediaType },
|
|
257
|
+
recipe: { name: item.recipe, sha256: rendition.recipe.sha256 },
|
|
258
|
+
digest: built.digest,
|
|
259
|
+
build: rendition.build,
|
|
260
|
+
outputs,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
finally {
|
|
265
|
+
await rm(stage, { recursive: true, force: true });
|
|
266
|
+
}
|
|
267
|
+
const complete = resultItems.filter((r) => "outputs" in r);
|
|
268
|
+
const manifest = {
|
|
269
|
+
format: "assetgrove-delivery-manifest/1",
|
|
270
|
+
...(options.draft === true && { draft: true }),
|
|
271
|
+
items: complete.map(({ item: _item, ...rest }) => rest),
|
|
272
|
+
};
|
|
273
|
+
const manifestBytes = new TextEncoder().encode(`${JSON.stringify(manifest, null, 2)}\n`);
|
|
274
|
+
const manifestEntry = { item: -1, rel: "delivery.json", bytes: manifestBytes };
|
|
275
|
+
await collisions([...entries, manifestEntry], out, problems);
|
|
276
|
+
const written = problems.length === 0 && options.preview !== true;
|
|
277
|
+
if (written) {
|
|
278
|
+
await mkdir(out, { recursive: true });
|
|
279
|
+
for (const entry of [...entries, manifestEntry]) {
|
|
280
|
+
const path = join(out, ...entry.rel.split("/"));
|
|
281
|
+
await mkdir(dirname(path), { recursive: true });
|
|
282
|
+
await writeFile(path, entry.bytes);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return {
|
|
286
|
+
preview: options.preview ?? false,
|
|
287
|
+
draft: options.draft ?? false,
|
|
288
|
+
release: gated && written,
|
|
289
|
+
policy,
|
|
290
|
+
out,
|
|
291
|
+
manifestPath: join(out, "delivery.json"),
|
|
292
|
+
manifest,
|
|
293
|
+
items: resultItems,
|
|
294
|
+
problems,
|
|
295
|
+
written,
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
const label = (entry) => (entry.item < 0 ? "delivery.json" : `item ${entry.item + 1}`);
|
|
299
|
+
/** Collects clashes among planned paths and with what already lies at the destinations. */
|
|
300
|
+
async function collisions(entries, out, problems) {
|
|
301
|
+
const seen = new Map();
|
|
302
|
+
for (const entry of entries) {
|
|
303
|
+
const add = (message) => problems.push({
|
|
304
|
+
item: Math.max(entry.item, 0),
|
|
305
|
+
file: entry.rel,
|
|
306
|
+
code: "output_collision",
|
|
307
|
+
message,
|
|
308
|
+
});
|
|
309
|
+
try {
|
|
310
|
+
checkWrites([entry.rel]);
|
|
311
|
+
}
|
|
312
|
+
catch (error) {
|
|
313
|
+
add(`${label(entry)}: ${error.message}`);
|
|
314
|
+
continue;
|
|
315
|
+
}
|
|
316
|
+
const key = entry.rel.toLowerCase();
|
|
317
|
+
const other = seen.get(key);
|
|
318
|
+
if (other !== undefined) {
|
|
319
|
+
add(`${label(entry)} and ${label(other)} write the same path${other.rel === entry.rel ? "" : ` (differing only by case: "${other.rel}" and "${entry.rel}")`}: ${entry.rel}`);
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
seen.set(key, entry);
|
|
323
|
+
// A folder on the way must be a real folder, not a planned file, a file or a link.
|
|
324
|
+
const segments = entry.rel.split("/");
|
|
325
|
+
let blocked = false;
|
|
326
|
+
for (let n = 1; n < segments.length && !blocked; n++) {
|
|
327
|
+
const folder = segments.slice(0, n).join("/");
|
|
328
|
+
const planned = entries.find((e) => e.rel.toLowerCase() === folder.toLowerCase());
|
|
329
|
+
const found = planned
|
|
330
|
+
? undefined
|
|
331
|
+
: await lstatOrUndefined(join(out, ...segments.slice(0, n)));
|
|
332
|
+
if (planned || (found !== undefined && (found.isSymbolicLink() || !found.isDirectory()))) {
|
|
333
|
+
add(`${label(entry)}: ${entry.rel} needs folder ${folder}, which is ${planned ? `written as a file by ${label(planned)}` : "not a folder"}`);
|
|
334
|
+
blocked = true;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
if (blocked)
|
|
338
|
+
continue;
|
|
339
|
+
const out0 = await lstatOrUndefined(out);
|
|
340
|
+
if (out0 !== undefined && (out0.isSymbolicLink() || !out0.isDirectory())) {
|
|
341
|
+
add(`${out} is not a folder`);
|
|
342
|
+
continue;
|
|
343
|
+
}
|
|
344
|
+
const path = join(out, ...segments);
|
|
345
|
+
const existing = await lstatOrUndefined(path);
|
|
346
|
+
if (existing === undefined)
|
|
347
|
+
continue;
|
|
348
|
+
if (existing.isSymbolicLink() || !existing.isFile()) {
|
|
349
|
+
add(`${label(entry)}: ${entry.rel} exists and is not a regular file`);
|
|
350
|
+
}
|
|
351
|
+
else if (sha256Hex(await readFile(path)) !== sha256Hex(entry.bytes)) {
|
|
352
|
+
add(`${label(entry)}: ${entry.rel} exists with different bytes`);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { KindMedia } from "./media.ts";
|
|
2
|
+
import type { Settings } from "./settings.ts";
|
|
3
|
+
export interface DisclosureCount {
|
|
4
|
+
name: string;
|
|
5
|
+
assets: number;
|
|
6
|
+
}
|
|
7
|
+
export interface DisclosureTerms {
|
|
8
|
+
terms: string;
|
|
9
|
+
/** The `as of` date the terms were recorded with, when they say one. */
|
|
10
|
+
asOf?: string;
|
|
11
|
+
assets: number;
|
|
12
|
+
}
|
|
13
|
+
export interface DisclosureSigner {
|
|
14
|
+
subject: string;
|
|
15
|
+
certificateSha256: string;
|
|
16
|
+
development: boolean;
|
|
17
|
+
assets: number;
|
|
18
|
+
}
|
|
19
|
+
export interface DisclosureCredentials {
|
|
20
|
+
/** Assets whose provenance records a signing certificate. */
|
|
21
|
+
signed: number;
|
|
22
|
+
/** Of those, the assets signed with the local development certificate. */
|
|
23
|
+
development: number;
|
|
24
|
+
signers: DisclosureSigner[];
|
|
25
|
+
/** Present only when something was signed with the development certificate. */
|
|
26
|
+
note?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface StoreEvidence {
|
|
29
|
+
policy: string;
|
|
30
|
+
checkedOn: string;
|
|
31
|
+
status: "resolved" | "unresolved";
|
|
32
|
+
affectedAssets: string[];
|
|
33
|
+
unresolvedAssets: string[];
|
|
34
|
+
what: string;
|
|
35
|
+
how: string;
|
|
36
|
+
}
|
|
37
|
+
export interface DisclosureSound {
|
|
38
|
+
asset: string;
|
|
39
|
+
kind: string;
|
|
40
|
+
models: string[];
|
|
41
|
+
providers: string[];
|
|
42
|
+
plans: string[];
|
|
43
|
+
/** Present only when a call's output grant is not exclusive. */
|
|
44
|
+
exclusive?: false;
|
|
45
|
+
trainingOptOut?: {
|
|
46
|
+
optedOut: boolean;
|
|
47
|
+
since: string;
|
|
48
|
+
source: string;
|
|
49
|
+
};
|
|
50
|
+
line: string;
|
|
51
|
+
}
|
|
52
|
+
export interface Disclosure {
|
|
53
|
+
/** Cards read. */
|
|
54
|
+
assets: number;
|
|
55
|
+
/** Assets by kind, then by IPTC source type (the vocabulary's last segment, or `unknown`). */
|
|
56
|
+
byKind: Record<string, Record<string, number>>;
|
|
57
|
+
bySourceType: DisclosureCount[];
|
|
58
|
+
models: DisclosureCount[];
|
|
59
|
+
providers: DisclosureCount[];
|
|
60
|
+
/** The model vendors behind gateway calls; empty without settings to name the adapters. */
|
|
61
|
+
vendors: DisclosureCount[];
|
|
62
|
+
terms: DisclosureTerms[];
|
|
63
|
+
contentCredentials: DisclosureCredentials;
|
|
64
|
+
/** Cards whose provenance could not be read; they count as `unknown`. */
|
|
65
|
+
withoutProvenance: string[];
|
|
66
|
+
/** One entry per audio asset, from its route record, sorted by asset name. */
|
|
67
|
+
sounds: DisclosureSound[];
|
|
68
|
+
godot: StoreEvidence;
|
|
69
|
+
playdate: StoreEvidence;
|
|
70
|
+
steam: string;
|
|
71
|
+
itch: {
|
|
72
|
+
tags: string[];
|
|
73
|
+
text: string;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/** Summarises the library under `root` from its cards and provenance. */
|
|
77
|
+
export declare function disclose(root: string, options?: {
|
|
78
|
+
settings?: Pick<Settings, "providers">;
|
|
79
|
+
selected?: string[];
|
|
80
|
+
/** The kinds whose media trait says which assets are audio; core's by default. */
|
|
81
|
+
kinds?: KindMedia;
|
|
82
|
+
}): Promise<Disclosure>;
|
|
83
|
+
/** The summary as Markdown, for `--out`. */
|
|
84
|
+
export declare function disclosureMarkdown(d: Disclosure): string;
|