@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
package/dist/bible.js
ADDED
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
import { isGitMarker } from "./git-marker.js";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
4
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
5
|
+
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
6
|
+
import { parse, stringify } from "yaml";
|
|
7
|
+
import { homeDir } from "./env.js";
|
|
8
|
+
import { InputError } from "./errors.js";
|
|
9
|
+
import { formatLine, readFormat } from "./formats.js";
|
|
10
|
+
import { refuseSettingsBlocks } from "./shared-settings.js";
|
|
11
|
+
import { SUBJECT_KINDS } from "./types.js";
|
|
12
|
+
function object(value, label) {
|
|
13
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
14
|
+
throw new InputError(`${label} must be an object`);
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
function text(value, label) {
|
|
18
|
+
if (typeof value !== "string" || value.trim() === "")
|
|
19
|
+
throw new InputError(`${label} must be a nonempty string`);
|
|
20
|
+
}
|
|
21
|
+
function strings(value, label, empty = false) {
|
|
22
|
+
if (!Array.isArray(value) || (!empty && !value.length))
|
|
23
|
+
throw new InputError(`${label} must be an array of strings`);
|
|
24
|
+
for (const entry of value)
|
|
25
|
+
text(entry, label);
|
|
26
|
+
}
|
|
27
|
+
function choice(value, allowed, label) {
|
|
28
|
+
if (typeof value !== "string" || !allowed.includes(value))
|
|
29
|
+
throw new InputError(`${label} must be one of ${allowed.join(", ")}`);
|
|
30
|
+
}
|
|
31
|
+
/** A subject's optional `kind` and `bounds` (#627). */
|
|
32
|
+
function subjectShape(subject, label) {
|
|
33
|
+
if (subject["kind"] !== undefined)
|
|
34
|
+
choice(subject["kind"], [...SUBJECT_KINDS], `${label}.kind`);
|
|
35
|
+
if (subject["bounds"] !== undefined) {
|
|
36
|
+
const bounds = object(subject["bounds"], `${label}.bounds`);
|
|
37
|
+
for (const key of ["widthM", "heightM", "depthM"]) {
|
|
38
|
+
const value = bounds[key];
|
|
39
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0)
|
|
40
|
+
throw new InputError(`${label}.bounds.${key} must be a positive number of metres`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function number(value, label) {
|
|
45
|
+
if (typeof value !== "number" || !Number.isFinite(value))
|
|
46
|
+
throw new InputError(`${label} must be a finite number`);
|
|
47
|
+
}
|
|
48
|
+
function range(min, max, label) {
|
|
49
|
+
number(min, label);
|
|
50
|
+
number(max, label);
|
|
51
|
+
if (min < 0 || max > 1 || min > max)
|
|
52
|
+
throw new InputError(`${label} must be ordered within 0..1`);
|
|
53
|
+
}
|
|
54
|
+
function hex(value, label) {
|
|
55
|
+
if (typeof value !== "string" || !/^#[\da-f]{6}$/i.test(value))
|
|
56
|
+
throw new InputError(`${label} must be a six-digit hex colour`);
|
|
57
|
+
}
|
|
58
|
+
/** Validate the DTCG types used for art direction, including aliases and inherited group types. */
|
|
59
|
+
export function validateTokens(input) {
|
|
60
|
+
const root = object(input, "tokens");
|
|
61
|
+
const tokens = new Map();
|
|
62
|
+
function collect(group, path, inherited) {
|
|
63
|
+
const type = group["$type"] ?? inherited;
|
|
64
|
+
for (const [name, value] of Object.entries(group)) {
|
|
65
|
+
if (name.startsWith("$"))
|
|
66
|
+
continue;
|
|
67
|
+
if (/[.{}]/.test(name))
|
|
68
|
+
throw new InputError(`invalid DTCG token name ${name}`);
|
|
69
|
+
const node = object(value, `token ${[...path, name].join(".")}`);
|
|
70
|
+
const next = [...path, name];
|
|
71
|
+
if ("$value" in node) {
|
|
72
|
+
if (Object.keys(node).some((key) => !key.startsWith("$")))
|
|
73
|
+
throw new InputError(`DTCG token ${next.join(".")} cannot also be a group`);
|
|
74
|
+
tokens.set(next.join("."), { node, type: node["$type"] ?? type });
|
|
75
|
+
}
|
|
76
|
+
else
|
|
77
|
+
collect(node, next, type);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
collect(root, []);
|
|
81
|
+
const active = new Set();
|
|
82
|
+
const complete = new Map();
|
|
83
|
+
function validate(path) {
|
|
84
|
+
const entry = tokens.get(path);
|
|
85
|
+
if (!entry)
|
|
86
|
+
throw new InputError(`unknown DTCG alias ${path}`);
|
|
87
|
+
if (active.has(path))
|
|
88
|
+
throw new InputError(`circular DTCG alias ${path}`);
|
|
89
|
+
if (complete.has(path))
|
|
90
|
+
return complete.get(path);
|
|
91
|
+
active.add(path);
|
|
92
|
+
const { node } = entry;
|
|
93
|
+
let type = entry.type;
|
|
94
|
+
const value = node["$value"];
|
|
95
|
+
if (typeof value === "string" && /^\{.+\}$/.test(value)) {
|
|
96
|
+
const referredType = validate(value.slice(1, -1));
|
|
97
|
+
if (node["$type"] !== undefined && node["$type"] !== referredType)
|
|
98
|
+
throw new InputError(`DTCG alias ${path} has a different type`);
|
|
99
|
+
type = node["$type"] ?? referredType;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
const label = `DTCG ${path}`;
|
|
103
|
+
switch (type) {
|
|
104
|
+
case "color": {
|
|
105
|
+
const c = object(value, label);
|
|
106
|
+
choice(c["colorSpace"], [
|
|
107
|
+
"srgb",
|
|
108
|
+
"srgb-linear",
|
|
109
|
+
"hsl",
|
|
110
|
+
"hwb",
|
|
111
|
+
"lab",
|
|
112
|
+
"lch",
|
|
113
|
+
"oklab",
|
|
114
|
+
"oklch",
|
|
115
|
+
"display-p3",
|
|
116
|
+
"a98-rgb",
|
|
117
|
+
"prophoto-rgb",
|
|
118
|
+
"rec2020",
|
|
119
|
+
"xyz-d50",
|
|
120
|
+
"xyz-d65",
|
|
121
|
+
], `${label} colorSpace`);
|
|
122
|
+
if (!Array.isArray(c["components"]) || c["components"].length !== 3)
|
|
123
|
+
throw new InputError(`${label} needs three components`);
|
|
124
|
+
for (const v of c["components"])
|
|
125
|
+
if (v !== "none")
|
|
126
|
+
number(v, label);
|
|
127
|
+
if (["srgb", "srgb-linear", "display-p3", "a98-rgb", "prophoto-rgb", "rec2020"].includes(c["colorSpace"]))
|
|
128
|
+
for (const v of c["components"])
|
|
129
|
+
if (v !== "none" && (v < 0 || v > 1))
|
|
130
|
+
throw new InputError(`${label} RGB components must be 0..1`);
|
|
131
|
+
if (c["alpha"] !== undefined)
|
|
132
|
+
range(c["alpha"], c["alpha"], label);
|
|
133
|
+
if (c["hex"] !== undefined)
|
|
134
|
+
hex(c["hex"], label);
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
case "number":
|
|
138
|
+
number(value, label);
|
|
139
|
+
break;
|
|
140
|
+
case "duration": {
|
|
141
|
+
const duration = object(value, label);
|
|
142
|
+
number(duration["value"], label);
|
|
143
|
+
if (duration["value"] < 0)
|
|
144
|
+
throw new InputError(`${label} duration must be nonnegative`);
|
|
145
|
+
choice(duration["unit"], ["ms", "s"], label);
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
case "cubicBezier": {
|
|
149
|
+
if (!Array.isArray(value) || value.length !== 4)
|
|
150
|
+
throw new InputError(`${label} needs four values`);
|
|
151
|
+
for (const v of value)
|
|
152
|
+
number(v, label);
|
|
153
|
+
range(value[0], value[0], label);
|
|
154
|
+
range(value[2], value[2], label);
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
default:
|
|
158
|
+
throw new InputError(`${label} uses unsupported DTCG type ${String(type)}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
active.delete(path);
|
|
162
|
+
complete.set(path, type);
|
|
163
|
+
return type;
|
|
164
|
+
}
|
|
165
|
+
for (const path of tokens.keys())
|
|
166
|
+
validate(path);
|
|
167
|
+
}
|
|
168
|
+
function tokenType(tokens, path, active = new Set()) {
|
|
169
|
+
if (active.has(path))
|
|
170
|
+
throw new InputError(`circular DTCG alias ${path}`);
|
|
171
|
+
active.add(path);
|
|
172
|
+
let node = tokens;
|
|
173
|
+
let inherited;
|
|
174
|
+
for (const key of path.split(".")) {
|
|
175
|
+
const group = object(node, `tokens.${path}`);
|
|
176
|
+
inherited = group["$type"] ?? inherited;
|
|
177
|
+
node = group[key];
|
|
178
|
+
}
|
|
179
|
+
const token = object(node, `tokens.${path}`);
|
|
180
|
+
if (token["$type"] !== undefined)
|
|
181
|
+
return token["$type"];
|
|
182
|
+
const value = token["$value"];
|
|
183
|
+
if (typeof value === "string" && /^\{.+\}$/.test(value))
|
|
184
|
+
return tokenType(tokens, value.slice(1, -1), active);
|
|
185
|
+
return inherited;
|
|
186
|
+
}
|
|
187
|
+
function tokenValue(tokens, path) {
|
|
188
|
+
let value = tokens;
|
|
189
|
+
for (const key of path.split("."))
|
|
190
|
+
value = object(value, `tokens.${path}`)[key];
|
|
191
|
+
const token = object(value, `tokens.${path}`);
|
|
192
|
+
if (!("$value" in token))
|
|
193
|
+
throw new InputError(`tokens.${path} must be a DTCG token`);
|
|
194
|
+
const result = token["$value"];
|
|
195
|
+
return typeof result === "string" && /^\{.+\}$/.test(result)
|
|
196
|
+
? tokenValue(tokens, result.slice(1, -1))
|
|
197
|
+
: result;
|
|
198
|
+
}
|
|
199
|
+
export function biblePalette(bible) {
|
|
200
|
+
const palette = object(bible.tokens["palette"], "tokens.palette");
|
|
201
|
+
return Object.keys(palette)
|
|
202
|
+
.filter((name) => !name.startsWith("$"))
|
|
203
|
+
.map((name) => {
|
|
204
|
+
if (tokenType(bible.tokens, `palette.${name}`) !== "color")
|
|
205
|
+
throw new InputError("palette must use color tokens");
|
|
206
|
+
const color = object(tokenValue(bible.tokens, `palette.${name}`), `palette.${name}`);
|
|
207
|
+
if (color["colorSpace"] !== "srgb")
|
|
208
|
+
throw new InputError("bible palette colours must use sRGB");
|
|
209
|
+
const components = color["components"];
|
|
210
|
+
if (components.some((v) => typeof v !== "number"))
|
|
211
|
+
throw new InputError("palette colours cannot have missing components");
|
|
212
|
+
return `#${components
|
|
213
|
+
.map((v) => Math.round(v * 255)
|
|
214
|
+
.toString(16)
|
|
215
|
+
.padStart(2, "0"))
|
|
216
|
+
.join("")}`;
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
const AXIS_TEXT = ["realism", "proportions", "detailDensity", "texture", "lightingKey"];
|
|
220
|
+
function validateAxes(a, label, partial) {
|
|
221
|
+
const has = (key) => !partial || a[key] !== undefined;
|
|
222
|
+
for (const key of Object.keys(a))
|
|
223
|
+
if (![...AXIS_TEXT, "rendering", "outline", "shading"].includes(key))
|
|
224
|
+
throw new InputError(`${label}.${key} is not a style axis`);
|
|
225
|
+
if (has("rendering"))
|
|
226
|
+
choice(a["rendering"], ["painterly", "naturalistic", "flat-cartoon", "pixel", "stylised-3d"], "rendering");
|
|
227
|
+
for (const key of AXIS_TEXT)
|
|
228
|
+
if (has(key))
|
|
229
|
+
text(a[key], `${label}.${key}`);
|
|
230
|
+
if (has("outline")) {
|
|
231
|
+
const outline = object(a["outline"], `${label}.outline`);
|
|
232
|
+
choice(outline["weight"], ["none", "thin", "bold"], "outline.weight");
|
|
233
|
+
text(outline["colour"], "outline.colour");
|
|
234
|
+
if (!/^\{[^{}]+\}$/.test(outline["colour"]))
|
|
235
|
+
throw new InputError("outline.colour must reference a DTCG color token");
|
|
236
|
+
}
|
|
237
|
+
if (has("shading"))
|
|
238
|
+
choice(a["shading"], ["soft", "cel-2-3-tone", "flat"], "shading");
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* The project root of a shared file in `dir`: the nearest ancestor (inclusive) holding `.git` or
|
|
242
|
+
* `.assetgrove`, else `dir` itself. As in settings, the home directory is never a project root (it
|
|
243
|
+
* would hold every private file), so the walk stops below it. Reference paths in shared files must
|
|
244
|
+
* resolve inside the root.
|
|
245
|
+
*/
|
|
246
|
+
export function projectRoot(dir, home = homeDir()) {
|
|
247
|
+
const start = realish(resolve(dir));
|
|
248
|
+
const stop = realish(resolve(home));
|
|
249
|
+
for (let current = start; current !== stop; current = dirname(current)) {
|
|
250
|
+
if (isGitMarker(join(current, ".git")) || existsSync(join(current, ".assetgrove")))
|
|
251
|
+
return current;
|
|
252
|
+
if (dirname(current) === current)
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
return start;
|
|
256
|
+
}
|
|
257
|
+
/** `path` with symlinks resolved as far as it exists, so a link cannot leave the root unseen. */
|
|
258
|
+
function realish(path) {
|
|
259
|
+
const missing = [];
|
|
260
|
+
let current = path;
|
|
261
|
+
while (!existsSync(current)) {
|
|
262
|
+
if (dirname(current) === current)
|
|
263
|
+
return path;
|
|
264
|
+
missing.unshift(basename(current));
|
|
265
|
+
current = dirname(current);
|
|
266
|
+
}
|
|
267
|
+
return join(realpathSync.native(current), ...missing);
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Refuses (exit 2 `invalid_input`) any of `paths`, relative to `baseDir`, that resolves outside the
|
|
271
|
+
* project root of `baseDir`, so a shared file cannot send a private file from elsewhere.
|
|
272
|
+
*/
|
|
273
|
+
export function requireInsideProject(paths, baseDir, source, home = homeDir()) {
|
|
274
|
+
const root = projectRoot(baseDir, home);
|
|
275
|
+
for (const path of paths) {
|
|
276
|
+
const full = realish(resolve(baseDir, path));
|
|
277
|
+
const rel = relative(root, full);
|
|
278
|
+
if (rel === ".." || rel.startsWith(`..${sep}`) || isAbsolute(rel))
|
|
279
|
+
throw new InputError(`${source}: reference ${path} resolves outside the project root ${root}; move it into the project`);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Checks the licence fields of a bible's reference images: the bible needs `referenceLicense`
|
|
284
|
+
* when it lists any, and each reference's own `license`, when set, must be text.
|
|
285
|
+
*/
|
|
286
|
+
function checkReferenceLicense(referenceLicense, references, source) {
|
|
287
|
+
if (referenceLicense !== undefined)
|
|
288
|
+
text(referenceLicense, `${source} referenceLicense`);
|
|
289
|
+
for (const reference of references)
|
|
290
|
+
if (reference.license !== undefined)
|
|
291
|
+
text(reference.license, `${source} reference ${reference.path} license`);
|
|
292
|
+
if (references.length && referenceLicense === undefined)
|
|
293
|
+
throw new InputError(`${source} lists references but no referenceLicense; add "referenceLicense" (an SPDX ID, LicenseRef-* or NOASSERTION)`);
|
|
294
|
+
}
|
|
295
|
+
/** Every reference image a Markdown bible lists: its anchors and its identity locks' images. */
|
|
296
|
+
/** The perspective sample as a reference, when the bible names one. */
|
|
297
|
+
export function perspectiveReference(bible) {
|
|
298
|
+
return bible.perspective === undefined ? [] : [{ path: bible.perspective, role: "perspective" }];
|
|
299
|
+
}
|
|
300
|
+
export function bibleReferences(bible) {
|
|
301
|
+
return [
|
|
302
|
+
...bible.anchors.positive,
|
|
303
|
+
...bible.anchors.negative,
|
|
304
|
+
...Object.values(bible.identities).flatMap((lock) => [
|
|
305
|
+
{ path: lock.turnaround, role: "turnaround" },
|
|
306
|
+
...(lock.references ?? []).map((path) => ({ path, role: "identity reference" })),
|
|
307
|
+
]),
|
|
308
|
+
];
|
|
309
|
+
}
|
|
310
|
+
/** The licence of each listed reference, as provenance records it; empty when none is listed. */
|
|
311
|
+
export function referenceLicenses(referenceLicense, references) {
|
|
312
|
+
return references.map((reference) => ({
|
|
313
|
+
path: reference.path,
|
|
314
|
+
role: reference.role,
|
|
315
|
+
license: reference.license ?? referenceLicense ?? "NOASSERTION",
|
|
316
|
+
}));
|
|
317
|
+
}
|
|
318
|
+
export function validateBible(input) {
|
|
319
|
+
refuseSettingsBlocks(input, "style bible");
|
|
320
|
+
const b = object(input, "bible");
|
|
321
|
+
for (const field of ["version", "world", "preset"])
|
|
322
|
+
text(b[field], field);
|
|
323
|
+
const a = object(b["axes"], "axes");
|
|
324
|
+
validateAxes(a, "axes", false);
|
|
325
|
+
const outline = object(a["outline"], "outline");
|
|
326
|
+
const looks = b["looks"] === undefined ? {} : object(b["looks"], "looks");
|
|
327
|
+
for (const [name, look] of Object.entries(looks)) {
|
|
328
|
+
text(name, "look name");
|
|
329
|
+
validateAxes(object(look, `looks.${name}`), `looks.${name}`, true);
|
|
330
|
+
}
|
|
331
|
+
const tone = object(b["tone"], "tone");
|
|
332
|
+
choice(tone["audience"], ["young-kids", "all-ages", "teen", "mature"], "audience");
|
|
333
|
+
strings(tone["moodRange"], "moodRange");
|
|
334
|
+
strings(tone["contentLimits"], "contentLimits");
|
|
335
|
+
const anchors = object(b["anchors"], "anchors");
|
|
336
|
+
for (const kind of ["positive", "negative"]) {
|
|
337
|
+
if (!Array.isArray(anchors[kind]))
|
|
338
|
+
throw new InputError(`anchors.${kind} must be an array`);
|
|
339
|
+
for (const value of anchors[kind]) {
|
|
340
|
+
const anchor = object(value, `anchor ${kind}`);
|
|
341
|
+
text(anchor["path"], "anchor.path");
|
|
342
|
+
text(anchor["role"], "anchor.role");
|
|
343
|
+
if (anchor["subject"] !== undefined)
|
|
344
|
+
text(anchor["subject"], "anchor.subject");
|
|
345
|
+
if (anchor["view"] !== undefined)
|
|
346
|
+
text(anchor["view"], "anchor.view");
|
|
347
|
+
if (anchor["license"] !== undefined)
|
|
348
|
+
text(anchor["license"], "anchor.license");
|
|
349
|
+
if (anchor["look"] !== undefined && !Object.hasOwn(looks, anchor["look"]))
|
|
350
|
+
throw new InputError(`anchor ${anchor["path"]} names undeclared look ${anchor["look"]}`);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
choice(b["colorRule"], ["full", "palette"], "colorRule");
|
|
354
|
+
if (b["perspective"] !== undefined)
|
|
355
|
+
text(b["perspective"], "perspective");
|
|
356
|
+
if (b["perspectiveDescription"] !== undefined)
|
|
357
|
+
text(b["perspectiveDescription"], "perspectiveDescription");
|
|
358
|
+
if (b["subjects"] !== undefined)
|
|
359
|
+
for (const [name, value] of Object.entries(object(b["subjects"], "subjects"))) {
|
|
360
|
+
const subject = object(value, `subjects.${name}`);
|
|
361
|
+
text(subject["description"], `subjects.${name}.description`);
|
|
362
|
+
subjectShape(subject, `subjects.${name}`);
|
|
363
|
+
}
|
|
364
|
+
validateTokens(b["tokens"]);
|
|
365
|
+
const tokens = object(b["tokens"], "tokens");
|
|
366
|
+
const outlineTokens = [outline, ...Object.values(looks).map((l) => l["outline"])]
|
|
367
|
+
.filter((o) => o !== undefined)
|
|
368
|
+
.map((o) => o["colour"].slice(1, -1));
|
|
369
|
+
for (const p of ["light", "rim", "fog.colour", ...outlineTokens]) {
|
|
370
|
+
if (tokenType(tokens, p) !== "color")
|
|
371
|
+
throw new InputError(`tokens.${p} must have color type`);
|
|
372
|
+
object(tokenValue(tokens, p), `tokens.${p}`);
|
|
373
|
+
}
|
|
374
|
+
for (const p of [
|
|
375
|
+
"fog.density",
|
|
376
|
+
"valueRange.min",
|
|
377
|
+
"valueRange.max",
|
|
378
|
+
"saturation.min",
|
|
379
|
+
"saturation.max",
|
|
380
|
+
])
|
|
381
|
+
if (tokenType(tokens, p) !== "number")
|
|
382
|
+
throw new InputError(`tokens.${p} must have number type`);
|
|
383
|
+
const density = tokenValue(tokens, "fog.density");
|
|
384
|
+
range(density, density, "fog.density");
|
|
385
|
+
range(tokenValue(tokens, "valueRange.min"), tokenValue(tokens, "valueRange.max"), "valueRange");
|
|
386
|
+
range(tokenValue(tokens, "saturation.min"), tokenValue(tokens, "saturation.max"), "saturation");
|
|
387
|
+
const adjustable = object(b["adjustable"], "adjustable");
|
|
388
|
+
strings(adjustable["mood"], "adjustable.mood");
|
|
389
|
+
const protectedFields = new Set([
|
|
390
|
+
"audience",
|
|
391
|
+
"tone",
|
|
392
|
+
"palette",
|
|
393
|
+
"colorRule",
|
|
394
|
+
"identity",
|
|
395
|
+
"identities",
|
|
396
|
+
"contentLimits",
|
|
397
|
+
"rendering",
|
|
398
|
+
"proportions",
|
|
399
|
+
"signatureFeatures",
|
|
400
|
+
"turnaround",
|
|
401
|
+
]);
|
|
402
|
+
for (const [key, value] of Object.entries(adjustable)) {
|
|
403
|
+
if (protectedFields.has(key) || protectedFields.has(key.split(".")[0]))
|
|
404
|
+
throw new InputError(`adjustable.${key} cannot override the constitution`);
|
|
405
|
+
if (Array.isArray(value))
|
|
406
|
+
strings(value, `adjustable.${key}`);
|
|
407
|
+
else {
|
|
408
|
+
const bounds = object(value, `adjustable.${key}`);
|
|
409
|
+
number(bounds["min"], `adjustable.${key}.min`);
|
|
410
|
+
number(bounds["max"], `adjustable.${key}.max`);
|
|
411
|
+
if (bounds["min"] > bounds["max"])
|
|
412
|
+
throw new InputError(`invalid adjustable.${key} bounds`);
|
|
413
|
+
const tokenRange = key === "saturation"
|
|
414
|
+
? "saturation"
|
|
415
|
+
: ["value", "valueRange"].includes(key)
|
|
416
|
+
? "valueRange"
|
|
417
|
+
: undefined;
|
|
418
|
+
if (tokenRange &&
|
|
419
|
+
(bounds["min"] < tokenValue(tokens, `${tokenRange}.min`) ||
|
|
420
|
+
bounds["max"] > tokenValue(tokens, `${tokenRange}.max`)))
|
|
421
|
+
throw new InputError(`adjustable.${key} exceeds constitutional token bounds`);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
if (adjustable["mood"].some((mood) => !tone["moodRange"].includes(mood)))
|
|
425
|
+
throw new InputError("adjustable moods must lie within tone.moodRange");
|
|
426
|
+
const identities = object(b["identities"], "identities");
|
|
427
|
+
for (const [name, value] of Object.entries(identities)) {
|
|
428
|
+
const lock = object(value, `identity ${name}`);
|
|
429
|
+
if (lock["approved"] !== true)
|
|
430
|
+
throw new InputError(`identity ${name} needs an approved turnaround`);
|
|
431
|
+
for (const key of ["version", "turnaround", "proportions"])
|
|
432
|
+
text(lock[key], `identity.${name}.${key}`);
|
|
433
|
+
strings(lock["signatureFeatures"], `identity.${name}.signatureFeatures`);
|
|
434
|
+
strings(lock["palette"], `identity.${name}.palette`);
|
|
435
|
+
if (lock["references"] !== undefined)
|
|
436
|
+
strings(lock["references"], `identity.${name}.references`);
|
|
437
|
+
for (const colour of lock["palette"])
|
|
438
|
+
hex(colour, `identity.${name}.palette`);
|
|
439
|
+
subjectShape(lock, `identity.${name}`);
|
|
440
|
+
}
|
|
441
|
+
const bible = b;
|
|
442
|
+
if (!biblePalette(bible).length)
|
|
443
|
+
throw new InputError("palette must contain at least one colour token");
|
|
444
|
+
checkReferenceLicense(b["referenceLicense"], [...bibleReferences(bible), ...perspectiveReference(bible)], "bible");
|
|
445
|
+
return bible;
|
|
446
|
+
}
|
|
447
|
+
/** The front matter of a Markdown bible, unparsed, and the prose after it. */
|
|
448
|
+
export function splitFrontMatter(source) {
|
|
449
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/.exec(source);
|
|
450
|
+
if (!match)
|
|
451
|
+
throw new InputError("style bible must be Markdown with YAML front matter");
|
|
452
|
+
return { front: match[1], prose: match[2] };
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Parses a Markdown bible: its front matter must carry the format line of `kind` (a refusal is
|
|
456
|
+
* exit 2 `format_unsupported`), then the bible is validated.
|
|
457
|
+
*/
|
|
458
|
+
export function parseBible(source, kind = "style-bible", name = "style bible") {
|
|
459
|
+
const { front, prose: body } = splitFrontMatter(source);
|
|
460
|
+
try {
|
|
461
|
+
let yaml;
|
|
462
|
+
try {
|
|
463
|
+
yaml = parse(front);
|
|
464
|
+
}
|
|
465
|
+
catch (error) {
|
|
466
|
+
throw new InputError(`invalid bible YAML: ${error.message}`);
|
|
467
|
+
}
|
|
468
|
+
const data = validateBible(readFormat(kind, yaml, name).value);
|
|
469
|
+
const prose = body;
|
|
470
|
+
if (!/^##\s+Do['’]s and Don['’]ts\s*$/im.test(prose))
|
|
471
|
+
throw new InputError("style bible must contain a Do's and Don'ts section");
|
|
472
|
+
return { data, prose };
|
|
473
|
+
}
|
|
474
|
+
catch (error) {
|
|
475
|
+
if (error instanceof InputError)
|
|
476
|
+
throw error;
|
|
477
|
+
throw new InputError(`invalid bible YAML: ${error.message}`);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
/** Writes a Markdown bible with the current format line of `kind` first. */
|
|
481
|
+
export function serializeBible(data, prose, kind = "style-bible") {
|
|
482
|
+
const versioned = { format: formatLine(kind), ...data };
|
|
483
|
+
versioned.format = formatLine(kind);
|
|
484
|
+
validateBible(versioned);
|
|
485
|
+
return `---\n${stringify(versioned)}---\n${prose}`;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Loads a Markdown bible of `kind`: format line, validation, and every reference path inside the
|
|
489
|
+
* project root (exit 2 before any provider call).
|
|
490
|
+
*/
|
|
491
|
+
export async function loadBible(path, kind = "style-bible") {
|
|
492
|
+
const full = resolve(path);
|
|
493
|
+
let source;
|
|
494
|
+
try {
|
|
495
|
+
source = await readFile(full, "utf8");
|
|
496
|
+
}
|
|
497
|
+
catch (error) {
|
|
498
|
+
throw new InputError(`cannot read style bible ${full}`, { cause: error });
|
|
499
|
+
}
|
|
500
|
+
const parsed = parseBible(source, kind, full);
|
|
501
|
+
requireInsideProject([...bibleReferences(parsed.data), ...perspectiveReference(parsed.data)].map((reference) => reference.path), dirname(full), full);
|
|
502
|
+
return {
|
|
503
|
+
path: full,
|
|
504
|
+
dir: dirname(full),
|
|
505
|
+
hash: createHash("sha256").update(source).digest("hex"),
|
|
506
|
+
...parsed,
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
const color = (hex) => ({
|
|
510
|
+
$type: "color",
|
|
511
|
+
$value: {
|
|
512
|
+
colorSpace: "srgb",
|
|
513
|
+
components: [1, 3, 5].map((n) => parseInt(hex.slice(n, n + 2), 16) / 255),
|
|
514
|
+
},
|
|
515
|
+
});
|
|
516
|
+
const numeric = (value) => ({ $type: "number", $value: value });
|
|
517
|
+
function preset(rendering, shading, audience, texture, lightingKey) {
|
|
518
|
+
return {
|
|
519
|
+
format: formatLine("style-bible"),
|
|
520
|
+
version: "1",
|
|
521
|
+
world: "Your world",
|
|
522
|
+
preset: "",
|
|
523
|
+
axes: {
|
|
524
|
+
rendering,
|
|
525
|
+
realism: "clearly stylised, original fictional forms",
|
|
526
|
+
proportions: "readable silhouettes with expressive heads",
|
|
527
|
+
outline: { weight: rendering === "flat-cartoon" ? "bold" : "none", colour: "{outline}" },
|
|
528
|
+
shading,
|
|
529
|
+
detailDensity: rendering === "flat-cartoon" ? "low" : "medium",
|
|
530
|
+
texture,
|
|
531
|
+
lightingKey,
|
|
532
|
+
},
|
|
533
|
+
tone: {
|
|
534
|
+
audience,
|
|
535
|
+
moodRange: audience === "young-kids"
|
|
536
|
+
? ["cheerful", "calm", "curious"]
|
|
537
|
+
: ["warm", "calm", "mildly eerie"],
|
|
538
|
+
contentLimits: ["no graphic violence", "no sexual content", "no hateful imagery"],
|
|
539
|
+
},
|
|
540
|
+
anchors: { positive: [], negative: [] },
|
|
541
|
+
colorRule: "full",
|
|
542
|
+
tokens: {
|
|
543
|
+
palette: { ink: color("#292433"), warm: color("#c49b70"), cool: color("#7c93a8") },
|
|
544
|
+
light: color("#fff0d6"),
|
|
545
|
+
rim: color("#a6c4e8"),
|
|
546
|
+
fog: { colour: color("#a1aabd"), density: numeric(0.1) },
|
|
547
|
+
valueRange: { min: numeric(0.1), max: numeric(0.95) },
|
|
548
|
+
saturation: { min: numeric(0.2), max: numeric(0.8) },
|
|
549
|
+
outline: color("#292433"),
|
|
550
|
+
},
|
|
551
|
+
adjustable: {
|
|
552
|
+
mood: audience === "young-kids"
|
|
553
|
+
? ["cheerful", "calm", "curious"]
|
|
554
|
+
: ["warm", "calm", "mildly eerie"],
|
|
555
|
+
},
|
|
556
|
+
identities: {},
|
|
557
|
+
};
|
|
558
|
+
}
|
|
559
|
+
export const BIBLE_PRESETS = {
|
|
560
|
+
"cozy-storybook": preset("painterly", "soft", "all-ages", "visible gentle brushwork, soft tactile surfaces", "soft diffuse warm key light"),
|
|
561
|
+
"flat-cartoon-kids": preset("flat-cartoon", "flat", "young-kids", "clean solid colour regions, no surface grain", "even bright illumination"),
|
|
562
|
+
"dark-gritty-isometric": preset("stylised-3d", "cel-2-3-tone", "teen", "weathered surfaces with restrained fine grain", "low-key directional light, isometric camera"),
|
|
563
|
+
};
|
|
564
|
+
for (const [name, value] of Object.entries(BIBLE_PRESETS))
|
|
565
|
+
value.preset = name;
|
|
566
|
+
BIBLE_PRESETS["dark-gritty-isometric"].tone.moodRange = ["somber", "tense", "mildly eerie"];
|
|
567
|
+
BIBLE_PRESETS["dark-gritty-isometric"].adjustable.mood = ["somber", "tense", "mildly eerie"];
|
|
568
|
+
BIBLE_PRESETS["dark-gritty-isometric"].tokens["saturation"] = {
|
|
569
|
+
min: numeric(0.1),
|
|
570
|
+
max: numeric(0.5),
|
|
571
|
+
};
|
|
572
|
+
BIBLE_PRESETS["dark-gritty-isometric"].tokens["valueRange"] = {
|
|
573
|
+
min: numeric(0.05),
|
|
574
|
+
max: numeric(0.65),
|
|
575
|
+
};
|
|
576
|
+
export async function describeBible(path) {
|
|
577
|
+
const document = await loadBible(path);
|
|
578
|
+
return {
|
|
579
|
+
...document.data,
|
|
580
|
+
path: document.path,
|
|
581
|
+
hash: document.hash,
|
|
582
|
+
prose: document.prose,
|
|
583
|
+
palette: biblePalette(document.data),
|
|
584
|
+
presets: Object.keys(BIBLE_PRESETS),
|
|
585
|
+
doDont: doDontSection(document.prose),
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
export function doDontSection(prose) {
|
|
589
|
+
return (/^##\s+Do['’]s and Don['’]ts\s*\r?\n([\s\S]*?)(?=^##\s|$(?![\s\S]))/im
|
|
590
|
+
.exec(prose)?.[1]
|
|
591
|
+
?.trim() ?? "");
|
|
592
|
+
}
|
|
593
|
+
/** The name, and folder, of the art-direction skill init writes (src/init.ts). */
|
|
594
|
+
export const ART_DIRECTION_SKILL = "art-direction";
|
|
595
|
+
/** The colours of the project's DESIGN.md, or undefined when it has none. Whether an asset is UI is decided by the caller. */
|
|
596
|
+
export async function loadDesignColors(directory) {
|
|
597
|
+
let source;
|
|
598
|
+
try {
|
|
599
|
+
source = await readFile(join(directory, "DESIGN.md"), "utf8");
|
|
600
|
+
}
|
|
601
|
+
catch (error) {
|
|
602
|
+
if (error.code === "ENOENT")
|
|
603
|
+
return undefined;
|
|
604
|
+
throw error;
|
|
605
|
+
}
|
|
606
|
+
const front = /^---\r?\n([\s\S]*?)\r?\n---/.exec(source);
|
|
607
|
+
const blocks = [
|
|
608
|
+
...(front ? [front[1]] : []),
|
|
609
|
+
...Array.from(source.matchAll(/^```ya?ml[^\n]*\r?\n([\s\S]*?)^```\s*$/gm), (match) => match[1]),
|
|
610
|
+
];
|
|
611
|
+
const colors = {};
|
|
612
|
+
for (const block of blocks) {
|
|
613
|
+
const parsed = parse(block);
|
|
614
|
+
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
|
|
615
|
+
continue;
|
|
616
|
+
const candidate = parsed["colors"];
|
|
617
|
+
if (candidate !== undefined)
|
|
618
|
+
Object.assign(colors, object(candidate, "DESIGN.md colors"));
|
|
619
|
+
}
|
|
620
|
+
return Object.keys(colors).length ? colors : undefined;
|
|
621
|
+
}
|
|
622
|
+
/** Explicitly replace look/tone from a target-owned preset while retaining world identity and palette. */
|
|
623
|
+
export async function useBiblePreset(options) {
|
|
624
|
+
if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(options.preset))
|
|
625
|
+
throw new InputError("preset must be a lowercase slug");
|
|
626
|
+
const document = await loadBible(options.biblePath);
|
|
627
|
+
const selected = await loadBible(join(document.dir, "presets", `${options.preset}.md`), "style-preset");
|
|
628
|
+
const data = structuredClone(document.data);
|
|
629
|
+
data.preset = options.preset;
|
|
630
|
+
data.axes = structuredClone(selected.data.axes);
|
|
631
|
+
data.tone = structuredClone(selected.data.tone);
|
|
632
|
+
data.adjustable = structuredClone(selected.data.adjustable);
|
|
633
|
+
data.tokens = {
|
|
634
|
+
...data.tokens,
|
|
635
|
+
...structuredClone(selected.data.tokens),
|
|
636
|
+
palette: data.tokens["palette"],
|
|
637
|
+
};
|
|
638
|
+
validateBible(data);
|
|
639
|
+
await writeFile(document.path, serializeBible(data, document.prose));
|
|
640
|
+
return describeBible(document.path);
|
|
641
|
+
}
|