@craft_eco/craft-mcp 0.1.26 → 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 (1146) hide show
  1. package/README.md +15 -15
  2. package/bin/craft-mcp.mjs +1 -1
  3. package/dist-server/game-workflow/bundle-files.mjs +48 -43
  4. package/dist-server/game-workflow/check.mjs +3 -4
  5. package/dist-server/game-workflow/engines.mjs +16 -7
  6. package/dist-server/game-workflow/project-bundles.mjs +129 -90
  7. package/dist-server/game-workflow/project-context.mjs +97 -91
  8. package/dist-server/game-workflow/projects.mjs +13 -8
  9. package/dist-server/integrations/config.mjs +71 -71
  10. package/dist-server/integrations/files.mjs +54 -54
  11. package/dist-server/integrations/hosts.mjs +35 -30
  12. package/dist-server/integrations/install.mjs +86 -86
  13. package/dist-server/integrations/runtime.mjs +72 -71
  14. package/dist-server/mcp/server.mjs +6 -5
  15. package/dist-server/mcp/start.mjs +3 -1
  16. package/package.json +8 -10
  17. package/resources/craft-create/SKILL.md +3 -6
  18. package/resources/targets/codebuddy/js/bootstrap/SKILL.md +14 -0
  19. package/resources/targets/codebuddy/js/craft-game-maker/SKILL.md +77 -0
  20. package/resources/targets/codebuddy/js/craft-game-maker/js.md +10 -0
  21. package/resources/targets/codebuddy/js/js/bundle.json +99 -0
  22. package/resources/targets/codebuddy/js/js/context/AGENTS.md +25 -0
  23. package/resources/targets/codebuddy/js/js/context/hooks/hooks.json +14 -0
  24. package/resources/targets/codebuddy/js/js/context/knowledge/AigcWiring.md +9 -0
  25. package/resources/targets/codebuddy/js/js/context/knowledge/AssetUrl.md +9 -0
  26. package/resources/targets/codebuddy/js/js/context/knowledge/Layout.md +7 -0
  27. package/resources/targets/codebuddy/js/js/context/knowledge/Lifecycle.md +11 -0
  28. package/resources/targets/codebuddy/js/js/context/skills/aigc-generate/SKILL.md +14 -0
  29. package/resources/targets/codebuddy/js/js/context/skills/asset-search/SKILL.md +12 -0
  30. package/resources/targets/codebuddy/js/js/context/skills/asset-search/references/resource-config.md +9 -0
  31. package/resources/targets/codebuddy/js/js/context/skills/export-config/SKILL.md +16 -0
  32. package/resources/targets/codebuddy/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  33. package/resources/targets/codebuddy/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  34. package/resources/targets/codebuddy/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  35. package/resources/targets/codebuddy/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  36. package/resources/targets/codebuddy/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  37. package/resources/targets/codebuddy/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  38. package/resources/targets/codebuddy/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  39. package/resources/targets/codebuddy/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  40. package/resources/targets/codebuddy/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  41. package/resources/targets/codebuddy/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  42. package/resources/targets/codebuddy/js/js/context/skills/index.json +31 -0
  43. package/resources/targets/codebuddy/js/js/context/skills/visual-qa/SKILL.md +14 -0
  44. package/resources/targets/codebuddy/js/js/project/README.md +7 -0
  45. package/resources/targets/codebuddy/js/js/project/configs/assets.json +1 -0
  46. package/resources/targets/codebuddy/js/js/project/configs/game.controls.json +3 -0
  47. package/resources/targets/codebuddy/js/js/project/configs/game.json +3 -0
  48. package/resources/targets/codebuddy/js/js/project/game-runtime.json +7 -0
  49. package/resources/targets/codebuddy/js/js/project/game.config.json +7 -0
  50. package/resources/targets/codebuddy/js/js/project/index.html +20 -0
  51. package/resources/targets/codebuddy/js/js/project/package.json +22 -0
  52. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  53. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  54. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  55. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  56. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  57. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  58. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  59. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  60. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  61. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  62. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  63. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  64. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  65. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  66. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  67. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  68. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  69. package/resources/targets/codebuddy/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  70. package/resources/targets/codebuddy/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  71. package/resources/targets/codebuddy/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  72. package/resources/targets/codebuddy/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  73. package/resources/targets/codebuddy/js/js/project/scripts/config-export.mjs +13 -0
  74. package/resources/targets/codebuddy/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  75. package/resources/targets/codebuddy/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  76. package/resources/targets/codebuddy/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  77. package/resources/targets/codebuddy/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  78. package/resources/targets/codebuddy/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  79. package/resources/targets/codebuddy/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  80. package/resources/targets/codebuddy/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  81. package/resources/targets/codebuddy/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  82. package/resources/targets/codebuddy/js/js/project/scripts/write-preview-ready.mjs +22 -0
  83. package/resources/targets/codebuddy/js/js/project/src/display/ui-stage.ts +156 -0
  84. package/resources/targets/codebuddy/js/js/project/src/display/viewport.ts +249 -0
  85. package/resources/targets/codebuddy/js/js/project/src/main.ts +87 -0
  86. package/resources/targets/codebuddy/js/js/project/src/platform.ts +2 -0
  87. package/resources/targets/codebuddy/js/js/project/src/scenes/LoadScene.ts +89 -0
  88. package/resources/targets/codebuddy/js/js/project/src/scenes/PlayScene.ts +17 -0
  89. package/resources/targets/codebuddy/js/js/project/src/screenUi.ts +185 -0
  90. package/resources/targets/codebuddy/js/js/project/src/style.css +294 -0
  91. package/resources/targets/codebuddy/js/js/project/tsconfig.json +20 -0
  92. package/resources/targets/codebuddy/js/js/project/unified_data_control_config.json +20 -0
  93. package/resources/targets/codebuddy/js/js/project/vite.config.ts +5 -0
  94. package/resources/targets/codebuddy/js/recovery.md +7 -0
  95. package/resources/targets/codebuddy/js/target.json +61 -0
  96. package/resources/targets/codebuddy/js3d/bootstrap/SKILL.md +14 -0
  97. package/resources/targets/codebuddy/js3d/craft-game-maker/SKILL.md +77 -0
  98. package/resources/targets/codebuddy/js3d/craft-game-maker/js3d.md +13 -0
  99. package/resources/targets/codebuddy/js3d/js3d/bundle.json +110 -0
  100. package/resources/targets/codebuddy/js3d/js3d/context/AGENTS.md +26 -0
  101. package/resources/targets/codebuddy/js3d/js3d/context/hooks/hooks.json +14 -0
  102. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AigcWiring.md +9 -0
  103. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  104. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  105. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/Layout.md +7 -0
  106. package/resources/targets/codebuddy/js3d/js3d/context/knowledge/Runtime.md +9 -0
  107. package/resources/targets/codebuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +14 -0
  108. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-search/SKILL.md +12 -0
  109. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md +11 -0
  110. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  111. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  112. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  113. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  114. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  115. package/resources/targets/codebuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  116. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  117. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  118. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  119. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  120. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  121. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  122. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  123. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  124. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  125. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  126. package/resources/targets/codebuddy/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  127. package/resources/targets/codebuddy/js3d/js3d/context/skills/index.json +43 -0
  128. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  129. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  130. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  131. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  132. package/resources/targets/codebuddy/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  133. package/resources/targets/codebuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  134. package/resources/targets/codebuddy/js3d/js3d/project/README.md +7 -0
  135. package/resources/targets/codebuddy/js3d/js3d/project/configs/game.controls.json +3 -0
  136. package/resources/targets/codebuddy/js3d/js3d/project/configs/game.json +3 -0
  137. package/resources/targets/codebuddy/js3d/js3d/project/game-runtime.json +7 -0
  138. package/resources/targets/codebuddy/js3d/js3d/project/game.config.json +7 -0
  139. package/resources/targets/codebuddy/js3d/js3d/project/index.html +12 -0
  140. package/resources/targets/codebuddy/js3d/js3d/project/package.json +23 -0
  141. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  142. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  143. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  144. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  145. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  146. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  147. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  148. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  149. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  150. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  151. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  152. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  153. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  154. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  155. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  156. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  157. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  158. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  159. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  160. package/resources/targets/codebuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  161. package/resources/targets/codebuddy/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  162. package/resources/targets/codebuddy/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  163. package/resources/targets/codebuddy/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  164. package/resources/targets/codebuddy/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  165. package/resources/targets/codebuddy/js3d/js3d/project/scripts/config-export.mjs +15 -0
  166. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  167. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  168. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  169. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  170. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  171. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  172. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  173. package/resources/targets/codebuddy/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  174. package/resources/targets/codebuddy/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  175. package/resources/targets/codebuddy/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  176. package/resources/targets/codebuddy/js3d/js3d/project/src/display/viewport.ts +239 -0
  177. package/resources/targets/codebuddy/js3d/js3d/project/src/main.ts +85 -0
  178. package/resources/targets/codebuddy/js3d/js3d/project/src/platform.ts +2 -0
  179. package/resources/targets/codebuddy/js3d/js3d/project/src/style.css +83 -0
  180. package/resources/targets/codebuddy/js3d/js3d/project/tsconfig.json +20 -0
  181. package/resources/targets/codebuddy/js3d/js3d/project/unified_data_control_config.json +20 -0
  182. package/resources/targets/codebuddy/js3d/js3d/project/vite.config.ts +5 -0
  183. package/resources/targets/codebuddy/js3d/recovery.md +7 -0
  184. package/resources/targets/codebuddy/js3d/target.json +60 -0
  185. package/resources/targets/codex/js/bootstrap/SKILL.md +14 -0
  186. package/resources/targets/codex/js/craft-game-maker/SKILL.md +77 -0
  187. package/resources/targets/codex/js/craft-game-maker/js.md +10 -0
  188. package/resources/targets/codex/js/js/bundle.json +99 -0
  189. package/resources/targets/codex/js/js/context/AGENTS.md +25 -0
  190. package/resources/targets/codex/js/js/context/hooks/hooks.json +14 -0
  191. package/resources/targets/codex/js/js/context/knowledge/AigcWiring.md +9 -0
  192. package/resources/targets/codex/js/js/context/knowledge/AssetUrl.md +9 -0
  193. package/resources/targets/codex/js/js/context/knowledge/Layout.md +7 -0
  194. package/resources/targets/codex/js/js/context/knowledge/Lifecycle.md +11 -0
  195. package/resources/targets/codex/js/js/context/skills/aigc-generate/SKILL.md +14 -0
  196. package/resources/targets/codex/js/js/context/skills/asset-search/SKILL.md +12 -0
  197. package/resources/targets/codex/js/js/context/skills/asset-search/references/resource-config.md +9 -0
  198. package/resources/targets/codex/js/js/context/skills/export-config/SKILL.md +16 -0
  199. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  200. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  201. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  202. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  203. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  204. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  205. package/resources/targets/codex/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  206. package/resources/targets/codex/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  207. package/resources/targets/codex/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  208. package/resources/targets/codex/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  209. package/resources/targets/codex/js/js/context/skills/index.json +31 -0
  210. package/resources/targets/codex/js/js/context/skills/visual-qa/SKILL.md +14 -0
  211. package/resources/targets/codex/js/js/project/README.md +7 -0
  212. package/resources/targets/codex/js/js/project/configs/assets.json +1 -0
  213. package/resources/targets/codex/js/js/project/configs/game.controls.json +3 -0
  214. package/resources/targets/codex/js/js/project/configs/game.json +3 -0
  215. package/resources/targets/codex/js/js/project/game-runtime.json +7 -0
  216. package/resources/targets/codex/js/js/project/game.config.json +7 -0
  217. package/resources/targets/codex/js/js/project/index.html +20 -0
  218. package/resources/targets/codex/js/js/project/package.json +22 -0
  219. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  220. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  221. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  222. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  223. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  224. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  225. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  226. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  227. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  228. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  229. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  230. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  231. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  232. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  233. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  234. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  235. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  236. package/resources/targets/codex/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  237. package/resources/targets/codex/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  238. package/resources/targets/codex/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  239. package/resources/targets/codex/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  240. package/resources/targets/codex/js/js/project/scripts/config-export.mjs +13 -0
  241. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  242. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  243. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  244. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  245. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  246. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  247. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  248. package/resources/targets/codex/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  249. package/resources/targets/codex/js/js/project/scripts/write-preview-ready.mjs +22 -0
  250. package/resources/targets/codex/js/js/project/src/display/ui-stage.ts +156 -0
  251. package/resources/targets/codex/js/js/project/src/display/viewport.ts +249 -0
  252. package/resources/targets/codex/js/js/project/src/main.ts +87 -0
  253. package/resources/targets/codex/js/js/project/src/platform.ts +2 -0
  254. package/resources/targets/codex/js/js/project/src/scenes/LoadScene.ts +89 -0
  255. package/resources/targets/codex/js/js/project/src/scenes/PlayScene.ts +17 -0
  256. package/resources/targets/codex/js/js/project/src/screenUi.ts +185 -0
  257. package/resources/targets/codex/js/js/project/src/style.css +294 -0
  258. package/resources/targets/codex/js/js/project/tsconfig.json +20 -0
  259. package/resources/targets/codex/js/js/project/unified_data_control_config.json +20 -0
  260. package/resources/targets/codex/js/js/project/vite.config.ts +5 -0
  261. package/resources/targets/codex/js/recovery.md +7 -0
  262. package/resources/targets/codex/js/target.json +61 -0
  263. package/resources/targets/codex/js3d/bootstrap/SKILL.md +14 -0
  264. package/resources/targets/codex/js3d/craft-game-maker/SKILL.md +77 -0
  265. package/resources/targets/codex/js3d/craft-game-maker/js3d.md +13 -0
  266. package/resources/targets/codex/js3d/js3d/bundle.json +110 -0
  267. package/resources/targets/codex/js3d/js3d/context/AGENTS.md +26 -0
  268. package/resources/targets/codex/js3d/js3d/context/hooks/hooks.json +14 -0
  269. package/resources/targets/codex/js3d/js3d/context/knowledge/AigcWiring.md +9 -0
  270. package/resources/targets/codex/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  271. package/resources/targets/codex/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  272. package/resources/targets/codex/js3d/js3d/context/knowledge/Layout.md +7 -0
  273. package/resources/targets/codex/js3d/js3d/context/knowledge/Runtime.md +9 -0
  274. package/resources/targets/codex/js3d/js3d/context/skills/aigc-integration/SKILL.md +14 -0
  275. package/resources/targets/codex/js3d/js3d/context/skills/asset-search/SKILL.md +12 -0
  276. package/resources/targets/codex/js3d/js3d/context/skills/asset-search/references/resource-config.md +11 -0
  277. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  278. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  279. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  280. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  281. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  282. package/resources/targets/codex/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  283. package/resources/targets/codex/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  284. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  285. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  286. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  287. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  288. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  289. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  290. package/resources/targets/codex/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  291. package/resources/targets/codex/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  292. package/resources/targets/codex/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  293. package/resources/targets/codex/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  294. package/resources/targets/codex/js3d/js3d/context/skills/index.json +43 -0
  295. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  296. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  297. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  298. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  299. package/resources/targets/codex/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  300. package/resources/targets/codex/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  301. package/resources/targets/codex/js3d/js3d/project/README.md +7 -0
  302. package/resources/targets/codex/js3d/js3d/project/configs/game.controls.json +3 -0
  303. package/resources/targets/codex/js3d/js3d/project/configs/game.json +3 -0
  304. package/resources/targets/codex/js3d/js3d/project/game-runtime.json +7 -0
  305. package/resources/targets/codex/js3d/js3d/project/game.config.json +7 -0
  306. package/resources/targets/codex/js3d/js3d/project/index.html +12 -0
  307. package/resources/targets/codex/js3d/js3d/project/package.json +23 -0
  308. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  309. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  310. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  311. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  312. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  313. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  314. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  315. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  316. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  317. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  318. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  319. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  320. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  321. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  322. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  323. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  324. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  325. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  326. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  327. package/resources/targets/codex/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  328. package/resources/targets/codex/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  329. package/resources/targets/codex/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  330. package/resources/targets/codex/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  331. package/resources/targets/codex/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  332. package/resources/targets/codex/js3d/js3d/project/scripts/config-export.mjs +15 -0
  333. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  334. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  335. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  336. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  337. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  338. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  339. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  340. package/resources/targets/codex/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  341. package/resources/targets/codex/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  342. package/resources/targets/codex/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  343. package/resources/targets/codex/js3d/js3d/project/src/display/viewport.ts +239 -0
  344. package/resources/targets/codex/js3d/js3d/project/src/main.ts +85 -0
  345. package/resources/targets/codex/js3d/js3d/project/src/platform.ts +2 -0
  346. package/resources/targets/codex/js3d/js3d/project/src/style.css +83 -0
  347. package/resources/targets/codex/js3d/js3d/project/tsconfig.json +20 -0
  348. package/resources/targets/codex/js3d/js3d/project/unified_data_control_config.json +20 -0
  349. package/resources/targets/codex/js3d/js3d/project/vite.config.ts +5 -0
  350. package/resources/targets/codex/js3d/recovery.md +7 -0
  351. package/resources/targets/codex/js3d/target.json +60 -0
  352. package/resources/targets/index.json +41 -0
  353. package/resources/targets/workbuddy/js/bootstrap/SKILL.md +14 -0
  354. package/resources/targets/workbuddy/js/craft-game-maker/SKILL.md +77 -0
  355. package/resources/targets/workbuddy/js/craft-game-maker/js.md +10 -0
  356. package/resources/targets/workbuddy/js/js/bundle.json +99 -0
  357. package/resources/targets/workbuddy/js/js/context/AGENTS.md +25 -0
  358. package/resources/targets/workbuddy/js/js/context/hooks/hooks.json +14 -0
  359. package/resources/targets/workbuddy/js/js/context/knowledge/AigcWiring.md +9 -0
  360. package/resources/targets/workbuddy/js/js/context/knowledge/AssetUrl.md +9 -0
  361. package/resources/targets/workbuddy/js/js/context/knowledge/Layout.md +7 -0
  362. package/resources/targets/workbuddy/js/js/context/knowledge/Lifecycle.md +11 -0
  363. package/resources/targets/workbuddy/js/js/context/skills/aigc-generate/SKILL.md +14 -0
  364. package/resources/targets/workbuddy/js/js/context/skills/asset-search/SKILL.md +12 -0
  365. package/resources/targets/workbuddy/js/js/context/skills/asset-search/references/resource-config.md +9 -0
  366. package/resources/targets/workbuddy/js/js/context/skills/export-config/SKILL.md +16 -0
  367. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  368. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  369. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/config.mjs +1 -0
  370. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  371. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/project.mjs +77 -0
  372. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  373. package/resources/targets/workbuddy/js/js/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  374. package/resources/targets/workbuddy/js/js/context/skills/export-config/scripts/export-config.mjs +4 -0
  375. package/resources/targets/workbuddy/js/js/context/skills/export-config/scripts/install.mjs +89 -0
  376. package/resources/targets/workbuddy/js/js/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  377. package/resources/targets/workbuddy/js/js/context/skills/index.json +31 -0
  378. package/resources/targets/workbuddy/js/js/context/skills/visual-qa/SKILL.md +14 -0
  379. package/resources/targets/workbuddy/js/js/project/README.md +7 -0
  380. package/resources/targets/workbuddy/js/js/project/configs/assets.json +1 -0
  381. package/resources/targets/workbuddy/js/js/project/configs/game.controls.json +3 -0
  382. package/resources/targets/workbuddy/js/js/project/configs/game.json +3 -0
  383. package/resources/targets/workbuddy/js/js/project/game-runtime.json +7 -0
  384. package/resources/targets/workbuddy/js/js/project/game.config.json +7 -0
  385. package/resources/targets/workbuddy/js/js/project/index.html +20 -0
  386. package/resources/targets/workbuddy/js/js/project/package.json +22 -0
  387. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  388. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  389. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  390. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  391. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  392. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  393. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  394. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/platform/platform.mjs +29 -0
  395. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/release.json +22 -0
  396. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  397. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  398. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  399. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  400. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  401. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  402. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  403. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  404. package/resources/targets/workbuddy/js/js/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  405. package/resources/targets/workbuddy/js/js/project/scripts/config-export/assert-asset-wiring.mjs +72 -0
  406. package/resources/targets/workbuddy/js/js/project/scripts/config-export/panel-resource-path.mjs +106 -0
  407. package/resources/targets/workbuddy/js/js/project/scripts/config-export/sync-asset-controls.mjs +316 -0
  408. package/resources/targets/workbuddy/js/js/project/scripts/config-export.mjs +13 -0
  409. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  410. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  411. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/config.mjs +1 -0
  412. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/installed.json +6 -0
  413. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  414. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/project.mjs +77 -0
  415. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  416. package/resources/targets/workbuddy/js/js/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  417. package/resources/targets/workbuddy/js/js/project/scripts/write-preview-ready.mjs +22 -0
  418. package/resources/targets/workbuddy/js/js/project/src/display/ui-stage.ts +156 -0
  419. package/resources/targets/workbuddy/js/js/project/src/display/viewport.ts +249 -0
  420. package/resources/targets/workbuddy/js/js/project/src/main.ts +87 -0
  421. package/resources/targets/workbuddy/js/js/project/src/platform.ts +2 -0
  422. package/resources/targets/workbuddy/js/js/project/src/scenes/LoadScene.ts +89 -0
  423. package/resources/targets/workbuddy/js/js/project/src/scenes/PlayScene.ts +17 -0
  424. package/resources/targets/workbuddy/js/js/project/src/screenUi.ts +185 -0
  425. package/resources/targets/workbuddy/js/js/project/src/style.css +294 -0
  426. package/resources/targets/workbuddy/js/js/project/tsconfig.json +20 -0
  427. package/resources/targets/workbuddy/js/js/project/unified_data_control_config.json +20 -0
  428. package/resources/targets/workbuddy/js/js/project/vite.config.ts +5 -0
  429. package/resources/targets/workbuddy/js/recovery.md +7 -0
  430. package/resources/targets/workbuddy/js/target.json +61 -0
  431. package/resources/targets/workbuddy/js3d/bootstrap/SKILL.md +14 -0
  432. package/resources/targets/workbuddy/js3d/craft-game-maker/SKILL.md +77 -0
  433. package/resources/targets/workbuddy/js3d/craft-game-maker/js3d.md +13 -0
  434. package/resources/targets/workbuddy/js3d/js3d/bundle.json +110 -0
  435. package/resources/targets/workbuddy/js3d/js3d/context/AGENTS.md +26 -0
  436. package/resources/targets/workbuddy/js3d/js3d/context/hooks/hooks.json +14 -0
  437. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AigcWiring.md +9 -0
  438. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/AssetUrl.md +9 -0
  439. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/CodingGuide/Pitfalls.md +11 -0
  440. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/Layout.md +7 -0
  441. package/resources/targets/workbuddy/js3d/js3d/context/knowledge/Runtime.md +9 -0
  442. package/resources/targets/workbuddy/js3d/js3d/context/skills/aigc-integration/SKILL.md +14 -0
  443. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-search/SKILL.md +12 -0
  444. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-search/references/resource-config.md +11 -0
  445. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/SKILL.md +16 -0
  446. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/compare-animations.mjs +48 -0
  447. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/anim.mjs +266 -0
  448. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/glb.mjs +241 -0
  449. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/lib/scan.mjs +455 -0
  450. package/resources/targets/workbuddy/js3d/js3d/context/skills/asset-usage-audit/scripts/scan-assets.mjs +77 -0
  451. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/SKILL.md +16 -0
  452. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/cli.mjs +20 -0
  453. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/config.d.mts +19 -0
  454. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/config.mjs +1 -0
  455. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/project.d.mts +6 -0
  456. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/project.mjs +77 -0
  457. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/vite.d.mts +2 -0
  458. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/assets/tooling/vite.mjs +34 -0
  459. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/scripts/export-config.mjs +4 -0
  460. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/scripts/install.mjs +89 -0
  461. package/resources/targets/workbuddy/js3d/js3d/context/skills/export-config/scripts/panel-resource-path.mjs +106 -0
  462. package/resources/targets/workbuddy/js3d/js3d/context/skills/index.json +43 -0
  463. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/SKILL.md +21 -0
  464. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/scripts/lib/rules.mjs +470 -0
  465. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/scripts/lib/scan.mjs +387 -0
  466. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/scripts/lib/source.mjs +398 -0
  467. package/resources/targets/workbuddy/js3d/js3d/context/skills/performance-audit/scripts/scan-perf.mjs +130 -0
  468. package/resources/targets/workbuddy/js3d/js3d/context/skills/visual-qa/SKILL.md +14 -0
  469. package/resources/targets/workbuddy/js3d/js3d/project/README.md +7 -0
  470. package/resources/targets/workbuddy/js3d/js3d/project/configs/game.controls.json +3 -0
  471. package/resources/targets/workbuddy/js3d/js3d/project/configs/game.json +3 -0
  472. package/resources/targets/workbuddy/js3d/js3d/project/game-runtime.json +7 -0
  473. package/resources/targets/workbuddy/js3d/js3d/project/game.config.json +7 -0
  474. package/resources/targets/workbuddy/js3d/js3d/project/index.html +12 -0
  475. package/resources/targets/workbuddy/js3d/js3d/project/package.json +23 -0
  476. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-ai-game-sdk.min.js +5 -0
  477. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/qq-session.mjs +208 -0
  478. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/identity/shared.mjs +37 -0
  479. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-capture-video.mjs +227 -0
  480. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.d.mts +31 -0
  481. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform-service.mjs +272 -0
  482. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.d.mts +79 -0
  483. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/platform/platform.mjs +30 -0
  484. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/release.json +24 -0
  485. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/cli.mjs +16 -0
  486. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.d.mts +4 -0
  487. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/project.mjs +50 -0
  488. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.d.mts +3 -0
  489. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tooling/vite.mjs +72 -0
  490. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.d.mts +24 -0
  491. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/assets.mjs +2 -0
  492. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.d.mts +10 -0
  493. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/astc.mjs +1 -0
  494. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.d.mts +26 -0
  495. package/resources/targets/workbuddy/js3d/js3d/project/runtime/lightgame/1.1.0/tools/glb.mjs +351 -0
  496. package/resources/targets/workbuddy/js3d/js3d/project/scripts/config-export/assert-asset-wiring.mjs +97 -0
  497. package/resources/targets/workbuddy/js3d/js3d/project/scripts/config-export/panel-resource-path.mjs +106 -0
  498. package/resources/targets/workbuddy/js3d/js3d/project/scripts/config-export/sync-asset-controls.mjs +327 -0
  499. package/resources/targets/workbuddy/js3d/js3d/project/scripts/config-export/sync-scene-assets.mjs +191 -0
  500. package/resources/targets/workbuddy/js3d/js3d/project/scripts/config-export.mjs +15 -0
  501. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/cli.mjs +20 -0
  502. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/config.d.mts +19 -0
  503. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/config.mjs +1 -0
  504. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/installed.json +6 -0
  505. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/project.d.mts +6 -0
  506. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/project.mjs +77 -0
  507. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/vite.d.mts +2 -0
  508. package/resources/targets/workbuddy/js3d/js3d/project/scripts/skill-modules/export-config/vite.mjs +34 -0
  509. package/resources/targets/workbuddy/js3d/js3d/project/scripts/write-preview-ready.mjs +22 -0
  510. package/resources/targets/workbuddy/js3d/js3d/project/src/display/ui-stage.ts +156 -0
  511. package/resources/targets/workbuddy/js3d/js3d/project/src/display/viewport.ts +239 -0
  512. package/resources/targets/workbuddy/js3d/js3d/project/src/main.ts +85 -0
  513. package/resources/targets/workbuddy/js3d/js3d/project/src/platform.ts +2 -0
  514. package/resources/targets/workbuddy/js3d/js3d/project/src/style.css +83 -0
  515. package/resources/targets/workbuddy/js3d/js3d/project/tsconfig.json +20 -0
  516. package/resources/targets/workbuddy/js3d/js3d/project/unified_data_control_config.json +20 -0
  517. package/resources/targets/workbuddy/js3d/js3d/project/vite.config.ts +5 -0
  518. package/resources/targets/workbuddy/js3d/recovery.md +7 -0
  519. package/resources/targets/workbuddy/js3d/target.json +60 -0
  520. package/vendor/craft-runtime/NOTICE.md +3 -0
  521. package/vendor/craft-runtime/SOURCE.json +63 -0
  522. package/vendor/craft-runtime/index.js +1716 -0
  523. package/vendor/craft-runtime/isolated-launcher.js +94 -0
  524. package/vendor/craft-runtime/isolated-preload.js +80 -0
  525. package/vendor/craft-runtime/package.json +8 -0
  526. package/vendor/agent-cli/dist/runtime-tools/registry.json +0 -6
  527. package/vendor/agent-cli/dist/runtime-tools/tool-bundle-types.d.cts +0 -15
  528. package/vendor/agent-cli/dist/runtime-tools/tool-bundle.cjs +0 -129
  529. package/vendor/agent-cli/dist/runtime-tools/ue/blender-cook-assets.cjs +0 -296
  530. package/vendor/agent-cli/dist/runtime-tools/ue/context-adapter.cjs +0 -48
  531. package/vendor/agent-cli/dist/runtime-tools/ue/scene-process-lock.cjs +0 -110
  532. package/vendor/agent-cli/dist/runtime-tools/ue/tool-manifest.json +0 -22
  533. package/vendor/agent-cli/dist/runtime-tools/ue/ue-asset-references.cjs +0 -305
  534. package/vendor/agent-cli/dist/src/artifacts/build-failure.d.ts +0 -8
  535. package/vendor/agent-cli/dist/src/artifacts/build-failure.d.ts.map +0 -1
  536. package/vendor/agent-cli/dist/src/artifacts/build-failure.js +0 -39
  537. package/vendor/agent-cli/dist/src/artifacts/build-failure.js.map +0 -1
  538. package/vendor/agent-cli/dist/src/artifacts/context-finalize.d.ts +0 -3
  539. package/vendor/agent-cli/dist/src/artifacts/context-finalize.d.ts.map +0 -1
  540. package/vendor/agent-cli/dist/src/artifacts/context-finalize.js +0 -54
  541. package/vendor/agent-cli/dist/src/artifacts/context-finalize.js.map +0 -1
  542. package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.d.ts +0 -5
  543. package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.d.ts.map +0 -1
  544. package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.js +0 -45
  545. package/vendor/agent-cli/dist/src/artifacts/dependency-toolchain.js.map +0 -1
  546. package/vendor/agent-cli/dist/src/artifacts/external-game-archive.d.ts +0 -19
  547. package/vendor/agent-cli/dist/src/artifacts/external-game-archive.d.ts.map +0 -1
  548. package/vendor/agent-cli/dist/src/artifacts/external-game-archive.js +0 -107
  549. package/vendor/agent-cli/dist/src/artifacts/external-game-archive.js.map +0 -1
  550. package/vendor/agent-cli/dist/src/artifacts/external-game-upload.d.ts +0 -44
  551. package/vendor/agent-cli/dist/src/artifacts/external-game-upload.d.ts.map +0 -1
  552. package/vendor/agent-cli/dist/src/artifacts/external-game-upload.js +0 -106
  553. package/vendor/agent-cli/dist/src/artifacts/external-game-upload.js.map +0 -1
  554. package/vendor/agent-cli/dist/src/artifacts/native-source.d.ts +0 -3
  555. package/vendor/agent-cli/dist/src/artifacts/native-source.d.ts.map +0 -1
  556. package/vendor/agent-cli/dist/src/artifacts/native-source.js +0 -13
  557. package/vendor/agent-cli/dist/src/artifacts/native-source.js.map +0 -1
  558. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.d.ts +0 -13
  559. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.d.ts.map +0 -1
  560. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js +0 -365
  561. package/vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js.map +0 -1
  562. package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts +0 -63
  563. package/vendor/agent-cli/dist/src/artifacts/prepare.d.ts.map +0 -1
  564. package/vendor/agent-cli/dist/src/artifacts/prepare.js +0 -216
  565. package/vendor/agent-cli/dist/src/artifacts/prepare.js.map +0 -1
  566. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts +0 -41
  567. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.d.ts.map +0 -1
  568. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js +0 -184
  569. package/vendor/agent-cli/dist/src/artifacts/process-artifacts.js.map +0 -1
  570. package/vendor/agent-cli/dist/src/artifacts/restore-permissions.d.ts +0 -27
  571. package/vendor/agent-cli/dist/src/artifacts/restore-permissions.d.ts.map +0 -1
  572. package/vendor/agent-cli/dist/src/artifacts/restore-permissions.js +0 -112
  573. package/vendor/agent-cli/dist/src/artifacts/restore-permissions.js.map +0 -1
  574. package/vendor/agent-cli/dist/src/artifacts/restore.d.ts +0 -37
  575. package/vendor/agent-cli/dist/src/artifacts/restore.d.ts.map +0 -1
  576. package/vendor/agent-cli/dist/src/artifacts/restore.js +0 -465
  577. package/vendor/agent-cli/dist/src/artifacts/restore.js.map +0 -1
  578. package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.d.ts +0 -14
  579. package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.d.ts.map +0 -1
  580. package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.js +0 -119
  581. package/vendor/agent-cli/dist/src/artifacts/scene-asset-references.js.map +0 -1
  582. package/vendor/agent-cli/dist/src/artifacts/static.d.ts +0 -19
  583. package/vendor/agent-cli/dist/src/artifacts/static.d.ts.map +0 -1
  584. package/vendor/agent-cli/dist/src/artifacts/static.js +0 -238
  585. package/vendor/agent-cli/dist/src/artifacts/static.js.map +0 -1
  586. package/vendor/agent-cli/dist/src/cli/commands/process.d.ts +0 -4
  587. package/vendor/agent-cli/dist/src/cli/commands/process.d.ts.map +0 -1
  588. package/vendor/agent-cli/dist/src/cli/commands/process.js +0 -24
  589. package/vendor/agent-cli/dist/src/cli/commands/process.js.map +0 -1
  590. package/vendor/agent-cli/dist/src/cli/commands/run-controls.d.ts +0 -23
  591. package/vendor/agent-cli/dist/src/cli/commands/run-controls.d.ts.map +0 -1
  592. package/vendor/agent-cli/dist/src/cli/commands/run-controls.js +0 -62
  593. package/vendor/agent-cli/dist/src/cli/commands/run-controls.js.map +0 -1
  594. package/vendor/agent-cli/dist/src/cli/commands/run-mock.d.ts +0 -9
  595. package/vendor/agent-cli/dist/src/cli/commands/run-mock.d.ts.map +0 -1
  596. package/vendor/agent-cli/dist/src/cli/commands/run-mock.js +0 -15
  597. package/vendor/agent-cli/dist/src/cli/commands/run-mock.js.map +0 -1
  598. package/vendor/agent-cli/dist/src/cli/commands/run.d.ts +0 -3
  599. package/vendor/agent-cli/dist/src/cli/commands/run.d.ts.map +0 -1
  600. package/vendor/agent-cli/dist/src/cli/commands/run.js +0 -284
  601. package/vendor/agent-cli/dist/src/cli/commands/run.js.map +0 -1
  602. package/vendor/agent-cli/dist/src/cli/commands/setup.d.ts +0 -11
  603. package/vendor/agent-cli/dist/src/cli/commands/setup.d.ts.map +0 -1
  604. package/vendor/agent-cli/dist/src/cli/commands/setup.js +0 -161
  605. package/vendor/agent-cli/dist/src/cli/commands/setup.js.map +0 -1
  606. package/vendor/agent-cli/dist/src/cli/options.d.ts +0 -83
  607. package/vendor/agent-cli/dist/src/cli/options.d.ts.map +0 -1
  608. package/vendor/agent-cli/dist/src/cli/options.js +0 -213
  609. package/vendor/agent-cli/dist/src/cli/options.js.map +0 -1
  610. package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts +0 -5
  611. package/vendor/agent-cli/dist/src/cli/process-protocol.d.ts.map +0 -1
  612. package/vendor/agent-cli/dist/src/cli/process-protocol.js +0 -301
  613. package/vendor/agent-cli/dist/src/cli/process-protocol.js.map +0 -1
  614. package/vendor/agent-cli/dist/src/cli/process-steering.d.ts +0 -21
  615. package/vendor/agent-cli/dist/src/cli/process-steering.d.ts.map +0 -1
  616. package/vendor/agent-cli/dist/src/cli/process-steering.js +0 -66
  617. package/vendor/agent-cli/dist/src/cli/process-steering.js.map +0 -1
  618. package/vendor/agent-cli/dist/src/cli/registry.d.ts +0 -55
  619. package/vendor/agent-cli/dist/src/cli/registry.d.ts.map +0 -1
  620. package/vendor/agent-cli/dist/src/cli/registry.js +0 -99
  621. package/vendor/agent-cli/dist/src/cli/registry.js.map +0 -1
  622. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.d.ts +0 -44
  623. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.d.ts.map +0 -1
  624. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.js +0 -83
  625. package/vendor/agent-cli/dist/src/cli/render/jsonl-sink.js.map +0 -1
  626. package/vendor/agent-cli/dist/src/cli/render/text-sink.d.ts +0 -28
  627. package/vendor/agent-cli/dist/src/cli/render/text-sink.d.ts.map +0 -1
  628. package/vendor/agent-cli/dist/src/cli/render/text-sink.js +0 -52
  629. package/vendor/agent-cli/dist/src/cli/render/text-sink.js.map +0 -1
  630. package/vendor/agent-cli/dist/src/cli.d.ts +0 -9
  631. package/vendor/agent-cli/dist/src/cli.d.ts.map +0 -1
  632. package/vendor/agent-cli/dist/src/cli.js +0 -54
  633. package/vendor/agent-cli/dist/src/cli.js.map +0 -1
  634. package/vendor/agent-cli/dist/src/component/browser-queue.d.ts +0 -55
  635. package/vendor/agent-cli/dist/src/component/browser-queue.d.ts.map +0 -1
  636. package/vendor/agent-cli/dist/src/component/browser-queue.js +0 -63
  637. package/vendor/agent-cli/dist/src/component/browser-queue.js.map +0 -1
  638. package/vendor/agent-cli/dist/src/component/execution.d.ts +0 -28
  639. package/vendor/agent-cli/dist/src/component/execution.d.ts.map +0 -1
  640. package/vendor/agent-cli/dist/src/component/execution.js +0 -143
  641. package/vendor/agent-cli/dist/src/component/execution.js.map +0 -1
  642. package/vendor/agent-cli/dist/src/component/isolated-launcher.d.ts +0 -2
  643. package/vendor/agent-cli/dist/src/component/isolated-launcher.d.ts.map +0 -1
  644. package/vendor/agent-cli/dist/src/component/isolated-launcher.js +0 -76
  645. package/vendor/agent-cli/dist/src/component/isolated-launcher.js.map +0 -1
  646. package/vendor/agent-cli/dist/src/component/isolated-preload.d.ts +0 -2
  647. package/vendor/agent-cli/dist/src/component/isolated-preload.d.ts.map +0 -1
  648. package/vendor/agent-cli/dist/src/component/isolated-preload.js +0 -27
  649. package/vendor/agent-cli/dist/src/component/isolated-preload.js.map +0 -1
  650. package/vendor/agent-cli/dist/src/component/platform-access/server.d.ts +0 -19
  651. package/vendor/agent-cli/dist/src/component/platform-access/server.d.ts.map +0 -1
  652. package/vendor/agent-cli/dist/src/component/platform-access/server.js +0 -206
  653. package/vendor/agent-cli/dist/src/component/platform-access/server.js.map +0 -1
  654. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.d.ts +0 -31
  655. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.d.ts.map +0 -1
  656. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.js +0 -62
  657. package/vendor/agent-cli/dist/src/component/preparation-diagnostics.js.map +0 -1
  658. package/vendor/agent-cli/dist/src/component/preparation.d.ts +0 -10
  659. package/vendor/agent-cli/dist/src/component/preparation.d.ts.map +0 -1
  660. package/vendor/agent-cli/dist/src/component/preparation.js +0 -35
  661. package/vendor/agent-cli/dist/src/component/preparation.js.map +0 -1
  662. package/vendor/agent-cli/dist/src/component/process-diagnostics.d.ts +0 -25
  663. package/vendor/agent-cli/dist/src/component/process-diagnostics.d.ts.map +0 -1
  664. package/vendor/agent-cli/dist/src/component/process-diagnostics.js +0 -137
  665. package/vendor/agent-cli/dist/src/component/process-diagnostics.js.map +0 -1
  666. package/vendor/agent-cli/dist/src/component/process-isolation.d.ts +0 -10
  667. package/vendor/agent-cli/dist/src/component/process-isolation.d.ts.map +0 -1
  668. package/vendor/agent-cli/dist/src/component/process-isolation.js +0 -59
  669. package/vendor/agent-cli/dist/src/component/process-isolation.js.map +0 -1
  670. package/vendor/agent-cli/dist/src/component/proxied-fetch.d.ts +0 -2
  671. package/vendor/agent-cli/dist/src/component/proxied-fetch.d.ts.map +0 -1
  672. package/vendor/agent-cli/dist/src/component/proxied-fetch.js +0 -46
  673. package/vendor/agent-cli/dist/src/component/proxied-fetch.js.map +0 -1
  674. package/vendor/agent-cli/dist/src/component/public-egress.d.ts +0 -17
  675. package/vendor/agent-cli/dist/src/component/public-egress.d.ts.map +0 -1
  676. package/vendor/agent-cli/dist/src/component/public-egress.js +0 -246
  677. package/vendor/agent-cli/dist/src/component/public-egress.js.map +0 -1
  678. package/vendor/agent-cli/dist/src/component/runtime-tools.d.ts +0 -15
  679. package/vendor/agent-cli/dist/src/component/runtime-tools.d.ts.map +0 -1
  680. package/vendor/agent-cli/dist/src/component/runtime-tools.js +0 -37
  681. package/vendor/agent-cli/dist/src/component/runtime-tools.js.map +0 -1
  682. package/vendor/agent-cli/dist/src/component/runtime.d.ts +0 -8
  683. package/vendor/agent-cli/dist/src/component/runtime.d.ts.map +0 -1
  684. package/vendor/agent-cli/dist/src/component/runtime.js +0 -95
  685. package/vendor/agent-cli/dist/src/component/runtime.js.map +0 -1
  686. package/vendor/agent-cli/dist/src/config/config-store.d.ts +0 -50
  687. package/vendor/agent-cli/dist/src/config/config-store.d.ts.map +0 -1
  688. package/vendor/agent-cli/dist/src/config/config-store.js +0 -117
  689. package/vendor/agent-cli/dist/src/config/config-store.js.map +0 -1
  690. package/vendor/agent-cli/dist/src/context/cache-lease.d.ts +0 -17
  691. package/vendor/agent-cli/dist/src/context/cache-lease.d.ts.map +0 -1
  692. package/vendor/agent-cli/dist/src/context/cache-lease.js +0 -133
  693. package/vendor/agent-cli/dist/src/context/cache-lease.js.map +0 -1
  694. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.d.ts +0 -9
  695. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.d.ts.map +0 -1
  696. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.js +0 -51
  697. package/vendor/agent-cli/dist/src/context/cache-prune-diagnostics.js.map +0 -1
  698. package/vendor/agent-cli/dist/src/context/cache-publication-lock.d.ts +0 -3
  699. package/vendor/agent-cli/dist/src/context/cache-publication-lock.d.ts.map +0 -1
  700. package/vendor/agent-cli/dist/src/context/cache-publication-lock.js +0 -68
  701. package/vendor/agent-cli/dist/src/context/cache-publication-lock.js.map +0 -1
  702. package/vendor/agent-cli/dist/src/context/cache-publication.d.ts +0 -4
  703. package/vendor/agent-cli/dist/src/context/cache-publication.d.ts.map +0 -1
  704. package/vendor/agent-cli/dist/src/context/cache-publication.js +0 -58
  705. package/vendor/agent-cli/dist/src/context/cache-publication.js.map +0 -1
  706. package/vendor/agent-cli/dist/src/context/client-context-view.d.ts +0 -12
  707. package/vendor/agent-cli/dist/src/context/client-context-view.d.ts.map +0 -1
  708. package/vendor/agent-cli/dist/src/context/client-context-view.js +0 -100
  709. package/vendor/agent-cli/dist/src/context/client-context-view.js.map +0 -1
  710. package/vendor/agent-cli/dist/src/context/context-budget.d.ts +0 -3
  711. package/vendor/agent-cli/dist/src/context/context-budget.d.ts.map +0 -1
  712. package/vendor/agent-cli/dist/src/context/context-budget.js +0 -10
  713. package/vendor/agent-cli/dist/src/context/context-budget.js.map +0 -1
  714. package/vendor/agent-cli/dist/src/context/context-cache.d.ts +0 -108
  715. package/vendor/agent-cli/dist/src/context/context-cache.d.ts.map +0 -1
  716. package/vendor/agent-cli/dist/src/context/context-cache.js +0 -360
  717. package/vendor/agent-cli/dist/src/context/context-cache.js.map +0 -1
  718. package/vendor/agent-cli/dist/src/context/context-project.d.ts +0 -67
  719. package/vendor/agent-cli/dist/src/context/context-project.d.ts.map +0 -1
  720. package/vendor/agent-cli/dist/src/context/context-project.js +0 -254
  721. package/vendor/agent-cli/dist/src/context/context-project.js.map +0 -1
  722. package/vendor/agent-cli/dist/src/context/context-resource.d.ts +0 -4
  723. package/vendor/agent-cli/dist/src/context/context-resource.d.ts.map +0 -1
  724. package/vendor/agent-cli/dist/src/context/context-resource.js +0 -11
  725. package/vendor/agent-cli/dist/src/context/context-resource.js.map +0 -1
  726. package/vendor/agent-cli/dist/src/context/context-scoped-source.d.ts +0 -13
  727. package/vendor/agent-cli/dist/src/context/context-scoped-source.d.ts.map +0 -1
  728. package/vendor/agent-cli/dist/src/context/context-scoped-source.js +0 -78
  729. package/vendor/agent-cli/dist/src/context/context-scoped-source.js.map +0 -1
  730. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.d.ts +0 -23
  731. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.d.ts.map +0 -1
  732. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.js +0 -200
  733. package/vendor/agent-cli/dist/src/context/context-snapshot-cache.js.map +0 -1
  734. package/vendor/agent-cli/dist/src/context/local-skills.d.ts +0 -6
  735. package/vendor/agent-cli/dist/src/context/local-skills.d.ts.map +0 -1
  736. package/vendor/agent-cli/dist/src/context/local-skills.js +0 -174
  737. package/vendor/agent-cli/dist/src/context/local-skills.js.map +0 -1
  738. package/vendor/agent-cli/dist/src/context/member-context.d.ts +0 -20
  739. package/vendor/agent-cli/dist/src/context/member-context.d.ts.map +0 -1
  740. package/vendor/agent-cli/dist/src/context/member-context.js +0 -113
  741. package/vendor/agent-cli/dist/src/context/member-context.js.map +0 -1
  742. package/vendor/agent-cli/dist/src/context/member-documents.d.ts +0 -3
  743. package/vendor/agent-cli/dist/src/context/member-documents.d.ts.map +0 -1
  744. package/vendor/agent-cli/dist/src/context/member-documents.js +0 -38
  745. package/vendor/agent-cli/dist/src/context/member-documents.js.map +0 -1
  746. package/vendor/agent-cli/dist/src/context/member-profile-header.d.ts +0 -3
  747. package/vendor/agent-cli/dist/src/context/member-profile-header.d.ts.map +0 -1
  748. package/vendor/agent-cli/dist/src/context/member-profile-header.js +0 -62
  749. package/vendor/agent-cli/dist/src/context/member-profile-header.js.map +0 -1
  750. package/vendor/agent-cli/dist/src/context/member-profile.d.ts +0 -43
  751. package/vendor/agent-cli/dist/src/context/member-profile.d.ts.map +0 -1
  752. package/vendor/agent-cli/dist/src/context/member-profile.js +0 -91
  753. package/vendor/agent-cli/dist/src/context/member-profile.js.map +0 -1
  754. package/vendor/agent-cli/dist/src/context/member-selection.d.ts +0 -7
  755. package/vendor/agent-cli/dist/src/context/member-selection.d.ts.map +0 -1
  756. package/vendor/agent-cli/dist/src/context/member-selection.js +0 -58
  757. package/vendor/agent-cli/dist/src/context/member-selection.js.map +0 -1
  758. package/vendor/agent-cli/dist/src/context/script-dependencies.d.ts +0 -14
  759. package/vendor/agent-cli/dist/src/context/script-dependencies.d.ts.map +0 -1
  760. package/vendor/agent-cli/dist/src/context/script-dependencies.js +0 -40
  761. package/vendor/agent-cli/dist/src/context/script-dependencies.js.map +0 -1
  762. package/vendor/agent-cli/dist/src/context/shared-cache-build.d.ts +0 -3
  763. package/vendor/agent-cli/dist/src/context/shared-cache-build.d.ts.map +0 -1
  764. package/vendor/agent-cli/dist/src/context/shared-cache-build.js +0 -56
  765. package/vendor/agent-cli/dist/src/context/shared-cache-build.js.map +0 -1
  766. package/vendor/agent-cli/dist/src/context/team-definition.d.ts +0 -39
  767. package/vendor/agent-cli/dist/src/context/team-definition.d.ts.map +0 -1
  768. package/vendor/agent-cli/dist/src/context/team-definition.js +0 -78
  769. package/vendor/agent-cli/dist/src/context/team-definition.js.map +0 -1
  770. package/vendor/agent-cli/dist/src/context/team-knowledge.d.ts +0 -7
  771. package/vendor/agent-cli/dist/src/context/team-knowledge.d.ts.map +0 -1
  772. package/vendor/agent-cli/dist/src/context/team-knowledge.js +0 -46
  773. package/vendor/agent-cli/dist/src/context/team-knowledge.js.map +0 -1
  774. package/vendor/agent-cli/dist/src/context/template-cache.d.ts +0 -31
  775. package/vendor/agent-cli/dist/src/context/template-cache.d.ts.map +0 -1
  776. package/vendor/agent-cli/dist/src/context/template-cache.js +0 -100
  777. package/vendor/agent-cli/dist/src/context/template-cache.js.map +0 -1
  778. package/vendor/agent-cli/dist/src/context/template-refresh.d.ts +0 -6
  779. package/vendor/agent-cli/dist/src/context/template-refresh.d.ts.map +0 -1
  780. package/vendor/agent-cli/dist/src/context/template-refresh.js +0 -45
  781. package/vendor/agent-cli/dist/src/context/template-refresh.js.map +0 -1
  782. package/vendor/agent-cli/dist/src/context/template-seed.d.ts +0 -45
  783. package/vendor/agent-cli/dist/src/context/template-seed.d.ts.map +0 -1
  784. package/vendor/agent-cli/dist/src/context/template-seed.js +0 -169
  785. package/vendor/agent-cli/dist/src/context/template-seed.js.map +0 -1
  786. package/vendor/agent-cli/dist/src/context/template-sync.d.ts +0 -11
  787. package/vendor/agent-cli/dist/src/context/template-sync.d.ts.map +0 -1
  788. package/vendor/agent-cli/dist/src/context/template-sync.js +0 -167
  789. package/vendor/agent-cli/dist/src/context/template-sync.js.map +0 -1
  790. package/vendor/agent-cli/dist/src/context/user-skill-bundle.d.ts +0 -19
  791. package/vendor/agent-cli/dist/src/context/user-skill-bundle.d.ts.map +0 -1
  792. package/vendor/agent-cli/dist/src/context/user-skill-bundle.js +0 -292
  793. package/vendor/agent-cli/dist/src/context/user-skill-bundle.js.map +0 -1
  794. package/vendor/agent-cli/dist/src/context/user-skill-context.d.ts +0 -15
  795. package/vendor/agent-cli/dist/src/context/user-skill-context.d.ts.map +0 -1
  796. package/vendor/agent-cli/dist/src/context/user-skill-context.js +0 -217
  797. package/vendor/agent-cli/dist/src/context/user-skill-context.js.map +0 -1
  798. package/vendor/agent-cli/dist/src/context/user-skill-install.d.ts +0 -54
  799. package/vendor/agent-cli/dist/src/context/user-skill-install.d.ts.map +0 -1
  800. package/vendor/agent-cli/dist/src/context/user-skill-install.js +0 -184
  801. package/vendor/agent-cli/dist/src/context/user-skill-install.js.map +0 -1
  802. package/vendor/agent-cli/dist/src/context/zip-extract.d.ts +0 -14
  803. package/vendor/agent-cli/dist/src/context/zip-extract.d.ts.map +0 -1
  804. package/vendor/agent-cli/dist/src/context/zip-extract.js +0 -130
  805. package/vendor/agent-cli/dist/src/context/zip-extract.js.map +0 -1
  806. package/vendor/agent-cli/dist/src/index.d.ts +0 -65
  807. package/vendor/agent-cli/dist/src/index.d.ts.map +0 -1
  808. package/vendor/agent-cli/dist/src/index.js +0 -91
  809. package/vendor/agent-cli/dist/src/index.js.map +0 -1
  810. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.d.ts +0 -68
  811. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.d.ts.map +0 -1
  812. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.js +0 -244
  813. package/vendor/agent-cli/dist/src/lifecycle/engine-hooks.js.map +0 -1
  814. package/vendor/agent-cli/dist/src/lifecycle/hook-command.d.ts +0 -40
  815. package/vendor/agent-cli/dist/src/lifecycle/hook-command.d.ts.map +0 -1
  816. package/vendor/agent-cli/dist/src/lifecycle/hook-command.js +0 -87
  817. package/vendor/agent-cli/dist/src/lifecycle/hook-command.js.map +0 -1
  818. package/vendor/agent-cli/dist/src/lifecycle/registry.d.ts +0 -134
  819. package/vendor/agent-cli/dist/src/lifecycle/registry.d.ts.map +0 -1
  820. package/vendor/agent-cli/dist/src/lifecycle/registry.js +0 -152
  821. package/vendor/agent-cli/dist/src/lifecycle/registry.js.map +0 -1
  822. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.d.ts +0 -40
  823. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.d.ts.map +0 -1
  824. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.js +0 -149
  825. package/vendor/agent-cli/dist/src/lifecycle/workspace-change.js.map +0 -1
  826. package/vendor/agent-cli/dist/src/mcp/client.d.ts +0 -12
  827. package/vendor/agent-cli/dist/src/mcp/client.d.ts.map +0 -1
  828. package/vendor/agent-cli/dist/src/mcp/client.js +0 -95
  829. package/vendor/agent-cli/dist/src/mcp/client.js.map +0 -1
  830. package/vendor/agent-cli/dist/src/mcp/connection.d.ts +0 -14
  831. package/vendor/agent-cli/dist/src/mcp/connection.d.ts.map +0 -1
  832. package/vendor/agent-cli/dist/src/mcp/connection.js +0 -115
  833. package/vendor/agent-cli/dist/src/mcp/connection.js.map +0 -1
  834. package/vendor/agent-cli/dist/src/mcp/execute.d.ts +0 -5
  835. package/vendor/agent-cli/dist/src/mcp/execute.d.ts.map +0 -1
  836. package/vendor/agent-cli/dist/src/mcp/execute.js +0 -26
  837. package/vendor/agent-cli/dist/src/mcp/execute.js.map +0 -1
  838. package/vendor/agent-cli/dist/src/mcp/instance-lock.d.ts +0 -11
  839. package/vendor/agent-cli/dist/src/mcp/instance-lock.d.ts.map +0 -1
  840. package/vendor/agent-cli/dist/src/mcp/instance-lock.js +0 -51
  841. package/vendor/agent-cli/dist/src/mcp/instance-lock.js.map +0 -1
  842. package/vendor/agent-cli/dist/src/mcp/types.d.ts +0 -27
  843. package/vendor/agent-cli/dist/src/mcp/types.d.ts.map +0 -1
  844. package/vendor/agent-cli/dist/src/mcp/types.js +0 -2
  845. package/vendor/agent-cli/dist/src/mcp/types.js.map +0 -1
  846. package/vendor/agent-cli/dist/src/protocol/input.d.ts +0 -21
  847. package/vendor/agent-cli/dist/src/protocol/input.d.ts.map +0 -1
  848. package/vendor/agent-cli/dist/src/protocol/input.js +0 -95
  849. package/vendor/agent-cli/dist/src/protocol/input.js.map +0 -1
  850. package/vendor/agent-cli/dist/src/protocol/link/channel.d.ts +0 -58
  851. package/vendor/agent-cli/dist/src/protocol/link/channel.d.ts.map +0 -1
  852. package/vendor/agent-cli/dist/src/protocol/link/channel.js +0 -337
  853. package/vendor/agent-cli/dist/src/protocol/link/channel.js.map +0 -1
  854. package/vendor/agent-cli/dist/src/protocol/link/codec-json.d.ts +0 -13
  855. package/vendor/agent-cli/dist/src/protocol/link/codec-json.d.ts.map +0 -1
  856. package/vendor/agent-cli/dist/src/protocol/link/codec-json.js +0 -27
  857. package/vendor/agent-cli/dist/src/protocol/link/codec-json.js.map +0 -1
  858. package/vendor/agent-cli/dist/src/protocol/link/envelope.d.ts +0 -57
  859. package/vendor/agent-cli/dist/src/protocol/link/envelope.d.ts.map +0 -1
  860. package/vendor/agent-cli/dist/src/protocol/link/envelope.js +0 -93
  861. package/vendor/agent-cli/dist/src/protocol/link/envelope.js.map +0 -1
  862. package/vendor/agent-cli/dist/src/protocol/link/liveness.d.ts +0 -28
  863. package/vendor/agent-cli/dist/src/protocol/link/liveness.d.ts.map +0 -1
  864. package/vendor/agent-cli/dist/src/protocol/link/liveness.js +0 -86
  865. package/vendor/agent-cli/dist/src/protocol/link/liveness.js.map +0 -1
  866. package/vendor/agent-cli/dist/src/protocol/link/middleware.d.ts +0 -14
  867. package/vendor/agent-cli/dist/src/protocol/link/middleware.d.ts.map +0 -1
  868. package/vendor/agent-cli/dist/src/protocol/link/middleware.js +0 -40
  869. package/vendor/agent-cli/dist/src/protocol/link/middleware.js.map +0 -1
  870. package/vendor/agent-cli/dist/src/protocol/link/rpc.d.ts +0 -31
  871. package/vendor/agent-cli/dist/src/protocol/link/rpc.d.ts.map +0 -1
  872. package/vendor/agent-cli/dist/src/protocol/link/rpc.js +0 -90
  873. package/vendor/agent-cli/dist/src/protocol/link/rpc.js.map +0 -1
  874. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.d.ts +0 -32
  875. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.d.ts.map +0 -1
  876. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.js +0 -106
  877. package/vendor/agent-cli/dist/src/protocol/link/transport-ws.js.map +0 -1
  878. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.d.ts +0 -533
  879. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.d.ts.map +0 -1
  880. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.js +0 -137
  881. package/vendor/agent-cli/dist/src/protocol/messages/errors.gen.js.map +0 -1
  882. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts +0 -448
  883. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.d.ts.map +0 -1
  884. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js +0 -133
  885. package/vendor/agent-cli/dist/src/protocol/messages/messages.gen.js.map +0 -1
  886. package/vendor/agent-cli/dist/src/security/binary-read-receipts.d.ts +0 -9
  887. package/vendor/agent-cli/dist/src/security/binary-read-receipts.d.ts.map +0 -1
  888. package/vendor/agent-cli/dist/src/security/binary-read-receipts.js +0 -58
  889. package/vendor/agent-cli/dist/src/security/binary-read-receipts.js.map +0 -1
  890. package/vendor/agent-cli/dist/src/security/command-parse.d.ts +0 -21
  891. package/vendor/agent-cli/dist/src/security/command-parse.d.ts.map +0 -1
  892. package/vendor/agent-cli/dist/src/security/command-parse.js +0 -395
  893. package/vendor/agent-cli/dist/src/security/command-parse.js.map +0 -1
  894. package/vendor/agent-cli/dist/src/security/command-translate.d.ts +0 -30
  895. package/vendor/agent-cli/dist/src/security/command-translate.d.ts.map +0 -1
  896. package/vendor/agent-cli/dist/src/security/command-translate.js +0 -165
  897. package/vendor/agent-cli/dist/src/security/command-translate.js.map +0 -1
  898. package/vendor/agent-cli/dist/src/security/context-write-policy.d.ts +0 -18
  899. package/vendor/agent-cli/dist/src/security/context-write-policy.d.ts.map +0 -1
  900. package/vendor/agent-cli/dist/src/security/context-write-policy.js +0 -121
  901. package/vendor/agent-cli/dist/src/security/context-write-policy.js.map +0 -1
  902. package/vendor/agent-cli/dist/src/security/guard.d.ts +0 -45
  903. package/vendor/agent-cli/dist/src/security/guard.d.ts.map +0 -1
  904. package/vendor/agent-cli/dist/src/security/guard.js +0 -166
  905. package/vendor/agent-cli/dist/src/security/guard.js.map +0 -1
  906. package/vendor/agent-cli/dist/src/security/mount-table.d.ts +0 -56
  907. package/vendor/agent-cli/dist/src/security/mount-table.d.ts.map +0 -1
  908. package/vendor/agent-cli/dist/src/security/mount-table.js +0 -251
  909. package/vendor/agent-cli/dist/src/security/mount-table.js.map +0 -1
  910. package/vendor/agent-cli/dist/src/security/sandbox-path.d.ts +0 -23
  911. package/vendor/agent-cli/dist/src/security/sandbox-path.d.ts.map +0 -1
  912. package/vendor/agent-cli/dist/src/security/sandbox-path.js +0 -110
  913. package/vendor/agent-cli/dist/src/security/sandbox-path.js.map +0 -1
  914. package/vendor/agent-cli/dist/src/security/tool-run-owner.d.ts +0 -5
  915. package/vendor/agent-cli/dist/src/security/tool-run-owner.d.ts.map +0 -1
  916. package/vendor/agent-cli/dist/src/security/tool-run-owner.js +0 -16
  917. package/vendor/agent-cli/dist/src/security/tool-run-owner.js.map +0 -1
  918. package/vendor/agent-cli/dist/src/security/tool-scope.d.ts +0 -19
  919. package/vendor/agent-cli/dist/src/security/tool-scope.d.ts.map +0 -1
  920. package/vendor/agent-cli/dist/src/security/tool-scope.js +0 -122
  921. package/vendor/agent-cli/dist/src/security/tool-scope.js.map +0 -1
  922. package/vendor/agent-cli/dist/src/session/client.d.ts +0 -146
  923. package/vendor/agent-cli/dist/src/session/client.d.ts.map +0 -1
  924. package/vendor/agent-cli/dist/src/session/client.js +0 -410
  925. package/vendor/agent-cli/dist/src/session/client.js.map +0 -1
  926. package/vendor/agent-cli/dist/src/session/custom-context.d.ts +0 -6
  927. package/vendor/agent-cli/dist/src/session/custom-context.d.ts.map +0 -1
  928. package/vendor/agent-cli/dist/src/session/custom-context.js +0 -106
  929. package/vendor/agent-cli/dist/src/session/custom-context.js.map +0 -1
  930. package/vendor/agent-cli/dist/src/session/engine-decide.d.ts +0 -38
  931. package/vendor/agent-cli/dist/src/session/engine-decide.d.ts.map +0 -1
  932. package/vendor/agent-cli/dist/src/session/engine-decide.js +0 -87
  933. package/vendor/agent-cli/dist/src/session/engine-decide.js.map +0 -1
  934. package/vendor/agent-cli/dist/src/session/execution-recovery.d.ts +0 -9
  935. package/vendor/agent-cli/dist/src/session/execution-recovery.d.ts.map +0 -1
  936. package/vendor/agent-cli/dist/src/session/execution-recovery.js +0 -49
  937. package/vendor/agent-cli/dist/src/session/execution-recovery.js.map +0 -1
  938. package/vendor/agent-cli/dist/src/session/execution-settlement.d.ts +0 -4
  939. package/vendor/agent-cli/dist/src/session/execution-settlement.d.ts.map +0 -1
  940. package/vendor/agent-cli/dist/src/session/execution-settlement.js +0 -15
  941. package/vendor/agent-cli/dist/src/session/execution-settlement.js.map +0 -1
  942. package/vendor/agent-cli/dist/src/session/expert-definition.d.ts +0 -4
  943. package/vendor/agent-cli/dist/src/session/expert-definition.d.ts.map +0 -1
  944. package/vendor/agent-cli/dist/src/session/expert-definition.js +0 -20
  945. package/vendor/agent-cli/dist/src/session/expert-definition.js.map +0 -1
  946. package/vendor/agent-cli/dist/src/session/link-config.d.ts +0 -13
  947. package/vendor/agent-cli/dist/src/session/link-config.d.ts.map +0 -1
  948. package/vendor/agent-cli/dist/src/session/link-config.js +0 -29
  949. package/vendor/agent-cli/dist/src/session/link-config.js.map +0 -1
  950. package/vendor/agent-cli/dist/src/session/link-outcome.d.ts +0 -30
  951. package/vendor/agent-cli/dist/src/session/link-outcome.d.ts.map +0 -1
  952. package/vendor/agent-cli/dist/src/session/link-outcome.js +0 -67
  953. package/vendor/agent-cli/dist/src/session/link-outcome.js.map +0 -1
  954. package/vendor/agent-cli/dist/src/session/link-session.d.ts +0 -80
  955. package/vendor/agent-cli/dist/src/session/link-session.d.ts.map +0 -1
  956. package/vendor/agent-cli/dist/src/session/link-session.js +0 -445
  957. package/vendor/agent-cli/dist/src/session/link-session.js.map +0 -1
  958. package/vendor/agent-cli/dist/src/session/local-execution.d.ts +0 -28
  959. package/vendor/agent-cli/dist/src/session/local-execution.d.ts.map +0 -1
  960. package/vendor/agent-cli/dist/src/session/local-execution.js +0 -119
  961. package/vendor/agent-cli/dist/src/session/local-execution.js.map +0 -1
  962. package/vendor/agent-cli/dist/src/session/member-tools.d.ts +0 -22
  963. package/vendor/agent-cli/dist/src/session/member-tools.d.ts.map +0 -1
  964. package/vendor/agent-cli/dist/src/session/member-tools.js +0 -72
  965. package/vendor/agent-cli/dist/src/session/member-tools.js.map +0 -1
  966. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.d.ts +0 -7
  967. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.d.ts.map +0 -1
  968. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.js +0 -30
  969. package/vendor/agent-cli/dist/src/session/process-artifact-publisher.js.map +0 -1
  970. package/vendor/agent-cli/dist/src/session/process-environment.d.ts +0 -3
  971. package/vendor/agent-cli/dist/src/session/process-environment.d.ts.map +0 -1
  972. package/vendor/agent-cli/dist/src/session/process-environment.js +0 -33
  973. package/vendor/agent-cli/dist/src/session/process-environment.js.map +0 -1
  974. package/vendor/agent-cli/dist/src/session/process-lifecycle.d.ts +0 -5
  975. package/vendor/agent-cli/dist/src/session/process-lifecycle.d.ts.map +0 -1
  976. package/vendor/agent-cli/dist/src/session/process-lifecycle.js +0 -18
  977. package/vendor/agent-cli/dist/src/session/process-lifecycle.js.map +0 -1
  978. package/vendor/agent-cli/dist/src/session/process-observability.d.ts +0 -7
  979. package/vendor/agent-cli/dist/src/session/process-observability.d.ts.map +0 -1
  980. package/vendor/agent-cli/dist/src/session/process-observability.js +0 -25
  981. package/vendor/agent-cli/dist/src/session/process-observability.js.map +0 -1
  982. package/vendor/agent-cli/dist/src/session/process-request.d.ts +0 -38
  983. package/vendor/agent-cli/dist/src/session/process-request.d.ts.map +0 -1
  984. package/vendor/agent-cli/dist/src/session/process-request.js +0 -491
  985. package/vendor/agent-cli/dist/src/session/process-request.js.map +0 -1
  986. package/vendor/agent-cli/dist/src/session/process-restore.d.ts +0 -4
  987. package/vendor/agent-cli/dist/src/session/process-restore.d.ts.map +0 -1
  988. package/vendor/agent-cli/dist/src/session/process-restore.js +0 -21
  989. package/vendor/agent-cli/dist/src/session/process-restore.js.map +0 -1
  990. package/vendor/agent-cli/dist/src/session/process-summary-output.d.ts +0 -15
  991. package/vendor/agent-cli/dist/src/session/process-summary-output.d.ts.map +0 -1
  992. package/vendor/agent-cli/dist/src/session/process-summary-output.js +0 -46
  993. package/vendor/agent-cli/dist/src/session/process-summary-output.js.map +0 -1
  994. package/vendor/agent-cli/dist/src/session/process-workspace.d.ts +0 -3
  995. package/vendor/agent-cli/dist/src/session/process-workspace.d.ts.map +0 -1
  996. package/vendor/agent-cli/dist/src/session/process-workspace.js +0 -21
  997. package/vendor/agent-cli/dist/src/session/process-workspace.js.map +0 -1
  998. package/vendor/agent-cli/dist/src/session/reference-tools.d.ts +0 -8
  999. package/vendor/agent-cli/dist/src/session/reference-tools.d.ts.map +0 -1
  1000. package/vendor/agent-cli/dist/src/session/reference-tools.js +0 -35
  1001. package/vendor/agent-cli/dist/src/session/reference-tools.js.map +0 -1
  1002. package/vendor/agent-cli/dist/src/session/run-events.d.ts +0 -81
  1003. package/vendor/agent-cli/dist/src/session/run-events.d.ts.map +0 -1
  1004. package/vendor/agent-cli/dist/src/session/run-events.js +0 -160
  1005. package/vendor/agent-cli/dist/src/session/run-events.js.map +0 -1
  1006. package/vendor/agent-cli/dist/src/session/run-setup.d.ts +0 -78
  1007. package/vendor/agent-cli/dist/src/session/run-setup.d.ts.map +0 -1
  1008. package/vendor/agent-cli/dist/src/session/run-setup.js +0 -294
  1009. package/vendor/agent-cli/dist/src/session/run-setup.js.map +0 -1
  1010. package/vendor/agent-cli/dist/src/session/run-start-body.d.ts +0 -48
  1011. package/vendor/agent-cli/dist/src/session/run-start-body.d.ts.map +0 -1
  1012. package/vendor/agent-cli/dist/src/session/run-start-body.js +0 -82
  1013. package/vendor/agent-cli/dist/src/session/run-start-body.js.map +0 -1
  1014. package/vendor/agent-cli/dist/src/session/run-steer.d.ts +0 -42
  1015. package/vendor/agent-cli/dist/src/session/run-steer.d.ts.map +0 -1
  1016. package/vendor/agent-cli/dist/src/session/run-steer.js +0 -205
  1017. package/vendor/agent-cli/dist/src/session/run-steer.js.map +0 -1
  1018. package/vendor/agent-cli/dist/src/session/team-persistence.d.ts +0 -17
  1019. package/vendor/agent-cli/dist/src/session/team-persistence.d.ts.map +0 -1
  1020. package/vendor/agent-cli/dist/src/session/team-persistence.js +0 -75
  1021. package/vendor/agent-cli/dist/src/session/team-persistence.js.map +0 -1
  1022. package/vendor/agent-cli/dist/src/session/tool-scheduler.d.ts +0 -37
  1023. package/vendor/agent-cli/dist/src/session/tool-scheduler.d.ts.map +0 -1
  1024. package/vendor/agent-cli/dist/src/session/tool-scheduler.js +0 -242
  1025. package/vendor/agent-cli/dist/src/session/tool-scheduler.js.map +0 -1
  1026. package/vendor/agent-cli/dist/src/session/user-choice-policy.d.ts +0 -25
  1027. package/vendor/agent-cli/dist/src/session/user-choice-policy.d.ts.map +0 -1
  1028. package/vendor/agent-cli/dist/src/session/user-choice-policy.js +0 -70
  1029. package/vendor/agent-cli/dist/src/session/user-choice-policy.js.map +0 -1
  1030. package/vendor/agent-cli/dist/src/session/user-choice.d.ts +0 -6
  1031. package/vendor/agent-cli/dist/src/session/user-choice.d.ts.map +0 -1
  1032. package/vendor/agent-cli/dist/src/session/user-choice.js +0 -101
  1033. package/vendor/agent-cli/dist/src/session/user-choice.js.map +0 -1
  1034. package/vendor/agent-cli/dist/src/session/user-skill-compatibility.d.ts +0 -4
  1035. package/vendor/agent-cli/dist/src/session/user-skill-compatibility.d.ts.map +0 -1
  1036. package/vendor/agent-cli/dist/src/session/user-skill-compatibility.js +0 -25
  1037. package/vendor/agent-cli/dist/src/session/user-skill-compatibility.js.map +0 -1
  1038. package/vendor/agent-cli/dist/src/session/user-skill-loaded.d.ts +0 -31
  1039. package/vendor/agent-cli/dist/src/session/user-skill-loaded.d.ts.map +0 -1
  1040. package/vendor/agent-cli/dist/src/session/user-skill-loaded.js +0 -105
  1041. package/vendor/agent-cli/dist/src/session/user-skill-loaded.js.map +0 -1
  1042. package/vendor/agent-cli/dist/src/session/user-skill-prompt.d.ts +0 -4
  1043. package/vendor/agent-cli/dist/src/session/user-skill-prompt.d.ts.map +0 -1
  1044. package/vendor/agent-cli/dist/src/session/user-skill-prompt.js +0 -15
  1045. package/vendor/agent-cli/dist/src/session/user-skill-prompt.js.map +0 -1
  1046. package/vendor/agent-cli/dist/src/shared/app-id.d.ts +0 -13
  1047. package/vendor/agent-cli/dist/src/shared/app-id.d.ts.map +0 -1
  1048. package/vendor/agent-cli/dist/src/shared/app-id.js +0 -25
  1049. package/vendor/agent-cli/dist/src/shared/app-id.js.map +0 -1
  1050. package/vendor/agent-cli/dist/src/shared/auth-headers.d.ts +0 -13
  1051. package/vendor/agent-cli/dist/src/shared/auth-headers.d.ts.map +0 -1
  1052. package/vendor/agent-cli/dist/src/shared/auth-headers.js +0 -16
  1053. package/vendor/agent-cli/dist/src/shared/auth-headers.js.map +0 -1
  1054. package/vendor/agent-cli/dist/src/shared/cli-version.d.ts +0 -3
  1055. package/vendor/agent-cli/dist/src/shared/cli-version.d.ts.map +0 -1
  1056. package/vendor/agent-cli/dist/src/shared/cli-version.js +0 -22
  1057. package/vendor/agent-cli/dist/src/shared/cli-version.js.map +0 -1
  1058. package/vendor/agent-cli/dist/src/shared/error-detail.d.ts +0 -14
  1059. package/vendor/agent-cli/dist/src/shared/error-detail.d.ts.map +0 -1
  1060. package/vendor/agent-cli/dist/src/shared/error-detail.js +0 -29
  1061. package/vendor/agent-cli/dist/src/shared/error-detail.js.map +0 -1
  1062. package/vendor/agent-cli/dist/src/shared/output-guard.d.ts +0 -36
  1063. package/vendor/agent-cli/dist/src/shared/output-guard.d.ts.map +0 -1
  1064. package/vendor/agent-cli/dist/src/shared/output-guard.js +0 -94
  1065. package/vendor/agent-cli/dist/src/shared/output-guard.js.map +0 -1
  1066. package/vendor/agent-cli/dist/src/shared/process-cwd.d.ts +0 -3
  1067. package/vendor/agent-cli/dist/src/shared/process-cwd.d.ts.map +0 -1
  1068. package/vendor/agent-cli/dist/src/shared/process-cwd.js +0 -11
  1069. package/vendor/agent-cli/dist/src/shared/process-cwd.js.map +0 -1
  1070. package/vendor/agent-cli/dist/src/shared/process-types.d.ts +0 -60
  1071. package/vendor/agent-cli/dist/src/shared/process-types.d.ts.map +0 -1
  1072. package/vendor/agent-cli/dist/src/shared/process-types.js +0 -10
  1073. package/vendor/agent-cli/dist/src/shared/process-types.js.map +0 -1
  1074. package/vendor/agent-cli/dist/src/shared/replace-file.d.ts +0 -3
  1075. package/vendor/agent-cli/dist/src/shared/replace-file.d.ts.map +0 -1
  1076. package/vendor/agent-cli/dist/src/shared/replace-file.js +0 -34
  1077. package/vendor/agent-cli/dist/src/shared/replace-file.js.map +0 -1
  1078. package/vendor/agent-cli/dist/src/shared/server-headers.d.ts +0 -7
  1079. package/vendor/agent-cli/dist/src/shared/server-headers.d.ts.map +0 -1
  1080. package/vendor/agent-cli/dist/src/shared/server-headers.js +0 -113
  1081. package/vendor/agent-cli/dist/src/shared/server-headers.js.map +0 -1
  1082. package/vendor/agent-cli/dist/src/shared/shell-runtime.d.ts +0 -47
  1083. package/vendor/agent-cli/dist/src/shared/shell-runtime.d.ts.map +0 -1
  1084. package/vendor/agent-cli/dist/src/shared/shell-runtime.js +0 -210
  1085. package/vendor/agent-cli/dist/src/shared/shell-runtime.js.map +0 -1
  1086. package/vendor/agent-cli/dist/src/shared/types.d.ts +0 -519
  1087. package/vendor/agent-cli/dist/src/shared/types.d.ts.map +0 -1
  1088. package/vendor/agent-cli/dist/src/shared/types.js +0 -2
  1089. package/vendor/agent-cli/dist/src/shared/types.js.map +0 -1
  1090. package/vendor/agent-cli/dist/src/shared/user-choice.d.ts +0 -41
  1091. package/vendor/agent-cli/dist/src/shared/user-choice.d.ts.map +0 -1
  1092. package/vendor/agent-cli/dist/src/shared/user-choice.js +0 -2
  1093. package/vendor/agent-cli/dist/src/shared/user-choice.js.map +0 -1
  1094. package/vendor/agent-cli/dist/src/tools/artifact-publisher.d.ts +0 -9
  1095. package/vendor/agent-cli/dist/src/tools/artifact-publisher.d.ts.map +0 -1
  1096. package/vendor/agent-cli/dist/src/tools/artifact-publisher.js +0 -85
  1097. package/vendor/agent-cli/dist/src/tools/artifact-publisher.js.map +0 -1
  1098. package/vendor/agent-cli/dist/src/tools/command-executor.d.ts +0 -33
  1099. package/vendor/agent-cli/dist/src/tools/command-executor.d.ts.map +0 -1
  1100. package/vendor/agent-cli/dist/src/tools/command-executor.js +0 -133
  1101. package/vendor/agent-cli/dist/src/tools/command-executor.js.map +0 -1
  1102. package/vendor/agent-cli/dist/src/tools/context-program-publish.d.ts +0 -16
  1103. package/vendor/agent-cli/dist/src/tools/context-program-publish.d.ts.map +0 -1
  1104. package/vendor/agent-cli/dist/src/tools/context-program-publish.js +0 -104
  1105. package/vendor/agent-cli/dist/src/tools/context-program-publish.js.map +0 -1
  1106. package/vendor/agent-cli/dist/src/tools/context-program-receipt.d.ts +0 -21
  1107. package/vendor/agent-cli/dist/src/tools/context-program-receipt.d.ts.map +0 -1
  1108. package/vendor/agent-cli/dist/src/tools/context-program-receipt.js +0 -102
  1109. package/vendor/agent-cli/dist/src/tools/context-program-receipt.js.map +0 -1
  1110. package/vendor/agent-cli/dist/src/tools/context-program.d.ts +0 -21
  1111. package/vendor/agent-cli/dist/src/tools/context-program.d.ts.map +0 -1
  1112. package/vendor/agent-cli/dist/src/tools/context-program.js +0 -236
  1113. package/vendor/agent-cli/dist/src/tools/context-program.js.map +0 -1
  1114. package/vendor/agent-cli/dist/src/tools/file-ops.d.ts +0 -52
  1115. package/vendor/agent-cli/dist/src/tools/file-ops.d.ts.map +0 -1
  1116. package/vendor/agent-cli/dist/src/tools/file-ops.js +0 -403
  1117. package/vendor/agent-cli/dist/src/tools/file-ops.js.map +0 -1
  1118. package/vendor/agent-cli/dist/src/tools/file-search.d.ts +0 -29
  1119. package/vendor/agent-cli/dist/src/tools/file-search.d.ts.map +0 -1
  1120. package/vendor/agent-cli/dist/src/tools/file-search.js +0 -98
  1121. package/vendor/agent-cli/dist/src/tools/file-search.js.map +0 -1
  1122. package/vendor/agent-cli/dist/src/tools/file-stat.d.ts +0 -9
  1123. package/vendor/agent-cli/dist/src/tools/file-stat.d.ts.map +0 -1
  1124. package/vendor/agent-cli/dist/src/tools/file-stat.js +0 -29
  1125. package/vendor/agent-cli/dist/src/tools/file-stat.js.map +0 -1
  1126. package/vendor/agent-cli/dist/src/tools/local-hands.d.ts +0 -58
  1127. package/vendor/agent-cli/dist/src/tools/local-hands.d.ts.map +0 -1
  1128. package/vendor/agent-cli/dist/src/tools/local-hands.js +0 -330
  1129. package/vendor/agent-cli/dist/src/tools/local-hands.js.map +0 -1
  1130. package/vendor/agent-cli/dist/src/tools/ripgrep-search.d.ts +0 -24
  1131. package/vendor/agent-cli/dist/src/tools/ripgrep-search.d.ts.map +0 -1
  1132. package/vendor/agent-cli/dist/src/tools/ripgrep-search.js +0 -160
  1133. package/vendor/agent-cli/dist/src/tools/ripgrep-search.js.map +0 -1
  1134. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.d.ts +0 -69
  1135. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.d.ts.map +0 -1
  1136. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.js +0 -68
  1137. package/vendor/agent-cli/dist/src/tools/tool-contract.gen.js.map +0 -1
  1138. package/vendor/agent-cli/dist/src/tools/tool-timeout.d.ts +0 -29
  1139. package/vendor/agent-cli/dist/src/tools/tool-timeout.d.ts.map +0 -1
  1140. package/vendor/agent-cli/dist/src/tools/tool-timeout.js +0 -88
  1141. package/vendor/agent-cli/dist/src/tools/tool-timeout.js.map +0 -1
  1142. package/vendor/agent-cli/dist/src/tools/write-guard.d.ts +0 -42
  1143. package/vendor/agent-cli/dist/src/tools/write-guard.d.ts.map +0 -1
  1144. package/vendor/agent-cli/dist/src/tools/write-guard.js +0 -34
  1145. package/vendor/agent-cli/dist/src/tools/write-guard.js.map +0 -1
  1146. package/vendor/agent-cli/package.json +0 -29
@@ -0,0 +1,1716 @@
1
+ // vendor/agent-cli/dist/src/protocol/messages/errors.gen.js
2
+ var ErrRunCancelled = { code: 70024, message: "\u672C\u6B21\u8FD0\u884C\u5DF2\u53D6\u6D88" };
3
+ var ErrRunPreparationTimeout = { code: 70027, message: "\u8FD0\u884C\u51C6\u5907\u8D85\u65F6\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u540E\u91CD\u8BD5" };
4
+ var ErrDependencyInstallFailed = { code: 70030, message: "\u5DE5\u7A0B\u4F9D\u8D56\u5B89\u88C5\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5" };
5
+ var ErrDependencyInstallTimeout = { code: 70031, message: "\u5DE5\u7A0B\u4F9D\u8D56\u5B89\u88C5\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5" };
6
+ var ErrInvalidConfiguration = { code: 70402, message: "\u670D\u52A1\u914D\u7F6E\u65E0\u6548" };
7
+
8
+ // vendor/agent-cli/dist/src/protocol/link/envelope.js
9
+ var LinkError = class extends Error {
10
+ code;
11
+ constructor(err, cause) {
12
+ super(err.message, cause === void 0 ? void 0 : { cause });
13
+ this.name = "AgentRunError";
14
+ this.code = err.code;
15
+ }
16
+ /** JSON 输出只包含公开字段,不传出内部原因。 */
17
+ toJSON() {
18
+ return { code: this.code, message: this.message };
19
+ }
20
+ };
21
+
22
+ // vendor/agent-cli/dist/src/component/preparation.js
23
+ var DEFAULT_PREPARATION_TIMEOUT_MS = 12e4;
24
+ async function withPreparation(options, work) {
25
+ const timeoutMs = options.timeoutMs ?? DEFAULT_PREPARATION_TIMEOUT_MS;
26
+ if (!Number.isFinite(timeoutMs) || timeoutMs <= 0 || timeoutMs > 36e5) {
27
+ throw new LinkError(ErrInvalidConfiguration, "preparation timeout must be within 1..3600000ms");
28
+ }
29
+ const controller = new AbortController();
30
+ const onAbort = () => controller.abort(options.signal?.reason instanceof LinkError ? options.signal.reason : new LinkError(ErrRunCancelled));
31
+ if (options.signal?.aborted)
32
+ onAbort();
33
+ else
34
+ options.signal?.addEventListener("abort", onAbort, { once: true });
35
+ const timer = setTimeout(() => {
36
+ if (!controller.signal.aborted)
37
+ controller.abort(options.diagnostics?.timeoutError(timeoutMs) ?? new LinkError(ErrRunPreparationTimeout));
38
+ }, timeoutMs);
39
+ try {
40
+ controller.signal.throwIfAborted();
41
+ const result = await work(controller.signal);
42
+ controller.signal.throwIfAborted();
43
+ return result;
44
+ } catch (err) {
45
+ if (controller.signal.aborted)
46
+ throw controller.signal.reason;
47
+ throw err;
48
+ } finally {
49
+ clearTimeout(timer);
50
+ options.signal?.removeEventListener("abort", onAbort);
51
+ }
52
+ }
53
+
54
+ // vendor/agent-cli/dist/src/shared/output-guard.js
55
+ var DEFAULT_MAX_OUTPUT_BYTES = 128 * 1024;
56
+ var STREAM_COLLECT_LIMIT_BYTES = 1024 * 1024;
57
+ var MIN_BINARY_RUN_LENGTH = 4096;
58
+ var BINARY_RUN_RE = new RegExp(`[A-Za-z0-9+/=_-]{${MIN_BINARY_RUN_LENGTH},}`, "g");
59
+
60
+ // vendor/agent-cli/dist/src/shared/shell-runtime.js
61
+ import fs from "node:fs";
62
+ import { spawn } from "node:child_process";
63
+ var IS_WINDOWS = process.platform === "win32";
64
+ var currentRuntime = {
65
+ platform: process.platform,
66
+ env: process.env,
67
+ isFile: (candidate) => {
68
+ try {
69
+ return fs.statSync(candidate).isFile();
70
+ } catch {
71
+ return false;
72
+ }
73
+ },
74
+ pathExists: (candidate) => fs.existsSync(candidate)
75
+ };
76
+ function killProcessTree(pid) {
77
+ if (!pid)
78
+ return Promise.resolve();
79
+ if (IS_WINDOWS) {
80
+ return new Promise((resolve) => {
81
+ let settled = false;
82
+ const finish = () => {
83
+ if (settled)
84
+ return;
85
+ settled = true;
86
+ resolve();
87
+ };
88
+ const fallback = () => {
89
+ try {
90
+ process.kill(pid);
91
+ } catch {
92
+ }
93
+ finish();
94
+ };
95
+ try {
96
+ const killer = spawn("taskkill", ["/pid", String(pid), "/T", "/F"], {
97
+ stdio: "ignore",
98
+ windowsHide: true
99
+ });
100
+ killer.once("error", fallback);
101
+ killer.once("close", finish);
102
+ } catch {
103
+ fallback();
104
+ }
105
+ });
106
+ }
107
+ try {
108
+ process.kill(-pid, "SIGKILL");
109
+ } catch {
110
+ try {
111
+ process.kill(pid, "SIGKILL");
112
+ } catch {
113
+ }
114
+ }
115
+ return Promise.resolve();
116
+ }
117
+
118
+ // vendor/agent-cli/dist/src/component/execution.js
119
+ import fs2 from "node:fs";
120
+
121
+ // vendor/agent-cli/dist/src/component/process-isolation.js
122
+ import { AsyncLocalStorage } from "node:async_hooks";
123
+ import { mkdtemp, rm, realpath, stat } from "node:fs/promises";
124
+ import path from "node:path";
125
+ import { fileURLToPath } from "node:url";
126
+ var scopes = new AsyncLocalStorage();
127
+ async function isolatedInvocation(file, args, options) {
128
+ const scope = scopes.getStore();
129
+ if (!scope || options.trustedNetwork)
130
+ return { file, args, options };
131
+ const cwd = await realpath(options.cwd);
132
+ const mounts = /* @__PURE__ */ new Set([scope.directory]);
133
+ for (const source of options.readOnlyDirectories ?? []) {
134
+ const canonical = await realpath(source);
135
+ if (canonical !== source || !(await stat(canonical)).isDirectory())
136
+ throw Error("redirected frozen context");
137
+ mounts.add(canonical);
138
+ }
139
+ const within = (root, target) => {
140
+ const relative = path.relative(root, target);
141
+ return relative !== ".." && !relative.startsWith("../") && !path.isAbsolute(relative);
142
+ };
143
+ if (!within(scope.workspace, cwd) && ![...mounts].some((root) => within(root, cwd)))
144
+ throw Error("isolated cwd outside approved directories");
145
+ const bwrapArgs = ["--unshare-user", "--unshare-pid", "--unshare-net", "--unshare-ipc", "--unshare-uts", "--unshare-cgroup", "--uid", "10001", "--gid", "10001", "--die-with-parent", "--new-session", "--ro-bind", "/", "/", "--tmpfs", "/tmp", "--proc", "/proc", "--dev", "/dev", "--bind", scope.workspace, scope.workspace];
146
+ for (const source of mounts)
147
+ bwrapArgs.push("--ro-bind", source, source);
148
+ bwrapArgs.push("--chdir", cwd, "--", process.execPath, fileURLToPath(new URL("./isolated-launcher.js", import.meta.url)), scope.directory);
149
+ const env = { ...options.env };
150
+ for (const key of Object.keys(env))
151
+ if (key.startsWith("CRAFT_WEB_") || key === "CRAFT_BWRAP_PATH" || ["NODE_OPTIONS", "NODE_EXTRA_CA_CERTS", "AGENT_CLI_TOKEN"].includes(key))
152
+ delete env[key];
153
+ return { file: scope.bwrap, args: bwrapArgs, options: {
154
+ ...options,
155
+ cwd,
156
+ env,
157
+ stdin: JSON.stringify({ file, args, env, stdin: options.stdin ?? "" })
158
+ } };
159
+ }
160
+
161
+ // vendor/agent-cli/dist/src/component/execution.js
162
+ import path3 from "node:path";
163
+ import { spawn as spawn2 } from "node:child_process";
164
+
165
+ // vendor/agent-cli/dist/src/shared/process-cwd.js
166
+ import path2 from "node:path";
167
+ function nativeProcessCwd(cwd) {
168
+ return process.platform === "win32" && path2.resolve(cwd).length >= 260 ? path2.toNamespacedPath(cwd) : cwd;
169
+ }
170
+
171
+ // vendor/agent-cli/dist/src/component/browser-queue.js
172
+ import { randomUUID } from "node:crypto";
173
+ var BrowserExecutionQueue = class {
174
+ active;
175
+ waiting = [];
176
+ totals = /* @__PURE__ */ new Map();
177
+ snapshot() {
178
+ return {
179
+ active: this.active ? { ...this.active } : null,
180
+ waiting: this.waiting.map((item) => ({ ...item.entry })),
181
+ totals: Object.fromEntries([...this.totals].map(([key, value]) => [key, { ...value }]))
182
+ };
183
+ }
184
+ async run(workspace, signal, action) {
185
+ signal?.throwIfAborted();
186
+ const entry = { id: randomUUID(), workspace, queuedAt: Date.now() };
187
+ await new Promise((resolve, reject) => {
188
+ const waiter = { entry, signal, grant: resolve, abort: () => {
189
+ const index = this.waiting.indexOf(waiter);
190
+ if (index < 0)
191
+ return;
192
+ this.waiting.splice(index, 1);
193
+ signal?.removeEventListener("abort", waiter.abort);
194
+ reject(signal?.reason ?? Error("Browser queue cancelled"));
195
+ } };
196
+ this.waiting.push(waiter);
197
+ signal?.addEventListener("abort", waiter.abort, { once: true });
198
+ if (signal?.aborted)
199
+ waiter.abort();
200
+ this.drain();
201
+ });
202
+ try {
203
+ signal?.throwIfAborted();
204
+ return await action();
205
+ } finally {
206
+ const total = this.totals.get(workspace) ?? { completed: 0, waitMs: 0 };
207
+ total.completed++;
208
+ total.waitMs += entry.startedAt - entry.queuedAt;
209
+ this.totals.set(workspace, total);
210
+ this.active = void 0;
211
+ this.drain();
212
+ }
213
+ }
214
+ drain() {
215
+ if (this.active)
216
+ return;
217
+ const next = this.waiting.shift();
218
+ if (!next)
219
+ return;
220
+ next.signal?.removeEventListener("abort", next.abort);
221
+ next.entry.startedAt = Date.now();
222
+ this.active = next.entry;
223
+ next.grant();
224
+ }
225
+ };
226
+ var queue = new BrowserExecutionQueue();
227
+ var enabled = false;
228
+ function withBrowserExecution(workspace, signal, action) {
229
+ return enabled ? queue.run(workspace, signal, action) : action();
230
+ }
231
+
232
+ // vendor/agent-cli/dist/src/component/execution.js
233
+ function resolveProgram(program, args, env) {
234
+ if (!program.trim() || program.includes("\0"))
235
+ throw new Error("\u7A0B\u5E8F\u540D\u4E0D\u80FD\u4E3A\u7A7A\u6216\u542B NUL");
236
+ if (program === "node" || program === "node.exe")
237
+ return { file: process.execPath, args };
238
+ if (["npm", "npm.cmd", "npx", "npx.cmd"].includes(program)) {
239
+ const name = program.startsWith("npx") ? "npx-cli.js" : "npm-cli.js";
240
+ const dirs = [path3.dirname(process.execPath), ...(env.PATH ?? env.Path ?? "").split(path3.delimiter)];
241
+ for (const dir of dirs) {
242
+ if (!dir)
243
+ continue;
244
+ const candidates = [
245
+ path3.join(dir, "node_modules", "npm", "bin", name),
246
+ path3.resolve(dir, "..", "lib", "node_modules", "npm", "bin", name),
247
+ path3.resolve(dir, "..", "share", "nodejs", "npm", "bin", name)
248
+ ];
249
+ for (const candidate of candidates) {
250
+ if (fs2.existsSync(candidate))
251
+ return { file: process.execPath, args: [candidate, ...args] };
252
+ }
253
+ }
254
+ if (process.platform === "win32")
255
+ throw new Error("\u672A\u627E\u5230 npm \u7684 JS \u5165\u53E3\uFF0C\u8BF7\u914D\u7F6E\u5B8C\u6574\u7684 Node/npm \u8FD0\u884C\u65F6");
256
+ }
257
+ if (process.platform === "win32" && /\.(cmd|bat)$/i.test(program)) {
258
+ throw new Error("\u6279\u5904\u7406\u6587\u4EF6\u9700\u8981\u901A\u8FC7\u660E\u786E\u7684 Shell \u6267\u884C\uFF1B\u7A0B\u5E8F\u6267\u884C\u53EA\u63A5\u53D7\u539F\u751F\u7A0B\u5E8F\u6216 Node/npm \u5165\u53E3");
259
+ }
260
+ return { file: program, args };
261
+ }
262
+ function processEnvironment(extra = {}) {
263
+ const inherited = { ...process.env };
264
+ for (const key of Object.keys(inherited)) {
265
+ if (key.startsWith("PLATFORM_") || key === "AGENT_CLI_TOKEN")
266
+ delete inherited[key];
267
+ }
268
+ const env = { ...inherited, ...extra, PYTHONIOENCODING: "utf-8", PYTHONUTF8: "1" };
269
+ delete env.AGENT_CLI_TOKEN;
270
+ return env;
271
+ }
272
+ function runProcess(file, args, options) {
273
+ if (options.env.CRAFT_RUNTIME_REQUIREMENTS === "browser") {
274
+ return withBrowserExecution(options.cwd, options.signal, () => runOwnedProcess(file, args, options));
275
+ }
276
+ return runOwnedProcess(file, args, options);
277
+ }
278
+ async function runOwnedProcess(file, args, options) {
279
+ const invocation = await isolatedInvocation(file, args, options);
280
+ file = invocation.file;
281
+ args = invocation.args;
282
+ options = invocation.options;
283
+ if (options.signal?.aborted) {
284
+ return Promise.resolve({ exitCode: -1, signal: null, stdout: "", stderr: "", timedOut: false, aborted: true });
285
+ }
286
+ return new Promise((resolve, reject) => {
287
+ const child = spawn2(file, args, {
288
+ cwd: nativeProcessCwd(options.cwd),
289
+ env: options.env,
290
+ windowsHide: true,
291
+ detached: process.platform !== "win32",
292
+ stdio: ["pipe", "pipe", "pipe"]
293
+ });
294
+ const stdout = [];
295
+ const stderr = [];
296
+ let stdoutBytes = 0;
297
+ let stderrBytes = 0;
298
+ let timedOut = false;
299
+ let aborted = false;
300
+ let settled = false;
301
+ let processTreeStopped;
302
+ const stopProcessTree = () => {
303
+ processTreeStopped ??= killProcessTree(child.pid);
304
+ return processTreeStopped;
305
+ };
306
+ const collect = (kind, chunk) => {
307
+ const used = kind === "stdout" ? stdoutBytes : stderrBytes;
308
+ const part = chunk.subarray(0, Math.max(0, STREAM_COLLECT_LIMIT_BYTES - used));
309
+ if (part.length === 0)
310
+ return;
311
+ if (kind === "stdout") {
312
+ stdout.push(part);
313
+ stdoutBytes += part.length;
314
+ } else {
315
+ stderr.push(part);
316
+ stderrBytes += part.length;
317
+ }
318
+ };
319
+ child.stdout.on("data", (chunk) => collect("stdout", chunk));
320
+ child.stderr.on("data", (chunk) => collect("stderr", chunk));
321
+ const timer = setTimeout(() => {
322
+ timedOut = true;
323
+ void stopProcessTree();
324
+ }, options.timeoutMs);
325
+ const onAbort = () => {
326
+ aborted = true;
327
+ void stopProcessTree();
328
+ };
329
+ options.signal?.addEventListener("abort", onAbort, { once: true });
330
+ if (options.signal?.aborted)
331
+ onAbort();
332
+ const finish = async (error, code = null, signal = null) => {
333
+ if (settled)
334
+ return;
335
+ settled = true;
336
+ clearTimeout(timer);
337
+ options.signal?.removeEventListener("abort", onAbort);
338
+ await processTreeStopped;
339
+ if (error) {
340
+ reject(error);
341
+ return;
342
+ }
343
+ resolve({ signal, exitCode: timedOut || aborted ? -1 : code ?? -1, stdout: Buffer.concat(stdout).toString("utf8"), stderr: Buffer.concat(stderr).toString("utf8"), timedOut, aborted });
344
+ };
345
+ child.on("error", (error) => {
346
+ void finish(error);
347
+ });
348
+ child.on("close", (code, signal) => {
349
+ void finish(void 0, code, signal);
350
+ });
351
+ const onOutputError = (error) => {
352
+ if (settled)
353
+ return;
354
+ void stopProcessTree();
355
+ void finish(error);
356
+ };
357
+ child.stdout.on("error", onOutputError);
358
+ child.stderr.on("error", onOutputError);
359
+ child.stdin.on("error", (error) => {
360
+ if (error.code !== "EPIPE" && error.code !== "ERR_STREAM_DESTROYED") {
361
+ void stopProcessTree();
362
+ void finish(error);
363
+ }
364
+ });
365
+ child.stdin.end(options.stdin ?? "");
366
+ });
367
+ }
368
+
369
+ // vendor/agent-cli/dist/src/component/runtime.js
370
+ import os from "node:os";
371
+ import path4 from "node:path";
372
+ import { createRequire } from "node:module";
373
+ var probeScript = [
374
+ "const fs=require('node:fs');const {chromium}=require(process.argv[1]);",
375
+ "const candidates=JSON.parse(process.argv[2]);",
376
+ "candidates.push({exe:chromium.executablePath(),source:'managed'});",
377
+ "(async()=>{const failures=[];for(const item of candidates){",
378
+ "if(!fs.existsSync(item.exe))continue;let browser;",
379
+ "try{browser=await chromium.launch({executablePath:item.exe,headless:true,timeout:15000,chromiumSandbox:true,args:['--disable-dev-shm-usage','--enable-unsafe-swiftshader']});",
380
+ "await browser.close();console.log(JSON.stringify({exe:item.exe,source:item.source}));return;",
381
+ "}catch(e){if(browser)await browser.close().catch(()=>{});failures.push(item.source+': '+e.message);}}",
382
+ "console.log(JSON.stringify({missing:!fs.existsSync(chromium.executablePath()),failures}));})().catch(e=>{console.error(e.message);process.exit(1)});"
383
+ ].join("\n");
384
+ function playwrightEntry(cwd, env) {
385
+ const roots = [
386
+ env.PLAYWRIGHT_PACKAGE_ROOT,
387
+ path4.join(cwd, "node_modules"),
388
+ ...(env.NODE_PATH ?? "").split(path4.delimiter),
389
+ path4.dirname(process.execPath),
390
+ "/opt/js-toolchain/node_modules",
391
+ "/usr/local/lib/node_modules",
392
+ "/usr/lib/node_modules"
393
+ ].filter((root) => !!root);
394
+ const anchors = [...roots.map((root) => path4.join(root, "__agent_runtime.cjs")), import.meta.url];
395
+ for (const anchor of anchors) {
396
+ try {
397
+ return createRequire(anchor).resolve("playwright");
398
+ } catch (error) {
399
+ if (error.code !== "MODULE_NOT_FOUND")
400
+ throw error;
401
+ }
402
+ }
403
+ throw new Error("\u6D4F\u89C8\u5668\u80FD\u529B\u9700\u8981 Playwright API \u5305\uFF1B\u8BF7\u4F7F\u7528\u542B\u8BE5\u80FD\u529B\u7684\u5BA2\u6237\u7AEF\u8FD0\u884C\u65F6\u6216\u5728\u6267\u884C\u7AEF\u5B89\u88C5 playwright\u3002");
404
+ }
405
+ function browserCandidates(env) {
406
+ const explicit = env.CRAFT_BROWSER_EXECUTABLE || env.UE_CHECK_BROWSER || env.CHROME_PATH;
407
+ const dirs = process.platform === "win32" ? [
408
+ env.PROGRAMFILES,
409
+ env["ProgramFiles(x86)"],
410
+ env.LOCALAPPDATA
411
+ ].filter((value) => !!value) : [];
412
+ const paths = process.platform === "win32" ? dirs.flatMap((dir) => [
413
+ path4.join(dir, "Google", "Chrome", "Application", "chrome.exe"),
414
+ path4.join(dir, "Microsoft", "Edge", "Application", "msedge.exe")
415
+ ]) : process.platform === "darwin" ? [
416
+ "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
417
+ "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
418
+ ] : ["/usr/bin/google-chrome", "/usr/bin/google-chrome-stable", "/usr/bin/microsoft-edge", "/usr/bin/chromium", "/usr/bin/chromium-browser"];
419
+ return [...new Set([explicit, ...paths].filter((value) => !!value))].map((exe) => ({ exe, source: exe === explicit ? "configured" : "system" }));
420
+ }
421
+ async function probe(entry, options, env) {
422
+ const candidates = browserCandidates(env);
423
+ const result = await runProcess(process.execPath, ["-e", probeScript, entry, JSON.stringify(candidates)], {
424
+ cwd: options.cwd,
425
+ env,
426
+ signal: options.signal,
427
+ timeoutMs: 12e4
428
+ });
429
+ if (result.aborted)
430
+ throw new Error("\u6D4F\u89C8\u5668\u8FD0\u884C\u65F6\u51C6\u5907\u5DF2\u53D6\u6D88");
431
+ if (result.exitCode !== 0)
432
+ throw new Error("\u6D4F\u89C8\u5668\u63A2\u6D4B\u5931\u8D25: " + result.stderr);
433
+ return JSON.parse(result.stdout);
434
+ }
435
+ async function prepareBrowserEnvironment(options) {
436
+ const env = processEnvironment(options.env);
437
+ const entry = playwrightEntry(options.cwd, env);
438
+ let state = await probe(entry, options, env);
439
+ if (!state.exe && state.missing && env.CRAFT_RUNTIME_POLICY !== "preinstalled") {
440
+ env.PLAYWRIGHT_BROWSERS_PATH ||= path4.join(process.platform === "win32" ? env.LOCALAPPDATA || os.homedir() : env.XDG_CACHE_HOME || path4.join(os.homedir(), ".cache"), "craft-agent", "runtime", "playwright");
441
+ state = await probe(entry, options, env);
442
+ if (!state.exe && state.missing) {
443
+ const pkgDir = path4.dirname(createRequire(entry).resolve("playwright/package.json"));
444
+ const result = await runProcess(process.execPath, [path4.join(pkgDir, "cli.js"), "install", "chromium"], {
445
+ cwd: options.cwd,
446
+ env,
447
+ signal: options.signal,
448
+ timeoutMs: 3e5
449
+ });
450
+ if (result.exitCode !== 0)
451
+ throw new Error("\u6D4F\u89C8\u5668\u6309\u9700\u5B89\u88C5\u5931\u8D25: " + result.stderr);
452
+ state = await probe(entry, options, env);
453
+ }
454
+ }
455
+ if (!state.exe)
456
+ throw new Error("\u6267\u884C\u7AEF\u6CA1\u6709\u53EF\u7528\u6D4F\u89C8\u5668: " + (state.failures?.join(" | ") || "\u9884\u88C5\u6D4F\u89C8\u5668\u7F3A\u5931"));
457
+ const packageRoot = path4.dirname(path4.dirname(createRequire(entry).resolve("playwright/package.json")));
458
+ return {
459
+ CRAFT_BROWSER_EXECUTABLE: state.exe,
460
+ UE_CHECK_BROWSER: state.exe,
461
+ PLAYWRIGHT_PACKAGE_ROOT: packageRoot,
462
+ NODE_PATH: [packageRoot, env.NODE_PATH].filter(Boolean).join(path4.delimiter),
463
+ ...env.PLAYWRIGHT_BROWSERS_PATH ? { PLAYWRIGHT_BROWSERS_PATH: env.PLAYWRIGHT_BROWSERS_PATH } : {}
464
+ };
465
+ }
466
+
467
+ // vendor/agent-cli/dist/src/component/process-diagnostics.js
468
+ var REASONS = {
469
+ ENOTFOUND: "dns",
470
+ EAI_AGAIN: "dns",
471
+ ECONNREFUSED: "connection_refused",
472
+ ECONNRESET: "connection_reset",
473
+ ETIMEDOUT: "timeout",
474
+ ESOCKETTIMEDOUT: "timeout",
475
+ UND_ERR_CONNECT_TIMEOUT: "timeout",
476
+ CERT_HAS_EXPIRED: "certificate",
477
+ UNABLE_TO_VERIFY_LEAF_SIGNATURE: "certificate",
478
+ DEPTH_ZERO_SELF_SIGNED_CERT: "certificate",
479
+ SELF_SIGNED_CERT_IN_CHAIN: "certificate",
480
+ ENOSPC: "disk_full",
481
+ EDQUOT: "disk_full",
482
+ EACCES: "permission_denied",
483
+ EPERM: "permission_denied",
484
+ ENOENT: "not_found",
485
+ EROFS: "read_only",
486
+ EIO: "io_error",
487
+ EUSAGE: "lockfile_invalid",
488
+ EJSONPARSE: "invalid_manifest",
489
+ ERESOLVE: "dependency_conflict",
490
+ ETARGET: "package_unavailable",
491
+ E404: "package_unavailable",
492
+ E401: "authentication",
493
+ E403: "permission_denied",
494
+ EEXIST: "path_conflict",
495
+ ENOTEMPTY: "path_conflict",
496
+ ENOTDIR: "not_directory",
497
+ EISDIR: "not_directory",
498
+ ELOOP: "symlink_loop",
499
+ EMFILE: "file_limit",
500
+ ENFILE: "file_limit"
501
+ };
502
+ var DiagnosticCause = class extends Error {
503
+ reason;
504
+ fields;
505
+ constructor(reason, fields = {}, cause) {
506
+ super(reason, { cause });
507
+ this.reason = reason;
508
+ this.fields = fields;
509
+ }
510
+ };
511
+ function npmFailureReason(stderr) {
512
+ const codes = [...stderr.matchAll(/^npm (?:ERR!|error) code ([A-Z0-9_]+)\s*$/gm)];
513
+ return REASONS[codes.at(-1)?.[1] ?? ""] ?? "process_exit";
514
+ }
515
+ function validateRegistry(raw) {
516
+ try {
517
+ const url = new URL(raw);
518
+ if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || url.search || url.hash || /[\s\x00-\x1f]/.test(raw))
519
+ throw new Error();
520
+ return url.href;
521
+ } catch {
522
+ throw new DiagnosticCause("invalid_registry");
523
+ }
524
+ }
525
+
526
+ // vendor/agent-cli/dist/src/shared/replace-file.js
527
+ import fs3 from "node:fs/promises";
528
+ import path5 from "node:path";
529
+ import { randomUUID as randomUUID2 } from "node:crypto";
530
+ async function replaceFile(source, target) {
531
+ const previous = process.platform === "win32" ? await fs3.lstat(target).catch((error) => {
532
+ if (error.code === "ENOENT")
533
+ return void 0;
534
+ throw error;
535
+ }) : void 0;
536
+ if (!previous || (previous.mode & 128) !== 0) {
537
+ await fs3.rename(source, target);
538
+ return;
539
+ }
540
+ const pinned = path5.join(path5.dirname(target), `.replace-prior-${randomUUID2()}.tmp`);
541
+ await fs3.link(target, pinned);
542
+ try {
543
+ const opened = await fs3.lstat(pinned);
544
+ if (!opened.isFile() || opened.dev !== previous.dev || opened.ino !== previous.ino)
545
+ throw new Error("Replacement target identity changed");
546
+ await fs3.chmod(pinned, previous.mode | 128);
547
+ try {
548
+ await fs3.rename(source, target);
549
+ } finally {
550
+ await fs3.chmod(pinned, previous.mode);
551
+ }
552
+ } finally {
553
+ await fs3.unlink(pinned);
554
+ }
555
+ }
556
+
557
+ // vendor/agent-cli/dist/src/artifacts/static.js
558
+ import { createHash as createHash2 } from "node:crypto";
559
+ import { constants as constants3 } from "node:fs";
560
+ import { lstat as lstat2, open, readFile as readFile3, readdir as readdir2, realpath as realpath3, stat as stat3, unlink } from "node:fs/promises";
561
+ import path8 from "node:path";
562
+
563
+ // vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js
564
+ import { createHash } from "node:crypto";
565
+ import { constants as constants2 } from "node:fs";
566
+ import { chmod, copyFile, link, lstat, mkdir, mkdtemp as mkdtemp2, readFile as readFile2, readdir, readlink, realpath as realpath2, rename, rm as rm2, symlink, writeFile } from "node:fs/promises";
567
+ import path7 from "node:path";
568
+
569
+ // vendor/agent-cli/dist/src/artifacts/dependency-toolchain.js
570
+ import { constants } from "node:fs";
571
+ import { access, readFile, stat as stat2 } from "node:fs/promises";
572
+ import path6 from "node:path";
573
+ var record = (value) => !!value && typeof value === "object" && !Array.isArray(value);
574
+ async function missingDeclaredToolchain(projectDir, manifest) {
575
+ if (!manifest) {
576
+ let data;
577
+ try {
578
+ data = JSON.parse(await readFile(path6.join(projectDir, "package.json"), "utf8"));
579
+ } catch (error) {
580
+ if (error.code === "ENOENT")
581
+ return false;
582
+ throw error;
583
+ }
584
+ if (!record(data))
585
+ return false;
586
+ manifest = data;
587
+ }
588
+ const declared = {
589
+ ...record(manifest.dependencies) ? manifest.dependencies : {},
590
+ ...record(manifest.devDependencies) ? manifest.devDependencies : {}
591
+ };
592
+ const scripts = record(manifest.scripts) ? Object.values(manifest.scripts).filter((value) => typeof value === "string").join("\n") : "";
593
+ for (const tool of [{ dependency: "typescript", bin: "tsc", script: /\btsc\b/ }, { dependency: "vite", bin: "vite", script: /\bvite\b/ }]) {
594
+ if (typeof declared[tool.dependency] !== "string" || !tool.script.test(scripts))
595
+ continue;
596
+ const executable = path6.join(projectDir, "node_modules", ".bin", tool.bin + (process.platform === "win32" ? ".cmd" : ""));
597
+ try {
598
+ if (!(await stat2(executable)).isFile())
599
+ return true;
600
+ await access(executable, process.platform === "win32" ? constants.F_OK : constants.X_OK);
601
+ } catch (error) {
602
+ if (["ENOENT", "ENOTDIR", "EACCES"].includes(error.code ?? ""))
603
+ return true;
604
+ throw error;
605
+ }
606
+ }
607
+ return false;
608
+ }
609
+
610
+ // vendor/agent-cli/dist/src/artifacts/preinstalled-dependencies.js
611
+ var RECEIPT = ".agent-cli-preinstalled.json";
612
+ var DEPENDENCY_FIELDS = ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies", "peerDependenciesMeta", "overrides"];
613
+ function preinstalledRuntimeIdentity() {
614
+ const header = process.report.getReport().header;
615
+ return {
616
+ platform: process.platform,
617
+ arch: process.arch,
618
+ node: process.versions.node,
619
+ libc: process.platform === "linux" ? header.glibcVersionRuntime ?? "musl" : "none"
620
+ };
621
+ }
622
+ function record2(value) {
623
+ return !!value && typeof value === "object" && !Array.isArray(value);
624
+ }
625
+ function stable(value) {
626
+ if (Array.isArray(value))
627
+ return `[${value.map(stable).join(",")}]`;
628
+ if (record2(value))
629
+ return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${stable(value[key])}`).join(",")}}`;
630
+ return JSON.stringify(value);
631
+ }
632
+ function digest(value) {
633
+ return createHash("sha256").update(stable(value)).digest("hex");
634
+ }
635
+ function dependencies(manifest) {
636
+ return Object.fromEntries(DEPENDENCY_FIELDS.filter((key) => record2(manifest[key]) && Object.keys(manifest[key]).length).map((key) => [key, manifest[key]]));
637
+ }
638
+ function coversDependencies(wanted, provided) {
639
+ for (const field of DEPENDENCY_FIELDS) {
640
+ const need = wanted[field];
641
+ if (!record2(need))
642
+ continue;
643
+ const have = provided[field];
644
+ if (!record2(have))
645
+ return false;
646
+ for (const [name, spec] of Object.entries(need))
647
+ if (stable(have[name]) !== stable(spec))
648
+ return false;
649
+ }
650
+ return true;
651
+ }
652
+ function resolveEdge(packages, from, name) {
653
+ for (let base = from; ; ) {
654
+ const location = `${base ? `${base}/` : ""}node_modules/${name}`;
655
+ if (location in packages)
656
+ return location;
657
+ if (!base)
658
+ return void 0;
659
+ const parent = base.lastIndexOf("/node_modules/");
660
+ base = parent < 0 ? "" : base.slice(0, parent);
661
+ }
662
+ }
663
+ function reachablePackages(lock, manifest) {
664
+ const keep = /* @__PURE__ */ new Set();
665
+ const pending = [["", manifest]];
666
+ for (let next = pending.pop(); next; next = pending.pop()) {
667
+ const [from, pkg] = next;
668
+ const fields = from ? ["dependencies", "optionalDependencies", "peerDependencies"] : ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies"];
669
+ for (const field of fields) {
670
+ const edges = pkg[field];
671
+ if (!record2(edges))
672
+ continue;
673
+ for (const name of Object.keys(edges)) {
674
+ const location = resolveEdge(lock.packages, from, name);
675
+ if (!location || keep.has(location))
676
+ continue;
677
+ keep.add(location);
678
+ pending.push([location, lock.packages[location]]);
679
+ }
680
+ }
681
+ }
682
+ return Object.fromEntries(Object.entries(lock.packages).filter(([relative]) => keep.has(relative)));
683
+ }
684
+ function inside(root, target) {
685
+ const relative = path7.relative(root, target);
686
+ return relative === "" || !relative.startsWith(`..${path7.sep}`) && relative !== ".." && !path7.isAbsolute(relative);
687
+ }
688
+ async function jsonFile(file, maxBytes = 8 * 1024 * 1024) {
689
+ const info = await lstat(file);
690
+ if (!info.isFile() || info.size > maxBytes)
691
+ throw new DiagnosticCause("preinstalled_invalid");
692
+ const value = JSON.parse(await readFile2(file, "utf8"));
693
+ if (!record2(value))
694
+ throw new DiagnosticCause("preinstalled_invalid");
695
+ return value;
696
+ }
697
+ function asLock(value) {
698
+ if (value.lockfileVersion !== 3 || !record2(value.packages) || !record2(value.packages[""]))
699
+ throw new DiagnosticCause("preinstalled_invalid");
700
+ return value;
701
+ }
702
+ var METADATA_FIELDS = ["license", "funding", "deprecated"];
703
+ var IDENTITY_VERSION = 2;
704
+ var PUBLIC_REGISTRY = "https://registry.npmjs.org/";
705
+ function packageName(relative, pkg) {
706
+ return typeof pkg.name === "string" ? pkg.name : relative.slice(relative.lastIndexOf("node_modules/") + "node_modules/".length);
707
+ }
708
+ function registryTarballBase(relative, pkg) {
709
+ if (typeof pkg.resolved !== "string" || typeof pkg.version !== "string" || typeof pkg.integrity !== "string" || !/^sha512-[A-Za-z0-9+/]{86}==$/.test(pkg.integrity))
710
+ return void 0;
711
+ let url;
712
+ try {
713
+ url = new URL(pkg.resolved);
714
+ } catch {
715
+ return void 0;
716
+ }
717
+ if (url.protocol !== "https:" || url.username || url.password || url.search || url.hash)
718
+ return void 0;
719
+ const name = packageName(relative, pkg);
720
+ const suffix = `/${name}/-/${name.slice(name.lastIndexOf("/") + 1)}-${pkg.version}.tgz`;
721
+ if (!url.pathname.endsWith(suffix) || url.href !== pkg.resolved)
722
+ return void 0;
723
+ return `${url.origin}${url.pathname.slice(0, -suffix.length)}/`;
724
+ }
725
+ function lockIdentity(lock) {
726
+ const peerTargets = /* @__PURE__ */ new Set();
727
+ for (const pkg of Object.values(lock.packages)) {
728
+ if (record2(pkg) && record2(pkg.peerDependencies))
729
+ for (const name of Object.keys(pkg.peerDependencies))
730
+ peerTargets.add(name);
731
+ }
732
+ const packages = { "": dependencies(lock.packages[""]) };
733
+ for (const [relative, pkg] of Object.entries(lock.packages)) {
734
+ if (!relative)
735
+ continue;
736
+ if (!record2(pkg)) {
737
+ packages[relative] = pkg;
738
+ continue;
739
+ }
740
+ const normalized = { ...pkg };
741
+ for (const field of METADATA_FIELDS)
742
+ delete normalized[field];
743
+ if (registryTarballBase(relative, pkg))
744
+ normalized.resolved = "registry-tarball";
745
+ if (normalized.peer === true && peerTargets.has(packageName(relative, pkg)))
746
+ delete normalized.peer;
747
+ packages[relative] = normalized;
748
+ }
749
+ return packages;
750
+ }
751
+ function lockCovers(projectLock, bundleLock) {
752
+ if (untrustedRegistry(projectLock, bundleLock))
753
+ return false;
754
+ const bundleId = lockIdentity(bundleLock);
755
+ for (const [relative, pkg] of Object.entries(lockIdentity(projectLock))) {
756
+ if (!relative)
757
+ continue;
758
+ if (stable(bundleId[relative]) !== stable(pkg))
759
+ return false;
760
+ }
761
+ return coversDependencies(dependencies(projectLock.packages[""]), dependencies(bundleLock.packages[""]));
762
+ }
763
+ function untrustedRegistry(projectLock, bundleLock) {
764
+ const trusted = /* @__PURE__ */ new Set([PUBLIC_REGISTRY]);
765
+ try {
766
+ if (process.env.CRAFT_NPM_REGISTRY)
767
+ trusted.add(new URL(validateRegistry(process.env.CRAFT_NPM_REGISTRY)).href.replace(/\/?$/, "/"));
768
+ } catch {
769
+ }
770
+ for (const [relative, pkg] of Object.entries(bundleLock.packages)) {
771
+ const base = relative && record2(pkg) ? registryTarballBase(relative, pkg) : void 0;
772
+ if (base)
773
+ trusted.add(base);
774
+ }
775
+ return Object.entries(projectLock.packages).some(([relative, pkg]) => {
776
+ if (!relative || !record2(pkg) || pkg.resolved === bundleLock.packages[relative]?.resolved)
777
+ return false;
778
+ const base = registryTarballBase(relative, pkg);
779
+ return !base || !trusted.has(base);
780
+ });
781
+ }
782
+ async function matchBundle(root, cwd, manifest, hasLock, signal) {
783
+ const miss = (reason) => ({ source: "registry", reason });
784
+ if (!root)
785
+ return miss("preinstalled_unavailable");
786
+ if (!path7.isAbsolute(root))
787
+ return miss("preinstalled_invalid");
788
+ try {
789
+ root = await realpath2(root);
790
+ if (inside(cwd, root) || inside(root, cwd))
791
+ return miss("preinstalled_invalid");
792
+ const runtime = await jsonFile(path7.join(root, "runtime.json"), 4096);
793
+ if (Object.entries(preinstalledRuntimeIdentity()).some(([key, value]) => runtime[key] !== value))
794
+ return miss("preinstalled_mismatch");
795
+ if (manifest.workspaces || manifest.bundleDependencies || manifest.bundledDependencies)
796
+ return miss("preinstalled_mismatch");
797
+ const projectLock = hasLock ? asLock(await jsonFile(path7.join(cwd, "package-lock.json"))) : void 0;
798
+ const entries = await readdir(root, { withFileTypes: true });
799
+ if (entries.length > 32)
800
+ return miss("preinstalled_invalid");
801
+ for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
802
+ signal?.throwIfAborted();
803
+ if (!entry.isDirectory())
804
+ continue;
805
+ const bundle = path7.join(root, entry.name);
806
+ const candidate = await jsonFile(path7.join(bundle, "package.json"));
807
+ const candidateDeps = dependencies(candidate);
808
+ if (!coversDependencies(dependencies(manifest), candidateDeps))
809
+ continue;
810
+ const lock = asLock(await jsonFile(path7.join(bundle, "package-lock.json")));
811
+ if (stable(dependencies(lock.packages[""])) !== stable(candidateDeps))
812
+ return miss("preinstalled_invalid");
813
+ if (projectLock && !lockCovers(projectLock, lock))
814
+ continue;
815
+ const modules = path7.join(bundle, "node_modules");
816
+ if (!(await lstat(modules)).isDirectory() || await missingDeclaredToolchain(bundle, manifest))
817
+ return miss("preinstalled_invalid");
818
+ for (const [relative, pkg] of Object.entries(lock.packages)) {
819
+ signal?.throwIfAborted();
820
+ if (!relative)
821
+ continue;
822
+ if (!record2(pkg) || !relative.startsWith("node_modules/") || relative.includes("\\") || !inside(modules, path7.resolve(bundle, relative)))
823
+ return miss("preinstalled_invalid");
824
+ try {
825
+ const installed = await jsonFile(path7.join(bundle, relative, "package.json"));
826
+ if (installed.version !== pkg.version)
827
+ return miss("preinstalled_invalid");
828
+ } catch (error) {
829
+ if (pkg.optional === true && error.code === "ENOENT")
830
+ continue;
831
+ return miss("preinstalled_invalid");
832
+ }
833
+ }
834
+ return { modules, lock, projectLock };
835
+ }
836
+ return miss("preinstalled_mismatch");
837
+ } catch (error) {
838
+ signal?.throwIfAborted();
839
+ return miss(error.code === "ENOENT" ? "preinstalled_unavailable" : "preinstalled_invalid");
840
+ }
841
+ }
842
+ async function copyTree(source, destination, root, signal) {
843
+ signal?.throwIfAborted();
844
+ const info = await lstat(source);
845
+ if (info.isSymbolicLink()) {
846
+ const target = await readlink(source);
847
+ if (path7.isAbsolute(target) || !inside(root, path7.resolve(path7.dirname(source), target)) || !inside(root, await realpath2(source)))
848
+ throw new DiagnosticCause("preinstalled_invalid");
849
+ await symlink(target, destination);
850
+ } else if (info.isDirectory()) {
851
+ await mkdir(destination, { mode: 448 });
852
+ for (const name of await readdir(source)) {
853
+ if (name === RECEIPT || name === ".package-lock.json")
854
+ continue;
855
+ await copyTree(path7.join(source, name), path7.join(destination, name), root, signal);
856
+ }
857
+ } else if (info.isFile()) {
858
+ await copyFile(source, destination, constants2.COPYFILE_FICLONE);
859
+ await chmod(destination, info.mode & 511 | 384);
860
+ } else
861
+ throw new DiagnosticCause("preinstalled_invalid");
862
+ }
863
+ async function restorePreinstalledDependencies(cwd, manifest, hasLock, signal, report) {
864
+ const bundle = await matchBundle(process.env.CRAFT_JS_DEPENDENCIES_DIR ?? "", cwd, manifest, hasLock, signal);
865
+ if ("source" in bundle) {
866
+ report?.(bundle);
867
+ return false;
868
+ }
869
+ report?.({ source: "preinstalled", reason: "preinstalled_hit" });
870
+ signal?.throwIfAborted();
871
+ const staging = await mkdtemp2(path7.join(cwd, ".agent-cli-dependencies-"));
872
+ const modules = path7.join(cwd, "node_modules");
873
+ const replacement = path7.join(staging, "node_modules");
874
+ const previous = path7.join(staging, "previous");
875
+ try {
876
+ try {
877
+ await copyTree(bundle.modules, replacement, bundle.modules, signal);
878
+ } catch (error) {
879
+ if (error instanceof DiagnosticCause && error.reason === "preinstalled_invalid") {
880
+ report?.({ source: "registry", reason: "preinstalled_invalid" });
881
+ return false;
882
+ }
883
+ throw error;
884
+ }
885
+ signal?.throwIfAborted();
886
+ const lock = { ...bundle.lock, packages: { "": { ...dependencies(manifest) }, ...reachablePackages(bundle.lock, manifest) } };
887
+ for (const key of ["name", "version"]) {
888
+ delete lock[key];
889
+ if (typeof manifest[key] === "string")
890
+ lock[key] = lock.packages[""][key] = manifest[key];
891
+ }
892
+ await writeFile(path7.join(replacement, RECEIPT), JSON.stringify({
893
+ identity: IDENTITY_VERSION,
894
+ manifest: digest(dependencies(manifest)),
895
+ lock: digest(lockIdentity(bundle.projectLock ?? lock))
896
+ }), { mode: 384 });
897
+ if (!hasLock) {
898
+ const stagedLock = path7.join(staging, "package-lock.json");
899
+ await writeFile(stagedLock, JSON.stringify(lock, null, 2) + "\n", { flag: "wx", mode: 384 });
900
+ await link(stagedLock, path7.join(cwd, "package-lock.json"));
901
+ }
902
+ signal?.throwIfAborted();
903
+ let moved = false;
904
+ try {
905
+ await rename(modules, previous);
906
+ moved = true;
907
+ } catch (error) {
908
+ if (error.code !== "ENOENT")
909
+ throw error;
910
+ }
911
+ try {
912
+ await rename(replacement, modules);
913
+ } catch (error) {
914
+ if (moved)
915
+ await rename(previous, modules);
916
+ throw error;
917
+ }
918
+ return true;
919
+ } finally {
920
+ await rm2(staging, { recursive: true, force: true });
921
+ }
922
+ }
923
+
924
+ // vendor/agent-cli/dist/src/artifacts/build-failure.js
925
+ import { stripVTControlCharacters } from "node:util";
926
+ var BuildFailureError = class extends Error {
927
+ constructor(message, options) {
928
+ super(boundBuildDiagnostic(message), options);
929
+ }
930
+ };
931
+ function boundBuildDiagnostic(message) {
932
+ const clean = stripVTControlCharacters(message).replace(/[\x00-\x08\x0b-\x1f\x7f-\x9f]/g, "").trim();
933
+ let result = "";
934
+ let bytes = 0;
935
+ for (const char of clean) {
936
+ bytes += Buffer.byteLength(char);
937
+ if (bytes > 4e3)
938
+ break;
939
+ result += char;
940
+ }
941
+ return result;
942
+ }
943
+ function buildFailureExcerpt(stdout, stderr) {
944
+ const lines = stripVTControlCharacters(`${stdout}
945
+ ${stderr}`).split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
946
+ const picked = lines.filter((line) => /\berror TS\d+\b/.test(line) || /(?:tsc|vite): (?:not found|Permission denied)/.test(line) || /Could not resolve|Could not load|Cannot find module|Module not found/.test(line) || /^(?:Error:|error during build:|\[vite[^\]]*\])/.test(line) || /Found \d+ error/.test(line));
947
+ if (picked.length)
948
+ return boundBuildDiagnostic(picked.slice(0, 12).join("\n"));
949
+ const useful = lines.filter((line) => !/^npm notice\b/.test(line) && !/^\[export-config\].*\bslots=/.test(line));
950
+ return boundBuildDiagnostic((useful.length ? useful : lines).slice(-12).join("\n"));
951
+ }
952
+
953
+ // vendor/agent-cli/dist/src/artifacts/static.js
954
+ var PROJECT_INSTALL_TIMEOUT_MS = 6e5;
955
+ var INSTALL_PENDING = ".agent-cli-dependencies-pending";
956
+ async function installProjectDependencies(projectDir, runner = runNpmInstall, signal, timeoutMs = PROJECT_INSTALL_TIMEOUT_MS, report) {
957
+ signal?.throwIfAborted();
958
+ const context = await dependencyInstallContext(projectDir);
959
+ if (!context.hasDependencies)
960
+ return;
961
+ const args = context.hasLock ? ["ci", "--ignore-scripts", "--include=dev", "--no-audit", "--no-fund"] : ["install", "--ignore-scripts", "--include=dev", "--no-audit", "--no-fund", "--package-lock=true"];
962
+ signal?.throwIfAborted();
963
+ const markerPath = path8.join(context.cwd, INSTALL_PENDING);
964
+ await markDependencyInstall(markerPath);
965
+ const started = Date.now();
966
+ const budget = AbortSignal.timeout(timeoutMs);
967
+ const copySignal = signal ? AbortSignal.any([signal, budget]) : budget;
968
+ let reused;
969
+ try {
970
+ reused = await restorePreinstalledDependencies(context.cwd, context.manifest, context.hasLock, copySignal, report);
971
+ } catch (error) {
972
+ signal?.throwIfAborted();
973
+ if (budget.aborted)
974
+ throw new LinkError(ErrDependencyInstallTimeout, new DiagnosticCause("timeout", { timeout_ms: timeoutMs, timed_out: true }));
975
+ throw new LinkError(ErrDependencyInstallFailed, error);
976
+ }
977
+ if (!reused) {
978
+ const remaining = timeoutMs - (Date.now() - started);
979
+ if (remaining <= 0)
980
+ throw new LinkError(ErrDependencyInstallTimeout, new DiagnosticCause("timeout", { timeout_ms: timeoutMs, timed_out: true }));
981
+ const env = installEnvironment(true);
982
+ if (env.CRAFT_NPM_REGISTRY)
983
+ args.push("--registry", env.CRAFT_NPM_REGISTRY);
984
+ await runner(context.cwd, args, env, remaining, signal);
985
+ signal?.throwIfAborted();
986
+ if (await missingDeclaredToolchain(context.cwd))
987
+ throw new LinkError(ErrDependencyInstallFailed, new DiagnosticCause("toolchain_missing"));
988
+ }
989
+ signal?.throwIfAborted();
990
+ await unlink(markerPath);
991
+ }
992
+ async function markDependencyInstall(markerPath) {
993
+ try {
994
+ const marker = await open(markerPath, constants3.O_WRONLY | constants3.O_CREAT | constants3.O_EXCL, 384);
995
+ await marker.close();
996
+ } catch (error) {
997
+ if (error.code !== "EEXIST")
998
+ throw error;
999
+ const existing = await lstat2(markerPath);
1000
+ if (!existing.isFile() || existing.isSymbolicLink())
1001
+ throw new Error("dependency preparation marker must be a regular file");
1002
+ }
1003
+ }
1004
+ async function dependencyInstallContext(projectDir) {
1005
+ if (!path8.isAbsolute(projectDir))
1006
+ throw new Error("snapshot project directory must be absolute");
1007
+ const cwd = await realpath3(projectDir);
1008
+ if (!(await stat3(cwd)).isDirectory())
1009
+ throw new Error("snapshot project is not a directory");
1010
+ let packageData;
1011
+ try {
1012
+ packageData = JSON.parse(await readFile3(path8.join(cwd, "package.json"), "utf8"));
1013
+ } catch (error) {
1014
+ if (error.code === "ENOENT")
1015
+ return { cwd, manifest: {}, hasDependencies: false, hasLock: false };
1016
+ throw new DiagnosticCause("invalid_manifest", {}, error);
1017
+ }
1018
+ if (!isRecord(packageData))
1019
+ throw new Error("snapshot package.json is invalid");
1020
+ const manifest = packageData;
1021
+ const hasDependencies = ["dependencies", "devDependencies", "optionalDependencies"].some((key) => {
1022
+ const value = packageData[key];
1023
+ return isRecord(value) && Object.keys(value).length > 0;
1024
+ });
1025
+ if (!hasDependencies)
1026
+ return { cwd, manifest, hasDependencies: false, hasLock: false };
1027
+ try {
1028
+ const lock = await lstat2(path8.join(cwd, "package-lock.json"));
1029
+ if (!lock.isFile() || lock.isSymbolicLink())
1030
+ throw new Error("package-lock.json must be a regular file");
1031
+ return { cwd, manifest, hasDependencies, hasLock: true };
1032
+ } catch (error) {
1033
+ if (error.code === "ENOENT")
1034
+ return { cwd, manifest, hasDependencies, hasLock: false };
1035
+ throw error;
1036
+ }
1037
+ }
1038
+ function installEnvironment(install = false) {
1039
+ const env = {
1040
+ PATH: process.env.PATH ?? "",
1041
+ HOME: process.env.HOME ?? "",
1042
+ NODE_ENV: "production"
1043
+ };
1044
+ if (install && process.env.CRAFT_NPM_REGISTRY)
1045
+ env.CRAFT_NPM_REGISTRY = validateRegistry(process.env.CRAFT_NPM_REGISTRY);
1046
+ if (process.platform === "win32") {
1047
+ for (const key of ["SystemRoot", "WINDIR", "ComSpec", "PATHEXT", "TEMP", "TMP"]) {
1048
+ if (process.env[key])
1049
+ env[key] = process.env[key];
1050
+ }
1051
+ }
1052
+ return env;
1053
+ }
1054
+ async function buildJsStatic(projectDir, timeoutMs = 12e4, environment = {}, signal) {
1055
+ if (!path8.isAbsolute(projectDir) || timeoutMs < 1e3 || timeoutMs > 3e5)
1056
+ throw new Error("invalid JS build input", { cause: new DiagnosticCause("build_input_invalid") });
1057
+ const cwd = await realpath3(projectDir);
1058
+ if (!(await stat3(cwd)).isDirectory())
1059
+ throw new Error("JS project is not a directory", { cause: new DiagnosticCause("build_input_invalid") });
1060
+ const env = installEnvironment();
1061
+ for (const key of ["CLAUDE_DIR", "CLAUDE_PROJECT_DIR"]) {
1062
+ if (environment[key])
1063
+ env[key] = environment[key];
1064
+ }
1065
+ const npm = resolveProgram("npm", ["run", "build"], env);
1066
+ signal?.throwIfAborted();
1067
+ const result = await runProcess(npm.file, npm.args, { cwd, env, timeoutMs, signal, readOnlyDirectories: environment.CLAUDE_DIR ? [environment.CLAUDE_DIR] : [] });
1068
+ signal?.throwIfAborted();
1069
+ const details = { exit_code: result.exitCode, signal: result.signal, timed_out: result.timedOut, aborted: result.aborted, timeout_ms: timeoutMs };
1070
+ if (result.timedOut)
1071
+ throw new BuildFailureError("JS build timed out", { cause: new DiagnosticCause("timeout", details) });
1072
+ if (result.exitCode !== 0)
1073
+ throw new BuildFailureError(`JS build failed (exit ${result.exitCode}): ${buildFailureExcerpt(result.stdout, result.stderr)}`, { cause: new DiagnosticCause(result.signal ? "process_signal" : npmFailureReason(result.stderr), details) });
1074
+ }
1075
+ async function runNpmInstall(cwd, args, env, timeoutMs, signal) {
1076
+ const npm = resolveProgram("npm", args, env);
1077
+ const result = await runProcess(npm.file, npm.args, { cwd, env, timeoutMs, signal, trustedNetwork: true });
1078
+ const details = { exit_code: result.exitCode, signal: result.signal, timed_out: result.timedOut, aborted: result.aborted, timeout_ms: timeoutMs };
1079
+ if (signal?.aborted)
1080
+ throw new DiagnosticCause("cancelled", details, signal.reason);
1081
+ if (result.timedOut)
1082
+ throw new LinkError(ErrDependencyInstallTimeout, new DiagnosticCause("timeout", details));
1083
+ if (result.exitCode !== 0)
1084
+ throw new LinkError(ErrDependencyInstallFailed, new DiagnosticCause(result.signal ? "process_signal" : npmFailureReason(result.stderr), details));
1085
+ }
1086
+ function isRecord(value) {
1087
+ return typeof value === "object" && value !== null && !Array.isArray(value);
1088
+ }
1089
+ async function prepareStaticArtifacts(distDir) {
1090
+ if (!path8.isAbsolute(distDir))
1091
+ throw new Error("static directory must be absolute", { cause: new DiagnosticCause("static_output_invalid") });
1092
+ try {
1093
+ if ((await lstat2(distDir)).isSymbolicLink())
1094
+ throw new Error("static directory must not be a symlink", { cause: new DiagnosticCause("static_output_invalid") });
1095
+ } catch (error) {
1096
+ if (error.code === "ENOENT")
1097
+ throw new BuildFailureError("JS build produced no dist output", { cause: new DiagnosticCause("static_output_missing") });
1098
+ throw error;
1099
+ }
1100
+ const root = await realpath3(distDir);
1101
+ if (!(await stat3(root)).isDirectory())
1102
+ throw new Error("static output is not a directory", { cause: new DiagnosticCause("static_output_invalid") });
1103
+ const artifacts = [];
1104
+ let totalBytes = 0;
1105
+ async function walk(dir) {
1106
+ const entries = await readdir2(dir, { withFileTypes: true });
1107
+ entries.sort((a, b) => a.name.localeCompare(b.name));
1108
+ for (const entry of entries) {
1109
+ if (entry.name.startsWith(".") || /(?:secret|credential|token|private[_-]?key)/i.test(entry.name))
1110
+ continue;
1111
+ const absolute = path8.join(dir, entry.name);
1112
+ if (entry.isDirectory()) {
1113
+ await walk(absolute);
1114
+ continue;
1115
+ }
1116
+ if (!entry.isFile())
1117
+ continue;
1118
+ if (artifacts.length >= 2e3)
1119
+ throw new Error("static file count exceeds limit", { cause: new DiagnosticCause("static_limit_exceeded") });
1120
+ const handle = await open(absolute, constants3.O_RDONLY | (constants3.O_NOFOLLOW ?? 0));
1121
+ try {
1122
+ const info = await handle.stat();
1123
+ if (!info.isFile() || info.size > 8 * 1024 * 1024 || totalBytes + info.size > 64 * 1024 * 1024) {
1124
+ throw new Error("static file exceeds size limit", { cause: new DiagnosticCause("static_limit_exceeded") });
1125
+ }
1126
+ const content = await handle.readFile();
1127
+ if (content.length !== info.size)
1128
+ throw new Error("static file changed during collection", { cause: new DiagnosticCause("artifact_changed") });
1129
+ totalBytes += content.length;
1130
+ artifacts.push({
1131
+ relativePath: path8.relative(root, absolute).split(path8.sep).join("/"),
1132
+ path: absolute,
1133
+ bytes: content.length,
1134
+ sha256: createHash2("sha256").update(content).digest("hex")
1135
+ });
1136
+ } finally {
1137
+ await handle.close();
1138
+ }
1139
+ }
1140
+ }
1141
+ await walk(root);
1142
+ if (!artifacts.some((item) => item.relativePath === "index.html"))
1143
+ throw new BuildFailureError("JS build has no index.html", { cause: new DiagnosticCause("static_output_missing") });
1144
+ return artifacts;
1145
+ }
1146
+
1147
+ // vendor/agent-cli/dist/src/artifacts/external-game-archive.js
1148
+ import { createHash as createHash3 } from "node:crypto";
1149
+ var EXTERNAL_GAME_UPLOAD_LIMITS = Object.freeze({
1150
+ files: 2e3,
1151
+ fileBytes: 8 * 1024 * 1024,
1152
+ totalFileBytes: 64 * 1024 * 1024,
1153
+ archiveBytes: 65 * 1024 * 1024,
1154
+ gzipBytes: 66 * 1024 * 1024,
1155
+ jsonBytes: 90 * 1024 * 1024,
1156
+ pathBytes: 240,
1157
+ centralDirectoryBytes: 4 * 1024 * 1024
1158
+ });
1159
+ var crcTable = Uint32Array.from({ length: 256 }, (_, value) => {
1160
+ for (let bit = 0; bit < 8; bit++)
1161
+ value = value & 1 ? value >>> 1 ^ 3988292384 : value >>> 1;
1162
+ return value >>> 0;
1163
+ });
1164
+ function crc32(data) {
1165
+ let value = 4294967295;
1166
+ for (const byte of data)
1167
+ value = crcTable[(value ^ byte) & 255] ^ value >>> 8;
1168
+ return (value ^ 4294967295) >>> 0;
1169
+ }
1170
+ function checkedName(name) {
1171
+ if (typeof name !== "string" || !name || name.normalize("NFC") !== name || /[\p{Cc}\\:%?#<>|"*]/u.test(name) || name.split("/").some((part) => !part || part.startsWith(".") || part.endsWith(".") || part.endsWith(" "))) {
1172
+ throw new Error("Invalid external game archive file path");
1173
+ }
1174
+ const encoded = Buffer.from(name, "utf8");
1175
+ if (encoded.length > EXTERNAL_GAME_UPLOAD_LIMITS.pathBytes || encoded.toString("utf8") !== name) {
1176
+ throw new Error("External game archive file path exceeds the platform limit or contains invalid Unicode");
1177
+ }
1178
+ return encoded;
1179
+ }
1180
+ function collisionKey(name) {
1181
+ return name.toUpperCase().toLowerCase().normalize("NFC");
1182
+ }
1183
+ function encodeExternalGameArchive(files, signal) {
1184
+ signal?.throwIfAborted();
1185
+ const parts = [], central = [], names = /* @__PURE__ */ new Set();
1186
+ let offset = 0, centralBytes = 0, totalBytes = 0;
1187
+ let hasEntryPoint = false;
1188
+ for (const [name, input] of files) {
1189
+ signal?.throwIfAborted();
1190
+ const encoded = checkedName(name), key = collisionKey(name);
1191
+ if (names.size >= EXTERNAL_GAME_UPLOAD_LIMITS.files)
1192
+ throw new Error("External game archive file count exceeds the platform limit");
1193
+ if (names.has(key))
1194
+ throw new Error("External game archive contains duplicate file paths");
1195
+ if (!(input instanceof Uint8Array) || input.byteLength > EXTERNAL_GAME_UPLOAD_LIMITS.fileBytes || totalBytes + input.byteLength > EXTERNAL_GAME_UPLOAD_LIMITS.totalFileBytes) {
1196
+ throw new Error("External game archive file bytes exceed the platform limit");
1197
+ }
1198
+ names.add(key);
1199
+ totalBytes += input.byteLength;
1200
+ hasEntryPoint ||= name === "index.html" && input.byteLength > 0;
1201
+ const data = Buffer.from(input);
1202
+ const checksum = crc32(data);
1203
+ const local = Buffer.alloc(30);
1204
+ local.writeUInt32LE(67324752, 0);
1205
+ local.writeUInt16LE(20, 4);
1206
+ local.writeUInt16LE(2048, 6);
1207
+ local.writeUInt16LE(33, 12);
1208
+ local.writeUInt32LE(checksum, 14);
1209
+ local.writeUInt32LE(data.length, 18);
1210
+ local.writeUInt32LE(data.length, 22);
1211
+ local.writeUInt16LE(encoded.length, 26);
1212
+ const entry = Buffer.alloc(46);
1213
+ entry.writeUInt32LE(33639248, 0);
1214
+ entry.writeUInt16LE(20, 4);
1215
+ local.copy(entry, 6, 4, 30);
1216
+ entry.writeUInt32LE(offset, 42);
1217
+ parts.push(local, encoded, data);
1218
+ central.push(entry, encoded);
1219
+ offset += local.length + encoded.length + data.length;
1220
+ centralBytes += entry.length + encoded.length;
1221
+ if (centralBytes > EXTERNAL_GAME_UPLOAD_LIMITS.centralDirectoryBytes || offset + centralBytes + 22 > EXTERNAL_GAME_UPLOAD_LIMITS.archiveBytes) {
1222
+ throw new Error("External game ZIP exceeds the platform size limit");
1223
+ }
1224
+ }
1225
+ if (!hasEntryPoint)
1226
+ throw new Error("External game archive requires a non-empty root index.html");
1227
+ for (const key of names) {
1228
+ let parent = key;
1229
+ while (parent.includes("/")) {
1230
+ parent = parent.slice(0, parent.lastIndexOf("/"));
1231
+ if (names.has(parent))
1232
+ throw new Error("External game archive has conflicting file and directory paths");
1233
+ }
1234
+ }
1235
+ const end = Buffer.alloc(22);
1236
+ end.writeUInt32LE(101010256, 0);
1237
+ end.writeUInt16LE(names.size, 8);
1238
+ end.writeUInt16LE(names.size, 10);
1239
+ end.writeUInt32LE(centralBytes, 12);
1240
+ end.writeUInt32LE(offset, 16);
1241
+ const bytes = offset + centralBytes + end.length;
1242
+ parts.push(...central, end);
1243
+ const hash = createHash3("sha256");
1244
+ for (const part of parts)
1245
+ hash.update(part);
1246
+ signal?.throwIfAborted();
1247
+ return { parts, bytes, sha256: hash.digest("hex") };
1248
+ }
1249
+
1250
+ // vendor/agent-cli/dist/src/artifacts/external-game-upload.js
1251
+ import { createHash as createHash4 } from "node:crypto";
1252
+ import { promisify } from "node:util";
1253
+ import { gzip } from "node:zlib";
1254
+ var compress = promisify(gzip);
1255
+ var api = "/api/ms/external-game-uploads";
1256
+ var idPattern = /^[A-Za-z0-9_-]{1,128}$/;
1257
+ var digestPattern = /^[0-9a-f]{64}$/;
1258
+ async function encodeExternalGameContent(archive, signal) {
1259
+ signal?.throwIfAborted();
1260
+ if (!Number.isSafeInteger(archive?.bytes) || archive.bytes < 22 || archive.bytes > EXTERNAL_GAME_UPLOAD_LIMITS.archiveBytes || !Array.isArray(archive.parts) || !digestPattern.test(archive.sha256 ?? "")) {
1261
+ throw new Error("Invalid external game ZIP metadata or platform size limit");
1262
+ }
1263
+ let bytes = 0;
1264
+ for (const part of archive.parts) {
1265
+ signal?.throwIfAborted();
1266
+ if (!(part instanceof Uint8Array))
1267
+ throw new Error("Invalid external game ZIP part");
1268
+ bytes += part.byteLength;
1269
+ if (bytes > archive.bytes)
1270
+ throw new Error("External game ZIP length does not match its prepared metadata");
1271
+ }
1272
+ if (bytes !== archive.bytes)
1273
+ throw new Error("External game ZIP length does not match its prepared metadata");
1274
+ const original = Buffer.concat(archive.parts, bytes);
1275
+ if (createHash4("sha256").update(original).digest("hex") !== archive.sha256) {
1276
+ throw new Error("External game ZIP SHA-256 does not match its prepared metadata");
1277
+ }
1278
+ let encoded;
1279
+ try {
1280
+ encoded = await compress(original, { maxOutputLength: EXTERNAL_GAME_UPLOAD_LIMITS.gzipBytes });
1281
+ } catch (error) {
1282
+ if (error.code === "ERR_BUFFER_TOO_LARGE") {
1283
+ throw new Error("Compressed external game ZIP exceeds the platform size limit");
1284
+ }
1285
+ throw error;
1286
+ }
1287
+ signal?.throwIfAborted();
1288
+ if (encoded.length > EXTERNAL_GAME_UPLOAD_LIMITS.gzipBytes)
1289
+ throw new Error("Compressed external game ZIP exceeds the platform size limit");
1290
+ const body = { archive_encoded: encoded.toString("base64") };
1291
+ if (Buffer.byteLength(JSON.stringify(body)) > EXTERNAL_GAME_UPLOAD_LIMITS.jsonBytes) {
1292
+ throw new Error("External game JSON exceeds the platform size limit");
1293
+ }
1294
+ return body;
1295
+ }
1296
+ async function externalGameUploadRequest(kind, options, signal) {
1297
+ signal?.throwIfAborted();
1298
+ if (kind === "prepare") {
1299
+ if (!options.input || typeof options.input !== "object" || Array.isArray(options.input)) {
1300
+ throw new Error("External game prepare input is required");
1301
+ }
1302
+ return { endpoint: api + "/prepare", method: "POST", body: { ...options.input } };
1303
+ }
1304
+ if (typeof options.id !== "string" || !idPattern.test(options.id))
1305
+ throw new Error("Invalid external game upload ID");
1306
+ const endpoint = api + "/" + options.id;
1307
+ if (kind === "upload") {
1308
+ if (!options.archive)
1309
+ throw new Error("External game ZIP is required");
1310
+ return { endpoint: endpoint + "/content", method: "POST", body: await encodeExternalGameContent(options.archive, signal) };
1311
+ }
1312
+ if (kind === "commit")
1313
+ return { endpoint: endpoint + "/commit", method: "POST", body: {} };
1314
+ if (kind === "status")
1315
+ return { endpoint, method: "GET" };
1316
+ throw new Error("Unknown external game upload operation");
1317
+ }
1318
+ function safeId(value) {
1319
+ return typeof value === "string" && idPattern.test(value);
1320
+ }
1321
+ function parseExternalGameUploadReceipt(value, options = {}) {
1322
+ if (value === null || typeof value !== "object" || Array.isArray(value))
1323
+ throw new Error("Invalid external game upload receipt");
1324
+ const data = value;
1325
+ if (!safeId(data.upload_id) || options.uploadId !== void 0 && data.upload_id !== options.uploadId || !["prepared", "uploaded", "draft_ready", "expired"].includes(data.state)) {
1326
+ throw new Error("Invalid external game upload receipt");
1327
+ }
1328
+ if (options.requireUploadPath && data.state === "prepared" && data.upload_path === void 0 || data.upload_path !== void 0 && data.upload_path !== `${api}/${data.upload_id}/content`) {
1329
+ throw new Error("Unexpected external game upload path");
1330
+ }
1331
+ const result = { upload_id: data.upload_id, state: data.state };
1332
+ if (result.state === "draft_ready") {
1333
+ if (!safeId(data.conversation_id) || !safeId(data.version_id) || options.conversationId !== void 0 && data.conversation_id !== options.conversationId) {
1334
+ throw new Error("Invalid external game draft version receipt");
1335
+ }
1336
+ result.conversation_id = data.conversation_id;
1337
+ result.version_id = data.version_id;
1338
+ if (data.external_manifest_sha256 !== void 0 || options.requireManifest) {
1339
+ if (typeof data.external_manifest_sha256 !== "string" || !digestPattern.test(data.external_manifest_sha256)) {
1340
+ throw new Error("Invalid external game draft manifest");
1341
+ }
1342
+ result.external_manifest_sha256 = data.external_manifest_sha256;
1343
+ }
1344
+ }
1345
+ return result;
1346
+ }
1347
+
1348
+ // vendor/agent-cli/dist/src/context/template-seed.js
1349
+ import { constants as constants5 } from "node:fs";
1350
+ import fs6 from "node:fs/promises";
1351
+ import path11 from "node:path";
1352
+
1353
+ // vendor/agent-cli/dist/src/context/template-refresh.js
1354
+ import fs4 from "node:fs/promises";
1355
+ import path9 from "node:path";
1356
+ var USER_OWNED_ROOTS = /* @__PURE__ */ new Set(["SPEC", "src", "Content", "configs"]);
1357
+ function normalizeRefreshPaths(value) {
1358
+ if (value === void 0)
1359
+ return [];
1360
+ if (!Array.isArray(value))
1361
+ throw new Error("Template refresh_paths must be an array");
1362
+ const paths = value.map((entry) => {
1363
+ if (typeof entry !== "string" || !entry || entry.includes("\\") || entry.includes("\0") || /[:*?<>"|]/.test(entry)) {
1364
+ throw new Error("Invalid template refresh path");
1365
+ }
1366
+ const segments = entry.split("/");
1367
+ if (USER_OWNED_ROOTS.has(segments[0]) || segments.some((segment) => !segment || segment === "." || segment === ".." || segment === ".git" || segment === ".claude" || segment === "node_modules" || segment.startsWith(".env"))) {
1368
+ throw new Error(`Invalid template refresh path: ${entry}`);
1369
+ }
1370
+ return entry;
1371
+ });
1372
+ return [...new Set(paths)].sort().filter((entry, _, all) => !all.some((parent) => parent !== entry && entry.startsWith(`${parent}/`)));
1373
+ }
1374
+ function isRefreshPath(relativePath, refreshPaths) {
1375
+ return refreshPaths.some((entry) => relativePath === entry || relativePath.startsWith(`${entry}/`));
1376
+ }
1377
+ async function assertTemplateTarget(root, relativePath) {
1378
+ let target = root;
1379
+ for (const segment of ["", ...relativePath.split(path9.sep)]) {
1380
+ if (segment)
1381
+ target = path9.join(target, segment);
1382
+ try {
1383
+ const stat4 = await fs4.lstat(target);
1384
+ if (stat4.isSymbolicLink())
1385
+ throw new Error(`Template target contains a symbolic link: ${relativePath}`);
1386
+ } catch (error) {
1387
+ if (error.code === "ENOENT")
1388
+ return;
1389
+ throw error;
1390
+ }
1391
+ }
1392
+ }
1393
+
1394
+ // vendor/agent-cli/dist/src/context/template-sync.js
1395
+ import fs5 from "node:fs/promises";
1396
+ import { constants as constants4 } from "node:fs";
1397
+ import path10 from "node:path";
1398
+ import { randomUUID as randomUUID3 } from "node:crypto";
1399
+ async function syncManagedTemplatePaths(options) {
1400
+ const copied = /* @__PURE__ */ new Set();
1401
+ for (const declared of options.refreshPaths) {
1402
+ const relative = path10.normalize(declared);
1403
+ options.signal.throwIfAborted();
1404
+ const source = path10.join(options.sourceDir, relative);
1405
+ if (!await statOrMissing(source))
1406
+ continue;
1407
+ const target = path10.join(options.targetDir, relative);
1408
+ await assertTemplateTarget(options.targetDir, relative);
1409
+ await assertRegularTree(target, options.signal);
1410
+ }
1411
+ for (const declared of options.refreshPaths) {
1412
+ const relative = path10.normalize(declared);
1413
+ const source = path10.join(options.sourceDir, relative);
1414
+ if (!await statOrMissing(source))
1415
+ continue;
1416
+ await withWritableParents(options.targetDir, path10.dirname(relative), async () => {
1417
+ await synchronize(options, relative, copied);
1418
+ });
1419
+ }
1420
+ return copied;
1421
+ }
1422
+ async function synchronize(options, relative, copied) {
1423
+ options.signal.throwIfAborted();
1424
+ const source = path10.join(options.sourceDir, relative), target = path10.join(options.targetDir, relative);
1425
+ const sourceStat = await fs5.lstat(source), previous = await statOrMissing(target);
1426
+ if (sourceStat.isSymbolicLink() || !sourceStat.isFile() && !sourceStat.isDirectory()) {
1427
+ throw new Error(`Template source is not a regular file or directory: ${relative}`);
1428
+ }
1429
+ if (sourceStat.isFile()) {
1430
+ if (!options.files.has(relative))
1431
+ return;
1432
+ if (previous?.isDirectory())
1433
+ await removeManagedTree(target, options.signal);
1434
+ if (await copyManagedFile(source, target, options.signal))
1435
+ copied.add(relative);
1436
+ return;
1437
+ }
1438
+ if (previous && !previous.isDirectory())
1439
+ await fs5.unlink(target);
1440
+ await fs5.mkdir(target, { recursive: true });
1441
+ const originalMode = (previous?.isDirectory() ? previous.mode : sourceStat.mode) & 511;
1442
+ await fs5.chmod(target, originalMode | 448);
1443
+ let completed = false;
1444
+ try {
1445
+ const sourceEntries = await fs5.readdir(source, { withFileTypes: true });
1446
+ const expected = new Set(sourceEntries.filter((entry) => entry.isDirectory() || options.files.has(path10.join(relative, entry.name))).map((entry) => entry.name));
1447
+ for (const name of await fs5.readdir(target)) {
1448
+ if (!expected.has(name))
1449
+ await removeManagedTree(path10.join(target, name), options.signal);
1450
+ }
1451
+ for (const entry of sourceEntries)
1452
+ await synchronize(options, path10.join(relative, entry.name), copied);
1453
+ completed = true;
1454
+ } finally {
1455
+ await fs5.chmod(target, completed ? originalMode & ~146 | 320 : originalMode);
1456
+ }
1457
+ }
1458
+ async function copyManagedFile(source, target, signal) {
1459
+ const data = await fs5.readFile(source), previous = await statOrMissing(target);
1460
+ if (previous && (previous.mode & 146) === 0 && data.equals(await fs5.readFile(target)))
1461
+ return false;
1462
+ const temporary = path10.join(path10.dirname(target), `.template-${randomUUID3()}.tmp`);
1463
+ try {
1464
+ signal.throwIfAborted();
1465
+ await fs5.copyFile(source, temporary, constants4.COPYFILE_EXCL);
1466
+ await fs5.chmod(temporary, (await fs5.stat(source)).mode & 365 | 256);
1467
+ signal.throwIfAborted();
1468
+ await replaceFile(temporary, target);
1469
+ return true;
1470
+ } finally {
1471
+ await fs5.rm(temporary, { force: true });
1472
+ }
1473
+ }
1474
+ async function withWritableParents(root, relative, body) {
1475
+ const changed = [];
1476
+ let directory = root;
1477
+ try {
1478
+ for (const segment of ["", ...relative.split(path10.sep).filter((segment2) => segment2 && segment2 !== ".")]) {
1479
+ if (segment)
1480
+ directory = path10.join(directory, segment);
1481
+ const previous = await statOrMissing(directory);
1482
+ if (!previous) {
1483
+ await fs5.mkdir(directory, { recursive: true });
1484
+ continue;
1485
+ }
1486
+ if (!previous.isDirectory() || previous.isSymbolicLink())
1487
+ throw new Error("Template target parent is not a regular directory");
1488
+ if ((previous.mode & 448) !== 448) {
1489
+ await fs5.chmod(directory, previous.mode | 448);
1490
+ changed.push({ directory, mode: previous.mode & 4095 });
1491
+ }
1492
+ }
1493
+ await body();
1494
+ } finally {
1495
+ const failures = [];
1496
+ for (const entry of changed.reverse()) {
1497
+ try {
1498
+ await fs5.chmod(entry.directory, entry.mode);
1499
+ } catch (error) {
1500
+ failures.push(error);
1501
+ }
1502
+ }
1503
+ if (failures.length)
1504
+ throw new AggregateError(failures, "Template parent permissions could not be restored");
1505
+ }
1506
+ }
1507
+ async function assertRegularTree(target, signal) {
1508
+ signal.throwIfAborted();
1509
+ const stat4 = await statOrMissing(target);
1510
+ if (!stat4)
1511
+ return;
1512
+ if (stat4.isSymbolicLink())
1513
+ throw new Error("Template target contains a symbolic link");
1514
+ if (stat4.isDirectory()) {
1515
+ for (const name of await fs5.readdir(target))
1516
+ await assertRegularTree(path10.join(target, name), signal);
1517
+ } else if (!stat4.isFile())
1518
+ throw new Error("Template target is not a regular file");
1519
+ }
1520
+ async function removeManagedTree(target, signal) {
1521
+ signal.throwIfAborted();
1522
+ const stat4 = await fs5.lstat(target);
1523
+ if (stat4.isSymbolicLink())
1524
+ throw new Error("Template target contains a symbolic link");
1525
+ if (!stat4.isDirectory()) {
1526
+ await fs5.unlink(target);
1527
+ return;
1528
+ }
1529
+ await fs5.chmod(target, stat4.mode | 448);
1530
+ let removed = false;
1531
+ try {
1532
+ for (const name of await fs5.readdir(target))
1533
+ await removeManagedTree(path10.join(target, name), signal);
1534
+ await fs5.rmdir(target);
1535
+ removed = true;
1536
+ } finally {
1537
+ if (!removed)
1538
+ await fs5.chmod(target, stat4.mode);
1539
+ }
1540
+ }
1541
+ async function statOrMissing(file) {
1542
+ try {
1543
+ return await fs5.lstat(file);
1544
+ } catch (error) {
1545
+ if (error.code === "ENOENT")
1546
+ return void 0;
1547
+ throw error;
1548
+ }
1549
+ }
1550
+
1551
+ // vendor/agent-cli/dist/src/context/template-seed.js
1552
+ async function seedProjectTemplate(sourceDir, targetDir, options = {}) {
1553
+ return withPreparation(options, async (signal) => {
1554
+ const copied = [];
1555
+ const skipped = [];
1556
+ const force = options.force === true;
1557
+ const refreshPaths = normalizeRefreshPaths(options.refreshPaths);
1558
+ let started = Date.now();
1559
+ const isNewProject = await isNewOrEmptyWorkspace(targetDir);
1560
+ options.log?.(`[agent-cli] template target inspection: ${Date.now() - started}ms`);
1561
+ started = Date.now();
1562
+ const files = (await listRelativeFiles(sourceDir, signal)).filter((file) => path11.basename(file) !== ".ok" && (!options.skipGitkeep || path11.basename(file) !== ".gitkeep"));
1563
+ options.log?.(`[agent-cli] template source scan: ${Date.now() - started}ms (${files.length} files)`);
1564
+ started = Date.now();
1565
+ const managedCopies = await syncManagedTemplatePaths({ sourceDir, targetDir, refreshPaths, files: new Set(files), signal });
1566
+ const directories = /* @__PURE__ */ new Map();
1567
+ for (let offset = 0; offset < files.length; offset += 4) {
1568
+ const batch = await Promise.allSettled(files.slice(offset, offset + 4).map(async (relPath) => {
1569
+ signal.throwIfAborted();
1570
+ const refresh = isRefreshPath(normalizeRel(relPath), refreshPaths);
1571
+ if (options.refreshOnly && !refresh)
1572
+ return false;
1573
+ await assertTemplateTarget(targetDir, relPath);
1574
+ if (refresh)
1575
+ return managedCopies.has(relPath);
1576
+ const targetPath = path11.join(targetDir, relPath);
1577
+ const parent = path11.dirname(targetPath);
1578
+ let directory = directories.get(parent);
1579
+ if (!directory) {
1580
+ directory = fs6.mkdir(parent, { recursive: true });
1581
+ directories.set(parent, directory);
1582
+ }
1583
+ await directory;
1584
+ signal.throwIfAborted();
1585
+ try {
1586
+ await fs6.copyFile(path11.join(sourceDir, relPath), targetPath, force ? 0 : constants5.COPYFILE_EXCL);
1587
+ return true;
1588
+ } catch (error) {
1589
+ if (!force && error.code === "EEXIST")
1590
+ return false;
1591
+ throw error;
1592
+ }
1593
+ }));
1594
+ for (const [index, result] of batch.entries()) {
1595
+ if (result.status === "rejected")
1596
+ throw result.reason;
1597
+ (result.value ? copied : skipped).push(normalizeRel(files[offset + index]));
1598
+ }
1599
+ }
1600
+ options.log?.(`[agent-cli] template directory preparation and file copy: ${Date.now() - started}ms`);
1601
+ return {
1602
+ copied,
1603
+ skipped,
1604
+ total: copied.length + skipped.length,
1605
+ isNewProject
1606
+ };
1607
+ });
1608
+ }
1609
+ async function isNewOrEmptyWorkspace(targetDir) {
1610
+ let stat4;
1611
+ try {
1612
+ stat4 = await fs6.lstat(targetDir);
1613
+ } catch (err) {
1614
+ if (err.code === "ENOENT") {
1615
+ return true;
1616
+ }
1617
+ throw err;
1618
+ }
1619
+ if (!stat4.isDirectory()) {
1620
+ return false;
1621
+ }
1622
+ const entries = await fs6.readdir(targetDir);
1623
+ if (entries.length === 0) {
1624
+ return true;
1625
+ }
1626
+ const hasPackageJson = await pathExists(path11.join(targetDir, "package.json"));
1627
+ const hasContent = await pathExists(path11.join(targetDir, "Content"));
1628
+ const hasSpec = await pathExists(path11.join(targetDir, "SPEC"));
1629
+ const hasProjectGodot = await pathExists(path11.join(targetDir, "project.godot"));
1630
+ return !(hasPackageJson || hasContent || hasSpec || hasProjectGodot);
1631
+ }
1632
+ async function listRelativeFiles(sourceDir, signal) {
1633
+ const files = [];
1634
+ await walkDirectory(sourceDir, "", files, signal);
1635
+ return files;
1636
+ }
1637
+ async function walkDirectory(rootDir, relDir, files, signal) {
1638
+ signal.throwIfAborted();
1639
+ const currentDir = relDir ? path11.join(rootDir, relDir) : rootDir;
1640
+ const entries = await fs6.readdir(currentDir, { withFileTypes: true });
1641
+ for (const entry of entries) {
1642
+ signal.throwIfAborted();
1643
+ const relPath = relDir ? path11.join(relDir, entry.name) : entry.name;
1644
+ if (entry.isSymbolicLink())
1645
+ throw new Error(`Template source contains a symbolic link: ${relPath}`);
1646
+ if (!entry.isFile() && !entry.isDirectory())
1647
+ throw new Error(`Template source is not a regular file: ${relPath}`);
1648
+ if (entry.isDirectory()) {
1649
+ await walkDirectory(rootDir, relPath, files, signal);
1650
+ continue;
1651
+ }
1652
+ files.push(relPath);
1653
+ }
1654
+ }
1655
+ async function pathExists(targetPath) {
1656
+ try {
1657
+ await fs6.lstat(targetPath);
1658
+ return true;
1659
+ } catch (err) {
1660
+ if (err.code === "ENOENT") {
1661
+ return false;
1662
+ }
1663
+ throw err;
1664
+ }
1665
+ }
1666
+ function normalizeRel(relPath) {
1667
+ return relPath.replace(/\\/g, "/");
1668
+ }
1669
+
1670
+ // sdk/finalize-game-context.mjs
1671
+ import path12 from "node:path";
1672
+ import { readFile as readFile4, realpath as realpath4, lstat as lstat3 } from "node:fs/promises";
1673
+ async function finalizeGameContext({ workspaceDir, contextDir, engine, onLog = () => {
1674
+ } }, signal) {
1675
+ if (!["js", "js3d"].includes(engine) || !path12.isAbsolute(workspaceDir) || !path12.isAbsolute(contextDir)) throw new Error("Invalid game finalization input");
1676
+ signal?.throwIfAborted();
1677
+ const workspace = await realpath4(workspaceDir), context = await realpath4(contextDir);
1678
+ const file = path12.join(context, "hooks/hooks.json");
1679
+ if (!(await lstat3(file)).isFile() || (await lstat3(file)).isSymbolicLink()) throw new Error("Game hooks must be a regular file");
1680
+ const raw = await readFile4(file, { encoding: "utf8", signal });
1681
+ if (Buffer.byteLength(raw) > 64 * 1024) throw new Error("Game hooks exceed size limit");
1682
+ const hooks = JSON.parse(raw);
1683
+ if (!hooks || typeof hooks !== "object" || Array.isArray(hooks) || Object.keys(hooks).some((key) => key !== "run:complete") || !Array.isArray(hooks["run:complete"]) || !hooks["run:complete"].length) throw new Error("Unsupported game finalization declarations");
1684
+ const invocations = [];
1685
+ for (const hook of hooks["run:complete"]) {
1686
+ if (!hook || typeof hook !== "object" || Object.keys(hook).some((key) => !["name", "when", "command", "cwd", "timeoutMs", "required"].includes(key)) || hook.name !== "export-config" || hook.when !== "workspace-changed" || hook.cwd !== "workspace" || hook.required !== void 0 && typeof hook.required !== "boolean" || JSON.stringify(hook.command) !== JSON.stringify(["node", "${CONTEXT_DIR}/skills/export-config/scripts/export-config.mjs"]) || !Number.isInteger(hook.timeoutMs) || hook.timeoutMs < 1e3 || hook.timeoutMs > 6e5) throw new Error("Unsupported game export hook");
1687
+ const script = path12.join(context, "skills/export-config/scripts/export-config.mjs");
1688
+ const actual = await realpath4(script);
1689
+ if (actual !== script || !(await lstat3(script)).isFile()) throw new Error("Game export hook must stay inside the bound context");
1690
+ invocations.push({ script, timeoutMs: hook.timeoutMs });
1691
+ }
1692
+ if (invocations.length !== 1) throw new Error("Expected exactly one game export hook");
1693
+ const env = Object.fromEntries(Object.entries(process.env).filter(([key]) => !key.startsWith("PLATFORM_") && key !== "AGENT_CLI_TOKEN"));
1694
+ Object.assign(env, { CRAFT_CONTEXT_DIR: context, CRAFT_PROJECT_DIR: workspace });
1695
+ for (const invocation of invocations) {
1696
+ signal?.throwIfAborted();
1697
+ onLog("Exporting configuration with the bound context");
1698
+ const result = await runProcess(process.execPath, [invocation.script], { cwd: workspace, env, timeoutMs: invocation.timeoutMs, signal, readOnlyDirectories: [context] });
1699
+ signal?.throwIfAborted();
1700
+ if (result.exitCode !== 0 || result.timedOut || result.aborted) throw new Error("Game configuration export failed: " + (result.timedOut ? "timeout" : result.aborted ? "cancelled" : (result.stderr || result.stdout).slice(-2e3)));
1701
+ onLog("Configuration export completed");
1702
+ }
1703
+ }
1704
+ export {
1705
+ buildJsStatic,
1706
+ encodeExternalGameArchive,
1707
+ encodeExternalGameContent,
1708
+ externalGameUploadRequest,
1709
+ finalizeGameContext,
1710
+ installProjectDependencies,
1711
+ parseExternalGameUploadReceipt,
1712
+ prepareBrowserEnvironment,
1713
+ prepareStaticArtifacts,
1714
+ runProcess,
1715
+ seedProjectTemplate
1716
+ };