@futdevpro/ccap 1.1.2988 → 1.1.2995

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 (178) hide show
  1. package/client-dist/{agent-instances.module-EZ3HLJRW.js → agent-instances.module-Y2KBMNCK.js} +2 -2
  2. package/client-dist/{ca.module-2NK5JZOQ.js → ca.module-THNXAPI2.js} +2 -2
  3. package/client-dist/{cc-usage-dashboard.component-SLFNE2NX.js → cc-usage-dashboard.component-XQTSJYNO.js} +2 -2
  4. package/client-dist/{cc.module-F7LHWQ3A.js → cc.module-SBU4LUC2.js} +2 -2
  5. package/client-dist/{chunk-HK3NW3BA.js → chunk-2JZ3QUN7.js} +2 -2
  6. package/client-dist/{chunk-66YFYBOC.js → chunk-2L25BDDH.js} +2 -2
  7. package/client-dist/{chunk-L2E2MBF2.js → chunk-3BN32RX3.js} +2 -2
  8. package/client-dist/{chunk-4JZNUGDT.js → chunk-3F4AEMEH.js} +2 -2
  9. package/client-dist/{chunk-35HAXCRL.js → chunk-4EQNFMWU.js} +2 -2
  10. package/client-dist/{chunk-X3CIXD4W.js → chunk-4YCGUCIE.js} +2 -2
  11. package/client-dist/{chunk-SYXQFJNU.js → chunk-54JIUO7K.js} +2 -2
  12. package/client-dist/{chunk-I5LYGLY6.js → chunk-54KKC54L.js} +2 -2
  13. package/client-dist/{chunk-W66474CE.js → chunk-73ZQF6FQ.js} +2 -2
  14. package/client-dist/{chunk-OJPFXL3T.js → chunk-ACH3Z3TA.js} +2 -2
  15. package/client-dist/{chunk-CJXAN5QP.js → chunk-AJATGXNX.js} +2 -2
  16. package/client-dist/{chunk-XDP5GOHT.js → chunk-ASRYRN2I.js} +2 -2
  17. package/client-dist/{chunk-QYAK3VTE.js → chunk-BLA4WJEG.js} +2 -2
  18. package/client-dist/{chunk-6UTINZN6.js → chunk-BZVOKLVZ.js} +2 -2
  19. package/client-dist/{chunk-M53FIKSO.js → chunk-C7CAW6PK.js} +2 -2
  20. package/client-dist/{chunk-MIWIPUJL.js → chunk-CL5GKNF3.js} +2 -2
  21. package/client-dist/{chunk-ACLAVYA7.js → chunk-CSNFLERX.js} +2 -2
  22. package/client-dist/{chunk-WKXTPGKW.js → chunk-G5G7ZRTT.js} +2 -2
  23. package/client-dist/{chunk-I24ZZ4G3.js → chunk-GUJJP3HP.js} +2 -2
  24. package/client-dist/{chunk-QM4JVUVN.js → chunk-HB7GOR7P.js} +2 -2
  25. package/client-dist/{chunk-CPOWA47I.js → chunk-HL5RGNNL.js} +2 -2
  26. package/client-dist/{chunk-PUVXCR3N.js → chunk-IBAMIAIM.js} +2 -2
  27. package/client-dist/{chunk-LOUIZXXC.js → chunk-IDWKG7BQ.js} +2 -2
  28. package/client-dist/{chunk-LNDWBFCV.js → chunk-IES67WDC.js} +2 -2
  29. package/client-dist/{chunk-IMV4JDM4.js → chunk-JDJZC55L.js} +2 -2
  30. package/client-dist/{chunk-VUMU4S4O.js → chunk-KD7WNBCA.js} +2 -2
  31. package/client-dist/{chunk-XC26T3JJ.js → chunk-KJJKC27U.js} +2 -2
  32. package/client-dist/{chunk-ZJ3DCODZ.js → chunk-LGMUHF7N.js} +2 -2
  33. package/client-dist/{chunk-ZJ3DCODZ.js.map → chunk-LGMUHF7N.js.map} +1 -1
  34. package/client-dist/{chunk-RTAONMUA.js → chunk-LR3E2GDS.js} +2 -2
  35. package/client-dist/{chunk-SMBU53NX.js → chunk-MKV4EKJ3.js} +2 -2
  36. package/client-dist/{chunk-CK4L2E6A.js → chunk-OF2Q6Y2J.js} +2 -2
  37. package/client-dist/{chunk-TWUEQMEF.js → chunk-OPKRH2ZF.js} +2 -2
  38. package/client-dist/{chunk-7FDRE6FK.js → chunk-OTEHKHH6.js} +2 -2
  39. package/client-dist/{chunk-SUAZOLRE.js → chunk-P47C3DF2.js} +2 -2
  40. package/client-dist/{chunk-KOFPH2WQ.js → chunk-PXOCZHXA.js} +2 -2
  41. package/client-dist/{chunk-EZQXUBC4.js → chunk-Q6DP4BK2.js} +2 -2
  42. package/client-dist/{chunk-RQSPYGNE.js → chunk-SQFFII5G.js} +2 -2
  43. package/client-dist/{chunk-565H5Q7X.js → chunk-SSVNU5XX.js} +2 -2
  44. package/client-dist/chunk-TIFSV5V7.js +4 -0
  45. package/client-dist/{chunk-ZRLAS63L.js.map → chunk-TIFSV5V7.js.map} +3 -3
  46. package/client-dist/{chunk-2CZLQZAC.js → chunk-TUOCYFPY.js} +2 -2
  47. package/client-dist/{chunk-LP2E4KMW.js → chunk-UVND3MT4.js} +2 -2
  48. package/client-dist/{chunk-CROOTWQ4.js → chunk-UWRJP62D.js} +2 -2
  49. package/client-dist/{chunk-6IVNYSN4.js → chunk-VBPR247V.js} +2 -2
  50. package/client-dist/{chunk-XO6LJ5A6.js → chunk-VRLA24M4.js} +2 -2
  51. package/client-dist/{chunk-W4ICO22C.js → chunk-VS2SOEHH.js} +2 -2
  52. package/client-dist/{chunk-6CNO7CIR.js → chunk-VUVGA3PU.js} +2 -2
  53. package/client-dist/{chunk-CZK7PL4V.js → chunk-WFP5T7CK.js} +2 -2
  54. package/client-dist/{chunk-5GCMRTM2.js → chunk-WPK3COA5.js} +2 -2
  55. package/client-dist/{chunk-4ORBCWDZ.js → chunk-WS5IPV7J.js} +2 -2
  56. package/client-dist/{chunk-SIC2VUD2.js → chunk-X3XME6YM.js} +2 -2
  57. package/client-dist/{chunk-RJEB2CGY.js → chunk-XD65U2AA.js} +2 -2
  58. package/client-dist/{chunk-CZVHJQVK.js → chunk-Y5E6NMMF.js} +2 -2
  59. package/client-dist/{chunk-SAWE7K3L.js → chunk-YBDAZFC6.js} +2 -2
  60. package/client-dist/{chunk-ZI46JBHS.js → chunk-YFVC52RF.js} +2 -2
  61. package/client-dist/{chunk-HKO57F7B.js → chunk-YULSJ6Q7.js} +2 -2
  62. package/client-dist/{chunk-ALRGHRMX.js → chunk-Z2O72EKW.js} +2 -2
  63. package/client-dist/{consultant.module-ZRSJ2JPM.js → consultant.module-Z5HEVFX6.js} +2 -2
  64. package/client-dist/{crd.module-TDLM6M2Z.js → crd.module-V47NZMPB.js} +2 -2
  65. package/client-dist/{dashboard.module-VSWWQDEU.js → dashboard.module-CTYD32XL.js} +2 -2
  66. package/client-dist/{do.module-CCOHMJLG.js → do.module-CXAUW7J5.js} +2 -2
  67. package/client-dist/{document-library.module-QLZ4ZUUG.js → document-library.module-BWG5WRSR.js} +2 -2
  68. package/client-dist/{embedding-eval.module-6KORAJ7D.js → embedding-eval.module-UW3ATVS4.js} +2 -2
  69. package/client-dist/{embedding-registry.module-GJJ5G2Y7.js → embedding-registry.module-EUHSKBTW.js} +2 -2
  70. package/client-dist/{err.module-4GLVR2GJ.js → err.module-TVAU67PY.js} +2 -2
  71. package/client-dist/{feedback.module-U6CCHRVZ.js → feedback.module-QMTGBHSW.js} +2 -2
  72. package/client-dist/{host-runtime-mcp.module-EV5GZKTL.js → host-runtime-mcp.module-MGFIHPEU.js} +2 -2
  73. package/client-dist/index.html +1 -1
  74. package/client-dist/{live-dev-pipeline.module-MWG23KAS.js → live-dev-pipeline.module-234JPLHL.js} +2 -2
  75. package/client-dist/{logs.module-YNDMPESQ.js → logs.module-AJKP66C3.js} +2 -2
  76. package/client-dist/{main-OGUDQHPL.js → main-RCR3UPER.js} +3 -3
  77. package/client-dist/{master-control-remote-poc.module-37OSJYRO.js → master-control-remote-poc.module-MJHRVAJV.js} +2 -2
  78. package/client-dist/{mobile-app.module-2DXC7DFY.js → mobile-app.module-BGY5OBR4.js} +2 -2
  79. package/client-dist/{model-registry.module-Z64FRB5O.js → model-registry.module-7QY63GF2.js} +2 -2
  80. package/client-dist/{oc.module-6SHIJS3R.js → oc.module-DCGI6UB3.js} +2 -2
  81. package/client-dist/{orc.module-NBZZGOV3.js → orc.module-BGIHVCKN.js} +2 -2
  82. package/client-dist/{project-management.module-TR33UVCV.js → project-management.module-75PSVWLM.js} +2 -2
  83. package/client-dist/project-source-routed.module-UK5YELZX.js +2 -0
  84. package/client-dist/{scheduler.module-M3LHP2DW.js → scheduler.module-4CBGNYNZ.js} +2 -2
  85. package/client-dist/{session.module-FIZ5NYKK.js → session.module-BBRWFWYW.js} +2 -2
  86. package/client-dist/{set.module-4E6WAYIQ.js → set.module-JXC6IB4D.js} +2 -2
  87. package/client-dist/{setup.module-2AUXXLIR.js → setup.module-VWNDXFJR.js} +2 -2
  88. package/client-dist/{terminals.module-GCGUOFVO.js → terminals.module-SJJ5FS3B.js} +2 -2
  89. package/client-dist/{voice-notes-poc.module-6LVDT3MA.js → voice-notes-poc.module-H5JKVBK7.js} +2 -2
  90. package/client-dist/{wfs.module-XQGZNMEP.js → wfs.module-IR6D4R6Q.js} +2 -2
  91. package/package.json +1 -1
  92. package/client-dist/chunk-ZRLAS63L.js +0 -4
  93. package/client-dist/project-source-routed.module-ZZ7SNTUN.js +0 -2
  94. /package/client-dist/{agent-instances.module-EZ3HLJRW.js.map → agent-instances.module-Y2KBMNCK.js.map} +0 -0
  95. /package/client-dist/{ca.module-2NK5JZOQ.js.map → ca.module-THNXAPI2.js.map} +0 -0
  96. /package/client-dist/{cc-usage-dashboard.component-SLFNE2NX.js.map → cc-usage-dashboard.component-XQTSJYNO.js.map} +0 -0
  97. /package/client-dist/{cc.module-F7LHWQ3A.js.map → cc.module-SBU4LUC2.js.map} +0 -0
  98. /package/client-dist/{chunk-HK3NW3BA.js.map → chunk-2JZ3QUN7.js.map} +0 -0
  99. /package/client-dist/{chunk-66YFYBOC.js.map → chunk-2L25BDDH.js.map} +0 -0
  100. /package/client-dist/{chunk-L2E2MBF2.js.map → chunk-3BN32RX3.js.map} +0 -0
  101. /package/client-dist/{chunk-4JZNUGDT.js.map → chunk-3F4AEMEH.js.map} +0 -0
  102. /package/client-dist/{chunk-35HAXCRL.js.map → chunk-4EQNFMWU.js.map} +0 -0
  103. /package/client-dist/{chunk-X3CIXD4W.js.map → chunk-4YCGUCIE.js.map} +0 -0
  104. /package/client-dist/{chunk-SYXQFJNU.js.map → chunk-54JIUO7K.js.map} +0 -0
  105. /package/client-dist/{chunk-I5LYGLY6.js.map → chunk-54KKC54L.js.map} +0 -0
  106. /package/client-dist/{chunk-W66474CE.js.map → chunk-73ZQF6FQ.js.map} +0 -0
  107. /package/client-dist/{chunk-OJPFXL3T.js.map → chunk-ACH3Z3TA.js.map} +0 -0
  108. /package/client-dist/{chunk-CJXAN5QP.js.map → chunk-AJATGXNX.js.map} +0 -0
  109. /package/client-dist/{chunk-XDP5GOHT.js.map → chunk-ASRYRN2I.js.map} +0 -0
  110. /package/client-dist/{chunk-QYAK3VTE.js.map → chunk-BLA4WJEG.js.map} +0 -0
  111. /package/client-dist/{chunk-6UTINZN6.js.map → chunk-BZVOKLVZ.js.map} +0 -0
  112. /package/client-dist/{chunk-M53FIKSO.js.map → chunk-C7CAW6PK.js.map} +0 -0
  113. /package/client-dist/{chunk-MIWIPUJL.js.map → chunk-CL5GKNF3.js.map} +0 -0
  114. /package/client-dist/{chunk-ACLAVYA7.js.map → chunk-CSNFLERX.js.map} +0 -0
  115. /package/client-dist/{chunk-WKXTPGKW.js.map → chunk-G5G7ZRTT.js.map} +0 -0
  116. /package/client-dist/{chunk-I24ZZ4G3.js.map → chunk-GUJJP3HP.js.map} +0 -0
  117. /package/client-dist/{chunk-QM4JVUVN.js.map → chunk-HB7GOR7P.js.map} +0 -0
  118. /package/client-dist/{chunk-CPOWA47I.js.map → chunk-HL5RGNNL.js.map} +0 -0
  119. /package/client-dist/{chunk-PUVXCR3N.js.map → chunk-IBAMIAIM.js.map} +0 -0
  120. /package/client-dist/{chunk-LOUIZXXC.js.map → chunk-IDWKG7BQ.js.map} +0 -0
  121. /package/client-dist/{chunk-LNDWBFCV.js.map → chunk-IES67WDC.js.map} +0 -0
  122. /package/client-dist/{chunk-IMV4JDM4.js.map → chunk-JDJZC55L.js.map} +0 -0
  123. /package/client-dist/{chunk-VUMU4S4O.js.map → chunk-KD7WNBCA.js.map} +0 -0
  124. /package/client-dist/{chunk-XC26T3JJ.js.map → chunk-KJJKC27U.js.map} +0 -0
  125. /package/client-dist/{chunk-RTAONMUA.js.map → chunk-LR3E2GDS.js.map} +0 -0
  126. /package/client-dist/{chunk-SMBU53NX.js.map → chunk-MKV4EKJ3.js.map} +0 -0
  127. /package/client-dist/{chunk-CK4L2E6A.js.map → chunk-OF2Q6Y2J.js.map} +0 -0
  128. /package/client-dist/{chunk-TWUEQMEF.js.map → chunk-OPKRH2ZF.js.map} +0 -0
  129. /package/client-dist/{chunk-7FDRE6FK.js.map → chunk-OTEHKHH6.js.map} +0 -0
  130. /package/client-dist/{chunk-SUAZOLRE.js.map → chunk-P47C3DF2.js.map} +0 -0
  131. /package/client-dist/{chunk-KOFPH2WQ.js.map → chunk-PXOCZHXA.js.map} +0 -0
  132. /package/client-dist/{chunk-EZQXUBC4.js.map → chunk-Q6DP4BK2.js.map} +0 -0
  133. /package/client-dist/{chunk-RQSPYGNE.js.map → chunk-SQFFII5G.js.map} +0 -0
  134. /package/client-dist/{chunk-565H5Q7X.js.map → chunk-SSVNU5XX.js.map} +0 -0
  135. /package/client-dist/{chunk-2CZLQZAC.js.map → chunk-TUOCYFPY.js.map} +0 -0
  136. /package/client-dist/{chunk-LP2E4KMW.js.map → chunk-UVND3MT4.js.map} +0 -0
  137. /package/client-dist/{chunk-CROOTWQ4.js.map → chunk-UWRJP62D.js.map} +0 -0
  138. /package/client-dist/{chunk-6IVNYSN4.js.map → chunk-VBPR247V.js.map} +0 -0
  139. /package/client-dist/{chunk-XO6LJ5A6.js.map → chunk-VRLA24M4.js.map} +0 -0
  140. /package/client-dist/{chunk-W4ICO22C.js.map → chunk-VS2SOEHH.js.map} +0 -0
  141. /package/client-dist/{chunk-6CNO7CIR.js.map → chunk-VUVGA3PU.js.map} +0 -0
  142. /package/client-dist/{chunk-CZK7PL4V.js.map → chunk-WFP5T7CK.js.map} +0 -0
  143. /package/client-dist/{chunk-5GCMRTM2.js.map → chunk-WPK3COA5.js.map} +0 -0
  144. /package/client-dist/{chunk-4ORBCWDZ.js.map → chunk-WS5IPV7J.js.map} +0 -0
  145. /package/client-dist/{chunk-SIC2VUD2.js.map → chunk-X3XME6YM.js.map} +0 -0
  146. /package/client-dist/{chunk-RJEB2CGY.js.map → chunk-XD65U2AA.js.map} +0 -0
  147. /package/client-dist/{chunk-CZVHJQVK.js.map → chunk-Y5E6NMMF.js.map} +0 -0
  148. /package/client-dist/{chunk-SAWE7K3L.js.map → chunk-YBDAZFC6.js.map} +0 -0
  149. /package/client-dist/{chunk-ZI46JBHS.js.map → chunk-YFVC52RF.js.map} +0 -0
  150. /package/client-dist/{chunk-HKO57F7B.js.map → chunk-YULSJ6Q7.js.map} +0 -0
  151. /package/client-dist/{chunk-ALRGHRMX.js.map → chunk-Z2O72EKW.js.map} +0 -0
  152. /package/client-dist/{consultant.module-ZRSJ2JPM.js.map → consultant.module-Z5HEVFX6.js.map} +0 -0
  153. /package/client-dist/{crd.module-TDLM6M2Z.js.map → crd.module-V47NZMPB.js.map} +0 -0
  154. /package/client-dist/{dashboard.module-VSWWQDEU.js.map → dashboard.module-CTYD32XL.js.map} +0 -0
  155. /package/client-dist/{do.module-CCOHMJLG.js.map → do.module-CXAUW7J5.js.map} +0 -0
  156. /package/client-dist/{document-library.module-QLZ4ZUUG.js.map → document-library.module-BWG5WRSR.js.map} +0 -0
  157. /package/client-dist/{embedding-eval.module-6KORAJ7D.js.map → embedding-eval.module-UW3ATVS4.js.map} +0 -0
  158. /package/client-dist/{embedding-registry.module-GJJ5G2Y7.js.map → embedding-registry.module-EUHSKBTW.js.map} +0 -0
  159. /package/client-dist/{err.module-4GLVR2GJ.js.map → err.module-TVAU67PY.js.map} +0 -0
  160. /package/client-dist/{feedback.module-U6CCHRVZ.js.map → feedback.module-QMTGBHSW.js.map} +0 -0
  161. /package/client-dist/{host-runtime-mcp.module-EV5GZKTL.js.map → host-runtime-mcp.module-MGFIHPEU.js.map} +0 -0
  162. /package/client-dist/{live-dev-pipeline.module-MWG23KAS.js.map → live-dev-pipeline.module-234JPLHL.js.map} +0 -0
  163. /package/client-dist/{logs.module-YNDMPESQ.js.map → logs.module-AJKP66C3.js.map} +0 -0
  164. /package/client-dist/{main-OGUDQHPL.js.map → main-RCR3UPER.js.map} +0 -0
  165. /package/client-dist/{master-control-remote-poc.module-37OSJYRO.js.map → master-control-remote-poc.module-MJHRVAJV.js.map} +0 -0
  166. /package/client-dist/{mobile-app.module-2DXC7DFY.js.map → mobile-app.module-BGY5OBR4.js.map} +0 -0
  167. /package/client-dist/{model-registry.module-Z64FRB5O.js.map → model-registry.module-7QY63GF2.js.map} +0 -0
  168. /package/client-dist/{oc.module-6SHIJS3R.js.map → oc.module-DCGI6UB3.js.map} +0 -0
  169. /package/client-dist/{orc.module-NBZZGOV3.js.map → orc.module-BGIHVCKN.js.map} +0 -0
  170. /package/client-dist/{project-management.module-TR33UVCV.js.map → project-management.module-75PSVWLM.js.map} +0 -0
  171. /package/client-dist/{project-source-routed.module-ZZ7SNTUN.js.map → project-source-routed.module-UK5YELZX.js.map} +0 -0
  172. /package/client-dist/{scheduler.module-M3LHP2DW.js.map → scheduler.module-4CBGNYNZ.js.map} +0 -0
  173. /package/client-dist/{session.module-FIZ5NYKK.js.map → session.module-BBRWFWYW.js.map} +0 -0
  174. /package/client-dist/{set.module-4E6WAYIQ.js.map → set.module-JXC6IB4D.js.map} +0 -0
  175. /package/client-dist/{setup.module-2AUXXLIR.js.map → setup.module-VWNDXFJR.js.map} +0 -0
  176. /package/client-dist/{terminals.module-GCGUOFVO.js.map → terminals.module-SJJ5FS3B.js.map} +0 -0
  177. /package/client-dist/{voice-notes-poc.module-6LVDT3MA.js.map → voice-notes-poc.module-H5JKVBK7.js.map} +0 -0
  178. /package/client-dist/{wfs.module-XQGZNMEP.js.map → wfs.module-IR6D4R6Q.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import{I as _,K as T,N as D,p as U}from"./chunk-ZJ3DCODZ.js";import{C,Gb as H,a as b,aa as I,b as j,h as w,k as L,p as g,q as h,wb as d,xb as M,y as F}from"./chunk-TBMJSIBB.js";var y=[{prefix:"/setup",hint:"Setup \u2014 client/src/app/_modules/config/_modules/setup/"},{prefix:"/settings",hint:"Settings \u2014 client/src/app/_modules/config/_modules/settings/"},{prefix:"/model-registry",hint:"Model registry \u2014 client/src/app/_modules/model-registry/"},{prefix:"/embedding-registry",hint:"Embedding registry \u2014 client/src/app/_modules/ai-systems/_modules/embedding-registry/"},{prefix:"/embedding-eval",hint:"Embedding eval \u2014 client/src/app/_modules/embedding-eval/"},{prefix:"/session",hint:"CCAP Session UI \u2014 client/src/app/_modules/session/"},{prefix:"/errors",hint:"Errors list \u2014 client/src/app/_modules/system/_modules/errors/"},{prefix:"/feedback",hint:"Feedback \u2014 client/src/app/_modules/feedback/"},{prefix:"/logs",hint:"Logs \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/logs/"},{prefix:"/host-runtime-mcp",hint:"Host runtime MCP \u2014 client/src/app/_modules/dev/_modules/host-runtime-mcp/"},{prefix:"/voice-notes-poc",hint:"Voice notes POC \u2014 client/src/app/_modules/dev/_modules/poc/voice-notes-poc/"},{prefix:"/master-control-remote-poc",hint:"Master control remote POC \u2014 client/src/app/_modules/dev/_modules/poc/master-control-remote-poc/"},{prefix:"/workflow-settings",hint:"Workflow settings \u2014 client/src/app/_modules/config/_modules/workflow-settings/"},{prefix:"/coordinator",hint:"Coordinator \u2014 client/src/app/_modules/coordinator/"},{prefix:"/dark-office",hint:"Dark Office \u2014 client/src/app/_modules/dark-office/"},{prefix:"/project-management",hint:"Project management \u2014 client/src/app/_modules/project-management/"},{prefix:"/cc-session",hint:"CC Session UI \u2014 client/src/app/_modules/cc-session/"},{prefix:"/mobile-app",hint:"Mobile app \u2014 client/src/app/_modules/dev/_modules/poc/mobile-app/"},{prefix:"/oc-session",hint:"OC Session \u2014 client/src/app/_modules/oc/"},{prefix:"/ca-session",hint:"CA Session \u2014 client/src/app/_modules/ca-session/"},{prefix:"/consultant",hint:"Consultant \u2014 client/src/app/_modules/consultant/"},{prefix:"/agent-instances",hint:"Agent instances \u2014 client/src/app/_modules/agent-instances/"},{prefix:"/terminals",hint:"Terminals \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/terminals/"},{prefix:"/live-development-pipeline",hint:"Live Development Pipeline \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/live-dev-pipeline/"},{prefix:"/system-status",hint:"Legacy route \u2192 redirects to /live-development-pipeline \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/live-dev-pipeline/"},{prefix:"/",hint:"Dashboard (root) \u2014 client/src/app/_modules/dashboard/"}];var q="NG0203",S=class r{static isNg0203Message(n){return n.trim()===q}static buildDiagnostics(n){let t={route:n.context.route,url:n.context.url,userAgent:n.context.userAgent,timestamp:n.context.timestamp},e=r.parseStackFrames(n.stack),i=typeof n.context.route=="string"?n.context.route:"",o=r.resolveRouteFeatureHints(i),s=r.buildStaticGuidance(),l=r.buildToolSteps({clientSnapshot:t,clientSource:n.clientSource,stackFrames:e,routeFeatureHints:o});return{summary:"Angular NG0203: inject() was called outside an injection context (constructor, field initializer, factory, or runInInjectionContext).",clientSource:n.clientSource,clientSnapshot:t,stackFrames:e,routeFeatureHints:o,staticGuidance:s,toolSteps:l}}static formatDiagnosticsAppendix(n){let t;try{t=JSON.stringify(n,null,2)}catch{t='{"ng0203Diagnostics":"JSON stringify failed"}'}return`
1
+ import{I as _,K as T,N as D,p as U}from"./chunk-LGMUHF7N.js";import{C,Gb as H,a as b,aa as I,b as j,h as w,k as L,p as g,q as h,wb as d,xb as M,y as F}from"./chunk-TBMJSIBB.js";var y=[{prefix:"/setup",hint:"Setup \u2014 client/src/app/_modules/config/_modules/setup/"},{prefix:"/settings",hint:"Settings \u2014 client/src/app/_modules/config/_modules/settings/"},{prefix:"/model-registry",hint:"Model registry \u2014 client/src/app/_modules/model-registry/"},{prefix:"/embedding-registry",hint:"Embedding registry \u2014 client/src/app/_modules/ai-systems/_modules/embedding-registry/"},{prefix:"/embedding-eval",hint:"Embedding eval \u2014 client/src/app/_modules/embedding-eval/"},{prefix:"/session",hint:"CCAP Session UI \u2014 client/src/app/_modules/session/"},{prefix:"/errors",hint:"Errors list \u2014 client/src/app/_modules/system/_modules/errors/"},{prefix:"/feedback",hint:"Feedback \u2014 client/src/app/_modules/feedback/"},{prefix:"/logs",hint:"Logs \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/logs/"},{prefix:"/host-runtime-mcp",hint:"Host runtime MCP \u2014 client/src/app/_modules/dev/_modules/host-runtime-mcp/"},{prefix:"/voice-notes-poc",hint:"Voice notes POC \u2014 client/src/app/_modules/dev/_modules/poc/voice-notes-poc/"},{prefix:"/master-control-remote-poc",hint:"Master control remote POC \u2014 client/src/app/_modules/dev/_modules/poc/master-control-remote-poc/"},{prefix:"/workflow-settings",hint:"Workflow settings \u2014 client/src/app/_modules/config/_modules/workflow-settings/"},{prefix:"/coordinator",hint:"Coordinator \u2014 client/src/app/_modules/coordinator/"},{prefix:"/dark-office",hint:"Dark Office \u2014 client/src/app/_modules/dark-office/"},{prefix:"/project-management",hint:"Project management \u2014 client/src/app/_modules/project-management/"},{prefix:"/cc-session",hint:"CC Session UI \u2014 client/src/app/_modules/cc-session/"},{prefix:"/mobile-app",hint:"Mobile app \u2014 client/src/app/_modules/dev/_modules/poc/mobile-app/"},{prefix:"/oc-session",hint:"OC Session \u2014 client/src/app/_modules/oc/"},{prefix:"/ca-session",hint:"CA Session \u2014 client/src/app/_modules/ca-session/"},{prefix:"/consultant",hint:"Consultant \u2014 client/src/app/_modules/consultant/"},{prefix:"/agent-instances",hint:"Agent instances \u2014 client/src/app/_modules/agent-instances/"},{prefix:"/terminals",hint:"Terminals \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/terminals/"},{prefix:"/live-development-pipeline",hint:"Live Development Pipeline \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/live-dev-pipeline/"},{prefix:"/system-status",hint:"Legacy route \u2192 redirects to /live-development-pipeline \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/live-dev-pipeline/"},{prefix:"/",hint:"Dashboard (root) \u2014 client/src/app/_modules/dashboard/"}];var q="NG0203",S=class r{static isNg0203Message(n){return n.trim()===q}static buildDiagnostics(n){let t={route:n.context.route,url:n.context.url,userAgent:n.context.userAgent,timestamp:n.context.timestamp},e=r.parseStackFrames(n.stack),i=typeof n.context.route=="string"?n.context.route:"",o=r.resolveRouteFeatureHints(i),s=r.buildStaticGuidance(),l=r.buildToolSteps({clientSnapshot:t,clientSource:n.clientSource,stackFrames:e,routeFeatureHints:o});return{summary:"Angular NG0203: inject() was called outside an injection context (constructor, field initializer, factory, or runInInjectionContext).",clientSource:n.clientSource,clientSnapshot:t,stackFrames:e,routeFeatureHints:o,staticGuidance:s,toolSteps:l}}static formatDiagnosticsAppendix(n){let t;try{t=JSON.stringify(n,null,2)}catch{t='{"ng0203Diagnostics":"JSON stringify failed"}'}return`
2
2
 
3
3
  [NG0203 diagnostics]
4
4
  ${t}`}static parseStackFrames(n){if(n==null||!n.trim())return[];let t=n.split(`
@@ -24,4 +24,4 @@ ${String(n)}`}function nt(r){if(r instanceof Error&&typeof r.stack=="string"&&r.
24
24
  `),s=t!=null&&t.trim().length>0?t.trim():"(no stack)";return`${o}
25
25
 
26
26
  ${s}`}buildReportPayloadFromError(t,e){let i=this.getCurrentContext(),o=f.getErrorMessageForDisplay(t),s=r.enrichMessageForReport(t,o),l=f.getStackForReport(t),m=this.buildStackWithContext(l,i),R=r.extractErrorCode(t),E=r.extractAdditionalContent(t);return{message:s,stack:m,source:e??"client-app",errorCode:R,errorAdditionalContent:E,clientContext:i}}static enrichMessageForReport(t,e){if(!(t instanceof d))return e;let i=t.url?`URL: ${t.url}`:"URL: (?)",o=`status: ${t.status}`;return`${e} | ${i} | ${o}`}static extractErrorCode(t){if(t==null||typeof t!="object")return;let e=t;if(typeof e.errorCode=="string"&&e.errorCode.length>0)return e.errorCode;if(typeof e._errorCode=="string"&&e._errorCode.length>0)return e._errorCode}static extractAdditionalContent(t){if(t==null||typeof t!="object")return;let e=t;if(e.additionalContent!=null&&typeof e.additionalContent=="object")return e.additionalContent}buildReportPayloadFromParams(t){let e=this.getCurrentContext(),i=this.buildStackWithContext(t.stack,e);return{message:t.message,stack:i,source:t.source,clientContext:e}}showError(t,e){setTimeout(()=>{try{let i=f.getErrorMessageForDisplay(t),o=N.tryGetShortNotificationAffix({error:t});if(o.length>0&&(i=i+o),!(t instanceof d)&&!(this.settingsGeneral_DS.section_$().form.reportSocketConnectionErrorsToErrorList===!0)&&x.matchesDisplayMessage(i)){t instanceof Error&&p.DyFM_Log.error("[CCAP]",e??"client-app",t);return}let s=this.getCurrentContext(),l;if(k.isNg0600Message(i))try{l=k.buildDiagnostics({stack:f.getStackForReport(t),context:{route:s.route,url:s.url,userAgent:s.userAgent,timestamp:s.timestamp},clientSource:e})}catch(a){p.DyFM_Log.error("CCAP NG0600 diagnostics failed",a)}let m;if(S.isNg0203Message(i))try{m=S.buildDiagnostics({stack:f.getStackForReport(t),context:{route:s.route,url:s.url,userAgent:s.userAgent,timestamp:s.timestamp},clientSource:e})}catch(a){p.DyFM_Log.error("CCAP NG0203 diagnostics failed",a)}let R=e!=null&&e.trim().length>0?e.trim():void 0,E={id:this.nextNotificationId++,error:t,displayMessage:i,timestamp:Date.now(),isDismissing:!1,clientSource:R,ng0600Diagnostics:l,ng0203Diagnostics:m};if(this.errors_$.update(a=>{let u=[...a,E];return u.length>r.maxNotifications?u.slice(u.length-r.maxNotifications):u}),setTimeout(()=>{this.dismissNotification(E.id)},r.autoDismissMs),t instanceof Error&&p.DyFM_Log.error("[CCAP]",e??"client-app",t),!(t instanceof d)){let a=this.buildReportPayloadFromError(t,e??"client-app"),u="";l!=null?u=k.formatDiagnosticsAppendix(l):m!=null&&(u=S.formatDiagnosticsAppendix(m));let X=u.length>0?`${a.stack??""}${u}`:a.stack??"",Y={message:a.message,stack:X,source:a.source,sessionId:a.sessionId,runId:a.runId,errorCode:a.errorCode,errorAdditionalContent:a.errorAdditionalContent,clientContext:a.clientContext};this.errors_AS.reportError(Y).catch(()=>{})}}catch(i){p.DyFM_Log.error("CCAP showError set failed",i)}},0)}selectError(t){let e=this.errors_$().find(i=>i.id===t);e!=null&&this.selectedNotificationForModal_$.set(e)}dismissNotification(t){let i=this.errors_$().find(o=>o.id===t);i==null||i.isDismissing||(this.errors_$.update(o=>o.map(s=>s.id===t?j(b({},s),{isDismissing:!0}):s)),setTimeout(()=>{this.errors_$.update(o=>o.filter(s=>s.id!==t))},r.exitAnimationMs))}dismissSelected(){this.selectedNotificationForModal_$.set(null)}dismissAll(){this.errors_$.set([]),this.selectedNotificationForModal_$.set(null)}copyToClipboard(t){return L(this,null,function*(){return(yield this.tryWriteTextWithNavigatorClipboard(t))?{ok:!0}:this.copyTextWithExecCommand(t)?{ok:!0}:{ok:!1,error:new Error("Clipboard copy failed (secure Clipboard API unavailable or denied, and legacy execCommand copy failed)")}})}tryWriteTextWithNavigatorClipboard(t){return L(this,null,function*(){let e=typeof navigator<"u"?navigator.clipboard:void 0;if(e==null||typeof e.writeText!="function")return!1;try{return yield e.writeText(t),!0}catch{return!1}})}copyTextWithExecCommand(t){if(typeof document>"u"||typeof document.execCommand!="function")return!1;let e=document.createElement("textarea");e.value=t,e.setAttribute("readonly",""),e.setAttribute("aria-hidden","true"),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.margin="0",e.style.border="none",e.style.outline="none",e.style.opacity="0",e.style.pointerEvents="none",document.body.appendChild(e),e.focus(),e.select();let i=t.length;e.setSelectionRange(0,i);let o=!1;try{o=document.execCommand("copy")}catch{o=!1}return e.remove(),o}reportErrorOnly(t){if(!(this.settingsGeneral_DS.section_$().form.reportSocketConnectionErrorsToErrorList===!0)&&(t.source==="client-socket"||x.matchesDisplayMessage(t.message)))return;let i=this.buildReportPayloadFromParams(t);this.errors_AS.reportError(i).catch(()=>{})}static \u0275fac=function(e){return new(e||r)};static \u0275prov=F({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{S as a,k as b,c,$ as d,v as e,z as f,N as g,f as h,V as i,Ot as j};
27
- //# sourceMappingURL=chunk-66YFYBOC.js.map
27
+ //# sourceMappingURL=chunk-2L25BDDH.js.map
@@ -1,2 +1,2 @@
1
- import{j as s}from"./chunk-SUAZOLRE.js";var r="ccap-personaSoulDraft";function p(){try{let o=localStorage.getItem(r);if(!o)return null;let n=s.tryParseStrict({text:o,contextLabel:"CCAP_PersonaDraft_localStorage"});if(!n.ok)return null;let e=n.value;if(typeof e!="object"||e===null)return null;let t=Object.fromEntries(Object.entries(e)),a=typeof t.name=="string"?t.name:"",c=typeof t.personality=="string"?t.personality:"",i=typeof t.conversation_style=="string"?t.conversation_style:"",l=typeof t.work_style=="string"?t.work_style:"",f=typeof t.mission=="string"?t.mission:"",y=typeof t.avoid=="string"?t.avoid:"";return{name:a,personality:c,conversation_style:i,work_style:l,mission:f,avoid:y}}catch{return null}}function g(o){try{localStorage.setItem(r,JSON.stringify(o))}catch{}}function u(){try{localStorage.removeItem(r)}catch{}}var m={get:p,save:g,clear:u};export{m as a};
2
- //# sourceMappingURL=chunk-L2E2MBF2.js.map
1
+ import{j as s}from"./chunk-P47C3DF2.js";var r="ccap-personaSoulDraft";function p(){try{let o=localStorage.getItem(r);if(!o)return null;let n=s.tryParseStrict({text:o,contextLabel:"CCAP_PersonaDraft_localStorage"});if(!n.ok)return null;let e=n.value;if(typeof e!="object"||e===null)return null;let t=Object.fromEntries(Object.entries(e)),a=typeof t.name=="string"?t.name:"",c=typeof t.personality=="string"?t.personality:"",i=typeof t.conversation_style=="string"?t.conversation_style:"",l=typeof t.work_style=="string"?t.work_style:"",f=typeof t.mission=="string"?t.mission:"",y=typeof t.avoid=="string"?t.avoid:"";return{name:a,personality:c,conversation_style:i,work_style:l,mission:f,avoid:y}}catch{return null}}function g(o){try{localStorage.setItem(r,JSON.stringify(o))}catch{}}function u(){try{localStorage.removeItem(r)}catch{}}var m={get:p,save:g,clear:u};export{m as a};
2
+ //# sourceMappingURL=chunk-3BN32RX3.js.map
@@ -1,2 +1,2 @@
1
- import{a as E}from"./chunk-X3CIXD4W.js";import{a as I}from"./chunk-EZQXUBC4.js";import{e as v}from"./chunk-ACLAVYA7.js";import{L,p as F,t as k,w as c}from"./chunk-ZJ3DCODZ.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-4JZNUGDT.js.map
1
+ import{a as E}from"./chunk-4YCGUCIE.js";import{a as I}from"./chunk-Q6DP4BK2.js";import{e as v}from"./chunk-CSNFLERX.js";import{L,p as F,t as k,w as c}from"./chunk-LGMUHF7N.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-3F4AEMEH.js.map
@@ -1,4 +1,4 @@
1
- import{a as G}from"./chunk-ALRGHRMX.js";import{a as K}from"./chunk-M53FIKSO.js";import{e as F}from"./chunk-ACLAVYA7.js";import{h as f,j as U}from"./chunk-66YFYBOC.js";import{I as D,p as H}from"./chunk-ZJ3DCODZ.js";import{C as _,R as L,a as w,aa as p,b as $,d as k,h as O,k as h,p as d,vb as g,xb as P,y as M}from"./chunk-TBMJSIBB.js";var C=O(H());var I=(()=>{class l{static GATEWAY_CHAT_MESSAGE_TIMESTAMP_FIELD_NAMES=["timestamp","createdAt","updatedAt","ts","time","sentAt","messageTimestamp","created_at","updated_at","lastMessageAt","last_message_at","startedAt","started_at","lastActivityAt","last_activity_at"];static GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES=["lastActivityAt","updatedAt","lastMessageAt","updated_at","last_activity_at","last_message_at","startedAt","started_at","createdAt","created_at"];static GATEWAY_SESSION_STARTED_FIELD_NAMES=["startedAt","started_at","createdAt","created_at"];static GATEWAY_OUTPUT_ONLY_TIMESTAMP_FIELD_NAMES=["lastMessageAt","last_message_at","lastOutputAt","last_output_at"];static extractTimestamp(t,s){for(let e of s){let n=t[e];if(typeof n=="string"&&n)return n;if(typeof n=="number"&&n>0){let o=n<1e12?n*1e3:n;return new Date(o).toISOString()}}}}return l})();var E=class l{static buildGatewaySessionsFetch(y){let t=y.response._firstSessionKeys,s=Array.isArray(t)?t:[],e=Array.isArray(y.response.sessions)?y.response.sessions:[],n=e.map(i=>l.mapRawSessionToListItem({raw:i,gatewayUrl:y.response.gatewayUrl}));return{listItems:l.sortListItemsByLastActivityDesc({items:n}),rawSessions:e,gatewayUrl:y.response.gatewayUrl,source:y.response.source,instanceId:y.response.instanceId,firstSessionKeys:s}}static mapRawSessionToListItem(y){let t=y.raw;return{sessionId:typeof t.key=="string"?t.key:typeof t.sessionId=="string"?t.sessionId:typeof t.id=="string"?t.id:String(t.key??t.sessionId??t.id??""),label:typeof t.label=="string"?t.label:typeof t.name=="string"?t.name:typeof t.title=="string"?t.title:void 0,workspacePath:typeof t.workspacePath=="string"?t.workspacePath:typeof t.cwd=="string"?t.cwd:"",status:typeof t.status=="string"?t.status:"unknown",statusMessage:typeof t.statusMessage=="string"?t.statusMessage:void 0,gatewayUrl:y.gatewayUrl,openclawAgentName:typeof t.agentName=="string"?t.agentName:typeof t.agent=="string"?t.agent:void 0,promptCount:typeof t.promptCount=="number"?t.promptCount:typeof t.messageCount=="number"?t.messageCount:0,toolCallCount:typeof t.toolCallCount=="number"?t.toolCallCount:0,lastActivityAt:I.extractTimestamp(t,I.GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES),startedAt:I.extractTimestamp(t,I.GATEWAY_SESSION_STARTED_FIELD_NAMES),lastPrompt:typeof t.lastPrompt=="string"?t.lastPrompt:void 0,mode:typeof t.mode=="string"?t.mode:void 0,reasoningEffort:typeof t.reasoningEffort=="string"?t.reasoningEffort:typeof t.thinking=="string"?t.thinking:void 0,isArchived:typeof t.isArchived=="boolean"?t.isArchived:!1}}static sortListItemsByLastActivityDesc(y){return[...y.items].sort((t,s)=>{let e=t.lastActivityAt?new Date(t.lastActivityAt).getTime():0;return(s.lastActivityAt?new Date(s.lastActivityAt).getTime():0)-e})}};var N=(()=>{class l{baseUrl=`${D.api.baseUrl}/oc-session`;http=_(P);peiContext_DS=_(K);withCcapId(t){let s=this.peiContext_DS.activeCcapId_$();return s?t.set("ccapId",s):t}createSession(t){let s=this.withCcapId(new g);return d(this.http.post(this.baseUrl,t,{params:s}))}listSessions(t){let s=this.withCcapId(new g);return t?.status&&(s=s.set("status",t.status)),t?.workspacePath&&(s=s.set("workspacePath",t.workspacePath)),t?.gatewayUrl&&(s=s.set("gatewayUrl",t.gatewayUrl)),t?.includeArchived&&(s=s.set("includeArchived","1")),t?.limit!=null&&(s=s.set("limit",String(t.limit))),t?.offset!=null&&(s=s.set("offset",String(t.offset))),d(this.http.get(this.baseUrl,{params:s}))}listGatewaySessions(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.get(`${this.baseUrl}/gateway-sessions`,{params:s}))}getGatewaySessionHistory(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.get(`${this.baseUrl}/gateway-sessions/${t.sessionId}/history`,{params:s}))}sendGatewayPrompt(t){return d(this.http.post(`${this.baseUrl}/gateway-sessions/${t.sessionId}/send`,{instanceId:t.instanceId,content:t.content,agentName:t.agentName}))}abortGatewaySession(t){return d(this.http.post(`${this.baseUrl}/gateway-sessions/${t.sessionId}/abort`,{instanceId:t.instanceId}))}deleteGatewaySession(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.delete(`${this.baseUrl}/gateway-sessions/${t.sessionId}`,{params:s}))}getSession(t){let s=this.withCcapId(new g);return d(this.http.get(`${this.baseUrl}/${t.sessionId}`,{params:s}))}sendPrompt(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/prompt`,{content:t.content},{params:s}))}reconnectSession(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/reconnect`,{},{params:s}))}stopExecution(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/stop-execution`,{},{params:s}))}terminateSession(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/terminate`,{},{params:s}))}updateSessionConfig(t){let o=t,{sessionId:s}=o,e=k(o,["sessionId"]),n=this.withCcapId(new g);return d(this.http.patch(`${this.baseUrl}/${s}/config`,e,{params:n}))}setSessionArchived(t){let s=this.withCcapId(new g);return d(this.http.patch(`${this.baseUrl}/${t.sessionId}/archive`,{isArchived:t.isArchived},{params:s}))}getSessionEvents(t){let s=this.withCcapId(new g);return t.eventType&&(s=s.set("eventType",t.eventType)),t.since&&(s=s.set("since",t.since)),t.sinceSequence!=null&&(s=s.set("sinceSequence",String(t.sinceSequence))),t.limit!=null&&(s=s.set("limit",String(t.limit))),t.offset!=null&&(s=s.set("offset",String(t.offset))),t.latest&&(s=s.set("latest","1")),d(this.http.get(`${this.baseUrl}/${t.sessionId}/events`,{params:s}))}getSessionEventStreamUrl(t){let s=`${this.baseUrl}/${t.sessionId}/events/stream`,e=this.peiContext_DS.activeCcapId_$();return e?`${s}?ccapId=${encodeURIComponent(e)}`:s}static \u0275fac=function(s){return new(s||l)};static \u0275prov=M({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();var lt=(()=>{class l{sessions_$=p([]);sessionsLoading_$=p(!1);sessionsLoadError_$=p(null);selectedSession_$=p(null);selectedSessionLoading_$=p(!1);selectedSessionEvents_$=p([]);consoleMessages_$=p([]);assembledMessages_$=p([]);lastStatusUpdate_$=p(null);sessionUsage_$=p({inputTokens:0,outputTokens:0,costUsd:0});activeSessionId_$=p("");activeInstanceId_$=p("");gatewayFilter_$=p(null);extSessionMsg_AS=_(G);ocSession_AS=_(N);globalError_CS=_(U);socket_CS=_(F);ngZone=_(L);eventSubscription=null;reconnectSubscription=null;lastKnownEventSequence=-1;chatPollHandle=null;detailPollHandle=null;lastPolledHistoryFingerprint="";constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(t=>{this.handleSocketEvent(t)}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(t=>{if(t){let s=this.activeSessionId_$();s&&(this.socket_CS.emit("oc-session:subscribe",{sessionId:s}),this.loadAssembledMessages({sessionId:s}).catch(()=>{})),this.backfillMissedEvents()}})}ngOnDestroy(){this.stopChatPolling(),this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null),this.reconnectSubscription&&(this.reconnectSubscription.unsubscribe(),this.reconnectSubscription=null)}setGatewayFilter(t){this.gatewayFilter_$.set(t),this.loadSessions().catch(()=>{})}setGatewayFilterOnly(t){this.gatewayFilter_$.set(t)}loadSessions(t){return h(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let e=[...(yield this.ocSession_AS.listSessions({status:t?.status,workspacePath:t?.workspacePath,gatewayUrl:this.gatewayFilter_$()??void 0,includeArchived:t?.includeArchived})).sessions].sort((n,o)=>{let i=n.lastActivityAt?new Date(n.lastActivityAt).getTime():0;return(o.lastActivityAt?new Date(o.lastActivityAt).getTime():0)-i});this.sessions_$.set(e)}catch(s){this.sessionsLoadError_$.set(s),this.pushConsoleMessage({type:"error",text:`Load sessions failed: ${f.getErrorMessageForDisplay(s)}`})}finally{this.sessionsLoading_$.set(!1)}})}fetchGatewaySessionsForInstance(t){return h(this,null,function*(){let s=yield this.ocSession_AS.listGatewaySessions({instanceId:t.instanceId});return E.buildGatewaySessionsFetch({response:s})})}loadGatewaySessions(t){return h(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let s=yield this.fetchGatewaySessionsForInstance({instanceId:t.instanceId});!s.listItems.length&&s.rawSessions.length>0&&this.pushConsoleMessage({type:"error",text:`Gateway returned ${s.rawSessions.length} sessions but mapping produced 0.
1
+ import{a as G}from"./chunk-Z2O72EKW.js";import{a as K}from"./chunk-C7CAW6PK.js";import{e as F}from"./chunk-CSNFLERX.js";import{h as f,j as U}from"./chunk-2L25BDDH.js";import{I as D,p as H}from"./chunk-LGMUHF7N.js";import{C as _,R as L,a as w,aa as p,b as $,d as k,h as O,k as h,p as d,vb as g,xb as P,y as M}from"./chunk-TBMJSIBB.js";var C=O(H());var I=(()=>{class l{static GATEWAY_CHAT_MESSAGE_TIMESTAMP_FIELD_NAMES=["timestamp","createdAt","updatedAt","ts","time","sentAt","messageTimestamp","created_at","updated_at","lastMessageAt","last_message_at","startedAt","started_at","lastActivityAt","last_activity_at"];static GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES=["lastActivityAt","updatedAt","lastMessageAt","updated_at","last_activity_at","last_message_at","startedAt","started_at","createdAt","created_at"];static GATEWAY_SESSION_STARTED_FIELD_NAMES=["startedAt","started_at","createdAt","created_at"];static GATEWAY_OUTPUT_ONLY_TIMESTAMP_FIELD_NAMES=["lastMessageAt","last_message_at","lastOutputAt","last_output_at"];static extractTimestamp(t,s){for(let e of s){let n=t[e];if(typeof n=="string"&&n)return n;if(typeof n=="number"&&n>0){let o=n<1e12?n*1e3:n;return new Date(o).toISOString()}}}}return l})();var E=class l{static buildGatewaySessionsFetch(y){let t=y.response._firstSessionKeys,s=Array.isArray(t)?t:[],e=Array.isArray(y.response.sessions)?y.response.sessions:[],n=e.map(i=>l.mapRawSessionToListItem({raw:i,gatewayUrl:y.response.gatewayUrl}));return{listItems:l.sortListItemsByLastActivityDesc({items:n}),rawSessions:e,gatewayUrl:y.response.gatewayUrl,source:y.response.source,instanceId:y.response.instanceId,firstSessionKeys:s}}static mapRawSessionToListItem(y){let t=y.raw;return{sessionId:typeof t.key=="string"?t.key:typeof t.sessionId=="string"?t.sessionId:typeof t.id=="string"?t.id:String(t.key??t.sessionId??t.id??""),label:typeof t.label=="string"?t.label:typeof t.name=="string"?t.name:typeof t.title=="string"?t.title:void 0,workspacePath:typeof t.workspacePath=="string"?t.workspacePath:typeof t.cwd=="string"?t.cwd:"",status:typeof t.status=="string"?t.status:"unknown",statusMessage:typeof t.statusMessage=="string"?t.statusMessage:void 0,gatewayUrl:y.gatewayUrl,openclawAgentName:typeof t.agentName=="string"?t.agentName:typeof t.agent=="string"?t.agent:void 0,promptCount:typeof t.promptCount=="number"?t.promptCount:typeof t.messageCount=="number"?t.messageCount:0,toolCallCount:typeof t.toolCallCount=="number"?t.toolCallCount:0,lastActivityAt:I.extractTimestamp(t,I.GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES),startedAt:I.extractTimestamp(t,I.GATEWAY_SESSION_STARTED_FIELD_NAMES),lastPrompt:typeof t.lastPrompt=="string"?t.lastPrompt:void 0,mode:typeof t.mode=="string"?t.mode:void 0,reasoningEffort:typeof t.reasoningEffort=="string"?t.reasoningEffort:typeof t.thinking=="string"?t.thinking:void 0,isArchived:typeof t.isArchived=="boolean"?t.isArchived:!1}}static sortListItemsByLastActivityDesc(y){return[...y.items].sort((t,s)=>{let e=t.lastActivityAt?new Date(t.lastActivityAt).getTime():0;return(s.lastActivityAt?new Date(s.lastActivityAt).getTime():0)-e})}};var N=(()=>{class l{baseUrl=`${D.api.baseUrl}/oc-session`;http=_(P);peiContext_DS=_(K);withCcapId(t){let s=this.peiContext_DS.activeCcapId_$();return s?t.set("ccapId",s):t}createSession(t){let s=this.withCcapId(new g);return d(this.http.post(this.baseUrl,t,{params:s}))}listSessions(t){let s=this.withCcapId(new g);return t?.status&&(s=s.set("status",t.status)),t?.workspacePath&&(s=s.set("workspacePath",t.workspacePath)),t?.gatewayUrl&&(s=s.set("gatewayUrl",t.gatewayUrl)),t?.includeArchived&&(s=s.set("includeArchived","1")),t?.limit!=null&&(s=s.set("limit",String(t.limit))),t?.offset!=null&&(s=s.set("offset",String(t.offset))),d(this.http.get(this.baseUrl,{params:s}))}listGatewaySessions(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.get(`${this.baseUrl}/gateway-sessions`,{params:s}))}getGatewaySessionHistory(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.get(`${this.baseUrl}/gateway-sessions/${t.sessionId}/history`,{params:s}))}sendGatewayPrompt(t){return d(this.http.post(`${this.baseUrl}/gateway-sessions/${t.sessionId}/send`,{instanceId:t.instanceId,content:t.content,agentName:t.agentName}))}abortGatewaySession(t){return d(this.http.post(`${this.baseUrl}/gateway-sessions/${t.sessionId}/abort`,{instanceId:t.instanceId}))}deleteGatewaySession(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.delete(`${this.baseUrl}/gateway-sessions/${t.sessionId}`,{params:s}))}getSession(t){let s=this.withCcapId(new g);return d(this.http.get(`${this.baseUrl}/${t.sessionId}`,{params:s}))}sendPrompt(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/prompt`,{content:t.content},{params:s}))}reconnectSession(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/reconnect`,{},{params:s}))}stopExecution(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/stop-execution`,{},{params:s}))}terminateSession(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/terminate`,{},{params:s}))}updateSessionConfig(t){let o=t,{sessionId:s}=o,e=k(o,["sessionId"]),n=this.withCcapId(new g);return d(this.http.patch(`${this.baseUrl}/${s}/config`,e,{params:n}))}setSessionArchived(t){let s=this.withCcapId(new g);return d(this.http.patch(`${this.baseUrl}/${t.sessionId}/archive`,{isArchived:t.isArchived},{params:s}))}getSessionEvents(t){let s=this.withCcapId(new g);return t.eventType&&(s=s.set("eventType",t.eventType)),t.since&&(s=s.set("since",t.since)),t.sinceSequence!=null&&(s=s.set("sinceSequence",String(t.sinceSequence))),t.limit!=null&&(s=s.set("limit",String(t.limit))),t.offset!=null&&(s=s.set("offset",String(t.offset))),t.latest&&(s=s.set("latest","1")),d(this.http.get(`${this.baseUrl}/${t.sessionId}/events`,{params:s}))}getSessionEventStreamUrl(t){let s=`${this.baseUrl}/${t.sessionId}/events/stream`,e=this.peiContext_DS.activeCcapId_$();return e?`${s}?ccapId=${encodeURIComponent(e)}`:s}static \u0275fac=function(s){return new(s||l)};static \u0275prov=M({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();var lt=(()=>{class l{sessions_$=p([]);sessionsLoading_$=p(!1);sessionsLoadError_$=p(null);selectedSession_$=p(null);selectedSessionLoading_$=p(!1);selectedSessionEvents_$=p([]);consoleMessages_$=p([]);assembledMessages_$=p([]);lastStatusUpdate_$=p(null);sessionUsage_$=p({inputTokens:0,outputTokens:0,costUsd:0});activeSessionId_$=p("");activeInstanceId_$=p("");gatewayFilter_$=p(null);extSessionMsg_AS=_(G);ocSession_AS=_(N);globalError_CS=_(U);socket_CS=_(F);ngZone=_(L);eventSubscription=null;reconnectSubscription=null;lastKnownEventSequence=-1;chatPollHandle=null;detailPollHandle=null;lastPolledHistoryFingerprint="";constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(t=>{this.handleSocketEvent(t)}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(t=>{if(t){let s=this.activeSessionId_$();s&&(this.socket_CS.emit("oc-session:subscribe",{sessionId:s}),this.loadAssembledMessages({sessionId:s}).catch(()=>{})),this.backfillMissedEvents()}})}ngOnDestroy(){this.stopChatPolling(),this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null),this.reconnectSubscription&&(this.reconnectSubscription.unsubscribe(),this.reconnectSubscription=null)}setGatewayFilter(t){this.gatewayFilter_$.set(t),this.loadSessions().catch(()=>{})}setGatewayFilterOnly(t){this.gatewayFilter_$.set(t)}loadSessions(t){return h(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let e=[...(yield this.ocSession_AS.listSessions({status:t?.status,workspacePath:t?.workspacePath,gatewayUrl:this.gatewayFilter_$()??void 0,includeArchived:t?.includeArchived})).sessions].sort((n,o)=>{let i=n.lastActivityAt?new Date(n.lastActivityAt).getTime():0;return(o.lastActivityAt?new Date(o.lastActivityAt).getTime():0)-i});this.sessions_$.set(e)}catch(s){this.sessionsLoadError_$.set(s),this.pushConsoleMessage({type:"error",text:`Load sessions failed: ${f.getErrorMessageForDisplay(s)}`})}finally{this.sessionsLoading_$.set(!1)}})}fetchGatewaySessionsForInstance(t){return h(this,null,function*(){let s=yield this.ocSession_AS.listGatewaySessions({instanceId:t.instanceId});return E.buildGatewaySessionsFetch({response:s})})}loadGatewaySessions(t){return h(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let s=yield this.fetchGatewaySessionsForInstance({instanceId:t.instanceId});!s.listItems.length&&s.rawSessions.length>0&&this.pushConsoleMessage({type:"error",text:`Gateway returned ${s.rawSessions.length} sessions but mapping produced 0.
2
2
  First session keys: ${s.firstSessionKeys.join(", ")}`}),this.sessions_$.set(s.listItems)}catch(s){this.sessionsLoadError_$.set(s),this.pushConsoleMessage({type:"error",text:`Load gateway sessions failed: ${f.getErrorMessageForDisplay(s)}`})}finally{this.sessionsLoading_$.set(!1)}})}loadSessionDetail(t){return h(this,null,function*(){let s=t.isSilent===!0;s||this.selectedSessionLoading_$.set(!0);try{let e=yield this.ocSession_AS.getSession({sessionId:t.sessionId});this.selectedSession_$.set(e),this.loadAssembledMessages({sessionId:t.sessionId}).catch(()=>{})}catch(e){if(!s){this.selectedSession_$.set(null);let n=e instanceof Error?e.message:"Failed to load session details";this.pushConsoleMessage({type:"error",text:`Load session failed: ${n}`})}}finally{s||this.selectedSessionLoading_$.set(!1)}})}loadGatewaySessionHistory(t){return h(this,null,function*(){this.selectedSessionLoading_$.set(!0),this.consoleMessages_$.set([]);try{let s=yield this.ocSession_AS.getGatewaySessionHistory({sessionId:t.sessionId,instanceId:t.instanceId}),e=s,n=Array.isArray(e._rawKeys)?e._rawKeys:[],o=Array.isArray(s.history)?s.history:[],i=this.parseGatewayHistory(o),a=typeof e.messageCount=="number"?e.messageCount:0,r=Array.isArray(e._firstMessageKeys)?e._firstMessageKeys:[];i.length?this.consoleMessages_$.set(i):a>0?this.consoleMessages_$.set([{listKey:this.allocateConsoleListKey(),type:"error",text:`Gateway session has ${a} messages, but mapping failed.
3
3
  Message keys: ${r.join(", ")||"unknown"}
4
4
  Gateway response keys: ${n.join(", ")||"none"}`,timestamp:new Date().toISOString()}]):this.consoleMessages_$.set([{listKey:this.allocateConsoleListKey(),type:"info",text:"Gateway session loaded \u2014 session has no messages yet.",timestamp:new Date().toISOString()}]),this.selectedSession_$.set({session:{sessionId:t.sessionId,workspacePath:"",status:"unknown",promptCount:0,toolCallCount:0,isArchived:!1},runtime:{isLive:!1,runtimeStatus:null,outputBufferLength:0}}),this.lastPolledHistoryFingerprint=this.computeGatewayHistoryFingerprint(o),this.startChatPolling()}catch(s){this.selectedSession_$.set(null),this.pushConsoleMessage({type:"error",text:`Load gateway session history failed: ${f.getErrorMessageForDisplay(s)}`})}finally{this.selectedSessionLoading_$.set(!1)}})}loadSessionEvents(t){return h(this,null,function*(){try{let s=yield this.ocSession_AS.getSessionEvents({sessionId:t.sessionId,eventType:t.eventType,limit:t.limit??500,latest:!0});this.selectedSessionEvents_$.set(s.events),this.updateLastKnownSequence(s.events);for(let e of s.events)this.pushConsoleMessageFromEvent(e)}catch(s){this.selectedSessionEvents_$.set([]),this.pushConsoleMessage({type:"error",text:`Load events failed: ${f.getErrorMessageForDisplay(s)}`})}})}createSession(t){return h(this,null,function*(){try{let s=yield this.ocSession_AS.createSession(t),e=String(s.session.sessionId||"");return yield this.loadSessions(),e}catch(s){throw this.pushConsoleMessage({type:"error",text:`Create session failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}sendPrompt(t){return h(this,null,function*(){this.pushConsoleMessage({type:"prompt",text:t.content});try{let s=this.activeInstanceId_$();s?yield this.ocSession_AS.sendGatewayPrompt({sessionId:t.sessionId,instanceId:s,content:t.content}):yield this.ocSession_AS.sendPrompt(t)}catch(s){throw this.pushConsoleMessage({type:"error",text:`Send failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}reconnectSession(t){return h(this,null,function*(){try{yield this.ocSession_AS.reconnectSession(t),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Reconnect failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}stopExecution(t){return h(this,null,function*(){try{yield this.ocSession_AS.stopExecution(t)}catch(s){throw this.pushConsoleMessage({type:"error",text:`Stop execution failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}terminateSession(t){return h(this,null,function*(){try{yield this.ocSession_AS.terminateSession(t),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Terminate failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}setSessionArchived(t){return h(this,null,function*(){try{yield this.ocSession_AS.setSessionArchived(t),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Archive failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}updateSessionConfig(t){return h(this,null,function*(){try{yield this.ocSession_AS.updateSessionConfig(t);let s=this.selectedSession_$();if(s?.session.sessionId===t.sessionId){let e=w({},s.session);t.mode!=null&&(e.mode=t.mode),t.reasoningEffort!=null&&(e.reasoningEffort=t.reasoningEffort),t.openclawAgentName!=null&&(e.openclawAgentName=t.openclawAgentName),this.selectedSession_$.set($(w({},s),{session:e}))}}catch(s){throw this.pushConsoleMessage({type:"error",text:`Config update failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}setActiveSessionId(t){let s=this.activeSessionId_$();s&&s!==t&&this.socket_CS.emit("oc-session:unsubscribe",{sessionId:s}),this.activeSessionId_$.set(t),t&&this.socket_CS.emit("oc-session:subscribe",{sessionId:t})}clearLiveOutput(){this.stopChatPolling(),this.consoleMessages_$.set([]),this.sessionUsage_$.set({inputTokens:0,outputTokens:0,costUsd:0}),this.lastKnownEventSequence=-1}allocateConsoleListKey(){return globalThis.crypto.randomUUID()}pushConsoleMessage(t){let s=t.type==="assistant"||t.type==="prompt"?t.text.trim():t.text,e={listKey:t.listKey??this.allocateConsoleListKey(),type:t.type,text:s,timestamp:t.timestamp??new Date().toISOString(),expandableContent:t.expandableContent,rawData:t.rawData},n=this.consoleMessages_$();this.consoleMessages_$.set([...n,e])}static CHAT_POLL_INTERVAL_MS=5*C.second;static DETAIL_POLL_INTERVAL_MS=10*C.second;startChatPolling(){this.stopChatPolling(),this.chatPollHandle=setInterval(()=>{this.pollChatHistory()},l.CHAT_POLL_INTERVAL_MS),this.detailPollHandle=setInterval(()=>{let t=this.activeSessionId_$();t&&this.loadSessionDetail({sessionId:t,isSilent:!0})},l.DETAIL_POLL_INTERVAL_MS)}stopChatPolling(){this.chatPollHandle&&(clearInterval(this.chatPollHandle),this.chatPollHandle=null),this.detailPollHandle&&(clearInterval(this.detailPollHandle),this.detailPollHandle=null),this.lastPolledHistoryFingerprint=""}computeGatewayHistoryFingerprint(t){let s=t.length;if(!s)return"0";let e=t[s-1],n=typeof e.id=="string"?e.id:typeof e.messageId=="string"?e.messageId:"",o=l.extractGatewayChatMessageTimestamp(e),i=this.extractTextFromMessage(e),a=400,r=i.length>a?i.slice(0,a):i;return`${s}${n}${o}${r}`}pollChatHistory(){return h(this,null,function*(){let t=this.activeSessionId_$(),s=this.activeInstanceId_$();if(!(!t||!s))try{let e=yield this.ocSession_AS.getGatewaySessionHistory({sessionId:t,instanceId:s}),n=Array.isArray(e.history)?e.history:[],o=this.computeGatewayHistoryFingerprint(n);if(o===this.lastPolledHistoryFingerprint)return;this.lastPolledHistoryFingerprint=o;let i=this.parseGatewayHistory(n);this.ngZone.run(()=>{this.consoleMessages_$.set(i)})}catch{}})}parseGatewayHistory(t){let s=[],e=new Map,n=[];for(let i of t){let a=i.content;if(Array.isArray(a))for(let r of a){let u=typeof r.type=="string"?r.type:"";if(u==="tool_use"||u==="toolCall"){let S=typeof r.id=="string"?r.id:"";S&&n.push(S)}if(u==="tool_result"){let S=typeof r.tool_use_id=="string"?r.tool_use_id:"";S&&e.set(S,this.extractTextFromContentBlock(r))}}}let o=0;for(let i of t){let a=typeof i.role=="string"?i.role:"";if(a==="toolResult"||a==="tool_result"){let r=this.extractTextFromMessage(i);o<n.length&&(e.set(n[o],r),o++)}}for(let i of t){let a=typeof i.role=="string"?i.role:"unknown",r=i.content,u=l.extractGatewayChatMessageTimestamp(i);if(a==="toolResult"||a==="tool_result")continue;if(typeof r=="string"){s.push({listKey:this.allocateConsoleListKey(),type:a==="user"||a==="human"?"prompt":a==="assistant"?"assistant":"info",text:r,timestamp:u,rawData:i});continue}if(Array.isArray(r)){for(let c of r){let v=typeof c.type=="string"?c.type:"";if(v==="text")s.push({listKey:this.allocateConsoleListKey(),type:a==="user"||a==="human"?"prompt":"assistant",text:typeof c.text=="string"?c.text:"",timestamp:u,rawData:{_block:c,_message:{role:a,timestamp:u,contentBlockCount:r.length}}});else if(v==="tool_use"||v==="toolCall"){let b=typeof c.name=="string"?c.name:"unknown tool",T=typeof c.id=="string"?c.id:"",m=c.input??c.arguments,A=e.get(T);s.push({listKey:this.allocateConsoleListKey(),type:"tool",text:`${b}
@@ -6,4 +6,4 @@ ${JSON.stringify(m,null,2)}`,timestamp:u,expandableContent:A,rawData:{_block:c,_
6
6
  `):A=JSON.stringify(c,null,2),s.push({listKey:this.allocateConsoleListKey(),type:"tool-result",text:A,timestamp:u,rawData:{_block:c}})}}else v==="thinking"?s.push({listKey:this.allocateConsoleListKey(),type:"info",text:typeof c.thinking=="string"?c.thinking:JSON.stringify(c,null,2),timestamp:u,rawData:{_block:c}}):s.push({listKey:this.allocateConsoleListKey(),type:"info",text:JSON.stringify(c,null,2),timestamp:u,rawData:{_block:c}})}continue}let S=typeof i.text=="string"?i.text:typeof i.message=="string"?i.message:JSON.stringify(i,null,2);s.push({listKey:this.allocateConsoleListKey(),type:a==="user"||a==="human"?"prompt":a==="assistant"?"assistant":a==="tool"||a==="tool_result"||a==="tool_use"?"tool":"info",text:S,timestamp:u,rawData:i})}return s}backfillMissedEvents(){return h(this,null,function*(){let t=this.activeSessionId_$();if(!(!t||this.lastKnownEventSequence<0))try{let e=(yield this.ocSession_AS.getSessionEvents({sessionId:t,sinceSequence:this.lastKnownEventSequence})).events;if(!e.length)return;this.ngZone.run(()=>{let n=this.selectedSessionEvents_$();this.selectedSessionEvents_$.set([...n,...e]);for(let o of e)this.pushConsoleMessageFromEvent(o);this.updateLastKnownSequence(e)})}catch(s){C.DyFM_Log.warn("CCAP_OcSession_DS | backfill failed",s)}})}updateLastKnownSequence(t){for(let s of t)s.sequence>this.lastKnownEventSequence&&(this.lastKnownEventSequence=s.sequence)}handleSocketEvent(t){let s=t.event,e=t.payload;try{this.ngZone.run(()=>{switch(s){case"oc-session:status":this.handleStatusUpdate(e);break;case"oc-session:output":this.handleOutputChunk(e);break;case"oc-session:event":this.handleSessionEvent(e);break;case"oc-session:list-update":this.handleListUpdate(e);break;case"ext-session-msg:message":this.handleAssembledMessage(e);break;case"ext-session-msg:update":this.handleAssembledMessageUpdate(e);break}})}catch(n){C.DyFM_Log.error(`CCAP_OcSession_DS | socket event error | event: ${s}`,n)}}handleStatusUpdate(t){let s=t.sessionId??"",e=t.status??"",n=t.statusMessage;this.lastStatusUpdate_$.set({sessionId:s,status:e,statusMessage:n});let i=this.sessions_$().map(r=>r.sessionId===s?$(w({},r),{status:e,statusMessage:n}):r);this.sessions_$.set(i);let a=this.selectedSession_$();if(a?.session.sessionId===s){let r=e==="running"||e==="waiting-input";this.selectedSession_$.set($(w({},a),{session:$(w({},a.session),{status:e,statusMessage:n}),runtime:$(w({},a.runtime),{isLive:r,runtimeStatus:e})}))}if(e==="errored"){let r=n?`OC Session error (${s}): ${n}`:`OC Session error (${s}): session entered errored state`;this.globalError_CS.showError(new Error(r),"oc-session-status")}}handleOutputChunk(t){let s=t.sessionId??"";if(s&&s!==this.activeSessionId_$())return;let e=t.content??"",n=t.type??"response";e&&this.pushConsoleMessage({type:n==="error"?"error":"assistant",text:e})}handleSessionEvent(t){let s=t.sessionId??"";if(s&&s!==this.activeSessionId_$())return;let e=t.event??{},n={sessionId:s,eventType:e.eventType??"",timestamp:e.timestamp??"",data:e.data??{},sequence:e.sequence??0};if(n.sequence<=this.lastKnownEventSequence)return;this.lastKnownEventSequence=n.sequence;let o=this.selectedSessionEvents_$();this.selectedSessionEvents_$.set([...o,n]),this.pushConsoleMessageFromEvent(n)}handleListUpdate(t){this.loadSessions().catch(()=>{})}extractTextFromContentBlock(t){let s=t.content;return typeof s=="string"?s:Array.isArray(s)?s.map(e=>typeof e.text=="string"?e.text:JSON.stringify(e,null,2)).join(`
7
7
  `):typeof t.text=="string"?t.text:JSON.stringify(t,null,2)}extractTextFromMessage(t){let s=t.content;return typeof s=="string"?s:Array.isArray(s)?s.map(e=>typeof e.text=="string"?e.text:JSON.stringify(e,null,2)).join(`
8
8
  `):JSON.stringify(t,null,2)}pushConsoleMessageFromEvent(t){let s=t.data;switch(t.eventType){case"response-chunk":{let e=typeof s.content=="string"?s.content:"";e&&this.pushConsoleMessage({type:"assistant",text:e});break}case"response-complete":{let e=s.usage;if(e&&typeof e=="object"){let n=e,o=this.sessionUsage_$();this.sessionUsage_$.set({inputTokens:o.inputTokens+(typeof n.inputTokens=="number"?n.inputTokens:0),outputTokens:o.outputTokens+(typeof n.outputTokens=="number"?n.outputTokens:0),costUsd:o.costUsd+(typeof n.costUsd=="number"?n.costUsd:0)})}break}case"tool-call-start":{let e=typeof s.name=="string"?s.name:"unknown",n=s.input,o=n?this.summarizeToolInput(n):"",i=o?`${e}: ${o}`:e;this.pushConsoleMessage({type:"tool",text:i,rawData:s});break}case"tool-call-end":{let e=s.content??s.output,n=typeof e=="string"?e:JSON.stringify(e??{});this.pushConsoleMessage({type:"tool-result",text:n.length>200?n.substring(0,200)+"\u2026":n,expandableContent:n.length>200?n:void 0,rawData:s});break}case"error":{let e=s.message??s.content;typeof e=="string"&&e&&this.pushConsoleMessage({type:"error",text:e});break}case"connection-change":{let e=typeof s.state=="string"?s.state:"";e&&this.pushConsoleMessage({type:"info",text:`Gateway connection: ${e}`,rawData:s});break}default:break}}summarizeToolInput(t){if(typeof t=="string")return t.length>80?t.substring(0,80)+"\u2026":t;if(typeof t=="object"&&t!==null){let s=JSON.stringify(t);return s.length>80?s.substring(0,80)+"\u2026":s}return""}static extractGatewayChatMessageTimestamp(t){return I.extractTimestamp(t,I.GATEWAY_CHAT_MESSAGE_TIMESTAMP_FIELD_NAMES)??""}loadAssembledMessages(t){return h(this,null,function*(){try{let s=yield this.extSessionMsg_AS.getMessages({sessionId:t.sessionId,latest:!0});this.assembledMessages_$.set(s.messages)}catch(s){C.DyFM_Log.error(`CCAP_OcSession_DS | loadAssembledMessages failed | sessionId: ${t.sessionId}`,s)}})}handleAssembledMessage(t){let s=typeof t.sessionId=="string"?t.sessionId:"";if(!s||s!==this.activeSessionId_$())return;let e=t.message;if(!e||typeof e!="object")return;let n=e,o=this.assembledMessages_$();this.assembledMessages_$.set([...o,n])}handleAssembledMessageUpdate(t){let s=typeof t.sessionId=="string"?t.sessionId:"";if(!s||s!==this.activeSessionId_$())return;let e=typeof t.messageKey=="string"?t.messageKey:"";if(!e)return;let n=t.update;if(!n||typeof n!="object")return;let o=n,i=this.assembledMessages_$(),a=i.findIndex(S=>S.messageKey===e);if(a<0)return;let r=w({},i[a]);typeof o.bodyText=="string"&&(r.bodyText=o.bodyText),o.toolResult!==void 0&&(r.toolResult=o.toolResult),typeof o.toolStatus=="string"&&(r.toolStatus=o.toolStatus),o.headerStatusDot!==void 0&&(r.headerStatusDot=typeof o.headerStatusDot=="string"?o.headerStatusDot:void 0);let u=[...i];u[a]=r,this.assembledMessages_$.set(u)}static \u0275fac=function(s){return new(s||l)};static \u0275prov=M({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();export{I as a,lt as b};
9
- //# sourceMappingURL=chunk-35HAXCRL.js.map
9
+ //# sourceMappingURL=chunk-4EQNFMWU.js.map
@@ -1,2 +1,2 @@
1
- import{I as d}from"./chunk-ZJ3DCODZ.js";import{C as o,p as n,xb as l,y as s}from"./chunk-TBMJSIBB.js";var p=(()=>{class r{baseUrl=`${d.api.baseUrl}/model-registry`;http=o(l);getList(e){let t=new URLSearchParams;e?.provider!==void 0&&e.provider.trim()!==""&&t.set("provider",e.provider.trim()),e?.modelName!==void 0&&e.modelName.trim()!==""&&t.set("modelName",e.modelName.trim()),e?.enabled===!0?t.set("enabled","true"):e?.enabled===!1&&t.set("enabled","false"),e?.inactiveProviderOnly===!0&&t.set("inactiveProviderOnly","true");let i=t.toString(),u=`${this.baseUrl}/list${i!==""?`?${i}`:""}`;return n(this.http.get(u))}sync(){return n(this.http.post(`${this.baseUrl}/sync`,{}))}setEnabled(e,t){return n(this.http.patch(`${this.baseUrl}/patch/${encodeURIComponent(e)}`,{enabled:t}))}patchEntry(e,t){let i={};return t.enabled!==void 0&&(i.enabled=t.enabled),t.reasoningLevelForTest!==void 0&&(i.reasoningLevelForTest=t.reasoningLevelForTest),t.capabilities!==void 0&&(i.capabilities=t.capabilities),n(this.http.patch(`${this.baseUrl}/patch/${encodeURIComponent(e)}`,i))}bulkSetEnabled(e,t){return n(this.http.patch(`${this.baseUrl}/bulk-enabled`,{ids:e,enabled:t}))}deleteEntry(e){return n(this.http.delete(`${this.baseUrl}/entry/${encodeURIComponent(e)}`))}deleteEntries(e){return n(this.http.post(`${this.baseUrl}/delete-entries`,{ids:e}))}getTestResults(e){let t=new URLSearchParams;e.provider&&t.set("provider",e.provider),e.model&&t.set("model",e.model),e.limit!==void 0&&t.set("limit",String(e.limit)),e.reasoningLevel!==void 0&&e.reasoningLevel.trim()!==""&&t.set("reasoningLevel",e.reasoningLevel.trim());let i=t.toString();return n(this.http.get(`${this.baseUrl}/test-results${i?`?${i}`:""}`))}getPrompts(){return n(this.http.get(`${this.baseUrl}/prompts`))}startTestRun(e,t){let i={modelIds:e};return t!==void 0&&t.length>0&&(i.promptIds=t),n(this.http.post(`${this.baseUrl}/test-run`,i))}getTestRunStatus(e){return n(this.http.get(`${this.baseUrl}/test-run/${e}`))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{p as a};
2
- //# sourceMappingURL=chunk-X3CIXD4W.js.map
1
+ import{I as d}from"./chunk-LGMUHF7N.js";import{C as o,p as n,xb as l,y as s}from"./chunk-TBMJSIBB.js";var p=(()=>{class r{baseUrl=`${d.api.baseUrl}/model-registry`;http=o(l);getList(e){let t=new URLSearchParams;e?.provider!==void 0&&e.provider.trim()!==""&&t.set("provider",e.provider.trim()),e?.modelName!==void 0&&e.modelName.trim()!==""&&t.set("modelName",e.modelName.trim()),e?.enabled===!0?t.set("enabled","true"):e?.enabled===!1&&t.set("enabled","false"),e?.inactiveProviderOnly===!0&&t.set("inactiveProviderOnly","true");let i=t.toString(),u=`${this.baseUrl}/list${i!==""?`?${i}`:""}`;return n(this.http.get(u))}sync(){return n(this.http.post(`${this.baseUrl}/sync`,{}))}setEnabled(e,t){return n(this.http.patch(`${this.baseUrl}/patch/${encodeURIComponent(e)}`,{enabled:t}))}patchEntry(e,t){let i={};return t.enabled!==void 0&&(i.enabled=t.enabled),t.reasoningLevelForTest!==void 0&&(i.reasoningLevelForTest=t.reasoningLevelForTest),t.capabilities!==void 0&&(i.capabilities=t.capabilities),n(this.http.patch(`${this.baseUrl}/patch/${encodeURIComponent(e)}`,i))}bulkSetEnabled(e,t){return n(this.http.patch(`${this.baseUrl}/bulk-enabled`,{ids:e,enabled:t}))}deleteEntry(e){return n(this.http.delete(`${this.baseUrl}/entry/${encodeURIComponent(e)}`))}deleteEntries(e){return n(this.http.post(`${this.baseUrl}/delete-entries`,{ids:e}))}getTestResults(e){let t=new URLSearchParams;e.provider&&t.set("provider",e.provider),e.model&&t.set("model",e.model),e.limit!==void 0&&t.set("limit",String(e.limit)),e.reasoningLevel!==void 0&&e.reasoningLevel.trim()!==""&&t.set("reasoningLevel",e.reasoningLevel.trim());let i=t.toString();return n(this.http.get(`${this.baseUrl}/test-results${i?`?${i}`:""}`))}getPrompts(){return n(this.http.get(`${this.baseUrl}/prompts`))}startTestRun(e,t){let i={modelIds:e};return t!==void 0&&t.length>0&&(i.promptIds=t),n(this.http.post(`${this.baseUrl}/test-run`,i))}getTestRunStatus(e){return n(this.http.get(`${this.baseUrl}/test-run/${e}`))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{p as a};
2
+ //# sourceMappingURL=chunk-4YCGUCIE.js.map
@@ -1,2 +1,2 @@
1
- import{e as $}from"./chunk-ACLAVYA7.js";import{I as h,p as S}from"./chunk-ZJ3DCODZ.js";import{C as u,aa as a,h as C,k as m,p as c,xb as y,y as _}from"./chunk-TBMJSIBB.js";var f=C(S());var T=(()=>{class n{baseUrl=`${h.api.baseUrl}/terminals`;http=u(y);getTerminals(){return c(this.http.get(this.baseUrl))}startTerminal(t){return c(this.http.post(`${this.baseUrl}/start`,{path:t.path},{headers:{"Content-Type":"application/json"}}))}runCommand(t,e){return c(this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/command`,{action:e.action,command:e.command,code:e.code},{headers:{"Content-Type":"application/json"}}))}deleteTerminal(t){return c(this.http.delete(`${this.baseUrl}/${encodeURIComponent(t)}`))}closeTerminal(t){return c(this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/close`,{},{headers:{"Content-Type":"application/json"}}))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=_({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var R="terminal:list",A="terminal:list:result",q="terminal:start",b="terminal:start:result",p="terminal:attach",N="terminal:command-result",M="terminal:command-output",k="terminal:command-stdin";function E(n){if(n==null||typeof n!="object")return null;let s=n,t=typeof s.terminalId=="string"?s.terminalId:"";if(!t.trim())return null;let e=s.type,r=e==="exec"||e==="cc-runner"||e==="ca-runner"?e:void 0;return{_id:typeof s._id=="string"?s._id:void 0,terminalId:t.trim(),path:typeof s.path=="string"?s.path:void 0,status:typeof s.status=="string"?s.status:void 0,__created:typeof s.__created=="string"?s.__created:void 0,__lastModified:typeof s.__lastModified=="string"?s.__lastModified:void 0,type:r,sessionId:typeof s.sessionId=="string"?s.sessionId:void 0,command:typeof s.command=="string"?s.command:void 0}}var B=(()=>{class n{terminals_$=a([]);terminalsLoading_$=a(!1);terminalsLoadError_$=a(null);selectedTerminalId_$=a("");commandResults_$=a([]);startLoading_$=a(!1);startError_$=a(null);runCommandLoading_$=a(!1);runCommandError_$=a(null);interactiveRequestId_$=a(null);interactiveOutput_$=a("");eventSubscription=null;terminal_AS=u(T);socket_CS=u($);constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(t=>{if(t.event===A){let r=(Array.isArray(t.payload.terminals)?t.payload.terminals:[]).map(i=>E(i)).filter(i=>i!==null);this.terminals_$.set(r),this.terminalsLoading_$.set(!1),t.payload.error!==void 0&&t.payload.error!==null&&this.terminalsLoadError_$.set(t.payload.error)}else if(t.event===b){if(this.startLoading_$.set(!1),t.payload.error!==void 0&&t.payload.error!==null){this.startError_$.set(t.payload.error);return}this.startError_$.set(null);let e=typeof t.payload.terminalId=="string"?t.payload.terminalId:"",r=typeof t.payload.path=="string"?t.payload.path:"";e&&(this.terminals_$.update(i=>i.some(l=>l.terminalId===e)?i:[{terminalId:e,path:r,status:t.payload.status},...i]),this.selectedTerminalId_$.set(e),this.socket_CS.emit(p,{terminalId:e}),this.commandResults_$.set([]),this.clearInteractiveState())}else if(t.event===N){if((typeof t.payload.terminalId=="string"?t.payload.terminalId:"")!==this.selectedTerminalId_$())return;let r=t.payload.interactive===!0,i=t.payload.interactiveEnd===!0,o=typeof t.payload.exitCode=="number"?t.payload.exitCode:void 0;if(r){let d=typeof t.payload.requestId=="string"?t.payload.requestId:"";this.interactiveRequestId_$.set(d||null),this.interactiveOutput_$.set("");return}if(i){let d=this.interactiveOutput_$();this.interactiveRequestId_$.set(null),this.interactiveOutput_$.set("");let g=o!==void 0?`Session ended. Exit code: ${o}`:"Session ended.";this.commandResults_$.update(I=>[...d.trim().length>0?[...I,{output:d.trim(),success:!0}]:I,{output:g,success:!0,interactiveEnd:!0,exitCode:o}]);return}let l={requestId:typeof t.payload.requestId=="string"?t.payload.requestId:void 0,output:typeof t.payload.output=="string"?t.payload.output:"",success:t.payload.success===!0,error:typeof t.payload.error=="string"?t.payload.error:void 0};this.commandResults_$.update(d=>[...d,l])}else if(t.event===M){let e=typeof t.payload.terminalId=="string"?t.payload.terminalId.trim():"",r=typeof t.payload.requestId=="string"?String(t.payload.requestId).trim():"",i=typeof t.payload.chunk=="string"?t.payload.chunk:"",o=(this.interactiveRequestId_$()??"").trim(),l=(this.selectedTerminalId_$()??"").trim();if(o.length===0||r!==o){h.production||f.DyFM_Log.info("CCAP_Terminal | command-output kisz\u0171rve: requestId mismatch",{requestId:r,currentRequestId:o});return}if(e.length>0&&l.length>0&&e!==l){h.production||f.DyFM_Log.info("CCAP_Terminal | command-output kisz\u0171rve: terminalId mismatch",{terminalId:e,selectedId:l});return}this.interactiveOutput_$.update(d=>d+i)}})}requestTerminalListViaSocket(){this.terminalsLoadError_$.set(null),this.terminalsLoading_$.set(!0),this.socket_CS.emit(R,{})}loadTerminalsRest(){return m(this,null,function*(){this.terminalsLoadError_$.set(null),this.terminalsLoading_$.set(!0);try{let t=yield this.terminal_AS.getTerminals(),r=(Array.isArray(t?.terminals)?t.terminals:[]).map(i=>E(i)).filter(i=>i!==null);this.terminals_$.set(r)}catch(t){this.terminalsLoadError_$.set(t)}finally{this.terminalsLoading_$.set(!1)}})}startTerminalRest(t){return m(this,null,function*(){this.startError_$.set(null),this.startLoading_$.set(!0);try{let e=yield this.terminal_AS.startTerminal(t);this.startError_$.set(null),e.terminalId&&(this.terminals_$.update(r=>r.some(o=>o.terminalId===e.terminalId)?r:[{terminalId:e.terminalId,path:e.path,status:e.status},...r]),this.selectedTerminalId_$.set(e.terminalId),this.socket_CS.emit(p,{terminalId:e.terminalId}),this.commandResults_$.set([]),this.clearInteractiveState())}catch(e){this.startError_$.set(e)}finally{this.startLoading_$.set(!1)}})}startTerminalViaSocket(t){this.startError_$.set(null),this.startLoading_$.set(!0),this.socket_CS.emit(q,{path:t.path})}sendStdin(t){let e=this.selectedTerminalId_$(),r=this.interactiveRequestId_$();!e||!r||this.socket_CS.emit(k,{terminalId:e,requestId:r,data:typeof t=="string"?t:""})}clearInteractiveState(){this.interactiveRequestId_$.set(null),this.interactiveOutput_$.set("")}attachToTerminal(t){this.selectedTerminalId_$.set(t),this.socket_CS.emit(p,{terminalId:t}),this.commandResults_$.set([]),this.clearInteractiveState()}deleteTerminal(t){return m(this,null,function*(){let e=(t??"").trim();if(e){this.runCommandError_$.set(null);try{yield this.terminal_AS.deleteTerminal(e),this.terminals_$.update(r=>r.filter(i=>(i.terminalId??"")!==e)),this.selectedTerminalId_$()===e&&(this.selectedTerminalId_$.set(""),this.clearInteractiveState())}catch(r){this.runCommandError_$.set(r)}}})}closeTerminal(t){return m(this,null,function*(){let e=(t??"").trim();if(e){this.runCommandError_$.set(null);try{yield this.terminal_AS.closeTerminal(e),this.selectedTerminalId_$()===e&&this.clearInteractiveState(),yield this.loadTerminalsRest()}catch(r){this.runCommandError_$.set(r)}}})}runCommand(t){return m(this,null,function*(){let e=this.selectedTerminalId_$();if(!e){this.runCommandError_$.set(new Error("No terminal selected"));return}this.runCommandError_$.set(null),this.runCommandLoading_$.set(!0);try{let r=yield this.terminal_AS.runCommand(e,t);this.runCommandError_$.set(null),r.interactive===!0&&typeof r.requestId=="string"?(this.interactiveRequestId_$.set(r.requestId),this.interactiveOutput_$.set("")):this.commandResults_$.update(i=>[...i,{output:r.output,success:r.success,error:r.error}])}catch(r){this.runCommandError_$.set(r)}finally{this.runCommandLoading_$.set(!1)}})}ngOnDestroy(){this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=_({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();export{B as a};
2
- //# sourceMappingURL=chunk-SYXQFJNU.js.map
1
+ import{e as $}from"./chunk-CSNFLERX.js";import{I as h,p as S}from"./chunk-LGMUHF7N.js";import{C as u,aa as a,h as C,k as m,p as c,xb as y,y as _}from"./chunk-TBMJSIBB.js";var f=C(S());var T=(()=>{class n{baseUrl=`${h.api.baseUrl}/terminals`;http=u(y);getTerminals(){return c(this.http.get(this.baseUrl))}startTerminal(t){return c(this.http.post(`${this.baseUrl}/start`,{path:t.path},{headers:{"Content-Type":"application/json"}}))}runCommand(t,e){return c(this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/command`,{action:e.action,command:e.command,code:e.code},{headers:{"Content-Type":"application/json"}}))}deleteTerminal(t){return c(this.http.delete(`${this.baseUrl}/${encodeURIComponent(t)}`))}closeTerminal(t){return c(this.http.post(`${this.baseUrl}/${encodeURIComponent(t)}/close`,{},{headers:{"Content-Type":"application/json"}}))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=_({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var R="terminal:list",A="terminal:list:result",q="terminal:start",b="terminal:start:result",p="terminal:attach",N="terminal:command-result",M="terminal:command-output",k="terminal:command-stdin";function E(n){if(n==null||typeof n!="object")return null;let s=n,t=typeof s.terminalId=="string"?s.terminalId:"";if(!t.trim())return null;let e=s.type,r=e==="exec"||e==="cc-runner"||e==="ca-runner"?e:void 0;return{_id:typeof s._id=="string"?s._id:void 0,terminalId:t.trim(),path:typeof s.path=="string"?s.path:void 0,status:typeof s.status=="string"?s.status:void 0,__created:typeof s.__created=="string"?s.__created:void 0,__lastModified:typeof s.__lastModified=="string"?s.__lastModified:void 0,type:r,sessionId:typeof s.sessionId=="string"?s.sessionId:void 0,command:typeof s.command=="string"?s.command:void 0}}var B=(()=>{class n{terminals_$=a([]);terminalsLoading_$=a(!1);terminalsLoadError_$=a(null);selectedTerminalId_$=a("");commandResults_$=a([]);startLoading_$=a(!1);startError_$=a(null);runCommandLoading_$=a(!1);runCommandError_$=a(null);interactiveRequestId_$=a(null);interactiveOutput_$=a("");eventSubscription=null;terminal_AS=u(T);socket_CS=u($);constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(t=>{if(t.event===A){let r=(Array.isArray(t.payload.terminals)?t.payload.terminals:[]).map(i=>E(i)).filter(i=>i!==null);this.terminals_$.set(r),this.terminalsLoading_$.set(!1),t.payload.error!==void 0&&t.payload.error!==null&&this.terminalsLoadError_$.set(t.payload.error)}else if(t.event===b){if(this.startLoading_$.set(!1),t.payload.error!==void 0&&t.payload.error!==null){this.startError_$.set(t.payload.error);return}this.startError_$.set(null);let e=typeof t.payload.terminalId=="string"?t.payload.terminalId:"",r=typeof t.payload.path=="string"?t.payload.path:"";e&&(this.terminals_$.update(i=>i.some(l=>l.terminalId===e)?i:[{terminalId:e,path:r,status:t.payload.status},...i]),this.selectedTerminalId_$.set(e),this.socket_CS.emit(p,{terminalId:e}),this.commandResults_$.set([]),this.clearInteractiveState())}else if(t.event===N){if((typeof t.payload.terminalId=="string"?t.payload.terminalId:"")!==this.selectedTerminalId_$())return;let r=t.payload.interactive===!0,i=t.payload.interactiveEnd===!0,o=typeof t.payload.exitCode=="number"?t.payload.exitCode:void 0;if(r){let d=typeof t.payload.requestId=="string"?t.payload.requestId:"";this.interactiveRequestId_$.set(d||null),this.interactiveOutput_$.set("");return}if(i){let d=this.interactiveOutput_$();this.interactiveRequestId_$.set(null),this.interactiveOutput_$.set("");let g=o!==void 0?`Session ended. Exit code: ${o}`:"Session ended.";this.commandResults_$.update(I=>[...d.trim().length>0?[...I,{output:d.trim(),success:!0}]:I,{output:g,success:!0,interactiveEnd:!0,exitCode:o}]);return}let l={requestId:typeof t.payload.requestId=="string"?t.payload.requestId:void 0,output:typeof t.payload.output=="string"?t.payload.output:"",success:t.payload.success===!0,error:typeof t.payload.error=="string"?t.payload.error:void 0};this.commandResults_$.update(d=>[...d,l])}else if(t.event===M){let e=typeof t.payload.terminalId=="string"?t.payload.terminalId.trim():"",r=typeof t.payload.requestId=="string"?String(t.payload.requestId).trim():"",i=typeof t.payload.chunk=="string"?t.payload.chunk:"",o=(this.interactiveRequestId_$()??"").trim(),l=(this.selectedTerminalId_$()??"").trim();if(o.length===0||r!==o){h.production||f.DyFM_Log.info("CCAP_Terminal | command-output kisz\u0171rve: requestId mismatch",{requestId:r,currentRequestId:o});return}if(e.length>0&&l.length>0&&e!==l){h.production||f.DyFM_Log.info("CCAP_Terminal | command-output kisz\u0171rve: terminalId mismatch",{terminalId:e,selectedId:l});return}this.interactiveOutput_$.update(d=>d+i)}})}requestTerminalListViaSocket(){this.terminalsLoadError_$.set(null),this.terminalsLoading_$.set(!0),this.socket_CS.emit(R,{})}loadTerminalsRest(){return m(this,null,function*(){this.terminalsLoadError_$.set(null),this.terminalsLoading_$.set(!0);try{let t=yield this.terminal_AS.getTerminals(),r=(Array.isArray(t?.terminals)?t.terminals:[]).map(i=>E(i)).filter(i=>i!==null);this.terminals_$.set(r)}catch(t){this.terminalsLoadError_$.set(t)}finally{this.terminalsLoading_$.set(!1)}})}startTerminalRest(t){return m(this,null,function*(){this.startError_$.set(null),this.startLoading_$.set(!0);try{let e=yield this.terminal_AS.startTerminal(t);this.startError_$.set(null),e.terminalId&&(this.terminals_$.update(r=>r.some(o=>o.terminalId===e.terminalId)?r:[{terminalId:e.terminalId,path:e.path,status:e.status},...r]),this.selectedTerminalId_$.set(e.terminalId),this.socket_CS.emit(p,{terminalId:e.terminalId}),this.commandResults_$.set([]),this.clearInteractiveState())}catch(e){this.startError_$.set(e)}finally{this.startLoading_$.set(!1)}})}startTerminalViaSocket(t){this.startError_$.set(null),this.startLoading_$.set(!0),this.socket_CS.emit(q,{path:t.path})}sendStdin(t){let e=this.selectedTerminalId_$(),r=this.interactiveRequestId_$();!e||!r||this.socket_CS.emit(k,{terminalId:e,requestId:r,data:typeof t=="string"?t:""})}clearInteractiveState(){this.interactiveRequestId_$.set(null),this.interactiveOutput_$.set("")}attachToTerminal(t){this.selectedTerminalId_$.set(t),this.socket_CS.emit(p,{terminalId:t}),this.commandResults_$.set([]),this.clearInteractiveState()}deleteTerminal(t){return m(this,null,function*(){let e=(t??"").trim();if(e){this.runCommandError_$.set(null);try{yield this.terminal_AS.deleteTerminal(e),this.terminals_$.update(r=>r.filter(i=>(i.terminalId??"")!==e)),this.selectedTerminalId_$()===e&&(this.selectedTerminalId_$.set(""),this.clearInteractiveState())}catch(r){this.runCommandError_$.set(r)}}})}closeTerminal(t){return m(this,null,function*(){let e=(t??"").trim();if(e){this.runCommandError_$.set(null);try{yield this.terminal_AS.closeTerminal(e),this.selectedTerminalId_$()===e&&this.clearInteractiveState(),yield this.loadTerminalsRest()}catch(r){this.runCommandError_$.set(r)}}})}runCommand(t){return m(this,null,function*(){let e=this.selectedTerminalId_$();if(!e){this.runCommandError_$.set(new Error("No terminal selected"));return}this.runCommandError_$.set(null),this.runCommandLoading_$.set(!0);try{let r=yield this.terminal_AS.runCommand(e,t);this.runCommandError_$.set(null),r.interactive===!0&&typeof r.requestId=="string"?(this.interactiveRequestId_$.set(r.requestId),this.interactiveOutput_$.set("")):this.commandResults_$.update(i=>[...i,{output:r.output,success:r.success,error:r.error}])}catch(r){this.runCommandError_$.set(r)}finally{this.runCommandLoading_$.set(!1)}})}ngOnDestroy(){this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=_({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();export{B as a};
2
+ //# sourceMappingURL=chunk-54JIUO7K.js.map