@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,750 @@
|
|
|
1
|
+
import { assetFiles, isRestricted, readStorageField, storageField } from "../storage.js";
|
|
2
|
+
import { libraryOriginSchema, originOf, originSchema, originSourceType } from "../origin.js";
|
|
3
|
+
import { evaluateProjectRules, measuredRuleMedia } from "../project-rules.js";
|
|
4
|
+
/**
|
|
5
|
+
* Library maintenance (design sections 1.2, 1.4 and 4): `library check` compares the records
|
|
6
|
+
* (provenance and review records) with their projections (card machine fields, `index.md`,
|
|
7
|
+
* `log.md`, the canonical layout of review records); `library rebuild` rewrites the projections;
|
|
8
|
+
* `library stats` and `library drift` are reports computed from the cards. The expected state is
|
|
9
|
+
* built once, so what rebuild writes is what check compares.
|
|
10
|
+
*/
|
|
11
|
+
import { execFileSync } from "node:child_process";
|
|
12
|
+
import { readFileSync, readdirSync } from "node:fs";
|
|
13
|
+
import { readFile } from "node:fs/promises";
|
|
14
|
+
import { basename, dirname, join, relative, sep } from "node:path";
|
|
15
|
+
import { isDeepStrictEqual } from "node:util";
|
|
16
|
+
import { sha256Hex } from "./canonical.js";
|
|
17
|
+
import { machineFieldsOf, isCardText, machineFields, parseCard, rewriteMachineFields, writeCard, } from "./card.js";
|
|
18
|
+
import { checkIndexPaths, checkLogPaths, indexAssetsFor, logEntriesFromReview, logLinesFor, normalizeLog, parseIndex, renderIndex, renderLog, } from "./folder.js";
|
|
19
|
+
import { describesUnrecordedEdit } from "./adopt.js";
|
|
20
|
+
import { CREDITS_JSON, CREDITS_MD, creditsAsset, creditsReport, renderCreditsJson, renderCreditsMarkdown, sameText, staleCreditsAssets, staleCreditsRows, } from "./credits.js";
|
|
21
|
+
import { MediaMissingError, readMedia } from "./lfs.js";
|
|
22
|
+
import { measureMedia } from "./media-metadata.js";
|
|
23
|
+
import { bibleVersionOfText, judgementOf, madeUnderOtherVersion } from "./stale.js";
|
|
24
|
+
import { facingRequirement, missingFacings } from "../animation/facing.js";
|
|
25
|
+
import { libraryPath } from "./paths.js";
|
|
26
|
+
import { relationshipGraph } from "./relations.js";
|
|
27
|
+
import { checkReviewPaths, currentVersion, parseReview, versionNumber, versionStatus, writeReview, } from "./review.js";
|
|
28
|
+
import { assetgroveVersion, bibleLines, libraryConfig, readText, within, writeAtomic, } from "./write.js";
|
|
29
|
+
const SKIP_DIR = (name) => name.startsWith(".") || name === "node_modules" || name.endsWith(".review");
|
|
30
|
+
const rel = (config, path) => relative(config.root, path).split(sep).join("/");
|
|
31
|
+
function walk(root) {
|
|
32
|
+
const folders = new Map();
|
|
33
|
+
const visit = (dir) => {
|
|
34
|
+
let entries;
|
|
35
|
+
try {
|
|
36
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const names = [];
|
|
42
|
+
for (const entry of entries) {
|
|
43
|
+
if (entry.isDirectory()) {
|
|
44
|
+
if (!SKIP_DIR(entry.name))
|
|
45
|
+
visit(join(dir, entry.name));
|
|
46
|
+
}
|
|
47
|
+
else if (entry.isFile())
|
|
48
|
+
names.push(entry.name);
|
|
49
|
+
}
|
|
50
|
+
folders.set(dir, names);
|
|
51
|
+
};
|
|
52
|
+
visit(root);
|
|
53
|
+
return folders;
|
|
54
|
+
}
|
|
55
|
+
/** Whether `git` maps this file to Git LFS; undefined outside a Git repository. */
|
|
56
|
+
function lfsMapped(path) {
|
|
57
|
+
try {
|
|
58
|
+
const out = execFileSync("git", ["-C", dirname(path), "check-attr", "filter", "--", basename(path)], {
|
|
59
|
+
encoding: "utf8",
|
|
60
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
61
|
+
});
|
|
62
|
+
return /: filter: lfs\s*$/m.test(out);
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function cardData(card) {
|
|
69
|
+
return card.data;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The provenance the current version's records name, and the fields read from it. A version picked
|
|
73
|
+
* with a provenance file of its own records that file's sha256 (`provenanceSha256`): the source is
|
|
74
|
+
* the card's named one, or else the file beside the media, whichever holds those bytes. Without
|
|
75
|
+
* that hash (a manifest that embeds the provenance) the source is the one the card names. A file
|
|
76
|
+
* that only has a provenance file's name beside the media is never read in its place.
|
|
77
|
+
*/
|
|
78
|
+
async function currentProvenance(asset, config, resourceName, named) {
|
|
79
|
+
const recorded = currentVersion(asset.review.record)?.provenanceSha256;
|
|
80
|
+
const read = async (resource) => {
|
|
81
|
+
try {
|
|
82
|
+
const path = libraryPath(config.root, asset.dir, resource, asset.cardPath);
|
|
83
|
+
return await readFile(path);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
let resource = named;
|
|
90
|
+
let bytes = named === undefined ? undefined : await read(named);
|
|
91
|
+
if (recorded !== undefined && (bytes === undefined || sha256Hex(bytes) !== recorded)) {
|
|
92
|
+
const beside = `${resourceName}.provenance.json`;
|
|
93
|
+
const besideBytes = await read(beside);
|
|
94
|
+
if (besideBytes !== undefined && sha256Hex(besideBytes) === recorded) {
|
|
95
|
+
resource = beside;
|
|
96
|
+
bytes = besideBytes;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
let fields;
|
|
100
|
+
try {
|
|
101
|
+
fields = bytes && findProvenance(JSON.parse(bytes.toString("utf8")), 0);
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
fields = undefined;
|
|
105
|
+
}
|
|
106
|
+
return { ...(resource !== undefined && { resource }), ...(fields && { fields }) };
|
|
107
|
+
}
|
|
108
|
+
function findProvenance(value, depth) {
|
|
109
|
+
if (value === null || typeof value !== "object" || depth > 4)
|
|
110
|
+
return undefined;
|
|
111
|
+
const o = value;
|
|
112
|
+
const { route, bibleVersion, license, finishedAt } = o;
|
|
113
|
+
if (typeof route === "string" &&
|
|
114
|
+
typeof bibleVersion === "string" &&
|
|
115
|
+
typeof license === "string" &&
|
|
116
|
+
typeof finishedAt === "string") {
|
|
117
|
+
const origin = originSchema.safeParse(o["origin"]);
|
|
118
|
+
const digitalSourceType = originSourceType(o["digitalSourceType"]);
|
|
119
|
+
const declaration = o["sourceDeclaration"];
|
|
120
|
+
const declarationType = originSourceType(declaration?.["value"]);
|
|
121
|
+
return {
|
|
122
|
+
route,
|
|
123
|
+
bibleVersion,
|
|
124
|
+
license,
|
|
125
|
+
finishedAt,
|
|
126
|
+
...(origin.success && { origin: origin.data }),
|
|
127
|
+
...(digitalSourceType !== undefined && { digitalSourceType }),
|
|
128
|
+
...(declarationType !== undefined &&
|
|
129
|
+
declarationType !== "undeclared" &&
|
|
130
|
+
typeof declaration?.["declaredBy"] === "string" && {
|
|
131
|
+
sourceDeclaration: { value: declarationType, declaredBy: declaration["declaredBy"] },
|
|
132
|
+
}),
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
for (const child of Object.values(o)) {
|
|
136
|
+
const found = findProvenance(child, depth + 1);
|
|
137
|
+
if (found)
|
|
138
|
+
return found;
|
|
139
|
+
}
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
/** The machine fields the records say this asset's card has; undefined when they cannot say. */
|
|
143
|
+
async function expectedFields(asset, config) {
|
|
144
|
+
const { card, review } = asset;
|
|
145
|
+
if (!card || !review || !currentVersion(review.record))
|
|
146
|
+
return undefined;
|
|
147
|
+
const data = cardData(card.parsed);
|
|
148
|
+
// The media the records name: the pick annotation's target source, else what the card says.
|
|
149
|
+
const recorded = review.record.annotations
|
|
150
|
+
.filter((a) => a["ag:action"] === "pick" || a["ag:action"] === "replace")
|
|
151
|
+
.map((a) => (typeof a.target === "string" ? undefined : a.target.source))
|
|
152
|
+
.filter((s) => s !== undefined)
|
|
153
|
+
.at(-1);
|
|
154
|
+
const resourceName = recorded ?? String(data["resource"]);
|
|
155
|
+
const generated = data["generated"];
|
|
156
|
+
const byMatch = /^assetgrove\/(\S+) via (.*)$/.exec(generated?.by ?? "");
|
|
157
|
+
const lock = data["lock"];
|
|
158
|
+
const sources = (data["sources"] ?? []);
|
|
159
|
+
const resource = (id) => sources.find((s) => s.id === id)?.resource;
|
|
160
|
+
const current = await currentProvenance(asset, config, resourceName, resource("provenance"));
|
|
161
|
+
const provenance = current.fields ?? {
|
|
162
|
+
route: byMatch?.[2] ?? "",
|
|
163
|
+
bibleVersion: String(data["bible"] ?? lock?.bible ?? ""),
|
|
164
|
+
license: String(data["license"] ?? ""),
|
|
165
|
+
finishedAt: generated?.at ?? "",
|
|
166
|
+
};
|
|
167
|
+
const provenanceResource = current.resource;
|
|
168
|
+
const bibleResource = resource("bible");
|
|
169
|
+
const fields = machineFields({
|
|
170
|
+
resource: resourceName,
|
|
171
|
+
media: await measureMedia(libraryPath(config.root, asset.dir, resourceName, asset.cardPath), currentVersion(review.record).sha256),
|
|
172
|
+
provenance,
|
|
173
|
+
...(provenanceResource !== undefined && { provenanceResource }),
|
|
174
|
+
review: review.record,
|
|
175
|
+
reviewResource: `${asset.id}.review.json`,
|
|
176
|
+
...(bibleResource !== undefined && { bibleResource }),
|
|
177
|
+
kind: typeof data["kind"] === "string" ? data["kind"] : "",
|
|
178
|
+
subject: typeof data["subject"] === "string" ? data["subject"] : "",
|
|
179
|
+
...(typeof data["animationFamily"] === "string" && {
|
|
180
|
+
animationFamily: data["animationFamily"],
|
|
181
|
+
}),
|
|
182
|
+
...(typeof data["action"] === "string" && { action: data["action"] }),
|
|
183
|
+
...(typeof data["facing"] === "string" && { facing: data["facing"] }),
|
|
184
|
+
// A music card's form and requested tempo come from its spec, which only the card keeps.
|
|
185
|
+
...(data["kind"] === "music" && typeof data["form"] === "string" && { form: data["form"] }),
|
|
186
|
+
...(data["kind"] === "music" && typeof data["tempo"] === "number" && { tempo: data["tempo"] }),
|
|
187
|
+
assetgrove: byMatch?.[1] ?? assetgroveVersion(),
|
|
188
|
+
...storageInput(data["storage"], originOf(provenance), () => assetFiles(asset.cardPath, resourceName, currentVersion(review.record).sha256)),
|
|
189
|
+
});
|
|
190
|
+
// A manifest outside the library root is not readable here; its card is the only projection.
|
|
191
|
+
if (current.fields === undefined) {
|
|
192
|
+
const retained = libraryOriginSchema.safeParse(data["origin"]);
|
|
193
|
+
if (retained.success)
|
|
194
|
+
fields["origin"] = retained.data;
|
|
195
|
+
}
|
|
196
|
+
// These have no record besides the card: they stay as it has them.
|
|
197
|
+
for (const key of ["kind", "subject", "animationFamily", "action", "facing"])
|
|
198
|
+
if (typeof data[key] !== "string")
|
|
199
|
+
delete fields[key];
|
|
200
|
+
return fields;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* The card's storage: its recorded level, kept when stricter than its origin's default, and for a
|
|
204
|
+
* restricted asset its recorded files, else its media and the binary files beside it (src/storage.ts).
|
|
205
|
+
*/
|
|
206
|
+
function storageInput(value, origin, files) {
|
|
207
|
+
const storage = storageField(origin, readStorageField(value), files);
|
|
208
|
+
return isRestricted(storage.level) ? { storage } : {};
|
|
209
|
+
}
|
|
210
|
+
/** Reads every card and review record under the library root, with what is wrong with each. */
|
|
211
|
+
async function gather(config, problems) {
|
|
212
|
+
const folders = walk(config.root);
|
|
213
|
+
const assets = [];
|
|
214
|
+
const problem = (path, code) => problems.push({ file: rel(config, path), code });
|
|
215
|
+
for (const [dir, names] of [...folders].sort(([a], [b]) => (a < b ? -1 : 1))) {
|
|
216
|
+
const ids = new Map();
|
|
217
|
+
const asset = (id) => {
|
|
218
|
+
let found = ids.get(id);
|
|
219
|
+
if (!found) {
|
|
220
|
+
found = {
|
|
221
|
+
dir,
|
|
222
|
+
id,
|
|
223
|
+
cardPath: join(dir, `${id}.md`),
|
|
224
|
+
reviewPath: join(dir, `${id}.review.json`),
|
|
225
|
+
};
|
|
226
|
+
ids.set(id, found);
|
|
227
|
+
}
|
|
228
|
+
return found;
|
|
229
|
+
};
|
|
230
|
+
for (const name of [...names].sort()) {
|
|
231
|
+
if (name.endsWith(".review.json"))
|
|
232
|
+
asset(name.slice(0, -".review.json".length));
|
|
233
|
+
else if (name.endsWith(".md") && name !== "index.md" && name !== "log.md") {
|
|
234
|
+
let text;
|
|
235
|
+
try {
|
|
236
|
+
text = readFileSync(join(dir, name), "utf8");
|
|
237
|
+
}
|
|
238
|
+
catch {
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
if (isCardText(text))
|
|
242
|
+
asset(name.slice(0, -3));
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
for (const found of [...ids.values()].sort((a, b) => (a.id < b.id ? -1 : 1))) {
|
|
246
|
+
const reviewText = await readText(found.reviewPath);
|
|
247
|
+
if (reviewText === undefined)
|
|
248
|
+
problem(found.reviewPath, "review_missing");
|
|
249
|
+
else {
|
|
250
|
+
try {
|
|
251
|
+
const record = parseReview(reviewText, found.reviewPath);
|
|
252
|
+
checkReviewPaths(record, config.root, dir, found.reviewPath);
|
|
253
|
+
found.review = { record, text: reviewText };
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
problem(found.reviewPath, "review_invalid");
|
|
257
|
+
found.unreadable = "review";
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
const cardText = await readText(found.cardPath);
|
|
261
|
+
if (cardText === undefined)
|
|
262
|
+
problem(found.cardPath, "card_missing");
|
|
263
|
+
else {
|
|
264
|
+
try {
|
|
265
|
+
const parsed = parseCard(cardText, found.cardPath);
|
|
266
|
+
const paths = [
|
|
267
|
+
String(parsed.data["resource"]),
|
|
268
|
+
...(parsed.data["sources"] ?? [])
|
|
269
|
+
.filter((s) => s.id !== "bible")
|
|
270
|
+
.map((s) => s.resource),
|
|
271
|
+
];
|
|
272
|
+
for (const path of paths)
|
|
273
|
+
libraryPath(config.root, dir, path, found.cardPath);
|
|
274
|
+
found.card = { parsed, text: cardText };
|
|
275
|
+
}
|
|
276
|
+
catch {
|
|
277
|
+
problem(found.cardPath, "card_invalid");
|
|
278
|
+
found.unreadable = "card";
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
assets.push(found);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
return assets;
|
|
285
|
+
}
|
|
286
|
+
const compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
287
|
+
/** Compares the records with their projections; collects the problems, layout-only differences and writes. */
|
|
288
|
+
export async function readLibrary(profile, targetDir) {
|
|
289
|
+
const config = libraryConfig(profile, targetDir);
|
|
290
|
+
const problems = [];
|
|
291
|
+
const ruleFindings = [];
|
|
292
|
+
const needsRebuild = [];
|
|
293
|
+
const writes = [];
|
|
294
|
+
const assets = await gather(config, problems);
|
|
295
|
+
problems.push(...relationshipGraph(config.root, assets).problems);
|
|
296
|
+
// A card or record that cannot be read leaves its folders' projections underivable: that problem
|
|
297
|
+
// is reported once, not again as a mismatch of the index and log it would have fed.
|
|
298
|
+
const broken = new Set(problems.map((p) => dirname(join(config.root, p.file))));
|
|
299
|
+
const problem = (path, code) => problems.push({ file: rel(config, path), code });
|
|
300
|
+
// Records: review records in canonical layout; cards' machine fields; media in LFS.
|
|
301
|
+
const expected = [];
|
|
302
|
+
const credits = [];
|
|
303
|
+
for (const asset of assets) {
|
|
304
|
+
const findingStart = ruleFindings.length;
|
|
305
|
+
if (asset.review) {
|
|
306
|
+
expected.push({
|
|
307
|
+
path: asset.reviewPath,
|
|
308
|
+
kind: "review",
|
|
309
|
+
text: writeReview(asset.review.record),
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
if (asset.card) {
|
|
313
|
+
const fields = await expectedFields(asset, config);
|
|
314
|
+
// The credits report is projected from the card as rebuild writes it.
|
|
315
|
+
let cardData = asset.card.parsed.data;
|
|
316
|
+
if (fields) {
|
|
317
|
+
const next = rewriteMachineFields(asset.card.parsed, fields, asset.cardPath);
|
|
318
|
+
cardData = next.data;
|
|
319
|
+
expected.push({ path: asset.cardPath, kind: "card", text: writeCard(next) });
|
|
320
|
+
const differs = machineFieldsOf(asset.card.parsed.data["kind"]).some((key) => {
|
|
321
|
+
// Older cards can omit the additive origin projection and request a rebuild.
|
|
322
|
+
if (key === "origin" && !Object.hasOwn(asset.card.parsed.data, key))
|
|
323
|
+
return false;
|
|
324
|
+
return !isDeepStrictEqual(asset.card.parsed.data[key], next.data[key]);
|
|
325
|
+
});
|
|
326
|
+
if (differs)
|
|
327
|
+
problem(asset.cardPath, "machine_field_mismatch");
|
|
328
|
+
}
|
|
329
|
+
credits.push(creditsAsset(config.root, asset.dir, asset.id, cardData));
|
|
330
|
+
// A provenance (a file of its own, or a manifest that embeds it) left by an adopt that
|
|
331
|
+
// recorded no version describes bytes no version records.
|
|
332
|
+
const named = (asset.card.parsed.data["sources"] ?? []).find((source) => source.id === "provenance");
|
|
333
|
+
if (named !== undefined && asset.review) {
|
|
334
|
+
const path = join(asset.dir, named.resource);
|
|
335
|
+
const json = await readText(path);
|
|
336
|
+
let value;
|
|
337
|
+
try {
|
|
338
|
+
value = json === undefined ? undefined : JSON.parse(json);
|
|
339
|
+
}
|
|
340
|
+
catch {
|
|
341
|
+
value = undefined;
|
|
342
|
+
}
|
|
343
|
+
if (describesUnrecordedEdit(value, currentVersion(asset.review.record)?.sha256)) {
|
|
344
|
+
problem(path, "provenance_unrecorded");
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
const resource = String(asset.card.parsed.data["resource"]);
|
|
348
|
+
const media = join(asset.dir, resource);
|
|
349
|
+
let measured;
|
|
350
|
+
if (within(config.root, media)) {
|
|
351
|
+
try {
|
|
352
|
+
const read = await readMedia(media);
|
|
353
|
+
if (read.kind !== "lfs-pointer")
|
|
354
|
+
measured = measuredRuleMedia(read.bytes);
|
|
355
|
+
if (lfsMapped(media) === false)
|
|
356
|
+
problem(media, "media_not_lfs");
|
|
357
|
+
}
|
|
358
|
+
catch (error) {
|
|
359
|
+
if (error instanceof MediaMissingError) {
|
|
360
|
+
problem(media, "media_missing");
|
|
361
|
+
}
|
|
362
|
+
else
|
|
363
|
+
problem(media, "media_invalid");
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
ruleFindings.push(...evaluateProjectRules({
|
|
367
|
+
rules: profile.rules,
|
|
368
|
+
asset: asset.id,
|
|
369
|
+
card: asset.card.parsed.data,
|
|
370
|
+
...(measured && { media: measured }),
|
|
371
|
+
}));
|
|
372
|
+
}
|
|
373
|
+
for (const finding of ruleFindings.slice(findingStart))
|
|
374
|
+
if (finding.status === "failed" && finding.severity === "error")
|
|
375
|
+
problem(asset.cardPath, `project_rule:${finding.rule}`);
|
|
376
|
+
}
|
|
377
|
+
const requirement = facingRequirement(profile);
|
|
378
|
+
if (requirement) {
|
|
379
|
+
const families = [];
|
|
380
|
+
const firstCard = new Map();
|
|
381
|
+
for (const asset of [...assets].sort((x, y) => (x.id < y.id ? -1 : 1))) {
|
|
382
|
+
const data = asset.card && cardData(asset.card.parsed);
|
|
383
|
+
if (!data || typeof data["animationFamily"] !== "string")
|
|
384
|
+
continue;
|
|
385
|
+
const subject = typeof data["subject"] === "string" ? data["subject"] : asset.id;
|
|
386
|
+
if (!firstCard.has(subject))
|
|
387
|
+
firstCard.set(subject, asset.cardPath);
|
|
388
|
+
families.push({
|
|
389
|
+
subject,
|
|
390
|
+
...(typeof data["action"] === "string" && { action: data["action"] }),
|
|
391
|
+
...(typeof data["facing"] === "string" && { facing: data["facing"] }),
|
|
392
|
+
});
|
|
393
|
+
}
|
|
394
|
+
for (const { subject, action, facing } of missingFacings(families, requirement))
|
|
395
|
+
problems.push({
|
|
396
|
+
file: rel(config, firstCard.get(subject)),
|
|
397
|
+
code: "facing_missing",
|
|
398
|
+
message: `${subject} has no "${action}" facing ${facing}`,
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
// Projections: every folder from the root to each card, from the cards found.
|
|
402
|
+
const cards = assets.filter((a) => a.card);
|
|
403
|
+
// A card that does not parse keeps its asset's rows in its folder's index and log as they are,
|
|
404
|
+
// and a review record that does not parse keeps its asset's log lines: rebuilt without them, the
|
|
405
|
+
// projections would say less than the records do. The file is reported by name above.
|
|
406
|
+
const held = (folder, which) => new Set(assets.filter((a) => a.dir === folder && which(a)).map((a) => a.id));
|
|
407
|
+
const listed = assets.filter((a) => a.card || a.unreadable === "card");
|
|
408
|
+
// An empty library has no projections to keep: no cards, no index.
|
|
409
|
+
const folderSet = new Set(listed.length > 0 ? [config.root] : []);
|
|
410
|
+
for (const found of listed) {
|
|
411
|
+
for (let folder = found.dir; within(config.root, folder); folder = dirname(folder)) {
|
|
412
|
+
folderSet.add(folder);
|
|
413
|
+
if (folder === config.root)
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
const folderList = [...folderSet].sort();
|
|
418
|
+
const rootLogText = await readText(join(config.root, "log.md"));
|
|
419
|
+
const bible = bibleLines(rootLogText);
|
|
420
|
+
for (const folder of folderList) {
|
|
421
|
+
const isRoot = folder === config.root;
|
|
422
|
+
const here = cards.filter((c) => c.dir === folder);
|
|
423
|
+
const name = isRoot ? config.game : basename(folder);
|
|
424
|
+
const children = folderList
|
|
425
|
+
.filter((f) => f !== folder && dirname(f) === folder)
|
|
426
|
+
.map((f) => basename(f));
|
|
427
|
+
const indexPath = join(folder, "index.md");
|
|
428
|
+
const keptIndex = indexAssetsFor(await readText(indexPath), held(folder, (a) => a.unreadable === "card"));
|
|
429
|
+
if (keptIndex === undefined) {
|
|
430
|
+
// The rows of an unreadable card are in an index that does not parse either: rewritten, the
|
|
431
|
+
// index would lose them, so it is left as it is and reported.
|
|
432
|
+
problem(indexPath, "index_invalid");
|
|
433
|
+
}
|
|
434
|
+
else {
|
|
435
|
+
const index = renderIndex({
|
|
436
|
+
name,
|
|
437
|
+
...(isRoot && { root: { game: config.game } }),
|
|
438
|
+
folders: children,
|
|
439
|
+
assets: here
|
|
440
|
+
.map((c) => {
|
|
441
|
+
const data = c.card.parsed.data;
|
|
442
|
+
return {
|
|
443
|
+
id: c.id,
|
|
444
|
+
title: data.title,
|
|
445
|
+
...(data.description !== undefined && { description: data.description }),
|
|
446
|
+
};
|
|
447
|
+
})
|
|
448
|
+
.concat(keptIndex),
|
|
449
|
+
});
|
|
450
|
+
expected.push({
|
|
451
|
+
path: indexPath,
|
|
452
|
+
kind: "index",
|
|
453
|
+
text: index,
|
|
454
|
+
normalise: (actual) => {
|
|
455
|
+
const parsed = parseIndex(actual, indexPath);
|
|
456
|
+
checkIndexPaths(parsed, config.root, folder, indexPath);
|
|
457
|
+
if (parsed.root && parsed.root.okfVersion !== "0.2")
|
|
458
|
+
return "";
|
|
459
|
+
return renderIndex({
|
|
460
|
+
name,
|
|
461
|
+
...(parsed.root && { root: { game: parsed.root.game } }),
|
|
462
|
+
folders: parsed.folders,
|
|
463
|
+
assets: parsed.assets.map((a) => ({
|
|
464
|
+
id: a.id,
|
|
465
|
+
title: a.title,
|
|
466
|
+
...(a.description !== undefined && { description: a.description }),
|
|
467
|
+
})),
|
|
468
|
+
});
|
|
469
|
+
},
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
const logPath = join(folder, "log.md");
|
|
473
|
+
const keptLog = logLinesFor(await readText(logPath), held(folder, (a) => a.unreadable !== undefined));
|
|
474
|
+
if (config.log && (here.length > 0 || keptLog.length > 0 || (isRoot && bible.length > 0))) {
|
|
475
|
+
const entries = isRoot ? [...bible] : [];
|
|
476
|
+
for (const c of here) {
|
|
477
|
+
if (c.review) {
|
|
478
|
+
entries.push(...logEntriesFromReview(c.review.record, {
|
|
479
|
+
id: c.id,
|
|
480
|
+
title: c.card.parsed.data.title,
|
|
481
|
+
}));
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
expected.push({
|
|
485
|
+
path: logPath,
|
|
486
|
+
kind: "log",
|
|
487
|
+
text: renderLog(entries, keptLog),
|
|
488
|
+
normalise: (actual) => {
|
|
489
|
+
checkLogPaths(actual, config.root, folder, logPath);
|
|
490
|
+
return normalizeLog(actual);
|
|
491
|
+
},
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
const order = { review: 0, card: 1, index: 2, log: 3 };
|
|
496
|
+
expected.sort((a, b) => order[a.kind] - order[b.kind] || compare(a.path, b.path));
|
|
497
|
+
for (const file of expected) {
|
|
498
|
+
const actual = await readText(file.path);
|
|
499
|
+
if (actual === undefined) {
|
|
500
|
+
if (file.kind === "index" || file.kind === "log")
|
|
501
|
+
problem(file.path, `${file.kind}_missing`);
|
|
502
|
+
writes.push({ path: file.path, text: file.text });
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
if (actual === file.text)
|
|
506
|
+
continue;
|
|
507
|
+
writes.push({ path: file.path, text: file.text });
|
|
508
|
+
if (file.kind === "card") {
|
|
509
|
+
// A machine-field mismatch was reported above; otherwise only the layout differs.
|
|
510
|
+
if (!problems.some((p) => p.file === rel(config, file.path)))
|
|
511
|
+
needsRebuild.push(rel(config, file.path));
|
|
512
|
+
continue;
|
|
513
|
+
}
|
|
514
|
+
if (file.kind === "review") {
|
|
515
|
+
needsRebuild.push(rel(config, file.path));
|
|
516
|
+
continue;
|
|
517
|
+
}
|
|
518
|
+
let normalised;
|
|
519
|
+
try {
|
|
520
|
+
normalised = file.normalise(actual);
|
|
521
|
+
}
|
|
522
|
+
catch {
|
|
523
|
+
problem(file.path, `${file.kind}_invalid`);
|
|
524
|
+
continue;
|
|
525
|
+
}
|
|
526
|
+
if (normalised === file.text)
|
|
527
|
+
needsRebuild.push(rel(config, file.path));
|
|
528
|
+
else if (![...broken].some((b) => within(dirname(file.path), b))) {
|
|
529
|
+
problem(file.path, `${file.kind}_mismatch`);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
// An asset whose card is missing or does not parse is reported as such, not again as stale.
|
|
533
|
+
const cardless = new Set(assets.filter((a) => !a.card).map((a) => a.id));
|
|
534
|
+
await checkCredits(config, creditsReport(config.game, credits), listed.length > 0, cardless, {
|
|
535
|
+
problems,
|
|
536
|
+
needsRebuild,
|
|
537
|
+
writes,
|
|
538
|
+
});
|
|
539
|
+
return { config, assets, problems, needsRebuild, writes, ruleFindings };
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Compares the committed credits report with the current one. A missing report is to be written
|
|
543
|
+
* (`needsRebuild`), as an older card without `origin` is; one that differs only in layout too.
|
|
544
|
+
* Otherwise each asset whose entry or row differs is a `credits_stale` problem naming it, and a
|
|
545
|
+
* `credits.report.json` that is not a report is `credits_invalid`. Line endings are not compared.
|
|
546
|
+
*/
|
|
547
|
+
async function checkCredits(config, report, hasCards, broken, out) {
|
|
548
|
+
const jsonPath = join(config.root, CREDITS_JSON);
|
|
549
|
+
const mdPath = join(config.root, CREDITS_MD);
|
|
550
|
+
const committed = { json: await readText(jsonPath), md: await readText(mdPath) };
|
|
551
|
+
if (!hasCards && committed.json === undefined && committed.md === undefined)
|
|
552
|
+
return;
|
|
553
|
+
const files = [
|
|
554
|
+
{ path: jsonPath, text: renderCreditsJson(report), actual: committed.json },
|
|
555
|
+
{ path: mdPath, text: renderCreditsMarkdown(report), actual: committed.md },
|
|
556
|
+
];
|
|
557
|
+
for (const file of files) {
|
|
558
|
+
if (file.actual !== undefined && sameText(file.actual, file.text))
|
|
559
|
+
continue;
|
|
560
|
+
out.writes.push({ path: file.path, text: file.text });
|
|
561
|
+
const name = rel(config, file.path);
|
|
562
|
+
if (file.actual === undefined) {
|
|
563
|
+
out.needsRebuild.push(name);
|
|
564
|
+
continue;
|
|
565
|
+
}
|
|
566
|
+
let stale;
|
|
567
|
+
try {
|
|
568
|
+
stale =
|
|
569
|
+
file.path === jsonPath
|
|
570
|
+
? staleCreditsAssets(file.actual, report)
|
|
571
|
+
: staleCreditsRows(file.actual, file.text);
|
|
572
|
+
}
|
|
573
|
+
catch {
|
|
574
|
+
out.problems.push({ file: name, code: "credits_invalid" });
|
|
575
|
+
continue;
|
|
576
|
+
}
|
|
577
|
+
const named = stale.filter((asset) => !broken.has(asset));
|
|
578
|
+
if (named.length === 0 && stale.length > 0)
|
|
579
|
+
continue;
|
|
580
|
+
stale = named;
|
|
581
|
+
if (stale.length === 0 &&
|
|
582
|
+
file.path === jsonPath &&
|
|
583
|
+
isDeepStrictEqual(JSON.parse(file.actual), report)) {
|
|
584
|
+
// The file holds the report in another layout.
|
|
585
|
+
out.needsRebuild.push(name);
|
|
586
|
+
continue;
|
|
587
|
+
}
|
|
588
|
+
if (stale.length === 0)
|
|
589
|
+
out.problems.push({ file: name, code: "credits_stale" });
|
|
590
|
+
for (const asset of stale)
|
|
591
|
+
out.problems.push({ file: name, code: "credits_stale", reference: asset });
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
/** Rewrites every projection that differs from what the records say; the caller holds the library lock. */
|
|
595
|
+
export async function rebuildLibrary(state) {
|
|
596
|
+
const written = [];
|
|
597
|
+
for (const { path, text } of state.writes) {
|
|
598
|
+
await writeAtomic(path, text);
|
|
599
|
+
written.push(rel(state.config, path));
|
|
600
|
+
}
|
|
601
|
+
return written;
|
|
602
|
+
}
|
|
603
|
+
/** Counts by kind and state, and the share of change requests approved within two new versions. */
|
|
604
|
+
export function libraryStats(state) {
|
|
605
|
+
const byKind = {};
|
|
606
|
+
const byState = {};
|
|
607
|
+
let total = 0;
|
|
608
|
+
let approved = 0;
|
|
609
|
+
let assets = 0;
|
|
610
|
+
for (const asset of state.assets) {
|
|
611
|
+
if (!asset.review)
|
|
612
|
+
continue;
|
|
613
|
+
const { record } = asset.review;
|
|
614
|
+
const current = currentVersion(record);
|
|
615
|
+
if (!current)
|
|
616
|
+
continue;
|
|
617
|
+
assets += 1;
|
|
618
|
+
const kind = String(asset.card?.parsed.data["kind"] ?? "unknown");
|
|
619
|
+
byKind[kind] = (byKind[kind] ?? 0) + 1;
|
|
620
|
+
const status = versionStatus(record, current.sha256);
|
|
621
|
+
byState[status] = (byState[status] ?? 0) + 1;
|
|
622
|
+
for (const annotation of record.annotations) {
|
|
623
|
+
if (annotation.motivation !== "editing")
|
|
624
|
+
continue;
|
|
625
|
+
const target = annotation.target;
|
|
626
|
+
let position = typeof target === "string" ? undefined : versionNumber(record, target["ag:version"] ?? "");
|
|
627
|
+
if (position === undefined) {
|
|
628
|
+
const before = record.versions.filter((v) => v.at <= annotation.created).length;
|
|
629
|
+
position = Math.max(before, 1);
|
|
630
|
+
}
|
|
631
|
+
total += 1;
|
|
632
|
+
const later = record.versions.slice(position, position + 2);
|
|
633
|
+
if (later.some((v) => versionStatus(record, v.sha256) === "approved"))
|
|
634
|
+
approved += 1;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
return {
|
|
638
|
+
assets,
|
|
639
|
+
byKind: sorted(byKind),
|
|
640
|
+
byState: sorted(byState),
|
|
641
|
+
changeRequests: {
|
|
642
|
+
total,
|
|
643
|
+
approvedWithinTwoVersions: approved,
|
|
644
|
+
share: total === 0 ? null : approved / total,
|
|
645
|
+
},
|
|
646
|
+
};
|
|
647
|
+
}
|
|
648
|
+
function sorted(counts) {
|
|
649
|
+
return Object.fromEntries(Object.entries(counts).sort(([a], [b]) => compare(a, b)));
|
|
650
|
+
}
|
|
651
|
+
/** The version of a JSON or Markdown style bible. */
|
|
652
|
+
export function bibleVersionOf(path) {
|
|
653
|
+
let text;
|
|
654
|
+
try {
|
|
655
|
+
text = readFileSync(path, "utf8");
|
|
656
|
+
}
|
|
657
|
+
catch {
|
|
658
|
+
return undefined;
|
|
659
|
+
}
|
|
660
|
+
return bibleVersionOfText(text, path.endsWith(".json"));
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* The assets made under another bible version than `bibleVersion` (the card's `bible` differs,
|
|
664
|
+
* compared for equality), each as the staleness judgement needs it; a card with no
|
|
665
|
+
* `lock.sha256` cannot be judged and is left out.
|
|
666
|
+
*/
|
|
667
|
+
export function staleSubjects(state, bibleVersion) {
|
|
668
|
+
const out = [];
|
|
669
|
+
for (const asset of state.assets) {
|
|
670
|
+
if (!asset.card)
|
|
671
|
+
continue;
|
|
672
|
+
const data = asset.card.parsed.data;
|
|
673
|
+
const cardBible = data.bible ?? data.lock?.bible;
|
|
674
|
+
const sha256 = data.lock?.sha256;
|
|
675
|
+
if (!madeUnderOtherVersion(cardBible, bibleVersion) || sha256 === undefined)
|
|
676
|
+
continue;
|
|
677
|
+
const text = (v) => (typeof v === "string" && v !== "" ? v : undefined);
|
|
678
|
+
const kind = text(data.kind);
|
|
679
|
+
const subject = text(data.subject);
|
|
680
|
+
const sources = (asset.card.parsed.data["sources"] ?? []);
|
|
681
|
+
const provenance = sources.find((s) => s.id === "provenance")?.resource;
|
|
682
|
+
out.push({
|
|
683
|
+
asset: asset.id,
|
|
684
|
+
media: libraryPath(state.config.root, asset.dir, data.resource, asset.cardPath),
|
|
685
|
+
...(provenance !== undefined && {
|
|
686
|
+
provenance: libraryPath(state.config.root, asset.dir, provenance, asset.cardPath),
|
|
687
|
+
}),
|
|
688
|
+
sha256,
|
|
689
|
+
from: String(cardBible),
|
|
690
|
+
...(kind && { kind }),
|
|
691
|
+
...(subject && { subject }),
|
|
692
|
+
tags: Array.isArray(data.tags)
|
|
693
|
+
? [...new Set(data.tags.filter((t) => typeof t === "string" && t !== ""))]
|
|
694
|
+
: [],
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
return out;
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Assets made under another bible version (an exact count), the stale ones among them (the
|
|
701
|
+
* cached answers of `library judge-stale`; no model is called here) and modified ones, computed
|
|
702
|
+
* from each card.
|
|
703
|
+
*/
|
|
704
|
+
export async function libraryDrift(state, bibleVersion, cache) {
|
|
705
|
+
const otherVersion = [];
|
|
706
|
+
const stale = [];
|
|
707
|
+
const modified = [];
|
|
708
|
+
for (const asset of state.assets) {
|
|
709
|
+
if (!asset.card)
|
|
710
|
+
continue;
|
|
711
|
+
const data = asset.card.parsed.data;
|
|
712
|
+
const file = rel(state.config, join(asset.dir, data.resource));
|
|
713
|
+
const cardBible = data.bible ?? data.lock?.bible;
|
|
714
|
+
const lock = data.lock?.sha256;
|
|
715
|
+
if (bibleVersion !== undefined && madeUnderOtherVersion(cardBible, bibleVersion)) {
|
|
716
|
+
const from = String(cardBible);
|
|
717
|
+
const judgement = cache === undefined ? "unjudged" : judgementOf(cache, lock, from, bibleVersion);
|
|
718
|
+
otherVersion.push({ asset: asset.id, file, bible: from, sha256: lock ?? null, judgement });
|
|
719
|
+
if (judgement === "redo") {
|
|
720
|
+
const probability = cache?.get(lock, from, bibleVersion)?.probability;
|
|
721
|
+
stale.push({
|
|
722
|
+
asset: asset.id,
|
|
723
|
+
file,
|
|
724
|
+
reason: `made under bible ${from}; judged to need redoing under ${bibleVersion}`,
|
|
725
|
+
bible: from,
|
|
726
|
+
...(probability !== undefined && { probability }),
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
if (lock === undefined)
|
|
731
|
+
continue;
|
|
732
|
+
try {
|
|
733
|
+
const media = libraryPath(state.config.root, asset.dir, data.resource, asset.cardPath);
|
|
734
|
+
const read = await readMedia(media, { sha256: lock });
|
|
735
|
+
if (read.matches === false) {
|
|
736
|
+
modified.push({
|
|
737
|
+
asset: asset.id,
|
|
738
|
+
file,
|
|
739
|
+
reason: read.kind === "lfs-pointer"
|
|
740
|
+
? `pointer oid ${read.sha256} differs from lock.sha256`
|
|
741
|
+
: `sha256 ${read.sha256} differs from lock.sha256`,
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
catch {
|
|
746
|
+
modified.push({ asset: asset.id, file, reason: "missing" });
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
return { bibleVersion: bibleVersion ?? null, otherVersion, stale, modified };
|
|
750
|
+
}
|