@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,252 @@
|
|
|
1
|
+
import type { AccountReading, AccountRoute, AnimateRequest, AudioRequest, AudioResult, Billing, CallKind, CallTypes, LimitReading, ModelRequest, ModelResult, RigRequest, DecisionRequest, DecisionResult, EmbedRequest, EmbedResult, GenerationProvider, ImageRequest, ImageResult, VisionRequest, VisionResult } from "./provider.ts";
|
|
2
|
+
/**
|
|
3
|
+
* A scripted generation provider for tests and offline runs. It never calls a model: each call is
|
|
4
|
+
* answered by the script, and every request is kept in `calls` so tests can inspect it.
|
|
5
|
+
*/
|
|
6
|
+
export interface Script {
|
|
7
|
+
image(request: ImageRequest, index: number): Omit<ImageResult, "requestId"> & {
|
|
8
|
+
requestId?: string;
|
|
9
|
+
};
|
|
10
|
+
vision(request: VisionRequest, index: number): Omit<VisionResult, "requestId"> & {
|
|
11
|
+
requestId?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Answers typed decision calls; a script without it cannot answer one. An answer of the wrong
|
|
15
|
+
* type, or a choice that is not one of the question's options, is refused naming the operation.
|
|
16
|
+
*/
|
|
17
|
+
decide?(request: DecisionRequest, index: number): Omit<DecisionResult, "requestId"> & {
|
|
18
|
+
requestId?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Answers the prompt policy's model check (the `prompt-policy` decision). A script without it
|
|
22
|
+
* allows every prompt (probability 0); its calls do not count toward `decide`'s index.
|
|
23
|
+
*/
|
|
24
|
+
promptPolicy?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
25
|
+
requestId?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Answers the prompt policy's reading of an ambiguous name (a `prompt-policy` Choice decision:
|
|
29
|
+
* `protected`, `word` or `other-name`; `nameReadingAsked` gives the term). A script without it
|
|
30
|
+
* reads every such name as an ordinary word.
|
|
31
|
+
*/
|
|
32
|
+
promptReading?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
33
|
+
requestId?: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Answers whether a turnaround candidate's views show its subject alone (the
|
|
37
|
+
* `turnaround-subject` choice decision). A script without it answers `alone`; its calls do not
|
|
38
|
+
* count toward `decide`'s index.
|
|
39
|
+
*/
|
|
40
|
+
turnaroundSubject?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
41
|
+
requestId?: string;
|
|
42
|
+
};
|
|
43
|
+
/** Answers embedding calls (images and text in one space); a script without it cannot answer one. */
|
|
44
|
+
embed?(request: EmbedRequest, index: number): Scripted<EmbedResult>;
|
|
45
|
+
/**
|
|
46
|
+
* Answers the brief policy's model check (the `brief-policy` decisions; `briefPolicyAsked` in
|
|
47
|
+
* src/policy/brief.ts reads the field and target from the prompt). A script without it finds
|
|
48
|
+
* no departure (probability 0); its calls do not count toward `decide`'s index.
|
|
49
|
+
*/
|
|
50
|
+
briefPolicy?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
51
|
+
requestId?: string;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Answers which view a 3D request's reference shows (the `reference-view` choice decision). A
|
|
55
|
+
* script without it answers those from `decide`; its calls do not count toward `decide`'s index.
|
|
56
|
+
*/
|
|
57
|
+
referenceView?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
58
|
+
requestId?: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Answers which way a generated 3D model faces (the `model3d-facing` choice decision). A script
|
|
62
|
+
* without it answers those from `decide`; its calls do not count toward `decide`'s index.
|
|
63
|
+
*/
|
|
64
|
+
facing?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
65
|
+
requestId?: string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Answers whether a look-dev marking is kept (the `lookdev-marking` choice decision). A script
|
|
69
|
+
* without it answers those from `decide`; its calls do not count toward `decide`'s index.
|
|
70
|
+
*/
|
|
71
|
+
marking?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
72
|
+
requestId?: string;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Answers which motion template describes an animation family (the `motion-template` choice
|
|
76
|
+
* decision). A script without it refuses the call; its calls do not count toward `decide`'s index.
|
|
77
|
+
*/
|
|
78
|
+
motionTemplate?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
79
|
+
requestId?: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Answers whether a set member is drawn in a different style (the `style-outlier` Boolean
|
|
83
|
+
* decision). A script without it answers those from `decide`, and one with neither answers
|
|
84
|
+
* "same style" (probability 0); its calls do not count toward `decide`'s index.
|
|
85
|
+
*/
|
|
86
|
+
styleOutlier?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
87
|
+
requestId?: string;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Answers whether stage's cut-out lost part of the subject or kept background (the `cutout`
|
|
91
|
+
* Boolean decision). A script without it answers no (probability 0); its calls do not count
|
|
92
|
+
* toward `decide`'s index.
|
|
93
|
+
*/
|
|
94
|
+
cutout?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
95
|
+
requestId?: string;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Answers what an ambiguous blob on a sheet is (the `sheet-blob` choice decision: figure, part,
|
|
99
|
+
* label or speck). A script without it answers label, the area rule's drop; its calls do not
|
|
100
|
+
* count toward `decide`'s index.
|
|
101
|
+
*/
|
|
102
|
+
sheetBlob?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
103
|
+
requestId?: string;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Answers whether a planned run's candidate violates the constitution or asset spec (the
|
|
107
|
+
* `style-verdict` decisions). A script without it finds no violation (probability 0); its calls
|
|
108
|
+
* do not count toward `decide`'s index.
|
|
109
|
+
*/
|
|
110
|
+
styleVerdict?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
111
|
+
requestId?: string;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Answers which allowed mood or adjustment value is closest to a brief's out-of-bounds one (the
|
|
115
|
+
* `brief-clamp` choice decisions). A script without it falls through to `decide`.
|
|
116
|
+
*/
|
|
117
|
+
briefClamp?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
118
|
+
requestId?: string;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Answers whether an asset is part of the game's user interface (the `ui-asset` decisions). A
|
|
122
|
+
* script without it answers probability 0 (not UI); its calls do not count toward `decide`'s index.
|
|
123
|
+
*/
|
|
124
|
+
uiAsset?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
125
|
+
requestId?: string;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Answers whether a material map flickers between two frames (the `map-flicker` choice decision:
|
|
129
|
+
* same, follows-pose or flickers). A script without it answers flickers, the pixel rule's fail;
|
|
130
|
+
* its calls do not count toward `decide`'s index.
|
|
131
|
+
*/
|
|
132
|
+
mapFlicker?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
133
|
+
requestId?: string;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Answers which library clip a requested animation family is (the `clip-map` choice decision: a
|
|
137
|
+
* library clip key or none). A script without it answers none; its calls do not count toward
|
|
138
|
+
* `decide`'s index.
|
|
139
|
+
*/
|
|
140
|
+
clipMap?(request: DecisionRequest): Omit<DecisionResult, "requestId"> & {
|
|
141
|
+
requestId?: string;
|
|
142
|
+
};
|
|
143
|
+
/** Answers image-to-3D calls; a script without it cannot answer one. */
|
|
144
|
+
model?(request: ModelRequest, index: number): Scripted<ModelResult>;
|
|
145
|
+
/** Answers rig calls. */
|
|
146
|
+
rig?(request: RigRequest, index: number): Scripted<ModelResult>;
|
|
147
|
+
/** Answers clip retargeting calls. */
|
|
148
|
+
animate?(request: AnimateRequest, index: number): Scripted<ModelResult>;
|
|
149
|
+
/** Answers audio calls; a script without it cannot answer one. */
|
|
150
|
+
audio?(request: AudioRequest, index: number): Scripted<AudioResult>;
|
|
151
|
+
/** Test only: the account check a real adapter makes (`GenerationProvider.checkAccount`). */
|
|
152
|
+
account?(route?: AccountRoute): AccountReading | Promise<AccountReading>;
|
|
153
|
+
/**
|
|
154
|
+
* Test only: the scripted adapter marks the provider paid, so its calls count in the spend
|
|
155
|
+
* ledger and need a declared limit, and tests can prove the limits offline.
|
|
156
|
+
*/
|
|
157
|
+
paid?: boolean;
|
|
158
|
+
/**
|
|
159
|
+
* Test only: narrows the capabilities the scripted adapter declares for this module (for example,
|
|
160
|
+
* without `mask`).
|
|
161
|
+
*/
|
|
162
|
+
capabilities?: string[];
|
|
163
|
+
/** Test only: the provider's limit reading, as a real adapter reads its balance. */
|
|
164
|
+
limitReading?(): LimitReading | Promise<LimitReading>;
|
|
165
|
+
/** Test only: where a call's cost comes from when it settles, as a real adapter declares it. */
|
|
166
|
+
settle?: Billing["settle"];
|
|
167
|
+
/** Test only: whether a call's cost can be looked up later, as a real adapter declares it. */
|
|
168
|
+
reconcile?: Billing["reconcile"];
|
|
169
|
+
/** Test only: the provider's own estimate of a call (`GenerationProvider.estimate`). */
|
|
170
|
+
estimate?(request: CallTypes[CallKind][0], kind: CallKind): number | Promise<number>;
|
|
171
|
+
/**
|
|
172
|
+
* Test only: the provider's own cost of a call by its request ID, as the gateway reports it;
|
|
173
|
+
* undefined while it is not reported yet.
|
|
174
|
+
*/
|
|
175
|
+
callCost?(requestId: string): number | null | undefined | Promise<number | null | undefined>;
|
|
176
|
+
}
|
|
177
|
+
type Scripted<T extends {
|
|
178
|
+
requestId: string;
|
|
179
|
+
}> = Omit<T, "requestId"> & {
|
|
180
|
+
requestId?: string;
|
|
181
|
+
};
|
|
182
|
+
export declare class ScriptedProvider implements GenerationProvider {
|
|
183
|
+
readonly billing: Billing;
|
|
184
|
+
/** It records every typed parameter it is sent, so it declares them all. */
|
|
185
|
+
readonly parameters: readonly ["size", "tiling", "palette"];
|
|
186
|
+
readonly audioParameters: readonly ["durationS", "seed", "promptInfluence"];
|
|
187
|
+
/** The script's own `account`, when it has one. */
|
|
188
|
+
readonly checkAccount?: (route?: AccountRoute) => Promise<AccountReading>;
|
|
189
|
+
/** The script's own `estimate`, when it has one. */
|
|
190
|
+
readonly estimate?: (request: CallTypes[CallKind][0], kind: CallKind) => Promise<number>;
|
|
191
|
+
readonly calls: Array<{
|
|
192
|
+
kind: "image";
|
|
193
|
+
request: ImageRequest;
|
|
194
|
+
} | {
|
|
195
|
+
kind: "vision";
|
|
196
|
+
request: VisionRequest;
|
|
197
|
+
} | {
|
|
198
|
+
kind: "decide";
|
|
199
|
+
request: DecisionRequest;
|
|
200
|
+
} | {
|
|
201
|
+
kind: "model";
|
|
202
|
+
request: ModelRequest;
|
|
203
|
+
} | {
|
|
204
|
+
kind: "rig";
|
|
205
|
+
request: RigRequest;
|
|
206
|
+
} | {
|
|
207
|
+
kind: "animate";
|
|
208
|
+
request: AnimateRequest;
|
|
209
|
+
} | {
|
|
210
|
+
kind: "embed";
|
|
211
|
+
request: EmbedRequest;
|
|
212
|
+
} | {
|
|
213
|
+
kind: "audio";
|
|
214
|
+
request: AudioRequest;
|
|
215
|
+
}>;
|
|
216
|
+
private audioCount;
|
|
217
|
+
private embedCount;
|
|
218
|
+
private modelCount;
|
|
219
|
+
private rigCount;
|
|
220
|
+
private animateCount;
|
|
221
|
+
private readonly script;
|
|
222
|
+
private imageCount;
|
|
223
|
+
private visionCount;
|
|
224
|
+
private decideCount;
|
|
225
|
+
private styleOutlierCount;
|
|
226
|
+
private policyCount;
|
|
227
|
+
private briefPolicyCount;
|
|
228
|
+
private viewCount;
|
|
229
|
+
private facingCount;
|
|
230
|
+
private markingCount;
|
|
231
|
+
private templateCount;
|
|
232
|
+
private turnaroundSubjectCount;
|
|
233
|
+
private cutoutCount;
|
|
234
|
+
private sheetBlobCount;
|
|
235
|
+
private verdictCount;
|
|
236
|
+
private clampCount;
|
|
237
|
+
private uiCount;
|
|
238
|
+
private mapFlickerCount;
|
|
239
|
+
private clipMapCount;
|
|
240
|
+
/** Free unless the script sets `paid`; `billing` overrides the descriptor's other fields. */
|
|
241
|
+
constructor(script: Script, billing?: Partial<Omit<Billing, "paid">>);
|
|
242
|
+
declares(capability: string): boolean;
|
|
243
|
+
generateImage(request: ImageRequest): Promise<ImageResult>;
|
|
244
|
+
analyzeImages(request: VisionRequest): Promise<VisionResult>;
|
|
245
|
+
decide(request: DecisionRequest): Promise<DecisionResult>;
|
|
246
|
+
embed(request: EmbedRequest): Promise<EmbedResult>;
|
|
247
|
+
generateModel(request: ModelRequest): Promise<ModelResult>;
|
|
248
|
+
rigModel(request: RigRequest): Promise<ModelResult>;
|
|
249
|
+
animateModel(request: AnimateRequest): Promise<ModelResult>;
|
|
250
|
+
generateAudio(request: AudioRequest): Promise<AudioResult>;
|
|
251
|
+
}
|
|
252
|
+
export {};
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { AUDIO_PARAMETERS } from "../audio-parameters.js";
|
|
2
|
+
import { CALL_PARAMETERS } from "../call-parameters.js";
|
|
3
|
+
import { BRIEF_POLICY_OPERATION, CUTOUT_OPERATION, SHEET_BLOB_OPERATION, TURNAROUND_SUBJECT_OPERATION, LOOKDEV_MARKING_OPERATION, MODEL3D_FACING_OPERATION, PROMPT_POLICY_OPERATION, MOTION_TEMPLATE_OPERATION, STYLE_VERDICT_OPERATION, BRIEF_CLAMP_OPERATION, UI_ASSET_OPERATION, MAP_FLICKER_OPERATION, CLIP_MAP_OPERATION, REFERENCE_VIEW_OPERATION, STYLE_OUTLIER_OPERATION, } from "../routes.js";
|
|
4
|
+
function checkDecideAnswer(request, answer) {
|
|
5
|
+
const { question } = request;
|
|
6
|
+
const head = `the provider script's decide() answered the ${request.operation ?? "(no operation)"} ${question.type} question`;
|
|
7
|
+
const tail = " (docs/generation-knobs.md lists every decision a provider script answers)";
|
|
8
|
+
const options = question.type === "choice" ? Object.keys(question.options).join(", ") : "";
|
|
9
|
+
if (answer?.type !== question.type) {
|
|
10
|
+
const offered = question.type === "choice" ? `; its options: ${options}` : "";
|
|
11
|
+
throw new Error(`${head} with ${answer ? `a ${answer.type} answer` : "no answer"}, not a ${question.type} answer${offered}${tail}`);
|
|
12
|
+
}
|
|
13
|
+
if (question.type === "choice" &&
|
|
14
|
+
answer.type === "choice" &&
|
|
15
|
+
!Object.hasOwn(question.options, answer.choice)) {
|
|
16
|
+
throw new Error(`${head} with a choice "${answer.choice}", not one of its options: ${options}${tail}`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export class ScriptedProvider {
|
|
20
|
+
billing;
|
|
21
|
+
/** It records every typed parameter it is sent, so it declares them all. */
|
|
22
|
+
parameters = CALL_PARAMETERS;
|
|
23
|
+
audioParameters = AUDIO_PARAMETERS;
|
|
24
|
+
/** The script's own `account`, when it has one. */
|
|
25
|
+
checkAccount;
|
|
26
|
+
/** The script's own `estimate`, when it has one. */
|
|
27
|
+
estimate;
|
|
28
|
+
calls = [];
|
|
29
|
+
audioCount = 0;
|
|
30
|
+
embedCount = 0;
|
|
31
|
+
modelCount = 0;
|
|
32
|
+
rigCount = 0;
|
|
33
|
+
animateCount = 0;
|
|
34
|
+
script;
|
|
35
|
+
imageCount = 0;
|
|
36
|
+
visionCount = 0;
|
|
37
|
+
decideCount = 0;
|
|
38
|
+
styleOutlierCount = 0;
|
|
39
|
+
policyCount = 0;
|
|
40
|
+
briefPolicyCount = 0;
|
|
41
|
+
viewCount = 0;
|
|
42
|
+
facingCount = 0;
|
|
43
|
+
markingCount = 0;
|
|
44
|
+
templateCount = 0;
|
|
45
|
+
turnaroundSubjectCount = 0;
|
|
46
|
+
cutoutCount = 0;
|
|
47
|
+
sheetBlobCount = 0;
|
|
48
|
+
verdictCount = 0;
|
|
49
|
+
clampCount = 0;
|
|
50
|
+
uiCount = 0;
|
|
51
|
+
mapFlickerCount = 0;
|
|
52
|
+
clipMapCount = 0;
|
|
53
|
+
/** Free unless the script sets `paid`; `billing` overrides the descriptor's other fields. */
|
|
54
|
+
constructor(script, billing) {
|
|
55
|
+
this.script = script;
|
|
56
|
+
const read = script.limitReading?.bind(script);
|
|
57
|
+
const cost = script.callCost?.bind(script);
|
|
58
|
+
this.billing = {
|
|
59
|
+
adapter: "scripted",
|
|
60
|
+
providerId: "scripted",
|
|
61
|
+
hosts: [],
|
|
62
|
+
settle: "reported",
|
|
63
|
+
reconcile: "unavailable",
|
|
64
|
+
...billing,
|
|
65
|
+
paid: script.paid === true,
|
|
66
|
+
...(script.settle !== undefined && { settle: script.settle }),
|
|
67
|
+
...(script.reconcile !== undefined && { reconcile: script.reconcile }),
|
|
68
|
+
...(read !== undefined && { readLimit: async () => read() }),
|
|
69
|
+
...(cost !== undefined && { callCost: async (requestId) => cost(requestId) }),
|
|
70
|
+
};
|
|
71
|
+
const estimate = script.estimate?.bind(script);
|
|
72
|
+
if (estimate !== undefined)
|
|
73
|
+
this.estimate = async (request, kind) => estimate(request, kind);
|
|
74
|
+
const account = script.account?.bind(script);
|
|
75
|
+
if (account !== undefined)
|
|
76
|
+
this.checkAccount = async (route) => account(route);
|
|
77
|
+
}
|
|
78
|
+
declares(capability) {
|
|
79
|
+
return this.script.capabilities?.includes(capability) ?? true;
|
|
80
|
+
}
|
|
81
|
+
async generateImage(request) {
|
|
82
|
+
this.calls.push({ kind: "image", request });
|
|
83
|
+
const index = this.imageCount++;
|
|
84
|
+
const result = this.script.image(request, index);
|
|
85
|
+
return { requestId: `scripted-image-${index}`, ...result };
|
|
86
|
+
}
|
|
87
|
+
async analyzeImages(request) {
|
|
88
|
+
this.calls.push({ kind: "vision", request });
|
|
89
|
+
const index = this.visionCount++;
|
|
90
|
+
const result = this.script.vision(request, index);
|
|
91
|
+
return { requestId: `scripted-vision-${index}`, ...result };
|
|
92
|
+
}
|
|
93
|
+
async decide(request) {
|
|
94
|
+
this.calls.push({ kind: "decide", request });
|
|
95
|
+
if (request.operation === PROMPT_POLICY_OPERATION) {
|
|
96
|
+
const index = this.policyCount++;
|
|
97
|
+
const answer = request.question.type === "choice"
|
|
98
|
+
? this.script.promptReading
|
|
99
|
+
? this.script.promptReading(request)
|
|
100
|
+
: { answer: { type: "choice", choice: "word" }, costUsd: 0 }
|
|
101
|
+
: this.script.promptPolicy
|
|
102
|
+
? this.script.promptPolicy(request)
|
|
103
|
+
: { answer: { type: "boolean", probability: 0 }, costUsd: 0 };
|
|
104
|
+
return { requestId: `scripted-prompt-policy-${index}`, ...answer };
|
|
105
|
+
}
|
|
106
|
+
if (request.operation === BRIEF_POLICY_OPERATION) {
|
|
107
|
+
const index = this.briefPolicyCount++;
|
|
108
|
+
const answer = this.script.briefPolicy
|
|
109
|
+
? this.script.briefPolicy(request)
|
|
110
|
+
: { answer: { type: "boolean", probability: 0 }, costUsd: 0 };
|
|
111
|
+
return { requestId: `scripted-brief-policy-${index}`, ...answer };
|
|
112
|
+
}
|
|
113
|
+
if (request.operation === REFERENCE_VIEW_OPERATION && this.script.referenceView) {
|
|
114
|
+
const index = this.viewCount++;
|
|
115
|
+
return {
|
|
116
|
+
requestId: `scripted-reference-view-${index}`,
|
|
117
|
+
...this.script.referenceView(request),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
if (request.operation === MODEL3D_FACING_OPERATION && this.script.facing) {
|
|
121
|
+
const index = this.facingCount++;
|
|
122
|
+
return { requestId: `scripted-facing-${index}`, ...this.script.facing(request) };
|
|
123
|
+
}
|
|
124
|
+
if (request.operation === LOOKDEV_MARKING_OPERATION && this.script.marking) {
|
|
125
|
+
const index = this.markingCount++;
|
|
126
|
+
return { requestId: `scripted-marking-${index}`, ...this.script.marking(request) };
|
|
127
|
+
}
|
|
128
|
+
if (request.operation === STYLE_VERDICT_OPERATION) {
|
|
129
|
+
const index = this.verdictCount++;
|
|
130
|
+
const answer = this.script.styleVerdict
|
|
131
|
+
? this.script.styleVerdict(request)
|
|
132
|
+
: { answer: { type: "boolean", probability: 0 }, costUsd: 0 };
|
|
133
|
+
return { requestId: `scripted-style-verdict-${index}`, ...answer };
|
|
134
|
+
}
|
|
135
|
+
if (request.operation === BRIEF_CLAMP_OPERATION && this.script.briefClamp) {
|
|
136
|
+
const index = this.clampCount++;
|
|
137
|
+
return { requestId: `scripted-brief-clamp-${index}`, ...this.script.briefClamp(request) };
|
|
138
|
+
}
|
|
139
|
+
if (request.operation === UI_ASSET_OPERATION) {
|
|
140
|
+
const index = this.uiCount++;
|
|
141
|
+
const answer = this.script.uiAsset
|
|
142
|
+
? this.script.uiAsset(request)
|
|
143
|
+
: { answer: { type: "boolean", probability: 0 }, costUsd: 0 };
|
|
144
|
+
return { requestId: `scripted-ui-asset-${index}`, ...answer };
|
|
145
|
+
}
|
|
146
|
+
if (request.operation === MOTION_TEMPLATE_OPERATION) {
|
|
147
|
+
const index = this.templateCount++;
|
|
148
|
+
if (!this.script.motionTemplate)
|
|
149
|
+
throw new Error("the provider script has no motionTemplate answer");
|
|
150
|
+
return {
|
|
151
|
+
requestId: `scripted-motion-template-${index}`,
|
|
152
|
+
...this.script.motionTemplate(request),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
if (request.operation === STYLE_OUTLIER_OPERATION &&
|
|
156
|
+
(this.script.styleOutlier || !this.script.decide)) {
|
|
157
|
+
const index = this.styleOutlierCount++;
|
|
158
|
+
return {
|
|
159
|
+
requestId: `scripted-style-outlier-${index}`,
|
|
160
|
+
...(this.script.styleOutlier?.(request) ?? {
|
|
161
|
+
answer: { type: "boolean", probability: 0 },
|
|
162
|
+
costUsd: 0,
|
|
163
|
+
}),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
if (request.operation === CUTOUT_OPERATION) {
|
|
167
|
+
const index = this.cutoutCount++;
|
|
168
|
+
const answer = this.script.cutout
|
|
169
|
+
? this.script.cutout(request)
|
|
170
|
+
: { answer: { type: "boolean", probability: 0 }, costUsd: 0 };
|
|
171
|
+
return { requestId: `scripted-cutout-${index}`, ...answer };
|
|
172
|
+
}
|
|
173
|
+
if (request.operation === TURNAROUND_SUBJECT_OPERATION) {
|
|
174
|
+
const index = this.turnaroundSubjectCount++;
|
|
175
|
+
const answer = this.script.turnaroundSubject
|
|
176
|
+
? this.script.turnaroundSubject(request)
|
|
177
|
+
: { answer: { type: "choice", choice: "alone" }, costUsd: 0 };
|
|
178
|
+
checkDecideAnswer(request, answer.answer);
|
|
179
|
+
return { requestId: `scripted-turnaround-subject-${index}`, ...answer };
|
|
180
|
+
}
|
|
181
|
+
if (request.operation === SHEET_BLOB_OPERATION) {
|
|
182
|
+
const index = this.sheetBlobCount++;
|
|
183
|
+
const answer = this.script.sheetBlob
|
|
184
|
+
? this.script.sheetBlob(request)
|
|
185
|
+
: { answer: { type: "choice", choice: "label" }, costUsd: 0 };
|
|
186
|
+
return { requestId: `scripted-sheet-blob-${index}`, ...answer };
|
|
187
|
+
}
|
|
188
|
+
if (request.operation === MAP_FLICKER_OPERATION) {
|
|
189
|
+
const index = this.mapFlickerCount++;
|
|
190
|
+
const answer = this.script.mapFlicker
|
|
191
|
+
? this.script.mapFlicker(request)
|
|
192
|
+
: { answer: { type: "choice", choice: "flickers" }, costUsd: 0 };
|
|
193
|
+
return { requestId: `scripted-map-flicker-${index}`, ...answer };
|
|
194
|
+
}
|
|
195
|
+
if (request.operation === CLIP_MAP_OPERATION) {
|
|
196
|
+
const index = this.clipMapCount++;
|
|
197
|
+
const answer = this.script.clipMap
|
|
198
|
+
? this.script.clipMap(request)
|
|
199
|
+
: { answer: { type: "choice", choice: "none" }, costUsd: 0 };
|
|
200
|
+
return { requestId: `scripted-clip-map-${index}`, ...answer };
|
|
201
|
+
}
|
|
202
|
+
const index = this.decideCount++;
|
|
203
|
+
if (!this.script.decide)
|
|
204
|
+
throw new Error("the provider script has no decide answer");
|
|
205
|
+
const result = this.script.decide(request, index);
|
|
206
|
+
checkDecideAnswer(request, result.answer);
|
|
207
|
+
return { requestId: `scripted-decide-${index}`, ...result };
|
|
208
|
+
}
|
|
209
|
+
async embed(request) {
|
|
210
|
+
this.calls.push({ kind: "embed", request });
|
|
211
|
+
const index = this.embedCount++;
|
|
212
|
+
if (!this.script.embed)
|
|
213
|
+
throw new Error("the provider script has no embed answer");
|
|
214
|
+
return { requestId: `scripted-embed-${index}`, ...this.script.embed(request, index) };
|
|
215
|
+
}
|
|
216
|
+
async generateModel(request) {
|
|
217
|
+
this.calls.push({ kind: "model", request });
|
|
218
|
+
const index = this.modelCount++;
|
|
219
|
+
if (!this.script.model)
|
|
220
|
+
throw new Error("the provider script has no model answer");
|
|
221
|
+
return { requestId: `scripted-model-${index}`, ...this.script.model(request, index) };
|
|
222
|
+
}
|
|
223
|
+
async rigModel(request) {
|
|
224
|
+
this.calls.push({ kind: "rig", request });
|
|
225
|
+
const index = this.rigCount++;
|
|
226
|
+
if (!this.script.rig)
|
|
227
|
+
throw new Error("the provider script has no rig answer");
|
|
228
|
+
return { requestId: `scripted-rig-${index}`, ...this.script.rig(request, index) };
|
|
229
|
+
}
|
|
230
|
+
async animateModel(request) {
|
|
231
|
+
this.calls.push({ kind: "animate", request });
|
|
232
|
+
const index = this.animateCount++;
|
|
233
|
+
if (!this.script.animate)
|
|
234
|
+
throw new Error("the provider script has no animate answer");
|
|
235
|
+
return { requestId: `scripted-animate-${index}`, ...this.script.animate(request, index) };
|
|
236
|
+
}
|
|
237
|
+
async generateAudio(request) {
|
|
238
|
+
this.calls.push({ kind: "audio", request });
|
|
239
|
+
const index = this.audioCount++;
|
|
240
|
+
if (!this.script.audio)
|
|
241
|
+
throw new Error("the provider script has no audio answer");
|
|
242
|
+
return { requestId: `scripted-audio-${index}`, ...this.script.audio(request, index) };
|
|
243
|
+
}
|
|
244
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AudioRequest, AudioResult, Billing, CallKind, GenerationProvider, ImageResult, LimitReading, ProviderJobs, VisionResult } from "./provider.ts";
|
|
2
|
+
/** Stability's fixed endpoint; settings never move it. */
|
|
3
|
+
export declare const STABILITY_BASE_URL = "https://api.stability.ai";
|
|
4
|
+
/**
|
|
5
|
+
* The Stability audio adapter: Stable Audio 2.5 (one synchronous call) and 3.0 (a job with an id,
|
|
6
|
+
* results kept 24 h). Stability publishes no official JavaScript SDK for its REST API (its only
|
|
7
|
+
* SDK, the Python `stability-sdk`, targets the retired gRPC API), so this adapter speaks the
|
|
8
|
+
* documented REST API directly over the injected `fetch`; the exception is recorded in
|
|
9
|
+
* docs/decisions.md. A successful call costs 8 credits × `usdPerCredit` (default the published
|
|
10
|
+
* $0.01). Stability takes no idempotency key and cannot look a job up by one, so the jobs declare
|
|
11
|
+
* neither `dedupesByKey` nor `find`.
|
|
12
|
+
*/
|
|
13
|
+
export declare class StabilityProvider implements GenerationProvider {
|
|
14
|
+
#private;
|
|
15
|
+
readonly billing: Billing;
|
|
16
|
+
readonly audioParameters: readonly ["durationS", "seed"];
|
|
17
|
+
constructor(options: {
|
|
18
|
+
apiKey: string | undefined;
|
|
19
|
+
keyEnv?: string;
|
|
20
|
+
/** USD per Stability credit, from settings (`providers.<id>.usdPerCredit`). */
|
|
21
|
+
usdPerCredit?: number;
|
|
22
|
+
billing?: Omit<Billing, "hosts" | "readLimit" | "callCost">;
|
|
23
|
+
/** Tests only: a loopback fixture. Settings never set it. */
|
|
24
|
+
baseUrl?: string;
|
|
25
|
+
fetch?: typeof fetch;
|
|
26
|
+
sleep?: (ms: number) => Promise<void>;
|
|
27
|
+
pollIntervalMs?: number;
|
|
28
|
+
timeoutMs?: number;
|
|
29
|
+
});
|
|
30
|
+
generateImage(): Promise<ImageResult>;
|
|
31
|
+
analyzeImages(): Promise<VisionResult>;
|
|
32
|
+
/** The account's credit balance as a limit reading; spends nothing. */
|
|
33
|
+
limitReading(): Promise<LimitReading>;
|
|
34
|
+
/** The call's cost in USD, checked before core reserves: an unknown model or duration refuses. */
|
|
35
|
+
estimate(request: Parameters<NonNullable<GenerationProvider["estimate"]>>[0], kind: CallKind): number;
|
|
36
|
+
readonly jobs: ProviderJobs;
|
|
37
|
+
generateAudio(request: AudioRequest): Promise<AudioResult>;
|
|
38
|
+
}
|