@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,298 @@
|
|
|
1
|
+
import { ProviderError } from "../errors.js";
|
|
2
|
+
import { failureFacts, isQuotaRefusal, providerFailure } from "./failure.js";
|
|
3
|
+
/** The gateway's fixed endpoint, at the gateway SDK's own path. */
|
|
4
|
+
const GATEWAY_BASE_URL = "https://ai-gateway.vercel.sh/v4/ai";
|
|
5
|
+
function toNumber(value) {
|
|
6
|
+
const n = typeof value === "string" && value.trim() !== "" ? Number(value) : value;
|
|
7
|
+
return typeof n === "number" && Number.isFinite(n) ? n : undefined;
|
|
8
|
+
}
|
|
9
|
+
function gatewayMeta(metadata) {
|
|
10
|
+
return metadata?.["gateway"] ?? {};
|
|
11
|
+
}
|
|
12
|
+
function requestId(...candidates) {
|
|
13
|
+
for (const c of candidates) {
|
|
14
|
+
if (typeof c === "string" && c !== "")
|
|
15
|
+
return { requestId: c, requestIdSource: "provider" };
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
requestId: `local-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`,
|
|
19
|
+
requestIdSource: "local",
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** The back-off before each resend of a rate-limited decision call. */
|
|
23
|
+
const RATE_LIMIT_BACKOFF_MS = [2000, 4000, 8000, 16000];
|
|
24
|
+
/**
|
|
25
|
+
* Decision providers rate-limit tightly (#27): a call refused with HTTP 429 did no work, so it is
|
|
26
|
+
* sent again after a back-off. Any other failure may have been billed and is never resent here:
|
|
27
|
+
* the run's resume is its retry, under a reservation of its own. A quota 429 is not resent.
|
|
28
|
+
*/
|
|
29
|
+
async function retryRateLimited(call) {
|
|
30
|
+
for (let attempt = 0;; attempt++) {
|
|
31
|
+
try {
|
|
32
|
+
return await call();
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
const facts = failureFacts(error);
|
|
36
|
+
const delay = RATE_LIMIT_BACKOFF_MS[attempt];
|
|
37
|
+
if (delay === undefined || facts.status !== 429 || isQuotaRefusal(facts))
|
|
38
|
+
throw error;
|
|
39
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The Vercel AI Gateway adapter, the only place that touches the `ai` SDK.
|
|
45
|
+
*
|
|
46
|
+
* Request ID, in order of preference: the gateway generation ID from provider metadata, the
|
|
47
|
+
* `x-vercel-id` response header (images) or the response ID (vision), else a generated
|
|
48
|
+
* `local-<timestamp>-<random>` with `requestIdSource: "local"`, so provenance always has one and
|
|
49
|
+
* never passes it off as the provider's. Cost is the gateway's reported
|
|
50
|
+
* `cost` (USD) from provider metadata, left unset when the gateway does not report one.
|
|
51
|
+
*/
|
|
52
|
+
export class VercelGateway {
|
|
53
|
+
billing;
|
|
54
|
+
#apiKey;
|
|
55
|
+
#baseURL;
|
|
56
|
+
#gateway;
|
|
57
|
+
#keyEnv;
|
|
58
|
+
/**
|
|
59
|
+
* `apiKey` and `baseURL` are always passed to the SDK, so no `*_BASE_URL` or key variable of the
|
|
60
|
+
* environment ever applies. Without a key every call fails with a provider error naming
|
|
61
|
+
* `keyEnv`.
|
|
62
|
+
*/
|
|
63
|
+
constructor(options) {
|
|
64
|
+
const baseURL = options.baseURL ?? GATEWAY_BASE_URL;
|
|
65
|
+
this.#keyEnv = options.keyEnv ?? "AI_GATEWAY_API_KEY";
|
|
66
|
+
this.#apiKey = options.apiKey !== "" ? options.apiKey : undefined;
|
|
67
|
+
this.#baseURL = baseURL;
|
|
68
|
+
this.billing = {
|
|
69
|
+
adapter: "vercel-ai-gateway",
|
|
70
|
+
providerId: "vercel-ai-gateway",
|
|
71
|
+
paid: true,
|
|
72
|
+
settle: "reported",
|
|
73
|
+
reconcile: "lookup",
|
|
74
|
+
...options.billing,
|
|
75
|
+
hosts: [new URL(baseURL).host],
|
|
76
|
+
readLimit: () => this.credits(),
|
|
77
|
+
callCost: (requestId) => this.generationCost(requestId),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/** The base URL the SDK is given when settings name none. */
|
|
81
|
+
static defaultBaseURL = GATEWAY_BASE_URL;
|
|
82
|
+
/**
|
|
83
|
+
* The `ai` SDK and the gateway client. The SDK is imported on first use, so a process that never
|
|
84
|
+
* calls the gateway never loads it.
|
|
85
|
+
*/
|
|
86
|
+
async #client(label) {
|
|
87
|
+
if (this.#apiKey === undefined)
|
|
88
|
+
throw new ProviderError(`gateway ${label}: ${this.#keyEnv} is not set; the gateway key must come from the environment`);
|
|
89
|
+
const ai = await import("ai");
|
|
90
|
+
this.#gateway ??= ai.createGateway({ apiKey: this.#apiKey, baseURL: this.#baseURL });
|
|
91
|
+
return { gateway: this.#gateway, ai };
|
|
92
|
+
}
|
|
93
|
+
async #guard(label, call) {
|
|
94
|
+
const { gateway, ai } = await this.#client(label);
|
|
95
|
+
try {
|
|
96
|
+
return await call(gateway, ai);
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
throw providerFailure("gateway", label, error);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** The gateway's credit balance, in USD; spends nothing. */
|
|
103
|
+
async credits() {
|
|
104
|
+
const credits = await this.#guard("credits", (g) => g.getCredits());
|
|
105
|
+
const balanceUsd = toNumber(credits.balance);
|
|
106
|
+
if (balanceUsd === undefined)
|
|
107
|
+
throw new ProviderError("gateway credits: no balance returned");
|
|
108
|
+
return { balanceUsd, source: "gateway credits" };
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The gateway's own cost of one generation (`getGenerationInfo`, `totalCost` in USD); spends
|
|
112
|
+
* nothing. Undefined while the answer may still come: the gateway does not know the generation
|
|
113
|
+
* yet (404), is busy or failing (429, 5xx, no response), or this process has no key to ask with.
|
|
114
|
+
* Null when it never will: an ID that is not a generation ID (a response header or a local ID),
|
|
115
|
+
* a request the gateway rejects (400, 401, 403), or an answer with no numeric cost.
|
|
116
|
+
*/
|
|
117
|
+
async generationCost(requestId) {
|
|
118
|
+
if (!requestId.startsWith("gen_"))
|
|
119
|
+
return null;
|
|
120
|
+
if (this.#apiKey === undefined)
|
|
121
|
+
return undefined;
|
|
122
|
+
const { gateway } = await this.#client("generation");
|
|
123
|
+
let info;
|
|
124
|
+
try {
|
|
125
|
+
info = await gateway.getGenerationInfo({ id: requestId });
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
const status = error.statusCode;
|
|
129
|
+
return status === 400 || status === 401 || status === 403 ? null : undefined;
|
|
130
|
+
}
|
|
131
|
+
return toNumber(info.totalCost) ?? null;
|
|
132
|
+
}
|
|
133
|
+
async generateImage(req) {
|
|
134
|
+
const result = await this.#guard("image", (gateway, ai) => ai.generateImage({
|
|
135
|
+
model: gateway.imageModel(req.model),
|
|
136
|
+
// One request per reservation: an SDK retry would resend a paid call.
|
|
137
|
+
maxRetries: 0,
|
|
138
|
+
prompt: req.references.length === 0
|
|
139
|
+
? req.prompt
|
|
140
|
+
: { text: req.prompt, images: req.references.map((r) => r.bytes) },
|
|
141
|
+
...(req.size !== undefined && { size: req.size }),
|
|
142
|
+
...(req.seed !== undefined && { seed: req.seed }),
|
|
143
|
+
...(req.providerOptions !== undefined && {
|
|
144
|
+
providerOptions: req.providerOptions,
|
|
145
|
+
}),
|
|
146
|
+
}));
|
|
147
|
+
const meta = result.providerMetadata;
|
|
148
|
+
const gw = gatewayMeta(meta);
|
|
149
|
+
const seed = toNumber(gw["seed"]) ??
|
|
150
|
+
Object.values(meta ?? {})
|
|
151
|
+
.map((entry) => toNumber(entry?.["seed"]))
|
|
152
|
+
.find((s) => s !== undefined);
|
|
153
|
+
const cost = toNumber(gw["cost"]);
|
|
154
|
+
return {
|
|
155
|
+
images: result.images.map((i) => ({ mediaType: i.mediaType, bytes: i.uint8Array })),
|
|
156
|
+
...requestId(gw["generationId"], result.responses[0]?.headers?.["x-vercel-id"]),
|
|
157
|
+
...(cost !== undefined && { costUsd: cost }),
|
|
158
|
+
...(seed !== undefined && { seed }),
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
async analyzeImages(req) {
|
|
162
|
+
const result = await this.#guard("vision", (gateway, ai) => ai.generateText({
|
|
163
|
+
model: gateway.languageModel(req.model),
|
|
164
|
+
maxRetries: 0,
|
|
165
|
+
messages: [
|
|
166
|
+
{
|
|
167
|
+
role: "user",
|
|
168
|
+
content: [
|
|
169
|
+
{ type: "text", text: req.prompt },
|
|
170
|
+
...req.images.map((i) => ({
|
|
171
|
+
type: "image",
|
|
172
|
+
image: i.bytes,
|
|
173
|
+
mediaType: i.mediaType,
|
|
174
|
+
})),
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
...(req.providerOptions !== undefined && {
|
|
179
|
+
providerOptions: req.providerOptions,
|
|
180
|
+
}),
|
|
181
|
+
}));
|
|
182
|
+
const gw = gatewayMeta(result.providerMetadata);
|
|
183
|
+
const cost = toNumber(gw["cost"]);
|
|
184
|
+
return {
|
|
185
|
+
text: result.text,
|
|
186
|
+
...requestId(gw["generationId"], result.response.id),
|
|
187
|
+
...(cost !== undefined && { costUsd: cost }),
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* A typed decision through the gateway's decision models. The question is always asked under
|
|
192
|
+
* the ID `answer`. Confidence is the provider's own statistic from provider metadata
|
|
193
|
+
* (Perplexity and TypeSafe report one per question), when it reports one.
|
|
194
|
+
*/
|
|
195
|
+
async decide(req) {
|
|
196
|
+
const q = req.question;
|
|
197
|
+
const question = q.type === "score"
|
|
198
|
+
? { type: "score", instructions: q.instructions, criteria: q.levels }
|
|
199
|
+
: q.type === "choice"
|
|
200
|
+
? { type: "choice", instructions: q.instructions, criteria: q.options }
|
|
201
|
+
: {
|
|
202
|
+
type: "boolean",
|
|
203
|
+
instructions: q.instructions,
|
|
204
|
+
criteria: {
|
|
205
|
+
...(q.whenTrue !== undefined && { true: q.whenTrue }),
|
|
206
|
+
...(q.whenFalse !== undefined && { false: q.whenFalse }),
|
|
207
|
+
},
|
|
208
|
+
};
|
|
209
|
+
const result = await this.#guard("decide", (gateway, ai) => retryRateLimited(() => ai.experimental_decide({
|
|
210
|
+
model: gateway.decisionModel(req.model),
|
|
211
|
+
state: [
|
|
212
|
+
{ type: "text", text: req.prompt },
|
|
213
|
+
...req.images.map((i) => ({
|
|
214
|
+
type: "file",
|
|
215
|
+
mediaType: i.mediaType,
|
|
216
|
+
data: i.bytes,
|
|
217
|
+
})),
|
|
218
|
+
],
|
|
219
|
+
questions: { answer: question },
|
|
220
|
+
maxRetries: 0,
|
|
221
|
+
})));
|
|
222
|
+
const raw = result.answers.answer;
|
|
223
|
+
const answer = raw.type === "score"
|
|
224
|
+
? {
|
|
225
|
+
type: "score",
|
|
226
|
+
score: raw.score,
|
|
227
|
+
...(raw.probabilities !== undefined && { probabilities: raw.probabilities }),
|
|
228
|
+
}
|
|
229
|
+
: raw.type === "choice"
|
|
230
|
+
? {
|
|
231
|
+
type: "choice",
|
|
232
|
+
choice: raw.choice,
|
|
233
|
+
...(raw.probabilities !== undefined && { probabilities: raw.probabilities }),
|
|
234
|
+
}
|
|
235
|
+
: { type: "boolean", probability: raw.probability };
|
|
236
|
+
const meta = result.providerMetadata;
|
|
237
|
+
const confidence = Object.values(meta ?? {})
|
|
238
|
+
.map((entry) => {
|
|
239
|
+
const c = entry?.["confidence"];
|
|
240
|
+
return toNumber(c !== null && typeof c === "object" ? c["answer"] : c);
|
|
241
|
+
})
|
|
242
|
+
.find((c) => c !== undefined);
|
|
243
|
+
const cost = toNumber(gatewayMeta(meta)["cost"]);
|
|
244
|
+
return {
|
|
245
|
+
answer,
|
|
246
|
+
decisionSource: "decision-model",
|
|
247
|
+
...requestId(gatewayMeta(meta)["generationId"], result.response.id),
|
|
248
|
+
...(cost !== undefined && { costUsd: cost }),
|
|
249
|
+
...(confidence !== undefined && { confidence }),
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* One embedding through the gateway's embedding models, at the requested width. The SDK's
|
|
254
|
+
* `embed` takes text; an image goes to a Google multimodal model (`google/gemini-embedding-2`)
|
|
255
|
+
* as the Google provider's `content` option, inline, with an empty value. Another vendor's model
|
|
256
|
+
* is refused an image, since its gateway embeddings take text only.
|
|
257
|
+
*/
|
|
258
|
+
async embed(req) {
|
|
259
|
+
const image = "image" in req.input ? req.input.image : undefined;
|
|
260
|
+
if (image !== undefined && !req.model.startsWith("google/"))
|
|
261
|
+
throw new ProviderError(`gateway embed: ${req.model} embeds text only through the gateway; route the embeddings role to a model that embeds images and text in one space, such as google/gemini-embedding-2`);
|
|
262
|
+
const own = req.providerOptions ?? {};
|
|
263
|
+
const providerOptions = image === undefined
|
|
264
|
+
? own
|
|
265
|
+
: {
|
|
266
|
+
...own,
|
|
267
|
+
google: {
|
|
268
|
+
...own["google"],
|
|
269
|
+
content: [
|
|
270
|
+
[
|
|
271
|
+
{
|
|
272
|
+
inlineData: {
|
|
273
|
+
mimeType: image.mediaType,
|
|
274
|
+
data: Buffer.from(image.bytes).toString("base64"),
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
],
|
|
278
|
+
],
|
|
279
|
+
},
|
|
280
|
+
};
|
|
281
|
+
const result = await this.#guard("embed", (gateway, ai) => ai.embed({
|
|
282
|
+
model: gateway.embeddingModel(req.model),
|
|
283
|
+
value: "text" in req.input ? req.input.text : "",
|
|
284
|
+
dimensions: req.dimensions,
|
|
285
|
+
maxRetries: 0,
|
|
286
|
+
...(Object.keys(providerOptions).length > 0 && {
|
|
287
|
+
providerOptions: providerOptions,
|
|
288
|
+
}),
|
|
289
|
+
}));
|
|
290
|
+
const gw = gatewayMeta(result.providerMetadata);
|
|
291
|
+
const cost = toNumber(gw["cost"]);
|
|
292
|
+
return {
|
|
293
|
+
vector: result.embedding,
|
|
294
|
+
...requestId(gw["generationId"]),
|
|
295
|
+
...(cost !== undefined && { costUsd: cost }),
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import type { ZodType } from "zod";
|
|
2
|
+
import type { Caller } from "../calls.ts";
|
|
3
|
+
import type { CallParameters } from "../call-parameters.ts";
|
|
4
|
+
import type { ReferenceViewCache } from "../model3d/views.ts";
|
|
5
|
+
import type { ClipMapCache } from "../model3d/clip-map.ts";
|
|
6
|
+
import type { FramesTrait } from "../frames.ts";
|
|
7
|
+
import type { AudioContext, MediaTrait } from "../media.ts";
|
|
8
|
+
import type { StabilityEntry } from "../qa/stability.ts";
|
|
9
|
+
import type { Routes } from "../routes.ts";
|
|
10
|
+
import type { TransformStep } from "../transform/types.ts";
|
|
11
|
+
import type { CardSummary } from "../library/summary.ts";
|
|
12
|
+
import type { AssetSpec, MediaOutput, QaResult, Reason, StyleBible, TargetProfile } from "../types.ts";
|
|
13
|
+
/**
|
|
14
|
+
* A generator turns one asset spec into one candidate: its model calls, post-processing and QA.
|
|
15
|
+
* A new media type is a new generator registered with the loop; the loop itself does not change.
|
|
16
|
+
*/
|
|
17
|
+
export interface GeneratorContext {
|
|
18
|
+
spec: AssetSpec;
|
|
19
|
+
/** Directory the spec's relative paths (such as `keyPose`) resolve against. */
|
|
20
|
+
specDir: string;
|
|
21
|
+
bible: StyleBible;
|
|
22
|
+
/** Directory the bible's relative paths resolve against. */
|
|
23
|
+
bibleDir: string;
|
|
24
|
+
profile: TargetProfile;
|
|
25
|
+
/** Every provider call goes through this; it reserves against the cap and records provenance. */
|
|
26
|
+
call: Caller;
|
|
27
|
+
/** Zero-based candidate number within the run. */
|
|
28
|
+
index: number;
|
|
29
|
+
/** A per-candidate seed, sent to models whose route supports seeds. */
|
|
30
|
+
seed: number;
|
|
31
|
+
/** The author's note of this round, appended to the generation prompts. */
|
|
32
|
+
note?: string;
|
|
33
|
+
/** Directory the profile's relative paths (a rig template, reference frames) resolve against. */
|
|
34
|
+
profileDir?: string;
|
|
35
|
+
/** The run's cache of which view each reference image shows, shared by its candidates. */
|
|
36
|
+
referenceViews?: ReferenceViewCache;
|
|
37
|
+
/** The run's cache of clip-map decisions, shared by its candidates. */
|
|
38
|
+
clipMaps?: ClipMapCache;
|
|
39
|
+
/**
|
|
40
|
+
* The stability entries the run's model-backed checks are judged by (the kind's QA registry);
|
|
41
|
+
* src/qa/stability.json when absent. A kind reads it where a qualified decision changes what it
|
|
42
|
+
* makes, as `prop-3d`'s facing does.
|
|
43
|
+
*/
|
|
44
|
+
stability?: readonly StabilityEntry[];
|
|
45
|
+
}
|
|
46
|
+
export interface GeneratedCandidate {
|
|
47
|
+
output: MediaOutput;
|
|
48
|
+
qa: QaResult;
|
|
49
|
+
/** The prompt that defines the candidate (for animation, the key-pose prompt). */
|
|
50
|
+
prompt: string;
|
|
51
|
+
parameters: Record<string, unknown>;
|
|
52
|
+
/**
|
|
53
|
+
* The transformation steps that made the output, recorded in the candidate's provenance before
|
|
54
|
+
* the metadata step.
|
|
55
|
+
*/
|
|
56
|
+
steps?: TransformStep[];
|
|
57
|
+
/**
|
|
58
|
+
* Files written for the person beside the candidate, such as a 3D model's turntable renders,
|
|
59
|
+
* whether or not it passes QA. Written to `<run>/c<n>-<generator kind as a slug>/` (`safeSegment`:
|
|
60
|
+
* `ext:tile` writes to `c1-ext-tile/`).
|
|
61
|
+
*/
|
|
62
|
+
artifacts?: Array<{
|
|
63
|
+
name: string;
|
|
64
|
+
bytes: Uint8Array;
|
|
65
|
+
}>;
|
|
66
|
+
/** The model-written summary of the candidate, when its QA call gave one. */
|
|
67
|
+
summary?: CardSummary;
|
|
68
|
+
}
|
|
69
|
+
/** One model call a candidate makes, as forecast from the routes. */
|
|
70
|
+
export interface PlannedCall {
|
|
71
|
+
operation: string;
|
|
72
|
+
model: string;
|
|
73
|
+
estimatedCostUsd: number;
|
|
74
|
+
/**
|
|
75
|
+
* The typed parameters the call will pass (src/call-parameters.ts), so they enter the request
|
|
76
|
+
* digest; absent when it passes none.
|
|
77
|
+
*/
|
|
78
|
+
parameters?: CallParameters;
|
|
79
|
+
}
|
|
80
|
+
/** What a kind's QA check reads: the candidate's media and what it was made for. */
|
|
81
|
+
export interface KindCheckInput {
|
|
82
|
+
spec: AssetSpec;
|
|
83
|
+
profile: TargetProfile;
|
|
84
|
+
bible: StyleBible;
|
|
85
|
+
output: MediaOutput;
|
|
86
|
+
/** An `audio` kind's candidate, decoded: its PCM per channel, sample rate and channel layout. */
|
|
87
|
+
audio?: AudioContext;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* One QA check a kind declares (design section 11). Every check a kind's reasons name, from
|
|
91
|
+
* `generate` or from a check's `run`, is declared here: core judges each reason by its
|
|
92
|
+
* declaration, and a reason neither its kind nor core declares is advisory (`cause: "undeclared"`)
|
|
93
|
+
* and never filters.
|
|
94
|
+
*
|
|
95
|
+
* - `exact`: deterministic and free. With `run`, core runs it under a `Caller` that refuses every
|
|
96
|
+
* call, and the conformance suite runs it twice and fails it when it calls or answers
|
|
97
|
+
* differently. Its reasons filter.
|
|
98
|
+
* - `model`: a model's answer decides it. With
|
|
99
|
+
* `run`, it may call a model through the candidate's `Caller`; its calls belong in the kind's
|
|
100
|
+
* `planCandidate`. Its reasons filter only with a qualifying stability entry (core's
|
|
101
|
+
* src/qa/stability.json, or the kind's own `stability`) for its name, its version and the model
|
|
102
|
+
* its `operation`'s route resolves to on the run; otherwise they are advisory.
|
|
103
|
+
* - `gated`: core's kinds only: a model decision core gates by its own rule (a 3D character's
|
|
104
|
+
* facing, the identity lock). A pack declaring it is refused at load.
|
|
105
|
+
*/
|
|
106
|
+
export interface KindCheck {
|
|
107
|
+
/**
|
|
108
|
+
* The `check` its reasons carry. A name ending in `*` declares a family: every check whose name
|
|
109
|
+
* starts with what precedes the `*` (`clip-*` covers `clip-walk`).
|
|
110
|
+
*/
|
|
111
|
+
name: string;
|
|
112
|
+
mode: "exact" | "model" | "gated";
|
|
113
|
+
/** Bumped when what the check asks or measures changes; a stability entry holds for one. "1" when absent. */
|
|
114
|
+
version?: string;
|
|
115
|
+
/** The `source` of the reasons it covers; absent: every source. */
|
|
116
|
+
source?: Reason["source"];
|
|
117
|
+
/** A `model` check: the operation whose route's model answers it. Without one it never filters. */
|
|
118
|
+
operation?: string;
|
|
119
|
+
/** Runs the check on a candidate. Absent: a declaration only; the kind's `generate` returns its reasons. */
|
|
120
|
+
run?(input: KindCheckInput, call: Caller): Promise<Reason[]> | Reason[];
|
|
121
|
+
}
|
|
122
|
+
/** A file made elsewhere that `import --spec` hands a kind, as given. */
|
|
123
|
+
export interface KindImportInput {
|
|
124
|
+
spec: AssetSpec;
|
|
125
|
+
profile: TargetProfile;
|
|
126
|
+
/** The file's bytes, which the kind may read but must return unaltered as the output's. */
|
|
127
|
+
bytes: Uint8Array;
|
|
128
|
+
/** Sniffed from the bytes. */
|
|
129
|
+
mediaType: string;
|
|
130
|
+
/** The file name's extension, lower-case and without the dot. */
|
|
131
|
+
extension: string;
|
|
132
|
+
/**
|
|
133
|
+
* The project's tile kinds, from the label vocabulary's `tileKinds`, else the default set. The
|
|
134
|
+
* vocabulary is read when this is called, so a kind calls it only when it needs the kinds.
|
|
135
|
+
*/
|
|
136
|
+
tileKinds(): readonly string[];
|
|
137
|
+
}
|
|
138
|
+
/** What a kind proposes from an imported file, once it imports cleanly by the spec. */
|
|
139
|
+
export interface KindProposeInput extends KindImportInput {
|
|
140
|
+
/** The output the file imported as. */
|
|
141
|
+
output: MediaOutput;
|
|
142
|
+
}
|
|
143
|
+
/** What a kind read from a file (spec fields), and why a person must confirm it. */
|
|
144
|
+
export interface KindRead {
|
|
145
|
+
read: Record<string, unknown>;
|
|
146
|
+
reason: string;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* What a kind makes of an imported file: the output (the file's own bytes and media type, with the
|
|
150
|
+
* kind's fields) and the parameters provenance records; or, when the spec leaves out what the kind
|
|
151
|
+
* can read from the file, what it read (`read`, spec fields) and why a person must confirm it.
|
|
152
|
+
*/
|
|
153
|
+
export type KindImport = {
|
|
154
|
+
output: MediaOutput;
|
|
155
|
+
parameters: Record<string, unknown>;
|
|
156
|
+
} | KindRead;
|
|
157
|
+
export interface Generator {
|
|
158
|
+
/** The `kind` of asset spec this generator handles. */
|
|
159
|
+
kind: string;
|
|
160
|
+
/**
|
|
161
|
+
* What the kind's output is: `image`, `model` or `audio` (src/media.ts). Core's raster features
|
|
162
|
+
* (the contact sheet, the frames trait, plan, apply, vary) ask it, and an `audio` kind's checks
|
|
163
|
+
* get the decoded WAV as `KindCheckInput.audio`. Absent: `image`.
|
|
164
|
+
*/
|
|
165
|
+
media?: MediaTrait;
|
|
166
|
+
/**
|
|
167
|
+
* How the kind's output is cut into frames. A `strip` kind's output carries core's frame layout
|
|
168
|
+
* as `output.fields.frames` (`FrameLayout`, src/frames.ts), which core checks after `generate`,
|
|
169
|
+
* and gets core's frame features: plan/apply, contact-sheet key frames, strip thumbnails and
|
|
170
|
+
* staleness, the atlas presets. `single`: one image. Absent: the kind has no frames. Only an
|
|
171
|
+
* `image` kind declares one.
|
|
172
|
+
*/
|
|
173
|
+
frames?: FramesTrait;
|
|
174
|
+
/**
|
|
175
|
+
* The calls one candidate makes, from the routes; their estimates are reserved before the run
|
|
176
|
+
* starts. Throws `InputError` for a spec that cannot be generated, before any spend.
|
|
177
|
+
*/
|
|
178
|
+
planCandidate(spec: AssetSpec, profile: TargetProfile, routes: Routes): PlannedCall[];
|
|
179
|
+
/**
|
|
180
|
+
* The calls a request makes once, whatever its candidate count (a 3D character's reference
|
|
181
|
+
* view calls); forecast with the candidates' calls. Absent: none.
|
|
182
|
+
*/
|
|
183
|
+
planRequest?(spec: AssetSpec, profile: TargetProfile, routes: Routes, bible: StyleBible): PlannedCall[];
|
|
184
|
+
generate(context: GeneratorContext): Promise<GeneratedCandidate>;
|
|
185
|
+
/**
|
|
186
|
+
* Takes in a file made elsewhere (a bought or hand-drawn sheet) as this kind's output, its bytes
|
|
187
|
+
* untouched: `import --spec` calls it, runs the kind's exact checks on the output and stages it as
|
|
188
|
+
* a run's one candidate. Makes no call. Throws `InputError` for a spec or file it cannot take.
|
|
189
|
+
* Absent: the kind is generated only.
|
|
190
|
+
*/
|
|
191
|
+
importMedia?(input: KindImportInput): KindImport;
|
|
192
|
+
/**
|
|
193
|
+
* The calls `proposeImport` makes, reserved before it runs. Absent: the kind proposes nothing
|
|
194
|
+
* from an imported file.
|
|
195
|
+
*/
|
|
196
|
+
planProposal?(spec: AssetSpec, profile: TargetProfile, routes: Routes): PlannedCall[];
|
|
197
|
+
/**
|
|
198
|
+
* What a model proposes from an imported file (a tile sheet's cell labels), for a person to
|
|
199
|
+
* confirm by stating it in the spec. `import --spec --propose-labels` calls it once the file
|
|
200
|
+
* imports cleanly by the spec; it stages nothing.
|
|
201
|
+
*/
|
|
202
|
+
proposeImport?(input: KindProposeInput, call: Caller): Promise<KindRead>;
|
|
203
|
+
/**
|
|
204
|
+
* The QA checks the kind declares: every check its reasons name. Core runs those with a `run` on
|
|
205
|
+
* each candidate after `generate`. Absent: none, so every reason the kind returns is undeclared.
|
|
206
|
+
*/
|
|
207
|
+
checks?: KindCheck[];
|
|
208
|
+
/**
|
|
209
|
+
* Measured stability entries for the kind's `model` checks (src/qa/stability.ts), each with
|
|
210
|
+
* `measuredBy` and the sha256 of its labelled set; core validates them when the kind loads.
|
|
211
|
+
*/
|
|
212
|
+
stability?: StabilityEntry[];
|
|
213
|
+
/**
|
|
214
|
+
* The operations the kind calls, each with a role of core's role table (`ROLE_CAPABILITY` in
|
|
215
|
+
* src/routes.ts). A pack's are `<pack name>:<op>`; core's kinds name core operations. Core
|
|
216
|
+
* routes each like a core operation: `routes.<op>`, then `roles.<role>`, then the role's default.
|
|
217
|
+
*/
|
|
218
|
+
operations?: Readonly<Record<string, string>>;
|
|
219
|
+
/**
|
|
220
|
+
* Validates every spec of this kind (the whole spec object); an invalid one is refused before
|
|
221
|
+
* any spend, naming the field. It may not declare a routing field (an endpoint, model, provider,
|
|
222
|
+
* provider options, graph or command): model, tier and price stay on the route in settings.
|
|
223
|
+
*/
|
|
224
|
+
specSchema?: ZodType;
|
|
225
|
+
/**
|
|
226
|
+
* Validates the target profile's `kinds.<kind>` block, without its `values`. Without one the
|
|
227
|
+
* block accepts only `values`. The same routing fields are refused.
|
|
228
|
+
*/
|
|
229
|
+
profileSchema?: ZodType;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* The reasons of a kind's checks on one candidate: each `exact` check under a `RefusingCaller`
|
|
233
|
+
* (`exactCaller`), every other one under the candidate's `call`. A declaration without `run` runs
|
|
234
|
+
* nothing.
|
|
235
|
+
*/
|
|
236
|
+
export declare function runKindChecks(checks: readonly KindCheck[], input: KindCheckInput, call: Caller, exactCaller: () => Caller): Promise<Reason[]>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The reasons of a kind's checks on one candidate: each `exact` check under a `RefusingCaller`
|
|
3
|
+
* (`exactCaller`), every other one under the candidate's `call`. A declaration without `run` runs
|
|
4
|
+
* nothing.
|
|
5
|
+
*/
|
|
6
|
+
export async function runKindChecks(checks, input, call, exactCaller) {
|
|
7
|
+
const reasons = [];
|
|
8
|
+
for (const check of checks)
|
|
9
|
+
if (check.run !== undefined)
|
|
10
|
+
reasons.push(...(await check.run(input, check.mode === "exact" ? exactCaller() : call)));
|
|
11
|
+
return reasons;
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Raster } from "../image/raster.ts";
|
|
2
|
+
import type { Caller } from "../calls.ts";
|
|
3
|
+
import type { DecisionQuestion } from "../gateway/provider.ts";
|
|
4
|
+
import type { Reason } from "../types.ts";
|
|
5
|
+
import type { Generator } from "./generator.ts";
|
|
6
|
+
/** The question stage's `cutout` decision asks of each candidate. */
|
|
7
|
+
export declare const CUTOUT_QUESTION: DecisionQuestion;
|
|
8
|
+
/**
|
|
9
|
+
* One `cutout` decision on a candidate: given its source (frames side by side) and its cut-out
|
|
10
|
+
* over a contrasting colour, whether background removal cut part of the subject away or left
|
|
11
|
+
* background attached. A yes is a failing `cutout` reason.
|
|
12
|
+
*/
|
|
13
|
+
export declare function judgeCutout(call: Caller, options: {
|
|
14
|
+
subject: string;
|
|
15
|
+
frames: readonly Raster[];
|
|
16
|
+
cutout: Raster;
|
|
17
|
+
}): Promise<Reason>;
|
|
18
|
+
/** A still image: one text-and-reference generation, post-processed to a single frame. */
|
|
19
|
+
export declare const stillGenerator: Generator;
|
|
20
|
+
export declare const spriteStripGenerator: Generator;
|
|
21
|
+
export declare const imageGenerators: Generator[];
|