@futdevpro/ccap 1.1.2980 → 1.1.2988

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 (177) hide show
  1. package/client-dist/{agent-instances.module-WFXL2NDE.js → agent-instances.module-EZ3HLJRW.js} +2 -2
  2. package/client-dist/{ca.module-CVTI3AF7.js → ca.module-2NK5JZOQ.js} +2 -2
  3. package/client-dist/{cc-usage-dashboard.component-I2G2NBSY.js → cc-usage-dashboard.component-SLFNE2NX.js} +2 -2
  4. package/client-dist/{cc.module-EXDXYOJ4.js → cc.module-F7LHWQ3A.js} +2 -2
  5. package/client-dist/{chunk-ESPURNI3.js → chunk-2CZLQZAC.js} +2 -2
  6. package/client-dist/{chunk-N26D6SXG.js → chunk-35HAXCRL.js} +2 -2
  7. package/client-dist/{chunk-3HWZLIS3.js → chunk-4JZNUGDT.js} +2 -2
  8. package/client-dist/{chunk-SG5TSGOY.js → chunk-4ORBCWDZ.js} +2 -2
  9. package/client-dist/{chunk-Q2WNI354.js → chunk-565H5Q7X.js} +2 -2
  10. package/client-dist/{chunk-SBPFNYFT.js → chunk-5GCMRTM2.js} +2 -2
  11. package/client-dist/{chunk-WXN5C3BS.js → chunk-66YFYBOC.js} +2 -2
  12. package/client-dist/{chunk-HRSSMQBA.js → chunk-6CNO7CIR.js} +2 -2
  13. package/client-dist/{chunk-7XAV5GIW.js → chunk-6IVNYSN4.js} +2 -2
  14. package/client-dist/{chunk-ZOCMDQAW.js → chunk-6UTINZN6.js} +2 -2
  15. package/client-dist/{chunk-VSGHMHDK.js → chunk-7FDRE6FK.js} +2 -2
  16. package/client-dist/{chunk-FVNI46U2.js → chunk-ACLAVYA7.js} +2 -2
  17. package/client-dist/{chunk-4CXFWMLH.js → chunk-ALRGHRMX.js} +2 -2
  18. package/client-dist/{chunk-AQO5IW5B.js → chunk-CJXAN5QP.js} +2 -2
  19. package/client-dist/{chunk-ORFH2XGX.js → chunk-CK4L2E6A.js} +2 -2
  20. package/client-dist/{chunk-EP3IAFIL.js → chunk-CPOWA47I.js} +2 -2
  21. package/client-dist/{chunk-GH67BJ7J.js → chunk-CROOTWQ4.js} +2 -2
  22. package/client-dist/{chunk-4ANOVQQ6.js → chunk-CZK7PL4V.js} +2 -2
  23. package/client-dist/{chunk-TSGXTLGO.js → chunk-CZVHJQVK.js} +2 -2
  24. package/client-dist/{chunk-N7HJWJ2S.js → chunk-EZQXUBC4.js} +2 -2
  25. package/client-dist/{chunk-4OK5LJEU.js → chunk-HK3NW3BA.js} +2 -2
  26. package/client-dist/{chunk-VHZQSBXM.js → chunk-HKO57F7B.js} +2 -2
  27. package/client-dist/{chunk-GZRNNZID.js → chunk-I24ZZ4G3.js} +2 -2
  28. package/client-dist/{chunk-7EHVTWSO.js → chunk-I5LYGLY6.js} +2 -2
  29. package/client-dist/{chunk-CU2HMFAD.js → chunk-IMV4JDM4.js} +2 -2
  30. package/client-dist/{chunk-C75AJJFP.js → chunk-KOFPH2WQ.js} +2 -2
  31. package/client-dist/{chunk-LBMIDL4S.js → chunk-L2E2MBF2.js} +2 -2
  32. package/client-dist/{chunk-2CUMN334.js → chunk-LNDWBFCV.js} +2 -2
  33. package/client-dist/{chunk-2UXI7P2C.js → chunk-LOUIZXXC.js} +2 -2
  34. package/client-dist/{chunk-DPGBOTN3.js → chunk-LP2E4KMW.js} +2 -2
  35. package/client-dist/{chunk-2VU3GISV.js → chunk-M53FIKSO.js} +2 -2
  36. package/client-dist/{chunk-JGLBYLWW.js → chunk-MIWIPUJL.js} +2 -2
  37. package/client-dist/{chunk-OVD3GSH2.js → chunk-OJPFXL3T.js} +2 -2
  38. package/client-dist/{chunk-EPIK2P4Q.js → chunk-PUVXCR3N.js} +2 -2
  39. package/client-dist/{chunk-VEPJ3MZH.js → chunk-QM4JVUVN.js} +2 -2
  40. package/client-dist/{chunk-KB2F332Z.js → chunk-QYAK3VTE.js} +2 -2
  41. package/client-dist/{chunk-RWQ5B34I.js → chunk-RJEB2CGY.js} +2 -2
  42. package/client-dist/{chunk-AE5VAS75.js → chunk-RQSPYGNE.js} +2 -2
  43. package/client-dist/{chunk-MMFURH5P.js → chunk-RTAONMUA.js} +2 -2
  44. package/client-dist/{chunk-BGNEFOVG.js → chunk-SAWE7K3L.js} +2 -2
  45. package/client-dist/{chunk-RG67NB4W.js → chunk-SIC2VUD2.js} +2 -2
  46. package/client-dist/{chunk-WL7JJ44C.js → chunk-SMBU53NX.js} +2 -2
  47. package/client-dist/{chunk-I4M7XPFX.js → chunk-SUAZOLRE.js} +2 -2
  48. package/client-dist/{chunk-FSUMD4VQ.js → chunk-SYXQFJNU.js} +2 -2
  49. package/client-dist/{chunk-UBUKMZCP.js → chunk-TWUEQMEF.js} +2 -2
  50. package/client-dist/{chunk-RT7QOL2Q.js → chunk-VUMU4S4O.js} +2 -2
  51. package/client-dist/{chunk-AYDRWFG2.js → chunk-W4ICO22C.js} +2 -2
  52. package/client-dist/{chunk-6EPKNTJZ.js → chunk-W66474CE.js} +2 -2
  53. package/client-dist/{chunk-WDSKSHR7.js → chunk-WKXTPGKW.js} +2 -2
  54. package/client-dist/{chunk-RV3A7THL.js → chunk-X3CIXD4W.js} +2 -2
  55. package/client-dist/{chunk-4WGQS2HA.js → chunk-XC26T3JJ.js} +2 -2
  56. package/client-dist/{chunk-UHAAQJ2R.js → chunk-XDP5GOHT.js} +2 -2
  57. package/client-dist/{chunk-4PZ65LDL.js → chunk-XO6LJ5A6.js} +2 -2
  58. package/client-dist/{chunk-PGKNPYIE.js → chunk-ZI46JBHS.js} +2 -2
  59. package/client-dist/{chunk-5N64HGRY.js → chunk-ZJ3DCODZ.js} +2 -2
  60. package/client-dist/{chunk-5N64HGRY.js.map → chunk-ZJ3DCODZ.js.map} +1 -1
  61. package/client-dist/{chunk-PWAWM6DC.js → chunk-ZRLAS63L.js} +2 -2
  62. package/client-dist/{consultant.module-WHGIMF6M.js → consultant.module-ZRSJ2JPM.js} +2 -2
  63. package/client-dist/{crd.module-EH2RIMWD.js → crd.module-TDLM6M2Z.js} +2 -2
  64. package/client-dist/{dashboard.module-EROOHU4C.js → dashboard.module-VSWWQDEU.js} +2 -2
  65. package/client-dist/{do.module-PATPM2KZ.js → do.module-CCOHMJLG.js} +2 -2
  66. package/client-dist/{document-library.module-QBW7XGNT.js → document-library.module-QLZ4ZUUG.js} +2 -2
  67. package/client-dist/{embedding-eval.module-O4YXXNZE.js → embedding-eval.module-6KORAJ7D.js} +2 -2
  68. package/client-dist/{embedding-registry.module-DOWVA6RV.js → embedding-registry.module-GJJ5G2Y7.js} +2 -2
  69. package/client-dist/{err.module-AWN67SP6.js → err.module-4GLVR2GJ.js} +2 -2
  70. package/client-dist/{feedback.module-BWKJCSTU.js → feedback.module-U6CCHRVZ.js} +2 -2
  71. package/client-dist/{host-runtime-mcp.module-24MRZ77I.js → host-runtime-mcp.module-EV5GZKTL.js} +2 -2
  72. package/client-dist/index.html +1 -1
  73. package/client-dist/{live-dev-pipeline.module-T4EERACF.js → live-dev-pipeline.module-MWG23KAS.js} +2 -2
  74. package/client-dist/{logs.module-O4MVHXRP.js → logs.module-YNDMPESQ.js} +2 -2
  75. package/client-dist/{main-NP3NWD3C.js → main-OGUDQHPL.js} +3 -3
  76. package/client-dist/{master-control-remote-poc.module-M6TNRCRQ.js → master-control-remote-poc.module-37OSJYRO.js} +2 -2
  77. package/client-dist/{mobile-app.module-SW2L4EB3.js → mobile-app.module-2DXC7DFY.js} +2 -2
  78. package/client-dist/{model-registry.module-MMEFDY3Y.js → model-registry.module-Z64FRB5O.js} +2 -2
  79. package/client-dist/{oc.module-PVCITNSF.js → oc.module-6SHIJS3R.js} +2 -2
  80. package/client-dist/{orc.module-2S5XXXZI.js → orc.module-NBZZGOV3.js} +2 -2
  81. package/client-dist/{project-management.module-XD6NLN3S.js → project-management.module-TR33UVCV.js} +2 -2
  82. package/client-dist/project-source-routed.module-ZZ7SNTUN.js +2 -0
  83. package/client-dist/{scheduler.module-7YAZ6PYA.js → scheduler.module-M3LHP2DW.js} +2 -2
  84. package/client-dist/{session.module-QNFMZPFT.js → session.module-FIZ5NYKK.js} +2 -2
  85. package/client-dist/{set.module-QLYUFFRH.js → set.module-4E6WAYIQ.js} +2 -2
  86. package/client-dist/{setup.module-HSVFOBYN.js → setup.module-2AUXXLIR.js} +2 -2
  87. package/client-dist/{terminals.module-2NKJL3L6.js → terminals.module-GCGUOFVO.js} +2 -2
  88. package/client-dist/{voice-notes-poc.module-VBWYBFHH.js → voice-notes-poc.module-6LVDT3MA.js} +2 -2
  89. package/client-dist/{wfs.module-2ZF3S6F2.js → wfs.module-XQGZNMEP.js} +2 -2
  90. package/package.json +1 -1
  91. package/client-dist/project-source-routed.module-ZBU2T4Q5.js +0 -2
  92. /package/client-dist/{agent-instances.module-WFXL2NDE.js.map → agent-instances.module-EZ3HLJRW.js.map} +0 -0
  93. /package/client-dist/{ca.module-CVTI3AF7.js.map → ca.module-2NK5JZOQ.js.map} +0 -0
  94. /package/client-dist/{cc-usage-dashboard.component-I2G2NBSY.js.map → cc-usage-dashboard.component-SLFNE2NX.js.map} +0 -0
  95. /package/client-dist/{cc.module-EXDXYOJ4.js.map → cc.module-F7LHWQ3A.js.map} +0 -0
  96. /package/client-dist/{chunk-ESPURNI3.js.map → chunk-2CZLQZAC.js.map} +0 -0
  97. /package/client-dist/{chunk-N26D6SXG.js.map → chunk-35HAXCRL.js.map} +0 -0
  98. /package/client-dist/{chunk-3HWZLIS3.js.map → chunk-4JZNUGDT.js.map} +0 -0
  99. /package/client-dist/{chunk-SG5TSGOY.js.map → chunk-4ORBCWDZ.js.map} +0 -0
  100. /package/client-dist/{chunk-Q2WNI354.js.map → chunk-565H5Q7X.js.map} +0 -0
  101. /package/client-dist/{chunk-SBPFNYFT.js.map → chunk-5GCMRTM2.js.map} +0 -0
  102. /package/client-dist/{chunk-WXN5C3BS.js.map → chunk-66YFYBOC.js.map} +0 -0
  103. /package/client-dist/{chunk-HRSSMQBA.js.map → chunk-6CNO7CIR.js.map} +0 -0
  104. /package/client-dist/{chunk-7XAV5GIW.js.map → chunk-6IVNYSN4.js.map} +0 -0
  105. /package/client-dist/{chunk-ZOCMDQAW.js.map → chunk-6UTINZN6.js.map} +0 -0
  106. /package/client-dist/{chunk-VSGHMHDK.js.map → chunk-7FDRE6FK.js.map} +0 -0
  107. /package/client-dist/{chunk-FVNI46U2.js.map → chunk-ACLAVYA7.js.map} +0 -0
  108. /package/client-dist/{chunk-4CXFWMLH.js.map → chunk-ALRGHRMX.js.map} +0 -0
  109. /package/client-dist/{chunk-AQO5IW5B.js.map → chunk-CJXAN5QP.js.map} +0 -0
  110. /package/client-dist/{chunk-ORFH2XGX.js.map → chunk-CK4L2E6A.js.map} +0 -0
  111. /package/client-dist/{chunk-EP3IAFIL.js.map → chunk-CPOWA47I.js.map} +0 -0
  112. /package/client-dist/{chunk-GH67BJ7J.js.map → chunk-CROOTWQ4.js.map} +0 -0
  113. /package/client-dist/{chunk-4ANOVQQ6.js.map → chunk-CZK7PL4V.js.map} +0 -0
  114. /package/client-dist/{chunk-TSGXTLGO.js.map → chunk-CZVHJQVK.js.map} +0 -0
  115. /package/client-dist/{chunk-N7HJWJ2S.js.map → chunk-EZQXUBC4.js.map} +0 -0
  116. /package/client-dist/{chunk-4OK5LJEU.js.map → chunk-HK3NW3BA.js.map} +0 -0
  117. /package/client-dist/{chunk-VHZQSBXM.js.map → chunk-HKO57F7B.js.map} +0 -0
  118. /package/client-dist/{chunk-GZRNNZID.js.map → chunk-I24ZZ4G3.js.map} +0 -0
  119. /package/client-dist/{chunk-7EHVTWSO.js.map → chunk-I5LYGLY6.js.map} +0 -0
  120. /package/client-dist/{chunk-CU2HMFAD.js.map → chunk-IMV4JDM4.js.map} +0 -0
  121. /package/client-dist/{chunk-C75AJJFP.js.map → chunk-KOFPH2WQ.js.map} +0 -0
  122. /package/client-dist/{chunk-LBMIDL4S.js.map → chunk-L2E2MBF2.js.map} +0 -0
  123. /package/client-dist/{chunk-2CUMN334.js.map → chunk-LNDWBFCV.js.map} +0 -0
  124. /package/client-dist/{chunk-2UXI7P2C.js.map → chunk-LOUIZXXC.js.map} +0 -0
  125. /package/client-dist/{chunk-DPGBOTN3.js.map → chunk-LP2E4KMW.js.map} +0 -0
  126. /package/client-dist/{chunk-2VU3GISV.js.map → chunk-M53FIKSO.js.map} +0 -0
  127. /package/client-dist/{chunk-JGLBYLWW.js.map → chunk-MIWIPUJL.js.map} +0 -0
  128. /package/client-dist/{chunk-OVD3GSH2.js.map → chunk-OJPFXL3T.js.map} +0 -0
  129. /package/client-dist/{chunk-EPIK2P4Q.js.map → chunk-PUVXCR3N.js.map} +0 -0
  130. /package/client-dist/{chunk-VEPJ3MZH.js.map → chunk-QM4JVUVN.js.map} +0 -0
  131. /package/client-dist/{chunk-KB2F332Z.js.map → chunk-QYAK3VTE.js.map} +0 -0
  132. /package/client-dist/{chunk-RWQ5B34I.js.map → chunk-RJEB2CGY.js.map} +0 -0
  133. /package/client-dist/{chunk-AE5VAS75.js.map → chunk-RQSPYGNE.js.map} +0 -0
  134. /package/client-dist/{chunk-MMFURH5P.js.map → chunk-RTAONMUA.js.map} +0 -0
  135. /package/client-dist/{chunk-BGNEFOVG.js.map → chunk-SAWE7K3L.js.map} +0 -0
  136. /package/client-dist/{chunk-RG67NB4W.js.map → chunk-SIC2VUD2.js.map} +0 -0
  137. /package/client-dist/{chunk-WL7JJ44C.js.map → chunk-SMBU53NX.js.map} +0 -0
  138. /package/client-dist/{chunk-I4M7XPFX.js.map → chunk-SUAZOLRE.js.map} +0 -0
  139. /package/client-dist/{chunk-FSUMD4VQ.js.map → chunk-SYXQFJNU.js.map} +0 -0
  140. /package/client-dist/{chunk-UBUKMZCP.js.map → chunk-TWUEQMEF.js.map} +0 -0
  141. /package/client-dist/{chunk-RT7QOL2Q.js.map → chunk-VUMU4S4O.js.map} +0 -0
  142. /package/client-dist/{chunk-AYDRWFG2.js.map → chunk-W4ICO22C.js.map} +0 -0
  143. /package/client-dist/{chunk-6EPKNTJZ.js.map → chunk-W66474CE.js.map} +0 -0
  144. /package/client-dist/{chunk-WDSKSHR7.js.map → chunk-WKXTPGKW.js.map} +0 -0
  145. /package/client-dist/{chunk-RV3A7THL.js.map → chunk-X3CIXD4W.js.map} +0 -0
  146. /package/client-dist/{chunk-4WGQS2HA.js.map → chunk-XC26T3JJ.js.map} +0 -0
  147. /package/client-dist/{chunk-UHAAQJ2R.js.map → chunk-XDP5GOHT.js.map} +0 -0
  148. /package/client-dist/{chunk-4PZ65LDL.js.map → chunk-XO6LJ5A6.js.map} +0 -0
  149. /package/client-dist/{chunk-PGKNPYIE.js.map → chunk-ZI46JBHS.js.map} +0 -0
  150. /package/client-dist/{chunk-PWAWM6DC.js.map → chunk-ZRLAS63L.js.map} +0 -0
  151. /package/client-dist/{consultant.module-WHGIMF6M.js.map → consultant.module-ZRSJ2JPM.js.map} +0 -0
  152. /package/client-dist/{crd.module-EH2RIMWD.js.map → crd.module-TDLM6M2Z.js.map} +0 -0
  153. /package/client-dist/{dashboard.module-EROOHU4C.js.map → dashboard.module-VSWWQDEU.js.map} +0 -0
  154. /package/client-dist/{do.module-PATPM2KZ.js.map → do.module-CCOHMJLG.js.map} +0 -0
  155. /package/client-dist/{document-library.module-QBW7XGNT.js.map → document-library.module-QLZ4ZUUG.js.map} +0 -0
  156. /package/client-dist/{embedding-eval.module-O4YXXNZE.js.map → embedding-eval.module-6KORAJ7D.js.map} +0 -0
  157. /package/client-dist/{embedding-registry.module-DOWVA6RV.js.map → embedding-registry.module-GJJ5G2Y7.js.map} +0 -0
  158. /package/client-dist/{err.module-AWN67SP6.js.map → err.module-4GLVR2GJ.js.map} +0 -0
  159. /package/client-dist/{feedback.module-BWKJCSTU.js.map → feedback.module-U6CCHRVZ.js.map} +0 -0
  160. /package/client-dist/{host-runtime-mcp.module-24MRZ77I.js.map → host-runtime-mcp.module-EV5GZKTL.js.map} +0 -0
  161. /package/client-dist/{live-dev-pipeline.module-T4EERACF.js.map → live-dev-pipeline.module-MWG23KAS.js.map} +0 -0
  162. /package/client-dist/{logs.module-O4MVHXRP.js.map → logs.module-YNDMPESQ.js.map} +0 -0
  163. /package/client-dist/{main-NP3NWD3C.js.map → main-OGUDQHPL.js.map} +0 -0
  164. /package/client-dist/{master-control-remote-poc.module-M6TNRCRQ.js.map → master-control-remote-poc.module-37OSJYRO.js.map} +0 -0
  165. /package/client-dist/{mobile-app.module-SW2L4EB3.js.map → mobile-app.module-2DXC7DFY.js.map} +0 -0
  166. /package/client-dist/{model-registry.module-MMEFDY3Y.js.map → model-registry.module-Z64FRB5O.js.map} +0 -0
  167. /package/client-dist/{oc.module-PVCITNSF.js.map → oc.module-6SHIJS3R.js.map} +0 -0
  168. /package/client-dist/{orc.module-2S5XXXZI.js.map → orc.module-NBZZGOV3.js.map} +0 -0
  169. /package/client-dist/{project-management.module-XD6NLN3S.js.map → project-management.module-TR33UVCV.js.map} +0 -0
  170. /package/client-dist/{project-source-routed.module-ZBU2T4Q5.js.map → project-source-routed.module-ZZ7SNTUN.js.map} +0 -0
  171. /package/client-dist/{scheduler.module-7YAZ6PYA.js.map → scheduler.module-M3LHP2DW.js.map} +0 -0
  172. /package/client-dist/{session.module-QNFMZPFT.js.map → session.module-FIZ5NYKK.js.map} +0 -0
  173. /package/client-dist/{set.module-QLYUFFRH.js.map → set.module-4E6WAYIQ.js.map} +0 -0
  174. /package/client-dist/{setup.module-HSVFOBYN.js.map → setup.module-2AUXXLIR.js.map} +0 -0
  175. /package/client-dist/{terminals.module-2NKJL3L6.js.map → terminals.module-GCGUOFVO.js.map} +0 -0
  176. /package/client-dist/{voice-notes-poc.module-VBWYBFHH.js.map → voice-notes-poc.module-6LVDT3MA.js.map} +0 -0
  177. /package/client-dist/{wfs.module-2ZF3S6F2.js.map → wfs.module-XQGZNMEP.js.map} +0 -0
@@ -1,8 +1,8 @@
1
- import{a as O}from"./chunk-4CXFWMLH.js";import{a as q}from"./chunk-2VU3GISV.js";import{d as F}from"./chunk-4WGQS2HA.js";import{e as D}from"./chunk-FVNI46U2.js";import{h as A,j as k}from"./chunk-WXN5C3BS.js";import{I as R,p as j}from"./chunk-5N64HGRY.js";import{C as I,R as P,a as S,aa as m,b,h as U,k as f,p as y,vb as g,xb as K,y as w}from"./chunk-TBMJSIBB.js";var C=class{static compareMirrorEventsAsc(n,e){let t=(n.sequence??0)-(e.sequence??0);if(t!==0)return t;let s=typeof n.timestamp=="string"?n.timestamp:"",o=typeof e.timestamp=="string"?e.timestamp:"",i=s.localeCompare(o);if(i!==0)return i;let r=typeof n.eventType=="string"?n.eventType:"",a=typeof e.eventType=="string"?e.eventType:"";return r.localeCompare(a)}};var v=class c{static messageIdsCompatibleForStreamMerge(n,e){let t=(n??"").trim(),s=(e??"").trim();return t.length>0&&s.length>0?t===s:!0}static parseStreamChunkFromMirrorData(n){let e=n.update;if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=c.toPlainRecord(e),s=t.sessionUpdate,o=null;if(s==="agent_message_chunk"&&(o="agent"),s==="user_message_chunk"&&(o="user"),s==="agent_thought_chunk"&&(o="thought"),o===null)return null;let i=t.content;if(i===null||typeof i!="object"||Array.isArray(i))return null;let a=c.toPlainRecord(i).text;if(typeof a!="string"||!a.length)return null;let l=t.messageId,d=typeof l=="string"&&l.length>0?l:void 0;return{role:o,text:a,messageId:d}}static canMergeConsoleTailWithChunk(n){let e=n.prev;if(e.streamTextRole===void 0||e.streamTextRole!==n.parsed.role)return!1;let t=e.streamMessageId,s=n.parsed.messageId;if(!c.messageIdsCompatibleForStreamMerge(t,s))return!1;let o=n.ev.sequence??0,i=e.streamLastSequence??0;return!(o<=i)}static canMergeMirrorChunkEvents(n,e,t){let s=c.parseStreamChunkFromMirrorData(n.data??{});if(s===null||s.role!==t.role)return!1;let o=s.messageId,i=t.messageId;if(!c.messageIdsCompatibleForStreamMerge(o,i))return!1;let r=n.sequence??0;return!((e.sequence??0)<=r)}static foldEventsToTimelineRows(n){let e=[];for(let t of n){let s=c.parseStreamChunkFromMirrorData(t.data??{});if(s!==null){let o=e.length>0?e[e.length-1]:void 0,i=o!==void 0&&o.events.length>0?o.events[o.events.length-1]:void 0;if(o!==void 0&&i!==void 0&&c.canMergeMirrorChunkEvents(i,t,s)){let r=[...o.events,t];e[e.length-1]={rowKey:c.mergedTimelineRowKey(r),events:r}}else e.push({rowKey:`evt-${String(t.sequence??0)}`,events:[t]})}else e.push({rowKey:`evt-${String(t.sequence??0)}`,events:[t]})}return e}static mergedTimelineRowKey(n){if(!n.length)return"evt-empty";let e=n[0].sequence??0,t=n[n.length-1].sequence??0;return`merged-chunk-${String(e)}-${String(t)}`}static toPlainRecord(n){let e={};for(let t of Object.keys(n))e[t]=Reflect.get(n,t);return e}};var M=U(j());var x=class c{static prettyStringifyUnknown(n){try{let e=c.expandEmbeddedJsonStrings(n);return JSON.stringify(e,null,2)}catch{return n==null?String(n):typeof n=="object"?"[Object stringify failed]":String(n)}}static expandEmbeddedJsonStrings(n){if(n==null)return n;if(typeof n=="string"){let t=n;if(!F.looksLikeJson(t))return t;try{let s=JSON.parse(t.trim());return c.expandEmbeddedJsonStrings(s)}catch{return t}}if(typeof n!="object")return n;if(Array.isArray(n))return n.map(t=>c.expandEmbeddedJsonStrings(t));let e={};for(let t of Object.keys(n)){let s=Reflect.get(n,t);e[t]=c.expandEmbeddedJsonStrings(s)}return e}};var T=class c{static buildFromMirrorEvent(n){let e=n.sequence??0,t=n.data!==void 0?n.data:{},s=typeof n.eventType=="string"?n.eventType:"";return s==="prompt-sent"?c.buildPromptSentBrief(e,t):s==="ca-session-update"?c.buildCaSessionUpdateBrief(e,t):c.buildGenericBrief(s,e,t)}static extractSessionUpdateKind(n){let e=n.update;if(e===null||typeof e!="object"||Array.isArray(e))return;let s=c.toPlainRecord(e).sessionUpdate;return typeof s=="string"&&s.length?s:void 0}static buildPromptSentBrief(n,e){let t=e.content;return typeof t!="string"||!t.length?null:{listKey:`mirror-prompt-${String(n)}`,consoleType:"prompt",bodyText:t,mirrorEventType:"prompt-sent",useRawBubbleKind:!1,rawData:e}}static buildCaSessionUpdateBrief(n,e){let t=v.parseStreamChunkFromMirrorData(e);if(t!==null){let o=c.extractSessionUpdateKind(e),i=t.role==="thought";return{listKey:`mirror-chunk-${String(n)}`,consoleType:i?"thinking":"assistant",bodyText:t.text,mirrorEventType:"ca-session-update",briefSubtype:o,useRawBubbleKind:!1,rawData:e,isStreamingTextChunk:!0,streamTextRole:t.role,streamMessageId:t.messageId}}let s=x.prettyStringifyUnknown(e);return{listKey:`mirror-ca-session-update-${String(n)}`,consoleType:"info",bodyText:s,mirrorEventType:"ca-session-update",useRawBubbleKind:!0,rawData:e}}static buildGenericBrief(n,e,t){let s=c.safeListKeySegment(n),o={eventType:n.length?n:"unknown",sequence:e,data:t},i=x.prettyStringifyUnknown(o);return{listKey:`mirror-${s}-${String(e)}`,consoleType:"info",bodyText:i,mirrorEventType:n.length?n:"unknown",useRawBubbleKind:!0,rawData:t}}static safeListKeySegment(n){let e=n.replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/^_+|_+$/g,"");return e.length?e:"event"}static toPlainRecord(n){let e={};for(let t of Object.keys(n))e[t]=Reflect.get(n,t);return e}};var u=class c{static listKeyStart(n){return`ca-tc-${n}-start`}static listKeyProgress(n){return`ca-tc-${n}-progress`}static listKeyResult(n){return`ca-tc-${n}-result`}static listKeyError(n){return`ca-tc-${n}-error`}static tryParseStableListKey(n){let e="ca-tc-";if(!n.startsWith(e))return null;let t=[{suffix:"-progress",role:"progress"},{suffix:"-start",role:"start"},{suffix:"-result",role:"result"},{suffix:"-error",role:"error"}];for(let s of t){if(!n.endsWith(s.suffix))continue;let o=n.slice(e.length,n.length-s.suffix.length);return o.length?{toolCallId:o,role:s.role}:null}return null}static tryParseMirrorData(n){let e=n.update;if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=c.toPlainRecord(e),s=t.sessionUpdate;if(s!=="tool_call"&&s!=="tool_call_update")return null;let o=t.toolCallId;if(typeof o!="string"||!o.trim().length)return null;let i=t.status,r=typeof i=="string"?i:"",a=t.title,l=typeof a=="string"&&a.trim().length?a.trim():void 0,d=t.kind,h=typeof d=="string"&&d.trim().length?d.trim():void 0,p=t.rawOutput,E=t.rawInput,_=t.content,$=t.locations;return{sessionUpdate:s,toolCallId:o.trim(),status:r,title:l,toolKind:h,rawOutput:p!==void 0?p:void 0,rawInput:E!==void 0?E:void 0,content:Array.isArray(_)&&_.length?_:void 0,locations:Array.isArray($)&&$.length?$:void 0}}static hasRawOutputError(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;let e=c.toPlainRecord(n);return Object.prototype.hasOwnProperty.call(e,"error")}static summarizeRawOutputError(n){if(n===null||typeof n!="object"||Array.isArray(n))return"Tool call failed";let t=c.toPlainRecord(n).error;if(typeof t=="string"&&t.trim().length)return t.trim();try{return JSON.stringify(n)}catch{return"Tool call failed"}}static summarizeRawOutputSuccess(n){if(n===void 0)return"Completed";try{let e=JSON.stringify(n),t=400;return e.length>t?`${e.substring(0,t)}\u2026`:e}catch{return"Completed"}}static formatRawInput(n){if(n==null)return"";try{return JSON.stringify(n,null,2)}catch{return String(n)}}static formatLocations(n){if(!n?.length)return"";let e=[];for(let t of n){if(t===null||typeof t!="object"||Array.isArray(t))continue;let s=c.toPlainRecord(t),o=s.path;if(typeof o!="string"||!o.length)continue;let i=s.line,r=typeof i=="number"?`:${i}`:"";e.push(`${o}${r}`)}return e.join(`
1
+ import{a as O}from"./chunk-ALRGHRMX.js";import{a as q}from"./chunk-M53FIKSO.js";import{d as F}from"./chunk-XC26T3JJ.js";import{e as D}from"./chunk-ACLAVYA7.js";import{h as A,j as k}from"./chunk-66YFYBOC.js";import{I as R,p as j}from"./chunk-ZJ3DCODZ.js";import{C as I,R as P,a as S,aa as m,b,h as U,k as f,p as y,vb as g,xb as K,y as w}from"./chunk-TBMJSIBB.js";var C=class{static compareMirrorEventsAsc(n,e){let t=(n.sequence??0)-(e.sequence??0);if(t!==0)return t;let s=typeof n.timestamp=="string"?n.timestamp:"",o=typeof e.timestamp=="string"?e.timestamp:"",i=s.localeCompare(o);if(i!==0)return i;let r=typeof n.eventType=="string"?n.eventType:"",a=typeof e.eventType=="string"?e.eventType:"";return r.localeCompare(a)}};var v=class c{static messageIdsCompatibleForStreamMerge(n,e){let t=(n??"").trim(),s=(e??"").trim();return t.length>0&&s.length>0?t===s:!0}static parseStreamChunkFromMirrorData(n){let e=n.update;if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=c.toPlainRecord(e),s=t.sessionUpdate,o=null;if(s==="agent_message_chunk"&&(o="agent"),s==="user_message_chunk"&&(o="user"),s==="agent_thought_chunk"&&(o="thought"),o===null)return null;let i=t.content;if(i===null||typeof i!="object"||Array.isArray(i))return null;let a=c.toPlainRecord(i).text;if(typeof a!="string"||!a.length)return null;let l=t.messageId,d=typeof l=="string"&&l.length>0?l:void 0;return{role:o,text:a,messageId:d}}static canMergeConsoleTailWithChunk(n){let e=n.prev;if(e.streamTextRole===void 0||e.streamTextRole!==n.parsed.role)return!1;let t=e.streamMessageId,s=n.parsed.messageId;if(!c.messageIdsCompatibleForStreamMerge(t,s))return!1;let o=n.ev.sequence??0,i=e.streamLastSequence??0;return!(o<=i)}static canMergeMirrorChunkEvents(n,e,t){let s=c.parseStreamChunkFromMirrorData(n.data??{});if(s===null||s.role!==t.role)return!1;let o=s.messageId,i=t.messageId;if(!c.messageIdsCompatibleForStreamMerge(o,i))return!1;let r=n.sequence??0;return!((e.sequence??0)<=r)}static foldEventsToTimelineRows(n){let e=[];for(let t of n){let s=c.parseStreamChunkFromMirrorData(t.data??{});if(s!==null){let o=e.length>0?e[e.length-1]:void 0,i=o!==void 0&&o.events.length>0?o.events[o.events.length-1]:void 0;if(o!==void 0&&i!==void 0&&c.canMergeMirrorChunkEvents(i,t,s)){let r=[...o.events,t];e[e.length-1]={rowKey:c.mergedTimelineRowKey(r),events:r}}else e.push({rowKey:`evt-${String(t.sequence??0)}`,events:[t]})}else e.push({rowKey:`evt-${String(t.sequence??0)}`,events:[t]})}return e}static mergedTimelineRowKey(n){if(!n.length)return"evt-empty";let e=n[0].sequence??0,t=n[n.length-1].sequence??0;return`merged-chunk-${String(e)}-${String(t)}`}static toPlainRecord(n){let e={};for(let t of Object.keys(n))e[t]=Reflect.get(n,t);return e}};var M=U(j());var x=class c{static prettyStringifyUnknown(n){try{let e=c.expandEmbeddedJsonStrings(n);return JSON.stringify(e,null,2)}catch{return n==null?String(n):typeof n=="object"?"[Object stringify failed]":String(n)}}static expandEmbeddedJsonStrings(n){if(n==null)return n;if(typeof n=="string"){let t=n;if(!F.looksLikeJson(t))return t;try{let s=JSON.parse(t.trim());return c.expandEmbeddedJsonStrings(s)}catch{return t}}if(typeof n!="object")return n;if(Array.isArray(n))return n.map(t=>c.expandEmbeddedJsonStrings(t));let e={};for(let t of Object.keys(n)){let s=Reflect.get(n,t);e[t]=c.expandEmbeddedJsonStrings(s)}return e}};var T=class c{static buildFromMirrorEvent(n){let e=n.sequence??0,t=n.data!==void 0?n.data:{},s=typeof n.eventType=="string"?n.eventType:"";return s==="prompt-sent"?c.buildPromptSentBrief(e,t):s==="ca-session-update"?c.buildCaSessionUpdateBrief(e,t):c.buildGenericBrief(s,e,t)}static extractSessionUpdateKind(n){let e=n.update;if(e===null||typeof e!="object"||Array.isArray(e))return;let s=c.toPlainRecord(e).sessionUpdate;return typeof s=="string"&&s.length?s:void 0}static buildPromptSentBrief(n,e){let t=e.content;return typeof t!="string"||!t.length?null:{listKey:`mirror-prompt-${String(n)}`,consoleType:"prompt",bodyText:t,mirrorEventType:"prompt-sent",useRawBubbleKind:!1,rawData:e}}static buildCaSessionUpdateBrief(n,e){let t=v.parseStreamChunkFromMirrorData(e);if(t!==null){let o=c.extractSessionUpdateKind(e),i=t.role==="thought";return{listKey:`mirror-chunk-${String(n)}`,consoleType:i?"thinking":"assistant",bodyText:t.text,mirrorEventType:"ca-session-update",briefSubtype:o,useRawBubbleKind:!1,rawData:e,isStreamingTextChunk:!0,streamTextRole:t.role,streamMessageId:t.messageId}}let s=x.prettyStringifyUnknown(e);return{listKey:`mirror-ca-session-update-${String(n)}`,consoleType:"info",bodyText:s,mirrorEventType:"ca-session-update",useRawBubbleKind:!0,rawData:e}}static buildGenericBrief(n,e,t){let s=c.safeListKeySegment(n),o={eventType:n.length?n:"unknown",sequence:e,data:t},i=x.prettyStringifyUnknown(o);return{listKey:`mirror-${s}-${String(e)}`,consoleType:"info",bodyText:i,mirrorEventType:n.length?n:"unknown",useRawBubbleKind:!0,rawData:t}}static safeListKeySegment(n){let e=n.replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/^_+|_+$/g,"");return e.length?e:"event"}static toPlainRecord(n){let e={};for(let t of Object.keys(n))e[t]=Reflect.get(n,t);return e}};var u=class c{static listKeyStart(n){return`ca-tc-${n}-start`}static listKeyProgress(n){return`ca-tc-${n}-progress`}static listKeyResult(n){return`ca-tc-${n}-result`}static listKeyError(n){return`ca-tc-${n}-error`}static tryParseStableListKey(n){let e="ca-tc-";if(!n.startsWith(e))return null;let t=[{suffix:"-progress",role:"progress"},{suffix:"-start",role:"start"},{suffix:"-result",role:"result"},{suffix:"-error",role:"error"}];for(let s of t){if(!n.endsWith(s.suffix))continue;let o=n.slice(e.length,n.length-s.suffix.length);return o.length?{toolCallId:o,role:s.role}:null}return null}static tryParseMirrorData(n){let e=n.update;if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=c.toPlainRecord(e),s=t.sessionUpdate;if(s!=="tool_call"&&s!=="tool_call_update")return null;let o=t.toolCallId;if(typeof o!="string"||!o.trim().length)return null;let i=t.status,r=typeof i=="string"?i:"",a=t.title,l=typeof a=="string"&&a.trim().length?a.trim():void 0,d=t.kind,h=typeof d=="string"&&d.trim().length?d.trim():void 0,p=t.rawOutput,E=t.rawInput,_=t.content,$=t.locations;return{sessionUpdate:s,toolCallId:o.trim(),status:r,title:l,toolKind:h,rawOutput:p!==void 0?p:void 0,rawInput:E!==void 0?E:void 0,content:Array.isArray(_)&&_.length?_:void 0,locations:Array.isArray($)&&$.length?$:void 0}}static hasRawOutputError(n){if(n===null||typeof n!="object"||Array.isArray(n))return!1;let e=c.toPlainRecord(n);return Object.prototype.hasOwnProperty.call(e,"error")}static summarizeRawOutputError(n){if(n===null||typeof n!="object"||Array.isArray(n))return"Tool call failed";let t=c.toPlainRecord(n).error;if(typeof t=="string"&&t.trim().length)return t.trim();try{return JSON.stringify(n)}catch{return"Tool call failed"}}static summarizeRawOutputSuccess(n){if(n===void 0)return"Completed";try{let e=JSON.stringify(n),t=400;return e.length>t?`${e.substring(0,t)}\u2026`:e}catch{return"Completed"}}static formatRawInput(n){if(n==null)return"";try{return JSON.stringify(n,null,2)}catch{return String(n)}}static formatLocations(n){if(!n?.length)return"";let e=[];for(let t of n){if(t===null||typeof t!="object"||Array.isArray(t))continue;let s=c.toPlainRecord(t),o=s.path;if(typeof o!="string"||!o.length)continue;let i=s.line,r=typeof i=="number"?`:${i}`:"";e.push(`${o}${r}`)}return e.join(`
2
2
  `)}static formatContent(n){if(!n?.length)return"";let e=[];for(let t of n){if(t===null||typeof t!="object"||Array.isArray(t))continue;let s=c.toPlainRecord(t),o=s.type;if(o==="diff"){let i=s.path,r=s.oldText,a=s.newText,d=[`--- ${typeof i=="string"?i:"(unknown)"}`];typeof r=="string"&&r.length&&d.push(`- ${r.substring(0,500)}${r.length>500?"\u2026":""}`),typeof a=="string"&&a.length&&d.push(`+ ${a.substring(0,500)}${a.length>500?"\u2026":""}`),e.push(d.join(`
3
3
  `))}else if(o==="terminal")try{e.push(`[terminal] ${JSON.stringify(s,null,2)}`)}catch{e.push("[terminal output]")}else if(o==="content"){let i=s.parts;if(Array.isArray(i)){for(let r of i)if(r!==null&&typeof r=="object"&&!Array.isArray(r)){let a=c.toPlainRecord(r);typeof a.text=="string"&&e.push(a.text)}}}}return e.join(`
4
4
 
5
5
  `)}static toPlainRecord(n){let e={};for(let t of Object.keys(n))e[t]=Reflect.get(n,t);return e}};var L=(()=>{class c{baseUrl=`${R.api.baseUrl}/ca-session`;http=I(K);peiContext_DS=I(q);withCcapId(e){let t=this.peiContext_DS.activeCcapId_$();return t?e.set("ccapId",t):e}createSession(e){let t=this.withCcapId(new g);return y(this.http.post(this.baseUrl,e,{params:t}))}listSessions(e){let t=this.withCcapId(new g);return e?.status&&(t=t.set("status",e.status)),e?.workspacePath&&(t=t.set("workspacePath",e.workspacePath)),e?.includeArchived&&(t=t.set("includeArchived","1")),y(this.http.get(this.baseUrl,{params:t}))}syncFromAgent(e){let t=this.withCcapId(new g);return y(this.http.post(`${this.baseUrl}/sync`,{cwd:e?.cwd},{params:t}))}getSession(e){let t=this.withCcapId(new g);return y(this.http.get(`${this.baseUrl}/${e}`,{params:t}))}sendPrompt(e){let t=this.withCcapId(new g);return y(this.http.post(`${this.baseUrl}/${e.sessionId}/prompt`,{content:e.content},{params:t}))}stopExecution(e){let t=this.withCcapId(new g);return y(this.http.post(`${this.baseUrl}/${e}/stop-execution`,{},{params:t}))}terminateSession(e){let t=this.withCcapId(new g);return y(this.http.post(`${this.baseUrl}/${e}/terminate`,{},{params:t}))}setSessionArchived(e){let t=this.withCcapId(new g);return y(this.http.patch(`${this.baseUrl}/${e.sessionId}/archive`,{isArchived:e.isArchived},{params:t}))}getSessionEvents(e){let t=this.withCcapId(new g);return e.sinceSequence!=null&&(t=t.set("sinceSequence",String(e.sinceSequence))),e.limit!=null&&(t=t.set("limit",String(e.limit))),y(this.http.get(`${this.baseUrl}/${e.sessionId}/events`,{params:t}))}hydrateSession(e){return y(this.http.post(`${this.baseUrl}/${e.sessionId}/hydrate`,{force:e.force===!0},{params:this.withCcapId(new g)}))}static \u0275fac=function(t){return new(t||c)};static \u0275prov=w({token:c,factory:c.\u0275fac,providedIn:"root"})}return c})();var fe=(()=>{class c{sessions_$=m([]);sessionsLoading_$=m(!1);sessionsLoadError_$=m(null);selectedSession_$=m(null);selectedSessionLoading_$=m(!1);selectedSessionEvents_$=m([]);sessionEventsHasMore_$=m(!1);mirrorRuntime_$=m(null);consoleMessages_$=m([]);assembledMessages_$=m([]);lastStatusUpdate_$=m(null);activeSessionId_$=m("");sessionDetailError_$=m(null);caSession_AS=I(L);extSessionMsg_AS=I(O);globalError_CS=I(k);socket_CS=I(D);ngZone=I(P);eventSubscription=null;reconnectSubscription=null;lastKnownEventSequence=-1;openSessionPollTimer=null;openSessionPollTargetId="";pendingOptimisticPrompts=[];sessionEventsNextSince=null;constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(e=>{this.handleSocketEvent(e)}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(e=>{if(e){let t=this.activeSessionId_$();t&&(this.socket_CS.emit("ca-session:subscribe",{sessionId:t}),this.loadAssembledMessages({sessionId:t}).catch(()=>{}))}})}ngOnDestroy(){this.stopOpenSessionPolling(),this.eventSubscription?.unsubscribe(),this.reconnectSubscription?.unsubscribe()}loadSessions(e){return f(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let t=yield this.caSession_AS.listSessions({includeArchived:e?.includeArchived}),s=t.sessions,i=(Array.isArray(s)?s:[]).map(E=>this.mapSessionRecord(this.toRecord(E)));this.sessions_$.set(i);let r=t.mirrorRuntime,a=this.toRecord(r),l=a.isAcpConnected,d=a.loadSessionSupported,h=a.isTerminalMode,p=a.isTerminalRunnerConnected;typeof l=="boolean"&&typeof d=="boolean"?this.mirrorRuntime_$.set({isAcpConnected:l,loadSessionSupported:d,isTerminalMode:h===!0,isTerminalRunnerConnected:p===!0}):this.mirrorRuntime_$.set(null)}catch(t){this.sessionsLoadError_$.set(t),this.globalError_CS.showError(t,"ca-session-list")}finally{this.sessionsLoading_$.set(!1)}})}syncFromAgent(e){return f(this,null,function*(){try{yield this.caSession_AS.syncFromAgent({cwd:e?.cwd}),yield this.loadSessions()}catch(t){throw this.globalError_CS.showError(t,"ca-session-sync"),t}})}loadSessionDetail(e){return f(this,null,function*(){this.sessionDetailError_$.set(null),this.selectedSessionLoading_$.set(!0);try{let s=(yield this.caSession_AS.getSession(e.sessionId)).session;this.selectedSession_$.set(this.mapSessionRecord(s)),this.sessionEventsNextSince=null,this.sessionEventsHasMore_$.set(!1);let o=yield this.caSession_AS.getSessionEvents({sessionId:e.sessionId,limit:200}),i=o.events.map(a=>({sessionId:typeof a.sessionId=="string"?a.sessionId:e.sessionId,eventType:typeof a.eventType=="string"?a.eventType:"",timestamp:typeof a.timestamp=="string"?a.timestamp:"",data:this.asRecord(a.data),sequence:typeof a.sequence=="number"?a.sequence:0}));this.selectedSessionEvents_$.set(i),this.sessionEventsHasMore_$.set(o.hasMore===!0);let r=o.nextSinceSequence;return this.sessionEventsNextSince=typeof r=="number"?r:null,this.lastKnownEventSequence=Math.max(-1,...this.selectedSessionEvents_$().map(a=>a.sequence??0)),this.seedConsoleFromMirrorEvents(i),this.loadAssembledMessages({sessionId:e.sessionId}).catch(()=>{}),!0}catch(t){return this.sessionDetailError_$.set(t),this.selectedSession_$.set(null),this.selectedSessionEvents_$.set([]),this.globalError_CS.showError(t,"ca-session-detail"),!1}finally{this.selectedSessionLoading_$.set(!1)}})}loadMoreSessionEvents(e){return f(this,null,function*(){let t=this.sessionEventsNextSince;if(t!=null)try{let s=yield this.caSession_AS.getSessionEvents({sessionId:e.sessionId,sinceSequence:t,limit:200}),o=s.events.map(a=>({sessionId:typeof a.sessionId=="string"?a.sessionId:e.sessionId,eventType:typeof a.eventType=="string"?a.eventType:"",timestamp:typeof a.timestamp=="string"?a.timestamp:"",data:this.asRecord(a.data),sequence:typeof a.sequence=="number"?a.sequence:0})),i=[...this.selectedSessionEvents_$(),...o];i.sort(C.compareMirrorEventsAsc),this.selectedSessionEvents_$.set(i),this.sessionEventsHasMore_$.set(s.hasMore===!0);let r=s.nextSinceSequence;this.sessionEventsNextSince=typeof r=="number"?r:null,this.lastKnownEventSequence=Math.max(this.lastKnownEventSequence,...o.map(a=>a.sequence??0))}catch(s){this.globalError_CS.showError(s,"ca-session-events-page")}})}hydrateFromAgent(e){return f(this,null,function*(){try{yield this.caSession_AS.hydrateSession({sessionId:e.sessionId,force:e.force})}catch(s){throw this.globalError_CS.showError(s,"ca-session-hydrate"),s}if(!(yield this.loadSessionDetail({sessionId:e.sessionId}))){let s=this.sessionDetailError_$();throw s instanceof Error?s:new Error("CA session detail reload after hydrate failed")}})}setActiveSessionId(e){let t=this.activeSessionId_$();t&&t!==e&&this.socket_CS.emit("ca-session:unsubscribe",{sessionId:t}),this.activeSessionId_$.set(e),e&&this.socket_CS.emit("ca-session:subscribe",{sessionId:e})}clearLiveOutput(){this.consoleMessages_$.set([]),this.lastKnownEventSequence=-1,this.pendingOptimisticPrompts.length=0}createSession(e){return f(this,null,function*(){try{let t=yield this.caSession_AS.createSession({workspacePath:e.workspacePath,label:e.label}),o=this.toRecord(t.session).sessionId,i=typeof o=="string"?o:"";return yield this.loadSessions(),i}catch(t){throw t}})}sendPrompt(e){return f(this,null,function*(){let t=`optimistic-prompt-${globalThis.crypto.randomUUID()}`;this.pendingOptimisticPrompts.push({listKey:t,text:e.content}),this.pushConsoleMessage({listKey:t,type:"prompt",text:e.content});try{yield this.caSession_AS.sendPrompt(e)}catch(s){let o=this.pendingOptimisticPrompts.findIndex(i=>i.listKey===t);throw o>=0&&this.pendingOptimisticPrompts.splice(o,1),this.pushConsoleMessage({type:"error",text:A.getErrorMessageForDisplay(s)}),this.globalError_CS.showError(s,"ca-session-prompt"),s}})}stopExecution(e){return f(this,null,function*(){try{yield this.caSession_AS.stopExecution(e)}catch(t){throw this.globalError_CS.showError(t,"ca-session-stop-execution"),t}})}terminateSession(e){return f(this,null,function*(){try{yield this.caSession_AS.terminateSession(e),yield this.loadSessions()}catch(t){throw this.globalError_CS.showError(t,"ca-session-terminate"),t}})}setSessionArchived(e){return f(this,null,function*(){try{let t=yield this.caSession_AS.setSessionArchived(e);yield this.loadSessions(),this.selectedSession_$()?.sessionId===e.sessionId&&t.session!==null&&typeof t.session=="object"&&this.selectedSession_$.set(this.mapSessionRecord(this.toRecord(t.session)))}catch(t){throw this.globalError_CS.showError(t,"ca-session-archive"),t}})}startOpenSessionPolling(e){if(this.stopOpenSessionPolling(),!e)return;this.openSessionPollTargetId=e;let t=10*M.second;this.openSessionPollTimer=globalThis.setInterval(()=>{this.runOpenSessionPollTick(e)},t)}stopOpenSessionPolling(){this.openSessionPollTimer!==null&&(globalThis.clearInterval(this.openSessionPollTimer),this.openSessionPollTimer=null),this.openSessionPollTargetId=""}pushConsoleMessage(e){let t=this.materializeConsoleLineFromPushParams({listKey:e.listKey,type:e.type,text:e.text,timestamp:e.timestamp??new Date().toISOString(),rawData:e.rawData,mirrorEventType:e.mirrorEventType,briefSubtype:e.briefSubtype,useRawBubbleKind:e.useRawBubbleKind,streamTextRole:e.streamTextRole,streamLastSequence:e.streamLastSequence,streamMessageId:e.streamMessageId,streamPartData:e.streamPartData,toolDisplayName:e.toolDisplayName,isToolCallFailedIndicator:e.isToolCallFailedIndicator}),s=this.consoleMessages_$();this.consoleMessages_$.set([...s,t])}appendConsoleMirrorEventOne(e){if(e.eventType==="ca-session-update"){let i=u.tryParseMirrorData(e.data??{});if(i!==null&&this.applyToolCallMirrorEventToLiveConsole({ev:e,parsed:i}))return}let t=T.buildFromMirrorEvent(e);if(t===null||(e.eventType==="prompt-sent"&&t.consoleType==="prompt"&&this.removePendingOptimisticPromptBubbleIfTextMatchesMirror(t.bodyText),this.consoleMessages_$().some(i=>i.listKey===t.listKey))||t.isStreamingTextChunk===!0&&this.tryMergeStreamingMirrorChunkIntoConsole({ev:e,brief:t}))return;let o=typeof e.timestamp=="string"&&e.timestamp.length?e.timestamp:new Date().toISOString();this.pushConsoleMessage(this.buildConsolePushParamsFromBrief({ev:e,brief:t,timestampIso:o}))}tryMergeStreamingMirrorChunkIntoConsole(e){let t=this.consoleMessages_$();if(t.length===0)return!1;let s=t[t.length-1],o=v.parseStreamChunkFromMirrorData(e.ev.data??{});if(o===null||!v.canMergeConsoleTailWithChunk({prev:s,ev:e.ev,parsed:o}))return!1;let i=s.streamPartData!==void 0?[...s.streamPartData]:[];i.push(e.ev.data??{});let r=e.brief.streamMessageId,a=r!==void 0&&r.trim().length>0?r.trim():s.streamMessageId,l=b(S({},s),{text:s.text+e.brief.bodyText,streamLastSequence:e.ev.sequence??s.streamLastSequence,streamMessageId:a,streamPartData:i,rawData:{streamMerged:!0,partCount:i.length,lastChunkSequence:e.ev.sequence,chunkSnapshots:i}}),d=[...t];return d[d.length-1]=l,this.consoleMessages_$.set(d),!0}buildConsolePushParamsFromBrief(e){let t=e.brief;return t.isStreamingTextChunk===!0?{listKey:t.listKey,type:t.consoleType,text:t.bodyText,timestamp:e.timestampIso,rawData:t.rawData,mirrorEventType:t.mirrorEventType,briefSubtype:t.briefSubtype,useRawBubbleKind:t.useRawBubbleKind,streamTextRole:t.streamTextRole,streamLastSequence:e.ev.sequence,streamMessageId:t.streamMessageId,streamPartData:[e.ev.data??{}]}:{listKey:t.listKey,type:t.consoleType,text:t.bodyText,timestamp:e.timestampIso,rawData:t.rawData,mirrorEventType:t.mirrorEventType,briefSubtype:t.briefSubtype,useRawBubbleKind:t.useRawBubbleKind}}buildFoldedConsoleMessagesFromMirrorEvents(e){let t=[];for(let s of e){if(this.tryFoldToolCallMirrorEventIntoOut(t,s))continue;let i=T.buildFromMirrorEvent(s);if(i===null)continue;let r=typeof s.timestamp=="string"&&s.timestamp.length?s.timestamp:new Date().toISOString();if(i.isStreamingTextChunk===!0){let a=v.parseStreamChunkFromMirrorData(s.data??{});if(a===null)continue;let l=t.length>0?t[t.length-1]:void 0;if(l!==void 0&&v.canMergeConsoleTailWithChunk({prev:l,ev:s,parsed:a})){let d=l.streamPartData!==void 0?[...l.streamPartData]:[];d.push(s.data??{});let h=i.streamMessageId,p=h!==void 0&&h.trim().length>0?h.trim():l.streamMessageId;t[t.length-1]=b(S({},l),{text:l.text+i.bodyText,streamLastSequence:s.sequence??l.streamLastSequence,streamMessageId:p,streamPartData:d,rawData:{streamMerged:!0,partCount:d.length,lastChunkSequence:s.sequence,chunkSnapshots:d}})}else t.push(this.materializeConsoleLineFromPushParams(this.buildConsolePushParamsFromBrief({ev:s,brief:i,timestampIso:r})))}else t.push(this.materializeConsoleLineFromPushParams(this.buildConsolePushParamsFromBrief({ev:s,brief:i,timestampIso:r})))}return t}materializeConsoleLineFromPushParams(e){return{listKey:e.listKey??globalThis.crypto.randomUUID(),type:e.type,text:e.text,timestamp:e.timestamp,rawData:e.rawData,mirrorEventType:e.mirrorEventType,briefSubtype:e.briefSubtype,useRawBubbleKind:e.useRawBubbleKind,streamTextRole:e.streamTextRole,streamLastSequence:e.streamLastSequence,streamMessageId:e.streamMessageId,streamPartData:e.streamPartData,toolDisplayName:e.toolDisplayName,isToolCallFailedIndicator:e.isToolCallFailedIndicator}}applyToolCallMirrorEventToLiveConsole(e){let t=e.parsed,s=t.toolCallId,o=typeof e.ev.timestamp=="string"&&e.ev.timestamp.length?e.ev.timestamp:new Date().toISOString(),i=e.ev.data??{};if(t.sessionUpdate==="tool_call"){let r=u.listKeyStart(s);if(this.consoleMessages_$().some(h=>h.listKey===r))return!0;let l=c.toolCallDisplayName(t),d=c.buildToolCallBodyText({displayName:l,parsed:t});return this.pushConsoleMessage({listKey:r,type:"tool",text:d,timestamp:o,rawData:i,mirrorEventType:"ca-session-update",briefSubtype:"tool_call",toolDisplayName:l}),!0}if(t.sessionUpdate==="tool_call_update"&&t.status==="in_progress"){t.rawInput!==void 0&&this.patchLiveToolCallStartInput({toolCallId:s,parsed:t});let r=u.listKeyProgress(s),a="in_progress",l=this.consoleMessages_$(),d=l.findIndex(p=>p.listKey===r),h=this.materializeConsoleLineFromPushParams({listKey:r,type:"status-update",text:a,timestamp:o,rawData:i,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"});if(d>=0){let p=[...l];p[d]=h,this.consoleMessages_$.set(p)}else this.consoleMessages_$.set([...l,h]);return!0}if(t.sessionUpdate==="tool_call_update"&&t.status==="completed"){if(u.hasRawOutputError(t.rawOutput)){let d=u.listKeyError(s);if(!this.consoleMessages_$().some(p=>p.listKey===d)){let p=u.summarizeRawOutputError(t.rawOutput);this.pushConsoleMessage({listKey:d,type:"error",text:p,timestamp:o,rawData:i,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"}),this.patchLiveConsoleToolCallStartFailed({toolCallId:s})}return!0}let a=u.listKeyResult(s);if(!this.consoleMessages_$().some(d=>d.listKey===a)){let d=u.summarizeRawOutputSuccess(t.rawOutput);this.pushConsoleMessage({listKey:a,type:"tool-result",text:d,timestamp:o,rawData:i,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"})}return!0}return!1}tryFoldToolCallMirrorEventIntoOut(e,t){if(t.eventType!=="ca-session-update")return!1;let s=u.tryParseMirrorData(t.data??{});if(s===null)return!1;let o=typeof t.timestamp=="string"&&t.timestamp.length?t.timestamp:new Date().toISOString(),i=t.data??{};if(s.sessionUpdate==="tool_call"){let r=u.listKeyStart(s.toolCallId);if(!e.some(l=>l.listKey===r)){let l=c.toolCallDisplayName(s),d=c.buildToolCallBodyText({displayName:l,parsed:s});e.push(this.materializeConsoleLineFromPushParams({listKey:r,type:"tool",text:d,timestamp:o,rawData:i,mirrorEventType:"ca-session-update",briefSubtype:"tool_call",toolDisplayName:l}))}return!0}if(s.sessionUpdate==="tool_call_update"&&s.status==="in_progress"){s.rawInput!==void 0&&c.patchOutArrayToolCallStartInput(e,s);let r=u.listKeyProgress(s.toolCallId),a=this.materializeConsoleLineFromPushParams({listKey:r,type:"status-update",text:"in_progress",timestamp:o,rawData:i,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"}),l=e.findIndex(d=>d.listKey===r);return l>=0?e[l]=a:e.push(a),!0}if(s.sessionUpdate==="tool_call_update"&&s.status==="completed"){if(u.hasRawOutputError(s.rawOutput)){let d=u.listKeyError(s.toolCallId);if(!e.some(p=>p.listKey===d)){let p=u.summarizeRawOutputError(s.rawOutput);e.push(this.materializeConsoleLineFromPushParams({listKey:d,type:"error",text:p,timestamp:o,rawData:i,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"})),c.patchOutArrayToolCallStartFailed(e,s.toolCallId)}return!0}let a=u.listKeyResult(s.toolCallId);if(!e.some(d=>d.listKey===a)){let d=u.summarizeRawOutputSuccess(s.rawOutput);e.push(this.materializeConsoleLineFromPushParams({listKey:a,type:"tool-result",text:d,timestamp:o,rawData:i,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"}))}return!0}return!1}patchLiveToolCallStartInput(e){let t=u.listKeyStart(e.toolCallId),s=this.consoleMessages_$(),o=s.findIndex(l=>l.listKey===t);if(o<0)return;let i=s[o].toolDisplayName??"Tool call",r=c.buildToolCallBodyText({displayName:i,parsed:e.parsed}),a=[...s];a[o]=b(S({},a[o]),{text:r}),this.consoleMessages_$.set(a)}patchLiveConsoleToolCallStartFailed(e){let t=u.listKeyStart(e.toolCallId),s=this.consoleMessages_$(),o=s.findIndex(r=>r.listKey===t);if(o<0)return;let i=[...s];i[o]=b(S({},i[o]),{isToolCallFailedIndicator:!0}),this.consoleMessages_$.set(i)}static patchOutArrayToolCallStartFailed(e,t){let s=u.listKeyStart(t),o=e.findIndex(i=>i.listKey===s);o<0||(e[o]=b(S({},e[o]),{isToolCallFailedIndicator:!0}))}static patchOutArrayToolCallStartInput(e,t){let s=u.listKeyStart(t.toolCallId),o=e.findIndex(a=>a.listKey===s);if(o<0)return;let i=e[o].toolDisplayName??"Tool call",r=c.buildToolCallBodyText({displayName:i,parsed:t});e[o]=b(S({},e[o]),{text:r})}static toolCallDisplayName(e){return e.title!==void 0&&e.title.length?e.title:e.toolKind!==void 0&&e.toolKind.length?e.toolKind:"Tool call"}static buildToolCallBodyText(e){let t=[e.displayName],s=u.formatRawInput(e.parsed.rawInput);s.length&&t.push(s);let o=u.formatLocations(e.parsed.locations);return o.length&&t.push(`[locations]
6
6
  ${o}`),t.join(`
7
7
  `)}runOpenSessionPollTick(e){return f(this,null,function*(){if(!(e!==this.activeSessionId_$()||e!==this.openSessionPollTargetId))try{let t=yield this.caSession_AS.getSession(e);this.ngZone.run(()=>{e===this.activeSessionId_$()&&this.selectedSession_$.set(this.mapSessionRecord(this.toRecord(t.session)))});let s=this.lastKnownEventSequence,i=(yield this.caSession_AS.getSessionEvents({sessionId:e,sinceSequence:s>=0?s:void 0,limit:200})).events.map(r=>({sessionId:typeof r.sessionId=="string"?r.sessionId:e,eventType:typeof r.eventType=="string"?r.eventType:"",timestamp:typeof r.timestamp=="string"?r.timestamp:"",data:this.asRecord(r.data),sequence:typeof r.sequence=="number"?r.sequence:0}));if(!i.length)return;this.ngZone.run(()=>{if(e!==this.activeSessionId_$())return;let r=new Map;for(let l of this.selectedSessionEvents_$())r.set(l.sequence??0,l);for(let l of i)r.set(l.sequence??0,l);let a=[...r.values()].sort(C.compareMirrorEventsAsc);this.selectedSessionEvents_$.set(a);for(let l of i)(l.sequence??0)>s&&this.appendConsoleMirrorEventOne(l);this.lastKnownEventSequence=Math.max(s,...i.map(l=>l.sequence??0))})}catch{}})}handleSocketEvent(e){let t=e.event,s=e.payload;try{this.ngZone.run(()=>{switch(t){case"ca-session:status":this.handleStatusUpdate(s);break;case"ca-session:output":this.handleOutputChunk(s);break;case"ca-session:event":this.handleSessionEvent(s);break;case"ca-session:list-update":this.loadSessions().catch(()=>{});break;case"ext-session-msg:message":this.handleAssembledMessage(s);break;case"ext-session-msg:update":this.handleAssembledMessageUpdate(s);break;default:break}})}catch(o){M.DyFM_Log.error(`CCAP_CaSession_DS | socket error | ${t}`,o)}}handleStatusUpdate(e){let t=typeof e.sessionId=="string"?e.sessionId:"",s=typeof e.status=="string"?e.status:"",o=typeof e.statusMessage=="string"?e.statusMessage:void 0;this.lastStatusUpdate_$.set({sessionId:t,status:s,statusMessage:o});let i=this.sessions_$();this.sessions_$.set(i.map(a=>a.sessionId===t?b(S({},a),{status:s,statusMessage:o}):a));let r=this.selectedSession_$();r?.sessionId===t&&this.selectedSession_$.set(b(S({},r),{status:s,statusMessage:o})),s==="errored"&&this.globalError_CS.showError(new Error(o?`CA session error: ${o}`:"CA session errored"),"ca-session-status")}handleOutputChunk(e){let t=typeof e.sessionId=="string"?e.sessionId:"";if(t&&t!==this.activeSessionId_$())return;let s=typeof e.content=="string"?e.content:"",o=typeof e.type=="string"?e.type:"response";if(s){let i={};for(let r of Object.keys(e))i[r]=Reflect.get(e,r);this.pushConsoleMessage({type:o==="error"?"error":"assistant",text:s,rawData:i,mirrorEventType:"ca-session:output"})}}handleSessionEvent(e){let t=typeof e.sessionId=="string"?e.sessionId:"";if(t&&t!==this.activeSessionId_$())return;let s=this.asRecord(e.event),o=typeof s.sequence=="number"?s.sequence:0;if(o<=this.lastKnownEventSequence)return;this.lastKnownEventSequence=o;let i=s.timestamp,r={sessionId:t,eventType:typeof s.eventType=="string"?s.eventType:"",timestamp:typeof i=="string"&&i.length?i:new Date().toISOString(),data:this.asRecord(s.data),sequence:o},a=this.selectedSessionEvents_$();this.selectedSessionEvents_$.set([...a,r]),this.appendConsoleMirrorEventOne(r)}seedConsoleFromMirrorEvents(e){this.pendingOptimisticPrompts.length=0;let t=[...e].sort(C.compareMirrorEventsAsc);this.consoleMessages_$.set(this.buildFoldedConsoleMessagesFromMirrorEvents(t))}removePendingOptimisticPromptBubbleIfTextMatchesMirror(e){let t=this.pendingOptimisticPrompts.findIndex(i=>i.text===e||i.text.trim()===e.trim());if(t<0)return;let s=this.pendingOptimisticPrompts[t];this.pendingOptimisticPrompts.splice(t,1);let o=this.consoleMessages_$().filter(i=>i.listKey!==s.listKey);this.consoleMessages_$.set(o)}mapSessionRecord(e){return{sessionId:typeof e.sessionId=="string"?e.sessionId:void 0,acpSessionId:typeof e.acpSessionId=="string"?e.acpSessionId:void 0,label:typeof e.label=="string"?e.label:void 0,workspacePath:typeof e.workspacePath=="string"?e.workspacePath:void 0,status:typeof e.status=="string"?e.status:void 0,statusMessage:typeof e.statusMessage=="string"?e.statusMessage:void 0,promptCount:typeof e.promptCount=="number"?e.promptCount:void 0,lastPrompt:typeof e.lastPrompt=="string"?e.lastPrompt:void 0,lastActivityAt:typeof e.lastActivityAt=="string"?e.lastActivityAt:void 0,isArchived:e.isArchived===!0,parentSessionId:typeof e.parentSessionId=="string"?e.parentSessionId:void 0,lastSyncAt:typeof e.lastSyncAt=="string"?e.lastSyncAt:void 0,lastSyncError:typeof e.lastSyncError=="string"?e.lastSyncError:void 0,agentInfoName:typeof e.agentInfoName=="string"?e.agentInfoName:void 0,agentInfoVersion:typeof e.agentInfoVersion=="string"?e.agentInfoVersion:void 0,isAcpConnected:typeof e.isAcpConnected=="boolean"?e.isAcpConnected:void 0,loadSessionSupported:typeof e.loadSessionSupported=="boolean"?e.loadSessionSupported:void 0,isTerminalMode:typeof e.isTerminalMode=="boolean"?e.isTerminalMode:void 0,isTerminalRunnerConnected:typeof e.isTerminalRunnerConnected=="boolean"?e.isTerminalRunnerConnected:void 0}}asRecord(e){return this.toRecord(e)}toRecord(e){if(e!==null&&typeof e=="object"&&!Array.isArray(e)){let t={};for(let s of Object.keys(e))t[s]=Reflect.get(e,s);return t}return{}}loadAssembledMessages(e){return f(this,null,function*(){try{let t=yield this.extSessionMsg_AS.getMessages({sessionId:e.sessionId,latest:!0});this.assembledMessages_$.set(t.messages)}catch(t){M.DyFM_Log.error(`CCAP_CaSession_DS | loadAssembledMessages failed | sessionId: ${e.sessionId}`,t)}})}handleAssembledMessage(e){let t=typeof e.sessionId=="string"?e.sessionId:"";if(!t||t!==this.activeSessionId_$())return;let s=e.message;if(!s||typeof s!="object")return;let o=s,i=this.assembledMessages_$();this.assembledMessages_$.set([...i,o])}handleAssembledMessageUpdate(e){let t=typeof e.sessionId=="string"?e.sessionId:"";if(!t||t!==this.activeSessionId_$())return;let s=typeof e.messageKey=="string"?e.messageKey:"";if(!s)return;let o=e.update;if(!o||typeof o!="object")return;let i=o,r=this.assembledMessages_$(),a=r.findIndex(h=>h.messageKey===s);if(a<0)return;let l=S({},r[a]);typeof i.bodyText=="string"&&(l.bodyText=i.bodyText),i.toolResult!==void 0&&(l.toolResult=i.toolResult),typeof i.toolStatus=="string"&&(l.toolStatus=i.toolStatus),i.headerStatusDot!==void 0&&(l.headerStatusDot=typeof i.headerStatusDot=="string"?i.headerStatusDot:void 0);let d=[...r];d[a]=l,this.assembledMessages_$.set(d)}static \u0275fac=function(t){return new(t||c)};static \u0275prov=w({token:c,factory:c.\u0275fac,providedIn:"root"})}return c})();export{C as a,v as b,x as c,u as d,fe as e};
8
- //# sourceMappingURL=chunk-HRSSMQBA.js.map
8
+ //# sourceMappingURL=chunk-6CNO7CIR.js.map
@@ -1,2 +1,2 @@
1
- import{p as o}from"./chunk-5N64HGRY.js";import{h as r}from"./chunk-TBMJSIBB.js";var a=function(t){return t.created="created",t.alreadyLinked="already-linked",t.userMarked="user-marked",t.errorNotFound="error-not-found",t}(a||{});var m=function(t){return t.confirm="confirm",t.optionSelect="option-select",t.question="question",t}(m||{});var e=r(o());var d=new e.DyFM_DataModel_Params({dataName:"ccap_setting",properties:{ccapId:{type:"string"},sectionId:{type:"string",required:!0,index:!0},sectionProtectionFlag:{type:"string",required:!0,unique:!0},payload:{type:"object",required:!0}}});var p=r(o());var S=new p.DyFM_DataModel_Params({dataName:"pm_project",properties:{ccapId:{type:"string",index:!0},name:{type:"string",required:!0,index:!0},githubRepoUrl:{type:"string"},description:{type:"string"},localPath:{type:"string"},isActive:{type:"boolean"},preferredBugsMdRelativePath:{type:"string"},gitBranch:{type:"string"},gitStatus:{type:"string"},gitAheadBehind:{type:"string"},gitLastCommitDate:{type:"string"},gitLastCommitMessage:{type:"string"},gitLastCommitAuthor:{type:"string"},gitRemoteUrl:{type:"string"},gitInfo:{type:"object"},packageVersion:{type:"string"},packageScripts:{type:"array"},packageDependencyCount:{type:"number"},packageDevDependencyCount:{type:"number"},packageInfo:{type:"object"},artifacts:{type:"object"},lastSyncAt:{type:"string"},lastSyncStatus:{type:"string"},lastSyncSummary:{type:"string"},lastSyncDurationMs:{type:"number"},lastSyncErrors:{type:"array"},githubOwner:{type:"string"},githubRepo:{type:"string"},githubIssueSyncEnabled:{type:"boolean"},githubIssueSyncAt:{type:"string"},githubIssueSyncStatus:{type:"string"},githubIssueSyncSummary:{type:"string"},githubIssueSyncConfig:{type:"object"},githubPrSyncEnabled:{type:"boolean"},githubPrSyncAt:{type:"string"}}});var n=r(o());var P=new n.DyFM_DataModel_Params({dataName:"pm_user_request",properties:{projectId:{type:"string",required:!0,index:!0},content:{type:"string",required:!0},title:{type:"string"},type:{type:"string"},code:{type:"string"},priority:{type:"string"},area:{type:"string"},phase:{type:"string"},status:{type:"string"},specStatus:{type:"string"},implStatus:{type:"string"},testStatus:{type:"string"},completeStatus:{type:"string"},githubIssueNumber:{type:"number",index:!0},githubIssueUrl:{type:"string"},githubIssueId:{type:"number"},githubSyncedAt:{type:"string"},githubSyncDirection:{type:"string"}}});var s=r(o());var k=new s.DyFM_DataModel_Params({dataName:"ccap_quick_input",properties:{projectId:{type:"string",required:!0,index:!0},rawContent:{type:"string",required:!0},title:{type:"string"},status:{type:"string",required:!0,index:!0},promotedUserRequestId:{type:"string"},promotedBugCode:{type:"string"},predictedProjectId:{type:"string",index:!0},predictedType:{type:"string"},predictedCleanDescription:{type:"string"},taskDifficulty:{type:"string"},priority:{type:"string"},area:{type:"string"},createdAtVersion:{type:"string"}}});var x=r(o());var q=new x.DyFM_DataModel_Params({dataName:"pm_project_group",properties:{ccapId:{type:"string",index:!0},name:{type:"string",required:!0,index:!0},scanPath:{type:"string",required:!0},description:{type:"string"}}});var i=r(o());var A=new i.DyFM_DataModel_Params({dataName:"pm_project_group_file",properties:{groupId:{type:"string",required:!0,index:!0},ccapId:{type:"string",index:!0},relativePath:{type:"string",required:!0},sizeBytes:{type:"number"},lastModifiedAt:{type:"string"},fileHash:{type:"string"},isDirectory:{type:"boolean"}}});export{a,m as b};
2
- //# sourceMappingURL=chunk-7XAV5GIW.js.map
1
+ import{p as o}from"./chunk-ZJ3DCODZ.js";import{h as r}from"./chunk-TBMJSIBB.js";var a=function(t){return t.created="created",t.alreadyLinked="already-linked",t.userMarked="user-marked",t.errorNotFound="error-not-found",t}(a||{});var m=function(t){return t.confirm="confirm",t.optionSelect="option-select",t.question="question",t}(m||{});var e=r(o());var d=new e.DyFM_DataModel_Params({dataName:"ccap_setting",properties:{ccapId:{type:"string"},sectionId:{type:"string",required:!0,index:!0},sectionProtectionFlag:{type:"string",required:!0,unique:!0},payload:{type:"object",required:!0}}});var p=r(o());var S=new p.DyFM_DataModel_Params({dataName:"pm_project",properties:{ccapId:{type:"string",index:!0},name:{type:"string",required:!0,index:!0},githubRepoUrl:{type:"string"},description:{type:"string"},localPath:{type:"string"},isActive:{type:"boolean"},preferredBugsMdRelativePath:{type:"string"},gitBranch:{type:"string"},gitStatus:{type:"string"},gitAheadBehind:{type:"string"},gitLastCommitDate:{type:"string"},gitLastCommitMessage:{type:"string"},gitLastCommitAuthor:{type:"string"},gitRemoteUrl:{type:"string"},gitInfo:{type:"object"},packageVersion:{type:"string"},packageScripts:{type:"array"},packageDependencyCount:{type:"number"},packageDevDependencyCount:{type:"number"},packageInfo:{type:"object"},artifacts:{type:"object"},lastSyncAt:{type:"string"},lastSyncStatus:{type:"string"},lastSyncSummary:{type:"string"},lastSyncDurationMs:{type:"number"},lastSyncErrors:{type:"array"},githubOwner:{type:"string"},githubRepo:{type:"string"},githubIssueSyncEnabled:{type:"boolean"},githubIssueSyncAt:{type:"string"},githubIssueSyncStatus:{type:"string"},githubIssueSyncSummary:{type:"string"},githubIssueSyncConfig:{type:"object"},githubPrSyncEnabled:{type:"boolean"},githubPrSyncAt:{type:"string"}}});var n=r(o());var P=new n.DyFM_DataModel_Params({dataName:"pm_user_request",properties:{projectId:{type:"string",required:!0,index:!0},content:{type:"string",required:!0},title:{type:"string"},type:{type:"string"},code:{type:"string"},priority:{type:"string"},area:{type:"string"},phase:{type:"string"},status:{type:"string"},specStatus:{type:"string"},implStatus:{type:"string"},testStatus:{type:"string"},completeStatus:{type:"string"},githubIssueNumber:{type:"number",index:!0},githubIssueUrl:{type:"string"},githubIssueId:{type:"number"},githubSyncedAt:{type:"string"},githubSyncDirection:{type:"string"}}});var s=r(o());var k=new s.DyFM_DataModel_Params({dataName:"ccap_quick_input",properties:{projectId:{type:"string",required:!0,index:!0},rawContent:{type:"string",required:!0},title:{type:"string"},status:{type:"string",required:!0,index:!0},promotedUserRequestId:{type:"string"},promotedBugCode:{type:"string"},predictedProjectId:{type:"string",index:!0},predictedType:{type:"string"},predictedCleanDescription:{type:"string"},taskDifficulty:{type:"string"},priority:{type:"string"},area:{type:"string"},createdAtVersion:{type:"string"}}});var x=r(o());var q=new x.DyFM_DataModel_Params({dataName:"pm_project_group",properties:{ccapId:{type:"string",index:!0},name:{type:"string",required:!0,index:!0},scanPath:{type:"string",required:!0},description:{type:"string"}}});var i=r(o());var A=new i.DyFM_DataModel_Params({dataName:"pm_project_group_file",properties:{groupId:{type:"string",required:!0,index:!0},ccapId:{type:"string",index:!0},relativePath:{type:"string",required:!0},sizeBytes:{type:"number"},lastModifiedAt:{type:"string"},fileHash:{type:"string"},isDirectory:{type:"boolean"}}});export{a,m as b};
2
+ //# sourceMappingURL=chunk-6IVNYSN4.js.map
@@ -1,2 +1,2 @@
1
- import{p as l}from"./chunk-5N64HGRY.js";import{G as i,h as f}from"./chunk-TBMJSIBB.js";var o=f(l()),u=10*o.second,_=20*o.second,a=5,c=7;var n=class{static getDurationBand(r){if(r==null)return null;let e=typeof r=="number"?r:Number(r);return Number.isNaN(e)||e<0?null:e<=u?"green":e<=_?"yellow":"red"}static getScoreBand(r){return r<a?"red":r>=c?"green":"yellow"}};var m=(()=>{class t{transform(e){return e!=null?n.getScoreBand(Number(e)):"yellow"}static \u0275fac=function(p){return new(p||t)};static \u0275pipe=i({name:"ccapScoreBand",type:t,pure:!0,standalone:!0})}return t})();export{n as a,m as b};
2
- //# sourceMappingURL=chunk-ZOCMDQAW.js.map
1
+ import{p as l}from"./chunk-ZJ3DCODZ.js";import{G as i,h as f}from"./chunk-TBMJSIBB.js";var o=f(l()),u=10*o.second,_=20*o.second,a=5,c=7;var n=class{static getDurationBand(r){if(r==null)return null;let e=typeof r=="number"?r:Number(r);return Number.isNaN(e)||e<0?null:e<=u?"green":e<=_?"yellow":"red"}static getScoreBand(r){return r<a?"red":r>=c?"green":"yellow"}};var m=(()=>{class t{transform(e){return e!=null?n.getScoreBand(Number(e)):"yellow"}static \u0275fac=function(p){return new(p||t)};static \u0275pipe=i({name:"ccapScoreBand",type:t,pure:!0,standalone:!0})}return t})();export{n as a,m as b};
2
+ //# sourceMappingURL=chunk-6UTINZN6.js.map
@@ -1,3 +1,3 @@
1
- import{b as Y}from"./chunk-MMFURH5P.js";import{a as ee}from"./chunk-PWAWM6DC.js";import{a as X}from"./chunk-FLAJXIYW.js";import{b as G,c as k,f as V,i as W,n as A,o as U,p as B,v as R}from"./chunk-EO4DNTT4.js";import{d as J,i as Q}from"./chunk-I4M7XPFX.js";import{a as F}from"./chunk-5UPNU54P.js";import{c as q}from"./chunk-WXN5C3BS.js";import{C as f}from"./chunk-5N64HGRY.js";import{C as E,D as v,Fa as d,Ga as y,Ha as $,I as K,J as m,K as g,Q as j,T as O,Ta as z,U as C,Z as s,aa as c,da as M,fa as H,ga as _,hb as L,jb as N,k as b,la as x,na as I,oa as T,pa as P,qa as r,ra as o,ua as S,ub as D,va as p,wa as u,wb as Z}from"./chunk-TBMJSIBB.js";var te="ccap-pm-user-input-wizard-draft:",w=class a{static storageKey(l,e){let i=`${te}${l}`,t=e?.trim();return t!==void 0&&t.length>0?`${i}:qi:${t}`:i}static load(l,e){let i=a.storageKey(l,e),t=F.readJson(i,null);if(!a.isDraftShape(t))return null;let n=t;return typeof n.previewMarkdown!="string"&&(n.previewMarkdown=""),n}static save(l,e,i){let t=a.storageKey(l,i),n={rawText:e.rawText,refinementDraft:e.refinementDraft,wizardStep:e.wizardStep,suggestionJson:e.suggestionJson,previewMarkdown:e.previewMarkdown,updatedAt:e.updatedAt};F.writeJson(t,n)}static clear(l,e){let i=a.storageKey(l,e);F.remove(i)}static isDraftShape(l){if(typeof l!="object"||l===null||Array.isArray(l))return!1;let e=Reflect.get(l,"previewMarkdown"),i=typeof e=="string"||e===void 0,t=Reflect.get(l,"suggestionJson");return typeof Reflect.get(l,"rawText")=="string"&&typeof Reflect.get(l,"refinementDraft")=="string"&&typeof Reflect.get(l,"wizardStep")=="number"&&(t===null||typeof t=="string")&&i&&typeof Reflect.get(l,"updatedAt")=="string"}};function re(a,l){if(a&1){let e=S();r(0,"div",0)(1,"h3",11),d(2,"New USER-INPUT (wizard)"),o(),r(3,"button",12),p("click",function(){m(e);let t=u();return g(t.handleDiscardDraft())}),d(4," Clear draft "),o()()}}function oe(a,l){if(a&1){let e=S();r(0,"div",1)(1,"button",12),p("click",function(){m(e);let t=u();return g(t.handleDiscardDraft())}),d(2," Clear draft "),o()()}}function ae(a,l){if(a&1&&(r(0,"div",3),d(1),o()),a&2){let e=u();s(),$(" ",e.suggestErrorText_$()," ")}}function se(a,l){if(a&1&&(r(0,"div",3),d(1),o()),a&2){let e=u();s(),$(" ",e.finalizeErrorText_$()," ")}}function de(a,l){if(a&1&&(r(0,"div",4)(1,"span",13),d(2,"LLM system prompt (last suggest / refine)"),o(),r(3,"pre",14),d(4),o()()),a&2){let e=u();s(4),y(e.pm_DS.userInputWizardLastLlmSystemPrompt_$())}}function le(a,l){if(a&1&&(r(0,"div",4)(1,"span",13),d(2,"LLM user message (last suggest / refine)"),o(),r(3,"pre",15),d(4),o()()),a&2){let e=u();s(4),y(e.pm_DS.userInputWizardLastLlmUserMessage_$())}}function pe(a,l){a&1&&d(0," Formatting\u2026 ")}function _e(a,l){a&1&&d(0," Format with AI ")}function ue(a,l){if(a&1){let e=S();r(0,"div",9)(1,"button",16),p("click",function(){m(e);let t=u();return g(t.handleFormatWithAi())}),M(2,pe,1,0)(3,_e,1,0),o()()}if(a&2){let e=u();s(),_("disabled",e.pm_DS.userInputWizardSuggestLoading_$()||!e.rawText_$().trim()),s(),x(e.pm_DS.userInputWizardSuggestLoading_$()?2:3)}}function ce(a,l){if(a&1&&(r(0,"option",24),d(1),o()),a&2){let e=l.$implicit;_("value",e),s(),y(e)}}function me(a,l){if(a&1){let e=S();r(0,"div",28)(1,"label",20),d(2,"Refine instruction (optional)"),o(),r(3,"textarea",30),p("ngModelChange",function(t){m(e);let n=u(2);return g(n.handleRefinementInput(t))}),d(4," "),o(),r(5,"button",31),p("click",function(){m(e);let t=u(2);return g(t.handleRefine())}),d(6," Refine with AI "),o()()}if(a&2){let e=u(2);s(3),_("ngModel",e.refinement_$()),s(2),_("disabled",e.pm_DS.userInputWizardSuggestLoading_$()||!e.refinement_$().trim())}}function ge(a,l){a&1&&d(0," Saving\u2026 ")}function he(a,l){a&1&&d(0," Finalize (USER-INPUT.md + database) ")}function fe(a,l){if(a&1){let e=S();r(0,"div",10)(1,"h4",17),d(2,"Preview (last server response)"),o(),r(3,"pre",18),d(4),o(),r(5,"div",19)(6,"div",4)(7,"label",20),d(8,"Type"),o(),r(9,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editType_$.set(t),g(n.handleEditorChange())}),o()(),r(10,"div",4)(11,"label",20),d(12,"Code"),o(),r(13,"input",22),p("ngModelChange",function(t){m(e);let n=u();return n.editCode_$.set(t),g(n.handleEditorChange())}),o()(),r(14,"div",4)(15,"label",20),d(16,"Priority"),o(),r(17,"select",23),p("ngModelChange",function(t){m(e);let n=u();return n.editPriority_$.set(t),g(n.handleEditorChange())}),T(18,ce,2,2,"option",24,I),o()(),r(20,"div",4)(21,"label",20),d(22,"Phase"),o(),r(23,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editPhase_$.set(t),g(n.handleEditorChange())}),o()(),r(24,"div",25)(25,"label",20),d(26,"Area"),o(),r(27,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editArea_$.set(t),g(n.handleEditorChange())}),o()(),r(28,"div",25)(29,"label",20),d(30,"Title (DB)"),o(),r(31,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editTitle_$.set(t),g(n.handleEditorChange())}),o()(),r(32,"div",25)(33,"label",20),d(34,"Details (one line)"),o(),r(35,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editDetails_$.set(t),g(n.handleEditorChange())}),o()(),r(36,"div",4)(37,"label",20),d(38,"E1"),o(),r(39,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editE1_$.set(t),g(n.handleEditorChange())}),o()(),r(40,"div",4)(41,"label",20),d(42,"E2"),o(),r(43,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editE2_$.set(t),g(n.handleEditorChange())}),o()(),r(44,"div",4)(45,"label",20),d(46,"E3"),o(),r(47,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editE3_$.set(t),g(n.handleEditorChange())}),o()(),r(48,"div",4)(49,"label",20),d(50,"E4"),o(),r(51,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editE4_$.set(t),g(n.handleEditorChange())}),o()()(),r(52,"label",26)(53,"input",27),p("ngModelChange",function(t){m(e);let n=u();return g(n.addToBacklog_$.set(t))}),o(),d(54," Also append matching line to BACKLOG.md "),o(),M(55,me,7,2,"div",28),r(56,"button",29),p("click",function(){m(e);let t=u();return g(t.handleFinalize())}),M(57,ge,1,0)(58,he,1,0),o()()}if(a&2){let e=u();s(4),y(e.previewMarkdown_$()),s(5),_("ngModel",e.editType_$()),s(4),_("ngModel",e.editCode_$()),s(4),_("ngModel",e.editPriority_$()),s(),P(e.priorities),s(5),_("ngModel",e.editPhase_$()),s(4),_("ngModel",e.editArea_$()),s(4),_("ngModel",e.editTitle_$()),s(4),_("ngModel",e.editDetails_$()),s(4),_("ngModel",e.editE1_$()),s(4),_("ngModel",e.editE2_$()),s(4),_("ngModel",e.editE3_$()),s(4),_("ngModel",e.editE4_$()),s(2),_("ngModel",e.addToBacklog_$()),s(2),x(e.skipSuggestMode?-1:55),s(),_("disabled",e.pm_DS.userInputWizardFinalizeLoading_$()||!e.rawText_$().trim()),s(),x(e.pm_DS.userInputWizardFinalizeLoading_$()?57:58)}}var xe=400,Ve=(()=>{class a{projectId="";isEmbeddedInModal=!1;wizardCompleted=new j;wizardFinalizeSuccess=new j;quickInputDraftId=null;initialRawContent="";skipSuggestMode=!1;initialStagingPriority=void 0;pm_DS=E(ee);suggestErrorText_$=L(()=>{let e=this.pm_DS.userInputWizardSuggestError_$();return e?a.formatHttpError(e):null});finalizeErrorText_$=L(()=>{let e=this.pm_DS.userInputWizardFinalizeError_$();return e?a.formatHttpError(e):null});rawText_$=c("");refinement_$=c("");wizardStep_$=c(0);previewMarkdown_$=c("");addToBacklog_$=c(!1);editType_$=c("");editCode_$=c("");editPriority_$=c(f.medium);editArea_$=c("");editPhase_$=c("MVP1");editDetails_$=c("");editTitle_$=c("");editE1_$=c("\u274C");editE2_$=c("\u274C");editE3_$=c("\u274C");editE4_$=c("\u274C");priorities=Object.values(f);draftTimer;ngOnChanges(e){(e.projectId!==void 0&&e.projectId.currentValue||e.quickInputDraftId!==void 0||e.initialRawContent!==void 0||e.skipSuggestMode!==void 0||e.initialStagingPriority!==void 0)&&this.projectId&&this.applyWizardBootstrapFromInputs()}ngOnDestroy(){this.draftTimer!==void 0&&clearTimeout(this.draftTimer)}handleVoiceTranscript(e){let i=e?.trim()??"";i.length&&(this.rawText_$.update(t=>t?`${t}
1
+ import{b as Y}from"./chunk-RTAONMUA.js";import{a as ee}from"./chunk-ZRLAS63L.js";import{a as X}from"./chunk-FLAJXIYW.js";import{b as G,c as k,f as V,i as W,n as A,o as U,p as B,v as R}from"./chunk-EO4DNTT4.js";import{d as J,i as Q}from"./chunk-SUAZOLRE.js";import{a as F}from"./chunk-5UPNU54P.js";import{c as q}from"./chunk-66YFYBOC.js";import{C as f}from"./chunk-ZJ3DCODZ.js";import{C as E,D as v,Fa as d,Ga as y,Ha as $,I as K,J as m,K as g,Q as j,T as O,Ta as z,U as C,Z as s,aa as c,da as M,fa as H,ga as _,hb as L,jb as N,k as b,la as x,na as I,oa as T,pa as P,qa as r,ra as o,ua as S,ub as D,va as p,wa as u,wb as Z}from"./chunk-TBMJSIBB.js";var te="ccap-pm-user-input-wizard-draft:",w=class a{static storageKey(l,e){let i=`${te}${l}`,t=e?.trim();return t!==void 0&&t.length>0?`${i}:qi:${t}`:i}static load(l,e){let i=a.storageKey(l,e),t=F.readJson(i,null);if(!a.isDraftShape(t))return null;let n=t;return typeof n.previewMarkdown!="string"&&(n.previewMarkdown=""),n}static save(l,e,i){let t=a.storageKey(l,i),n={rawText:e.rawText,refinementDraft:e.refinementDraft,wizardStep:e.wizardStep,suggestionJson:e.suggestionJson,previewMarkdown:e.previewMarkdown,updatedAt:e.updatedAt};F.writeJson(t,n)}static clear(l,e){let i=a.storageKey(l,e);F.remove(i)}static isDraftShape(l){if(typeof l!="object"||l===null||Array.isArray(l))return!1;let e=Reflect.get(l,"previewMarkdown"),i=typeof e=="string"||e===void 0,t=Reflect.get(l,"suggestionJson");return typeof Reflect.get(l,"rawText")=="string"&&typeof Reflect.get(l,"refinementDraft")=="string"&&typeof Reflect.get(l,"wizardStep")=="number"&&(t===null||typeof t=="string")&&i&&typeof Reflect.get(l,"updatedAt")=="string"}};function re(a,l){if(a&1){let e=S();r(0,"div",0)(1,"h3",11),d(2,"New USER-INPUT (wizard)"),o(),r(3,"button",12),p("click",function(){m(e);let t=u();return g(t.handleDiscardDraft())}),d(4," Clear draft "),o()()}}function oe(a,l){if(a&1){let e=S();r(0,"div",1)(1,"button",12),p("click",function(){m(e);let t=u();return g(t.handleDiscardDraft())}),d(2," Clear draft "),o()()}}function ae(a,l){if(a&1&&(r(0,"div",3),d(1),o()),a&2){let e=u();s(),$(" ",e.suggestErrorText_$()," ")}}function se(a,l){if(a&1&&(r(0,"div",3),d(1),o()),a&2){let e=u();s(),$(" ",e.finalizeErrorText_$()," ")}}function de(a,l){if(a&1&&(r(0,"div",4)(1,"span",13),d(2,"LLM system prompt (last suggest / refine)"),o(),r(3,"pre",14),d(4),o()()),a&2){let e=u();s(4),y(e.pm_DS.userInputWizardLastLlmSystemPrompt_$())}}function le(a,l){if(a&1&&(r(0,"div",4)(1,"span",13),d(2,"LLM user message (last suggest / refine)"),o(),r(3,"pre",15),d(4),o()()),a&2){let e=u();s(4),y(e.pm_DS.userInputWizardLastLlmUserMessage_$())}}function pe(a,l){a&1&&d(0," Formatting\u2026 ")}function _e(a,l){a&1&&d(0," Format with AI ")}function ue(a,l){if(a&1){let e=S();r(0,"div",9)(1,"button",16),p("click",function(){m(e);let t=u();return g(t.handleFormatWithAi())}),M(2,pe,1,0)(3,_e,1,0),o()()}if(a&2){let e=u();s(),_("disabled",e.pm_DS.userInputWizardSuggestLoading_$()||!e.rawText_$().trim()),s(),x(e.pm_DS.userInputWizardSuggestLoading_$()?2:3)}}function ce(a,l){if(a&1&&(r(0,"option",24),d(1),o()),a&2){let e=l.$implicit;_("value",e),s(),y(e)}}function me(a,l){if(a&1){let e=S();r(0,"div",28)(1,"label",20),d(2,"Refine instruction (optional)"),o(),r(3,"textarea",30),p("ngModelChange",function(t){m(e);let n=u(2);return g(n.handleRefinementInput(t))}),d(4," "),o(),r(5,"button",31),p("click",function(){m(e);let t=u(2);return g(t.handleRefine())}),d(6," Refine with AI "),o()()}if(a&2){let e=u(2);s(3),_("ngModel",e.refinement_$()),s(2),_("disabled",e.pm_DS.userInputWizardSuggestLoading_$()||!e.refinement_$().trim())}}function ge(a,l){a&1&&d(0," Saving\u2026 ")}function he(a,l){a&1&&d(0," Finalize (USER-INPUT.md + database) ")}function fe(a,l){if(a&1){let e=S();r(0,"div",10)(1,"h4",17),d(2,"Preview (last server response)"),o(),r(3,"pre",18),d(4),o(),r(5,"div",19)(6,"div",4)(7,"label",20),d(8,"Type"),o(),r(9,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editType_$.set(t),g(n.handleEditorChange())}),o()(),r(10,"div",4)(11,"label",20),d(12,"Code"),o(),r(13,"input",22),p("ngModelChange",function(t){m(e);let n=u();return n.editCode_$.set(t),g(n.handleEditorChange())}),o()(),r(14,"div",4)(15,"label",20),d(16,"Priority"),o(),r(17,"select",23),p("ngModelChange",function(t){m(e);let n=u();return n.editPriority_$.set(t),g(n.handleEditorChange())}),T(18,ce,2,2,"option",24,I),o()(),r(20,"div",4)(21,"label",20),d(22,"Phase"),o(),r(23,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editPhase_$.set(t),g(n.handleEditorChange())}),o()(),r(24,"div",25)(25,"label",20),d(26,"Area"),o(),r(27,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editArea_$.set(t),g(n.handleEditorChange())}),o()(),r(28,"div",25)(29,"label",20),d(30,"Title (DB)"),o(),r(31,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editTitle_$.set(t),g(n.handleEditorChange())}),o()(),r(32,"div",25)(33,"label",20),d(34,"Details (one line)"),o(),r(35,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editDetails_$.set(t),g(n.handleEditorChange())}),o()(),r(36,"div",4)(37,"label",20),d(38,"E1"),o(),r(39,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editE1_$.set(t),g(n.handleEditorChange())}),o()(),r(40,"div",4)(41,"label",20),d(42,"E2"),o(),r(43,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editE2_$.set(t),g(n.handleEditorChange())}),o()(),r(44,"div",4)(45,"label",20),d(46,"E3"),o(),r(47,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editE3_$.set(t),g(n.handleEditorChange())}),o()(),r(48,"div",4)(49,"label",20),d(50,"E4"),o(),r(51,"input",21),p("ngModelChange",function(t){m(e);let n=u();return n.editE4_$.set(t),g(n.handleEditorChange())}),o()()(),r(52,"label",26)(53,"input",27),p("ngModelChange",function(t){m(e);let n=u();return g(n.addToBacklog_$.set(t))}),o(),d(54," Also append matching line to BACKLOG.md "),o(),M(55,me,7,2,"div",28),r(56,"button",29),p("click",function(){m(e);let t=u();return g(t.handleFinalize())}),M(57,ge,1,0)(58,he,1,0),o()()}if(a&2){let e=u();s(4),y(e.previewMarkdown_$()),s(5),_("ngModel",e.editType_$()),s(4),_("ngModel",e.editCode_$()),s(4),_("ngModel",e.editPriority_$()),s(),P(e.priorities),s(5),_("ngModel",e.editPhase_$()),s(4),_("ngModel",e.editArea_$()),s(4),_("ngModel",e.editTitle_$()),s(4),_("ngModel",e.editDetails_$()),s(4),_("ngModel",e.editE1_$()),s(4),_("ngModel",e.editE2_$()),s(4),_("ngModel",e.editE3_$()),s(4),_("ngModel",e.editE4_$()),s(2),_("ngModel",e.addToBacklog_$()),s(2),x(e.skipSuggestMode?-1:55),s(),_("disabled",e.pm_DS.userInputWizardFinalizeLoading_$()||!e.rawText_$().trim()),s(),x(e.pm_DS.userInputWizardFinalizeLoading_$()?57:58)}}var xe=400,Ve=(()=>{class a{projectId="";isEmbeddedInModal=!1;wizardCompleted=new j;wizardFinalizeSuccess=new j;quickInputDraftId=null;initialRawContent="";skipSuggestMode=!1;initialStagingPriority=void 0;pm_DS=E(ee);suggestErrorText_$=L(()=>{let e=this.pm_DS.userInputWizardSuggestError_$();return e?a.formatHttpError(e):null});finalizeErrorText_$=L(()=>{let e=this.pm_DS.userInputWizardFinalizeError_$();return e?a.formatHttpError(e):null});rawText_$=c("");refinement_$=c("");wizardStep_$=c(0);previewMarkdown_$=c("");addToBacklog_$=c(!1);editType_$=c("");editCode_$=c("");editPriority_$=c(f.medium);editArea_$=c("");editPhase_$=c("MVP1");editDetails_$=c("");editTitle_$=c("");editE1_$=c("\u274C");editE2_$=c("\u274C");editE3_$=c("\u274C");editE4_$=c("\u274C");priorities=Object.values(f);draftTimer;ngOnChanges(e){(e.projectId!==void 0&&e.projectId.currentValue||e.quickInputDraftId!==void 0||e.initialRawContent!==void 0||e.skipSuggestMode!==void 0||e.initialStagingPriority!==void 0)&&this.projectId&&this.applyWizardBootstrapFromInputs()}ngOnDestroy(){this.draftTimer!==void 0&&clearTimeout(this.draftTimer)}handleVoiceTranscript(e){let i=e?.trim()??"";i.length&&(this.rawText_$.update(t=>t?`${t}
2
2
  ${i}`:i),this.scheduleDraftSave())}handleFormatWithAi(){return b(this,null,function*(){let e=this.rawText_$().trim();if(!(!e.length||!this.projectId))try{let i=yield this.pm_DS.suggestUserInputFormat(this.projectId,{rawText:e});this.previewMarkdown_$.set(i.previewMarkdown),this.applySuggestionToEditors(i.suggestion),this.wizardStep_$.set(1),this.scheduleDraftSave()}catch{}})}handleRefine(){return b(this,null,function*(){let e=this.rawText_$().trim(),i=this.refinement_$().trim();if(!e.length||!i.length||!this.projectId)return;let t=this.buildSuggestionFromEditors();if(t)try{let n=yield this.pm_DS.suggestUserInputFormat(this.projectId,{rawText:e,refinementInstruction:i,previousSuggestion:t});this.previewMarkdown_$.set(n.previewMarkdown),this.applySuggestionToEditors(n.suggestion),this.scheduleDraftSave()}catch{}})}handleFinalize(){return b(this,null,function*(){let e=this.rawText_$().trim();if(!(!e.length||!this.projectId))try{let i=yield this.pm_DS.finalizeUserInputWizard(this.projectId,{rawContent:e,type:this.editType_$().trim(),code:this.editCode_$().trim(),priority:this.editPriority_$().trim(),phase:this.editPhase_$().trim(),details:this.editDetails_$().trim(),area:this.editArea_$().trim()||void 0,title:this.editTitle_$().trim()||void 0,e1:this.editE1_$().trim(),e2:this.editE2_$().trim(),e3:this.editE3_$().trim(),e4:this.editE4_$().trim(),addToBacklog:this.addToBacklog_$()});w.clear(this.projectId,this.quickInputDraftId),this.resetWizardState(),this.wizardFinalizeSuccess.emit(i),this.wizardCompleted.emit()}catch{}})}handleDiscardDraft(){this.projectId&&w.clear(this.projectId,this.quickInputDraftId),this.resetWizardState(),this.skipSuggestMode&&this.wizardStep_$.set(1)}handleRawTextInput(e){this.rawText_$.set(e),this.scheduleDraftSave()}handleRefinementInput(e){this.refinement_$.set(e),this.scheduleDraftSave()}handleEditorChange(){this.scheduleDraftSave()}resetWizardState(){this.rawText_$.set(""),this.refinement_$.set(""),this.wizardStep_$.set(0),this.previewMarkdown_$.set(""),this.addToBacklog_$.set(!1),this.editType_$.set(""),this.editCode_$.set(""),this.editPriority_$.set(f.medium),this.editArea_$.set(""),this.editPhase_$.set("MVP1"),this.editDetails_$.set(""),this.editTitle_$.set(""),this.editE1_$.set("\u274C"),this.editE2_$.set("\u274C"),this.editE3_$.set("\u274C"),this.editE4_$.set("\u274C")}applySuggestionToEditors(e){this.editType_$.set(e.type.trim()),this.editCode_$.set(e.code.trim()),this.editPriority_$.set(e.priority.trim().toLowerCase()),this.editArea_$.set(e.area?.trim()??""),this.editPhase_$.set(e.phase.trim()),this.editDetails_$.set(e.details.trim()),this.editTitle_$.set(e.title?.trim()??""),this.editE1_$.set(e.e1.trim()),this.editE2_$.set(e.e2.trim()),this.editE3_$.set(e.e3.trim()),this.editE4_$.set(e.e4.trim())}buildSuggestionFromEditors(){let e=this.editType_$().trim(),i=this.editCode_$().trim();return!e.length||!i.length?null:{type:e,code:i,priority:this.editPriority_$().trim(),phase:this.editPhase_$().trim(),details:this.editDetails_$().trim(),e1:this.editE1_$().trim(),e2:this.editE2_$().trim(),e3:this.editE3_$().trim(),e4:this.editE4_$().trim(),area:this.editArea_$().trim()||void 0,title:this.editTitle_$().trim()||void 0}}applyWizardBootstrapFromInputs(){if(!this.projectId)return;let e=w.load(this.projectId,this.quickInputDraftId);if(e){this.rawText_$.set(e.rawText),this.refinement_$.set(e.refinementDraft);let t=e.wizardStep;if(this.skipSuggestMode&&(t=t<1?1:t),this.wizardStep_$.set(t),e.suggestionJson)try{let n=JSON.parse(e.suggestionJson);a.isSuggestionShape(n)&&this.applySuggestionToEditors(n)}catch{}this.previewMarkdown_$.set(e.previewMarkdown??""),this.scheduleDraftSave();return}this.resetWizardState();let i=this.initialRawContent?.trim()??"";i.length>0&&this.rawText_$.set(i),this.skipSuggestMode&&this.wizardStep_$.set(1),this.initialStagingPriority!==void 0&&this.editPriority_$.set(this.initialStagingPriority),this.scheduleDraftSave()}static formatHttpError(e){if(e instanceof Z){let i=a.readNestedErrorString(e.error);return i||e.message}return e instanceof Error?e.message:String(e)}static readNestedErrorString(e){if(!q.isRecord(e))return null;let i=e.error;return typeof i=="string"?i:null}static isSuggestionShape(e){return q.isRecord(e)?typeof e.type=="string"&&typeof e.code=="string"&&typeof e.priority=="string"&&typeof e.phase=="string"&&typeof e.details=="string"&&typeof e.e1=="string"&&typeof e.e2=="string"&&typeof e.e3=="string"&&typeof e.e4=="string":!1}scheduleDraftSave(){this.projectId&&(this.draftTimer!==void 0&&clearTimeout(this.draftTimer),this.draftTimer=setTimeout(()=>{this.persistDraft()},xe))}persistDraft(){if(!this.projectId)return;let e=this.buildSuggestionFromEditors(),i={rawText:this.rawText_$(),refinementDraft:this.refinement_$(),wizardStep:this.wizardStep_$(),suggestionJson:e?JSON.stringify(e):null,previewMarkdown:this.previewMarkdown_$(),updatedAt:new Date().toISOString()};w.save(this.projectId,i,this.quickInputDraftId)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=v({type:a,selectors:[["app-pm-user-input-wizard"]],inputs:{projectId:"projectId",isEmbeddedInModal:"isEmbeddedInModal",quickInputDraftId:"quickInputDraftId",initialRawContent:"initialRawContent",skipSuggestMode:"skipSuggestMode",initialStagingPriority:"initialStagingPriority"},outputs:{wizardCompleted:"wizardCompleted",wizardFinalizeSuccess:"wizardFinalizeSuccess"},standalone:!0,features:[K,z],decls:17,vars:9,consts:[[1,"flex","items-center","justify-between","gap-2","flex-wrap"],[1,"flex","justify-end"],[1,"text-xs","text-neutral-500"],[1,"rounded","border","border-red-800/50","bg-red-950/30","px-3","py-2","text-xs","text-red-300","whitespace-pre-wrap"],[1,"flex","flex-col","gap-1"],[1,"relative","pt-5"],[1,"text-xs","text-neutral-400","block","mb-1"],["rows","6",1,"w-full","bg-neutral-900","border","border-neutral-600","rounded","px-3","py-2","text-sm","text-neutral-100","placeholder:text-neutral-600","focus:outline-none","focus:border-ccapAccent","resize-y","min-h-[120px]",3,"ngModelChange","ngModel"],[1,"absolute","left-1/2","top-6","z-10","-translate-x-1/2","-translate-y-1/2",3,"transcriptReady"],[1,"flex","flex-wrap","gap-2"],[1,"border-t","border-neutral-700","pt-4","flex","flex-col","gap-3"],[1,"text-sm","font-semibold","text-neutral-200"],["type","button",1,"px-2","py-1","text-xs","text-neutral-500","hover:text-red-400","border","border-transparent","hover:border-red-900/50","rounded",3,"click"],[1,"text-xs","font-semibold","text-neutral-400"],[1,"text-[11px]","text-neutral-300","bg-neutral-950/80","border","border-neutral-700","rounded","p-2","max-h-32","overflow-auto","whitespace-pre-wrap","font-mono"],[1,"text-[11px]","text-neutral-300","bg-neutral-950/80","border","border-neutral-700","rounded","p-2","max-h-48","overflow-auto","whitespace-pre-wrap","font-mono"],["type","button",1,"px-4","py-2","border","border-ccapAccent","rounded","text-ccapAccent","text-sm","font-semibold","hover:bg-ccapAccent","hover:text-white","transition-colors","disabled:opacity-40",3,"click","disabled"],[1,"text-xs","font-semibold","text-neutral-400","uppercase","tracking-wide"],[1,"text-xs","text-neutral-300","bg-neutral-950/80","border","border-neutral-700","rounded","p-3","max-h-48","overflow-auto","whitespace-pre-wrap","font-mono"],[1,"grid","grid-cols-1","sm:grid-cols-2","gap-3"],[1,"text-xs","text-neutral-400"],["type","text",1,"bg-neutral-900","border","border-neutral-600","rounded","px-2","py-1.5","text-sm","text-neutral-100",3,"ngModelChange","ngModel"],["type","text",1,"bg-neutral-900","border","border-neutral-600","rounded","px-2","py-1.5","text-sm","font-mono","text-neonCyan",3,"ngModelChange","ngModel"],[1,"bg-neutral-900","border","border-neutral-600","rounded","px-2","py-1.5","text-sm","text-neutral-100",3,"ngModelChange","ngModel"],[3,"value"],[1,"flex","flex-col","gap-1","sm:col-span-2"],[1,"flex","items-center","gap-2","text-xs","text-neutral-400","cursor-pointer"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"flex","flex-col","gap-2","border","border-neutral-700","rounded","p-3","bg-neutral-900/40"],["type","button",1,"px-4","py-2","bg-ccapAccent/20","border","border-ccapAccent","text-ccapAccent","text-sm","font-semibold","rounded","hover:bg-ccapAccent","hover:text-white","transition-colors","disabled:opacity-40",3,"click","disabled"],["rows","2",1,"bg-neutral-900","border","border-neutral-600","rounded","px-2","py-1.5","text-sm","text-neutral-100","resize-y",3,"ngModelChange","ngModel"],["type","button",1,"self-start","px-3","py-1.5","border","border-neutral-500","rounded","text-neutral-300","text-xs","font-semibold","hover:border-ccapAccent","hover:text-ccapAccent","disabled:opacity-40",3,"click","disabled"]],template:function(i,t){i&1&&(r(0,"div"),M(1,re,5,0,"div",0)(2,oe,3,0,"div",1),r(3,"p",2),d(4," Raw text is never rewritten by the model. AI suggests metadata only. Drafts are saved in this browser (localStorage). "),o(),M(5,ae,2,1,"div",3)(6,se,2,1,"div",3)(7,de,5,1,"div",4)(8,le,5,1,"div",4),r(9,"div",5)(10,"label",6),d(11,"Raw user input"),o(),r(12,"textarea",7),p("ngModelChange",function(h){return t.handleRawTextInput(h)}),d(13," "),o(),r(14,"app-ccap-voice-record-button",8),p("transcriptReady",function(h){return t.handleVoiceTranscript(h)}),o()(),M(15,ue,4,2,"div",9)(16,fe,59,16,"div",10),o()),i&2&&(H("class","flex flex-col gap-4"+(t.isEmbeddedInModal?"":" rounded-lg bg-neutral-800/50 border border-ccapAccent/30 p-4")),s(),x(t.isEmbeddedInModal?2:1),s(4),x(t.suggestErrorText_$()?5:-1),s(),x(t.finalizeErrorText_$()?6:-1),s(),x(t.pm_DS.userInputWizardLastLlmSystemPrompt_$()?7:-1),s(),x(t.pm_DS.userInputWizardLastLlmUserMessage_$()?8:-1),s(4),_("ngModel",t.rawText_$()),s(3),x(t.skipSuggestMode?-1:15),s(),x(t.wizardStep_$()>=1||t.skipSuggestMode?16:-1))},dependencies:[D,R,U,B,k,G,A,V,W,Y],encapsulation:2})}return a})();function Ce(a,l){if(a&1&&(r(0,"option",8),d(1),o()),a&2){let e=l.$implicit;_("ngValue",e),s(),y(e)}}var Je=(()=>{class a{userInput_DS=E(Q);isOpen=C(!1);isBusy=C(!1);modalZIndex=C("50");prefillTitle=C("");prefillDetails=C("");prefillPriority=C(void 0);closed=O();submitted=O();title_$=c("");details_$=c("");area_$=c("");phase_$=c("MVP1");priority_$=c(f.medium);priorityChoices=[f.low,f.medium,f.high,f.urgent];constructor(){N(()=>{if(this.isOpen()){let e=this.prefillTitle().trim(),i=this.prefillDetails().trim();this.title_$.set(e),this.details_$.set(i),this.area_$.set(""),this.phase_$.set("MVP1");let t=this.prefillPriority();this.priority_$.set(t!==void 0?t:f.medium)}}),N(()=>{this.isOpen()?this.userInput_DS.pushQuickInputOverlayAreaContextByOverlayId(J.pmManualBugModal):this.userInput_DS.popQuickInputOverlayAreaContext(J.pmManualBugModal)},{allowSignalWrites:!0})}handleClose(){this.closed.emit()}handleSubmit(){let e=this.title_$().trim(),i=this.details_$().trim();if(!e.length||!i.length)return;let t=this.area_$().trim(),n=this.phase_$().trim(),h={title:e,details:i,priority:this.priority_$(),phase:n.length>0?n:"MVP1"};t.length>0&&(h.area=t),this.submitted.emit(h)}handleTitleInput(e){this.title_$.set(e)}handleDetailsInput(e){this.details_$.set(e)}handleAreaInput(e){this.area_$.set(e)}handlePhaseInput(e){this.phase_$.set(e)}handlePriorityChange(e){if(typeof e=="string"){let i=a.parsePriority(e);i&&this.priority_$.set(i);return}this.priority_$.set(e)}static parsePriority(e){let i=e.trim().toLowerCase(),t=Object.values(f);for(let n of t)if(n===i)return n}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=v({type:a,selectors:[["app-pm-manual-bug-modal"]],inputs:{isOpen:[1,"isOpen"],isBusy:[1,"isBusy"],modalZIndex:[1,"modalZIndex"],prefillTitle:[1,"prefillTitle"],prefillDetails:[1,"prefillDetails"],prefillPriority:[1,"prefillPriority"]},outputs:{closed:"closed",submitted:"submitted"},standalone:!0,features:[z],decls:30,vars:12,consts:[["title","New bug (manual)",3,"closed","isOpen","maxWidth","zIndex","headerBorderClass"],[1,"flex","flex-col","gap-3","text-sm","text-neutral-200"],[1,"flex","flex-col","gap-1"],[1,"text-xs","text-neutral-500"],["type","text",1,"w-full","rounded","border","border-neutral-600","bg-neutral-900","px-2","py-1.5","text-neutral-100",3,"ngModelChange","ngModel"],["rows","6",1,"w-full","rounded","border","border-neutral-600","bg-neutral-900","px-2","py-1.5","text-neutral-100","font-mono","text-xs",3,"ngModelChange","ngModel"],[1,"grid","grid-cols-1","sm:grid-cols-2","gap-3"],[1,"rounded","border","border-neutral-600","bg-neutral-900","px-2","py-1.5","text-neutral-100",3,"ngModelChange","ngModel"],[3,"ngValue"],["modal-footer","",1,"flex","justify-end","gap-2","px-4","py-3","border-t","border-neutral-800","shrink-0"],["type","button",1,"px-3","py-1.5","text-xs","font-semibold","rounded","border","border-neutral-600","text-neutral-300","hover:border-neutral-500","disabled:opacity-40","disabled:pointer-events-none",3,"click","disabled"],["type","button",1,"px-3","py-1.5","text-xs","font-semibold","rounded","border","border-ccapAccent","text-ccapAccent","hover:bg-ccapAccent/10","disabled:opacity-40","disabled:pointer-events-none",3,"click","disabled"]],template:function(i,t){i&1&&(r(0,"app-s-modal",0),p("closed",function(){return t.handleClose()}),r(1,"div",1)(2,"label",2)(3,"span",3),d(4,"Title"),o(),r(5,"input",4),p("ngModelChange",function(h){return t.handleTitleInput(h)}),o()(),r(6,"label",2)(7,"span",3),d(8,"Details (raw \u2014 stored verbatim)"),o(),r(9,"textarea",5),p("ngModelChange",function(h){return t.handleDetailsInput(h)}),o()(),r(10,"div",6)(11,"label",2)(12,"span",3),d(13,"Priority"),o(),r(14,"select",7),p("ngModelChange",function(h){return t.handlePriorityChange(h)}),T(15,Ce,2,2,"option",8,I),o()(),r(17,"label",2)(18,"span",3),d(19,"Phase"),o(),r(20,"input",4),p("ngModelChange",function(h){return t.handlePhaseInput(h)}),o()()(),r(21,"label",2)(22,"span",3),d(23,"Area (optional)"),o(),r(24,"input",4),p("ngModelChange",function(h){return t.handleAreaInput(h)}),o()()(),r(25,"div",9)(26,"button",10),p("click",function(){return t.handleClose()}),d(27," Cancel "),o(),r(28,"button",11),p("click",function(){return t.handleSubmit()}),d(29),o()()()),i&2&&(_("isOpen",t.isOpen())("maxWidth","lg")("zIndex",t.modalZIndex())("headerBorderClass","border-neonRed/40"),s(5),_("ngModel",t.title_$()),s(4),_("ngModel",t.details_$()),s(5),_("ngModel",t.priority_$()),s(),P(t.priorityChoices),s(5),_("ngModel",t.phase_$()),s(4),_("ngModel",t.area_$()),s(2),_("disabled",t.isBusy()),s(2),_("disabled",t.isBusy()||!t.title_$().trim().length||!t.details_$().trim().length),s(),$(" ",t.isBusy()?"Creating\u2026":"Create bug"," "))},dependencies:[D,R,U,B,k,A,V,W,X],encapsulation:2})}return a})();export{Je as a,Ve as b};
3
- //# sourceMappingURL=chunk-VSGHMHDK.js.map
3
+ //# sourceMappingURL=chunk-7FDRE6FK.js.map
@@ -1,4 +1,4 @@
1
- import{j as ks}from"./chunk-WXN5C3BS.js";import{I as $,N as Es,a as _s,b as ys,c as gs,d as ur,e as gt,f as ms,g as lr,i as hr,l as bs,n as dr,p as fr}from"./chunk-5N64HGRY.js";import{C as oe,H as _t,O as fs,P as De,a as as,aa as z,e as cr,f,g as ar,h as us,hb as ps,i as K,ib as yt,jb as Fe,k as u,l as ls,m as hs,w as pt,y as ds}from"./chunk-TBMJSIBB.js";var qe=f(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.DyFM_SocketEvent_Key=void 0;var vs=function(s){return s.incomingNewConnection="connection",s.outgoingNewConnection="connect",s.subscribe="subscribe",s.subscriptionSuccessful="subscriptionSuccessful",s.unsubscribe="unsubscribe",s.unsubscribeSuccessful="unsubscribeSuccessful",s.disconnect="disconnect",s.ping="ping",s.event="event",s.error="error",s}(vs||(Me.DyFM_SocketEvent_Key=vs={}))});var Ss=f(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.DyFM_SocketClient_Params=void 0;var yr=ur(),gr=gt(),bt=class{name;service;address;port;reconnectDelay=yr.second*30;reconnect=!0;socketOptions;constructor(e){Object.assign(this,e),this.reconnect=!!this.reconnectDelay,(this.socketOptions?.autoConnect||this.socketOptions?.reconnection||this.socketOptions?.reconnectionDelay)&&(gr.DyFM_Log.warn("autoConnect or reconnection is set to true in socketOptions, so reconnect is set to false",`
1
+ import{j as ks}from"./chunk-66YFYBOC.js";import{I as $,N as Es,a as _s,b as ys,c as gs,d as ur,e as gt,f as ms,g as lr,i as hr,l as bs,n as dr,p as fr}from"./chunk-ZJ3DCODZ.js";import{C as oe,H as _t,O as fs,P as De,a as as,aa as z,e as cr,f,g as ar,h as us,hb as ps,i as K,ib as yt,jb as Fe,k as u,l as ls,m as hs,w as pt,y as ds}from"./chunk-TBMJSIBB.js";var qe=f(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.DyFM_SocketEvent_Key=void 0;var vs=function(s){return s.incomingNewConnection="connection",s.outgoingNewConnection="connect",s.subscribe="subscribe",s.subscriptionSuccessful="subscriptionSuccessful",s.unsubscribe="unsubscribe",s.unsubscribeSuccessful="unsubscribeSuccessful",s.disconnect="disconnect",s.ping="ping",s.event="event",s.error="error",s}(vs||(Me.DyFM_SocketEvent_Key=vs={}))});var Ss=f(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.DyFM_SocketClient_Params=void 0;var yr=ur(),gr=gt(),bt=class{name;service;address;port;reconnectDelay=yr.second*30;reconnect=!0;socketOptions;constructor(e){Object.assign(this,e),this.reconnect=!!this.reconnectDelay,(this.socketOptions?.autoConnect||this.socketOptions?.reconnection||this.socketOptions?.reconnectionDelay)&&(gr.DyFM_Log.warn("autoConnect or reconnection is set to true in socketOptions, so reconnect is set to false",`
2
2
  This means that the reconnection will use the socket.io reconnection logic, `,"not the Dynamo implementations."),this.reconnect=!1)}};xe.DyFM_SocketClient_Params=bt});var kt=f(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.DyFM_SocketEvent=void 0;var Ie=gs(),ws=ms(),Ee=gt(),mr=hr(),br=bs(),ke=qe(),Et=class{name;eventKey;serviceName;preProcesses;tasks;logEvent;logEventContent;stackLocation;constructor(e){try{this.name=e.name??e.eventKey,this.eventKey=e.eventKey,this.serviceName=e.serviceName??"UnknownSocketService",this.preProcesses=e.preProcesses??[],this.tasks=e.tasks??[],this.stackLocation=(0,mr.DyFM_getConstructionStackLocation)(),e.logEvent!==void 0?this.logEvent=e.logEvent:this.eventKey===ke.DyFM_SocketEvent_Key.subscribe?this.logEvent=!1:[ke.DyFM_SocketEvent_Key.incomingNewConnection,ke.DyFM_SocketEvent_Key.outgoingNewConnection,ke.DyFM_SocketEvent_Key.disconnect].includes(this.eventKey)?this.logEvent=Ie.DyFM_global_settings.log_settings.socket_allEvents||Ie.DyFM_global_settings.log_settings.socket_mainEvents:this.logEvent=Ie.DyFM_global_settings.log_settings.socket_allEvents,this.logEventContent=e.logEventContent??Ie.DyFM_global_settings.log_settings.socket_eventContent}catch(t){throw Ee.DyFM_Log.error(`
3
3
  Socket Event params setup failed (${this.serviceName}): ${e.eventKey}`,t),t}}getPreLog(e){return u(this,null,function*(){try{this.logEventContent&&this.eventKey!==ke.DyFM_SocketEvent_Key.incomingNewConnection?Ee.DyFM_Log.log(`---> incoming socket(${this.serviceName}) event: ${this.eventKey};
4
4
 
@@ -8,4 +8,4 @@ socket-client(${this.params?.name}) Service setup finished`),yield this.connectS
8
8
  Fn:. setupDefaultEvents`),this.defaultEvents.forEach(e=>{e.serviceName=this.params.name;let t=this.incomingEvents.find(n=>n.eventKey===e.eventKey);t?t.tasks.unshift(...e.tasks):this.incomingEvents.push(e)})}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Setup Default Events failed, ERROR:`,e),e}})}setupSocketEvents(){return u(this,null,function*(){try{this.debugLog&&console.log(`Setup socket-client(${this.params.name}) Events...`),yield Lo.DyFM_Array.asyncForEach(this.incomingEvents,e=>u(this,null,function*(){e.serviceName=this.params.name,this.socket.on(e.eventKey,t=>u(this,null,function*(){try{yield e.executeEventTasks(t,this.params.service)}catch(n){k.DyFM_Log.error(`socket-client(${this.params.name}) Event failed, ERROR:`,n),yield this.emitEvent(X.DyFM_SocketEvent_Key.error,n)}}))}))}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Setup Socket Events failed, ERROR:`,e),e}})}connectSocket(){return u(this,null,function*(){try{k.DyFM_Log.info(`< .. > socket-client(${this.params.name}) connecting to ${this.params.address}:${this.params.port} ...`),this.socket.connect(),this.params.reconnect&&(yield this.tryReconnectIfNeeded())}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Connect Socket failed, ERROR:`,e),e}})}tryingToReconnect=!1;tryReconnectIfNeeded(){return u(this,null,function*(){try{if(console.log("tryReconnectIfNeeded",this._params.reconnectDelay),this.tryingToReconnect){k.DyFM_Log.warn(`socket-client(${this.params.name}) already trying to reconnect!`);return}if(!this.params.reconnect){k.DyFM_Log.warn(`socket-client(${this.params.name}) Dynamo reconnection is disabled!`);return}this.tryingToReconnect=!0,this.logFn&&console.log(`
9
9
  Fn:. tryReconnectIfNeeded`),yield vn.DyFM_Async.delay(this._params.reconnectDelay),this.connected||(this.tryingToReconnect=!1,yield this.connectSocket())}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Try Reconnect failed, ERROR:`,e),this.tryingToReconnect=!1,e}})}reconnect(){this.tryingToReconnect=!1,this.socket&&this.socket.disconnect(),this.connectSocket()}};lt.DyFM_SocketClient_ServiceBase=os});var wn=f(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});var ht=(ys(),K(_s));ht.__exportStar(qe(),be);ht.__exportStar(Ss(),be);ht.__exportStar(kt(),be);ht.__exportStar(Sn(),be)});function pr(s,e){!e?.injector&&_t(pr);let t=e?.injector??oe(fs),n=new hs(1),r=Fe(()=>{let i;try{i=s()}catch(o){yt(()=>n.error(o));return}yt(()=>n.next(i))},{injector:t,manualCleanup:!0});return t.get(De).onDestroy(()=>{r.destroy(),n.complete()}),n.asObservable()}function mt(s,e){let t=!e?.manualCleanup;t&&!e?.injector&&_t(mt);let n=t?e?.injector?.get(De)??oe(De):null,r=_r(e?.equal),i;e?.requireSync?i=z({kind:0},{equal:r}):i=z({kind:1,value:e?.initialValue},{equal:r});let o=s.subscribe({next:c=>i.set({kind:1,value:c}),error:c=>{if(e?.rejectErrors)throw c;i.set({kind:2,error:c})}});if(e?.requireSync&&i().kind===0)throw new pt(601,!1);return n?.onDestroy(o.unsubscribe.bind(o)),ps(()=>{let c=i();switch(c.kind){case 1:return c.value;case 2:throw c.error;case 0:throw new pt(601,!1)}},{equal:e?.equal})}function _r(s=Object.is){return(e,t)=>e.kind===1&&t.kind===1&&s(e.value,t.value)}var C=us(fr()),d=us(wn());var j=function(s){return s.connecting="connecting",s.connected="connected",s.error="error",s}(j||{});function dt(){if($.socketUrl!==void 0&&$.socketUrl.trim()!=="")return $.socketUrl.trim();if(typeof window<"u"){let s=new URL(window.location.href).origin;return C.DyFM_Log.warn("CCAP_Socket | socketUrl not set, using same-origin fallback:",s),s}return""}function U(s){return s!=null&&typeof s=="object"&&!(s instanceof Error)}function Cn(){return typeof globalThis>"u"?!1:globalThis.jasmine!==void 0}var Tn="answer",On="notify-user",Rn="agent-events",Pn="context:updated",An="monitoring:event",Nn="user-notification",Dn="cc-session:status",Fn="cc-session:output",Mn="cc-session:event",qn="cc-session:list-update",xn="cc-session:session-update",In="ca-session:status",jn="ca-session:output",Ln="ca-session:event",Bn="ca-session:list-update",Un="ext-session-msg:message",Kn="ext-session-msg:update",$n="user-interaction:request",Vn="instance-data:session-status-updated",Wn="instance:presence-update",Hn="openclaw-instance-data:status-updated",Yn="cci-instance-data:status-updated",Xn="cai-instance-data:status-updated",Jn="terminal:list:result",zn="terminal:start:result",Gn="terminal:command-result",Qn="terminal:command-output",Zn="cc:rate-limit-update",er="cc:account-usage-update",tr="cc:account-list-update",sr="session-queue:updated",nr="session-queue:lock-changed",Uo="system-error",Ko="terminal-error",$o="server:start-id",Vo="connect_error",Wo=8*C.second,Yc=(()=>{class s extends d.DyFM_SocketClient_ServiceBase{status_$=z(j.connecting);lastError_$=z(null);connectAttemptCount_$=z(0);hasEverConnected=!1;connectionTimeoutId=null;knownServerStartId=null;eventSubject_S=new ls;event$=this.eventSubject_S.asObservable();connected_$=mt(this.connected$,{initialValue:!1});get socketAddress(){return dt()||(this.params?.address??"")}globalError_CS=oe(ks);settingsGeneral_DS=oe(Es);constructor(){super(),Cn()||this.startConnectionTimeout(),Fe(()=>{this.connected&&!this.subscribed&&this.subscribe()})}startConnectionTimeout(){this.clearConnectionTimeout(),this.connectionTimeoutId=setTimeout(()=>{if(this.connectionTimeoutId=null,this.status_$()===j.connecting){let t=new Error("Socket connection timeout \u2013 server unreachable or setup failed. Click to reconnect.");this.status_$.set(j.error),this.lastError_$.set(t),C.DyFM_Log.warn("CCAP_Socket | Connection timeout")}},Wo)}clearConnectionTimeout(){this.connectionTimeoutId!==null&&(clearTimeout(this.connectionTimeoutId),this.connectionTimeoutId=null)}getParams(){let t=dt(),n=Cn(),r={path:"/socket",transports:["polling","websocket"],reconnectionDelay:1e3};return n&&(r.reconnection=!1),new d.DyFM_SocketClient_Params({name:"CCAP Client",address:t,reconnect:!n,reconnectDelay:C.minute,socketOptions:r})}getIncomingEvents(){let t=this,n=(r,i)=>{try{let o=U(i)?i:{};if(!t.eventSubject_S){let c=`Socket event dropped: eventSubject not initialized | event: ${r} | This means the socket event system is not functional \u2014 no live updates will arrive.`;C.DyFM_Log.error(`[CCAP_Socket] ${c}`),t.globalError_CS.showError(new Error(c),"client-socket-event-subject");return}t.eventSubject_S.next({event:r,payload:o})}catch(o){let c=o instanceof Error?o.message:String(o);C.DyFM_Log.error(`[CCAP_Socket] pushEnvelope failed | event: ${r} | ${c}`),t.globalError_CS.showError(o instanceof Error?o:new Error(`Socket event processing failed: ${r} \u2014 ${c}`),"client-socket-push-envelope")}};return[new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.outgoingNewConnection,tasks:[()=>u(this,null,function*(){t.clearConnectionTimeout(),t.hasEverConnected=!0,t.status_$.set(j.connected),t.lastError_$.set(null),t.connectAttemptCount_$.set(0),C.DyFM_Log.info("CCAP_Socket | Connected")})]}),new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.disconnect,tasks:[()=>u(this,null,function*(){t.hasEverConnected&&t.status_$.set(j.error),C.DyFM_Log.info("CCAP_Socket | Disconnected")})]}),new d.DyFM_SocketEvent({eventKey:Vo,tasks:[r=>u(this,null,function*(){t.clearConnectionTimeout(),t.connectAttemptCount_$.update(a=>a+1);let i=r instanceof Error?r:new Error(String(r)),o=U(r)?r.description:void 0,c=U(r)?r.type:void 0;C.DyFM_Log.info("CCAP_Socket | connect_error",`attempt #${t.connectAttemptCount_$()}`,i?.message??String(r),o!==void 0?String(o):"",c!==void 0?String(c):""),t.status_$.set(j.error);let h=t.params?.address??"",_=t.buildSocketErrorDisplay({err:i,socketUrl:h,eventType:"connect_error",raw:r});t.lastError_$.set(_),t.shouldReportSocketConnectionErrorsToErrorList()&&t.globalError_CS.reportErrorOnly({message:String(_.fullMessage??_.message??i.message),stack:typeof _.stack=="string"?_.stack:void 0,source:"client-socket"})})]}),new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.error,tasks:[r=>u(this,null,function*(){t.clearConnectionTimeout(),t.status_$.set(j.error);let i=r instanceof Error?r:new Error(String(r)),o=t.params?.address??"",c=t.buildSocketErrorDisplay({err:i,socketUrl:o,eventType:"error",raw:r});t.lastError_$.set(c),t.shouldReportSocketConnectionErrorsToErrorList()&&t.globalError_CS.reportErrorOnly({message:String(c.fullMessage??c.message??i.message),stack:typeof c.stack=="string"?c.stack:void 0,source:"client-socket"})})]}),new d.DyFM_SocketEvent({eventKey:Tn,tasks:[r=>u(this,null,function*(){n(Tn,r)})]}),new d.DyFM_SocketEvent({eventKey:On,tasks:[r=>u(this,null,function*(){n(On,r)})]}),new d.DyFM_SocketEvent({eventKey:Rn,tasks:[r=>u(this,null,function*(){n(Rn,r)})]}),new d.DyFM_SocketEvent({eventKey:Pn,tasks:[r=>u(this,null,function*(){n(Pn,r)})]}),new d.DyFM_SocketEvent({eventKey:An,tasks:[r=>u(this,null,function*(){n(An,r)})]}),new d.DyFM_SocketEvent({eventKey:Nn,tasks:[r=>u(this,null,function*(){let i=U(r)?r:{};if(n(Nn,r),i.type===Uo){let o=t.buildServerErrorDisplay(i);t.globalError_CS.showError(o,"client-socket")}else if(i.type===Ko){let o=t.buildTerminalErrorDisplay(i);t.globalError_CS.showError(o,"client-socket")}})]}),new d.DyFM_SocketEvent({eventKey:$o,tasks:[r=>u(this,null,function*(){let i=U(r)?r:{},o=typeof i.serverStartId=="number"?i.serverStartId:void 0;o!==void 0&&(t.knownServerStartId===null?(t.knownServerStartId=o,C.DyFM_Log.info("CCAP_Socket | Server start ID stored:",o)):t.knownServerStartId!==o&&(C.DyFM_Log.warn("CCAP_Socket | Server restarted (start ID changed), reloading page"),window.location.reload()))})]}),new d.DyFM_SocketEvent({eventKey:Dn,tasks:[r=>u(this,null,function*(){n(Dn,r)})]}),new d.DyFM_SocketEvent({eventKey:Fn,tasks:[r=>u(this,null,function*(){n(Fn,r)})]}),new d.DyFM_SocketEvent({eventKey:Mn,tasks:[r=>u(this,null,function*(){n(Mn,r)})]}),new d.DyFM_SocketEvent({eventKey:qn,tasks:[r=>u(this,null,function*(){n(qn,r)})]}),new d.DyFM_SocketEvent({eventKey:xn,tasks:[r=>u(this,null,function*(){n(xn,r)})]}),new d.DyFM_SocketEvent({eventKey:In,tasks:[r=>u(this,null,function*(){n(In,r)})]}),new d.DyFM_SocketEvent({eventKey:jn,tasks:[r=>u(this,null,function*(){n(jn,r)})]}),new d.DyFM_SocketEvent({eventKey:Ln,tasks:[r=>u(this,null,function*(){n(Ln,r)})]}),new d.DyFM_SocketEvent({eventKey:Bn,tasks:[r=>u(this,null,function*(){n(Bn,r)})]}),new d.DyFM_SocketEvent({eventKey:Un,tasks:[r=>u(this,null,function*(){n(Un,r)})]}),new d.DyFM_SocketEvent({eventKey:Kn,tasks:[r=>u(this,null,function*(){n(Kn,r)})]}),new d.DyFM_SocketEvent({eventKey:$n,tasks:[r=>u(this,null,function*(){n($n,r)})]}),new d.DyFM_SocketEvent({eventKey:Vn,tasks:[r=>u(this,null,function*(){n(Vn,r)})]}),new d.DyFM_SocketEvent({eventKey:Wn,tasks:[r=>u(this,null,function*(){n(Wn,r)})]}),new d.DyFM_SocketEvent({eventKey:Hn,tasks:[r=>u(this,null,function*(){n(Hn,r)})]}),new d.DyFM_SocketEvent({eventKey:Yn,tasks:[r=>u(this,null,function*(){n(Yn,r)})]}),new d.DyFM_SocketEvent({eventKey:Xn,tasks:[r=>u(this,null,function*(){n(Xn,r)})]}),new d.DyFM_SocketEvent({eventKey:Jn,tasks:[r=>u(this,null,function*(){n(Jn,r)})]}),new d.DyFM_SocketEvent({eventKey:zn,tasks:[r=>u(this,null,function*(){n(zn,r)})]}),new d.DyFM_SocketEvent({eventKey:Gn,tasks:[r=>u(this,null,function*(){n(Gn,r)})]}),new d.DyFM_SocketEvent({eventKey:Qn,tasks:[r=>u(this,null,function*(){n(Qn,r)})]}),new d.DyFM_SocketEvent({eventKey:sr,tasks:[r=>u(this,null,function*(){n(sr,r)})]}),new d.DyFM_SocketEvent({eventKey:nr,tasks:[r=>u(this,null,function*(){n(nr,r)})]}),new d.DyFM_SocketEvent({eventKey:Zn,tasks:[r=>u(this,null,function*(){n(Zn,r)})]}),new d.DyFM_SocketEvent({eventKey:er,tasks:[r=>u(this,null,function*(){n(er,r)})]}),new d.DyFM_SocketEvent({eventKey:tr,tasks:[r=>u(this,null,function*(){n(tr,r)})]})]}getSubscriptionContent(){return u(this,null,function*(){let t=this.socket?.id;return Promise.resolve({clientId:t})})}shouldReportSocketConnectionErrorsToErrorList(){return this.settingsGeneral_DS.section_$().form.reportSocketConnectionErrorsToErrorList===!0}buildSocketErrorDisplay(t){let n=t.err.message?.trim()?t.err.message:"WebSocket connection failed",r=t.socketUrl.trim()?`WebSocket: ${n} \u2014 ${t.socketUrl}`:`WebSocket: ${n}`,i={message:r,fullMessage:r,name:t.err.name,stack:t.err.stack??null,socketUrl:t.socketUrl,transport:"websocket",eventType:t.eventType,attemptedAt:new Date().toISOString(),connectAttempt:this.connectAttemptCount_$()},o=$.socketUrl!==void 0&&$.socketUrl.trim()!=="";i.socketUrlSource=o?"environment.socketUrl":"same-origin fallback";let c=this.params?.socketOptions?.transports??[];if(c.length>0&&(i.configuredTransports=c.join(", ")),typeof window<"u"&&(i.pageOrigin=window.location.origin),U(t.raw)){let _=t.raw,a=_.description;if(typeof a=="string"&&a.trim())i.description=a.trim();else if(a instanceof Error)i.description=a.message,a.stack&&(i.descriptionStack=a.stack);else if(a instanceof Event)i.description=this.extractDomEventInfo(a);else if(U(a)){let l=a,y=[];typeof l.message=="string"&&l.message.trim()&&y.push(l.message.trim()),typeof l.status=="number"&&(i.httpStatus=l.status,y.push(`HTTP ${l.status}`)),typeof l.statusText=="string"&&l.statusText.trim()&&(i.httpStatusText=l.statusText.trim(),y.push(l.statusText.trim())),typeof l.responseURL=="string"&&l.responseURL.trim()&&(i.responseUrl=l.responseURL.trim()),y.length>0&&(i.description=y.join(" \u2013 "))}typeof _.type=="string"&&_.type.trim()&&(i.type=_.type.trim()),U(_.context)&&(i.errorContext=_.context)}t.raw instanceof Event&&!i.description&&(i.description=this.extractDomEventInfo(t.raw));let h=[r];if(typeof i.description=="string"&&h.push(`Cause: ${i.description}`),typeof i.httpStatus=="number"){let _=typeof i.httpStatusText=="string"?` ${i.httpStatusText}`:"";h.push(`HTTP: ${i.httpStatus}${_}`)}return typeof i.responseUrl=="string"&&h.push(`Response URL: ${i.responseUrl}`),h.push(`Attempt: #${i.connectAttempt}`),h.push(`Source: ${i.socketUrlSource}`),i.fullMessage=h.join(" | "),i}extractDomEventInfo(t){let n=[];n.push(`type=${t.type}`);let r=t.target;return U(r)&&(typeof r.readyState=="number"&&n.push(`readyState=${r.readyState}`),typeof r.url=="string"&&r.url&&n.push(`url=${r.url}`),typeof r.responseURL=="string"&&r.responseURL&&n.push(`responseURL=${r.responseURL}`),typeof r.status=="number"&&n.push(`status=${r.status}`)),n.push("(DOM Event - tipikusan SSL cert reject, CORS, vagy network unreachable)"),n.join(", ")}buildTerminalErrorDisplay(t){let n=typeof t.message=="string"?t.message:String(t.message??""),r=typeof t.code=="string"?t.code:String(t.code??""),i=[n];r&&i.push(`K\xF3d: ${r}`),typeof t.terminalId=="string"&&t.terminalId.trim()&&i.push(`Termin\xE1l ID: ${t.terminalId.trim()}`),typeof t.path=="string"&&t.path.trim()&&i.push(`Path: ${t.path.trim()}`);let o=i.join(`
10
10
  `),c=typeof t.timestamp=="number"?t.timestamp:Date.now();return{source:"server",message:n,stack:null,detailsText:o,timestamp:c}}buildServerErrorDisplay(t){let n=typeof t.message=="string"?t.message:String(t.message??""),r=t.stack,i=typeof r=="string"?r:r!=null?String(r):null,o=typeof t.detailsText=="string"?t.detailsText:JSON.stringify(t,null,2),c=typeof t.timestamp=="number"?t.timestamp:Date.now();return{source:"server",message:n,stack:i,detailsText:o,timestamp:c}}reconnect(){if(this.socket){this.clearConnectionTimeout(),this.status_$.set(j.connecting),this.lastError_$.set(null),this.connectAttemptCount_$.set(0),this.startConnectionTimeout();let t=this.params?.address??dt();C.DyFM_Log.info("CCAP_Socket | Reconnecting to",t),this.socket.disconnect(),this.socket.connect()}}emit(t,n){this.socket?.connected&&this.socket.emit(t,n)}diagnoseConnection(){return u(this,null,function*(){let t=this.params?.address??dt(),n={timestamp:new Date().toISOString(),socketUrl:t,socketUrlSource:$.socketUrl!==void 0&&$.socketUrl.trim()!==""?"environment.socketUrl":"same-origin fallback",pageOrigin:typeof window<"u"?window.location.origin:"",socketConnected:this.socket?.connected??!1,socketId:this.socket?.id??null,connectAttemptCount:this.connectAttemptCount_$(),currentStatus:this.status_$()},r=yield s.probeEndpoint("/api/server/status","serverStatusApi");if(n.serverStatusApi=r,r.ok===!0&&r.body!==void 0){let _=r.body;if(_!==null&&typeof _=="object"){let a=_;n.serverReportedHttpPort=a.httpPort??null,n.serverReportedSocketPort=a.socketPort??null}}let i=this.params?.socketOptions?.path??"/socket",o=`${t}${i}/?EIO=4&transport=polling&t=${Date.now()}`,c=yield s.probeEndpoint(o,"socketIoPolling");n.socketIoPolling=c;let h=n.serverReportedSocketPort;if(typeof h=="number"&&h>0){let _=`http://localhost:${h}${i}/?EIO=4&transport=polling&t=${Date.now()}`,a=yield s.probeEndpoint(_,"socketIoDirectPort");n.socketIoDirectPort=a}return n})}static probeEndpoint(t,n){return u(this,null,function*(){let r={url:t,label:n},i=performance.now();try{let o=yield fetch(t,{method:"GET",cache:"no-store"}),c=Math.round(performance.now()-i);r.ok=o.ok,r.httpStatus=o.status,r.httpStatusText=o.statusText,r.elapsedMs=c;try{let h=yield o.text();try{r.body=JSON.parse(h)}catch{r.bodyPreview=h.substring(0,300)}}catch{r.bodyReadError="Failed to read response body"}}catch(o){let c=Math.round(performance.now()-i);r.elapsedMs=c,r.ok=!1,r.fetchError=o instanceof Error?o.message:String(o),o instanceof TypeError&&(r.fetchErrorType="TypeError (network/CORS/SSL)")}return r})}ngOnDestroy(){this.clearConnectionTimeout(),this.socket&&this.socket.disconnect()}static \u0275fac=function(n){return new(n||s)};static \u0275prov=ds({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();export{pr as a,mt as b,wn as c,j as d,Yc as e};
11
- //# sourceMappingURL=chunk-FVNI46U2.js.map
11
+ //# sourceMappingURL=chunk-ACLAVYA7.js.map
@@ -1,2 +1,2 @@
1
- import{I as c}from"./chunk-5N64HGRY.js";import{C as s,p as n,vb as o,xb as f,y as r}from"./chunk-TBMJSIBB.js";var b=(()=>{class i{baseUrl=`${c.api.baseUrl}/ext-session-message`;http=s(f);getMessages(t){let e=new o;return t.sinceSequence!==void 0&&(e=e.set("sinceSequence",String(t.sinceSequence))),t.beforeSequence!==void 0&&(e=e.set("beforeSequence",String(t.beforeSequence))),t.limit!==void 0&&(e=e.set("limit",String(t.limit))),t.latest&&(e=e.set("latest","1")),n(this.http.get(`${this.baseUrl}/${t.sessionId}/messages`,{params:e}))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=r({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{b as a};
2
- //# sourceMappingURL=chunk-4CXFWMLH.js.map
1
+ import{I as c}from"./chunk-ZJ3DCODZ.js";import{C as s,p as n,vb as o,xb as f,y as r}from"./chunk-TBMJSIBB.js";var b=(()=>{class i{baseUrl=`${c.api.baseUrl}/ext-session-message`;http=s(f);getMessages(t){let e=new o;return t.sinceSequence!==void 0&&(e=e.set("sinceSequence",String(t.sinceSequence))),t.beforeSequence!==void 0&&(e=e.set("beforeSequence",String(t.beforeSequence))),t.limit!==void 0&&(e=e.set("limit",String(t.limit))),t.latest&&(e=e.set("latest","1")),n(this.http.get(`${this.baseUrl}/${t.sessionId}/messages`,{params:e}))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=r({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{b as a};
2
+ //# sourceMappingURL=chunk-ALRGHRMX.js.map
@@ -1,2 +1,2 @@
1
- import{I as p}from"./chunk-5N64HGRY.js";import{C as a,p as r,vb as o,xb as n,y as s}from"./chunk-TBMJSIBB.js";var h=(()=>{class t{baseUrl=`${p.api.baseUrl}/server`;http=a(n);getStatus(){return r(this.http.get(`${this.baseUrl}/status`))}getLiveDevPipelineStatus(i){let e=new o;return i.isPrevious&&(e=e.set("previous","true")),r(this.http.get(`${this.baseUrl}/live-dev-pipeline-status`,{params:e}))}static \u0275fac=function(e){return new(e||t)};static \u0275prov=s({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{h as a};
2
- //# sourceMappingURL=chunk-AQO5IW5B.js.map
1
+ import{I as p}from"./chunk-ZJ3DCODZ.js";import{C as a,p as r,vb as o,xb as n,y as s}from"./chunk-TBMJSIBB.js";var h=(()=>{class t{baseUrl=`${p.api.baseUrl}/server`;http=a(n);getStatus(){return r(this.http.get(`${this.baseUrl}/status`))}getLiveDevPipelineStatus(i){let e=new o;return i.isPrevious&&(e=e.set("previous","true")),r(this.http.get(`${this.baseUrl}/live-dev-pipeline-status`,{params:e}))}static \u0275fac=function(e){return new(e||t)};static \u0275prov=s({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{h as a};
2
+ //# sourceMappingURL=chunk-CJXAN5QP.js.map
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-UHAAQJ2R.js";import{I as c,p as _}from"./chunk-5N64HGRY.js";import{C as a,aa as r,h as u,k as n,p as o,xb as f,y as l}from"./chunk-TBMJSIBB.js";var p=u(_());var $=6e4,y=(()=>{class i{api_AS=a(h);instancePresenceMap_$=r(new Map);intervalHandle=void 0;lastRefreshAt_$=r(null);startPeriodicRefresh(){this.intervalHandle===void 0&&(this.refreshNow(),this.intervalHandle=setInterval(()=>{this.refreshNow()},$))}stopPeriodicRefresh(){this.intervalHandle!==void 0&&(clearInterval(this.intervalHandle),this.intervalHandle=void 0)}refreshNow(){return n(this,null,function*(){try{let t=yield this.api_AS.getPresence(),e=new Map;for(let s of t.list??[])s.instanceKey&&e.set(s.instanceKey,s);this.instancePresenceMap_$.set(e),this.lastRefreshAt_$.set(new Date().toISOString())}catch(t){p.DyFM_Log.warn(`[CCAP] ExS_InstancePresence_DataService refresh failed (non-fatal): ${t instanceof Error?t.message:String(t)}`)}})}getPresence(t){let e=this.instancePresenceMap_$().get(t);return e||{instanceKey:t,presence:"unknown",wsConnected:!1,reason:"presence map not loaded yet"}}ngOnDestroy(){this.stopPeriodicRefresh()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var g=5e3,P=18,v=5e3,L=(()=>{class i{versionInfo_$=r(null);loading_$=r(!1);loadError_$=r(null);lastLoadedAt_$=r(null);triggering_$=r(!1);triggerResult_$=r(null);triggerError_$=r(null);pollingPostUpdate_$=r(!1);triggerSucceeded_$=r(null);triggerTimedOut_$=r(!1);http=a(f);pollTimer=null;loadVersionInfo(){return n(this,null,function*(){this.loading_$.set(!0),this.loadError_$.set(null);try{let t=`${c.api.baseUrl}/server/health/version-info`,e=yield o(this.http.get(t));this.versionInfo_$.set(e),this.lastLoadedAt_$.set(new Date)}catch(t){let e=t instanceof Error?t.message:String(t);this.loadError_$.set(e),this.versionInfo_$.set(null)}finally{this.loading_$.set(!1)}})}triggerUpdate(t){return n(this,null,function*(){this.cancelPostUpdatePolling(),this.triggerSucceeded_$.set(null),this.triggerTimedOut_$.set(!1),this.triggering_$.set(!0),this.triggerError_$.set(null),this.triggerResult_$.set(null);try{let e=`${c.api.baseUrl}/server/health/trigger-update`,s=yield o(this.http.post(e,{force:t===!0}));this.triggerResult_$.set(s),s.status==="started"&&s.currentVersion&&this.startPostUpdatePolling(s.currentVersion)}catch(e){let s=e instanceof Error?e.message:String(e);this.triggerError_$.set(s)}finally{this.triggering_$.set(!1)}})}startPostUpdatePolling(t){this.pollingPostUpdate_$.set(!0);let e=0,s=()=>n(this,null,function*(){e+=1;let d=yield this.pollHealthPid();if(d&&d!==t){this.triggerSucceeded_$.set({oldVersion:t,newVersion:d,detectedAtMs:Date.now()}),this.pollingPostUpdate_$.set(!1),this.pollTimer=null,setTimeout(()=>{typeof window<"u"&&window?.location&&window.location.reload()},v);return}if(e>=P){this.triggerTimedOut_$.set(!0),this.pollingPostUpdate_$.set(!1),this.pollTimer=null;return}this.pollTimer=setTimeout(()=>{s()},g)});this.pollTimer=setTimeout(()=>{s()},g)}cancelPostUpdatePolling(){this.pollTimer&&(clearTimeout(this.pollTimer),this.pollTimer=null),this.pollingPostUpdate_$.set(!1)}pollHealthPid(){return n(this,null,function*(){try{let t=`${c.api.baseUrl}/server/health/pid`,e=yield o(this.http.get(t));return typeof e?.ccapVersion=="string"?e.ccapVersion:null}catch{return null}})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{y as a,L as b};
2
- //# sourceMappingURL=chunk-ORFH2XGX.js.map
1
+ import{a as h}from"./chunk-XDP5GOHT.js";import{I as c,p as _}from"./chunk-ZJ3DCODZ.js";import{C as a,aa as r,h as u,k as n,p as o,xb as f,y as l}from"./chunk-TBMJSIBB.js";var p=u(_());var $=6e4,y=(()=>{class i{api_AS=a(h);instancePresenceMap_$=r(new Map);intervalHandle=void 0;lastRefreshAt_$=r(null);startPeriodicRefresh(){this.intervalHandle===void 0&&(this.refreshNow(),this.intervalHandle=setInterval(()=>{this.refreshNow()},$))}stopPeriodicRefresh(){this.intervalHandle!==void 0&&(clearInterval(this.intervalHandle),this.intervalHandle=void 0)}refreshNow(){return n(this,null,function*(){try{let t=yield this.api_AS.getPresence(),e=new Map;for(let s of t.list??[])s.instanceKey&&e.set(s.instanceKey,s);this.instancePresenceMap_$.set(e),this.lastRefreshAt_$.set(new Date().toISOString())}catch(t){p.DyFM_Log.warn(`[CCAP] ExS_InstancePresence_DataService refresh failed (non-fatal): ${t instanceof Error?t.message:String(t)}`)}})}getPresence(t){let e=this.instancePresenceMap_$().get(t);return e||{instanceKey:t,presence:"unknown",wsConnected:!1,reason:"presence map not loaded yet"}}ngOnDestroy(){this.stopPeriodicRefresh()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var g=5e3,P=18,v=5e3,L=(()=>{class i{versionInfo_$=r(null);loading_$=r(!1);loadError_$=r(null);lastLoadedAt_$=r(null);triggering_$=r(!1);triggerResult_$=r(null);triggerError_$=r(null);pollingPostUpdate_$=r(!1);triggerSucceeded_$=r(null);triggerTimedOut_$=r(!1);http=a(f);pollTimer=null;loadVersionInfo(){return n(this,null,function*(){this.loading_$.set(!0),this.loadError_$.set(null);try{let t=`${c.api.baseUrl}/server/health/version-info`,e=yield o(this.http.get(t));this.versionInfo_$.set(e),this.lastLoadedAt_$.set(new Date)}catch(t){let e=t instanceof Error?t.message:String(t);this.loadError_$.set(e),this.versionInfo_$.set(null)}finally{this.loading_$.set(!1)}})}triggerUpdate(t){return n(this,null,function*(){this.cancelPostUpdatePolling(),this.triggerSucceeded_$.set(null),this.triggerTimedOut_$.set(!1),this.triggering_$.set(!0),this.triggerError_$.set(null),this.triggerResult_$.set(null);try{let e=`${c.api.baseUrl}/server/health/trigger-update`,s=yield o(this.http.post(e,{force:t===!0}));this.triggerResult_$.set(s),s.status==="started"&&s.currentVersion&&this.startPostUpdatePolling(s.currentVersion)}catch(e){let s=e instanceof Error?e.message:String(e);this.triggerError_$.set(s)}finally{this.triggering_$.set(!1)}})}startPostUpdatePolling(t){this.pollingPostUpdate_$.set(!0);let e=0,s=()=>n(this,null,function*(){e+=1;let d=yield this.pollHealthPid();if(d&&d!==t){this.triggerSucceeded_$.set({oldVersion:t,newVersion:d,detectedAtMs:Date.now()}),this.pollingPostUpdate_$.set(!1),this.pollTimer=null,setTimeout(()=>{typeof window<"u"&&window?.location&&window.location.reload()},v);return}if(e>=P){this.triggerTimedOut_$.set(!0),this.pollingPostUpdate_$.set(!1),this.pollTimer=null;return}this.pollTimer=setTimeout(()=>{s()},g)});this.pollTimer=setTimeout(()=>{s()},g)}cancelPostUpdatePolling(){this.pollTimer&&(clearTimeout(this.pollTimer),this.pollTimer=null),this.pollingPostUpdate_$.set(!1)}pollHealthPid(){return n(this,null,function*(){try{let t=`${c.api.baseUrl}/server/health/pid`,e=yield o(this.http.get(t));return typeof e?.ccapVersion=="string"?e.ccapVersion:null}catch{return null}})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{y as a,L as b};
2
+ //# sourceMappingURL=chunk-CK4L2E6A.js.map
@@ -1,2 +1,2 @@
1
- import{a as M}from"./chunk-GH67BJ7J.js";import{a as z,b as K}from"./chunk-DPGBOTN3.js";import{b as N,c as U}from"./chunk-4WGQS2HA.js";import{e as H}from"./chunk-FVNI46U2.js";import{a as P}from"./chunk-FLAJXIYW.js";import{a as k}from"./chunk-5UPNU54P.js";import{j as O}from"./chunk-WXN5C3BS.js";import{I as L,p as Y}from"./chunk-5N64HGRY.js";import{$a as b,C as m,D as w,Fa as a,Ga as A,Ha as u,T as R,Ta as T,U as f,Z as s,aa as C,ab as g,da as x,ga as _,h as G,hb as $,k as h,la as c,mb as F,na as q,oa as v,p as S,pa as I,qa as r,ra as n,ub as Q,va as D,wa as d,xb as j,y}from"./chunk-TBMJSIBB.js";var J=(t,o)=>o._id;function Z(t,o){t&1&&(r(0,"div",1),a(1,"Nincs kiv\xE1lasztott session."),n())}function ee(t,o){t&1&&(r(0,"div",1),a(1," Ehhez a sessionh\xF6z nincs akt\xEDv schedule job. "),n())}function te(t,o){t&1&&(r(0,"span",7),a(1,"paused"),n())}function ie(t,o){t&1&&(r(0,"span",8),a(1,"disabled"),n())}function ne(t,o){t&1&&(r(0,"span",9),a(1,"dry-run"),n())}function oe(t,o){if(t&1&&(r(0,"div",10),a(1),n()),t&2){let e=d().$implicit;s(),A(e.description)}}function se(t,o){if(t&1&&(r(0,"span")(1,"span",15),a(2,"tz:"),n(),a(3),n()),t&2){let e=d().$implicit;s(3),u(" ",e.timezone,"")}}function ae(t,o){if(t&1&&(r(0,"span",12),b(1,"sAbsoluteTime"),r(2,"span",15),a(3,"next:"),n(),a(4),b(5,"sTimeAgo"),n()),t&2){let e=d().$implicit;_("title",g(1,2,e.nextDueAt)),s(4),u(" ",g(5,4,e.nextDueAt),"")}}function re(t,o){if(t&1&&(r(0,"span",12),b(1,"sAbsoluteTime"),r(2,"span",15),a(3,"last:"),n(),a(4),b(5,"sTimeAgo"),n()),t&2){let e=d().$implicit;_("title",g(1,2,e.lastTriggeredAt)),s(4),u(" ",g(5,4,e.lastTriggeredAt),"")}}function le(t,o){if(t&1&&(r(0,"span",16),a(1),n()),t&2){let e=o.$implicit,i=d(4);_("ngClass",i.getStatusColorClass(e.status))("title",(e.scheduledAt||"\u2014")+" \u2014 "+(e.status||"\u2014")+(e.skipReason?" ("+e.skipReason+")":"")+(e.errorDetails!=null&&e.errorDetails.message?": "+e.errorDetails.message:"")),s(),u(" ",i.getStatusLabel(e.status)," ")}}function de(t,o){if(t&1&&(r(0,"div",13),v(1,le,2,3,"span",16,J),n()),t&2){let e=d().$implicit,i=d(2);s(),I(i.getRecentExecutionsForJob(e._id))}}function ue(t,o){t&1&&(r(0,"div",14),a(1,"M\xE9g nem volt execution."),n())}function ce(t,o){if(t&1&&(r(0,"div",3)(1,"div",4)(2,"span",5),a(3),n(),r(4,"span",6),a(5),b(6,"schSchedulePresetLabel"),n(),x(7,te,2,0,"span",7)(8,ie,2,0,"span",8)(9,ne,2,0,"span",9),n(),x(10,oe,2,1,"div",10),r(11,"div",11),x(12,se,4,1,"span")(13,ae,6,6,"span",12)(14,re,6,6,"span",12),n(),x(15,de,3,0,"div",13)(16,ue,2,0,"div",14),n()),t&2){let e=o.$implicit,i=d(2);s(3),u(" ",e.name||e._id," "),s(2),u(" ",g(6,10,e.schedule)," "),s(2),c(e.paused?7:-1),s(),c(e.enabled===!1?8:-1),s(),c(e.dryRun?9:-1),s(),c(e.description?10:-1),s(2),c(e.timezone?12:-1),s(),c(e.nextDueAt?13:-1),s(),c(e.lastTriggeredAt?14:-1),s(),c(i.getRecentExecutionsForJob(e._id).length>0?15:16)}}function pe(t,o){if(t&1&&(r(0,"div",2),v(1,ce,17,12,"div",3,J),n()),t&2){let e=d();s(),I(e.jobsForSession_$())}}var Be=(()=>{class t{sessionId=f.required();isOpen=f.required();closed=R();jobs_DS=m(z);jobsForSession_$=$(()=>{let e=this.sessionId();return e?this.jobs_DS.jobs_$().filter(i=>i.target?.payload?.sessionId===e):[]});executionsByJob_$=$(()=>this.jobs_DS.recentExecutions_$());ngOnInit(){this.jobs_DS.jobs_$().length===0&&this.jobs_DS.loadAll()}getRecentExecutionsForJob(e){return e?(this.executionsByJob_$().get(e)??[]).slice(0,5):[]}getStatusColorClass(e){switch(e){case"completed":return"bg-green-500/20 text-green-400";case"triggered":return"bg-blue-500/20 text-blue-400";case"skipped":return"bg-yellow-500/20 text-yellow-400";case"failed":return"bg-red-500/20 text-red-400";case"cancelled":return"bg-neutral-500/20 text-neutral-400";case"dry-run":return"bg-purple-500/20 text-purple-400";default:return"bg-neutral-700/30 text-neutral-300"}}getStatusLabel(e){switch(e){case"completed":return"OK";case"triggered":return"RUN";case"skipped":return"SKP";case"failed":return"FAIL";case"cancelled":return"CNL";case"dry-run":return"DRY";default:return e??"\u2014"}}handleClose(){this.closed.emit()}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=w({type:t,selectors:[["app-sch-schedule-popup"]],inputs:{sessionId:[1,"sessionId"],isOpen:[1,"isOpen"]},outputs:{closed:"closed"},standalone:!0,features:[T],decls:4,vars:6,consts:[[3,"closed","isOpen","title","maxWidth","bodyFlexColumn","headerBorderClass"],[1,"p-4","text-center","text-neutral-500","text-sm"],[1,"flex-1","overflow-y-auto","space-y-3","pr-1"],[1,"border","border-neutral-700/60","rounded-md","p-2.5","bg-neutral-900/40"],[1,"flex","items-center","gap-2","mb-1.5"],[1,"text-sm","font-medium","text-neutral-200","truncate"],[1,"text-[10px]","text-neutral-400"],[1,"text-[10px]","px-1","rounded","bg-yellow-500/20","text-yellow-400"],[1,"text-[10px]","px-1","rounded","bg-neutral-500/20","text-neutral-400"],[1,"text-[10px]","px-1","rounded","bg-purple-500/20","text-purple-400"],[1,"text-[11px]","text-neutral-400","mb-1.5","truncate"],[1,"flex","flex-wrap","gap-x-3","gap-y-0.5","text-[10px]","text-neutral-500","mb-2"],[3,"title"],[1,"flex","flex-wrap","gap-1"],[1,"text-[10px]","text-neutral-500"],[1,"text-neutral-600"],[1,"text-[10px]","px-1.5","py-0.5","rounded","font-mono",3,"ngClass","title"]],template:function(i,l){i&1&&(r(0,"app-s-modal",0),D("closed",function(){return l.handleClose()}),x(1,Z,2,0,"div",1)(2,ee,2,0,"div",1)(3,pe,3,0,"div",2),n()),i&2&&(_("isOpen",l.isOpen())("title","Schedule inf\xF3k ehhez a session-h\xF6z")("maxWidth","lg")("bodyFlexColumn",!0)("headerBorderClass","border-neonCyan/50"),s(),c(l.sessionId()?l.jobsForSession_$().length===0?2:3:1))},dependencies:[Q,F,P,N,U,K],encapsulation:2})}return t})();var _e=(t,o)=>o._id;function me(t,o){t&1&&(r(0,"div",1),a(1,"Nincs kiv\xE1lasztott session."),n())}function xe(t,o){t&1&&(r(0,"div",1),a(1," Ehhez a sessionh\xF6z nincs koordin\xE1tor. "),n())}function he(t,o){if(t&1&&(r(0,"span")(1,"span",9),a(2,"provider:"),n(),a(3),n()),t&2){let e=d().$implicit;s(3),u(" ",e.providerName,"")}}function Se(t,o){if(t&1&&(r(0,"span")(1,"span",9),a(2,"model:"),n(),a(3),n()),t&2){let e=d().$implicit;s(3),u(" ",e.model,"")}}function fe(t,o){if(t&1&&(r(0,"span")(1,"span",9),a(2,"project:"),n(),a(3),n()),t&2){let e=d().$implicit;s(3),u(" ",e.projectId,"")}}function Ce(t,o){if(t&1&&(r(0,"div",10)(1,"span",9),a(2,"paused:"),n(),a(3),n()),t&2){let e=d().$implicit;_("title",e.pauseReason),s(3),u(" ",e.pauseReason," ")}}function ve(t,o){if(t&1&&(r(0,"div",11)(1,"span",9),a(2,"last:"),n(),a(3),n()),t&2){let e=d().$implicit;_("title",e.lastResponseSummary),s(3),u(" ",e.lastResponseSummary," ")}}function Ie(t,o){if(t&1&&(r(0,"span",13),a(1),n()),t&2){let e=o.$implicit;_("title",e),s(),u(" blocker: ",e," ")}}function be(t,o){if(t&1&&(r(0,"div",12),v(1,Ie,2,2,"span",13,q),n()),t&2){let e=d().$implicit;s(),I(e.blockers)}}function ge(t,o){if(t&1&&(r(0,"div",3)(1,"div",4)(2,"span",5),a(3),n(),r(4,"span",6),a(5),n()(),r(6,"div",7),x(7,he,4,1,"span")(8,Se,4,1,"span")(9,fe,4,1,"span"),n(),r(10,"div",8)(11,"span",9),a(12,"phase:"),n(),a(13),r(14,"span",9),a(15,"\xB7"),n(),r(16,"span",9),a(17,"phase-step:"),n(),a(18),r(19,"span",9),a(20,"\xB7"),n(),r(21,"span",9),a(22,"total:"),n(),a(23),n(),x(24,Ce,4,2,"div",10)(25,ve,4,2,"div",11)(26,be,3,0,"div",12),n()),t&2){let e=o.$implicit,i=d(2);s(3),u(" ",e.workflowId||e._id," "),s(),_("ngClass",i.getStatusColorClass(e.status)),s(),u(" ",e.status||"\u2014"," "),s(2),c(e.providerName?7:-1),s(),c(e.model?8:-1),s(),c(e.projectId?9:-1),s(4),u(" ",e.currentPhaseIndex," "),s(5),u(" ",e.currentPhaseStepCount," "),s(5),u(" ",e.totalStepCount," "),s(),c(e.pauseReason?24:-1),s(),c(e.lastResponseSummary?25:-1),s(),c(e.blockers&&e.blockers.length>0?26:-1)}}function Ee(t,o){if(t&1&&(r(0,"div",2),v(1,ge,27,12,"div",3,_e),n()),t&2){let e=d();s(),I(e.coordinatorsForSession_$())}}var Ne=(()=>{class t{sessionId=f.required();isOpen=f.required();closed=R();coordinator_DS=m(M);coordinatorsForSession_$=$(()=>{let e=this.sessionId();return e?this.coordinator_DS.globalCoordinatorsList_$().filter(i=>i.sessionId===e):[]});ngOnInit(){this.coordinator_DS.globalCoordinatorsList_$().length===0&&this.coordinator_DS.loadAllCoordinatorsForManagementPage()}getStatusColorClass(e){switch((e??"").trim().toLowerCase()){case"active":return"bg-green-500/20 text-green-400";case"running":return"bg-green-500/20 text-green-400";case"paused":return"bg-yellow-500/20 text-yellow-400";case"idle":return"bg-blue-500/20 text-blue-400";case"stopped":return"bg-neutral-500/20 text-neutral-400";case"completed":return"bg-neutral-600/20 text-neutral-400";case"failed":return"bg-red-500/20 text-red-400";default:return"bg-neutral-700/30 text-neutral-300"}}handleClose(){this.closed.emit()}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=w({type:t,selectors:[["app-crd-info-popup"]],inputs:{sessionId:[1,"sessionId"],isOpen:[1,"isOpen"]},outputs:{closed:"closed"},standalone:!0,features:[T],decls:4,vars:6,consts:[[3,"closed","isOpen","title","maxWidth","bodyFlexColumn","headerBorderClass"],[1,"p-4","text-center","text-neutral-500","text-sm"],[1,"flex-1","overflow-y-auto","space-y-3","pr-1"],[1,"border","border-neutral-700/60","rounded-md","p-2.5","bg-neutral-900/40"],[1,"flex","items-center","gap-2","mb-1.5"],[1,"text-sm","font-medium","text-neutral-200","truncate"],[1,"text-[10px]","px-1.5","py-0.5","rounded","font-mono",3,"ngClass"],[1,"flex","flex-wrap","gap-x-3","gap-y-0.5","text-[10px]","text-neutral-500","mb-2"],[1,"text-[11px]","text-neutral-400","mb-1.5"],[1,"text-neutral-600"],[1,"text-[11px]","text-yellow-400/80","mb-1.5","truncate",3,"title"],[1,"text-[11px]","text-neutral-400","mb-1.5","line-clamp-2",3,"title"],[1,"flex","flex-wrap","gap-1","mt-1"],[1,"text-[10px]","px-1.5","py-0.5","rounded","bg-red-500/15","text-red-400","truncate","max-w-full",3,"title"]],template:function(i,l){i&1&&(r(0,"app-s-modal",0),D("closed",function(){return l.handleClose()}),x(1,me,2,0,"div",1)(2,xe,2,0,"div",1)(3,Ee,3,0,"div",2),n()),i&2&&(_("isOpen",l.isOpen())("title","Koordin\xE1tor inf\xF3k ehhez a session-h\xF6z")("maxWidth","lg")("bodyFlexColumn",!0)("headerBorderClass","border-neonAmber/50"),s(),c(l.sessionId()?l.coordinatorsForSession_$().length===0?2:3:1))},dependencies:[Q,F,P],encapsulation:2})}return t})();var W=(()=>{class t{apiBase=L.api.baseUrl;http=m(j);getQueue(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}?_t=${Date.now()}`;return S(this.http.get(i))}editItem(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}/${e.queueItemId}`;return S(this.http.patch(i,{text:e.text}))}removeItem(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}/${e.queueItemId}`;return S(this.http.delete(i))}sendNow(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}/${e.queueItemId}/send-now`;return S(this.http.post(i,{}))}reorderItem(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}/${e.queueItemId}/reorder`;return S(this.http.post(i,{direction:e.direction}))}lockQueue(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}/lock`;return S(this.http.post(i,{}))}unlockQueue(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}/unlock`;return S(this.http.post(i,{}))}buildUrl(e,i){return`${this.apiBase}/${e}-queue/${i}`}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var p=G(Y());var $e="session-queue:updated",ye="session-queue:lock-changed",tt=(()=>{class t{sessionQueue_AS=m(W);socket_CS=m(H);globalError_CS=m(O);eventSubscription=null;reconnectSubscription=null;activeSessionId="";activeBaseRoute="";queueSnapshot_$=C(null);isLocked_$=C(!1);editingItemId_$=C(null);editingText_$=C("");items_$=C([]);constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(e=>{this.handleSocketEvent(e)}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(e=>{e&&this.activeSessionId&&(p.DyFM_Log.info(`ExS_Queue_DS | Socket reconnected, reloading queue | session: ${this.activeSessionId}`),this.loadQueue())})}ngOnDestroy(){this.eventSubscription?.unsubscribe(),this.eventSubscription=null,this.reconnectSubscription?.unsubscribe(),this.reconnectSubscription=null}subscribeToSession(e){this.activeSessionId=e.sessionId,this.activeBaseRoute=e.baseRoute,p.DyFM_Log.info(`ExS_Queue_DS | subscribeToSession | session: ${e.sessionId} | baseRoute: ${e.baseRoute}`),this.loadQueue()}unsubscribe(){this.activeSessionId="",this.activeBaseRoute="",this.queueSnapshot_$.set(null),this.items_$.set([]),this.isLocked_$.set(!1),this.editingItemId_$.set(null),this.editingText_$.set("")}startEditing(e){return h(this,null,function*(){if(!this.activeSessionId||!this.activeBaseRoute)return;if(!this.isItemInCurrentSnapshot(e)){p.DyFM_Log.info(`ExS_Queue_DS | startEditing \u2014 stale item, reloading | queueItemId: ${e}`),yield this.loadQueue();return}try{yield this.sessionQueue_AS.lockQueue({baseRoute:this.activeBaseRoute,sessionId:this.activeSessionId})}catch{return}let i=this.items_$().find(l=>l.queueItemId===e);this.isLocked_$.set(!0),this.editingItemId_$.set(e),this.editingText_$.set(i?.text??"")})}saveEdit(){return h(this,null,function*(){let e=this.editingItemId_$();if(!(!e||!this.activeSessionId||!this.activeBaseRoute)){try{if((yield this.sessionQueue_AS.editItem({baseRoute:this.activeBaseRoute,sessionId:this.activeSessionId,queueItemId:e,text:this.editingText_$()})).item===null){this.globalError_CS.showError(new Error("Queue item not found \u2014 it may have been delivered while editing"),"session-queue-edit"),yield this.finishEditing(),yield this.loadQueue();return}}catch(i){this.globalError_CS.showError(i,"session-queue-edit-save");return}yield this.finishEditing()}})}cancelEdit(){return h(this,null,function*(){yield this.finishEditing()})}removeItem(e){return h(this,null,function*(){if(!(!this.activeSessionId||!this.activeBaseRoute)){if(!this.isItemInCurrentSnapshot(e)){p.DyFM_Log.info(`ExS_Queue_DS | removeItem \u2014 stale item, reloading | queueItemId: ${e}`),yield this.loadQueue();return}try{(yield this.sessionQueue_AS.removeItem({baseRoute:this.activeBaseRoute,sessionId:this.activeSessionId,queueItemId:e})).success===!1&&(p.DyFM_Log.info(`ExS_Queue_DS | removeItem \u2014 server: item not found, reloading | queueItemId: ${e}`),yield this.loadQueue())}catch{yield this.loadQueue()}}})}sendNow(e){return h(this,null,function*(){if(!(!this.activeSessionId||!this.activeBaseRoute)){if(!this.isItemInCurrentSnapshot(e)){p.DyFM_Log.info(`ExS_Queue_DS | sendNow \u2014 stale item, reloading | queueItemId: ${e}`),yield this.loadQueue();return}try{let i=yield this.sessionQueue_AS.sendNow({baseRoute:this.activeBaseRoute,sessionId:this.activeSessionId,queueItemId:e});if(i.success===!1){let l=typeof i.reason=="string"?i.reason:"unknown";l==="Item not found in queue"?p.DyFM_Log.info(`ExS_Queue_DS | sendNow \u2014 server: item already delivered, reloading | queueItemId: ${e}`):this.globalError_CS.showError(new Error(`Send-now delivery failed: ${l}`),"session-queue-send-now"),yield this.loadQueue()}}catch{yield this.loadQueue()}}})}reorderItem(e){return h(this,null,function*(){if(!(!this.activeSessionId||!this.activeBaseRoute)){if(!this.isItemInCurrentSnapshot(e.queueItemId)){p.DyFM_Log.info(`ExS_Queue_DS | reorderItem \u2014 stale item, reloading | queueItemId: ${e.queueItemId}`),yield this.loadQueue();return}try{(yield this.sessionQueue_AS.reorderItem({baseRoute:this.activeBaseRoute,sessionId:this.activeSessionId,queueItemId:e.queueItemId,direction:e.direction})).success===!1&&(p.DyFM_Log.info(`ExS_Queue_DS | reorderItem \u2014 server: item not found, reloading | queueItemId: ${e.queueItemId}`),yield this.loadQueue())}catch{yield this.loadQueue()}}})}isItemInCurrentSnapshot(e){return this.items_$().some(i=>i.queueItemId===e)}loadQueue(){return h(this,null,function*(){let e=this.activeSessionId,i=this.activeBaseRoute;if(!(!e||!i))try{let l=yield this.sessionQueue_AS.getQueue({baseRoute:i,sessionId:e});if(this.activeSessionId!==e){p.DyFM_Log.info(`ExS_Queue_DS | loadQueue result discarded (session changed) | requested: ${e} | current: ${this.activeSessionId}`);return}let E=l?.queue?.items?.length??0;p.DyFM_Log.info(`ExS_Queue_DS | loadQueue OK | session: ${e} | items: ${E}`),this.applySnapshot(l.queue)}catch(l){if(this.activeSessionId!==e)return;p.DyFM_Log.warn(`ExS_Queue_DS | loadQueue FAILED | session: ${e} | baseRoute: ${i} | error: ${l instanceof Error?l.message:String(l)}`),this.queueSnapshot_$.set(null),this.items_$.set([])}})}applySnapshot(e){this.queueSnapshot_$.set(e),this.items_$.set(e.items??[]),this.isLocked_$.set(e.isLocked)}finishEditing(){return h(this,null,function*(){if(this.editingItemId_$.set(null),this.editingText_$.set(""),this.isLocked_$.set(!1),!(!this.activeSessionId||!this.activeBaseRoute))try{yield this.sessionQueue_AS.unlockQueue({baseRoute:this.activeBaseRoute,sessionId:this.activeSessionId})}catch(e){this.globalError_CS.showError(e,"session-queue-unlock")}})}handleSocketEvent(e){let i=e.payload;if((typeof i.sessionId=="string"?i.sessionId:"")===this.activeSessionId&&(e.event===$e&&this.applySnapshot(i),e.event===ye)){let E=typeof i.isLocked=="boolean"?i.isLocked:!1;this.isLocked_$.set(E)}}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var V=class{static saveDraft(o,e,i){!o||!e||k.writeString(`${o}:promptDraft:${e}`,i)}static loadDraft(o,e){return!o||!e?"":k.readString(`${o}:promptDraft:${e}`)??""}static clearDraft(o,e){!o||!e||k.remove(`${o}:promptDraft:${e}`)}};export{Be as a,Ne as b,tt as c,V as d};
2
- //# sourceMappingURL=chunk-EP3IAFIL.js.map
1
+ import{a as M}from"./chunk-CROOTWQ4.js";import{a as z,b as K}from"./chunk-LP2E4KMW.js";import{b as N,c as U}from"./chunk-XC26T3JJ.js";import{e as H}from"./chunk-ACLAVYA7.js";import{a as P}from"./chunk-FLAJXIYW.js";import{a as k}from"./chunk-5UPNU54P.js";import{j as O}from"./chunk-66YFYBOC.js";import{I as L,p as Y}from"./chunk-ZJ3DCODZ.js";import{$a as b,C as m,D as w,Fa as a,Ga as A,Ha as u,T as R,Ta as T,U as f,Z as s,aa as C,ab as g,da as x,ga as _,h as G,hb as $,k as h,la as c,mb as F,na as q,oa as v,p as S,pa as I,qa as r,ra as n,ub as Q,va as D,wa as d,xb as j,y}from"./chunk-TBMJSIBB.js";var J=(t,o)=>o._id;function Z(t,o){t&1&&(r(0,"div",1),a(1,"Nincs kiv\xE1lasztott session."),n())}function ee(t,o){t&1&&(r(0,"div",1),a(1," Ehhez a sessionh\xF6z nincs akt\xEDv schedule job. "),n())}function te(t,o){t&1&&(r(0,"span",7),a(1,"paused"),n())}function ie(t,o){t&1&&(r(0,"span",8),a(1,"disabled"),n())}function ne(t,o){t&1&&(r(0,"span",9),a(1,"dry-run"),n())}function oe(t,o){if(t&1&&(r(0,"div",10),a(1),n()),t&2){let e=d().$implicit;s(),A(e.description)}}function se(t,o){if(t&1&&(r(0,"span")(1,"span",15),a(2,"tz:"),n(),a(3),n()),t&2){let e=d().$implicit;s(3),u(" ",e.timezone,"")}}function ae(t,o){if(t&1&&(r(0,"span",12),b(1,"sAbsoluteTime"),r(2,"span",15),a(3,"next:"),n(),a(4),b(5,"sTimeAgo"),n()),t&2){let e=d().$implicit;_("title",g(1,2,e.nextDueAt)),s(4),u(" ",g(5,4,e.nextDueAt),"")}}function re(t,o){if(t&1&&(r(0,"span",12),b(1,"sAbsoluteTime"),r(2,"span",15),a(3,"last:"),n(),a(4),b(5,"sTimeAgo"),n()),t&2){let e=d().$implicit;_("title",g(1,2,e.lastTriggeredAt)),s(4),u(" ",g(5,4,e.lastTriggeredAt),"")}}function le(t,o){if(t&1&&(r(0,"span",16),a(1),n()),t&2){let e=o.$implicit,i=d(4);_("ngClass",i.getStatusColorClass(e.status))("title",(e.scheduledAt||"\u2014")+" \u2014 "+(e.status||"\u2014")+(e.skipReason?" ("+e.skipReason+")":"")+(e.errorDetails!=null&&e.errorDetails.message?": "+e.errorDetails.message:"")),s(),u(" ",i.getStatusLabel(e.status)," ")}}function de(t,o){if(t&1&&(r(0,"div",13),v(1,le,2,3,"span",16,J),n()),t&2){let e=d().$implicit,i=d(2);s(),I(i.getRecentExecutionsForJob(e._id))}}function ue(t,o){t&1&&(r(0,"div",14),a(1,"M\xE9g nem volt execution."),n())}function ce(t,o){if(t&1&&(r(0,"div",3)(1,"div",4)(2,"span",5),a(3),n(),r(4,"span",6),a(5),b(6,"schSchedulePresetLabel"),n(),x(7,te,2,0,"span",7)(8,ie,2,0,"span",8)(9,ne,2,0,"span",9),n(),x(10,oe,2,1,"div",10),r(11,"div",11),x(12,se,4,1,"span")(13,ae,6,6,"span",12)(14,re,6,6,"span",12),n(),x(15,de,3,0,"div",13)(16,ue,2,0,"div",14),n()),t&2){let e=o.$implicit,i=d(2);s(3),u(" ",e.name||e._id," "),s(2),u(" ",g(6,10,e.schedule)," "),s(2),c(e.paused?7:-1),s(),c(e.enabled===!1?8:-1),s(),c(e.dryRun?9:-1),s(),c(e.description?10:-1),s(2),c(e.timezone?12:-1),s(),c(e.nextDueAt?13:-1),s(),c(e.lastTriggeredAt?14:-1),s(),c(i.getRecentExecutionsForJob(e._id).length>0?15:16)}}function pe(t,o){if(t&1&&(r(0,"div",2),v(1,ce,17,12,"div",3,J),n()),t&2){let e=d();s(),I(e.jobsForSession_$())}}var Be=(()=>{class t{sessionId=f.required();isOpen=f.required();closed=R();jobs_DS=m(z);jobsForSession_$=$(()=>{let e=this.sessionId();return e?this.jobs_DS.jobs_$().filter(i=>i.target?.payload?.sessionId===e):[]});executionsByJob_$=$(()=>this.jobs_DS.recentExecutions_$());ngOnInit(){this.jobs_DS.jobs_$().length===0&&this.jobs_DS.loadAll()}getRecentExecutionsForJob(e){return e?(this.executionsByJob_$().get(e)??[]).slice(0,5):[]}getStatusColorClass(e){switch(e){case"completed":return"bg-green-500/20 text-green-400";case"triggered":return"bg-blue-500/20 text-blue-400";case"skipped":return"bg-yellow-500/20 text-yellow-400";case"failed":return"bg-red-500/20 text-red-400";case"cancelled":return"bg-neutral-500/20 text-neutral-400";case"dry-run":return"bg-purple-500/20 text-purple-400";default:return"bg-neutral-700/30 text-neutral-300"}}getStatusLabel(e){switch(e){case"completed":return"OK";case"triggered":return"RUN";case"skipped":return"SKP";case"failed":return"FAIL";case"cancelled":return"CNL";case"dry-run":return"DRY";default:return e??"\u2014"}}handleClose(){this.closed.emit()}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=w({type:t,selectors:[["app-sch-schedule-popup"]],inputs:{sessionId:[1,"sessionId"],isOpen:[1,"isOpen"]},outputs:{closed:"closed"},standalone:!0,features:[T],decls:4,vars:6,consts:[[3,"closed","isOpen","title","maxWidth","bodyFlexColumn","headerBorderClass"],[1,"p-4","text-center","text-neutral-500","text-sm"],[1,"flex-1","overflow-y-auto","space-y-3","pr-1"],[1,"border","border-neutral-700/60","rounded-md","p-2.5","bg-neutral-900/40"],[1,"flex","items-center","gap-2","mb-1.5"],[1,"text-sm","font-medium","text-neutral-200","truncate"],[1,"text-[10px]","text-neutral-400"],[1,"text-[10px]","px-1","rounded","bg-yellow-500/20","text-yellow-400"],[1,"text-[10px]","px-1","rounded","bg-neutral-500/20","text-neutral-400"],[1,"text-[10px]","px-1","rounded","bg-purple-500/20","text-purple-400"],[1,"text-[11px]","text-neutral-400","mb-1.5","truncate"],[1,"flex","flex-wrap","gap-x-3","gap-y-0.5","text-[10px]","text-neutral-500","mb-2"],[3,"title"],[1,"flex","flex-wrap","gap-1"],[1,"text-[10px]","text-neutral-500"],[1,"text-neutral-600"],[1,"text-[10px]","px-1.5","py-0.5","rounded","font-mono",3,"ngClass","title"]],template:function(i,l){i&1&&(r(0,"app-s-modal",0),D("closed",function(){return l.handleClose()}),x(1,Z,2,0,"div",1)(2,ee,2,0,"div",1)(3,pe,3,0,"div",2),n()),i&2&&(_("isOpen",l.isOpen())("title","Schedule inf\xF3k ehhez a session-h\xF6z")("maxWidth","lg")("bodyFlexColumn",!0)("headerBorderClass","border-neonCyan/50"),s(),c(l.sessionId()?l.jobsForSession_$().length===0?2:3:1))},dependencies:[Q,F,P,N,U,K],encapsulation:2})}return t})();var _e=(t,o)=>o._id;function me(t,o){t&1&&(r(0,"div",1),a(1,"Nincs kiv\xE1lasztott session."),n())}function xe(t,o){t&1&&(r(0,"div",1),a(1," Ehhez a sessionh\xF6z nincs koordin\xE1tor. "),n())}function he(t,o){if(t&1&&(r(0,"span")(1,"span",9),a(2,"provider:"),n(),a(3),n()),t&2){let e=d().$implicit;s(3),u(" ",e.providerName,"")}}function Se(t,o){if(t&1&&(r(0,"span")(1,"span",9),a(2,"model:"),n(),a(3),n()),t&2){let e=d().$implicit;s(3),u(" ",e.model,"")}}function fe(t,o){if(t&1&&(r(0,"span")(1,"span",9),a(2,"project:"),n(),a(3),n()),t&2){let e=d().$implicit;s(3),u(" ",e.projectId,"")}}function Ce(t,o){if(t&1&&(r(0,"div",10)(1,"span",9),a(2,"paused:"),n(),a(3),n()),t&2){let e=d().$implicit;_("title",e.pauseReason),s(3),u(" ",e.pauseReason," ")}}function ve(t,o){if(t&1&&(r(0,"div",11)(1,"span",9),a(2,"last:"),n(),a(3),n()),t&2){let e=d().$implicit;_("title",e.lastResponseSummary),s(3),u(" ",e.lastResponseSummary," ")}}function Ie(t,o){if(t&1&&(r(0,"span",13),a(1),n()),t&2){let e=o.$implicit;_("title",e),s(),u(" blocker: ",e," ")}}function be(t,o){if(t&1&&(r(0,"div",12),v(1,Ie,2,2,"span",13,q),n()),t&2){let e=d().$implicit;s(),I(e.blockers)}}function ge(t,o){if(t&1&&(r(0,"div",3)(1,"div",4)(2,"span",5),a(3),n(),r(4,"span",6),a(5),n()(),r(6,"div",7),x(7,he,4,1,"span")(8,Se,4,1,"span")(9,fe,4,1,"span"),n(),r(10,"div",8)(11,"span",9),a(12,"phase:"),n(),a(13),r(14,"span",9),a(15,"\xB7"),n(),r(16,"span",9),a(17,"phase-step:"),n(),a(18),r(19,"span",9),a(20,"\xB7"),n(),r(21,"span",9),a(22,"total:"),n(),a(23),n(),x(24,Ce,4,2,"div",10)(25,ve,4,2,"div",11)(26,be,3,0,"div",12),n()),t&2){let e=o.$implicit,i=d(2);s(3),u(" ",e.workflowId||e._id," "),s(),_("ngClass",i.getStatusColorClass(e.status)),s(),u(" ",e.status||"\u2014"," "),s(2),c(e.providerName?7:-1),s(),c(e.model?8:-1),s(),c(e.projectId?9:-1),s(4),u(" ",e.currentPhaseIndex," "),s(5),u(" ",e.currentPhaseStepCount," "),s(5),u(" ",e.totalStepCount," "),s(),c(e.pauseReason?24:-1),s(),c(e.lastResponseSummary?25:-1),s(),c(e.blockers&&e.blockers.length>0?26:-1)}}function Ee(t,o){if(t&1&&(r(0,"div",2),v(1,ge,27,12,"div",3,_e),n()),t&2){let e=d();s(),I(e.coordinatorsForSession_$())}}var Ne=(()=>{class t{sessionId=f.required();isOpen=f.required();closed=R();coordinator_DS=m(M);coordinatorsForSession_$=$(()=>{let e=this.sessionId();return e?this.coordinator_DS.globalCoordinatorsList_$().filter(i=>i.sessionId===e):[]});ngOnInit(){this.coordinator_DS.globalCoordinatorsList_$().length===0&&this.coordinator_DS.loadAllCoordinatorsForManagementPage()}getStatusColorClass(e){switch((e??"").trim().toLowerCase()){case"active":return"bg-green-500/20 text-green-400";case"running":return"bg-green-500/20 text-green-400";case"paused":return"bg-yellow-500/20 text-yellow-400";case"idle":return"bg-blue-500/20 text-blue-400";case"stopped":return"bg-neutral-500/20 text-neutral-400";case"completed":return"bg-neutral-600/20 text-neutral-400";case"failed":return"bg-red-500/20 text-red-400";default:return"bg-neutral-700/30 text-neutral-300"}}handleClose(){this.closed.emit()}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=w({type:t,selectors:[["app-crd-info-popup"]],inputs:{sessionId:[1,"sessionId"],isOpen:[1,"isOpen"]},outputs:{closed:"closed"},standalone:!0,features:[T],decls:4,vars:6,consts:[[3,"closed","isOpen","title","maxWidth","bodyFlexColumn","headerBorderClass"],[1,"p-4","text-center","text-neutral-500","text-sm"],[1,"flex-1","overflow-y-auto","space-y-3","pr-1"],[1,"border","border-neutral-700/60","rounded-md","p-2.5","bg-neutral-900/40"],[1,"flex","items-center","gap-2","mb-1.5"],[1,"text-sm","font-medium","text-neutral-200","truncate"],[1,"text-[10px]","px-1.5","py-0.5","rounded","font-mono",3,"ngClass"],[1,"flex","flex-wrap","gap-x-3","gap-y-0.5","text-[10px]","text-neutral-500","mb-2"],[1,"text-[11px]","text-neutral-400","mb-1.5"],[1,"text-neutral-600"],[1,"text-[11px]","text-yellow-400/80","mb-1.5","truncate",3,"title"],[1,"text-[11px]","text-neutral-400","mb-1.5","line-clamp-2",3,"title"],[1,"flex","flex-wrap","gap-1","mt-1"],[1,"text-[10px]","px-1.5","py-0.5","rounded","bg-red-500/15","text-red-400","truncate","max-w-full",3,"title"]],template:function(i,l){i&1&&(r(0,"app-s-modal",0),D("closed",function(){return l.handleClose()}),x(1,me,2,0,"div",1)(2,xe,2,0,"div",1)(3,Ee,3,0,"div",2),n()),i&2&&(_("isOpen",l.isOpen())("title","Koordin\xE1tor inf\xF3k ehhez a session-h\xF6z")("maxWidth","lg")("bodyFlexColumn",!0)("headerBorderClass","border-neonAmber/50"),s(),c(l.sessionId()?l.coordinatorsForSession_$().length===0?2:3:1))},dependencies:[Q,F,P],encapsulation:2})}return t})();var W=(()=>{class t{apiBase=L.api.baseUrl;http=m(j);getQueue(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}?_t=${Date.now()}`;return S(this.http.get(i))}editItem(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}/${e.queueItemId}`;return S(this.http.patch(i,{text:e.text}))}removeItem(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}/${e.queueItemId}`;return S(this.http.delete(i))}sendNow(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}/${e.queueItemId}/send-now`;return S(this.http.post(i,{}))}reorderItem(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}/${e.queueItemId}/reorder`;return S(this.http.post(i,{direction:e.direction}))}lockQueue(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}/lock`;return S(this.http.post(i,{}))}unlockQueue(e){let i=`${this.buildUrl(e.baseRoute,e.sessionId)}/unlock`;return S(this.http.post(i,{}))}buildUrl(e,i){return`${this.apiBase}/${e}-queue/${i}`}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var p=G(Y());var $e="session-queue:updated",ye="session-queue:lock-changed",tt=(()=>{class t{sessionQueue_AS=m(W);socket_CS=m(H);globalError_CS=m(O);eventSubscription=null;reconnectSubscription=null;activeSessionId="";activeBaseRoute="";queueSnapshot_$=C(null);isLocked_$=C(!1);editingItemId_$=C(null);editingText_$=C("");items_$=C([]);constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(e=>{this.handleSocketEvent(e)}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(e=>{e&&this.activeSessionId&&(p.DyFM_Log.info(`ExS_Queue_DS | Socket reconnected, reloading queue | session: ${this.activeSessionId}`),this.loadQueue())})}ngOnDestroy(){this.eventSubscription?.unsubscribe(),this.eventSubscription=null,this.reconnectSubscription?.unsubscribe(),this.reconnectSubscription=null}subscribeToSession(e){this.activeSessionId=e.sessionId,this.activeBaseRoute=e.baseRoute,p.DyFM_Log.info(`ExS_Queue_DS | subscribeToSession | session: ${e.sessionId} | baseRoute: ${e.baseRoute}`),this.loadQueue()}unsubscribe(){this.activeSessionId="",this.activeBaseRoute="",this.queueSnapshot_$.set(null),this.items_$.set([]),this.isLocked_$.set(!1),this.editingItemId_$.set(null),this.editingText_$.set("")}startEditing(e){return h(this,null,function*(){if(!this.activeSessionId||!this.activeBaseRoute)return;if(!this.isItemInCurrentSnapshot(e)){p.DyFM_Log.info(`ExS_Queue_DS | startEditing \u2014 stale item, reloading | queueItemId: ${e}`),yield this.loadQueue();return}try{yield this.sessionQueue_AS.lockQueue({baseRoute:this.activeBaseRoute,sessionId:this.activeSessionId})}catch{return}let i=this.items_$().find(l=>l.queueItemId===e);this.isLocked_$.set(!0),this.editingItemId_$.set(e),this.editingText_$.set(i?.text??"")})}saveEdit(){return h(this,null,function*(){let e=this.editingItemId_$();if(!(!e||!this.activeSessionId||!this.activeBaseRoute)){try{if((yield this.sessionQueue_AS.editItem({baseRoute:this.activeBaseRoute,sessionId:this.activeSessionId,queueItemId:e,text:this.editingText_$()})).item===null){this.globalError_CS.showError(new Error("Queue item not found \u2014 it may have been delivered while editing"),"session-queue-edit"),yield this.finishEditing(),yield this.loadQueue();return}}catch(i){this.globalError_CS.showError(i,"session-queue-edit-save");return}yield this.finishEditing()}})}cancelEdit(){return h(this,null,function*(){yield this.finishEditing()})}removeItem(e){return h(this,null,function*(){if(!(!this.activeSessionId||!this.activeBaseRoute)){if(!this.isItemInCurrentSnapshot(e)){p.DyFM_Log.info(`ExS_Queue_DS | removeItem \u2014 stale item, reloading | queueItemId: ${e}`),yield this.loadQueue();return}try{(yield this.sessionQueue_AS.removeItem({baseRoute:this.activeBaseRoute,sessionId:this.activeSessionId,queueItemId:e})).success===!1&&(p.DyFM_Log.info(`ExS_Queue_DS | removeItem \u2014 server: item not found, reloading | queueItemId: ${e}`),yield this.loadQueue())}catch{yield this.loadQueue()}}})}sendNow(e){return h(this,null,function*(){if(!(!this.activeSessionId||!this.activeBaseRoute)){if(!this.isItemInCurrentSnapshot(e)){p.DyFM_Log.info(`ExS_Queue_DS | sendNow \u2014 stale item, reloading | queueItemId: ${e}`),yield this.loadQueue();return}try{let i=yield this.sessionQueue_AS.sendNow({baseRoute:this.activeBaseRoute,sessionId:this.activeSessionId,queueItemId:e});if(i.success===!1){let l=typeof i.reason=="string"?i.reason:"unknown";l==="Item not found in queue"?p.DyFM_Log.info(`ExS_Queue_DS | sendNow \u2014 server: item already delivered, reloading | queueItemId: ${e}`):this.globalError_CS.showError(new Error(`Send-now delivery failed: ${l}`),"session-queue-send-now"),yield this.loadQueue()}}catch{yield this.loadQueue()}}})}reorderItem(e){return h(this,null,function*(){if(!(!this.activeSessionId||!this.activeBaseRoute)){if(!this.isItemInCurrentSnapshot(e.queueItemId)){p.DyFM_Log.info(`ExS_Queue_DS | reorderItem \u2014 stale item, reloading | queueItemId: ${e.queueItemId}`),yield this.loadQueue();return}try{(yield this.sessionQueue_AS.reorderItem({baseRoute:this.activeBaseRoute,sessionId:this.activeSessionId,queueItemId:e.queueItemId,direction:e.direction})).success===!1&&(p.DyFM_Log.info(`ExS_Queue_DS | reorderItem \u2014 server: item not found, reloading | queueItemId: ${e.queueItemId}`),yield this.loadQueue())}catch{yield this.loadQueue()}}})}isItemInCurrentSnapshot(e){return this.items_$().some(i=>i.queueItemId===e)}loadQueue(){return h(this,null,function*(){let e=this.activeSessionId,i=this.activeBaseRoute;if(!(!e||!i))try{let l=yield this.sessionQueue_AS.getQueue({baseRoute:i,sessionId:e});if(this.activeSessionId!==e){p.DyFM_Log.info(`ExS_Queue_DS | loadQueue result discarded (session changed) | requested: ${e} | current: ${this.activeSessionId}`);return}let E=l?.queue?.items?.length??0;p.DyFM_Log.info(`ExS_Queue_DS | loadQueue OK | session: ${e} | items: ${E}`),this.applySnapshot(l.queue)}catch(l){if(this.activeSessionId!==e)return;p.DyFM_Log.warn(`ExS_Queue_DS | loadQueue FAILED | session: ${e} | baseRoute: ${i} | error: ${l instanceof Error?l.message:String(l)}`),this.queueSnapshot_$.set(null),this.items_$.set([])}})}applySnapshot(e){this.queueSnapshot_$.set(e),this.items_$.set(e.items??[]),this.isLocked_$.set(e.isLocked)}finishEditing(){return h(this,null,function*(){if(this.editingItemId_$.set(null),this.editingText_$.set(""),this.isLocked_$.set(!1),!(!this.activeSessionId||!this.activeBaseRoute))try{yield this.sessionQueue_AS.unlockQueue({baseRoute:this.activeBaseRoute,sessionId:this.activeSessionId})}catch(e){this.globalError_CS.showError(e,"session-queue-unlock")}})}handleSocketEvent(e){let i=e.payload;if((typeof i.sessionId=="string"?i.sessionId:"")===this.activeSessionId&&(e.event===$e&&this.applySnapshot(i),e.event===ye)){let E=typeof i.isLocked=="boolean"?i.isLocked:!1;this.isLocked_$.set(E)}}static \u0275fac=function(i){return new(i||t)};static \u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var V=class{static saveDraft(o,e,i){!o||!e||k.writeString(`${o}:promptDraft:${e}`,i)}static loadDraft(o,e){return!o||!e?"":k.readString(`${o}:promptDraft:${e}`)??""}static clearDraft(o,e){!o||!e||k.remove(`${o}:promptDraft:${e}`)}};export{Be as a,Ne as b,tt as c,V as d};
2
+ //# sourceMappingURL=chunk-CPOWA47I.js.map
@@ -1,2 +1,2 @@
1
- import{e as _}from"./chunk-FVNI46U2.js";import{I as C,p as $}from"./chunk-5N64HGRY.js";import{C as l,a as c,aa as s,b as d,h as f,hb as S,k as n,p as a,t as h,xb as m,y as p}from"./chunk-TBMJSIBB.js";var i=f($());var g=(()=>{class e{http=l(m);coordinatorUrl(t){return`${C.api.baseUrl}/session/${t}/coordinator`}getStatus(t){return a(this.http.get(this.coordinatorUrl(t)))}startCoordinator(t){return a(this.http.post(this.coordinatorUrl(t.sessionId),{providerName:t.providerName,model:t.model,workflowId:t.workflowId,projectId:t.projectId}))}stopCoordinator(t){return a(this.http.delete(this.coordinatorUrl(t)))}pauseCoordinator(t){return a(this.http.post(`${this.coordinatorUrl(t)}/pause`,{}))}resumeCoordinator(t){return a(this.http.post(`${this.coordinatorUrl(t)}/resume`,{}))}listCoordinators(t){return a(this.http.get(`${this.coordinatorUrl(t)}/list`))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var b="coordinator:",j=(()=>{class e{coordinator_AS=l(g);socket_CS=l(_);coordinator_$=s(null);decisions_$=s([]);lastGenerationStats_$=s(null);userInteractionPrompt_$=s(null);isLoading_$=s(!1);globalCoordinatorsList_$=s([]);globalCoordinatorsListLoading_$=s(!1);coordinatedSessionIds_$=S(()=>{let t=new Set;for(let o of this.globalCoordinatorsList_$()){let r=(o.status??"").trim().toLowerCase();if(r==="stopped"||r==="completed")continue;let u=o.sessionId?.trim();u&&t.add(u)}return t});activeSessionId=null;socketSubscription=null;ngOnDestroy(){this.cleanupSocketSubscription()}loadAllCoordinatorsForManagementPage(){return n(this,null,function*(){this.globalCoordinatorsListLoading_$.set(!0);try{let t=yield this.coordinator_AS.listCoordinators("_all");this.globalCoordinatorsList_$.set(t.coordinators??[])}catch(t){i.DyFM_Error.logSimple("CCAP_Coordinator_DS | loadAllCoordinatorsForManagementPage failed",t)}finally{this.globalCoordinatorsListLoading_$.set(!1)}})}loadCoordinatorStatus(t){return n(this,null,function*(){try{this.isLoading_$.set(!0);let o=yield this.coordinator_AS.getStatus(t);this.coordinator_$.set(o.coordinator),o.coordinator&&(this.decisions_$.set(o.coordinator.decisions??[]),this.setupSocketListeners(t))}catch(o){i.DyFM_Error.logSimple("CCAP_Coordinator_DS | loadCoordinatorStatus failed",o),this.coordinator_$.set(null)}finally{this.isLoading_$.set(!1)}})}startCoordinator(t){return n(this,null,function*(){try{this.isLoading_$.set(!0),this.decisions_$.set([]),this.userInteractionPrompt_$.set(null),this.lastGenerationStats_$.set(null);let o=yield this.coordinator_AS.startCoordinator(t);this.coordinator_$.set(o.coordinator),this.setupSocketListeners(t.sessionId)}catch(o){throw i.DyFM_Error.logSimple("CCAP_Coordinator_DS | startCoordinator failed",o),o}finally{this.isLoading_$.set(!1)}})}stopCoordinator(t){return n(this,null,function*(){try{yield this.coordinator_AS.stopCoordinator(t),this.coordinator_$.set(null),this.cleanupSocketSubscription()}catch(o){throw i.DyFM_Error.logSimple("CCAP_Coordinator_DS | stopCoordinator failed",o),o}})}pauseCoordinator(t){return n(this,null,function*(){try{yield this.coordinator_AS.pauseCoordinator(t),yield this.loadCoordinatorStatus(t)}catch(o){throw i.DyFM_Error.logSimple("CCAP_Coordinator_DS | pauseCoordinator failed",o),o}})}resumeCoordinator(t){return n(this,null,function*(){try{this.userInteractionPrompt_$.set(null),yield this.coordinator_AS.resumeCoordinator(t),yield this.loadCoordinatorStatus(t)}catch(o){throw i.DyFM_Error.logSimple("CCAP_Coordinator_DS | resumeCoordinator failed",o),o}})}setupSocketListeners(t){this.activeSessionId!==t&&(this.cleanupSocketSubscription(),this.activeSessionId=t,this.socketSubscription=this.socket_CS.event$.pipe(h(o=>o.event.startsWith(b))).subscribe(o=>{let r=o.payload&&typeof o.payload=="object"?o.payload:{};this.handleSocketEvent(o.event,r)}),i.DyFM_Log.info(`CCAP_Coordinator_DS | Socket subscription setup for session: ${t}`))}handleSocketEvent(t,o){switch(t){case"coordinator:stepCompleted":this.handleStepCompleted(o);break;case"coordinator:userInteractionRequired":this.handleUserInteractionRequired(o);break;case"coordinator:error":this.handleError(o);break;case"coordinator:resumed":this.userInteractionPrompt_$.set(null),this.coordinator_$.update(r=>r&&d(c({},r),{status:"active",pauseReason:null}));break;case"coordinator:completed":this.coordinator_$.update(r=>{if(!r)return r;let u=o.success?"completed":"failed";return d(c({},r),{status:u})});break;default:break}}handleStepCompleted(t){let o={coordinatorId:String(t.coordinatorId??""),sessionId:String(t.sessionId??""),action:String(t.action??""),reasoning:String(t.reasoning??""),generationStats:t.generationStats?t.generationStats:void 0},r={action:o.action,messageToAgent:null,statusUpdates:[],reasoning:o.reasoning,stopReason:null,userInteractionDetails:null,timestamp:new Date().toISOString()};this.decisions_$.set([...this.decisions_$(),r]),o.generationStats&&this.lastGenerationStats_$.set({timestamp:new Date().toISOString(),model:o.generationStats.model,providerName:o.generationStats.providerName,inputTokens:o.generationStats.inputTokens,outputTokens:o.generationStats.outputTokens,responseTimeMs:o.generationStats.responseTimeMs,action:o.action,reasoning:o.reasoning,messageToAgent:null})}handleUserInteractionRequired(t){this.userInteractionPrompt_$.set(String(t.details??"")),this.coordinator_$.update(o=>o&&d(c({},o),{status:"paused",pauseReason:String(t.details??"")}))}handleError(t){this.coordinator_$.update(o=>o&&d(c({},o),{status:"paused",pauseReason:String(t.error??"Unknown error")}))}cleanupSocketSubscription(){this.socketSubscription&&(this.socketSubscription.unsubscribe(),this.socketSubscription=null),this.activeSessionId=null}static \u0275fac=function(o){return new(o||e)};static \u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{j as a};
2
- //# sourceMappingURL=chunk-GH67BJ7J.js.map
1
+ import{e as _}from"./chunk-ACLAVYA7.js";import{I as C,p as $}from"./chunk-ZJ3DCODZ.js";import{C as l,a as c,aa as s,b as d,h as f,hb as S,k as n,p as a,t as h,xb as m,y as p}from"./chunk-TBMJSIBB.js";var i=f($());var g=(()=>{class e{http=l(m);coordinatorUrl(t){return`${C.api.baseUrl}/session/${t}/coordinator`}getStatus(t){return a(this.http.get(this.coordinatorUrl(t)))}startCoordinator(t){return a(this.http.post(this.coordinatorUrl(t.sessionId),{providerName:t.providerName,model:t.model,workflowId:t.workflowId,projectId:t.projectId}))}stopCoordinator(t){return a(this.http.delete(this.coordinatorUrl(t)))}pauseCoordinator(t){return a(this.http.post(`${this.coordinatorUrl(t)}/pause`,{}))}resumeCoordinator(t){return a(this.http.post(`${this.coordinatorUrl(t)}/resume`,{}))}listCoordinators(t){return a(this.http.get(`${this.coordinatorUrl(t)}/list`))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var b="coordinator:",j=(()=>{class e{coordinator_AS=l(g);socket_CS=l(_);coordinator_$=s(null);decisions_$=s([]);lastGenerationStats_$=s(null);userInteractionPrompt_$=s(null);isLoading_$=s(!1);globalCoordinatorsList_$=s([]);globalCoordinatorsListLoading_$=s(!1);coordinatedSessionIds_$=S(()=>{let t=new Set;for(let o of this.globalCoordinatorsList_$()){let r=(o.status??"").trim().toLowerCase();if(r==="stopped"||r==="completed")continue;let u=o.sessionId?.trim();u&&t.add(u)}return t});activeSessionId=null;socketSubscription=null;ngOnDestroy(){this.cleanupSocketSubscription()}loadAllCoordinatorsForManagementPage(){return n(this,null,function*(){this.globalCoordinatorsListLoading_$.set(!0);try{let t=yield this.coordinator_AS.listCoordinators("_all");this.globalCoordinatorsList_$.set(t.coordinators??[])}catch(t){i.DyFM_Error.logSimple("CCAP_Coordinator_DS | loadAllCoordinatorsForManagementPage failed",t)}finally{this.globalCoordinatorsListLoading_$.set(!1)}})}loadCoordinatorStatus(t){return n(this,null,function*(){try{this.isLoading_$.set(!0);let o=yield this.coordinator_AS.getStatus(t);this.coordinator_$.set(o.coordinator),o.coordinator&&(this.decisions_$.set(o.coordinator.decisions??[]),this.setupSocketListeners(t))}catch(o){i.DyFM_Error.logSimple("CCAP_Coordinator_DS | loadCoordinatorStatus failed",o),this.coordinator_$.set(null)}finally{this.isLoading_$.set(!1)}})}startCoordinator(t){return n(this,null,function*(){try{this.isLoading_$.set(!0),this.decisions_$.set([]),this.userInteractionPrompt_$.set(null),this.lastGenerationStats_$.set(null);let o=yield this.coordinator_AS.startCoordinator(t);this.coordinator_$.set(o.coordinator),this.setupSocketListeners(t.sessionId)}catch(o){throw i.DyFM_Error.logSimple("CCAP_Coordinator_DS | startCoordinator failed",o),o}finally{this.isLoading_$.set(!1)}})}stopCoordinator(t){return n(this,null,function*(){try{yield this.coordinator_AS.stopCoordinator(t),this.coordinator_$.set(null),this.cleanupSocketSubscription()}catch(o){throw i.DyFM_Error.logSimple("CCAP_Coordinator_DS | stopCoordinator failed",o),o}})}pauseCoordinator(t){return n(this,null,function*(){try{yield this.coordinator_AS.pauseCoordinator(t),yield this.loadCoordinatorStatus(t)}catch(o){throw i.DyFM_Error.logSimple("CCAP_Coordinator_DS | pauseCoordinator failed",o),o}})}resumeCoordinator(t){return n(this,null,function*(){try{this.userInteractionPrompt_$.set(null),yield this.coordinator_AS.resumeCoordinator(t),yield this.loadCoordinatorStatus(t)}catch(o){throw i.DyFM_Error.logSimple("CCAP_Coordinator_DS | resumeCoordinator failed",o),o}})}setupSocketListeners(t){this.activeSessionId!==t&&(this.cleanupSocketSubscription(),this.activeSessionId=t,this.socketSubscription=this.socket_CS.event$.pipe(h(o=>o.event.startsWith(b))).subscribe(o=>{let r=o.payload&&typeof o.payload=="object"?o.payload:{};this.handleSocketEvent(o.event,r)}),i.DyFM_Log.info(`CCAP_Coordinator_DS | Socket subscription setup for session: ${t}`))}handleSocketEvent(t,o){switch(t){case"coordinator:stepCompleted":this.handleStepCompleted(o);break;case"coordinator:userInteractionRequired":this.handleUserInteractionRequired(o);break;case"coordinator:error":this.handleError(o);break;case"coordinator:resumed":this.userInteractionPrompt_$.set(null),this.coordinator_$.update(r=>r&&d(c({},r),{status:"active",pauseReason:null}));break;case"coordinator:completed":this.coordinator_$.update(r=>{if(!r)return r;let u=o.success?"completed":"failed";return d(c({},r),{status:u})});break;default:break}}handleStepCompleted(t){let o={coordinatorId:String(t.coordinatorId??""),sessionId:String(t.sessionId??""),action:String(t.action??""),reasoning:String(t.reasoning??""),generationStats:t.generationStats?t.generationStats:void 0},r={action:o.action,messageToAgent:null,statusUpdates:[],reasoning:o.reasoning,stopReason:null,userInteractionDetails:null,timestamp:new Date().toISOString()};this.decisions_$.set([...this.decisions_$(),r]),o.generationStats&&this.lastGenerationStats_$.set({timestamp:new Date().toISOString(),model:o.generationStats.model,providerName:o.generationStats.providerName,inputTokens:o.generationStats.inputTokens,outputTokens:o.generationStats.outputTokens,responseTimeMs:o.generationStats.responseTimeMs,action:o.action,reasoning:o.reasoning,messageToAgent:null})}handleUserInteractionRequired(t){this.userInteractionPrompt_$.set(String(t.details??"")),this.coordinator_$.update(o=>o&&d(c({},o),{status:"paused",pauseReason:String(t.details??"")}))}handleError(t){this.coordinator_$.update(o=>o&&d(c({},o),{status:"paused",pauseReason:String(t.error??"Unknown error")}))}cleanupSocketSubscription(){this.socketSubscription&&(this.socketSubscription.unsubscribe(),this.socketSubscription=null),this.activeSessionId=null}static \u0275fac=function(o){return new(o||e)};static \u0275prov=p({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{j as a};
2
+ //# sourceMappingURL=chunk-CROOTWQ4.js.map
@@ -1,2 +1,2 @@
1
- import{b as a}from"./chunk-Q2WNI354.js";var f=class{static extract(t){if(t.toolName)return t.toolName;if(t.rawData){let s=t.rawData.name??t.rawData.tool_name??t.rawData.last_tool_name;if(typeof s=="string")return s}let o=t.bodyText.indexOf(":");return o>0?t.bodyText.substring(0,o).trim():t.bodyText.trim()}};var b=class e{static DEFAULT_GROUPABLE_TOOLS=new Set(["Read","Bash","Grep","Glob"]);static DEFAULT_MIN_GROUP_SIZE=2;static groupSubAgentItems(t,o){let s=new Map;for(let r=0;r<t.length;r++){let n=t[r];if(n.kind===a.tool&&n.toolName==="Agent"){let i=e.resolveAgentId(n);i&&s.set(i,{item:n,index:r})}}if(!s.size)return t;let c=new Map,d=new Set;for(let r=0;r<t.length;r++){let n=t[r];if(n.parentAgentId&&s.has(n.parentAgentId)){let i=c.get(n.parentAgentId)??[];i.push(n),c.set(n.parentAgentId,i),d.add(r)}}let l=[];for(let r=0;r<t.length;r++){if(d.has(r))continue;let n=t[r];if(n.kind===a.tool&&n.toolName==="Agent"){let i=e.resolveAgentId(n),p=c.get(i)??[],g=[n,...p],I=e.buildSubAgentLabel(n),A=e.extractSubagentType(n),y=e.groupConsecutiveToolItems(g,o);l.push({listKey:e.newListKey(),kind:a.subAgentGroup,bodyText:I,groupItems:y,groupToolName:A||"Agent",rawData:n.rawData})}else l.push(n)}return l}static groupConsecutiveToolItems(t,o){let s=o?.groupableTools??e.DEFAULT_GROUPABLE_TOOLS,c=o?.minGroupSize??e.DEFAULT_MIN_GROUP_SIZE,d=[],l=[],r="",n=()=>{if(!l.length)return;let i=l.filter(p=>p.kind===a.tool).length;i>=c?d.push({listKey:e.newListKey(),kind:a.toolGroup,bodyText:`${r} \xD7 ${i}`,groupItems:l,groupToolName:r}):d.push(...l),l=[],r=""};for(let i of t){if(i.kind===a.tool){let p=f.extract(i);if(s.has(p)){r&&r!==p&&n(),r=p,l.push(i);continue}}if(i.kind===a.toolResult&&l.length){l.push(i);continue}n(),d.push(i)}return n(),d}static resolveAgentId(t){return t.toolCallId?t.toolCallId:t.rawData&&typeof t.rawData.id=="string"?t.rawData.id:""}static extractSubagentType(t){let o=t.rawData?.input;if(!o||typeof o!="object")return"";let s=o.subagent_type;return typeof s=="string"?s:""}static extractDescription(t){let o=t.rawData?.input;if(!o||typeof o!="object")return"";let s=o.description;return typeof s=="string"?s:""}static buildSubAgentLabel(t){let o=e.extractSubagentType(t),s=e.extractDescription(t);return o?`${o}: ${s||"..."}`:s||"Sub-agent"}static newListKey(){return globalThis.crypto.randomUUID()}};var u=function(e){return e.user="user",e.assistant="assistant",e.tool="tool",e.toolResult="tool-result",e.status="status",e.error="error",e.info="info",e.result="result",e.thinking="thinking",e.statusUpdate="status-update",e}(u||{});var h=class e{static fromAssembledMessage(t,o){let s=e.mapRoleToKind(t.messageRole),c=t.toolResult?{text:t.toolResult.text,expandableContent:t.toolResult.expandableContent,rawData:t.toolResult.rawData,isError:t.toolResult.isError}:void 0,d=t.messageRole===u.tool&&t.toolName==="Edit"&&!!t.expandableContent;return{listKey:t.messageKey,kind:s,bodyText:t.bodyText,timestampIso:t.timestamp,toolName:t.toolName,expandableContent:t.expandableContent,pairedResult:c,rawData:t.rawData,subtype:t.subtype,isUserAligned:t.isUserAligned,headerStatusDot:t.headerStatusDot==="error"?"error":void 0,flags:{showCopy:!0,showRawInfo:!0,useEditDiffForExpandable:d},tts:e.buildTts(t,o),toolCallId:t.toolCallId,parentAgentId:t.parentAgentId}}static buildTts(t,o){if(!(!o||!(t.messageRole===u.user||t.messageRole===u.assistant)||!t.bodyText.trim().length))return{messageKey:t.messageKey,sessionId:o.sessionId,role:t.messageRole,content:t.bodyText,timestampIso:t.timestamp,hasTtsAudio:o.cachedKeys.has(t.messageKey)}}static mapRoleToKind(t){switch(t){case u.user:return a.userPrompt;case u.assistant:return a.assistant;case u.tool:return a.tool;case u.toolResult:return a.toolResult;case u.status:return a.status;case u.error:return a.error;case u.info:return a.info;case u.result:return a.result;case u.thinking:return a.thinking;case u.statusUpdate:return a.statusUpdate;default:return a.info}}};export{b as a,h as b};
2
- //# sourceMappingURL=chunk-4ANOVQQ6.js.map
1
+ import{b as a}from"./chunk-565H5Q7X.js";var f=class{static extract(t){if(t.toolName)return t.toolName;if(t.rawData){let s=t.rawData.name??t.rawData.tool_name??t.rawData.last_tool_name;if(typeof s=="string")return s}let o=t.bodyText.indexOf(":");return o>0?t.bodyText.substring(0,o).trim():t.bodyText.trim()}};var b=class e{static DEFAULT_GROUPABLE_TOOLS=new Set(["Read","Bash","Grep","Glob"]);static DEFAULT_MIN_GROUP_SIZE=2;static groupSubAgentItems(t,o){let s=new Map;for(let r=0;r<t.length;r++){let n=t[r];if(n.kind===a.tool&&n.toolName==="Agent"){let i=e.resolveAgentId(n);i&&s.set(i,{item:n,index:r})}}if(!s.size)return t;let c=new Map,d=new Set;for(let r=0;r<t.length;r++){let n=t[r];if(n.parentAgentId&&s.has(n.parentAgentId)){let i=c.get(n.parentAgentId)??[];i.push(n),c.set(n.parentAgentId,i),d.add(r)}}let l=[];for(let r=0;r<t.length;r++){if(d.has(r))continue;let n=t[r];if(n.kind===a.tool&&n.toolName==="Agent"){let i=e.resolveAgentId(n),p=c.get(i)??[],g=[n,...p],I=e.buildSubAgentLabel(n),A=e.extractSubagentType(n),y=e.groupConsecutiveToolItems(g,o);l.push({listKey:e.newListKey(),kind:a.subAgentGroup,bodyText:I,groupItems:y,groupToolName:A||"Agent",rawData:n.rawData})}else l.push(n)}return l}static groupConsecutiveToolItems(t,o){let s=o?.groupableTools??e.DEFAULT_GROUPABLE_TOOLS,c=o?.minGroupSize??e.DEFAULT_MIN_GROUP_SIZE,d=[],l=[],r="",n=()=>{if(!l.length)return;let i=l.filter(p=>p.kind===a.tool).length;i>=c?d.push({listKey:e.newListKey(),kind:a.toolGroup,bodyText:`${r} \xD7 ${i}`,groupItems:l,groupToolName:r}):d.push(...l),l=[],r=""};for(let i of t){if(i.kind===a.tool){let p=f.extract(i);if(s.has(p)){r&&r!==p&&n(),r=p,l.push(i);continue}}if(i.kind===a.toolResult&&l.length){l.push(i);continue}n(),d.push(i)}return n(),d}static resolveAgentId(t){return t.toolCallId?t.toolCallId:t.rawData&&typeof t.rawData.id=="string"?t.rawData.id:""}static extractSubagentType(t){let o=t.rawData?.input;if(!o||typeof o!="object")return"";let s=o.subagent_type;return typeof s=="string"?s:""}static extractDescription(t){let o=t.rawData?.input;if(!o||typeof o!="object")return"";let s=o.description;return typeof s=="string"?s:""}static buildSubAgentLabel(t){let o=e.extractSubagentType(t),s=e.extractDescription(t);return o?`${o}: ${s||"..."}`:s||"Sub-agent"}static newListKey(){return globalThis.crypto.randomUUID()}};var u=function(e){return e.user="user",e.assistant="assistant",e.tool="tool",e.toolResult="tool-result",e.status="status",e.error="error",e.info="info",e.result="result",e.thinking="thinking",e.statusUpdate="status-update",e}(u||{});var h=class e{static fromAssembledMessage(t,o){let s=e.mapRoleToKind(t.messageRole),c=t.toolResult?{text:t.toolResult.text,expandableContent:t.toolResult.expandableContent,rawData:t.toolResult.rawData,isError:t.toolResult.isError}:void 0,d=t.messageRole===u.tool&&t.toolName==="Edit"&&!!t.expandableContent;return{listKey:t.messageKey,kind:s,bodyText:t.bodyText,timestampIso:t.timestamp,toolName:t.toolName,expandableContent:t.expandableContent,pairedResult:c,rawData:t.rawData,subtype:t.subtype,isUserAligned:t.isUserAligned,headerStatusDot:t.headerStatusDot==="error"?"error":void 0,flags:{showCopy:!0,showRawInfo:!0,useEditDiffForExpandable:d},tts:e.buildTts(t,o),toolCallId:t.toolCallId,parentAgentId:t.parentAgentId}}static buildTts(t,o){if(!(!o||!(t.messageRole===u.user||t.messageRole===u.assistant)||!t.bodyText.trim().length))return{messageKey:t.messageKey,sessionId:o.sessionId,role:t.messageRole,content:t.bodyText,timestampIso:t.timestamp,hasTtsAudio:o.cachedKeys.has(t.messageKey)}}static mapRoleToKind(t){switch(t){case u.user:return a.userPrompt;case u.assistant:return a.assistant;case u.tool:return a.tool;case u.toolResult:return a.toolResult;case u.status:return a.status;case u.error:return a.error;case u.info:return a.info;case u.result:return a.result;case u.thinking:return a.thinking;case u.statusUpdate:return a.statusUpdate;default:return a.info}}};export{b as a,h as b};
2
+ //# sourceMappingURL=chunk-CZK7PL4V.js.map
@@ -1,2 +1,2 @@
1
- import{p as h}from"./chunk-5N64HGRY.js";import{h as S}from"./chunk-TBMJSIBB.js";var c=S(h()),f=60,d=60*60,g=60*60*24,M=7,m=class{static formatRelativeTime(t){if(t==null)return"";let n=typeof t=="string"?new Date(t):t;if(Number.isNaN(n.getTime()))return"";let a=new Date,i=a.getTime()-n.getTime(),o=Math.floor(i/c.second);if(o<0)return"";if(o<f)return"just now";let e=Math.floor(o/f);if(e<60)return e===1?"1 minute ago":`${e} minutes ago`;let s=Math.floor(o/d);if(s<24)return s===1?"1 hour ago":`${s} hours ago`;let r=Math.floor(o/g);if(r<=M)return r===1?"1 day ago":`${r} days ago`;let u={month:"short",day:"numeric",year:n.getFullYear()!==a.getFullYear()?"numeric":void 0};return n.toLocaleDateString(void 0,u)}static formatCompactRelativeTime(t){if(t==null)return"";let n=typeof t=="string"?new Date(t):t;if(Number.isNaN(n.getTime()))return"";let i=Date.now()-n.getTime();if(i<0)return"just now";let o=Math.floor(i/c.second),e=Math.floor(o/f),s=Math.floor(o/d),r=Math.floor(o/g);return o<f?"just now":e<60?`${e}m ago`:s<24?`${s}h ago`:r<30?`${r}d ago`:`${Math.floor(r/30)}mo ago`}static formatAbsoluteForTooltip(t){if(t==null)return"";let n=typeof t=="string"?new Date(t):t;if(Number.isNaN(n.getTime()))return"";let a=String(n.getFullYear()),i=String(n.getMonth()+1).padStart(2,"0"),o=String(n.getDate()).padStart(2,"0"),e=String(n.getHours()).padStart(2,"0"),s=String(n.getMinutes()).padStart(2,"0"),r=String(n.getSeconds()).padStart(2,"0");return`${a}-${i}-${o} ${e}:${s}:${r}`}};export{m as a};
2
- //# sourceMappingURL=chunk-TSGXTLGO.js.map
1
+ import{p as h}from"./chunk-ZJ3DCODZ.js";import{h as S}from"./chunk-TBMJSIBB.js";var c=S(h()),f=60,d=60*60,g=60*60*24,M=7,m=class{static formatRelativeTime(t){if(t==null)return"";let n=typeof t=="string"?new Date(t):t;if(Number.isNaN(n.getTime()))return"";let a=new Date,i=a.getTime()-n.getTime(),o=Math.floor(i/c.second);if(o<0)return"";if(o<f)return"just now";let e=Math.floor(o/f);if(e<60)return e===1?"1 minute ago":`${e} minutes ago`;let s=Math.floor(o/d);if(s<24)return s===1?"1 hour ago":`${s} hours ago`;let r=Math.floor(o/g);if(r<=M)return r===1?"1 day ago":`${r} days ago`;let u={month:"short",day:"numeric",year:n.getFullYear()!==a.getFullYear()?"numeric":void 0};return n.toLocaleDateString(void 0,u)}static formatCompactRelativeTime(t){if(t==null)return"";let n=typeof t=="string"?new Date(t):t;if(Number.isNaN(n.getTime()))return"";let i=Date.now()-n.getTime();if(i<0)return"just now";let o=Math.floor(i/c.second),e=Math.floor(o/f),s=Math.floor(o/d),r=Math.floor(o/g);return o<f?"just now":e<60?`${e}m ago`:s<24?`${s}h ago`:r<30?`${r}d ago`:`${Math.floor(r/30)}mo ago`}static formatAbsoluteForTooltip(t){if(t==null)return"";let n=typeof t=="string"?new Date(t):t;if(Number.isNaN(n.getTime()))return"";let a=String(n.getFullYear()),i=String(n.getMonth()+1).padStart(2,"0"),o=String(n.getDate()).padStart(2,"0"),e=String(n.getHours()).padStart(2,"0"),s=String(n.getMinutes()).padStart(2,"0"),r=String(n.getSeconds()).padStart(2,"0");return`${a}-${i}-${o} ${e}:${s}:${r}`}};export{m as a};
2
+ //# sourceMappingURL=chunk-CZVHJQVK.js.map
@@ -1,2 +1,2 @@
1
- import{q as i}from"./chunk-5N64HGRY.js";var e=class{static build(r){let t=r.localAiKey.trim();if(!t.length)throw new Error("localAiSettings.key must be non-empty UUID for custom local LLM rows");return`${i.customLocalAi}--${t}`}static parseLocalAiKeyFromInstanceId(r){let t=`${i.customLocalAi}--`,o=r.instanceId.trim();if(!o.startsWith(t)||o.length<=t.length)throw new Error("Invalid custom local LLM instance id");return o.slice(t.length)}};export{e as a};
2
- //# sourceMappingURL=chunk-N7HJWJ2S.js.map
1
+ import{q as i}from"./chunk-ZJ3DCODZ.js";var e=class{static build(r){let t=r.localAiKey.trim();if(!t.length)throw new Error("localAiSettings.key must be non-empty UUID for custom local LLM rows");return`${i.customLocalAi}--${t}`}static parseLocalAiKeyFromInstanceId(r){let t=`${i.customLocalAi}--`,o=r.instanceId.trim();if(!o.startsWith(t)||o.length<=t.length)throw new Error("Invalid custom local LLM instance id");return o.slice(t.length)}};export{e as a};
2
+ //# sourceMappingURL=chunk-EZQXUBC4.js.map