@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,19 @@
|
|
|
1
|
+
export type MediaEvidence = {
|
|
2
|
+
format: "assetgrove-media/1";
|
|
3
|
+
sha256: string;
|
|
4
|
+
status: "available";
|
|
5
|
+
mediaType: string;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
durationS?: number;
|
|
9
|
+
sampleRate?: number;
|
|
10
|
+
channels?: number;
|
|
11
|
+
} | {
|
|
12
|
+
format: "assetgrove-media/1";
|
|
13
|
+
sha256: string;
|
|
14
|
+
status: "unavailable";
|
|
15
|
+
reason: string;
|
|
16
|
+
};
|
|
17
|
+
/** Only these measured facts cross the boundary from embedded metadata to library projections. */
|
|
18
|
+
export declare function measureMediaBytes(bytes: Uint8Array, sha256: string): MediaEvidence;
|
|
19
|
+
export declare function measureMedia(path: string, sha256: string): Promise<MediaEvidence>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { decodeAudio, frameCount } from "../audio/engine.js";
|
|
2
|
+
import { decodeImage } from "../image/raster.js";
|
|
3
|
+
import { GLB_MEDIA_TYPE, parseGlb } from "../model3d/glb.js";
|
|
4
|
+
import { sniffMediaType } from "../request.js";
|
|
5
|
+
import { sha256Hex } from "./canonical.js";
|
|
6
|
+
import { MediaMissingError, readMedia } from "./lfs.js";
|
|
7
|
+
/** Only these measured facts cross the boundary from embedded metadata to library projections. */
|
|
8
|
+
export function measureMediaBytes(bytes, sha256) {
|
|
9
|
+
if (sha256Hex(bytes) !== sha256)
|
|
10
|
+
return { format: "assetgrove-media/1", sha256, status: "unavailable", reason: "hash_mismatch" };
|
|
11
|
+
const mediaType = sniffMediaType(bytes);
|
|
12
|
+
if (mediaType === "image/png" || mediaType === "image/jpeg") {
|
|
13
|
+
try {
|
|
14
|
+
const { width, height } = decodeImage(bytes);
|
|
15
|
+
return {
|
|
16
|
+
format: "assetgrove-media/1",
|
|
17
|
+
sha256,
|
|
18
|
+
status: "available",
|
|
19
|
+
mediaType,
|
|
20
|
+
width,
|
|
21
|
+
height,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return {
|
|
26
|
+
format: "assetgrove-media/1",
|
|
27
|
+
sha256,
|
|
28
|
+
status: "unavailable",
|
|
29
|
+
reason: "invalid_media",
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (mediaType === "audio/wav") {
|
|
34
|
+
try {
|
|
35
|
+
const audio = decodeAudio(bytes);
|
|
36
|
+
return {
|
|
37
|
+
format: "assetgrove-media/1",
|
|
38
|
+
sha256,
|
|
39
|
+
status: "available",
|
|
40
|
+
mediaType,
|
|
41
|
+
durationS: frameCount(audio) / audio.sampleRate,
|
|
42
|
+
sampleRate: audio.sampleRate,
|
|
43
|
+
channels: audio.channels.length,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return {
|
|
48
|
+
format: "assetgrove-media/1",
|
|
49
|
+
sha256,
|
|
50
|
+
status: "unavailable",
|
|
51
|
+
reason: "invalid_media",
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
parseGlb(bytes);
|
|
57
|
+
return { format: "assetgrove-media/1", sha256, status: "available", mediaType: GLB_MEDIA_TYPE };
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return {
|
|
61
|
+
format: "assetgrove-media/1",
|
|
62
|
+
sha256,
|
|
63
|
+
status: "unavailable",
|
|
64
|
+
reason: "unsupported_media",
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export async function measureMedia(path, sha256) {
|
|
69
|
+
try {
|
|
70
|
+
const read = await readMedia(path, { sha256 });
|
|
71
|
+
if (!read.matches)
|
|
72
|
+
return {
|
|
73
|
+
format: "assetgrove-media/1",
|
|
74
|
+
sha256,
|
|
75
|
+
status: "unavailable",
|
|
76
|
+
reason: "hash_mismatch",
|
|
77
|
+
};
|
|
78
|
+
if (read.kind === "lfs-pointer")
|
|
79
|
+
return { format: "assetgrove-media/1", sha256, status: "unavailable", reason: "lfs_pointer" };
|
|
80
|
+
return measureMediaBytes(read.bytes, sha256);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
if (error instanceof MediaMissingError)
|
|
84
|
+
return {
|
|
85
|
+
format: "assetgrove-media/1",
|
|
86
|
+
sha256,
|
|
87
|
+
status: "unavailable",
|
|
88
|
+
reason: "missing_file",
|
|
89
|
+
};
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The absolute path of `rel`, read from a file in `base`, when it lies inside the library `root`;
|
|
3
|
+
* otherwise throws InputError naming `source`, the file and field it was read from.
|
|
4
|
+
*/
|
|
5
|
+
export declare function libraryPath(root: string, base: string, rel: string, source: string): string;
|
|
6
|
+
/** Whether `rel`, read from a file in `base`, resolves inside the library `root`. */
|
|
7
|
+
export declare function insideLibrary(root: string, base: string, rel: string): boolean;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The library path rule. Every path read from a card, review record or index row must resolve
|
|
3
|
+
* inside the library root, with symlinks resolved, or the read is refused as invalid input, so a
|
|
4
|
+
* shared card cannot point Assetgrove at a file elsewhere.
|
|
5
|
+
*/
|
|
6
|
+
import { realpathSync } from "node:fs";
|
|
7
|
+
import { dirname, isAbsolute, join, posix, relative, resolve, win32 } from "node:path";
|
|
8
|
+
import { InputError } from "../errors.js";
|
|
9
|
+
import { readRecordPath } from "../paths.js";
|
|
10
|
+
function within(root, path) {
|
|
11
|
+
const rel = relative(root, path);
|
|
12
|
+
return (rel !== ".." && !rel.startsWith(`..${posix.sep}`) && !rel.startsWith("..\\") && !isAbsolute(rel));
|
|
13
|
+
}
|
|
14
|
+
/** `path` with symlinks resolved on its longest existing prefix; missing segments are kept as written. */
|
|
15
|
+
function realish(path) {
|
|
16
|
+
const missing = [];
|
|
17
|
+
let head = resolve(path);
|
|
18
|
+
for (;;) {
|
|
19
|
+
try {
|
|
20
|
+
return join(realpathSync.native(head), ...missing.reverse());
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
const parent = dirname(head);
|
|
24
|
+
if (parent === head)
|
|
25
|
+
return resolve(path);
|
|
26
|
+
missing.push(head.slice(parent.length).replace(/^[\\/]+/, ""));
|
|
27
|
+
head = parent;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function resolveInside(root, base, rel, source) {
|
|
32
|
+
const refuse = () => new InputError(`${source}: path "${String(rel)}" leaves the library root`);
|
|
33
|
+
if (typeof rel !== "string" || rel === "" || rel.includes("\0"))
|
|
34
|
+
throw refuse();
|
|
35
|
+
readRecordPath(rel, `${source}: path`);
|
|
36
|
+
const firstSlash = rel.indexOf("/");
|
|
37
|
+
const scheme = rel.indexOf(":");
|
|
38
|
+
if (scheme !== -1 && (firstSlash === -1 || scheme < firstSlash))
|
|
39
|
+
throw refuse();
|
|
40
|
+
if (posix.isAbsolute(rel) || win32.isAbsolute(rel))
|
|
41
|
+
throw refuse();
|
|
42
|
+
const path = resolve(base, rel);
|
|
43
|
+
if (!within(resolve(root), path))
|
|
44
|
+
throw refuse();
|
|
45
|
+
if (!within(realish(root), realish(path)))
|
|
46
|
+
throw refuse();
|
|
47
|
+
return path;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The absolute path of `rel`, read from a file in `base`, when it lies inside the library `root`;
|
|
51
|
+
* otherwise throws InputError naming `source`, the file and field it was read from.
|
|
52
|
+
*/
|
|
53
|
+
export function libraryPath(root, base, rel, source) {
|
|
54
|
+
return resolveInside(root, base, rel, source);
|
|
55
|
+
}
|
|
56
|
+
/** Whether `rel`, read from a file in `base`, resolves inside the library `root`. */
|
|
57
|
+
export function insideLibrary(root, base, rel) {
|
|
58
|
+
try {
|
|
59
|
+
resolveInside(root, base, rel, "path");
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type ReviewRecord } from "./review.ts";
|
|
2
|
+
export declare const RELATIONS: readonly ["derived-from", "variant-of", "part-of"];
|
|
3
|
+
export interface VersionReference {
|
|
4
|
+
asset: string;
|
|
5
|
+
sha256: string;
|
|
6
|
+
}
|
|
7
|
+
/** A source that is a file under the library root, such as an editable artwork file. */
|
|
8
|
+
export interface FileReference {
|
|
9
|
+
file: string;
|
|
10
|
+
sha256: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Relationship {
|
|
13
|
+
relation: (typeof RELATIONS)[number];
|
|
14
|
+
downstream: VersionReference;
|
|
15
|
+
source: VersionReference | FileReference;
|
|
16
|
+
reference: string;
|
|
17
|
+
}
|
|
18
|
+
export interface LineageProblem {
|
|
19
|
+
file: string;
|
|
20
|
+
code: string;
|
|
21
|
+
reference: string;
|
|
22
|
+
message: string;
|
|
23
|
+
}
|
|
24
|
+
interface RecordAsset {
|
|
25
|
+
reviewPath: string;
|
|
26
|
+
review?: {
|
|
27
|
+
record: ReviewRecord;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare function relationshipGraph(root: string, assets: readonly RecordAsset[]): {
|
|
31
|
+
nodes: VersionReference[];
|
|
32
|
+
edges: Relationship[];
|
|
33
|
+
problems: LineageProblem[];
|
|
34
|
+
changedSources: (Relationship & {
|
|
35
|
+
currentSha256: string | null;
|
|
36
|
+
})[];
|
|
37
|
+
affected: {
|
|
38
|
+
recordedSources: Relationship[];
|
|
39
|
+
asset: string;
|
|
40
|
+
sha256: string;
|
|
41
|
+
}[];
|
|
42
|
+
};
|
|
43
|
+
export declare function browseRelationships(graph: ReturnType<typeof relationshipGraph>, asset?: string, sha256?: string): {
|
|
44
|
+
selected: VersionReference[];
|
|
45
|
+
forward: Relationship[];
|
|
46
|
+
reverse: Relationship[];
|
|
47
|
+
nodes: VersionReference[];
|
|
48
|
+
edges: Relationship[];
|
|
49
|
+
problems: LineageProblem[];
|
|
50
|
+
changedSources: (Relationship & {
|
|
51
|
+
currentSha256: string | null;
|
|
52
|
+
})[];
|
|
53
|
+
affected: {
|
|
54
|
+
recordedSources: Relationship[];
|
|
55
|
+
asset: string;
|
|
56
|
+
sha256: string;
|
|
57
|
+
}[];
|
|
58
|
+
};
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { relative, sep } from "node:path";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { InputError } from "../errors.js";
|
|
5
|
+
import { sha256Hex } from "./canonical.js";
|
|
6
|
+
import { parseLfsPointer } from "./lfs.js";
|
|
7
|
+
import { libraryPath } from "./paths.js";
|
|
8
|
+
import { versionSourceIndex } from "./review.js";
|
|
9
|
+
export const RELATIONS = ["derived-from", "variant-of", "part-of"];
|
|
10
|
+
const hex = z.string().regex(/^[0-9a-f]{64}$/);
|
|
11
|
+
const lineageSchema = z.union([
|
|
12
|
+
z.object({ relation: z.enum(RELATIONS), asset: z.string().min(1), sha256: hex }),
|
|
13
|
+
z.object({ relation: z.enum(RELATIONS), file: z.string().min(1), sha256: hex }),
|
|
14
|
+
]);
|
|
15
|
+
const key = (node) => "file" in node ? `file:${node.file}@${node.sha256}` : `${node.asset}@${node.sha256}`;
|
|
16
|
+
const compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
|
|
17
|
+
export function relationshipGraph(root, assets) {
|
|
18
|
+
const nodes = [];
|
|
19
|
+
const current = new Map();
|
|
20
|
+
const records = assets
|
|
21
|
+
.filter((asset) => asset.review)
|
|
22
|
+
.map((asset) => ({
|
|
23
|
+
asset: relative(root, asset.reviewPath)
|
|
24
|
+
.split(sep)
|
|
25
|
+
.join("/")
|
|
26
|
+
.replace(/\.review\.json$/, ""),
|
|
27
|
+
file: relative(root, asset.reviewPath).split(sep).join("/"),
|
|
28
|
+
record: asset.review.record,
|
|
29
|
+
}));
|
|
30
|
+
for (const { asset, record } of records) {
|
|
31
|
+
for (const version of record.versions)
|
|
32
|
+
nodes.push({ asset, sha256: version.sha256 });
|
|
33
|
+
const last = record.versions.at(-1);
|
|
34
|
+
if (last)
|
|
35
|
+
current.set(asset, last.sha256);
|
|
36
|
+
}
|
|
37
|
+
nodes.sort((a, b) => compare(key(a), key(b)));
|
|
38
|
+
const known = new Set(nodes.map(key));
|
|
39
|
+
const edges = [];
|
|
40
|
+
const problems = [];
|
|
41
|
+
for (const { asset, file, record } of records) {
|
|
42
|
+
record.versions.forEach((version, index) => {
|
|
43
|
+
const lineage = version["lineage"];
|
|
44
|
+
if (lineage === undefined)
|
|
45
|
+
return;
|
|
46
|
+
const location = `ag:versions[${versionSourceIndex(version, index)}].lineage`;
|
|
47
|
+
if (!Array.isArray(lineage)) {
|
|
48
|
+
problems.push({
|
|
49
|
+
file,
|
|
50
|
+
code: "lineage_invalid",
|
|
51
|
+
reference: location,
|
|
52
|
+
message: "lineage must be an array",
|
|
53
|
+
});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
lineage.forEach((value, i) => {
|
|
57
|
+
const reference = `${location}[${i}]`;
|
|
58
|
+
const refuse = (message) => problems.push({ file, code: "lineage_invalid", reference, message });
|
|
59
|
+
const parsed = lineageSchema.safeParse(value);
|
|
60
|
+
if (!parsed.success) {
|
|
61
|
+
refuse(`${JSON.stringify(value)}: ${parsed.error.message}`);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const data = parsed.data;
|
|
65
|
+
const { relation, sha256 } = data;
|
|
66
|
+
const sourceName = "file" in data ? data.file : data.asset;
|
|
67
|
+
try {
|
|
68
|
+
libraryPath(root, root, "file" in data ? data.file : `${data.asset}.review.json`, `${file}: ${reference}`);
|
|
69
|
+
if (sourceName.split("/").some((part) => part === "." || part === ".." || part === ""))
|
|
70
|
+
throw new InputError(`${"file" in data ? "file" : "asset"} must be a canonical library-relative ${"file" in data ? "path" : "asset id"}`);
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
refuse(`${JSON.stringify(value)}: ${error instanceof Error ? error.message : String(error)}`);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const source = "file" in data ? { file: data.file, sha256 } : { asset: data.asset, sha256 };
|
|
77
|
+
if (!("file" in source) && !known.has(key(source))) {
|
|
78
|
+
refuse(`unknown source ${key(source)}`);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
edges.push({
|
|
82
|
+
relation,
|
|
83
|
+
downstream: { asset, sha256: version.sha256 },
|
|
84
|
+
source,
|
|
85
|
+
reference: `${file}:${reference}`,
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
edges.sort((a, b) => compare(a.reference, b.reference));
|
|
91
|
+
const adjacency = new Map();
|
|
92
|
+
for (const edge of edges) {
|
|
93
|
+
const from = key(edge.downstream);
|
|
94
|
+
adjacency.set(from, [...(adjacency.get(from) ?? []), key(edge.source)]);
|
|
95
|
+
}
|
|
96
|
+
const reaches = (start, target) => {
|
|
97
|
+
const pending = [start];
|
|
98
|
+
const visited = new Set();
|
|
99
|
+
while (pending.length) {
|
|
100
|
+
const node = pending.pop();
|
|
101
|
+
if (node === target)
|
|
102
|
+
return true;
|
|
103
|
+
if (visited.has(node))
|
|
104
|
+
continue;
|
|
105
|
+
visited.add(node);
|
|
106
|
+
pending.push(...(adjacency.get(node) ?? []));
|
|
107
|
+
}
|
|
108
|
+
return false;
|
|
109
|
+
};
|
|
110
|
+
for (const edge of edges) {
|
|
111
|
+
if (reaches(key(edge.source), key(edge.downstream))) {
|
|
112
|
+
const split = edge.reference.indexOf(":ag:versions");
|
|
113
|
+
problems.push({
|
|
114
|
+
file: edge.reference.slice(0, split),
|
|
115
|
+
code: "lineage_cycle",
|
|
116
|
+
reference: edge.reference.slice(split + 1),
|
|
117
|
+
message: `${key(edge.downstream)} --${edge.relation}--> ${key(edge.source)}`,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
problems.sort((a, b) => compare(`${a.file}:${a.reference}`, `${b.file}:${b.reference}`));
|
|
122
|
+
const changedSources = [];
|
|
123
|
+
for (const edge of edges) {
|
|
124
|
+
const currentSha256 = "file" in edge.source ? fileSha256(root, edge.source.file) : current.get(edge.source.asset);
|
|
125
|
+
if (currentSha256 !== edge.source.sha256)
|
|
126
|
+
changedSources.push({ ...edge, currentSha256 });
|
|
127
|
+
}
|
|
128
|
+
const affectedKeys = new Set(changedSources.map((edge) => key(edge.downstream)));
|
|
129
|
+
const pending = [...affectedKeys];
|
|
130
|
+
const dependents = new Map();
|
|
131
|
+
for (const edge of edges) {
|
|
132
|
+
const from = key(edge.source);
|
|
133
|
+
dependents.set(from, [...(dependents.get(from) ?? []), key(edge.downstream)]);
|
|
134
|
+
}
|
|
135
|
+
while (pending.length) {
|
|
136
|
+
for (const downstream of dependents.get(pending.pop()) ?? []) {
|
|
137
|
+
if (affectedKeys.has(downstream))
|
|
138
|
+
continue;
|
|
139
|
+
affectedKeys.add(downstream);
|
|
140
|
+
pending.push(downstream);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const affected = nodes
|
|
144
|
+
.filter((node) => affectedKeys.has(key(node)))
|
|
145
|
+
.map((node) => ({
|
|
146
|
+
...node,
|
|
147
|
+
recordedSources: edges.filter((edge) => key(edge.downstream) === key(node)),
|
|
148
|
+
}));
|
|
149
|
+
return { nodes, edges, problems, changedSources, affected };
|
|
150
|
+
}
|
|
151
|
+
/** The hash of a file under the library root, an unfetched LFS pointer by its oid; null when unreadable. */
|
|
152
|
+
function fileSha256(root, file) {
|
|
153
|
+
try {
|
|
154
|
+
const bytes = new Uint8Array(readFileSync(libraryPath(root, root, file, file)));
|
|
155
|
+
return parseLfsPointer(bytes)?.oid ?? sha256Hex(bytes);
|
|
156
|
+
}
|
|
157
|
+
catch {
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
export function browseRelationships(graph, asset, sha256) {
|
|
162
|
+
if (sha256 !== undefined && asset === undefined)
|
|
163
|
+
throw new InputError("--sha256 requires --asset");
|
|
164
|
+
const selected = asset === undefined
|
|
165
|
+
? graph.nodes
|
|
166
|
+
: graph.nodes.filter((node) => node.asset === asset && (sha256 === undefined || node.sha256 === sha256));
|
|
167
|
+
if (asset !== undefined && selected.length === 0)
|
|
168
|
+
throw new InputError(`unknown asset version ${asset}${sha256 === undefined ? "" : `@${sha256}`}`);
|
|
169
|
+
const keys = new Set(selected.map(key));
|
|
170
|
+
return {
|
|
171
|
+
...graph,
|
|
172
|
+
selected,
|
|
173
|
+
forward: graph.edges.filter((edge) => keys.has(key(edge.downstream))),
|
|
174
|
+
reverse: graph.edges.filter((edge) => keys.has(key(edge.source))),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Review records: `<assetId>.review.json`, a W3C Web Annotation `AnnotationCollection` beside a
|
|
3
|
+
* picked asset. Each version and annotation sits on its own line, so two branches' appends
|
|
4
|
+
* union-merge; the reader tolerates the missing or extra commas that leaves, and the canonical
|
|
5
|
+
* writer restores strict JSON. Past lines are never rewritten: a resolution is a new annotation.
|
|
6
|
+
*/
|
|
7
|
+
import { z } from "zod";
|
|
8
|
+
/** Every library file kind that carries a format line, with the version this build reads. */
|
|
9
|
+
export declare const LIBRARY_FORMATS: {
|
|
10
|
+
readonly card: 1;
|
|
11
|
+
readonly review: 2;
|
|
12
|
+
};
|
|
13
|
+
export declare const ACTIONS: readonly ["pick", "replace", "approve", "reject", "answer", "card-edit", "adopt", "resolve"];
|
|
14
|
+
export declare const MOTIVATIONS: readonly ["commenting", "replying", "assessing", "editing", "describing", "tagging", "moderating"];
|
|
15
|
+
/** A Media Fragments temporal range in seconds: `t=start,end` or `t=npt:start,end`. */
|
|
16
|
+
export interface TimeRange {
|
|
17
|
+
start: number;
|
|
18
|
+
end: number;
|
|
19
|
+
}
|
|
20
|
+
/** The time range a `t=` fragment names, or undefined when the value is not one. */
|
|
21
|
+
export declare function parseTimeFragment(value: string): TimeRange | undefined;
|
|
22
|
+
declare const annotationSchema: z.ZodObject<{
|
|
23
|
+
id: z.ZodOptional<z.ZodString>;
|
|
24
|
+
type: z.ZodLiteral<"Annotation">;
|
|
25
|
+
motivation: z.ZodEnum<{
|
|
26
|
+
commenting: "commenting";
|
|
27
|
+
replying: "replying";
|
|
28
|
+
assessing: "assessing";
|
|
29
|
+
editing: "editing";
|
|
30
|
+
describing: "describing";
|
|
31
|
+
tagging: "tagging";
|
|
32
|
+
moderating: "moderating";
|
|
33
|
+
}>;
|
|
34
|
+
created: z.ZodString;
|
|
35
|
+
body: z.ZodOptional<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
36
|
+
type: z.ZodLiteral<"TextualBody">;
|
|
37
|
+
value: z.ZodString;
|
|
38
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
39
|
+
format: z.ZodOptional<z.ZodString>;
|
|
40
|
+
language: z.ZodOptional<z.ZodString>;
|
|
41
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
42
|
+
type: z.ZodLiteral<"SpecificResource">;
|
|
43
|
+
source: z.ZodString;
|
|
44
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, z.core.$loose>]>, z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
46
|
+
type: z.ZodLiteral<"TextualBody">;
|
|
47
|
+
value: z.ZodString;
|
|
48
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
49
|
+
format: z.ZodOptional<z.ZodString>;
|
|
50
|
+
language: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
52
|
+
type: z.ZodLiteral<"SpecificResource">;
|
|
53
|
+
source: z.ZodString;
|
|
54
|
+
purpose: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, z.core.$loose>]>>]>>;
|
|
56
|
+
target: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
57
|
+
source: z.ZodString;
|
|
58
|
+
"ag:version": z.ZodOptional<z.ZodString>;
|
|
59
|
+
"ag:frame": z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
"ag:view": z.ZodOptional<z.ZodNumber>;
|
|
61
|
+
"ag:mask": z.ZodOptional<z.ZodString>;
|
|
62
|
+
"ag:frames": z.ZodOptional<z.ZodObject<{
|
|
63
|
+
from: z.ZodNumber;
|
|
64
|
+
to: z.ZodNumber;
|
|
65
|
+
}, z.core.$loose>>;
|
|
66
|
+
"ag:cell": z.ZodOptional<z.ZodObject<{
|
|
67
|
+
column: z.ZodNumber;
|
|
68
|
+
row: z.ZodNumber;
|
|
69
|
+
}, z.core.$loose>>;
|
|
70
|
+
selector: z.ZodOptional<z.ZodObject<{
|
|
71
|
+
type: z.ZodLiteral<"FragmentSelector">;
|
|
72
|
+
conformsTo: z.ZodLiteral<"http://www.w3.org/TR/media-frags/">;
|
|
73
|
+
value: z.ZodString;
|
|
74
|
+
}, z.core.$loose>>;
|
|
75
|
+
}, z.core.$loose>]>;
|
|
76
|
+
"ag:action": z.ZodOptional<z.ZodEnum<{
|
|
77
|
+
replace: "replace";
|
|
78
|
+
pick: "pick";
|
|
79
|
+
approve: "approve";
|
|
80
|
+
reject: "reject";
|
|
81
|
+
answer: "answer";
|
|
82
|
+
"card-edit": "card-edit";
|
|
83
|
+
adopt: "adopt";
|
|
84
|
+
resolve: "resolve";
|
|
85
|
+
}>>;
|
|
86
|
+
"ag:resolves": z.ZodOptional<z.ZodString>;
|
|
87
|
+
"ag:confirmation": z.ZodOptional<z.ZodObject<{
|
|
88
|
+
method: z.ZodString;
|
|
89
|
+
digest: z.ZodOptional<z.ZodString>;
|
|
90
|
+
operator: z.ZodOptional<z.ZodString>;
|
|
91
|
+
delegatedBy: z.ZodOptional<z.ZodString>;
|
|
92
|
+
}, z.core.$loose>>;
|
|
93
|
+
}, z.core.$loose>;
|
|
94
|
+
declare const versionSchema: z.ZodObject<{
|
|
95
|
+
sha256: z.ZodString;
|
|
96
|
+
provenanceSha256: z.ZodOptional<z.ZodString>;
|
|
97
|
+
contentSha256: z.ZodOptional<z.ZodString>;
|
|
98
|
+
run: z.ZodOptional<z.ZodString>;
|
|
99
|
+
candidate: z.ZodOptional<z.ZodString>;
|
|
100
|
+
at: z.ZodString;
|
|
101
|
+
answers: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
|
+
confirmation: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
method: z.ZodString;
|
|
104
|
+
digest: z.ZodOptional<z.ZodString>;
|
|
105
|
+
operator: z.ZodOptional<z.ZodString>;
|
|
106
|
+
delegatedBy: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, z.core.$loose>>;
|
|
108
|
+
}, z.core.$loose>;
|
|
109
|
+
export type Annotation = z.output<typeof annotationSchema> & {
|
|
110
|
+
id: string;
|
|
111
|
+
};
|
|
112
|
+
/** An annotation before its id is computed. */
|
|
113
|
+
export type AnnotationInput = z.input<typeof annotationSchema>;
|
|
114
|
+
export type Version = z.output<typeof versionSchema>;
|
|
115
|
+
export declare function versionSourceIndex(version: Version, fallback: number): number;
|
|
116
|
+
export type VersionInput = z.input<typeof versionSchema>;
|
|
117
|
+
export interface ReviewRecord {
|
|
118
|
+
id: string;
|
|
119
|
+
context: unknown;
|
|
120
|
+
/** Top-level members other than the ones Assetgrove writes itself. */
|
|
121
|
+
extra: Record<string, unknown>;
|
|
122
|
+
/** In stack order, one per media sha256. */
|
|
123
|
+
versions: Version[];
|
|
124
|
+
/** Ordered by `created`, then id. */
|
|
125
|
+
annotations: Annotation[];
|
|
126
|
+
}
|
|
127
|
+
export type VersionStatus = "approved" | "rejected" | "changes-requested" | "pending";
|
|
128
|
+
/** The id an annotation's content earns: `#` and the first 16 hex of the hash of it without `id`. */
|
|
129
|
+
export declare function annotationId(annotation: Record<string, unknown>): string;
|
|
130
|
+
/** A copy of the annotation with its id set, first. */
|
|
131
|
+
export declare function withId<T extends Record<string, unknown>>(annotation: T): T & {
|
|
132
|
+
id: string;
|
|
133
|
+
};
|
|
134
|
+
/** Validates an already-parsed review record; refuses with InputError naming `source`. */
|
|
135
|
+
export declare function validateReview(value: unknown, source: string): ReviewRecord;
|
|
136
|
+
/**
|
|
137
|
+
* Reads a review record. Strict JSON parses as is; otherwise each line inside the versions and
|
|
138
|
+
* items sections is read as one object, tolerating a missing, extra or doubled comma. A union
|
|
139
|
+
* merge of two branches that each appended a version and an annotation interleaves the sections
|
|
140
|
+
* and repeats the lines between them; the reader reads that as the union too.
|
|
141
|
+
*/
|
|
142
|
+
export declare function parseReview(text: string, source: string): ReviewRecord;
|
|
143
|
+
/** The canonical text: fixed header and footer, one line per version and annotation. */
|
|
144
|
+
export declare function writeReview(record: ReviewRecord): string;
|
|
145
|
+
/** A record with no versions and no annotations; `address` is its collection id. */
|
|
146
|
+
export declare function emptyReview(address: string): ReviewRecord;
|
|
147
|
+
/** A new record with the version added (the same media sha256 keeps its earliest entry). */
|
|
148
|
+
export declare function appendVersion(record: ReviewRecord, version: VersionInput): ReviewRecord;
|
|
149
|
+
/**
|
|
150
|
+
* A new record whose version `sha256` derives from `lineage`: each new file entry replaces that
|
|
151
|
+
* file's earlier entry on the version, other entries are kept. Used when a source edit renders the
|
|
152
|
+
* same media again, so the version records the source bytes it now derives from.
|
|
153
|
+
*/
|
|
154
|
+
export declare function updateVersionLineage(record: ReviewRecord, sha256: string, lineage: Array<{
|
|
155
|
+
relation: "derived-from";
|
|
156
|
+
file: string;
|
|
157
|
+
sha256: string;
|
|
158
|
+
}>): ReviewRecord;
|
|
159
|
+
/** A new record with the annotation added, its id computed; the same content is added once. */
|
|
160
|
+
export declare function appendAnnotation(record: ReviewRecord, annotation: AnnotationInput): ReviewRecord;
|
|
161
|
+
/**
|
|
162
|
+
* The stamp for the next version or annotation written into `record`: `now`, or 1 ms after the
|
|
163
|
+
* latest stamp already in the record when that is later. Stamps order the record, so what a writer
|
|
164
|
+
* appends sorts after everything already there even when another machine's clock was ahead.
|
|
165
|
+
*/
|
|
166
|
+
export declare function nextStamp(record: ReviewRecord, now?: Date): string;
|
|
167
|
+
/** The 1-based position of a version in the stack, or undefined when it is not there. */
|
|
168
|
+
export declare function versionNumber(record: ReviewRecord, sha256: string): number | undefined;
|
|
169
|
+
/** The latest version in the stack. */
|
|
170
|
+
export declare function currentVersion(record: ReviewRecord): Version | undefined;
|
|
171
|
+
/** The version an annotation targets, by sha256. */
|
|
172
|
+
export declare function targetVersion(annotation: Annotation): string | undefined;
|
|
173
|
+
/** The latest assessment decides; else an unanswered, unresolved change request; else pending. */
|
|
174
|
+
export declare function versionStatus(record: ReviewRecord, sha256: string): VersionStatus;
|
|
175
|
+
/** The tag a person's `tagging` annotation gives a version to mark it as a placeholder. */
|
|
176
|
+
export declare const PLACEHOLDER_TAG = "placeholder";
|
|
177
|
+
/** The body of a placeholder mark: a W3C tag. */
|
|
178
|
+
export declare function placeholderBody(): {
|
|
179
|
+
type: "TextualBody";
|
|
180
|
+
purpose: string;
|
|
181
|
+
value: string;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* The annotations that mark version `sha256` as a placeholder, oldest first: each `tagging`
|
|
185
|
+
* annotation targeting that version with a tag body whose value is `placeholder`.
|
|
186
|
+
*/
|
|
187
|
+
export declare function placeholderMarks(record: ReviewRecord, sha256: string): Annotation[];
|
|
188
|
+
/** Every path the record names: target sources, masks and linked reference files. */
|
|
189
|
+
export declare function reviewPaths(record: ReviewRecord): string[];
|
|
190
|
+
/** Refuses (InputError) any named path that leaves the library root. */
|
|
191
|
+
export declare function checkReviewPaths(record: ReviewRecord, libraryRoot: string, recordDir: string, source: string): void;
|
|
192
|
+
/** The head of a record: its last annotation's id and a hash of every item line. */
|
|
193
|
+
export interface RecordHead {
|
|
194
|
+
/** The last annotation's id (by `created`, then id), or null when there is none. */
|
|
195
|
+
last: string | null;
|
|
196
|
+
/** The sha256 of the canonical version and annotation lines, joined by newlines. */
|
|
197
|
+
items: string;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The record's head (design section 3.3): a digest that holds it changes once any line is added,
|
|
201
|
+
* whether by a review action, a pull or a union merge, so a stored confirmation cannot be replayed.
|
|
202
|
+
*/
|
|
203
|
+
export declare function recordHead(record: ReviewRecord): RecordHead;
|
|
204
|
+
export {};
|