agentworkshop 0.7.5 → 0.7.7

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 (519) hide show
  1. package/.AgentWorkShop/prompts/host-tools.json +1 -1
  2. package/.output/.AgentWorkShop/prompts/host-tools.json +1 -1
  3. package/.output/nitro.json +1 -1
  4. package/.output/public/_nuxt/{rzGB_ojX.js → 3612gD2V.js} +2 -2
  5. package/.output/public/_nuxt/8eIQAVlb.js +1 -0
  6. package/.output/public/_nuxt/Ah9qOv1m.js +1 -0
  7. package/.output/public/_nuxt/{DdPeifHR.js → B4Fia4FB.js} +1 -1
  8. package/.output/public/_nuxt/B7aqqzkY.js +1 -0
  9. package/.output/public/_nuxt/BJ-fxrSw.js +1 -0
  10. package/.output/public/_nuxt/{DPDqAD1e.js → BSXx2vqR.js} +1 -1
  11. package/.output/public/_nuxt/{CdSgfcYR.js → BVZjSVs2.js} +1 -1
  12. package/.output/public/_nuxt/{DP6bdyIp.js → BVzDoF8t.js} +1 -1
  13. package/.output/public/_nuxt/BYL0Rjqj.js +7 -0
  14. package/.output/public/_nuxt/{CXmkVXS5.js → BjVLsC3M.js} +1 -1
  15. package/.output/public/_nuxt/{7ZABjMRh2.js → BkfchkK62.js} +1 -1
  16. package/.output/public/_nuxt/BnVoQ74r.js +1 -0
  17. package/.output/public/_nuxt/Bnp4vIAf.js +1 -0
  18. package/.output/public/_nuxt/BsMpJf7S.js +70 -0
  19. package/.output/public/_nuxt/{Z8k0uMSI.js → Bt_HDizI.js} +1 -1
  20. package/.output/public/_nuxt/Bu-P92Pe.js +18 -0
  21. package/.output/public/_nuxt/ButLXkjo.js +2 -0
  22. package/.output/public/_nuxt/C-GarxYC.js +1 -0
  23. package/.output/public/_nuxt/{D8DDDzV62.js → C2iWjzEC2.js} +1 -1
  24. package/.output/public/_nuxt/{HWXLx5Hz.js → C8dxXc6K.js} +5 -5
  25. package/.output/public/_nuxt/CGdPdJPP.js +1 -0
  26. package/.output/public/_nuxt/{CyygA0q4.js → CQiKcuoG.js} +4 -4
  27. package/.output/public/_nuxt/{CN7Zh8GQ.js → CRGlf1Gb.js} +1 -1
  28. package/.output/public/_nuxt/{DSBfvCi5.js → CblLEiCZ.js} +7 -7
  29. package/.output/public/_nuxt/Cd15nPnG2.js +1 -0
  30. package/.output/public/_nuxt/{OwJ1LJkF.js → CsCpu2Zh.js} +1 -1
  31. package/.output/public/_nuxt/CvbHIGQY2.js +1 -0
  32. package/.output/public/_nuxt/Cyk3du4K2.js +1 -0
  33. package/.output/public/_nuxt/{DVQAz9WI.js → D4qXvjuV.js} +2 -2
  34. package/.output/public/_nuxt/{CfIXY-ET.js → DCEyMaN-.js} +1 -1
  35. package/.output/public/_nuxt/{BFYNhG9S.js → DCXIGxzT.js} +1 -1
  36. package/.output/public/_nuxt/{B9aPoQvt.js → DM8DS9MA.js} +1 -1
  37. package/.output/public/_nuxt/{ChnfyQHz.js → DNzaswei.js} +1 -1
  38. package/.output/public/_nuxt/{CrFGZYVB2.js → DYZBdSSg2.js} +1 -1
  39. package/.output/public/_nuxt/{dObsRdSQ.js → DZk24ego.js} +1 -1
  40. package/.output/public/_nuxt/DeYsUzhr.js +1 -0
  41. package/.output/public/_nuxt/Dk6pq9JB2.js +1 -0
  42. package/.output/public/_nuxt/{ByGNWgAr.js → Do88WZG2.js} +3 -3
  43. package/.output/public/_nuxt/{R_WxTozV2.js → Du-eSpo2.js} +1 -1
  44. package/.output/public/_nuxt/OmpTerminalPanel.B_Pl5Ynm.css +1 -0
  45. package/.output/public/_nuxt/{Bsc69G4x.js → VnIWJ0ts.js} +3 -3
  46. package/.output/public/_nuxt/_id_.BzKMZnLe.css +1 -0
  47. package/.output/public/_nuxt/_id_.CbpDAWRh.css +1 -0
  48. package/.output/public/_nuxt/{_wsId_.DET_GinP.css → _wsId_.COUzMXpP.css} +1 -1
  49. package/.output/public/_nuxt/agents.BlejnOOC.css +1 -0
  50. package/.output/public/_nuxt/builds/latest.json +1 -1
  51. package/.output/public/_nuxt/builds/meta/14df171d-89cb-43ec-ad6f-9df72d6da7f5.json +1 -0
  52. package/.output/public/_nuxt/daq.zZ8GR433.css +1 -0
  53. package/.output/public/_nuxt/{default.D17kXlD6.css → default.V3_hUJq1.css} +1 -1
  54. package/.output/public/_nuxt/{B4GHHF6d2.js → fQUs58kX2.js} +1 -1
  55. package/.output/public/_nuxt/p7wSGMtc.js +1 -0
  56. package/.output/public/_nuxt/tRBT-plo.js +1 -0
  57. package/.output/server/chunks/_/SearchOutlined.mjs +4 -4
  58. package/.output/server/chunks/_/SearchOutlined.mjs.map +1 -1
  59. package/.output/server/chunks/_/character-asset.repo.mjs +3 -6
  60. package/.output/server/chunks/_/character-asset.repo.mjs.map +1 -1
  61. package/.output/server/chunks/_/host-bindings.mjs +1 -1
  62. package/.output/server/chunks/_/nitro.mjs +4967 -2035
  63. package/.output/server/chunks/_/nitro.mjs.map +1 -1
  64. package/.output/server/chunks/_/scene-layout.repo.mjs +4 -10
  65. package/.output/server/chunks/_/scene-layout.repo.mjs.map +1 -1
  66. package/.output/server/chunks/build/{Col-D7fjGDF6.mjs → Col-biaNnEPf.mjs} +2 -2
  67. package/.output/server/chunks/build/{Col-D7fjGDF6.mjs.map → Col-biaNnEPf.mjs.map} +1 -1
  68. package/.output/server/chunks/build/{OmpTerminalPanel-B_SYhmgb.mjs → OmpTerminalPanel-COphA1br.mjs} +20 -19
  69. package/.output/server/chunks/build/OmpTerminalPanel-COphA1br.mjs.map +1 -0
  70. package/.output/server/chunks/build/{TownView-Bl8Gkcxi.mjs → TownView-B5KifIaT.mjs} +4 -4
  71. package/.output/server/chunks/build/{TownView-Bl8Gkcxi.mjs.map → TownView-B5KifIaT.mjs.map} +1 -1
  72. package/.output/server/chunks/build/{_id_-GnRJPykX.mjs → _id_-C-ewLgfl.mjs} +119 -119
  73. package/.output/server/chunks/build/{_id_-GnRJPykX.mjs.map → _id_-C-ewLgfl.mjs.map} +1 -1
  74. package/.output/server/chunks/build/{_id_-CWLFGZjV.mjs → _id_-Ct4Jhvl1.mjs} +42 -38
  75. package/.output/server/chunks/build/_id_-Ct4Jhvl1.mjs.map +1 -0
  76. package/.output/server/chunks/build/{_wsId_-BhQMjyHG.mjs → _wsId_-CanI_6Su.mjs} +591 -53
  77. package/.output/server/chunks/build/{_wsId_-BhQMjyHG.mjs.map → _wsId_-CanI_6Su.mjs.map} +1 -1
  78. package/.output/server/chunks/build/{agents-D4l1icvn.mjs → agents-DSOptxXA.mjs} +146 -91
  79. package/.output/server/chunks/build/agents-DSOptxXA.mjs.map +1 -0
  80. package/.output/server/chunks/build/{alert-gH-s7yIh.mjs → alert-qJnjyRcP.mjs} +3 -3
  81. package/.output/server/chunks/build/{alert-gH-s7yIh.mjs.map → alert-qJnjyRcP.mjs.map} +1 -1
  82. package/.output/server/chunks/build/{button-BhbX5ACI.mjs → button-DEcZFcqN.mjs} +3 -3
  83. package/.output/server/chunks/build/{button-BhbX5ACI.mjs.map → button-DEcZFcqN.mjs.map} +1 -1
  84. package/.output/server/chunks/build/{card-l4BbX67w.mjs → card-Dipvaykh.mjs} +5 -5
  85. package/.output/server/chunks/build/{card-l4BbX67w.mjs.map → card-Dipvaykh.mjs.map} +1 -1
  86. package/.output/server/chunks/build/{channel-templates-DqjtC-R0.mjs → channel-templates-BK0KuPOd.mjs} +13 -12
  87. package/.output/server/chunks/build/channel-templates-BK0KuPOd.mjs.map +1 -0
  88. package/.output/server/chunks/build/{checkbox-BF11p3dH.mjs → checkbox-dzcpU_Cd.mjs} +4 -4
  89. package/.output/server/chunks/build/{checkbox-BF11p3dH.mjs.map → checkbox-dzcpU_Cd.mjs.map} +1 -1
  90. package/.output/server/chunks/build/{daq-BOgpn9sl.mjs → daq-D9RA_uze.mjs} +102 -102
  91. package/.output/server/chunks/build/{daq-BOgpn9sl.mjs.map → daq-D9RA_uze.mjs.map} +1 -1
  92. package/.output/server/chunks/build/dcw-BTM5YU-B.mjs +1 -1
  93. package/.output/server/chunks/build/{default-CKJWhkot.mjs → default-BfWGTlbj.mjs} +81 -23
  94. package/.output/server/chunks/build/{default-CKJWhkot.mjs.map → default-BfWGTlbj.mjs.map} +1 -1
  95. package/.output/server/chunks/build/{drawer-CVValqoh.mjs → drawer-Cmh90erI.mjs} +3 -3
  96. package/.output/server/chunks/build/{drawer-CVValqoh.mjs.map → drawer-Cmh90erI.mjs.map} +1 -1
  97. package/.output/server/chunks/build/{dropdown-ByCsEWlQ.mjs → dropdown-CGQ0KAzA.mjs} +2 -2
  98. package/.output/server/chunks/build/{dropdown-ByCsEWlQ.mjs.map → dropdown-CGQ0KAzA.mjs.map} +1 -1
  99. package/.output/server/chunks/build/{dropdown-Dex8PXu6.mjs → dropdown-vhn1NPFs.mjs} +4 -4
  100. package/.output/server/chunks/build/{dropdown-Dex8PXu6.mjs.map → dropdown-vhn1NPFs.mjs.map} +1 -1
  101. package/.output/server/chunks/build/{input-number-BBlRoAJ7.mjs → input-number-Bd55elNN.mjs} +5 -5
  102. package/.output/server/chunks/build/{input-number-BBlRoAJ7.mjs.map → input-number-Bd55elNN.mjs.map} +1 -1
  103. package/.output/server/chunks/build/{input--KMeLYqZ.mjs → input-sf_BT6o6.mjs} +3 -3
  104. package/.output/server/chunks/build/{input--KMeLYqZ.mjs.map → input-sf_BT6o6.mjs.map} +1 -1
  105. package/.output/server/chunks/build/logs-Dyk0I2I9.mjs +1 -1
  106. package/.output/server/chunks/build/{menu-xN-SXb9Q.mjs → menu-WCrlpYVh.mjs} +3 -3
  107. package/.output/server/chunks/build/{menu-xN-SXb9Q.mjs.map → menu-WCrlpYVh.mjs.map} +1 -1
  108. package/.output/server/chunks/build/{modal-DrCOcjrl.mjs → modal-yvUquPj5.mjs} +4 -4
  109. package/.output/server/chunks/build/{modal-DrCOcjrl.mjs.map → modal-yvUquPj5.mjs.map} +1 -1
  110. package/.output/server/chunks/build/{monitor-KW8WLOJd.mjs → monitor-MIOvsyLa.mjs} +21 -21
  111. package/.output/server/chunks/build/{monitor-KW8WLOJd.mjs.map → monitor-MIOvsyLa.mjs.map} +1 -1
  112. package/.output/server/chunks/build/pages-DR2bzczM.mjs +1 -1
  113. package/.output/server/chunks/build/{plugins-B-ZNey0Z.mjs → plugins-DnOBIWGg.mjs} +7 -7
  114. package/.output/server/chunks/build/{plugins-B-ZNey0Z.mjs.map → plugins-DnOBIWGg.mjs.map} +1 -1
  115. package/.output/server/chunks/build/{popconfirm-C5H1Qoh3.mjs → popconfirm-CRaHcz5O.mjs} +4 -4
  116. package/.output/server/chunks/build/{popconfirm-C5H1Qoh3.mjs.map → popconfirm-CRaHcz5O.mjs.map} +1 -1
  117. package/.output/server/chunks/build/{useWorkshopApi-Bh5VUHWu.mjs → segmented-DPe9ZzLO.mjs} +7 -78
  118. package/.output/server/chunks/build/segmented-DPe9ZzLO.mjs.map +1 -0
  119. package/.output/server/chunks/build/{select-D7H2ysgT.mjs → select-D-CeE5vY.mjs} +3 -3
  120. package/.output/server/chunks/build/{select-D7H2ysgT.mjs.map → select-D-CeE5vY.mjs.map} +1 -1
  121. package/.output/server/chunks/build/{settings-Cr06lbRy.mjs → settings-DA8IkGLo.mjs} +11 -11
  122. package/.output/server/chunks/build/{settings-Cr06lbRy.mjs.map → settings-DA8IkGLo.mjs.map} +1 -1
  123. package/.output/server/chunks/build/{space-DCwIlnkI.mjs → space-CCBYAkXt.mjs} +2 -2
  124. package/.output/server/chunks/build/{space-DCwIlnkI.mjs.map → space-CCBYAkXt.mjs.map} +1 -1
  125. package/.output/server/chunks/build/{switch-VC0m9ede.mjs → switch-CelRXpcy.mjs} +3 -3
  126. package/.output/server/chunks/build/{switch-VC0m9ede.mjs.map → switch-CelRXpcy.mjs.map} +1 -1
  127. package/.output/server/chunks/build/{table-BksLg3Q_.mjs → table-Cswq-l2r.mjs} +10 -10
  128. package/.output/server/chunks/build/{table-BksLg3Q_.mjs.map → table-Cswq-l2r.mjs.map} +1 -1
  129. package/.output/server/chunks/build/{tabs-CzUfD3iX.mjs → tabs-BM3tAh_J.mjs} +5 -5
  130. package/.output/server/chunks/build/{tabs-CzUfD3iX.mjs.map → tabs-BM3tAh_J.mjs.map} +1 -1
  131. package/.output/server/chunks/build/{tag-oQI3VtqM.mjs → tag-NO9jEqKy.mjs} +4 -4
  132. package/.output/server/chunks/build/{tag-oQI3VtqM.mjs.map → tag-NO9jEqKy.mjs.map} +1 -1
  133. package/.output/server/chunks/build/{teams-QR3BBF7A.mjs → teams-BhSKBBBM.mjs} +15 -14
  134. package/.output/server/chunks/build/teams-BhSKBBBM.mjs.map +1 -0
  135. package/.output/server/chunks/build/{tokens-DFvr_TLj.mjs → tokens-D_eyxmcv.mjs} +16 -16
  136. package/.output/server/chunks/build/{tokens-DFvr_TLj.mjs.map → tokens-D_eyxmcv.mjs.map} +1 -1
  137. package/.output/server/chunks/build/town-BUqRobze.mjs +1 -1
  138. package/.output/server/chunks/build/{town-_4tEEEVW.mjs → town-DPtOPRRO.mjs} +4 -4
  139. package/.output/server/chunks/build/{town-_4tEEEVW.mjs.map → town-DPtOPRRO.mjs.map} +1 -1
  140. package/.output/server/chunks/build/useLocalTime-9a4B-aHv.mjs +42 -0
  141. package/.output/server/chunks/build/useLocalTime-9a4B-aHv.mjs.map +1 -0
  142. package/.output/server/chunks/build/useWorkshopApi-D2gq06N2.mjs +81 -0
  143. package/.output/server/chunks/build/useWorkshopApi-D2gq06N2.mjs.map +1 -0
  144. package/.output/server/chunks/build/useWorkshopWs-B3j5wIAK.mjs +1 -1
  145. package/.output/server/chunks/build/user-Dk-ytEUV.mjs +1 -1
  146. package/.output/server/chunks/build/{users-4FZ0yFUO.mjs → users-CmVvb1oq.mjs} +16 -16
  147. package/.output/server/chunks/build/{users-4FZ0yFUO.mjs.map → users-CmVvb1oq.mjs.map} +1 -1
  148. package/.output/server/chunks/build/{workshop-k0XZTFKg.mjs → workshop-iCzNRifn.mjs} +9 -9
  149. package/.output/server/chunks/build/{workshop-k0XZTFKg.mjs.map → workshop-iCzNRifn.mjs.map} +1 -1
  150. package/.output/server/chunks/build/workspaces-IfORCDJE.mjs +1 -1
  151. package/.output/server/chunks/routes/api/health.get.mjs +1 -1
  152. package/.output/server/chunks/routes/api/index.get.mjs +1 -1
  153. package/.output/server/chunks/routes/api/index.post.mjs +1 -1
  154. package/.output/server/chunks/routes/api/mcp/workshop.mjs +1 -1
  155. package/.output/server/chunks/routes/api/metrics.mjs +1 -1
  156. package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs +1 -1
  157. package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs +1 -1
  158. package/.output/server/chunks/routes/api/plugins/manifest.get.mjs +1 -1
  159. package/.output/server/chunks/routes/api/system/config.get.mjs +1 -1
  160. package/.output/server/chunks/routes/api/system/index.get.mjs +3 -3
  161. package/.output/server/chunks/routes/api/system/index.get.mjs.map +1 -1
  162. package/.output/server/chunks/routes/api/system/index.patch.mjs +1 -1
  163. package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs +1 -1
  164. package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs +1 -1
  165. package/.output/server/chunks/routes/api/system/monitor.get.mjs +1 -1
  166. package/.output/server/chunks/routes/api/system/settings/events.get.mjs +1 -1
  167. package/.output/server/chunks/routes/api/system/settings/reset.post.mjs +1 -1
  168. package/.output/server/chunks/routes/api/users/_id_.delete.mjs +1 -1
  169. package/.output/server/chunks/routes/api/users/_id_.get.mjs +1 -1
  170. package/.output/server/chunks/routes/api/users/_id_.put.mjs +1 -1
  171. package/.output/server/chunks/routes/api/users/index.get.mjs +1 -1
  172. package/.output/server/chunks/routes/api/users/index.post.mjs +1 -1
  173. package/.output/server/chunks/routes/api/users/login.post.mjs +1 -1
  174. package/.output/server/chunks/routes/api/users/logout.post.mjs +1 -1
  175. package/.output/server/chunks/routes/api/users/me.get.mjs +1 -1
  176. package/.output/server/chunks/routes/api/users/register.post.mjs +1 -1
  177. package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs +1 -1
  178. package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs +1 -1
  179. package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs +1 -1
  180. package/.output/server/chunks/routes/api/workshop/_...path_.mjs +1 -1
  181. package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs +1 -1
  182. package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs +1 -1
  183. package/.output/server/chunks/routes/api/workshop/a2a/send.post.mjs +1 -1
  184. package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs +1 -1
  185. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs +1 -1
  186. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs +1 -1
  187. package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs +1 -1
  188. package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs +1 -1
  189. package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs +1 -1
  190. package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs +6 -14
  191. package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs.map +1 -1
  192. package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs +39 -0
  193. package/.output/server/chunks/routes/api/workshop/agent-tools/list.get.mjs.map +1 -0
  194. package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs +1 -1
  195. package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs +1 -1
  196. package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs +1 -1
  197. package/.output/server/chunks/routes/api/workshop/agents/subscribe.post.mjs +1 -1
  198. package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs +1 -1
  199. package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs +1 -1
  200. package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs +1 -1
  201. package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs +1 -1
  202. package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs +2 -2
  203. package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs +1 -1
  204. package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs +2 -2
  205. package/.output/server/chunks/routes/api/workshop/audit.get.mjs +1 -1
  206. package/.output/server/chunks/routes/api/workshop/caller.mjs +1 -1
  207. package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +2 -2
  208. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.delete.mjs +1 -1
  209. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs +1 -1
  210. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs +1 -1
  211. package/.output/server/chunks/routes/api/workshop/channel-templates/from-channel.post.mjs +1 -1
  212. package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs +2 -2
  213. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs +1 -1
  214. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.post.mjs +1 -1
  215. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs +1 -1
  216. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/search.post.mjs +1 -1
  217. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs +1 -1
  218. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs +1 -1
  219. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs +1 -1
  220. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs +1 -1
  221. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs +1 -1
  222. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs +1 -1
  223. package/.output/server/chunks/routes/api/workshop/channels/_id/events.get.mjs +1 -1
  224. package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs +1 -1
  225. package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs +2 -2
  226. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs +1 -1
  227. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs +1 -1
  228. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs +1 -1
  229. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs +1 -1
  230. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs +1 -1
  231. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs +1 -1
  232. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs +1 -1
  233. package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs +1 -1
  234. package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs +2 -2
  235. package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs +1 -1
  236. package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs +2 -2
  237. package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs +9 -2
  238. package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs.map +1 -1
  239. package/.output/server/chunks/routes/api/workshop/channels.get.mjs +1 -1
  240. package/.output/server/chunks/routes/api/workshop/channels.post.mjs +2 -2
  241. package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs +2 -2
  242. package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs +2 -2
  243. package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs +2 -2
  244. package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +6 -4
  245. package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs.map +1 -1
  246. package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs +2 -2
  247. package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs +2 -2
  248. package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs +2 -2
  249. package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs +2 -2
  250. package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs +2 -2
  251. package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs +2 -2
  252. package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs +2 -2
  253. package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +2 -2
  254. package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs +2 -2
  255. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +2 -2
  256. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +2 -2
  257. package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +2 -2
  258. package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +2 -2
  259. package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +2 -2
  260. package/.output/server/chunks/routes/api/workshop/dcw/_id/read.post.mjs +2 -2
  261. package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +2 -2
  262. package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +2 -2
  263. package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +2 -2
  264. package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +2 -2
  265. package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +2 -2
  266. package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +2 -2
  267. package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +2 -2
  268. package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +2 -2
  269. package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +2 -2
  270. package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +2 -2
  271. package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +2 -2
  272. package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +2 -2
  273. package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +2 -2
  274. package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +2 -2
  275. package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +2 -2
  276. package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +2 -2
  277. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +2 -2
  278. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +2 -2
  279. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +2 -2
  280. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs +2 -2
  281. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +2 -2
  282. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +2 -2
  283. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +2 -2
  284. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +2 -2
  285. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +2 -2
  286. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +2 -2
  287. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +2 -2
  288. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs +2 -2
  289. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +2 -2
  290. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +2 -2
  291. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.patch.mjs +2 -2
  292. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +2 -2
  293. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +2 -2
  294. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +2 -2
  295. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +2 -2
  296. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +2 -2
  297. package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +2 -2
  298. package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs +1 -1
  299. package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs +1 -1
  300. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs +2 -2
  301. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs +2 -2
  302. package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs +1 -1
  303. package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +247 -0
  304. package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs.map +1 -0
  305. package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs +27 -0
  306. package/.output/server/chunks/routes/api/workshop/harnesses.get.mjs.map +1 -0
  307. package/.output/server/chunks/routes/api/workshop/hitl/pending.get.mjs +1 -1
  308. package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs +19 -7
  309. package/.output/server/chunks/routes/api/workshop/hitl/respond.post.mjs.map +1 -1
  310. package/.output/server/chunks/routes/api/workshop/index.get.mjs +1 -1
  311. package/.output/server/chunks/routes/api/workshop/index.post.mjs +1 -1
  312. package/.output/server/chunks/routes/api/workshop/index10.get.mjs +1 -1
  313. package/.output/server/chunks/routes/api/workshop/index2.get.mjs +1 -1
  314. package/.output/server/chunks/routes/api/workshop/index2.post.mjs +1 -1
  315. package/.output/server/chunks/routes/api/workshop/index3.get.mjs +1 -1
  316. package/.output/server/chunks/routes/api/workshop/index3.post.mjs +2 -2
  317. package/.output/server/chunks/routes/api/workshop/index4.get.mjs +2 -2
  318. package/.output/server/chunks/routes/api/workshop/index4.post.mjs +2 -2
  319. package/.output/server/chunks/routes/api/workshop/index5.get.mjs +2 -2
  320. package/.output/server/chunks/routes/api/workshop/index5.post.mjs +2 -2
  321. package/.output/server/chunks/routes/api/workshop/index6.get.mjs +1 -1
  322. package/.output/server/chunks/routes/api/workshop/index6.post.mjs +2 -2
  323. package/.output/server/chunks/routes/api/workshop/index7.get.mjs +1 -1
  324. package/.output/server/chunks/routes/api/workshop/index7.post.mjs +1 -1
  325. package/.output/server/chunks/routes/api/workshop/index8.get.mjs +1 -1
  326. package/.output/server/chunks/routes/api/workshop/index8.post.mjs +1 -1
  327. package/.output/server/chunks/routes/api/workshop/index9.get.mjs +1 -1
  328. package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs +1 -1
  329. package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs +1 -1
  330. package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs +1 -1
  331. package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +1 -1
  332. package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +1 -1
  333. package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs +1 -1
  334. package/.output/server/chunks/routes/api/workshop/runtime.get.mjs +1 -1
  335. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +1 -1
  336. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +1 -1
  337. package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs +1 -1
  338. package/.output/server/chunks/routes/api/workshop/tasks/_id/complete.post.mjs +1 -1
  339. package/.output/server/chunks/routes/api/workshop/tasks/_id/dispatch.post.mjs +1 -1
  340. package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs +1 -1
  341. package/.output/server/chunks/routes/api/workshop/tasks/_id/report.post.mjs +1 -1
  342. package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs +1 -1
  343. package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs +1 -1
  344. package/.output/server/chunks/routes/api/workshop/tasks.get.mjs +1 -1
  345. package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs +2 -2
  346. package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs +1 -1
  347. package/.output/server/chunks/routes/api/workshop/teams/_id/index.post.mjs +1 -1
  348. package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs +1 -1
  349. package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs +1 -1
  350. package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs +1 -1
  351. package/.output/server/chunks/routes/api/workshop/teams/_id_.patch.mjs +1 -1
  352. package/.output/server/chunks/routes/api/workshop/users/me.get.mjs +1 -1
  353. package/.output/server/chunks/routes/api/workshop/users/register.post.mjs +1 -1
  354. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +2 -2
  355. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.delete.mjs +1 -1
  356. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs +1 -1
  357. package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs +1 -1
  358. package/.output/server/chunks/routes/renderer.mjs +1 -1
  359. package/.output/server/chunks/virtual/entry.mjs +123 -113
  360. package/.output/server/chunks/virtual/entry.mjs.map +1 -1
  361. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  362. package/.output/server/index.mjs +1 -1
  363. package/.output/server/package.json +1 -1
  364. package/app/components/AppHeader.vue +56 -2
  365. package/app/components/workshop/ChannelSessionList.vue +703 -593
  366. package/app/components/workshop/terminal/OmpTerminalPanel.vue +2 -1
  367. package/app/composables/workshop/useLocalTime.ts +16 -0
  368. package/app/composables/workshop/useSceneLayouts.ts +2 -1
  369. package/app/composables/workshop/useWorkshopApi.ts +249 -224
  370. package/app/pages/daq/[id].vue +7 -6
  371. package/app/pages/daq/index.vue +2 -2
  372. package/app/pages/dcw/[id].vue +3 -3
  373. package/app/pages/workshop/agents.vue +432 -382
  374. package/bin/aw.mjs +0 -0
  375. package/cli/aw.mjs +8 -1
  376. package/cli/commands/stop.mjs +111 -108
  377. package/cli/commands/tui.mjs +10 -1
  378. package/cli/core/registry.mjs +5 -3
  379. package/cli/infra.mjs +108 -109
  380. package/config.yml +134 -134
  381. package/docs/tui.md +1 -1
  382. package/i18n/locales/en.ts +5 -0
  383. package/i18n/locales/zh-CN.ts +5 -0
  384. package/package.json +148 -140
  385. package/scripts/_dbg-catalog-smoke.ts +20 -0
  386. package/scripts/_dbg-codex-probe.mjs +58 -0
  387. package/scripts/_dbg-dsh-probe.mjs +31 -0
  388. package/scripts/_dbg-interval-scenario.mjs +126 -0
  389. package/scripts/_dbg-line-spawn.ts +31 -0
  390. package/scripts/_dbg-live-engine-probe.mjs +80 -0
  391. package/scripts/_dbg-mcp-bridge-probe.mjs +147 -0
  392. package/scripts/_dbg-opencode-sse.mjs +101 -0
  393. package/scripts/_dbg-opencode-start.ts +57 -0
  394. package/scripts/_dbg-plugin-matrix.mjs +212 -0
  395. package/scripts/_dbg-protocol-matrix.mjs +425 -0
  396. package/scripts/_dbg-real-scenario-timeline.log +123 -0
  397. package/scripts/_dbg-registry-smoke.ts +14 -0
  398. package/scripts/_dbg-sim-keeper.mjs +100 -0
  399. package/scripts/_dbg-team-drill.mjs +173 -0
  400. package/scripts/dev-guard.mjs +11 -3
  401. package/scripts/dev-protocol-simulators.mjs +28 -1
  402. package/scripts/e2e-multi-harness.ts +374 -0
  403. package/scripts/e2e-multiharness-team.mjs +319 -0
  404. package/scripts/e2e-plc-scenario.mjs +292 -0
  405. package/scripts/e2e-real-scenario.mjs +452 -0
  406. package/scripts/migrate-local-time.mjs +123 -0
  407. package/scripts/start.mjs +60 -9
  408. package/server/api/system/settings/index.get.ts +3 -3
  409. package/server/api/workshop/agent-tools/invoke.post.ts +27 -41
  410. package/server/api/workshop/agent-tools/list.get.ts +25 -0
  411. package/server/api/workshop/channels/[id]/index.patch.ts +38 -30
  412. package/server/api/workshop/daq/[id]/samples.get.ts +6 -3
  413. package/server/api/workshop/harnesses/[id]/providers.get.ts +16 -0
  414. package/server/api/workshop/harnesses.get.ts +12 -0
  415. package/server/api/workshop/hitl/respond.post.ts +87 -67
  416. package/server/api/workshop/ws.ts +13 -0
  417. package/server/data/daqs.json +1366 -16
  418. package/server/data/dcw-lines.json +266 -0
  419. package/server/data/dcw-products.json +203 -0
  420. package/server/data/dcw-recipes.json +784 -0
  421. package/server/data/dcw-rollback.json +1144 -1
  422. package/server/data/dcw-runs.json +983 -791
  423. package/server/data/dcw-writes.json +1080 -0
  424. package/server/data/dcws.json +3278 -203
  425. package/server/data/line-runs.json +52 -2
  426. package/server/harness/aw-mcp-bridge.mjs +153 -0
  427. package/server/plugins/00-local-time.ts +10 -0
  428. package/server/plugins/aw-plugins.ts +3 -0
  429. package/server/plugins/backup.ts +116 -97
  430. package/server/plugins/dev-stability-guard.ts +24 -15
  431. package/server/plugins/retention.ts +1 -0
  432. package/server/plugins/security.ts +24 -3
  433. package/server/plugins/workshop.ts +156 -153
  434. package/server/repositories/user.repository.ts +414 -391
  435. package/server/services/system-config.ts +30 -6
  436. package/server/services/workshop/.mimosa/hook-state/sess_fed429fb-c8b7-4a50-bbd6-45afc580893f.json +1 -0
  437. package/server/services/workshop/.mimosa/hook-status/sess_fed429fb-c8b7-4a50-bbd6-45afc580893f-e6b75bbfe6.json +14 -0
  438. package/server/services/workshop/agents/adapters/line-spawn.ts +108 -0
  439. package/server/services/workshop/agents/adapters/stdio-jsonrpc.ts +316 -0
  440. package/server/services/workshop/agents/agent-interface.ts +17 -0
  441. package/server/services/workshop/agents/codex-agent.ts +822 -0
  442. package/server/services/workshop/agents/dsh-agent.ts +670 -0
  443. package/server/services/workshop/agents/factory.ts +4 -16
  444. package/server/services/workshop/agents/harness-env.ts +54 -0
  445. package/server/services/workshop/agents/harness-models.ts +270 -0
  446. package/server/services/workshop/agents/host-tool-bridge.ts +592 -0
  447. package/server/services/workshop/agents/industrial-tools.ts +5 -1
  448. package/server/services/workshop/agents/node-bindings.repo.ts +4 -5
  449. package/server/services/workshop/agents/omp-agent.ts +1178 -1957
  450. package/server/services/workshop/agents/opencode-agent.ts +987 -0
  451. package/server/services/workshop/agents/prompt-builder.ts +393 -0
  452. package/server/services/workshop/agents/registry.ts +125 -0
  453. package/server/services/workshop/assets/character-asset.repo.ts +3 -5
  454. package/server/services/workshop/assets/device-twin.repo.ts +3 -5
  455. package/server/services/workshop/daq/daq-controller.ts +8 -4
  456. package/server/services/workshop/daq/daq-node.repo.ts +3 -5
  457. package/server/services/workshop/daq/daq-node.ts +2 -2
  458. package/server/services/workshop/daq/daq-templates.ts +3 -5
  459. package/server/services/workshop/daq/drivers.ts +41 -12
  460. package/server/services/workshop/daq/storage/sqlite.adapter.ts +313 -309
  461. package/server/services/workshop/db/backup-registry.ts +33 -0
  462. package/server/services/workshop/db/channel.repo.ts +104 -101
  463. package/server/services/workshop/db/database.ts +956 -949
  464. package/server/services/workshop/dcw/dcw-controller.ts +3 -1
  465. package/server/services/workshop/dcw/dcw-line.repo.ts +4 -11
  466. package/server/services/workshop/dcw/dcw-node.repo.ts +3 -5
  467. package/server/services/workshop/dcw/dcw-node.ts +13 -1
  468. package/server/services/workshop/dcw/dcw-product.repo.ts +3 -4
  469. package/server/services/workshop/dcw/dcw-recipe.repo.ts +3 -19
  470. package/server/services/workshop/dcw/dcw-templates.ts +3 -5
  471. package/server/services/workshop/dcw/drivers.ts +37 -13
  472. package/server/services/workshop/dcw/line-run.ts +3 -5
  473. package/server/services/workshop/dcw/recipe-rollback.repo.ts +4 -10
  474. package/server/services/workshop/json-store.mjs +72 -0
  475. package/server/services/workshop/plugins/host.mjs +2 -1
  476. package/server/services/workshop/runtime/agent-runtime.ts +44 -0
  477. package/server/services/workshop/runtime/manager.ts +2953 -2868
  478. package/server/services/workshop/scene/scene-layout.repo.ts +4 -11
  479. package/server/services/workshop/settings.ts +7 -0
  480. package/shared/config/schema.json +5 -0
  481. package/shared/config/single-instance.mjs +133 -86
  482. package/shared/local-time.mjs +36 -0
  483. package/shared/workshop-protocol.ts +11 -5
  484. package/tui/aw-tui.mjs +28 -10
  485. package/tui/components/hitl-card.mjs +47 -36
  486. package/tui/lib/config.mjs +62 -58
  487. package/tui/lib/ws.mjs +2 -1
  488. package/.output/public/_nuxt/9X0fVBD7.js +0 -57
  489. package/.output/public/_nuxt/B6M2WJWm2.js +0 -1
  490. package/.output/public/_nuxt/B9Yie5HN.js +0 -2
  491. package/.output/public/_nuxt/BF9XPEuw.js +0 -1
  492. package/.output/public/_nuxt/BbQornXa.js +0 -1
  493. package/.output/public/_nuxt/Bxgaym6j.js +0 -1
  494. package/.output/public/_nuxt/Bxh5nf8j.js +0 -1
  495. package/.output/public/_nuxt/CXLI50Sq.js +0 -1
  496. package/.output/public/_nuxt/CdfAP_IH2.js +0 -1
  497. package/.output/public/_nuxt/Ce1zyNYu.js +0 -1
  498. package/.output/public/_nuxt/D-Ne4C9a.js +0 -1
  499. package/.output/public/_nuxt/DEHNjlTq2.js +0 -1
  500. package/.output/public/_nuxt/DFnGFEav.js +0 -18
  501. package/.output/public/_nuxt/DYWgGHNo.js +0 -7
  502. package/.output/public/_nuxt/OmpTerminalPanel.Bc9GjNU5.css +0 -1
  503. package/.output/public/_nuxt/W1E3-5ML.js +0 -14
  504. package/.output/public/_nuxt/XVB9_zwP.js +0 -1
  505. package/.output/public/_nuxt/Xaf_HIR3.js +0 -1
  506. package/.output/public/_nuxt/_id_.BeqSLvl_.css +0 -1
  507. package/.output/public/_nuxt/_id_.DN3U6EF9.css +0 -1
  508. package/.output/public/_nuxt/agents.BJwgTLFZ.css +0 -1
  509. package/.output/public/_nuxt/builds/meta/55c10854-ee0e-4be4-924b-a1b0e100fe11.json +0 -1
  510. package/.output/public/_nuxt/daq.BXsnevQv.css +0 -1
  511. package/.output/public/_nuxt/yIKY_V1P.js +0 -1
  512. package/.output/server/chunks/build/OmpTerminalPanel-B_SYhmgb.mjs.map +0 -1
  513. package/.output/server/chunks/build/_id_-CWLFGZjV.mjs.map +0 -1
  514. package/.output/server/chunks/build/agents-D4l1icvn.mjs.map +0 -1
  515. package/.output/server/chunks/build/channel-templates-DqjtC-R0.mjs.map +0 -1
  516. package/.output/server/chunks/build/interval-WlxgjTzO.mjs +0 -9
  517. package/.output/server/chunks/build/interval-WlxgjTzO.mjs.map +0 -1
  518. package/.output/server/chunks/build/teams-QR3BBF7A.mjs.map +0 -1
  519. package/.output/server/chunks/build/useWorkshopApi-Bh5VUHWu.mjs.map +0 -1
@@ -0,0 +1,58 @@
1
+ /**
2
+ * codex app-server 裸协议探针:initialize → thread/start → turn/start,原样打印全部通知。
3
+ * 运行:node scripts/_dbg-codex-probe.mjs
4
+ */
5
+ import { spawn } from 'node:child_process'
6
+ import { createInterface } from 'node:readline'
7
+ import { randomUUID } from 'node:crypto'
8
+ import { mkdtempSync, copyFileSync } from 'node:fs'
9
+ import { join } from 'node:path'
10
+ import { homedir, tmpdir } from 'node:os'
11
+
12
+ const home = mkdtempSync(join(tmpdir(), 'aw-codex-probe-'))
13
+ try { copyFileSync(join(homedir(), '.codex', 'auth.json'), join(home, 'auth.json')) } catch {}
14
+ console.log('CODEX_HOME=', home)
15
+
16
+ const child = spawn('cmd.exe', ['/d', '/s', '/c', 'codex app-server'], {
17
+ env: { ...process.env, CODEX_HOME: home },
18
+ stdio: ['pipe', 'pipe', 'pipe'],
19
+ windowsVerbatimArguments: true,
20
+ shell: false,
21
+ })
22
+ let seq = 0
23
+ const pending = new Map()
24
+ const rl = createInterface({ input: child.stdout })
25
+ rl.on('line', (line) => {
26
+ let f
27
+ try { f = JSON.parse(line) } catch { console.log('[non-json]', line.slice(0, 120)); return }
28
+ if (f.id !== undefined && (f.result !== undefined || f.error !== undefined)) {
29
+ const p = pending.get(f.id)
30
+ if (p) { pending.delete(f.id); p(f) }
31
+ else console.log('[resp-no-waiter]', JSON.stringify(f).slice(0, 200))
32
+ return
33
+ }
34
+ console.log('[notify]', JSON.stringify(f).slice(0, 400))
35
+ })
36
+ child.stderr.on('data', d => process.stderr.write('[stderr] ' + d))
37
+
38
+ function request(method, params, timeoutMs = 30_000) {
39
+ const id = ++seq
40
+ return new Promise((resolve, reject) => {
41
+ const timer = setTimeout(() => reject(new Error(`timeout ${method}`)), timeoutMs)
42
+ pending.set(id, (f) => { clearTimeout(timer); f.error ? reject(new Error(JSON.stringify(f.error))) : resolve(f.result) })
43
+ child.stdin.write(JSON.stringify({ jsonrpc: '2.0', id, method, ...(params !== undefined ? { params } : {}) }) + '\n')
44
+ })
45
+ }
46
+
47
+ const init = await request('initialize', { clientInfo: { name: 'aw-probe', title: 'probe', version: '0.0.1' } })
48
+ console.log('[init.result]', JSON.stringify(init).slice(0, 300))
49
+ child.stdin.write(JSON.stringify({ jsonrpc: '2.0', method: 'initialized', params: {} }) + '\n')
50
+
51
+ const thread = await request('thread/start', { cwd: process.cwd(), approvalPolicy: 'on-request', sandbox: 'workspace-write' })
52
+ const threadId = thread?.thread?.id ?? thread?.id
53
+ console.log('[thread]', threadId)
54
+
55
+ await request('turn/start', { threadId, input: [{ type: 'text', text: 'Reply with exactly: OK' }] }, 60_000)
56
+ console.log('[turn/start accepted]; waiting notifications...')
57
+
58
+ setTimeout(() => { console.log('[done listening]'); child.kill('SIGKILL'); process.exit(0) }, 45_000)
@@ -0,0 +1,31 @@
1
+ /**
2
+ * dsh ACP 裸协议探针:spawn `dsh --profile acp`,发 initialize,原样打印 stdout/stderr。
3
+ * 运行:node scripts/_dbg-dsh-probe.mjs
4
+ */
5
+ import { spawn } from 'node:child_process'
6
+
7
+ const child = spawn('cmd.exe', ['/d', '/s', '/c', 'dsh --profile acp'], {
8
+ env: { ...process.env },
9
+ stdio: ['pipe', 'pipe', 'pipe'],
10
+ windowsVerbatimArguments: true,
11
+ shell: false,
12
+ })
13
+ child.stdout.on('data', (d) => process.stdout.write('[out] ' + d))
14
+ child.stderr.on('data', (d) => process.stderr.write('[err] ' + d))
15
+ child.on('exit', (code) => { console.log('[exit]', code); process.exit(0) })
16
+
17
+ setTimeout(() => {
18
+ console.log('\n── sending initialize (t+15s) ──')
19
+ child.stdin.write(JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'initialize', params: { protocolVersion: 1, clientCapabilities: {} } }) + '\n')
20
+ }, 15_000)
21
+
22
+ setTimeout(() => {
23
+ console.log('\n── resending initialize (t+40s) ──')
24
+ child.stdin.write(JSON.stringify({ jsonrpc: '2.0', id: 2, method: 'initialize', params: { protocolVersion: 1, clientCapabilities: {} } }) + '\n')
25
+ }, 40_000)
26
+
27
+ setTimeout(() => {
28
+ console.log('\n── timeout, killing ──')
29
+ child.kill('SIGKILL')
30
+ process.exit(0)
31
+ }, 70_000)
@@ -0,0 +1,126 @@
1
+ /**
2
+ * 采样/查询时间间隔 场景测试(真实链路)。
3
+ * NO_PROXY='127.0.0.1,localhost' node scripts/_dbg-interval-scenario.mjs [--base http://127.0.0.1:3001]
4
+ *
5
+ * 验收:
6
+ * S1 节点采样间隔独立可调:同产线 3 节点 intervalMs=1000/5000/7000 → 60s 内样本数呈独立节拍
7
+ * (A≈55-60, B≈11-13, C≈8-10);下限 1s(<1000 被钳到 1000)
8
+ * S2 samples 查询:缺省 bucketMs → 返回 bucketMs=15000 且点为桶聚合(avg);bucketMs=1000 → 桶更细
9
+ * S3 产线 lineQuery(产品/配方/参数/时间/间隔):缺省 → 15s 桶;bucketMs=1000 → 桶数更多
10
+ */
11
+ const BASE = (() => {
12
+ const i = process.argv.indexOf('--base')
13
+ return i > 0 ? process.argv[i + 1] : 'http://127.0.0.1:3001'
14
+ })()
15
+ const TAG = Date.now().toString(36)
16
+
17
+ let failures = 0
18
+ let passed = 0
19
+ const results = []
20
+ const check = (id, name, ok, detail = '') => {
21
+ console.log(` ${ok ? 'PASS' : 'FAIL'} ${id} ${name}${detail ? ` — ${detail}` : ''}`)
22
+ results.push({ id, name, ok, detail })
23
+ ok ? passed++ : failures++
24
+ }
25
+ const sleep = ms => new Promise(r => setTimeout(r, ms))
26
+ const api = async (method, path, { body, token } = {}) => {
27
+ const res = await fetch(`${BASE}${path}`, {
28
+ method,
29
+ headers: { 'content-type': 'application/json', ...(token ? { authorization: `Bearer ${token}` } : {}) },
30
+ body: body !== undefined ? JSON.stringify(body) : undefined,
31
+ })
32
+ return { status: res.status, ...(await res.json().catch(() => ({}))) }
33
+ }
34
+
35
+ async function main() {
36
+ console.log(`\n━━━ 采样/查询间隔 场景测试 @ ${BASE} (tag=${TAG}) ━━━`)
37
+ const reg = await api('POST', '/api/users/register', { body: { email: `itv-${TAG}@test.local`, password: 'Passw0rd!123', name: `itv-${TAG}` } })
38
+ const token = reg.data?.token
39
+ if (!token) throw new Error(`注册失败: ${JSON.stringify(reg).slice(0, 160)}`)
40
+
41
+ const line = (await api('POST', '/api/workshop/dcw/lines', { body: { name: `间隔产线-${TAG}` }, token })).data?.line
42
+ const mk = async (intervalMs) => (await api('POST', '/api/workshop/daq', {
43
+ body: { templateRef: 'daq-temp-tc', name: `间隔${intervalMs ?? '默认'}-${TAG}`, driver: 'mock', lineId: line.id, intervalMs, publishIntervalMs: 0 }, token,
44
+ })).data?.node
45
+ const nA = await mk(1000)
46
+ const nB = await mk(5000)
47
+ const nC = await mk(7000)
48
+ // 下限钳制:创建时传 250ms → 服务端收敛为 1000
49
+ const nMin = (await api('POST', '/api/workshop/daq', {
50
+ body: { templateRef: 'daq-temp-tc', name: `下限钳制-${TAG}`, driver: 'mock', lineId: line.id, intervalMs: 250, publishIntervalMs: 0 }, token,
51
+ })).data?.node
52
+ check('S0', '四节点创建(1s/5s/7s/下限钳制)', Boolean(nA?.id && nB?.id && nC?.id && nMin?.id))
53
+ check('S0.1', '创建下限钳制(250ms → 1000)', nMin?.intervalMs === 1000, `intervalMs=${nMin?.intervalMs}`)
54
+
55
+ const dw = (await api('POST', '/api/workshop/dcw', { body: { templateRef: 'dcw-temp-sp', name: `间隔参数-${TAG}`, driver: 'mock', lineId: line.id }, token })).data?.node
56
+ const prod = (await api('POST', '/api/workshop/dcw/products', { body: { name: `间隔产品-${TAG}`, lineId: line.id }, token })).data?.product
57
+ const recipe = (await api('POST', '/api/workshop/dcw/recipes', {
58
+ body: {
59
+ productId: prod.id, name: `间隔配方-${TAG}`,
60
+ params: [{ templateRef: 'dcw-temp-sp', nodeId: dw.id, value: 180, min: 150, max: 200 }],
61
+ daqWindows: [{ nodeId: nA.id, min: 0, max: 260 }],
62
+ }, token,
63
+ })).data?.recipe
64
+ const start = await api('POST', `/api/workshop/dcw/lines/${line.id}/start`, { body: { recipeId: recipe.id }, token })
65
+ check('S0.2', '产线开跑(门控激活)', start.code === 0, start.message ?? '')
66
+
67
+ console.log(' … 60s 采样窗口(三节点独立节拍)…')
68
+ await sleep(60_000)
69
+
70
+ const countOf = async (id) => {
71
+ const s = await api('GET', `/api/workshop/daq/${id}/samples?bucketMs=1000&from=${Date.now() - 70_000}`, { token })
72
+ const pts = s.data?.points ?? []
73
+ return pts.reduce((a, p) => a + Number(p.cnt ?? 1), 0)
74
+ }
75
+ const [cA, cB, cC, cMin] = await Promise.all([countOf(nA.id), countOf(nB.id), countOf(nC.id), countOf(nMin.id)])
76
+ check('S1.1', '1s 节点 60s ≈55-60 样本', cA >= 45 && cA <= 65, `cnt=${cA}`)
77
+ check('S1.2', '5s 节点 60s ≈11-13 样本', cB >= 9 && cB <= 15, `cnt=${cB}`)
78
+ check('S1.3', '7s 节点 60s ≈8-10 样本', cC >= 6 && cC <= 12, `cnt=${cC}`)
79
+ check('S1.4', '三节点节拍独立(A > B > C)', cA > cB && cB > cC, `A=${cA} B=${cB} C=${cC}`)
80
+ check('S1.5', '钳制节点(250→1000)节拍 = 1s 档', Math.abs(cMin - cA) <= 6, `min=${cMin} A=${cA}`)
81
+
82
+ // PATCH 改节拍:运行中把 7s 节点改 1s → 后续样本变密
83
+ const repatch = await api('PATCH', `/api/workshop/daq/${nC.id}`, { body: { intervalMs: 1000 }, token })
84
+ check('S1.6', '运行中 PATCH 改节拍(7s→1s)', repatch.code === 0 && repatch.data?.node?.intervalMs === 1000, `intervalMs=${repatch.data?.node?.intervalMs}`)
85
+ await sleep(8000)
86
+ const cAfter = await api('GET', `/api/workshop/daq/${nC.id}/samples?bucketMs=1000&from=${Date.now() - 7000}`, { token })
87
+ const cAfterPts = cAfter.data?.points ?? []
88
+ const cAfterCnt = cAfterPts.reduce((a, p) => a + Number(p.cnt ?? 1), 0)
89
+ check('S1.7', '改拍后 7s 窗口样本 ≈7-9(原应≈1)', cAfterCnt >= 6, `cnt=${cAfterCnt}`)
90
+
91
+ // S2 samples 查询缺省 bucket
92
+ const qDefault = await api('GET', `/api/workshop/daq/${nB.id}/samples`, { token })
93
+ const dpts = qDefault.data?.points ?? []
94
+ const isBucketShape = dpts.length > 0 && dpts[0].avg !== undefined && dpts[0].cnt !== undefined
95
+ check('S2.1', 'samples 缺省 → bucketMs=15000(15s 桶聚合)', qDefault.data?.bucketMs === 15000 && isBucketShape, `bucketMs=${qDefault.data?.bucketMs} shape=${isBucketShape} pts=${dpts.length}`)
96
+ const q1s = await api('GET', `/api/workshop/daq/${nB.id}/samples?bucketMs=1000`, { token })
97
+ check('S2.2', 'samples bucketMs=1000 → 桶数多于默认', (q1s.data?.points ?? []).length > dpts.length, `1s=${(q1s.data?.points ?? []).length} default=${dpts.length}`)
98
+ const qLow = await api('GET', `/api/workshop/daq/${nB.id}/samples?bucketMs=300`, { token })
99
+ check('S2.3', 'samples bucketMs=300 → 钳到 1000', qLow.data?.bucketMs === 1000, `bucketMs=${qLow.data?.bucketMs}`)
100
+
101
+ // S3 产线 lineQuery(产线数据查询卡后端)
102
+ const lqDefault = await api('GET', `/api/workshop/dcw/line/query?lineId=${line.id}&from=${Date.now() - 70_000}`, { token })
103
+ const lch = lqDefault.data?.channels ?? []
104
+ const lBucketShape = lch.length > 0 && (lch[0].points?.[0]?.avg !== undefined)
105
+ check('S3.1', 'lineQuery 缺省 → 15s 桶聚合', lch.length > 0 && lBucketShape, `channels=${lch.length} bucketShape=${lBucketShape}`)
106
+ const lq1s = await api('GET', `/api/workshop/dcw/line/query?lineId=${line.id}&from=${Date.now() - 70_000}&bucketMs=1000`, { token })
107
+ const l1ch = (lq1s.data?.channels ?? [])[0]?.points?.length ?? 0
108
+ const l0ch = lch[0]?.points?.length ?? 0
109
+ check('S3.2', 'lineQuery bucketMs=1000 → 桶数更多', l1ch > l0ch, `1s=${l1ch} default=${l0ch}`)
110
+ const lqLow = await api('GET', `/api/workshop/dcw/line/query?lineId=${line.id}&bucketMs=500`, { token })
111
+ // 无法直接看生效值;用 1s 桶点数一致性间接验证(钳到 1000 → 与 bucketMs=1000 相同桶数)
112
+ const lLowCh = (lqLow.data?.channels ?? [])[0]?.points?.length ?? 0
113
+ check('S3.3', 'lineQuery bucketMs=500 → 钳到 1000(桶数与 1s 一致)', lLowCh === l1ch, `500→${lLowCh} vs 1000=${l1ch}`)
114
+
115
+ // 清理
116
+ await api('POST', `/api/workshop/dcw/lines/${line.id}/stop`, { token }).catch(() => {})
117
+ for (const n of [nA, nB, nC, nMin]) await api('DELETE', `/api/workshop/daq/${n.id}`, { token }).catch(() => {})
118
+ await api('DELETE', `/api/workshop/dcw/${dw.id}`, { token }).catch(() => {})
119
+ await api('DELETE', `/api/workshop/dcw/lines/${line.id}`, { token }).catch(() => {})
120
+
121
+ console.log(`\n━━━ 间隔场景测试结果: ${passed} passed / ${failures} failed ━━━`)
122
+ if (failures) for (const r of results.filter(x => !x.ok)) console.log(` ${r.id} ${r.name} — ${r.detail}`)
123
+ process.exit(failures === 0 ? 0 : 1)
124
+ }
125
+
126
+ main().catch((err) => { console.error('FATAL', err); process.exit(1) })
@@ -0,0 +1,31 @@
1
+ /**
2
+ * line-spawn 聚焦探针:验证 codex(.cmd shim)经受控包装拉起并可 stdio 通信。
3
+ * 运行:npx tsx --tsconfig .nuxt/tsconfig.server.json scripts/_dbg-line-spawn.ts
4
+ */
5
+ import { spawnLineProcess } from '../server/services/workshop/agents/adapters/line-spawn'
6
+
7
+ async function main(): Promise<void> {
8
+ console.log('── spawn codex --version(.cmd shim 经 cmd.exe 包装)──')
9
+ const child = spawnLineProcess('codex', ['--version'], {})
10
+ let out = ''
11
+ child.stdout?.setEncoding('utf-8')
12
+ child.stdout?.on('data', (d: string) => {
13
+ out += d
14
+ })
15
+ const code = await new Promise<number | null>((resolve) => {
16
+ child.on('exit', c => resolve(c))
17
+ child.on('error', (e) => {
18
+ console.log('spawn error:', e.message)
19
+ resolve(-1)
20
+ })
21
+ })
22
+ console.log('exit=', code, 'stdout=', out.trim())
23
+ if (code !== 0 || !out.includes('codex')) {
24
+ console.log('FAIL')
25
+ process.exit(1)
26
+ }
27
+ console.log('PASS')
28
+ process.exit(0)
29
+ }
30
+
31
+ void main()
@@ -0,0 +1,80 @@
1
+ /**
2
+ * 最小实时探针:单 worker(harness 可选)+ mock lead,注入 requireReply 消息,
3
+ * 全量拉取 AEP 事件(含 error/delta/status),观察引擎回合的真实行为。
4
+ * 运行:node scripts/_dbg-live-engine-probe.mjs codex|dsh|omp
5
+ */
6
+ const BASE = process.env.AW_BASE ?? 'http://127.0.0.1:3000'
7
+ const harness = process.argv[2] ?? 'dsh'
8
+
9
+ const reg = await fetch(`${BASE}/api/workshop/users/register`, {
10
+ method: 'POST', headers: { 'content-type': 'application/json' },
11
+ body: JSON.stringify({ name: `probe-${harness}-${Date.now() % 100000}` }),
12
+ }).then(r => r.json())
13
+ const T = reg?.data?.token
14
+ if (!T) { console.error('注册失败'); process.exit(1) }
15
+ const api = async (method, path, body) => {
16
+ const res = await fetch(`${BASE}${path}`, {
17
+ method, headers: { 'content-type': 'application/json', authorization: `Bearer ${T}` },
18
+ body: body !== undefined ? JSON.stringify(body) : undefined,
19
+ })
20
+ return await res.json().catch(() => ({}))
21
+ }
22
+
23
+ const ch = await api('POST', '/api/workshop/channels', { name: `probe-${harness}`, leadAgent: { name: 'lead', harness: 'mock' } })
24
+ const cid = ch?.data?.channelId
25
+ const w = await api('POST', `/api/workshop/channels/${cid}/agents`, {
26
+ name: `w-${harness}`, harness, role: 'worker',
27
+ config: harness === 'codex' ? { approvalPolicy: 'on-request', sandbox: 'workspace-write' } : {},
28
+ })
29
+ console.log(`channel=${cid} worker=${w?.data?.id} harness=${harness}`)
30
+
31
+ // 事件录制流由首个 WS 订阅触发(无订阅者不落库),故先接 WS 再触发事件
32
+ const { createRequire } = await import('node:module')
33
+ const sleep = (ms) => new Promise(r => setTimeout(r, ms))
34
+ const { WebSocket } = createRequire(import.meta.url)('D:/codes/ABO/AgentWorkShop/node_modules/.pnpm/ws@8.21.3/node_modules/ws')
35
+ const ws = new WebSocket(BASE.replace(/^http/, 'ws') + '/api/workshop/ws')
36
+ ws.on('open', () => ws.send(JSON.stringify({ type: 'sub', channelId: cid, token: T })))
37
+ ws.on('error', (e) => console.log('[ws error]', e.message))
38
+ await sleep(1200)
39
+
40
+ const seen = []
41
+ let lastSeq = 0
42
+ const poll = async () => {
43
+ const res = await api('GET', `/api/workshop/channels/${cid}/events?limit=500`)
44
+ for (const f of (res?.data?.items ?? [])) {
45
+ if (Number(f.seq ?? 0) > lastSeq) {
46
+ lastSeq = Number(f.seq)
47
+ seen.push(f)
48
+ const p = f.payload ?? {}
49
+ if (f.type === 'error') console.log(`[evt] ERROR ${p.code}: ${String(p.message ?? '').slice(0, 200)}`)
50
+ else if (f.type === 'a2a.message') console.log(`[evt] message ${(p.parts ?? []).map(x => x.text ?? '').join('').slice(0, 120)}`)
51
+ else if (f.type === 'agent.status.message') console.log(`[evt] status: ${String(p.text ?? '').slice(0, 140)}`)
52
+ else if (f.type === 'agent.delta') process.stdout.write('.')
53
+ else if (f.type === 'a2a.artifact') console.log(`[evt] artifact: ${(p.artifact?.parts ?? []).map(x => x.text ?? '').join('').slice(0, 260)}`)
54
+ else if (f.type === 'task.status') console.log(`[evt] task ${p.state}`)
55
+ else if (f.type === 'hitl.request') console.log(`[evt] HITL ${p.kind}`)
56
+ }
57
+ }
58
+ }
59
+ const poller = setInterval(() => { void poll().catch(() => {}) }, 1500)
60
+
61
+ const m = await api('POST', `/api/workshop/channels/${cid}/messages`, {
62
+ toAgentId: w?.data?.id, fromLabel: '探针员', requireReply: true,
63
+ text: `兼容性检查:请用一句话说明你的引擎(${harness}),然后原样回复"${harness} 在线"。`,
64
+ })
65
+ console.log('message sent:', m.status, m?.data?.messageId?.slice(0, 8))
66
+
67
+ const deadline = Date.now() + 300_000
68
+ let replied = false
69
+ while (Date.now() < deadline) {
70
+ await new Promise(r => setTimeout(r, 2000))
71
+ await poll()
72
+ replied = seen.some(f => f.type === 'a2a.message' && f.payload?.metadata?.['x-aw-in-reply-to'] === m?.data?.messageId)
73
+ if (replied) break
74
+ }
75
+ clearInterval(poller)
76
+ console.log(replied ? '\n=== 回执已收到 ===' : '\n=== 300s 未收到回执 ===')
77
+ const byType = {}
78
+ for (const f of seen) byType[f.type] = (byType[f.type] ?? 0) + 1
79
+ console.log('帧分布:', JSON.stringify(byType))
80
+ process.exit(0)
@@ -0,0 +1,147 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * MCP 桥探针:验证 aw-mcp-bridge.mjs 的 MCP stdio ↔ HTTP 回程转译(不依赖真实引擎)。
4
+ * 运行:node scripts/_dbg-mcp-bridge-probe.mjs
5
+ */
6
+ import { spawn } from 'node:child_process'
7
+ import { createServer } from 'node:http'
8
+ import { createInterface } from 'node:readline'
9
+ import { randomUUID } from 'node:crypto'
10
+ import { join, dirname } from 'node:path'
11
+ import { fileURLToPath } from 'node:url'
12
+
13
+ const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..')
14
+ const BRIDGE = join(ROOT, 'server', 'harness', 'aw-mcp-bridge.mjs')
15
+ const AGENT_ID = `a-${randomUUID().slice(0, 8)}`
16
+ const TOKEN = `t-${randomUUID()}`
17
+
18
+ let failures = 0
19
+ const check = (name, ok, detail = '') => {
20
+ console.log(` ${ok ? 'PASS' : 'FAIL'} ${name}${detail ? ` — ${detail}` : ''}`)
21
+ if (!ok) failures += 1
22
+ }
23
+
24
+ const seen = { listToken: null, invokeToken: null, invokeBody: null }
25
+
26
+ /** HTTP stub:模拟平台 agent-tools 面 */
27
+ const server = createServer((req, res) => {
28
+ const token = req.headers['x-aw-agent-token']
29
+ if (req.method === 'GET' && req.url?.startsWith('/api/workshop/agent-tools/list')) {
30
+ seen.listToken = token
31
+ if (token !== TOKEN) {
32
+ res.writeHead(401, { 'content-type': 'application/json' })
33
+ res.end(JSON.stringify({ code: 401, message: 'bad token' }))
34
+ return
35
+ }
36
+ res.writeHead(200, { 'content-type': 'application/json' })
37
+ res.end(JSON.stringify({
38
+ code: 0,
39
+ data: {
40
+ tools: [
41
+ { name: 'report_progress', description: 'Report progress', parameters: { type: 'object', properties: { progress: { type: 'number' } }, required: ['progress'] } },
42
+ { name: 'probe_tool', description: 'Probe tool', parameters: { type: 'object', properties: { q: { type: 'string' } } } },
43
+ ],
44
+ },
45
+ }))
46
+ return
47
+ }
48
+ if (req.method === 'POST' && req.url?.startsWith('/api/workshop/agent-tools/invoke')) {
49
+ seen.invokeToken = token
50
+ let body = ''
51
+ req.on('data', (d) => { body += d })
52
+ req.on('end', () => {
53
+ seen.invokeBody = JSON.parse(body || '{}')
54
+ if (token !== TOKEN) {
55
+ res.writeHead(401, { 'content-type': 'application/json' })
56
+ res.end(JSON.stringify({ code: 401, message: 'bad token' }))
57
+ return
58
+ }
59
+ const tool = seen.invokeBody.tool
60
+ res.writeHead(200, { 'content-type': 'application/json' })
61
+ if (tool === 'boom') {
62
+ res.end(JSON.stringify({ code: 0, data: { result: { text: '模拟工具失败', isError: true } } }))
63
+ }
64
+ else {
65
+ res.end(JSON.stringify({ code: 0, data: { result: { text: `OK ${tool} q=${seen.invokeBody.args?.q ?? ''}` } } }))
66
+ }
67
+ })
68
+ return
69
+ }
70
+ res.writeHead(404)
71
+ res.end()
72
+ })
73
+
74
+ await new Promise((resolve) => { server.listen(0, '127.0.0.1', resolve) })
75
+ const port = server.address().port
76
+
77
+ function rpc(child, msg, timeoutMs = 10_000) {
78
+ return new Promise((resolve, reject) => {
79
+ const timer = setTimeout(() => reject(new Error(`RPC 超时: ${msg.method ?? msg.id}`)), timeoutMs)
80
+ const rl = child.rl
81
+ const onLine = (line) => {
82
+ try {
83
+ const frame = JSON.parse(line)
84
+ if (frame.id === msg.id) {
85
+ clearTimeout(timer)
86
+ rl.removeListener('line', onLine)
87
+ resolve(frame)
88
+ }
89
+ }
90
+ catch { /* 忽略非 JSON 行 */ }
91
+ }
92
+ rl.on('line', onLine)
93
+ child.stdin.write(JSON.stringify(msg) + '\n')
94
+ })
95
+ }
96
+
97
+ console.log('━━━ MCP 桥探针(aw-mcp-bridge.mjs)━━━')
98
+ try {
99
+ const proc = spawn(process.execPath, [BRIDGE], {
100
+ env: { ...process.env, AW_BASE_URL: `http://127.0.0.1:${port}`, AW_AGENT_ID: AGENT_ID, AW_AGENT_TOKEN: TOKEN },
101
+ stdio: ['pipe', 'pipe', 'pipe'],
102
+ })
103
+ proc.rl = createInterface({ input: proc.stdout })
104
+ let stderr = ''
105
+ proc.stderr.on('data', (d) => { stderr += d })
106
+
107
+ // 1. initialize
108
+ const init = await rpc(proc, { jsonrpc: '2.0', id: 1, method: 'initialize', params: { protocolVersion: '2024-11-05' } })
109
+ check('initialize 握手', init.result?.serverInfo?.name === 'aw-host-tools', `serverInfo=${JSON.stringify(init.result?.serverInfo)}`)
110
+
111
+ // 2. tools/list(验证 token 头与工具面透传)
112
+ const list = await rpc(proc, { jsonrpc: '2.0', id: 2, method: 'tools/list' })
113
+ const names = (list.result?.tools ?? []).map(t => t.name)
114
+ check('tools/list 携带 agent token', seen.listToken === TOKEN)
115
+ check('tools/list 透传平台工具面', names.includes('report_progress') && names.includes('probe_tool'), `names=${names.join(',')}`)
116
+ const probe = (list.result?.tools ?? []).find(t => t.name === 'probe_tool')
117
+ check('inputSchema = parameters', JSON.stringify(probe?.inputSchema ?? {}).includes('q'))
118
+
119
+ // 3. tools/call 成功路径
120
+ const call = await rpc(proc, { jsonrpc: '2.0', id: 3, method: 'tools/call', params: { name: 'probe_tool', arguments: { q: 'hello' } } })
121
+ check('tools/call 回程 HTTP', seen.invokeBody?.tool === 'probe_tool' && seen.invokeBody?.agentId === AGENT_ID)
122
+ check('tools/call 结果转译', call.result?.content?.[0]?.text === 'OK probe_tool q=hello', `text=${call.result?.content?.[0]?.text}`)
123
+ check('tools/call 携带 agent token', seen.invokeToken === TOKEN)
124
+
125
+ // 4. isError 透传
126
+ const boom = await rpc(proc, { jsonrpc: '2.0', id: 4, method: 'tools/call', params: { name: 'boom', arguments: {} } })
127
+ check('isError 透传', boom.result?.isError === true, `text=${boom.result?.content?.[0]?.text}`)
128
+
129
+ proc.kill('SIGKILL')
130
+ }
131
+ catch (err) {
132
+ check('桥进程往返', false, err.message)
133
+ }
134
+
135
+ // 5. 缺 token → 桥拒绝启动
136
+ const bad = spawn(process.execPath, [BRIDGE], {
137
+ env: { ...process.env, AW_BASE_URL: `http://127.0.0.1:${port}`, AW_AGENT_ID: '', AW_AGENT_TOKEN: '' },
138
+ stdio: ['pipe', 'pipe', 'pipe'],
139
+ })
140
+ let badStderr = ''
141
+ bad.stderr.on('data', (d) => { badStderr += d })
142
+ const badExit = await new Promise((resolve) => { bad.on('exit', (code) => resolve(code)) })
143
+ check('缺 AW_AGENT_ID 拒绝启动', badExit === 1, `exit=${badExit} stderr=${badStderr.trim().slice(0, 80)}`)
144
+
145
+ server.close()
146
+ console.log(failures === 0 ? '\n━━━ 全部通过 ━━━' : `\n━━━ ${failures} 项失败 ━━━`)
147
+ process.exit(failures === 0 ? 0 : 1)
@@ -0,0 +1,101 @@
1
+ /**
2
+ * opencode serve SSE 裸探针:复现 impl 的调用形状,原样打印事件流。
3
+ * 运行:node scripts/_dbg-opencode-sse.mjs
4
+ */
5
+ import { spawn } from 'node:child_process'
6
+ import { randomUUID } from 'node:crypto'
7
+ import { mkdtempSync, copyFileSync, mkdirSync } from 'node:fs'
8
+ import { join, dirname } from 'node:path'
9
+ import { homedir, tmpdir } from 'node:os'
10
+
11
+ const dataDir = mkdtempSync(join(tmpdir(), 'aw-oc-data-'))
12
+ const configDir = mkdtempSync(join(tmpdir(), 'aw-oc-cfg-'))
13
+ mkdirSync(join(dataDir, 'opencode'), { recursive: true })
14
+ try { copyFileSync(join(homedir(), '.local', 'share', 'opencode', 'auth.json'), join(dataDir, 'opencode', 'auth.json')) } catch (e) { console.log('auth copy fail', e.message) }
15
+ console.log('dataDir=', dataDir)
16
+
17
+ const port = 20000 + Math.floor(Math.random() * 20000)
18
+ const pw = randomUUID()
19
+ const child = spawn('opencode', ['serve', '--port', String(port), '--hostname', '127.0.0.1'], {
20
+ env: { ...process.env, OPENCODE_SERVER_PASSWORD: pw, XDG_DATA_HOME: dataDir, XDG_CONFIG_HOME: configDir },
21
+ stdio: ['ignore', 'pipe', 'pipe'], shell: false,
22
+ })
23
+ child.stderr.on('data', (d) => process.stderr.write('[err] ' + d))
24
+
25
+ const auth = { headers: { authorization: `Basic ${Buffer.from(`opencode:${pw}`).toString('base64')}`, 'content-type': 'application/json' } }
26
+
27
+ setTimeout(async () => {
28
+ // 健康探测
29
+ let healthy = false
30
+ for (let i = 0; i < 60; i++) {
31
+ try {
32
+ const r = await fetch(`http://127.0.0.1:${port}/global/health`, { headers: { authorization: auth.headers.authorization }, signal: AbortSignal.timeout(2000) })
33
+ if (r.ok) { healthy = true; break }
34
+ }
35
+ catch {}
36
+ await new Promise(r => setTimeout(r, 500))
37
+ }
38
+ console.log('healthy=', healthy)
39
+ if (!healthy) process.exit(1)
40
+
41
+ // MCP 桥注册(与 impl 同形状)
42
+ const bridge = process.env.AW_BRIDGE_PATH ?? join(process.cwd(), 'server', 'harness', 'aw-mcp-bridge.mjs')
43
+ const mcpRes = await fetch(`http://127.0.0.1:${port}/mcp`, { ...auth, method: 'POST', body: JSON.stringify({
44
+ name: 'aw-host-tools',
45
+ config: { type: 'local', command: [process.execPath, bridge], environment: { AW_BASE_URL: 'http://127.0.0.1:1', AW_AGENT_ID: 'x', AW_AGENT_TOKEN: 'y' } },
46
+ }) })
47
+ console.log('mcp register:', mcpRes.status, (await mcpRes.text()).slice(0, 120))
48
+
49
+ // 建会话(带权限规则)
50
+ const sesRes = await fetch(`http://127.0.0.1:${port}/session`, { ...auth, method: 'POST', body: JSON.stringify({
51
+ title: 'probe',
52
+ permission: [{ permission: 'edit', action: 'ask' }, { permission: 'bash', pattern: '*', action: 'ask' }],
53
+ }) })
54
+ const ses = await sesRes.json()
55
+ console.log('session:', sesRes.status, JSON.stringify(ses).slice(0, 200))
56
+ const sid = ses.id
57
+
58
+ // 事件流
59
+ const es = await fetch(`http://127.0.0.1:${port}/event`, { headers: auth.headers })
60
+ const reader = es.body.getReader()
61
+ const dec = new TextDecoder()
62
+ let buf = ''
63
+ const events = []
64
+ ;(async () => {
65
+ for (;;) {
66
+ const { done, value } = await reader.read()
67
+ if (done) break
68
+ buf += dec.decode(value, { stream: true })
69
+ const parts = buf.split('\n\n'); buf = parts.pop()
70
+ for (const chunk of parts) for (const line of chunk.split('\n')) {
71
+ if (!line.startsWith('data:')) continue
72
+ try { events.push(JSON.parse(line.slice(5))) } catch {}
73
+ }
74
+ }
75
+ })()
76
+
77
+ // 投递
78
+ const pr = await fetch(`http://127.0.0.1:${port}/session/${sid}/prompt_async`, { ...auth, method: 'POST', body: JSON.stringify({
79
+ model: { providerID: 'zhipuai-coding-plan', modelID: 'glm-5.3-flash' },
80
+ parts: [{ type: 'text', text: 'Reply with exactly: OK' }],
81
+ }) })
82
+ console.log('prompt_async:', pr.status)
83
+
84
+ const deadline = Date.now() + 90_000
85
+ while (Date.now() < deadline) {
86
+ await new Promise(r => setTimeout(r, 1500))
87
+ const err = events.find(e => e.type === 'session.error')
88
+ const idle = events.find(e => e.type === 'session.idle')
89
+ if (err || idle) break
90
+ }
91
+ console.log('--- events (deduped by type) ---')
92
+ const seen = new Map()
93
+ for (const e of events) {
94
+ const key = e.type + ':' + (e.properties?.part?.type ?? '')
95
+ if (!seen.has(key)) { seen.set(key, 1); console.log(e.type, JSON.stringify(e.properties ?? {}).slice(0, 260)) }
96
+ else seen.set(key, seen.get(key) + 1)
97
+ }
98
+ for (const [k, n] of seen) if (n > 1) console.log(`(${k} x${n})`)
99
+ child.kill('SIGKILL')
100
+ process.exit(0)
101
+ }, 3000)
@@ -0,0 +1,57 @@
1
+ /**
2
+ * opencode impl 启动聚焦探针:复现 e2e 的 spawn+健康探测路径,逐次打印探测结果。
3
+ * 运行:npx tsx --tsconfig .nuxt/tsconfig.server.json scripts/_dbg-opencode-start.ts
4
+ */
5
+ import { spawn as launchChildProcess } from 'node:child_process'
6
+ import { randomUUID } from 'node:crypto'
7
+ import { createServer } from 'node:net'
8
+
9
+ async function freePort(): Promise<number> {
10
+ return new Promise((resolve, reject) => {
11
+ const srv = createServer()
12
+ srv.unref()
13
+ srv.on('error', reject)
14
+ srv.listen(0, '127.0.0.1', () => {
15
+ const addr = srv.address()
16
+ const port = typeof addr === 'object' && addr ? addr.port : 0
17
+ srv.close(() => (port ? resolve(port) : reject(new Error('无可用端口'))))
18
+ })
19
+ })
20
+ }
21
+
22
+ const port = await freePort()
23
+ const password = randomUUID()
24
+ console.log('port=', port)
25
+ const child = launchChildProcess('opencode', ['serve', '--port', String(port), '--hostname', '127.0.0.1'], {
26
+ cwd: process.cwd(),
27
+ env: { ...process.env, OPENCODE_SERVER_PASSWORD: password },
28
+ windowsHide: true,
29
+ shell: false,
30
+ })
31
+ console.log('pid=', child.pid)
32
+ child.stdout?.on('data', (d: Buffer) => process.stdout.write(`[out] ${d}`))
33
+ child.stderr?.on('data', (d: Buffer) => process.stderr.write(`[err] ${d}`))
34
+ child.on('exit', code => console.log('exit', code))
35
+ child.on('error', err => console.log('spawn error', err.message))
36
+
37
+ const basic = `Basic ${Buffer.from(`opencode:${password}`).toString('base64')}`
38
+ const deadline = Date.now() + 45_000
39
+ let n = 0
40
+ while (Date.now() < deadline) {
41
+ n++
42
+ try {
43
+ const res = await fetch(`http://127.0.0.1:${port}/global/health`, {
44
+ headers: { authorization: basic },
45
+ signal: AbortSignal.timeout(2000),
46
+ })
47
+ const text = await res.text()
48
+ console.log(`attempt ${n}: ${res.status} ${text.slice(0, 80)}`)
49
+ if (res.ok) break
50
+ }
51
+ catch (err) {
52
+ if (n % 10 === 0) console.log(`attempt ${n}: ${(err as Error).message}`)
53
+ }
54
+ await new Promise(r => setTimeout(r, 500))
55
+ }
56
+ child.kill('SIGKILL')
57
+ process.exit(0)