agentworkshop 0.8.0 → 0.8.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 (396) hide show
  1. package/.AgentWorkShop/prompts/host-tools.json +123 -0
  2. package/.output/.AgentWorkShop/prompts/host-tools.json +123 -0
  3. package/.output/nitro.json +1 -1
  4. package/.output/public/_nuxt/{DJJDigim2.js → -FhgRqJl2.js} +1 -1
  5. package/.output/public/_nuxt/{CGk_VUhO2.js → 0qvcO_KM2.js} +1 -1
  6. package/.output/public/_nuxt/26OL4Ao82.js +1 -0
  7. package/.output/public/_nuxt/{sBDZymdy2.js → 2Kwo_j9G2.js} +1 -1
  8. package/.output/public/_nuxt/{BqYVLAcm.js → 2v5GdspM.js} +1 -1
  9. package/.output/public/_nuxt/{DkQBMVTs2.js → 8M7wFbEN2.js} +1 -1
  10. package/.output/public/_nuxt/{DtiY69xi2.js → 8SZLbrI42.js} +1 -1
  11. package/.output/public/_nuxt/{DF32f5EL2.js → B2NbzUau2.js} +1 -1
  12. package/.output/public/_nuxt/{CwZW1ZCe2.js → B4JlRHBB2.js} +1 -1
  13. package/.output/public/_nuxt/{BQOn0q6Y.js → B6C4WofF.js} +1 -1
  14. package/.output/public/_nuxt/{BC7W6lNm.js → B6UwtJ1a.js} +1 -1
  15. package/.output/public/_nuxt/{BfQ-ptH0.js → B8HFUsMH.js} +1 -1
  16. package/.output/public/_nuxt/{DzBbYWrw2.js → BBB_j2LU2.js} +1 -1
  17. package/.output/public/_nuxt/BCLUwdP52.js +1 -0
  18. package/.output/public/_nuxt/{CLxmY3Rh.js → BK4wbfGS.js} +1 -1
  19. package/.output/public/_nuxt/{BRMVDfPl2.js → BKidykmV2.js} +1 -1
  20. package/.output/public/_nuxt/BPUQZ9Lq2.js +8 -0
  21. package/.output/public/_nuxt/BRYBzVMJ.js +1 -0
  22. package/.output/public/_nuxt/{Bj5sjA5O.js → BRci9D_l.js} +1 -1
  23. package/.output/public/_nuxt/{Dmgqz2np2.js → BVGzwAxr2.js} +1 -1
  24. package/.output/public/_nuxt/BVg2R2VB2.js +1 -0
  25. package/.output/public/_nuxt/{C3aUN4Vp2.js → BW2uTUx52.js} +1 -1
  26. package/.output/public/_nuxt/{B5FKaMM02.js → BY3Lbz3h2.js} +1 -1
  27. package/.output/public/_nuxt/{DIwmMa_7.js → BYzim_Bn.js} +1 -1
  28. package/.output/public/_nuxt/{D8xUsQGt.js → B_Obcbiu.js} +1 -1
  29. package/.output/public/_nuxt/BaYDgyaR.js +3 -0
  30. package/.output/public/_nuxt/{DZJ11BTI.js → BbACaREb.js} +1 -1
  31. package/.output/public/_nuxt/{BJrj5JVe2.js → BcosvNXb2.js} +1 -1
  32. package/.output/public/_nuxt/{B_-vAvzb.js → BfeXib9G.js} +1 -1
  33. package/.output/public/_nuxt/{CeLqojCJ.js → BfgTar9L.js} +1 -1
  34. package/.output/public/_nuxt/BfvuWqSa.js +1 -0
  35. package/.output/public/_nuxt/{D8r8PNQa2.js → BiZWwdcD2.js} +1 -1
  36. package/.output/public/_nuxt/{DIFkTkdS.js → BkEokGX5.js} +1 -1
  37. package/.output/public/_nuxt/{CJSohaqk2.js → BklGqEto2.js} +2 -2
  38. package/.output/public/_nuxt/{DkpmSnHX.js → Bko5adbu.js} +1 -1
  39. package/.output/public/_nuxt/{DTQTGA6v2.js → BmBlIIJo2.js} +1 -1
  40. package/.output/public/_nuxt/{D_NjL-Hz.js → Bmvt9ydE.js} +1 -1
  41. package/.output/public/_nuxt/{Cp4r6Eiz.js → BoyuIoSm.js} +1 -1
  42. package/.output/public/_nuxt/{62J4vljm.js → Bq-tmkst.js} +1 -1
  43. package/.output/public/_nuxt/{BMMoqi94.js → BqFaZ4kS.js} +1 -1
  44. package/.output/public/_nuxt/BsJYieAL2.js +1 -0
  45. package/.output/public/_nuxt/{DD4J2Otc.js → BtZKe9ZV.js} +1 -1
  46. package/.output/public/_nuxt/{BnpY_zNx.js → BtumQhZK.js} +1 -1
  47. package/.output/public/_nuxt/{BjLzqWJH2.js → BwWs9EdO2.js} +1 -1
  48. package/.output/public/_nuxt/{Bx2a9cuY2.js → BxxpJxZf2.js} +1 -1
  49. package/.output/public/_nuxt/{qRXa-PM22.js → ByTnUqFw2.js} +1 -1
  50. package/.output/public/_nuxt/{DvOETuoT2.js → Byiiiwc72.js} +1 -1
  51. package/.output/public/_nuxt/{Car2lkbb.js → C1-SuwUN.js} +1 -1
  52. package/.output/public/_nuxt/{Dg81dOEO.js → C14pM5G4.js} +1 -1
  53. package/.output/public/_nuxt/{MDhaRQq_.js → C2Yp-B8m.js} +1 -1
  54. package/.output/public/_nuxt/{BJ2nJNlK2.js → C4e6_nom2.js} +1 -1
  55. package/.output/public/_nuxt/{CiCEprsp2.js → C5OStZJ62.js} +1 -1
  56. package/.output/public/_nuxt/{ByMj6e7s.js → C6lssmvl.js} +2 -2
  57. package/.output/public/_nuxt/{C6uBP0Xa.js → CC-GEjfN.js} +1 -1
  58. package/.output/public/_nuxt/CC2Pv8VL2.js +1 -0
  59. package/.output/public/_nuxt/{DKiqdYnj.js → CCcMgxV9.js} +1 -1
  60. package/.output/public/_nuxt/{5S26I34j2.js → CDL30A2z2.js} +1 -1
  61. package/.output/public/_nuxt/{B8C-QJB5.js → CDYLasP8.js} +1 -1
  62. package/.output/public/_nuxt/CElzwyXQ.js +1 -0
  63. package/.output/public/_nuxt/{2KE8xGVm.js → CEvJu-xI.js} +1 -1
  64. package/.output/public/_nuxt/{CR612R752.js → CFQRFctQ2.js} +1 -1
  65. package/.output/public/_nuxt/{DnzjxC0u.js → CHk9XxNi.js} +2 -2
  66. package/.output/public/_nuxt/{Bx4MR0jd.js → CLFmtXU7.js} +1 -1
  67. package/.output/public/_nuxt/{DW8k_0dQ.js → CMJi6yYS.js} +1 -1
  68. package/.output/public/_nuxt/{DD-r0S1p.js → CPvFGbr8.js} +1 -1
  69. package/.output/public/_nuxt/{CCgbgkid.js → CQSxS_Ek.js} +2 -2
  70. package/.output/public/_nuxt/{jGxHnjW6.js → CQuo31jF.js} +1 -1
  71. package/.output/public/_nuxt/{SoO2K-di.js → CRCrWy-6.js} +1 -1
  72. package/.output/public/_nuxt/CUCFFL9m.js +84 -0
  73. package/.output/public/_nuxt/CZYNy60j2.js +1 -0
  74. package/.output/public/_nuxt/{WPwdj9pg.js → CZsFf7ck.js} +1 -1
  75. package/.output/public/_nuxt/CfFUK6932.js +2 -0
  76. package/.output/public/_nuxt/{DAsjfdZD.js → CfIbFnJz.js} +1 -1
  77. package/.output/public/_nuxt/{Tk6TQZjU.js → CjF4QY9h.js} +1 -1
  78. package/.output/public/_nuxt/{DlUQa0wn.js → Cjo1t2IF.js} +1 -1
  79. package/.output/public/_nuxt/{CDn0eDn8.js → CmuGMxDP.js} +1 -1
  80. package/.output/public/_nuxt/Cn6EojFe.js +1 -0
  81. package/.output/public/_nuxt/{DLqSQbGv.js → CnYazk8d.js} +1 -1
  82. package/.output/public/_nuxt/{DQfy6R_2.js → CnrGVJIr.js} +1 -1
  83. package/.output/public/_nuxt/{C0YL0HKK.js → CtcBhkci.js} +1 -1
  84. package/.output/public/_nuxt/{h5gsh8E92.js → Cv-Mv7_h2.js} +1 -1
  85. package/.output/public/_nuxt/{vPcnBJsa2.js → CzlZrfq82.js} +1 -1
  86. package/.output/public/_nuxt/{C2YYOgMe.js → CznnUTZx.js} +2 -2
  87. package/.output/public/_nuxt/{csitHKnE2.js → D-80EfyA2.js} +1 -1
  88. package/.output/public/_nuxt/{BRdoISnJ2.js → D1C6qtS12.js} +1 -1
  89. package/.output/public/_nuxt/{Cnrmlixo.js → D1MkndMZ.js} +2 -2
  90. package/.output/public/_nuxt/{BLwDhlaa.js → D37gODe0.js} +1 -1
  91. package/.output/public/_nuxt/{NXY37IO62.js → D6FhDrYe2.js} +1 -1
  92. package/.output/public/_nuxt/{Btx8wL4-.js → D7TZLu4F.js} +1 -1
  93. package/.output/public/_nuxt/{qoUdVDnC.js → D7tEwf-o.js} +3 -3
  94. package/.output/public/_nuxt/D8HQPtm62.js +1 -0
  95. package/.output/public/_nuxt/D9O4L4jK.js +1 -0
  96. package/.output/public/_nuxt/{aQ1B7BZa2.js → D9lL3fJM2.js} +2 -2
  97. package/.output/public/_nuxt/{CT-vTjcG2.js → DC-2eKo62.js} +1 -1
  98. package/.output/public/_nuxt/DF9ETYJ32.js +1 -0
  99. package/.output/public/_nuxt/DGGBrc0q2.js +1 -0
  100. package/.output/public/_nuxt/DGu_fna7.js +1 -0
  101. package/.output/public/_nuxt/{BupBjt6B.js → DKOvbitt.js} +1 -1
  102. package/.output/public/_nuxt/{B1PzYsqN.js → DNxudyND.js} +1 -1
  103. package/.output/public/_nuxt/{BfX6_AjY.js → DOT-XQyi.js} +1 -1
  104. package/.output/public/_nuxt/{BsTZnkVK.js → DPPC9Teq.js} +1 -1
  105. package/.output/public/_nuxt/{HxohXQ_r.js → DRskyE7l.js} +1 -1
  106. package/.output/public/_nuxt/{B-U7E_Mc2.js → DW4ZgInh2.js} +1 -1
  107. package/.output/public/_nuxt/{BErG4kzc2.js → DWe6BMlp2.js} +1 -1
  108. package/.output/public/_nuxt/{BH8RvpVy.js → DWy0AjON.js} +1 -1
  109. package/.output/public/_nuxt/{Bc_k6AVA.js → DXgw1dVL.js} +4 -4
  110. package/.output/public/_nuxt/{C3sWJ8SD2.js → DZsKIzKD2.js} +1 -1
  111. package/.output/public/_nuxt/D_59BNP1.js +14 -0
  112. package/.output/public/_nuxt/{BQIO4MkA2.js → D_FZ3KZI2.js} +1 -1
  113. package/.output/public/_nuxt/{n_Njdwii2.js → D__vJGHF2.js} +1 -1
  114. package/.output/public/_nuxt/{C9gErLQc2.js → DaizNGUm2.js} +1 -1
  115. package/.output/public/_nuxt/{C-MY-JQE.js → DdyE0ylS.js} +1 -1
  116. package/.output/public/_nuxt/DhLlTxQh2.js +1 -0
  117. package/.output/public/_nuxt/{CxVhG0Xx.js → DhW7cFOa.js} +1 -1
  118. package/.output/public/_nuxt/{Rt2i6k7C2.js → DhjgWrB62.js} +1 -1
  119. package/.output/public/_nuxt/{KwT4sN_d.js → DiWcX4gj.js} +1 -1
  120. package/.output/public/_nuxt/DiloA8vK.js +1 -0
  121. package/.output/public/_nuxt/{DX-c5laM2.js → DlS-SkQ42.js} +1 -1
  122. package/.output/public/_nuxt/{D_Zspo1y.js → DmHp9yQ3.js} +1 -1
  123. package/.output/public/_nuxt/{dq1HKoGD.js → DoL9u6wu.js} +1 -1
  124. package/.output/public/_nuxt/{CIvMT5Ic.js → DqxBCeDe.js} +1 -1
  125. package/.output/public/_nuxt/{BnNmkGJS2.js → DrlnrdvY2.js} +3 -3
  126. package/.output/public/_nuxt/{BAcjVcku2.js → Dt8TL8_X2.js} +1 -1
  127. package/.output/public/_nuxt/{BtfwbNC0.js → Du7gS8RU.js} +1 -1
  128. package/.output/public/_nuxt/DuUc4bbY2.js +1 -0
  129. package/.output/public/_nuxt/{DPUXbTg9.js → DudoisLM.js} +1 -1
  130. package/.output/public/_nuxt/{Ce5R-ZGf2.js → DwgVlehj2.js} +1 -1
  131. package/.output/public/_nuxt/Dyxf2xZw.js +1 -0
  132. package/.output/public/_nuxt/Dz9C2pTa.js +1 -0
  133. package/.output/public/_nuxt/{BYxG9Hb2.js → EMbqTHfT.js} +1 -1
  134. package/.output/public/_nuxt/{B1SzppY12.js → FsRVXpyF2.js} +1 -1
  135. package/.output/public/_nuxt/{0MLy6ogg2.js → GQrEW8nk2.js} +1 -1
  136. package/.output/public/_nuxt/{Tuz5LcLM.js → IXR1BWP5.js} +1 -1
  137. package/.output/public/_nuxt/{-jpUnM1I2.js → Iub61dX92.js} +1 -1
  138. package/.output/public/_nuxt/{CQgOzpvI.js → JegDslce.js} +2 -2
  139. package/.output/public/_nuxt/{DrF3TWoj.js → KzK37yIr.js} +1 -1
  140. package/.output/public/_nuxt/{Br3MggOL.js → N-CCmCsX.js} +1 -1
  141. package/.output/public/_nuxt/{DHhmq7s_.js → NfvZ5Lzv.js} +1 -1
  142. package/.output/public/_nuxt/{CzX_kaPL.js → POTcePF_.js} +1 -1
  143. package/.output/public/_nuxt/{D7s96J3r2.js → Q-JpBT032.js} +1 -1
  144. package/.output/public/_nuxt/{DzwIZ81f2.js → R1g64DNi2.js} +1 -1
  145. package/.output/public/_nuxt/{JgheoP3e.js → R5Pz7BqB.js} +1 -1
  146. package/.output/public/_nuxt/{yLyz0-Yz.js → SvjzWbn8.js} +1 -1
  147. package/.output/public/_nuxt/{Dd7MZc_Q.js → XqXoaoDs.js} +1 -1
  148. package/.output/public/_nuxt/{B6jtLy6z.js → YAA98rWJ.js} +11 -11
  149. package/.output/public/_nuxt/{HX4_xnak2.js → YLYSczSq2.js} +1 -1
  150. package/.output/public/_nuxt/{BBw9ylUY2.js → YNhAoK-R2.js} +1 -1
  151. package/.output/public/_nuxt/Zkbt8Uk5.js +1 -0
  152. package/.output/public/_nuxt/aml.PalMp-5n.css +1 -0
  153. package/.output/public/_nuxt/{C41CcsiD.js → b7UcqLKi.js} +1 -1
  154. package/.output/public/_nuxt/builds/latest.json +1 -1
  155. package/.output/public/_nuxt/builds/meta/fa0af8b5-3929-428d-a6de-3b5cc6b8248f.json +1 -0
  156. package/.output/public/_nuxt/{DVkFSOZi.js → cKj4vSo5.js} +1 -1
  157. package/.output/public/_nuxt/{r1CpGsFp.js → dHwWyr6b.js} +1 -1
  158. package/.output/public/_nuxt/{DlcA9Gxl.js → eePbiWEh.js} +1 -1
  159. package/.output/public/_nuxt/{cjRzSvAg2.js → eymRov9Y2.js} +1 -1
  160. package/.output/public/_nuxt/{B8cViLJT.js → geMze5qw.js} +1 -1
  161. package/.output/public/_nuxt/{uu1wfdfR2.js → gh-WMxV_2.js} +1 -1
  162. package/.output/public/_nuxt/{Ce6e1mPk2.js → hCN555XP2.js} +1 -1
  163. package/.output/public/_nuxt/{rdUE8Khf.js → hZG5MLjK.js} +3 -3
  164. package/.output/public/_nuxt/{CcX_jP-d.js → hlfahYxK.js} +1 -1
  165. package/.output/public/_nuxt/{cGSl2GZp2.js → ilJHF1nA2.js} +1 -1
  166. package/.output/public/_nuxt/{D6ZcgHPz.js → jDuiDtGb.js} +1 -1
  167. package/.output/public/_nuxt/{DbeNMehP.js → k9b520K-.js} +1 -1
  168. package/.output/public/_nuxt/ontology.B_3Wn907.css +1 -0
  169. package/.output/public/_nuxt/optimizer.CLA8I1sy.css +1 -0
  170. package/.output/public/_nuxt/{DSORcpTJ.js → rDvMijKA.js} +2 -2
  171. package/.output/public/_nuxt/{CAiHhX8P2.js → rF7mggl72.js} +2 -2
  172. package/.output/public/_nuxt/ri9UF8rk.js +2 -0
  173. package/.output/public/_nuxt/{KgnxOsMr.js → toG_qAMH.js} +1 -1
  174. package/.output/public/_nuxt/{KQZmHR_K.js → u3h4pGpm.js} +2 -2
  175. package/.output/public/_nuxt/{dJ7gK7C2.js → uomnHjhM.js} +1 -1
  176. package/.output/public/_nuxt/{BUTg4W_x2.js → v77qozuJ2.js} +1 -1
  177. package/.output/public/_nuxt/{BcEr7tIB.js → v7cV7hJa.js} +1 -1
  178. package/.output/public/_nuxt/{D25dVZ822.js → vkQoYNQR2.js} +2 -2
  179. package/.output/public/_nuxt/{wR_w07322.js → vp3LtnTz2.js} +1 -1
  180. package/.output/public/_nuxt/{Bnc8HELj2.js → we7-sMSo2.js} +1 -1
  181. package/.output/public/_nuxt/{kN3ZzR1-.js → wxISMS1i.js} +1 -1
  182. package/.output/public/_nuxt/{DGrrucbG.js → zy7efYKR.js} +1 -1
  183. package/.output/server/chunks/_/data-export.mjs +5 -5
  184. package/.output/server/chunks/_/data-query.mjs +2 -2
  185. package/.output/server/chunks/_/eda-run.repo.mjs +2 -2
  186. package/.output/server/chunks/_/features.mjs +4 -4
  187. package/.output/server/chunks/_/golden.mjs +2 -2
  188. package/.output/server/chunks/_/index.mjs +1 -1
  189. package/.output/server/chunks/_/mes-console.mjs +1 -1
  190. package/.output/server/chunks/_/nitro.mjs +2149 -1520
  191. package/.output/server/chunks/_/nitro.mjs.map +1 -1
  192. package/.output/server/chunks/_/spc.mjs +1 -1
  193. package/.output/server/chunks/build/TownView-BWMDbosY.mjs +1 -1
  194. package/.output/server/chunks/build/{_wsId_-BNKrrV1H.mjs → _wsId_-BPy-Aj9L.mjs} +3 -3
  195. package/.output/server/chunks/build/{_wsId_-BNKrrV1H.mjs.map → _wsId_-BPy-Aj9L.mjs.map} +1 -1
  196. package/.output/server/chunks/build/{agents-8tV9xL97.mjs → agents-CpNLdI8E.mjs} +6 -6
  197. package/.output/server/chunks/build/{agents-8tV9xL97.mjs.map → agents-CpNLdI8E.mjs.map} +1 -1
  198. package/.output/server/chunks/build/{aml-BNTEDOsl.mjs → aml-DRAFRcGU.mjs} +15 -12
  199. package/.output/server/chunks/build/{aml-BNTEDOsl.mjs.map → aml-DRAFRcGU.mjs.map} +1 -1
  200. package/.output/server/chunks/build/{channel-templates-Iot9Y3vV.mjs → channel-templates-ByHOQQkO.mjs} +2 -2
  201. package/.output/server/chunks/build/{channel-templates-Iot9Y3vV.mjs.map → channel-templates-ByHOQQkO.mjs.map} +1 -1
  202. package/.output/server/chunks/build/daq-CdxcfY_G.mjs +1 -1
  203. package/.output/server/chunks/build/dcw-BlDQtS4q.mjs +1 -1
  204. package/.output/server/chunks/build/{default-CJkOcmrm.mjs → default-CNWS6NUw.mjs} +4 -4
  205. package/.output/server/chunks/build/{default-CJkOcmrm.mjs.map → default-CNWS6NUw.mjs.map} +1 -1
  206. package/.output/server/chunks/build/{dropdown-CjwsxU39.mjs → dropdown-BNwTVGde.mjs} +2 -2
  207. package/.output/server/chunks/build/{dropdown-CjwsxU39.mjs.map → dropdown-BNwTVGde.mjs.map} +1 -1
  208. package/.output/server/chunks/build/{dropdown-C6YH_kSO.mjs → dropdown-Cd-xPhR6.mjs} +2 -2
  209. package/.output/server/chunks/build/{dropdown-C6YH_kSO.mjs.map → dropdown-Cd-xPhR6.mjs.map} +1 -1
  210. package/.output/server/chunks/build/input-number-BNlNDK7H.mjs +1 -1
  211. package/.output/server/chunks/build/{logs-BTfJQ6vQ.mjs → logs-pRb-TMWa.mjs} +3 -3
  212. package/.output/server/chunks/build/{logs-BTfJQ6vQ.mjs.map → logs-pRb-TMWa.mjs.map} +1 -1
  213. package/.output/server/chunks/build/{monitor-DvaR3yo8.mjs → monitor-Cq6hRFeQ.mjs} +6 -6
  214. package/.output/server/chunks/build/{monitor-DvaR3yo8.mjs.map → monitor-Cq6hRFeQ.mjs.map} +1 -1
  215. package/.output/server/chunks/build/{ontology-C3HS5pMo.mjs → ontology-DK0Mf0zT.mjs} +510 -81
  216. package/.output/server/chunks/build/ontology-DK0Mf0zT.mjs.map +1 -0
  217. package/.output/server/chunks/build/{operations-Cl8nVm9D.mjs → operations-SMQrRAcr.mjs} +3 -3
  218. package/.output/server/chunks/build/{operations-Cl8nVm9D.mjs.map → operations-SMQrRAcr.mjs.map} +1 -1
  219. package/.output/server/chunks/build/optimizer-BlWTsM-W.mjs +202 -0
  220. package/.output/server/chunks/build/optimizer-BlWTsM-W.mjs.map +1 -0
  221. package/.output/server/chunks/build/{pagination-KaIvHBzi.mjs → pagination-DTAconUo.mjs} +2 -2
  222. package/.output/server/chunks/build/{pagination-KaIvHBzi.mjs.map → pagination-DTAconUo.mjs.map} +1 -1
  223. package/.output/server/chunks/build/{permissions-CVTfixZj.mjs → permissions-DgXQZSyx.mjs} +6 -6
  224. package/.output/server/chunks/build/{permissions-CVTfixZj.mjs.map → permissions-DgXQZSyx.mjs.map} +1 -1
  225. package/.output/server/chunks/build/{schedules-BLhn2CLn.mjs → schedules-dSnr8url.mjs} +6 -6
  226. package/.output/server/chunks/build/{schedules-BLhn2CLn.mjs.map → schedules-dSnr8url.mjs.map} +1 -1
  227. package/.output/server/chunks/build/{select--XFl7CtY.mjs → select-B3Dsb9yq.mjs} +3 -3
  228. package/.output/server/chunks/build/{select--XFl7CtY.mjs.map → select-B3Dsb9yq.mjs.map} +1 -1
  229. package/.output/server/chunks/build/{settings-DIf_iYdu.mjs → settings-BrIhnS2Z.mjs} +2 -2
  230. package/.output/server/chunks/build/{settings-DIf_iYdu.mjs.map → settings-BrIhnS2Z.mjs.map} +1 -1
  231. package/.output/server/chunks/build/{table-DIu_YCJN.mjs → table-CmVD-cA9.mjs} +4 -4
  232. package/.output/server/chunks/build/{table-DIu_YCJN.mjs.map → table-CmVD-cA9.mjs.map} +1 -1
  233. package/.output/server/chunks/build/{teams-B2J6ouRY.mjs → teams-B1d32eHK.mjs} +4 -4
  234. package/.output/server/chunks/build/{teams-B2J6ouRY.mjs.map → teams-B1d32eHK.mjs.map} +1 -1
  235. package/.output/server/chunks/build/{tokens-DFQGaN2n.mjs → tokens-GYaGJ35Z.mjs} +6 -6
  236. package/.output/server/chunks/build/{tokens-DFQGaN2n.mjs.map → tokens-GYaGJ35Z.mjs.map} +1 -1
  237. package/.output/server/chunks/build/{tools-DWJFnU_t.mjs → tools-s_9U1Djj.mjs} +6 -6
  238. package/.output/server/chunks/build/{tools-DWJFnU_t.mjs.map → tools-s_9U1Djj.mjs.map} +1 -1
  239. package/.output/server/chunks/build/types-D6J7slEa.mjs +1 -1
  240. package/.output/server/chunks/build/useDaqAddNode-D_Rkju0f.mjs +1 -1
  241. package/.output/server/chunks/build/useDaqDetailNode-DeOsDxK5.mjs +1 -1
  242. package/.output/server/chunks/build/useDaqDetailParams-Cm9a9r5G.mjs +1 -1
  243. package/.output/server/chunks/build/useDaqFilters-CctmO03p.mjs +1 -1
  244. package/.output/server/chunks/build/useDaqStream-B9ZBVQrI.mjs +1 -1
  245. package/.output/server/chunks/build/useDaqTemplates-CK37sMfi.mjs +1 -1
  246. package/.output/server/chunks/build/useDcwAddNode-DACVcEHs.mjs +1 -1
  247. package/.output/server/chunks/build/useDcwStream-Dir5ufAU.mjs +1 -1
  248. package/.output/server/chunks/build/{users-BWw0VCr9.mjs → users-DjiVC_tS.mjs} +6 -6
  249. package/.output/server/chunks/build/{users-BWw0VCr9.mjs.map → users-DjiVC_tS.mjs.map} +1 -1
  250. package/.output/server/chunks/routes/api/mcp/workshop.mjs +1 -1
  251. package/.output/server/chunks/routes/api/system/backup/run.post.mjs +2 -2
  252. package/.output/server/chunks/routes/api/workshop/aml/models/_id_.patch.mjs +7 -1
  253. package/.output/server/chunks/routes/api/workshop/aml/models/_id_.patch.mjs.map +1 -1
  254. package/.output/server/chunks/routes/api/workshop/channel-templates/_id/instantiate.post.mjs +1 -1
  255. package/.output/server/chunks/routes/api/workshop/channels.post.mjs +6 -6
  256. package/.output/server/chunks/routes/api/workshop/daq/_id/ingest.post.mjs +2 -2
  257. package/.output/server/chunks/routes/api/workshop/harnesses/_id/providers.get.mjs +1 -1
  258. package/.output/server/chunks/routes/api/workshop/index.mjs +1 -1
  259. package/.output/server/chunks/routes/api/workshop/index.put.mjs +1 -1
  260. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/autofix.mjs +52 -0
  261. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/autofix.mjs.map +1 -0
  262. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/compile.mjs +1 -1
  263. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/evidence.mjs +1 -1
  264. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/publish.mjs +1 -1
  265. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval-decision.mjs +1 -1
  266. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/approval.mjs +1 -1
  267. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/rules/_ruleId/transition.mjs +1 -1
  268. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/subgraph.mjs +38 -0
  269. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/subgraph.mjs.map +1 -0
  270. package/.output/server/chunks/routes/api/workshop/ontology/drafts/_draftId/validate.mjs +1 -1
  271. package/.output/server/chunks/routes/api/workshop/ontology/export/_ontologyId_.mjs +1 -1
  272. package/.output/server/chunks/routes/api/workshop/ontology/index.mjs +1 -1
  273. package/.output/server/chunks/routes/api/workshop/ontology/scene.mjs +8 -1
  274. package/.output/server/chunks/routes/api/workshop/ontology/scene.mjs.map +1 -1
  275. package/.output/server/chunks/routes/api/workshop/ontology/traces/_ontologyId_.mjs +1 -1
  276. package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId/compare.mjs +1 -1
  277. package/.output/server/chunks/routes/api/workshop/ontology/versions/_ontologyId_.mjs +1 -1
  278. package/.output/server/chunks/routes/api/workshop/optimization/capabilities.get.mjs +1 -1
  279. package/.output/server/chunks/routes/api/workshop/optimization/index.mjs +1 -1
  280. package/.output/server/chunks/routes/api/workshop/optimization/index2.mjs +1 -1
  281. package/.output/server/chunks/routes/api/workshop/optimization/profiles/_id/publish.post.mjs +1 -1
  282. package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/crosscheck.post.mjs +1 -1
  283. package/.output/server/chunks/routes/api/workshop/optimization/recommendations/_id/dispatch.post.mjs +1 -1
  284. package/.output/server/chunks/routes/api/workshop/optimization/solve.post.mjs +1 -1
  285. package/.output/server/chunks/routes/api/workshop/plugins/_name/disable.post.mjs +1 -1
  286. package/.output/server/chunks/routes/api/workshop/plugins/_name/enable.post.mjs +1 -1
  287. package/.output/server/chunks/routes/api/workshop/process-model/datasets.post.mjs +1 -1
  288. package/.output/server/chunks/routes/api/workshop/process-model/eligibility.mjs +1 -1
  289. package/.output/server/chunks/routes/api/workshop/process-model/index.mjs +1 -1
  290. package/.output/server/chunks/routes/api/workshop/process-model/specs/_id/publish.post.mjs +1 -1
  291. package/.output/server/chunks/routes/api/workshop/process-model/train.post.mjs +1 -1
  292. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.delete.mjs +1 -1
  293. package/.output/server/chunks/routes/api/workshop/scene/layouts/_channelId_.put.mjs +1 -1
  294. package/.output/server/chunks/routes/api/workshop/tools/sync.post.mjs +1 -1
  295. package/.output/server/chunks/routes/api/workshop/workspaces/_id/channel-templates/_tplId_.post.mjs +1 -1
  296. package/.output/server/chunks/routes/renderer.mjs +2 -2
  297. package/.output/server/chunks/virtual/entry.mjs +92 -18
  298. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  299. package/.output/server/package.json +1 -1
  300. package/README-zh.md +5 -4
  301. package/README.md +6 -5
  302. package/app/components/aml/AmlModelsTable.vue +5 -0
  303. package/app/components/ontology/OntologyGraph.vue +356 -0
  304. package/app/pages/aml/styles.css +1 -0
  305. package/app/pages/ontology/index.vue +318 -35
  306. package/app/pages/ontology/types.ts +42 -0
  307. package/app/pages/optimizer/index.vue +21 -4
  308. package/config.yml +1 -1
  309. package/docs/cli.en.md +2 -2
  310. package/docs/cli.md +2 -2
  311. package/docs/plugins.en.md +1 -1
  312. package/docs/plugins.md +1 -1
  313. package/docs/sdk.en.md +1 -1
  314. package/docs/sdk.md +1 -1
  315. package/i18n/locales/en.ts +26 -0
  316. package/i18n/locales/zh-CN.ts +26 -0
  317. package/mcp/aw-mcp-server.mjs +20 -2
  318. package/package.json +1 -1
  319. package/scripts/e2e-direct-rest-simulator-paper.mjs +624 -0
  320. package/scripts/e2e-idd-results.mjs +177 -0
  321. package/scripts/e2e-model-loop-live.mjs +58 -4
  322. package/scripts/e2e-ontology-live.mjs +138 -3
  323. package/scripts/e2e-ontology.mjs +393 -328
  324. package/scripts/e2e-pi-simulator-paper.mjs +2316 -0
  325. package/scripts/e2e-registered-harness-simulator-paper.mjs +1926 -0
  326. package/scripts/e2e-simulator-optimizer-paper.mjs +264 -0
  327. package/scripts/fixtures/omp-paper-harness.mjs +163 -0
  328. package/sdk/context.mjs +6 -0
  329. package/sdk/index.d.mts +2 -0
  330. package/server/api/workshop/aml/models/[id].patch.ts +36 -30
  331. package/server/api/workshop/ontology/drafts/[draftId]/autofix.ts +31 -0
  332. package/server/api/workshop/ontology/drafts/[draftId]/subgraph.ts +24 -0
  333. package/server/api/workshop/ontology/scene.ts +14 -1
  334. package/server/plugins-builtin/diag-bridge/client.mjs +390 -239
  335. package/server/plugins-builtin/diag-bridge/host/helpers.mjs +80 -0
  336. package/server/plugins-builtin/diag-bridge/host/plugin.mjs +264 -2
  337. package/server/plugins-builtin/diag-bridge/i18n.json +84 -4
  338. package/server/services/workshop/agents/adapters/omp-rpc-client/frames.ts +129 -111
  339. package/server/services/workshop/agents/host-tool-bridge/tools/industrial.ts +6 -3
  340. package/server/services/workshop/agents/industrial/aml-job-tools.ts +602 -569
  341. package/server/services/workshop/agents/industrial/grant-guard.ts +15 -1
  342. package/server/services/workshop/agents/industrial/index.ts +2 -2
  343. package/server/services/workshop/agents/industrial/ontology-tools.ts +66 -6
  344. package/server/services/workshop/agents/industrial/ops-tools.ts +54 -16
  345. package/server/services/workshop/agents/industrial/optimizer-tools.ts +2 -0
  346. package/server/services/workshop/agents/industrial/recipe-gate.ts +19 -6
  347. package/server/services/workshop/agents/industrial/recipe-propose-tools.ts +1 -1
  348. package/server/services/workshop/agents/omp-agent/supervision-history.ts +38 -0
  349. package/server/services/workshop/agents/omp-agent/tools-steer.ts +18 -1
  350. package/server/services/workshop/aml/aml.repo.ts +16 -0
  351. package/server/services/workshop/daq/bus/index.ts +12 -5
  352. package/server/services/workshop/db/database/open.ts +97 -97
  353. package/server/services/workshop/db/database/schema.ts +1 -0
  354. package/server/services/workshop/ontology/autofix.ts +198 -0
  355. package/server/services/workshop/ontology/contracts.ts +3 -1
  356. package/server/services/workshop/ontology/index.ts +2 -0
  357. package/server/services/workshop/ontology/ontology.service.ts +46 -0
  358. package/server/services/workshop/ontology/subgraph.core.ts +300 -0
  359. package/server/services/workshop/ontology/subgraph.service.ts +113 -0
  360. package/server/services/workshop/optimization/contracts.ts +2 -0
  361. package/server/services/workshop/optimization/profile-adopt.service.ts +5 -0
  362. package/server/services/workshop/optimization/profile.repo.ts +6 -4
  363. package/.output/public/_nuxt/B3Y5bCrM.js +0 -1
  364. package/.output/public/_nuxt/B8N8nsad2.js +0 -2
  365. package/.output/public/_nuxt/BO0BJx3w2.js +0 -8
  366. package/.output/public/_nuxt/BWn-lfCp2.js +0 -1
  367. package/.output/public/_nuxt/Bcs9zzO62.js +0 -1
  368. package/.output/public/_nuxt/BwO2Y5FH2.js +0 -1
  369. package/.output/public/_nuxt/Byf4IxU2.js +0 -14
  370. package/.output/public/_nuxt/C-LU6xv_.js +0 -1
  371. package/.output/public/_nuxt/CJ0bjZ6v2.js +0 -1
  372. package/.output/public/_nuxt/CJ3Vul2u.js +0 -1
  373. package/.output/public/_nuxt/CNwx04ln.js +0 -84
  374. package/.output/public/_nuxt/CVCscYzb2.js +0 -1
  375. package/.output/public/_nuxt/C_A0MCol2.js +0 -1
  376. package/.output/public/_nuxt/CnP6snIz.js +0 -3
  377. package/.output/public/_nuxt/D0mzKkZr.js +0 -1
  378. package/.output/public/_nuxt/D3buuIkE.js +0 -1
  379. package/.output/public/_nuxt/D4_INWgq.js +0 -1
  380. package/.output/public/_nuxt/D5kCimyw2.js +0 -1
  381. package/.output/public/_nuxt/DBtXLkyA.js +0 -1
  382. package/.output/public/_nuxt/DHURbGkn2.js +0 -1
  383. package/.output/public/_nuxt/DaBzS-iu.js +0 -1
  384. package/.output/public/_nuxt/DnlhV7Xe.js +0 -1
  385. package/.output/public/_nuxt/GtI6PUI32.js +0 -1
  386. package/.output/public/_nuxt/Nw_6OpQZ.js +0 -1
  387. package/.output/public/_nuxt/Y4sMSPrS2.js +0 -1
  388. package/.output/public/_nuxt/aml.CeLxRzvI.css +0 -1
  389. package/.output/public/_nuxt/builds/meta/7a79a7e4-d691-4cf5-ae3a-3b01814479fb.json +0 -1
  390. package/.output/public/_nuxt/goF_oZHF.js +0 -2
  391. package/.output/public/_nuxt/ontology.QMGeh66l.css +0 -1
  392. package/.output/public/_nuxt/optimizer.B8gCbU1b.css +0 -1
  393. package/.output/public/_nuxt/rJ7To74v2.js +0 -1
  394. package/.output/server/chunks/build/ontology-C3HS5pMo.mjs.map +0 -1
  395. package/.output/server/chunks/build/optimizer-BOtGWEtc.mjs +0 -200
  396. package/.output/server/chunks/build/optimizer-BOtGWEtc.mjs.map +0 -1
@@ -1,239 +1,390 @@
1
- /**
2
- * diag-bridge 客户端面板 —— 注入 'plugins.page' 插槽。
3
- * 连接检测(调 /health,含用户配置 token 的实测三态,结构化渲染) +
4
- * 诊断记录表(runId/产线/状态/评分/入库/报告),30s 自动刷新,语言切换即重渲染;
5
- * 已完成诊断可点「报告」在线查看 report md 全文(经 /report 路由代理诊断服务)。
6
- */
7
- export function setup(ctx) {
8
- const styleId = 'aw-diag-styles'
9
- if (!document.getElementById(styleId)) {
10
- document.head.append(ctx.el('style', { id: styleId }, [`
11
- .aw-diag { display:flex; flex-direction:column; gap:8px; font-size:12px; }
12
- .aw-diag-toolbar { display:flex; justify-content:flex-end; }
13
- .aw-diag-btn { padding:4px 12px; border:1px solid color-mix(in srgb, currentColor 28%, transparent); border-radius:7px; background:transparent; color:inherit; cursor:pointer; }
14
- .aw-diag-btn:disabled { opacity:.45; cursor:default; }
15
- .aw-diag-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
16
- .aw-diag-table { width:100%; border-collapse:collapse; min-width:540px; }
17
- .aw-diag-table th, .aw-diag-table td { text-align:left; padding:5px 8px; border-bottom:1px solid color-mix(in srgb, currentColor 10%, transparent); white-space:nowrap; }
18
- .aw-diag-table th { opacity:.65; font-weight:500; }
19
- .aw-diag-st { display:inline-flex; align-items:center; gap:5px; }
20
- .aw-diag-dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
21
- .aw-diag-dot-running { background:#41c8f4; }
22
- .aw-diag-dot-completed { background:#35e0a0; }
23
- .aw-diag-dot-failed, .aw-diag-dot-stopped { background:#e05a5a; }
24
- .aw-diag-dot-na { background:#9aa4ad; }
25
- .aw-diag-empty { opacity:.6; padding:8px 0; }
26
- .aw-diag-status { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
27
- .aw-diag-check { padding:8px 10px; border:1px dashed color-mix(in srgb, currentColor 20%, transparent); border-radius:8px; display:flex; flex-direction:column; gap:5px; }
28
- /* 未检测前不渲染空虚线框 */
29
- .aw-diag-check:has(> .aw-diag-check-rows:empty) { display:none; }
30
- .aw-diag-check-rows { display:flex; flex-direction:column; gap:3px; }
31
- .aw-diag-check-row { display:flex; gap:6px; align-items:baseline; flex-wrap:wrap; }
32
- .aw-diag-check-k { opacity:.65; min-width:86px; }
33
- .aw-diag-check-err { color:#e05a5a; }
34
- .aw-diag-check-ok { color:#35e0a0; }
35
- .aw-diag-modal { position:fixed; inset:0; z-index:9999; background:rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; }
36
- .aw-diag-modal-box { width:min(860px, 92vw); max-height:84vh; display:flex; flex-direction:column; gap:8px; background:var(--aw-bg, #101826); color:inherit; border:1px solid color-mix(in srgb, currentColor 22%, transparent); border-radius:12px; padding:14px 16px; }
37
- .aw-diag-modal-head { display:flex; align-items:center; justify-content:space-between; gap:12px; font-weight:600; }
38
- .aw-diag-report { flex:1; overflow:auto; white-space:pre-wrap; font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:12px; line-height:1.6; }
39
- `]))
40
- }
41
-
42
- ctx.ui.registerPanel({
43
- slot: 'plugins.page',
44
- name: 'diag-runs',
45
- titleKey: 'panel.title',
46
- order: 20,
47
- mount(el) {
48
- const t = k => ctx.t(`panel.${k}`)
49
- const timer = setInterval(() => {
50
- void load()
51
- void refreshStatus()
52
- }, 30_000)
53
- const table = ctx.el('div', { class: 'aw-diag-table-wrap' })
54
-
55
- function dot(ok, na = false) {
56
- return ctx.el('span', {
57
- class: `aw-diag-dot ${na ? 'aw-diag-dot-na' : ok ? 'aw-diag-dot-completed' : 'aw-diag-dot-failed'}`,
58
- title: na ? t('tokenUnknown') : ok ? t('ok') : t('bad'),
59
- })
60
- }
61
-
62
- // ---- 连接状态行(30s 轮询) + 「检测连接」显式检测(宿主后端会拿用户配置的 token 实测受保护端点) ----
63
- const remoteCell = ctx.el('span', { class: 'aw-diag-st' }, [dot(false), ` ${t('remote')}: -`])
64
- const tokenCell = ctx.el('span', { class: 'aw-diag-st' }, [dot(false, true), ` ${t('tokenCfg')}: -`])
65
- const engineCell = ctx.el('span', { class: 'aw-diag-st faint' }, [` ${t('engine')}: -`])
66
- const statusRow = ctx.el('div', { class: 'aw-diag-status' }, [remoteCell, tokenCell, engineCell])
67
-
68
- const checkBtn = ctx.el('button', { class: 'aw-diag-btn' }, [t('checkBtn')])
69
- const checkRows = ctx.el('div', { class: 'aw-diag-check-rows' })
70
- const checkBox = ctx.el('div', { class: 'aw-diag-check' }, [checkRows])
71
- checkBtn.addEventListener('click', () => void runCheck())
72
-
73
- /** 检测明细行:true 绿 / false 红 / null 灰 */
74
- function checkRow(label, okState, value) {
75
- const val = ctx.el('span')
76
- for (const seg of (Array.isArray(value) ? value : [{ text: String(value) }])) {
77
- val.append(ctx.el('span', { class: seg.cls ?? '' }, [String(seg.text)]))
78
- }
79
- return ctx.el('div', { class: 'aw-diag-check-row' }, [
80
- ctx.el('span', { class: 'aw-diag-check-k' }, [label]),
81
- dot(okState === true, okState == null),
82
- val,
83
- ])
84
- }
85
-
86
- /** token 三态文案 */
87
- const tokenText = tk => !tk?.configured
88
- ? t('tokenNone')
89
- : tk?.accepted === true ? t('tokenAccepted') : tk?.accepted === false ? t('tokenRejected') : t('tokenUnknown')
90
-
91
- async function runCheck() {
92
- checkBtn.disabled = true
93
- checkBtn.textContent = t('checking')
94
- const t0 = Date.now()
95
- const h = await ctx.fetch('/api/plugins/diag-bridge/health').catch(() => null)
96
- const ms = Date.now() - t0
97
- const rows = []
98
- if (!h) {
99
- rows.push(checkRow(t('checkBtn'), false, [{ text: t('checkFail'), cls: 'aw-diag-check-err' }]))
100
- }
101
- else {
102
- const remote = h?.remote ?? {}
103
- const rOk = remote?.status === 'ok'
104
- rows.push(checkRow(t('remote'), rOk, [
105
- { text: `${h?.base ?? '-'} · ${remote?.status ?? '-'}`, cls: rOk ? '' : 'aw-diag-check-err' },
106
- ...(remote?.auth ? [{ text: ` · auth=${remote.auth}`, cls: /被拒|401|403/.test(String(remote.auth)) ? 'aw-diag-check-err' : '' }] : []),
107
- ...(remote?.error ? [{ text: ` · ${remote.error}`, cls: 'aw-diag-check-err' }] : []),
108
- ]))
109
- const tk = h?.token ?? {}
110
- rows.push(checkRow(t('tokenCfg'), tk?.configured ? tk?.accepted : null,
111
- [{ text: tokenText(tk), cls: tk?.accepted === false ? 'aw-diag-check-err' : '' },
112
- ...(tk?.hint ? [{ text: ` · ${tk.hint}`, cls: 'aw-diag-check-err' }] : []),
113
- ...(h?.auth ? [{ text: ` · ${h.auth === 'bearer' ? t('bearer') : t('anonymous')}` }] : [])]))
114
- rows.push(checkRow(t('engine'), true, [{ text: String(h?.harness ?? '-') }]))
115
- const by = h?.runs?.byStatus ?? {}
116
- rows.push(checkRow(t('runs'), true, [{ text: `${h?.runs?.total ?? 0} (completed ${by.completed ?? 0} / running ${by.running ?? 0} / failed ${by.failed ?? 0})` }]))
117
- const allOk = rOk && tk?.accepted !== false
118
- rows.push(ctx.el('div', { class: 'aw-diag-check-row' }, [
119
- ctx.el('span', { class: allOk ? 'aw-diag-check-ok' : 'aw-diag-check-err' },
120
- [allOk ? `✔ ${t('allOk')}` : `✖ ${t('allBad')}`]),
121
- ctx.el('span', { class: 'faint' }, [` · ${t('latency')} ${ms}ms`]),
122
- ]))
123
- }
124
- checkRows.replaceChildren(...rows)
125
- checkBtn.disabled = false
126
- checkBtn.textContent = t('checkBtn')
127
- }
128
-
129
- async function refreshStatus() {
130
- const h = await ctx.fetch('/api/plugins/diag-bridge/health').catch(() => null)
131
- const remote = h?.remote ?? {}
132
- const rOk = remote?.status === 'ok'
133
- remoteCell.replaceChildren(dot(rOk), ` ${t('remote')}: ${remote?.status ?? '-'}${remote?.auth ? `(${remote.auth})` : ''}`)
134
- const tk = h?.token ?? {}
135
- tokenCell.replaceChildren(dot(tk?.configured ? tk?.accepted === true : false, !tk?.configured), ` ${t('tokenCfg')}: ${tokenText(tk)}`)
136
- engineCell.replaceChildren(` ${t('engine')}: ${h?.harness ?? '-'}`)
137
- }
138
-
139
- el.append(ctx.el('div', { class: 'aw-diag' }, [
140
- statusRow,
141
- ctx.el('div', { class: 'aw-diag-toolbar' }, [
142
- checkBtn,
143
- ctx.el('button', { class: 'aw-diag-btn', onclick: () => void load() }, [t('refresh')]),
144
- ]),
145
- checkBox,
146
- table,
147
- ]))
148
-
149
- const statusOf = (s) => {
150
- const key = ['running', 'completed', 'failed', 'stopped'].includes(s) ? s : 'other'
151
- return ctx.el('span', { class: 'aw-diag-st' }, [
152
- ctx.el('span', { class: `aw-diag-dot aw-diag-dot-${key}` }),
153
- t(`st_${key}`),
154
- ])
155
- }
156
-
157
- // 报告查看:拉 /report 路由,弹层渲染 report md 全文
158
- async function showReport(runId, btn) {
159
- const modal = ctx.el('div', { class: 'aw-diag-modal' }, [
160
- ctx.el('div', { class: 'aw-diag-modal-box' }, [
161
- ctx.el('div', { class: 'aw-diag-modal-head' }, [
162
- ctx.el('span', {}, [`${t('report')} · ${runId}`]),
163
- ctx.el('button', { class: 'aw-diag-btn', onclick: () => modal.remove() }, [t('close')]),
164
- ]),
165
- ctx.el('div', { class: 'aw-diag-report' }, [t('loading')]),
166
- ]),
167
- ])
168
- modal.addEventListener('click', (e) => {
169
- if (e.target === modal) modal.remove()
170
- })
171
- document.body.append(modal)
172
- const box = modal.querySelector('.aw-diag-report')
173
- try {
174
- const r = await ctx.fetch(`/api/plugins/diag-bridge/report?run_id=${encodeURIComponent(runId)}`)
175
- if (!r?.success) throw new Error(r?.error || `HTTP error(${runId})`)
176
- const rep = r.report ?? {}
177
- box.textContent = typeof rep === 'string' ? rep : String(rep.content ?? JSON.stringify(rep, null, 2))
178
- }
179
- catch (err) {
180
- box.textContent = `${t('report_fail')}: ${err?.message ?? err}`
181
- }
182
- finally {
183
- if (btn) btn.disabled = false
184
- }
185
- }
186
-
187
- async function load() {
188
- const r = await ctx.fetch('/api/plugins/diag-bridge/runs').catch(() => null)
189
- const runs = Array.isArray(r?.runs) ? r.runs.slice(0, 8) : []
190
- if (!runs.length) {
191
- table.replaceChildren(ctx.el('div', { class: 'aw-diag-empty' }, [t('none')]))
192
- return
193
- }
194
- const thead = ctx.el('tr', {}, [
195
- ctx.el('th', {}, [t('run')]),
196
- ctx.el('th', {}, [t('line')]),
197
- ctx.el('th', {}, [t('status')]),
198
- ctx.el('th', {}, [t('score')]),
199
- ctx.el('th', {}, [t('stored')]),
200
- ctx.el('th', {}, [t('report')]),
201
- ])
202
- const tbody = ctx.el('tbody')
203
- for (const run of runs) {
204
- const isDone = String(run.status ?? '') === 'completed'
205
- const btn = isDone
206
- ? ctx.el('button', {
207
- class: 'aw-diag-btn',
208
- onclick: () => {
209
- btn.disabled = true
210
- void showReport(String(run.runId), btn)
211
- },
212
- }, [t('view')])
213
- : ctx.el('span', { style: 'opacity:.4' }, ['-'])
214
- tbody.append(ctx.el('tr', {}, [
215
- ctx.el('td', { class: 'aw-mono' }, [String(run.runId ?? '-')]),
216
- ctx.el('td', {}, [String(run.line ?? '-')]),
217
- ctx.el('td', {}, [statusOf(String(run.status ?? ''))]),
218
- ctx.el('td', {}, [run.score != null ? String(run.score) : '-']),
219
- ctx.el('td', {}, [run.stored === true ? t('yes') : t('no')]),
220
- ctx.el('td', {}, [btn]),
221
- ]))
222
- }
223
- table.replaceChildren(ctx.el('table', { class: 'aw-diag-table' }, [ctx.el('thead', {}, [thead]), tbody]))
224
- }
225
-
226
- void load()
227
- void refreshStatus()
228
- // 语言切换 → 重渲染(标题由插槽响应式解析,表格文案在此重取)
229
- const offLocale = ctx.hooks.on('i18n:changed', () => {
230
- void load()
231
- void refreshStatus()
232
- })
233
- return () => {
234
- clearInterval(timer)
235
- offLocale()
236
- }
237
- },
238
- })
239
- }
1
+ /**
2
+ * diag-bridge 客户端面板 —— 注入 'plugins.page' 插槽。
3
+ * 连接检测(调 /health,含用户配置 token 的实测三态,结构化渲染) +
4
+ * 诊断记录表(runId/产线/状态/评分/入库/报告),30s 自动刷新,语言切换即重渲染;
5
+ * 已完成诊断可点「报告」在线查看 report md 全文(经 /report 路由代理诊断服务)。
6
+ */
7
+ export function setup(ctx) {
8
+ // 同入口挂第二面板:分析结果库(插件页 order 21;宿主只认 setup(ctx))
9
+ setupResults(ctx)
10
+ const styleId = 'aw-diag-styles'
11
+ if (!document.getElementById(styleId)) {
12
+ document.head.append(ctx.el('style', { id: styleId }, [`
13
+ .aw-diag { display:flex; flex-direction:column; gap:8px; font-size:12px; }
14
+ .aw-diag-toolbar { display:flex; justify-content:flex-end; }
15
+ .aw-diag-btn { padding:4px 12px; border:1px solid color-mix(in srgb, currentColor 28%, transparent); border-radius:7px; background:transparent; color:inherit; cursor:pointer; }
16
+ .aw-diag-btn:disabled { opacity:.45; cursor:default; }
17
+ .aw-diag-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
18
+ .aw-diag-table { width:100%; border-collapse:collapse; min-width:540px; }
19
+ .aw-diag-table th, .aw-diag-table td { text-align:left; padding:5px 8px; border-bottom:1px solid color-mix(in srgb, currentColor 10%, transparent); white-space:nowrap; }
20
+ .aw-diag-table th { opacity:.65; font-weight:500; }
21
+ .aw-diag-st { display:inline-flex; align-items:center; gap:5px; }
22
+ .aw-diag-dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
23
+ .aw-diag-dot-running { background:#41c8f4; }
24
+ .aw-diag-dot-completed { background:#35e0a0; }
25
+ .aw-diag-dot-failed, .aw-diag-dot-stopped { background:#e05a5a; }
26
+ .aw-diag-dot-na { background:#9aa4ad; }
27
+ .aw-diag-empty { opacity:.6; padding:8px 0; }
28
+ .aw-diag-status { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
29
+ .aw-diag-check { padding:8px 10px; border:1px dashed color-mix(in srgb, currentColor 20%, transparent); border-radius:8px; display:flex; flex-direction:column; gap:5px; }
30
+ .aw-diag-check-rows { display:flex; flex-direction:column; gap:3px; }
31
+ .aw-diag-check-row { display:flex; gap:6px; align-items:baseline; flex-wrap:wrap; }
32
+ .aw-diag-check-k { opacity:.65; min-width:86px; }
33
+ .aw-diag-check-err { color:#e05a5a; }
34
+ .aw-diag-check-ok { color:#35e0a0; }
35
+ .aw-diag-modal { position:fixed; inset:0; z-index:9999; background:rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; }
36
+ .aw-diag-modal-box { width:min(860px, 92vw); max-height:84vh; display:flex; flex-direction:column; gap:8px; background:var(--aw-bg, #101826); color:inherit; border:1px solid color-mix(in srgb, currentColor 22%, transparent); border-radius:12px; padding:14px 16px; }
37
+ .aw-diag-modal-head { display:flex; align-items:center; justify-content:space-between; gap:12px; font-weight:600; }
38
+ .aw-diag-report { flex:1; overflow:auto; white-space:pre-wrap; font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:12px; line-height:1.6; }
39
+ `]))
40
+ }
41
+
42
+ ctx.ui.registerPanel({
43
+ slot: 'plugins.page',
44
+ name: 'diag-runs',
45
+ titleKey: 'panel.title',
46
+ order: 20,
47
+ mount(el) {
48
+ const t = k => ctx.t(`panel.${k}`)
49
+ const timer = setInterval(() => {
50
+ void load()
51
+ void refreshStatus()
52
+ }, 30_000)
53
+ const table = ctx.el('div', { class: 'aw-diag-table-wrap' })
54
+
55
+ function dot(ok, na = false) {
56
+ return ctx.el('span', {
57
+ class: `aw-diag-dot ${na ? 'aw-diag-dot-na' : ok ? 'aw-diag-dot-completed' : 'aw-diag-dot-failed'}`,
58
+ title: na ? t('tokenUnknown') : ok ? t('ok') : t('bad'),
59
+ })
60
+ }
61
+
62
+ // ---- 连接状态行(30s 轮询) + 「检测连接」显式检测(宿主后端会拿用户配置的 token 实测受保护端点) ----
63
+ const remoteCell = ctx.el('span', { class: 'aw-diag-st' }, [dot(false), ` ${t('remote')}: -`])
64
+ const tokenCell = ctx.el('span', { class: 'aw-diag-st' }, [dot(false, true), ` ${t('tokenCfg')}: -`])
65
+ const engineCell = ctx.el('span', { class: 'aw-diag-st faint' }, [` ${t('engine')}: -`])
66
+ const statusRow = ctx.el('div', { class: 'aw-diag-status' }, [remoteCell, tokenCell, engineCell])
67
+
68
+ const checkBtn = ctx.el('button', { class: 'aw-diag-btn' }, [t('checkBtn')])
69
+ const checkRows = ctx.el('div', { class: 'aw-diag-check-rows' })
70
+ const checkBox = ctx.el('div', { class: 'aw-diag-check' }, [checkRows])
71
+ checkBtn.addEventListener('click', () => void runCheck())
72
+
73
+ /** 检测明细行:true 绿 / false 红 / null 灰 */
74
+ function checkRow(label, okState, value) {
75
+ const val = ctx.el('span')
76
+ for (const seg of (Array.isArray(value) ? value : [{ text: String(value) }])) {
77
+ val.append(ctx.el('span', { class: seg.cls ?? '' }, [String(seg.text)]))
78
+ }
79
+ return ctx.el('div', { class: 'aw-diag-check-row' }, [
80
+ ctx.el('span', { class: 'aw-diag-check-k' }, [label]),
81
+ dot(okState === true, okState == null),
82
+ val,
83
+ ])
84
+ }
85
+
86
+ /** token 三态文案 */
87
+ const tokenText = tk => !tk?.configured
88
+ ? t('tokenNone')
89
+ : tk?.accepted === true ? t('tokenAccepted') : tk?.accepted === false ? t('tokenRejected') : t('tokenUnknown')
90
+
91
+ async function runCheck() {
92
+ checkBtn.disabled = true
93
+ checkBtn.textContent = t('checking')
94
+ const t0 = Date.now()
95
+ const h = await ctx.fetch('/api/plugins/diag-bridge/health').catch(() => null)
96
+ const ms = Date.now() - t0
97
+ const rows = []
98
+ if (!h) {
99
+ rows.push(checkRow(t('checkBtn'), false, [{ text: t('checkFail'), cls: 'aw-diag-check-err' }]))
100
+ }
101
+ else {
102
+ const remote = h?.remote ?? {}
103
+ const rOk = remote?.status === 'ok'
104
+ rows.push(checkRow(t('remote'), rOk, [
105
+ { text: `${h?.base ?? '-'} · ${remote?.status ?? '-'}`, cls: rOk ? '' : 'aw-diag-check-err' },
106
+ ...(remote?.auth ? [{ text: ` · auth=${remote.auth}`, cls: /被拒|401|403/.test(String(remote.auth)) ? 'aw-diag-check-err' : '' }] : []),
107
+ ...(remote?.error ? [{ text: ` · ${remote.error}`, cls: 'aw-diag-check-err' }] : []),
108
+ ]))
109
+ const tk = h?.token ?? {}
110
+ rows.push(checkRow(t('tokenCfg'), tk?.configured ? tk?.accepted : null,
111
+ [{ text: tokenText(tk), cls: tk?.accepted === false ? 'aw-diag-check-err' : '' },
112
+ ...(tk?.hint ? [{ text: ` · ${tk.hint}`, cls: 'aw-diag-check-err' }] : []),
113
+ ...(h?.auth ? [{ text: ` · ${h.auth === 'bearer' ? t('bearer') : t('anonymous')}` }] : [])]))
114
+ rows.push(checkRow(t('engine'), true, [{ text: String(h?.harness ?? '-') }]))
115
+ const by = h?.runs?.byStatus ?? {}
116
+ rows.push(checkRow(t('runs'), true, [{ text: `${h?.runs?.total ?? 0} (completed ${by.completed ?? 0} / running ${by.running ?? 0} / failed ${by.failed ?? 0})` }]))
117
+ const allOk = rOk && tk?.accepted !== false
118
+ rows.push(ctx.el('div', { class: 'aw-diag-check-row' }, [
119
+ ctx.el('span', { class: allOk ? 'aw-diag-check-ok' : 'aw-diag-check-err' },
120
+ [allOk ? `✔ ${t('allOk')}` : `✖ ${t('allBad')}`]),
121
+ ctx.el('span', { class: 'faint' }, [` · ${t('latency')} ${ms}ms`]),
122
+ ]))
123
+ }
124
+ checkRows.replaceChildren(...rows)
125
+ checkBtn.disabled = false
126
+ checkBtn.textContent = t('checkBtn')
127
+ }
128
+
129
+ async function refreshStatus() {
130
+ const h = await ctx.fetch('/api/plugins/diag-bridge/health').catch(() => null)
131
+ const remote = h?.remote ?? {}
132
+ const rOk = remote?.status === 'ok'
133
+ remoteCell.replaceChildren(dot(rOk), ` ${t('remote')}: ${remote?.status ?? '-'}${remote?.auth ? `(${remote.auth})` : ''}`)
134
+ const tk = h?.token ?? {}
135
+ tokenCell.replaceChildren(dot(tk?.configured ? tk?.accepted === true : false, !tk?.configured), ` ${t('tokenCfg')}: ${tokenText(tk)}`)
136
+ engineCell.replaceChildren(` ${t('engine')}: ${h?.harness ?? '-'}`)
137
+ }
138
+
139
+ el.append(ctx.el('div', { class: 'aw-diag' }, [
140
+ statusRow,
141
+ ctx.el('div', { class: 'aw-diag-toolbar' }, [
142
+ checkBtn,
143
+ ctx.el('button', { class: 'aw-diag-btn', onclick: () => void load() }, [t('refresh')]),
144
+ ]),
145
+ checkBox,
146
+ table,
147
+ ]))
148
+
149
+ const statusOf = (s) => {
150
+ const key = ['running', 'completed', 'failed', 'stopped'].includes(s) ? s : 'other'
151
+ return ctx.el('span', { class: 'aw-diag-st' }, [
152
+ ctx.el('span', { class: `aw-diag-dot aw-diag-dot-${key}` }),
153
+ t(`st_${key}`),
154
+ ])
155
+ }
156
+
157
+ // 报告查看:拉 /report 路由,弹层渲染 report md 全文
158
+ async function showReport(runId, btn) {
159
+ const modal = ctx.el('div', { class: 'aw-diag-modal' }, [
160
+ ctx.el('div', { class: 'aw-diag-modal-box' }, [
161
+ ctx.el('div', { class: 'aw-diag-modal-head' }, [
162
+ ctx.el('span', {}, [`${t('report')} · ${runId}`]),
163
+ ctx.el('button', { class: 'aw-diag-btn', onclick: () => modal.remove() }, [t('close')]),
164
+ ]),
165
+ ctx.el('div', { class: 'aw-diag-report' }, [t('loading')]),
166
+ ]),
167
+ ])
168
+ modal.addEventListener('click', (e) => {
169
+ if (e.target === modal) modal.remove()
170
+ })
171
+ document.body.append(modal)
172
+ const box = modal.querySelector('.aw-diag-report')
173
+ try {
174
+ const r = await ctx.fetch(`/api/plugins/diag-bridge/report?run_id=${encodeURIComponent(runId)}`)
175
+ if (!r?.success) throw new Error(r?.error || `HTTP error(${runId})`)
176
+ const rep = r.report ?? {}
177
+ box.textContent = typeof rep === 'string' ? rep : String(rep.content ?? JSON.stringify(rep, null, 2))
178
+ }
179
+ catch (err) {
180
+ box.textContent = `${t('report_fail')}: ${err?.message ?? err}`
181
+ }
182
+ finally {
183
+ if (btn) btn.disabled = false
184
+ }
185
+ }
186
+
187
+ async function load() {
188
+ const r = await ctx.fetch('/api/plugins/diag-bridge/runs').catch(() => null)
189
+ const runs = Array.isArray(r?.runs) ? r.runs.slice(0, 8) : []
190
+ if (!runs.length) {
191
+ table.replaceChildren(ctx.el('div', { class: 'aw-diag-empty' }, [t('none')]))
192
+ return
193
+ }
194
+ const thead = ctx.el('tr', {}, [
195
+ ctx.el('th', {}, [t('run')]),
196
+ ctx.el('th', {}, [t('line')]),
197
+ ctx.el('th', {}, [t('status')]),
198
+ ctx.el('th', {}, [t('score')]),
199
+ ctx.el('th', {}, [t('stored')]),
200
+ ctx.el('th', {}, [t('report')]),
201
+ ])
202
+ const tbody = ctx.el('tbody')
203
+ for (const run of runs) {
204
+ const isDone = String(run.status ?? '') === 'completed'
205
+ const btn = isDone
206
+ ? ctx.el('button', {
207
+ class: 'aw-diag-btn',
208
+ onclick: () => {
209
+ btn.disabled = true
210
+ void showReport(String(run.runId), btn)
211
+ },
212
+ }, [t('view')])
213
+ : ctx.el('span', { style: 'opacity:.4' }, ['-'])
214
+ tbody.append(ctx.el('tr', {}, [
215
+ ctx.el('td', { class: 'aw-mono' }, [String(run.runId ?? '-')]),
216
+ ctx.el('td', {}, [String(run.line ?? '-')]),
217
+ ctx.el('td', {}, [statusOf(String(run.status ?? ''))]),
218
+ ctx.el('td', {}, [run.score != null ? String(run.score) : '-']),
219
+ ctx.el('td', {}, [run.stored === true ? t('yes') : t('no')]),
220
+ ctx.el('td', {}, [btn]),
221
+ ]))
222
+ }
223
+ table.replaceChildren(ctx.el('table', { class: 'aw-diag-table' }, [ctx.el('thead', {}, [thead]), tbody]))
224
+ }
225
+
226
+ void load()
227
+ void refreshStatus()
228
+ // 语言切换 → 重渲染(标题由插槽响应式解析,表格文案在此重取)
229
+ const offLocale = ctx.hooks.on('i18n:changed', () => {
230
+ void load()
231
+ void refreshStatus()
232
+ })
233
+ return () => {
234
+ clearInterval(timer)
235
+ offLocale()
236
+ }
237
+ },
238
+ })
239
+ }
240
+
241
+ // ══ 第二面板:分析结果库(§16;经插件路由代理,同源同开关) ══════════════════════
242
+ export function setupResults(ctx) {
243
+ ctx.ui.registerPanel({
244
+ slot: 'plugins.page',
245
+ name: 'diag-results',
246
+ titleKey: 'panel_results.title',
247
+ order: 21,
248
+ mount(el) {
249
+ const t = k => ctx.t(`panel_results.${k}`)
250
+ const box = ctx.el('div', { class: 'aw-diag' })
251
+ const state = { list: null, total: 0, detail: null, editing: false, error: '', canAnnotate: false }
252
+
253
+ const searchInput = ctx.el('input', { type: 'search', placeholder: t('search'), style: 'min-width:220px;padding:4px 8px;border-radius:7px;border:1px solid color-mix(in srgb,currentColor 25%,transparent);background:transparent;color:inherit' })
254
+ const intentSel = ctx.el('select', { style: 'padding:4px;border-radius:7px;border:1px solid color-mix(in srgb,currentColor 25%,transparent);background:transparent;color:inherit' }, [
255
+ ctx.el('option', { value: '' }, [t('allIntents')]),
256
+ ...['deep-diagnosis', 'stability-report', 'quick-screen', 'doe-analysis', 'experience-mining', 'optimizer-campaign'].map(v => ctx.el('option', { value: v }, [v])),
257
+ ])
258
+ const searchBtn = ctx.el('button', { class: 'aw-diag-btn' }, [t('searchBtn')])
259
+ const statusLine = ctx.el('div', { class: 'aw-diag-empty' })
260
+ const listWrap = ctx.el('div', { class: 'aw-diag-table-wrap' })
261
+ box.append(
262
+ ctx.el('div', { class: 'aw-diag-toolbar', style: 'justify-content:flex-start;gap:8px;flex-wrap:wrap' }, [searchInput, intentSel, searchBtn]),
263
+ statusLine,
264
+ listWrap,
265
+ )
266
+
267
+ function setError(msg) {
268
+ statusLine.textContent = ''
269
+ listWrap.replaceChildren(ctx.el('div', { class: 'aw-diag-empty' }, [msg]))
270
+ }
271
+
272
+ async function load() {
273
+ const qs = new URLSearchParams({ brief: 'false', limit: '20' })
274
+ const q = String(searchInput.value ?? '').trim()
275
+ if (q) qs.set('q', q)
276
+ const intent = String(intentSel.value ?? '')
277
+ if (intent) qs.set('intent', intent)
278
+ const r = await ctx.fetch(`/api/plugins/diag-bridge/results?${qs.toString()}`).catch(err => ({ __err: String(err?.message ?? err) }))
279
+ if (r?.__err) {
280
+ setError(`${t('loadFail')}: ${r.__err}`)
281
+ return
282
+ }
283
+ if (r?.success === false) {
284
+ setError(String(r?.error ?? t('loadFail')))
285
+ return
286
+ }
287
+ const d = r?.data ?? {}
288
+ state.list = d.results ?? []
289
+ state.total = d.total ?? 0
290
+ statusLine.textContent = t('total').replace('{n}', String(state.total))
291
+ renderList()
292
+ // annotate 能力探测:设置不可见,尝试 PATCH 一个非法体(400 即代表开放)
293
+ }
294
+
295
+ function renderList() {
296
+ if (!state.list?.length) {
297
+ listWrap.replaceChildren(ctx.el('div', { class: 'aw-diag-empty' }, [t('empty')]))
298
+ return
299
+ }
300
+ const table = ctx.el('table', { class: 'aw-diag-table' })
301
+ table.append(ctx.el('tr', {}, [t('colId'), t('colTitle'), t('colIntent'), t('colScore'), t('colVerdict'), t('colCreated'), t('colTags')].map(h => ctx.el('th', {}, [h]))))
302
+ for (const c of state.list) {
303
+ const tr = ctx.el('tr', { style: 'cursor:pointer' })
304
+ for (const text of [c.result_id, c.title, c.intent, String(c.score ?? '-'), String(c.verdict ?? '-'), String(c.completed_at ?? c.created_at ?? '-'), (c.tags ?? []).join(',')]) {
305
+ tr.append(ctx.el('td', {}, [String(text)]))
306
+ }
307
+ tr.addEventListener('click', () => void openDetail(String(c.result_id)))
308
+ table.append(tr)
309
+ }
310
+ listWrap.replaceChildren(table)
311
+ }
312
+
313
+ async function openDetail(id) {
314
+ const r = await ctx.fetch(`/api/plugins/diag-bridge/results/detail?id=${encodeURIComponent(id)}&include_md=true`).catch(() => null)
315
+ if (!r || r?.success === false) {
316
+ setError(String(r?.error ?? t('loadFail')))
317
+ return
318
+ }
319
+ state.detail = r.data
320
+ renderDetail()
321
+ }
322
+
323
+ function renderDetail() {
324
+ const d = state.detail
325
+ if (!d) return
326
+ const closeBtn = ctx.el('button', { class: 'aw-diag-btn' }, [t('close')])
327
+ closeBtn.addEventListener('click', () => {
328
+ state.detail = null
329
+ state.editing = false
330
+ renderList()
331
+ })
332
+ const boxD = ctx.el('div', { class: 'aw-diag', style: 'gap:10px' })
333
+ const head = ctx.el('div', { class: 'aw-diag-modal-head' }, [`${d.result_id} · ${d.title ?? ''} · ${d.intent ?? ''} · ${d.score ?? '-'}分 ${d.verdict ?? ''}`, closeBtn])
334
+ const summary = ctx.el('div', { style: 'white-space:pre-wrap;max-height:120px;overflow:auto' }, [String(d.summary ?? '')])
335
+ const kn = d.summary_json?.key_numbers ? ctx.el('div', { class: 'aw-diag-check-row' }, [ctx.el('span', { class: 'aw-diag-check-k' }, [t('keyNumbers')]), JSON.stringify(d.summary_json.key_numbers)]) : null
336
+ const htmlLinks = ctx.el('div', { class: 'aw-diag-check-row' }, [ctx.el('span', { class: 'aw-diag-check-k' }, [t('htmlReports')]),
337
+ ...(d.files?.html ?? []).slice(0, 6).map(h => ctx.el('a', { href: h.url, target: '_blank', style: 'margin-right:10px' }, [String(h.path ?? 'html')]))])
338
+ const md = ctx.el('details', {}, [ctx.el('summary', {}, [t('reportMd')]), ctx.el('div', { class: 'aw-diag-report', style: 'max-height:280px' }, [String(d.report_md ?? '(include_md 未开启或无内容)')])])
339
+ boxD.append(head, summary)
340
+ if (kn) boxD.append(kn)
341
+ boxD.append(htmlLinks, md)
342
+ // 编辑区(仅当尝试 annotate 成功可见;失败显示只读)
343
+ const descInput = ctx.el('textarea', { rows: 3, style: 'width:100%;border-radius:7px;border:1px solid color-mix(in srgb,currentColor 25%,transparent);background:transparent;color:inherit' })
344
+ descInput.value = String(d.description ?? '')
345
+ const tagsInput = ctx.el('input', { type: 'text', style: 'width:100%;padding:4px 8px;border-radius:7px;border:1px solid color-mix(in srgb,currentColor 25%,transparent);background:transparent;color:inherit' })
346
+ tagsInput.value = (d.tags ?? []).join(',')
347
+ const saveBtn = ctx.el('button', { class: 'aw-diag-btn' }, [t('save')])
348
+ const saveMsg = ctx.el('span', { class: 'aw-diag-empty' })
349
+ saveBtn.addEventListener('click', async () => {
350
+ saveBtn.disabled = true
351
+ saveMsg.textContent = t('loading')
352
+ const tags = String(tagsInput.value).split(',').map(s => s.trim()).filter(Boolean)
353
+ const r = await ctx.fetch(`/api/plugins/diag-bridge/results/edit?id=${encodeURIComponent(d.result_id)}`, {
354
+ method: 'PATCH',
355
+ body: { description: descInput.value, tags },
356
+ }).catch(err => ({ success: false, error: String(err?.message ?? err) }))
357
+ saveBtn.disabled = false
358
+ if (r?.success) {
359
+ saveMsg.textContent = t('saved')
360
+ state.detail = r.data
361
+ renderDetail()
362
+ void load()
363
+ }
364
+ else {
365
+ saveMsg.textContent = `${t('saveFail')}: ${String(r?.error ?? '')}`
366
+ if (String(r?.error ?? '').includes('未开放')) state.canAnnotate = false
367
+ }
368
+ })
369
+ const editBox = ctx.el('div', { class: 'aw-diag-check' }, [
370
+ ctx.el('div', {}, [t('edit')]),
371
+ ctx.el('label', { style: 'display:block;margin:4px 0' }, [t('editDesc')]),
372
+ descInput,
373
+ ctx.el('label', { style: 'display:block;margin:6px 0 4px' }, [t('editTags')]),
374
+ tagsInput,
375
+ ctx.el('div', { style: 'margin-top:8px;display:flex;gap:8px;align-items:center' }, [saveBtn, saveMsg]),
376
+ ])
377
+ boxD.append(editBox)
378
+ listWrap.replaceChildren(boxD)
379
+ }
380
+
381
+ searchBtn.addEventListener('click', () => void load())
382
+ searchInput.addEventListener('keydown', (e) => {
383
+ if (e.key === 'Enter') void load()
384
+ })
385
+ el.append(box)
386
+ void load()
387
+ return () => {}
388
+ },
389
+ })
390
+ }