@playcraft/cli 0.0.55 → 0.0.57

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.
Files changed (170) hide show
  1. package/README.md +18 -0
  2. package/REMIX.md +115 -19
  3. package/dist/atom-tree/fusion-hints.js +8 -3
  4. package/dist/atom-tree/fusion-intent.js +62 -0
  5. package/dist/atom-tree/selection.js +3 -1
  6. package/dist/commands/create.js +299 -85
  7. package/dist/commands/image.js +79 -69
  8. package/dist/commands/levels.js +29 -0
  9. package/dist/commands/patterns.js +75 -0
  10. package/dist/commands/remix.js +93 -0
  11. package/dist/commands/skills.js +48 -17
  12. package/dist/index.js +9 -5
  13. package/dist/remix/clone-source.js +208 -0
  14. package/dist/remix/clone.js +256 -0
  15. package/dist/remix/local-git.js +56 -0
  16. package/dist/remix/pull.js +64 -0
  17. package/dist/remix/push.js +70 -0
  18. package/dist/scaffold/templates.js +1 -1
  19. package/dist/utils/agent-api-client.js +10 -3
  20. package/dist/utils/remix-image-attachments.js +4 -32
  21. package/dist/utils/sandbox-path.js +20 -0
  22. package/package.json +3 -3
  23. package/project-template/.claude/agents/creative-director.md +114 -0
  24. package/project-template/.claude/agents/developer.md +5 -2
  25. package/project-template/.claude/agents/game-designer.md +41 -20
  26. package/project-template/.claude/agents/refs/README.md +8 -0
  27. package/project-template/.claude/agents/refs/creative-director-guide.md +35 -0
  28. package/project-template/.claude/agents/refs/creative-director-kickoff-guide.md +52 -0
  29. package/project-template/.claude/agents/refs/creative-discovery-guide.md +76 -0
  30. package/project-template/.claude/agents/refs/creative-north-star-examples.md +82 -0
  31. package/project-template/.claude/agents/refs/developer-dev-handoff.md +1 -1
  32. package/project-template/.claude/agents/refs/game-designer-fusion-depth-playbook.md +28 -0
  33. package/project-template/.claude/agents/refs/game-designer-gameplay-sufficiency.md +4 -4
  34. package/project-template/.claude/agents/reviewer.md +11 -0
  35. package/project-template/.claude/hooks/README.md +12 -12
  36. package/project-template/.claude/hooks/block-developer-preflight.mjs +49 -13
  37. package/project-template/.claude/hooks/block-ring1-tasklist.mjs +1 -1
  38. package/project-template/.claude/hooks/user-prompt.mjs +3 -13
  39. package/project-template/.claude/hooks/validate-workflow-stop.mjs +209 -12
  40. package/project-template/.claude/settings.json +2 -2
  41. package/project-template/.claude/skills/playcraft-playable-optimization/SKILL.md +20 -20
  42. package/project-template/.claude/skills/session-analyzer/scripts/resolve-session.mjs +0 -1
  43. package/project-template/.claude/snapshot.mjs +0 -1
  44. package/project-template/.codebuddy/settings.json +1 -1
  45. package/project-template/.cursor/rules/playcraft-orchestrator.mdc +1 -1
  46. package/project-template/CLAUDE.md +9 -9
  47. package/project-template/docs/project-state.md +1 -1
  48. package/project-template/docs/team/agent-conduct.md +18 -18
  49. package/project-template/docs/team/collaboration.md +19 -7
  50. package/project-template/docs/team/workflow-changelog.md +15 -0
  51. package/project-template/fusion-patterns/catalog.json +77 -0
  52. package/project-template/package.json +2 -0
  53. package/project-template/skills/_shared/scripts/create-playable.mjs +31 -11
  54. package/project-template/skills/_shared/scripts/dev-start.mjs +3 -3
  55. package/project-template/skills/_shared/scripts/disclosure-config.mjs +65 -39
  56. package/project-template/skills/_shared/scripts/harness-smoke.mjs +3 -1
  57. package/project-template/skills/_shared/scripts/lib/fusion-intent.mjs +88 -0
  58. package/project-template/skills/_shared/scripts/lib/skill-fidelity.mjs +185 -0
  59. package/project-template/skills/_shared/scripts/slice-set.mjs +29 -2
  60. package/project-template/skills/_shared/scripts/state-get.mjs +124 -7
  61. package/project-template/skills/_shared/scripts/state-store.mjs +25 -2
  62. package/project-template/skills/_shared/scripts/validate-level-sketch.mjs +444 -0
  63. package/project-template/skills/_shared/scripts/verify-design-consistency.mjs +728 -0
  64. package/project-template/skills/playable-record/scripts/lib/dev-server.mjs +46 -11
  65. package/project-template/skills/playable-record/scripts/record-playable.mjs +2 -1
  66. package/project-template/skills/playable-record/scripts/verify-contract.mjs +4 -4
  67. package/project-template/skills/playable-record/scripts/verify-firstwin.mjs +3 -3
  68. package/project-template/skills/playable-record/scripts/verify-fusion.mjs +37 -2
  69. package/project-template/skills/playable-record/scripts/verify-slice.mjs +2 -2
  70. package/project-template/templates/design-brief.template.md +34 -0
  71. package/project-template/templates/design-methodology.md +1 -2
  72. package/project-template/templates/design.template.md +65 -0
  73. package/project-template/templates/developer-log.template.md +12 -1
  74. package/project-template/templates/five-axis-framework.md +12 -0
  75. package/project-template/templates/game-designer-creative-process.template.md +99 -0
  76. package/project-template/templates/level-sketch.template.json +56 -0
  77. package/project-template/templates/north-star.template.md +43 -0
  78. package/project-template/templates/project-state.template.md +1 -1
  79. package/project-template/vite.config.ts +4 -5
  80. package/project-templates/phaser/.claude/agents/creative-director.md +114 -0
  81. package/project-templates/phaser/.claude/agents/game-designer.md +41 -20
  82. package/project-templates/phaser/.claude/agents/refs/creative-director-guide.md +35 -0
  83. package/project-templates/phaser/.claude/agents/refs/creative-director-kickoff-guide.md +52 -0
  84. package/project-templates/phaser/.claude/agents/refs/creative-discovery-guide.md +76 -0
  85. package/project-templates/phaser/.claude/agents/refs/creative-north-star-examples.md +82 -0
  86. package/project-templates/phaser/.claude/agents/refs/developer-dev-handoff.md +1 -1
  87. package/project-templates/phaser/.claude/agents/refs/game-designer-fusion-depth-playbook.md +28 -0
  88. package/project-templates/phaser/.claude/agents/reviewer.md +11 -0
  89. package/project-templates/phaser/.claude/hooks/block-ring1-tasklist.mjs +2 -2
  90. package/project-templates/phaser/.claude/hooks/user-prompt.mjs +17 -18
  91. package/project-templates/phaser/.claude/hooks/validate-workflow-stop.mjs +209 -12
  92. package/project-templates/phaser/.claude/skills/playcraft-playable-optimization/SKILL.md +20 -20
  93. package/project-templates/phaser/.cursor/rules/playcraft-orchestrator.mdc +1 -1
  94. package/project-templates/phaser/CLAUDE.md +88 -54
  95. package/project-templates/phaser/docs/DESIGN.md +25 -0
  96. package/project-templates/phaser/docs/project-state.md +1 -1
  97. package/project-templates/phaser/docs/team/collaboration.md +19 -7
  98. package/project-templates/phaser/docs/team/workflow-changelog.md +14 -0
  99. package/project-templates/phaser/fusion-patterns/catalog.json +77 -0
  100. package/project-templates/phaser/package.json +3 -1
  101. package/project-templates/phaser/skills/_shared/scripts/dev-start.mjs +3 -3
  102. package/project-templates/phaser/skills/_shared/scripts/disclosure-config.mjs +65 -39
  103. package/project-templates/phaser/skills/_shared/scripts/harness-smoke.mjs +3 -1
  104. package/project-templates/phaser/skills/_shared/scripts/lib/fusion-intent.mjs +88 -0
  105. package/project-templates/phaser/skills/_shared/scripts/lib/skill-fidelity.mjs +185 -0
  106. package/project-templates/phaser/skills/_shared/scripts/state-get.mjs +124 -7
  107. package/project-templates/phaser/skills/_shared/scripts/state-store.mjs +25 -2
  108. package/project-templates/phaser/skills/_shared/scripts/validate-level-sketch.mjs +444 -0
  109. package/project-templates/phaser/skills/_shared/scripts/verify-design-consistency.mjs +728 -0
  110. package/project-templates/phaser/skills/playable-record/scripts/lib/dev-server.mjs +46 -11
  111. package/project-templates/phaser/skills/playable-record/scripts/record-playable.mjs +2 -1
  112. package/project-templates/phaser/skills/playable-record/scripts/verify-contract.mjs +4 -4
  113. package/project-templates/phaser/skills/playable-record/scripts/verify-firstwin.mjs +3 -3
  114. package/project-templates/phaser/skills/playable-record/scripts/verify-fusion.mjs +37 -2
  115. package/project-templates/phaser/skills/playable-record/scripts/verify-slice.mjs +2 -2
  116. package/project-templates/phaser/templates/design-brief.template.md +42 -11
  117. package/project-templates/phaser/templates/design-methodology.md +1 -2
  118. package/project-templates/phaser/templates/design.template.md +77 -0
  119. package/project-templates/phaser/templates/five-axis-framework.md +50 -1
  120. package/project-templates/phaser/templates/game-designer-creative-process.template.md +99 -0
  121. package/project-templates/phaser/templates/level-sketch.template.json +56 -0
  122. package/project-templates/phaser/templates/north-star.template.md +43 -0
  123. package/project-templates/phaser/templates/project-state.template.md +1 -1
  124. package/project-templates/phaser/vite.config.ts +4 -5
  125. package/project-templates/threejs/.claude/agents/creative-director.md +114 -0
  126. package/project-templates/threejs/.claude/agents/game-designer.md +41 -20
  127. package/project-templates/threejs/.claude/agents/refs/creative-director-guide.md +35 -0
  128. package/project-templates/threejs/.claude/agents/refs/creative-director-kickoff-guide.md +52 -0
  129. package/project-templates/threejs/.claude/agents/refs/creative-discovery-guide.md +76 -0
  130. package/project-templates/threejs/.claude/agents/refs/creative-north-star-examples.md +82 -0
  131. package/project-templates/threejs/.claude/agents/refs/developer-dev-handoff.md +1 -1
  132. package/project-templates/threejs/.claude/agents/refs/game-designer-fusion-depth-playbook.md +28 -0
  133. package/project-templates/threejs/.claude/agents/reviewer.md +11 -0
  134. package/project-templates/threejs/.claude/hooks/block-ring1-tasklist.mjs +2 -2
  135. package/project-templates/threejs/.claude/hooks/user-prompt.mjs +17 -18
  136. package/project-templates/threejs/.claude/hooks/validate-workflow-stop.mjs +209 -12
  137. package/project-templates/threejs/.claude/skills/playcraft-playable-optimization/SKILL.md +20 -20
  138. package/project-templates/threejs/.cursor/rules/playcraft-orchestrator.mdc +1 -1
  139. package/project-templates/threejs/CLAUDE.md +88 -54
  140. package/project-templates/threejs/docs/DESIGN.md +25 -0
  141. package/project-templates/threejs/docs/project-state.md +1 -1
  142. package/project-templates/threejs/docs/team/collaboration.md +19 -7
  143. package/project-templates/threejs/docs/team/workflow-changelog.md +14 -0
  144. package/project-templates/threejs/fusion-patterns/catalog.json +77 -0
  145. package/project-templates/threejs/package.json +3 -1
  146. package/project-templates/threejs/skills/_shared/scripts/dev-start.mjs +3 -3
  147. package/project-templates/threejs/skills/_shared/scripts/disclosure-config.mjs +65 -39
  148. package/project-templates/threejs/skills/_shared/scripts/harness-smoke.mjs +3 -1
  149. package/project-templates/threejs/skills/_shared/scripts/lib/fusion-intent.mjs +88 -0
  150. package/project-templates/threejs/skills/_shared/scripts/lib/skill-fidelity.mjs +185 -0
  151. package/project-templates/threejs/skills/_shared/scripts/state-get.mjs +124 -7
  152. package/project-templates/threejs/skills/_shared/scripts/state-store.mjs +25 -2
  153. package/project-templates/threejs/skills/_shared/scripts/validate-level-sketch.mjs +444 -0
  154. package/project-templates/threejs/skills/_shared/scripts/verify-design-consistency.mjs +728 -0
  155. package/project-templates/threejs/skills/playable-record/scripts/lib/dev-server.mjs +46 -11
  156. package/project-templates/threejs/skills/playable-record/scripts/record-playable.mjs +2 -1
  157. package/project-templates/threejs/skills/playable-record/scripts/verify-contract.mjs +4 -4
  158. package/project-templates/threejs/skills/playable-record/scripts/verify-firstwin.mjs +3 -3
  159. package/project-templates/threejs/skills/playable-record/scripts/verify-fusion.mjs +37 -2
  160. package/project-templates/threejs/skills/playable-record/scripts/verify-slice.mjs +2 -2
  161. package/project-templates/threejs/templates/design-brief.template.md +42 -11
  162. package/project-templates/threejs/templates/design-methodology.md +1 -2
  163. package/project-templates/threejs/templates/design.template.md +77 -0
  164. package/project-templates/threejs/templates/five-axis-framework.md +50 -1
  165. package/project-templates/threejs/templates/game-designer-creative-process.template.md +99 -0
  166. package/project-templates/threejs/templates/level-sketch.template.json +56 -0
  167. package/project-templates/threejs/templates/north-star.template.md +43 -0
  168. package/project-templates/threejs/templates/project-state.template.md +1 -1
  169. package/project-templates/threejs/vite.config.ts +4 -5
  170. package/project-template/docs/DESIGN.md +0 -65
package/README.md CHANGED
@@ -91,6 +91,24 @@ playcraft remix start \
91
91
  --open
92
92
  ```
93
93
 
94
+ ### 6. 将 Remix 源码 clone 到本地
95
+
96
+ 完整步骤(登录 → clone → commit → push)见:
97
+
98
+ - [Remix 本地 Clone / Commit / Push](../../docs/cli/remix-local-clone-push.md)
99
+
100
+ ```bash
101
+ playcraft login
102
+ # 推荐:粘贴 Remix 详情页 / Editor / 工蜂分支页 URL
103
+ playcraft remix clone '<remix-detail-or-editor-or-gongfeng-url>' --install
104
+
105
+ cd <cloned-dir>
106
+ npm run dev # external 引擎
107
+ git add -A && git commit -m "…"
108
+ playcraft remix pull # 需要同步远端时
109
+ playcraft remix push # 不要裸 git push/pull(尤其 Windows)
110
+ ```
111
+
94
112
  完整的 Remix 子命令、参数、图片传输、自动化输出及故障处理说明见:
95
113
 
96
114
  - [PlayCraft CLI Remix 完整命令参考](./REMIX.md)
package/REMIX.md CHANGED
@@ -11,6 +11,7 @@ CLI (Command-Line Interface, 命令行界面) 的 Remix 工作流用于:
11
11
  - 向当前沙箱的 Agent 会话发送文本需求和参考图片。
12
12
  - 在交互式终端或自动化脚本中完成端到端创建流程。
13
13
  - 在本地项目中应用 Phaser 或 Three.js 引擎脚手架。
14
+ - **经 PlayCraft Git 代理将 Remix 源码 clone 到本地、本地开发后 push 回 Remix 分支。**
14
15
 
15
16
  ## 1. 命令总览
16
17
 
@@ -22,18 +23,25 @@ playcraft remix create
22
23
  playcraft remix start
23
24
  playcraft remix prompt
24
25
  playcraft remix run
25
- ```
26
-
27
- | 想完成的操作 | 推荐命令 |
28
- | ---------------------------- | --------------------------------------------------------------------- |
29
- | 查看当前账号所属团队 | `playcraft remix teams` |
30
- | 查看团队内可作为模板的项目 | `playcraft remix templates --team-id <team-id>` |
31
- | 只创建 Remix,不启动沙箱 | `playcraft remix create` 或交互式 `playcraft remix run` 后留空 Prompt |
32
- | 启动已有 Remix 并打开 Editor | `playcraft remix start --project-id <id> --branch <branch> --open` |
33
- | 向已有 Remix 发送需求 | `playcraft remix prompt` |
34
- | 创建 Remix 并立即运行 Agent | `playcraft remix run` |
35
- | 查询已有 Remix 列表 | `playcraft tools list-remixes`;当前没有 `playcraft remix list` |
36
- | 给本地项目应用引擎模板 | `playcraft remix init-template` |
26
+ playcraft remix clone
27
+ playcraft remix pull
28
+ playcraft remix push
29
+ playcraft git-credential
30
+ ```
31
+
32
+ | 想完成的操作 | 推荐命令 |
33
+ | ---------------------------- | ------------------------------------------------------------------------------- |
34
+ | 查看当前账号所属团队 | `playcraft remix teams` |
35
+ | 查看团队内可作为模板的项目 | `playcraft remix templates --team-id <team-id>` |
36
+ | 只创建 Remix,不启动沙箱 | `playcraft remix create` 或交互式 `playcraft remix run` 后留空 Prompt |
37
+ | 启动已有 Remix 并打开 Editor | `playcraft remix start --project-id <id> --branch <branch> --open` |
38
+ | 向已有 Remix 发送需求 | `playcraft remix prompt` |
39
+ | 创建 Remix 并立即运行 Agent | `playcraft remix run` |
40
+ | **Clone Remix 源码到本地** | `playcraft remix clone <详情页/Editor/工蜂 URL>` 或 `--project-id` + `--branch` |
41
+ | **Pull 远端 Remix** | `playcraft remix pull`(推荐;Windows 勿直接 `git pull`) |
42
+ | **Push 回 Remix 分支** | `playcraft remix push`(推荐;Windows 勿直接 `git push`) |
43
+ | 查询已有 Remix 列表 | `playcraft tools list-remixes`;当前没有 `playcraft remix list` |
44
+ | 给本地项目应用引擎模板 | `playcraft remix init-template` |
37
45
 
38
46
  查看当前版本的帮助:
39
47
 
@@ -717,27 +725,115 @@ playcraft remix start --project-id <project-id> --branch <remix-branch> --open
717
725
 
718
726
  可以。`remix prompt` 会自动启动或复用沙箱。
719
727
 
720
- ### 14.3 为什么 `prompt` 必须同时提供项目 ID 和分支?
728
+ ## 14. 本地 Clone / Push(Git 代理)
729
+
730
+ 登录后可将 Remix 源码经 **PlayCraft Backend Git Smart HTTP 代理**克隆到本机,无需工蜂凭据。平台服务账号 Token 不会下发到 CLI。
731
+
732
+ > **上手文档(推荐先读)**:[Remix 本地 Clone / Commit / Push](../../docs/cli/remix-local-clone-push.md)
733
+
734
+ ### 14.1 Clone
735
+
736
+ ```bash
737
+ playcraft login --url https://test-playcraft.aix.intlgame.com
738
+
739
+ # 建议本地开发时 API 直连 backend(避免经前端 Next rewrite)
740
+ export PLAYCRAFT_API_URL=http://localhost:3001
741
+
742
+ # 推荐:直接粘贴 Remix 详情页或 Editor 地址
743
+ playcraft remix clone \
744
+ 'https://playcraft.aix.intlgame.com/projects/<uuid>/remixes/remix%2Fyour-branch' \
745
+ --install
746
+
747
+ playcraft remix clone \
748
+ 'https://playcraft.aix.intlgame.com/editor/remix/<uuid>?branch=remix%2Fyour-branch' \
749
+ --install
750
+
751
+ # 也可粘贴详情页上的工蜂分支页(git.woa.com / git.tencent.com 互认);仍走 PlayCraft 代理
752
+ playcraft remix clone \
753
+ 'https://git.woa.com/<group>/<repo>/tree/remix%2Fyour-branch' \
754
+ --install
755
+
756
+ playcraft remix clone \
757
+ 'https://git.tencent.com/<group>/<repo>/tree/remix%2Fyour-branch' \
758
+ --install
759
+
760
+ # 兼容旧写法
761
+ playcraft remix clone \
762
+ --project-id <project-id> \
763
+ --branch remix/your-branch \
764
+ --install
765
+ ```
766
+
767
+ 行为说明:
768
+
769
+ - Clone URL 形如:`<api>/api/git/projects/<projectId>/branches/<urlencode(branch)>.git`
770
+ - 固定浅克隆:`--single-branch --depth 1`
771
+ - 鉴权使用已登录 PAT(`Authorization: Bearer`),remote URL **不含** Token
772
+ - 仅 advertise / 允许操作 **URL 中指定的那条 Remix 分支**(不能拉同项目其它私有分支)
773
+ - 克隆后写入 `.playcraft.json`(projectId / branch / cloneUrl),并配置 `credential.helper=!playcraft git-credential`
774
+ - 工蜂地址会先调用 `GET /api/git/resolve-repo` 映射到 PlayCraft 项目,再经代理 clone(不会直连工蜂)
775
+
776
+ ### 14.2 本地运行
777
+
778
+ - **external(Phaser / Three.js)**:`npm install && npm run dev`(可用 `--install` / `--dev`)
779
+ - **PlayCanvas**:使用 `playcraft start --project <id>`,不是 Vite
780
+
781
+ ### 14.3 Pull / Push
782
+
783
+ 在克隆目录内:
784
+
785
+ ```bash
786
+ # 同步远端(例如沙箱 Save 之后)
787
+ playcraft remix pull
788
+
789
+ # 本地改完并 commit 后写回
790
+ git add -A
791
+ git commit -m "local changes"
792
+ playcraft remix push
793
+ ```
794
+
795
+ **不要**依赖裸 `git pull` / `git push`(尤其 Windows + Git Credential Manager 会弹窗)。二者与 clone 一样注入 `Authorization: Bearer`,并禁用本命令的 credential helper。
796
+
797
+ 服务端强制(push):
798
+
799
+ - 只能 push 到 URL 对应的 Remix 分支
800
+ - 禁止 push `main` / `master` / 项目默认分支
801
+ - 禁止新建 / 删除分支、推 tag
802
+ - Gallery 只读用户可以 clone,**不能** push(需 editor/owner 或该分支创建者)
803
+
804
+ ### 14.4 与云端沙箱同时写
805
+
806
+ 同一 Remix 分支若已在沙箱打开并 Save,本机 `playcraft remix push` 与沙箱 push 会互相覆盖。请避免两边同时写同一分支;需要合并远端时先 `playcraft remix pull`。push 成功后 backend 会 `BareRepoCache.invalidate`。
807
+
808
+ ### 14.5 `playcraft git-credential`
809
+
810
+ clone 后仍可能写入仓库 `credential.helper`(兼容)。**日常请用 `playcraft remix pull` / `push`**,不要手动跑 `git-credential`。
811
+
812
+ ---
813
+
814
+ ## 15. 常见问题
815
+
816
+ ### 15.1 为什么 `prompt` 必须同时提供项目 ID 和分支?
721
817
 
722
818
  项目中可能存在多个 Remix 分支。显式指定二者可以避免需求落到 `main` 或其他 Remix。
723
819
 
724
- ### 14.4 `--open` 与 URL 输出有什么区别?
820
+ ### 15.2 `--open` 与 URL 输出有什么区别?
725
821
 
726
822
  `--open` 会调用系统浏览器。没有 `--open` 时命令仍会返回或打印 Editor URL,适合远程终端和自动化环境。
727
823
 
728
- ### 14.5 图片上传失败后是否仍会发送纯文本?
824
+ ### 15.3 图片上传失败后是否仍会发送纯文本?
729
825
 
730
826
  不会。附件校验或上传失败时,整个 Prompt 请求失败,避免 Agent 在缺少参考图的情况下继续执行。
731
827
 
732
- ### 14.6 `--no-wait` 是否会取消 Agent?
828
+ ### 15.4 `--no-wait` 是否会取消 Agent?
733
829
 
734
830
  不会。它只让 CLI 在 Agent 接收请求后立即返回,远端任务继续运行。
735
831
 
736
- ### 14.7 超时后 Agent 是否会停止?
832
+ ### 15.5 超时后 Agent 是否会停止?
737
833
 
738
834
  不保证。`--timeout` 限制 CLI 等待时间;当前命令不会因为本地等待超时而自动中止远端 Agent。
739
835
 
740
- ### 14.8 如何避免测试环境和生产环境 Token 混用?
836
+ ### 15.6 如何避免测试环境和生产环境 Token 混用?
741
837
 
742
838
  登录时显式传入环境地址:
743
839
 
@@ -747,7 +843,7 @@ playcraft login --url https://test-playcraft.aix.intlgame.com
747
843
 
748
844
  CLI 只会在保存 Token 的环境与目标环境一致时复用它;浏览器重新授权会创建新 Token 并替换旧值。
749
845
 
750
- ## 15. 版本与帮助
846
+ ## 16. 版本与帮助
751
847
 
752
848
  本文档描述当前源码中的命令。安装版本可能落后于仓库源码,排查参数差异时先检查:
753
849
 
@@ -21,9 +21,14 @@ const EMBEDDED_FUSION_EDGES = [
21
21
  label: 'C-Sequential, high risk → prefer pseudo-fusion',
22
22
  },
23
23
  {
24
- from: 'match3_core.aigameplay',
25
- to: 'arrow_escape_core.aigameplay',
26
- label: 'C-Sequential, medium-high risk → prefer pseudo-fusion',
24
+ from: 'path_elimination_rules.aigameplay',
25
+ to: 'pick_and_match_rules.aigameplay',
26
+ label: 'B2-Active, low risk → prefer arrow_pick_match composite',
27
+ },
28
+ {
29
+ from: 'path_elimination_rules.aigameplay',
30
+ to: 'arrow_pick_match_rules.aigameplay',
31
+ label: 'B2-Active composite — use instead of stitching parents',
27
32
  },
28
33
  ];
29
34
  function fusionEdges() {
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Fusion intent detection and composite-skill helpers for skills match routing.
3
+ */
4
+ const FUSION_KEYWORDS = [
5
+ '融合',
6
+ 'fusion',
7
+ 'hybrid',
8
+ 'combine',
9
+ '组合',
10
+ 'mix',
11
+ 'mixed',
12
+ 'plus',
13
+ '+',
14
+ '和',
15
+ '与',
16
+ '加',
17
+ ];
18
+ const ELIMINATION_KEYWORDS = ['消除', 'elimination', 'eliminate', 'match-3', 'match3', '三消', 'match'];
19
+ const ARROW_PATH_KEYWORDS = ['箭头', 'arrow', 'path', '路径', 'slide-out', 'slide'];
20
+ /** True when user intent suggests combining multiple gameplay mechanics. */
21
+ export function detectFusionIntent(intentTags, rawIntent = '') {
22
+ const blob = `${rawIntent} ${intentTags.join(' ')}`.toLowerCase();
23
+ if (FUSION_KEYWORDS.some((k) => blob.includes(k.toLowerCase())))
24
+ return true;
25
+ const hasElim = ELIMINATION_KEYWORDS.some((k) => blob.includes(k.toLowerCase()));
26
+ const hasArrow = ARROW_PATH_KEYWORDS.some((k) => blob.includes(k.toLowerCase()));
27
+ return hasElim && hasArrow;
28
+ }
29
+ /** Composite fusion skill: manifest declares ≥2 parent gameplay types. */
30
+ export function isFusionCompositeManifest(manifest) {
31
+ const parents = manifest.pgs?.parentTypes;
32
+ if (Array.isArray(parents) && parents.length >= 2)
33
+ return true;
34
+ if (manifest.pgs?.fusionDescription)
35
+ return true;
36
+ const id = manifest.atomId ?? '';
37
+ if (id.includes('_pick_') || id.includes('_match_')) {
38
+ return id.includes('arrow') || id.includes('path');
39
+ }
40
+ return false;
41
+ }
42
+ export function getManifestParentTypes(manifest) {
43
+ return manifest.pgs?.parentTypes ?? [];
44
+ }
45
+ /** Bonus score when fusion intent matches a composite skill. */
46
+ export function fusionCompositeScoreBoost(manifest, intentTags, rawIntent = '') {
47
+ if (!detectFusionIntent(intentTags, rawIntent))
48
+ return 0;
49
+ if (!isFusionCompositeManifest(manifest))
50
+ return 0;
51
+ return 25;
52
+ }
53
+ /** Penalize single-mechanic gameplay seeds when fusion intent is explicit. */
54
+ export function fusionSingleMechanicPenalty(manifest, intentTags, rawIntent = '') {
55
+ if (!detectFusionIntent(intentTags, rawIntent))
56
+ return 0;
57
+ if (manifest.category !== 'gameplay' && manifest.bundleType !== 'aigameplay')
58
+ return 0;
59
+ if (isFusionCompositeManifest(manifest))
60
+ return 0;
61
+ return -8;
62
+ }
@@ -327,7 +327,9 @@ export function collectPinnedDependencies(atomId, manifestIndex, engine, visited
327
327
  if (!imp.pinAtomId || visited.has(imp.pinAtomId))
328
328
  continue;
329
329
  deps.push(imp.pinAtomId);
330
- deps.push(...collectPinnedDependencies(imp.pinAtomId, manifestIndex, engine, visited, depth + 1));
330
+ if (imp.edgeKind === 'requires') {
331
+ deps.push(...collectPinnedDependencies(imp.pinAtomId, manifestIndex, engine, visited, depth + 1));
332
+ }
331
333
  }
332
334
  return deps;
333
335
  }