@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,208 @@
|
|
|
1
|
+
import { execFileSync } from "node:child_process";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { posix, resolve } from "node:path";
|
|
4
|
+
import { withoutVariables } from "../env.js";
|
|
5
|
+
import { InputError } from "../errors.js";
|
|
6
|
+
import { isCardText, parseCard } from "./card.js";
|
|
7
|
+
import { canonicalJson, sha256Hex } from "./canonical.js";
|
|
8
|
+
import { parseLfsPointer } from "./lfs.js";
|
|
9
|
+
import { parseReview } from "./review.js";
|
|
10
|
+
function git(cwd, args) {
|
|
11
|
+
try {
|
|
12
|
+
return execFileSync("git", args, {
|
|
13
|
+
cwd,
|
|
14
|
+
env: { ...withoutVariables(["GIT_NO_LAZY_FETCH"]), GIT_NO_LAZY_FETCH: "1" },
|
|
15
|
+
timeout: 30_000,
|
|
16
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
17
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
throw new InputError(`Cannot read local Git revision (${args[0]}); required objects may be unavailable.`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const order = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
25
|
+
export function libraryDiff(target, base, head) {
|
|
26
|
+
const cwd = resolve(target);
|
|
27
|
+
const revision = (ref) => git(cwd, ["rev-parse", "--verify", "--end-of-options", `${ref}^{commit}`])
|
|
28
|
+
.toString()
|
|
29
|
+
.trim();
|
|
30
|
+
const before = revision(base), after = revision(head);
|
|
31
|
+
const common = git(cwd, ["rev-parse", "--git-common-dir"]).toString().trim();
|
|
32
|
+
const objects = resolve(cwd, common, "lfs/objects");
|
|
33
|
+
let remote = "";
|
|
34
|
+
try {
|
|
35
|
+
remote = git(cwd, ["config", "--get", "remote.origin.url"]).toString().trim();
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
/* A local repository need not have a remote. */
|
|
39
|
+
}
|
|
40
|
+
const github = /^(?:https:\/\/github\.com\/|git@github\.com:)([^\s?#]+?)(?:\.git)?$/.exec(remote)?.[1];
|
|
41
|
+
const snapshot = (commit) => {
|
|
42
|
+
const files = new Map();
|
|
43
|
+
for (const line of git(cwd, ["ls-tree", "-rz", "--full-tree", commit]).toString().split("\0")) {
|
|
44
|
+
if (!line)
|
|
45
|
+
continue;
|
|
46
|
+
const tab = line.indexOf("\t"), [mode, type, oid] = line.slice(0, tab).split(" ");
|
|
47
|
+
if (type === "blob" && mode !== "120000")
|
|
48
|
+
files.set(line.slice(tab + 1), oid);
|
|
49
|
+
}
|
|
50
|
+
const bytes = (path) => git(cwd, ["cat-file", "blob", files.get(path)]);
|
|
51
|
+
const media = (path) => {
|
|
52
|
+
const content = bytes(path), pointer = parseLfsPointer(content);
|
|
53
|
+
if (!pointer && content.toString().startsWith("version https://git-lfs.github.com/spec/v1"))
|
|
54
|
+
throw new InputError(`${path}: invalid LFS pointer`);
|
|
55
|
+
const sha256 = pointer?.oid ?? sha256Hex(content);
|
|
56
|
+
let status = "available";
|
|
57
|
+
if (pointer) {
|
|
58
|
+
let local;
|
|
59
|
+
try {
|
|
60
|
+
local = readFileSync(resolve(objects, pointer.oid.slice(0, 2), pointer.oid.slice(2, 4), pointer.oid));
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
status = "missing_lfs_object";
|
|
64
|
+
}
|
|
65
|
+
if (local && (local.length !== pointer.size || sha256Hex(local) !== pointer.oid))
|
|
66
|
+
status = "invalid_lfs_object";
|
|
67
|
+
}
|
|
68
|
+
const link = github
|
|
69
|
+
? `https://github.com/${github}/blob/${commit}/${path.split("/").map(encodeURIComponent).join("/")}`
|
|
70
|
+
: `git:${commit}:${encodeURIComponent(path)}`;
|
|
71
|
+
return { path, sha256, status, ...(status === "available" ? { preview: link } : {}) };
|
|
72
|
+
};
|
|
73
|
+
const provenance = [...files.keys()]
|
|
74
|
+
.filter((p) => p.endsWith("provenance.json"))
|
|
75
|
+
.flatMap((path) => {
|
|
76
|
+
const text = bytes(path).toString();
|
|
77
|
+
let record;
|
|
78
|
+
try {
|
|
79
|
+
record = JSON.parse(text);
|
|
80
|
+
}
|
|
81
|
+
catch {
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
return record?.generator === "transform" &&
|
|
85
|
+
Array.isArray(record.sources) &&
|
|
86
|
+
Array.isArray(record.outputs)
|
|
87
|
+
? [{ path, sources: record.sources, outputs: record.outputs }]
|
|
88
|
+
: [];
|
|
89
|
+
});
|
|
90
|
+
const assets = new Map();
|
|
91
|
+
for (const path of [...files.keys()].sort(order)) {
|
|
92
|
+
if (!path.endsWith(".md"))
|
|
93
|
+
continue;
|
|
94
|
+
const text = bytes(path).toString();
|
|
95
|
+
if (!isCardText(text))
|
|
96
|
+
continue;
|
|
97
|
+
const card = parseCard(text, path).data;
|
|
98
|
+
const resource = card.resource;
|
|
99
|
+
if (resource.includes("\\") ||
|
|
100
|
+
resource.includes(":") ||
|
|
101
|
+
resource.startsWith("/") ||
|
|
102
|
+
resource.includes("\0"))
|
|
103
|
+
throw new InputError(`${path}: unsafe resource`);
|
|
104
|
+
const resourcePath = posix.normalize(posix.join(posix.dirname(path), resource));
|
|
105
|
+
if (resourcePath.startsWith("../"))
|
|
106
|
+
throw new InputError(`${path}: resource escapes repository`);
|
|
107
|
+
const id = path.slice(0, -3), reviewPath = `${id}.review.json`;
|
|
108
|
+
const review = files.has(reviewPath)
|
|
109
|
+
? parseReview(bytes(reviewPath).toString(), reviewPath)
|
|
110
|
+
: undefined;
|
|
111
|
+
const sourceHash = files.has(resourcePath) ? media(resourcePath).sha256 : undefined;
|
|
112
|
+
const provenPaths = [];
|
|
113
|
+
for (const record of provenance) {
|
|
114
|
+
if (!sourceHash ||
|
|
115
|
+
!record.sources.some((source) => source?.sha256 === sourceHash))
|
|
116
|
+
continue;
|
|
117
|
+
for (const output of record.outputs) {
|
|
118
|
+
if (typeof output?.path !== "string" || typeof output?.sha256 !== "string")
|
|
119
|
+
continue;
|
|
120
|
+
const portable = output.path.replaceAll("\\", "/");
|
|
121
|
+
const candidates = [
|
|
122
|
+
portable,
|
|
123
|
+
posix.join(posix.dirname(record.path), posix.basename(portable)),
|
|
124
|
+
];
|
|
125
|
+
for (const candidate of candidates) {
|
|
126
|
+
if (candidate !== resourcePath &&
|
|
127
|
+
files.has(candidate) &&
|
|
128
|
+
media(candidate).sha256 === output.sha256)
|
|
129
|
+
provenPaths.push(candidate);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const renditionPaths = [
|
|
134
|
+
...new Set([
|
|
135
|
+
...provenPaths,
|
|
136
|
+
...[...files.keys()].filter((p) => p.startsWith(`${id}.`) &&
|
|
137
|
+
p !== path &&
|
|
138
|
+
p !== reviewPath &&
|
|
139
|
+
p !== resourcePath &&
|
|
140
|
+
!p.endsWith(".json") &&
|
|
141
|
+
!p.endsWith(".md")),
|
|
142
|
+
]),
|
|
143
|
+
].sort(order);
|
|
144
|
+
assets.set(id, {
|
|
145
|
+
version: review?.versions ?? { version: card.version, lock: card.lock },
|
|
146
|
+
labels: card.tags ?? [],
|
|
147
|
+
reviews: review?.annotations ?? [],
|
|
148
|
+
renditions: renditionPaths.map(media),
|
|
149
|
+
...(files.has(resourcePath) ? { media: media(resourcePath) } : {}),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
return assets;
|
|
153
|
+
};
|
|
154
|
+
const left = snapshot(before), right = snapshot(after);
|
|
155
|
+
const changes = [...new Set([...left.keys(), ...right.keys()])].sort(order).flatMap((asset) => {
|
|
156
|
+
const old = left.get(asset), next = right.get(asset);
|
|
157
|
+
const categories = ["version", "labels", "reviews", "renditions", "media"].filter((key) => {
|
|
158
|
+
const clean = (value) => Array.isArray(value)
|
|
159
|
+
? value.map(clean)
|
|
160
|
+
: value && typeof value === "object"
|
|
161
|
+
? Object.fromEntries(Object.entries(value)
|
|
162
|
+
.filter(([k]) => k !== "preview")
|
|
163
|
+
.map(([k, v]) => [k, clean(v)]))
|
|
164
|
+
: value;
|
|
165
|
+
return canonicalJson(clean(old?.[key])) !== canonicalJson(clean(next?.[key]));
|
|
166
|
+
});
|
|
167
|
+
return categories.length
|
|
168
|
+
? [
|
|
169
|
+
{
|
|
170
|
+
asset,
|
|
171
|
+
change: !old ? "added" : !next ? "removed" : "modified",
|
|
172
|
+
categories,
|
|
173
|
+
before: old,
|
|
174
|
+
after: next,
|
|
175
|
+
},
|
|
176
|
+
]
|
|
177
|
+
: [];
|
|
178
|
+
});
|
|
179
|
+
return { base: before, head: after, changes };
|
|
180
|
+
}
|
|
181
|
+
export function formatLibraryDiff(report) {
|
|
182
|
+
return [
|
|
183
|
+
`# Library changes`,
|
|
184
|
+
"",
|
|
185
|
+
`Base: ${report.base}`,
|
|
186
|
+
`Head: ${report.head}`,
|
|
187
|
+
"",
|
|
188
|
+
...report.changes.flatMap((change) => [
|
|
189
|
+
`## ${JSON.stringify(change.asset)} (${change.change})`,
|
|
190
|
+
`Changed: ${change.categories.join(", ")}`,
|
|
191
|
+
"",
|
|
192
|
+
...["before", "after"].flatMap((side) => {
|
|
193
|
+
const asset = change[side];
|
|
194
|
+
return asset
|
|
195
|
+
? [
|
|
196
|
+
`${side}:`,
|
|
197
|
+
"```json",
|
|
198
|
+
JSON.stringify({ version: asset.version, labels: asset.labels, reviews: asset.reviews }, null, 2),
|
|
199
|
+
"```",
|
|
200
|
+
...[...(asset.media ? [asset.media] : []), ...asset.renditions].map((media) => `${JSON.stringify(media.path)}: ${media.status}; sha256 ${media.sha256}${media.preview ? ` [preview](${media.preview})` : ""}`),
|
|
201
|
+
"",
|
|
202
|
+
]
|
|
203
|
+
: [];
|
|
204
|
+
}),
|
|
205
|
+
]),
|
|
206
|
+
...(report.changes.length ? [] : ["No library changes."]),
|
|
207
|
+
].join("\n");
|
|
208
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TargetProfile } from "../types.ts";
|
|
2
|
+
export interface ExactMatch {
|
|
3
|
+
assetId: string;
|
|
4
|
+
version: number;
|
|
5
|
+
sha256: string;
|
|
6
|
+
/** Present when the bytes matched are those a signed version was signed over, not its file. */
|
|
7
|
+
contentSha256?: string;
|
|
8
|
+
card: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Version hashes name the entire media bytes, including credentials, rather than decoded pixels.
|
|
12
|
+
* A signed version also matches the exact bytes it was signed over (its `contentSha256`), as
|
|
13
|
+
* `olderVersionCheck` treats them as that version: a staged candidate is compared unsigned.
|
|
14
|
+
*/
|
|
15
|
+
export declare function exactMatches(profile: TargetProfile, target: string, hashes: readonly string[]): Promise<ExactMatch[]>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { libraryPath } from "./paths.js";
|
|
2
|
+
import { libraryConfig, readOwnCard, readOwnReview, scanCards } from "./write.js";
|
|
3
|
+
/**
|
|
4
|
+
* Version hashes name the entire media bytes, including credentials, rather than decoded pixels.
|
|
5
|
+
* A signed version also matches the exact bytes it was signed over (its `contentSha256`), as
|
|
6
|
+
* `olderVersionCheck` treats them as that version: a staged candidate is compared unsigned.
|
|
7
|
+
*/
|
|
8
|
+
export async function exactMatches(profile, target, hashes) {
|
|
9
|
+
const { root } = libraryConfig(profile, target);
|
|
10
|
+
const wanted = new Set(hashes);
|
|
11
|
+
const matches = [];
|
|
12
|
+
for (const found of scanCards(root)) {
|
|
13
|
+
try {
|
|
14
|
+
const cardPath = libraryPath(root, found.dir, `${found.id}.md`, "exact match card");
|
|
15
|
+
const card = await readOwnCard(cardPath, root, found.dir);
|
|
16
|
+
if (card === undefined)
|
|
17
|
+
continue;
|
|
18
|
+
const data = card.data;
|
|
19
|
+
const reviewPath = libraryPath(root, found.dir, data.sources?.find((source) => source.id === "review")?.resource ??
|
|
20
|
+
`${found.id}.review.json`, cardPath);
|
|
21
|
+
const record = await readOwnReview(reviewPath, root, found.dir, undefined);
|
|
22
|
+
const versions = record?.versions.map((v, i) => ({
|
|
23
|
+
sha256: v.sha256,
|
|
24
|
+
contentSha256: v.contentSha256,
|
|
25
|
+
version: i + 1,
|
|
26
|
+
})) ??
|
|
27
|
+
(found.sha256 === undefined
|
|
28
|
+
? []
|
|
29
|
+
: [{ sha256: found.sha256, contentSha256: undefined, version: data.version ?? 1 }]);
|
|
30
|
+
for (const { contentSha256, ...version } of versions) {
|
|
31
|
+
const byContent = !wanted.has(version.sha256) && contentSha256 !== undefined && wanted.has(contentSha256);
|
|
32
|
+
if (!wanted.has(version.sha256) && !byContent)
|
|
33
|
+
continue;
|
|
34
|
+
matches.push({
|
|
35
|
+
assetId: found.id,
|
|
36
|
+
...version,
|
|
37
|
+
...(byContent && { contentSha256 }),
|
|
38
|
+
card: cardPath,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// As with library writes, an unrelated unreadable record cannot block another asset.
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return matches.sort((a, b) => a.card.localeCompare(b.card) || a.version - b.version);
|
|
47
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { LoadedAsset } from "./actions.ts";
|
|
2
|
+
import type { Version } from "./review.ts";
|
|
3
|
+
/** A note's anchor on a version, as a review target carries it. */
|
|
4
|
+
export interface Anchor {
|
|
5
|
+
frames?: {
|
|
6
|
+
from: number;
|
|
7
|
+
to: number;
|
|
8
|
+
};
|
|
9
|
+
cell?: {
|
|
10
|
+
column: number;
|
|
11
|
+
row: number;
|
|
12
|
+
};
|
|
13
|
+
/** Seconds, from a Media Fragments `t=` selector. */
|
|
14
|
+
time?: {
|
|
15
|
+
start: number;
|
|
16
|
+
end: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/** What a version holds: its frames and atlas grid when it is an image, its duration when timed. */
|
|
20
|
+
export interface VersionExtent {
|
|
21
|
+
/** The version's number in the stack, for messages. */
|
|
22
|
+
version: number;
|
|
23
|
+
image?: {
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
};
|
|
27
|
+
/** The frame count and grid, when the version's provenance records its frame layout. */
|
|
28
|
+
layout?: {
|
|
29
|
+
frames: number;
|
|
30
|
+
columns: number;
|
|
31
|
+
rows: number;
|
|
32
|
+
};
|
|
33
|
+
/** Seconds, when the bytes are a track music-metadata reads a duration from. */
|
|
34
|
+
duration?: number;
|
|
35
|
+
/** Why the bytes could not be measured, when they could not. */
|
|
36
|
+
unmeasured?: string;
|
|
37
|
+
}
|
|
38
|
+
/** The frame size and count a provenance's parameters record, at the top or under `postprocess`. */
|
|
39
|
+
export declare function frameLayoutOf(parameters: unknown): {
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
count: number;
|
|
43
|
+
} | undefined;
|
|
44
|
+
/** Measures `version` of `asset` from its own bytes. */
|
|
45
|
+
export declare function versionExtent(asset: LoadedAsset, version: Version): Promise<VersionExtent>;
|
|
46
|
+
/**
|
|
47
|
+
* Refuses (InputError) an anchor that does not fit the version: each message names the selector,
|
|
48
|
+
* what it asked for and the version's valid range.
|
|
49
|
+
*/
|
|
50
|
+
export declare function checkAnchor(anchor: Anchor, extent: VersionExtent, assetId: string): void;
|
|
51
|
+
/** The anchor a review target carries, read back from its members. */
|
|
52
|
+
export declare function anchorOf(target: unknown): Anchor | undefined;
|
|
53
|
+
/** The target members that store `anchor` (merged into a version target). */
|
|
54
|
+
export declare function anchorMembers(anchor: Anchor): Record<string, unknown>;
|
|
55
|
+
/** One line naming an anchor, for human output: `frames 2-5, cell 1,0, time 0.5-1.25 s`. */
|
|
56
|
+
export declare function describeAnchor(anchor: Anchor | undefined): string;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The extent of one exact version of a picked asset, and the bounds check of a note's anchor
|
|
3
|
+
* against it (docs/library.md, Anchors). An anchor names part of a version: a frame range of a
|
|
4
|
+
* strip (`ag:frames`), a cell of an atlas (`ag:cell`) or a time range of a track (a `t=` selector).
|
|
5
|
+
* The valid range is measured from the version's own bytes, never assumed: frames and cells from
|
|
6
|
+
* the image size and the frame layout its provenance records, the duration through music-metadata.
|
|
7
|
+
* The image size is read from the header, never by decoding: PNG, JPEG and WebP through the
|
|
8
|
+
* repository's header reader, KTX2 through ktx-parse. Bytes neither reader nor music-metadata
|
|
9
|
+
* measures are named as unmeasured, so a refusal says the type could not be measured.
|
|
10
|
+
*/
|
|
11
|
+
import { readFile } from "node:fs/promises";
|
|
12
|
+
import { read as readKtx2 } from "ktx-parse";
|
|
13
|
+
import { InputError } from "../errors.js";
|
|
14
|
+
import { imageSize } from "../model3d/scene.js";
|
|
15
|
+
import { findProvenance } from "./adopt.js";
|
|
16
|
+
import { sha256Hex } from "./canonical.js";
|
|
17
|
+
import { findGitDir, lfsObjectPath, readMedia } from "./lfs.js";
|
|
18
|
+
import { libraryPath } from "./paths.js";
|
|
19
|
+
import { parseTimeFragment } from "./review.js";
|
|
20
|
+
/** The version's bytes: the working file when they are the version's, else the local Git LFS store. */
|
|
21
|
+
async function versionBytes(asset, sha256) {
|
|
22
|
+
try {
|
|
23
|
+
const media = await readMedia(asset.mediaPath);
|
|
24
|
+
if (media.kind !== "lfs-pointer" && media.sha256 === sha256)
|
|
25
|
+
return media.bytes;
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
if (!(error instanceof InputError))
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
const gitDir = findGitDir(asset.dir);
|
|
32
|
+
if (gitDir === undefined)
|
|
33
|
+
return undefined;
|
|
34
|
+
const bytes = await readFile(lfsObjectPath(gitDir, sha256)).catch(() => undefined);
|
|
35
|
+
return bytes !== undefined && sha256Hex(bytes) === sha256 ? new Uint8Array(bytes) : undefined;
|
|
36
|
+
}
|
|
37
|
+
/** The frame size and count a provenance's parameters record, at the top or under `postprocess`. */
|
|
38
|
+
export function frameLayoutOf(parameters) {
|
|
39
|
+
if (parameters === null || typeof parameters !== "object")
|
|
40
|
+
return undefined;
|
|
41
|
+
const top = parameters;
|
|
42
|
+
const post = (top["postprocess"] !== null && typeof top["postprocess"] === "object" ? top["postprocess"] : {});
|
|
43
|
+
const frame = (top["frame"] ?? post["frame"]);
|
|
44
|
+
const count = top["frameCount"] ?? post["frameCount"];
|
|
45
|
+
const width = frame?.["width"];
|
|
46
|
+
const height = frame?.["height"];
|
|
47
|
+
const positive = (n) => Number.isInteger(n) && n > 0;
|
|
48
|
+
if (!positive(width) || !positive(height) || !positive(count))
|
|
49
|
+
return undefined;
|
|
50
|
+
return { width, height, count };
|
|
51
|
+
}
|
|
52
|
+
/** The provenance parameters the card names, which describe the current version. */
|
|
53
|
+
async function currentParameters(asset) {
|
|
54
|
+
const sources = (asset.card.data["sources"] ?? []);
|
|
55
|
+
const source = sources.find((s) => s.id === "provenance");
|
|
56
|
+
if (typeof source?.resource !== "string")
|
|
57
|
+
return undefined;
|
|
58
|
+
try {
|
|
59
|
+
const path = libraryPath(asset.config.root, asset.dir, source.resource, asset.cardPath);
|
|
60
|
+
return findProvenance(JSON.parse(await readFile(path, "utf8")))?.parameters;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Measures `version` of `asset` from its own bytes. */
|
|
67
|
+
export async function versionExtent(asset, version) {
|
|
68
|
+
const number = asset.record.versions.findIndex((v) => v.sha256 === version.sha256) + 1;
|
|
69
|
+
const extent = { version: number };
|
|
70
|
+
const bytes = await versionBytes(asset, version.sha256);
|
|
71
|
+
if (bytes === undefined) {
|
|
72
|
+
extent.unmeasured = `the bytes of version ${number} are neither the working file nor in the local Git LFS store`;
|
|
73
|
+
return extent;
|
|
74
|
+
}
|
|
75
|
+
const image = sizeOf(bytes);
|
|
76
|
+
if (image !== undefined) {
|
|
77
|
+
extent.image = image;
|
|
78
|
+
// The card's provenance describes the current version; an older one's layout is not recorded.
|
|
79
|
+
const current = asset.record.versions.at(-1)?.sha256 === version.sha256;
|
|
80
|
+
const layout = current ? frameLayoutOf(await currentParameters(asset)) : undefined;
|
|
81
|
+
if (layout !== undefined) {
|
|
82
|
+
const columns = Math.floor(image.width / layout.width);
|
|
83
|
+
const rows = Math.floor(image.height / layout.height);
|
|
84
|
+
extent.layout = { frames: Math.min(layout.count, columns * rows), columns, rows };
|
|
85
|
+
}
|
|
86
|
+
else if (current) {
|
|
87
|
+
// An image with no recorded frame layout is one frame and one cell.
|
|
88
|
+
extent.layout = { frames: 1, columns: 1, rows: 1 };
|
|
89
|
+
}
|
|
90
|
+
return extent;
|
|
91
|
+
}
|
|
92
|
+
// Imported on first use, so a process that measures no audio never loads it.
|
|
93
|
+
const { parseBuffer } = await import("music-metadata");
|
|
94
|
+
try {
|
|
95
|
+
const { format } = await parseBuffer(bytes, undefined, { duration: true, skipCovers: true });
|
|
96
|
+
if (typeof format.duration === "number" && Number.isFinite(format.duration)) {
|
|
97
|
+
extent.duration = format.duration;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
// Not a track music-metadata reads.
|
|
102
|
+
}
|
|
103
|
+
if (extent.duration === undefined) {
|
|
104
|
+
extent.unmeasured = `the media type of version ${number} could not be measured: no reader here gives its image size or its duration`;
|
|
105
|
+
}
|
|
106
|
+
return extent;
|
|
107
|
+
}
|
|
108
|
+
/** Width and height from an image header, or undefined when no reader here knows the type. */
|
|
109
|
+
function sizeOf(bytes) {
|
|
110
|
+
const size = imageSize(bytes);
|
|
111
|
+
if (size !== undefined && size.width > 0 && size.height > 0)
|
|
112
|
+
return size;
|
|
113
|
+
try {
|
|
114
|
+
const ktx = readKtx2(bytes);
|
|
115
|
+
if (ktx.pixelWidth > 0)
|
|
116
|
+
return { width: ktx.pixelWidth, height: Math.max(ktx.pixelHeight, 1) };
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
// Not a KTX2 container.
|
|
120
|
+
}
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
const seconds = (n) => `${Number(n.toFixed(3))}`;
|
|
124
|
+
/**
|
|
125
|
+
* Refuses (InputError) an anchor that does not fit the version: each message names the selector,
|
|
126
|
+
* what it asked for and the version's valid range.
|
|
127
|
+
*/
|
|
128
|
+
export function checkAnchor(anchor, extent, assetId) {
|
|
129
|
+
const of = `version ${extent.version} of ${assetId}`;
|
|
130
|
+
const unmeasured = (selector, what) => new InputError(`${selector} needs ${what}, but ${extent.unmeasured ?? `${of} has none`}; anchor the note without ${selector}`);
|
|
131
|
+
if (anchor.frames !== undefined || anchor.cell !== undefined) {
|
|
132
|
+
const selector = anchor.frames !== undefined ? "ag:frames" : "ag:cell";
|
|
133
|
+
if (extent.layout === undefined) {
|
|
134
|
+
if (extent.unmeasured === undefined && extent.image !== undefined) {
|
|
135
|
+
throw new InputError(`${selector} needs the frame layout of ${of}, which only the current version's provenance records; anchor the current version`);
|
|
136
|
+
}
|
|
137
|
+
throw unmeasured(selector, "an image");
|
|
138
|
+
}
|
|
139
|
+
const { frames, columns, rows } = extent.layout;
|
|
140
|
+
if (anchor.frames !== undefined) {
|
|
141
|
+
const { from, to } = anchor.frames;
|
|
142
|
+
if (to >= frames) {
|
|
143
|
+
throw new InputError(`ag:frames ${from}-${to} is outside ${of}: valid frames are 0-${frames - 1}`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (anchor.cell !== undefined) {
|
|
147
|
+
const { column, row } = anchor.cell;
|
|
148
|
+
if (column >= columns || row >= rows) {
|
|
149
|
+
throw new InputError(`ag:cell ${column},${row} is outside ${of}: valid cells are columns 0-${columns - 1}, rows 0-${rows - 1}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (anchor.time !== undefined) {
|
|
154
|
+
if (extent.duration === undefined)
|
|
155
|
+
throw unmeasured("selector t=", "a duration");
|
|
156
|
+
const { start, end } = anchor.time;
|
|
157
|
+
if (end > extent.duration) {
|
|
158
|
+
throw new InputError(`selector t=${seconds(start)},${seconds(end)} is outside ${of}: the valid time range is 0-${seconds(extent.duration)} s`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/** The anchor a review target carries, read back from its members. */
|
|
163
|
+
export function anchorOf(target) {
|
|
164
|
+
if (target === null || typeof target !== "object")
|
|
165
|
+
return undefined;
|
|
166
|
+
const t = target;
|
|
167
|
+
const anchor = {};
|
|
168
|
+
const frames = t["ag:frames"];
|
|
169
|
+
if (frames !== undefined)
|
|
170
|
+
anchor.frames = { from: frames.from, to: frames.to };
|
|
171
|
+
const cell = t["ag:cell"];
|
|
172
|
+
if (cell !== undefined)
|
|
173
|
+
anchor.cell = { column: cell.column, row: cell.row };
|
|
174
|
+
const selector = t["selector"];
|
|
175
|
+
const time = typeof selector?.value === "string" ? parseTimeFragment(selector.value) : undefined;
|
|
176
|
+
if (time !== undefined)
|
|
177
|
+
anchor.time = time;
|
|
178
|
+
return Object.keys(anchor).length === 0 ? undefined : anchor;
|
|
179
|
+
}
|
|
180
|
+
/** The target members that store `anchor` (merged into a version target). */
|
|
181
|
+
export function anchorMembers(anchor) {
|
|
182
|
+
return {
|
|
183
|
+
...(anchor.frames && { "ag:frames": { from: anchor.frames.from, to: anchor.frames.to } }),
|
|
184
|
+
...(anchor.cell && { "ag:cell": { column: anchor.cell.column, row: anchor.cell.row } }),
|
|
185
|
+
...(anchor.time && {
|
|
186
|
+
selector: {
|
|
187
|
+
type: "FragmentSelector",
|
|
188
|
+
conformsTo: "http://www.w3.org/TR/media-frags/",
|
|
189
|
+
value: `t=${anchor.time.start},${anchor.time.end}`,
|
|
190
|
+
},
|
|
191
|
+
}),
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
/** One line naming an anchor, for human output: `frames 2-5, cell 1,0, time 0.5-1.25 s`. */
|
|
195
|
+
export function describeAnchor(anchor) {
|
|
196
|
+
if (anchor === undefined)
|
|
197
|
+
return "";
|
|
198
|
+
return [
|
|
199
|
+
anchor.frames && `frames ${anchor.frames.from}-${anchor.frames.to}`,
|
|
200
|
+
anchor.cell && `cell ${anchor.cell.column},${anchor.cell.row}`,
|
|
201
|
+
anchor.time && `time ${seconds(anchor.time.start)}-${seconds(anchor.time.end)} s`,
|
|
202
|
+
]
|
|
203
|
+
.filter(Boolean)
|
|
204
|
+
.join(", ");
|
|
205
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ReviewRecord } from "./review.ts";
|
|
2
|
+
/** Folds line breaks to one space, then backslash-escapes `\ [ ] < > |`. */
|
|
3
|
+
export declare function escapeText(text: string): string;
|
|
4
|
+
/** A relative path with each segment percent-encoded, so spaces and parentheses cannot break a link. */
|
|
5
|
+
export declare function linkTarget(rel: string): string;
|
|
6
|
+
export interface IndexAsset {
|
|
7
|
+
id: string;
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IndexInput {
|
|
12
|
+
/** The folder name, or the game id at the root. */
|
|
13
|
+
name: string;
|
|
14
|
+
root?: {
|
|
15
|
+
game: string;
|
|
16
|
+
};
|
|
17
|
+
folders: string[];
|
|
18
|
+
assets: IndexAsset[];
|
|
19
|
+
}
|
|
20
|
+
/** The text of an `index.md`. */
|
|
21
|
+
export declare function renderIndex(input: IndexInput): string;
|
|
22
|
+
export interface ParsedIndexAsset {
|
|
23
|
+
id: string;
|
|
24
|
+
/** The decoded link target, relative to the folder. */
|
|
25
|
+
target: string;
|
|
26
|
+
title: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ParsedIndex {
|
|
30
|
+
root?: {
|
|
31
|
+
okfVersion: string;
|
|
32
|
+
game: string;
|
|
33
|
+
};
|
|
34
|
+
folders: string[];
|
|
35
|
+
assets: ParsedIndexAsset[];
|
|
36
|
+
}
|
|
37
|
+
/** Reads an `index.md`, collapsing the duplicate headings and rows a union merge leaves. */
|
|
38
|
+
export declare function parseIndex(text: string, source: string): ParsedIndex;
|
|
39
|
+
/** Refuses (InputError) any index row whose path leaves the library root. */
|
|
40
|
+
export declare function checkIndexPaths(index: ParsedIndex, libraryRoot: string, folderDir: string, source: string): void;
|
|
41
|
+
export type LogAction = "pick" | "replace" | "approve" | "reject" | "answer" | "card-edit" | "adopt";
|
|
42
|
+
export type LogEntry = {
|
|
43
|
+
/** ISO-8601 UTC. */
|
|
44
|
+
at: string;
|
|
45
|
+
action: LogAction;
|
|
46
|
+
asset: {
|
|
47
|
+
id: string;
|
|
48
|
+
title: string;
|
|
49
|
+
};
|
|
50
|
+
detail?: string;
|
|
51
|
+
} | {
|
|
52
|
+
at: string;
|
|
53
|
+
action: "bible";
|
|
54
|
+
from: string;
|
|
55
|
+
to: string;
|
|
56
|
+
};
|
|
57
|
+
/** One rendered log line, under its day's heading. */
|
|
58
|
+
export interface LogLine {
|
|
59
|
+
date: string;
|
|
60
|
+
line: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* The text of a `log.md`: newest first, one line per entry, identical lines collapsed. `kept` lines
|
|
64
|
+
* (carried over as they are from the current log) are rendered with them.
|
|
65
|
+
*/
|
|
66
|
+
export declare function renderLog(entries: LogEntry[], kept?: LogLine[]): string;
|
|
67
|
+
/** The lines of a log that link to one of the asset ids' cards, as they are. */
|
|
68
|
+
export declare function logLinesFor(text: string | undefined, ids: Set<string>): LogLine[];
|
|
69
|
+
/**
|
|
70
|
+
* The asset rows of an index that name one of the asset ids, as entries `renderIndex` takes;
|
|
71
|
+
* `undefined` when there are ids to keep and the index does not parse, so their rows cannot be read
|
|
72
|
+
* and the index must be left as it is.
|
|
73
|
+
*/
|
|
74
|
+
export declare function indexAssetsFor(text: string | undefined, ids: Set<string>): IndexAsset[] | undefined;
|
|
75
|
+
/** Re-emits a possibly union-merged log: duplicate headings merged, duplicate lines dropped, order restored. */
|
|
76
|
+
export declare function normalizeLog(text: string): string;
|
|
77
|
+
/** Every link target (decoded) the log's lines name. */
|
|
78
|
+
export declare function logLinks(text: string, source?: string): string[];
|
|
79
|
+
/** Refuses (InputError) any log link that leaves the library root. */
|
|
80
|
+
export declare function checkLogPaths(text: string, libraryRoot: string, folderDir: string, source: string): void;
|
|
81
|
+
/** One entry per annotation carrying an Assetgrove action other than `resolve`. */
|
|
82
|
+
export declare function logEntriesFromReview(record: ReviewRecord, asset: {
|
|
83
|
+
id: string;
|
|
84
|
+
title: string;
|
|
85
|
+
}): LogEntry[];
|