@recombine-ai/bosun 0.3.7 → 0.3.10

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 (462) hide show
  1. package/build/client/_app/immutable/assets/0.CJ5NCdBm.css +1 -0
  2. package/build/client/_app/immutable/assets/0.CJ5NCdBm.css.br +0 -0
  3. package/build/client/_app/immutable/assets/0.CJ5NCdBm.css.gz +0 -0
  4. package/build/client/_app/immutable/assets/2.DxwYfh1z.css +1 -0
  5. package/build/client/_app/immutable/assets/2.DxwYfh1z.css.br +0 -0
  6. package/build/client/_app/immutable/assets/2.DxwYfh1z.css.gz +0 -0
  7. package/build/client/_app/immutable/assets/7.DlSPCZj0.css +1 -0
  8. package/build/client/_app/immutable/assets/7.DlSPCZj0.css.br +0 -0
  9. package/build/client/_app/immutable/assets/7.DlSPCZj0.css.gz +0 -0
  10. package/build/client/_app/immutable/assets/8.BX46PfEJ.css +1 -0
  11. package/build/client/_app/immutable/assets/8.BX46PfEJ.css.br +0 -0
  12. package/build/client/_app/immutable/assets/8.BX46PfEJ.css.gz +0 -0
  13. package/build/client/_app/immutable/assets/{AgentSidebar.QeNZJtLq.css → AgentSidebar.BL1i3rB_.css} +1 -1
  14. package/build/client/_app/immutable/assets/AgentSidebar.BL1i3rB_.css.br +0 -0
  15. package/build/client/_app/immutable/assets/AgentSidebar.BL1i3rB_.css.gz +0 -0
  16. package/build/client/_app/immutable/assets/Tab.DlCfjMY1.css +1 -0
  17. package/build/client/_app/immutable/assets/Tab.DlCfjMY1.css.br +0 -0
  18. package/build/client/_app/immutable/assets/Tab.DlCfjMY1.css.gz +0 -0
  19. package/build/client/_app/immutable/chunks/{BHL1bMOV.js → BNoAJ1Rf.js} +1 -1
  20. package/build/client/_app/immutable/chunks/BNoAJ1Rf.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/BNoAJ1Rf.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/BVDwc-2z.js +1 -0
  23. package/build/client/_app/immutable/chunks/BVDwc-2z.js.br +0 -0
  24. package/build/client/_app/immutable/chunks/BVDwc-2z.js.gz +0 -0
  25. package/build/client/_app/immutable/chunks/BXkrt826.js +1 -0
  26. package/build/client/_app/immutable/chunks/BXkrt826.js.br +0 -0
  27. package/build/client/_app/immutable/chunks/BXkrt826.js.gz +0 -0
  28. package/build/client/_app/immutable/chunks/{Cx_xzGPa.js → Bdb5tyDH.js} +1 -1
  29. package/build/client/_app/immutable/chunks/Bdb5tyDH.js.br +0 -0
  30. package/build/client/_app/immutable/chunks/Bdb5tyDH.js.gz +0 -0
  31. package/build/client/_app/immutable/chunks/{DaRvw8c-.js → BfHUxT3G.js} +7 -7
  32. package/build/client/_app/immutable/chunks/BfHUxT3G.js.br +0 -0
  33. package/build/client/_app/immutable/chunks/BfHUxT3G.js.gz +0 -0
  34. package/build/client/_app/immutable/chunks/{CRlLKhPr.js → Bk1rEq7o.js} +1 -1
  35. package/build/client/_app/immutable/chunks/Bk1rEq7o.js.br +0 -0
  36. package/build/client/_app/immutable/chunks/Bk1rEq7o.js.gz +0 -0
  37. package/build/client/_app/immutable/chunks/BkclRFLx.js +3 -0
  38. package/build/client/_app/immutable/chunks/BkclRFLx.js.br +0 -0
  39. package/build/client/_app/immutable/chunks/BkclRFLx.js.gz +0 -0
  40. package/build/client/_app/immutable/chunks/{DJ_lsF0V.js → BnxfhlSj.js} +1 -1
  41. package/build/client/_app/immutable/chunks/BnxfhlSj.js.br +0 -0
  42. package/build/client/_app/immutable/chunks/BnxfhlSj.js.gz +0 -0
  43. package/build/client/_app/immutable/chunks/BqROrg0C.js +1 -0
  44. package/build/client/_app/immutable/chunks/BqROrg0C.js.br +0 -0
  45. package/build/client/_app/immutable/chunks/BqROrg0C.js.gz +0 -0
  46. package/build/client/_app/immutable/chunks/{C769zFCl.js → ByQey8Oa.js} +1 -1
  47. package/build/client/_app/immutable/chunks/ByQey8Oa.js.br +0 -0
  48. package/build/client/_app/immutable/chunks/ByQey8Oa.js.gz +0 -0
  49. package/build/client/_app/immutable/chunks/CFwu9ET3.js +1 -0
  50. package/build/client/_app/immutable/chunks/CFwu9ET3.js.br +0 -0
  51. package/build/client/_app/immutable/chunks/CFwu9ET3.js.gz +0 -0
  52. package/build/client/_app/immutable/chunks/{D5fGPlBk.js → CIIE25ox.js} +1 -1
  53. package/build/client/_app/immutable/chunks/CIIE25ox.js.br +0 -0
  54. package/build/client/_app/immutable/chunks/CIIE25ox.js.gz +0 -0
  55. package/build/client/_app/immutable/chunks/{DAfsp-82.js → CNMNmz2q.js} +1 -1
  56. package/build/client/_app/immutable/chunks/CNMNmz2q.js.br +0 -0
  57. package/build/client/_app/immutable/chunks/CNMNmz2q.js.gz +0 -0
  58. package/build/client/_app/immutable/chunks/CNvyTQrC.js +1 -0
  59. package/build/client/_app/immutable/chunks/CNvyTQrC.js.br +2 -0
  60. package/build/client/_app/immutable/chunks/CNvyTQrC.js.gz +0 -0
  61. package/build/client/_app/immutable/chunks/CVHvdSBf.js +1 -0
  62. package/build/client/_app/immutable/chunks/CVHvdSBf.js.br +0 -0
  63. package/build/client/_app/immutable/chunks/CVHvdSBf.js.gz +0 -0
  64. package/build/client/_app/immutable/chunks/CYiRxJxs.js +1 -0
  65. package/build/client/_app/immutable/chunks/CYiRxJxs.js.br +0 -0
  66. package/build/client/_app/immutable/chunks/CYiRxJxs.js.gz +0 -0
  67. package/build/client/_app/immutable/chunks/CZPhtqrs.js +8 -0
  68. package/build/client/_app/immutable/chunks/CZPhtqrs.js.br +0 -0
  69. package/build/client/_app/immutable/chunks/CZPhtqrs.js.gz +0 -0
  70. package/build/client/_app/immutable/chunks/{CRTtd6by.js → CdzpH-Ca.js} +1 -1
  71. package/build/client/_app/immutable/chunks/CdzpH-Ca.js.br +0 -0
  72. package/build/client/_app/immutable/chunks/CdzpH-Ca.js.gz +0 -0
  73. package/build/client/_app/immutable/chunks/Cf8q8_nj.js +1 -0
  74. package/build/client/_app/immutable/chunks/Cf8q8_nj.js.br +0 -0
  75. package/build/client/_app/immutable/chunks/Cf8q8_nj.js.gz +0 -0
  76. package/build/client/_app/immutable/chunks/Cg3F7Z11.js +1 -0
  77. package/build/client/_app/immutable/chunks/Cg3F7Z11.js.br +0 -0
  78. package/build/client/_app/immutable/chunks/Cg3F7Z11.js.gz +0 -0
  79. package/build/client/_app/immutable/chunks/CpSIcnXs.js +1 -0
  80. package/build/client/_app/immutable/chunks/CpSIcnXs.js.br +0 -0
  81. package/build/client/_app/immutable/chunks/CpSIcnXs.js.gz +0 -0
  82. package/build/client/_app/immutable/chunks/{Codln_pl.js → Ct9HfpvA.js} +1 -1
  83. package/build/client/_app/immutable/chunks/Ct9HfpvA.js.br +0 -0
  84. package/build/client/_app/immutable/chunks/Ct9HfpvA.js.gz +0 -0
  85. package/build/client/_app/immutable/chunks/DJPBfZIx.js +1 -0
  86. package/build/client/_app/immutable/chunks/DJPBfZIx.js.br +0 -0
  87. package/build/client/_app/immutable/chunks/DJPBfZIx.js.gz +0 -0
  88. package/build/client/_app/immutable/chunks/{BOQMymse.js → DOatwnEt.js} +1 -1
  89. package/build/client/_app/immutable/chunks/DOatwnEt.js.br +0 -0
  90. package/build/client/_app/immutable/chunks/DOatwnEt.js.gz +0 -0
  91. package/build/client/_app/immutable/chunks/DQqJYxgt.js +1 -0
  92. package/build/client/_app/immutable/chunks/DQqJYxgt.js.br +0 -0
  93. package/build/client/_app/immutable/chunks/DQqJYxgt.js.gz +0 -0
  94. package/build/client/_app/immutable/chunks/{Culo9hD6.js → DSfxalyG.js} +1 -1
  95. package/build/client/_app/immutable/chunks/DSfxalyG.js.br +0 -0
  96. package/build/client/_app/immutable/chunks/DSfxalyG.js.gz +0 -0
  97. package/build/client/_app/immutable/chunks/Djx0Ybbq.js +8 -0
  98. package/build/client/_app/immutable/chunks/Djx0Ybbq.js.br +0 -0
  99. package/build/client/_app/immutable/chunks/Djx0Ybbq.js.gz +0 -0
  100. package/build/client/_app/immutable/chunks/Drkf9Bgr.js +33 -0
  101. package/build/client/_app/immutable/chunks/Drkf9Bgr.js.br +0 -0
  102. package/build/client/_app/immutable/chunks/Drkf9Bgr.js.gz +0 -0
  103. package/build/client/_app/immutable/chunks/DujX6kBV.js +2 -0
  104. package/build/client/_app/immutable/chunks/DujX6kBV.js.br +0 -0
  105. package/build/client/_app/immutable/chunks/DujX6kBV.js.gz +0 -0
  106. package/build/client/_app/immutable/chunks/{4PztAao_.js → HPBQctDD.js} +1 -1
  107. package/build/client/_app/immutable/chunks/HPBQctDD.js.br +0 -0
  108. package/build/client/_app/immutable/chunks/HPBQctDD.js.gz +0 -0
  109. package/build/client/_app/immutable/chunks/Jaf1TUfw.js +1 -0
  110. package/build/client/_app/immutable/chunks/Jaf1TUfw.js.br +2 -0
  111. package/build/client/_app/immutable/chunks/Jaf1TUfw.js.gz +0 -0
  112. package/build/client/_app/immutable/chunks/{yOR3vtRx.js → KDW88ZZa.js} +1 -1
  113. package/build/client/_app/immutable/chunks/KDW88ZZa.js.br +0 -0
  114. package/build/client/_app/immutable/chunks/KDW88ZZa.js.gz +0 -0
  115. package/build/client/_app/immutable/chunks/{CfKHaDCm.js → TO5ESkEd.js} +1 -1
  116. package/build/client/_app/immutable/chunks/TO5ESkEd.js.br +0 -0
  117. package/build/client/_app/immutable/chunks/TO5ESkEd.js.gz +0 -0
  118. package/build/client/_app/immutable/chunks/axPa8Xqj.js +1 -0
  119. package/build/client/_app/immutable/chunks/axPa8Xqj.js.br +0 -0
  120. package/build/client/_app/immutable/chunks/axPa8Xqj.js.gz +0 -0
  121. package/build/client/_app/immutable/chunks/mbM5jWoB.js +4 -0
  122. package/build/client/_app/immutable/chunks/mbM5jWoB.js.br +0 -0
  123. package/build/client/_app/immutable/chunks/mbM5jWoB.js.gz +0 -0
  124. package/build/client/_app/immutable/chunks/{Bw2f0Pmg.js → oeB0PCTX.js} +1 -1
  125. package/build/client/_app/immutable/chunks/oeB0PCTX.js.br +0 -0
  126. package/build/client/_app/immutable/chunks/oeB0PCTX.js.gz +0 -0
  127. package/build/client/_app/immutable/chunks/{qXu78w_4.js → rtsVMmSs.js} +1 -1
  128. package/build/client/_app/immutable/chunks/rtsVMmSs.js.br +0 -0
  129. package/build/client/_app/immutable/chunks/rtsVMmSs.js.gz +0 -0
  130. package/build/client/_app/immutable/chunks/trViNh3G.js +1 -0
  131. package/build/client/_app/immutable/chunks/trViNh3G.js.br +0 -0
  132. package/build/client/_app/immutable/chunks/trViNh3G.js.gz +0 -0
  133. package/build/client/_app/immutable/chunks/yWz0pZR0.js +1 -0
  134. package/build/client/_app/immutable/chunks/yWz0pZR0.js.br +0 -0
  135. package/build/client/_app/immutable/chunks/yWz0pZR0.js.gz +0 -0
  136. package/build/client/_app/immutable/entry/app.Bf26VmYF.js +2 -0
  137. package/build/client/_app/immutable/entry/app.Bf26VmYF.js.br +0 -0
  138. package/build/client/_app/immutable/entry/app.Bf26VmYF.js.gz +0 -0
  139. package/build/client/_app/immutable/entry/start.B7gGsWVa.js +1 -0
  140. package/build/client/_app/immutable/entry/start.B7gGsWVa.js.br +2 -0
  141. package/build/client/_app/immutable/entry/start.B7gGsWVa.js.gz +0 -0
  142. package/build/client/_app/immutable/nodes/0.DzfWS9dq.js +3 -0
  143. package/build/client/_app/immutable/nodes/0.DzfWS9dq.js.br +0 -0
  144. package/build/client/_app/immutable/nodes/0.DzfWS9dq.js.gz +0 -0
  145. package/build/client/_app/immutable/nodes/1.DXQZr-dH.js +1 -0
  146. package/build/client/_app/immutable/nodes/1.DXQZr-dH.js.br +0 -0
  147. package/build/client/_app/immutable/nodes/1.DXQZr-dH.js.gz +0 -0
  148. package/build/client/_app/immutable/nodes/10.BHSGZYEC.js +1 -0
  149. package/build/client/_app/immutable/nodes/10.BHSGZYEC.js.br +0 -0
  150. package/build/client/_app/immutable/nodes/10.BHSGZYEC.js.gz +0 -0
  151. package/build/client/_app/immutable/nodes/11.CZ_7M4AF.js +1 -0
  152. package/build/client/_app/immutable/nodes/11.CZ_7M4AF.js.br +0 -0
  153. package/build/client/_app/immutable/nodes/11.CZ_7M4AF.js.gz +0 -0
  154. package/build/client/_app/immutable/nodes/12.DRr2l3NZ.js +1 -0
  155. package/build/client/_app/immutable/nodes/12.DRr2l3NZ.js.br +2 -0
  156. package/build/client/_app/immutable/nodes/12.DRr2l3NZ.js.gz +0 -0
  157. package/build/client/_app/immutable/nodes/13.DaAF9e8t.js +1 -0
  158. package/build/client/_app/immutable/nodes/13.DaAF9e8t.js.br +0 -0
  159. package/build/client/_app/immutable/nodes/13.DaAF9e8t.js.gz +0 -0
  160. package/build/client/_app/immutable/nodes/14.f9d5b8IR.js +11 -0
  161. package/build/client/_app/immutable/nodes/14.f9d5b8IR.js.br +0 -0
  162. package/build/client/_app/immutable/nodes/14.f9d5b8IR.js.gz +0 -0
  163. package/build/client/_app/immutable/nodes/2.pYR7L1PM.js +35 -0
  164. package/build/client/_app/immutable/nodes/2.pYR7L1PM.js.br +0 -0
  165. package/build/client/_app/immutable/nodes/2.pYR7L1PM.js.gz +0 -0
  166. package/build/client/_app/immutable/nodes/3.D-_vDp-o.js +1 -0
  167. package/build/client/_app/immutable/nodes/3.D-_vDp-o.js.br +0 -0
  168. package/build/client/_app/immutable/nodes/3.D-_vDp-o.js.gz +0 -0
  169. package/build/client/_app/immutable/nodes/{3.C-B1sGi_.js → 4.DylMSvDw.js} +1 -1
  170. package/build/client/_app/immutable/nodes/4.DylMSvDw.js.br +0 -0
  171. package/build/client/_app/immutable/nodes/4.DylMSvDw.js.gz +0 -0
  172. package/build/client/_app/immutable/nodes/5.DqrhJj9B.js +1 -0
  173. package/build/client/_app/immutable/nodes/5.DqrhJj9B.js.br +0 -0
  174. package/build/client/_app/immutable/nodes/5.DqrhJj9B.js.gz +0 -0
  175. package/build/client/_app/immutable/nodes/6.CPYhLc46.js +1 -0
  176. package/build/client/_app/immutable/nodes/6.CPYhLc46.js.br +4 -0
  177. package/build/client/_app/immutable/nodes/6.CPYhLc46.js.gz +0 -0
  178. package/build/client/_app/immutable/nodes/7.C1zE2WMk.js +2 -0
  179. package/build/client/_app/immutable/nodes/7.C1zE2WMk.js.br +0 -0
  180. package/build/client/_app/immutable/nodes/7.C1zE2WMk.js.gz +0 -0
  181. package/build/client/_app/immutable/nodes/8.CiDoIZSu.js +6 -0
  182. package/build/client/_app/immutable/nodes/8.CiDoIZSu.js.br +0 -0
  183. package/build/client/_app/immutable/nodes/8.CiDoIZSu.js.gz +0 -0
  184. package/build/client/_app/immutable/nodes/9.BVI-eEdV.js +1 -0
  185. package/build/client/_app/immutable/nodes/9.BVI-eEdV.js.br +0 -0
  186. package/build/client/_app/immutable/nodes/9.BVI-eEdV.js.gz +0 -0
  187. package/build/client/_app/version.json +1 -1
  188. package/build/client/_app/version.json.br +0 -0
  189. package/build/client/_app/version.json.gz +0 -0
  190. package/build/server/chunks/0-aCCGn5tt.js +9 -0
  191. package/build/server/chunks/{0-CqdHgLFy.js.map → 0-aCCGn5tt.js.map} +1 -1
  192. package/build/server/chunks/1-PJOfwEJU.js +9 -0
  193. package/build/server/chunks/{1-CptSbbsC.js.map → 1-PJOfwEJU.js.map} +1 -1
  194. package/build/server/chunks/{7-soEaW5k5.js → 10-C7WLHR92.js} +5 -5
  195. package/build/server/chunks/10-C7WLHR92.js.map +1 -0
  196. package/build/server/chunks/11-CPYwUx-7.js +21 -0
  197. package/build/server/chunks/11-CPYwUx-7.js.map +1 -0
  198. package/build/server/chunks/12-C5OSs5Op.js +20 -0
  199. package/build/server/chunks/12-C5OSs5Op.js.map +1 -0
  200. package/build/server/chunks/13-DPcsc1p-.js +9 -0
  201. package/build/server/chunks/13-DPcsc1p-.js.map +1 -0
  202. package/build/server/chunks/14-PJnTNd-L.js +9 -0
  203. package/build/server/chunks/14-PJnTNd-L.js.map +1 -0
  204. package/build/server/chunks/2-CGWn8izo.js +9 -0
  205. package/build/server/chunks/2-CGWn8izo.js.map +1 -0
  206. package/build/server/chunks/3-DSX59wuh.js +9 -0
  207. package/build/server/chunks/3-DSX59wuh.js.map +1 -0
  208. package/build/server/chunks/4-BML64sIA.js +9 -0
  209. package/build/server/chunks/4-BML64sIA.js.map +1 -0
  210. package/build/server/chunks/5-vxvPoTJ3.js +9 -0
  211. package/build/server/chunks/5-vxvPoTJ3.js.map +1 -0
  212. package/build/server/chunks/6-uS_X9B0s.js +21 -0
  213. package/build/server/chunks/6-uS_X9B0s.js.map +1 -0
  214. package/build/server/chunks/7-C3AnIPYT.js +9 -0
  215. package/build/server/chunks/7-C3AnIPYT.js.map +1 -0
  216. package/build/server/chunks/8-BJTCvcMs.js +9 -0
  217. package/build/server/chunks/8-BJTCvcMs.js.map +1 -0
  218. package/build/server/chunks/9-W6XYayeK.js +25 -0
  219. package/build/server/chunks/9-W6XYayeK.js.map +1 -0
  220. package/build/server/chunks/{AgentSidebar-BIVt78i3.js → AgentSidebar-BB_yQ9s0.js} +4 -4
  221. package/build/server/chunks/AgentSidebar-BB_yQ9s0.js.map +1 -0
  222. package/build/server/chunks/{Button-ZjVPI4zo.js → Button-DZYrr6c0.js} +6 -6
  223. package/build/server/chunks/Button-DZYrr6c0.js.map +1 -0
  224. package/build/server/chunks/{CopyTracesDropdown-B8MjGOwT.js → ChatStepTrace-COI_fylM.js} +29 -146
  225. package/build/server/chunks/ChatStepTrace-COI_fylM.js.map +1 -0
  226. package/build/server/chunks/{ContextEditor-Dgs8Ax9B.js → ContextEditor-ByGoXY5_.js} +28 -13
  227. package/build/server/chunks/ContextEditor-ByGoXY5_.js.map +1 -0
  228. package/build/server/chunks/{Icon-Csjrnozq.js → Icon-BgknHaZs.js} +2 -2
  229. package/build/server/chunks/{Icon-Csjrnozq.js.map → Icon-BgknHaZs.js.map} +1 -1
  230. package/build/server/chunks/{Input-BCU2QEQ2.js → Input-DZT3Mm_-.js} +3 -2
  231. package/build/server/chunks/Input-DZT3Mm_-.js.map +1 -0
  232. package/build/server/chunks/{Modal-bmttP-F1.js → Modal-D4tx0Bdo.js} +3 -3
  233. package/build/server/chunks/Modal-D4tx0Bdo.js.map +1 -0
  234. package/build/server/chunks/{Tab-Jw_OwV7Q.js → Tab-ClYAMM-e.js} +4 -4
  235. package/build/server/chunks/Tab-ClYAMM-e.js.map +1 -0
  236. package/build/server/chunks/_layout.svelte-BdnWuh8V.js +849 -0
  237. package/build/server/chunks/_layout.svelte-BdnWuh8V.js.map +1 -0
  238. package/build/server/chunks/{_layout.svelte-CrT993Da.js → _layout.svelte-Svi5xbzP.js} +1 -14
  239. package/build/server/chunks/_layout.svelte-Svi5xbzP.js.map +1 -0
  240. package/build/server/chunks/{_layout.svelte-GwcIlDHC.js → _layout.svelte-h89mGXIj.js} +25 -31
  241. package/build/server/chunks/_layout.svelte-h89mGXIj.js.map +1 -0
  242. package/build/server/chunks/{_page.svelte-CVO2CdmB.js → _page.svelte-39hvC6-Q.js} +4 -4
  243. package/build/server/chunks/{_page.svelte-CVO2CdmB.js.map → _page.svelte-39hvC6-Q.js.map} +1 -1
  244. package/build/server/chunks/{_page.svelte-d8hJxmZl.js → _page.svelte-B3PTKffw.js} +374 -361
  245. package/build/server/chunks/_page.svelte-B3PTKffw.js.map +1 -0
  246. package/build/server/chunks/{_page.svelte-D8d07zd0.js → _page.svelte-B4py4PyV.js} +160 -12
  247. package/build/server/chunks/_page.svelte-B4py4PyV.js.map +1 -0
  248. package/build/server/chunks/_page.svelte-CC26hDwf.js +675 -0
  249. package/build/server/chunks/_page.svelte-CC26hDwf.js.map +1 -0
  250. package/build/server/chunks/{_page.svelte-BAi74pJ3.js → _page.svelte-CbqAsz26.js} +3 -3
  251. package/build/server/chunks/_page.svelte-CbqAsz26.js.map +1 -0
  252. package/build/server/chunks/{_page.svelte-BOzS_rqK.js → _page.svelte-CnjXZO9K.js} +18 -27
  253. package/build/server/chunks/_page.svelte-CnjXZO9K.js.map +1 -0
  254. package/build/server/chunks/edit-workspace-context-OTOIRCI0.js +13 -0
  255. package/build/server/chunks/edit-workspace-context-OTOIRCI0.js.map +1 -0
  256. package/build/server/chunks/hooks-BJphIAi-.js +8 -0
  257. package/build/server/chunks/hooks-BJphIAi-.js.map +1 -0
  258. package/build/server/chunks/{Tab.svelte_svelte_type_style_lang-ByZ0KVzO.js → index-server-CefdgakO.js} +2 -2
  259. package/build/server/chunks/index-server-CefdgakO.js.map +1 -0
  260. package/build/server/chunks/{index2-C572SQM_.js → index2-BuOY2QE4.js} +2 -2
  261. package/build/server/chunks/{index2-C572SQM_.js.map → index2-BuOY2QE4.js.map} +1 -1
  262. package/build/server/chunks/log-content.svelte-B3ZvaoLs.js +20 -0
  263. package/build/server/chunks/log-content.svelte-B3ZvaoLs.js.map +1 -0
  264. package/build/server/index.js +3 -2
  265. package/build/server/index.js.map +1 -1
  266. package/build/server/manifest.js +51 -18
  267. package/build/server/manifest.js.map +1 -1
  268. package/package.json +3 -1
  269. package/src/backend/lib/decode-html-entities.spec.ts +29 -0
  270. package/src/backend/lib/decode-html-entities.ts +25 -0
  271. package/src/backend/roleplay/router.ts +31 -0
  272. package/src/backend/tests/academy.ts +353 -115
  273. package/src/backend/tests/analyze.ts +357 -0
  274. package/src/backend/tests/data.ts +48 -12
  275. package/src/backend/tests/emulate-agents.ts +39 -4
  276. package/src/backend/tests/prompt-issues.ts +204 -0
  277. package/src/backend/tests/router.ts +51 -4
  278. package/build/client/_app/immutable/assets/0.BPqDeVAI.css +0 -1
  279. package/build/client/_app/immutable/assets/0.BPqDeVAI.css.br +0 -0
  280. package/build/client/_app/immutable/assets/0.BPqDeVAI.css.gz +0 -0
  281. package/build/client/_app/immutable/assets/4.BIrSikaZ.css +0 -1
  282. package/build/client/_app/immutable/assets/4.BIrSikaZ.css.br +0 -0
  283. package/build/client/_app/immutable/assets/4.BIrSikaZ.css.gz +0 -0
  284. package/build/client/_app/immutable/assets/6.C4C8vBUW.css +0 -1
  285. package/build/client/_app/immutable/assets/6.C4C8vBUW.css.br +0 -0
  286. package/build/client/_app/immutable/assets/6.C4C8vBUW.css.gz +0 -0
  287. package/build/client/_app/immutable/assets/AgentSidebar.QeNZJtLq.css.br +0 -0
  288. package/build/client/_app/immutable/assets/AgentSidebar.QeNZJtLq.css.gz +0 -0
  289. package/build/client/_app/immutable/assets/Tab.BxaGw9IG.css +0 -1
  290. package/build/client/_app/immutable/assets/Tab.BxaGw9IG.css.br +0 -0
  291. package/build/client/_app/immutable/assets/Tab.BxaGw9IG.css.gz +0 -0
  292. package/build/client/_app/immutable/chunks/4PztAao_.js.br +0 -0
  293. package/build/client/_app/immutable/chunks/4PztAao_.js.gz +0 -0
  294. package/build/client/_app/immutable/chunks/B2gGEZTS.js +0 -1
  295. package/build/client/_app/immutable/chunks/B2gGEZTS.js.br +0 -2
  296. package/build/client/_app/immutable/chunks/B2gGEZTS.js.gz +0 -0
  297. package/build/client/_app/immutable/chunks/BHL1bMOV.js.br +0 -0
  298. package/build/client/_app/immutable/chunks/BHL1bMOV.js.gz +0 -0
  299. package/build/client/_app/immutable/chunks/BOQMymse.js.br +0 -0
  300. package/build/client/_app/immutable/chunks/BOQMymse.js.gz +0 -0
  301. package/build/client/_app/immutable/chunks/Bd7SZbXQ.js +0 -1
  302. package/build/client/_app/immutable/chunks/Bd7SZbXQ.js.br +0 -0
  303. package/build/client/_app/immutable/chunks/Bd7SZbXQ.js.gz +0 -0
  304. package/build/client/_app/immutable/chunks/Bf1oCG9-.js +0 -8
  305. package/build/client/_app/immutable/chunks/Bf1oCG9-.js.br +0 -0
  306. package/build/client/_app/immutable/chunks/Bf1oCG9-.js.gz +0 -0
  307. package/build/client/_app/immutable/chunks/BgaIh2D4.js +0 -1
  308. package/build/client/_app/immutable/chunks/BgaIh2D4.js.br +0 -0
  309. package/build/client/_app/immutable/chunks/BgaIh2D4.js.gz +0 -0
  310. package/build/client/_app/immutable/chunks/BrDK8TTs.js +0 -2
  311. package/build/client/_app/immutable/chunks/BrDK8TTs.js.br +0 -0
  312. package/build/client/_app/immutable/chunks/BrDK8TTs.js.gz +0 -0
  313. package/build/client/_app/immutable/chunks/BsKQRAyX.js +0 -1
  314. package/build/client/_app/immutable/chunks/BsKQRAyX.js.br +0 -0
  315. package/build/client/_app/immutable/chunks/BsKQRAyX.js.gz +0 -0
  316. package/build/client/_app/immutable/chunks/Bw2f0Pmg.js.br +0 -0
  317. package/build/client/_app/immutable/chunks/Bw2f0Pmg.js.gz +0 -0
  318. package/build/client/_app/immutable/chunks/BzAx_Qn3.js +0 -1
  319. package/build/client/_app/immutable/chunks/BzAx_Qn3.js.br +0 -0
  320. package/build/client/_app/immutable/chunks/BzAx_Qn3.js.gz +0 -0
  321. package/build/client/_app/immutable/chunks/C-dTPkQy.js +0 -1
  322. package/build/client/_app/immutable/chunks/C-dTPkQy.js.br +0 -0
  323. package/build/client/_app/immutable/chunks/C-dTPkQy.js.gz +0 -0
  324. package/build/client/_app/immutable/chunks/C769zFCl.js.br +0 -0
  325. package/build/client/_app/immutable/chunks/C769zFCl.js.gz +0 -0
  326. package/build/client/_app/immutable/chunks/C7FjDhij.js +0 -4
  327. package/build/client/_app/immutable/chunks/C7FjDhij.js.br +0 -0
  328. package/build/client/_app/immutable/chunks/C7FjDhij.js.gz +0 -0
  329. package/build/client/_app/immutable/chunks/CInh9KnU.js +0 -1
  330. package/build/client/_app/immutable/chunks/CInh9KnU.js.br +0 -2
  331. package/build/client/_app/immutable/chunks/CInh9KnU.js.gz +0 -0
  332. package/build/client/_app/immutable/chunks/CRTtd6by.js.br +0 -0
  333. package/build/client/_app/immutable/chunks/CRTtd6by.js.gz +0 -0
  334. package/build/client/_app/immutable/chunks/CRlLKhPr.js.br +0 -0
  335. package/build/client/_app/immutable/chunks/CRlLKhPr.js.gz +0 -0
  336. package/build/client/_app/immutable/chunks/CUfDVPpW.js +0 -1
  337. package/build/client/_app/immutable/chunks/CUfDVPpW.js.br +0 -0
  338. package/build/client/_app/immutable/chunks/CUfDVPpW.js.gz +0 -0
  339. package/build/client/_app/immutable/chunks/CfKHaDCm.js.br +0 -0
  340. package/build/client/_app/immutable/chunks/CfKHaDCm.js.gz +0 -0
  341. package/build/client/_app/immutable/chunks/Codln_pl.js.br +0 -0
  342. package/build/client/_app/immutable/chunks/Codln_pl.js.gz +0 -0
  343. package/build/client/_app/immutable/chunks/Culo9hD6.js.br +0 -0
  344. package/build/client/_app/immutable/chunks/Culo9hD6.js.gz +0 -0
  345. package/build/client/_app/immutable/chunks/CxDLEL1d.js +0 -8
  346. package/build/client/_app/immutable/chunks/CxDLEL1d.js.br +0 -0
  347. package/build/client/_app/immutable/chunks/CxDLEL1d.js.gz +0 -0
  348. package/build/client/_app/immutable/chunks/Cx_xzGPa.js.br +0 -0
  349. package/build/client/_app/immutable/chunks/Cx_xzGPa.js.gz +0 -0
  350. package/build/client/_app/immutable/chunks/D-51TRqM.js +0 -33
  351. package/build/client/_app/immutable/chunks/D-51TRqM.js.br +0 -0
  352. package/build/client/_app/immutable/chunks/D-51TRqM.js.gz +0 -0
  353. package/build/client/_app/immutable/chunks/D5fGPlBk.js.br +0 -0
  354. package/build/client/_app/immutable/chunks/D5fGPlBk.js.gz +0 -0
  355. package/build/client/_app/immutable/chunks/D9h7-Y-f.js +0 -1
  356. package/build/client/_app/immutable/chunks/D9h7-Y-f.js.br +0 -0
  357. package/build/client/_app/immutable/chunks/D9h7-Y-f.js.gz +0 -0
  358. package/build/client/_app/immutable/chunks/DAfsp-82.js.br +0 -0
  359. package/build/client/_app/immutable/chunks/DAfsp-82.js.gz +0 -0
  360. package/build/client/_app/immutable/chunks/DJ_lsF0V.js.br +0 -0
  361. package/build/client/_app/immutable/chunks/DJ_lsF0V.js.gz +0 -0
  362. package/build/client/_app/immutable/chunks/DaRvw8c-.js.br +0 -0
  363. package/build/client/_app/immutable/chunks/DaRvw8c-.js.gz +0 -0
  364. package/build/client/_app/immutable/chunks/FawE95CY.js +0 -1
  365. package/build/client/_app/immutable/chunks/FawE95CY.js.br +0 -0
  366. package/build/client/_app/immutable/chunks/FawE95CY.js.gz +0 -0
  367. package/build/client/_app/immutable/chunks/HBgR5qMR.js +0 -3
  368. package/build/client/_app/immutable/chunks/HBgR5qMR.js.br +0 -0
  369. package/build/client/_app/immutable/chunks/HBgR5qMR.js.gz +0 -0
  370. package/build/client/_app/immutable/chunks/I-mny6CH.js +0 -1
  371. package/build/client/_app/immutable/chunks/I-mny6CH.js.br +0 -0
  372. package/build/client/_app/immutable/chunks/I-mny6CH.js.gz +0 -0
  373. package/build/client/_app/immutable/chunks/aeuWzujc.js +0 -1
  374. package/build/client/_app/immutable/chunks/aeuWzujc.js.br +0 -2
  375. package/build/client/_app/immutable/chunks/aeuWzujc.js.gz +0 -0
  376. package/build/client/_app/immutable/chunks/qXu78w_4.js.br +0 -0
  377. package/build/client/_app/immutable/chunks/qXu78w_4.js.gz +0 -0
  378. package/build/client/_app/immutable/chunks/yOR3vtRx.js.br +0 -0
  379. package/build/client/_app/immutable/chunks/yOR3vtRx.js.gz +0 -0
  380. package/build/client/_app/immutable/entry/app.Dd7V5oBZ.js +0 -2
  381. package/build/client/_app/immutable/entry/app.Dd7V5oBZ.js.br +0 -0
  382. package/build/client/_app/immutable/entry/app.Dd7V5oBZ.js.gz +0 -0
  383. package/build/client/_app/immutable/entry/start.I6276KWl.js +0 -1
  384. package/build/client/_app/immutable/entry/start.I6276KWl.js.br +0 -2
  385. package/build/client/_app/immutable/entry/start.I6276KWl.js.gz +0 -0
  386. package/build/client/_app/immutable/nodes/0.DgVTcUxG.js +0 -3
  387. package/build/client/_app/immutable/nodes/0.DgVTcUxG.js.br +0 -0
  388. package/build/client/_app/immutable/nodes/0.DgVTcUxG.js.gz +0 -0
  389. package/build/client/_app/immutable/nodes/1._3H1cdWd.js +0 -1
  390. package/build/client/_app/immutable/nodes/1._3H1cdWd.js.br +0 -0
  391. package/build/client/_app/immutable/nodes/1._3H1cdWd.js.gz +0 -0
  392. package/build/client/_app/immutable/nodes/2.BO0WBJz3.js +0 -1
  393. package/build/client/_app/immutable/nodes/2.BO0WBJz3.js.br +0 -0
  394. package/build/client/_app/immutable/nodes/2.BO0WBJz3.js.gz +0 -0
  395. package/build/client/_app/immutable/nodes/3.C-B1sGi_.js.br +0 -0
  396. package/build/client/_app/immutable/nodes/3.C-B1sGi_.js.gz +0 -0
  397. package/build/client/_app/immutable/nodes/4.SsrvuMXV.js +0 -35
  398. package/build/client/_app/immutable/nodes/4.SsrvuMXV.js.br +0 -0
  399. package/build/client/_app/immutable/nodes/4.SsrvuMXV.js.gz +0 -0
  400. package/build/client/_app/immutable/nodes/5.DM_0dw43.js +0 -1
  401. package/build/client/_app/immutable/nodes/5.DM_0dw43.js.br +0 -0
  402. package/build/client/_app/immutable/nodes/5.DM_0dw43.js.gz +0 -0
  403. package/build/client/_app/immutable/nodes/6.BLcf1-sM.js +0 -5
  404. package/build/client/_app/immutable/nodes/6.BLcf1-sM.js.br +0 -0
  405. package/build/client/_app/immutable/nodes/6.BLcf1-sM.js.gz +0 -0
  406. package/build/client/_app/immutable/nodes/7.BLozkJCY.js +0 -1
  407. package/build/client/_app/immutable/nodes/7.BLozkJCY.js.br +0 -0
  408. package/build/client/_app/immutable/nodes/7.BLozkJCY.js.gz +0 -0
  409. package/build/client/_app/immutable/nodes/8.BeHRzquW.js +0 -1
  410. package/build/client/_app/immutable/nodes/8.BeHRzquW.js.br +0 -0
  411. package/build/client/_app/immutable/nodes/8.BeHRzquW.js.gz +0 -0
  412. package/build/client/_app/immutable/nodes/9.B1qNbiqD.js +0 -11
  413. package/build/client/_app/immutable/nodes/9.B1qNbiqD.js.br +0 -0
  414. package/build/client/_app/immutable/nodes/9.B1qNbiqD.js.gz +0 -0
  415. package/build/server/chunks/0-CqdHgLFy.js +0 -9
  416. package/build/server/chunks/1-CptSbbsC.js +0 -9
  417. package/build/server/chunks/2-CVrU1q5e.js +0 -9
  418. package/build/server/chunks/2-CVrU1q5e.js.map +0 -1
  419. package/build/server/chunks/3-Bi3FZgxy.js +0 -9
  420. package/build/server/chunks/3-Bi3FZgxy.js.map +0 -1
  421. package/build/server/chunks/4-Cg81z1QT.js +0 -9
  422. package/build/server/chunks/4-Cg81z1QT.js.map +0 -1
  423. package/build/server/chunks/5-BDZ8fU2l.js +0 -9
  424. package/build/server/chunks/5-BDZ8fU2l.js.map +0 -1
  425. package/build/server/chunks/6-_jdLZ_Lr.js +0 -33
  426. package/build/server/chunks/6-_jdLZ_Lr.js.map +0 -1
  427. package/build/server/chunks/7-soEaW5k5.js.map +0 -1
  428. package/build/server/chunks/8-Yp_dUmRS.js +0 -9
  429. package/build/server/chunks/8-Yp_dUmRS.js.map +0 -1
  430. package/build/server/chunks/9-Cb4lmLGK.js +0 -9
  431. package/build/server/chunks/9-Cb4lmLGK.js.map +0 -1
  432. package/build/server/chunks/AgentSidebar-BIVt78i3.js.map +0 -1
  433. package/build/server/chunks/Button-ZjVPI4zo.js.map +0 -1
  434. package/build/server/chunks/ContextEditor-Dgs8Ax9B.js.map +0 -1
  435. package/build/server/chunks/CopyTracesDropdown-B8MjGOwT.js.map +0 -1
  436. package/build/server/chunks/Input-BCU2QEQ2.js.map +0 -1
  437. package/build/server/chunks/Modal-bmttP-F1.js.map +0 -1
  438. package/build/server/chunks/Tab-Jw_OwV7Q.js.map +0 -1
  439. package/build/server/chunks/Tab.svelte_svelte_type_style_lang-ByZ0KVzO.js.map +0 -1
  440. package/build/server/chunks/_layout.svelte-CrT993Da.js.map +0 -1
  441. package/build/server/chunks/_layout.svelte-GwcIlDHC.js.map +0 -1
  442. package/build/server/chunks/_page.svelte--l_LvFv_.js +0 -2307
  443. package/build/server/chunks/_page.svelte--l_LvFv_.js.map +0 -1
  444. package/build/server/chunks/_page.svelte-BAi74pJ3.js.map +0 -1
  445. package/build/server/chunks/_page.svelte-BOzS_rqK.js.map +0 -1
  446. package/build/server/chunks/_page.svelte-D8d07zd0.js.map +0 -1
  447. package/build/server/chunks/_page.svelte-d8hJxmZl.js.map +0 -1
  448. /package/build/client/_app/immutable/assets/{9.C5apk4jm.css → 14.C5apk4jm.css} +0 -0
  449. /package/build/client/_app/immutable/assets/{9.C5apk4jm.css.br → 14.C5apk4jm.css.br} +0 -0
  450. /package/build/client/_app/immutable/assets/{9.C5apk4jm.css.gz → 14.C5apk4jm.css.gz} +0 -0
  451. /package/build/client/_app/immutable/assets/{2.Dzh7_Q8n.css → 3.Dzh7_Q8n.css} +0 -0
  452. /package/build/client/_app/immutable/assets/{2.Dzh7_Q8n.css.br → 3.Dzh7_Q8n.css.br} +0 -0
  453. /package/build/client/_app/immutable/assets/{2.Dzh7_Q8n.css.gz → 3.Dzh7_Q8n.css.gz} +0 -0
  454. /package/build/client/_app/immutable/assets/{3.CZVw96CJ.css → 4.CZVw96CJ.css} +0 -0
  455. /package/build/client/_app/immutable/assets/{3.CZVw96CJ.css.br → 4.CZVw96CJ.css.br} +0 -0
  456. /package/build/client/_app/immutable/assets/{3.CZVw96CJ.css.gz → 4.CZVw96CJ.css.gz} +0 -0
  457. /package/build/client/_app/immutable/assets/{CopyTracesDropdown.NFJFjHv0.css → ChatStepTrace.NFJFjHv0.css} +0 -0
  458. /package/build/client/_app/immutable/assets/{CopyTracesDropdown.NFJFjHv0.css.br → ChatStepTrace.NFJFjHv0.css.br} +0 -0
  459. /package/build/client/_app/immutable/assets/{CopyTracesDropdown.NFJFjHv0.css.gz → ChatStepTrace.NFJFjHv0.css.gz} +0 -0
  460. /package/build/client/_app/immutable/assets/{Modal.tn0RQdqM.css → bosun-theme.tn0RQdqM.css} +0 -0
  461. /package/build/client/_app/immutable/assets/{Modal.tn0RQdqM.css.br → bosun-theme.tn0RQdqM.css.br} +0 -0
  462. /package/build/client/_app/immutable/assets/{Modal.tn0RQdqM.css.gz → bosun-theme.tn0RQdqM.css.gz} +0 -0
@@ -1,2307 +0,0 @@
1
- import { h as head, c as attr_style, a as attr_class, b as attr, s as stringify, e as ensure_array_like, f as attributes } from './index2-C572SQM_.js';
2
- import { P as Panel, C as ContextEditor } from './ContextEditor-Dgs8Ax9B.js';
3
- import { B as Button } from './Button-ZjVPI4zo.js';
4
- import { M as Modal } from './Modal-bmttP-F1.js';
5
- import { o as onDestroy } from './Tab.svelte_svelte_type_style_lang-ByZ0KVzO.js';
6
- import { p as page, g as goto } from './index3-DeV2OWZf.js';
7
- import { I as Icon$1, h as html } from './Icon-Csjrnozq.js';
8
- import { T as Tabs, a as Tab } from './Tab-Jw_OwV7Q.js';
9
- import { g as getAgentsContext } from './agents-context-BrlIlkOW.js';
10
- import { A as AgentSidebar } from './AgentSidebar-BIVt78i3.js';
11
- import { I as Input } from './Input-BCU2QEQ2.js';
12
- import { t as trpc } from './trpc-client-Bucti7HD.js';
13
- import { X as escape_html } from './context-zH5kvtGY.js';
14
- import 'js-yaml';
15
- import './events-M0vvlm3M.js';
16
- import './state.svelte-DtOGaiYC.js';
17
- import './utils-KcIDVAAe.js';
18
- import './index-DxaLoiKh.js';
19
- import '@trpc/client';
20
-
21
- function _defineProperty(obj, key, value) {
22
- if (key in obj) {
23
- Object.defineProperty(obj, key, {
24
- value,
25
- enumerable: true,
26
- configurable: true,
27
- writable: true
28
- });
29
- } else {
30
- obj[key] = value;
31
- }
32
- return obj;
33
- }
34
- var FEATURE_FLAG_NAMES = Object.freeze({
35
- // This flag exists as a workaround for issue 454 (basically a browser bug) - seems like these rect values take time to update when in grid layout. Setting it to true can cause strange behaviour in the REPL for non-grid zones, see issue 470
36
- USE_COMPUTED_STYLE_INSTEAD_OF_BOUNDING_RECT: "USE_COMPUTED_STYLE_INSTEAD_OF_BOUNDING_RECT"
37
- });
38
- _defineProperty({}, FEATURE_FLAG_NAMES.USE_COMPUTED_STYLE_INSTEAD_OF_BOUNDING_RECT, false);
39
- var _ID_TO_INSTRUCTION;
40
- var INSTRUCTION_IDs$1 = {
41
- DND_ZONE_ACTIVE: "dnd-zone-active",
42
- DND_ZONE_DRAG_DISABLED: "dnd-zone-drag-disabled"
43
- };
44
- _ID_TO_INSTRUCTION = {}, _defineProperty(_ID_TO_INSTRUCTION, INSTRUCTION_IDs$1.DND_ZONE_ACTIVE, "Tab to one the items and press space-bar or enter to start dragging it"), _defineProperty(_ID_TO_INSTRUCTION, INSTRUCTION_IDs$1.DND_ZONE_DRAG_DISABLED, "This is a disabled drag and drop list");
45
- const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
46
- const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
47
- const colonSeparated = value.split(":");
48
- if (value.slice(0, 1) === "@") {
49
- if (colonSeparated.length < 2 || colonSeparated.length > 3) return null;
50
- provider = colonSeparated.shift().slice(1);
51
- }
52
- if (colonSeparated.length > 3 || !colonSeparated.length) return null;
53
- if (colonSeparated.length > 1) {
54
- const name$1 = colonSeparated.pop();
55
- const prefix = colonSeparated.pop();
56
- const result = {
57
- provider: colonSeparated.length > 0 ? colonSeparated[0] : provider,
58
- prefix,
59
- name: name$1
60
- };
61
- return validate && !validateIconName(result) ? null : result;
62
- }
63
- const name = colonSeparated[0];
64
- const dashSeparated = name.split("-");
65
- if (dashSeparated.length > 1) {
66
- const result = {
67
- provider,
68
- prefix: dashSeparated.shift(),
69
- name: dashSeparated.join("-")
70
- };
71
- return validate && !validateIconName(result) ? null : result;
72
- }
73
- if (allowSimpleName && provider === "") {
74
- const result = {
75
- provider,
76
- prefix: "",
77
- name
78
- };
79
- return validate && !validateIconName(result, allowSimpleName) ? null : result;
80
- }
81
- return null;
82
- };
83
- const validateIconName = (icon, allowSimpleName) => {
84
- if (!icon) return false;
85
- return !!((allowSimpleName && icon.prefix === "" || !!icon.prefix) && !!icon.name);
86
- };
87
- function getIconsTree(data, names) {
88
- const icons = data.icons;
89
- const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
90
- const resolved = /* @__PURE__ */ Object.create(null);
91
- function resolve(name) {
92
- if (icons[name]) return resolved[name] = [];
93
- if (!(name in resolved)) {
94
- resolved[name] = null;
95
- const parent = aliases[name] && aliases[name].parent;
96
- const value = parent && resolve(parent);
97
- if (value) resolved[name] = [parent].concat(value);
98
- }
99
- return resolved[name];
100
- }
101
- Object.keys(icons).concat(Object.keys(aliases)).forEach(resolve);
102
- return resolved;
103
- }
104
- const defaultIconDimensions = Object.freeze({
105
- left: 0,
106
- top: 0,
107
- width: 16,
108
- height: 16
109
- });
110
- const defaultIconTransformations = Object.freeze({
111
- rotate: 0,
112
- vFlip: false,
113
- hFlip: false
114
- });
115
- const defaultIconProps = Object.freeze({
116
- ...defaultIconDimensions,
117
- ...defaultIconTransformations
118
- });
119
- const defaultExtendedIconProps = Object.freeze({
120
- ...defaultIconProps,
121
- body: "",
122
- hidden: false
123
- });
124
- function mergeIconTransformations(obj1, obj2) {
125
- const result = {};
126
- if (!obj1.hFlip !== !obj2.hFlip) result.hFlip = true;
127
- if (!obj1.vFlip !== !obj2.vFlip) result.vFlip = true;
128
- const rotate = ((obj1.rotate || 0) + (obj2.rotate || 0)) % 4;
129
- if (rotate) result.rotate = rotate;
130
- return result;
131
- }
132
- function mergeIconData(parent, child) {
133
- const result = mergeIconTransformations(parent, child);
134
- for (const key in defaultExtendedIconProps) if (key in defaultIconTransformations) {
135
- if (key in parent && !(key in result)) result[key] = defaultIconTransformations[key];
136
- } else if (key in child) result[key] = child[key];
137
- else if (key in parent) result[key] = parent[key];
138
- return result;
139
- }
140
- function internalGetIconData(data, name, tree) {
141
- const icons = data.icons;
142
- const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
143
- let currentProps = {};
144
- function parse(name$1) {
145
- currentProps = mergeIconData(icons[name$1] || aliases[name$1], currentProps);
146
- }
147
- parse(name);
148
- tree.forEach(parse);
149
- return mergeIconData(data, currentProps);
150
- }
151
- function parseIconSet(data, callback) {
152
- const names = [];
153
- if (typeof data !== "object" || typeof data.icons !== "object") return names;
154
- if (data.not_found instanceof Array) data.not_found.forEach((name) => {
155
- callback(name, null);
156
- names.push(name);
157
- });
158
- const tree = getIconsTree(data);
159
- for (const name in tree) {
160
- const item = tree[name];
161
- if (item) {
162
- callback(name, internalGetIconData(data, name, item));
163
- names.push(name);
164
- }
165
- }
166
- return names;
167
- }
168
- const optionalPropertyDefaults = {
169
- provider: "",
170
- aliases: {},
171
- not_found: {},
172
- ...defaultIconDimensions
173
- };
174
- function checkOptionalProps(item, defaults) {
175
- for (const prop in defaults) if (prop in item && typeof item[prop] !== typeof defaults[prop]) return false;
176
- return true;
177
- }
178
- function quicklyValidateIconSet(obj) {
179
- if (typeof obj !== "object" || obj === null) return null;
180
- const data = obj;
181
- if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") return null;
182
- if (!checkOptionalProps(obj, optionalPropertyDefaults)) return null;
183
- const icons = data.icons;
184
- for (const name in icons) {
185
- const icon = icons[name];
186
- if (!name || typeof icon.body !== "string" || !checkOptionalProps(icon, defaultExtendedIconProps)) return null;
187
- }
188
- const aliases = data.aliases || /* @__PURE__ */ Object.create(null);
189
- for (const name in aliases) {
190
- const icon = aliases[name];
191
- const parent = icon.parent;
192
- if (!name || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(icon, defaultExtendedIconProps)) return null;
193
- }
194
- return data;
195
- }
196
- const dataStorage = /* @__PURE__ */ Object.create(null);
197
- function newStorage(provider, prefix) {
198
- return {
199
- provider,
200
- prefix,
201
- icons: /* @__PURE__ */ Object.create(null),
202
- missing: /* @__PURE__ */ new Set()
203
- };
204
- }
205
- function getStorage(provider, prefix) {
206
- const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */ Object.create(null));
207
- return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
208
- }
209
- function addIconSet(storage2, data) {
210
- if (!quicklyValidateIconSet(data)) return [];
211
- return parseIconSet(data, (name, icon) => {
212
- if (icon) storage2.icons[name] = icon;
213
- else storage2.missing.add(name);
214
- });
215
- }
216
- function addIconToStorage(storage2, name, icon) {
217
- try {
218
- if (typeof icon.body === "string") {
219
- storage2.icons[name] = { ...icon };
220
- return true;
221
- }
222
- } catch (err) {
223
- }
224
- return false;
225
- }
226
- let simpleNames = false;
227
- function allowSimpleNames(allow) {
228
- if (typeof allow === "boolean") simpleNames = allow;
229
- return simpleNames;
230
- }
231
- function getIconData(name) {
232
- const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
233
- if (icon) {
234
- const storage2 = getStorage(icon.provider, icon.prefix);
235
- const iconName = icon.name;
236
- return storage2.icons[iconName] || (storage2.missing.has(iconName) ? null : void 0);
237
- }
238
- }
239
- function addIcon(name, data) {
240
- const icon = stringToIcon(name, true, simpleNames);
241
- if (!icon) return false;
242
- const storage2 = getStorage(icon.provider, icon.prefix);
243
- if (data) return addIconToStorage(storage2, icon.name, data);
244
- else {
245
- storage2.missing.add(icon.name);
246
- return true;
247
- }
248
- }
249
- function addCollection(data, provider) {
250
- if (typeof data !== "object") return false;
251
- if (typeof provider !== "string") provider = data.provider || "";
252
- if (simpleNames && !provider && !data.prefix) {
253
- let added = false;
254
- if (quicklyValidateIconSet(data)) {
255
- data.prefix = "";
256
- parseIconSet(data, (name, icon) => {
257
- if (addIcon(name, icon)) added = true;
258
- });
259
- }
260
- return added;
261
- }
262
- const prefix = data.prefix;
263
- if (!validateIconName({
264
- prefix,
265
- name: "a"
266
- })) return false;
267
- const storage2 = getStorage(provider, prefix);
268
- return !!addIconSet(storage2, data);
269
- }
270
- const defaultIconSizeCustomisations = Object.freeze({
271
- width: null,
272
- height: null
273
- });
274
- const defaultIconCustomisations = Object.freeze({
275
- ...defaultIconSizeCustomisations,
276
- ...defaultIconTransformations
277
- });
278
- const unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
279
- const unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
280
- function calculateSize(size, ratio, precision) {
281
- if (ratio === 1) return size;
282
- precision = precision || 100;
283
- if (typeof size === "number") return Math.ceil(size * ratio * precision) / precision;
284
- if (typeof size !== "string") return size;
285
- const oldParts = size.split(unitsSplit);
286
- if (oldParts === null || !oldParts.length) return size;
287
- const newParts = [];
288
- let code = oldParts.shift();
289
- let isNumber = unitsTest.test(code);
290
- while (true) {
291
- if (isNumber) {
292
- const num = parseFloat(code);
293
- if (isNaN(num)) newParts.push(code);
294
- else newParts.push(Math.ceil(num * ratio * precision) / precision);
295
- } else newParts.push(code);
296
- code = oldParts.shift();
297
- if (code === void 0) return newParts.join("");
298
- isNumber = !isNumber;
299
- }
300
- }
301
- function splitSVGDefs(content, tag = "defs") {
302
- let defs = "";
303
- const index = content.indexOf("<" + tag);
304
- while (index >= 0) {
305
- const start = content.indexOf(">", index);
306
- const end = content.indexOf("</" + tag);
307
- if (start === -1 || end === -1) break;
308
- const endEnd = content.indexOf(">", end);
309
- if (endEnd === -1) break;
310
- defs += content.slice(start + 1, end).trim();
311
- content = content.slice(0, index).trim() + content.slice(endEnd + 1);
312
- }
313
- return {
314
- defs,
315
- content
316
- };
317
- }
318
- function mergeDefsAndContent(defs, content) {
319
- return defs ? "<defs>" + defs + "</defs>" + content : content;
320
- }
321
- function wrapSVGContent(body, start, end) {
322
- const split = splitSVGDefs(body);
323
- return mergeDefsAndContent(split.defs, start + split.content + end);
324
- }
325
- const isUnsetKeyword = (value) => value === "unset" || value === "undefined" || value === "none";
326
- function iconToSVG(icon, customisations) {
327
- const fullIcon = {
328
- ...defaultIconProps,
329
- ...icon
330
- };
331
- const fullCustomisations = {
332
- ...defaultIconCustomisations,
333
- ...customisations
334
- };
335
- const box = {
336
- left: fullIcon.left,
337
- top: fullIcon.top,
338
- width: fullIcon.width,
339
- height: fullIcon.height
340
- };
341
- let body = fullIcon.body;
342
- [fullIcon, fullCustomisations].forEach((props) => {
343
- const transformations = [];
344
- const hFlip = props.hFlip;
345
- const vFlip = props.vFlip;
346
- let rotation = props.rotate;
347
- if (hFlip) if (vFlip) rotation += 2;
348
- else {
349
- transformations.push("translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")");
350
- transformations.push("scale(-1 1)");
351
- box.top = box.left = 0;
352
- }
353
- else if (vFlip) {
354
- transformations.push("translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")");
355
- transformations.push("scale(1 -1)");
356
- box.top = box.left = 0;
357
- }
358
- let tempValue;
359
- if (rotation < 0) rotation -= Math.floor(rotation / 4) * 4;
360
- rotation = rotation % 4;
361
- switch (rotation) {
362
- case 1:
363
- tempValue = box.height / 2 + box.top;
364
- transformations.unshift("rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")");
365
- break;
366
- case 2:
367
- transformations.unshift("rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")");
368
- break;
369
- case 3:
370
- tempValue = box.width / 2 + box.left;
371
- transformations.unshift("rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")");
372
- break;
373
- }
374
- if (rotation % 2 === 1) {
375
- if (box.left !== box.top) {
376
- tempValue = box.left;
377
- box.left = box.top;
378
- box.top = tempValue;
379
- }
380
- if (box.width !== box.height) {
381
- tempValue = box.width;
382
- box.width = box.height;
383
- box.height = tempValue;
384
- }
385
- }
386
- if (transformations.length) body = wrapSVGContent(body, '<g transform="' + transformations.join(" ") + '">', "</g>");
387
- });
388
- const customisationsWidth = fullCustomisations.width;
389
- const customisationsHeight = fullCustomisations.height;
390
- const boxWidth = box.width;
391
- const boxHeight = box.height;
392
- let width;
393
- let height;
394
- if (customisationsWidth === null) {
395
- height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
396
- width = calculateSize(height, boxWidth / boxHeight);
397
- } else {
398
- width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
399
- height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
400
- }
401
- const attributes2 = {};
402
- const setAttr = (prop, value) => {
403
- if (!isUnsetKeyword(value)) attributes2[prop] = value.toString();
404
- };
405
- setAttr("width", width);
406
- setAttr("height", height);
407
- const viewBox = [
408
- box.left,
409
- box.top,
410
- boxWidth,
411
- boxHeight
412
- ];
413
- attributes2.viewBox = viewBox.join(" ");
414
- return {
415
- attributes: attributes2,
416
- viewBox,
417
- body
418
- };
419
- }
420
- const regex = /\sid="(\S+)"/g;
421
- const randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
422
- let counter = 0;
423
- function replaceIDs(body, prefix = randomPrefix) {
424
- const ids = [];
425
- let match;
426
- while (match = regex.exec(body)) ids.push(match[1]);
427
- if (!ids.length) return body;
428
- const suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
429
- ids.forEach((id) => {
430
- const newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
431
- const escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
432
- body = body.replace(new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"), "$1" + newID + suffix + "$3");
433
- });
434
- body = body.replace(new RegExp(suffix, "g"), "");
435
- return body;
436
- }
437
- const storage = /* @__PURE__ */ Object.create(null);
438
- function setAPIModule(provider, item) {
439
- storage[provider] = item;
440
- }
441
- function getAPIModule(provider) {
442
- return storage[provider] || storage[""];
443
- }
444
- function createAPIConfig(source) {
445
- let resources;
446
- if (typeof source.resources === "string") resources = [source.resources];
447
- else {
448
- resources = source.resources;
449
- if (!(resources instanceof Array) || !resources.length) return null;
450
- }
451
- const result = {
452
- resources,
453
- path: source.path || "/",
454
- maxURL: source.maxURL || 500,
455
- rotate: source.rotate || 750,
456
- timeout: source.timeout || 5e3,
457
- random: source.random === true,
458
- index: source.index || 0,
459
- dataAfterTimeout: source.dataAfterTimeout !== false
460
- };
461
- return result;
462
- }
463
- const configStorage = /* @__PURE__ */ Object.create(null);
464
- const fallBackAPISources = ["https://api.simplesvg.com", "https://api.unisvg.com"];
465
- const fallBackAPI = [];
466
- while (fallBackAPISources.length > 0) if (fallBackAPISources.length === 1) fallBackAPI.push(fallBackAPISources.shift());
467
- else if (Math.random() > 0.5) fallBackAPI.push(fallBackAPISources.shift());
468
- else fallBackAPI.push(fallBackAPISources.pop());
469
- configStorage[""] = createAPIConfig({ resources: ["https://api.iconify.design"].concat(fallBackAPI) });
470
- function addAPIProvider(provider, customConfig) {
471
- const config = createAPIConfig(customConfig);
472
- if (config === null) return false;
473
- configStorage[provider] = config;
474
- return true;
475
- }
476
- function getAPIConfig(provider) {
477
- return configStorage[provider];
478
- }
479
- const detectFetch = () => {
480
- let callback;
481
- try {
482
- callback = fetch;
483
- if (typeof callback === "function") return callback;
484
- } catch (err) {
485
- }
486
- };
487
- let fetchModule = detectFetch();
488
- function calculateMaxLength(provider, prefix) {
489
- const config = getAPIConfig(provider);
490
- if (!config) return 0;
491
- let result;
492
- if (!config.maxURL) result = 0;
493
- else {
494
- let maxHostLength = 0;
495
- config.resources.forEach((item) => {
496
- const host = item;
497
- maxHostLength = Math.max(maxHostLength, host.length);
498
- });
499
- const url = prefix + ".json?icons=";
500
- result = config.maxURL - maxHostLength - config.path.length - url.length;
501
- }
502
- return result;
503
- }
504
- function shouldAbort(status) {
505
- return status === 404;
506
- }
507
- const prepare = (provider, prefix, icons) => {
508
- const results = [];
509
- const maxLength = calculateMaxLength(provider, prefix);
510
- const type = "icons";
511
- let item = {
512
- type,
513
- provider,
514
- prefix,
515
- icons: []
516
- };
517
- let length = 0;
518
- icons.forEach((name, index) => {
519
- length += name.length + 1;
520
- if (length >= maxLength && index > 0) {
521
- results.push(item);
522
- item = {
523
- type,
524
- provider,
525
- prefix,
526
- icons: []
527
- };
528
- length = name.length;
529
- }
530
- item.icons.push(name);
531
- });
532
- results.push(item);
533
- return results;
534
- };
535
- function getPath(provider) {
536
- if (typeof provider === "string") {
537
- const config = getAPIConfig(provider);
538
- if (config) return config.path;
539
- }
540
- return "/";
541
- }
542
- const send = (host, params, callback) => {
543
- if (!fetchModule) {
544
- callback("abort", 424);
545
- return;
546
- }
547
- let path = getPath(params.provider);
548
- switch (params.type) {
549
- case "icons": {
550
- const prefix = params.prefix;
551
- const icons = params.icons;
552
- const iconsList = icons.join(",");
553
- const urlParams = new URLSearchParams({ icons: iconsList });
554
- path += prefix + ".json?" + urlParams.toString();
555
- break;
556
- }
557
- case "custom": {
558
- const uri = params.uri;
559
- path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
560
- break;
561
- }
562
- default:
563
- callback("abort", 400);
564
- return;
565
- }
566
- let defaultError = 503;
567
- fetchModule(host + path).then((response) => {
568
- const status = response.status;
569
- if (status !== 200) {
570
- setTimeout(() => {
571
- callback(shouldAbort(status) ? "abort" : "next", status);
572
- });
573
- return;
574
- }
575
- defaultError = 501;
576
- return response.json();
577
- }).then((data) => {
578
- if (typeof data !== "object" || data === null) {
579
- setTimeout(() => {
580
- if (data === 404) callback("abort", data);
581
- else callback("next", defaultError);
582
- });
583
- return;
584
- }
585
- setTimeout(() => {
586
- callback("success", data);
587
- });
588
- }).catch(() => {
589
- callback("next", defaultError);
590
- });
591
- };
592
- const fetchAPIModule = {
593
- prepare,
594
- send
595
- };
596
- function removeCallback(storages, id) {
597
- storages.forEach((storage2) => {
598
- const items = storage2.loaderCallbacks;
599
- if (items) storage2.loaderCallbacks = items.filter((row) => row.id !== id);
600
- });
601
- }
602
- function updateCallbacks(storage2) {
603
- if (!storage2.pendingCallbacksFlag) {
604
- storage2.pendingCallbacksFlag = true;
605
- setTimeout(() => {
606
- storage2.pendingCallbacksFlag = false;
607
- const items = storage2.loaderCallbacks ? storage2.loaderCallbacks.slice(0) : [];
608
- if (!items.length) return;
609
- let hasPending = false;
610
- const provider = storage2.provider;
611
- const prefix = storage2.prefix;
612
- items.forEach((item) => {
613
- const icons = item.icons;
614
- const oldLength = icons.pending.length;
615
- icons.pending = icons.pending.filter((icon) => {
616
- if (icon.prefix !== prefix) return true;
617
- const name = icon.name;
618
- if (storage2.icons[name]) icons.loaded.push({
619
- provider,
620
- prefix,
621
- name
622
- });
623
- else if (storage2.missing.has(name)) icons.missing.push({
624
- provider,
625
- prefix,
626
- name
627
- });
628
- else {
629
- hasPending = true;
630
- return true;
631
- }
632
- return false;
633
- });
634
- if (icons.pending.length !== oldLength) {
635
- if (!hasPending) removeCallback([storage2], item.id);
636
- item.callback(icons.loaded.slice(0), icons.missing.slice(0), icons.pending.slice(0), item.abort);
637
- }
638
- });
639
- });
640
- }
641
- }
642
- let idCounter = 0;
643
- function storeCallback(callback, icons, pendingSources) {
644
- const id = idCounter++;
645
- const abort = removeCallback.bind(null, pendingSources, id);
646
- if (!icons.pending.length) return abort;
647
- const item = {
648
- id,
649
- icons,
650
- callback,
651
- abort
652
- };
653
- pendingSources.forEach((storage2) => {
654
- (storage2.loaderCallbacks || (storage2.loaderCallbacks = [])).push(item);
655
- });
656
- return abort;
657
- }
658
- function sortIcons(icons) {
659
- const result = {
660
- loaded: [],
661
- missing: [],
662
- pending: []
663
- };
664
- const storage2 = /* @__PURE__ */ Object.create(null);
665
- icons.sort((a, b) => {
666
- if (a.provider !== b.provider) return a.provider.localeCompare(b.provider);
667
- if (a.prefix !== b.prefix) return a.prefix.localeCompare(b.prefix);
668
- return a.name.localeCompare(b.name);
669
- });
670
- let lastIcon = {
671
- provider: "",
672
- prefix: "",
673
- name: ""
674
- };
675
- icons.forEach((icon) => {
676
- if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) return;
677
- lastIcon = icon;
678
- const provider = icon.provider;
679
- const prefix = icon.prefix;
680
- const name = icon.name;
681
- const providerStorage = storage2[provider] || (storage2[provider] = /* @__PURE__ */ Object.create(null));
682
- const localStorage = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
683
- let list;
684
- if (name in localStorage.icons) list = result.loaded;
685
- else if (prefix === "" || localStorage.missing.has(name)) list = result.missing;
686
- else list = result.pending;
687
- const item = {
688
- provider,
689
- prefix,
690
- name
691
- };
692
- list.push(item);
693
- });
694
- return result;
695
- }
696
- function listToIcons(list, validate = true, simpleNames2 = false) {
697
- const result = [];
698
- list.forEach((item) => {
699
- const icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames2) : item;
700
- if (icon) result.push(icon);
701
- });
702
- return result;
703
- }
704
- const defaultConfig = {
705
- resources: [],
706
- index: 0,
707
- timeout: 2e3,
708
- rotate: 750,
709
- random: false,
710
- dataAfterTimeout: false
711
- };
712
- function sendQuery(config, payload, query, done) {
713
- const resourcesCount = config.resources.length;
714
- const startIndex = config.random ? Math.floor(Math.random() * resourcesCount) : config.index;
715
- let resources;
716
- if (config.random) {
717
- let list = config.resources.slice(0);
718
- resources = [];
719
- while (list.length > 1) {
720
- const nextIndex = Math.floor(Math.random() * list.length);
721
- resources.push(list[nextIndex]);
722
- list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
723
- }
724
- resources = resources.concat(list);
725
- } else resources = config.resources.slice(startIndex).concat(config.resources.slice(0, startIndex));
726
- const startTime = Date.now();
727
- let status = "pending";
728
- let queriesSent = 0;
729
- let lastError;
730
- let timer = null;
731
- let queue = [];
732
- let doneCallbacks = [];
733
- if (typeof done === "function") doneCallbacks.push(done);
734
- function resetTimer() {
735
- if (timer) {
736
- clearTimeout(timer);
737
- timer = null;
738
- }
739
- }
740
- function abort() {
741
- if (status === "pending") status = "aborted";
742
- resetTimer();
743
- queue.forEach((item) => {
744
- if (item.status === "pending") item.status = "aborted";
745
- });
746
- queue = [];
747
- }
748
- function subscribe(callback, overwrite) {
749
- if (overwrite) doneCallbacks = [];
750
- if (typeof callback === "function") doneCallbacks.push(callback);
751
- }
752
- function getQueryStatus() {
753
- return {
754
- startTime,
755
- payload,
756
- status,
757
- queriesSent,
758
- queriesPending: queue.length,
759
- subscribe,
760
- abort
761
- };
762
- }
763
- function failQuery() {
764
- status = "failed";
765
- doneCallbacks.forEach((callback) => {
766
- callback(void 0, lastError);
767
- });
768
- }
769
- function clearQueue() {
770
- queue.forEach((item) => {
771
- if (item.status === "pending") item.status = "aborted";
772
- });
773
- queue = [];
774
- }
775
- function moduleResponse(item, response, data) {
776
- const isError = response !== "success";
777
- queue = queue.filter((queued) => queued !== item);
778
- switch (status) {
779
- case "pending":
780
- break;
781
- case "failed":
782
- if (isError || !config.dataAfterTimeout) return;
783
- break;
784
- default:
785
- return;
786
- }
787
- if (response === "abort") {
788
- lastError = data;
789
- failQuery();
790
- return;
791
- }
792
- if (isError) {
793
- lastError = data;
794
- if (!queue.length) if (!resources.length) failQuery();
795
- else execNext();
796
- return;
797
- }
798
- resetTimer();
799
- clearQueue();
800
- if (!config.random) {
801
- const index = config.resources.indexOf(item.resource);
802
- if (index !== -1 && index !== config.index) config.index = index;
803
- }
804
- status = "completed";
805
- doneCallbacks.forEach((callback) => {
806
- callback(data);
807
- });
808
- }
809
- function execNext() {
810
- if (status !== "pending") return;
811
- resetTimer();
812
- const resource = resources.shift();
813
- if (resource === void 0) {
814
- if (queue.length) {
815
- timer = setTimeout(() => {
816
- resetTimer();
817
- if (status === "pending") {
818
- clearQueue();
819
- failQuery();
820
- }
821
- }, config.timeout);
822
- return;
823
- }
824
- failQuery();
825
- return;
826
- }
827
- const item = {
828
- status: "pending",
829
- resource,
830
- callback: (status$1, data) => {
831
- moduleResponse(item, status$1, data);
832
- }
833
- };
834
- queue.push(item);
835
- queriesSent++;
836
- timer = setTimeout(execNext, config.rotate);
837
- query(resource, payload, item.callback);
838
- }
839
- setTimeout(execNext);
840
- return getQueryStatus;
841
- }
842
- function initRedundancy(cfg) {
843
- const config = {
844
- ...defaultConfig,
845
- ...cfg
846
- };
847
- let queries = [];
848
- function cleanup() {
849
- queries = queries.filter((item) => item().status === "pending");
850
- }
851
- function query(payload, queryCallback, doneCallback) {
852
- const query$1 = sendQuery(config, payload, queryCallback, (data, error) => {
853
- cleanup();
854
- if (doneCallback) doneCallback(data, error);
855
- });
856
- queries.push(query$1);
857
- return query$1;
858
- }
859
- function find(callback) {
860
- return queries.find((value) => {
861
- return callback(value);
862
- }) || null;
863
- }
864
- const instance = {
865
- query,
866
- find,
867
- setIndex: (index) => {
868
- config.index = index;
869
- },
870
- getIndex: () => config.index,
871
- cleanup
872
- };
873
- return instance;
874
- }
875
- function emptyCallback$1() {
876
- }
877
- const redundancyCache = /* @__PURE__ */ Object.create(null);
878
- function getRedundancyCache(provider) {
879
- if (!redundancyCache[provider]) {
880
- const config = getAPIConfig(provider);
881
- if (!config) return;
882
- const redundancy = initRedundancy(config);
883
- const cachedReundancy = {
884
- config,
885
- redundancy
886
- };
887
- redundancyCache[provider] = cachedReundancy;
888
- }
889
- return redundancyCache[provider];
890
- }
891
- function sendAPIQuery(target, query, callback) {
892
- let redundancy;
893
- let send2;
894
- if (typeof target === "string") {
895
- const api = getAPIModule(target);
896
- if (!api) {
897
- callback(void 0, 424);
898
- return emptyCallback$1;
899
- }
900
- send2 = api.send;
901
- const cached = getRedundancyCache(target);
902
- if (cached) redundancy = cached.redundancy;
903
- } else {
904
- const config = createAPIConfig(target);
905
- if (config) {
906
- redundancy = initRedundancy(config);
907
- const moduleKey = target.resources ? target.resources[0] : "";
908
- const api = getAPIModule(moduleKey);
909
- if (api) send2 = api.send;
910
- }
911
- }
912
- if (!redundancy || !send2) {
913
- callback(void 0, 424);
914
- return emptyCallback$1;
915
- }
916
- return redundancy.query(query, send2, callback)().abort;
917
- }
918
- function emptyCallback() {
919
- }
920
- function loadedNewIcons(storage2) {
921
- if (!storage2.iconsLoaderFlag) {
922
- storage2.iconsLoaderFlag = true;
923
- setTimeout(() => {
924
- storage2.iconsLoaderFlag = false;
925
- updateCallbacks(storage2);
926
- });
927
- }
928
- }
929
- function checkIconNamesForAPI(icons) {
930
- const valid = [];
931
- const invalid = [];
932
- icons.forEach((name) => {
933
- (name.match(matchIconName) ? valid : invalid).push(name);
934
- });
935
- return {
936
- valid,
937
- invalid
938
- };
939
- }
940
- function parseLoaderResponse(storage2, icons, data) {
941
- function checkMissing() {
942
- const pending = storage2.pendingIcons;
943
- icons.forEach((name) => {
944
- if (pending) pending.delete(name);
945
- if (!storage2.icons[name]) storage2.missing.add(name);
946
- });
947
- }
948
- if (data && typeof data === "object") try {
949
- const parsed = addIconSet(storage2, data);
950
- if (!parsed.length) {
951
- checkMissing();
952
- return;
953
- }
954
- } catch (err) {
955
- console.error(err);
956
- }
957
- checkMissing();
958
- loadedNewIcons(storage2);
959
- }
960
- function parsePossiblyAsyncResponse(response, callback) {
961
- if (response instanceof Promise) response.then((data) => {
962
- callback(data);
963
- }).catch(() => {
964
- callback(null);
965
- });
966
- else callback(response);
967
- }
968
- function loadNewIcons(storage2, icons) {
969
- if (!storage2.iconsToLoad) storage2.iconsToLoad = icons;
970
- else storage2.iconsToLoad = storage2.iconsToLoad.concat(icons).sort();
971
- if (!storage2.iconsQueueFlag) {
972
- storage2.iconsQueueFlag = true;
973
- setTimeout(() => {
974
- storage2.iconsQueueFlag = false;
975
- const { provider, prefix } = storage2;
976
- const icons$1 = storage2.iconsToLoad;
977
- delete storage2.iconsToLoad;
978
- if (!icons$1 || !icons$1.length) return;
979
- const customIconLoader = storage2.loadIcon;
980
- if (storage2.loadIcons && (icons$1.length > 1 || !customIconLoader)) {
981
- parsePossiblyAsyncResponse(storage2.loadIcons(icons$1, prefix, provider), (data) => {
982
- parseLoaderResponse(storage2, icons$1, data);
983
- });
984
- return;
985
- }
986
- if (customIconLoader) {
987
- icons$1.forEach((name) => {
988
- const response = customIconLoader(name, prefix, provider);
989
- parsePossiblyAsyncResponse(response, (data) => {
990
- const iconSet = data ? {
991
- prefix,
992
- icons: { [name]: data }
993
- } : null;
994
- parseLoaderResponse(storage2, [name], iconSet);
995
- });
996
- });
997
- return;
998
- }
999
- const { valid, invalid } = checkIconNamesForAPI(icons$1);
1000
- if (invalid.length) parseLoaderResponse(storage2, invalid, null);
1001
- if (!valid.length) return;
1002
- const api = prefix.match(matchIconName) ? getAPIModule(provider) : null;
1003
- if (!api) {
1004
- parseLoaderResponse(storage2, valid, null);
1005
- return;
1006
- }
1007
- const params = api.prepare(provider, prefix, valid);
1008
- params.forEach((item) => {
1009
- sendAPIQuery(provider, item, (data) => {
1010
- parseLoaderResponse(storage2, item.icons, data);
1011
- });
1012
- });
1013
- });
1014
- }
1015
- }
1016
- const loadIcons = (icons, callback) => {
1017
- const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
1018
- const sortedIcons = sortIcons(cleanedIcons);
1019
- if (!sortedIcons.pending.length) {
1020
- let callCallback = true;
1021
- if (callback) setTimeout(() => {
1022
- if (callCallback) callback(sortedIcons.loaded, sortedIcons.missing, sortedIcons.pending, emptyCallback);
1023
- });
1024
- return () => {
1025
- callCallback = false;
1026
- };
1027
- }
1028
- const newIcons = /* @__PURE__ */ Object.create(null);
1029
- const sources = [];
1030
- let lastProvider, lastPrefix;
1031
- sortedIcons.pending.forEach((icon) => {
1032
- const { provider, prefix } = icon;
1033
- if (prefix === lastPrefix && provider === lastProvider) return;
1034
- lastProvider = provider;
1035
- lastPrefix = prefix;
1036
- sources.push(getStorage(provider, prefix));
1037
- const providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
1038
- if (!providerNewIcons[prefix]) providerNewIcons[prefix] = [];
1039
- });
1040
- sortedIcons.pending.forEach((icon) => {
1041
- const { provider, prefix, name } = icon;
1042
- const storage2 = getStorage(provider, prefix);
1043
- const pendingQueue = storage2.pendingIcons || (storage2.pendingIcons = /* @__PURE__ */ new Set());
1044
- if (!pendingQueue.has(name)) {
1045
- pendingQueue.add(name);
1046
- newIcons[provider][prefix].push(name);
1047
- }
1048
- });
1049
- sources.forEach((storage2) => {
1050
- const list = newIcons[storage2.provider][storage2.prefix];
1051
- if (list.length) loadNewIcons(storage2, list);
1052
- });
1053
- return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
1054
- };
1055
- function mergeCustomisations(defaults, item) {
1056
- const result = { ...defaults };
1057
- for (const key in item) {
1058
- const value = item[key];
1059
- const valueType = typeof value;
1060
- if (key in defaultIconSizeCustomisations) {
1061
- if (value === null || value && (valueType === "string" || valueType === "number")) result[key] = value;
1062
- } else if (valueType === typeof result[key]) result[key] = key === "rotate" ? value % 4 : value;
1063
- }
1064
- return result;
1065
- }
1066
- const separator = /[\s,]+/;
1067
- function flipFromString(custom, flip) {
1068
- flip.split(separator).forEach((str) => {
1069
- const value = str.trim();
1070
- switch (value) {
1071
- case "horizontal":
1072
- custom.hFlip = true;
1073
- break;
1074
- case "vertical":
1075
- custom.vFlip = true;
1076
- break;
1077
- }
1078
- });
1079
- }
1080
- function rotateFromString(value, defaultValue = 0) {
1081
- const units = value.replace(/^-?[0-9.]*/, "");
1082
- function cleanup(value$1) {
1083
- while (value$1 < 0) value$1 += 4;
1084
- return value$1 % 4;
1085
- }
1086
- if (units === "") {
1087
- const num = parseInt(value);
1088
- return isNaN(num) ? 0 : cleanup(num);
1089
- } else if (units !== value) {
1090
- let split = 0;
1091
- switch (units) {
1092
- case "%":
1093
- split = 25;
1094
- break;
1095
- case "deg":
1096
- split = 90;
1097
- }
1098
- if (split) {
1099
- let num = parseFloat(value.slice(0, value.length - units.length));
1100
- if (isNaN(num)) return 0;
1101
- num = num / split;
1102
- return num % 1 === 0 ? cleanup(num) : 0;
1103
- }
1104
- }
1105
- return defaultValue;
1106
- }
1107
- function iconToHTML(body, attributes2) {
1108
- let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
1109
- for (const attr2 in attributes2) renderAttribsHTML += " " + attr2 + '="' + attributes2[attr2] + '"';
1110
- return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
1111
- }
1112
- function encodeSVGforURL(svg) {
1113
- return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
1114
- }
1115
- function svgToData(svg) {
1116
- return "data:image/svg+xml," + encodeSVGforURL(svg);
1117
- }
1118
- function svgToURL(svg) {
1119
- return 'url("' + svgToData(svg) + '")';
1120
- }
1121
- const defaultExtendedIconCustomisations = {
1122
- ...defaultIconCustomisations,
1123
- inline: false
1124
- };
1125
- const svgDefaults = {
1126
- "xmlns": "http://www.w3.org/2000/svg",
1127
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
1128
- "aria-hidden": true,
1129
- "role": "img"
1130
- };
1131
- const commonProps = {
1132
- display: "inline-block"
1133
- };
1134
- const monotoneProps = {
1135
- "background-color": "currentColor"
1136
- };
1137
- const coloredProps = {
1138
- "background-color": "transparent"
1139
- };
1140
- const propsToAdd = {
1141
- image: "var(--svg)",
1142
- repeat: "no-repeat",
1143
- size: "100% 100%"
1144
- };
1145
- const propsToAddTo = {
1146
- "-webkit-mask": monotoneProps,
1147
- "mask": monotoneProps,
1148
- "background": coloredProps
1149
- };
1150
- for (const prefix in propsToAddTo) {
1151
- const list = propsToAddTo[prefix];
1152
- for (const prop in propsToAdd) {
1153
- list[prefix + "-" + prop] = propsToAdd[prop];
1154
- }
1155
- }
1156
- function fixSize(value) {
1157
- return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
1158
- }
1159
- function render(icon, props) {
1160
- const customisations = mergeCustomisations(defaultExtendedIconCustomisations, props);
1161
- const mode = props.mode || "svg";
1162
- const componentProps = mode === "svg" ? { ...svgDefaults } : {};
1163
- if (icon.body.indexOf("xlink:") === -1) {
1164
- delete componentProps["xmlns:xlink"];
1165
- }
1166
- let style = typeof props.style === "string" ? props.style : "";
1167
- for (let key in props) {
1168
- const value = props[key];
1169
- if (value === void 0) {
1170
- continue;
1171
- }
1172
- switch (key) {
1173
- case "icon":
1174
- case "style":
1175
- case "onLoad":
1176
- case "mode":
1177
- case "ssr":
1178
- break;
1179
- case "inline":
1180
- case "hFlip":
1181
- case "vFlip":
1182
- customisations[key] = value === true || value === "true" || value === 1;
1183
- break;
1184
- case "flip":
1185
- if (typeof value === "string") {
1186
- flipFromString(customisations, value);
1187
- }
1188
- break;
1189
- case "color":
1190
- style = style + (style.length > 0 && style.trim().slice(-1) !== ";" ? ";" : "") + "color: " + value + "; ";
1191
- break;
1192
- case "rotate":
1193
- if (typeof value === "string") {
1194
- customisations[key] = rotateFromString(value);
1195
- } else if (typeof value === "number") {
1196
- customisations[key] = value;
1197
- }
1198
- break;
1199
- case "ariaHidden":
1200
- case "aria-hidden":
1201
- if (value !== true && value !== "true") {
1202
- delete componentProps["aria-hidden"];
1203
- }
1204
- break;
1205
- default:
1206
- if (key.slice(0, 3) === "on:") {
1207
- break;
1208
- }
1209
- if (defaultExtendedIconCustomisations[key] === void 0) {
1210
- componentProps[key] = value;
1211
- }
1212
- }
1213
- }
1214
- const item = iconToSVG(icon, customisations);
1215
- const renderAttribs = item.attributes;
1216
- if (customisations.inline) {
1217
- style = "vertical-align: -0.125em; " + style;
1218
- }
1219
- if (mode === "svg") {
1220
- Object.assign(componentProps, renderAttribs);
1221
- if (style !== "") {
1222
- componentProps.style = style;
1223
- }
1224
- let localCounter = 0;
1225
- let id = props.id;
1226
- if (typeof id === "string") {
1227
- id = id.replace(/-/g, "_");
1228
- }
1229
- return {
1230
- svg: true,
1231
- attributes: componentProps,
1232
- body: replaceIDs(item.body, id ? () => id + "ID" + localCounter++ : "iconifySvelte")
1233
- };
1234
- }
1235
- const { body, width, height } = icon;
1236
- const useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
1237
- const html2 = iconToHTML(body, {
1238
- ...renderAttribs,
1239
- width: width + "",
1240
- height: height + ""
1241
- });
1242
- const url = svgToURL(html2);
1243
- const styles = {
1244
- "--svg": url
1245
- };
1246
- const size = (prop) => {
1247
- const value = renderAttribs[prop];
1248
- if (value) {
1249
- styles[prop] = fixSize(value);
1250
- }
1251
- };
1252
- size("width");
1253
- size("height");
1254
- Object.assign(styles, commonProps, useMask ? monotoneProps : coloredProps);
1255
- let customStyle = "";
1256
- for (const key in styles) {
1257
- customStyle += key + ": " + styles[key] + ";";
1258
- }
1259
- componentProps.style = customStyle + style;
1260
- return {
1261
- svg: false,
1262
- attributes: componentProps
1263
- };
1264
- }
1265
- allowSimpleNames(true);
1266
- setAPIModule("", fetchAPIModule);
1267
- if (typeof document !== "undefined" && typeof window !== "undefined") {
1268
- const _window = window;
1269
- if (_window.IconifyPreload !== void 0) {
1270
- const preload = _window.IconifyPreload;
1271
- const err = "Invalid IconifyPreload syntax.";
1272
- if (typeof preload === "object" && preload !== null) {
1273
- (preload instanceof Array ? preload : [preload]).forEach((item) => {
1274
- try {
1275
- if (
1276
- // Check if item is an object and not null/array
1277
- typeof item !== "object" || item === null || item instanceof Array || // Check for 'icons' and 'prefix'
1278
- typeof item.icons !== "object" || typeof item.prefix !== "string" || // Add icon set
1279
- !addCollection(item)
1280
- ) {
1281
- console.error(err);
1282
- }
1283
- } catch (e) {
1284
- console.error(err);
1285
- }
1286
- });
1287
- }
1288
- }
1289
- if (_window.IconifyProviders !== void 0) {
1290
- const providers = _window.IconifyProviders;
1291
- if (typeof providers === "object" && providers !== null) {
1292
- for (let key in providers) {
1293
- const err = "IconifyProviders[" + key + "] is invalid.";
1294
- try {
1295
- const value = providers[key];
1296
- if (typeof value !== "object" || !value || value.resources === void 0) {
1297
- continue;
1298
- }
1299
- if (!addAPIProvider(key, value)) {
1300
- console.error(err);
1301
- }
1302
- } catch (e) {
1303
- console.error(err);
1304
- }
1305
- }
1306
- }
1307
- }
1308
- }
1309
- function checkIconState(icon, state, mounted, callback, onload) {
1310
- function abortLoading() {
1311
- if (state.loading) {
1312
- state.loading.abort();
1313
- state.loading = null;
1314
- }
1315
- }
1316
- if (typeof icon === "object" && icon !== null && typeof icon.body === "string") {
1317
- state.name = "";
1318
- abortLoading();
1319
- return { data: { ...defaultIconProps, ...icon } };
1320
- }
1321
- let iconName;
1322
- if (typeof icon !== "string" || (iconName = stringToIcon(icon, false, true)) === null) {
1323
- abortLoading();
1324
- return null;
1325
- }
1326
- const data = getIconData(iconName);
1327
- if (!data) {
1328
- if (mounted && (!state.loading || state.loading.name !== icon)) {
1329
- abortLoading();
1330
- state.name = "";
1331
- state.loading = {
1332
- name: icon,
1333
- abort: loadIcons([iconName], callback)
1334
- };
1335
- }
1336
- return null;
1337
- }
1338
- abortLoading();
1339
- if (state.name !== icon) {
1340
- state.name = icon;
1341
- if (onload && !state.destroyed) {
1342
- setTimeout(() => {
1343
- onload(icon);
1344
- });
1345
- }
1346
- }
1347
- const classes = ["iconify"];
1348
- if (iconName.prefix !== "") {
1349
- classes.push("iconify--" + iconName.prefix);
1350
- }
1351
- if (iconName.provider !== "") {
1352
- classes.push("iconify--" + iconName.provider);
1353
- }
1354
- return { data, classes };
1355
- }
1356
- function generateIcon(icon, props) {
1357
- return icon ? render({
1358
- ...defaultIconProps,
1359
- ...icon
1360
- }, props) : null;
1361
- }
1362
- function Icon($$renderer, $$props) {
1363
- $$renderer.component(($$renderer2) => {
1364
- const iconState = {
1365
- // Last icon name
1366
- name: "",
1367
- // Loading status
1368
- loading: null,
1369
- // Destroyed status
1370
- destroyed: false
1371
- };
1372
- const { $$slots, $$events, ...props } = $$props;
1373
- let mounted = false;
1374
- let isMounted = !!props.ssr || mounted;
1375
- let iconData = (() => {
1376
- return checkIconState(props.icon, iconState, isMounted, loaded, props.onload);
1377
- })();
1378
- let data = (() => {
1379
- const generatedData = iconData ? generateIcon(iconData.data, props) : null;
1380
- if (generatedData && iconData.classes) {
1381
- generatedData.attributes["class"] = (typeof props["class"] === "string" ? props["class"] + " " : "") + iconData.classes.join(" ");
1382
- }
1383
- return generatedData;
1384
- })();
1385
- function loaded() {
1386
- }
1387
- onDestroy(() => {
1388
- iconState.destroyed = true;
1389
- if (iconState.loading) {
1390
- iconState.loading.abort();
1391
- iconState.loading = null;
1392
- }
1393
- });
1394
- if (data) {
1395
- $$renderer2.push("<!--[-->");
1396
- if (data.svg) {
1397
- $$renderer2.push("<!--[-->");
1398
- $$renderer2.push(`<svg${attributes({ ...data.attributes }, void 0, void 0, void 0, 3)}>${html(data.body)}</svg>`);
1399
- } else {
1400
- $$renderer2.push("<!--[!-->");
1401
- $$renderer2.push(`<span${attributes({ ...data.attributes })}></span>`);
1402
- }
1403
- $$renderer2.push(`<!--]-->`);
1404
- } else {
1405
- $$renderer2.push("<!--[!-->");
1406
- }
1407
- $$renderer2.push(`<!--]-->`);
1408
- });
1409
- }
1410
- function MiniEditor($$renderer, $$props) {
1411
- $$renderer.component(($$renderer2) => {
1412
- let editor = null;
1413
- let {
1414
- value,
1415
- onChange,
1416
- onBlur,
1417
- language = "plaintext",
1418
- height = 120
1419
- } = $$props;
1420
- onDestroy(() => {
1421
- try {
1422
- editor?.dispose();
1423
- } finally {
1424
- editor = null;
1425
- }
1426
- });
1427
- $$renderer2.push(`<div class="w-full"${attr_style(
1428
- // Update language when prop changes without recreating the editor
1429
- // External value changes should update the model (avoid loops)
1430
- `height:${height}px`
1431
- )}></div>`);
1432
- });
1433
- }
1434
- function _page($$renderer, $$props) {
1435
- $$renderer.component(($$renderer2) => {
1436
- const { onAgentSelect } = getAgentsContext();
1437
- let { params } = $$props;
1438
- let agents = [];
1439
- const agent = params.agent;
1440
- let repeats = 1;
1441
- let concurrency = 1;
1442
- let defaultContext = {};
1443
- let defaultContextDraft = {};
1444
- let showDefaultContextModal = false;
1445
- let showViewerModal = false;
1446
- let viewerTitle = "";
1447
- let viewerContent = null;
1448
- let viewerLoading = false;
1449
- let viewerError = null;
1450
- let showTestContextModal = false;
1451
- let activeContextTestId = null;
1452
- let testContextDraft = "";
1453
- function safeClone(v) {
1454
- try {
1455
- return structuredClone(v);
1456
- } catch (e) {
1457
- try {
1458
- return JSON.parse(JSON.stringify(v));
1459
- } catch {
1460
- return v;
1461
- }
1462
- }
1463
- }
1464
- async function openViewer(title, params2) {
1465
- viewerTitle = title;
1466
- viewerContent = null;
1467
- viewerError = null;
1468
- viewerLoading = true;
1469
- showViewerModal = true;
1470
- try {
1471
- const text = await trpc.tests.resultEntry.query({
1472
- agent: params2.agent,
1473
- testId: params2.id,
1474
- resultKey: params2.key,
1475
- timestamp: params2.timestamp,
1476
- index: params2.run
1477
- });
1478
- let formatted = text;
1479
- try {
1480
- const json = JSON.parse(text);
1481
- formatted = JSON.stringify(json, null, 2);
1482
- } catch {
1483
- }
1484
- viewerContent = formatted;
1485
- } catch (e) {
1486
- console.error(e);
1487
- viewerError = "Failed to load content";
1488
- } finally {
1489
- viewerLoading = false;
1490
- }
1491
- }
1492
- const baseAssertionTypes = [
1493
- // Non-deterministic / model-graded
1494
- { value: "llm-rubric", label: "LLM" },
1495
- { value: "answer-relevance", label: "Answer Relevance (LLM)" },
1496
- {
1497
- value: "context-faithfulness",
1498
- label: "Context Faithfulness (LLM)"
1499
- },
1500
- { value: "context-recall", label: "Context Recall (LLM)" },
1501
- { value: "context-relevance", label: "Context Relevance (LLM)" },
1502
- {
1503
- value: "model-graded-closedqa",
1504
- label: "Model-Graded Closed QA"
1505
- },
1506
- {
1507
- value: "model-graded-factuality",
1508
- label: "Model-Graded Factuality"
1509
- },
1510
- { value: "moderation", label: "Moderation" },
1511
- { value: "classifier", label: "Classifier" },
1512
- { value: "g-eval", label: "G-Eval" },
1513
- { value: "factuality", label: "Factuality" },
1514
- {
1515
- value: "conversation-relevance",
1516
- label: "Conversation Relevance"
1517
- },
1518
- // Deterministic string/content checks
1519
- { value: "equals", label: "Equals" },
1520
- { value: "contains", label: "Contains" },
1521
- { value: "icontains", label: "Contains (case-insensitive)" },
1522
- { value: "contains-all", label: "Contains All" },
1523
- { value: "contains-any", label: "Contains Any" },
1524
- { value: "icontains-all", label: "Contains All (iCase)" },
1525
- { value: "icontains-any", label: "Contains Any (iCase)" },
1526
- { value: "starts-with", label: "Starts With" },
1527
- { value: "regex", label: "Regex" },
1528
- { value: "levenshtein", label: "Levenshtein Distance" },
1529
- { value: "is-refusal", label: "Is Refusal" },
1530
- // Content type assertions
1531
- { value: "is-html", label: "Is HTML" },
1532
- { value: "contains-html", label: "Contains HTML" },
1533
- { value: "is-json", label: "Is JSON" },
1534
- { value: "contains-json", label: "Contains JSON" },
1535
- { value: "is-xml", label: "Is XML" },
1536
- { value: "contains-xml", label: "Contains XML" },
1537
- { value: "is-sql", label: "Is SQL" },
1538
- { value: "contains-sql", label: "Contains SQL" },
1539
- // Metrics
1540
- { value: "similar", label: "Semantic Similarity" },
1541
- { value: "rouge-n", label: "ROUGE-N" },
1542
- { value: "bleu", label: "BLEU" },
1543
- { value: "gleu", label: "GLEU" },
1544
- { value: "meteor", label: "METEOR" },
1545
- { value: "perplexity", label: "Perplexity" },
1546
- { value: "perplexity-score", label: "Perplexity Score" },
1547
- // Performance/trace
1548
- { value: "latency", label: "Latency" },
1549
- { value: "cost", label: "Cost" },
1550
- { value: "finish-reason", label: "Finish Reason" },
1551
- { value: "trace-error-spans", label: "Trace Error Spans" },
1552
- { value: "trace-span-count", label: "Trace Span Count" },
1553
- { value: "trace-span-duration", label: "Trace Span Duration" },
1554
- // Tools/validators
1555
- {
1556
- value: "is-valid-function-call",
1557
- label: "Is Valid Function Call"
1558
- },
1559
- {
1560
- value: "is-valid-openai-function-call",
1561
- label: "Is Valid OpenAI Function Call"
1562
- },
1563
- {
1564
- value: "is-valid-openai-tools-call",
1565
- label: "Is Valid OpenAI Tools Call"
1566
- },
1567
- { value: "guardrails", label: "Guardrails" },
1568
- // Custom hooks
1569
- { value: "javascript", label: "JavaScript (custom)" },
1570
- { value: "python", label: "Python (custom)" },
1571
- { value: "webhook", label: "Webhook (custom)" },
1572
- { value: "pi", label: "Pi Scorer" }
1573
- ];
1574
- const assertionTypes = [
1575
- ...baseAssertionTypes,
1576
- ...baseAssertionTypes.map((opt) => ({ value: `not-${opt.value}`, label: `Not ${opt.label}` }))
1577
- ];
1578
- let tests = [];
1579
- let running = false;
1580
- let runScope = null;
1581
- let runDone = 0;
1582
- let runTotal = 0;
1583
- let pollInFlight = false;
1584
- let pollTimer = null;
1585
- let runToken = 0;
1586
- const pendingSaves = /* @__PURE__ */ new Set();
1587
- let pendingSaveCount = 0;
1588
- const isSaving = pendingSaveCount > 0;
1589
- let hasFetchedTests = false;
1590
- function trackSave(p) {
1591
- pendingSaves.add(p);
1592
- pendingSaveCount += 1;
1593
- p.finally(() => {
1594
- pendingSaves.delete(p);
1595
- pendingSaveCount -= 1;
1596
- });
1597
- return p;
1598
- }
1599
- function makeResult(id, rr) {
1600
- return {
1601
- success_rate: rr.success_rate,
1602
- total_runs: Array.isArray(rr.results) ? rr.results.length : 0,
1603
- isOld: !!rr.is_old,
1604
- runs: (Array.isArray(rr.results) ? rr.results : []).map((run2, idx) => {
1605
- const timestamp = rr.report_timestamp;
1606
- const params2 = { agent, id, timestamp, run: idx };
1607
- return {
1608
- index: idx + 1,
1609
- success: !!run2.success,
1610
- text: String(run2.result || ""),
1611
- evaluation: String(run2.evaluation || ""),
1612
- links: {
1613
- renderedPrompt: { ...params2, key: "rendered_prompt" },
1614
- receivedPrompt: { ...params2, key: "received_prompt" },
1615
- conversation: { ...params2, key: "stringified_conversation" },
1616
- context: { ...params2, key: "received_context" },
1617
- logs: { ...params2, key: "logs" },
1618
- traces: { ...params2, key: "traces" }
1619
- }
1620
- };
1621
- })
1622
- };
1623
- }
1624
- async function refresh() {
1625
- try {
1626
- const [{ rows }, config, results] = await Promise.all([
1627
- trpc.tests.list.query({ agent }),
1628
- trpc.tests.config.query({ agent }),
1629
- trpc.tests.latestResult.query({ agent })
1630
- ]);
1631
- repeats = config.repeats ?? 1;
1632
- concurrency = config.concurrency ?? 1;
1633
- defaultContext = config.defaultContext ?? {};
1634
- tests = rows.map((r) => {
1635
- const id = r.id;
1636
- const rr = results[id];
1637
- return {
1638
- id,
1639
- pinned: String(r.pinned).toUpperCase() === "TRUE",
1640
- scenario: r.scenario || "",
1641
- author: r.author || "",
1642
- assertion_type: r.assertion_type || "llm-rubric",
1643
- assertion_value: r.assertion_value || "",
1644
- conversation: r.conversation || "",
1645
- expected_output: r.expected_output || "",
1646
- timeout: Number(r.timeout ?? 0),
1647
- similarity_threshold: Number(r.similarity_threshold ?? 60),
1648
- context: JSON.stringify(r.context),
1649
- result: rr ? makeResult(id, rr) : void 0
1650
- };
1651
- });
1652
- } catch {
1653
- tests = [];
1654
- repeats = 1;
1655
- concurrency = 1;
1656
- defaultContext = {};
1657
- } finally {
1658
- hasFetchedTests = true;
1659
- }
1660
- }
1661
- async function pollLatestResults(activeToken) {
1662
- if (pollInFlight) return;
1663
- pollInFlight = true;
1664
- try {
1665
- const results = await trpc.tests.latestResult.query({ agent });
1666
- if (activeToken !== runToken) return;
1667
- const nextTests = tests.map((t) => {
1668
- const rr = results[t.id];
1669
- return { ...t, result: rr ? makeResult(t.id, rr) : void 0 };
1670
- });
1671
- tests = nextTests;
1672
- const scope = runScope;
1673
- const done = nextTests.reduce(
1674
- (acc, t) => {
1675
- if (scope === "pinned" && !t.pinned) return acc;
1676
- return t.result && !t.result.isOld ? acc + 1 : acc;
1677
- },
1678
- 0
1679
- );
1680
- runDone = done;
1681
- } catch (e) {
1682
- console.error(e);
1683
- } finally {
1684
- pollInFlight = false;
1685
- }
1686
- }
1687
- async function run(scope) {
1688
- running = true;
1689
- runScope = scope;
1690
- runTotal = scope === "all" ? tests.length : tests.filter((t) => t.pinned).length;
1691
- runDone = 0;
1692
- runToken += 1;
1693
- const activeToken = runToken;
1694
- await Promise.all([...pendingSaves]);
1695
- if (pollTimer) clearInterval(pollTimer);
1696
- pollTimer = setInterval(() => pollLatestResults(activeToken), 800);
1697
- void pollLatestResults(activeToken);
1698
- try {
1699
- await trpc.tests.runTests.mutate({ agent, scope });
1700
- } finally {
1701
- if (pollTimer) clearInterval(pollTimer);
1702
- pollTimer = null;
1703
- try {
1704
- await refresh();
1705
- } finally {
1706
- running = false;
1707
- runScope = null;
1708
- }
1709
- }
1710
- }
1711
- const pinnedCount = tests.filter((t) => t.pinned).length;
1712
- const hasPinned = pinnedCount > 0;
1713
- const allPinned = tests.length > 0 && pinnedCount === tests.length;
1714
- const somePinned = pinnedCount > 0 && !allPinned;
1715
- async function addTest() {
1716
- const res = await trpc.tests.addTest.mutate({ agent, seed: {}, mergeContexts: true });
1717
- tests = [parseTest(res), ...tests];
1718
- }
1719
- function parseTest(res) {
1720
- return {
1721
- ...res,
1722
- pinned: res.pinned === "TRUE",
1723
- timeout: Number(res.timeout),
1724
- similarity_threshold: Number(res.similarity_threshold),
1725
- context: JSON.stringify(res.context)
1726
- };
1727
- }
1728
- function clamp(n, min, max) {
1729
- return Math.max(min, Math.min(max, n));
1730
- }
1731
- function formatEvaluation(ev) {
1732
- if (!ev) return "";
1733
- try {
1734
- return ev.replace(/^\s*\d+\s*[:.)-]?\s*(?:[❌✖️✔✅✗xX])?\s*/u, "");
1735
- } catch {
1736
- return ev;
1737
- }
1738
- }
1739
- function parseJson(s) {
1740
- try {
1741
- return s && s.trim() ? JSON.parse(s) : {};
1742
- } catch {
1743
- return {};
1744
- }
1745
- }
1746
- const saveTimers = /* @__PURE__ */ new Map();
1747
- function saveRowDebounced(id, patch, delay = 600) {
1748
- const key = `${id}:context`;
1749
- const prev = saveTimers.get(key);
1750
- if (prev) clearTimeout(prev);
1751
- const t = setTimeout(
1752
- () => {
1753
- trackSave(saveRow(id, patch));
1754
- saveTimers.delete(key);
1755
- },
1756
- delay
1757
- );
1758
- saveTimers.set(key, t);
1759
- }
1760
- async function saveRow(id, patch) {
1761
- await trpc.tests.patchTest.mutate({ agent, id, patch });
1762
- }
1763
- async function saveConfigPatch(patch) {
1764
- trpc.tests.updateConfig.mutate({ agent: params.agent, cfg: patch });
1765
- }
1766
- const dec = (s) => {
1767
- try {
1768
- return s ? decodeURIComponent(s) : "";
1769
- } catch {
1770
- return s || "";
1771
- }
1772
- };
1773
- const currentAgentNorm = (() => {
1774
- return dec(agent).trim().replace(/^\/+|\/+$/g, "");
1775
- })();
1776
- const activeTopTab = (() => page.url.pathname.split("/")[1])();
1777
- function handleTabChange({ value }) {
1778
- if (value === activeTopTab) return;
1779
- page.url.searchParams.get("step");
1780
- if (value === "roleplay") {
1781
- goto();
1782
- return;
1783
- }
1784
- if (value === "tests") {
1785
- goto();
1786
- return;
1787
- }
1788
- if (value === "traces") {
1789
- goto();
1790
- return;
1791
- }
1792
- goto();
1793
- }
1794
- function handleAgentClick(agentId) {
1795
- onAgentSelect(agentId);
1796
- const [proj, ag] = (agentId || "").split("/");
1797
- if (proj && ag) goto();
1798
- }
1799
- onDestroy(() => {
1800
- if (pollTimer) clearInterval(pollTimer);
1801
- });
1802
- let $$settled = true;
1803
- let $$inner_renderer;
1804
- function $$render_inner($$renderer3) {
1805
- head($$renderer3, ($$renderer4) => {
1806
- $$renderer4.title(($$renderer5) => {
1807
- $$renderer5.push(`<title>Recombine: Tests</title>`);
1808
- });
1809
- $$renderer4.push(`<link rel="preload" href="/ui/arrow_tests.svg" as="image"/>`);
1810
- });
1811
- $$renderer3.push(`<div class="flex h-screen">`);
1812
- AgentSidebar($$renderer3, {
1813
- className: "flex-none",
1814
- agents,
1815
- currentAgent: currentAgentNorm,
1816
- onAgentClick: handleAgentClick
1817
- });
1818
- $$renderer3.push(`<!----> <div class="flex h-full min-w-0 flex-1 flex-col bg-rc-gray-980 pb-3 pr-4 pt-2"><nav class="mb-3 flex h-14 flex-none items-center justify-between bg-rc-gray-980"><div class="flex items-center">`);
1819
- Tabs($$renderer3, {
1820
- value: activeTopTab,
1821
- ariaLabel: "Top tabs",
1822
- onChange: handleTabChange,
1823
- children: ($$renderer4) => {
1824
- Tab($$renderer4, {
1825
- value: "roleplay",
1826
- children: ($$renderer5) => {
1827
- $$renderer5.push(`<!---->Roleplay`);
1828
- }
1829
- });
1830
- $$renderer4.push(`<!----> `);
1831
- Tab($$renderer4, {
1832
- value: "tests",
1833
- children: ($$renderer5) => {
1834
- $$renderer5.push(`<!---->Tests`);
1835
- }
1836
- });
1837
- $$renderer4.push(`<!----> `);
1838
- Tab($$renderer4, {
1839
- value: "traces",
1840
- children: ($$renderer5) => {
1841
- $$renderer5.push(`<!---->Traces`);
1842
- }
1843
- });
1844
- $$renderer4.push(`<!---->`);
1845
- },
1846
- $$slots: { default: true }
1847
- });
1848
- $$renderer3.push(`<!----></div> `);
1849
- Panel($$renderer3, {
1850
- class: "!rounded-none p-3 pr-0",
1851
- children: ($$renderer4) => {
1852
- $$renderer4.push(`<div class="flex items-center gap-16"><div class="flex items-center">`);
1853
- Button($$renderer4, {
1854
- variant: "ghost",
1855
- class: "text-sm font-semibold text-rc-gray-400 underline decoration-dashed underline-offset-4 hover:text-rc-gray-200",
1856
- onclick: () => {
1857
- defaultContextDraft = safeClone(defaultContext);
1858
- showDefaultContextModal = true;
1859
- },
1860
- children: ($$renderer5) => {
1861
- $$renderer5.push(`<!---->Default context`);
1862
- },
1863
- $$slots: { default: true }
1864
- });
1865
- $$renderer4.push(`<!----> <div class="relative inline-flex items-center">`);
1866
- Button($$renderer4, {
1867
- variant: "secondary",
1868
- onclick: addTest,
1869
- children: ($$renderer5) => {
1870
- $$renderer5.push(`<!---->New test`);
1871
- },
1872
- $$slots: { default: true }
1873
- });
1874
- $$renderer4.push(`<!----> `);
1875
- if (hasFetchedTests && tests.length === 0) {
1876
- $$renderer4.push("<!--[-->");
1877
- $$renderer4.push(`<div class="pointer-events-none absolute -left-28 top-full mt-4 inline-flex -translate-x-1/2 flex-col items-center"><div class="relative w-50vw max-w-2xl"><img src="/ui/arrow_tests.svg" alt="Arrow" class="block h-auto w-full object-contain"/> <span class="absolute inset-0 mt-48 flex items-center justify-center text-center text-4xl font-extrabold text-rc-gray-200">No tests yet.<br/>Add the first one</span></div></div>`);
1878
- } else {
1879
- $$renderer4.push("<!--[!-->");
1880
- }
1881
- $$renderer4.push(`<!--]--></div></div> <div class="flex flex-wrap items-center gap-3">`);
1882
- if (running) {
1883
- $$renderer4.push("<!--[-->");
1884
- $$renderer4.push(`<div class="mr-3 flex items-center gap-3"><span class="animate-pulse rounded bg-rc-green-200 px-2 py-1 text-xs text-white">Running… ${escape_html(runDone)}/${escape_html(runTotal)}</span></div>`);
1885
- } else {
1886
- $$renderer4.push("<!--[!-->");
1887
- }
1888
- $$renderer4.push(`<!--]--> <div class="flex items-center gap-2"><label class="font-semibold text-rc-gray-300">Repeats</label> `);
1889
- Input($$renderer4, {
1890
- type: "number",
1891
- min: "0",
1892
- max: "500",
1893
- class: "w-16",
1894
- onchange: () => {
1895
- repeats = clamp(+repeats || 0, 0, 500);
1896
- trackSave(saveConfigPatch({ repeats }));
1897
- },
1898
- get value() {
1899
- return repeats;
1900
- },
1901
- set value($$value) {
1902
- repeats = $$value;
1903
- $$settled = false;
1904
- }
1905
- });
1906
- $$renderer4.push(`<!----></div> <div class="flex items-center gap-2"><label class="font-semibold text-rc-gray-300">Concurrency</label> `);
1907
- Input($$renderer4, {
1908
- type: "number",
1909
- min: "0",
1910
- max: "20",
1911
- class: "w-16",
1912
- onchange: () => {
1913
- concurrency = clamp(+concurrency || 0, 0, 20);
1914
- trackSave(saveConfigPatch({ concurrency }));
1915
- },
1916
- get value() {
1917
- return concurrency;
1918
- },
1919
- set value($$value) {
1920
- concurrency = $$value;
1921
- $$settled = false;
1922
- }
1923
- });
1924
- $$renderer4.push(`<!----></div> `);
1925
- Button($$renderer4, {
1926
- variant: "secondary",
1927
- class: "disabled:cursor-not-allowed disabled:opacity-50",
1928
- disabled: !hasPinned || running || isSaving,
1929
- onclick: () => run("pinned"),
1930
- children: ($$renderer5) => {
1931
- $$renderer5.push(`<!---->Run pinned`);
1932
- },
1933
- $$slots: { default: true }
1934
- });
1935
- $$renderer4.push(`<!----> `);
1936
- Button($$renderer4, {
1937
- class: "disabled:cursor-not-allowed disabled:opacity-50",
1938
- disabled: running || isSaving || tests.length === 0,
1939
- onclick: () => run("all"),
1940
- children: ($$renderer5) => {
1941
- $$renderer5.push(`<!---->Run all`);
1942
- },
1943
- $$slots: { default: true }
1944
- });
1945
- $$renderer4.push(`<!----></div></div>`);
1946
- }
1947
- });
1948
- $$renderer3.push(`<!----></nav> `);
1949
- {
1950
- let children = function($$renderer4) {
1951
- ContextEditor($$renderer4, {
1952
- class: "h-[70vh]",
1953
- context: defaultContextDraft,
1954
- onContextChanged: (ctx) => defaultContextDraft = ctx,
1955
- suppressErrors: true,
1956
- defaultFormat: "json",
1957
- hideHeader: true
1958
- });
1959
- }, footer = function($$renderer4) {
1960
- Button($$renderer4, {
1961
- variant: "outlined",
1962
- size: "small",
1963
- onclick: () => {
1964
- showDefaultContextModal = false;
1965
- },
1966
- children: ($$renderer5) => {
1967
- $$renderer5.push(`<!---->Cancel`);
1968
- },
1969
- $$slots: { default: true }
1970
- });
1971
- $$renderer4.push(`<!----> `);
1972
- Button($$renderer4, {
1973
- size: "small",
1974
- onclick: async () => {
1975
- defaultContext = defaultContextDraft;
1976
- await trackSave(saveConfigPatch({ defaultContext }));
1977
- showDefaultContextModal = false;
1978
- },
1979
- children: ($$renderer5) => {
1980
- $$renderer5.push(`<!---->Save`);
1981
- },
1982
- $$slots: { default: true }
1983
- });
1984
- $$renderer4.push(`<!---->`);
1985
- };
1986
- Modal($$renderer3, {
1987
- title: "Default Context",
1988
- get open() {
1989
- return showDefaultContextModal;
1990
- },
1991
- set open($$value) {
1992
- showDefaultContextModal = $$value;
1993
- $$settled = false;
1994
- },
1995
- children,
1996
- footer,
1997
- $$slots: { default: true, footer: true }
1998
- });
1999
- }
2000
- $$renderer3.push(`<!----> `);
2001
- {
2002
- let children = function($$renderer4) {
2003
- MiniEditor($$renderer4, {
2004
- value: testContextDraft,
2005
- onChange: (v) => testContextDraft = v,
2006
- language: "json",
2007
- height: 360
2008
- });
2009
- }, footer = function($$renderer4) {
2010
- Button($$renderer4, {
2011
- variant: "outlined",
2012
- size: "small",
2013
- onclick: () => {
2014
- showTestContextModal = false;
2015
- activeContextTestId = null;
2016
- },
2017
- children: ($$renderer5) => {
2018
- $$renderer5.push(`<!---->Cancel`);
2019
- },
2020
- $$slots: { default: true }
2021
- });
2022
- $$renderer4.push(`<!----> `);
2023
- Button($$renderer4, {
2024
- size: "small",
2025
- onclick: async () => {
2026
- const row = tests.find((r) => r.id === activeContextTestId);
2027
- if (row) {
2028
- row.context = testContextDraft;
2029
- await trackSave(saveRow(row.id, { context: JSON.parse(row.context) }));
2030
- }
2031
- showTestContextModal = false;
2032
- activeContextTestId = null;
2033
- },
2034
- children: ($$renderer5) => {
2035
- $$renderer5.push(`<!---->Save`);
2036
- },
2037
- $$slots: { default: true }
2038
- });
2039
- $$renderer4.push(`<!---->`);
2040
- };
2041
- Modal($$renderer3, {
2042
- title: "Edit Test Context",
2043
- get open() {
2044
- return showTestContextModal;
2045
- },
2046
- set open($$value) {
2047
- showTestContextModal = $$value;
2048
- $$settled = false;
2049
- },
2050
- children,
2051
- footer,
2052
- $$slots: { default: true, footer: true }
2053
- });
2054
- }
2055
- $$renderer3.push(`<!----> `);
2056
- {
2057
- let children = function($$renderer4) {
2058
- if (viewerLoading) {
2059
- $$renderer4.push("<!--[-->");
2060
- $$renderer4.push(`<div class="text-sm text-gray-300">Loading…</div>`);
2061
- } else {
2062
- $$renderer4.push("<!--[!-->");
2063
- if (viewerError) {
2064
- $$renderer4.push("<!--[-->");
2065
- $$renderer4.push(`<div class="text-sm text-red-400">${escape_html(viewerError)}</div>`);
2066
- } else {
2067
- $$renderer4.push("<!--[!-->");
2068
- $$renderer4.push(`<pre class="whitespace-pre-wrap font-mono text-sm text-gray-200">${escape_html(viewerContent)}</pre>`);
2069
- }
2070
- $$renderer4.push(`<!--]-->`);
2071
- }
2072
- $$renderer4.push(`<!--]-->`);
2073
- };
2074
- Modal($$renderer3, {
2075
- title: viewerTitle,
2076
- class: "w-fit min-w-[560px]",
2077
- get open() {
2078
- return showViewerModal;
2079
- },
2080
- set open($$value) {
2081
- showViewerModal = $$value;
2082
- $$settled = false;
2083
- },
2084
- children,
2085
- $$slots: { default: true }
2086
- });
2087
- }
2088
- $$renderer3.push(`<!----> <div class="rc-scroll h-[calc(100vh-3.5rem)] overflow-auto p-0">`);
2089
- if (!hasFetchedTests) {
2090
- $$renderer3.push("<!--[-->");
2091
- $$renderer3.push(`<div class="flex h-full items-center justify-center text-sm text-gray-400">Loading tests…</div>`);
2092
- } else {
2093
- $$renderer3.push("<!--[!-->");
2094
- if (tests.length > 0) {
2095
- $$renderer3.push("<!--[-->");
2096
- Panel($$renderer3, {
2097
- class: "overflow-hidden !rounded-none p-0",
2098
- children: ($$renderer4) => {
2099
- $$renderer4.push(`<div class="overflow-auto"><table class="min-w-full text-sm"><thead><tr class="align-top"><th class="w-20 p-0 text-center"><div class="flex items-center justify-end pr-2"><span class="font-normal">Pin all</span> <button${attr_class(`inline-flex h-8 w-8 items-center justify-center rounded disabled:cursor-not-allowed disabled:opacity-50 ${stringify(allPinned || somePinned ? "text-rc-green-400 hover:text-rc-green-300" : "text-gray-400 hover:text-gray-200")}`)} aria-label="Pin/unpin all" title="Pin/unpin all"${attr("disabled", running || isSaving || tests.length === 0, true)}>`);
2100
- Icon($$renderer4, {
2101
- icon: allPinned ? "mdi:pin" : "mdi:pin-outline",
2102
- width: 18,
2103
- height: 18,
2104
- class: "relative top-[1px]"
2105
- });
2106
- $$renderer4.push(`<!----></button></div></th><th class="p-0"><div class="p-2"><div class="grid grid-cols-1 gap-3 md:grid-cols-12"><div class="flex items-center justify-between md:col-span-4"><span class="text-left font-semibold text-rc-gray-300">Pinned: ${escape_html(pinnedCount)}/${escape_html(tests.length)}</span> <span class="mr-3 text-right font-semibold uppercase tracking-wide text-gray-300">Test</span></div> <div class="ml-3 text-left font-semibold uppercase tracking-wide text-gray-300 md:col-span-8">Result</div></div></div></th></tr></thead><tbody><!--[-->`);
2107
- const each_array = ensure_array_like(tests);
2108
- for (let i = 0, $$length = each_array.length; i < $$length; i++) {
2109
- let t = each_array[i];
2110
- $$renderer4.push(`<tr class="align-top"><td class="w-20 p-0 text-center align-top"><div class="p-2"><div class="flex items-center justify-center gap-1"><span class="inline-flex h-8 w-8 cursor-grab select-none items-center justify-center rounded text-xl leading-none text-gray-400 hover:text-gray-200 active:cursor-grabbing" title="Drag row" aria-label="Drag row">⠿</span> <button${attr_class(`inline-flex h-8 w-8 items-center justify-center rounded disabled:cursor-not-allowed disabled:opacity-50 ${stringify(t.pinned ? "text-rc-green-400 hover:text-rc-green-300" : "text-gray-400 hover:text-gray-200")}`)}${attr("aria-label", t.pinned ? "Unpin" : "Pin")}${attr("title", t.pinned ? "Unpin" : "Pin")}${attr("disabled", running || isSaving, true)}>`);
2111
- Icon($$renderer4, {
2112
- icon: t.pinned ? "mdi:pin" : "mdi:pin-outline",
2113
- width: 18,
2114
- height: 18,
2115
- class: "relative top-[1px]"
2116
- });
2117
- $$renderer4.push(`<!----></button></div></div></td><td class="p-0"><div class="border-b border-rc-gray-700 p-2"><div class="mt-2 grid grid-cols-1 gap-3 md:grid-cols-12"><div class="self-start md:col-span-4"><div class="left-details-bg flex flex-col gap-2 rounded border border-rc-gray-700 p-2 svelte-f5z0gs"><div class="mb-1 flex justify-between"><div><input class="card-input-title svelte-f5z0gs" type="text" placeholder="Scenario"${attr("value", t.scenario)}/> <input class="card-input-subtle mt-1 svelte-f5z0gs" type="text" placeholder="Author"${attr("value", t.author)}/></div> <button title="Delete" class="m-2 inline-flex shrink-0 text-xl text-rc-gray-200 hover:text-rc-gray-100">🗑</button></div> <div class="flex items-center gap-2">`);
2118
- $$renderer4.select(
2119
- {
2120
- class: "rc-scroll rc-input w-36",
2121
- value: t.assertion_type,
2122
- "aria-label": "Assertion Type",
2123
- onchange: () => saveRow(t.id, { assertion_type: t.assertion_type })
2124
- },
2125
- ($$renderer5) => {
2126
- $$renderer5.push(`<!--[-->`);
2127
- const each_array_1 = ensure_array_like(assertionTypes);
2128
- for (let $$index = 0, $$length2 = each_array_1.length; $$index < $$length2; $$index++) {
2129
- let opt = each_array_1[$$index];
2130
- $$renderer5.option({ value: opt.value }, ($$renderer6) => {
2131
- $$renderer6.push(`${escape_html(opt.label)}`);
2132
- });
2133
- }
2134
- $$renderer5.push(`<!--]-->`);
2135
- },
2136
- "svelte-f5z0gs"
2137
- );
2138
- $$renderer4.push(` <input class="rc-input min-w-0 flex-1 svelte-f5z0gs" type="text"${attr("value", t.assertion_value)} placeholder="Assertion value"/> <button title="Duplicate" class="mr-2 shrink-0 text-gray-300 hover:text-gray-100 disabled:cursor-not-allowed disabled:opacity-50"${attr("disabled", running || isSaving, true)}>`);
2139
- Icon($$renderer4, { icon: "mdi:content-copy", width: 18, height: 18 });
2140
- $$renderer4.push(`<!----></button></div> <div class="flex items-center gap-3"><div class="flex items-center gap-1"><span class="text-xs uppercase tracking-wide text-gray-400">Timeout</span> <input class="rc-input no-spin w-16 svelte-f5z0gs" type="number" min="0" max="999"${attr("value", t.timeout)} placeholder="Timeout"/> <span class="text-xs text-gray-400">sec</span></div> <div class="flex items-center gap-1"><span class="text-xs uppercase tracking-wide text-gray-400">Similarity</span> <input class="rc-input no-spin w-16 svelte-f5z0gs" type="number" min="0" max="100"${attr("value", t.similarity_threshold)} placeholder="Similarity (%)"/> <span class="text-xs text-gray-400">%</span></div></div> <div class="text-xs uppercase tracking-wide text-gray-400">Test context</div> `);
2141
- ContextEditor($$renderer4, {
2142
- class: "h-24",
2143
- context: parseJson(t.context),
2144
- suppressErrors: true,
2145
- defaultFormat: "yaml",
2146
- hideHeader: true,
2147
- onContextChanged: (ctx) => {
2148
- try {
2149
- const str = JSON.stringify(ctx);
2150
- t.context = str;
2151
- saveRowDebounced(t.id, { context: ctx });
2152
- } catch {
2153
- }
2154
- }
2155
- });
2156
- $$renderer4.push(`<!----> <div class="text-xs uppercase tracking-wide text-gray-400">Conversation</div> `);
2157
- MiniEditor($$renderer4, {
2158
- value: t.conversation,
2159
- onChange: (v) => t.conversation = v,
2160
- onBlur: () => saveRow(t.id, { conversation: t.conversation }),
2161
- language: "markdown",
2162
- height: 140
2163
- });
2164
- $$renderer4.push(`<!----> <div class="text-xs uppercase tracking-wide text-gray-400">Expected</div> `);
2165
- MiniEditor($$renderer4, {
2166
- value: t.expected_output,
2167
- onChange: (v) => t.expected_output = v,
2168
- onBlur: () => saveRow(t.id, { expected_output: t.expected_output }),
2169
- language: "markdown",
2170
- height: 120
2171
- });
2172
- $$renderer4.push(`<!----></div></div> <div class="md:col-span-8"><div class="mb-2 ml-3 text-sm">`);
2173
- if (t.result) {
2174
- $$renderer4.push("<!--[-->");
2175
- $$renderer4.push(`<div class="text-lg font-extrabold"><span class="text-rc-gray-200">${escape_html(t.result.runs.filter((r) => r.success).length)}/${escape_html(t.result.total_runs)}</span> `);
2176
- if (t.result.isOld) {
2177
- $$renderer4.push("<!--[-->");
2178
- $$renderer4.push(`<span class="text-rc-gray-400">(old)</span>`);
2179
- } else {
2180
- $$renderer4.push("<!--[!-->");
2181
- }
2182
- $$renderer4.push(`<!--]--></div> <span class="block font-medium text-rc-gray-400">Success:</span>`);
2183
- } else {
2184
- $$renderer4.push("<!--[!-->");
2185
- $$renderer4.push(`<span class="ml-3 text-gray-500">—</span>`);
2186
- }
2187
- $$renderer4.push(`<!--]--></div> `);
2188
- if (t.result) {
2189
- $$renderer4.push("<!--[-->");
2190
- $$renderer4.push(`<div class="flex flex-col gap-3"><!--[-->`);
2191
- const each_array_2 = ensure_array_like(t.result.runs);
2192
- for (let $$index_1 = 0, $$length2 = each_array_2.length; $$index_1 < $$length2; $$index_1++) {
2193
- let run2 = each_array_2[$$index_1];
2194
- $$renderer4.push(`<div class="max-w-3xl rounded-md border border-rc-gray-700 bg-rc-gray-800/40 px-3 py-2"><div${attr_class(`w-full whitespace-pre-wrap break-words rounded-lg px-3 py-2 text-rc-gray-100 ${run2.success ? "bg-rc-green-700 backdrop-blur-md" : ""}`, "svelte-f5z0gs")}${attr_style(!run2.success ? "background-color: rgb(156 80 80)" : "")}>${escape_html(run2.text || "—")}</div> <div${attr_class(`mt-2 flex w-full flex-col gap-x-4 whitespace-pre-wrap break-words text-sm ${run2.success ? "text-rc-green-200" : "text-rc-red-800"}`, "svelte-f5z0gs")}><div class="flex items-center gap-0">`);
2195
- if (run2.success) {
2196
- $$renderer4.push("<!--[-->");
2197
- Icon$1($$renderer4, {
2198
- name: "checkmark",
2199
- width: 20,
2200
- height: 20,
2201
- class: "shrink-0 self-end"
2202
- });
2203
- } else {
2204
- $$renderer4.push("<!--[!-->");
2205
- Icon$1($$renderer4, {
2206
- name: "close",
2207
- width: 18,
2208
- height: 18,
2209
- class: "shrink-0 scale-110 self-start"
2210
- });
2211
- }
2212
- $$renderer4.push(`<!--]--> <span>${escape_html(run2.success ? "Pass" : formatEvaluation(run2.evaluation) || "Fail")}</span></div> <div class="mt-1 flex flex-wrap items-center gap-x-4">`);
2213
- Button($$renderer4, {
2214
- variant: "outlined",
2215
- size: "small",
2216
- class: "border-none !px-0 text-sm text-rc-gray-400 underline decoration-dashed underline-offset-4 hover:bg-transparent hover:text-rc-gray-200",
2217
- onclick: () => openViewer("Rendered Prompt", run2.links.renderedPrompt),
2218
- children: ($$renderer5) => {
2219
- $$renderer5.push(`<!---->Rendered prompt`);
2220
- },
2221
- $$slots: { default: true }
2222
- });
2223
- $$renderer4.push(`<!----> `);
2224
- Button($$renderer4, {
2225
- variant: "outlined",
2226
- size: "small",
2227
- class: "border-none !px-0 text-sm text-rc-gray-400 underline decoration-dashed underline-offset-4 hover:bg-transparent hover:text-rc-gray-200",
2228
- onclick: () => openViewer("Received Prompt", run2.links.receivedPrompt),
2229
- children: ($$renderer5) => {
2230
- $$renderer5.push(`<!---->Received prompt`);
2231
- },
2232
- $$slots: { default: true }
2233
- });
2234
- $$renderer4.push(`<!----> `);
2235
- Button($$renderer4, {
2236
- variant: "outlined",
2237
- size: "small",
2238
- class: "border-none !px-0 text-sm text-rc-gray-400 underline decoration-dashed underline-offset-4 hover:bg-transparent hover:text-rc-gray-200",
2239
- onclick: () => openViewer("Conversation", run2.links.conversation),
2240
- children: ($$renderer5) => {
2241
- $$renderer5.push(`<!---->Conversation`);
2242
- },
2243
- $$slots: { default: true }
2244
- });
2245
- $$renderer4.push(`<!----> `);
2246
- Button($$renderer4, {
2247
- variant: "outlined",
2248
- size: "small",
2249
- class: "border-none !px-0 text-sm text-rc-gray-400 underline decoration-dashed underline-offset-4 hover:bg-transparent hover:text-rc-gray-200",
2250
- onclick: () => openViewer("Context", run2.links.context),
2251
- children: ($$renderer5) => {
2252
- $$renderer5.push(`<!---->Context`);
2253
- },
2254
- $$slots: { default: true }
2255
- });
2256
- $$renderer4.push(`<!----> `);
2257
- Button($$renderer4, {
2258
- variant: "outlined",
2259
- size: "small",
2260
- class: "border-none !px-0 text-sm text-rc-gray-400 underline decoration-dashed underline-offset-4 hover:bg-transparent hover:text-rc-gray-200",
2261
- onclick: () => openViewer("Logs", run2.links.logs),
2262
- children: ($$renderer5) => {
2263
- $$renderer5.push(`<!---->Logs`);
2264
- },
2265
- $$slots: { default: true }
2266
- });
2267
- $$renderer4.push(`<!----> `);
2268
- Button($$renderer4, {
2269
- variant: "outlined",
2270
- size: "small",
2271
- class: "border-none !px-0 text-sm text-rc-gray-400 underline decoration-dashed underline-offset-4 hover:bg-transparent hover:text-rc-gray-200",
2272
- onclick: () => openViewer("Traces", run2.links.traces),
2273
- children: ($$renderer5) => {
2274
- $$renderer5.push(`<!---->Traces`);
2275
- },
2276
- $$slots: { default: true }
2277
- });
2278
- $$renderer4.push(`<!----></div></div></div>`);
2279
- }
2280
- $$renderer4.push(`<!--]--></div>`);
2281
- } else {
2282
- $$renderer4.push("<!--[!-->");
2283
- $$renderer4.push(`<span class="ml-6 text-gray-500">—</span>`);
2284
- }
2285
- $$renderer4.push(`<!--]--></div></div></div></td></tr>`);
2286
- }
2287
- $$renderer4.push(`<!--]--></tbody></table></div>`);
2288
- }
2289
- });
2290
- } else {
2291
- $$renderer3.push("<!--[!-->");
2292
- }
2293
- $$renderer3.push(`<!--]-->`);
2294
- }
2295
- $$renderer3.push(`<!--]--></div></div></div>`);
2296
- }
2297
- do {
2298
- $$settled = true;
2299
- $$inner_renderer = $$renderer2.copy();
2300
- $$render_inner($$inner_renderer);
2301
- } while (!$$settled);
2302
- $$renderer2.subsume($$inner_renderer);
2303
- });
2304
- }
2305
-
2306
- export { _page as default };
2307
- //# sourceMappingURL=_page.svelte--l_LvFv_.js.map