@bf-meishijian/aip 0.0.41 → 0.0.43

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 (747) hide show
  1. package/dist/apps/local-coding-host/src/bash-discovery.d.ts +8 -0
  2. package/dist/apps/local-coding-host/src/bash-discovery.d.ts.map +1 -0
  3. package/dist/apps/local-coding-host/src/bash-discovery.js +66 -0
  4. package/dist/apps/local-coding-host/src/bash-discovery.js.map +1 -0
  5. package/dist/apps/local-coding-host/src/cli.d.ts +4 -0
  6. package/dist/apps/local-coding-host/src/cli.d.ts.map +1 -0
  7. package/dist/apps/local-coding-host/src/cli.js +388 -0
  8. package/dist/apps/local-coding-host/src/cli.js.map +1 -0
  9. package/dist/apps/local-coding-host/src/coding-run-manager.d.ts +174 -0
  10. package/dist/apps/local-coding-host/src/coding-run-manager.d.ts.map +1 -0
  11. package/dist/apps/local-coding-host/src/coding-run-manager.js +1587 -0
  12. package/dist/apps/local-coding-host/src/coding-run-manager.js.map +1 -0
  13. package/dist/apps/local-coding-host/src/coding-subagent-child.d.ts +22 -0
  14. package/dist/apps/local-coding-host/src/coding-subagent-child.d.ts.map +1 -0
  15. package/dist/apps/local-coding-host/src/coding-subagent-child.js +96 -0
  16. package/dist/apps/local-coding-host/src/coding-subagent-child.js.map +1 -0
  17. package/dist/apps/local-coding-host/src/coding-subagents.d.ts +65 -0
  18. package/dist/apps/local-coding-host/src/coding-subagents.d.ts.map +1 -0
  19. package/dist/apps/local-coding-host/src/coding-subagents.js +521 -0
  20. package/dist/apps/local-coding-host/src/coding-subagents.js.map +1 -0
  21. package/dist/apps/local-coding-host/src/command-executor.d.ts +9 -0
  22. package/dist/apps/local-coding-host/src/command-executor.d.ts.map +1 -0
  23. package/dist/apps/local-coding-host/src/command-executor.js +222 -0
  24. package/dist/apps/local-coding-host/src/command-executor.js.map +1 -0
  25. package/dist/apps/local-coding-host/src/command-wakeup.d.ts +19 -0
  26. package/dist/apps/local-coding-host/src/command-wakeup.d.ts.map +1 -0
  27. package/dist/apps/local-coding-host/src/command-wakeup.js +109 -0
  28. package/dist/apps/local-coding-host/src/command-wakeup.js.map +1 -0
  29. package/dist/apps/local-coding-host/src/daemon.d.ts +8 -0
  30. package/dist/apps/local-coding-host/src/daemon.d.ts.map +1 -0
  31. package/dist/apps/local-coding-host/src/daemon.js +314 -0
  32. package/dist/apps/local-coding-host/src/daemon.js.map +1 -0
  33. package/dist/apps/local-coding-host/src/delivery-files.d.ts +39 -0
  34. package/dist/apps/local-coding-host/src/delivery-files.d.ts.map +1 -0
  35. package/dist/apps/local-coding-host/src/delivery-files.js +237 -0
  36. package/dist/apps/local-coding-host/src/delivery-files.js.map +1 -0
  37. package/dist/apps/local-coding-host/src/delivery-tools.d.ts +30 -0
  38. package/dist/apps/local-coding-host/src/delivery-tools.d.ts.map +1 -0
  39. package/dist/apps/local-coding-host/src/delivery-tools.js +196 -0
  40. package/dist/apps/local-coding-host/src/delivery-tools.js.map +1 -0
  41. package/dist/apps/local-coding-host/src/diagnostic-log.d.ts +20 -0
  42. package/dist/apps/local-coding-host/src/diagnostic-log.d.ts.map +1 -0
  43. package/dist/apps/local-coding-host/src/diagnostic-log.js +61 -0
  44. package/dist/apps/local-coding-host/src/diagnostic-log.js.map +1 -0
  45. package/dist/apps/local-coding-host/src/diagnostics.d.ts +38 -0
  46. package/dist/apps/local-coding-host/src/diagnostics.d.ts.map +1 -0
  47. package/dist/apps/local-coding-host/src/diagnostics.js +217 -0
  48. package/dist/apps/local-coding-host/src/diagnostics.js.map +1 -0
  49. package/dist/apps/local-coding-host/src/execution-process-observer.d.ts +19 -0
  50. package/dist/apps/local-coding-host/src/execution-process-observer.d.ts.map +1 -0
  51. package/dist/apps/local-coding-host/src/execution-process-observer.js +35 -0
  52. package/dist/apps/local-coding-host/src/execution-process-observer.js.map +1 -0
  53. package/dist/apps/local-coding-host/src/execution-process-tree.d.ts +32 -0
  54. package/dist/apps/local-coding-host/src/execution-process-tree.d.ts.map +1 -0
  55. package/dist/apps/local-coding-host/src/execution-process-tree.js +288 -0
  56. package/dist/apps/local-coding-host/src/execution-process-tree.js.map +1 -0
  57. package/dist/apps/local-coding-host/src/execution-process.d.ts +59 -0
  58. package/dist/apps/local-coding-host/src/execution-process.d.ts.map +1 -0
  59. package/dist/apps/local-coding-host/src/execution-process.js +112 -0
  60. package/dist/apps/local-coding-host/src/execution-process.js.map +1 -0
  61. package/dist/apps/local-coding-host/src/execution-receipts.d.ts +12 -0
  62. package/dist/apps/local-coding-host/src/execution-receipts.d.ts.map +1 -0
  63. package/dist/apps/local-coding-host/src/execution-receipts.js +89 -0
  64. package/dist/apps/local-coding-host/src/execution-receipts.js.map +1 -0
  65. package/dist/apps/local-coding-host/src/execution-supervisor.d.ts +25 -0
  66. package/dist/apps/local-coding-host/src/execution-supervisor.d.ts.map +1 -0
  67. package/dist/apps/local-coding-host/src/execution-supervisor.js +482 -0
  68. package/dist/apps/local-coding-host/src/execution-supervisor.js.map +1 -0
  69. package/dist/apps/local-coding-host/src/execution-worker.d.ts +42 -0
  70. package/dist/apps/local-coding-host/src/execution-worker.d.ts.map +1 -0
  71. package/dist/apps/local-coding-host/src/execution-worker.js +165 -0
  72. package/dist/apps/local-coding-host/src/execution-worker.js.map +1 -0
  73. package/dist/apps/local-coding-host/src/general-run-client.d.ts +111 -0
  74. package/dist/apps/local-coding-host/src/general-run-client.d.ts.map +1 -0
  75. package/dist/apps/local-coding-host/src/general-run-client.js +41 -0
  76. package/dist/apps/local-coding-host/src/general-run-client.js.map +1 -0
  77. package/dist/apps/local-coding-host/src/general-run-manager.d.ts +33 -0
  78. package/dist/apps/local-coding-host/src/general-run-manager.d.ts.map +1 -0
  79. package/dist/apps/local-coding-host/src/general-run-manager.js +363 -0
  80. package/dist/apps/local-coding-host/src/general-run-manager.js.map +1 -0
  81. package/dist/apps/local-coding-host/src/general-run-supervisor.d.ts +12 -0
  82. package/dist/apps/local-coding-host/src/general-run-supervisor.d.ts.map +1 -0
  83. package/dist/apps/local-coding-host/src/general-run-supervisor.js +160 -0
  84. package/dist/apps/local-coding-host/src/general-run-supervisor.js.map +1 -0
  85. package/dist/apps/local-coding-host/src/general-run-tools.d.ts +25 -0
  86. package/dist/apps/local-coding-host/src/general-run-tools.d.ts.map +1 -0
  87. package/dist/apps/local-coding-host/src/general-run-tools.js +123 -0
  88. package/dist/apps/local-coding-host/src/general-run-tools.js.map +1 -0
  89. package/dist/apps/local-coding-host/src/git-credential-environment.d.ts +3 -0
  90. package/dist/apps/local-coding-host/src/git-credential-environment.d.ts.map +1 -0
  91. package/dist/apps/local-coding-host/src/git-credential-environment.js +46 -0
  92. package/dist/apps/local-coding-host/src/git-credential-environment.js.map +1 -0
  93. package/dist/apps/local-coding-host/src/git-credential-helper.d.ts +2 -0
  94. package/dist/apps/local-coding-host/src/git-credential-helper.d.ts.map +1 -0
  95. package/dist/apps/local-coding-host/src/git-credential-helper.js +38 -0
  96. package/dist/apps/local-coding-host/src/git-credential-helper.js.map +1 -0
  97. package/dist/apps/local-coding-host/src/git-http-migration.d.ts +24 -0
  98. package/dist/apps/local-coding-host/src/git-http-migration.d.ts.map +1 -0
  99. package/dist/apps/local-coding-host/src/git-http-migration.js +197 -0
  100. package/dist/apps/local-coding-host/src/git-http-migration.js.map +1 -0
  101. package/dist/apps/local-coding-host/src/git-process.d.ts +25 -0
  102. package/dist/apps/local-coding-host/src/git-process.d.ts.map +1 -0
  103. package/dist/apps/local-coding-host/src/git-process.js +85 -0
  104. package/dist/apps/local-coding-host/src/git-process.js.map +1 -0
  105. package/dist/apps/local-coding-host/src/git-transport.d.ts +6 -0
  106. package/dist/apps/local-coding-host/src/git-transport.d.ts.map +1 -0
  107. package/dist/apps/local-coding-host/src/git-transport.js +57 -0
  108. package/dist/apps/local-coding-host/src/git-transport.js.map +1 -0
  109. package/dist/apps/local-coding-host/src/gitlab-cli.d.ts +2 -0
  110. package/dist/apps/local-coding-host/src/gitlab-cli.d.ts.map +1 -0
  111. package/dist/apps/local-coding-host/src/gitlab-cli.js +39 -0
  112. package/dist/apps/local-coding-host/src/gitlab-cli.js.map +1 -0
  113. package/dist/apps/local-coding-host/src/gitlab-credentials.d.ts +18 -0
  114. package/dist/apps/local-coding-host/src/gitlab-credentials.d.ts.map +1 -0
  115. package/dist/apps/local-coding-host/src/gitlab-credentials.js +137 -0
  116. package/dist/apps/local-coding-host/src/gitlab-credentials.js.map +1 -0
  117. package/dist/apps/local-coding-host/src/handoff-cli.d.ts +2 -0
  118. package/dist/apps/local-coding-host/src/handoff-cli.d.ts.map +1 -0
  119. package/dist/apps/local-coding-host/src/handoff-cli.js +86 -0
  120. package/dist/apps/local-coding-host/src/handoff-cli.js.map +1 -0
  121. package/dist/apps/local-coding-host/src/harness.d.ts +2 -0
  122. package/dist/apps/local-coding-host/src/harness.d.ts.map +1 -0
  123. package/dist/apps/local-coding-host/src/harness.js +2 -0
  124. package/dist/apps/local-coding-host/src/harness.js.map +1 -0
  125. package/dist/apps/local-coding-host/src/host-log.d.ts +13 -0
  126. package/dist/apps/local-coding-host/src/host-log.d.ts.map +1 -0
  127. package/dist/apps/local-coding-host/src/host-log.js +43 -0
  128. package/dist/apps/local-coding-host/src/host-log.js.map +1 -0
  129. package/dist/apps/local-coding-host/src/host-shell.d.ts +2 -0
  130. package/dist/apps/local-coding-host/src/host-shell.d.ts.map +1 -0
  131. package/dist/apps/local-coding-host/src/host-shell.js +2 -0
  132. package/dist/apps/local-coding-host/src/host-shell.js.map +1 -0
  133. package/dist/apps/local-coding-host/src/host-status.d.ts +57 -0
  134. package/dist/apps/local-coding-host/src/host-status.d.ts.map +1 -0
  135. package/dist/apps/local-coding-host/src/host-status.js +144 -0
  136. package/dist/apps/local-coding-host/src/host-status.js.map +1 -0
  137. package/dist/apps/local-coding-host/src/host-tools.d.ts +15 -0
  138. package/dist/apps/local-coding-host/src/host-tools.d.ts.map +1 -0
  139. package/dist/apps/local-coding-host/src/host-tools.js +178 -0
  140. package/dist/apps/local-coding-host/src/host-tools.js.map +1 -0
  141. package/dist/apps/local-coding-host/src/host-update.d.ts +3 -0
  142. package/dist/apps/local-coding-host/src/host-update.d.ts.map +1 -0
  143. package/dist/apps/local-coding-host/src/host-update.js +95 -0
  144. package/dist/apps/local-coding-host/src/host-update.js.map +1 -0
  145. package/dist/apps/local-coding-host/src/installer.d.ts +28 -0
  146. package/dist/apps/local-coding-host/src/installer.d.ts.map +1 -0
  147. package/dist/apps/local-coding-host/src/installer.js +346 -0
  148. package/dist/apps/local-coding-host/src/installer.js.map +1 -0
  149. package/dist/apps/local-coding-host/src/linux-service.d.ts +14 -0
  150. package/dist/apps/local-coding-host/src/linux-service.d.ts.map +1 -0
  151. package/dist/apps/local-coding-host/src/linux-service.js +63 -0
  152. package/dist/apps/local-coding-host/src/linux-service.js.map +1 -0
  153. package/dist/apps/local-coding-host/src/live-employee.d.ts +17 -0
  154. package/dist/apps/local-coding-host/src/live-employee.d.ts.map +1 -0
  155. package/dist/apps/local-coding-host/src/live-employee.js +74 -0
  156. package/dist/apps/local-coding-host/src/live-employee.js.map +1 -0
  157. package/dist/apps/local-coding-host/src/local-employee-runtime.d.ts +30 -0
  158. package/dist/apps/local-coding-host/src/local-employee-runtime.d.ts.map +1 -0
  159. package/dist/apps/local-coding-host/src/local-employee-runtime.js +521 -0
  160. package/dist/apps/local-coding-host/src/local-employee-runtime.js.map +1 -0
  161. package/dist/apps/local-coding-host/src/local-handoff-workspace.d.ts +27 -0
  162. package/dist/apps/local-coding-host/src/local-handoff-workspace.d.ts.map +1 -0
  163. package/dist/apps/local-coding-host/src/local-handoff-workspace.js +71 -0
  164. package/dist/apps/local-coding-host/src/local-handoff-workspace.js.map +1 -0
  165. package/dist/apps/local-coding-host/src/local-mcp.d.ts +246 -0
  166. package/dist/apps/local-coding-host/src/local-mcp.d.ts.map +1 -0
  167. package/dist/apps/local-coding-host/src/local-mcp.js +173 -0
  168. package/dist/apps/local-coding-host/src/local-mcp.js.map +1 -0
  169. package/dist/apps/local-coding-host/src/local-model-usage.d.ts +6 -0
  170. package/dist/apps/local-coding-host/src/local-model-usage.d.ts.map +1 -0
  171. package/dist/apps/local-coding-host/src/local-model-usage.js +40 -0
  172. package/dist/apps/local-coding-host/src/local-model-usage.js.map +1 -0
  173. package/dist/apps/local-coding-host/src/login-url.d.ts +3 -0
  174. package/dist/apps/local-coding-host/src/login-url.d.ts.map +1 -0
  175. package/dist/apps/local-coding-host/src/login-url.js +30 -0
  176. package/dist/apps/local-coding-host/src/login-url.js.map +1 -0
  177. package/dist/apps/local-coding-host/src/managed-process.d.ts +21 -0
  178. package/dist/apps/local-coding-host/src/managed-process.d.ts.map +1 -0
  179. package/dist/apps/local-coding-host/src/managed-process.js +119 -0
  180. package/dist/apps/local-coding-host/src/managed-process.js.map +1 -0
  181. package/dist/apps/local-coding-host/src/merge-requests.d.ts +54 -0
  182. package/dist/apps/local-coding-host/src/merge-requests.d.ts.map +1 -0
  183. package/dist/apps/local-coding-host/src/merge-requests.js +230 -0
  184. package/dist/apps/local-coding-host/src/merge-requests.js.map +1 -0
  185. package/dist/apps/local-coding-host/src/model-stores.d.ts +20 -0
  186. package/dist/apps/local-coding-host/src/model-stores.d.ts.map +1 -0
  187. package/dist/apps/local-coding-host/src/model-stores.js +77 -0
  188. package/dist/apps/local-coding-host/src/model-stores.js.map +1 -0
  189. package/dist/apps/local-coding-host/src/open-browser.d.ts +2 -0
  190. package/dist/apps/local-coding-host/src/open-browser.d.ts.map +1 -0
  191. package/dist/apps/local-coding-host/src/open-browser.js +20 -0
  192. package/dist/apps/local-coding-host/src/open-browser.js.map +1 -0
  193. package/dist/apps/local-coding-host/src/operation-context.d.ts +31 -0
  194. package/dist/apps/local-coding-host/src/operation-context.d.ts.map +1 -0
  195. package/dist/apps/local-coding-host/src/operation-context.js +166 -0
  196. package/dist/apps/local-coding-host/src/operation-context.js.map +1 -0
  197. package/dist/apps/local-coding-host/src/outcome-cli.d.ts +3 -0
  198. package/dist/apps/local-coding-host/src/outcome-cli.d.ts.map +1 -0
  199. package/dist/apps/local-coding-host/src/outcome-cli.js +91 -0
  200. package/dist/apps/local-coding-host/src/outcome-cli.js.map +1 -0
  201. package/dist/apps/local-coding-host/src/paths.d.ts +30 -0
  202. package/dist/apps/local-coding-host/src/paths.d.ts.map +1 -0
  203. package/dist/apps/local-coding-host/src/paths.js +52 -0
  204. package/dist/apps/local-coding-host/src/paths.js.map +1 -0
  205. package/dist/apps/local-coding-host/src/pi-message-queue.d.ts +20 -0
  206. package/dist/apps/local-coding-host/src/pi-message-queue.d.ts.map +1 -0
  207. package/dist/apps/local-coding-host/src/pi-message-queue.js +78 -0
  208. package/dist/apps/local-coding-host/src/pi-message-queue.js.map +1 -0
  209. package/dist/apps/local-coding-host/src/pi-model-service.d.ts +91 -0
  210. package/dist/apps/local-coding-host/src/pi-model-service.d.ts.map +1 -0
  211. package/dist/apps/local-coding-host/src/pi-model-service.js +372 -0
  212. package/dist/apps/local-coding-host/src/pi-model-service.js.map +1 -0
  213. package/dist/apps/local-coding-host/src/platform-client.d.ts +398 -0
  214. package/dist/apps/local-coding-host/src/platform-client.d.ts.map +1 -0
  215. package/dist/apps/local-coding-host/src/platform-client.js +255 -0
  216. package/dist/apps/local-coding-host/src/platform-client.js.map +1 -0
  217. package/dist/apps/local-coding-host/src/platform-gitlab-credential.d.ts +8 -0
  218. package/dist/apps/local-coding-host/src/platform-gitlab-credential.d.ts.map +1 -0
  219. package/dist/apps/local-coding-host/src/platform-gitlab-credential.js +31 -0
  220. package/dist/apps/local-coding-host/src/platform-gitlab-credential.js.map +1 -0
  221. package/dist/apps/local-coding-host/src/platform.d.ts +2 -0
  222. package/dist/apps/local-coding-host/src/platform.d.ts.map +1 -0
  223. package/dist/apps/local-coding-host/src/platform.js +15 -0
  224. package/dist/apps/local-coding-host/src/platform.js.map +1 -0
  225. package/dist/apps/local-coding-host/src/profile.d.ts +9 -0
  226. package/dist/apps/local-coding-host/src/profile.d.ts.map +1 -0
  227. package/dist/apps/local-coding-host/src/profile.js +43 -0
  228. package/dist/apps/local-coding-host/src/profile.js.map +1 -0
  229. package/dist/apps/local-coding-host/src/project-facts.d.ts +20 -0
  230. package/dist/apps/local-coding-host/src/project-facts.d.ts.map +1 -0
  231. package/dist/apps/local-coding-host/src/project-facts.js +94 -0
  232. package/dist/apps/local-coding-host/src/project-facts.js.map +1 -0
  233. package/dist/apps/local-coding-host/src/provider-auth-error.d.ts +3 -0
  234. package/dist/apps/local-coding-host/src/provider-auth-error.d.ts.map +1 -0
  235. package/dist/apps/local-coding-host/src/provider-auth-error.js +12 -0
  236. package/dist/apps/local-coding-host/src/provider-auth-error.js.map +1 -0
  237. package/dist/apps/local-coding-host/src/qa-contract.d.ts +2 -0
  238. package/dist/apps/local-coding-host/src/qa-contract.d.ts.map +1 -0
  239. package/dist/apps/local-coding-host/src/qa-contract.js +3 -0
  240. package/dist/apps/local-coding-host/src/qa-contract.js.map +1 -0
  241. package/dist/apps/local-coding-host/src/qa-project-checkout.d.ts +16 -0
  242. package/dist/apps/local-coding-host/src/qa-project-checkout.d.ts.map +1 -0
  243. package/dist/apps/local-coding-host/src/qa-project-checkout.js +92 -0
  244. package/dist/apps/local-coding-host/src/qa-project-checkout.js.map +1 -0
  245. package/dist/apps/local-coding-host/src/qa-session-manager.d.ts +83 -0
  246. package/dist/apps/local-coding-host/src/qa-session-manager.d.ts.map +1 -0
  247. package/dist/apps/local-coding-host/src/qa-session-manager.js +782 -0
  248. package/dist/apps/local-coding-host/src/qa-session-manager.js.map +1 -0
  249. package/dist/apps/local-coding-host/src/run-resources.d.ts +17 -0
  250. package/dist/apps/local-coding-host/src/run-resources.d.ts.map +1 -0
  251. package/dist/apps/local-coding-host/src/run-resources.js +115 -0
  252. package/dist/apps/local-coding-host/src/run-resources.js.map +1 -0
  253. package/dist/apps/local-coding-host/src/runtime-cleanup.d.ts +5 -0
  254. package/dist/apps/local-coding-host/src/runtime-cleanup.d.ts.map +1 -0
  255. package/dist/apps/local-coding-host/src/runtime-cleanup.js +187 -0
  256. package/dist/apps/local-coding-host/src/runtime-cleanup.js.map +1 -0
  257. package/dist/apps/local-coding-host/src/runtime-environment.d.ts +2 -0
  258. package/dist/apps/local-coding-host/src/runtime-environment.d.ts.map +1 -0
  259. package/dist/apps/local-coding-host/src/runtime-environment.js +7 -0
  260. package/dist/apps/local-coding-host/src/runtime-environment.js.map +1 -0
  261. package/dist/apps/local-coding-host/src/runtime-search-tools.d.ts +3 -0
  262. package/dist/apps/local-coding-host/src/runtime-search-tools.d.ts.map +1 -0
  263. package/dist/apps/local-coding-host/src/runtime-search-tools.js +30 -0
  264. package/dist/apps/local-coding-host/src/runtime-search-tools.js.map +1 -0
  265. package/dist/apps/local-coding-host/src/secure-json.d.ts +12 -0
  266. package/dist/apps/local-coding-host/src/secure-json.d.ts.map +1 -0
  267. package/dist/apps/local-coding-host/src/secure-json.js +129 -0
  268. package/dist/apps/local-coding-host/src/secure-json.js.map +1 -0
  269. package/dist/apps/local-coding-host/src/self-check.d.ts +3 -0
  270. package/dist/apps/local-coding-host/src/self-check.d.ts.map +1 -0
  271. package/dist/apps/local-coding-host/src/self-check.js +9 -0
  272. package/dist/apps/local-coding-host/src/self-check.js.map +1 -0
  273. package/dist/apps/local-coding-host/src/skill-bundle-cache.d.ts +11 -0
  274. package/dist/apps/local-coding-host/src/skill-bundle-cache.d.ts.map +1 -0
  275. package/dist/apps/local-coding-host/src/skill-bundle-cache.js +76 -0
  276. package/dist/apps/local-coding-host/src/skill-bundle-cache.js.map +1 -0
  277. package/dist/apps/local-coding-host/src/skill-storage.d.ts +18 -0
  278. package/dist/apps/local-coding-host/src/skill-storage.d.ts.map +1 -0
  279. package/dist/apps/local-coding-host/src/skill-storage.js +287 -0
  280. package/dist/apps/local-coding-host/src/skill-storage.js.map +1 -0
  281. package/dist/apps/local-coding-host/src/stage-delivery.d.ts +2 -0
  282. package/dist/apps/local-coding-host/src/stage-delivery.d.ts.map +1 -0
  283. package/dist/apps/local-coding-host/src/stage-delivery.js +3 -0
  284. package/dist/apps/local-coding-host/src/stage-delivery.js.map +1 -0
  285. package/dist/apps/local-coding-host/src/state.d.ts +55 -0
  286. package/dist/apps/local-coding-host/src/state.d.ts.map +1 -0
  287. package/dist/apps/local-coding-host/src/state.js +151 -0
  288. package/dist/apps/local-coding-host/src/state.js.map +1 -0
  289. package/dist/apps/local-coding-host/src/storage-maintenance.d.ts +13 -0
  290. package/dist/apps/local-coding-host/src/storage-maintenance.d.ts.map +1 -0
  291. package/dist/apps/local-coding-host/src/storage-maintenance.js +62 -0
  292. package/dist/apps/local-coding-host/src/storage-maintenance.js.map +1 -0
  293. package/dist/apps/local-coding-host/src/test-cli.d.ts +2 -0
  294. package/dist/apps/local-coding-host/src/test-cli.d.ts.map +1 -0
  295. package/dist/apps/local-coding-host/src/test-cli.js +48 -0
  296. package/dist/apps/local-coding-host/src/test-cli.js.map +1 -0
  297. package/dist/apps/local-coding-host/src/test-executor.d.ts +41 -0
  298. package/dist/apps/local-coding-host/src/test-executor.d.ts.map +1 -0
  299. package/dist/apps/local-coding-host/src/test-executor.js +483 -0
  300. package/dist/apps/local-coding-host/src/test-executor.js.map +1 -0
  301. package/dist/apps/local-coding-host/src/test-reports.d.ts +25 -0
  302. package/dist/apps/local-coding-host/src/test-reports.d.ts.map +1 -0
  303. package/dist/apps/local-coding-host/src/test-reports.js +129 -0
  304. package/dist/apps/local-coding-host/src/test-reports.js.map +1 -0
  305. package/dist/apps/local-coding-host/src/test-run-manager.d.ts +34 -0
  306. package/dist/apps/local-coding-host/src/test-run-manager.d.ts.map +1 -0
  307. package/dist/apps/local-coding-host/src/test-run-manager.js +180 -0
  308. package/dist/apps/local-coding-host/src/test-run-manager.js.map +1 -0
  309. package/dist/apps/local-coding-host/src/tool-dispatch.d.ts +14 -0
  310. package/dist/apps/local-coding-host/src/tool-dispatch.d.ts.map +1 -0
  311. package/dist/apps/local-coding-host/src/tool-dispatch.js +59 -0
  312. package/dist/apps/local-coding-host/src/tool-dispatch.js.map +1 -0
  313. package/dist/apps/local-coding-host/src/tool-probe.d.ts +31 -0
  314. package/dist/apps/local-coding-host/src/tool-probe.d.ts.map +1 -0
  315. package/dist/apps/local-coding-host/src/tool-probe.js +95 -0
  316. package/dist/apps/local-coding-host/src/tool-probe.js.map +1 -0
  317. package/dist/apps/local-coding-host/src/windows-runtime.d.ts +9 -0
  318. package/dist/apps/local-coding-host/src/windows-runtime.d.ts.map +1 -0
  319. package/dist/apps/local-coding-host/src/windows-runtime.js +64 -0
  320. package/dist/apps/local-coding-host/src/windows-runtime.js.map +1 -0
  321. package/dist/apps/local-coding-host/src/windows-service.d.ts +22 -0
  322. package/dist/apps/local-coding-host/src/windows-service.d.ts.map +1 -0
  323. package/dist/apps/local-coding-host/src/windows-service.js +126 -0
  324. package/dist/apps/local-coding-host/src/windows-service.js.map +1 -0
  325. package/dist/apps/local-coding-host/src/workflow-guidance.d.ts +2 -0
  326. package/dist/apps/local-coding-host/src/workflow-guidance.d.ts.map +1 -0
  327. package/dist/apps/local-coding-host/src/workflow-guidance.js +3 -0
  328. package/dist/apps/local-coding-host/src/workflow-guidance.js.map +1 -0
  329. package/dist/apps/local-coding-host/src/workspace-diff.d.ts +6 -0
  330. package/dist/apps/local-coding-host/src/workspace-diff.d.ts.map +1 -0
  331. package/dist/apps/local-coding-host/src/workspace-diff.js +280 -0
  332. package/dist/apps/local-coding-host/src/workspace-diff.js.map +1 -0
  333. package/dist/apps/local-coding-host/src/workspace-gc.d.ts +25 -0
  334. package/dist/apps/local-coding-host/src/workspace-gc.d.ts.map +1 -0
  335. package/dist/apps/local-coding-host/src/workspace-gc.js +417 -0
  336. package/dist/apps/local-coding-host/src/workspace-gc.js.map +1 -0
  337. package/dist/apps/local-coding-host/tests/bash-discovery.test.d.ts +2 -0
  338. package/dist/apps/local-coding-host/tests/bash-discovery.test.d.ts.map +1 -0
  339. package/dist/apps/local-coding-host/tests/bash-discovery.test.js +36 -0
  340. package/dist/apps/local-coding-host/tests/bash-discovery.test.js.map +1 -0
  341. package/dist/apps/local-coding-host/tests/cli-startup.test.d.ts +2 -0
  342. package/dist/apps/local-coding-host/tests/cli-startup.test.d.ts.map +1 -0
  343. package/dist/apps/local-coding-host/tests/cli-startup.test.js +176 -0
  344. package/dist/apps/local-coding-host/tests/cli-startup.test.js.map +1 -0
  345. package/dist/apps/local-coding-host/tests/coding-run-manager.test.d.ts +2 -0
  346. package/dist/apps/local-coding-host/tests/coding-run-manager.test.d.ts.map +1 -0
  347. package/dist/apps/local-coding-host/tests/coding-run-manager.test.js +3211 -0
  348. package/dist/apps/local-coding-host/tests/coding-run-manager.test.js.map +1 -0
  349. package/dist/apps/local-coding-host/tests/coding-subagent-child.test.d.ts +2 -0
  350. package/dist/apps/local-coding-host/tests/coding-subagent-child.test.d.ts.map +1 -0
  351. package/dist/apps/local-coding-host/tests/coding-subagent-child.test.js +223 -0
  352. package/dist/apps/local-coding-host/tests/coding-subagent-child.test.js.map +1 -0
  353. package/dist/apps/local-coding-host/tests/coding-subagents.integration.test.d.ts +2 -0
  354. package/dist/apps/local-coding-host/tests/coding-subagents.integration.test.d.ts.map +1 -0
  355. package/dist/apps/local-coding-host/tests/coding-subagents.integration.test.js +390 -0
  356. package/dist/apps/local-coding-host/tests/coding-subagents.integration.test.js.map +1 -0
  357. package/dist/apps/local-coding-host/tests/command-wakeup.test.d.ts +2 -0
  358. package/dist/apps/local-coding-host/tests/command-wakeup.test.d.ts.map +1 -0
  359. package/dist/apps/local-coding-host/tests/command-wakeup.test.js +148 -0
  360. package/dist/apps/local-coding-host/tests/command-wakeup.test.js.map +1 -0
  361. package/dist/apps/local-coding-host/tests/daemon-wakeup.test.d.ts +2 -0
  362. package/dist/apps/local-coding-host/tests/daemon-wakeup.test.d.ts.map +1 -0
  363. package/dist/apps/local-coding-host/tests/daemon-wakeup.test.js +636 -0
  364. package/dist/apps/local-coding-host/tests/daemon-wakeup.test.js.map +1 -0
  365. package/dist/apps/local-coding-host/tests/database-tool-transport.test.d.ts +2 -0
  366. package/dist/apps/local-coding-host/tests/database-tool-transport.test.d.ts.map +1 -0
  367. package/dist/apps/local-coding-host/tests/database-tool-transport.test.js +37 -0
  368. package/dist/apps/local-coding-host/tests/database-tool-transport.test.js.map +1 -0
  369. package/dist/apps/local-coding-host/tests/delivery-files.test.d.ts +2 -0
  370. package/dist/apps/local-coding-host/tests/delivery-files.test.d.ts.map +1 -0
  371. package/dist/apps/local-coding-host/tests/delivery-files.test.js +655 -0
  372. package/dist/apps/local-coding-host/tests/delivery-files.test.js.map +1 -0
  373. package/dist/apps/local-coding-host/tests/device-gitlab-sync.test.d.ts +2 -0
  374. package/dist/apps/local-coding-host/tests/device-gitlab-sync.test.d.ts.map +1 -0
  375. package/dist/apps/local-coding-host/tests/device-gitlab-sync.test.js +116 -0
  376. package/dist/apps/local-coding-host/tests/device-gitlab-sync.test.js.map +1 -0
  377. package/dist/apps/local-coding-host/tests/diagnostic-logging.test.d.ts +2 -0
  378. package/dist/apps/local-coding-host/tests/diagnostic-logging.test.d.ts.map +1 -0
  379. package/dist/apps/local-coding-host/tests/diagnostic-logging.test.js +143 -0
  380. package/dist/apps/local-coding-host/tests/diagnostic-logging.test.js.map +1 -0
  381. package/dist/apps/local-coding-host/tests/execution-process.test.d.ts +2 -0
  382. package/dist/apps/local-coding-host/tests/execution-process.test.d.ts.map +1 -0
  383. package/dist/apps/local-coding-host/tests/execution-process.test.js +127 -0
  384. package/dist/apps/local-coding-host/tests/execution-process.test.js.map +1 -0
  385. package/dist/apps/local-coding-host/tests/execution-receipts.test.d.ts +2 -0
  386. package/dist/apps/local-coding-host/tests/execution-receipts.test.d.ts.map +1 -0
  387. package/dist/apps/local-coding-host/tests/execution-receipts.test.js +72 -0
  388. package/dist/apps/local-coding-host/tests/execution-receipts.test.js.map +1 -0
  389. package/dist/apps/local-coding-host/tests/execution-supervisor.test.d.ts +2 -0
  390. package/dist/apps/local-coding-host/tests/execution-supervisor.test.d.ts.map +1 -0
  391. package/dist/apps/local-coding-host/tests/execution-supervisor.test.js +488 -0
  392. package/dist/apps/local-coding-host/tests/execution-supervisor.test.js.map +1 -0
  393. package/dist/apps/local-coding-host/tests/general-employee-fixture.d.ts +3 -0
  394. package/dist/apps/local-coding-host/tests/general-employee-fixture.d.ts.map +1 -0
  395. package/dist/apps/local-coding-host/tests/general-employee-fixture.js +43 -0
  396. package/dist/apps/local-coding-host/tests/general-employee-fixture.js.map +1 -0
  397. package/dist/apps/local-coding-host/tests/general-run-manager.test.d.ts +2 -0
  398. package/dist/apps/local-coding-host/tests/general-run-manager.test.d.ts.map +1 -0
  399. package/dist/apps/local-coding-host/tests/general-run-manager.test.js +506 -0
  400. package/dist/apps/local-coding-host/tests/general-run-manager.test.js.map +1 -0
  401. package/dist/apps/local-coding-host/tests/general-run-supervisor.test.d.ts +2 -0
  402. package/dist/apps/local-coding-host/tests/general-run-supervisor.test.d.ts.map +1 -0
  403. package/dist/apps/local-coding-host/tests/general-run-supervisor.test.js +252 -0
  404. package/dist/apps/local-coding-host/tests/general-run-supervisor.test.js.map +1 -0
  405. package/dist/apps/local-coding-host/tests/general-run-tools.test.d.ts +2 -0
  406. package/dist/apps/local-coding-host/tests/general-run-tools.test.d.ts.map +1 -0
  407. package/dist/apps/local-coding-host/tests/general-run-tools.test.js +202 -0
  408. package/dist/apps/local-coding-host/tests/general-run-tools.test.js.map +1 -0
  409. package/dist/apps/local-coding-host/tests/general-run.integration.test.d.ts +2 -0
  410. package/dist/apps/local-coding-host/tests/general-run.integration.test.d.ts.map +1 -0
  411. package/dist/apps/local-coding-host/tests/general-run.integration.test.js +150 -0
  412. package/dist/apps/local-coding-host/tests/general-run.integration.test.js.map +1 -0
  413. package/dist/apps/local-coding-host/tests/git-http-migration.test.d.ts +2 -0
  414. package/dist/apps/local-coding-host/tests/git-http-migration.test.d.ts.map +1 -0
  415. package/dist/apps/local-coding-host/tests/git-http-migration.test.js +140 -0
  416. package/dist/apps/local-coding-host/tests/git-http-migration.test.js.map +1 -0
  417. package/dist/apps/local-coding-host/tests/git-process.test.d.ts +2 -0
  418. package/dist/apps/local-coding-host/tests/git-process.test.d.ts.map +1 -0
  419. package/dist/apps/local-coding-host/tests/git-process.test.js +106 -0
  420. package/dist/apps/local-coding-host/tests/git-process.test.js.map +1 -0
  421. package/dist/apps/local-coding-host/tests/git-transport.test.d.ts +2 -0
  422. package/dist/apps/local-coding-host/tests/git-transport.test.d.ts.map +1 -0
  423. package/dist/apps/local-coding-host/tests/git-transport.test.js +56 -0
  424. package/dist/apps/local-coding-host/tests/git-transport.test.js.map +1 -0
  425. package/dist/apps/local-coding-host/tests/gitlab-credentials.test.d.ts +2 -0
  426. package/dist/apps/local-coding-host/tests/gitlab-credentials.test.d.ts.map +1 -0
  427. package/dist/apps/local-coding-host/tests/gitlab-credentials.test.js +130 -0
  428. package/dist/apps/local-coding-host/tests/gitlab-credentials.test.js.map +1 -0
  429. package/dist/apps/local-coding-host/tests/gitlab-platform-credentials.test.d.ts +2 -0
  430. package/dist/apps/local-coding-host/tests/gitlab-platform-credentials.test.d.ts.map +1 -0
  431. package/dist/apps/local-coding-host/tests/gitlab-platform-credentials.test.js +273 -0
  432. package/dist/apps/local-coding-host/tests/gitlab-platform-credentials.test.js.map +1 -0
  433. package/dist/apps/local-coding-host/tests/host-log.test.d.ts +2 -0
  434. package/dist/apps/local-coding-host/tests/host-log.test.d.ts.map +1 -0
  435. package/dist/apps/local-coding-host/tests/host-log.test.js +51 -0
  436. package/dist/apps/local-coding-host/tests/host-log.test.js.map +1 -0
  437. package/dist/apps/local-coding-host/tests/host-status-workspace.test.d.ts +2 -0
  438. package/dist/apps/local-coding-host/tests/host-status-workspace.test.d.ts.map +1 -0
  439. package/dist/apps/local-coding-host/tests/host-status-workspace.test.js +256 -0
  440. package/dist/apps/local-coding-host/tests/host-status-workspace.test.js.map +1 -0
  441. package/dist/apps/local-coding-host/tests/host-tool-stages.test.d.ts +2 -0
  442. package/dist/apps/local-coding-host/tests/host-tool-stages.test.d.ts.map +1 -0
  443. package/dist/apps/local-coding-host/tests/host-tool-stages.test.js +82 -0
  444. package/dist/apps/local-coding-host/tests/host-tool-stages.test.js.map +1 -0
  445. package/dist/apps/local-coding-host/tests/host-tools-logging.test.d.ts +2 -0
  446. package/dist/apps/local-coding-host/tests/host-tools-logging.test.d.ts.map +1 -0
  447. package/dist/apps/local-coding-host/tests/host-tools-logging.test.js +110 -0
  448. package/dist/apps/local-coding-host/tests/host-tools-logging.test.js.map +1 -0
  449. package/dist/apps/local-coding-host/tests/host-tools.test.d.ts +2 -0
  450. package/dist/apps/local-coding-host/tests/host-tools.test.d.ts.map +1 -0
  451. package/dist/apps/local-coding-host/tests/host-tools.test.js +96 -0
  452. package/dist/apps/local-coding-host/tests/host-tools.test.js.map +1 -0
  453. package/dist/apps/local-coding-host/tests/host-update.test.d.ts +2 -0
  454. package/dist/apps/local-coding-host/tests/host-update.test.d.ts.map +1 -0
  455. package/dist/apps/local-coding-host/tests/host-update.test.js +102 -0
  456. package/dist/apps/local-coding-host/tests/host-update.test.js.map +1 -0
  457. package/dist/apps/local-coding-host/tests/install-scripts.test.d.ts +2 -0
  458. package/dist/apps/local-coding-host/tests/install-scripts.test.d.ts.map +1 -0
  459. package/dist/apps/local-coding-host/tests/install-scripts.test.js +80 -0
  460. package/dist/apps/local-coding-host/tests/install-scripts.test.js.map +1 -0
  461. package/dist/apps/local-coding-host/tests/linux-service.test.d.ts +2 -0
  462. package/dist/apps/local-coding-host/tests/linux-service.test.d.ts.map +1 -0
  463. package/dist/apps/local-coding-host/tests/linux-service.test.js +32 -0
  464. package/dist/apps/local-coding-host/tests/linux-service.test.js.map +1 -0
  465. package/dist/apps/local-coding-host/tests/live-employee.test.d.ts +2 -0
  466. package/dist/apps/local-coding-host/tests/live-employee.test.d.ts.map +1 -0
  467. package/dist/apps/local-coding-host/tests/live-employee.test.js +739 -0
  468. package/dist/apps/local-coding-host/tests/live-employee.test.js.map +1 -0
  469. package/dist/apps/local-coding-host/tests/local-handoff-workspace-errors.test.d.ts +2 -0
  470. package/dist/apps/local-coding-host/tests/local-handoff-workspace-errors.test.d.ts.map +1 -0
  471. package/dist/apps/local-coding-host/tests/local-handoff-workspace-errors.test.js +33 -0
  472. package/dist/apps/local-coding-host/tests/local-handoff-workspace-errors.test.js.map +1 -0
  473. package/dist/apps/local-coding-host/tests/local-handoff-workspace.test.d.ts +2 -0
  474. package/dist/apps/local-coding-host/tests/local-handoff-workspace.test.d.ts.map +1 -0
  475. package/dist/apps/local-coding-host/tests/local-handoff-workspace.test.js +67 -0
  476. package/dist/apps/local-coding-host/tests/local-handoff-workspace.test.js.map +1 -0
  477. package/dist/apps/local-coding-host/tests/local-host.test.d.ts +2 -0
  478. package/dist/apps/local-coding-host/tests/local-host.test.d.ts.map +1 -0
  479. package/dist/apps/local-coding-host/tests/local-host.test.js +1009 -0
  480. package/dist/apps/local-coding-host/tests/local-host.test.js.map +1 -0
  481. package/dist/apps/local-coding-host/tests/local-intake-recovery.test.d.ts +2 -0
  482. package/dist/apps/local-coding-host/tests/local-intake-recovery.test.d.ts.map +1 -0
  483. package/dist/apps/local-coding-host/tests/local-intake-recovery.test.js +71 -0
  484. package/dist/apps/local-coding-host/tests/local-intake-recovery.test.js.map +1 -0
  485. package/dist/apps/local-coding-host/tests/local-mcp.test.d.ts +2 -0
  486. package/dist/apps/local-coding-host/tests/local-mcp.test.d.ts.map +1 -0
  487. package/dist/apps/local-coding-host/tests/local-mcp.test.js +193 -0
  488. package/dist/apps/local-coding-host/tests/local-mcp.test.js.map +1 -0
  489. package/dist/apps/local-coding-host/tests/local-model-usage.test.d.ts +2 -0
  490. package/dist/apps/local-coding-host/tests/local-model-usage.test.d.ts.map +1 -0
  491. package/dist/apps/local-coding-host/tests/local-model-usage.test.js +55 -0
  492. package/dist/apps/local-coding-host/tests/local-model-usage.test.js.map +1 -0
  493. package/dist/apps/local-coding-host/tests/local-outcome-workspace.test.d.ts +2 -0
  494. package/dist/apps/local-coding-host/tests/local-outcome-workspace.test.d.ts.map +1 -0
  495. package/dist/apps/local-coding-host/tests/local-outcome-workspace.test.js +87 -0
  496. package/dist/apps/local-coding-host/tests/local-outcome-workspace.test.js.map +1 -0
  497. package/dist/apps/local-coding-host/tests/login-url.test.d.ts +2 -0
  498. package/dist/apps/local-coding-host/tests/login-url.test.d.ts.map +1 -0
  499. package/dist/apps/local-coding-host/tests/login-url.test.js +82 -0
  500. package/dist/apps/local-coding-host/tests/login-url.test.js.map +1 -0
  501. package/dist/apps/local-coding-host/tests/material-fixture.d.ts +13 -0
  502. package/dist/apps/local-coding-host/tests/material-fixture.d.ts.map +1 -0
  503. package/dist/apps/local-coding-host/tests/material-fixture.js +32 -0
  504. package/dist/apps/local-coding-host/tests/material-fixture.js.map +1 -0
  505. package/dist/apps/local-coding-host/tests/merge-requests.test.d.ts +2 -0
  506. package/dist/apps/local-coding-host/tests/merge-requests.test.d.ts.map +1 -0
  507. package/dist/apps/local-coding-host/tests/merge-requests.test.js +318 -0
  508. package/dist/apps/local-coding-host/tests/merge-requests.test.js.map +1 -0
  509. package/dist/apps/local-coding-host/tests/model-stores.test.d.ts +2 -0
  510. package/dist/apps/local-coding-host/tests/model-stores.test.d.ts.map +1 -0
  511. package/dist/apps/local-coding-host/tests/model-stores.test.js +152 -0
  512. package/dist/apps/local-coding-host/tests/model-stores.test.js.map +1 -0
  513. package/dist/apps/local-coding-host/tests/operation-context.test.d.ts +2 -0
  514. package/dist/apps/local-coding-host/tests/operation-context.test.d.ts.map +1 -0
  515. package/dist/apps/local-coding-host/tests/operation-context.test.js +171 -0
  516. package/dist/apps/local-coding-host/tests/operation-context.test.js.map +1 -0
  517. package/dist/apps/local-coding-host/tests/outcome-cli.test.d.ts +2 -0
  518. package/dist/apps/local-coding-host/tests/outcome-cli.test.d.ts.map +1 -0
  519. package/dist/apps/local-coding-host/tests/outcome-cli.test.js +208 -0
  520. package/dist/apps/local-coding-host/tests/outcome-cli.test.js.map +1 -0
  521. package/dist/apps/local-coding-host/tests/pi-message-queue.test.d.ts +2 -0
  522. package/dist/apps/local-coding-host/tests/pi-message-queue.test.d.ts.map +1 -0
  523. package/dist/apps/local-coding-host/tests/pi-message-queue.test.js +91 -0
  524. package/dist/apps/local-coding-host/tests/pi-message-queue.test.js.map +1 -0
  525. package/dist/apps/local-coding-host/tests/pi-model-switch.test.d.ts +2 -0
  526. package/dist/apps/local-coding-host/tests/pi-model-switch.test.d.ts.map +1 -0
  527. package/dist/apps/local-coding-host/tests/pi-model-switch.test.js +244 -0
  528. package/dist/apps/local-coding-host/tests/pi-model-switch.test.js.map +1 -0
  529. package/dist/apps/local-coding-host/tests/pi-native-capabilities.test.d.ts +2 -0
  530. package/dist/apps/local-coding-host/tests/pi-native-capabilities.test.d.ts.map +1 -0
  531. package/dist/apps/local-coding-host/tests/pi-native-capabilities.test.js +75 -0
  532. package/dist/apps/local-coding-host/tests/pi-native-capabilities.test.js.map +1 -0
  533. package/dist/apps/local-coding-host/tests/pi-overflow-recovery.test.d.ts +2 -0
  534. package/dist/apps/local-coding-host/tests/pi-overflow-recovery.test.d.ts.map +1 -0
  535. package/dist/apps/local-coding-host/tests/pi-overflow-recovery.test.js +183 -0
  536. package/dist/apps/local-coding-host/tests/pi-overflow-recovery.test.js.map +1 -0
  537. package/dist/apps/local-coding-host/tests/pi-session-restore.test.d.ts +2 -0
  538. package/dist/apps/local-coding-host/tests/pi-session-restore.test.d.ts.map +1 -0
  539. package/dist/apps/local-coding-host/tests/pi-session-restore.test.js +84 -0
  540. package/dist/apps/local-coding-host/tests/pi-session-restore.test.js.map +1 -0
  541. package/dist/apps/local-coding-host/tests/platform-client-status.test.d.ts +2 -0
  542. package/dist/apps/local-coding-host/tests/platform-client-status.test.d.ts.map +1 -0
  543. package/dist/apps/local-coding-host/tests/platform-client-status.test.js +29 -0
  544. package/dist/apps/local-coding-host/tests/platform-client-status.test.js.map +1 -0
  545. package/dist/apps/local-coding-host/tests/platform-models.test.d.ts +2 -0
  546. package/dist/apps/local-coding-host/tests/platform-models.test.d.ts.map +1 -0
  547. package/dist/apps/local-coding-host/tests/platform-models.test.js +395 -0
  548. package/dist/apps/local-coding-host/tests/platform-models.test.js.map +1 -0
  549. package/dist/apps/local-coding-host/tests/powershell-resolution.test.d.ts +2 -0
  550. package/dist/apps/local-coding-host/tests/powershell-resolution.test.d.ts.map +1 -0
  551. package/dist/apps/local-coding-host/tests/powershell-resolution.test.js +138 -0
  552. package/dist/apps/local-coding-host/tests/powershell-resolution.test.js.map +1 -0
  553. package/dist/apps/local-coding-host/tests/profile-installer.test.d.ts +2 -0
  554. package/dist/apps/local-coding-host/tests/profile-installer.test.d.ts.map +1 -0
  555. package/dist/apps/local-coding-host/tests/profile-installer.test.js +88 -0
  556. package/dist/apps/local-coding-host/tests/profile-installer.test.js.map +1 -0
  557. package/dist/apps/local-coding-host/tests/profile.test.d.ts +2 -0
  558. package/dist/apps/local-coding-host/tests/profile.test.d.ts.map +1 -0
  559. package/dist/apps/local-coding-host/tests/profile.test.js +88 -0
  560. package/dist/apps/local-coding-host/tests/profile.test.js.map +1 -0
  561. package/dist/apps/local-coding-host/tests/provider-auth-status.test.d.ts +2 -0
  562. package/dist/apps/local-coding-host/tests/provider-auth-status.test.d.ts.map +1 -0
  563. package/dist/apps/local-coding-host/tests/provider-auth-status.test.js +82 -0
  564. package/dist/apps/local-coding-host/tests/provider-auth-status.test.js.map +1 -0
  565. package/dist/apps/local-coding-host/tests/qa-project-checkout.test.d.ts +2 -0
  566. package/dist/apps/local-coding-host/tests/qa-project-checkout.test.d.ts.map +1 -0
  567. package/dist/apps/local-coding-host/tests/qa-project-checkout.test.js +101 -0
  568. package/dist/apps/local-coding-host/tests/qa-project-checkout.test.js.map +1 -0
  569. package/dist/apps/local-coding-host/tests/qa-session-manager.test.d.ts +2 -0
  570. package/dist/apps/local-coding-host/tests/qa-session-manager.test.d.ts.map +1 -0
  571. package/dist/apps/local-coding-host/tests/qa-session-manager.test.js +1493 -0
  572. package/dist/apps/local-coding-host/tests/qa-session-manager.test.js.map +1 -0
  573. package/dist/apps/local-coding-host/tests/qa-verification-contract.test.d.ts +2 -0
  574. package/dist/apps/local-coding-host/tests/qa-verification-contract.test.d.ts.map +1 -0
  575. package/dist/apps/local-coding-host/tests/qa-verification-contract.test.js +208 -0
  576. package/dist/apps/local-coding-host/tests/qa-verification-contract.test.js.map +1 -0
  577. package/dist/apps/local-coding-host/tests/recovery-workspace.test.d.ts +2 -0
  578. package/dist/apps/local-coding-host/tests/recovery-workspace.test.d.ts.map +1 -0
  579. package/dist/apps/local-coding-host/tests/recovery-workspace.test.js +69 -0
  580. package/dist/apps/local-coding-host/tests/recovery-workspace.test.js.map +1 -0
  581. package/dist/apps/local-coding-host/tests/review-query.test.d.ts +2 -0
  582. package/dist/apps/local-coding-host/tests/review-query.test.d.ts.map +1 -0
  583. package/dist/apps/local-coding-host/tests/review-query.test.js +66 -0
  584. package/dist/apps/local-coding-host/tests/review-query.test.js.map +1 -0
  585. package/dist/apps/local-coding-host/tests/run-resources.test.d.ts +2 -0
  586. package/dist/apps/local-coding-host/tests/run-resources.test.d.ts.map +1 -0
  587. package/dist/apps/local-coding-host/tests/run-resources.test.js +207 -0
  588. package/dist/apps/local-coding-host/tests/run-resources.test.js.map +1 -0
  589. package/dist/apps/local-coding-host/tests/runtime-cleanup.test.d.ts +2 -0
  590. package/dist/apps/local-coding-host/tests/runtime-cleanup.test.d.ts.map +1 -0
  591. package/dist/apps/local-coding-host/tests/runtime-cleanup.test.js +161 -0
  592. package/dist/apps/local-coding-host/tests/runtime-cleanup.test.js.map +1 -0
  593. package/dist/apps/local-coding-host/tests/runtime-package-install.test.d.ts +2 -0
  594. package/dist/apps/local-coding-host/tests/runtime-package-install.test.d.ts.map +1 -0
  595. package/dist/apps/local-coding-host/tests/runtime-package-install.test.js +63 -0
  596. package/dist/apps/local-coding-host/tests/runtime-package-install.test.js.map +1 -0
  597. package/dist/apps/local-coding-host/tests/runtime-version.test.d.ts +2 -0
  598. package/dist/apps/local-coding-host/tests/runtime-version.test.d.ts.map +1 -0
  599. package/dist/apps/local-coding-host/tests/runtime-version.test.js +15 -0
  600. package/dist/apps/local-coding-host/tests/runtime-version.test.js.map +1 -0
  601. package/dist/apps/local-coding-host/tests/secure-json.test.d.ts +2 -0
  602. package/dist/apps/local-coding-host/tests/secure-json.test.d.ts.map +1 -0
  603. package/dist/apps/local-coding-host/tests/secure-json.test.js +64 -0
  604. package/dist/apps/local-coding-host/tests/secure-json.test.js.map +1 -0
  605. package/dist/apps/local-coding-host/tests/skill-storage-gc.test.d.ts +2 -0
  606. package/dist/apps/local-coding-host/tests/skill-storage-gc.test.d.ts.map +1 -0
  607. package/dist/apps/local-coding-host/tests/skill-storage-gc.test.js +312 -0
  608. package/dist/apps/local-coding-host/tests/skill-storage-gc.test.js.map +1 -0
  609. package/dist/apps/local-coding-host/tests/storage-maintenance.test.d.ts +2 -0
  610. package/dist/apps/local-coding-host/tests/storage-maintenance.test.d.ts.map +1 -0
  611. package/dist/apps/local-coding-host/tests/storage-maintenance.test.js +135 -0
  612. package/dist/apps/local-coding-host/tests/storage-maintenance.test.js.map +1 -0
  613. package/dist/apps/local-coding-host/tests/test-executor.test.d.ts +2 -0
  614. package/dist/apps/local-coding-host/tests/test-executor.test.d.ts.map +1 -0
  615. package/dist/apps/local-coding-host/tests/test-executor.test.js +365 -0
  616. package/dist/apps/local-coding-host/tests/test-executor.test.js.map +1 -0
  617. package/dist/apps/local-coding-host/tests/test-reports.test.d.ts +2 -0
  618. package/dist/apps/local-coding-host/tests/test-reports.test.d.ts.map +1 -0
  619. package/dist/apps/local-coding-host/tests/test-reports.test.js +68 -0
  620. package/dist/apps/local-coding-host/tests/test-reports.test.js.map +1 -0
  621. package/dist/apps/local-coding-host/tests/test-run-manager.test.d.ts +2 -0
  622. package/dist/apps/local-coding-host/tests/test-run-manager.test.d.ts.map +1 -0
  623. package/dist/apps/local-coding-host/tests/test-run-manager.test.js +287 -0
  624. package/dist/apps/local-coding-host/tests/test-run-manager.test.js.map +1 -0
  625. package/dist/apps/local-coding-host/tests/tool-dispatch.integration.test.d.ts +2 -0
  626. package/dist/apps/local-coding-host/tests/tool-dispatch.integration.test.d.ts.map +1 -0
  627. package/dist/apps/local-coding-host/tests/tool-dispatch.integration.test.js +224 -0
  628. package/dist/apps/local-coding-host/tests/tool-dispatch.integration.test.js.map +1 -0
  629. package/dist/apps/local-coding-host/tests/tool-dispatch.test.d.ts +2 -0
  630. package/dist/apps/local-coding-host/tests/tool-dispatch.test.d.ts.map +1 -0
  631. package/dist/apps/local-coding-host/tests/tool-dispatch.test.js +47 -0
  632. package/dist/apps/local-coding-host/tests/tool-dispatch.test.js.map +1 -0
  633. package/dist/apps/local-coding-host/tests/tool-probe.test.d.ts +2 -0
  634. package/dist/apps/local-coding-host/tests/tool-probe.test.d.ts.map +1 -0
  635. package/dist/apps/local-coding-host/tests/tool-probe.test.js +55 -0
  636. package/dist/apps/local-coding-host/tests/tool-probe.test.js.map +1 -0
  637. package/dist/apps/local-coding-host/tests/windows-background-check.test.d.ts +2 -0
  638. package/dist/apps/local-coding-host/tests/windows-background-check.test.d.ts.map +1 -0
  639. package/dist/apps/local-coding-host/tests/windows-background-check.test.js +60 -0
  640. package/dist/apps/local-coding-host/tests/windows-background-check.test.js.map +1 -0
  641. package/dist/apps/local-coding-host/tests/windows-install-script.test.d.ts +2 -0
  642. package/dist/apps/local-coding-host/tests/windows-install-script.test.d.ts.map +1 -0
  643. package/dist/apps/local-coding-host/tests/windows-install-script.test.js +170 -0
  644. package/dist/apps/local-coding-host/tests/windows-install-script.test.js.map +1 -0
  645. package/dist/apps/local-coding-host/tests/windows-installer.test.d.ts +2 -0
  646. package/dist/apps/local-coding-host/tests/windows-installer.test.d.ts.map +1 -0
  647. package/dist/apps/local-coding-host/tests/windows-installer.test.js +244 -0
  648. package/dist/apps/local-coding-host/tests/windows-installer.test.js.map +1 -0
  649. package/dist/apps/local-coding-host/tests/windows-task-configuration.test.d.ts +2 -0
  650. package/dist/apps/local-coding-host/tests/windows-task-configuration.test.d.ts.map +1 -0
  651. package/dist/apps/local-coding-host/tests/windows-task-configuration.test.js +34 -0
  652. package/dist/apps/local-coding-host/tests/windows-task-configuration.test.js.map +1 -0
  653. package/dist/apps/local-coding-host/tests/workflow-rule-projection.test.d.ts +2 -0
  654. package/dist/apps/local-coding-host/tests/workflow-rule-projection.test.d.ts.map +1 -0
  655. package/dist/apps/local-coding-host/tests/workflow-rule-projection.test.js +370 -0
  656. package/dist/apps/local-coding-host/tests/workflow-rule-projection.test.js.map +1 -0
  657. package/dist/apps/local-coding-host/tests/workspace-diff.test.d.ts +2 -0
  658. package/dist/apps/local-coding-host/tests/workspace-diff.test.d.ts.map +1 -0
  659. package/dist/apps/local-coding-host/tests/workspace-diff.test.js +166 -0
  660. package/dist/apps/local-coding-host/tests/workspace-diff.test.js.map +1 -0
  661. package/dist/apps/local-coding-host/tests/workspace-gc.test.d.ts +2 -0
  662. package/dist/apps/local-coding-host/tests/workspace-gc.test.d.ts.map +1 -0
  663. package/dist/apps/local-coding-host/tests/workspace-gc.test.js +391 -0
  664. package/dist/apps/local-coding-host/tests/workspace-gc.test.js.map +1 -0
  665. package/dist/cli.js +2 -1
  666. package/dist/cli.js.map +1 -1
  667. package/dist/daemon.d.ts.map +1 -1
  668. package/dist/daemon.js +23 -0
  669. package/dist/daemon.js.map +1 -1
  670. package/dist/delivery-tools.d.ts +4 -2
  671. package/dist/delivery-tools.d.ts.map +1 -1
  672. package/dist/delivery-tools.js +45 -32
  673. package/dist/delivery-tools.js.map +1 -1
  674. package/dist/diagnostics.d.ts.map +1 -1
  675. package/dist/general-run-client.d.ts.map +1 -1
  676. package/dist/git-process.d.ts +1 -0
  677. package/dist/git-process.d.ts.map +1 -1
  678. package/dist/git-process.js +5 -1
  679. package/dist/git-process.js.map +1 -1
  680. package/dist/host-status.d.ts.map +1 -1
  681. package/dist/merge-requests.d.ts +4 -1
  682. package/dist/merge-requests.d.ts.map +1 -1
  683. package/dist/merge-requests.js +34 -8
  684. package/dist/merge-requests.js.map +1 -1
  685. package/dist/pi-model-service.d.ts.map +1 -1
  686. package/dist/platform-client.d.ts +4 -0
  687. package/dist/platform-client.d.ts.map +1 -1
  688. package/dist/platform-client.js +3 -0
  689. package/dist/platform-client.js.map +1 -1
  690. package/dist/project-facts.d.ts +1 -0
  691. package/dist/project-facts.d.ts.map +1 -1
  692. package/dist/project-facts.js +1 -1
  693. package/dist/project-facts.js.map +1 -1
  694. package/dist/services/platform-api/src/coding-run/coding-tool-definitions.d.ts +83 -0
  695. package/dist/services/platform-api/src/coding-run/coding-tool-definitions.d.ts.map +1 -0
  696. package/dist/services/platform-api/src/coding-run/coding-tool-definitions.js +282 -0
  697. package/dist/services/platform-api/src/coding-run/coding-tool-definitions.js.map +1 -0
  698. package/dist/services/platform-api/src/coding-run/delivery-requirements.d.ts +15 -0
  699. package/dist/services/platform-api/src/coding-run/delivery-requirements.d.ts.map +1 -0
  700. package/dist/services/platform-api/src/coding-run/delivery-requirements.js +60 -0
  701. package/dist/services/platform-api/src/coding-run/delivery-requirements.js.map +1 -0
  702. package/dist/services/platform-api/src/coding-run/development-test-report.d.ts +10 -0
  703. package/dist/services/platform-api/src/coding-run/development-test-report.d.ts.map +1 -0
  704. package/dist/services/platform-api/src/coding-run/development-test-report.js +32 -0
  705. package/dist/services/platform-api/src/coding-run/development-test-report.js.map +1 -0
  706. package/dist/services/platform-api/src/coding-run/host-tool-dispatch.d.ts +21 -0
  707. package/dist/services/platform-api/src/coding-run/host-tool-dispatch.d.ts.map +1 -0
  708. package/dist/services/platform-api/src/coding-run/host-tool-dispatch.js +86 -0
  709. package/dist/services/platform-api/src/coding-run/host-tool-dispatch.js.map +1 -0
  710. package/dist/services/platform-api/src/coding-run/workspace-materials.d.ts +37 -0
  711. package/dist/services/platform-api/src/coding-run/workspace-materials.d.ts.map +1 -0
  712. package/dist/services/platform-api/src/coding-run/workspace-materials.js +99 -0
  713. package/dist/services/platform-api/src/coding-run/workspace-materials.js.map +1 -0
  714. package/dist/services/platform-api/src/common/app-exception.d.ts +17 -0
  715. package/dist/services/platform-api/src/common/app-exception.d.ts.map +1 -0
  716. package/dist/services/platform-api/src/common/app-exception.js +46 -0
  717. package/dist/services/platform-api/src/common/app-exception.js.map +1 -0
  718. package/dist/services/platform-api/src/config/environment.d.ts +30 -0
  719. package/dist/services/platform-api/src/config/environment.d.ts.map +1 -0
  720. package/dist/services/platform-api/src/config/environment.js +123 -0
  721. package/dist/services/platform-api/src/config/environment.js.map +1 -0
  722. package/dist/services/platform-api/src/database/database.service.d.ts +38 -0
  723. package/dist/services/platform-api/src/database/database.service.d.ts.map +1 -0
  724. package/dist/services/platform-api/src/database/database.service.js +520 -0
  725. package/dist/services/platform-api/src/database/database.service.js.map +1 -0
  726. package/dist/services/platform-api/src/database/migration-ledger.d.ts +5 -0
  727. package/dist/services/platform-api/src/database/migration-ledger.d.ts.map +1 -0
  728. package/dist/services/platform-api/src/database/migration-ledger.js +33 -0
  729. package/dist/services/platform-api/src/database/migration-ledger.js.map +1 -0
  730. package/dist/services/platform-api/src/digital-employee/local-skill-bundles.d.ts +13 -0
  731. package/dist/services/platform-api/src/digital-employee/local-skill-bundles.d.ts.map +1 -0
  732. package/dist/services/platform-api/src/digital-employee/local-skill-bundles.js +25 -0
  733. package/dist/services/platform-api/src/digital-employee/local-skill-bundles.js.map +1 -0
  734. package/dist/services/platform-api/src/mcp-connection/mcp-tool-name.d.ts +6 -0
  735. package/dist/services/platform-api/src/mcp-connection/mcp-tool-name.d.ts.map +1 -0
  736. package/dist/services/platform-api/src/mcp-connection/mcp-tool-name.js +20 -0
  737. package/dist/services/platform-api/src/mcp-connection/mcp-tool-name.js.map +1 -0
  738. package/dist/services/platform-api/src/qa/qa-tool-definitions.d.ts +100 -0
  739. package/dist/services/platform-api/src/qa/qa-tool-definitions.d.ts.map +1 -0
  740. package/dist/services/platform-api/src/qa/qa-tool-definitions.js +498 -0
  741. package/dist/services/platform-api/src/qa/qa-tool-definitions.js.map +1 -0
  742. package/dist/tsconfig.tsbuildinfo +1 -0
  743. package/dist/workspace-diff.d.ts +6 -0
  744. package/dist/workspace-diff.d.ts.map +1 -0
  745. package/dist/workspace-diff.js +278 -0
  746. package/dist/workspace-diff.js.map +1 -0
  747. package/package.json +4 -4
@@ -0,0 +1,655 @@
1
+ import { WORKSPACE_TEMPLATE_FILES } from "@ai-platform/api-contracts";
2
+ import { execFileSync } from "node:child_process";
3
+ import { mkdir, mkdtemp, readdir, readFile, rm, symlink, writeFile } from "node:fs/promises";
4
+ import { tmpdir } from "node:os";
5
+ import { join } from "node:path";
6
+ import { afterEach, describe, expect, it, vi } from "vitest";
7
+ import { codingDeliveryRequirements } from "../../../services/platform-api/src/coding-run/delivery-requirements.js";
8
+ import { workspaceMaterialPreparation } from "../../../services/platform-api/src/coding-run/workspace-materials.js";
9
+ import { initialPrompt, worktreeTreeHash } from "../src/coding-run-manager.js";
10
+ import { collectDeliveryFiles as collectFiles, commandMaterialReader, initializeDeliveryFiles as executeMaterials, publishReviewMaterials as publishMaterials, } from "../src/delivery-files.js";
11
+ import { DELIVERY_FILES, STAGE_DELIVERY_PROTOCOLS } from "../src/stage-delivery.js";
12
+ import { hostIdentity, readDeviceAuth, syncDeviceGitLabCredential, writeDeviceAuth, writeHostState, } from "../src/state.js";
13
+ import { materialInput, materialSource, readMaterialFixture } from "./material-fixture.js";
14
+ const withMaterials = (input) => ({
15
+ ...materialInput(input),
16
+ materialPreparation: workspaceMaterialPreparation(materialInput(input)),
17
+ deliveryRequirements: codingDeliveryRequirements(input),
18
+ });
19
+ const initializeDeliveryFiles = async (root, input, resume = false) => executeMaterials(root, withMaterials(input), resume, readMaterialFixture);
20
+ const publishReviewMaterials = async (root, input) => publishMaterials(root, withMaterials({ ...input, phase: "PREPARATION" }), readMaterialFixture);
21
+ const collectDeliveryFiles = (root, input, slots) => collectFiles(root, materialInput(input), Object.entries(DELIVERY_FILES)
22
+ .filter(([slot]) => !["SUMMARY", "DEPLOYMENT_REPORT"].includes(slot))
23
+ .filter(([slot]) => slots
24
+ ? slots.includes(slot)
25
+ : !["TEST_PLAN", "TEST_REPORT"].includes(slot))
26
+ .filter(([slot]) => slot !== "DESIGN" || input.technicalDesign)
27
+ .filter(([slot]) => slot !== "SYSTEM_REVIEW")
28
+ .map(([slot, path]) => ({
29
+ slot: slot,
30
+ path,
31
+ required: slot !== "TEST_PLAN" &&
32
+ !(input.phase === "DEPLOYMENT" && ["PRD", "DESIGN"].includes(slot)),
33
+ })));
34
+ let root = "";
35
+ afterEach(async () => {
36
+ vi.unstubAllEnvs();
37
+ if (root)
38
+ await rm(root, { recursive: true, force: true });
39
+ });
40
+ async function setup() {
41
+ root = await mkdtemp(join(tmpdir(), "aip-files-"));
42
+ await mkdir(join(root, "main"));
43
+ await mkdir(join(root, "other"));
44
+ const input = withMaterials({
45
+ workItem: { key: "AIP-12" },
46
+ primaryProjectId: "p1",
47
+ projects: [
48
+ { id: "p2", name: "other" },
49
+ { id: "p1", name: "main" },
50
+ ],
51
+ requirement: { body_markdown: "实际需求正文" },
52
+ technicalDesign: { content: "实际设计正文" },
53
+ });
54
+ return { input, directory: await initializeDeliveryFiles(root, input) };
55
+ }
56
+ describe("固定交付文件", () => {
57
+ it("主项目不在首项时仍只采集主项目材料,缺失时不从次项目补取", async () => {
58
+ const { input, directory } = await setup();
59
+ const secondary = join(root, "other", "docs/aip/AIP-12");
60
+ await mkdir(secondary, { recursive: true });
61
+ await writeFile(join(secondary, "plan.md"), "次项目材料不应采集");
62
+ await writeFile(join(directory, "plan.md"), "主项目真实计划");
63
+ const files = await collectDeliveryFiles(root, input, ["IMPLEMENTATION_PLAN"]);
64
+ expect(files).toHaveLength(1);
65
+ expect(files[0]?.content).toBe("主项目真实计划");
66
+ await rm(join(directory, "plan.md"));
67
+ await expect(collectDeliveryFiles(root, input, ["IMPLEMENTATION_PLAN"])).rejects.toThrow("plan.md 文件不存在");
68
+ });
69
+ it("下发所有原型与二进制资源并保持 PRD 相对链接,恢复不覆盖本地修改", async () => {
70
+ const { input, directory } = await setup();
71
+ input.prototypeFiles = [
72
+ { path: "方案/index.html", base64: Buffer.from("adopted").toString("base64") },
73
+ { path: "draft.html", base64: Buffer.from("draft").toString("base64") },
74
+ { path: "assets/image.png", base64: Buffer.from([0, 255, 1]).toString("base64") },
75
+ ];
76
+ await initializeDeliveryFiles(root, input);
77
+ expect(await readFile(join(directory, "prototype/方案/index.html"), "utf8")).toBe("adopted");
78
+ expect(await readFile(join(directory, "prototype/draft.html"), "utf8")).toBe("draft");
79
+ expect(await readFile(join(directory, "prototype/assets/image.png"))).toEqual(Buffer.from([0, 255, 1]));
80
+ await writeFile(join(directory, "prototype/draft.html"), "local changes");
81
+ await initializeDeliveryFiles(root, input, true);
82
+ expect(await readFile(join(directory, "prototype/draft.html"), "utf8")).toBe("local changes");
83
+ });
84
+ it("原型下发拒绝越界路径和本地符号链接", async () => {
85
+ const { input, directory } = await setup();
86
+ for (const path of ["../prd.md", "/tmp/file", "a/../../file", "C:/file"]) {
87
+ await expect(initializeDeliveryFiles(root, { ...input, prototypeFiles: [{ path, base64: "eA==" }] })).rejects.toThrow("AIP_MATERIAL_PATH_INVALID");
88
+ }
89
+ await symlink(join(root, "other"), join(directory, "prototype"));
90
+ await expect(initializeDeliveryFiles(root, {
91
+ ...input,
92
+ prototypeFiles: [{ path: "index.html", base64: "eA==" }],
93
+ })).rejects.toThrow("AIP_MATERIAL_PATH_INVALID");
94
+ });
95
+ it("开发协议增加必交测试报告,部署携带已有报告且不新增必交要求", () => {
96
+ for (const protocol of [
97
+ STAGE_DELIVERY_PROTOCOLS.DEVELOPMENT,
98
+ STAGE_DELIVERY_PROTOCOLS.DEPLOYMENT,
99
+ ]) {
100
+ expect(protocol.instructions).toContain("summary");
101
+ expect(protocol.instructions).not.toMatch(/summary\.md|deployment\.md|无参数/);
102
+ }
103
+ expect(STAGE_DELIVERY_PROTOCOLS.DEVELOPMENT.requiredFiles).toEqual([
104
+ "plan.md",
105
+ "code_review.md",
106
+ "report.md",
107
+ "release_checklist.md",
108
+ ]);
109
+ expect(STAGE_DELIVERY_PROTOCOLS.DEPLOYMENT.requiredFiles).toEqual([
110
+ "plan.md",
111
+ "code_review.md",
112
+ "release_checklist.md",
113
+ ]);
114
+ expect(STAGE_DELIVERY_PROTOCOLS.DEPLOYMENT.optionalFiles).toContain("report.md");
115
+ });
116
+ it("只在主项目下发真实输入及完整模板包,恢复保留修改", async () => {
117
+ const { input, directory } = await setup();
118
+ expect((await readdir(directory)).sort()).toEqual([...WORKSPACE_TEMPLATE_FILES, "prd.md", "design.md"].sort());
119
+ expect(await readdir(join(root, "other"))).toEqual([]);
120
+ expect(await readFile(join(directory, "prd.md"), "utf8")).toBe("实际需求正文");
121
+ expect(await readdir(directory)).not.toContain("deployment.md");
122
+ expect(await readdir(directory)).not.toContain("summary.md");
123
+ await writeFile(join(directory, "prd.md"), "本地改稿");
124
+ await writeFile(join(directory, "deployment.md"), "本地结果");
125
+ await initializeDeliveryFiles(root, { ...input, projects: [...input.projects].reverse() });
126
+ expect(await readFile(join(directory, "prd.md"), "utf8")).toBe("本地改稿");
127
+ expect(await readFile(join(directory, "deployment.md"), "utf8")).toBe("本地结果");
128
+ });
129
+ it("错误定位缺文件与空正文,正文自由并忽略目录中过程稿", async () => {
130
+ const { input, directory } = await setup();
131
+ await expect(collectDeliveryFiles(root, input)).rejects.toThrow("code_review.md 内容为空");
132
+ for (const f of [
133
+ "summary.md",
134
+ "plan.md",
135
+ "deployment.md",
136
+ "code_review.md",
137
+ "release_checklist.md",
138
+ ])
139
+ await writeFile(join(directory, f), "任意正文".repeat(300));
140
+ await writeFile(join(directory, "report-final-v3.md"), "不应收集");
141
+ expect((await collectDeliveryFiles(root, input)).map((f) => f.slot)).toHaveLength(5);
142
+ await rm(join(directory, "prd.md"));
143
+ await initializeDeliveryFiles(root, input, true);
144
+ await expect(collectDeliveryFiles(root, input)).rejects.toThrow("prd.md 文件不存在");
145
+ });
146
+ it("plan 必须有非空内容,不校验清单格式和勾选状态", async () => {
147
+ const { input, directory } = await setup();
148
+ const plan = join(directory, "plan.md");
149
+ for (const content of ["", " \n\t"]) {
150
+ await writeFile(plan, content);
151
+ await expect(collectDeliveryFiles(root, input, ["IMPLEMENTATION_PLAN"])).rejects.toThrow("plan.md 内容为空");
152
+ }
153
+ for (const content of ["开发完成后整理的实施说明", "- [ ] 尚未勾选"]) {
154
+ await writeFile(plan, content);
155
+ expect(await collectDeliveryFiles(root, input, ["IMPLEMENTATION_PLAN"])).toEqual([
156
+ expect.objectContaining({ slot: "IMPLEMENTATION_PLAN", content }),
157
+ ]);
158
+ }
159
+ await rm(plan);
160
+ await expect(collectDeliveryFiles(root, input, ["IMPLEMENTATION_PLAN"])).rejects.toThrow("plan.md 文件不存在");
161
+ });
162
+ it("部署收集无需旧测试报告,缺失可选需求文档不阻断", async () => {
163
+ const { input, directory } = await setup();
164
+ for (const name of [
165
+ "summary.md",
166
+ "plan.md",
167
+ "deployment.md",
168
+ "code_review.md",
169
+ "release_checklist.md",
170
+ ])
171
+ await writeFile(join(directory, name), "真实事实");
172
+ await rm(join(directory, "prd.md"));
173
+ await rm(join(directory, "design.md"));
174
+ const files = await collectDeliveryFiles(root, { ...input, phase: "DEPLOYMENT" });
175
+ expect(files.map((file) => file.slot)).not.toContain("DEPLOYMENT_REPORT");
176
+ expect(files.map((file) => file.slot)).not.toContain("SUMMARY");
177
+ expect(files.map((file) => file.slot)).not.toContain("TEST_REPORT");
178
+ });
179
+ it("只按路径指引主/子会话,不把原始正文放进提示", async () => {
180
+ const { input } = await setup();
181
+ const promptInput = {
182
+ ...materialInput(input),
183
+ deliveryRequirements: codingDeliveryRequirements({ ...input, phase: "DEVELOPMENT" }),
184
+ phase: "DEVELOPMENT",
185
+ requirement: { title: "PRD", source: materialSource(input.requirement.body_markdown) },
186
+ technicalDesign: input.technicalDesign
187
+ ? { source: materialSource(input.technicalDesign.content), title: "Design" }
188
+ : null,
189
+ workItem: { ...input.workItem, id: "work-item", title: "任务" },
190
+ agent: { systemPrompt: "", skills: [] },
191
+ providerId: "openai-codex",
192
+ modelId: "m",
193
+ thinkingLevel: "high",
194
+ projects: input.projects.map((p) => ({
195
+ ...p,
196
+ repositoryUrl: "",
197
+ baselineCommit: "",
198
+ baselineBranch: "main",
199
+ devBranch: "feature",
200
+ testBranch: "",
201
+ })),
202
+ };
203
+ const confirmed = materialSource("已确认的上线交接正文");
204
+ promptInput.testHandoff = {
205
+ summary: "已验收",
206
+ files: [
207
+ {
208
+ slot: "TEST_REPORT",
209
+ path: "docs/aip/AIP-12/test_report.md",
210
+ materialPath: "handoff/confirmed-1.md",
211
+ source: confirmed,
212
+ baseMaterialPath: "handoff/base-1.md",
213
+ baseSource: materialSource("旧版正文"),
214
+ },
215
+ ],
216
+ };
217
+ const prompt = initialPrompt(materialInput(promptInput), root);
218
+ expect(prompt).toContain(JSON.stringify(join(root, "main/docs/aip/AIP-12/handoff/confirmed-1.md")));
219
+ expect(prompt).toContain(JSON.stringify(join(root, "main/docs/aip/AIP-12/handoff/base-1.md")));
220
+ expect(prompt).not.toContain(confirmed.fileRef);
221
+ expect(prompt).not.toContain("已确认的上线交接正文");
222
+ expect(prompt).not.toContain("节点规则");
223
+ expect(prompt).not.toContain("谁执行谁");
224
+ expect(prompt).not.toContain("Apollo");
225
+ const updated = initialPrompt(materialInput({ ...promptInput, inputConflict: true }), root);
226
+ expect(updated).toContain("正式输入材料已更新");
227
+ expect(updated).not.toContain(".platform.md");
228
+ expect(prompt).toContain(join(root, "main/docs/aip/AIP-12/prd.md"));
229
+ expect(prompt).not.toContain("实际需求正文");
230
+ expect(prompt).not.toContain("实际设计正文");
231
+ });
232
+ it.each([true, false, undefined])("开发交接完整分支成果不依赖审查开关(%s),普通聊天不强制推送", (reviewEnabled) => {
233
+ const input = withMaterials({
234
+ phase: "DEVELOPMENT",
235
+ ...(reviewEnabled === undefined ? {} : { qualityReview: { enabled: reviewEnabled } }),
236
+ requirement: { title: "本轮修改", body_markdown: "部署新改动" },
237
+ technicalDesign: null,
238
+ primaryProjectId: "p1",
239
+ workItem: { id: "work-item", key: "AIP-12", title: "修复后重新部署" },
240
+ agent: { systemPrompt: "", skills: [] },
241
+ providerId: "openai-codex",
242
+ modelId: "m",
243
+ thinkingLevel: "high",
244
+ projects: [
245
+ {
246
+ id: "p1",
247
+ name: "app",
248
+ repositoryUrl: "",
249
+ baselineCommit: "",
250
+ baselineBranch: "main",
251
+ devBranch: "aip/AIP-12",
252
+ testBranch: "test",
253
+ },
254
+ ],
255
+ });
256
+ const development = initialPrompt(materialInput(input), "/workspace");
257
+ expect(development).toContain("aip/AIP-12");
258
+ expect(development).not.toContain("节点规则");
259
+ expect(STAGE_DELIVERY_PROTOCOLS.DEVELOPMENT.instructions).toContain("调用 complete_development 前提交本轮改动并推送已分配开发分支");
260
+ const deployment = initialPrompt(materialInput({ ...input, phase: "DEPLOYMENT" }), "/workspace");
261
+ expect(deployment).toContain("DEPLOYMENT");
262
+ expect(deployment).not.toContain("调用 complete_development 前");
263
+ });
264
+ it.each([false, true])("开发提示词不暴露部署配置(已有部署快照:%s)", async (hasSnapshot) => {
265
+ const { input } = await setup();
266
+ const deploymentConfiguration = hasSnapshot
267
+ ? {
268
+ projects: [
269
+ {
270
+ projectId: "p1",
271
+ projectName: "app",
272
+ testBranch: "private-test-branch",
273
+ instructions: "private-deployment-instructions",
274
+ pipelines: [
275
+ {
276
+ name: "private-pipeline",
277
+ pipelineId: "private-pipeline-id",
278
+ consoleUrl: "https://deploy.example/private-pipeline",
279
+ triggerMode: "AUTO",
280
+ targets: [],
281
+ },
282
+ ],
283
+ },
284
+ ],
285
+ }
286
+ : undefined;
287
+ const context = {
288
+ ...input,
289
+ workItem: { id: "work-item", key: "AIP-12", title: "修复缺陷" },
290
+ agent: { systemPrompt: "", skills: [] },
291
+ providerId: "openai-codex",
292
+ modelId: "m",
293
+ thinkingLevel: "high",
294
+ projects: input.projects.map((project) => ({
295
+ ...project,
296
+ repositoryUrl: "",
297
+ baselineCommit: "",
298
+ baselineBranch: "main",
299
+ devBranch: "aip/AIP-12",
300
+ testBranch: "private-test-branch",
301
+ })),
302
+ ...(deploymentConfiguration ? { deploymentConfiguration } : {}),
303
+ };
304
+ const development = initialPrompt(withMaterials({ ...context, phase: "DEVELOPMENT" }), root);
305
+ expect(development).not.toContain("deploymentConfiguration");
306
+ expect(development).not.toContain("private-");
307
+ const deployment = initialPrompt(withMaterials({ ...context, phase: "DEPLOYMENT" }), root);
308
+ expect(deployment).toContain("private-test-branch");
309
+ if (hasSnapshot) {
310
+ expect(JSON.parse(deployment.split("本轮执行上下文:\n")[1]).deploymentConfiguration).toEqual(deploymentConfiguration);
311
+ }
312
+ });
313
+ it("拒绝错误主项目、路径穿越、文件外链和替换整个任务目录", async () => {
314
+ const { input, directory } = await setup();
315
+ await expect(initializeDeliveryFiles(root, { ...input, primaryProjectId: "missing" })).rejects.toThrow("PRIMARY_PROJECT");
316
+ await expect(initializeDeliveryFiles(root, { ...input, workItem: { key: "../../outside" } })).rejects.toThrow("KEY_INVALID");
317
+ const external = join(root, "external");
318
+ await mkdir(external);
319
+ await writeFile(join(external, "private"), "private");
320
+ await rm(join(directory, "prd.md"));
321
+ await symlink(join(external, "private"), join(directory, "prd.md"));
322
+ await expect(collectDeliveryFiles(root, input)).rejects.toThrow("无法读取或路径越界");
323
+ await rm(directory, { recursive: true });
324
+ await symlink(external, directory);
325
+ await expect(collectDeliveryFiles(root, input)).rejects.toThrow("OUTSIDE_PROJECT");
326
+ });
327
+ it("输入更新覆盖正式文件且不沿外链写入,历史对照文件保留", async () => {
328
+ const { input, directory } = await setup();
329
+ const external = join(root, "private");
330
+ await writeFile(external, "keep");
331
+ await writeFile(join(directory, "prd.platform.md"), "历史稿");
332
+ await rm(join(directory, "prd.md"));
333
+ await symlink(external, join(directory, "prd.md"));
334
+ await initializeDeliveryFiles(root, {
335
+ ...input,
336
+ inputConflict: true,
337
+ requirement: { body_markdown: "最新平台稿" },
338
+ });
339
+ expect(await readFile(external, "utf8")).toBe("keep");
340
+ expect(await readFile(join(directory, "prd.platform.md"), "utf8")).toBe("历史稿");
341
+ expect(await readFile(join(directory, "prd.md"), "utf8")).toBe("最新平台稿");
342
+ expect(await readdir(directory)).not.toContain("design.platform.md");
343
+ });
344
+ it("仅本次指定文件不影响被测代码树,源码变化必须重新验证", async () => {
345
+ const { directory } = await setup();
346
+ const cwd = join(root, "main");
347
+ const git = (...args) => execFileSync("git", args, { cwd, stdio: "pipe" });
348
+ git("init");
349
+ git("config", "user.email", "test@example.invalid");
350
+ git("config", "user.name", "test");
351
+ await writeFile(join(cwd, "code.js"), "export const x=1");
352
+ git("add", ".");
353
+ git("commit", "-m", "base");
354
+ const base = await worktreeTreeHash(cwd, "AIP-12", true);
355
+ await writeFile(join(directory, "deployment.md"), "新报告");
356
+ expect(await worktreeTreeHash(cwd, "AIP-12")).toBe(base);
357
+ git("add", ".");
358
+ git("commit", "-m", "report");
359
+ expect(await worktreeTreeHash(cwd, "AIP-12", true)).toBe(base);
360
+ await writeFile(join(cwd, "code.js"), "export const x=2");
361
+ expect(await worktreeTreeHash(cwd, "AIP-12")).not.toBe(base);
362
+ });
363
+ });
364
+ describe("准备阶段发布审查材料", () => {
365
+ it.each(["directory", "contents", "local-exclude"])("只向主项目发布材料,其他项目只推分支并保留忽略与暂存:%s", async (ignoreMode) => {
366
+ const { input } = await setup();
367
+ vi.stubEnv("AIP_HOME", join(root, "host"));
368
+ vi.stubEnv("AIP_PROFILE", "local");
369
+ await writeDeviceAuth({
370
+ platformUrl: "http://127.0.0.1:3000",
371
+ deviceToken: "test-only-device-token",
372
+ expiresAt: "2099-01-01T00:00:00Z",
373
+ user: { id: "robot", username: "robot" },
374
+ });
375
+ const host = { ...hostIdentity(), hostId: "host", generation: 1, catalogRevision: 0 };
376
+ await writeHostState(host);
377
+ await syncDeviceGitLabCredential((await readDeviceAuth()), host, {
378
+ baseUrl: "https://gitlab.example.test",
379
+ revision: 1,
380
+ credential: {
381
+ username: "robot",
382
+ token: "test-only-gitlab-token",
383
+ commitIdentity: { name: "Review Robot", email: "review@example.test" },
384
+ },
385
+ });
386
+ const projects = [];
387
+ const git = (cwd, ...args) => execFileSync("git", args, { cwd, encoding: "utf8", stdio: "pipe" }).trim();
388
+ for (const p of input.projects) {
389
+ const cwd = join(root, p.name);
390
+ git(cwd, "init", "-b", "main");
391
+ git(cwd, "config", "user.name", "fixture");
392
+ git(cwd, "config", "user.email", "fixture@example.invalid");
393
+ await writeFile(join(cwd, "code.js"), "baseline");
394
+ git(cwd, "add", "code.js");
395
+ if (p.id === input.primaryProjectId) {
396
+ await writeFile(join(cwd, "docs/aip/AIP-12/prd.md"), "仓库中的旧版需求");
397
+ git(cwd, "add", "docs/aip/AIP-12/prd.md");
398
+ }
399
+ if (ignoreMode === "local-exclude") {
400
+ await writeFile(join(cwd, ".git/info/exclude"), "docs/\n");
401
+ }
402
+ else {
403
+ await writeFile(join(cwd, ".gitignore"), (ignoreMode === "directory" ? "docs/\n" : "docs/*\n") +
404
+ (p.id === input.primaryProjectId ? "" : "*.md\n"));
405
+ git(cwd, "add", ".gitignore");
406
+ }
407
+ git(cwd, "commit", "-m", "baseline");
408
+ const remote = join(root, `${p.name}.git`);
409
+ git(root, "clone", "--bare", cwd, remote);
410
+ git(cwd, "remote", "add", "origin", remote);
411
+ git(cwd, "config", "remote.origin.mirror", "true");
412
+ git(cwd, "checkout", "-b", "aip/materials");
413
+ await writeFile(join(cwd, "unrelated.txt"), "leave staged");
414
+ git(cwd, "add", "unrelated.txt");
415
+ projects.push({
416
+ ...p,
417
+ devBranch: "aip/materials",
418
+ baselineBranch: "main",
419
+ testBranch: "test",
420
+ baseline: git(cwd, "rev-parse", "HEAD"),
421
+ });
422
+ }
423
+ input.prototypeFiles = [
424
+ { path: "pages/index.html", base64: Buffer.from("prototype").toString("base64") },
425
+ ];
426
+ await publishReviewMaterials(root, { ...input, projects });
427
+ for (const project of projects) {
428
+ const cwd = join(root, project.name);
429
+ const remote = join(root, `${project.name}.git`);
430
+ const head = git(cwd, "rev-parse", "HEAD");
431
+ expect(git(remote, "rev-parse", "refs/heads/aip/materials")).toBe(head);
432
+ expect(git(remote, "rev-parse", "main")).toBe(project.baseline);
433
+ expect(git(cwd, "diff", "--cached", "--name-only")).toBe("unrelated.txt");
434
+ if (project.id !== input.primaryProjectId) {
435
+ expect(head).toBe(project.baseline);
436
+ expect(await readdir(cwd)).not.toContain("docs");
437
+ expect(git(cwd, "status", "--porcelain")).toBe("A unrelated.txt");
438
+ continue;
439
+ }
440
+ expect(git(cwd, "log", "-1", "--format=%an <%ae>%n%cn <%ce>")).toBe("Review Robot <review@example.test>\nReview Robot <review@example.test>");
441
+ expect(git(remote, "show", `${head}:docs/aip/AIP-12/prd.md`)).toBe(input.requirement.body_markdown);
442
+ expect(git(remote, "show", `${head}:docs/aip/AIP-12/design.md`)).toBe(input.technicalDesign.content);
443
+ expect(git(cwd, "diff", "--name-only", `${project.baseline}..HEAD`)).toBe([
444
+ ".gitignore",
445
+ "docs/aip/AIP-12/design.md",
446
+ "docs/aip/AIP-12/prd.md",
447
+ "docs/aip/AIP-12/prototype/pages/index.html",
448
+ ...WORKSPACE_TEMPLATE_FILES.map((name) => `docs/aip/AIP-12/${name}`),
449
+ ]
450
+ .sort()
451
+ .join("\n"));
452
+ for (const name of WORKSPACE_TEMPLATE_FILES)
453
+ expect(git(remote, "show", `${head}:docs/aip/AIP-12/${name}`)).toBe("");
454
+ await writeFile(join(cwd, "docs/private.md"), "不应开放");
455
+ expect(git(cwd, "check-ignore", "docs/private.md")).toBe("docs/private.md");
456
+ expect(git(remote, "show", `${head}:.gitignore`)).toContain("!/docs/aip/**");
457
+ await publishReviewMaterials(root, { ...input, projects });
458
+ expect(git(cwd, "rev-parse", "HEAD")).toBe(head);
459
+ }
460
+ await writeFile(join(root, "main/docs/aip/AIP-12/prd.md"), "local edit");
461
+ await expect(publishReviewMaterials(root, { ...input, projects })).rejects.toThrow("AIP_MATERIALS_CONTENT_CONFLICT");
462
+ expect(await readFile(join(root, "main/docs/aip/AIP-12/prd.md"), "utf8")).toBe("local edit");
463
+ const secondary = join(root, "other");
464
+ const ref = "refs/heads/aip/materials";
465
+ git(secondary, "checkout", "main");
466
+ await expect(publishReviewMaterials(root, { ...input, projects })).rejects.toThrow("AIP_MATERIALS_BRANCH_MISMATCH");
467
+ git(secondary, "checkout", "aip/materials");
468
+ const remote = join(root, "other.git");
469
+ const base = git(remote, "rev-parse", ref);
470
+ const advance = git(secondary, "commit-tree", `${base}^{tree}`, "-p", base, "-m", "advance");
471
+ git(secondary, "-c", "remote.origin.mirror=false", "push", "origin", `${advance}:${ref}`);
472
+ await expect(publishReviewMaterials(root, { ...input, projects })).rejects.toThrow("GIT_PROCESS_EXIT");
473
+ expect(git(remote, "rev-parse", ref)).toBe(advance);
474
+ expect(git(secondary, "diff", "--cached", "--name-only")).toBe("unrelated.txt");
475
+ }, 30_000);
476
+ });
477
+ describe("平台指定材料的执行", () => {
478
+ it("无需 Host 识别业务文件名即可创建、保留和替换补充材料", async () => {
479
+ const { input, directory } = await setup();
480
+ const file = {
481
+ projectId: input.primaryProjectId,
482
+ path: "context/constraints.txt",
483
+ source: materialSource("平台补充材料 v1"),
484
+ mode: "create",
485
+ };
486
+ const prepared = {
487
+ ...input,
488
+ phase: "DEPLOYMENT",
489
+ materialPreparation: {
490
+ ...input.materialPreparation,
491
+ initialFiles: [file],
492
+ resumeFiles: [],
493
+ inputPaths: [file.path],
494
+ reviewPublications: [],
495
+ },
496
+ };
497
+ await executeMaterials(root, materialInput(prepared), false, readMaterialFixture);
498
+ const path = join(directory, file.path);
499
+ expect(await readFile(path, "utf8")).toBe("平台补充材料 v1");
500
+ await writeFile(path, "本地补充");
501
+ await executeMaterials(root, materialInput(prepared), false, readMaterialFixture);
502
+ await executeMaterials(root, materialInput(prepared), true, readMaterialFixture);
503
+ expect(await readFile(path, "utf8")).toBe("本地补充");
504
+ prepared.materialPreparation.resumeFiles = [
505
+ { ...file, source: materialSource("平台明确更新"), mode: "replace" },
506
+ ];
507
+ await executeMaterials(root, materialInput(prepared), true, readMaterialFixture);
508
+ expect(await readFile(path, "utf8")).toBe("平台明确更新");
509
+ expect(await readFile(join(directory, "prd.md"), "utf8")).toBe(input.requirement.body_markdown);
510
+ });
511
+ it("执行下发的任意二进制材料并拒绝不同内容与越界", async () => {
512
+ const { input, directory } = await setup();
513
+ const file = {
514
+ projectId: input.primaryProjectId,
515
+ path: "reference/data.bin",
516
+ source: materialSource(Buffer.from([0, 255, 18]).toString("base64"), "base64"),
517
+ mode: "verify",
518
+ };
519
+ const prepared = {
520
+ ...input,
521
+ materialPreparation: { ...input.materialPreparation, initialFiles: [file] },
522
+ };
523
+ await executeMaterials(root, materialInput(prepared), false, readMaterialFixture);
524
+ await executeMaterials(root, materialInput(prepared), false, readMaterialFixture);
525
+ expect(await readFile(join(directory, file.path))).toEqual(Buffer.from([0, 255, 18]));
526
+ file.source = materialSource("eA==", "base64");
527
+ await expect(executeMaterials(root, materialInput(prepared), false, readMaterialFixture)).rejects.toThrow("CONTENT_CONFLICT");
528
+ for (const path of ["../outside", "/tmp/outside", "a/../../outside", "C:/outside"]) {
529
+ file.path = path;
530
+ await expect(executeMaterials(root, materialInput(prepared), false, readMaterialFixture)).rejects.toThrow("PATH_INVALID");
531
+ }
532
+ file.path = "valid.txt";
533
+ file.projectId = "unauthorized";
534
+ await expect(executeMaterials(root, materialInput(prepared), false, readMaterialFixture)).rejects.toThrow("PRIMARY_PROJECT");
535
+ });
536
+ });
537
+ describe("平台明确的交付收集要求", () => {
538
+ it("平台可指定已有槽位的新路径与必需性,Host 不按业务阶段改写清单", async () => {
539
+ const { input, directory } = await setup();
540
+ const requirements = [
541
+ { slot: "TEST_REPORT", path: "proof/result.md", required: true },
542
+ ];
543
+ await expect(collectFiles(root, input, requirements)).rejects.toThrow("文件不存在");
544
+ expect(await collectFiles(root, input, [{ ...requirements[0], required: false }])).toEqual([]);
545
+ await mkdir(join(directory, "proof"));
546
+ await writeFile(join(directory, "proof/result.md"), "真实测试证据");
547
+ expect(await collectFiles(root, input, requirements)).toMatchObject([
548
+ { slot: "TEST_REPORT", path: "docs/aip/AIP-12/proof/result.md", content: "真实测试证据" },
549
+ ]);
550
+ for (const path of [
551
+ "../outside.md",
552
+ "/tmp/outside.md",
553
+ "C:/outside.md",
554
+ "proof/../../outside.md",
555
+ ])
556
+ await expect(collectFiles(root, input, [{ ...requirements[0], path }])).rejects.toThrow("AIP_MATERIAL_PATH_INVALID");
557
+ await symlink(join(root, "other"), join(directory, "escaped"));
558
+ await writeFile(join(root, "other/result.md"), "外部哨兵");
559
+ await expect(collectFiles(root, input, [
560
+ { ...requirements[0], path: "escaped/result.md", required: false },
561
+ ])).rejects.toThrow("路径越界");
562
+ expect(await readFile(join(root, "other/result.md"), "utf8")).toBe("外部哨兵");
563
+ });
564
+ });
565
+ describe("命令材料读取", () => {
566
+ it("多个项目引用同一大文件时仅下载一次并校验原始二进制字节", async () => {
567
+ const body = Buffer.concat([Buffer.from("中文材料".repeat(80_000)), Buffer.from([0, 255])]);
568
+ const source = materialSource(body.toString("base64"), "base64");
569
+ const fetch = vi.fn(async () => ({
570
+ content: body.toString("base64"),
571
+ encoding: "base64",
572
+ contentHash: source.contentHash,
573
+ }));
574
+ const reader = commandMaterialReader(fetch);
575
+ const copies = await Promise.all([
576
+ reader(source),
577
+ reader({ ...source, fileRef: "another-reference" }),
578
+ reader(source),
579
+ ]);
580
+ for (const copy of copies)
581
+ expect(copy.equals(body)).toBe(true);
582
+ expect(fetch).toHaveBeenCalledTimes(1);
583
+ });
584
+ it.each(["utf8", "base64"])("相同字节使用不同引用编码时接受服务端 %s 表示并复用下载", async (encoding) => {
585
+ const body = Buffer.from("相同的 PRD 和原型正文");
586
+ const utf8 = materialSource(body.toString("utf8"));
587
+ const base64 = materialSource(body.toString("base64"), "base64");
588
+ const fetch = vi.fn(async () => ({
589
+ content: body.toString(encoding),
590
+ encoding,
591
+ contentHash: utf8.contentHash,
592
+ }));
593
+ const reader = commandMaterialReader(fetch);
594
+ const first = encoding === "utf8" ? base64 : utf8;
595
+ const second = encoding === "utf8" ? utf8 : base64;
596
+ expect(await reader(first)).toEqual(body);
597
+ expect(await reader(second)).toEqual(body);
598
+ expect(fetch).toHaveBeenCalledTimes(1);
599
+ });
600
+ it.each(["hash", "body", "encoding"])("拒绝 %s 不符合材料引用的响应", async (mismatch) => {
601
+ const source = materialSource("确认材料");
602
+ const reader = commandMaterialReader(async () => ({
603
+ content: mismatch === "body" ? "被替换材料" : "确认材料",
604
+ contentHash: mismatch === "hash" ? "0".repeat(64) : source.contentHash,
605
+ encoding: mismatch === "encoding" ? "base64" : "utf8",
606
+ }));
607
+ await expect(reader(source)).rejects.toThrow("AIP_MATERIAL_CONTENT_INVALID");
608
+ });
609
+ });
610
+ describe("材料包发布创建语义", () => {
611
+ it("保留已有提交和本地填写,空文件推送工单分支,重试不覆盖也不新增提交", async () => {
612
+ const { input, directory } = await setup();
613
+ const cwd = join(root, "main");
614
+ const git = (at, ...args) => execFileSync("git", args, { cwd: at, encoding: "utf8", stdio: "pipe" }).trim();
615
+ git(cwd, "init", "-b", "main");
616
+ git(cwd, "config", "user.name", "fixture");
617
+ git(cwd, "config", "user.email", "fixture@example.invalid");
618
+ await writeFile(join(directory, "plan.md"), "已提交的开发计划");
619
+ git(cwd, "add", "docs/aip/AIP-12/plan.md");
620
+ git(cwd, "commit", "-m", "existing plan");
621
+ const remote = join(root, "material-pack.git");
622
+ git(root, "clone", "--bare", cwd, remote);
623
+ git(cwd, "remote", "add", "origin", remote);
624
+ git(cwd, "checkout", "-b", "aip/material-pack");
625
+ await writeFile(join(directory, "report.md"), "本地已完成的测试报告");
626
+ const prepared = withMaterials({
627
+ ...input,
628
+ phase: "PREPARATION",
629
+ projects: [
630
+ {
631
+ id: "p1",
632
+ name: "main",
633
+ devBranch: "aip/material-pack",
634
+ baselineBranch: "main",
635
+ testBranch: "test",
636
+ },
637
+ ],
638
+ });
639
+ const publication = prepared.materialPreparation.reviewPublications[0];
640
+ for (const file of publication.files.filter((file) => file.mode === "create"))
641
+ file.source = materialSource(file.path === "release_checklist.md" ? "" : `# 新版模板 ${file.path}`);
642
+ await publishMaterials(root, prepared, readMaterialFixture);
643
+ const head = git(cwd, "rev-parse", "HEAD");
644
+ expect(git(remote, "show", `${head}:docs/aip/AIP-12/plan.md`)).toBe("已提交的开发计划");
645
+ expect(git(remote, "show", `${head}:docs/aip/AIP-12/report.md`)).toBe("本地已完成的测试报告");
646
+ expect(git(remote, "show", `${head}:docs/aip/AIP-12/release_checklist.md`)).toBe("");
647
+ expect(git(remote, "rev-parse", "refs/heads/aip/material-pack")).toBe(head);
648
+ for (const file of publication.files.filter((file) => file.mode === "create"))
649
+ file.source = materialSource("再次调整模板");
650
+ await publishMaterials(root, prepared, readMaterialFixture);
651
+ expect(git(cwd, "rev-parse", "HEAD")).toBe(head);
652
+ expect(await readFile(join(directory, "report.md"), "utf8")).toBe("本地已完成的测试报告");
653
+ });
654
+ });
655
+ //# sourceMappingURL=delivery-files.test.js.map