@futdevpro/ccap 1.1.3496 → 1.1.3503

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 (192) hide show
  1. package/client-dist/{agent-instances.module-X7U4LOQ5.js → agent-instances.module-UYD2XYZE.js} +2 -2
  2. package/client-dist/{ca.module-OVAHP3JS.js → ca.module-3CDQXCAY.js} +2 -2
  3. package/client-dist/{cc-usage-dashboard.component-3MOL2EMW.js → cc-usage-dashboard.component-MGVQCZUN.js} +2 -2
  4. package/client-dist/{cc.module-VBMRNILG.js → cc.module-BFN6BZIN.js} +2 -2
  5. package/client-dist/{chunk-MNLTOLQZ.js → chunk-27RTDRPJ.js} +2 -2
  6. package/client-dist/{chunk-6RWGMVJZ.js → chunk-2UN7HPVU.js} +2 -2
  7. package/client-dist/{chunk-LNVYS2CJ.js → chunk-32QSFPDR.js} +2 -2
  8. package/client-dist/{chunk-5WVPI5OK.js → chunk-32WW5HVW.js} +2 -2
  9. package/client-dist/{chunk-OUKRDBHU.js → chunk-45RYB36M.js} +2 -2
  10. package/client-dist/{chunk-GD5VHVVJ.js → chunk-4J5DWAPO.js} +2 -2
  11. package/client-dist/{chunk-VCQSQGOX.js → chunk-4VX4P4Q3.js} +2 -2
  12. package/client-dist/{chunk-UA5AFKEY.js → chunk-55LHNHV7.js} +2 -2
  13. package/client-dist/{chunk-5PXAAX3K.js → chunk-5APAM7YJ.js} +2 -2
  14. package/client-dist/{chunk-5PXAAX3K.js.map → chunk-5APAM7YJ.js.map} +1 -1
  15. package/client-dist/{chunk-2K34XAEU.js → chunk-5QAKXYWT.js} +2 -2
  16. package/client-dist/{chunk-ELBTQT2G.js → chunk-6D27TSZV.js} +2 -2
  17. package/client-dist/{chunk-NQ43KQRC.js → chunk-7MDPIWHS.js} +2 -2
  18. package/client-dist/{chunk-636DWHTZ.js → chunk-7NW27ZEP.js} +2 -2
  19. package/client-dist/{chunk-MRL54K52.js → chunk-7QLE2HOD.js} +2 -2
  20. package/client-dist/{chunk-HLKWWOCX.js → chunk-ADKAF2LM.js} +2 -2
  21. package/client-dist/{chunk-WAFES4NR.js → chunk-BGZFNZ2C.js} +2 -2
  22. package/client-dist/{chunk-NXBTW2AM.js → chunk-C2XSLL34.js} +2 -2
  23. package/client-dist/{chunk-F3FV3SOO.js → chunk-CZTIPDFA.js} +2 -2
  24. package/client-dist/{chunk-7SZOLOA4.js → chunk-E65UDGDD.js} +2 -2
  25. package/client-dist/{chunk-AYRVFADA.js → chunk-EFNJA3BL.js} +2 -2
  26. package/client-dist/{chunk-5FUXSI2Y.js → chunk-EUOPIQ5M.js} +2 -2
  27. package/client-dist/{chunk-3AKYVQFR.js → chunk-FIEFWNJ6.js} +2 -2
  28. package/client-dist/{chunk-DHP23DA2.js → chunk-FJ4AQ7DJ.js} +2 -2
  29. package/client-dist/{chunk-UXZMJ3RD.js → chunk-FTD33PGM.js} +2 -2
  30. package/client-dist/{chunk-EDA2QDUR.js → chunk-G67NI7SB.js} +2 -2
  31. package/client-dist/{chunk-DOEUSIDX.js → chunk-GIL5OROM.js} +2 -2
  32. package/client-dist/{chunk-UKAFB4DE.js → chunk-GIOHSC4G.js} +2 -2
  33. package/client-dist/{chunk-FEJKBT6M.js → chunk-GWK7XTQP.js} +2 -2
  34. package/client-dist/{chunk-WWVWBDY4.js → chunk-IZEUWGJK.js} +2 -2
  35. package/client-dist/{chunk-DADSRDUH.js → chunk-JJGA6W5B.js} +2 -2
  36. package/client-dist/{chunk-MKM6YALC.js → chunk-JU3RXVDX.js} +2 -2
  37. package/client-dist/{chunk-R6C53TBY.js → chunk-JV5HX5WS.js} +2 -2
  38. package/client-dist/{chunk-FOX5TCWN.js → chunk-JZMWWTFG.js} +2 -2
  39. package/client-dist/{chunk-E7BWLAFR.js → chunk-KOC4SVZ5.js} +2 -2
  40. package/client-dist/{chunk-LMDCKD73.js → chunk-KRHX46JK.js} +2 -2
  41. package/client-dist/{chunk-RCYNHOVP.js → chunk-MFTEXAIX.js} +2 -2
  42. package/client-dist/{chunk-U35DT4S7.js → chunk-MZ3YYQWQ.js} +2 -2
  43. package/client-dist/{chunk-Y2G6YG4Y.js → chunk-N7EJNOHR.js} +2 -2
  44. package/client-dist/{chunk-MCDO453Y.js → chunk-NOL3YONA.js} +2 -2
  45. package/client-dist/{chunk-C5O7O7TL.js → chunk-OMWHFGY6.js} +2 -2
  46. package/client-dist/{chunk-C4GAEXKQ.js → chunk-ORUMPAIH.js} +2 -2
  47. package/client-dist/{chunk-BBKB5QCB.js → chunk-OZ3TFPBG.js} +2 -2
  48. package/client-dist/{chunk-XQPGIUGR.js → chunk-QAT6LVRB.js} +2 -2
  49. package/client-dist/{chunk-Q2GH4G66.js → chunk-QKJHPKSW.js} +2 -2
  50. package/client-dist/chunk-QP4ANIRB.js +2 -0
  51. package/client-dist/{chunk-KRH7QV2N.js.map → chunk-QP4ANIRB.js.map} +3 -3
  52. package/client-dist/{chunk-5I674QUM.js → chunk-QRLOYIIN.js} +2 -2
  53. package/client-dist/{chunk-E55IKBIN.js → chunk-RW5UDPYM.js} +2 -2
  54. package/client-dist/{chunk-UTGG7NEB.js → chunk-SPUD4EJ3.js} +2 -2
  55. package/client-dist/{chunk-V6CGIE5N.js → chunk-TEX5KB4S.js} +2 -2
  56. package/client-dist/{chunk-IN7IV33W.js → chunk-VFQYSWYJ.js} +2 -2
  57. package/client-dist/{chunk-5VBTL72N.js → chunk-VNUSAOT6.js} +2 -2
  58. package/client-dist/{chunk-RHQ75EUO.js → chunk-VRW33XBA.js} +2 -2
  59. package/client-dist/{chunk-Y7RQWADJ.js → chunk-WZGZ4B4R.js} +2 -2
  60. package/client-dist/{chunk-RRCL7OCF.js → chunk-XQESPKDR.js} +2 -2
  61. package/client-dist/{chunk-FGFGLDML.js → chunk-YMTP6F2C.js} +2 -2
  62. package/client-dist/{chunk-ARFG3EJ2.js → chunk-Z3Y2VOXP.js} +2 -2
  63. package/client-dist/{chunk-B4RZAN5F.js → chunk-ZFOQPLZY.js} +2 -2
  64. package/client-dist/{consultant.module-7TSAWZUO.js → consultant.module-MXCBA6UI.js} +2 -2
  65. package/client-dist/{crd.module-D6RNAOAZ.js → crd.module-PGOP7A3H.js} +2 -2
  66. package/client-dist/{dashboard.module-W7TEQTRX.js → dashboard.module-YAWOK3X4.js} +2 -2
  67. package/client-dist/{do.module-HQ35HKER.js → do.module-YPKXT2VE.js} +2 -2
  68. package/client-dist/{document-library.module-47WOC5DZ.js → document-library.module-47UIYBBS.js} +2 -2
  69. package/client-dist/{embedding-eval.module-ECHVBX3X.js → embedding-eval.module-ZFEAXH6R.js} +2 -2
  70. package/client-dist/{embedding-registry.module-2ZZYZ6YN.js → embedding-registry.module-CX6ONIEM.js} +2 -2
  71. package/client-dist/{err.module-XNZWO7CL.js → err.module-2WOMSH46.js} +2 -2
  72. package/client-dist/{feedback.module-34CGK66K.js → feedback.module-KVOQQYW7.js} +2 -2
  73. package/client-dist/{host-runtime-mcp.module-M5CKSPTF.js → host-runtime-mcp.module-76HVPG4X.js} +2 -2
  74. package/client-dist/index.html +1 -1
  75. package/client-dist/{live-dev-pipeline.module-RSFYW5H2.js → live-dev-pipeline.module-ZNMPF3BA.js} +2 -2
  76. package/client-dist/{logs.module-RTKNBXRE.js → logs.module-N37FMRF3.js} +2 -2
  77. package/client-dist/{main-A2OFMAWM.js → main-CCBBKAON.js} +3 -3
  78. package/client-dist/{master-control-remote-poc.module-OG47OAWK.js → master-control-remote-poc.module-N65RQBOH.js} +2 -2
  79. package/client-dist/{mobile-app.module-7KZFRNEJ.js → mobile-app.module-SFHXH642.js} +2 -2
  80. package/client-dist/{model-registry.module-2G6PC775.js → model-registry.module-QHKLMBXO.js} +2 -2
  81. package/client-dist/{oc.module-JVVX34OJ.js → oc.module-JGV3IDGY.js} +2 -2
  82. package/client-dist/{orc.module-UYIFFI26.js → orc.module-VZ5XW5KW.js} +2 -2
  83. package/client-dist/{project-management.module-5YLXYNRF.js → project-management.module-DL4TUNDP.js} +2 -2
  84. package/client-dist/project-source-routed.module-G3PDOXVT.js +2 -0
  85. package/client-dist/{scheduler.module-A2SYUA6U.js → scheduler.module-Q3SJSC4T.js} +2 -2
  86. package/client-dist/{session.module-G5AEROTS.js → session.module-U2IP5J2B.js} +2 -2
  87. package/client-dist/{set.module-D2RFHZ6W.js → set.module-GTMFMOEB.js} +2 -2
  88. package/client-dist/{setup.module-JROPEOGJ.js → setup.module-4TXUKI27.js} +2 -2
  89. package/client-dist/{terminals.module-UT2PTW42.js → terminals.module-W3ZC3EEB.js} +2 -2
  90. package/client-dist/{voice-notes-poc.module-FTEN7ZSY.js → voice-notes-poc.module-WV4DMW3S.js} +2 -2
  91. package/client-dist/{wfs.module-QK7AKGH2.js → wfs.module-GIXOJHRJ.js} +2 -2
  92. package/package.json +1 -1
  93. package/server/build/src/_modules/ccap-agent/_modules/ccap-sessions/_services/ccap-sessions.control-service.d.ts +7 -0
  94. package/server/build/src/_modules/ccap-agent/_modules/ccap-sessions/_services/ccap-sessions.control-service.d.ts.map +1 -1
  95. package/server/build/src/_modules/ccap-agent/_modules/ccap-sessions/_services/ccap-sessions.control-service.js +22 -0
  96. package/server/build/src/_modules/ccap-agent/_modules/ccap-sessions/_services/ccap-sessions.control-service.js.map +1 -1
  97. package/server/build/src/_modules/ccap-agent/_modules/ccap-sessions/_services/ccap-sessions.control-service.spec.js +24 -0
  98. package/server/build/src/_modules/ccap-agent/_modules/ccap-sessions/_services/ccap-sessions.control-service.spec.js.map +1 -1
  99. package/server/build/src/_modules/ccap-agent/_modules/ccap-sessions/_services/ccap-sessions.data-service.d.ts +1 -0
  100. package/server/build/src/_modules/ccap-agent/_modules/ccap-sessions/_services/ccap-sessions.data-service.d.ts.map +1 -1
  101. package/server/build/src/_modules/ccap-agent/_modules/ccap-sessions/_services/ccap-sessions.data-service.js +12 -0
  102. package/server/build/src/_modules/ccap-agent/_modules/ccap-sessions/_services/ccap-sessions.data-service.js.map +1 -1
  103. package/server/build/src/_modules/ccap-agent/_modules/tools/_models/interfaces/llm-tools/tool-schema/tool-result/tls-tool-execution-context.interface.d.ts +8 -0
  104. package/server/build/src/_modules/ccap-agent/_modules/tools/_models/interfaces/llm-tools/tool-schema/tool-result/tls-tool-execution-context.interface.d.ts.map +1 -1
  105. package/client-dist/chunk-KRH7QV2N.js +0 -2
  106. package/client-dist/project-source-routed.module-QKDDJUNB.js +0 -2
  107. /package/client-dist/{agent-instances.module-X7U4LOQ5.js.map → agent-instances.module-UYD2XYZE.js.map} +0 -0
  108. /package/client-dist/{ca.module-OVAHP3JS.js.map → ca.module-3CDQXCAY.js.map} +0 -0
  109. /package/client-dist/{cc-usage-dashboard.component-3MOL2EMW.js.map → cc-usage-dashboard.component-MGVQCZUN.js.map} +0 -0
  110. /package/client-dist/{cc.module-VBMRNILG.js.map → cc.module-BFN6BZIN.js.map} +0 -0
  111. /package/client-dist/{chunk-MNLTOLQZ.js.map → chunk-27RTDRPJ.js.map} +0 -0
  112. /package/client-dist/{chunk-6RWGMVJZ.js.map → chunk-2UN7HPVU.js.map} +0 -0
  113. /package/client-dist/{chunk-LNVYS2CJ.js.map → chunk-32QSFPDR.js.map} +0 -0
  114. /package/client-dist/{chunk-5WVPI5OK.js.map → chunk-32WW5HVW.js.map} +0 -0
  115. /package/client-dist/{chunk-OUKRDBHU.js.map → chunk-45RYB36M.js.map} +0 -0
  116. /package/client-dist/{chunk-GD5VHVVJ.js.map → chunk-4J5DWAPO.js.map} +0 -0
  117. /package/client-dist/{chunk-VCQSQGOX.js.map → chunk-4VX4P4Q3.js.map} +0 -0
  118. /package/client-dist/{chunk-UA5AFKEY.js.map → chunk-55LHNHV7.js.map} +0 -0
  119. /package/client-dist/{chunk-2K34XAEU.js.map → chunk-5QAKXYWT.js.map} +0 -0
  120. /package/client-dist/{chunk-ELBTQT2G.js.map → chunk-6D27TSZV.js.map} +0 -0
  121. /package/client-dist/{chunk-NQ43KQRC.js.map → chunk-7MDPIWHS.js.map} +0 -0
  122. /package/client-dist/{chunk-636DWHTZ.js.map → chunk-7NW27ZEP.js.map} +0 -0
  123. /package/client-dist/{chunk-MRL54K52.js.map → chunk-7QLE2HOD.js.map} +0 -0
  124. /package/client-dist/{chunk-HLKWWOCX.js.map → chunk-ADKAF2LM.js.map} +0 -0
  125. /package/client-dist/{chunk-WAFES4NR.js.map → chunk-BGZFNZ2C.js.map} +0 -0
  126. /package/client-dist/{chunk-NXBTW2AM.js.map → chunk-C2XSLL34.js.map} +0 -0
  127. /package/client-dist/{chunk-F3FV3SOO.js.map → chunk-CZTIPDFA.js.map} +0 -0
  128. /package/client-dist/{chunk-7SZOLOA4.js.map → chunk-E65UDGDD.js.map} +0 -0
  129. /package/client-dist/{chunk-AYRVFADA.js.map → chunk-EFNJA3BL.js.map} +0 -0
  130. /package/client-dist/{chunk-5FUXSI2Y.js.map → chunk-EUOPIQ5M.js.map} +0 -0
  131. /package/client-dist/{chunk-3AKYVQFR.js.map → chunk-FIEFWNJ6.js.map} +0 -0
  132. /package/client-dist/{chunk-DHP23DA2.js.map → chunk-FJ4AQ7DJ.js.map} +0 -0
  133. /package/client-dist/{chunk-UXZMJ3RD.js.map → chunk-FTD33PGM.js.map} +0 -0
  134. /package/client-dist/{chunk-EDA2QDUR.js.map → chunk-G67NI7SB.js.map} +0 -0
  135. /package/client-dist/{chunk-DOEUSIDX.js.map → chunk-GIL5OROM.js.map} +0 -0
  136. /package/client-dist/{chunk-UKAFB4DE.js.map → chunk-GIOHSC4G.js.map} +0 -0
  137. /package/client-dist/{chunk-FEJKBT6M.js.map → chunk-GWK7XTQP.js.map} +0 -0
  138. /package/client-dist/{chunk-WWVWBDY4.js.map → chunk-IZEUWGJK.js.map} +0 -0
  139. /package/client-dist/{chunk-DADSRDUH.js.map → chunk-JJGA6W5B.js.map} +0 -0
  140. /package/client-dist/{chunk-MKM6YALC.js.map → chunk-JU3RXVDX.js.map} +0 -0
  141. /package/client-dist/{chunk-R6C53TBY.js.map → chunk-JV5HX5WS.js.map} +0 -0
  142. /package/client-dist/{chunk-FOX5TCWN.js.map → chunk-JZMWWTFG.js.map} +0 -0
  143. /package/client-dist/{chunk-E7BWLAFR.js.map → chunk-KOC4SVZ5.js.map} +0 -0
  144. /package/client-dist/{chunk-LMDCKD73.js.map → chunk-KRHX46JK.js.map} +0 -0
  145. /package/client-dist/{chunk-RCYNHOVP.js.map → chunk-MFTEXAIX.js.map} +0 -0
  146. /package/client-dist/{chunk-U35DT4S7.js.map → chunk-MZ3YYQWQ.js.map} +0 -0
  147. /package/client-dist/{chunk-Y2G6YG4Y.js.map → chunk-N7EJNOHR.js.map} +0 -0
  148. /package/client-dist/{chunk-MCDO453Y.js.map → chunk-NOL3YONA.js.map} +0 -0
  149. /package/client-dist/{chunk-C5O7O7TL.js.map → chunk-OMWHFGY6.js.map} +0 -0
  150. /package/client-dist/{chunk-C4GAEXKQ.js.map → chunk-ORUMPAIH.js.map} +0 -0
  151. /package/client-dist/{chunk-BBKB5QCB.js.map → chunk-OZ3TFPBG.js.map} +0 -0
  152. /package/client-dist/{chunk-XQPGIUGR.js.map → chunk-QAT6LVRB.js.map} +0 -0
  153. /package/client-dist/{chunk-Q2GH4G66.js.map → chunk-QKJHPKSW.js.map} +0 -0
  154. /package/client-dist/{chunk-5I674QUM.js.map → chunk-QRLOYIIN.js.map} +0 -0
  155. /package/client-dist/{chunk-E55IKBIN.js.map → chunk-RW5UDPYM.js.map} +0 -0
  156. /package/client-dist/{chunk-UTGG7NEB.js.map → chunk-SPUD4EJ3.js.map} +0 -0
  157. /package/client-dist/{chunk-V6CGIE5N.js.map → chunk-TEX5KB4S.js.map} +0 -0
  158. /package/client-dist/{chunk-IN7IV33W.js.map → chunk-VFQYSWYJ.js.map} +0 -0
  159. /package/client-dist/{chunk-5VBTL72N.js.map → chunk-VNUSAOT6.js.map} +0 -0
  160. /package/client-dist/{chunk-RHQ75EUO.js.map → chunk-VRW33XBA.js.map} +0 -0
  161. /package/client-dist/{chunk-Y7RQWADJ.js.map → chunk-WZGZ4B4R.js.map} +0 -0
  162. /package/client-dist/{chunk-RRCL7OCF.js.map → chunk-XQESPKDR.js.map} +0 -0
  163. /package/client-dist/{chunk-FGFGLDML.js.map → chunk-YMTP6F2C.js.map} +0 -0
  164. /package/client-dist/{chunk-ARFG3EJ2.js.map → chunk-Z3Y2VOXP.js.map} +0 -0
  165. /package/client-dist/{chunk-B4RZAN5F.js.map → chunk-ZFOQPLZY.js.map} +0 -0
  166. /package/client-dist/{consultant.module-7TSAWZUO.js.map → consultant.module-MXCBA6UI.js.map} +0 -0
  167. /package/client-dist/{crd.module-D6RNAOAZ.js.map → crd.module-PGOP7A3H.js.map} +0 -0
  168. /package/client-dist/{dashboard.module-W7TEQTRX.js.map → dashboard.module-YAWOK3X4.js.map} +0 -0
  169. /package/client-dist/{do.module-HQ35HKER.js.map → do.module-YPKXT2VE.js.map} +0 -0
  170. /package/client-dist/{document-library.module-47WOC5DZ.js.map → document-library.module-47UIYBBS.js.map} +0 -0
  171. /package/client-dist/{embedding-eval.module-ECHVBX3X.js.map → embedding-eval.module-ZFEAXH6R.js.map} +0 -0
  172. /package/client-dist/{embedding-registry.module-2ZZYZ6YN.js.map → embedding-registry.module-CX6ONIEM.js.map} +0 -0
  173. /package/client-dist/{err.module-XNZWO7CL.js.map → err.module-2WOMSH46.js.map} +0 -0
  174. /package/client-dist/{feedback.module-34CGK66K.js.map → feedback.module-KVOQQYW7.js.map} +0 -0
  175. /package/client-dist/{host-runtime-mcp.module-M5CKSPTF.js.map → host-runtime-mcp.module-76HVPG4X.js.map} +0 -0
  176. /package/client-dist/{live-dev-pipeline.module-RSFYW5H2.js.map → live-dev-pipeline.module-ZNMPF3BA.js.map} +0 -0
  177. /package/client-dist/{logs.module-RTKNBXRE.js.map → logs.module-N37FMRF3.js.map} +0 -0
  178. /package/client-dist/{main-A2OFMAWM.js.map → main-CCBBKAON.js.map} +0 -0
  179. /package/client-dist/{master-control-remote-poc.module-OG47OAWK.js.map → master-control-remote-poc.module-N65RQBOH.js.map} +0 -0
  180. /package/client-dist/{mobile-app.module-7KZFRNEJ.js.map → mobile-app.module-SFHXH642.js.map} +0 -0
  181. /package/client-dist/{model-registry.module-2G6PC775.js.map → model-registry.module-QHKLMBXO.js.map} +0 -0
  182. /package/client-dist/{oc.module-JVVX34OJ.js.map → oc.module-JGV3IDGY.js.map} +0 -0
  183. /package/client-dist/{orc.module-UYIFFI26.js.map → orc.module-VZ5XW5KW.js.map} +0 -0
  184. /package/client-dist/{project-management.module-5YLXYNRF.js.map → project-management.module-DL4TUNDP.js.map} +0 -0
  185. /package/client-dist/{project-source-routed.module-QKDDJUNB.js.map → project-source-routed.module-G3PDOXVT.js.map} +0 -0
  186. /package/client-dist/{scheduler.module-A2SYUA6U.js.map → scheduler.module-Q3SJSC4T.js.map} +0 -0
  187. /package/client-dist/{session.module-G5AEROTS.js.map → session.module-U2IP5J2B.js.map} +0 -0
  188. /package/client-dist/{set.module-D2RFHZ6W.js.map → set.module-GTMFMOEB.js.map} +0 -0
  189. /package/client-dist/{setup.module-JROPEOGJ.js.map → setup.module-4TXUKI27.js.map} +0 -0
  190. /package/client-dist/{terminals.module-UT2PTW42.js.map → terminals.module-W3ZC3EEB.js.map} +0 -0
  191. /package/client-dist/{voice-notes-poc.module-FTEN7ZSY.js.map → voice-notes-poc.module-WV4DMW3S.js.map} +0 -0
  192. /package/client-dist/{wfs.module-QK7AKGH2.js.map → wfs.module-GIXOJHRJ.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{a as Wt,b as Fe}from"./chunk-FEJKBT6M.js";import{a as pe,b as Le,c as Bt,d as Nt,e as Oe,f as zt}from"./chunk-5FUXSI2Y.js";import{a as ve,b as _e,c as me,d as Ut}from"./chunk-FGFGLDML.js";import{a as jt}from"./chunk-G5SK3OBM.js";import{a as Re}from"./chunk-UXZMJ3RD.js";import{a as Ve}from"./chunk-7SZOLOA4.js";import{a as be}from"./chunk-Q2PKIGLB.js";import{a as It}from"./chunk-HLKWWOCX.js";import{a as H}from"./chunk-RHQ75EUO.js";import{a as Je}from"./chunk-YRVQSWSZ.js";import{a as kt}from"./chunk-IN7IV33W.js";import{a as $t,b as Ae}from"./chunk-Y2G6YG4Y.js";import"./chunk-2K34XAEU.js";import"./chunk-WWVWBDY4.js";import"./chunk-L44637OO.js";import"./chunk-6RWGMVJZ.js";import"./chunk-UFBTR2BG.js";import{a as de}from"./chunk-AYRVFADA.js";import"./chunk-ELBTQT2G.js";import"./chunk-5I674QUM.js";import"./chunk-LNVYS2CJ.js";import{e as Lt,f as Ot,g as Ft}from"./chunk-E7BWLAFR.js";import"./chunk-WAFES4NR.js";import{a as Pt}from"./chunk-7JUIBZEE.js";import{a as At,b as Mt,c as Vt}from"./chunk-C7XPBJTG.js";import{a as Xe,b as j,c as Ye,f as Rt}from"./chunk-NQ43KQRC.js";import"./chunk-WPHEQXWB.js";import{a as Dt,c as Et}from"./chunk-DADSRDUH.js";import{b as Me,c as Pe}from"./chunk-OUKRDBHU.js";import"./chunk-B4RZAN5F.js";import"./chunk-NXBTW2AM.js";import"./chunk-Q2NVIOCY.js";import{a as ce}from"./chunk-XOGAYT52.js";import"./chunk-E55IKBIN.js";import"./chunk-5VBTL72N.js";import"./chunk-LMDCKD73.js";import"./chunk-V3VQWJQL.js";import"./chunk-XQPGIUGR.js";import"./chunk-ARFG3EJ2.js";import"./chunk-ZBTWQZNB.js";import{a as ee}from"./chunk-FLAJXIYW.js";import{c as gt,f as St,i as bt,n as vt,o as wt,p as yt,v as Tt}from"./chunk-EO4DNTT4.js";import"./chunk-Y7RQWADJ.js";import{a as R}from"./chunk-5UPNU54P.js";import{j as le}from"./chunk-FOX5TCWN.js";import{p as Ct}from"./chunk-5PXAAX3K.js";import{$a as F,Aa as fe,Ba as he,C as D,Cb as Ee,D as B,E as it,Ea as ge,Eb as xt,Fa as d,Fb as ft,G as se,Ga as k,Gb as re,Ha as $,Ia as Y,J as u,K as C,Kb as ht,L as E,M as L,N as ot,Pa as Se,Qa as rt,Ra as Ie,T as ke,Ta as ae,U as K,Va as Ge,W as J,Xa as lt,Z as a,_ as st,a as He,aa as v,ab as U,b as qe,bb as dt,ca as at,da as x,db as ct,fa as Ce,ga as b,h as et,ha as $e,hb as A,ia as X,ib as pt,ja as O,jb as De,k as V,la as m,ma as Ke,mb as Q,oa as N,ob as _t,pa as z,pb as mt,qa as o,qb as ut,ra as s,sa as g,ta as Qe,ua as y,ub as Z,va as f,wa as c,y as tt,z as nt,za as xe}from"./chunk-TBMJSIBB.js";function _n(t,r){if(t&1&&(o(0,"span",9),d(1),s()),t&2){let e=c().$implicit;a(),$(" ",e.header," ")}}function mn(t,r){t&1&&(E(),o(0,"svg",19),g(1,"path",20),s())}function un(t,r){if(t&1&&(o(0,"span",18),x(1,mn,2,0,":svg:svg",19),s()),t&2){let e=c().$index,i=c(2).$index,n=c(2);X("bg-orange-500",n.isOptionSelected(i,e))("border-orange-500",n.isOptionSelected(i,e))("border-neutral-500",!n.isOptionSelected(i,e)),a(),m(n.isOptionSelected(i,e)?1:-1)}}function Cn(t,r){t&1&&g(0,"span",22)}function xn(t,r){if(t&1&&(o(0,"span",21),x(1,Cn,1,0,"span",22),s()),t&2){let e=c().$index,i=c(2).$index,n=c(2);X("border-orange-500",n.isOptionSelected(i,e))("border-neutral-500",!n.isOptionSelected(i,e)),a(),m(n.isOptionSelected(i,e)?1:-1)}}function fn(t,r){if(t&1&&(o(0,"span",17),d(1),s()),t&2){let e=c().$implicit;a(),$(" ",e.description," ")}}function hn(t,r){if(t&1){let e=y();o(0,"li")(1,"button",12),f("click",function(){let n=u(e).$index,l=c(2),p=l.$implicit,_=l.$index,w=c(2);return C(w.handleOptionToggle(_,n,p.multiSelect))}),x(2,un,2,7,"span",13)(3,xn,2,5,"span",14),o(4,"span",15)(5,"span",16),d(6),s(),x(7,fn,2,1,"span",17),s()()()}if(t&2){let e=r.$implicit,i=r.$index,n=c(2),l=n.$implicit,p=n.$index,_=c(2);a(),b("ngClass",_.isOptionSelected(p,i)?"bg-orange-500/10 border-orange-500/45":"bg-neutral-900/40 border-neutral-700/60 hover:bg-orange-500/10 hover:border-orange-500/30"),a(),m(l.multiSelect?2:3),a(4),$(" ",e.label," "),a(),m(e.description?7:-1)}}function gn(t,r){if(t&1&&(o(0,"ul",11),N(1,hn,8,4,"li",null,Ke),s()),t&2){let e=c().$implicit;a(),z(e.options)}}function Sn(t,r){if(t&1&&(o(0,"div",1)(1,"div",8),x(2,_n,2,1,"span",9),o(3,"span",10),d(4),s()(),x(5,gn,3,0,"ul",11),s()),t&2){let e=r.$implicit;a(2),m(e.header?2:-1),a(2),$(" ",e.question," "),a(),m(e.options.length>0?5:-1)}}function bn(t,r){if(t&1&&(o(0,"div",0),N(1,Sn,6,3,"div",1,Ke),o(3,"div",2),E(),o(4,"svg",3),g(5,"circle",4)(6,"path",5)(7,"path",6),s(),L(),o(8,"span",7),d(9," Answer-submit not yet wired \u2014 type your choice in the CC input below. "),s()()()),t&2){let e=c();a(),z(e.questions_$())}}var Ue=(()=>{class t{rawData=K(void 0);selections_$=v(new Map);questions_$=A(()=>{let e=this.rawData();if(!e)return[];let i=e.input;if(!i||typeof i!="object")return[];let n=i.questions;return Array.isArray(n)?n.map(l=>t.parseQuestion(l)).filter(l=>l!==null):[]});handleOptionToggle(e,i,n){this.selections_$.update(l=>{let p=new Map(l),_=new Set(p.get(e)??[]);return n?_.has(i)?_.delete(i):_.add(i):_.has(i)&&_.size===1||(_.clear(),_.add(i)),p.set(e,_),p})}isOptionSelected(e,i){return this.selections_$().get(e)?.has(i)??!1}static parseQuestion(e){if(!e||typeof e!="object")return null;let i=e,n=typeof i.question=="string"?i.question:"";if(!n)return null;let l=typeof i.header=="string"?i.header:"",p=i.multiSelect===!0,_=i.options,w=Array.isArray(_)?_.map(h=>t.parseOption(h)).filter(h=>h!==null):[];return{question:n,header:l,multiSelect:p,options:w}}static parseOption(e){if(!e||typeof e!="object")return null;let i=e,n=typeof i.label=="string"?i.label:"";if(!n)return null;let l=typeof i.description=="string"?i.description:"";return{label:n,description:l}}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-s-agent-tool-ask-user-question"]],hostAttrs:[1,"block"],inputs:{rawData:[1,"rawData"]},standalone:!0,features:[ae],decls:1,vars:1,consts:[[1,"px-2.5","py-2","space-y-3"],[1,"space-y-1.5"],[1,"flex","items-center","gap-1.5","px-2","py-1","rounded-md","bg-neutral-800/50","border","border-neutral-700/60"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","text-neutral-400","shrink-0"],["cx","8","cy","8","r","6"],["d","M8 5.5v3"],["d","M8 10.5h.01"],[1,"text-[10px]","sm:text-[11px]","text-neutral-400","leading-snug"],[1,"flex","items-start","gap-2","flex-wrap"],[1,"inline-flex","items-center","px-1.5","py-0.5","rounded","text-[10px]","font-medium","bg-orange-500/15","border","border-orange-500/30","text-orange-300","shrink-0","mt-0.5"],[1,"text-xs","sm:text-sm","text-neutral-200","font-medium","leading-snug"],[1,"space-y-1","pl-0.5"],["type","button",1,"w-full","flex","items-start","gap-2","px-2","py-1.5","rounded-md","border","text-left","transition-colors","cursor-pointer",3,"click","ngClass"],[1,"shrink-0","mt-0.5","w-3.5","h-3.5","rounded-sm","border","flex","items-center","justify-center",3,"bg-orange-500","border-orange-500","border-neutral-500"],[1,"shrink-0","mt-0.5","w-3.5","h-3.5","rounded-full","border","flex","items-center","justify-center",3,"border-orange-500","border-neutral-500"],[1,"min-w-0","flex-1"],[1,"block","text-xs","text-neutral-200","font-medium","leading-snug"],[1,"block","text-[11px]","text-neutral-400","leading-snug","mt-0.5"],[1,"shrink-0","mt-0.5","w-3.5","h-3.5","rounded-sm","border","flex","items-center","justify-center"],["viewBox","0 0 12 12","fill","none","stroke","currentColor","stroke-width","2.5","stroke-linecap","round","stroke-linejoin","round",1,"w-2.5","h-2.5","text-neutral-900"],["d","M2.5 6.5l2.5 2.5L9.5 3.5"],[1,"shrink-0","mt-0.5","w-3.5","h-3.5","rounded-full","border","flex","items-center","justify-center"],[1,"w-1.5","h-1.5","rounded-full","bg-orange-500"]],template:function(i,n){i&1&&x(0,bn,10,0,"div",0),i&2&&m(n.questions_$().length>0?0:-1)},dependencies:[Z,Q],encapsulation:2})}return t})();function wn(t,r){t&1&&(o(0,"div",3),E(),o(1,"svg",5),g(2,"path",6),s(),L(),o(3,"span",7),d(4,"Plan accepted"),s()())}function yn(t,r){if(t&1){let e=y();o(0,"button",8),f("click",function(){u(e);let n=c(2);return C(n.handleAccept())}),E(),o(1,"svg",9),g(2,"path",6),s(),d(3," Accept plan "),s()}}function Tn(t,r){if(t&1){let e=y();o(0,"div",0)(1,"div",1),f("click",function(n){u(e);let l=c();return C(l.handleAssistantMdClick(n))}),s(),o(2,"div",2),x(3,wn,5,0,"div",3)(4,yn,4,0,"button",4),s()()}if(t&2){let e=c();a(),b("innerHTML",r,J),a(2),m(e.isAccepted_$()?3:4)}}var je=(()=>{class t{sanitizer=D(Ee);globalError_CS=D(le);rawData=K(void 0);accepted=ke();isAccepted_$=v(!1);planText_$=A(()=>{let e=this.rawData();if(!e)return"";let i=e.input;if(!i||typeof i!="object")return"";let n=i.plan;return typeof n=="string"?n:""});planHtml_$=A(()=>{let e=this.planText_$();if(!e)return null;let i=Xe.toSanitizedHtml(e);return this.sanitizer.bypassSecurityTrustHtml(i)});handleAccept(){this.isAccepted_$()||(this.isAccepted_$.set(!0),this.accepted.emit())}handleAssistantMdClick(e){return V(this,null,function*(){yield Xe.handleCodeCopyClick(e,i=>this.globalError_CS.copyToClipboard(i))})}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-s-agent-tool-plan-view"]],hostAttrs:[1,"block"],inputs:{rawData:[1,"rawData"]},outputs:{accepted:"accepted"},standalone:!0,features:[ae],decls:1,vars:1,consts:[[1,"px-2.5","py-2","space-y-2"],[1,"ccap-assistant-md","leading-snug","sm:leading-normal","break-words","text-neutral-200","text-xs","sm:text-sm","min-w-0","max-h-[400px]","overflow-y-auto","overflow-x-auto","pr-1",3,"click","innerHTML"],[1,"flex","justify-end","pt-1","border-t","border-orange-500/10"],[1,"inline-flex","items-center","gap-1.5","px-3","py-1","rounded-md","bg-green-500/10","border","border-green-500/25"],["type","button",1,"inline-flex","items-center","gap-1.5","px-3","py-1","rounded-md","bg-ccapAccent/10","border","border-ccapAccent/30","text-ccapAccent","text-[11px]","font-medium","cursor-pointer","hover:bg-ccapAccent/20","hover:border-ccapAccent/50","transition-colors"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","text-green-400"],["d","M3.5 8.5l3 3 6-6"],[1,"text-[11px]","text-green-400","font-medium"],["type","button",1,"inline-flex","items-center","gap-1.5","px-3","py-1","rounded-md","bg-ccapAccent/10","border","border-ccapAccent/30","text-ccapAccent","text-[11px]","font-medium","cursor-pointer","hover:bg-ccapAccent/20","hover:border-ccapAccent/50","transition-colors",3,"click"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5"]],template:function(i,n){if(i&1&&x(0,Tn,5,2,"div",0),i&2){let l;m((l=n.planHtml_$())?0:-1,l)}},dependencies:[Z],styles:[`@charset "UTF-8";
1
+ import{a as Wt,b as Fe}from"./chunk-GWK7XTQP.js";import{a as pe,b as Le,c as Bt,d as Nt,e as Oe,f as zt}from"./chunk-EUOPIQ5M.js";import{a as ve,b as _e,c as me,d as Ut}from"./chunk-YMTP6F2C.js";import{a as jt}from"./chunk-G5SK3OBM.js";import{a as Re}from"./chunk-FTD33PGM.js";import{a as Ve}from"./chunk-E65UDGDD.js";import{a as be}from"./chunk-Q2PKIGLB.js";import{a as It}from"./chunk-ADKAF2LM.js";import{a as H}from"./chunk-VRW33XBA.js";import{a as Je}from"./chunk-YRVQSWSZ.js";import{a as kt}from"./chunk-VFQYSWYJ.js";import{a as $t,b as Ae}from"./chunk-N7EJNOHR.js";import"./chunk-5QAKXYWT.js";import"./chunk-IZEUWGJK.js";import"./chunk-L44637OO.js";import"./chunk-2UN7HPVU.js";import"./chunk-UFBTR2BG.js";import{a as de}from"./chunk-EFNJA3BL.js";import"./chunk-6D27TSZV.js";import"./chunk-QRLOYIIN.js";import"./chunk-32QSFPDR.js";import{e as Lt,f as Ot,g as Ft}from"./chunk-KOC4SVZ5.js";import"./chunk-BGZFNZ2C.js";import{a as Pt}from"./chunk-7JUIBZEE.js";import{a as At,b as Mt,c as Vt}from"./chunk-C7XPBJTG.js";import{a as Xe,b as j,c as Ye,f as Rt}from"./chunk-7MDPIWHS.js";import"./chunk-WPHEQXWB.js";import{a as Dt,c as Et}from"./chunk-JJGA6W5B.js";import{b as Me,c as Pe}from"./chunk-45RYB36M.js";import"./chunk-ZFOQPLZY.js";import"./chunk-C2XSLL34.js";import"./chunk-Q2NVIOCY.js";import{a as ce}from"./chunk-XOGAYT52.js";import"./chunk-RW5UDPYM.js";import"./chunk-VNUSAOT6.js";import"./chunk-KRHX46JK.js";import"./chunk-V3VQWJQL.js";import"./chunk-QAT6LVRB.js";import"./chunk-Z3Y2VOXP.js";import"./chunk-ZBTWQZNB.js";import{a as ee}from"./chunk-FLAJXIYW.js";import{c as gt,f as St,i as bt,n as vt,o as wt,p as yt,v as Tt}from"./chunk-EO4DNTT4.js";import"./chunk-WZGZ4B4R.js";import{a as R}from"./chunk-5UPNU54P.js";import{j as le}from"./chunk-JZMWWTFG.js";import{p as Ct}from"./chunk-5APAM7YJ.js";import{$a as F,Aa as fe,Ba as he,C as D,Cb as Ee,D as B,E as it,Ea as ge,Eb as xt,Fa as d,Fb as ft,G as se,Ga as k,Gb as re,Ha as $,Ia as Y,J as u,K as C,Kb as ht,L as E,M as L,N as ot,Pa as Se,Qa as rt,Ra as Ie,T as ke,Ta as ae,U as K,Va as Ge,W as J,Xa as lt,Z as a,_ as st,a as He,aa as v,ab as U,b as qe,bb as dt,ca as at,da as x,db as ct,fa as Ce,ga as b,h as et,ha as $e,hb as A,ia as X,ib as pt,ja as O,jb as De,k as V,la as m,ma as Ke,mb as Q,oa as N,ob as _t,pa as z,pb as mt,qa as o,qb as ut,ra as s,sa as g,ta as Qe,ua as y,ub as Z,va as f,wa as c,y as tt,z as nt,za as xe}from"./chunk-TBMJSIBB.js";function _n(t,r){if(t&1&&(o(0,"span",9),d(1),s()),t&2){let e=c().$implicit;a(),$(" ",e.header," ")}}function mn(t,r){t&1&&(E(),o(0,"svg",19),g(1,"path",20),s())}function un(t,r){if(t&1&&(o(0,"span",18),x(1,mn,2,0,":svg:svg",19),s()),t&2){let e=c().$index,i=c(2).$index,n=c(2);X("bg-orange-500",n.isOptionSelected(i,e))("border-orange-500",n.isOptionSelected(i,e))("border-neutral-500",!n.isOptionSelected(i,e)),a(),m(n.isOptionSelected(i,e)?1:-1)}}function Cn(t,r){t&1&&g(0,"span",22)}function xn(t,r){if(t&1&&(o(0,"span",21),x(1,Cn,1,0,"span",22),s()),t&2){let e=c().$index,i=c(2).$index,n=c(2);X("border-orange-500",n.isOptionSelected(i,e))("border-neutral-500",!n.isOptionSelected(i,e)),a(),m(n.isOptionSelected(i,e)?1:-1)}}function fn(t,r){if(t&1&&(o(0,"span",17),d(1),s()),t&2){let e=c().$implicit;a(),$(" ",e.description," ")}}function hn(t,r){if(t&1){let e=y();o(0,"li")(1,"button",12),f("click",function(){let n=u(e).$index,l=c(2),p=l.$implicit,_=l.$index,w=c(2);return C(w.handleOptionToggle(_,n,p.multiSelect))}),x(2,un,2,7,"span",13)(3,xn,2,5,"span",14),o(4,"span",15)(5,"span",16),d(6),s(),x(7,fn,2,1,"span",17),s()()()}if(t&2){let e=r.$implicit,i=r.$index,n=c(2),l=n.$implicit,p=n.$index,_=c(2);a(),b("ngClass",_.isOptionSelected(p,i)?"bg-orange-500/10 border-orange-500/45":"bg-neutral-900/40 border-neutral-700/60 hover:bg-orange-500/10 hover:border-orange-500/30"),a(),m(l.multiSelect?2:3),a(4),$(" ",e.label," "),a(),m(e.description?7:-1)}}function gn(t,r){if(t&1&&(o(0,"ul",11),N(1,hn,8,4,"li",null,Ke),s()),t&2){let e=c().$implicit;a(),z(e.options)}}function Sn(t,r){if(t&1&&(o(0,"div",1)(1,"div",8),x(2,_n,2,1,"span",9),o(3,"span",10),d(4),s()(),x(5,gn,3,0,"ul",11),s()),t&2){let e=r.$implicit;a(2),m(e.header?2:-1),a(2),$(" ",e.question," "),a(),m(e.options.length>0?5:-1)}}function bn(t,r){if(t&1&&(o(0,"div",0),N(1,Sn,6,3,"div",1,Ke),o(3,"div",2),E(),o(4,"svg",3),g(5,"circle",4)(6,"path",5)(7,"path",6),s(),L(),o(8,"span",7),d(9," Answer-submit not yet wired \u2014 type your choice in the CC input below. "),s()()()),t&2){let e=c();a(),z(e.questions_$())}}var Ue=(()=>{class t{rawData=K(void 0);selections_$=v(new Map);questions_$=A(()=>{let e=this.rawData();if(!e)return[];let i=e.input;if(!i||typeof i!="object")return[];let n=i.questions;return Array.isArray(n)?n.map(l=>t.parseQuestion(l)).filter(l=>l!==null):[]});handleOptionToggle(e,i,n){this.selections_$.update(l=>{let p=new Map(l),_=new Set(p.get(e)??[]);return n?_.has(i)?_.delete(i):_.add(i):_.has(i)&&_.size===1||(_.clear(),_.add(i)),p.set(e,_),p})}isOptionSelected(e,i){return this.selections_$().get(e)?.has(i)??!1}static parseQuestion(e){if(!e||typeof e!="object")return null;let i=e,n=typeof i.question=="string"?i.question:"";if(!n)return null;let l=typeof i.header=="string"?i.header:"",p=i.multiSelect===!0,_=i.options,w=Array.isArray(_)?_.map(h=>t.parseOption(h)).filter(h=>h!==null):[];return{question:n,header:l,multiSelect:p,options:w}}static parseOption(e){if(!e||typeof e!="object")return null;let i=e,n=typeof i.label=="string"?i.label:"";if(!n)return null;let l=typeof i.description=="string"?i.description:"";return{label:n,description:l}}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-s-agent-tool-ask-user-question"]],hostAttrs:[1,"block"],inputs:{rawData:[1,"rawData"]},standalone:!0,features:[ae],decls:1,vars:1,consts:[[1,"px-2.5","py-2","space-y-3"],[1,"space-y-1.5"],[1,"flex","items-center","gap-1.5","px-2","py-1","rounded-md","bg-neutral-800/50","border","border-neutral-700/60"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","text-neutral-400","shrink-0"],["cx","8","cy","8","r","6"],["d","M8 5.5v3"],["d","M8 10.5h.01"],[1,"text-[10px]","sm:text-[11px]","text-neutral-400","leading-snug"],[1,"flex","items-start","gap-2","flex-wrap"],[1,"inline-flex","items-center","px-1.5","py-0.5","rounded","text-[10px]","font-medium","bg-orange-500/15","border","border-orange-500/30","text-orange-300","shrink-0","mt-0.5"],[1,"text-xs","sm:text-sm","text-neutral-200","font-medium","leading-snug"],[1,"space-y-1","pl-0.5"],["type","button",1,"w-full","flex","items-start","gap-2","px-2","py-1.5","rounded-md","border","text-left","transition-colors","cursor-pointer",3,"click","ngClass"],[1,"shrink-0","mt-0.5","w-3.5","h-3.5","rounded-sm","border","flex","items-center","justify-center",3,"bg-orange-500","border-orange-500","border-neutral-500"],[1,"shrink-0","mt-0.5","w-3.5","h-3.5","rounded-full","border","flex","items-center","justify-center",3,"border-orange-500","border-neutral-500"],[1,"min-w-0","flex-1"],[1,"block","text-xs","text-neutral-200","font-medium","leading-snug"],[1,"block","text-[11px]","text-neutral-400","leading-snug","mt-0.5"],[1,"shrink-0","mt-0.5","w-3.5","h-3.5","rounded-sm","border","flex","items-center","justify-center"],["viewBox","0 0 12 12","fill","none","stroke","currentColor","stroke-width","2.5","stroke-linecap","round","stroke-linejoin","round",1,"w-2.5","h-2.5","text-neutral-900"],["d","M2.5 6.5l2.5 2.5L9.5 3.5"],[1,"shrink-0","mt-0.5","w-3.5","h-3.5","rounded-full","border","flex","items-center","justify-center"],[1,"w-1.5","h-1.5","rounded-full","bg-orange-500"]],template:function(i,n){i&1&&x(0,bn,10,0,"div",0),i&2&&m(n.questions_$().length>0?0:-1)},dependencies:[Z,Q],encapsulation:2})}return t})();function wn(t,r){t&1&&(o(0,"div",3),E(),o(1,"svg",5),g(2,"path",6),s(),L(),o(3,"span",7),d(4,"Plan accepted"),s()())}function yn(t,r){if(t&1){let e=y();o(0,"button",8),f("click",function(){u(e);let n=c(2);return C(n.handleAccept())}),E(),o(1,"svg",9),g(2,"path",6),s(),d(3," Accept plan "),s()}}function Tn(t,r){if(t&1){let e=y();o(0,"div",0)(1,"div",1),f("click",function(n){u(e);let l=c();return C(l.handleAssistantMdClick(n))}),s(),o(2,"div",2),x(3,wn,5,0,"div",3)(4,yn,4,0,"button",4),s()()}if(t&2){let e=c();a(),b("innerHTML",r,J),a(2),m(e.isAccepted_$()?3:4)}}var je=(()=>{class t{sanitizer=D(Ee);globalError_CS=D(le);rawData=K(void 0);accepted=ke();isAccepted_$=v(!1);planText_$=A(()=>{let e=this.rawData();if(!e)return"";let i=e.input;if(!i||typeof i!="object")return"";let n=i.plan;return typeof n=="string"?n:""});planHtml_$=A(()=>{let e=this.planText_$();if(!e)return null;let i=Xe.toSanitizedHtml(e);return this.sanitizer.bypassSecurityTrustHtml(i)});handleAccept(){this.isAccepted_$()||(this.isAccepted_$.set(!0),this.accepted.emit())}handleAssistantMdClick(e){return V(this,null,function*(){yield Xe.handleCodeCopyClick(e,i=>this.globalError_CS.copyToClipboard(i))})}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-s-agent-tool-plan-view"]],hostAttrs:[1,"block"],inputs:{rawData:[1,"rawData"]},outputs:{accepted:"accepted"},standalone:!0,features:[ae],decls:1,vars:1,consts:[[1,"px-2.5","py-2","space-y-2"],[1,"ccap-assistant-md","leading-snug","sm:leading-normal","break-words","text-neutral-200","text-xs","sm:text-sm","min-w-0","max-h-[400px]","overflow-y-auto","overflow-x-auto","pr-1",3,"click","innerHTML"],[1,"flex","justify-end","pt-1","border-t","border-orange-500/10"],[1,"inline-flex","items-center","gap-1.5","px-3","py-1","rounded-md","bg-green-500/10","border","border-green-500/25"],["type","button",1,"inline-flex","items-center","gap-1.5","px-3","py-1","rounded-md","bg-ccapAccent/10","border","border-ccapAccent/30","text-ccapAccent","text-[11px]","font-medium","cursor-pointer","hover:bg-ccapAccent/20","hover:border-ccapAccent/50","transition-colors"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","text-green-400"],["d","M3.5 8.5l3 3 6-6"],[1,"text-[11px]","text-green-400","font-medium"],["type","button",1,"inline-flex","items-center","gap-1.5","px-3","py-1","rounded-md","bg-ccapAccent/10","border","border-ccapAccent/30","text-ccapAccent","text-[11px]","font-medium","cursor-pointer","hover:bg-ccapAccent/20","hover:border-ccapAccent/50","transition-colors",3,"click"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5"]],template:function(i,n){if(i&1&&x(0,Tn,5,2,"div",0),i&2){let l;m((l=n.planHtml_$())?0:-1,l)}},dependencies:[Z],styles:[`@charset "UTF-8";
2
2
  /*# sourceMappingURL=s-agent-tool-plan-view.component-E4T5UMZT.css.map */`]})}return t})();var $n=(t,r)=>r.content,In=(t,r,e)=>({"text-neutral-500 line-through":t,"text-blue-300":r,"text-neutral-300":e});function Dn(t,r){t&1&&(E(),o(0,"svg",5),g(1,"path",10),s())}function En(t,r){t&1&&(o(0,"span",6),g(1,"span",11),s())}function An(t,r){t&1&&(o(0,"span",6),g(1,"span",12),s())}function Mn(t,r){if(t&1&&(o(0,"div",9),d(1),s()),t&2){let e=c().$implicit;a(),k(e.activeForm)}}function Pn(t,r){if(t&1&&(o(0,"div",4),x(1,Dn,2,0,":svg:svg",5)(2,En,2,0,"span",6)(3,An,2,0,"span",6),o(4,"div",7)(5,"span",8),d(6),s(),x(7,Mn,2,1,"div",9),s()()),t&2){let e,i=r.$implicit;a(),m((e=i.status)==="completed"?1:e==="in_progress"?2:3),a(4),b("ngClass",lt(4,In,i.status==="completed",i.status==="in_progress",i.status!=="completed"&&i.status!=="in_progress")),a(),k(i.content),a(),m(i.status==="in_progress"&&i.activeForm?7:-1)}}function Vn(t,r){if(t&1&&(o(0,"div",0)(1,"div",1)(2,"span",2),d(3,"Tasks"),s(),o(4,"span",3),d(5),s()(),N(6,Pn,8,8,"div",4,$n),s()),t&2){let e=c();a(5),Y("",e.completedCount_$(),"/",e.totalCount_$(),""),a(),z(e.todos_$())}}var Be=(()=>{class t{rawData=K(void 0);todos_$=A(()=>{let e=this.rawData();if(!e)return[];let i=e.input;if(!i||typeof i!="object")return[];let n=i.todos;return Array.isArray(n)?n.filter(l=>typeof l=="object"&&l!==null&&typeof l.content=="string"):[]});completedCount_$=A(()=>this.todos_$().filter(e=>e.status==="completed").length);totalCount_$=A(()=>this.todos_$().length);static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-s-agent-tool-todo-list"]],hostAttrs:[1,"block"],inputs:{rawData:[1,"rawData"]},standalone:!0,features:[ae],decls:1,vars:1,consts:[[1,"px-2.5","py-1.5","space-y-0.5"],[1,"flex","items-center","gap-1.5","mb-1"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","font-medium"],[1,"text-[10px]","text-neutral-600"],[1,"flex","items-start","gap-2","py-0.5"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-4","h-4","text-green-400","shrink-0","mt-px"],[1,"w-4","h-4","shrink-0","mt-px","flex","items-center","justify-center"],[1,"min-w-0"],[1,"text-[11px]","leading-relaxed","break-words",3,"ngClass"],[1,"text-[9px]","text-blue-400/50","mt-px"],["d","M3.5 8.5l3 3 6-6"],[1,"w-3","h-3","rounded-full","border-2","border-blue-400/40","border-t-blue-400","animate-spin"],[1,"w-3","h-3","rounded-full","border","border-neutral-600"]],template:function(i,n){i&1&&x(0,Vn,8,2,"div",0),i&2&&m(n.todos_$().length?0:-1)},dependencies:[Z,Q],encapsulation:2})}return t})();var M="ccap-ccSession",T=class{static saveProjectFilter(r){R.writeString(`${M}:projectFilter`,r)}static loadProjectFilter(){return R.readString(`${M}:projectFilter`)??""}static saveLastWorkspacePath(r){R.writeString(`${M}:lastWorkspacePath`,r)}static loadLastWorkspacePath(){return R.readString(`${M}:lastWorkspacePath`)??""}static saveLastLabel(r){R.writeString(`${M}:lastLabel`,r)}static loadLastLabel(){return R.readString(`${M}:lastLabel`)??""}static savePromptDraft(r,e){ve.saveDraft(M,r,e)}static loadPromptDraft(r){return ve.loadDraft(M,r)}static clearPromptDraft(r){ve.clearDraft(M,r)}static hasPromptDraft(r){return ve.hasDraft(M,r)}static savePanelOpen(r,e){R.writeBoolean(`${M}:panelOpen:${r}`,e)}static loadPanelOpen(r,e){return R.readBoolean(`${M}:panelOpen:${r}`,e)}static savePanelWidth(r,e){R.writeNumber(`${M}:panelWidth:${r}`,e)}static loadPanelWidth(r,e){return R.readNumber(`${M}:panelWidth:${r}`,e)}static saveSessionMode(r){R.writeString(`${M}:sessionMode`,r)}static loadSessionMode(){return R.readString(`${M}:sessionMode`)??"normal"}static saveSessionEffort(r){R.writeString(`${M}:sessionEffort`,r)}static loadSessionEffort(){return R.readString(`${M}:sessionEffort`)??"high"}static saveSessionModel(r){R.writeString(`${M}:sessionModel`,r)}static loadSessionModel(){return R.readString(`${M}:sessionModel`)??"sonnet"}static saveStatusHistory(r){R.writeBoolean(`${M}:statusHistory`,r)}static loadStatusHistory(){return R.readBoolean(`${M}:statusHistory`,!1)}static saveLastSessionId(r){R.writeString(`${M}:lastSessionId`,r)}static loadLastSessionId(){return R.readString(`${M}:lastSessionId`)??""}static saveLastCcapId(r){R.writeString(`${M}:lastCcapId`,r)}static loadLastCcapId(){return R.readString(`${M}:lastCcapId`)??""}static saveShowStatusUpdates(r){R.writeBoolean(`${M}:showStatusUpdates`,r)}static loadShowStatusUpdates(){return R.readBoolean(`${M}:showStatusUpdates`,!0)}static saveShowArchived(r){R.writeBoolean(`${M}:showArchived`,r)}static loadShowArchived(){return R.readBoolean(`${M}:showArchived`,!1)}};var G=(()=>{class t{ccSession_DS=D(H);isTimelinePanelOpen_$=v(T.loadPanelOpen("timeline",!1));isMetadataPanelOpen_$=v(T.loadPanelOpen("metadata",!1));isResuming_$=v(!1);isTerminating_$=v(!1);isStopping_$=v(!1);isForking_$=v(!1);isShowSessionStatus_$=v(T.loadStatusHistory());isShowAgentUpdates_$=v(T.loadShowStatusUpdates());handleToggleTimeline(){let e=!this.isTimelinePanelOpen_$();this.isTimelinePanelOpen_$.set(e),T.savePanelOpen("timeline",e)}handleToggleMetadata(){let e=!this.isMetadataPanelOpen_$();this.isMetadataPanelOpen_$.set(e),T.savePanelOpen("metadata",e)}handleToggleSessionStatus(){let e=!this.isShowSessionStatus_$();this.isShowSessionStatus_$.set(e),T.saveStatusHistory(e)}handleToggleAgentUpdates(){let e=!this.isShowAgentUpdates_$();this.isShowAgentUpdates_$.set(e),T.saveShowStatusUpdates(e)}handleResume(){return V(this,null,function*(){let e=this.ccSession_DS.selectedSession_$();if(!e||this.isResuming_$())return;let i=e.session.sessionId;if(i){this.isResuming_$.set(!0);try{yield this.ccSession_DS.resumeSession({sessionId:i})}catch{}finally{this.isResuming_$.set(!1)}}})}handleStopExecution(){return V(this,null,function*(){let e=this.ccSession_DS.selectedSession_$();if(!e||this.isStopping_$())return;let i=e.session.sessionId;if(i){this.isStopping_$.set(!0);try{yield this.ccSession_DS.stopExecution({sessionId:i})}catch{}finally{this.isStopping_$.set(!1)}}})}handleFork(){return V(this,null,function*(){let e=this.ccSession_DS.selectedSession_$();if(!e||this.isForking_$())return null;let i=e.session.sessionId;if(!i||!e.session.claudeSessionId)return null;this.isForking_$.set(!0);try{return yield this.ccSession_DS.forkSession({sessionId:i})}catch{return null}finally{this.isForking_$.set(!1)}})}handleTerminate(){return V(this,null,function*(){let e=this.ccSession_DS.selectedSession_$();if(!e||this.isTerminating_$())return;let i=e.session.sessionId;if(i){this.isTerminating_$.set(!0);try{yield this.ccSession_DS.terminateSession({sessionId:i})}catch{}finally{this.isTerminating_$.set(!1)}}})}diagnosticSnapshot_$=v(null);isDiagnosticOpen_$=v(!1);isLoadingDiagnostic_$=v(!1);handleShowDiagnostic(){return V(this,null,function*(){let i=this.ccSession_DS.selectedSession_$()?.session.sessionId??"";if(!(!i||this.isLoadingDiagnostic_$())){this.isLoadingDiagnostic_$.set(!0);try{let n=yield this.ccSession_DS.loadDiagnostic({sessionId:i});n&&(this.diagnosticSnapshot_$.set(n),this.isDiagnosticOpen_$.set(!0))}catch{}finally{this.isLoadingDiagnostic_$.set(!1)}}})}handleCloseDiagnostic(){this.isDiagnosticOpen_$.set(!1),this.diagnosticSnapshot_$.set(null)}static \u0275fac=function(i){return new(i||t)};static \u0275prov=tt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Fn=(t,r)=>r._id,Un=(t,r)=>r.path;function jn(t,r){if(t&1&&(o(0,"option",26),d(1),s()),t&2){let e=c().$implicit;b("value",e.localPath),a(),k(e.name)}}function Bn(t,r){if(t&1&&x(0,jn,2,2,"option",26),t&2){let e=r.$implicit;m(e.localPath?0:-1)}}function Nn(t,r){t&1&&(o(0,"div",12),d(1,"Loading sessions..."),s())}function zn(t,r){t&1&&(o(0,"div",13),d(1,"Failed to load sessions"),s())}function Wn(t,r){if(t&1){let e=y();o(0,"app-s-session-select",27),f("selected",function(n){u(e);let l=c();return C(l.handleSelectSession(n))})("contextMenu",function(n){u(e);let l=c();return C(l.handleRowContextMenu(n))})("scheduleIndicatorClicked",function(n){u(e);let l=c();return C(l.handleScheduleIndicatorClick(n))})("coordinatorIndicatorClicked",function(n){u(e);let l=c();return C(l.handleCoordinatorIndicatorClick(n))}),s()}if(t&2){let e=c();b("rows",e.sessionRowViews_$())("activeId",e.ccSession_DS.activeSessionId_$())("hideSearch",!0)}}function Hn(t,r){t&1&&(o(0,"div",12),d(1,"No sessions found"),s())}function qn(t,r){if(t&1&&(o(0,"option",26),d(1),s()),t&2){let e=r.$implicit;b("value",e.path),a(),Y("",e.label," \u2014 ",e.path,"")}}function Kn(t,r){if(t&1){let e=y();o(0,"select",28),f("ngModelChange",function(n){u(e);let l=c();return C(l.handlePathOptionChange(n))}),o(1,"option",29),d(2,"Select a path..."),s(),N(3,qn,2,3,"option",26,Un),o(5,"option",30),d(6,"Custom path..."),s()()}if(t&2){let e=c();b("ngModel",e.selectedPathOption_$()),a(3),z(e.newAgentSessionWorkspace_DS.workspacePathPickerOptions_$())}}function Qn(t,r){if(t&1){let e=y();o(0,"div",33)(1,"input",34,0),f("input",function(){u(e);let n=ge(2),l=c(2);return C(l.renameValue_$.set(n.value))})("keydown.enter",function(){u(e);let n=c(2);return C(n.handleCtxRenameConfirm())})("keydown.escape",function(){u(e);let n=c(2);return C(n.handleCloseCtxMenu())}),s()()}if(t&2){let e=c(2);a(),b("value",e.renameValue_$())}}function Gn(t,r){t&1&&d(0," \u2713 Link copied ")}function Jn(t,r){t&1&&d(0," Copy failed ")}function Xn(t,r){t&1&&d(0," Copy link ")}function Yn(t,r){if(t&1){let e=y();o(0,"button",36),f("click",function(){u(e);let n=c(3);return C(n.handleCtxResume())}),d(1," Resume "),s()}}function Zn(t,r){if(t&1){let e=y();g(0,"div",38),o(1,"button",39),f("click",function(){u(e);let n=c(3);return C(n.handleCtxTerminate())}),d(2," Terminate "),s()}}function ei(t,r){if(t&1){let e=y();o(0,"button",35),f("click",function(){u(e);let n=c(2);return C(n.handleCtxCopyLink())}),x(1,Gn,1,0)(2,Jn,1,0)(3,Xn,1,0),s(),o(4,"button",36),f("click",function(){u(e);let n=c(2);return C(n.handleCtxRenameStart())}),d(5," Rename "),s(),o(6,"button",36),f("click",function(){u(e);let n=c(2);return C(n.handleCtxToggleArchive())}),d(7),s(),x(8,Yn,2,0,"button",37)(9,Zn,3,0)}if(t&2){let e,i=c(),n=c();b("disabled",n.linkCopyState_$()!=="idle"),a(),m((e=n.linkCopyState_$())==="copied"?1:e==="failed"?2:3),a(6),$(" ",i.isArchived?"Unarchive":"Archive"," "),a(),m(i.status==="completed"||i.status==="errored"?8:-1),a(),m(i.status==="running"||i.status==="starting"||i.status==="waiting-input"?9:-1)}}function ti(t,r){if(t&1){let e=y();o(0,"div",31),f("click",function(){u(e);let n=c();return C(n.handleCloseCtxMenu())}),s(),o(1,"div",32),x(2,Qn,3,1,"div",33)(3,ei,10,5),s()}if(t&2){let e=c();a(),$e("left",e.ctxMenuPos_$().x,"px")("top",e.ctxMenuPos_$().y,"px"),a(),m(e.isRenaming_$()?2:3)}}var qt=(()=>{class t{ccSession_DS=D(H);newAgentSessionWorkspace_DS=D(It);pm_DS=D(Dt);peiContext_DS=D(de);scheduledJobs_DS=D(Ve);coordinator_DS=D(Re);router=D(re);globalError_CS=D(le);instanceChangeEffect=De(()=>{let e=this.peiContext_DS.activeCcapId_$(),i=this.showArchived_$();e&&pt(()=>{this.ccSession_DS.loadSessions({includeArchived:i||void 0})})});projectFilter_$=v("");filteredSessions_$=A(()=>{let e=this.ccSession_DS.sessions_$(),i=this.projectFilter_$();if(!i)return e;let n=t.normalizePath(i);return e.filter(l=>!!l.workspacePath&&t.normalizePath(l.workspacePath)===n)});sessionRowViews_$=A(()=>{let e=this.scheduledJobs_DS.scheduledSessionIds_$(),i=this.coordinator_DS.coordinatedSessionIds_$();return this.filteredSessions_$().map(n=>({id:n.sessionId,label:n.label||n.sessionId,status:n.status,statusColorClass:Je.resolve(n.status),workspacePath:n.workspacePath,isArchived:!!n.isArchived,lastActivityAt:n.lastActivityAt,promptCount:n.promptCount,isRunning:Je.isRunning(n.status),hasSchedule:e.has(n.sessionId),hasCoordinator:i.has(n.sessionId),hasDraft:T.hasPromptDraft(n.sessionId)}))});isCreateDialogOpen_$=v(!1);schedulePopupSessionId_$=v(null);coordinatorPopupSessionId_$=v(null);newSessionWorkspacePath_$=v("");newSessionLabel_$=v("");isCreating_$=v(!1);showArchived_$=v(!1);selectedPathOption_$=v("");sessionSelected=ke();ctxMenuSession_$=v(null);ctxMenuPos_$=v({x:0,y:0});isRenaming_$=v(!1);renameValue_$=v("");linkCopyState_$=v("idle");ngOnInit(){let e=T.loadProjectFilter();e&&this.projectFilter_$.set(e);let i=T.loadShowArchived();this.showArchived_$.set(i),!this.pm_DS.projectsLoadedOnce_$()&&!this.pm_DS.projectsLoading_$()&&this.pm_DS.loadProjects(),this.peiContext_DS.ensureInitialized().then(()=>{this.ccSession_DS.loadSessions({includeArchived:i||void 0})}),this.scheduledJobs_DS.loadAll(),this.coordinator_DS.loadAllCoordinatorsForManagementPage()}handleSelectSession(e){let i=this.peiContext_DS.activeCcapId_$(),n=i?["/cc-session",i,e]:["/cc-session",e];this.router.navigate(n),this.sessionSelected.emit()}handleOpenCreateDialog(){return V(this,null,function*(){if(this.isCreateDialogOpen_$.set(!0),yield this.newAgentSessionWorkspace_DS.refreshWorkspacePathPickerOptions(),!this.newSessionWorkspacePath_$()){let i=this.newAgentSessionWorkspace_DS.resolveInitialWorkspacePath({lastWorkspacePath:T.loadLastWorkspacePath()});if(i){this.newSessionWorkspacePath_$.set(i);let n=this.newAgentSessionWorkspace_DS.workspacePathPickerOptions_$().some(l=>l.path===i);this.selectedPathOption_$.set(n?i:"custom")}}let e=T.loadLastLabel();e&&this.newSessionLabel_$.set(e)})}handlePathOptionChange(e){this.selectedPathOption_$.set(e),e&&e!=="custom"&&this.newSessionWorkspacePath_$.set(e)}handleCloseCreateDialog(){this.isCreateDialogOpen_$.set(!1),this.newSessionWorkspacePath_$.set(""),this.newSessionLabel_$.set(""),this.selectedPathOption_$.set("")}handleCreateSession(){return V(this,null,function*(){let e=this.newSessionWorkspacePath_$();if(!(!e||this.isCreating_$())){this.isCreating_$.set(!0);try{T.saveLastWorkspacePath(e),T.saveLastLabel(this.newSessionLabel_$());let i=T.loadSessionMode(),n=T.loadSessionEffort(),l=yield this.ccSession_DS.createSession({workspacePath:e,label:this.newSessionLabel_$()||void 0,mode:i||void 0,reasoningEffort:n||void 0});if(this.handleCloseCreateDialog(),l){let p=this.peiContext_DS.activeCcapId_$(),_=p?["/cc-session",p,l]:["/cc-session",l];this.router.navigate(_)}}catch{this.handleCloseCreateDialog()}finally{this.isCreating_$.set(!1)}}})}handleProjectFilterChange(e){this.projectFilter_$.set(e),T.saveProjectFilter(e)}handleToggleShowArchived(){let e=!this.showArchived_$();this.showArchived_$.set(e),T.saveShowArchived(e),this.handleRefresh()}handleToggleArchive(e,i){return V(this,null,function*(){e.stopPropagation();try{yield this.ccSession_DS.setSessionArchived({sessionId:i.sessionId,isArchived:!i.isArchived}),this.handleRefresh()}catch{}})}handleRowContextMenu(e){this.isRenaming_$.set(!1);let i=this.filteredSessions_$().find(n=>n.sessionId===e.id);i&&(this.ctxMenuSession_$.set(i),this.ctxMenuPos_$.set({x:e.event.clientX,y:e.event.clientY}))}handleScheduleIndicatorClick(e){this.schedulePopupSessionId_$.set(e)}handleCloseSchedulePopup(){this.schedulePopupSessionId_$.set(null)}handleCoordinatorIndicatorClick(e){this.coordinatorPopupSessionId_$.set(e)}handleCloseCoordinatorPopup(){this.coordinatorPopupSessionId_$.set(null)}handleCloseCtxMenu(){this.ctxMenuSession_$.set(null),this.isRenaming_$.set(!1),this.renameValue_$.set(""),this.linkCopyState_$.set("idle")}handleCtxCopyLink(){return V(this,null,function*(){let e=this.ctxMenuSession_$();if(!e)return;let i=this.peiContext_DS.activeCcapId_$(),n=i?`/cc-session/${i}/${e.sessionId}`:`/cc-session/${e.sessionId}`,l=`${window.location.origin}${n}`,p=yield this.globalError_CS.copyToClipboard(l);this.linkCopyState_$.set(p.ok?"copied":"failed"),setTimeout(()=>{this.handleCloseCtxMenu()},700)})}handleCtxRenameStart(){let e=this.ctxMenuSession_$();e&&(this.renameValue_$.set(e.label||""),this.isRenaming_$.set(!0),setTimeout(()=>{let i=document.querySelector("#ctxRenameInput");i&&(i.focus(),i.select())},0))}handleCtxRenameConfirm(){return V(this,null,function*(){let e=this.ctxMenuSession_$();if(!e)return;let i=this.renameValue_$().trim();if(i!==(e.label||""))try{yield this.ccSession_DS.updateSessionConfig({sessionId:e.sessionId,label:i})}catch{}this.handleCloseCtxMenu()})}handleCtxToggleArchive(){return V(this,null,function*(){let e=this.ctxMenuSession_$();if(e){this.handleCloseCtxMenu();try{yield this.ccSession_DS.setSessionArchived({sessionId:e.sessionId,isArchived:!e.isArchived}),this.handleRefresh()}catch{}}})}handleCtxTerminate(){return V(this,null,function*(){let e=this.ctxMenuSession_$();if(e){this.handleCloseCtxMenu();try{yield this.ccSession_DS.terminateSession({sessionId:e.sessionId}),this.handleRefresh()}catch{}}})}handleCtxResume(){return V(this,null,function*(){let e=this.ctxMenuSession_$();if(e){this.handleCloseCtxMenu();try{yield this.ccSession_DS.resumeSession({sessionId:e.sessionId}),this.handleRefresh()}catch{}}})}handleRefresh(){this.ccSession_DS.loadSessions({includeArchived:this.showArchived_$()||void 0})}static normalizePath(e){let i=e.trim().toLowerCase().replace(/\\/g,"/");for(;i.endsWith("/")&&i.length>1;)i=i.slice(0,-1);return i}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-ccap-cc-dashboard"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],outputs:{sessionSelected:"sessionSelected"},decls:41,vars:24,consts:[["renameInput",""],[1,"p-2","border-b","border-neonDefault"],[1,"flex","items-center","justify-between","p-3","border-b","border-neonDefault"],[1,"text-sm","font-semibold","text-neutral-200"],[1,"flex","gap-1"],["title","Refresh",1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors",3,"click"],[1,"px-2","py-1","text-xs","border","border-ccapAccent","text-ccapAccent","hover:bg-ccapAccent","hover:text-white","hover:shadow-neon-glow-accent","rounded","transition-colors",3,"click"],[1,"p-2","border-b","border-neonDefault","flex","gap-2","items-center"],[1,"flex-1","bg-neutral-900","text-neutral-300","text-xs","rounded","px-2","py-1","border","border-neonDefault",3,"ngModelChange","ngModel"],["value",""],[1,"px-2","py-1","text-[10px]","border","rounded","transition-colors","whitespace-nowrap",3,"click","title"],[1,"flex-1","overflow-y-auto"],[1,"p-4","text-center","text-neutral-500","text-sm"],[1,"p-4","text-center","text-red-400","text-sm"],["kind","cc",3,"rows","activeId","hideSearch"],[3,"closed","isOpen","title","maxWidth","closeOnBackdropClick"],[1,"mb-2"],[1,"text-xs","text-neutral-400","block","mb-1"],[1,"w-full","bg-neutral-900","text-neutral-300","text-xs","rounded","px-2","py-1.5","border","border-neonDefault","focus:border-neonCyan","focus:outline-none","mb-1.5",3,"ngModel"],["type","text","placeholder","/path/to/workspace",1,"w-full","bg-neutral-900","text-neutral-200","text-sm","rounded","px-2","py-1.5","border","border-neonDefault","focus:border-neonCyan","focus:outline-none",3,"ngModelChange","ngModel"],[1,"mb-3"],["type","text","placeholder","My session",1,"w-full","bg-neutral-900","text-neutral-200","text-sm","rounded","px-2","py-1.5","border","border-neonDefault","focus:border-neonCyan","focus:outline-none",3,"ngModelChange","ngModel"],[1,"flex","justify-end","gap-2"],[1,"px-3","py-1.5","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors",3,"click","disabled"],[1,"px-3","py-1.5","text-xs","border","border-ccapAccent","text-ccapAccent","hover:bg-ccapAccent","hover:text-white","disabled:opacity-50","rounded","transition-colors",3,"click","disabled"],[3,"closed","sessionId","isOpen"],[3,"value"],["kind","cc",3,"selected","contextMenu","scheduleIndicatorClicked","coordinatorIndicatorClicked","rows","activeId","hideSearch"],[1,"w-full","bg-neutral-900","text-neutral-300","text-xs","rounded","px-2","py-1.5","border","border-neonDefault","focus:border-neonCyan","focus:outline-none","mb-1.5",3,"ngModelChange","ngModel"],["value","","disabled",""],["value","custom"],[1,"fixed","inset-0","z-40",3,"click"],[1,"fixed","z-50","min-w-[160px]","bg-neutral-900","border","border-neutral-700","rounded-lg","shadow-xl","py-1","text-xs"],[1,"px-2","py-1.5"],["id","ctxRenameInput","type","text",1,"w-full","bg-neutral-800","text-neutral-200","text-xs","rounded","px-2","py-1","border","border-neonDefault","focus:border-neonCyan","focus:outline-none",3,"input","keydown.enter","keydown.escape","value"],[1,"w-full","text-left","px-3","py-1.5","text-neutral-300","hover:bg-neutral-800","transition-colors",3,"click","disabled"],[1,"w-full","text-left","px-3","py-1.5","text-neutral-300","hover:bg-neutral-800","transition-colors",3,"click"],[1,"w-full","text-left","px-3","py-1.5","text-neutral-300","hover:bg-neutral-800","transition-colors"],[1,"border-t","border-neutral-700","my-1"],[1,"w-full","text-left","px-3","py-1.5","text-red-400","hover:bg-red-500/10","transition-colors",3,"click"]],template:function(i,n){if(i&1&&(o(0,"div",1),g(1,"app-s-instance-chip-row-with-info"),s(),o(2,"div",2)(3,"h2",3),d(4,"CC Sessions"),s(),o(5,"div",4)(6,"button",5),f("click",function(){return n.handleRefresh()}),d(7," Refresh "),s(),o(8,"button",6),f("click",function(){return n.handleOpenCreateDialog()}),d(9," + New "),s()()(),o(10,"div",7)(11,"select",8),f("ngModelChange",function(p){return n.handleProjectFilterChange(p)}),o(12,"option",9),d(13,"All projects"),s(),N(14,Bn,1,1,null,null,Fn),s(),o(16,"button",10),f("click",function(){return n.handleToggleShowArchived()}),d(17),s()(),o(18,"div",11),x(19,Nn,2,0,"div",12)(20,zn,2,0,"div",13)(21,Wn,1,3,"app-s-session-select",14)(22,Hn,2,0,"div",12),s(),o(23,"app-s-modal",15),f("closed",function(){return n.isCreateDialogOpen_$.set(!1)}),o(24,"div",16)(25,"label",17),d(26,"Workspace Path *"),s(),x(27,Kn,7,1,"select",18),o(28,"input",19),f("ngModelChange",function(p){return n.newSessionWorkspacePath_$.set(p)}),s()(),o(29,"div",20)(30,"label",17),d(31,"Label (optional)"),s(),o(32,"input",21),f("ngModelChange",function(p){return n.newSessionLabel_$.set(p)}),s()(),o(33,"div",22)(34,"button",23),f("click",function(){return n.handleCloseCreateDialog()}),d(35," Cancel "),s(),o(36,"button",24),f("click",function(){return n.handleCreateSession()}),d(37),s()()(),o(38,"app-sch-schedule-popup",25),f("closed",function(){return n.handleCloseSchedulePopup()}),s(),o(39,"app-crd-info-popup",25),f("closed",function(){return n.handleCloseCoordinatorPopup()}),s(),x(40,ti,4,5)),i&2){let l;a(11),b("ngModel",n.projectFilter_$()),a(3),z(n.pm_DS.projects_$()),a(2),O(n.showArchived_$()?"border-amber-500/60 text-amber-400 bg-amber-500/10 hover:bg-amber-500/20":"border-neonDefault text-neutral-500 hover:text-neutral-300 hover:bg-neutral-700"),b("title",n.showArchived_$()?"Hide archived sessions":"Show archived sessions"),a(),$(" ",n.showArchived_$()?"Archived ON":"Archived"," "),a(2),m(n.ccSession_DS.sessionsLoading_$()?19:-1),a(),m(n.ccSession_DS.sessionsLoadError_$()?20:-1),a(),m(n.sessionRowViews_$().length?21:-1),a(),m(!n.ccSession_DS.sessionsLoading_$()&&!n.sessionRowViews_$().length?22:-1),a(),b("isOpen",n.isCreateDialogOpen_$())("title","New CC Session")("maxWidth","sm")("closeOnBackdropClick",!1),a(4),m(n.newAgentSessionWorkspace_DS.workspacePathPickerOptions_$().length?27:-1),a(),b("ngModel",n.newSessionWorkspacePath_$()),a(4),b("ngModel",n.newSessionLabel_$()),a(2),b("disabled",n.isCreating_$()),a(2),b("disabled",n.isCreating_$()||!n.newSessionWorkspacePath_$()),a(),$(" ",n.isCreating_$()?"Creating...":"Create"," "),a(),b("sessionId",n.schedulePopupSessionId_$())("isOpen",n.schedulePopupSessionId_$()!==null),a(),b("sessionId",n.coordinatorPopupSessionId_$())("isOpen",n.coordinatorPopupSessionId_$()!==null),a(),m((l=n.ctxMenuSession_$())?40:-1,l)}},dependencies:[wt,yt,gt,vt,St,bt,Le,ee,_e,me,Et],encapsulation:2})}return t})();var Ne=(()=>{class t{transform(e){switch(e){case"running":return"bg-yellow-500";case"waiting-input":return"bg-green-500";case"starting":return"bg-yellow-500";case"creating":return"bg-yellow-400";case"completed":return"bg-blue-500";case"errored":return"bg-red-500";case"terminated":return"bg-red-700";case"stalled":return"bg-orange-500";default:return"bg-neutral-600"}}static \u0275fac=function(i){return new(i||t)};static \u0275pipe=se({name:"ccSessionStatusColor",type:t,pure:!0})}return t})();function oi(t,r){t&1&&g(0,"div",5)}function si(t,r){if(t&1){let e=y();o(0,"button",14),f("click",function(){u(e);let n=c();return C(n.detailUi_DS.handleToggleMetadata())}),d(1," Info "),s()}if(t&2){let e=c();O(e.detailUi_DS.isMetadataPanelOpen_$()?"border-neonCyan/50 text-neonCyan bg-neonCyan/10":"border-neutral-700 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600")}}function ai(t,r){t&1&&g(0,"span",18)}function ri(t,r){if(t&1&&(g(0,"span",17),F(1,"ccSessionStatusColor"),x(2,ai,1,0,"span",18)),t&2){c(2);let e=Ie(1);b("ngClass",U(1,3,e.detail.session.status))("title",e.detail.session.status),a(2),m(e.detail.runtime.isLive?2:-1)}}function li(t,r){t&1&&(o(0,"span",16),d(1,"Loading\u2026"),s())}function di(t,r){if(t&1&&(o(0,"span",15),d(1),s(),x(2,ri,3,5)(3,li,2,0,"span",16)),t&2){c();let e=Ie(1);b("title",e.title),a(),$(" ",e.title," "),a(),m(e.detail?2:-1),a(),m(e.isLoading&&!e.showActions?3:-1)}}function ci(t,r){if(t&1){let e=y();o(0,"button",23),f("click",function(){u(e);let n=c(2);return C(n.detailUi_DS.handleStopExecution())}),d(1),s()}if(t&2){let e=c(2);b("disabled",e.detailUi_DS.isStopping_$()),a(),$(" ",e.detailUi_DS.isStopping_$()?"Stopping\u2026":"Stop"," ")}}function pi(t,r){if(t&1){let e=y();Se(0),o(1,"div",9)(2,"button",19),f("click",function(){u(e);let n=c();return C(n.detailUi_DS.handleToggleTimeline())}),d(3," Timeline "),s(),o(4,"button",20),f("click",function(){u(e);let n=c();return C(n.handleForkSession())}),d(5),s(),g(6,"span",21),x(7,ci,2,2,"button",22),s()}if(t&2){let e=c(),n=Ie(1).detail;a(2),O(e.detailUi_DS.isTimelinePanelOpen_$()?"border-neonCyan/50 text-neonCyan bg-neonCyan/10":"border-neutral-700 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600"),a(2),b("disabled",e.detailUi_DS.isForking_$()||!n.session.claudeSessionId)("title",e.detailUi_DS.isForking_$()?"Fork in progress\u2026":n.session.claudeSessionId?"Fork conversation into new session":"Cannot fork: no conversation yet"),a(),$(" ",e.detailUi_DS.isForking_$()?"Forking\u2026":"Fork"," "),a(2),m(n.session.status==="running"?7:-1)}}var Xt=(()=>{class t{router=D(re);peiContext_DS=D(de);ccSession_DS=D(H);detailUi_DS=D(G);sidebarWidth_$=v(320);isSidebarOpen_$=v(!0);isResizing_$=v(!1);ccTopBarContext_$=A(()=>{let e=this.ccSession_DS.activeSessionId_$();if(!e)return null;let i=this.ccSession_DS.selectedSessionLoading_$(),n=this.ccSession_DS.selectedSession_$(),p=this.ccSession_DS.sessions_$().find(I=>I.sessionId===e),_=n?.session.sessionId===e;return{title:(_?n.session.label||n.session.sessionId:null)??(p?p.label||p.sessionId:e),detail:_?n:null,showActions:_&&!i,isLoading:i}});ngOnInit(){let e=T.loadPanelWidth("sidebar",320);this.sidebarWidth_$.set(Math.max(200,Math.min(600,e))),this.isSidebarOpen_$.set(T.loadPanelOpen("sidebar",!0))}handleSidebarResizeStart(e){let i=e.clientX,n=this.sidebarWidth_$();this.isResizing_$.set(!0),be.attachUntilPointerUp({startEvent:e,onMove:l=>{let p=l.clientX-i,_=Math.max(200,Math.min(600,n+p));this.sidebarWidth_$.set(_)},onEnd:()=>{this.isResizing_$.set(!1),T.savePanelWidth("sidebar",this.sidebarWidth_$())}})}handleToggleSidebar(){this.isSidebarOpen_$.update(e=>!e),T.savePanelOpen("sidebar",this.isSidebarOpen_$())}handleSessionSelectedFromDashboard(){window.innerWidth<640&&this.isSidebarOpen_$.set(!1)}handleForkSession(){return V(this,null,function*(){let e=yield this.detailUi_DS.handleFork();if(e){let i=this.peiContext_DS.activeCcapId_$(),n=i?["/cc-session",i,e]:["/cc-session",e];yield this.router.navigate(n)}})}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-ccap-cc-shell"]],hostAttrs:[1,"flex","min-h-0","w-full","flex-1","flex-col","overflow-hidden"],decls:19,vars:14,consts:[[1,"flex","min-h-0","w-full","flex-1","flex-col","overflow-hidden"],["sSessionToolbarLeft","",1,"flex","items-center","gap-1","min-w-0"],[1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors","flex","items-center","gap-1","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","h-3","shrink-0","transition-transform","duration-150"],["points","6 9 12 15 18 9"],[1,"w-px","h-4","bg-neutral-700","shrink-0","self-center","mx-0.5"],["type","button",1,"px-2","py-1","text-xs","border","rounded","transition-colors","shrink-0",3,"class"],["sSessionToolbarCenter","",1,"flex","flex-wrap","items-center","justify-center","gap-2","min-w-0","max-w-[min(100vw-10rem,48rem)]"],["sSessionToolbarRight","",1,"flex","items-center","gap-1","min-w-0","flex-wrap","justify-end"],[1,"flex","gap-1","shrink-0","items-center","flex-wrap","justify-end"],[3,"sidebarResizeStart","isSidebarOpen","sidebarWidthPx","isResizing"],["sSessionShellSidebar","",1,"flex","flex-col","overflow-hidden","h-full"],[3,"sessionSelected"],["sSessionShellMain","",1,"flex","min-h-0","flex-1","flex-col","overflow-hidden","[&>router-outlet]:contents"],["type","button",1,"px-2","py-1","text-xs","border","rounded","transition-colors","shrink-0",3,"click"],[1,"text-sm","font-semibold","text-neutral-200","truncate","text-center","min-w-0","max-w-[min(240px,35vw)]",3,"title"],[1,"text-[10px]","text-neutral-500","shrink-0"],[1,"w-2","h-2","rounded-full","shrink-0",3,"ngClass","title"],["title","Live",1,"w-2","h-2","rounded-full","bg-green-500","animate-pulse","shrink-0"],[1,"px-2","py-1","text-xs","border","rounded","transition-colors",3,"click"],[1,"px-2","py-1","text-xs","border","border-neutral-700","text-neutral-500","hover:text-neutral-300","hover:border-neutral-600","disabled:opacity-40","rounded","transition-colors",3,"click","disabled","title"],[1,"w-px","bg-neutral-700","mx-0.5","self-stretch","min-h-[1.25rem]"],[1,"px-2","py-1","text-xs","border","border-neonRed/50","text-red-300","hover:bg-red-950/40","disabled:opacity-40","rounded","transition-colors",3,"disabled"],[1,"px-2","py-1","text-xs","border","border-neonRed/50","text-red-300","hover:bg-red-950/40","disabled:opacity-40","rounded","transition-colors",3,"click","disabled"]],template:function(i,n){if(i&1){let l=y();o(0,"div",0),Se(1),o(2,"app-s-session-shell-toolbar")(3,"div",1)(4,"button",2),f("click",function(){return u(l),C(n.handleToggleSidebar())}),E(),o(5,"svg",3),g(6,"polyline",4),s(),d(7," Sessions "),s(),x(8,oi,1,0,"div",5)(9,si,2,2,"button",6),s(),L(),o(10,"div",7),x(11,di,4,4),s(),o(12,"div",8),x(13,pi,8,6,"div",9),s()(),o(14,"app-s-resizable-session-shell-layout",10),f("sidebarResizeStart",function(_){return u(l),C(n.handleSidebarResizeStart(_))}),o(15,"div",11)(16,"app-ccap-cc-dashboard",12),f("sessionSelected",function(){return u(l),C(n.handleSessionSelectedFromDashboard())}),s()(),o(17,"div",13),g(18,"router-outlet"),s()()()}if(i&2){X("select-none",n.isResizing_$()),a();let l=rt(n.ccTopBarContext_$());a(4),X("rotate-90",n.isSidebarOpen_$())("-rotate-90",!n.isSidebarOpen_$()),a(3),m(l?8:-1),a(),m(l&&l.showActions&&l.detail?9:-1),a(2),m(l?11:-1),a(2),m(l&&l.showActions&&l.detail?13:-1),a(),b("isSidebarOpen",n.isSidebarOpen_$())("sidebarWidthPx",n.sidebarWidth_$())("isResizing",n.isResizing_$())}},dependencies:[Q,ft,At,Mt,qt,Ne],encapsulation:2})}return t})();var ie=et(Ct());var ye=function(t){return t.normal="normal",t.plan="plan",t}(ye||{});var ue=function(t){return t.sonnet="sonnet",t.opus="opus",t.haiku="haiku",t}(ue||{});var Te=class t{static fromDisplayItem(r){let e=t.mapMessageTypeToKind(r.messageType),i=r.pairedResult?{text:r.pairedResult.text,expandableContent:r.pairedResult.expandableContent,rawData:r.pairedResult.rawData,isError:r.pairedResult.isError}:void 0,n=r.messageType==="tool"&&r.toolName==="Edit"&&!!r.expandableContent;return{listKey:r.listKey,kind:e,bodyText:r.text,toolName:r.toolName,expandableContent:r.expandableContent,pairedResult:i,rawData:r.rawData,subtype:r.subtype,isUserAligned:r.messageType==="prompt",flags:{showCopy:!0,showRawInfo:!0,useEditDiffForExpandable:n}}}static mapMessageTypeToKind(r){switch(r){case"prompt":return j.userPrompt;case"assistant":return j.assistant;case"tool":return j.tool;case"tool-result":return j.toolResult;case"error":return j.error;case"info":return j.info;case"status":return j.status;case"result":return j.result;case"run-intent":return j.runIntent;case"iteration":return j.iteration;case"thinking":return j.thinking;case"status-update":return j.statusUpdate;case"raw":return j.raw;case"tool-group":return j.toolGroup;case"sub-agent-group":return j.subAgentGroup;default:return j.info}}};var ze=(()=>{class t{sanitizer;constructor(e){this.sanitizer=e}transform(e){if(!e)return this.sanitizer.bypassSecurityTrustHtml('<span class="text-neutral-500">{}</span>');try{let i=JSON.stringify(e,null,2),n=this.highlightJson(i);return this.sanitizer.bypassSecurityTrustHtml(n)}catch{return this.sanitizer.bypassSecurityTrustHtml('<span class="text-neutral-500">{}</span>')}}MULTILINE_THRESHOLD=150;highlightJson(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/("(\\u[\da-fA-F]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,n=>/^"/.test(n)?/:$/.test(n)?`<span style="color:#7dd3fc">${n}</span>`:n.length>this.MULTILINE_THRESHOLD&&n.includes("\\n")?this.formatMultilineString(n):`<span style="color:#86efac">${n}</span>`:/true|false/.test(n)?`<span style="color:#fbbf24">${n}</span>`:/null/.test(n)?`<span style="color:#a78bfa">${n}</span>`:`<span style="color:#fb923c">${n}</span>`)}formatMultilineString(e){return'<span style="color:#86efac">"</span><span style="display:block;margin:2px 0;padding:4px 8px;border-left:2px solid rgba(134,239,172,0.25);background:rgba(134,239,172,0.04);border-radius:0 4px 4px 0;color:#86efac;opacity:0.85;white-space:pre-wrap;word-break:break-word;font-size:0.9em;line-height:1.5">'+e.slice(1,-1).replace(/\\n/g,`
3
3
  `).replace(/\\t/g," ").replace(/\\r/g,"").replace(/\\"/g,'"').replace(/\\\\/g,"\\")+'</span><span style="color:#86efac">"</span>'}static \u0275fac=function(i){return new(i||t)(st(Ee,16))};static \u0275pipe=se({name:"ccSessionJsonFormat",type:t,pure:!0})}return t})();var _i=["chatScroll"],mi=["sessionInput"],ui=(t,r)=>r.promptListKey,Ze=(t,r)=>r.listKey,Ci=(t,r)=>r.trackKey,Zt=t=>({$implicit:t});function xi(t,r){if(t&1){let e=y();o(0,"div",14),f("click",function(){u(e);let n=c();return C(n.handleStickyPromptClick())}),o(1,"div",15)(2,"span",16),d(3,"YOU"),s(),o(4,"span",17),d(5),s(),E(),o(6,"svg",18),g(7,"path",19),s()()()}if(t&2){let e=c();a(5),k(e.lastPromptText_$())}}function fi(t,r){t&1&&d(0," Plan ")}function hi(t,r){t&1&&d(0," Ask user ")}function gi(t,r){if(t&1&&d(0),t&2){let e=c(3).$implicit;$(" ",e.toolName," ")}}function Si(t,r){if(t&1){let e=y();o(0,"button",34),f("click",function(){u(e);let n=c(3).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",35),d(2,"i"),s()()}}function bi(t,r){if(t&1){let e=y();o(0,"app-s-agent-tool-plan-view",36),f("accepted",function(){u(e);let n=c(4);return C(n.handlePlanAccepted())}),s()}if(t&2){let e=c(3).$implicit;b("rawData",e.rawData)}}function vi(t,r){if(t&1&&g(0,"app-s-agent-tool-ask-user-question",33),t&2){let e=c(3).$implicit;b("rawData",e.rawData)}}function wi(t,r){if(t&1&&g(0,"app-s-agent-tool-todo-list",33),t&2){let e=c(3).$implicit;b("rawData",e.rawData)}}function yi(t,r){if(t&1&&(o(0,"div",29),g(1,"span",30),F(2,"sAgentToolIcon"),o(3,"span",31),x(4,fi,1,0)(5,hi,1,0)(6,gi,1,1),s(),x(7,Si,3,0,"button",32),s(),x(8,bi,1,1,"app-s-agent-tool-plan-view",33)(9,vi,1,1,"app-s-agent-tool-ask-user-question",33)(10,wi,1,1,"app-s-agent-tool-todo-list",33)),t&2){let e,i,n,l=c(2).$implicit;a(),b("innerHTML",U(2,4,(e=l.toolName)!==null&&e!==void 0?e:""),J),a(3),m((i=l.toolName)==="ExitPlanMode"?4:i==="AskUserQuestion"?5:6),a(3),m(l.rawData?7:-1),a(),m((n=l.toolName)==="ExitPlanMode"?8:n==="AskUserQuestion"?9:10)}}function Ti(t,r){if(t&1){let e=y();o(0,"app-s-agent-tool-call-card",37),f("toolRawInfoClick",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))})("pairedRawInfoClick",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenPairedResultInfo(n))}),s()}if(t&2){let e,i,n,l,p=c(2).$implicit;b("toolName",(e=p.toolName)!==null&&e!==void 0?e:"")("summaryText",p.text)("toolDescription",(i=p.toolDescription)!==null&&i!==void 0?i:"")("isPathRtl",p.toolName==="Read")("showToolRawInfo",!!p.rawData||!!(p.pairedResult!=null&&p.pairedResult.rawData))("expandableContent",(n=p.expandableContent)!==null&&n!==void 0?n:"")("pairedResult",(l=p.pairedResult)!==null&&l!==void 0?l:null)}}function ki(t,r){if(t&1&&(o(0,"div",20)(1,"div",27),x(2,yi,11,6)(3,Ti,1,7,"app-s-agent-tool-call-card",28),s()()),t&2){let e=c().$implicit;a(2),m(e.toolName==="TodoWrite"||e.toolName==="ExitPlanMode"||e.toolName==="AskUserQuestion"?2:3)}}function $i(t,r){if(t&1){let e=y();o(0,"app-s-agent-tool-call-card",45),f("toolRawInfoClick",function(){u(e);let n=c().$implicit,l=c(3);return C(l.handleOpenInfoPopup(n))})("pairedRawInfoClick",function(){u(e);let n=c().$implicit,l=c(3);return C(l.handleOpenPairedResultInfo(n))}),s()}if(t&2){let e,i,n,l,p=c().$implicit;b("toolName",(e=p.toolName)!==null&&e!==void 0?e:"")("summaryText",p.text)("toolDescription",(i=p.toolDescription)!==null&&i!==void 0?i:"")("isPathRtl",p.toolName==="Read")("showToolRawInfo",!!p.rawData||!!(p.pairedResult!=null&&p.pairedResult.rawData))("expandableContent",(n=p.expandableContent)!==null&&n!==void 0?n:"")("pairedResult",(l=p.pairedResult)!==null&&l!==void 0?l:null)}}function Ii(t,r){if(t&1&&(o(0,"div",44)(1,"span",46),d(2),s()()),t&2){let e=c().$implicit;a(2),k(e.text)}}function Di(t,r){if(t&1&&x(0,$i,1,7,"app-s-agent-tool-call-card",43)(1,Ii,3,1,"div",44),t&2){let e=r.$implicit;m(e.messageType==="tool"?0:-1),a(),m(e.messageType==="tool-result"?1:-1)}}function Ei(t,r){if(t&1&&(o(0,"div",20)(1,"details",38)(2,"summary",39),g(3,"span",30),F(4,"sAgentToolIcon"),o(5,"span",31),d(6),s(),E(),o(7,"svg",40),g(8,"path",41),s()(),L(),o(9,"div",42),N(10,Di,2,2,null,null,Ze),s()()()),t&2){let e=c().$implicit;a(3),b("innerHTML",U(4,2,e.groupToolName),J),a(3),k(e.text),a(4),z(e.groupItems)}}function Ai(t,r){t&1&&(o(0,"span",58),g(1,"span",63),o(2,"span",64),d(3,"running"),s()())}function Mi(t,r){if(t&1){let e=y();o(0,"button",65),f("click",function(n){u(e);let l=c(2).$implicit;return c().handleOpenInfoPopup(l.groupItems[0]),C(n.stopPropagation())}),o(1,"span",66),d(2,"i"),s()()}}function Pi(t,r){if(t&1){let e=y();o(0,"details",67),f("click",function(n){return u(e),C(n.stopPropagation())}),o(1,"summary",68),E(),o(2,"svg",69),g(3,"path",41),s(),L(),o(4,"span",70),d(5),s()(),o(6,"div",71)(7,"pre",72),d(8),s()()()}if(t&2){let e=c(2).$implicit;a(5),k(e.groupItems[0].pairedResult.text),a(3),k(e.groupItems[0].pairedResult.expandableContent||e.groupItems[0].pairedResult.text)}}function Vi(t,r){if(t&1&&Qe(0,73),t&2){let e=c().$implicit;c(3);let i=ge(2);b("ngTemplateOutlet",i)("ngTemplateOutletContext",Ge(2,Zt,e))}}function Ri(t,r){if(t&1&&x(0,Vi,1,4,"ng-container",73),t&2){let e=r.$index;m(e>0?0:-1)}}function Li(t,r){if(t&1&&(o(0,"div",21)(1,"details",47)(2,"summary",48),E(),o(3,"svg",49),g(4,"rect",50)(5,"circle",51)(6,"circle",52)(7,"path",53)(8,"path",54),s(),L(),o(9,"span",55),d(10,"Sub-agent"),s(),o(11,"span",56),d(12),s(),o(13,"span",57),d(14),s(),x(15,Ai,4,0,"span",58)(16,Mi,3,0,"button",59),E(),o(17,"svg",60),g(18,"path",41),s()(),x(19,Pi,9,2,"details",61),L(),o(20,"div",62),N(21,Ri,1,1,null,null,Ze),s()()()),t&2){let e,i=c().$implicit;a(12),k(i.text),a(2),k(((e=i.groupItems==null?null:i.groupItems.length)!==null&&e!==void 0?e:0)>1?i.groupItems.length-1:0),a(),m(!(i.groupItems==null||i.groupItems[0]==null)&&i.groupItems[0].pairedResult?-1:15),a(),m(!(i.groupItems==null||i.groupItems[0]==null)&&i.groupItems[0].rawData?16:-1),a(3),m(!(i.groupItems==null||i.groupItems[0]==null)&&i.groupItems[0].pairedResult?19:-1),a(2),z(i.groupItems)}}function Oi(t,r){if(t&1){let e=y();o(0,"button",78),f("click",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",79),d(2,"i"),s()()}}function Fi(t,r){if(t&1&&(o(0,"div",22)(1,"div",74),g(2,"span",75),o(3,"span",76),d(4),s(),x(5,Oi,3,0,"button",77),s()()),t&2){let e=c().$implicit;a(4),k(e.text),a(),m(e.rawData?5:-1)}}function Ui(t,r){t&1&&(o(0,"span",83),d(1,"Run intent: "),s())}function ji(t,r){if(t&1&&(o(0,"div",23)(1,"div",80),g(2,"span",81),o(3,"span",82),x(4,Ui,2,0,"span",83),d(5),s()()()),t&2){let e=c().$implicit;a(4),m(e.isLatestMessage?-1:4),a(),$(" ",e.text," ")}}function Bi(t,r){if(t&1&&(o(0,"div",20)(1,"div",84),g(2,"span",85),o(3,"span",86),d(4),s()()()),t&2){let e=c().$implicit;a(4),k(e.text)}}function Ni(t,r){if(t&1){let e=y();o(0,"button",98),f("click",function(n){u(e);let l=c(2).$implicit;return c().handleOpenInfoPopup(l),C(n.stopPropagation())}),o(1,"span",99),d(2,"i"),s()()}}function zi(t,r){if(t&1&&(o(0,"div",24)(1,"details",87)(2,"summary",88),E(),o(3,"svg",89),g(4,"circle",90)(5,"path",91)(6,"circle",92),s(),L(),o(7,"span",93),d(8,"Thinking"),s(),o(9,"span",94),d(10),s(),x(11,Ni,3,0,"button",95),s(),o(12,"div",96)(13,"pre",97),d(14),s()()()()),t&2){let e=c().$implicit;a(10),k(e.text),a(),m(e.rawData?11:-1),a(3),k(e.text)}}function Wi(t,r){if(t&1){let e=y();o(0,"button",104),f("click",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",105),d(2,"i"),s()()}}function Hi(t,r){if(t&1&&(o(0,"div",25)(1,"div",100),g(2,"span",101),o(3,"span",102),d(4),s(),x(5,Wi,3,0,"button",103),s()()),t&2){let e=c().$implicit;a(4),k(e.text),a(),m(e.rawData?5:-1)}}function qi(t,r){if(t&1&&(o(0,"span",110),d(1),s()),t&2){let e=c(2).$implicit;a(),k(e.subtype)}}function Ki(t,r){if(t&1){let e=y();o(0,"button",112),f("click",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",113),d(2,"i"),s()()}}function Qi(t,r){if(t&1&&(o(0,"div",26)(1,"div",106),E(),o(2,"svg",107),g(3,"path",108),s(),L(),o(4,"span",109),d(5),s(),x(6,qi,2,1,"span",110)(7,Ki,3,0,"button",111),s()()),t&2){let e=c().$implicit;a(5),k(e.text),a(),m(e.subtype?6:-1),a(),m(e.rawData?7:-1)}}function Gi(t,r){if(t&1){let e=y();o(0,"button",121),f("click",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",122),d(2,"i"),s()()}}function Ji(t,r){if(t&1&&(g(0,"pre",120),F(1,"ccSessionJsonFormat")),t&2){let e=c(2).$implicit;b("innerHTML",U(1,1,e.rawData),J)}}function Xi(t,r){if(t&1&&(o(0,"div",24)(1,"div",114)(2,"div",115),g(3,"span",116),o(4,"span",117),d(5),s(),o(6,"span",118),d(7,"needs brief"),s(),x(8,Gi,3,0,"button",119),s(),x(9,Ji,2,3,"pre",120),s()()),t&2){let e=c().$implicit;a(5),k(e.text),a(3),m(e.rawData?8:-1),a(),m(e.rawData?9:-1)}}function Yi(t,r){if(t&1&&x(0,ki,4,1,"div",20)(1,Ei,12,4,"div",20)(2,Li,23,5,"div",21)(3,Fi,6,2,"div",22)(4,ji,6,2,"div",23)(5,Bi,5,1,"div",20)(6,zi,15,3,"div",24)(7,Hi,6,2,"div",25)(8,Qi,8,3,"div",26)(9,Xi,10,3,"div",24),t&2){let e,i=r.$implicit;m((e=i.messageType)==="tool"?0:e==="tool-group"?1:e==="sub-agent-group"?2:e==="result"?3:e==="run-intent"?4:e==="iteration"?5:e==="thinking"?6:e==="status"?7:e==="status-update"?8:e==="raw"?9:-1)}}function Zi(t,r){t&1&&(o(0,"div",6)(1,"div",123),E(),o(2,"svg",124),g(3,"path",108),s(),L(),o(4,"span",125),d(5,"Loading older messages..."),s()()())}function eo(t,r){if(t&1){let e=y();o(0,"div",126)(1,"div",128)(2,"app-s-agent-console-message-bubble",129),f("ttsCached",function(n){u(e);let l=c(2);return C(l.handleTtsCached(n))}),s()()()}if(t&2){let e=c().$implicit;Ce("data-prompt-key",e.promptListKey)("data-prompt-text",e.promptText),a(2),b("view",e.promptBubbleView)}}function to(t,r){if(t&1){let e=y();o(0,"div",136)(1,"div",137)(2,"app-s-agent-console-message-bubble",129),f("ttsCached",function(n){u(e);let l=c(4);return C(l.handleTtsCached(n))}),s()()()}if(t&2){let e=c().$implicit;X("justify-end",e.messageType==="prompt"),a(),O(e.messageType==="prompt"?"w-[85%]":e.messageType==="tool"||e.messageType==="tool-result"?"w-[90%] ml-4":"w-[90%]"),a(),b("view",e.bubbleView)}}function no(t,r){if(t&1&&Qe(0,73),t&2){let e=c().$implicit;c(3);let i=ge(2);b("ngTemplateOutlet",i)("ngTemplateOutletContext",Ge(2,Zt,e))}}function io(t,r){if(t&1&&x(0,to,3,5,"div",135)(1,no,1,4,"ng-container",73),t&2){let e=r.$implicit;m(e.bubbleView?0:1)}}function oo(t,r){if(t&1&&(o(0,"details",127)(1,"summary",130),E(),o(2,"svg",131),g(3,"path",41),s(),L(),o(4,"span",132),d(5),s(),g(6,"div",133),s(),o(7,"div",134),N(8,io,2,1,null,null,Ze),s()()),t&2){let e=c().$implicit;a(5),$("",e.items.length," events"),a(3),z(e.items)}}function so(t,r){if(t&1&&x(0,eo,3,3,"div",126)(1,oo,10,1,"details",127),t&2){let e=r.$implicit;m(e.promptBubbleView?0:-1),a(),m(e.items.length?1:-1)}}function ao(t,r){t&1&&(o(0,"div",138)(1,"div",140),g(2,"div",141),s(),o(3,"div",142),g(4,"div",143),s(),o(5,"div",140),g(6,"div",144),s(),o(7,"div",145),E(),o(8,"svg",146),g(9,"path",108),s(),L(),o(10,"span",147),d(11,"Loading chat history\u2026"),s()()())}function ro(t,r){t&1&&(o(0,"div",139)(1,"span",148),d(2,"\u{1F4AC}"),s(),o(3,"span",149),d(4,"Send a prompt to start the conversation"),s()())}function lo(t,r){if(t&1&&x(0,ao,12,0,"div",138)(1,ro,5,0,"div",139),t&2){let e=c();m(e.ccSession_DS.assembledMessagesLoaded_$()?1:0)}}function co(t,r){t&1&&(E(),o(0,"svg",153),g(1,"path",154),s(),L(),o(2,"span"),d(3,"Copied!"),s())}function po(t,r){t&1&&(E(),o(0,"svg",155),g(1,"path",156),s(),L(),o(2,"span"),d(3,"Copy last 30 events"),s())}function _o(t,r){t&1&&(E(),o(0,"svg",153),g(1,"path",154),s(),L(),o(2,"span"),d(3,"Copied!"),s())}function mo(t,r){t&1&&(E(),o(0,"svg",155),g(1,"rect",157)(2,"path",158),s(),L(),o(3,"span"),d(4,"Copy JSON"),s())}function uo(t,r){if(t&1&&(o(0,"section")(1,"div",159),d(2,"Primary (message / tool call)"),s(),o(3,"pre",160),d(4),s()()),t&2){let e=c();a(4),k(e.primaryJson)}}function Co(t,r){if(t&1&&(o(0,"div",161)(1,"div",162),d(2),s(),o(3,"pre",160),d(4),s()()),t&2){let e=r.$implicit,i=c(2);a(2),Y(" Part ",e.index+1," / ",i.streamParts.length," "),a(2),k(e.json)}}function xo(t,r){if(t&1&&(o(0,"section")(1,"div",159),d(2,"Stream mirror payloads (each chunk)"),s(),N(3,Co,5,3,"div",161,Ci),s()),t&2){let e=c();a(3),z(e.streamParts)}}function fo(t,r){if(t&1&&(o(0,"section")(1,"div",159),d(2,"Paired tool result"),s(),o(3,"pre",160),d(4),s()()),t&2){let e=c();a(4),k(e.pairedJson)}}function ho(t,r){if(t&1){let e=y();o(0,"div",150)(1,"button",151),f("click",function(){u(e);let n=c();return C(n.handleCopyLast30Events())}),x(2,co,4,0)(3,po,4,0),s(),o(4,"button",151),f("click",function(){u(e);let n=c();return C(n.handleCopyInfoPopup())}),x(5,_o,4,0)(6,mo,5,0),s()(),o(7,"div",152),x(8,uo,5,1,"section")(9,xo,5,0,"section")(10,fo,5,1,"section"),s()}if(t&2){let e=r,i=c();a(),O(i.isLast30Copied_$()?"bg-green-500/15 border border-green-500/30 text-green-300":"bg-neutral-800 border border-neutral-700 text-neutral-400 hover:text-neutral-200 hover:border-neutral-600"),a(),m(i.isLast30Copied_$()?2:3),a(2),O(i.isInfoCopied_$()?"bg-green-500/15 border border-green-500/30 text-green-300":"bg-neutral-800 border border-neutral-700 text-neutral-400 hover:text-neutral-200 hover:border-neutral-600"),a(),m(i.isInfoCopied_$()?5:6),a(3),m(e.primaryJson?8:-1),a(),m(e.showStreamBreakdown?9:-1),a(),m(e.pairedJson?10:-1)}}var en=(()=>{class t{sessionId=K("");ccSession_DS=D(H);detailUi_DS=D(G);sessionQueue_DS=D(Ut);voiceInputUi_DS=D($t);ttsCachedKeys_$=v(new Set);handleTtsCached(e){this.ttsCachedKeys_$.update(i=>new Set([...i,e]))}promptInput_$=v("");isAutoScroll_$=v(!0);isSending_$=v(!1);isExecuting_$=A(()=>this.ccSession_DS.selectedSession_$()?.session?.status==="running");selectedMode_$=v(T.loadSessionMode()||ye.normal);selectedEffort_$=v(T.loadSessionEffort()||ce.high);selectedModel_$=v(T.loadSessionModel()||ue.sonnet);modeOptions=[ye.normal,ye.plan];effortOptions=[ce.none,ce.low,ce.mid,ce.high];modelOptions=[ue.sonnet,ue.opus,ue.haiku];modelName_$=A(()=>{let e=this.ccSession_DS.selectedSession_$();return e?.session?.activeModel||e?.session?.model||""});usage_$=A(()=>this.ccSession_DS.sessionUsage_$());usageText_$=A(()=>{let e=this.usage_$();if(!e.totalTokens)return"";let i=e.totalTokens>1e3?`${(e.totalTokens/1e3).toFixed(1)}k`:String(e.totalTokens),n=e.costUsd>0?` \xB7 $${e.costUsd.toFixed(4)}`:"";return`${i} tokens${n}`});chatTurns_$=A(()=>{let e=this.ccSession_DS.assembledMessages_$();if(e.length>0)return this.buildTurnsFromAssembledMessages(e);if(!this.ccSession_DS.assembledMessagesLoaded_$())return[];let i=this.ccSession_DS.consoleMessages_$(),n=this.isShowSessionStatus(),l=this.isShowAgentUpdates(),p=this.sessionId(),_=this.ttsCachedKeys_$(),w=[],h=null;for(let S of i)if(!(S.type==="status-update"&&!l))if(S.type==="prompt")h={promptText:S.text,promptListKey:S.listKey,promptBubbleView:{listKey:S.listKey,kind:j.userPrompt,bodyText:S.text,timestampIso:S.timestamp,isUserAligned:!0,flags:{showCopy:!0,showRawInfo:!1,useEditDiffForExpandable:!1},tts:S.text.trim().length>0?{messageKey:S.listKey,sessionId:p,role:"user",content:S.text,timestampIso:S.timestamp,hasTtsAudio:_.has(S.listKey)}:void 0,imageDataUrls:S.imageDataUrls},items:[]},w.push(h);else{h||(h={promptText:"",promptListKey:`__no-prompt-${w.length}`,items:[]},w.push(h));let I={listKey:S.listKey,messageType:S.type,text:S.text,isStatus:S.isStatus,expandableContent:S.expandableContent,isLatestMessage:!1,rawData:S.rawData,timestamp:S.timestamp,subtype:S.subtype,parentAgentId:S.parentAgentId};S.type==="tool"&&(I.toolName=this.extractToolNameFromMsg(S),I.toolDescription=this.extractToolDescription(S.rawData)),h.items.push(I)}if(w.length){let S=w[w.length-1];S.items.length&&(S.items[S.items.length-1].isLatestMessage=!0)}if(!n)for(let S of w){let I=-1;for(let P=S.items.length-1;P>=0;P--)if(S.items[P].isStatus){I=P;break}I>=0&&(S.items=S.items.filter((P,W)=>!P.isStatus||W===I))}for(let S of w)S.items=this.pairToolCallsWithResults(S.items);for(let S of w)S.items=this.groupSubAgentItems(S.items);for(let S of w)S.items=this.groupConsecutiveToolItems(S.items);for(let S of w)S.items=S.items.map(I=>{if(!(I.messageType==="assistant"||I.messageType==="error"||I.messageType==="tool-result"||I.messageType==="info"))return I;let W=Te.fromDisplayItem(I);return I.messageType==="assistant"&&I.text.trim().length>0&&(W.tts={messageKey:I.listKey,sessionId:p,role:"assistant",content:I.text,timestampIso:I.timestamp??new Date().toISOString(),hasTtsAudio:_.has(I.listKey)}),qe(He({},I),{bubbleView:W})});return w});stickyPromptInfo_$=v(null);lastPromptText_$=A(()=>this.stickyPromptInfo_$()?.promptText??"");isShowSessionStatus=K(!1);isShowAgentUpdates=K(!0);isShowStickyPrompt_$=v(!1);isInfoPopupOpen_$=v(!1);infoPopupBundle_$=v(null);infoPopupTitle_$=v("");isInfoCopied_$=v(!1);isLast30Copied_$=v(!1);chatScrollRef;sessionInputRef;pendingAttachments_$=v([]);previousItemCount=0;constructor(){De(()=>{let e=this.sessionId();if(e){let i=T.loadPromptDraft(e);this.promptInput_$.set(i),this.sessionQueue_DS.subscribeToSession({sessionId:e,baseRoute:"cc-session"})}},{allowSignalWrites:!0})}ngOnDestroy(){this.sessionQueue_DS.unsubscribe()}ngAfterViewChecked(){let e=this.ccSession_DS.assembledMessages_$(),i=this.ccSession_DS.consoleMessages_$(),n=e.length+i.length;this.isAutoScroll_$()&&n>this.previousItemCount&&this.scrollToBottom(),this.previousItemCount=n}handleSendPrompt(){return V(this,null,function*(){let e=this.promptInput_$().trim(),i=this.pendingAttachments_$();if(!e&&!i.length||this.isSending_$())return;let n=this.sessionId();if(n){this.isSending_$.set(!0),T.clearPromptDraft(n);try{yield this.ccSession_DS.sendPrompt({sessionId:n,content:e,attachments:i.length>0?i:void 0}),this.promptInput_$.set(""),this.sessionInputRef?.clearAttachments()}catch{T.savePromptDraft(n,e)}finally{this.isSending_$.set(!1)}}})}handleAttachmentsChanged(e){this.pendingAttachments_$.set(e)}handlePromptInputChange(e){this.promptInput_$.set(e);let i=this.sessionId();i&&T.savePromptDraft(i,e)}handleQuickCastAction(e){return V(this,null,function*(){let i=e.trim(),n=this.sessionId();if(!(!i||!n||this.isSending_$())){this.isSending_$.set(!0);try{yield this.ccSession_DS.sendPrompt({sessionId:n,content:i})}finally{this.isSending_$.set(!1)}}})}handleVoiceSegment(e){let i=this.promptInput_$().trim(),n=jt.deduplicateOverlap(i,e.text,e.overlapPrevMs).trim();if(n.length>0){let l=i.length>0?`${i} ${n}`:n;this.handlePromptInputChange(l)}this.voiceInputUi_DS.autoSendAfterVoice_$()&&e.isFinal&&this.handleSendPrompt()}handleRestartRunnerClicked(){let e=this.sessionId().trim();e&&this.ccSession_DS.restartRunner({sessionId:e})}handlePlanAccepted(){let e=this.sessionId();e&&this.ccSession_DS.sendPrompt({sessionId:e,content:"plan approved, proceed"}).catch(i=>{ie.DyFM_Log.error("[CCAP] cc-console plan-accept send",i)})}handleKeydown(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.handleSendPrompt())}handleSelectMode(e){this.selectedMode_$.set(e),T.saveSessionMode(e);let i=this.sessionId();i&&this.ccSession_DS.updateSessionConfig({sessionId:i,mode:e}).catch(n=>{ie.DyFM_Log.error("[CCAP] cc-session-console config-update mode",n)})}handleSelectEffort(e){this.selectedEffort_$.set(e),T.saveSessionEffort(e);let i=this.sessionId();i&&this.ccSession_DS.updateSessionConfig({sessionId:i,reasoningEffort:e}).catch(n=>{ie.DyFM_Log.error("[CCAP] cc-session-console config-update effort",n)})}handleSelectModel(e){this.selectedModel_$.set(e),T.saveSessionModel(e);let i=this.sessionId();i&&this.ccSession_DS.updateSessionConfig({sessionId:i,model:e}).catch(n=>{ie.DyFM_Log.error("[CCAP] cc-session-console config-update model",n)})}handleChatScroll(){let e=this.chatScrollRef?.nativeElement;if(!e)return;this.updateStickyPrompt(e);let i=e.scrollHeight-e.scrollTop-e.clientHeight<60;this.isAutoScroll_$.set(i),e.scrollTop<40&&this.ccSession_DS.assembledMessagesHasMore_$()&&this.loadOlderMessages(e)}updateStickyPrompt(e){if(!(e.scrollTop>80)){this.isShowStickyPrompt_$.set(!1),this.stickyPromptInfo_$.set(null);return}let l=e.getBoundingClientRect().top+50,p=e.querySelectorAll("[data-prompt-key]"),_=this.isShowStickyPrompt_$(),w=l-8,h=l+24,S=null;for(let I=p.length-1;I>=0;I--){let P=p[I],W=P.getBoundingClientRect(),oe=_?h:w;if(W.bottom<oe){let te=P.getAttribute("data-prompt-key")??"",ne=P.getAttribute("data-prompt-text")??"";te&&ne&&(S={promptListKey:te,promptText:ne});break}}this.stickyPromptInfo_$.set(S),this.isShowStickyPrompt_$.set(!!S)}handleStickyPromptClick(){let e=this.stickyPromptInfo_$();if(!e)return;let i=this.chatScrollRef?.nativeElement;if(!i)return;let n=i.querySelector(`[data-prompt-key="${e.promptListKey}"]`);if(!n)return;let l=i.getBoundingClientRect(),p=n.getBoundingClientRect(),_=58;i.scrollTop+=p.top-l.top-_}loadOlderMessages(e){return V(this,null,function*(){let i=this.sessionId();if(!i)return;let n=e.scrollHeight;yield this.ccSession_DS.loadOlderAssembledMessages({sessionId:i}),requestAnimationFrame(()=>{let l=e.scrollHeight;e.scrollTop=l-n,requestAnimationFrame(()=>{this.updateStickyPrompt(e)})})})}handleOpenInfoPopup(e){Ye.ccItemHasAnyRaw(e)&&(this.infoPopupTitle_$.set(e.messageType),this.infoPopupBundle_$.set(Ye.buildForCcConsoleItem(e)),this.isInfoPopupOpen_$.set(!0))}handleOpenPairedResultInfo(e){this.handleOpenInfoPopup(e)}handleCloseInfoPopup(){this.isInfoPopupOpen_$.set(!1),this.infoPopupBundle_$.set(null),this.isInfoCopied_$.set(!1),this.isLast30Copied_$.set(!1)}handleCopyInfoPopup(){let e=this.infoPopupBundle_$();e&&navigator.clipboard.writeText(e.copyJsonString).then(()=>{this.isInfoCopied_$.set(!0),setTimeout(()=>{this.isInfoCopied_$.set(!1)},2e3)}).catch(i=>{ie.DyFM_Log.error("[CCAP] cc-session-console clipboard-copy",i)})}handleCopyLast30Events(){let i=this.ccSession_DS.assembledMessages_$().slice(-30),n=JSON.stringify(i,null,2);navigator.clipboard.writeText(n).then(()=>{this.isLast30Copied_$.set(!0),setTimeout(()=>{this.isLast30Copied_$.set(!1)},2e3)}).catch(l=>{ie.DyFM_Log.error("[CCAP] cc-session-console clipboard-copy-last30",l)})}pairToolCallsWithResults(e){let i=new Map;for(let l=0;l<e.length;l++){let p=e[l];if(p.messageType==="tool"&&p.rawData){let _=typeof p.rawData.id=="string"?p.rawData.id:"";_&&i.set(_,l)}}if(!i.size)return e;let n=new Set;for(let l=0;l<e.length;l++){let p=e[l];if(p.messageType==="tool-result"&&p.rawData){let _=typeof p.rawData.tool_use_id=="string"?p.rawData.tool_use_id:"",w=_?i.get(_):void 0;w!==void 0&&(e[w].pairedResult={text:p.text,expandableContent:p.expandableContent,rawData:p.rawData},n.add(l))}}return n.size?e.filter((l,p)=>!n.has(p)):e}extractToolNameFromMsg(e){if(e.rawData){let n=e.rawData.name??e.rawData.tool_name??e.rawData.last_tool_name;if(typeof n=="string")return n}let i=e.text.indexOf(":");return i>0?e.text.substring(0,i).trim():e.text.trim()}extractToolDescription(e){if(!e)return;let i=e.input;if(!i||typeof i!="object")return;let n=i.description;return typeof n=="string"?n:void 0}extractToolName(e){if(e.toolName)return e.toolName;if(e.rawData){let n=e.rawData.name??e.rawData.tool_name??e.rawData.last_tool_name;if(typeof n=="string")return n}let i=e.text.indexOf(":");return i>0?e.text.substring(0,i).trim():e.text.trim()}groupSubAgentItems(e){let i=new Map;for(let _=0;_<e.length;_++){let w=e[_];if(w.messageType==="tool"&&w.toolName==="Agent"&&w.rawData){let h=typeof w.rawData.id=="string"?w.rawData.id:"";h&&i.set(h,{item:w,index:_})}}if(!i.size)return e;let n=new Map,l=new Set;for(let _=0;_<e.length;_++){let w=e[_];if(w.parentAgentId&&(l.add(_),i.has(w.parentAgentId))){let h=n.get(w.parentAgentId)??[];h.push(w),n.set(w.parentAgentId,h)}}let p=[];for(let _=0;_<e.length;_++){if(l.has(_))continue;let w=e[_];if(w.messageType==="tool"&&w.toolName==="Agent"&&w.rawData){let h=typeof w.rawData.id=="string"?w.rawData.id:"",S=n.get(h)??[],I=[w,...S],P=w.rawData?.input,W=P&&typeof P=="object"&&typeof P.subagent_type=="string"?P.subagent_type:"",oe=P&&typeof P=="object"&&typeof P.description=="string"?P.description:"",te=W?`${W}: ${oe||"..."}`:oe||"Sub-agent",ne=this.groupConsecutiveToolItems(I);p.push({listKey:w.listKey,messageType:"sub-agent-group",text:te,isStatus:!1,isLatestMessage:!1,groupItems:ne,groupToolName:W||"Agent"})}else p.push(w)}return p}buildTurnsFromAssembledMessages(e){let i=this.isShowAgentUpdates(),n=this.isShowSessionStatus(),l=this.sessionId(),p=this.ttsCachedKeys_$(),_=[],w=null;for(let h of e){let S=h.messageRole==="status-update"&&h.subtype==="task_progress"&&!!h.rawData?.last_tool_name;if(!(h.messageRole==="status-update"&&!i&&!S))if(h.messageRole==="user"&&h.isUserAligned===!0)w={promptText:h.bodyText,promptListKey:h.messageKey,promptBubbleView:{listKey:h.messageKey,kind:j.userPrompt,bodyText:h.bodyText,timestampIso:h.timestamp,isUserAligned:!0,rawData:h.rawData,flags:{showCopy:!0,showRawInfo:!!h.rawData,useEditDiffForExpandable:!1},tts:h.bodyText.trim().length>0?{messageKey:h.messageKey,sessionId:l,role:"user",content:h.bodyText,timestampIso:h.timestamp,hasTtsAudio:p.has(h.messageKey)}:void 0},items:[]},_.push(w);else{w||(w={promptText:"",promptListKey:`__no-prompt-${_.length}`,items:[]},_.push(w));let I=h.rawData&&typeof h.rawData.last_tool_name=="string"?h.rawData.last_tool_name:"",P=h.messageRole==="status-update"&&h.subtype==="task_progress"&&!!I,W=P?"tool":h.messageRole,oe=W==="status"||W==="status-update",te=t.mapAssembledRoleToMessageType(W),ne={listKey:h.messageKey,messageType:te,text:P?`${I}: ${h.bodyText}`:h.bodyText,isStatus:oe,expandableContent:h.expandableContent,isLatestMessage:!1,rawData:h.rawData,timestamp:h.timestamp,subtype:h.subtype,parentAgentId:h.parentAgentId,toolName:h.toolName||(P?I:void 0),toolDescription:te==="tool"?this.extractToolDescription(h.rawData):void 0};h.toolResult&&(ne.pairedResult={text:h.toolResult.text,expandableContent:h.toolResult.expandableContent,rawData:h.toolResult.rawData,isError:h.toolResult.isError}),w.items.push(ne)}}if(_.length){let h=_[_.length-1];h.items.length&&(h.items[h.items.length-1].isLatestMessage=!0)}if(!n)for(let h of _){let S=-1;for(let I=h.items.length-1;I>=0;I--)if(h.items[I].isStatus){S=I;break}S>=0&&(h.items=h.items.filter((I,P)=>!I.isStatus||P===S))}for(let h of _)h.items=this.groupSubAgentItems(h.items);for(let h of _)h.items=this.groupConsecutiveToolItems(h.items);for(let h of _)h.items=h.items.map(S=>{if(!(S.messageType==="assistant"||S.messageType==="error"||S.messageType==="tool-result"||S.messageType==="info"))return S;let P=Te.fromDisplayItem(S);return S.messageType==="assistant"&&S.text.trim().length>0&&(P.tts={messageKey:S.listKey,sessionId:l,role:"assistant",content:S.text,timestampIso:S.timestamp??new Date().toISOString(),hasTtsAudio:p.has(S.listKey)}),qe(He({},S),{bubbleView:P})});return _}groupConsecutiveToolItems(e){let i=[],n=[],l="",p=()=>{if(!n.length)return;let _=n.filter(w=>w.messageType==="tool").length;_>=2?i.push({listKey:n[0].listKey,messageType:"tool-group",text:`${l} \xD7 ${_}`,isStatus:!1,isLatestMessage:!1,groupItems:n,groupToolName:l}):i.push(...n),n=[],l=""};for(let _ of e){if(_.messageType==="tool"){let w=this.extractToolName(_);l&&l!==w&&p(),l=w,n.push(_);continue}if(_.messageType==="tool-result"&&n.length){n.push(_);continue}p(),i.push(_)}return p(),i}static mapAssembledRoleToMessageType(e){switch(e){case"user":return"prompt";case"assistant":return"assistant";case"tool":return"tool";case"tool-result":return"tool-result";case"status":return"status";case"error":return"error";case"info":return"info";case"result":return"result";case"thinking":return"thinking";case"status-update":return"status-update";default:return"info"}}scrollToBottom(){let e=this.chatScrollRef?.nativeElement;e&&(e.scrollTop=e.scrollHeight)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-ccap-cc-console"]],viewQuery:function(i,n){if(i&1&&(xe(_i,5),xe(mi,5)),i&2){let l;fe(l=he())&&(n.chatScrollRef=l.first),fe(l=he())&&(n.sessionInputRef=l.first)}},hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],inputs:{sessionId:[1,"sessionId"],isShowSessionStatus:[1,"isShowSessionStatus"],isShowAgentUpdates:[1,"isShowAgentUpdates"]},decls:20,vars:28,consts:[["itemRenderer",""],["chatScroll",""],["sessionInput",""],[1,"sticky","top-0","z-10","px-4","py-2","bg-ccapBg/95","backdrop-blur-sm","border-b","border-neonCyan/20","shrink-0","cursor-pointer","hover:bg-ccapBg/80","transition-colors","group/sticky"],[1,"relative","flex-1","flex","flex-col","min-h-0"],[1,"flex-1","overflow-y-auto","min-h-0","px-3","py-3",3,"scroll"],[1,"flex","justify-center","py-3"],[3,"sessionId"],[3,"actionSelected"],[3,"restartRunnerClicked","sessionId","showRestartRunner"],[1,"absolute","bottom-4","right-4","z-30","pointer-events-auto"],[3,"transcriptSegmentReady","compactLayout"],["placeholder","Type a message... (Enter to send)",3,"draftTextChange","attachmentsChanged","sendRequested","queueRequested","stopRequested","modeChanged","modelChanged","effortChanged","queueEditStart","queueEditTextChange","queueEditSave","queueEditCancel","queueRemoveItem","queueSendNow","queueMoveUp","queueMoveDown","draftText","isExecuting","isSending","isStopping","enableAttachments","modeOptions","selectedMode","modelOptions","selectedModel","effortOptions","selectedEffort","usageText","textareaRows","queueItems","isQueueLocked","editingQueueItemId","editingQueueText"],["maxWidth","4xl","headerBorderClass","border-neonCyan/30",3,"closed","isOpen","title"],[1,"sticky","top-0","z-10","px-4","py-2","bg-ccapBg/95","backdrop-blur-sm","border-b","border-neonCyan/20","shrink-0","cursor-pointer","hover:bg-ccapBg/80","transition-colors","group/sticky",3,"click"],[1,"flex","items-start","gap-2"],[1,"text-[10px]","text-neonCyan/70","font-medium","mt-0.5","shrink-0"],[1,"text-xs","text-neonCyan/90","line-clamp-2","leading-relaxed","group-hover/sticky:text-neonCyan"],["viewBox","0 0 12 12","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"w-3","h-3","text-neonCyan/40","shrink-0","mt-0.5","group-hover/sticky:text-neonCyan/70","transition-colors"],["d","M6 9V3M3 5.5L6 3l3 2.5"],[1,"flex","justify-start","mb-1.5"],[1,"mb-2"],[1,"flex","justify-start","mb-2","group/msg"],[1,"flex","justify-start","mb-2"],[1,"flex","justify-start","mb-1.5","group/msg"],[1,"flex","justify-center","mb-1.5"],[1,"flex","justify-center","mb-1","group/msg"],[1,"bg-orange-500/5","border","border-orange-500/15","rounded-lg","max-w-[90%]","overflow-hidden"],["layout","full","density","comfortable",3,"toolName","summaryText","toolDescription","isPathRtl","showToolRawInfo","expandableContent","pairedResult"],[1,"flex","items-center","gap-1.5","px-2.5","py-1","border-b","border-orange-500/10"],[1,"text-orange-400","shrink-0","flex","items-center",3,"innerHTML"],[1,"text-[11px]","text-orange-300/90","font-medium"],[1,"ml-auto","shrink-0","w-4","h-4","rounded-full","bg-orange-500/20","border","border-orange-500/30","flex","items-center","justify-center","cursor-pointer","hover:bg-orange-500/40"],[3,"rawData"],[1,"ml-auto","shrink-0","w-4","h-4","rounded-full","bg-orange-500/20","border","border-orange-500/30","flex","items-center","justify-center","cursor-pointer","hover:bg-orange-500/40",3,"click"],[1,"text-[8px]","text-orange-300","font-bold","leading-none"],[3,"accepted","rawData"],["layout","full","density","comfortable",3,"toolRawInfoClick","pairedRawInfoClick","toolName","summaryText","toolDescription","isPathRtl","showToolRawInfo","expandableContent","pairedResult"],["open","",1,"bg-orange-500/5","border","border-orange-500/15","rounded-lg","max-w-[90%]","overflow-hidden"],[1,"flex","items-center","gap-1.5","px-2.5","py-1","cursor-pointer","select-none","hover:bg-orange-500/8","transition-colors"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3","text-orange-400/50","ml-1","transition-transform","[details[open]>&]:rotate-90"],["d","M4.5 2.5l4 3.5-4 3.5","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"],[1,"px-2","pb-1.5","pt-0.5","space-y-0.5"],["layout","nested","density","compact",3,"toolName","summaryText","toolDescription","isPathRtl","showToolRawInfo","expandableContent","pairedResult"],[1,"pl-5","mb-0.5"],["layout","nested","density","compact",3,"toolRawInfoClick","pairedRawInfoClick","toolName","summaryText","toolDescription","isPathRtl","showToolRawInfo","expandableContent","pairedResult"],[1,"text-[10px]","text-neutral-500","line-clamp-1"],[1,"border","border-indigo-500/20","rounded-lg","overflow-hidden","bg-indigo-500/3"],[1,"flex","items-center","gap-1.5","px-2.5","py-1.5","cursor-pointer","select-none","hover:bg-indigo-500/8","transition-colors","list-none","[&::-webkit-details-marker]:hidden","group/sah"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","text-indigo-400","shrink-0"],["x","3","y","5","width","10","height","8","rx","2"],["cx","6","cy","9","r","1"],["cx","10","cy","9","r","1"],["d","M8 2v3"],["d","M6 2h4"],[1,"text-[10px]","text-indigo-400/60","font-medium","uppercase","tracking-wider","shrink-0"],[1,"text-[11px]","text-indigo-300/90","font-medium","truncate"],[1,"text-[9px]","text-indigo-400/40","shrink-0"],["title","Sub-agent in progress \u2014 m\xE9g nincs eredm\xE9ny",1,"flex","items-center","gap-1","text-[10px]","text-amber-300/90","shrink-0"],[1,"shrink-0","w-4","h-4","rounded-full","bg-indigo-500/20","border","border-indigo-500/30","flex","items-center","justify-center","cursor-pointer","hover:bg-indigo-500/40"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3","text-indigo-400/40","ml-auto","shrink-0","transition-transform","[[open]>&]:rotate-90"],[1,"border-t","border-indigo-500/10"],[1,"px-2","pb-2","pt-1","space-y-0.5","border-t","border-indigo-500/10"],["aria-hidden","true",1,"inline-block","w-2","h-2","animate-spin","rounded-full","border","border-amber-400/60","border-t-amber-200"],[1,"uppercase","tracking-wider"],[1,"shrink-0","w-4","h-4","rounded-full","bg-indigo-500/20","border","border-indigo-500/30","flex","items-center","justify-center","cursor-pointer","hover:bg-indigo-500/40",3,"click"],[1,"text-[8px]","text-indigo-300","font-bold","leading-none"],[1,"border-t","border-indigo-500/10",3,"click"],[1,"flex","items-center","gap-1","px-2.5","py-1","bg-indigo-500/5","cursor-pointer","select-none","hover:bg-indigo-500/8","transition-colors","list-none","[&::-webkit-details-marker]:hidden"],["viewBox","0 0 12 12","fill","none",1,"w-2.5","h-2.5","text-indigo-400/40","shrink-0","transition-transform","[[open]>&]:rotate-90"],[1,"text-[10px]","text-indigo-300/40","truncate","leading-relaxed"],[1,"px-2.5","py-1.5","bg-indigo-500/5","border-t","border-indigo-500/8"],[1,"text-[10px]","text-indigo-200/40","whitespace-pre-wrap","break-words","max-h-[200px]","overflow-y-auto","overflow-x-auto","leading-relaxed"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"inline-flex","items-center","gap-1.5","bg-green-500/8","border","border-green-500/20","rounded-lg","px-2.5","py-1"],[1,"w-1.5","h-1.5","rounded-full","bg-green-400","shrink-0"],[1,"text-[11px]","text-green-300/90","break-words","min-w-0"],[1,"ml-1","w-4","h-4","rounded-full","bg-green-500/20","border","border-green-500/30","flex","items-center","justify-center","cursor-pointer","hover:bg-green-500/40"],[1,"ml-1","w-4","h-4","rounded-full","bg-green-500/20","border","border-green-500/30","flex","items-center","justify-center","cursor-pointer","hover:bg-green-500/40",3,"click"],[1,"text-[8px]","text-green-300","font-bold","leading-none"],[1,"inline-flex","items-start","gap-1.5","bg-blue-500/8","border","border-blue-500/20","rounded-lg","px-2.5","py-1.5","max-w-[90%]"],[1,"w-1.5","h-1.5","rounded-full","bg-blue-400","shrink-0","mt-0.5"],[1,"text-[11px]","text-blue-300/90","leading-relaxed","min-w-0","break-words"],[1,"text-blue-400/60","font-medium"],[1,"inline-flex","items-center","gap-1.5","bg-violet-500/8","border","border-violet-500/20","rounded-lg","px-2.5","py-1"],[1,"w-1.5","h-1.5","rounded-full","bg-violet-400","shrink-0"],[1,"text-[11px]","text-violet-300/90","truncate","max-w-[80%]"],[1,"bg-sky-500/5","border","border-sky-500/15","rounded-lg","max-w-[90%]","overflow-hidden"],[1,"flex","items-center","gap-1.5","px-2.5","py-1","cursor-pointer","select-none","hover:bg-sky-500/8","transition-colors"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","text-sky-400","shrink-0"],["cx","8","cy","8","r","6"],["d","M6 6.5a2 2 0 0 1 3.5 1.5c0 1-1.5 1.5-1.5 1.5"],["cx","8","cy","12","r","0.5","fill","currentColor"],[1,"text-[11px]","text-sky-300/80","font-medium"],[1,"text-[10px]","text-sky-400/40","ml-1","truncate","min-w-0"],[1,"ml-auto","shrink-0","w-3.5","h-3.5","rounded-full","bg-sky-500/15","flex","items-center","justify-center","cursor-pointer","hover:bg-sky-500/30"],[1,"px-2.5","pb-2","pt-1"],[1,"text-[10px]","text-sky-200/60","whitespace-pre-wrap","break-words","max-h-[200px]","overflow-y-auto","overflow-x-auto","leading-relaxed"],[1,"ml-auto","shrink-0","w-3.5","h-3.5","rounded-full","bg-sky-500/15","flex","items-center","justify-center","cursor-pointer","hover:bg-sky-500/30",3,"click"],[1,"text-[7px]","text-sky-300/60","font-bold","leading-none"],[1,"inline-flex","items-center","gap-1.5","bg-neonPurple/8","border","border-neonPurple/20","rounded-full","px-3","py-0.5"],[1,"w-1","h-1","rounded-full","bg-neonPurple","animate-pulse","shrink-0"],[1,"text-[10px]","text-neonPurple/80","truncate"],[1,"shrink-0","w-3.5","h-3.5","rounded-full","bg-neonPurple/15","flex","items-center","justify-center","cursor-pointer","hover:bg-neonPurple/30"],[1,"shrink-0","w-3.5","h-3.5","rounded-full","bg-neonPurple/15","flex","items-center","justify-center","cursor-pointer","hover:bg-neonPurple/30",3,"click"],[1,"text-[7px]","text-neonPurple/60","font-bold","leading-none"],[1,"inline-flex","items-center","gap-1.5","bg-teal-500/6","border","border-teal-500/15","rounded-full","px-3","py-0.5","max-w-[85%]"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2",1,"w-3","h-3","text-teal-400/70","shrink-0","animate-spin"],["d","M8 2a6 6 0 0 1 6 6","stroke-linecap","round"],[1,"text-[10px]","text-teal-300/70","truncate"],[1,"text-[8px]","text-teal-400/40","shrink-0"],[1,"shrink-0","w-3.5","h-3.5","rounded-full","bg-teal-500/15","flex","items-center","justify-center","cursor-pointer","hover:bg-teal-500/30"],[1,"shrink-0","w-3.5","h-3.5","rounded-full","bg-teal-500/15","flex","items-center","justify-center","cursor-pointer","hover:bg-teal-500/30",3,"click"],[1,"text-[7px]","text-teal-300/60","font-bold","leading-none"],[1,"bg-neutral-800/60","border","border-amber-500/15","rounded-lg","px-2.5","py-1.5","max-w-[85%]"],[1,"flex","items-center","gap-1.5","mb-1"],[1,"w-1.5","h-1.5","rounded-full","bg-amber-400","shrink-0"],[1,"text-[10px]","text-neutral-400","font-medium","uppercase","tracking-wider"],[1,"text-[8px]","text-amber-500/60","italic","ml-1"],[1,"ml-auto","w-4","h-4","rounded-full","bg-neutral-700/80","border","border-neutral-600/50","flex","items-center","justify-center","cursor-pointer","hover:bg-neutral-600"],[1,"text-[10px]","text-neutral-500","whitespace-pre-wrap","break-words","max-h-[120px]","overflow-y-auto","overflow-x-auto","leading-relaxed",3,"innerHTML"],[1,"ml-auto","w-4","h-4","rounded-full","bg-neutral-700/80","border","border-neutral-600/50","flex","items-center","justify-center","cursor-pointer","hover:bg-neutral-600",3,"click"],[1,"text-[8px]","text-neutral-300","font-bold","leading-none"],[1,"inline-flex","items-center","gap-2","px-3","py-1.5","rounded-full","bg-neutral-800/60","border","border-neutral-700/50"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2",1,"w-3.5","h-3.5","text-neonCyan/70","animate-spin"],[1,"text-[11px]","text-neutral-400"],[1,"flex","justify-end","mb-3"],["open","",1,"mb-3"],[1,"max-w-[85%]","min-w-0"],[3,"ttsCached","view"],[1,"flex","items-center","gap-1.5","mb-1.5","cursor-pointer","select-none","list-none","[&::-webkit-details-marker]:hidden","group/sum"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3","text-neutral-600","shrink-0","transition-transform","[[open]>&]:rotate-90"],[1,"text-[10px]","text-neutral-600","group-hover/sum:text-neutral-400","transition-colors"],[1,"flex-1","h-px","bg-neutral-800","ml-1"],[1,"pl-1"],[1,"flex","mb-2","w-full","min-w-0",3,"justify-end"],[1,"flex","mb-2","w-full","min-w-0"],[1,"min-w-0"],["aria-label","Chat history bet\xF6lt\xE9se folyamatban",1,"flex","flex-col","gap-3","px-2","py-4"],[1,"flex","flex-col","items-center","justify-center","h-full","text-neutral-500","gap-2"],[1,"flex","justify-end"],[1,"w-[60%]","max-w-[420px]","h-12","rounded-lg","bg-neutral-800/50","animate-pulse"],[1,"flex","justify-start"],[1,"w-[75%]","max-w-[520px]","h-20","rounded-lg","bg-neutral-800/50","animate-pulse"],[1,"w-[55%]","max-w-[380px]","h-10","rounded-lg","bg-neutral-800/50","animate-pulse"],[1,"flex","items-center","justify-center","gap-2","mt-2"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2",1,"w-3","h-3","text-neonCyan/70","animate-spin"],[1,"text-[10px]","text-neutral-500"],[1,"text-2xl"],[1,"text-xs"],[1,"flex","justify-end","gap-2","mb-2"],[1,"inline-flex","items-center","gap-1.5","px-2.5","py-1","rounded-md","text-[11px]","transition-colors","cursor-pointer",3,"click"],[1,"space-y-4","max-h-[60vh]","overflow-y-auto","p-1"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5"],["d","M3 8.5l3 3 7-7"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5"],["d","M2 4h12M2 8h12M2 12h8"],["x","5","y","5","width","9","height","9","rx","1.5"],["d","M3 11V3a1.5 1.5 0 0 1 1.5-1.5H11"],[1,"text-[9px]","text-neutral-500","uppercase","tracking-wide","mb-1"],[1,"text-xs","leading-relaxed","whitespace-pre-wrap","break-words","overflow-x-auto","font-mono","text-neutral-300"],[1,"mb-3","last:mb-0"],[1,"text-[8px]","text-neutral-600","mb-0.5"]],template:function(i,n){if(i&1){let l=y();x(0,xi,8,1,"div",3)(1,Yi,10,1,"ng-template",null,0,ct),o(3,"div",4)(4,"div",5,1),f("scroll",function(){return u(l),C(n.handleChatScroll())}),x(6,Zi,6,0,"div",6),N(7,so,2,2,null,null,ui),x(9,lo,2,1),s(),g(10,"app-s-session-schedule-overlay",7),o(11,"app-s-session-quickcast-overlay",8),f("actionSelected",function(_){return u(l),C(n.handleQuickCastAction(_))}),s(),g(12,"app-s-session-coordinator-overlay",7),o(13,"app-s-session-quick-settings-overlay",9),f("restartRunnerClicked",function(){return u(l),C(n.handleRestartRunnerClicked())}),s(),o(14,"div",10)(15,"app-ccap-voice-record-button",11),f("transcriptSegmentReady",function(_){return u(l),C(n.handleVoiceSegment(_))}),s()()(),o(16,"app-s-session-input",12,2),f("draftTextChange",function(_){return u(l),C(n.handlePromptInputChange(_))})("attachmentsChanged",function(_){return u(l),C(n.handleAttachmentsChanged(_))})("sendRequested",function(){return u(l),C(n.handleSendPrompt())})("queueRequested",function(){return u(l),C(n.handleSendPrompt())})("stopRequested",function(){return u(l),C(n.detailUi_DS.handleStopExecution())})("modeChanged",function(_){return u(l),C(n.handleSelectMode(_))})("modelChanged",function(_){return u(l),C(n.handleSelectModel(_))})("effortChanged",function(_){return u(l),C(n.handleSelectEffort(_))})("queueEditStart",function(_){return u(l),C(n.sessionQueue_DS.startEditing(_))})("queueEditTextChange",function(_){return u(l),C(n.sessionQueue_DS.editingText_$.set(_))})("queueEditSave",function(){return u(l),C(n.sessionQueue_DS.saveEdit())})("queueEditCancel",function(){return u(l),C(n.sessionQueue_DS.cancelEdit())})("queueRemoveItem",function(_){return u(l),C(n.sessionQueue_DS.removeItem(_))})("queueSendNow",function(_){return u(l),C(n.sessionQueue_DS.sendNow(_))})("queueMoveUp",function(_){return u(l),C(n.sessionQueue_DS.reorderItem({queueItemId:_,direction:"up"}))})("queueMoveDown",function(_){return u(l),C(n.sessionQueue_DS.reorderItem({queueItemId:_,direction:"down"}))}),s(),o(18,"app-s-modal",13),f("closed",function(){return u(l),C(n.handleCloseInfoPopup())}),x(19,ho,11,9),s()}if(i&2){let l;m(n.isShowStickyPrompt_$()?0:-1),a(6),m(n.ccSession_DS.isLoadingOlderMessages_$()?6:-1),a(),z(n.chatTurns_$()),a(2),m(n.chatTurns_$().length?-1:9),a(),b("sessionId",n.sessionId()),a(2),b("sessionId",n.sessionId()),a(),b("sessionId",n.sessionId())("showRestartRunner",!0),a(2),b("compactLayout",!0),a(),b("draftText",n.promptInput_$())("isExecuting",n.isExecuting_$())("isSending",n.isSending_$())("isStopping",n.detailUi_DS.isStopping_$())("enableAttachments",!0)("modeOptions",n.modeOptions)("selectedMode",n.selectedMode_$())("modelOptions",n.modelOptions)("selectedModel",n.selectedModel_$())("effortOptions",n.effortOptions)("selectedEffort",n.selectedEffort_$())("usageText",n.usageText_$())("textareaRows",2)("queueItems",n.sessionQueue_DS.items_$())("isQueueLocked",n.sessionQueue_DS.isLocked_$())("editingQueueItemId",n.sessionQueue_DS.editingItemId_$())("editingQueueText",n.sessionQueue_DS.editingText_$()),a(2),b("isOpen",n.isInfoPopupOpen_$())("title","Event details \u2014 "+n.infoPopupTitle_$()),a(),m((l=n.infoPopupBundle_$())?19:-1,l)}},dependencies:[_t,ee,Ae,Ue,je,Be,Bt,Nt,Oe,zt,Vt,Rt,Ot,Lt,ze],encapsulation:2})}return t})();var tn=(()=>{class t{transform(e){switch(e){case"status-change":return"bg-purple-600";case"prompt-sent":return"bg-blue-600";case"response-chunk":return"bg-green-600";case"response-complete":return"bg-green-500";case"tool-call-start":return"bg-orange-500";case"tool-call-end":return"bg-orange-400";case"stdout-line":return"bg-neutral-600";case"stderr-line":return"bg-red-500";case"error":return"bg-red-600";case"file-operation":return"bg-cyan-600";case"shell-command":return"bg-yellow-600";case"session-init":return"bg-blue-500";case"config-mismatch":return"bg-amber-600";case"cli-args-record":return"bg-slate-500";case"usage-update":return"bg-teal-600";case"config-change":return"bg-indigo-500";case"runner-overflow":return"bg-red-700";case"interrupted-prompt":return"bg-amber-500";case"cli-chunk":return"bg-neutral-500";default:return"bg-neutral-600"}}static \u0275fac=function(i){return new(i||t)};static \u0275pipe=se({name:"ccSessionEventTypeColor",type:t,pure:!0})}return t})();var wo=["eventList"],yo=(t,r)=>r.sequence;function To(t,r){t&1&&(o(0,"span",14),d(1," CCAP "),s())}function ko(t,r){t&1&&(E(),o(0,"svg",19),g(1,"path",22),s())}function $o(t,r){t&1&&(E(),o(0,"svg",20),g(1,"rect",23)(2,"path",24),s())}function Io(t,r){if(t&1&&(g(0,"pre",21),F(1,"ccSessionJsonFormat")),t&2){let e=c().$implicit;b("innerHTML",U(1,1,e.data),J)}}function Do(t,r){if(t&1){let e=y();o(0,"div",12),f("click",function(){let n=u(e).$implicit,l=c();return C(l.handleToggleEvent(n.sequence))}),o(1,"div",13),x(2,To,2,0,"span",14),o(3,"span",15),F(4,"ccSessionEventTypeColor"),d(5),s(),o(6,"span",16),d(7),s(),o(8,"span",17),F(9,"sAbsoluteTime"),d(10),F(11,"sTimeAgo"),s(),o(12,"button",18),f("click",function(n){let l=u(e).$implicit,p=c();return C(p.handleCopyEvent(l,n))}),x(13,ko,2,0,":svg:svg",19)(14,$o,3,0,":svg:svg",20),s()(),x(15,Io,2,3,"pre",21),s()}if(t&2){let e=r.$implicit,i=c();a(2),m(e.eventSource==="ccap-internal"?2:-1),a(),b("ngClass",U(4,8,e.eventType)),a(2),$(" ",e.eventType," "),a(2),$(" #",e.sequence," "),a(),b("title",U(9,10,e.timestamp)),a(2),$(" ",U(11,12,e.timestamp)," "),a(3),m(i.copiedSequence_$()===e.sequence?13:14),a(2),m(i.isExpanded(e.sequence)?15:-1)}}function Eo(t,r){t&1&&(o(0,"div",11),d(1,"No events yet"),s())}var nn=(()=>{class t{ccSession_DS=D(H);detailUi_DS=D(G);globalError_CS=D(le);expandedSequences_$=v(new Set);isAutoScroll_$=v(!0);copiedSequence_$=v(null);eventListRef;previousEventCount=0;ngAfterViewChecked(){let e=this.ccSession_DS.selectedSessionEvents_$().length;this.isAutoScroll_$()&&e>this.previousEventCount&&this.scrollToBottom(),this.previousEventCount=e}handleToggleEvent(e){let i=this.expandedSequences_$(),n=new Set(i);n.has(e)?n.delete(e):n.add(e),this.expandedSequences_$.set(n)}handleToggleAutoScroll(){this.isAutoScroll_$.update(e=>!e)}isExpanded(e){return this.expandedSequences_$().has(e)}handleCopyEvent(e,i){return V(this,null,function*(){i.stopPropagation();let n=JSON.stringify(e.data,null,2);(yield this.globalError_CS.copyToClipboard(n)).ok&&(this.copiedSequence_$.set(e.sequence),setTimeout(()=>{this.copiedSequence_$.set(null)},1500))})}scrollToBottom(){let e=this.eventListRef?.nativeElement;e&&(e.scrollTop=e.scrollHeight)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-ccap-cc-timeline"]],viewQuery:function(i,n){if(i&1&&xe(wo,5),i&2){let l;fe(l=he())&&(n.eventListRef=l.first)}},hostAttrs:[1,"flex","flex-col","h-full","overflow-hidden"],decls:18,vars:8,consts:[["eventList",""],[1,"flex","items-center","justify-between","p-2","border-b","border-neonDefault","shrink-0"],[1,"flex","items-center","gap-1"],[1,"text-xs","text-neutral-400","font-medium"],[1,"text-xs","text-neutral-500"],[1,"text-[10px]","px-1.5","py-0.5","border","rounded","transition-colors",3,"click"],[1,"flex","items-center","gap-1","px-2","py-1.5","border-b","border-neonDefault","shrink-0"],["title","Session lifecycle status changes (running, waiting, completed...)",1,"px-2","py-0.5","text-[10px]","border","rounded","transition-colors",3,"click"],["title","Agent progress updates (task_progress, tool status...)",1,"px-2","py-0.5","text-[10px]","border","rounded","transition-colors",3,"click"],[1,"flex-1","overflow-y-auto","min-h-0"],[1,"px-2","py-1","border-b","border-neutral-700/30","cursor-pointer","hover:bg-neutral-800/30","transition-colors"],[1,"p-3","text-center","text-neutral-500","text-xs"],[1,"px-2","py-1","border-b","border-neutral-700/30","cursor-pointer","hover:bg-neutral-800/30","transition-colors",3,"click"],[1,"flex","items-center","gap-1.5"],["title","CCAP-internal event (saj\xE1t rendszer state-reconciliation / force-reset / recovery)",1,"text-[9px]","px-1","py-0.5","rounded","bg-purple-700","text-white","whitespace-nowrap","leading-none","font-semibold"],[1,"text-[9px]","px-1","py-0.5","rounded","text-white","whitespace-nowrap","leading-none",3,"ngClass"],[1,"text-[10px]","text-neutral-600","leading-none"],[1,"text-[10px]","text-neutral-400","ml-auto","leading-none",3,"title"],["title","Copy event data",1,"ml-1","p-0.5","rounded","transition-colors","text-neutral-500","hover:text-neonCyan","shrink-0",3,"click"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2",1,"w-3","h-3","text-green-400"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","1.5",1,"w-3","h-3"],[1,"mt-1","p-2","bg-neutral-900","border","border-neutral-700/50","rounded","text-[10px]","text-neonCyan/70","overflow-x-auto","max-h-60","whitespace-pre-wrap","break-words","font-mono",3,"innerHTML"],["d","M3 8.5L6.5 12L13 4","stroke-linecap","round","stroke-linejoin","round"],["x","5","y","5","width","8","height","8","rx","1","stroke-linecap","round","stroke-linejoin","round"],["d","M3 11V3h8","stroke-linecap","round","stroke-linejoin","round"]],template:function(i,n){if(i&1){let l=y();o(0,"div",1)(1,"div",2)(2,"span",3),d(3,"Event Timeline"),s(),o(4,"span",4),d(5),s()(),o(6,"button",5),f("click",function(){return u(l),C(n.handleToggleAutoScroll())}),d(7," Auto-scroll "),s()(),o(8,"div",6)(9,"button",7),f("click",function(){return u(l),C(n.detailUi_DS.handleToggleSessionStatus())}),d(10," Session status "),s(),o(11,"button",8),f("click",function(){return u(l),C(n.detailUi_DS.handleToggleAgentUpdates())}),d(12," Agent updates "),s()(),o(13,"div",9,0),N(15,Do,16,14,"div",10,yo),x(17,Eo,2,0,"div",11),s()}i&2&&(a(5),$(" (",n.ccSession_DS.selectedSessionEvents_$().length,") "),a(),O(n.isAutoScroll_$()?"border-neonCyan text-neonCyan shadow-neon-glow-cyan":"border-neonDefault text-neutral-400"),a(3),O(n.detailUi_DS.isShowSessionStatus_$()?"border-neonPurple/50 text-neonPurple bg-neonPurple/10":"border-neutral-700 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600"),a(2),O(n.detailUi_DS.isShowAgentUpdates_$()?"border-teal-500/50 text-teal-400 bg-teal-500/10":"border-neutral-700 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600"),a(4),z(n.ccSession_DS.selectedSessionEvents_$()),a(2),m(n.ccSession_DS.selectedSessionEvents_$().length?-1:17))},dependencies:[Q,Me,Pe,tn,ze],encapsulation:2})}return t})();var on=et(Ct());function Mo(t,r){if(t&1){let e=y();o(0,"button",48),f("click",function(){u(e);let n=c(2);return C(n.handleScheduleBadgeClick())}),E(),o(1,"svg",49),g(2,"rect",50)(3,"line",51)(4,"line",52)(5,"line",53),s()()}}function Po(t,r){if(t&1){let e=y();o(0,"button",54),f("click",function(){u(e);let n=c(2);return C(n.handleCoordinatorBadgeClick())}),E(),o(1,"svg",49),g(2,"circle",55)(3,"polygon",56),s()()}}function Vo(t,r){if(t&1){let e=y();o(0,"button",57),f("click",function(){u(e);let n=c(2);return C(n.detailUi_DS.handleResume())}),d(1),s()}if(t&2){let e=c(2);b("disabled",e.detailUi_DS.isResuming_$()),a(),$(" ",e.detailUi_DS.isResuming_$()?"Resuming...":"Resume"," ")}}function Ro(t,r){if(t&1){let e=y();o(0,"div",12)(1,"div",58)(2,"span",59),d(3,"CC Session diagnostic"),s(),o(4,"button",60),f("click",function(){u(e);let n=c(2);return C(n.detailUi_DS.handleCloseDiagnostic())}),d(5,"\u2715"),s()(),o(6,"pre",61),d(7),F(8,"json"),s()()}t&2&&(a(7),k(U(8,1,r)))}function Lo(t,r){if(t&1&&(o(0,"span"),d(1),s()),t&2){let e=c(2);a(),Y("",e.rateLimitScopeLabel_$()," ",e.rateLimitPercent_$(),"%")}}function Oo(t,r){t&1&&(o(0,"span"),d(1,"Rate limit"),s())}function Fo(t,r){if(t&1&&(Se(0),o(1,"div",66)(2,"span",36),d(3,"Status"),s(),o(4,"span",67),d(5),s()(),o(6,"div",66)(7,"span",36),d(8,"Scope"),s(),o(9,"span",68),d(10),o(11,"span",69),d(12),s()()(),o(13,"div")(14,"div",70)(15,"span",36),d(16,"Utilization"),s(),o(17,"span",71),d(18),s()(),o(19,"div",72),g(20,"div",73),s()(),o(21,"div",66)(22,"span",36),d(23,"Warning threshold"),s(),o(24,"span",68),d(25),s()(),o(26,"div",66)(27,"span",36),d(28,"Resets in"),s(),o(29,"span",68),d(30),s()(),o(31,"div",66)(32,"span",36),d(33,"Overage"),s(),o(34,"span",74),d(35),s()(),o(36,"div",75)(37,"span",76),d(38),F(39,"date"),s()()),t&2){let e=c(3),i=e.rateLimitInfo_$();a(4),O(e.isRateLimitOverThreshold_$()?"text-red-400":"text-green-400"),a(),$(" ",i.status," "),a(5),$(" ",e.rateLimitScopeLabel_$()," "),a(2),$("(",i.rateLimitType,")"),a(6),$("",e.rateLimitPercent_$(),"%"),a(2),O(e.isRateLimitOverThreshold_$()?"bg-red-500":e.rateLimitPercent_$()>50?"bg-amber-500":"bg-green-500"),$e("width",e.rateLimitPercent_$(),"%"),Ce("data-utilization-color",e.isRateLimitOverThreshold_$()?"red":e.rateLimitPercent_$()>50?"amber":"green"),a(5),$("",e.rateLimitThresholdPercent_$(),"%"),a(5),k(e.rateLimitResetText_$()),a(4),O(i.isUsingOverage?"text-amber-400":"text-neutral-400"),a(),$(" ",i.isUsingOverage?"active":"inactive"," "),a(3),$("Last updated: ",dt(39,17,i.receivedAt,"HH:mm:ss"),"")}}function Uo(t,r){t&1&&(o(0,"div",65),d(1," No rate limit data yet "),s())}function jo(t,r){if(t&1){let e=y();o(0,"div",62),f("click",function(){u(e);let n=c(2);return C(n.handleToggleRateLimit())}),s(),o(1,"div",63)(2,"div",64),d(3,"Rate Limit Info"),s(),x(4,Fo,40,20)(5,Uo,2,0,"div",65),s()}if(t&2){let e=c(2);a(4),m(e.rateLimitInfo_$()?4:5)}}function Bo(t,r){if(t&1&&(o(0,"span",22),d(1),s()),t&2){let e=c(2);a(),$("Account: ",e.boundAccountDisplayName(),"")}}function No(t,r){t&1&&(o(0,"span"),d(1,"No account bound"),s())}function zo(t,r){t&1&&(o(0,"div",80),d(1),s()),t&2&&(a(),k(r))}function Wo(t,r){if(t&1){let e=y();o(0,"div",62),f("click",function(){u(e);let n=c(2);return C(n.handleToggleAccountUsage())}),s(),o(1,"div",77)(2,"div",78)(3,"div",79),d(4),s(),x(5,zo,2,1,"div",80),s(),o(6,"div",81),d(7),s(),o(8,"div",82),g(9,"app-cc-account-usage-view",83),s()()}if(t&2){let e,i,n=c(2);a(4),$(" ",n.boundAccountDisplayName()," "),a(),m((e=(e=n.boundAccount_$())==null?null:e.email)?5:-1,e),a(),b("title",(i=n.boundAccountKey_$())!==null&&i!==void 0?i:""),a(),$(" key: ",n.boundAccountKey_$()," "),a(2),b("accountKey",n.boundAccountKey_$())("compact",!0)}}function Ho(t,r){t&1&&g(0,"span",26)}function qo(t,r){if(t&1&&(o(0,"div",27),d(1),s()),t&2){let e=c();a(),k(e.session.statusMessage)}}function Ko(t,r){if(t&1&&(o(0,"div",28)(1,"div",24),d(2,"Actor"),s(),o(3,"div",42),d(4),s()()),t&2){let e=c();a(4),$(" ",e.session.actorLabel||e.session.actorId," ")}}function Qo(t,r){if(t&1&&(o(0,"div",28)(1,"div",24),d(2,"Process ID"),s(),o(3,"div",84),d(4),s()()),t&2){let e=c();a(4),k(e.session.processId)}}function Go(t,r){if(t&1&&(o(0,"div",28)(1,"div",24),d(2,"Claude Session"),s(),o(3,"div",29),d(4),s()()),t&2){let e=c();a(4),k(e.session.claudeSessionId)}}function Jo(t,r){if(t&1&&(o(0,"div",28)(1,"div",24),d(2,"Last Prompt"),s(),o(3,"div",85),d(4),s()()),t&2){let e=c();a(4),k(e.session.lastPrompt)}}function Xo(t,r){if(t&1&&(o(0,"div",37)(1,"div",38),d(2,"Started"),s(),o(3,"div",86),F(4,"sAbsoluteTime"),d(5),F(6,"sTimeAgo"),s()()),t&2){let e=c();a(3),b("title",U(4,2,e.session.startedAt)),a(2),k(U(6,4,e.session.startedAt))}}function Yo(t,r){if(t&1&&(o(0,"div",37)(1,"div",38),d(2,"Last Activity"),s(),o(3,"div",86),F(4,"sAbsoluteTime"),d(5),F(6,"sTimeAgo"),s()()),t&2){let e=c();a(3),b("title",U(4,2,e.session.lastActivityAt)),a(2),k(U(6,4,e.session.lastActivityAt))}}function Zo(t,r){if(t&1&&(o(0,"div",37)(1,"div",38),d(2,"Completed"),s(),o(3,"div",86),F(4,"sAbsoluteTime"),d(5),F(6,"sTimeAgo"),s()()),t&2){let e=c();a(3),b("title",U(4,2,e.session.completedAt)),a(2),k(U(6,4,e.session.completedAt))}}function es(t,r){if(t&1&&(o(0,"div",37)(1,"div",38),d(2,"Model"),s(),o(3,"div",42),d(4),s()()),t&2){let e=c();a(4),k(e.session.activeModel||e.session.model)}}function ts(t,r){if(t&1&&(o(0,"div",37)(1,"div",38),d(2,"Mode"),s(),o(3,"div",42),d(4),s()()),t&2){let e=c();a(4),k(e.session.mode)}}function ns(t,r){if(t&1&&(o(0,"div",37)(1,"div",38),d(2,"Permission"),s(),o(3,"div",42),d(4),s()()),t&2){let e=c();a(4),k(e.session.permissionPolicy)}}function is(t,r){if(t&1&&(o(0,"div",37)(1,"div",38),d(2,"Effort"),s(),o(3,"div",42),d(4),s()()),t&2){let e=c();a(4),k(e.session.reasoningEffort)}}function os(t,r){if(t&1&&(o(0,"div",37)(1,"div",38),d(2,"Max Turns"),s(),o(3,"div",42),d(4),s()()),t&2){let e=c();a(4),k(e.session.maxTurns)}}function ss(t,r){if(t&1){let e=y();o(0,"button",87),f("click",function(){u(e);let n=c(),l=c();return C(l.handleToggleDebugMode(n.session.sessionId,!0))}),d(1," on (--debug) "),s()}}function as(t,r){if(t&1){let e=y();o(0,"button",88),f("click",function(){u(e);let n=c(),l=c();return C(l.handleToggleDebugMode(n.session.sessionId,!1))}),d(1," off "),s()}}function rs(t,r){if(t&1&&(o(0,"div",37)(1,"div",38),d(2,"Cost"),s(),o(3,"div",91),d(4),s()()),t&2){let e=c(2);a(4),$("$",e.session.costUsdTotal.toFixed(4),"")}}function ls(t,r){if(t&1&&(g(0,"hr",31),o(1,"h3",32),d(2," Usage "),s(),o(3,"div",89)(4,"div",34)(5,"div",90),d(6),s(),o(7,"div",36),d(8,"Input"),s()(),o(9,"div",34)(10,"div",90),d(11),s(),o(12,"div",36),d(13,"Output"),s()()(),x(14,rs,5,1,"div",37)),t&2){let e=c(),i=c();a(6),k(i.formatTokens(e.session.inputTokensTotal)),a(5),k(i.formatTokens(e.session.outputTokensTotal)),a(3),m(e.session.costUsdTotal?14:-1)}}function ds(t,r){if(t&1&&(o(0,"div",37)(1,"div",38),d(2,"Runtime Status"),s(),o(3,"div",42),d(4),s()()),t&2){let e=c();a(4),k(e.runtime.runtimeStatus)}}function cs(t,r){if(t&1&&(o(0,"div",37)(1,"div",38),d(2,"Runner"),s(),o(3,"div",41),d(4),s()()),t&2){let e=c();a(3),O(e.runtime.isTerminalRunnerConnected?"text-neonGreen":"text-amber-400"),a(),$(" ",e.runtime.isTerminalRunnerConnected?"connected":"disconnected"," ")}}function ps(t,r){if(t&1){let e=y();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"h3",4),d(4," Session Info "),s(),x(5,Mo,6,0,"button",5)(6,Po,4,0,"button",6),s(),o(7,"button",7),f("click",function(){u(e);let n=c();return C(n.isArchiveConfirmOpen_$.set(!0))}),d(8),s()(),o(9,"div",8),x(10,Vo,2,2,"button",9),o(11,"button",10),f("click",function(){u(e);let n=c();return C(n.handleRestartRunner())}),d(12," \u21BB Restart runner "),s(),o(13,"button",11),f("click",function(){u(e);let n=c();return C(n.detailUi_DS.handleShowDiagnostic())}),d(14),s(),x(15,Ro,9,3,"div",12),o(16,"div",13)(17,"button",14),f("click",function(){u(e);let n=c();return C(n.handleToggleRateLimit())}),E(),o(18,"svg",15),g(19,"circle",16)(20,"path",17),s(),x(21,Lo,2,2,"span")(22,Oo,2,0,"span"),s(),x(23,jo,6,1),s(),L(),o(24,"div",18)(25,"button",19),f("click",function(){u(e);let n=c();return C(n.handleToggleAccountUsage())}),E(),o(26,"svg",15),g(27,"circle",16)(28,"path",20)(29,"path",21),s(),x(30,Bo,2,1,"span",22)(31,No,2,0,"span"),s(),x(32,Wo,10,6),s()(),L(),o(33,"div",23)(34,"div",24),d(35,"Status"),s(),o(36,"div",3)(37,"span",25),F(38,"ccSessionStatusColor"),d(39),s(),x(40,Ho,1,0,"span",26),s(),x(41,qo,2,1,"div",27),s(),o(42,"div",28)(43,"div",24),d(44,"Session ID"),s(),o(45,"div",29),d(46),s()(),o(47,"div",28)(48,"div",24),d(49,"Workspace"),s(),o(50,"div",30),d(51),s()(),x(52,Ko,5,1,"div",28)(53,Qo,5,1,"div",28)(54,Go,5,1,"div",28),g(55,"hr",31),o(56,"h3",32),d(57," Statistics "),s(),o(58,"div",33)(59,"div",34)(60,"div",35),d(61),s(),o(62,"div",36),d(63,"Prompts"),s()(),o(64,"div",34)(65,"div",35),d(66),s(),o(67,"div",36),d(68,"Tool Calls"),s()()(),x(69,Jo,5,1,"div",28),g(70,"hr",31),o(71,"h3",32),d(72," Timestamps "),s(),x(73,Xo,7,6,"div",37)(74,Yo,7,6,"div",37)(75,Zo,7,6,"div",37),g(76,"hr",31),o(77,"h3",32),d(78," Configuration "),s(),x(79,es,5,1,"div",37)(80,ts,5,1,"div",37)(81,ns,5,1,"div",37)(82,is,5,1,"div",37)(83,os,5,1,"div",37),o(84,"div",37)(85,"div",38),d(86,"Debug Mode"),s(),x(87,ss,2,0,"button",39)(88,as,2,0,"button",40),s(),x(89,ls,15,3),g(90,"hr",31),o(91,"h3",32),d(92," Runtime "),s(),o(93,"div",37)(94,"div",38),d(95,"Live"),s(),o(96,"div",41),d(97),s()(),x(98,ds,5,1,"div",37),o(99,"div",37)(100,"div",38),d(101,"Output Buffer"),s(),o(102,"div",42),d(103),s()(),o(104,"div",37)(105,"div",38),d(106,"Runner Mode"),s(),o(107,"div",42),d(108),s()(),x(109,cs,5,3,"div",37),s(),o(110,"app-s-modal",43),f("closed",function(){u(e);let n=c();return C(n.isArchiveConfirmOpen_$.set(!1))}),o(111,"p",44),d(112),s(),o(113,"div",45)(114,"button",46),f("click",function(){u(e);let n=c();return C(n.isArchiveConfirmOpen_$.set(!1))}),d(115," Cancel "),s(),o(116,"button",47),f("click",function(){let n=u(e),l=c();return C(l.handleConfirmToggleArchive(n.session))}),d(117),s()()()}if(t&2){let e,i=r,n=c();a(5),m(n.hasSchedule_$()?5:-1),a(),m(n.hasCoordinator_$()?6:-1),a(),O(i.session.isArchived?"text-amber-400 border border-amber-500/60 bg-amber-500/10 hover:bg-amber-500/20":"text-neutral-500 border border-neutral-700 hover:text-neutral-300 hover:bg-neutral-700"),b("title",i.session.isArchived?"Unarchive session":"Archive session"),a(),$(" ",i.session.isArchived?"Unarchive":"Archive"," "),a(2),m(i.session.status==="completed"||i.session.status==="errored"?10:-1),a(3),b("disabled",n.detailUi_DS.isLoadingDiagnostic_$()),a(),$(" ",n.detailUi_DS.isLoadingDiagnostic_$()?"\u{1F50D} Loading\u2026":"\u{1F50D} Diagnostic"," "),a(),m((e=n.detailUi_DS.isDiagnosticOpen_$()&&n.detailUi_DS.diagnosticSnapshot_$())?15:-1,e),a(2),O(n.rateLimitInfo_$()?n.isRateLimitOverThreshold_$()?"border-red-500/30 text-red-400/80 hover:bg-red-500/10":"border-green-500/30 text-green-400/80 hover:bg-green-500/10":"border-neutral-700 text-neutral-500"),Ce("data-rate-limit-state",n.rateLimitInfo_$()?n.isRateLimitOverThreshold_$()?"reached":"allowed":"unknown"),a(4),m(n.rateLimitInfo_$()?21:22),a(2),m(n.isRateLimitOpen_$()?23:-1),a(2),O(n.boundAccountKey_$()?"border-neonCyan/40 text-neonCyan/90 hover:bg-neonCyan/10":"border-neutral-700 text-neutral-500"),b("disabled",!n.boundAccountKey_$())("title",n.boundAccountKey_$()?"CC Account usage (5h / weekly / opus / sonnet / extra)":"No account bound to this session yet"),a(5),m(n.boundAccountKey_$()?30:31),a(2),m(n.isAccountUsageOpen_$()&&n.boundAccountKey_$()?32:-1),a(5),b("ngClass",U(38,56,i.session.status)),a(2),$(" ",i.session.status," "),a(),m(i.runtime.isLive?40:-1),a(),m(i.session.statusMessage?41:-1),a(5),k(i.session.sessionId),a(5),k(i.session.workspacePath),a(),m(i.session.actorId||i.session.actorLabel?52:-1),a(),m(i.session.processId?53:-1),a(),m(i.session.claudeSessionId?54:-1),a(7),k(i.session.promptCount),a(5),k(i.session.toolCallCount),a(3),m(i.session.lastPrompt?69:-1),a(4),m(i.session.startedAt?73:-1),a(),m(i.session.lastActivityAt?74:-1),a(),m(i.session.completedAt?75:-1),a(4),m(i.session.activeModel||i.session.model?79:-1),a(),m(i.session.mode?80:-1),a(),m(i.session.permissionPolicy?81:-1),a(),m(i.session.reasoningEffort?82:-1),a(),m(i.session.maxTurns?83:-1),a(4),m(i.session.isDebugMode?87:88),a(2),m(i.session.inputTokensTotal||i.session.outputTokensTotal||i.session.costUsdTotal?89:-1),a(7),O(i.runtime.isLive?"text-neonGreen":"text-neutral-500"),a(),$(" ",i.runtime.isLive?"Yes":"No"," "),a(),m(i.runtime.runtimeStatus?98:-1),a(5),$("",i.runtime.outputBufferLength," lines"),a(5),$(" ",i.runtime.isTerminalMode?"terminal":"direct"," "),a(),m(i.runtime.isTerminalMode?109:-1),a(),b("isOpen",n.isArchiveConfirmOpen_$())("title",i.session.isArchived?"Unarchive Session":"Archive Session")("maxWidth","sm")("closeOnBackdropClick",!0),a(2),$(" ",i.session.isArchived?"Are you sure you want to unarchive this session?":"Are you sure you want to archive this session?"," "),a(5),$(" ",i.session.isArchived?"Unarchive":"Archive"," ")}}var sn=(()=>{class t{ccSession_DS=D(H);detailUi_DS=D(G);scheduledJobs_DS=D(Ve);coordinator_DS=D(Re);account_DS=D(Wt);hasSchedule_$=A(()=>{let e=this.ccSession_DS.activeSessionId_$();return e?this.scheduledJobs_DS.scheduledSessionIds_$().has(e):!1});hasCoordinator_$=A(()=>{let e=this.ccSession_DS.activeSessionId_$();return e?this.coordinator_DS.coordinatedSessionIds_$().has(e):!1});isRateLimitOpen_$=v(!1);isArchiveConfirmOpen_$=v(!1);schedulePopupSessionId_$=v(null);coordinatorPopupSessionId_$=v(null);handleScheduleBadgeClick(){let e=this.ccSession_DS.activeSessionId_$();e&&this.schedulePopupSessionId_$.set(e)}handleCloseSchedulePopup(){this.schedulePopupSessionId_$.set(null)}handleCoordinatorBadgeClick(){let e=this.ccSession_DS.activeSessionId_$();e&&this.coordinatorPopupSessionId_$.set(e)}handleCloseCoordinatorPopup(){this.coordinatorPopupSessionId_$.set(null)}handleToggleDebugMode(e,i){if(!e)return;let n=!i;this.ccSession_DS.updateSessionConfig({sessionId:e,isDebugMode:n}).catch(l=>{on.DyFM_Log.error("[CCAP] cc-metadata config-update isDebugMode",l)})}rateLimitInfo_$=A(()=>this.ccSession_DS.rateLimitInfo_$());rateLimitResetText_$=A(()=>pe.formatResetText(this.rateLimitInfo_$()));rateLimitPercent_$=A(()=>pe.computeUtilizationPercent(this.rateLimitInfo_$()));rateLimitThresholdPercent_$=A(()=>pe.computeThresholdPercent(this.rateLimitInfo_$()));rateLimitScopeLabel_$=A(()=>pe.formatLimitScopeLabel(this.rateLimitInfo_$()));isRateLimitOverThreshold_$=A(()=>pe.isOverThreshold(this.rateLimitInfo_$()));boundAccountKey_$=A(()=>this.ccSession_DS.selectedSession_$()?.session.accountKey);boundAccount_$=A(()=>{let e=this.boundAccountKey_$();return e===void 0||e===""?null:this.account_DS.accounts_$().find(n=>n.accountKey===e)??null});isAccountUsageOpen_$=v(!1);ngOnInit(){this.scheduledJobs_DS.jobs_$().length===0&&this.scheduledJobs_DS.loadAll(),this.coordinator_DS.globalCoordinatorsList_$().length===0&&this.coordinator_DS.loadAllCoordinatorsForManagementPage(),this.account_DS.accounts_$().length===0&&this.account_DS.loadAccounts(),this.account_DS.startLiveUpdates()}handleToggleAccountUsage(){this.isAccountUsageOpen_$.update(e=>!e)}boundAccountDisplayName(){let e=this.boundAccount_$();if(e!==null&&e.displayName!=="")return e.displayName;let i=this.boundAccountKey_$();return i!==void 0&&i!==""?`account-${i.slice(0,6)}`:"\u2014"}handleToggleRateLimit(){this.isRateLimitOpen_$.update(e=>!e)}handleConfirmToggleArchive(e){return V(this,null,function*(){this.isArchiveConfirmOpen_$.set(!1);try{yield this.ccSession_DS.setSessionArchived({sessionId:e.sessionId,isArchived:!e.isArchived})}catch{}})}handleRestartRunner(){return V(this,null,function*(){let e=this.ccSession_DS.activeSessionId_$();if(e)try{yield this.ccSession_DS.restartRunner({sessionId:e})}catch{}})}formatTokens(e){return e?e>1e3?`${(e/1e3).toFixed(1)}k`:String(e):"0"}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-ccap-cc-metadata"]],hostAttrs:[1,"block","h-full","overflow-y-auto"],decls:3,vars:5,consts:[[3,"closed","sessionId","isOpen"],[1,"p-3"],[1,"flex","items-center","justify-between","mb-3"],[1,"flex","items-center","gap-1.5"],[1,"text-xs","font-semibold","text-neutral-400","uppercase","tracking-wider"],["type","button","title","Ehhez a session-h\xF6z tartozik schedule \u2014 kattints a r\xE9szletek\xE9rt","aria-label","Schedule attached \u2014 open popup",1,"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,"text-neonAmber/80","hover:text-neonAmber","focus:outline-none","focus:ring-1","focus:ring-neonAmber/60","rounded","p-0.5"],[1,"text-[10px]","px-1.5","py-0.5","rounded","transition-colors",3,"click","title"],[1,"flex","flex-col","gap-2","mb-4"],["type","button",1,"w-full","px-2","py-1.5","text-xs","border","border-ccapAccent","text-ccapAccent","hover:bg-ccapAccent","hover:text-white","disabled:opacity-50","rounded","transition-colors",3,"disabled"],["type","button","title","Runner kill + respawn (\xFAj CMD/termin\xE1l ablak; haszn\xE1ld ha verzi\xF3-mismatch vagy no-ACK loop van)",1,"w-full","px-2","py-1.5","text-xs","border","border-amber-500/60","text-amber-300","hover:bg-amber-500/10","disabled:opacity-50","rounded","transition-colors",3,"click"],["type","button","title","CC Session lifecycle in-memory state lek\xE9r\xE9se: hasTerminalSocket, hadRunner, recent REG-TIMEOUT, flapTracker stb. (stuck session debug)",1,"w-full","px-2","py-1.5","text-xs","border","border-neutral-700","text-neutral-300","hover:bg-neutral-800","disabled:opacity-50","rounded","transition-colors",3,"click","disabled"],[1,"w-full","p-2","text-[10px]","border","border-neutral-700","rounded","bg-neutral-900/60","overflow-x-auto"],["data-testid","cc-rate-limit-container",1,"relative","w-full","shrink-0"],["type","button","data-testid","cc-rate-limit-button","title","Rate limit info",1,"w-full","px-2","py-1.5","text-xs","border","rounded","transition-colors","flex","items-center","justify-center","gap-1.5",3,"click"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","shrink-0"],["cx","8","cy","8","r","6"],["d","M8 5v3.5l2 1.5"],["data-testid","cc-account-usage-container",1,"relative","w-full","shrink-0"],["type","button","data-testid","cc-account-usage-button",1,"w-full","px-2","py-1.5","text-xs","border","rounded","transition-colors","flex","items-center","justify-center","gap-1.5",3,"click","disabled","title"],["d","M8 4v4l3 1.5"],["d","M2 8h2M12 8h2M8 2v2M8 12v2"],[1,"truncate"],[1,"mb-4"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","mb-1"],[1,"text-[10px]","px-1.5","py-0.5","rounded-full","text-white",3,"ngClass"],[1,"w-1.5","h-1.5","rounded-full","bg-green-500","animate-pulse"],[1,"text-xs","text-neutral-500","mt-0.5"],[1,"mb-3"],[1,"text-xs","text-neutral-400","font-mono","break-all"],[1,"text-xs","text-neutral-400","break-all"],[1,"border-neutral-700/50","my-3"],[1,"text-xs","font-semibold","text-neutral-400","uppercase","tracking-wider","mb-3"],[1,"grid","grid-cols-2","gap-2","mb-4"],[1,"bg-neutral-800/60","border","border-neonDefault","rounded","p-2","text-center"],[1,"text-lg","font-bold","text-neutral-100"],[1,"text-[10px]","text-neutral-500"],[1,"mb-2"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","mb-0.5"],["type","button","title","CLI --debug flag akt\xEDv \u2014 klikk a kikapcsol\xE1shoz",1,"text-xs","px-2","py-0.5","rounded","border","border-amber-700","text-amber-400","hover:border-amber-500","hover:text-amber-300","transition-colors","duration-150"],["type","button","title","CLI --debug flag inakt\xEDv \u2014 klikk a bekapcsol\xE1shoz",1,"text-xs","px-2","py-0.5","rounded","border","border-neutral-700","text-neutral-500","hover:border-neutral-500","hover:text-neutral-300","transition-colors","duration-150"],[1,"text-xs"],[1,"text-xs","text-neutral-400"],[3,"closed","isOpen","title","maxWidth","closeOnBackdropClick"],[1,"text-sm","text-neutral-300","mb-4"],[1,"flex","justify-end","gap-2"],[1,"px-3","py-1.5","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors",3,"click"],[1,"px-3","py-1.5","text-xs","border","border-amber-500","text-amber-400","hover:bg-amber-500","hover:text-white","rounded","transition-colors",3,"click"],["type","button","title","Ehhez a session-h\xF6z tartozik schedule \u2014 kattints a r\xE9szletek\xE9rt","aria-label","Schedule attached \u2014 open popup",1,"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,"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"],["type","button",1,"w-full","px-2","py-1.5","text-xs","border","border-ccapAccent","text-ccapAccent","hover:bg-ccapAccent","hover:text-white","disabled:opacity-50","rounded","transition-colors",3,"click","disabled"],[1,"flex","items-center","justify-between","mb-1.5"],[1,"text-neutral-400","font-medium"],["type","button","aria-label","Close diagnostic",1,"text-neutral-500","hover:text-neutral-300",3,"click"],[1,"text-neutral-300","whitespace-pre-wrap","break-all"],[1,"fixed","inset-0","z-40",3,"click"],["data-testid","cc-rate-limit-popover",1,"absolute","left-0","top-full","mt-1","z-50","w-full","min-w-[16rem]","max-w-[min(100vw-2rem,18rem)]","bg-neutral-900","border","border-neutral-700","rounded-lg","shadow-xl","p-3","space-y-2.5"],[1,"text-xs","font-semibold","text-neutral-200","mb-2"],[1,"text-[11px]","text-neutral-500","text-center","py-2"],[1,"flex","items-center","justify-between"],["data-testid","cc-rate-limit-status",1,"text-[11px]","font-medium"],[1,"text-[11px]","text-neutral-300"],[1,"text-[9px]","text-neutral-500"],[1,"flex","items-center","justify-between","mb-1"],[1,"text-[10px]","text-neutral-300","font-medium"],[1,"w-full","h-1.5","bg-neutral-800","rounded-full","overflow-hidden"],["data-testid","cc-rate-limit-utilization-bar",1,"h-full","rounded-full","transition-all"],[1,"text-[11px]"],[1,"border-t","border-neutral-800","pt-1.5","mt-1.5"],[1,"text-[9px]","text-neutral-600"],["data-testid","cc-account-usage-popover",1,"absolute","left-0","top-full","mt-1","z-50","w-full","min-w-[16rem]","max-w-[min(100vw-2rem,20rem)]","bg-neutral-900","border","border-neutral-700","rounded-lg","shadow-xl","p-3","space-y-2.5"],[1,"flex","items-center","justify-between","mb-2"],[1,"text-xs","font-semibold","text-neutral-200","truncate"],[1,"text-[10px]","text-neonCyan/80","truncate","ml-2"],[1,"text-[9px]","text-neutral-600","font-mono","truncate",3,"title"],[1,"pt-1"],[3,"accountKey","compact"],[1,"text-xs","text-neutral-400","font-mono"],[1,"text-xs","text-neutral-400","line-clamp-3"],[1,"text-xs","text-neutral-400",3,"title"],["type","button","title","CLI --debug flag akt\xEDv \u2014 klikk a kikapcsol\xE1shoz",1,"text-xs","px-2","py-0.5","rounded","border","border-amber-700","text-amber-400","hover:border-amber-500","hover:text-amber-300","transition-colors","duration-150",3,"click"],["type","button","title","CLI --debug flag inakt\xEDv \u2014 klikk a bekapcsol\xE1shoz",1,"text-xs","px-2","py-0.5","rounded","border","border-neutral-700","text-neutral-500","hover:border-neutral-500","hover:text-neutral-300","transition-colors","duration-150",3,"click"],[1,"grid","grid-cols-2","gap-2","mb-2"],[1,"text-sm","font-bold","text-neutral-100"],[1,"text-xs","text-neonGreen","font-mono"]],template:function(i,n){if(i&1&&(x(0,ps,118,58),o(1,"app-sch-schedule-popup",0),f("closed",function(){return n.handleCloseSchedulePopup()}),s(),o(2,"app-crd-info-popup",0),f("closed",function(){return n.handleCloseCoordinatorPopup()}),s()),i&2){let l;m((l=n.ccSession_DS.selectedSession_$())?0:-1,l),a(),b("sessionId",n.schedulePopupSessionId_$())("isOpen",n.schedulePopupSessionId_$()!==null),a(),b("sessionId",n.coordinatorPopupSessionId_$())("isOpen",n.coordinatorPopupSessionId_$()!==null)}},dependencies:[Q,ee,_e,me,Fe,ut,mt,Me,Pe,Ne],encapsulation:2})}return t})();function ms(t,r){t&1&&(o(0,"div",0),d(1," Loading session... "),s())}function us(t,r){if(t&1){let e=y();o(0,"app-s-session-detail-three-column-layout",2),f("startResizeStart",function(n){u(e);let l=c();return C(l.handleMetadataResizeStart(n))})("endResizeStart",function(n){u(e);let l=c();return C(l.handleTimelineResizeStart(n))}),o(1,"div",3),g(2,"app-ccap-cc-metadata"),s(),o(3,"div",4),g(4,"app-ccap-cc-console",5),s(),o(5,"div",6),g(6,"app-ccap-cc-timeline"),s()()}if(t&2){let e=c();b("isStartOpen",e.detailUi_DS.isMetadataPanelOpen_$())("isEndOpen",e.detailUi_DS.isTimelinePanelOpen_$())("startWidthPx",e.metadataWidth_$())("endWidthPx",e.timelineWidth_$())("isResizing",e.isResizing_$()),a(4),b("sessionId",e.sessionId_$())("isShowSessionStatus",e.detailUi_DS.isShowSessionStatus_$())("isShowAgentUpdates",e.detailUi_DS.isShowAgentUpdates_$())}}function Cs(t,r){t&1&&(o(0,"div",0),d(1," Select a session to view details "),s())}var We=(()=>{class t extends kt{ccSession_DS=D(H);detailUi_DS=D(G);peiContext_DS=D(de);route=D(xt);router=D(re);sessionId_$=v("");metadataWidth_$=v(256);timelineWidth_$=v(288);isResizing_$=v(!1);ngOnInit(){this.metadataWidth_$.set(Math.max(160,Math.min(500,T.loadPanelWidth("metadata",256)))),this.timelineWidth_$.set(Math.max(200,Math.min(600,T.loadPanelWidth("timeline",288)))),this.addSubscription(this.route.params.subscribe(e=>{let i=e.sessionId??"",n=e.ccapId??"";if(this.sessionId_$.set(i),i)T.saveLastSessionId(i),n&&T.saveLastCcapId(n),this.peiContext_DS.ensureInitialized().then(()=>{n&&this.peiContext_DS.activeCcapId_$()!==n&&this.peiContext_DS.selectInstance(n),this.ccSession_DS.clearLiveOutput(),this.ccSession_DS.setActiveSessionId(i),this.ccSession_DS.loadSessionDetail({sessionId:i}),this.ccSession_DS.loadSessionEvents({sessionId:i});let l=this.peiContext_DS.activeCcapId_$();l&&this.ccSession_DS.loadPersistedRateLimitState({ccapId:l}).catch(()=>{})});else{let l=T.loadLastSessionId(),p=T.loadLastCcapId();if(l){let _=p?["/cc-session",p,l]:["/cc-session",l];this.router.navigate(_,{replaceUrl:!0})}}}))}ngOnDestroy(){this.ccSession_DS.setActiveSessionId(""),super.ngOnDestroy()}handleMetadataResizeStart(e){let i=this.metadataWidth_$(),n=e.clientX;this.isResizing_$.set(!0),be.attachUntilPointerUp({startEvent:e,onMove:l=>{let p=l.clientX-n,_=Math.max(160,Math.min(500,i+p));this.metadataWidth_$.set(_)},onEnd:()=>{this.isResizing_$.set(!1),T.savePanelWidth("metadata",this.metadataWidth_$())}})}handleTimelineResizeStart(e){let i=this.timelineWidth_$(),n=e.clientX;this.isResizing_$.set(!0),be.attachUntilPointerUp({startEvent:e,onMove:l=>{let p=n-l.clientX,_=Math.max(200,Math.min(600,i+p));this.timelineWidth_$.set(_)},onEnd:()=>{this.isResizing_$.set(!1),T.savePanelWidth("timeline",this.timelineWidth_$())}})}static \u0275fac=(()=>{let e;return function(n){return(e||(e=ot(t)))(n||t)}})();static \u0275cmp=B({type:t,selectors:[["app-ccap-cc-detail"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],features:[at],decls:3,vars:1,consts:[[1,"flex","items-center","justify-center","h-full","text-neutral-500","text-sm"],[3,"isStartOpen","isEndOpen","startWidthPx","endWidthPx","isResizing"],[3,"startResizeStart","endResizeStart","isStartOpen","isEndOpen","startWidthPx","endWidthPx","isResizing"],["sDetailColumnStart",""],["sDetailColumnMain",""],[3,"sessionId","isShowSessionStatus","isShowAgentUpdates"],["sDetailColumnEnd",""]],template:function(i,n){i&1&&x(0,ms,2,0,"div",0)(1,us,7,8,"app-s-session-detail-three-column-layout",1)(2,Cs,2,0,"div",0),i&2&&m(n.ccSession_DS.selectedSessionLoading_$()?0:n.ccSession_DS.selectedSession_$()?1:2)},dependencies:[Pt,en,nn,sn],encapsulation:2})}return t})();var xs=[{path:"",component:Xt,children:[{path:"",pathMatch:"full",component:We},{path:":ccapId/:sessionId",component:We},{path:":sessionId",component:We}]}],nl=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=it({type:t});static \u0275inj=nt({imports:[Z,Tt,ht.forChild(xs),Le,ee,Ae,Ue,je,Be,_e,Oe,me,Fe,Ft]})}return t})();export{nl as CcSession_Module};
4
- //# sourceMappingURL=cc.module-VBMRNILG.js.map
4
+ //# sourceMappingURL=cc.module-BFN6BZIN.js.map
@@ -1,2 +1,2 @@
1
- import{a as r}from"./chunk-NXBTW2AM.js";import{G as i}from"./chunk-TBMJSIBB.js";var p=(()=>{class e{transform(t){return r.formatRelativeTime(t)}static \u0275fac=function(a){return new(a||e)};static \u0275pipe=i({name:"ccapRelativeTime",type:e,pure:!0,standalone:!0})}return e})();export{p as a};
2
- //# sourceMappingURL=chunk-MNLTOLQZ.js.map
1
+ import{a as r}from"./chunk-C2XSLL34.js";import{G as i}from"./chunk-TBMJSIBB.js";var p=(()=>{class e{transform(t){return r.formatRelativeTime(t)}static \u0275fac=function(a){return new(a||e)};static \u0275pipe=i({name:"ccapRelativeTime",type:e,pure:!0,standalone:!0})}return e})();export{p as a};
2
+ //# sourceMappingURL=chunk-27RTDRPJ.js.map
@@ -1,2 +1,2 @@
1
- import{I as c}from"./chunk-5PXAAX3K.js";import{C as s,p as n,vb as o,xb as f,y as r}from"./chunk-TBMJSIBB.js";var b=(()=>{class i{baseUrl=`${c.api.baseUrl}/ext-session-message`;http=s(f);getMessages(t){let e=new o;return t.sinceSequence!==void 0&&(e=e.set("sinceSequence",String(t.sinceSequence))),t.beforeSequence!==void 0&&(e=e.set("beforeSequence",String(t.beforeSequence))),t.limit!==void 0&&(e=e.set("limit",String(t.limit))),t.latest&&(e=e.set("latest","1")),n(this.http.get(`${this.baseUrl}/${t.sessionId}/messages`,{params:e}))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=r({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{b as a};
2
- //# sourceMappingURL=chunk-6RWGMVJZ.js.map
1
+ import{I as c}from"./chunk-5APAM7YJ.js";import{C as s,p as n,vb as o,xb as f,y as r}from"./chunk-TBMJSIBB.js";var b=(()=>{class i{baseUrl=`${c.api.baseUrl}/ext-session-message`;http=s(f);getMessages(t){let e=new o;return t.sinceSequence!==void 0&&(e=e.set("sinceSequence",String(t.sinceSequence))),t.beforeSequence!==void 0&&(e=e.set("beforeSequence",String(t.beforeSequence))),t.limit!==void 0&&(e=e.set("limit",String(t.limit))),t.latest&&(e=e.set("latest","1")),n(this.http.get(`${this.baseUrl}/${t.sessionId}/messages`,{params:e}))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=r({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{b as a};
2
+ //# sourceMappingURL=chunk-2UN7HPVU.js.map
@@ -1,2 +1,2 @@
1
- import{I as o}from"./chunk-5PXAAX3K.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-LNVYS2CJ.js.map
1
+ import{I as o}from"./chunk-5APAM7YJ.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-32QSFPDR.js.map
@@ -1,8 +1,8 @@
1
- import{a as O}from"./chunk-6RWGMVJZ.js";import{a as q}from"./chunk-AYRVFADA.js";import{d as F}from"./chunk-OUKRDBHU.js";import{e as D}from"./chunk-ARFG3EJ2.js";import{h as A,j as k}from"./chunk-FOX5TCWN.js";import{I as R,p as j}from"./chunk-5PXAAX3K.js";import{C as I,R as P,a as S,aa as m,b,h as U,k as f,p as y,vb as g,xb as K,y as E}from"./chunk-TBMJSIBB.js";var M=class{static compareMirrorEventsAsc(i,e){let t=(i.sequence??0)-(e.sequence??0);if(t!==0)return t;let s=typeof i.timestamp=="string"?i.timestamp:"",n=typeof e.timestamp=="string"?e.timestamp:"",o=s.localeCompare(n);if(o!==0)return o;let r=typeof i.eventType=="string"?i.eventType:"",a=typeof e.eventType=="string"?e.eventType:"";return r.localeCompare(a)}};var C=class c{static messageIdsCompatibleForStreamMerge(i,e){let t=(i??"").trim(),s=(e??"").trim();return t.length>0&&s.length>0?t===s:!0}static parseStreamChunkFromMirrorData(i){let e=i.update;if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=c.toPlainRecord(e),s=t.sessionUpdate,n=null;if(s==="agent_message_chunk"&&(n="agent"),s==="user_message_chunk"&&(n="user"),s==="agent_thought_chunk"&&(n="thought"),n===null)return null;let o=t.content;if(o===null||typeof o!="object"||Array.isArray(o))return null;let a=c.toPlainRecord(o).text;if(typeof a!="string"||!a.length)return null;let l=t.messageId,d=typeof l=="string"&&l.length>0?l:void 0;return{role:n,text:a,messageId:d}}static canMergeConsoleTailWithChunk(i){let e=i.prev;if(e.streamTextRole===void 0||e.streamTextRole!==i.parsed.role)return!1;let t=e.streamMessageId,s=i.parsed.messageId;if(!c.messageIdsCompatibleForStreamMerge(t,s))return!1;let n=i.ev.sequence??0,o=e.streamLastSequence??0;return!(n<=o)}static canMergeMirrorChunkEvents(i,e,t){let s=c.parseStreamChunkFromMirrorData(i.data??{});if(s===null||s.role!==t.role)return!1;let n=s.messageId,o=t.messageId;if(!c.messageIdsCompatibleForStreamMerge(n,o))return!1;let r=i.sequence??0;return!((e.sequence??0)<=r)}static foldEventsToTimelineRows(i){let e=[];for(let t of i){let s=c.parseStreamChunkFromMirrorData(t.data??{});if(s!==null){let n=e.length>0?e[e.length-1]:void 0,o=n!==void 0&&n.events.length>0?n.events[n.events.length-1]:void 0;if(n!==void 0&&o!==void 0&&c.canMergeMirrorChunkEvents(o,t,s)){let r=[...n.events,t];e[e.length-1]={rowKey:c.mergedTimelineRowKey(r),events:r}}else e.push({rowKey:`evt-${String(t.sequence??0)}`,events:[t]})}else e.push({rowKey:`evt-${String(t.sequence??0)}`,events:[t]})}return e}static mergedTimelineRowKey(i){if(!i.length)return"evt-empty";let e=i[0].sequence??0,t=i[i.length-1].sequence??0;return`merged-chunk-${String(e)}-${String(t)}`}static toPlainRecord(i){let e={};for(let t of Object.keys(i))e[t]=Reflect.get(i,t);return e}};var v=U(j());var x=class c{static prettyStringifyUnknown(i){try{let e=c.expandEmbeddedJsonStrings(i);return JSON.stringify(e,null,2)}catch{return i==null?String(i):typeof i=="object"?"[Object stringify failed]":String(i)}}static expandEmbeddedJsonStrings(i){if(i==null)return i;if(typeof i=="string"){let t=i;if(!F.looksLikeJson(t))return t;try{let s=JSON.parse(t.trim());return c.expandEmbeddedJsonStrings(s)}catch{return t}}if(typeof i!="object")return i;if(Array.isArray(i))return i.map(t=>c.expandEmbeddedJsonStrings(t));let e={};for(let t of Object.keys(i)){let s=Reflect.get(i,t);e[t]=c.expandEmbeddedJsonStrings(s)}return e}};var T=class c{static buildFromMirrorEvent(i){let e=i.sequence??0,t=i.data!==void 0?i.data:{},s=typeof i.eventType=="string"?i.eventType:"";return s==="prompt-sent"?c.buildPromptSentBrief(e,t):s==="ca-session-update"?c.buildCaSessionUpdateBrief(e,t):c.buildGenericBrief(s,e,t)}static extractSessionUpdateKind(i){let e=i.update;if(e===null||typeof e!="object"||Array.isArray(e))return;let s=c.toPlainRecord(e).sessionUpdate;return typeof s=="string"&&s.length?s:void 0}static buildPromptSentBrief(i,e){let t=e.content;return typeof t!="string"||!t.length?null:{listKey:`mirror-prompt-${String(i)}`,consoleType:"prompt",bodyText:t,mirrorEventType:"prompt-sent",useRawBubbleKind:!1,rawData:e}}static buildCaSessionUpdateBrief(i,e){let t=C.parseStreamChunkFromMirrorData(e);if(t!==null){let n=c.extractSessionUpdateKind(e),o=t.role==="thought";return{listKey:`mirror-chunk-${String(i)}`,consoleType:o?"thinking":"assistant",bodyText:t.text,mirrorEventType:"ca-session-update",briefSubtype:n,useRawBubbleKind:!1,rawData:e,isStreamingTextChunk:!0,streamTextRole:t.role,streamMessageId:t.messageId}}let s=x.prettyStringifyUnknown(e);return{listKey:`mirror-ca-session-update-${String(i)}`,consoleType:"info",bodyText:s,mirrorEventType:"ca-session-update",useRawBubbleKind:!0,rawData:e}}static buildGenericBrief(i,e,t){let s=c.safeListKeySegment(i),n={eventType:i.length?i:"unknown",sequence:e,data:t},o=x.prettyStringifyUnknown(n);return{listKey:`mirror-${s}-${String(e)}`,consoleType:"info",bodyText:o,mirrorEventType:i.length?i:"unknown",useRawBubbleKind:!0,rawData:t}}static safeListKeySegment(i){let e=i.replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/^_+|_+$/g,"");return e.length?e:"event"}static toPlainRecord(i){let e={};for(let t of Object.keys(i))e[t]=Reflect.get(i,t);return e}};var u=class c{static listKeyStart(i){return`ca-tc-${i}-start`}static listKeyProgress(i){return`ca-tc-${i}-progress`}static listKeyResult(i){return`ca-tc-${i}-result`}static listKeyError(i){return`ca-tc-${i}-error`}static tryParseStableListKey(i){let e="ca-tc-";if(!i.startsWith(e))return null;let t=[{suffix:"-progress",role:"progress"},{suffix:"-start",role:"start"},{suffix:"-result",role:"result"},{suffix:"-error",role:"error"}];for(let s of t){if(!i.endsWith(s.suffix))continue;let n=i.slice(e.length,i.length-s.suffix.length);return n.length?{toolCallId:n,role:s.role}:null}return null}static tryParseMirrorData(i){let e=i.update;if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=c.toPlainRecord(e),s=t.sessionUpdate;if(s!=="tool_call"&&s!=="tool_call_update")return null;let n=t.toolCallId;if(typeof n!="string"||!n.trim().length)return null;let o=t.status,r=typeof o=="string"?o:"",a=t.title,l=typeof a=="string"&&a.trim().length?a.trim():void 0,d=t.kind,h=typeof d=="string"&&d.trim().length?d.trim():void 0,p=t.rawOutput,_=t.rawInput,w=t.content,$=t.locations;return{sessionUpdate:s,toolCallId:n.trim(),status:r,title:l,toolKind:h,rawOutput:p!==void 0?p:void 0,rawInput:_!==void 0?_:void 0,content:Array.isArray(w)&&w.length?w:void 0,locations:Array.isArray($)&&$.length?$:void 0}}static hasRawOutputError(i){if(i===null||typeof i!="object"||Array.isArray(i))return!1;let e=c.toPlainRecord(i);return Object.prototype.hasOwnProperty.call(e,"error")}static summarizeRawOutputError(i){if(i===null||typeof i!="object"||Array.isArray(i))return"Tool call failed";let t=c.toPlainRecord(i).error;if(typeof t=="string"&&t.trim().length)return t.trim();try{return JSON.stringify(i)}catch{return"Tool call failed"}}static summarizeRawOutputSuccess(i){if(i===void 0)return"Completed";try{let e=JSON.stringify(i),t=400;return e.length>t?`${e.substring(0,t)}\u2026`:e}catch{return"Completed"}}static formatRawInput(i){if(i==null)return"";try{return JSON.stringify(i,null,2)}catch{return String(i)}}static formatLocations(i){if(!i?.length)return"";let e=[];for(let t of i){if(t===null||typeof t!="object"||Array.isArray(t))continue;let s=c.toPlainRecord(t),n=s.path;if(typeof n!="string"||!n.length)continue;let o=s.line,r=typeof o=="number"?`:${o}`:"";e.push(`${n}${r}`)}return e.join(`
1
+ import{a as O}from"./chunk-2UN7HPVU.js";import{a as q}from"./chunk-EFNJA3BL.js";import{d as F}from"./chunk-45RYB36M.js";import{e as D}from"./chunk-Z3Y2VOXP.js";import{h as A,j as k}from"./chunk-JZMWWTFG.js";import{I as R,p as j}from"./chunk-5APAM7YJ.js";import{C as I,R as P,a as S,aa as m,b,h as U,k as f,p as y,vb as g,xb as K,y as E}from"./chunk-TBMJSIBB.js";var M=class{static compareMirrorEventsAsc(i,e){let t=(i.sequence??0)-(e.sequence??0);if(t!==0)return t;let s=typeof i.timestamp=="string"?i.timestamp:"",n=typeof e.timestamp=="string"?e.timestamp:"",o=s.localeCompare(n);if(o!==0)return o;let r=typeof i.eventType=="string"?i.eventType:"",a=typeof e.eventType=="string"?e.eventType:"";return r.localeCompare(a)}};var C=class c{static messageIdsCompatibleForStreamMerge(i,e){let t=(i??"").trim(),s=(e??"").trim();return t.length>0&&s.length>0?t===s:!0}static parseStreamChunkFromMirrorData(i){let e=i.update;if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=c.toPlainRecord(e),s=t.sessionUpdate,n=null;if(s==="agent_message_chunk"&&(n="agent"),s==="user_message_chunk"&&(n="user"),s==="agent_thought_chunk"&&(n="thought"),n===null)return null;let o=t.content;if(o===null||typeof o!="object"||Array.isArray(o))return null;let a=c.toPlainRecord(o).text;if(typeof a!="string"||!a.length)return null;let l=t.messageId,d=typeof l=="string"&&l.length>0?l:void 0;return{role:n,text:a,messageId:d}}static canMergeConsoleTailWithChunk(i){let e=i.prev;if(e.streamTextRole===void 0||e.streamTextRole!==i.parsed.role)return!1;let t=e.streamMessageId,s=i.parsed.messageId;if(!c.messageIdsCompatibleForStreamMerge(t,s))return!1;let n=i.ev.sequence??0,o=e.streamLastSequence??0;return!(n<=o)}static canMergeMirrorChunkEvents(i,e,t){let s=c.parseStreamChunkFromMirrorData(i.data??{});if(s===null||s.role!==t.role)return!1;let n=s.messageId,o=t.messageId;if(!c.messageIdsCompatibleForStreamMerge(n,o))return!1;let r=i.sequence??0;return!((e.sequence??0)<=r)}static foldEventsToTimelineRows(i){let e=[];for(let t of i){let s=c.parseStreamChunkFromMirrorData(t.data??{});if(s!==null){let n=e.length>0?e[e.length-1]:void 0,o=n!==void 0&&n.events.length>0?n.events[n.events.length-1]:void 0;if(n!==void 0&&o!==void 0&&c.canMergeMirrorChunkEvents(o,t,s)){let r=[...n.events,t];e[e.length-1]={rowKey:c.mergedTimelineRowKey(r),events:r}}else e.push({rowKey:`evt-${String(t.sequence??0)}`,events:[t]})}else e.push({rowKey:`evt-${String(t.sequence??0)}`,events:[t]})}return e}static mergedTimelineRowKey(i){if(!i.length)return"evt-empty";let e=i[0].sequence??0,t=i[i.length-1].sequence??0;return`merged-chunk-${String(e)}-${String(t)}`}static toPlainRecord(i){let e={};for(let t of Object.keys(i))e[t]=Reflect.get(i,t);return e}};var v=U(j());var x=class c{static prettyStringifyUnknown(i){try{let e=c.expandEmbeddedJsonStrings(i);return JSON.stringify(e,null,2)}catch{return i==null?String(i):typeof i=="object"?"[Object stringify failed]":String(i)}}static expandEmbeddedJsonStrings(i){if(i==null)return i;if(typeof i=="string"){let t=i;if(!F.looksLikeJson(t))return t;try{let s=JSON.parse(t.trim());return c.expandEmbeddedJsonStrings(s)}catch{return t}}if(typeof i!="object")return i;if(Array.isArray(i))return i.map(t=>c.expandEmbeddedJsonStrings(t));let e={};for(let t of Object.keys(i)){let s=Reflect.get(i,t);e[t]=c.expandEmbeddedJsonStrings(s)}return e}};var T=class c{static buildFromMirrorEvent(i){let e=i.sequence??0,t=i.data!==void 0?i.data:{},s=typeof i.eventType=="string"?i.eventType:"";return s==="prompt-sent"?c.buildPromptSentBrief(e,t):s==="ca-session-update"?c.buildCaSessionUpdateBrief(e,t):c.buildGenericBrief(s,e,t)}static extractSessionUpdateKind(i){let e=i.update;if(e===null||typeof e!="object"||Array.isArray(e))return;let s=c.toPlainRecord(e).sessionUpdate;return typeof s=="string"&&s.length?s:void 0}static buildPromptSentBrief(i,e){let t=e.content;return typeof t!="string"||!t.length?null:{listKey:`mirror-prompt-${String(i)}`,consoleType:"prompt",bodyText:t,mirrorEventType:"prompt-sent",useRawBubbleKind:!1,rawData:e}}static buildCaSessionUpdateBrief(i,e){let t=C.parseStreamChunkFromMirrorData(e);if(t!==null){let n=c.extractSessionUpdateKind(e),o=t.role==="thought";return{listKey:`mirror-chunk-${String(i)}`,consoleType:o?"thinking":"assistant",bodyText:t.text,mirrorEventType:"ca-session-update",briefSubtype:n,useRawBubbleKind:!1,rawData:e,isStreamingTextChunk:!0,streamTextRole:t.role,streamMessageId:t.messageId}}let s=x.prettyStringifyUnknown(e);return{listKey:`mirror-ca-session-update-${String(i)}`,consoleType:"info",bodyText:s,mirrorEventType:"ca-session-update",useRawBubbleKind:!0,rawData:e}}static buildGenericBrief(i,e,t){let s=c.safeListKeySegment(i),n={eventType:i.length?i:"unknown",sequence:e,data:t},o=x.prettyStringifyUnknown(n);return{listKey:`mirror-${s}-${String(e)}`,consoleType:"info",bodyText:o,mirrorEventType:i.length?i:"unknown",useRawBubbleKind:!0,rawData:t}}static safeListKeySegment(i){let e=i.replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/^_+|_+$/g,"");return e.length?e:"event"}static toPlainRecord(i){let e={};for(let t of Object.keys(i))e[t]=Reflect.get(i,t);return e}};var u=class c{static listKeyStart(i){return`ca-tc-${i}-start`}static listKeyProgress(i){return`ca-tc-${i}-progress`}static listKeyResult(i){return`ca-tc-${i}-result`}static listKeyError(i){return`ca-tc-${i}-error`}static tryParseStableListKey(i){let e="ca-tc-";if(!i.startsWith(e))return null;let t=[{suffix:"-progress",role:"progress"},{suffix:"-start",role:"start"},{suffix:"-result",role:"result"},{suffix:"-error",role:"error"}];for(let s of t){if(!i.endsWith(s.suffix))continue;let n=i.slice(e.length,i.length-s.suffix.length);return n.length?{toolCallId:n,role:s.role}:null}return null}static tryParseMirrorData(i){let e=i.update;if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=c.toPlainRecord(e),s=t.sessionUpdate;if(s!=="tool_call"&&s!=="tool_call_update")return null;let n=t.toolCallId;if(typeof n!="string"||!n.trim().length)return null;let o=t.status,r=typeof o=="string"?o:"",a=t.title,l=typeof a=="string"&&a.trim().length?a.trim():void 0,d=t.kind,h=typeof d=="string"&&d.trim().length?d.trim():void 0,p=t.rawOutput,_=t.rawInput,w=t.content,$=t.locations;return{sessionUpdate:s,toolCallId:n.trim(),status:r,title:l,toolKind:h,rawOutput:p!==void 0?p:void 0,rawInput:_!==void 0?_:void 0,content:Array.isArray(w)&&w.length?w:void 0,locations:Array.isArray($)&&$.length?$:void 0}}static hasRawOutputError(i){if(i===null||typeof i!="object"||Array.isArray(i))return!1;let e=c.toPlainRecord(i);return Object.prototype.hasOwnProperty.call(e,"error")}static summarizeRawOutputError(i){if(i===null||typeof i!="object"||Array.isArray(i))return"Tool call failed";let t=c.toPlainRecord(i).error;if(typeof t=="string"&&t.trim().length)return t.trim();try{return JSON.stringify(i)}catch{return"Tool call failed"}}static summarizeRawOutputSuccess(i){if(i===void 0)return"Completed";try{let e=JSON.stringify(i),t=400;return e.length>t?`${e.substring(0,t)}\u2026`:e}catch{return"Completed"}}static formatRawInput(i){if(i==null)return"";try{return JSON.stringify(i,null,2)}catch{return String(i)}}static formatLocations(i){if(!i?.length)return"";let e=[];for(let t of i){if(t===null||typeof t!="object"||Array.isArray(t))continue;let s=c.toPlainRecord(t),n=s.path;if(typeof n!="string"||!n.length)continue;let o=s.line,r=typeof o=="number"?`:${o}`:"";e.push(`${n}${r}`)}return e.join(`
2
2
  `)}static formatContent(i){if(!i?.length)return"";let e=[];for(let t of i){if(t===null||typeof t!="object"||Array.isArray(t))continue;let s=c.toPlainRecord(t),n=s.type;if(n==="diff"){let o=s.path,r=s.oldText,a=s.newText,d=[`--- ${typeof o=="string"?o:"(unknown)"}`];typeof r=="string"&&r.length&&d.push(`- ${r.substring(0,500)}${r.length>500?"\u2026":""}`),typeof a=="string"&&a.length&&d.push(`+ ${a.substring(0,500)}${a.length>500?"\u2026":""}`),e.push(d.join(`
3
3
  `))}else if(n==="terminal")try{e.push(`[terminal] ${JSON.stringify(s,null,2)}`)}catch{e.push("[terminal output]")}else if(n==="content"){let o=s.parts;if(Array.isArray(o)){for(let r of o)if(r!==null&&typeof r=="object"&&!Array.isArray(r)){let a=c.toPlainRecord(r);typeof a.text=="string"&&e.push(a.text)}}}}return e.join(`
4
4
 
5
5
  `)}static toPlainRecord(i){let e={};for(let t of Object.keys(i))e[t]=Reflect.get(i,t);return e}};var L=(()=>{class c{baseUrl=`${R.api.baseUrl}/ca-session`;http=I(K);peiContext_DS=I(q);withCcapId(e){let t=this.peiContext_DS.activeCcapId_$();return t?e.set("ccapId",t):e}createSession(e){let t=this.withCcapId(new g);return y(this.http.post(this.baseUrl,e,{params:t}))}listSessions(e){let t=this.withCcapId(new g);return e?.status&&(t=t.set("status",e.status)),e?.workspacePath&&(t=t.set("workspacePath",e.workspacePath)),e?.includeArchived&&(t=t.set("includeArchived","1")),y(this.http.get(this.baseUrl,{params:t}))}syncFromAgent(e){let t=this.withCcapId(new g);return y(this.http.post(`${this.baseUrl}/sync`,{cwd:e?.cwd},{params:t}))}getSession(e){let t=this.withCcapId(new g);return y(this.http.get(`${this.baseUrl}/${e}`,{params:t}))}sendPrompt(e){let t=this.withCcapId(new g);return y(this.http.post(`${this.baseUrl}/${e.sessionId}/prompt`,{content:e.content},{params:t}))}stopExecution(e){let t=this.withCcapId(new g);return y(this.http.post(`${this.baseUrl}/${e}/stop-execution`,{},{params:t}))}terminateSession(e){let t=this.withCcapId(new g);return y(this.http.post(`${this.baseUrl}/${e}/terminate`,{},{params:t}))}setSessionArchived(e){let t=this.withCcapId(new g);return y(this.http.patch(`${this.baseUrl}/${e.sessionId}/archive`,{isArchived:e.isArchived},{params:t}))}getSessionEvents(e){let t=this.withCcapId(new g);return e.sinceSequence!=null&&(t=t.set("sinceSequence",String(e.sinceSequence))),e.limit!=null&&(t=t.set("limit",String(e.limit))),y(this.http.get(`${this.baseUrl}/${e.sessionId}/events`,{params:t}))}hydrateSession(e){return y(this.http.post(`${this.baseUrl}/${e.sessionId}/hydrate`,{force:e.force===!0},{params:this.withCcapId(new g)}))}static \u0275fac=function(t){return new(t||c)};static \u0275prov=E({token:c,factory:c.\u0275fac,providedIn:"root"})}return c})();var fe=(()=>{class c{sessions_$=m([]);sessionsLoading_$=m(!1);sessionsLoadError_$=m(null);selectedSession_$=m(null);selectedSessionLoading_$=m(!1);selectedSessionEvents_$=m([]);sessionEventsHasMore_$=m(!1);mirrorRuntime_$=m(null);consoleMessages_$=m([]);assembledMessages_$=m([]);assembledMessagesHasMore_$=m(!1);isLoadingOlderMessages_$=m(!1);lastStatusUpdate_$=m(null);activeSessionId_$=m("");sessionDetailError_$=m(null);caSession_AS=I(L);extSessionMsg_AS=I(O);globalError_CS=I(k);socket_CS=I(D);ngZone=I(P);eventSubscription=null;reconnectSubscription=null;lastKnownEventSequence=-1;openSessionPollTimer=null;openSessionPollTargetId="";pendingOptimisticPrompts=[];sessionEventsNextSince=null;constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(e=>{this.handleSocketEvent(e)}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(e=>{if(e){let t=this.activeSessionId_$();t&&(this.socket_CS.emit("ca-session:subscribe",{sessionId:t}),this.loadAssembledMessages({sessionId:t}).catch(()=>{}))}})}ngOnDestroy(){this.stopOpenSessionPolling(),this.eventSubscription?.unsubscribe(),this.reconnectSubscription?.unsubscribe()}loadSessions(e){return f(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let t=yield this.caSession_AS.listSessions({includeArchived:e?.includeArchived}),s=t.sessions,o=(Array.isArray(s)?s:[]).map(_=>this.mapSessionRecord(this.toRecord(_)));this.sessions_$.set(o);let r=t.mirrorRuntime,a=this.toRecord(r),l=a.isAcpConnected,d=a.loadSessionSupported,h=a.isTerminalMode,p=a.isTerminalRunnerConnected;typeof l=="boolean"&&typeof d=="boolean"?this.mirrorRuntime_$.set({isAcpConnected:l,loadSessionSupported:d,isTerminalMode:h===!0,isTerminalRunnerConnected:p===!0}):this.mirrorRuntime_$.set(null)}catch(t){this.sessionsLoadError_$.set(t),this.globalError_CS.showError(t,"ca-session-list")}finally{this.sessionsLoading_$.set(!1)}})}syncFromAgent(e){return f(this,null,function*(){try{yield this.caSession_AS.syncFromAgent({cwd:e?.cwd}),yield this.loadSessions()}catch(t){throw this.globalError_CS.showError(t,"ca-session-sync"),t}})}loadSessionDetail(e){return f(this,null,function*(){this.sessionDetailError_$.set(null),this.selectedSessionLoading_$.set(!0);try{let s=(yield this.caSession_AS.getSession(e.sessionId)).session;this.selectedSession_$.set(this.mapSessionRecord(s)),this.sessionEventsNextSince=null,this.sessionEventsHasMore_$.set(!1);let n=yield this.caSession_AS.getSessionEvents({sessionId:e.sessionId,limit:200}),o=n.events.map(a=>({sessionId:typeof a.sessionId=="string"?a.sessionId:e.sessionId,eventType:typeof a.eventType=="string"?a.eventType:"",timestamp:typeof a.timestamp=="string"?a.timestamp:"",data:this.asRecord(a.data),sequence:typeof a.sequence=="number"?a.sequence:0}));this.selectedSessionEvents_$.set(o),this.sessionEventsHasMore_$.set(n.hasMore===!0);let r=n.nextSinceSequence;return this.sessionEventsNextSince=typeof r=="number"?r:null,this.lastKnownEventSequence=Math.max(-1,...this.selectedSessionEvents_$().map(a=>a.sequence??0)),this.seedConsoleFromMirrorEvents(o),this.loadAssembledMessages({sessionId:e.sessionId}).catch(()=>{}),!0}catch(t){return this.sessionDetailError_$.set(t),this.selectedSession_$.set(null),this.selectedSessionEvents_$.set([]),this.globalError_CS.showError(t,"ca-session-detail"),!1}finally{this.selectedSessionLoading_$.set(!1)}})}loadMoreSessionEvents(e){return f(this,null,function*(){let t=this.sessionEventsNextSince;if(t!=null)try{let s=yield this.caSession_AS.getSessionEvents({sessionId:e.sessionId,sinceSequence:t,limit:200}),n=s.events.map(a=>({sessionId:typeof a.sessionId=="string"?a.sessionId:e.sessionId,eventType:typeof a.eventType=="string"?a.eventType:"",timestamp:typeof a.timestamp=="string"?a.timestamp:"",data:this.asRecord(a.data),sequence:typeof a.sequence=="number"?a.sequence:0})),o=[...this.selectedSessionEvents_$(),...n];o.sort(M.compareMirrorEventsAsc),this.selectedSessionEvents_$.set(o),this.sessionEventsHasMore_$.set(s.hasMore===!0);let r=s.nextSinceSequence;this.sessionEventsNextSince=typeof r=="number"?r:null,this.lastKnownEventSequence=Math.max(this.lastKnownEventSequence,...n.map(a=>a.sequence??0))}catch(s){this.globalError_CS.showError(s,"ca-session-events-page")}})}hydrateFromAgent(e){return f(this,null,function*(){try{yield this.caSession_AS.hydrateSession({sessionId:e.sessionId,force:e.force})}catch(s){throw this.globalError_CS.showError(s,"ca-session-hydrate"),s}if(!(yield this.loadSessionDetail({sessionId:e.sessionId}))){let s=this.sessionDetailError_$();throw s instanceof Error?s:new Error("CA session detail reload after hydrate failed")}})}setActiveSessionId(e){let t=this.activeSessionId_$();t&&t!==e&&this.socket_CS.emit("ca-session:unsubscribe",{sessionId:t}),this.activeSessionId_$.set(e),e&&this.socket_CS.emit("ca-session:subscribe",{sessionId:e})}clearLiveOutput(){this.consoleMessages_$.set([]),this.lastKnownEventSequence=-1,this.pendingOptimisticPrompts.length=0}createSession(e){return f(this,null,function*(){try{let t=yield this.caSession_AS.createSession({workspacePath:e.workspacePath,label:e.label}),n=this.toRecord(t.session).sessionId,o=typeof n=="string"?n:"";return yield this.loadSessions(),o}catch(t){throw t}})}sendPrompt(e){return f(this,null,function*(){let t=`optimistic-prompt-${globalThis.crypto.randomUUID()}`;this.pendingOptimisticPrompts.push({listKey:t,text:e.content}),this.pushConsoleMessage({listKey:t,type:"prompt",text:e.content});try{yield this.caSession_AS.sendPrompt(e)}catch(s){let n=this.pendingOptimisticPrompts.findIndex(o=>o.listKey===t);throw n>=0&&this.pendingOptimisticPrompts.splice(n,1),this.pushConsoleMessage({type:"error",text:A.getErrorMessageForDisplay(s)}),this.globalError_CS.showError(s,"ca-session-prompt"),s}})}stopExecution(e){return f(this,null,function*(){try{yield this.caSession_AS.stopExecution(e)}catch(t){throw this.globalError_CS.showError(t,"ca-session-stop-execution"),t}})}terminateSession(e){return f(this,null,function*(){try{yield this.caSession_AS.terminateSession(e),yield this.loadSessions()}catch(t){throw this.globalError_CS.showError(t,"ca-session-terminate"),t}})}setSessionArchived(e){return f(this,null,function*(){try{let t=yield this.caSession_AS.setSessionArchived(e);yield this.loadSessions(),this.selectedSession_$()?.sessionId===e.sessionId&&t.session!==null&&typeof t.session=="object"&&this.selectedSession_$.set(this.mapSessionRecord(this.toRecord(t.session)))}catch(t){throw this.globalError_CS.showError(t,"ca-session-archive"),t}})}startOpenSessionPolling(e){if(this.stopOpenSessionPolling(),!e)return;this.openSessionPollTargetId=e;let t=10*v.second;this.openSessionPollTimer=globalThis.setInterval(()=>{this.runOpenSessionPollTick(e)},t)}stopOpenSessionPolling(){this.openSessionPollTimer!==null&&(globalThis.clearInterval(this.openSessionPollTimer),this.openSessionPollTimer=null),this.openSessionPollTargetId=""}pushConsoleMessage(e){let t=this.materializeConsoleLineFromPushParams({listKey:e.listKey,type:e.type,text:e.text,timestamp:e.timestamp??new Date().toISOString(),rawData:e.rawData,mirrorEventType:e.mirrorEventType,briefSubtype:e.briefSubtype,useRawBubbleKind:e.useRawBubbleKind,streamTextRole:e.streamTextRole,streamLastSequence:e.streamLastSequence,streamMessageId:e.streamMessageId,streamPartData:e.streamPartData,toolDisplayName:e.toolDisplayName,isToolCallFailedIndicator:e.isToolCallFailedIndicator}),s=this.consoleMessages_$();this.consoleMessages_$.set([...s,t])}appendConsoleMirrorEventOne(e){if(e.eventType==="ca-session-update"){let o=u.tryParseMirrorData(e.data??{});if(o!==null&&this.applyToolCallMirrorEventToLiveConsole({ev:e,parsed:o}))return}let t=T.buildFromMirrorEvent(e);if(t===null||(e.eventType==="prompt-sent"&&t.consoleType==="prompt"&&this.removePendingOptimisticPromptBubbleIfTextMatchesMirror(t.bodyText),this.consoleMessages_$().some(o=>o.listKey===t.listKey))||t.isStreamingTextChunk===!0&&this.tryMergeStreamingMirrorChunkIntoConsole({ev:e,brief:t}))return;let n=typeof e.timestamp=="string"&&e.timestamp.length?e.timestamp:new Date().toISOString();this.pushConsoleMessage(this.buildConsolePushParamsFromBrief({ev:e,brief:t,timestampIso:n}))}tryMergeStreamingMirrorChunkIntoConsole(e){let t=this.consoleMessages_$();if(t.length===0)return!1;let s=t[t.length-1],n=C.parseStreamChunkFromMirrorData(e.ev.data??{});if(n===null||!C.canMergeConsoleTailWithChunk({prev:s,ev:e.ev,parsed:n}))return!1;let o=s.streamPartData!==void 0?[...s.streamPartData]:[];o.push(e.ev.data??{});let r=e.brief.streamMessageId,a=r!==void 0&&r.trim().length>0?r.trim():s.streamMessageId,l=b(S({},s),{text:s.text+e.brief.bodyText,streamLastSequence:e.ev.sequence??s.streamLastSequence,streamMessageId:a,streamPartData:o,rawData:{streamMerged:!0,partCount:o.length,lastChunkSequence:e.ev.sequence,chunkSnapshots:o}}),d=[...t];return d[d.length-1]=l,this.consoleMessages_$.set(d),!0}buildConsolePushParamsFromBrief(e){let t=e.brief;return t.isStreamingTextChunk===!0?{listKey:t.listKey,type:t.consoleType,text:t.bodyText,timestamp:e.timestampIso,rawData:t.rawData,mirrorEventType:t.mirrorEventType,briefSubtype:t.briefSubtype,useRawBubbleKind:t.useRawBubbleKind,streamTextRole:t.streamTextRole,streamLastSequence:e.ev.sequence,streamMessageId:t.streamMessageId,streamPartData:[e.ev.data??{}]}:{listKey:t.listKey,type:t.consoleType,text:t.bodyText,timestamp:e.timestampIso,rawData:t.rawData,mirrorEventType:t.mirrorEventType,briefSubtype:t.briefSubtype,useRawBubbleKind:t.useRawBubbleKind}}buildFoldedConsoleMessagesFromMirrorEvents(e){let t=[];for(let s of e){if(this.tryFoldToolCallMirrorEventIntoOut(t,s))continue;let o=T.buildFromMirrorEvent(s);if(o===null)continue;let r=typeof s.timestamp=="string"&&s.timestamp.length?s.timestamp:new Date().toISOString();if(o.isStreamingTextChunk===!0){let a=C.parseStreamChunkFromMirrorData(s.data??{});if(a===null)continue;let l=t.length>0?t[t.length-1]:void 0;if(l!==void 0&&C.canMergeConsoleTailWithChunk({prev:l,ev:s,parsed:a})){let d=l.streamPartData!==void 0?[...l.streamPartData]:[];d.push(s.data??{});let h=o.streamMessageId,p=h!==void 0&&h.trim().length>0?h.trim():l.streamMessageId;t[t.length-1]=b(S({},l),{text:l.text+o.bodyText,streamLastSequence:s.sequence??l.streamLastSequence,streamMessageId:p,streamPartData:d,rawData:{streamMerged:!0,partCount:d.length,lastChunkSequence:s.sequence,chunkSnapshots:d}})}else t.push(this.materializeConsoleLineFromPushParams(this.buildConsolePushParamsFromBrief({ev:s,brief:o,timestampIso:r})))}else t.push(this.materializeConsoleLineFromPushParams(this.buildConsolePushParamsFromBrief({ev:s,brief:o,timestampIso:r})))}return t}materializeConsoleLineFromPushParams(e){return{listKey:e.listKey??globalThis.crypto.randomUUID(),type:e.type,text:e.text,timestamp:e.timestamp,rawData:e.rawData,mirrorEventType:e.mirrorEventType,briefSubtype:e.briefSubtype,useRawBubbleKind:e.useRawBubbleKind,streamTextRole:e.streamTextRole,streamLastSequence:e.streamLastSequence,streamMessageId:e.streamMessageId,streamPartData:e.streamPartData,toolDisplayName:e.toolDisplayName,isToolCallFailedIndicator:e.isToolCallFailedIndicator}}applyToolCallMirrorEventToLiveConsole(e){let t=e.parsed,s=t.toolCallId,n=typeof e.ev.timestamp=="string"&&e.ev.timestamp.length?e.ev.timestamp:new Date().toISOString(),o=e.ev.data??{};if(t.sessionUpdate==="tool_call"){let r=u.listKeyStart(s);if(this.consoleMessages_$().some(h=>h.listKey===r))return!0;let l=c.toolCallDisplayName(t),d=c.buildToolCallBodyText({displayName:l,parsed:t});return this.pushConsoleMessage({listKey:r,type:"tool",text:d,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call",toolDisplayName:l}),!0}if(t.sessionUpdate==="tool_call_update"&&t.status==="in_progress"){t.rawInput!==void 0&&this.patchLiveToolCallStartInput({toolCallId:s,parsed:t});let r=u.listKeyProgress(s),a="in_progress",l=this.consoleMessages_$(),d=l.findIndex(p=>p.listKey===r),h=this.materializeConsoleLineFromPushParams({listKey:r,type:"status-update",text:a,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"});if(d>=0){let p=[...l];p[d]=h,this.consoleMessages_$.set(p)}else this.consoleMessages_$.set([...l,h]);return!0}if(t.sessionUpdate==="tool_call_update"&&t.status==="completed"){if(u.hasRawOutputError(t.rawOutput)){let d=u.listKeyError(s);if(!this.consoleMessages_$().some(p=>p.listKey===d)){let p=u.summarizeRawOutputError(t.rawOutput);this.pushConsoleMessage({listKey:d,type:"error",text:p,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"}),this.patchLiveConsoleToolCallStartFailed({toolCallId:s})}return!0}let a=u.listKeyResult(s);if(!this.consoleMessages_$().some(d=>d.listKey===a)){let d=u.summarizeRawOutputSuccess(t.rawOutput);this.pushConsoleMessage({listKey:a,type:"tool-result",text:d,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"})}return!0}return!1}tryFoldToolCallMirrorEventIntoOut(e,t){if(t.eventType!=="ca-session-update")return!1;let s=u.tryParseMirrorData(t.data??{});if(s===null)return!1;let n=typeof t.timestamp=="string"&&t.timestamp.length?t.timestamp:new Date().toISOString(),o=t.data??{};if(s.sessionUpdate==="tool_call"){let r=u.listKeyStart(s.toolCallId);if(!e.some(l=>l.listKey===r)){let l=c.toolCallDisplayName(s),d=c.buildToolCallBodyText({displayName:l,parsed:s});e.push(this.materializeConsoleLineFromPushParams({listKey:r,type:"tool",text:d,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call",toolDisplayName:l}))}return!0}if(s.sessionUpdate==="tool_call_update"&&s.status==="in_progress"){s.rawInput!==void 0&&c.patchOutArrayToolCallStartInput(e,s);let r=u.listKeyProgress(s.toolCallId),a=this.materializeConsoleLineFromPushParams({listKey:r,type:"status-update",text:"in_progress",timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"}),l=e.findIndex(d=>d.listKey===r);return l>=0?e[l]=a:e.push(a),!0}if(s.sessionUpdate==="tool_call_update"&&s.status==="completed"){if(u.hasRawOutputError(s.rawOutput)){let d=u.listKeyError(s.toolCallId);if(!e.some(p=>p.listKey===d)){let p=u.summarizeRawOutputError(s.rawOutput);e.push(this.materializeConsoleLineFromPushParams({listKey:d,type:"error",text:p,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"})),c.patchOutArrayToolCallStartFailed(e,s.toolCallId)}return!0}let a=u.listKeyResult(s.toolCallId);if(!e.some(d=>d.listKey===a)){let d=u.summarizeRawOutputSuccess(s.rawOutput);e.push(this.materializeConsoleLineFromPushParams({listKey:a,type:"tool-result",text:d,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"}))}return!0}return!1}patchLiveToolCallStartInput(e){let t=u.listKeyStart(e.toolCallId),s=this.consoleMessages_$(),n=s.findIndex(l=>l.listKey===t);if(n<0)return;let o=s[n].toolDisplayName??"Tool call",r=c.buildToolCallBodyText({displayName:o,parsed:e.parsed}),a=[...s];a[n]=b(S({},a[n]),{text:r}),this.consoleMessages_$.set(a)}patchLiveConsoleToolCallStartFailed(e){let t=u.listKeyStart(e.toolCallId),s=this.consoleMessages_$(),n=s.findIndex(r=>r.listKey===t);if(n<0)return;let o=[...s];o[n]=b(S({},o[n]),{isToolCallFailedIndicator:!0}),this.consoleMessages_$.set(o)}static patchOutArrayToolCallStartFailed(e,t){let s=u.listKeyStart(t),n=e.findIndex(o=>o.listKey===s);n<0||(e[n]=b(S({},e[n]),{isToolCallFailedIndicator:!0}))}static patchOutArrayToolCallStartInput(e,t){let s=u.listKeyStart(t.toolCallId),n=e.findIndex(a=>a.listKey===s);if(n<0)return;let o=e[n].toolDisplayName??"Tool call",r=c.buildToolCallBodyText({displayName:o,parsed:t});e[n]=b(S({},e[n]),{text:r})}static toolCallDisplayName(e){return e.title!==void 0&&e.title.length?e.title:e.toolKind!==void 0&&e.toolKind.length?e.toolKind:"Tool call"}static buildToolCallBodyText(e){let t=[e.displayName],s=u.formatRawInput(e.parsed.rawInput);s.length&&t.push(s);let n=u.formatLocations(e.parsed.locations);return n.length&&t.push(`[locations]
6
6
  ${n}`),t.join(`
7
7
  `)}runOpenSessionPollTick(e){return f(this,null,function*(){if(!(e!==this.activeSessionId_$()||e!==this.openSessionPollTargetId))try{let t=yield this.caSession_AS.getSession(e);this.ngZone.run(()=>{e===this.activeSessionId_$()&&this.selectedSession_$.set(this.mapSessionRecord(this.toRecord(t.session)))});let s=this.lastKnownEventSequence,o=(yield this.caSession_AS.getSessionEvents({sessionId:e,sinceSequence:s>=0?s:void 0,limit:200})).events.map(r=>({sessionId:typeof r.sessionId=="string"?r.sessionId:e,eventType:typeof r.eventType=="string"?r.eventType:"",timestamp:typeof r.timestamp=="string"?r.timestamp:"",data:this.asRecord(r.data),sequence:typeof r.sequence=="number"?r.sequence:0}));if(!o.length)return;this.ngZone.run(()=>{if(e!==this.activeSessionId_$())return;let r=new Map;for(let l of this.selectedSessionEvents_$())r.set(l.sequence??0,l);for(let l of o)r.set(l.sequence??0,l);let a=[...r.values()].sort(M.compareMirrorEventsAsc);this.selectedSessionEvents_$.set(a);for(let l of o)(l.sequence??0)>s&&this.appendConsoleMirrorEventOne(l);this.lastKnownEventSequence=Math.max(s,...o.map(l=>l.sequence??0))})}catch{}})}handleSocketEvent(e){let t=e.event,s=e.payload;try{this.ngZone.run(()=>{switch(t){case"ca-session:status":this.handleStatusUpdate(s);break;case"ca-session:output":this.handleOutputChunk(s);break;case"ca-session:event":this.handleSessionEvent(s);break;case"ca-session:list-update":this.loadSessions().catch(()=>{});break;case"ext-session-msg:message":this.handleAssembledMessage(s);break;case"ext-session-msg:update":this.handleAssembledMessageUpdate(s);break;default:break}})}catch(n){v.DyFM_Log.error(`CCAP_CaSession_DS | socket error | ${t}`,n)}}handleStatusUpdate(e){let t=typeof e.sessionId=="string"?e.sessionId:"",s=typeof e.status=="string"?e.status:"",n=typeof e.statusMessage=="string"?e.statusMessage:void 0;this.lastStatusUpdate_$.set({sessionId:t,status:s,statusMessage:n});let o=this.sessions_$();this.sessions_$.set(o.map(a=>a.sessionId===t?b(S({},a),{status:s,statusMessage:n}):a));let r=this.selectedSession_$();r?.sessionId===t&&this.selectedSession_$.set(b(S({},r),{status:s,statusMessage:n})),s==="errored"&&this.globalError_CS.showError(new Error(n?`CA session error: ${n}`:"CA session errored"),"ca-session-status")}handleOutputChunk(e){let t=typeof e.sessionId=="string"?e.sessionId:"";if(t&&t!==this.activeSessionId_$())return;let s=typeof e.content=="string"?e.content:"",n=typeof e.type=="string"?e.type:"response";if(s){let o={};for(let r of Object.keys(e))o[r]=Reflect.get(e,r);this.pushConsoleMessage({type:n==="error"?"error":"assistant",text:s,rawData:o,mirrorEventType:"ca-session:output"})}}handleSessionEvent(e){let t=typeof e.sessionId=="string"?e.sessionId:"";if(t&&t!==this.activeSessionId_$())return;let s=this.asRecord(e.event),n=typeof s.sequence=="number"?s.sequence:0;if(n<=this.lastKnownEventSequence)return;this.lastKnownEventSequence=n;let o=s.timestamp,r={sessionId:t,eventType:typeof s.eventType=="string"?s.eventType:"",timestamp:typeof o=="string"&&o.length?o:new Date().toISOString(),data:this.asRecord(s.data),sequence:n},a=this.selectedSessionEvents_$();this.selectedSessionEvents_$.set([...a,r]),this.appendConsoleMirrorEventOne(r)}seedConsoleFromMirrorEvents(e){this.pendingOptimisticPrompts.length=0;let t=[...e].sort(M.compareMirrorEventsAsc);this.consoleMessages_$.set(this.buildFoldedConsoleMessagesFromMirrorEvents(t))}removePendingOptimisticPromptBubbleIfTextMatchesMirror(e){let t=this.pendingOptimisticPrompts.findIndex(o=>o.text===e||o.text.trim()===e.trim());if(t<0)return;let s=this.pendingOptimisticPrompts[t];this.pendingOptimisticPrompts.splice(t,1);let n=this.consoleMessages_$().filter(o=>o.listKey!==s.listKey);this.consoleMessages_$.set(n)}mapSessionRecord(e){return{sessionId:typeof e.sessionId=="string"?e.sessionId:void 0,acpSessionId:typeof e.acpSessionId=="string"?e.acpSessionId:void 0,label:typeof e.label=="string"?e.label:void 0,workspacePath:typeof e.workspacePath=="string"?e.workspacePath:void 0,status:typeof e.status=="string"?e.status:void 0,statusMessage:typeof e.statusMessage=="string"?e.statusMessage:void 0,promptCount:typeof e.promptCount=="number"?e.promptCount:void 0,lastPrompt:typeof e.lastPrompt=="string"?e.lastPrompt:void 0,lastActivityAt:typeof e.lastActivityAt=="string"?e.lastActivityAt:void 0,isArchived:e.isArchived===!0,parentSessionId:typeof e.parentSessionId=="string"?e.parentSessionId:void 0,lastSyncAt:typeof e.lastSyncAt=="string"?e.lastSyncAt:void 0,lastSyncError:typeof e.lastSyncError=="string"?e.lastSyncError:void 0,agentInfoName:typeof e.agentInfoName=="string"?e.agentInfoName:void 0,agentInfoVersion:typeof e.agentInfoVersion=="string"?e.agentInfoVersion:void 0,isAcpConnected:typeof e.isAcpConnected=="boolean"?e.isAcpConnected:void 0,loadSessionSupported:typeof e.loadSessionSupported=="boolean"?e.loadSessionSupported:void 0,isTerminalMode:typeof e.isTerminalMode=="boolean"?e.isTerminalMode:void 0,isTerminalRunnerConnected:typeof e.isTerminalRunnerConnected=="boolean"?e.isTerminalRunnerConnected:void 0}}asRecord(e){return this.toRecord(e)}toRecord(e){if(e!==null&&typeof e=="object"&&!Array.isArray(e)){let t={};for(let s of Object.keys(e))t[s]=Reflect.get(e,s);return t}return{}}loadAssembledMessages(e){return f(this,null,function*(){try{let t=yield this.extSessionMsg_AS.getMessages({sessionId:e.sessionId,latest:!0});this.assembledMessages_$.set(t.messages),this.assembledMessagesHasMore_$.set(t.hasMore===!0)}catch(t){v.DyFM_Log.error(`CCAP_CaSession_DS | loadAssembledMessages failed | sessionId: ${e.sessionId}`,t)}})}loadOlderAssembledMessages(e){return f(this,null,function*(){if(this.isLoadingOlderMessages_$()||!this.assembledMessagesHasMore_$())return;let t=this.assembledMessages_$();if(!t.length)return;let s=t.reduce((n,o)=>(o.sequence??0)<n?o.sequence??0:n,t[0].sequence??0);this.isLoadingOlderMessages_$.set(!0);try{let n=yield this.extSessionMsg_AS.getMessages({sessionId:e.sessionId,beforeSequence:s,limit:e.limit??50});n.messages.length&&this.assembledMessages_$.set([...n.messages,...t]),this.assembledMessagesHasMore_$.set(n.hasMore===!0)}catch(n){v.DyFM_Log.error(`CCAP_CaSession_DS | loadOlderAssembledMessages failed | sessionId: ${e.sessionId}`,n)}finally{this.isLoadingOlderMessages_$.set(!1)}})}handleAssembledMessage(e){let t=typeof e.sessionId=="string"?e.sessionId:"";if(!t||t!==this.activeSessionId_$())return;let s=e.message;if(!s||typeof s!="object")return;let n=s,o=this.assembledMessages_$();this.assembledMessages_$.set([...o,n])}handleAssembledMessageUpdate(e){let t=typeof e.sessionId=="string"?e.sessionId:"";if(!t||t!==this.activeSessionId_$())return;let s=typeof e.messageKey=="string"?e.messageKey:"";if(!s)return;let n=e.update;if(!n||typeof n!="object")return;let o=n,r=this.assembledMessages_$(),a=r.findIndex(h=>h.messageKey===s);if(a<0)return;let l=S({},r[a]);typeof o.bodyText=="string"&&(l.bodyText=o.bodyText),o.toolResult!==void 0&&(l.toolResult=o.toolResult),typeof o.toolStatus=="string"&&(l.toolStatus=o.toolStatus),o.headerStatusDot!==void 0&&(l.headerStatusDot=typeof o.headerStatusDot=="string"?o.headerStatusDot:void 0);let d=[...r];d[a]=l,this.assembledMessages_$.set(d)}static \u0275fac=function(t){return new(t||c)};static \u0275prov=E({token:c,factory:c.\u0275fac,providedIn:"root"})}return c})();export{M as a,C as b,x as c,u as d,fe as e};
8
- //# sourceMappingURL=chunk-5WVPI5OK.js.map
8
+ //# sourceMappingURL=chunk-32WW5HVW.js.map
@@ -1,3 +1,3 @@
1
- import{a as n}from"./chunk-NXBTW2AM.js";import{G as o}from"./chunk-TBMJSIBB.js";var u=(()=>{class e{transform(t){return n.formatAbsoluteForTooltip(t)}static \u0275fac=function(i){return new(i||e)};static \u0275pipe=o({name:"sAbsoluteTime",type:e,pure:!0,standalone:!0})}return e})();var d=(()=>{class e{transform(t){return n.formatCompactRelativeTime(t)}static \u0275fac=function(i){return new(i||e)};static \u0275pipe=o({name:"sTimeAgo",type:e,pure:!0,standalone:!0})}return e})();var a=class e{static normalizeForSearch(r){return typeof r!="string"||r.length===0?"":r.trim().toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"")}static includesText(r,t){let i=e.normalizeForSearch(t);return i.length===0?!0:e.normalizeForSearch(r).includes(i)}};var s=class{static looksLikeJson(r){let t=r.trim();return t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]")}static formatJson(r){try{let t=JSON.parse(r.trim());return JSON.stringify(t,null,2)}catch{return r}}static lineCount(r){return r.split(`
1
+ import{a as n}from"./chunk-C2XSLL34.js";import{G as o}from"./chunk-TBMJSIBB.js";var u=(()=>{class e{transform(t){return n.formatAbsoluteForTooltip(t)}static \u0275fac=function(i){return new(i||e)};static \u0275pipe=o({name:"sAbsoluteTime",type:e,pure:!0,standalone:!0})}return e})();var d=(()=>{class e{transform(t){return n.formatCompactRelativeTime(t)}static \u0275fac=function(i){return new(i||e)};static \u0275pipe=o({name:"sTimeAgo",type:e,pure:!0,standalone:!0})}return e})();var a=class e{static normalizeForSearch(r){return typeof r!="string"||r.length===0?"":r.trim().toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"")}static includesText(r,t){let i=e.normalizeForSearch(t);return i.length===0?!0:e.normalizeForSearch(r).includes(i)}};var s=class{static looksLikeJson(r){let t=r.trim();return t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]")}static formatJson(r){try{let t=JSON.parse(r.trim());return JSON.stringify(t,null,2)}catch{return r}}static lineCount(r){return r.split(`
2
2
  `).length}};export{a,u as b,d as c,s as d};
3
- //# sourceMappingURL=chunk-OUKRDBHU.js.map
3
+ //# sourceMappingURL=chunk-45RYB36M.js.map