@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,76 @@
|
|
|
1
|
+
import { providerFailure } from "./failure.js";
|
|
2
|
+
import { decideStructured, requestIdOf as requestId, userMessage } from "./structured.js";
|
|
3
|
+
/**
|
|
4
|
+
* Any OpenAI-compatible endpoint (a local image or chat server, or a hosted one), through the AI
|
|
5
|
+
* SDK's own OpenAI-compatible provider. Images through the images API, vision through chat
|
|
6
|
+
* completions, typed decisions through structured output. The endpoint reports no cost, so each
|
|
7
|
+
* call settles at its route's estimate.
|
|
8
|
+
*/
|
|
9
|
+
export class OpenAICompatibleProvider {
|
|
10
|
+
billing;
|
|
11
|
+
#options;
|
|
12
|
+
#client;
|
|
13
|
+
constructor(options) {
|
|
14
|
+
this.#options = {
|
|
15
|
+
name: "openai-compatible",
|
|
16
|
+
baseURL: options.baseURL,
|
|
17
|
+
supportsStructuredOutputs: true,
|
|
18
|
+
...(options.apiKey !== undefined && { apiKey: options.apiKey }),
|
|
19
|
+
};
|
|
20
|
+
this.billing = { ...options.billing, hosts: [new URL(options.baseURL).host] };
|
|
21
|
+
}
|
|
22
|
+
/** The SDK is imported on first use, so a process that never calls the endpoint never loads it. */
|
|
23
|
+
async #sdk() {
|
|
24
|
+
const [{ createOpenAICompatible }, ai] = await Promise.all([
|
|
25
|
+
import("@ai-sdk/openai-compatible"),
|
|
26
|
+
import("ai"),
|
|
27
|
+
]);
|
|
28
|
+
this.#client ??= createOpenAICompatible(this.#options);
|
|
29
|
+
return { client: this.#client, ai };
|
|
30
|
+
}
|
|
31
|
+
async #guard(label, call) {
|
|
32
|
+
try {
|
|
33
|
+
return await call();
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
throw providerFailure("openai-compatible", label, error);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async generateImage(req) {
|
|
40
|
+
const { client, ai } = await this.#sdk();
|
|
41
|
+
const result = await this.#guard("image", () => ai.generateImage({
|
|
42
|
+
model: client.imageModel(req.model),
|
|
43
|
+
// One request per reservation: an SDK retry would resend a paid call.
|
|
44
|
+
maxRetries: 0,
|
|
45
|
+
prompt: req.references.length === 0
|
|
46
|
+
? req.prompt
|
|
47
|
+
: { text: req.prompt, images: req.references.map((r) => r.bytes) },
|
|
48
|
+
...(req.size !== undefined && { size: req.size }),
|
|
49
|
+
...(req.seed !== undefined && { seed: req.seed }),
|
|
50
|
+
...(req.providerOptions !== undefined && {
|
|
51
|
+
providerOptions: req.providerOptions,
|
|
52
|
+
}),
|
|
53
|
+
}));
|
|
54
|
+
return {
|
|
55
|
+
images: result.images.map((i) => ({ mediaType: i.mediaType, bytes: i.uint8Array })),
|
|
56
|
+
...requestId(result.responses[0]?.headers?.["x-request-id"]),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
async analyzeImages(req) {
|
|
60
|
+
const { client, ai } = await this.#sdk();
|
|
61
|
+
const result = await this.#guard("vision", () => ai.generateText({
|
|
62
|
+
model: client.chatModel(req.model),
|
|
63
|
+
maxRetries: 0,
|
|
64
|
+
messages: userMessage(req.prompt, req.images),
|
|
65
|
+
...(req.providerOptions !== undefined && {
|
|
66
|
+
providerOptions: req.providerOptions,
|
|
67
|
+
}),
|
|
68
|
+
}));
|
|
69
|
+
return { text: result.text, ...requestId(result.response.id) };
|
|
70
|
+
}
|
|
71
|
+
/** A typed decision through structured output (src/gateway/structured.ts). */
|
|
72
|
+
async decide(req) {
|
|
73
|
+
const { client } = await this.#sdk();
|
|
74
|
+
return decideStructured("openai-compatible", client.chatModel(req.model), req, (label, call) => this.#guard(label, call));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Billing, DecisionRequest, DecisionResult, GenerationProvider, ImageRequest, ImageResult, VisionRequest, VisionResult } from "./provider.ts";
|
|
2
|
+
/** OpenAI's API, at the SDK's own path; settings may not change it. */
|
|
3
|
+
export declare const OPENAI_BASE_URL = "https://api.openai.com/v1";
|
|
4
|
+
/**
|
|
5
|
+
* Converts a mask in Assetgrove's convention (opaque, light pixels are the region) to OpenAI's:
|
|
6
|
+
* the region is transparent, which the model edits, and everything else is opaque.
|
|
7
|
+
*/
|
|
8
|
+
export declare function openAiMask(bytes: Uint8Array): Uint8Array;
|
|
9
|
+
/**
|
|
10
|
+
* OpenAI's API through the AI SDK's `@ai-sdk/openai` provider: images (with references, an edit)
|
|
11
|
+
* through the images API, vision and planning through the responses API, typed decisions through
|
|
12
|
+
* structured output. The key is passed with the fixed endpoint, so `OPENAI_BASE_URL` and
|
|
13
|
+
* `OPENAI_API_KEY` of the environment never apply on their own. An ordinary key reports no cost,
|
|
14
|
+
* so each call settles at its route's estimate. A quota 429 is `cap_refused` (src/gateway/failure.ts).
|
|
15
|
+
*/
|
|
16
|
+
export declare class OpenAIProvider implements GenerationProvider {
|
|
17
|
+
#private;
|
|
18
|
+
readonly billing: Billing;
|
|
19
|
+
constructor(options: {
|
|
20
|
+
apiKey: string | undefined;
|
|
21
|
+
keyEnv?: string;
|
|
22
|
+
billing: Omit<Billing, "hosts" | "readLimit">;
|
|
23
|
+
});
|
|
24
|
+
generateImage(req: ImageRequest): Promise<ImageResult>;
|
|
25
|
+
analyzeImages(req: VisionRequest): Promise<VisionResult>;
|
|
26
|
+
/** A typed decision through structured output (src/gateway/structured.ts). */
|
|
27
|
+
decide(req: DecisionRequest): Promise<DecisionResult>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { ProviderError } from "../errors.js";
|
|
2
|
+
import { providerFailure } from "./failure.js";
|
|
3
|
+
import { decodeImage, createRaster, encodePng, setPixel } from "../image/raster.js";
|
|
4
|
+
import { maskInside } from "../regions.js";
|
|
5
|
+
import { decideStructured, requestIdOf, userMessage } from "./structured.js";
|
|
6
|
+
/** OpenAI's API, at the SDK's own path; settings may not change it. */
|
|
7
|
+
export const OPENAI_BASE_URL = "https://api.openai.com/v1";
|
|
8
|
+
/**
|
|
9
|
+
* Converts a mask in Assetgrove's convention (opaque, light pixels are the region) to OpenAI's:
|
|
10
|
+
* the region is transparent, which the model edits, and everything else is opaque.
|
|
11
|
+
*/
|
|
12
|
+
export function openAiMask(bytes) {
|
|
13
|
+
const mask = decodeImage(bytes);
|
|
14
|
+
const out = createRaster(mask.width, mask.height);
|
|
15
|
+
for (let y = 0; y < mask.height; y++)
|
|
16
|
+
for (let x = 0; x < mask.width; x++)
|
|
17
|
+
setPixel(out, x, y, maskInside(mask, x, y) ? [0, 0, 0, 0] : [0, 0, 0, 255]);
|
|
18
|
+
return encodePng(out);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* OpenAI's API through the AI SDK's `@ai-sdk/openai` provider: images (with references, an edit)
|
|
22
|
+
* through the images API, vision and planning through the responses API, typed decisions through
|
|
23
|
+
* structured output. The key is passed with the fixed endpoint, so `OPENAI_BASE_URL` and
|
|
24
|
+
* `OPENAI_API_KEY` of the environment never apply on their own. An ordinary key reports no cost,
|
|
25
|
+
* so each call settles at its route's estimate. A quota 429 is `cap_refused` (src/gateway/failure.ts).
|
|
26
|
+
*/
|
|
27
|
+
export class OpenAIProvider {
|
|
28
|
+
billing;
|
|
29
|
+
#apiKey;
|
|
30
|
+
#client;
|
|
31
|
+
#keyEnv;
|
|
32
|
+
constructor(options) {
|
|
33
|
+
this.#keyEnv = options.keyEnv ?? "OPENAI_API_KEY";
|
|
34
|
+
this.#apiKey = options.apiKey !== "" ? options.apiKey : undefined;
|
|
35
|
+
this.billing = { ...options.billing, hosts: [new URL(OPENAI_BASE_URL).host] };
|
|
36
|
+
}
|
|
37
|
+
/** The SDK is imported on first use, so a process that never calls OpenAI never loads it. */
|
|
38
|
+
async #clientFor(label) {
|
|
39
|
+
if (this.#apiKey === undefined)
|
|
40
|
+
throw new ProviderError(`openai ${label}: ${this.#keyEnv} is not set; the OpenAI key must come from the environment`);
|
|
41
|
+
if (this.#client === undefined) {
|
|
42
|
+
const { createOpenAI } = await import("@ai-sdk/openai");
|
|
43
|
+
this.#client ??= createOpenAI({ apiKey: this.#apiKey, baseURL: OPENAI_BASE_URL });
|
|
44
|
+
}
|
|
45
|
+
return this.#client;
|
|
46
|
+
}
|
|
47
|
+
async #guard(label, call) {
|
|
48
|
+
try {
|
|
49
|
+
return await call();
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
throw providerFailure("openai", label, error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async generateImage(req) {
|
|
56
|
+
const model = (await this.#clientFor("image")).image(req.model);
|
|
57
|
+
const { generateImage } = await import("ai");
|
|
58
|
+
const result = await this.#guard("image", () => generateImage({
|
|
59
|
+
model,
|
|
60
|
+
// One request per reservation: an SDK retry would resend a paid call.
|
|
61
|
+
maxRetries: 0,
|
|
62
|
+
prompt: req.references.length === 0 && req.mask === undefined
|
|
63
|
+
? req.prompt
|
|
64
|
+
: {
|
|
65
|
+
text: req.prompt,
|
|
66
|
+
images: req.references.map((r) => r.bytes),
|
|
67
|
+
...(req.mask !== undefined && { mask: openAiMask(req.mask.bytes) }),
|
|
68
|
+
},
|
|
69
|
+
...(req.size !== undefined && { size: req.size }),
|
|
70
|
+
...(req.seed !== undefined && { seed: req.seed }),
|
|
71
|
+
...(req.providerOptions !== undefined && {
|
|
72
|
+
providerOptions: req.providerOptions,
|
|
73
|
+
}),
|
|
74
|
+
}));
|
|
75
|
+
return {
|
|
76
|
+
images: result.images.map((i) => ({ mediaType: i.mediaType, bytes: i.uint8Array })),
|
|
77
|
+
...requestIdOf(result.responses[0]?.headers?.["x-request-id"]),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
async analyzeImages(req) {
|
|
81
|
+
const model = (await this.#clientFor("vision"))(req.model);
|
|
82
|
+
const { generateText } = await import("ai");
|
|
83
|
+
const result = await this.#guard("vision", () => generateText({
|
|
84
|
+
model,
|
|
85
|
+
messages: userMessage(req.prompt, req.images),
|
|
86
|
+
maxRetries: 0,
|
|
87
|
+
...(req.providerOptions !== undefined && {
|
|
88
|
+
providerOptions: req.providerOptions,
|
|
89
|
+
}),
|
|
90
|
+
}));
|
|
91
|
+
return {
|
|
92
|
+
text: result.text,
|
|
93
|
+
...requestIdOf(result.response.headers?.["x-request-id"], result.response.id),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
/** A typed decision through structured output (src/gateway/structured.ts). */
|
|
97
|
+
async decide(req) {
|
|
98
|
+
const model = (await this.#clientFor("decide"))(req.model);
|
|
99
|
+
return decideStructured("openai", model, req, (label, call) => this.#guard(label, call), "x-request-id");
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The generation provider interface Assetgrove owns. The gateway adapter implements it; the
|
|
3
|
+
* scripted provider implements it for tests. No provider SDK type appears here.
|
|
4
|
+
*/
|
|
5
|
+
export interface ImageInput {
|
|
6
|
+
mediaType: string;
|
|
7
|
+
bytes: Uint8Array;
|
|
8
|
+
}
|
|
9
|
+
export interface ImageRequest {
|
|
10
|
+
model: string;
|
|
11
|
+
prompt: string;
|
|
12
|
+
/** Reference images; when present the model edits or follows them. */
|
|
13
|
+
references: ImageInput[];
|
|
14
|
+
/**
|
|
15
|
+
* A mask of the region to edit, in Assetgrove's region convention: opaque, light pixels are the
|
|
16
|
+
* region (src/regions.ts). Sent only to a provider whose adapter declares the `mask` capability.
|
|
17
|
+
*/
|
|
18
|
+
mask?: ImageInput;
|
|
19
|
+
size?: string;
|
|
20
|
+
seed?: number;
|
|
21
|
+
providerOptions?: Record<string, Record<string, unknown>>;
|
|
22
|
+
/**
|
|
23
|
+
* The typed per-call parameters the kind passed (src/call-parameters.ts), sent only to a
|
|
24
|
+
* provider whose adapter declares each in `parameters`; the adapter maps them to its API.
|
|
25
|
+
*/
|
|
26
|
+
output?: ImageOutputParameters;
|
|
27
|
+
}
|
|
28
|
+
/** The typed per-call parameters as a provider receives them; the palette with its bytes. */
|
|
29
|
+
export interface ImageOutputParameters {
|
|
30
|
+
size?: {
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
};
|
|
34
|
+
tiling?: {
|
|
35
|
+
x: boolean;
|
|
36
|
+
y: boolean;
|
|
37
|
+
};
|
|
38
|
+
palette?: {
|
|
39
|
+
path: string;
|
|
40
|
+
sha256: string;
|
|
41
|
+
bytes: Uint8Array;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface ProviderResult {
|
|
45
|
+
requestId: string;
|
|
46
|
+
/**
|
|
47
|
+
* `local` when the provider reported no request ID and the adapter generated one, so a
|
|
48
|
+
* fabricated ID is never mistaken for a traceable one. Absent means the provider reported it.
|
|
49
|
+
*/
|
|
50
|
+
requestIdSource?: "provider" | "local";
|
|
51
|
+
/** The cost the provider reported, in USD, when it reports one. */
|
|
52
|
+
costUsd?: number;
|
|
53
|
+
/** The seed the provider used, when it reports one. */
|
|
54
|
+
seed?: number;
|
|
55
|
+
/**
|
|
56
|
+
* The provider plan the account was on when it made this output, when the adapter reads it (an
|
|
57
|
+
* ElevenLabs tier). It replaces the route grant's `plan` in the call's record.
|
|
58
|
+
*/
|
|
59
|
+
plan?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface ImageResult extends ProviderResult {
|
|
62
|
+
images: ImageInput[];
|
|
63
|
+
}
|
|
64
|
+
export interface VisionRequest {
|
|
65
|
+
model: string;
|
|
66
|
+
prompt: string;
|
|
67
|
+
images: ImageInput[];
|
|
68
|
+
/** The route's provider options, passed to the provider as given. */
|
|
69
|
+
providerOptions?: Record<string, Record<string, unknown>>;
|
|
70
|
+
}
|
|
71
|
+
export interface VisionResult extends ProviderResult {
|
|
72
|
+
text: string;
|
|
73
|
+
}
|
|
74
|
+
/** The kind of provider call; a provider made of several adapters bills each kind to one of them. */
|
|
75
|
+
export type CallKind = "image" | "vision" | "decide" | "model" | "rig" | "animate" | "embed" | "audio";
|
|
76
|
+
/**
|
|
77
|
+
* One audio generation (design: docs/PRD-audio.md). The typed parameters are the closed set a kind
|
|
78
|
+
* may pass (src/audio-parameters.ts); `seed` is sent only on a route that has one. Every route is
|
|
79
|
+
* asked for WAV, and core refuses any other result at intake.
|
|
80
|
+
*/
|
|
81
|
+
export interface AudioRequest {
|
|
82
|
+
model: string;
|
|
83
|
+
prompt: string;
|
|
84
|
+
/** The requested duration in seconds; the provider chooses one when absent. */
|
|
85
|
+
durationS?: number;
|
|
86
|
+
seed?: number;
|
|
87
|
+
/** How closely the output follows the prompt, 0 to 1, where the provider has such a control. */
|
|
88
|
+
promptInfluence?: number;
|
|
89
|
+
providerOptions?: Record<string, Record<string, unknown>>;
|
|
90
|
+
}
|
|
91
|
+
export interface AudioResult extends ProviderResult {
|
|
92
|
+
/** The audio file, which core accepts only as WAV. */
|
|
93
|
+
audio: ImageInput;
|
|
94
|
+
}
|
|
95
|
+
/** The route a provider's account is checked for: the operation, its model and options. */
|
|
96
|
+
export interface AccountRoute {
|
|
97
|
+
operation: string;
|
|
98
|
+
model: string;
|
|
99
|
+
providerOptions?: Record<string, Record<string, unknown>>;
|
|
100
|
+
}
|
|
101
|
+
/** What a provider's account check read; spends nothing. */
|
|
102
|
+
export interface AccountReading {
|
|
103
|
+
/** The account's plan or tier, as the provider names it. */
|
|
104
|
+
plan: string;
|
|
105
|
+
/** Where the reading came from, for example `elevenlabs subscription`. */
|
|
106
|
+
source: string;
|
|
107
|
+
/**
|
|
108
|
+
* Why the plan does not allow the route (a free tier, a sample rate above the tier); absent when
|
|
109
|
+
* it does. Core refuses the route with it, exit 2 `route_unavailable`, before any reservation.
|
|
110
|
+
*/
|
|
111
|
+
refused?: string;
|
|
112
|
+
}
|
|
113
|
+
/** What the provider reports about the money its key can still spend. */
|
|
114
|
+
export interface LimitReading {
|
|
115
|
+
/** The balance the provider reports, in USD; absent when it cannot be priced. */
|
|
116
|
+
balanceUsd?: number;
|
|
117
|
+
/** The balance in the provider's own unit, when that is not USD (Tripo credits). */
|
|
118
|
+
balance?: number;
|
|
119
|
+
unit?: string;
|
|
120
|
+
/** Where the reading came from, for example `gateway credits`. */
|
|
121
|
+
source: string;
|
|
122
|
+
}
|
|
123
|
+
/** A declared limit at the provider, as settings hold it (`providers.<id>.limit`). */
|
|
124
|
+
export interface DeclaredLimit {
|
|
125
|
+
kind: string;
|
|
126
|
+
usd?: number;
|
|
127
|
+
period?: string;
|
|
128
|
+
acceptUnlimited?: boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* What a provider instance costs, declared by its adapter (src/providers/adapter.ts), never by a
|
|
132
|
+
* provider's name: the hosts it reaches, where a call's cost comes from (`settle`), whether it can
|
|
133
|
+
* be looked up later (`reconcile`), the limit the developer declared and how to read the
|
|
134
|
+
* provider's own balance. Whether its calls are paid is core's decision (`paid`).
|
|
135
|
+
*/
|
|
136
|
+
export interface Billing {
|
|
137
|
+
/** The adapter id, for example `vercel-ai-gateway`. */
|
|
138
|
+
adapter: string;
|
|
139
|
+
/** The settings id of the provider instance. */
|
|
140
|
+
providerId: string;
|
|
141
|
+
/**
|
|
142
|
+
* Decided by core, never by the adapter: `createProvider` replaces the adapter's value with
|
|
143
|
+
* `corePaid` (paid unless the settings entry is `free` on a loopback `baseURL`).
|
|
144
|
+
*/
|
|
145
|
+
paid: boolean;
|
|
146
|
+
/** The hosts its calls reach. */
|
|
147
|
+
hosts: string[];
|
|
148
|
+
/** The limit declared in settings, when one is. */
|
|
149
|
+
limit?: DeclaredLimit;
|
|
150
|
+
/** Reads the provider's balance; spends nothing. Absent where the provider offers no reading. */
|
|
151
|
+
readLimit?: () => Promise<LimitReading>;
|
|
152
|
+
/**
|
|
153
|
+
* Where a call's cost comes from when it settles: `reported`, the cost the provider reports in
|
|
154
|
+
* the result (`ProviderResult.costUsd`; the reservation when it reports none), or `declared`,
|
|
155
|
+
* the amount reserved: the route's estimate, which is the ceiling, or the provider's lower
|
|
156
|
+
* `estimate`.
|
|
157
|
+
*/
|
|
158
|
+
settle: "reported" | "declared";
|
|
159
|
+
/** Whether a call's cost can be looked up later by its request ID (`callCost`), or not at all. */
|
|
160
|
+
reconcile: "lookup" | "unavailable";
|
|
161
|
+
/**
|
|
162
|
+
* The provider's own cost of one call, in USD, by the request ID it returned; spends nothing.
|
|
163
|
+
* Undefined while the provider has not reported it yet (the lookup stays pending); null for an ID
|
|
164
|
+
* the provider can never look up. Present only where `reconcile` is `lookup`.
|
|
165
|
+
*/
|
|
166
|
+
callCost?: (requestId: string) => Promise<number | null | undefined>;
|
|
167
|
+
}
|
|
168
|
+
/** A queued job's state as its provider reports it. */
|
|
169
|
+
export type JobStatus = "queued" | "running" | "done" | "failed" | "unknown";
|
|
170
|
+
/**
|
|
171
|
+
* A call a provider serves as a queued job (design section 9). Core journals the job's key before
|
|
172
|
+
* `submit` and its handle right after, polls `status` and collects `result`, so a run that dies
|
|
173
|
+
* while the job runs adopts the same job when it resumes instead of paying for another.
|
|
174
|
+
*/
|
|
175
|
+
export interface JobProvider<Request, Result> {
|
|
176
|
+
/**
|
|
177
|
+
* True when submitting a key the provider already has returns that key's job rather than a new
|
|
178
|
+
* one: a resumed run whose journal lost the handle submits again with the same key.
|
|
179
|
+
*/
|
|
180
|
+
readonly dedupesByKey?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Whether this request is served as a job; every request of the kind when absent. A request it
|
|
183
|
+
* declines is one direct call (a provider whose models differ, such as Stable Audio 2.5 and 3.0).
|
|
184
|
+
*/
|
|
185
|
+
serves?(request: Request): boolean;
|
|
186
|
+
/** Submits the job and returns its handle. `key` names the attempt (run, call and attempt). */
|
|
187
|
+
submit(request: Request, options: {
|
|
188
|
+
key: string;
|
|
189
|
+
}): Promise<string>;
|
|
190
|
+
/** The job's state; spends nothing. */
|
|
191
|
+
status(handle: string): Promise<JobStatus>;
|
|
192
|
+
/** A finished job's result. Core passes the request the job was submitted with. */
|
|
193
|
+
result(handle: string, request: Request): Promise<Result>;
|
|
194
|
+
/** Cancels a job. Core does not call it: a stopped run leaves its job running and journaled. */
|
|
195
|
+
cancel?(handle: string): Promise<void>;
|
|
196
|
+
/** The handle of the job submitted with `key`, or undefined when the provider has none. */
|
|
197
|
+
find?(key: string): Promise<string | undefined>;
|
|
198
|
+
}
|
|
199
|
+
/** Each call kind's request and result. */
|
|
200
|
+
export interface CallTypes {
|
|
201
|
+
image: [ImageRequest, ImageResult];
|
|
202
|
+
vision: [VisionRequest, VisionResult];
|
|
203
|
+
decide: [DecisionRequest, DecisionResult];
|
|
204
|
+
embed: [EmbedRequest, EmbedResult];
|
|
205
|
+
model: [ModelRequest, ModelResult];
|
|
206
|
+
rig: [RigRequest, ModelResult];
|
|
207
|
+
animate: [AnimateRequest, ModelResult];
|
|
208
|
+
audio: [AudioRequest, AudioResult];
|
|
209
|
+
}
|
|
210
|
+
/** The call kinds a provider serves as jobs. */
|
|
211
|
+
export type ProviderJobs = {
|
|
212
|
+
[K in CallKind]?: JobProvider<CallTypes[K][0], CallTypes[K][1]>;
|
|
213
|
+
};
|
|
214
|
+
export interface GenerationProvider {
|
|
215
|
+
/** What its calls cost and where they go, from its adapter. */
|
|
216
|
+
readonly billing: Billing;
|
|
217
|
+
/**
|
|
218
|
+
* The typed per-call parameters it maps (src/call-parameters.ts), read when it is called
|
|
219
|
+
* directly rather than through a provider set (which reads its adapter's). None when absent.
|
|
220
|
+
*/
|
|
221
|
+
readonly parameters?: readonly ("size" | "tiling" | "palette")[];
|
|
222
|
+
/**
|
|
223
|
+
* The audio call parameters it maps (src/audio-parameters.ts), read when it is called directly
|
|
224
|
+
* rather than through a provider set (which reads its adapter's). None when absent.
|
|
225
|
+
*/
|
|
226
|
+
readonly audioParameters?: readonly ("durationS" | "seed" | "promptInfluence")[];
|
|
227
|
+
/** The kinds of call served as queued jobs; a kind not listed is one direct call. */
|
|
228
|
+
readonly jobs?: ProviderJobs;
|
|
229
|
+
/** The billing of one kind of call, for a provider made of several adapters. */
|
|
230
|
+
billingFor?(kind: CallKind): Billing;
|
|
231
|
+
/**
|
|
232
|
+
* What this call will cost, in USD; spends nothing. Core calls it after the spend is confirmed
|
|
233
|
+
* and before reserving, and reserves the lower of it and the route's estimate (the ceiling): it
|
|
234
|
+
* can only lower a reservation. An estimate above the ceiling refuses the call before any spend.
|
|
235
|
+
*/
|
|
236
|
+
estimate?(request: CallTypes[CallKind][0], kind: CallKind): number | Promise<number>;
|
|
237
|
+
generateImage(request: ImageRequest): Promise<ImageResult>;
|
|
238
|
+
analyzeImages(request: VisionRequest): Promise<VisionResult>;
|
|
239
|
+
/** A typed decision (Score, Boolean or Choice); providers without decision models leave it out. */
|
|
240
|
+
decide?(request: DecisionRequest): Promise<DecisionResult>;
|
|
241
|
+
/**
|
|
242
|
+
* One embedding: an image or a text, in the one vector space the model puts both in. Providers
|
|
243
|
+
* without the `embed` capability leave it out.
|
|
244
|
+
*/
|
|
245
|
+
embed?(request: EmbedRequest): Promise<EmbedResult>;
|
|
246
|
+
/** Image-to-3D: a textured model from reference images. Providers without 3D leave it out. */
|
|
247
|
+
generateModel?(request: ModelRequest): Promise<ModelResult>;
|
|
248
|
+
/** Rigs a model the provider made earlier (by its handle) for a gait. */
|
|
249
|
+
rigModel?(request: RigRequest): Promise<ModelResult>;
|
|
250
|
+
/**
|
|
251
|
+
* Retargets library clips onto a rigged model (by its handle). The result holds the requested
|
|
252
|
+
* clips' animations; Assetgrove sends one clip per call and reads no animation names.
|
|
253
|
+
*/
|
|
254
|
+
animateModel?(request: AnimateRequest): Promise<ModelResult>;
|
|
255
|
+
/** One audio generation. Providers without the `audio` capability leave it out. */
|
|
256
|
+
generateAudio?(request: AudioRequest): Promise<AudioResult>;
|
|
257
|
+
/**
|
|
258
|
+
* Reads the account's plan and checks that it allows the route (with no route: that it allows
|
|
259
|
+
* any of the adapter's calls); spends nothing. A refusal is a reading with `refused` set.
|
|
260
|
+
* Core calls it at plan and `doctor`; providers whose plan cannot limit a route leave it out.
|
|
261
|
+
*/
|
|
262
|
+
checkAccount?(route?: AccountRoute): Promise<AccountReading>;
|
|
263
|
+
}
|
|
264
|
+
export interface EmbedRequest {
|
|
265
|
+
model: string;
|
|
266
|
+
/** One image (encoded bytes) or one text. */
|
|
267
|
+
input: {
|
|
268
|
+
image: ImageInput;
|
|
269
|
+
} | {
|
|
270
|
+
text: string;
|
|
271
|
+
};
|
|
272
|
+
/** The vector width asked for. */
|
|
273
|
+
dimensions: number;
|
|
274
|
+
providerOptions?: Record<string, Record<string, unknown>>;
|
|
275
|
+
}
|
|
276
|
+
export interface EmbedResult extends ProviderResult {
|
|
277
|
+
vector: number[];
|
|
278
|
+
}
|
|
279
|
+
/** Reference views for image-to-3D, by the view each image shows. */
|
|
280
|
+
export interface ModelView extends ImageInput {
|
|
281
|
+
/**
|
|
282
|
+
* `front`, `left`, `back` or `right` (the character's own side), else `three-quarter`, `sheet`
|
|
283
|
+
* or `detail` (src/model3d/views.ts).
|
|
284
|
+
*/
|
|
285
|
+
view: string;
|
|
286
|
+
}
|
|
287
|
+
export interface ModelRequest {
|
|
288
|
+
model: string;
|
|
289
|
+
/** Reference images; with several named views the provider may build from all of them. */
|
|
290
|
+
views: ModelView[];
|
|
291
|
+
prompt?: string;
|
|
292
|
+
seed?: number;
|
|
293
|
+
/** The target's triangle budget; a provider that can limit its mesh should stay within it. */
|
|
294
|
+
maxTriangles?: number;
|
|
295
|
+
providerOptions?: Record<string, Record<string, unknown>>;
|
|
296
|
+
}
|
|
297
|
+
export interface RigRequest {
|
|
298
|
+
model: string;
|
|
299
|
+
/** The provider's handle of the model to rig. */
|
|
300
|
+
source: string;
|
|
301
|
+
/** The rig the provider fits, for example `quadruped` or `biped`. */
|
|
302
|
+
rigType: string;
|
|
303
|
+
providerOptions?: Record<string, Record<string, unknown>>;
|
|
304
|
+
}
|
|
305
|
+
export interface AnimateRequest {
|
|
306
|
+
model: string;
|
|
307
|
+
/** The provider's handle of the rigged model. */
|
|
308
|
+
source: string;
|
|
309
|
+
/** Library clip IDs; Assetgrove sends one per call so the result's animation is that clip's. */
|
|
310
|
+
clips: string[];
|
|
311
|
+
providerOptions?: Record<string, Record<string, unknown>>;
|
|
312
|
+
}
|
|
313
|
+
export interface ModelResult extends ProviderResult {
|
|
314
|
+
/** An opaque handle a later call (rig, animate) passes back to the same provider. */
|
|
315
|
+
handle: string;
|
|
316
|
+
/** The model as binary glTF. */
|
|
317
|
+
glb: Uint8Array;
|
|
318
|
+
/**
|
|
319
|
+
* For an animate call: the index, in `glb`, of each requested library clip's animation. An
|
|
320
|
+
* adapter that cannot tell leaves it out.
|
|
321
|
+
*/
|
|
322
|
+
animations?: Record<string, number>;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* A typed decision question. `score` asks for a position on ordered levels (indexed from zero);
|
|
326
|
+
* `boolean` asks for the probability that the statement is true; `choice` asks which one of the
|
|
327
|
+
* named options holds (each name with what it means).
|
|
328
|
+
*/
|
|
329
|
+
export type DecisionQuestion = {
|
|
330
|
+
type: "score";
|
|
331
|
+
instructions: string;
|
|
332
|
+
levels: string[];
|
|
333
|
+
} | {
|
|
334
|
+
type: "boolean";
|
|
335
|
+
instructions: string;
|
|
336
|
+
whenTrue?: string;
|
|
337
|
+
whenFalse?: string;
|
|
338
|
+
} | {
|
|
339
|
+
type: "choice";
|
|
340
|
+
instructions: string;
|
|
341
|
+
options: Record<string, string>;
|
|
342
|
+
};
|
|
343
|
+
export interface DecisionRequest {
|
|
344
|
+
model: string;
|
|
345
|
+
/** Text state given before the images. */
|
|
346
|
+
prompt: string;
|
|
347
|
+
/** Images, in the order the prompt names them. */
|
|
348
|
+
images: ImageInput[];
|
|
349
|
+
question: DecisionQuestion;
|
|
350
|
+
/** The operation the decision is for (`identity`, `prompt-policy`); adapters may ignore it. */
|
|
351
|
+
operation?: string;
|
|
352
|
+
}
|
|
353
|
+
export type DecisionAnswer = {
|
|
354
|
+
type: "score";
|
|
355
|
+
/** Fractional position in `[0, levels.length - 1]`. */
|
|
356
|
+
score: number;
|
|
357
|
+
/** Probability per level index, when the model reports a distribution. */
|
|
358
|
+
probabilities?: Record<string, number>;
|
|
359
|
+
} | {
|
|
360
|
+
type: "boolean";
|
|
361
|
+
/** The model's probability that the statement is true. */
|
|
362
|
+
probability: number;
|
|
363
|
+
} | {
|
|
364
|
+
type: "choice";
|
|
365
|
+
/** The option chosen: one of the question's option names. */
|
|
366
|
+
choice: string;
|
|
367
|
+
/** Probability per option name, when the model reports one. */
|
|
368
|
+
probabilities?: Record<string, number>;
|
|
369
|
+
};
|
|
370
|
+
export interface DecisionResult extends ProviderResult {
|
|
371
|
+
answer: DecisionAnswer;
|
|
372
|
+
/** The provider's own confidence statistic for the answer, when it reports one. */
|
|
373
|
+
confidence?: number;
|
|
374
|
+
/**
|
|
375
|
+
* How the answer was made: a decision model's typed answer (`decision-model`), or a chat model's
|
|
376
|
+
* answer constrained by structured output (`structured-output`).
|
|
377
|
+
*/
|
|
378
|
+
decisionSource?: DecisionSource;
|
|
379
|
+
}
|
|
380
|
+
export type DecisionSource = "decision-model" | "structured-output";
|