@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,67 @@
|
|
|
1
|
+
import type { TermsProblem } from "./origin.ts";
|
|
2
|
+
import type { CallRecord, OutputGrant, Provenance, TargetProfile } from "./types.ts";
|
|
3
|
+
/**
|
|
4
|
+
* The target cannot declare an output under any licence its provider's terms allow, or a
|
|
5
|
+
* third-party origin's terms do not allow its hand-off (`terms`: each permission they do not give).
|
|
6
|
+
*/
|
|
7
|
+
export declare class LicenseError extends Error {
|
|
8
|
+
readonly terms?: TermsProblem[];
|
|
9
|
+
constructor(message: string, options?: ErrorOptions & {
|
|
10
|
+
terms?: TermsProblem[];
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
/** Why `value` is not a valid output grant; empty when it is one. */
|
|
14
|
+
export declare function grantProblems(value: unknown): string[];
|
|
15
|
+
/** Throws an InputError naming what is wrong with a grant, when it is not one. */
|
|
16
|
+
export declare function requireGrant(value: unknown, label: string): OutputGrant;
|
|
17
|
+
/**
|
|
18
|
+
* The combination of several grants; the most restrictive wins. `commercial` and `relabel` hold
|
|
19
|
+
* only when every grant allows them; `license` is the licence of the most restrictive grants
|
|
20
|
+
* (joined with ` AND ` when they differ); `plan` lists every plan, `attribution` every credit line.
|
|
21
|
+
* `exclusive` is false when any grant is non-exclusive, true when every grant says exclusive, and
|
|
22
|
+
* absent otherwise. Undefined when there is no grant.
|
|
23
|
+
*/
|
|
24
|
+
export declare function combineGrants(grants: OutputGrant[]): OutputGrant | undefined;
|
|
25
|
+
/** The distinct licences of an SPDX conjunction (`A AND B`), as a recorded expression is written. */
|
|
26
|
+
export declare function licenseComponents(license: string): string[];
|
|
27
|
+
/** The combined grant of every call that records one. */
|
|
28
|
+
export declare function grantOf(calls: CallRecord[]): OutputGrant | undefined;
|
|
29
|
+
/** The licences a target accepts beyond its own (`acceptedLicenses`); none when unset. */
|
|
30
|
+
export declare function acceptedLicenses(profile: TargetProfile): string[];
|
|
31
|
+
/**
|
|
32
|
+
* The licence an output with this grant is declared under in the target, or why it cannot be
|
|
33
|
+
* declared: the target's licence when the grant allows relabelling (or there is no grant), else
|
|
34
|
+
* the granted licence when it is commercial and the target lists it in `acceptedLicenses`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function licenseDecision(profile: TargetProfile, grant: OutputGrant | undefined): {
|
|
37
|
+
license: string;
|
|
38
|
+
} | {
|
|
39
|
+
refused: string;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* The grant and declared licence fields of a provenance made of these calls, for staging: when
|
|
43
|
+
* the target cannot take the output, `license` is the granted licence, and hand-off refuses it.
|
|
44
|
+
*/
|
|
45
|
+
export declare function licenseFields(profile: TargetProfile, calls: CallRecord[]): {
|
|
46
|
+
license: string;
|
|
47
|
+
outputGrant?: OutputGrant;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Throws a LicenseError for the first call that records no `outputGrant`, naming its route and the
|
|
51
|
+
* developer settings fields that declare the grant of its provider and model. No grant, no
|
|
52
|
+
* hand-off. A call's role is read from `operations` (core's table, or core's plus the loaded
|
|
53
|
+
* kinds' from `ExtensionRegistry.operations`), so a kind's own operation names `roles.<role>` too.
|
|
54
|
+
*/
|
|
55
|
+
export declare function requireGrants(calls: CallRecord[], operations?: Readonly<Record<string, string>>): void;
|
|
56
|
+
/**
|
|
57
|
+
* Throws a LicenseError when the provenance's third-party origin has terms that do not allow its
|
|
58
|
+
* hand-off: a game's commercial use of a modified copy, and use as a reference for generation when
|
|
59
|
+
* a call made media from it.
|
|
60
|
+
*/
|
|
61
|
+
export declare function requireOriginTerms(provenance: Provenance, operations?: Readonly<Record<string, string>>): void;
|
|
62
|
+
/**
|
|
63
|
+
* The provenance as it is handed to the target: the grant re-derived from its calls and the licence
|
|
64
|
+
* it is declared under. Throws a LicenseError when a third-party origin's terms do not allow the
|
|
65
|
+
* hand-off, when a call records no grant, or when the target cannot declare it.
|
|
66
|
+
*/
|
|
67
|
+
export declare function requireLicensable(profile: TargetProfile, provenance: Provenance, operations?: Readonly<Record<string, string>>): Provenance;
|
package/dist/license.js
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output grants: what a provider grants for an output, and which licence the output may be declared
|
|
3
|
+
* under in a target (issue #47; the field names are shared with the target's asset manifest).
|
|
4
|
+
*/
|
|
5
|
+
import { InputError } from "./errors.js";
|
|
6
|
+
import { termsProblems } from "./origin.js";
|
|
7
|
+
import { roleOf, routeFields } from "./routes.js";
|
|
8
|
+
/**
|
|
9
|
+
* The target cannot declare an output under any licence its provider's terms allow, or a
|
|
10
|
+
* third-party origin's terms do not allow its hand-off (`terms`: each permission they do not give).
|
|
11
|
+
*/
|
|
12
|
+
export class LicenseError extends Error {
|
|
13
|
+
terms;
|
|
14
|
+
constructor(message, options) {
|
|
15
|
+
super(message, options);
|
|
16
|
+
this.name = "LicenseError";
|
|
17
|
+
if (options?.terms !== undefined)
|
|
18
|
+
this.terms = options.terms;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/** Why `value` is not a valid output grant; empty when it is one. */
|
|
22
|
+
export function grantProblems(value) {
|
|
23
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
24
|
+
return ["it is not a JSON object"];
|
|
25
|
+
}
|
|
26
|
+
const grant = value;
|
|
27
|
+
const problems = [];
|
|
28
|
+
for (const key of ["license", "plan"]) {
|
|
29
|
+
if (typeof grant[key] !== "string" || !grant[key].trim()) {
|
|
30
|
+
problems.push(`${key} is not a non-empty string`);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
for (const key of ["commercial", "relabel"]) {
|
|
34
|
+
if (typeof grant[key] !== "boolean")
|
|
35
|
+
problems.push(`${key} is not true or false`);
|
|
36
|
+
}
|
|
37
|
+
if (grant["attribution"] !== undefined && typeof grant["attribution"] !== "string") {
|
|
38
|
+
problems.push("attribution is not a string");
|
|
39
|
+
}
|
|
40
|
+
if (grant["exclusive"] !== undefined && typeof grant["exclusive"] !== "boolean") {
|
|
41
|
+
problems.push("exclusive is not true or false");
|
|
42
|
+
}
|
|
43
|
+
if (grant["relabel"] === true && grant["commercial"] === false) {
|
|
44
|
+
problems.push("relabel cannot be true for a non-commercial grant");
|
|
45
|
+
}
|
|
46
|
+
return problems;
|
|
47
|
+
}
|
|
48
|
+
/** Throws an InputError naming what is wrong with a grant, when it is not one. */
|
|
49
|
+
export function requireGrant(value, label) {
|
|
50
|
+
const problems = grantProblems(value);
|
|
51
|
+
if (problems.length > 0) {
|
|
52
|
+
throw new InputError(`invalid outputGrant of ${label}: ${problems.join("; ")}`);
|
|
53
|
+
}
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
/** How restrictive a grant is: non-commercial, then attribution-only, then relabellable. */
|
|
57
|
+
function rank(grant) {
|
|
58
|
+
if (!grant.commercial)
|
|
59
|
+
return 2;
|
|
60
|
+
return grant.relabel ? 0 : 1;
|
|
61
|
+
}
|
|
62
|
+
const distinct = (values) => [...new Set(values)];
|
|
63
|
+
/**
|
|
64
|
+
* The combination of several grants; the most restrictive wins. `commercial` and `relabel` hold
|
|
65
|
+
* only when every grant allows them; `license` is the licence of the most restrictive grants
|
|
66
|
+
* (joined with ` AND ` when they differ); `plan` lists every plan, `attribution` every credit line.
|
|
67
|
+
* `exclusive` is false when any grant is non-exclusive, true when every grant says exclusive, and
|
|
68
|
+
* absent otherwise. Undefined when there is no grant.
|
|
69
|
+
*/
|
|
70
|
+
export function combineGrants(grants) {
|
|
71
|
+
if (grants.length === 0)
|
|
72
|
+
return undefined;
|
|
73
|
+
const worst = Math.max(...grants.map(rank));
|
|
74
|
+
const attribution = distinct(grants.flatMap((g) => (g.attribution ? [g.attribution] : [])));
|
|
75
|
+
const exclusive = grants.some((g) => g.exclusive === false)
|
|
76
|
+
? false
|
|
77
|
+
: grants.every((g) => g.exclusive === true)
|
|
78
|
+
? true
|
|
79
|
+
: undefined;
|
|
80
|
+
return {
|
|
81
|
+
license: distinct(grants.filter((g) => rank(g) === worst).map((g) => g.license))
|
|
82
|
+
.sort()
|
|
83
|
+
.join(" AND "),
|
|
84
|
+
plan: distinct(grants.map((g) => g.plan)).join(" + "),
|
|
85
|
+
commercial: grants.every((g) => g.commercial),
|
|
86
|
+
relabel: grants.every((g) => g.relabel),
|
|
87
|
+
...(attribution.length > 0 && { attribution: attribution.join("; ") }),
|
|
88
|
+
...(exclusive !== undefined && { exclusive }),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/** The distinct licences of an SPDX conjunction (`A AND B`), as a recorded expression is written. */
|
|
92
|
+
export function licenseComponents(license) {
|
|
93
|
+
return distinct(license.split(" AND ").map((l) => l.trim()));
|
|
94
|
+
}
|
|
95
|
+
/** The combined grant of every call that records one. */
|
|
96
|
+
export function grantOf(calls) {
|
|
97
|
+
return combineGrants(calls.flatMap((c, i) => c.outputGrant === undefined
|
|
98
|
+
? []
|
|
99
|
+
: [requireGrant(c.outputGrant, `call ${i + 1} (${c.route})`)]));
|
|
100
|
+
}
|
|
101
|
+
/** The licences a target accepts beyond its own (`acceptedLicenses`); none when unset. */
|
|
102
|
+
export function acceptedLicenses(profile) {
|
|
103
|
+
const accepted = profile.acceptedLicenses ?? [];
|
|
104
|
+
if (!Array.isArray(accepted) || accepted.some((l) => typeof l !== "string")) {
|
|
105
|
+
throw new InputError(`the target profile's acceptedLicenses must be a list of licence IDs`);
|
|
106
|
+
}
|
|
107
|
+
return accepted;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The licence an output with this grant is declared under in the target, or why it cannot be
|
|
111
|
+
* declared: the target's licence when the grant allows relabelling (or there is no grant), else
|
|
112
|
+
* the granted licence when it is commercial and the target lists it in `acceptedLicenses`.
|
|
113
|
+
*/
|
|
114
|
+
export function licenseDecision(profile, grant) {
|
|
115
|
+
if (!grant || grant.relabel)
|
|
116
|
+
return { license: profile.license };
|
|
117
|
+
const where = `${grant.license} (${grant.plan} plan)`;
|
|
118
|
+
if (!grant.commercial) {
|
|
119
|
+
return {
|
|
120
|
+
refused: `the provider's terms grant ${where} without commercial use; ` +
|
|
121
|
+
`${profile.name} cannot take it under ${profile.license} or any other licence`,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
const accepted = acceptedLicenses(profile);
|
|
125
|
+
const missing = licenseComponents(grant.license).filter((l) => !accepted.includes(l));
|
|
126
|
+
if (accepted.includes(grant.license) || missing.length === 0)
|
|
127
|
+
return { license: grant.license };
|
|
128
|
+
return {
|
|
129
|
+
refused: `the provider's terms grant ${where}` +
|
|
130
|
+
`${grant.attribution ? `, which requires the credit "${grant.attribution}"` : ""}` +
|
|
131
|
+
`, not ownership; ${profile.name} would relabel it as ${profile.license}. ` +
|
|
132
|
+
`List ${missing.map((l) => `"${l}"`).join(" and ")} in the target profile's acceptedLicenses to accept it on purpose`,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The grant and declared licence fields of a provenance made of these calls, for staging: when
|
|
137
|
+
* the target cannot take the output, `license` is the granted licence, and hand-off refuses it.
|
|
138
|
+
*/
|
|
139
|
+
export function licenseFields(profile, calls) {
|
|
140
|
+
const outputGrant = grantOf(calls);
|
|
141
|
+
const decision = licenseDecision(profile, outputGrant);
|
|
142
|
+
return {
|
|
143
|
+
license: "license" in decision ? decision.license : outputGrant.license,
|
|
144
|
+
...(outputGrant && { outputGrant }),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Throws a LicenseError for the first call that records no `outputGrant`, naming its route and the
|
|
149
|
+
* developer settings fields that declare the grant of its provider and model. No grant, no
|
|
150
|
+
* hand-off. A call's role is read from `operations` (core's table, or core's plus the loaded
|
|
151
|
+
* kinds' from `ExtensionRegistry.operations`), so a kind's own operation names `roles.<role>` too.
|
|
152
|
+
*/
|
|
153
|
+
export function requireGrants(calls, operations) {
|
|
154
|
+
calls.forEach((call, index) => {
|
|
155
|
+
if (call.outputGrant !== undefined)
|
|
156
|
+
return;
|
|
157
|
+
const fields = routeFields(call.operation, operations)
|
|
158
|
+
.map((f) => `${f}.outputGrant`)
|
|
159
|
+
.join(" or ");
|
|
160
|
+
throw new LicenseError(`refused hand-off: call ${index + 1} (route ${call.route}) records no outputGrant, so nothing says its output may be handed to a game; declare the grant its provider's terms give for that provider and model in the developer settings (${fields})`);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* The roles whose calls read media and make none. A call of any other role, or of an operation no
|
|
165
|
+
* table names, counts as generating from the media.
|
|
166
|
+
*/
|
|
167
|
+
const READING_ROLES = new Set(["vision", "decisions", "planning", "embeddings"]);
|
|
168
|
+
/**
|
|
169
|
+
* Throws a LicenseError when the provenance's third-party origin has terms that do not allow its
|
|
170
|
+
* hand-off: a game's commercial use of a modified copy, and use as a reference for generation when
|
|
171
|
+
* a call made media from it.
|
|
172
|
+
*/
|
|
173
|
+
export function requireOriginTerms(provenance, operations) {
|
|
174
|
+
const calls = Array.isArray(provenance.calls) ? provenance.calls : [];
|
|
175
|
+
const generated = calls.some((call) => {
|
|
176
|
+
const role = roleOf(call.operation, operations);
|
|
177
|
+
return role === undefined || !READING_ROLES.has(role);
|
|
178
|
+
});
|
|
179
|
+
const needed = [
|
|
180
|
+
"commercial",
|
|
181
|
+
"modification",
|
|
182
|
+
...(generated ? ["reference"] : []),
|
|
183
|
+
];
|
|
184
|
+
const problems = termsProblems(provenance.origin, needed);
|
|
185
|
+
if (problems.length > 0) {
|
|
186
|
+
throw new LicenseError(`refused hand-off: the media comes from ${provenance.origin?.source ?? "a third party"}, and ${problems.map((p) => p.reason).join("; ")}`, { terms: problems });
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* The provenance as it is handed to the target: the grant re-derived from its calls and the licence
|
|
191
|
+
* it is declared under. Throws a LicenseError when a third-party origin's terms do not allow the
|
|
192
|
+
* hand-off, when a call records no grant, or when the target cannot declare it.
|
|
193
|
+
*/
|
|
194
|
+
export function requireLicensable(profile, provenance, operations) {
|
|
195
|
+
requireOriginTerms(provenance, operations);
|
|
196
|
+
const calls = Array.isArray(provenance.calls) ? provenance.calls : [];
|
|
197
|
+
requireGrants(calls, operations);
|
|
198
|
+
const outputGrant = grantOf(calls);
|
|
199
|
+
const decision = licenseDecision(profile, outputGrant);
|
|
200
|
+
if ("refused" in decision)
|
|
201
|
+
throw new LicenseError(`refused hand-off: ${decision.refused}`);
|
|
202
|
+
const { outputGrant: _stale, ...rest } = provenance;
|
|
203
|
+
void _stale;
|
|
204
|
+
return { ...rest, license: decision.license, ...(outputGrant && { outputGrant }) };
|
|
205
|
+
}
|
package/dist/limits.d.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider limits (design section 3): the provider's own limit on a key is the hard one, so a paid
|
|
3
|
+
* call to a provider with no declared limit is refused before any spend, and `spend check`
|
|
4
|
+
* compares each declared limit with what the provider reports.
|
|
5
|
+
*/
|
|
6
|
+
import type { Billing, CallKind, GenerationProvider, LimitReading } from "./gateway/provider.ts";
|
|
7
|
+
/** A spend refusal at the provider limit: `provider_limit_undeclared` or `provider_limit_mismatch`. */
|
|
8
|
+
export declare class ProviderLimitError extends Error {
|
|
9
|
+
readonly code: "provider_limit_undeclared" | "provider_limit_mismatch";
|
|
10
|
+
readonly provider: string;
|
|
11
|
+
constructor(code: "provider_limit_undeclared" | "provider_limit_mismatch", provider: string, message: string);
|
|
12
|
+
}
|
|
13
|
+
/** The billing of every adapter a provider calls through: its parts, or itself. */
|
|
14
|
+
export declare function billingParts(provider: GenerationProvider): readonly Billing[];
|
|
15
|
+
/** The billing a call of this kind is charged to. */
|
|
16
|
+
export declare function billingOf(provider: GenerationProvider, kind: CallKind): Billing;
|
|
17
|
+
/**
|
|
18
|
+
* Throws `provider_limit_undeclared` (exit 3) when a paid provider has no declared limit, or
|
|
19
|
+
* declares `unlimited` without `acceptUnlimited`. A free provider needs none.
|
|
20
|
+
*/
|
|
21
|
+
export declare function assertLimitDeclared(billing: Billing): void;
|
|
22
|
+
/** Every paid part of a provider declares a limit; see `assertLimitDeclared`. */
|
|
23
|
+
export declare function assertLimitsDeclared(provider: GenerationProvider): void;
|
|
24
|
+
/** One provider's limit as `spend check` reports it. */
|
|
25
|
+
export interface LimitCheck {
|
|
26
|
+
provider: string;
|
|
27
|
+
adapter: string;
|
|
28
|
+
paid: boolean;
|
|
29
|
+
declared: boolean;
|
|
30
|
+
limit: Billing["limit"] | null;
|
|
31
|
+
/** True when a reading confirms the declared limit. */
|
|
32
|
+
verified: boolean;
|
|
33
|
+
/** What the provider reported; null when it offers no reading or none was taken. */
|
|
34
|
+
reading: LimitReading | null;
|
|
35
|
+
/** Why the limit is not verified, or why the reading failed. */
|
|
36
|
+
note?: string;
|
|
37
|
+
/** True when the reading contradicts the declared limit. */
|
|
38
|
+
mismatch: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Compares a declared limit with a reading. A balance verifies only a `prepaid` limit with `usd`:
|
|
42
|
+
* the provider can spend no more than its balance, so a balance at or under the declared amount
|
|
43
|
+
* confirms it and one above contradicts it. Other kinds cannot be confirmed by a balance.
|
|
44
|
+
*/
|
|
45
|
+
export declare function compareReading(limit: Billing["limit"], reading: LimitReading): {
|
|
46
|
+
verified: boolean;
|
|
47
|
+
mismatch: boolean;
|
|
48
|
+
note?: string;
|
|
49
|
+
};
|
|
50
|
+
/** Checks one provider's declared limit against its reading, when it offers one. */
|
|
51
|
+
export declare function checkLimit(billing: Billing): Promise<LimitCheck>;
|
package/dist/limits.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { redact } from "./redact.js";
|
|
2
|
+
/** A spend refusal at the provider limit: `provider_limit_undeclared` or `provider_limit_mismatch`. */
|
|
3
|
+
export class ProviderLimitError extends Error {
|
|
4
|
+
code;
|
|
5
|
+
provider;
|
|
6
|
+
constructor(code, provider, message) {
|
|
7
|
+
super(redact(message));
|
|
8
|
+
this.name = "ProviderLimitError";
|
|
9
|
+
this.code = code;
|
|
10
|
+
this.provider = provider;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** The billing of every adapter a provider calls through: its parts, or itself. */
|
|
14
|
+
export function billingParts(provider) {
|
|
15
|
+
const parts = provider.parts;
|
|
16
|
+
return parts ?? [provider.billing];
|
|
17
|
+
}
|
|
18
|
+
/** The billing a call of this kind is charged to. */
|
|
19
|
+
export function billingOf(provider, kind) {
|
|
20
|
+
return provider.billingFor?.(kind) ?? provider.billing;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Throws `provider_limit_undeclared` (exit 3) when a paid provider has no declared limit, or
|
|
24
|
+
* declares `unlimited` without `acceptUnlimited`. A free provider needs none.
|
|
25
|
+
*/
|
|
26
|
+
export function assertLimitDeclared(billing) {
|
|
27
|
+
if (!billing.paid)
|
|
28
|
+
return;
|
|
29
|
+
const limit = billing.limit;
|
|
30
|
+
if (limit === undefined) {
|
|
31
|
+
throw new ProviderLimitError("provider_limit_undeclared", billing.providerId, `refused: provider "${billing.providerId}" (${billing.adapter}) is paid and declares no limit; set providers.${billing.providerId}.limit in the developer settings to the limit its key carries at the provider`);
|
|
32
|
+
}
|
|
33
|
+
if (limit.kind === "unlimited" && limit.acceptUnlimited !== true) {
|
|
34
|
+
throw new ProviderLimitError("provider_limit_undeclared", billing.providerId, `refused: provider "${billing.providerId}" declares an unlimited key without acceptUnlimited: true`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** Every paid part of a provider declares a limit; see `assertLimitDeclared`. */
|
|
38
|
+
export function assertLimitsDeclared(provider) {
|
|
39
|
+
for (const billing of billingParts(provider))
|
|
40
|
+
assertLimitDeclared(billing);
|
|
41
|
+
}
|
|
42
|
+
const EPSILON = 1e-9;
|
|
43
|
+
/**
|
|
44
|
+
* Compares a declared limit with a reading. A balance verifies only a `prepaid` limit with `usd`:
|
|
45
|
+
* the provider can spend no more than its balance, so a balance at or under the declared amount
|
|
46
|
+
* confirms it and one above contradicts it. Other kinds cannot be confirmed by a balance.
|
|
47
|
+
*/
|
|
48
|
+
export function compareReading(limit, reading) {
|
|
49
|
+
if (limit === undefined)
|
|
50
|
+
return { verified: false, mismatch: false, note: "no limit declared" };
|
|
51
|
+
if (reading.balanceUsd === undefined)
|
|
52
|
+
return { verified: false, mismatch: false, note: "the reading has no USD balance" };
|
|
53
|
+
if (limit.kind !== "prepaid" || limit.usd === undefined)
|
|
54
|
+
return {
|
|
55
|
+
verified: false,
|
|
56
|
+
mismatch: false,
|
|
57
|
+
note: `a balance cannot confirm a ${limit.kind} limit`,
|
|
58
|
+
};
|
|
59
|
+
if (reading.balanceUsd > limit.usd + EPSILON)
|
|
60
|
+
return {
|
|
61
|
+
verified: false,
|
|
62
|
+
mismatch: true,
|
|
63
|
+
note: `the provider reports a $${reading.balanceUsd.toFixed(2)} balance, above the declared $${limit.usd.toFixed(2)} prepaid limit`,
|
|
64
|
+
};
|
|
65
|
+
return { verified: true, mismatch: false };
|
|
66
|
+
}
|
|
67
|
+
/** Checks one provider's declared limit against its reading, when it offers one. */
|
|
68
|
+
export async function checkLimit(billing) {
|
|
69
|
+
const base = {
|
|
70
|
+
provider: billing.providerId,
|
|
71
|
+
adapter: billing.adapter,
|
|
72
|
+
paid: billing.paid,
|
|
73
|
+
declared: billing.limit !== undefined,
|
|
74
|
+
limit: billing.limit ?? null,
|
|
75
|
+
};
|
|
76
|
+
if (billing.readLimit === undefined) {
|
|
77
|
+
return {
|
|
78
|
+
...base,
|
|
79
|
+
verified: false,
|
|
80
|
+
reading: null,
|
|
81
|
+
mismatch: false,
|
|
82
|
+
note: "the provider offers no reading to an ordinary key; declared only",
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
let reading;
|
|
86
|
+
try {
|
|
87
|
+
reading = await billing.readLimit();
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
return {
|
|
91
|
+
...base,
|
|
92
|
+
verified: false,
|
|
93
|
+
reading: null,
|
|
94
|
+
mismatch: false,
|
|
95
|
+
note: `reading failed: ${redact(error instanceof Error ? error.message : String(error))}`,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const compared = compareReading(billing.limit, reading);
|
|
99
|
+
return { ...base, reading, ...compared };
|
|
100
|
+
}
|
package/dist/loop.d.ts
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import type { BudgetKey } from "./model3d/profile.ts";
|
|
2
|
+
import type { PromptPolicyRecord } from "./policy/text.ts";
|
|
3
|
+
import type { CapSource } from "./budget.ts";
|
|
4
|
+
import type { SpendLedger } from "./spend.ts";
|
|
5
|
+
import type { IdentityAgreement, IdentityRecordCheck } from "./identity.ts";
|
|
6
|
+
import type { FilteringState, StabilityEntry } from "./qa/stability.ts";
|
|
7
|
+
import type { GenerationProvider } from "./gateway/provider.ts";
|
|
8
|
+
import type { Generator, PlannedCall } from "./generators/generator.ts";
|
|
9
|
+
import type { Routes } from "./routes.ts";
|
|
10
|
+
import type { CandidateSummary } from "./library/summary.ts";
|
|
11
|
+
import type { AssetSpec, Provenance, Reason, StyleBible, TargetProfile } from "./types.ts";
|
|
12
|
+
export declare const DEFAULT_CANDIDATES = 4;
|
|
13
|
+
export declare const DEFAULT_CAP_USD = 5;
|
|
14
|
+
export interface StageOptions {
|
|
15
|
+
spec: AssetSpec;
|
|
16
|
+
specDir: string;
|
|
17
|
+
bible: StyleBible;
|
|
18
|
+
bibleDir: string;
|
|
19
|
+
profile: TargetProfile;
|
|
20
|
+
/** Directory the profile's relative paths resolve against (the profile file's directory). */
|
|
21
|
+
profileDir?: string;
|
|
22
|
+
routes: Routes;
|
|
23
|
+
/** The provider set of the settings, or one provider that serves every route. */
|
|
24
|
+
provider: GenerationProvider;
|
|
25
|
+
/** One provider's settings id, recorded in each call's route; a set records each route's own. */
|
|
26
|
+
providerName?: string;
|
|
27
|
+
/** The cross-run spend ledger every paid call also reserves against (src/spend.ts). */
|
|
28
|
+
ledger?: SpendLedger;
|
|
29
|
+
/** The asset kinds of the registry (src/extensions/registry.ts): core's and the extensions'. */
|
|
30
|
+
generators: Generator[];
|
|
31
|
+
/**
|
|
32
|
+
* Directory runs are staged under; each run gets `<runsDir>/<runId>/`. The stage command gives
|
|
33
|
+
* the run id of its request digest, `r-<16 hex>` (src/runs/dir.ts).
|
|
34
|
+
*/
|
|
35
|
+
runsDir: string;
|
|
36
|
+
candidates?: number;
|
|
37
|
+
capUsd?: number;
|
|
38
|
+
runId?: string;
|
|
39
|
+
now?: () => Date;
|
|
40
|
+
/** Receives one line per candidate outcome and one when the run stops early. */
|
|
41
|
+
log?: (message: string) => void;
|
|
42
|
+
/** The plan step's prompt-policy record, kept in the run record and each candidate's provenance. */
|
|
43
|
+
promptPolicy?: PromptPolicyRecord;
|
|
44
|
+
/** The author's note of this round, appended to each candidate's generation prompt. */
|
|
45
|
+
note?: string;
|
|
46
|
+
/**
|
|
47
|
+
* The measured stability entries model-backed checks filter by; src/qa/stability.json by default.
|
|
48
|
+
* The kinds' own entries are added to them.
|
|
49
|
+
*/
|
|
50
|
+
stability?: readonly StabilityEntry[];
|
|
51
|
+
/** The settings' state directory; judged reference views are cached under it. */
|
|
52
|
+
stateDir?: string;
|
|
53
|
+
}
|
|
54
|
+
/** What a stage run would call and cost, computed without spending anything. */
|
|
55
|
+
export interface StagePlan {
|
|
56
|
+
kind: string;
|
|
57
|
+
requested: number;
|
|
58
|
+
capUsd: number;
|
|
59
|
+
/** The calls one candidate makes. */
|
|
60
|
+
perCandidate: PlannedCall[];
|
|
61
|
+
/** The calls the request makes once (a 3D character's reference view calls). */
|
|
62
|
+
perRequest: PlannedCall[];
|
|
63
|
+
/** Calls across all candidates and the request's own. */
|
|
64
|
+
calls: number;
|
|
65
|
+
estimateUsd: number;
|
|
66
|
+
/** Whether the estimate fits the cap; a forecast over the cap is reported, not thrown. */
|
|
67
|
+
withinCap: boolean;
|
|
68
|
+
/** The budget a 3D candidate is generated and checked against. */
|
|
69
|
+
budget?: {
|
|
70
|
+
limits: Record<BudgetKey, number>;
|
|
71
|
+
tier?: string;
|
|
72
|
+
tierClass?: string;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export declare function planStage(options: {
|
|
76
|
+
spec: AssetSpec;
|
|
77
|
+
profile: TargetProfile;
|
|
78
|
+
routes: Routes;
|
|
79
|
+
generators: Generator[];
|
|
80
|
+
candidates?: number;
|
|
81
|
+
capUsd?: number;
|
|
82
|
+
/** The style bible; with it, the request's own calls are forecast too. */
|
|
83
|
+
bible?: StyleBible;
|
|
84
|
+
}): StagePlan;
|
|
85
|
+
/** A candidate that passed QA, as staged for the author. */
|
|
86
|
+
export interface StagedCandidate {
|
|
87
|
+
id: string;
|
|
88
|
+
/** File name inside the run directory. */
|
|
89
|
+
file: string;
|
|
90
|
+
mediaType: string;
|
|
91
|
+
extension: string;
|
|
92
|
+
sha256: string;
|
|
93
|
+
/** Why it passed: one reason per check. */
|
|
94
|
+
reasons: Reason[];
|
|
95
|
+
fields: Record<string, unknown>;
|
|
96
|
+
provenance: Provenance;
|
|
97
|
+
/** The model-written summary its QA call gave, and the operation and model that wrote it. */
|
|
98
|
+
summary?: CandidateSummary;
|
|
99
|
+
/** Files written for the person beside the candidate (turntable renders), relative to the run. */
|
|
100
|
+
artifacts?: string[];
|
|
101
|
+
/**
|
|
102
|
+
* Artifacts whose name the generator returned could not be written as given (path rules,
|
|
103
|
+
* design section 14): the file written and the name returned.
|
|
104
|
+
*/
|
|
105
|
+
artifactNames?: Array<{
|
|
106
|
+
file: string;
|
|
107
|
+
original: string;
|
|
108
|
+
}>;
|
|
109
|
+
/** Files that go into the target beside the media (textures, groom maps), each a template field. */
|
|
110
|
+
sidecars?: Array<{
|
|
111
|
+
/** Path relative to the run directory. */
|
|
112
|
+
file: string;
|
|
113
|
+
/** File name written beside the media, no directory parts. */
|
|
114
|
+
name: string;
|
|
115
|
+
mediaType: string;
|
|
116
|
+
sha256: string;
|
|
117
|
+
/** Dotted path under `output` where `{ path, sha256 }` is exposed to the templates. */
|
|
118
|
+
field: string;
|
|
119
|
+
/** Merged into the `{ path, sha256 }` object. */
|
|
120
|
+
extra?: Record<string, unknown>;
|
|
121
|
+
}>;
|
|
122
|
+
}
|
|
123
|
+
export interface RunRecord {
|
|
124
|
+
runId: string;
|
|
125
|
+
/** The run directory this record is in (`<runs>/r-<16 hex>/` for a planned request). */
|
|
126
|
+
runDir?: string;
|
|
127
|
+
/** The prompt policy's check of the request's prompt text (planned runs). */
|
|
128
|
+
promptPolicy?: PromptPolicyRecord;
|
|
129
|
+
/** The person's confirmation of the request's spend (design section 7), when it needed one. */
|
|
130
|
+
confirmation?: import("./types.ts").ConfirmationRecord;
|
|
131
|
+
/**
|
|
132
|
+
* Set by request_change: the asset id, the sha256 of the version the candidates were made on,
|
|
133
|
+
* and the ids of the editing annotations they answer (design section 3.4).
|
|
134
|
+
*/
|
|
135
|
+
changeRequest?: {
|
|
136
|
+
asset: string;
|
|
137
|
+
version: string;
|
|
138
|
+
answers: string[];
|
|
139
|
+
};
|
|
140
|
+
createdAt: string;
|
|
141
|
+
spec: AssetSpec;
|
|
142
|
+
/** Absolute directory the spec's relative paths resolved against. */
|
|
143
|
+
specDir: string;
|
|
144
|
+
profile: TargetProfile;
|
|
145
|
+
/**
|
|
146
|
+
* Absolute directory the profile's relative paths resolved against, when known: `lod` on the
|
|
147
|
+
* staged run reads the rig template from it for the `rig-template` check.
|
|
148
|
+
*/
|
|
149
|
+
profileDir?: string;
|
|
150
|
+
bibleVersion: string;
|
|
151
|
+
capUsd: number;
|
|
152
|
+
/** Where the cap came from (planned runs): the settings, the run options, `--cap` or the command. */
|
|
153
|
+
capSource?: CapSource;
|
|
154
|
+
estimateUsd: number;
|
|
155
|
+
spentUsd: number;
|
|
156
|
+
requested: number;
|
|
157
|
+
/** Only candidates that passed QA. Failing candidates are never staged or shown. */
|
|
158
|
+
candidates: StagedCandidate[];
|
|
159
|
+
/** How many candidates were filtered out by QA or failed to generate. */
|
|
160
|
+
filtered: number;
|
|
161
|
+
/** Messages of candidates that failed to generate (no media is kept for them). */
|
|
162
|
+
errors: string[];
|
|
163
|
+
/** Why each filtered candidate was filtered (planned runs); `candidate` is the 1-based number. */
|
|
164
|
+
rejections?: Array<{
|
|
165
|
+
candidate: number;
|
|
166
|
+
reasons: Reason[];
|
|
167
|
+
/** What the candidate cost (staged runs). */
|
|
168
|
+
costUsd?: number;
|
|
169
|
+
/** Files written for the person (turntable renders), relative to the run. */
|
|
170
|
+
artifacts?: string[];
|
|
171
|
+
/**
|
|
172
|
+
* Artifacts whose name the generator returned could not be written as given (path rules,
|
|
173
|
+
* design section 14): the file written and the name returned.
|
|
174
|
+
*/
|
|
175
|
+
artifactNames?: Array<{
|
|
176
|
+
file: string;
|
|
177
|
+
original: string;
|
|
178
|
+
}>;
|
|
179
|
+
/**
|
|
180
|
+
* The candidate id, `c<n>`. This and the five fields below are kept only for a `character-3d`
|
|
181
|
+
* candidate generated and filtered by QA, so `rig` can re-rig it (docs/characters-3d.md).
|
|
182
|
+
*/
|
|
183
|
+
id?: string;
|
|
184
|
+
/** The model's file name inside the run directory. */
|
|
185
|
+
file?: string;
|
|
186
|
+
/** The model's media type. */
|
|
187
|
+
mediaType?: string;
|
|
188
|
+
/** The model's file extension. */
|
|
189
|
+
extension?: string;
|
|
190
|
+
/** The model file's SHA-256. */
|
|
191
|
+
sha256?: string;
|
|
192
|
+
/** How the model was made, as a staged candidate records it. */
|
|
193
|
+
provenance?: Provenance;
|
|
194
|
+
}>;
|
|
195
|
+
/**
|
|
196
|
+
* The identity lock check of a planned run: which lock version scored the candidates, the mode
|
|
197
|
+
* and threshold, and how often the identity verdict agreed with the QA verdict (the shadow-mode
|
|
198
|
+
* measurement). Absent when the character has no lock or scoring was off.
|
|
199
|
+
*/
|
|
200
|
+
identity?: {
|
|
201
|
+
subject: string;
|
|
202
|
+
lockVersion: string;
|
|
203
|
+
lockSha256: string;
|
|
204
|
+
mode: "shadow" | "enforce";
|
|
205
|
+
threshold: number;
|
|
206
|
+
agreement: IdentityAgreement;
|
|
207
|
+
/** How many candidates were scored; an unscored candidate is not counted here or in `agreement`. */
|
|
208
|
+
scores: number;
|
|
209
|
+
/** How many candidates' scoring calls failed, so they were kept unscored; absent when none. */
|
|
210
|
+
unscored?: number;
|
|
211
|
+
/** Enforce mode: the record's own check, run once before the first paid generation. */
|
|
212
|
+
recordCheck?: IdentityRecordCheck;
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Whether each model-backed check filtered: `filtering` only where it is measured stable on the
|
|
216
|
+
* run's model (src/qa/stability.json, or the kind's own entries); otherwise `advisory`, its
|
|
217
|
+
* reasons marked `shadow`, with the cause. A check neither its kind nor core declares is `advisory`
|
|
218
|
+
* with cause `undeclared`. Absent when no model-backed or undeclared check ran.
|
|
219
|
+
*/
|
|
220
|
+
filtering?: FilteringState[];
|
|
221
|
+
/** The numbered contact sheet in the run directory (`contact.png`), when a candidate has an image. */
|
|
222
|
+
contactSheet?: string;
|
|
223
|
+
/** Why candidate generation stopped early, when it did (for example the cost cap). */
|
|
224
|
+
stopped?: string;
|
|
225
|
+
picked?: {
|
|
226
|
+
candidateId: string;
|
|
227
|
+
at: string;
|
|
228
|
+
target: string;
|
|
229
|
+
files: string[];
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
export declare const RUN_FILE = "run.json";
|
|
233
|
+
/**
|
|
234
|
+
* Stages a run: reserves the whole run's estimate against the cap (refusing before any provider
|
|
235
|
+
* call when it does not fit), generates candidates, keeps only the ones that pass QA, and writes
|
|
236
|
+
* them with their reasons and provenance to the run directory for the author to pick from.
|
|
237
|
+
*/
|
|
238
|
+
export declare function stage(options: StageOptions): Promise<{
|
|
239
|
+
run: RunRecord;
|
|
240
|
+
runDir: string;
|
|
241
|
+
}>;
|
|
242
|
+
export declare function writeRun(runDir: string, run: RunRecord): Promise<void>;
|
|
243
|
+
export declare function readRun(runDir: string): Promise<RunRecord>;
|
|
244
|
+
export { readJson } from "./json.ts";
|