@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,77 @@
|
|
|
1
|
+
import type { Caller } from "../calls.ts";
|
|
2
|
+
import type { PlannedCall } from "../generators/generator.ts";
|
|
3
|
+
import type { Routes } from "../routes.ts";
|
|
4
|
+
import type { AssetSpec, BibleReference, LoadedReference, StyleBible } from "../types.ts";
|
|
5
|
+
/** The views a reference can show, each with what it means (the choice's options). */
|
|
6
|
+
export declare const REFERENCE_VIEWS: {
|
|
7
|
+
readonly front: "a single full-body view of the character from the front, facing the viewer";
|
|
8
|
+
readonly left: "a single full-body view of the character's own left side, in profile";
|
|
9
|
+
readonly right: "a single full-body view of the character's own right side, in profile";
|
|
10
|
+
readonly back: "a single full-body view of the character from behind";
|
|
11
|
+
readonly "three-quarter": "a single full-body view of the character turned about halfway between front and side";
|
|
12
|
+
readonly sheet: "several views of the character on one sheet (a turnaround or character sheet)";
|
|
13
|
+
readonly detail: "not a full-body view: a close-up of the head or a part, an expression, a pose detail";
|
|
14
|
+
};
|
|
15
|
+
export type ReferenceView = keyof typeof REFERENCE_VIEWS;
|
|
16
|
+
/** How a reference's view was known: declared by the bible, judged now, or judged earlier. */
|
|
17
|
+
export type ViewSource = "declared" | "judged" | "cached";
|
|
18
|
+
export interface ViewedReference extends LoadedReference {
|
|
19
|
+
view: ReferenceView;
|
|
20
|
+
viewSource: ViewSource;
|
|
21
|
+
/** The judged view's probability, when it was judged. */
|
|
22
|
+
probability?: number;
|
|
23
|
+
}
|
|
24
|
+
export declare function isReferenceView(value: unknown): value is ReferenceView;
|
|
25
|
+
/** Throws for a declared `view` that names none of the views. */
|
|
26
|
+
export declare function checkDeclaredView(reference: {
|
|
27
|
+
path: string;
|
|
28
|
+
view?: unknown;
|
|
29
|
+
}, where: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* The bible's references of the spec's subject, without the perspective sample; with `byLook`,
|
|
32
|
+
* only those of the spec's look (or of every look).
|
|
33
|
+
*/
|
|
34
|
+
export declare function subjectBibleReferences(spec: AssetSpec, bible: StyleBible, options?: {
|
|
35
|
+
byLook?: boolean;
|
|
36
|
+
}): BibleReference[];
|
|
37
|
+
/**
|
|
38
|
+
* The view calls a request forecasts: one per reference with no declared view. An upper bound,
|
|
39
|
+
* so the confirmed request does not depend on what the cache holds.
|
|
40
|
+
*/
|
|
41
|
+
export declare function planReferenceViews(references: BibleReference[], routes: Routes): PlannedCall[];
|
|
42
|
+
interface CachedView {
|
|
43
|
+
view: ReferenceView;
|
|
44
|
+
probability?: number;
|
|
45
|
+
model: string;
|
|
46
|
+
role: string;
|
|
47
|
+
}
|
|
48
|
+
/** Judged views by image sha256: in memory for the run, and on disk under a state directory. */
|
|
49
|
+
export declare class ReferenceViewCache {
|
|
50
|
+
#private;
|
|
51
|
+
constructor(stateDir?: string);
|
|
52
|
+
get(sha256: string): Promise<CachedView | undefined>;
|
|
53
|
+
set(sha256: string, value: CachedView): Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Which view each reference shows: the bible's declared view, else the cache, else one typed
|
|
57
|
+
* choice decision on the image and its role (made through `call`, inside the run's budget).
|
|
58
|
+
*/
|
|
59
|
+
export declare function referenceViews(call: Caller, references: Array<LoadedReference & {
|
|
60
|
+
declared?: string | undefined;
|
|
61
|
+
}>, cache: ReferenceViewCache): Promise<ViewedReference[]>;
|
|
62
|
+
/** Loads the references and answers which view each shows; see `referenceViews`. */
|
|
63
|
+
export declare function loadReferenceViews(call: Caller, references: BibleReference[], bibleDir: string, cache: ReferenceViewCache): Promise<ViewedReference[]>;
|
|
64
|
+
/** What each reference was judged (or declared) to show, for an error or a reason. */
|
|
65
|
+
export declare function describeViews(references: ViewedReference[]): string;
|
|
66
|
+
/** Refuses a request whose references show no front view, naming what each was judged to show. */
|
|
67
|
+
export declare function requireFront(references: ViewedReference[]): void;
|
|
68
|
+
/** The views as recorded in provenance, one per reference. */
|
|
69
|
+
export declare function viewRecord(references: ViewedReference[]): {
|
|
70
|
+
probability?: number | undefined;
|
|
71
|
+
role: string;
|
|
72
|
+
path: string;
|
|
73
|
+
sha256: string;
|
|
74
|
+
view: "front" | "sheet" | "left" | "right" | "back" | "three-quarter" | "detail";
|
|
75
|
+
viewSource: ViewSource;
|
|
76
|
+
}[];
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which view each approved reference of a 3D request shows (#325), for generation and look-dev
|
|
3
|
+
* alike. A `view` the bible declares on the reference wins; otherwise a typed choice decision is
|
|
4
|
+
* shown the image and its role and chooses among the views below. The answer is cached by the
|
|
5
|
+
* image's sha256: in memory for the run and, when the command has a state directory, in
|
|
6
|
+
* `<stateDir>/reference-views/<sha256>.json`. A request with no front view is refused before its
|
|
7
|
+
* first expensive call.
|
|
8
|
+
*/
|
|
9
|
+
import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
import { InputError } from "../errors.js";
|
|
12
|
+
import { loadReference, subjectOf } from "../request.js";
|
|
13
|
+
import { REFERENCE_VIEW_OPERATION } from "../routes.js";
|
|
14
|
+
/** The views a reference can show, each with what it means (the choice's options). */
|
|
15
|
+
export const REFERENCE_VIEWS = {
|
|
16
|
+
front: "a single full-body view of the character from the front, facing the viewer",
|
|
17
|
+
left: "a single full-body view of the character's own left side, in profile",
|
|
18
|
+
right: "a single full-body view of the character's own right side, in profile",
|
|
19
|
+
back: "a single full-body view of the character from behind",
|
|
20
|
+
"three-quarter": "a single full-body view of the character turned about halfway between front and side",
|
|
21
|
+
sheet: "several views of the character on one sheet (a turnaround or character sheet)",
|
|
22
|
+
detail: "not a full-body view: a close-up of the head or a part, an expression, a pose detail",
|
|
23
|
+
};
|
|
24
|
+
export function isReferenceView(value) {
|
|
25
|
+
return typeof value === "string" && Object.hasOwn(REFERENCE_VIEWS, value);
|
|
26
|
+
}
|
|
27
|
+
/** Throws for a declared `view` that names none of the views. */
|
|
28
|
+
export function checkDeclaredView(reference, where) {
|
|
29
|
+
if (reference.view !== undefined && !isReferenceView(reference.view)) {
|
|
30
|
+
throw new InputError(`${where}: reference ${reference.path} declares view ${JSON.stringify(reference.view)}; ` +
|
|
31
|
+
`a view is one of ${Object.keys(REFERENCE_VIEWS).join(", ")}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The bible's references of the spec's subject, without the perspective sample; with `byLook`,
|
|
36
|
+
* only those of the spec's look (or of every look).
|
|
37
|
+
*/
|
|
38
|
+
export function subjectBibleReferences(spec, bible, options = {}) {
|
|
39
|
+
const subject = subjectOf(spec);
|
|
40
|
+
return (bible.references ?? []).filter((r) => r.subject === subject &&
|
|
41
|
+
r.role !== "perspective" &&
|
|
42
|
+
(!options.byLook || r.look === undefined || spec.look === undefined || r.look === spec.look));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The view calls a request forecasts: one per reference with no declared view. An upper bound,
|
|
46
|
+
* so the confirmed request does not depend on what the cache holds.
|
|
47
|
+
*/
|
|
48
|
+
export function planReferenceViews(references, routes) {
|
|
49
|
+
const undeclared = references.filter((r) => r.view === undefined);
|
|
50
|
+
if (undeclared.length === 0)
|
|
51
|
+
return [];
|
|
52
|
+
const route = Object.hasOwn(routes, REFERENCE_VIEW_OPERATION)
|
|
53
|
+
? routes[REFERENCE_VIEW_OPERATION]
|
|
54
|
+
: undefined;
|
|
55
|
+
if (!route)
|
|
56
|
+
throw new InputError(`no model route for operation "${REFERENCE_VIEW_OPERATION}"`);
|
|
57
|
+
return undeclared.map(() => ({
|
|
58
|
+
operation: REFERENCE_VIEW_OPERATION,
|
|
59
|
+
model: route.model,
|
|
60
|
+
estimatedCostUsd: route.estimatedCostUsd,
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
/** Judged views by image sha256: in memory for the run, and on disk under a state directory. */
|
|
64
|
+
export class ReferenceViewCache {
|
|
65
|
+
#memory = new Map();
|
|
66
|
+
#dir;
|
|
67
|
+
constructor(stateDir) {
|
|
68
|
+
this.#dir = stateDir !== undefined ? join(stateDir, "reference-views") : undefined;
|
|
69
|
+
}
|
|
70
|
+
async get(sha256) {
|
|
71
|
+
const held = this.#memory.get(sha256);
|
|
72
|
+
if (held || this.#dir === undefined)
|
|
73
|
+
return held;
|
|
74
|
+
try {
|
|
75
|
+
const value = JSON.parse(await readFile(join(this.#dir, `${sha256}.json`), "utf8"));
|
|
76
|
+
if (!value || !isReferenceView(value.view))
|
|
77
|
+
return undefined;
|
|
78
|
+
const cached = {
|
|
79
|
+
view: value.view,
|
|
80
|
+
...(typeof value.probability === "number" && { probability: value.probability }),
|
|
81
|
+
model: typeof value.model === "string" ? value.model : "",
|
|
82
|
+
role: typeof value.role === "string" ? value.role : "",
|
|
83
|
+
};
|
|
84
|
+
this.#memory.set(sha256, cached);
|
|
85
|
+
return cached;
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async set(sha256, value) {
|
|
92
|
+
this.#memory.set(sha256, value);
|
|
93
|
+
if (this.#dir === undefined)
|
|
94
|
+
return;
|
|
95
|
+
await mkdir(this.#dir, { recursive: true });
|
|
96
|
+
const file = join(this.#dir, `${sha256}.json`);
|
|
97
|
+
const temp = `${file}.${process.pid}.tmp`;
|
|
98
|
+
await writeFile(temp, `${JSON.stringify(value, null, 2)}\n`);
|
|
99
|
+
await rename(temp, file);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function viewPrompt(role) {
|
|
103
|
+
return [
|
|
104
|
+
"The image is an approved reference of a character, for building its 3D model.",
|
|
105
|
+
`The style bible names its role: "${role}". The role may not name the view; judge from the image.`,
|
|
106
|
+
"Which view of the character does the image show? Left and right are the character's own left and right side, not the viewer's.",
|
|
107
|
+
].join("\n");
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Which view each reference shows: the bible's declared view, else the cache, else one typed
|
|
111
|
+
* choice decision on the image and its role (made through `call`, inside the run's budget).
|
|
112
|
+
*/
|
|
113
|
+
export async function referenceViews(call, references, cache) {
|
|
114
|
+
const out = [];
|
|
115
|
+
for (const { declared, ...reference } of references) {
|
|
116
|
+
if (declared !== undefined) {
|
|
117
|
+
checkDeclaredView({ path: reference.path, view: declared }, "the style bible");
|
|
118
|
+
out.push({ ...reference, view: declared, viewSource: "declared" });
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
const cached = await cache.get(reference.sha256);
|
|
122
|
+
if (cached) {
|
|
123
|
+
out.push({
|
|
124
|
+
...reference,
|
|
125
|
+
view: cached.view,
|
|
126
|
+
viewSource: "cached",
|
|
127
|
+
...(cached.probability !== undefined && { probability: cached.probability }),
|
|
128
|
+
});
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const { result, record } = await call.decide(REFERENCE_VIEW_OPERATION, viewPrompt(reference.role), [reference], {
|
|
132
|
+
type: "choice",
|
|
133
|
+
instructions: "Choose the view the image shows.",
|
|
134
|
+
options: { ...REFERENCE_VIEWS },
|
|
135
|
+
});
|
|
136
|
+
if (result.answer.type !== "choice" || !isReferenceView(result.answer.choice)) {
|
|
137
|
+
throw new InputError(`the ${REFERENCE_VIEW_OPERATION} decision gave no view`);
|
|
138
|
+
}
|
|
139
|
+
const view = result.answer.choice;
|
|
140
|
+
const probability = record.decision?.value;
|
|
141
|
+
await cache.set(reference.sha256, {
|
|
142
|
+
view,
|
|
143
|
+
...(probability !== undefined && { probability }),
|
|
144
|
+
model: record.model,
|
|
145
|
+
role: reference.role,
|
|
146
|
+
});
|
|
147
|
+
out.push({
|
|
148
|
+
...reference,
|
|
149
|
+
view,
|
|
150
|
+
viewSource: "judged",
|
|
151
|
+
...(probability !== undefined && { probability }),
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
return out;
|
|
155
|
+
}
|
|
156
|
+
/** Loads the references and answers which view each shows; see `referenceViews`. */
|
|
157
|
+
export async function loadReferenceViews(call, references, bibleDir, cache) {
|
|
158
|
+
const loaded = await Promise.all(references.map(async (r) => ({
|
|
159
|
+
...(await loadReference(r.path, r.role, bibleDir)),
|
|
160
|
+
declared: r.view,
|
|
161
|
+
})));
|
|
162
|
+
return referenceViews(call, loaded, cache);
|
|
163
|
+
}
|
|
164
|
+
/** What each reference was judged (or declared) to show, for an error or a reason. */
|
|
165
|
+
export function describeViews(references) {
|
|
166
|
+
return references
|
|
167
|
+
.map((r) => `${r.path} ("${r.role}"): ${r.view}` +
|
|
168
|
+
(r.viewSource === "declared"
|
|
169
|
+
? " (declared)"
|
|
170
|
+
: ` (judged${r.probability !== undefined ? `, p ${r.probability.toFixed(2)}` : ""}${r.viewSource === "cached" ? ", cached" : ""})`))
|
|
171
|
+
.join("; ");
|
|
172
|
+
}
|
|
173
|
+
/** Refuses a request whose references show no front view, naming what each was judged to show. */
|
|
174
|
+
export function requireFront(references) {
|
|
175
|
+
if (references.some((r) => r.view === "front"))
|
|
176
|
+
return;
|
|
177
|
+
throw new InputError(`no approved reference shows the character's front view, so no paid 3D call was made: ` +
|
|
178
|
+
`${describeViews(references)}. Add a front view, or declare "view": "front" on the reference that shows it`);
|
|
179
|
+
}
|
|
180
|
+
/** The views as recorded in provenance, one per reference. */
|
|
181
|
+
export function viewRecord(references) {
|
|
182
|
+
return references.map((r) => ({
|
|
183
|
+
role: r.role,
|
|
184
|
+
path: r.path,
|
|
185
|
+
sha256: r.sha256,
|
|
186
|
+
view: r.view,
|
|
187
|
+
viewSource: r.viewSource,
|
|
188
|
+
...(r.probability !== undefined && { probability: Math.round(r.probability * 1e4) / 1e4 }),
|
|
189
|
+
}));
|
|
190
|
+
}
|
package/dist/origin.d.ts
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { DigitalSourceType, SourceDeclaration } from "./metadata.ts";
|
|
3
|
+
declare const answer: z.ZodEnum<{
|
|
4
|
+
yes: "yes";
|
|
5
|
+
no: "no";
|
|
6
|
+
"not-stated": "not-stated";
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* What a supplier's licence allows, as a person read it from the supplier's own wording. The person
|
|
10
|
+
* confirms them in the confirmation of every hand-off of the media, which shows them and whose digest
|
|
11
|
+
* covers them.
|
|
12
|
+
*/
|
|
13
|
+
export declare const termsSchema: z.ZodObject<{
|
|
14
|
+
commercial: z.ZodEnum<{
|
|
15
|
+
yes: "yes";
|
|
16
|
+
no: "no";
|
|
17
|
+
"not-stated": "not-stated";
|
|
18
|
+
}>;
|
|
19
|
+
modification: z.ZodEnum<{
|
|
20
|
+
yes: "yes";
|
|
21
|
+
no: "no";
|
|
22
|
+
"not-stated": "not-stated";
|
|
23
|
+
}>;
|
|
24
|
+
redistribution: z.ZodEnum<{
|
|
25
|
+
yes: "yes";
|
|
26
|
+
no: "no";
|
|
27
|
+
"not-stated": "not-stated";
|
|
28
|
+
}>;
|
|
29
|
+
reference: z.ZodEnum<{
|
|
30
|
+
yes: "yes";
|
|
31
|
+
no: "no";
|
|
32
|
+
"not-stated": "not-stated";
|
|
33
|
+
}>;
|
|
34
|
+
wording: z.ZodString;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
export type OriginTerms = z.infer<typeof termsSchema>;
|
|
37
|
+
export type TermsAnswer = z.infer<typeof answer>;
|
|
38
|
+
/** The terms' permissions, in the order they are checked and reported. */
|
|
39
|
+
export declare const TERMS: readonly ["commercial", "modification", "redistribution", "reference"];
|
|
40
|
+
export type TermsPermission = (typeof TERMS)[number];
|
|
41
|
+
export declare const originSchema: z.ZodObject<{
|
|
42
|
+
kind: z.ZodEnum<{
|
|
43
|
+
"human-made": "human-made";
|
|
44
|
+
"third-party": "third-party";
|
|
45
|
+
}>;
|
|
46
|
+
evidence: z.ZodString;
|
|
47
|
+
source: z.ZodOptional<z.ZodString>;
|
|
48
|
+
license: z.ZodOptional<z.ZodString>;
|
|
49
|
+
terms: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
commercial: z.ZodEnum<{
|
|
51
|
+
yes: "yes";
|
|
52
|
+
no: "no";
|
|
53
|
+
"not-stated": "not-stated";
|
|
54
|
+
}>;
|
|
55
|
+
modification: z.ZodEnum<{
|
|
56
|
+
yes: "yes";
|
|
57
|
+
no: "no";
|
|
58
|
+
"not-stated": "not-stated";
|
|
59
|
+
}>;
|
|
60
|
+
redistribution: z.ZodEnum<{
|
|
61
|
+
yes: "yes";
|
|
62
|
+
no: "no";
|
|
63
|
+
"not-stated": "not-stated";
|
|
64
|
+
}>;
|
|
65
|
+
reference: z.ZodEnum<{
|
|
66
|
+
yes: "yes";
|
|
67
|
+
no: "no";
|
|
68
|
+
"not-stated": "not-stated";
|
|
69
|
+
}>;
|
|
70
|
+
wording: z.ZodString;
|
|
71
|
+
}, z.core.$strict>>;
|
|
72
|
+
attribution: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, z.core.$strict>;
|
|
74
|
+
export type OriginRecord = z.infer<typeof originSchema>;
|
|
75
|
+
/**
|
|
76
|
+
* How a permission the terms do not give is refused: the supplier forbids it (`forbidden`), the
|
|
77
|
+
* terms do not state it and that counts as no (`unstated-no`), or they do not state it and the
|
|
78
|
+
* developer must record yes or no (`question`).
|
|
79
|
+
*/
|
|
80
|
+
export type TermsOutcome = "forbidden" | "unstated-no" | "question";
|
|
81
|
+
export interface TermsProblem {
|
|
82
|
+
permission: TermsPermission;
|
|
83
|
+
answer: TermsAnswer;
|
|
84
|
+
outcome: TermsOutcome;
|
|
85
|
+
reason: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* The permissions in `needed` the terms of a third-party origin do not give, each with its outcome
|
|
89
|
+
* and reason; empty when they give all of it or the origin is not third-party. A third-party origin
|
|
90
|
+
* without terms states nothing. Not stated is no for redistribution and reference use, and a
|
|
91
|
+
* question for the developer for commercial use and modification (issue #683).
|
|
92
|
+
*/
|
|
93
|
+
export declare function termsProblems(origin: Pick<LibraryOrigin, "declaredKind" | "kind" | "terms"> | undefined, needed: readonly TermsPermission[]): TermsProblem[];
|
|
94
|
+
/** A third-party origin's terms as a hand-off's confirmation shows them and its digest covers them. */
|
|
95
|
+
export interface ShownTerms {
|
|
96
|
+
source: string;
|
|
97
|
+
license: string | null;
|
|
98
|
+
/** The terms, or null when the origin records none (every answer not stated). */
|
|
99
|
+
terms: OriginTerms | null;
|
|
100
|
+
}
|
|
101
|
+
/** The terms a person confirms with a hand-off of media from `origin`; undefined unless third-party. */
|
|
102
|
+
export declare function shownTerms(origin: Pick<LibraryOrigin, "declaredKind" | "kind" | "source" | "license" | "terms"> | undefined): ShownTerms | undefined;
|
|
103
|
+
/** The shown terms as one clause of a confirmation's summary. */
|
|
104
|
+
export declare function shownTermsText(shown: ShownTerms): string;
|
|
105
|
+
export interface LibraryOrigin {
|
|
106
|
+
kind: "unknown" | "ai-generated" | "human-made" | "third-party";
|
|
107
|
+
declaredKind?: OriginRecord["kind"];
|
|
108
|
+
evidence?: string;
|
|
109
|
+
source?: string;
|
|
110
|
+
license?: string;
|
|
111
|
+
terms?: OriginTerms;
|
|
112
|
+
attribution?: string;
|
|
113
|
+
digitalSourceType?: DigitalSourceType;
|
|
114
|
+
}
|
|
115
|
+
export declare const libraryOriginSchema: z.ZodObject<{
|
|
116
|
+
kind: z.ZodEnum<{
|
|
117
|
+
unknown: "unknown";
|
|
118
|
+
"human-made": "human-made";
|
|
119
|
+
"third-party": "third-party";
|
|
120
|
+
"ai-generated": "ai-generated";
|
|
121
|
+
}>;
|
|
122
|
+
declaredKind: z.ZodOptional<z.ZodEnum<{
|
|
123
|
+
"human-made": "human-made";
|
|
124
|
+
"third-party": "third-party";
|
|
125
|
+
}>>;
|
|
126
|
+
evidence: z.ZodOptional<z.ZodString>;
|
|
127
|
+
source: z.ZodOptional<z.ZodString>;
|
|
128
|
+
license: z.ZodOptional<z.ZodString>;
|
|
129
|
+
terms: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
commercial: z.ZodEnum<{
|
|
131
|
+
yes: "yes";
|
|
132
|
+
no: "no";
|
|
133
|
+
"not-stated": "not-stated";
|
|
134
|
+
}>;
|
|
135
|
+
modification: z.ZodEnum<{
|
|
136
|
+
yes: "yes";
|
|
137
|
+
no: "no";
|
|
138
|
+
"not-stated": "not-stated";
|
|
139
|
+
}>;
|
|
140
|
+
redistribution: z.ZodEnum<{
|
|
141
|
+
yes: "yes";
|
|
142
|
+
no: "no";
|
|
143
|
+
"not-stated": "not-stated";
|
|
144
|
+
}>;
|
|
145
|
+
reference: z.ZodEnum<{
|
|
146
|
+
yes: "yes";
|
|
147
|
+
no: "no";
|
|
148
|
+
"not-stated": "not-stated";
|
|
149
|
+
}>;
|
|
150
|
+
wording: z.ZodString;
|
|
151
|
+
}, z.core.$strict>>;
|
|
152
|
+
attribution: z.ZodOptional<z.ZodString>;
|
|
153
|
+
digitalSourceType: z.ZodOptional<z.ZodCustom<DigitalSourceType, DigitalSourceType>>;
|
|
154
|
+
}, z.core.$strip>;
|
|
155
|
+
export declare function parseOrigin(value: unknown, label?: string): OriginRecord;
|
|
156
|
+
export declare function originOf(provenance: {
|
|
157
|
+
origin?: OriginRecord;
|
|
158
|
+
digitalSourceType?: DigitalSourceType;
|
|
159
|
+
sourceDeclaration?: SourceDeclaration;
|
|
160
|
+
}): LibraryOrigin;
|
|
161
|
+
export declare function originSourceType(value: unknown): DigitalSourceType | undefined;
|
|
162
|
+
export {};
|
package/dist/origin.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { InputError } from "./errors.js";
|
|
3
|
+
import { DIGITAL_SOURCE_TYPES, parseDigitalSourceType } from "./metadata.js";
|
|
4
|
+
const nonEmpty = z.string().refine((value) => value.trim().length > 0, "must not be empty");
|
|
5
|
+
const answer = z.enum(["yes", "no", "not-stated"]);
|
|
6
|
+
/**
|
|
7
|
+
* What a supplier's licence allows, as a person read it from the supplier's own wording. The person
|
|
8
|
+
* confirms them in the confirmation of every hand-off of the media, which shows them and whose digest
|
|
9
|
+
* covers them.
|
|
10
|
+
*/
|
|
11
|
+
export const termsSchema = z.strictObject({
|
|
12
|
+
commercial: answer,
|
|
13
|
+
modification: answer,
|
|
14
|
+
redistribution: answer,
|
|
15
|
+
reference: answer,
|
|
16
|
+
/** The supplier's own wording, verbatim. */
|
|
17
|
+
wording: nonEmpty,
|
|
18
|
+
});
|
|
19
|
+
/** The terms' permissions, in the order they are checked and reported. */
|
|
20
|
+
export const TERMS = ["commercial", "modification", "redistribution", "reference"];
|
|
21
|
+
export const originSchema = z
|
|
22
|
+
.strictObject({
|
|
23
|
+
kind: z.enum(["human-made", "third-party"]),
|
|
24
|
+
evidence: nonEmpty,
|
|
25
|
+
source: z.string().min(1).optional(),
|
|
26
|
+
license: z.string().min(1).optional(),
|
|
27
|
+
terms: termsSchema.optional(),
|
|
28
|
+
/** The credit line the supplier or artist asks for, as the credits report lists it. */
|
|
29
|
+
attribution: nonEmpty.optional(),
|
|
30
|
+
})
|
|
31
|
+
.superRefine((record, ctx) => {
|
|
32
|
+
if (record.kind === "third-party" && !record.source)
|
|
33
|
+
ctx.addIssue({
|
|
34
|
+
code: "custom",
|
|
35
|
+
path: ["source"],
|
|
36
|
+
message: "third-party origin needs its source",
|
|
37
|
+
});
|
|
38
|
+
if (record.kind !== "third-party" && record.terms !== undefined)
|
|
39
|
+
ctx.addIssue({
|
|
40
|
+
code: "custom",
|
|
41
|
+
path: ["terms"],
|
|
42
|
+
message: "only a third-party origin has a supplier's terms",
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
const PERMISSION_TEXT = {
|
|
46
|
+
commercial: "commercial use",
|
|
47
|
+
modification: "modification",
|
|
48
|
+
redistribution: "redistribution of the files",
|
|
49
|
+
reference: "use as a reference for generation",
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* The permissions in `needed` the terms of a third-party origin do not give, each with its outcome
|
|
53
|
+
* and reason; empty when they give all of it or the origin is not third-party. A third-party origin
|
|
54
|
+
* without terms states nothing. Not stated is no for redistribution and reference use, and a
|
|
55
|
+
* question for the developer for commercial use and modification (issue #683).
|
|
56
|
+
*/
|
|
57
|
+
export function termsProblems(origin, needed) {
|
|
58
|
+
if (origin === undefined || (origin.declaredKind ?? origin.kind) !== "third-party")
|
|
59
|
+
return [];
|
|
60
|
+
return needed.flatMap((permission) => {
|
|
61
|
+
const value = origin.terms?.[permission] ?? "not-stated";
|
|
62
|
+
const what = PERMISSION_TEXT[permission];
|
|
63
|
+
if (value === "yes")
|
|
64
|
+
return [];
|
|
65
|
+
const problem = (outcome, reason) => [
|
|
66
|
+
{ permission, answer: value, outcome, reason },
|
|
67
|
+
];
|
|
68
|
+
if (value === "no")
|
|
69
|
+
return problem("forbidden", `the supplier's terms forbid ${what}`);
|
|
70
|
+
return permission === "redistribution" || permission === "reference"
|
|
71
|
+
? problem("unstated-no", `the supplier's terms do not state ${what}, which counts as no`)
|
|
72
|
+
: problem("question", `the supplier's terms do not state whether they allow ${what}: read the supplier's wording and record "yes" or "no" as terms.${permission} in the origin file, then import again`);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/** The terms a person confirms with a hand-off of media from `origin`; undefined unless third-party. */
|
|
76
|
+
export function shownTerms(origin) {
|
|
77
|
+
if (origin === undefined || (origin.declaredKind ?? origin.kind) !== "third-party")
|
|
78
|
+
return undefined;
|
|
79
|
+
return {
|
|
80
|
+
source: origin.source ?? "a third party",
|
|
81
|
+
license: origin.license ?? null,
|
|
82
|
+
terms: origin.terms ?? null,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** The shown terms as one clause of a confirmation's summary. */
|
|
86
|
+
export function shownTermsText(shown) {
|
|
87
|
+
const answers = shown.terms === null
|
|
88
|
+
? "none recorded"
|
|
89
|
+
: TERMS.map((p) => `${PERMISSION_TEXT[p]} ${shown.terms[p]}`).join(", ");
|
|
90
|
+
return `supplier terms of ${shown.source}${shown.license === null ? "" : ` (${shown.license})`}: ${answers}`;
|
|
91
|
+
}
|
|
92
|
+
export const libraryOriginSchema = z.object({
|
|
93
|
+
kind: z.enum(["unknown", "ai-generated", "human-made", "third-party"]),
|
|
94
|
+
declaredKind: z.enum(["human-made", "third-party"]).optional(),
|
|
95
|
+
evidence: z.string().optional(),
|
|
96
|
+
source: z.string().optional(),
|
|
97
|
+
license: z.string().optional(),
|
|
98
|
+
terms: termsSchema.optional(),
|
|
99
|
+
attribution: z.string().optional(),
|
|
100
|
+
digitalSourceType: z
|
|
101
|
+
.custom((value) => originSourceType(value) !== undefined)
|
|
102
|
+
.optional(),
|
|
103
|
+
});
|
|
104
|
+
export function parseOrigin(value, label = "origin") {
|
|
105
|
+
const result = originSchema.safeParse(value);
|
|
106
|
+
if (!result.success)
|
|
107
|
+
throw new InputError(`invalid ${label}: ${result.error.message}`);
|
|
108
|
+
return result.data;
|
|
109
|
+
}
|
|
110
|
+
export function originOf(provenance) {
|
|
111
|
+
const digitalSourceType = provenance.digitalSourceType;
|
|
112
|
+
const ai = digitalSourceType === DIGITAL_SOURCE_TYPES.generated ||
|
|
113
|
+
digitalSourceType === DIGITAL_SOURCE_TYPES.composite;
|
|
114
|
+
const humanDeclaration = provenance.sourceDeclaration?.value === DIGITAL_SOURCE_TYPES.human;
|
|
115
|
+
return {
|
|
116
|
+
...provenance.origin,
|
|
117
|
+
...(provenance.origin !== undefined && { declaredKind: provenance.origin.kind }),
|
|
118
|
+
kind: ai
|
|
119
|
+
? "ai-generated"
|
|
120
|
+
: (provenance.origin?.kind ?? (humanDeclaration ? "human-made" : "unknown")),
|
|
121
|
+
...(provenance.origin === undefined &&
|
|
122
|
+
humanDeclaration && {
|
|
123
|
+
evidence: `Declared ${provenance.sourceDeclaration.value} by ${provenance.sourceDeclaration.declaredBy}`,
|
|
124
|
+
}),
|
|
125
|
+
...(digitalSourceType !== undefined && { digitalSourceType }),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
export function originSourceType(value) {
|
|
129
|
+
return value === "undeclared"
|
|
130
|
+
? value
|
|
131
|
+
: typeof value === "string"
|
|
132
|
+
? parseDigitalSourceType(value)
|
|
133
|
+
: undefined;
|
|
134
|
+
}
|
package/dist/paths.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { AssetSpec, TargetProfile } from "./types.ts";
|
|
2
|
+
/** `rel` as records and JSON output carry it: `/`-separated. */
|
|
3
|
+
export declare function recordPath(rel: string): string;
|
|
4
|
+
/** `path` relative to `root`, as a record path. */
|
|
5
|
+
export declare function relativeRecordPath(root: string, path: string): string;
|
|
6
|
+
/** A relative path read from a record: `/`-separated only. */
|
|
7
|
+
export declare function readRecordPath(rel: string, what?: string): string;
|
|
8
|
+
/**
|
|
9
|
+
* `name` as one file-name segment: lower-case letters, digits and hyphens, every other run of
|
|
10
|
+
* characters (`:` and `/` included) one hyphen. Core asset kinds pass unchanged; `ext:tile`
|
|
11
|
+
* becomes `ext-tile`; a name with nothing left becomes `kind`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function safeSegment(name: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* `name` as one file-name segment `windowsProblem` accepts: each character Windows refuses
|
|
16
|
+
* (`<>:"|?*`, a backslash, a control character) and `/` becomes `-`, a trailing dot or space
|
|
17
|
+
* becomes `-`, a device name gets a `_` prefix, and `""`, `.` and `..` become `artifact`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function safeFileName(name: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Refuses, before anything is written, a set of `/`-separated relative paths in which two name the
|
|
22
|
+
* same file or differ only by case, or a segment Windows cannot hold: one with `<>:"|?*`, a
|
|
23
|
+
* backslash or a control character, one ending in a dot or a space, or a device name such as `con`
|
|
24
|
+
* or `lpt1.txt`. The rules hold on every OS, so a target checked out anywhere holds every file.
|
|
25
|
+
*/
|
|
26
|
+
export declare function checkWrites(rels: readonly string[]): void;
|
|
27
|
+
/** Whether the manifest template embeds the whole provenance record as `"{{provenance}}"`. */
|
|
28
|
+
export declare function embedsProvenance(template: unknown): boolean;
|
|
29
|
+
/** The shared layout with this kind's media and optional manifest override. */
|
|
30
|
+
export declare function layoutFor(profile: TargetProfile, kind: string): TargetProfile["layout"];
|
|
31
|
+
/**
|
|
32
|
+
* Refuses a kind's layout override that renders outside the library root, naming the kind and the
|
|
33
|
+
* field. Only overridden fields are checked; the root is `library.root` or the fixed prefix of the
|
|
34
|
+
* shared `layout.media`. At profile load the default render fills `{{profile.*}}` from the
|
|
35
|
+
* profile's values and name, and every other value with a plain segment.
|
|
36
|
+
*/
|
|
37
|
+
export declare function checkKindLayoutPaths(profile: TargetProfile, kind: string, render?: (template: string) => string, targetDir?: string): void;
|
|
38
|
+
/**
|
|
39
|
+
* Refuses a profile whose layout (`media`, `manifest`, `provenance`) or manifest template names a
|
|
40
|
+
* spec value this spec does not set, as `layout.media needs spec.animationFamily`. The manifest
|
|
41
|
+
* template is checked only when the profile's hand-off lists the `manifest` preset, the one preset
|
|
42
|
+
* that renders it. A whole-string `"{{spec.x?}}"` in the manifest is optional and passes. The hand-off renders the same values, so
|
|
43
|
+
* this refusal comes before any paid call instead of as a render error at pick.
|
|
44
|
+
*/
|
|
45
|
+
export declare function checkSpecValues(profile: TargetProfile, spec: AssetSpec): void;
|
|
46
|
+
/**
|
|
47
|
+
* Refuses, before any paid call, a profile layout whose paths for this spec could never be written:
|
|
48
|
+
* `media`, `manifest` and `provenance` are rendered from the spec and the profile, with each value
|
|
49
|
+
* only known at hand-off standing in as its own name, and checked as the hand-off checks them.
|
|
50
|
+
*/
|
|
51
|
+
export declare function checkLayout(profile: TargetProfile, spec: AssetSpec): void;
|
|
52
|
+
/** Whether a relative path has a `.git` segment, in any case. */
|
|
53
|
+
export declare function inGitDir(rel: string): boolean;
|