@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,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The doctor report (issue #483): what each hand-off preset's `doctor` hook finds wrong in the
|
|
3
|
+
* target. Read-only: the target is listed and read, Git is only asked, and nothing is written.
|
|
4
|
+
*/
|
|
5
|
+
import { execFile, spawn } from "node:child_process";
|
|
6
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
7
|
+
import { isAbsolute, join, posix, relative, resolve } from "node:path";
|
|
8
|
+
import { promisify } from "node:util";
|
|
9
|
+
import { gitReadOnlyEnv } from "../env.js";
|
|
10
|
+
import { LFS_EXTENSIONS } from "../gitlfs.js";
|
|
11
|
+
import { readLibrary } from "../library/maintain.js";
|
|
12
|
+
import { libraryOriginSchema } from "../origin.js";
|
|
13
|
+
import { assetFiles, cardFiles, isPublicRepository, isRestricted, readStorageField, relPosix, storageField, trackedOf, } from "../storage.js";
|
|
14
|
+
import { realOf } from "../handoff.js";
|
|
15
|
+
import { libraryConfig } from "../library/write.js";
|
|
16
|
+
import { inGitDir } from "../paths.js";
|
|
17
|
+
import { isInside } from "../settings.js";
|
|
18
|
+
import { listTarget, usageRead } from "./usage.js";
|
|
19
|
+
import { resolveHandoff } from "./presets/index.js";
|
|
20
|
+
const execGit = promisify(execFile);
|
|
21
|
+
/** Git told not to write anything, such as a refreshed index. */
|
|
22
|
+
const GIT_ENV = gitReadOnlyEnv();
|
|
23
|
+
/** The findings of every preset of the profile that has a `doctor`, merged and sorted. */
|
|
24
|
+
export async function projectDoctor(input) {
|
|
25
|
+
const { profile, registry } = input;
|
|
26
|
+
const presets = resolveHandoff(profile, registry).filter((p) => p.preset.doctor !== undefined);
|
|
27
|
+
const root = resolve(input.targetDir);
|
|
28
|
+
const realTarget = realOf(root);
|
|
29
|
+
const guarded = [input.configDir, input.stateDir].map((dir) => realOf(resolve(dir)));
|
|
30
|
+
const read = usageRead(root, realTarget, guarded);
|
|
31
|
+
const ctx = {
|
|
32
|
+
profile,
|
|
33
|
+
list: (dir) => listTarget(root, realTarget, dir, guarded),
|
|
34
|
+
tracked: (dir) => tracked(root, realTarget, dir, guarded),
|
|
35
|
+
lfs: (paths) => lfsPaths(root, realTarget, paths),
|
|
36
|
+
};
|
|
37
|
+
const merged = new Map();
|
|
38
|
+
const errors = [];
|
|
39
|
+
const core = await libraryLfsFinding(profile, root, ctx);
|
|
40
|
+
if (core !== undefined) {
|
|
41
|
+
merged.set(JSON.stringify([core.code, core.path, null, core.problem, core.correction]), {
|
|
42
|
+
...core,
|
|
43
|
+
presets: ["core"],
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
for (const finding of await restrictedMediaFindings(profile, root, input.storage)) {
|
|
47
|
+
merged.set(JSON.stringify([finding.code, finding.path, null]), {
|
|
48
|
+
...finding,
|
|
49
|
+
presets: ["core"],
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
for (const { preset, options } of presets) {
|
|
53
|
+
try {
|
|
54
|
+
for (const finding of await preset.doctor(ctx, options, read)) {
|
|
55
|
+
const key = JSON.stringify([
|
|
56
|
+
finding.code,
|
|
57
|
+
finding.path,
|
|
58
|
+
finding.line ?? null,
|
|
59
|
+
finding.problem,
|
|
60
|
+
finding.correction,
|
|
61
|
+
]);
|
|
62
|
+
const have = merged.get(key);
|
|
63
|
+
if (have === undefined)
|
|
64
|
+
merged.set(key, { ...finding, presets: [preset.name] });
|
|
65
|
+
else if (!have.presets.includes(preset.name))
|
|
66
|
+
have.presets.push(preset.name);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
errors.push({
|
|
71
|
+
preset: preset.name,
|
|
72
|
+
error: error instanceof Error ? error.message : String(error),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return { findings: sortFindings([...merged.values()]), errors };
|
|
77
|
+
}
|
|
78
|
+
/** Sorts findings in place by path, line and code, the order the doctor report lists them in. */
|
|
79
|
+
export function sortFindings(findings) {
|
|
80
|
+
const order = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
81
|
+
return findings.sort((a, b) => order(a.path, b.path) || (a.line ?? 0) - (b.line ?? 0) || order(a.code, b.code));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Restricted media Git tracks in a repository the settings call public (issue #684): each file of a
|
|
85
|
+
* private or local asset that `git ls-files` names. The level is derived as hand-off derives it:
|
|
86
|
+
* the stricter of the origin's default and the card's recorded level, so a card handed off before
|
|
87
|
+
* it recorded `storage` is checked too; its files are the recorded ones, else its media and the
|
|
88
|
+
* binary files beside it.
|
|
89
|
+
*/
|
|
90
|
+
async function restrictedMediaFindings(profile, root, storage) {
|
|
91
|
+
if (storage === undefined || !(await inWorkTree(root)) || !isPublicRepository(root, storage))
|
|
92
|
+
return [];
|
|
93
|
+
let state;
|
|
94
|
+
try {
|
|
95
|
+
state = await readLibrary(profile, root);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
const findings = [];
|
|
101
|
+
for (const asset of state.assets) {
|
|
102
|
+
const data = asset.card?.parsed.data;
|
|
103
|
+
if (data === undefined || typeof data["resource"] !== "string")
|
|
104
|
+
continue;
|
|
105
|
+
const origin = libraryOriginSchema.safeParse(data["origin"]);
|
|
106
|
+
const lock = data["lock"];
|
|
107
|
+
const beside = () => assetFiles(asset.cardPath, data["resource"], String(lock?.sha256 ?? ""));
|
|
108
|
+
const field = storageField(origin.success ? origin.data : undefined, readStorageField(data["storage"]), beside);
|
|
109
|
+
if (!isRestricted(field.level))
|
|
110
|
+
continue;
|
|
111
|
+
let files;
|
|
112
|
+
try {
|
|
113
|
+
files = cardFiles(asset.cardPath, field, state.config.root).map((file) => file.abs);
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
// A recorded path outside the library is not followed; the media beside the card still is.
|
|
117
|
+
try {
|
|
118
|
+
files = cardFiles(asset.cardPath, { ...field, files: beside() }, state.config.root).map((file) => file.abs);
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
for (const abs of trackedOf(root, files)) {
|
|
125
|
+
const rel = relPosix(root, abs);
|
|
126
|
+
findings.push({
|
|
127
|
+
code: "restricted-media-tracked",
|
|
128
|
+
path: rel,
|
|
129
|
+
problem: `${asset.id} is ${field.level}, and Git tracks its media in a repository the settings call public`,
|
|
130
|
+
correction: `run git rm --cached -- ${rel} and commit; remove it from the published history too, and keep it in the store (assetgrove storage push)`,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return findings;
|
|
135
|
+
}
|
|
136
|
+
/** The library's managed block no longer routes every LFS type to LFS (a type added since init). */
|
|
137
|
+
async function libraryLfsFinding(profile, root, ctx) {
|
|
138
|
+
let library;
|
|
139
|
+
try {
|
|
140
|
+
library = libraryConfig(profile, root);
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
return undefined;
|
|
144
|
+
}
|
|
145
|
+
const file = join(library.root, ".gitattributes");
|
|
146
|
+
if (!existsSync(file))
|
|
147
|
+
return undefined;
|
|
148
|
+
let text;
|
|
149
|
+
try {
|
|
150
|
+
text = readFileSync(file, "utf8");
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
return undefined;
|
|
154
|
+
}
|
|
155
|
+
if (!text.split(/\r?\n/).some((line) => line.startsWith("# BEGIN assetgrove")))
|
|
156
|
+
return undefined;
|
|
157
|
+
if (!(await inWorkTree(root)))
|
|
158
|
+
return undefined;
|
|
159
|
+
const prefix = library.rootRel === "" ? "" : `${library.rootRel}/`;
|
|
160
|
+
const probes = LFS_EXTENSIONS.map((ext) => `${prefix}assetgrove-doctor-probe.${ext}`);
|
|
161
|
+
const stored = new Set(await ctx.lfs(probes));
|
|
162
|
+
const missing = LFS_EXTENSIONS.filter((_, i) => !stored.has(probes[i]));
|
|
163
|
+
if (missing.length === 0)
|
|
164
|
+
return undefined;
|
|
165
|
+
const list = missing.map((ext) => `.${ext}`).join(", ");
|
|
166
|
+
return {
|
|
167
|
+
code: "lfs-rules-outdated",
|
|
168
|
+
path: `${prefix}.gitattributes`,
|
|
169
|
+
problem: `Git does not store ${list} files in the library in Git LFS`,
|
|
170
|
+
correction: `run assetgrove init again to update its managed block, or add ${missing
|
|
171
|
+
.map((ext) => `\`*.${ext} filter=lfs diff=lfs merge=lfs -text\``)
|
|
172
|
+
.join(", ")}`,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
async function inWorkTree(root) {
|
|
176
|
+
try {
|
|
177
|
+
const { stdout } = await execGit("git", ["rev-parse", "--is-inside-work-tree"], {
|
|
178
|
+
cwd: root,
|
|
179
|
+
env: GIT_ENV,
|
|
180
|
+
});
|
|
181
|
+
return stdout.trim() === "true";
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
/** A target-relative path made with `/`, or undefined when it leaves the target or is in `.git`. */
|
|
188
|
+
function inTarget(root, path) {
|
|
189
|
+
if (isAbsolute(path))
|
|
190
|
+
return undefined;
|
|
191
|
+
const rel = posix.normalize(path.replaceAll("\\", "/") || ".");
|
|
192
|
+
if (rel === ".." || rel.startsWith("../") || rel.startsWith("/") || inGitDir(rel))
|
|
193
|
+
return undefined;
|
|
194
|
+
return relative(root, resolve(root, rel)) === "" && rel !== "." ? undefined : rel;
|
|
195
|
+
}
|
|
196
|
+
async function tracked(root, realTarget, dir, guarded) {
|
|
197
|
+
const rel = inTarget(root, dir);
|
|
198
|
+
if (rel === undefined)
|
|
199
|
+
return [];
|
|
200
|
+
const start = realOf(join(root, ...rel.split("/")));
|
|
201
|
+
if (!isInside(start, realTarget) || guarded.some((g) => isInside(start, g)))
|
|
202
|
+
return [];
|
|
203
|
+
let stdout;
|
|
204
|
+
try {
|
|
205
|
+
({ stdout } = await execGit("git", ["--literal-pathspecs", "ls-files", "-z", "--", rel], {
|
|
206
|
+
cwd: root,
|
|
207
|
+
env: GIT_ENV,
|
|
208
|
+
maxBuffer: 1 << 28,
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
return [];
|
|
213
|
+
}
|
|
214
|
+
return stdout
|
|
215
|
+
.split("\0")
|
|
216
|
+
.filter((p) => p !== "" &&
|
|
217
|
+
!inGitDir(p) &&
|
|
218
|
+
!guarded.some((g) => isInside(realOf(join(root, ...p.split("/"))), g)))
|
|
219
|
+
.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
|
|
220
|
+
}
|
|
221
|
+
async function lfsPaths(root, realTarget, paths) {
|
|
222
|
+
const asked = [
|
|
223
|
+
...new Set(paths.flatMap((p) => {
|
|
224
|
+
const rel = inTarget(root, p);
|
|
225
|
+
return rel === undefined || rel === "." ? [] : [rel];
|
|
226
|
+
})),
|
|
227
|
+
];
|
|
228
|
+
if (asked.length === 0 || realTarget === "")
|
|
229
|
+
return [];
|
|
230
|
+
const out = await new Promise((done) => {
|
|
231
|
+
const child = spawn("git", ["--literal-pathspecs", "check-attr", "-z", "--stdin", "filter"], {
|
|
232
|
+
cwd: root,
|
|
233
|
+
env: GIT_ENV,
|
|
234
|
+
});
|
|
235
|
+
let text = "";
|
|
236
|
+
child.stdout.setEncoding("utf8");
|
|
237
|
+
child.stdout.on("data", (chunk) => (text += chunk));
|
|
238
|
+
child.on("error", () => done(""));
|
|
239
|
+
child.on("close", (code) => done(code === 0 ? text : ""));
|
|
240
|
+
child.stdin.on("error", () => { });
|
|
241
|
+
child.stdin.end(asked.join("\0") + "\0");
|
|
242
|
+
});
|
|
243
|
+
const fields = out.split("\0");
|
|
244
|
+
const found = [];
|
|
245
|
+
for (let i = 0; i + 2 < fields.length; i += 3)
|
|
246
|
+
if (fields[i + 2] === "lfs")
|
|
247
|
+
found.push(fields[i]);
|
|
248
|
+
return found.sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
|
|
249
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DigitalSourceType } from "../metadata.ts";
|
|
2
|
+
/** The media type of a path in a format that can carry the mark, by its extension. */
|
|
3
|
+
export declare function markableMediaType(path: string): string | undefined;
|
|
4
|
+
/** Whether a media type names a format that can carry the mark. */
|
|
5
|
+
export declare function canCarryMark(mediaType: string): boolean;
|
|
6
|
+
/** What a written file's mark must say. */
|
|
7
|
+
export interface ExpectedMark {
|
|
8
|
+
digitalSourceType: DigitalSourceType;
|
|
9
|
+
models: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
/** One problem with a written file's mark, and the hand-off code of the branch that found it. */
|
|
12
|
+
export interface MarkProblem {
|
|
13
|
+
code: "mark_missing" | "mark_invalid";
|
|
14
|
+
message: string;
|
|
15
|
+
}
|
|
16
|
+
/** The problems with one written file's mark; empty when it carries it. */
|
|
17
|
+
export declare function markProblems(path: string, bytes: Uint8Array | undefined, mediaType: string, expected: ExpectedMark): MarkProblem[];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The mark check of a hand-off (design section 6): each preset's check reads the AI mark back from
|
|
3
|
+
* every written file whose format can carry it, the atlas images included, and names each file
|
|
4
|
+
* that lacks it. The mark is the IPTC digital source type and, when provenance names models, the
|
|
5
|
+
* models. Formats that cannot carry a mark are not checked; the record (provenance and the card)
|
|
6
|
+
* still holds the source type for them.
|
|
7
|
+
*/
|
|
8
|
+
import { extname } from "node:path";
|
|
9
|
+
import { modelText, readDigitalSourceType, readMarkedModels } from "../metadata.js";
|
|
10
|
+
const MEDIA_TYPES = {
|
|
11
|
+
".png": "image/png",
|
|
12
|
+
".jpg": "image/jpeg",
|
|
13
|
+
".jpeg": "image/jpeg",
|
|
14
|
+
".webp": "image/webp",
|
|
15
|
+
".glb": "model/gltf-binary",
|
|
16
|
+
".gltf": "model/gltf+json",
|
|
17
|
+
".ktx2": "image/ktx2",
|
|
18
|
+
".wav": "audio/wav",
|
|
19
|
+
".ogg": "audio/ogg",
|
|
20
|
+
".opus": "audio/ogg",
|
|
21
|
+
".m4a": "audio/mp4",
|
|
22
|
+
};
|
|
23
|
+
/** The media type of a path in a format that can carry the mark, by its extension. */
|
|
24
|
+
export function markableMediaType(path) {
|
|
25
|
+
return MEDIA_TYPES[extname(path).toLowerCase()];
|
|
26
|
+
}
|
|
27
|
+
/** Whether a media type names a format that can carry the mark. */
|
|
28
|
+
export function canCarryMark(mediaType) {
|
|
29
|
+
return Object.values(MEDIA_TYPES).includes(mediaType);
|
|
30
|
+
}
|
|
31
|
+
/** The problems with one written file's mark; empty when it carries it. */
|
|
32
|
+
export function markProblems(path, bytes, mediaType, expected) {
|
|
33
|
+
if (bytes === undefined || expected.digitalSourceType === "undeclared")
|
|
34
|
+
return [];
|
|
35
|
+
let source;
|
|
36
|
+
let models;
|
|
37
|
+
try {
|
|
38
|
+
source = readDigitalSourceType(bytes, mediaType);
|
|
39
|
+
models = readMarkedModels(bytes, mediaType);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return [
|
|
43
|
+
{
|
|
44
|
+
code: "mark_invalid",
|
|
45
|
+
message: `${path} is not a readable ${mediaType} file, so its AI mark cannot be read`,
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
if (source === undefined)
|
|
50
|
+
return [
|
|
51
|
+
{ code: "mark_missing", message: `${path} lacks the AI mark (the IPTC digital source type)` },
|
|
52
|
+
];
|
|
53
|
+
if (source !== expected.digitalSourceType)
|
|
54
|
+
return [
|
|
55
|
+
{
|
|
56
|
+
code: "mark_invalid",
|
|
57
|
+
message: `${path} marks source type ${source}, expected ${expected.digitalSourceType}`,
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
const wanted = modelText(expected.models);
|
|
61
|
+
if (wanted !== undefined && models !== wanted)
|
|
62
|
+
return [
|
|
63
|
+
{ code: "mark_invalid", message: `${path} lacks the provenance's models in its AI mark` },
|
|
64
|
+
];
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { animationProblems, animationsOf, atlasFile, atlasOptions, buildAtlas, checkAtlas, sidecarPath, stripGeometry, } from "./atlas-json.js";
|
|
2
|
+
export const asepriteJsonPreset = {
|
|
3
|
+
name: "aseprite-json",
|
|
4
|
+
optionsSchema: atlasOptions("array"),
|
|
5
|
+
async write(ctx, { shape }) {
|
|
6
|
+
const g = stripGeometry(ctx, "aseprite-json");
|
|
7
|
+
const doc = buildAtlas(g, shape, true);
|
|
8
|
+
doc.animations = animationsOf(g);
|
|
9
|
+
doc.meta["frameTags"] = [{ name: g.animation, from: 0, to: g.count - 1, direction: "forward" }];
|
|
10
|
+
return [atlasFile(sidecarPath(g.media, ".aseprite.json"), doc)];
|
|
11
|
+
},
|
|
12
|
+
async check(ctx, { shape }, files, read) {
|
|
13
|
+
const g = stripGeometry(ctx, "aseprite-json");
|
|
14
|
+
const file = files[0]?.path ?? sidecarPath(g.media, ".aseprite.json");
|
|
15
|
+
return checkAtlas(g, shape, file, read, (doc) => {
|
|
16
|
+
const rawMeta = doc["meta"];
|
|
17
|
+
const meta = rawMeta !== null && typeof rawMeta === "object" && !Array.isArray(rawMeta)
|
|
18
|
+
? rawMeta
|
|
19
|
+
: {};
|
|
20
|
+
const tags = Array.isArray(meta["frameTags"]) ? meta["frameTags"] : [];
|
|
21
|
+
const covered = new Set();
|
|
22
|
+
const problems = animationProblems(g, doc, file);
|
|
23
|
+
for (const t of tags) {
|
|
24
|
+
const { from, to } = (t ?? {});
|
|
25
|
+
if (Number.isInteger(from) && Number.isInteger(to)) {
|
|
26
|
+
if (from < 0 || to > g.count - 1) {
|
|
27
|
+
problems.push(`${file} a meta.frameTags entry names frames outside 0 to ${g.count - 1}`);
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
for (let i = from; i <= to; i++)
|
|
31
|
+
covered.add(i);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (!Array.from({ length: g.count }, (_, i) => covered.has(i)).every(Boolean)) {
|
|
35
|
+
problems.push(`${file} meta.frameTags do not cover frames 0 to ${g.count - 1}`);
|
|
36
|
+
}
|
|
37
|
+
const frames = doc["frames"];
|
|
38
|
+
const list = Array.isArray(frames) ? frames : Object.values((frames ?? {}));
|
|
39
|
+
if (list.some((f) => f?.duration !== g.durationMs)) {
|
|
40
|
+
problems.push(`${file} a frame has no duration of ${g.durationMs}`);
|
|
41
|
+
}
|
|
42
|
+
return problems;
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { HandoffPreset, PresetContext, PresetFile } from "./index.ts";
|
|
3
|
+
export type AtlasShape = "hash" | "array";
|
|
4
|
+
export declare const atlasOptions: (defaultShape: AtlasShape) => z.ZodObject<{
|
|
5
|
+
shape: z.ZodDefault<z.ZodEnum<{
|
|
6
|
+
array: "array";
|
|
7
|
+
hash: "hash";
|
|
8
|
+
}>>;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
|
+
export interface StripGeometry {
|
|
11
|
+
assetId: string;
|
|
12
|
+
animation: string;
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
count: number;
|
|
16
|
+
durationMs: number;
|
|
17
|
+
/** The media path relative to the target directory, with `/`. */
|
|
18
|
+
media: string;
|
|
19
|
+
}
|
|
20
|
+
/** The strip's geometry from the hand-off context; anything that is not a strip is invalid input. */
|
|
21
|
+
export declare function stripGeometry(ctx: PresetContext, preset: string): StripGeometry;
|
|
22
|
+
export declare const frameName: (assetId: string, i: number) => string;
|
|
23
|
+
/** The JSON path beside the media: `<media without extension><suffix>`. */
|
|
24
|
+
export declare function sidecarPath(media: string, suffix: string): string;
|
|
25
|
+
export interface AtlasDoc {
|
|
26
|
+
frames: Record<string, unknown> | Record<string, unknown>[];
|
|
27
|
+
meta: Record<string, unknown>;
|
|
28
|
+
animations?: Record<string, string[]>;
|
|
29
|
+
}
|
|
30
|
+
export declare function buildAtlas(g: StripGeometry, shape: AtlasShape, withDuration: boolean): AtlasDoc;
|
|
31
|
+
export declare const animationsOf: (g: StripGeometry) => Record<string, string[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Compares a read-back document's `animations` with what the preset wrote (`animationsOf`): the same
|
|
34
|
+
* animation names, each listing the same frame names in the same order.
|
|
35
|
+
*/
|
|
36
|
+
export declare function animationProblems(g: StripGeometry, doc: Record<string, unknown>, file: string): string[];
|
|
37
|
+
export declare function atlasFile(path: string, doc: unknown): PresetFile;
|
|
38
|
+
type Read = (path: string) => Promise<Uint8Array | undefined>;
|
|
39
|
+
/** Reads the JSON and the PNG back and returns what disagrees with the strip's geometry. */
|
|
40
|
+
export declare function checkAtlas(g: StripGeometry, shape: AtlasShape, file: string, read: Read, extra: (doc: Record<string, unknown>) => string[]): Promise<string[]>;
|
|
41
|
+
export declare const atlasJsonPreset: HandoffPreset<{
|
|
42
|
+
shape: AtlasShape;
|
|
43
|
+
}>;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `atlas-json` preset (design section 14): sprite-atlas JSON written from a strip's own
|
|
3
|
+
* geometry, without repacking. Frames are named `<assetId>_<nnn>`; `meta` holds app, version,
|
|
4
|
+
* image, format, size and scale; `animations` maps the animation to its frame names. `shape` is
|
|
5
|
+
* `hash` (frames keyed by name) or `array`. The check reads the JSON and the PNG back. The writer
|
|
6
|
+
* is hand-written (docs/decisions.md: no library writes these).
|
|
7
|
+
*/
|
|
8
|
+
import { posix } from "node:path";
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
import { InputError } from "../../errors.js";
|
|
11
|
+
import { decodePng } from "../../image/raster.js";
|
|
12
|
+
import { lookup } from "../../template.js";
|
|
13
|
+
export const atlasOptions = (defaultShape) => z.strictObject({ shape: z.enum(["hash", "array"]).default(defaultShape) });
|
|
14
|
+
const posInt = (v) => typeof v === "number" && Number.isInteger(v) && v > 0;
|
|
15
|
+
/** The strip's geometry from the hand-off context; anything that is not a strip is invalid input. */
|
|
16
|
+
export function stripGeometry(ctx, preset) {
|
|
17
|
+
const spec = (lookup(ctx.context, "spec") ?? {});
|
|
18
|
+
const frames = lookup(ctx.context, "output.frames");
|
|
19
|
+
const media = lookup(ctx.context, "output.path");
|
|
20
|
+
const assetId = spec["assetId"];
|
|
21
|
+
if (ctx.frames !== "strip" ||
|
|
22
|
+
frames === undefined ||
|
|
23
|
+
frames === null ||
|
|
24
|
+
!posInt(frames["width"]) ||
|
|
25
|
+
!posInt(frames["height"]) ||
|
|
26
|
+
!posInt(frames["count"]) ||
|
|
27
|
+
typeof media !== "string" ||
|
|
28
|
+
typeof assetId !== "string") {
|
|
29
|
+
throw new InputError(`preset "${preset}" needs a sprite strip with frame width, height and count`);
|
|
30
|
+
}
|
|
31
|
+
const family = spec["animationFamily"];
|
|
32
|
+
const duration = frames["durationMs"] ?? ctx.profile.frames.durationMs;
|
|
33
|
+
return {
|
|
34
|
+
assetId,
|
|
35
|
+
animation: typeof family === "string" && family !== "" ? family : assetId,
|
|
36
|
+
width: frames["width"],
|
|
37
|
+
height: frames["height"],
|
|
38
|
+
count: frames["count"],
|
|
39
|
+
durationMs: posInt(duration) ? duration : 100,
|
|
40
|
+
media: media.replaceAll("\\", "/"),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export const frameName = (assetId, i) => `${assetId}_${String(i).padStart(3, "0")}`;
|
|
44
|
+
/** The JSON path beside the media: `<media without extension><suffix>`. */
|
|
45
|
+
export function sidecarPath(media, suffix) {
|
|
46
|
+
const ext = posix.extname(media);
|
|
47
|
+
return `${ext === "" ? media : media.slice(0, -ext.length)}${suffix}`;
|
|
48
|
+
}
|
|
49
|
+
export function buildAtlas(g, shape, withDuration) {
|
|
50
|
+
const entries = Array.from({ length: g.count }, (_, i) => ({
|
|
51
|
+
filename: frameName(g.assetId, i),
|
|
52
|
+
frame: { x: i * g.width, y: 0, w: g.width, h: g.height },
|
|
53
|
+
rotated: false,
|
|
54
|
+
trimmed: false,
|
|
55
|
+
spriteSourceSize: { x: 0, y: 0, w: g.width, h: g.height },
|
|
56
|
+
sourceSize: { w: g.width, h: g.height },
|
|
57
|
+
...(withDuration && { duration: g.durationMs }),
|
|
58
|
+
}));
|
|
59
|
+
const frames = shape === "array"
|
|
60
|
+
? entries
|
|
61
|
+
: Object.fromEntries(entries.map(({ filename, ...rest }) => [filename, rest]));
|
|
62
|
+
return {
|
|
63
|
+
frames,
|
|
64
|
+
meta: {
|
|
65
|
+
app: "assetgrove",
|
|
66
|
+
version: "1.0",
|
|
67
|
+
image: posix.basename(g.media),
|
|
68
|
+
format: "RGBA8888",
|
|
69
|
+
size: { w: g.width * g.count, h: g.height },
|
|
70
|
+
scale: "1",
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export const animationsOf = (g) => ({
|
|
75
|
+
[g.animation]: Array.from({ length: g.count }, (_, i) => frameName(g.assetId, i)),
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* Compares a read-back document's `animations` with what the preset wrote (`animationsOf`): the same
|
|
79
|
+
* animation names, each listing the same frame names in the same order.
|
|
80
|
+
*/
|
|
81
|
+
export function animationProblems(g, doc, file) {
|
|
82
|
+
const want = animationsOf(g);
|
|
83
|
+
const raw = doc["animations"];
|
|
84
|
+
if (!isObject(raw))
|
|
85
|
+
return [`${file} has no animations object`];
|
|
86
|
+
const problems = [];
|
|
87
|
+
const names = Object.keys(want);
|
|
88
|
+
for (const name of Object.keys(raw)) {
|
|
89
|
+
if (!names.includes(name))
|
|
90
|
+
problems.push(`${file} animations has an unexpected ${name}`);
|
|
91
|
+
}
|
|
92
|
+
for (const name of names) {
|
|
93
|
+
const got = raw[name];
|
|
94
|
+
const frames = want[name];
|
|
95
|
+
if (!Array.isArray(got))
|
|
96
|
+
problems.push(`${file} animations has no ${name}`);
|
|
97
|
+
else if (got.length !== frames.length || got.some((n, i) => n !== frames[i])) {
|
|
98
|
+
problems.push(`${file} animations.${name} does not list frames 0 to ${g.count - 1} in order`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return problems;
|
|
102
|
+
}
|
|
103
|
+
export function atlasFile(path, doc) {
|
|
104
|
+
return { path, content: `${JSON.stringify(doc, null, 2)}\n` };
|
|
105
|
+
}
|
|
106
|
+
const isObject = (v) => v !== null && typeof v === "object" && !Array.isArray(v);
|
|
107
|
+
/** Reads the JSON and the PNG back and returns what disagrees with the strip's geometry. */
|
|
108
|
+
export async function checkAtlas(g, shape, file, read, extra) {
|
|
109
|
+
const bytes = await read(file);
|
|
110
|
+
if (bytes === undefined)
|
|
111
|
+
return [`${file} is missing`];
|
|
112
|
+
let doc;
|
|
113
|
+
try {
|
|
114
|
+
doc = JSON.parse(new TextDecoder().decode(bytes));
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return [`${file} is not JSON`];
|
|
118
|
+
}
|
|
119
|
+
if (!isObject(doc))
|
|
120
|
+
return [`${file} is not a JSON object`];
|
|
121
|
+
const problems = [];
|
|
122
|
+
const raw = doc["frames"];
|
|
123
|
+
const list = Array.isArray(raw)
|
|
124
|
+
? raw
|
|
125
|
+
: isObject(raw)
|
|
126
|
+
? Object.entries(raw).map(([filename, v]) => (isObject(v) ? { filename, ...v } : v))
|
|
127
|
+
: [];
|
|
128
|
+
if (shape === "hash" ? !isObject(raw) : !Array.isArray(raw)) {
|
|
129
|
+
problems.push(`${file} frames is not ${shape === "hash" ? "an object keyed by frame name" : "an array"}`);
|
|
130
|
+
}
|
|
131
|
+
if (list.length !== g.count) {
|
|
132
|
+
problems.push(`${file} lists ${list.length} frames, expected ${g.count}`);
|
|
133
|
+
}
|
|
134
|
+
list.forEach((entry, i) => {
|
|
135
|
+
const e = isObject(entry) ? entry : {};
|
|
136
|
+
const rect = e["frame"];
|
|
137
|
+
const want = { x: i * g.width, y: 0, w: g.width, h: g.height };
|
|
138
|
+
if (e["filename"] !== frameName(g.assetId, i)) {
|
|
139
|
+
problems.push(`${file} frame ${i} is not named ${frameName(g.assetId, i)}`);
|
|
140
|
+
}
|
|
141
|
+
if (!isObject(rect) || ["x", "y", "w", "h"].some((k) => rect[k] !== want[k])) {
|
|
142
|
+
problems.push(`${file} frame ${i} rectangle is not ${JSON.stringify(want)}`);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
const meta = isObject(doc["meta"]) ? doc["meta"] : {};
|
|
146
|
+
const size = isObject(meta["size"]) ? meta["size"] : {};
|
|
147
|
+
const wantSize = { w: g.width * g.count, h: g.height };
|
|
148
|
+
if (size["w"] !== wantSize.w || size["h"] !== wantSize.h) {
|
|
149
|
+
problems.push(`${file} meta.size is not ${wantSize.w}x${wantSize.h}`);
|
|
150
|
+
}
|
|
151
|
+
if (meta["scale"] !== "1")
|
|
152
|
+
problems.push(`${file} meta.scale is not "1"`);
|
|
153
|
+
const image = meta["image"];
|
|
154
|
+
if (typeof image !== "string" ||
|
|
155
|
+
posix.isAbsolute(image) ||
|
|
156
|
+
image.includes("\\") ||
|
|
157
|
+
image.split("/").includes("..")) {
|
|
158
|
+
problems.push(`${file} meta.image is not a relative path with "/"`);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
const imagePath = posix.join(posix.dirname(file), image);
|
|
162
|
+
const png = await read(imagePath);
|
|
163
|
+
if (png === undefined)
|
|
164
|
+
problems.push(`${file} meta.image ${image} does not name a written file`);
|
|
165
|
+
else {
|
|
166
|
+
try {
|
|
167
|
+
const px = decodePng(png);
|
|
168
|
+
if (px.width !== wantSize.w || px.height !== wantSize.h) {
|
|
169
|
+
problems.push(`${imagePath} is ${px.width}x${px.height}, expected ${wantSize.w}x${wantSize.h}`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
problems.push(`${imagePath} is not a PNG`);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (posix.normalize(imagePath) !== posix.normalize(g.media))
|
|
177
|
+
problems.push(`${file} meta.image does not name ${g.media}`);
|
|
178
|
+
}
|
|
179
|
+
return [...problems, ...extra(doc)];
|
|
180
|
+
}
|
|
181
|
+
export const atlasJsonPreset = {
|
|
182
|
+
name: "atlas-json",
|
|
183
|
+
optionsSchema: atlasOptions("hash"),
|
|
184
|
+
async write(ctx, { shape }) {
|
|
185
|
+
const g = stripGeometry(ctx, "atlas-json");
|
|
186
|
+
const doc = buildAtlas(g, shape, false);
|
|
187
|
+
doc.animations = animationsOf(g);
|
|
188
|
+
return [atlasFile(sidecarPath(g.media, ".atlas.json"), doc)];
|
|
189
|
+
},
|
|
190
|
+
async check(ctx, { shape }, files, read) {
|
|
191
|
+
const g = stripGeometry(ctx, "atlas-json");
|
|
192
|
+
const file = files[0]?.path ?? sidecarPath(g.media, ".atlas.json");
|
|
193
|
+
return checkAtlas(g, shape, file, read, (doc) => animationProblems(g, doc, file));
|
|
194
|
+
},
|
|
195
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { HandoffPreset } from "./index.ts";
|
|
3
|
+
declare const options: z.ZodObject<{
|
|
4
|
+
index: z.ZodDefault<z.ZodString>;
|
|
5
|
+
maxSize: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
padding: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
formats: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
8
|
+
png: "png";
|
|
9
|
+
ktx2: "ktx2";
|
|
10
|
+
}>>>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
type Options = z.infer<typeof options>;
|
|
13
|
+
export declare const atlasPackPreset: HandoffPreset<Options>;
|
|
14
|
+
export {};
|