@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,245 @@
|
|
|
1
|
+
import { nearMatchesFor, subjectReferencePaths } from "../search/near-match.js";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { readJson, lockFor, loadProfile, loadStyleBible } from "../inputs.js";
|
|
4
|
+
import { runCapParts } from "../budget.js";
|
|
5
|
+
import { providerSet, spendLedger } from "../providers/index.js";
|
|
6
|
+
import { IDENTITY_CAST_OPERATION, IDENTITY_CHECK_OPERATION } from "../routes.js";
|
|
7
|
+
import { generateSheet, motionLines, planSheet, sheetBrief } from "../sheet/generate.js";
|
|
8
|
+
import { templatesFor } from "../animation/templates.js";
|
|
9
|
+
import { InputError } from "../errors.js";
|
|
10
|
+
import { knownTemplate } from "../animation/template-choice.js";
|
|
11
|
+
import { SliceError } from "../sheet/slice.js";
|
|
12
|
+
import { familyHandoffStandIn } from "../sheet/import.js";
|
|
13
|
+
import { checkSpecValues } from "../paths.js";
|
|
14
|
+
import { sharedTexts, subjectOf, withSharedText } from "../request.js";
|
|
15
|
+
import { formatImport } from "./import.js";
|
|
16
|
+
import { dryRunOutcome, refusal, usd } from "./result.js";
|
|
17
|
+
import { defineCommand } from "./types.js";
|
|
18
|
+
import { DRY_RUN_PROPERTY, NOTE_PROPERTY, ROUND_PROPERTY, RUNS_PROPERTY, bibleReads, buildWorkPlan, specReads, styleBibleReads, jobsOf, paidBy, } from "../runs/plan.js";
|
|
19
|
+
/** Generate-sheet's plan step: its inputs, providers, planned calls and WorkPlan, with no call. */
|
|
20
|
+
async function prepare(args, ctx) {
|
|
21
|
+
const { capUsd, capSource } = runCapParts(args.cap, ctx.settings);
|
|
22
|
+
// Checked before the sheet is paid for; the import checks it again.
|
|
23
|
+
if (args.maxHalo !== undefined && !(args.maxHalo >= 0 && args.maxHalo <= 1))
|
|
24
|
+
throw new InputError(`the matte limit --max-halo must be a fraction from 0 to 1, not ${args.maxHalo}`);
|
|
25
|
+
const spec = await readJson(args.spec);
|
|
26
|
+
const bible = await loadStyleBible(args.bible);
|
|
27
|
+
// A BIBLE.md holds the identity locks too: it is the lock bible unless --lock-bible names another.
|
|
28
|
+
const lockBible = args.lockBible ?? args.bible;
|
|
29
|
+
const profile = await loadProfile(args.profile);
|
|
30
|
+
// Before the sheet is paid for: every spec value the layout names is one its families hand off with.
|
|
31
|
+
checkSpecValues(profile.value, familyHandoffStandIn(spec.value, profile.value));
|
|
32
|
+
const brief = args.brief === undefined
|
|
33
|
+
? undefined
|
|
34
|
+
: sheetBrief((await readJson(args.brief)).value, ctx.settings.promptPolicy.allow);
|
|
35
|
+
const providers = await providerSet(args.providerScript, ctx);
|
|
36
|
+
const routes = providers.routes;
|
|
37
|
+
const lock = await lockFor(lockBible, args.identityMode, spec.value.subject ?? spec.value.assetId, profile.value, routes);
|
|
38
|
+
const perCall = [
|
|
39
|
+
...planSheet(spec.value, profile.value, routes),
|
|
40
|
+
...(lock
|
|
41
|
+
? [
|
|
42
|
+
lock.settings.question === "cast" ? IDENTITY_CAST_OPERATION : "identity",
|
|
43
|
+
...(lock.settings.mode === "enforce" ? [IDENTITY_CHECK_OPERATION] : []),
|
|
44
|
+
].map((operation) => ({
|
|
45
|
+
operation,
|
|
46
|
+
model: routes[operation].model,
|
|
47
|
+
estimatedCostUsd: routes[operation].estimatedCostUsd,
|
|
48
|
+
}))
|
|
49
|
+
: []),
|
|
50
|
+
];
|
|
51
|
+
const jobs = jobsOf(perCall, routes);
|
|
52
|
+
// The sheet prompt states the family's motion template, which the profile can declare. A family
|
|
53
|
+
// nothing declares or names is decided at run time, so every template's lines are checked.
|
|
54
|
+
const family = spec.value.animationFamily;
|
|
55
|
+
const templates = templatesFor(profile.value);
|
|
56
|
+
const known = typeof family === "string"
|
|
57
|
+
? knownTemplate(family, templates, spec.value.template)
|
|
58
|
+
: { source: "undecided" };
|
|
59
|
+
const motionTemplates = known ? [known.template] : templates;
|
|
60
|
+
const bibleFiles = styleBibleReads("bible", bible);
|
|
61
|
+
const near = await nearMatchesFor(spec.value, await subjectReferencePaths(spec, lockBible, bible), ctx, args.brief === undefined ? undefined : (await readJson(args.brief)).value);
|
|
62
|
+
const work = await buildWorkPlan(generateSheetCommand, args, {
|
|
63
|
+
near,
|
|
64
|
+
promptAllow: ctx.settings.promptPolicy.allow,
|
|
65
|
+
inputs: ["spec", "bible", "profile", "brief", "lockBible"],
|
|
66
|
+
reads: {
|
|
67
|
+
...bibleFiles,
|
|
68
|
+
...specReads("spec", spec),
|
|
69
|
+
...(lock && lockBible !== undefined
|
|
70
|
+
? await bibleReads("lockBible", lockBible, lock.cast ? undefined : [lock.record.subject])
|
|
71
|
+
: {}),
|
|
72
|
+
// The recorded threshold decides which candidates enforce mode drops.
|
|
73
|
+
...(lock?.recordPath !== undefined && { "lockBible/identity-thresholds": lock.recordPath }),
|
|
74
|
+
},
|
|
75
|
+
// The sheet prompt names the subject (the asset id when the spec has no subject), so the plan
|
|
76
|
+
// step checks it, free, before the spend is confirmed.
|
|
77
|
+
promptText: [
|
|
78
|
+
subjectOf(spec.value),
|
|
79
|
+
...motionTemplates.flatMap((t) => motionLines(t, undefined)),
|
|
80
|
+
...(args.note !== undefined ? [args.note] : []),
|
|
81
|
+
],
|
|
82
|
+
jobs,
|
|
83
|
+
capUsd,
|
|
84
|
+
capSource,
|
|
85
|
+
paid: paidBy(providers, jobs),
|
|
86
|
+
providers,
|
|
87
|
+
candidates: 1,
|
|
88
|
+
});
|
|
89
|
+
return { spec, bible, profile, brief, providers, routes, capUsd, lock, perCall, work };
|
|
90
|
+
}
|
|
91
|
+
export const generateSheetCommand = defineCommand({
|
|
92
|
+
name: "generate-sheet",
|
|
93
|
+
tool: "generate_sheet",
|
|
94
|
+
summary: "have the model draw a whole cycle as one sheet within a cost cap, then import it",
|
|
95
|
+
details: `Asks the model for a whole animation cycle as one sheet within the cost cap in USD, then
|
|
96
|
+
imports it as the import command does, with a proposed grouping for a human to confirm.
|
|
97
|
+
A sheet that does not slice into exactly the spec's frames.count figures fails QA (exit 5),
|
|
98
|
+
naming the cells or figures behind the difference; the sheet and its generation record are
|
|
99
|
+
kept in the import directory.
|
|
100
|
+
--dry-run prints the planned calls, the cost forecast and the spend left under the daily and
|
|
101
|
+
work-item limits, writes nothing and needs no key.
|
|
102
|
+
--lock-bible (by default --bible, when it is a BIBLE.md) and --identity-mode score the generated
|
|
103
|
+
sheet against the subject's identity lock as the import command does; the scoring call is part of the forecast and the cap.
|
|
104
|
+
The prompt states the family's motion template (its beats, a held pose, the loop). --brief adds
|
|
105
|
+
the author's brief (purpose, setting, what happens), checked as plan checks it.
|
|
106
|
+
--note adds the author's note to the sheet prompt (policy-checked, part of the request's digest); with
|
|
107
|
+
--round it asks for another round.`,
|
|
108
|
+
input: {
|
|
109
|
+
type: "object",
|
|
110
|
+
properties: {
|
|
111
|
+
spec: { type: "string", description: "the asset spec", placeholder: "<spec.json>" },
|
|
112
|
+
bible: {
|
|
113
|
+
type: "string",
|
|
114
|
+
description: "the style bible (BIBLE.md)",
|
|
115
|
+
placeholder: "<BIBLE.md>",
|
|
116
|
+
},
|
|
117
|
+
profile: { type: "string", description: "the target profile", placeholder: "<profile.json>" },
|
|
118
|
+
brief: {
|
|
119
|
+
type: "string",
|
|
120
|
+
description: "the author's brief: purpose, setting, what happens",
|
|
121
|
+
placeholder: "<brief.json>",
|
|
122
|
+
},
|
|
123
|
+
cap: {
|
|
124
|
+
type: "number",
|
|
125
|
+
description: "the run's cost cap in USD; at most, and by default, the settings' caps.runUsd",
|
|
126
|
+
placeholder: "<usd>",
|
|
127
|
+
},
|
|
128
|
+
imports: {
|
|
129
|
+
type: "string",
|
|
130
|
+
description: "where imports are staged",
|
|
131
|
+
default: ".assetgrove/imports",
|
|
132
|
+
},
|
|
133
|
+
lockBible: {
|
|
134
|
+
type: "string",
|
|
135
|
+
description: "score the sheet against the subject's identity lock in this art bible (default: --bible)",
|
|
136
|
+
placeholder: "<BIBLE.md>",
|
|
137
|
+
},
|
|
138
|
+
identityMode: {
|
|
139
|
+
type: "string",
|
|
140
|
+
description: "override the profile's identity mode",
|
|
141
|
+
placeholder: "<off|shadow|enforce>",
|
|
142
|
+
},
|
|
143
|
+
maxHalo: {
|
|
144
|
+
type: "number",
|
|
145
|
+
minimum: 0,
|
|
146
|
+
description: "the matte checks' limit, 0 to 1: the share of a frame's edge pixels that may keep the background colour (default 0.005)",
|
|
147
|
+
placeholder: "<fraction>",
|
|
148
|
+
},
|
|
149
|
+
workItem: {
|
|
150
|
+
type: "string",
|
|
151
|
+
description: "the work item the spend ledger counts against",
|
|
152
|
+
placeholder: "<label>",
|
|
153
|
+
},
|
|
154
|
+
providerScript: {
|
|
155
|
+
type: "string",
|
|
156
|
+
description: "answer every model call from this module instead of a provider",
|
|
157
|
+
placeholder: "<module>",
|
|
158
|
+
},
|
|
159
|
+
runs: RUNS_PROPERTY,
|
|
160
|
+
note: NOTE_PROPERTY,
|
|
161
|
+
round: ROUND_PROPERTY,
|
|
162
|
+
dryRun: DRY_RUN_PROPERTY,
|
|
163
|
+
},
|
|
164
|
+
required: ["spec", "bible", "profile"],
|
|
165
|
+
additionalProperties: false,
|
|
166
|
+
},
|
|
167
|
+
effect: { readOnly: false, spends: "conditional", writes: "runs" },
|
|
168
|
+
confirm: "spend",
|
|
169
|
+
plan: async (args, ctx) => (await prepare(args, ctx)).work,
|
|
170
|
+
async run(args, ctx) {
|
|
171
|
+
const ledger = spendLedger(ctx, args.workItem);
|
|
172
|
+
const { spec, bible, profile, brief, providers, routes, capUsd, lock, perCall, work } = await prepare(args, ctx);
|
|
173
|
+
if (args.dryRun) {
|
|
174
|
+
const estimateUsd = perCall.reduce((sum, c) => sum + c.estimatedCostUsd, 0);
|
|
175
|
+
const plan = {
|
|
176
|
+
kind: "sheet",
|
|
177
|
+
calls: perCall.length,
|
|
178
|
+
perCall,
|
|
179
|
+
estimateUsd,
|
|
180
|
+
capUsd,
|
|
181
|
+
withinCap: estimateUsd <= capUsd + 1e-9,
|
|
182
|
+
};
|
|
183
|
+
const human = [
|
|
184
|
+
`dry run: one generated sheet, ${perCall.length} planned call(s), nothing spent`,
|
|
185
|
+
...perCall.map((c) => ` ${c.operation} ${c.model} ~${usd(c.estimatedCostUsd)}`),
|
|
186
|
+
`forecast ${usd(estimateUsd)} against a $${capUsd.toFixed(2)} cap` +
|
|
187
|
+
(plan.withinCap ? "" : " (over the cap)"),
|
|
188
|
+
].join("\n");
|
|
189
|
+
return dryRunOutcome(work, human, ledger.forProfile(profile.value), plan);
|
|
190
|
+
}
|
|
191
|
+
let generated;
|
|
192
|
+
try {
|
|
193
|
+
generated = await generateSheet({
|
|
194
|
+
spec: spec.value,
|
|
195
|
+
...(brief !== undefined && { brief }),
|
|
196
|
+
specDir: spec.dir,
|
|
197
|
+
bible: bible.value,
|
|
198
|
+
bibleDir: bible.dir,
|
|
199
|
+
profile: profile.value,
|
|
200
|
+
routes,
|
|
201
|
+
provider: providers,
|
|
202
|
+
importsDir: resolve(args.imports ?? ".assetgrove/imports"),
|
|
203
|
+
...(ctx.run && { runDir: ctx.run.dir }),
|
|
204
|
+
...(args.maxHalo !== undefined && { matte: { maxHaloFraction: args.maxHalo } }),
|
|
205
|
+
capUsd,
|
|
206
|
+
ledger,
|
|
207
|
+
...(args.note !== undefined && { note: args.note }),
|
|
208
|
+
...(lock && {
|
|
209
|
+
identity: {
|
|
210
|
+
record: lock.record,
|
|
211
|
+
references: lock.references,
|
|
212
|
+
settings: lock.settings,
|
|
213
|
+
...(lock.cast && { cast: lock.cast }),
|
|
214
|
+
},
|
|
215
|
+
}),
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
catch (error) {
|
|
219
|
+
// The model drew another number of figures than the spec asks for: the sheet failed QA.
|
|
220
|
+
if (!(error instanceof SliceError))
|
|
221
|
+
throw error;
|
|
222
|
+
const fields = {
|
|
223
|
+
spentUsd: error.spentUsd,
|
|
224
|
+
found: error.found,
|
|
225
|
+
expected: error.expected,
|
|
226
|
+
problems: error.problems,
|
|
227
|
+
...(error.kept !== undefined && { kept: error.kept }),
|
|
228
|
+
};
|
|
229
|
+
return refusal("qa_found_nothing", error.message, fields, "");
|
|
230
|
+
}
|
|
231
|
+
const { record, importDir, grouping, spentUsd, contactSheet } = generated;
|
|
232
|
+
return {
|
|
233
|
+
exitCode: 0,
|
|
234
|
+
fields: withSharedText({
|
|
235
|
+
importDir,
|
|
236
|
+
spentUsd,
|
|
237
|
+
...(ctx.run && { runDir: ctx.run.dir }),
|
|
238
|
+
...(contactSheet && { contactSheet }),
|
|
239
|
+
...record,
|
|
240
|
+
grouping,
|
|
241
|
+
}, sharedTexts(bible.value)),
|
|
242
|
+
human: `$${spentUsd.toFixed(4)} spent\n${formatImport(record, importDir, grouping)}`,
|
|
243
|
+
};
|
|
244
|
+
},
|
|
245
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const identityCheckCommand: import("./types.ts").CommandSpec<Record<string, unknown>>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Budget, runCapParts } from "../budget.js";
|
|
2
|
+
import { loadBible } from "../bible.js";
|
|
3
|
+
import { Caller } from "../calls.js";
|
|
4
|
+
import { InputError } from "../errors.js";
|
|
5
|
+
import { checkIdentityRecord, loadIdentity } from "../identity.js";
|
|
6
|
+
import { providerSet, spendLedger } from "../providers/index.js";
|
|
7
|
+
import { IDENTITY_CHECK_OPERATION } from "../routes.js";
|
|
8
|
+
import { ledgerFor } from "../spend.js";
|
|
9
|
+
import { DRY_RUN_PROPERTY, ROUND_PROPERTY, RUNS_PROPERTY, bibleReads, buildWorkPlan, jobOf, paidBy, } from "../runs/plan.js";
|
|
10
|
+
import { dryRunOutcome, formatWork } from "./result.js";
|
|
11
|
+
import { defineCommand } from "./types.js";
|
|
12
|
+
/** The plan step: the identities to check, loaded as the run loads them, and its WorkPlan. */
|
|
13
|
+
async function prepare(args, ctx) {
|
|
14
|
+
const doc = await loadBible(args.bible);
|
|
15
|
+
const named = args.subject ?? [];
|
|
16
|
+
const subjects = named.length > 0 ? named : Object.keys(doc.data.identities).sort();
|
|
17
|
+
const loaded = await Promise.all(subjects.map(async (subject) => {
|
|
18
|
+
const identity = await loadIdentity(doc, subject);
|
|
19
|
+
if (!identity)
|
|
20
|
+
throw new InputError(`"${subject}" has no identity lock in ${doc.path}`);
|
|
21
|
+
return identity;
|
|
22
|
+
}));
|
|
23
|
+
if (loaded.length === 0)
|
|
24
|
+
throw new InputError(`${doc.path} has no identity locks`);
|
|
25
|
+
const provider = await providerSet(args.providerScript, ctx);
|
|
26
|
+
const jobs = [
|
|
27
|
+
jobOf(IDENTITY_CHECK_OPERATION, provider.routes[IDENTITY_CHECK_OPERATION], loaded.length),
|
|
28
|
+
];
|
|
29
|
+
const work = await buildWorkPlan(identityCheckCommand, args, {
|
|
30
|
+
promptAllow: ctx.settings.promptPolicy.allow,
|
|
31
|
+
inputs: ["bible"],
|
|
32
|
+
reads: await bibleReads("bible", args.bible, subjects),
|
|
33
|
+
jobs,
|
|
34
|
+
...runCapParts(args.cap, ctx.settings),
|
|
35
|
+
paid: paidBy(provider, jobs),
|
|
36
|
+
providers: provider,
|
|
37
|
+
candidates: 0,
|
|
38
|
+
});
|
|
39
|
+
return { loaded, provider, work };
|
|
40
|
+
}
|
|
41
|
+
export const identityCheckCommand = defineCommand({
|
|
42
|
+
name: "identity-check",
|
|
43
|
+
tool: "identity_check",
|
|
44
|
+
summary: "check that identity records agree with their own approved references",
|
|
45
|
+
details: `Asks the identity-check route whether each identity record's written signature features,
|
|
46
|
+
proportions and palette agree with the record's approved reference images (the source of truth).
|
|
47
|
+
Checks every identity in the bible, or the named subjects. Exits 1 when any record disagrees or
|
|
48
|
+
could not be checked: identity enforce mode does not filter with such a record until a person
|
|
49
|
+
fixes its text or its references. See docs/generation-knobs.md.`,
|
|
50
|
+
input: {
|
|
51
|
+
type: "object",
|
|
52
|
+
properties: {
|
|
53
|
+
bible: {
|
|
54
|
+
type: "string",
|
|
55
|
+
description: "the BIBLE.md holding the identity records",
|
|
56
|
+
placeholder: "<BIBLE.md>",
|
|
57
|
+
},
|
|
58
|
+
subject: {
|
|
59
|
+
type: "array",
|
|
60
|
+
items: { type: "string" },
|
|
61
|
+
description: "a subject to check; repeat for several (default: every identity)",
|
|
62
|
+
placeholder: "<name>",
|
|
63
|
+
},
|
|
64
|
+
cap: {
|
|
65
|
+
type: "number",
|
|
66
|
+
description: "the run's cost cap in USD; at most, and by default, the settings' caps.runUsd",
|
|
67
|
+
placeholder: "<usd>",
|
|
68
|
+
},
|
|
69
|
+
workItem: {
|
|
70
|
+
type: "string",
|
|
71
|
+
description: "the work item the spend ledger counts against",
|
|
72
|
+
placeholder: "<label>",
|
|
73
|
+
},
|
|
74
|
+
providerScript: {
|
|
75
|
+
type: "string",
|
|
76
|
+
description: "answer every model call from this module instead of a provider",
|
|
77
|
+
placeholder: "<module>",
|
|
78
|
+
},
|
|
79
|
+
runs: RUNS_PROPERTY,
|
|
80
|
+
round: ROUND_PROPERTY,
|
|
81
|
+
dryRun: DRY_RUN_PROPERTY,
|
|
82
|
+
},
|
|
83
|
+
required: ["bible"],
|
|
84
|
+
additionalProperties: false,
|
|
85
|
+
},
|
|
86
|
+
effect: { readOnly: false, spends: "always", writes: "runs" },
|
|
87
|
+
confirm: "spend",
|
|
88
|
+
plan: async (args, ctx) => (await prepare(args, ctx)).work,
|
|
89
|
+
async run(args, ctx) {
|
|
90
|
+
const { loaded, provider, work } = await prepare(args, ctx);
|
|
91
|
+
if (args.dryRun)
|
|
92
|
+
return dryRunOutcome(work, formatWork("identity-check", work), spendLedger(ctx, args.workItem));
|
|
93
|
+
const routes = provider.routes;
|
|
94
|
+
const budget = new Budget(work.capUsd, ledgerFor(spendLedger(ctx, args.workItem), provider, {}));
|
|
95
|
+
budget.check(loaded.length * routes[IDENTITY_CHECK_OPERATION].estimatedCostUsd, `${loaded.length} identity record checks`);
|
|
96
|
+
const caller = new Caller({
|
|
97
|
+
provider,
|
|
98
|
+
budget,
|
|
99
|
+
routes,
|
|
100
|
+
log: ctx.log,
|
|
101
|
+
});
|
|
102
|
+
const checks = [];
|
|
103
|
+
for (const identity of loaded)
|
|
104
|
+
checks.push(await checkIdentityRecord({ caller, ...identity }));
|
|
105
|
+
const ok = checks.every((c) => c.checked && c.consistent);
|
|
106
|
+
const fields = { checks, spentUsd: budget.spentUsd };
|
|
107
|
+
const human = checks.map((c) => c.reason).join("\n");
|
|
108
|
+
return { exitCode: ok ? 0 : 1, fields, human };
|
|
109
|
+
},
|
|
110
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const identityEvalCommand: import("./types.ts").CommandSpec<Record<string, unknown>>;
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { readFile, realpath } from "node:fs/promises";
|
|
2
|
+
import { relative, resolve } from "node:path";
|
|
3
|
+
import { InputError } from "../errors.js";
|
|
4
|
+
import { loadBible } from "../bible.js";
|
|
5
|
+
import { recordIdentityThreshold } from "../identity.js";
|
|
6
|
+
import { sha256 } from "../request.js";
|
|
7
|
+
import { evaluateIdentity, planEvaluation } from "../identity-eval.js";
|
|
8
|
+
import { loadProfile } from "../inputs.js";
|
|
9
|
+
import { runCapParts } from "../budget.js";
|
|
10
|
+
import { providerSet, spendLedger } from "../providers/index.js";
|
|
11
|
+
import { IDENTITY_CHECK_OPERATION } from "../routes.js";
|
|
12
|
+
import { DRY_RUN_PROPERTY, ROUND_PROPERTY, RUNS_PROPERTY, buildWorkPlan, jobOf, paidBy, } from "../runs/plan.js";
|
|
13
|
+
import { dryRunOutcome, formatWork } from "./result.js";
|
|
14
|
+
import { defineCommand } from "./types.js";
|
|
15
|
+
function formatMedium(medium, m, threshold) {
|
|
16
|
+
const pct = (n) => `${Number((n * 100).toFixed(1))}%`;
|
|
17
|
+
const line = (label, g) => ` ${label}: ${g.cases} cases${g.auc !== undefined ? `, AUC ${g.auc.toFixed(3)}` : ""}, false accepts ${pct(g.falseAcceptRate)}, false rejects ${pct(g.falseRejectRate)}`;
|
|
18
|
+
const b = m.configured;
|
|
19
|
+
return [
|
|
20
|
+
`${medium.toUpperCase()}${m.provisional ? " (provisional, no threshold rests on it)" : ""} at threshold ${threshold}:`,
|
|
21
|
+
line("overall", b),
|
|
22
|
+
...Object.entries(b.byKind).map(([k, g]) => line(`kind ${k}`, g)),
|
|
23
|
+
...Object.entries(b.byCast).map(([c, g]) => line(`cast ${c}`, g)),
|
|
24
|
+
m.provisional
|
|
25
|
+
? " enforce bar: not judged on provisional 3D"
|
|
26
|
+
: b.bar.met
|
|
27
|
+
? " enforce bar (provisional): met"
|
|
28
|
+
: ` enforce bar (provisional): not met: ${b.bar.failures.join("; ")}`,
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
async function record(args, report) {
|
|
32
|
+
if (!report.recommended)
|
|
33
|
+
throw new InputError("nothing to record: none meets the bar, so no threshold is recommended");
|
|
34
|
+
const at = report.media["2d"]?.recommended;
|
|
35
|
+
// Enforce drops paid candidates at the recorded cut, so a cut whose eval failed the bar (a set
|
|
36
|
+
// the model cannot separate recommends the reject-everything cut) is never recorded.
|
|
37
|
+
if (!at?.bar.met)
|
|
38
|
+
throw new InputError(`nothing recorded: at the recommended threshold ${report.recommended.threshold} the enforce bar is not met${at ? ` (${at.bar.failures.join("; ")})` : ""}`);
|
|
39
|
+
const doc = await loadBible(args.bible);
|
|
40
|
+
return recordIdentityThreshold(doc.dir, {
|
|
41
|
+
question: report.question,
|
|
42
|
+
model: report.model,
|
|
43
|
+
threshold: report.recommended.threshold,
|
|
44
|
+
recordedAt: new Date().toISOString(),
|
|
45
|
+
eval: {
|
|
46
|
+
casesFile: relative(doc.dir, resolve(args.cases)) || args.cases,
|
|
47
|
+
casesSha256: sha256(new Uint8Array(await readFile(args.cases))),
|
|
48
|
+
cases: report.cases,
|
|
49
|
+
scored: report.scored,
|
|
50
|
+
falseAcceptRate: at?.falseAcceptRate ?? 0,
|
|
51
|
+
falseRejectRate: at?.falseRejectRate ?? 0,
|
|
52
|
+
barMet: at?.bar.met ?? false,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/** The plan step: the same inputs and routes the run uses, and its WorkPlan, with no call. */
|
|
57
|
+
async function prepare(args, ctx) {
|
|
58
|
+
const profile = args.profile ? (await loadProfile(args.profile)).value : {};
|
|
59
|
+
const provider = await providerSet(args.providerScript, ctx);
|
|
60
|
+
const set = await planEvaluation({
|
|
61
|
+
...(args.bible !== undefined && { biblePath: args.bible }),
|
|
62
|
+
casesPath: args.cases,
|
|
63
|
+
profile,
|
|
64
|
+
});
|
|
65
|
+
// Checked before any call: a record is the bible's own, so every case must be judged against it.
|
|
66
|
+
if (args.record) {
|
|
67
|
+
if (args.bible === undefined)
|
|
68
|
+
throw new InputError("--record needs --bible <BIBLE.md>");
|
|
69
|
+
// Compared by real path: a case may reach the same bible through a link or another spelling.
|
|
70
|
+
const own = await realpath((await loadBible(args.bible)).path);
|
|
71
|
+
const real = await Promise.all(set.bibles.map(async (path) => [path, await realpath(path)]));
|
|
72
|
+
const others = real.filter(([, path]) => path !== own).map(([typed]) => typed);
|
|
73
|
+
if (others.length > 0)
|
|
74
|
+
throw new InputError(`--record records a threshold for ${args.bible} alone, but cases name other bibles: ${others.join(", ")}`);
|
|
75
|
+
}
|
|
76
|
+
const jobs = [
|
|
77
|
+
jobOf(set.operation, provider.routes[set.operation], set.cases),
|
|
78
|
+
jobOf(IDENTITY_CHECK_OPERATION, provider.routes[IDENTITY_CHECK_OPERATION], set.identities),
|
|
79
|
+
];
|
|
80
|
+
const work = await buildWorkPlan(identityEvalCommand, args, {
|
|
81
|
+
promptAllow: ctx.settings.promptPolicy.allow,
|
|
82
|
+
inputs: ["cases", "bible", "profile"],
|
|
83
|
+
reads: set.reads,
|
|
84
|
+
jobs,
|
|
85
|
+
...runCapParts(args.cap, ctx.settings),
|
|
86
|
+
paid: paidBy(provider, jobs),
|
|
87
|
+
providers: provider,
|
|
88
|
+
candidates: 0,
|
|
89
|
+
});
|
|
90
|
+
return { profile, provider, work };
|
|
91
|
+
}
|
|
92
|
+
export const identityEvalCommand = defineCommand({
|
|
93
|
+
name: "identity-eval",
|
|
94
|
+
tool: "identity_eval",
|
|
95
|
+
summary: "score a local labelled image set against identity locks and recommend a threshold",
|
|
96
|
+
details: `Scores every case of a labelled set against its subject's identity lock through the identity
|
|
97
|
+
route. cases.json is a list (or {"cases": [...]}) of {"image", "subject", "same": true|false,
|
|
98
|
+
"qa": true|false (optional), "kind": same|drift|generic|lookalike, "cast", "medium": 2d|3d,
|
|
99
|
+
"bible": path relative to the file}, image paths relative to the file. --bible is optional when
|
|
100
|
+
every case names its bible. With identity.question "cast" each candidate is judged against the whole
|
|
101
|
+
cast of its bible; every subject's record is first checked against its own references. Each call's label, confidence,
|
|
102
|
+
latency and cost are logged on stderr, and one JSON line per case goes to --log. Reports accuracy
|
|
103
|
+
for every threshold, the recommended threshold, accuracy at the profile's threshold and agreement
|
|
104
|
+
with the cases' QA verdicts. The recommended threshold is the one with the fewest false rejects among those whose false-accept rate is within the enforce bar overall, per kind and per cast (the lowest on a tie); when none meets the bar, none is recommended. --record writes it to identity-thresholds.json beside --bible, keyed by question and model, which enforce mode requires. Never filters or approves. Keep the set and the log local; they may
|
|
105
|
+
hold a game's private art. See docs/generation-knobs.md.`,
|
|
106
|
+
input: {
|
|
107
|
+
type: "object",
|
|
108
|
+
properties: {
|
|
109
|
+
bible: {
|
|
110
|
+
type: "string",
|
|
111
|
+
description: "the BIBLE.md holding the identity locks",
|
|
112
|
+
placeholder: "<BIBLE.md>",
|
|
113
|
+
},
|
|
114
|
+
cases: { type: "string", description: "the labelled cases", placeholder: "<cases.json>" },
|
|
115
|
+
profile: { type: "string", description: "the target profile", placeholder: "<profile.json>" },
|
|
116
|
+
record: {
|
|
117
|
+
type: "boolean",
|
|
118
|
+
description: "record the recommended threshold for this bible and model in identity-thresholds.json beside the bible; refused when none meets the bar",
|
|
119
|
+
},
|
|
120
|
+
log: {
|
|
121
|
+
type: "string",
|
|
122
|
+
description: "where one JSON line per case is written",
|
|
123
|
+
placeholder: "<identity-eval.jsonl>",
|
|
124
|
+
},
|
|
125
|
+
cap: {
|
|
126
|
+
type: "number",
|
|
127
|
+
description: "the run's cost cap in USD; at most, and by default, the settings' caps.runUsd",
|
|
128
|
+
placeholder: "<usd>",
|
|
129
|
+
},
|
|
130
|
+
workItem: {
|
|
131
|
+
type: "string",
|
|
132
|
+
description: "the work item the spend ledger counts against",
|
|
133
|
+
placeholder: "<label>",
|
|
134
|
+
},
|
|
135
|
+
providerScript: {
|
|
136
|
+
type: "string",
|
|
137
|
+
description: "answer every model call from this module instead of a provider",
|
|
138
|
+
placeholder: "<module>",
|
|
139
|
+
},
|
|
140
|
+
runs: RUNS_PROPERTY,
|
|
141
|
+
round: ROUND_PROPERTY,
|
|
142
|
+
dryRun: DRY_RUN_PROPERTY,
|
|
143
|
+
},
|
|
144
|
+
required: ["cases"],
|
|
145
|
+
additionalProperties: false,
|
|
146
|
+
},
|
|
147
|
+
effect: { readOnly: false, spends: "always", writes: "out" },
|
|
148
|
+
confirm: "spend",
|
|
149
|
+
plan: async (args, ctx) => (await prepare(args, ctx)).work,
|
|
150
|
+
async run(args, ctx) {
|
|
151
|
+
const { profile, provider, work } = await prepare(args, ctx);
|
|
152
|
+
if (args.dryRun)
|
|
153
|
+
return dryRunOutcome(work, formatWork("identity-eval", work), spendLedger(ctx, args.workItem).forProfile(profile));
|
|
154
|
+
const report = await evaluateIdentity({
|
|
155
|
+
...(args.bible !== undefined && { biblePath: args.bible }),
|
|
156
|
+
casesPath: args.cases,
|
|
157
|
+
profile,
|
|
158
|
+
routes: provider.routes,
|
|
159
|
+
provider,
|
|
160
|
+
capUsd: work.capUsd,
|
|
161
|
+
ledger: spendLedger(ctx, args.workItem),
|
|
162
|
+
...(args.log !== undefined && { logPath: args.log }),
|
|
163
|
+
log: ctx.log,
|
|
164
|
+
});
|
|
165
|
+
const pct = (n) => `${(n * 100).toFixed(1)}%`;
|
|
166
|
+
const recorded = args.record ? await record(args, report) : undefined;
|
|
167
|
+
const lines = [
|
|
168
|
+
`${report.scored} of ${report.cases} cases scored by ${report.model} (${report.question}), ${report.failed} failed, $${report.spentUsd.toFixed(6)} spent`,
|
|
169
|
+
...report.sweep.map((r) => ` threshold ${r.threshold.toFixed(3)}: ${r.correct} correct (${pct(r.accuracy)}), ${r.falseRejects} false rejects, ${r.falseAccepts} false accepts`),
|
|
170
|
+
report.recommended
|
|
171
|
+
? `recommended threshold ${report.recommended.threshold.toFixed(3)} (${pct(report.recommended.accuracy)})`
|
|
172
|
+
: report.sweep.length > 0
|
|
173
|
+
? "no threshold recommended: none meets the bar (false-accept rate within the enforce bar)"
|
|
174
|
+
: "no threshold recommended: no 2D case of a trusted record was scored",
|
|
175
|
+
...(recorded
|
|
176
|
+
? [`recorded threshold ${report.recommended?.threshold.toFixed(3)} in ${recorded}`]
|
|
177
|
+
: []),
|
|
178
|
+
`configured threshold ${report.configured.threshold}: ${pct(report.configured.accuracy)}`,
|
|
179
|
+
...(report.qaAgreement
|
|
180
|
+
? [
|
|
181
|
+
`agreement with QA: ${report.qaAgreement.agree}/${report.qaAgreement.scored} (${pct(report.qaAgreement.rate)}), identity-only failures ${report.qaAgreement.identityOnlyFailed}, QA-only failures ${report.qaAgreement.qaOnlyFailed}`,
|
|
182
|
+
]
|
|
183
|
+
: []),
|
|
184
|
+
...["2d", "3d"].flatMap((medium) => {
|
|
185
|
+
const m = report.media[medium];
|
|
186
|
+
return m ? formatMedium(medium, m, report.configured.threshold) : [];
|
|
187
|
+
}),
|
|
188
|
+
...(report.untrusted
|
|
189
|
+
? [
|
|
190
|
+
`untrusted records (kept out of the threshold and the bar): ${report.untrusted.cases} cases at threshold ${report.configured.threshold}, false accepts ${pct(report.untrusted.falseAcceptRate)}, false rejects ${pct(report.untrusted.falseRejectRate)}`,
|
|
191
|
+
]
|
|
192
|
+
: []),
|
|
193
|
+
...report.recordChecks.map((c) => `record check: ${c.reason}`),
|
|
194
|
+
];
|
|
195
|
+
return { exitCode: 0, fields: { ...report }, human: lines.join("\n") };
|
|
196
|
+
},
|
|
197
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ImportRecord } from "../sheet/import.ts";
|
|
2
|
+
import type { Grouping } from "../sheet/types.ts";
|
|
3
|
+
/** The identity score of an import as text lines. */
|
|
4
|
+
export declare function formatIdentity(record: ImportRecord): string[];
|
|
5
|
+
/** An import as text: the frames, their failed checks and the proposed grouping. */
|
|
6
|
+
export declare function formatImport(record: ImportRecord, importDir: string, grouping: Grouping): string;
|
|
7
|
+
export declare const importCommand: import("./types.ts").CommandSpec<Record<string, unknown>>;
|