@futdevpro/ccap 1.1.3457 → 1.1.3465

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 (201) hide show
  1. package/client-dist/{agent-instances.module-SQX3OI47.js → agent-instances.module-T5NZHTUX.js} +2 -2
  2. package/client-dist/{ca.module-U57DTU3K.js → ca.module-FQELCJHL.js} +2 -2
  3. package/client-dist/cc-usage-dashboard.component-53VPGRKO.js +2 -0
  4. package/client-dist/cc-usage-dashboard.component-53VPGRKO.js.map +7 -0
  5. package/client-dist/{cc.module-HQSFTBH2.js → cc.module-BD3QY5IC.js} +2 -2
  6. package/client-dist/{chunk-AUHXM2NG.js → chunk-2KA2U2YX.js} +2 -2
  7. package/client-dist/{chunk-ZHQ4IVXL.js → chunk-2OCS2YB5.js} +2 -2
  8. package/client-dist/{chunk-SRM3VZ3S.js → chunk-2RW3Z32T.js} +2 -2
  9. package/client-dist/{chunk-ROCS3SA6.js → chunk-2W2KDWV6.js} +2 -2
  10. package/client-dist/{chunk-YXVUSYU3.js → chunk-36ZBT2CJ.js} +2 -2
  11. package/client-dist/{chunk-ZWK2P7RI.js → chunk-42N2AACO.js} +2 -2
  12. package/client-dist/{chunk-RL3RCDZ6.js → chunk-4GBTGROS.js} +2 -2
  13. package/client-dist/{chunk-2QO3J3CG.js → chunk-4HYC2OQP.js} +2 -2
  14. package/client-dist/{chunk-XD7D4OE5.js → chunk-4UVXQUK7.js} +2 -2
  15. package/client-dist/{chunk-P6QZ2F7A.js → chunk-5VAPWYHT.js} +2 -2
  16. package/client-dist/{chunk-B2ZOJEU2.js → chunk-5YYFP3K4.js} +2 -2
  17. package/client-dist/{chunk-TXOMYIKQ.js → chunk-6DI6TTLH.js} +2 -2
  18. package/client-dist/{chunk-DYVONEIU.js → chunk-6S67EM2E.js} +2 -2
  19. package/client-dist/{chunk-P36CQIM4.js → chunk-A3SVMYCA.js} +2 -2
  20. package/client-dist/{chunk-AXX3DVLC.js → chunk-AH3DHRBU.js} +2 -2
  21. package/client-dist/{chunk-3FE7PGC3.js → chunk-AHZLIVHV.js} +2 -2
  22. package/client-dist/{chunk-YUACUATN.js → chunk-BEJFX7HS.js} +2 -2
  23. package/client-dist/{chunk-Z5Y2UZ7E.js → chunk-BKICQS7D.js} +2 -2
  24. package/client-dist/{chunk-T2EOKDUV.js → chunk-BNWGUIZH.js} +2 -2
  25. package/client-dist/{chunk-W7MZHUSV.js → chunk-C6DGCFHL.js} +2 -2
  26. package/client-dist/{chunk-Y3VHRAYW.js → chunk-CORKSPL3.js} +2 -2
  27. package/client-dist/{chunk-XMUO7FLZ.js → chunk-ELLKS37C.js} +2 -2
  28. package/client-dist/{chunk-XC5AQG22.js → chunk-GARB57PP.js} +2 -2
  29. package/client-dist/{chunk-WC2UW6PS.js → chunk-GD5V3BWU.js} +2 -2
  30. package/client-dist/{chunk-NT2WYDN4.js → chunk-GGZ3SJBD.js} +2 -2
  31. package/client-dist/{chunk-XXHJIU7S.js → chunk-GVS2YOQS.js} +2 -2
  32. package/client-dist/{chunk-F6RI5ZAG.js → chunk-IF5JBBPU.js} +2 -2
  33. package/client-dist/{chunk-5PQJXAIN.js → chunk-IFXJIKH4.js} +2 -2
  34. package/client-dist/{chunk-6MLUBVOE.js → chunk-J5HUXXKW.js} +2 -2
  35. package/client-dist/{chunk-DJF2VBVO.js → chunk-JJILMXI4.js} +2 -2
  36. package/client-dist/{chunk-OQZXITHN.js → chunk-JLKTCB3H.js} +2 -2
  37. package/client-dist/{chunk-I6G47UYO.js → chunk-K6PYNZ2O.js} +2 -2
  38. package/client-dist/{chunk-P6MJWUPR.js → chunk-L45QVZNT.js} +2 -2
  39. package/client-dist/{chunk-3MEI6XWH.js → chunk-LRVS6OH7.js} +2 -2
  40. package/client-dist/{chunk-AK3BNMCA.js → chunk-LWSSRQ3A.js} +2 -2
  41. package/client-dist/{chunk-AK3BNMCA.js.map → chunk-LWSSRQ3A.js.map} +1 -1
  42. package/client-dist/{chunk-U6IIUTJZ.js → chunk-M5QA3SHD.js} +2 -2
  43. package/client-dist/{chunk-IIEGH2OL.js → chunk-MELUJSKX.js} +2 -2
  44. package/client-dist/{chunk-AAPCOMPW.js → chunk-ODVR6BGX.js} +2 -2
  45. package/client-dist/{chunk-MGGCILJ5.js → chunk-P7KKKTL2.js} +2 -2
  46. package/client-dist/{chunk-NSIWA2P5.js → chunk-PGHUXL7M.js} +2 -2
  47. package/client-dist/{chunk-SH7ZW4NP.js → chunk-QMB5YYMP.js} +2 -2
  48. package/client-dist/{chunk-VFWKI2WS.js → chunk-QMLTSA2U.js} +2 -2
  49. package/client-dist/{chunk-5BGMJCRT.js → chunk-RM7ASQRB.js} +2 -2
  50. package/client-dist/{chunk-N2SCVGDO.js → chunk-SFPWMV4C.js} +2 -2
  51. package/client-dist/{chunk-HM7DY6UV.js → chunk-SQOIJHU2.js} +2 -2
  52. package/client-dist/{chunk-M6ORAXIW.js → chunk-SX4OPQOG.js} +2 -2
  53. package/client-dist/{chunk-YE64CYNH.js → chunk-TRPAJFTF.js} +2 -2
  54. package/client-dist/{chunk-5CADRWU5.js → chunk-VE3FJJKW.js} +2 -2
  55. package/client-dist/chunk-VF52FVGQ.js +2 -0
  56. package/client-dist/chunk-VF52FVGQ.js.map +7 -0
  57. package/client-dist/{chunk-QS6XFT7T.js → chunk-VFHCDW6E.js} +2 -2
  58. package/client-dist/{chunk-DQRB55V3.js → chunk-VGOZI4SO.js} +2 -2
  59. package/client-dist/{chunk-LZYMECRL.js → chunk-WHDFCYAN.js} +2 -2
  60. package/client-dist/{chunk-2TXJ5BO3.js → chunk-X3QENSK2.js} +2 -2
  61. package/client-dist/{chunk-FWNDCHJM.js → chunk-X6HOES7C.js} +2 -2
  62. package/client-dist/{chunk-IZRPUBEE.js → chunk-YVTCB6RZ.js} +2 -2
  63. package/client-dist/{chunk-UUDXW5EL.js → chunk-ZHDALAGY.js} +2 -2
  64. package/client-dist/{chunk-D6TGZGT7.js → chunk-ZLECQVI2.js} +2 -2
  65. package/client-dist/{consultant.module-N6CGRTHN.js → consultant.module-KVCB3EXV.js} +2 -2
  66. package/client-dist/{crd.module-36J4VUON.js → crd.module-HWDVQ4LB.js} +2 -2
  67. package/client-dist/{dashboard.module-TVKAHKR3.js → dashboard.module-6532542W.js} +2 -2
  68. package/client-dist/{do.module-M7SNUPVI.js → do.module-K7DGAE6J.js} +2 -2
  69. package/client-dist/{document-library.module-IKC7DCTI.js → document-library.module-5PBZBOIV.js} +2 -2
  70. package/client-dist/{embedding-eval.module-VL6J4ZCI.js → embedding-eval.module-4XSMCPIW.js} +2 -2
  71. package/client-dist/{embedding-registry.module-Q2WZRU3K.js → embedding-registry.module-J47MLCE3.js} +2 -2
  72. package/client-dist/{err.module-7YLG3OV6.js → err.module-KNLO27W5.js} +2 -2
  73. package/client-dist/{feedback.module-5PJ3LOA3.js → feedback.module-75TQM2HT.js} +2 -2
  74. package/client-dist/{host-runtime-mcp.module-VUUXJQS7.js → host-runtime-mcp.module-GIV6LCON.js} +2 -2
  75. package/client-dist/index.html +1 -1
  76. package/client-dist/{live-dev-pipeline.module-KVQ7K2SJ.js → live-dev-pipeline.module-KDYKMMQA.js} +2 -2
  77. package/client-dist/{logs.module-GNHHW5XH.js → logs.module-TJ5EVO53.js} +2 -2
  78. package/client-dist/{main-2OE2UCH6.js → main-IEMAKLQQ.js} +3 -3
  79. package/client-dist/{master-control-remote-poc.module-KBXMAL7D.js → master-control-remote-poc.module-HPBO2HKG.js} +2 -2
  80. package/client-dist/{mobile-app.module-ZMM7CQUN.js → mobile-app.module-B7IYEBLK.js} +2 -2
  81. package/client-dist/{model-registry.module-FVNT2TBF.js → model-registry.module-F7NALYFC.js} +2 -2
  82. package/client-dist/{oc.module-HSQPGOOX.js → oc.module-ZOE5BKKI.js} +2 -2
  83. package/client-dist/{orc.module-GBE5Y3RI.js → orc.module-DMTAUMB7.js} +2 -2
  84. package/client-dist/{project-management.module-GPNAW3AY.js → project-management.module-FYYKWANX.js} +2 -2
  85. package/client-dist/project-source-routed.module-YXGEVEQO.js +2 -0
  86. package/client-dist/{scheduler.module-DW4EYAR2.js → scheduler.module-EKCXZSJE.js} +2 -2
  87. package/client-dist/{session.module-AWT5X47Z.js → session.module-RPW52W7E.js} +2 -2
  88. package/client-dist/{set.module-N37ZINNA.js → set.module-FSYBKXJH.js} +2 -2
  89. package/client-dist/{setup.module-PQWUPHUH.js → setup.module-KYXEAHED.js} +2 -2
  90. package/client-dist/{terminals.module-DLDEEM7F.js → terminals.module-MMQYWXQZ.js} +2 -2
  91. package/client-dist/{voice-notes-poc.module-ZACIDBJW.js → voice-notes-poc.module-YABLQUOL.js} +2 -2
  92. package/client-dist/{wfs.module-E65F3UFA.js → wfs.module-7W5WA5SV.js} +2 -2
  93. package/package.json +1 -1
  94. package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account-route.control-service.d.ts +42 -0
  95. package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account-route.control-service.d.ts.map +1 -1
  96. package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account-route.control-service.js +27 -0
  97. package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account-route.control-service.js.map +1 -1
  98. package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account.controller.d.ts.map +1 -1
  99. package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account.controller.js +43 -0
  100. package/server/build/src/_modules/external-sessions/_modules/claude-code/_routes/cc-account/cc-account.controller.js.map +1 -1
  101. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-identity-backfill.control-service.d.ts +54 -0
  102. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-identity-backfill.control-service.d.ts.map +1 -0
  103. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-identity-backfill.control-service.js +175 -0
  104. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-identity-backfill.control-service.js.map +1 -0
  105. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-pool.control-service.d.ts +21 -0
  106. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-pool.control-service.d.ts.map +1 -1
  107. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-pool.control-service.js +70 -0
  108. package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/account/cc-account-pool.control-service.js.map +1 -1
  109. package/server/build/src/app.server.d.ts.map +1 -1
  110. package/server/build/src/app.server.js +8 -0
  111. package/server/build/src/app.server.js.map +1 -1
  112. package/client-dist/cc-usage-dashboard.component-755E2TLE.js +0 -2
  113. package/client-dist/cc-usage-dashboard.component-755E2TLE.js.map +0 -7
  114. package/client-dist/chunk-B7LOJGT4.js +0 -2
  115. package/client-dist/chunk-B7LOJGT4.js.map +0 -7
  116. package/client-dist/project-source-routed.module-CUPC5MOO.js +0 -2
  117. /package/client-dist/{agent-instances.module-SQX3OI47.js.map → agent-instances.module-T5NZHTUX.js.map} +0 -0
  118. /package/client-dist/{ca.module-U57DTU3K.js.map → ca.module-FQELCJHL.js.map} +0 -0
  119. /package/client-dist/{cc.module-HQSFTBH2.js.map → cc.module-BD3QY5IC.js.map} +0 -0
  120. /package/client-dist/{chunk-AUHXM2NG.js.map → chunk-2KA2U2YX.js.map} +0 -0
  121. /package/client-dist/{chunk-ZHQ4IVXL.js.map → chunk-2OCS2YB5.js.map} +0 -0
  122. /package/client-dist/{chunk-SRM3VZ3S.js.map → chunk-2RW3Z32T.js.map} +0 -0
  123. /package/client-dist/{chunk-ROCS3SA6.js.map → chunk-2W2KDWV6.js.map} +0 -0
  124. /package/client-dist/{chunk-YXVUSYU3.js.map → chunk-36ZBT2CJ.js.map} +0 -0
  125. /package/client-dist/{chunk-ZWK2P7RI.js.map → chunk-42N2AACO.js.map} +0 -0
  126. /package/client-dist/{chunk-RL3RCDZ6.js.map → chunk-4GBTGROS.js.map} +0 -0
  127. /package/client-dist/{chunk-2QO3J3CG.js.map → chunk-4HYC2OQP.js.map} +0 -0
  128. /package/client-dist/{chunk-XD7D4OE5.js.map → chunk-4UVXQUK7.js.map} +0 -0
  129. /package/client-dist/{chunk-P6QZ2F7A.js.map → chunk-5VAPWYHT.js.map} +0 -0
  130. /package/client-dist/{chunk-B2ZOJEU2.js.map → chunk-5YYFP3K4.js.map} +0 -0
  131. /package/client-dist/{chunk-TXOMYIKQ.js.map → chunk-6DI6TTLH.js.map} +0 -0
  132. /package/client-dist/{chunk-DYVONEIU.js.map → chunk-6S67EM2E.js.map} +0 -0
  133. /package/client-dist/{chunk-P36CQIM4.js.map → chunk-A3SVMYCA.js.map} +0 -0
  134. /package/client-dist/{chunk-AXX3DVLC.js.map → chunk-AH3DHRBU.js.map} +0 -0
  135. /package/client-dist/{chunk-3FE7PGC3.js.map → chunk-AHZLIVHV.js.map} +0 -0
  136. /package/client-dist/{chunk-YUACUATN.js.map → chunk-BEJFX7HS.js.map} +0 -0
  137. /package/client-dist/{chunk-Z5Y2UZ7E.js.map → chunk-BKICQS7D.js.map} +0 -0
  138. /package/client-dist/{chunk-T2EOKDUV.js.map → chunk-BNWGUIZH.js.map} +0 -0
  139. /package/client-dist/{chunk-W7MZHUSV.js.map → chunk-C6DGCFHL.js.map} +0 -0
  140. /package/client-dist/{chunk-Y3VHRAYW.js.map → chunk-CORKSPL3.js.map} +0 -0
  141. /package/client-dist/{chunk-XMUO7FLZ.js.map → chunk-ELLKS37C.js.map} +0 -0
  142. /package/client-dist/{chunk-XC5AQG22.js.map → chunk-GARB57PP.js.map} +0 -0
  143. /package/client-dist/{chunk-WC2UW6PS.js.map → chunk-GD5V3BWU.js.map} +0 -0
  144. /package/client-dist/{chunk-NT2WYDN4.js.map → chunk-GGZ3SJBD.js.map} +0 -0
  145. /package/client-dist/{chunk-XXHJIU7S.js.map → chunk-GVS2YOQS.js.map} +0 -0
  146. /package/client-dist/{chunk-F6RI5ZAG.js.map → chunk-IF5JBBPU.js.map} +0 -0
  147. /package/client-dist/{chunk-5PQJXAIN.js.map → chunk-IFXJIKH4.js.map} +0 -0
  148. /package/client-dist/{chunk-6MLUBVOE.js.map → chunk-J5HUXXKW.js.map} +0 -0
  149. /package/client-dist/{chunk-DJF2VBVO.js.map → chunk-JJILMXI4.js.map} +0 -0
  150. /package/client-dist/{chunk-OQZXITHN.js.map → chunk-JLKTCB3H.js.map} +0 -0
  151. /package/client-dist/{chunk-I6G47UYO.js.map → chunk-K6PYNZ2O.js.map} +0 -0
  152. /package/client-dist/{chunk-P6MJWUPR.js.map → chunk-L45QVZNT.js.map} +0 -0
  153. /package/client-dist/{chunk-3MEI6XWH.js.map → chunk-LRVS6OH7.js.map} +0 -0
  154. /package/client-dist/{chunk-U6IIUTJZ.js.map → chunk-M5QA3SHD.js.map} +0 -0
  155. /package/client-dist/{chunk-IIEGH2OL.js.map → chunk-MELUJSKX.js.map} +0 -0
  156. /package/client-dist/{chunk-AAPCOMPW.js.map → chunk-ODVR6BGX.js.map} +0 -0
  157. /package/client-dist/{chunk-MGGCILJ5.js.map → chunk-P7KKKTL2.js.map} +0 -0
  158. /package/client-dist/{chunk-NSIWA2P5.js.map → chunk-PGHUXL7M.js.map} +0 -0
  159. /package/client-dist/{chunk-SH7ZW4NP.js.map → chunk-QMB5YYMP.js.map} +0 -0
  160. /package/client-dist/{chunk-VFWKI2WS.js.map → chunk-QMLTSA2U.js.map} +0 -0
  161. /package/client-dist/{chunk-5BGMJCRT.js.map → chunk-RM7ASQRB.js.map} +0 -0
  162. /package/client-dist/{chunk-N2SCVGDO.js.map → chunk-SFPWMV4C.js.map} +0 -0
  163. /package/client-dist/{chunk-HM7DY6UV.js.map → chunk-SQOIJHU2.js.map} +0 -0
  164. /package/client-dist/{chunk-M6ORAXIW.js.map → chunk-SX4OPQOG.js.map} +0 -0
  165. /package/client-dist/{chunk-YE64CYNH.js.map → chunk-TRPAJFTF.js.map} +0 -0
  166. /package/client-dist/{chunk-5CADRWU5.js.map → chunk-VE3FJJKW.js.map} +0 -0
  167. /package/client-dist/{chunk-QS6XFT7T.js.map → chunk-VFHCDW6E.js.map} +0 -0
  168. /package/client-dist/{chunk-DQRB55V3.js.map → chunk-VGOZI4SO.js.map} +0 -0
  169. /package/client-dist/{chunk-LZYMECRL.js.map → chunk-WHDFCYAN.js.map} +0 -0
  170. /package/client-dist/{chunk-2TXJ5BO3.js.map → chunk-X3QENSK2.js.map} +0 -0
  171. /package/client-dist/{chunk-FWNDCHJM.js.map → chunk-X6HOES7C.js.map} +0 -0
  172. /package/client-dist/{chunk-IZRPUBEE.js.map → chunk-YVTCB6RZ.js.map} +0 -0
  173. /package/client-dist/{chunk-UUDXW5EL.js.map → chunk-ZHDALAGY.js.map} +0 -0
  174. /package/client-dist/{chunk-D6TGZGT7.js.map → chunk-ZLECQVI2.js.map} +0 -0
  175. /package/client-dist/{consultant.module-N6CGRTHN.js.map → consultant.module-KVCB3EXV.js.map} +0 -0
  176. /package/client-dist/{crd.module-36J4VUON.js.map → crd.module-HWDVQ4LB.js.map} +0 -0
  177. /package/client-dist/{dashboard.module-TVKAHKR3.js.map → dashboard.module-6532542W.js.map} +0 -0
  178. /package/client-dist/{do.module-M7SNUPVI.js.map → do.module-K7DGAE6J.js.map} +0 -0
  179. /package/client-dist/{document-library.module-IKC7DCTI.js.map → document-library.module-5PBZBOIV.js.map} +0 -0
  180. /package/client-dist/{embedding-eval.module-VL6J4ZCI.js.map → embedding-eval.module-4XSMCPIW.js.map} +0 -0
  181. /package/client-dist/{embedding-registry.module-Q2WZRU3K.js.map → embedding-registry.module-J47MLCE3.js.map} +0 -0
  182. /package/client-dist/{err.module-7YLG3OV6.js.map → err.module-KNLO27W5.js.map} +0 -0
  183. /package/client-dist/{feedback.module-5PJ3LOA3.js.map → feedback.module-75TQM2HT.js.map} +0 -0
  184. /package/client-dist/{host-runtime-mcp.module-VUUXJQS7.js.map → host-runtime-mcp.module-GIV6LCON.js.map} +0 -0
  185. /package/client-dist/{live-dev-pipeline.module-KVQ7K2SJ.js.map → live-dev-pipeline.module-KDYKMMQA.js.map} +0 -0
  186. /package/client-dist/{logs.module-GNHHW5XH.js.map → logs.module-TJ5EVO53.js.map} +0 -0
  187. /package/client-dist/{main-2OE2UCH6.js.map → main-IEMAKLQQ.js.map} +0 -0
  188. /package/client-dist/{master-control-remote-poc.module-KBXMAL7D.js.map → master-control-remote-poc.module-HPBO2HKG.js.map} +0 -0
  189. /package/client-dist/{mobile-app.module-ZMM7CQUN.js.map → mobile-app.module-B7IYEBLK.js.map} +0 -0
  190. /package/client-dist/{model-registry.module-FVNT2TBF.js.map → model-registry.module-F7NALYFC.js.map} +0 -0
  191. /package/client-dist/{oc.module-HSQPGOOX.js.map → oc.module-ZOE5BKKI.js.map} +0 -0
  192. /package/client-dist/{orc.module-GBE5Y3RI.js.map → orc.module-DMTAUMB7.js.map} +0 -0
  193. /package/client-dist/{project-management.module-GPNAW3AY.js.map → project-management.module-FYYKWANX.js.map} +0 -0
  194. /package/client-dist/{project-source-routed.module-CUPC5MOO.js.map → project-source-routed.module-YXGEVEQO.js.map} +0 -0
  195. /package/client-dist/{scheduler.module-DW4EYAR2.js.map → scheduler.module-EKCXZSJE.js.map} +0 -0
  196. /package/client-dist/{session.module-AWT5X47Z.js.map → session.module-RPW52W7E.js.map} +0 -0
  197. /package/client-dist/{set.module-N37ZINNA.js.map → set.module-FSYBKXJH.js.map} +0 -0
  198. /package/client-dist/{setup.module-PQWUPHUH.js.map → setup.module-KYXEAHED.js.map} +0 -0
  199. /package/client-dist/{terminals.module-DLDEEM7F.js.map → terminals.module-MMQYWXQZ.js.map} +0 -0
  200. /package/client-dist/{voice-notes-poc.module-ZACIDBJW.js.map → voice-notes-poc.module-YABLQUOL.js.map} +0 -0
  201. /package/client-dist/{wfs.module-E65F3UFA.js.map → wfs.module-7W5WA5SV.js.map} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["src/app/_modules/external-sessions/_modules/claude-code/_services/cc-account.api-service.ts", "src/app/_modules/external-sessions/_modules/claude-code/_services/cc-account.data-service.ts", "src/app/_modules/external-sessions/_modules/claude-code/_collections/cc-account-usage-chart.util.ts", "src/app/_modules/external-sessions/_modules/claude-code/_components/cc-account-usage-view/cc-account-usage-view.component.ts", "src/app/_modules/external-sessions/_modules/claude-code/_components/cc-account-usage-view/cc-account-usage-view.component.html"],
4
+ "sourcesContent": ["import { inject, Injectable } from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\n\nimport { firstValueFrom } from 'rxjs';\n\nimport { CC_Account_Response } from '../_models/interfaces/cc-account.interface';\nimport { CC_AccountUsageEvent_Response } from '../_models/interfaces/cc-account-usage-event.interface';\nimport {\n CC_AccountInstanceMapping_Response,\n CC_AccountUsageState_Response,\n} from '../_models/interfaces/cc-account-usage-state.interface';\nimport { CC_AccountIdentityList_Response } from '../_models/interfaces/cc-account-identity-group.interface';\nimport { environment } from '../../../../../../environments/environment';\n\n/**\n * CC Account REST API service (REQ-CC-USAGE-DASHBOARD-001 Slice 5 cycle 856).\n *\n * HTTP-bridge a server-oldali `CC_Account_Controller` endpoint-jaihoz\n * (`/cc-account/*`). Egyszerű thin api-service mintán a\n * `cc-cci-instance-data.api-service.ts`-hez hasonlóan: minden hívás\n * `firstValueFrom`-mal Promise-ra fordított `HttpClient` get/post/patch.\n *\n * A Slice 5+ Dashboard komponensek és a Slice 6 instance-mapping view\n * data-service-en keresztül használja.\n */\n@Injectable({ providedIn: 'root' })\nexport class CC_Account_ApiService {\n\n private readonly baseUrl: string = `${environment.api.baseUrl}/cc-account`;\n\n private readonly http: HttpClient = inject(HttpClient);\n\n /** GET /cc-account/list — cross-instance account-lista. */\n listAccounts(): Promise<{ items: CC_Account_Response[] }> {\n return firstValueFrom(\n this.http.get<{ items: CC_Account_Response[] }>(`${this.baseUrl}/list`),\n );\n }\n\n /**\n * GET /cc-account/list-by-identity — REQ-CC-ACCOUNT-IDENTITY-EMAIL-001 Slice 3\n * part-1 (cycle 890): account-lista accountIdentity szerint csoportosítva.\n * A Dashboard ezt használja a per-email view-hoz (a token-rotation\n * duplikátumok egyetlen kártyán).\n */\n listAccountsByIdentity(): Promise<CC_AccountIdentityList_Response> {\n return firstValueFrom(\n this.http.get<CC_AccountIdentityList_Response>(`${this.baseUrl}/list-by-identity`),\n );\n }\n\n /**\n * POST /cc-account/backfill-identity — REQ-CC-ACCOUNT-IDENTITY-EMAIL-001\n * Slice 2 (cycle 889): manuális identity-backfill trigger.\n */\n backfillIdentity(): Promise<{\n totalScanned: number;\n alreadyPopulated: number;\n populated: number;\n skippedMissingFile: number;\n skippedInvalidPayload: number;\n failures: number;\n }> {\n return firstValueFrom(\n this.http.post<{\n totalScanned: number;\n alreadyPopulated: number;\n populated: number;\n skippedMissingFile: number;\n skippedInvalidPayload: number;\n failures: number;\n }>(`${this.baseUrl}/backfill-identity`, {}),\n );\n }\n\n /**\n * GET /cc-account/identity-audit — REQ-CC-ACCOUNT-IDENTITY-EMAIL-001 Slice 2\n * (cycle 889): identity-duplikáció audit.\n */\n auditIdentityDuplicates(): Promise<{\n duplicateGroups: { accountIdentity: string; accountKeys: string[]; count: number }[];\n totalDuplicates: number;\n uniqueIdentities: number;\n recordsWithoutIdentity: number;\n }> {\n return firstValueFrom(\n this.http.get<{\n duplicateGroups: { accountIdentity: string; accountKeys: string[]; count: number }[];\n totalDuplicates: number;\n uniqueIdentities: number;\n recordsWithoutIdentity: number;\n }>(`${this.baseUrl}/identity-audit`),\n );\n }\n\n /** POST /cc-account/refresh — a hívó CCAP instance-en credential-discovery újrafutás. */\n refreshLocalAccounts(): Promise<{ refreshedKeys: string[]; scannedPaths: number }> {\n return firstValueFrom(\n this.http.post<{ refreshedKeys: string[]; scannedPaths: number }>(\n `${this.baseUrl}/refresh`,\n {},\n ),\n );\n }\n\n /**\n * GET /cc-account/instance-mapping — Slice 4 cross-instance aggregate.\n * Minden ismert CCAP instance group-by lastObservedByCcapId — melyik account-okat\n * látta utoljára.\n */\n getInstanceMapping(): Promise<CC_AccountInstanceMapping_Response> {\n return firstValueFrom(\n this.http.get<CC_AccountInstanceMapping_Response>(`${this.baseUrl}/instance-mapping`),\n );\n }\n\n /** GET /cc-account/:accountKey — egy account részletek. */\n getAccount(accountKey: string): Promise<CC_Account_Response> {\n return firstValueFrom(\n this.http.get<CC_Account_Response>(`${this.baseUrl}/${accountKey}`),\n );\n }\n\n /**\n * GET /cc-account/:accountKey/usage — Slice 3 per-account usage state-ek.\n * 0..5 rekord (egy windowType-onként).\n */\n getAccountUsage(accountKey: string): Promise<{ items: CC_AccountUsageState_Response[] }> {\n return firstValueFrom(\n this.http.get<{ items: CC_AccountUsageState_Response[] }>(\n `${this.baseUrl}/${accountKey}/usage`,\n ),\n );\n }\n\n /**\n * GET /cc-account/:accountKey/usage-history — történeti event-lista\n * (REQ-CC-USAGE-DASHBOARD-001 cycle 879). Append-only timeline; opcionális\n * windowType + idő-tartomány szűrők (`fromMs`, `toMs`).\n */\n getAccountUsageHistory(params: {\n accountKey: string;\n windowType?: string;\n fromMs?: number;\n toMs?: number;\n }): Promise<{ items: CC_AccountUsageEvent_Response[] }> {\n const query: string[] = [];\n if (params.windowType != null && params.windowType !== '') {\n query.push(`windowType=${encodeURIComponent(params.windowType)}`);\n }\n if (params.fromMs != null) {\n query.push(`fromMs=${params.fromMs}`);\n }\n if (params.toMs != null) {\n query.push(`toMs=${params.toMs}`);\n }\n const qs: string = query.length > 0 ? `?${query.join('&')}` : '';\n return firstValueFrom(\n this.http.get<{ items: CC_AccountUsageEvent_Response[] }>(\n `${this.baseUrl}/${params.accountKey}/usage-history${qs}`,\n ),\n );\n }\n\n /**\n * POST /cc-account/:accountKey/refresh-usage — aktív Anthropic usage-pull\n * (REQ-CC-USAGE-DASHBOARD-001 cycle 873). A server credential-fájl + Bearer-rel\n * hív, az 5 window state-et upsert-eli, profile-mezőket (email/orgId/planTier)\n * a CC_Account-ba updateli, socket-broadcast.\n */\n refreshAccountUsage(accountKey: string): Promise<{ status: string; windowsUpserted: number; email: string | null }> {\n return firstValueFrom(\n this.http.post<{ status: string; windowsUpserted: number; email: string | null }>(\n `${this.baseUrl}/${accountKey}/refresh-usage`,\n {},\n ),\n );\n }\n\n /**\n * PATCH /cc-account/:accountKey — user-editable mezők frissítése (cycle 876):\n * `displayName` és/vagy `email`. Mindkettő opcionális; legalább egy kell.\n * `email: null` (vagy üres string) → kitörli (clear). Server-side validáció:\n * displayName 200-char + control-char tiltás, email RFC alap-formátum + 320-char.\n */\n renameAccount(params: {\n accountKey: string;\n displayName?: string;\n email?: string | null;\n }): Promise<CC_Account_Response> {\n const body: Record<string, unknown> = {};\n if (params.displayName !== undefined) {\n body.displayName = params.displayName;\n }\n if (params.email !== undefined) {\n body.email = params.email;\n }\n return firstValueFrom(\n this.http.patch<CC_Account_Response>(\n `${this.baseUrl}/${params.accountKey}`,\n body,\n ),\n );\n }\n}\n", "import { inject, Injectable, NgZone, OnDestroy, signal } from '@angular/core';\nimport { Subscription } from 'rxjs';\n\nimport { CCAP_Socket_ControlService } from '../../../../../_services/control-services/ccap-socket.control-service';\nimport { CC_Account_ApiService } from './cc-account.api-service';\nimport { CC_Account_Response } from '../_models/interfaces/cc-account.interface';\nimport { CC_AccountUsageEvent_Response } from '../_models/interfaces/cc-account-usage-event.interface';\nimport {\n CC_AccountInstanceMapping_Response,\n CC_AccountUsageState_Response,\n} from '../_models/interfaces/cc-account-usage-state.interface';\nimport {\n CC_AccountIdentityGroup_Response,\n} from '../_models/interfaces/cc-account-identity-group.interface';\n\n/** Socket envelope shape — `CCAP_Socket_ControlService.event$` Subject közvetíti. */\ninterface SocketEnvelope_Interface {\n event: string;\n payload: Record<string, unknown>;\n}\n\n/** REQ-CC-USAGE-DASHBOARD-001 Slice 6 second-half: socket event nevek. */\nconst SOCKET_EVENT_CC_ACCOUNT_USAGE_UPDATE: string = 'cc:account-usage-update';\nconst SOCKET_EVENT_CC_ACCOUNT_LIST_UPDATE: string = 'cc:account-list-update';\n\n/**\n * CC Account Dashboard data service (REQ-CC-USAGE-DASHBOARD-001 Slice 5 cycle 857).\n *\n * SSOT a Slice 5+ Dashboard kliens-oldali state-jéhez. Signal-ek a komponensek\n * change-detection-jéhez (`accounts_$`, `accountUsageMap_$`, `instanceMapping_$`,\n * `isLoading_$`, `loadError_$`); async metódusok REST hívásokhoz a\n * `CC_Account_ApiService`-en át (cycle 856).\n *\n * NEM perzisztál (a backend DBNT a SSOT) — a kliens csak cache-eli a fetch-eket\n * a komponens élettartam alatt. Refresh: explicit user-action (`refreshAccounts`)\n * vagy szocket-event (Slice 6).\n */\n@Injectable({ providedIn: 'root' })\nexport class CC_Account_DataService implements OnDestroy {\n\n private readonly account_AS: CC_Account_ApiService = inject(CC_Account_ApiService);\n private readonly socket_CS: CCAP_Socket_ControlService = inject(CCAP_Socket_ControlService);\n private readonly ngZone: NgZone = inject(NgZone);\n\n /** Socket envelope subscription élettartam-kezelése. */\n private socketSubscription: Subscription | null = null;\n\n /** Cross-instance account-lista (a `listAccounts` REST eredménye). */\n readonly accounts_$ = signal<CC_Account_Response[]>([]);\n\n /**\n * Per-account usage state cache: `accountKey → usage-state[]` (5 windowType-onként\n * egy rekord max). A Slice 5 Dashboard account-card-ok ebből rendernek.\n */\n readonly accountUsageMap_$ = signal<Map<string, CC_AccountUsageState_Response[]>>(\n new Map(),\n );\n\n /** Cross-instance aggregate (Slice 4 instance-mapping endpoint cache). */\n readonly instanceMapping_$ = signal<CC_AccountInstanceMapping_Response | null>(null);\n\n /**\n * Per-account usage-history cache: `accountKey → event[]` (REQ-CC-USAGE-DASHBOARD-001\n * cycle 879). Append-only timeline a `ccap_cc_account_usage_event` collection-ből;\n * lazy-loaded a Dashboard expand-panel megnyitásakor.\n */\n readonly usageHistoryMap_$ = signal<Map<string, CC_AccountUsageEvent_Response[]>>(\n new Map(),\n );\n\n /**\n * REQ-CC-ACCOUNT-IDENTITY-EMAIL-001 Slice 3 part-1 (cycle 890): identity-\n * csoportosított account-lista — per-email view a Dashboard-on. A\n * `accounts_$` (raw rekordok, duplikátumokkal) MELLETT él; a Dashboard a\n * `identityGroups_$`-ot rendereli (egy kártya / identity), az `accounts_$`\n * audit / admin-célokra megmarad.\n */\n readonly identityGroups_$ = signal<CC_AccountIdentityGroup_Response[]>([]);\n\n /** Bármelyik load folyamatban-e (UI spinner-hez). */\n readonly isLoading_$ = signal<boolean>(false);\n\n /** Utolsó load hiba — null ha sikeres vagy nem futott. */\n readonly loadError_$ = signal<string | null>(null);\n\n /**\n * Bootstrap fetch: account-list + instance-mapping párhuzamosan, majd a\n * megismert account-okhoz az 5 windowType-os usage state-eket is lehúzzuk\n * (REQ-CC-USAGE-DASHBOARD-001 cycle 883). Ez biztosítja, hogy a Dashboard\n * megnyitásakor azonnal látszanak az utolsó perzisztált usage értékek —\n * nem kell auto-pull socket-eventre vagy manuális Pull-clickre várni.\n */\n async loadDashboardBootstrap(): Promise<void> {\n this.isLoading_$.set(true);\n this.loadError_$.set(null);\n try {\n // REQ-CC-ACCOUNT-IDENTITY-EMAIL-001 Slice 3 part-1 (cycle 890): a Dashboard\n // most az identity-group endpoint-ot is használja a per-email view-hoz.\n // Párhuzamosan az accountsList + instance-mapping + identity-groups.\n const [accountsResp, mappingResp, groupsResp] = await Promise.all([\n this.account_AS.listAccounts(),\n this.account_AS.getInstanceMapping(),\n this.account_AS.listAccountsByIdentity(),\n ]);\n this.accounts_$.set(accountsResp.items);\n this.instanceMapping_$.set(mappingResp);\n this.identityGroups_$.set(groupsResp.groups);\n // A `accountUsageMap_$` cache-be a group merged-usage-eket is beleírjuk\n // — a `<app-cc-account-usage-view [accountKey]>` komponens (per identity-group\n // a primary.accountKey-vel) ezt olvassa.\n const nextMap: Map<string, CC_AccountUsageState_Response[]> = new Map(this.accountUsageMap_$());\n for (const group of groupsResp.groups) {\n nextMap.set(group.primary.accountKey, group.mergedUsage);\n }\n this.accountUsageMap_$.set(nextMap);\n } catch (err: unknown) {\n this.loadError_$.set(this.errorMessageOf(err));\n } finally {\n this.isLoading_$.set(false);\n }\n }\n\n /**\n * REQ-CC-ACCOUNT-IDENTITY-EMAIL-001 Slice 3 part-1 (cycle 890): csak az\n * identity-groups refetch-je (a refresh-after-pull / list-update szocketnél).\n */\n async loadIdentityGroups(): Promise<void> {\n try {\n const resp = await this.account_AS.listAccountsByIdentity();\n this.identityGroups_$.set(resp.groups);\n // Merged-usage cache update is.\n const nextMap: Map<string, CC_AccountUsageState_Response[]> = new Map(this.accountUsageMap_$());\n for (const group of resp.groups) {\n nextMap.set(group.primary.accountKey, group.mergedUsage);\n }\n this.accountUsageMap_$.set(nextMap);\n } catch (err: unknown) {\n this.loadError_$.set(this.errorMessageOf(err));\n }\n }\n\n /** Csak az account-listát tölti újra (kis fetch). */\n async loadAccounts(): Promise<void> {\n try {\n const resp = await this.account_AS.listAccounts();\n this.accounts_$.set(resp.items);\n } catch (err: unknown) {\n this.loadError_$.set(this.errorMessageOf(err));\n }\n }\n\n /**\n * Per-account usage-state fetch + cache-be írás. A Slice 5 account-card\n * komponens ezt hívja a saját accountKey-jére.\n */\n async loadAccountUsage(accountKey: string): Promise<void> {\n try {\n const resp = await this.account_AS.getAccountUsage(accountKey);\n const next: Map<string, CC_AccountUsageState_Response[]> = new Map(this.accountUsageMap_$());\n next.set(accountKey, resp.items);\n this.accountUsageMap_$.set(next);\n } catch (err: unknown) {\n this.loadError_$.set(this.errorMessageOf(err));\n }\n }\n\n /**\n * Per-account usage-history fetch + cache-be írás (REQ-CC-USAGE-DASHBOARD-001\n * cycle 879). Lazy: a Dashboard expand-panel megnyitásakor hívjuk. Opcionális\n * windowType + idő-tartomány szűrőkkel.\n */\n async loadAccountUsageHistory(params: {\n accountKey: string;\n windowType?: string;\n fromMs?: number;\n toMs?: number;\n }): Promise<void> {\n try {\n const resp = await this.account_AS.getAccountUsageHistory(params);\n const next: Map<string, CC_AccountUsageEvent_Response[]> = new Map(this.usageHistoryMap_$());\n next.set(params.accountKey, resp.items);\n this.usageHistoryMap_$.set(next);\n } catch (err: unknown) {\n this.loadError_$.set(this.errorMessageOf(err));\n }\n }\n\n /** Cross-instance aggregate refetch (Slice 4 — Slice 6 view bootstrap-jánál). */\n async loadInstanceMapping(): Promise<void> {\n try {\n const resp = await this.account_AS.getInstanceMapping();\n this.instanceMapping_$.set(resp);\n } catch (err: unknown) {\n this.loadError_$.set(this.errorMessageOf(err));\n }\n }\n\n /**\n * Explicit user-trigger: a hívó CCAP instance-en credential-discovery újrafutás\n * + account-lista refetch. POST /refresh után automatikusan listAccounts-szal frissít.\n */\n async refreshAccounts(): Promise<{ refreshedKeys: string[]; scannedPaths: number }> {\n this.isLoading_$.set(true);\n this.loadError_$.set(null);\n try {\n const refreshResult = await this.account_AS.refreshLocalAccounts();\n await this.loadAccounts();\n return refreshResult;\n } catch (err: unknown) {\n this.loadError_$.set(this.errorMessageOf(err));\n return { refreshedKeys: [], scannedPaths: 0 };\n } finally {\n this.isLoading_$.set(false);\n }\n }\n\n /**\n * Aktív usage-pull egy adott account-ra (REQ-CC-USAGE-DASHBOARD-001 cycle 873).\n * A server `POST /cc-account/:accountKey/refresh-usage`-t hívja, ami az\n * Anthropic `/api/oauth/usage` endpoint-ját triggeri Bearer-rel. A pull\n * eredménye automatikusan jön socket-eventként (`cc:account-usage-update`),\n * de a sikeres POST után explicit re-fetch-eljük is az adott account usage-ét\n * + a teljes account-listát (a profile-mezők is updatelődtek).\n */\n async refreshAccountUsage(accountKey: string): Promise<{ status: string; windowsUpserted: number; email: string | null }> {\n try {\n const result = await this.account_AS.refreshAccountUsage(accountKey);\n // Re-fetch a friss state-et — bár a socket-event is jön, a cache-frissítés\n // garantált a user-action végén.\n await this.loadAccountUsage(accountKey);\n await this.loadAccounts();\n return result;\n } catch (err: unknown) {\n this.loadError_$.set(this.errorMessageOf(err));\n return { status: 'error', windowsUpserted: 0, email: null };\n }\n }\n\n /**\n * Display-name átírása + a cache-elt account-lista frissítése (a megfelelő\n * elem displayName mezőjének felülírása, signal-update).\n */\n async renameAccount(params: {\n accountKey: string;\n displayName?: string;\n email?: string | null;\n }): Promise<void> {\n try {\n const updated = await this.account_AS.renameAccount(params);\n const next: CC_Account_Response[] = this.accounts_$().map(\n (a): CC_Account_Response => (a.accountKey === params.accountKey ? updated : a),\n );\n this.accounts_$.set(next);\n } catch (err: unknown) {\n this.loadError_$.set(this.errorMessageOf(err));\n }\n }\n\n /**\n * Socket subscription init (REQ-CC-USAGE-DASHBOARD-001 Slice 6 second-half cycle 871).\n * A `CCAP_Socket_ControlService.event$` Subject minden socket-event-et közvetít\n * envelope-formában (event-name + payload). Mi az `cc:account-usage-update`\n * és `cc:account-list-update` event-ekre szűrünk és a megfelelő signal-eket frissítjük.\n *\n * Late subscription: a Dashboard component `ngOnInit`-jéből hívjuk (vagy explicit\n * service-init-kor), hogy ne legyen subscription-overhead, ha a Dashboard sose\n * nyílik meg.\n */\n startLiveUpdates(): void {\n if (this.socketSubscription != null) {\n return;\n }\n this.socketSubscription = this.socket_CS.event$.subscribe(\n (envelope: SocketEnvelope_Interface): void => {\n this.ngZone.run((): void => {\n if (envelope.event === SOCKET_EVENT_CC_ACCOUNT_USAGE_UPDATE) {\n this.handleAccountUsageUpdate(envelope.payload);\n } else if (envelope.event === SOCKET_EVENT_CC_ACCOUNT_LIST_UPDATE) {\n this.handleAccountListUpdate(envelope.payload);\n }\n });\n },\n );\n }\n\n /** Socket subscription teardown (component destroy / explicit stop). */\n stopLiveUpdates(): void {\n if (this.socketSubscription != null) {\n this.socketSubscription.unsubscribe();\n this.socketSubscription = null;\n }\n }\n\n ngOnDestroy(): void {\n this.stopLiveUpdates();\n }\n\n /**\n * Per-account usage state real-time frissítés. A server `persistAccountUsageState`\n * upsert sikere után emit-elt event-ből építjük újra a `accountUsageMap_$`\n * megfelelő `accountKey` bejegyzését. Ha a windowType már szerepel, lecseréljük;\n * különben hozzáadjuk.\n */\n private handleAccountUsageUpdate(payload: Record<string, unknown>): void {\n const accountKey: unknown = payload.accountKey;\n const windowType: unknown = payload.windowType;\n if (typeof accountKey !== 'string' || accountKey === '' || typeof windowType !== 'string') {\n return;\n }\n const newItem: CC_AccountUsageState_Response = {\n accountKey: accountKey,\n windowType: windowType,\n utilization: typeof payload.utilization === 'number' ? payload.utilization : undefined,\n resetsAtMs: typeof payload.resetsAtMs === 'number' ? payload.resetsAtMs : undefined,\n lastObservedStatus: typeof payload.lastObservedStatus === 'string' ? payload.lastObservedStatus : undefined,\n observedAt: typeof payload.observedAt === 'string' ? payload.observedAt : undefined,\n lastObservedByCcapId: typeof payload.lastObservedByCcapId === 'string' ? payload.lastObservedByCcapId : undefined,\n lastObservedBySessionId: typeof payload.lastObservedBySessionId === 'string' ? payload.lastObservedBySessionId : undefined,\n };\n\n const next: Map<string, CC_AccountUsageState_Response[]> = new Map(this.accountUsageMap_$());\n const existing: CC_AccountUsageState_Response[] = next.get(accountKey) ?? [];\n const replaced: CC_AccountUsageState_Response[] = existing.filter(\n (item: CC_AccountUsageState_Response): boolean => item.windowType !== windowType,\n );\n replaced.push(newItem);\n next.set(accountKey, replaced);\n this.accountUsageMap_$.set(next);\n }\n\n /**\n * Account-pool változás (új account felfedezve, displayName-átírás): a\n * legegyszerűbb és legbiztonságosabb módon `loadAccounts()` re-fetch-csel\n * frissítjük a `accounts_$` signal-t. Cross-instance change-ek esetén is\n * ez a megközelítés robosztus (a DB SSOT-ből minden instance ugyanazt látja).\n */\n private handleAccountListUpdate(_payload: Record<string, unknown>): void {\n void this.loadAccounts();\n // REQ-CC-ACCOUNT-IDENTITY-EMAIL-001 Slice 3 part-1 (cycle 890): a Dashboard\n // identity-groups view is frissül a socket-eventre — egyébként új account\n // (vagy backfill utáni identity-update) nem jutna el a Dashboard kártyáira.\n void this.loadIdentityGroups();\n }\n\n /** Hibaüzenet kinyerés tipikus shape-ekből (HttpErrorResponse / Error / unknown). */\n private errorMessageOf(err: unknown): string {\n if (err instanceof Error) {\n return err.message;\n }\n if (typeof err === 'object' && err !== null) {\n const rec: Record<string, unknown> = err as Record<string, unknown>;\n if (typeof rec.message === 'string') {\n return rec.message;\n }\n }\n return String(err);\n }\n}\n", "import { CC_AccountUsageEvent_Response } from '../_models/interfaces/cc-account-usage-event.interface';\nimport {\n CC_AccountUsageChartLine_Interface,\n CC_AccountUsageChart_Result,\n} from '../_models/interfaces/cc-account-usage-chart.interface';\n\n/**\n * Account usage-history → SVG chart-line projektor (REQ-CC-USAGE-DASHBOARD-001\n * cycle 884). Az event-eket windowType-onként szétválogatja, observedAt szerint\n * növekvő sorrendbe rendezi, majd a `(t, utilization)` párokat egy 100×40 unit-os\n * viewBox-ba projektálja (x: 0..100 idő-tengely, y: 0=tele/100% .. 40=üres/0%).\n *\n * A 5 fix windowType-onkénti szín stabil (a Dashboard-kártyák és a Session-info\n * popover is ugyanezt használja, mint vizuális SSOT).\n */\nexport class CC_AccountUsageChart_Util {\n\n static readonly CHART_WIDTH: number = 100;\n static readonly CHART_HEIGHT: number = 40;\n\n /** Fix windowType-onkénti szín-paletta (stroke hex). */\n static readonly COLOR_MAP: Record<string, string> = {\n five_hour: '#10b981',\n seven_day: '#06b6d4',\n seven_day_opus: '#a855f7',\n seven_day_sonnet: '#f59e0b',\n extra_usage: '#f43f5e',\n };\n\n static readonly WINDOW_LABEL_MAP: Record<string, string> = {\n five_hour: '5h',\n seven_day: 'Weekly',\n seven_day_opus: 'Opus',\n seven_day_sonnet: 'Sonnet',\n extra_usage: 'Extra',\n };\n\n /** Fix windowType render-sorrend (stabil legend-sorrend). */\n static readonly WINDOW_ORDER: string[] = [\n 'five_hour',\n 'seven_day',\n 'seven_day_opus',\n 'seven_day_sonnet',\n 'extra_usage',\n ];\n\n /**\n * Account-history events → chart-line projektálás.\n * Üres input → üres result (`hasAnyData=false`); a hívó tudja kezelni az\n * \"no data yet\" placeholder render-t.\n */\n static buildChart(events: CC_AccountUsageEvent_Response[]): CC_AccountUsageChart_Result {\n // Idő-tartomány + érvényes pontok detektálása egy menetben.\n let minT: number = Number.POSITIVE_INFINITY;\n let maxT: number = Number.NEGATIVE_INFINITY;\n let validCount: number = 0;\n for (const e of events) {\n if (typeof e.observedAt !== 'string' || e.observedAt === '') {\n continue;\n }\n if (typeof e.utilization !== 'number' || !isFinite(e.utilization)) {\n continue;\n }\n const t: number = Date.parse(e.observedAt);\n if (!isFinite(t)) {\n continue;\n }\n if (t < minT) {\n minT = t;\n }\n if (t > maxT) {\n maxT = t;\n }\n validCount++;\n }\n\n if (validCount === 0) {\n return {\n lines: CC_AccountUsageChart_Util.WINDOW_ORDER.map(\n (wt: string): CC_AccountUsageChartLine_Interface => ({\n windowType: wt,\n label: CC_AccountUsageChart_Util.WINDOW_LABEL_MAP[wt] ?? wt,\n colorHex: CC_AccountUsageChart_Util.COLOR_MAP[wt] ?? '#9ca3af',\n pathPoints: '',\n hasData: false,\n pointCount: 0,\n lastX: 0,\n lastY: 0,\n }),\n ),\n hasAnyData: false,\n minTimeMs: 0,\n maxTimeMs: 0,\n };\n }\n\n // Degenerate eset: minden esemény ugyanabban a ms-ben — expand-eljük 1h-vel,\n // hogy a vízszintes vonalak ne 0-szélességűek legyenek.\n if (maxT - minT < 1) {\n maxT = minT + 3_600_000;\n }\n const range: number = maxT - minT;\n\n const lines: CC_AccountUsageChartLine_Interface[] =\n CC_AccountUsageChart_Util.WINDOW_ORDER.map((wt: string): CC_AccountUsageChartLine_Interface => {\n // windowType-onkénti gyűjtés + növekvő idő szerinti rendezés.\n const points: { t: number; u: number }[] = [];\n for (const e of events) {\n if (e.windowType !== wt) {\n continue;\n }\n if (typeof e.observedAt !== 'string' || e.observedAt === '') {\n continue;\n }\n if (typeof e.utilization !== 'number' || !isFinite(e.utilization)) {\n continue;\n }\n const t: number = Date.parse(e.observedAt);\n if (!isFinite(t)) {\n continue;\n }\n points.push({ t: t, u: Math.max(0, Math.min(1, e.utilization)) });\n }\n points.sort((a: { t: number; u: number }, b: { t: number; u: number }): number => a.t - b.t);\n\n const coords: string[] = [];\n let lastX: number = 0;\n let lastY: number = 0;\n for (const p of points) {\n const x: number = ((p.t - minT) / range) * CC_AccountUsageChart_Util.CHART_WIDTH;\n const y: number = CC_AccountUsageChart_Util.CHART_HEIGHT\n - (p.u * CC_AccountUsageChart_Util.CHART_HEIGHT);\n coords.push(`${x.toFixed(2)},${y.toFixed(2)}`);\n lastX = x;\n lastY = y;\n }\n\n return {\n windowType: wt,\n label: CC_AccountUsageChart_Util.WINDOW_LABEL_MAP[wt] ?? wt,\n colorHex: CC_AccountUsageChart_Util.COLOR_MAP[wt] ?? '#9ca3af',\n pathPoints: coords.join(' '),\n hasData: coords.length > 0,\n pointCount: coords.length,\n lastX: lastX,\n lastY: lastY,\n };\n });\n\n return {\n lines: lines,\n hasAnyData: lines.some((l: CC_AccountUsageChartLine_Interface): boolean => l.hasData),\n minTimeMs: minT,\n maxTimeMs: maxT,\n };\n }\n}\n", "import { CommonModule } from '@angular/common';\nimport { Component, computed, effect, inject, Input, signal, Signal } from '@angular/core';\n\nimport { CC_Account_DataService } from '../../_services/cc-account.data-service';\nimport { CC_AccountUsageState_Response } from '../../_models/interfaces/cc-account-usage-state.interface';\nimport { CC_AccountUsageChart_Result } from '../../_models/interfaces/cc-account-usage-chart.interface';\nimport { CC_AccountUsageChart_Util } from '../../_collections/cc-account-usage-chart.util';\n\n/**\n * CC Account Usage View — megosztott komponens (REQ-CC-USAGE-DASHBOARD-001 cycle 885).\n *\n * Egy account `accountKey`-éhez tartozó 5 windowType-os usage státusz + opcionális\n * időbeli SVG-graph render. Több helyen használt:\n * - CC Usage Dashboard (account-cards) — `compact=false`, graph elérhető\n * - CC Session info-panel popover — `compact=true` szűk popover-hez\n * - bárhol ahol egy accountKey-hez kell mutatni a usage-snapshot-ot\n *\n * SSOT: a `CC_Account_DataService.accountUsageMap_$` és `usageHistoryMap_$` signal-okat\n * olvassa. Lazy-fetch saját maga: ha a state cache-ben még nincs, indítja a\n * `loadAccountUsage`-t. A history-fetch csak akkor fut, ha a graph megnyílik.\n */\n@Component({\n selector: 'app-cc-account-usage-view',\n standalone: true,\n imports: [CommonModule],\n templateUrl: './cc-account-usage-view.component.html',\n})\n/**\n * REQ-CC-USAGE-DASHBOARD-001 (cycle 885) — shared CC account-usage megjelenítő.\n * Egyetlen komponens a per-account utilization graph + status egységes renderéhez,\n * amit a Dashboard és a CC Session info-panel egyaránt használ (graph + status\n * SSOT). Csak Render-only: state-et a `CC_Account_DataService`-ből olvas.\n */\nexport class CC_AccountUsageView_Component {\n\n private readonly account_DS: CC_Account_DataService = inject(CC_Account_DataService);\n\n /** Account stable kulcs — kötelező input. */\n @Input({ required: true }) accountKey: string = '';\n\n /** Kompakt layout (kisebb fontok, szűkebb padding) — popover-be javasolt. */\n @Input() compact: boolean = false;\n\n /** Igaz → a graph toggle gomb meg fog jelenni (default: true). */\n @Input() showGraphToggle: boolean = true;\n\n /** Igaz → a graph-panel induláskor nyitva (default: false → lezárt). */\n @Input() initiallyOpenGraph: boolean = false;\n\n /** Lokális UI state: a graph-panel nyitva/zárva. */\n readonly isGraphOpen_$ = signal<boolean>(false);\n\n /** SVG chart-data builder az adott account-history cache-éből. */\n readonly chart_$: Signal<CC_AccountUsageChart_Result> = computed(\n (): CC_AccountUsageChart_Result => {\n return CC_AccountUsageChart_Util.buildChart(\n this.account_DS.usageHistoryMap_$().get(this.accountKey) ?? [],\n );\n },\n );\n\n /** SVG viewBox literal (a template használja). */\n readonly chartViewBox: string = `0 0 ${CC_AccountUsageChart_Util.CHART_WIDTH} ${CC_AccountUsageChart_Util.CHART_HEIGHT}`;\n readonly chartW: number = CC_AccountUsageChart_Util.CHART_WIDTH;\n readonly chartH: number = CC_AccountUsageChart_Util.CHART_HEIGHT;\n readonly chartMidY: number = CC_AccountUsageChart_Util.CHART_HEIGHT / 2;\n\n /**\n * Reaktív lazy-fetch: ha az accountKey változik vagy a cache üres, lekérjük\n * a perzisztált usage state-et. Ez azoknál a használati helyeknél kritikus\n * (popover, CC sessions dashboard), ahol a Dashboard-bootstrap NEM futott.\n */\n private readonly usageEffect = effect((): void => {\n const key: string = this.accountKey;\n if (!key) {\n return;\n }\n if (!this.account_DS.accountUsageMap_$().has(key)) {\n void this.account_DS.loadAccountUsage(key);\n }\n });\n\n /** initiallyOpenGraph input alkalmazása az isGraphOpen_$-ra. */\n private readonly initialOpenEffect = effect((): void => {\n if (this.initiallyOpenGraph) {\n this.isGraphOpen_$.set(true);\n }\n });\n\n /** Graph-toggle handler — első megnyitás-kor history-fetch. */\n async handleToggleGraph(): Promise<void> {\n const next: boolean = !this.isGraphOpen_$();\n this.isGraphOpen_$.set(next);\n if (next && !this.account_DS.usageHistoryMap_$().has(this.accountKey)) {\n await this.account_DS.loadAccountUsageHistory({ accountKey: this.accountKey });\n }\n }\n\n /** Explicit refresh — history-fetch reload. */\n async handleRefreshGraph(): Promise<void> {\n await this.account_DS.loadAccountUsageHistory({ accountKey: this.accountKey });\n }\n\n /** Egy adott windowType state-jét adja vissza, vagy null. */\n usageItemOfWindow(windowType: string): CC_AccountUsageState_Response | null {\n const items: CC_AccountUsageState_Response[] = this.account_DS.accountUsageMap_$().get(this.accountKey) ?? [];\n for (const item of items) {\n if (item.windowType === windowType) {\n return item;\n }\n }\n return null;\n }\n\n /** True ha legalább egy windowType-ra van adat. */\n hasAnyUsageData(): boolean {\n const items: CC_AccountUsageState_Response[] = this.account_DS.accountUsageMap_$().get(this.accountKey) ?? [];\n return items.length > 0;\n }\n\n /** Window-typeName → emberi label (pure mapping). */\n windowLabelOf(windowType: string): string {\n switch (windowType) {\n case 'five_hour': return '5-hour session';\n case 'seven_day': return 'Weekly';\n case 'seven_day_opus': return 'Weekly · Opus';\n case 'seven_day_sonnet': return 'Weekly · Sonnet';\n case 'extra_usage': return 'Extra (pay-as-you-go)';\n default: return windowType;\n }\n }\n\n /** Utilization → progress-bar width (0..100%, 0 ha null). */\n utilizationPercent(utilization: number | undefined): number {\n if (utilization == null || !isFinite(utilization)) {\n return 0;\n }\n return Math.max(0, Math.min(100, Math.round(utilization * 100)));\n }\n\n /** Utilization fraction (0..1) → percent string '42%'. null → '—'. */\n formatUtilization(utilization: number | null | undefined): string {\n if (utilization == null) {\n return '—';\n }\n return `${Math.round(utilization * 100)}%`;\n }\n\n /** Progress-bar szín-osztály utilization alapján (zöld/sárga/piros). */\n utilizationBarColorClass(utilization: number | undefined): string {\n if (utilization == null || !isFinite(utilization)) {\n return 'bg-neutral-600';\n }\n if (utilization >= 0.85) {\n return 'bg-red-500';\n }\n if (utilization >= 0.5) {\n return 'bg-amber-500';\n }\n return 'bg-emerald-500';\n }\n\n /** Reset countdown — emberi olvasható ('2h 34m', '5d 1h', 'expired', '—'). */\n formatResetCountdown(resetsAtMs: number | undefined): string {\n if (resetsAtMs == null || !isFinite(resetsAtMs) || resetsAtMs <= 0) {\n return '—';\n }\n const diffMs: number = resetsAtMs - Date.now();\n if (diffMs <= 0) {\n return 'expired';\n }\n const totalMinutes: number = Math.floor(diffMs / 60_000);\n const days: number = Math.floor(totalMinutes / (60 * 24));\n const hours: number = Math.floor((totalMinutes % (60 * 24)) / 60);\n const minutes: number = totalMinutes % 60;\n if (days > 0) {\n return `${days}d ${hours}h`;\n }\n if (hours > 0) {\n return `${hours}h ${minutes}m`;\n }\n return `${minutes}m`;\n }\n}\n", "<!-- CC Account Usage View — megosztott komponens (cycle 885).\n A 5 usage-sor mindig látszik (placeholder ha üres), a graph opcionális toggle-able. -->\n<div class=\"flex flex-col\" [class.gap-1]=\"compact\" [class.gap-2]=\"!compact\">\n <!-- 5 usage-sor: a mindig-látható status block. -->\n <div [class.space-y-1]=\"compact\" [class.space-y-2]=\"!compact\">\n @for (windowType of ['five_hour', 'seven_day', 'seven_day_opus', 'seven_day_sonnet', 'extra_usage']; track windowType) {\n @let item = usageItemOfWindow(windowType);\n <div [class]=\"compact ? 'grid grid-cols-[90px_1fr_56px] items-center gap-2 text-[10px]' : 'grid grid-cols-[110px_1fr_64px] items-center gap-2 text-[11px]'\"\n [class.opacity-50]=\"!item\">\n <div class=\"text-neutral-300 font-medium truncate\" [title]=\"windowType\">\n {{ windowLabelOf(windowType) }}\n </div>\n <div class=\"flex items-center gap-2 min-w-0\">\n <div [class]=\"compact ? 'flex-1 h-1.5 bg-neutral-800 rounded-full overflow-hidden' : 'flex-1 h-2 bg-neutral-800 rounded-full overflow-hidden'\">\n @if (item) {\n <div [class]=\"'h-full transition-all ' + utilizationBarColorClass(item.utilization)\"\n [style.width.%]=\"utilizationPercent(item.utilization)\"></div>\n }\n </div>\n <span class=\"font-mono text-neutral-200 text-right shrink-0\"\n [class]=\"compact ? 'w-8 text-[10px]' : 'w-9'\">\n {{ formatUtilization(item?.utilization ?? null) }}\n </span>\n </div>\n <div class=\"font-mono text-neutral-500 text-right text-[10px] truncate\"\n [title]=\"'Resets in ' + formatResetCountdown(item?.resetsAtMs)\">\n {{ formatResetCountdown(item?.resetsAtMs) }}\n </div>\n </div>\n }\n </div>\n\n @if (!hasAnyUsageData()) {\n <div class=\"text-[10px] text-neutral-500 italic pt-1 border-t border-neutral-800/40\">\n No data yet — click <strong class=\"text-neutral-400\">Pull</strong> or wait for the next rate-limit event.\n </div>\n }\n\n <!-- Graph toggle + SVG line-chart (cycle 884 portolva ide). -->\n @if (showGraphToggle) {\n <div class=\"border-t border-neutral-800/40 pt-2\">\n <button\n type=\"button\"\n class=\"text-[11px] text-neutral-400 hover:text-neonCyan flex items-center gap-1 transition-colors\"\n (click)=\"handleToggleGraph()\"\n [title]=\"isGraphOpen_$() ? 'Hide usage graph' : 'Show usage graph (utilization over time per window)'\"\n >\n <svg class=\"w-3 h-3 transition-transform\"\n [class.rotate-90]=\"isGraphOpen_$()\"\n fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M9 5l7 7-7 7\"/>\n </svg>\n 📈 {{ isGraphOpen_$() ? 'Hide' : 'Show' }} graph\n </button>\n\n @if (isGraphOpen_$()) {\n @let chart = chart_$();\n <div class=\"mt-2 rounded-md border border-neutral-800 bg-neutral-950/40 p-2\">\n @if (!chart.hasAnyData) {\n <div class=\"text-[11px] text-neutral-500 italic px-2 py-3 text-center\">\n No graph data yet — pull usage or wait for a CC session rate-limit event.\n </div>\n } @else {\n <div class=\"relative w-full\">\n <svg [attr.viewBox]=\"chartViewBox\" preserveAspectRatio=\"none\"\n class=\"w-full block\"\n [class.h-24]=\"compact\"\n [class.h-32]=\"!compact\">\n <!-- Háttér + 0%, 50%, 100% referencia-vonalak. -->\n <line x1=\"0\" [attr.y1]=\"chartH\" [attr.x2]=\"chartW\" [attr.y2]=\"chartH\"\n stroke=\"#3f3f46\" stroke-width=\"0.3\"/>\n <line x1=\"0\" [attr.y1]=\"chartMidY\" [attr.x2]=\"chartW\" [attr.y2]=\"chartMidY\"\n stroke=\"#3f3f46\" stroke-width=\"0.2\" stroke-dasharray=\"1,1\"/>\n <line x1=\"0\" y1=\"0\" [attr.x2]=\"chartW\" y2=\"0\"\n stroke=\"#3f3f46\" stroke-width=\"0.2\" stroke-dasharray=\"1,1\"/>\n @for (line of chart.lines; track line.windowType) {\n @if (line.hasData) {\n @if (line.pointCount === 1) {\n <circle [attr.cx]=\"line.lastX\" [attr.cy]=\"line.lastY\" r=\"0.8\" [attr.fill]=\"line.colorHex\"/>\n } @else {\n <polyline [attr.points]=\"line.pathPoints\"\n [attr.stroke]=\"line.colorHex\"\n fill=\"none\" stroke-width=\"0.6\"\n stroke-linecap=\"round\" stroke-linejoin=\"round\"\n vector-effect=\"non-scaling-stroke\"/>\n <circle [attr.cx]=\"line.lastX\" [attr.cy]=\"line.lastY\" r=\"0.6\" [attr.fill]=\"line.colorHex\"/>\n }\n }\n }\n </svg>\n <div class=\"absolute inset-y-0 left-0 flex flex-col justify-between text-[8px] text-neutral-600 font-mono pointer-events-none\">\n <span>100%</span>\n <span>50%</span>\n <span>0%</span>\n </div>\n </div>\n <div class=\"mt-2 flex flex-wrap items-center gap-2 text-[10px]\">\n @for (line of chart.lines; track line.windowType) {\n <div class=\"flex items-center gap-1\" [class.opacity-40]=\"!line.hasData\">\n <span class=\"inline-block w-2 h-2 rounded-sm\" [style.background-color]=\"line.colorHex\"></span>\n <span class=\"text-neutral-300\">{{ line.label }}</span>\n @if (line.hasData) {\n <span class=\"text-neutral-500\">·</span>\n <span class=\"font-mono text-neutral-400\">\n {{ ((chartH - line.lastY) / chartH * 100).toFixed(0) }}%\n </span>\n }\n </div>\n }\n </div>\n <div class=\"mt-1 flex items-center justify-between text-[9px] text-neutral-600\">\n @if (chart.minTimeMs) {\n <span>{{ chart.minTimeMs | date:'yyyy-MM-dd HH:mm' }}</span>\n } @else {\n <span>—</span>\n }\n <button\n type=\"button\"\n class=\"text-[10px] text-neutral-400 hover:text-neonCyan border border-neutral-700\n hover:border-neonCyan rounded px-1.5 py-0.5 transition-colors\"\n (click)=\"handleRefreshGraph()\"\n title=\"Re-fetch usage event history for this graph.\"\n >\n ↻ Refresh\n </button>\n @if (chart.maxTimeMs) {\n <span>{{ chart.maxTimeMs | date:'yyyy-MM-dd HH:mm' }}</span>\n } @else {\n <span>—</span>\n }\n </div>\n }\n </div>\n }\n </div>\n }\n</div>\n"],
5
+ "mappings": "icA0BA,IAAaA,IAAqB,IAAA,CAA5B,MAAOA,CAAqB,CAEfC,QAAkB,GAAGC,GAAYC,IAAIF,OAAO,cAE5CG,KAAmBC,EAAOC,EAAU,EAGrDC,cAAY,CACV,OAAOC,EACL,KAAKJ,KAAKK,IAAsC,GAAG,KAAKR,OAAO,OAAO,CAAC,CAE3E,CAQAS,wBAAsB,CACpB,OAAOF,EACL,KAAKJ,KAAKK,IAAqC,GAAG,KAAKR,OAAO,mBAAmB,CAAC,CAEtF,CAMAU,kBAAgB,CAQd,OAAOH,EACL,KAAKJ,KAAKQ,KAOP,GAAG,KAAKX,OAAO,qBAAsB,CAAA,CAAE,CAAC,CAE/C,CAMAY,yBAAuB,CAMrB,OAAOL,EACL,KAAKJ,KAAKK,I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EAAA,kBAAA,EAAA,CAAA,EAAA,YAAA,kBAAA,CAAA,EAAAC,SAAA,SAAAC,EAAAC,EAAA,CAAAD,EAAA,IC/B1CxH,EAAA,EAAA,MAAA,CAAA,EAA4E,EAAA,KAAA,EAGxEuC,EAAA,EAAAmF,GAAA,GAAA,GAAA,MAAA,EAAAC,CAAA,EAyBFzH,EAAA,EAEAC,EAAA,EAAAyH,GAAA,EAAA,EAAA,MAAA,CAAA,EAA0B,EAAAC,GAAA,EAAA,EAAA,MAAA,CAAA,EAwG5B3H,EAAA,SAtI2BQ,EAAA,QAAA+G,EAAAhH,OAAA,EAAuB,QAAA,CAAAgH,EAAAhH,OAAA,EAE3CD,EAAA,EAAAE,EAAA,YAAA+G,EAAAhH,OAAA,EAA2B,YAAA,CAAAgH,EAAAhH,OAAA,EAC9BD,EAAA,EAAA6C,EAAAyE,GAAA,GAAAC,EAAA,CAAA,EA2BFvH,EAAA,CAAA,EAAAO,EAAA0G,EAAAzB,gBAAA,EAAA,GAAA,CAAA,EAOAxF,EAAA,EAAAO,EAAA0G,EAAApD,gBAAA,EAAA,EAAA,kBDfU2D,GAAYC,EAAA,EAAAC,cAAA,CAAA,CAAA,SASXlE,CAA6B,GAAA",
6
+ "names": ["CC_Account_ApiService", "baseUrl", "environment", "api", "http", "inject", "HttpClient", "listAccounts", "firstValueFrom", "get", "listAccountsByIdentity", "backfillIdentity", "post", "auditIdentityDuplicates", "refreshLocalAccounts", "getInstanceMapping", "getAccount", "accountKey", "getAccountUsage", "getAccountUsageHistory", "params", "query", "windowType", "push", "encodeURIComponent", "fromMs", "toMs", "qs", "length", "join", "refreshAccountUsage", "renameAccount", "body", "displayName", "undefined", "email", "patch", "factory", "\u0275fac", "providedIn", "SOCKET_EVENT_CC_ACCOUNT_USAGE_UPDATE", "SOCKET_EVENT_CC_ACCOUNT_LIST_UPDATE", "CC_Account_DataService", "account_AS", "inject", "CC_Account_ApiService", "socket_CS", "CCAP_Socket_ControlService", "ngZone", "NgZone", "socketSubscription", "accounts_$", "signal", "accountUsageMap_$", "Map", "instanceMapping_$", "usageHistoryMap_$", "identityGroups_$", "isLoading_$", "loadError_$", "loadDashboardBootstrap", "__async", "set", "accountsResp", "mappingResp", "groupsResp", "Promise", "all", "listAccounts", "getInstanceMapping", "listAccountsByIdentity", "items", "groups", "nextMap", "group", "primary", "accountKey", "mergedUsage", "err", "errorMessageOf", "loadIdentityGroups", "resp", "loadAccounts", "loadAccountUsage", "getAccountUsage", "next", "loadAccountUsageHistory", "params", "getAccountUsageHistory", "loadInstanceMapping", "refreshAccounts", "refreshResult", "refreshLocalAccounts", "refreshedKeys", "scannedPaths", "refreshAccountUsage", "result", "status", "windowsUpserted", "email", "renameAccount", "updated", "map", "a", "startLiveUpdates", "event$", "subscribe", "envelope", "run", "event", "handleAccountUsageUpdate", "payload", "handleAccountListUpdate", "stopLiveUpdates", "unsubscribe", "ngOnDestroy", "windowType", "newItem", "utilization", "undefined", "resetsAtMs", "lastObservedStatus", "observedAt", "lastObservedByCcapId", "lastObservedBySessionId", "replaced", "get", "filter", "item", "push", "_payload", "Error", "message", "rec", "String", "factory", "\u0275fac", "providedIn", "CC_AccountUsageChart_Util", "CHART_WIDTH", "CHART_HEIGHT", "COLOR_MAP", "five_hour", "seven_day", "seven_day_opus", "seven_day_sonnet", "extra_usage", "WINDOW_LABEL_MAP", "WINDOW_ORDER", "buildChart", "events", "minT", "Number", "POSITIVE_INFINITY", "maxT", "NEGATIVE_INFINITY", "validCount", "e", "observedAt", "utilization", "isFinite", "t", "Date", "parse", "lines", "map", "wt", "windowType", "label", "colorHex", "pathPoints", "hasData", "pointCount", "lastX", "lastY", "hasAnyData", "minTimeMs", "maxTimeMs", "range", "points", "push", "u", "Math", "max", "min", "sort", "a", "b", "coords", "p", "x", "y", "toFixed", "join", "length", "some", "l", "\u0275\u0275element", "\u0275\u0275classMap", "ctx_r1", "utilizationBarColorClass", "item_r1", "utilization", "\u0275\u0275styleProp", "utilizationPercent", "\u0275\u0275declareLet", "\u0275\u0275elementStart", "\u0275\u0275text", "\u0275\u0275elementEnd", "\u0275\u0275template", "CC_AccountUsageView_Component_For_3_Conditional_6_Template", "\u0275\u0275storeLet", "usageItemOfWindow", "windowType_r3", "\u0275\u0275advance", "compact", "\u0275\u0275classProp", "item_r4", "\u0275\u0275property", "\u0275\u0275textInterpolate1", "windowLabelOf", "\u0275\u0275conditional", "formatUtilization", "tmp_18_0", "undefined", "formatResetCountdown", "resetsAtMs", "CC_AccountUsageView_Component_Conditional_5_Conditional_5_Conditional_3_For_6_Conditional_0_Conditional_0_Template", "CC_AccountUsageView_Component_Conditional_5_Conditional_5_Conditional_3_For_6_Conditional_0_Conditional_1_Template", "line_r7", "pointCount", "CC_AccountUsageView_Component_Conditional_5_Conditional_5_Conditional_3_For_6_Conditional_0_Template", "hasData", "chartH", "line_r8", "lastY", "toFixed", "CC_AccountUsageView_Component_Conditional_5_Conditional_5_Conditional_3_For_16_Conditional_4_Template", "colorHex", "\u0275\u0275textInterpolate", "label", "\u0275\u0275pipeBind2", "chart_r9", "minTimeMs", "maxTimeMs", "\u0275\u0275repeaterCreate", "CC_AccountUsageView_Component_Conditional_5_Conditional_5_Conditional_3_For_6_Template", "_forTrack0", "CC_AccountUsageView_Component_Conditional_5_Conditional_5_Conditional_3_For_16_Template", "CC_AccountUsageView_Component_Conditional_5_Conditional_5_Conditional_3_Conditional_18_Template", "CC_AccountUsageView_Component_Conditional_5_Conditional_5_Conditional_3_Conditional_19_Template", "\u0275\u0275listener", "\u0275\u0275restoreView", "_r6", "\u0275\u0275nextContext", "\u0275\u0275resetView", "handleRefreshGraph", "CC_AccountUsageView_Component_Conditional_5_Conditional_5_Conditional_3_Conditional_22_Template", "CC_AccountUsageView_Component_Conditional_5_Conditional_5_Conditional_3_Conditional_23_Template", "\u0275\u0275repeater", "lines", "CC_AccountUsageView_Component_Conditional_5_Conditional_5_Conditional_2_Template", "CC_AccountUsageView_Component_Conditional_5_Conditional_5_Conditional_3_Template", "chart_$", "chart_r10", "hasAnyData", "_r5", "handleToggleGraph", "CC_AccountUsageView_Component_Conditional_5_Conditional_5_Template", "isGraphOpen_$", "CC_AccountUsageView_Component", "account_DS", "inject", "CC_Account_DataService", "accountKey", "showGraphToggle", "initiallyOpenGraph", "signal", "computed", "CC_AccountUsageChart_Util", "buildChart", "usageHistoryMap_$", "get", "chartViewBox", "CHART_WIDTH", "CHART_HEIGHT", "chartW", "chartMidY", "usageEffect", "effect", "key", "accountUsageMap_$", "has", "loadAccountUsage", "initialOpenEffect", "set", "__async", "next", "loadAccountUsageHistory", "windowType", "items", "item", "hasAnyUsageData", "length", "isFinite", "Math", "max", "min", "round", "diffMs", "Date", "now", "totalMinutes", "floor", "days", "hours", "minutes", "selectors", "inputs", "standalone", "features", "\u0275\u0275StandaloneFeature", "decls", "vars", "consts", "template", "rf", "ctx", "CC_AccountUsageView_Component_For_3_Template", "\u0275\u0275repeaterTrackByIdentity", "CC_AccountUsageView_Component_Conditional_4_Template", "CC_AccountUsageView_Component_Conditional_5_Template", "\u0275\u0275pureFunction0", "_c0", "CommonModule", "DatePipe", "encapsulation"]
7
+ }
@@ -1,3 +1,3 @@
1
- import{a as R,b as O}from"./chunk-3MEI6XWH.js";import{a as q}from"./chunk-3FE7PGC3.js";import{a as g}from"./chunk-UFBTR2BG.js";import{a as U}from"./chunk-XC5AQG22.js";import{e as P}from"./chunk-HM7DY6UV.js";import{h as y,j as L}from"./chunk-YE64CYNH.js";import{p as D}from"./chunk-AK3BNMCA.js";import{C as v,R as T,a as h,aa as p,b as S,h as E,k as d,y as A}from"./chunk-TBMJSIBB.js";var f=E(D());var _=class u{static compareAsc(C,e){let s=(C.sequence??0)-(e.sequence??0);if(s!==0)return s;let n=typeof C.timestamp=="string"?C.timestamp:"",t=typeof e.timestamp=="string"?e.timestamp:"",o=n.localeCompare(t);if(o!==0)return o;let i=typeof C.messageKey=="string"?C.messageKey:"",r=typeof e.messageKey=="string"?e.messageKey:"";return i.localeCompare(r)}static sortAsc(C){return[...C].sort(u.compareAsc)}};var M=E(D());var x=(()=>{class u{parent;agentToolUseIds=new Set;activeSubAgentId="";toolUseIdToName=new Map;init(e){this.parent=e}resetTrackingState(){this.toolUseIdToName.clear(),this.agentToolUseIds.clear(),this.activeSubAgentId=""}handleSocketEvent(e,s){let n=e.event,t=e.payload;try{let o=typeof t.ccapId=="string"?t.ccapId:"";if(n!=="cc:rate-limit-update"&&n!=="ext-session-msg:message"&&n!=="ext-session-msg:update"&&o&&s.selectedCcapId&&o!==s.selectedCcapId){M.DyFM_Log.info(`CCAP_CcSession_DS | socket event dropped by instance filter | event: ${n} | eventCcapId: ${o} | selectedCcapId: ${s.selectedCcapId}`);return}switch(n){case"cc-session:status":this.handleStatusUpdate(t);break;case"cc-session:output":this.handleOutputChunk(t);break;case"cc-session:event":this.handleSessionEvent(t);break;case"cc-session:list-update":this.handleListUpdate(t);break;case"cc-session:session-update":this.handleSessionItemUpdate(t);break;case"agent-events":this.handleAgentEvent(t);break;case"ext-session-msg:message":this.handleAssembledMessage(t);break;case"ext-session-msg:update":this.handleAssembledMessageUpdate(t);break;case"cc:rate-limit-update":this.handleRateLimitBroadcast(t);break}}catch(o){let i=o instanceof Error?o.message:String(o);M.DyFM_Log.error(`CCAP_CcSession_DS | socket event error | event: ${n}`,o),s.globalErrorShowError(o instanceof Error?o:new Error(`CC Session socket event processing failed: ${n} \u2014 ${i}`),"cc-session-socket-event")}}pushConsoleMessageFromEvent(e,s,n){let t=e.data;switch(e.eventType){case"response-chunk":{this.pushResponseChunkBlocks(t);break}case"tool-call-start":{let o=t.name??t.tool_name??"unknown",i=typeof t.id=="string"?t.id:"";i&&this.toolUseIdToName.set(i,o),o==="Agent"&&i&&this.agentToolUseIds.add(i);let r=t.input,a=r?u.summarizeToolInput(r):"",l=a?`${o}: ${a}`:o,c=o==="Edit"?u.buildEditExpandableContent(r):void 0,m=o==="Agent"?"":this.activeSubAgentId;this.parent.pushConsoleMessage({type:"tool",text:l,expandableContent:c,rawData:t,parentAgentId:m||void 0});break}case"tool-call-end":{let o=t.content??t.output,i=typeof o=="string"?o:"",r=i.length>200?i.substring(0,200)+"\u2026":i;if(r){let a=i.length>200?i:void 0;this.parent.pushConsoleMessage({type:"tool-result",text:r,expandableContent:a,rawData:t,parentAgentId:this.activeSubAgentId||void 0})}break}case"response-complete":{this.activeSubAgentId="";let o=t.cost_usd,i=typeof o=="number"?` ($${o.toFixed(4)})`:"",r=typeof t.model=="string"?` \xB7 ${t.model}`:"";this.parent.pushConsoleMessage({type:"result",text:`Response complete${r}${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)}),this.accumulateUsage(t);break}case"prompt-sent":{let o=typeof t.content=="string"?t.content:"";o&&(this.parent.consoleMessages_$().some(a=>a.type==="prompt"&&a.text===o.trim())||this.parent.pushConsoleMessage({type:"prompt",text:o,rawData:t,expandableContent:JSON.stringify(t,null,2)}));break}case"status-change":{let o=typeof t.from=="string"?t.from:"",i=typeof t.to=="string"?t.to:"";if(i){let r=typeof t.statusMessage=="string"?t.statusMessage:void 0,a=o?`${o} \u2192 ${i}`:i,l=r?`${a} \u2014 ${r}`:a;this.parent.pushConsoleMessage({type:"status",text:l,isStatus:!0,rawData:t,expandableContent:JSON.stringify(t,null,2)})}break}case"config-change":{let o=t.update,i=o&&typeof o=="object"?Object.keys(o).join(", "):"unknown";this.parent.pushConsoleMessage({type:"info",text:`Config updated: ${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"error":{let o=typeof t.message=="string"?t.message:"Unknown error";this.parent.pushConsoleMessage({type:"error",text:o,rawData:t,expandableContent:JSON.stringify(t,null,2)}),s&&n(new Error(`CC Session error: ${o}`),"cc-session-event");break}case"usage-update":{this.accumulateUsage(t);break}case"cli-chunk":{this.handleCliChunkEvent(t);break}case"runner-overflow":{let i=`Runner buffer overflow: ${typeof t.droppedCount=="number"?t.droppedCount:0} output items lost during server disconnect`;this.parent.pushConsoleMessage({type:"error",text:i,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"interrupted-prompt":{let o=typeof t.reason=="string"?t.reason:"",i=typeof t.lastPrompt=="string"?t.lastPrompt:"",r=i.length>80?i.substring(0,80)+"\u2026":i,a=r?`Prompt interrupted (${o}): "${r}"`:`Prompt interrupted${o?" ("+o+")":""}`;this.parent.pushConsoleMessage({type:"status",text:a,isStatus:!0,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"session-init":{let o=typeof t.model=="string"?t.model:"",i=typeof t.claudeCodeVersion=="string"?t.claudeCodeVersion:"",r=typeof t.permissionMode=="string"?t.permissionMode:"",a=[];o&&a.push(o),r&&a.push(r),i&&a.push(`v${i}`);let l=a.length>0?`CLI init: ${a.join(" \xB7 ")}`:"CLI initialized",c=JSON.stringify(t,null,2);this.parent.pushConsoleMessage({type:"info",text:l,rawData:t,expandableContent:c});break}case"config-mismatch":{let o=t.mismatches,i=Array.isArray(o)?o.map(r=>`${r.field}: requested "${r.requested}" \u2192 actual "${r.actual}"`).join(", "):"unknown mismatch";this.parent.pushConsoleMessage({type:"error",text:`Config mismatch: ${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"cli-args-record":{let o=typeof t.model=="string"?t.model:"default",i=typeof t.reasoningEffort=="string"?t.reasoningEffort:"default",r=typeof t.mode=="string"?t.mode:"normal",a=typeof t.permissionPolicy=="string"?t.permissionPolicy:"default",l=`CLI spawn: model=${o} \xB7 effort=${i} \xB7 mode=${r} \xB7 permission=${a}`;this.parent.pushConsoleMessage({type:"info",text:l,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"stdout-line":case"stderr-line":break;default:{let o=e.eventType;this.parent.pushConsoleMessage({type:"raw",text:o,rawData:t});break}}}handleStatusUpdate(e){let s=e.sessionId??"",n=e.status??"",t=e.statusMessage;this.parent.lastStatusUpdate_$.set({sessionId:s,status:n,statusMessage:t});let i=this.parent.sessions_$().map(a=>a.sessionId===s?S(h({},a),{status:n,statusMessage:t}):a);this.parent.sessions_$.set(i);let r=this.parent.selectedSession_$();if(r?.session.sessionId===s){let a=u.isLiveCcSessionStatus(n);this.parent.selectedSession_$.set(S(h({},r),{session:S(h({},r.session),{status:n,statusMessage:t}),runtime:S(h({},r.runtime),{isLive:a,runtimeStatus:n})}))}if(n==="errored"){let a=(t??"").trim();if(a.startsWith("Auto-recovery: terminal runner dropped silently")||a.startsWith("Exit code:"))M.DyFM_Log.warn(`CCAP_CcSession | user-task-fail diagnostic (NOT recorded to /errors) | sessionId: ${s} | statusMessage: ${a}`);else{let c=t?`CC Session error (${s}): ${t}`:`CC Session error (${s}): session entered errored state`;this.parent.showGlobalError(new Error(c),"cc-session-status")}}this.parent.evaluateSessionEventsPolling()}handleOutputChunk(e){let s=e.sessionId??"";if(s&&s!==this.parent.activeSessionId_$())return;let n=e.content??"",t=e.type??"stdout",o=this.parent.liveOutput_$(),i=n.split(`
1
+ import{a as R,b as O}from"./chunk-LRVS6OH7.js";import{a as q}from"./chunk-AHZLIVHV.js";import{a as g}from"./chunk-UFBTR2BG.js";import{a as U}from"./chunk-GARB57PP.js";import{e as P}from"./chunk-SQOIJHU2.js";import{h as y,j as L}from"./chunk-TRPAJFTF.js";import{p as D}from"./chunk-LWSSRQ3A.js";import{C as v,R as T,a as h,aa as p,b as S,h as E,k as d,y as A}from"./chunk-TBMJSIBB.js";var f=E(D());var _=class u{static compareAsc(C,e){let s=(C.sequence??0)-(e.sequence??0);if(s!==0)return s;let n=typeof C.timestamp=="string"?C.timestamp:"",t=typeof e.timestamp=="string"?e.timestamp:"",o=n.localeCompare(t);if(o!==0)return o;let i=typeof C.messageKey=="string"?C.messageKey:"",r=typeof e.messageKey=="string"?e.messageKey:"";return i.localeCompare(r)}static sortAsc(C){return[...C].sort(u.compareAsc)}};var M=E(D());var x=(()=>{class u{parent;agentToolUseIds=new Set;activeSubAgentId="";toolUseIdToName=new Map;init(e){this.parent=e}resetTrackingState(){this.toolUseIdToName.clear(),this.agentToolUseIds.clear(),this.activeSubAgentId=""}handleSocketEvent(e,s){let n=e.event,t=e.payload;try{let o=typeof t.ccapId=="string"?t.ccapId:"";if(n!=="cc:rate-limit-update"&&n!=="ext-session-msg:message"&&n!=="ext-session-msg:update"&&o&&s.selectedCcapId&&o!==s.selectedCcapId){M.DyFM_Log.info(`CCAP_CcSession_DS | socket event dropped by instance filter | event: ${n} | eventCcapId: ${o} | selectedCcapId: ${s.selectedCcapId}`);return}switch(n){case"cc-session:status":this.handleStatusUpdate(t);break;case"cc-session:output":this.handleOutputChunk(t);break;case"cc-session:event":this.handleSessionEvent(t);break;case"cc-session:list-update":this.handleListUpdate(t);break;case"cc-session:session-update":this.handleSessionItemUpdate(t);break;case"agent-events":this.handleAgentEvent(t);break;case"ext-session-msg:message":this.handleAssembledMessage(t);break;case"ext-session-msg:update":this.handleAssembledMessageUpdate(t);break;case"cc:rate-limit-update":this.handleRateLimitBroadcast(t);break}}catch(o){let i=o instanceof Error?o.message:String(o);M.DyFM_Log.error(`CCAP_CcSession_DS | socket event error | event: ${n}`,o),s.globalErrorShowError(o instanceof Error?o:new Error(`CC Session socket event processing failed: ${n} \u2014 ${i}`),"cc-session-socket-event")}}pushConsoleMessageFromEvent(e,s,n){let t=e.data;switch(e.eventType){case"response-chunk":{this.pushResponseChunkBlocks(t);break}case"tool-call-start":{let o=t.name??t.tool_name??"unknown",i=typeof t.id=="string"?t.id:"";i&&this.toolUseIdToName.set(i,o),o==="Agent"&&i&&this.agentToolUseIds.add(i);let r=t.input,a=r?u.summarizeToolInput(r):"",l=a?`${o}: ${a}`:o,c=o==="Edit"?u.buildEditExpandableContent(r):void 0,m=o==="Agent"?"":this.activeSubAgentId;this.parent.pushConsoleMessage({type:"tool",text:l,expandableContent:c,rawData:t,parentAgentId:m||void 0});break}case"tool-call-end":{let o=t.content??t.output,i=typeof o=="string"?o:"",r=i.length>200?i.substring(0,200)+"\u2026":i;if(r){let a=i.length>200?i:void 0;this.parent.pushConsoleMessage({type:"tool-result",text:r,expandableContent:a,rawData:t,parentAgentId:this.activeSubAgentId||void 0})}break}case"response-complete":{this.activeSubAgentId="";let o=t.cost_usd,i=typeof o=="number"?` ($${o.toFixed(4)})`:"",r=typeof t.model=="string"?` \xB7 ${t.model}`:"";this.parent.pushConsoleMessage({type:"result",text:`Response complete${r}${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)}),this.accumulateUsage(t);break}case"prompt-sent":{let o=typeof t.content=="string"?t.content:"";o&&(this.parent.consoleMessages_$().some(a=>a.type==="prompt"&&a.text===o.trim())||this.parent.pushConsoleMessage({type:"prompt",text:o,rawData:t,expandableContent:JSON.stringify(t,null,2)}));break}case"status-change":{let o=typeof t.from=="string"?t.from:"",i=typeof t.to=="string"?t.to:"";if(i){let r=typeof t.statusMessage=="string"?t.statusMessage:void 0,a=o?`${o} \u2192 ${i}`:i,l=r?`${a} \u2014 ${r}`:a;this.parent.pushConsoleMessage({type:"status",text:l,isStatus:!0,rawData:t,expandableContent:JSON.stringify(t,null,2)})}break}case"config-change":{let o=t.update,i=o&&typeof o=="object"?Object.keys(o).join(", "):"unknown";this.parent.pushConsoleMessage({type:"info",text:`Config updated: ${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"error":{let o=typeof t.message=="string"?t.message:"Unknown error";this.parent.pushConsoleMessage({type:"error",text:o,rawData:t,expandableContent:JSON.stringify(t,null,2)}),s&&n(new Error(`CC Session error: ${o}`),"cc-session-event");break}case"usage-update":{this.accumulateUsage(t);break}case"cli-chunk":{this.handleCliChunkEvent(t);break}case"runner-overflow":{let i=`Runner buffer overflow: ${typeof t.droppedCount=="number"?t.droppedCount:0} output items lost during server disconnect`;this.parent.pushConsoleMessage({type:"error",text:i,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"interrupted-prompt":{let o=typeof t.reason=="string"?t.reason:"",i=typeof t.lastPrompt=="string"?t.lastPrompt:"",r=i.length>80?i.substring(0,80)+"\u2026":i,a=r?`Prompt interrupted (${o}): "${r}"`:`Prompt interrupted${o?" ("+o+")":""}`;this.parent.pushConsoleMessage({type:"status",text:a,isStatus:!0,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"session-init":{let o=typeof t.model=="string"?t.model:"",i=typeof t.claudeCodeVersion=="string"?t.claudeCodeVersion:"",r=typeof t.permissionMode=="string"?t.permissionMode:"",a=[];o&&a.push(o),r&&a.push(r),i&&a.push(`v${i}`);let l=a.length>0?`CLI init: ${a.join(" \xB7 ")}`:"CLI initialized",c=JSON.stringify(t,null,2);this.parent.pushConsoleMessage({type:"info",text:l,rawData:t,expandableContent:c});break}case"config-mismatch":{let o=t.mismatches,i=Array.isArray(o)?o.map(r=>`${r.field}: requested "${r.requested}" \u2192 actual "${r.actual}"`).join(", "):"unknown mismatch";this.parent.pushConsoleMessage({type:"error",text:`Config mismatch: ${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"cli-args-record":{let o=typeof t.model=="string"?t.model:"default",i=typeof t.reasoningEffort=="string"?t.reasoningEffort:"default",r=typeof t.mode=="string"?t.mode:"normal",a=typeof t.permissionPolicy=="string"?t.permissionPolicy:"default",l=`CLI spawn: model=${o} \xB7 effort=${i} \xB7 mode=${r} \xB7 permission=${a}`;this.parent.pushConsoleMessage({type:"info",text:l,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"stdout-line":case"stderr-line":break;default:{let o=e.eventType;this.parent.pushConsoleMessage({type:"raw",text:o,rawData:t});break}}}handleStatusUpdate(e){let s=e.sessionId??"",n=e.status??"",t=e.statusMessage;this.parent.lastStatusUpdate_$.set({sessionId:s,status:n,statusMessage:t});let i=this.parent.sessions_$().map(a=>a.sessionId===s?S(h({},a),{status:n,statusMessage:t}):a);this.parent.sessions_$.set(i);let r=this.parent.selectedSession_$();if(r?.session.sessionId===s){let a=u.isLiveCcSessionStatus(n);this.parent.selectedSession_$.set(S(h({},r),{session:S(h({},r.session),{status:n,statusMessage:t}),runtime:S(h({},r.runtime),{isLive:a,runtimeStatus:n})}))}if(n==="errored"){let a=(t??"").trim();if(a.startsWith("Auto-recovery: terminal runner dropped silently")||a.startsWith("Exit code:"))M.DyFM_Log.warn(`CCAP_CcSession | user-task-fail diagnostic (NOT recorded to /errors) | sessionId: ${s} | statusMessage: ${a}`);else{let c=t?`CC Session error (${s}): ${t}`:`CC Session error (${s}): session entered errored state`;this.parent.showGlobalError(new Error(c),"cc-session-status")}}this.parent.evaluateSessionEventsPolling()}handleOutputChunk(e){let s=e.sessionId??"";if(s&&s!==this.parent.activeSessionId_$())return;let n=e.content??"",t=e.type??"stdout",o=this.parent.liveOutput_$(),i=n.split(`
2
2
  `),r=3e3;if(t==="stderr"){let c=new Set(this.parent.liveStderrLines_$()),m=o.length;for(let I=0;I<i.length;I++)c.add(m+I);this.parent.liveStderrLines_$.set(c)}let l=[...o,...i];if(l.length>r){let c=l.length-r,m=l.slice(c),I=this.parent.liveStderrLines_$(),b=new Set;for(let w of I){let $=w-c;$>=0&&b.add($)}this.parent.liveStderrLines_$.set(b),this.parent.liveOutput_$.set(m)}else this.parent.liveOutput_$.set(l)}handleSessionEvent(e){let s=e.sessionId??"";if(s&&s!==this.parent.activeSessionId_$())return;let n=e.event??{},t={sessionId:s,eventType:n.eventType??"",timestamp:n.timestamp??"",data:n.data??{},sequence:n.sequence??0,eventSource:typeof n.eventSource=="string"?n.eventSource:void 0};if(t.sequence<=this.parent.getLastKnownEventSequence())return;this.parent.setLastKnownEventSequence(t.sequence);let o=this.parent.selectedSessionEvents_$();this.parent.selectedSessionEvents_$.set([...o,t]),this.pushConsoleMessageFromEvent(t,!0,(i,r)=>{this.parent.showGlobalError(i,r)})}handleAgentEvent(e){let s=typeof e.phase=="string"?e.phase:void 0;if(s)switch(s){case g.runInitialization:this.parent.pushConsoleMessage({type:"status",text:"RUN initialization",isStatus:!0});break;case g.analyze:this.parent.pushConsoleMessage({type:"status",text:"Analyzing incoming message",isStatus:!0});break;case g.analyzeResult:{let n=typeof e.runIntent=="string"?e.runIntent:"";n&&this.parent.pushConsoleMessage({type:"run-intent",text:n,isStatus:!1});break}case g.assemble:this.parent.pushConsoleMessage({type:"status",text:"Refreshing Context",isStatus:!0});break;case g.executionStart:this.parent.pushConsoleMessage({type:"status",text:"Starting Agent",isStatus:!0});break;case g.llmAgenticLoop:this.parent.pushConsoleMessage({type:"status",text:"Selecting next move",isStatus:!0});break;case g.agenticLoopIteration:{let n=typeof e.action=="string"?e.action:"",t=typeof e.tool=="string"?e.tool:"",o=typeof e.intent=="string"?e.intent:"",i=[];n&&i.push(n),t&&i.push(t),o&&i.push(o);let r=i.join(" \xB7 ");r&&this.parent.pushConsoleMessage({type:"iteration",text:r,isStatus:!1});break}case g.llmToolDescription:this.parent.pushConsoleMessage({type:"status",text:"Assembling tool inputs",isStatus:!0});break;case g.llmToolErrorRetry:this.parent.pushConsoleMessage({type:"status",text:"Figuring out what's wrong",isStatus:!0});break;case g.toolErrorRetry:this.parent.pushConsoleMessage({type:"status",text:"Trying to fix inputs",isStatus:!0});break;case g.executionEnd:this.parent.pushConsoleMessage({type:"status",text:"Finishing run",isStatus:!0});break;case g.finalization:case g.llmRunFinalization:this.parent.pushConsoleMessage({type:"status",text:"Gathering what we've done",isStatus:!0});break;case g.postFinalization:this.parent.pushConsoleMessage({type:"status",text:"Memorizing stuff",isStatus:!0});break;case g.runFlowComplete:this.parent.pushConsoleMessage({type:"status",text:"Getting back to user",isStatus:!0});break}}handleRateLimitBroadcast(e){let s=e.rate_limit_info;if(!s||typeof s!="object")return;let n=s,t={status:typeof n.status=="string"?n.status:"",resetsAt:typeof n.resetsAt=="number"?n.resetsAt:0,rateLimitType:typeof n.rateLimitType=="string"?n.rateLimitType:"",utilization:typeof n.utilization=="number"?n.utilization:0,surpassedThreshold:typeof n.surpassedThreshold=="number"?n.surpassedThreshold:0,isUsingOverage:n.isUsingOverage===!0,receivedAt:new Date().toISOString()};this.parent.rateLimitInfo_$.set(t)}handleListUpdate(e){let s=e.sessions??[],o=[...this.parent.sessions_$().some(i=>i.isArchived===!0)?s:s.filter(i=>!i.isArchived)].sort((i,r)=>{let a=i.lastActivityAt?new Date(i.lastActivityAt).getTime():0;return(r.lastActivityAt?new Date(r.lastActivityAt).getTime():0)-a});this.parent.sessions_$.set(o),this.mergeActiveSessionDetail(s)}handleSessionItemUpdate(e){let s=typeof e.sessionId=="string"?e.sessionId:"";if(!s)return;let n=typeof e.update=="object"&&e.update!==null?e.update:{},o=this.parent.sessions_$().map(r=>r.sessionId!==s?r:u.applySessionFieldUpdate(r,n));this.parent.sessions_$.set(o);let i=this.parent.selectedSession_$();i?.session.sessionId===s&&this.parent.selectedSession_$.set(S(h({},i),{session:u.applySessionFieldUpdate(i.session,n)}))}static applySessionFieldUpdate(e,s){let n=h({},e);return typeof s.toolCallCountIncrement=="number"&&(n.toolCallCount=(n.toolCallCount??0)+s.toolCallCountIncrement),typeof s.promptCountIncrement=="number"&&(n.promptCount=(n.promptCount??0)+s.promptCountIncrement),typeof s.inputTokensIncrement=="number"&&(n.inputTokensTotal=(n.inputTokensTotal??0)+s.inputTokensIncrement),typeof s.outputTokensIncrement=="number"&&(n.outputTokensTotal=(n.outputTokensTotal??0)+s.outputTokensIncrement),typeof s.costUsdIncrement=="number"&&(n.costUsdTotal=(n.costUsdTotal??0)+s.costUsdIncrement),typeof s.status=="string"&&(n.status=s.status),(typeof s.statusMessage=="string"||s.statusMessage===void 0)&&(n.statusMessage=s.statusMessage),typeof s.lastActivityAt=="string"&&(n.lastActivityAt=s.lastActivityAt),typeof s.lastPrompt=="string"&&(n.lastPrompt=s.lastPrompt),typeof s.activeModel=="string"&&(n.activeModel=s.activeModel),n}mergeActiveSessionDetail(e){let s=this.parent.activeSessionId_$();if(!s)return;let n=this.parent.selectedSession_$();if(!n)return;let t=e.find(o=>o.sessionId===s);t&&this.parent.selectedSession_$.set(S(h({},n),{session:h(h({},n.session),t)}))}handleAssembledMessage(e){let s=typeof e.sessionId=="string"?e.sessionId:"",n=this.parent.activeSessionId_$();if(!s||s!==n)return;let t=e.message;if(!t||typeof t!="object"){M.DyFM_Log.warn("CCAP_CcSession_DS | handleAssembledMessage dropped: invalid message payload",{sessionId:s,payloadKeys:Object.keys(e)});return}let o=t,i=this.parent.assembledMessages_$(),r=typeof o.messageKey=="string"?o.messageKey:"";r&&i.some(a=>a.messageKey===r)||this.parent.assembledMessages_$.set(_.sortAsc([...i,o]))}handleAssembledMessageUpdate(e){let s=typeof e.sessionId=="string"?e.sessionId:"";if(!s||s!==this.parent.activeSessionId_$())return;let n=typeof e.messageKey=="string"?e.messageKey:"";if(!n)return;let t=e.update;if(!t||typeof t!="object")return;let o=t,i=this.parent.assembledMessages_$(),r=i.findIndex(c=>c.messageKey===n);if(r<0)return;let a=h({},i[r]);typeof o.bodyText=="string"&&(a.bodyText=o.bodyText),o.toolResult!==void 0&&(a.toolResult=o.toolResult),typeof o.toolStatus=="string"&&(a.toolStatus=o.toolStatus),o.headerStatusDot!==void 0&&(a.headerStatusDot=typeof o.headerStatusDot=="string"?o.headerStatusDot:void 0);let l=[...i];l[r]=a,this.parent.assembledMessages_$.set(l)}handleCliChunkEvent(e){let s=typeof e.type=="string"?e.type:"";if(s==="rate_limit_event"){let n=e.rate_limit_info;if(n&&typeof n=="object"){let t=n,o={status:typeof t.status=="string"?t.status:"",resetsAt:typeof t.resetsAt=="number"?t.resetsAt:0,rateLimitType:typeof t.rateLimitType=="string"?t.rateLimitType:"",utilization:typeof t.utilization=="number"?t.utilization:0,surpassedThreshold:typeof t.surpassedThreshold=="number"?t.surpassedThreshold:0,isUsingOverage:t.isUsingOverage===!0,receivedAt:new Date().toISOString()};this.parent.rateLimitInfo_$.set(o)}return}if(s==="system"){this.handleCliChunkSystemEvent(e);return}this.handleCliChunkToolResults(e)||this.parent.pushConsoleMessage({type:"raw",text:s||"cli-chunk",rawData:e})}handleCliChunkSystemEvent(e){let s=typeof e.subtype=="string"?e.subtype:"",n=typeof e.description=="string"?e.description:u.buildSystemEventBrief({subtype:s,data:e}),t=typeof e.tool_use_id=="string"?e.tool_use_id:"";t&&this.agentToolUseIds.has(t)&&(this.activeSubAgentId=t);let o=t&&this.agentToolUseIds.has(t)?t:this.activeSubAgentId||void 0,i=typeof e.last_tool_name=="string"?e.last_tool_name:"";if(s==="task_progress"&&i){this.parent.pushConsoleMessage({type:"tool",text:`${i}: ${n}`,isStatus:!1,rawData:e,parentAgentId:o});return}this.parent.pushConsoleMessage({type:"status-update",text:n,subtype:s,isStatus:!1,rawData:e,parentAgentId:o})}pushResponseChunkBlocks(e){let s=e.message,n=s&&typeof s=="object"?s.content:e.content;if(Array.isArray(n)){for(let t of n){if(!t||typeof t!="object")continue;let o=t,i=typeof o.type=="string"?o.type:"";if(i==="text"){let r=typeof o.text=="string"?o.text:"";r&&(this.activeSubAgentId="",this.parent.pushConsoleMessage({type:"assistant",text:r,rawData:e}))}else if(i==="tool_use")this.handleResponseChunkToolUse(o,e);else if(i==="tool_result")this.handleResponseChunkToolResult(o);else if(i==="thinking"){let r=typeof o.thinking=="string"?o.thinking:"";r&&this.parent.pushConsoleMessage({type:"thinking",text:r,rawData:o,parentAgentId:this.activeSubAgentId||void 0})}else i&&this.parent.pushConsoleMessage({type:"raw",text:i,rawData:o})}return}if(typeof n=="string"&&n){this.parent.pushConsoleMessage({type:"assistant",text:n,rawData:e});return}this.parent.pushConsoleMessage({type:"raw",text:"response-chunk",rawData:e})}handleResponseChunkToolUse(e,s){let n=typeof e.name=="string"?e.name:"unknown",t=typeof e.id=="string"?e.id:"";t&&this.toolUseIdToName.set(t,n),n==="Agent"&&t&&this.agentToolUseIds.add(t);let o=e.input,i=o?u.summarizeToolInput(o):"",r=i?`${n}: ${i}`:n,a=n==="Edit"?u.buildEditExpandableContent(o):void 0,l=n==="Agent"?"":this.activeSubAgentId;this.parent.pushConsoleMessage({type:"tool",text:r,expandableContent:a,rawData:e,parentAgentId:l||void 0})}handleResponseChunkToolResult(e){let s=typeof e.tool_use_id=="string"?e.tool_use_id:"",n=s&&this.agentToolUseIds.has(s)?s:this.activeSubAgentId||"",t=e.content??e.output,o=typeof t=="string"?t:"",i=o.length>200?o.substring(0,200)+"\u2026":o||"tool_result";this.parent.pushConsoleMessage({type:"tool-result",text:i,expandableContent:o.length>200?o:void 0,rawData:e,parentAgentId:n||void 0})}handleCliChunkToolResults(e){if((typeof e.type=="string"?e.type:"")!=="user")return!1;let n=e.message,t=n&&typeof n=="object"?n.content:null;if(!Array.isArray(t))return!1;let o=typeof e.parent_tool_use_id=="string"?e.parent_tool_use_id:"",i=!1;for(let r of t){if(!r||typeof r!="object")continue;let a=r,l=typeof a.type=="string"?a.type:"";if(l==="tool_result"){let c=typeof a.tool_use_id=="string"?a.tool_use_id:"",m=c?this.toolUseIdToName.get(c)??"":"",I=a.content,b=typeof I=="string"?I:"",w=a.is_error===!0,$=m?`${m}: `:"",k=b.length>200?b.substring(0,200)+"\u2026":b||"tool result",F=w?`${$}ERROR \u2014 ${k}`:`${$}${k}`;this.parent.pushConsoleMessage({type:"tool-result",text:F,expandableContent:b.length>200?b:void 0,rawData:S(h({},a),{parent_tool_use_id:o||void 0}),parentAgentId:o||void 0}),i=!0}else if(l==="text"&&o){let c=typeof a.text=="string"?a.text:"";if(c){let m=c.length>200?c.substring(0,200)+"\u2026":c;this.parent.pushConsoleMessage({type:"tool-result",text:m,expandableContent:c.length>200?c:void 0,rawData:{tool_use_id:o,type:"sub-agent-prompt",text:c},parentAgentId:o}),i=!0}}}return i}static isLiveCcSessionStatus(e){return e==="running"||e==="waiting-input"||e==="starting"}static buildSystemEventBrief(e){switch(e.subtype){case"init":{let s=typeof e.data.cwd=="string"?e.data.cwd:"",n=typeof e.data.model=="string"?e.data.model:"",t=["init"];return s&&t.push(s),n&&t.push(n),t.join(" \xB7 ")}case"task_updated":{let s=e.data.patch,n=s&&typeof s=="object"&&typeof s.status=="string"?s.status:"";return n?`task ${n}`:"task updated"}case"task_notification":{let s=typeof e.data.status=="string"?e.data.status:"";return s?`task ${s}`:"task notification"}default:return e.subtype||"system"}}static buildEditExpandableContent(e){if(!e||typeof e!="object")return;let s=e,n=s.old_string,t=s.new_string;if(typeof n!="string"||typeof t!="string")return;let o=500,i=n.length>o?n.substring(0,o)+"\u2026":n,r=t.length>o?t.substring(0,o)+"\u2026":t;return JSON.stringify({old:i,new:r})}static summarizeToolInput(e){if(typeof e=="string")return e.length>120?e.substring(0,120)+"\u2026":e;if(e&&typeof e=="object"){let s=e,n=s.file_path??s.path,t=s.command,o=s.pattern;if(typeof n=="string")return n;if(typeof t=="string")return t.length>120?t.substring(0,120)+"\u2026":t;if(typeof o=="string")return o}return""}accumulateUsage(e){let s=e.usage,n=typeof e.cost_usd=="number"?e.cost_usd:0,t=0,o=0;if(s&&typeof s=="object"){let r=s;t=typeof r.input_tokens=="number"?r.input_tokens:typeof r.promptTokens=="number"?r.promptTokens:0,o=typeof r.output_tokens=="number"?r.output_tokens:typeof r.completionTokens=="number"?r.completionTokens:0}let i=this.parent.sessionUsage_$();this.parent.sessionUsage_$.set({promptTokens:i.promptTokens+t,completionTokens:i.completionTokens+o,totalTokens:i.totalTokens+t+o,costUsd:i.costUsd+n})}static \u0275fac=function(s){return new(s||u)};static \u0275prov=A({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();var ne=(()=>{class u{sessions_$=p([]);sessionsLoading_$=p(!1);sessionsLoadError_$=p(null);selectedSession_$=p(null);selectedSessionLoading_$=p(!1);selectedSessionEvents_$=p([]);liveOutput_$=p([]);liveStderrLines_$=p(new Set);consoleMessages_$=p([]);assembledMessages_$=p([]);assembledMessagesHasMore_$=p(!1);isLoadingOlderMessages_$=p(!1);assembledMessagesLoaded_$=p(!1);lastStatusUpdate_$=p(null);sessionUsage_$=p({promptTokens:0,completionTokens:0,totalTokens:0,costUsd:0});rateLimitInfo_$=p(null);activeSessionId_$=p("");ccSession_AS=v(R);extSessionMsg_AS=v(q);globalError_CS=v(L);socket_CS=v(P);ngZone=v(T);peiContext_DS=v(U);socketEventHandler_CS=v(x);eventSubscription=null;reconnectSubscription=null;lastKnownEventSequence=-1;static SESSION_EVENTS_POLL_INTERVAL_MS=5*f.second;sessionEventsPollHandle=null;isSessionEventsPollInFlight=!1;constructor(){this.socketEventHandler_CS.init(this),this.eventSubscription=this.socket_CS.event$.subscribe(e=>{this.ngZone.run(()=>{this.socketEventHandler_CS.handleSocketEvent(e,{selectedCcapId:this.peiContext_DS.activeCcapId_$(),globalErrorShowError:(s,n)=>{this.globalError_CS.showError(s,n)}})})}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(e=>{if(!e)return;let s=this.activeSessionId_$();s&&(this.socket_CS.emit("cc-session:subscribe",{sessionId:s}),this.loadAssembledMessages({sessionId:s}).catch(()=>{}),this.loadSessionDetail({sessionId:s}).catch(()=>{})),this.loadSessions().catch(()=>{}),this.backfillMissedEvents()})}ngOnDestroy(){this.stopSessionEventsPolling(),this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null),this.reconnectSubscription&&(this.reconnectSubscription.unsubscribe(),this.reconnectSubscription=null)}showGlobalError(e,s){this.globalError_CS.showError(e,s)}getLastKnownEventSequence(){return this.lastKnownEventSequence}setLastKnownEventSequence(e){this.lastKnownEventSequence=e}evaluateSessionEventsPolling(){let e=this.activeSessionId_$(),s=this.resolveActiveSessionStatusForEventsPolling();!!(e&&this.lastKnownEventSequence>=0&&s!=null&&x.isLiveCcSessionStatus(s))?this.ensureSessionEventsPollingStarted():this.stopSessionEventsPolling()}loadSessions(e){return d(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let n=[...(yield this.ccSession_AS.listSessions({status:e?.status,workspacePath:e?.workspacePath,includeArchived:e?.includeArchived})).sessions].sort((t,o)=>{let i=t.lastActivityAt?new Date(t.lastActivityAt).getTime():0;return(o.lastActivityAt?new Date(o.lastActivityAt).getTime():0)-i});this.sessions_$.set(n)}catch(s){this.sessionsLoadError_$.set(s)}finally{this.sessionsLoading_$.set(!1)}})}loadPersistedRateLimitState(e){return d(this,null,function*(){let s=e.ccapId?.trim()??"";if(s)try{let n=yield this.ccSession_AS.getRateLimitState({ccapId:s});this.mergePersistedRateLimitState(n.items)}catch(n){f.DyFM_Log.warn(`ClaudeCode_DS | loadPersistedRateLimitState failed (non-blocking) | ccapId: ${s} | ${n instanceof Error?n.message:String(n)}`)}})}mergePersistedRateLimitState(e){if(this.rateLimitInfo_$()!==null)return;let s=O.mapServerItemsToClientInfo(e);s!==null&&this.rateLimitInfo_$.set(s)}loadSessionDetail(e){return d(this,null,function*(){this.selectedSessionLoading_$.set(!0);try{let s=yield this.ccSession_AS.getSession({sessionId:e.sessionId}),n=this.activeSessionId_$();if(n&&n!==e.sessionId){f.DyFM_Log.info(`CCAP_CcSession_DS | loadSessionDetail stale response \u2014 discarded | requestedSessionId: ${e.sessionId} | currentActiveSessionId: ${n}`);return}this.selectedSession_$.set(s)}catch(s){let n=this.activeSessionId_$();if(n&&n!==e.sessionId)return;this.selectedSession_$.set(null);let t=s instanceof Error?s.message:"Failed to load session details";this.pushConsoleMessage({type:"error",text:`Load session failed: ${t}`})}finally{this.selectedSessionLoading_$.set(!1),this.evaluateSessionEventsPolling()}})}loadSessionEvents(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.getSessionEvents({sessionId:e.sessionId,eventType:e.eventType,limit:e.limit??500,latest:!0}),n=this.activeSessionId_$();if(n&&n!==e.sessionId){f.DyFM_Log.info(`CCAP_CcSession_DS | loadSessionEvents stale response \u2014 discarded | requestedSessionId: ${e.sessionId} | currentActiveSessionId: ${n}`);return}this.selectedSessionEvents_$.set(s.events),this.updateLastKnownSequence(s.events);for(let t of s.events)this.socketEventHandler_CS.pushConsoleMessageFromEvent(t,!1,(o,i)=>{this.globalError_CS.showError(o,i)});this.loadAssembledMessages({sessionId:e.sessionId}).catch(()=>{})}catch{let n=this.activeSessionId_$();if(n&&n!==e.sessionId)return;this.selectedSessionEvents_$.set([])}finally{this.evaluateSessionEventsPolling()}})}createSession(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.createSession(e),n=String(s.session.sessionId||"");return yield this.loadSessions(),n}catch(s){throw this.pushConsoleMessage({type:"error",text:`Create session failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}sendPrompt(e){return d(this,null,function*(){let s=e.attachments?.filter(n=>n.isImage&&!!n.base64).map(n=>`data:${n.mimeType};base64,${n.base64}`);this.pushConsoleMessage({type:"prompt",text:e.content,imageDataUrls:s?.length?s:void 0});try{let n=yield this.ccSession_AS.sendPrompt(e);n.relayed&&(n.targetOnline?this.pushConsoleMessage({type:"info",text:`Prompt relayed to remote instance (task: ${n.taskId?.substring(0,8)}\u2026)`}):this.pushConsoleMessage({type:"error",text:`\u26A0 A t\xE1voli instance jelenleg offline \u2014 a prompt queue-ban v\xE1rakozik (task: ${n.taskId?.substring(0,8)}\u2026) \xE9s csak akkor k\xE9zbes\xEDt\u0151dik, ha a target instance online lesz. Ellen\u0151rizd, hogy mindk\xE9t instance fut, \xE9s a Settings \u2192 Cluster sharedSecret azonos.`})),this.evaluateSessionEventsPolling()}catch(n){throw this.pushConsoleMessage({type:"error",text:`Send failed: ${y.getErrorMessageForDisplay(n)}`}),this.globalError_CS.showError(n,"CC Session sendPrompt"),n}})}forkSession(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.forkSession({sessionId:e.sessionId,label:e.label}),n=String(s.session.sessionId||"");return yield this.loadSessions(),n}catch(s){throw this.pushConsoleMessage({type:"error",text:`Fork session failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}resumeSession(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.resumeSession(e);s.relayed&&this.pushConsoleMessage({type:"info",text:s.targetOnline?"Resume relayed to remote instance":"Resume queued for offline remote instance"}),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Resume failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}stopExecution(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.stopExecution(e);if(s.relayed){this.pushSystemAssembledMessage({sessionId:e.sessionId,text:s.targetOnline?"Stop execution relayed to remote instance":"Stop execution queued for offline remote instance",role:"info"});return}let n=s.message||"Execution stopped";this.pushSystemAssembledMessage({sessionId:e.sessionId,text:n,role:"info"})}catch(s){throw this.pushSystemAssembledMessage({sessionId:e.sessionId,text:`Stop execution failed: ${y.getErrorMessageForDisplay(s)}`,role:"error"}),s}})}loadDiagnostic(e){return d(this,null,function*(){try{return yield this.ccSession_AS.getDiagnostic({sessionId:e.sessionId})}catch(s){return f.DyFM_Log.error(`CCAP_CcSession_DS | loadDiagnostic failed | sessionId: ${e.sessionId}`,s),null}})}terminateSession(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.terminateSession(e);s.relayed?this.pushSystemAssembledMessage({sessionId:e.sessionId,text:s.targetOnline?"Terminate relayed to remote instance":"Terminate queued for offline remote instance",role:"info"}):this.pushSystemAssembledMessage({sessionId:e.sessionId,text:"Session terminated",role:"status"}),yield this.loadSessions()}catch(s){throw this.pushSystemAssembledMessage({sessionId:e.sessionId,text:`Terminate failed: ${y.getErrorMessageForDisplay(s)}`,role:"error"}),s}})}restartRunner(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.restartRunner(e);this.pushSystemAssembledMessage({sessionId:e.sessionId,text:`Runner restarted (new terminalId: ${s.newTerminalId.slice(0,8)}\u2026). New terminal window should open shortly.`,role:"info"})}catch(s){throw this.pushSystemAssembledMessage({sessionId:e.sessionId,text:`Runner restart failed: ${y.getErrorMessageForDisplay(s)}`,role:"error"}),s}})}setSessionArchived(e){return d(this,null,function*(){try{yield this.ccSession_AS.setSessionArchived(e),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Archive failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}updateSessionConfig(e){return d(this,null,function*(){try{yield this.ccSession_AS.updateSessionConfig(e);let s=this.selectedSession_$();if(s?.session.sessionId===e.sessionId){let n=h({},s.session);e.label!=null&&(n.label=e.label),e.mode!=null&&(n.mode=e.mode),e.permissionPolicy!=null&&(n.permissionPolicy=e.permissionPolicy),e.reasoningEffort!=null&&(n.reasoningEffort=e.reasoningEffort),e.model!=null&&(n.model=e.model),e.isDebugMode!=null&&(n.isDebugMode=e.isDebugMode),this.selectedSession_$.set(S(h({},s),{session:n}))}if(e.label!=null){let n=this.sessions_$(),t=n.findIndex(o=>o.sessionId===e.sessionId);if(t>=0){let o=[...n];o[t]=S(h({},o[t]),{label:e.label}),this.sessions_$.set(o)}}}catch(s){throw this.pushConsoleMessage({type:"error",text:`Config update failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}setActiveSessionId(e){let s=this.activeSessionId_$();s!==e&&this.stopSessionEventsPolling(),s&&s!==e&&this.socket_CS.emit("cc-session:unsubscribe",{sessionId:s}),this.activeSessionId_$.set(e),e&&this.socket_CS.emit("cc-session:subscribe",{sessionId:e})}clearLiveOutput(){this.stopSessionEventsPolling(),this.liveOutput_$.set([]),this.liveStderrLines_$.set(new Set),this.consoleMessages_$.set([]),this.assembledMessages_$.set([]),this.assembledMessagesHasMore_$.set(!1),this.isLoadingOlderMessages_$.set(!1),this.assembledMessagesLoaded_$.set(!1),this.selectedSession_$.set(null),this.selectedSessionEvents_$.set([]),this.lastStatusUpdate_$.set(null),this.sessionUsage_$.set({promptTokens:0,completionTokens:0,totalTokens:0,costUsd:0}),this.lastKnownEventSequence=-1,this.socketEventHandler_CS.resetTrackingState()}pushConsoleMessage(e){let s=e.type==="assistant"||e.type==="prompt"?e.text.trim():e.text,n={listKey:e.listKey??this.allocateConsoleListKey(),type:e.type,text:s,timestamp:e.timestamp??new Date().toISOString(),isStatus:e.isStatus??!1,expandableContent:e.expandableContent,rawData:e.rawData,subtype:e.subtype,parentAgentId:e.parentAgentId,imageDataUrls:e.imageDataUrls},t=this.consoleMessages_$();this.consoleMessages_$.set([...t,n])}loadAssembledMessages(e){return d(this,null,function*(){try{let s=yield this.extSessionMsg_AS.getMessages({sessionId:e.sessionId,latest:!0}),n=this.activeSessionId_$();if(n&&n!==e.sessionId){f.DyFM_Log.info(`CCAP_CcSession_DS | loadAssembledMessages stale \u2014 discarded | requestedSessionId: ${e.sessionId} | currentActiveSessionId: ${n} | restMessageCount: ${s.messages.length}`);return}let t=this.assembledMessages_$(),o=new Set(s.messages.map(r=>r.messageKey).filter(r=>typeof r=="string"&&r.length>0)),i=t.filter(r=>!o.has(r.messageKey));this.assembledMessages_$.set(_.sortAsc([...s.messages,...i])),this.assembledMessagesHasMore_$.set(s.hasMore)}catch(s){f.DyFM_Log.error(`CCAP_CcSession_DS | loadAssembledMessages failed | sessionId: ${e.sessionId}`,s)}finally{this.assembledMessagesLoaded_$.set(!0)}})}loadOlderAssembledMessages(e){return d(this,null,function*(){if(this.isLoadingOlderMessages_$()||!this.assembledMessagesHasMore_$())return;let s=this.assembledMessages_$();if(!s.length)return;let n=s.reduce((t,o)=>(o.sequence??0)<t?o.sequence??0:t,s[0].sequence??0);this.isLoadingOlderMessages_$.set(!0);try{let t=yield this.extSessionMsg_AS.getMessages({sessionId:e.sessionId,beforeSequence:n,limit:e.limit??50});t.messages.length&&this.assembledMessages_$.set(_.sortAsc([...t.messages,...s])),this.assembledMessagesHasMore_$.set(t.hasMore)}catch(t){f.DyFM_Log.error(`CCAP_CcSession_DS | loadOlderAssembledMessages failed | sessionId: ${e.sessionId}`,t)}finally{this.isLoadingOlderMessages_$.set(!1)}})}pushSystemAssembledMessage(e){let s=this.assembledMessages_$(),n=s.length?s.reduce((o,i)=>(i.sequence??0)>o?i.sequence??0:o,0):0,t={messageKey:`sys-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,sessionId:e.sessionId,sessionType:"cc",messageRole:e.role,bodyText:e.text,timestamp:new Date().toISOString(),sequence:n+1};this.assembledMessages_$.set(_.sortAsc([...s,t])),this.pushConsoleMessage({type:e.role==="error"?"error":e.role==="status"?"status":"info",text:e.text,isStatus:e.role==="status"})}allocateConsoleListKey(){return globalThis.crypto.randomUUID()}pullEventsSinceLastKnownSequence(e){return d(this,null,function*(){let s=this.activeSessionId_$();if(!(!s||this.lastKnownEventSequence<0))try{let t=(yield this.ccSession_AS.getSessionEvents({sessionId:s,sinceSequence:this.lastKnownEventSequence})).events;if(!t.length)return;this.ngZone.run(()=>{let o=this.activeSessionId_$();if(o!==s){f.DyFM_Log.info(`CCAP_CcSession_DS | pull(${e}) stale \u2014 discarded | requestedSessionId: ${s} | currentActiveSessionId: ${o} | newEventCount: ${t.length}`);return}let i=this.selectedSessionEvents_$();this.selectedSessionEvents_$.set([...i,...t]);for(let r of t)this.socketEventHandler_CS.pushConsoleMessageFromEvent(r,!0,(a,l)=>{this.globalError_CS.showError(a,l)});this.updateLastKnownSequence(t)})}catch(n){let t=e==="poll"?"session events poll failed":"backfill failed";f.DyFM_Log.warn(`CCAP_CcSession_DS | ${t}`,n)}})}backfillMissedEvents(){return d(this,null,function*(){yield this.pullEventsSinceLastKnownSequence("backfill")})}updateLastKnownSequence(e){for(let s of e)s.sequence>this.lastKnownEventSequence&&(this.lastKnownEventSequence=s.sequence)}resolveActiveSessionStatusForEventsPolling(){let e=this.activeSessionId_$();if(!e)return null;let s=this.selectedSession_$();if(s?.session.sessionId===e)return s.session.status;let n=this.lastStatusUpdate_$();return n?.sessionId===e?n.status:this.sessions_$().find(o=>o.sessionId===e)?.status??null}ensureSessionEventsPollingStarted(){this.sessionEventsPollHandle===null&&(this.sessionEventsPollHandle=setInterval(()=>{this.onSessionEventsPollTick()},u.SESSION_EVENTS_POLL_INTERVAL_MS))}stopSessionEventsPolling(){this.sessionEventsPollHandle!==null&&(clearInterval(this.sessionEventsPollHandle),this.sessionEventsPollHandle=null),this.isSessionEventsPollInFlight=!1}onSessionEventsPollTick(){return d(this,null,function*(){if(!this.isSessionEventsPollInFlight){this.isSessionEventsPollInFlight=!0;try{yield this.pullEventsSinceLastKnownSequence("poll");let e=this.activeSessionId_$();e&&(yield this.loadAssembledMessages({sessionId:e}))}finally{this.isSessionEventsPollInFlight=!1}}})}static \u0275fac=function(s){return new(s||u)};static \u0275prov=A({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();export{ne as a};
3
- //# sourceMappingURL=chunk-QS6XFT7T.js.map
3
+ //# sourceMappingURL=chunk-VFHCDW6E.js.map
@@ -1,2 +1,2 @@
1
- import{a as E}from"./chunk-XXHJIU7S.js";import{a as I}from"./chunk-SRM3VZ3S.js";import{e as v}from"./chunk-HM7DY6UV.js";import{L,p as F,t as k,w as c}from"./chunk-AK3BNMCA.js";import{C as $,a as _,aa as i,b as S,h as A,hb as T,k as o,y as P}from"./chunk-TBMJSIBB.js";var a=A(F());var D="model-test-run-progress",w="model-test-result-saved",M=5e3,q=(()=>{class d{runPollingInterval=null;modelTestRunProgressSocketSub=null;modelTestResultSavedSocketSub=null;lastListFilters=void 0;list_$=i([]);listLoading_$=i(!1);listLoadError_$=i(null);registryProviderIds_$=i([]);selectedEntryId_$=i("");entryDetail_$=i(null);entryDetailLoading_$=i(!1);entryDetailNotFound_$=i(!1);entryDetailLoadError_$=i(null);prompts_$=i([]);promptsLoading_$=i(!1);results_$=i([]);testRunId_$=i("");testRunStatus_$=i(null);testRunPollingActive_$=i(!1);testRunError_$=i(null);testRunSelectedModelIds_$=i([]);testRunPanelDismissed_$=i(!1);testRunPanelVisible_$=T(()=>{let t=this.testRunId_$(),e=this.testRunStatus_$();return!(!t||e==null||this.testRunPanelDismissed_$())});setupConfigForRegistry_$=i(null);syncing_$=i(!1);modelTestRunProgressCurrentTask_$=i(null);modelRegistry_AS=$(E);settings_AS=$(L);socket_CS=$(v);ngOnDestroy(){this.stopRunPolling(),this.stopModelTestRunProgressSocket(),this.stopModelTestResultSavedSocket()}loadList(t){return o(this,null,function*(){t!==void 0&&(this.lastListFilters=t),this.listLoading_$.set(!0),this.listLoadError_$.set(null);try{let s=(yield this.modelRegistry_AS.getList(t)).list??[];return this.list_$.set(s),s}catch(e){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | Failed to load list",e),this.listLoadError_$.set(e),[]}finally{this.listLoading_$.set(!1)}})}loadRegistryProviderIdsUnfiltered(){return o(this,null,function*(){try{let e=(yield this.modelRegistry_AS.getList({})).list??[],s=d.collectSortedUniqueProviderIds(e);this.registryProviderIds_$.set(s)}catch(t){a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | Failed to load registry provider ids for filter UI (unfiltered list)",t)}})}deleteRegistryEntry(t){return o(this,null,function*(){this.listLoadError_$.set(null);try{return yield this.modelRegistry_AS.deleteEntry(t),yield this.loadList(this.lastListFilters),yield this.loadRegistryProviderIdsUnfiltered(),!0}catch(e){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | deleteRegistryEntry failed",e),this.listLoadError_$.set(e),!1}})}deleteRegistryEntries(t){return o(this,null,function*(){this.listLoadError_$.set(null);try{let e=yield this.modelRegistry_AS.deleteEntries(t);return yield this.loadList(this.lastListFilters),yield this.loadRegistryProviderIdsUnfiltered(),e}catch(e){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | deleteRegistryEntries failed",e),this.listLoadError_$.set(e),null}})}static collectSortedUniqueProviderIds(t){let e=t.map(s=>s.provider??"").filter(s=>s!=="");return[...new Set(e)].sort()}setSelectedEntryId(t){this.selectedEntryId_$.set(t??"")}loadEntry(t){return o(this,null,function*(){this.entryDetailLoading_$.set(!0),this.entryDetailNotFound_$.set(!1),this.entryDetailLoadError_$.set(null),this.selectedEntryId_$()!==t&&(this.entryDetail_$.set(null),this.results_$.set([]));try{let r=((yield this.modelRegistry_AS.getList(this.lastListFilters)).list??[]).find(f=>f.id===t);if(!r)return this.entryDetail_$.set(null),this.entryDetailNotFound_$.set(!0),null;this.entryDetail_$.set(r);let n=r.reasoningLevelForTest?.trim()||"none",l=yield this.modelRegistry_AS.getTestResults({provider:r.provider,model:r.modelName,limit:200,reasoningLevel:n});return this.results_$.set(l.results??[]),r}catch(e){a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | Failed to load entry",e);let s=e instanceof Error?e.message:String(e);return this.entryDetailLoadError_$.set(s),this.selectedEntryId_$()===t&&this.entryDetail_$.set(null),null}finally{this.entryDetailLoading_$.set(!1)}})}loadPrompts(){return o(this,null,function*(){this.promptsLoading_$.set(!0);try{let e=(yield this.modelRegistry_AS.getPrompts()).prompts??[];return this.prompts_$.set(e),e}catch(t){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | Failed to load prompts",t),this.prompts_$.set([]),[]}finally{this.promptsLoading_$.set(!1)}})}loadResults(t,e,s){return o(this,null,function*(){try{let n=(yield this.modelRegistry_AS.getTestResults({provider:t,model:e,limit:200,reasoningLevel:s})).results??[];return this.results_$.set(n),n}catch(r){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | Failed to load results",r),[]}})}sync(){return o(this,null,function*(){this.syncing_$.set(!0),this.listLoadError_$.set(null);try{let t=yield this.modelRegistry_AS.sync();return yield Promise.all([this.loadSetupConfigForRegistry(),this.loadList(this.lastListFilters),this.loadRegistryProviderIdsUnfiltered()]),t}catch(t){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | Sync failed",t),this.listLoadError_$.set(t),null}finally{this.syncing_$.set(!1)}})}setEnabled(t,e){return o(this,null,function*(){this.listLoadError_$.set(null);try{return yield this.modelRegistry_AS.setEnabled(t,e),yield this.loadList(this.lastListFilters),!0}catch(s){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | setEnabled failed",s),this.listLoadError_$.set(s),!1}})}patchEntry(t,e){return o(this,null,function*(){this.listLoadError_$.set(null);let s=this.selectedEntryId_$()===t,r=this.entryDetail_$();if(s&&r&&e.reasoningLevelForTest!==void 0&&this.entryDetail_$.update(n=>n?S(_({},n),{reasoningLevelForTest:e.reasoningLevelForTest}):null),s&&r&&e.enabled!==void 0){let n=e.enabled;this.entryDetail_$.update(l=>l?S(_({},l),{enabled:n}):null)}s&&r&&e.capabilities!==void 0&&this.entryDetail_$.update(n=>n?S(_({},n),{capabilities:e.capabilities}):null);try{return yield this.modelRegistry_AS.patchEntry(t,e),yield this.loadList(this.lastListFilters),s&&(e.reasoningLevelForTest!==void 0&&e.enabled===void 0&&e.capabilities===void 0||(yield this.loadEntry(t))),!0}catch(n){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | patchEntry failed",n),this.listLoadError_$.set(n),s&&this.entryDetail_$()&&this.loadEntry(t),!1}})}setReasoningLevelForTest(t,e){return o(this,null,function*(){return this.patchEntry(t,{reasoningLevelForTest:e})})}bulkSetEnabled(t,e){return o(this,null,function*(){this.listLoadError_$.set(null);try{let s=yield this.modelRegistry_AS.bulkSetEnabled(t,e);return yield this.loadList(this.lastListFilters),s.updated}catch(s){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | bulkSetEnabled failed",s),this.listLoadError_$.set(s),null}})}startTestRun(t,e){return o(this,null,function*(){this.testRunError_$.set(null);try{let s=yield this.modelRegistry_AS.startTestRun(t,e);return this.testRunPanelDismissed_$.set(!1),this.testRunSelectedModelIds_$.set([...t]),this.testRunId_$.set(s.runId),this.testRunStatus_$.set({runId:s.runId,status:c.pending,results:[]}),this.startModelTestRunProgressSocket(),this.startModelTestResultSavedSocket(),this.startRunPolling(s.runId),s.runId}catch(s){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | startTestRun failed",s),this.testRunError_$.set(s),null}})}startRunPolling(t){this.clearRunPollingIntervalOnly(),this.testRunPollingActive_$.set(!0);let e=M;this.runPollingInterval=setInterval(()=>{this.pollRunStatus(t)},e),this.pollRunStatus(t)}clearRunPollingIntervalOnly(){this.runPollingInterval&&(clearInterval(this.runPollingInterval),this.runPollingInterval=null)}stopRunPolling(){this.clearRunPollingIntervalOnly(),this.testRunPollingActive_$.set(!1),this.testRunId_$.set(""),this.testRunStatus_$.set(null),this.testRunError_$.set(null),this.modelTestRunProgressCurrentTask_$.set(null),this.testRunSelectedModelIds_$.set([]),this.testRunPanelDismissed_$.set(!1)}dismissTestRunPanel(){this.testRunPanelDismissed_$.set(!0)}pollRunStatus(t){return o(this,null,function*(){try{let e=yield this.modelRegistry_AS.getTestRunStatus(t);this.testRunStatus_$.set(e),(e.status==="completed"||e.status==="failed")&&(this.clearRunPollingIntervalOnly(),this.testRunPollingActive_$.set(!1))}catch(e){this.testRunError_$.set(e),this.clearRunPollingIntervalOnly(),this.testRunPollingActive_$.set(!1)}})}startModelTestRunProgressSocket(){this.modelTestRunProgressSocketSub||(this.modelTestRunProgressSocketSub=this.socket_CS.event$.subscribe(t=>{if(t.event!=="user-notification")return;let e=t.payload??{};if(e.type!==D)return;let s=e.runId,r=e.status,n=e.current,l=e.total,f=e.currentTask,m=e.error,u=e.failedTask,g=e.errorDetails;this.setTestRunProgressFromSocket({runId:typeof s=="string"?s:void 0,status:typeof r=="string"?r:void 0,current:typeof n=="number"?n:void 0,total:typeof l=="number"?l:void 0,currentTask:f,error:typeof m=="string"?m:void 0,failedTask:u,errorDetails:g})}))}stopModelTestRunProgressSocket(){this.modelTestRunProgressSocketSub&&(this.modelTestRunProgressSocketSub.unsubscribe(),this.modelTestRunProgressSocketSub=null)}startModelTestResultSavedSocket(){this.modelTestResultSavedSocketSub||(this.modelTestResultSavedSocketSub=this.socket_CS.event$.subscribe(t=>{if(t.event!=="user-notification")return;let e=t.payload??{};e.type===w&&this.mergeResultFromSocket(e)}))}stopModelTestResultSavedSocket(){this.modelTestResultSavedSocketSub&&(this.modelTestResultSavedSocketSub.unsubscribe(),this.modelTestResultSavedSocketSub=null)}mergeResultFromSocket(t){let e=this.testRunId_$();if(!e||t.runId!==e)return;let s=this.testRunStatus_$();if(!s)return;let r=d.parseResultItemFromSocket(t);if(!r)return;let n=R=>`${R.provider}|${R.model}|${R.promptId}|${R.reasoningLevel??"none"}`,l=n(r),m=[...s.results.filter(R=>n(R)!==l),r],u=t.current,g=t.total,h=typeof u=="number"?u:s.progress?.current,y=typeof g=="number"?g:s.progress?.total;this.testRunStatus_$.set(S(_({},s),{results:m,progress:typeof y=="number"&&y>0&&typeof h=="number"?{current:Math.max(h,s.progress?.current??0),total:y}:s.progress}));let p=this.entryDetail_$();if(p&&r.provider===p.provider&&r.model===p.modelName){let b=this.results_$().filter(C=>n(C)!==l);this.results_$.set([r,...b])}}static parseResultItemFromSocket(t){let e=t.provider,s=t.model,r=t.promptId,n=t.score;return typeof e!="string"||typeof s!="string"||typeof r!="string"?null:{provider:e,model:s,promptId:r,reasoningLevel:typeof t.reasoningLevel=="string"?t.reasoningLevel:void 0,score:typeof n=="number"?n:0,analysis:typeof t.analysis=="string"?t.analysis:void 0,promptText:typeof t.promptText=="string"?t.promptText:void 0,modelOutput:typeof t.modelOutput=="string"?t.modelOutput:void 0,thinking:typeof t.thinking=="string"?t.thinking:void 0,generationTimeMs:typeof t.generationTimeMs=="number"?t.generationTimeMs:void 0,analyzerProvider:typeof t.analyzerProvider=="string"?t.analyzerProvider:void 0,analyzerModel:typeof t.analyzerModel=="string"?t.analyzerModel:void 0,inputTokens:typeof t.inputTokens=="number"?t.inputTokens:void 0,outputTokens:typeof t.outputTokens=="number"?t.outputTokens:void 0,thinkingTokens:typeof t.thinkingTokens=="number"?t.thinkingTokens:void 0,createdAt:typeof t.createdAt=="string"?t.createdAt:void 0}}setTestRunProgressFromSocket(t){let e=this.testRunId_$();if(!e||t.runId!==e)return;let s=this.testRunStatus_$();if(!s)return;let r=d.parseRunStatusFromSocket(t.status,s.status),n=d.parseFailedTaskFromSocketPayload(t.failedTask),l=d.parseErrorDetailsFromSocketPayload(t.errorDetails),f=t.error!==void 0?t.error:s.error;this.testRunStatus_$.set(S(_({},s),{status:r,progress:typeof t.total=="number"&&t.total>0?{current:t.current??0,total:t.total}:s.progress,error:f,failedTask:n??s.failedTask,errorDetails:l??s.errorDetails}));let m=typeof t.status=="string"?t.status:"";if(m===c.completed||m===c.failed){this.modelTestRunProgressCurrentTask_$.set(null);return}let u=t.currentTask;if(u&&typeof u=="object"&&u!==null&&"promptId"in u){let g=u,h=g.promptId,y=g.provider,p=g.modelName;this.modelTestRunProgressCurrentTask_$.set({provider:typeof y=="string"?y:"",modelName:typeof p=="string"?p:"",promptId:typeof h=="string"?h:""});return}this.modelTestRunProgressCurrentTask_$.set(null)}static isPlainObjectRecord(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}static parseFailedTaskFromSocketPayload(t){if(!d.isPlainObjectRecord(t))return;let e=t,s=e.provider,r=e.model,n=e.promptId;if(!(typeof s!="string"||typeof r!="string"||typeof n!="string"))return{provider:s,model:r,promptId:n}}static parseErrorDetailsFromSocketPayload(t){if(!d.isPlainObjectRecord(t))return;let e=t,s=e.message;if(typeof s!="string")return;let r=e.errorCode,n=e.stack;return{message:s,errorCode:typeof r=="string"?r:void 0,stack:typeof n=="string"?n:void 0}}static parseRunStatusFromSocket(t,e){return typeof t!="string"?e:t===c.pending?c.pending:t===c.running?c.running:t===c.completed?c.completed:t===c.failed?c.failed:e}loadSetupConfigForRegistry(){return o(this,null,function*(){try{let t=yield this.settings_AS.getSection(k.llmProviders),e=typeof t.defaultLlmProvider=="string"?t.defaultLlmProvider:void 0,s=typeof t.defaultLlmModel=="string"?t.defaultLlmModel:void 0,r={},n=t.localAiSettings;if(Array.isArray(n))for(let f of n){if(f==null||typeof f!="object"||Array.isArray(f))continue;let m=f,u=m.key,g=m.name;if(typeof u!="string"||!u.trim())continue;let h=typeof g=="string"?g.trim():"",y=h.length>0?h:"Local AI",p=I.build({localAiKey:u.trim()});r[p]={label:y}}let l={defaultLlmProvider:e,defaultLlmModel:s,llmProviderConfig:Object.keys(r).length>0?r:void 0};return this.setupConfigForRegistry_$.set(l),l}catch{return this.setupConfigForRegistry_$.set(null),null}})}getCachedList(){return this.list_$()}getCachedEntryDetail(){return this.entryDetail_$()}getCachedPrompts(){return this.prompts_$()}getCachedResults(){return this.results_$()}getCachedSetupConfigForRegistry(){return this.setupConfigForRegistry_$()}static \u0275fac=function(e){return new(e||d)};static \u0275prov=P({token:d,factory:d.\u0275fac,providedIn:"root"})}return d})();export{q as a};
2
- //# sourceMappingURL=chunk-DQRB55V3.js.map
1
+ import{a as E}from"./chunk-GVS2YOQS.js";import{a as I}from"./chunk-2RW3Z32T.js";import{e as v}from"./chunk-SQOIJHU2.js";import{L,p as F,t as k,w as c}from"./chunk-LWSSRQ3A.js";import{C as $,a as _,aa as i,b as S,h as A,hb as T,k as o,y as P}from"./chunk-TBMJSIBB.js";var a=A(F());var D="model-test-run-progress",w="model-test-result-saved",M=5e3,q=(()=>{class d{runPollingInterval=null;modelTestRunProgressSocketSub=null;modelTestResultSavedSocketSub=null;lastListFilters=void 0;list_$=i([]);listLoading_$=i(!1);listLoadError_$=i(null);registryProviderIds_$=i([]);selectedEntryId_$=i("");entryDetail_$=i(null);entryDetailLoading_$=i(!1);entryDetailNotFound_$=i(!1);entryDetailLoadError_$=i(null);prompts_$=i([]);promptsLoading_$=i(!1);results_$=i([]);testRunId_$=i("");testRunStatus_$=i(null);testRunPollingActive_$=i(!1);testRunError_$=i(null);testRunSelectedModelIds_$=i([]);testRunPanelDismissed_$=i(!1);testRunPanelVisible_$=T(()=>{let t=this.testRunId_$(),e=this.testRunStatus_$();return!(!t||e==null||this.testRunPanelDismissed_$())});setupConfigForRegistry_$=i(null);syncing_$=i(!1);modelTestRunProgressCurrentTask_$=i(null);modelRegistry_AS=$(E);settings_AS=$(L);socket_CS=$(v);ngOnDestroy(){this.stopRunPolling(),this.stopModelTestRunProgressSocket(),this.stopModelTestResultSavedSocket()}loadList(t){return o(this,null,function*(){t!==void 0&&(this.lastListFilters=t),this.listLoading_$.set(!0),this.listLoadError_$.set(null);try{let s=(yield this.modelRegistry_AS.getList(t)).list??[];return this.list_$.set(s),s}catch(e){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | Failed to load list",e),this.listLoadError_$.set(e),[]}finally{this.listLoading_$.set(!1)}})}loadRegistryProviderIdsUnfiltered(){return o(this,null,function*(){try{let e=(yield this.modelRegistry_AS.getList({})).list??[],s=d.collectSortedUniqueProviderIds(e);this.registryProviderIds_$.set(s)}catch(t){a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | Failed to load registry provider ids for filter UI (unfiltered list)",t)}})}deleteRegistryEntry(t){return o(this,null,function*(){this.listLoadError_$.set(null);try{return yield this.modelRegistry_AS.deleteEntry(t),yield this.loadList(this.lastListFilters),yield this.loadRegistryProviderIdsUnfiltered(),!0}catch(e){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | deleteRegistryEntry failed",e),this.listLoadError_$.set(e),!1}})}deleteRegistryEntries(t){return o(this,null,function*(){this.listLoadError_$.set(null);try{let e=yield this.modelRegistry_AS.deleteEntries(t);return yield this.loadList(this.lastListFilters),yield this.loadRegistryProviderIdsUnfiltered(),e}catch(e){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | deleteRegistryEntries failed",e),this.listLoadError_$.set(e),null}})}static collectSortedUniqueProviderIds(t){let e=t.map(s=>s.provider??"").filter(s=>s!=="");return[...new Set(e)].sort()}setSelectedEntryId(t){this.selectedEntryId_$.set(t??"")}loadEntry(t){return o(this,null,function*(){this.entryDetailLoading_$.set(!0),this.entryDetailNotFound_$.set(!1),this.entryDetailLoadError_$.set(null),this.selectedEntryId_$()!==t&&(this.entryDetail_$.set(null),this.results_$.set([]));try{let r=((yield this.modelRegistry_AS.getList(this.lastListFilters)).list??[]).find(f=>f.id===t);if(!r)return this.entryDetail_$.set(null),this.entryDetailNotFound_$.set(!0),null;this.entryDetail_$.set(r);let n=r.reasoningLevelForTest?.trim()||"none",l=yield this.modelRegistry_AS.getTestResults({provider:r.provider,model:r.modelName,limit:200,reasoningLevel:n});return this.results_$.set(l.results??[]),r}catch(e){a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | Failed to load entry",e);let s=e instanceof Error?e.message:String(e);return this.entryDetailLoadError_$.set(s),this.selectedEntryId_$()===t&&this.entryDetail_$.set(null),null}finally{this.entryDetailLoading_$.set(!1)}})}loadPrompts(){return o(this,null,function*(){this.promptsLoading_$.set(!0);try{let e=(yield this.modelRegistry_AS.getPrompts()).prompts??[];return this.prompts_$.set(e),e}catch(t){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | Failed to load prompts",t),this.prompts_$.set([]),[]}finally{this.promptsLoading_$.set(!1)}})}loadResults(t,e,s){return o(this,null,function*(){try{let n=(yield this.modelRegistry_AS.getTestResults({provider:t,model:e,limit:200,reasoningLevel:s})).results??[];return this.results_$.set(n),n}catch(r){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | Failed to load results",r),[]}})}sync(){return o(this,null,function*(){this.syncing_$.set(!0),this.listLoadError_$.set(null);try{let t=yield this.modelRegistry_AS.sync();return yield Promise.all([this.loadSetupConfigForRegistry(),this.loadList(this.lastListFilters),this.loadRegistryProviderIdsUnfiltered()]),t}catch(t){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | Sync failed",t),this.listLoadError_$.set(t),null}finally{this.syncing_$.set(!1)}})}setEnabled(t,e){return o(this,null,function*(){this.listLoadError_$.set(null);try{return yield this.modelRegistry_AS.setEnabled(t,e),yield this.loadList(this.lastListFilters),!0}catch(s){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | setEnabled failed",s),this.listLoadError_$.set(s),!1}})}patchEntry(t,e){return o(this,null,function*(){this.listLoadError_$.set(null);let s=this.selectedEntryId_$()===t,r=this.entryDetail_$();if(s&&r&&e.reasoningLevelForTest!==void 0&&this.entryDetail_$.update(n=>n?S(_({},n),{reasoningLevelForTest:e.reasoningLevelForTest}):null),s&&r&&e.enabled!==void 0){let n=e.enabled;this.entryDetail_$.update(l=>l?S(_({},l),{enabled:n}):null)}s&&r&&e.capabilities!==void 0&&this.entryDetail_$.update(n=>n?S(_({},n),{capabilities:e.capabilities}):null);try{return yield this.modelRegistry_AS.patchEntry(t,e),yield this.loadList(this.lastListFilters),s&&(e.reasoningLevelForTest!==void 0&&e.enabled===void 0&&e.capabilities===void 0||(yield this.loadEntry(t))),!0}catch(n){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | patchEntry failed",n),this.listLoadError_$.set(n),s&&this.entryDetail_$()&&this.loadEntry(t),!1}})}setReasoningLevelForTest(t,e){return o(this,null,function*(){return this.patchEntry(t,{reasoningLevelForTest:e})})}bulkSetEnabled(t,e){return o(this,null,function*(){this.listLoadError_$.set(null);try{let s=yield this.modelRegistry_AS.bulkSetEnabled(t,e);return yield this.loadList(this.lastListFilters),s.updated}catch(s){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | bulkSetEnabled failed",s),this.listLoadError_$.set(s),null}})}startTestRun(t,e){return o(this,null,function*(){this.testRunError_$.set(null);try{let s=yield this.modelRegistry_AS.startTestRun(t,e);return this.testRunPanelDismissed_$.set(!1),this.testRunSelectedModelIds_$.set([...t]),this.testRunId_$.set(s.runId),this.testRunStatus_$.set({runId:s.runId,status:c.pending,results:[]}),this.startModelTestRunProgressSocket(),this.startModelTestResultSavedSocket(),this.startRunPolling(s.runId),s.runId}catch(s){return a.DyFM_Error.logSimple("CCAP_ModelRegistryDS | startTestRun failed",s),this.testRunError_$.set(s),null}})}startRunPolling(t){this.clearRunPollingIntervalOnly(),this.testRunPollingActive_$.set(!0);let e=M;this.runPollingInterval=setInterval(()=>{this.pollRunStatus(t)},e),this.pollRunStatus(t)}clearRunPollingIntervalOnly(){this.runPollingInterval&&(clearInterval(this.runPollingInterval),this.runPollingInterval=null)}stopRunPolling(){this.clearRunPollingIntervalOnly(),this.testRunPollingActive_$.set(!1),this.testRunId_$.set(""),this.testRunStatus_$.set(null),this.testRunError_$.set(null),this.modelTestRunProgressCurrentTask_$.set(null),this.testRunSelectedModelIds_$.set([]),this.testRunPanelDismissed_$.set(!1)}dismissTestRunPanel(){this.testRunPanelDismissed_$.set(!0)}pollRunStatus(t){return o(this,null,function*(){try{let e=yield this.modelRegistry_AS.getTestRunStatus(t);this.testRunStatus_$.set(e),(e.status==="completed"||e.status==="failed")&&(this.clearRunPollingIntervalOnly(),this.testRunPollingActive_$.set(!1))}catch(e){this.testRunError_$.set(e),this.clearRunPollingIntervalOnly(),this.testRunPollingActive_$.set(!1)}})}startModelTestRunProgressSocket(){this.modelTestRunProgressSocketSub||(this.modelTestRunProgressSocketSub=this.socket_CS.event$.subscribe(t=>{if(t.event!=="user-notification")return;let e=t.payload??{};if(e.type!==D)return;let s=e.runId,r=e.status,n=e.current,l=e.total,f=e.currentTask,m=e.error,u=e.failedTask,g=e.errorDetails;this.setTestRunProgressFromSocket({runId:typeof s=="string"?s:void 0,status:typeof r=="string"?r:void 0,current:typeof n=="number"?n:void 0,total:typeof l=="number"?l:void 0,currentTask:f,error:typeof m=="string"?m:void 0,failedTask:u,errorDetails:g})}))}stopModelTestRunProgressSocket(){this.modelTestRunProgressSocketSub&&(this.modelTestRunProgressSocketSub.unsubscribe(),this.modelTestRunProgressSocketSub=null)}startModelTestResultSavedSocket(){this.modelTestResultSavedSocketSub||(this.modelTestResultSavedSocketSub=this.socket_CS.event$.subscribe(t=>{if(t.event!=="user-notification")return;let e=t.payload??{};e.type===w&&this.mergeResultFromSocket(e)}))}stopModelTestResultSavedSocket(){this.modelTestResultSavedSocketSub&&(this.modelTestResultSavedSocketSub.unsubscribe(),this.modelTestResultSavedSocketSub=null)}mergeResultFromSocket(t){let e=this.testRunId_$();if(!e||t.runId!==e)return;let s=this.testRunStatus_$();if(!s)return;let r=d.parseResultItemFromSocket(t);if(!r)return;let n=R=>`${R.provider}|${R.model}|${R.promptId}|${R.reasoningLevel??"none"}`,l=n(r),m=[...s.results.filter(R=>n(R)!==l),r],u=t.current,g=t.total,h=typeof u=="number"?u:s.progress?.current,y=typeof g=="number"?g:s.progress?.total;this.testRunStatus_$.set(S(_({},s),{results:m,progress:typeof y=="number"&&y>0&&typeof h=="number"?{current:Math.max(h,s.progress?.current??0),total:y}:s.progress}));let p=this.entryDetail_$();if(p&&r.provider===p.provider&&r.model===p.modelName){let b=this.results_$().filter(C=>n(C)!==l);this.results_$.set([r,...b])}}static parseResultItemFromSocket(t){let e=t.provider,s=t.model,r=t.promptId,n=t.score;return typeof e!="string"||typeof s!="string"||typeof r!="string"?null:{provider:e,model:s,promptId:r,reasoningLevel:typeof t.reasoningLevel=="string"?t.reasoningLevel:void 0,score:typeof n=="number"?n:0,analysis:typeof t.analysis=="string"?t.analysis:void 0,promptText:typeof t.promptText=="string"?t.promptText:void 0,modelOutput:typeof t.modelOutput=="string"?t.modelOutput:void 0,thinking:typeof t.thinking=="string"?t.thinking:void 0,generationTimeMs:typeof t.generationTimeMs=="number"?t.generationTimeMs:void 0,analyzerProvider:typeof t.analyzerProvider=="string"?t.analyzerProvider:void 0,analyzerModel:typeof t.analyzerModel=="string"?t.analyzerModel:void 0,inputTokens:typeof t.inputTokens=="number"?t.inputTokens:void 0,outputTokens:typeof t.outputTokens=="number"?t.outputTokens:void 0,thinkingTokens:typeof t.thinkingTokens=="number"?t.thinkingTokens:void 0,createdAt:typeof t.createdAt=="string"?t.createdAt:void 0}}setTestRunProgressFromSocket(t){let e=this.testRunId_$();if(!e||t.runId!==e)return;let s=this.testRunStatus_$();if(!s)return;let r=d.parseRunStatusFromSocket(t.status,s.status),n=d.parseFailedTaskFromSocketPayload(t.failedTask),l=d.parseErrorDetailsFromSocketPayload(t.errorDetails),f=t.error!==void 0?t.error:s.error;this.testRunStatus_$.set(S(_({},s),{status:r,progress:typeof t.total=="number"&&t.total>0?{current:t.current??0,total:t.total}:s.progress,error:f,failedTask:n??s.failedTask,errorDetails:l??s.errorDetails}));let m=typeof t.status=="string"?t.status:"";if(m===c.completed||m===c.failed){this.modelTestRunProgressCurrentTask_$.set(null);return}let u=t.currentTask;if(u&&typeof u=="object"&&u!==null&&"promptId"in u){let g=u,h=g.promptId,y=g.provider,p=g.modelName;this.modelTestRunProgressCurrentTask_$.set({provider:typeof y=="string"?y:"",modelName:typeof p=="string"?p:"",promptId:typeof h=="string"?h:""});return}this.modelTestRunProgressCurrentTask_$.set(null)}static isPlainObjectRecord(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}static parseFailedTaskFromSocketPayload(t){if(!d.isPlainObjectRecord(t))return;let e=t,s=e.provider,r=e.model,n=e.promptId;if(!(typeof s!="string"||typeof r!="string"||typeof n!="string"))return{provider:s,model:r,promptId:n}}static parseErrorDetailsFromSocketPayload(t){if(!d.isPlainObjectRecord(t))return;let e=t,s=e.message;if(typeof s!="string")return;let r=e.errorCode,n=e.stack;return{message:s,errorCode:typeof r=="string"?r:void 0,stack:typeof n=="string"?n:void 0}}static parseRunStatusFromSocket(t,e){return typeof t!="string"?e:t===c.pending?c.pending:t===c.running?c.running:t===c.completed?c.completed:t===c.failed?c.failed:e}loadSetupConfigForRegistry(){return o(this,null,function*(){try{let t=yield this.settings_AS.getSection(k.llmProviders),e=typeof t.defaultLlmProvider=="string"?t.defaultLlmProvider:void 0,s=typeof t.defaultLlmModel=="string"?t.defaultLlmModel:void 0,r={},n=t.localAiSettings;if(Array.isArray(n))for(let f of n){if(f==null||typeof f!="object"||Array.isArray(f))continue;let m=f,u=m.key,g=m.name;if(typeof u!="string"||!u.trim())continue;let h=typeof g=="string"?g.trim():"",y=h.length>0?h:"Local AI",p=I.build({localAiKey:u.trim()});r[p]={label:y}}let l={defaultLlmProvider:e,defaultLlmModel:s,llmProviderConfig:Object.keys(r).length>0?r:void 0};return this.setupConfigForRegistry_$.set(l),l}catch{return this.setupConfigForRegistry_$.set(null),null}})}getCachedList(){return this.list_$()}getCachedEntryDetail(){return this.entryDetail_$()}getCachedPrompts(){return this.prompts_$()}getCachedResults(){return this.results_$()}getCachedSetupConfigForRegistry(){return this.setupConfigForRegistry_$()}static \u0275fac=function(e){return new(e||d)};static \u0275prov=P({token:d,factory:d.\u0275fac,providedIn:"root"})}return d})();export{q as a};
2
+ //# sourceMappingURL=chunk-VGOZI4SO.js.map
@@ -1,2 +1,2 @@
1
- import{f as l}from"./chunk-RL3RCDZ6.js";import{N as p}from"./chunk-AK3BNMCA.js";import{C as i,aa as n,k as o,y as c}from"./chunk-TBMJSIBB.js";var d=(()=>{class a{settingsGeneral_DS=i(p);pm_AS=i(l);workspacePathPickerOptions_$=n([]);refreshWorkspacePathPickerOptions(){return o(this,null,function*(){yield this.settingsGeneral_DS.loadDefaultWorkspacePath();let t=this.settingsGeneral_DS.defaultWorkspacePath_$().trim(),e=[];t&&e.push({label:"Default Workspace",path:t}),this.workspacePathPickerOptions_$.set(e);try{let f=(yield this.pm_AS.listProjects()).projects.filter(s=>!!s.localPath&&!!s.isActive).map(s=>({label:s.name||"Unnamed Project",path:s.localPath??""})),r=[];t&&r.push({label:"Default Workspace",path:t}),r.push(...f),this.workspacePathPickerOptions_$.set(r)}catch{}})}resolveInitialWorkspacePath(t){let e=this.settingsGeneral_DS.defaultWorkspacePath_$().trim();return t.lastWorkspacePath.trim()||e}static \u0275fac=function(e){return new(e||a)};static \u0275prov=c({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();export{d as a};
2
- //# sourceMappingURL=chunk-LZYMECRL.js.map
1
+ import{f as l}from"./chunk-4GBTGROS.js";import{N as p}from"./chunk-LWSSRQ3A.js";import{C as i,aa as n,k as o,y as c}from"./chunk-TBMJSIBB.js";var d=(()=>{class a{settingsGeneral_DS=i(p);pm_AS=i(l);workspacePathPickerOptions_$=n([]);refreshWorkspacePathPickerOptions(){return o(this,null,function*(){yield this.settingsGeneral_DS.loadDefaultWorkspacePath();let t=this.settingsGeneral_DS.defaultWorkspacePath_$().trim(),e=[];t&&e.push({label:"Default Workspace",path:t}),this.workspacePathPickerOptions_$.set(e);try{let f=(yield this.pm_AS.listProjects()).projects.filter(s=>!!s.localPath&&!!s.isActive).map(s=>({label:s.name||"Unnamed Project",path:s.localPath??""})),r=[];t&&r.push({label:"Default Workspace",path:t}),r.push(...f),this.workspacePathPickerOptions_$.set(r)}catch{}})}resolveInitialWorkspacePath(t){let e=this.settingsGeneral_DS.defaultWorkspacePath_$().trim();return t.lastWorkspacePath.trim()||e}static \u0275fac=function(e){return new(e||a)};static \u0275prov=c({token:a,factory:a.\u0275fac,providedIn:"root"})}return a})();export{d as a};
2
+ //# sourceMappingURL=chunk-WHDFCYAN.js.map
@@ -1,2 +1,2 @@
1
- import{h as d,j as M}from"./chunk-YE64CYNH.js";import{p as F}from"./chunk-AK3BNMCA.js";import{C as u,D as f,Fa as y,Ga as w,L as h,Ta as S,U as o,Z as r,aa as l,da as b,fa as k,ga as x,h as E,hb as a,ia as _,ja as c,k as m,la as C,qa as s,ra as p,sa as g,ub as $,va as T,wa as v}from"./chunk-TBMJSIBB.js";var z=E(F());function O(i,B){if(i&1&&(s(0,"span",4),y(1),p()),i&2){let e=v();_("text-green-400",e.feedbackOk_$())("text-red-400",!e.feedbackOk_$()),r(),w(e.feedbackText_$())}}var q=(()=>{class i{content=o.required();buttonTitle=o("M\xE1sol\xE1s v\xE1g\xF3lapra");size=o("sm");feedbackText_$=l("");feedbackOk_$=l(!0);hasFeedback_$=a(()=>this.feedbackText_$().length>0);sizeClass_$=a(()=>this.size()==="md"?"p-2 min-h-[44px] min-w-[44px]":"p-1.5 gt-xs:p-2 min-h-[32px] min-w-[32px] gt-xs:min-h-[36px] gt-xs:min-w-[36px]");iconSizeClass_$=a(()=>this.size()==="md"?"h-5 w-5":"h-4 w-4");globalError_CS=u(M);static feedbackResetMs=2*z.second;feedbackTimer=null;handleCopy(){return m(this,null,function*(){let e=this.content();if(!e)return;let t=yield this.globalError_CS.copyToClipboard(e);t.ok?this.showFeedback("M\xE1solva!",!0):(this.showFeedback("Sikertelen",!1),this.globalError_CS.reportErrorOnly({message:d.getErrorMessageForDisplay(t.error),source:"copy-button",stack:d.getStackForReport(t.error)}))})}showFeedback(e,t){this.feedbackTimer!==null&&clearTimeout(this.feedbackTimer),this.feedbackText_$.set(e),this.feedbackOk_$.set(t),this.feedbackTimer=setTimeout(()=>{this.feedbackText_$.set(""),this.feedbackTimer=null},i.feedbackResetMs)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=f({type:i,selectors:[["app-s-copy-button"]],hostAttrs:[1,"inline-flex","items-center","gap-1.5"],inputs:{content:[1,"content"],buttonTitle:[1,"buttonTitle"],size:[1,"size"]},standalone:!0,features:[S],decls:4,vars:7,consts:[["type","button",3,"click","title"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke","currentColor","aria-hidden","true"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"],[1,"text-[11px]","gt-xs:text-xs","shrink-0",3,"text-green-400","text-red-400"],[1,"text-[11px]","gt-xs:text-xs","shrink-0"]],template:function(t,n){t&1&&(s(0,"button",0),T("click",function(){return n.handleCopy()}),h(),s(1,"svg",1),g(2,"path",2),p()(),b(3,O,2,5,"span",3)),t&2&&(c(n.sizeClass_$()+" flex items-center justify-center rounded text-neutral-400 hover:text-neutral-200 hover:bg-neutral-700 transition-colors shrink-0"),x("title",n.buttonTitle()),k("aria-label",n.buttonTitle()),r(),c(n.iconSizeClass_$()),r(2),C(n.hasFeedback_$()?3:-1))},dependencies:[$],encapsulation:2})}return i})();export{q as a};
2
- //# sourceMappingURL=chunk-2TXJ5BO3.js.map
1
+ import{h as d,j as M}from"./chunk-TRPAJFTF.js";import{p as F}from"./chunk-LWSSRQ3A.js";import{C as u,D as f,Fa as y,Ga as w,L as h,Ta as S,U as o,Z as r,aa as l,da as b,fa as k,ga as x,h as E,hb as a,ia as _,ja as c,k as m,la as C,qa as s,ra as p,sa as g,ub as $,va as T,wa as v}from"./chunk-TBMJSIBB.js";var z=E(F());function O(i,B){if(i&1&&(s(0,"span",4),y(1),p()),i&2){let e=v();_("text-green-400",e.feedbackOk_$())("text-red-400",!e.feedbackOk_$()),r(),w(e.feedbackText_$())}}var q=(()=>{class i{content=o.required();buttonTitle=o("M\xE1sol\xE1s v\xE1g\xF3lapra");size=o("sm");feedbackText_$=l("");feedbackOk_$=l(!0);hasFeedback_$=a(()=>this.feedbackText_$().length>0);sizeClass_$=a(()=>this.size()==="md"?"p-2 min-h-[44px] min-w-[44px]":"p-1.5 gt-xs:p-2 min-h-[32px] min-w-[32px] gt-xs:min-h-[36px] gt-xs:min-w-[36px]");iconSizeClass_$=a(()=>this.size()==="md"?"h-5 w-5":"h-4 w-4");globalError_CS=u(M);static feedbackResetMs=2*z.second;feedbackTimer=null;handleCopy(){return m(this,null,function*(){let e=this.content();if(!e)return;let t=yield this.globalError_CS.copyToClipboard(e);t.ok?this.showFeedback("M\xE1solva!",!0):(this.showFeedback("Sikertelen",!1),this.globalError_CS.reportErrorOnly({message:d.getErrorMessageForDisplay(t.error),source:"copy-button",stack:d.getStackForReport(t.error)}))})}showFeedback(e,t){this.feedbackTimer!==null&&clearTimeout(this.feedbackTimer),this.feedbackText_$.set(e),this.feedbackOk_$.set(t),this.feedbackTimer=setTimeout(()=>{this.feedbackText_$.set(""),this.feedbackTimer=null},i.feedbackResetMs)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=f({type:i,selectors:[["app-s-copy-button"]],hostAttrs:[1,"inline-flex","items-center","gap-1.5"],inputs:{content:[1,"content"],buttonTitle:[1,"buttonTitle"],size:[1,"size"]},standalone:!0,features:[S],decls:4,vars:7,consts:[["type","button",3,"click","title"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke","currentColor","aria-hidden","true"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"],[1,"text-[11px]","gt-xs:text-xs","shrink-0",3,"text-green-400","text-red-400"],[1,"text-[11px]","gt-xs:text-xs","shrink-0"]],template:function(t,n){t&1&&(s(0,"button",0),T("click",function(){return n.handleCopy()}),h(),s(1,"svg",1),g(2,"path",2),p()(),b(3,O,2,5,"span",3)),t&2&&(c(n.sizeClass_$()+" flex items-center justify-center rounded text-neutral-400 hover:text-neutral-200 hover:bg-neutral-700 transition-colors shrink-0"),x("title",n.buttonTitle()),k("aria-label",n.buttonTitle()),r(),c(n.iconSizeClass_$()),r(2),C(n.hasFeedback_$()?3:-1))},dependencies:[$],encapsulation:2})}return i})();export{q as a};
2
+ //# sourceMappingURL=chunk-X3QENSK2.js.map
@@ -1,2 +1,2 @@
1
- import{I as p}from"./chunk-AK3BNMCA.js";import{C as l,G as h,aa as a,hb as b,k as i,p as o,xb as d,y as n}from"./chunk-TBMJSIBB.js";var g=(()=>{class r{http=l(d);baseUrl=`${p.api.baseUrl}/sch`;listJobs(){return o(this.http.get(`${this.baseUrl}/jobs`))}getJob(e){return o(this.http.get(`${this.baseUrl}/jobs/${e}`))}createJob(e){return o(this.http.post(`${this.baseUrl}/jobs`,e))}updateJob(e,t){return o(this.http.patch(`${this.baseUrl}/jobs/${e}`,t))}deleteJob(e){return o(this.http.delete(`${this.baseUrl}/jobs/${e}`))}enableJob(e){return o(this.http.post(`${this.baseUrl}/jobs/${e}/enable`,{}))}disableJob(e){return o(this.http.post(`${this.baseUrl}/jobs/${e}/disable`,{}))}pauseJob(e){return o(this.http.post(`${this.baseUrl}/jobs/${e}/pause`,{}))}resumeJob(e){return o(this.http.post(`${this.baseUrl}/jobs/${e}/resume`,{}))}triggerNow(e){let t=[];e.bypass&&t.push("bypass=true"),e.forcePolicy&&t.push(`forcePolicy=${encodeURIComponent(e.forcePolicy)}`),e.dryRun&&t.push("dryRun=true");let s=t.length?`?${t.join("&")}`:"";return o(this.http.post(`${this.baseUrl}/jobs/${e.jobId}/trigger-now${s}`,{reason:e.reason}))}listExecutions(e){let t=[];e.jobId&&t.push(`jobId=${encodeURIComponent(e.jobId)}`),e.status&&t.push(`status=${encodeURIComponent(e.status)}`),e.targetSessionId&&t.push(`targetSessionId=${encodeURIComponent(e.targetSessionId)}`),e.from&&t.push(`from=${encodeURIComponent(e.from)}`),e.to&&t.push(`to=${encodeURIComponent(e.to)}`);let s=t.length?`?${t.join("&")}`:"";return o(this.http.get(`${this.baseUrl}/executions${s}`))}getExecution(e){return o(this.http.get(`${this.baseUrl}/executions/${e}`))}getDefaults(){return o(this.http.get(`${this.baseUrl}/defaults`))}applyDefaults(){return o(this.http.post(`${this.baseUrl}/defaults/apply`,{}))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=n({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var F=(()=>{class r{jobs_AS=l(g);jobs_$=a([]);recentExecutions_$=a(new Map);isLoading_$=a(!1);errorMessage_$=a(null);scheduledSessionIds_$=b(()=>{let e=new Set;for(let t of this.jobs_$()){if(t.enabled===!1)continue;let s=t.target?.payload?.sessionId?.trim();s&&e.add(s)}return e});loadAll(){return i(this,null,function*(){this.isLoading_$.set(!0),this.errorMessage_$.set(null);try{let t=(yield this.jobs_AS.listJobs()).jobs??[];this.jobs_$.set(t),this.loadRecentExecutionsForJobs(t)}catch(e){this.errorMessage_$.set(e?.message??"Failed to load scheduler jobs")}finally{this.isLoading_$.set(!1)}})}loadRecentExecutionsForJobs(e){return i(this,null,function*(){let t=new Map;try{let $=(yield this.jobs_AS.listExecutions({})).executions??[];for(let j of e){let c=j._id??"";if(!c)continue;let y=$.filter(u=>u.jobId===c).sort((u,m)=>(m.scheduledAt??"").localeCompare(u.scheduledAt??"")).slice(0,10);t.set(c,y)}}catch{}this.recentExecutions_$.set(t)})}getJob(e){return i(this,null,function*(){try{return(yield this.jobs_AS.getJob(e)).job}catch(t){return this.errorMessage_$.set(t?.message??"Failed to load job"),null}})}create(e){return i(this,null,function*(){try{let t=yield this.jobs_AS.createJob(e);return yield this.loadAll(),t.job}catch(t){return this.errorMessage_$.set(t?.message??"Failed to create job"),null}})}update(e,t){return i(this,null,function*(){try{let s=yield this.jobs_AS.updateJob(e,t);return yield this.loadAll(),s.job}catch(s){return this.errorMessage_$.set(s?.message??"Failed to update job"),null}})}remove(e){return i(this,null,function*(){try{let t=yield this.jobs_AS.deleteJob(e);return yield this.loadAll(),t.deleted}catch(t){return this.errorMessage_$.set(t?.message??"Failed to delete job"),!1}})}toggleEnabled(e,t){return i(this,null,function*(){try{t?yield this.jobs_AS.enableJob(e):yield this.jobs_AS.disableJob(e),yield this.loadAll()}catch(s){this.errorMessage_$.set(s?.message??"Failed to toggle enabled state")}})}togglePaused(e,t){return i(this,null,function*(){try{t?yield this.jobs_AS.pauseJob(e):yield this.jobs_AS.resumeJob(e),yield this.loadAll()}catch(s){this.errorMessage_$.set(s?.message??"Failed to toggle paused state")}})}triggerNow(e){return i(this,null,function*(){try{return(yield this.jobs_AS.triggerNow(e)).triggered}catch(t){return this.errorMessage_$.set(t?.message??"Failed to trigger job"),!1}})}listExecutions(e){return i(this,null,function*(){try{return(yield this.jobs_AS.listExecutions({jobId:e.jobId})).executions??[]}catch(t){return this.errorMessage_$.set(t?.message??"Failed to load executions"),[]}})}getDefaults(){return i(this,null,function*(){try{return(yield this.jobs_AS.getDefaults()).defaults}catch(e){return this.errorMessage_$.set(e?.message??"Failed to load defaults"),null}})}static \u0275fac=function(t){return new(t||r)};static \u0275prov=n({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var E=(()=>{class r{transform(e){if(!e||!e.preset)return"\u2014";let t=e.preset,s=e.intervalValue;if(s===void 0||!isFinite(s))return t;switch(t){case"every-n-minutes":return`every ${s} minutes`;case"every-n-hours":return`every ${s} hours`;case"every-n-days":return`every ${s} days`;case"windowed-interval":return`every ${s} min (window)`;default:return t}}static \u0275fac=function(t){return new(t||r)};static \u0275pipe=h({name:"schSchedulePresetLabel",type:r,pure:!0,standalone:!0})}return r})();export{F as a,E as b};
2
- //# sourceMappingURL=chunk-FWNDCHJM.js.map
1
+ import{I as p}from"./chunk-LWSSRQ3A.js";import{C as l,G as h,aa as a,hb as b,k as i,p as o,xb as d,y as n}from"./chunk-TBMJSIBB.js";var g=(()=>{class r{http=l(d);baseUrl=`${p.api.baseUrl}/sch`;listJobs(){return o(this.http.get(`${this.baseUrl}/jobs`))}getJob(e){return o(this.http.get(`${this.baseUrl}/jobs/${e}`))}createJob(e){return o(this.http.post(`${this.baseUrl}/jobs`,e))}updateJob(e,t){return o(this.http.patch(`${this.baseUrl}/jobs/${e}`,t))}deleteJob(e){return o(this.http.delete(`${this.baseUrl}/jobs/${e}`))}enableJob(e){return o(this.http.post(`${this.baseUrl}/jobs/${e}/enable`,{}))}disableJob(e){return o(this.http.post(`${this.baseUrl}/jobs/${e}/disable`,{}))}pauseJob(e){return o(this.http.post(`${this.baseUrl}/jobs/${e}/pause`,{}))}resumeJob(e){return o(this.http.post(`${this.baseUrl}/jobs/${e}/resume`,{}))}triggerNow(e){let t=[];e.bypass&&t.push("bypass=true"),e.forcePolicy&&t.push(`forcePolicy=${encodeURIComponent(e.forcePolicy)}`),e.dryRun&&t.push("dryRun=true");let s=t.length?`?${t.join("&")}`:"";return o(this.http.post(`${this.baseUrl}/jobs/${e.jobId}/trigger-now${s}`,{reason:e.reason}))}listExecutions(e){let t=[];e.jobId&&t.push(`jobId=${encodeURIComponent(e.jobId)}`),e.status&&t.push(`status=${encodeURIComponent(e.status)}`),e.targetSessionId&&t.push(`targetSessionId=${encodeURIComponent(e.targetSessionId)}`),e.from&&t.push(`from=${encodeURIComponent(e.from)}`),e.to&&t.push(`to=${encodeURIComponent(e.to)}`);let s=t.length?`?${t.join("&")}`:"";return o(this.http.get(`${this.baseUrl}/executions${s}`))}getExecution(e){return o(this.http.get(`${this.baseUrl}/executions/${e}`))}getDefaults(){return o(this.http.get(`${this.baseUrl}/defaults`))}applyDefaults(){return o(this.http.post(`${this.baseUrl}/defaults/apply`,{}))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=n({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var F=(()=>{class r{jobs_AS=l(g);jobs_$=a([]);recentExecutions_$=a(new Map);isLoading_$=a(!1);errorMessage_$=a(null);scheduledSessionIds_$=b(()=>{let e=new Set;for(let t of this.jobs_$()){if(t.enabled===!1)continue;let s=t.target?.payload?.sessionId?.trim();s&&e.add(s)}return e});loadAll(){return i(this,null,function*(){this.isLoading_$.set(!0),this.errorMessage_$.set(null);try{let t=(yield this.jobs_AS.listJobs()).jobs??[];this.jobs_$.set(t),this.loadRecentExecutionsForJobs(t)}catch(e){this.errorMessage_$.set(e?.message??"Failed to load scheduler jobs")}finally{this.isLoading_$.set(!1)}})}loadRecentExecutionsForJobs(e){return i(this,null,function*(){let t=new Map;try{let $=(yield this.jobs_AS.listExecutions({})).executions??[];for(let j of e){let c=j._id??"";if(!c)continue;let y=$.filter(u=>u.jobId===c).sort((u,m)=>(m.scheduledAt??"").localeCompare(u.scheduledAt??"")).slice(0,10);t.set(c,y)}}catch{}this.recentExecutions_$.set(t)})}getJob(e){return i(this,null,function*(){try{return(yield this.jobs_AS.getJob(e)).job}catch(t){return this.errorMessage_$.set(t?.message??"Failed to load job"),null}})}create(e){return i(this,null,function*(){try{let t=yield this.jobs_AS.createJob(e);return yield this.loadAll(),t.job}catch(t){return this.errorMessage_$.set(t?.message??"Failed to create job"),null}})}update(e,t){return i(this,null,function*(){try{let s=yield this.jobs_AS.updateJob(e,t);return yield this.loadAll(),s.job}catch(s){return this.errorMessage_$.set(s?.message??"Failed to update job"),null}})}remove(e){return i(this,null,function*(){try{let t=yield this.jobs_AS.deleteJob(e);return yield this.loadAll(),t.deleted}catch(t){return this.errorMessage_$.set(t?.message??"Failed to delete job"),!1}})}toggleEnabled(e,t){return i(this,null,function*(){try{t?yield this.jobs_AS.enableJob(e):yield this.jobs_AS.disableJob(e),yield this.loadAll()}catch(s){this.errorMessage_$.set(s?.message??"Failed to toggle enabled state")}})}togglePaused(e,t){return i(this,null,function*(){try{t?yield this.jobs_AS.pauseJob(e):yield this.jobs_AS.resumeJob(e),yield this.loadAll()}catch(s){this.errorMessage_$.set(s?.message??"Failed to toggle paused state")}})}triggerNow(e){return i(this,null,function*(){try{return(yield this.jobs_AS.triggerNow(e)).triggered}catch(t){return this.errorMessage_$.set(t?.message??"Failed to trigger job"),!1}})}listExecutions(e){return i(this,null,function*(){try{return(yield this.jobs_AS.listExecutions({jobId:e.jobId})).executions??[]}catch(t){return this.errorMessage_$.set(t?.message??"Failed to load executions"),[]}})}getDefaults(){return i(this,null,function*(){try{return(yield this.jobs_AS.getDefaults()).defaults}catch(e){return this.errorMessage_$.set(e?.message??"Failed to load defaults"),null}})}static \u0275fac=function(t){return new(t||r)};static \u0275prov=n({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var E=(()=>{class r{transform(e){if(!e||!e.preset)return"\u2014";let t=e.preset,s=e.intervalValue;if(s===void 0||!isFinite(s))return t;switch(t){case"every-n-minutes":return`every ${s} minutes`;case"every-n-hours":return`every ${s} hours`;case"every-n-days":return`every ${s} days`;case"windowed-interval":return`every ${s} min (window)`;default:return t}}static \u0275fac=function(t){return new(t||r)};static \u0275pipe=h({name:"schSchedulePresetLabel",type:r,pure:!0,standalone:!0})}return r})();export{F as a,E as b};
2
+ //# sourceMappingURL=chunk-X6HOES7C.js.map