@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,455 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pack conformance suite (`@clockgrove/assetgrove/testing`, design section 11): what a pack runs
|
|
3
|
+
* in its own tests on its adapters, kinds and presets. The whole suite runs with the global `fetch`
|
|
4
|
+
* trapped, so a pack that reaches the network outside its guarded `http` fails. Every `exact` QA
|
|
5
|
+
* check of every kind runs twice, each time under a `Caller` that refuses every call: an exact check
|
|
6
|
+
* that makes a call, throws, or answers differently the second time fails the suite; every `model`
|
|
7
|
+
* check that runs is run once on the scripted provider. A kind whose `generate` or check returns a
|
|
8
|
+
* reason naming a check neither the kind nor core declares fails it too: core would record that
|
|
9
|
+
* reason advisory (`cause: "undeclared"`), never filtering.
|
|
10
|
+
*/
|
|
11
|
+
import { DEFAULT_TILE_KINDS } from "../library/labels.js";
|
|
12
|
+
import { createHash } from "node:crypto";
|
|
13
|
+
import { AssertionError } from "node:assert";
|
|
14
|
+
import { isAbsolute } from "node:path";
|
|
15
|
+
import { Budget } from "../budget.js";
|
|
16
|
+
import { Caller, RefusingCaller } from "../calls.js";
|
|
17
|
+
import { bindExtensionSettings, createExtensionContext } from "../extension/context.js";
|
|
18
|
+
import { coreExtension } from "../extensions/core.js";
|
|
19
|
+
import { checkExtension, packSettingsOf } from "../extensions/registry.js";
|
|
20
|
+
import { checkOf, kindQaRegistry } from "../qa/stability.js";
|
|
21
|
+
import { ScriptedProvider } from "../gateway/scripted.js";
|
|
22
|
+
import { createProvider } from "../providers/adapter.js";
|
|
23
|
+
import { defaultRoutes, ROLE_DEFAULT_OPERATION } from "../routes.js";
|
|
24
|
+
import { sampleBible, samplePng, sampleProfile, sampleScript } from "./samples.js";
|
|
25
|
+
import { refusingToolRunner } from "../extension/tools.js";
|
|
26
|
+
import { mediaCheckContext } from "../media.js";
|
|
27
|
+
function messageOf(error) {
|
|
28
|
+
return error instanceof Error ? error.message : String(error);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The pack's extension, as core would load it: the default export, or its factory's result, whose
|
|
32
|
+
* `context.settings` then holds `settings` (the pack's block) checked against its `settingsSchema`.
|
|
33
|
+
*/
|
|
34
|
+
export async function resolveEntry(entry, name = "conformance", settings) {
|
|
35
|
+
if (typeof entry !== "function")
|
|
36
|
+
return entry;
|
|
37
|
+
const context = createExtensionContext(name);
|
|
38
|
+
const extension = await entry(context);
|
|
39
|
+
const schema = extension?.settingsSchema;
|
|
40
|
+
// A schema that is not zod is left for checkExtension to refuse.
|
|
41
|
+
if (schema === undefined || typeof schema.safeParse === "function")
|
|
42
|
+
bindExtensionSettings(context, packSettingsOf(extension, name, settings, "the pack settings"));
|
|
43
|
+
return extension;
|
|
44
|
+
}
|
|
45
|
+
/** Replaces the global `fetch` while `body` runs; every call is recorded and refused. */
|
|
46
|
+
async function withFetchTrapped(trapped, body) {
|
|
47
|
+
const original = globalThis.fetch;
|
|
48
|
+
globalThis.fetch = ((input) => {
|
|
49
|
+
const url = input instanceof Request ? input.url : String(input);
|
|
50
|
+
trapped.push(url);
|
|
51
|
+
return Promise.reject(new Error(`the conformance suite traps the global fetch (${url})`));
|
|
52
|
+
});
|
|
53
|
+
try {
|
|
54
|
+
return await body();
|
|
55
|
+
}
|
|
56
|
+
finally {
|
|
57
|
+
globalThis.fetch = original;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function reasonProblem(value) {
|
|
61
|
+
if (!Array.isArray(value))
|
|
62
|
+
return "did not return a list of reasons";
|
|
63
|
+
for (const r of value) {
|
|
64
|
+
if (typeof r?.check !== "string" ||
|
|
65
|
+
typeof r.passed !== "boolean" ||
|
|
66
|
+
typeof r.reason !== "string" ||
|
|
67
|
+
!["deterministic", "vision", "decision"].includes(r.source))
|
|
68
|
+
return `returned a reason that is not {check, passed, reason, source}: ${JSON.stringify(r)}`;
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
/** Runs one `exact` check twice, each under a refusing Caller; the problems it shows. */
|
|
73
|
+
export async function exactCheckProblems(check, input) {
|
|
74
|
+
const answers = [];
|
|
75
|
+
for (const pass of [1, 2]) {
|
|
76
|
+
const caller = new RefusingCaller(`exact check ${check.name} makes no provider call`);
|
|
77
|
+
let result;
|
|
78
|
+
try {
|
|
79
|
+
result = await check.run(input, caller);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (caller.attempts.length > 0)
|
|
83
|
+
return [`made a provider call (${caller.attempts.join(", ")}) on run ${pass}`];
|
|
84
|
+
return [`threw on run ${pass}: ${messageOf(error)}`];
|
|
85
|
+
}
|
|
86
|
+
if (caller.attempts.length > 0)
|
|
87
|
+
return [`made a provider call (${caller.attempts.join(", ")}) on run ${pass}`];
|
|
88
|
+
const shape = reasonProblem(result);
|
|
89
|
+
if (shape !== undefined)
|
|
90
|
+
return [`${shape} on run ${pass}`];
|
|
91
|
+
answers.push(JSON.stringify(result));
|
|
92
|
+
}
|
|
93
|
+
return answers[0] === answers[1]
|
|
94
|
+
? []
|
|
95
|
+
: [`is not deterministic: it answered ${answers[0]} and then ${answers[1]}`];
|
|
96
|
+
}
|
|
97
|
+
function routesFor(ext) {
|
|
98
|
+
const routes = { ...defaultRoutes };
|
|
99
|
+
for (const adapter of ext.adapters ?? [])
|
|
100
|
+
for (const [op, route] of Object.entries(adapter.defaultRoutes ?? {}))
|
|
101
|
+
routes[op] ??= { ...route, provider: adapter.id };
|
|
102
|
+
// A kind's own operation takes its role's default route, as core resolves it (src/routes.ts).
|
|
103
|
+
for (const kind of ext.kinds ?? [])
|
|
104
|
+
for (const [op, role] of Object.entries(kind.operations ?? {})) {
|
|
105
|
+
const fallback = routes[ROLE_DEFAULT_OPERATION[role] ?? ""];
|
|
106
|
+
if (fallback !== undefined)
|
|
107
|
+
routes[op] ??= fallback;
|
|
108
|
+
}
|
|
109
|
+
return routes;
|
|
110
|
+
}
|
|
111
|
+
/** The checks a list of reasons names that no declaration covers, each once. */
|
|
112
|
+
function undeclaredOf(reasons, checks) {
|
|
113
|
+
return [...new Set(reasons.filter((r) => checkOf(r, checks) === undefined).map((r) => r.check))];
|
|
114
|
+
}
|
|
115
|
+
async function checkKind(kind, sample, routes, declared, fail, ran) {
|
|
116
|
+
if (sample === undefined) {
|
|
117
|
+
fail("has no sample: give options.kinds[<kind>] a spec");
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const profile = sample.profile ?? sampleProfile();
|
|
121
|
+
const bible = sample.bible ?? sampleBible();
|
|
122
|
+
let output = sample.output;
|
|
123
|
+
if (kind.importMedia !== undefined) {
|
|
124
|
+
// A kind that imports takes the sample's output as the file, and must keep its bytes as given.
|
|
125
|
+
if (output === undefined) {
|
|
126
|
+
fail("imports a file: give options.kinds[<kind>].output, the file it imports");
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
const { bytes, mediaType, extension } = output;
|
|
131
|
+
const taken = kind.importMedia({
|
|
132
|
+
spec: sample.spec,
|
|
133
|
+
profile,
|
|
134
|
+
bytes,
|
|
135
|
+
mediaType,
|
|
136
|
+
extension,
|
|
137
|
+
tileKinds: () => DEFAULT_TILE_KINDS,
|
|
138
|
+
});
|
|
139
|
+
if ("read" in taken) {
|
|
140
|
+
fail("importMedia read what the sample spec leaves out: give a spec that states it");
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (!Buffer.from(taken.output.bytes).equals(Buffer.from(bytes)))
|
|
144
|
+
fail("importMedia altered the file's bytes; an import keeps them as given");
|
|
145
|
+
output = taken.output;
|
|
146
|
+
ran("importMedia");
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
fail(`importMedia threw: ${messageOf(error)}`);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (kind.importMedia === undefined)
|
|
154
|
+
try {
|
|
155
|
+
const planned = kind.planCandidate(sample.spec, profile, routes);
|
|
156
|
+
if (!Array.isArray(planned))
|
|
157
|
+
fail("planCandidate did not return a list");
|
|
158
|
+
else
|
|
159
|
+
for (const call of planned)
|
|
160
|
+
if (typeof call?.operation !== "string" || !(call.estimatedCostUsd >= 0))
|
|
161
|
+
fail(`planCandidate returned a call without an operation and an estimate`);
|
|
162
|
+
ran("planCandidate");
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
fail(`planCandidate threw: ${messageOf(error)}`);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (output === undefined) {
|
|
169
|
+
try {
|
|
170
|
+
const provider = new ScriptedProvider(sample.script ?? sampleScript());
|
|
171
|
+
const generated = await kind.generate({
|
|
172
|
+
spec: sample.spec,
|
|
173
|
+
specDir: process.cwd(),
|
|
174
|
+
bible,
|
|
175
|
+
bibleDir: process.cwd(),
|
|
176
|
+
profile,
|
|
177
|
+
call: new Caller({ provider, providerName: "scripted", budget: new Budget(100), routes }),
|
|
178
|
+
index: 0,
|
|
179
|
+
seed: 1,
|
|
180
|
+
});
|
|
181
|
+
output = generated?.output;
|
|
182
|
+
if (typeof output?.mediaType !== "string" ||
|
|
183
|
+
typeof output.extension !== "string" ||
|
|
184
|
+
!(output.bytes instanceof Uint8Array) ||
|
|
185
|
+
output.bytes.length === 0) {
|
|
186
|
+
fail("generate returned no media (output.mediaType, extension and bytes)");
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
if (typeof generated.qa?.passed !== "boolean")
|
|
190
|
+
fail("generate returned no qa verdict");
|
|
191
|
+
else {
|
|
192
|
+
const shape = reasonProblem(generated.qa.reasons);
|
|
193
|
+
if (shape !== undefined)
|
|
194
|
+
fail(`generate's qa ${shape}`);
|
|
195
|
+
else
|
|
196
|
+
for (const id of undeclaredOf(generated.qa.reasons, declared))
|
|
197
|
+
fail(`generate returned a reason for check "${id}", which neither the kind nor core declares; declare it in the kind's checks`);
|
|
198
|
+
}
|
|
199
|
+
ran("generate on the scripted provider");
|
|
200
|
+
}
|
|
201
|
+
catch (error) {
|
|
202
|
+
fail(`generate threw on the scripted provider: ${messageOf(error)}`);
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
// An audio kind's checks read the decoded WAV, as `stage` gives it them.
|
|
207
|
+
let media = {};
|
|
208
|
+
try {
|
|
209
|
+
media = mediaCheckContext(kind.media, output);
|
|
210
|
+
}
|
|
211
|
+
catch (error) {
|
|
212
|
+
if ((kind.checks ?? []).some((c) => c.run !== undefined))
|
|
213
|
+
fail(`its ${kind.media} output does not decode for its checks: ${messageOf(error)}`);
|
|
214
|
+
}
|
|
215
|
+
for (const check of kind.checks ?? []) {
|
|
216
|
+
const run = check.run;
|
|
217
|
+
if (run === undefined) {
|
|
218
|
+
ran(`${check.mode} check ${check.name}: declared, its reasons come from generate`);
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
const input = { spec: sample.spec, profile, bible, output, ...media };
|
|
222
|
+
if (check.mode !== "exact") {
|
|
223
|
+
// A model check runs once on the scripted provider, so the reasons it returns are checked
|
|
224
|
+
// against the kind's declarations as `stage` judges them.
|
|
225
|
+
try {
|
|
226
|
+
const provider = new ScriptedProvider(sample.script ?? sampleScript());
|
|
227
|
+
const call = new Caller({
|
|
228
|
+
provider,
|
|
229
|
+
providerName: "scripted",
|
|
230
|
+
budget: new Budget(100),
|
|
231
|
+
routes,
|
|
232
|
+
});
|
|
233
|
+
const reasons = await run(input, call);
|
|
234
|
+
const shape = reasonProblem(reasons);
|
|
235
|
+
if (shape !== undefined)
|
|
236
|
+
fail(`${check.mode} check ${check.name} ${shape}`);
|
|
237
|
+
else
|
|
238
|
+
for (const id of undeclaredOf(reasons, declared))
|
|
239
|
+
fail(`${check.mode} check ${check.name} returned a reason for check "${id}", which neither the kind nor core declares`);
|
|
240
|
+
}
|
|
241
|
+
catch (error) {
|
|
242
|
+
fail(`${check.mode} check ${check.name} threw on the scripted provider: ${messageOf(error)}; give options.kinds[<kind>].script the answers it needs`);
|
|
243
|
+
}
|
|
244
|
+
ran(`${check.mode} check ${check.name}, once on the scripted provider`);
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
const problems = await exactCheckProblems({ ...check, run }, input);
|
|
248
|
+
for (const problem of problems)
|
|
249
|
+
fail(`exact check ${check.name} ${problem}`);
|
|
250
|
+
if (problems.length === 0) {
|
|
251
|
+
const reasons = await run(input, new RefusingCaller(`exact check ${check.name}`));
|
|
252
|
+
for (const id of undeclaredOf(reasons, declared))
|
|
253
|
+
fail(`exact check ${check.name} returned a reason for check "${id}", which neither the kind nor core declares`);
|
|
254
|
+
}
|
|
255
|
+
ran(`exact check ${check.name}, twice under a refusing Caller`);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
async function checkPreset(preset, sample, fail, ran) {
|
|
259
|
+
let options;
|
|
260
|
+
try {
|
|
261
|
+
options = preset.optionsSchema.parse(sample?.options ?? {});
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
fail(`optionsSchema refused the sample options: ${messageOf(error)}`);
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
// The suite runs no program: a preset's tool run is refused here (sample.context may give one).
|
|
268
|
+
const noTools = refusingToolRunner("the conformance suite runs no program");
|
|
269
|
+
const assetCtx = () => ({
|
|
270
|
+
profile: sampleProfile(),
|
|
271
|
+
context: { spec: { assetId: "conformance-1", kind: "still" }, output: {}, provenance: {} },
|
|
272
|
+
manifestRel: "assets/manifests/conformance-1.json",
|
|
273
|
+
run: noTools,
|
|
274
|
+
...sample?.context,
|
|
275
|
+
});
|
|
276
|
+
const familyPng = samplePng();
|
|
277
|
+
const familiesCtx = () => ({
|
|
278
|
+
profile: sampleProfile(),
|
|
279
|
+
assetId: "conformance-1",
|
|
280
|
+
families: [
|
|
281
|
+
{
|
|
282
|
+
name: "idle",
|
|
283
|
+
id: "conformance-1-idle",
|
|
284
|
+
media: "assets/source/conformance-1-idle.png",
|
|
285
|
+
sha256: createHash("sha256").update(familyPng).digest("hex"),
|
|
286
|
+
content: familyPng,
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
run: noTools,
|
|
290
|
+
...sample?.context,
|
|
291
|
+
});
|
|
292
|
+
// The sample target is empty: `read` finds nothing there.
|
|
293
|
+
const nothing = async () => undefined;
|
|
294
|
+
const write = () => preset.scope === "families"
|
|
295
|
+
? preset.write(familiesCtx(), options, nothing)
|
|
296
|
+
: preset.write(assetCtx(), options, nothing);
|
|
297
|
+
const check = (files, read) => preset.scope === "families"
|
|
298
|
+
? preset.check(familiesCtx(), options, files, read)
|
|
299
|
+
: preset.check(assetCtx(), options, files, read);
|
|
300
|
+
let files;
|
|
301
|
+
try {
|
|
302
|
+
files = await write();
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
fail(`write threw: ${messageOf(error)}`);
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
if (!Array.isArray(files)) {
|
|
309
|
+
fail("write did not return a list of files");
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
for (const file of files) {
|
|
313
|
+
const path = file?.path;
|
|
314
|
+
if (typeof path !== "string" ||
|
|
315
|
+
path === "" ||
|
|
316
|
+
isAbsolute(path) ||
|
|
317
|
+
path.startsWith("/") ||
|
|
318
|
+
path.split(/[\\/]/).includes(".."))
|
|
319
|
+
fail(`write returned a path outside the target: ${JSON.stringify(path)}`);
|
|
320
|
+
if (typeof file?.content !== "string" && !(file?.content instanceof Uint8Array))
|
|
321
|
+
fail(`write returned ${JSON.stringify(path)} without string or byte content`);
|
|
322
|
+
}
|
|
323
|
+
ran("write");
|
|
324
|
+
const written = new Map(files.map((f) => [
|
|
325
|
+
f.path,
|
|
326
|
+
typeof f.content === "string" ? new TextEncoder().encode(f.content) : f.content,
|
|
327
|
+
]));
|
|
328
|
+
try {
|
|
329
|
+
const problems = await check(files, async (p) => written.get(p));
|
|
330
|
+
if (!Array.isArray(problems) || problems.length > 0)
|
|
331
|
+
fail(`check refused what write wrote: ${JSON.stringify(problems)}`);
|
|
332
|
+
if (files.length > 0) {
|
|
333
|
+
const missing = await check(files, nothing);
|
|
334
|
+
if (!Array.isArray(missing) || missing.length === 0)
|
|
335
|
+
fail("check passed with none of its files written, so it checks nothing");
|
|
336
|
+
}
|
|
337
|
+
ran("check reads back what write wrote");
|
|
338
|
+
}
|
|
339
|
+
catch (error) {
|
|
340
|
+
fail(`check threw: ${messageOf(error)}`);
|
|
341
|
+
}
|
|
342
|
+
const read = async (p) => written.get(p);
|
|
343
|
+
if (preset.doctor !== undefined) {
|
|
344
|
+
// The doctor is read-only and reports findings; here it sees a target with no files and no Git.
|
|
345
|
+
try {
|
|
346
|
+
const findings = await preset.doctor({
|
|
347
|
+
profile: sampleProfile(),
|
|
348
|
+
list: async () => [],
|
|
349
|
+
tracked: async () => [],
|
|
350
|
+
lfs: async () => [],
|
|
351
|
+
}, options, read);
|
|
352
|
+
const text = (v) => typeof v === "string";
|
|
353
|
+
if (!Array.isArray(findings) ||
|
|
354
|
+
findings.some((f) => [f?.["code"], f?.["path"], f?.["problem"], f?.["correction"]].some((v) => !text(v))))
|
|
355
|
+
fail(`doctor returned ${JSON.stringify(findings)}, not a list of findings with a string code, path, problem and correction`);
|
|
356
|
+
ran("doctor returns a list of findings");
|
|
357
|
+
}
|
|
358
|
+
catch (error) {
|
|
359
|
+
fail(`doctor threw: ${messageOf(error)}`);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
if (preset.warnings === undefined)
|
|
363
|
+
return;
|
|
364
|
+
// Warnings are advisory lines about the target: a list of strings, never a throw.
|
|
365
|
+
try {
|
|
366
|
+
const warnings = preset.scope === "families"
|
|
367
|
+
? await preset.warnings(familiesCtx(), options, read)
|
|
368
|
+
: await preset.warnings(assetCtx(), options, read);
|
|
369
|
+
if (!Array.isArray(warnings) || warnings.some((w) => typeof w !== "string"))
|
|
370
|
+
fail(`warnings returned ${JSON.stringify(warnings)}, not a list of strings`);
|
|
371
|
+
ran("warnings returns a list of strings");
|
|
372
|
+
}
|
|
373
|
+
catch (error) {
|
|
374
|
+
fail(`warnings threw: ${messageOf(error)}`);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function checkAdapter(adapter, settings, fail, ran) {
|
|
378
|
+
if (!Array.isArray(adapter.capabilities))
|
|
379
|
+
fail("capabilities is not a list");
|
|
380
|
+
if (!Array.isArray(adapter.fixedHosts))
|
|
381
|
+
fail("fixedHosts is not a list");
|
|
382
|
+
else
|
|
383
|
+
for (const host of adapter.fixedHosts) {
|
|
384
|
+
let parsed;
|
|
385
|
+
try {
|
|
386
|
+
parsed = new URL(`https://${host}`).host;
|
|
387
|
+
}
|
|
388
|
+
catch {
|
|
389
|
+
parsed = undefined;
|
|
390
|
+
}
|
|
391
|
+
if (typeof host !== "string" || parsed !== host.toLowerCase())
|
|
392
|
+
fail(`fixedHosts holds ${JSON.stringify(host)}, which is not a bare host`);
|
|
393
|
+
}
|
|
394
|
+
if (typeof adapter.endpointFromSettings !== "boolean")
|
|
395
|
+
fail("endpointFromSettings is not a boolean");
|
|
396
|
+
if (typeof adapter.create !== "function") {
|
|
397
|
+
fail("has no create function");
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
const entry = settings ?? {
|
|
401
|
+
adapter: adapter.id,
|
|
402
|
+
...(adapter.endpointFromSettings && { baseURL: "http://127.0.0.1:9/" }),
|
|
403
|
+
};
|
|
404
|
+
try {
|
|
405
|
+
createProvider("conformance", { adapter: adapter.id, ...entry }, { adapters: [adapter], env: {} });
|
|
406
|
+
ran("create with core's guarded fetch, billing declared");
|
|
407
|
+
}
|
|
408
|
+
catch (error) {
|
|
409
|
+
fail(`create failed: ${messageOf(error)}`);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Runs the conformance suite on a pack's entry (its default export) and reports every failure.
|
|
414
|
+
* Nothing is thrown for a failing pack; `assertConformance` throws.
|
|
415
|
+
*/
|
|
416
|
+
export async function runConformance(entry, options = {}) {
|
|
417
|
+
const failures = [];
|
|
418
|
+
const checked = [];
|
|
419
|
+
const trapped = [];
|
|
420
|
+
await withFetchTrapped(trapped, async () => {
|
|
421
|
+
let ext;
|
|
422
|
+
try {
|
|
423
|
+
ext = checkExtension(await resolveEntry(entry, options.name, options.settings), "the pack");
|
|
424
|
+
}
|
|
425
|
+
catch (error) {
|
|
426
|
+
failures.push(messageOf(error));
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
checked.push(`extension ${ext.name}: shape and ids`);
|
|
430
|
+
const routes = routesFor(ext);
|
|
431
|
+
for (const adapter of ext.adapters ?? [])
|
|
432
|
+
checkAdapter(adapter, options.adapters?.[adapter.id], (why) => failures.push(`adapter ${adapter.id} ${why}`), (what) => checked.push(`adapter ${adapter.id}: ${what}`));
|
|
433
|
+
for (const kind of ext.kinds ?? [])
|
|
434
|
+
await checkKind(kind, options.kinds?.[kind.kind], routes,
|
|
435
|
+
// Judged as `stage` judges it: core's declarations and the kind's own, never another kind's.
|
|
436
|
+
kindQaRegistry(kind, coreExtension.kinds ?? []).checks, (why) => failures.push(`kind ${kind.kind} ${why}`), (what) => checked.push(`kind ${kind.kind}: ${what}`));
|
|
437
|
+
for (const preset of ext.presets ?? [])
|
|
438
|
+
await checkPreset(preset, options.presets?.[preset.name], (why) => failures.push(`preset ${preset.name} ${why}`), (what) => checked.push(`preset ${preset.name}: ${what}`));
|
|
439
|
+
});
|
|
440
|
+
for (const url of trapped)
|
|
441
|
+
failures.push(`reached the global fetch (${url}); use the context's http`);
|
|
442
|
+
return { passed: failures.length === 0, failures, checked };
|
|
443
|
+
}
|
|
444
|
+
/** Runs the suite and throws an `AssertionError` listing every failure. */
|
|
445
|
+
export async function assertConformance(entry, options = {}) {
|
|
446
|
+
const report = await runConformance(entry, options);
|
|
447
|
+
if (!report.passed)
|
|
448
|
+
throw new AssertionError({
|
|
449
|
+
message: `the pack fails the conformance suite:\n- ${report.failures.join("\n- ")}`,
|
|
450
|
+
actual: report.failures,
|
|
451
|
+
expected: [],
|
|
452
|
+
operator: "conformance",
|
|
453
|
+
});
|
|
454
|
+
return report;
|
|
455
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pack test kit, published as `@clockgrove/assetgrove/testing` (design section 11): the
|
|
3
|
+
* scripted provider, a temporary project and settings builder, synthetic samples, and the
|
|
4
|
+
* conformance suite a pack runs on its adapters, kinds and presets. Tests only: nothing here is
|
|
5
|
+
* loaded by core's CLI or MCP server.
|
|
6
|
+
*/
|
|
7
|
+
export { ScriptedProvider } from "../gateway/scripted.ts";
|
|
8
|
+
export type { Script } from "../gateway/scripted.ts";
|
|
9
|
+
export { scriptedAdapter } from "../providers/adapter.ts";
|
|
10
|
+
export { RefusingCaller, CallRefusedError } from "../calls.ts";
|
|
11
|
+
export { createExtensionContext as extensionContext } from "../extension/context.ts";
|
|
12
|
+
export { assertConformance, exactCheckProblems, resolveEntry, runConformance, } from "./conformance.ts";
|
|
13
|
+
export type { ConformanceOptions, ConformanceReport, KindSample, PresetSample, } from "./conformance.ts";
|
|
14
|
+
export { cli } from "./cli.ts";
|
|
15
|
+
export type { CliCallOptions, CliCallResult } from "./cli.ts";
|
|
16
|
+
export { SCRIPTED_LIMIT, TEST_OPERATOR, tempProject } from "./project.ts";
|
|
17
|
+
export type { CliResult, McpSession, RunOptions, TempProject } from "./project.ts";
|
|
18
|
+
export { SAMPLE_PALETTE, bibleMarkdown, sampleBible, sampleProfile, samplePng, sampleScript, sampleWav, } from "./samples.ts";
|
|
19
|
+
export type { SampleWavOptions } from "./samples.ts";
|
|
20
|
+
export type { ConfirmRequest } from "../confirm/prompt.ts";
|
|
21
|
+
export type { Outcome } from "../commands/types.ts";
|
|
22
|
+
export { asepriteFile, fernAseprite } from "./aseprite.ts";
|
|
23
|
+
export type { AsepriteCelInput, AsepriteInput, AsepriteLayerInput } from "./aseprite.ts";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pack test kit, published as `@clockgrove/assetgrove/testing` (design section 11): the
|
|
3
|
+
* scripted provider, a temporary project and settings builder, synthetic samples, and the
|
|
4
|
+
* conformance suite a pack runs on its adapters, kinds and presets. Tests only: nothing here is
|
|
5
|
+
* loaded by core's CLI or MCP server.
|
|
6
|
+
*/
|
|
7
|
+
export { ScriptedProvider } from "../gateway/scripted.js";
|
|
8
|
+
export { scriptedAdapter } from "../providers/adapter.js";
|
|
9
|
+
export { RefusingCaller, CallRefusedError } from "../calls.js";
|
|
10
|
+
export { createExtensionContext as extensionContext } from "../extension/context.js";
|
|
11
|
+
export { assertConformance, exactCheckProblems, resolveEntry, runConformance, } from "./conformance.js";
|
|
12
|
+
export { cli } from "./cli.js";
|
|
13
|
+
export { SCRIPTED_LIMIT, TEST_OPERATOR, tempProject } from "./project.js";
|
|
14
|
+
export { SAMPLE_PALETTE, bibleMarkdown, sampleBible, sampleProfile, samplePng, sampleScript, sampleWav, } from "./samples.js";
|
|
15
|
+
export { asepriteFile, fernAseprite } from "./aseprite.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Transport } from "@modelcontextprotocol/server";
|
|
2
|
+
import type { Env } from "../env.ts";
|
|
3
|
+
/** What `assetgrove mcp` takes on its command line, and the server's environment and log. */
|
|
4
|
+
export interface McpServerOptions {
|
|
5
|
+
/** `--provider-script`: every model call is answered by this module. */
|
|
6
|
+
providerScript?: string;
|
|
7
|
+
/** `--work-item`: the work item the spend ledger counts against. */
|
|
8
|
+
workItem?: string;
|
|
9
|
+
/** `--target`: the project whose library is served as resources. */
|
|
10
|
+
target?: string;
|
|
11
|
+
/** `--read-only`: only the read-only tools. */
|
|
12
|
+
readOnly?: boolean;
|
|
13
|
+
/** The environment settings and keys are read from; the process environment when absent. */
|
|
14
|
+
env?: Env;
|
|
15
|
+
/** Receives the server's log lines (a spawned server's stderr); dropped when absent. */
|
|
16
|
+
log?: (message: string) => void;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Serves core's MCP server in this process, as `assetgrove mcp` with these options would, and
|
|
20
|
+
* connects `client` to it. `client.close()` ends the server and waits for it. A server that refuses
|
|
21
|
+
* to start (exit 2 on the CLI) rejects with its error.
|
|
22
|
+
*/
|
|
23
|
+
export declare function connectMcp(client: {
|
|
24
|
+
connect(transport: Transport): Promise<void>;
|
|
25
|
+
}, options?: McpServerOptions): Promise<void>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tests' MCP session (issue #574): an official MCP client connected to core's `serveMcp` in
|
|
3
|
+
* this process, over a pair of in-memory streams framed as stdio frames them, so a test reaches
|
|
4
|
+
* every tool and resource `assetgrove mcp` serves without starting a process. Tests only: core's
|
|
5
|
+
* CLI and MCP server never load it.
|
|
6
|
+
*/
|
|
7
|
+
import { PassThrough } from "node:stream";
|
|
8
|
+
import { ReadBuffer, serializeMessage } from "@modelcontextprotocol/server";
|
|
9
|
+
import { createRunContext, settingsScope } from "../commands/context.js";
|
|
10
|
+
import { serveMcp } from "../mcp.js";
|
|
11
|
+
/** The client side of the stream pair: messages written to the server, answers read back. */
|
|
12
|
+
class StreamClientTransport {
|
|
13
|
+
onclose;
|
|
14
|
+
onerror;
|
|
15
|
+
onmessage;
|
|
16
|
+
#buffer = new ReadBuffer();
|
|
17
|
+
toServer;
|
|
18
|
+
fromServer;
|
|
19
|
+
served;
|
|
20
|
+
constructor(toServer, fromServer, served) {
|
|
21
|
+
this.toServer = toServer;
|
|
22
|
+
this.fromServer = fromServer;
|
|
23
|
+
this.served = served;
|
|
24
|
+
}
|
|
25
|
+
async start() {
|
|
26
|
+
this.fromServer.on("data", (chunk) => {
|
|
27
|
+
this.#buffer.append(chunk);
|
|
28
|
+
for (;;) {
|
|
29
|
+
let message;
|
|
30
|
+
try {
|
|
31
|
+
message = this.#buffer.readMessage();
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
this.onerror?.(error);
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if (message === null)
|
|
38
|
+
break;
|
|
39
|
+
this.onmessage?.(message);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
async send(message) {
|
|
44
|
+
this.toServer.write(serializeMessage(message));
|
|
45
|
+
}
|
|
46
|
+
/** Ends the server's input and waits until the server has closed. */
|
|
47
|
+
async close() {
|
|
48
|
+
this.toServer.end();
|
|
49
|
+
await this.served.catch(() => { });
|
|
50
|
+
this.#buffer.clear();
|
|
51
|
+
this.onclose?.();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Serves core's MCP server in this process, as `assetgrove mcp` with these options would, and
|
|
56
|
+
* connects `client` to it. `client.close()` ends the server and waits for it. A server that refuses
|
|
57
|
+
* to start (exit 2 on the CLI) rejects with its error.
|
|
58
|
+
*/
|
|
59
|
+
export async function connectMcp(client, options = {}) {
|
|
60
|
+
const ctx = await createRunContext({
|
|
61
|
+
log: options.log ?? (() => { }),
|
|
62
|
+
...(options.env && { env: options.env }),
|
|
63
|
+
...settingsScope({ target: options.target, providerScript: options.providerScript }),
|
|
64
|
+
...(options.providerScript !== undefined && { providerScript: options.providerScript }),
|
|
65
|
+
...(options.workItem !== undefined && { workItem: options.workItem }),
|
|
66
|
+
});
|
|
67
|
+
const toServer = new PassThrough();
|
|
68
|
+
const fromServer = new PassThrough();
|
|
69
|
+
const served = serveMcp(ctx, toServer, fromServer, {
|
|
70
|
+
...(options.target !== undefined && { target: options.target }),
|
|
71
|
+
...(options.readOnly && { readOnly: true }),
|
|
72
|
+
});
|
|
73
|
+
// A refusal at start settles `served` before any answer arrives.
|
|
74
|
+
await Promise.race([
|
|
75
|
+
client.connect(new StreamClientTransport(toServer, fromServer, served)),
|
|
76
|
+
served.then(() => {
|
|
77
|
+
throw new Error("the MCP server ended before the client connected");
|
|
78
|
+
}),
|
|
79
|
+
]);
|
|
80
|
+
}
|