summer-engine 3.8.0 → 4.2.0
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/.claude-plugin/marketplace.json +2 -13
- package/.claude-plugin/plugin.json +24 -22
- package/.codex-plugin/plugin.json +18 -22
- package/.cursor-plugin/plugin.json +8 -14
- package/.factory-plugin/plugin.json +6 -13
- package/AGENTS.md +19 -12
- package/CHANGELOG.md +133 -0
- package/GEMINI.md +3 -3
- package/README.md +118 -37
- package/assets/icon.png +0 -0
- package/commands/start.md +71 -0
- package/commands/summer.md +3 -2
- package/dist/cli/banner.js +3 -0
- package/dist/cli/commands/config.js +3 -2
- package/dist/cli/commands/create.js +12 -3
- package/dist/cli/commands/list.d.ts +5 -0
- package/dist/cli/commands/list.js +30 -13
- package/dist/cli/commands/login.d.ts +27 -0
- package/dist/cli/commands/login.js +58 -12
- package/dist/cli/commands/memory.js +6 -2
- package/dist/cli/commands/ops.d.ts +64 -0
- package/dist/cli/commands/ops.js +329 -0
- package/dist/cli/commands/setup.d.ts +4 -0
- package/dist/cli/commands/setup.js +254 -26
- package/dist/cli/commands/skills.js +28 -11
- package/dist/cli/commands/status.d.ts +26 -0
- package/dist/cli/commands/status.js +36 -21
- package/dist/cli/index.js +7 -0
- package/dist/core/agent-host.d.ts +65 -0
- package/dist/core/agent-host.js +193 -0
- package/dist/core/capabilities/agent-playbook.d.ts +3 -0
- package/dist/core/capabilities/agent-playbook.js +54 -2
- package/dist/core/capabilities/apps.d.ts +33 -10
- package/dist/core/capabilities/apps.js +25 -12
- package/dist/core/capabilities/audit/args.d.ts +6 -6
- package/dist/core/capabilities/doctor.d.ts +3 -0
- package/dist/core/capabilities/doctor.js +20 -15
- package/dist/core/capabilities/fabricate-mesh.d.ts +4 -4
- package/dist/core/capabilities/game-task-plan.d.ts +12 -6
- package/dist/core/capabilities/game-task-plan.js +80 -5
- package/dist/core/capabilities/hdri-import.d.ts +2 -2
- package/dist/core/capabilities/motion-generation.d.ts +2 -2
- package/dist/core/capabilities/motion-generation.js +2 -2
- package/dist/core/capabilities/navigation/open.d.ts +6 -2
- package/dist/core/capabilities/navigation/open.js +3 -0
- package/dist/core/capabilities/placement.d.ts +23 -23
- package/dist/core/capabilities/publish-build.js +2 -0
- package/dist/core/capabilities/runtime-control.d.ts +42 -42
- package/dist/core/capabilities/scene-script-target.d.ts +17 -0
- package/dist/core/capabilities/scene-script-target.js +70 -0
- package/dist/core/capabilities/seeing/args.d.ts +16 -16
- package/dist/core/capabilities/sfx-choices.d.ts +4 -0
- package/dist/core/capabilities/sfx-choices.js +13 -6
- package/dist/core/capabilities/tool-dispatch.d.ts +12 -3
- package/dist/core/capabilities/tool-dispatch.js +81 -46
- package/dist/core/capabilities/ui-control.d.ts +2 -2
- package/dist/core/capabilities/world-snapshot.d.ts +4 -4
- package/dist/core/embeddings.d.ts +2 -0
- package/dist/core/embeddings.js +1 -1
- package/dist/core/error-codes.d.ts +62 -0
- package/dist/core/error-codes.js +97 -0
- package/dist/core/format.d.ts +2 -0
- package/dist/core/format.js +2 -1
- package/dist/core/hosted-mcp.d.ts +22 -0
- package/dist/core/hosted-mcp.js +56 -1
- package/dist/core/library-read.js +5 -0
- package/dist/core/library-search.d.ts +2 -2
- package/dist/core/library-search.js +2 -1
- package/dist/core/oauth.js +4 -0
- package/dist/core/ops/areas.d.ts +11 -0
- package/dist/core/ops/areas.js +24 -0
- package/dist/core/ops/catalog.d.ts +45 -0
- package/dist/core/ops/catalog.js +157 -0
- package/dist/core/ops/cloud.d.ts +64 -0
- package/dist/core/ops/cloud.js +198 -0
- package/dist/core/ops/contract.d.ts +120 -0
- package/dist/core/ops/contract.js +134 -0
- package/dist/core/ops/engine-answer.d.ts +25 -0
- package/dist/core/ops/engine-answer.js +117 -0
- package/dist/core/ops/engine.d.ts +55 -0
- package/dist/core/ops/engine.js +649 -0
- package/dist/core/ops/public-catalog.d.ts +48 -0
- package/dist/core/ops/public-catalog.js +56 -0
- package/dist/core/ops/save-files.d.ts +78 -0
- package/dist/core/ops/save-files.js +419 -0
- package/dist/core/ops/search.d.ts +8 -0
- package/dist/core/ops/search.js +187 -0
- package/dist/core/skills-registry.d.ts +16 -1
- package/dist/core/skills-registry.js +35 -2
- package/dist/core/telemetry.d.ts +32 -0
- package/dist/core/telemetry.js +38 -10
- package/dist/core/tool-profiles.d.ts +25 -0
- package/dist/core/tool-profiles.js +41 -0
- package/dist/installer/agent-config.d.ts +17 -4
- package/dist/installer/agent-config.js +27 -6
- package/dist/installer/agent-table.d.ts +12 -0
- package/dist/installer/agent-table.js +33 -9
- package/dist/installer/cli-permissions.d.ts +65 -0
- package/dist/installer/cli-permissions.js +182 -0
- package/dist/installer/setup.d.ts +4 -0
- package/dist/installer/setup.js +12 -4
- package/dist/installer/skills-refresh.d.ts +29 -0
- package/dist/installer/skills-refresh.js +261 -0
- package/dist/installer/version-check.d.ts +51 -11
- package/dist/installer/version-check.js +147 -37
- package/dist/mcp/command.js +7 -0
- package/dist/mcp/hosted-mount.d.ts +27 -2
- package/dist/mcp/hosted-mount.js +53 -23
- package/dist/mcp/legacy-toolset.d.ts +27 -0
- package/dist/mcp/legacy-toolset.js +43 -0
- package/dist/mcp/ops-surface.d.ts +59 -0
- package/dist/mcp/ops-surface.js +453 -0
- package/dist/mcp/server.d.ts +45 -11
- package/dist/mcp/server.js +263 -89
- package/dist/mcp/tool-results.d.ts +26 -0
- package/dist/mcp/tool-results.js +81 -0
- package/dist/mcp/tool-surface.d.ts +65 -0
- package/dist/mcp/tool-surface.js +317 -0
- package/dist/mcp/tools/app-tools.js +9 -2
- package/dist/mcp/tools/asset-tools.js +55 -53
- package/dist/mcp/tools/audit-tools.js +21 -21
- package/dist/mcp/tools/debug-tools.js +6 -6
- package/dist/mcp/tools/fabricate-tools.js +6 -6
- package/dist/mcp/tools/generate-tools.js +76 -70
- package/dist/mcp/tools/project-tools.d.ts +9 -4
- package/dist/mcp/tools/project-tools.js +16 -10
- package/dist/mcp/tools/scene-tools.js +12 -23
- package/dist/mcp/tools/script-tools.js +9 -5
- package/dist/mcp/tools/with-engine.d.ts +6 -0
- package/dist/mcp/tools/with-engine.js +19 -0
- package/dist/project-memory/agent-instructions.d.ts +47 -0
- package/dist/project-memory/agent-instructions.js +226 -0
- package/gemini-extension.json +6 -13
- package/hooks/pre-commit-doctor.sh +5 -4
- package/hooks/session-start.sh +24 -28
- package/integrations/README.md +1 -1
- package/integrations/claude/README.md +6 -0
- package/integrations/claude/manifest-target.json +4 -0
- package/integrations/claude-desktop/README.md +1 -1
- package/integrations/copilot-jetbrains/README.md +1 -1
- package/integrations/gemini/README.md +11 -0
- package/integrations/junie/README.md +1 -1
- package/integrations/lm-studio/README.md +1 -1
- package/integrations/trae/README.md +1 -1
- package/integrations/visual-studio/README.md +1 -1
- package/integrations/windsurf/README.md +1 -1
- package/library/references/mcp-tools-reference/mcp-tools-reference.md +79 -51
- package/library/references/mcp-tools-reference/resource.yaml +1 -1
- package/library/references/product-map/resource.yaml +2 -2
- package/library/skills/3d-lighting/SKILL.md +69 -28
- package/library/skills/3d-lighting/resource.yaml +1 -1
- package/library/skills/README.md +121 -118
- package/library/skills/adaptive-music/SKILL.md +40 -23
- package/library/skills/adaptive-music/resource.yaml +1 -1
- package/library/skills/agent-playtesting/SKILL.md +23 -1
- package/library/skills/agent-playtesting/resource.yaml +1 -1
- package/library/skills/ai-characters-in-games/SKILL.md +16 -1
- package/library/skills/ai-characters-in-games/resource.yaml +1 -1
- package/library/skills/ambient-bed/SKILL.md +38 -13
- package/library/skills/ambient-bed/resource.yaml +1 -1
- package/library/skills/animated-loop/SKILL.md +60 -32
- package/library/skills/animated-loop/resource.yaml +1 -1
- package/library/skills/animation-tree/SKILL.md +27 -1
- package/library/skills/animation-tree/resource.yaml +1 -1
- package/library/skills/art-direction/SKILL.md +17 -3
- package/library/skills/art-direction/resource.yaml +1 -1
- package/library/skills/asset-strategy/SKILL.md +51 -4
- package/library/skills/asset-strategy/resource.yaml +2 -1
- package/library/skills/audio-direction/SKILL.md +26 -10
- package/library/skills/audio-direction/resource.yaml +1 -1
- package/library/skills/auto-fire-targeting/SKILL.md +15 -1
- package/library/skills/auto-fire-targeting/resource.yaml +1 -1
- package/library/skills/bounded-engine-runs/SKILL.md +1 -1
- package/library/skills/bounded-engine-runs/resource.yaml +1 -1
- package/library/skills/brainstorm-game/SKILL.md +14 -1
- package/library/skills/brainstorm-game/resource.yaml +1 -1
- package/library/skills/brainstorming/SKILL.md +1 -1
- package/library/skills/brainstorming/resource.yaml +1 -1
- package/library/skills/browse-templates/SKILL.md +11 -1
- package/library/skills/browse-templates/resource.yaml +1 -1
- package/library/skills/camera-rigs/SKILL.md +22 -2
- package/library/skills/camera-rigs/resource.yaml +1 -1
- package/library/skills/celeste-momentum-platforming/resource.yaml +1 -0
- package/library/skills/character-animation-wiring/SKILL.md +28 -4
- package/library/skills/character-animation-wiring/resource.yaml +1 -1
- package/library/skills/character-model/SKILL.md +83 -47
- package/library/skills/character-model/resource.yaml +1 -1
- package/library/skills/character-movement/SKILL.md +27 -3
- package/library/skills/character-movement/resource.yaml +1 -1
- package/library/skills/character-portrait/SKILL.md +39 -19
- package/library/skills/character-portrait/resource.yaml +1 -1
- package/library/skills/cinematic-cutscene/SKILL.md +79 -46
- package/library/skills/cinematic-cutscene/resource.yaml +1 -1
- package/library/skills/combat-basics/SKILL.md +20 -1
- package/library/skills/combat-basics/resource.yaml +1 -1
- package/library/skills/compatibility-renderer-traps/SKILL.md +12 -1
- package/library/skills/compatibility-renderer-traps/resource.yaml +1 -1
- package/library/skills/concept-art/SKILL.md +29 -12
- package/library/skills/concept-art/resource.yaml +1 -1
- package/library/skills/concept-to-level/SKILL.md +258 -0
- package/library/skills/concept-to-level/references/technical-rules.md +150 -0
- package/library/skills/concept-to-level/resource.yaml +44 -0
- package/library/skills/create-asset-sheet/SKILL.md +37 -13
- package/library/skills/create-asset-sheet/resource.yaml +1 -1
- package/library/skills/debug/SKILL.md +34 -2
- package/library/skills/debug/resource.yaml +1 -1
- package/library/skills/debugging-game-feel/SKILL.md +13 -1
- package/library/skills/debugging-game-feel/resource.yaml +1 -1
- package/library/skills/design-level/SKILL.md +40 -35
- package/library/skills/design-level/resource.yaml +1 -1
- package/library/skills/design-mechanic/SKILL.md +18 -1
- package/library/skills/design-mechanic/resource.yaml +1 -1
- package/library/skills/design-npc/SKILL.md +43 -24
- package/library/skills/design-npc/resource.yaml +1 -1
- package/library/skills/diagnosing-perf-regressions/SKILL.md +13 -1
- package/library/skills/diagnosing-perf-regressions/resource.yaml +1 -1
- package/library/skills/driving-the-editor-ui/SKILL.md +24 -1
- package/library/skills/driving-the-editor-ui/resource.yaml +1 -1
- package/library/skills/environment-kit/SKILL.md +43 -16
- package/library/skills/environment-kit/resource.yaml +1 -1
- package/library/skills/export-and-ship/SKILL.md +29 -6
- package/library/skills/export-and-ship/resource.yaml +1 -1
- package/library/skills/fabricating-assets/SKILL.md +30 -7
- package/library/skills/fabricating-assets/resource.yaml +3 -3
- package/library/skills/facial-and-lipsync/SKILL.md +36 -15
- package/library/skills/facial-and-lipsync/resource.yaml +1 -1
- package/library/skills/fps-controller/SKILL.md +50 -41
- package/library/skills/fps-controller/resource.yaml +1 -1
- package/library/skills/game-feel/SKILL.md +34 -8
- package/library/skills/game-feel/resource.yaml +1 -1
- package/library/skills/gameskill/SKILL.md +15 -4
- package/library/skills/gameskill/resource.yaml +1 -1
- package/library/skills/gdscript-patterns/SKILL.md +16 -1
- package/library/skills/gdscript-patterns/resource.yaml +1 -1
- package/library/skills/generate-motion/SKILL.md +51 -21
- package/library/skills/generate-motion/resource.yaml +1 -1
- package/library/skills/godogen-visual-proof-game-generation/SKILL.md +18 -1
- package/library/skills/godogen-visual-proof-game-generation/resource.yaml +1 -0
- package/library/skills/grow-analytics/SKILL.md +13 -3
- package/library/skills/grow-analytics/resource.yaml +1 -1
- package/library/skills/headless-scripting/SKILL.md +14 -1
- package/library/skills/headless-scripting/resource.yaml +1 -1
- package/library/skills/in-game-purchases/SKILL.md +12 -1
- package/library/skills/in-game-purchases/resource.yaml +1 -1
- package/library/skills/instantiate-asset-pack/SKILL.md +19 -2
- package/library/skills/instantiate-asset-pack/resource.yaml +1 -1
- package/library/skills/lumera-single-image-scene-reconstruction/resource.yaml +1 -0
- package/library/skills/make-game/SKILL.md +33 -4
- package/library/skills/make-game/references/2d-platformer.md +1 -1
- package/library/skills/make-game/references/3d-fps.md +1 -1
- package/library/skills/make-game/references/3d-horror.md +1 -1
- package/library/skills/make-game/references/3d-third-person.md +2 -2
- package/library/skills/make-game/resource.yaml +1 -1
- package/library/skills/multiplayer/SKILL.md +13 -1
- package/library/skills/multiplayer/resource.yaml +1 -1
- package/library/skills/multiplayer-movement/SKILL.md +19 -1
- package/library/skills/multiplayer-movement/resource.yaml +1 -1
- package/library/skills/multiplayer-project/SKILL.md +18 -1
- package/library/skills/multiplayer-project/resource.yaml +1 -1
- package/library/skills/multiplayer-publish/SKILL.md +25 -7
- package/library/skills/multiplayer-publish/resource.yaml +3 -3
- package/library/skills/multiplayer-state/SKILL.md +17 -1
- package/library/skills/multiplayer-state/resource.yaml +1 -1
- package/library/skills/multiplayer-testing/SKILL.md +16 -1
- package/library/skills/multiplayer-testing/resource.yaml +1 -1
- package/library/skills/music-track/SKILL.md +38 -13
- package/library/skills/music-track/resource.yaml +1 -1
- package/library/skills/navigate-summer/SKILL.md +26 -9
- package/library/skills/navigate-summer/resource.yaml +1 -1
- package/library/skills/new-project/SKILL.md +12 -1
- package/library/skills/new-project/resource.yaml +1 -1
- package/library/skills/organic-model/SKILL.md +48 -18
- package/library/skills/organic-model/resource.yaml +1 -1
- package/library/skills/pixel-art/SKILL.md +42 -23
- package/library/skills/pixel-art/resource.yaml +1 -1
- package/library/skills/play/SKILL.md +19 -1
- package/library/skills/play/resource.yaml +1 -1
- package/library/skills/playtesting-a-feature/SKILL.md +24 -1
- package/library/skills/playtesting-a-feature/resource.yaml +1 -1
- package/library/skills/procedural-animation/SKILL.md +38 -16
- package/library/skills/procedural-animation/resource.yaml +1 -1
- package/library/skills/prop-model/SKILL.md +48 -19
- package/library/skills/prop-model/resource.yaml +1 -1
- package/library/skills/psx-retro-rendering/resource.yaml +1 -0
- package/library/skills/publish-your-game/SKILL.md +43 -6
- package/library/skills/publish-your-game/resource.yaml +3 -3
- package/library/skills/realtime-wet-surfaces/resource.yaml +1 -0
- package/library/skills/release-readiness/SKILL.md +13 -1
- package/library/skills/release-readiness/resource.yaml +1 -1
- package/library/skills/remote-deploy/SKILL.md +15 -1
- package/library/skills/remote-deploy/resource.yaml +1 -1
- package/library/skills/retarget/SKILL.md +43 -20
- package/library/skills/retarget/resource.yaml +1 -1
- package/library/skills/running-in-the-cloud/SKILL.md +11 -1
- package/library/skills/running-in-the-cloud/resource.yaml +1 -1
- package/library/skills/save-load/SKILL.md +16 -1
- package/library/skills/save-load/resource.yaml +1 -1
- package/library/skills/scene-composition/SKILL.md +18 -1
- package/library/skills/scene-composition/resource.yaml +1 -1
- package/library/skills/scene-hierarchy-design/SKILL.md +26 -2
- package/library/skills/scene-hierarchy-design/resource.yaml +1 -1
- package/library/skills/scene-scripting/SKILL.md +96 -636
- package/library/skills/scene-scripting/references/ctx-api.md +184 -0
- package/library/skills/scene-scripting/references/recipes-2d-ui.md +193 -0
- package/library/skills/scene-scripting/references/recipes-3d.md +280 -0
- package/library/skills/scene-scripting/resource.yaml +4 -4
- package/library/skills/scene-to-level/SKILL.md +24 -2
- package/library/skills/scene-to-level/resource.yaml +1 -1
- package/library/skills/skill-create/resource.yaml +1 -0
- package/library/skills/skill-improve/resource.yaml +1 -0
- package/library/skills/skill-test/SKILL.md +12 -2
- package/library/skills/skill-test/resource.yaml +1 -0
- package/library/skills/skintokens-auto-rigging/resource.yaml +1 -0
- package/library/skills/skybox-panorama/SKILL.md +47 -21
- package/library/skills/skybox-panorama/resource.yaml +1 -1
- package/library/skills/sound-effect/SKILL.md +52 -20
- package/library/skills/sound-effect/resource.yaml +1 -1
- package/library/skills/spatial-placement/SKILL.md +44 -9
- package/library/skills/spatial-placement/resource.yaml +1 -1
- package/library/skills/sprite-sheet/SKILL.md +55 -27
- package/library/skills/sprite-sheet/resource.yaml +1 -1
- package/library/skills/store-art/SKILL.md +14 -3
- package/library/skills/store-art/resource.yaml +2 -2
- package/library/skills/store-listing/SKILL.md +13 -3
- package/library/skills/store-listing/resource.yaml +2 -2
- package/library/skills/summer-analytics/SKILL.md +22 -5
- package/library/skills/summer-analytics/resource.yaml +2 -2
- package/library/skills/summer-apps/SKILL.md +77 -32
- package/library/skills/summer-apps/manifest.md +1 -1
- package/library/skills/summer-apps/minimal-app.md +7 -7
- package/library/skills/summer-apps/resource.yaml +1 -1
- package/library/skills/summer-apps/sdk-reference.md +5 -5
- package/library/skills/summer-apps-design/SKILL.md +1 -1
- package/library/skills/summer-apps-design/resource.yaml +1 -1
- package/library/skills/summer-assets/SKILL.md +86 -0
- package/library/skills/summer-assets/resource.yaml +34 -0
- package/library/skills/summer-cli/SKILL.md +133 -0
- package/library/skills/summer-cli/resource.yaml +31 -0
- package/library/skills/summer-friends/SKILL.md +14 -0
- package/library/skills/summer-leaderboards/SKILL.md +16 -0
- package/library/skills/summer-match-results/SKILL.md +17 -0
- package/library/skills/summer-matchmaking/SKILL.md +17 -0
- package/library/skills/summer-parties/SKILL.md +14 -0
- package/library/skills/summer-player-data/SKILL.md +14 -0
- package/library/skills/summer-store/SKILL.md +16 -1
- package/library/skills/summer-world-chat/SKILL.md +14 -0
- package/library/skills/summer-world-saves/SKILL.md +14 -0
- package/library/skills/text-to-motion/SKILL.md +45 -23
- package/library/skills/text-to-motion/prompts-and-controls.md +5 -5
- package/library/skills/text-to-motion/resource.yaml +1 -1
- package/library/skills/text-to-motion/rigging-for-text-motion.md +2 -2
- package/library/skills/tileable-texture/SKILL.md +37 -15
- package/library/skills/tileable-texture/resource.yaml +1 -1
- package/library/skills/trailer-shot/SKILL.md +46 -24
- package/library/skills/trailer-shot/resource.yaml +1 -1
- package/library/skills/tune-performance/SKILL.md +32 -6
- package/library/skills/tune-performance/resource.yaml +1 -1
- package/library/skills/ui-basics/SKILL.md +55 -36
- package/library/skills/ui-basics/resource.yaml +1 -1
- package/library/skills/ui-graphics/SKILL.md +64 -38
- package/library/skills/ui-graphics/resource.yaml +1 -1
- package/library/skills/use-widget-asset/SKILL.md +15 -1
- package/library/skills/use-widget-asset/resource.yaml +1 -1
- package/library/skills/using-summer/SKILL.md +32 -5
- package/library/skills/using-summer/resource.yaml +3 -2
- package/library/skills/vehicle-model/SKILL.md +92 -57
- package/library/skills/vehicle-model/resource.yaml +1 -1
- package/library/skills/verification-before-completion/SKILL.md +1 -1
- package/library/skills/verification-before-completion/resource.yaml +1 -1
- package/library/skills/verifying-scenes/SKILL.md +31 -2
- package/library/skills/verifying-scenes/resource.yaml +1 -1
- package/library/skills/vfx-dissolve/SKILL.md +21 -2
- package/library/skills/vfx-dissolve/resource.yaml +1 -1
- package/library/skills/vfx-fire/SKILL.md +41 -41
- package/library/skills/vfx-fire/resource.yaml +1 -1
- package/library/skills/vfx-hit-spark/SKILL.md +24 -1
- package/library/skills/vfx-hit-spark/resource.yaml +1 -1
- package/library/skills/vfx-lightning/SKILL.md +30 -16
- package/library/skills/vfx-lightning/resource.yaml +1 -1
- package/library/skills/vfx-magic-glow/SKILL.md +46 -32
- package/library/skills/vfx-magic-glow/resource.yaml +1 -1
- package/library/skills/vfx-muzzle-flash/SKILL.md +43 -35
- package/library/skills/vfx-muzzle-flash/resource.yaml +1 -1
- package/library/skills/vfx-smoke/SKILL.md +39 -31
- package/library/skills/vfx-smoke/resource.yaml +1 -1
- package/library/skills/vfx-water-ripple/SKILL.md +35 -31
- package/library/skills/vfx-water-ripple/resource.yaml +1 -1
- package/library/skills/voice-line/SKILL.md +87 -40
- package/library/skills/voice-line/resource.yaml +1 -1
- package/library/skills/web-and-touch-input/SKILL.md +20 -1
- package/library/skills/web-and-touch-input/resource.yaml +1 -1
- package/library/skills/web-compatibility-look/SKILL.md +21 -1
- package/library/skills/web-compatibility-look/resource.yaml +1 -1
- package/library/skills/world-building-3d/SKILL.md +29 -1
- package/library/skills/world-building-3d/resource.yaml +1 -1
- package/library/skills/writing-skills/resource.yaml +1 -0
- package/library/tools/add-node/GUIDE.md +14 -0
- package/library/tools/align-distribute-3d/GUIDE.md +7 -0
- package/library/tools/app-call/resource.yaml +1 -1
- package/library/tools/app-guide/resource.yaml +2 -2
- package/library/tools/app-page/resource.yaml +1 -1
- package/library/tools/app-screenshot/resource.yaml +19 -1
- package/library/tools/app-tools/resource.yaml +1 -1
- package/library/tools/attach-to-surface/GUIDE.md +15 -0
- package/library/tools/batch/GUIDE.md +27 -0
- package/library/tools/camera-bookmark/GUIDE.md +12 -0
- package/library/tools/capture-gameplay/GUIDE.md +3 -0
- package/library/tools/capture-gameplay/resource.yaml +3 -3
- package/library/tools/check-job/resource.yaml +1 -1
- package/library/tools/clear-console/GUIDE.md +3 -0
- package/library/tools/connect-ports/GUIDE.md +9 -0
- package/library/tools/connect-signal/GUIDE.md +14 -0
- package/library/tools/create-debug-report/GUIDE.md +10 -0
- package/library/tools/create-scene/GUIDE.md +10 -0
- package/library/tools/debug-views/GUIDE.md +7 -0
- package/library/tools/enable-plugin/GUIDE.md +3 -0
- package/library/tools/export-game/GUIDE.md +3 -0
- package/library/tools/export-game/resource.yaml +3 -3
- package/library/tools/export-templates/GUIDE.md +3 -0
- package/library/tools/fabricate-3d/GUIDE.md +19 -0
- package/library/tools/frame-nodes/GUIDE.md +9 -0
- package/library/tools/frame-shot/GUIDE.md +9 -0
- package/library/tools/game-control/GUIDE.md +9 -0
- package/library/tools/game-input/GUIDE.md +9 -0
- package/library/tools/game-probe/GUIDE.md +9 -0
- package/library/tools/generate-3d/resource.yaml +3 -3
- package/library/tools/generate-motion/resource.yaml +2 -2
- package/library/tools/get-console/GUIDE.md +9 -0
- package/library/tools/get-console/resource.yaml +5 -0
- package/library/tools/get-debugger-errors/GUIDE.md +7 -0
- package/library/tools/get-debugger-errors/resource.yaml +5 -0
- package/library/tools/get-debugger-warnings/GUIDE.md +7 -0
- package/library/tools/get-debugger-warnings/resource.yaml +5 -0
- package/library/tools/get-diagnostics/GUIDE.md +13 -0
- package/library/tools/get-project-context/GUIDE.md +25 -0
- package/library/tools/get-runtime-tree/GUIDE.md +7 -0
- package/library/tools/get-runtime-tree/resource.yaml +5 -0
- package/library/tools/get-scene-tree/GUIDE.md +11 -0
- package/library/tools/get-scene-tree/resource.yaml +5 -0
- package/library/tools/get-script-errors/GUIDE.md +5 -0
- package/library/tools/grep/GUIDE.md +11 -0
- package/library/tools/import-asset/GUIDE.md +8 -0
- package/library/tools/import-asset-by-id/GUIDE.md +12 -0
- package/library/tools/import-from-url/GUIDE.md +10 -0
- package/library/tools/import-from-url-batch/GUIDE.md +3 -0
- package/library/tools/import-hdri/GUIDE.md +16 -0
- package/library/tools/input-map-bind/GUIDE.md +11 -0
- package/library/tools/inspect-asset/GUIDE.md +14 -0
- package/library/tools/inspect-asset/resource.yaml +5 -0
- package/library/tools/inspect-node/GUIDE.md +11 -0
- package/library/tools/inspect-node/resource.yaml +5 -0
- package/library/tools/inspect-resource/GUIDE.md +7 -0
- package/library/tools/inspect-resource/resource.yaml +5 -0
- package/library/tools/inspect-runtime-node/GUIDE.md +7 -0
- package/library/tools/inspect-runtime-node/resource.yaml +5 -0
- package/library/tools/instantiate-scene/GUIDE.md +12 -0
- package/library/tools/is-running/GUIDE.md +3 -0
- package/library/tools/measure/GUIDE.md +8 -0
- package/library/tools/navigation-probe/GUIDE.md +9 -0
- package/library/tools/open/resource.yaml +2 -2
- package/library/tools/open-main-scene/GUIDE.md +6 -0
- package/library/tools/open-scene/GUIDE.md +8 -0
- package/library/tools/place-adjacent/GUIDE.md +7 -0
- package/library/tools/play/GUIDE.md +13 -0
- package/library/tools/project-setting/GUIDE.md +9 -0
- package/library/tools/publish-build/resource.yaml +6 -6
- package/library/tools/raycast/GUIDE.md +7 -0
- package/library/tools/read-file/GUIDE.md +10 -0
- package/library/tools/read-library/resource.yaml +5 -0
- package/library/tools/recent-events/GUIDE.md +7 -0
- package/library/tools/remove-node/GUIDE.md +3 -0
- package/library/tools/repeat-along/GUIDE.md +5 -0
- package/library/tools/replace-node/GUIDE.md +9 -0
- package/library/tools/replace-text/GUIDE.md +5 -0
- package/library/tools/run-editor-script/GUIDE.md +16 -0
- package/library/tools/run-script/GUIDE.md +30 -0
- package/library/tools/run-script/resource.yaml +6 -3
- package/library/tools/runtime-animate/GUIDE.md +7 -0
- package/library/tools/runtime-call/GUIDE.md +7 -0
- package/library/tools/runtime-set/GUIDE.md +9 -0
- package/library/tools/runtime-spawn/GUIDE.md +9 -0
- package/library/tools/save-scene/GUIDE.md +3 -0
- package/library/tools/scene-audit/GUIDE.md +29 -0
- package/library/tools/screenshot/GUIDE.md +17 -0
- package/library/tools/select-node/GUIDE.md +3 -0
- package/library/tools/set-prop/GUIDE.md +23 -0
- package/library/tools/set-resource-property/GUIDE.md +8 -0
- package/library/tools/shot-sheet/GUIDE.md +7 -0
- package/library/tools/snap-to-surface/GUIDE.md +17 -0
- package/library/tools/snapshot-diff/GUIDE.md +7 -0
- package/library/tools/starcast/GUIDE.md +12 -0
- package/library/tools/stop/GUIDE.md +3 -0
- package/library/tools/test-placement/GUIDE.md +7 -0
- package/library/tools/ui-actions/GUIDE.md +12 -0
- package/library/tools/ui-activate/GUIDE.md +11 -0
- package/library/tools/ui-screenshot/GUIDE.md +9 -0
- package/library/tools/ui-tree/GUIDE.md +10 -0
- package/library/tools/wait-for-event/GUIDE.md +11 -0
- package/library/tools/world-snapshot/GUIDE.md +9 -0
- package/library/tools/write-file/GUIDE.md +5 -0
- package/library/tools/zoom/GUIDE.md +5 -0
- package/package.json +8 -5
- package/registry/generated/counts.json +2 -2
- package/registry/generated/gemini-extension.json +6 -13
- package/registry/generated/index.json +482 -349
- package/registry/generated/marketplace.claude.json +2 -13
- package/registry/generated/plugin.claude-directory.json +168 -0
- package/registry/generated/plugin.claude.json +24 -22
- package/registry/generated/plugin.codex.json +18 -22
- package/registry/generated/plugin.cursor.json +8 -14
- package/registry/generated/plugin.factory.json +6 -13
- package/registry/generated/server.json +43 -0
- package/registry/generated/skills-index.md +121 -118
- package/registry/generated/skills-registry.json +167 -115
- package/registry/operations/fixtures/invalid-deprecated-without-replacement.json +60 -0
- package/registry/operations/fixtures/invalid-name.json +60 -0
- package/registry/operations/fixtures/invalid-publish-without-owner.json +82 -0
- package/registry/operations/fixtures/invalid-spend-without-estimate.json +42 -0
- package/registry/operations/fixtures/invalid-unknown-field.json +61 -0
- package/registry/operations/fixtures/valid-player-facing.json +82 -0
- package/registry/operations/fixtures/valid-read.json +60 -0
- package/registry/operations/fixtures/valid-spend.json +43 -0
- package/registry/operations/legacy-names.json +1241 -0
- package/registry/operations/public-catalog.json +33160 -0
- package/registry/schemas/operation.schema.json +318 -0
- package/registry/schemas/skill.schema.json +4 -0
- package/CLAUDE.md +0 -7
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { CLI_AREAS } from "../../core/ops/areas.js";
|
|
3
|
+
import { localEntries, localInputSchema, localWireForm, missingInput } from "../../core/ops/catalog.js";
|
|
4
|
+
import { answerOfHosted, callHostedV4, describeFromShipped, hostedCallFailure, searchEverywhere } from "../../core/ops/cloud.js";
|
|
5
|
+
import { errorAnswer, isLocalOp, localToolsFor, opFromCli, OP_NAME, resolveOpName } from "../../core/ops/contract.js";
|
|
6
|
+
import { ENGINE_SPLIT_OPS, engineOpDef, splitToolArgs } from "../../core/ops/engine.js";
|
|
7
|
+
import { engineFailure, engineNotRunning } from "../../core/ops/engine-answer.js";
|
|
8
|
+
import { loadLibraryIndex } from "../../core/library-search.js";
|
|
9
|
+
import { FileSaver, withOutField } from "../../core/ops/save-files.js";
|
|
10
|
+
import { dispatchTool, EngineUnavailableError, ToolResultError } from "../../core/capabilities/tool-dispatch.js";
|
|
11
|
+
/**
|
|
12
|
+
* The CLI view of the operation catalog (on by default; SUMMER_SURFACE=v3 leaves it out):
|
|
13
|
+
*
|
|
14
|
+
* summer <area> <action> [--<field> <value> ...] [--input '<json>'] [--dry-run] [--idempotency-key <k>] [--wait] [--json]
|
|
15
|
+
* summer whoami
|
|
16
|
+
* summer ops search <words...> | summer ops describe <op>
|
|
17
|
+
*
|
|
18
|
+
* Engine and local operations run in this process (the same functions
|
|
19
|
+
* `summer tool` runs); cloud operations run on the hosted Summer server
|
|
20
|
+
* through its summer_call, with the person's sign-in.
|
|
21
|
+
*/
|
|
22
|
+
export { CLI_AREAS };
|
|
23
|
+
const RESERVED_FLAGS = new Set(["json", "dry-run", "wait", "idempotency-key", "input"]);
|
|
24
|
+
const camel = (flag) => flag.replace(/-([a-z0-9])/g, (_match, letter) => letter.toUpperCase());
|
|
25
|
+
/** A flag's field: camelCase (`--scene-path` is scenePath), or snake_case when the schema names it so (`--look-at` is look_at). */
|
|
26
|
+
function fieldName(flag, schema) {
|
|
27
|
+
const snake = flag.replace(/-/g, "_");
|
|
28
|
+
return snake !== flag && schema?.properties?.[snake] && !schema.properties[camel(flag)] ? snake : camel(flag);
|
|
29
|
+
}
|
|
30
|
+
function coerce(value, schema) {
|
|
31
|
+
const type = Array.isArray(schema?.type) ? schema?.type[0] : schema?.type;
|
|
32
|
+
if (value === true)
|
|
33
|
+
return true;
|
|
34
|
+
if (type === "number" || type === "integer")
|
|
35
|
+
return Number(value);
|
|
36
|
+
if (type === "boolean")
|
|
37
|
+
return value === "true";
|
|
38
|
+
if (type === "string")
|
|
39
|
+
return value;
|
|
40
|
+
if (type === "object" || type === "array") {
|
|
41
|
+
try {
|
|
42
|
+
return JSON.parse(value);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return type === "array" ? value.split(",") : value;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return /^(-?\d+(\.\d+)?|true|false)$/.test(value) ? JSON.parse(value) : value;
|
|
49
|
+
}
|
|
50
|
+
/** `--max-items 3 --tag a --tag b --no-loop` -> `{ maxItems: 3, tag: ["a", "b"], loop: false }`, typed by the schema. */
|
|
51
|
+
export function parseCallFlags(argv, schema) {
|
|
52
|
+
const out = { input: {}, json: false, dryRun: false, wait: false };
|
|
53
|
+
const fields = {};
|
|
54
|
+
for (let index = 0; index < argv.length; index++) {
|
|
55
|
+
const token = argv[index];
|
|
56
|
+
if (!token.startsWith("--"))
|
|
57
|
+
throw new Error(`Unexpected argument "${token}". Pass fields as --name value.`);
|
|
58
|
+
const [rawName, inline] = token.slice(2).split(/=(.*)/s, 2);
|
|
59
|
+
if (rawName === "json")
|
|
60
|
+
out.json = true;
|
|
61
|
+
else if (rawName === "dry-run")
|
|
62
|
+
out.dryRun = true;
|
|
63
|
+
else if (rawName === "wait")
|
|
64
|
+
out.wait = true;
|
|
65
|
+
else if (rawName === "idempotency-key" || rawName === "input") {
|
|
66
|
+
const value = inline ?? argv[++index];
|
|
67
|
+
if (value === undefined)
|
|
68
|
+
throw new Error(`--${rawName} needs a value.`);
|
|
69
|
+
if (rawName === "input") {
|
|
70
|
+
const parsed = JSON.parse(value);
|
|
71
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
72
|
+
throw new Error("--input must be a JSON object.");
|
|
73
|
+
Object.assign(out.input, parsed);
|
|
74
|
+
}
|
|
75
|
+
else
|
|
76
|
+
out.idempotencyKey = value;
|
|
77
|
+
}
|
|
78
|
+
else if (rawName.startsWith("no-") && !RESERVED_FLAGS.has(rawName)) {
|
|
79
|
+
fields[fieldName(rawName.slice(3), schema)] = false;
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
const name = fieldName(rawName, schema);
|
|
83
|
+
const next = argv[index + 1];
|
|
84
|
+
const value = inline ?? (next !== undefined && !next.startsWith("--") ? (index++, next) : true);
|
|
85
|
+
const property = schema?.properties?.[name];
|
|
86
|
+
const typed = property?.type === "array" ? coerce(value, property.items) : coerce(value, property);
|
|
87
|
+
if (property?.type === "array")
|
|
88
|
+
fields[name] = [...(fields[name] ?? []), ...(Array.isArray(typed) ? typed : [typed])];
|
|
89
|
+
else
|
|
90
|
+
fields[name] = name in fields ? [...[fields[name]].flat(), typed] : typed;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
out.input = { ...out.input, ...fields };
|
|
94
|
+
// --dry-run anywhere makes a dry run, whatever the input says: allow rules for dry runs rely on it (installer/cli-permissions.ts).
|
|
95
|
+
if (out.dryRun)
|
|
96
|
+
delete out.input.dryRun;
|
|
97
|
+
return out;
|
|
98
|
+
}
|
|
99
|
+
export const defaultOpsCliDeps = {
|
|
100
|
+
hosted: (name, args) => callHostedV4(name, args),
|
|
101
|
+
dispatch: dispatchTool,
|
|
102
|
+
print: (text) => process.stdout.write(`${text}\n`),
|
|
103
|
+
printError: (text) => process.stderr.write(`${text}\n`),
|
|
104
|
+
};
|
|
105
|
+
/** The docs.read id of a local tool's guide (tool/<slug>). */
|
|
106
|
+
function guideOf(toolName) {
|
|
107
|
+
const entry = loadLibraryIndex().find((candidate) => candidate.kind === "tool" && candidate.mcp_tool_name === toolName);
|
|
108
|
+
return entry?.id;
|
|
109
|
+
}
|
|
110
|
+
async function runLocal(op, call, deps) {
|
|
111
|
+
// A split operation runs its 3.x tool with the action fixed (core/ops/engine.ts).
|
|
112
|
+
const split = ENGINE_SPLIT_OPS[op];
|
|
113
|
+
const entry = localEntries().find((candidate) => candidate.name === op);
|
|
114
|
+
const tool = split?.tool ?? entry?.mcpTool ?? localToolsFor(op)[0];
|
|
115
|
+
if (!tool)
|
|
116
|
+
return errorAnswer("not_found", `No operation is named "${op}".`, { next: { op: "ops.search", input: { query: op } } });
|
|
117
|
+
// maxCharacters cuts the text an MCP client gets; the CLI prints the whole answer.
|
|
118
|
+
const { maxCharacters, ...input } = call.input;
|
|
119
|
+
const uncut = maxCharacters === undefined ? undefined : ["maxCharacters: the CLI prints the whole answer; cut it in the shell (for example | head -c 8000)."];
|
|
120
|
+
const args = split ? splitToolArgs(split, input) : input;
|
|
121
|
+
const def = engineOpDef(op);
|
|
122
|
+
const guide = guideOf(tool);
|
|
123
|
+
const describe = guide && def ? { op: "docs.read", input: { id: guide } } : { op: "ops.describe", input: { name: op } };
|
|
124
|
+
const missing = missingInput(localInputSchema(op), input);
|
|
125
|
+
if (missing)
|
|
126
|
+
return errorAnswer("invalid_input", missing, { next: describe });
|
|
127
|
+
if (call.dryRun) {
|
|
128
|
+
return { ok: true, status: "dry_run", preview: { summary: `${entry?.title ?? op}: the input is valid. Nothing was done.`, changes: [], approval: entry?.approval ?? "none", estimate: null, valid: true } };
|
|
129
|
+
}
|
|
130
|
+
try {
|
|
131
|
+
return { ok: true, status: "done", result: await deps.dispatch(tool, args), ...(uncut ? { warnings: uncut } : {}) };
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
if (error instanceof EngineUnavailableError)
|
|
135
|
+
return engineNotRunning();
|
|
136
|
+
if (error instanceof ToolResultError) {
|
|
137
|
+
return def ? engineFailure(JSON.stringify(error.result), op, { effect: def.effect, guide }) : errorAnswer("invalid_input", error.message, { details: { tool: error.result } });
|
|
138
|
+
}
|
|
139
|
+
return errorAnswer("invalid_input", error instanceof Error ? error.message : String(error), { next: describe });
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async function runCloud(op, call, deps) {
|
|
143
|
+
try {
|
|
144
|
+
return answerOfHosted(await deps.hosted("summer_call", { op, input: call.input, ...(call.dryRun ? { dryRun: true } : {}), ...(call.idempotencyKey ? { idempotencyKey: call.idempotencyKey } : {}) }));
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
return hostedCallFailure(error, { op, dryRun: call.dryRun, idempotencyKey: call.idempotencyKey });
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
/** The input schema used to type flags: the local descriptor, or the hosted ops.describe. */
|
|
151
|
+
async function schemaFor(op, deps) {
|
|
152
|
+
if (isLocalOp(op))
|
|
153
|
+
return localInputSchema(op);
|
|
154
|
+
const answer = await runCloud("ops.describe", { input: { name: op }, json: true, dryRun: false, wait: false }, deps);
|
|
155
|
+
const input = answer.ok && answer.status === "done" ? answer.result.operation?.input : undefined;
|
|
156
|
+
return input ? withOutField(op, input) : null;
|
|
157
|
+
}
|
|
158
|
+
/** Failed waits the job itself does not cause: the call to Summer did not get through. */
|
|
159
|
+
const WAIT_DID_NOT_GET_THROUGH = new Set(["unavailable", "outcome_unknown", "not_signed_in", "forbidden", "rate_limited"]);
|
|
160
|
+
/** Follow a running job or an approval until it ends (jobs.wait, at most 50 s per call). */
|
|
161
|
+
async function waitFor(answer, deps) {
|
|
162
|
+
let current = answer;
|
|
163
|
+
if (current.ok && current.status === "needs_approval")
|
|
164
|
+
deps.printError(`Waiting for approval: ${current.approval.url}`);
|
|
165
|
+
for (let round = 0; round < 120 && current.ok && (current.status === "running" || current.status === "needs_approval"); round++) {
|
|
166
|
+
const job = current.job.id;
|
|
167
|
+
const waited = await runCloud("jobs.wait", { input: { jobId: job, timeoutSeconds: 50 }, json: true, dryRun: false, wait: false }, deps);
|
|
168
|
+
// The job runs on whatever the wait answered: a failed wait names it, so the job is waited on, not started again.
|
|
169
|
+
// One that did not get through says to wait again; any other keeps its own next step (sign in, slow down).
|
|
170
|
+
if (!waited.ok && WAIT_DID_NOT_GET_THROUGH.has(waited.error.code)) {
|
|
171
|
+
const { code, message, retry, next, details } = waited.error;
|
|
172
|
+
return errorAnswer(code, `${message} Job ${job} is still on Summer's server.`, {
|
|
173
|
+
retry,
|
|
174
|
+
next: code === "unavailable" ? { op: "jobs.wait", input: { jobId: job } } : next,
|
|
175
|
+
details: { ...details, job },
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
if (!waited.ok || waited.status !== "done")
|
|
179
|
+
return waited;
|
|
180
|
+
const result = waited.result;
|
|
181
|
+
if (!result.finished)
|
|
182
|
+
continue;
|
|
183
|
+
// An approved generation runs on as its own job: follow that job.
|
|
184
|
+
const chained = result.job.result;
|
|
185
|
+
if (result.job.state === "done" && chained?.status === "running" && chained.job?.id) {
|
|
186
|
+
current = { ok: true, status: "running", job: chained.job };
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
if (result.job.state === "done")
|
|
190
|
+
return { ok: true, status: "done", result: result.job.result ?? {} };
|
|
191
|
+
return errorAnswer(result.job.state === "failed" ? "invalid_input" : "conflict", result.job.error?.message ?? `The job ended: ${result.job.state}.`, { details: { job } });
|
|
192
|
+
}
|
|
193
|
+
return current;
|
|
194
|
+
}
|
|
195
|
+
/** A value as one shell word: single quotes, so the shell expands nothing in it. */
|
|
196
|
+
const shellWord = (value) => (/^[\w./:@+=-]+$/.test(value) ? value : `'${value.replace(/'/g, `'\\''`)}'`);
|
|
197
|
+
/** The answer for a person; `out` is the --out to keep in the printed wait command. */
|
|
198
|
+
export function formatAnswer(answer, out) {
|
|
199
|
+
const waitFlags = (id) => `summer jobs wait --job-id ${id}${out ? ` --out ${shellWord(out)}` : ""}`;
|
|
200
|
+
if (!answer.ok) {
|
|
201
|
+
const next = answer.error.next;
|
|
202
|
+
const step = !next ? "" : "op" in next ? `\nNext: ${next.op}` : "url" in next ? `\nNext: ${next.label}: ${next.url}` : `\nNext: ${next.say}`;
|
|
203
|
+
return `Error (${answer.error.code}): ${answer.error.message}${step}`;
|
|
204
|
+
}
|
|
205
|
+
switch (answer.status) {
|
|
206
|
+
case "done":
|
|
207
|
+
return JSON.stringify(answer.result, null, 2);
|
|
208
|
+
case "running":
|
|
209
|
+
return `Started: job ${answer.job.id}. Wait for it: ${waitFlags(answer.job.id)}`;
|
|
210
|
+
case "needs_approval":
|
|
211
|
+
return `Needs approval (${answer.approval.who}): ${answer.approval.summary}\n${answer.approval.url}\nNothing changes until they approve. Follow it: ${waitFlags(answer.job.id)}`;
|
|
212
|
+
case "dry_run":
|
|
213
|
+
return `Dry run: ${String(answer.preview.summary ?? "")}\n${JSON.stringify(answer.preview, null, 2)}`;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/** Run one operation from the command line and print its answer; returns the exit code. */
|
|
217
|
+
export async function runOpFromCli(op, argv, deps = defaultOpsCliDeps) {
|
|
218
|
+
if (!OP_NAME.test(op)) {
|
|
219
|
+
deps.printError(formatAnswer(errorAnswer("invalid_input", `"${op}" is not an operation name (area action).`, { next: { op: "ops.search" } })));
|
|
220
|
+
return 1;
|
|
221
|
+
}
|
|
222
|
+
let call;
|
|
223
|
+
try {
|
|
224
|
+
const hasFields = argv.some((token) => token.startsWith("--") && !RESERVED_FLAGS.has(token.slice(2).split("=")[0]));
|
|
225
|
+
call = parseCallFlags(argv, hasFields ? await schemaFor(op, deps) : null);
|
|
226
|
+
}
|
|
227
|
+
catch (error) {
|
|
228
|
+
deps.printError(formatAnswer(errorAnswer("invalid_input", error instanceof Error ? error.message : String(error))));
|
|
229
|
+
return 1;
|
|
230
|
+
}
|
|
231
|
+
let answer;
|
|
232
|
+
let out;
|
|
233
|
+
if (isLocalOp(op)) {
|
|
234
|
+
answer = await runLocal(op, call, deps);
|
|
235
|
+
if (call.wait)
|
|
236
|
+
answer = await waitFor(answer, deps);
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
// --out stays here: the files save on this machine once the answer (or the waited job) names them.
|
|
240
|
+
const files = deps.files ?? new FileSaver({ saveByDefault: true });
|
|
241
|
+
const taken = files.take(op, call.input);
|
|
242
|
+
out = taken.out;
|
|
243
|
+
answer = await runCloud(op, { ...call, input: taken.input }, deps);
|
|
244
|
+
if (call.wait)
|
|
245
|
+
answer = await waitFor(answer, deps);
|
|
246
|
+
answer = await files.finish(op, answer, out);
|
|
247
|
+
}
|
|
248
|
+
(answer.ok ? deps.print : deps.printError)(call.json ? JSON.stringify(answer) : formatAnswer(answer, out));
|
|
249
|
+
if (!call.json && answer.ok)
|
|
250
|
+
for (const warning of answer.warnings ?? [])
|
|
251
|
+
deps.printError(`Warning: ${warning}`);
|
|
252
|
+
return answer.ok ? 0 : 1;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* `summer ops search <words...>`: every operation, local and cloud, signed in
|
|
256
|
+
* or not; a cloud one that needs a sign-in says so. A how-to (docs.search
|
|
257
|
+
* first) points at the library.
|
|
258
|
+
*/
|
|
259
|
+
export async function searchFromCli(query, options, deps = defaultOpsCliDeps) {
|
|
260
|
+
const { items, warning } = await searchEverywhere(query, { area: options.area, limit: options.limit }, deps.hosted);
|
|
261
|
+
if (options.json) {
|
|
262
|
+
deps.print(JSON.stringify({ ok: true, status: "done", result: { items }, ...(warning ? { warnings: [warning] } : {}) }));
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
for (const item of items)
|
|
266
|
+
deps.print(`${item.name.padEnd(32)} ${item.effect.padEnd(13)} ${item.title}${item.needsSignIn ? " (needs sign-in)" : ""}`);
|
|
267
|
+
if (items[0]?.name === "docs.search")
|
|
268
|
+
deps.print(`How-to guides for this: summer docs search --query ${shellWord(query)}`);
|
|
269
|
+
if (warning)
|
|
270
|
+
deps.printError(warning);
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* `summer ops describe <op>`: a local operation from this package; a cloud
|
|
274
|
+
* one from Summer's server, or from the shipped catalog when the server
|
|
275
|
+
* cannot answer (signed out, offline).
|
|
276
|
+
*/
|
|
277
|
+
export async function describeFromCli(op, deps = defaultOpsCliDeps, options = {}) {
|
|
278
|
+
const local = localWireForm(resolveOpName(op));
|
|
279
|
+
if (local) {
|
|
280
|
+
// --json: the same answer shape as the cloud describe ({operation}).
|
|
281
|
+
deps.print(options.json ? JSON.stringify({ ok: true, status: "done", result: { operation: local } }) : JSON.stringify(local, null, 2));
|
|
282
|
+
return 0;
|
|
283
|
+
}
|
|
284
|
+
const asked = await runCloud("ops.describe", { input: { name: op }, json: options.json === true, dryRun: false, wait: false }, deps);
|
|
285
|
+
const answer = describeFromShipped(op, asked) ?? asked;
|
|
286
|
+
(answer.ok ? deps.print : deps.printError)(options.json ? JSON.stringify(answer) : formatAnswer(answer));
|
|
287
|
+
if (!options.json && answer.ok)
|
|
288
|
+
for (const warning of answer.warnings ?? [])
|
|
289
|
+
deps.printError(`Warning: ${warning}`);
|
|
290
|
+
return answer.ok ? 0 : 1;
|
|
291
|
+
}
|
|
292
|
+
function areaCommand(area) {
|
|
293
|
+
return new Command(area)
|
|
294
|
+
.description(`Summer ${area} operations: summer ${area} <action> --field value. Find them: summer ops search ${area}`)
|
|
295
|
+
.argument("<action>", "The operation's action, e.g. list or set-base")
|
|
296
|
+
.allowUnknownOption(true)
|
|
297
|
+
.allowExcessArguments(true)
|
|
298
|
+
.helpOption(false)
|
|
299
|
+
.action(async (action, _options, command) => {
|
|
300
|
+
process.exitCode = await runOpFromCli(opFromCli(area, action), command.args.slice(1));
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
export function opsCliCommands() {
|
|
304
|
+
const whoami = new Command("whoami")
|
|
305
|
+
.description("Who is signed in, and their credits")
|
|
306
|
+
.allowUnknownOption(true)
|
|
307
|
+
.allowExcessArguments(true)
|
|
308
|
+
.action(async (_options, command) => {
|
|
309
|
+
process.exitCode = await runOpFromCli("whoami", command.args);
|
|
310
|
+
});
|
|
311
|
+
const ops = new Command("ops").description("Find and describe Summer operations");
|
|
312
|
+
ops
|
|
313
|
+
.command("search <words...>")
|
|
314
|
+
.description("Find operations by describing the job in plain words")
|
|
315
|
+
.option("--area <area>", "Only this area")
|
|
316
|
+
.option("--limit <n>", "Most results", "8")
|
|
317
|
+
.option("--json", "Print the answer as JSON")
|
|
318
|
+
.action(async (wordsArg, options) => {
|
|
319
|
+
await searchFromCli(wordsArg.join(" "), { area: options.area, limit: Number(options.limit) || 8, json: options.json === true });
|
|
320
|
+
});
|
|
321
|
+
ops
|
|
322
|
+
.command("describe <op>")
|
|
323
|
+
.description("Show one operation with its exact input")
|
|
324
|
+
.option("--json", "Print the answer as JSON")
|
|
325
|
+
.action(async (op, options) => {
|
|
326
|
+
process.exitCode = await describeFromCli(op, defaultOpsCliDeps, { json: options.json === true });
|
|
327
|
+
});
|
|
328
|
+
return [whoami, ops, ...CLI_AREAS.map(areaCommand)];
|
|
329
|
+
}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
export declare const setupCommand: Command;
|
|
3
|
+
/** True when `path` sits in a git repository that does not ignore it (false outside git, or without git). */
|
|
4
|
+
export declare function notGitIgnored(path: string, cwd?: string): boolean;
|
|
5
|
+
/** One line instead of a row per three skills: the first few names and how many more. `--json` keeps the full list. */
|
|
6
|
+
export declare function skillNamesSample(names: readonly string[], max?: number): string;
|