@craft_eco/craft-mcp 0.1.25 → 0.1.28

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 (1585) hide show
  1. package/README.md +33 -12
  2. package/bin/craft-mcp.mjs +10 -8
  3. package/dist-server/game-workflow/bundle-files.mjs +48 -0
  4. package/dist-server/game-workflow/check.mjs +3 -4
  5. package/dist-server/game-workflow/engines.mjs +24 -8
  6. package/dist-server/game-workflow/project-bundles.mjs +129 -0
  7. package/dist-server/game-workflow/project-context.mjs +97 -0
  8. package/dist-server/game-workflow/projects.mjs +22 -5
  9. package/dist-server/game-workflow/publication-materials.mjs +18 -20
  10. package/dist-server/game-workflow/publications.mjs +15 -17
  11. package/dist-server/game-workflow/publish-capture.mjs +21 -57
  12. package/dist-server/integrations/config.mjs +71 -0
  13. package/dist-server/integrations/files.mjs +54 -0
  14. package/dist-server/integrations/hosts.mjs +35 -0
  15. package/dist-server/integrations/install.mjs +86 -0
  16. package/dist-server/integrations/runtime.mjs +72 -0
  17. package/dist-server/mcp/publication-page.mjs +18 -50
  18. package/dist-server/mcp/publish-panel.mjs +28 -35
  19. package/dist-server/mcp/server.mjs +22 -18
  20. package/dist-server/mcp/start.mjs +3 -1
  21. package/dist-server/preview/preview-launcher.mjs +9 -2
  22. package/dist-server/preview/preview-start.mjs +2 -2
  23. package/dist-server/upstream/publication-transport.mjs +19 -19
  24. package/package.json +14 -8
  25. package/resources/craft-create/SKILL.md +11 -0
  26. package/resources/craft-game-maker/SKILL.md +77 -71
  27. package/resources/craft-game-maker/js.md +10 -10
  28. package/resources/craft-game-maker/js3d.md +13 -13
  29. package/resources/game_visual_qa.mjs +1149 -1149
  30. package/resources/js/bundle.json +93 -0
  31. package/resources/js/context/AGENTS.md +15 -102
  32. package/resources/js/context/knowledge/AigcWiring.md +5 -196
  33. package/resources/js/context/knowledge/AssetUrl.md +5 -20
  34. package/resources/js/context/knowledge/Layout.md +7 -0
  35. package/resources/js/context/knowledge/Lifecycle.md +6 -27
  36. package/resources/js/context/skills/aigc-generate/SKILL.md +6 -141
  37. package/resources/js/context/skills/asset-search/SKILL.md +5 -62
  38. package/resources/js/context/skills/asset-search/references/resource-config.md +9 -0
  39. package/resources/js/context/skills/export-config/SKILL.md +7 -19
  40. package/resources/js/context/skills/export-config/scripts/export-config.mjs +3 -45
  41. package/resources/js/context/skills/index.json +30 -0
  42. package/resources/js/context/skills/visual-qa/SKILL.md +6 -28
  43. package/resources/js/project/README.md +4 -96
  44. package/resources/js/project/package.json +1 -2
  45. package/resources/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  46. package/resources/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  47. package/resources/js/project/scripts/config-export.mjs +10 -34
  48. package/resources/js3d/bundle.json +104 -0
  49. package/resources/js3d/context/AGENTS.md +16 -85
  50. package/resources/js3d/context/knowledge/AigcWiring.md +9 -0
  51. package/resources/js3d/context/knowledge/AssetUrl.md +9 -0
  52. package/resources/js3d/context/knowledge/CodingGuide/Pitfalls.md +9 -67
  53. package/resources/js3d/context/knowledge/Layout.md +7 -0
  54. package/resources/js3d/context/knowledge/Runtime.md +5 -30
  55. package/resources/js3d/context/skills/aigc-integration/SKILL.md +6 -164
  56. package/resources/js3d/context/skills/asset-search/SKILL.md +5 -171
  57. package/resources/js3d/context/skills/asset-search/references/resource-config.md +6 -94
  58. package/resources/js3d/context/skills/asset-usage-audit/SKILL.md +6 -82
  59. package/resources/js3d/context/skills/export-config/SKILL.md +7 -11
  60. package/resources/js3d/context/skills/export-config/scripts/export-config.mjs +3 -55
  61. package/resources/js3d/context/skills/index.json +42 -0
  62. package/resources/js3d/context/skills/performance-audit/SKILL.md +8 -153
  63. package/resources/js3d/context/skills/visual-qa/SKILL.md +14 -0
  64. package/resources/js3d/project/README.md +4 -103
  65. package/resources/js3d/project/package.json +1 -2
  66. package/resources/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  67. package/resources/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  68. package/resources/js3d/project/scripts/config-export.mjs +12 -34
  69. package/resources/targets/codebuddy/js/bootstrap/SKILL.md +14 -0
  70. package/resources/targets/codebuddy/js/craft-game-maker/SKILL.md +77 -0
  71. package/resources/targets/codebuddy/js/craft-game-maker/js.md +10 -0
  72. package/resources/targets/codebuddy/js/js/bundle.json +99 -0
  73. package/resources/targets/codebuddy/js/js/context/AGENTS.md +25 -0
  74. package/resources/targets/codebuddy/js/js/context/hooks/hooks.json +14 -0
  75. package/resources/targets/codebuddy/js/js/context/knowledge/AigcWiring.md +9 -0
  76. package/resources/targets/codebuddy/js/js/context/knowledge/AssetUrl.md +9 -0
  77. package/resources/targets/codebuddy/js/js/context/knowledge/Layout.md +7 -0
  78. package/resources/targets/codebuddy/js/js/context/knowledge/Lifecycle.md +11 -0
  79. package/resources/targets/codebuddy/js/js/context/skills/aigc-generate/SKILL.md +14 -0
  80. package/resources/targets/codebuddy/js/js/context/skills/asset-search/SKILL.md +12 -0
  81. package/resources/targets/codebuddy/js/js/context/skills/asset-search/references/resource-config.md +9 -0
  82. package/resources/targets/codebuddy/js/js/context/skills/export-config/SKILL.md +16 -0
  83. package/resources/targets/codebuddy/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  84. package/resources/targets/codebuddy/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  85. package/resources/targets/codebuddy/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  86. package/resources/targets/codebuddy/js/js/context/skills/index.json +31 -0
  87. package/resources/targets/codebuddy/js/js/context/skills/visual-qa/SKILL.md +14 -0
  88. package/resources/targets/codebuddy/js/js/project/README.md +7 -0
  89. package/resources/targets/codebuddy/js/js/project/configs/assets.json +1 -0
  90. package/resources/targets/codebuddy/js/js/project/configs/game.controls.json +3 -0
  91. package/resources/targets/codebuddy/js/js/project/configs/game.json +3 -0
  92. package/resources/targets/codebuddy/js/js/project/game.config.json +7 -0
  93. package/resources/targets/codebuddy/js/js/project/index.html +20 -0
  94. package/resources/targets/codebuddy/js/js/project/package.json +22 -0
  95. package/resources/targets/codebuddy/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  96. package/resources/targets/codebuddy/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  97. package/resources/targets/codebuddy/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  98. package/resources/targets/codebuddy/js/js/project/scripts/config-export.mjs +13 -0
  99. package/resources/targets/codebuddy/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  100. package/resources/targets/codebuddy/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  101. package/resources/targets/codebuddy/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  102. package/resources/targets/codebuddy/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  103. package/resources/targets/codebuddy/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  104. package/resources/targets/codebuddy/js/js/project/scripts/write-preview-ready.mjs +22 -0
  105. package/resources/targets/codebuddy/js/js/project/src/scenes/LoadScene.ts +89 -0
  106. package/resources/targets/codebuddy/js/js/project/src/scenes/PlayScene.ts +17 -0
  107. package/resources/targets/codebuddy/js/js/project/unified_data_control_config.json +20 -0
  108. package/resources/targets/codebuddy/js/recovery.md +7 -0
  109. package/resources/targets/codebuddy/js/target.json +61 -0
  110. package/resources/targets/codebuddy/js3d/bootstrap/SKILL.md +14 -0
  111. package/resources/targets/codebuddy/js3d/craft-game-maker/SKILL.md +77 -0
  112. package/resources/targets/codebuddy/js3d/craft-game-maker/js3d.md +13 -0
  113. package/resources/targets/codebuddy/js3d/js3d/bundle.json +110 -0
  114. package/resources/targets/codebuddy/js3d/js3d/context/AGENTS.md +26 -0
  115. package/resources/targets/codebuddy/js3d/js3d/context/hooks/hooks.json +14 -0
  116. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AigcWiring.md +9 -0
  117. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  118. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  119. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/Layout.md +7 -0
  120. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/Runtime.md +9 -0
  121. package/resources/targets/codebuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +14 -0
  122. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-search/SKILL.md +12 -0
  123. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md +11 -0
  124. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  125. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  126. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  127. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  128. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  129. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  130. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  131. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  132. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  133. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  134. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  135. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  136. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  137. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  138. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  139. package/resources/targets/codebuddy/js3d/js3d/context/skills/index.json +43 -0
  140. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  141. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  142. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  143. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  144. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  145. package/resources/targets/codebuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  146. package/resources/targets/codebuddy/js3d/js3d/project/README.md +7 -0
  147. package/resources/targets/codebuddy/js3d/js3d/project/configs/game.controls.json +3 -0
  148. package/resources/targets/codebuddy/js3d/js3d/project/configs/game.json +3 -0
  149. package/resources/targets/codebuddy/js3d/js3d/project/game-runtime.json +7 -0
  150. package/resources/targets/codebuddy/js3d/js3d/project/game.config.json +7 -0
  151. package/resources/targets/codebuddy/js3d/js3d/project/index.html +12 -0
  152. package/resources/targets/codebuddy/js3d/js3d/project/package.json +23 -0
  153. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  154. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  155. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  156. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  157. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  158. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  159. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  160. package/resources/targets/codebuddy/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  161. package/resources/targets/codebuddy/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  162. package/resources/targets/codebuddy/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  163. package/resources/targets/codebuddy/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  164. package/resources/targets/codebuddy/js3d/js3d/project/scripts/config-export.mjs +15 -0
  165. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  166. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  167. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  168. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  169. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  170. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  171. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  172. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  173. package/resources/targets/codebuddy/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  174. package/resources/targets/codebuddy/js3d/js3d/project/src/main.ts +85 -0
  175. package/resources/targets/codebuddy/js3d/js3d/project/src/platform.ts +2 -0
  176. package/resources/targets/codebuddy/js3d/js3d/project/src/style.css +83 -0
  177. package/resources/targets/codebuddy/js3d/js3d/project/tsconfig.json +20 -0
  178. package/resources/targets/codebuddy/js3d/js3d/project/unified_data_control_config.json +20 -0
  179. package/resources/targets/codebuddy/js3d/js3d/project/vite.config.ts +5 -0
  180. package/resources/targets/codebuddy/js3d/recovery.md +7 -0
  181. package/resources/targets/codebuddy/js3d/target.json +60 -0
  182. package/resources/targets/codex/js/bootstrap/SKILL.md +14 -0
  183. package/resources/targets/codex/js/craft-game-maker/SKILL.md +77 -0
  184. package/resources/targets/codex/js/craft-game-maker/js.md +10 -0
  185. package/resources/targets/codex/js/js/bundle.json +99 -0
  186. package/resources/targets/codex/js/js/context/AGENTS.md +25 -0
  187. package/resources/targets/codex/js/js/context/hooks/hooks.json +14 -0
  188. package/resources/targets/codex/js/js/context/knowledge/AigcWiring.md +9 -0
  189. package/resources/targets/codex/js/js/context/knowledge/AssetUrl.md +9 -0
  190. package/resources/targets/codex/js/js/context/knowledge/Layout.md +7 -0
  191. package/resources/targets/codex/js/js/context/knowledge/Lifecycle.md +11 -0
  192. package/resources/targets/codex/js/js/context/skills/aigc-generate/SKILL.md +14 -0
  193. package/resources/targets/codex/js/js/context/skills/asset-search/SKILL.md +12 -0
  194. package/resources/targets/codex/js/js/context/skills/asset-search/references/resource-config.md +9 -0
  195. package/resources/targets/codex/js/js/context/skills/export-config/SKILL.md +16 -0
  196. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  197. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  198. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  199. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  200. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  201. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  202. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  203. package/resources/targets/codex/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  204. package/resources/targets/codex/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  205. package/resources/targets/codex/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  206. package/resources/targets/codex/js/js/context/skills/index.json +31 -0
  207. package/resources/targets/codex/js/js/context/skills/visual-qa/SKILL.md +14 -0
  208. package/resources/targets/codex/js/js/project/README.md +7 -0
  209. package/resources/targets/codex/js/js/project/configs/assets.json +1 -0
  210. package/resources/targets/codex/js/js/project/configs/game.controls.json +3 -0
  211. package/resources/targets/codex/js/js/project/configs/game.json +3 -0
  212. package/resources/targets/codex/js/js/project/game-runtime.json +7 -0
  213. package/resources/targets/codex/js/js/project/game.config.json +7 -0
  214. package/resources/targets/codex/js/js/project/index.html +20 -0
  215. package/resources/targets/codex/js/js/project/package.json +22 -0
  216. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  217. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  218. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  219. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  220. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  221. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  222. package/resources/targets/codex/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  223. package/resources/targets/codex/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  224. package/resources/targets/codex/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  225. package/resources/targets/codex/js/js/project/scripts/config-export.mjs +13 -0
  226. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  227. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  228. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  229. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  230. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  231. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  232. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  233. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  234. package/resources/targets/codex/js/js/project/scripts/write-preview-ready.mjs +22 -0
  235. package/resources/targets/codex/js/js/project/src/main.ts +87 -0
  236. package/resources/targets/codex/js/js/project/src/platform.ts +2 -0
  237. package/resources/targets/codex/js/js/project/src/scenes/LoadScene.ts +89 -0
  238. package/resources/targets/codex/js/js/project/src/scenes/PlayScene.ts +17 -0
  239. package/resources/targets/codex/js/js/project/src/screenUi.ts +185 -0
  240. package/resources/targets/codex/js/js/project/src/style.css +294 -0
  241. package/resources/targets/codex/js/js/project/tsconfig.json +20 -0
  242. package/resources/targets/codex/js/js/project/unified_data_control_config.json +20 -0
  243. package/resources/targets/codex/js/js/project/vite.config.ts +5 -0
  244. package/resources/targets/codex/js/recovery.md +7 -0
  245. package/resources/targets/codex/js/target.json +61 -0
  246. package/resources/targets/codex/js3d/bootstrap/SKILL.md +14 -0
  247. package/resources/targets/codex/js3d/craft-game-maker/SKILL.md +77 -0
  248. package/resources/targets/codex/js3d/craft-game-maker/js3d.md +13 -0
  249. package/resources/targets/codex/js3d/js3d/bundle.json +110 -0
  250. package/resources/targets/codex/js3d/js3d/context/AGENTS.md +26 -0
  251. package/resources/targets/codex/js3d/js3d/context/hooks/hooks.json +14 -0
  252. package/resources/targets/codex/js3d/js3d/context/knowledge/AigcWiring.md +9 -0
  253. package/resources/targets/codex/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  254. package/resources/targets/codex/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  255. package/resources/targets/codex/js3d/js3d/context/knowledge/Layout.md +7 -0
  256. package/resources/targets/codex/js3d/js3d/context/knowledge/Runtime.md +9 -0
  257. package/resources/targets/codex/js3d/js3d/context/skills/aigc-integration/SKILL.md +14 -0
  258. package/resources/targets/codex/js3d/js3d/context/skills/asset-search/SKILL.md +12 -0
  259. package/resources/targets/codex/js3d/js3d/context/skills/asset-search/references/resource-config.md +11 -0
  260. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  261. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  262. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  263. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  264. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  265. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  266. package/resources/targets/codex/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  267. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  268. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  269. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  270. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  271. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  272. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  273. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  274. package/resources/targets/codex/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  275. package/resources/targets/codex/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  276. package/resources/targets/codex/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  277. package/resources/targets/codex/js3d/js3d/context/skills/index.json +43 -0
  278. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  279. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  280. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  281. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  282. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  283. package/resources/targets/codex/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  284. package/resources/targets/codex/js3d/js3d/project/README.md +7 -0
  285. package/resources/targets/codex/js3d/js3d/project/configs/game.controls.json +3 -0
  286. package/resources/targets/codex/js3d/js3d/project/configs/game.json +3 -0
  287. package/resources/targets/codex/js3d/js3d/project/game-runtime.json +7 -0
  288. package/resources/targets/codex/js3d/js3d/project/game.config.json +7 -0
  289. package/resources/targets/codex/js3d/js3d/project/index.html +12 -0
  290. package/resources/targets/codex/js3d/js3d/project/package.json +23 -0
  291. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  292. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  293. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  294. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  295. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  296. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  297. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  298. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  299. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  300. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  301. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  302. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  303. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  304. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  305. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  306. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  307. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  308. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  309. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  310. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  311. package/resources/targets/codex/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  312. package/resources/targets/codex/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  313. package/resources/targets/codex/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  314. package/resources/targets/codex/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  315. package/resources/targets/codex/js3d/js3d/project/scripts/config-export.mjs +15 -0
  316. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  317. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  318. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  319. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  320. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  321. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  322. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  323. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  324. package/resources/targets/codex/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  325. package/resources/targets/codex/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  326. package/resources/targets/codex/js3d/js3d/project/src/display/viewport.ts +239 -0
  327. package/resources/targets/codex/js3d/js3d/project/src/main.ts +85 -0
  328. package/resources/targets/codex/js3d/js3d/project/src/platform.ts +2 -0
  329. package/resources/targets/codex/js3d/js3d/project/src/style.css +83 -0
  330. package/resources/targets/codex/js3d/js3d/project/tsconfig.json +20 -0
  331. package/resources/targets/codex/js3d/js3d/project/unified_data_control_config.json +20 -0
  332. package/resources/targets/codex/js3d/js3d/project/vite.config.ts +5 -0
  333. package/resources/targets/codex/js3d/recovery.md +7 -0
  334. package/resources/targets/codex/js3d/target.json +60 -0
  335. package/resources/targets/index.json +41 -0
  336. package/resources/targets/workbuddy/js/bootstrap/SKILL.md +14 -0
  337. package/resources/targets/workbuddy/js/craft-game-maker/SKILL.md +77 -0
  338. package/resources/targets/workbuddy/js/craft-game-maker/js.md +10 -0
  339. package/resources/targets/workbuddy/js/js/bundle.json +99 -0
  340. package/resources/targets/workbuddy/js/js/context/AGENTS.md +25 -0
  341. package/resources/targets/workbuddy/js/js/context/hooks/hooks.json +14 -0
  342. package/resources/targets/workbuddy/js/js/context/knowledge/AigcWiring.md +9 -0
  343. package/resources/targets/workbuddy/js/js/context/knowledge/AssetUrl.md +9 -0
  344. package/resources/targets/workbuddy/js/js/context/knowledge/Layout.md +7 -0
  345. package/resources/targets/workbuddy/js/js/context/knowledge/Lifecycle.md +11 -0
  346. package/resources/targets/workbuddy/js/js/context/skills/aigc-generate/SKILL.md +14 -0
  347. package/resources/targets/workbuddy/js/js/context/skills/asset-search/SKILL.md +12 -0
  348. package/resources/targets/workbuddy/js/js/context/skills/asset-search/references/resource-config.md +9 -0
  349. package/resources/targets/workbuddy/js/js/context/skills/export-config/SKILL.md +16 -0
  350. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  351. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  352. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  353. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  354. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  355. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  356. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  357. package/resources/targets/workbuddy/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  358. package/resources/targets/workbuddy/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  359. package/resources/targets/workbuddy/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  360. package/resources/targets/workbuddy/js/js/context/skills/index.json +31 -0
  361. package/resources/targets/workbuddy/js/js/context/skills/visual-qa/SKILL.md +14 -0
  362. package/resources/targets/workbuddy/js/js/project/README.md +7 -0
  363. package/resources/targets/workbuddy/js/js/project/configs/assets.json +1 -0
  364. package/resources/targets/workbuddy/js/js/project/configs/game.controls.json +3 -0
  365. package/resources/targets/workbuddy/js/js/project/configs/game.json +3 -0
  366. package/resources/targets/workbuddy/js/js/project/game-runtime.json +7 -0
  367. package/resources/targets/workbuddy/js/js/project/game.config.json +7 -0
  368. package/resources/targets/workbuddy/js/js/project/index.html +20 -0
  369. package/resources/targets/workbuddy/js/js/project/package.json +22 -0
  370. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  371. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  372. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  373. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  374. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  375. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  376. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  377. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  378. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  379. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  380. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  381. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  382. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  383. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  384. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  385. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  386. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  387. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  388. package/resources/targets/workbuddy/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  389. package/resources/targets/workbuddy/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  390. package/resources/targets/workbuddy/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  391. package/resources/targets/workbuddy/js/js/project/scripts/config-export.mjs +13 -0
  392. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  393. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  394. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  395. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  396. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  397. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  398. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  399. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  400. package/resources/targets/workbuddy/js/js/project/scripts/write-preview-ready.mjs +22 -0
  401. package/resources/targets/workbuddy/js/js/project/src/display/ui-stage.ts +156 -0
  402. package/resources/targets/workbuddy/js/js/project/src/display/viewport.ts +249 -0
  403. package/resources/targets/workbuddy/js/js/project/src/main.ts +87 -0
  404. package/resources/targets/workbuddy/js/js/project/src/platform.ts +2 -0
  405. package/resources/targets/workbuddy/js/js/project/src/scenes/LoadScene.ts +89 -0
  406. package/resources/targets/workbuddy/js/js/project/src/scenes/PlayScene.ts +17 -0
  407. package/resources/targets/workbuddy/js/js/project/src/screenUi.ts +185 -0
  408. package/resources/targets/workbuddy/js/js/project/src/style.css +294 -0
  409. package/resources/targets/workbuddy/js/js/project/tsconfig.json +20 -0
  410. package/resources/targets/workbuddy/js/js/project/unified_data_control_config.json +20 -0
  411. package/resources/targets/workbuddy/js/js/project/vite.config.ts +5 -0
  412. package/resources/targets/workbuddy/js/recovery.md +7 -0
  413. package/resources/targets/workbuddy/js/target.json +61 -0
  414. package/resources/targets/workbuddy/js3d/bootstrap/SKILL.md +14 -0
  415. package/resources/targets/workbuddy/js3d/craft-game-maker/SKILL.md +77 -0
  416. package/resources/targets/workbuddy/js3d/craft-game-maker/js3d.md +13 -0
  417. package/resources/targets/workbuddy/js3d/js3d/bundle.json +110 -0
  418. package/resources/targets/workbuddy/js3d/js3d/context/AGENTS.md +26 -0
  419. package/resources/targets/workbuddy/js3d/js3d/context/hooks/hooks.json +14 -0
  420. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AigcWiring.md +9 -0
  421. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  422. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  423. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/Layout.md +7 -0
  424. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/Runtime.md +9 -0
  425. package/resources/targets/workbuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +14 -0
  426. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-search/SKILL.md +12 -0
  427. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md +11 -0
  428. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  429. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  430. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  431. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  432. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  433. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  434. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  435. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  436. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  437. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  438. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  439. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  440. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  441. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  442. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  443. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  444. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  445. package/resources/targets/workbuddy/js3d/js3d/context/skills/index.json +43 -0
  446. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  447. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  448. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  449. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  450. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  451. package/resources/targets/workbuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  452. package/resources/targets/workbuddy/js3d/js3d/project/README.md +7 -0
  453. package/resources/targets/workbuddy/js3d/js3d/project/configs/game.controls.json +3 -0
  454. package/resources/targets/workbuddy/js3d/js3d/project/configs/game.json +3 -0
  455. package/resources/targets/workbuddy/js3d/js3d/project/game-runtime.json +7 -0
  456. package/resources/targets/workbuddy/js3d/js3d/project/game.config.json +7 -0
  457. package/resources/targets/workbuddy/js3d/js3d/project/index.html +12 -0
  458. package/resources/targets/workbuddy/js3d/js3d/project/package.json +23 -0
  459. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  460. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  461. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  462. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  463. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  464. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  465. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  466. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  467. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  468. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  469. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  470. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  471. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  472. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  473. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  474. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  475. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  476. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  477. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  478. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  479. package/resources/targets/workbuddy/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  480. package/resources/targets/workbuddy/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  481. package/resources/targets/workbuddy/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  482. package/resources/targets/workbuddy/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  483. package/resources/targets/workbuddy/js3d/js3d/project/scripts/config-export.mjs +15 -0
  484. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  485. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  486. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  487. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  488. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  489. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  490. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  491. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  492. package/resources/targets/workbuddy/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  493. package/resources/targets/workbuddy/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  494. package/resources/targets/workbuddy/js3d/js3d/project/src/display/viewport.ts +239 -0
  495. package/resources/targets/workbuddy/js3d/js3d/project/src/main.ts +85 -0
  496. package/resources/targets/workbuddy/js3d/js3d/project/src/platform.ts +2 -0
  497. package/resources/targets/workbuddy/js3d/js3d/project/src/style.css +83 -0
  498. package/resources/targets/workbuddy/js3d/js3d/project/tsconfig.json +20 -0
  499. package/resources/targets/workbuddy/js3d/js3d/project/unified_data_control_config.json +20 -0
  500. package/resources/targets/workbuddy/js3d/js3d/project/vite.config.ts +5 -0
  501. package/resources/targets/workbuddy/js3d/recovery.md +7 -0
  502. package/resources/targets/workbuddy/js3d/target.json +60 -0
  503. package/vendor/craft-runtime/NOTICE.md +3 -0
  504. package/vendor/craft-runtime/SOURCE.json +63 -0
  505. package/vendor/craft-runtime/index.js +1716 -0
  506. package/vendor/craft-runtime/isolated-launcher.js +94 -0
  507. package/vendor/craft-runtime/isolated-preload.js +80 -0
  508. package/vendor/craft-runtime/package.json +8 -0
  509. package/resources/js/context/.role/AGENTS_DESIGN.md +0 -9
  510. package/resources/js/context/agents/aigc-asset.md +0 -168
  511. package/resources/js/context/knowledge/AigcEnabled.md +0 -49
  512. package/resources/js/context/knowledge/FrontendComponents.md +0 -17
  513. package/resources/js/context/knowledge/MobileAdaptation.md +0 -73
  514. package/resources/js/context/knowledge/MobileAdapted.md +0 -36
  515. package/resources/js/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +0 -114
  516. package/resources/js/context/knowledge/Multiplayer/OverviewKnowledge.md +0 -115
  517. package/resources/js/context/knowledge/Multiplayer/StateSyncKnowledge.md +0 -392
  518. package/resources/js/context/knowledge/PlatformServices.md +0 -190
  519. package/resources/js/context/knowledge/ProjectDisplayConfig.md +0 -35
  520. package/resources/js/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +0 -242
  521. package/resources/js/context/knowledge/Ui.md +0 -11
  522. package/resources/js/context/knowledge/UiEditorCompat.md +0 -21
  523. package/resources/js/context/rules/MultiplayerCapability.md +0 -23
  524. package/resources/js/context/rules/MultiplayerRoomEntryUX.md +0 -63
  525. package/resources/js/context/rules/PlatformBoundaryModules.md +0 -44
  526. package/resources/js/context/rules/preview_ready.md +0 -8
  527. package/resources/js/context/skills/aigc-generate/knowledge/audio.md +0 -39
  528. package/resources/js/context/skills/aigc-generate/knowledge/batch-replace.md +0 -26
  529. package/resources/js/context/skills/aigc-generate/knowledge/character2d.md +0 -132
  530. package/resources/js/context/skills/aigc-generate/knowledge/non-stepwise-aigc.md +0 -53
  531. package/resources/js/context/skills/aigc-generate/knowledge/texture-prop.md +0 -52
  532. package/resources/js/context/skills/aigc-generate/knowledge/texture-scene.md +0 -191
  533. package/resources/js/context/skills/aigc-generate/knowledge/texture-ui.md +0 -55
  534. package/resources/js/context/skills/asset-search/scripts/asset_display.mjs +0 -62
  535. package/resources/js/context/skills/asset-search/scripts/config.json +0 -5
  536. package/resources/js/context/skills/asset-search/scripts/provided_assets.mjs +0 -125
  537. package/resources/js/context/skills/asset-search/scripts/search.mjs +0 -760
  538. package/resources/js/context/skills/asset-search/scripts/sprite_source_materializer.mjs +0 -657
  539. package/resources/js/context/skills/asset-search/strategies/anim2d.md +0 -42
  540. package/resources/js/context/skills/asset-search/strategies/audio.md +0 -34
  541. package/resources/js/context/skills/asset-search/strategies/effect2d.md +0 -31
  542. package/resources/js/context/skills/asset-search/strategies/texture-prop.md +0 -22
  543. package/resources/js/context/skills/asset-search/strategies/ui-common.md +0 -40
  544. package/resources/js/context/skills/asset-search/strategies/ui-style.md +0 -28
  545. package/resources/js/context/skills/export-config/scripts/sync-asset-controls.mjs +0 -352
  546. package/resources/js/context/skills/export-config/scripts/translate-asset-titles.mjs +0 -161
  547. package/resources/js/context/skills/lightgame-runtime-adapt/SKILL.md +0 -93
  548. package/resources/js/context/skills/lightgame-runtime-adapt/project/package.json +0 -22
  549. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/config-export.mjs +0 -37
  550. package/resources/js/context/skills/lightgame-runtime-adapt/project/scripts/refresh-runtime.mjs +0 -50
  551. package/resources/js/context/skills/lightgame-runtime-adapt/scripts/install-template.mjs +0 -159
  552. package/resources/js/context/skills/mobile-adaptation/SKILL.md +0 -277
  553. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +0 -50
  554. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +0 -862
  555. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +0 -92
  556. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +0 -254
  557. package/resources/js/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +0 -245
  558. package/resources/js/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +0 -135
  559. package/resources/js/context/skills/mobile-adaptation/references/input-config.md +0 -342
  560. package/resources/js/context/skills/mobile-adaptation/references/verification.md +0 -140
  561. package/resources/js/context/skills/mobile-adaptation/references/web-audio.md +0 -11
  562. package/resources/js/context/skills/mobile-compat-qa/SKILL.md +0 -53
  563. package/resources/js/context/skills/mobile-compat-qa/references/startup-diagnosis.md +0 -23
  564. package/resources/js/context/skills/mobile-compat-qa/references/web-lifecycle.md +0 -20
  565. package/resources/js/context/skills/mobile-compat-qa/references/web-performance.md +0 -19
  566. package/resources/js/context/skills/optimization-suggestions/SKILL.md +0 -89
  567. package/resources/js/context/skills/platform-services/SKILL.md +0 -101
  568. package/resources/js/context/skills/platform-services/assets/modules/MultiplayerManager.ts +0 -465
  569. package/resources/js/context/skills/platform-services/assets/modules/eventBus.ts +0 -57
  570. package/resources/js/context/skills/platform-services/assets/modules/leaderboard.d.mts +0 -39
  571. package/resources/js/context/skills/platform-services/assets/modules/leaderboard.mjs +0 -1
  572. package/resources/js/context/skills/platform-services/assets/modules/log.ts +0 -35
  573. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +0 -61
  574. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +0 -52
  575. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +0 -30
  576. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +0 -89
  577. package/resources/js/context/skills/platform-services/assets/modules/multiplayer/types.ts +0 -47
  578. package/resources/js/context/skills/platform-services/assets/modules/save.d.mts +0 -49
  579. package/resources/js/context/skills/platform-services/assets/modules/save.mjs +0 -1
  580. package/resources/js/context/skills/platform-services/assets/scaffold/ds/main.mjs +0 -7
  581. package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +0 -264
  582. package/resources/js/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +0 -39
  583. package/resources/js/context/skills/platform-services/references/SERVER_GUIDE.md +0 -139
  584. package/resources/js/context/skills/platform-services/references/api_reference.md +0 -18
  585. package/resources/js/context/skills/platform-services/references/leaderboard_playbook.md +0 -96
  586. package/resources/js/context/skills/platform-services/scripts/install.mjs +0 -148
  587. package/resources/js/context/skills/resolution-adaptation/SKILL.md +0 -47
  588. package/resources/js/context/skills/resolution-adaptation/assets/example/main.ts +0 -98
  589. package/resources/js/context/skills/resolution-adaptation/assets/example/ui-tokens.css +0 -200
  590. package/resources/js/context/skills/resolution-adaptation/references/audit.md +0 -31
  591. package/resources/js/context/skills/resolution-adaptation/references/device-safe-area.md +0 -40
  592. package/resources/js/context/skills/resolution-adaptation/references/game-ui-occlusion.md +0 -18
  593. package/resources/js/context/skills/resolution-adaptation/references/layout-rules.md +0 -15
  594. package/resources/js/context/skills/resolution-adaptation/references/troubleshooting.md +0 -34
  595. package/resources/js/context/skills/resolution-adaptation/references/viewport-api.md +0 -38
  596. package/resources/js/context/skills/resolution-adaptation/references/world-resize.md +0 -55
  597. package/resources/js/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +0 -448
  598. package/resources/js/context/skills/scene-editor-compat/SKILL.md +0 -94
  599. package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.assets.json +0 -13
  600. package/resources/js/context/skills/scene-editor-compat/assets/example/localcraft.scene-editor.json +0 -6
  601. package/resources/js/context/skills/scene-editor-compat/assets/example/src/game/sceneAdapter.ts +0 -25
  602. package/resources/js/context/skills/scene-editor-compat/assets/example/src/scenes/main.scene.json +0 -18
  603. package/resources/js/context/skills/scene-editor-compat/assets/runtime/release.json +0 -7
  604. package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.d.mts +0 -42
  605. package/resources/js/context/skills/scene-editor-compat/assets/runtime/scene.mjs +0 -144
  606. package/resources/js/context/skills/scene-editor-compat/docs/contract.md +0 -330
  607. package/resources/js/context/skills/scene-editor-compat/docs/resource-sync.md +0 -64
  608. package/resources/js/context/skills/scene-editor-compat/docs/runtime-state.md +0 -28
  609. package/resources/js/context/skills/scene-editor-compat/docs/terrain-contract.md +0 -47
  610. package/resources/js/context/skills/scene-editor-compat/docs/visual-contract.md +0 -64
  611. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.assets.json +0 -38
  612. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/localcraft.scene-editor.json +0 -9
  613. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneAdapter.ts +0 -59
  614. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneBlockers.ts +0 -30
  615. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/game/sceneFileAssets.ts +0 -66
  616. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/Main.Scene.ts +0 -20
  617. package/resources/js/context/skills/scene-editor-compat/examples/platformer-ts/src/scenes/SceneTypes.ts +0 -26
  618. package/resources/js/context/skills/scene-editor-compat/references/contract.md +0 -73
  619. package/resources/js/context/skills/scene-editor-compat/scripts/apply_scene_marker.py +0 -162
  620. package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_contract.py +0 -853
  621. package/resources/js/context/skills/scene-editor-compat/scripts/check_scene_resource_urls.py +0 -173
  622. package/resources/js/context/skills/scene-editor-compat/scripts/scene-editor.mjs +0 -427
  623. package/resources/js/context/skills/scene-editor-compat/version.json +0 -1
  624. package/resources/js/context/skills/ui-editor-compat/SKILL.md +0 -48
  625. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +0 -35
  626. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +0 -74
  627. package/resources/js/context/skills/ui-editor-compat/assets/example/hud/hud.css +0 -60
  628. package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +0 -45
  629. package/resources/js/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +0 -265
  630. package/resources/js/context/skills/ui-editor-compat/assets/runtime/release.json +0 -7
  631. package/resources/js/context/skills/ui-editor-compat/references/contract.md +0 -132
  632. package/resources/js/context/skills/ui-editor-compat/scripts/editor-contract.mjs +0 -327
  633. package/resources/js/context/skills/ui-editor-compat/scripts/project-files.mjs +0 -80
  634. package/resources/js/context/skills/ui-editor-compat/scripts/ui-editor.mjs +0 -84
  635. package/resources/js/context/skills/version-update/SKILL.md +0 -192
  636. package/resources/js/context/skills/version-update/scripts/check_runtime_refs.mjs +0 -129
  637. package/resources/js/context/skills/version-update/scripts/feature_snapshot.mjs +0 -159
  638. package/resources/js/context/skills/version-update/scripts/update_feature_version.mjs +0 -157
  639. package/resources/js/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
  640. package/resources/js/context/version/version.json +0 -1
  641. package/resources/js/project/SPEC/assist/.gitkeep +0 -0
  642. package/resources/js/project/SPEC/guide/.gitkeep +0 -0
  643. package/resources/js/project/SPEC/plan/.gitkeep +0 -0
  644. package/resources/js/project/SPEC/readme.md +0 -6
  645. package/resources/js/project/SPEC/res/.gitkeep +0 -0
  646. package/resources/js/project/SPEC/task-item/.gitkeep +0 -0
  647. package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +0 -39
  648. package/resources/js/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +0 -1
  649. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +0 -25
  650. package/resources/js/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +0 -1
  651. package/resources/js/project/runtime/lightgame/1.0.0/platform/save.d.mts +0 -49
  652. package/resources/js/project/runtime/lightgame/1.0.0/platform/save.mjs +0 -1
  653. package/resources/js/project/runtime/lightgame/1.0.0/release.json +0 -37
  654. package/resources/js/project/runtime/lightgame/1.0.0/tooling/cli.mjs +0 -2
  655. package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.d.mts +0 -8
  656. package/resources/js/project/runtime/lightgame/1.0.0/tooling/project.mjs +0 -2
  657. package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +0 -3
  658. package/resources/js/project/runtime/lightgame/1.0.0/tooling/vite.mjs +0 -8
  659. package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.d.mts +0 -20
  660. package/resources/js/project/runtime/lightgame/1.0.0/tools/audio.mjs +0 -1
  661. package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +0 -21
  662. package/resources/js/project/runtime/lightgame/1.0.0/tools/canvas.mjs +0 -1
  663. package/resources/js/project/runtime/lightgame/1.0.0/tools/input.d.mts +0 -17
  664. package/resources/js/project/runtime/lightgame/1.0.0/tools/input.mjs +0 -1
  665. package/resources/js/project/runtime/lightgame/1.0.0/tools/three.d.mts +0 -40
  666. package/resources/js/project/runtime/lightgame/1.0.0/tools/three.mjs +0 -1
  667. package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.d.mts +0 -10
  668. package/resources/js/project/runtime/lightgame/1.0.0/tools/ui.mjs +0 -1
  669. package/resources/js/project/runtime/lightgame/1.0.0/tools/video.d.mts +0 -8
  670. package/resources/js/project/runtime/lightgame/1.0.0/tools/video.mjs +0 -1
  671. package/resources/js/project/scripts/refresh-runtime.mjs +0 -50
  672. package/resources/js/project/vendor/core-manager-js/package.json +0 -33
  673. package/resources/js/project/vendor/core-manager-js/src/.versions.json +0 -42
  674. package/resources/js/project/vendor/core-manager-js/src/CoreManagerPlugin.ts +0 -41
  675. package/resources/js/project/vendor/core-manager-js/src/assetManager/AssetRef.ts +0 -93
  676. package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcFirstImageFile.ts +0 -203
  677. package/resources/js/project/vendor/core-manager-js/src/assetManager/AstcTextureLoader.ts +0 -106
  678. package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.test.ts +0 -25
  679. package/resources/js/project/vendor/core-manager-js/src/assetManager/resolveAssetUrl.ts +0 -21
  680. package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.test.ts +0 -65
  681. package/resources/js/project/vendor/core-manager-js/src/audioManager/AudioManager.ts +0 -340
  682. package/resources/js/project/vendor/core-manager-js/src/configManager/FeatureConfig.ts +0 -87
  683. package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.d.mts +0 -92
  684. package/resources/js/project/vendor/core-manager-js/src/configManager/tuneRuntime.mjs +0 -271
  685. package/resources/js/project/vendor/core-manager-js/src/index.ts +0 -31
  686. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputConfig.ts +0 -81
  687. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.test.ts +0 -43
  688. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputManager.ts +0 -32
  689. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.test.ts +0 -141
  690. package/resources/js/project/vendor/core-manager-js/src/inputManager/InputRuntime.ts +0 -20
  691. package/resources/js/project/vendor/core-manager-js/src/inputManager/KeyboardProvider.ts +0 -183
  692. package/resources/js/project/vendor/core-manager-js/src/inputManager/TouchProvider.ts +0 -304
  693. package/resources/js/project/vendor/core-manager-js/src/inputManager/VirtualJoystick.ts +0 -351
  694. package/resources/js/project/vendor/core-manager-js/src/inputManager/_internal/InputManagerImpl.ts +0 -180
  695. package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64 +0 -13
  696. package/resources/js/project/vendor/core-manager-js/src/inputManager/icons.b64.d.ts +0 -14
  697. package/resources/js/project/vendor/core-manager-js/src/inputManager/input_config.example.json +0 -68
  698. package/resources/js/project/vendor/core-manager-js/src/logManager/DebugConsole.ts +0 -433
  699. package/resources/js/project/vendor/core-manager-js/src/logManager/LogCapture.ts +0 -118
  700. package/resources/js/project/vendor/core-manager-js/src/logManager/LogManager.ts +0 -444
  701. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCapture.ts +0 -485
  702. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.test.ts +0 -66
  703. package/resources/js/project/vendor/core-manager-js/src/logManager/ScreenCaptureVideo.ts +0 -149
  704. package/resources/js/project/vendor/core-manager-js/src/logManager/icons.b64 +0 -9
  705. package/resources/js/project/vendor/core-manager-js/src/resourceManager/AssetUrlResolver.ts +0 -29
  706. package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.test.ts +0 -88
  707. package/resources/js/project/vendor/core-manager-js/src/resourceManager/ResourceManager.ts +0 -122
  708. package/resources/js/project/vendor/core-manager-js/src/runtime.ts +0 -24
  709. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterEntity.ts +0 -318
  710. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.test.ts +0 -151
  711. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/CharacterPhysicsBinding.ts +0 -235
  712. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.test.ts +0 -98
  713. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectComposite.ts +0 -94
  714. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/EffectEntity.ts +0 -209
  715. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.test.ts +0 -106
  716. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxManager.ts +0 -341
  717. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.test.ts +0 -68
  718. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/FxRecipe.ts +0 -236
  719. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.test.ts +0 -22
  720. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteAnimManager.ts +0 -29
  721. package/resources/js/project/vendor/core-manager-js/src/spriteAnimManager/SpriteEntity.test.ts +0 -197
  722. package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiContracts.ts +0 -9
  723. package/resources/js/project/vendor/core-manager-js/src/uiManager/DomUiKit.ts +0 -555
  724. package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.test.ts +0 -112
  725. package/resources/js/project/vendor/core-manager-js/src/uiManager/UIFacadePlugin.ts +0 -178
  726. package/resources/js/project/vendor/core-manager-js/src/uiManager/ui-base.css +0 -246
  727. package/resources/js/project/vendor/core-manager-js/src/videoManager/VideoManager.ts +0 -139
  728. package/resources/js/project/vendor/core-manager-js/tsconfig.json +0 -15
  729. package/resources/js/project/vendor/run.sh +0 -4
  730. package/resources/js/project/version/craft_feature_version.json +0 -42
  731. package/resources/js/project/version/project_feature_version.json +0 -11
  732. package/resources/js3d/context/.role/AGENTS_DESIGN.md +0 -9
  733. package/resources/js3d/context/knowledge/3D/PoseInterpolationKnowledge.md +0 -75
  734. package/resources/js3d/context/knowledge/CodingGuide/SceneEditableGuide.md +0 -42
  735. package/resources/js3d/context/knowledge/FrontendComponents.md +0 -19
  736. package/resources/js3d/context/knowledge/MobileAdaptation.md +0 -73
  737. package/resources/js3d/context/knowledge/MobileAdapted.md +0 -36
  738. package/resources/js3d/context/knowledge/Multiplayer/GameplaySystemKnowledge.md +0 -114
  739. package/resources/js3d/context/knowledge/Multiplayer/OverviewKnowledge.md +0 -117
  740. package/resources/js3d/context/knowledge/Multiplayer/StateSyncKnowledge.md +0 -430
  741. package/resources/js3d/context/knowledge/PlatformServices.md +0 -190
  742. package/resources/js3d/context/knowledge/ProjectDisplayConfig.md +0 -35
  743. package/resources/js3d/context/knowledge/SceneEditorCompat.md +0 -35
  744. package/resources/js3d/context/knowledge/StepByStep.md +0 -21
  745. package/resources/js3d/context/knowledge/Subsystems/Optional/MultiplayerManagerKnowledge.md +0 -242
  746. package/resources/js3d/context/knowledge/UiEditorCompat.md +0 -21
  747. package/resources/js3d/context/rules/MultiplayerCapability.md +0 -27
  748. package/resources/js3d/context/rules/MultiplayerRoomEntryUX.md +0 -63
  749. package/resources/js3d/context/rules/PlatformBoundaryModules.md +0 -44
  750. package/resources/js3d/context/rules/preview_ready.md +0 -8
  751. package/resources/js3d/context/skills/aigc-integration/assets/sprite-sheet-player.mjs +0 -70
  752. package/resources/js3d/context/skills/aigc-integration/callback.md +0 -77
  753. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/README.md +0 -23
  754. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/audio-aigc-knowledge.md +0 -38
  755. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/character2d-aigc-knowledge.md +0 -72
  756. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/staticmesh-aigc-knowledge.md +0 -33
  757. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-prop-aigc-knowledge.md +0 -36
  758. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-scene-aigc-knowledge.md +0 -37
  759. package/resources/js3d/context/skills/aigc-integration/knowledge/aigc/texture-ui-aigc-knowledge.md +0 -35
  760. package/resources/js3d/context/skills/asset-search/references/sprite-sheets.md +0 -58
  761. package/resources/js3d/context/skills/asset-search/scripts/asset_display.mjs +0 -62
  762. package/resources/js3d/context/skills/asset-search/scripts/config.json +0 -235
  763. package/resources/js3d/context/skills/asset-search/scripts/manifest_pipeline.mjs +0 -905
  764. package/resources/js3d/context/skills/asset-search/scripts/preflight.mjs +0 -79
  765. package/resources/js3d/context/skills/asset-search/scripts/provided_assets.mjs +0 -74
  766. package/resources/js3d/context/skills/asset-search/scripts/search.mjs +0 -637
  767. package/resources/js3d/context/skills/asset-search/scripts/sprite_source_materializer.mjs +0 -667
  768. package/resources/js3d/context/skills/asset-search/strategies/anim2d.md +0 -42
  769. package/resources/js3d/context/skills/asset-search/strategies/effect2d.md +0 -31
  770. package/resources/js3d/context/skills/asset-usage-audit/references/case-tidewater-zoo.md +0 -89
  771. package/resources/js3d/context/skills/asset-usage-audit/references/optimization-playbook.md +0 -143
  772. package/resources/js3d/context/skills/asset-usage-audit/references/usage-model.md +0 -90
  773. package/resources/js3d/context/skills/export-config/scripts/sync-scene-assets.mjs +0 -216
  774. package/resources/js3d/context/skills/export-config/scripts/translate-asset-titles.mjs +0 -161
  775. package/resources/js3d/context/skills/game-art-style/SKILL.md +0 -60
  776. package/resources/js3d/context/skills/game-art-style/assets/previews/cartoon.png +0 -0
  777. package/resources/js3d/context/skills/game-art-style/assets/previews/comic.png +0 -0
  778. package/resources/js3d/context/skills/game-art-style/assets/previews/cozy.png +0 -0
  779. package/resources/js3d/context/skills/game-art-style/assets/previews/cyber.png +0 -0
  780. package/resources/js3d/context/skills/game-art-style/assets/previews/horror.png +0 -0
  781. package/resources/js3d/context/skills/game-art-style/assets/previews/lowpoly.png +0 -0
  782. package/resources/js3d/context/skills/game-art-style/assets/previews/paper.png +0 -0
  783. package/resources/js3d/context/skills/game-art-style/assets/previews/voxel.png +0 -0
  784. package/resources/js3d/context/skills/game-art-style/references/art-parameters-lite.md +0 -38
  785. package/resources/js3d/context/skills/game-art-style/references/construction.md +0 -111
  786. package/resources/js3d/context/skills/game-art-style/references/materials-textures.md +0 -105
  787. package/resources/js3d/context/skills/game-art-style/references/sources.md +0 -25
  788. package/resources/js3d/context/skills/game-art-style/references/styles/cartoon.md +0 -175
  789. package/resources/js3d/context/skills/game-art-style/references/styles/comic.md +0 -168
  790. package/resources/js3d/context/skills/game-art-style/references/styles/cozy.md +0 -191
  791. package/resources/js3d/context/skills/game-art-style/references/styles/cyber.md +0 -165
  792. package/resources/js3d/context/skills/game-art-style/references/styles/horror.md +0 -173
  793. package/resources/js3d/context/skills/game-art-style/references/styles/lowpoly.md +0 -185
  794. package/resources/js3d/context/skills/game-art-style/references/styles/paper.md +0 -181
  795. package/resources/js3d/context/skills/game-art-style/references/styles/voxel.md +0 -189
  796. package/resources/js3d/context/skills/game-art-style/references/user-style-document.md +0 -88
  797. package/resources/js3d/context/skills/mobile-adaptation/SKILL.md +0 -301
  798. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-config.json +0 -104
  799. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-layer.ts +0 -933
  800. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-platform.ts +0 -92
  801. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/input-primitives.ts +0 -254
  802. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/input/look-pad.ts +0 -245
  803. package/resources/js3d/context/skills/mobile-adaptation/assets/example/src/ui/touch-controls.css +0 -257
  804. package/resources/js3d/context/skills/mobile-adaptation/references/input-config.md +0 -342
  805. package/resources/js3d/context/skills/mobile-adaptation/references/verification.md +0 -140
  806. package/resources/js3d/context/skills/mobile-adaptation/references/web-audio.md +0 -11
  807. package/resources/js3d/context/skills/mobile-compat-qa/SKILL.md +0 -53
  808. package/resources/js3d/context/skills/mobile-compat-qa/references/startup-diagnosis.md +0 -23
  809. package/resources/js3d/context/skills/mobile-compat-qa/references/web-form-input.md +0 -10
  810. package/resources/js3d/context/skills/mobile-compat-qa/references/web-lifecycle.md +0 -20
  811. package/resources/js3d/context/skills/mobile-compat-qa/references/web-performance.md +0 -19
  812. package/resources/js3d/context/skills/optimization-suggestions/SKILL.md +0 -74
  813. package/resources/js3d/context/skills/performance-audit/references/case-notes.md +0 -93
  814. package/resources/js3d/context/skills/performance-audit/references/rules.md +0 -183
  815. package/resources/js3d/context/skills/platform-services/SKILL.md +0 -101
  816. package/resources/js3d/context/skills/platform-services/assets/modules/MultiplayerManager.ts +0 -465
  817. package/resources/js3d/context/skills/platform-services/assets/modules/eventBus.ts +0 -57
  818. package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.d.mts +0 -39
  819. package/resources/js3d/context/skills/platform-services/assets/modules/leaderboard.mjs +0 -1
  820. package/resources/js3d/context/skills/platform-services/assets/modules/log.ts +0 -35
  821. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/clockSync.ts +0 -61
  822. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/dsClient.ts +0 -52
  823. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/payloadCodec.ts +0 -30
  824. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/roomHttp.ts +0 -89
  825. package/resources/js3d/context/skills/platform-services/assets/modules/multiplayer/types.ts +0 -47
  826. package/resources/js3d/context/skills/platform-services/assets/modules/save.d.mts +0 -49
  827. package/resources/js3d/context/skills/platform-services/assets/modules/save.mjs +0 -1
  828. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/main.mjs +0 -7
  829. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/SyncRoom.mjs +0 -264
  830. package/resources/js3d/context/skills/platform-services/assets/scaffold/ds/rooms/syncSchema.mjs +0 -39
  831. package/resources/js3d/context/skills/platform-services/references/SERVER_GUIDE.md +0 -139
  832. package/resources/js3d/context/skills/platform-services/references/api_reference.md +0 -18
  833. package/resources/js3d/context/skills/platform-services/references/leaderboard_playbook.md +0 -96
  834. package/resources/js3d/context/skills/platform-services/scripts/install.mjs +0 -148
  835. package/resources/js3d/context/skills/resolution-adaptation/SKILL.md +0 -46
  836. package/resources/js3d/context/skills/resolution-adaptation/assets/example/main.ts +0 -129
  837. package/resources/js3d/context/skills/resolution-adaptation/assets/example/ui-tokens.css +0 -188
  838. package/resources/js3d/context/skills/resolution-adaptation/references/audit.md +0 -31
  839. package/resources/js3d/context/skills/resolution-adaptation/references/device-safe-area.md +0 -40
  840. package/resources/js3d/context/skills/resolution-adaptation/references/game-ui-occlusion.md +0 -18
  841. package/resources/js3d/context/skills/resolution-adaptation/references/layout-rules.md +0 -15
  842. package/resources/js3d/context/skills/resolution-adaptation/references/troubleshooting.md +0 -34
  843. package/resources/js3d/context/skills/resolution-adaptation/references/viewport-api.md +0 -38
  844. package/resources/js3d/context/skills/resolution-adaptation/scripts/aspect_audit.mjs +0 -448
  845. package/resources/js3d/context/skills/scene-editor-compat/SKILL.md +0 -599
  846. package/resources/js3d/context/skills/scene-editor-compat/references/bundle-contract.md +0 -141
  847. package/resources/js3d/context/skills/scene-editor-compat/references/editor-integration.md +0 -92
  848. package/resources/js3d/context/skills/scene-editor-compat/references/scene-data-format.md +0 -125
  849. package/resources/js3d/context/skills/scene-editor-compat/references/slots-rules.md +0 -113
  850. package/resources/js3d/context/skills/scene-editor-compat/scripts/scene-editor.mjs +0 -1187
  851. package/resources/js3d/context/skills/threejs-game-quality/SKILL.md +0 -53
  852. package/resources/js3d/context/skills/threejs-game-quality/agents/openai.yaml +0 -4
  853. package/resources/js3d/context/skills/threejs-game-quality/references/01-build.md +0 -94
  854. package/resources/js3d/context/skills/threejs-game-quality/references/02-avoid.md +0 -50
  855. package/resources/js3d/context/skills/threejs-game-quality/references/03-detect.md +0 -105
  856. package/resources/js3d/context/skills/threejs-game-quality/references/camera-by-genre.md +0 -147
  857. package/resources/js3d/context/skills/threejs-game-quality/references/camera-distance.md +0 -79
  858. package/resources/js3d/context/skills/threejs-game-quality/references/camera-sources.md +0 -56
  859. package/resources/js3d/context/skills/threejs-game-quality/references/character-motion-face.md +0 -51
  860. package/resources/js3d/context/skills/threejs-game-quality/references/parameter-contract.md +0 -55
  861. package/resources/js3d/context/skills/threejs-game-quality/references/refine-existing.md +0 -78
  862. package/resources/js3d/context/skills/threejs-game-quality/references/rendering-stability.md +0 -84
  863. package/resources/js3d/context/skills/threejs-game-quality/references/runtime-tools.md +0 -120
  864. package/resources/js3d/context/skills/threejs-game-quality/scripts/package.json +0 -4
  865. package/resources/js3d/context/skills/threejs-game-quality/scripts/runtime-audit.js +0 -238
  866. package/resources/js3d/context/skills/ui-editor-compat/SKILL.md +0 -59
  867. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLayout_Hud.ts +0 -35
  868. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/WidgetLogic_Hud.ts +0 -61
  869. package/resources/js3d/context/skills/ui-editor-compat/assets/example/hud/hud.css +0 -60
  870. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.d.mts +0 -45
  871. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/dom-ui.mjs +0 -265
  872. package/resources/js3d/context/skills/ui-editor-compat/assets/runtime/release.json +0 -7
  873. package/resources/js3d/context/skills/ui-editor-compat/references/contract.md +0 -110
  874. package/resources/js3d/context/skills/ui-editor-compat/scripts/editor-contract.mjs +0 -327
  875. package/resources/js3d/context/skills/ui-editor-compat/scripts/project-files.mjs +0 -80
  876. package/resources/js3d/context/skills/ui-editor-compat/scripts/ui-editor.mjs +0 -84
  877. package/resources/js3d/context/skills/version-update/SKILL.md +0 -191
  878. package/resources/js3d/context/skills/version-update/scripts/check_runtime_refs.mjs +0 -129
  879. package/resources/js3d/context/skills/version-update/scripts/feature_snapshot.mjs +0 -159
  880. package/resources/js3d/context/skills/version-update/scripts/update_feature_version.mjs +0 -157
  881. package/resources/js3d/context/skills/version-update/upgrade_diffs/.gitkeep +0 -0
  882. package/resources/js3d/context/version/version.json +0 -1
  883. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.d.mts +0 -39
  884. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/leaderboard.mjs +0 -1
  885. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.d.mts +0 -25
  886. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform-service.mjs +0 -1
  887. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/platform.mjs +0 -30
  888. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.d.mts +0 -49
  889. package/resources/js3d/project/runtime/lightgame/1.0.0/platform/save.mjs +0 -1
  890. package/resources/js3d/project/runtime/lightgame/1.0.0/release.json +0 -39
  891. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/cli.mjs +0 -2
  892. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.d.mts +0 -8
  893. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/project.mjs +0 -2
  894. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.d.mts +0 -3
  895. package/resources/js3d/project/runtime/lightgame/1.0.0/tooling/vite.mjs +0 -7
  896. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.d.mts +0 -20
  897. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/audio.mjs +0 -1
  898. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.d.mts +0 -21
  899. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/canvas.mjs +0 -1
  900. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.d.mts +0 -17
  901. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/input.mjs +0 -1
  902. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.d.mts +0 -40
  903. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/three.mjs +0 -1
  904. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.d.mts +0 -10
  905. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/ui.mjs +0 -1
  906. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.d.mts +0 -8
  907. package/resources/js3d/project/runtime/lightgame/1.0.0/tools/video.mjs +0 -1
  908. package/resources/js3d/project/scripts/refresh-runtime.mjs +0 -50
  909. package/resources/js3d/project/vendor/core-manager-three/package.json +0 -12
  910. package/resources/js3d/project/vendor/core-manager-three/src/index.ts +0 -2
  911. package/resources/js3d/project/vendor/run.sh +0 -4
  912. package/resources/js3d/project/version/craft_feature_version.json +0 -42
  913. package/resources/js3d/project/version/project_feature_version.json +0 -11
  914. package/vendor/agent-cli/dist/runtime-tools/registry.json +0 -6
  915. package/vendor/agent-cli/dist/runtime-tools/tool-bundle-types.d.cts +0 -15
  916. package/vendor/agent-cli/dist/runtime-tools/tool-bundle.cjs +0 -129
  917. package/vendor/agent-cli/dist/runtime-tools/ue/blender-cook-assets.cjs +0 -296
  918. package/vendor/agent-cli/dist/runtime-tools/ue/context-adapter.cjs +0 -48
  919. package/vendor/agent-cli/dist/runtime-tools/ue/scene-process-lock.cjs +0 -110
  920. package/vendor/agent-cli/dist/runtime-tools/ue/tool-manifest.json +0 -22
  921. package/vendor/agent-cli/dist/runtime-tools/ue/ue-asset-references.cjs +0 -305
  922. package/vendor/agent-cli/dist/src/artifacts/context-finalize.d.ts +0 -3
  923. package/vendor/agent-cli/dist/src/artifacts/context-finalize.d.ts.map +0 -1
  924. package/vendor/agent-cli/dist/src/artifacts/context-finalize.js +0 -54
  925. package/vendor/agent-cli/dist/src/artifacts/context-finalize.js.map +0 -1
  926. package/vendor/agent-cli/dist/src/artifacts/external-game-archive.d.ts +0 -19
  927. package/vendor/agent-cli/dist/src/artifacts/external-game-archive.d.ts.map +0 -1
  928. package/vendor/agent-cli/dist/src/artifacts/external-game-archive.js +0 -107
  929. package/vendor/agent-cli/dist/src/artifacts/external-game-archive.js.map +0 -1
  930. package/vendor/agent-cli/dist/src/artifacts/external-game-upload.d.ts +0 -44
  931. package/vendor/agent-cli/dist/src/artifacts/external-game-upload.d.ts.map +0 -1
  932. package/vendor/agent-cli/dist/src/artifacts/external-game-upload.js +0 -106
  933. package/vendor/agent-cli/dist/src/artifacts/external-game-upload.js.map +0 -1
  934. package/vendor/agent-cli/dist/src/artifacts/native-source.d.ts +0 -3
  935. package/vendor/agent-cli/dist/src/artifacts/native-source.d.ts.map +0 -1
  936. package/vendor/agent-cli/dist/src/artifacts/native-source.js +0 -13
  937. package/vendor/agent-cli/dist/src/artifacts/native-source.js.map +0 -1
  938. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.d.ts +0 -13
  939. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.d.ts.map +0 -1
  940. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js +0 -364
  941. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js.map +0 -1
  942. package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts +0 -61
  943. package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts.map +0 -1
  944. package/vendor/agent-cli/dist/src/artifacts/prepare.js +0 -211
  945. package/vendor/agent-cli/dist/src/artifacts/prepare.js.map +0 -1
  946. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts +0 -39
  947. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts.map +0 -1
  948. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js +0 -173
  949. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js.map +0 -1
  950. package/vendor/agent-cli/dist/src/artifacts/restore-permissions.d.ts +0 -27
  951. package/vendor/agent-cli/dist/src/artifacts/restore-permissions.d.ts.map +0 -1
  952. package/vendor/agent-cli/dist/src/artifacts/restore-permissions.js +0 -112
  953. package/vendor/agent-cli/dist/src/artifacts/restore-permissions.js.map +0 -1
  954. package/vendor/agent-cli/dist/src/artifacts/restore.d.ts +0 -37
  955. package/vendor/agent-cli/dist/src/artifacts/restore.d.ts.map +0 -1
  956. package/vendor/agent-cli/dist/src/artifacts/restore.js +0 -465
  957. package/vendor/agent-cli/dist/src/artifacts/restore.js.map +0 -1
  958. package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts +0 -7
  959. package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.d.ts.map +0 -1
  960. package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js +0 -145
  961. package/vendor/agent-cli/dist/src/artifacts/scene-asset-delivery.js.map +0 -1
  962. package/vendor/agent-cli/dist/src/artifacts/static.d.ts +0 -19
  963. package/vendor/agent-cli/dist/src/artifacts/static.d.ts.map +0 -1
  964. package/vendor/agent-cli/dist/src/artifacts/static.js +0 -224
  965. package/vendor/agent-cli/dist/src/artifacts/static.js.map +0 -1
  966. package/vendor/agent-cli/dist/src/cli/commands/process.d.ts +0 -4
  967. package/vendor/agent-cli/dist/src/cli/commands/process.d.ts.map +0 -1
  968. package/vendor/agent-cli/dist/src/cli/commands/process.js +0 -24
  969. package/vendor/agent-cli/dist/src/cli/commands/process.js.map +0 -1
  970. package/vendor/agent-cli/dist/src/cli/commands/run-controls.d.ts +0 -23
  971. package/vendor/agent-cli/dist/src/cli/commands/run-controls.d.ts.map +0 -1
  972. package/vendor/agent-cli/dist/src/cli/commands/run-controls.js +0 -62
  973. package/vendor/agent-cli/dist/src/cli/commands/run-controls.js.map +0 -1
  974. package/vendor/agent-cli/dist/src/cli/commands/run-mock.d.ts +0 -9
  975. package/vendor/agent-cli/dist/src/cli/commands/run-mock.d.ts.map +0 -1
  976. package/vendor/agent-cli/dist/src/cli/commands/run-mock.js +0 -15
  977. package/vendor/agent-cli/dist/src/cli/commands/run-mock.js.map +0 -1
  978. package/vendor/agent-cli/dist/src/cli/commands/run.d.ts +0 -3
  979. package/vendor/agent-cli/dist/src/cli/commands/run.d.ts.map +0 -1
  980. package/vendor/agent-cli/dist/src/cli/commands/run.js +0 -284
  981. package/vendor/agent-cli/dist/src/cli/commands/run.js.map +0 -1
  982. package/vendor/agent-cli/dist/src/cli/commands/setup.d.ts +0 -11
  983. package/vendor/agent-cli/dist/src/cli/commands/setup.d.ts.map +0 -1
  984. package/vendor/agent-cli/dist/src/cli/commands/setup.js +0 -161
  985. package/vendor/agent-cli/dist/src/cli/commands/setup.js.map +0 -1
  986. package/vendor/agent-cli/dist/src/cli/options.d.ts +0 -83
  987. package/vendor/agent-cli/dist/src/cli/options.d.ts.map +0 -1
  988. package/vendor/agent-cli/dist/src/cli/options.js +0 -213
  989. package/vendor/agent-cli/dist/src/cli/options.js.map +0 -1
  990. package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts +0 -5
  991. package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts.map +0 -1
  992. package/vendor/agent-cli/dist/src/cli/process-protocol.js +0 -279
  993. package/vendor/agent-cli/dist/src/cli/process-protocol.js.map +0 -1
  994. package/vendor/agent-cli/dist/src/cli/registry.d.ts +0 -55
  995. package/vendor/agent-cli/dist/src/cli/registry.d.ts.map +0 -1
  996. package/vendor/agent-cli/dist/src/cli/registry.js +0 -99
  997. package/vendor/agent-cli/dist/src/cli/registry.js.map +0 -1
  998. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.d.ts +0 -44
  999. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.d.ts.map +0 -1
  1000. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.js +0 -83
  1001. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.js.map +0 -1
  1002. package/vendor/agent-cli/dist/src/cli/render/text-sink.d.ts +0 -28
  1003. package/vendor/agent-cli/dist/src/cli/render/text-sink.d.ts.map +0 -1
  1004. package/vendor/agent-cli/dist/src/cli/render/text-sink.js +0 -52
  1005. package/vendor/agent-cli/dist/src/cli/render/text-sink.js.map +0 -1
  1006. package/vendor/agent-cli/dist/src/cli.d.ts +0 -9
  1007. package/vendor/agent-cli/dist/src/cli.d.ts.map +0 -1
  1008. package/vendor/agent-cli/dist/src/cli.js +0 -54
  1009. package/vendor/agent-cli/dist/src/cli.js.map +0 -1
  1010. package/vendor/agent-cli/dist/src/component/browser-queue.d.ts +0 -55
  1011. package/vendor/agent-cli/dist/src/component/browser-queue.d.ts.map +0 -1
  1012. package/vendor/agent-cli/dist/src/component/browser-queue.js +0 -63
  1013. package/vendor/agent-cli/dist/src/component/browser-queue.js.map +0 -1
  1014. package/vendor/agent-cli/dist/src/component/execution.d.ts +0 -28
  1015. package/vendor/agent-cli/dist/src/component/execution.d.ts.map +0 -1
  1016. package/vendor/agent-cli/dist/src/component/execution.js +0 -143
  1017. package/vendor/agent-cli/dist/src/component/execution.js.map +0 -1
  1018. package/vendor/agent-cli/dist/src/component/isolated-launcher.d.ts +0 -2
  1019. package/vendor/agent-cli/dist/src/component/isolated-launcher.d.ts.map +0 -1
  1020. package/vendor/agent-cli/dist/src/component/isolated-launcher.js +0 -76
  1021. package/vendor/agent-cli/dist/src/component/isolated-launcher.js.map +0 -1
  1022. package/vendor/agent-cli/dist/src/component/isolated-preload.d.ts +0 -2
  1023. package/vendor/agent-cli/dist/src/component/isolated-preload.d.ts.map +0 -1
  1024. package/vendor/agent-cli/dist/src/component/isolated-preload.js +0 -27
  1025. package/vendor/agent-cli/dist/src/component/isolated-preload.js.map +0 -1
  1026. package/vendor/agent-cli/dist/src/component/platform-access/server.d.ts +0 -19
  1027. package/vendor/agent-cli/dist/src/component/platform-access/server.d.ts.map +0 -1
  1028. package/vendor/agent-cli/dist/src/component/platform-access/server.js +0 -206
  1029. package/vendor/agent-cli/dist/src/component/platform-access/server.js.map +0 -1
  1030. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.d.ts +0 -31
  1031. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.d.ts.map +0 -1
  1032. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.js +0 -62
  1033. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.js.map +0 -1
  1034. package/vendor/agent-cli/dist/src/component/preparation.d.ts +0 -10
  1035. package/vendor/agent-cli/dist/src/component/preparation.d.ts.map +0 -1
  1036. package/vendor/agent-cli/dist/src/component/preparation.js +0 -35
  1037. package/vendor/agent-cli/dist/src/component/preparation.js.map +0 -1
  1038. package/vendor/agent-cli/dist/src/component/process-diagnostics.d.ts +0 -25
  1039. package/vendor/agent-cli/dist/src/component/process-diagnostics.d.ts.map +0 -1
  1040. package/vendor/agent-cli/dist/src/component/process-diagnostics.js +0 -137
  1041. package/vendor/agent-cli/dist/src/component/process-diagnostics.js.map +0 -1
  1042. package/vendor/agent-cli/dist/src/component/process-isolation.d.ts +0 -10
  1043. package/vendor/agent-cli/dist/src/component/process-isolation.d.ts.map +0 -1
  1044. package/vendor/agent-cli/dist/src/component/process-isolation.js +0 -59
  1045. package/vendor/agent-cli/dist/src/component/process-isolation.js.map +0 -1
  1046. package/vendor/agent-cli/dist/src/component/proxied-fetch.d.ts +0 -2
  1047. package/vendor/agent-cli/dist/src/component/proxied-fetch.d.ts.map +0 -1
  1048. package/vendor/agent-cli/dist/src/component/proxied-fetch.js +0 -46
  1049. package/vendor/agent-cli/dist/src/component/proxied-fetch.js.map +0 -1
  1050. package/vendor/agent-cli/dist/src/component/public-egress.d.ts +0 -17
  1051. package/vendor/agent-cli/dist/src/component/public-egress.d.ts.map +0 -1
  1052. package/vendor/agent-cli/dist/src/component/public-egress.js +0 -246
  1053. package/vendor/agent-cli/dist/src/component/public-egress.js.map +0 -1
  1054. package/vendor/agent-cli/dist/src/component/runtime-tools.d.ts +0 -15
  1055. package/vendor/agent-cli/dist/src/component/runtime-tools.d.ts.map +0 -1
  1056. package/vendor/agent-cli/dist/src/component/runtime-tools.js +0 -37
  1057. package/vendor/agent-cli/dist/src/component/runtime-tools.js.map +0 -1
  1058. package/vendor/agent-cli/dist/src/component/runtime.d.ts +0 -8
  1059. package/vendor/agent-cli/dist/src/component/runtime.d.ts.map +0 -1
  1060. package/vendor/agent-cli/dist/src/component/runtime.js +0 -95
  1061. package/vendor/agent-cli/dist/src/component/runtime.js.map +0 -1
  1062. package/vendor/agent-cli/dist/src/config/config-store.d.ts +0 -50
  1063. package/vendor/agent-cli/dist/src/config/config-store.d.ts.map +0 -1
  1064. package/vendor/agent-cli/dist/src/config/config-store.js +0 -117
  1065. package/vendor/agent-cli/dist/src/config/config-store.js.map +0 -1
  1066. package/vendor/agent-cli/dist/src/context/cache-lease.d.ts +0 -17
  1067. package/vendor/agent-cli/dist/src/context/cache-lease.d.ts.map +0 -1
  1068. package/vendor/agent-cli/dist/src/context/cache-lease.js +0 -133
  1069. package/vendor/agent-cli/dist/src/context/cache-lease.js.map +0 -1
  1070. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.d.ts +0 -9
  1071. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.d.ts.map +0 -1
  1072. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.js +0 -51
  1073. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.js.map +0 -1
  1074. package/vendor/agent-cli/dist/src/context/cache-publication-lock.d.ts +0 -3
  1075. package/vendor/agent-cli/dist/src/context/cache-publication-lock.d.ts.map +0 -1
  1076. package/vendor/agent-cli/dist/src/context/cache-publication-lock.js +0 -68
  1077. package/vendor/agent-cli/dist/src/context/cache-publication-lock.js.map +0 -1
  1078. package/vendor/agent-cli/dist/src/context/cache-publication.d.ts +0 -4
  1079. package/vendor/agent-cli/dist/src/context/cache-publication.d.ts.map +0 -1
  1080. package/vendor/agent-cli/dist/src/context/cache-publication.js +0 -58
  1081. package/vendor/agent-cli/dist/src/context/cache-publication.js.map +0 -1
  1082. package/vendor/agent-cli/dist/src/context/client-context-view.d.ts +0 -12
  1083. package/vendor/agent-cli/dist/src/context/client-context-view.d.ts.map +0 -1
  1084. package/vendor/agent-cli/dist/src/context/client-context-view.js +0 -100
  1085. package/vendor/agent-cli/dist/src/context/client-context-view.js.map +0 -1
  1086. package/vendor/agent-cli/dist/src/context/context-budget.d.ts +0 -3
  1087. package/vendor/agent-cli/dist/src/context/context-budget.d.ts.map +0 -1
  1088. package/vendor/agent-cli/dist/src/context/context-budget.js +0 -10
  1089. package/vendor/agent-cli/dist/src/context/context-budget.js.map +0 -1
  1090. package/vendor/agent-cli/dist/src/context/context-cache.d.ts +0 -108
  1091. package/vendor/agent-cli/dist/src/context/context-cache.d.ts.map +0 -1
  1092. package/vendor/agent-cli/dist/src/context/context-cache.js +0 -360
  1093. package/vendor/agent-cli/dist/src/context/context-cache.js.map +0 -1
  1094. package/vendor/agent-cli/dist/src/context/context-project.d.ts +0 -67
  1095. package/vendor/agent-cli/dist/src/context/context-project.d.ts.map +0 -1
  1096. package/vendor/agent-cli/dist/src/context/context-project.js +0 -254
  1097. package/vendor/agent-cli/dist/src/context/context-project.js.map +0 -1
  1098. package/vendor/agent-cli/dist/src/context/context-resource.d.ts +0 -4
  1099. package/vendor/agent-cli/dist/src/context/context-resource.d.ts.map +0 -1
  1100. package/vendor/agent-cli/dist/src/context/context-resource.js +0 -11
  1101. package/vendor/agent-cli/dist/src/context/context-resource.js.map +0 -1
  1102. package/vendor/agent-cli/dist/src/context/context-scoped-source.d.ts +0 -13
  1103. package/vendor/agent-cli/dist/src/context/context-scoped-source.d.ts.map +0 -1
  1104. package/vendor/agent-cli/dist/src/context/context-scoped-source.js +0 -78
  1105. package/vendor/agent-cli/dist/src/context/context-scoped-source.js.map +0 -1
  1106. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.d.ts +0 -23
  1107. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.d.ts.map +0 -1
  1108. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.js +0 -200
  1109. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.js.map +0 -1
  1110. package/vendor/agent-cli/dist/src/context/local-skills.d.ts +0 -6
  1111. package/vendor/agent-cli/dist/src/context/local-skills.d.ts.map +0 -1
  1112. package/vendor/agent-cli/dist/src/context/local-skills.js +0 -174
  1113. package/vendor/agent-cli/dist/src/context/local-skills.js.map +0 -1
  1114. package/vendor/agent-cli/dist/src/context/member-context.d.ts +0 -20
  1115. package/vendor/agent-cli/dist/src/context/member-context.d.ts.map +0 -1
  1116. package/vendor/agent-cli/dist/src/context/member-context.js +0 -113
  1117. package/vendor/agent-cli/dist/src/context/member-context.js.map +0 -1
  1118. package/vendor/agent-cli/dist/src/context/member-documents.d.ts +0 -3
  1119. package/vendor/agent-cli/dist/src/context/member-documents.d.ts.map +0 -1
  1120. package/vendor/agent-cli/dist/src/context/member-documents.js +0 -38
  1121. package/vendor/agent-cli/dist/src/context/member-documents.js.map +0 -1
  1122. package/vendor/agent-cli/dist/src/context/member-profile-header.d.ts +0 -3
  1123. package/vendor/agent-cli/dist/src/context/member-profile-header.d.ts.map +0 -1
  1124. package/vendor/agent-cli/dist/src/context/member-profile-header.js +0 -62
  1125. package/vendor/agent-cli/dist/src/context/member-profile-header.js.map +0 -1
  1126. package/vendor/agent-cli/dist/src/context/member-profile.d.ts +0 -43
  1127. package/vendor/agent-cli/dist/src/context/member-profile.d.ts.map +0 -1
  1128. package/vendor/agent-cli/dist/src/context/member-profile.js +0 -91
  1129. package/vendor/agent-cli/dist/src/context/member-profile.js.map +0 -1
  1130. package/vendor/agent-cli/dist/src/context/member-selection.d.ts +0 -7
  1131. package/vendor/agent-cli/dist/src/context/member-selection.d.ts.map +0 -1
  1132. package/vendor/agent-cli/dist/src/context/member-selection.js +0 -58
  1133. package/vendor/agent-cli/dist/src/context/member-selection.js.map +0 -1
  1134. package/vendor/agent-cli/dist/src/context/script-dependencies.d.ts +0 -14
  1135. package/vendor/agent-cli/dist/src/context/script-dependencies.d.ts.map +0 -1
  1136. package/vendor/agent-cli/dist/src/context/script-dependencies.js +0 -40
  1137. package/vendor/agent-cli/dist/src/context/script-dependencies.js.map +0 -1
  1138. package/vendor/agent-cli/dist/src/context/shared-cache-build.d.ts +0 -3
  1139. package/vendor/agent-cli/dist/src/context/shared-cache-build.d.ts.map +0 -1
  1140. package/vendor/agent-cli/dist/src/context/shared-cache-build.js +0 -56
  1141. package/vendor/agent-cli/dist/src/context/shared-cache-build.js.map +0 -1
  1142. package/vendor/agent-cli/dist/src/context/team-definition.d.ts +0 -39
  1143. package/vendor/agent-cli/dist/src/context/team-definition.d.ts.map +0 -1
  1144. package/vendor/agent-cli/dist/src/context/team-definition.js +0 -78
  1145. package/vendor/agent-cli/dist/src/context/team-definition.js.map +0 -1
  1146. package/vendor/agent-cli/dist/src/context/team-knowledge.d.ts +0 -7
  1147. package/vendor/agent-cli/dist/src/context/team-knowledge.d.ts.map +0 -1
  1148. package/vendor/agent-cli/dist/src/context/team-knowledge.js +0 -46
  1149. package/vendor/agent-cli/dist/src/context/team-knowledge.js.map +0 -1
  1150. package/vendor/agent-cli/dist/src/context/template-cache.d.ts +0 -31
  1151. package/vendor/agent-cli/dist/src/context/template-cache.d.ts.map +0 -1
  1152. package/vendor/agent-cli/dist/src/context/template-cache.js +0 -100
  1153. package/vendor/agent-cli/dist/src/context/template-cache.js.map +0 -1
  1154. package/vendor/agent-cli/dist/src/context/template-refresh.d.ts +0 -6
  1155. package/vendor/agent-cli/dist/src/context/template-refresh.d.ts.map +0 -1
  1156. package/vendor/agent-cli/dist/src/context/template-refresh.js +0 -45
  1157. package/vendor/agent-cli/dist/src/context/template-refresh.js.map +0 -1
  1158. package/vendor/agent-cli/dist/src/context/template-seed.d.ts +0 -45
  1159. package/vendor/agent-cli/dist/src/context/template-seed.d.ts.map +0 -1
  1160. package/vendor/agent-cli/dist/src/context/template-seed.js +0 -169
  1161. package/vendor/agent-cli/dist/src/context/template-seed.js.map +0 -1
  1162. package/vendor/agent-cli/dist/src/context/template-sync.d.ts +0 -11
  1163. package/vendor/agent-cli/dist/src/context/template-sync.d.ts.map +0 -1
  1164. package/vendor/agent-cli/dist/src/context/template-sync.js +0 -167
  1165. package/vendor/agent-cli/dist/src/context/template-sync.js.map +0 -1
  1166. package/vendor/agent-cli/dist/src/context/user-skill-bundle.d.ts +0 -19
  1167. package/vendor/agent-cli/dist/src/context/user-skill-bundle.d.ts.map +0 -1
  1168. package/vendor/agent-cli/dist/src/context/user-skill-bundle.js +0 -292
  1169. package/vendor/agent-cli/dist/src/context/user-skill-bundle.js.map +0 -1
  1170. package/vendor/agent-cli/dist/src/context/user-skill-context.d.ts +0 -15
  1171. package/vendor/agent-cli/dist/src/context/user-skill-context.d.ts.map +0 -1
  1172. package/vendor/agent-cli/dist/src/context/user-skill-context.js +0 -217
  1173. package/vendor/agent-cli/dist/src/context/user-skill-context.js.map +0 -1
  1174. package/vendor/agent-cli/dist/src/context/user-skill-install.d.ts +0 -54
  1175. package/vendor/agent-cli/dist/src/context/user-skill-install.d.ts.map +0 -1
  1176. package/vendor/agent-cli/dist/src/context/user-skill-install.js +0 -184
  1177. package/vendor/agent-cli/dist/src/context/user-skill-install.js.map +0 -1
  1178. package/vendor/agent-cli/dist/src/context/zip-extract.d.ts +0 -14
  1179. package/vendor/agent-cli/dist/src/context/zip-extract.d.ts.map +0 -1
  1180. package/vendor/agent-cli/dist/src/context/zip-extract.js +0 -130
  1181. package/vendor/agent-cli/dist/src/context/zip-extract.js.map +0 -1
  1182. package/vendor/agent-cli/dist/src/index.d.ts +0 -62
  1183. package/vendor/agent-cli/dist/src/index.d.ts.map +0 -1
  1184. package/vendor/agent-cli/dist/src/index.js +0 -88
  1185. package/vendor/agent-cli/dist/src/index.js.map +0 -1
  1186. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.d.ts +0 -68
  1187. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.d.ts.map +0 -1
  1188. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.js +0 -244
  1189. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.js.map +0 -1
  1190. package/vendor/agent-cli/dist/src/lifecycle/hook-command.d.ts +0 -40
  1191. package/vendor/agent-cli/dist/src/lifecycle/hook-command.d.ts.map +0 -1
  1192. package/vendor/agent-cli/dist/src/lifecycle/hook-command.js +0 -87
  1193. package/vendor/agent-cli/dist/src/lifecycle/hook-command.js.map +0 -1
  1194. package/vendor/agent-cli/dist/src/lifecycle/registry.d.ts +0 -134
  1195. package/vendor/agent-cli/dist/src/lifecycle/registry.d.ts.map +0 -1
  1196. package/vendor/agent-cli/dist/src/lifecycle/registry.js +0 -152
  1197. package/vendor/agent-cli/dist/src/lifecycle/registry.js.map +0 -1
  1198. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.d.ts +0 -40
  1199. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.d.ts.map +0 -1
  1200. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.js +0 -149
  1201. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.js.map +0 -1
  1202. package/vendor/agent-cli/dist/src/mcp/client.d.ts +0 -12
  1203. package/vendor/agent-cli/dist/src/mcp/client.d.ts.map +0 -1
  1204. package/vendor/agent-cli/dist/src/mcp/client.js +0 -95
  1205. package/vendor/agent-cli/dist/src/mcp/client.js.map +0 -1
  1206. package/vendor/agent-cli/dist/src/mcp/connection.d.ts +0 -14
  1207. package/vendor/agent-cli/dist/src/mcp/connection.d.ts.map +0 -1
  1208. package/vendor/agent-cli/dist/src/mcp/connection.js +0 -115
  1209. package/vendor/agent-cli/dist/src/mcp/connection.js.map +0 -1
  1210. package/vendor/agent-cli/dist/src/mcp/execute.d.ts +0 -5
  1211. package/vendor/agent-cli/dist/src/mcp/execute.d.ts.map +0 -1
  1212. package/vendor/agent-cli/dist/src/mcp/execute.js +0 -26
  1213. package/vendor/agent-cli/dist/src/mcp/execute.js.map +0 -1
  1214. package/vendor/agent-cli/dist/src/mcp/instance-lock.d.ts +0 -11
  1215. package/vendor/agent-cli/dist/src/mcp/instance-lock.d.ts.map +0 -1
  1216. package/vendor/agent-cli/dist/src/mcp/instance-lock.js +0 -51
  1217. package/vendor/agent-cli/dist/src/mcp/instance-lock.js.map +0 -1
  1218. package/vendor/agent-cli/dist/src/mcp/types.d.ts +0 -27
  1219. package/vendor/agent-cli/dist/src/mcp/types.d.ts.map +0 -1
  1220. package/vendor/agent-cli/dist/src/mcp/types.js +0 -2
  1221. package/vendor/agent-cli/dist/src/mcp/types.js.map +0 -1
  1222. package/vendor/agent-cli/dist/src/protocol/input.d.ts +0 -21
  1223. package/vendor/agent-cli/dist/src/protocol/input.d.ts.map +0 -1
  1224. package/vendor/agent-cli/dist/src/protocol/input.js +0 -95
  1225. package/vendor/agent-cli/dist/src/protocol/input.js.map +0 -1
  1226. package/vendor/agent-cli/dist/src/protocol/link/channel.d.ts +0 -58
  1227. package/vendor/agent-cli/dist/src/protocol/link/channel.d.ts.map +0 -1
  1228. package/vendor/agent-cli/dist/src/protocol/link/channel.js +0 -337
  1229. package/vendor/agent-cli/dist/src/protocol/link/channel.js.map +0 -1
  1230. package/vendor/agent-cli/dist/src/protocol/link/codec-json.d.ts +0 -13
  1231. package/vendor/agent-cli/dist/src/protocol/link/codec-json.d.ts.map +0 -1
  1232. package/vendor/agent-cli/dist/src/protocol/link/codec-json.js +0 -27
  1233. package/vendor/agent-cli/dist/src/protocol/link/codec-json.js.map +0 -1
  1234. package/vendor/agent-cli/dist/src/protocol/link/envelope.d.ts +0 -57
  1235. package/vendor/agent-cli/dist/src/protocol/link/envelope.d.ts.map +0 -1
  1236. package/vendor/agent-cli/dist/src/protocol/link/envelope.js +0 -93
  1237. package/vendor/agent-cli/dist/src/protocol/link/envelope.js.map +0 -1
  1238. package/vendor/agent-cli/dist/src/protocol/link/liveness.d.ts +0 -28
  1239. package/vendor/agent-cli/dist/src/protocol/link/liveness.d.ts.map +0 -1
  1240. package/vendor/agent-cli/dist/src/protocol/link/liveness.js +0 -86
  1241. package/vendor/agent-cli/dist/src/protocol/link/liveness.js.map +0 -1
  1242. package/vendor/agent-cli/dist/src/protocol/link/middleware.d.ts +0 -14
  1243. package/vendor/agent-cli/dist/src/protocol/link/middleware.d.ts.map +0 -1
  1244. package/vendor/agent-cli/dist/src/protocol/link/middleware.js +0 -40
  1245. package/vendor/agent-cli/dist/src/protocol/link/middleware.js.map +0 -1
  1246. package/vendor/agent-cli/dist/src/protocol/link/rpc.d.ts +0 -31
  1247. package/vendor/agent-cli/dist/src/protocol/link/rpc.d.ts.map +0 -1
  1248. package/vendor/agent-cli/dist/src/protocol/link/rpc.js +0 -90
  1249. package/vendor/agent-cli/dist/src/protocol/link/rpc.js.map +0 -1
  1250. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.d.ts +0 -32
  1251. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.d.ts.map +0 -1
  1252. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.js +0 -106
  1253. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.js.map +0 -1
  1254. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.d.ts +0 -533
  1255. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.d.ts.map +0 -1
  1256. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.js +0 -137
  1257. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.js.map +0 -1
  1258. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts +0 -420
  1259. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts.map +0 -1
  1260. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js +0 -116
  1261. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js.map +0 -1
  1262. package/vendor/agent-cli/dist/src/security/binary-read-receipts.d.ts +0 -9
  1263. package/vendor/agent-cli/dist/src/security/binary-read-receipts.d.ts.map +0 -1
  1264. package/vendor/agent-cli/dist/src/security/binary-read-receipts.js +0 -58
  1265. package/vendor/agent-cli/dist/src/security/binary-read-receipts.js.map +0 -1
  1266. package/vendor/agent-cli/dist/src/security/command-parse.d.ts +0 -21
  1267. package/vendor/agent-cli/dist/src/security/command-parse.d.ts.map +0 -1
  1268. package/vendor/agent-cli/dist/src/security/command-parse.js +0 -395
  1269. package/vendor/agent-cli/dist/src/security/command-parse.js.map +0 -1
  1270. package/vendor/agent-cli/dist/src/security/command-translate.d.ts +0 -30
  1271. package/vendor/agent-cli/dist/src/security/command-translate.d.ts.map +0 -1
  1272. package/vendor/agent-cli/dist/src/security/command-translate.js +0 -165
  1273. package/vendor/agent-cli/dist/src/security/command-translate.js.map +0 -1
  1274. package/vendor/agent-cli/dist/src/security/context-write-policy.d.ts +0 -18
  1275. package/vendor/agent-cli/dist/src/security/context-write-policy.d.ts.map +0 -1
  1276. package/vendor/agent-cli/dist/src/security/context-write-policy.js +0 -121
  1277. package/vendor/agent-cli/dist/src/security/context-write-policy.js.map +0 -1
  1278. package/vendor/agent-cli/dist/src/security/guard.d.ts +0 -45
  1279. package/vendor/agent-cli/dist/src/security/guard.d.ts.map +0 -1
  1280. package/vendor/agent-cli/dist/src/security/guard.js +0 -166
  1281. package/vendor/agent-cli/dist/src/security/guard.js.map +0 -1
  1282. package/vendor/agent-cli/dist/src/security/mount-table.d.ts +0 -56
  1283. package/vendor/agent-cli/dist/src/security/mount-table.d.ts.map +0 -1
  1284. package/vendor/agent-cli/dist/src/security/mount-table.js +0 -251
  1285. package/vendor/agent-cli/dist/src/security/mount-table.js.map +0 -1
  1286. package/vendor/agent-cli/dist/src/security/sandbox-path.d.ts +0 -23
  1287. package/vendor/agent-cli/dist/src/security/sandbox-path.d.ts.map +0 -1
  1288. package/vendor/agent-cli/dist/src/security/sandbox-path.js +0 -110
  1289. package/vendor/agent-cli/dist/src/security/sandbox-path.js.map +0 -1
  1290. package/vendor/agent-cli/dist/src/security/tool-run-owner.d.ts +0 -5
  1291. package/vendor/agent-cli/dist/src/security/tool-run-owner.d.ts.map +0 -1
  1292. package/vendor/agent-cli/dist/src/security/tool-run-owner.js +0 -16
  1293. package/vendor/agent-cli/dist/src/security/tool-run-owner.js.map +0 -1
  1294. package/vendor/agent-cli/dist/src/security/tool-scope.d.ts +0 -19
  1295. package/vendor/agent-cli/dist/src/security/tool-scope.d.ts.map +0 -1
  1296. package/vendor/agent-cli/dist/src/security/tool-scope.js +0 -122
  1297. package/vendor/agent-cli/dist/src/security/tool-scope.js.map +0 -1
  1298. package/vendor/agent-cli/dist/src/session/client.d.ts +0 -136
  1299. package/vendor/agent-cli/dist/src/session/client.d.ts.map +0 -1
  1300. package/vendor/agent-cli/dist/src/session/client.js +0 -400
  1301. package/vendor/agent-cli/dist/src/session/client.js.map +0 -1
  1302. package/vendor/agent-cli/dist/src/session/custom-context.d.ts +0 -6
  1303. package/vendor/agent-cli/dist/src/session/custom-context.d.ts.map +0 -1
  1304. package/vendor/agent-cli/dist/src/session/custom-context.js +0 -106
  1305. package/vendor/agent-cli/dist/src/session/custom-context.js.map +0 -1
  1306. package/vendor/agent-cli/dist/src/session/engine-decide.d.ts +0 -38
  1307. package/vendor/agent-cli/dist/src/session/engine-decide.d.ts.map +0 -1
  1308. package/vendor/agent-cli/dist/src/session/engine-decide.js +0 -87
  1309. package/vendor/agent-cli/dist/src/session/engine-decide.js.map +0 -1
  1310. package/vendor/agent-cli/dist/src/session/execution-recovery.d.ts +0 -9
  1311. package/vendor/agent-cli/dist/src/session/execution-recovery.d.ts.map +0 -1
  1312. package/vendor/agent-cli/dist/src/session/execution-recovery.js +0 -49
  1313. package/vendor/agent-cli/dist/src/session/execution-recovery.js.map +0 -1
  1314. package/vendor/agent-cli/dist/src/session/execution-settlement.d.ts +0 -4
  1315. package/vendor/agent-cli/dist/src/session/execution-settlement.d.ts.map +0 -1
  1316. package/vendor/agent-cli/dist/src/session/execution-settlement.js +0 -15
  1317. package/vendor/agent-cli/dist/src/session/execution-settlement.js.map +0 -1
  1318. package/vendor/agent-cli/dist/src/session/expert-definition.d.ts +0 -4
  1319. package/vendor/agent-cli/dist/src/session/expert-definition.d.ts.map +0 -1
  1320. package/vendor/agent-cli/dist/src/session/expert-definition.js +0 -20
  1321. package/vendor/agent-cli/dist/src/session/expert-definition.js.map +0 -1
  1322. package/vendor/agent-cli/dist/src/session/link-config.d.ts +0 -13
  1323. package/vendor/agent-cli/dist/src/session/link-config.d.ts.map +0 -1
  1324. package/vendor/agent-cli/dist/src/session/link-config.js +0 -29
  1325. package/vendor/agent-cli/dist/src/session/link-config.js.map +0 -1
  1326. package/vendor/agent-cli/dist/src/session/link-outcome.d.ts +0 -30
  1327. package/vendor/agent-cli/dist/src/session/link-outcome.d.ts.map +0 -1
  1328. package/vendor/agent-cli/dist/src/session/link-outcome.js +0 -67
  1329. package/vendor/agent-cli/dist/src/session/link-outcome.js.map +0 -1
  1330. package/vendor/agent-cli/dist/src/session/link-session.d.ts +0 -77
  1331. package/vendor/agent-cli/dist/src/session/link-session.d.ts.map +0 -1
  1332. package/vendor/agent-cli/dist/src/session/link-session.js +0 -432
  1333. package/vendor/agent-cli/dist/src/session/link-session.js.map +0 -1
  1334. package/vendor/agent-cli/dist/src/session/local-execution.d.ts +0 -28
  1335. package/vendor/agent-cli/dist/src/session/local-execution.d.ts.map +0 -1
  1336. package/vendor/agent-cli/dist/src/session/local-execution.js +0 -119
  1337. package/vendor/agent-cli/dist/src/session/local-execution.js.map +0 -1
  1338. package/vendor/agent-cli/dist/src/session/member-tools.d.ts +0 -22
  1339. package/vendor/agent-cli/dist/src/session/member-tools.d.ts.map +0 -1
  1340. package/vendor/agent-cli/dist/src/session/member-tools.js +0 -72
  1341. package/vendor/agent-cli/dist/src/session/member-tools.js.map +0 -1
  1342. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.d.ts +0 -7
  1343. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.d.ts.map +0 -1
  1344. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.js +0 -30
  1345. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.js.map +0 -1
  1346. package/vendor/agent-cli/dist/src/session/process-environment.d.ts +0 -3
  1347. package/vendor/agent-cli/dist/src/session/process-environment.d.ts.map +0 -1
  1348. package/vendor/agent-cli/dist/src/session/process-environment.js +0 -33
  1349. package/vendor/agent-cli/dist/src/session/process-environment.js.map +0 -1
  1350. package/vendor/agent-cli/dist/src/session/process-lifecycle.d.ts +0 -5
  1351. package/vendor/agent-cli/dist/src/session/process-lifecycle.d.ts.map +0 -1
  1352. package/vendor/agent-cli/dist/src/session/process-lifecycle.js +0 -18
  1353. package/vendor/agent-cli/dist/src/session/process-lifecycle.js.map +0 -1
  1354. package/vendor/agent-cli/dist/src/session/process-observability.d.ts +0 -4
  1355. package/vendor/agent-cli/dist/src/session/process-observability.d.ts.map +0 -1
  1356. package/vendor/agent-cli/dist/src/session/process-observability.js +0 -14
  1357. package/vendor/agent-cli/dist/src/session/process-observability.js.map +0 -1
  1358. package/vendor/agent-cli/dist/src/session/process-request.d.ts +0 -37
  1359. package/vendor/agent-cli/dist/src/session/process-request.d.ts.map +0 -1
  1360. package/vendor/agent-cli/dist/src/session/process-request.js +0 -473
  1361. package/vendor/agent-cli/dist/src/session/process-request.js.map +0 -1
  1362. package/vendor/agent-cli/dist/src/session/process-restore.d.ts +0 -4
  1363. package/vendor/agent-cli/dist/src/session/process-restore.d.ts.map +0 -1
  1364. package/vendor/agent-cli/dist/src/session/process-restore.js +0 -21
  1365. package/vendor/agent-cli/dist/src/session/process-restore.js.map +0 -1
  1366. package/vendor/agent-cli/dist/src/session/process-summary-output.d.ts +0 -15
  1367. package/vendor/agent-cli/dist/src/session/process-summary-output.d.ts.map +0 -1
  1368. package/vendor/agent-cli/dist/src/session/process-summary-output.js +0 -46
  1369. package/vendor/agent-cli/dist/src/session/process-summary-output.js.map +0 -1
  1370. package/vendor/agent-cli/dist/src/session/process-workspace.d.ts +0 -3
  1371. package/vendor/agent-cli/dist/src/session/process-workspace.d.ts.map +0 -1
  1372. package/vendor/agent-cli/dist/src/session/process-workspace.js +0 -21
  1373. package/vendor/agent-cli/dist/src/session/process-workspace.js.map +0 -1
  1374. package/vendor/agent-cli/dist/src/session/reference-tools.d.ts +0 -8
  1375. package/vendor/agent-cli/dist/src/session/reference-tools.d.ts.map +0 -1
  1376. package/vendor/agent-cli/dist/src/session/reference-tools.js +0 -35
  1377. package/vendor/agent-cli/dist/src/session/reference-tools.js.map +0 -1
  1378. package/vendor/agent-cli/dist/src/session/run-events.d.ts +0 -81
  1379. package/vendor/agent-cli/dist/src/session/run-events.d.ts.map +0 -1
  1380. package/vendor/agent-cli/dist/src/session/run-events.js +0 -160
  1381. package/vendor/agent-cli/dist/src/session/run-events.js.map +0 -1
  1382. package/vendor/agent-cli/dist/src/session/run-setup.d.ts +0 -78
  1383. package/vendor/agent-cli/dist/src/session/run-setup.d.ts.map +0 -1
  1384. package/vendor/agent-cli/dist/src/session/run-setup.js +0 -294
  1385. package/vendor/agent-cli/dist/src/session/run-setup.js.map +0 -1
  1386. package/vendor/agent-cli/dist/src/session/run-start-body.d.ts +0 -47
  1387. package/vendor/agent-cli/dist/src/session/run-start-body.d.ts.map +0 -1
  1388. package/vendor/agent-cli/dist/src/session/run-start-body.js +0 -77
  1389. package/vendor/agent-cli/dist/src/session/run-start-body.js.map +0 -1
  1390. package/vendor/agent-cli/dist/src/session/team-persistence.d.ts +0 -17
  1391. package/vendor/agent-cli/dist/src/session/team-persistence.d.ts.map +0 -1
  1392. package/vendor/agent-cli/dist/src/session/team-persistence.js +0 -75
  1393. package/vendor/agent-cli/dist/src/session/team-persistence.js.map +0 -1
  1394. package/vendor/agent-cli/dist/src/session/tool-scheduler.d.ts +0 -37
  1395. package/vendor/agent-cli/dist/src/session/tool-scheduler.d.ts.map +0 -1
  1396. package/vendor/agent-cli/dist/src/session/tool-scheduler.js +0 -242
  1397. package/vendor/agent-cli/dist/src/session/tool-scheduler.js.map +0 -1
  1398. package/vendor/agent-cli/dist/src/session/user-choice-policy.d.ts +0 -25
  1399. package/vendor/agent-cli/dist/src/session/user-choice-policy.d.ts.map +0 -1
  1400. package/vendor/agent-cli/dist/src/session/user-choice-policy.js +0 -70
  1401. package/vendor/agent-cli/dist/src/session/user-choice-policy.js.map +0 -1
  1402. package/vendor/agent-cli/dist/src/session/user-choice.d.ts +0 -6
  1403. package/vendor/agent-cli/dist/src/session/user-choice.d.ts.map +0 -1
  1404. package/vendor/agent-cli/dist/src/session/user-choice.js +0 -101
  1405. package/vendor/agent-cli/dist/src/session/user-choice.js.map +0 -1
  1406. package/vendor/agent-cli/dist/src/session/user-skill-compatibility.d.ts +0 -4
  1407. package/vendor/agent-cli/dist/src/session/user-skill-compatibility.d.ts.map +0 -1
  1408. package/vendor/agent-cli/dist/src/session/user-skill-compatibility.js +0 -25
  1409. package/vendor/agent-cli/dist/src/session/user-skill-compatibility.js.map +0 -1
  1410. package/vendor/agent-cli/dist/src/session/user-skill-loaded.d.ts +0 -31
  1411. package/vendor/agent-cli/dist/src/session/user-skill-loaded.d.ts.map +0 -1
  1412. package/vendor/agent-cli/dist/src/session/user-skill-loaded.js +0 -105
  1413. package/vendor/agent-cli/dist/src/session/user-skill-loaded.js.map +0 -1
  1414. package/vendor/agent-cli/dist/src/session/user-skill-prompt.d.ts +0 -4
  1415. package/vendor/agent-cli/dist/src/session/user-skill-prompt.d.ts.map +0 -1
  1416. package/vendor/agent-cli/dist/src/session/user-skill-prompt.js +0 -15
  1417. package/vendor/agent-cli/dist/src/session/user-skill-prompt.js.map +0 -1
  1418. package/vendor/agent-cli/dist/src/shared/app-id.d.ts +0 -13
  1419. package/vendor/agent-cli/dist/src/shared/app-id.d.ts.map +0 -1
  1420. package/vendor/agent-cli/dist/src/shared/app-id.js +0 -25
  1421. package/vendor/agent-cli/dist/src/shared/app-id.js.map +0 -1
  1422. package/vendor/agent-cli/dist/src/shared/auth-headers.d.ts +0 -13
  1423. package/vendor/agent-cli/dist/src/shared/auth-headers.d.ts.map +0 -1
  1424. package/vendor/agent-cli/dist/src/shared/auth-headers.js +0 -16
  1425. package/vendor/agent-cli/dist/src/shared/auth-headers.js.map +0 -1
  1426. package/vendor/agent-cli/dist/src/shared/cli-version.d.ts +0 -3
  1427. package/vendor/agent-cli/dist/src/shared/cli-version.d.ts.map +0 -1
  1428. package/vendor/agent-cli/dist/src/shared/cli-version.js +0 -22
  1429. package/vendor/agent-cli/dist/src/shared/cli-version.js.map +0 -1
  1430. package/vendor/agent-cli/dist/src/shared/error-detail.d.ts +0 -14
  1431. package/vendor/agent-cli/dist/src/shared/error-detail.d.ts.map +0 -1
  1432. package/vendor/agent-cli/dist/src/shared/error-detail.js +0 -29
  1433. package/vendor/agent-cli/dist/src/shared/error-detail.js.map +0 -1
  1434. package/vendor/agent-cli/dist/src/shared/output-guard.d.ts +0 -36
  1435. package/vendor/agent-cli/dist/src/shared/output-guard.d.ts.map +0 -1
  1436. package/vendor/agent-cli/dist/src/shared/output-guard.js +0 -94
  1437. package/vendor/agent-cli/dist/src/shared/output-guard.js.map +0 -1
  1438. package/vendor/agent-cli/dist/src/shared/process-cwd.d.ts +0 -3
  1439. package/vendor/agent-cli/dist/src/shared/process-cwd.d.ts.map +0 -1
  1440. package/vendor/agent-cli/dist/src/shared/process-cwd.js +0 -11
  1441. package/vendor/agent-cli/dist/src/shared/process-cwd.js.map +0 -1
  1442. package/vendor/agent-cli/dist/src/shared/process-types.d.ts +0 -60
  1443. package/vendor/agent-cli/dist/src/shared/process-types.d.ts.map +0 -1
  1444. package/vendor/agent-cli/dist/src/shared/process-types.js +0 -10
  1445. package/vendor/agent-cli/dist/src/shared/process-types.js.map +0 -1
  1446. package/vendor/agent-cli/dist/src/shared/replace-file.d.ts +0 -3
  1447. package/vendor/agent-cli/dist/src/shared/replace-file.d.ts.map +0 -1
  1448. package/vendor/agent-cli/dist/src/shared/replace-file.js +0 -34
  1449. package/vendor/agent-cli/dist/src/shared/replace-file.js.map +0 -1
  1450. package/vendor/agent-cli/dist/src/shared/server-headers.d.ts +0 -7
  1451. package/vendor/agent-cli/dist/src/shared/server-headers.d.ts.map +0 -1
  1452. package/vendor/agent-cli/dist/src/shared/server-headers.js +0 -113
  1453. package/vendor/agent-cli/dist/src/shared/server-headers.js.map +0 -1
  1454. package/vendor/agent-cli/dist/src/shared/shell-runtime.d.ts +0 -47
  1455. package/vendor/agent-cli/dist/src/shared/shell-runtime.d.ts.map +0 -1
  1456. package/vendor/agent-cli/dist/src/shared/shell-runtime.js +0 -210
  1457. package/vendor/agent-cli/dist/src/shared/shell-runtime.js.map +0 -1
  1458. package/vendor/agent-cli/dist/src/shared/types.d.ts +0 -513
  1459. package/vendor/agent-cli/dist/src/shared/types.d.ts.map +0 -1
  1460. package/vendor/agent-cli/dist/src/shared/types.js +0 -2
  1461. package/vendor/agent-cli/dist/src/shared/types.js.map +0 -1
  1462. package/vendor/agent-cli/dist/src/shared/user-choice.d.ts +0 -41
  1463. package/vendor/agent-cli/dist/src/shared/user-choice.d.ts.map +0 -1
  1464. package/vendor/agent-cli/dist/src/shared/user-choice.js +0 -2
  1465. package/vendor/agent-cli/dist/src/shared/user-choice.js.map +0 -1
  1466. package/vendor/agent-cli/dist/src/tools/artifact-publisher.d.ts +0 -9
  1467. package/vendor/agent-cli/dist/src/tools/artifact-publisher.d.ts.map +0 -1
  1468. package/vendor/agent-cli/dist/src/tools/artifact-publisher.js +0 -85
  1469. package/vendor/agent-cli/dist/src/tools/artifact-publisher.js.map +0 -1
  1470. package/vendor/agent-cli/dist/src/tools/command-executor.d.ts +0 -33
  1471. package/vendor/agent-cli/dist/src/tools/command-executor.d.ts.map +0 -1
  1472. package/vendor/agent-cli/dist/src/tools/command-executor.js +0 -133
  1473. package/vendor/agent-cli/dist/src/tools/command-executor.js.map +0 -1
  1474. package/vendor/agent-cli/dist/src/tools/context-program-publish.d.ts +0 -16
  1475. package/vendor/agent-cli/dist/src/tools/context-program-publish.d.ts.map +0 -1
  1476. package/vendor/agent-cli/dist/src/tools/context-program-publish.js +0 -104
  1477. package/vendor/agent-cli/dist/src/tools/context-program-publish.js.map +0 -1
  1478. package/vendor/agent-cli/dist/src/tools/context-program.d.ts +0 -21
  1479. package/vendor/agent-cli/dist/src/tools/context-program.d.ts.map +0 -1
  1480. package/vendor/agent-cli/dist/src/tools/context-program.js +0 -233
  1481. package/vendor/agent-cli/dist/src/tools/context-program.js.map +0 -1
  1482. package/vendor/agent-cli/dist/src/tools/file-ops.d.ts +0 -52
  1483. package/vendor/agent-cli/dist/src/tools/file-ops.d.ts.map +0 -1
  1484. package/vendor/agent-cli/dist/src/tools/file-ops.js +0 -403
  1485. package/vendor/agent-cli/dist/src/tools/file-ops.js.map +0 -1
  1486. package/vendor/agent-cli/dist/src/tools/file-search.d.ts +0 -29
  1487. package/vendor/agent-cli/dist/src/tools/file-search.d.ts.map +0 -1
  1488. package/vendor/agent-cli/dist/src/tools/file-search.js +0 -98
  1489. package/vendor/agent-cli/dist/src/tools/file-search.js.map +0 -1
  1490. package/vendor/agent-cli/dist/src/tools/file-stat.d.ts +0 -9
  1491. package/vendor/agent-cli/dist/src/tools/file-stat.d.ts.map +0 -1
  1492. package/vendor/agent-cli/dist/src/tools/file-stat.js +0 -29
  1493. package/vendor/agent-cli/dist/src/tools/file-stat.js.map +0 -1
  1494. package/vendor/agent-cli/dist/src/tools/local-hands.d.ts +0 -58
  1495. package/vendor/agent-cli/dist/src/tools/local-hands.d.ts.map +0 -1
  1496. package/vendor/agent-cli/dist/src/tools/local-hands.js +0 -330
  1497. package/vendor/agent-cli/dist/src/tools/local-hands.js.map +0 -1
  1498. package/vendor/agent-cli/dist/src/tools/ripgrep-search.d.ts +0 -24
  1499. package/vendor/agent-cli/dist/src/tools/ripgrep-search.d.ts.map +0 -1
  1500. package/vendor/agent-cli/dist/src/tools/ripgrep-search.js +0 -160
  1501. package/vendor/agent-cli/dist/src/tools/ripgrep-search.js.map +0 -1
  1502. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.d.ts +0 -69
  1503. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.d.ts.map +0 -1
  1504. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.js +0 -68
  1505. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.js.map +0 -1
  1506. package/vendor/agent-cli/dist/src/tools/tool-timeout.d.ts +0 -29
  1507. package/vendor/agent-cli/dist/src/tools/tool-timeout.d.ts.map +0 -1
  1508. package/vendor/agent-cli/dist/src/tools/tool-timeout.js +0 -88
  1509. package/vendor/agent-cli/dist/src/tools/tool-timeout.js.map +0 -1
  1510. package/vendor/agent-cli/dist/src/tools/write-guard.d.ts +0 -42
  1511. package/vendor/agent-cli/dist/src/tools/write-guard.d.ts.map +0 -1
  1512. package/vendor/agent-cli/dist/src/tools/write-guard.js +0 -34
  1513. package/vendor/agent-cli/dist/src/tools/write-guard.js.map +0 -1
  1514. package/vendor/agent-cli/package.json +0 -29
  1515. /package/resources/js/{context/skills/export-config/scripts → project/scripts/config-export}/assert-asset-wiring.mjs +0 -0
  1516. /package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/assert-asset-wiring.mjs +0 -0
  1517. /package/resources/js3d/{context/skills/export-config/scripts → project/scripts/config-export}/sync-asset-controls.mjs +0 -0
  1518. /package/resources/{js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config → targets/codebuddy/js/js/context/skills/export-config/assets/tooling}/cli.mjs +0 -0
  1519. /package/resources/{js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config → targets/codebuddy/js/js/context/skills/export-config/assets/tooling}/config.d.mts +0 -0
  1520. /package/resources/{js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config → targets/codebuddy/js/js/context/skills/export-config/assets/tooling}/config.mjs +0 -0
  1521. /package/resources/{js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config → targets/codebuddy/js/js/context/skills/export-config/assets/tooling}/project.d.mts +0 -0
  1522. /package/resources/{js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config → targets/codebuddy/js/js/context/skills/export-config/assets/tooling}/project.mjs +0 -0
  1523. /package/resources/{js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config → targets/codebuddy/js/js/context/skills/export-config/assets/tooling}/vite.d.mts +0 -0
  1524. /package/resources/{js/context/skills/lightgame-runtime-adapt/project/scripts/skill-modules/export-config → targets/codebuddy/js/js/context/skills/export-config/assets/tooling}/vite.mjs +0 -0
  1525. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/game-runtime.json +0 -0
  1526. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +0 -0
  1527. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +0 -0
  1528. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +0 -0
  1529. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +0 -0
  1530. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +0 -0
  1531. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +0 -0
  1532. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/platform/platform.d.mts +0 -0
  1533. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/platform/platform.mjs +0 -0
  1534. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/release.json +0 -0
  1535. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/tooling/cli.mjs +0 -0
  1536. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/tooling/project.d.mts +0 -0
  1537. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/tooling/project.mjs +0 -0
  1538. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +0 -0
  1539. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/tooling/vite.mjs +0 -0
  1540. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/tools/assets.d.mts +0 -0
  1541. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/tools/assets.mjs +0 -0
  1542. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/tools/astc.d.mts +0 -0
  1543. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/runtime/lightgame/1.1.0/tools/astc.mjs +0 -0
  1544. /package/resources/{js/project/runtime/lightgame/1.0.0/platform → targets/codebuddy/js/js/project/scripts/skill-modules/export-config}/config.d.mts +0 -0
  1545. /package/resources/{js/project/runtime/lightgame/1.0.0/platform → targets/codebuddy/js/js/project/scripts/skill-modules/export-config}/config.mjs +0 -0
  1546. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/scripts/skill-modules/export-config/installed.json +0 -0
  1547. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/src/display/ui-stage.ts +0 -0
  1548. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/src/display/viewport.ts +0 -0
  1549. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/src/main.ts +0 -0
  1550. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/src/platform.ts +0 -0
  1551. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/src/screenUi.ts +0 -0
  1552. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/src/style.css +0 -0
  1553. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/tsconfig.json +0 -0
  1554. /package/resources/{js/context/skills/lightgame-runtime-adapt → targets/codebuddy/js/js}/project/vite.config.ts +0 -0
  1555. /package/resources/{js3d/project/runtime/lightgame/1.0.0/platform → targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling}/config.d.mts +0 -0
  1556. /package/resources/{js3d/project/runtime/lightgame/1.0.0/platform → targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling}/config.mjs +0 -0
  1557. /package/resources/{js/context/skills/platform-services/assets/modules → targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform}/identity/qq-ai-game-sdk.min.js +0 -0
  1558. /package/resources/{js/context/skills/platform-services/assets/modules → targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform}/identity/qq-session.mjs +0 -0
  1559. /package/resources/{js/context/skills/platform-services/assets/modules → targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform}/identity/shared.mjs +0 -0
  1560. /package/resources/{js/project/runtime/lightgame/1.0.0 → targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0}/platform/platform-capture-video.mjs +0 -0
  1561. /package/resources/{js/context/skills/platform-services/assets/modules → targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform}/platform-service.d.mts +0 -0
  1562. /package/resources/{js/context/skills/platform-services/assets/modules → targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform}/platform-service.mjs +0 -0
  1563. /package/resources/{js3d/project/runtime/lightgame/1.0.0 → targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0}/platform/platform.d.mts +0 -0
  1564. /package/resources/{js/project/runtime/lightgame/1.0.0 → targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0}/tools/assets.d.mts +0 -0
  1565. /package/resources/{js3d/project/runtime/lightgame/1.0.0 → targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0}/tools/assets.mjs +0 -0
  1566. /package/resources/{js/project/runtime/lightgame/1.0.0 → targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0}/tools/astc.d.mts +0 -0
  1567. /package/resources/{js3d/project/runtime/lightgame/1.0.0 → targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0}/tools/astc.mjs +0 -0
  1568. /package/resources/{js3d/project/runtime/lightgame/1.0.0 → targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0}/tools/glb.d.mts +0 -0
  1569. /package/resources/{js3d/project/runtime/lightgame/1.0.0 → targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0}/tools/glb.mjs +0 -0
  1570. /package/resources/{js3d/context/skills/resolution-adaptation/assets → targets/codebuddy/js3d/js3d/project/src}/display/ui-stage.ts +0 -0
  1571. /package/resources/{js3d/context/skills/resolution-adaptation/assets → targets/codebuddy/js3d/js3d/project/src}/display/viewport.ts +0 -0
  1572. /package/resources/{js3d/context/skills/platform-services/assets/modules → targets/codex/js/js/project/runtime/lightgame/1.1.0/platform}/identity/qq-ai-game-sdk.min.js +0 -0
  1573. /package/resources/{js3d/context/skills/platform-services/assets/modules → targets/codex/js/js/project/runtime/lightgame/1.1.0/platform}/identity/qq-session.mjs +0 -0
  1574. /package/resources/{js3d/context/skills/platform-services/assets/modules → targets/codex/js/js/project/runtime/lightgame/1.1.0/platform}/identity/shared.mjs +0 -0
  1575. /package/resources/{js3d/project/runtime/lightgame/1.0.0 → targets/codex/js/js/project/runtime/lightgame/1.1.0}/platform/platform-capture-video.mjs +0 -0
  1576. /package/resources/{js3d/context/skills/platform-services/assets/modules → targets/codex/js/js/project/runtime/lightgame/1.1.0/platform}/platform-service.d.mts +0 -0
  1577. /package/resources/{js3d/context/skills/platform-services/assets/modules → targets/codex/js/js/project/runtime/lightgame/1.1.0/platform}/platform-service.mjs +0 -0
  1578. /package/resources/{js/project/runtime/lightgame/1.0.0 → targets/codex/js/js/project/runtime/lightgame/1.1.0}/platform/platform.d.mts +0 -0
  1579. /package/resources/{js/project/runtime/lightgame/1.0.0 → targets/codex/js/js/project/runtime/lightgame/1.1.0}/platform/platform.mjs +0 -0
  1580. /package/resources/{js3d/project/runtime/lightgame/1.0.0 → targets/codex/js/js/project/runtime/lightgame/1.1.0}/tools/assets.d.mts +0 -0
  1581. /package/resources/{js/project/runtime/lightgame/1.0.0 → targets/codex/js/js/project/runtime/lightgame/1.1.0}/tools/assets.mjs +0 -0
  1582. /package/resources/{js3d/project/runtime/lightgame/1.0.0 → targets/codex/js/js/project/runtime/lightgame/1.1.0}/tools/astc.d.mts +0 -0
  1583. /package/resources/{js/project/runtime/lightgame/1.0.0 → targets/codex/js/js/project/runtime/lightgame/1.1.0}/tools/astc.mjs +0 -0
  1584. /package/resources/{js/context/skills/resolution-adaptation/assets → targets/codex/js/js/project/src}/display/ui-stage.ts +0 -0
  1585. /package/resources/{js/context/skills/resolution-adaptation/assets → targets/codex/js/js/project/src}/display/viewport.ts +0 -0
@@ -1,39 +0,0 @@
1
- import type { PlatformService } from './platform-service.mjs';
2
- export type SortOrder = 'asc' | 'desc';
3
- export type UpdatePolicy = 'BEST' | 'OVERWRITE' | 'ACCUMULATE';
4
- /** One logical board splits into one physical board per period; the server buckets by wall clock. */
5
- export type Period = 'all_time' | 'weekly' | 'monthly' | 'season';
6
- /** Platform category. Free-form labels belong in subType, never here. */
7
- export type BoardType = 'comprehensive' | 'periodic' | 'test';
8
- /** Season boards only. The server derives the current season from this and refuses configs that straddle a calendar month or overlap an existing season. */
9
- export interface PeriodConfig { startTime: number; periodDays: number; loopCount?: number; }
10
- export interface ConfigureOptions { type?: BoardType; subType?: string; period?: Period; periodConfig?: PeriodConfig; }
11
- /** No seasonNumber on purpose: reports always land in the current period, so a closed season can never be backfilled. */
12
- export interface ReportOptions { boardKey?: string; period?: Period; extra?: unknown; }
13
- export interface BatchReportItem { boardKey?: string; score: number; playerName?: string; period?: Period; extra?: unknown; }
14
- export interface QueryOptions { boardKey?: string; period?: Period; seasonNumber?: number; limit?: number; includeSelf?: boolean; aroundSelf?: number; }
15
- export interface UpdateDisplayOptions { boardKey?: string; period?: Period; seasonNumber?: number; }
16
- export interface ClearOptions { boardKey?: string; allBoards?: boolean; }
17
- export interface ReportResult { result: string; message: string; board_key?: string; period?: Period; season_number?: number; type?: string; is_best?: boolean; score?: number; rank?: number; total?: number; }
18
- export interface BatchResult { result: string; message: string; boards?: ReportResult[]; reported?: number; succeeded?: number; }
19
- export interface QueryItem { rank: number; player_id: string; player_name: string; score: number; extra?: unknown; }
20
- export interface QueryResult { result: string; message: string; board_key?: string; period?: Period; season_number?: number; display_name?: string; type?: string; items?: QueryItem[]; self?: QueryItem | null; total?: number; }
21
- export interface UpdateDisplayResult { result: string; message: string; board_key?: string; period?: Period; season_number?: number; player_name?: string; }
22
- export interface ClearResult { result: string; message: string; board_key?: string; all_boards?: boolean; deleted?: number; }
23
- export interface Leaderboard {
24
- /**
25
- * Stores the board's creation params and its period; later calls reuse that period unless one is passed explicitly.
26
- * A string is the legacy boardType: a BoardType value becomes `type`, any other non-empty label becomes `subType`.
27
- */
28
- configure(sortOrder: SortOrder, updatePolicy: UpdatePolicy, scoreRange: [number, number], boardKey?: string, opts?: ConfigureOptions | string): void;
29
- report(score: number, playerName?: string, onDone?: (result: ReportResult) => void, opts?: ReportOptions): Promise<ReportResult>;
30
- /** Up to 10 boards. Each entry succeeds or fails on its own and nothing is rolled back, so read every boards[i].result. */
31
- reportBatch(boards: BatchReportItem[], onDone?: (result: BatchResult) => void): Promise<BatchResult>;
32
- query(onDone?: (result: QueryResult) => void, opts?: QueryOptions): Promise<QueryResult>;
33
- /** Requires an existing score row on that board, otherwise NOT_ON_BOARD. */
34
- updateDisplay(playerName?: string, extra?: unknown, onDone?: (result: UpdateDisplayResult) => void, opts?: UpdateDisplayOptions): Promise<UpdateDisplayResult>;
35
- /** Author-only; permissions are enforced by the server. */
36
- clear(onDone?: (result: ClearResult) => void, opts?: ClearOptions): Promise<ClearResult>;
37
- }
38
- export function createLeaderboard(options?: { service?: PlatformService }): Leaderboard;
39
- export const LeaderboardManager: Leaderboard;
@@ -1 +0,0 @@
1
- var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});var SERVICE_KEY=Symbol.for("@game-runtime/platform-service/v1");var unavailable=__name(()=>({ok:false,code:"PLATFORM_UNAVAILABLE",message:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u5E73\u53F0\u670D\u52A1"}),"unavailable");var failure=__name((code="INTERNAL_ERROR",message="\u670D\u52A1\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")=>({ok:false,code,message}),"failure");var duration=__name((value,fallback)=>Number.isFinite(value)&&value>=0?Math.min(value,6e4):fallback,"duration");function parentOrigin(win,explicit){const valid=__name(value=>{try{const url=new URL(value);return/^https?:$/.test(url.protocol)?url.origin:null}catch{return null}},"valid");if(explicit&&explicit!=="*")return valid(explicit);const referrer=valid(win?.document?.referrer);if(referrer)return referrer;try{return valid(win?.parent?.location?.origin)}catch{return null}}__name(parentOrigin,"parentOrigin");function apiBase(value){try{const url=new URL(value);const local=url.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(url.hostname);if(url.protocol!=="https:"&&!local||url.username||url.password||url.search||url.hash)return null;return url.href.replace(/\/+$/,"")}catch{return null}}__name(apiBase,"apiBase");function createPlatformService(options={}){const win=options.window??(typeof window==="undefined"?void 0:window);let initialized=false,disposed=false,state="pending",identity=null,session=0,initTimer;let origin=null;const waiters=new Set,requests=new Set,listeners=new Map;const emit=__name((event,...args)=>{for(const listener of[...listeners.get(event)||[]]){try{listener(...args)}catch{}}},"emit");const settle=__name(next=>{const previous=state;state=next;clearTimeout(initTimer);for(const resolve of waiters)resolve();waiters.clear();if(previous!==next)emit("state-change",next,previous)},"settle");const invalidate=__name(()=>{session++;for(const cancel of[...requests])cancel()},"invalidate");const onMessage=__name(event=>{if(disposed||!origin||event.source!==win?.parent||event.origin!==origin)return;const{type,data}=event.data||{};if(!data||typeof data!=="object")return;if(type==="runtime-init"){const api=typeof data.api==="string"?apiBase(data.api.trim()):null;const token=typeof data.token==="string"?data.token.trim():"";const appId=typeof data.app_id==="string"?data.app_id.trim():"";const playerId=typeof data.player_id==="string"?data.player_id.trim():"";if(!api||!token||!appId||!playerId)return;if(!identity||identity.api!==api||identity.appId!==appId||identity.playerId!==playerId)invalidate();identity={api,token,appId,playerId,playerName:typeof data.player_name==="string"?data.player_name.trim():""};settle("active")}else if(type==="session-token-refresh"&&identity&&typeof data.token==="string"&&data.token.trim()){identity={...identity,token:data.token.trim()};emit("token-refreshed")}},"onMessage");const dispatch=__name(async(options2,expectedSession)=>{if(disposed||state!=="active"||session!==expectedSession)return unavailable();const currentIdentity=identity;const controller=new AbortController;let timer,cancel;const interrupted=new Promise(resolve=>{cancel=__name(()=>{controller.abort();resolve(unavailable())},"cancel");requests.add(cancel);timer=setTimeout(()=>{controller.abort();resolve(failure())},duration(options2.timeoutMs,1e4))});const operation=__name(async()=>{try{const headers=new Headers(options2.headers);headers.set("Content-Type","application/json");headers.set("Authorization",`Bearer ${currentIdentity.token}`);const response=await(win?.fetch?win.fetch.bind(win):globalThis.fetch)(`${currentIdentity.api}${options2.path}`,{method:"POST",headers,body:JSON.stringify(options2.body??{}),signal:controller.signal,redirect:"error",credentials:"omit"});if(response.status===401)return failure("AUTH_FAILED","\u767B\u5F55\u6001\u5931\u6548");if(response.status===403)return failure("FORBIDDEN","\u65E0\u6743\u64CD\u4F5C");if(response.status!==200)return failure();const envelope=await response.json();if(envelope?.code!==0||typeof envelope?.data?.result!=="string"||!envelope.data.result)return failure();const data=envelope.data;return{ok:data.result==="OK",code:data.result,message:typeof data.message==="string"?data.message:"",data}}catch{return failure()}},"operation");try{const result=await Promise.race([operation(),interrupted]);if(disposed||session!==expectedSession)return unavailable();return{...result,tokenChanged:identity.token!==currentIdentity.token}}finally{clearTimeout(timer);requests.delete(cancel)}},"dispatch");const service={get disposed(){return disposed},init(){if(initialized||disposed)return Promise.resolve();initialized=true;origin=parentOrigin(win,options.targetOrigin);if(!win?.addEventListener||win.parent===win||!origin)settle("noop");else{win.addEventListener("message",onMessage);win.addEventListener("pagehide",service.dispose);initTimer=setTimeout(()=>settle("noop"),duration(options.initTimeoutMs,5e3))}return Promise.resolve()},whenReady(){void service.init();if(state!=="pending"||disposed)return Promise.resolve();if(waiters.size>=16){const oldest=waiters.values().next().value;waiters.delete(oldest);oldest()}return new Promise(resolve=>waiters.add(resolve))},getState:__name(()=>state,"getState"),isReady:__name(()=>state==="active"&&!disposed,"isReady"),getAppId:__name(()=>identity?.appId??"","getAppId"),getPlayerId:__name(()=>identity?.playerId??"","getPlayerId"),getPlayerName:__name(()=>identity?.playerName??"","getPlayerName"),getSessionId:__name(()=>session,"getSessionId"),async request(options2){if(!options2||typeof options2.path!=="string"||!/^\/[A-Za-z0-9/_-]+$/.test(options2.path))return failure("INVALID_ARGUMENT","\u975E\u6CD5\u8BF7\u6C42\u8DEF\u5F84");if((options2.path.startsWith("/api/cloudsave/")||options2.path.startsWith("/api/leaderboard/"))&&!disposed){void service.init();if(state==="noop"&&origin){state="pending";emit("state-change","pending","noop");initTimer=setTimeout(()=>settle("noop"),duration(options.initTimeoutMs,5e3))}}const expected=options2.sessionId??(state==="pending"?null:session);await service.whenReady();if(disposed||state!=="active"||expected!==null&&expected!==session)return unavailable();const requestSession=session;let result=await dispatch(options2,requestSession);if(result.code==="AUTH_FAILED"&&result.tokenChanged)result=await dispatch(options2,requestSession);const{tokenChanged,...publicResult}=result;return publicResult},on(event,listener){if(!listeners.has(event))listeners.set(event,new Set);listeners.get(event).add(listener);return()=>service.off(event,listener)},off(event,listener){listeners.get(event)?.delete(listener)},dispose(){if(disposed)return;disposed=true;invalidate();identity=null;settle("noop");win?.removeEventListener?.("message",onMessage);win?.removeEventListener?.("pagehide",service.dispose);emit("dispose");listeners.clear();if(win?.[SERVICE_KEY]===service)delete win[SERVICE_KEY]}};return service}__name(createPlatformService,"createPlatformService");function getPlatformService(options={}){const win=options.window??(typeof window==="undefined"?void 0:window);if(!win)throw new Error("getPlatformService requires a browser window");if(!win[SERVICE_KEY]||win[SERVICE_KEY].disposed)win[SERVICE_KEY]=createPlatformService({...options,window:win});return win[SERVICE_KEY]}__name(getPlatformService,"getPlatformService");var PlatformServiceManager=Object.freeze(Object.fromEntries(["init","whenReady","getState","isReady","getAppId","getPlayerId","getPlayerName","getSessionId","request","on","off","dispose"].map(method=>[method,(...args)=>getPlatformService()[method](...args)])));var MANAGER_KEY=Symbol.for("@game-runtime/leaderboard/v1");var invalid=__name(message=>({result:"INVALID_ARGUMENT",message}),"invalid");var boardKey=__name(value=>value===void 0||value===""?"default":value,"boardKey");var validKey=__name(value=>typeof value==="string"&&/^[A-Za-z0-9._-]{1,64}$/.test(value),"validKey");var PERIODS=["all_time","weekly","monthly","season"];var validPeriod=__name(value=>PERIODS.includes(value),"validPeriod");var MAX_AROUND_SELF=25;var seasonConfig=__name(value=>{if(value===null||typeof value!=="object")return void 0;return{start_time:value.startTime??value.start_time,period_days:value.periodDays??value.period_days,loop_count:value.loopCount??value.loop_count??0}},"seasonConfig");var BOARD_TYPES=["comprehensive","periodic","test"];var configureOptions=__name(value=>typeof value==="string"?BOARD_TYPES.includes(value)?{type:value}:value?{subType:value}:{}:value!==null&&typeof value==="object"?value:{},"configureOptions");var deliver=__name(async(promise,callback)=>{const result=await promise;try{callback?.(result)}catch{}return result},"deliver");function createLeaderboard(options={}){const service=options.service??getPlatformService();const specs=new Map;const send=__name(async(action,body)=>{const res=await service.request({path:`/api/leaderboard/${action}`,body});return{...res.data,result:res.code,message:res.message}},"send");const periodOf=__name((key,opts)=>{const p=opts?.period??specs.get(key)?.period;return validPeriod(p)?p:"all_time"},"periodOf");const guard=__name((key,opts)=>{if(!validKey(key))return invalid("\u975E\u6CD5 boardKey");if(opts?.period!==void 0&&!validPeriod(opts.period))return invalid("\u975E\u6CD5 period\uFF0C\u53EA\u80FD\u662F all_time/weekly/monthly/season");return null},"guard");const ready=__name(async()=>{const sessionId=service.getState()==="pending"?null:service.getSessionId();await service.whenReady();return sessionId!==null&&sessionId!==service.getSessionId()?{result:"PLATFORM_UNAVAILABLE",message:"\u5E73\u53F0\u8EAB\u4EFD\u5DF2\u5207\u6362"}:null},"ready");const scoreBody=__name((key,score,playerName,opts)=>{const body={score,player_name:typeof playerName==="string"&&playerName.trim()?playerName.trim():service.getPlayerName(),board_key:key,...specs.get(key),period:periodOf(key,opts)};if(opts?.extra!==void 0)body.extra=opts.extra;return body},"scoreBody");return{configure(sortOrder,updatePolicy,scoreRange,key="default",opts={}){opts=configureOptions(opts);if(!["asc","desc"].includes(sortOrder)||!["BEST","OVERWRITE","ACCUMULATE"].includes(updatePolicy)||!Array.isArray(scoreRange)||scoreRange.length!==2||!scoreRange.every(Number.isFinite)||scoreRange[0]>scoreRange[1]||!validKey(key))return;const period=validPeriod(opts.period)?opts.period:"all_time";const spec={sort_order:sortOrder,update_policy:updatePolicy,score_range:[...scoreRange],period,type:opts.type!==void 0&&opts.type!==""?String(opts.type):period==="all_time"?"comprehensive":"periodic"};if(opts.subType!==void 0&&opts.subType!=="")spec.sub_type=String(opts.subType);const cfg=period==="season"?seasonConfig(opts.periodConfig):void 0;if(cfg)spec.period_config=cfg;specs.set(key,spec)},report(score,playerName,onDone,opts={}){const key=boardKey(opts.boardKey);const run=__name(async()=>{if(!Number.isFinite(score))return{result:"INVALID_SCORE",message:"score \u5FC5\u987B\u662F\u6709\u9650\u6570\u5B57"};const bad=guard(key,opts);if(bad)return bad;const stale=await ready();if(stale)return stale;return send("report",scoreBody(key,score,playerName,opts))},"run");return deliver(run(),onDone)},reportBatch(boards,onDone){const run=__name(async()=>{if(!Array.isArray(boards)||boards.length===0)return invalid("boards \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4");const stale=await ready();if(stale)return stale;const items=[];for(const item of boards){const key=boardKey(item?.boardKey);if(!Number.isFinite(item?.score))return{result:"INVALID_SCORE",message:"score \u5FC5\u987B\u662F\u6709\u9650\u6570\u5B57"};const bad=guard(key,item);if(bad)return bad;items.push(scoreBody(key,item.score,item.playerName,item))}const res=await send("report-batch",{boards:items});return Array.isArray(res.boards)?{...res,boards:res.boards.map(b=>({...b,message:b.message??(b.result==="OK"?"\u6210\u529F":"\u64CD\u4F5C\u5931\u8D25")}))}:res},"run");return deliver(run(),onDone)},query(onDone,opts={}){const key=boardKey(opts.boardKey);const run=__name(async()=>{const bad=guard(key,opts);if(bad)return bad;const body={board_key:key,period:periodOf(key,opts),limit:Number.isFinite(opts.limit)&&opts.limit>0?Math.floor(opts.limit):50,include_self:opts.includeSelf!==false};if(Number.isFinite(opts.seasonNumber)&&opts.seasonNumber>0)body.season_number=Math.floor(opts.seasonNumber);if(Number.isFinite(opts.aroundSelf)&&opts.aroundSelf>0)body.around_self=Math.min(Math.floor(opts.aroundSelf),MAX_AROUND_SELF);const res=await send("query",body);return res.result==="BOARD_NOT_FOUND"||res.result==="ARCHIVED"?{...res,board_key:key,items:[],self:null,total:0}:res},"run");return deliver(run(),onDone)},updateDisplay(playerName,extra,onDone,opts={}){const key=boardKey(opts.boardKey);const run=__name(async()=>{const bad=guard(key,opts);if(bad)return bad;const body={board_key:key,period:periodOf(key,opts)};if(Number.isFinite(opts.seasonNumber)&&opts.seasonNumber>0)body.season_number=Math.floor(opts.seasonNumber);if(typeof playerName==="string"&&playerName.trim())body.player_name=playerName.trim();if(extra!==void 0)body.extra=extra;return send("update-display-data",body)},"run");return deliver(run(),onDone)},clear(onDone,opts={}){const key=boardKey(opts.boardKey);const body=opts.allBoards===true?{all_boards:true}:{all_boards:false,board_key:key};return deliver(opts.allBoards!==true&&!validKey(key)?invalid("\u975E\u6CD5 boardKey"):send("clear",body),onDone)}}}__name(createLeaderboard,"createLeaderboard");function current(){const service=getPlatformService();if(window[MANAGER_KEY]?.service!==service)window[MANAGER_KEY]={service,manager:createLeaderboard({service})};return window[MANAGER_KEY].manager}__name(current,"current");var LeaderboardManager=Object.freeze(Object.fromEntries(["configure","report","query","clear","reportBatch","updateDisplay"].map(method=>[method,(...args)=>current()[method](...args)])));export{LeaderboardManager,createLeaderboard};
@@ -1,25 +0,0 @@
1
- export type PlatformState = 'pending' | 'active' | 'noop';
2
- export type PlatformEvent = 'state-change' | 'token-refreshed' | 'dispose';
3
- export interface PlatformServiceOptions { window?: Window; targetOrigin?: string; initTimeoutMs?: number; }
4
- export interface PlatformRequestOptions {
5
- path: string; body?: Record<string, unknown>; timeoutMs?: number; headers?: HeadersInit;
6
- /** Reject if the host identity has changed since this operation was queued. */
7
- sessionId?: number;
8
- }
9
- export interface PlatformResponse<T = Record<string, unknown>> { ok: boolean; code: string; message: string; data?: T; }
10
- export interface PlatformService {
11
- readonly disposed: boolean;
12
- /** Installs the listener immediately; does not wait for host identity. */
13
- init(): Promise<void>;
14
- /** Waits at most initTimeoutMs. Never await before sending the game's ready message. */
15
- whenReady(): Promise<void>;
16
- getState(): PlatformState; isReady(): boolean;
17
- getAppId(): string; getPlayerId(): string; getPlayerName(): string; getSessionId(): number;
18
- request<T = Record<string, unknown>>(options: PlatformRequestOptions): Promise<PlatformResponse<T>>;
19
- on(event: PlatformEvent, listener: (...args: any[]) => void): () => void;
20
- off(event: PlatformEvent, listener: (...args: any[]) => void): void;
21
- dispose(): void;
22
- }
23
- export function createPlatformService(options?: PlatformServiceOptions): PlatformService;
24
- export function getPlatformService(options?: PlatformServiceOptions): PlatformService;
25
- export const PlatformServiceManager: Omit<PlatformService, 'disposed'>;
@@ -1 +0,0 @@
1
- var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});var SERVICE_KEY=Symbol.for("@game-runtime/platform-service/v1");var unavailable=__name(()=>({ok:false,code:"PLATFORM_UNAVAILABLE",message:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u5E73\u53F0\u670D\u52A1"}),"unavailable");var failure=__name((code="INTERNAL_ERROR",message="\u670D\u52A1\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")=>({ok:false,code,message}),"failure");var duration=__name((value,fallback)=>Number.isFinite(value)&&value>=0?Math.min(value,6e4):fallback,"duration");function parentOrigin(win,explicit){const valid=__name(value=>{try{const url=new URL(value);return/^https?:$/.test(url.protocol)?url.origin:null}catch{return null}},"valid");if(explicit&&explicit!=="*")return valid(explicit);const referrer=valid(win?.document?.referrer);if(referrer)return referrer;try{return valid(win?.parent?.location?.origin)}catch{return null}}__name(parentOrigin,"parentOrigin");function apiBase(value){try{const url=new URL(value);const local=url.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(url.hostname);if(url.protocol!=="https:"&&!local||url.username||url.password||url.search||url.hash)return null;return url.href.replace(/\/+$/,"")}catch{return null}}__name(apiBase,"apiBase");function createPlatformService(options={}){const win=options.window??(typeof window==="undefined"?void 0:window);let initialized=false,disposed=false,state="pending",identity=null,session=0,initTimer;let origin=null;const waiters=new Set,requests=new Set,listeners=new Map;const emit=__name((event,...args)=>{for(const listener of[...listeners.get(event)||[]]){try{listener(...args)}catch{}}},"emit");const settle=__name(next=>{const previous=state;state=next;clearTimeout(initTimer);for(const resolve of waiters)resolve();waiters.clear();if(previous!==next)emit("state-change",next,previous)},"settle");const invalidate=__name(()=>{session++;for(const cancel of[...requests])cancel()},"invalidate");const onMessage=__name(event=>{if(disposed||!origin||event.source!==win?.parent||event.origin!==origin)return;const{type,data}=event.data||{};if(!data||typeof data!=="object")return;if(type==="runtime-init"){const api=typeof data.api==="string"?apiBase(data.api.trim()):null;const token=typeof data.token==="string"?data.token.trim():"";const appId=typeof data.app_id==="string"?data.app_id.trim():"";const playerId=typeof data.player_id==="string"?data.player_id.trim():"";if(!api||!token||!appId||!playerId)return;if(!identity||identity.api!==api||identity.appId!==appId||identity.playerId!==playerId)invalidate();identity={api,token,appId,playerId,playerName:typeof data.player_name==="string"?data.player_name.trim():""};settle("active")}else if(type==="session-token-refresh"&&identity&&typeof data.token==="string"&&data.token.trim()){identity={...identity,token:data.token.trim()};emit("token-refreshed")}},"onMessage");const dispatch=__name(async(options2,expectedSession)=>{if(disposed||state!=="active"||session!==expectedSession)return unavailable();const currentIdentity=identity;const controller=new AbortController;let timer,cancel;const interrupted=new Promise(resolve=>{cancel=__name(()=>{controller.abort();resolve(unavailable())},"cancel");requests.add(cancel);timer=setTimeout(()=>{controller.abort();resolve(failure())},duration(options2.timeoutMs,1e4))});const operation=__name(async()=>{try{const headers=new Headers(options2.headers);headers.set("Content-Type","application/json");headers.set("Authorization",`Bearer ${currentIdentity.token}`);const response=await(win?.fetch?win.fetch.bind(win):globalThis.fetch)(`${currentIdentity.api}${options2.path}`,{method:"POST",headers,body:JSON.stringify(options2.body??{}),signal:controller.signal,redirect:"error",credentials:"omit"});if(response.status===401)return failure("AUTH_FAILED","\u767B\u5F55\u6001\u5931\u6548");if(response.status===403)return failure("FORBIDDEN","\u65E0\u6743\u64CD\u4F5C");if(response.status!==200)return failure();const envelope=await response.json();if(envelope?.code!==0||typeof envelope?.data?.result!=="string"||!envelope.data.result)return failure();const data=envelope.data;return{ok:data.result==="OK",code:data.result,message:typeof data.message==="string"?data.message:"",data}}catch{return failure()}},"operation");try{const result=await Promise.race([operation(),interrupted]);if(disposed||session!==expectedSession)return unavailable();return{...result,tokenChanged:identity.token!==currentIdentity.token}}finally{clearTimeout(timer);requests.delete(cancel)}},"dispatch");const service={get disposed(){return disposed},init(){if(initialized||disposed)return Promise.resolve();initialized=true;origin=parentOrigin(win,options.targetOrigin);if(!win?.addEventListener||win.parent===win||!origin)settle("noop");else{win.addEventListener("message",onMessage);win.addEventListener("pagehide",service.dispose);initTimer=setTimeout(()=>settle("noop"),duration(options.initTimeoutMs,5e3))}return Promise.resolve()},whenReady(){void service.init();if(state!=="pending"||disposed)return Promise.resolve();if(waiters.size>=16){const oldest=waiters.values().next().value;waiters.delete(oldest);oldest()}return new Promise(resolve=>waiters.add(resolve))},getState:__name(()=>state,"getState"),isReady:__name(()=>state==="active"&&!disposed,"isReady"),getAppId:__name(()=>identity?.appId??"","getAppId"),getPlayerId:__name(()=>identity?.playerId??"","getPlayerId"),getPlayerName:__name(()=>identity?.playerName??"","getPlayerName"),getSessionId:__name(()=>session,"getSessionId"),async request(options2){if(!options2||typeof options2.path!=="string"||!/^\/[A-Za-z0-9/_-]+$/.test(options2.path))return failure("INVALID_ARGUMENT","\u975E\u6CD5\u8BF7\u6C42\u8DEF\u5F84");if((options2.path.startsWith("/api/cloudsave/")||options2.path.startsWith("/api/leaderboard/"))&&!disposed){void service.init();if(state==="noop"&&origin){state="pending";emit("state-change","pending","noop");initTimer=setTimeout(()=>settle("noop"),duration(options.initTimeoutMs,5e3))}}const expected=options2.sessionId??(state==="pending"?null:session);await service.whenReady();if(disposed||state!=="active"||expected!==null&&expected!==session)return unavailable();const requestSession=session;let result=await dispatch(options2,requestSession);if(result.code==="AUTH_FAILED"&&result.tokenChanged)result=await dispatch(options2,requestSession);const{tokenChanged,...publicResult}=result;return publicResult},on(event,listener){if(!listeners.has(event))listeners.set(event,new Set);listeners.get(event).add(listener);return()=>service.off(event,listener)},off(event,listener){listeners.get(event)?.delete(listener)},dispose(){if(disposed)return;disposed=true;invalidate();identity=null;settle("noop");win?.removeEventListener?.("message",onMessage);win?.removeEventListener?.("pagehide",service.dispose);emit("dispose");listeners.clear();if(win?.[SERVICE_KEY]===service)delete win[SERVICE_KEY]}};return service}__name(createPlatformService,"createPlatformService");function getPlatformService(options={}){const win=options.window??(typeof window==="undefined"?void 0:window);if(!win)throw new Error("getPlatformService requires a browser window");if(!win[SERVICE_KEY]||win[SERVICE_KEY].disposed)win[SERVICE_KEY]=createPlatformService({...options,window:win});return win[SERVICE_KEY]}__name(getPlatformService,"getPlatformService");var PlatformServiceManager=Object.freeze(Object.fromEntries(["init","whenReady","getState","isReady","getAppId","getPlayerId","getPlayerName","getSessionId","request","on","off","dispose"].map(method=>[method,(...args)=>getPlatformService()[method](...args)])));export{PlatformServiceManager,createPlatformService,getPlatformService};
@@ -1,30 +0,0 @@
1
- import { paintVideos, unionCaptureRect, collectPaintVideos, finishCanvasOverlays } from './platform-capture-video.mjs';
2
- var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});var DEBUG_ICONS={"close":"iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAACUBJREFUeAG9WWtsXNURnvvYXWe9fuLFcXHIOnGjxFZaVU6QElWqVYSUPqWqMVIqJPpwKrVV/5SqVCXKgyLEI+QvSMkPEAEkDAICCIRAxH8wD/tHBDYgBbzBhoisZTuJvY5374OZs+ccz969u951HEYa3+u95/HNnJlz5swArDP5vm8oxn8N9sngbYLtYY1Uc0eaDMmX74VBDKPiWLKd6Kh+gnUis5pGSkNMU0K7CrjStgRqMDZlO5OY3o8cOWIE2vAx9XzXsyolwBkVCSABEluSbckRzn19ffx/+m4NDAxQe1POYUJgBddFgLABpZY5cAU4ihzr7u6O4bNO8gb+TKVS9B7r6emJcmEkm+VAV1qRqkwImLkoU6C+CMRCwEKIzs5O8bx8+bICFmlra7MZUHtxcdFub2+3JyYmqL0AT2PAiqmRianxDTa5r/xuVSpn73ISq7+/nyYW2oaCduPJZDKBz0bkJuSWpqamFny2It9E3NjY2EpM35CoTQNyoqOjIw6F1aGxInJsKyDEdZlSEXgoaDMmTYEmTyjQEmwSuR15Yzwe7yDGd8Ub6VsikUjKti2yb0KOJQQpI0RZsst9IFsns0FnM4eGhgx0RGNsbEzYPpqCWnZtw3d1dTUd7On5RVtdZE/MsHoty9xkFlYFPIArrudNLTvu+ExueeSJ8U/ffC6dnsNPrhzHk+8wPT0NKIQ7PDxsyN99jidMw+WIL6EAjEtuXrx40UITIVsXAjzY15f61a2dg43R6J0KcDW0kMs//9LU9GOHRkcvNDQ0OJZlufPz864URAnk4Ur4x44d86UAfhhIpXF654eNNh80GSudTvNdx0aNt/735/3/blhYGITroMzy8oldL585jq+OZFc+hRBoAR5aAAngCVCBVShZAXnSFmkfNW/l83lrZmbGrq+vjx7esWPznTt7XzSz2U5YB3J9b+rZL8/vPzR6Lo2rm8fVDRPC46ugIgKTAQcuIdqhdl4yGwKPDhg5eeDAj/Z3pdYNPJFlmJv+sKX7hacHB3/sui5tFOpsKDqpy/pAwHyK7B7Y6frArl1dBxC8bRrrBp4TrcTpL9IDh8fGvsR/88gOmq+D5iv8gZmRX7QC8qAQg+ByBWMZHSbcSPBEtBJ3bU0NkX9BQWkm+R4elmJLPXr0qF4FZUr6iKYP0sY0aDpJld0P33H7f5Kx2L+Ck5rxOERSXbA8MQ7V0mp9ZnO5Uz996+1Dtm3n0B/ESkDBuYmLdiSTHdNiTaTtC+07jmPhFmfdt3NnKgy8nUzCxocfhfbDR6D1b3+HaqiaPq3R6OC927enELwyY80UzXJHNlUIrELis2fPGmh3BoYHBu7LxtWrV63f/KDjnrCJYj29AhBR4mf9qwpBbW8+fLSoTzn67aZbDsKKCQejVe3c6oPPPNxAuzMymYyQ+I/btrU0RuyBsEmWRj8CJ3NJ/19JiCB4ooXhs1COmqKxAfSFFiheAQMDQYNdkHwzIJV66ojz7h9u3VduEm9xEb69/9iqQoSBz6UnYe6pJ8sNjbYNjQe3b9uHW7eFAaDGRmEN305Nfjwz+9d+0BaN7oUK5GYyFYUoB576+NlspaGhrW7D3oWFBZibm9OYEKMQRG8+SjJYCRtsNCEbw98oHirRc7/c93bENHthFbIQIDmmnbxZ/5b96EOI4m5TbDbvouafWhU8Ud7zxruHXrwdT2e+G6kdSeyayoR8JQSC14Jh1GlYprkJqqCwlYjvvq0E/Ozjj1cFnojOBQzJTQQv8KByxe/yXi1wm0oSIgyZRSPc//WFppYIM0yIIPhaiPwgK4VFTFq5GJ3qjUfcB6RX+Bjvq74+rKxKTWSwv5zItAw8wKrVPiOhXTxQIQSbb1bEAYXLCFRJYQ6rqA7PDPIREqJa8vzC3HiY8nxSkXaCmQBf2pnamTy6ScEawdNuw82JHLoWISi4EyBNU9/M5NNXZh/cRoE3Is46zsRqE1XaKoM+UYsQS3gFJQzoxAqPJh0LqVAaPRswfPDR6z28wNBHktqbWV4egTWCJ3sPc2wSogPjoTBT4zRzbWkEDzKlfc5i4xEhNRcKWPjc2toawVtY5NcdNyUf/MnuD8J2o1oOqbBzwkHhvvnnP6Ac3ffh6PbTk5PkvTlqjrukgxuNUKwSJOjEWsrZ2VkPAznvzNeZ+Su53PNhE/BgrhJ4orCVoL6RzZvDhoYrdOm/dGleghWM4EtMyQyA50J4GIN4aGvuq1NfnwybhAdz1YQHQSHomb9wIbTtK1OTj6HzuoSB8GAGzw9gFBSWvFWRH0/URj/5093/b8hmQzMQpEkyh1qoUp9LS0sn+t959xGMBMh0RAiB5uMy89FCFJmQClNxNxIrgM6sbkHOQ++9f9yLx6fDJqwVfKU+tHXuPvPacQSvc0R4pfS3bNniwcr2qVegSAB5rfRpN6KOmI2gTiKAOv3557PPfDz+e8fzp+EGkUqvwErQJjR+/vx5lRvyg5mJkvsANaDG1BHtzsMsssqSOZhFS7/X1PznGyEEgX+/seUvlBtSAlBGgkxHCqL2fl9toRq0InlZ5rkYfaWTF3yRKn94z57U/s5b1i1DwRNbIG0eVi7xSoASB1YANcnl0Wk8KPiDGADBu3Lw/L0jI5Nbh164LbO0fAKuk2avXTv1wLlP7kDwkwy8FgAP2KIELwSUXm1yV+xMLMVoYoAVoQv//Zjc/d3mW+8pd28OIwoQ6Wx5/avpU/8bG0sT4ObmZkruOjgH+Z5Qmkopym5+OZBFpDJeAXMKZut4wkvwgVSq5a+9O/a1xer2brDMHroI8fS6g0FhTqbXT0589gaesHRIuXjbcikzTQenzMIJjaPmXcpKVwJfkVS0Byv3T12dkXUwXeCQFRlV4KBYYaNkUdzAxJgobtA3XuBg1Roai4omVPkRGTmuuEDteVXgJY4NpalGVWbilRpVYmpmJSbO9FuzbNMg+8Rxl1MlJl6ZMRlwqJkC9TFOwXxphFUlN0hh6rGQVy9Bck6wb6p6qauVHDis4SZYSQj+v1FOEGJZPlUrI1jW03SJlb5T3Viao9Y6G79E61WZTjVCBH7TZiW1J4rXsoBtQ6DoTYCDoANa135Xtb2vURA+mdaaqiqyyXlCNlg2NYJjKQ6Z78ZT2AETQt8vqFqpguOHtYX1ou8Aln34zITMnNQAAAAASUVORK5CYII=","copy":"iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAjRJREFUeAG9Vi1UAkEQnvPZMGOWDFmyZLV6ZsySIUOGDBms0iFjhoxZzGT8PpiRc98etwc85715e7c/8818OzN3Iv8sUdaGzWZTwHAN5biOomgpJ0h0AOgWwyO07CytoTPoCOArOQcgwIoYBpItBB1JDrlMmb9KPPehUxheK71VaAylUzGdw1pPAuUiZf4LanQ9q3EhKHQCreN1qOs1gD5IXkAcqkDpcYWGMdVUUEbVVJp/BXveMIz1Ndbow4TGoOOExon5gc71XVCCQEe6Xg7BsghjZ54ex5qFFilLoy1/oyQTViZVyQFom7vQiQfU5q491C10LEqAXCpNZuQTAFPM8bmmoBXZ1+JMo/JJ0B26Wbo1pmk+1zkDI3W+9C8mz2YCOt0iSUtHdlRy/R3aSomupONCAsQKn9GQuqodVOMhBW1U3oP+WVa7M0o/dKy5qR8gTDQ6xyzu4fydBAAadVbkwUWMiMjIa+J8w+rYu98etHA7+srWxsY8TW5WRwo+2pQZtjwrMV5Tz90bOYdIx4vs74XA3zqSshtdo7GOL4lg40l2/dfOt5KgUYqnpKQmh2UpKZmr31I6TltcJ1tjL6ADXNFD1JXs76keAMozHdmX2vbbmfmLkeIMqW8EgJpzxlbzKMA8oLqXHwAm0/xCjhTN4K6+stu0D5STZXvpaMCcoBZ54STAHKDWfeZH36Erzp1uG4fsqoAJY1+c7tkAPaCuDPkfdFZABbXGwa7E301rk9uv0A+syCIowF8I0wAAAABJRU5ErkJggg==","repairButtonNormal":"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAASpJREFUeAHtmNkOgjAQRW8h7pD4/1+poriLc2lL3CAmVZiHnmTSJX04KW1JrkEHVVUZaTKpsVTq6hdUUmepA8sYc21baPBZjCJLJ9YHe6nik+iboMgtpMnRIv9HbrCS5ePkk4TIUSzDsGxFsvCDxHfczg0tRzJxmftBLejOXA495M6p2cEhzlwX9FrWHWc6gz7GfOZoOoVeFtoFJxQcQS8pBTVdjlfSBMqJgqFEwVCiYChRMJQoGEoUDCUKhhIFQ6HgFXq5aRc8U/AIvRwoWEIvx0SSJMZeJ+ijZF7ob/EKNvXUAl227NSCLtksoIeNT1ubd1AmdtAh+ZSyaoqA+Vk3nRFws9JGckxb5+gHPnXrr0L0R5wo068JbOL/q129wP4g+HrsRKz1gt4BbGxXSBA1jQUAAAAASUVORK5CYII=","repairButtonPressed":"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAASVJREFUeAHtmNGOgjAQRW9h0cXd//9SRRG1zq0DQUViUrTz0JPcQBoeTiZtSa7DDN57J49fSSUpNEvgJSdJJzk65y6vPnSYFqPIv+QH36GV7KdEnwRFjhOr8UL+g3CqlDyMF+8kRI5iNdLSjCWHPTWaXGo26hIIgrrnLMj11Oo0TDDFnpuDLn98KdR0DXtUvOYot4Jd1tYFKwqWsEtJQUuH45FiqX/rx8iCsWTBWLJgLFkwliwYSxaMJQvGkgVjoeAFdvHWBU8U7GCXjoIH2OVYSJPUl4nWaNkX9qd4i1s/Z4XQFfIlCGqz2cAOTd+2DvegLIQaFulp1CUwVQGz6dogTQV8JwfMl+jsDL9Vy/Gq271Voo9R0ZWmxHJTpchZxVq9SSa5Ai7HV0pECgrmAAAAAElFTkSuQmCC","repairButtonHover":"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAUNJREFUeAHtmDFPg0Acxd+ROrSDDgx20KEdcPT7f4uuMthBBxwcdChDTfA9uFOqlOUa+A/3S14OmpL8cvCH5DmM0DTNFZcNkzNLZoXL8MV8MG9M5Zw7nPujw7CYRB692BS8MuWQ6D9Bym25FMwC03JEJ7nv/3giSDmJFZgXSZbhJAsHvZ2bm4Ium3DSCvpnzoJcoPBOPzs4xzM3ht4eGlJk3vQO9sjpttAOrmGXrQRvYZdcgjewy1KClobjL6sMxkmCsSTBWJJgLEkwliQYSxKMJQnGkgRjkeABdjlKsIZdPiX4DrtUEtzDLlXGJkm1l8VdfKFbHaZ4h671tELbFeqgFZQplyfYofROv+9B32yWmJ+TlnWoAlZ5+ACLFXCAkmr01RneYxo0pLtwW/u4sau86NrnGl2xeAn09aq92DPFzg7oN2XhV0pkK6f9AAAAAElFTkSuQmCC","error":"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAA9hJREFUeAGtV01SGlEQ7n7DkC03CC6T+AMnEE8QPYFkkSoEqtQTADcgVTJalYV6As0JxBNAqdFlyAnimmGm0z0ww5vhDT/Kt3FG3uuv3zf9+gdhSfROTnLWcLjPj7uIWACCPD/nJj+/AsIAifpA2HU/2L+K7fbrMnZx0YKXyknetdxjJChrhEsYpivL91ufLi4G89elQE6cGY6aAHQM74AP2NpxzpqwigNyak+5dwSBzEmwtNTlv/3xcwBRpkCABTTsYTUGrMaeSY0ZB56+Vwtg480MOUGXwG9un5/fwxw8Hx3tjpQqTz5ZzAlw4WDzp9OHNAdMJyfZSFReRJxEr1otWIA3uiImJZS+aUZ2PrWXzRZXJRcUHafvZe0iG7mdmkM+oLqT+Jo6NcFjtd7kJY2pCbrdcpwDWAMea7U7Zi9FpAjtzU7nVJ4DBUR6nVxkH2Wz32BNGNn2ASs7iOwTnLxUKvnIAc9yG/oG5Xn7yyaSZSC20MfYgVzLCq43ju+7+y/yjhPItuPMnF5uB9nQ4Cw4COVL4qFSLaOFhz7hvenuJz7F6yhrb6hJep2C6MpknLJ4yf7ui3xP1dqlkVzxGiZQ/Dmfa7WPM0Y8bGlvOdt1vyqFuBuR8LdPi3hFejRDWXciItfsfO50/iZtbF2cdWGavMAnKmXYWCH8ByePPqTgi+O0Hmq1DV5zqDkBvk/3SXKP7zqkQrIoBqojZ041qWoTD9IdEGx3OmVCuJ6SQdlEXpxfgHSOvNwCvcItjPykEyuSJzlyCt4CLyhGMSjA7hLkMLsv4dGiDcmAC5EMzDmIKa6kk9GsFGAF8qBQQfrtSIHOMVCxyEcspe16OKrvmwJO6kUyMOc5IZGv2egrH0i/97lepV4yblTxWqEHnOl2mBLRY71e0qut4v5RcbkVCaM4yFjUMDng+2OCtGifONEO15gSETeth/q7NK9KCgVvvIKp+yWTCjvnnbaFkJf+IC3a2YnTcE3ytyduUEjrkqTmBEVKXnpcjjPK/RN5yidwhWhNFVEKnj10e7r8I9/bkIMEeaB40R6E8o29w3zGdW9gTcgMh5fxHpOaoYqoe2mxl/Gulm6lMXmrEkGpl4No3VBQ8BxnI3yPMqGQeL69p3cuUjTs4bAXdMorQiJeZE+SJwuVsS337Xg3O15IV65S18WzoKTOJeaeoqETh+RqUVseQoLS4g45bcigcUWbGUz41xIY0vm8QjV3NvxdrTZ4tGrCOyDB7dl2Ky2OFg6ngRrctCYnnQUIcovneT+Kbx1OZxwJx3Nu4XBctPKgj+ccvEFuRx7P7eXH8/9PPzdXAAKiMAAAAABJRU5ErkJggg==","log":"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAA/FJREFUeAGtV81OG1cUPucOtmda8QDwAFiVWqXBVVdVywIVpBrEpiUhXZsX8D6wDw+A1y0IKlWIoFapsiBVtk7kJFJkHsDsQ8DXf/fknAnz6xlsD3wbz3juvd85555fhDFRfLk6/eUHe8HkYB4GUASFM0Q0Ld8Q8QIMnRsLmvxc13b7RfOH44txzsVRC+7/92DWQP8hglX2CMcBKXjaK+Rr73/84xyyCCAa2x/tCq94CLcC1hpLB7XUr0l/uloT7bIeM0MbCC9IUR2IzpRB18xGsWUQ5/gaivw7M8yCra6d20yyxpAA956vz/Ed7wyTU90A1N4u/VWHG/DNs19LlsEVvoJyXAhQUG0sHpylCpCiecsAbY8iHlZkbQ76uZ2IRRIsocKbhsmprtv60aTkgsbi0ZnWnQ0mPQ2Oo9m87u0Wj1Z9Z/YtcO/ZeoVXVILFeNpYPqjCHYDPFsVKwdmw31g+3JFH1wJi+gg5m13r9jbcEXS7XWXtAwfkyPrq/99nfAGITCWyw8Jqc228RDIO5CyDsBX+L3+lN1wB5D4IAo/l56dxT50U8//8tuJp6OGzH2HgS8oqC7cqOPZCeCEBncAt8O2/D7YGFjwWZ4sLYcAECYmzqu3kf1J8B6XQmlYWjw+TkzLla4LZXKcbuVo5260bngxKlRSrPOevQMhs+gg5fM6Y2MX9+Dq2sK+g4qKmpKoFXymTAEnkNIDNxi8JvhTiIOaeClc4CpkniWBg4da7xYOTzOQMxRyGfGGmFYyAJCiPwBrQ1tfP18tZyZMwJU7hNxYJ9Z6QLpCC92shYKqH32UhNy7HdQJmbiWdjP9VSmoMb34+3OdiFKnnIkRmzUMcyNwq6vlYStrD4VOLC5GJXEBY9B45OzYVh0IQ92weqecTCNHqQG9jXPJ59+yg2iKYurrs6tNwcuC4rKQdEBOi1aX+5vvlv89hTBjAlfC7bndfKCkUZMLpl0ppVvCEQGOqk5J/z51WvOYIt+uO949WZ41jH/uruXPRV+1Hd1UR3Qb30tkLm58VWBEF3Dzweu24JU2Cv4PzuO04T+COYF85j8Pkco2e9fyOSEqjbRf2oj0cnOorvZ3VEqK5c+k8oXA3xL7TWDpc9V78TCgkSnc2I50LwYL9hfOn2ylPCPF4MXucXHwnvC65Le+bnXh/L5POFDvrqxHlWogNR1KM2CWHPlbjIZs8mIhT2oXdtCGDxTlzB5Pr8HXTK2c45ESWMr6lhuyNsyGHY4VTZQVugQGZ/Z7u1tL8aPRwytaggl0ZmnRugJueYXDSBbM3KleMFMCDREkhn1tQaJV4Fzslj+foVVG5ChnPTRN66lWHs+u4kfMJaa9SIoiCo5UAAAAASUVORK5CYII=","warning":"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAAtRJREFUeAG9V91x2kAQ/lZ+wI+UgDugBOEGkrwlMBmgAuMKgAqwK4BMDH60KwhyBSEVRB2YtxjPSJs96ThO/IgTP/5mNNKdTnvf7u1+dwKOAA/9srpwBAgHgB99Xz7tMsPXXTOK+Ja+BwEKojCBaOJ3CDTYboxbVA9+oAAKERDPK8z01+qa63u6DIw5vfMVtYO5o0l4KASva9EJaCGTySWNWdJFKMeX3gAF4ByBde+TydtBmLwbyruS9S7imms+uEeA6clMAL5bTp605Vn1maEX6DpadSPAY7/FQFU3QyxwvzFogT5MTpDPP1WlnIoAkfGIOOu96ZfEI6JVFDxyyoW9BJT3cqvoZkiN4H7n4LdYvUujQKhGD34He5CbhDrxpksCdp2rd9IzVLWHN3xZll6yXKT64VSWuRGIY68F2/usyDSVEgpBHyV8Mh41gpHcAu1eGZe4yZtjJwHlIRGv1t7DZzhCyrBv7MTUydsvciKwEh1mHtHX6R+4Ekg1IEgbEoWS1y1EIF17bplB7+ijIKRabo09cEdyo+pMIE0u/bHyfkvZ7SXQCGYZcSIMnAgkWbzaZsNDvDdwEKdNAlnROch78/26OG2R6AyBLaKz23uC25Zri5OKwsRvbiWQJJ7tPbiXa/gflCYEMvJZQv2ya5iKAsdWWTLd2WVplDAaX/esug+9+vQKJ0Q8qf2G3tBknh59S6ObENjY6wGf6tOXPIOpFKMbSxA9xH0xGOaOlwTki0TWMxKtl2BNdPZMno6jJ7lakqiqaob7xu8SJ+8I0alY5p2O5hmJVuIkc3sb3juWnZ1YEoVnl29UFFRpr4zghiQ5XqFPtfY5z4mEzuYip+DkZ6ZEr7oZKgK8bJw683fBmhMeqTNeiko09ns4I5T3qtytrhnx47X8Yu0RnTMhOWGph+ihNpIDRxMfCGIaUeNX2yihPsspEhWcFSz/EBgV/Yc8G/4DVxF6DgaK+k4AAAAASUVORK5CYII="};var iconUrl=__name(key=>DEBUG_ICONS[key]?`data:image/png;base64,${DEBUG_ICONS[key]}`:"","iconUrl");function copyWithTextarea(doc,text){const textarea=doc.createElement("textarea");textarea.value=text;textarea.setAttribute("readonly","true");textarea.style.cssText="position:fixed;left:-9999px;top:0";doc.body.appendChild(textarea);textarea.focus();textarea.select();let ok=false;try{ok=doc.execCommand("copy")}catch{ok=false}textarea.remove();return ok}__name(copyWithTextarea,"copyWithTextarea");function mountDebugConsole({doc,win,listen,ignoreAttribute,history,bridge}){const panel=doc.createElement("div");panel.setAttribute(ignoreAttribute,"");panel.style.cssText="position:fixed;left:8px;bottom:20px;z-index:2147483647;visibility:hidden";const root=panel.attachShadow({mode:"open"});root.innerHTML=`<style>
3
- .debug-console{position:relative;box-sizing:border-box;display:inline-flex;align-items:center;min-width:205px;min-height:36px;padding:5px 8px;border-radius:12px;background:rgba(31,15,20,.92);border:1px solid rgba(128,46,56,.85);color:rgb(242,242,242);font-family:-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',sans-serif;font-size:17px;line-height:1;user-select:none;-webkit-user-select:none;cursor:grab}
4
- .debug-console__row{display:inline-flex;align-items:center;gap:9px}
5
- .debug-console__counter{display:inline-flex;align-items:center;gap:2px}
6
- .debug-console__count-icon{display:block;width:16px;height:16px;object-fit:contain}
7
- .debug-console__count-label{min-width:14px;color:rgb(242,242,242);font-size:17px;font-variant-numeric:tabular-nums}
8
- .debug-console__icon-button{display:inline-flex;align-items:center;justify-content:center;margin:0;padding:0;border:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
9
- .debug-console__repair-button{position:relative;box-sizing:border-box;width:64px;height:28px;gap:2px;padding:0;overflow:hidden;color:rgb(242,242,242);font:inherit;font-size:16px;line-height:1;white-space:nowrap;flex-wrap:nowrap;background:transparent}
10
- .debug-console__repair-button::before{content:'';position:absolute;inset:0;box-sizing:border-box;border:12px solid transparent;border-image-source:url("${iconUrl("repairButtonNormal")}");border-image-slice:12 fill;border-image-width:12px;border-image-repeat:stretch;pointer-events:none}
11
- .debug-console__repair-button:hover::before{border-image-source:url("${iconUrl("repairButtonHover")}")}
12
- .debug-console__repair-button:active::before{border-image-source:url("${iconUrl("repairButtonPressed")}")}
13
- .debug-console__repair-button img{position:relative;z-index:1;display:block;width:20px;height:20px;flex:0 0 auto}
14
- .debug-console__repair-button span{position:relative;z-index:1;display:block;color:rgb(242,242,242);font-size:16px;line-height:1;white-space:nowrap;flex:0 0 auto}
15
- .debug-console__close-button{position:absolute;top:-16px;right:-18px;width:24px;height:24px;background:transparent}
16
- .debug-console__close-button img{display:block;width:24px;height:24px}
17
- .debug-console__repair-button.is-copy-ok{filter:drop-shadow(0 0 4px rgba(77,219,117,.9))}
18
- .debug-console__repair-button.is-copy-fail{filter:drop-shadow(0 0 4px rgba(255,89,102,.9))}
19
- .debug-console__repair-button:disabled{opacity:.45;cursor:default}
20
- </style>
21
- <div class="debug-console" title="\u6309\u4F4F\u5E76\u79FB\u52A8\u53EF\u62D6\u52A8\u8C03\u8BD5\u9762\u677F" style="touch-action:none">
22
- <div class="debug-console__row">
23
- <span class="debug-console__counter" title="\u65E5\u5FD7" data-count="log"><img class="debug-console__count-icon" alt="\u65E5\u5FD7" width="16" height="16" src="${iconUrl("log")}"><span class="debug-console__count-label">0</span></span>
24
- <span class="debug-console__counter" title="\u8B66\u544A" data-count="warn"><img class="debug-console__count-icon" alt="\u8B66\u544A" width="16" height="16" src="${iconUrl("warning")}"><span class="debug-console__count-label">0</span></span>
25
- <span class="debug-console__counter" title="\u9519\u8BEF" data-count="error"><img class="debug-console__count-icon" alt="\u9519\u8BEF" width="16" height="16" src="${iconUrl("error")}"><span class="debug-console__count-label">0</span></span>
26
- <button class="debug-console__icon-button debug-console__repair-button" type="button" title="\u4FEE\u590D\uFF1A\u63D2\u5165\u8C03\u8BD5\u65E5\u5FD7\u5230\u5BF9\u8BDD" aria-label="\u4FEE\u590D\uFF1A\u63D2\u5165\u8C03\u8BD5\u65E5\u5FD7\u5230\u5BF9\u8BDD"><img alt="" width="20" height="20" src="${iconUrl("copy")}"><span>\u4FEE\u590D</span></button>
27
- </div>
28
- <button class="debug-console__icon-button debug-console__close-button" type="button" title="\u6E05\u7A7A\u65E5\u5FD7" aria-label="\u6E05\u7A7A\u65E5\u5FD7"><img alt="" width="24" height="24" src="${iconUrl("close")}"></button>
29
- </div>`;const bar=root.querySelector(".debug-console");const logCount=root.querySelector('[data-count="log"] .debug-console__count-label');const warnCount=root.querySelector('[data-count="warn"] .debug-console__count-label');const errorCount=root.querySelector('[data-count="error"] .debug-console__count-label');const send=root.querySelector(".debug-console__repair-button");const close=root.querySelector(".debug-console__close-button");let dragPointerId=null;let dragging=false;let suppressClickUntil=0;let dragStartX=0;let dragStartY=0;let dragOffsetX=0;let dragOffsetY=0;const flashCopy=__name((ok,title)=>{const oldTitle=send.title;send.title=title;send.classList.remove("is-copy-ok","is-copy-fail");void send.offsetWidth;send.classList.add(ok?"is-copy-ok":"is-copy-fail");win.setTimeout(()=>{send.classList.remove("is-copy-ok","is-copy-fail");send.title=oldTitle},260)},"flashCopy");const copyLogs=__name(async()=>{if(history.length===0){flashCopy(false,"\u6CA1\u6709\u53EF\u590D\u5236\u7684\u65E5\u5FD7");return}const text=bridge.exportLogs();let ok=bridge.sendLogsToParent();try{if(win.navigator?.clipboard?.writeText&&win.isSecureContext){await win.navigator.clipboard.writeText(text);ok=true}else ok=copyWithTextarea(doc,text)||ok}catch{ok=copyWithTextarea(doc,text)||ok}flashCopy(ok,ok?"\u5DF2\u590D\u5236/\u5DF2\u53D1\u9001\u65E5\u5FD7":"\u590D\u5236\u5931\u8D25")},"copyLogs");const updatePanel=__name(()=>{const warn=history.filter(entry=>entry.level==="warn").length;const error=history.filter(entry=>entry.level==="error").length;const log=history.length-warn-error;logCount.textContent=String(log);warnCount.textContent=String(warn);errorCount.textContent=String(error);send.disabled=history.length===0;panel.style.visibility="visible"},"updatePanel");send.addEventListener("click",()=>{if(Date.now()>=suppressClickUntil)void copyLogs()});close.addEventListener("click",event=>{event.stopPropagation();bridge.clearLogs()});bar.addEventListener("pointerdown",event=>{if(event.button!==0||dragPointerId!==null)return;if(event.target?.closest?.(".debug-console__close-button"))return;dragPointerId=event.pointerId;dragStartX=event.clientX;dragStartY=event.clientY;const rect=panel.getBoundingClientRect();dragOffsetX=event.clientX-rect.left;dragOffsetY=event.clientY-rect.top});listen(win,"pointermove",event=>{if(event.pointerId!==dragPointerId)return;const dx=event.clientX-dragStartX;const dy=event.clientY-dragStartY;if(!dragging){if(Math.hypot(dx,dy)<=2)return;dragging=true;suppressClickUntil=Date.now()+350;bar.setPointerCapture?.(event.pointerId)}event.preventDefault();const rect=panel.getBoundingClientRect();const maxLeft=Math.max(0,win.innerWidth-rect.width);const maxTop=Math.max(0,win.innerHeight-rect.height);panel.style.left=`${Math.min(Math.max(0,event.clientX-dragOffsetX),maxLeft)}px`;panel.style.top=`${Math.min(Math.max(0,event.clientY-dragOffsetY),maxTop)}px`;panel.style.right="auto";panel.style.bottom="auto"});const endDrag=__name(event=>{if(event.pointerId!==dragPointerId)return;if(dragging){suppressClickUntil=Date.now()+350;bar.releasePointerCapture?.(event.pointerId)}dragPointerId=null;dragging=false},"endDrag");listen(win,"pointerup",endDrag);listen(win,"pointercancel",endDrag);doc.body.append(panel);updatePanel();return{panel,updatePanel}}__name(mountDebugConsole,"mountDebugConsole");var SERVICE_KEY=Symbol.for("@game-runtime/platform-service/v1");var unavailable=__name(()=>({ok:false,code:"PLATFORM_UNAVAILABLE",message:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u5E73\u53F0\u670D\u52A1"}),"unavailable");var failure=__name((code="INTERNAL_ERROR",message="\u670D\u52A1\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")=>({ok:false,code,message}),"failure");var duration=__name((value,fallback)=>Number.isFinite(value)&&value>=0?Math.min(value,6e4):fallback,"duration");function parentOrigin(win,explicit){const valid=__name(value=>{try{const url=new URL(value);return/^https?:$/.test(url.protocol)?url.origin:null}catch{return null}},"valid");if(explicit&&explicit!=="*")return valid(explicit);const referrer=valid(win?.document?.referrer);if(referrer)return referrer;try{return valid(win?.parent?.location?.origin)}catch{return null}}__name(parentOrigin,"parentOrigin");function apiBase(value){try{const url=new URL(value);const local=url.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(url.hostname);if(url.protocol!=="https:"&&!local||url.username||url.password||url.search||url.hash)return null;return url.href.replace(/\/+$/,"")}catch{return null}}__name(apiBase,"apiBase");function createPlatformService(options={}){const win=options.window??(typeof window==="undefined"?void 0:window);let initialized=false,disposed=false,state="pending",identity=null,session=0,initTimer;let origin=null;const waiters=new Set,requests=new Set,listeners=new Map;const emit=__name((event,...args)=>{for(const listener of[...listeners.get(event)||[]]){try{listener(...args)}catch{}}},"emit");const settle=__name(next=>{const previous=state;state=next;clearTimeout(initTimer);for(const resolve of waiters)resolve();waiters.clear();if(previous!==next)emit("state-change",next,previous)},"settle");const invalidate=__name(()=>{session++;for(const cancel of[...requests])cancel()},"invalidate");const onMessage=__name(event=>{if(disposed||!origin||event.source!==win?.parent||event.origin!==origin)return;const{type,data}=event.data||{};if(!data||typeof data!=="object")return;if(type==="runtime-init"){const api=typeof data.api==="string"?apiBase(data.api.trim()):null;const token=typeof data.token==="string"?data.token.trim():"";const appId=typeof data.app_id==="string"?data.app_id.trim():"";const playerId=typeof data.player_id==="string"?data.player_id.trim():"";if(!api||!token||!appId||!playerId)return;if(!identity||identity.api!==api||identity.appId!==appId||identity.playerId!==playerId)invalidate();identity={api,token,appId,playerId,playerName:typeof data.player_name==="string"?data.player_name.trim():""};settle("active")}else if(type==="session-token-refresh"&&identity&&typeof data.token==="string"&&data.token.trim()){identity={...identity,token:data.token.trim()};emit("token-refreshed")}},"onMessage");const dispatch=__name(async(options2,expectedSession)=>{if(disposed||state!=="active"||session!==expectedSession)return unavailable();const currentIdentity=identity;const controller=new AbortController;let timer,cancel;const interrupted=new Promise(resolve=>{cancel=__name(()=>{controller.abort();resolve(unavailable())},"cancel");requests.add(cancel);timer=setTimeout(()=>{controller.abort();resolve(failure())},duration(options2.timeoutMs,1e4))});const operation=__name(async()=>{try{const headers=new Headers(options2.headers);headers.set("Content-Type","application/json");headers.set("Authorization",`Bearer ${currentIdentity.token}`);const response=await(win?.fetch?win.fetch.bind(win):globalThis.fetch)(`${currentIdentity.api}${options2.path}`,{method:"POST",headers,body:JSON.stringify(options2.body??{}),signal:controller.signal,redirect:"error",credentials:"omit"});if(response.status===401)return failure("AUTH_FAILED","\u767B\u5F55\u6001\u5931\u6548");if(response.status===403)return failure("FORBIDDEN","\u65E0\u6743\u64CD\u4F5C");if(response.status!==200)return failure();const envelope=await response.json();if(envelope?.code!==0||typeof envelope?.data?.result!=="string"||!envelope.data.result)return failure();const data=envelope.data;return{ok:data.result==="OK",code:data.result,message:typeof data.message==="string"?data.message:"",data}}catch{return failure()}},"operation");try{const result=await Promise.race([operation(),interrupted]);if(disposed||session!==expectedSession)return unavailable();return{...result,tokenChanged:identity.token!==currentIdentity.token}}finally{clearTimeout(timer);requests.delete(cancel)}},"dispatch");const service={get disposed(){return disposed},init(){if(initialized||disposed)return Promise.resolve();initialized=true;origin=parentOrigin(win,options.targetOrigin);if(!win?.addEventListener||win.parent===win||!origin)settle("noop");else{win.addEventListener("message",onMessage);win.addEventListener("pagehide",service.dispose);initTimer=setTimeout(()=>settle("noop"),duration(options.initTimeoutMs,5e3))}return Promise.resolve()},whenReady(){void service.init();if(state!=="pending"||disposed)return Promise.resolve();if(waiters.size>=16){const oldest=waiters.values().next().value;waiters.delete(oldest);oldest()}return new Promise(resolve=>waiters.add(resolve))},getState:__name(()=>state,"getState"),isReady:__name(()=>state==="active"&&!disposed,"isReady"),getAppId:__name(()=>identity?.appId??"","getAppId"),getPlayerId:__name(()=>identity?.playerId??"","getPlayerId"),getPlayerName:__name(()=>identity?.playerName??"","getPlayerName"),getSessionId:__name(()=>session,"getSessionId"),async request(options2){if(!options2||typeof options2.path!=="string"||!/^\/[A-Za-z0-9/_-]+$/.test(options2.path))return failure("INVALID_ARGUMENT","\u975E\u6CD5\u8BF7\u6C42\u8DEF\u5F84");if((options2.path.startsWith("/api/cloudsave/")||options2.path.startsWith("/api/leaderboard/"))&&!disposed){void service.init();if(state==="noop"&&origin){state="pending";emit("state-change","pending","noop");initTimer=setTimeout(()=>settle("noop"),duration(options.initTimeoutMs,5e3))}}const expected=options2.sessionId??(state==="pending"?null:session);await service.whenReady();if(disposed||state!=="active"||expected!==null&&expected!==session)return unavailable();const requestSession=session;let result=await dispatch(options2,requestSession);if(result.code==="AUTH_FAILED"&&result.tokenChanged)result=await dispatch(options2,requestSession);const{tokenChanged,...publicResult}=result;return publicResult},on(event,listener){if(!listeners.has(event))listeners.set(event,new Set);listeners.get(event).add(listener);return()=>service.off(event,listener)},off(event,listener){listeners.get(event)?.delete(listener)},dispose(){if(disposed)return;disposed=true;invalidate();identity=null;settle("noop");win?.removeEventListener?.("message",onMessage);win?.removeEventListener?.("pagehide",service.dispose);emit("dispose");listeners.clear();if(win?.[SERVICE_KEY]===service)delete win[SERVICE_KEY]}};return service}__name(createPlatformService,"createPlatformService");function getPlatformService(options={}){const win=options.window??(typeof window==="undefined"?void 0:window);if(!win)throw new Error("getPlatformService requires a browser window");if(!win[SERVICE_KEY]||win[SERVICE_KEY].disposed)win[SERVICE_KEY]=createPlatformService({...options,window:win});return win[SERVICE_KEY]}__name(getPlatformService,"getPlatformService");var PlatformServiceManager=Object.freeze(Object.fromEntries(["init","whenReady","getState","isReady","getAppId","getPlayerId","getPlayerName","getSessionId","request","on","off","dispose"].map(method=>[method,(...args)=>getPlatformService()[method](...args)])));var BRIDGE_KEY=Symbol.for("@game-runtime/platform/v1");var CONSOLE_METHODS=["log","info","debug","warn","error"];var IGNORE_ATTRIBUTE="data-game-runtime-ignore";var bounded=__name((value,fallback,min,max)=>Number.isFinite(value)?Math.max(min,Math.min(max,value)):fallback,"bounded");var messageOf=__name(error=>{try{return error?.stack||error?.message||String(error)}catch{return"[unreadable error]"}},"messageOf");var serialize=__name(value=>{if(typeof value==="string")return value;if(value instanceof Error)return messageOf(value);const seen=new WeakSet;try{return JSON.stringify(value,(_key,item)=>{if(typeof item==="bigint")return`${item}n`;if(typeof item==="object"&&item!==null){if(seen.has(item))return"[Circular]";seen.add(item)}return item})??String(value)}catch{return"[unserializable value]"}},"serialize");function startPlatform(options={}){const win=typeof window==="undefined"?void 0:window;if(!win?.document)throw new Error("startPlatform requires a browser window");if(win[BRIDGE_KEY]&&!win[BRIDGE_KEY].disposed)return win[BRIDGE_KEY];const service=getPlatformService({window:win,targetOrigin:options.targetOrigin});void service.init();const doc=win.document;const settings={preview:options.preview??new URLSearchParams(win.location?.search||"").has("preview"),targetOrigin:options.targetOrigin||"*",resultDelayMs:bounded(options.resultDelayMs,3e3,0,6e4),captureTimeoutMs:bounded(options.captureTimeoutMs,4e3,1,3e4),maxLogs:bounded(options.maxLogs,500,1,5e3),maxLogChars:bounded(options.maxLogChars,2e5,1e3,2e6),showLogPanel:options.showLogPanel!==false};const history=[];const connections=new Map;const cleanups=[];const pending=new Set;const assetCache=new Map;let historyChars=0;let disposed=false;let result=1;let resultReported=false;let resultTimer;let notifiedReady=false;let active;let panel;let updatePanel=__name(()=>{},"updatePanel");const listen=__name((target,type,callback,capture=false)=>{target.addEventListener(type,callback,capture);cleanups.push(()=>target.removeEventListener(type,callback,capture))},"listen");const post=__name((payload,target=win.parent,origin=settings.targetOrigin)=>{if(disposed||!target||target===win)return;try{target.postMessage(payload,origin)}catch{}},"post");const armResult=__name(()=>{if(resultReported||resultTimer!==void 0||disposed)return;resultTimer=win.setTimeout(()=>{resultTimer=void 0;if(disposed||resultReported)return;resultReported=true;post({type:"runtime-result",data:result})},settings.resultDelayMs)},"armResult");const signalError=__name((crash=false)=>{if(!resultReported){if(crash)result=2;else if(result!==2)result=0;armResult()}},"signalError");const record=__name((level,message,source="console")=>{if(disposed)return;const entry={time:Date.now(),level,message:String(message).slice(0,8e3),source};history.push(entry);historyChars+=entry.message.length;while(history.length>settings.maxLogs||historyChars>settings.maxLogChars){historyChars-=history.shift().message.length}updatePanel()},"record");const consoleObject=win.console;for(const method of CONSOLE_METHODS){const original=consoleObject?.[method];if(typeof original!=="function")continue;const wrapped=__name(function(...args){if(!disposed){record(method==="log"?"info":method,args.map(serialize).join(" "));if(method==="error")signalError()}return Reflect.apply(original,consoleObject,args)},"wrapped");try{consoleObject[method]=wrapped;cleanups.push(()=>{if(consoleObject[method]===wrapped)consoleObject[method]=original})}catch{}}listen(win,"error",event=>{const target=event.target;const detail=event.error?messageOf(event.error):event.message||`Resource failed: ${target?.src||target?.href||target?.tagName||"unknown"}`;record("error",detail,"window.error");signalError()},true);listen(win,"unhandledrejection",event=>{record("error",serialize(event.reason),"unhandledrejection");signalError()});const seenWebglEvents=new WeakSet;const handleWebgl=__name(event=>{if(seenWebglEvents.has(event))return;seenWebglEvents.add(event);const restored=event.type==="webglcontextrestored";record(restored?"warn":"error",`${event.type}: ${event.statusMessage||"no details"}`,"webgl");if(!restored)signalError(true)},"handleWebgl");for(const type of["webglcontextlost","webglcontextcreationerror","webglcontextrestored"]){listen(doc,type,handleWebgl,true)}const finishCapture=__name((ticket,response)=>{if(!pending.has(ticket))return;pending.delete(ticket);ticket.connection?.requests.delete(ticket);win.clearTimeout(ticket.timer);ticket.abort.abort();if(!disposed)post({type:"screenshot-response",...ticket.id,...response},ticket.source,ticket.origin);ticket.resolve?.(response)},"finishCapture");const cancelCapture=__name(ticket=>{pending.delete(ticket);ticket.connection?.requests.delete(ticket);win.clearTimeout(ticket.timer);ticket.abort.abort();ticket.resolve?.({ok:false,error:"Preview disposed"})},"cancelCapture");const captureFrame=__name(connection=>{for(const ticket of[...connection.requests]){connection.requests.delete(ticket);if(!pending.has(ticket))continue;try{const canvas=connection.canvas;if(!(canvas.width>0&&canvas.height>0))throw new Error("Canvas has no drawable size");const canvasRect=canvas.getBoundingClientRect();const snapshotNotes=[];let roots=[];try{roots=findUiRoots(canvas,connection.options.uiRoot,win)}catch(error){snapshotNotes.push(`UI roots unavailable: ${messageOf(error)}`)}const videos=collectPaintVideos(canvas,roots);const frameRect=unionCaptureRect(canvasRect,[...roots,...videos]);const scaleX=canvas.width/(canvasRect.width||canvas.width);const scaleY=canvas.height/(canvasRect.height||canvas.height);const canvasCopy=doc.createElement("canvas");canvasCopy.width=canvas.width;canvasCopy.height=canvas.height;const canvasContext=canvasCopy.getContext("2d");if(!canvasContext)throw new Error("Screenshot 2D context unavailable");canvasContext.drawImage(canvas,0,0);const base=canvasCopy.toDataURL("image/png");if(!base.startsWith("data:image/"))throw new Error("Canvas snapshot is empty");const copy=doc.createElement("canvas");copy.width=Math.max(1,Math.round(frameRect.width*scaleX));copy.height=Math.max(1,Math.round(frameRect.height*scaleY));const context=copy.getContext("2d");if(!context)throw new Error("Screenshot 2D context unavailable");const fill=captureBackground(canvas,win);if(fill){context.fillStyle=fill;context.fillRect(0,0,copy.width,copy.height)}context.drawImage(canvas,(canvasRect.left-frameRect.left)*scaleX,(canvasRect.top-frameRect.top)*scaleY);try{paintVideos(copy,canvas,roots,win,snapshotNotes)}catch(error){snapshotNotes.push(`video overlay omitted: ${messageOf(error)}`)}let frame=base;let uiTree=null;try{uiTree=captureTree(canvas,roots,win)}catch(error){record("warn",messageOf(error),"ui-tree")}ticket.baseResponse={data:frame,composited:false,uiTree};const layers=[];for(const root of roots){if(root.tagName==="VIDEO")continue;try{layers.push(snapshotLayer(root,canvas,win,frameRect))}catch(error){snapshotNotes.push(`UI snapshot unavailable: ${messageOf(error)}`)}}void composeSnapshot(copy,frame,layers,win,ticket.abort.signal,assetCache).then(composite=>finishCapture(ticket,{ok:true,...finishCanvasOverlays(copy,canvas,roots,win,snapshotNotes,composite),uiTree,...snapshotNotes.length?{note:[...snapshotNotes,composite.note].filter(Boolean).join("; ").slice(0,2e3)}:{}}),error=>finishCapture(ticket,{ok:false,error:messageOf(error)}))}catch(error){record("warn",messageOf(error),"screenshot");finishCapture(ticket,{ok:false,error:messageOf(error)})}}},"captureFrame");const requestCapture=__name((source,origin,requestId,resolve)=>{const id=typeof requestId==="string"||typeof requestId==="number"?{requestId}:{};if(!active||active.disposed||pending.size>=4){const response={ok:false,error:!active?"No canvas registered":"Screenshot queue is full"};post({type:"screenshot-response",...id,...response},source,origin);resolve?.(response);return}const connection=active;const ticket={id,source,origin,connection,abort:new AbortController,resolve};ticket.timer=win.setTimeout(()=>{finishCapture(ticket,ticket.baseResponse?{ok:true,...ticket.baseResponse,note:"DOM composition timed out; returned the captured canvas frame"}:{ok:false,error:"Screenshot timed out waiting for a rendered frame"})},settings.captureTimeoutMs);pending.add(ticket);connection.requests.add(ticket);if(connection.options.renderForCapture){try{const returned=connection.options.renderForCapture();if(returned&&typeof returned.then==="function"){Promise.resolve(returned).catch(()=>{});throw new Error("renderForCapture must render synchronously; call afterRender for asynchronous rendering")}connection.handle.afterRender()}catch(error){finishCapture(ticket,{ok:false,error:messageOf(error)})}}},"requestCapture");listen(win,"message",event=>{if(event.source!==win.parent||event.data?.type!=="screenshot-request")return;if(settings.targetOrigin!=="*"&&event.origin!==settings.targetOrigin)return;requestCapture(event.source,settings.targetOrigin==="*"?"*":event.origin,event.data.requestId)});const bridge={get disposed(){return disposed},getLogs:__name(()=>history.map(entry=>({...entry})),"getLogs"),exportLogs:__name(()=>history.map(entry=>`[${new Date(entry.time).toISOString()}] [${entry.level}] [${entry.source}] ${entry.message}`).join("\n"),"exportLogs"),clearLogs(){history.length=0;historyChars=0;updatePanel()},sendLogsToParent(){if(disposed||win.parent===win||history.length===0)return false;post({type:"runtime-log",data:{message:bridge.exportLogs(),count:history.length}});return true},capture(){if(disposed)return Promise.resolve({ok:false,error:"Preview disposed"});return new Promise(resolve=>requestCapture(win,"*",void 0,resolve))},captureUiTree(){if(!active||disposed)return null;return captureTree(active.canvas,findUiRoots(active.canvas,active.options.uiRoot,win),win)},connect(canvas,connectionOptions={}){if(disposed)throw new Error("Platform bridge is disposed; call startPlatform again");if(canvas?.tagName!=="CANVAS"||typeof canvas.getContext!=="function"){throw new TypeError("connectPreview expects an HTMLCanvasElement")}if(canvas.ownerDocument!==doc)throw new Error("Canvas must belong to the platform window");if(connections.has(canvas))return connections.get(canvas).handle;const connection={canvas,options:connectionOptions,requests:new Set,rendered:false,ready:false,disposed:false};const notifyReady=__name(()=>{if(disposed||connection.disposed||!connection.ready||!connection.rendered||notifiedReady)return;notifiedReady=true;post({type:"onloadend"});post({type:"ready"})},"notifyReady");const types=["webglcontextlost","webglcontextcreationerror","webglcontextrestored"];for(const type of types)canvas.addEventListener(type,handleWebgl);connection.handle={afterRender(){if(disposed||connection.disposed)return;connection.rendered=true;armResult();notifyReady();captureFrame(connection)},markReady(){if(disposed||connection.disposed)return;connection.ready=true;notifyReady()},dispose(){if(connection.disposed)return;connection.disposed=true;for(const type of types)canvas.removeEventListener(type,handleWebgl);for(const ticket of[...pending])if(ticket.connection===connection)cancelCapture(ticket);connections.delete(canvas);if(active===connection)active=[...connections.values()].at(-1);if(connections.size===0)bridge.dispose()}};connections.set(canvas,connection);active=connection;return connection.handle},dispose(){if(disposed)return;disposed=true;service.dispose();if(resultTimer!==void 0)win.clearTimeout(resultTimer);for(const ticket of[...pending])cancelCapture(ticket);for(const connection of[...connections.values()])connection.handle.dispose();for(const cleanup of cleanups.reverse())cleanup();panel?.remove();assetCache.clear();updatePanel=__name(()=>{},"updatePanel");if(win[BRIDGE_KEY]===bridge)delete win[BRIDGE_KEY]}};win[BRIDGE_KEY]=bridge;listen(win,"pagehide",()=>bridge.dispose());const mountPanel=__name(()=>{if(disposed||panel||!doc.body||!settings.preview||!settings.showLogPanel)return;const mounted=mountDebugConsole({doc,win,listen,ignoreAttribute:IGNORE_ATTRIBUTE,history,bridge});panel=mounted.panel;updatePanel=mounted.updatePanel},"mountPanel");if(doc.body)mountPanel();else listen(doc,"DOMContentLoaded",mountPanel);return bridge}__name(startPlatform,"startPlatform");function connectPreview(canvas,options={}){return startPlatform(options).connect(canvas,options)}__name(connectPreview,"connectPreview");function captureBackground(canvas,win){const node=canvas.parentElement||canvas.ownerDocument.body;if(!node)return"";const color=win.getComputedStyle(node).backgroundColor;if(color&&color!=="transparent"&&color!=="rgba(0, 0, 0, 0)")return color;const body=canvas.ownerDocument.body;if(!body||body===node)return color||"";return win.getComputedStyle(body).backgroundColor||""}__name(captureBackground,"captureBackground");function findUiRoots(canvas,configured,win){if(configured===null||configured===false)return[];const doc=canvas.ownerDocument;const candidates=configured!==void 0?Array.isArray(configured)?configured:[configured]:[doc.getElementById("ui-root"),...Array.from(canvas.parentElement?.children||[])];const roots=[];for(const candidate of candidates){const root=typeof candidate==="string"?doc.querySelector(candidate):candidate;if(!root||root===canvas||root.nodeType!==1||root.hasAttribute(IGNORE_ATTRIBUTE))continue;if(["SCRIPT","STYLE","LINK","CANVAS","VIDEO"].includes(root.tagName))continue;if(roots.some(existing=>existing===root||existing.contains(root)))continue;const style=win.getComputedStyle(root);const rect=root.getBoundingClientRect();if(style.display==="none"||style.visibility==="hidden"||Number(style.opacity)===0||!rect.width||!rect.height)continue;for(let index=roots.length-1;index>=0;index--)if(root.contains(roots[index]))roots.splice(index,1);roots.push(root)}return roots}__name(findUiRoots,"findUiRoots");function snapshotLayer(root,canvas,win,frameRect){const rect=root.getBoundingClientRect();const canvasRect=canvas.getBoundingClientRect();frameRect=frameRect||unionCaptureRect(canvasRect,[root]);const clone=root.cloneNode(true);const originals=[root,...root.querySelectorAll("*")];const copies=[clone,...clone.querySelectorAll("*")];const resources=[];const notes=[];for(let index=0;index<originals.length;index++){const src=originals[index];const dst=copies[index];if(!dst?.style)continue;if(src===canvas||src.hasAttribute(IGNORE_ATTRIBUTE)||["SCRIPT","STYLE","LINK","IFRAME","VIDEO","CANVAS"].includes(src.tagName)){if(src.tagName==="IFRAME")notes.push("iframe overlay omitted");dst.remove();continue}const style=win.getComputedStyle(src);for(let i=0;i<style.length;i++){const property=style[i];dst.style.setProperty(property,style.getPropertyValue(property),"important")}dst.style.setProperty("animation","none","important");dst.style.setProperty("transition","none","important");for(const attr of[...dst.attributes])if(/^on/i.test(attr.name))dst.removeAttribute(attr.name);if(src.tagName==="IMG"){dst.removeAttribute("srcset");resources.push({node:dst,attr:"src",value:src.currentSrc||src.src})}if(src.tagName==="INPUT")dst.setAttribute("value",src.value);if(src.tagName==="TEXTAREA")dst.textContent=src.value;if(src.tagName==="OPTION")src.selected?dst.setAttribute("selected",""):dst.removeAttribute("selected");for(const property of["background-image","border-image-source","mask-image","-webkit-mask-image"]){const value=style.getPropertyValue(property);if(value?.includes("url("))resources.push({node:dst,property,value})}}const scaleX=rect.width/(root.offsetWidth||rect.width);const scaleY=rect.height/(root.offsetHeight||rect.height);for(const[property,value]of Object.entries({position:"absolute",left:"0px",top:"0px",right:"auto",bottom:"auto",margin:"0px",transform:"none","transform-origin":"0 0"})){clone.style.setProperty(property,value,"important")}let css="";for(const sheet of[...root.ownerDocument.styleSheets]){try{css+=[...sheet.cssRules].map(rule=>rule.cssText).join("\n")}catch{notes.push("cross-origin stylesheet unavailable")}}return{clone,resources,notes,css,width:frameRect.width||canvasRect.width||canvas.width,height:frameRect.height||canvasRect.height||canvas.height,left:rect.left-frameRect.left,top:rect.top-frameRect.top,scaleX,scaleY}}__name(snapshotLayer,"snapshotLayer");async function composeSnapshot(copy,base,layers,win,signal,cache){if(!layers.length)return{data:base,composited:false,note:"No DOM UI overlay"};let composited=false;const notes=[];for(const layer of layers){if(signal.aborted)throw new Error("Screenshot cancelled");try{const image=await rasterizeLayer(layer,win,signal,cache);copy.getContext("2d").drawImage(image,0,0,copy.width,copy.height);composited=true;notes.push(...layer.notes)}catch(error){if(signal.aborted)throw error;notes.push(messageOf(error))}}try{return{data:composited?copy.toDataURL("image/png"):base,composited,...notes.length?{note:notes.join("; ").slice(0,2e3)}:{}}}catch(error){return{data:base,composited:false,note:`DOM composite unavailable: ${messageOf(error)}`}}}__name(composeSnapshot,"composeSnapshot");async function rasterizeLayer(layer,win,signal,cache){for(const resource of layer.resources){if(signal.aborted)throw new Error("Screenshot cancelled");if(resource.attr){try{resource.node.setAttribute(resource.attr,await inlineAsset(resource.value,win,signal,cache))}catch(error){resource.node.removeAttribute(resource.attr);layer.notes.push(`UI image omitted: ${messageOf(error)}`)}}else{let value=resource.value;for(const match of resource.value.matchAll(/url\(\s*(['"]?)(.*?)\1\s*\)/g)){try{value=value.replace(match[0],`url("${await inlineAsset(match[2],win,signal,cache)}")`)}catch(error){value=value.replace(match[0],"none");layer.notes.push(`UI background omitted: ${messageOf(error)}`)}}resource.node.style.setProperty(resource.property,value,"important")}}layer.clone.setAttribute("xmlns","http://www.w3.org/1999/xhtml");const serialized=new win.XMLSerializer().serializeToString(layer.clone);const css=`${layer.css}
30
- *,*::before,*::after{animation:none!important;transition:none!important}`.replace(/]]>/g,"]]]]><![CDATA[>");const svg=`<svg xmlns="http://www.w3.org/2000/svg" width="${layer.width}" height="${layer.height}"><foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="position:relative;width:${layer.width}px;height:${layer.height}px;overflow:hidden"><style><![CDATA[${css}]]></style><div style="position:absolute;left:${layer.left}px;top:${layer.top}px;transform:scale(${layer.scaleX},${layer.scaleY});transform-origin:0 0">${serialized}</div></div></foreignObject></svg>`;return new Promise((resolve,reject)=>{const image=new win.Image;const cleanup=__name(()=>{signal.removeEventListener("abort",abort);image.onload=null;image.onerror=null},"cleanup");const abort=__name(()=>{cleanup();image.src="";reject(new Error("Screenshot cancelled"))},"abort");signal.addEventListener("abort",abort,{once:true});image.onload=()=>{cleanup();resolve(image)};image.onerror=()=>{cleanup();reject(new Error("DOM UI rasterization failed"))};if(signal.aborted)abort();else image.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`})}__name(rasterizeLayer,"rasterizeLayer");async function inlineAsset(source,win,signal,cache){if(!source)throw new Error("empty URL");if(source.startsWith("data:"))return source;const url=new URL(source,win.document.baseURI).href;if(cache.has(url))return cache.get(url);const response=await win.fetch(url,{signal,credentials:"same-origin",cache:"force-cache"});if(!response.ok)throw new Error(`asset HTTP ${response.status}`);const blob=await response.blob();if(blob.size>5*1024*1024)throw new Error("UI asset exceeds 5 MiB");const data=await new Promise((resolve,reject)=>{const reader=new win.FileReader;const abort=__name(()=>{reader.abort();reject(new Error("Screenshot cancelled"))},"abort");const cleanup=__name(()=>signal.removeEventListener("abort",abort),"cleanup");reader.onload=()=>{cleanup();resolve(String(reader.result))};reader.onerror=()=>{cleanup();reject(new Error("UI asset read failed"))};reader.onabort=()=>{cleanup();reject(new Error("Screenshot cancelled"))};signal.addEventListener("abort",abort,{once:true});if(signal.aborted)abort();else reader.readAsDataURL(blob)});if(data.length<2e5&&cache.size<32)cache.set(url,data);return data}__name(inlineAsset,"inlineAsset");function captureTree(canvas,roots,win){if(!roots.length)return null;const canvasRect=canvas.getBoundingClientRect();const rect=unionCaptureRect(canvasRect,roots);const scaleX=canvas.width/(canvasRect.width||canvas.width);const scaleY=canvas.height/(canvasRect.height||canvas.height);const round=__name(value=>Math.round(value*100)/100,"round");const tree={design:{width:Math.max(1,Math.round(rect.width*scaleX)),height:Math.max(1,Math.round(rect.height*scaleY))},scale:round(1/scaleX),nodeCount:0,truncated:false,hiddenSkipped:0,issues:[],layers:[]};const walk=__name((element,depth,parent)=>{if(element===canvas||element.hasAttribute(IGNORE_ATTRIBUTE))return null;const style=win.getComputedStyle(element);if(style.display==="none"||style.visibility==="hidden"||Number(style.opacity)===0){tree.hiddenSkipped++;return null}if(tree.nodeCount>=300){tree.truncated=true;return null}tree.nodeCount++;const bounds=element.getBoundingClientRect();const node={desc:`${element.tagName.toLowerCase()}${element.id?`#${element.id}`:""}${[...element.classList].map(name=>`.${name}`).join("")}`,rect:{x:round((bounds.left-rect.left)*scaleX),y:round((bounds.top-rect.top)*scaleY),w:round(bounds.width*scaleX),h:round(bounds.height*scaleY)}};const text=[...element.childNodes].filter(child=>child.nodeType===3).map(child=>child.textContent).join("").trim();if(text)node.text=text.slice(0,256);if(style.overflowX!=="visible"||style.overflowY!=="visible")node.overflow=`${style.overflowX} ${style.overflowY}`;const layer=Number.parseInt(element.dataset?.layer,10);if(Number.isFinite(layer))node.layer=layer;if(parent&&!parent.overflow&&tree.issues.length<20){const a=parent.rect;const b=node.rect;if(a.w>0&&a.h>0&&(b.x<a.x-1||b.y<a.y-1||b.x+b.w>a.x+a.w+1||b.y+b.h>a.y+a.h+1)){tree.issues.push(`overflow: ${node.desc} exceeds ${parent.desc}`)}}if(depth>=12){if(element.children.length)tree.truncated=true}else{const children=[...element.children].map(child=>walk(child,depth+1,node)).filter(Boolean);if(children.length)node.children=children}return node},"walk");tree.layers=roots.map(root=>walk(root,0,null)).filter(Boolean);return tree}__name(captureTree,"captureTree");export{connectPreview,startPlatform};
@@ -1,49 +0,0 @@
1
- import type { PlatformService } from './platform-service.mjs';
2
- export type FieldValue = number | string;
3
- export type FieldsMap = Record<string, FieldValue>;
4
- export type SaveSource = 'cloud' | 'local';
5
- export interface WriteOptions {
6
- slotKey?: string; label?: string; ifMatchTimestamp?: number | null;
7
- /** Ask the server to attach its blob to a CONFLICT reply. Off by default: a blob is up to 2 MiB and every conflict would drag it over the wire. */
8
- conflictIncludeBlob?: boolean;
9
- }
10
- export interface LoadOptions { slotKey?: string; includeBlob?: boolean; }
11
- export interface DeleteOptions { slotKey?: string; fieldKeys?: string[]; clearBlob?: boolean; dropSlot?: boolean; ifMatchTimestamp?: number | null; }
12
- /**
13
- * On CONFLICT the server's current copy rides along in `fields` / `blob_size`
14
- * (and `blob` when conflictIncludeBlob was set), so the game can diff it against
15
- * the local one. `updated_at` is the server token: the SDK deliberately does NOT
16
- * adopt it, so a blind retry conflicts again instead of overwriting the other
17
- * device. Pass it back as `ifMatchTimestamp` to go through with the write.
18
- */
19
- export interface WriteResult { result: string; message: string; source?: SaveSource; slot_key?: string; updated_at?: number; fields_count?: number; blob_size?: number; fields?: FieldsMap; blob?: Uint8Array | null; }
20
- export interface LoadResult extends WriteResult { label?: string; }
21
- export interface SlotInfo { slot_key: string; label: string; fields_count: number; blob_size: number; updated_at: number; }
22
- export interface ListResult { result: string; message: string; source?: SaveSource; slots?: SlotInfo[]; }
23
- export interface DeleteResult extends WriteResult { deleted_fields?: number; blob_cleared?: boolean; slot_dropped?: boolean; }
24
- export interface SaveApi {
25
- setFields(map: FieldsMap, onDone?: (result: WriteResult) => void, opts?: WriteOptions): Promise<WriteResult>;
26
- setBlob(bytes: Uint8Array | null | undefined, onDone?: (result: WriteResult) => void, opts?: WriteOptions): Promise<WriteResult>;
27
- save(map: FieldsMap, bytes: Uint8Array | null | undefined, onDone?: (result: WriteResult) => void, opts?: WriteOptions): Promise<WriteResult>;
28
- load(onDone?: (result: LoadResult) => void, opts?: LoadOptions): Promise<LoadResult>;
29
- list(onDone?: (result: ListResult) => void): Promise<ListResult>;
30
- delete(onDone?: (result: DeleteResult) => void, opts?: DeleteOptions): Promise<DeleteResult>;
31
- /** Flush at checkpoints while the page is alive. Unload cannot guarantee HTTP delivery. */
32
- flush(onDone?: (result: WriteResult) => void, slotKey?: string): Promise<WriteResult>;
33
- setDebounceMs(ms: number): void;
34
- }
35
- export interface SaveManagerApi extends SaveApi {
36
- /** Uses the same slot queues and locks, with local fallback disabled. */
37
- readonly cloud: SaveApi;
38
- setMirrorEnabled(enabled: boolean): void; isMirrorEnabled(): boolean;
39
- dispose(): void;
40
- }
41
- export interface SaveManagerOptions {
42
- service?: PlatformService; window?: Window;
43
- /** Omit for localStorage. Null explicitly disables local persistence. */
44
- storage?: Storage | null;
45
- /** Standalone namespace; defaults to the game URL's directory. */
46
- localNamespace?: string;
47
- }
48
- export function createSaveManager(options?: SaveManagerOptions): SaveManagerApi & { readonly disposed: boolean };
49
- export const SaveManager: SaveManagerApi;
@@ -1 +0,0 @@
1
- var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});var SERVICE_KEY=Symbol.for("@game-runtime/platform-service/v1");var unavailable=__name(()=>({ok:false,code:"PLATFORM_UNAVAILABLE",message:"\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301\u5E73\u53F0\u670D\u52A1"}),"unavailable");var failure=__name((code="INTERNAL_ERROR",message="\u670D\u52A1\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5")=>({ok:false,code,message}),"failure");var duration=__name((value,fallback)=>Number.isFinite(value)&&value>=0?Math.min(value,6e4):fallback,"duration");function parentOrigin(win,explicit){const valid=__name(value=>{try{const url=new URL(value);return/^https?:$/.test(url.protocol)?url.origin:null}catch{return null}},"valid");if(explicit&&explicit!=="*")return valid(explicit);const referrer=valid(win?.document?.referrer);if(referrer)return referrer;try{return valid(win?.parent?.location?.origin)}catch{return null}}__name(parentOrigin,"parentOrigin");function apiBase(value){try{const url=new URL(value);const local=url.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(url.hostname);if(url.protocol!=="https:"&&!local||url.username||url.password||url.search||url.hash)return null;return url.href.replace(/\/+$/,"")}catch{return null}}__name(apiBase,"apiBase");function createPlatformService(options={}){const win=options.window??(typeof window==="undefined"?void 0:window);let initialized=false,disposed=false,state="pending",identity=null,session=0,initTimer;let origin=null;const waiters=new Set,requests=new Set,listeners=new Map;const emit=__name((event,...args)=>{for(const listener of[...listeners.get(event)||[]]){try{listener(...args)}catch{}}},"emit");const settle=__name(next=>{const previous=state;state=next;clearTimeout(initTimer);for(const resolve of waiters)resolve();waiters.clear();if(previous!==next)emit("state-change",next,previous)},"settle");const invalidate=__name(()=>{session++;for(const cancel of[...requests])cancel()},"invalidate");const onMessage=__name(event=>{if(disposed||!origin||event.source!==win?.parent||event.origin!==origin)return;const{type,data}=event.data||{};if(!data||typeof data!=="object")return;if(type==="runtime-init"){const api=typeof data.api==="string"?apiBase(data.api.trim()):null;const token=typeof data.token==="string"?data.token.trim():"";const appId=typeof data.app_id==="string"?data.app_id.trim():"";const playerId=typeof data.player_id==="string"?data.player_id.trim():"";if(!api||!token||!appId||!playerId)return;if(!identity||identity.api!==api||identity.appId!==appId||identity.playerId!==playerId)invalidate();identity={api,token,appId,playerId,playerName:typeof data.player_name==="string"?data.player_name.trim():""};settle("active")}else if(type==="session-token-refresh"&&identity&&typeof data.token==="string"&&data.token.trim()){identity={...identity,token:data.token.trim()};emit("token-refreshed")}},"onMessage");const dispatch=__name(async(options2,expectedSession)=>{if(disposed||state!=="active"||session!==expectedSession)return unavailable();const currentIdentity=identity;const controller=new AbortController;let timer,cancel;const interrupted=new Promise(resolve=>{cancel=__name(()=>{controller.abort();resolve(unavailable())},"cancel");requests.add(cancel);timer=setTimeout(()=>{controller.abort();resolve(failure())},duration(options2.timeoutMs,1e4))});const operation=__name(async()=>{try{const headers=new Headers(options2.headers);headers.set("Content-Type","application/json");headers.set("Authorization",`Bearer ${currentIdentity.token}`);const response=await(win?.fetch?win.fetch.bind(win):globalThis.fetch)(`${currentIdentity.api}${options2.path}`,{method:"POST",headers,body:JSON.stringify(options2.body??{}),signal:controller.signal,redirect:"error",credentials:"omit"});if(response.status===401)return failure("AUTH_FAILED","\u767B\u5F55\u6001\u5931\u6548");if(response.status===403)return failure("FORBIDDEN","\u65E0\u6743\u64CD\u4F5C");if(response.status!==200)return failure();const envelope=await response.json();if(envelope?.code!==0||typeof envelope?.data?.result!=="string"||!envelope.data.result)return failure();const data=envelope.data;return{ok:data.result==="OK",code:data.result,message:typeof data.message==="string"?data.message:"",data}}catch{return failure()}},"operation");try{const result=await Promise.race([operation(),interrupted]);if(disposed||session!==expectedSession)return unavailable();return{...result,tokenChanged:identity.token!==currentIdentity.token}}finally{clearTimeout(timer);requests.delete(cancel)}},"dispatch");const service={get disposed(){return disposed},init(){if(initialized||disposed)return Promise.resolve();initialized=true;origin=parentOrigin(win,options.targetOrigin);if(!win?.addEventListener||win.parent===win||!origin)settle("noop");else{win.addEventListener("message",onMessage);win.addEventListener("pagehide",service.dispose);initTimer=setTimeout(()=>settle("noop"),duration(options.initTimeoutMs,5e3))}return Promise.resolve()},whenReady(){void service.init();if(state!=="pending"||disposed)return Promise.resolve();if(waiters.size>=16){const oldest=waiters.values().next().value;waiters.delete(oldest);oldest()}return new Promise(resolve=>waiters.add(resolve))},getState:__name(()=>state,"getState"),isReady:__name(()=>state==="active"&&!disposed,"isReady"),getAppId:__name(()=>identity?.appId??"","getAppId"),getPlayerId:__name(()=>identity?.playerId??"","getPlayerId"),getPlayerName:__name(()=>identity?.playerName??"","getPlayerName"),getSessionId:__name(()=>session,"getSessionId"),async request(options2){if(!options2||typeof options2.path!=="string"||!/^\/[A-Za-z0-9/_-]+$/.test(options2.path))return failure("INVALID_ARGUMENT","\u975E\u6CD5\u8BF7\u6C42\u8DEF\u5F84");if((options2.path.startsWith("/api/cloudsave/")||options2.path.startsWith("/api/leaderboard/"))&&!disposed){void service.init();if(state==="noop"&&origin){state="pending";emit("state-change","pending","noop");initTimer=setTimeout(()=>settle("noop"),duration(options.initTimeoutMs,5e3))}}const expected=options2.sessionId??(state==="pending"?null:session);await service.whenReady();if(disposed||state!=="active"||expected!==null&&expected!==session)return unavailable();const requestSession=session;let result=await dispatch(options2,requestSession);if(result.code==="AUTH_FAILED"&&result.tokenChanged)result=await dispatch(options2,requestSession);const{tokenChanged,...publicResult}=result;return publicResult},on(event,listener){if(!listeners.has(event))listeners.set(event,new Set);listeners.get(event).add(listener);return()=>service.off(event,listener)},off(event,listener){listeners.get(event)?.delete(listener)},dispose(){if(disposed)return;disposed=true;invalidate();identity=null;settle("noop");win?.removeEventListener?.("message",onMessage);win?.removeEventListener?.("pagehide",service.dispose);emit("dispose");listeners.clear();if(win?.[SERVICE_KEY]===service)delete win[SERVICE_KEY]}};return service}__name(createPlatformService,"createPlatformService");function getPlatformService(options={}){const win=options.window??(typeof window==="undefined"?void 0:window);if(!win)throw new Error("getPlatformService requires a browser window");if(!win[SERVICE_KEY]||win[SERVICE_KEY].disposed)win[SERVICE_KEY]=createPlatformService({...options,window:win});return win[SERVICE_KEY]}__name(getPlatformService,"getPlatformService");var PlatformServiceManager=Object.freeze(Object.fromEntries(["init","whenReady","getState","isReady","getAppId","getPlayerId","getPlayerName","getSessionId","request","on","off","dispose"].map(method=>[method,(...args)=>getPlatformService()[method](...args)])));var keyPattern=/^[A-Za-z0-9._-]{1,64}$/;var invalidSave=__name(message=>({result:"INVALID_ARGUMENT",message}),"invalidSave");var missingSave=__name(slot=>({result:"NOT_FOUND",message:"\u5B58\u6863\u4E0D\u5B58\u5728",slot_key:slot,fields:{},blob:null,label:"",blob_size:0}),"missingSave");function copyFields(value){if(!value||typeof value!=="object"||Array.isArray(value))throw new Error("fields \u5FC5\u987B\u662F\u6807\u91CF\u5B57\u5178");const entries=Object.entries(value);for(const[key,item]of entries){if(!keyPattern.test(key)||typeof item!=="string"&&(typeof item!=="number"||!Number.isFinite(item)||Number.isInteger(item)&&!Number.isSafeInteger(item)))throw new Error("fields \u53EA\u5141\u8BB8\u5B89\u5168\u6570\u5B57\u6216\u5B57\u7B26\u4E32\uFF0C\u952E\u987B\u4E3A 1\u201364 \u4F4D\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u70B9\u3001\u4E0B\u5212\u7EBF\u6216\u8FDE\u5B57\u7B26")}return Object.fromEntries(entries)}__name(copyFields,"copyFields");function encodeBlob(bytes){if(bytes==null)return null;if(!(bytes instanceof Uint8Array))throw new Error("blob \u5FC5\u987B\u662F Uint8Array \u6216 null");let binary="";for(let offset=0;offset<bytes.length;offset+=32768)binary+=String.fromCharCode(...bytes.subarray(offset,offset+32768));return btoa(binary)}__name(encodeBlob,"encodeBlob");function decodeBlob(value){if(value==null)return null;if(typeof value!=="string")throw new Error("\u65E0\u6548 blob");return Uint8Array.from(atob(value),char=>char.charCodeAt(0))}__name(decodeBlob,"decodeBlob");function createLocalSaveStore(getStorage){const prefix=__name(scope=>`@lightgame/save/v1/${encodeURIComponent(scope)}/`,"prefix");const storage=__name(()=>{const value=getStorage();if(!value)throw new Error("\u672C\u5730\u5B58\u50A8\u4E0D\u53EF\u7528");return value},"storage");const read=__name((scope,slot)=>{const value=storage().getItem(`${prefix(scope)}${slot}`);if(value===null)return null;const record=JSON.parse(value);if(record?.version!==1||!Number.isFinite(record.updated_at)||typeof record.label!=="string")throw new Error("\u672C\u5730\u5B58\u6863\u5DF2\u635F\u574F");record.fields=copyFields(record.fields);decodeBlob(record.blob);return record},"read");const metadata=__name((slot,record)=>({slot_key:slot,label:record.label,fields_count:Object.keys(record.fields).length,blob_size:decodeBlob(record.blob)?.length??0,updated_at:record.updated_at}),"metadata");const put=__name((scope,slot,record)=>storage().setItem(`${prefix(scope)}${slot}`,JSON.stringify(record)),"put");return{perform(scope,action,body){const slot=body.slot_key;try{if(action==="list"){const target=storage(),start=prefix(scope),slots=[];for(let index=0;index<target.length;index++){const key=target.key(index);if(key?.startsWith(start)&&keyPattern.test(key.slice(start.length))){const name=key.slice(start.length),record2=read(scope,name);if(record2)slots.push(metadata(name,record2))}}return{result:"OK",message:"",slots:slots.sort((a,b)=>a.slot_key.localeCompare(b.slot_key))}}const previous=read(scope,slot);if(action==="get")return previous?{result:"OK",message:"",...metadata(slot,previous),fields:previous.fields,blob:body.include_blob===false?null:decodeBlob(previous.blob)}:missingSave(slot);if(action==="delete"){if(!previous||body.drop_slot){storage().removeItem(`${prefix(scope)}${slot}`);return{result:"OK",message:"",slot_key:slot,deleted_fields:previous?Object.keys(previous.fields).length:0,blob_cleared:!!previous?.blob,slot_dropped:!!previous,updated_at:0}}let deleted=0;for(const key of body.field_keys||[])if(Object.hasOwn(previous.fields,key)){delete previous.fields[key];deleted++}const cleared=body.clear_blob===true&&previous.blob!==null;if(body.clear_blob)previous.blob=null;previous.updated_at=Math.max(Date.now(),previous.updated_at+1);put(scope,slot,previous);return{result:"OK",message:"",slot_key:slot,deleted_fields:deleted,blob_cleared:cleared,slot_dropped:false,updated_at:previous.updated_at}}const record=previous??{version:1,fields:{},blob:null,label:"",updated_at:0};if(body.fields_replace_all)record.fields={...body.fields};else if(body.fields)record.fields={...record.fields,...body.fields};if(body.clear_blob)record.blob=null;else if(Object.hasOwn(body,"blob"))record.blob=body.blob;if(body.label!==void 0)record.label=body.label;record.updated_at=Math.max(Date.now(),record.updated_at+1);put(scope,slot,record);return{result:"OK",message:"",...metadata(slot,record)}}catch{return{result:"INTERNAL_ERROR",message:"\u672C\u5730\u5B58\u6863\u4E0D\u53EF\u8BFB\u5199\u6216\u5DF2\u635F\u574F"}}},mirror(scope,action,body,result){if(action==="get"){if(body.include_blob===false)return;this.perform(scope,"set",{slot_key:body.slot_key,fields:result.fields,fields_replace_all:true,blob:encodeBlob(result.blob),label:result.label})}else if(action==="set"||action==="delete")this.perform(scope,action,body)}}}__name(createLocalSaveStore,"createLocalSaveStore");var MANAGER_KEY=Symbol.for("@game-runtime/save/v1");var unavailable2=__name(()=>({result:"PLATFORM_UNAVAILABLE",message:"\u5E73\u53F0\u8EAB\u4EFD\u5DF2\u5207\u6362\u6216\u5B58\u6863\u670D\u52A1\u5DF2\u5173\u95ED"}),"unavailable");var failed=__name(()=>({result:"INTERNAL_ERROR",message:"\u5B58\u6863\u670D\u52A1\u6682\u4E0D\u53EF\u7528"}),"failed");var fallbackCodes=new Set(["PLATFORM_UNAVAILABLE","INTERNAL_ERROR"]);var deliver=__name(async(promise,callback)=>{const result=await promise;try{callback?.(result)}catch{}return result},"deliver");function createSaveManager(options={}){const service=options.service??getPlatformService();const win=options.window??(typeof window==="undefined"?void 0:window);const namespace=options.localNamespace??win?.location?.pathname?.replace(/(?:index(?:_profile)?\.html)?$/,"")??"standalone";const local=createLocalSaveStore(()=>options.storage===void 0?win?.localStorage:options.storage);const batches=new Map,queues=new Map,tokens=new Map,results=new Map;let disposed=false,debounceMs=800,mirrorEnabled=true,stop;const stopped=new Promise(resolve=>{stop=__name(()=>resolve(unavailable2()),"stop")});const context=__name(()=>{const initial=service.getState()==="pending"?null:service.getSessionId();return service.whenReady().then(()=>{if(disposed||service.disposed||initial!==null&&initial!==service.getSessionId())return null;return{session:service.getSessionId(),scope:JSON.stringify(service.isReady()?["player",service.getAppId(),service.getPlayerId()]:["local",namespace])}})},"context");const current2=__name(ctx=>ctx&&!disposed&&!service.disposed&&ctx.session===service.getSessionId(),"current");const queue=__name((slot,operation)=>{const previous=queues.get(slot)??Promise.resolve();const promise=Promise.race([previous.then(()=>disposed?unavailable2():operation()).catch(failed),stopped]);queues.set(slot,promise);void promise.then(result=>{results.set(slot,result);if(queues.get(slot)===promise)queues.delete(slot)});return promise},"queue");const execute=__name(async(ctxPromise,action,originalBody,opts,cloudOnly)=>{const ctx=await ctxPromise;if(!current2(ctx))return unavailable2();const slot=originalBody.slot_key;const tokenKey=`${ctx.scope}/${slot}`;const body={...originalBody};if(action==="set"||action==="delete"){const timestamp=opts.ifMatchTimestamp===void 0?tokens.get(tokenKey):opts.ifMatchTimestamp;if(timestamp>0)body.if_match_timestamp=timestamp}const response=await service.request({path:`/api/cloudsave/${action}`,body,sessionId:ctx.session});if(!current2(ctx))return unavailable2();let result={...response.data,result:response.code,message:response.message};if(response.ok){try{if(action==="get")result={...result,slot_key:slot,fields:copyFields(result.fields),blob:body.include_blob===false?null:decodeBlob(result.blob),label:typeof result.label==="string"?result.label:""};if(action==="list"&&!Array.isArray(result.slots))throw new Error("Missing slots")}catch{result=failed()}}if(result.result==="OK"){if(action==="delete"&&(body.drop_slot||result.slot_dropped))tokens.delete(tokenKey);else if(Number.isFinite(result.updated_at)&&result.updated_at>0)tokens.set(tokenKey,result.updated_at);if(mirrorEnabled)local.mirror(ctx.scope,action,body,result)}else if(result.result==="NOT_FOUND"&&action==="get"){tokens.delete(tokenKey);result={...missingSave(slot),message:result.message}}else if(result.result==="CONFLICT"){if(result.fields&&typeof result.fields==="object"){let blob=null;try{blob=result.blob==null?null:decodeBlob(result.blob)}catch{}result={...result,blob_size:Number.isFinite(result.blob_size)?result.blob_size:0,blob}}}else if(!cloudOnly&&fallbackCodes.has(result.result)){return{...local.perform(ctx.scope,action,body),source:"local"}}return{...result,source:"cloud"}},"execute");const validateOptions=__name((opts,kind)=>{const slot=opts.slotKey===void 0||opts.slotKey===""?"default":opts.slotKey;if(typeof slot!=="string"||!keyPattern.test(slot))throw new Error("\u975E\u6CD5 slotKey");if(opts.label!==void 0&&(typeof opts.label!=="string"||opts.label.length>200))throw new Error("label \u5FC5\u987B\u4E3A\u6700\u591A 200 \u5B57\u7B26\u7684\u5B57\u7B26\u4E32");if(opts.ifMatchTimestamp!=null&&(!Number.isSafeInteger(opts.ifMatchTimestamp)||opts.ifMatchTimestamp<0))throw new Error("\u975E\u6CD5 ifMatchTimestamp");const body={slot_key:slot};if(kind==="set"&&opts.label!==void 0)body.label=opts.label;if(kind==="set"&&opts.conflictIncludeBlob===true)body.conflict_include_blob=true;return body},"validateOptions");const flushBatch=__name(slot=>{const batch=batches.get(slot);if(!batch)return;batches.delete(slot);clearTimeout(batch.timer);const promise=queue(slot,()=>execute(batch.context,"set",batch.body,batch.opts,batch.cloudOnly));void promise.then(result=>{for(const resolve of batch.resolvers)resolve(result)})},"flushBatch");const schedule=__name((action,body,opts,cloudOnly)=>{const ctx=context();flushBatch(body.slot_key);return queue(body.slot_key,()=>execute(ctx,action,body,opts,cloudOnly))},"schedule");const safely=__name((callback,operation)=>{if(disposed)return deliver(unavailable2(),callback);try{return deliver(operation(),callback)}catch(error){return deliver(invalidSave(error.message),callback)}},"safely");const methods=__name(cloudOnly=>({setFields(map,onDone,opts={}){return safely(onDone,()=>{const body=validateOptions(opts,"set");body.fields=copyFields(map);if(!Object.keys(body.fields).length)throw new Error("fields \u4E0D\u80FD\u4E3A\u7A7A");const slot=body.slot_key;const session=service.getSessionId();let batch=batches.get(slot);if(batch&&(batch.cloudOnly!==cloudOnly||batch.session!==session||batch.opts.ifMatchTimestamp!==opts.ifMatchTimestamp)){flushBatch(slot);batch=null}if(!batch){batch={context:context(),session,body,opts:{...opts},cloudOnly,resolvers:[],timer:null};batches.set(slot,batch)}else{batch.body.fields={...batch.body.fields,...body.fields};if(body.label!==void 0)batch.body.label=body.label}const promise=new Promise(resolve=>batch.resolvers.push(resolve));clearTimeout(batch.timer);if(debounceMs===0)flushBatch(slot);else batch.timer=setTimeout(()=>flushBatch(slot),debounceMs);return promise})},setBlob(bytes,onDone,opts={}){return safely(onDone,()=>{const body=validateOptions(opts,"set"),blob=encodeBlob(bytes);if(blob===null)body.clear_blob=true;else body.blob=blob;return schedule("set",body,{...opts},cloudOnly)})},save(map,bytes,onDone,opts={}){return safely(onDone,()=>{const body={...validateOptions(opts,"set"),fields:copyFields(map),fields_replace_all:true},blob=encodeBlob(bytes);if(blob===null)body.clear_blob=true;else body.blob=blob;return schedule("set",body,{...opts},cloudOnly)})},load(onDone,opts={}){return safely(onDone,()=>schedule("get",{...validateOptions(opts,"get"),include_blob:opts.includeBlob!==false},{...opts},cloudOnly))},list(onDone){return safely(onDone,()=>{const ctx=context();for(const slot of[...batches.keys()])flushBatch(slot);const previous=[...queues.values()];return queue("*list",async()=>{await Promise.all(previous);return execute(ctx,"list",{},{},cloudOnly)})})},delete(onDone,opts={}){return safely(onDone,()=>{const body=validateOptions(opts,"delete");if(opts.dropSlot===true)body.drop_slot=true;else{if(opts.fieldKeys!==void 0&&(!Array.isArray(opts.fieldKeys)||!opts.fieldKeys.every(key=>typeof key==="string"&&keyPattern.test(key))))throw new Error("\u975E\u6CD5 fieldKeys");if(opts.fieldKeys?.length)body.field_keys=[...opts.fieldKeys];if(opts.clearBlob===true)body.clear_blob=true;if(!body.field_keys&&!body.clear_blob)throw new Error("\u81F3\u5C11\u6307\u5B9A fieldKeys\u3001clearBlob \u6216 dropSlot")}return schedule("delete",body,{...opts},cloudOnly)})},flush(onDone,slotKey="default"){return safely(onDone,()=>{const{slot_key:slot}=validateOptions({slotKey},"set");flushBatch(slot);return queue(slot,()=>results.get(slot)??{result:"OK",message:""})})},setDebounceMs(ms){if(Number.isFinite(ms)&&ms>=0&&ms<=6e4)debounceMs=Math.floor(ms)}}),"methods");const manager={...methods(false),cloud:Object.freeze(methods(true)),get disposed(){return disposed},setMirrorEnabled(enabled){mirrorEnabled=enabled===true},isMirrorEnabled:__name(()=>mirrorEnabled,"isMirrorEnabled"),dispose(){if(disposed)return;disposed=true;for(const batch of batches.values()){clearTimeout(batch.timer);for(const resolve of batch.resolvers)resolve(unavailable2())}batches.clear();tokens.clear();results.clear();stop();unsubscribe();win?.removeEventListener?.("pagehide",manager.dispose)}};const unsubscribe=service.on("dispose",()=>manager.dispose());win?.addEventListener?.("pagehide",manager.dispose);return manager}__name(createSaveManager,"createSaveManager");function current(){const service=getPlatformService();if(window[MANAGER_KEY]?.service!==service||window[MANAGER_KEY]?.manager.disposed){window[MANAGER_KEY]?.manager.dispose();window[MANAGER_KEY]={service,manager:createSaveManager({service})}}return window[MANAGER_KEY].manager}__name(current,"current");var publicMethods=["setFields","setBlob","save","load","list","delete","flush","setDebounceMs","setMirrorEnabled","isMirrorEnabled","dispose"];var SaveManager=Object.freeze({...Object.fromEntries(publicMethods.map(method=>[method,(...args)=>current()[method](...args)])),get cloud(){return current().cloud}});export{SaveManager,createSaveManager};
@@ -1,39 +0,0 @@
1
- {
2
- "version": "1.0.0",
3
- "files": {
4
- "platform/config.d.mts": "25066e71f44ee8b74b2285e3824536afb4cac25f63f4d4c2193da29c237d774d",
5
- "platform/config.mjs": "29b7b5242900f505f6cf5cf2c09f598e02413a657b37b4561086d464d637ba6c",
6
- "platform/leaderboard.d.mts": "70a7dc23228e5a089f58ab287cc6c96d86361e3adc92a5b34f30e9a8e1775c18",
7
- "platform/leaderboard.mjs": "f5ab292432ee58995712d25f42364d3a37fda14829fb68627ee5155412a76648",
8
- "platform/platform-capture-video.mjs": "5137bfd403c8500e1e5b5305ac7f3ca55ee68daaade624333a7c85786077713d",
9
- "platform/platform-service.d.mts": "8c42fc90744b5c3d359620222d574ecc7096ce347aab57eb5d6d931bfbbe7a7b",
10
- "platform/platform-service.mjs": "86336e4a2a496f1da5d285a055ed80d4703dfccba79c7ee51a4d7b9756a17848",
11
- "platform/platform.d.mts": "d3a4542667006d41bc6d7f96ba3d662757b20a89f54f3f341459d89bc4b5194d",
12
- "platform/platform.mjs": "0c32833b7e2c506a49c551d8fa1d305b69658d674ac00f3101e78339a3779f9a",
13
- "platform/save.d.mts": "2a0b8d298cf864b0c6c1e91bd1f30733f2d604cfed94fbdca1ce24b66afd597f",
14
- "platform/save.mjs": "beec18ac7561ffd18da559f69ed5b3120750e368c094556ef28a46e4e59b698a",
15
- "tooling/cli.mjs": "f42faeb151f15a58c914bc3301cdd904f11f610629bc71d7aaf07ddb59369880",
16
- "tooling/project.d.mts": "4814b60c19c1eccd52100d93a3a1aec2001c5b06dda800f8c2e1715f9a2e2ff8",
17
- "tooling/project.mjs": "f6a0dda684df4edddd48ac42c05796421824517848da28cda49fe70160fabcc9",
18
- "tooling/vite.d.mts": "18e6c0bf44bc744cbc6b489c916364181c1f1ebfe4c90d9ca4cd39c05d0b6c33",
19
- "tooling/vite.mjs": "6a432046da98c1049a0fe7509585cee98511e6159448f9b9605c0c17b5686a5d",
20
- "tools/assets.d.mts": "50111c87e3c639383df7900c88540e91b564e560c4411b9d0292712de3712628",
21
- "tools/assets.mjs": "2f49509e8ea4414be53e4103668b34d14f189e11b011a804e75dc8f323cdd8c4",
22
- "tools/astc.d.mts": "24416261df0bbfc9a22ec010eb6857bea6ee39703e6e62caf183c2adbe45cd86",
23
- "tools/astc.mjs": "f95d04d42d7dc4d838ef1ca785f116901219f6bbd9e14a762d81b0c494091720",
24
- "tools/audio.d.mts": "8f1464fa1434c78f04b07c7e1fe9e08d8a2d5fe6b9a36003aec9c67804ab0f63",
25
- "tools/audio.mjs": "ca13c3b51a20a91321f6953d9ebac62ff52f53fdb31924e7a59225ff1b04f8bd",
26
- "tools/canvas.d.mts": "4d9b58336c4d7f762e6259e677d3e43098e9c29e9083e99ff1ad9234baebad11",
27
- "tools/canvas.mjs": "dd3a773ede34e99d1b554bf187c0ec8c4244f3787618dab1de3cf22c18504892",
28
- "tools/glb.d.mts": "9c221722bb9464da819d0967774e0bea2dd5d1520fad2c11532f0c71939fec47",
29
- "tools/glb.mjs": "4e4386543ca125b78b63ec0bb0bea667d08428edcfa16ea6e07a110b61642b47",
30
- "tools/input.d.mts": "f5f3149d42546943afcc47ae46b2146afddf299d2531920f5f0fed0a1ffd4324",
31
- "tools/input.mjs": "c0c780a58dfb3c07492c5b6dc0fd211ed2114c0a7c0e00293537af9f49abb61c",
32
- "tools/three.d.mts": "865f536aaa32fd02c54ce0ead6742c84e021c6e5537fe3cdcadc726a854fa5d3",
33
- "tools/three.mjs": "af55b115d1e0dce80837a3346cf44cd0298848781f867ca0c9d1a894a6cd5a99",
34
- "tools/ui.d.mts": "c990c47e978312cc12995db778936bc446dd210d6dc6e163f8192415150eb2ce",
35
- "tools/ui.mjs": "49e12c1c4883e3d370b19a565fba414282fd18e65cdb48d7bc6dabc16864888b",
36
- "tools/video.d.mts": "3cef5b097e883bc7f1aea088e34da8b466777238c22dde55bbf0d5a8fad07f66",
37
- "tools/video.mjs": "22a11153fae94cfa8d766de90d7e0f417383036e069af75ffcfa9628647eeaab"
38
- }
39
- }
@@ -1,2 +0,0 @@
1
- var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});import{resolve as resolve2}from"node:path";import{pathToFileURL}from"node:url";import{readFile,readdir,writeFile,rename,unlink}from"node:fs/promises";import{resolve,relative,isAbsolute,dirname,basename,join}from"node:path";import{createHash,randomUUID}from"node:crypto";var has=__name((value,key)=>Object.prototype.hasOwnProperty.call(value,key),"has");var record=__name(value=>value!==null&&typeof value==="object"&&!Array.isArray(value),"record");var equal=__name((a,b)=>typeof a===typeof b&&(typeof a==="number"?Math.abs(a-b)<1e-9:a===b),"equal");var colorPattern=/^#(?:[a-f\d]{3}|[a-f\d]{4}|[a-f\d]{6}|[a-f\d]{8})$/i;var reserved=new Set(["__proto__","prototype","constructor"]);function assertKey(key,label){if(!key||key.includes(".")||reserved.has(key))throw new TypeError(`${label}: config keys must be nonempty, safe and contain no dots (${key})`)}__name(assertKey,"assertKey");function inferControl(value,metadata={}){if(metadata.enabled===false||metadata.expose===false)return null;const kind=metadata.type??(typeof value==="number"?"number":typeof value==="boolean"?"boolean":typeof value==="string"&&colorPattern.test(value)?"color":void 0);if(!kind)return null;let control;switch(kind){case"int":case"float":case"number":case"num_slider":{if(typeof value!=="number"||!Number.isFinite(value))throw new TypeError("numeric controls require a finite numeric default");const span=Math.max(1,Math.abs(value)*2);const min=metadata.min??Math.min(0,value-span);const max=metadata.max??Math.max(1,value+span);const step=metadata.step??(kind==="int"||kind!=="float"&&Number.isInteger(value)?1:.01);if(![min,max,step].every(Number.isFinite)||min>max||step<=0||value<min||value>max)throw new TypeError("numeric min/max/step must be finite, contain the default, and step must be positive");control={type:"num_slider",default:value,min,max,step,unit:metadata.unit??""};if(kind==="int")control.integer=true;break}case"bool":case"boolean":case"switch":if(typeof value!=="boolean")throw new TypeError("switch controls require a boolean default");control={type:"switch",default:value};break;case"enum":case"dropdown":{const options=metadata.options?.map(option=>record(option)?{value:option.value,label:String(option.label??option.value)}:{value:option,label:String(option)});if(!options?.length||options.some(option=>!["string","number"].includes(typeof option.value))||new Set(options.map(option=>`${typeof option.value}:${option.value}`)).size!==options.length||!options.some(option=>equal(option.value,value)))throw new TypeError("dropdown options must be unique scalar values and contain the default");control={type:"dropdown",default:value,options};break}case"string":case"text":if(typeof value!=="string")throw new TypeError("text controls require a string default");control={type:"text",default:value};break;case"color":if(typeof value!=="string"||!colorPattern.test(value))throw new TypeError("color controls require a hexadecimal color default");control={type:"color",default:value,alpha:metadata.alpha??(value.length===5||value.length===9)};break;case"resource":if(typeof value!=="string")throw new TypeError("resource controls require a string default");control={type:"resource",default:value};for(const key of["category","subcategory","asset_type"])if(metadata[key]!==void 0)control[key]=metadata[key];break;default:throw new TypeError(`unsupported control type: ${kind}`)}return control}__name(inferControl,"inferControl");function validateControlValue(control,value){switch(control.type){case"num_slider":return typeof value==="number"&&Number.isFinite(value)&&value>=control.min&&value<=control.max&&(!control.integer||Number.isInteger(value));case"switch":return typeof value==="boolean";case"color":return typeof value==="string"&&colorPattern.test(value);case"dropdown":return control.options.some(option=>equal(option.value,value));case"text":case"resource":return typeof value==="string";default:return false}}__name(validateControlValue,"validateControlValue");function leaves(data,metadata,owner){if(!record(data)||!record(metadata))throw new TypeError(`${owner}: config and controls must be JSON objects`);const output=[];const seen=new Set;function walk(value,parts){if(Array.isArray(value))return;if(record(value)){for(const[key,child]of Object.entries(value)){assertKey(key,owner);walk(child,[...parts,key])}return}const path=parts.join(".");const meta=metadata[path]??{};if(!record(meta))throw new TypeError(`${owner}.${path}: controls metadata must be an object`);seen.add(path);try{const control=inferControl(value,meta);if(control)output.push({path,parts,control,meta,value})}catch(error){throw new TypeError(`${owner}.${path}: ${error.message}`)}}__name(walk,"walk");walk(data,[]);for(const key of Object.keys(metadata))if(!seen.has(key))throw new TypeError(`${owner}.${key}: control refers to a missing scalar field (arrays are not exposed)`);return output}__name(leaves,"leaves");function createConfigEntries(owner,data,metadata={},previous=[],options={}){assertKey(owner,"config filename");const oldBySchema=new Map((Array.isArray(previous)?previous:[]).map(item=>[item.schema,item]));return leaves(data,metadata,owner).map(({path,control,meta,value})=>{const schema=`${owner}.${path}`;const old=oldBySchema.get(schema);const oldControl=old?.control;let selected=value;let stale=oldControl?.previous_value;if(oldControl){const candidate=has(oldControl,"change_value")?oldControl.change_value:has(oldControl,"value")?oldControl.value:oldControl.default;const origin=has(oldControl,"origin")?oldControl.origin:oldControl.default;if(!equal(origin,value)&&equal(candidate,origin)){selected=value;stale=void 0}else if((control.type==="resource"||equal(origin,value))&&validateControlValue(control,candidate)){selected=candidate;if(!equal(candidate,value))stale=void 0}else if(!equal(candidate,value)){stale=candidate;options.onWarn?.(`${schema}: saved override is incompatible with the current default or constraints; using code default`)}}return{schema,enabled:old?.enabled!==false,title:meta.title??old?.title??path,description:meta.description??old?.description??"",locator:{tab:meta.tab??owner,group:meta.group??path.split(".")[0],priority:meta.priority??0},control:{...control,...control.type==="resource"?Object.fromEntries(["category","subcategory","asset_type"].filter(key=>control[key]===void 0&&oldControl?.[key]!==void 0).map(key=>[key,oldControl[key]])):{},origin:value,value:selected,...stale!==void 0?{previous_value:stale}:{}}}})}__name(createConfigEntries,"createConfigEntries");function projectPath(root,path){const target=resolve(root,path);const rel=relative(resolve(root),target);if(rel===".."||rel.startsWith(`..${process.platform==="win32"?"\\":"/"}`)||isAbsolute(rel))throw new Error(`Path escapes project: ${path}`);return target}__name(projectPath,"projectPath");async function readJson(path,fallback){try{return JSON.parse(await readFile(path,"utf8"))}catch(error){if(error.code==="ENOENT"&&fallback!==void 0)return fallback;throw new Error(`${path}: ${error.message}`,{cause:error})}}__name(readJson,"readJson");async function readProjectManifest(projectRoot){const root=resolve(projectRoot);const manifest=await readJson(join(root,"game-runtime.json"));if(typeof manifest.version!=="string"||!/^\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(manifest.version)||typeof manifest.root!=="string")throw new Error("game-runtime.json requires a fixed version and relative root");if(isAbsolute(manifest.root)||!manifest.root.startsWith("runtime/"))throw new Error("game-runtime.json root must be project-relative under runtime/");projectPath(root,manifest.root);projectPath(root,manifest.configs??"configs");return{...manifest,configs:manifest.configs??"configs",projectRoot:root}}__name(readProjectManifest,"readProjectManifest");async function verifyRuntime(projectRoot){const manifest=await readProjectManifest(projectRoot);const sdkRoot=projectPath(manifest.projectRoot,manifest.root);const release=await readJson(join(sdkRoot,"release.json"));if(release.version!==manifest.version||!release.files||typeof release.files!=="object")throw new Error("Runtime release does not match game-runtime.json");for(const[name,expected]of Object.entries(release.files)){const actual=createHash("sha256").update(await readFile(projectPath(sdkRoot,name))).digest("hex");if(actual!==expected)throw new Error(`Runtime ${release.version} integrity mismatch: ${name}. Restore this release or explicitly upgrade the project.`)}return{manifest,release}}__name(verifyRuntime,"verifyRuntime");async function readProjectConfigs(projectRoot){const manifest=await readProjectManifest(projectRoot);const configRoot=projectPath(manifest.projectRoot,manifest.configs);let files;try{files=await readdir(configRoot,{withFileTypes:true})}catch(error){if(error.code==="ENOENT")throw new Error(`Configured directory is missing: ${configRoot}. Existing panel values were not changed.`);throw error}const configs=[];for(const file of files.sort((a,b)=>a.name.localeCompare(b.name))){if(!file.isFile()||!file.name.endsWith(".json")||file.name.endsWith(".controls.json"))continue;const name=basename(file.name,".json");const path=join(configRoot,file.name);configs.push({name,path,metadataPath:join(configRoot,`${name}.controls.json`),data:await readJson(path),metadata:await readJson(join(configRoot,`${name}.controls.json`),{})})}const snapshotPath=join(manifest.projectRoot,"unified_data_control_config.json");const snapshot=await readJson(snapshotPath,[]);if(!Array.isArray(snapshot)&&!(snapshot&&typeof snapshot==="object"&&Object.keys(snapshot).length===0))throw new Error(`${snapshotPath}: expected a ConfigItem array`);return{manifest,configs,snapshotPath,snapshot:Array.isArray(snapshot)?snapshot:[]}}__name(readProjectConfigs,"readProjectConfigs");var exportQueues=new Map;function exportProjectConfig(projectRoot,options={}){const key=resolve(projectRoot);const previous=exportQueues.get(key)??Promise.resolve();const next=previous.catch(()=>{}).then(()=>writeProjectConfig(key,options));exportQueues.set(key,next);return next.finally(()=>{if(exportQueues.get(key)===next)exportQueues.delete(key)})}__name(exportProjectConfig,"exportProjectConfig");async function writeProjectConfig(projectRoot,options={}){const state=await readProjectConfigs(projectRoot);const warnings=[];const entries=state.configs.flatMap(config=>createConfigEntries(config.name,config.data,config.metadata,state.snapshot,{onWarn:__name(warning=>warnings.push(warning),"onWarn")}));const output=`${JSON.stringify(entries,null,2)}
2
- `;let current="";try{current=await readFile(state.snapshotPath,"utf8")}catch(error){if(error.code!=="ENOENT")throw error}if(current!==output){if(options.check)throw new Error("Configuration snapshot is stale. Run the export-config command before collecting the upload snapshot.");const temporary=`${state.snapshotPath}.${process.pid}.${randomUUID()}.tmp`;try{await writeFile(temporary,output,"utf8");await rename(temporary,state.snapshotPath)}finally{await unlink(temporary).catch(error=>{if(error.code!=="ENOENT")throw error})}}for(const warning of warnings)options.onWarn?.(warning);return{entries,warnings,changed:current!==output}}__name(writeProjectConfig,"writeProjectConfig");async function runCli(args=process.argv.slice(2)){const command=args[0]??"export-config";const projectIndex=args.indexOf("--project");if(projectIndex!==-1&&!args[projectIndex+1])throw new Error("--project requires a path");const project=resolve2(projectIndex===-1?process.cwd():args[projectIndex+1]);if(command==="verify"){const{release}=await verifyRuntime(project);console.log(`[LightGame] runtime ${release.version} verified`)}else if(command==="export-config"){await verifyRuntime(project);const result=await exportProjectConfig(project,{check:args.includes("--check"),onWarn:__name(warning=>console.warn(`[LightGame config] ${warning}`),"onWarn")});console.log(`[LightGame] ${result.entries.length} controls ${result.changed?"exported":"unchanged"}`)}else throw new Error(`Unknown runtime command: ${command}`)}__name(runCli,"runCli");if(process.argv[1]&&import.meta.url===pathToFileURL(resolve2(process.argv[1])).href){runCli().catch(error=>{console.error(`[LightGame] ${error.message}`);process.exitCode=1})}export{runCli};
@@ -1,8 +0,0 @@
1
- import type { ConfigEntry, ControlMetadata } from '../platform/config.mjs';
2
- export interface ProjectManifest { version: string; root: string; configs: string; projectRoot: string; cdnBase?: string; cli?: 'cli.mjs' | 'tooling/cli.mjs' }
3
- export function projectPath(root: string, path: string): string;
4
- export function readProjectManifest(root: string): Promise<ProjectManifest>;
5
- export function verifyRuntime(root: string): Promise<{ manifest: ProjectManifest; release: { version: string; files: Record<string, string> } }>;
6
- export function readProjectConfigs(root: string): Promise<{manifest: ProjectManifest; configs: Array<{name: string; path: string; metadataPath: string; data: object; metadata: Record<string, ControlMetadata>}>; snapshotPath: string; snapshot: ConfigEntry[]}>;
7
- export function exportProjectConfig(root: string, options?: {check?: boolean; onWarn?: (message: string) => void}): Promise<{entries: ConfigEntry[]; warnings: string[]; changed: boolean}>;
8
- export function resolvedProjectConfigs(root: string): Promise<Awaited<ReturnType<typeof readProjectConfigs>> & {resolved: Map<string, object>}>;
@@ -1,2 +0,0 @@
1
- var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});import{readFile,readdir,writeFile,rename,unlink}from"node:fs/promises";import{resolve,relative,isAbsolute,dirname,basename,join}from"node:path";import{createHash,randomUUID}from"node:crypto";function rewriteLibraryGlbMount(path){const value=String(path??"").trim();if(!value||/^(?:data:|blob:)/i.test(value))return value;const parts=value.match(/^([^?#]*)([?#].*)?$/);if(!parts)return value;const pathname=parts[1],rest=parts[2]??"";if(!/\.(?:glb|gltf)$/i.test(pathname))return value;if(pathname.startsWith("/Glb/Game/")||pathname.startsWith("Glb/Game/"))return value;if(pathname.startsWith("/Game/"))return`/Glb${pathname}${rest}`;if(pathname.startsWith("Game/"))return`Glb/${pathname}${rest}`;if(/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(value))try{const url=new URL(value);if(url.pathname.startsWith("/Game/")&&/\.(?:glb|gltf)$/i.test(url.pathname)){url.pathname=`/Glb${url.pathname}`;return url.href}}catch{}return value}__name(rewriteLibraryGlbMount,"rewriteLibraryGlbMount");function resolveAssetUrl(path,{cdnBaseUrl="",baseUrl}={}){const value=rewriteLibraryGlbMount(path);if(!value)throw new TypeError("Asset path must not be empty");if(/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(value))return value;const encoded=encodeURI(value).replace(/%25([\da-f]{2})/gi,"%$1");const localPrefix=/^(?:assets|game|res|cfg|fonts)\//.test(value);if(cdnBaseUrl&&!localPrefix&&(value.startsWith("/Game/")||value.startsWith("/Glb/")||!/^(?:\/|\.\.?\/)/.test(value))){return`${cdnBaseUrl.replace(/\/+$/,"")}/${encoded.replace(/^\/+/,"")}`}return baseUrl?new URL(encoded,baseUrl).href:encoded}__name(resolveAssetUrl,"resolveAssetUrl");var has=__name((value,key)=>Object.prototype.hasOwnProperty.call(value,key),"has");var record=__name(value=>value!==null&&typeof value==="object"&&!Array.isArray(value),"record");var equal=__name((a,b)=>typeof a===typeof b&&(typeof a==="number"?Math.abs(a-b)<1e-9:a===b),"equal");var colorPattern=/^#(?:[a-f\d]{3}|[a-f\d]{4}|[a-f\d]{6}|[a-f\d]{8})$/i;var reserved=new Set(["__proto__","prototype","constructor"]);function assertKey(key,label){if(!key||key.includes(".")||reserved.has(key))throw new TypeError(`${label}: config keys must be nonempty, safe and contain no dots (${key})`)}__name(assertKey,"assertKey");function normalizeAssetUrl(value,cdnBase="https://file.craft.qq.com"){const path=String(value??"").trim().replaceAll("\\","/");return path?resolveAssetUrl(path,{cdnBaseUrl:cdnBase}):""}__name(normalizeAssetUrl,"normalizeAssetUrl");function inferControl(value,metadata={}){if(metadata.enabled===false||metadata.expose===false)return null;const kind=metadata.type??(typeof value==="number"?"number":typeof value==="boolean"?"boolean":typeof value==="string"&&colorPattern.test(value)?"color":void 0);if(!kind)return null;let control;switch(kind){case"int":case"float":case"number":case"num_slider":{if(typeof value!=="number"||!Number.isFinite(value))throw new TypeError("numeric controls require a finite numeric default");const span=Math.max(1,Math.abs(value)*2);const min=metadata.min??Math.min(0,value-span);const max=metadata.max??Math.max(1,value+span);const step=metadata.step??(kind==="int"||kind!=="float"&&Number.isInteger(value)?1:.01);if(![min,max,step].every(Number.isFinite)||min>max||step<=0||value<min||value>max)throw new TypeError("numeric min/max/step must be finite, contain the default, and step must be positive");control={type:"num_slider",default:value,min,max,step,unit:metadata.unit??""};if(kind==="int")control.integer=true;break}case"bool":case"boolean":case"switch":if(typeof value!=="boolean")throw new TypeError("switch controls require a boolean default");control={type:"switch",default:value};break;case"enum":case"dropdown":{const options=metadata.options?.map(option=>record(option)?{value:option.value,label:String(option.label??option.value)}:{value:option,label:String(option)});if(!options?.length||options.some(option=>!["string","number"].includes(typeof option.value))||new Set(options.map(option=>`${typeof option.value}:${option.value}`)).size!==options.length||!options.some(option=>equal(option.value,value)))throw new TypeError("dropdown options must be unique scalar values and contain the default");control={type:"dropdown",default:value,options};break}case"string":case"text":if(typeof value!=="string")throw new TypeError("text controls require a string default");control={type:"text",default:value};break;case"color":if(typeof value!=="string"||!colorPattern.test(value))throw new TypeError("color controls require a hexadecimal color default");control={type:"color",default:value,alpha:metadata.alpha??(value.length===5||value.length===9)};break;case"resource":if(typeof value!=="string")throw new TypeError("resource controls require a string default");control={type:"resource",default:value};for(const key of["category","subcategory","asset_type"])if(metadata[key]!==void 0)control[key]=metadata[key];break;default:throw new TypeError(`unsupported control type: ${kind}`)}return control}__name(inferControl,"inferControl");function validateControlValue(control,value){switch(control.type){case"num_slider":return typeof value==="number"&&Number.isFinite(value)&&value>=control.min&&value<=control.max&&(!control.integer||Number.isInteger(value));case"switch":return typeof value==="boolean";case"color":return typeof value==="string"&&colorPattern.test(value);case"dropdown":return control.options.some(option=>equal(option.value,value));case"text":case"resource":return typeof value==="string";default:return false}}__name(validateControlValue,"validateControlValue");function leaves(data,metadata,owner){if(!record(data)||!record(metadata))throw new TypeError(`${owner}: config and controls must be JSON objects`);const output=[];const seen=new Set;function walk(value,parts){if(Array.isArray(value))return;if(record(value)){for(const[key,child]of Object.entries(value)){assertKey(key,owner);walk(child,[...parts,key])}return}const path=parts.join(".");const meta=metadata[path]??{};if(!record(meta))throw new TypeError(`${owner}.${path}: controls metadata must be an object`);seen.add(path);try{const control=inferControl(value,meta);if(control)output.push({path,parts,control,meta,value})}catch(error){throw new TypeError(`${owner}.${path}: ${error.message}`)}}__name(walk,"walk");walk(data,[]);for(const key of Object.keys(metadata))if(!seen.has(key))throw new TypeError(`${owner}.${key}: control refers to a missing scalar field (arrays are not exposed)`);return output}__name(leaves,"leaves");function createConfigEntries(owner,data,metadata={},previous=[],options={}){assertKey(owner,"config filename");const oldBySchema=new Map((Array.isArray(previous)?previous:[]).map(item=>[item.schema,item]));return leaves(data,metadata,owner).map(({path,control,meta,value})=>{const schema=`${owner}.${path}`;const old=oldBySchema.get(schema);const oldControl=old?.control;let selected=value;let stale=oldControl?.previous_value;if(oldControl){const candidate=has(oldControl,"change_value")?oldControl.change_value:has(oldControl,"value")?oldControl.value:oldControl.default;const origin=has(oldControl,"origin")?oldControl.origin:oldControl.default;if(!equal(origin,value)&&equal(candidate,origin)){selected=value;stale=void 0}else if((control.type==="resource"||equal(origin,value))&&validateControlValue(control,candidate)){selected=candidate;if(!equal(candidate,value))stale=void 0}else if(!equal(candidate,value)){stale=candidate;options.onWarn?.(`${schema}: saved override is incompatible with the current default or constraints; using code default`)}}return{schema,enabled:old?.enabled!==false,title:meta.title??old?.title??path,description:meta.description??old?.description??"",locator:{tab:meta.tab??owner,group:meta.group??path.split(".")[0],priority:meta.priority??0},control:{...control,...control.type==="resource"?Object.fromEntries(["category","subcategory","asset_type"].filter(key=>control[key]===void 0&&oldControl?.[key]!==void 0).map(key=>[key,oldControl[key]])):{},origin:value,value:selected,...stale!==void 0?{previous_value:stale}:{}}}})}__name(createConfigEntries,"createConfigEntries");function resolveConfig(owner,data,metadata={},entries=[],options={}){const result=JSON.parse(JSON.stringify(data));const index=new Map((Array.isArray(entries)?entries:[]).map(item=>[item.schema,item]));for(const{path,parts,control,value}of leaves(data,metadata,owner)){const item=index.get(`${owner}.${path}`);let selected=value;if(item?.enabled!==false&&item?.control){const stored=item.control;const candidate=has(stored,"change_value")?stored.change_value:has(stored,"value")?stored.value:stored.default;const origin=has(stored,"origin")?stored.origin:stored.default;if(!equal(origin,value)&&equal(candidate,origin))selected=value;else if((control.type==="resource"||equal(origin,value))&&validateControlValue(control,candidate))selected=candidate;else options.onWarn?.(`${owner}.${path}: ignored incompatible saved override`)}if(control.type==="resource")selected=normalizeAssetUrl(selected,options.cdnBase);let parent=result;for(const key of parts.slice(0,-1))parent=parent[key];parent[parts.at(-1)]=selected}return result}__name(resolveConfig,"resolveConfig");function projectPath(root,path){const target=resolve(root,path);const rel=relative(resolve(root),target);if(rel===".."||rel.startsWith(`..${process.platform==="win32"?"\\":"/"}`)||isAbsolute(rel))throw new Error(`Path escapes project: ${path}`);return target}__name(projectPath,"projectPath");async function readJson(path,fallback){try{return JSON.parse(await readFile(path,"utf8"))}catch(error){if(error.code==="ENOENT"&&fallback!==void 0)return fallback;throw new Error(`${path}: ${error.message}`,{cause:error})}}__name(readJson,"readJson");async function readProjectManifest(projectRoot){const root=resolve(projectRoot);const manifest=await readJson(join(root,"game-runtime.json"));if(typeof manifest.version!=="string"||!/^\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(manifest.version)||typeof manifest.root!=="string")throw new Error("game-runtime.json requires a fixed version and relative root");if(isAbsolute(manifest.root)||!manifest.root.startsWith("runtime/"))throw new Error("game-runtime.json root must be project-relative under runtime/");projectPath(root,manifest.root);projectPath(root,manifest.configs??"configs");return{...manifest,configs:manifest.configs??"configs",projectRoot:root}}__name(readProjectManifest,"readProjectManifest");async function verifyRuntime(projectRoot){const manifest=await readProjectManifest(projectRoot);const sdkRoot=projectPath(manifest.projectRoot,manifest.root);const release=await readJson(join(sdkRoot,"release.json"));if(release.version!==manifest.version||!release.files||typeof release.files!=="object")throw new Error("Runtime release does not match game-runtime.json");for(const[name,expected]of Object.entries(release.files)){const actual=createHash("sha256").update(await readFile(projectPath(sdkRoot,name))).digest("hex");if(actual!==expected)throw new Error(`Runtime ${release.version} integrity mismatch: ${name}. Restore this release or explicitly upgrade the project.`)}return{manifest,release}}__name(verifyRuntime,"verifyRuntime");async function readProjectConfigs(projectRoot){const manifest=await readProjectManifest(projectRoot);const configRoot=projectPath(manifest.projectRoot,manifest.configs);let files;try{files=await readdir(configRoot,{withFileTypes:true})}catch(error){if(error.code==="ENOENT")throw new Error(`Configured directory is missing: ${configRoot}. Existing panel values were not changed.`);throw error}const configs=[];for(const file of files.sort((a,b)=>a.name.localeCompare(b.name))){if(!file.isFile()||!file.name.endsWith(".json")||file.name.endsWith(".controls.json"))continue;const name=basename(file.name,".json");const path=join(configRoot,file.name);configs.push({name,path,metadataPath:join(configRoot,`${name}.controls.json`),data:await readJson(path),metadata:await readJson(join(configRoot,`${name}.controls.json`),{})})}const snapshotPath=join(manifest.projectRoot,"unified_data_control_config.json");const snapshot=await readJson(snapshotPath,[]);if(!Array.isArray(snapshot)&&!(snapshot&&typeof snapshot==="object"&&Object.keys(snapshot).length===0))throw new Error(`${snapshotPath}: expected a ConfigItem array`);return{manifest,configs,snapshotPath,snapshot:Array.isArray(snapshot)?snapshot:[]}}__name(readProjectConfigs,"readProjectConfigs");var exportQueues=new Map;function exportProjectConfig(projectRoot,options={}){const key=resolve(projectRoot);const previous=exportQueues.get(key)??Promise.resolve();const next=previous.catch(()=>{}).then(()=>writeProjectConfig(key,options));exportQueues.set(key,next);return next.finally(()=>{if(exportQueues.get(key)===next)exportQueues.delete(key)})}__name(exportProjectConfig,"exportProjectConfig");async function writeProjectConfig(projectRoot,options={}){const state=await readProjectConfigs(projectRoot);const warnings=[];const entries=state.configs.flatMap(config=>createConfigEntries(config.name,config.data,config.metadata,state.snapshot,{onWarn:__name(warning=>warnings.push(warning),"onWarn")}));const output=`${JSON.stringify(entries,null,2)}
2
- `;let current="";try{current=await readFile(state.snapshotPath,"utf8")}catch(error){if(error.code!=="ENOENT")throw error}if(current!==output){if(options.check)throw new Error("Configuration snapshot is stale. Run the export-config command before collecting the upload snapshot.");const temporary=`${state.snapshotPath}.${process.pid}.${randomUUID()}.tmp`;try{await writeFile(temporary,output,"utf8");await rename(temporary,state.snapshotPath)}finally{await unlink(temporary).catch(error=>{if(error.code!=="ENOENT")throw error})}}for(const warning of warnings)options.onWarn?.(warning);return{entries,warnings,changed:current!==output}}__name(writeProjectConfig,"writeProjectConfig");async function resolvedProjectConfigs(projectRoot){const state=await readProjectConfigs(projectRoot);return{...state,resolved:new Map(state.configs.map(config=>[resolve(config.path),resolveConfig(config.name,config.data,config.metadata,state.snapshot,{cdnBase:state.manifest.cdnBase})]))}}__name(resolvedProjectConfigs,"resolvedProjectConfigs");export{exportProjectConfig,projectPath,readProjectConfigs,readProjectManifest,resolvedProjectConfigs,verifyRuntime};
@@ -1,3 +0,0 @@
1
- import type { Plugin } from 'vite';
2
- export interface LightgamePluginOptions { entry?: string; profile?: boolean }
3
- export function lightgame(options?: LightgamePluginOptions): Plugin;
@@ -1,7 +0,0 @@
1
- var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});import{resolve as resolve2,relative as relative2,join as join2}from"node:path";import{createRequire}from"node:module";import{readFile as readFile2,writeFile as writeFile2}from"node:fs/promises";import{readFile,readdir,writeFile,rename,unlink}from"node:fs/promises";import{resolve,relative,isAbsolute,dirname,basename,join}from"node:path";import{createHash,randomUUID}from"node:crypto";function rewriteLibraryGlbMount(path){const value=String(path??"").trim();if(!value||/^(?:data:|blob:)/i.test(value))return value;const parts=value.match(/^([^?#]*)([?#].*)?$/);if(!parts)return value;const pathname=parts[1],rest=parts[2]??"";if(!/\.(?:glb|gltf)$/i.test(pathname))return value;if(pathname.startsWith("/Glb/Game/")||pathname.startsWith("Glb/Game/"))return value;if(pathname.startsWith("/Game/"))return`/Glb${pathname}${rest}`;if(pathname.startsWith("Game/"))return`Glb/${pathname}${rest}`;if(/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(value))try{const url=new URL(value);if(url.pathname.startsWith("/Game/")&&/\.(?:glb|gltf)$/i.test(url.pathname)){url.pathname=`/Glb${url.pathname}`;return url.href}}catch{}return value}__name(rewriteLibraryGlbMount,"rewriteLibraryGlbMount");function resolveAssetUrl(path,{cdnBaseUrl="",baseUrl}={}){const value=rewriteLibraryGlbMount(path);if(!value)throw new TypeError("Asset path must not be empty");if(/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(value))return value;const encoded=encodeURI(value).replace(/%25([\da-f]{2})/gi,"%$1");const localPrefix=/^(?:assets|game|res|cfg|fonts)\//.test(value);if(cdnBaseUrl&&!localPrefix&&(value.startsWith("/Game/")||value.startsWith("/Glb/")||!/^(?:\/|\.\.?\/)/.test(value))){return`${cdnBaseUrl.replace(/\/+$/,"")}/${encoded.replace(/^\/+/,"")}`}return baseUrl?new URL(encoded,baseUrl).href:encoded}__name(resolveAssetUrl,"resolveAssetUrl");var has=__name((value,key)=>Object.prototype.hasOwnProperty.call(value,key),"has");var record=__name(value=>value!==null&&typeof value==="object"&&!Array.isArray(value),"record");var equal=__name((a,b)=>typeof a===typeof b&&(typeof a==="number"?Math.abs(a-b)<1e-9:a===b),"equal");var colorPattern=/^#(?:[a-f\d]{3}|[a-f\d]{4}|[a-f\d]{6}|[a-f\d]{8})$/i;var reserved=new Set(["__proto__","prototype","constructor"]);function assertKey(key,label){if(!key||key.includes(".")||reserved.has(key))throw new TypeError(`${label}: config keys must be nonempty, safe and contain no dots (${key})`)}__name(assertKey,"assertKey");function normalizeAssetUrl(value,cdnBase="https://file.craft.qq.com"){const path=String(value??"").trim().replaceAll("\\","/");return path?resolveAssetUrl(path,{cdnBaseUrl:cdnBase}):""}__name(normalizeAssetUrl,"normalizeAssetUrl");function inferControl(value,metadata={}){if(metadata.enabled===false||metadata.expose===false)return null;const kind=metadata.type??(typeof value==="number"?"number":typeof value==="boolean"?"boolean":typeof value==="string"&&colorPattern.test(value)?"color":void 0);if(!kind)return null;let control;switch(kind){case"int":case"float":case"number":case"num_slider":{if(typeof value!=="number"||!Number.isFinite(value))throw new TypeError("numeric controls require a finite numeric default");const span=Math.max(1,Math.abs(value)*2);const min=metadata.min??Math.min(0,value-span);const max=metadata.max??Math.max(1,value+span);const step=metadata.step??(kind==="int"||kind!=="float"&&Number.isInteger(value)?1:.01);if(![min,max,step].every(Number.isFinite)||min>max||step<=0||value<min||value>max)throw new TypeError("numeric min/max/step must be finite, contain the default, and step must be positive");control={type:"num_slider",default:value,min,max,step,unit:metadata.unit??""};if(kind==="int")control.integer=true;break}case"bool":case"boolean":case"switch":if(typeof value!=="boolean")throw new TypeError("switch controls require a boolean default");control={type:"switch",default:value};break;case"enum":case"dropdown":{const options=metadata.options?.map(option=>record(option)?{value:option.value,label:String(option.label??option.value)}:{value:option,label:String(option)});if(!options?.length||options.some(option=>!["string","number"].includes(typeof option.value))||new Set(options.map(option=>`${typeof option.value}:${option.value}`)).size!==options.length||!options.some(option=>equal(option.value,value)))throw new TypeError("dropdown options must be unique scalar values and contain the default");control={type:"dropdown",default:value,options};break}case"string":case"text":if(typeof value!=="string")throw new TypeError("text controls require a string default");control={type:"text",default:value};break;case"color":if(typeof value!=="string"||!colorPattern.test(value))throw new TypeError("color controls require a hexadecimal color default");control={type:"color",default:value,alpha:metadata.alpha??(value.length===5||value.length===9)};break;case"resource":if(typeof value!=="string")throw new TypeError("resource controls require a string default");control={type:"resource",default:value};for(const key of["category","subcategory","asset_type"])if(metadata[key]!==void 0)control[key]=metadata[key];break;default:throw new TypeError(`unsupported control type: ${kind}`)}return control}__name(inferControl,"inferControl");function validateControlValue(control,value){switch(control.type){case"num_slider":return typeof value==="number"&&Number.isFinite(value)&&value>=control.min&&value<=control.max&&(!control.integer||Number.isInteger(value));case"switch":return typeof value==="boolean";case"color":return typeof value==="string"&&colorPattern.test(value);case"dropdown":return control.options.some(option=>equal(option.value,value));case"text":case"resource":return typeof value==="string";default:return false}}__name(validateControlValue,"validateControlValue");function leaves(data,metadata,owner){if(!record(data)||!record(metadata))throw new TypeError(`${owner}: config and controls must be JSON objects`);const output=[];const seen=new Set;function walk(value,parts){if(Array.isArray(value))return;if(record(value)){for(const[key,child]of Object.entries(value)){assertKey(key,owner);walk(child,[...parts,key])}return}const path=parts.join(".");const meta=metadata[path]??{};if(!record(meta))throw new TypeError(`${owner}.${path}: controls metadata must be an object`);seen.add(path);try{const control=inferControl(value,meta);if(control)output.push({path,parts,control,meta,value})}catch(error){throw new TypeError(`${owner}.${path}: ${error.message}`)}}__name(walk,"walk");walk(data,[]);for(const key of Object.keys(metadata))if(!seen.has(key))throw new TypeError(`${owner}.${key}: control refers to a missing scalar field (arrays are not exposed)`);return output}__name(leaves,"leaves");function createConfigEntries(owner,data,metadata={},previous=[],options={}){assertKey(owner,"config filename");const oldBySchema=new Map((Array.isArray(previous)?previous:[]).map(item=>[item.schema,item]));return leaves(data,metadata,owner).map(({path,control,meta,value})=>{const schema=`${owner}.${path}`;const old=oldBySchema.get(schema);const oldControl=old?.control;let selected=value;let stale=oldControl?.previous_value;if(oldControl){const candidate=has(oldControl,"change_value")?oldControl.change_value:has(oldControl,"value")?oldControl.value:oldControl.default;const origin=has(oldControl,"origin")?oldControl.origin:oldControl.default;if(!equal(origin,value)&&equal(candidate,origin)){selected=value;stale=void 0}else if((control.type==="resource"||equal(origin,value))&&validateControlValue(control,candidate)){selected=candidate;if(!equal(candidate,value))stale=void 0}else if(!equal(candidate,value)){stale=candidate;options.onWarn?.(`${schema}: saved override is incompatible with the current default or constraints; using code default`)}}return{schema,enabled:old?.enabled!==false,title:meta.title??old?.title??path,description:meta.description??old?.description??"",locator:{tab:meta.tab??owner,group:meta.group??path.split(".")[0],priority:meta.priority??0},control:{...control,...control.type==="resource"?Object.fromEntries(["category","subcategory","asset_type"].filter(key=>control[key]===void 0&&oldControl?.[key]!==void 0).map(key=>[key,oldControl[key]])):{},origin:value,value:selected,...stale!==void 0?{previous_value:stale}:{}}}})}__name(createConfigEntries,"createConfigEntries");function resolveConfig(owner,data,metadata={},entries=[],options={}){const result=JSON.parse(JSON.stringify(data));const index=new Map((Array.isArray(entries)?entries:[]).map(item=>[item.schema,item]));for(const{path,parts,control,value}of leaves(data,metadata,owner)){const item=index.get(`${owner}.${path}`);let selected=value;if(item?.enabled!==false&&item?.control){const stored=item.control;const candidate=has(stored,"change_value")?stored.change_value:has(stored,"value")?stored.value:stored.default;const origin=has(stored,"origin")?stored.origin:stored.default;if(!equal(origin,value)&&equal(candidate,origin))selected=value;else if((control.type==="resource"||equal(origin,value))&&validateControlValue(control,candidate))selected=candidate;else options.onWarn?.(`${owner}.${path}: ignored incompatible saved override`)}if(control.type==="resource")selected=normalizeAssetUrl(selected,options.cdnBase);let parent=result;for(const key of parts.slice(0,-1))parent=parent[key];parent[parts.at(-1)]=selected}return result}__name(resolveConfig,"resolveConfig");function projectPath(root,path){const target=resolve(root,path);const rel=relative(resolve(root),target);if(rel===".."||rel.startsWith(`..${process.platform==="win32"?"\\":"/"}`)||isAbsolute(rel))throw new Error(`Path escapes project: ${path}`);return target}__name(projectPath,"projectPath");async function readJson(path,fallback){try{return JSON.parse(await readFile(path,"utf8"))}catch(error){if(error.code==="ENOENT"&&fallback!==void 0)return fallback;throw new Error(`${path}: ${error.message}`,{cause:error})}}__name(readJson,"readJson");async function readProjectManifest(projectRoot){const root=resolve(projectRoot);const manifest=await readJson(join(root,"game-runtime.json"));if(typeof manifest.version!=="string"||!/^\d+\.\d+\.\d+(?:-[\w.-]+)?$/.test(manifest.version)||typeof manifest.root!=="string")throw new Error("game-runtime.json requires a fixed version and relative root");if(isAbsolute(manifest.root)||!manifest.root.startsWith("runtime/"))throw new Error("game-runtime.json root must be project-relative under runtime/");projectPath(root,manifest.root);projectPath(root,manifest.configs??"configs");return{...manifest,configs:manifest.configs??"configs",projectRoot:root}}__name(readProjectManifest,"readProjectManifest");async function verifyRuntime(projectRoot){const manifest=await readProjectManifest(projectRoot);const sdkRoot=projectPath(manifest.projectRoot,manifest.root);const release=await readJson(join(sdkRoot,"release.json"));if(release.version!==manifest.version||!release.files||typeof release.files!=="object")throw new Error("Runtime release does not match game-runtime.json");for(const[name,expected]of Object.entries(release.files)){const actual=createHash("sha256").update(await readFile(projectPath(sdkRoot,name))).digest("hex");if(actual!==expected)throw new Error(`Runtime ${release.version} integrity mismatch: ${name}. Restore this release or explicitly upgrade the project.`)}return{manifest,release}}__name(verifyRuntime,"verifyRuntime");async function readProjectConfigs(projectRoot){const manifest=await readProjectManifest(projectRoot);const configRoot=projectPath(manifest.projectRoot,manifest.configs);let files;try{files=await readdir(configRoot,{withFileTypes:true})}catch(error){if(error.code==="ENOENT")throw new Error(`Configured directory is missing: ${configRoot}. Existing panel values were not changed.`);throw error}const configs=[];for(const file of files.sort((a,b)=>a.name.localeCompare(b.name))){if(!file.isFile()||!file.name.endsWith(".json")||file.name.endsWith(".controls.json"))continue;const name=basename(file.name,".json");const path=join(configRoot,file.name);configs.push({name,path,metadataPath:join(configRoot,`${name}.controls.json`),data:await readJson(path),metadata:await readJson(join(configRoot,`${name}.controls.json`),{})})}const snapshotPath=join(manifest.projectRoot,"unified_data_control_config.json");const snapshot=await readJson(snapshotPath,[]);if(!Array.isArray(snapshot)&&!(snapshot&&typeof snapshot==="object"&&Object.keys(snapshot).length===0))throw new Error(`${snapshotPath}: expected a ConfigItem array`);return{manifest,configs,snapshotPath,snapshot:Array.isArray(snapshot)?snapshot:[]}}__name(readProjectConfigs,"readProjectConfigs");var exportQueues=new Map;function exportProjectConfig(projectRoot,options={}){const key=resolve(projectRoot);const previous=exportQueues.get(key)??Promise.resolve();const next=previous.catch(()=>{}).then(()=>writeProjectConfig(key,options));exportQueues.set(key,next);return next.finally(()=>{if(exportQueues.get(key)===next)exportQueues.delete(key)})}__name(exportProjectConfig,"exportProjectConfig");async function writeProjectConfig(projectRoot,options={}){const state=await readProjectConfigs(projectRoot);const warnings=[];const entries=state.configs.flatMap(config=>createConfigEntries(config.name,config.data,config.metadata,state.snapshot,{onWarn:__name(warning=>warnings.push(warning),"onWarn")}));const output=`${JSON.stringify(entries,null,2)}
2
- `;let current="";try{current=await readFile(state.snapshotPath,"utf8")}catch(error){if(error.code!=="ENOENT")throw error}if(current!==output){if(options.check)throw new Error("Configuration snapshot is stale. Run the export-config command before collecting the upload snapshot.");const temporary=`${state.snapshotPath}.${process.pid}.${randomUUID()}.tmp`;try{await writeFile(temporary,output,"utf8");await rename(temporary,state.snapshotPath)}finally{await unlink(temporary).catch(error=>{if(error.code!=="ENOENT")throw error})}}for(const warning of warnings)options.onWarn?.(warning);return{entries,warnings,changed:current!==output}}__name(writeProjectConfig,"writeProjectConfig");async function resolvedProjectConfigs(projectRoot){const state=await readProjectConfigs(projectRoot);return{...state,resolved:new Map(state.configs.map(config=>[resolve(config.path),resolveConfig(config.name,config.data,config.metadata,state.snapshot,{cdnBase:state.manifest.cdnBase})]))}}__name(resolvedProjectConfigs,"resolvedProjectConfigs");function lightgame(options={}){const virtualId="virtual:lightgame/bootstrap";const resolvedId=`\0${virtualId}`;let root,outDir,state,server;const entry=options.entry??"/src/main.ts";const asUrl=__name(path=>`/${relative2(root,path).replaceAll("\\","/")}`,"asUrl");const refresh=__name(async()=>{state=await resolvedProjectConfigs(root)},"refresh");return{name:"lightgame-platform",enforce:"pre",async configResolved(config){root=config.root;outDir=resolve2(root,config.build.outDir);await verifyRuntime(root);const packageJson=JSON.parse(await readFile2(join2(root,"package.json"),"utf8"));const require2=createRequire(join2(root,"package.json"));for(const dependency of["vite","three"]){const expected=packageJson.dependencies?.[dependency]??packageJson.devDependencies?.[dependency];if(!expected)continue;let actual;if(dependency==="three"){let path=require2.resolve("three");path=resolve2(path,"..","..","package.json");actual=JSON.parse(await readFile2(path,"utf8")).version}else actual=require2("vite/package.json").version;if(actual!==expected)throw new Error(`[LightGame] ${dependency} version mismatch: project requires ${expected}, toolchain provides ${actual}. Align the toolchain; do not silently fall back.`)}await exportProjectConfig(root,{onWarn:__name(message=>console.warn(`[LightGame config] ${message}`),"onWarn")});await refresh()},configureServer(value){server=value},resolveId(id){if(id===virtualId||id===`/${virtualId}`)return resolvedId},load(id){if(id!==resolvedId)return;const runtimeUrl=asUrl(resolve2(root,state.manifest.root,"platform/platform.mjs"));return`let bridge;
3
- try { const sdk = await import(${JSON.stringify(runtimeUrl)}); bridge = sdk.startPlatform(); } catch (error) { console.error('[LightGame] platform startup failed', error); }
4
- try { await import(${JSON.stringify(entry)}); } catch (error) { console.error('[LightGame] game startup failed', error); throw error; }
5
- if (import.meta.hot) import.meta.hot.dispose(() => bridge?.dispose());
6
- `},transformIndexHtml:{order:"pre",handler(html){let matched=0;const target=entry.replace(/^\.?\//,"");const transformed=html.replace(/<script\b([^>]*?)\bsrc\s*=\s*(["'])([^"']+)\2([^>]*)>\s*<\/script>/gi,(tag,before,quote,source,after)=>{if(source.replace(/^\.?\//,"")!==target)return tag;matched+=1;return`<script type="module" src="/${virtualId}"></script>`});if(matched!==1)throw new Error(`[LightGame] expected exactly one ${entry} module script in index.html, found ${matched}`);return transformed}},transform(code,id){const path=resolve2(id.split("?")[0]);const query=new URLSearchParams(id.includes("?")?id.slice(id.indexOf("?")+1):"");const data=state?.resolved.get(path);if(data!==void 0&&!query.has("raw")&&!query.has("url"))return{code:JSON.stringify(data),map:null}},async hotUpdate(context){if(this.environment.name!=="client")return;const path=resolve2(context.file);if(path===join2(root,"unified_data_control_config.json")||state.configs.some(config=>path===config.path||path===config.metadataPath)||path.startsWith(`${resolve2(root,state.manifest.configs)}/`)||path.startsWith(`${resolve2(root,state.manifest.configs)}\\`)){await exportProjectConfig(root,{onWarn:__name(message=>console.warn(`[LightGame config] ${message}`),"onWarn")});await refresh();server?.moduleGraph.invalidateAll();server?.ws.send({type:"full-reload"});return[]}},async closeBundle(){if(options.profile===false||!outDir)return;let html;try{html=await readFile2(join2(outDir,"index.html"),"utf8")}catch(error){if(error.code==="ENOENT")return;throw error}const tag='<script src="https://file.craft.qq.com/QA/profile_toolbox.js"></script>';await writeFile2(join2(outDir,"index_profile.html"),html.replace("</head>",` ${tag}
7
- </head>`),"utf8")}}}__name(lightgame,"lightgame");export{lightgame};