@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,156 @@
|
|
|
1
|
+
import { type Env } from "./env.ts";
|
|
2
|
+
import type { ConfirmPort, ConfirmRequest } from "./confirm/prompt.ts";
|
|
3
|
+
import type { RequestConfirmation } from "./confirm/index.ts";
|
|
4
|
+
import type { Settings } from "./settings.ts";
|
|
5
|
+
/** The gated kinds. There is no `material-encode` operation. */
|
|
6
|
+
export declare const COMMAND_KINDS: readonly ["validator", "material-compression", "material-preview", "provider-script", "tool"];
|
|
7
|
+
export type CommandKind = (typeof COMMAND_KINDS)[number];
|
|
8
|
+
/** What a command's hash covers, and the hash. */
|
|
9
|
+
export interface CommandIdentity {
|
|
10
|
+
kind: CommandKind;
|
|
11
|
+
/** For kind `tool`, the pack's tool id (`<name>:<id>`), inside the hash; absent otherwise. */
|
|
12
|
+
tool?: string;
|
|
13
|
+
/** The argv template, before placeholders are filled. */
|
|
14
|
+
argv: string[];
|
|
15
|
+
/** Relative to the Git top level with `/` (`.` for the top level), or absolute outside one. */
|
|
16
|
+
cwd: string;
|
|
17
|
+
/** The sha256 of each argv element that is a regular file under cwd, by its `/` path from cwd. */
|
|
18
|
+
files: Record<string, string>;
|
|
19
|
+
/** sha256 hex of the canonical `{kind, argv, cwd, files}`. */
|
|
20
|
+
hash: string;
|
|
21
|
+
/**
|
|
22
|
+
* The project the command runs in, outside the hash: the real path of cwd's Git top level, or of
|
|
23
|
+
* cwd outside one. An approval record holds only for the projects it lists.
|
|
24
|
+
*/
|
|
25
|
+
root: string;
|
|
26
|
+
}
|
|
27
|
+
/** How a command came to be approved. */
|
|
28
|
+
export type ApprovalMethod = "settings" | "tty" | "terminal" | "elicitation" | "delegated";
|
|
29
|
+
/** A command step as provenance records it. */
|
|
30
|
+
export interface CommandStep {
|
|
31
|
+
kind: CommandKind;
|
|
32
|
+
/** For kind `tool`, the pack's tool id. */
|
|
33
|
+
tool?: string;
|
|
34
|
+
hash: string;
|
|
35
|
+
method: ApprovalMethod;
|
|
36
|
+
/** For method `delegated`: the command run, who delegated it, the scope and the client. */
|
|
37
|
+
argv?: string[];
|
|
38
|
+
delegatedBy?: string;
|
|
39
|
+
scope?: "command";
|
|
40
|
+
client?: string;
|
|
41
|
+
selfReported?: true;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* What deciding an approval reads: the settings, a channel to ask a person when there is one, and
|
|
45
|
+
* the client's name a delegated step names.
|
|
46
|
+
*/
|
|
47
|
+
export interface ApprovalGate {
|
|
48
|
+
settings: Pick<Settings, "configDir" | "stateDir" | "mode" | "commands" | "contentCredentials" | "audio" | "delegation" | "storage">;
|
|
49
|
+
prompt?: ConfirmPort;
|
|
50
|
+
client?: string;
|
|
51
|
+
}
|
|
52
|
+
/** An approval record as written to `<configDir>/approvals/<hex>.json`. */
|
|
53
|
+
export interface ApprovalRecord {
|
|
54
|
+
kind: CommandKind;
|
|
55
|
+
tool?: string;
|
|
56
|
+
hash: string;
|
|
57
|
+
argv: string[];
|
|
58
|
+
cwd: string;
|
|
59
|
+
files: Record<string, string>;
|
|
60
|
+
/** The projects (`CommandIdentity.root`) a person approved the command in. */
|
|
61
|
+
roots: string[];
|
|
62
|
+
method: "tty" | "terminal" | "elicitation";
|
|
63
|
+
at: string;
|
|
64
|
+
}
|
|
65
|
+
/** The `error.confirmation` of a gated command no one approved. */
|
|
66
|
+
export interface CommandConfirmation {
|
|
67
|
+
kind: "command";
|
|
68
|
+
id: string;
|
|
69
|
+
summary: string;
|
|
70
|
+
confirmCommand: string;
|
|
71
|
+
command: CommandIdentity;
|
|
72
|
+
}
|
|
73
|
+
/** The `error.confirmation` of a settings change no one confirmed (src/settings-write.ts). */
|
|
74
|
+
export interface SettingsConfirmation {
|
|
75
|
+
kind: "settings";
|
|
76
|
+
id: string;
|
|
77
|
+
summary: string;
|
|
78
|
+
confirmCommand: string;
|
|
79
|
+
}
|
|
80
|
+
/** What exit 8 asks a person to confirm: a command, or a spend, pick, write or settings request. */
|
|
81
|
+
export type Confirmation = CommandConfirmation | RequestConfirmation | SettingsConfirmation;
|
|
82
|
+
/**
|
|
83
|
+
* Exit 8: a person must confirm (`confirmation_required` or `_declined`). A paid call outside any
|
|
84
|
+
* run has no request to name, so its confirmation is absent.
|
|
85
|
+
*/
|
|
86
|
+
export declare class ConfirmationError extends Error {
|
|
87
|
+
readonly code: "confirmation_required" | "confirmation_declined";
|
|
88
|
+
readonly confirmation: Confirmation | undefined;
|
|
89
|
+
constructor(code: "confirmation_required" | "confirmation_declined", message: string, confirmation?: Confirmation);
|
|
90
|
+
}
|
|
91
|
+
/** Exit 2 `command_refused`: a command Assetgrove will not start. */
|
|
92
|
+
export declare class CommandRefusedError extends Error {
|
|
93
|
+
readonly code = "command_refused";
|
|
94
|
+
constructor(message: string);
|
|
95
|
+
}
|
|
96
|
+
/** The nearest directory at or above `dir` holding a `.git` entry (a directory or a file). */
|
|
97
|
+
export declare function gitTopLevel(dir: string): string | undefined;
|
|
98
|
+
/** The identity of `{kind, tool?, argv, cwd, files}` in the project `root`, its hash computed. */
|
|
99
|
+
export declare function identityOf(identity: Omit<CommandIdentity, "hash" | "root">, root: string): CommandIdentity;
|
|
100
|
+
/**
|
|
101
|
+
* The identity a stored `{kind, argv, cwd, files, root}` describes, when it is well formed and
|
|
102
|
+
* `{kind, argv, cwd, files}` hashes to `hash`; otherwise undefined. `assetgrove confirm` approves only a pending request whose shown
|
|
103
|
+
* command is the one its id names.
|
|
104
|
+
*/
|
|
105
|
+
export declare function verifiedIdentity(details: unknown, hash: string): CommandIdentity | undefined;
|
|
106
|
+
/** The project of a cwd: the real path of its Git top level, or of the cwd outside one. */
|
|
107
|
+
export declare function projectOf(cwd: string): string;
|
|
108
|
+
/** The cwd as hashed: relative to its Git top level with `/`, or absolute outside a repository. */
|
|
109
|
+
export declare function hashedCwd(cwd: string): string;
|
|
110
|
+
/**
|
|
111
|
+
* The identity of a command run in `cwd` from an argv template. Every argv element without a
|
|
112
|
+
* placeholder that names a regular file under cwd is hashed into `files`.
|
|
113
|
+
*/
|
|
114
|
+
export declare function commandIdentity(kind: CommandKind, argv: string[], cwd: string): CommandIdentity;
|
|
115
|
+
/**
|
|
116
|
+
* The identity of a --provider-script module: argv is its file name, cwd its directory and files
|
|
117
|
+
* its sha256, so the hash follows the module's place in its repository and its bytes.
|
|
118
|
+
*/
|
|
119
|
+
export declare function scriptIdentity(modulePath: string): CommandIdentity;
|
|
120
|
+
/** The confirmation request of a command, as a form or a prompt shows it. */
|
|
121
|
+
export declare function commandRequest(identity: CommandIdentity): ConfirmRequest;
|
|
122
|
+
/** Where a command's approval record lives. */
|
|
123
|
+
export declare function approvalPath(configDir: string, hash: string): string;
|
|
124
|
+
/**
|
|
125
|
+
* Writes an approval record for a command a person accepted in the project `identity.root`,
|
|
126
|
+
* keeping the projects an earlier record of the same hash lists.
|
|
127
|
+
*/
|
|
128
|
+
export declare function writeApproval(configDir: string, identity: CommandIdentity, method: ApprovalRecord["method"]): Promise<string>;
|
|
129
|
+
/**
|
|
130
|
+
* The approval record of a command, when one exists for its hash and lists its project: the same
|
|
131
|
+
* command in another project is asked again.
|
|
132
|
+
*/
|
|
133
|
+
export declare function readApproval(configDir: string, identity: Pick<CommandIdentity, "hash" | "root">): Promise<ApprovalRecord | undefined>;
|
|
134
|
+
/**
|
|
135
|
+
* Returns how a command is approved, asking a person when no approval exists and a channel can.
|
|
136
|
+
* Sources, in order: `settings.commands.approved` (in any project); attended, the record at
|
|
137
|
+
* `<configDir>/approvals/<hex>.json` when it lists the command's project; the settings'
|
|
138
|
+
* `delegation` with the `command` scope, for this run only (it writes no approval record, only
|
|
139
|
+
* the delegated record under `<stateDir>/delegated`); under headless settings nothing else
|
|
140
|
+
* counts; the prompt, whose accept writes that record.
|
|
141
|
+
* Otherwise the request is saved to `<stateDir>/pending/<hex>.json` and exit 8 carries the command.
|
|
142
|
+
*/
|
|
143
|
+
export declare function requireApproval(identity: CommandIdentity, gate: ApprovalGate): Promise<CommandStep>;
|
|
144
|
+
/** The gate of a library call given none: the developer settings, and no one to ask. */
|
|
145
|
+
export declare function defaultGate(): ApprovalGate;
|
|
146
|
+
/**
|
|
147
|
+
* The program a command starts. On Windows a bare `argv[0]` is resolved through PATH and PATHEXT
|
|
148
|
+
* only, never the cwd, whose program no hash covers: one found only in the cwd is refused (exit 2
|
|
149
|
+
* `command_refused`); a path is resolved against the cwd. A `.cmd` or `.bat` result is refused
|
|
150
|
+
* (exit 2 `command_refused`): a shim runs through cmd.exe, a shell. Elsewhere `argv[0]` is
|
|
151
|
+
* returned as is.
|
|
152
|
+
*/
|
|
153
|
+
export declare function resolveProgram(argv0: string, cwd: string, options?: {
|
|
154
|
+
platform?: string;
|
|
155
|
+
env?: Env;
|
|
156
|
+
}): string;
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commands a developer writes (design section 8): the profile's validator, the profile style's
|
|
3
|
+
* material compression and preview commands, and the CLI's --provider-script module. Each runs only
|
|
4
|
+
* with an approval tied to its exact `commandHash`: listed in `settings.commands.approved`, or a
|
|
5
|
+
* record at `<configDir>/approvals/<hex>.json`, or, for one run, the developer settings' `delegation`
|
|
6
|
+
* with the `command` scope (method `delegated`). Otherwise a person is asked (kind `command`) and the
|
|
7
|
+
* accept is recorded; with no channel the command exits 8 `confirmation_required` carrying it, and
|
|
8
|
+
* `assetgrove confirm <hex>` approves it. Commands never run through a shell; on Windows a `.cmd`
|
|
9
|
+
* or `.bat` shim is refused (exit 2 `command_refused`).
|
|
10
|
+
*/
|
|
11
|
+
import { isGitMarker } from "./git-marker.js";
|
|
12
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
13
|
+
import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
|
|
14
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
15
|
+
import { basename, dirname, isAbsolute, join, relative, resolve, sep, win32 } from "node:path";
|
|
16
|
+
import { windowsSearchPath } from "./env.js";
|
|
17
|
+
import { savePending } from "./confirm/pending.js";
|
|
18
|
+
import { delegatedFields, delegationFor } from "./confirm/delegation.js";
|
|
19
|
+
import { loadSettings } from "./settings.js";
|
|
20
|
+
/** The gated kinds. There is no `material-encode` operation. */
|
|
21
|
+
export const COMMAND_KINDS = [
|
|
22
|
+
"validator",
|
|
23
|
+
"material-compression",
|
|
24
|
+
"material-preview",
|
|
25
|
+
"provider-script",
|
|
26
|
+
"tool",
|
|
27
|
+
];
|
|
28
|
+
/**
|
|
29
|
+
* Exit 8: a person must confirm (`confirmation_required` or `_declined`). A paid call outside any
|
|
30
|
+
* run has no request to name, so its confirmation is absent.
|
|
31
|
+
*/
|
|
32
|
+
export class ConfirmationError extends Error {
|
|
33
|
+
code;
|
|
34
|
+
confirmation;
|
|
35
|
+
constructor(code, message, confirmation) {
|
|
36
|
+
super(message);
|
|
37
|
+
this.name = "ConfirmationError";
|
|
38
|
+
this.code = code;
|
|
39
|
+
this.confirmation = confirmation;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/** Exit 2 `command_refused`: a command Assetgrove will not start. */
|
|
43
|
+
export class CommandRefusedError extends Error {
|
|
44
|
+
code = "command_refused";
|
|
45
|
+
constructor(message) {
|
|
46
|
+
super(message);
|
|
47
|
+
this.name = "CommandRefusedError";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function sha256Hex(data) {
|
|
51
|
+
return createHash("sha256").update(data).digest("hex");
|
|
52
|
+
}
|
|
53
|
+
/** The real path, or its nearest existing ancestor's real path joined with the rest. */
|
|
54
|
+
function real(path) {
|
|
55
|
+
if (existsSync(path))
|
|
56
|
+
return realpathSync.native(path);
|
|
57
|
+
const parent = dirname(path);
|
|
58
|
+
return parent === path ? path : join(real(parent), basename(path));
|
|
59
|
+
}
|
|
60
|
+
/** The nearest directory at or above `dir` holding a `.git` entry (a directory or a file). */
|
|
61
|
+
export function gitTopLevel(dir) {
|
|
62
|
+
for (let at = real(resolve(dir));; at = dirname(at)) {
|
|
63
|
+
if (isGitMarker(join(at, ".git")))
|
|
64
|
+
return at;
|
|
65
|
+
if (dirname(at) === at)
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
const toPosix = (path) => path.split(sep).join("/");
|
|
70
|
+
function isFile(path) {
|
|
71
|
+
try {
|
|
72
|
+
return statSync(path).isFile();
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* The canonical JSON of an identity: fixed key order, files sorted by path. A `tool` identity adds
|
|
80
|
+
* its tool id, so every other kind's hash is what it always was.
|
|
81
|
+
*/
|
|
82
|
+
function canonical(identity) {
|
|
83
|
+
const files = Object.fromEntries(Object.entries(identity.files).sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)));
|
|
84
|
+
const { kind, argv, cwd } = identity;
|
|
85
|
+
return JSON.stringify(kind === "tool" ? { kind, tool: identity.tool, argv, cwd, files } : { kind, argv, cwd, files });
|
|
86
|
+
}
|
|
87
|
+
/** The identity of `{kind, tool?, argv, cwd, files}` in the project `root`, its hash computed. */
|
|
88
|
+
export function identityOf(identity, root) {
|
|
89
|
+
return { ...identity, hash: sha256Hex(canonical(identity)), root };
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The identity a stored `{kind, argv, cwd, files, root}` describes, when it is well formed and
|
|
93
|
+
* `{kind, argv, cwd, files}` hashes to `hash`; otherwise undefined. `assetgrove confirm` approves only a pending request whose shown
|
|
94
|
+
* command is the one its id names.
|
|
95
|
+
*/
|
|
96
|
+
export function verifiedIdentity(details, hash) {
|
|
97
|
+
if (typeof details !== "object" || details === null)
|
|
98
|
+
return undefined;
|
|
99
|
+
const d = details;
|
|
100
|
+
const kind = d.kind;
|
|
101
|
+
if (typeof kind !== "string" || !COMMAND_KINDS.includes(kind)) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
if (!Array.isArray(d.argv) || !d.argv.every((a) => typeof a === "string"))
|
|
105
|
+
return undefined;
|
|
106
|
+
if (typeof d.cwd !== "string")
|
|
107
|
+
return undefined;
|
|
108
|
+
if (typeof d.files !== "object" || d.files === null || Array.isArray(d.files))
|
|
109
|
+
return undefined;
|
|
110
|
+
const files = d.files;
|
|
111
|
+
if (!Object.values(files).every((v) => typeof v === "string"))
|
|
112
|
+
return undefined;
|
|
113
|
+
if (typeof d.root !== "string" || d.root === "")
|
|
114
|
+
return undefined;
|
|
115
|
+
if (kind === "tool" && typeof d.tool !== "string")
|
|
116
|
+
return undefined;
|
|
117
|
+
const identity = {
|
|
118
|
+
kind: kind,
|
|
119
|
+
...(kind === "tool" && { tool: d.tool }),
|
|
120
|
+
argv: [...d.argv],
|
|
121
|
+
cwd: d.cwd,
|
|
122
|
+
files: { ...files },
|
|
123
|
+
};
|
|
124
|
+
return sha256Hex(canonical(identity)) === hash ? { ...identity, hash, root: d.root } : undefined;
|
|
125
|
+
}
|
|
126
|
+
/** The project of a cwd: the real path of its Git top level, or of the cwd outside one. */
|
|
127
|
+
export function projectOf(cwd) {
|
|
128
|
+
const full = real(resolve(cwd));
|
|
129
|
+
return gitTopLevel(full) ?? full;
|
|
130
|
+
}
|
|
131
|
+
/** The cwd as hashed: relative to its Git top level with `/`, or absolute outside a repository. */
|
|
132
|
+
export function hashedCwd(cwd) {
|
|
133
|
+
const full = real(resolve(cwd));
|
|
134
|
+
const top = gitTopLevel(full);
|
|
135
|
+
if (top === undefined)
|
|
136
|
+
return toPosix(full);
|
|
137
|
+
return toPosix(relative(top, full)) || ".";
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* The identity of a command run in `cwd` from an argv template. Every argv element without a
|
|
141
|
+
* placeholder that names a regular file under cwd is hashed into `files`.
|
|
142
|
+
*/
|
|
143
|
+
export function commandIdentity(kind, argv, cwd) {
|
|
144
|
+
const full = real(resolve(cwd));
|
|
145
|
+
const files = {};
|
|
146
|
+
for (const arg of argv) {
|
|
147
|
+
if (arg === "" || arg.includes("{{"))
|
|
148
|
+
continue;
|
|
149
|
+
// An absolute argument is compared by its real path, as the cwd is: a file inside the project
|
|
150
|
+
// named through a symlink or an 8.3 short path is still hashed, so changing it asks again.
|
|
151
|
+
const path = isAbsolute(arg) ? real(arg) : resolve(full, arg);
|
|
152
|
+
const rel = relative(full, path);
|
|
153
|
+
if (rel === "" || rel.startsWith("..") || isAbsolute(rel) || !isFile(path))
|
|
154
|
+
continue;
|
|
155
|
+
files[toPosix(rel)] = sha256Hex(readFileSync(path));
|
|
156
|
+
}
|
|
157
|
+
const identity = { kind, argv: [...argv], cwd: hashedCwd(full), files };
|
|
158
|
+
return { ...identity, hash: sha256Hex(canonical(identity)), root: projectOf(full) };
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The identity of a --provider-script module: argv is its file name, cwd its directory and files
|
|
162
|
+
* its sha256, so the hash follows the module's place in its repository and its bytes.
|
|
163
|
+
*/
|
|
164
|
+
export function scriptIdentity(modulePath) {
|
|
165
|
+
const full = real(resolve(modulePath));
|
|
166
|
+
if (!isFile(full)) {
|
|
167
|
+
// An unreadable module still gets a stable identity; loading it then fails as invalid input.
|
|
168
|
+
const identity = {
|
|
169
|
+
kind: "provider-script",
|
|
170
|
+
argv: [basename(full)],
|
|
171
|
+
cwd: hashedCwd(dirname(full)),
|
|
172
|
+
files: {},
|
|
173
|
+
};
|
|
174
|
+
return { ...identity, hash: sha256Hex(canonical(identity)), root: projectOf(dirname(full)) };
|
|
175
|
+
}
|
|
176
|
+
return commandIdentity("provider-script", [basename(full)], dirname(full));
|
|
177
|
+
}
|
|
178
|
+
/** What a command is called in a message: `the validator command`, `the tool godot:engine`. */
|
|
179
|
+
function named(identity) {
|
|
180
|
+
return identity.kind === "tool" ? `the tool ${identity.tool}` : `the ${identity.kind} command`;
|
|
181
|
+
}
|
|
182
|
+
function confirmation(identity) {
|
|
183
|
+
return {
|
|
184
|
+
kind: "command",
|
|
185
|
+
id: identity.hash,
|
|
186
|
+
summary: `run ${named(identity)} ${JSON.stringify(identity.argv)} in ${identity.cwd}`,
|
|
187
|
+
confirmCommand: `assetgrove confirm ${identity.hash}`,
|
|
188
|
+
command: {
|
|
189
|
+
kind: identity.kind,
|
|
190
|
+
...(identity.tool !== undefined && { tool: identity.tool }),
|
|
191
|
+
hash: identity.hash,
|
|
192
|
+
argv: identity.argv,
|
|
193
|
+
cwd: identity.cwd,
|
|
194
|
+
files: identity.files,
|
|
195
|
+
root: identity.root,
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
/** The confirmation request of a command, as a form or a prompt shows it. */
|
|
200
|
+
export function commandRequest(identity) {
|
|
201
|
+
return {
|
|
202
|
+
kind: "command",
|
|
203
|
+
id: identity.hash,
|
|
204
|
+
summary: identity.kind === "tool"
|
|
205
|
+
? `Assetgrove wants to run the tool ${identity.tool} a pack declares, in scratch:`
|
|
206
|
+
: `Assetgrove wants to run a ${identity.kind} command a file names:`,
|
|
207
|
+
details: {
|
|
208
|
+
kind: identity.kind,
|
|
209
|
+
...(identity.tool !== undefined && { tool: identity.tool }),
|
|
210
|
+
argv: identity.argv,
|
|
211
|
+
cwd: identity.cwd,
|
|
212
|
+
files: identity.files,
|
|
213
|
+
root: identity.root,
|
|
214
|
+
hash: identity.hash,
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/** Where a command's approval record lives. */
|
|
219
|
+
export function approvalPath(configDir, hash) {
|
|
220
|
+
return join(configDir, "approvals", `${hash}.json`);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Writes an approval record for a command a person accepted in the project `identity.root`,
|
|
224
|
+
* keeping the projects an earlier record of the same hash lists.
|
|
225
|
+
*/
|
|
226
|
+
export async function writeApproval(configDir, identity, method) {
|
|
227
|
+
const earlier = await readRecord(configDir, identity.hash);
|
|
228
|
+
const record = {
|
|
229
|
+
kind: identity.kind,
|
|
230
|
+
...(identity.tool !== undefined && { tool: identity.tool }),
|
|
231
|
+
hash: identity.hash,
|
|
232
|
+
argv: identity.argv,
|
|
233
|
+
cwd: identity.cwd,
|
|
234
|
+
files: identity.files,
|
|
235
|
+
roots: [...new Set([...(earlier?.roots ?? []), identity.root])],
|
|
236
|
+
method,
|
|
237
|
+
at: new Date().toISOString(),
|
|
238
|
+
};
|
|
239
|
+
const path = approvalPath(configDir, identity.hash);
|
|
240
|
+
await mkdir(dirname(path), { recursive: true });
|
|
241
|
+
await writeFile(path, `${JSON.stringify(record, null, 2)}\n`);
|
|
242
|
+
return path;
|
|
243
|
+
}
|
|
244
|
+
/** The approval record of a hash, when one exists, names that hash and lists its projects. */
|
|
245
|
+
async function readRecord(configDir, hash) {
|
|
246
|
+
let record;
|
|
247
|
+
try {
|
|
248
|
+
record = JSON.parse(await readFile(approvalPath(configDir, hash), "utf8"));
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
return undefined;
|
|
252
|
+
}
|
|
253
|
+
const listed = Array.isArray(record.roots) && record.roots.every((r) => typeof r === "string");
|
|
254
|
+
return record.hash === hash && listed ? record : undefined;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* The approval record of a command, when one exists for its hash and lists its project: the same
|
|
258
|
+
* command in another project is asked again.
|
|
259
|
+
*/
|
|
260
|
+
export async function readApproval(configDir, identity) {
|
|
261
|
+
const record = await readRecord(configDir, identity.hash);
|
|
262
|
+
return record?.roots.includes(identity.root) ? record : undefined;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Records one delegated command approval at `<stateDir>/delegated/<time>-<hex>.json`: the step
|
|
266
|
+
* (argv, `delegatedBy`, scope, client, `selfReported`), its cwd and when. Every delegated command
|
|
267
|
+
* leaves this record, a provider script too, whose run keeps no command step; it approves nothing
|
|
268
|
+
* later (approval files live under `<configDir>/approvals`).
|
|
269
|
+
*/
|
|
270
|
+
async function recordDelegated(stateDir, step, cwd) {
|
|
271
|
+
const at = new Date().toISOString();
|
|
272
|
+
const dir = join(stateDir, "delegated");
|
|
273
|
+
await mkdir(dir, { recursive: true });
|
|
274
|
+
const name = `${at.replace(/[:.]/g, "-")}-${step.hash}-${randomBytes(4).toString("hex")}.json`;
|
|
275
|
+
await writeFile(join(dir, name), `${JSON.stringify({ ...step, cwd, at }, null, 2)}\n`);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Returns how a command is approved, asking a person when no approval exists and a channel can.
|
|
279
|
+
* Sources, in order: `settings.commands.approved` (in any project); attended, the record at
|
|
280
|
+
* `<configDir>/approvals/<hex>.json` when it lists the command's project; the settings'
|
|
281
|
+
* `delegation` with the `command` scope, for this run only (it writes no approval record, only
|
|
282
|
+
* the delegated record under `<stateDir>/delegated`); under headless settings nothing else
|
|
283
|
+
* counts; the prompt, whose accept writes that record.
|
|
284
|
+
* Otherwise the request is saved to `<stateDir>/pending/<hex>.json` and exit 8 carries the command.
|
|
285
|
+
*/
|
|
286
|
+
export async function requireApproval(identity, gate) {
|
|
287
|
+
const { settings } = gate;
|
|
288
|
+
const step = (method) => ({
|
|
289
|
+
kind: identity.kind,
|
|
290
|
+
...(identity.tool !== undefined && { tool: identity.tool }),
|
|
291
|
+
hash: identity.hash,
|
|
292
|
+
method,
|
|
293
|
+
});
|
|
294
|
+
if (settings.commands.approved.some((entry) => entry.hash.toLowerCase() === identity.hash))
|
|
295
|
+
return step("settings");
|
|
296
|
+
const asked = confirmation(identity);
|
|
297
|
+
const record = settings.mode === "headless" ? undefined : await readApproval(settings.configDir, identity);
|
|
298
|
+
if (record !== undefined)
|
|
299
|
+
return step(record.method);
|
|
300
|
+
const delegation = delegationFor(settings, "command");
|
|
301
|
+
if (delegation !== undefined) {
|
|
302
|
+
const delegated = {
|
|
303
|
+
...step("delegated"),
|
|
304
|
+
argv: identity.argv,
|
|
305
|
+
...delegatedFields(delegation, "command", gate.client),
|
|
306
|
+
scope: "command",
|
|
307
|
+
};
|
|
308
|
+
await recordDelegated(settings.stateDir, delegated, identity.cwd);
|
|
309
|
+
return delegated;
|
|
310
|
+
}
|
|
311
|
+
if (settings.mode === "headless") {
|
|
312
|
+
throw new ConfirmationError("confirmation_required", `${named(identity)} ${JSON.stringify(identity.argv)} (hash ${identity.hash}) is not in settings.commands.approved; headless settings run only commands listed there`, asked);
|
|
313
|
+
}
|
|
314
|
+
const request = commandRequest(identity);
|
|
315
|
+
if (gate.prompt) {
|
|
316
|
+
if (!(await gate.prompt.confirm(request))) {
|
|
317
|
+
throw new ConfirmationError("confirmation_declined", `${named(identity)} ${JSON.stringify(identity.argv)} was declined`, asked);
|
|
318
|
+
}
|
|
319
|
+
await writeApproval(settings.configDir, identity, gate.prompt.method);
|
|
320
|
+
return step(gate.prompt.method);
|
|
321
|
+
}
|
|
322
|
+
await savePending(settings.stateDir, request);
|
|
323
|
+
throw new ConfirmationError("confirmation_required", `${named(identity)} ${JSON.stringify(identity.argv)} in ${identity.cwd} needs approval; run: ${asked.confirmCommand}`, asked);
|
|
324
|
+
}
|
|
325
|
+
/** The gate of a library call given none: the developer settings, and no one to ask. */
|
|
326
|
+
export function defaultGate() {
|
|
327
|
+
return { settings: loadSettings() };
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* The program a command starts. On Windows a bare `argv[0]` is resolved through PATH and PATHEXT
|
|
331
|
+
* only, never the cwd, whose program no hash covers: one found only in the cwd is refused (exit 2
|
|
332
|
+
* `command_refused`); a path is resolved against the cwd. A `.cmd` or `.bat` result is refused
|
|
333
|
+
* (exit 2 `command_refused`): a shim runs through cmd.exe, a shell. Elsewhere `argv[0]` is
|
|
334
|
+
* returned as is.
|
|
335
|
+
*/
|
|
336
|
+
export function resolveProgram(argv0, cwd, options = {}) {
|
|
337
|
+
const platform = options.platform ?? process.platform;
|
|
338
|
+
if (platform !== "win32")
|
|
339
|
+
return argv0;
|
|
340
|
+
const search = windowsSearchPath(options.env);
|
|
341
|
+
const exts = (search.pathext ?? ".COM;.EXE;.BAT;.CMD")
|
|
342
|
+
.split(";")
|
|
343
|
+
.filter(Boolean)
|
|
344
|
+
.map((e) => e.toLowerCase());
|
|
345
|
+
const bare = !(/[\\/]/.test(argv0) || win32.isAbsolute(argv0));
|
|
346
|
+
const bases = bare
|
|
347
|
+
? (search.path ?? "")
|
|
348
|
+
.split(";")
|
|
349
|
+
.filter(Boolean)
|
|
350
|
+
.map((dir) => win32.join(dir, argv0))
|
|
351
|
+
: [win32.resolve(cwd, argv0)];
|
|
352
|
+
const hasExt = exts.includes(win32.extname(argv0).toLowerCase());
|
|
353
|
+
const candidatesOf = (base) => (hasExt ? [base] : exts.map((ext) => base + ext));
|
|
354
|
+
for (const base of bases) {
|
|
355
|
+
const found = candidatesOf(base).find(isFile);
|
|
356
|
+
if (found === undefined)
|
|
357
|
+
continue;
|
|
358
|
+
if (/\.(cmd|bat)$/i.test(found)) {
|
|
359
|
+
throw new CommandRefusedError(`"${argv0}" resolves to ${found}, a .cmd or .bat shim, which runs through a shell; name the program itself, for example ["node", "<script>"]`);
|
|
360
|
+
}
|
|
361
|
+
return found;
|
|
362
|
+
}
|
|
363
|
+
// Not on PATH: Windows would start a program of that name from the cwd, which no hash covers.
|
|
364
|
+
const local = bare ? candidatesOf(win32.join(cwd, argv0)).find(isFile) : undefined;
|
|
365
|
+
if (local !== undefined) {
|
|
366
|
+
throw new CommandRefusedError(`"${argv0}" is not on PATH and resolves to ${local} in the command's directory, which its approval does not cover; name the program by its path`);
|
|
367
|
+
}
|
|
368
|
+
return argv0;
|
|
369
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ApprovalGate, CommandIdentity } from "../approvals.ts";
|
|
2
|
+
import type { RegisteredTool } from "../extensions/registry.ts";
|
|
3
|
+
import type { ToolStep } from "../extension/tools.ts";
|
|
4
|
+
import type { Settings } from "../settings.ts";
|
|
5
|
+
import type { AudioItem } from "./engine.ts";
|
|
6
|
+
/** AAC renditions are 48 kHz. */
|
|
7
|
+
export declare const AAC_RATE = 48000;
|
|
8
|
+
export declare const AAC_MEDIA_TYPE = "audio/mp4";
|
|
9
|
+
export declare const AAC_TOOL = "audio:ffmpeg";
|
|
10
|
+
/** The encoder's defaults: bitrate in kbps. */
|
|
11
|
+
export declare const AAC_DEFAULTS: {
|
|
12
|
+
readonly bitrate: 128;
|
|
13
|
+
};
|
|
14
|
+
/** The fixed argv, relative to scratch: the WAV on standard input, the `.m4a` left in scratch. */
|
|
15
|
+
export declare const AAC_ARGS: readonly string[];
|
|
16
|
+
/** The tool the developer settings' `audio.ffmpeg` names. */
|
|
17
|
+
export declare function aacTool(settings: Pick<Settings, "audio">): RegisteredTool;
|
|
18
|
+
/** The identity of the AAC run with `executable`, which a developer approves (docs/audio.md). */
|
|
19
|
+
export declare function aacToolIdentity(executable: string, projectDir: string): CommandIdentity;
|
|
20
|
+
/** The encoder as recorded on each `.m4a`: FFmpeg's version and licence, and the executable's hash. */
|
|
21
|
+
export interface AacEncoder {
|
|
22
|
+
name: "ffmpeg aac";
|
|
23
|
+
version: string;
|
|
24
|
+
vendor: "FFmpeg";
|
|
25
|
+
license: string;
|
|
26
|
+
sha256: string;
|
|
27
|
+
}
|
|
28
|
+
export interface AacRendition {
|
|
29
|
+
bytes: Uint8Array;
|
|
30
|
+
sampleRate: 48000;
|
|
31
|
+
channels: number;
|
|
32
|
+
/** The 48 kHz frames fed to the encoder. */
|
|
33
|
+
frames: number;
|
|
34
|
+
paddingStartFrames: number;
|
|
35
|
+
paddingEndFrames: number;
|
|
36
|
+
encoder: AacEncoder;
|
|
37
|
+
tool: ToolStep;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Encodes a master as AAC-LC in `.m4a` at 48 kHz through the approved FFmpeg run. The master goes
|
|
41
|
+
* in as a float or 24-bit WAV so the converter adds no quantisation.
|
|
42
|
+
*/
|
|
43
|
+
export declare function encodeAac(master: AudioItem, run: {
|
|
44
|
+
gate: ApprovalGate;
|
|
45
|
+
projectDir: string;
|
|
46
|
+
}): Promise<AacRendition>;
|
|
47
|
+
/** What the `.m4a` records of its own padding. */
|
|
48
|
+
export interface AacPadding {
|
|
49
|
+
sampleRate: number;
|
|
50
|
+
channels: number;
|
|
51
|
+
/** `mp4a.40.2`, AAC-LC. */
|
|
52
|
+
codec: string;
|
|
53
|
+
/** The priming a decoder drops from the start: the edit list's `media_time`. */
|
|
54
|
+
paddingStartFrames: number;
|
|
55
|
+
/** The frames after the audio, to the end of the last AAC frame. */
|
|
56
|
+
paddingEndFrames: number;
|
|
57
|
+
/** The audio frames between the paddings, at the track's rate. */
|
|
58
|
+
frames: number;
|
|
59
|
+
}
|
|
60
|
+
/** Reads the padding from an `.m4a`'s edit list; refuses a file without one, with other tracks or codecs. */
|
|
61
|
+
export declare function readAacPadding(bytes: Uint8Array): AacPadding;
|