@clockgrove/assetgrove 0.0.0-stage → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +277 -2
- package/dist/animation/commands.d.ts +180 -0
- package/dist/animation/commands.js +515 -0
- package/dist/animation/facing.d.ts +44 -0
- package/dist/animation/facing.js +100 -0
- package/dist/animation/fix.d.ts +136 -0
- package/dist/animation/fix.js +529 -0
- package/dist/animation/flicker.d.ts +44 -0
- package/dist/animation/flicker.js +117 -0
- package/dist/animation/halo.d.ts +72 -0
- package/dist/animation/halo.js +253 -0
- package/dist/animation/holes.d.ts +122 -0
- package/dist/animation/holes.js +262 -0
- package/dist/animation/preview.d.ts +38 -0
- package/dist/animation/preview.js +161 -0
- package/dist/animation/qa.d.ts +57 -0
- package/dist/animation/qa.js +418 -0
- package/dist/animation/run.d.ts +109 -0
- package/dist/animation/run.js +182 -0
- package/dist/animation/strip.d.ts +13 -0
- package/dist/animation/strip.js +41 -0
- package/dist/animation/template-choice.d.ts +75 -0
- package/dist/animation/template-choice.js +153 -0
- package/dist/animation/templates.d.ts +39 -0
- package/dist/animation/templates.js +333 -0
- package/dist/animation/types.d.ts +257 -0
- package/dist/animation/types.js +1 -0
- package/dist/approvals.d.ts +156 -0
- package/dist/approvals.js +369 -0
- package/dist/audio/aac.d.ts +61 -0
- package/dist/audio/aac.js +152 -0
- package/dist/audio/checks.d.ts +38 -0
- package/dist/audio/checks.js +254 -0
- package/dist/audio/delivery.d.ts +52 -0
- package/dist/audio/delivery.js +105 -0
- package/dist/audio/engine.d.ts +65 -0
- package/dist/audio/engine.js +164 -0
- package/dist/audio/handoff.d.ts +75 -0
- package/dist/audio/handoff.js +185 -0
- package/dist/audio/kinds.d.ts +6 -0
- package/dist/audio/kinds.js +315 -0
- package/dist/audio/loudness.d.ts +22 -0
- package/dist/audio/loudness.js +72 -0
- package/dist/audio/ogg.d.ts +27 -0
- package/dist/audio/ogg.js +65 -0
- package/dist/audio/operations.d.ts +20 -0
- package/dist/audio/operations.js +335 -0
- package/dist/audio/opus.d.ts +40 -0
- package/dist/audio/opus.js +108 -0
- package/dist/audio/profile.d.ts +200 -0
- package/dist/audio/profile.js +126 -0
- package/dist/audio/run.d.ts +83 -0
- package/dist/audio/run.js +192 -0
- package/dist/audio/vorbis-comments.d.ts +25 -0
- package/dist/audio/vorbis-comments.js +243 -0
- package/dist/audio/waveform.d.ts +13 -0
- package/dist/audio/waveform.js +52 -0
- package/dist/audio-parameters.d.ts +17 -0
- package/dist/audio-parameters.js +45 -0
- package/dist/audit/bar.d.ts +65 -0
- package/dist/audit/bar.js +97 -0
- package/dist/audit/members.d.ts +40 -0
- package/dist/audit/members.js +119 -0
- package/dist/bible-view.d.ts +10 -0
- package/dist/bible-view.js +122 -0
- package/dist/bible.d.ts +272 -0
- package/dist/bible.js +641 -0
- package/dist/budget.d.ts +119 -0
- package/dist/budget.js +227 -0
- package/dist/call-parameters.d.ts +71 -0
- package/dist/call-parameters.js +90 -0
- package/dist/calls.d.ts +145 -0
- package/dist/calls.js +788 -0
- package/dist/cli/main.d.ts +22 -0
- package/dist/cli/main.js +137 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +5 -0
- package/dist/commands/animation-qa.d.ts +1 -0
- package/dist/commands/animation-qa.js +240 -0
- package/dist/commands/apply.d.ts +12 -0
- package/dist/commands/apply.js +181 -0
- package/dist/commands/audit.d.ts +92 -0
- package/dist/commands/audit.js +555 -0
- package/dist/commands/bible.d.ts +1 -0
- package/dist/commands/bible.js +39 -0
- package/dist/commands/browse.d.ts +12 -0
- package/dist/commands/browse.js +113 -0
- package/dist/commands/card.d.ts +3 -0
- package/dist/commands/card.js +445 -0
- package/dist/commands/compare.d.ts +1 -0
- package/dist/commands/compare.js +90 -0
- package/dist/commands/confirm.d.ts +1 -0
- package/dist/commands/confirm.js +267 -0
- package/dist/commands/context.d.ts +43 -0
- package/dist/commands/context.js +115 -0
- package/dist/commands/deliver.d.ts +1 -0
- package/dist/commands/deliver.js +99 -0
- package/dist/commands/disclosure.d.ts +1 -0
- package/dist/commands/disclosure.js +80 -0
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/commands/doctor.js +112 -0
- package/dist/commands/estimate.d.ts +2 -0
- package/dist/commands/estimate.js +80 -0
- package/dist/commands/extensions.d.ts +2 -0
- package/dist/commands/extensions.js +70 -0
- package/dist/commands/fix-frame.d.ts +1 -0
- package/dist/commands/fix-frame.js +206 -0
- package/dist/commands/generate-sheet.d.ts +1 -0
- package/dist/commands/generate-sheet.js +245 -0
- package/dist/commands/identity-check.d.ts +1 -0
- package/dist/commands/identity-check.js +110 -0
- package/dist/commands/identity-eval.d.ts +1 -0
- package/dist/commands/identity-eval.js +197 -0
- package/dist/commands/import.d.ts +7 -0
- package/dist/commands/import.js +472 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +117 -0
- package/dist/commands/intake.d.ts +1 -0
- package/dist/commands/intake.js +56 -0
- package/dist/commands/labels.d.ts +1 -0
- package/dist/commands/labels.js +101 -0
- package/dist/commands/library.d.ts +9 -0
- package/dist/commands/library.js +711 -0
- package/dist/commands/lod.d.ts +1 -0
- package/dist/commands/lod.js +93 -0
- package/dist/commands/look-dev.d.ts +1 -0
- package/dist/commands/look-dev.js +148 -0
- package/dist/commands/materials.d.ts +1 -0
- package/dist/commands/materials.js +223 -0
- package/dist/commands/mcp.d.ts +1 -0
- package/dist/commands/mcp.js +53 -0
- package/dist/commands/migrate.d.ts +1 -0
- package/dist/commands/migrate.js +123 -0
- package/dist/commands/op.d.ts +5 -0
- package/dist/commands/op.js +114 -0
- package/dist/commands/ops.d.ts +1 -0
- package/dist/commands/ops.js +17 -0
- package/dist/commands/pick-batch.d.ts +24 -0
- package/dist/commands/pick-batch.js +343 -0
- package/dist/commands/pick.d.ts +48 -0
- package/dist/commands/pick.js +469 -0
- package/dist/commands/plan.d.ts +3 -0
- package/dist/commands/plan.js +156 -0
- package/dist/commands/recipe.d.ts +1 -0
- package/dist/commands/recipe.js +52 -0
- package/dist/commands/registry.d.ts +5 -0
- package/dist/commands/registry.js +121 -0
- package/dist/commands/render-sprite.d.ts +1 -0
- package/dist/commands/render-sprite.js +67 -0
- package/dist/commands/rendition.d.ts +1 -0
- package/dist/commands/rendition.js +56 -0
- package/dist/commands/request-change.d.ts +2 -0
- package/dist/commands/request-change.js +950 -0
- package/dist/commands/result.d.ts +34 -0
- package/dist/commands/result.js +237 -0
- package/dist/commands/review.d.ts +28 -0
- package/dist/commands/review.js +444 -0
- package/dist/commands/rig.d.ts +1 -0
- package/dist/commands/rig.js +74 -0
- package/dist/commands/runner.d.ts +45 -0
- package/dist/commands/runner.js +297 -0
- package/dist/commands/runs.d.ts +22 -0
- package/dist/commands/runs.js +159 -0
- package/dist/commands/search.d.ts +69 -0
- package/dist/commands/search.js +638 -0
- package/dist/commands/settings.d.ts +2 -0
- package/dist/commands/settings.js +284 -0
- package/dist/commands/spend.d.ts +2 -0
- package/dist/commands/spend.js +159 -0
- package/dist/commands/stage-source.d.ts +1 -0
- package/dist/commands/stage-source.js +58 -0
- package/dist/commands/stage.d.ts +9 -0
- package/dist/commands/stage.js +229 -0
- package/dist/commands/storage.d.ts +3 -0
- package/dist/commands/storage.js +200 -0
- package/dist/commands/turnaround.d.ts +1 -0
- package/dist/commands/turnaround.js +171 -0
- package/dist/commands/types.d.ts +195 -0
- package/dist/commands/types.js +7 -0
- package/dist/commands/vary.d.ts +2 -0
- package/dist/commands/vary.js +222 -0
- package/dist/commands/write-families.d.ts +14 -0
- package/dist/commands/write-families.js +158 -0
- package/dist/compare.d.ts +87 -0
- package/dist/compare.js +306 -0
- package/dist/confirm/delegation.d.ts +30 -0
- package/dist/confirm/delegation.js +31 -0
- package/dist/confirm/index.d.ts +84 -0
- package/dist/confirm/index.js +176 -0
- package/dist/confirm/mcp.d.ts +60 -0
- package/dist/confirm/mcp.js +253 -0
- package/dist/confirm/pending.d.ts +11 -0
- package/dist/confirm/pending.js +40 -0
- package/dist/confirm/prompt.d.ts +65 -0
- package/dist/confirm/prompt.js +68 -0
- package/dist/confirm/records.d.ts +17 -0
- package/dist/confirm/records.js +63 -0
- package/dist/contact.d.ts +80 -0
- package/dist/contact.js +224 -0
- package/dist/credentials.d.ts +170 -0
- package/dist/credentials.js +598 -0
- package/dist/dataflows.d.ts +32 -0
- package/dist/dataflows.js +42 -0
- package/dist/delivery.d.ts +89 -0
- package/dist/delivery.js +355 -0
- package/dist/disclosure.d.ts +84 -0
- package/dist/disclosure.js +397 -0
- package/dist/env.d.ts +90 -0
- package/dist/env.js +236 -0
- package/dist/errors.d.ts +90 -0
- package/dist/errors.js +105 -0
- package/dist/extension/api.d.ts +389 -0
- package/dist/extension/api.js +20 -0
- package/dist/extension/context.d.ts +9 -0
- package/dist/extension/context.js +60 -0
- package/dist/extension/helpers.d.ts +75 -0
- package/dist/extension/helpers.js +107 -0
- package/dist/extension/http.d.ts +32 -0
- package/dist/extension/http.js +104 -0
- package/dist/extension/setup.d.ts +53 -0
- package/dist/extension/setup.js +162 -0
- package/dist/extension/tools.d.ts +97 -0
- package/dist/extension/tools.js +235 -0
- package/dist/extensions/core.d.ts +7 -0
- package/dist/extensions/core.js +18 -0
- package/dist/extensions/errors.d.ts +22 -0
- package/dist/extensions/errors.js +34 -0
- package/dist/extensions/registry.d.ts +119 -0
- package/dist/extensions/registry.js +535 -0
- package/dist/extensions/version.d.ts +9 -0
- package/dist/extensions/version.js +57 -0
- package/dist/formats.d.ts +46 -0
- package/dist/formats.js +81 -0
- package/dist/frames.d.ts +58 -0
- package/dist/frames.js +80 -0
- package/dist/gateway/anthropic.d.ts +22 -0
- package/dist/gateway/anthropic.js +65 -0
- package/dist/gateway/elevenlabs.d.ts +36 -0
- package/dist/gateway/elevenlabs.js +192 -0
- package/dist/gateway/failure.d.ts +29 -0
- package/dist/gateway/failure.js +70 -0
- package/dist/gateway/openai-compatible.d.ts +20 -0
- package/dist/gateway/openai-compatible.js +76 -0
- package/dist/gateway/openai.d.ts +28 -0
- package/dist/gateway/openai.js +101 -0
- package/dist/gateway/provider.d.ts +380 -0
- package/dist/gateway/provider.js +5 -0
- package/dist/gateway/scripted.d.ts +252 -0
- package/dist/gateway/scripted.js +244 -0
- package/dist/gateway/stability.d.ts +38 -0
- package/dist/gateway/stability.js +232 -0
- package/dist/gateway/structured.d.ts +31 -0
- package/dist/gateway/structured.js +83 -0
- package/dist/gateway/tripo.d.ts +48 -0
- package/dist/gateway/tripo.js +374 -0
- package/dist/gateway/vercel.d.ts +52 -0
- package/dist/gateway/vercel.js +298 -0
- package/dist/generators/generator.d.ts +236 -0
- package/dist/generators/generator.js +12 -0
- package/dist/generators/image.d.ts +21 -0
- package/dist/generators/image.js +286 -0
- package/dist/generators/spec-schema.d.ts +29 -0
- package/dist/generators/spec-schema.js +21 -0
- package/dist/git-marker.d.ts +3 -0
- package/dist/git-marker.js +13 -0
- package/dist/gitlfs.d.ts +38 -0
- package/dist/gitlfs.js +171 -0
- package/dist/guard.d.ts +55 -0
- package/dist/guard.js +323 -0
- package/dist/handoff/current-profile.d.ts +48 -0
- package/dist/handoff/current-profile.js +127 -0
- package/dist/handoff/doctor.d.ts +26 -0
- package/dist/handoff/doctor.js +249 -0
- package/dist/handoff/mark-check.d.ts +17 -0
- package/dist/handoff/mark-check.js +66 -0
- package/dist/handoff/presets/aseprite-json.d.ts +5 -0
- package/dist/handoff/presets/aseprite-json.js +45 -0
- package/dist/handoff/presets/atlas-json.d.ts +44 -0
- package/dist/handoff/presets/atlas-json.js +195 -0
- package/dist/handoff/presets/atlas-pack.d.ts +14 -0
- package/dist/handoff/presets/atlas-pack.js +431 -0
- package/dist/handoff/presets/index.d.ts +273 -0
- package/dist/handoff/presets/index.js +58 -0
- package/dist/handoff/presets/manifest.d.ts +2 -0
- package/dist/handoff/presets/manifest.js +49 -0
- package/dist/handoff/usage.d.ts +27 -0
- package/dist/handoff/usage.js +159 -0
- package/dist/handoff.d.ts +345 -0
- package/dist/handoff.js +1221 -0
- package/dist/identity-eval.d.ts +156 -0
- package/dist/identity-eval.js +321 -0
- package/dist/identity.d.ts +293 -0
- package/dist/identity.js +675 -0
- package/dist/image/apply-style.d.ts +4 -0
- package/dist/image/apply-style.js +37 -0
- package/dist/image/digits.d.ts +5 -0
- package/dist/image/digits.js +40 -0
- package/dist/image/ktx2.d.ts +83 -0
- package/dist/image/ktx2.js +196 -0
- package/dist/image/raster.d.ts +23 -0
- package/dist/image/raster.js +77 -0
- package/dist/image/resample.d.ts +10 -0
- package/dist/image/resample.js +82 -0
- package/dist/image/webp.d.ts +17 -0
- package/dist/image/webp.js +323 -0
- package/dist/init.d.ts +132 -0
- package/dist/init.js +425 -0
- package/dist/inputs.d.ts +67 -0
- package/dist/inputs.js +151 -0
- package/dist/json.d.ts +7 -0
- package/dist/json.js +27 -0
- package/dist/keys.d.ts +34 -0
- package/dist/keys.js +198 -0
- package/dist/kind-schemas.d.ts +17 -0
- package/dist/kind-schemas.js +205 -0
- package/dist/library/actions.d.ts +76 -0
- package/dist/library/actions.js +212 -0
- package/dist/library/adopt.d.ts +177 -0
- package/dist/library/adopt.js +624 -0
- package/dist/library/canonical.d.ts +7 -0
- package/dist/library/canonical.js +29 -0
- package/dist/library/card.d.ts +138 -0
- package/dist/library/card.js +532 -0
- package/dist/library/credits.d.ts +70 -0
- package/dist/library/credits.js +222 -0
- package/dist/library/describe.d.ts +48 -0
- package/dist/library/describe.js +199 -0
- package/dist/library/diff.d.ts +26 -0
- package/dist/library/diff.js +208 -0
- package/dist/library/exact.d.ts +15 -0
- package/dist/library/exact.js +47 -0
- package/dist/library/extent.d.ts +56 -0
- package/dist/library/extent.js +205 -0
- package/dist/library/folder.d.ts +85 -0
- package/dist/library/folder.js +291 -0
- package/dist/library/labels.d.ts +29 -0
- package/dist/library/labels.js +112 -0
- package/dist/library/lfs.d.ts +42 -0
- package/dist/library/lfs.js +140 -0
- package/dist/library/maintain.d.ts +100 -0
- package/dist/library/maintain.js +750 -0
- package/dist/library/media-metadata.d.ts +19 -0
- package/dist/library/media-metadata.js +92 -0
- package/dist/library/paths.d.ts +7 -0
- package/dist/library/paths.js +65 -0
- package/dist/library/relations.d.ts +59 -0
- package/dist/library/relations.js +176 -0
- package/dist/library/review.d.ts +204 -0
- package/dist/library/review.js +545 -0
- package/dist/library/stale.d.ts +88 -0
- package/dist/library/stale.js +229 -0
- package/dist/library/suggestions.d.ts +37 -0
- package/dist/library/suggestions.js +146 -0
- package/dist/library/summary.d.ts +65 -0
- package/dist/library/summary.js +138 -0
- package/dist/library/undo.d.ts +18 -0
- package/dist/library/undo.js +141 -0
- package/dist/library/worklist.d.ts +42 -0
- package/dist/library/worklist.js +91 -0
- package/dist/library/write.d.ts +282 -0
- package/dist/library/write.js +790 -0
- package/dist/license.d.ts +67 -0
- package/dist/license.js +205 -0
- package/dist/limits.d.ts +51 -0
- package/dist/limits.js +100 -0
- package/dist/loop.d.ts +244 -0
- package/dist/loop.js +377 -0
- package/dist/material/core.d.ts +70 -0
- package/dist/material/core.js +238 -0
- package/dist/material/engine.d.ts +15 -0
- package/dist/material/engine.js +141 -0
- package/dist/material/flicker.d.ts +26 -0
- package/dist/material/flicker.js +71 -0
- package/dist/material/operations.d.ts +2 -0
- package/dist/material/operations.js +48 -0
- package/dist/material/pipeline.d.ts +51 -0
- package/dist/material/pipeline.js +431 -0
- package/dist/material/profile.d.ts +29 -0
- package/dist/material/profile.js +97 -0
- package/dist/material/rendition.d.ts +5 -0
- package/dist/material/rendition.js +76 -0
- package/dist/mcp.d.ts +72 -0
- package/dist/mcp.js +514 -0
- package/dist/media.d.ts +36 -0
- package/dist/media.js +46 -0
- package/dist/metadata.d.ts +61 -0
- package/dist/metadata.js +748 -0
- package/dist/model-declarations.d.ts +28 -0
- package/dist/model-declarations.js +14 -0
- package/dist/model3d/clip-map.d.ts +49 -0
- package/dist/model3d/clip-map.js +129 -0
- package/dist/model3d/core-checks.d.ts +61 -0
- package/dist/model3d/core-checks.js +278 -0
- package/dist/model3d/facing.d.ts +49 -0
- package/dist/model3d/facing.js +125 -0
- package/dist/model3d/generator.d.ts +19 -0
- package/dist/model3d/generator.js +482 -0
- package/dist/model3d/glb.d.ts +120 -0
- package/dist/model3d/glb.js +155 -0
- package/dist/model3d/handoff.d.ts +37 -0
- package/dist/model3d/handoff.js +131 -0
- package/dist/model3d/lod/chain.d.ts +50 -0
- package/dist/model3d/lod/chain.js +447 -0
- package/dist/model3d/lod/command.d.ts +38 -0
- package/dist/model3d/lod/command.js +377 -0
- package/dist/model3d/lod/qa.d.ts +36 -0
- package/dist/model3d/lod/qa.js +189 -0
- package/dist/model3d/lod/settings.d.ts +36 -0
- package/dist/model3d/lod/settings.js +137 -0
- package/dist/model3d/lod/simplify.d.ts +35 -0
- package/dist/model3d/lod/simplify.js +337 -0
- package/dist/model3d/lod/textures.d.ts +46 -0
- package/dist/model3d/lod/textures.js +190 -0
- package/dist/model3d/lookdev/command.d.ts +219 -0
- package/dist/model3d/lookdev/command.js +1795 -0
- package/dist/model3d/lookdev/edit.d.ts +44 -0
- package/dist/model3d/lookdev/edit.js +241 -0
- package/dist/model3d/lookdev/groom.d.ts +86 -0
- package/dist/model3d/lookdev/groom.js +462 -0
- package/dist/model3d/lookdev/markings.d.ts +98 -0
- package/dist/model3d/lookdev/markings.js +319 -0
- package/dist/model3d/lookdev/project.d.ts +100 -0
- package/dist/model3d/lookdev/project.js +721 -0
- package/dist/model3d/lookdev/settings.d.ts +65 -0
- package/dist/model3d/lookdev/settings.js +103 -0
- package/dist/model3d/lookdev/texels.d.ts +32 -0
- package/dist/model3d/lookdev/texels.js +192 -0
- package/dist/model3d/profile.d.ts +101 -0
- package/dist/model3d/profile.js +132 -0
- package/dist/model3d/prop.d.ts +29 -0
- package/dist/model3d/prop.js +317 -0
- package/dist/model3d/qa.d.ts +27 -0
- package/dist/model3d/qa.js +105 -0
- package/dist/model3d/render.d.ts +172 -0
- package/dist/model3d/render.js +791 -0
- package/dist/model3d/rig/build.d.ts +14 -0
- package/dist/model3d/rig/build.js +210 -0
- package/dist/model3d/rig/candidate.d.ts +50 -0
- package/dist/model3d/rig/candidate.js +132 -0
- package/dist/model3d/rig/command.d.ts +50 -0
- package/dist/model3d/rig/command.js +229 -0
- package/dist/model3d/rig/fit.d.ts +88 -0
- package/dist/model3d/rig/fit.js +568 -0
- package/dist/model3d/rig/gait.d.ts +105 -0
- package/dist/model3d/rig/gait.js +334 -0
- package/dist/model3d/rig/math.d.ts +27 -0
- package/dist/model3d/rig/math.js +92 -0
- package/dist/model3d/rig/motion.d.ts +26 -0
- package/dist/model3d/rig/motion.js +223 -0
- package/dist/model3d/rig/qa.d.ts +76 -0
- package/dist/model3d/rig/qa.js +357 -0
- package/dist/model3d/rig/rig.d.ts +55 -0
- package/dist/model3d/rig/rig.js +213 -0
- package/dist/model3d/rig/template.d.ts +195 -0
- package/dist/model3d/rig/template.js +456 -0
- package/dist/model3d/scene.d.ts +115 -0
- package/dist/model3d/scene.js +684 -0
- package/dist/model3d/views.d.ts +77 -0
- package/dist/model3d/views.js +190 -0
- package/dist/origin.d.ts +162 -0
- package/dist/origin.js +134 -0
- package/dist/paths.d.ts +53 -0
- package/dist/paths.js +240 -0
- package/dist/planning.d.ts +261 -0
- package/dist/planning.js +1470 -0
- package/dist/policy/blocklist.d.ts +28 -0
- package/dist/policy/blocklist.js +58 -0
- package/dist/policy/brief.d.ts +67 -0
- package/dist/policy/brief.js +110 -0
- package/dist/policy/cuts.d.ts +26 -0
- package/dist/policy/cuts.js +80 -0
- package/dist/policy/model.d.ts +69 -0
- package/dist/policy/model.js +202 -0
- package/dist/policy/text.d.ts +183 -0
- package/dist/policy/text.js +285 -0
- package/dist/postprocess.d.ts +68 -0
- package/dist/postprocess.js +302 -0
- package/dist/profile.d.ts +5 -0
- package/dist/profile.js +98 -0
- package/dist/project-rules.d.ts +54 -0
- package/dist/project-rules.js +105 -0
- package/dist/provenance-binding.d.ts +55 -0
- package/dist/provenance-binding.js +352 -0
- package/dist/providers/adapter.d.ts +176 -0
- package/dist/providers/adapter.js +418 -0
- package/dist/providers/index.d.ts +33 -0
- package/dist/providers/index.js +49 -0
- package/dist/providers/script.d.ts +13 -0
- package/dist/providers/script.js +65 -0
- package/dist/providers/set.d.ts +76 -0
- package/dist/providers/set.js +134 -0
- package/dist/pure-cbor.d.ts +1 -0
- package/dist/pure-cbor.js +8 -0
- package/dist/qa/stability.d.ts +215 -0
- package/dist/qa/stability.js +393 -0
- package/dist/qa/stability.json +32 -0
- package/dist/qa.d.ts +36 -0
- package/dist/qa.js +148 -0
- package/dist/reconcile.d.ts +111 -0
- package/dist/reconcile.js +416 -0
- package/dist/redact.d.ts +29 -0
- package/dist/redact.js +74 -0
- package/dist/regions.d.ts +49 -0
- package/dist/regions.js +113 -0
- package/dist/release-policy.d.ts +99 -0
- package/dist/release-policy.js +266 -0
- package/dist/request.d.ts +74 -0
- package/dist/request.js +249 -0
- package/dist/routes.d.ts +327 -0
- package/dist/routes.js +1166 -0
- package/dist/runs/dir.d.ts +33 -0
- package/dist/runs/dir.js +30 -0
- package/dist/runs/execute.d.ts +86 -0
- package/dist/runs/execute.js +422 -0
- package/dist/runs/journal.d.ts +150 -0
- package/dist/runs/journal.js +216 -0
- package/dist/runs/lock.d.ts +57 -0
- package/dist/runs/lock.js +322 -0
- package/dist/runs/plan.d.ts +261 -0
- package/dist/runs/plan.js +404 -0
- package/dist/search/near-match.d.ts +32 -0
- package/dist/search/near-match.js +86 -0
- package/dist/search/reader.d.ts +17 -0
- package/dist/search/reader.js +334 -0
- package/dist/search/sheet.d.ts +4 -0
- package/dist/search/sheet.js +28 -0
- package/dist/search/style-outliers.d.ts +77 -0
- package/dist/search/style-outliers.js +166 -0
- package/dist/settings-write.d.ts +78 -0
- package/dist/settings-write.js +374 -0
- package/dist/settings.d.ts +436 -0
- package/dist/settings.js +622 -0
- package/dist/shared-settings.d.ts +4 -0
- package/dist/shared-settings.js +24 -0
- package/dist/sheet/blobs.d.ts +33 -0
- package/dist/sheet/blobs.js +145 -0
- package/dist/sheet/generate.d.ts +71 -0
- package/dist/sheet/generate.js +278 -0
- package/dist/sheet/group.d.ts +20 -0
- package/dist/sheet/group.js +191 -0
- package/dist/sheet/import.d.ts +315 -0
- package/dist/sheet/import.js +832 -0
- package/dist/sheet/matte.d.ts +25 -0
- package/dist/sheet/matte.js +508 -0
- package/dist/sheet/media-import.d.ts +41 -0
- package/dist/sheet/media-import.js +118 -0
- package/dist/sheet/register.d.ts +17 -0
- package/dist/sheet/register.js +176 -0
- package/dist/sheet/slice.d.ts +73 -0
- package/dist/sheet/slice.js +912 -0
- package/dist/sheet/types.d.ts +225 -0
- package/dist/sheet/types.js +1 -0
- package/dist/source/aseprite.d.ts +14 -0
- package/dist/source/aseprite.js +124 -0
- package/dist/source/stage.d.ts +24 -0
- package/dist/source/stage.js +172 -0
- package/dist/spend.d.ts +220 -0
- package/dist/spend.js +436 -0
- package/dist/sprite/render.d.ts +22 -0
- package/dist/sprite/render.js +272 -0
- package/dist/storage.d.ts +135 -0
- package/dist/storage.js +405 -0
- package/dist/style.d.ts +19 -0
- package/dist/style.js +26 -0
- package/dist/template.d.ts +29 -0
- package/dist/template.js +98 -0
- package/dist/testing/aseprite.d.ts +54 -0
- package/dist/testing/aseprite.js +191 -0
- package/dist/testing/cli.d.ts +24 -0
- package/dist/testing/cli.js +91 -0
- package/dist/testing/conformance.d.ts +61 -0
- package/dist/testing/conformance.js +455 -0
- package/dist/testing/index.d.ts +23 -0
- package/dist/testing/index.js +15 -0
- package/dist/testing/mcp.d.ts +25 -0
- package/dist/testing/mcp.js +80 -0
- package/dist/testing/project.d.ts +81 -0
- package/dist/testing/project.js +215 -0
- package/dist/testing/samples.d.ts +42 -0
- package/dist/testing/samples.js +122 -0
- package/dist/transform/operations.d.ts +5 -0
- package/dist/transform/operations.js +320 -0
- package/dist/transform/raster-engine.d.ts +9 -0
- package/dist/transform/raster-engine.js +329 -0
- package/dist/transform/rendition.d.ts +65 -0
- package/dist/transform/rendition.js +317 -0
- package/dist/transform/run.d.ts +138 -0
- package/dist/transform/run.js +442 -0
- package/dist/transform/schema.d.ts +33 -0
- package/dist/transform/schema.js +73 -0
- package/dist/transform/types.d.ts +101 -0
- package/dist/transform/types.js +1 -0
- package/dist/tree/address.d.ts +18 -0
- package/dist/tree/address.js +59 -0
- package/dist/tree/list.d.ts +18 -0
- package/dist/tree/list.js +101 -0
- package/dist/tree/project.d.ts +61 -0
- package/dist/tree/project.js +145 -0
- package/dist/tree/read.d.ts +43 -0
- package/dist/tree/read.js +715 -0
- package/dist/tree/search.d.ts +20 -0
- package/dist/tree/search.js +44 -0
- package/dist/tree/serve.d.ts +79 -0
- package/dist/tree/serve.js +415 -0
- package/dist/tree/thumbs.d.ts +26 -0
- package/dist/tree/thumbs.js +134 -0
- package/dist/turnaround.d.ts +195 -0
- package/dist/turnaround.js +622 -0
- package/dist/types.d.ts +595 -0
- package/dist/types.js +1 -0
- package/package.json +112 -3
- package/policy/blocklist.json +47 -0
- package/policy/prompt-policy-cuts.json +15 -0
- package/skills/art-direction/SKILL.md +16 -0
- package/skills/art-direction/default.md +14 -0
- package/skills/art-direction/presets/cozy-storybook.md +121 -0
- package/skills/art-direction/presets/dark-gritty-isometric.md +121 -0
- package/skills/art-direction/presets/flat-cartoon-kids.md +121 -0
- package/skills/art-direction/references/bible-format.md +47 -0
- package/skills/assetgrove/SKILL.md +109 -0
- package/skills/assetgrove/references/commands.md +723 -0
package/dist/routes.js
ADDED
|
@@ -0,0 +1,1166 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model routes (design section 12): which provider and model serve each operation. Routes come
|
|
3
|
+
* only from the developer settings: `settings.routes[op]` over `settings.roles[role]` over the
|
|
4
|
+
* configured adapters' `defaultRoutes`. Grants and terms belong to the (provider, model) pair.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { SettingsError } from "./env.js";
|
|
8
|
+
export const IDENTITY_CAST_OPERATION = "identity-cast";
|
|
9
|
+
export const LOOKDEV_OPERATION = "lookdev";
|
|
10
|
+
export const LOOKDEV_LOCATE_OPERATION = "lookdev-locate";
|
|
11
|
+
export const LOOKDEV_GROOM_OPERATION = "lookdev-groom";
|
|
12
|
+
export const LOOKDEV_MARKINGS_OPERATION = "lookdev-markings";
|
|
13
|
+
export const IDENTITY_CHECK_OPERATION = "identity-check";
|
|
14
|
+
/**
|
|
15
|
+
* Hosted search embeddings (design section 7.7): one operation for images and texts alike, so both
|
|
16
|
+
* always land in one model's space. No adapter routes it by default: the `embeddings` role does.
|
|
17
|
+
*/
|
|
18
|
+
export const EMBED_OPERATION = "embed";
|
|
19
|
+
/** The prompt policy's model check: one Boolean decision on a request's prompt text. */
|
|
20
|
+
export const PROMPT_POLICY_OPERATION = "prompt-policy";
|
|
21
|
+
/** The brief policy's model check: Boolean decisions on whether text departs from the style bible. */
|
|
22
|
+
export const BRIEF_POLICY_OPERATION = "brief-policy";
|
|
23
|
+
/** Which view a 3D request's reference image shows: one typed choice decision per image. */
|
|
24
|
+
export const REFERENCE_VIEW_OPERATION = "reference-view";
|
|
25
|
+
/** Which way a generated 3D model faces (#365): one typed choice decision per candidate. */
|
|
26
|
+
export const MODEL3D_FACING_OPERATION = "model3d-facing";
|
|
27
|
+
/** Whether a look-dev identity marking is kept (#365): one typed choice decision per marking and render. */
|
|
28
|
+
export const LOOKDEV_MARKING_OPERATION = "lookdev-marking";
|
|
29
|
+
/**
|
|
30
|
+
* Whether a library asset made under another style bible version should be redone: one Boolean
|
|
31
|
+
* decision per asset and version pair, made only by `library judge-stale` (src/library/stale.ts).
|
|
32
|
+
*/
|
|
33
|
+
export const STALENESS_OPERATION = "bible-staleness";
|
|
34
|
+
/**
|
|
35
|
+
* Which motion template describes an animation family (#364): one typed choice decision per
|
|
36
|
+
* family with no declared template and no template of its exact name, text only.
|
|
37
|
+
*/
|
|
38
|
+
export const MOTION_TEMPLATE_OPERATION = "motion-template";
|
|
39
|
+
/**
|
|
40
|
+
* Whether a member of a set is drawn in a different art style from the rest: one Boolean decision
|
|
41
|
+
* per member among the five most distant of the set's ranking, made only by `find --outliers`
|
|
42
|
+
* (src/search/style-outliers.ts).
|
|
43
|
+
*/
|
|
44
|
+
export const STYLE_OUTLIER_OPERATION = "style-outlier";
|
|
45
|
+
/**
|
|
46
|
+
* Whether stage's background removal cut part of the subject away or left background attached
|
|
47
|
+
* (#364): one Boolean decision per still or sprite-strip candidate, shown the source image and the
|
|
48
|
+
* cut-out over a contrasting colour.
|
|
49
|
+
*/
|
|
50
|
+
export const CUTOUT_OPERATION = "cutout";
|
|
51
|
+
/**
|
|
52
|
+
* What an ambiguous blob on a contact sheet is (#364): a figure, part of the figure next to it, a
|
|
53
|
+
* label or a speck. One choice decision per blob the slicer cannot tell by area, at sheet import.
|
|
54
|
+
*/
|
|
55
|
+
export const SHEET_BLOB_OPERATION = "sheet-blob";
|
|
56
|
+
/**
|
|
57
|
+
* Whether a planned run's candidate violates the constitution or asset spec (#378): one Boolean
|
|
58
|
+
* decision per candidate, shown the candidate and the references.
|
|
59
|
+
*/
|
|
60
|
+
export const STYLE_VERDICT_OPERATION = "style-verdict";
|
|
61
|
+
/**
|
|
62
|
+
* Which allowed mood (or enumerated adjustment value) is closest to the one a brief requested
|
|
63
|
+
* (#378): a typed choice, at most once per field per plan, only when the request is out of bounds.
|
|
64
|
+
*/
|
|
65
|
+
export const BRIEF_CLAMP_OPERATION = "brief-clamp";
|
|
66
|
+
/**
|
|
67
|
+
* Whether an asset is part of the game's user interface (#378): one Boolean decision per plan,
|
|
68
|
+
* asked only when DESIGN.md has colours and the brief does not declare `ui`.
|
|
69
|
+
*/
|
|
70
|
+
export const UI_ASSET_OPERATION = "ui-asset";
|
|
71
|
+
/**
|
|
72
|
+
* Whether a material map flickers between two frames (#364): one choice decision (same, follows
|
|
73
|
+
* the pose, flickers) per channel and frame pair whose map the pixel comparison could not clear.
|
|
74
|
+
*/
|
|
75
|
+
export const MAP_FLICKER_OPERATION = "map-flicker";
|
|
76
|
+
/**
|
|
77
|
+
* A turnaround sheet (#627): the subject redrawn from its photos in the bible's look, on a model
|
|
78
|
+
* that redraws from reference images rather than one that preserves the photo.
|
|
79
|
+
*/
|
|
80
|
+
export const TURNAROUND_OPERATION = "turnaround";
|
|
81
|
+
/**
|
|
82
|
+
* Whether each view of a turnaround candidate shows its subject alone (#627): one typed choice
|
|
83
|
+
* decision per candidate on its four views.
|
|
84
|
+
*/
|
|
85
|
+
export const TURNAROUND_SUBJECT_OPERATION = "turnaround-subject";
|
|
86
|
+
/**
|
|
87
|
+
* Which library clip of a 3D clip route is a requested animation family (#378): one choice
|
|
88
|
+
* decision per family that is not exactly a library key, at most once per family per run, made
|
|
89
|
+
* only on the provider-rig path.
|
|
90
|
+
*/
|
|
91
|
+
export const CLIP_MAP_OPERATION = "clip-map";
|
|
92
|
+
/**
|
|
93
|
+
* Audio generation (docs/PRD-audio.md): the operation that holds each audio adapter's default
|
|
94
|
+
* route. A kind's own audio operation (role `audio`) takes this default when it has none.
|
|
95
|
+
*/
|
|
96
|
+
export const AUDIO_OPERATION = "audio";
|
|
97
|
+
/**
|
|
98
|
+
* The route fields a settings route or role may set beside its provider, model, grant, terms,
|
|
99
|
+
* estimate and provider options (#547), each validated here: the settings' route schema takes
|
|
100
|
+
* this schema's fields.
|
|
101
|
+
*/
|
|
102
|
+
export const routeOptionsFieldsSchema = z.strictObject({
|
|
103
|
+
/** Image routes: the size asked for, `<width>x<height>` in pixels. */
|
|
104
|
+
size: z
|
|
105
|
+
.string()
|
|
106
|
+
.regex(/^[1-9]\d*x[1-9]\d*$/, "must be <width>x<height> in pixels, such as 1024x1024")
|
|
107
|
+
.optional(),
|
|
108
|
+
/** Whether the model accepts a seed; only then is one sent and recorded. */
|
|
109
|
+
supportsSeed: z.boolean().optional(),
|
|
110
|
+
/** 3D routes: the axis the provider's models face. */
|
|
111
|
+
forward: z.enum(["+x", "-x", "+z", "-z"]).optional(),
|
|
112
|
+
/** 3D clip routes: the provider's animation library, by gait then family. */
|
|
113
|
+
library: z
|
|
114
|
+
.record(z.string().min(1), z.record(z.string().min(1), z.strictObject({ clip: z.string().min(1), loop: z.boolean() })))
|
|
115
|
+
.optional(),
|
|
116
|
+
/** 3D rig routes: the provider's rig type for each gait. */
|
|
117
|
+
rigTypes: z.record(z.string().min(1), z.string().min(1)).optional(),
|
|
118
|
+
});
|
|
119
|
+
/** The route fields a settings route or role may set (`routeOptionsFieldsSchema`). */
|
|
120
|
+
export const ROUTE_FIELDS = ["size", "supportsSeed", "forward", "library", "rigTypes"];
|
|
121
|
+
/**
|
|
122
|
+
* Tripo on paid credits: the account owns its outputs, so they ship under the target's licence
|
|
123
|
+
* (owner decision on #72). Credits are about $0.01 each.
|
|
124
|
+
*/
|
|
125
|
+
const tripoGrant = {
|
|
126
|
+
license: "LicenseRef-tripo-paid",
|
|
127
|
+
plan: "paid",
|
|
128
|
+
commercial: true,
|
|
129
|
+
relabel: true,
|
|
130
|
+
};
|
|
131
|
+
const tripoTerms = "Tripo API Terms of Service, paid credits (as of 2026-11-10)";
|
|
132
|
+
const tripoTermsAsOf = "2026-11-10";
|
|
133
|
+
const googleGrant = {
|
|
134
|
+
license: "LicenseRef-google-api",
|
|
135
|
+
plan: "api",
|
|
136
|
+
commercial: true,
|
|
137
|
+
relabel: true,
|
|
138
|
+
};
|
|
139
|
+
const googleTerms = "Google Gemini API Additional Terms of Service, via Vercel AI Gateway (as of 2026-11-07)";
|
|
140
|
+
const googleTermsAsOf = "2026-11-07";
|
|
141
|
+
/**
|
|
142
|
+
* Stability's terms for Stable Audio, read 2026-11-18 (docs/PRD-audio.md, "Routes"). Stability
|
|
143
|
+
* assigns its rights in output, so the target may declare its own licence.
|
|
144
|
+
*/
|
|
145
|
+
const stabilityAudioGrant = {
|
|
146
|
+
license: "LicenseRef-stability-api",
|
|
147
|
+
plan: "api",
|
|
148
|
+
commercial: true,
|
|
149
|
+
relabel: true,
|
|
150
|
+
};
|
|
151
|
+
const stabilityAudioTerms = "Stability AI API Terms of Service (as of 2026-11-18): Stability assigns its rights in output to you; commercial use allowed. Training on inputs and outputs is on by default, with an opt-out. Its watermark, content credentials and other AI markings may not be removed, and output may not be presented as human-made.";
|
|
152
|
+
const stabilityAudioTermsAsOf = "2026-11-18";
|
|
153
|
+
/** Stability's published price: 8 credits a successful generation at $0.01 a credit. */
|
|
154
|
+
const STABLE_AUDIO_USD = 0.08;
|
|
155
|
+
/** Stable Audio 2.5: direct and synchronous, 1 to 190 s, with a seed. Serves every audio kind. */
|
|
156
|
+
const stableAudio25Route = {
|
|
157
|
+
model: "stable-audio-2.5",
|
|
158
|
+
estimatedCostUsd: STABLE_AUDIO_USD,
|
|
159
|
+
supportsSeed: true,
|
|
160
|
+
outputGrant: stabilityAudioGrant,
|
|
161
|
+
providerTerms: stabilityAudioTerms,
|
|
162
|
+
providerTermsAsOf: stabilityAudioTermsAsOf,
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* The Stability adapter's routes by model beyond its default: Stable Audio 3.0, asynchronous with a
|
|
166
|
+
* job id, up to 380 s, results kept 24 h; for ambience and music. A settings route naming the
|
|
167
|
+
* Stability provider and this model takes its terms, grant and estimate.
|
|
168
|
+
*/
|
|
169
|
+
export const STABILITY_MODEL_ROUTES = {
|
|
170
|
+
"stable-audio-3.0": {
|
|
171
|
+
model: "stable-audio-3.0",
|
|
172
|
+
estimatedCostUsd: STABLE_AUDIO_USD,
|
|
173
|
+
supportsSeed: true,
|
|
174
|
+
outputGrant: stabilityAudioGrant,
|
|
175
|
+
providerTerms: stabilityAudioTerms,
|
|
176
|
+
providerTermsAsOf: stabilityAudioTermsAsOf,
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
/** The Stability adapter's default routes: audio on Stable Audio 2.5. */
|
|
180
|
+
export const STABILITY_DEFAULT_ROUTES = {
|
|
181
|
+
audio: stableAudio25Route,
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* ElevenLabs Sound Effects v3, direct, on a paid plan (read 2026-11-18). The grant's plan is
|
|
185
|
+
* replaced on each call by the account's tier as the adapter reads it; the output is non-exclusive.
|
|
186
|
+
* Its estimate is the published $0.12 a minute for the longest clip the API makes (30 s); each
|
|
187
|
+
* call reserves the rate times its own requested duration.
|
|
188
|
+
*/
|
|
189
|
+
export const ELEVENLABS_DEFAULT_ROUTES = {
|
|
190
|
+
audio: {
|
|
191
|
+
model: "eleven_text_to_sound_v3",
|
|
192
|
+
estimatedCostUsd: 0.06,
|
|
193
|
+
providerOptions: { elevenlabs: { sampleRate: 44100 } },
|
|
194
|
+
outputGrant: {
|
|
195
|
+
license: "LicenseRef-elevenlabs-paid",
|
|
196
|
+
plan: "paid",
|
|
197
|
+
commercial: true,
|
|
198
|
+
relabel: true,
|
|
199
|
+
exclusive: false,
|
|
200
|
+
},
|
|
201
|
+
providerTerms: 'ElevenLabs Terms of Service, paid plan (as of 2026-11-18): paid plans may use output commercially; free plans are non-commercial only. You keep the rights in output. Output is non-exclusive: it may not be unique across users. ElevenLabs may use content to improve its services, with a "Data use" opt-out that applies from the day it is set.',
|
|
202
|
+
providerTermsAsOf: "2026-11-18",
|
|
203
|
+
},
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Audio routes the design refuses, each with its reason (docs/PRD-audio.md, "Routes"): a route of
|
|
207
|
+
* the `audio` role that matches one is unavailable, naming the reason, before any reservation.
|
|
208
|
+
*/
|
|
209
|
+
export const REFUSED_AUDIO_ROUTES = [
|
|
210
|
+
{
|
|
211
|
+
reason: "its model is licensed CC BY-NC (non-commercial), and a sold game is commercial use",
|
|
212
|
+
matches: (route) => /(^|-)NC(-|$)/.test(route.outputGrant?.license ?? "") ||
|
|
213
|
+
/(^|[/_-])(musicgen|audiogen)([._-]|$)/i.test(route.model),
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
reason: "it is open-weight Stable Audio hosted by a third party: the Stability AI Community License needs registration, ends above $1,000,000 of revenue and does not say how a host's outputs are covered",
|
|
217
|
+
// The scripted stand-in serves the core defaults, Stability's included, and reaches no host.
|
|
218
|
+
matches: (route, adapter) => adapter !== "stability" &&
|
|
219
|
+
adapter !== STAND_IN_ADAPTER &&
|
|
220
|
+
/stable[-_ ]?audio/i.test(route.model),
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
reason: "it reaches ElevenLabs through the AI Gateway, whose terms do not say which ElevenLabs rights tier applies",
|
|
224
|
+
matches: (route, adapter) => adapter === "vercel-ai-gateway" && /^elevenlabs\//i.test(route.model),
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
reason: "it is Eleven Music, whose plans below Enterprise exclude games outside its Indie Game definition, which Assetgrove cannot verify",
|
|
228
|
+
// Only ElevenLabs' own ids: `eleven_music*` anywhere, a bare `music_v1` only on ElevenLabs
|
|
229
|
+
// (its adapter, or an `elevenlabs/` model id). Another vendor's `music-…` model is not this.
|
|
230
|
+
matches: (route, adapter) => {
|
|
231
|
+
const model = route.model.replace(/^elevenlabs\//i, "");
|
|
232
|
+
const eleven = adapter === "elevenlabs" || /^elevenlabs\//i.test(route.model);
|
|
233
|
+
return /^eleven[-_]?music([-_]|$)/i.test(model) || (eleven && /^music([-_]|$)/i.test(model));
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
reason: "its vendor has no public API",
|
|
238
|
+
matches: (route) => /(^|\/)(suno|udio)([/_-]|$)/i.test(route.model),
|
|
239
|
+
},
|
|
240
|
+
];
|
|
241
|
+
/**
|
|
242
|
+
* The core default routes, each with the grant its terms give: the gateway survey of 2026-11-07
|
|
243
|
+
* (docs/models.md) for the 2D operations, Tripo for the 3D ones. Each adapter's `defaultRoutes`
|
|
244
|
+
* is its part of this table; the scripted adapter, the test stand-in, serves all of it.
|
|
245
|
+
*/
|
|
246
|
+
export const defaultRoutes = {
|
|
247
|
+
still: {
|
|
248
|
+
model: "openai/gpt-image-2",
|
|
249
|
+
estimatedCostUsd: 0.25,
|
|
250
|
+
size: "1024x1024",
|
|
251
|
+
outputGrant: {
|
|
252
|
+
license: "LicenseRef-openai-api",
|
|
253
|
+
plan: "api",
|
|
254
|
+
commercial: true,
|
|
255
|
+
relabel: true,
|
|
256
|
+
},
|
|
257
|
+
providerTerms: "OpenAI Services Agreement and Usage Policies, via Vercel AI Gateway (as of 2026-11-07)",
|
|
258
|
+
providerTermsAsOf: "2026-11-07",
|
|
259
|
+
},
|
|
260
|
+
edit: {
|
|
261
|
+
model: "bfl/flux-kontext-pro",
|
|
262
|
+
estimatedCostUsd: 0.05,
|
|
263
|
+
supportsSeed: true,
|
|
264
|
+
outputGrant: {
|
|
265
|
+
license: "LicenseRef-bfl-api",
|
|
266
|
+
plan: "api",
|
|
267
|
+
commercial: true,
|
|
268
|
+
relabel: true,
|
|
269
|
+
},
|
|
270
|
+
providerTerms: "Black Forest Labs API Terms of Service, via Vercel AI Gateway (as of 2026-11-07)",
|
|
271
|
+
providerTermsAsOf: "2026-11-07",
|
|
272
|
+
},
|
|
273
|
+
sheet: {
|
|
274
|
+
model: "openai/gpt-image-2",
|
|
275
|
+
estimatedCostUsd: 0.3,
|
|
276
|
+
size: "1536x1024",
|
|
277
|
+
outputGrant: {
|
|
278
|
+
license: "LicenseRef-openai-api",
|
|
279
|
+
plan: "api",
|
|
280
|
+
commercial: true,
|
|
281
|
+
relabel: true,
|
|
282
|
+
},
|
|
283
|
+
providerTerms: "OpenAI Services Agreement and Usage Policies, via Vercel AI Gateway (as of 2026-11-07)",
|
|
284
|
+
providerTermsAsOf: "2026-11-07",
|
|
285
|
+
},
|
|
286
|
+
vision: {
|
|
287
|
+
model: "google/gemini-3-flash",
|
|
288
|
+
estimatedCostUsd: 0.02,
|
|
289
|
+
outputGrant: {
|
|
290
|
+
license: "LicenseRef-google-api",
|
|
291
|
+
plan: "api",
|
|
292
|
+
commercial: true,
|
|
293
|
+
relabel: true,
|
|
294
|
+
},
|
|
295
|
+
providerTerms: "Google Gemini API Additional Terms of Service, via Vercel AI Gateway (as of 2026-11-07)",
|
|
296
|
+
providerTermsAsOf: "2026-11-07",
|
|
297
|
+
},
|
|
298
|
+
identity: {
|
|
299
|
+
// #27's image eval: best on identity with reference images; `openai/gpt-6-luna-decisions`
|
|
300
|
+
// is the alternate. About $0.00003 per answer; the estimate is a deliberate upper bound.
|
|
301
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
302
|
+
estimatedCostUsd: 0.001,
|
|
303
|
+
outputGrant: {
|
|
304
|
+
license: "LicenseRef-perplexity-api",
|
|
305
|
+
plan: "api",
|
|
306
|
+
commercial: true,
|
|
307
|
+
relabel: true,
|
|
308
|
+
},
|
|
309
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-08)",
|
|
310
|
+
providerTermsAsOf: "2026-11-08",
|
|
311
|
+
},
|
|
312
|
+
// The prompt policy's model check (#185): one Boolean decision on a request's prompt text,
|
|
313
|
+
// text only, on the same typed decision model and upper bound as identity.
|
|
314
|
+
[PROMPT_POLICY_OPERATION]: {
|
|
315
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
316
|
+
estimatedCostUsd: 0.001,
|
|
317
|
+
outputGrant: {
|
|
318
|
+
license: "LicenseRef-perplexity-api",
|
|
319
|
+
plan: "api",
|
|
320
|
+
commercial: true,
|
|
321
|
+
relabel: true,
|
|
322
|
+
},
|
|
323
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-15)",
|
|
324
|
+
providerTermsAsOf: "2026-11-15",
|
|
325
|
+
},
|
|
326
|
+
// The brief policy's model check (#324): one Boolean decision per protected bible field on
|
|
327
|
+
// whether a brief's or the compiler's text departs from the bible; same model and bound.
|
|
328
|
+
[BRIEF_POLICY_OPERATION]: {
|
|
329
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
330
|
+
estimatedCostUsd: 0.001,
|
|
331
|
+
outputGrant: {
|
|
332
|
+
license: "LicenseRef-perplexity-api",
|
|
333
|
+
plan: "api",
|
|
334
|
+
commercial: true,
|
|
335
|
+
relabel: true,
|
|
336
|
+
},
|
|
337
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-15)",
|
|
338
|
+
providerTermsAsOf: "2026-11-15",
|
|
339
|
+
},
|
|
340
|
+
// Which view a 3D request's reference shows (#325): one typed choice decision per image, on the
|
|
341
|
+
// same typed decision model and upper bound as identity.
|
|
342
|
+
[REFERENCE_VIEW_OPERATION]: {
|
|
343
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
344
|
+
estimatedCostUsd: 0.001,
|
|
345
|
+
outputGrant: {
|
|
346
|
+
license: "LicenseRef-perplexity-api",
|
|
347
|
+
plan: "api",
|
|
348
|
+
commercial: true,
|
|
349
|
+
relabel: true,
|
|
350
|
+
},
|
|
351
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-15)",
|
|
352
|
+
providerTermsAsOf: "2026-11-15",
|
|
353
|
+
},
|
|
354
|
+
// Which way a generated 3D model faces (#365): one typed choice decision per candidate on four
|
|
355
|
+
// free renders of the raw mesh, on the same typed decision model and upper bound.
|
|
356
|
+
[MODEL3D_FACING_OPERATION]: {
|
|
357
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
358
|
+
estimatedCostUsd: 0.001,
|
|
359
|
+
outputGrant: {
|
|
360
|
+
license: "LicenseRef-perplexity-api",
|
|
361
|
+
plan: "api",
|
|
362
|
+
commercial: true,
|
|
363
|
+
relabel: true,
|
|
364
|
+
},
|
|
365
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-15)",
|
|
366
|
+
},
|
|
367
|
+
// Whether each look-dev identity marking is kept, drifted or missing (#365): one typed choice
|
|
368
|
+
// decision per marking, view and season render, on the same typed decision model and bound.
|
|
369
|
+
[LOOKDEV_MARKING_OPERATION]: {
|
|
370
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
371
|
+
estimatedCostUsd: 0.001,
|
|
372
|
+
outputGrant: {
|
|
373
|
+
license: "LicenseRef-perplexity-api",
|
|
374
|
+
plan: "api",
|
|
375
|
+
commercial: true,
|
|
376
|
+
relabel: true,
|
|
377
|
+
},
|
|
378
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-15)",
|
|
379
|
+
},
|
|
380
|
+
// Whether an asset made under another bible version should be redone (#366): one Boolean
|
|
381
|
+
// decision per asset and version pair, shown its thumbnail; same model and bound as identity.
|
|
382
|
+
[STALENESS_OPERATION]: {
|
|
383
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
384
|
+
estimatedCostUsd: 0.001,
|
|
385
|
+
outputGrant: {
|
|
386
|
+
license: "LicenseRef-perplexity-api",
|
|
387
|
+
plan: "api",
|
|
388
|
+
commercial: true,
|
|
389
|
+
relabel: true,
|
|
390
|
+
},
|
|
391
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-16)",
|
|
392
|
+
providerTermsAsOf: "2026-11-16",
|
|
393
|
+
},
|
|
394
|
+
// Which motion template describes an animation family (#364): one typed choice decision per
|
|
395
|
+
// undecided family, text only, on the same typed decision model and upper bound as identity.
|
|
396
|
+
[MOTION_TEMPLATE_OPERATION]: {
|
|
397
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
398
|
+
estimatedCostUsd: 0.001,
|
|
399
|
+
outputGrant: {
|
|
400
|
+
license: "LicenseRef-perplexity-api",
|
|
401
|
+
plan: "api",
|
|
402
|
+
commercial: true,
|
|
403
|
+
relabel: true,
|
|
404
|
+
},
|
|
405
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-16)",
|
|
406
|
+
providerTermsAsOf: "2026-11-16",
|
|
407
|
+
},
|
|
408
|
+
// Whether a set member is drawn in another art style (#366): one Boolean decision per member
|
|
409
|
+
// among the five most distant, shown it and a contact sheet; same model and bound as identity.
|
|
410
|
+
[STYLE_OUTLIER_OPERATION]: {
|
|
411
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
412
|
+
estimatedCostUsd: 0.001,
|
|
413
|
+
outputGrant: {
|
|
414
|
+
license: "LicenseRef-perplexity-api",
|
|
415
|
+
plan: "api",
|
|
416
|
+
commercial: true,
|
|
417
|
+
relabel: true,
|
|
418
|
+
},
|
|
419
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-16)",
|
|
420
|
+
providerTermsAsOf: "2026-11-16",
|
|
421
|
+
},
|
|
422
|
+
// Whether stage's cut-out lost part of the subject or kept background (#364): one Boolean
|
|
423
|
+
// decision per still or sprite-strip candidate, on the same typed decision model and bound.
|
|
424
|
+
[CUTOUT_OPERATION]: {
|
|
425
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
426
|
+
estimatedCostUsd: 0.001,
|
|
427
|
+
outputGrant: {
|
|
428
|
+
license: "LicenseRef-perplexity-api",
|
|
429
|
+
plan: "api",
|
|
430
|
+
commercial: true,
|
|
431
|
+
relabel: true,
|
|
432
|
+
},
|
|
433
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-17)",
|
|
434
|
+
providerTermsAsOf: "2026-11-17",
|
|
435
|
+
},
|
|
436
|
+
// What an ambiguous blob on a sheet is (#364): one choice decision per blob slicing cannot tell
|
|
437
|
+
// by area, at most 24 per sheet (SHEET_BLOB_LIMIT), on the same typed decision model and bound.
|
|
438
|
+
[SHEET_BLOB_OPERATION]: {
|
|
439
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
440
|
+
estimatedCostUsd: 0.001,
|
|
441
|
+
outputGrant: {
|
|
442
|
+
license: "LicenseRef-perplexity-api",
|
|
443
|
+
plan: "api",
|
|
444
|
+
commercial: true,
|
|
445
|
+
relabel: true,
|
|
446
|
+
},
|
|
447
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-17)",
|
|
448
|
+
providerTermsAsOf: "2026-11-17",
|
|
449
|
+
},
|
|
450
|
+
// Whether a planned run's candidate violates the constitution or asset spec (#378): one Boolean
|
|
451
|
+
// decision per candidate, on the same typed decision model and upper bound as identity.
|
|
452
|
+
[STYLE_VERDICT_OPERATION]: {
|
|
453
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
454
|
+
estimatedCostUsd: 0.001,
|
|
455
|
+
outputGrant: {
|
|
456
|
+
license: "LicenseRef-perplexity-api",
|
|
457
|
+
plan: "api",
|
|
458
|
+
commercial: true,
|
|
459
|
+
relabel: true,
|
|
460
|
+
},
|
|
461
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-16)",
|
|
462
|
+
providerTermsAsOf: "2026-11-16",
|
|
463
|
+
},
|
|
464
|
+
// Plan-time brief decisions (#378), on the same typed decision model and upper bound as identity.
|
|
465
|
+
[BRIEF_CLAMP_OPERATION]: {
|
|
466
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
467
|
+
estimatedCostUsd: 0.001,
|
|
468
|
+
outputGrant: {
|
|
469
|
+
license: "LicenseRef-perplexity-api",
|
|
470
|
+
plan: "api",
|
|
471
|
+
commercial: true,
|
|
472
|
+
relabel: true,
|
|
473
|
+
},
|
|
474
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-16)",
|
|
475
|
+
providerTermsAsOf: "2026-11-16",
|
|
476
|
+
},
|
|
477
|
+
[UI_ASSET_OPERATION]: {
|
|
478
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
479
|
+
estimatedCostUsd: 0.001,
|
|
480
|
+
outputGrant: {
|
|
481
|
+
license: "LicenseRef-perplexity-api",
|
|
482
|
+
plan: "api",
|
|
483
|
+
commercial: true,
|
|
484
|
+
relabel: true,
|
|
485
|
+
},
|
|
486
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-16)",
|
|
487
|
+
providerTermsAsOf: "2026-11-16",
|
|
488
|
+
},
|
|
489
|
+
// Whether a material map flickers between two frames (#364): one choice decision per channel and
|
|
490
|
+
// frame pair still over the flicker bound where the albedo is unchanged, same model and bound.
|
|
491
|
+
[MAP_FLICKER_OPERATION]: {
|
|
492
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
493
|
+
estimatedCostUsd: 0.001,
|
|
494
|
+
outputGrant: {
|
|
495
|
+
license: "LicenseRef-perplexity-api",
|
|
496
|
+
plan: "api",
|
|
497
|
+
commercial: true,
|
|
498
|
+
relabel: true,
|
|
499
|
+
},
|
|
500
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-17)",
|
|
501
|
+
providerTermsAsOf: "2026-11-17",
|
|
502
|
+
},
|
|
503
|
+
// Which library clip a requested animation family is (#378): one choice decision per family that
|
|
504
|
+
// is not exactly a library key, same model and bound.
|
|
505
|
+
[CLIP_MAP_OPERATION]: {
|
|
506
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
507
|
+
estimatedCostUsd: 0.001,
|
|
508
|
+
outputGrant: {
|
|
509
|
+
license: "LicenseRef-perplexity-api",
|
|
510
|
+
plan: "api",
|
|
511
|
+
commercial: true,
|
|
512
|
+
relabel: true,
|
|
513
|
+
},
|
|
514
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-17)",
|
|
515
|
+
providerTermsAsOf: "2026-11-17",
|
|
516
|
+
},
|
|
517
|
+
// Identity as a choice among the whole cast's references (#92): one vision call per candidate.
|
|
518
|
+
[IDENTITY_CAST_OPERATION]: {
|
|
519
|
+
model: "openai/gpt-6.1-terra",
|
|
520
|
+
estimatedCostUsd: 0.02,
|
|
521
|
+
outputGrant: {
|
|
522
|
+
license: "LicenseRef-openai-api",
|
|
523
|
+
plan: "api",
|
|
524
|
+
commercial: true,
|
|
525
|
+
relabel: true,
|
|
526
|
+
},
|
|
527
|
+
providerTerms: "OpenAI Services Agreement and Usage Policies, via Vercel AI Gateway (as of 2026-11-11)",
|
|
528
|
+
providerTermsAsOf: "2026-11-11",
|
|
529
|
+
},
|
|
530
|
+
// Whether an identity record's written signature agrees with its own approved references (#92).
|
|
531
|
+
[IDENTITY_CHECK_OPERATION]: {
|
|
532
|
+
model: "openai/gpt-6.1-terra",
|
|
533
|
+
estimatedCostUsd: 0.02,
|
|
534
|
+
outputGrant: {
|
|
535
|
+
license: "LicenseRef-openai-api",
|
|
536
|
+
plan: "api",
|
|
537
|
+
commercial: true,
|
|
538
|
+
relabel: true,
|
|
539
|
+
},
|
|
540
|
+
providerTerms: "OpenAI Services Agreement and Usage Policies, via Vercel AI Gateway (as of 2026-11-11)",
|
|
541
|
+
providerTermsAsOf: "2026-11-11",
|
|
542
|
+
},
|
|
543
|
+
// Identity flicker (#376): one typed Boolean decision per consecutive frame pair and the loop
|
|
544
|
+
// seam, on the typed decision model and its upper bound.
|
|
545
|
+
flicker: {
|
|
546
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
547
|
+
estimatedCostUsd: 0.001,
|
|
548
|
+
outputGrant: {
|
|
549
|
+
license: "LicenseRef-perplexity-api",
|
|
550
|
+
plan: "api",
|
|
551
|
+
commercial: true,
|
|
552
|
+
relabel: true,
|
|
553
|
+
},
|
|
554
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-15)",
|
|
555
|
+
providerTermsAsOf: "2026-11-15",
|
|
556
|
+
},
|
|
557
|
+
// Image-to-3D on Tripo: multiview (or single-image) to a textured PBR model, 30 credits with
|
|
558
|
+
// texture and PBR (#72's probe); the estimate is an upper bound. Its models face +x: measured
|
|
559
|
+
// on a real run (#72), head at +x in the raw multiview output and after the rig.
|
|
560
|
+
model3d: {
|
|
561
|
+
model: "tripo/v2.5-20250123",
|
|
562
|
+
estimatedCostUsd: 0.5,
|
|
563
|
+
forward: "+x",
|
|
564
|
+
outputGrant: tripoGrant,
|
|
565
|
+
providerTerms: tripoTerms,
|
|
566
|
+
providerTermsAsOf: tripoTermsAsOf,
|
|
567
|
+
providerOptions: {
|
|
568
|
+
tripo: { modelVersion: "v2.5-20250123", texture: true, pbr: true },
|
|
569
|
+
},
|
|
570
|
+
},
|
|
571
|
+
// Tripo's auto-rig, 25 credits (#72's probe). Quadruped rigs need the v2 rigger; v1 refuses them.
|
|
572
|
+
rig3d: {
|
|
573
|
+
model: "tripo/animate-rig-v2.0-20250506",
|
|
574
|
+
estimatedCostUsd: 0.3,
|
|
575
|
+
outputGrant: tripoGrant,
|
|
576
|
+
providerTerms: tripoTerms,
|
|
577
|
+
providerTermsAsOf: tripoTermsAsOf,
|
|
578
|
+
rigTypes: { quadruped: "quadruped", biped: "biped" },
|
|
579
|
+
providerOptions: {
|
|
580
|
+
tripo: { spec: "tripo", modelVersion: "v2.0-20250506" },
|
|
581
|
+
},
|
|
582
|
+
},
|
|
583
|
+
// Tripo's animation library retargeted onto the rig.
|
|
584
|
+
clips3d: {
|
|
585
|
+
model: "tripo/animate-retarget",
|
|
586
|
+
estimatedCostUsd: 0.2,
|
|
587
|
+
outputGrant: tripoGrant,
|
|
588
|
+
providerTerms: tripoTerms,
|
|
589
|
+
providerTermsAsOf: tripoTermsAsOf,
|
|
590
|
+
library: {
|
|
591
|
+
biped: {
|
|
592
|
+
idle: { clip: "preset:idle", loop: true },
|
|
593
|
+
walk: { clip: "preset:walk", loop: true },
|
|
594
|
+
run: { clip: "preset:run", loop: true },
|
|
595
|
+
jump: { clip: "preset:jump", loop: false },
|
|
596
|
+
turn: { clip: "preset:turn", loop: false },
|
|
597
|
+
hurt: { clip: "preset:hurt", loop: false },
|
|
598
|
+
fall: { clip: "preset:fall", loop: false },
|
|
599
|
+
climb: { clip: "preset:climb", loop: false },
|
|
600
|
+
dive: { clip: "preset:dive", loop: false },
|
|
601
|
+
slash: { clip: "preset:slash", loop: false },
|
|
602
|
+
shoot: { clip: "preset:shoot", loop: false },
|
|
603
|
+
},
|
|
604
|
+
// Tripo's library has one quadruped clip (probed 2026-11-10: `preset:quadruped:idle`,
|
|
605
|
+
// `:run`, `:trot` and others are refused as invalid animation names).
|
|
606
|
+
quadruped: {
|
|
607
|
+
walk: { clip: "preset:quadruped:walk", loop: true },
|
|
608
|
+
},
|
|
609
|
+
},
|
|
610
|
+
},
|
|
611
|
+
// Look-dev (#82): each flat-lit render of a picked 3D character repainted in the look its
|
|
612
|
+
// approved references and the bible define, then projected back onto the model's own UVs.
|
|
613
|
+
// Turnaround (#627): its own route, so a sheet is redrawn from the photos rather than edited
|
|
614
|
+
// from them; the reference-driven model the other core routes with references use.
|
|
615
|
+
[TURNAROUND_OPERATION]: {
|
|
616
|
+
model: "openai/gpt-image-2",
|
|
617
|
+
estimatedCostUsd: 0.25,
|
|
618
|
+
size: "1024x1024",
|
|
619
|
+
outputGrant: {
|
|
620
|
+
license: "LicenseRef-openai-api",
|
|
621
|
+
plan: "api",
|
|
622
|
+
commercial: true,
|
|
623
|
+
relabel: true,
|
|
624
|
+
},
|
|
625
|
+
providerTerms: "OpenAI Services Agreement and Usage Policies, via Vercel AI Gateway (as of 2026-11-07)",
|
|
626
|
+
providerTermsAsOf: "2026-11-07",
|
|
627
|
+
},
|
|
628
|
+
// Turnaround (#627): whether each view shows the subject alone, on the typed decision model.
|
|
629
|
+
[TURNAROUND_SUBJECT_OPERATION]: {
|
|
630
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
631
|
+
estimatedCostUsd: 0.001,
|
|
632
|
+
outputGrant: {
|
|
633
|
+
license: "LicenseRef-perplexity-api",
|
|
634
|
+
plan: "api",
|
|
635
|
+
commercial: true,
|
|
636
|
+
relabel: true,
|
|
637
|
+
},
|
|
638
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-15)",
|
|
639
|
+
providerTermsAsOf: "2026-11-15",
|
|
640
|
+
},
|
|
641
|
+
[LOOKDEV_OPERATION]: {
|
|
642
|
+
model: "openai/gpt-image-2",
|
|
643
|
+
estimatedCostUsd: 0.25,
|
|
644
|
+
size: "1024x1024",
|
|
645
|
+
outputGrant: {
|
|
646
|
+
license: "LicenseRef-openai-api",
|
|
647
|
+
plan: "api",
|
|
648
|
+
commercial: true,
|
|
649
|
+
relabel: true,
|
|
650
|
+
},
|
|
651
|
+
providerTerms: "OpenAI Services Agreement and Usage Policies, via Vercel AI Gateway (as of 2026-11-07)",
|
|
652
|
+
providerTermsAsOf: "2026-11-07",
|
|
653
|
+
},
|
|
654
|
+
// Look-dev (#82): where the eyes and nose are on a close-up render, as pixel points and radii.
|
|
655
|
+
[LOOKDEV_LOCATE_OPERATION]: {
|
|
656
|
+
model: "google/gemini-3-flash",
|
|
657
|
+
estimatedCostUsd: 0.02,
|
|
658
|
+
outputGrant: {
|
|
659
|
+
license: "LicenseRef-google-api",
|
|
660
|
+
plan: "api",
|
|
661
|
+
commercial: true,
|
|
662
|
+
relabel: true,
|
|
663
|
+
},
|
|
664
|
+
providerTerms: "Google Gemini API Additional Terms of Service, via Vercel AI Gateway (as of 2026-11-07)",
|
|
665
|
+
providerTermsAsOf: "2026-11-07",
|
|
666
|
+
},
|
|
667
|
+
// Look-dev (#82): one season's groom (lengths, densities, tip tint) read from the target's traits.
|
|
668
|
+
[LOOKDEV_GROOM_OPERATION]: {
|
|
669
|
+
model: "google/gemini-3-flash",
|
|
670
|
+
estimatedCostUsd: 0.02,
|
|
671
|
+
outputGrant: {
|
|
672
|
+
license: "LicenseRef-google-api",
|
|
673
|
+
plan: "api",
|
|
674
|
+
commercial: true,
|
|
675
|
+
relabel: true,
|
|
676
|
+
},
|
|
677
|
+
providerTerms: "Google Gemini API Additional Terms of Service, via Vercel AI Gateway (as of 2026-11-07)",
|
|
678
|
+
providerTermsAsOf: "2026-11-07",
|
|
679
|
+
},
|
|
680
|
+
// Look-dev (#122): where each identity marking and the coat beside it are, in a turnaround view
|
|
681
|
+
// and the lit renders of the same view, for the deterministic markings check.
|
|
682
|
+
// Low thinking (assetgrove#122): boxing markings needs no long reasoning, and at the default
|
|
683
|
+
// level the call ran long enough to time out at the gateway relay in two real runs.
|
|
684
|
+
[LOOKDEV_MARKINGS_OPERATION]: {
|
|
685
|
+
model: "google/gemini-3-flash",
|
|
686
|
+
estimatedCostUsd: 0.02,
|
|
687
|
+
providerOptions: { google: { thinkingConfig: { thinkingLevel: "low" } } },
|
|
688
|
+
outputGrant: {
|
|
689
|
+
license: "LicenseRef-google-api",
|
|
690
|
+
plan: "api",
|
|
691
|
+
commercial: true,
|
|
692
|
+
relabel: true,
|
|
693
|
+
},
|
|
694
|
+
providerTerms: "Google Gemini API Additional Terms of Service, via Vercel AI Gateway (as of 2026-11-12)",
|
|
695
|
+
providerTermsAsOf: "2026-11-12",
|
|
696
|
+
},
|
|
697
|
+
// Holes (#376): one typed Boolean decision per frame (the frame before and after background
|
|
698
|
+
// removal, or its enclosed see-through areas marked), on the typed decision model.
|
|
699
|
+
holes: {
|
|
700
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
701
|
+
estimatedCostUsd: 0.001,
|
|
702
|
+
outputGrant: {
|
|
703
|
+
license: "LicenseRef-perplexity-api",
|
|
704
|
+
plan: "api",
|
|
705
|
+
commercial: true,
|
|
706
|
+
relabel: true,
|
|
707
|
+
},
|
|
708
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-15)",
|
|
709
|
+
providerTermsAsOf: "2026-11-15",
|
|
710
|
+
},
|
|
711
|
+
// Fix-frame's scale (#376): one typed choice among candidate sizes, on the typed decision model.
|
|
712
|
+
"fix-scale": {
|
|
713
|
+
model: "perplexity/pplx-decider-v1.2",
|
|
714
|
+
estimatedCostUsd: 0.001,
|
|
715
|
+
outputGrant: {
|
|
716
|
+
license: "LicenseRef-perplexity-api",
|
|
717
|
+
plan: "api",
|
|
718
|
+
commercial: true,
|
|
719
|
+
relabel: true,
|
|
720
|
+
},
|
|
721
|
+
providerTerms: "Perplexity API Terms of Service, via Vercel AI Gateway (as of 2026-11-15)",
|
|
722
|
+
providerTermsAsOf: "2026-11-15",
|
|
723
|
+
},
|
|
724
|
+
// Prompt compilation for plan (the planning role) and material QA: the vision model.
|
|
725
|
+
compiler: {
|
|
726
|
+
model: "google/gemini-3-flash",
|
|
727
|
+
estimatedCostUsd: 0.02,
|
|
728
|
+
outputGrant: googleGrant,
|
|
729
|
+
providerTerms: googleTerms,
|
|
730
|
+
providerTermsAsOf: googleTermsAsOf,
|
|
731
|
+
},
|
|
732
|
+
"material-qa": {
|
|
733
|
+
model: "google/gemini-3-flash",
|
|
734
|
+
estimatedCostUsd: 0.02,
|
|
735
|
+
outputGrant: googleGrant,
|
|
736
|
+
providerTerms: googleTerms,
|
|
737
|
+
providerTermsAsOf: googleTermsAsOf,
|
|
738
|
+
},
|
|
739
|
+
// Audio (docs/PRD-audio.md): Stability's default, served by the Stability adapter.
|
|
740
|
+
[AUDIO_OPERATION]: stableAudio25Route,
|
|
741
|
+
};
|
|
742
|
+
/** The 3D operations, served by Tripo; every other core default is a gateway route. */
|
|
743
|
+
const MODEL3D_OPERATIONS = new Set(["model3d", "rig3d", "clips3d"]);
|
|
744
|
+
function pick(keep) {
|
|
745
|
+
return Object.fromEntries(Object.entries(defaultRoutes).filter(([op]) => keep(op)));
|
|
746
|
+
}
|
|
747
|
+
/** The gateway adapter's default routes: the 2D operations of the core defaults. */
|
|
748
|
+
export const GATEWAY_DEFAULT_ROUTES = pick((op) => !MODEL3D_OPERATIONS.has(op) && op !== AUDIO_OPERATION);
|
|
749
|
+
/** The Tripo adapter's default routes: the 3D operations of the core defaults. */
|
|
750
|
+
export const TRIPO_DEFAULT_ROUTES = pick((op) => MODEL3D_OPERATIONS.has(op));
|
|
751
|
+
/** The role each operation maps to (design section 12). */
|
|
752
|
+
export const OPERATION_ROLES = {
|
|
753
|
+
still: "image",
|
|
754
|
+
sheet: "image",
|
|
755
|
+
edit: "edit",
|
|
756
|
+
[LOOKDEV_OPERATION]: "edit",
|
|
757
|
+
[TURNAROUND_OPERATION]: "edit",
|
|
758
|
+
fix: "edit",
|
|
759
|
+
vision: "vision",
|
|
760
|
+
[LOOKDEV_LOCATE_OPERATION]: "vision",
|
|
761
|
+
[LOOKDEV_GROOM_OPERATION]: "vision",
|
|
762
|
+
[LOOKDEV_MARKINGS_OPERATION]: "vision",
|
|
763
|
+
[IDENTITY_CAST_OPERATION]: "vision",
|
|
764
|
+
[IDENTITY_CHECK_OPERATION]: "vision",
|
|
765
|
+
"material-qa": "vision",
|
|
766
|
+
identity: "decisions",
|
|
767
|
+
flicker: "decisions",
|
|
768
|
+
holes: "decisions",
|
|
769
|
+
"fix-scale": "decisions",
|
|
770
|
+
[PROMPT_POLICY_OPERATION]: "decisions",
|
|
771
|
+
[BRIEF_POLICY_OPERATION]: "decisions",
|
|
772
|
+
[REFERENCE_VIEW_OPERATION]: "decisions",
|
|
773
|
+
[MODEL3D_FACING_OPERATION]: "decisions",
|
|
774
|
+
[LOOKDEV_MARKING_OPERATION]: "decisions",
|
|
775
|
+
[STALENESS_OPERATION]: "decisions",
|
|
776
|
+
[MOTION_TEMPLATE_OPERATION]: "decisions",
|
|
777
|
+
[STYLE_OUTLIER_OPERATION]: "decisions",
|
|
778
|
+
[CUTOUT_OPERATION]: "decisions",
|
|
779
|
+
[SHEET_BLOB_OPERATION]: "decisions",
|
|
780
|
+
[STYLE_VERDICT_OPERATION]: "decisions",
|
|
781
|
+
[BRIEF_CLAMP_OPERATION]: "decisions",
|
|
782
|
+
[UI_ASSET_OPERATION]: "decisions",
|
|
783
|
+
[MAP_FLICKER_OPERATION]: "decisions",
|
|
784
|
+
[CLIP_MAP_OPERATION]: "decisions",
|
|
785
|
+
[TURNAROUND_SUBJECT_OPERATION]: "decisions",
|
|
786
|
+
compiler: "planning",
|
|
787
|
+
model3d: "model3d",
|
|
788
|
+
rig3d: "rig3d",
|
|
789
|
+
clips3d: "clips3d",
|
|
790
|
+
[EMBED_OPERATION]: "embeddings",
|
|
791
|
+
[AUDIO_OPERATION]: "audio",
|
|
792
|
+
};
|
|
793
|
+
/** The adapter capability each role needs. */
|
|
794
|
+
export const ROLE_CAPABILITY = {
|
|
795
|
+
image: "image",
|
|
796
|
+
edit: "edit",
|
|
797
|
+
vision: "vision",
|
|
798
|
+
decisions: "decide",
|
|
799
|
+
planning: "vision",
|
|
800
|
+
model3d: "model",
|
|
801
|
+
rig3d: "rig",
|
|
802
|
+
clips3d: "animate",
|
|
803
|
+
embeddings: "embed",
|
|
804
|
+
audio: "audio",
|
|
805
|
+
};
|
|
806
|
+
/**
|
|
807
|
+
* The core operation whose default route serves a role's operations that have no default of their
|
|
808
|
+
* own: a kind's `pixel:still` (role image) starts from the default of `still`.
|
|
809
|
+
*/
|
|
810
|
+
export const ROLE_DEFAULT_OPERATION = {
|
|
811
|
+
image: "still",
|
|
812
|
+
edit: "edit",
|
|
813
|
+
vision: "vision",
|
|
814
|
+
decisions: "identity",
|
|
815
|
+
planning: "compiler",
|
|
816
|
+
model3d: "model3d",
|
|
817
|
+
rig3d: "rig3d",
|
|
818
|
+
clips3d: "clips3d",
|
|
819
|
+
embeddings: EMBED_OPERATION,
|
|
820
|
+
audio: AUDIO_OPERATION,
|
|
821
|
+
};
|
|
822
|
+
/**
|
|
823
|
+
* The role of an operation in `operations` (core's table by default, or core's plus the loaded
|
|
824
|
+
* kinds'); undefined for an operation outside it.
|
|
825
|
+
*/
|
|
826
|
+
export function roleOf(operation, operations = OPERATION_ROLES) {
|
|
827
|
+
return Object.hasOwn(operations, operation) ? operations[operation] : undefined;
|
|
828
|
+
}
|
|
829
|
+
/** The settings fields that route an operation: its route, then its role. */
|
|
830
|
+
export function routeFields(operation, operations = OPERATION_ROLES) {
|
|
831
|
+
const role = roleOf(operation, operations);
|
|
832
|
+
return [`routes.${operation}`, ...(role !== undefined ? [`roles.${role}`] : [])];
|
|
833
|
+
}
|
|
834
|
+
/** No configured provider serves an operation. Exit 2 `route_unavailable`, before any reservation. */
|
|
835
|
+
export class RouteUnavailableError extends Error {
|
|
836
|
+
code = "route_unavailable";
|
|
837
|
+
operation;
|
|
838
|
+
constructor(operation, message) {
|
|
839
|
+
super(message);
|
|
840
|
+
this.name = "RouteUnavailableError";
|
|
841
|
+
this.operation = operation;
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* More than one configured provider could serve an operation and no route or role picks one.
|
|
846
|
+
* Exit 2 `settings_invalid`: which provider serves it is the developer's choice, not an order.
|
|
847
|
+
*/
|
|
848
|
+
export class RouteAmbiguousError extends SettingsError {
|
|
849
|
+
operation;
|
|
850
|
+
candidates;
|
|
851
|
+
field;
|
|
852
|
+
constructor(operation, candidates, field) {
|
|
853
|
+
super(`settings.${field} is not set, and ${candidates.length} configured providers (${candidates.join(", ")}) could serve the ${operation} operation; set settings.${field} to the provider and model that should`);
|
|
854
|
+
this.name = "RouteAmbiguousError";
|
|
855
|
+
this.operation = operation;
|
|
856
|
+
this.candidates = candidates;
|
|
857
|
+
this.field = field;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
/** JSON with object keys sorted, so equal options compare equal whatever their key order. */
|
|
861
|
+
function sortedJson(value) {
|
|
862
|
+
return JSON.stringify(value, (_key, v) => v !== null && typeof v === "object" && !Array.isArray(v)
|
|
863
|
+
? Object.fromEntries(Object.entries(v).sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)))
|
|
864
|
+
: v);
|
|
865
|
+
}
|
|
866
|
+
/** The settable route fields an override sets, each a copy. */
|
|
867
|
+
function routeOptionsOf(override) {
|
|
868
|
+
const options = {};
|
|
869
|
+
for (const field of ROUTE_FIELDS) {
|
|
870
|
+
if (override[field] !== undefined)
|
|
871
|
+
options[field] = structuredClone(override[field]);
|
|
872
|
+
}
|
|
873
|
+
return options;
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* The settable fields a route has that differ from its provider's default route for the operation
|
|
877
|
+
* (compared as canonical JSON); undefined when none do, so a route on default options keys as before.
|
|
878
|
+
*/
|
|
879
|
+
function keyedRouteOptions(route, base) {
|
|
880
|
+
const keyed = {};
|
|
881
|
+
for (const field of ROUTE_FIELDS) {
|
|
882
|
+
const value = route[field];
|
|
883
|
+
if (value !== undefined && sortedJson(value) !== sortedJson(base?.[field])) {
|
|
884
|
+
keyed[field] = structuredClone(value);
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
return Object.keys(keyed).length > 0 ? keyed : undefined;
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* The adapter of the test stand-in. Its default routes mirror the core defaults, so it serves an
|
|
891
|
+
* operation only when no other configured provider has a default route for it.
|
|
892
|
+
*/
|
|
893
|
+
const STAND_IN_ADAPTER = "scripted";
|
|
894
|
+
/**
|
|
895
|
+
* The route of one operation: `settings.routes[op]` over `settings.roles[role]` over the default
|
|
896
|
+
* route of the one configured provider whose adapter lists the operation, the scripted stand-in
|
|
897
|
+
* serving only when no other does. When more than one provider could serve it and no route or role
|
|
898
|
+
* picks one, throws `RouteAmbiguousError` (`settings_invalid`) naming the field to set: no order of
|
|
899
|
+
* ids chooses. An override that names the default's provider and model (the default of the
|
|
900
|
+
* override's own provider) keeps the whole default route. One that changes either belongs to
|
|
901
|
+
* another (provider, model) pair, so it takes nothing from the default: it carries only its own `estimatedCostUsd`, `outputGrant` and `providerTerms`,
|
|
902
|
+
* and it must set `estimatedCostUsd` unless its provider is `free` or the scripted stand-in
|
|
903
|
+
* (`settings_invalid` otherwise). `providerOptions` follow the same rule: an override of the same
|
|
904
|
+
* pair that names them replaces the default's whole, one that names none keeps the default's; a
|
|
905
|
+
* changed pair carries only the ones it names. A route whose options differ from the default of its
|
|
906
|
+
* own provider also gets them as `keyedProviderOptions`. The settable route fields (`ROUTE_FIELDS`:
|
|
907
|
+
* `size`, `supportsSeed`, `forward`, `library`, `rigTypes`) follow the same rule field by field: one
|
|
908
|
+
* the override sets replaces the default's, one it leaves out is kept on the same pair and absent on
|
|
909
|
+
* a changed one; those that differ from the route's own default (the adapter's model route when the
|
|
910
|
+
* override names one, else the default of the route's own provider) are its `keyedRouteOptions`. Throws `RouteUnavailableError` when the result names no
|
|
911
|
+
* configured provider whose adapter has the role's capability.
|
|
912
|
+
*/
|
|
913
|
+
export function resolveRoute(settings, operation, providers, operations = OPERATION_ROLES) {
|
|
914
|
+
const role = roleOf(operation, operations);
|
|
915
|
+
const capability = role !== undefined ? ROLE_CAPABILITY[role] : undefined;
|
|
916
|
+
const fields = routeFields(operation, operations)
|
|
917
|
+
.map((f) => `settings.${f}`)
|
|
918
|
+
.join(" or ");
|
|
919
|
+
const what = `the ${operation} operation${role !== undefined ? ` (role ${role})` : ""}`;
|
|
920
|
+
// An operation of a kind, outside core's table, takes its role's default where its adapter has none of its own.
|
|
921
|
+
const defaultFor = (p) => p.adapter.defaultRoutes?.[operation] ??
|
|
922
|
+
(role !== undefined && !Object.hasOwn(OPERATION_ROLES, operation)
|
|
923
|
+
? p.adapter.defaultRoutes?.[ROLE_DEFAULT_OPERATION[role] ?? ""]
|
|
924
|
+
: undefined);
|
|
925
|
+
const candidates = providers
|
|
926
|
+
.filter((p) => p.adapter.id !== STAND_IN_ADAPTER && defaultFor(p))
|
|
927
|
+
.map((p) => p.id)
|
|
928
|
+
.sort();
|
|
929
|
+
const field = Object.hasOwn(settings.routes, operation)
|
|
930
|
+
? `routes.${operation}`
|
|
931
|
+
: role !== undefined && Object.hasOwn(settings.roles, role)
|
|
932
|
+
? `roles.${role}`
|
|
933
|
+
: undefined;
|
|
934
|
+
const override = field === undefined
|
|
935
|
+
? undefined
|
|
936
|
+
: field.startsWith("routes.")
|
|
937
|
+
? settings.routes[operation]
|
|
938
|
+
: settings.roles[role];
|
|
939
|
+
const defaultOf = (id) => {
|
|
940
|
+
const p = providers.find((q) => q.id === id);
|
|
941
|
+
const base = p !== undefined ? defaultFor(p) : undefined;
|
|
942
|
+
return p !== undefined && base !== undefined
|
|
943
|
+
? { ...structuredClone(base), provider: p.id }
|
|
944
|
+
: undefined;
|
|
945
|
+
};
|
|
946
|
+
let fallback;
|
|
947
|
+
/** The route's own default when it is an adapter's model route; else its provider's default. */
|
|
948
|
+
let keyBase;
|
|
949
|
+
if (override !== undefined) {
|
|
950
|
+
fallback = defaultOf(override.provider);
|
|
951
|
+
// A model the adapter knows beyond its default carries its own terms, grant and estimate.
|
|
952
|
+
const p = providers.find((q) => q.id === override.provider);
|
|
953
|
+
const known = fallback?.model === override.model ? undefined : p?.adapter.modelRoutes?.[override.model];
|
|
954
|
+
if (p !== undefined && known !== undefined) {
|
|
955
|
+
fallback = { ...structuredClone(known), provider: p.id };
|
|
956
|
+
keyBase = fallback;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
else if (candidates.length > 1) {
|
|
960
|
+
throw new RouteAmbiguousError(operation, candidates, role !== undefined ? `roles.${role}` : `routes.${operation}`);
|
|
961
|
+
}
|
|
962
|
+
else {
|
|
963
|
+
fallback = defaultOf(candidates[0] ?? providers.find((p) => defaultFor(p))?.id);
|
|
964
|
+
}
|
|
965
|
+
let route;
|
|
966
|
+
/** The settings field of an override that changes the pair and sets no estimate. */
|
|
967
|
+
let missingEstimate;
|
|
968
|
+
if (override !== undefined) {
|
|
969
|
+
const same = fallback?.provider === override.provider && fallback?.model === override.model;
|
|
970
|
+
if (same) {
|
|
971
|
+
// A date belongs to the terms text it was recorded for: new text without its own date
|
|
972
|
+
// drops the default's date rather than claiming it.
|
|
973
|
+
const { providerTermsAsOf: inheritedAsOf, ...base } = fallback;
|
|
974
|
+
const keepAsOf = override.providerTerms === undefined && inheritedAsOf !== undefined
|
|
975
|
+
? { providerTermsAsOf: inheritedAsOf }
|
|
976
|
+
: {};
|
|
977
|
+
route = {
|
|
978
|
+
...base,
|
|
979
|
+
...keepAsOf,
|
|
980
|
+
...(override.estimatedCostUsd !== undefined && {
|
|
981
|
+
estimatedCostUsd: override.estimatedCostUsd,
|
|
982
|
+
}),
|
|
983
|
+
...(override.outputGrant !== undefined && {
|
|
984
|
+
outputGrant: structuredClone(override.outputGrant),
|
|
985
|
+
}),
|
|
986
|
+
...(override.modelDeclarations !== undefined && {
|
|
987
|
+
modelDeclarations: structuredClone(override.modelDeclarations),
|
|
988
|
+
}),
|
|
989
|
+
...(override.providerTerms !== undefined && { providerTerms: override.providerTerms }),
|
|
990
|
+
...(override.providerTermsAsOf !== undefined && {
|
|
991
|
+
providerTermsAsOf: override.providerTermsAsOf,
|
|
992
|
+
}),
|
|
993
|
+
...(override.providerOptions !== undefined && {
|
|
994
|
+
providerOptions: structuredClone(override.providerOptions),
|
|
995
|
+
}),
|
|
996
|
+
...(override.trainingOptOut !== undefined && {
|
|
997
|
+
trainingOptOut: { ...override.trainingOptOut },
|
|
998
|
+
}),
|
|
999
|
+
...routeOptionsOf(override),
|
|
1000
|
+
};
|
|
1001
|
+
}
|
|
1002
|
+
else {
|
|
1003
|
+
missingEstimate = override.estimatedCostUsd === undefined ? field : undefined;
|
|
1004
|
+
route = {
|
|
1005
|
+
provider: override.provider,
|
|
1006
|
+
model: override.model,
|
|
1007
|
+
estimatedCostUsd: override.estimatedCostUsd ?? 0,
|
|
1008
|
+
...(override.outputGrant !== undefined && {
|
|
1009
|
+
outputGrant: structuredClone(override.outputGrant),
|
|
1010
|
+
}),
|
|
1011
|
+
...(override.modelDeclarations !== undefined && {
|
|
1012
|
+
modelDeclarations: structuredClone(override.modelDeclarations),
|
|
1013
|
+
}),
|
|
1014
|
+
...(override.providerTerms !== undefined && { providerTerms: override.providerTerms }),
|
|
1015
|
+
...(override.providerTermsAsOf !== undefined && {
|
|
1016
|
+
providerTermsAsOf: override.providerTermsAsOf,
|
|
1017
|
+
}),
|
|
1018
|
+
...(override.providerOptions !== undefined && {
|
|
1019
|
+
providerOptions: structuredClone(override.providerOptions),
|
|
1020
|
+
}),
|
|
1021
|
+
...(override.trainingOptOut !== undefined && {
|
|
1022
|
+
trainingOptOut: { ...override.trainingOptOut },
|
|
1023
|
+
}),
|
|
1024
|
+
...routeOptionsOf(override),
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
else if (fallback !== undefined) {
|
|
1029
|
+
route = fallback;
|
|
1030
|
+
}
|
|
1031
|
+
else {
|
|
1032
|
+
throw new RouteUnavailableError(operation, `route unavailable: no configured provider serves ${what}; set ${fields} in the developer settings to a configured provider${capability !== undefined ? ` whose adapter has the ${capability} capability` : ""}`);
|
|
1033
|
+
}
|
|
1034
|
+
if (route.providerOptions !== undefined) {
|
|
1035
|
+
const base = defaultOf(route.provider)?.providerOptions;
|
|
1036
|
+
if (base === undefined || sortedJson(route.providerOptions) !== sortedJson(base)) {
|
|
1037
|
+
route.keyedProviderOptions = structuredClone(route.providerOptions);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
// A model route's own fields are its defaults: only what the settings change from them is keyed.
|
|
1041
|
+
const keyed = keyedRouteOptions(route, keyBase !== undefined && keyBase.provider === route.provider && keyBase.model === route.model
|
|
1042
|
+
? keyBase
|
|
1043
|
+
: defaultOf(route.provider));
|
|
1044
|
+
if (keyed !== undefined)
|
|
1045
|
+
route.keyedRouteOptions = keyed;
|
|
1046
|
+
const provider = providers.find((p) => p.id === route.provider);
|
|
1047
|
+
if (provider === undefined) {
|
|
1048
|
+
throw new RouteUnavailableError(operation, `route unavailable: ${what} names provider "${route.provider}", which is not in the developer settings' providers`);
|
|
1049
|
+
}
|
|
1050
|
+
if (role === "audio") {
|
|
1051
|
+
const refused = REFUSED_AUDIO_ROUTES.find((r) => r.matches(route, provider.adapter.id));
|
|
1052
|
+
if (refused !== undefined)
|
|
1053
|
+
throw new RouteUnavailableError(operation, `route unavailable: ${what} names model "${route.model}" of provider "${provider.id}" (${provider.adapter.id} adapter), a refused audio route: ${refused.reason}`);
|
|
1054
|
+
}
|
|
1055
|
+
if (capability !== undefined && !provider.adapter.capabilities.includes(capability)) {
|
|
1056
|
+
throw new RouteUnavailableError(operation, `route unavailable: ${what} names provider "${provider.id}", whose ${provider.adapter.id} adapter has no ${capability} capability; set ${fields} in the developer settings to a provider that has it`);
|
|
1057
|
+
}
|
|
1058
|
+
if (capability === "embed" && provider.adapter.embedsModel?.(route.model) === false) {
|
|
1059
|
+
throw new RouteUnavailableError(operation, `route unavailable: ${what} names model "${route.model}" of provider "${provider.id}", which its ${provider.adapter.id} adapter cannot embed images and text with in one space; set ${fields} in the developer settings to a model that can`);
|
|
1060
|
+
}
|
|
1061
|
+
if (missingEstimate !== undefined &&
|
|
1062
|
+
provider.settings?.free !== true &&
|
|
1063
|
+
provider.adapter.id !== STAND_IN_ADAPTER) {
|
|
1064
|
+
throw new SettingsError(`settings.${missingEstimate} routes ${what} to provider "${route.provider}" and model "${route.model}", which is not that operation's default (provider, model) pair, and sets no estimatedCostUsd; set settings.${missingEstimate}.estimatedCostUsd to the most one call can cost, since every paid call reserves its estimate before it is made`);
|
|
1065
|
+
}
|
|
1066
|
+
return route;
|
|
1067
|
+
}
|
|
1068
|
+
/** Every operation the settings could route: the role table's and the settings' own routes. */
|
|
1069
|
+
export function knownOperations(settings, operations = OPERATION_ROLES) {
|
|
1070
|
+
return [...new Set([...Object.keys(operations), ...Object.keys(settings.routes)])];
|
|
1071
|
+
}
|
|
1072
|
+
/**
|
|
1073
|
+
* The routes of the settings, by operation. An operation no configured provider serves is absent,
|
|
1074
|
+
* and reading it throws its `RouteUnavailableError` (exit 2 `route_unavailable`), so a command
|
|
1075
|
+
* that plans a call on it stops before any reservation. An ambiguous operation is absent too, and
|
|
1076
|
+
* reading it throws `RouteAmbiguousError` (exit 2 `settings_invalid`).
|
|
1077
|
+
*/
|
|
1078
|
+
export function resolveRoutes(settings, providers, operations = OPERATION_ROLES) {
|
|
1079
|
+
const resolved = {};
|
|
1080
|
+
const unavailable = new Map();
|
|
1081
|
+
for (const operation of knownOperations(settings, operations)) {
|
|
1082
|
+
try {
|
|
1083
|
+
resolved[operation] = resolveRoute(settings, operation, providers, operations);
|
|
1084
|
+
}
|
|
1085
|
+
catch (error) {
|
|
1086
|
+
if (!(error instanceof RouteUnavailableError || error instanceof RouteAmbiguousError)) {
|
|
1087
|
+
throw error;
|
|
1088
|
+
}
|
|
1089
|
+
unavailable.set(operation, error);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
return new Proxy(resolved, {
|
|
1093
|
+
get(target, key, receiver) {
|
|
1094
|
+
if (typeof key === "string" && !Object.hasOwn(target, key)) {
|
|
1095
|
+
const error = unavailable.get(key);
|
|
1096
|
+
if (error instanceof RouteAmbiguousError) {
|
|
1097
|
+
throw new RouteAmbiguousError(error.operation, error.candidates, error.field);
|
|
1098
|
+
}
|
|
1099
|
+
if (error !== undefined)
|
|
1100
|
+
throw new RouteUnavailableError(error.operation, error.message);
|
|
1101
|
+
}
|
|
1102
|
+
return Reflect.get(target, key, receiver);
|
|
1103
|
+
},
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
const anthropicGrant = {
|
|
1107
|
+
license: "LicenseRef-anthropic-api",
|
|
1108
|
+
plan: "api",
|
|
1109
|
+
commercial: true,
|
|
1110
|
+
relabel: true,
|
|
1111
|
+
};
|
|
1112
|
+
const anthropicTerms = "Anthropic Commercial Terms of Service and Usage Policy (as of 2026-11-14)";
|
|
1113
|
+
const anthropicTermsAsOf = "2026-11-14";
|
|
1114
|
+
const openaiGrant = {
|
|
1115
|
+
license: "LicenseRef-openai-api",
|
|
1116
|
+
plan: "api",
|
|
1117
|
+
commercial: true,
|
|
1118
|
+
relabel: true,
|
|
1119
|
+
};
|
|
1120
|
+
const openaiTerms = "OpenAI Services Agreement and Usage Policies (as of 2026-11-14)";
|
|
1121
|
+
const openaiTermsAsOf = "2026-11-14";
|
|
1122
|
+
/**
|
|
1123
|
+
* A direct adapter's default routes: every operation of the core defaults whose role is in
|
|
1124
|
+
* `models`, on that role's model at that model's own estimate, with the adapter's grant and terms.
|
|
1125
|
+
* The size is the core default's for the same operation; provider options are the gateway's and
|
|
1126
|
+
* are not carried.
|
|
1127
|
+
*/
|
|
1128
|
+
function directRoutes(models, grant, terms, termsAsOf) {
|
|
1129
|
+
const routes = {};
|
|
1130
|
+
for (const [operation, route] of Object.entries(defaultRoutes)) {
|
|
1131
|
+
const role = roleOf(operation);
|
|
1132
|
+
const direct = role !== undefined ? models[role] : undefined;
|
|
1133
|
+
if (direct === undefined)
|
|
1134
|
+
continue;
|
|
1135
|
+
routes[operation] = {
|
|
1136
|
+
model: direct.model,
|
|
1137
|
+
estimatedCostUsd: direct.byOperation?.[operation] ?? direct.estimatedCostUsd,
|
|
1138
|
+
...(route.size !== undefined && { size: route.size }),
|
|
1139
|
+
outputGrant: { ...grant },
|
|
1140
|
+
providerTerms: terms,
|
|
1141
|
+
providerTermsAsOf: termsAsOf,
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
return routes;
|
|
1145
|
+
}
|
|
1146
|
+
/**
|
|
1147
|
+
* The anthropic adapter's default routes (design section 12): vision, decisions and planning.
|
|
1148
|
+
* Anthropic has no image models, so image and edit stay with another adapter.
|
|
1149
|
+
*/
|
|
1150
|
+
export const ANTHROPIC_DEFAULT_ROUTES = directRoutes({
|
|
1151
|
+
// Up to 16 images a call (identity-cast) at Sonnet's input price, with room for the answer.
|
|
1152
|
+
vision: { model: "claude-sonnet-5-5", estimatedCostUsd: 0.1 },
|
|
1153
|
+
planning: { model: "claude-sonnet-5-5", estimatedCostUsd: 0.1 },
|
|
1154
|
+
// Two images and a short structured answer at Haiku's price.
|
|
1155
|
+
decisions: { model: "claude-haiku-5-5", estimatedCostUsd: 0.01 },
|
|
1156
|
+
}, anthropicGrant, anthropicTerms, anthropicTermsAsOf);
|
|
1157
|
+
/** The openai adapter's default routes (design section 12): every 2D role. */
|
|
1158
|
+
export const OPENAI_DEFAULT_ROUTES = directRoutes({
|
|
1159
|
+
// gpt-image-2 with references: the bounds the gateway default sets for the same model.
|
|
1160
|
+
image: { model: "gpt-image-2", estimatedCostUsd: 0.25, byOperation: { sheet: 0.3 } },
|
|
1161
|
+
edit: { model: "gpt-image-2", estimatedCostUsd: 0.25 },
|
|
1162
|
+
// gpt-6.1-terra: the gateway default's bound for the same model, which covers 16 images.
|
|
1163
|
+
vision: { model: "gpt-6.1-terra", estimatedCostUsd: 0.02 },
|
|
1164
|
+
planning: { model: "gpt-6.1-terra", estimatedCostUsd: 0.02 },
|
|
1165
|
+
decisions: { model: "gpt-6.1-terra", estimatedCostUsd: 0.02 },
|
|
1166
|
+
}, openaiGrant, openaiTerms, openaiTermsAsOf);
|