agentworkshop 0.5.9 → 0.6.1

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 (572) hide show
  1. package/.AgentWorkShop/prompts/compaction-hints.md +9 -9
  2. package/.AgentWorkShop/prompts/host-tools.json +42 -0
  3. package/.output/.AgentWorkShop/prompts/compaction-hints.md +9 -9
  4. package/.output/.AgentWorkShop/prompts/host-tools.json +42 -0
  5. package/.output/nitro.json +1 -1
  6. package/.output/public/_nuxt/{Dm5mD6XT.js → BD9D9pl4.js} +1 -1
  7. package/.output/public/_nuxt/{BdKzfJiM.js → BxD8Fg_Z.js} +1 -1
  8. package/.output/public/_nuxt/{dRAyjbJ6.js → C-Y5ydB6.js} +3 -3
  9. package/.output/public/_nuxt/{Bok1DRqh.js → C0FogB-p.js} +1 -1
  10. package/.output/public/_nuxt/{BUNGEK2z.js → C2QSTAWf.js} +1 -1
  11. package/.output/public/_nuxt/{CWDzKGtj.js → CclO6GyL.js} +1 -1
  12. package/.output/public/_nuxt/{B3__nfxM.js → Ck6tznoQ.js} +1 -1
  13. package/.output/public/_nuxt/CwS_UHeH.js +1 -0
  14. package/.output/public/_nuxt/{CE2ynNi9.js → CwcOEM8m.js} +1 -1
  15. package/.output/public/_nuxt/MhK4buEJ.js +1 -0
  16. package/.output/public/_nuxt/_id_.DN3U6EF9.css +1 -0
  17. package/.output/public/_nuxt/builds/latest.json +1 -1
  18. package/.output/public/_nuxt/builds/meta/221de779-a113-4232-b9a1-31a614f5e3c7.json +1 -0
  19. package/.output/public/_nuxt/{entry.DjhxLu-f.css → entry.DvlXlPwx.css} +1 -1
  20. package/.output/public/_nuxt/settings.BG0K9_MG.css +1 -0
  21. package/.output/server/chunks/_/error-500.mjs.map +1 -1
  22. package/.output/server/chunks/_/nitro.mjs +2675 -1425
  23. package/.output/server/chunks/_/nitro.mjs.map +1 -1
  24. package/.output/server/chunks/build/{OmpTerminalPanel-CZnxR3M_.mjs → OmpTerminalPanel-B_SYhmgb.mjs} +2 -2
  25. package/.output/server/chunks/build/{OmpTerminalPanel-CZnxR3M_.mjs.map → OmpTerminalPanel-B_SYhmgb.mjs.map} +1 -1
  26. package/.output/server/chunks/build/{TownView-DYlUNRZe.mjs → TownView-D9yCQe1T.mjs} +6 -6
  27. package/.output/server/chunks/build/{TownView-DYlUNRZe.mjs.map → TownView-D9yCQe1T.mjs.map} +1 -1
  28. package/.output/server/chunks/build/{_id_-BOhG2yz8.mjs → _id_-CmKAEFHV.mjs} +4 -2
  29. package/.output/server/chunks/build/_id_-CmKAEFHV.mjs.map +1 -0
  30. package/.output/server/chunks/build/{_id_-CuyMYmhY.mjs → _id_-xR3AChMO.mjs} +74 -26
  31. package/.output/server/chunks/build/_id_-xR3AChMO.mjs.map +1 -0
  32. package/.output/server/chunks/build/{_wsId_-B5f5BdW2.mjs → _wsId_-C45nVrl-.mjs} +12 -10
  33. package/.output/server/chunks/build/{_wsId_-B5f5BdW2.mjs.map → _wsId_-C45nVrl-.mjs.map} +1 -1
  34. package/.output/server/chunks/build/{agents-BVaxN75W.mjs → agents-D4l1icvn.mjs} +5 -3
  35. package/.output/server/chunks/build/agents-D4l1icvn.mjs.map +1 -0
  36. package/.output/server/chunks/build/{channel-templates-D1K2IKrE.mjs → channel-templates-DqjtC-R0.mjs} +5 -3
  37. package/.output/server/chunks/build/channel-templates-DqjtC-R0.mjs.map +1 -0
  38. package/.output/server/chunks/build/{client-only-CFTHwakk.mjs → client-only-D5BzSQc6.mjs} +2 -2
  39. package/.output/server/chunks/build/client-only-D5BzSQc6.mjs.map +1 -0
  40. package/.output/server/chunks/build/{daq-ObtN1TQ4.mjs → daq-Boz_dlAQ.mjs} +6 -4
  41. package/.output/server/chunks/build/daq-Boz_dlAQ.mjs.map +1 -0
  42. package/.output/server/chunks/build/{dcw-fINr-He1.mjs → dcw-wTRwBAUi.mjs} +3 -1
  43. package/.output/server/chunks/build/dcw-wTRwBAUi.mjs.map +1 -0
  44. package/.output/server/chunks/build/{default-CVVO40Jj.mjs → default-Dt6xLdpd.mjs} +7 -5
  45. package/.output/server/chunks/build/{default-CVVO40Jj.mjs.map → default-Dt6xLdpd.mjs.map} +1 -1
  46. package/.output/server/chunks/build/interval-WlxgjTzO.mjs +9 -0
  47. package/.output/server/chunks/build/interval-WlxgjTzO.mjs.map +1 -0
  48. package/.output/server/chunks/build/{logs-DqNgCJAn.mjs → logs-Cdi-eXlN.mjs} +5 -3
  49. package/.output/server/chunks/build/logs-Cdi-eXlN.mjs.map +1 -0
  50. package/.output/server/chunks/build/{monitor-CTZLwbdw.mjs → monitor-yNoV98rf.mjs} +6 -4
  51. package/.output/server/chunks/build/{monitor-CTZLwbdw.mjs.map → monitor-yNoV98rf.mjs.map} +1 -1
  52. package/.output/server/chunks/build/{pages-DC52d7z7.mjs → pages-bWKy0ZsA.mjs} +6 -4
  53. package/.output/server/chunks/build/pages-bWKy0ZsA.mjs.map +1 -0
  54. package/.output/server/chunks/build/{plugins-DVQty7qG.mjs → plugins-B-ZNey0Z.mjs} +4 -2
  55. package/.output/server/chunks/build/plugins-B-ZNey0Z.mjs.map +1 -0
  56. package/.output/server/chunks/build/{settings-BeergncK.mjs → settings-C3T5hR2A.mjs} +21 -19
  57. package/.output/server/chunks/build/settings-C3T5hR2A.mjs.map +1 -0
  58. package/.output/server/chunks/build/{teams-CFeDlHDh.mjs → teams-QR3BBF7A.mjs} +5 -3
  59. package/.output/server/chunks/build/teams-QR3BBF7A.mjs.map +1 -0
  60. package/.output/server/chunks/build/{tokens-CBAUbOce.mjs → tokens-DFvr_TLj.mjs} +4 -2
  61. package/.output/server/chunks/build/tokens-DFvr_TLj.mjs.map +1 -0
  62. package/.output/server/chunks/build/town-BUqRobze.mjs +2 -0
  63. package/.output/server/chunks/build/town-BUqRobze.mjs.map +1 -1
  64. package/.output/server/chunks/build/{town-BxH-XXth.mjs → town-CKg6Qxba.mjs} +9 -7
  65. package/.output/server/chunks/build/town-CKg6Qxba.mjs.map +1 -0
  66. package/.output/server/chunks/build/{useDaqStream-CwORhsD7.mjs → useDaqStream-zHEptJQ_.mjs} +44 -1
  67. package/.output/server/chunks/build/useDaqStream-zHEptJQ_.mjs.map +1 -0
  68. package/.output/server/chunks/build/{useSiteConfig-Cc-ABesl.mjs → useSiteConfig-DJe_KMVr.mjs} +1 -1
  69. package/.output/server/chunks/build/{useSiteConfig-Cc-ABesl.mjs.map → useSiteConfig-DJe_KMVr.mjs.map} +1 -1
  70. package/.output/server/chunks/build/{useWorkshopApi-5er8_EHZ.mjs → useWorkshopApi-Bh5VUHWu.mjs} +1 -1
  71. package/.output/server/chunks/build/{useWorkshopApi-5er8_EHZ.mjs.map → useWorkshopApi-Bh5VUHWu.mjs.map} +1 -1
  72. package/.output/server/chunks/build/{useWorkshopWs-Dwr_1Q8f.mjs → useWorkshopWs-xcdeiSmJ.mjs} +2 -2
  73. package/.output/server/chunks/build/{useWorkshopWs-Dwr_1Q8f.mjs.map → useWorkshopWs-xcdeiSmJ.mjs.map} +1 -1
  74. package/.output/server/chunks/build/{user-CpVY4OAA.mjs → user-Dk-ytEUV.mjs} +1 -1
  75. package/.output/server/chunks/build/{user-CpVY4OAA.mjs.map → user-Dk-ytEUV.mjs.map} +1 -1
  76. package/.output/server/chunks/build/{users-BMs4s_6K.mjs → users-4FZ0yFUO.mjs} +4 -2
  77. package/.output/server/chunks/build/users-4FZ0yFUO.mjs.map +1 -0
  78. package/.output/server/chunks/build/{workshop-CJAyZ5zS.mjs → workshop-CLhwe5eo.mjs} +6 -4
  79. package/.output/server/chunks/build/workshop-CLhwe5eo.mjs.map +1 -0
  80. package/.output/server/chunks/build/{workspaces-Dq-1zvu9.mjs → workspaces-IfORCDJE.mjs} +2 -2
  81. package/.output/server/chunks/build/{workspaces-Dq-1zvu9.mjs.map → workspaces-IfORCDJE.mjs.map} +1 -1
  82. package/.output/server/chunks/routes/api/health.get.mjs +2 -0
  83. package/.output/server/chunks/routes/api/health.get.mjs.map +1 -1
  84. package/.output/server/chunks/routes/api/index.get.mjs +2 -0
  85. package/.output/server/chunks/routes/api/index.get.mjs.map +1 -1
  86. package/.output/server/chunks/routes/api/index.post.mjs +2 -0
  87. package/.output/server/chunks/routes/api/index.post.mjs.map +1 -1
  88. package/.output/server/chunks/routes/api/mcp/workshop.mjs +2 -0
  89. package/.output/server/chunks/routes/api/mcp/workshop.mjs.map +1 -1
  90. package/.output/server/chunks/routes/api/metrics.mjs +2 -0
  91. package/.output/server/chunks/routes/api/metrics.mjs.map +1 -1
  92. package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs +2 -0
  93. package/.output/server/chunks/routes/api/plugins/_name/_...path_.mjs.map +1 -1
  94. package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs +2 -0
  95. package/.output/server/chunks/routes/api/plugins/client/_name_.get.mjs.map +1 -1
  96. package/.output/server/chunks/routes/api/plugins/manifest.get.mjs +2 -0
  97. package/.output/server/chunks/routes/api/plugins/manifest.get.mjs.map +1 -1
  98. package/.output/server/chunks/routes/api/system/config.get.mjs +2 -0
  99. package/.output/server/chunks/routes/api/system/config.get.mjs.map +1 -1
  100. package/.output/server/chunks/routes/api/system/index.get.mjs +2 -0
  101. package/.output/server/chunks/routes/api/system/index.get.mjs.map +1 -1
  102. package/.output/server/chunks/routes/api/system/index.patch.mjs +2 -0
  103. package/.output/server/chunks/routes/api/system/index.patch.mjs.map +1 -1
  104. package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs +2 -0
  105. package/.output/server/chunks/routes/api/system/monitor/terminal/ws.mjs.map +1 -1
  106. package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs +2 -0
  107. package/.output/server/chunks/routes/api/system/monitor/terminate.post.mjs.map +1 -1
  108. package/.output/server/chunks/routes/api/system/monitor.get.mjs +2 -0
  109. package/.output/server/chunks/routes/api/system/monitor.get.mjs.map +1 -1
  110. package/.output/server/chunks/routes/api/system/settings/events.get.mjs +3 -2
  111. package/.output/server/chunks/routes/api/system/settings/events.get.mjs.map +1 -1
  112. package/.output/server/chunks/routes/api/system/settings/reset.post.mjs +2 -0
  113. package/.output/server/chunks/routes/api/system/settings/reset.post.mjs.map +1 -1
  114. package/.output/server/chunks/routes/api/users/_id_.delete.mjs +2 -0
  115. package/.output/server/chunks/routes/api/users/_id_.delete.mjs.map +1 -1
  116. package/.output/server/chunks/routes/api/users/_id_.get.mjs +2 -0
  117. package/.output/server/chunks/routes/api/users/_id_.get.mjs.map +1 -1
  118. package/.output/server/chunks/routes/api/users/_id_.put.mjs +2 -0
  119. package/.output/server/chunks/routes/api/users/_id_.put.mjs.map +1 -1
  120. package/.output/server/chunks/routes/api/users/index.get.mjs +2 -0
  121. package/.output/server/chunks/routes/api/users/index.get.mjs.map +1 -1
  122. package/.output/server/chunks/routes/api/users/index.post.mjs +2 -0
  123. package/.output/server/chunks/routes/api/users/index.post.mjs.map +1 -1
  124. package/.output/server/chunks/routes/api/users/login.post.mjs +2 -0
  125. package/.output/server/chunks/routes/api/users/login.post.mjs.map +1 -1
  126. package/.output/server/chunks/routes/api/users/logout.post.mjs +2 -0
  127. package/.output/server/chunks/routes/api/users/logout.post.mjs.map +1 -1
  128. package/.output/server/chunks/routes/api/users/me.get.mjs +2 -0
  129. package/.output/server/chunks/routes/api/users/me.get.mjs.map +1 -1
  130. package/.output/server/chunks/routes/api/users/register.post.mjs +2 -0
  131. package/.output/server/chunks/routes/api/users/register.post.mjs.map +1 -1
  132. package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs +2 -0
  133. package/.output/server/chunks/routes/api/users/tokens/_id/token.get.mjs.map +1 -1
  134. package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs +2 -0
  135. package/.output/server/chunks/routes/api/users/tokens/_id_.delete.mjs.map +1 -1
  136. package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs +2 -0
  137. package/.output/server/chunks/routes/api/users/tokens/_id_.patch.mjs.map +1 -1
  138. package/.output/server/chunks/routes/api/workshop/_...path_.mjs +2 -0
  139. package/.output/server/chunks/routes/api/workshop/_...path_.mjs.map +1 -1
  140. package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs +2 -0
  141. package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.get.mjs.map +1 -1
  142. package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs +2 -0
  143. package/.output/server/chunks/routes/api/workshop/a2a/_agentId/index.post.mjs.map +1 -1
  144. package/.output/server/chunks/routes/api/workshop/a2a/send.post.mjs +2 -0
  145. package/.output/server/chunks/routes/api/workshop/a2a/send.post.mjs.map +1 -1
  146. package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs +2 -0
  147. package/.output/server/chunks/routes/api/workshop/agent-tools/approvals/_id/decide.post.mjs.map +1 -1
  148. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs +2 -0
  149. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.delete.mjs.map +1 -1
  150. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs +2 -0
  151. package/.output/server/chunks/routes/api/workshop/agent-tools/bindings/_id_.patch.mjs.map +1 -1
  152. package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs +2 -0
  153. package/.output/server/chunks/routes/api/workshop/agent-tools/index.get.mjs.map +1 -1
  154. package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs +2 -0
  155. package/.output/server/chunks/routes/api/workshop/agent-tools/index.post.mjs.map +1 -1
  156. package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs +2 -0
  157. package/.output/server/chunks/routes/api/workshop/agent-tools/index2.get.mjs.map +1 -1
  158. package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs +2 -0
  159. package/.output/server/chunks/routes/api/workshop/agent-tools/invoke.post.mjs.map +1 -1
  160. package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs +2 -0
  161. package/.output/server/chunks/routes/api/workshop/agents/_id_.delete.mjs.map +1 -1
  162. package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs +2 -0
  163. package/.output/server/chunks/routes/api/workshop/agents/_id_.get.mjs.map +1 -1
  164. package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs +2 -0
  165. package/.output/server/chunks/routes/api/workshop/agents/_id_.patch.mjs.map +1 -1
  166. package/.output/server/chunks/routes/api/workshop/agents/subscribe.post.mjs +2 -0
  167. package/.output/server/chunks/routes/api/workshop/agents/subscribe.post.mjs.map +1 -1
  168. package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs +2 -0
  169. package/.output/server/chunks/routes/api/workshop/approvals/_id/decide.post.mjs.map +1 -1
  170. package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs +2 -0
  171. package/.output/server/chunks/routes/api/workshop/assets/character/_id_.delete.mjs.map +1 -1
  172. package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs +2 -0
  173. package/.output/server/chunks/routes/api/workshop/assets/devices/_id_.delete.mjs.map +1 -1
  174. package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs +2 -0
  175. package/.output/server/chunks/routes/api/workshop/assets/index.get.mjs.map +1 -1
  176. package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs +2 -0
  177. package/.output/server/chunks/routes/api/workshop/assets/index.post.mjs.map +1 -1
  178. package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs +2 -0
  179. package/.output/server/chunks/routes/api/workshop/assets/index2.get.mjs.map +1 -1
  180. package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs +2 -0
  181. package/.output/server/chunks/routes/api/workshop/assets/index2.post.mjs.map +1 -1
  182. package/.output/server/chunks/routes/api/workshop/audit.get.mjs +2 -0
  183. package/.output/server/chunks/routes/api/workshop/audit.get.mjs.map +1 -1
  184. package/.output/server/chunks/routes/api/workshop/caller.mjs +2 -0
  185. package/.output/server/chunks/routes/api/workshop/caller.mjs.map +1 -1
  186. package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +2 -0
  187. package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs.map +1 -1
  188. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.delete.mjs +2 -0
  189. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.delete.mjs.map +1 -1
  190. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs +2 -0
  191. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.get.mjs.map +1 -1
  192. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs +2 -0
  193. package/.output/server/chunks/routes/api/workshop/channel-templates/_id_.patch.mjs.map +1 -1
  194. package/.output/server/chunks/routes/api/workshop/channel-templates/from-channel.post.mjs +2 -0
  195. package/.output/server/chunks/routes/api/workshop/channel-templates/from-channel.post.mjs.map +1 -1
  196. package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs +2 -0
  197. package/.output/server/chunks/routes/api/workshop/channels/_id/activate.post.mjs.map +1 -1
  198. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs +2 -0
  199. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.get.mjs.map +1 -1
  200. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.post.mjs +2 -0
  201. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/index.post.mjs.map +1 -1
  202. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs +2 -0
  203. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/_memoryId_.delete.mjs.map +1 -1
  204. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/search.post.mjs +2 -0
  205. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/memories/search.post.mjs.map +1 -1
  206. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs +2 -0
  207. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/model.patch.mjs.map +1 -1
  208. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs +2 -0
  209. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/position.patch.mjs.map +1 -1
  210. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs +2 -0
  211. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/range.patch.mjs.map +1 -1
  212. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs +2 -0
  213. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId/stop.post.mjs.map +1 -1
  214. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs +2 -0
  215. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.delete.mjs.map +1 -1
  216. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs +2 -0
  217. package/.output/server/chunks/routes/api/workshop/channels/_id/agents/_agentId_.patch.mjs.map +1 -1
  218. package/.output/server/chunks/routes/api/workshop/channels/_id/events.get.mjs +2 -0
  219. package/.output/server/chunks/routes/api/workshop/channels/_id/events.get.mjs.map +1 -1
  220. package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs +2 -0
  221. package/.output/server/chunks/routes/api/workshop/channels/_id/index.get.mjs.map +1 -1
  222. package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs +2 -0
  223. package/.output/server/chunks/routes/api/workshop/channels/_id/index.post.mjs.map +1 -1
  224. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs +2 -0
  225. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.get.mjs.map +1 -1
  226. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs +2 -0
  227. package/.output/server/chunks/routes/api/workshop/channels/_id/index2.post.mjs.map +1 -1
  228. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs +2 -0
  229. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.get.mjs.map +1 -1
  230. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs +2 -0
  231. package/.output/server/chunks/routes/api/workshop/channels/_id/index3.post.mjs.map +1 -1
  232. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs +2 -0
  233. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.get.mjs.map +1 -1
  234. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs +2 -0
  235. package/.output/server/chunks/routes/api/workshop/channels/_id/index4.post.mjs.map +1 -1
  236. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs +2 -0
  237. package/.output/server/chunks/routes/api/workshop/channels/_id/memories/_memoryId_.delete.mjs.map +1 -1
  238. package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs +2 -0
  239. package/.output/server/chunks/routes/api/workshop/channels/_id/queue.get.mjs.map +1 -1
  240. package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs +2 -0
  241. package/.output/server/chunks/routes/api/workshop/channels/_id/terminals.get.mjs.map +1 -1
  242. package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs +2 -0
  243. package/.output/server/chunks/routes/api/workshop/channels/_id_.delete.mjs.map +1 -1
  244. package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs +2 -0
  245. package/.output/server/chunks/routes/api/workshop/channels/index.get.mjs.map +1 -1
  246. package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs +2 -0
  247. package/.output/server/chunks/routes/api/workshop/channels/index.patch.mjs.map +1 -1
  248. package/.output/server/chunks/routes/api/workshop/channels.get.mjs +2 -0
  249. package/.output/server/chunks/routes/api/workshop/channels.get.mjs.map +1 -1
  250. package/.output/server/chunks/routes/api/workshop/channels.post.mjs +2 -0
  251. package/.output/server/chunks/routes/api/workshop/channels.post.mjs.map +1 -1
  252. package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs +2 -0
  253. package/.output/server/chunks/routes/api/workshop/daq/_id/bind.post.mjs.map +1 -1
  254. package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs +36 -0
  255. package/.output/server/chunks/routes/api/workshop/daq/_id/frames/content.get.mjs.map +1 -0
  256. package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs +53 -0
  257. package/.output/server/chunks/routes/api/workshop/daq/_id/frames.get.mjs.map +1 -0
  258. package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs +2 -0
  259. package/.output/server/chunks/routes/api/workshop/daq/_id/samples.get.mjs.map +1 -1
  260. package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs +2 -0
  261. package/.output/server/chunks/routes/api/workshop/daq/_id/test.post.mjs.map +1 -1
  262. package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs +2 -0
  263. package/.output/server/chunks/routes/api/workshop/daq/_id_.delete.mjs.map +1 -1
  264. package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs +2 -0
  265. package/.output/server/chunks/routes/api/workshop/daq/_id_.patch.mjs.map +1 -1
  266. package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs +2 -0
  267. package/.output/server/chunks/routes/api/workshop/daq/alarms/_id/ack.post.mjs.map +1 -1
  268. package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs +2 -0
  269. package/.output/server/chunks/routes/api/workshop/daq/alarms.get.mjs.map +1 -1
  270. package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs +2 -0
  271. package/.output/server/chunks/routes/api/workshop/daq/controller.post.mjs.map +1 -1
  272. package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs +2 -0
  273. package/.output/server/chunks/routes/api/workshop/daq/index.post.mjs.map +1 -1
  274. package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs +2 -0
  275. package/.output/server/chunks/routes/api/workshop/daq/infra/reconnect.post.mjs.map +1 -1
  276. package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs +2 -0
  277. package/.output/server/chunks/routes/api/workshop/daq/infra.get.mjs.map +1 -1
  278. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs +2 -0
  279. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.delete.mjs.map +1 -1
  280. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs +2 -0
  281. package/.output/server/chunks/routes/api/workshop/daq/templates/_key_.patch.mjs.map +1 -1
  282. package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs +2 -0
  283. package/.output/server/chunks/routes/api/workshop/daq/test-driver.post.mjs.map +1 -1
  284. package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs +2 -0
  285. package/.output/server/chunks/routes/api/workshop/dcw/_id/bind.post.mjs.map +1 -1
  286. package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs +2 -0
  287. package/.output/server/chunks/routes/api/workshop/dcw/_id/param-ledger.get.mjs.map +1 -1
  288. package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs +2 -0
  289. package/.output/server/chunks/routes/api/workshop/dcw/_id/test.post.mjs.map +1 -1
  290. package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs +2 -0
  291. package/.output/server/chunks/routes/api/workshop/dcw/_id/write.post.mjs.map +1 -1
  292. package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs +2 -0
  293. package/.output/server/chunks/routes/api/workshop/dcw/_id_.delete.mjs.map +1 -1
  294. package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs +2 -0
  295. package/.output/server/chunks/routes/api/workshop/dcw/_id_.patch.mjs.map +1 -1
  296. package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs +2 -0
  297. package/.output/server/chunks/routes/api/workshop/dcw/controller.post.mjs.map +1 -1
  298. package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs +2 -0
  299. package/.output/server/chunks/routes/api/workshop/dcw/index.get.mjs.map +1 -1
  300. package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs +2 -0
  301. package/.output/server/chunks/routes/api/workshop/dcw/index.post.mjs.map +1 -1
  302. package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs +2 -0
  303. package/.output/server/chunks/routes/api/workshop/dcw/index2.get.mjs.map +1 -1
  304. package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs +2 -0
  305. package/.output/server/chunks/routes/api/workshop/dcw/index2.post.mjs.map +1 -1
  306. package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs +2 -0
  307. package/.output/server/chunks/routes/api/workshop/dcw/index3.get.mjs.map +1 -1
  308. package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs +2 -0
  309. package/.output/server/chunks/routes/api/workshop/dcw/index3.post.mjs.map +1 -1
  310. package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs +2 -0
  311. package/.output/server/chunks/routes/api/workshop/dcw/index4.get.mjs.map +1 -1
  312. package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs +2 -0
  313. package/.output/server/chunks/routes/api/workshop/dcw/index4.post.mjs.map +1 -1
  314. package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs +2 -0
  315. package/.output/server/chunks/routes/api/workshop/dcw/index5.get.mjs.map +1 -1
  316. package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs +2 -0
  317. package/.output/server/chunks/routes/api/workshop/dcw/journal/node/_nodeId/rollback.post.mjs.map +1 -1
  318. package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs +2 -0
  319. package/.output/server/chunks/routes/api/workshop/dcw/line/query.get.mjs.map +1 -1
  320. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs +2 -0
  321. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/start.post.mjs.map +1 -1
  322. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs +2 -0
  323. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id/stop.post.mjs.map +1 -1
  324. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs +2 -0
  325. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.delete.mjs.map +1 -1
  326. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs +2 -0
  327. package/.output/server/chunks/routes/api/workshop/dcw/lines/_id_.patch.mjs.map +1 -1
  328. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs +2 -0
  329. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/judge.post.mjs.map +1 -1
  330. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs +2 -0
  331. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/rollback.post.mjs.map +1 -1
  332. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs +2 -0
  333. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id/series.get.mjs.map +1 -1
  334. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs +2 -0
  335. package/.output/server/chunks/routes/api/workshop/dcw/optimizations/_id_.get.mjs.map +1 -1
  336. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs +2 -0
  337. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.delete.mjs.map +1 -1
  338. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs +2 -0
  339. package/.output/server/chunks/routes/api/workshop/dcw/products/_id_.patch.mjs.map +1 -1
  340. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs +2 -0
  341. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/apply.post.mjs.map +1 -1
  342. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs +2 -0
  343. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/mark-good.post.mjs.map +1 -1
  344. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs +2 -0
  345. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id/rollback-good.post.mjs.map +1 -1
  346. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs +2 -0
  347. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.delete.mjs.map +1 -1
  348. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.patch.mjs +2 -0
  349. package/.output/server/chunks/routes/api/workshop/dcw/recipes/_id_.patch.mjs.map +1 -1
  350. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs +2 -0
  351. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/close.post.mjs.map +1 -1
  352. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs +2 -0
  353. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/data.get.mjs.map +1 -1
  354. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs +2 -0
  355. package/.output/server/chunks/routes/api/workshop/dcw/runs/_id/rollback.post.mjs.map +1 -1
  356. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs +2 -0
  357. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.delete.mjs.map +1 -1
  358. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs +2 -0
  359. package/.output/server/chunks/routes/api/workshop/dcw/templates/_key_.patch.mjs.map +1 -1
  360. package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs +2 -0
  361. package/.output/server/chunks/routes/api/workshop/dcw/test-driver.post.mjs.map +1 -1
  362. package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs +2 -0
  363. package/.output/server/chunks/routes/api/workshop/device-twins/_id/control.post.mjs.map +1 -1
  364. package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs +2 -0
  365. package/.output/server/chunks/routes/api/workshop/device-twins/_id/telemetry.post.mjs.map +1 -1
  366. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs +2 -0
  367. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.delete.mjs.map +1 -1
  368. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs +2 -0
  369. package/.output/server/chunks/routes/api/workshop/device-twins/_id_.patch.mjs.map +1 -1
  370. package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs +2 -0
  371. package/.output/server/chunks/routes/api/workshop/fs/dirs.get.mjs.map +1 -1
  372. package/.output/server/chunks/routes/api/workshop/index.get.mjs +2 -0
  373. package/.output/server/chunks/routes/api/workshop/index.get.mjs.map +1 -1
  374. package/.output/server/chunks/routes/api/workshop/index.post.mjs +2 -0
  375. package/.output/server/chunks/routes/api/workshop/index.post.mjs.map +1 -1
  376. package/.output/server/chunks/routes/api/workshop/index10.get.mjs +2 -0
  377. package/.output/server/chunks/routes/api/workshop/index10.get.mjs.map +1 -1
  378. package/.output/server/chunks/routes/api/workshop/index2.get.mjs +2 -0
  379. package/.output/server/chunks/routes/api/workshop/index2.get.mjs.map +1 -1
  380. package/.output/server/chunks/routes/api/workshop/index2.post.mjs +2 -0
  381. package/.output/server/chunks/routes/api/workshop/index2.post.mjs.map +1 -1
  382. package/.output/server/chunks/routes/api/workshop/index3.get.mjs +2 -0
  383. package/.output/server/chunks/routes/api/workshop/index3.get.mjs.map +1 -1
  384. package/.output/server/chunks/routes/api/workshop/index3.post.mjs +2 -0
  385. package/.output/server/chunks/routes/api/workshop/index3.post.mjs.map +1 -1
  386. package/.output/server/chunks/routes/api/workshop/index4.get.mjs +2 -0
  387. package/.output/server/chunks/routes/api/workshop/index4.get.mjs.map +1 -1
  388. package/.output/server/chunks/routes/api/workshop/index4.post.mjs +2 -0
  389. package/.output/server/chunks/routes/api/workshop/index4.post.mjs.map +1 -1
  390. package/.output/server/chunks/routes/api/workshop/index5.get.mjs +2 -0
  391. package/.output/server/chunks/routes/api/workshop/index5.get.mjs.map +1 -1
  392. package/.output/server/chunks/routes/api/workshop/index5.post.mjs +2 -0
  393. package/.output/server/chunks/routes/api/workshop/index5.post.mjs.map +1 -1
  394. package/.output/server/chunks/routes/api/workshop/index6.get.mjs +2 -0
  395. package/.output/server/chunks/routes/api/workshop/index6.get.mjs.map +1 -1
  396. package/.output/server/chunks/routes/api/workshop/index6.post.mjs +2 -0
  397. package/.output/server/chunks/routes/api/workshop/index6.post.mjs.map +1 -1
  398. package/.output/server/chunks/routes/api/workshop/index7.get.mjs +2 -0
  399. package/.output/server/chunks/routes/api/workshop/index7.get.mjs.map +1 -1
  400. package/.output/server/chunks/routes/api/workshop/index7.post.mjs +2 -0
  401. package/.output/server/chunks/routes/api/workshop/index7.post.mjs.map +1 -1
  402. package/.output/server/chunks/routes/api/workshop/index8.get.mjs +2 -0
  403. package/.output/server/chunks/routes/api/workshop/index8.get.mjs.map +1 -1
  404. package/.output/server/chunks/routes/api/workshop/index8.post.mjs +2 -0
  405. package/.output/server/chunks/routes/api/workshop/index8.post.mjs.map +1 -1
  406. package/.output/server/chunks/routes/api/workshop/index9.get.mjs +2 -0
  407. package/.output/server/chunks/routes/api/workshop/index9.get.mjs.map +1 -1
  408. package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs +2 -0
  409. package/.output/server/chunks/routes/api/workshop/mailbox/all.get.mjs.map +1 -1
  410. package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs +2 -0
  411. package/.output/server/chunks/routes/api/workshop/mailbox.get.mjs.map +1 -1
  412. package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs +2 -0
  413. package/.output/server/chunks/routes/api/workshop/memories/maintenance.post.mjs.map +1 -1
  414. package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +2 -0
  415. package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs.map +1 -1
  416. package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +2 -0
  417. package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs.map +1 -1
  418. package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs +2 -0
  419. package/.output/server/chunks/routes/api/workshop/plugins/index.get.mjs.map +1 -1
  420. package/.output/server/chunks/routes/api/workshop/runtime.get.mjs +2 -0
  421. package/.output/server/chunks/routes/api/workshop/runtime.get.mjs.map +1 -1
  422. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +2 -0
  423. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs.map +1 -1
  424. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +2 -0
  425. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs.map +1 -1
  426. package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs +2 -0
  427. package/.output/server/chunks/routes/api/workshop/scene/layouts.get.mjs.map +1 -1
  428. package/.output/server/chunks/routes/api/workshop/tasks/_id/complete.post.mjs +2 -0
  429. package/.output/server/chunks/routes/api/workshop/tasks/_id/complete.post.mjs.map +1 -1
  430. package/.output/server/chunks/routes/api/workshop/tasks/_id/dispatch.post.mjs +2 -0
  431. package/.output/server/chunks/routes/api/workshop/tasks/_id/dispatch.post.mjs.map +1 -1
  432. package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs +2 -0
  433. package/.output/server/chunks/routes/api/workshop/tasks/_id/index.post.mjs.map +1 -1
  434. package/.output/server/chunks/routes/api/workshop/tasks/_id/report.post.mjs +2 -0
  435. package/.output/server/chunks/routes/api/workshop/tasks/_id/report.post.mjs.map +1 -1
  436. package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs +2 -0
  437. package/.output/server/chunks/routes/api/workshop/tasks/_id/retry.post.mjs.map +1 -1
  438. package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs +2 -0
  439. package/.output/server/chunks/routes/api/workshop/tasks/_id_.get.mjs.map +1 -1
  440. package/.output/server/chunks/routes/api/workshop/tasks.get.mjs +2 -0
  441. package/.output/server/chunks/routes/api/workshop/tasks.get.mjs.map +1 -1
  442. package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs +2 -0
  443. package/.output/server/chunks/routes/api/workshop/teams/_id/deploy.post.mjs.map +1 -1
  444. package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs +2 -0
  445. package/.output/server/chunks/routes/api/workshop/teams/_id/index.get.mjs.map +1 -1
  446. package/.output/server/chunks/routes/api/workshop/teams/_id/index.post.mjs +2 -0
  447. package/.output/server/chunks/routes/api/workshop/teams/_id/index.post.mjs.map +1 -1
  448. package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs +2 -0
  449. package/.output/server/chunks/routes/api/workshop/teams/_id/members/_agentId_.delete.mjs.map +1 -1
  450. package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs +2 -0
  451. package/.output/server/chunks/routes/api/workshop/teams/_id_.delete.mjs.map +1 -1
  452. package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs +2 -0
  453. package/.output/server/chunks/routes/api/workshop/teams/_id_.get.mjs.map +1 -1
  454. package/.output/server/chunks/routes/api/workshop/teams/_id_.patch.mjs +2 -0
  455. package/.output/server/chunks/routes/api/workshop/teams/_id_.patch.mjs.map +1 -1
  456. package/.output/server/chunks/routes/api/workshop/users/me.get.mjs +2 -0
  457. package/.output/server/chunks/routes/api/workshop/users/me.get.mjs.map +1 -1
  458. package/.output/server/chunks/routes/api/workshop/users/register.post.mjs +2 -0
  459. package/.output/server/chunks/routes/api/workshop/users/register.post.mjs.map +1 -1
  460. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +2 -0
  461. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs.map +1 -1
  462. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.delete.mjs +2 -0
  463. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.delete.mjs.map +1 -1
  464. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs +2 -0
  465. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channels/_channelId_.post.mjs.map +1 -1
  466. package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs +2 -0
  467. package/.output/server/chunks/routes/api/workshop/workspaces/index.delete.mjs.map +1 -1
  468. package/.output/server/chunks/routes/renderer.mjs +1 -1
  469. package/.output/server/chunks/routes/renderer.mjs.map +1 -1
  470. package/.output/server/chunks/virtual/entry.mjs +166 -114
  471. package/.output/server/chunks/virtual/entry.mjs.map +1 -1
  472. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  473. package/.output/server/index.mjs +2 -0
  474. package/.output/server/index.mjs.map +1 -1
  475. package/.output/server/package.json +1 -1
  476. package/app/composables/workshop/useDaqStream.ts +59 -1
  477. package/app/config/schema.ts +8 -0
  478. package/app/pages/daq/[id].vue +141 -1
  479. package/app/pages/settings.vue +10 -5
  480. package/app/plugins/runtime-config.client.ts +65 -65
  481. package/app/stores/runtime-config.ts +212 -212
  482. package/config.yml +77 -70
  483. package/docker-compose.yml +19 -2
  484. package/docs/plugins.md +271 -197
  485. package/i18n/dicts/_en.json +7 -2
  486. package/i18n/dicts/daqDetail.json +8 -2
  487. package/i18n/locales/en.ts +55 -29
  488. package/i18n/locales/zh-CN.ts +55 -29
  489. package/nuxt.config.ts +1 -1
  490. package/package.json +144 -143
  491. package/scripts/_dbg-collab-scenario-e2e.mjs +185 -0
  492. package/scripts/_dbg-daq-frame-alarm.mjs +49 -0
  493. package/scripts/_dbg-daq-frame-ui.mjs +62 -0
  494. package/scripts/_dbg-daq-frame-ws.mjs +72 -0
  495. package/scripts/_dbg-daq-frames-e2e.mjs +118 -0
  496. package/scripts/_dbg-host.mjs +16 -0
  497. package/scripts/_dbg-plugin-agent-read.ts +56 -0
  498. package/scripts/_dbg-plugin-sink-rest.mjs +70 -0
  499. package/scripts/_dbg-plugin-sink-ui.mjs +81 -0
  500. package/scripts/_dbg-plugin-tools-inject.ts +80 -0
  501. package/scripts/_dbg-plugin-verify-e2e.mjs +123 -0
  502. package/scripts/_dbg-prompts-hotreload-test.ts +76 -0
  503. package/scripts/_dbg-release-smoke.mjs +104 -0
  504. package/scripts/i18n-merge.mjs +69 -67
  505. package/scripts/test-context-governor.ts +176 -176
  506. package/scripts/test-daq-frames.ts +180 -0
  507. package/scripts/test-daq-minio.ts +77 -0
  508. package/scripts/test-memory-rrf-mmr.ts +114 -114
  509. package/scripts/test-plugin-ext.ts +173 -0
  510. package/server/api/system/settings/events.get.ts +27 -28
  511. package/server/api/system/settings/index.get.ts +14 -14
  512. package/server/api/system/settings/index.patch.ts +22 -22
  513. package/server/api/system/settings/reset.post.ts +12 -12
  514. package/server/api/workshop/daq/[id]/frames/content.get.ts +24 -0
  515. package/server/api/workshop/daq/[id]/frames.get.ts +44 -0
  516. package/server/data/daqs.json +113 -89
  517. package/server/data/dcw-rollback.json +1 -1
  518. package/server/data/dcw-runs.json +3207 -2517
  519. package/server/data/dcw-writes.json +720 -0
  520. package/server/data/dcws.json +4 -4
  521. package/server/data/line-runs.json +1 -232
  522. package/server/plugins/daq.ts +11 -0
  523. package/server/plugins/system-config.ts +38 -38
  524. package/server/services/system-config.ts +365 -356
  525. package/server/services/workshop/agents/industrial-tools.ts +91 -25
  526. package/server/services/workshop/agents/omp-agent.ts +1955 -1895
  527. package/server/services/workshop/agents/plugin-tools.ts +145 -0
  528. package/server/services/workshop/daq/bus/queue-port.ts +18 -0
  529. package/server/services/workshop/daq/daq-controller.ts +216 -14
  530. package/server/services/workshop/daq/daq-node.ts +257 -247
  531. package/server/services/workshop/daq/daq-runtime.ts +36 -4
  532. package/server/services/workshop/daq/daq-templates.ts +213 -157
  533. package/server/services/workshop/daq/drivers.ts +134 -30
  534. package/server/services/workshop/daq/frames.ts +227 -0
  535. package/server/services/workshop/daq/infra.ts +31 -17
  536. package/server/services/workshop/daq/objectstore/disk.adapter.ts +38 -0
  537. package/server/services/workshop/daq/objectstore/index.ts +88 -0
  538. package/server/services/workshop/daq/objectstore/minio.adapter.ts +60 -0
  539. package/server/services/workshop/daq/objectstore/objectstore-port.ts +27 -0
  540. package/server/services/workshop/daq/plugin-bridge.ts +73 -0
  541. package/server/services/workshop/daq/png-enc.ts +71 -0
  542. package/server/services/workshop/daq/storage/sqlite.adapter.ts +104 -1
  543. package/server/services/workshop/daq/storage/timescale.adapter.ts +95 -4
  544. package/server/services/workshop/daq/storage/tsdb-port.ts +46 -0
  545. package/server/services/workshop/plugins/host.mjs +479 -417
  546. package/server/services/workshop/runtime/agent-runtime.ts +744 -744
  547. package/shared/config/schema.json +6 -1
  548. package/shared/daq-protocol.ts +88 -0
  549. package/.output/public/_nuxt/B-PgoIPN.js +0 -1
  550. package/.output/public/_nuxt/DVNYfGsj.js +0 -1
  551. package/.output/public/_nuxt/_id_.CbiF5PrV.css +0 -1
  552. package/.output/public/_nuxt/builds/meta/6f7e40bf-a960-4f51-8a2e-bb1fffeaa5e8.json +0 -1
  553. package/.output/public/_nuxt/settings.BANibAnV.css +0 -1
  554. package/.output/server/chunks/build/_id_-BOhG2yz8.mjs.map +0 -1
  555. package/.output/server/chunks/build/_id_-CuyMYmhY.mjs.map +0 -1
  556. package/.output/server/chunks/build/agents-BVaxN75W.mjs.map +0 -1
  557. package/.output/server/chunks/build/channel-templates-D1K2IKrE.mjs.map +0 -1
  558. package/.output/server/chunks/build/client-only-CFTHwakk.mjs.map +0 -1
  559. package/.output/server/chunks/build/daq-ObtN1TQ4.mjs.map +0 -1
  560. package/.output/server/chunks/build/dcw-fINr-He1.mjs.map +0 -1
  561. package/.output/server/chunks/build/interval-Bt11uRPw.mjs +0 -9
  562. package/.output/server/chunks/build/interval-Bt11uRPw.mjs.map +0 -1
  563. package/.output/server/chunks/build/logs-DqNgCJAn.mjs.map +0 -1
  564. package/.output/server/chunks/build/pages-DC52d7z7.mjs.map +0 -1
  565. package/.output/server/chunks/build/plugins-DVQty7qG.mjs.map +0 -1
  566. package/.output/server/chunks/build/settings-BeergncK.mjs.map +0 -1
  567. package/.output/server/chunks/build/teams-CFeDlHDh.mjs.map +0 -1
  568. package/.output/server/chunks/build/tokens-CBAUbOce.mjs.map +0 -1
  569. package/.output/server/chunks/build/town-BxH-XXth.mjs.map +0 -1
  570. package/.output/server/chunks/build/useDaqStream-CwORhsD7.mjs.map +0 -1
  571. package/.output/server/chunks/build/users-BMs4s_6K.mjs.map +0 -1
  572. package/.output/server/chunks/build/workshop-CJAyZ5zS.mjs.map +0 -1
@@ -1,417 +1,479 @@
1
- // ============================================================
2
- // AgentWorkShop 插件宿主 —— 发现 / 装载 / 启停状态 / 热重载 / 路由表
3
- // ------------------------------------------------------------
4
- // 目录(与 aw commands 同哲学):
5
- // project: <repo>/.AgentWorkShop/plugins/<name>/index.mjs
6
- // user: ~/.AgentWorkShop/plugins/<name>/index.mjs(同名 project 优先)
7
- // 契约:入口导出普通对象 { name, version?, description?, setup(ctx)?,
8
- // client?: './client.mjs', routes?: [{method,path,handler}] }
9
- // —— ctx 由宿主注入,插件运行时零导入依赖(sdk/ 供类型与显式糖)。
10
- //
11
- // 启停状态机:配置根 plugins-state.json { version, updatedAt, disabled: string[] }
12
- // · 装载时跳过 disabled 插件(manifest 仍可见,enabled:false)
13
- // · 状态文件变化(fs.watch)→ 热重载:全部 dispose/解绑 → 重新装载
14
- // · CLI(aw plugin enable/disable) 与 Web 设置页均只写状态文件,服务自感知
15
- // 错误隔离:单插件装载/执行失败记入 failures,绝不拖垮主服务。
16
- // ============================================================
17
- import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, watch, writeFileSync } from 'node:fs'
18
- import { dirname, join, resolve } from 'node:path'
19
- import { pathToFileURL } from 'node:url'
20
- import { HookBus, createPluginContext, createRouteTable, validatePluginModule } from '@/sdk/index.mjs'
21
-
22
- const g = globalThis
23
-
24
- function log() {
25
- return {
26
- debug: (...a) => console.log('[aw-plugins][debug]', ...a),
27
- info: (...a) => console.log('[aw-plugins]', ...a),
28
- warn: (...a) => console.warn('[aw-plugins]', ...a),
29
- error: (...a) => console.error('[aw-plugins]', ...a),
30
- }
31
- }
32
-
33
- function defaultHome() {
34
- const home = process.env.HOME ?? process.env.USERPROFILE ?? ''
35
- return join(home, '.AgentWorkShop')
36
- }
37
-
38
- /** 运行模式路径(cwd 为检出根时启用 project 作用域) */
39
- function modePaths(cwd) {
40
- const isRepo = existsSync(join(cwd, 'config.yml')) && existsSync(join(cwd, 'nuxt.config.ts'))
41
- return {
42
- projectDir: isRepo ? join(cwd, '.AgentWorkShop', 'plugins') : null,
43
- userDir: join(process.env.AW_HOME && String(process.env.AW_HOME).trim() ? String(process.env.AW_HOME).trim() : defaultHome(), 'plugins'),
44
- homeDir: process.env.AW_HOME && String(process.env.AW_HOME).trim() ? String(process.env.AW_HOME).trim() : defaultHome(),
45
- }
46
- }
47
-
48
- function pathToUrl(p) {
49
- return pathToFileURL(resolve(p)).href
50
- }
51
-
52
- // ---- 启停状态(单一事实源:<配置根>/plugins-state.json;CLI/Web/宿主三方读写) ----
53
- export function statePathFor(homeDir) {
54
- return join(homeDir, 'plugins-state.json')
55
- }
56
-
57
- export function readDisabledSet(homeDir) {
58
- try {
59
- const j = JSON.parse(readFileSync(statePathFor(homeDir), 'utf8'))
60
- return new Set(Array.isArray(j.disabled) ? j.disabled : [])
61
- }
62
- catch {
63
- return new Set()
64
- }
65
- }
66
-
67
- export function writeDisabledSet(homeDir, disabled) {
68
- const p = statePathFor(homeDir)
69
- mkdirSync(dirname(p), { recursive: true })
70
- const tmp = `${p}.${process.pid}.tmp`
71
- writeFileSync(tmp, `${JSON.stringify({ version: 1, updatedAt: new Date().toISOString(), disabled: [...disabled] }, null, 2)}\n`, 'utf8')
72
- renameSync(tmp, p)
73
- }
74
-
75
- /** 发现两个作用域下的插件入口(project 同名覆盖 user) */
76
- export function discoverPluginDirs(cwd = process.cwd()) {
77
- const { projectDir, userDir } = modePaths(cwd)
78
- const out = []
79
- const seen = new Set()
80
- for (const [dir, scope] of [[projectDir, 'project'], [userDir, 'user']]) {
81
- if (!dir || !existsSync(dir)) continue
82
- for (const name of readdirSync(dir)) {
83
- const sub = join(dir, name)
84
- if (!existsSync(join(sub, 'index.mjs'))) continue
85
- if (seen.has(name)) continue
86
- seen.add(name)
87
- out.push({ dir: sub, scope })
88
- }
89
- }
90
- return out.sort((a, b) => a.dir.localeCompare(b.dir))
91
- }
92
-
93
- /**
94
- * 装载插件宿主(idempotent;nitro 启动期调用一次)。
95
- */
96
- export async function initPluginHost({ cwd = process.cwd(), packageRoot } = {}) {
97
- if (g.__awPluginHost) return g.__awPluginHost
98
- const logger = log()
99
- const homeDir = modePaths(cwd).homeDir
100
- const host = {
101
- bus: new HookBus({
102
- name: 'aw-plugins',
103
- onError: (err, meta) => logger.warn(`钩子错误(${meta?.type}):`, err?.message ?? err),
104
- }),
105
- routes: createRouteTable(),
106
- plugins: new Map(),
107
- disposables: new Map(), // name → fn[](ctx.onDispose 登记)
108
- hookOffs: new Map(), // name → off[](ctx.hooks.on 登记;热重载时解绑)
109
- failures: [],
110
- initedAt: null,
111
- cwd,
112
- packageRoot,
113
- logger,
114
- }
115
- g.__awPluginHost = host
116
-
117
- // 有效配置(只读面;引擎/模式解析从运行根动态加载)
118
- let config = null
119
- let settingsPath = null
120
- let paths = { home: homeDir, configRoot: join(cwd, '.AgentWorkShop'), dataDir: join(cwd, '.AgentWorkShop', 'data') }
121
- try {
122
- const homeMod = await import(pathToUrl(join(cwd, 'shared', 'config', 'home.mjs')))
123
- const rm = homeMod.resolveRunMode({ cwd, packageRoot, env: process.env })
124
- const engineRoot = rm.mode === 'repo' ? rm.root : (packageRoot ?? rm.root)
125
- if (engineRoot && existsSync(join(engineRoot, 'shared', 'config', 'engine.mjs'))) {
126
- const engine = await import(pathToUrl(join(engineRoot, 'shared', 'config', 'engine.mjs')))
127
- config = engine.loadEffective({ configPath: rm.configPath, settingsPath: rm.settingsPath, env: process.env })
128
- settingsPath = rm.settingsPath
129
- }
130
- paths = { home: rm.home, configRoot: rm.configRoot, dataDir: rm.dataDir }
131
- host.logger.info(`配置根: ${rm.configRoot} (${rm.mode} 模式)`)
132
- }
133
- catch (err) {
134
- host.logger.warn('配置引擎加载降级(插件 ctx.config 将为空):', err?.message)
135
- }
136
- host.config = config
137
-
138
- // 自环 origin:PORT env(prod:start.mjs 注入 / dev:dev-guard 注入 CLI 显式值)权威;
139
- // nitro listen 钩子兜底回填
140
- const argPort = (() => {
141
- const argv = process.argv
142
- const i = argv.indexOf('--port')
143
- if (i >= 0 && argv[i + 1]) return argv[i + 1]
144
- const eq = argv.find(a => a.startsWith('--port='))
145
- return eq ? eq.slice(7) : null
146
- })()
147
- let selfOrigin = `http://127.0.0.1:${process.env.PORT ?? process.env.NITRO_PORT ?? argPort ?? config?.effective?.['server.dev.port'] ?? 3000}`
148
- host.setSelfOrigin = (port) => {
149
- selfOrigin = `http://127.0.0.1:${port}`
150
- host.logger.info(`自环 origin 就绪: ${selfOrigin}`)
151
- }
152
- host.selfOrigin = () => selfOrigin
153
- host.logger.info(`自环 origin: ${selfOrigin}`)
154
-
155
- await loadAllPlugins(host, { config, settingsPath, paths })
156
- ensureStateWatcher(host)
157
- return host
158
- }
159
-
160
- /** 装载/重载全部插件(跳过 disabled;manifest 仍可见) */
161
- async function loadAllPlugins(host, { config, paths }) {
162
- const homeDir = modePaths(host.cwd).homeDir
163
- const disabled = readDisabledSet(homeDir)
164
- host.disabledSet = disabled
165
-
166
- const entries = discoverPluginDirs(host.cwd)
167
- if (entries.length) host.logger.info(`发现 ${entries.length} 个插件(停用 ${disabled.size}),开始装载 ...`)
168
-
169
- for (const { dir, scope } of entries) {
170
- const entry = join(dir, 'index.mjs')
171
- try {
172
- const mod = await import(pathToUrl(entry))
173
- const check = validatePluginModule(mod, entry)
174
- if (!check.ok) throw new Error(check.error)
175
- const def = check.def
176
-
177
- if (host.plugins.has(def.name)) throw new Error(`插件重名(后装载者跳过): ${def.name}`)
178
- if (disabled.has(def.name)) {
179
- host.plugins.set(def.name, {
180
- name: def.name,
181
- version: String(def.version ?? '0.0.0'),
182
- description: String(def.description ?? ''),
183
- scope,
184
- dir,
185
- entry,
186
- clientPath: def.client ? resolve(dir, def.client) : null,
187
- routes: [],
188
- enabled: false,
189
- error: null,
190
- })
191
- host.logger.info(`⊘ 跳过(已停用) [${scope}] ${def.name}`)
192
- continue
193
- }
194
-
195
- const rec = {
196
- name: def.name,
197
- version: String(def.version ?? '0.0.0'),
198
- description: String(def.description ?? ''),
199
- scope,
200
- dir,
201
- entry,
202
- clientPath: def.client ? resolve(dir, def.client) : null,
203
- routes: [],
204
- enabled: true,
205
- error: null,
206
- }
207
-
208
- const emitter = {
209
- registerRoute: (n, m, p, h) => {
210
- host.routes.register(n, m, p, h)
211
- rec.routes.push({ method: String(m).toUpperCase(), path: p })
212
- },
213
- }
214
- const perPluginDisposables = []
215
- const hookOffs = []
216
- host.disposables.set(def.name, perPluginDisposables)
217
- host.hookOffs.set(def.name, hookOffs)
218
- const scopedHooks = {
219
- on: (t, fn) => {
220
- const off = host.bus.on(t, fn)
221
- hookOffs.push(off)
222
- return off
223
- },
224
- once: (t, fn) => {
225
- const off = host.bus.once(t, fn)
226
- hookOffs.push(off)
227
- return off
228
- },
229
- off: (t, fn) => host.bus.off(t, fn),
230
- emit: (t, p) => host.bus.emit(t, p),
231
- }
232
- const ctx = createPluginContext({
233
- name: def.name,
234
- scope,
235
- dir,
236
- hooks: scopedHooks,
237
- logger: {
238
- debug: (...a) => host.logger.info(`[${def.name}][debug]`, ...a),
239
- info: (...a) => host.logger.info(`[${def.name}]`, ...a),
240
- warn: (...a) => host.logger.warn(`[${def.name}]`, ...a),
241
- error: (...a) => host.logger.error(`[${def.name}]`, ...a),
242
- },
243
- config,
244
- paths,
245
- emitter,
246
- onDispose: (fn) => {
247
- perPluginDisposables.push(fn)
248
- return fn
249
- },
250
- selfOrigin: () => selfOriginRef(host),
251
- })
252
-
253
- for (const r of (Array.isArray(def.routes) ? def.routes : [])) {
254
- emitter.registerRoute(def.name, r.method ?? 'GET', r.path, r.handler)
255
- }
256
- await def.setup?.(ctx)
257
-
258
- host.plugins.set(def.name, rec)
259
- host.logger.info(`✔ 已装载 [${scope}] ${def.name}@${rec.version}${rec.clientPath ? ' (+client)' : ''}`)
260
- }
261
- catch (err) {
262
- host.failures.push({ source: entry, error: err?.message ?? String(err) })
263
- host.logger.error(`装载失败 ${entry}:`, err?.message ?? err)
264
- }
265
- }
266
-
267
- host.initedAt = new Date().toISOString()
268
- await host.bus.emit('plugin:host:init', { plugins: [...host.plugins.keys()], failures: host.failures.length })
269
- host.logger.info(`装载完成: ${host.plugins.size} 个(含停用)/ ${host.failures.length} 失败 / 活跃路由 ${host.routes.size} 条`)
270
- }
271
-
272
- function selfOriginRef(host) {
273
- return host.selfOrigin()
274
- }
275
-
276
- /** 热重载:全部 dispose/解绑 → 重新装载(跳过停用)→ 广播 plugins.reloaded(并发合并) */
277
- export async function reloadPluginHost() {
278
- const host = getPluginHost()
279
- if (!host) return null
280
- if (host.reloadInFlight) return host.reloadInFlight
281
- host.reloadInFlight = doReload(host).finally(() => {
282
- host.reloadInFlight = null
283
- })
284
- return host.reloadInFlight
285
- }
286
-
287
- async function doReload(host) {
288
- host.logger.info('热重载插件宿主 ...')
289
- for (const [name, list] of host.disposables ?? []) {
290
- for (const fn of list.splice(0)) {
291
- try {
292
- await fn()
293
- }
294
- catch (err) {
295
- host.logger.warn(`[${name}] onDispose 失败:`, err?.message)
296
- }
297
- }
298
- }
299
- for (const offs of (host.hookOffs ?? new Map()).values()) {
300
- for (const off of offs.splice(0)) {
301
- try {
302
- off()
303
- }
304
- catch { /* 解绑失败忽略 */ }
305
- }
306
- }
307
- host.plugins.clear()
308
- host.routes = createRouteTable()
309
- host.failures = []
310
- await loadAllPlugins(host, { config: host.config, settingsPath: null, paths: { home: modePaths(host.cwd).homeDir, configRoot: join(host.cwd, '.AgentWorkShop'), dataDir: join(host.cwd, '.AgentWorkShop', 'data') } })
311
- await host.bus.emit('plugins:reloaded', { plugins: pluginManifest() })
312
- try {
313
- const m = await import('@/server/services/workshop/scene-events')
314
- m.broadcastSceneEvent('plugins.reloaded', { plugins: pluginManifest() })
315
- }
316
- catch { /* 广播失败不影响重载 */ }
317
- return host
318
- }
319
-
320
- /** 启停单插件(写状态文件;调用方随后 reloadPluginHost 或由 state watcher 触发) */
321
- export function setPluginEnabled(name, enabled) {
322
- const host = getPluginHost()
323
- const homeDir = modePaths(host?.cwd ?? process.cwd()).homeDir
324
- const set = readDisabledSet(homeDir)
325
- if (enabled) set.delete(name)
326
- else set.add(name)
327
- writeDisabledSet(homeDir, set)
328
- return [...set]
329
- }
330
-
331
- /** 状态文件监视 → 热重载(CLI/Web 只写文件,服务自感知) */
332
- function ensureStateWatcher(host) {
333
- const statePath = statePathFor(modePaths(host.cwd).homeDir)
334
- try {
335
- mkdirSync(dirname(statePath), { recursive: true })
336
- if (!existsSync(statePath)) writeDisabledSet(modePaths(host.cwd).homeDir, new Set())
337
- let debounce = null
338
- watch(statePath, () => {
339
- clearTimeout(debounce)
340
- debounce = setTimeout(() => {
341
- void reloadPluginHost()
342
- }, 400)
343
- })
344
- }
345
- catch (err) {
346
- host.logger.warn('状态文件监视不可用(启停需手动重启):', err?.message)
347
- }
348
- }
349
-
350
- /** 单例访问(未初始化返回 null —— 桥接点据此快速 no-op) */
351
- export function getPluginHost() {
352
- return g.__awPluginHost ?? null
353
- }
354
-
355
- /** scene-events 桥:全部无频道实时事件 → 插件 event:<type> */
356
- export function emitPluginEvent(type, payload) {
357
- void g.__awPluginHost?.bus.emit(`event:${type}`, payload)
358
- }
359
-
360
- /** DAQ 下发级采样钩子(与 WS daq.reading 同点、同节拍语义) */
361
- export function emitDaqSample(payload) {
362
- void g.__awPluginHost?.bus.emit('daq:sample', payload)
363
- }
364
-
365
- /** 写控 ACK 后观察钩子 */
366
- export function emitDcwWrite(payload) {
367
- void g.__awPluginHost?.bus.emit('dcw:write', payload)
368
- }
369
-
370
- /** 产线启停钩子 */
371
- export function emitLineLifecycle(kind, payload) {
372
- void g.__awPluginHost?.bus.emit(kind, payload)
373
- }
374
-
375
- /** 客户端脚本读取(免鉴权只读端点用;越界路径拒绝) */
376
- export function readClientScript(name) {
377
- const host = getPluginHost()
378
- const rec = host?.plugins.get(name)
379
- if (!host || !rec) return { status: 404 }
380
- if (!rec.clientPath || !existsSync(rec.clientPath)) return { status: 404 }
381
- if (!resolve(rec.clientPath).startsWith(resolve(rec.dir))) return { status: 400 }
382
- return { status: 200, code: readFileSync(rec.clientPath, 'utf8'), contentType: 'text/javascript; charset=utf-8' }
383
- }
384
-
385
- /** 清单(非敏感只读;含启停状态与路由) */
386
- export function pluginManifest() {
387
- const host = getPluginHost()
388
- if (!host) return []
389
- return [...host.plugins.values()].map(r => ({
390
- name: r.name,
391
- version: r.version,
392
- description: r.description,
393
- scope: r.scope,
394
- enabled: r.enabled !== false,
395
- hasClient: Boolean(r.clientPath),
396
- routes: host.routes.byPlugin(r.name),
397
- error: r.error,
398
- }))
399
- }
400
-
401
- /** 关机钩子(nitro close 时调用):先逐插件回收订阅/定时器,再广播 server:close */
402
- export async function shutdownPluginHost() {
403
- const host = getPluginHost()
404
- if (!host) return
405
- for (const [name, list] of host.disposables ?? []) {
406
- for (const fn of list.splice(0)) {
407
- try {
408
- await fn()
409
- }
410
- catch (err) {
411
- host.logger.warn(`[${name}] onDispose 失败:`, err?.message)
412
- }
413
- }
414
- }
415
- await host.bus.emit('server:close', { at: new Date().toISOString() })
416
- host.logger.info('插件清理完成,已发出 server:close')
417
- }
1
+ // ============================================================
2
+ // AgentWorkShop 插件宿主 —— 发现 / 装载 / 启停状态 / 热重载 / 路由表
3
+ // ------------------------------------------------------------
4
+ // 目录(与 aw commands 同哲学):
5
+ // project: <repo>/.AgentWorkShop/plugins/<name>/index.mjs
6
+ // user: ~/.AgentWorkShop/plugins/<name>/index.mjs(同名 project 优先)
7
+ // 契约:入口导出普通对象 { name, version?, description?, setup(ctx)?,
8
+ // client?: './client.mjs', routes?: [{method,path,handler}] }
9
+ // —— ctx 由宿主注入,插件运行时零导入依赖(sdk/ 供类型与显式糖)。
10
+ //
11
+ // 启停状态机:配置根 plugins-state.json { version, updatedAt, disabled: string[] }
12
+ // · 装载时跳过 disabled 插件(manifest 仍可见,enabled:false)
13
+ // · 状态文件变化(fs.watch)→ 热重载:全部 dispose/解绑 → 重新装载
14
+ // · CLI(aw plugin enable/disable) 与 Web 设置页均只写状态文件,服务自感知
15
+ // 错误隔离:单插件装载/执行失败记入 failures,绝不拖垮主服务。
16
+ // ============================================================
17
+ import { existsSync, mkdirSync, readdirSync, readFileSync, renameSync, watch, writeFileSync } from 'node:fs'
18
+ import { dirname, join, resolve } from 'node:path'
19
+ import { pathToFileURL } from 'node:url'
20
+ import { HookBus, createPluginContext, createRouteTable, validatePluginModule } from '@/sdk/index.mjs'
21
+
22
+ const g = globalThis
23
+
24
+ function log() {
25
+ return {
26
+ debug: (...a) => console.log('[aw-plugins][debug]', ...a),
27
+ info: (...a) => console.log('[aw-plugins]', ...a),
28
+ warn: (...a) => console.warn('[aw-plugins]', ...a),
29
+ error: (...a) => console.error('[aw-plugins]', ...a),
30
+ }
31
+ }
32
+
33
+ function defaultHome() {
34
+ const home = process.env.HOME ?? process.env.USERPROFILE ?? ''
35
+ return join(home, '.AgentWorkShop')
36
+ }
37
+
38
+ /** 运行模式路径(cwd 为检出根时启用 project 作用域) */
39
+ function modePaths(cwd) {
40
+ const isRepo = existsSync(join(cwd, 'config.yml')) && existsSync(join(cwd, 'nuxt.config.ts'))
41
+ return {
42
+ projectDir: isRepo ? join(cwd, '.AgentWorkShop', 'plugins') : null,
43
+ userDir: join(process.env.AW_HOME && String(process.env.AW_HOME).trim() ? String(process.env.AW_HOME).trim() : defaultHome(), 'plugins'),
44
+ homeDir: process.env.AW_HOME && String(process.env.AW_HOME).trim() ? String(process.env.AW_HOME).trim() : defaultHome(),
45
+ }
46
+ }
47
+
48
+ function pathToUrl(p) {
49
+ return pathToFileURL(resolve(p)).href
50
+ }
51
+
52
+ // ---- 启停状态(单一事实源:<配置根>/plugins-state.json;CLI/Web/宿主三方读写) ----
53
+ export function statePathFor(homeDir) {
54
+ return join(homeDir, 'plugins-state.json')
55
+ }
56
+
57
+ export function readDisabledSet(homeDir) {
58
+ try {
59
+ const j = JSON.parse(readFileSync(statePathFor(homeDir), 'utf8'))
60
+ return new Set(Array.isArray(j.disabled) ? j.disabled : [])
61
+ }
62
+ catch {
63
+ return new Set()
64
+ }
65
+ }
66
+
67
+ export function writeDisabledSet(homeDir, disabled) {
68
+ const p = statePathFor(homeDir)
69
+ mkdirSync(dirname(p), { recursive: true })
70
+ const tmp = `${p}.${process.pid}.tmp`
71
+ writeFileSync(tmp, `${JSON.stringify({ version: 1, updatedAt: new Date().toISOString(), disabled: [...disabled] }, null, 2)}\n`, 'utf8')
72
+ renameSync(tmp, p)
73
+ }
74
+
75
+ /** 发现两个作用域下的插件入口(project 同名覆盖 user) */
76
+ export function discoverPluginDirs(cwd = process.cwd()) {
77
+ const { projectDir, userDir } = modePaths(cwd)
78
+ const out = []
79
+ const seen = new Set()
80
+ for (const [dir, scope] of [[projectDir, 'project'], [userDir, 'user']]) {
81
+ if (!dir || !existsSync(dir)) continue
82
+ for (const name of readdirSync(dir)) {
83
+ const sub = join(dir, name)
84
+ if (!existsSync(join(sub, 'index.mjs'))) continue
85
+ if (seen.has(name)) continue
86
+ seen.add(name)
87
+ out.push({ dir: sub, scope })
88
+ }
89
+ }
90
+ return out.sort((a, b) => a.dir.localeCompare(b.dir))
91
+ }
92
+
93
+ /**
94
+ * 装载插件宿主(idempotent;nitro 启动期调用一次)。
95
+ */
96
+ export async function initPluginHost({ cwd = process.cwd(), packageRoot } = {}) {
97
+ if (g.__awPluginHost) return g.__awPluginHost
98
+ const logger = log()
99
+ const homeDir = modePaths(cwd).homeDir
100
+ const host = {
101
+ bus: new HookBus({
102
+ name: 'aw-plugins',
103
+ onError: (err, meta) => logger.warn(`钩子错误(${meta?.type}):`, err?.message ?? err),
104
+ }),
105
+ routes: createRouteTable(),
106
+ plugins: new Map(),
107
+ disposables: new Map(), // name → fn[](ctx.onDispose 登记)
108
+ hookOffs: new Map(), // name → off[](ctx.hooks.on 登记;热重载时解绑)
109
+ failures: [],
110
+ initedAt: null,
111
+ cwd,
112
+ packageRoot,
113
+ logger,
114
+ }
115
+ g.__awPluginHost = host
116
+
117
+ // 有效配置(只读面;引擎/模式解析从运行根动态加载)
118
+ let config = null
119
+ let settingsPath = null
120
+ let paths = { home: homeDir, configRoot: join(cwd, '.AgentWorkShop'), dataDir: join(cwd, '.AgentWorkShop', 'data') }
121
+ try {
122
+ const homeMod = await import(pathToUrl(join(cwd, 'shared', 'config', 'home.mjs')))
123
+ const rm = homeMod.resolveRunMode({ cwd, packageRoot, env: process.env })
124
+ const engineRoot = rm.mode === 'repo' ? rm.root : (packageRoot ?? rm.root)
125
+ if (engineRoot && existsSync(join(engineRoot, 'shared', 'config', 'engine.mjs'))) {
126
+ const engine = await import(pathToUrl(join(engineRoot, 'shared', 'config', 'engine.mjs')))
127
+ config = engine.loadEffective({ configPath: rm.configPath, settingsPath: rm.settingsPath, env: process.env })
128
+ settingsPath = rm.settingsPath
129
+ }
130
+ paths = { home: rm.home, configRoot: rm.configRoot, dataDir: rm.dataDir }
131
+ host.logger.info(`配置根: ${rm.configRoot} (${rm.mode} 模式)`)
132
+ }
133
+ catch (err) {
134
+ host.logger.warn('配置引擎加载降级(插件 ctx.config 将为空):', err?.message)
135
+ }
136
+ host.config = config
137
+
138
+ // 自环 origin:PORT env(prod:start.mjs 注入 / dev:dev-guard 注入 CLI 显式值)权威;
139
+ // nitro listen 钩子兜底回填
140
+ const argPort = (() => {
141
+ const argv = process.argv
142
+ const i = argv.indexOf('--port')
143
+ if (i >= 0 && argv[i + 1]) return argv[i + 1]
144
+ const eq = argv.find(a => a.startsWith('--port='))
145
+ return eq ? eq.slice(7) : null
146
+ })()
147
+ let selfOrigin = `http://127.0.0.1:${process.env.PORT ?? process.env.NITRO_PORT ?? argPort ?? config?.effective?.['server.dev.port'] ?? 3000}`
148
+ host.setSelfOrigin = (port) => {
149
+ selfOrigin = `http://127.0.0.1:${port}`
150
+ host.logger.info(`自环 origin 就绪: ${selfOrigin}`)
151
+ }
152
+ host.selfOrigin = () => selfOrigin
153
+ host.logger.info(`自环 origin: ${selfOrigin}`)
154
+
155
+ await loadAllPlugins(host, { config, settingsPath, paths })
156
+ ensureStateWatcher(host)
157
+ return host
158
+ }
159
+
160
+ /** 装载/重载全部插件(跳过 disabled;manifest 仍可见) */
161
+ async function loadAllPlugins(host, { config, paths }) {
162
+ const homeDir = modePaths(host.cwd).homeDir
163
+ const disabled = readDisabledSet(homeDir)
164
+ host.disabledSet = disabled
165
+
166
+ const entries = discoverPluginDirs(host.cwd)
167
+ if (entries.length) host.logger.info(`发现 ${entries.length} 个插件(停用 ${disabled.size}),开始装载 ...`)
168
+
169
+ for (const { dir, scope } of entries) {
170
+ const entry = join(dir, 'index.mjs')
171
+ try {
172
+ const mod = await import(pathToUrl(entry))
173
+ const check = validatePluginModule(mod, entry)
174
+ if (!check.ok) throw new Error(check.error)
175
+ const def = check.def
176
+
177
+ if (host.plugins.has(def.name)) throw new Error(`插件重名(后装载者跳过): ${def.name}`)
178
+ if (disabled.has(def.name)) {
179
+ host.plugins.set(def.name, {
180
+ name: def.name,
181
+ version: String(def.version ?? '0.0.0'),
182
+ description: String(def.description ?? ''),
183
+ scope,
184
+ dir,
185
+ entry,
186
+ clientPath: def.client ? resolve(dir, def.client) : null,
187
+ routes: [],
188
+ enabled: false,
189
+ error: null,
190
+ })
191
+ host.logger.info(`⊘ 跳过(已停用) [${scope}] ${def.name}`)
192
+ continue
193
+ }
194
+
195
+ const rec = {
196
+ name: def.name,
197
+ version: String(def.version ?? '0.0.0'),
198
+ description: String(def.description ?? ''),
199
+ scope,
200
+ dir,
201
+ entry,
202
+ clientPath: def.client ? resolve(dir, def.client) : null,
203
+ routes: [],
204
+ enabled: true,
205
+ error: null,
206
+ }
207
+
208
+ const emitter = {
209
+ registerRoute: (n, m, p, h) => {
210
+ host.routes.register(n, m, p, h)
211
+ rec.routes.push({ method: String(m).toUpperCase(), path: p })
212
+ },
213
+ }
214
+ const perPluginDisposables = []
215
+ const hookOffs = []
216
+ host.disposables.set(def.name, perPluginDisposables)
217
+ host.hookOffs.set(def.name, hookOffs)
218
+ const scopedHooks = {
219
+ on: (t, fn) => {
220
+ const off = host.bus.on(t, fn)
221
+ hookOffs.push(off)
222
+ return off
223
+ },
224
+ once: (t, fn) => {
225
+ const off = host.bus.once(t, fn)
226
+ hookOffs.push(off)
227
+ return off
228
+ },
229
+ off: (t, fn) => host.bus.off(t, fn),
230
+ emit: (t, p) => host.bus.emit(t, p),
231
+ }
232
+ const ctx = createPluginContext({
233
+ name: def.name,
234
+ scope,
235
+ dir,
236
+ hooks: scopedHooks,
237
+ logger: {
238
+ debug: (...a) => host.logger.info(`[${def.name}][debug]`, ...a),
239
+ info: (...a) => host.logger.info(`[${def.name}]`, ...a),
240
+ warn: (...a) => host.logger.warn(`[${def.name}]`, ...a),
241
+ error: (...a) => host.logger.error(`[${def.name}]`, ...a),
242
+ },
243
+ config,
244
+ paths,
245
+ emitter,
246
+ onDispose: (fn) => {
247
+ perPluginDisposables.push(fn)
248
+ return fn
249
+ },
250
+ selfOrigin: () => selfOriginRef(host),
251
+ })
252
+ // DAQ 扩展面(v2 帧管线):插件注册自定义驱动与下沉处理器。
253
+ // 桥经 globalThis 排队 —— daq 模块晚于插件宿主装载时,注册项先排队、
254
+ // daq 侧 plugin-bridge 接管后回放;重复装载由同名覆盖语义兜底。
255
+ const daqExt = (globalThis.__daqPluginExt ??= {
256
+ pendingDrivers: [],
257
+ pendingProcessors: [],
258
+ pendingTemplates: [],
259
+ registerDriver(d) {
260
+ this.pendingDrivers.push(d)
261
+ this._drain?.()
262
+ },
263
+ registerProcessor(kind, name, fn) {
264
+ this.pendingProcessors.push({ kind, name, fn })
265
+ this._drain?.()
266
+ },
267
+ registerTemplate(def) {
268
+ this.pendingTemplates.push(def)
269
+ this._drain?.()
270
+ },
271
+ drain(onDriver, onProcessor, onTemplate) {
272
+ this._drain = () => {
273
+ for (const d of this.pendingDrivers.splice(0)) onDriver(d)
274
+ for (const p of this.pendingProcessors.splice(0)) onProcessor(p.kind, p.name, p.fn)
275
+ for (const t of this.pendingTemplates.splice(0)) onTemplate(t)
276
+ }
277
+ this._drain()
278
+ },
279
+ })
280
+ ctx.daq = {
281
+ registerDriver: d => daqExt.registerDriver(d),
282
+ registerProcessor: (kind, name, fn) => daqExt.registerProcessor(kind, name, fn),
283
+ /** 注册数采节点模板(signalKind/sink.processors/metrics 全量可用;同名覆盖) */
284
+ registerTemplate: def => daqExt.registerTemplate(def),
285
+ /** 帧消费便捷别名(= hooks.on('daq:frame') / hooks.on('daq:sample')) */
286
+ onFrame: fn => scopedHooks.on('daq:frame', fn),
287
+ onSample: fn => scopedHooks.on('daq:sample', fn),
288
+ }
289
+ // OMP 工具扩展面:插件注册自定义 host 工具 → omp 会话运行时热注入
290
+ const ompExt = (globalThis.__ompPluginToolsBridge ??= {
291
+ pending: [],
292
+ register(plugin, tool) {
293
+ this.pending.push({ plugin, tool })
294
+ this._drain?.()
295
+ },
296
+ drain(onTool) {
297
+ this._drain = () => {
298
+ for (const def of this.pending.splice(0)) onTool(def)
299
+ }
300
+ this._drain()
301
+ },
302
+ })
303
+ ctx.omp = {
304
+ registerTool: (tool) => {
305
+ ompExt.register(def.name, tool)
306
+ ctx.logger.info(`已注册 omp 工具:「${tool?.name}」`)
307
+ },
308
+ }
309
+
310
+ for (const r of (Array.isArray(def.routes) ? def.routes : [])) {
311
+ emitter.registerRoute(def.name, r.method ?? 'GET', r.path, r.handler)
312
+ }
313
+ await def.setup?.(ctx)
314
+
315
+ host.plugins.set(def.name, rec)
316
+ host.logger.info(`✔ 已装载 [${scope}] ${def.name}@${rec.version}${rec.clientPath ? ' (+client)' : ''}`)
317
+ }
318
+ catch (err) {
319
+ host.failures.push({ source: entry, error: err?.message ?? String(err) })
320
+ host.logger.error(`装载失败 ${entry}:`, err?.message ?? err)
321
+ }
322
+ }
323
+
324
+ host.initedAt = new Date().toISOString()
325
+ await host.bus.emit('plugin:host:init', { plugins: [...host.plugins.keys()], failures: host.failures.length })
326
+ host.logger.info(`装载完成: ${host.plugins.size} 个(含停用)/ ${host.failures.length} 失败 / 活跃路由 ${host.routes.size} 条`)
327
+ }
328
+
329
+ function selfOriginRef(host) {
330
+ return host.selfOrigin()
331
+ }
332
+
333
+ /** 热重载:全部 dispose/解绑 → 重新装载(跳过停用)→ 广播 plugins.reloaded(并发合并) */
334
+ export async function reloadPluginHost() {
335
+ const host = getPluginHost()
336
+ if (!host) return null
337
+ if (host.reloadInFlight) return host.reloadInFlight
338
+ host.reloadInFlight = doReload(host).finally(() => {
339
+ host.reloadInFlight = null
340
+ })
341
+ return host.reloadInFlight
342
+ }
343
+
344
+ async function doReload(host) {
345
+ host.logger.info('热重载插件宿主 ...')
346
+ for (const [name, list] of host.disposables ?? []) {
347
+ for (const fn of list.splice(0)) {
348
+ try {
349
+ await fn()
350
+ }
351
+ catch (err) {
352
+ host.logger.warn(`[${name}] onDispose 失败:`, err?.message)
353
+ }
354
+ }
355
+ }
356
+ for (const offs of (host.hookOffs ?? new Map()).values()) {
357
+ for (const off of offs.splice(0)) {
358
+ try {
359
+ off()
360
+ }
361
+ catch { /* 解绑失败忽略 */ }
362
+ }
363
+ }
364
+ host.plugins.clear()
365
+ host.routes = createRouteTable()
366
+ host.failures = []
367
+ await loadAllPlugins(host, { config: host.config, settingsPath: null, paths: { home: modePaths(host.cwd).homeDir, configRoot: join(host.cwd, '.AgentWorkShop'), dataDir: join(host.cwd, '.AgentWorkShop', 'data') } })
368
+ await host.bus.emit('plugins:reloaded', { plugins: pluginManifest() })
369
+ try {
370
+ const m = await import('@/server/services/workshop/scene-events')
371
+ m.broadcastSceneEvent('plugins.reloaded', { plugins: pluginManifest() })
372
+ }
373
+ catch { /* 广播失败不影响重载 */ }
374
+ return host
375
+ }
376
+
377
+ /** 启停单插件(写状态文件;调用方随后 reloadPluginHost 或由 state watcher 触发) */
378
+ export function setPluginEnabled(name, enabled) {
379
+ const host = getPluginHost()
380
+ const homeDir = modePaths(host?.cwd ?? process.cwd()).homeDir
381
+ const set = readDisabledSet(homeDir)
382
+ if (enabled) set.delete(name)
383
+ else set.add(name)
384
+ writeDisabledSet(homeDir, set)
385
+ return [...set]
386
+ }
387
+
388
+ /** 状态文件监视 → 热重载(CLI/Web 只写文件,服务自感知) */
389
+ function ensureStateWatcher(host) {
390
+ const statePath = statePathFor(modePaths(host.cwd).homeDir)
391
+ try {
392
+ mkdirSync(dirname(statePath), { recursive: true })
393
+ if (!existsSync(statePath)) writeDisabledSet(modePaths(host.cwd).homeDir, new Set())
394
+ let debounce = null
395
+ watch(statePath, () => {
396
+ clearTimeout(debounce)
397
+ debounce = setTimeout(() => {
398
+ void reloadPluginHost()
399
+ }, 400)
400
+ })
401
+ }
402
+ catch (err) {
403
+ host.logger.warn('状态文件监视不可用(启停需手动重启):', err?.message)
404
+ }
405
+ }
406
+
407
+ /** 单例访问(未初始化返回 null —— 桥接点据此快速 no-op) */
408
+ export function getPluginHost() {
409
+ return g.__awPluginHost ?? null
410
+ }
411
+
412
+ /** scene-events 桥:全部无频道实时事件 → 插件 event:<type> */
413
+ export function emitPluginEvent(type, payload) {
414
+ void g.__awPluginHost?.bus.emit(`event:${type}`, payload)
415
+ }
416
+
417
+ /** DAQ 下发级采样钩子(与 WS daq.reading 同点、同节拍语义) */
418
+ export function emitDaqSample(payload) {
419
+ void g.__awPluginHost?.bus.emit('daq:sample', payload)
420
+ }
421
+
422
+ /** 帧观察钩子(v2 多形态信号;载荷只含元数据/指标/预览,不含 blob) */
423
+ export function emitDaqFrame(payload) {
424
+ void g.__awPluginHost?.bus.emit('daq:frame', payload)
425
+ }
426
+
427
+ /** 写控 ACK 后观察钩子 */
428
+ export function emitDcwWrite(payload) {
429
+ void g.__awPluginHost?.bus.emit('dcw:write', payload)
430
+ }
431
+
432
+ /** 产线启停钩子 */
433
+ export function emitLineLifecycle(kind, payload) {
434
+ void g.__awPluginHost?.bus.emit(kind, payload)
435
+ }
436
+
437
+ /** 客户端脚本读取(免鉴权只读端点用;越界路径拒绝) */
438
+ export function readClientScript(name) {
439
+ const host = getPluginHost()
440
+ const rec = host?.plugins.get(name)
441
+ if (!host || !rec) return { status: 404 }
442
+ if (!rec.clientPath || !existsSync(rec.clientPath)) return { status: 404 }
443
+ if (!resolve(rec.clientPath).startsWith(resolve(rec.dir))) return { status: 400 }
444
+ return { status: 200, code: readFileSync(rec.clientPath, 'utf8'), contentType: 'text/javascript; charset=utf-8' }
445
+ }
446
+
447
+ /** 清单(非敏感只读;含启停状态与路由) */
448
+ export function pluginManifest() {
449
+ const host = getPluginHost()
450
+ if (!host) return []
451
+ return [...host.plugins.values()].map(r => ({
452
+ name: r.name,
453
+ version: r.version,
454
+ description: r.description,
455
+ scope: r.scope,
456
+ enabled: r.enabled !== false,
457
+ hasClient: Boolean(r.clientPath),
458
+ routes: host.routes.byPlugin(r.name),
459
+ error: r.error,
460
+ }))
461
+ }
462
+
463
+ /** 关机钩子(nitro close 时调用):先逐插件回收订阅/定时器,再广播 server:close */
464
+ export async function shutdownPluginHost() {
465
+ const host = getPluginHost()
466
+ if (!host) return
467
+ for (const [name, list] of host.disposables ?? []) {
468
+ for (const fn of list.splice(0)) {
469
+ try {
470
+ await fn()
471
+ }
472
+ catch (err) {
473
+ host.logger.warn(`[${name}] onDispose 失败:`, err?.message)
474
+ }
475
+ }
476
+ }
477
+ await host.bus.emit('server:close', { at: new Date().toISOString() })
478
+ host.logger.info('插件清理完成,已发出 server:close')
479
+ }