@futdevpro/ccap 1.1.2429 → 1.1.2432

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 (181) hide show
  1. package/client-dist/{agent-instances.module-RZYPPRAM.js → agent-instances.module-JKEUNCUG.js} +2 -2
  2. package/client-dist/{ca.module-QINH4O4N.js → ca.module-TX3AFL3R.js} +2 -2
  3. package/client-dist/{cc.module-VDPOJI5K.js → cc.module-B5Z7Z43I.js} +2 -2
  4. package/client-dist/{chunk-C2JIHZSA.js → chunk-3EFXICQW.js} +2 -2
  5. package/client-dist/{chunk-TKH5TYQR.js → chunk-4UYB7JRE.js} +2 -2
  6. package/client-dist/{chunk-VVRW6Z6T.js → chunk-55AT264I.js} +2 -2
  7. package/client-dist/{chunk-PPX3BZII.js → chunk-6FYQBBKN.js} +2 -2
  8. package/client-dist/{chunk-EDJNVQES.js → chunk-75JAPRHN.js} +2 -2
  9. package/client-dist/{chunk-YVNOWF66.js → chunk-7BOFUMRF.js} +2 -2
  10. package/client-dist/{chunk-W2PRUFE2.js → chunk-7OVIJZ3I.js} +2 -2
  11. package/client-dist/{chunk-RI3ALJGR.js → chunk-ATXBAOPB.js} +2 -2
  12. package/client-dist/{chunk-G24Q5QRR.js → chunk-CIIP66UO.js} +2 -2
  13. package/client-dist/{chunk-N6ZJJLVP.js → chunk-D4HXGAOA.js} +2 -2
  14. package/client-dist/{chunk-55RS5CDP.js → chunk-E37ERYLL.js} +2 -2
  15. package/client-dist/{chunk-H7KV7VUT.js → chunk-FE4E3JH3.js} +2 -2
  16. package/client-dist/{chunk-TOY2LMCZ.js → chunk-FFWOS4UA.js} +2 -2
  17. package/client-dist/{chunk-JARR5ARB.js → chunk-FL7JMWSB.js} +2 -2
  18. package/client-dist/{chunk-DIJ2B7MQ.js → chunk-FSXAP2E7.js} +2 -2
  19. package/client-dist/{chunk-UFGGDD6A.js → chunk-FUTFIQDJ.js} +2 -2
  20. package/client-dist/{chunk-BBK7W63P.js → chunk-FXY3OFYD.js} +2 -2
  21. package/client-dist/{chunk-YGYISOSF.js → chunk-G5TWCL6S.js} +2 -2
  22. package/client-dist/{chunk-WGGUNLYH.js → chunk-GBVC2CL6.js} +2 -2
  23. package/client-dist/{chunk-T44YIVMQ.js → chunk-GY6WIUX3.js} +2 -2
  24. package/client-dist/{chunk-7VZZDUAJ.js → chunk-HEHXNLKY.js} +2 -2
  25. package/client-dist/{chunk-FGBFND2T.js → chunk-I2SFULUF.js} +2 -2
  26. package/client-dist/{chunk-FGBFND2T.js.map → chunk-I2SFULUF.js.map} +1 -1
  27. package/client-dist/{chunk-35SRLU3M.js → chunk-I5U3HPJG.js} +2 -2
  28. package/client-dist/{chunk-TGBEED5K.js → chunk-IEV7F6EL.js} +2 -2
  29. package/client-dist/{chunk-XEH3AYHH.js → chunk-INVP3OKB.js} +2 -2
  30. package/client-dist/{chunk-LBQTK43B.js → chunk-JOZRJDUL.js} +2 -2
  31. package/client-dist/{chunk-DM6FMVGG.js → chunk-JRGPAVVX.js} +2 -2
  32. package/client-dist/{chunk-NTGGORLA.js → chunk-KFNTFPN7.js} +2 -2
  33. package/client-dist/{chunk-D5OIEQJ7.js → chunk-KSBOX33Q.js} +2 -2
  34. package/client-dist/{chunk-ZLW5F3RV.js → chunk-LKN35PR6.js} +2 -2
  35. package/client-dist/{chunk-JHIND6VA.js → chunk-MK2MQJSP.js} +2 -2
  36. package/client-dist/{chunk-HQ225XML.js → chunk-MNOT53BD.js} +2 -2
  37. package/client-dist/{chunk-FZDBSBYV.js → chunk-MUIFJGHU.js} +2 -2
  38. package/client-dist/{chunk-A5543ONP.js → chunk-N76A7BVQ.js} +2 -2
  39. package/client-dist/{chunk-JNR3VH5W.js → chunk-N7OOE7E4.js} +2 -2
  40. package/client-dist/{chunk-SO5JTD3R.js → chunk-NZEXOFOI.js} +2 -2
  41. package/client-dist/{chunk-35LXCZXT.js → chunk-OLNPWGIZ.js} +2 -2
  42. package/client-dist/{chunk-LDRYRIG4.js → chunk-P22JFQR3.js} +2 -2
  43. package/client-dist/{chunk-4WRWSRIY.js → chunk-P3SPNTAX.js} +2 -2
  44. package/client-dist/{chunk-YESFTZ4F.js → chunk-QCRWKVJT.js} +2 -2
  45. package/client-dist/{chunk-FJA65K2A.js → chunk-QLZ5AUCW.js} +2 -2
  46. package/client-dist/{chunk-SVMFGTCL.js → chunk-R2BS7UGU.js} +2 -2
  47. package/client-dist/{chunk-MF74DXXX.js → chunk-SP3LFOET.js} +2 -2
  48. package/client-dist/{chunk-OD6DDVJX.js → chunk-T4WDZXQN.js} +2 -2
  49. package/client-dist/{chunk-BJQLYQ2Q.js → chunk-TJCH3S3T.js} +2 -2
  50. package/client-dist/{chunk-6A4MK7BV.js → chunk-UO5ZXB7L.js} +2 -2
  51. package/client-dist/{chunk-QIQ53K2D.js → chunk-VC2QRVQ7.js} +2 -2
  52. package/client-dist/{chunk-VW7GI2YR.js → chunk-VFDYFCC7.js} +2 -2
  53. package/client-dist/{chunk-7YSBILYM.js → chunk-VKPL624D.js} +2 -2
  54. package/client-dist/{chunk-2PWIONDN.js → chunk-VPGLGWPN.js} +2 -2
  55. package/client-dist/{chunk-3YMYHHZ6.js → chunk-XTZHZCG6.js} +2 -2
  56. package/client-dist/{chunk-347TBZVT.js → chunk-Y7SGEIKU.js} +2 -2
  57. package/client-dist/{chunk-P4MCRSBA.js → chunk-YOC3S3BH.js} +2 -2
  58. package/client-dist/{chunk-MWJJONDM.js → chunk-YQIFTARZ.js} +2 -2
  59. package/client-dist/{chunk-4TRPR5L6.js → chunk-ZHR6XIVW.js} +2 -2
  60. package/client-dist/{chunk-4B3YNAY2.js → chunk-ZVZD67AP.js} +2 -2
  61. package/client-dist/{consultant.module-JKODNOC3.js → consultant.module-YC7GKPOG.js} +2 -2
  62. package/client-dist/{crd.module-5L25FJEK.js → crd.module-LC3DY7LU.js} +2 -2
  63. package/client-dist/{dashboard.module-2VG45PI4.js → dashboard.module-JLA4MYYP.js} +2 -2
  64. package/client-dist/{do.module-EDOIXLQA.js → do.module-KTCE4X4J.js} +2 -2
  65. package/client-dist/{document-library.module-4VZA35GV.js → document-library.module-2QBE6V2Z.js} +2 -2
  66. package/client-dist/{embedding-eval.module-SEMUHG6E.js → embedding-eval.module-I7EWL3UM.js} +2 -2
  67. package/client-dist/{embedding-registry.module-4LPPTNO3.js → embedding-registry.module-M3L3L3BD.js} +2 -2
  68. package/client-dist/{err.module-D4MQL66X.js → err.module-OHL2V5Y3.js} +2 -2
  69. package/client-dist/{feedback.module-ZWG4BEZL.js → feedback.module-LNX7LWEM.js} +2 -2
  70. package/client-dist/{host-runtime-mcp.module-MOUJ2RXK.js → host-runtime-mcp.module-7SX3B3NP.js} +2 -2
  71. package/client-dist/index.html +1 -1
  72. package/client-dist/{live-dev-pipeline.module-L4E7BWVO.js → live-dev-pipeline.module-HL25YCJC.js} +2 -2
  73. package/client-dist/{logs.module-4KX5TIQO.js → logs.module-NNCGKX73.js} +2 -2
  74. package/client-dist/{main-AAN7AJOU.js → main-7Y4FEVC7.js} +3 -3
  75. package/client-dist/{master-control-remote-poc.module-5QHKCHTZ.js → master-control-remote-poc.module-5NTI5QPD.js} +2 -2
  76. package/client-dist/{mobile-app.module-OU4YUGMW.js → mobile-app.module-FTNCX6PP.js} +2 -2
  77. package/client-dist/{model-registry.module-MYYY2NHG.js → model-registry.module-GZUNF7PX.js} +2 -2
  78. package/client-dist/{oc.module-E6N2TOCE.js → oc.module-2NTIVSJN.js} +2 -2
  79. package/client-dist/{orc.module-G5IJVN7G.js → orc.module-CU4HSQUN.js} +2 -2
  80. package/client-dist/{project-management.module-FBFZ44C2.js → project-management.module-2D4Z7P4Q.js} +2 -2
  81. package/client-dist/project-source-routed.module-YBK2URBN.js +2 -0
  82. package/client-dist/{scheduler.module-6Y3EWL5H.js → scheduler.module-MYQMNT3T.js} +2 -2
  83. package/client-dist/{session.module-A44K63ML.js → session.module-QYX3W76J.js} +2 -2
  84. package/client-dist/{set.module-H3BKR5R4.js → set.module-DDUQ4KGU.js} +2 -2
  85. package/client-dist/{setup.module-3DXJJC2Y.js → setup.module-JS6FRMIB.js} +2 -2
  86. package/client-dist/{terminals.module-77QWSAOS.js → terminals.module-TVAWIQKB.js} +2 -2
  87. package/client-dist/{voice-notes-poc.module-BZLRUVW4.js → voice-notes-poc.module-3SNTCAXN.js} +2 -2
  88. package/client-dist/{wfs.module-5PIWVY65.js → wfs.module-LHPIAA73.js} +2 -2
  89. package/package.json +1 -1
  90. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.d.ts +17 -6
  91. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.d.ts.map +1 -1
  92. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.js +23 -7
  93. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.js.map +1 -1
  94. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.spec.js +10 -2
  95. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/status/cc-status-transition.control-service.spec.js.map +1 -1
  96. package/client-dist/project-source-routed.module-KCWBWO5M.js +0 -2
  97. /package/client-dist/{agent-instances.module-RZYPPRAM.js.map → agent-instances.module-JKEUNCUG.js.map} +0 -0
  98. /package/client-dist/{ca.module-QINH4O4N.js.map → ca.module-TX3AFL3R.js.map} +0 -0
  99. /package/client-dist/{cc.module-VDPOJI5K.js.map → cc.module-B5Z7Z43I.js.map} +0 -0
  100. /package/client-dist/{chunk-C2JIHZSA.js.map → chunk-3EFXICQW.js.map} +0 -0
  101. /package/client-dist/{chunk-TKH5TYQR.js.map → chunk-4UYB7JRE.js.map} +0 -0
  102. /package/client-dist/{chunk-VVRW6Z6T.js.map → chunk-55AT264I.js.map} +0 -0
  103. /package/client-dist/{chunk-PPX3BZII.js.map → chunk-6FYQBBKN.js.map} +0 -0
  104. /package/client-dist/{chunk-EDJNVQES.js.map → chunk-75JAPRHN.js.map} +0 -0
  105. /package/client-dist/{chunk-YVNOWF66.js.map → chunk-7BOFUMRF.js.map} +0 -0
  106. /package/client-dist/{chunk-W2PRUFE2.js.map → chunk-7OVIJZ3I.js.map} +0 -0
  107. /package/client-dist/{chunk-RI3ALJGR.js.map → chunk-ATXBAOPB.js.map} +0 -0
  108. /package/client-dist/{chunk-G24Q5QRR.js.map → chunk-CIIP66UO.js.map} +0 -0
  109. /package/client-dist/{chunk-N6ZJJLVP.js.map → chunk-D4HXGAOA.js.map} +0 -0
  110. /package/client-dist/{chunk-55RS5CDP.js.map → chunk-E37ERYLL.js.map} +0 -0
  111. /package/client-dist/{chunk-H7KV7VUT.js.map → chunk-FE4E3JH3.js.map} +0 -0
  112. /package/client-dist/{chunk-TOY2LMCZ.js.map → chunk-FFWOS4UA.js.map} +0 -0
  113. /package/client-dist/{chunk-JARR5ARB.js.map → chunk-FL7JMWSB.js.map} +0 -0
  114. /package/client-dist/{chunk-DIJ2B7MQ.js.map → chunk-FSXAP2E7.js.map} +0 -0
  115. /package/client-dist/{chunk-UFGGDD6A.js.map → chunk-FUTFIQDJ.js.map} +0 -0
  116. /package/client-dist/{chunk-BBK7W63P.js.map → chunk-FXY3OFYD.js.map} +0 -0
  117. /package/client-dist/{chunk-YGYISOSF.js.map → chunk-G5TWCL6S.js.map} +0 -0
  118. /package/client-dist/{chunk-WGGUNLYH.js.map → chunk-GBVC2CL6.js.map} +0 -0
  119. /package/client-dist/{chunk-T44YIVMQ.js.map → chunk-GY6WIUX3.js.map} +0 -0
  120. /package/client-dist/{chunk-7VZZDUAJ.js.map → chunk-HEHXNLKY.js.map} +0 -0
  121. /package/client-dist/{chunk-35SRLU3M.js.map → chunk-I5U3HPJG.js.map} +0 -0
  122. /package/client-dist/{chunk-TGBEED5K.js.map → chunk-IEV7F6EL.js.map} +0 -0
  123. /package/client-dist/{chunk-XEH3AYHH.js.map → chunk-INVP3OKB.js.map} +0 -0
  124. /package/client-dist/{chunk-LBQTK43B.js.map → chunk-JOZRJDUL.js.map} +0 -0
  125. /package/client-dist/{chunk-DM6FMVGG.js.map → chunk-JRGPAVVX.js.map} +0 -0
  126. /package/client-dist/{chunk-NTGGORLA.js.map → chunk-KFNTFPN7.js.map} +0 -0
  127. /package/client-dist/{chunk-D5OIEQJ7.js.map → chunk-KSBOX33Q.js.map} +0 -0
  128. /package/client-dist/{chunk-ZLW5F3RV.js.map → chunk-LKN35PR6.js.map} +0 -0
  129. /package/client-dist/{chunk-JHIND6VA.js.map → chunk-MK2MQJSP.js.map} +0 -0
  130. /package/client-dist/{chunk-HQ225XML.js.map → chunk-MNOT53BD.js.map} +0 -0
  131. /package/client-dist/{chunk-FZDBSBYV.js.map → chunk-MUIFJGHU.js.map} +0 -0
  132. /package/client-dist/{chunk-A5543ONP.js.map → chunk-N76A7BVQ.js.map} +0 -0
  133. /package/client-dist/{chunk-JNR3VH5W.js.map → chunk-N7OOE7E4.js.map} +0 -0
  134. /package/client-dist/{chunk-SO5JTD3R.js.map → chunk-NZEXOFOI.js.map} +0 -0
  135. /package/client-dist/{chunk-35LXCZXT.js.map → chunk-OLNPWGIZ.js.map} +0 -0
  136. /package/client-dist/{chunk-LDRYRIG4.js.map → chunk-P22JFQR3.js.map} +0 -0
  137. /package/client-dist/{chunk-4WRWSRIY.js.map → chunk-P3SPNTAX.js.map} +0 -0
  138. /package/client-dist/{chunk-YESFTZ4F.js.map → chunk-QCRWKVJT.js.map} +0 -0
  139. /package/client-dist/{chunk-FJA65K2A.js.map → chunk-QLZ5AUCW.js.map} +0 -0
  140. /package/client-dist/{chunk-SVMFGTCL.js.map → chunk-R2BS7UGU.js.map} +0 -0
  141. /package/client-dist/{chunk-MF74DXXX.js.map → chunk-SP3LFOET.js.map} +0 -0
  142. /package/client-dist/{chunk-OD6DDVJX.js.map → chunk-T4WDZXQN.js.map} +0 -0
  143. /package/client-dist/{chunk-BJQLYQ2Q.js.map → chunk-TJCH3S3T.js.map} +0 -0
  144. /package/client-dist/{chunk-6A4MK7BV.js.map → chunk-UO5ZXB7L.js.map} +0 -0
  145. /package/client-dist/{chunk-QIQ53K2D.js.map → chunk-VC2QRVQ7.js.map} +0 -0
  146. /package/client-dist/{chunk-VW7GI2YR.js.map → chunk-VFDYFCC7.js.map} +0 -0
  147. /package/client-dist/{chunk-7YSBILYM.js.map → chunk-VKPL624D.js.map} +0 -0
  148. /package/client-dist/{chunk-2PWIONDN.js.map → chunk-VPGLGWPN.js.map} +0 -0
  149. /package/client-dist/{chunk-3YMYHHZ6.js.map → chunk-XTZHZCG6.js.map} +0 -0
  150. /package/client-dist/{chunk-347TBZVT.js.map → chunk-Y7SGEIKU.js.map} +0 -0
  151. /package/client-dist/{chunk-P4MCRSBA.js.map → chunk-YOC3S3BH.js.map} +0 -0
  152. /package/client-dist/{chunk-MWJJONDM.js.map → chunk-YQIFTARZ.js.map} +0 -0
  153. /package/client-dist/{chunk-4TRPR5L6.js.map → chunk-ZHR6XIVW.js.map} +0 -0
  154. /package/client-dist/{chunk-4B3YNAY2.js.map → chunk-ZVZD67AP.js.map} +0 -0
  155. /package/client-dist/{consultant.module-JKODNOC3.js.map → consultant.module-YC7GKPOG.js.map} +0 -0
  156. /package/client-dist/{crd.module-5L25FJEK.js.map → crd.module-LC3DY7LU.js.map} +0 -0
  157. /package/client-dist/{dashboard.module-2VG45PI4.js.map → dashboard.module-JLA4MYYP.js.map} +0 -0
  158. /package/client-dist/{do.module-EDOIXLQA.js.map → do.module-KTCE4X4J.js.map} +0 -0
  159. /package/client-dist/{document-library.module-4VZA35GV.js.map → document-library.module-2QBE6V2Z.js.map} +0 -0
  160. /package/client-dist/{embedding-eval.module-SEMUHG6E.js.map → embedding-eval.module-I7EWL3UM.js.map} +0 -0
  161. /package/client-dist/{embedding-registry.module-4LPPTNO3.js.map → embedding-registry.module-M3L3L3BD.js.map} +0 -0
  162. /package/client-dist/{err.module-D4MQL66X.js.map → err.module-OHL2V5Y3.js.map} +0 -0
  163. /package/client-dist/{feedback.module-ZWG4BEZL.js.map → feedback.module-LNX7LWEM.js.map} +0 -0
  164. /package/client-dist/{host-runtime-mcp.module-MOUJ2RXK.js.map → host-runtime-mcp.module-7SX3B3NP.js.map} +0 -0
  165. /package/client-dist/{live-dev-pipeline.module-L4E7BWVO.js.map → live-dev-pipeline.module-HL25YCJC.js.map} +0 -0
  166. /package/client-dist/{logs.module-4KX5TIQO.js.map → logs.module-NNCGKX73.js.map} +0 -0
  167. /package/client-dist/{main-AAN7AJOU.js.map → main-7Y4FEVC7.js.map} +0 -0
  168. /package/client-dist/{master-control-remote-poc.module-5QHKCHTZ.js.map → master-control-remote-poc.module-5NTI5QPD.js.map} +0 -0
  169. /package/client-dist/{mobile-app.module-OU4YUGMW.js.map → mobile-app.module-FTNCX6PP.js.map} +0 -0
  170. /package/client-dist/{model-registry.module-MYYY2NHG.js.map → model-registry.module-GZUNF7PX.js.map} +0 -0
  171. /package/client-dist/{oc.module-E6N2TOCE.js.map → oc.module-2NTIVSJN.js.map} +0 -0
  172. /package/client-dist/{orc.module-G5IJVN7G.js.map → orc.module-CU4HSQUN.js.map} +0 -0
  173. /package/client-dist/{project-management.module-FBFZ44C2.js.map → project-management.module-2D4Z7P4Q.js.map} +0 -0
  174. /package/client-dist/{project-source-routed.module-KCWBWO5M.js.map → project-source-routed.module-YBK2URBN.js.map} +0 -0
  175. /package/client-dist/{scheduler.module-6Y3EWL5H.js.map → scheduler.module-MYQMNT3T.js.map} +0 -0
  176. /package/client-dist/{session.module-A44K63ML.js.map → session.module-QYX3W76J.js.map} +0 -0
  177. /package/client-dist/{set.module-H3BKR5R4.js.map → set.module-DDUQ4KGU.js.map} +0 -0
  178. /package/client-dist/{setup.module-3DXJJC2Y.js.map → setup.module-JS6FRMIB.js.map} +0 -0
  179. /package/client-dist/{terminals.module-77QWSAOS.js.map → terminals.module-TVAWIQKB.js.map} +0 -0
  180. /package/client-dist/{voice-notes-poc.module-BZLRUVW4.js.map → voice-notes-poc.module-3SNTCAXN.js.map} +0 -0
  181. /package/client-dist/{wfs.module-5PIWVY65.js.map → wfs.module-LHPIAA73.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{a as re,b as Ae,c as Vt,d as Rt}from"./chunk-347TBZVT.js";import{a as le,b as de,c as Ot,d as Oe}from"./chunk-EDJNVQES.js";import"./chunk-EGRHWZRV.js";import{a as Pe}from"./chunk-LBQTK43B.js";import{a as Me}from"./chunk-3YMYHHZ6.js";import{a as he}from"./chunk-Q2PKIGLB.js";import{a as vt}from"./chunk-7YSBILYM.js";import{a as W}from"./chunk-TKH5TYQR.js";import{a as Ne}from"./chunk-YRVQSWSZ.js";import{a as St}from"./chunk-T44YIVMQ.js";import{a as bt,b as $e}from"./chunk-4WRWSRIY.js";import"./chunk-VVRW6Z6T.js";import"./chunk-55RS5CDP.js";import"./chunk-L44637OO.js";import"./chunk-4TRPR5L6.js";import"./chunk-UFBTR2BG.js";import{a as Ie}from"./chunk-QIQ53K2D.js";import"./chunk-DIJ2B7MQ.js";import"./chunk-JNR3VH5W.js";import"./chunk-JHIND6VA.js";import{e as Mt,f as Pt,g as At}from"./chunk-OD6DDVJX.js";import"./chunk-YVNOWF66.js";import{a as It}from"./chunk-7JUIBZEE.js";import{a as Tt,b as kt,c as $t}from"./chunk-C7XPBJTG.js";import{a as Et,b as U,c as He,e as Dt}from"./chunk-JARR5ARB.js";import"./chunk-WPHEQXWB.js";import{a as wt,c as yt}from"./chunk-BJQLYQ2Q.js";import{b as Ee,c as De}from"./chunk-HQ225XML.js";import"./chunk-TGBEED5K.js";import"./chunk-FJA65K2A.js";import"./chunk-Q2NVIOCY.js";import{a as ae}from"./chunk-XOGAYT52.js";import"./chunk-H7KV7VUT.js";import"./chunk-SO5JTD3R.js";import"./chunk-WGGUNLYH.js";import"./chunk-V3VQWJQL.js";import"./chunk-N6ZJJLVP.js";import"./chunk-35SRLU3M.js";import"./chunk-ZBTWQZNB.js";import{a as Y}from"./chunk-FLAJXIYW.js";import{c as _t,f as mt,i as ut,n as Ct,o as ft,p as xt,v as ht}from"./chunk-EO4DNTT4.js";import"./chunk-SVMFGTCL.js";import{a as O}from"./chunk-5UPNU54P.js";import{j as gt}from"./chunk-UFGGDD6A.js";import{p as lt}from"./chunk-FGBFND2T.js";import{$a as F,Aa as ue,Ba as Ce,C as $,Cb as ke,D as z,E as Xe,Ea as fe,Eb as dt,Fa as d,Fb as ct,G as ie,Ga as y,Gb as se,Ha as E,Ia as J,J as u,K as C,Kb as pt,L as M,M as L,N as Ye,Pa as xe,Qa as tt,Ra as we,T as be,Ta as ye,U as Q,Va as We,W as G,Xa as nt,Z as a,_ as Ze,a as je,aa as b,ab as j,b as ze,bb as it,ca as et,da as g,db as ot,fa as pe,ga as v,h as Qe,ha as ve,hb as P,ia as _e,ib as st,ja as R,jb as Te,k as V,la as _,mb as X,oa as N,ob as at,pa as H,pb as rt,qa as o,ra as s,sa as S,ta as Be,ua as T,ub as oe,va as x,wa as c,y as Ge,z as Je,za as me}from"./chunk-TBMJSIBB.js";function on(t,r){t&1&&(o(0,"div",3),M(),o(1,"svg",5),S(2,"path",6),s(),L(),o(3,"span",7),d(4,"Plan accepted"),s()())}function sn(t,r){if(t&1){let e=T();o(0,"button",8),x("click",function(){u(e);let n=c(2);return C(n.handleAccept())}),M(),o(1,"svg",9),S(2,"path",6),s(),d(3," Accept plan "),s()}}function an(t,r){if(t&1&&(o(0,"div",0),S(1,"div",1),o(2,"div",2),g(3,on,5,0,"div",3)(4,sn,4,0,"button",4),s()()),t&2){let e=c();a(),v("innerHTML",r,G),a(2),_(e.isAccepted_$()?3:4)}}var Ve=(()=>{class t{sanitizer=$(ke);rawData=Q(void 0);accepted=be();isAccepted_$=b(!1);planText_$=P(()=>{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_$=P(()=>{let e=this.planText_$();if(!e)return null;let i=Et.toSanitizedHtml(e);return this.sanitizer.bypassSecurityTrustHtml(i)});handleAccept(){this.isAccepted_$()||(this.isAccepted_$.set(!0),this.accepted.emit())}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=z({type:t,selectors:[["app-s-agent-tool-plan-view"]],hostAttrs:[1,"block"],inputs:{rawData:[1,"rawData"]},outputs:{accepted:"accepted"},standalone:!0,features:[ye],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,"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&&g(0,an,5,2,"div",0),i&2){let l;_((l=n.planHtml_$())?0:-1,l)}},dependencies:[oe],styles:[`@charset "UTF-8";.ccap-assistant-md[_ngcontent-%COMP%]{font-size:inherit;line-height:1.55;text-align:left;color:#ffffffeb}.ccap-assistant-md[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:0}.ccap-assistant-md[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:0}.ccap-assistant-md[_ngcontent-%COMP%] h1[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:600;color:#fffffff7;letter-spacing:.01em}.ccap-assistant-md[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:1.2em;margin-top:1.5rem;margin-bottom:.6rem;padding-bottom:.45rem;border-bottom:1px solid rgba(0,245,255,.28)}.ccap-assistant-md[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:1.1em;margin-top:1.35rem;margin-bottom:.55rem;padding-bottom:.35rem;border-bottom:1px solid rgba(0,245,255,.16)}.ccap-assistant-md[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:1.02em;margin-top:1.15rem;margin-bottom:.45rem;color:#00f5ffe0}.ccap-assistant-md[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-size:.95em;margin-top:.95rem;margin-bottom:.35rem;color:#ffffffc7}.ccap-assistant-md[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:.5rem 0}.ccap-assistant-md[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:650;color:#fffffffa}.ccap-assistant-md[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{font-style:italic;color:#ffffffd9}.ccap-assistant-md[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:.6rem 0;padding-left:1.5rem;list-style-type:disc}.ccap-assistant-md[_ngcontent-%COMP%] ol[_ngcontent-%COMP%]{margin:.6rem 0;padding-left:1.5rem;list-style-type:decimal}.ccap-assistant-md[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin:.15rem 0;line-height:1.5}.ccap-assistant-md[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] ol[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style-type:circle}.ccap-assistant-md[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] ol[_ngcontent-%COMP%] ol[_ngcontent-%COMP%] ol[_ngcontent-%COMP%]{list-style-type:square}.ccap-assistant-md[_ngcontent-%COMP%] li[_ngcontent-%COMP%] + li[_ngcontent-%COMP%]{margin-top:.25rem}.ccap-assistant-md[_ngcontent-%COMP%] li[_ngcontent-%COMP%] > ul[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] li[_ngcontent-%COMP%] > ol[_ngcontent-%COMP%]{margin-top:.15rem;margin-bottom:.1rem}.ccap-assistant-md[_ngcontent-%COMP%] hr[_ngcontent-%COMP%]{border:0;height:1px;background:linear-gradient(90deg,transparent 0%,rgba(0,245,255,.38) 12%,rgba(0,245,255,.38) 88%,transparent 100%);margin:2.2rem 0}.ccap-assistant-md[_ngcontent-%COMP%] blockquote[_ngcontent-%COMP%]{margin:.75rem 0;padding:.45rem .85rem;border-left:3px solid rgba(0,245,255,.4);background:#00f5ff0a;border-radius:0 .25rem .25rem 0;color:#ffffffd9}.ccap-assistant-md[_ngcontent-%COMP%] blockquote[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:.2rem 0}.ccap-assistant-md[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{width:100%;border-collapse:separate;border-spacing:0;margin:1rem 0;font-size:.9em;display:block;overflow-x:auto;border:1px solid rgba(0,245,255,.32);border-radius:.3rem}.ccap-assistant-md[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:sticky;top:0}.ccap-assistant-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background:#00f5ff24;font-weight:600;color:#00f5ffeb;border-bottom:1px solid rgba(0,245,255,.22);border-right:1px solid rgba(0,245,255,.12);padding:.45rem .7rem;text-align:left;vertical-align:top;white-space:nowrap}.ccap-assistant-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child{border-right:none}.ccap-assistant-md[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:1px solid rgba(255,255,255,.16);border-right:1px solid rgba(255,255,255,.12);padding:.4rem .7rem;text-align:left;vertical-align:top}.ccap-assistant-md[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:last-child{border-right:none}.ccap-assistant-md[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.ccap-assistant-md[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n){background:#ffffff08}.ccap-assistant-md[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:#00f5ff0e}.ccap-assistant-md[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:.55rem 0;padding:.6rem .75rem;border-radius:.3rem;background:#00000080;border:1px solid rgba(255,255,255,.08);overflow-x:auto;font-size:.88em}.ccap-assistant-md[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.9em}.ccap-assistant-md[_ngcontent-%COMP%] p[_ngcontent-%COMP%] code[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] li[_ngcontent-%COMP%] code[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] td[_ngcontent-%COMP%] code[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{padding:.1rem .28rem;border-radius:.2rem;background:#00f5ff12;color:#00f5ffeb;border:1px solid rgba(0,245,255,.12)}.ccap-assistant-md[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:transparent;color:inherit;border:none;padding:0;font-size:inherit}.ccap-assistant-md[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#38bdf8;text-decoration:underline;text-underline-offset:2px}.ccap-assistant-md[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:#7dd3fc}
1
+ import{a as re,b as Ae,c as Vt,d as Rt}from"./chunk-Y7SGEIKU.js";import{a as le,b as de,c as Ot,d as Oe}from"./chunk-75JAPRHN.js";import"./chunk-EGRHWZRV.js";import{a as Pe}from"./chunk-JOZRJDUL.js";import{a as Me}from"./chunk-XTZHZCG6.js";import{a as he}from"./chunk-Q2PKIGLB.js";import{a as vt}from"./chunk-VKPL624D.js";import{a as W}from"./chunk-4UYB7JRE.js";import{a as Ne}from"./chunk-YRVQSWSZ.js";import{a as St}from"./chunk-GY6WIUX3.js";import{a as bt,b as $e}from"./chunk-P3SPNTAX.js";import"./chunk-55AT264I.js";import"./chunk-E37ERYLL.js";import"./chunk-L44637OO.js";import"./chunk-ZHR6XIVW.js";import"./chunk-UFBTR2BG.js";import{a as Ie}from"./chunk-VC2QRVQ7.js";import"./chunk-FSXAP2E7.js";import"./chunk-N7OOE7E4.js";import"./chunk-MK2MQJSP.js";import{e as Mt,f as Pt,g as At}from"./chunk-T4WDZXQN.js";import"./chunk-7BOFUMRF.js";import{a as It}from"./chunk-7JUIBZEE.js";import{a as Tt,b as kt,c as $t}from"./chunk-C7XPBJTG.js";import{a as Et,b as U,c as He,e as Dt}from"./chunk-FL7JMWSB.js";import"./chunk-WPHEQXWB.js";import{a as wt,c as yt}from"./chunk-TJCH3S3T.js";import{b as Ee,c as De}from"./chunk-MNOT53BD.js";import"./chunk-IEV7F6EL.js";import"./chunk-QLZ5AUCW.js";import"./chunk-Q2NVIOCY.js";import{a as ae}from"./chunk-XOGAYT52.js";import"./chunk-FE4E3JH3.js";import"./chunk-NZEXOFOI.js";import"./chunk-GBVC2CL6.js";import"./chunk-V3VQWJQL.js";import"./chunk-D4HXGAOA.js";import"./chunk-I5U3HPJG.js";import"./chunk-ZBTWQZNB.js";import{a as Y}from"./chunk-FLAJXIYW.js";import{c as _t,f as mt,i as ut,n as Ct,o as ft,p as xt,v as ht}from"./chunk-EO4DNTT4.js";import"./chunk-R2BS7UGU.js";import{a as O}from"./chunk-5UPNU54P.js";import{j as gt}from"./chunk-FUTFIQDJ.js";import{p as lt}from"./chunk-I2SFULUF.js";import{$a as F,Aa as ue,Ba as Ce,C as $,Cb as ke,D as z,E as Xe,Ea as fe,Eb as dt,Fa as d,Fb as ct,G as ie,Ga as y,Gb as se,Ha as E,Ia as J,J as u,K as C,Kb as pt,L as M,M as L,N as Ye,Pa as xe,Qa as tt,Ra as we,T as be,Ta as ye,U as Q,Va as We,W as G,Xa as nt,Z as a,_ as Ze,a as je,aa as b,ab as j,b as ze,bb as it,ca as et,da as g,db as ot,fa as pe,ga as v,h as Qe,ha as ve,hb as P,ia as _e,ib as st,ja as R,jb as Te,k as V,la as _,mb as X,oa as N,ob as at,pa as H,pb as rt,qa as o,ra as s,sa as S,ta as Be,ua as T,ub as oe,va as x,wa as c,y as Ge,z as Je,za as me}from"./chunk-TBMJSIBB.js";function on(t,r){t&1&&(o(0,"div",3),M(),o(1,"svg",5),S(2,"path",6),s(),L(),o(3,"span",7),d(4,"Plan accepted"),s()())}function sn(t,r){if(t&1){let e=T();o(0,"button",8),x("click",function(){u(e);let n=c(2);return C(n.handleAccept())}),M(),o(1,"svg",9),S(2,"path",6),s(),d(3," Accept plan "),s()}}function an(t,r){if(t&1&&(o(0,"div",0),S(1,"div",1),o(2,"div",2),g(3,on,5,0,"div",3)(4,sn,4,0,"button",4),s()()),t&2){let e=c();a(),v("innerHTML",r,G),a(2),_(e.isAccepted_$()?3:4)}}var Ve=(()=>{class t{sanitizer=$(ke);rawData=Q(void 0);accepted=be();isAccepted_$=b(!1);planText_$=P(()=>{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_$=P(()=>{let e=this.planText_$();if(!e)return null;let i=Et.toSanitizedHtml(e);return this.sanitizer.bypassSecurityTrustHtml(i)});handleAccept(){this.isAccepted_$()||(this.isAccepted_$.set(!0),this.accepted.emit())}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=z({type:t,selectors:[["app-s-agent-tool-plan-view"]],hostAttrs:[1,"block"],inputs:{rawData:[1,"rawData"]},outputs:{accepted:"accepted"},standalone:!0,features:[ye],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,"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&&g(0,an,5,2,"div",0),i&2){let l;_((l=n.planHtml_$())?0:-1,l)}},dependencies:[oe],styles:[`@charset "UTF-8";.ccap-assistant-md[_ngcontent-%COMP%]{font-size:inherit;line-height:1.55;text-align:left;color:#ffffffeb}.ccap-assistant-md[_ngcontent-%COMP%] [_ngcontent-%COMP%]:first-child{margin-top:0}.ccap-assistant-md[_ngcontent-%COMP%] [_ngcontent-%COMP%]:last-child{margin-bottom:0}.ccap-assistant-md[_ngcontent-%COMP%] h1[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] h3[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-weight:600;color:#fffffff7;letter-spacing:.01em}.ccap-assistant-md[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:1.2em;margin-top:1.5rem;margin-bottom:.6rem;padding-bottom:.45rem;border-bottom:1px solid rgba(0,245,255,.28)}.ccap-assistant-md[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:1.1em;margin-top:1.35rem;margin-bottom:.55rem;padding-bottom:.35rem;border-bottom:1px solid rgba(0,245,255,.16)}.ccap-assistant-md[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:1.02em;margin-top:1.15rem;margin-bottom:.45rem;color:#00f5ffe0}.ccap-assistant-md[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{font-size:.95em;margin-top:.95rem;margin-bottom:.35rem;color:#ffffffc7}.ccap-assistant-md[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:.5rem 0}.ccap-assistant-md[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{font-weight:650;color:#fffffffa}.ccap-assistant-md[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{font-style:italic;color:#ffffffd9}.ccap-assistant-md[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:.6rem 0;padding-left:1.5rem;list-style-type:disc}.ccap-assistant-md[_ngcontent-%COMP%] ol[_ngcontent-%COMP%]{margin:.6rem 0;padding-left:1.5rem;list-style-type:decimal}.ccap-assistant-md[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin:.15rem 0;line-height:1.5}.ccap-assistant-md[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] ol[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style-type:circle}.ccap-assistant-md[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] ul[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] ol[_ngcontent-%COMP%] ol[_ngcontent-%COMP%] ol[_ngcontent-%COMP%]{list-style-type:square}.ccap-assistant-md[_ngcontent-%COMP%] li[_ngcontent-%COMP%] + li[_ngcontent-%COMP%]{margin-top:.25rem}.ccap-assistant-md[_ngcontent-%COMP%] li[_ngcontent-%COMP%] > ul[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] li[_ngcontent-%COMP%] > ol[_ngcontent-%COMP%]{margin-top:.15rem;margin-bottom:.1rem}.ccap-assistant-md[_ngcontent-%COMP%] hr[_ngcontent-%COMP%]{border:0;height:1px;background:linear-gradient(90deg,transparent 0%,rgba(0,245,255,.38) 12%,rgba(0,245,255,.38) 88%,transparent 100%);margin:2.2rem 0}.ccap-assistant-md[_ngcontent-%COMP%] blockquote[_ngcontent-%COMP%]{margin:.75rem 0;padding:.45rem .85rem;border-left:3px solid rgba(0,245,255,.4);background:#00f5ff0a;border-radius:0 .25rem .25rem 0;color:#ffffffd9}.ccap-assistant-md[_ngcontent-%COMP%] blockquote[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:.2rem 0}.ccap-assistant-md[_ngcontent-%COMP%] table[_ngcontent-%COMP%]{width:100%;border-collapse:separate;border-spacing:0;margin:1rem 0;font-size:.9em;display:block;overflow-x:auto;border:1px solid rgba(0,245,255,.32);border-radius:.3rem}.ccap-assistant-md[_ngcontent-%COMP%] thead[_ngcontent-%COMP%]{position:sticky;top:0}.ccap-assistant-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background:#00f5ff24;font-weight:600;color:#00f5ffeb;border-bottom:1px solid rgba(0,245,255,.22);border-right:1px solid rgba(0,245,255,.12);padding:.45rem .7rem;text-align:left;vertical-align:top;white-space:nowrap}.ccap-assistant-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child{border-right:none}.ccap-assistant-md[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{border-bottom:1px solid rgba(255,255,255,.16);border-right:1px solid rgba(255,255,255,.12);padding:.4rem .7rem;text-align:left;vertical-align:top}.ccap-assistant-md[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:last-child{border-right:none}.ccap-assistant-md[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.ccap-assistant-md[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n){background:#ffffff08}.ccap-assistant-md[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background:#00f5ff0e}.ccap-assistant-md[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:.55rem 0;padding:.6rem .75rem;border-radius:.3rem;background:#00000080;border:1px solid rgba(255,255,255,.08);overflow-x:auto;font-size:.88em}.ccap-assistant-md[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:.9em}.ccap-assistant-md[_ngcontent-%COMP%] p[_ngcontent-%COMP%] code[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] li[_ngcontent-%COMP%] code[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] td[_ngcontent-%COMP%] code[_ngcontent-%COMP%], .ccap-assistant-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{padding:.1rem .28rem;border-radius:.2rem;background:#00f5ff12;color:#00f5ffeb;border:1px solid rgba(0,245,255,.12)}.ccap-assistant-md[_ngcontent-%COMP%] pre[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{background:transparent;color:inherit;border:none;padding:0;font-size:inherit}.ccap-assistant-md[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#38bdf8;text-decoration:underline;text-underline-offset:2px}.ccap-assistant-md[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{color:#7dd3fc}
2
2
  /*# sourceMappingURL=s-agent-tool-plan-view.component-PVG3EXHY.css.map */`]})}return t})();var ln=(t,r)=>r.content,dn=(t,r,e)=>({"text-neutral-500 line-through":t,"text-blue-300":r,"text-neutral-300":e});function cn(t,r){t&1&&(M(),o(0,"svg",5),S(1,"path",10),s())}function pn(t,r){t&1&&(o(0,"span",6),S(1,"span",11),s())}function _n(t,r){t&1&&(o(0,"span",6),S(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(),y(e.activeForm)}}function un(t,r){if(t&1&&(o(0,"div",4),g(1,cn,2,0,":svg:svg",5)(2,pn,2,0,"span",6)(3,_n,2,0,"span",6),o(4,"div",7)(5,"span",8),d(6),s(),g(7,mn,2,1,"div",9),s()()),t&2){let e,i=r.$implicit;a(),_((e=i.status)==="completed"?1:e==="in_progress"?2:3),a(4),v("ngClass",nt(4,dn,i.status==="completed",i.status==="in_progress",i.status!=="completed"&&i.status!=="in_progress")),a(),y(i.content),a(),_(i.status==="in_progress"&&i.activeForm?7:-1)}}function Cn(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,un,8,8,"div",4,ln),s()),t&2){let e=c();a(5),J("",e.completedCount_$(),"/",e.totalCount_$(),""),a(),H(e.todos_$())}}var Le=(()=>{class t{rawData=Q(void 0);todos_$=P(()=>{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_$=P(()=>this.todos_$().filter(e=>e.status==="completed").length);totalCount_$=P(()=>this.todos_$().length);static \u0275fac=function(i){return new(i||t)};static \u0275cmp=z({type:t,selectors:[["app-s-agent-tool-todo-list"]],hostAttrs:[1,"block"],inputs:{rawData:[1,"rawData"]},standalone:!0,features:[ye],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&&g(0,Cn,8,2,"div",0),i&2&&_(n.todos_$().length?0:-1)},dependencies:[oe,X],encapsulation:2})}return t})();var A="ccap-ccSession",k=class{static saveProjectFilter(r){O.writeString(`${A}:projectFilter`,r)}static loadProjectFilter(){return O.readString(`${A}:projectFilter`)??""}static saveLastWorkspacePath(r){O.writeString(`${A}:lastWorkspacePath`,r)}static loadLastWorkspacePath(){return O.readString(`${A}:lastWorkspacePath`)??""}static saveLastLabel(r){O.writeString(`${A}:lastLabel`,r)}static loadLastLabel(){return O.readString(`${A}:lastLabel`)??""}static savePromptDraft(r,e){Oe.saveDraft(A,r,e)}static loadPromptDraft(r){return Oe.loadDraft(A,r)}static clearPromptDraft(r){Oe.clearDraft(A,r)}static savePanelOpen(r,e){O.writeBoolean(`${A}:panelOpen:${r}`,e)}static loadPanelOpen(r,e){return O.readBoolean(`${A}:panelOpen:${r}`,e)}static savePanelWidth(r,e){O.writeNumber(`${A}:panelWidth:${r}`,e)}static loadPanelWidth(r,e){return O.readNumber(`${A}:panelWidth:${r}`,e)}static saveSessionMode(r){O.writeString(`${A}:sessionMode`,r)}static loadSessionMode(){return O.readString(`${A}:sessionMode`)??"normal"}static saveSessionEffort(r){O.writeString(`${A}:sessionEffort`,r)}static loadSessionEffort(){return O.readString(`${A}:sessionEffort`)??"high"}static saveSessionModel(r){O.writeString(`${A}:sessionModel`,r)}static loadSessionModel(){return O.readString(`${A}:sessionModel`)??"sonnet"}static saveStatusHistory(r){O.writeBoolean(`${A}:statusHistory`,r)}static loadStatusHistory(){return O.readBoolean(`${A}:statusHistory`,!1)}static saveLastSessionId(r){O.writeString(`${A}:lastSessionId`,r)}static loadLastSessionId(){return O.readString(`${A}:lastSessionId`)??""}static saveShowStatusUpdates(r){O.writeBoolean(`${A}:showStatusUpdates`,r)}static loadShowStatusUpdates(){return O.readBoolean(`${A}:showStatusUpdates`,!0)}static saveShowArchived(r){O.writeBoolean(`${A}:showArchived`,r)}static loadShowArchived(){return O.readBoolean(`${A}:showArchived`,!1)}};var K=(()=>{class t{ccSession_DS=$(W);isTimelinePanelOpen_$=b(k.loadPanelOpen("timeline",!1));isMetadataPanelOpen_$=b(k.loadPanelOpen("metadata",!1));isResuming_$=b(!1);isTerminating_$=b(!1);isStopping_$=b(!1);isForking_$=b(!1);isShowSessionStatus_$=b(k.loadStatusHistory());isShowAgentUpdates_$=b(k.loadShowStatusUpdates());handleToggleTimeline(){let e=!this.isTimelinePanelOpen_$();this.isTimelinePanelOpen_$.set(e),k.savePanelOpen("timeline",e)}handleToggleMetadata(){let e=!this.isMetadataPanelOpen_$();this.isMetadataPanelOpen_$.set(e),k.savePanelOpen("metadata",e)}handleToggleSessionStatus(){let e=!this.isShowSessionStatus_$();this.isShowSessionStatus_$.set(e),k.saveStatusHistory(e)}handleToggleAgentUpdates(){let e=!this.isShowAgentUpdates_$();this.isShowAgentUpdates_$.set(e),k.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)}}})}static \u0275fac=function(i){return new(i||t)};static \u0275prov=Ge({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var gn=(t,r)=>r._id,Sn=(t,r)=>r.path;function bn(t,r){if(t&1&&(o(0,"option",26),d(1),s()),t&2){let e=c().$implicit;v("value",e.localPath),a(),y(e.name)}}function vn(t,r){if(t&1&&g(0,bn,2,2,"option",26),t&2){let e=r.$implicit;_(e.localPath?0:-1)}}function wn(t,r){t&1&&(o(0,"div",12),d(1,"Loading sessions..."),s())}function yn(t,r){t&1&&(o(0,"div",13),d(1,"Failed to load sessions"),s())}function Tn(t,r){if(t&1){let e=T();o(0,"app-s-session-select",27),x("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();v("rows",e.sessionRowViews_$())("activeId",e.ccSession_DS.activeSessionId_$())("hideSearch",!0)}}function kn(t,r){t&1&&(o(0,"div",12),d(1,"No sessions found"),s())}function In(t,r){if(t&1&&(o(0,"option",26),d(1),s()),t&2){let e=r.$implicit;v("value",e.path),a(),J("",e.label," \u2014 ",e.path,"")}}function $n(t,r){if(t&1){let e=T();o(0,"select",28),x("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,In,2,3,"option",26,Sn),o(5,"option",30),d(6,"Custom path..."),s()()}if(t&2){let e=c();v("ngModel",e.selectedPathOption_$()),a(3),H(e.newAgentSessionWorkspace_DS.workspacePathPickerOptions_$())}}function En(t,r){if(t&1){let e=T();o(0,"div",33)(1,"input",34,0),x("input",function(){u(e);let n=fe(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(),v("value",e.renameValue_$())}}function Dn(t,r){if(t&1){let e=T();o(0,"button",35),x("click",function(){u(e);let n=c(3);return C(n.handleCtxResume())}),d(1," Resume "),s()}}function Mn(t,r){if(t&1){let e=T();S(0,"div",37),o(1,"button",38),x("click",function(){u(e);let n=c(3);return C(n.handleCtxTerminate())}),d(2," Terminate "),s()}}function Pn(t,r){if(t&1){let e=T();o(0,"button",35),x("click",function(){u(e);let n=c(2);return C(n.handleCtxRenameStart())}),d(1," Rename "),s(),o(2,"button",35),x("click",function(){u(e);let n=c(2);return C(n.handleCtxToggleArchive())}),d(3),s(),g(4,Dn,2,0,"button",36)(5,Mn,3,0)}if(t&2){let e=c();a(3),E(" ",e.isArchived?"Unarchive":"Archive"," "),a(),_(e.status==="completed"||e.status==="errored"?4:-1),a(),_(e.status==="running"||e.status==="starting"||e.status==="waiting-input"?5:-1)}}function An(t,r){if(t&1){let e=T();o(0,"div",31),x("click",function(){u(e);let n=c();return C(n.handleCloseCtxMenu())}),s(),o(1,"div",32),g(2,En,3,1,"div",33)(3,Pn,6,3),s()}if(t&2){let e=c();a(),ve("left",e.ctxMenuPos_$().x,"px")("top",e.ctxMenuPos_$().y,"px"),a(),_(e.isRenaming_$()?2:3)}}var Ft=(()=>{class t{ccSession_DS=$(W);newAgentSessionWorkspace_DS=$(vt);pm_DS=$(wt);peiContext_DS=$(Ie);scheduledJobs_DS=$(Me);coordinator_DS=$(Pe);router=$(se);instanceChangeEffect=Te(()=>{let e=this.peiContext_DS.activeCcapId_$(),i=this.showArchived_$();e&&st(()=>{this.ccSession_DS.loadSessions({includeArchived:i||void 0})})});projectFilter_$=b("");filteredSessions_$=P(()=>{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_$=P(()=>{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:Ne.resolve(n.status),workspacePath:n.workspacePath,isArchived:!!n.isArchived,lastActivityAt:n.lastActivityAt,promptCount:n.promptCount,isRunning:Ne.isRunning(n.status),hasSchedule:e.has(n.sessionId),hasCoordinator:i.has(n.sessionId)}))});isCreateDialogOpen_$=b(!1);schedulePopupSessionId_$=b(null);coordinatorPopupSessionId_$=b(null);newSessionWorkspacePath_$=b("");newSessionLabel_$=b("");isCreating_$=b(!1);showArchived_$=b(!1);selectedPathOption_$=b("");sessionSelected=be();ctxMenuSession_$=b(null);ctxMenuPos_$=b({x:0,y:0});isRenaming_$=b(!1);renameValue_$=b("");ngOnInit(){let e=k.loadProjectFilter();e&&this.projectFilter_$.set(e);let i=k.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){this.router.navigate(["/cc-session",e]),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:k.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=k.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{k.saveLastWorkspacePath(e),k.saveLastLabel(this.newSessionLabel_$());let i=k.loadSessionMode(),n=k.loadSessionEffort(),l=yield this.ccSession_DS.createSession({workspacePath:e,label:this.newSessionLabel_$()||void 0,mode:i||void 0,reasoningEffort:n||void 0});this.handleCloseCreateDialog(),l&&this.router.navigate(["/cc-session",l])}catch{this.handleCloseCreateDialog()}finally{this.isCreating_$.set(!1)}}})}handleProjectFilterChange(e){this.projectFilter_$.set(e),k.saveProjectFilter(e)}handleToggleShowArchived(){let e=!this.showArchived_$();this.showArchived_$.set(e),k.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("")}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=z({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"],[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),S(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),x("click",function(){return n.handleRefresh()}),d(7," Refresh "),s(),o(8,"button",6),x("click",function(){return n.handleOpenCreateDialog()}),d(9," + New "),s()()(),o(10,"div",7)(11,"select",8),x("ngModelChange",function(p){return n.handleProjectFilterChange(p)}),o(12,"option",9),d(13,"All projects"),s(),N(14,vn,1,1,null,null,gn),s(),o(16,"button",10),x("click",function(){return n.handleToggleShowArchived()}),d(17),s()(),o(18,"div",11),g(19,wn,2,0,"div",12)(20,yn,2,0,"div",13)(21,Tn,1,3,"app-s-session-select",14)(22,kn,2,0,"div",12),s(),o(23,"app-s-modal",15),x("closed",function(){return n.isCreateDialogOpen_$.set(!1)}),o(24,"div",16)(25,"label",17),d(26,"Workspace Path *"),s(),g(27,$n,7,1,"select",18),o(28,"input",19),x("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),x("ngModelChange",function(p){return n.newSessionLabel_$.set(p)}),s()(),o(33,"div",22)(34,"button",23),x("click",function(){return n.handleCloseCreateDialog()}),d(35," Cancel "),s(),o(36,"button",24),x("click",function(){return n.handleCreateSession()}),d(37),s()()(),o(38,"app-sch-schedule-popup",25),x("closed",function(){return n.handleCloseSchedulePopup()}),s(),o(39,"app-crd-info-popup",25),x("closed",function(){return n.handleCloseCoordinatorPopup()}),s(),g(40,An,4,5)),i&2){let l;a(11),v("ngModel",n.projectFilter_$()),a(3),H(n.pm_DS.projects_$()),a(2),R(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"),v("title",n.showArchived_$()?"Hide archived sessions":"Show archived sessions"),a(),E(" ",n.showArchived_$()?"Archived ON":"Archived"," "),a(2),_(n.ccSession_DS.sessionsLoading_$()?19:-1),a(),_(n.ccSession_DS.sessionsLoadError_$()?20:-1),a(),_(n.sessionRowViews_$().length?21:-1),a(),_(!n.ccSession_DS.sessionsLoading_$()&&!n.sessionRowViews_$().length?22:-1),a(),v("isOpen",n.isCreateDialogOpen_$())("title","New CC Session")("maxWidth","sm")("closeOnBackdropClick",!1),a(4),_(n.newAgentSessionWorkspace_DS.workspacePathPickerOptions_$().length?27:-1),a(),v("ngModel",n.newSessionWorkspacePath_$()),a(4),v("ngModel",n.newSessionLabel_$()),a(2),v("disabled",n.isCreating_$()),a(2),v("disabled",n.isCreating_$()||!n.newSessionWorkspacePath_$()),a(),E(" ",n.isCreating_$()?"Creating...":"Create"," "),a(),v("sessionId",n.schedulePopupSessionId_$())("isOpen",n.schedulePopupSessionId_$()!==null),a(),v("sessionId",n.coordinatorPopupSessionId_$())("isOpen",n.coordinatorPopupSessionId_$()!==null),a(),_((l=n.ctxMenuSession_$())?40:-1,l)}},dependencies:[ft,xt,_t,Ct,mt,ut,Ae,Y,le,de,yt],encapsulation:2})}return t})();var Fe=(()=>{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=ie({name:"ccSessionStatusColor",type:t,pure:!0})}return t})();function Rn(t,r){t&1&&S(0,"div",5)}function Ln(t,r){if(t&1){let e=T();o(0,"button",14),x("click",function(){u(e);let n=c();return C(n.detailUi_DS.handleToggleMetadata())}),d(1," Info "),s()}if(t&2){let e=c();R(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 Fn(t,r){t&1&&S(0,"span",18)}function Un(t,r){if(t&1&&(S(0,"span",17),F(1,"ccSessionStatusColor"),g(2,Fn,1,0,"span",18)),t&2){c(2);let e=we(1);v("ngClass",j(1,3,e.detail.session.status))("title",e.detail.session.status),a(2),_(e.detail.runtime.isLive?2:-1)}}function jn(t,r){t&1&&(o(0,"span",16),d(1,"Loading\u2026"),s())}function zn(t,r){if(t&1&&(o(0,"span",15),d(1),s(),g(2,Un,3,5)(3,jn,2,0,"span",16)),t&2){c();let e=we(1);v("title",e.title),a(),E(" ",e.title," "),a(),_(e.detail?2:-1),a(),_(e.isLoading&&!e.showActions?3:-1)}}function Bn(t,r){if(t&1){let e=T();o(0,"button",23),x("click",function(){u(e);let n=c(2);return C(n.detailUi_DS.handleStopExecution())}),d(1),s()}if(t&2){let e=c(2);v("disabled",e.detailUi_DS.isStopping_$()),a(),E(" ",e.detailUi_DS.isStopping_$()?"Stopping\u2026":"Stop"," ")}}function Wn(t,r){if(t&1){let e=T();xe(0),o(1,"div",9)(2,"button",19),x("click",function(){u(e);let n=c();return C(n.detailUi_DS.handleToggleTimeline())}),d(3," Timeline "),s(),o(4,"button",20),x("click",function(){u(e);let n=c();return C(n.handleForkSession())}),d(5),s(),S(6,"span",21),g(7,Bn,2,2,"button",22),s()}if(t&2){let e=c(),n=we(1).detail;a(2),R(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),v("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(" ",e.detailUi_DS.isForking_$()?"Forking\u2026":"Fork"," "),a(2),_(n.session.status==="running"?7:-1)}}var Wt=(()=>{class t{router=$(se);ccSession_DS=$(W);detailUi_DS=$(K);sidebarWidth_$=b(320);isSidebarOpen_$=b(!0);isResizing_$=b(!1);ccTopBarContext_$=P(()=>{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),m=n?.session.sessionId===e;return{title:(m?n.session.label||n.session.sessionId:null)??(p?p.label||p.sessionId:e),detail:m?n:null,showActions:m&&!i,isLoading:i}});ngOnInit(){let e=k.loadPanelWidth("sidebar",320);this.sidebarWidth_$.set(Math.max(200,Math.min(600,e))),this.isSidebarOpen_$.set(k.loadPanelOpen("sidebar",!0))}handleSidebarResizeStart(e){let i=e.clientX,n=this.sidebarWidth_$();this.isResizing_$.set(!0),he.attachUntilPointerUp({startEvent:e,onMove:l=>{let p=l.clientX-i,m=Math.max(200,Math.min(600,n+p));this.sidebarWidth_$.set(m)},onEnd:()=>{this.isResizing_$.set(!1),k.savePanelWidth("sidebar",this.sidebarWidth_$())}})}handleToggleSidebar(){this.isSidebarOpen_$.update(e=>!e),k.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();e&&(yield this.router.navigate(["/cc-session",e]))})}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=z({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=T();o(0,"div",0),xe(1),o(2,"app-s-session-shell-toolbar")(3,"div",1)(4,"button",2),x("click",function(){return u(l),C(n.handleToggleSidebar())}),M(),o(5,"svg",3),S(6,"polyline",4),s(),d(7," Sessions "),s(),g(8,Rn,1,0,"div",5)(9,Ln,2,2,"button",6),s(),L(),o(10,"div",7),g(11,zn,4,4),s(),o(12,"div",8),g(13,Wn,8,6,"div",9),s()(),o(14,"app-s-resizable-session-shell-layout",10),x("sidebarResizeStart",function(m){return u(l),C(n.handleSidebarResizeStart(m))}),o(15,"div",11)(16,"app-ccap-cc-dashboard",12),x("sessionSelected",function(){return u(l),C(n.handleSessionSelectedFromDashboard())}),s()(),o(17,"div",13),S(18,"router-outlet"),s()()()}if(i&2){_e("select-none",n.isResizing_$()),a();let l=tt(n.ccTopBarContext_$());a(4),_e("rotate-90",n.isSidebarOpen_$())("-rotate-90",!n.isSidebarOpen_$()),a(3),_(l?8:-1),a(),_(l&&l.showActions&&l.detail?9:-1),a(2),_(l?11:-1),a(2),_(l&&l.showActions&&l.detail?13:-1),a(),v("isSidebarOpen",n.isSidebarOpen_$())("sidebarWidthPx",n.sidebarWidth_$())("isResizing",n.isResizing_$())}},dependencies:[X,ct,Tt,kt,Ft,Fe],encapsulation:2})}return t})();var te=Qe(lt());var ge=function(t){return t.normal="normal",t.plan="plan",t}(ge||{});var ce=function(t){return t.sonnet="sonnet",t.opus="opus",t.haiku="haiku",t}(ce||{});var Se=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 U.userPrompt;case"assistant":return U.assistant;case"tool":return U.tool;case"tool-result":return U.toolResult;case"error":return U.error;case"info":return U.info;case"status":return U.status;case"result":return U.result;case"run-intent":return U.runIntent;case"iteration":return U.iteration;case"thinking":return U.thinking;case"status-update":return U.statusUpdate;case"raw":return U.raw;case"tool-group":return U.toolGroup;case"sub-agent-group":return U.subAgentGroup;default:return U.info}}};var Ue=(()=>{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)(Ze(ke,16))};static \u0275pipe=ie({name:"ccSessionJsonFormat",type:t,pure:!0})}return t})();var Nn=["chatScroll"],Hn=["sessionInput"],qn=(t,r)=>r.promptListKey,qe=(t,r)=>r.listKey,Kn=(t,r)=>r.trackKey,Ht=t=>({$implicit:t});function Qn(t,r){if(t&1){let e=T();o(0,"div",13),x("click",function(){u(e);let n=c();return C(n.handleStickyPromptClick())}),o(1,"div",14)(2,"span",15),d(3,"YOU"),s(),o(4,"span",16),d(5),s(),M(),o(6,"svg",17),S(7,"path",18),s()()()}if(t&2){let e=c();a(5),y(e.lastPromptText_$())}}function Gn(t,r){if(t&1){let e=T();o(0,"button",33),x("click",function(){u(e);let n=c(3).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",34),d(2,"i"),s()()}}function Jn(t,r){if(t&1){let e=T();o(0,"app-s-agent-tool-plan-view",35),x("accepted",function(){u(e);let n=c(4);return C(n.handlePlanAccepted())}),s()}if(t&2){let e=c(3).$implicit;v("rawData",e.rawData)}}function Xn(t,r){if(t&1&&S(0,"app-s-agent-tool-todo-list",32),t&2){let e=c(3).$implicit;v("rawData",e.rawData)}}function Yn(t,r){if(t&1&&(o(0,"div",28),S(1,"span",29),F(2,"sAgentToolIcon"),o(3,"span",30),d(4),s(),g(5,Gn,3,0,"button",31),s(),g(6,Jn,1,1,"app-s-agent-tool-plan-view",32)(7,Xn,1,1,"app-s-agent-tool-todo-list",32)),t&2){let e,i=c(2).$implicit;a(),v("innerHTML",j(2,4,(e=i.toolName)!==null&&e!==void 0?e:""),G),a(3),y(i.toolName==="ExitPlanMode"?"Plan":i.toolName),a(),_(i.rawData?5:-1),a(),_(i.toolName==="ExitPlanMode"?6:7)}}function Zn(t,r){if(t&1){let e=T();o(0,"app-s-agent-tool-call-card",36),x("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;v("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 ei(t,r){if(t&1&&(o(0,"div",19)(1,"div",26),g(2,Yn,8,6)(3,Zn,1,7,"app-s-agent-tool-call-card",27),s()()),t&2){let e=c().$implicit;a(2),_(e.toolName==="TodoWrite"||e.toolName==="ExitPlanMode"?2:3)}}function ti(t,r){if(t&1){let e=T();o(0,"app-s-agent-tool-call-card",44),x("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;v("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 ni(t,r){if(t&1&&(o(0,"div",43)(1,"span",45),d(2),s()()),t&2){let e=c().$implicit;a(2),y(e.text)}}function ii(t,r){if(t&1&&g(0,ti,1,7,"app-s-agent-tool-call-card",42)(1,ni,3,1,"div",43),t&2){let e=r.$implicit;_(e.messageType==="tool"?0:-1),a(),_(e.messageType==="tool-result"?1:-1)}}function oi(t,r){if(t&1&&(o(0,"div",19)(1,"details",37)(2,"summary",38),S(3,"span",29),F(4,"sAgentToolIcon"),o(5,"span",30),d(6),s(),M(),o(7,"svg",39),S(8,"path",40),s()(),L(),o(9,"div",41),N(10,ii,2,2,null,null,qe),s()()()),t&2){let e=c().$implicit;a(3),v("innerHTML",j(4,2,e.groupToolName),G),a(3),y(e.text),a(4),H(e.groupItems)}}function si(t,r){t&1&&(o(0,"span",57),S(1,"span",62),o(2,"span",63),d(3,"running"),s()())}function ai(t,r){if(t&1){let e=T();o(0,"button",64),x("click",function(n){u(e);let l=c(2).$implicit;return c().handleOpenInfoPopup(l.groupItems[0]),C(n.stopPropagation())}),o(1,"span",65),d(2,"i"),s()()}}function ri(t,r){if(t&1){let e=T();o(0,"details",66),x("click",function(n){return u(e),C(n.stopPropagation())}),o(1,"summary",67),M(),o(2,"svg",68),S(3,"path",40),s(),L(),o(4,"span",69),d(5),s()(),o(6,"div",70)(7,"pre",71),d(8),s()()()}if(t&2){let e=c(2).$implicit;a(5),y(e.groupItems[0].pairedResult.text),a(3),y(e.groupItems[0].pairedResult.expandableContent||e.groupItems[0].pairedResult.text)}}function li(t,r){if(t&1&&Be(0,72),t&2){let e=c().$implicit;c(3);let i=fe(2);v("ngTemplateOutlet",i)("ngTemplateOutletContext",We(2,Ht,e))}}function di(t,r){if(t&1&&g(0,li,1,4,"ng-container",72),t&2){let e=r.$index;_(e>0?0:-1)}}function ci(t,r){if(t&1&&(o(0,"div",20)(1,"details",46)(2,"summary",47),M(),o(3,"svg",48),S(4,"rect",49)(5,"circle",50)(6,"circle",51)(7,"path",52)(8,"path",53),s(),L(),o(9,"span",54),d(10,"Sub-agent"),s(),o(11,"span",55),d(12),s(),o(13,"span",56),d(14),s(),g(15,si,4,0,"span",57)(16,ai,3,0,"button",58),M(),o(17,"svg",59),S(18,"path",40),s()(),g(19,ri,9,2,"details",60),L(),o(20,"div",61),N(21,di,1,1,null,null,qe),s()()()),t&2){let e,i=c().$implicit;a(12),y(i.text),a(2),y(((e=i.groupItems==null?null:i.groupItems.length)!==null&&e!==void 0?e:0)>1?i.groupItems.length-1:0),a(),_(!(i.groupItems==null||i.groupItems[0]==null)&&i.groupItems[0].pairedResult?-1:15),a(),_(!(i.groupItems==null||i.groupItems[0]==null)&&i.groupItems[0].rawData?16:-1),a(3),_(!(i.groupItems==null||i.groupItems[0]==null)&&i.groupItems[0].pairedResult?19:-1),a(2),H(i.groupItems)}}function pi(t,r){if(t&1){let e=T();o(0,"button",77),x("click",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",78),d(2,"i"),s()()}}function _i(t,r){if(t&1&&(o(0,"div",21)(1,"div",73),S(2,"span",74),o(3,"span",75),d(4),s(),g(5,pi,3,0,"button",76),s()()),t&2){let e=c().$implicit;a(4),y(e.text),a(),_(e.rawData?5:-1)}}function mi(t,r){t&1&&(o(0,"span",82),d(1,"Run intent: "),s())}function ui(t,r){if(t&1&&(o(0,"div",22)(1,"div",79),S(2,"span",80),o(3,"span",81),g(4,mi,2,0,"span",82),d(5),s()()()),t&2){let e=c().$implicit;a(4),_(e.isLatestMessage?-1:4),a(),E(" ",e.text," ")}}function Ci(t,r){if(t&1&&(o(0,"div",19)(1,"div",83),S(2,"span",84),o(3,"span",85),d(4),s()()()),t&2){let e=c().$implicit;a(4),y(e.text)}}function fi(t,r){if(t&1){let e=T();o(0,"button",97),x("click",function(n){u(e);let l=c(2).$implicit;return c().handleOpenInfoPopup(l),C(n.stopPropagation())}),o(1,"span",98),d(2,"i"),s()()}}function xi(t,r){if(t&1&&(o(0,"div",23)(1,"details",86)(2,"summary",87),M(),o(3,"svg",88),S(4,"circle",89)(5,"path",90)(6,"circle",91),s(),L(),o(7,"span",92),d(8,"Thinking"),s(),o(9,"span",93),d(10),s(),g(11,fi,3,0,"button",94),s(),o(12,"div",95)(13,"pre",96),d(14),s()()()()),t&2){let e=c().$implicit;a(10),y(e.text),a(),_(e.rawData?11:-1),a(3),y(e.text)}}function hi(t,r){if(t&1){let e=T();o(0,"button",103),x("click",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",104),d(2,"i"),s()()}}function gi(t,r){if(t&1&&(o(0,"div",24)(1,"div",99),S(2,"span",100),o(3,"span",101),d(4),s(),g(5,hi,3,0,"button",102),s()()),t&2){let e=c().$implicit;a(4),y(e.text),a(),_(e.rawData?5:-1)}}function Si(t,r){if(t&1&&(o(0,"span",109),d(1),s()),t&2){let e=c(2).$implicit;a(),y(e.subtype)}}function bi(t,r){if(t&1){let e=T();o(0,"button",111),x("click",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",112),d(2,"i"),s()()}}function vi(t,r){if(t&1&&(o(0,"div",25)(1,"div",105),M(),o(2,"svg",106),S(3,"path",107),s(),L(),o(4,"span",108),d(5),s(),g(6,Si,2,1,"span",109)(7,bi,3,0,"button",110),s()()),t&2){let e=c().$implicit;a(5),y(e.text),a(),_(e.subtype?6:-1),a(),_(e.rawData?7:-1)}}function wi(t,r){if(t&1){let e=T();o(0,"button",120),x("click",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",121),d(2,"i"),s()()}}function yi(t,r){if(t&1&&(S(0,"pre",119),F(1,"ccSessionJsonFormat")),t&2){let e=c(2).$implicit;v("innerHTML",j(1,1,e.rawData),G)}}function Ti(t,r){if(t&1&&(o(0,"div",23)(1,"div",113)(2,"div",114),S(3,"span",115),o(4,"span",116),d(5),s(),o(6,"span",117),d(7,"needs brief"),s(),g(8,wi,3,0,"button",118),s(),g(9,yi,2,3,"pre",119),s()()),t&2){let e=c().$implicit;a(5),y(e.text),a(3),_(e.rawData?8:-1),a(),_(e.rawData?9:-1)}}function ki(t,r){if(t&1&&g(0,ei,4,1,"div",19)(1,oi,12,4,"div",19)(2,ci,23,5,"div",20)(3,_i,6,2,"div",21)(4,ui,6,2,"div",22)(5,Ci,5,1,"div",19)(6,xi,15,3,"div",23)(7,gi,6,2,"div",24)(8,vi,8,3,"div",25)(9,Ti,10,3,"div",23),t&2){let e,i=r.$implicit;_((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 Ii(t,r){t&1&&(o(0,"div",6)(1,"div",122),M(),o(2,"svg",123),S(3,"path",107),s(),L(),o(4,"span",124),d(5,"Loading older messages..."),s()()())}function $i(t,r){if(t&1){let e=T();o(0,"div",125)(1,"div",127)(2,"app-s-agent-console-message-bubble",128),x("ttsCached",function(n){u(e);let l=c(2);return C(l.handleTtsCached(n))}),s()()()}if(t&2){let e=c().$implicit;pe("data-prompt-key",e.promptListKey)("data-prompt-text",e.promptText),a(2),v("view",e.promptBubbleView)}}function Ei(t,r){if(t&1){let e=T();o(0,"div",135)(1,"div",136)(2,"app-s-agent-console-message-bubble",128),x("ttsCached",function(n){u(e);let l=c(4);return C(l.handleTtsCached(n))}),s()()()}if(t&2){let e=c().$implicit;_e("justify-end",e.messageType==="prompt"),a(),R(e.messageType==="prompt"?"w-[85%]":e.messageType==="tool"||e.messageType==="tool-result"?"w-[90%] ml-4":"w-[90%]"),a(),v("view",e.bubbleView)}}function Di(t,r){if(t&1&&Be(0,72),t&2){let e=c().$implicit;c(3);let i=fe(2);v("ngTemplateOutlet",i)("ngTemplateOutletContext",We(2,Ht,e))}}function Mi(t,r){if(t&1&&g(0,Ei,3,5,"div",134)(1,Di,1,4,"ng-container",72),t&2){let e=r.$implicit;_(e.bubbleView?0:1)}}function Pi(t,r){if(t&1&&(o(0,"details",126)(1,"summary",129),M(),o(2,"svg",130),S(3,"path",40),s(),L(),o(4,"span",131),d(5),s(),S(6,"div",132),s(),o(7,"div",133),N(8,Mi,2,1,null,null,qe),s()()),t&2){let e=c().$implicit;a(5),E("",e.items.length," events"),a(3),H(e.items)}}function Ai(t,r){if(t&1&&g(0,$i,3,3,"div",125)(1,Pi,10,1,"details",126),t&2){let e=r.$implicit;_(e.promptBubbleView?0:-1),a(),_(e.items.length?1:-1)}}function Oi(t,r){t&1&&(o(0,"div",137)(1,"div",139),S(2,"div",140),s(),o(3,"div",141),S(4,"div",142),s(),o(5,"div",139),S(6,"div",143),s(),o(7,"div",144),M(),o(8,"svg",145),S(9,"path",107),s(),L(),o(10,"span",146),d(11,"Loading chat history\u2026"),s()()())}function Vi(t,r){t&1&&(o(0,"div",138)(1,"span",147),d(2,"\u{1F4AC}"),s(),o(3,"span",148),d(4,"Send a prompt to start the conversation"),s()())}function Ri(t,r){if(t&1&&g(0,Oi,12,0,"div",137)(1,Vi,5,0,"div",138),t&2){let e=c();_(e.ccSession_DS.assembledMessagesLoaded_$()?1:0)}}function Li(t,r){t&1&&(M(),o(0,"svg",152),S(1,"path",153),s(),L(),o(2,"span"),d(3,"Copied!"),s())}function Fi(t,r){t&1&&(M(),o(0,"svg",154),S(1,"path",155),s(),L(),o(2,"span"),d(3,"Copy last 30 events"),s())}function Ui(t,r){t&1&&(M(),o(0,"svg",152),S(1,"path",153),s(),L(),o(2,"span"),d(3,"Copied!"),s())}function ji(t,r){t&1&&(M(),o(0,"svg",154),S(1,"rect",156)(2,"path",157),s(),L(),o(3,"span"),d(4,"Copy JSON"),s())}function zi(t,r){if(t&1&&(o(0,"section")(1,"div",158),d(2,"Primary (message / tool call)"),s(),o(3,"pre",159),d(4),s()()),t&2){let e=c();a(4),y(e.primaryJson)}}function Bi(t,r){if(t&1&&(o(0,"div",160)(1,"div",161),d(2),s(),o(3,"pre",159),d(4),s()()),t&2){let e=r.$implicit,i=c(2);a(2),J(" Part ",e.index+1," / ",i.streamParts.length," "),a(2),y(e.json)}}function Wi(t,r){if(t&1&&(o(0,"section")(1,"div",158),d(2,"Stream mirror payloads (each chunk)"),s(),N(3,Bi,5,3,"div",160,Kn),s()),t&2){let e=c();a(3),H(e.streamParts)}}function Ni(t,r){if(t&1&&(o(0,"section")(1,"div",158),d(2,"Paired tool result"),s(),o(3,"pre",159),d(4),s()()),t&2){let e=c();a(4),y(e.pairedJson)}}function Hi(t,r){if(t&1){let e=T();o(0,"div",149)(1,"button",150),x("click",function(){u(e);let n=c();return C(n.handleCopyLast30Events())}),g(2,Li,4,0)(3,Fi,4,0),s(),o(4,"button",150),x("click",function(){u(e);let n=c();return C(n.handleCopyInfoPopup())}),g(5,Ui,4,0)(6,ji,5,0),s()(),o(7,"div",151),g(8,zi,5,1,"section")(9,Wi,5,0,"section")(10,Ni,5,1,"section"),s()}if(t&2){let e=r,i=c();a(),R(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(),_(i.isLast30Copied_$()?2:3),a(2),R(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(),_(i.isInfoCopied_$()?5:6),a(3),_(e.primaryJson?8:-1),a(),_(e.showStreamBreakdown?9:-1),a(),_(e.pairedJson?10:-1)}}var qt=(()=>{class t{sessionId=Q("");ccSession_DS=$(W);detailUi_DS=$(K);sessionQueue_DS=$(Ot);voiceInputUi_DS=$(bt);ttsCachedKeys_$=b(new Set);handleTtsCached(e){this.ttsCachedKeys_$.update(i=>new Set([...i,e]))}promptInput_$=b("");isAutoScroll_$=b(!0);isSending_$=b(!1);isExecuting_$=P(()=>this.ccSession_DS.selectedSession_$()?.session?.status==="running");selectedMode_$=b(k.loadSessionMode()||ge.normal);selectedEffort_$=b(k.loadSessionEffort()||ae.high);selectedModel_$=b(k.loadSessionModel()||ce.sonnet);modeOptions=[ge.normal,ge.plan];effortOptions=[ae.none,ae.low,ae.mid,ae.high];modelOptions=[ce.sonnet,ce.opus,ce.haiku];modelName_$=P(()=>{let e=this.ccSession_DS.selectedSession_$();return e?.session?.activeModel||e?.session?.model||""});usage_$=P(()=>this.ccSession_DS.sessionUsage_$());usageText_$=P(()=>{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_$=P(()=>{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(),m=this.ttsCachedKeys_$(),w=[],f=null;for(let h of i)if(!(h.type==="status-update"&&!l))if(h.type==="prompt")f={promptText:h.text,promptListKey:h.listKey,promptBubbleView:{listKey:h.listKey,kind:U.userPrompt,bodyText:h.text,timestampIso:h.timestamp,isUserAligned:!0,flags:{showCopy:!0,showRawInfo:!1,useEditDiffForExpandable:!1},tts:h.text.trim().length>0?{messageKey:h.listKey,sessionId:p,role:"user",content:h.text,timestampIso:h.timestamp,hasTtsAudio:m.has(h.listKey)}:void 0,imageDataUrls:h.imageDataUrls},items:[]},w.push(f);else{f||(f={promptText:"",promptListKey:`__no-prompt-${w.length}`,items:[]},w.push(f));let I={listKey:h.listKey,messageType:h.type,text:h.text,isStatus:h.isStatus,expandableContent:h.expandableContent,isLatestMessage:!1,rawData:h.rawData,timestamp:h.timestamp,subtype:h.subtype,parentAgentId:h.parentAgentId};h.type==="tool"&&(I.toolName=this.extractToolNameFromMsg(h),I.toolDescription=this.extractToolDescription(h.rawData)),f.items.push(I)}if(w.length){let h=w[w.length-1];h.items.length&&(h.items[h.items.length-1].isLatestMessage=!0)}if(!n)for(let h of w){let I=-1;for(let D=h.items.length-1;D>=0;D--)if(h.items[D].isStatus){I=D;break}I>=0&&(h.items=h.items.filter((D,B)=>!D.isStatus||B===I))}for(let h of w)h.items=this.pairToolCallsWithResults(h.items);for(let h of w)h.items=this.groupSubAgentItems(h.items);for(let h of w)h.items=this.groupConsecutiveToolItems(h.items);for(let h of w)h.items=h.items.map(I=>{if(!(I.messageType==="assistant"||I.messageType==="error"||I.messageType==="tool-result"||I.messageType==="info"))return I;let B=Se.fromDisplayItem(I);return I.messageType==="assistant"&&I.text.trim().length>0&&(B.tts={messageKey:I.listKey,sessionId:p,role:"assistant",content:I.text,timestampIso:I.timestamp??new Date().toISOString(),hasTtsAudio:m.has(I.listKey)}),ze(je({},I),{bubbleView:B})});return w});stickyPromptInfo_$=b(null);lastPromptText_$=P(()=>this.stickyPromptInfo_$()?.promptText??"");isShowSessionStatus=Q(!1);isShowAgentUpdates=Q(!0);isShowStickyPrompt_$=b(!1);isInfoPopupOpen_$=b(!1);infoPopupBundle_$=b(null);infoPopupTitle_$=b("");isInfoCopied_$=b(!1);isLast30Copied_$=b(!1);chatScrollRef;sessionInputRef;pendingAttachments_$=b([]);previousItemCount=0;constructor(){Te(()=>{let e=this.sessionId();if(e){let i=k.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),k.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{k.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&&k.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=e.text.trim();if(!i.length)return;let n=this.promptInput_$().trim(),l=n.length>0?`${n} ${i}`:i;this.handlePromptInputChange(l),this.voiceInputUi_DS.autoSendAfterVoice_$()&&e.isFinal&&this.handleSendPrompt()}handlePlanAccepted(){let e=this.sessionId();e&&this.ccSession_DS.sendPrompt({sessionId:e,content:"plan approved, proceed"}).catch(i=>{te.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),k.saveSessionMode(e);let i=this.sessionId();i&&this.ccSession_DS.updateSessionConfig({sessionId:i,mode:e}).catch(n=>{te.DyFM_Log.error("[CCAP] cc-session-console config-update mode",n)})}handleSelectEffort(e){this.selectedEffort_$.set(e),k.saveSessionEffort(e);let i=this.sessionId();i&&this.ccSession_DS.updateSessionConfig({sessionId:i,reasoningEffort:e}).catch(n=>{te.DyFM_Log.error("[CCAP] cc-session-console config-update effort",n)})}handleSelectModel(e){this.selectedModel_$.set(e),k.saveSessionModel(e);let i=this.sessionId();i&&this.ccSession_DS.updateSessionConfig({sessionId:i,model:e}).catch(n=>{te.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]"),m=this.isShowStickyPrompt_$(),w=l-8,f=l+24,h=null;for(let I=p.length-1;I>=0;I--){let D=p[I],B=D.getBoundingClientRect(),ne=m?f:w;if(B.bottom<ne){let Z=D.getAttribute("data-prompt-key")??"",ee=D.getAttribute("data-prompt-text")??"";Z&&ee&&(h={promptListKey:Z,promptText:ee});break}}this.stickyPromptInfo_$.set(h),this.isShowStickyPrompt_$.set(!!h)}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(),m=58;i.scrollTop+=p.top-l.top-m}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){He.ccItemHasAnyRaw(e)&&(this.infoPopupTitle_$.set(e.messageType),this.infoPopupBundle_$.set(He.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=>{te.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=>{te.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 m=typeof p.rawData.id=="string"?p.rawData.id:"";m&&i.set(m,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 m=typeof p.rawData.tool_use_id=="string"?p.rawData.tool_use_id:"",w=m?i.get(m):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 m=0;m<e.length;m++){let w=e[m];if(w.messageType==="tool"&&w.toolName==="Agent"&&w.rawData){let f=typeof w.rawData.id=="string"?w.rawData.id:"";f&&i.set(f,{item:w,index:m})}}if(!i.size)return e;let n=new Map,l=new Set;for(let m=0;m<e.length;m++){let w=e[m];if(w.parentAgentId&&(l.add(m),i.has(w.parentAgentId))){let f=n.get(w.parentAgentId)??[];f.push(w),n.set(w.parentAgentId,f)}}let p=[];for(let m=0;m<e.length;m++){if(l.has(m))continue;let w=e[m];if(w.messageType==="tool"&&w.toolName==="Agent"&&w.rawData){let f=typeof w.rawData.id=="string"?w.rawData.id:"",h=n.get(f)??[],I=[w,...h],D=w.rawData?.input,B=D&&typeof D=="object"&&typeof D.subagent_type=="string"?D.subagent_type:"",ne=D&&typeof D=="object"&&typeof D.description=="string"?D.description:"",Z=B?`${B}: ${ne||"..."}`:ne||"Sub-agent",ee=this.groupConsecutiveToolItems(I);p.push({listKey:w.listKey,messageType:"sub-agent-group",text:Z,isStatus:!1,isLatestMessage:!1,groupItems:ee,groupToolName:B||"Agent"})}else p.push(w)}return p}buildTurnsFromAssembledMessages(e){let i=this.isShowAgentUpdates(),n=this.isShowSessionStatus(),l=this.sessionId(),p=this.ttsCachedKeys_$(),m=[],w=null;for(let f of e){let h=f.messageRole==="status-update"&&f.subtype==="task_progress"&&!!f.rawData?.last_tool_name;if(!(f.messageRole==="status-update"&&!i&&!h))if(f.messageRole==="user"&&f.isUserAligned===!0)w={promptText:f.bodyText,promptListKey:f.messageKey,promptBubbleView:{listKey:f.messageKey,kind:U.userPrompt,bodyText:f.bodyText,timestampIso:f.timestamp,isUserAligned:!0,rawData:f.rawData,flags:{showCopy:!0,showRawInfo:!!f.rawData,useEditDiffForExpandable:!1},tts:f.bodyText.trim().length>0?{messageKey:f.messageKey,sessionId:l,role:"user",content:f.bodyText,timestampIso:f.timestamp,hasTtsAudio:p.has(f.messageKey)}:void 0},items:[]},m.push(w);else{w||(w={promptText:"",promptListKey:`__no-prompt-${m.length}`,items:[]},m.push(w));let I=f.rawData&&typeof f.rawData.last_tool_name=="string"?f.rawData.last_tool_name:"",D=f.messageRole==="status-update"&&f.subtype==="task_progress"&&!!I,B=D?"tool":f.messageRole,ne=B==="status"||B==="status-update",Z=t.mapAssembledRoleToMessageType(B),ee={listKey:f.messageKey,messageType:Z,text:D?`${I}: ${f.bodyText}`:f.bodyText,isStatus:ne,expandableContent:f.expandableContent,isLatestMessage:!1,rawData:f.rawData,timestamp:f.timestamp,subtype:f.subtype,parentAgentId:f.parentAgentId,toolName:f.toolName||(D?I:void 0),toolDescription:Z==="tool"?this.extractToolDescription(f.rawData):void 0};f.toolResult&&(ee.pairedResult={text:f.toolResult.text,expandableContent:f.toolResult.expandableContent,rawData:f.toolResult.rawData,isError:f.toolResult.isError}),w.items.push(ee)}}if(m.length){let f=m[m.length-1];f.items.length&&(f.items[f.items.length-1].isLatestMessage=!0)}if(!n)for(let f of m){let h=-1;for(let I=f.items.length-1;I>=0;I--)if(f.items[I].isStatus){h=I;break}h>=0&&(f.items=f.items.filter((I,D)=>!I.isStatus||D===h))}for(let f of m)f.items=this.groupSubAgentItems(f.items);for(let f of m)f.items=this.groupConsecutiveToolItems(f.items);for(let f of m)f.items=f.items.map(h=>{if(!(h.messageType==="assistant"||h.messageType==="error"||h.messageType==="tool-result"||h.messageType==="info"))return h;let D=Se.fromDisplayItem(h);return h.messageType==="assistant"&&h.text.trim().length>0&&(D.tts={messageKey:h.listKey,sessionId:l,role:"assistant",content:h.text,timestampIso:h.timestamp??new Date().toISOString(),hasTtsAudio:p.has(h.listKey)}),ze(je({},h),{bubbleView:D})});return m}groupConsecutiveToolItems(e){let i=[],n=[],l="",p=()=>{if(!n.length)return;let m=n.filter(w=>w.messageType==="tool").length;m>=2?i.push({listKey:n[0].listKey,messageType:"tool-group",text:`${l} \xD7 ${m}`,isStatus:!1,isLatestMessage:!1,groupItems:n,groupToolName:l}):i.push(...n),n=[],l=""};for(let m of e){if(m.messageType==="tool"){let w=this.extractToolName(m);l&&l!==w&&p(),l=w,n.push(m);continue}if(m.messageType==="tool-result"&&n.length){n.push(m);continue}p(),i.push(m)}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=z({type:t,selectors:[["app-ccap-cc-console"]],viewQuery:function(i,n){if(i&1&&(me(Nn,5),me(Hn,5)),i&2){let l;ue(l=Ce())&&(n.chatScrollRef=l.first),ue(l=Ce())&&(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:18,vars:25,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"],[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=T();g(0,Qn,8,1,"div",3)(1,ki,10,1,"ng-template",null,0,ot),o(3,"div",4)(4,"div",5,1),x("scroll",function(){return u(l),C(n.handleChatScroll())}),g(6,Ii,6,0,"div",6),N(7,Ai,2,2,null,null,qn),g(9,Ri,2,1),s(),S(10,"app-s-session-schedule-overlay",7),o(11,"app-s-session-quickcast-overlay",8),x("actionSelected",function(m){return u(l),C(n.handleQuickCastAction(m))}),s(),o(12,"div",9)(13,"app-ccap-voice-record-button",10),x("transcriptSegmentReady",function(m){return u(l),C(n.handleVoiceSegment(m))}),s()()(),o(14,"app-s-session-input",11,2),x("draftTextChange",function(m){return u(l),C(n.handlePromptInputChange(m))})("attachmentsChanged",function(m){return u(l),C(n.handleAttachmentsChanged(m))})("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(m){return u(l),C(n.handleSelectMode(m))})("modelChanged",function(m){return u(l),C(n.handleSelectModel(m))})("effortChanged",function(m){return u(l),C(n.handleSelectEffort(m))})("queueEditStart",function(m){return u(l),C(n.sessionQueue_DS.startEditing(m))})("queueEditTextChange",function(m){return u(l),C(n.sessionQueue_DS.editingText_$.set(m))})("queueEditSave",function(){return u(l),C(n.sessionQueue_DS.saveEdit())})("queueEditCancel",function(){return u(l),C(n.sessionQueue_DS.cancelEdit())})("queueRemoveItem",function(m){return u(l),C(n.sessionQueue_DS.removeItem(m))})("queueSendNow",function(m){return u(l),C(n.sessionQueue_DS.sendNow(m))})("queueMoveUp",function(m){return u(l),C(n.sessionQueue_DS.reorderItem({queueItemId:m,direction:"up"}))})("queueMoveDown",function(m){return u(l),C(n.sessionQueue_DS.reorderItem({queueItemId:m,direction:"down"}))}),s(),o(16,"app-s-modal",12),x("closed",function(){return u(l),C(n.handleCloseInfoPopup())}),g(17,Hi,11,9),s()}if(i&2){let l;_(n.isShowStickyPrompt_$()?0:-1),a(6),_(n.ccSession_DS.isLoadingOlderMessages_$()?6:-1),a(),H(n.chatTurns_$()),a(2),_(n.chatTurns_$().length?-1:9),a(),v("sessionId",n.sessionId()),a(3),v("compactLayout",!0),a(),v("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),v("isOpen",n.isInfoPopupOpen_$())("title","Event details \u2014 "+n.infoPopupTitle_$()),a(),_((l=n.infoPopupBundle_$())?17:-1,l)}},dependencies:[at,Y,$e,Ve,Le,Vt,Rt,$t,Dt,Pt,Mt,Ue],encapsulation:2})}return t})();var Kt=(()=>{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=ie({name:"ccSessionEventTypeColor",type:t,pure:!0})}return t})();var Ji=["eventList"],Xi=(t,r)=>r.sequence;function Yi(t,r){t&1&&(o(0,"span",14),d(1," CCAP "),s())}function Zi(t,r){t&1&&(M(),o(0,"svg",19),S(1,"path",22),s())}function eo(t,r){t&1&&(M(),o(0,"svg",20),S(1,"rect",23)(2,"path",24),s())}function to(t,r){if(t&1&&(S(0,"pre",21),F(1,"ccSessionJsonFormat")),t&2){let e=c().$implicit;v("innerHTML",j(1,1,e.data),G)}}function no(t,r){if(t&1){let e=T();o(0,"div",12),x("click",function(){let n=u(e).$implicit,l=c();return C(l.handleToggleEvent(n.sequence))}),o(1,"div",13),g(2,Yi,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),x("click",function(n){let l=u(e).$implicit,p=c();return C(p.handleCopyEvent(l,n))}),g(13,Zi,2,0,":svg:svg",19)(14,eo,3,0,":svg:svg",20),s()(),g(15,to,2,3,"pre",21),s()}if(t&2){let e=r.$implicit,i=c();a(2),_(e.eventSource==="ccap-internal"?2:-1),a(),v("ngClass",j(4,8,e.eventType)),a(2),E(" ",e.eventType," "),a(2),E(" #",e.sequence," "),a(),v("title",j(9,10,e.timestamp)),a(2),E(" ",j(11,12,e.timestamp)," "),a(3),_(i.copiedSequence_$()===e.sequence?13:14),a(2),_(i.isExpanded(e.sequence)?15:-1)}}function io(t,r){t&1&&(o(0,"div",11),d(1,"No events yet"),s())}var Qt=(()=>{class t{ccSession_DS=$(W);detailUi_DS=$(K);globalError_CS=$(gt);expandedSequences_$=b(new Set);isAutoScroll_$=b(!0);copiedSequence_$=b(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=z({type:t,selectors:[["app-ccap-cc-timeline"]],viewQuery:function(i,n){if(i&1&&me(Ji,5),i&2){let l;ue(l=Ce())&&(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=T();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),x("click",function(){return u(l),C(n.handleToggleAutoScroll())}),d(7," Auto-scroll "),s()(),o(8,"div",6)(9,"button",7),x("click",function(){return u(l),C(n.detailUi_DS.handleToggleSessionStatus())}),d(10," Session status "),s(),o(11,"button",8),x("click",function(){return u(l),C(n.detailUi_DS.handleToggleAgentUpdates())}),d(12," Agent updates "),s()(),o(13,"div",9,0),N(15,no,16,14,"div",10,Xi),g(17,io,2,0,"div",11),s()}i&2&&(a(5),E(" (",n.ccSession_DS.selectedSessionEvents_$().length,") "),a(),R(n.isAutoScroll_$()?"border-neonCyan text-neonCyan shadow-neon-glow-cyan":"border-neonDefault text-neutral-400"),a(3),R(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),R(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),H(n.ccSession_DS.selectedSessionEvents_$()),a(2),_(n.ccSession_DS.selectedSessionEvents_$().length?-1:17))},dependencies:[X,Ee,De,Kt,Ue],encapsulation:2})}return t})();var Gt=Qe(lt());function so(t,r){if(t&1){let e=T();o(0,"button",40),x("click",function(){u(e);let n=c(2);return C(n.handleScheduleBadgeClick())}),M(),o(1,"svg",41),S(2,"rect",42)(3,"line",43)(4,"line",44)(5,"line",45),s()()}}function ao(t,r){if(t&1){let e=T();o(0,"button",46),x("click",function(){u(e);let n=c(2);return C(n.handleCoordinatorBadgeClick())}),M(),o(1,"svg",41),S(2,"circle",47)(3,"polygon",48),s()()}}function ro(t,r){if(t&1){let e=T();o(0,"button",49),x("click",function(){u(e);let n=c(2);return C(n.detailUi_DS.handleResume())}),d(1),s()}if(t&2){let e=c(2);v("disabled",e.detailUi_DS.isResuming_$()),a(),E(" ",e.detailUi_DS.isResuming_$()?"Resuming...":"Resume"," ")}}function lo(t,r){if(t&1&&(o(0,"span"),d(1),s()),t&2){let e=c(2);a(),J("",e.rateLimitScopeLabel_$()," ",e.rateLimitPercent_$(),"%")}}function co(t,r){t&1&&(o(0,"span"),d(1,"Rate limit"),s())}function po(t,r){if(t&1&&(xe(0),o(1,"div",54)(2,"span",28),d(3,"Status"),s(),o(4,"span",55),d(5),s()(),o(6,"div",54)(7,"span",28),d(8,"Scope"),s(),o(9,"span",56),d(10),o(11,"span",57),d(12),s()()(),o(13,"div")(14,"div",58)(15,"span",28),d(16,"Utilization"),s(),o(17,"span",59),d(18),s()(),o(19,"div",60),S(20,"div",61),s()(),o(21,"div",54)(22,"span",28),d(23,"Warning threshold"),s(),o(24,"span",56),d(25),s()(),o(26,"div",54)(27,"span",28),d(28,"Resets in"),s(),o(29,"span",56),d(30),s()(),o(31,"div",54)(32,"span",28),d(33,"Overage"),s(),o(34,"span",62),d(35),s()(),o(36,"div",63)(37,"span",64),d(38),F(39,"date"),s()()),t&2){let e=c(3),i=e.rateLimitInfo_$();a(4),R(e.isRateLimitOverThreshold_$()?"text-red-400":"text-green-400"),a(),E(" ",i.status," "),a(5),E(" ",e.rateLimitScopeLabel_$()," "),a(2),E("(",i.rateLimitType,")"),a(6),E("",e.rateLimitPercent_$(),"%"),a(2),R(e.isRateLimitOverThreshold_$()?"bg-red-500":e.rateLimitPercent_$()>50?"bg-amber-500":"bg-green-500"),ve("width",e.rateLimitPercent_$(),"%"),pe("data-utilization-color",e.isRateLimitOverThreshold_$()?"red":e.rateLimitPercent_$()>50?"amber":"green"),a(5),E("",e.rateLimitThresholdPercent_$(),"%"),a(5),y(e.rateLimitResetText_$()),a(4),R(i.isUsingOverage?"text-amber-400":"text-neutral-400"),a(),E(" ",i.isUsingOverage?"active":"inactive"," "),a(3),E("Last updated: ",it(39,17,i.receivedAt,"HH:mm:ss"),"")}}function _o(t,r){t&1&&(o(0,"div",53),d(1," No rate limit data yet "),s())}function mo(t,r){if(t&1){let e=T();o(0,"div",50),x("click",function(){u(e);let n=c(2);return C(n.handleToggleRateLimit())}),s(),o(1,"div",51)(2,"div",52),d(3,"Rate Limit Info"),s(),g(4,po,40,20)(5,_o,2,0,"div",53),s()}if(t&2){let e=c(2);a(4),_(e.rateLimitInfo_$()?4:5)}}function uo(t,r){t&1&&S(0,"span",18)}function Co(t,r){if(t&1&&(o(0,"div",19),d(1),s()),t&2){let e=c();a(),y(e.session.statusMessage)}}function fo(t,r){if(t&1&&(o(0,"div",20)(1,"div",16),d(2,"Actor"),s(),o(3,"div",34),d(4),s()()),t&2){let e=c();a(4),E(" ",e.session.actorLabel||e.session.actorId," ")}}function xo(t,r){if(t&1&&(o(0,"div",20)(1,"div",16),d(2,"Process ID"),s(),o(3,"div",65),d(4),s()()),t&2){let e=c();a(4),y(e.session.processId)}}function ho(t,r){if(t&1&&(o(0,"div",20)(1,"div",16),d(2,"Claude Session"),s(),o(3,"div",21),d(4),s()()),t&2){let e=c();a(4),y(e.session.claudeSessionId)}}function go(t,r){if(t&1&&(o(0,"div",20)(1,"div",16),d(2,"Last Prompt"),s(),o(3,"div",66),d(4),s()()),t&2){let e=c();a(4),y(e.session.lastPrompt)}}function So(t,r){if(t&1&&(o(0,"div",29)(1,"div",30),d(2,"Started"),s(),o(3,"div",67),F(4,"sAbsoluteTime"),d(5),F(6,"sTimeAgo"),s()()),t&2){let e=c();a(3),v("title",j(4,2,e.session.startedAt)),a(2),y(j(6,4,e.session.startedAt))}}function bo(t,r){if(t&1&&(o(0,"div",29)(1,"div",30),d(2,"Last Activity"),s(),o(3,"div",67),F(4,"sAbsoluteTime"),d(5),F(6,"sTimeAgo"),s()()),t&2){let e=c();a(3),v("title",j(4,2,e.session.lastActivityAt)),a(2),y(j(6,4,e.session.lastActivityAt))}}function vo(t,r){if(t&1&&(o(0,"div",29)(1,"div",30),d(2,"Completed"),s(),o(3,"div",67),F(4,"sAbsoluteTime"),d(5),F(6,"sTimeAgo"),s()()),t&2){let e=c();a(3),v("title",j(4,2,e.session.completedAt)),a(2),y(j(6,4,e.session.completedAt))}}function wo(t,r){if(t&1&&(o(0,"div",29)(1,"div",30),d(2,"Model"),s(),o(3,"div",34),d(4),s()()),t&2){let e=c();a(4),y(e.session.activeModel||e.session.model)}}function yo(t,r){if(t&1&&(o(0,"div",29)(1,"div",30),d(2,"Mode"),s(),o(3,"div",34),d(4),s()()),t&2){let e=c();a(4),y(e.session.mode)}}function To(t,r){if(t&1&&(o(0,"div",29)(1,"div",30),d(2,"Permission"),s(),o(3,"div",34),d(4),s()()),t&2){let e=c();a(4),y(e.session.permissionPolicy)}}function ko(t,r){if(t&1&&(o(0,"div",29)(1,"div",30),d(2,"Effort"),s(),o(3,"div",34),d(4),s()()),t&2){let e=c();a(4),y(e.session.reasoningEffort)}}function Io(t,r){if(t&1&&(o(0,"div",29)(1,"div",30),d(2,"Max Turns"),s(),o(3,"div",34),d(4),s()()),t&2){let e=c();a(4),y(e.session.maxTurns)}}function $o(t,r){if(t&1){let e=T();o(0,"button",68),x("click",function(){u(e);let n=c(),l=c();return C(l.handleToggleDebugMode(n.session.sessionId,!0))}),d(1," on (--debug) "),s()}}function Eo(t,r){if(t&1){let e=T();o(0,"button",69),x("click",function(){u(e);let n=c(),l=c();return C(l.handleToggleDebugMode(n.session.sessionId,!1))}),d(1," off "),s()}}function Do(t,r){if(t&1&&(o(0,"div",29)(1,"div",30),d(2,"Cost"),s(),o(3,"div",72),d(4),s()()),t&2){let e=c(2);a(4),E("$",e.session.costUsdTotal.toFixed(4),"")}}function Mo(t,r){if(t&1&&(S(0,"hr",23),o(1,"h3",24),d(2," Usage "),s(),o(3,"div",70)(4,"div",26)(5,"div",71),d(6),s(),o(7,"div",28),d(8,"Input"),s()(),o(9,"div",26)(10,"div",71),d(11),s(),o(12,"div",28),d(13,"Output"),s()()(),g(14,Do,5,1,"div",29)),t&2){let e=c(),i=c();a(6),y(i.formatTokens(e.session.inputTokensTotal)),a(5),y(i.formatTokens(e.session.outputTokensTotal)),a(3),_(e.session.costUsdTotal?14:-1)}}function Po(t,r){if(t&1&&(o(0,"div",29)(1,"div",30),d(2,"Runtime Status"),s(),o(3,"div",34),d(4),s()()),t&2){let e=c();a(4),y(e.runtime.runtimeStatus)}}function Ao(t,r){if(t&1&&(o(0,"div",29)(1,"div",30),d(2,"Runner"),s(),o(3,"div",33),d(4),s()()),t&2){let e=c();a(3),R(e.runtime.isTerminalRunnerConnected?"text-neonGreen":"text-amber-400"),a(),E(" ",e.runtime.isTerminalRunnerConnected?"connected":"disconnected"," ")}}function Oo(t,r){if(t&1){let e=T();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"h3",4),d(4," Session Info "),s(),g(5,so,6,0,"button",5)(6,ao,4,0,"button",6),s(),o(7,"button",7),x("click",function(){u(e);let n=c();return C(n.isArchiveConfirmOpen_$.set(!0))}),d(8),s()(),o(9,"div",8),g(10,ro,2,2,"button",9),o(11,"div",10)(12,"button",11),x("click",function(){u(e);let n=c();return C(n.handleToggleRateLimit())}),M(),o(13,"svg",12),S(14,"circle",13)(15,"path",14),s(),g(16,lo,2,2,"span")(17,co,2,0,"span"),s(),g(18,mo,6,1),s()(),L(),o(19,"div",15)(20,"div",16),d(21,"Status"),s(),o(22,"div",3)(23,"span",17),F(24,"ccSessionStatusColor"),d(25),s(),g(26,uo,1,0,"span",18),s(),g(27,Co,2,1,"div",19),s(),o(28,"div",20)(29,"div",16),d(30,"Session ID"),s(),o(31,"div",21),d(32),s()(),o(33,"div",20)(34,"div",16),d(35,"Workspace"),s(),o(36,"div",22),d(37),s()(),g(38,fo,5,1,"div",20)(39,xo,5,1,"div",20)(40,ho,5,1,"div",20),S(41,"hr",23),o(42,"h3",24),d(43," Statistics "),s(),o(44,"div",25)(45,"div",26)(46,"div",27),d(47),s(),o(48,"div",28),d(49,"Prompts"),s()(),o(50,"div",26)(51,"div",27),d(52),s(),o(53,"div",28),d(54,"Tool Calls"),s()()(),g(55,go,5,1,"div",20),S(56,"hr",23),o(57,"h3",24),d(58," Timestamps "),s(),g(59,So,7,6,"div",29)(60,bo,7,6,"div",29)(61,vo,7,6,"div",29),S(62,"hr",23),o(63,"h3",24),d(64," Configuration "),s(),g(65,wo,5,1,"div",29)(66,yo,5,1,"div",29)(67,To,5,1,"div",29)(68,ko,5,1,"div",29)(69,Io,5,1,"div",29),o(70,"div",29)(71,"div",30),d(72,"Debug Mode"),s(),g(73,$o,2,0,"button",31)(74,Eo,2,0,"button",32),s(),g(75,Mo,15,3),S(76,"hr",23),o(77,"h3",24),d(78," Runtime "),s(),o(79,"div",29)(80,"div",30),d(81,"Live"),s(),o(82,"div",33),d(83),s()(),g(84,Po,5,1,"div",29),o(85,"div",29)(86,"div",30),d(87,"Output Buffer"),s(),o(88,"div",34),d(89),s()(),o(90,"div",29)(91,"div",30),d(92,"Runner Mode"),s(),o(93,"div",34),d(94),s()(),g(95,Ao,5,3,"div",29),s(),o(96,"app-s-modal",35),x("closed",function(){u(e);let n=c();return C(n.isArchiveConfirmOpen_$.set(!1))}),o(97,"p",36),d(98),s(),o(99,"div",37)(100,"button",38),x("click",function(){u(e);let n=c();return C(n.isArchiveConfirmOpen_$.set(!1))}),d(101," Cancel "),s(),o(102,"button",39),x("click",function(){let n=u(e),l=c();return C(l.handleConfirmToggleArchive(n.session))}),d(103),s()()()}if(t&2){let e=r,i=c();a(5),_(i.hasSchedule_$()?5:-1),a(),_(i.hasCoordinator_$()?6:-1),a(),R(e.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"),v("title",e.session.isArchived?"Unarchive session":"Archive session"),a(),E(" ",e.session.isArchived?"Unarchive":"Archive"," "),a(2),_(e.session.status==="completed"||e.session.status==="errored"?10:-1),a(2),R(i.rateLimitInfo_$()?i.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"),pe("data-rate-limit-state",i.rateLimitInfo_$()?i.isRateLimitOverThreshold_$()?"reached":"allowed":"unknown"),a(4),_(i.rateLimitInfo_$()?16:17),a(2),_(i.isRateLimitOpen_$()?18:-1),a(5),v("ngClass",j(24,47,e.session.status)),a(2),E(" ",e.session.status," "),a(),_(e.runtime.isLive?26:-1),a(),_(e.session.statusMessage?27:-1),a(5),y(e.session.sessionId),a(5),y(e.session.workspacePath),a(),_(e.session.actorId||e.session.actorLabel?38:-1),a(),_(e.session.processId?39:-1),a(),_(e.session.claudeSessionId?40:-1),a(7),y(e.session.promptCount),a(5),y(e.session.toolCallCount),a(3),_(e.session.lastPrompt?55:-1),a(4),_(e.session.startedAt?59:-1),a(),_(e.session.lastActivityAt?60:-1),a(),_(e.session.completedAt?61:-1),a(4),_(e.session.activeModel||e.session.model?65:-1),a(),_(e.session.mode?66:-1),a(),_(e.session.permissionPolicy?67:-1),a(),_(e.session.reasoningEffort?68:-1),a(),_(e.session.maxTurns?69:-1),a(4),_(e.session.isDebugMode?73:74),a(2),_(e.session.inputTokensTotal||e.session.outputTokensTotal||e.session.costUsdTotal?75:-1),a(7),R(e.runtime.isLive?"text-neonGreen":"text-neutral-500"),a(),E(" ",e.runtime.isLive?"Yes":"No"," "),a(),_(e.runtime.runtimeStatus?84:-1),a(5),E("",e.runtime.outputBufferLength," lines"),a(5),E(" ",e.runtime.isTerminalMode?"terminal":"direct"," "),a(),_(e.runtime.isTerminalMode?95:-1),a(),v("isOpen",i.isArchiveConfirmOpen_$())("title",e.session.isArchived?"Unarchive Session":"Archive Session")("maxWidth","sm")("closeOnBackdropClick",!0),a(2),E(" ",e.session.isArchived?"Are you sure you want to unarchive this session?":"Are you sure you want to archive this session?"," "),a(5),E(" ",e.session.isArchived?"Unarchive":"Archive"," ")}}var Jt=(()=>{class t{ccSession_DS=$(W);detailUi_DS=$(K);scheduledJobs_DS=$(Me);coordinator_DS=$(Pe);hasSchedule_$=P(()=>{let e=this.ccSession_DS.activeSessionId_$();return e?this.scheduledJobs_DS.scheduledSessionIds_$().has(e):!1});hasCoordinator_$=P(()=>{let e=this.ccSession_DS.activeSessionId_$();return e?this.coordinator_DS.coordinatedSessionIds_$().has(e):!1});isRateLimitOpen_$=b(!1);isArchiveConfirmOpen_$=b(!1);schedulePopupSessionId_$=b(null);coordinatorPopupSessionId_$=b(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=>{Gt.DyFM_Log.error("[CCAP] cc-metadata config-update isDebugMode",l)})}rateLimitInfo_$=P(()=>this.ccSession_DS.rateLimitInfo_$());rateLimitResetText_$=P(()=>re.formatResetText(this.rateLimitInfo_$()));rateLimitPercent_$=P(()=>re.computeUtilizationPercent(this.rateLimitInfo_$()));rateLimitThresholdPercent_$=P(()=>re.computeThresholdPercent(this.rateLimitInfo_$()));rateLimitScopeLabel_$=P(()=>re.formatLimitScopeLabel(this.rateLimitInfo_$()));isRateLimitOverThreshold_$=P(()=>re.isOverThreshold(this.rateLimitInfo_$()));ngOnInit(){this.scheduledJobs_DS.jobs_$().length===0&&this.scheduledJobs_DS.loadAll(),this.coordinator_DS.globalCoordinatorsList_$().length===0&&this.coordinator_DS.loadAllCoordinatorsForManagementPage()}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{}})}formatTokens(e){return e?e>1e3?`${(e/1e3).toFixed(1)}k`:String(e):"0"}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=z({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"],["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"],[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,"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"],[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&&(g(0,Oo,104,49),o(1,"app-sch-schedule-popup",0),x("closed",function(){return n.handleCloseSchedulePopup()}),s(),o(2,"app-crd-info-popup",0),x("closed",function(){return n.handleCloseCoordinatorPopup()}),s()),i&2){let l;_((l=n.ccSession_DS.selectedSession_$())?0:-1,l),a(),v("sessionId",n.schedulePopupSessionId_$())("isOpen",n.schedulePopupSessionId_$()!==null),a(),v("sessionId",n.coordinatorPopupSessionId_$())("isOpen",n.coordinatorPopupSessionId_$()!==null)}},dependencies:[X,Y,le,de,rt,Ee,De,Fe],encapsulation:2})}return t})();function Ro(t,r){t&1&&(o(0,"div",0),d(1," Loading session... "),s())}function Lo(t,r){if(t&1){let e=T();o(0,"app-s-session-detail-three-column-layout",2),x("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),S(2,"app-ccap-cc-metadata"),s(),o(3,"div",4),S(4,"app-ccap-cc-console",5),s(),o(5,"div",6),S(6,"app-ccap-cc-timeline"),s()()}if(t&2){let e=c();v("isStartOpen",e.detailUi_DS.isMetadataPanelOpen_$())("isEndOpen",e.detailUi_DS.isTimelinePanelOpen_$())("startWidthPx",e.metadataWidth_$())("endWidthPx",e.timelineWidth_$())("isResizing",e.isResizing_$()),a(4),v("sessionId",e.sessionId_$())("isShowSessionStatus",e.detailUi_DS.isShowSessionStatus_$())("isShowAgentUpdates",e.detailUi_DS.isShowAgentUpdates_$())}}function Fo(t,r){t&1&&(o(0,"div",0),d(1," Select a session to view details "),s())}var Ke=(()=>{class t extends St{ccSession_DS=$(W);detailUi_DS=$(K);peiContext_DS=$(Ie);route=$(dt);router=$(se);sessionId_$=b("");metadataWidth_$=b(256);timelineWidth_$=b(288);isResizing_$=b(!1);ngOnInit(){this.metadataWidth_$.set(Math.max(160,Math.min(500,k.loadPanelWidth("metadata",256)))),this.timelineWidth_$.set(Math.max(200,Math.min(600,k.loadPanelWidth("timeline",288)))),this.addSubscription(this.route.params.subscribe(e=>{let i=e.sessionId??"";if(this.sessionId_$.set(i),i)k.saveLastSessionId(i),this.peiContext_DS.ensureInitialized().then(()=>{this.ccSession_DS.setActiveSessionId(i),this.ccSession_DS.clearLiveOutput(),this.ccSession_DS.loadSessionDetail({sessionId:i}),this.ccSession_DS.loadSessionEvents({sessionId:i});let n=this.peiContext_DS.activeCcapId_$();n&&this.ccSession_DS.loadPersistedRateLimitState({ccapId:n}).catch(()=>{})});else{let n=k.loadLastSessionId();n&&this.router.navigate(["/cc-session",n],{replaceUrl:!0})}}))}ngOnDestroy(){this.ccSession_DS.setActiveSessionId(""),super.ngOnDestroy()}handleMetadataResizeStart(e){let i=this.metadataWidth_$(),n=e.clientX;this.isResizing_$.set(!0),he.attachUntilPointerUp({startEvent:e,onMove:l=>{let p=l.clientX-n,m=Math.max(160,Math.min(500,i+p));this.metadataWidth_$.set(m)},onEnd:()=>{this.isResizing_$.set(!1),k.savePanelWidth("metadata",this.metadataWidth_$())}})}handleTimelineResizeStart(e){let i=this.timelineWidth_$(),n=e.clientX;this.isResizing_$.set(!0),he.attachUntilPointerUp({startEvent:e,onMove:l=>{let p=n-l.clientX,m=Math.max(200,Math.min(600,i+p));this.timelineWidth_$.set(m)},onEnd:()=>{this.isResizing_$.set(!1),k.savePanelWidth("timeline",this.timelineWidth_$())}})}static \u0275fac=(()=>{let e;return function(n){return(e||(e=Ye(t)))(n||t)}})();static \u0275cmp=z({type:t,selectors:[["app-ccap-cc-detail"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],features:[et],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&&g(0,Ro,2,0,"div",0)(1,Lo,7,8,"app-s-session-detail-three-column-layout",1)(2,Fo,2,0,"div",0),i&2&&_(n.ccSession_DS.selectedSessionLoading_$()?0:n.ccSession_DS.selectedSession_$()?1:2)},dependencies:[It,qt,Qt,Jt],encapsulation:2})}return t})();var Uo=[{path:"",component:Wt,children:[{path:"",pathMatch:"full",component:Ke},{path:":sessionId",component:Ke}]}],lr=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=Xe({type:t});static \u0275inj=Je({imports:[oe,ht,pt.forChild(Uo),Ae,Y,$e,Ve,Le,le,de,At]})}return t})();export{lr as CcSession_Module};
4
- //# sourceMappingURL=cc.module-VDPOJI5K.js.map
4
+ //# sourceMappingURL=cc.module-B5Z7Z43I.js.map
@@ -1,8 +1,8 @@
1
- import{a as O}from"./chunk-4TRPR5L6.js";import{a as q}from"./chunk-QIQ53K2D.js";import{d as F}from"./chunk-HQ225XML.js";import{e as D}from"./chunk-35SRLU3M.js";import{h as A,j as k}from"./chunk-UFGGDD6A.js";import{I as R,p as j}from"./chunk-FGBFND2T.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 w}from"./chunk-TBMJSIBB.js";var C=class{static compareMirrorEventsAsc(n,e){let t=(n.sequence??0)-(e.sequence??0);if(t!==0)return t;let s=typeof n.timestamp=="string"?n.timestamp:"",o=typeof e.timestamp=="string"?e.timestamp:"",i=s.localeCompare(o);if(i!==0)return i;let r=typeof n.eventType=="string"?n.eventType:"",a=typeof e.eventType=="string"?e.eventType:"";return r.localeCompare(a)}};var v=class c{static messageIdsCompatibleForStreamMerge(n,e){let t=(n??"").trim(),s=(e??"").trim();return t.length>0&&s.length>0?t===s:!0}static parseStreamChunkFromMirrorData(n){let e=n.update;if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=c.toPlainRecord(e),s=t.sessionUpdate,o=null;if(s==="agent_message_chunk"&&(o="agent"),s==="user_message_chunk"&&(o="user"),s==="agent_thought_chunk"&&(o="thought"),o===null)return null;let i=t.content;if(i===null||typeof i!="object"||Array.isArray(i))return null;let a=c.toPlainRecord(i).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:o,text:a,messageId:d}}static canMergeConsoleTailWithChunk(n){let e=n.prev;if(e.streamTextRole===void 0||e.streamTextRole!==n.parsed.role)return!1;let t=e.streamMessageId,s=n.parsed.messageId;if(!c.messageIdsCompatibleForStreamMerge(t,s))return!1;let o=n.ev.sequence??0,i=e.streamLastSequence??0;return!(o<=i)}static canMergeMirrorChunkEvents(n,e,t){let s=c.parseStreamChunkFromMirrorData(n.data??{});if(s===null||s.role!==t.role)return!1;let o=s.messageId,i=t.messageId;if(!c.messageIdsCompatibleForStreamMerge(o,i))return!1;let r=n.sequence??0;return!((e.sequence??0)<=r)}static foldEventsToTimelineRows(n){let e=[];for(let t of n){let s=c.parseStreamChunkFromMirrorData(t.data??{});if(s!==null){let o=e.length>0?e[e.length-1]:void 0,i=o!==void 0&&o.events.length>0?o.events[o.events.length-1]:void 0;if(o!==void 0&&i!==void 0&&c.canMergeMirrorChunkEvents(i,t,s)){let r=[...o.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(n){if(!n.length)return"evt-empty";let e=n[0].sequence??0,t=n[n.length-1].sequence??0;return`merged-chunk-${String(e)}-${String(t)}`}static toPlainRecord(n){let e={};for(let t of Object.keys(n))e[t]=Reflect.get(n,t);return e}};var M=U(j());var x=class c{static prettyStringifyUnknown(n){try{let e=c.expandEmbeddedJsonStrings(n);return JSON.stringify(e,null,2)}catch{return n==null?String(n):typeof n=="object"?"[Object stringify failed]":String(n)}}static expandEmbeddedJsonStrings(n){if(n==null)return n;if(typeof n=="string"){let t=n;if(!F.looksLikeJson(t))return t;try{let s=JSON.parse(t.trim());return c.expandEmbeddedJsonStrings(s)}catch{return t}}if(typeof n!="object")return n;if(Array.isArray(n))return n.map(t=>c.expandEmbeddedJsonStrings(t));let e={};for(let t of Object.keys(n)){let s=Reflect.get(n,t);e[t]=c.expandEmbeddedJsonStrings(s)}return e}};var T=class c{static buildFromMirrorEvent(n){let e=n.sequence??0,t=n.data!==void 0?n.data:{},s=typeof n.eventType=="string"?n.eventType:"";return s==="prompt-sent"?c.buildPromptSentBrief(e,t):s==="ca-session-update"?c.buildCaSessionUpdateBrief(e,t):c.buildGenericBrief(s,e,t)}static extractSessionUpdateKind(n){let e=n.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(n,e){let t=e.content;return typeof t!="string"||!t.length?null:{listKey:`mirror-prompt-${String(n)}`,consoleType:"prompt",bodyText:t,mirrorEventType:"prompt-sent",useRawBubbleKind:!1,rawData:e}}static buildCaSessionUpdateBrief(n,e){let t=v.parseStreamChunkFromMirrorData(e);if(t!==null){let o=c.extractSessionUpdateKind(e),i=t.role==="thought";return{listKey:`mirror-chunk-${String(n)}`,consoleType:i?"thinking":"assistant",bodyText:t.text,mirrorEventType:"ca-session-update",briefSubtype:o,useRawBubbleKind:!1,rawData:e,isStreamingTextChunk:!0,streamTextRole:t.role,streamMessageId:t.messageId}}let s=x.prettyStringifyUnknown(e);return{listKey:`mirror-ca-session-update-${String(n)}`,consoleType:"info",bodyText:s,mirrorEventType:"ca-session-update",useRawBubbleKind:!0,rawData:e}}static buildGenericBrief(n,e,t){let s=c.safeListKeySegment(n),o={eventType:n.length?n:"unknown",sequence:e,data:t},i=x.prettyStringifyUnknown(o);return{listKey:`mirror-${s}-${String(e)}`,consoleType:"info",bodyText:i,mirrorEventType:n.length?n:"unknown",useRawBubbleKind:!0,rawData:t}}static safeListKeySegment(n){let e=n.replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/^_+|_+$/g,"");return e.length?e:"event"}static toPlainRecord(n){let e={};for(let t of Object.keys(n))e[t]=Reflect.get(n,t);return e}};var u=class c{static listKeyStart(n){return`ca-tc-${n}-start`}static listKeyProgress(n){return`ca-tc-${n}-progress`}static listKeyResult(n){return`ca-tc-${n}-result`}static listKeyError(n){return`ca-tc-${n}-error`}static tryParseStableListKey(n){let e="ca-tc-";if(!n.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(!n.endsWith(s.suffix))continue;let o=n.slice(e.length,n.length-s.suffix.length);return o.length?{toolCallId:o,role:s.role}:null}return null}static tryParseMirrorData(n){let e=n.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 o=t.toolCallId;if(typeof o!="string"||!o.trim().length)return null;let i=t.status,r=typeof i=="string"?i:"",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,E=t.rawInput,_=t.content,$=t.locations;return{sessionUpdate:s,toolCallId:o.trim(),status:r,title:l,toolKind:h,rawOutput:p!==void 0?p:void 0,rawInput:E!==void 0?E:void 0,content:Array.isArray(_)&&_.length?_:void 0,locations:Array.isArray($)&&$.length?$:void 0}}static hasRawOutputError(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;let e=c.toPlainRecord(n);return Object.prototype.hasOwnProperty.call(e,"error")}static summarizeRawOutputError(n){if(n===null||typeof n!="object"||Array.isArray(n))return"Tool call failed";let t=c.toPlainRecord(n).error;if(typeof t=="string"&&t.trim().length)return t.trim();try{return JSON.stringify(n)}catch{return"Tool call failed"}}static summarizeRawOutputSuccess(n){if(n===void 0)return"Completed";try{let e=JSON.stringify(n),t=400;return e.length>t?`${e.substring(0,t)}\u2026`:e}catch{return"Completed"}}static formatRawInput(n){if(n==null)return"";try{return JSON.stringify(n,null,2)}catch{return String(n)}}static formatLocations(n){if(!n?.length)return"";let e=[];for(let t of n){if(t===null||typeof t!="object"||Array.isArray(t))continue;let s=c.toPlainRecord(t),o=s.path;if(typeof o!="string"||!o.length)continue;let i=s.line,r=typeof i=="number"?`:${i}`:"";e.push(`${o}${r}`)}return e.join(`
1
+ import{a as O}from"./chunk-ZHR6XIVW.js";import{a as q}from"./chunk-VC2QRVQ7.js";import{d as F}from"./chunk-MNOT53BD.js";import{e as D}from"./chunk-I5U3HPJG.js";import{h as A,j as k}from"./chunk-FUTFIQDJ.js";import{I as R,p as j}from"./chunk-I2SFULUF.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 w}from"./chunk-TBMJSIBB.js";var C=class{static compareMirrorEventsAsc(n,e){let t=(n.sequence??0)-(e.sequence??0);if(t!==0)return t;let s=typeof n.timestamp=="string"?n.timestamp:"",o=typeof e.timestamp=="string"?e.timestamp:"",i=s.localeCompare(o);if(i!==0)return i;let r=typeof n.eventType=="string"?n.eventType:"",a=typeof e.eventType=="string"?e.eventType:"";return r.localeCompare(a)}};var v=class c{static messageIdsCompatibleForStreamMerge(n,e){let t=(n??"").trim(),s=(e??"").trim();return t.length>0&&s.length>0?t===s:!0}static parseStreamChunkFromMirrorData(n){let e=n.update;if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=c.toPlainRecord(e),s=t.sessionUpdate,o=null;if(s==="agent_message_chunk"&&(o="agent"),s==="user_message_chunk"&&(o="user"),s==="agent_thought_chunk"&&(o="thought"),o===null)return null;let i=t.content;if(i===null||typeof i!="object"||Array.isArray(i))return null;let a=c.toPlainRecord(i).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:o,text:a,messageId:d}}static canMergeConsoleTailWithChunk(n){let e=n.prev;if(e.streamTextRole===void 0||e.streamTextRole!==n.parsed.role)return!1;let t=e.streamMessageId,s=n.parsed.messageId;if(!c.messageIdsCompatibleForStreamMerge(t,s))return!1;let o=n.ev.sequence??0,i=e.streamLastSequence??0;return!(o<=i)}static canMergeMirrorChunkEvents(n,e,t){let s=c.parseStreamChunkFromMirrorData(n.data??{});if(s===null||s.role!==t.role)return!1;let o=s.messageId,i=t.messageId;if(!c.messageIdsCompatibleForStreamMerge(o,i))return!1;let r=n.sequence??0;return!((e.sequence??0)<=r)}static foldEventsToTimelineRows(n){let e=[];for(let t of n){let s=c.parseStreamChunkFromMirrorData(t.data??{});if(s!==null){let o=e.length>0?e[e.length-1]:void 0,i=o!==void 0&&o.events.length>0?o.events[o.events.length-1]:void 0;if(o!==void 0&&i!==void 0&&c.canMergeMirrorChunkEvents(i,t,s)){let r=[...o.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(n){if(!n.length)return"evt-empty";let e=n[0].sequence??0,t=n[n.length-1].sequence??0;return`merged-chunk-${String(e)}-${String(t)}`}static toPlainRecord(n){let e={};for(let t of Object.keys(n))e[t]=Reflect.get(n,t);return e}};var M=U(j());var x=class c{static prettyStringifyUnknown(n){try{let e=c.expandEmbeddedJsonStrings(n);return JSON.stringify(e,null,2)}catch{return n==null?String(n):typeof n=="object"?"[Object stringify failed]":String(n)}}static expandEmbeddedJsonStrings(n){if(n==null)return n;if(typeof n=="string"){let t=n;if(!F.looksLikeJson(t))return t;try{let s=JSON.parse(t.trim());return c.expandEmbeddedJsonStrings(s)}catch{return t}}if(typeof n!="object")return n;if(Array.isArray(n))return n.map(t=>c.expandEmbeddedJsonStrings(t));let e={};for(let t of Object.keys(n)){let s=Reflect.get(n,t);e[t]=c.expandEmbeddedJsonStrings(s)}return e}};var T=class c{static buildFromMirrorEvent(n){let e=n.sequence??0,t=n.data!==void 0?n.data:{},s=typeof n.eventType=="string"?n.eventType:"";return s==="prompt-sent"?c.buildPromptSentBrief(e,t):s==="ca-session-update"?c.buildCaSessionUpdateBrief(e,t):c.buildGenericBrief(s,e,t)}static extractSessionUpdateKind(n){let e=n.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(n,e){let t=e.content;return typeof t!="string"||!t.length?null:{listKey:`mirror-prompt-${String(n)}`,consoleType:"prompt",bodyText:t,mirrorEventType:"prompt-sent",useRawBubbleKind:!1,rawData:e}}static buildCaSessionUpdateBrief(n,e){let t=v.parseStreamChunkFromMirrorData(e);if(t!==null){let o=c.extractSessionUpdateKind(e),i=t.role==="thought";return{listKey:`mirror-chunk-${String(n)}`,consoleType:i?"thinking":"assistant",bodyText:t.text,mirrorEventType:"ca-session-update",briefSubtype:o,useRawBubbleKind:!1,rawData:e,isStreamingTextChunk:!0,streamTextRole:t.role,streamMessageId:t.messageId}}let s=x.prettyStringifyUnknown(e);return{listKey:`mirror-ca-session-update-${String(n)}`,consoleType:"info",bodyText:s,mirrorEventType:"ca-session-update",useRawBubbleKind:!0,rawData:e}}static buildGenericBrief(n,e,t){let s=c.safeListKeySegment(n),o={eventType:n.length?n:"unknown",sequence:e,data:t},i=x.prettyStringifyUnknown(o);return{listKey:`mirror-${s}-${String(e)}`,consoleType:"info",bodyText:i,mirrorEventType:n.length?n:"unknown",useRawBubbleKind:!0,rawData:t}}static safeListKeySegment(n){let e=n.replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/^_+|_+$/g,"");return e.length?e:"event"}static toPlainRecord(n){let e={};for(let t of Object.keys(n))e[t]=Reflect.get(n,t);return e}};var u=class c{static listKeyStart(n){return`ca-tc-${n}-start`}static listKeyProgress(n){return`ca-tc-${n}-progress`}static listKeyResult(n){return`ca-tc-${n}-result`}static listKeyError(n){return`ca-tc-${n}-error`}static tryParseStableListKey(n){let e="ca-tc-";if(!n.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(!n.endsWith(s.suffix))continue;let o=n.slice(e.length,n.length-s.suffix.length);return o.length?{toolCallId:o,role:s.role}:null}return null}static tryParseMirrorData(n){let e=n.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 o=t.toolCallId;if(typeof o!="string"||!o.trim().length)return null;let i=t.status,r=typeof i=="string"?i:"",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,E=t.rawInput,_=t.content,$=t.locations;return{sessionUpdate:s,toolCallId:o.trim(),status:r,title:l,toolKind:h,rawOutput:p!==void 0?p:void 0,rawInput:E!==void 0?E:void 0,content:Array.isArray(_)&&_.length?_:void 0,locations:Array.isArray($)&&$.length?$:void 0}}static hasRawOutputError(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;let e=c.toPlainRecord(n);return Object.prototype.hasOwnProperty.call(e,"error")}static summarizeRawOutputError(n){if(n===null||typeof n!="object"||Array.isArray(n))return"Tool call failed";let t=c.toPlainRecord(n).error;if(typeof t=="string"&&t.trim().length)return t.trim();try{return JSON.stringify(n)}catch{return"Tool call failed"}}static summarizeRawOutputSuccess(n){if(n===void 0)return"Completed";try{let e=JSON.stringify(n),t=400;return e.length>t?`${e.substring(0,t)}\u2026`:e}catch{return"Completed"}}static formatRawInput(n){if(n==null)return"";try{return JSON.stringify(n,null,2)}catch{return String(n)}}static formatLocations(n){if(!n?.length)return"";let e=[];for(let t of n){if(t===null||typeof t!="object"||Array.isArray(t))continue;let s=c.toPlainRecord(t),o=s.path;if(typeof o!="string"||!o.length)continue;let i=s.line,r=typeof i=="number"?`:${i}`:"";e.push(`${o}${r}`)}return e.join(`
2
2
  `)}static formatContent(n){if(!n?.length)return"";let e=[];for(let t of n){if(t===null||typeof t!="object"||Array.isArray(t))continue;let s=c.toPlainRecord(t),o=s.type;if(o==="diff"){let i=s.path,r=s.oldText,a=s.newText,d=[`--- ${typeof i=="string"?i:"(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(o==="terminal")try{e.push(`[terminal] ${JSON.stringify(s,null,2)}`)}catch{e.push("[terminal output]")}else if(o==="content"){let i=s.parts;if(Array.isArray(i)){for(let r of i)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(n){let e={};for(let t of Object.keys(n))e[t]=Reflect.get(n,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=w({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([]);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,i=(Array.isArray(s)?s:[]).map(E=>this.mapSessionRecord(this.toRecord(E)));this.sessions_$.set(i);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 o=yield this.caSession_AS.getSessionEvents({sessionId:e.sessionId,limit:200}),i=o.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(i),this.sessionEventsHasMore_$.set(o.hasMore===!0);let r=o.nextSinceSequence;return this.sessionEventsNextSince=typeof r=="number"?r:null,this.lastKnownEventSequence=Math.max(-1,...this.selectedSessionEvents_$().map(a=>a.sequence??0)),this.seedConsoleFromMirrorEvents(i),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}),o=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})),i=[...this.selectedSessionEvents_$(),...o];i.sort(C.compareMirrorEventsAsc),this.selectedSessionEvents_$.set(i),this.sessionEventsHasMore_$.set(s.hasMore===!0);let r=s.nextSinceSequence;this.sessionEventsNextSince=typeof r=="number"?r:null,this.lastKnownEventSequence=Math.max(this.lastKnownEventSequence,...o.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}),o=this.toRecord(t.session).sessionId,i=typeof o=="string"?o:"";return yield this.loadSessions(),i}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 o=this.pendingOptimisticPrompts.findIndex(i=>i.listKey===t);throw o>=0&&this.pendingOptimisticPrompts.splice(o,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*M.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 i=u.tryParseMirrorData(e.data??{});if(i!==null&&this.applyToolCallMirrorEventToLiveConsole({ev:e,parsed:i}))return}let t=T.buildFromMirrorEvent(e);if(t===null||(e.eventType==="prompt-sent"&&t.consoleType==="prompt"&&this.removePendingOptimisticPromptBubbleIfTextMatchesMirror(t.bodyText),this.consoleMessages_$().some(i=>i.listKey===t.listKey))||t.isStreamingTextChunk===!0&&this.tryMergeStreamingMirrorChunkIntoConsole({ev:e,brief:t}))return;let o=typeof e.timestamp=="string"&&e.timestamp.length?e.timestamp:new Date().toISOString();this.pushConsoleMessage(this.buildConsolePushParamsFromBrief({ev:e,brief:t,timestampIso:o}))}tryMergeStreamingMirrorChunkIntoConsole(e){let t=this.consoleMessages_$();if(t.length===0)return!1;let s=t[t.length-1],o=v.parseStreamChunkFromMirrorData(e.ev.data??{});if(o===null||!v.canMergeConsoleTailWithChunk({prev:s,ev:e.ev,parsed:o}))return!1;let i=s.streamPartData!==void 0?[...s.streamPartData]:[];i.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:i,rawData:{streamMerged:!0,partCount:i.length,lastChunkSequence:e.ev.sequence,chunkSnapshots:i}}),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 i=T.buildFromMirrorEvent(s);if(i===null)continue;let r=typeof s.timestamp=="string"&&s.timestamp.length?s.timestamp:new Date().toISOString();if(i.isStreamingTextChunk===!0){let a=v.parseStreamChunkFromMirrorData(s.data??{});if(a===null)continue;let l=t.length>0?t[t.length-1]:void 0;if(l!==void 0&&v.canMergeConsoleTailWithChunk({prev:l,ev:s,parsed:a})){let d=l.streamPartData!==void 0?[...l.streamPartData]:[];d.push(s.data??{});let h=i.streamMessageId,p=h!==void 0&&h.trim().length>0?h.trim():l.streamMessageId;t[t.length-1]=b(S({},l),{text:l.text+i.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:i,timestampIso:r})))}else t.push(this.materializeConsoleLineFromPushParams(this.buildConsolePushParamsFromBrief({ev:s,brief:i,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,o=typeof e.ev.timestamp=="string"&&e.ev.timestamp.length?e.ev.timestamp:new Date().toISOString(),i=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:o,rawData:i,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:o,rawData:i,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:o,rawData:i,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:o,rawData:i,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 o=typeof t.timestamp=="string"&&t.timestamp.length?t.timestamp:new Date().toISOString(),i=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:o,rawData:i,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:o,rawData:i,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:o,rawData:i,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:o,rawData:i,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"}))}return!0}return!1}patchLiveToolCallStartInput(e){let t=u.listKeyStart(e.toolCallId),s=this.consoleMessages_$(),o=s.findIndex(l=>l.listKey===t);if(o<0)return;let i=s[o].toolDisplayName??"Tool call",r=c.buildToolCallBodyText({displayName:i,parsed:e.parsed}),a=[...s];a[o]=b(S({},a[o]),{text:r}),this.consoleMessages_$.set(a)}patchLiveConsoleToolCallStartFailed(e){let t=u.listKeyStart(e.toolCallId),s=this.consoleMessages_$(),o=s.findIndex(r=>r.listKey===t);if(o<0)return;let i=[...s];i[o]=b(S({},i[o]),{isToolCallFailedIndicator:!0}),this.consoleMessages_$.set(i)}static patchOutArrayToolCallStartFailed(e,t){let s=u.listKeyStart(t),o=e.findIndex(i=>i.listKey===s);o<0||(e[o]=b(S({},e[o]),{isToolCallFailedIndicator:!0}))}static patchOutArrayToolCallStartInput(e,t){let s=u.listKeyStart(t.toolCallId),o=e.findIndex(a=>a.listKey===s);if(o<0)return;let i=e[o].toolDisplayName??"Tool call",r=c.buildToolCallBodyText({displayName:i,parsed:t});e[o]=b(S({},e[o]),{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 o=u.formatLocations(e.parsed.locations);return o.length&&t.push(`[locations]
6
6
  ${o}`),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,i=(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(!i.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 i)r.set(l.sequence??0,l);let a=[...r.values()].sort(C.compareMirrorEventsAsc);this.selectedSessionEvents_$.set(a);for(let l of i)(l.sequence??0)>s&&this.appendConsoleMirrorEventOne(l);this.lastKnownEventSequence=Math.max(s,...i.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(o){M.DyFM_Log.error(`CCAP_CaSession_DS | socket error | ${t}`,o)}}handleStatusUpdate(e){let t=typeof e.sessionId=="string"?e.sessionId:"",s=typeof e.status=="string"?e.status:"",o=typeof e.statusMessage=="string"?e.statusMessage:void 0;this.lastStatusUpdate_$.set({sessionId:t,status:s,statusMessage:o});let i=this.sessions_$();this.sessions_$.set(i.map(a=>a.sessionId===t?b(S({},a),{status:s,statusMessage:o}):a));let r=this.selectedSession_$();r?.sessionId===t&&this.selectedSession_$.set(b(S({},r),{status:s,statusMessage:o})),s==="errored"&&this.globalError_CS.showError(new Error(o?`CA session error: ${o}`:"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:"",o=typeof e.type=="string"?e.type:"response";if(s){let i={};for(let r of Object.keys(e))i[r]=Reflect.get(e,r);this.pushConsoleMessage({type:o==="error"?"error":"assistant",text:s,rawData:i,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),o=typeof s.sequence=="number"?s.sequence:0;if(o<=this.lastKnownEventSequence)return;this.lastKnownEventSequence=o;let i=s.timestamp,r={sessionId:t,eventType:typeof s.eventType=="string"?s.eventType:"",timestamp:typeof i=="string"&&i.length?i:new Date().toISOString(),data:this.asRecord(s.data),sequence:o},a=this.selectedSessionEvents_$();this.selectedSessionEvents_$.set([...a,r]),this.appendConsoleMirrorEventOne(r)}seedConsoleFromMirrorEvents(e){this.pendingOptimisticPrompts.length=0;let t=[...e].sort(C.compareMirrorEventsAsc);this.consoleMessages_$.set(this.buildFoldedConsoleMessagesFromMirrorEvents(t))}removePendingOptimisticPromptBubbleIfTextMatchesMirror(e){let t=this.pendingOptimisticPrompts.findIndex(i=>i.text===e||i.text.trim()===e.trim());if(t<0)return;let s=this.pendingOptimisticPrompts[t];this.pendingOptimisticPrompts.splice(t,1);let o=this.consoleMessages_$().filter(i=>i.listKey!==s.listKey);this.consoleMessages_$.set(o)}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)}catch(t){M.DyFM_Log.error(`CCAP_CaSession_DS | loadAssembledMessages failed | sessionId: ${e.sessionId}`,t)}})}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 o=s,i=this.assembledMessages_$();this.assembledMessages_$.set([...i,o])}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 o=e.update;if(!o||typeof o!="object")return;let i=o,r=this.assembledMessages_$(),a=r.findIndex(h=>h.messageKey===s);if(a<0)return;let l=S({},r[a]);typeof i.bodyText=="string"&&(l.bodyText=i.bodyText),i.toolResult!==void 0&&(l.toolResult=i.toolResult),typeof i.toolStatus=="string"&&(l.toolStatus=i.toolStatus),i.headerStatusDot!==void 0&&(l.headerStatusDot=typeof i.headerStatusDot=="string"?i.headerStatusDot:void 0);let d=[...r];d[a]=l,this.assembledMessages_$.set(d)}static \u0275fac=function(t){return new(t||c)};static \u0275prov=w({token:c,factory:c.\u0275fac,providedIn:"root"})}return c})();export{C as a,v as b,x as c,u as d,fe as e};
8
- //# sourceMappingURL=chunk-C2JIHZSA.js.map
8
+ //# sourceMappingURL=chunk-3EFXICQW.js.map