@futdevpro/ccap 1.1.2964 → 1.1.2972

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 (198) hide show
  1. package/client-dist/{agent-instances.module-HY2VHBIJ.js → agent-instances.module-7JIOUWBV.js} +2 -2
  2. package/client-dist/ca.module-6RTUEF6F.js +5 -0
  3. package/client-dist/ca.module-6RTUEF6F.js.map +7 -0
  4. package/client-dist/{cc-usage-dashboard.component-LKFNBYVL.js → cc-usage-dashboard.component-MUE3JFHY.js} +2 -2
  5. package/client-dist/{cc.module-DIE6ZYLY.js → cc.module-MNX3GMAU.js} +4 -4
  6. package/client-dist/cc.module-MNX3GMAU.js.map +7 -0
  7. package/client-dist/{chunk-HUDNX2TQ.js → chunk-4WYWBPHC.js} +2 -2
  8. package/client-dist/{chunk-OTVNMXWD.js → chunk-4XIUSDLS.js} +2 -2
  9. package/client-dist/{chunk-HWBJNTEA.js → chunk-65KI3GR5.js} +2 -2
  10. package/client-dist/{chunk-QTBI3NZR.js → chunk-AAFXSEZA.js} +2 -2
  11. package/client-dist/{chunk-5XCRRBNZ.js → chunk-AX73SZY3.js} +2 -2
  12. package/client-dist/{chunk-ZJBX4PWF.js → chunk-BEGOF2N7.js} +2 -2
  13. package/client-dist/{chunk-WHYZNKV4.js → chunk-BM4UEP47.js} +2 -2
  14. package/client-dist/{chunk-VLW4WKLV.js → chunk-D4MN4WBX.js} +2 -2
  15. package/client-dist/{chunk-LACKIWSR.js → chunk-E4TY6O3W.js} +2 -2
  16. package/client-dist/{chunk-22IFFOSI.js → chunk-ECVTQRJ7.js} +2 -2
  17. package/client-dist/{chunk-4DO6YKND.js → chunk-F5SAKHCX.js} +2 -2
  18. package/client-dist/{chunk-SXMXRHRS.js → chunk-GAQBLHO3.js} +2 -2
  19. package/client-dist/{chunk-L3ECIYSX.js → chunk-GAS7HMJI.js} +2 -2
  20. package/client-dist/{chunk-LCOGH5NG.js → chunk-GK3RSZLZ.js} +2 -2
  21. package/client-dist/{chunk-55MKVFNX.js → chunk-IOXSJK5R.js} +2 -2
  22. package/client-dist/{chunk-APF4FF3U.js → chunk-IPLQJBDL.js} +2 -2
  23. package/client-dist/{chunk-UVQOIRMW.js → chunk-J6ZXTCHI.js} +2 -2
  24. package/client-dist/{chunk-IJLGLMJO.js → chunk-K35DOQT7.js} +2 -2
  25. package/client-dist/{chunk-OZE63YYG.js → chunk-K4GGODV4.js} +2 -2
  26. package/client-dist/{chunk-ISQFVLSF.js → chunk-K4ZQ4DD5.js} +2 -2
  27. package/client-dist/{chunk-GTH4FT5Y.js → chunk-KVUL77OV.js} +2 -2
  28. package/client-dist/{chunk-FF6BH35R.js → chunk-LZ2PMXWH.js} +2 -2
  29. package/client-dist/{chunk-5NGKACCT.js → chunk-MBE24QTZ.js} +2 -2
  30. package/client-dist/{chunk-CCUYQVNE.js → chunk-MEDDAUB3.js} +2 -2
  31. package/client-dist/{chunk-4564GYJ5.js → chunk-MUV3H7Z7.js} +2 -2
  32. package/client-dist/{chunk-HD5BCFN3.js → chunk-N3AR5TZI.js} +2 -2
  33. package/client-dist/{chunk-HQUS6ZSW.js → chunk-N3TQEDBL.js} +2 -2
  34. package/client-dist/{chunk-UBTKADWP.js → chunk-NEZJG3XV.js} +2 -2
  35. package/client-dist/{chunk-ZDJUICKL.js → chunk-OSJXI65X.js} +2 -2
  36. package/client-dist/{chunk-IBQTN5YN.js → chunk-P3UG3XEN.js} +2 -2
  37. package/client-dist/{chunk-VPBJ7EDQ.js → chunk-PQVFWHXC.js} +2 -2
  38. package/client-dist/{chunk-TDNEXMNL.js → chunk-QB2UH3OX.js} +2 -2
  39. package/client-dist/{chunk-SUFGVRIV.js → chunk-QEMJBYC2.js} +2 -2
  40. package/client-dist/{chunk-DQAJ7SNH.js → chunk-QFCHFWGA.js} +2 -2
  41. package/client-dist/{chunk-VJHWXKNO.js → chunk-QJKK7MN2.js} +2 -2
  42. package/client-dist/{chunk-6TP5DJKE.js → chunk-QSOEXUHP.js} +2 -2
  43. package/client-dist/{chunk-R52CDVAS.js → chunk-RL2M6DJN.js} +2 -2
  44. package/client-dist/{chunk-M2MQ43YC.js → chunk-RXRE3G4K.js} +2 -2
  45. package/client-dist/{chunk-M2MQ43YC.js.map → chunk-RXRE3G4K.js.map} +1 -1
  46. package/client-dist/{chunk-IKEQV7TO.js → chunk-SE7LVQMB.js} +2 -2
  47. package/client-dist/{chunk-2SMC7E3W.js → chunk-STIDSZ7I.js} +2 -2
  48. package/client-dist/{chunk-GMB2E5VV.js → chunk-T2722QP4.js} +2 -2
  49. package/client-dist/{chunk-DOEEKXYU.js → chunk-TKONBOQQ.js} +2 -2
  50. package/client-dist/{chunk-W7PSBH2X.js → chunk-U2WBKQML.js} +2 -2
  51. package/client-dist/{chunk-BTJGFYMU.js → chunk-UE4NDJOE.js} +2 -2
  52. package/client-dist/{chunk-66HYCHT3.js → chunk-UNNGLS4Y.js} +2 -2
  53. package/client-dist/{chunk-7HGLOQXB.js → chunk-UYLV7WAB.js} +2 -2
  54. package/client-dist/chunk-UYNSNX4F.js +2 -0
  55. package/client-dist/chunk-UYNSNX4F.js.map +7 -0
  56. package/client-dist/{chunk-53UP5J5U.js → chunk-VJEPWZGD.js} +2 -2
  57. package/client-dist/{chunk-PWPSHQ6T.js → chunk-VOITLR7O.js} +2 -2
  58. package/client-dist/{chunk-DIZTKV2A.js → chunk-VY4R2KTU.js} +2 -2
  59. package/client-dist/{chunk-P5IIY6MO.js → chunk-WDV7MFNU.js} +2 -2
  60. package/client-dist/{chunk-BW5WKQNI.js → chunk-WKAKYIU5.js} +2 -2
  61. package/client-dist/{chunk-MICI24HP.js → chunk-XYNIZC5J.js} +2 -2
  62. package/client-dist/{chunk-IQB44YSD.js → chunk-ZO5UJXHI.js} +2 -2
  63. package/client-dist/{chunk-F6LSYMQS.js → chunk-ZOWPV7TY.js} +2 -2
  64. package/client-dist/{chunk-TTWKTVB4.js → chunk-ZQT44XRN.js} +2 -2
  65. package/client-dist/{consultant.module-D3LT6Q7Q.js → consultant.module-DMGMZCMM.js} +2 -2
  66. package/client-dist/{crd.module-6H4ARFJI.js → crd.module-UY2I7Q6C.js} +2 -2
  67. package/client-dist/{dashboard.module-3SOB7UIK.js → dashboard.module-YAB6AARF.js} +2 -2
  68. package/client-dist/{do.module-JEKCVDN7.js → do.module-BQ4IIBCS.js} +2 -2
  69. package/client-dist/{document-library.module-QJRCHNHP.js → document-library.module-DDFSHADI.js} +2 -2
  70. package/client-dist/{embedding-eval.module-MMR2X56Q.js → embedding-eval.module-FJTNYACK.js} +2 -2
  71. package/client-dist/{embedding-registry.module-OF7URRJG.js → embedding-registry.module-Q7H4MSJI.js} +2 -2
  72. package/client-dist/{err.module-BSNE44J4.js → err.module-TEYGZOAQ.js} +2 -2
  73. package/client-dist/{feedback.module-N42SJQAD.js → feedback.module-46D4VD2U.js} +2 -2
  74. package/client-dist/{host-runtime-mcp.module-UVYBS76M.js → host-runtime-mcp.module-MOMBWPOG.js} +2 -2
  75. package/client-dist/index.html +2 -2
  76. package/client-dist/{live-dev-pipeline.module-R33WI6YN.js → live-dev-pipeline.module-3ZZC7EDM.js} +2 -2
  77. package/client-dist/{logs.module-CLZDKCFB.js → logs.module-CFTLPVNZ.js} +2 -2
  78. package/client-dist/main-4A2EJGC7.js +7 -0
  79. package/client-dist/main-4A2EJGC7.js.map +7 -0
  80. package/client-dist/{master-control-remote-poc.module-IXQRMTZO.js → master-control-remote-poc.module-4NVA4X32.js} +2 -2
  81. package/client-dist/{mobile-app.module-6VL6WSNJ.js → mobile-app.module-46TKS6V5.js} +2 -2
  82. package/client-dist/{model-registry.module-E63WDS2Y.js → model-registry.module-L56ALPDT.js} +2 -2
  83. package/client-dist/oc.module-OTDAUU73.js +3 -0
  84. package/client-dist/oc.module-OTDAUU73.js.map +7 -0
  85. package/client-dist/{orc.module-NO2J4BGL.js → orc.module-L6G3GB6S.js} +2 -2
  86. package/client-dist/{project-management.module-RLNO5UZC.js → project-management.module-U75UPDGP.js} +2 -2
  87. package/client-dist/project-source-routed.module-I4WHFL6T.js +2 -0
  88. package/client-dist/{scheduler.module-WUBZXO5V.js → scheduler.module-V7JUED6T.js} +2 -2
  89. package/client-dist/{session.module-5R43V7F5.js → session.module-CZCDYPUM.js} +9 -9
  90. package/client-dist/session.module-CZCDYPUM.js.map +7 -0
  91. package/client-dist/{set.module-36ZSGLGF.js → set.module-XQ6TPATG.js} +5 -5
  92. package/client-dist/{set.module-36ZSGLGF.js.map → set.module-XQ6TPATG.js.map} +3 -3
  93. package/client-dist/{setup.module-7MFIOZVY.js → setup.module-M5RVUX4A.js} +2 -2
  94. package/client-dist/styles-XKQ3MDLE.css +2 -0
  95. package/client-dist/styles-XKQ3MDLE.css.map +7 -0
  96. package/client-dist/{terminals.module-ZFFIL6DY.js → terminals.module-LPJ4TLM7.js} +2 -2
  97. package/client-dist/{voice-notes-poc.module-FXL6WNEJ.js → voice-notes-poc.module-UXJM32VE.js} +2 -2
  98. package/client-dist/{wfs.module-KNRW6VWW.js → wfs.module-UIBLZ4KZ.js} +2 -2
  99. package/package.json +1 -1
  100. package/server/build/src/_modules/setup-config/_routes/sc-server-status.controller.d.ts.map +1 -1
  101. package/server/build/src/_modules/setup-config/_routes/sc-server-status.controller.js +13 -0
  102. package/server/build/src/_modules/setup-config/_routes/sc-server-status.controller.js.map +1 -1
  103. package/server/build/src/_modules/setup-config/_services/control-services/sc-server-status.control-service.d.ts +28 -0
  104. package/server/build/src/_modules/setup-config/_services/control-services/sc-server-status.control-service.d.ts.map +1 -1
  105. package/server/build/src/_modules/setup-config/_services/control-services/sc-server-status.control-service.js +106 -0
  106. package/server/build/src/_modules/setup-config/_services/control-services/sc-server-status.control-service.js.map +1 -1
  107. package/client-dist/ca.module-ET22WIEL.js +0 -5
  108. package/client-dist/ca.module-ET22WIEL.js.map +0 -7
  109. package/client-dist/cc.module-DIE6ZYLY.js.map +0 -7
  110. package/client-dist/chunk-3DOLRVWQ.js +0 -2
  111. package/client-dist/chunk-3DOLRVWQ.js.map +0 -7
  112. package/client-dist/main-Q7457G6W.js +0 -7
  113. package/client-dist/main-Q7457G6W.js.map +0 -7
  114. package/client-dist/oc.module-TARPDB47.js +0 -3
  115. package/client-dist/oc.module-TARPDB47.js.map +0 -7
  116. package/client-dist/project-source-routed.module-NTVZXKR2.js +0 -2
  117. package/client-dist/session.module-5R43V7F5.js.map +0 -7
  118. package/client-dist/styles-YBSH3JQY.css +0 -2
  119. package/client-dist/styles-YBSH3JQY.css.map +0 -7
  120. /package/client-dist/{agent-instances.module-HY2VHBIJ.js.map → agent-instances.module-7JIOUWBV.js.map} +0 -0
  121. /package/client-dist/{cc-usage-dashboard.component-LKFNBYVL.js.map → cc-usage-dashboard.component-MUE3JFHY.js.map} +0 -0
  122. /package/client-dist/{chunk-HUDNX2TQ.js.map → chunk-4WYWBPHC.js.map} +0 -0
  123. /package/client-dist/{chunk-OTVNMXWD.js.map → chunk-4XIUSDLS.js.map} +0 -0
  124. /package/client-dist/{chunk-HWBJNTEA.js.map → chunk-65KI3GR5.js.map} +0 -0
  125. /package/client-dist/{chunk-QTBI3NZR.js.map → chunk-AAFXSEZA.js.map} +0 -0
  126. /package/client-dist/{chunk-5XCRRBNZ.js.map → chunk-AX73SZY3.js.map} +0 -0
  127. /package/client-dist/{chunk-ZJBX4PWF.js.map → chunk-BEGOF2N7.js.map} +0 -0
  128. /package/client-dist/{chunk-WHYZNKV4.js.map → chunk-BM4UEP47.js.map} +0 -0
  129. /package/client-dist/{chunk-VLW4WKLV.js.map → chunk-D4MN4WBX.js.map} +0 -0
  130. /package/client-dist/{chunk-LACKIWSR.js.map → chunk-E4TY6O3W.js.map} +0 -0
  131. /package/client-dist/{chunk-22IFFOSI.js.map → chunk-ECVTQRJ7.js.map} +0 -0
  132. /package/client-dist/{chunk-4DO6YKND.js.map → chunk-F5SAKHCX.js.map} +0 -0
  133. /package/client-dist/{chunk-SXMXRHRS.js.map → chunk-GAQBLHO3.js.map} +0 -0
  134. /package/client-dist/{chunk-L3ECIYSX.js.map → chunk-GAS7HMJI.js.map} +0 -0
  135. /package/client-dist/{chunk-LCOGH5NG.js.map → chunk-GK3RSZLZ.js.map} +0 -0
  136. /package/client-dist/{chunk-55MKVFNX.js.map → chunk-IOXSJK5R.js.map} +0 -0
  137. /package/client-dist/{chunk-APF4FF3U.js.map → chunk-IPLQJBDL.js.map} +0 -0
  138. /package/client-dist/{chunk-UVQOIRMW.js.map → chunk-J6ZXTCHI.js.map} +0 -0
  139. /package/client-dist/{chunk-IJLGLMJO.js.map → chunk-K35DOQT7.js.map} +0 -0
  140. /package/client-dist/{chunk-OZE63YYG.js.map → chunk-K4GGODV4.js.map} +0 -0
  141. /package/client-dist/{chunk-ISQFVLSF.js.map → chunk-K4ZQ4DD5.js.map} +0 -0
  142. /package/client-dist/{chunk-GTH4FT5Y.js.map → chunk-KVUL77OV.js.map} +0 -0
  143. /package/client-dist/{chunk-FF6BH35R.js.map → chunk-LZ2PMXWH.js.map} +0 -0
  144. /package/client-dist/{chunk-5NGKACCT.js.map → chunk-MBE24QTZ.js.map} +0 -0
  145. /package/client-dist/{chunk-CCUYQVNE.js.map → chunk-MEDDAUB3.js.map} +0 -0
  146. /package/client-dist/{chunk-4564GYJ5.js.map → chunk-MUV3H7Z7.js.map} +0 -0
  147. /package/client-dist/{chunk-HD5BCFN3.js.map → chunk-N3AR5TZI.js.map} +0 -0
  148. /package/client-dist/{chunk-HQUS6ZSW.js.map → chunk-N3TQEDBL.js.map} +0 -0
  149. /package/client-dist/{chunk-UBTKADWP.js.map → chunk-NEZJG3XV.js.map} +0 -0
  150. /package/client-dist/{chunk-ZDJUICKL.js.map → chunk-OSJXI65X.js.map} +0 -0
  151. /package/client-dist/{chunk-IBQTN5YN.js.map → chunk-P3UG3XEN.js.map} +0 -0
  152. /package/client-dist/{chunk-VPBJ7EDQ.js.map → chunk-PQVFWHXC.js.map} +0 -0
  153. /package/client-dist/{chunk-TDNEXMNL.js.map → chunk-QB2UH3OX.js.map} +0 -0
  154. /package/client-dist/{chunk-SUFGVRIV.js.map → chunk-QEMJBYC2.js.map} +0 -0
  155. /package/client-dist/{chunk-DQAJ7SNH.js.map → chunk-QFCHFWGA.js.map} +0 -0
  156. /package/client-dist/{chunk-VJHWXKNO.js.map → chunk-QJKK7MN2.js.map} +0 -0
  157. /package/client-dist/{chunk-6TP5DJKE.js.map → chunk-QSOEXUHP.js.map} +0 -0
  158. /package/client-dist/{chunk-R52CDVAS.js.map → chunk-RL2M6DJN.js.map} +0 -0
  159. /package/client-dist/{chunk-IKEQV7TO.js.map → chunk-SE7LVQMB.js.map} +0 -0
  160. /package/client-dist/{chunk-2SMC7E3W.js.map → chunk-STIDSZ7I.js.map} +0 -0
  161. /package/client-dist/{chunk-GMB2E5VV.js.map → chunk-T2722QP4.js.map} +0 -0
  162. /package/client-dist/{chunk-DOEEKXYU.js.map → chunk-TKONBOQQ.js.map} +0 -0
  163. /package/client-dist/{chunk-W7PSBH2X.js.map → chunk-U2WBKQML.js.map} +0 -0
  164. /package/client-dist/{chunk-BTJGFYMU.js.map → chunk-UE4NDJOE.js.map} +0 -0
  165. /package/client-dist/{chunk-66HYCHT3.js.map → chunk-UNNGLS4Y.js.map} +0 -0
  166. /package/client-dist/{chunk-7HGLOQXB.js.map → chunk-UYLV7WAB.js.map} +0 -0
  167. /package/client-dist/{chunk-53UP5J5U.js.map → chunk-VJEPWZGD.js.map} +0 -0
  168. /package/client-dist/{chunk-PWPSHQ6T.js.map → chunk-VOITLR7O.js.map} +0 -0
  169. /package/client-dist/{chunk-DIZTKV2A.js.map → chunk-VY4R2KTU.js.map} +0 -0
  170. /package/client-dist/{chunk-P5IIY6MO.js.map → chunk-WDV7MFNU.js.map} +0 -0
  171. /package/client-dist/{chunk-BW5WKQNI.js.map → chunk-WKAKYIU5.js.map} +0 -0
  172. /package/client-dist/{chunk-MICI24HP.js.map → chunk-XYNIZC5J.js.map} +0 -0
  173. /package/client-dist/{chunk-IQB44YSD.js.map → chunk-ZO5UJXHI.js.map} +0 -0
  174. /package/client-dist/{chunk-F6LSYMQS.js.map → chunk-ZOWPV7TY.js.map} +0 -0
  175. /package/client-dist/{chunk-TTWKTVB4.js.map → chunk-ZQT44XRN.js.map} +0 -0
  176. /package/client-dist/{consultant.module-D3LT6Q7Q.js.map → consultant.module-DMGMZCMM.js.map} +0 -0
  177. /package/client-dist/{crd.module-6H4ARFJI.js.map → crd.module-UY2I7Q6C.js.map} +0 -0
  178. /package/client-dist/{dashboard.module-3SOB7UIK.js.map → dashboard.module-YAB6AARF.js.map} +0 -0
  179. /package/client-dist/{do.module-JEKCVDN7.js.map → do.module-BQ4IIBCS.js.map} +0 -0
  180. /package/client-dist/{document-library.module-QJRCHNHP.js.map → document-library.module-DDFSHADI.js.map} +0 -0
  181. /package/client-dist/{embedding-eval.module-MMR2X56Q.js.map → embedding-eval.module-FJTNYACK.js.map} +0 -0
  182. /package/client-dist/{embedding-registry.module-OF7URRJG.js.map → embedding-registry.module-Q7H4MSJI.js.map} +0 -0
  183. /package/client-dist/{err.module-BSNE44J4.js.map → err.module-TEYGZOAQ.js.map} +0 -0
  184. /package/client-dist/{feedback.module-N42SJQAD.js.map → feedback.module-46D4VD2U.js.map} +0 -0
  185. /package/client-dist/{host-runtime-mcp.module-UVYBS76M.js.map → host-runtime-mcp.module-MOMBWPOG.js.map} +0 -0
  186. /package/client-dist/{live-dev-pipeline.module-R33WI6YN.js.map → live-dev-pipeline.module-3ZZC7EDM.js.map} +0 -0
  187. /package/client-dist/{logs.module-CLZDKCFB.js.map → logs.module-CFTLPVNZ.js.map} +0 -0
  188. /package/client-dist/{master-control-remote-poc.module-IXQRMTZO.js.map → master-control-remote-poc.module-4NVA4X32.js.map} +0 -0
  189. /package/client-dist/{mobile-app.module-6VL6WSNJ.js.map → mobile-app.module-46TKS6V5.js.map} +0 -0
  190. /package/client-dist/{model-registry.module-E63WDS2Y.js.map → model-registry.module-L56ALPDT.js.map} +0 -0
  191. /package/client-dist/{orc.module-NO2J4BGL.js.map → orc.module-L6G3GB6S.js.map} +0 -0
  192. /package/client-dist/{project-management.module-RLNO5UZC.js.map → project-management.module-U75UPDGP.js.map} +0 -0
  193. /package/client-dist/{project-source-routed.module-NTVZXKR2.js.map → project-source-routed.module-I4WHFL6T.js.map} +0 -0
  194. /package/client-dist/{scheduler.module-WUBZXO5V.js.map → scheduler.module-V7JUED6T.js.map} +0 -0
  195. /package/client-dist/{setup.module-7MFIOZVY.js.map → setup.module-M5RVUX4A.js.map} +0 -0
  196. /package/client-dist/{terminals.module-ZFFIL6DY.js.map → terminals.module-LPJ4TLM7.js.map} +0 -0
  197. /package/client-dist/{voice-notes-poc.module-FXL6WNEJ.js.map → voice-notes-poc.module-UXJM32VE.js.map} +0 -0
  198. /package/client-dist/{wfs.module-KNRW6VWW.js.map → wfs.module-UIBLZ4KZ.js.map} +0 -0
@@ -1,3 +1,3 @@
1
- import{c as Ce}from"./chunk-4DO6YKND.js";import{b as Ye}from"./chunk-COVCHZOZ.js";import{a as v}from"./chunk-UFBTR2BG.js";import{h as Be,i as Fe}from"./chunk-R52CDVAS.js";import{I as Ve}from"./chunk-M2MQ43YC.js";import{Aa as Oe,Ba as Re,C as Z,D as ae,Fa as m,Ga as L,Ha as _e,Ia as ze,J as R,K as z,L as H,M as ye,P as Pe,T as ne,Ta as le,U as F,Z as u,a as I,aa as V,b as w,da as D,fa as Y,ga as me,hb as g,ja as se,jb as Se,k as ke,la as S,oa as Le,p as be,pa as we,qa as p,ra as d,sa as W,ua as ie,ub as de,va as B,wa as C,xb as He,y as xe,za as Ge}from"./chunk-TBMJSIBB.js";var ve=class i{static getEmoji(o){let e=o.data??{},t=typeof e.step=="string"?e.step:"";return t==="run-initialization"?"\u{1F680}":t==="run-flow-complete"?"\u{1F3AF}":t==="tool-error-retry"?"\u26A0\uFE0F\u{1F9E0}":t.includes("tool-error")||t.includes("error-recovery")?"\u{1F527}\u274C":t.includes("agentic-loop-iteration")?"":o.eventType==="tool-call"||typeof e.toolId=="string"?"\u{1F527}":o.eventType==="llm-call"||typeof e.callType=="string"?"\u{1F9E0}":o.eventType==="error"?"\u26A0\uFE0F":""}static getBubbleClasses(o){let e=o.data??{},t=typeof e.step=="string"?e.step:"";return t==="run-initialization"||t==="run-flow-complete"?"bg-green-500/10 text-green-300 border border-green-500/50":t==="tool-error-retry"||t.includes("tool-error")||t.includes("error-recovery")?"bg-orange-500/10 text-orange-300 border border-orange-500/50":o.eventType==="error"||t.includes("circuit-breaker")?"bg-red-500/10 text-red-300 border border-red-500/50":t.includes("agentic-loop")?"bg-blue-500/10 text-blue-300 border border-blue-500/50":o.eventType==="tool-call"||typeof e.toolId=="string"?"bg-yellow-500/10 text-yellow-300 border border-yellow-500/50":o.eventType==="llm-call"||typeof e.callType=="string"?"bg-purple-500/10 text-purple-300 border border-purple-500/50":"bg-neutral-700 text-neutral-200 border border-neonCyan"}static getStepLabel(o){let e=o.data??{},t=e.step,n=e.toolId;if(typeof t=="string"&&t.length>0)return i.formatStepId(t);if(o.eventType==="tool-call"&&typeof n=="string"&&n.length>0)return`Eszk\xF6z: ${n}`;if(o.eventType==="llm-call"){let r=e.callType;return typeof r=="string"?`LLM: ${i.formatStepId(r)}`:"LLM h\xEDv\xE1s"}if(o.eventType==="error"){let r=e.message;return typeof r=="string"&&r.length>0?`Hiba: ${r.substring(0,40)}${r.length>40?"\u2026":""}`:"Hiba"}return o.eventType==="compacting"?typeof t=="string"&&t.length>0?i.formatStepId(t):"Compacting":i.formatEventTypeFallback(o.eventType)}static formatStepId(o){return o.split("-").map(e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e).join(" ")}static getDotClasses(o){let e=o.data??{},t=typeof e.step=="string"?e.step:"";return t==="run-initialization"||t==="run-flow-complete"?"bg-green-400":t==="tool-error-retry"||t.includes("tool-error")||t.includes("error-recovery")?"bg-orange-400":o.eventType==="error"||t.includes("circuit-breaker")?"bg-red-400":t.includes("agentic-loop")?"bg-blue-400":o.eventType==="tool-call"||typeof e.toolId=="string"?"bg-yellow-400":o.eventType==="llm-call"||typeof e.callType=="string"?"bg-purple-400":"bg-neutral-400"}static formatEventTypeFallback(o){return{step:"L\xE9p\xE9s","tool-call":"Eszk\xF6zh\xEDv\xE1s","context-update":"Kontextus friss\xEDt\xE9s",compacting:"Compacting","llm-call":"LLM h\xEDv\xE1s","session-event":"Session event",error:"Hiba"}[o]??o}};var x=function(i){return i.pending="pending",i.active="active",i.completed="completed",i.error="error",i}(x||{});var tt={[v.runInitialization]:"milestone-init",[v.analyze]:"phase-analyze",[v.analyzeResult]:"llm-analyze",[v.assemble]:"phase-assemble",[v.execution]:"phase-execution",[v.executionStart]:"phase-execution",[v.finalization]:"phase-finalization",[v.llmRunFinalization]:"llm-finalization",[v.postFinalization]:"phase-finalization",[v.runFlowComplete]:"milestone-complete"},nt=["milestone-init","phase-analyze","llm-analyze","phase-assemble","phase-execution","phase-finalization","llm-finalization","milestone-complete"],N=class i{static mapPhaseToNodeId(o){return tt[o]??null}static computeStateTransitions(o){let e=i.mapPhaseToNodeId(o);if(!e)return[];let t=[],n=!1;for(let r of nt)r===e?(t.push({nodeId:r,state:x.active}),n=!0):n||t.push({nodeId:r,state:x.completed});return t}static extractIterationData(o){let e=o.action;if(typeof e!="string")return null;let t=o.tool,n=typeof t=="string"?t:"",r=o.intent,s=typeof r=="string"?r:"",a=o.iterationCount;return{actionType:e,tool:n,intent:s,iterationIndex:typeof a=="number"?a:0}}static mapMonitoringEventToIterationNodeId(o,e){let t=o.data??{},n=t.step,r=typeof n=="string"?n:"",s=`iter-${e}`;if(o.eventType==="llm-call"){let a=t.callType;if(a==="agentic-loop")return`${s}-llm-decision`;if(a==="tool-description")return`${s}-tool-desc`;if(a==="tool-error-retry")return`${s}-tool-error-retry`;if(a==="tool-result-chunking")return`${s}-tool-chunking`;if(a==="goal-state-update")return`${s}-goal-update`}return o.eventType==="tool-call"?`${s}-tool-call`:o.eventType==="error"||r.includes("tool-error")?`${s}-tool-call`:null}static isTerminalPhase(o){return o===v.runFlowComplete}static SKELETON_LLM_NODE_MAP={analyze:"llm-analyze","run-finalization":"llm-finalization"};static LLM_CALL_PHASE_MAP={analyze:"phase-analyze","subanalyze-run-tasks":"phase-analyze","instant-reply":"phase-execution","run-finalization":"phase-finalization","chat-history-compacting":"phase-execution","execution-history-compacting":"phase-execution","soul-compacting":"phase-execution","context-compacting":"phase-execution","message-interceptor":"phase-execution"};static ITERATION_LLM_CALL_TYPES=new Set(["agentic-loop","tool-description","tool-error-retry","tool-result-chunking","goal-state-update"]);static LLM_CALL_LABEL_MAP={analyze:"LLM: Analyze","subanalyze-run-tasks":"LLM: Subanalyze","instant-reply":"LLM: Instant Reply","agentic-loop":"LLM Decision","tool-description":"Tool Description","tool-error-retry":"LLM: Error Retry","run-finalization":"LLM: Summary","chat-history-compacting":"LLM: Compact Chat","execution-history-compacting":"LLM: Compact Exec","soul-compacting":"LLM: Compact Soul","context-compacting":"LLM: Compact Ctx","tool-result-chunking":"LLM: Chunking","goal-state-update":"LLM: Goal Update","message-interceptor":"LLM: Msg Intercept"};static getPreCreatedSkeletonNodeId(o){return i.SKELETON_LLM_NODE_MAP[o]??null}static getLlmCallPhaseId(o){return i.LLM_CALL_PHASE_MAP[o]??null}static isIterationLlmCall(o){return i.ITERATION_LLM_CALL_TYPES.has(o)}static getLlmCallLabel(o){return i.LLM_CALL_LABEL_MAP[o]??`LLM: ${o}`}};var k=function(i){return i.sequential="sequential",i.loopEntry="loop-entry",i.errorRetry="error-retry",i}(k||{});var f=function(i){return i.phase="phase",i.milestone="milestone",i.llmCall="llm-call",i.toolCall="tool-call",i.toolError="tool-error",i.loopIteration="loop-iteration",i.action="action",i.error="error",i}(f||{});var je="milestone-init",Ee="phase-analyze",it="llm-analyze",Me="phase-assemble",ee="phase-execution",he="phase-finalization",Ae="llm-finalization",De="milestone-complete",P=class i{static buildSkeletonLayout(){let o=48+220/2,e=48,t=[],n=[],r=i.createNode({id:je,category:f.milestone,label:"Initialization",phase:v.runInitialization,x:o-200/2,y:e,width:200,height:48});t.push(r),e+=84;let s=i.createNode({id:Ee,category:f.phase,label:"Analyze",phase:v.analyze,x:o-220/2,y:e,width:220,height:60});t.push(s);let a=i.createNode({id:it,category:f.llmCall,label:"LLM: Analyze",phase:v.analyzeResult,x:o+220/2+28,y:e+16/2,width:160,height:44,parentId:Ee});t.push(a),n.push(i.createEdge(je,Ee,k.sequential)),e+=96;let h=i.createNode({id:Me,category:f.phase,label:"Assemble",phase:v.assemble,x:o-220/2,y:e,width:220,height:60});t.push(h),n.push(i.createEdge(Ee,Me,k.sequential)),e+=96;let l=i.createNode({id:ee,category:f.phase,label:"Execution",phase:v.execution,x:o-220/2,y:e,width:220,height:60});t.push(l),n.push(i.createEdge(Me,ee,k.sequential)),e+=96;let c=i.createNode({id:he,category:f.phase,label:"Finalization",phase:v.finalization,x:o-220/2,y:e,width:220,height:60});t.push(c);let _=i.createNode({id:Ae,category:f.llmCall,label:"LLM: Summary",phase:v.llmRunFinalization,x:o+220/2+28,y:e+16/2,width:160,height:44,parentId:he});t.push(_),n.push(i.createEdge(ee,he,k.sequential)),e+=96;let y=i.createNode({id:De,category:f.milestone,label:"Flow Complete",phase:v.runFlowComplete,x:o-200/2,y:e,width:200,height:48});t.push(y),n.push(i.createEdge(he,De,k.sequential));let T=i.recalculateViewBox(t,48);return{nodes:t,edges:n,viewBox:T,loopContainerBounds:null}}static addIterationColumn(o,e,t,n){let r=o.nodes.map(b=>I({},b)),s=[...o.edges],a=r.find(b=>b.id===ee);if(!a)return o;let h=a.x+20+e*208,l=a.y+60+20,c=`iter-${e}`,_=l,y=[],T=i.createNode({id:`${c}-llm-decision`,category:f.llmCall,label:"LLM Decision",phase:v.llmAgenticLoop,x:h,y:_,width:160,height:44,parentId:ee,iterationIndex:e});y.push(T),_+=68;let M=i.formatActionLabel(t),O=i.createNode({id:`${c}-action`,category:f.action,label:M,phase:v.agenticLoopIteration,x:h+20/2,y:_,width:140,height:32,parentId:ee,iterationIndex:e,data:n});if(y.push(O),_+=56,t==="tool-select"){let b=i.createNode({id:`${c}-tool-desc`,category:f.llmCall,label:"Tool Description",phase:v.llmToolDescription,x:h,y:_,width:160,height:44,parentId:ee,iterationIndex:e});y.push(b),_+=68;let q=n.tool,Q=typeof q=="string"?q:"tool",te=i.createNode({id:`${c}-tool-call`,category:f.toolCall,label:Q,phase:null,x:h,y:_,width:160,height:44,parentId:ee,iterationIndex:e,data:n});y.push(te),_+=68}for(let b=0;b<y.length-1;b++)s.push(i.createEdge(y[b].id,y[b+1].id,k.sequential));r.push(...y);let E=20*2+(e+1)*180+e*28,j=60+20*2+(_-l);a.width=Math.max(a.width,E),a.height=Math.max(a.height,j);let K=a.y+a.height,A=[he,Ae,De],ue=K+36;for(let b of A){let q=r.find(Q=>Q.id===b);if(q){if(b===Ae){let Q=r.find(te=>te.id===he);Q&&(q.y=Q.y+16/2);continue}q.y=ue,ue+=q.height+36}}let ge={x:a.x,y:a.y+60,width:a.width,height:a.height-60},J=r,Je=s.map(b=>{let q=J.find(te=>te.id===b.sourceNodeId),Q=J.find(te=>te.id===b.targetNodeId);return!q||!Q?b:w(I({},b),{pathD:i.computeEdgePath(q,Q,b.category)})}),et=i.recalculateViewBox(J,48);return{nodes:J,edges:Je,viewBox:et,loopContainerBounds:ge}}static computeEdgePath(o,e,t){let n=o.x+o.width/2,r=o.y+o.height,s=e.x+e.width/2,a=e.y;if(Math.abs(n-s)<20)return`M ${n} ${r} L ${s} ${a}`;let h=o.x+o.width,l=o.y+o.height/2,c=e.x,_=e.y+e.height/2;if(e.parentId===o.id)return`M ${h} ${l} L ${c} ${_}`;let y=r+(a-r)/2;return`M ${n} ${r} L ${n} ${y} L ${s} ${y} L ${s} ${a}`}static recalculateViewBox(o,e){if(o.length===0)return{x:0,y:0,width:600,height:400};let t=1/0,n=1/0,r=-1/0,s=-1/0;for(let a of o)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x+a.width),s=Math.max(s,a.y+a.height);return{x:t-e,y:n-e,width:r-t+e*2,height:s-n+e*2}}static addDynamicLlmNode(o,e,t,n,r,s){let a=o.nodes.map(A=>I({},A)),h=[...o.edges],l=a.find(A=>A.id===e);if(!l)return o;let c,_;l.category===f.phase||l.category===f.milestone?(c=l.x+l.width+28,_=l.y+(l.height-44)/2):(c=l.x,_=l.y+l.height+24);let T=i.createNode({id:t,category:f.llmCall,label:n,phase:null,x:c,y:_,width:160,height:44,parentId:r,iterationIndex:s??void 0});a.push(T),h.push(i.createEdge(e,t,k.sequential));let M=T.y+T.height;s!=null?i.expandExecutionContainer(a,M):i.shiftDownstreamIfOverlap(a,r,M);let O=o.loopContainerBounds,E=a.find(A=>A.id==="phase-execution");E&&E.height>60&&(O={x:E.x,y:E.y+60,width:E.width,height:E.height-60});let j=h.map(A=>{let ue=a.find(J=>J.id===A.sourceNodeId),ge=a.find(J=>J.id===A.targetNodeId);return!ue||!ge?A:w(I({},A),{pathD:i.computeEdgePath(ue,ge,A.category)})}),K=i.recalculateViewBox(a,48);return{nodes:a,edges:j,viewBox:K,loopContainerBounds:O}}static expandExecutionContainer(o,e){let t=o.find(l=>l.id==="phase-execution");if(!t)return;let n=t.y+60+20,r=60+20*2+(e+24-n);if(r<=t.height)return;t.height=r;let s=t.y+t.height,a=["phase-finalization","llm-finalization","milestone-complete"],h=s+36;for(let l of a){let c=o.find(_=>_.id===l);if(c){if(l==="llm-finalization"){let _=o.find(y=>y.id==="phase-finalization");_&&(c.y=_.y+16/2);continue}c.y<h&&(c.y=h),h=c.y+c.height+36}}for(let l of o)if(l.parentId==="phase-finalization"&&l.id!=="llm-finalization"&&l.category===f.llmCall){let c=o.find(_=>_.id==="phase-finalization");c&&(l.y=Math.max(l.y,c.y))}}static shiftDownstreamIfOverlap(o,e,t){let n=["milestone-init","phase-analyze","phase-assemble","phase-execution","phase-finalization","milestone-complete"],r=n.indexOf(e);if(r<0||r>=n.length-1)return;let s=n[r+1],a=o.find(_=>_.id===s);if(!a||t+36<=a.y)return;let h=t+36-a.y,l=new Set;for(let _ of o)_.parentId===e&&_.category===f.llmCall&&l.add(_.id);let c=a.y;for(let _ of o)_.y>=c&&!l.has(_.id)&&(_.y+=h)}static createNode(o){return{id:o.id,category:o.category,state:x.pending,label:o.label,phase:o.phase,x:o.x,y:o.y,width:o.width,height:o.height,data:o.data??{},iterationIndex:o.iterationIndex??null,parentId:o.parentId??null,monitoringEvent:null}}static createEdge(o,e,t){let n=t===k.errorRetry?"#f97316":t===k.loopEntry?"#3b82f6":"#525252",r=t===k.loopEntry?"8 4":t===k.errorRetry?"6 3":"none",s=t===k.errorRetry?"url(#ses-arrow-error)":t===k.loopEntry?"url(#ses-arrow-loop)":"url(#ses-arrow-seq)";return{id:`edge-${o}-${e}`,category:t,sourceNodeId:o,targetNodeId:e,pathD:"",strokeColor:n,strokeDashArray:r,markerEnd:s}}static formatActionLabel(o){return{"tool-select":"Tool Select","tool-group-open":"Tool Group","context-handling":"Context","loop-debrief":"Debrief",result:"Result"}[o]??o}};var qe=(()=>{class i{baseUrl=`${Ve.api.baseUrl}/session`;http=Z(He);getEvents(e){let t=encodeURIComponent(e.trim());return be(this.http.get(`${this.baseUrl}/${t}/events`))}getRunTrace(e){let t=e.sessionId.trim(),n=encodeURIComponent(e.runId.trim());return be(this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/runs/${n}/trace`))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=xe({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Ze=(()=>{class i{session_DS=Z(Ce);monitoring_AS=Z(qe);destroyRef=Z(Pe);graphLayout_$=V(null);activeNodeId_$=V("");selectedNodeId_$=V("");isLive_$=V(!1);isGraphOpen_$=V(!1);graphSessionId_$=V("");graphRunId_$=V("");isLoading_$=V(!1);currentIterationIndex=-1;monitoringSubscription=null;lastAppliedPhase="";phaseRightColumnLast={};iterationColumnLast={};dynamicNodeCounter=0;constructor(){Se(()=>{let e=this.session_DS.agentEvents_$();!this.isGraphOpen_$()||!this.isLive_$()||this.applyAgentEvent(e)},{allowSignalWrites:!0}),this.destroyRef.onDestroy(()=>{this.disposeSubscriptions()})}openGraphForRun(e,t,n){this.disposeSubscriptions(),this.resetState(),this.graphSessionId_$.set(e),this.graphRunId_$.set(t),this.isLive_$.set(n),this.isGraphOpen_$.set(!0),n?this.initLiveGraph():this.loadHistoricalGraph(e,t)}closeGraph(){this.disposeSubscriptions(),this.isGraphOpen_$.set(!1),this.selectedNodeId_$.set("")}selectNode(e){let t=this.selectedNodeId_$();this.selectedNodeId_$.set(t===e?"":e)}clearSelection(){this.selectedNodeId_$.set("")}initLiveGraph(){let e=P.buildSkeletonLayout(),t=this.recalculateEdgePaths(e);this.graphLayout_$.set(t),this.phaseRightColumnLast={"phase-analyze":"llm-analyze","phase-finalization":"llm-finalization"},this.iterationColumnLast={},this.monitoringSubscription=this.session_DS.monitoringEvent_S.subscribe(n=>{n.sessionId===this.graphSessionId_$()&&this.applyMonitoringEvent(n.event)})}applyAgentEvent(e){let t=e.phase;if(typeof t!="string"||t.length===0||t===this.lastAppliedPhase)return;if(this.lastAppliedPhase=t,t===v.agenticLoopIteration){let r=N.extractIterationData(e);r&&this.addIteration(r);return}let n=N.computeStateTransitions(t);n.length!==0&&(this.applyStateTransitions(n),N.isTerminalPhase(t)&&this.markAllIterationNodesCompleted())}addIteration(e){let t=this.graphLayout_$();if(!t)return;this.currentIterationIndex=e.iterationIndex,this.markPreviousIterationCompleted(e.iterationIndex);let n=P.addIterationColumn(t,e.iterationIndex,e.actionType,{tool:e.tool,intent:e.intent}),r=e.actionType==="tool-select"?`iter-${e.iterationIndex}-tool-call`:`iter-${e.iterationIndex}-action`;this.iterationColumnLast[e.iterationIndex]=r;let s=`iter-${e.iterationIndex}-llm-decision`,a=this.setNodeState(n,s,x.active);this.activeNodeId_$.set(s),this.graphLayout_$.set(this.recalculateEdgePaths(a))}markPreviousIterationCompleted(e){if(e<=0)return;let t=this.graphLayout_$();if(!t)return;let n=`iter-${e-1}`,r=t;for(let s of t.nodes)s.id.startsWith(n)&&s.state!==x.error&&(r=this.setNodeState(r,s.id,x.completed));this.graphLayout_$.set(r)}applyMonitoringEvent(e){let t=this.graphLayout_$();if(!t)return;let n=typeof e.eventType=="string"?e.eventType:"",r=typeof e.status=="string"?e.status:"",s=i.toRecord(e.data),a=typeof e.durationMs=="number"?e.durationMs:0,h=typeof e.inputSize=="number"?e.inputSize:0,l=typeof e.outputSize=="number"?e.outputSize:0,c={eventType:n,timestamp:new Date,data:s,durationMs:a,status:r,sessionId:this.graphSessionId_$(),runId:this.graphRunId_$(),inputSize:h,outputSize:l};if(n==="llm-call"){this.handleLlmCallMonitoringEvent(c,t);return}if(this.currentIterationIndex<0)return;let _=N.mapMonitoringEventToIterationNodeId(c,this.currentIterationIndex);if(!_)return;let y=this.enrichNodeWithMonitoringEvent(t,_,c);y&&this.graphLayout_$.set(y)}handleLlmCallMonitoringEvent(e,t){let n=e.data?.callType,r=typeof n=="string"?n:"";if(!r)return;let s=N.getPreCreatedSkeletonNodeId(r);if(s){let h=this.enrichNodeWithMonitoringEvent(t,s,e);h&&this.graphLayout_$.set(h);return}if(N.isIterationLlmCall(r)&&this.currentIterationIndex>=0){let h=N.mapMonitoringEventToIterationNodeId(e,this.currentIterationIndex);if(h){if(t.nodes.findIndex(c=>c.id===h)>=0){let c=this.enrichNodeWithMonitoringEvent(t,h,e);c&&this.graphLayout_$.set(c)}else this.createDynamicIterationLlmNode(t,r,h,e);return}}let a=N.getLlmCallPhaseId(r);a&&this.createDynamicSkeletonLlmNode(t,r,a,e)}enrichNodeWithMonitoringEvent(e,t,n){let r=e.nodes.findIndex(_=>_.id===t);if(r<0)return null;let s=n.data??{},a=n.status==="error",h=n.durationMs??0,l=a?x.error:h>0?x.completed:x.active,c=[...e.nodes];return c[r]=w(I({},c[r]),{state:l,monitoringEvent:n,data:w(I(I({},c[r].data),s),{durationMs:h})}),this.activeNodeId_$.set(l===x.active?t:""),w(I({},e),{nodes:c})}createDynamicSkeletonLlmNode(e,t,n,r){this.dynamicNodeCounter++;let s=`llm-dyn-${this.dynamicNodeCounter}`,a=N.getLlmCallLabel(t),h=this.phaseRightColumnLast[n]??n,l=P.addDynamicLlmNode(e,h,s,a,n,null);this.phaseRightColumnLast[n]=s;let c=this.enrichNodeWithMonitoringEvent(l,s,r);this.graphLayout_$.set(c??l)}createDynamicIterationLlmNode(e,t,n,r){let s=N.getLlmCallLabel(t),a=this.iterationColumnLast[this.currentIterationIndex]??`iter-${this.currentIterationIndex}-action`,h=P.addDynamicLlmNode(e,a,n,s,"phase-execution",this.currentIterationIndex);this.iterationColumnLast[this.currentIterationIndex]=n;let l=this.enrichNodeWithMonitoringEvent(h,n,r);this.graphLayout_$.set(l??h)}loadHistoricalGraph(e,t){return ke(this,null,function*(){this.isLoading_$.set(!0);try{let n=yield this.monitoring_AS.getRunTrace({sessionId:e,runId:t});this.buildHistoricalGraph(n.trace)}catch{let n=P.buildSkeletonLayout();this.graphLayout_$.set(this.recalculateEdgePaths(n))}finally{this.isLoading_$.set(!1)}})}buildHistoricalGraph(e){let t=P.buildSkeletonLayout();t=this.recalculateEdgePaths(t);let n="",r=-1,s={"phase-analyze":"llm-analyze","phase-finalization":"llm-finalization"},a={},h=0;for(let l of e){let c=l.data??{},_=c.step,y=typeof _=="string"?_:"";if(y.length>0&&N.mapPhaseToNodeId(y)&&y!==n){n=y;let M=N.computeStateTransitions(y);for(let O of M)t=this.setNodeState(t,O.nodeId,O.state)}if(y==="agentic-loop-iteration"||y.includes("agentic-loop")){let T=c.action,M=typeof T=="string"?T:"",O=c.tool,E=typeof O=="string"?O:"";if(M.length>0){r++,t=P.addIterationColumn(t,r,M,{tool:E});let j=M==="tool-select"?`iter-${r}-tool-call`:`iter-${r}-action`;a[r]=j}}if(l.eventType==="llm-call"){let T=c.callType,M=typeof T=="string"?T:"";if(M){let O=N.getPreCreatedSkeletonNodeId(M);if(O)t=this.enrichHistoricalNode(t,O,l,c);else if(N.isIterationLlmCall(M)&&r>=0){let E=N.mapMonitoringEventToIterationNodeId(l,r);if(E)if(t.nodes.findIndex(K=>K.id===E)>=0)t=this.enrichHistoricalNode(t,E,l,c);else{let K=N.getLlmCallLabel(M),A=a[r]??`iter-${r}-action`;t=P.addDynamicLlmNode(t,A,E,K,"phase-execution",r),t=this.enrichHistoricalNode(t,E,l,c),a[r]=E}}else{let E=N.getLlmCallPhaseId(M);if(E){h++;let j=`llm-dyn-${h}`,K=N.getLlmCallLabel(M),A=s[E]??E;t=P.addDynamicLlmNode(t,A,j,K,E,null),t=this.enrichHistoricalNode(t,j,l,c),s[E]=j}}}continue}if(r>=0){let T=N.mapMonitoringEventToIterationNodeId(l,r);T&&(t=this.enrichHistoricalNode(t,T,l,c))}}if(n===v.runFlowComplete)for(let l of t.nodes)l.state===x.pending&&(t=this.setNodeState(t,l.id,x.completed));this.graphLayout_$.set(this.recalculateEdgePaths(t))}enrichHistoricalNode(e,t,n,r){let s=e.nodes.findIndex(h=>h.id===t);if(s<0)return e;let a=[...e.nodes];return a[s]=w(I({},a[s]),{state:n.status==="error"?x.error:x.completed,monitoringEvent:n,data:w(I(I({},a[s].data),r),{durationMs:n.durationMs})}),w(I({},e),{nodes:a})}applyStateTransitions(e){let t=this.graphLayout_$();if(!t)return;let n="";for(let r of e)t=this.setNodeState(t,r.nodeId,r.state),r.state===x.active&&(n=r.nodeId);this.activeNodeId_$.set(n),this.graphLayout_$.set(t)}setNodeState(e,t,n){let r=e.nodes.findIndex(a=>a.id===t);if(r<0)return e;let s=[...e.nodes];return s[r]=w(I({},s[r]),{state:n}),w(I({},e),{nodes:s})}markAllIterationNodesCompleted(){let e=this.graphLayout_$();if(!e)return;let t=e;for(let n of e.nodes)n.iterationIndex!=null&&n.state!==x.error&&(t=this.setNodeState(t,n.id,x.completed));this.graphLayout_$.set(t)}recalculateEdgePaths(e){let t=e.edges.map(n=>{let r=e.nodes.find(a=>a.id===n.sourceNodeId),s=e.nodes.find(a=>a.id===n.targetNodeId);return!r||!s?n:w(I({},n),{pathD:P.computeEdgePath(r,s,n.category)})});return w(I({},e),{edges:t})}resetState(){this.graphLayout_$.set(null),this.activeNodeId_$.set(""),this.selectedNodeId_$.set(""),this.currentIterationIndex=-1,this.lastAppliedPhase="",this.isLoading_$.set(!1),this.dynamicNodeCounter=0,this.phaseRightColumnLast={},this.iterationColumnLast={}}disposeSubscriptions(){this.monitoringSubscription&&(this.monitoringSubscription.unsubscribe(),this.monitoringSubscription=null)}static toRecord(e){return typeof e!="object"||e==null?{}:JSON.parse(JSON.stringify(e))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=xe({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var ot=["appSesGraphNodeSvg",""];function rt(i,o){if(i&1&&(H(),p(0,"text",1),m(1),d()),i&2){let e=C();Y("x",10)("y",e.node().height/2+1),u(),L(e.icon_$())}}function at(i,o){if(i&1&&(H(),p(0,"text",3),m(1),d()),i&2){let e=C();Y("x",e.node().width-10)("y",12)("fill",e.node().state==="error"?"#ef4444":"#22c55e"),u(),L(e.stateIcon_$())}}function st(i,o){if(i&1&&(H(),p(0,"text",4),m(1),d()),i&2){let e=C();Y("x",e.node().width-8)("y",e.node().height-8),u(),_e("",e.durationMs_$(),"ms")}}var $e=class i{node=F.required();isHighlighted=F(!1);isSelected=F(!1);nodeClicked=ne();fillColor_$=g(()=>{let o=this.node();return o.state===x.pending?"#262626":i.CATEGORY_FILL_MAP[o.category]??"#262626"});strokeColor_$=g(()=>{let o=this.node();return o.state===x.error?"#ef4444":o.state===x.pending?"#525252":i.CATEGORY_STROKE_MAP[o.category]??"#737373"});strokeDashArray_$=g(()=>this.node().state===x.pending?"6 3":"none");textColor_$=g(()=>this.node().state===x.pending?"#737373":"#e5e5e5");opacity_$=g(()=>this.node().state===x.pending?.5:1);borderRadius_$=g(()=>this.node().category===f.action?16:8);icon_$=g(()=>{let o=this.node().category;return i.CATEGORY_ICON_MAP[o]??""});stateIcon_$=g(()=>{let o=this.node().state;return o===x.completed?"\u2713":o===x.error?"\u2715":""});animationClass_$=g(()=>this.node().state===x.active||this.isHighlighted()?"ses-graph-node--active":this.isSelected()?"ses-graph-node--selected":"");durationMs_$=g(()=>this.node().data.durationMs??0);handleClick(){this.nodeClicked.emit(this.node().id)}static CATEGORY_FILL_MAP={[f.phase]:"#1a1a2e",[f.milestone]:"#052e16",[f.llmCall]:"#1e1033",[f.toolCall]:"#2e2a05",[f.toolError]:"#2e1505",[f.loopIteration]:"#0a1628",[f.action]:"#1a1a2e",[f.error]:"#2e0505"};static CATEGORY_STROKE_MAP={[f.phase]:"#525252",[f.milestone]:"#22c55e",[f.llmCall]:"#a855f7",[f.toolCall]:"#eab308",[f.toolError]:"#f97316",[f.loopIteration]:"#3b82f6",[f.action]:"#3b82f6",[f.error]:"#ef4444"};static CATEGORY_ICON_MAP={[f.milestone]:"\u26A1",[f.llmCall]:"\u{1F9E0}",[f.toolCall]:"\u{1F527}",[f.toolError]:"\u26A0\uFE0F",[f.error]:"\u274C"};static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ae({type:i,selectors:[["","appSesGraphNodeSvg",""]],inputs:{node:[1,"node"],isHighlighted:[1,"isHighlighted"],isSelected:[1,"isSelected"]},outputs:{nodeClicked:"nodeClicked"},standalone:!0,features:[le],attrs:ot,decls:7,vars:21,consts:[[2,"cursor","pointer",3,"click"],["dominant-baseline","central","text-anchor","start","font-size","14"],["dominant-baseline","central"],["text-anchor","end","dominant-baseline","central","font-size","11","font-weight","700"],["text-anchor","end","dominant-baseline","auto","fill","#737373","font-size","9"]],template:function(e,t){e&1&&(H(),p(0,"g",0),B("click",function(){return t.handleClick()}),W(1,"rect"),D(2,rt,2,3,":svg:text",1),p(3,"text",2),m(4),d(),D(5,at,2,4,":svg:text",3)(6,st,2,3,":svg:text",4),d()),e&2&&(se(t.animationClass_$()),Y("transform","translate("+t.node().x+","+t.node().y+")")("opacity",t.opacity_$()),u(),Y("width",t.node().width)("height",t.node().height)("rx",t.borderRadius_$())("fill",t.fillColor_$())("stroke",t.strokeColor_$())("stroke-width",t.isSelected()?2.5:1.5)("stroke-dasharray",t.strokeDashArray_$()),u(),S(t.icon_$()?2:-1),u(),Y("x",t.icon_$()?30:t.node().width/2)("y",t.node().height/2+1)("text-anchor",t.icon_$()?"start":"middle")("fill",t.textColor_$())("font-size",t.node().category==="phase"||t.node().category==="milestone"?14:12)("font-weight",t.node().category==="phase"||t.node().category==="milestone"?600:400),u(),L(t.node().label),u(),S(t.stateIcon_$()?5:-1),u(),S(t.durationMs_$()?6:-1))},dependencies:[de],encapsulation:2})};function lt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Phase"),d(),p(3,"span",9),m(4),d()()),i&2){let e=C();u(4),L(e.node().phase)}}function dt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Step"),d(),p(3,"span",9),m(4),d()()),i&2){let e=C();u(4),L(e.stepLabel_$())}}function ct(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Duration"),d(),p(3,"span",9),m(4),d()()),i&2){let e=C();u(4),L(e.durationLabel_$())}}function pt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Tool"),d(),p(3,"span",12),m(4),d()()),i&2){let e=C();u(4),L(e.toolId_$())}}function ht(i,o){if(i&1&&(p(0,"div",10)(1,"span",13),m(2,"Intent"),d(),p(3,"span",14),m(4),d()()),i&2){let e=C();u(4),L(e.intent_$())}}function ut(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Iteration"),d(),p(3,"span",15),m(4),d()()),i&2){let e=C();u(4),_e("#",e.node().iterationIndex,"")}}function mt(i,o){if(i&1&&(p(0,"span",13),m(1," In: "),p(2,"span",9),m(3),d()()),i&2){let e=C(2);u(3),L(e.inputSize_$())}}function _t(i,o){if(i&1&&(p(0,"span",13),m(1," Out: "),p(2,"span",9),m(3),d()()),i&2){let e=C(2);u(3),L(e.outputSize_$())}}function ft(i,o){if(i&1&&(p(0,"div",11),D(1,mt,4,1,"span",13)(2,_t,4,1,"span",13),d()),i&2){let e=C();u(),S(e.inputSize_$()>0?1:-1),u(),S(e.outputSize_$()>0?2:-1)}}function gt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Provider"),d(),p(3,"span",26),m(4),d()()),i&2){let e=C(3);u(4),L(e.usedProvider_$())}}function xt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Model"),d(),p(3,"span",26),m(4),d()()),i&2){let e=C(3);u(4),L(e.usedModel_$())}}function yt(i,o){if(i&1&&(p(0,"span",13),m(1," Cost: "),p(2,"span",27),m(3),d()()),i&2){let e=C(4);u(3),L(e.costUsd_$())}}function St(i,o){if(i&1&&(p(0,"div",25)(1,"span",13),m(2," Tokens: "),p(3,"span",9),m(4),d()(),D(5,yt,4,1,"span",13),d()),i&2){let e=C(3);u(4),L(e.tokenInfo_$().total),u(),S(e.costUsd_$()?5:-1)}}function Ct(i,o){if(i&1&&(p(0,"div",16)(1,"div",23),m(2,"Used"),d(),p(3,"div",24),D(4,gt,5,1,"div",7)(5,xt,5,1,"div",7)(6,St,6,2,"div",25),d()()),i&2){let e=C(2);u(4),S(e.usedProvider_$()?4:-1),u(),S(e.usedModel_$()?5:-1),u(),S(e.tokenInfo_$()?6:-1)}}function vt(i,o){if(i&1){let e=ie();p(0,"button",28),B("click",function(){R(e);let n=C(2);return z(n.handleClearOverride())}),m(1," Clear "),d()}}function It(i,o){i&1&&(p(0,"div",21),m(1," Session override active "),d())}function Et(i,o){if(i&1&&(p(0,"div",22)(1,"div",29),m(2,"Global default"),d(),p(3,"div",30),m(4),d()()),i&2){let e=C(2);u(4),ze(" ",e.globalDefault_$().provider," / ",e.globalDefault_$().model," ")}}function Nt(i,o){if(i&1){let e=ie();D(0,Ct,7,3,"div",16),p(1,"div",16)(2,"div",17)(3,"div",18),m(4),d(),D(5,vt,2,0,"button",19),d(),p(6,"app-s-registry-provider-model-select",20),B("modelChange",function(n){R(e);let r=C();return z(r.handleModelChange(n))}),d(),D(7,It,2,0,"div",21),d(),D(8,Et,5,2,"div",22)}if(i&2){let e=C();S(e.usedProvider_$()||e.usedModel_$()?0:-1),u(4),_e(" Override: ",e.callTypeLabel_$()," "),u(),S(e.hasSessionOverride_$()?5:-1),u(),me("selectedProvider",e.selectedProvider_$())("selectedModel",e.selectedModel_$()),u(),S(e.hasSessionOverride_$()?7:-1),u(),S(e.globalDefault_$()?8:-1)}}var Ke=(()=>{class i{graph_DS=Z(Ze);session_DS=Z(Ce);registrySsot_CS=Z(Be);node=F.required();closed=ne();stateLabel_$=g(()=>({pending:"Pending",active:"Active",completed:"Completed",error:"Error"})[this.node().state]??this.node().state);durationLabel_$=g(()=>{let e=this.node().data.durationMs;return!e||e<=0?"":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`});toolId_$=g(()=>{let e=this.node().data,t=e.toolId??e.tool;return typeof t=="string"?t:""});intent_$=g(()=>{let e=this.node().data.intent;return typeof e=="string"?e:""});stepLabel_$=g(()=>{let e=this.node().data.step;return typeof e!="string"||e.length===0?"":ve.formatStepId(e)});inputSize_$=g(()=>{let e=this.node().monitoringEvent;return e?e.inputSize??0:0});outputSize_$=g(()=>{let e=this.node().monitoringEvent;return e?e.outputSize??0:0});stateColorClass_$=g(()=>({pending:"text-neutral-500",active:"text-cyan-400",completed:"text-green-400",error:"text-red-400"})[this.node().state]??"text-neutral-400");isLlmCall_$=g(()=>this.node().category===f.llmCall);callType_$=g(()=>{let e=this.node().data?.callType;return typeof e=="string"?e:""});callTypeLabel_$=g(()=>{let e=this.callType_$();return Ye[e]??e});usedProvider_$=g(()=>{let e=this.node().data?.provider;return typeof e=="string"?e:""});usedModel_$=g(()=>{let e=this.node().data?.model;return typeof e=="string"?e:""});sessionOverride_$=g(()=>{let e=this.callType_$();if(!e)return null;let t=this.graph_DS.graphSessionId_$();if(!t)return null;let r=this.session_DS.sessionInfoMap_$().get(t);if(!r)return null;let s=r.llmCallTypeOverrides;if(!s)return null;let a=s[e];if(typeof a!="object"||!a)return null;let h=a,l=h.provider,c=h.model;return typeof l=="string"&&typeof c=="string"?{provider:l,model:c}:null});globalDefault_$=g(()=>{let e=this.callType_$();if(!e)return null;let t=this.graph_DS.graphSessionId_$(),r=this.session_DS.sessionInfoMap_$().get(t);if(!r)return null;let s=r.globalCallTypeDefaults;if(!s)return null;let a=s[e];if(typeof a!="object"||!a)return null;let h=a,l=h.provider,c=h.model;return typeof l=="string"&&typeof c=="string"?{provider:l,model:c}:null});selectedProvider_$=g(()=>this.sessionOverride_$()?.provider??"");selectedModel_$=g(()=>this.sessionOverride_$()?.model??"");hasSessionOverride_$=g(()=>this.sessionOverride_$()!==null);tokenInfo_$=g(()=>{let e=this.node().data,t=e.promptTokens,n=e.completionTokens,r=e.totalTokens;return typeof r!="number"||r<=0?null:{prompt:typeof t=="number"?t:0,completion:typeof n=="number"?n:0,total:r}});costUsd_$=g(()=>{let e=this.node().data?.costUsd;return typeof e!="number"||e<=0?"":`$${e.toFixed(4)}`});handleClose(){this.closed.emit()}handleProviderChange(e){}handleModelChange(e){let t=this.callType_$(),n=this.graph_DS.graphSessionId_$();if(!t||!n||!e)return;let s=this.registrySsot_CS.enabledLlmModels_$().find(a=>a.modelName===e);s&&this.applySessionOverride(n,t,s.provider,s.modelName)}handleClearOverride(){let e=this.callType_$(),t=this.graph_DS.graphSessionId_$();!e||!t||this.clearSessionOverride(t,e)}applySessionOverride(e,t,n,r){let h=this.session_DS.sessionInfoMap_$().get(e)?.llmCallTypeOverrides??{},l=w(I({},h),{[t]:{provider:n,model:r}});this.session_DS.updateSession({sessionId:e,updates:{llmCallTypeOverrides:l}}).then(()=>{this.session_DS.loadSessionInfo(e)})}clearSessionOverride(e,t){let s=this.session_DS.sessionInfoMap_$().get(e)?.llmCallTypeOverrides??{},a=I({},s);Reflect.deleteProperty(a,t);let h=Object.keys(a).length>0;this.session_DS.updateSession({sessionId:e,updates:{llmCallTypeOverrides:h?a:null}}).then(()=>{this.session_DS.loadSessionInfo(e)})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ae({type:i,selectors:[["app-ses-graph-node-detail"]],inputs:{node:[1,"node"]},outputs:{closed:"closed"},standalone:!0,features:[le],decls:26,vars:13,consts:[[1,"w-80","max-h-[28rem]","overflow-y-auto","rounded-lg","border","border-neonCyan/30","bg-neutral-900/95","shadow-lg","backdrop-blur-sm","p-3"],[1,"flex","items-start","justify-between","gap-2","mb-2"],[1,"text-sm","font-semibold","text-neutral-200","leading-tight"],["title","Bez\xE1r\xE1s","aria-label","Bez\xE1r\xE1s",1,"p-1","min-h-[28px]","min-w-[28px]","flex","items-center","justify-center","rounded","text-neutral-400","hover:text-neutral-200","hover:bg-neutral-700","transition-colors","shrink-0",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5"],["d","M18 6L6 18M6 6l12 12"],[1,"space-y-1.5","text-xs"],[1,"flex","items-center","gap-2"],[1,"text-neutral-500","w-16","shrink-0"],[1,"text-neutral-300"],[1,"flex","flex-col","gap-0.5"],[1,"flex","items-center","gap-3","pt-1","border-t","border-neutral-800"],[1,"text-yellow-300","font-mono","text-[11px]"],[1,"text-neutral-500"],[1,"text-neutral-300","text-[11px]","leading-tight","break-words"],[1,"text-blue-400"],[1,"mt-3","pt-2","border-t","border-neutral-700"],[1,"flex","items-center","justify-between","mb-1.5"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider"],[1,"text-[10px]","text-red-400","hover:text-red-300","transition-colors"],["registryKind","llm","providerLabel","Provider","modelLabel","Model",3,"modelChange","selectedProvider","selectedModel"],[1,"mt-1.5","text-[10px]","text-purple-400"],[1,"mt-2","pt-1.5","border-t","border-neutral-800"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","mb-1.5"],[1,"space-y-1","text-xs"],[1,"flex","items-center","gap-3"],[1,"text-purple-300","font-mono","text-[11px]"],[1,"text-green-400"],[1,"text-[10px]","text-red-400","hover:text-red-300","transition-colors",3,"click"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","mb-1"],[1,"text-[11px]","text-neutral-400","font-mono"]],template:function(t,n){t&1&&(p(0,"div",0)(1,"div",1)(2,"h3",2),m(3),d(),p(4,"button",3),B("click",function(){return n.handleClose()}),H(),p(5,"svg",4),W(6,"path",5),d()()(),ye(),p(7,"div",6)(8,"div",7)(9,"span",8),m(10,"State"),d(),p(11,"span"),m(12),d()(),p(13,"div",7)(14,"span",8),m(15,"Type"),d(),p(16,"span",9),m(17),d()(),D(18,lt,5,1,"div",7)(19,dt,5,1,"div",7)(20,ct,5,1,"div",7)(21,pt,5,1,"div",7)(22,ht,5,1,"div",10)(23,ut,5,1,"div",7)(24,ft,3,2,"div",11),d(),D(25,Nt,9,7),d()),t&2&&(u(3),L(n.node().label),u(8),se(n.stateColorClass_$()+" font-medium"),u(),L(n.stateLabel_$()),u(5),L(n.node().category),u(),S(n.node().phase?18:-1),u(),S(n.stepLabel_$()?19:-1),u(),S(n.durationLabel_$()?20:-1),u(),S(n.toolId_$()?21:-1),u(),S(n.intent_$()?22:-1),u(),S(n.node().iterationIndex!==null?23:-1),u(),S(n.inputSize_$()>0||n.outputSize_$()>0?24:-1),u(),S(n.isLlmCall_$()&&n.callType_$()?25:-1))},dependencies:[de,Fe],encapsulation:2})}return i})();var $t=["graphSvg"],Qe=(i,o)=>o.id;function bt(i,o){i&1&&(p(0,"span",7),m(1,"Loading trace..."),d())}function Lt(i,o){if(i&1&&(H(),W(0,"rect",16)),i&2){let e=o;Y("x",e.x)("y",e.y)("width",e.width)("height",e.height)}}function wt(i,o){if(i&1&&(H(),W(0,"path",17)),i&2){let e=o.$implicit;Y("d",e.pathD)("stroke",e.strokeColor)("stroke-dasharray",e.strokeDashArray)("marker-end",e.markerEnd)}}function Tt(i,o){if(i&1){let e=ie();H(),p(0,"g",20),B("nodeClicked",function(n){R(e);let r=C();return z(r.handleNodeClick(n))}),d()}if(i&2){let e=o.$implicit,t=C();me("node",e)("isHighlighted",t.activeNodeId()===e.id)("isSelected",t.selectedNodeId()===e.id)}}function Mt(i,o){if(i&1){let e=ie();p(0,"app-ses-graph-node-detail",21),B("closed",function(){R(e);let n=C();return z(n.handleDetailClose())}),d()}i&2&&me("node",o)}var Gn=(()=>{class i{svgRef;layout=F(null);activeNodeId=F("");selectedNodeId=F("");isLoading=F(!1);nodeClicked=ne();detailClosed=ne();viewBox_$=V({x:0,y:0,width:800,height:600});viewBoxStr_$=g(()=>{let e=this.viewBox_$();return`${e.x} ${e.y} ${e.width} ${e.height}`});isFollowActive_$=V(!0);isPanning=!1;panStartX=0;panStartY=0;panStartViewBoxX=0;panStartViewBoxY=0;nodes_$=g(()=>this.layout()?.nodes??[]);edges_$=g(()=>this.layout()?.edges??[]);loopBounds_$=g(()=>this.layout()?.loopContainerBounds??null);selectedNode_$=g(()=>{let e=this.selectedNodeId();return e?this.nodes_$().find(t=>t.id===e)??null:null});constructor(){Se(()=>{let e=this.layout();e&&this.viewBox_$.set(I({},e.viewBox))},{allowSignalWrites:!0})}handleNodeClick(e){this.nodeClicked.emit(e)}handleDetailClose(){this.detailClosed.emit()}handlePointerDown(e){if(e.button!==0)return;this.isPanning=!0,this.panStartX=e.clientX,this.panStartY=e.clientY;let t=this.viewBox_$();this.panStartViewBoxX=t.x,this.panStartViewBoxY=t.y,this.svgRef&&this.svgRef.nativeElement.setPointerCapture(e.pointerId)}handlePointerMove(e){if(!this.isPanning||!this.svgRef)return;let t=this.svgRef.nativeElement,n=this.viewBox_$(),r=n.width/t.clientWidth,s=n.height/t.clientHeight,a=(e.clientX-this.panStartX)*r,h=(e.clientY-this.panStartY)*s;this.viewBox_$.set(w(I({},n),{x:this.panStartViewBoxX-a,y:this.panStartViewBoxY-h}))}handlePointerUp(){this.isPanning=!1}handleWheel(e){if(e.preventDefault(),!this.svgRef)return;let t=this.svgRef.nativeElement,n=this.viewBox_$(),r=e.deltaY>0?1.1:.9,s=t.getBoundingClientRect(),a=(e.clientX-s.left)/s.width,h=(e.clientY-s.top)/s.height,l=n.width*r,c=n.height*r;if(l<200||l>5e3)return;let _=n.x+(n.width-l)*a,y=n.y+(n.height-c)*h;this.viewBox_$.set({x:_,y,width:l,height:c})}handleFitToView(){let e=this.nodes_$();if(e.length===0)return;let t=P.recalculateViewBox(e,48);this.viewBox_$.set(t)}handleToggleFollowActive(){this.isFollowActive_$.update(e=>!e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ae({type:i,selectors:[["app-ses-graph-view"]],viewQuery:function(t,n){if(t&1&&Ge($t,5),t&2){let r;Oe(r=Re())&&(n.svgRef=r.first)}},inputs:{layout:[1,"layout"],activeNodeId:[1,"activeNodeId"],selectedNodeId:[1,"selectedNodeId"],isLoading:[1,"isLoading"]},outputs:{nodeClicked:"nodeClicked",detailClosed:"detailClosed"},standalone:!0,features:[le],decls:25,vars:6,consts:[["graphSvg",""],[1,"flex","flex-col","h-full","w-full","overflow-hidden"],[1,"flex","items-center","gap-2","px-3","py-2","border-b","border-neutral-800","shrink-0","bg-neutral-900/80"],["title","Fit to view",1,"px-2","py-1","text-xs","border","rounded","transition-colors","border-neutral-700","text-neutral-400","hover:text-neutral-200","hover:border-neutral-500",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","inline-block","mr-1"],["d","M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"],["title","Follow active node",1,"px-2","py-1","text-xs","border","rounded","transition-colors",3,"click"],[1,"text-xs","text-neutral-500","ml-auto"],[1,"flex-1","min-h-0","relative"],["preserveAspectRatio","xMidYMid meet",1,"ses-graph-svg",3,"pointerdown","pointermove","pointerup","pointerleave","wheel"],["id","ses-arrow-seq","markerWidth","8","markerHeight","6","refX","8","refY","3","orient","auto","markerUnits","strokeWidth"],["d","M 0 0 L 8 3 L 0 6 Z","fill","#525252"],["id","ses-arrow-loop","markerWidth","8","markerHeight","6","refX","8","refY","3","orient","auto","markerUnits","strokeWidth"],["d","M 0 0 L 8 3 L 0 6 Z","fill","#3b82f6"],["id","ses-arrow-error","markerWidth","8","markerHeight","6","refX","8","refY","3","orient","auto","markerUnits","strokeWidth"],["d","M 0 0 L 8 3 L 0 6 Z","fill","#f97316"],["rx","6","fill","#0f172a","stroke","#1e3a5f","stroke-width","1","stroke-dasharray","4 2","opacity","0.5"],["stroke-width","1.5","fill","none"],["appSesGraphNodeSvg","",3,"node","isHighlighted","isSelected"],[1,"absolute","top-2","right-2","z-10",3,"node"],["appSesGraphNodeSvg","",3,"nodeClicked","node","isHighlighted","isSelected"],[1,"absolute","top-2","right-2","z-10",3,"closed","node"]],template:function(t,n){if(t&1){let r=ie();p(0,"div",1)(1,"div",2)(2,"button",3),B("click",function(){return R(r),z(n.handleFitToView())}),H(),p(3,"svg",4),W(4,"path",5),d(),m(5," Fit "),d(),ye(),p(6,"button",6),B("click",function(){return R(r),z(n.handleToggleFollowActive())}),m(7," Follow "),d(),D(8,bt,2,0,"span",7),d(),p(9,"div",8),H(),p(10,"svg",9,0),B("pointerdown",function(a){return R(r),z(n.handlePointerDown(a))})("pointermove",function(a){return R(r),z(n.handlePointerMove(a))})("pointerup",function(){return R(r),z(n.handlePointerUp())})("pointerleave",function(){return R(r),z(n.handlePointerUp())})("wheel",function(a){return R(r),z(n.handleWheel(a))}),p(12,"defs")(13,"marker",10),W(14,"path",11),d(),p(15,"marker",12),W(16,"path",13),d(),p(17,"marker",14),W(18,"path",15),d()(),D(19,Lt,1,4,":svg:rect",16),Le(20,wt,1,4,":svg:path",17,Qe),Le(22,Tt,1,3,":svg:g",18,Qe),d(),D(24,Mt,1,1,"app-ses-graph-node-detail",19),d()()}if(t&2){let r,s;u(6),se(n.isFollowActive_$()?"border-neonCyan/50 text-neonCyan bg-neonCyan/10":"border-neutral-700 text-neutral-400 hover:text-neutral-200 hover:border-neutral-500"),u(2),S(n.isLoading()?8:-1),u(2),Y("viewBox",n.viewBoxStr_$()),u(9),S((r=n.loopBounds_$())?19:-1,r),u(),we(n.edges_$()),u(2),we(n.nodes_$()),u(2),S((s=n.selectedNode_$())?24:-1,s)}},dependencies:[de,$e,Ke],styles:[`@charset "UTF-8";@keyframes _ngcontent-%COMP%_ses-graph-node-pulse{0%,to{filter:drop-shadow(0 0 4px var(--ses-graph-pulse-color, #22d3ee))}50%{filter:drop-shadow(0 0 12px var(--ses-graph-pulse-color, #22d3ee))}}[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.ses-graph-svg[_ngcontent-%COMP%]{width:100%;height:100%;background:#0a0a0a;-webkit-user-select:none;user-select:none} .ses-graph-node--active{animation:_ngcontent-%COMP%_ses-graph-node-pulse 1.5s ease-in-out infinite} .ses-graph-node--active rect{stroke-width:2.5} .ses-graph-node--selected{filter:drop-shadow(0 0 6px rgba(34,211,238,.4))}
1
+ import{c as Ce}from"./chunk-F5SAKHCX.js";import{b as Ye}from"./chunk-COVCHZOZ.js";import{a as v}from"./chunk-UFBTR2BG.js";import{h as Be,i as Fe}from"./chunk-RL2M6DJN.js";import{I as Ve}from"./chunk-RXRE3G4K.js";import{Aa as Oe,Ba as Re,C as Z,D as ae,Fa as m,Ga as L,Ha as _e,Ia as ze,J as R,K as z,L as H,M as ye,P as Pe,T as ne,Ta as le,U as F,Z as u,a as I,aa as V,b as w,da as D,fa as Y,ga as me,hb as g,ja as se,jb as Se,k as ke,la as S,oa as Le,p as be,pa as we,qa as p,ra as d,sa as W,ua as ie,ub as de,va as B,wa as C,xb as He,y as xe,za as Ge}from"./chunk-TBMJSIBB.js";var ve=class i{static getEmoji(o){let e=o.data??{},t=typeof e.step=="string"?e.step:"";return t==="run-initialization"?"\u{1F680}":t==="run-flow-complete"?"\u{1F3AF}":t==="tool-error-retry"?"\u26A0\uFE0F\u{1F9E0}":t.includes("tool-error")||t.includes("error-recovery")?"\u{1F527}\u274C":t.includes("agentic-loop-iteration")?"":o.eventType==="tool-call"||typeof e.toolId=="string"?"\u{1F527}":o.eventType==="llm-call"||typeof e.callType=="string"?"\u{1F9E0}":o.eventType==="error"?"\u26A0\uFE0F":""}static getBubbleClasses(o){let e=o.data??{},t=typeof e.step=="string"?e.step:"";return t==="run-initialization"||t==="run-flow-complete"?"bg-green-500/10 text-green-300 border border-green-500/50":t==="tool-error-retry"||t.includes("tool-error")||t.includes("error-recovery")?"bg-orange-500/10 text-orange-300 border border-orange-500/50":o.eventType==="error"||t.includes("circuit-breaker")?"bg-red-500/10 text-red-300 border border-red-500/50":t.includes("agentic-loop")?"bg-blue-500/10 text-blue-300 border border-blue-500/50":o.eventType==="tool-call"||typeof e.toolId=="string"?"bg-yellow-500/10 text-yellow-300 border border-yellow-500/50":o.eventType==="llm-call"||typeof e.callType=="string"?"bg-purple-500/10 text-purple-300 border border-purple-500/50":"bg-neutral-700 text-neutral-200 border border-neonCyan"}static getStepLabel(o){let e=o.data??{},t=e.step,n=e.toolId;if(typeof t=="string"&&t.length>0)return i.formatStepId(t);if(o.eventType==="tool-call"&&typeof n=="string"&&n.length>0)return`Eszk\xF6z: ${n}`;if(o.eventType==="llm-call"){let r=e.callType;return typeof r=="string"?`LLM: ${i.formatStepId(r)}`:"LLM h\xEDv\xE1s"}if(o.eventType==="error"){let r=e.message;return typeof r=="string"&&r.length>0?`Hiba: ${r.substring(0,40)}${r.length>40?"\u2026":""}`:"Hiba"}return o.eventType==="compacting"?typeof t=="string"&&t.length>0?i.formatStepId(t):"Compacting":i.formatEventTypeFallback(o.eventType)}static formatStepId(o){return o.split("-").map(e=>e.length>0?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e).join(" ")}static getDotClasses(o){let e=o.data??{},t=typeof e.step=="string"?e.step:"";return t==="run-initialization"||t==="run-flow-complete"?"bg-green-400":t==="tool-error-retry"||t.includes("tool-error")||t.includes("error-recovery")?"bg-orange-400":o.eventType==="error"||t.includes("circuit-breaker")?"bg-red-400":t.includes("agentic-loop")?"bg-blue-400":o.eventType==="tool-call"||typeof e.toolId=="string"?"bg-yellow-400":o.eventType==="llm-call"||typeof e.callType=="string"?"bg-purple-400":"bg-neutral-400"}static formatEventTypeFallback(o){return{step:"L\xE9p\xE9s","tool-call":"Eszk\xF6zh\xEDv\xE1s","context-update":"Kontextus friss\xEDt\xE9s",compacting:"Compacting","llm-call":"LLM h\xEDv\xE1s","session-event":"Session event",error:"Hiba"}[o]??o}};var x=function(i){return i.pending="pending",i.active="active",i.completed="completed",i.error="error",i}(x||{});var tt={[v.runInitialization]:"milestone-init",[v.analyze]:"phase-analyze",[v.analyzeResult]:"llm-analyze",[v.assemble]:"phase-assemble",[v.execution]:"phase-execution",[v.executionStart]:"phase-execution",[v.finalization]:"phase-finalization",[v.llmRunFinalization]:"llm-finalization",[v.postFinalization]:"phase-finalization",[v.runFlowComplete]:"milestone-complete"},nt=["milestone-init","phase-analyze","llm-analyze","phase-assemble","phase-execution","phase-finalization","llm-finalization","milestone-complete"],N=class i{static mapPhaseToNodeId(o){return tt[o]??null}static computeStateTransitions(o){let e=i.mapPhaseToNodeId(o);if(!e)return[];let t=[],n=!1;for(let r of nt)r===e?(t.push({nodeId:r,state:x.active}),n=!0):n||t.push({nodeId:r,state:x.completed});return t}static extractIterationData(o){let e=o.action;if(typeof e!="string")return null;let t=o.tool,n=typeof t=="string"?t:"",r=o.intent,s=typeof r=="string"?r:"",a=o.iterationCount;return{actionType:e,tool:n,intent:s,iterationIndex:typeof a=="number"?a:0}}static mapMonitoringEventToIterationNodeId(o,e){let t=o.data??{},n=t.step,r=typeof n=="string"?n:"",s=`iter-${e}`;if(o.eventType==="llm-call"){let a=t.callType;if(a==="agentic-loop")return`${s}-llm-decision`;if(a==="tool-description")return`${s}-tool-desc`;if(a==="tool-error-retry")return`${s}-tool-error-retry`;if(a==="tool-result-chunking")return`${s}-tool-chunking`;if(a==="goal-state-update")return`${s}-goal-update`}return o.eventType==="tool-call"?`${s}-tool-call`:o.eventType==="error"||r.includes("tool-error")?`${s}-tool-call`:null}static isTerminalPhase(o){return o===v.runFlowComplete}static SKELETON_LLM_NODE_MAP={analyze:"llm-analyze","run-finalization":"llm-finalization"};static LLM_CALL_PHASE_MAP={analyze:"phase-analyze","subanalyze-run-tasks":"phase-analyze","instant-reply":"phase-execution","run-finalization":"phase-finalization","chat-history-compacting":"phase-execution","execution-history-compacting":"phase-execution","soul-compacting":"phase-execution","context-compacting":"phase-execution","message-interceptor":"phase-execution"};static ITERATION_LLM_CALL_TYPES=new Set(["agentic-loop","tool-description","tool-error-retry","tool-result-chunking","goal-state-update"]);static LLM_CALL_LABEL_MAP={analyze:"LLM: Analyze","subanalyze-run-tasks":"LLM: Subanalyze","instant-reply":"LLM: Instant Reply","agentic-loop":"LLM Decision","tool-description":"Tool Description","tool-error-retry":"LLM: Error Retry","run-finalization":"LLM: Summary","chat-history-compacting":"LLM: Compact Chat","execution-history-compacting":"LLM: Compact Exec","soul-compacting":"LLM: Compact Soul","context-compacting":"LLM: Compact Ctx","tool-result-chunking":"LLM: Chunking","goal-state-update":"LLM: Goal Update","message-interceptor":"LLM: Msg Intercept"};static getPreCreatedSkeletonNodeId(o){return i.SKELETON_LLM_NODE_MAP[o]??null}static getLlmCallPhaseId(o){return i.LLM_CALL_PHASE_MAP[o]??null}static isIterationLlmCall(o){return i.ITERATION_LLM_CALL_TYPES.has(o)}static getLlmCallLabel(o){return i.LLM_CALL_LABEL_MAP[o]??`LLM: ${o}`}};var k=function(i){return i.sequential="sequential",i.loopEntry="loop-entry",i.errorRetry="error-retry",i}(k||{});var f=function(i){return i.phase="phase",i.milestone="milestone",i.llmCall="llm-call",i.toolCall="tool-call",i.toolError="tool-error",i.loopIteration="loop-iteration",i.action="action",i.error="error",i}(f||{});var je="milestone-init",Ee="phase-analyze",it="llm-analyze",Me="phase-assemble",ee="phase-execution",he="phase-finalization",Ae="llm-finalization",De="milestone-complete",P=class i{static buildSkeletonLayout(){let o=48+220/2,e=48,t=[],n=[],r=i.createNode({id:je,category:f.milestone,label:"Initialization",phase:v.runInitialization,x:o-200/2,y:e,width:200,height:48});t.push(r),e+=84;let s=i.createNode({id:Ee,category:f.phase,label:"Analyze",phase:v.analyze,x:o-220/2,y:e,width:220,height:60});t.push(s);let a=i.createNode({id:it,category:f.llmCall,label:"LLM: Analyze",phase:v.analyzeResult,x:o+220/2+28,y:e+16/2,width:160,height:44,parentId:Ee});t.push(a),n.push(i.createEdge(je,Ee,k.sequential)),e+=96;let h=i.createNode({id:Me,category:f.phase,label:"Assemble",phase:v.assemble,x:o-220/2,y:e,width:220,height:60});t.push(h),n.push(i.createEdge(Ee,Me,k.sequential)),e+=96;let l=i.createNode({id:ee,category:f.phase,label:"Execution",phase:v.execution,x:o-220/2,y:e,width:220,height:60});t.push(l),n.push(i.createEdge(Me,ee,k.sequential)),e+=96;let c=i.createNode({id:he,category:f.phase,label:"Finalization",phase:v.finalization,x:o-220/2,y:e,width:220,height:60});t.push(c);let _=i.createNode({id:Ae,category:f.llmCall,label:"LLM: Summary",phase:v.llmRunFinalization,x:o+220/2+28,y:e+16/2,width:160,height:44,parentId:he});t.push(_),n.push(i.createEdge(ee,he,k.sequential)),e+=96;let y=i.createNode({id:De,category:f.milestone,label:"Flow Complete",phase:v.runFlowComplete,x:o-200/2,y:e,width:200,height:48});t.push(y),n.push(i.createEdge(he,De,k.sequential));let T=i.recalculateViewBox(t,48);return{nodes:t,edges:n,viewBox:T,loopContainerBounds:null}}static addIterationColumn(o,e,t,n){let r=o.nodes.map(b=>I({},b)),s=[...o.edges],a=r.find(b=>b.id===ee);if(!a)return o;let h=a.x+20+e*208,l=a.y+60+20,c=`iter-${e}`,_=l,y=[],T=i.createNode({id:`${c}-llm-decision`,category:f.llmCall,label:"LLM Decision",phase:v.llmAgenticLoop,x:h,y:_,width:160,height:44,parentId:ee,iterationIndex:e});y.push(T),_+=68;let M=i.formatActionLabel(t),O=i.createNode({id:`${c}-action`,category:f.action,label:M,phase:v.agenticLoopIteration,x:h+20/2,y:_,width:140,height:32,parentId:ee,iterationIndex:e,data:n});if(y.push(O),_+=56,t==="tool-select"){let b=i.createNode({id:`${c}-tool-desc`,category:f.llmCall,label:"Tool Description",phase:v.llmToolDescription,x:h,y:_,width:160,height:44,parentId:ee,iterationIndex:e});y.push(b),_+=68;let q=n.tool,Q=typeof q=="string"?q:"tool",te=i.createNode({id:`${c}-tool-call`,category:f.toolCall,label:Q,phase:null,x:h,y:_,width:160,height:44,parentId:ee,iterationIndex:e,data:n});y.push(te),_+=68}for(let b=0;b<y.length-1;b++)s.push(i.createEdge(y[b].id,y[b+1].id,k.sequential));r.push(...y);let E=20*2+(e+1)*180+e*28,j=60+20*2+(_-l);a.width=Math.max(a.width,E),a.height=Math.max(a.height,j);let K=a.y+a.height,A=[he,Ae,De],ue=K+36;for(let b of A){let q=r.find(Q=>Q.id===b);if(q){if(b===Ae){let Q=r.find(te=>te.id===he);Q&&(q.y=Q.y+16/2);continue}q.y=ue,ue+=q.height+36}}let ge={x:a.x,y:a.y+60,width:a.width,height:a.height-60},J=r,Je=s.map(b=>{let q=J.find(te=>te.id===b.sourceNodeId),Q=J.find(te=>te.id===b.targetNodeId);return!q||!Q?b:w(I({},b),{pathD:i.computeEdgePath(q,Q,b.category)})}),et=i.recalculateViewBox(J,48);return{nodes:J,edges:Je,viewBox:et,loopContainerBounds:ge}}static computeEdgePath(o,e,t){let n=o.x+o.width/2,r=o.y+o.height,s=e.x+e.width/2,a=e.y;if(Math.abs(n-s)<20)return`M ${n} ${r} L ${s} ${a}`;let h=o.x+o.width,l=o.y+o.height/2,c=e.x,_=e.y+e.height/2;if(e.parentId===o.id)return`M ${h} ${l} L ${c} ${_}`;let y=r+(a-r)/2;return`M ${n} ${r} L ${n} ${y} L ${s} ${y} L ${s} ${a}`}static recalculateViewBox(o,e){if(o.length===0)return{x:0,y:0,width:600,height:400};let t=1/0,n=1/0,r=-1/0,s=-1/0;for(let a of o)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x+a.width),s=Math.max(s,a.y+a.height);return{x:t-e,y:n-e,width:r-t+e*2,height:s-n+e*2}}static addDynamicLlmNode(o,e,t,n,r,s){let a=o.nodes.map(A=>I({},A)),h=[...o.edges],l=a.find(A=>A.id===e);if(!l)return o;let c,_;l.category===f.phase||l.category===f.milestone?(c=l.x+l.width+28,_=l.y+(l.height-44)/2):(c=l.x,_=l.y+l.height+24);let T=i.createNode({id:t,category:f.llmCall,label:n,phase:null,x:c,y:_,width:160,height:44,parentId:r,iterationIndex:s??void 0});a.push(T),h.push(i.createEdge(e,t,k.sequential));let M=T.y+T.height;s!=null?i.expandExecutionContainer(a,M):i.shiftDownstreamIfOverlap(a,r,M);let O=o.loopContainerBounds,E=a.find(A=>A.id==="phase-execution");E&&E.height>60&&(O={x:E.x,y:E.y+60,width:E.width,height:E.height-60});let j=h.map(A=>{let ue=a.find(J=>J.id===A.sourceNodeId),ge=a.find(J=>J.id===A.targetNodeId);return!ue||!ge?A:w(I({},A),{pathD:i.computeEdgePath(ue,ge,A.category)})}),K=i.recalculateViewBox(a,48);return{nodes:a,edges:j,viewBox:K,loopContainerBounds:O}}static expandExecutionContainer(o,e){let t=o.find(l=>l.id==="phase-execution");if(!t)return;let n=t.y+60+20,r=60+20*2+(e+24-n);if(r<=t.height)return;t.height=r;let s=t.y+t.height,a=["phase-finalization","llm-finalization","milestone-complete"],h=s+36;for(let l of a){let c=o.find(_=>_.id===l);if(c){if(l==="llm-finalization"){let _=o.find(y=>y.id==="phase-finalization");_&&(c.y=_.y+16/2);continue}c.y<h&&(c.y=h),h=c.y+c.height+36}}for(let l of o)if(l.parentId==="phase-finalization"&&l.id!=="llm-finalization"&&l.category===f.llmCall){let c=o.find(_=>_.id==="phase-finalization");c&&(l.y=Math.max(l.y,c.y))}}static shiftDownstreamIfOverlap(o,e,t){let n=["milestone-init","phase-analyze","phase-assemble","phase-execution","phase-finalization","milestone-complete"],r=n.indexOf(e);if(r<0||r>=n.length-1)return;let s=n[r+1],a=o.find(_=>_.id===s);if(!a||t+36<=a.y)return;let h=t+36-a.y,l=new Set;for(let _ of o)_.parentId===e&&_.category===f.llmCall&&l.add(_.id);let c=a.y;for(let _ of o)_.y>=c&&!l.has(_.id)&&(_.y+=h)}static createNode(o){return{id:o.id,category:o.category,state:x.pending,label:o.label,phase:o.phase,x:o.x,y:o.y,width:o.width,height:o.height,data:o.data??{},iterationIndex:o.iterationIndex??null,parentId:o.parentId??null,monitoringEvent:null}}static createEdge(o,e,t){let n=t===k.errorRetry?"#f97316":t===k.loopEntry?"#3b82f6":"#525252",r=t===k.loopEntry?"8 4":t===k.errorRetry?"6 3":"none",s=t===k.errorRetry?"url(#ses-arrow-error)":t===k.loopEntry?"url(#ses-arrow-loop)":"url(#ses-arrow-seq)";return{id:`edge-${o}-${e}`,category:t,sourceNodeId:o,targetNodeId:e,pathD:"",strokeColor:n,strokeDashArray:r,markerEnd:s}}static formatActionLabel(o){return{"tool-select":"Tool Select","tool-group-open":"Tool Group","context-handling":"Context","loop-debrief":"Debrief",result:"Result"}[o]??o}};var qe=(()=>{class i{baseUrl=`${Ve.api.baseUrl}/session`;http=Z(He);getEvents(e){let t=encodeURIComponent(e.trim());return be(this.http.get(`${this.baseUrl}/${t}/events`))}getRunTrace(e){let t=e.sessionId.trim(),n=encodeURIComponent(e.runId.trim());return be(this.http.get(`${this.baseUrl}/${encodeURIComponent(t)}/runs/${n}/trace`))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=xe({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var Ze=(()=>{class i{session_DS=Z(Ce);monitoring_AS=Z(qe);destroyRef=Z(Pe);graphLayout_$=V(null);activeNodeId_$=V("");selectedNodeId_$=V("");isLive_$=V(!1);isGraphOpen_$=V(!1);graphSessionId_$=V("");graphRunId_$=V("");isLoading_$=V(!1);currentIterationIndex=-1;monitoringSubscription=null;lastAppliedPhase="";phaseRightColumnLast={};iterationColumnLast={};dynamicNodeCounter=0;constructor(){Se(()=>{let e=this.session_DS.agentEvents_$();!this.isGraphOpen_$()||!this.isLive_$()||this.applyAgentEvent(e)},{allowSignalWrites:!0}),this.destroyRef.onDestroy(()=>{this.disposeSubscriptions()})}openGraphForRun(e,t,n){this.disposeSubscriptions(),this.resetState(),this.graphSessionId_$.set(e),this.graphRunId_$.set(t),this.isLive_$.set(n),this.isGraphOpen_$.set(!0),n?this.initLiveGraph():this.loadHistoricalGraph(e,t)}closeGraph(){this.disposeSubscriptions(),this.isGraphOpen_$.set(!1),this.selectedNodeId_$.set("")}selectNode(e){let t=this.selectedNodeId_$();this.selectedNodeId_$.set(t===e?"":e)}clearSelection(){this.selectedNodeId_$.set("")}initLiveGraph(){let e=P.buildSkeletonLayout(),t=this.recalculateEdgePaths(e);this.graphLayout_$.set(t),this.phaseRightColumnLast={"phase-analyze":"llm-analyze","phase-finalization":"llm-finalization"},this.iterationColumnLast={},this.monitoringSubscription=this.session_DS.monitoringEvent_S.subscribe(n=>{n.sessionId===this.graphSessionId_$()&&this.applyMonitoringEvent(n.event)})}applyAgentEvent(e){let t=e.phase;if(typeof t!="string"||t.length===0||t===this.lastAppliedPhase)return;if(this.lastAppliedPhase=t,t===v.agenticLoopIteration){let r=N.extractIterationData(e);r&&this.addIteration(r);return}let n=N.computeStateTransitions(t);n.length!==0&&(this.applyStateTransitions(n),N.isTerminalPhase(t)&&this.markAllIterationNodesCompleted())}addIteration(e){let t=this.graphLayout_$();if(!t)return;this.currentIterationIndex=e.iterationIndex,this.markPreviousIterationCompleted(e.iterationIndex);let n=P.addIterationColumn(t,e.iterationIndex,e.actionType,{tool:e.tool,intent:e.intent}),r=e.actionType==="tool-select"?`iter-${e.iterationIndex}-tool-call`:`iter-${e.iterationIndex}-action`;this.iterationColumnLast[e.iterationIndex]=r;let s=`iter-${e.iterationIndex}-llm-decision`,a=this.setNodeState(n,s,x.active);this.activeNodeId_$.set(s),this.graphLayout_$.set(this.recalculateEdgePaths(a))}markPreviousIterationCompleted(e){if(e<=0)return;let t=this.graphLayout_$();if(!t)return;let n=`iter-${e-1}`,r=t;for(let s of t.nodes)s.id.startsWith(n)&&s.state!==x.error&&(r=this.setNodeState(r,s.id,x.completed));this.graphLayout_$.set(r)}applyMonitoringEvent(e){let t=this.graphLayout_$();if(!t)return;let n=typeof e.eventType=="string"?e.eventType:"",r=typeof e.status=="string"?e.status:"",s=i.toRecord(e.data),a=typeof e.durationMs=="number"?e.durationMs:0,h=typeof e.inputSize=="number"?e.inputSize:0,l=typeof e.outputSize=="number"?e.outputSize:0,c={eventType:n,timestamp:new Date,data:s,durationMs:a,status:r,sessionId:this.graphSessionId_$(),runId:this.graphRunId_$(),inputSize:h,outputSize:l};if(n==="llm-call"){this.handleLlmCallMonitoringEvent(c,t);return}if(this.currentIterationIndex<0)return;let _=N.mapMonitoringEventToIterationNodeId(c,this.currentIterationIndex);if(!_)return;let y=this.enrichNodeWithMonitoringEvent(t,_,c);y&&this.graphLayout_$.set(y)}handleLlmCallMonitoringEvent(e,t){let n=e.data?.callType,r=typeof n=="string"?n:"";if(!r)return;let s=N.getPreCreatedSkeletonNodeId(r);if(s){let h=this.enrichNodeWithMonitoringEvent(t,s,e);h&&this.graphLayout_$.set(h);return}if(N.isIterationLlmCall(r)&&this.currentIterationIndex>=0){let h=N.mapMonitoringEventToIterationNodeId(e,this.currentIterationIndex);if(h){if(t.nodes.findIndex(c=>c.id===h)>=0){let c=this.enrichNodeWithMonitoringEvent(t,h,e);c&&this.graphLayout_$.set(c)}else this.createDynamicIterationLlmNode(t,r,h,e);return}}let a=N.getLlmCallPhaseId(r);a&&this.createDynamicSkeletonLlmNode(t,r,a,e)}enrichNodeWithMonitoringEvent(e,t,n){let r=e.nodes.findIndex(_=>_.id===t);if(r<0)return null;let s=n.data??{},a=n.status==="error",h=n.durationMs??0,l=a?x.error:h>0?x.completed:x.active,c=[...e.nodes];return c[r]=w(I({},c[r]),{state:l,monitoringEvent:n,data:w(I(I({},c[r].data),s),{durationMs:h})}),this.activeNodeId_$.set(l===x.active?t:""),w(I({},e),{nodes:c})}createDynamicSkeletonLlmNode(e,t,n,r){this.dynamicNodeCounter++;let s=`llm-dyn-${this.dynamicNodeCounter}`,a=N.getLlmCallLabel(t),h=this.phaseRightColumnLast[n]??n,l=P.addDynamicLlmNode(e,h,s,a,n,null);this.phaseRightColumnLast[n]=s;let c=this.enrichNodeWithMonitoringEvent(l,s,r);this.graphLayout_$.set(c??l)}createDynamicIterationLlmNode(e,t,n,r){let s=N.getLlmCallLabel(t),a=this.iterationColumnLast[this.currentIterationIndex]??`iter-${this.currentIterationIndex}-action`,h=P.addDynamicLlmNode(e,a,n,s,"phase-execution",this.currentIterationIndex);this.iterationColumnLast[this.currentIterationIndex]=n;let l=this.enrichNodeWithMonitoringEvent(h,n,r);this.graphLayout_$.set(l??h)}loadHistoricalGraph(e,t){return ke(this,null,function*(){this.isLoading_$.set(!0);try{let n=yield this.monitoring_AS.getRunTrace({sessionId:e,runId:t});this.buildHistoricalGraph(n.trace)}catch{let n=P.buildSkeletonLayout();this.graphLayout_$.set(this.recalculateEdgePaths(n))}finally{this.isLoading_$.set(!1)}})}buildHistoricalGraph(e){let t=P.buildSkeletonLayout();t=this.recalculateEdgePaths(t);let n="",r=-1,s={"phase-analyze":"llm-analyze","phase-finalization":"llm-finalization"},a={},h=0;for(let l of e){let c=l.data??{},_=c.step,y=typeof _=="string"?_:"";if(y.length>0&&N.mapPhaseToNodeId(y)&&y!==n){n=y;let M=N.computeStateTransitions(y);for(let O of M)t=this.setNodeState(t,O.nodeId,O.state)}if(y==="agentic-loop-iteration"||y.includes("agentic-loop")){let T=c.action,M=typeof T=="string"?T:"",O=c.tool,E=typeof O=="string"?O:"";if(M.length>0){r++,t=P.addIterationColumn(t,r,M,{tool:E});let j=M==="tool-select"?`iter-${r}-tool-call`:`iter-${r}-action`;a[r]=j}}if(l.eventType==="llm-call"){let T=c.callType,M=typeof T=="string"?T:"";if(M){let O=N.getPreCreatedSkeletonNodeId(M);if(O)t=this.enrichHistoricalNode(t,O,l,c);else if(N.isIterationLlmCall(M)&&r>=0){let E=N.mapMonitoringEventToIterationNodeId(l,r);if(E)if(t.nodes.findIndex(K=>K.id===E)>=0)t=this.enrichHistoricalNode(t,E,l,c);else{let K=N.getLlmCallLabel(M),A=a[r]??`iter-${r}-action`;t=P.addDynamicLlmNode(t,A,E,K,"phase-execution",r),t=this.enrichHistoricalNode(t,E,l,c),a[r]=E}}else{let E=N.getLlmCallPhaseId(M);if(E){h++;let j=`llm-dyn-${h}`,K=N.getLlmCallLabel(M),A=s[E]??E;t=P.addDynamicLlmNode(t,A,j,K,E,null),t=this.enrichHistoricalNode(t,j,l,c),s[E]=j}}}continue}if(r>=0){let T=N.mapMonitoringEventToIterationNodeId(l,r);T&&(t=this.enrichHistoricalNode(t,T,l,c))}}if(n===v.runFlowComplete)for(let l of t.nodes)l.state===x.pending&&(t=this.setNodeState(t,l.id,x.completed));this.graphLayout_$.set(this.recalculateEdgePaths(t))}enrichHistoricalNode(e,t,n,r){let s=e.nodes.findIndex(h=>h.id===t);if(s<0)return e;let a=[...e.nodes];return a[s]=w(I({},a[s]),{state:n.status==="error"?x.error:x.completed,monitoringEvent:n,data:w(I(I({},a[s].data),r),{durationMs:n.durationMs})}),w(I({},e),{nodes:a})}applyStateTransitions(e){let t=this.graphLayout_$();if(!t)return;let n="";for(let r of e)t=this.setNodeState(t,r.nodeId,r.state),r.state===x.active&&(n=r.nodeId);this.activeNodeId_$.set(n),this.graphLayout_$.set(t)}setNodeState(e,t,n){let r=e.nodes.findIndex(a=>a.id===t);if(r<0)return e;let s=[...e.nodes];return s[r]=w(I({},s[r]),{state:n}),w(I({},e),{nodes:s})}markAllIterationNodesCompleted(){let e=this.graphLayout_$();if(!e)return;let t=e;for(let n of e.nodes)n.iterationIndex!=null&&n.state!==x.error&&(t=this.setNodeState(t,n.id,x.completed));this.graphLayout_$.set(t)}recalculateEdgePaths(e){let t=e.edges.map(n=>{let r=e.nodes.find(a=>a.id===n.sourceNodeId),s=e.nodes.find(a=>a.id===n.targetNodeId);return!r||!s?n:w(I({},n),{pathD:P.computeEdgePath(r,s,n.category)})});return w(I({},e),{edges:t})}resetState(){this.graphLayout_$.set(null),this.activeNodeId_$.set(""),this.selectedNodeId_$.set(""),this.currentIterationIndex=-1,this.lastAppliedPhase="",this.isLoading_$.set(!1),this.dynamicNodeCounter=0,this.phaseRightColumnLast={},this.iterationColumnLast={}}disposeSubscriptions(){this.monitoringSubscription&&(this.monitoringSubscription.unsubscribe(),this.monitoringSubscription=null)}static toRecord(e){return typeof e!="object"||e==null?{}:JSON.parse(JSON.stringify(e))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=xe({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var ot=["appSesGraphNodeSvg",""];function rt(i,o){if(i&1&&(H(),p(0,"text",1),m(1),d()),i&2){let e=C();Y("x",10)("y",e.node().height/2+1),u(),L(e.icon_$())}}function at(i,o){if(i&1&&(H(),p(0,"text",3),m(1),d()),i&2){let e=C();Y("x",e.node().width-10)("y",12)("fill",e.node().state==="error"?"#ef4444":"#22c55e"),u(),L(e.stateIcon_$())}}function st(i,o){if(i&1&&(H(),p(0,"text",4),m(1),d()),i&2){let e=C();Y("x",e.node().width-8)("y",e.node().height-8),u(),_e("",e.durationMs_$(),"ms")}}var $e=class i{node=F.required();isHighlighted=F(!1);isSelected=F(!1);nodeClicked=ne();fillColor_$=g(()=>{let o=this.node();return o.state===x.pending?"#262626":i.CATEGORY_FILL_MAP[o.category]??"#262626"});strokeColor_$=g(()=>{let o=this.node();return o.state===x.error?"#ef4444":o.state===x.pending?"#525252":i.CATEGORY_STROKE_MAP[o.category]??"#737373"});strokeDashArray_$=g(()=>this.node().state===x.pending?"6 3":"none");textColor_$=g(()=>this.node().state===x.pending?"#737373":"#e5e5e5");opacity_$=g(()=>this.node().state===x.pending?.5:1);borderRadius_$=g(()=>this.node().category===f.action?16:8);icon_$=g(()=>{let o=this.node().category;return i.CATEGORY_ICON_MAP[o]??""});stateIcon_$=g(()=>{let o=this.node().state;return o===x.completed?"\u2713":o===x.error?"\u2715":""});animationClass_$=g(()=>this.node().state===x.active||this.isHighlighted()?"ses-graph-node--active":this.isSelected()?"ses-graph-node--selected":"");durationMs_$=g(()=>this.node().data.durationMs??0);handleClick(){this.nodeClicked.emit(this.node().id)}static CATEGORY_FILL_MAP={[f.phase]:"#1a1a2e",[f.milestone]:"#052e16",[f.llmCall]:"#1e1033",[f.toolCall]:"#2e2a05",[f.toolError]:"#2e1505",[f.loopIteration]:"#0a1628",[f.action]:"#1a1a2e",[f.error]:"#2e0505"};static CATEGORY_STROKE_MAP={[f.phase]:"#525252",[f.milestone]:"#22c55e",[f.llmCall]:"#a855f7",[f.toolCall]:"#eab308",[f.toolError]:"#f97316",[f.loopIteration]:"#3b82f6",[f.action]:"#3b82f6",[f.error]:"#ef4444"};static CATEGORY_ICON_MAP={[f.milestone]:"\u26A1",[f.llmCall]:"\u{1F9E0}",[f.toolCall]:"\u{1F527}",[f.toolError]:"\u26A0\uFE0F",[f.error]:"\u274C"};static \u0275fac=function(e){return new(e||i)};static \u0275cmp=ae({type:i,selectors:[["","appSesGraphNodeSvg",""]],inputs:{node:[1,"node"],isHighlighted:[1,"isHighlighted"],isSelected:[1,"isSelected"]},outputs:{nodeClicked:"nodeClicked"},standalone:!0,features:[le],attrs:ot,decls:7,vars:21,consts:[[2,"cursor","pointer",3,"click"],["dominant-baseline","central","text-anchor","start","font-size","14"],["dominant-baseline","central"],["text-anchor","end","dominant-baseline","central","font-size","11","font-weight","700"],["text-anchor","end","dominant-baseline","auto","fill","#737373","font-size","9"]],template:function(e,t){e&1&&(H(),p(0,"g",0),B("click",function(){return t.handleClick()}),W(1,"rect"),D(2,rt,2,3,":svg:text",1),p(3,"text",2),m(4),d(),D(5,at,2,4,":svg:text",3)(6,st,2,3,":svg:text",4),d()),e&2&&(se(t.animationClass_$()),Y("transform","translate("+t.node().x+","+t.node().y+")")("opacity",t.opacity_$()),u(),Y("width",t.node().width)("height",t.node().height)("rx",t.borderRadius_$())("fill",t.fillColor_$())("stroke",t.strokeColor_$())("stroke-width",t.isSelected()?2.5:1.5)("stroke-dasharray",t.strokeDashArray_$()),u(),S(t.icon_$()?2:-1),u(),Y("x",t.icon_$()?30:t.node().width/2)("y",t.node().height/2+1)("text-anchor",t.icon_$()?"start":"middle")("fill",t.textColor_$())("font-size",t.node().category==="phase"||t.node().category==="milestone"?14:12)("font-weight",t.node().category==="phase"||t.node().category==="milestone"?600:400),u(),L(t.node().label),u(),S(t.stateIcon_$()?5:-1),u(),S(t.durationMs_$()?6:-1))},dependencies:[de],encapsulation:2})};function lt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Phase"),d(),p(3,"span",9),m(4),d()()),i&2){let e=C();u(4),L(e.node().phase)}}function dt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Step"),d(),p(3,"span",9),m(4),d()()),i&2){let e=C();u(4),L(e.stepLabel_$())}}function ct(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Duration"),d(),p(3,"span",9),m(4),d()()),i&2){let e=C();u(4),L(e.durationLabel_$())}}function pt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Tool"),d(),p(3,"span",12),m(4),d()()),i&2){let e=C();u(4),L(e.toolId_$())}}function ht(i,o){if(i&1&&(p(0,"div",10)(1,"span",13),m(2,"Intent"),d(),p(3,"span",14),m(4),d()()),i&2){let e=C();u(4),L(e.intent_$())}}function ut(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Iteration"),d(),p(3,"span",15),m(4),d()()),i&2){let e=C();u(4),_e("#",e.node().iterationIndex,"")}}function mt(i,o){if(i&1&&(p(0,"span",13),m(1," In: "),p(2,"span",9),m(3),d()()),i&2){let e=C(2);u(3),L(e.inputSize_$())}}function _t(i,o){if(i&1&&(p(0,"span",13),m(1," Out: "),p(2,"span",9),m(3),d()()),i&2){let e=C(2);u(3),L(e.outputSize_$())}}function ft(i,o){if(i&1&&(p(0,"div",11),D(1,mt,4,1,"span",13)(2,_t,4,1,"span",13),d()),i&2){let e=C();u(),S(e.inputSize_$()>0?1:-1),u(),S(e.outputSize_$()>0?2:-1)}}function gt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Provider"),d(),p(3,"span",26),m(4),d()()),i&2){let e=C(3);u(4),L(e.usedProvider_$())}}function xt(i,o){if(i&1&&(p(0,"div",7)(1,"span",8),m(2,"Model"),d(),p(3,"span",26),m(4),d()()),i&2){let e=C(3);u(4),L(e.usedModel_$())}}function yt(i,o){if(i&1&&(p(0,"span",13),m(1," Cost: "),p(2,"span",27),m(3),d()()),i&2){let e=C(4);u(3),L(e.costUsd_$())}}function St(i,o){if(i&1&&(p(0,"div",25)(1,"span",13),m(2," Tokens: "),p(3,"span",9),m(4),d()(),D(5,yt,4,1,"span",13),d()),i&2){let e=C(3);u(4),L(e.tokenInfo_$().total),u(),S(e.costUsd_$()?5:-1)}}function Ct(i,o){if(i&1&&(p(0,"div",16)(1,"div",23),m(2,"Used"),d(),p(3,"div",24),D(4,gt,5,1,"div",7)(5,xt,5,1,"div",7)(6,St,6,2,"div",25),d()()),i&2){let e=C(2);u(4),S(e.usedProvider_$()?4:-1),u(),S(e.usedModel_$()?5:-1),u(),S(e.tokenInfo_$()?6:-1)}}function vt(i,o){if(i&1){let e=ie();p(0,"button",28),B("click",function(){R(e);let n=C(2);return z(n.handleClearOverride())}),m(1," Clear "),d()}}function It(i,o){i&1&&(p(0,"div",21),m(1," Session override active "),d())}function Et(i,o){if(i&1&&(p(0,"div",22)(1,"div",29),m(2,"Global default"),d(),p(3,"div",30),m(4),d()()),i&2){let e=C(2);u(4),ze(" ",e.globalDefault_$().provider," / ",e.globalDefault_$().model," ")}}function Nt(i,o){if(i&1){let e=ie();D(0,Ct,7,3,"div",16),p(1,"div",16)(2,"div",17)(3,"div",18),m(4),d(),D(5,vt,2,0,"button",19),d(),p(6,"app-s-registry-provider-model-select",20),B("modelChange",function(n){R(e);let r=C();return z(r.handleModelChange(n))}),d(),D(7,It,2,0,"div",21),d(),D(8,Et,5,2,"div",22)}if(i&2){let e=C();S(e.usedProvider_$()||e.usedModel_$()?0:-1),u(4),_e(" Override: ",e.callTypeLabel_$()," "),u(),S(e.hasSessionOverride_$()?5:-1),u(),me("selectedProvider",e.selectedProvider_$())("selectedModel",e.selectedModel_$()),u(),S(e.hasSessionOverride_$()?7:-1),u(),S(e.globalDefault_$()?8:-1)}}var Ke=(()=>{class i{graph_DS=Z(Ze);session_DS=Z(Ce);registrySsot_CS=Z(Be);node=F.required();closed=ne();stateLabel_$=g(()=>({pending:"Pending",active:"Active",completed:"Completed",error:"Error"})[this.node().state]??this.node().state);durationLabel_$=g(()=>{let e=this.node().data.durationMs;return!e||e<=0?"":e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`});toolId_$=g(()=>{let e=this.node().data,t=e.toolId??e.tool;return typeof t=="string"?t:""});intent_$=g(()=>{let e=this.node().data.intent;return typeof e=="string"?e:""});stepLabel_$=g(()=>{let e=this.node().data.step;return typeof e!="string"||e.length===0?"":ve.formatStepId(e)});inputSize_$=g(()=>{let e=this.node().monitoringEvent;return e?e.inputSize??0:0});outputSize_$=g(()=>{let e=this.node().monitoringEvent;return e?e.outputSize??0:0});stateColorClass_$=g(()=>({pending:"text-neutral-500",active:"text-cyan-400",completed:"text-green-400",error:"text-red-400"})[this.node().state]??"text-neutral-400");isLlmCall_$=g(()=>this.node().category===f.llmCall);callType_$=g(()=>{let e=this.node().data?.callType;return typeof e=="string"?e:""});callTypeLabel_$=g(()=>{let e=this.callType_$();return Ye[e]??e});usedProvider_$=g(()=>{let e=this.node().data?.provider;return typeof e=="string"?e:""});usedModel_$=g(()=>{let e=this.node().data?.model;return typeof e=="string"?e:""});sessionOverride_$=g(()=>{let e=this.callType_$();if(!e)return null;let t=this.graph_DS.graphSessionId_$();if(!t)return null;let r=this.session_DS.sessionInfoMap_$().get(t);if(!r)return null;let s=r.llmCallTypeOverrides;if(!s)return null;let a=s[e];if(typeof a!="object"||!a)return null;let h=a,l=h.provider,c=h.model;return typeof l=="string"&&typeof c=="string"?{provider:l,model:c}:null});globalDefault_$=g(()=>{let e=this.callType_$();if(!e)return null;let t=this.graph_DS.graphSessionId_$(),r=this.session_DS.sessionInfoMap_$().get(t);if(!r)return null;let s=r.globalCallTypeDefaults;if(!s)return null;let a=s[e];if(typeof a!="object"||!a)return null;let h=a,l=h.provider,c=h.model;return typeof l=="string"&&typeof c=="string"?{provider:l,model:c}:null});selectedProvider_$=g(()=>this.sessionOverride_$()?.provider??"");selectedModel_$=g(()=>this.sessionOverride_$()?.model??"");hasSessionOverride_$=g(()=>this.sessionOverride_$()!==null);tokenInfo_$=g(()=>{let e=this.node().data,t=e.promptTokens,n=e.completionTokens,r=e.totalTokens;return typeof r!="number"||r<=0?null:{prompt:typeof t=="number"?t:0,completion:typeof n=="number"?n:0,total:r}});costUsd_$=g(()=>{let e=this.node().data?.costUsd;return typeof e!="number"||e<=0?"":`$${e.toFixed(4)}`});handleClose(){this.closed.emit()}handleProviderChange(e){}handleModelChange(e){let t=this.callType_$(),n=this.graph_DS.graphSessionId_$();if(!t||!n||!e)return;let s=this.registrySsot_CS.enabledLlmModels_$().find(a=>a.modelName===e);s&&this.applySessionOverride(n,t,s.provider,s.modelName)}handleClearOverride(){let e=this.callType_$(),t=this.graph_DS.graphSessionId_$();!e||!t||this.clearSessionOverride(t,e)}applySessionOverride(e,t,n,r){let h=this.session_DS.sessionInfoMap_$().get(e)?.llmCallTypeOverrides??{},l=w(I({},h),{[t]:{provider:n,model:r}});this.session_DS.updateSession({sessionId:e,updates:{llmCallTypeOverrides:l}}).then(()=>{this.session_DS.loadSessionInfo(e)})}clearSessionOverride(e,t){let s=this.session_DS.sessionInfoMap_$().get(e)?.llmCallTypeOverrides??{},a=I({},s);Reflect.deleteProperty(a,t);let h=Object.keys(a).length>0;this.session_DS.updateSession({sessionId:e,updates:{llmCallTypeOverrides:h?a:null}}).then(()=>{this.session_DS.loadSessionInfo(e)})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ae({type:i,selectors:[["app-ses-graph-node-detail"]],inputs:{node:[1,"node"]},outputs:{closed:"closed"},standalone:!0,features:[le],decls:26,vars:13,consts:[[1,"w-80","max-h-[28rem]","overflow-y-auto","rounded-lg","border","border-neonCyan/30","bg-neutral-900/95","shadow-lg","backdrop-blur-sm","p-3"],[1,"flex","items-start","justify-between","gap-2","mb-2"],[1,"text-sm","font-semibold","text-neutral-200","leading-tight"],["title","Bez\xE1r\xE1s","aria-label","Bez\xE1r\xE1s",1,"p-1","min-h-[28px]","min-w-[28px]","flex","items-center","justify-center","rounded","text-neutral-400","hover:text-neutral-200","hover:bg-neutral-700","transition-colors","shrink-0",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5"],["d","M18 6L6 18M6 6l12 12"],[1,"space-y-1.5","text-xs"],[1,"flex","items-center","gap-2"],[1,"text-neutral-500","w-16","shrink-0"],[1,"text-neutral-300"],[1,"flex","flex-col","gap-0.5"],[1,"flex","items-center","gap-3","pt-1","border-t","border-neutral-800"],[1,"text-yellow-300","font-mono","text-[11px]"],[1,"text-neutral-500"],[1,"text-neutral-300","text-[11px]","leading-tight","break-words"],[1,"text-blue-400"],[1,"mt-3","pt-2","border-t","border-neutral-700"],[1,"flex","items-center","justify-between","mb-1.5"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider"],[1,"text-[10px]","text-red-400","hover:text-red-300","transition-colors"],["registryKind","llm","providerLabel","Provider","modelLabel","Model",3,"modelChange","selectedProvider","selectedModel"],[1,"mt-1.5","text-[10px]","text-purple-400"],[1,"mt-2","pt-1.5","border-t","border-neutral-800"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","mb-1.5"],[1,"space-y-1","text-xs"],[1,"flex","items-center","gap-3"],[1,"text-purple-300","font-mono","text-[11px]"],[1,"text-green-400"],[1,"text-[10px]","text-red-400","hover:text-red-300","transition-colors",3,"click"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","mb-1"],[1,"text-[11px]","text-neutral-400","font-mono"]],template:function(t,n){t&1&&(p(0,"div",0)(1,"div",1)(2,"h3",2),m(3),d(),p(4,"button",3),B("click",function(){return n.handleClose()}),H(),p(5,"svg",4),W(6,"path",5),d()()(),ye(),p(7,"div",6)(8,"div",7)(9,"span",8),m(10,"State"),d(),p(11,"span"),m(12),d()(),p(13,"div",7)(14,"span",8),m(15,"Type"),d(),p(16,"span",9),m(17),d()(),D(18,lt,5,1,"div",7)(19,dt,5,1,"div",7)(20,ct,5,1,"div",7)(21,pt,5,1,"div",7)(22,ht,5,1,"div",10)(23,ut,5,1,"div",7)(24,ft,3,2,"div",11),d(),D(25,Nt,9,7),d()),t&2&&(u(3),L(n.node().label),u(8),se(n.stateColorClass_$()+" font-medium"),u(),L(n.stateLabel_$()),u(5),L(n.node().category),u(),S(n.node().phase?18:-1),u(),S(n.stepLabel_$()?19:-1),u(),S(n.durationLabel_$()?20:-1),u(),S(n.toolId_$()?21:-1),u(),S(n.intent_$()?22:-1),u(),S(n.node().iterationIndex!==null?23:-1),u(),S(n.inputSize_$()>0||n.outputSize_$()>0?24:-1),u(),S(n.isLlmCall_$()&&n.callType_$()?25:-1))},dependencies:[de,Fe],encapsulation:2})}return i})();var $t=["graphSvg"],Qe=(i,o)=>o.id;function bt(i,o){i&1&&(p(0,"span",7),m(1,"Loading trace..."),d())}function Lt(i,o){if(i&1&&(H(),W(0,"rect",16)),i&2){let e=o;Y("x",e.x)("y",e.y)("width",e.width)("height",e.height)}}function wt(i,o){if(i&1&&(H(),W(0,"path",17)),i&2){let e=o.$implicit;Y("d",e.pathD)("stroke",e.strokeColor)("stroke-dasharray",e.strokeDashArray)("marker-end",e.markerEnd)}}function Tt(i,o){if(i&1){let e=ie();H(),p(0,"g",20),B("nodeClicked",function(n){R(e);let r=C();return z(r.handleNodeClick(n))}),d()}if(i&2){let e=o.$implicit,t=C();me("node",e)("isHighlighted",t.activeNodeId()===e.id)("isSelected",t.selectedNodeId()===e.id)}}function Mt(i,o){if(i&1){let e=ie();p(0,"app-ses-graph-node-detail",21),B("closed",function(){R(e);let n=C();return z(n.handleDetailClose())}),d()}i&2&&me("node",o)}var Gn=(()=>{class i{svgRef;layout=F(null);activeNodeId=F("");selectedNodeId=F("");isLoading=F(!1);nodeClicked=ne();detailClosed=ne();viewBox_$=V({x:0,y:0,width:800,height:600});viewBoxStr_$=g(()=>{let e=this.viewBox_$();return`${e.x} ${e.y} ${e.width} ${e.height}`});isFollowActive_$=V(!0);isPanning=!1;panStartX=0;panStartY=0;panStartViewBoxX=0;panStartViewBoxY=0;nodes_$=g(()=>this.layout()?.nodes??[]);edges_$=g(()=>this.layout()?.edges??[]);loopBounds_$=g(()=>this.layout()?.loopContainerBounds??null);selectedNode_$=g(()=>{let e=this.selectedNodeId();return e?this.nodes_$().find(t=>t.id===e)??null:null});constructor(){Se(()=>{let e=this.layout();e&&this.viewBox_$.set(I({},e.viewBox))},{allowSignalWrites:!0})}handleNodeClick(e){this.nodeClicked.emit(e)}handleDetailClose(){this.detailClosed.emit()}handlePointerDown(e){if(e.button!==0)return;this.isPanning=!0,this.panStartX=e.clientX,this.panStartY=e.clientY;let t=this.viewBox_$();this.panStartViewBoxX=t.x,this.panStartViewBoxY=t.y,this.svgRef&&this.svgRef.nativeElement.setPointerCapture(e.pointerId)}handlePointerMove(e){if(!this.isPanning||!this.svgRef)return;let t=this.svgRef.nativeElement,n=this.viewBox_$(),r=n.width/t.clientWidth,s=n.height/t.clientHeight,a=(e.clientX-this.panStartX)*r,h=(e.clientY-this.panStartY)*s;this.viewBox_$.set(w(I({},n),{x:this.panStartViewBoxX-a,y:this.panStartViewBoxY-h}))}handlePointerUp(){this.isPanning=!1}handleWheel(e){if(e.preventDefault(),!this.svgRef)return;let t=this.svgRef.nativeElement,n=this.viewBox_$(),r=e.deltaY>0?1.1:.9,s=t.getBoundingClientRect(),a=(e.clientX-s.left)/s.width,h=(e.clientY-s.top)/s.height,l=n.width*r,c=n.height*r;if(l<200||l>5e3)return;let _=n.x+(n.width-l)*a,y=n.y+(n.height-c)*h;this.viewBox_$.set({x:_,y,width:l,height:c})}handleFitToView(){let e=this.nodes_$();if(e.length===0)return;let t=P.recalculateViewBox(e,48);this.viewBox_$.set(t)}handleToggleFollowActive(){this.isFollowActive_$.update(e=>!e)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=ae({type:i,selectors:[["app-ses-graph-view"]],viewQuery:function(t,n){if(t&1&&Ge($t,5),t&2){let r;Oe(r=Re())&&(n.svgRef=r.first)}},inputs:{layout:[1,"layout"],activeNodeId:[1,"activeNodeId"],selectedNodeId:[1,"selectedNodeId"],isLoading:[1,"isLoading"]},outputs:{nodeClicked:"nodeClicked",detailClosed:"detailClosed"},standalone:!0,features:[le],decls:25,vars:6,consts:[["graphSvg",""],[1,"flex","flex-col","h-full","w-full","overflow-hidden"],[1,"flex","items-center","gap-2","px-3","py-2","border-b","border-neutral-800","shrink-0","bg-neutral-900/80"],["title","Fit to view",1,"px-2","py-1","text-xs","border","rounded","transition-colors","border-neutral-700","text-neutral-400","hover:text-neutral-200","hover:border-neutral-500",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","inline-block","mr-1"],["d","M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"],["title","Follow active node",1,"px-2","py-1","text-xs","border","rounded","transition-colors",3,"click"],[1,"text-xs","text-neutral-500","ml-auto"],[1,"flex-1","min-h-0","relative"],["preserveAspectRatio","xMidYMid meet",1,"ses-graph-svg",3,"pointerdown","pointermove","pointerup","pointerleave","wheel"],["id","ses-arrow-seq","markerWidth","8","markerHeight","6","refX","8","refY","3","orient","auto","markerUnits","strokeWidth"],["d","M 0 0 L 8 3 L 0 6 Z","fill","#525252"],["id","ses-arrow-loop","markerWidth","8","markerHeight","6","refX","8","refY","3","orient","auto","markerUnits","strokeWidth"],["d","M 0 0 L 8 3 L 0 6 Z","fill","#3b82f6"],["id","ses-arrow-error","markerWidth","8","markerHeight","6","refX","8","refY","3","orient","auto","markerUnits","strokeWidth"],["d","M 0 0 L 8 3 L 0 6 Z","fill","#f97316"],["rx","6","fill","#0f172a","stroke","#1e3a5f","stroke-width","1","stroke-dasharray","4 2","opacity","0.5"],["stroke-width","1.5","fill","none"],["appSesGraphNodeSvg","",3,"node","isHighlighted","isSelected"],[1,"absolute","top-2","right-2","z-10",3,"node"],["appSesGraphNodeSvg","",3,"nodeClicked","node","isHighlighted","isSelected"],[1,"absolute","top-2","right-2","z-10",3,"closed","node"]],template:function(t,n){if(t&1){let r=ie();p(0,"div",1)(1,"div",2)(2,"button",3),B("click",function(){return R(r),z(n.handleFitToView())}),H(),p(3,"svg",4),W(4,"path",5),d(),m(5," Fit "),d(),ye(),p(6,"button",6),B("click",function(){return R(r),z(n.handleToggleFollowActive())}),m(7," Follow "),d(),D(8,bt,2,0,"span",7),d(),p(9,"div",8),H(),p(10,"svg",9,0),B("pointerdown",function(a){return R(r),z(n.handlePointerDown(a))})("pointermove",function(a){return R(r),z(n.handlePointerMove(a))})("pointerup",function(){return R(r),z(n.handlePointerUp())})("pointerleave",function(){return R(r),z(n.handlePointerUp())})("wheel",function(a){return R(r),z(n.handleWheel(a))}),p(12,"defs")(13,"marker",10),W(14,"path",11),d(),p(15,"marker",12),W(16,"path",13),d(),p(17,"marker",14),W(18,"path",15),d()(),D(19,Lt,1,4,":svg:rect",16),Le(20,wt,1,4,":svg:path",17,Qe),Le(22,Tt,1,3,":svg:g",18,Qe),d(),D(24,Mt,1,1,"app-ses-graph-node-detail",19),d()()}if(t&2){let r,s;u(6),se(n.isFollowActive_$()?"border-neonCyan/50 text-neonCyan bg-neonCyan/10":"border-neutral-700 text-neutral-400 hover:text-neutral-200 hover:border-neutral-500"),u(2),S(n.isLoading()?8:-1),u(2),Y("viewBox",n.viewBoxStr_$()),u(9),S((r=n.loopBounds_$())?19:-1,r),u(),we(n.edges_$()),u(2),we(n.nodes_$()),u(2),S((s=n.selectedNode_$())?24:-1,s)}},dependencies:[de,$e,Ke],styles:[`@charset "UTF-8";@keyframes _ngcontent-%COMP%_ses-graph-node-pulse{0%,to{filter:drop-shadow(0 0 4px var(--ses-graph-pulse-color, #22d3ee))}50%{filter:drop-shadow(0 0 12px var(--ses-graph-pulse-color, #22d3ee))}}[_nghost-%COMP%]{display:block;width:100%;height:100%;position:relative}.ses-graph-svg[_ngcontent-%COMP%]{width:100%;height:100%;background:#0a0a0a;-webkit-user-select:none;user-select:none} .ses-graph-node--active{animation:_ngcontent-%COMP%_ses-graph-node-pulse 1.5s ease-in-out infinite} .ses-graph-node--active rect{stroke-width:2.5} .ses-graph-node--selected{filter:drop-shadow(0 0 6px rgba(34,211,238,.4))}
2
2
  /*# sourceMappingURL=ses-graph-view.component-5NATWVIS.css.map */`]})}return i})();export{qe as a,ve as b,x as c,k as d,f as e,P as f,Ze as g,Gn as h};
3
- //# sourceMappingURL=chunk-FF6BH35R.js.map
3
+ //# sourceMappingURL=chunk-LZ2PMXWH.js.map
@@ -1,3 +1,3 @@
1
- import{a as R,b as O}from"./chunk-BW5WKQNI.js";import{a as q}from"./chunk-PWPSHQ6T.js";import{a as g}from"./chunk-UFBTR2BG.js";import{a as U}from"./chunk-IQB44YSD.js";import{e as P}from"./chunk-QTBI3NZR.js";import{h as y,j as L}from"./chunk-MICI24HP.js";import{p as D}from"./chunk-M2MQ43YC.js";import{C as v,R as T,a as h,aa as p,b as f,h as E,k as d,y as A}from"./chunk-TBMJSIBB.js";var S=E(D());var _=class u{static compareAsc(C,e){let s=(C.sequence??0)-(e.sequence??0);if(s!==0)return s;let n=typeof C.timestamp=="string"?C.timestamp:"",t=typeof e.timestamp=="string"?e.timestamp:"",o=n.localeCompare(t);if(o!==0)return o;let i=typeof C.messageKey=="string"?C.messageKey:"",r=typeof e.messageKey=="string"?e.messageKey:"";return i.localeCompare(r)}static sortAsc(C){return[...C].sort(u.compareAsc)}};var M=E(D());var x=(()=>{class u{parent;agentToolUseIds=new Set;activeSubAgentId="";toolUseIdToName=new Map;init(e){this.parent=e}resetTrackingState(){this.toolUseIdToName.clear(),this.agentToolUseIds.clear(),this.activeSubAgentId=""}handleSocketEvent(e,s){let n=e.event,t=e.payload;try{let o=typeof t.ccapId=="string"?t.ccapId:"";if(n!=="cc:rate-limit-update"&&n!=="ext-session-msg:message"&&n!=="ext-session-msg:update"&&o&&s.selectedCcapId&&o!==s.selectedCcapId){M.DyFM_Log.info(`CCAP_CcSession_DS | socket event dropped by instance filter | event: ${n} | eventCcapId: ${o} | selectedCcapId: ${s.selectedCcapId}`);return}switch(n){case"cc-session:status":this.handleStatusUpdate(t);break;case"cc-session:output":this.handleOutputChunk(t);break;case"cc-session:event":this.handleSessionEvent(t);break;case"cc-session:list-update":this.handleListUpdate(t);break;case"cc-session:session-update":this.handleSessionItemUpdate(t);break;case"agent-events":this.handleAgentEvent(t);break;case"ext-session-msg:message":this.handleAssembledMessage(t);break;case"ext-session-msg:update":this.handleAssembledMessageUpdate(t);break;case"cc:rate-limit-update":this.handleRateLimitBroadcast(t);break}}catch(o){let i=o instanceof Error?o.message:String(o);M.DyFM_Log.error(`CCAP_CcSession_DS | socket event error | event: ${n}`,o),s.globalErrorShowError(o instanceof Error?o:new Error(`CC Session socket event processing failed: ${n} \u2014 ${i}`),"cc-session-socket-event")}}pushConsoleMessageFromEvent(e,s,n){let t=e.data;switch(e.eventType){case"response-chunk":{this.pushResponseChunkBlocks(t);break}case"tool-call-start":{let o=t.name??t.tool_name??"unknown",i=typeof t.id=="string"?t.id:"";i&&this.toolUseIdToName.set(i,o),o==="Agent"&&i&&this.agentToolUseIds.add(i);let r=t.input,a=r?u.summarizeToolInput(r):"",l=a?`${o}: ${a}`:o,c=o==="Edit"?u.buildEditExpandableContent(r):void 0,m=o==="Agent"?"":this.activeSubAgentId;this.parent.pushConsoleMessage({type:"tool",text:l,expandableContent:c,rawData:t,parentAgentId:m||void 0});break}case"tool-call-end":{let o=t.content??t.output,i=typeof o=="string"?o:"",r=i.length>200?i.substring(0,200)+"\u2026":i;if(r){let a=i.length>200?i:void 0;this.parent.pushConsoleMessage({type:"tool-result",text:r,expandableContent:a,rawData:t,parentAgentId:this.activeSubAgentId||void 0})}break}case"response-complete":{this.activeSubAgentId="";let o=t.cost_usd,i=typeof o=="number"?` ($${o.toFixed(4)})`:"",r=typeof t.model=="string"?` \xB7 ${t.model}`:"";this.parent.pushConsoleMessage({type:"result",text:`Response complete${r}${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)}),this.accumulateUsage(t);break}case"prompt-sent":{let o=typeof t.content=="string"?t.content:"";o&&(this.parent.consoleMessages_$().some(a=>a.type==="prompt"&&a.text===o.trim())||this.parent.pushConsoleMessage({type:"prompt",text:o,rawData:t,expandableContent:JSON.stringify(t,null,2)}));break}case"status-change":{let o=typeof t.from=="string"?t.from:"",i=typeof t.to=="string"?t.to:"";if(i){let r=typeof t.statusMessage=="string"?t.statusMessage:void 0,a=o?`${o} \u2192 ${i}`:i,l=r?`${a} \u2014 ${r}`:a;this.parent.pushConsoleMessage({type:"status",text:l,isStatus:!0,rawData:t,expandableContent:JSON.stringify(t,null,2)})}break}case"config-change":{let o=t.update,i=o&&typeof o=="object"?Object.keys(o).join(", "):"unknown";this.parent.pushConsoleMessage({type:"info",text:`Config updated: ${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"error":{let o=typeof t.message=="string"?t.message:"Unknown error";this.parent.pushConsoleMessage({type:"error",text:o,rawData:t,expandableContent:JSON.stringify(t,null,2)}),s&&n(new Error(`CC Session error: ${o}`),"cc-session-event");break}case"usage-update":{this.accumulateUsage(t);break}case"cli-chunk":{this.handleCliChunkEvent(t);break}case"runner-overflow":{let i=`Runner buffer overflow: ${typeof t.droppedCount=="number"?t.droppedCount:0} output items lost during server disconnect`;this.parent.pushConsoleMessage({type:"error",text:i,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"interrupted-prompt":{let o=typeof t.reason=="string"?t.reason:"",i=typeof t.lastPrompt=="string"?t.lastPrompt:"",r=i.length>80?i.substring(0,80)+"\u2026":i,a=r?`Prompt interrupted (${o}): "${r}"`:`Prompt interrupted${o?" ("+o+")":""}`;this.parent.pushConsoleMessage({type:"status",text:a,isStatus:!0,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"session-init":{let o=typeof t.model=="string"?t.model:"",i=typeof t.claudeCodeVersion=="string"?t.claudeCodeVersion:"",r=typeof t.permissionMode=="string"?t.permissionMode:"",a=[];o&&a.push(o),r&&a.push(r),i&&a.push(`v${i}`);let l=a.length>0?`CLI init: ${a.join(" \xB7 ")}`:"CLI initialized",c=JSON.stringify(t,null,2);this.parent.pushConsoleMessage({type:"info",text:l,rawData:t,expandableContent:c});break}case"config-mismatch":{let o=t.mismatches,i=Array.isArray(o)?o.map(r=>`${r.field}: requested "${r.requested}" \u2192 actual "${r.actual}"`).join(", "):"unknown mismatch";this.parent.pushConsoleMessage({type:"error",text:`Config mismatch: ${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"cli-args-record":{let o=typeof t.model=="string"?t.model:"default",i=typeof t.reasoningEffort=="string"?t.reasoningEffort:"default",r=typeof t.mode=="string"?t.mode:"normal",a=typeof t.permissionPolicy=="string"?t.permissionPolicy:"default",l=`CLI spawn: model=${o} \xB7 effort=${i} \xB7 mode=${r} \xB7 permission=${a}`;this.parent.pushConsoleMessage({type:"info",text:l,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"stdout-line":case"stderr-line":break;default:{let o=e.eventType;this.parent.pushConsoleMessage({type:"raw",text:o,rawData:t});break}}}handleStatusUpdate(e){let s=e.sessionId??"",n=e.status??"",t=e.statusMessage;this.parent.lastStatusUpdate_$.set({sessionId:s,status:n,statusMessage:t});let i=this.parent.sessions_$().map(a=>a.sessionId===s?f(h({},a),{status:n,statusMessage:t}):a);this.parent.sessions_$.set(i);let r=this.parent.selectedSession_$();if(r?.session.sessionId===s){let a=u.isLiveCcSessionStatus(n);this.parent.selectedSession_$.set(f(h({},r),{session:f(h({},r.session),{status:n,statusMessage:t}),runtime:f(h({},r.runtime),{isLive:a,runtimeStatus:n})}))}if(n==="errored"){let a=(t??"").trim();if(a.startsWith("Auto-recovery: terminal runner dropped silently")||a.startsWith("Exit code:"))M.DyFM_Log.warn(`CCAP_CcSession | user-task-fail diagnostic (NOT recorded to /errors) | sessionId: ${s} | statusMessage: ${a}`);else{let c=t?`CC Session error (${s}): ${t}`:`CC Session error (${s}): session entered errored state`;this.parent.showGlobalError(new Error(c),"cc-session-status")}}this.parent.evaluateSessionEventsPolling()}handleOutputChunk(e){let s=e.sessionId??"";if(s&&s!==this.parent.activeSessionId_$())return;let n=e.content??"",t=e.type??"stdout",o=this.parent.liveOutput_$(),i=n.split(`
1
+ import{a as R,b as O}from"./chunk-WKAKYIU5.js";import{a as q}from"./chunk-VOITLR7O.js";import{a as g}from"./chunk-UFBTR2BG.js";import{a as U}from"./chunk-ZO5UJXHI.js";import{e as P}from"./chunk-AAFXSEZA.js";import{h as y,j as L}from"./chunk-XYNIZC5J.js";import{p as D}from"./chunk-RXRE3G4K.js";import{C as v,R as T,a as h,aa as p,b as f,h as E,k as d,y as A}from"./chunk-TBMJSIBB.js";var S=E(D());var _=class u{static compareAsc(C,e){let s=(C.sequence??0)-(e.sequence??0);if(s!==0)return s;let n=typeof C.timestamp=="string"?C.timestamp:"",t=typeof e.timestamp=="string"?e.timestamp:"",o=n.localeCompare(t);if(o!==0)return o;let i=typeof C.messageKey=="string"?C.messageKey:"",r=typeof e.messageKey=="string"?e.messageKey:"";return i.localeCompare(r)}static sortAsc(C){return[...C].sort(u.compareAsc)}};var M=E(D());var x=(()=>{class u{parent;agentToolUseIds=new Set;activeSubAgentId="";toolUseIdToName=new Map;init(e){this.parent=e}resetTrackingState(){this.toolUseIdToName.clear(),this.agentToolUseIds.clear(),this.activeSubAgentId=""}handleSocketEvent(e,s){let n=e.event,t=e.payload;try{let o=typeof t.ccapId=="string"?t.ccapId:"";if(n!=="cc:rate-limit-update"&&n!=="ext-session-msg:message"&&n!=="ext-session-msg:update"&&o&&s.selectedCcapId&&o!==s.selectedCcapId){M.DyFM_Log.info(`CCAP_CcSession_DS | socket event dropped by instance filter | event: ${n} | eventCcapId: ${o} | selectedCcapId: ${s.selectedCcapId}`);return}switch(n){case"cc-session:status":this.handleStatusUpdate(t);break;case"cc-session:output":this.handleOutputChunk(t);break;case"cc-session:event":this.handleSessionEvent(t);break;case"cc-session:list-update":this.handleListUpdate(t);break;case"cc-session:session-update":this.handleSessionItemUpdate(t);break;case"agent-events":this.handleAgentEvent(t);break;case"ext-session-msg:message":this.handleAssembledMessage(t);break;case"ext-session-msg:update":this.handleAssembledMessageUpdate(t);break;case"cc:rate-limit-update":this.handleRateLimitBroadcast(t);break}}catch(o){let i=o instanceof Error?o.message:String(o);M.DyFM_Log.error(`CCAP_CcSession_DS | socket event error | event: ${n}`,o),s.globalErrorShowError(o instanceof Error?o:new Error(`CC Session socket event processing failed: ${n} \u2014 ${i}`),"cc-session-socket-event")}}pushConsoleMessageFromEvent(e,s,n){let t=e.data;switch(e.eventType){case"response-chunk":{this.pushResponseChunkBlocks(t);break}case"tool-call-start":{let o=t.name??t.tool_name??"unknown",i=typeof t.id=="string"?t.id:"";i&&this.toolUseIdToName.set(i,o),o==="Agent"&&i&&this.agentToolUseIds.add(i);let r=t.input,a=r?u.summarizeToolInput(r):"",l=a?`${o}: ${a}`:o,c=o==="Edit"?u.buildEditExpandableContent(r):void 0,m=o==="Agent"?"":this.activeSubAgentId;this.parent.pushConsoleMessage({type:"tool",text:l,expandableContent:c,rawData:t,parentAgentId:m||void 0});break}case"tool-call-end":{let o=t.content??t.output,i=typeof o=="string"?o:"",r=i.length>200?i.substring(0,200)+"\u2026":i;if(r){let a=i.length>200?i:void 0;this.parent.pushConsoleMessage({type:"tool-result",text:r,expandableContent:a,rawData:t,parentAgentId:this.activeSubAgentId||void 0})}break}case"response-complete":{this.activeSubAgentId="";let o=t.cost_usd,i=typeof o=="number"?` ($${o.toFixed(4)})`:"",r=typeof t.model=="string"?` \xB7 ${t.model}`:"";this.parent.pushConsoleMessage({type:"result",text:`Response complete${r}${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)}),this.accumulateUsage(t);break}case"prompt-sent":{let o=typeof t.content=="string"?t.content:"";o&&(this.parent.consoleMessages_$().some(a=>a.type==="prompt"&&a.text===o.trim())||this.parent.pushConsoleMessage({type:"prompt",text:o,rawData:t,expandableContent:JSON.stringify(t,null,2)}));break}case"status-change":{let o=typeof t.from=="string"?t.from:"",i=typeof t.to=="string"?t.to:"";if(i){let r=typeof t.statusMessage=="string"?t.statusMessage:void 0,a=o?`${o} \u2192 ${i}`:i,l=r?`${a} \u2014 ${r}`:a;this.parent.pushConsoleMessage({type:"status",text:l,isStatus:!0,rawData:t,expandableContent:JSON.stringify(t,null,2)})}break}case"config-change":{let o=t.update,i=o&&typeof o=="object"?Object.keys(o).join(", "):"unknown";this.parent.pushConsoleMessage({type:"info",text:`Config updated: ${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"error":{let o=typeof t.message=="string"?t.message:"Unknown error";this.parent.pushConsoleMessage({type:"error",text:o,rawData:t,expandableContent:JSON.stringify(t,null,2)}),s&&n(new Error(`CC Session error: ${o}`),"cc-session-event");break}case"usage-update":{this.accumulateUsage(t);break}case"cli-chunk":{this.handleCliChunkEvent(t);break}case"runner-overflow":{let i=`Runner buffer overflow: ${typeof t.droppedCount=="number"?t.droppedCount:0} output items lost during server disconnect`;this.parent.pushConsoleMessage({type:"error",text:i,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"interrupted-prompt":{let o=typeof t.reason=="string"?t.reason:"",i=typeof t.lastPrompt=="string"?t.lastPrompt:"",r=i.length>80?i.substring(0,80)+"\u2026":i,a=r?`Prompt interrupted (${o}): "${r}"`:`Prompt interrupted${o?" ("+o+")":""}`;this.parent.pushConsoleMessage({type:"status",text:a,isStatus:!0,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"session-init":{let o=typeof t.model=="string"?t.model:"",i=typeof t.claudeCodeVersion=="string"?t.claudeCodeVersion:"",r=typeof t.permissionMode=="string"?t.permissionMode:"",a=[];o&&a.push(o),r&&a.push(r),i&&a.push(`v${i}`);let l=a.length>0?`CLI init: ${a.join(" \xB7 ")}`:"CLI initialized",c=JSON.stringify(t,null,2);this.parent.pushConsoleMessage({type:"info",text:l,rawData:t,expandableContent:c});break}case"config-mismatch":{let o=t.mismatches,i=Array.isArray(o)?o.map(r=>`${r.field}: requested "${r.requested}" \u2192 actual "${r.actual}"`).join(", "):"unknown mismatch";this.parent.pushConsoleMessage({type:"error",text:`Config mismatch: ${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"cli-args-record":{let o=typeof t.model=="string"?t.model:"default",i=typeof t.reasoningEffort=="string"?t.reasoningEffort:"default",r=typeof t.mode=="string"?t.mode:"normal",a=typeof t.permissionPolicy=="string"?t.permissionPolicy:"default",l=`CLI spawn: model=${o} \xB7 effort=${i} \xB7 mode=${r} \xB7 permission=${a}`;this.parent.pushConsoleMessage({type:"info",text:l,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"stdout-line":case"stderr-line":break;default:{let o=e.eventType;this.parent.pushConsoleMessage({type:"raw",text:o,rawData:t});break}}}handleStatusUpdate(e){let s=e.sessionId??"",n=e.status??"",t=e.statusMessage;this.parent.lastStatusUpdate_$.set({sessionId:s,status:n,statusMessage:t});let i=this.parent.sessions_$().map(a=>a.sessionId===s?f(h({},a),{status:n,statusMessage:t}):a);this.parent.sessions_$.set(i);let r=this.parent.selectedSession_$();if(r?.session.sessionId===s){let a=u.isLiveCcSessionStatus(n);this.parent.selectedSession_$.set(f(h({},r),{session:f(h({},r.session),{status:n,statusMessage:t}),runtime:f(h({},r.runtime),{isLive:a,runtimeStatus:n})}))}if(n==="errored"){let a=(t??"").trim();if(a.startsWith("Auto-recovery: terminal runner dropped silently")||a.startsWith("Exit code:"))M.DyFM_Log.warn(`CCAP_CcSession | user-task-fail diagnostic (NOT recorded to /errors) | sessionId: ${s} | statusMessage: ${a}`);else{let c=t?`CC Session error (${s}): ${t}`:`CC Session error (${s}): session entered errored state`;this.parent.showGlobalError(new Error(c),"cc-session-status")}}this.parent.evaluateSessionEventsPolling()}handleOutputChunk(e){let s=e.sessionId??"";if(s&&s!==this.parent.activeSessionId_$())return;let n=e.content??"",t=e.type??"stdout",o=this.parent.liveOutput_$(),i=n.split(`
2
2
  `),r=3e3;if(t==="stderr"){let c=new Set(this.parent.liveStderrLines_$()),m=o.length;for(let b=0;b<i.length;b++)c.add(m+b);this.parent.liveStderrLines_$.set(c)}let l=[...o,...i];if(l.length>r){let c=l.length-r,m=l.slice(c),b=this.parent.liveStderrLines_$(),I=new Set;for(let w of b){let $=w-c;$>=0&&I.add($)}this.parent.liveStderrLines_$.set(I),this.parent.liveOutput_$.set(m)}else this.parent.liveOutput_$.set(l)}handleSessionEvent(e){let s=e.sessionId??"";if(s&&s!==this.parent.activeSessionId_$())return;let n=e.event??{},t={sessionId:s,eventType:n.eventType??"",timestamp:n.timestamp??"",data:n.data??{},sequence:n.sequence??0,eventSource:typeof n.eventSource=="string"?n.eventSource:void 0};if(t.sequence<=this.parent.getLastKnownEventSequence())return;this.parent.setLastKnownEventSequence(t.sequence);let o=this.parent.selectedSessionEvents_$();this.parent.selectedSessionEvents_$.set([...o,t]),this.pushConsoleMessageFromEvent(t,!0,(i,r)=>{this.parent.showGlobalError(i,r)})}handleAgentEvent(e){let s=typeof e.phase=="string"?e.phase:void 0;if(s)switch(s){case g.runInitialization:this.parent.pushConsoleMessage({type:"status",text:"RUN initialization",isStatus:!0});break;case g.analyze:this.parent.pushConsoleMessage({type:"status",text:"Analyzing incoming message",isStatus:!0});break;case g.analyzeResult:{let n=typeof e.runIntent=="string"?e.runIntent:"";n&&this.parent.pushConsoleMessage({type:"run-intent",text:n,isStatus:!1});break}case g.assemble:this.parent.pushConsoleMessage({type:"status",text:"Refreshing Context",isStatus:!0});break;case g.executionStart:this.parent.pushConsoleMessage({type:"status",text:"Starting Agent",isStatus:!0});break;case g.llmAgenticLoop:this.parent.pushConsoleMessage({type:"status",text:"Selecting next move",isStatus:!0});break;case g.agenticLoopIteration:{let n=typeof e.action=="string"?e.action:"",t=typeof e.tool=="string"?e.tool:"",o=typeof e.intent=="string"?e.intent:"",i=[];n&&i.push(n),t&&i.push(t),o&&i.push(o);let r=i.join(" \xB7 ");r&&this.parent.pushConsoleMessage({type:"iteration",text:r,isStatus:!1});break}case g.llmToolDescription:this.parent.pushConsoleMessage({type:"status",text:"Assembling tool inputs",isStatus:!0});break;case g.llmToolErrorRetry:this.parent.pushConsoleMessage({type:"status",text:"Figuring out what's wrong",isStatus:!0});break;case g.toolErrorRetry:this.parent.pushConsoleMessage({type:"status",text:"Trying to fix inputs",isStatus:!0});break;case g.executionEnd:this.parent.pushConsoleMessage({type:"status",text:"Finishing run",isStatus:!0});break;case g.finalization:case g.llmRunFinalization:this.parent.pushConsoleMessage({type:"status",text:"Gathering what we've done",isStatus:!0});break;case g.postFinalization:this.parent.pushConsoleMessage({type:"status",text:"Memorizing stuff",isStatus:!0});break;case g.runFlowComplete:this.parent.pushConsoleMessage({type:"status",text:"Getting back to user",isStatus:!0});break}}handleRateLimitBroadcast(e){let s=e.rate_limit_info;if(!s||typeof s!="object")return;let n=s,t={status:typeof n.status=="string"?n.status:"",resetsAt:typeof n.resetsAt=="number"?n.resetsAt:0,rateLimitType:typeof n.rateLimitType=="string"?n.rateLimitType:"",utilization:typeof n.utilization=="number"?n.utilization:0,surpassedThreshold:typeof n.surpassedThreshold=="number"?n.surpassedThreshold:0,isUsingOverage:n.isUsingOverage===!0,receivedAt:new Date().toISOString()};this.parent.rateLimitInfo_$.set(t)}handleListUpdate(e){let s=e.sessions??[],o=[...this.parent.sessions_$().some(i=>i.isArchived===!0)?s:s.filter(i=>!i.isArchived)].sort((i,r)=>{let a=i.lastActivityAt?new Date(i.lastActivityAt).getTime():0;return(r.lastActivityAt?new Date(r.lastActivityAt).getTime():0)-a});this.parent.sessions_$.set(o),this.mergeActiveSessionDetail(s)}handleSessionItemUpdate(e){let s=typeof e.sessionId=="string"?e.sessionId:"";if(!s)return;let n=typeof e.update=="object"&&e.update!==null?e.update:{},o=this.parent.sessions_$().map(r=>r.sessionId!==s?r:u.applySessionFieldUpdate(r,n));this.parent.sessions_$.set(o);let i=this.parent.selectedSession_$();i?.session.sessionId===s&&this.parent.selectedSession_$.set(f(h({},i),{session:u.applySessionFieldUpdate(i.session,n)}))}static applySessionFieldUpdate(e,s){let n=h({},e);return typeof s.toolCallCountIncrement=="number"&&(n.toolCallCount=(n.toolCallCount??0)+s.toolCallCountIncrement),typeof s.promptCountIncrement=="number"&&(n.promptCount=(n.promptCount??0)+s.promptCountIncrement),typeof s.inputTokensIncrement=="number"&&(n.inputTokensTotal=(n.inputTokensTotal??0)+s.inputTokensIncrement),typeof s.outputTokensIncrement=="number"&&(n.outputTokensTotal=(n.outputTokensTotal??0)+s.outputTokensIncrement),typeof s.costUsdIncrement=="number"&&(n.costUsdTotal=(n.costUsdTotal??0)+s.costUsdIncrement),typeof s.status=="string"&&(n.status=s.status),(typeof s.statusMessage=="string"||s.statusMessage===void 0)&&(n.statusMessage=s.statusMessage),typeof s.lastActivityAt=="string"&&(n.lastActivityAt=s.lastActivityAt),typeof s.lastPrompt=="string"&&(n.lastPrompt=s.lastPrompt),typeof s.activeModel=="string"&&(n.activeModel=s.activeModel),n}mergeActiveSessionDetail(e){let s=this.parent.activeSessionId_$();if(!s)return;let n=this.parent.selectedSession_$();if(!n)return;let t=e.find(o=>o.sessionId===s);t&&this.parent.selectedSession_$.set(f(h({},n),{session:h(h({},n.session),t)}))}handleAssembledMessage(e){let s=typeof e.sessionId=="string"?e.sessionId:"",n=this.parent.activeSessionId_$();if(!s||s!==n)return;let t=e.message;if(!t||typeof t!="object"){M.DyFM_Log.warn("CCAP_CcSession_DS | handleAssembledMessage dropped: invalid message payload",{sessionId:s,payloadKeys:Object.keys(e)});return}let o=t,i=this.parent.assembledMessages_$(),r=typeof o.messageKey=="string"?o.messageKey:"";r&&i.some(a=>a.messageKey===r)||this.parent.assembledMessages_$.set(_.sortAsc([...i,o]))}handleAssembledMessageUpdate(e){let s=typeof e.sessionId=="string"?e.sessionId:"";if(!s||s!==this.parent.activeSessionId_$())return;let n=typeof e.messageKey=="string"?e.messageKey:"";if(!n)return;let t=e.update;if(!t||typeof t!="object")return;let o=t,i=this.parent.assembledMessages_$(),r=i.findIndex(c=>c.messageKey===n);if(r<0)return;let a=h({},i[r]);typeof o.bodyText=="string"&&(a.bodyText=o.bodyText),o.toolResult!==void 0&&(a.toolResult=o.toolResult),typeof o.toolStatus=="string"&&(a.toolStatus=o.toolStatus),o.headerStatusDot!==void 0&&(a.headerStatusDot=typeof o.headerStatusDot=="string"?o.headerStatusDot:void 0);let l=[...i];l[r]=a,this.parent.assembledMessages_$.set(l)}handleCliChunkEvent(e){let s=typeof e.type=="string"?e.type:"";if(s==="rate_limit_event"){let n=e.rate_limit_info;if(n&&typeof n=="object"){let t=n,o={status:typeof t.status=="string"?t.status:"",resetsAt:typeof t.resetsAt=="number"?t.resetsAt:0,rateLimitType:typeof t.rateLimitType=="string"?t.rateLimitType:"",utilization:typeof t.utilization=="number"?t.utilization:0,surpassedThreshold:typeof t.surpassedThreshold=="number"?t.surpassedThreshold:0,isUsingOverage:t.isUsingOverage===!0,receivedAt:new Date().toISOString()};this.parent.rateLimitInfo_$.set(o)}return}if(s==="system"){this.handleCliChunkSystemEvent(e);return}this.handleCliChunkToolResults(e)||this.parent.pushConsoleMessage({type:"raw",text:s||"cli-chunk",rawData:e})}handleCliChunkSystemEvent(e){let s=typeof e.subtype=="string"?e.subtype:"",n=typeof e.description=="string"?e.description:u.buildSystemEventBrief({subtype:s,data:e}),t=typeof e.tool_use_id=="string"?e.tool_use_id:"";t&&this.agentToolUseIds.has(t)&&(this.activeSubAgentId=t);let o=t&&this.agentToolUseIds.has(t)?t:this.activeSubAgentId||void 0,i=typeof e.last_tool_name=="string"?e.last_tool_name:"";if(s==="task_progress"&&i){this.parent.pushConsoleMessage({type:"tool",text:`${i}: ${n}`,isStatus:!1,rawData:e,parentAgentId:o});return}this.parent.pushConsoleMessage({type:"status-update",text:n,subtype:s,isStatus:!1,rawData:e,parentAgentId:o})}pushResponseChunkBlocks(e){let s=e.message,n=s&&typeof s=="object"?s.content:e.content;if(Array.isArray(n)){for(let t of n){if(!t||typeof t!="object")continue;let o=t,i=typeof o.type=="string"?o.type:"";if(i==="text"){let r=typeof o.text=="string"?o.text:"";r&&(this.activeSubAgentId="",this.parent.pushConsoleMessage({type:"assistant",text:r,rawData:e}))}else if(i==="tool_use")this.handleResponseChunkToolUse(o,e);else if(i==="tool_result")this.handleResponseChunkToolResult(o);else if(i==="thinking"){let r=typeof o.thinking=="string"?o.thinking:"";r&&this.parent.pushConsoleMessage({type:"thinking",text:r,rawData:o,parentAgentId:this.activeSubAgentId||void 0})}else i&&this.parent.pushConsoleMessage({type:"raw",text:i,rawData:o})}return}if(typeof n=="string"&&n){this.parent.pushConsoleMessage({type:"assistant",text:n,rawData:e});return}this.parent.pushConsoleMessage({type:"raw",text:"response-chunk",rawData:e})}handleResponseChunkToolUse(e,s){let n=typeof e.name=="string"?e.name:"unknown",t=typeof e.id=="string"?e.id:"";t&&this.toolUseIdToName.set(t,n),n==="Agent"&&t&&this.agentToolUseIds.add(t);let o=e.input,i=o?u.summarizeToolInput(o):"",r=i?`${n}: ${i}`:n,a=n==="Edit"?u.buildEditExpandableContent(o):void 0,l=n==="Agent"?"":this.activeSubAgentId;this.parent.pushConsoleMessage({type:"tool",text:r,expandableContent:a,rawData:e,parentAgentId:l||void 0})}handleResponseChunkToolResult(e){let s=typeof e.tool_use_id=="string"?e.tool_use_id:"",n=s&&this.agentToolUseIds.has(s)?s:this.activeSubAgentId||"",t=e.content??e.output,o=typeof t=="string"?t:"",i=o.length>200?o.substring(0,200)+"\u2026":o||"tool_result";this.parent.pushConsoleMessage({type:"tool-result",text:i,expandableContent:o.length>200?o:void 0,rawData:e,parentAgentId:n||void 0})}handleCliChunkToolResults(e){if((typeof e.type=="string"?e.type:"")!=="user")return!1;let n=e.message,t=n&&typeof n=="object"?n.content:null;if(!Array.isArray(t))return!1;let o=typeof e.parent_tool_use_id=="string"?e.parent_tool_use_id:"",i=!1;for(let r of t){if(!r||typeof r!="object")continue;let a=r,l=typeof a.type=="string"?a.type:"";if(l==="tool_result"){let c=typeof a.tool_use_id=="string"?a.tool_use_id:"",m=c?this.toolUseIdToName.get(c)??"":"",b=a.content,I=typeof b=="string"?b:"",w=a.is_error===!0,$=m?`${m}: `:"",k=I.length>200?I.substring(0,200)+"\u2026":I||"tool result",F=w?`${$}ERROR \u2014 ${k}`:`${$}${k}`;this.parent.pushConsoleMessage({type:"tool-result",text:F,expandableContent:I.length>200?I:void 0,rawData:f(h({},a),{parent_tool_use_id:o||void 0}),parentAgentId:o||void 0}),i=!0}else if(l==="text"&&o){let c=typeof a.text=="string"?a.text:"";if(c){let m=c.length>200?c.substring(0,200)+"\u2026":c;this.parent.pushConsoleMessage({type:"tool-result",text:m,expandableContent:c.length>200?c:void 0,rawData:{tool_use_id:o,type:"sub-agent-prompt",text:c},parentAgentId:o}),i=!0}}}return i}static isLiveCcSessionStatus(e){return e==="running"||e==="waiting-input"||e==="starting"}static buildSystemEventBrief(e){switch(e.subtype){case"init":{let s=typeof e.data.cwd=="string"?e.data.cwd:"",n=typeof e.data.model=="string"?e.data.model:"",t=["init"];return s&&t.push(s),n&&t.push(n),t.join(" \xB7 ")}case"task_updated":{let s=e.data.patch,n=s&&typeof s=="object"&&typeof s.status=="string"?s.status:"";return n?`task ${n}`:"task updated"}case"task_notification":{let s=typeof e.data.status=="string"?e.data.status:"";return s?`task ${s}`:"task notification"}default:return e.subtype||"system"}}static buildEditExpandableContent(e){if(!e||typeof e!="object")return;let s=e,n=s.old_string,t=s.new_string;if(typeof n!="string"||typeof t!="string")return;let o=500,i=n.length>o?n.substring(0,o)+"\u2026":n,r=t.length>o?t.substring(0,o)+"\u2026":t;return JSON.stringify({old:i,new:r})}static summarizeToolInput(e){if(typeof e=="string")return e.length>120?e.substring(0,120)+"\u2026":e;if(e&&typeof e=="object"){let s=e,n=s.file_path??s.path,t=s.command,o=s.pattern;if(typeof n=="string")return n;if(typeof t=="string")return t.length>120?t.substring(0,120)+"\u2026":t;if(typeof o=="string")return o}return""}accumulateUsage(e){let s=e.usage,n=typeof e.cost_usd=="number"?e.cost_usd:0,t=0,o=0;if(s&&typeof s=="object"){let r=s;t=typeof r.input_tokens=="number"?r.input_tokens:typeof r.promptTokens=="number"?r.promptTokens:0,o=typeof r.output_tokens=="number"?r.output_tokens:typeof r.completionTokens=="number"?r.completionTokens:0}let i=this.parent.sessionUsage_$();this.parent.sessionUsage_$.set({promptTokens:i.promptTokens+t,completionTokens:i.completionTokens+o,totalTokens:i.totalTokens+t+o,costUsd:i.costUsd+n})}static \u0275fac=function(s){return new(s||u)};static \u0275prov=A({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();var ne=(()=>{class u{sessions_$=p([]);sessionsLoading_$=p(!1);sessionsLoadError_$=p(null);selectedSession_$=p(null);selectedSessionLoading_$=p(!1);selectedSessionEvents_$=p([]);liveOutput_$=p([]);liveStderrLines_$=p(new Set);consoleMessages_$=p([]);assembledMessages_$=p([]);assembledMessagesHasMore_$=p(!1);isLoadingOlderMessages_$=p(!1);assembledMessagesLoaded_$=p(!1);lastStatusUpdate_$=p(null);sessionUsage_$=p({promptTokens:0,completionTokens:0,totalTokens:0,costUsd:0});rateLimitInfo_$=p(null);activeSessionId_$=p("");ccSession_AS=v(R);extSessionMsg_AS=v(q);globalError_CS=v(L);socket_CS=v(P);ngZone=v(T);peiContext_DS=v(U);socketEventHandler_CS=v(x);eventSubscription=null;reconnectSubscription=null;lastKnownEventSequence=-1;static SESSION_EVENTS_POLL_INTERVAL_MS=5*S.second;sessionEventsPollHandle=null;isSessionEventsPollInFlight=!1;constructor(){this.socketEventHandler_CS.init(this),this.eventSubscription=this.socket_CS.event$.subscribe(e=>{this.ngZone.run(()=>{this.socketEventHandler_CS.handleSocketEvent(e,{selectedCcapId:this.peiContext_DS.activeCcapId_$(),globalErrorShowError:(s,n)=>{this.globalError_CS.showError(s,n)}})})}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(e=>{if(!e)return;let s=this.activeSessionId_$();s&&(this.socket_CS.emit("cc-session:subscribe",{sessionId:s}),this.loadAssembledMessages({sessionId:s}).catch(()=>{}),this.loadSessionDetail({sessionId:s}).catch(()=>{})),this.loadSessions().catch(()=>{}),this.backfillMissedEvents()})}ngOnDestroy(){this.stopSessionEventsPolling(),this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null),this.reconnectSubscription&&(this.reconnectSubscription.unsubscribe(),this.reconnectSubscription=null)}showGlobalError(e,s){this.globalError_CS.showError(e,s)}getLastKnownEventSequence(){return this.lastKnownEventSequence}setLastKnownEventSequence(e){this.lastKnownEventSequence=e}evaluateSessionEventsPolling(){let e=this.activeSessionId_$(),s=this.resolveActiveSessionStatusForEventsPolling();!!(e&&this.lastKnownEventSequence>=0&&s!=null&&x.isLiveCcSessionStatus(s))?this.ensureSessionEventsPollingStarted():this.stopSessionEventsPolling()}loadSessions(e){return d(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let n=[...(yield this.ccSession_AS.listSessions({status:e?.status,workspacePath:e?.workspacePath,includeArchived:e?.includeArchived})).sessions].sort((t,o)=>{let i=t.lastActivityAt?new Date(t.lastActivityAt).getTime():0;return(o.lastActivityAt?new Date(o.lastActivityAt).getTime():0)-i});this.sessions_$.set(n)}catch(s){this.sessionsLoadError_$.set(s)}finally{this.sessionsLoading_$.set(!1)}})}loadPersistedRateLimitState(e){return d(this,null,function*(){let s=e.ccapId?.trim()??"";if(s)try{let n=yield this.ccSession_AS.getRateLimitState({ccapId:s});this.mergePersistedRateLimitState(n.items)}catch(n){S.DyFM_Log.warn(`ClaudeCode_DS | loadPersistedRateLimitState failed (non-blocking) | ccapId: ${s} | ${n instanceof Error?n.message:String(n)}`)}})}mergePersistedRateLimitState(e){if(this.rateLimitInfo_$()!==null)return;let s=O.mapServerItemsToClientInfo(e);s!==null&&this.rateLimitInfo_$.set(s)}loadSessionDetail(e){return d(this,null,function*(){this.selectedSessionLoading_$.set(!0);try{let s=yield this.ccSession_AS.getSession({sessionId:e.sessionId}),n=this.activeSessionId_$();if(n&&n!==e.sessionId){S.DyFM_Log.info(`CCAP_CcSession_DS | loadSessionDetail stale response \u2014 discarded | requestedSessionId: ${e.sessionId} | currentActiveSessionId: ${n}`);return}this.selectedSession_$.set(s)}catch(s){let n=this.activeSessionId_$();if(n&&n!==e.sessionId)return;this.selectedSession_$.set(null);let t=s instanceof Error?s.message:"Failed to load session details";this.pushConsoleMessage({type:"error",text:`Load session failed: ${t}`})}finally{this.selectedSessionLoading_$.set(!1),this.evaluateSessionEventsPolling()}})}loadSessionEvents(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.getSessionEvents({sessionId:e.sessionId,eventType:e.eventType,limit:e.limit??500,latest:!0}),n=this.activeSessionId_$();if(n&&n!==e.sessionId){S.DyFM_Log.info(`CCAP_CcSession_DS | loadSessionEvents stale response \u2014 discarded | requestedSessionId: ${e.sessionId} | currentActiveSessionId: ${n}`);return}this.selectedSessionEvents_$.set(s.events),this.updateLastKnownSequence(s.events);for(let t of s.events)this.socketEventHandler_CS.pushConsoleMessageFromEvent(t,!1,(o,i)=>{this.globalError_CS.showError(o,i)});this.loadAssembledMessages({sessionId:e.sessionId}).catch(()=>{})}catch{let n=this.activeSessionId_$();if(n&&n!==e.sessionId)return;this.selectedSessionEvents_$.set([])}finally{this.evaluateSessionEventsPolling()}})}createSession(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.createSession(e),n=String(s.session.sessionId||"");return yield this.loadSessions(),n}catch(s){throw this.pushConsoleMessage({type:"error",text:`Create session failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}sendPrompt(e){return d(this,null,function*(){let s=e.attachments?.filter(n=>n.isImage&&!!n.base64).map(n=>`data:${n.mimeType};base64,${n.base64}`);this.pushConsoleMessage({type:"prompt",text:e.content,imageDataUrls:s?.length?s:void 0});try{let n=yield this.ccSession_AS.sendPrompt(e);n.relayed&&(n.targetOnline?this.pushConsoleMessage({type:"info",text:`Prompt relayed to remote instance (task: ${n.taskId?.substring(0,8)}\u2026)`}):this.pushConsoleMessage({type:"error",text:`\u26A0 A t\xE1voli instance jelenleg offline \u2014 a prompt queue-ban v\xE1rakozik (task: ${n.taskId?.substring(0,8)}\u2026) \xE9s csak akkor k\xE9zbes\xEDt\u0151dik, ha a target instance online lesz. Ellen\u0151rizd, hogy mindk\xE9t instance fut, \xE9s a Settings \u2192 Cluster sharedSecret azonos.`})),this.evaluateSessionEventsPolling()}catch(n){throw this.pushConsoleMessage({type:"error",text:`Send failed: ${y.getErrorMessageForDisplay(n)}`}),this.globalError_CS.showError(n,"CC Session sendPrompt"),n}})}forkSession(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.forkSession({sessionId:e.sessionId,label:e.label}),n=String(s.session.sessionId||"");return yield this.loadSessions(),n}catch(s){throw this.pushConsoleMessage({type:"error",text:`Fork session failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}resumeSession(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.resumeSession(e);s.relayed&&this.pushConsoleMessage({type:"info",text:s.targetOnline?"Resume relayed to remote instance":"Resume queued for offline remote instance"}),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Resume failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}stopExecution(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.stopExecution(e);if(s.relayed){this.pushSystemAssembledMessage({sessionId:e.sessionId,text:s.targetOnline?"Stop execution relayed to remote instance":"Stop execution queued for offline remote instance",role:"info"});return}let n=s.message||"Execution stopped";this.pushSystemAssembledMessage({sessionId:e.sessionId,text:n,role:"info"})}catch(s){throw this.pushSystemAssembledMessage({sessionId:e.sessionId,text:`Stop execution failed: ${y.getErrorMessageForDisplay(s)}`,role:"error"}),s}})}terminateSession(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.terminateSession(e);s.relayed?this.pushSystemAssembledMessage({sessionId:e.sessionId,text:s.targetOnline?"Terminate relayed to remote instance":"Terminate queued for offline remote instance",role:"info"}):this.pushSystemAssembledMessage({sessionId:e.sessionId,text:"Session terminated",role:"status"}),yield this.loadSessions()}catch(s){throw this.pushSystemAssembledMessage({sessionId:e.sessionId,text:`Terminate failed: ${y.getErrorMessageForDisplay(s)}`,role:"error"}),s}})}restartRunner(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.restartRunner(e);this.pushSystemAssembledMessage({sessionId:e.sessionId,text:`Runner restarted (new terminalId: ${s.newTerminalId.slice(0,8)}\u2026). New terminal window should open shortly.`,role:"info"})}catch(s){throw this.pushSystemAssembledMessage({sessionId:e.sessionId,text:`Runner restart failed: ${y.getErrorMessageForDisplay(s)}`,role:"error"}),s}})}setSessionArchived(e){return d(this,null,function*(){try{yield this.ccSession_AS.setSessionArchived(e),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Archive failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}updateSessionConfig(e){return d(this,null,function*(){try{yield this.ccSession_AS.updateSessionConfig(e);let s=this.selectedSession_$();if(s?.session.sessionId===e.sessionId){let n=h({},s.session);e.label!=null&&(n.label=e.label),e.mode!=null&&(n.mode=e.mode),e.permissionPolicy!=null&&(n.permissionPolicy=e.permissionPolicy),e.reasoningEffort!=null&&(n.reasoningEffort=e.reasoningEffort),e.model!=null&&(n.model=e.model),e.isDebugMode!=null&&(n.isDebugMode=e.isDebugMode),this.selectedSession_$.set(f(h({},s),{session:n}))}if(e.label!=null){let n=this.sessions_$(),t=n.findIndex(o=>o.sessionId===e.sessionId);if(t>=0){let o=[...n];o[t]=f(h({},o[t]),{label:e.label}),this.sessions_$.set(o)}}}catch(s){throw this.pushConsoleMessage({type:"error",text:`Config update failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}setActiveSessionId(e){let s=this.activeSessionId_$();s!==e&&this.stopSessionEventsPolling(),s&&s!==e&&this.socket_CS.emit("cc-session:unsubscribe",{sessionId:s}),this.activeSessionId_$.set(e),e&&this.socket_CS.emit("cc-session:subscribe",{sessionId:e})}clearLiveOutput(){this.stopSessionEventsPolling(),this.liveOutput_$.set([]),this.liveStderrLines_$.set(new Set),this.consoleMessages_$.set([]),this.assembledMessages_$.set([]),this.assembledMessagesHasMore_$.set(!1),this.isLoadingOlderMessages_$.set(!1),this.assembledMessagesLoaded_$.set(!1),this.selectedSession_$.set(null),this.selectedSessionEvents_$.set([]),this.lastStatusUpdate_$.set(null),this.sessionUsage_$.set({promptTokens:0,completionTokens:0,totalTokens:0,costUsd:0}),this.lastKnownEventSequence=-1,this.socketEventHandler_CS.resetTrackingState()}pushConsoleMessage(e){let s=e.type==="assistant"||e.type==="prompt"?e.text.trim():e.text,n={listKey:e.listKey??this.allocateConsoleListKey(),type:e.type,text:s,timestamp:e.timestamp??new Date().toISOString(),isStatus:e.isStatus??!1,expandableContent:e.expandableContent,rawData:e.rawData,subtype:e.subtype,parentAgentId:e.parentAgentId,imageDataUrls:e.imageDataUrls},t=this.consoleMessages_$();this.consoleMessages_$.set([...t,n])}loadAssembledMessages(e){return d(this,null,function*(){try{let s=yield this.extSessionMsg_AS.getMessages({sessionId:e.sessionId,latest:!0}),n=this.activeSessionId_$();if(n&&n!==e.sessionId){S.DyFM_Log.info(`CCAP_CcSession_DS | loadAssembledMessages stale \u2014 discarded | requestedSessionId: ${e.sessionId} | currentActiveSessionId: ${n} | restMessageCount: ${s.messages.length}`);return}let t=this.assembledMessages_$(),o=new Set(s.messages.map(r=>r.messageKey).filter(r=>typeof r=="string"&&r.length>0)),i=t.filter(r=>!o.has(r.messageKey));this.assembledMessages_$.set(_.sortAsc([...s.messages,...i])),this.assembledMessagesHasMore_$.set(s.hasMore)}catch(s){S.DyFM_Log.error(`CCAP_CcSession_DS | loadAssembledMessages failed | sessionId: ${e.sessionId}`,s)}finally{this.assembledMessagesLoaded_$.set(!0)}})}loadOlderAssembledMessages(e){return d(this,null,function*(){if(this.isLoadingOlderMessages_$()||!this.assembledMessagesHasMore_$())return;let s=this.assembledMessages_$();if(!s.length)return;let n=s.reduce((t,o)=>(o.sequence??0)<t?o.sequence??0:t,s[0].sequence??0);this.isLoadingOlderMessages_$.set(!0);try{let t=yield this.extSessionMsg_AS.getMessages({sessionId:e.sessionId,beforeSequence:n,limit:e.limit??50});t.messages.length&&this.assembledMessages_$.set(_.sortAsc([...t.messages,...s])),this.assembledMessagesHasMore_$.set(t.hasMore)}catch(t){S.DyFM_Log.error(`CCAP_CcSession_DS | loadOlderAssembledMessages failed | sessionId: ${e.sessionId}`,t)}finally{this.isLoadingOlderMessages_$.set(!1)}})}pushSystemAssembledMessage(e){let s=this.assembledMessages_$(),n=s.length?s.reduce((o,i)=>(i.sequence??0)>o?i.sequence??0:o,0):0,t={messageKey:`sys-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,sessionId:e.sessionId,sessionType:"cc",messageRole:e.role,bodyText:e.text,timestamp:new Date().toISOString(),sequence:n+1};this.assembledMessages_$.set(_.sortAsc([...s,t])),this.pushConsoleMessage({type:e.role==="error"?"error":e.role==="status"?"status":"info",text:e.text,isStatus:e.role==="status"})}allocateConsoleListKey(){return globalThis.crypto.randomUUID()}pullEventsSinceLastKnownSequence(e){return d(this,null,function*(){let s=this.activeSessionId_$();if(!(!s||this.lastKnownEventSequence<0))try{let t=(yield this.ccSession_AS.getSessionEvents({sessionId:s,sinceSequence:this.lastKnownEventSequence})).events;if(!t.length)return;this.ngZone.run(()=>{let o=this.activeSessionId_$();if(o!==s){S.DyFM_Log.info(`CCAP_CcSession_DS | pull(${e}) stale \u2014 discarded | requestedSessionId: ${s} | currentActiveSessionId: ${o} | newEventCount: ${t.length}`);return}let i=this.selectedSessionEvents_$();this.selectedSessionEvents_$.set([...i,...t]);for(let r of t)this.socketEventHandler_CS.pushConsoleMessageFromEvent(r,!0,(a,l)=>{this.globalError_CS.showError(a,l)});this.updateLastKnownSequence(t)})}catch(n){let t=e==="poll"?"session events poll failed":"backfill failed";S.DyFM_Log.warn(`CCAP_CcSession_DS | ${t}`,n)}})}backfillMissedEvents(){return d(this,null,function*(){yield this.pullEventsSinceLastKnownSequence("backfill")})}updateLastKnownSequence(e){for(let s of e)s.sequence>this.lastKnownEventSequence&&(this.lastKnownEventSequence=s.sequence)}resolveActiveSessionStatusForEventsPolling(){let e=this.activeSessionId_$();if(!e)return null;let s=this.selectedSession_$();if(s?.session.sessionId===e)return s.session.status;let n=this.lastStatusUpdate_$();return n?.sessionId===e?n.status:this.sessions_$().find(o=>o.sessionId===e)?.status??null}ensureSessionEventsPollingStarted(){this.sessionEventsPollHandle===null&&(this.sessionEventsPollHandle=setInterval(()=>{this.onSessionEventsPollTick()},u.SESSION_EVENTS_POLL_INTERVAL_MS))}stopSessionEventsPolling(){this.sessionEventsPollHandle!==null&&(clearInterval(this.sessionEventsPollHandle),this.sessionEventsPollHandle=null),this.isSessionEventsPollInFlight=!1}onSessionEventsPollTick(){return d(this,null,function*(){if(!this.isSessionEventsPollInFlight){this.isSessionEventsPollInFlight=!0;try{yield this.pullEventsSinceLastKnownSequence("poll");let e=this.activeSessionId_$();e&&(yield this.loadAssembledMessages({sessionId:e}))}finally{this.isSessionEventsPollInFlight=!1}}})}static \u0275fac=function(s){return new(s||u)};static \u0275prov=A({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();export{ne as a};
3
- //# sourceMappingURL=chunk-5NGKACCT.js.map
3
+ //# sourceMappingURL=chunk-MBE24QTZ.js.map
@@ -1,2 +1,2 @@
1
- import{f as l}from"./chunk-VLW4WKLV.js";import{N as p}from"./chunk-M2MQ43YC.js";import{C as i,aa as n,k as o,y as c}from"./chunk-TBMJSIBB.js";var d=(()=>{class a{settingsGeneral_DS=i(p);pm_AS=i(l);workspacePathPickerOptions_$=n([]);refreshWorkspacePathPickerOptions(){return o(this,null,function*(){yield this.settingsGeneral_DS.loadDefaultWorkspacePath();let t=this.settingsGeneral_DS.defaultWorkspacePath_$().trim(),e=[];t&&e.push({label:"Default Workspace",path:t}),this.workspacePathPickerOptions_$.set(e);try{let f=(yield this.pm_AS.listProjects()).projects.filter(s=>!!s.localPath&&!!s.isActive).map(s=>({label:s.name||"Unnamed Project",path:s.localPath??""})),r=[];t&&r.push({label:"Default Workspace",path:t}),r.push(...f),this.workspacePathPickerOptions_$.set(r)}catch{}})}resolveInitialWorkspacePath(t){let e=this.settingsGeneral_DS.defaultWorkspacePath_$().trim();return t.lastWorkspacePath.trim()||e}static \u0275fac=function(e){return new(e||a)};static \u0275prov=c({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();export{d as a};
2
- //# sourceMappingURL=chunk-CCUYQVNE.js.map
1
+ import{f as l}from"./chunk-D4MN4WBX.js";import{N as p}from"./chunk-RXRE3G4K.js";import{C as i,aa as n,k as o,y as c}from"./chunk-TBMJSIBB.js";var d=(()=>{class a{settingsGeneral_DS=i(p);pm_AS=i(l);workspacePathPickerOptions_$=n([]);refreshWorkspacePathPickerOptions(){return o(this,null,function*(){yield this.settingsGeneral_DS.loadDefaultWorkspacePath();let t=this.settingsGeneral_DS.defaultWorkspacePath_$().trim(),e=[];t&&e.push({label:"Default Workspace",path:t}),this.workspacePathPickerOptions_$.set(e);try{let f=(yield this.pm_AS.listProjects()).projects.filter(s=>!!s.localPath&&!!s.isActive).map(s=>({label:s.name||"Unnamed Project",path:s.localPath??""})),r=[];t&&r.push({label:"Default Workspace",path:t}),r.push(...f),this.workspacePathPickerOptions_$.set(r)}catch{}})}resolveInitialWorkspacePath(t){let e=this.settingsGeneral_DS.defaultWorkspacePath_$().trim();return t.lastWorkspacePath.trim()||e}static \u0275fac=function(e){return new(e||a)};static \u0275prov=c({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();export{d as a};
2
+ //# sourceMappingURL=chunk-MEDDAUB3.js.map
@@ -1,2 +1,2 @@
1
- import{b as a}from"./chunk-R52CDVAS.js";var f=class{static extract(t){if(t.toolName)return t.toolName;if(t.rawData){let s=t.rawData.name??t.rawData.tool_name??t.rawData.last_tool_name;if(typeof s=="string")return s}let o=t.bodyText.indexOf(":");return o>0?t.bodyText.substring(0,o).trim():t.bodyText.trim()}};var b=class e{static DEFAULT_GROUPABLE_TOOLS=new Set(["Read","Bash","Grep","Glob"]);static DEFAULT_MIN_GROUP_SIZE=2;static groupSubAgentItems(t,o){let s=new Map;for(let r=0;r<t.length;r++){let n=t[r];if(n.kind===a.tool&&n.toolName==="Agent"){let i=e.resolveAgentId(n);i&&s.set(i,{item:n,index:r})}}if(!s.size)return t;let c=new Map,d=new Set;for(let r=0;r<t.length;r++){let n=t[r];if(n.parentAgentId&&s.has(n.parentAgentId)){let i=c.get(n.parentAgentId)??[];i.push(n),c.set(n.parentAgentId,i),d.add(r)}}let l=[];for(let r=0;r<t.length;r++){if(d.has(r))continue;let n=t[r];if(n.kind===a.tool&&n.toolName==="Agent"){let i=e.resolveAgentId(n),p=c.get(i)??[],g=[n,...p],I=e.buildSubAgentLabel(n),A=e.extractSubagentType(n),y=e.groupConsecutiveToolItems(g,o);l.push({listKey:e.newListKey(),kind:a.subAgentGroup,bodyText:I,groupItems:y,groupToolName:A||"Agent",rawData:n.rawData})}else l.push(n)}return l}static groupConsecutiveToolItems(t,o){let s=o?.groupableTools??e.DEFAULT_GROUPABLE_TOOLS,c=o?.minGroupSize??e.DEFAULT_MIN_GROUP_SIZE,d=[],l=[],r="",n=()=>{if(!l.length)return;let i=l.filter(p=>p.kind===a.tool).length;i>=c?d.push({listKey:e.newListKey(),kind:a.toolGroup,bodyText:`${r} \xD7 ${i}`,groupItems:l,groupToolName:r}):d.push(...l),l=[],r=""};for(let i of t){if(i.kind===a.tool){let p=f.extract(i);if(s.has(p)){r&&r!==p&&n(),r=p,l.push(i);continue}}if(i.kind===a.toolResult&&l.length){l.push(i);continue}n(),d.push(i)}return n(),d}static resolveAgentId(t){return t.toolCallId?t.toolCallId:t.rawData&&typeof t.rawData.id=="string"?t.rawData.id:""}static extractSubagentType(t){let o=t.rawData?.input;if(!o||typeof o!="object")return"";let s=o.subagent_type;return typeof s=="string"?s:""}static extractDescription(t){let o=t.rawData?.input;if(!o||typeof o!="object")return"";let s=o.description;return typeof s=="string"?s:""}static buildSubAgentLabel(t){let o=e.extractSubagentType(t),s=e.extractDescription(t);return o?`${o}: ${s||"..."}`:s||"Sub-agent"}static newListKey(){return globalThis.crypto.randomUUID()}};var u=function(e){return e.user="user",e.assistant="assistant",e.tool="tool",e.toolResult="tool-result",e.status="status",e.error="error",e.info="info",e.result="result",e.thinking="thinking",e.statusUpdate="status-update",e}(u||{});var h=class e{static fromAssembledMessage(t,o){let s=e.mapRoleToKind(t.messageRole),c=t.toolResult?{text:t.toolResult.text,expandableContent:t.toolResult.expandableContent,rawData:t.toolResult.rawData,isError:t.toolResult.isError}:void 0,d=t.messageRole===u.tool&&t.toolName==="Edit"&&!!t.expandableContent;return{listKey:t.messageKey,kind:s,bodyText:t.bodyText,timestampIso:t.timestamp,toolName:t.toolName,expandableContent:t.expandableContent,pairedResult:c,rawData:t.rawData,subtype:t.subtype,isUserAligned:t.isUserAligned,headerStatusDot:t.headerStatusDot==="error"?"error":void 0,flags:{showCopy:!0,showRawInfo:!0,useEditDiffForExpandable:d},tts:e.buildTts(t,o),toolCallId:t.toolCallId,parentAgentId:t.parentAgentId}}static buildTts(t,o){if(!(!o||!(t.messageRole===u.user||t.messageRole===u.assistant)||!t.bodyText.trim().length))return{messageKey:t.messageKey,sessionId:o.sessionId,role:t.messageRole,content:t.bodyText,timestampIso:t.timestamp,hasTtsAudio:o.cachedKeys.has(t.messageKey)}}static mapRoleToKind(t){switch(t){case u.user:return a.userPrompt;case u.assistant:return a.assistant;case u.tool:return a.tool;case u.toolResult:return a.toolResult;case u.status:return a.status;case u.error:return a.error;case u.info:return a.info;case u.result:return a.result;case u.thinking:return a.thinking;case u.statusUpdate:return a.statusUpdate;default:return a.info}}};export{b as a,h as b};
2
- //# sourceMappingURL=chunk-4564GYJ5.js.map
1
+ import{b as a}from"./chunk-RL2M6DJN.js";var f=class{static extract(t){if(t.toolName)return t.toolName;if(t.rawData){let s=t.rawData.name??t.rawData.tool_name??t.rawData.last_tool_name;if(typeof s=="string")return s}let o=t.bodyText.indexOf(":");return o>0?t.bodyText.substring(0,o).trim():t.bodyText.trim()}};var b=class e{static DEFAULT_GROUPABLE_TOOLS=new Set(["Read","Bash","Grep","Glob"]);static DEFAULT_MIN_GROUP_SIZE=2;static groupSubAgentItems(t,o){let s=new Map;for(let r=0;r<t.length;r++){let n=t[r];if(n.kind===a.tool&&n.toolName==="Agent"){let i=e.resolveAgentId(n);i&&s.set(i,{item:n,index:r})}}if(!s.size)return t;let c=new Map,d=new Set;for(let r=0;r<t.length;r++){let n=t[r];if(n.parentAgentId&&s.has(n.parentAgentId)){let i=c.get(n.parentAgentId)??[];i.push(n),c.set(n.parentAgentId,i),d.add(r)}}let l=[];for(let r=0;r<t.length;r++){if(d.has(r))continue;let n=t[r];if(n.kind===a.tool&&n.toolName==="Agent"){let i=e.resolveAgentId(n),p=c.get(i)??[],g=[n,...p],I=e.buildSubAgentLabel(n),A=e.extractSubagentType(n),y=e.groupConsecutiveToolItems(g,o);l.push({listKey:e.newListKey(),kind:a.subAgentGroup,bodyText:I,groupItems:y,groupToolName:A||"Agent",rawData:n.rawData})}else l.push(n)}return l}static groupConsecutiveToolItems(t,o){let s=o?.groupableTools??e.DEFAULT_GROUPABLE_TOOLS,c=o?.minGroupSize??e.DEFAULT_MIN_GROUP_SIZE,d=[],l=[],r="",n=()=>{if(!l.length)return;let i=l.filter(p=>p.kind===a.tool).length;i>=c?d.push({listKey:e.newListKey(),kind:a.toolGroup,bodyText:`${r} \xD7 ${i}`,groupItems:l,groupToolName:r}):d.push(...l),l=[],r=""};for(let i of t){if(i.kind===a.tool){let p=f.extract(i);if(s.has(p)){r&&r!==p&&n(),r=p,l.push(i);continue}}if(i.kind===a.toolResult&&l.length){l.push(i);continue}n(),d.push(i)}return n(),d}static resolveAgentId(t){return t.toolCallId?t.toolCallId:t.rawData&&typeof t.rawData.id=="string"?t.rawData.id:""}static extractSubagentType(t){let o=t.rawData?.input;if(!o||typeof o!="object")return"";let s=o.subagent_type;return typeof s=="string"?s:""}static extractDescription(t){let o=t.rawData?.input;if(!o||typeof o!="object")return"";let s=o.description;return typeof s=="string"?s:""}static buildSubAgentLabel(t){let o=e.extractSubagentType(t),s=e.extractDescription(t);return o?`${o}: ${s||"..."}`:s||"Sub-agent"}static newListKey(){return globalThis.crypto.randomUUID()}};var u=function(e){return e.user="user",e.assistant="assistant",e.tool="tool",e.toolResult="tool-result",e.status="status",e.error="error",e.info="info",e.result="result",e.thinking="thinking",e.statusUpdate="status-update",e}(u||{});var h=class e{static fromAssembledMessage(t,o){let s=e.mapRoleToKind(t.messageRole),c=t.toolResult?{text:t.toolResult.text,expandableContent:t.toolResult.expandableContent,rawData:t.toolResult.rawData,isError:t.toolResult.isError}:void 0,d=t.messageRole===u.tool&&t.toolName==="Edit"&&!!t.expandableContent;return{listKey:t.messageKey,kind:s,bodyText:t.bodyText,timestampIso:t.timestamp,toolName:t.toolName,expandableContent:t.expandableContent,pairedResult:c,rawData:t.rawData,subtype:t.subtype,isUserAligned:t.isUserAligned,headerStatusDot:t.headerStatusDot==="error"?"error":void 0,flags:{showCopy:!0,showRawInfo:!0,useEditDiffForExpandable:d},tts:e.buildTts(t,o),toolCallId:t.toolCallId,parentAgentId:t.parentAgentId}}static buildTts(t,o){if(!(!o||!(t.messageRole===u.user||t.messageRole===u.assistant)||!t.bodyText.trim().length))return{messageKey:t.messageKey,sessionId:o.sessionId,role:t.messageRole,content:t.bodyText,timestampIso:t.timestamp,hasTtsAudio:o.cachedKeys.has(t.messageKey)}}static mapRoleToKind(t){switch(t){case u.user:return a.userPrompt;case u.assistant:return a.assistant;case u.tool:return a.tool;case u.toolResult:return a.toolResult;case u.status:return a.status;case u.error:return a.error;case u.info:return a.info;case u.result:return a.result;case u.thinking:return a.thinking;case u.statusUpdate:return a.statusUpdate;default:return a.info}}};export{b as a,h as b};
2
+ //# sourceMappingURL=chunk-MUV3H7Z7.js.map
@@ -1,2 +1,2 @@
1
- import{a as k}from"./chunk-UVQOIRMW.js";import{a as C}from"./chunk-V3VQWJQL.js";import{I as U,L as P,t as A}from"./chunk-M2MQ43YC.js";import{C as h,k as m,p as a,xb as M,y as b}from"./chunk-TBMJSIBB.js";var y=class{static readLlmCloudBucketsFromSectionResponse(n){return{anthropicLlm:v(n.anthropicSettings,{includeBaseUrl:!1}),googleLlm:v(n.googleSettings,{includeBaseUrl:!1}),deepseekLlm:v(n.deepseekSettings,{includeBaseUrl:!1}),fdpaiLlm:v(n.fdpaiSettings,{includeBaseUrl:!0})}}};function v(s,n){if(s==null||typeof s!="object"||Array.isArray(s))return{enabled:!1,defaultModel:"",baseUrl:"",apiKey:"",apiKeyMasked:""};let e=Reflect.get(s,"defaultModel"),o=Reflect.get(s,"apiKeyMasked"),i=Reflect.get(s,"baseUrl");return{enabled:Reflect.get(s,"enabled")===!0,defaultModel:typeof e=="string"?e:"",baseUrl:n.includeBaseUrl&&typeof i=="string"?i:"",apiKey:"",apiKeyMasked:typeof o=="string"?o:""}}var L=class{static parseLlmSettingsSectionForUi(n){let e=n.openAiSettings,o=!1,i="gpt-4o";if(e!=null&&typeof e=="object"&&!Array.isArray(e)){o=Reflect.get(e,"enabled")===!0;let t=Reflect.get(e,"defaultModel");typeof t=="string"&&(i=t)}let c=(Array.isArray(n.localAiSettings)?n.localAiSettings:[]).filter(t=>t!=null&&typeof t=="object"&&!Array.isArray(t)).map(t=>{let g=typeof t.key=="string"?t.key.trim():"";if(!g.length)return null;let S=typeof t.name=="string"?t.name:"",$=k.build({localAiKey:g}),T=S.trim().length>0?S.trim():"Local AI",_=t.enabled!==!1;return{id:$,baseUrl:(typeof t.baseUrl=="string"?t.baseUrl:"").trim(),model:(typeof t.defaultModel=="string"?t.defaultModel:"").trim(),label:T,enabled:_}}).filter(t=>t!=null),d=y.readLlmCloudBucketsFromSectionResponse(n),l=[];o&&l.push("open-ai"),d.anthropicLlm.enabled&&l.push("anthropic"),d.googleLlm.enabled&&l.push("google"),d.deepseekLlm.enabled&&l.push("deepseek"),d.fdpaiLlm.enabled&&l.push("fdp-ai");for(let t of c)t.enabled&&l.push(t.id);l.length===0&&l.push("open-ai");let F=c.map(t=>({id:t.id,label:t.label})),V=l.map(t=>({value:t,label:C.resolve(t,F)})),p=typeof n.defaultLlmProvider=="string"?n.defaultLlmProvider:"open-ai",u="";if(p==="open-ai")u=i;else if(p==="anthropic")u=d.anthropicLlm.defaultModel;else if(p==="google")u=d.googleLlm.defaultModel;else if(p==="deepseek")u=d.deepseekLlm.defaultModel;else if(p==="fdp-ai")u=d.fdpaiLlm.defaultModel;else{let t=c.find(g=>g.id===p);t&&(u=t.model)}return{enabledLlmProviderIds:l,llmProviderSelectOptions:V,defaultLlmProvider:p.trim(),defaultLlmModel:u.trim()}}};var I=(()=>{class s{baseUrl=`${U.api.baseUrl}/voice`;http=h(M);fetchVoiceNotesPoc(){return a(this.http.get(`${this.baseUrl}/poc/get-notes`))}fetchVoiceNotesQaSettings(){return a(this.http.get(`${this.baseUrl}/notes/qa-settings`))}saveVoiceNotesQaSettings(e){return a(this.http.put(`${this.baseUrl}/notes/qa-settings`,e,{headers:{"Content-Type":"application/json"}}))}saveVoiceNotesPoc(e){return a(this.http.put(`${this.baseUrl}/notes/poc`,e))}transcribeVoiceChunk(e){let o={qa:e.qaEnabled===!0?"1":"0",skip_classification:e.skipClassification!==!1?"true":"false"};e.confidenceThreshold!==void 0&&(o.confidence_threshold=String(e.confidenceThreshold)),e.noteContext!==void 0&&(o.note_context=e.noteContext);let i=Object.keys(o).map(c=>`${encodeURIComponent(c)}=${encodeURIComponent(o[c])}`).join("&"),f=`${this.baseUrl}/notes/transcribe${i?`?${i}`:""}`,r={"Content-Type":e.mimeType,Filename:e.filename};return a(this.http.post(f,e.blob,{headers:r}))}generateTtsSpeechBlob(e){return a(this.http.post(`${this.baseUrl}/tts/speech`,{input:e.text},{responseType:"blob"}))}getTtsMessageAudioUrl(e){let o=typeof e=="string"?e.trim():"";return o?`${this.baseUrl}/tts/message-audio/${encodeURIComponent(o)}`:""}getOrCreateTtsMessageAudio(e){return a(this.http.post(`${this.baseUrl}/tts/message-audio`,{sessionId:e.sessionId,role:e.role,content:e.content,timestamp:e.timestamp},{responseType:"blob",headers:{"Content-Type":"application/json"}}))}getVoiceSettings(){return a(this.http.get(`${this.baseUrl}/settings`))}saveTtsProvider(e){return a(this.http.post(`${this.baseUrl}/settings/tts-provider`,{provider:e}))}saveElevenLabsKey(e){return a(this.http.post(`${this.baseUrl}/settings/elevenlabs-key`,{apiKey:e}))}testElevenLabsApiKey(){return a(this.http.post(`${this.baseUrl}/settings/test-elevenlabs-key`,{}))}saveVoiceConfig(e){return a(this.http.post(`${this.baseUrl}/settings/voice-config`,{elevenLabsModelId:e.elevenLabsModelId,elevenLabsVoiceId:e.elevenLabsVoiceId}))}static \u0275fac=function(o){return new(o||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var Y=(()=>{class s{voice_AS=h(I);settings_AS=h(P);fetchQaEnabledFlag(){return m(this,null,function*(){try{return(yield this.voice_AS.fetchVoiceNotesQaSettings()).qaEnabled===!0}catch{return!1}})}loadSttQaSettingsPanelState(){return m(this,null,function*(){let e=yield this.voice_AS.fetchVoiceNotesQaSettings(),o=yield this.settings_AS.getSection(A.llmProviders),i=L.parseLlmSettingsSectionForUi(o),f=(e.providerName??"").trim(),r=[],c="";if(f.length>0){let d=yield this.fetchLlmModelsListForSttQa(f);r=[...d.models],c=d.errorMessage;let l=(e.modelName??"").trim();l.length>0&&!r.includes(l)&&(r=[l,...r])}return{qa:e,llmProviderSelectOptions:i.llmProviderSelectOptions,defaultLlmProvider:i.defaultLlmProvider,defaultLlmModel:i.defaultLlmModel,qaModelsForProvider:r,qaModelsListFetchError:c}})}fetchLlmModelsListForSttQa(e){return m(this,null,function*(){let o=e.trim();if(!o.length)return{models:[],errorMessage:""};try{let i=yield this.settings_AS.postListLlmModels({providerId:o}),f=i.models??[],r=typeof i.error=="string"?i.error.trim():"",c=i.success===!1;return f.length>0?{models:f,errorMessage:c?r.length>0?r:"Model list request failed.":""}:c?{models:[],errorMessage:r.length>0?r:"Model list request failed."}:{models:[],errorMessage:r}}catch(i){let f=i instanceof Error?i.message:String(i);return{models:[],errorMessage:f}}})}fetchLlmModelIdsForProvider(e){return m(this,null,function*(){return(yield this.fetchLlmModelsListForSttQa(e)).models})}normalizeConfusionMapEntries(e){return e.map(o=>({from:String(o.from).trim(),to:String(o.to).trim()})).filter(o=>o.from.length>0||o.to.length>0)}saveVoiceNotesQaSettings(e){return m(this,null,function*(){yield this.voice_AS.saveVoiceNotesQaSettings(e)})}fetchVoiceNotesPoc(){return this.voice_AS.fetchVoiceNotesPoc()}saveVoiceNotesPoc(e){return this.voice_AS.saveVoiceNotesPoc(e)}transcribeVoiceChunk(e){return this.voice_AS.transcribeVoiceChunk(e)}getTtsMessageAudioUrl(e){return this.voice_AS.getTtsMessageAudioUrl(e)}getOrCreateTtsMessageAudio(e){return this.voice_AS.getOrCreateTtsMessageAudio(e)}static \u0275fac=function(o){return new(o||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();export{y as a,I as b,Y as c};
2
- //# sourceMappingURL=chunk-HD5BCFN3.js.map
1
+ import{a as k}from"./chunk-J6ZXTCHI.js";import{a as C}from"./chunk-V3VQWJQL.js";import{I as U,L as P,t as A}from"./chunk-RXRE3G4K.js";import{C as h,k as m,p as a,xb as M,y as b}from"./chunk-TBMJSIBB.js";var y=class{static readLlmCloudBucketsFromSectionResponse(n){return{anthropicLlm:v(n.anthropicSettings,{includeBaseUrl:!1}),googleLlm:v(n.googleSettings,{includeBaseUrl:!1}),deepseekLlm:v(n.deepseekSettings,{includeBaseUrl:!1}),fdpaiLlm:v(n.fdpaiSettings,{includeBaseUrl:!0})}}};function v(s,n){if(s==null||typeof s!="object"||Array.isArray(s))return{enabled:!1,defaultModel:"",baseUrl:"",apiKey:"",apiKeyMasked:""};let e=Reflect.get(s,"defaultModel"),o=Reflect.get(s,"apiKeyMasked"),i=Reflect.get(s,"baseUrl");return{enabled:Reflect.get(s,"enabled")===!0,defaultModel:typeof e=="string"?e:"",baseUrl:n.includeBaseUrl&&typeof i=="string"?i:"",apiKey:"",apiKeyMasked:typeof o=="string"?o:""}}var L=class{static parseLlmSettingsSectionForUi(n){let e=n.openAiSettings,o=!1,i="gpt-4o";if(e!=null&&typeof e=="object"&&!Array.isArray(e)){o=Reflect.get(e,"enabled")===!0;let t=Reflect.get(e,"defaultModel");typeof t=="string"&&(i=t)}let c=(Array.isArray(n.localAiSettings)?n.localAiSettings:[]).filter(t=>t!=null&&typeof t=="object"&&!Array.isArray(t)).map(t=>{let g=typeof t.key=="string"?t.key.trim():"";if(!g.length)return null;let S=typeof t.name=="string"?t.name:"",$=k.build({localAiKey:g}),T=S.trim().length>0?S.trim():"Local AI",_=t.enabled!==!1;return{id:$,baseUrl:(typeof t.baseUrl=="string"?t.baseUrl:"").trim(),model:(typeof t.defaultModel=="string"?t.defaultModel:"").trim(),label:T,enabled:_}}).filter(t=>t!=null),d=y.readLlmCloudBucketsFromSectionResponse(n),l=[];o&&l.push("open-ai"),d.anthropicLlm.enabled&&l.push("anthropic"),d.googleLlm.enabled&&l.push("google"),d.deepseekLlm.enabled&&l.push("deepseek"),d.fdpaiLlm.enabled&&l.push("fdp-ai");for(let t of c)t.enabled&&l.push(t.id);l.length===0&&l.push("open-ai");let F=c.map(t=>({id:t.id,label:t.label})),V=l.map(t=>({value:t,label:C.resolve(t,F)})),p=typeof n.defaultLlmProvider=="string"?n.defaultLlmProvider:"open-ai",u="";if(p==="open-ai")u=i;else if(p==="anthropic")u=d.anthropicLlm.defaultModel;else if(p==="google")u=d.googleLlm.defaultModel;else if(p==="deepseek")u=d.deepseekLlm.defaultModel;else if(p==="fdp-ai")u=d.fdpaiLlm.defaultModel;else{let t=c.find(g=>g.id===p);t&&(u=t.model)}return{enabledLlmProviderIds:l,llmProviderSelectOptions:V,defaultLlmProvider:p.trim(),defaultLlmModel:u.trim()}}};var I=(()=>{class s{baseUrl=`${U.api.baseUrl}/voice`;http=h(M);fetchVoiceNotesPoc(){return a(this.http.get(`${this.baseUrl}/poc/get-notes`))}fetchVoiceNotesQaSettings(){return a(this.http.get(`${this.baseUrl}/notes/qa-settings`))}saveVoiceNotesQaSettings(e){return a(this.http.put(`${this.baseUrl}/notes/qa-settings`,e,{headers:{"Content-Type":"application/json"}}))}saveVoiceNotesPoc(e){return a(this.http.put(`${this.baseUrl}/notes/poc`,e))}transcribeVoiceChunk(e){let o={qa:e.qaEnabled===!0?"1":"0",skip_classification:e.skipClassification!==!1?"true":"false"};e.confidenceThreshold!==void 0&&(o.confidence_threshold=String(e.confidenceThreshold)),e.noteContext!==void 0&&(o.note_context=e.noteContext);let i=Object.keys(o).map(c=>`${encodeURIComponent(c)}=${encodeURIComponent(o[c])}`).join("&"),f=`${this.baseUrl}/notes/transcribe${i?`?${i}`:""}`,r={"Content-Type":e.mimeType,Filename:e.filename};return a(this.http.post(f,e.blob,{headers:r}))}generateTtsSpeechBlob(e){return a(this.http.post(`${this.baseUrl}/tts/speech`,{input:e.text},{responseType:"blob"}))}getTtsMessageAudioUrl(e){let o=typeof e=="string"?e.trim():"";return o?`${this.baseUrl}/tts/message-audio/${encodeURIComponent(o)}`:""}getOrCreateTtsMessageAudio(e){return a(this.http.post(`${this.baseUrl}/tts/message-audio`,{sessionId:e.sessionId,role:e.role,content:e.content,timestamp:e.timestamp},{responseType:"blob",headers:{"Content-Type":"application/json"}}))}getVoiceSettings(){return a(this.http.get(`${this.baseUrl}/settings`))}saveTtsProvider(e){return a(this.http.post(`${this.baseUrl}/settings/tts-provider`,{provider:e}))}saveElevenLabsKey(e){return a(this.http.post(`${this.baseUrl}/settings/elevenlabs-key`,{apiKey:e}))}testElevenLabsApiKey(){return a(this.http.post(`${this.baseUrl}/settings/test-elevenlabs-key`,{}))}saveVoiceConfig(e){return a(this.http.post(`${this.baseUrl}/settings/voice-config`,{elevenLabsModelId:e.elevenLabsModelId,elevenLabsVoiceId:e.elevenLabsVoiceId}))}static \u0275fac=function(o){return new(o||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var Y=(()=>{class s{voice_AS=h(I);settings_AS=h(P);fetchQaEnabledFlag(){return m(this,null,function*(){try{return(yield this.voice_AS.fetchVoiceNotesQaSettings()).qaEnabled===!0}catch{return!1}})}loadSttQaSettingsPanelState(){return m(this,null,function*(){let e=yield this.voice_AS.fetchVoiceNotesQaSettings(),o=yield this.settings_AS.getSection(A.llmProviders),i=L.parseLlmSettingsSectionForUi(o),f=(e.providerName??"").trim(),r=[],c="";if(f.length>0){let d=yield this.fetchLlmModelsListForSttQa(f);r=[...d.models],c=d.errorMessage;let l=(e.modelName??"").trim();l.length>0&&!r.includes(l)&&(r=[l,...r])}return{qa:e,llmProviderSelectOptions:i.llmProviderSelectOptions,defaultLlmProvider:i.defaultLlmProvider,defaultLlmModel:i.defaultLlmModel,qaModelsForProvider:r,qaModelsListFetchError:c}})}fetchLlmModelsListForSttQa(e){return m(this,null,function*(){let o=e.trim();if(!o.length)return{models:[],errorMessage:""};try{let i=yield this.settings_AS.postListLlmModels({providerId:o}),f=i.models??[],r=typeof i.error=="string"?i.error.trim():"",c=i.success===!1;return f.length>0?{models:f,errorMessage:c?r.length>0?r:"Model list request failed.":""}:c?{models:[],errorMessage:r.length>0?r:"Model list request failed."}:{models:[],errorMessage:r}}catch(i){let f=i instanceof Error?i.message:String(i);return{models:[],errorMessage:f}}})}fetchLlmModelIdsForProvider(e){return m(this,null,function*(){return(yield this.fetchLlmModelsListForSttQa(e)).models})}normalizeConfusionMapEntries(e){return e.map(o=>({from:String(o.from).trim(),to:String(o.to).trim()})).filter(o=>o.from.length>0||o.to.length>0)}saveVoiceNotesQaSettings(e){return m(this,null,function*(){yield this.voice_AS.saveVoiceNotesQaSettings(e)})}fetchVoiceNotesPoc(){return this.voice_AS.fetchVoiceNotesPoc()}saveVoiceNotesPoc(e){return this.voice_AS.saveVoiceNotesPoc(e)}transcribeVoiceChunk(e){return this.voice_AS.transcribeVoiceChunk(e)}getTtsMessageAudioUrl(e){return this.voice_AS.getTtsMessageAudioUrl(e)}getOrCreateTtsMessageAudio(e){return this.voice_AS.getOrCreateTtsMessageAudio(e)}static \u0275fac=function(o){return new(o||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();export{y as a,I as b,Y as c};
2
+ //# sourceMappingURL=chunk-N3AR5TZI.js.map
@@ -1,4 +1,4 @@
1
- import{a as K,b as J,c as X}from"./chunk-LACKIWSR.js";import{c as U,f as H,i as N,v as O}from"./chunk-EO4DNTT4.js";import{f as Q}from"./chunk-VLW4WKLV.js";import{$a as b,C as E,D as x,Fa as m,Ha as y,J as $,K as v,L as I,T as g,Ta as A,U as p,Z as a,aa as r,ab as F,da as f,ga as w,ha as T,hb as j,ia as W,ja as D,k as o,la as h,mb as B,oa as G,pa as q,qa as c,ra as u,sa as P,ua as R,ub as V,va as S,wa as d,y as M}from"./chunk-TBMJSIBB.js";var L=class s{static normalizeNewlines(l){return l.replace(/\r\n/g,`
1
+ import{a as K,b as J,c as X}from"./chunk-E4TY6O3W.js";import{c as U,f as H,i as N,v as O}from"./chunk-EO4DNTT4.js";import{f as Q}from"./chunk-D4MN4WBX.js";import{$a as b,C as E,D as x,Fa as m,Ha as y,J as $,K as v,L as I,T as g,Ta as A,U as p,Z as a,aa as r,ab as F,da as f,ga as w,ha as T,hb as j,ia as W,ja as D,k as o,la as h,mb as B,oa as G,pa as q,qa as c,ra as u,sa as P,ua as R,ub as V,va as S,wa as d,y as M}from"./chunk-TBMJSIBB.js";var L=class s{static normalizeNewlines(l){return l.replace(/\r\n/g,`
2
2
  `).replace(/\r/g,`
3
3
  `)}static sha256HexOfNormalized(l){return o(this,null,function*(){let e=s.normalizeNewlines(l),i=new TextEncoder().encode(e),n=yield crypto.subtle.digest("SHA-256",i),_=new Uint8Array(n),C="";for(let k=0;k<_.length;k+=1)C+=_[k].toString(16).padStart(2,"0");return C})}};var Y=(()=>{class s{projects_$=r([]);projectsLoading_$=r(!1);projectsError_$=r(null);projectsLoadedOnce_$=r(!1);activeProject_$=r(null);activeProjectComputedCcapHost_$=r(!1);activeProjectLoading_$=r(!1);activeProjectError_$=r(null);userRequests_$=r([]);userRequestsLoading_$=r(!1);userRequestsError_$=r(null);discoveredProjects_$=r([]);discoveryLoading_$=r(!1);discoveryError_$=r(null);gitStatusLoading_$=r(!1);gitStatusError_$=r(null);syncLoading_$=r(!1);syncError_$=r(null);lastSyncResult_$=r(null);fileContents_$=r(null);fileContentLoading_$=r(!1);fileContentError_$=r(null);testErrorReportsClearing_$=r(!1);agentReports_$=r([]);agentReportsLoading_$=r(!1);agentReportsError_$=r(null);activeAgentReport_$=r(null);activeAgentReportLoading_$=r(!1);activeAgentReportError_$=r(null);reviewsMeta_$=r([]);reviewsMetaLoading_$=r(!1);reviewsMetaError_$=r(null);reviewResult_$=r(null);reviewsRunning_$=r(!1);reviewsRunError_$=r(null);userInputWizardSuggestLoading_$=r(!1);userInputWizardSuggestError_$=r(null);userInputWizardFinalizeLoading_$=r(!1);userInputWizardFinalizeError_$=r(null);userInputWizardLastLlmSystemPrompt_$=r(null);userInputWizardLastLlmUserMessage_$=r(null);groups_$=r([]);groupsLoading_$=r(!1);groupsError_$=r(null);activeGroup_$=r(null);groupFiles_$=r(null);groupFilesLoading_$=r(!1);groupFilesError_$=r(null);crossInstanceProjects_$=r([]);crossInstanceLoading_$=r(!1);crossInstanceError_$=r(null);currentCcapId_$=r(null);cloneLoading_$=r(!1);cloneError_$=r(null);pm_AS=E(Q);loadProjects(){return o(this,null,function*(){this.projectsLoading_$.set(!0),this.projectsError_$.set(null);try{let e=yield this.pm_AS.listProjects();this.projects_$.set(e.projects),this.projectsLoadedOnce_$.set(!0)}catch(e){this.projectsError_$.set(e)}finally{this.projectsLoading_$.set(!1)}})}loadProject(e){return o(this,null,function*(){this.activeProjectLoading_$.set(!0),this.activeProjectError_$.set(null);try{let t=yield this.pm_AS.getProject(e);this.activeProject_$.set(t.project),this.activeProjectComputedCcapHost_$.set(t.computedCcapRevisionedHost)}catch(t){this.activeProjectError_$.set(t)}finally{this.activeProjectLoading_$.set(!1)}})}createProject(e){return o(this,null,function*(){let t=yield this.pm_AS.createProject(e);return yield this.loadProjects(),t.project})}updateProject(e,t){return o(this,null,function*(){let i=yield this.pm_AS.updateProject(e,t);this.activeProject_$.set(i.project),this.activeProjectComputedCcapHost_$.set(i.computedCcapRevisionedHost),this.projects_$.update(n=>n.map(_=>_._id===e?i.project:_))})}archiveProject(e){return o(this,null,function*(){yield this.pm_AS.archiveProject(e),yield this.loadProjects(),this.activeProject_$()?._id===e&&(this.activeProject_$.set(null),this.activeProjectComputedCcapHost_$.set(!1))})}loadGroups(){return o(this,null,function*(){this.groupsLoading_$.set(!0),this.groupsError_$.set(null);try{let e=yield this.pm_AS.listGroups();this.groups_$.set(e.groups)}catch(e){this.groupsError_$.set(e)}finally{this.groupsLoading_$.set(!1)}})}createGroup(e){return o(this,null,function*(){yield this.pm_AS.createGroup(e),yield this.loadGroups()})}archiveGroup(e){return o(this,null,function*(){yield this.pm_AS.archiveGroup(e),this.activeGroup_$()?._id===e&&this.activeGroup_$.set(null),yield this.loadGroups()})}selectGroup(e){this.activeGroup_$.set(e)}loadGroupFiles(e){return o(this,null,function*(){this.groupFilesLoading_$.set(!0),this.groupFilesError_$.set(null);try{let t=yield this.pm_AS.getGroupFiles(e);this.groupFiles_$.set(t)}catch(t){this.groupFilesError_$.set(t)}finally{this.groupFilesLoading_$.set(!1)}})}loadCrossInstanceProjects(){return o(this,null,function*(){this.crossInstanceLoading_$.set(!0),this.crossInstanceError_$.set(null);try{let e=yield this.pm_AS.listAllProjectsAcrossInstances();this.crossInstanceProjects_$.set(e.projects),this.currentCcapId_$.set(e.currentCcapId)}catch(e){this.crossInstanceError_$.set(e)}finally{this.crossInstanceLoading_$.set(!1)}})}cloneProject(e){return o(this,null,function*(){this.cloneLoading_$.set(!0),this.cloneError_$.set(null);try{yield this.pm_AS.cloneProject({sourceProjectId:e.sourceProjectId,targetParentDir:e.targetParentDir,repoName:e.repoName}),yield this.loadProjects()}catch(t){this.cloneError_$.set(t)}finally{this.cloneLoading_$.set(!1)}})}cloneGroup(e){return o(this,null,function*(){this.cloneLoading_$.set(!0),this.cloneError_$.set(null);try{yield this.pm_AS.cloneGroup({sourceGroupId:e.sourceGroupId,targetParentDir:e.targetParentDir}),yield this.loadProjects(),yield this.loadGroups()}catch(t){this.cloneError_$.set(t)}finally{this.cloneLoading_$.set(!1)}})}discoverProjects(e){return o(this,null,function*(){this.discoveryLoading_$.set(!0),this.discoveryError_$.set(null),this.discoveredProjects_$.set([]);try{let t=yield this.pm_AS.discoverProjects(e);this.discoveredProjects_$.set(t.discoveredProjects)}catch(t){this.discoveryError_$.set(t)}finally{this.discoveryLoading_$.set(!1)}})}createDiscoveredProjects(e){return o(this,null,function*(){for(let t of e){let i={name:t.name,localPath:t.localPath,description:t.description,githubRepoUrl:t.githubRepoUrl,isActive:!0};yield this.pm_AS.createProject(i)}yield this.loadProjects()})}clearDiscovery(){this.discoveredProjects_$.set([]),this.discoveryError_$.set(null),this.discoveryLoading_$.set(!1)}refreshGitStatus(e){return o(this,null,function*(){this.gitStatusLoading_$.set(!0),this.gitStatusError_$.set(null);try{let t=yield this.pm_AS.refreshGitStatus(e);this.activeProject_$.set(t.project);try{let i=yield this.pm_AS.getProject(e);this.activeProjectComputedCcapHost_$.set(i.computedCcapRevisionedHost)}catch{}this.projects_$.update(i=>i.map(n=>n._id===e?t.project:n))}catch(t){this.gitStatusError_$.set(t)}finally{this.gitStatusLoading_$.set(!1)}})}syncProject(e){return o(this,null,function*(){this.syncLoading_$.set(!0),this.syncError_$.set(null),this.lastSyncResult_$.set(null);try{let t=yield this.pm_AS.syncProject(e);this.lastSyncResult_$.set(t.syncResult),this.activeProject_$.set(t.project);try{let i=yield this.pm_AS.getProject(e);this.activeProjectComputedCcapHost_$.set(i.computedCcapRevisionedHost)}catch{}this.projects_$.update(i=>i.map(n=>n._id===e?t.project:n))}catch(t){this.syncError_$.set(t)}finally{this.syncLoading_$.set(!1)}})}syncAllProjects(){return o(this,null,function*(){this.syncLoading_$.set(!0),this.syncError_$.set(null);try{yield this.pm_AS.syncAllProjects(),yield this.loadProjects()}catch(e){this.syncError_$.set(e)}finally{this.syncLoading_$.set(!1)}})}loadAllFileContents(e){return o(this,null,function*(){this.fileContentLoading_$.set(!0),this.fileContentError_$.set(null);try{let t=yield this.pm_AS.getAllFileContents(e);this.fileContents_$.set(t.files)}catch(t){this.fileContentError_$.set(t)}finally{this.fileContentLoading_$.set(!1)}})}clearTestErrorReportsAndRefresh(e){return o(this,null,function*(){this.testErrorReportsClearing_$.set(!0);try{yield this.pm_AS.clearTestErrorReports(e),yield this.loadAllFileContents(e)}finally{this.testErrorReportsClearing_$.set(!1)}})}getBugsPathResolve(e){return o(this,null,function*(){return this.pm_AS.getBugsPathResolve(e)})}appendBugsFromErrorsAndRefreshFiles(e,t){return o(this,null,function*(){let i=yield this.pm_AS.appendBugsFromErrors(e,t);return yield this.loadAllFileContents(e),i})}appendSingleBugFromErrorAndRefreshFiles(e,t,i){return o(this,null,function*(){let n=yield this.pm_AS.appendSingleBugFromError(e,t,i);return yield this.loadAllFileContents(e),n})}createManualBugAndRefresh(e,t){return o(this,null,function*(){let i=yield this.pm_AS.createManualBug(e,t);return yield this.loadAllFileContents(e),yield this.loadUserRequests(e),i})}loadUserRequests(e){return o(this,null,function*(){this.userRequestsLoading_$.set(!0),this.userRequestsError_$.set(null);try{let t=yield this.pm_AS.listUserRequests(e);this.userRequests_$.set(t.userRequests)}catch(t){this.userRequestsError_$.set(t)}finally{this.userRequestsLoading_$.set(!1)}})}createUserRequest(e,t){return o(this,null,function*(){yield this.pm_AS.createUserRequest(e,t),yield this.loadUserRequests(e)})}updateUserRequest(e,t,i){return o(this,null,function*(){let n=yield this.pm_AS.updateUserRequest(e,t,i);this.userRequests_$.update(_=>_.map(C=>C._id===t?n.userRequest:C))})}suggestUserInputFormat(e,t){return o(this,null,function*(){this.userInputWizardSuggestLoading_$.set(!0),this.userInputWizardSuggestError_$.set(null),this.userInputWizardLastLlmSystemPrompt_$.set(null),this.userInputWizardLastLlmUserMessage_$.set(null);try{let i=yield this.pm_AS.suggestUserInputFormat(e,t);return this.userInputWizardLastLlmSystemPrompt_$.set(i.llmSystemPrompt??null),this.userInputWizardLastLlmUserMessage_$.set(i.llmUserMessage??null),i}catch(i){throw this.userInputWizardSuggestError_$.set(i),i}finally{this.userInputWizardSuggestLoading_$.set(!1)}})}mutateControlFileEntryAndRefresh(e,t,i){return o(this,null,function*(){let n=i.priorRawFingerprintSha256?.trim(),_=n!=null&&n.length>0?n:yield L.sha256HexOfNormalized(i.priorRawBlock),C={mode:i.mode,priorRawBlock:i.priorRawBlock,priorRawFingerprintSha256:_,newRawBlock:i.newRawBlock,bugsFileAbsolutePath:i.bugsFileAbsolutePath},k=yield this.pm_AS.mutateControlFileEntry(e,t,C);return yield this.loadAllFileContents(e),k})}finalizeUserInputWizard(e,t){return o(this,null,function*(){this.userInputWizardFinalizeLoading_$.set(!0),this.userInputWizardFinalizeError_$.set(null);try{let i=yield this.pm_AS.finalizeUserInput(e,t);return yield this.loadUserRequests(e),yield this.loadAllFileContents(e),i}catch(i){throw this.userInputWizardFinalizeError_$.set(i),i}finally{this.userInputWizardFinalizeLoading_$.set(!1)}})}loadReviewsMeta(e){return o(this,null,function*(){this.reviewsMetaLoading_$.set(!0),this.reviewsMetaError_$.set(null);try{let t=yield this.pm_AS.getReviewsMeta(e);this.reviewsMeta_$.set(t.reviewsMeta)}catch(t){this.reviewsMetaError_$.set(t)}finally{this.reviewsMetaLoading_$.set(!1)}})}runProjectReviews(e,t){return o(this,null,function*(){this.reviewsRunning_$.set(!0),this.reviewsRunError_$.set(null),this.reviewResult_$.set(null);try{let i=yield this.pm_AS.runProjectReviews(e,t);this.reviewResult_$.set(i.reviewResult)}catch(i){this.reviewsRunError_$.set(i)}finally{this.reviewsRunning_$.set(!1)}})}loadAgentReports(e){return o(this,null,function*(){this.agentReportsLoading_$.set(!0),this.agentReportsError_$.set(null);try{let t=yield this.pm_AS.listAgentReports(e);this.agentReports_$.set(t.reports)}catch(t){this.agentReportsError_$.set(t)}finally{this.agentReportsLoading_$.set(!1)}})}loadAgentReport(e,t){return o(this,null,function*(){this.activeAgentReportLoading_$.set(!0),this.activeAgentReportError_$.set(null);try{let i=yield this.pm_AS.getAgentReportContent(e,t);this.activeAgentReport_$.set(i)}catch(i){this.activeAgentReport_$.set(null),this.activeAgentReportError_$.set(i)}finally{this.activeAgentReportLoading_$.set(!1)}})}clearActiveAgentReport(){this.activeAgentReport_$.set(null),this.activeAgentReportError_$.set(null)}static \u0275fac=function(t){return new(t||s)};static \u0275prov=M({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();function te(s,l){if(s&1&&(c(0,"span",0),m(1),u()),s&2){let e=l;w("title",e),a(),y(" ",e," ")}}var Z=(()=>{class s{workspacePath=p(void 0);pm_DS=E(Y);projectName_$=j(()=>{let e=this.workspacePath();if(!e)return null;let t=s.normalizePath(e);return t?this.pm_DS.projects_$().find(_=>!!_.localPath&&s.normalizePath(_.localPath)===t)?.name??null:null});constructor(){!this.pm_DS.projectsLoadedOnce_$()&&!this.pm_DS.projectsLoading_$()&&!this.pm_DS.projectsError_$()&&this.pm_DS.loadProjects()}static normalizePath(e){let t=e.trim().toLowerCase().replace(/\\/g,"/");for(;t.endsWith("/")&&t.length>1;)t=t.slice(0,-1);return t}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=x({type:s,selectors:[["app-s-project-badge"]],hostAttrs:[1,"ml-auto"],hostVars:2,hostBindings:function(t,i){t&2&&T("display",i.projectName_$()?"inline-flex":"none")},inputs:{workspacePath:[1,"workspacePath"]},standalone:!0,features:[A],decls:1,vars:1,consts:[[1,"text-[9px]","px-1","py-0.5","rounded","bg-sky-500/20","text-sky-300","border","border-sky-500/30","shrink-0","truncate","max-w-[140px]",3,"title"]],template:function(t,i){if(t&1&&f(0,te,2,2,"span",0),t&2){let n;h((n=i.projectName_$())?0:-1,n)}},encapsulation:2})}return s})();function ie(s,l){s&1&&P(0,"span",4)}function se(s,l){if(s&1&&P(0,"app-s-project-badge",7),s&2){let e=d();w("workspacePath",e.view().workspacePath)}}function re(s,l){s&1&&(c(0,"span",8),m(1," archived "),u())}function ne(s,l){if(s&1){let e=R();c(0,"button",13),S("click",function(i){$(e);let n=d();return v(n.handleScheduleIndicatorClick(i))}),I(),c(1,"svg",14),P(2,"rect",15)(3,"line",16)(4,"line",17)(5,"line",18),u()()}}function oe(s,l){if(s&1){let e=R();c(0,"button",19),S("click",function(i){$(e);let n=d();return v(n.handleCoordinatorIndicatorClick(i))}),I(),c(1,"svg",14),P(2,"circle",20)(3,"polygon",21),u()()}}function ae(s,l){if(s&1&&(c(0,"div",11),m(1),u()),s&2){let e=d();a(),y(" ",e.view().workspacePath," ")}}function le(s,l){if(s&1&&(c(0,"div",12)(1,"span",22),m(2),u()()),s&2){let e=d();a(2),y(" ",e.view().promptCount," prompts ")}}var ee=(()=>{class s{view=p.required();isActive=p(!1);showWorkspacePath=p(!1);showPromptCount=p(!1);selected=g();contextMenu=g();scheduleIndicatorClicked=g();coordinatorIndicatorClicked=g();handleSelect(){this.selected.emit(this.view().id)}handleContextMenu(e){e.preventDefault(),e.stopPropagation(),this.contextMenu.emit({event:e,id:this.view().id})}handleScheduleIndicatorClick(e){e.stopPropagation(),this.scheduleIndicatorClicked.emit(this.view().id)}handleCoordinatorIndicatorClick(e){e.stopPropagation(),this.coordinatorIndicatorClicked.emit(this.view().id)}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=x({type:s,selectors:[["app-s-session-list-row"]],hostAttrs:[1,"block"],inputs:{view:[1,"view"],isActive:[1,"isActive"],showWorkspacePath:[1,"showWorkspacePath"],showPromptCount:[1,"showPromptCount"]},outputs:{selected:"selected",contextMenu:"contextMenu",scheduleIndicatorClicked:"scheduleIndicatorClicked",coordinatorIndicatorClicked:"coordinatorIndicatorClicked"},standalone:!0,features:[A],decls:17,vars:20,consts:[[1,"px-2","py-1.5","border-b","cursor-pointer","transition-colors",3,"click","contextmenu"],[1,"flex","items-center","gap-1.5"],[1,"relative","w-3.5","h-3.5","shrink-0","flex","items-center","justify-center",3,"title"],[1,"w-1.5","h-1.5","rounded-full",3,"ngClass"],[1,"absolute","inset-0","rounded-full","border","border-transparent","border-t-yellow-400","animate-spin"],[1,"text-xs","text-neutral-200","font-medium","truncate","shrink-1","min-w-0"],[1,"text-[10px]","text-neutral-400","shrink-0",3,"title"],[3,"workspacePath"],[1,"text-[8px]","px-0.5","rounded","bg-amber-500/15","text-amber-500","shrink-0"],["type","button","title","Ehhez a session-h\xF6z tartozik schedule \u2014 kattints a r\xE9szletek\xE9rt","aria-label","Schedule attached \u2014 open popup",1,"shrink-0","text-neonCyan/80","hover:text-neonCyan","focus:outline-none","focus:ring-1","focus:ring-neonCyan/60","rounded","p-0.5"],["type","button","title","Ehhez a session-h\xF6z tartozik koordin\xE1tor \u2014 kattints a r\xE9szletek\xE9rt","aria-label","Coordinator attached \u2014 open popup",1,"shrink-0","text-neonAmber/80","hover:text-neonAmber","focus:outline-none","focus:ring-1","focus:ring-neonAmber/60","rounded","p-0.5"],[1,"text-[10px]","text-neutral-500","truncate","mt-0.5","ml-5"],[1,"flex","items-center","gap-2","mt-0.5","ml-5"],["type","button","title","Ehhez a session-h\xF6z tartozik schedule \u2014 kattints a r\xE9szletek\xE9rt","aria-label","Schedule attached \u2014 open popup",1,"shrink-0","text-neonCyan/80","hover:text-neonCyan","focus:outline-none","focus:ring-1","focus:ring-neonCyan/60","rounded","p-0.5",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true",1,"w-3","h-3"],["x","3","y","4","width","18","height","18","rx","2","ry","2"],["x1","16","y1","2","x2","16","y2","6"],["x1","8","y1","2","x2","8","y2","6"],["x1","3","y1","10","x2","21","y2","10"],["type","button","title","Ehhez a session-h\xF6z tartozik koordin\xE1tor \u2014 kattints a r\xE9szletek\xE9rt","aria-label","Coordinator attached \u2014 open popup",1,"shrink-0","text-neonAmber/80","hover:text-neonAmber","focus:outline-none","focus:ring-1","focus:ring-neonAmber/60","rounded","p-0.5",3,"click"],["cx","12","cy","12","r","10"],["points","16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"],[1,"text-[10px]","text-neutral-600"]],template:function(t,i){if(t&1&&(c(0,"div",0),S("click",function(){return i.handleSelect()})("contextmenu",function(_){return i.handleContextMenu(_)}),c(1,"div",1)(2,"span",2),P(3,"span",3),f(4,ie,1,0,"span",4),u(),c(5,"span",5),m(6),u(),c(7,"span",6),b(8,"sAbsoluteTime"),m(9),b(10,"sTimeAgo"),u(),f(11,se,1,1,"app-s-project-badge",7)(12,re,2,0,"span",8)(13,ne,6,0,"button",9)(14,oe,4,0,"button",10),u(),f(15,ae,2,1,"div",11)(16,le,3,1,"div",12),u()),t&2){let n;D(i.isActive()?"border-l-2 border-l-ccapAccent border-b-neutral-700/30 bg-neutral-800/80":"border-l-2 border-l-transparent border-b-neutral-700/30 hover:bg-neutral-800/60"),W("opacity-50",i.view().isArchived),a(2),w("title",i.view().status),a(),w("ngClass",i.view().statusColorClass),a(),h(i.view().isRunning?4:-1),a(2),y(" ",i.view().label," "),a(),w("title",F(8,16,(n=i.view().lastActivityAt)!==null&&n!==void 0?n:"")),a(2),y(" ",i.view().lastActivityAt?F(10,18,i.view().lastActivityAt):"\u2014"," "),a(2),h(i.view().workspacePath?11:-1),a(),h(i.view().isArchived?12:-1),a(),h(i.view().hasSchedule?13:-1),a(),h(i.view().hasCoordinator?14:-1),a(),h(i.showWorkspacePath()&&i.view().workspacePath?15:-1),a(),h(i.showPromptCount()&&i.view().promptCount?16:-1)}},dependencies:[B,J,X,Z],encapsulation:2})}return s})();var ce=(s,l)=>l.id;function ue(s,l){if(s&1){let e=R();c(0,"div",1)(1,"input",5),S("ngModelChange",function(i){$(e);let n=d();return v(n.searchQuery_$.set(i))}),u()()}if(s&2){let e=d();a(),w("placeholder",e.searchPlaceholder())("ngModel",e.searchQuery_$())}}function pe(s,l){if(s&1){let e=R();c(0,"app-s-session-list-row",6),S("selected",function(i){$(e);let n=d();return v(n.handleRowSelect(i))})("contextMenu",function(i){$(e);let n=d();return v(n.handleRowContextMenu(i))})("scheduleIndicatorClicked",function(i){$(e);let n=d();return v(n.handleRowScheduleIndicatorClick(i))})("coordinatorIndicatorClicked",function(i){$(e);let n=d();return v(n.handleRowCoordinatorIndicatorClick(i))}),u()}if(s&2){let e=l.$implicit,t=d();w("view",e)("isActive",e.id===t.activeId())("showWorkspacePath",t.showWorkspacePath())("showPromptCount",t.showPromptCount())}}function de(s,l){s&1&&m(0," Nincs tal\xE1lat. ")}function _e(s,l){s&1&&m(0," \xDCres lista. ")}function he(s,l){if(s&1&&(c(0,"span",4),f(1,de,1,0)(2,_e,1,0),u()),s&2){let e=d();a(),h(e.searchQuery_$().trim().length>0?1:2)}}var qe=(()=>{class s{kind=p.required();rows=p([]);activeId=p("");showWorkspacePath=p(!1);showPromptCount=p(!1);searchPlaceholder=p("Keres\xE9s...");hideSearch=p(!1);selected=g();contextMenu=g();scheduleIndicatorClicked=g();coordinatorIndicatorClicked=g();searchQuery_$=r("");filteredRows_$=j(()=>{let e=this.rows();if(this.hideSearch())return e;let t=this.searchQuery_$();return t.trim().length===0?e:e.filter(i=>K.includesText(i.label,t))});handleRowSelect(e){this.selected.emit(e)}handleRowContextMenu(e){this.contextMenu.emit(e)}handleRowScheduleIndicatorClick(e){this.scheduleIndicatorClicked.emit(e)}handleRowCoordinatorIndicatorClick(e){this.coordinatorIndicatorClicked.emit(e)}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=x({type:s,selectors:[["app-s-session-select"]],hostAttrs:[1,"block"],inputs:{kind:[1,"kind"],rows:[1,"rows"],activeId:[1,"activeId"],showWorkspacePath:[1,"showWorkspacePath"],showPromptCount:[1,"showPromptCount"],searchPlaceholder:[1,"searchPlaceholder"],hideSearch:[1,"hideSearch"]},outputs:{selected:"selected",contextMenu:"contextMenu",scheduleIndicatorClicked:"scheduleIndicatorClicked",coordinatorIndicatorClicked:"coordinatorIndicatorClicked"},standalone:!0,features:[A],decls:6,vars:2,consts:[[1,"flex","flex-col","gap-2"],[1,"px-2","pt-2"],[1,"flex","flex-col","gap-1","px-2","pb-2"],[3,"view","isActive","showWorkspacePath","showPromptCount"],[1,"text-[11px]","text-neutral-500","italic","px-1","py-2"],["type","text","data-testid","s-session-select-search",1,"w-full","px-2","py-1","text-xs","rounded","border","border-neonDefault","bg-neutral-900","text-neutral-200","placeholder-neutral-500","focus:outline-none","focus:border-ccapAccent",3,"ngModelChange","placeholder","ngModel"],[3,"selected","contextMenu","scheduleIndicatorClicked","coordinatorIndicatorClicked","view","isActive","showWorkspacePath","showPromptCount"]],template:function(t,i){t&1&&(c(0,"div",0),f(1,ue,2,2,"div",1),c(2,"div",2),G(3,pe,1,4,"app-s-session-list-row",3,ce),f(5,he,3,1,"span",4),u()()),t&2&&(a(),h(i.hideSearch()?-1:1),a(2),q(i.filteredRows_$()),a(2),h(i.filteredRows_$().length===0?5:-1))},dependencies:[V,O,U,H,N,ee],encapsulation:2})}return s})();export{Y as a,ee as b,qe as c};
4
- //# sourceMappingURL=chunk-HQUS6ZSW.js.map
4
+ //# sourceMappingURL=chunk-N3TQEDBL.js.map
@@ -1,2 +1,2 @@
1
- import{I as d}from"./chunk-M2MQ43YC.js";import{C as o,p as n,xb as l,y as s}from"./chunk-TBMJSIBB.js";var p=(()=>{class r{baseUrl=`${d.api.baseUrl}/model-registry`;http=o(l);getList(e){let t=new URLSearchParams;e?.provider!==void 0&&e.provider.trim()!==""&&t.set("provider",e.provider.trim()),e?.modelName!==void 0&&e.modelName.trim()!==""&&t.set("modelName",e.modelName.trim()),e?.enabled===!0?t.set("enabled","true"):e?.enabled===!1&&t.set("enabled","false"),e?.inactiveProviderOnly===!0&&t.set("inactiveProviderOnly","true");let i=t.toString(),u=`${this.baseUrl}/list${i!==""?`?${i}`:""}`;return n(this.http.get(u))}sync(){return n(this.http.post(`${this.baseUrl}/sync`,{}))}setEnabled(e,t){return n(this.http.patch(`${this.baseUrl}/patch/${encodeURIComponent(e)}`,{enabled:t}))}patchEntry(e,t){let i={};return t.enabled!==void 0&&(i.enabled=t.enabled),t.reasoningLevelForTest!==void 0&&(i.reasoningLevelForTest=t.reasoningLevelForTest),t.capabilities!==void 0&&(i.capabilities=t.capabilities),n(this.http.patch(`${this.baseUrl}/patch/${encodeURIComponent(e)}`,i))}bulkSetEnabled(e,t){return n(this.http.patch(`${this.baseUrl}/bulk-enabled`,{ids:e,enabled:t}))}deleteEntry(e){return n(this.http.delete(`${this.baseUrl}/entry/${encodeURIComponent(e)}`))}deleteEntries(e){return n(this.http.post(`${this.baseUrl}/delete-entries`,{ids:e}))}getTestResults(e){let t=new URLSearchParams;e.provider&&t.set("provider",e.provider),e.model&&t.set("model",e.model),e.limit!==void 0&&t.set("limit",String(e.limit)),e.reasoningLevel!==void 0&&e.reasoningLevel.trim()!==""&&t.set("reasoningLevel",e.reasoningLevel.trim());let i=t.toString();return n(this.http.get(`${this.baseUrl}/test-results${i?`?${i}`:""}`))}getPrompts(){return n(this.http.get(`${this.baseUrl}/prompts`))}startTestRun(e,t){let i={modelIds:e};return t!==void 0&&t.length>0&&(i.promptIds=t),n(this.http.post(`${this.baseUrl}/test-run`,i))}getTestRunStatus(e){return n(this.http.get(`${this.baseUrl}/test-run/${e}`))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{p as a};
2
- //# sourceMappingURL=chunk-UBTKADWP.js.map
1
+ import{I as d}from"./chunk-RXRE3G4K.js";import{C as o,p as n,xb as l,y as s}from"./chunk-TBMJSIBB.js";var p=(()=>{class r{baseUrl=`${d.api.baseUrl}/model-registry`;http=o(l);getList(e){let t=new URLSearchParams;e?.provider!==void 0&&e.provider.trim()!==""&&t.set("provider",e.provider.trim()),e?.modelName!==void 0&&e.modelName.trim()!==""&&t.set("modelName",e.modelName.trim()),e?.enabled===!0?t.set("enabled","true"):e?.enabled===!1&&t.set("enabled","false"),e?.inactiveProviderOnly===!0&&t.set("inactiveProviderOnly","true");let i=t.toString(),u=`${this.baseUrl}/list${i!==""?`?${i}`:""}`;return n(this.http.get(u))}sync(){return n(this.http.post(`${this.baseUrl}/sync`,{}))}setEnabled(e,t){return n(this.http.patch(`${this.baseUrl}/patch/${encodeURIComponent(e)}`,{enabled:t}))}patchEntry(e,t){let i={};return t.enabled!==void 0&&(i.enabled=t.enabled),t.reasoningLevelForTest!==void 0&&(i.reasoningLevelForTest=t.reasoningLevelForTest),t.capabilities!==void 0&&(i.capabilities=t.capabilities),n(this.http.patch(`${this.baseUrl}/patch/${encodeURIComponent(e)}`,i))}bulkSetEnabled(e,t){return n(this.http.patch(`${this.baseUrl}/bulk-enabled`,{ids:e,enabled:t}))}deleteEntry(e){return n(this.http.delete(`${this.baseUrl}/entry/${encodeURIComponent(e)}`))}deleteEntries(e){return n(this.http.post(`${this.baseUrl}/delete-entries`,{ids:e}))}getTestResults(e){let t=new URLSearchParams;e.provider&&t.set("provider",e.provider),e.model&&t.set("model",e.model),e.limit!==void 0&&t.set("limit",String(e.limit)),e.reasoningLevel!==void 0&&e.reasoningLevel.trim()!==""&&t.set("reasoningLevel",e.reasoningLevel.trim());let i=t.toString();return n(this.http.get(`${this.baseUrl}/test-results${i?`?${i}`:""}`))}getPrompts(){return n(this.http.get(`${this.baseUrl}/prompts`))}startTestRun(e,t){let i={modelIds:e};return t!==void 0&&t.length>0&&(i.promptIds=t),n(this.http.post(`${this.baseUrl}/test-run`,i))}getTestRunStatus(e){return n(this.http.get(`${this.baseUrl}/test-run/${e}`))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{p as a};
2
+ //# sourceMappingURL=chunk-NEZJG3XV.js.map
@@ -1,2 +1,2 @@
1
- import{I as o}from"./chunk-M2MQ43YC.js";import{C as s,p as r,xb as a,y as n}from"./chunk-TBMJSIBB.js";var h=(()=>{class e{baseUrl=`${o.api.baseUrl}/oci-instance-data`;http=s(a);listInstances(){return r(this.http.get(`${this.baseUrl}/list`))}getByInstanceId(t){return r(this.http.get(`${this.baseUrl}/by-id/${t}`))}patchVisuals(t){let i={};return t.label!==void 0&&(i.label=t.label),t.darkOfficeVisuals!==void 0&&(i.darkOfficeVisuals=t.darkOfficeVisuals),r(this.http.patch(`${this.baseUrl}/by-id/${t.instanceId}`,i))}static \u0275fac=function(i){return new(i||e)};static \u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{h as a};
2
- //# sourceMappingURL=chunk-ZDJUICKL.js.map
1
+ import{I as o}from"./chunk-RXRE3G4K.js";import{C as s,p as r,xb as a,y as n}from"./chunk-TBMJSIBB.js";var h=(()=>{class e{baseUrl=`${o.api.baseUrl}/oci-instance-data`;http=s(a);listInstances(){return r(this.http.get(`${this.baseUrl}/list`))}getByInstanceId(t){return r(this.http.get(`${this.baseUrl}/by-id/${t}`))}patchVisuals(t){let i={};return t.label!==void 0&&(i.label=t.label),t.darkOfficeVisuals!==void 0&&(i.darkOfficeVisuals=t.darkOfficeVisuals),r(this.http.patch(`${this.baseUrl}/by-id/${t.instanceId}`,i))}static \u0275fac=function(i){return new(i||e)};static \u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{h as a};
2
+ //# sourceMappingURL=chunk-OSJXI65X.js.map
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-P5IIY6MO.js";import{I as d,p as h}from"./chunk-M2MQ43YC.js";import{C as l,aa as o,h as u,k as r,y as s}from"./chunk-TBMJSIBB.js";var e=function(t){return t.idle="idle",t.downloading="downloading",t.installing="installing",t.completed="completed",t.failed="failed",t}(e||{});var p=u(h());function m(){return typeof window.Capacitor<"u"&&window.Capacitor.isNativePlatform?.()===!0}function w(){let a=window.Capacitor?.Plugins?.AppUpdater;return a||null}var y=(()=>{class t{versionCheck_CS=l(c);downloadUrl=d.api.baseUrl+"/mobile/download";phase_$=o(e.idle);lastError_$=o("");startUpdate(){return r(this,null,function*(){let n=this.phase_$();if(!(n===e.downloading||n===e.installing)){this.lastError_$.set(""),this.phase_$.set(e.downloading);try{let i=w();if(i){this.phase_$.set(e.installing),yield i.downloadAndInstall({downloadUrl:this.downloadUrl}),this.phase_$.set(e.completed);return}this.openInSystemBrowser(this.downloadUrl),this.phase_$.set(e.completed)}catch(i){let f=i instanceof Error?i.message:String(i);this.lastError_$.set(f),this.phase_$.set(e.failed),p.DyFM_Error.logSimple("CCAP_MobileAppUpdater | startUpdate failed",i)}}})}autoUpdateIfAvailable(){return r(this,null,function*(){m()&&(yield this.versionCheck_CS.checkNow(),this.versionCheck_CS.updateAvailable_$()&&(yield this.startUpdate()))})}openInSystemBrowser(n){window.open(n,"_system")}static \u0275fac=function(i){return new(i||t)};static \u0275prov=s({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{e as a,y as b};
2
- //# sourceMappingURL=chunk-IBQTN5YN.js.map
1
+ import{b as c}from"./chunk-WDV7MFNU.js";import{I as d,p as h}from"./chunk-RXRE3G4K.js";import{C as l,aa as o,h as u,k as r,y as s}from"./chunk-TBMJSIBB.js";var e=function(t){return t.idle="idle",t.downloading="downloading",t.installing="installing",t.completed="completed",t.failed="failed",t}(e||{});var p=u(h());function m(){return typeof window.Capacitor<"u"&&window.Capacitor.isNativePlatform?.()===!0}function w(){let a=window.Capacitor?.Plugins?.AppUpdater;return a||null}var y=(()=>{class t{versionCheck_CS=l(c);downloadUrl=d.api.baseUrl+"/mobile/download";phase_$=o(e.idle);lastError_$=o("");startUpdate(){return r(this,null,function*(){let n=this.phase_$();if(!(n===e.downloading||n===e.installing)){this.lastError_$.set(""),this.phase_$.set(e.downloading);try{let i=w();if(i){this.phase_$.set(e.installing),yield i.downloadAndInstall({downloadUrl:this.downloadUrl}),this.phase_$.set(e.completed);return}this.openInSystemBrowser(this.downloadUrl),this.phase_$.set(e.completed)}catch(i){let f=i instanceof Error?i.message:String(i);this.lastError_$.set(f),this.phase_$.set(e.failed),p.DyFM_Error.logSimple("CCAP_MobileAppUpdater | startUpdate failed",i)}}})}autoUpdateIfAvailable(){return r(this,null,function*(){m()&&(yield this.versionCheck_CS.checkNow(),this.versionCheck_CS.updateAvailable_$()&&(yield this.startUpdate()))})}openInSystemBrowser(n){window.open(n,"_system")}static \u0275fac=function(i){return new(i||t)};static \u0275prov=s({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{e as a,y as b};
2
+ //# sourceMappingURL=chunk-P3UG3XEN.js.map