@futdevpro/ccap 1.1.3039 → 1.1.3046

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-63DMGKO2.js → agent-instances.module-TUXJXTGH.js} +2 -2
  2. package/client-dist/{ca.module-T4GLGQMJ.js → ca.module-HMLG5JWZ.js} +2 -2
  3. package/client-dist/{cc-usage-dashboard.component-WQFT75MV.js → cc-usage-dashboard.component-CGMHIQZO.js} +2 -2
  4. package/client-dist/{cc.module-PEJ6OV2U.js → cc.module-5WMNTNFR.js} +2 -2
  5. package/client-dist/{chunk-WPT7HGB2.js → chunk-2MLW7YDA.js} +2 -2
  6. package/client-dist/{chunk-JDBS6ZXD.js → chunk-3JHGYF3K.js} +2 -2
  7. package/client-dist/{chunk-VA3QGKXE.js → chunk-5F5TCOBC.js} +2 -2
  8. package/client-dist/{chunk-M4CGCNOB.js → chunk-5LANXE75.js} +2 -2
  9. package/client-dist/{chunk-KD4JK4LC.js → chunk-5LWUFMRP.js} +2 -2
  10. package/client-dist/{chunk-BJYELNNP.js → chunk-5ZJ7P2E3.js} +2 -2
  11. package/client-dist/{chunk-GBRJVJWI.js → chunk-64VGC4TP.js} +2 -2
  12. package/client-dist/{chunk-EUMQRYBI.js → chunk-6LLPBXMJ.js} +2 -2
  13. package/client-dist/{chunk-VRI47IVY.js → chunk-762K6QXC.js} +2 -2
  14. package/client-dist/{chunk-VRI47IVY.js.map → chunk-762K6QXC.js.map} +1 -1
  15. package/client-dist/{chunk-WL5L5AUS.js → chunk-7YR26SUN.js} +2 -2
  16. package/client-dist/{chunk-54YZZ7DI.js → chunk-BTU7ZELP.js} +2 -2
  17. package/client-dist/{chunk-OHI3J35R.js → chunk-BVQ4H3QA.js} +2 -2
  18. package/client-dist/{chunk-4MMPDNPS.js → chunk-BYGD4VXU.js} +2 -2
  19. package/client-dist/{chunk-SNMSF3UC.js → chunk-CSBAACGJ.js} +2 -2
  20. package/client-dist/{chunk-BNALWJUC.js → chunk-DNG6CDY4.js} +2 -2
  21. package/client-dist/{chunk-ZE4SBBQZ.js → chunk-FKASFAW6.js} +2 -2
  22. package/client-dist/{chunk-2AGHFWEW.js → chunk-G2LG5YAN.js} +2 -2
  23. package/client-dist/{chunk-RZPQNQWP.js → chunk-GIWNEAC6.js} +2 -2
  24. package/client-dist/{chunk-VILXJBM4.js → chunk-HDOMT44M.js} +2 -2
  25. package/client-dist/{chunk-RIYSXVU2.js → chunk-HIXULZYA.js} +2 -2
  26. package/client-dist/{chunk-SDS4IT63.js → chunk-HV2A2AJU.js} +2 -2
  27. package/client-dist/{chunk-3ZIP6GFB.js → chunk-HWTO6BTX.js} +2 -2
  28. package/client-dist/{chunk-ZELVI2B7.js → chunk-I6JSQIJW.js} +2 -2
  29. package/client-dist/{chunk-TXVACKLG.js → chunk-IBZVNW2L.js} +2 -2
  30. package/client-dist/{chunk-ZKMLJXN4.js → chunk-IXOQ2X3A.js} +2 -2
  31. package/client-dist/{chunk-5Y3UBNHV.js → chunk-JIIIJX42.js} +2 -2
  32. package/client-dist/{chunk-C4H7J567.js → chunk-JRM5W5XH.js} +2 -2
  33. package/client-dist/{chunk-56Q57BLF.js → chunk-JWK54FLV.js} +2 -2
  34. package/client-dist/{chunk-3GFRMENC.js → chunk-KFWHTXCI.js} +2 -2
  35. package/client-dist/{chunk-UOZVXYOQ.js → chunk-KOQT2O67.js} +2 -2
  36. package/client-dist/{chunk-UPREBG2C.js → chunk-LMJG2I62.js} +2 -2
  37. package/client-dist/{chunk-BPWY4SOQ.js → chunk-M5NG4Q3Z.js} +2 -2
  38. package/client-dist/{chunk-44PQAFEL.js → chunk-MJGLT4C2.js} +2 -2
  39. package/client-dist/{chunk-TKAV5X35.js → chunk-MMQ57B6R.js} +2 -2
  40. package/client-dist/{chunk-RJX7O3DI.js → chunk-MOASKRZP.js} +2 -2
  41. package/client-dist/{chunk-H6OPOJX2.js → chunk-MOSWP4BJ.js} +2 -2
  42. package/client-dist/{chunk-VS3F3LTC.js → chunk-N47ZRCQG.js} +2 -2
  43. package/client-dist/{chunk-5VMMYEMK.js → chunk-NRJKTIZF.js} +2 -2
  44. package/client-dist/{chunk-IOERVA2Z.js → chunk-PMLX3WAS.js} +2 -2
  45. package/client-dist/{chunk-6PIFC53E.js → chunk-PTQ5H5MK.js} +2 -2
  46. package/client-dist/{chunk-XSZRRELF.js → chunk-QAPJA5FD.js} +2 -2
  47. package/client-dist/{chunk-PWGYG7KG.js → chunk-QDFXDY3C.js} +2 -2
  48. package/client-dist/{chunk-73W3SDF2.js → chunk-QX6KVWQM.js} +2 -2
  49. package/client-dist/{chunk-GABPE7B3.js → chunk-RFY7BLUK.js} +2 -2
  50. package/client-dist/{chunk-OITOJMIX.js → chunk-S7V3R4PM.js} +2 -2
  51. package/client-dist/{chunk-U3FLQ2MZ.js → chunk-S7YJ7PPV.js} +2 -2
  52. package/client-dist/{chunk-2K7AS4TQ.js → chunk-TGDXETVE.js} +2 -2
  53. package/client-dist/{chunk-AD7RW3IE.js → chunk-UECIUR5A.js} +2 -2
  54. package/client-dist/{chunk-W3WV5NJ7.js → chunk-UFMIB2BX.js} +2 -2
  55. package/client-dist/{chunk-5A22WYW7.js → chunk-VRKWX3KT.js} +2 -2
  56. package/client-dist/{chunk-ATR4YAIL.js → chunk-VVEVLMXP.js} +2 -2
  57. package/client-dist/{chunk-NNEFCEZZ.js → chunk-VVXNQD62.js} +2 -2
  58. package/client-dist/{chunk-S2FEPCDW.js → chunk-WY3GPSWI.js} +2 -2
  59. package/client-dist/{chunk-I3IKMSNZ.js → chunk-XJ7THHXW.js} +2 -2
  60. package/client-dist/{chunk-CUMUA2HP.js → chunk-ZBR72J6L.js} +2 -2
  61. package/client-dist/{chunk-NXBECCCW.js → chunk-ZR3PV6LV.js} +2 -2
  62. package/client-dist/{consultant.module-H52V7TON.js → consultant.module-IWPWHJXW.js} +2 -2
  63. package/client-dist/{crd.module-X5U6DQ3D.js → crd.module-A5GTPGDU.js} +2 -2
  64. package/client-dist/{dashboard.module-4LC4RSOF.js → dashboard.module-UYMCOFAL.js} +2 -2
  65. package/client-dist/{do.module-HWKFQZQK.js → do.module-FE4EU7J2.js} +2 -2
  66. package/client-dist/{document-library.module-Z57ZOMUG.js → document-library.module-XJC3XSZT.js} +2 -2
  67. package/client-dist/{embedding-eval.module-ULD6Z5XA.js → embedding-eval.module-IRFMQYUF.js} +2 -2
  68. package/client-dist/{embedding-registry.module-TGWG2VER.js → embedding-registry.module-RZGHHZU5.js} +2 -2
  69. package/client-dist/{err.module-V5HQPNPJ.js → err.module-X6UEPN3L.js} +2 -2
  70. package/client-dist/{feedback.module-U2Z6XYBB.js → feedback.module-2R4SY2TO.js} +2 -2
  71. package/client-dist/{host-runtime-mcp.module-ZZGAS7DP.js → host-runtime-mcp.module-EMYRVQ3E.js} +2 -2
  72. package/client-dist/index.html +1 -1
  73. package/client-dist/{live-dev-pipeline.module-TPPLFJXH.js → live-dev-pipeline.module-F4CVC4GT.js} +2 -2
  74. package/client-dist/{logs.module-5ZT7XQ3Q.js → logs.module-Z6LHJ7CV.js} +2 -2
  75. package/client-dist/{main-NSPSEMNL.js → main-KDDSBWXD.js} +3 -3
  76. package/client-dist/{master-control-remote-poc.module-IK64YCVI.js → master-control-remote-poc.module-4XA676RK.js} +2 -2
  77. package/client-dist/{mobile-app.module-GI44MNWC.js → mobile-app.module-JMI7PNFE.js} +2 -2
  78. package/client-dist/{model-registry.module-F7M4C7MR.js → model-registry.module-FENJ2M5A.js} +2 -2
  79. package/client-dist/{oc.module-G4TGODLQ.js → oc.module-GAO2QTTP.js} +2 -2
  80. package/client-dist/{orc.module-DOAWAEFJ.js → orc.module-KFWHYDA4.js} +2 -2
  81. package/client-dist/{project-management.module-2SDSNJJL.js → project-management.module-U4KGDERT.js} +2 -2
  82. package/client-dist/project-source-routed.module-USJAUIRV.js +2 -0
  83. package/client-dist/{scheduler.module-25VUGCV3.js → scheduler.module-GCTKZ33L.js} +2 -2
  84. package/client-dist/{session.module-Q3KGKPUU.js → session.module-ODUH2WLD.js} +2 -2
  85. package/client-dist/{set.module-4NWORE5F.js → set.module-MT67GPDK.js} +2 -2
  86. package/client-dist/{setup.module-N3AYAAZ6.js → setup.module-ULOJZNLK.js} +2 -2
  87. package/client-dist/{terminals.module-3ELX7JV6.js → terminals.module-57KM2XRI.js} +2 -2
  88. package/client-dist/{voice-notes-poc.module-ZHORCWRL.js → voice-notes-poc.module-555BPDWS.js} +2 -2
  89. package/client-dist/{wfs.module-EDYBZUSQ.js → wfs.module-JJPUSWCI.js} +2 -2
  90. package/package.json +1 -1
  91. package/client-dist/project-source-routed.module-CQLNUDIR.js +0 -2
  92. /package/client-dist/{agent-instances.module-63DMGKO2.js.map → agent-instances.module-TUXJXTGH.js.map} +0 -0
  93. /package/client-dist/{ca.module-T4GLGQMJ.js.map → ca.module-HMLG5JWZ.js.map} +0 -0
  94. /package/client-dist/{cc-usage-dashboard.component-WQFT75MV.js.map → cc-usage-dashboard.component-CGMHIQZO.js.map} +0 -0
  95. /package/client-dist/{cc.module-PEJ6OV2U.js.map → cc.module-5WMNTNFR.js.map} +0 -0
  96. /package/client-dist/{chunk-WPT7HGB2.js.map → chunk-2MLW7YDA.js.map} +0 -0
  97. /package/client-dist/{chunk-JDBS6ZXD.js.map → chunk-3JHGYF3K.js.map} +0 -0
  98. /package/client-dist/{chunk-VA3QGKXE.js.map → chunk-5F5TCOBC.js.map} +0 -0
  99. /package/client-dist/{chunk-M4CGCNOB.js.map → chunk-5LANXE75.js.map} +0 -0
  100. /package/client-dist/{chunk-KD4JK4LC.js.map → chunk-5LWUFMRP.js.map} +0 -0
  101. /package/client-dist/{chunk-BJYELNNP.js.map → chunk-5ZJ7P2E3.js.map} +0 -0
  102. /package/client-dist/{chunk-GBRJVJWI.js.map → chunk-64VGC4TP.js.map} +0 -0
  103. /package/client-dist/{chunk-EUMQRYBI.js.map → chunk-6LLPBXMJ.js.map} +0 -0
  104. /package/client-dist/{chunk-WL5L5AUS.js.map → chunk-7YR26SUN.js.map} +0 -0
  105. /package/client-dist/{chunk-54YZZ7DI.js.map → chunk-BTU7ZELP.js.map} +0 -0
  106. /package/client-dist/{chunk-OHI3J35R.js.map → chunk-BVQ4H3QA.js.map} +0 -0
  107. /package/client-dist/{chunk-4MMPDNPS.js.map → chunk-BYGD4VXU.js.map} +0 -0
  108. /package/client-dist/{chunk-SNMSF3UC.js.map → chunk-CSBAACGJ.js.map} +0 -0
  109. /package/client-dist/{chunk-BNALWJUC.js.map → chunk-DNG6CDY4.js.map} +0 -0
  110. /package/client-dist/{chunk-ZE4SBBQZ.js.map → chunk-FKASFAW6.js.map} +0 -0
  111. /package/client-dist/{chunk-2AGHFWEW.js.map → chunk-G2LG5YAN.js.map} +0 -0
  112. /package/client-dist/{chunk-RZPQNQWP.js.map → chunk-GIWNEAC6.js.map} +0 -0
  113. /package/client-dist/{chunk-VILXJBM4.js.map → chunk-HDOMT44M.js.map} +0 -0
  114. /package/client-dist/{chunk-RIYSXVU2.js.map → chunk-HIXULZYA.js.map} +0 -0
  115. /package/client-dist/{chunk-SDS4IT63.js.map → chunk-HV2A2AJU.js.map} +0 -0
  116. /package/client-dist/{chunk-3ZIP6GFB.js.map → chunk-HWTO6BTX.js.map} +0 -0
  117. /package/client-dist/{chunk-ZELVI2B7.js.map → chunk-I6JSQIJW.js.map} +0 -0
  118. /package/client-dist/{chunk-TXVACKLG.js.map → chunk-IBZVNW2L.js.map} +0 -0
  119. /package/client-dist/{chunk-ZKMLJXN4.js.map → chunk-IXOQ2X3A.js.map} +0 -0
  120. /package/client-dist/{chunk-5Y3UBNHV.js.map → chunk-JIIIJX42.js.map} +0 -0
  121. /package/client-dist/{chunk-C4H7J567.js.map → chunk-JRM5W5XH.js.map} +0 -0
  122. /package/client-dist/{chunk-56Q57BLF.js.map → chunk-JWK54FLV.js.map} +0 -0
  123. /package/client-dist/{chunk-3GFRMENC.js.map → chunk-KFWHTXCI.js.map} +0 -0
  124. /package/client-dist/{chunk-UOZVXYOQ.js.map → chunk-KOQT2O67.js.map} +0 -0
  125. /package/client-dist/{chunk-UPREBG2C.js.map → chunk-LMJG2I62.js.map} +0 -0
  126. /package/client-dist/{chunk-BPWY4SOQ.js.map → chunk-M5NG4Q3Z.js.map} +0 -0
  127. /package/client-dist/{chunk-44PQAFEL.js.map → chunk-MJGLT4C2.js.map} +0 -0
  128. /package/client-dist/{chunk-TKAV5X35.js.map → chunk-MMQ57B6R.js.map} +0 -0
  129. /package/client-dist/{chunk-RJX7O3DI.js.map → chunk-MOASKRZP.js.map} +0 -0
  130. /package/client-dist/{chunk-H6OPOJX2.js.map → chunk-MOSWP4BJ.js.map} +0 -0
  131. /package/client-dist/{chunk-VS3F3LTC.js.map → chunk-N47ZRCQG.js.map} +0 -0
  132. /package/client-dist/{chunk-5VMMYEMK.js.map → chunk-NRJKTIZF.js.map} +0 -0
  133. /package/client-dist/{chunk-IOERVA2Z.js.map → chunk-PMLX3WAS.js.map} +0 -0
  134. /package/client-dist/{chunk-6PIFC53E.js.map → chunk-PTQ5H5MK.js.map} +0 -0
  135. /package/client-dist/{chunk-XSZRRELF.js.map → chunk-QAPJA5FD.js.map} +0 -0
  136. /package/client-dist/{chunk-PWGYG7KG.js.map → chunk-QDFXDY3C.js.map} +0 -0
  137. /package/client-dist/{chunk-73W3SDF2.js.map → chunk-QX6KVWQM.js.map} +0 -0
  138. /package/client-dist/{chunk-GABPE7B3.js.map → chunk-RFY7BLUK.js.map} +0 -0
  139. /package/client-dist/{chunk-OITOJMIX.js.map → chunk-S7V3R4PM.js.map} +0 -0
  140. /package/client-dist/{chunk-U3FLQ2MZ.js.map → chunk-S7YJ7PPV.js.map} +0 -0
  141. /package/client-dist/{chunk-2K7AS4TQ.js.map → chunk-TGDXETVE.js.map} +0 -0
  142. /package/client-dist/{chunk-AD7RW3IE.js.map → chunk-UECIUR5A.js.map} +0 -0
  143. /package/client-dist/{chunk-W3WV5NJ7.js.map → chunk-UFMIB2BX.js.map} +0 -0
  144. /package/client-dist/{chunk-5A22WYW7.js.map → chunk-VRKWX3KT.js.map} +0 -0
  145. /package/client-dist/{chunk-ATR4YAIL.js.map → chunk-VVEVLMXP.js.map} +0 -0
  146. /package/client-dist/{chunk-NNEFCEZZ.js.map → chunk-VVXNQD62.js.map} +0 -0
  147. /package/client-dist/{chunk-S2FEPCDW.js.map → chunk-WY3GPSWI.js.map} +0 -0
  148. /package/client-dist/{chunk-I3IKMSNZ.js.map → chunk-XJ7THHXW.js.map} +0 -0
  149. /package/client-dist/{chunk-CUMUA2HP.js.map → chunk-ZBR72J6L.js.map} +0 -0
  150. /package/client-dist/{chunk-NXBECCCW.js.map → chunk-ZR3PV6LV.js.map} +0 -0
  151. /package/client-dist/{consultant.module-H52V7TON.js.map → consultant.module-IWPWHJXW.js.map} +0 -0
  152. /package/client-dist/{crd.module-X5U6DQ3D.js.map → crd.module-A5GTPGDU.js.map} +0 -0
  153. /package/client-dist/{dashboard.module-4LC4RSOF.js.map → dashboard.module-UYMCOFAL.js.map} +0 -0
  154. /package/client-dist/{do.module-HWKFQZQK.js.map → do.module-FE4EU7J2.js.map} +0 -0
  155. /package/client-dist/{document-library.module-Z57ZOMUG.js.map → document-library.module-XJC3XSZT.js.map} +0 -0
  156. /package/client-dist/{embedding-eval.module-ULD6Z5XA.js.map → embedding-eval.module-IRFMQYUF.js.map} +0 -0
  157. /package/client-dist/{embedding-registry.module-TGWG2VER.js.map → embedding-registry.module-RZGHHZU5.js.map} +0 -0
  158. /package/client-dist/{err.module-V5HQPNPJ.js.map → err.module-X6UEPN3L.js.map} +0 -0
  159. /package/client-dist/{feedback.module-U2Z6XYBB.js.map → feedback.module-2R4SY2TO.js.map} +0 -0
  160. /package/client-dist/{host-runtime-mcp.module-ZZGAS7DP.js.map → host-runtime-mcp.module-EMYRVQ3E.js.map} +0 -0
  161. /package/client-dist/{live-dev-pipeline.module-TPPLFJXH.js.map → live-dev-pipeline.module-F4CVC4GT.js.map} +0 -0
  162. /package/client-dist/{logs.module-5ZT7XQ3Q.js.map → logs.module-Z6LHJ7CV.js.map} +0 -0
  163. /package/client-dist/{main-NSPSEMNL.js.map → main-KDDSBWXD.js.map} +0 -0
  164. /package/client-dist/{master-control-remote-poc.module-IK64YCVI.js.map → master-control-remote-poc.module-4XA676RK.js.map} +0 -0
  165. /package/client-dist/{mobile-app.module-GI44MNWC.js.map → mobile-app.module-JMI7PNFE.js.map} +0 -0
  166. /package/client-dist/{model-registry.module-F7M4C7MR.js.map → model-registry.module-FENJ2M5A.js.map} +0 -0
  167. /package/client-dist/{oc.module-G4TGODLQ.js.map → oc.module-GAO2QTTP.js.map} +0 -0
  168. /package/client-dist/{orc.module-DOAWAEFJ.js.map → orc.module-KFWHYDA4.js.map} +0 -0
  169. /package/client-dist/{project-management.module-2SDSNJJL.js.map → project-management.module-U4KGDERT.js.map} +0 -0
  170. /package/client-dist/{project-source-routed.module-CQLNUDIR.js.map → project-source-routed.module-USJAUIRV.js.map} +0 -0
  171. /package/client-dist/{scheduler.module-25VUGCV3.js.map → scheduler.module-GCTKZ33L.js.map} +0 -0
  172. /package/client-dist/{session.module-Q3KGKPUU.js.map → session.module-ODUH2WLD.js.map} +0 -0
  173. /package/client-dist/{set.module-4NWORE5F.js.map → set.module-MT67GPDK.js.map} +0 -0
  174. /package/client-dist/{setup.module-N3AYAAZ6.js.map → setup.module-ULOJZNLK.js.map} +0 -0
  175. /package/client-dist/{terminals.module-3ELX7JV6.js.map → terminals.module-57KM2XRI.js.map} +0 -0
  176. /package/client-dist/{voice-notes-poc.module-ZHORCWRL.js.map → voice-notes-poc.module-555BPDWS.js.map} +0 -0
  177. /package/client-dist/{wfs.module-EDYBZUSQ.js.map → wfs.module-JJPUSWCI.js.map} +0 -0
@@ -1,3 +1,3 @@
1
- import{a as n}from"./chunk-AD7RW3IE.js";import{G as o}from"./chunk-TBMJSIBB.js";var u=(()=>{class e{transform(t){return n.formatAbsoluteForTooltip(t)}static \u0275fac=function(i){return new(i||e)};static \u0275pipe=o({name:"sAbsoluteTime",type:e,pure:!0,standalone:!0})}return e})();var d=(()=>{class e{transform(t){return n.formatCompactRelativeTime(t)}static \u0275fac=function(i){return new(i||e)};static \u0275pipe=o({name:"sTimeAgo",type:e,pure:!0,standalone:!0})}return e})();var a=class e{static normalizeForSearch(r){return typeof r!="string"||r.length===0?"":r.trim().toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"")}static includesText(r,t){let i=e.normalizeForSearch(t);return i.length===0?!0:e.normalizeForSearch(r).includes(i)}};var s=class{static looksLikeJson(r){let t=r.trim();return t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]")}static formatJson(r){try{let t=JSON.parse(r.trim());return JSON.stringify(t,null,2)}catch{return r}}static lineCount(r){return r.split(`
1
+ import{a as n}from"./chunk-UECIUR5A.js";import{G as o}from"./chunk-TBMJSIBB.js";var u=(()=>{class e{transform(t){return n.formatAbsoluteForTooltip(t)}static \u0275fac=function(i){return new(i||e)};static \u0275pipe=o({name:"sAbsoluteTime",type:e,pure:!0,standalone:!0})}return e})();var d=(()=>{class e{transform(t){return n.formatCompactRelativeTime(t)}static \u0275fac=function(i){return new(i||e)};static \u0275pipe=o({name:"sTimeAgo",type:e,pure:!0,standalone:!0})}return e})();var a=class e{static normalizeForSearch(r){return typeof r!="string"||r.length===0?"":r.trim().toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"")}static includesText(r,t){let i=e.normalizeForSearch(t);return i.length===0?!0:e.normalizeForSearch(r).includes(i)}};var s=class{static looksLikeJson(r){let t=r.trim();return t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]")}static formatJson(r){try{let t=JSON.parse(r.trim());return JSON.stringify(t,null,2)}catch{return r}}static lineCount(r){return r.split(`
2
2
  `).length}};export{a,u as b,d as c,s as d};
3
- //# sourceMappingURL=chunk-TXVACKLG.js.map
3
+ //# sourceMappingURL=chunk-IBZVNW2L.js.map
@@ -1,2 +1,2 @@
1
- import{a as p}from"./chunk-RIYSXVU2.js";import{p as m}from"./chunk-VRI47IVY.js";import{G as i,h as s}from"./chunk-TBMJSIBB.js";var l=(()=>{class r{transform(n){return p.getDurationBand(n)}static \u0275fac=function(t){return new(t||r)};static \u0275pipe=i({name:"ccapDurationBand",type:r,pure:!0,standalone:!0})}return r})();var f=s(m()),a=f.second,u=60*a,c=60*u,o=class{static formatGenerationTimeMs(e){if(e==null||typeof e!="number"||Number.isNaN(e))return"\u2013";if(e<a)return`${Math.round(e)} ms`;if(e<u){let t=e/a;return t>=10||t%1===0?`${Math.round(t)} s`:`${t.toFixed(1)} s`}if(e<c){let t=e/u;return t>=10||t%1===0?`${Math.round(t)} min`:`${t.toFixed(1)} min`}let n=e/c;return n>=10||n%1===0?`${Math.round(n)} h`:`${n.toFixed(1)} h`}};var $=(()=>{class r{transform(n){return o.formatGenerationTimeMs(n)}static \u0275fac=function(t){return new(t||r)};static \u0275pipe=i({name:"ccapGenerationTime",type:r,pure:!0,standalone:!0})}return r})();export{l as a,$ as b};
2
- //# sourceMappingURL=chunk-ZKMLJXN4.js.map
1
+ import{a as p}from"./chunk-HIXULZYA.js";import{p as m}from"./chunk-762K6QXC.js";import{G as i,h as s}from"./chunk-TBMJSIBB.js";var l=(()=>{class r{transform(n){return p.getDurationBand(n)}static \u0275fac=function(t){return new(t||r)};static \u0275pipe=i({name:"ccapDurationBand",type:r,pure:!0,standalone:!0})}return r})();var f=s(m()),a=f.second,u=60*a,c=60*u,o=class{static formatGenerationTimeMs(e){if(e==null||typeof e!="number"||Number.isNaN(e))return"\u2013";if(e<a)return`${Math.round(e)} ms`;if(e<u){let t=e/a;return t>=10||t%1===0?`${Math.round(t)} s`:`${t.toFixed(1)} s`}if(e<c){let t=e/u;return t>=10||t%1===0?`${Math.round(t)} min`:`${t.toFixed(1)} min`}let n=e/c;return n>=10||n%1===0?`${Math.round(n)} h`:`${n.toFixed(1)} h`}};var $=(()=>{class r{transform(n){return o.formatGenerationTimeMs(n)}static \u0275fac=function(t){return new(t||r)};static \u0275pipe=i({name:"ccapGenerationTime",type:r,pure:!0,standalone:!0})}return r})();export{l as a,$ as b};
2
+ //# sourceMappingURL=chunk-IXOQ2X3A.js.map
@@ -1,2 +1,2 @@
1
- import{b as c}from"./chunk-VA3QGKXE.js";import{I as d,p as h}from"./chunk-VRI47IVY.js";import{C as l,aa as o,h as u,k as r,y as s}from"./chunk-TBMJSIBB.js";var e=function(t){return t.idle="idle",t.downloading="downloading",t.installing="installing",t.completed="completed",t.failed="failed",t}(e||{});var p=u(h());function m(){return typeof window.Capacitor<"u"&&window.Capacitor.isNativePlatform?.()===!0}function w(){let a=window.Capacitor?.Plugins?.AppUpdater;return a||null}var y=(()=>{class t{versionCheck_CS=l(c);downloadUrl=d.api.baseUrl+"/mobile/download";phase_$=o(e.idle);lastError_$=o("");startUpdate(){return r(this,null,function*(){let n=this.phase_$();if(!(n===e.downloading||n===e.installing)){this.lastError_$.set(""),this.phase_$.set(e.downloading);try{let i=w();if(i){this.phase_$.set(e.installing),yield i.downloadAndInstall({downloadUrl:this.downloadUrl}),this.phase_$.set(e.completed);return}this.openInSystemBrowser(this.downloadUrl),this.phase_$.set(e.completed)}catch(i){let f=i instanceof Error?i.message:String(i);this.lastError_$.set(f),this.phase_$.set(e.failed),p.DyFM_Error.logSimple("CCAP_MobileAppUpdater | startUpdate failed",i)}}})}autoUpdateIfAvailable(){return r(this,null,function*(){m()&&(yield this.versionCheck_CS.checkNow(),this.versionCheck_CS.updateAvailable_$()&&(yield this.startUpdate()))})}openInSystemBrowser(n){window.open(n,"_system")}static \u0275fac=function(i){return new(i||t)};static \u0275prov=s({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{e as a,y as b};
2
- //# sourceMappingURL=chunk-5Y3UBNHV.js.map
1
+ import{b as c}from"./chunk-5F5TCOBC.js";import{I as d,p as h}from"./chunk-762K6QXC.js";import{C as l,aa as o,h as u,k as r,y as s}from"./chunk-TBMJSIBB.js";var e=function(t){return t.idle="idle",t.downloading="downloading",t.installing="installing",t.completed="completed",t.failed="failed",t}(e||{});var p=u(h());function m(){return typeof window.Capacitor<"u"&&window.Capacitor.isNativePlatform?.()===!0}function w(){let a=window.Capacitor?.Plugins?.AppUpdater;return a||null}var y=(()=>{class t{versionCheck_CS=l(c);downloadUrl=d.api.baseUrl+"/mobile/download";phase_$=o(e.idle);lastError_$=o("");startUpdate(){return r(this,null,function*(){let n=this.phase_$();if(!(n===e.downloading||n===e.installing)){this.lastError_$.set(""),this.phase_$.set(e.downloading);try{let i=w();if(i){this.phase_$.set(e.installing),yield i.downloadAndInstall({downloadUrl:this.downloadUrl}),this.phase_$.set(e.completed);return}this.openInSystemBrowser(this.downloadUrl),this.phase_$.set(e.completed)}catch(i){let f=i instanceof Error?i.message:String(i);this.lastError_$.set(f),this.phase_$.set(e.failed),p.DyFM_Error.logSimple("CCAP_MobileAppUpdater | startUpdate failed",i)}}})}autoUpdateIfAvailable(){return r(this,null,function*(){m()&&(yield this.versionCheck_CS.checkNow(),this.versionCheck_CS.updateAvailable_$()&&(yield this.startUpdate()))})}openInSystemBrowser(n){window.open(n,"_system")}static \u0275fac=function(i){return new(i||t)};static \u0275prov=s({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{e as a,y as b};
2
+ //# sourceMappingURL=chunk-JIIIJX42.js.map
@@ -1,2 +1,2 @@
1
- import{I as s}from"./chunk-VRI47IVY.js";import{C as o,xb as i,y as n}from"./chunk-TBMJSIBB.js";var p=(()=>{class e{baseUrl=`${s.api.baseUrl}/document-library`;http=o(i);listDocuments(){return this.http.get(this.baseUrl)}getDocument(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t.documentId)}`)}uploadDocument(t){return this.http.post(`${this.baseUrl}/upload`,t.formData)}deleteDocument(t){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(t.documentId)}`)}startIndexing(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t.documentId)}/index`,{registryEntryId:t.registryEntryId})}getIndexingStatus(t){let r=new URLSearchParams({registryEntryId:t.registryEntryId}).toString();return this.http.get(`${this.baseUrl}/${encodeURIComponent(t.documentId)}/indexing-status?${r}`)}static \u0275fac=function(r){return new(r||e)};static \u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{p as a};
2
- //# sourceMappingURL=chunk-C4H7J567.js.map
1
+ import{I as s}from"./chunk-762K6QXC.js";import{C as o,xb as i,y as n}from"./chunk-TBMJSIBB.js";var p=(()=>{class e{baseUrl=`${s.api.baseUrl}/document-library`;http=o(i);listDocuments(){return this.http.get(this.baseUrl)}getDocument(t){return this.http.get(`${this.baseUrl}/${encodeURIComponent(t.documentId)}`)}uploadDocument(t){return this.http.post(`${this.baseUrl}/upload`,t.formData)}deleteDocument(t){return this.http.delete(`${this.baseUrl}/${encodeURIComponent(t.documentId)}`)}startIndexing(t){return this.http.post(`${this.baseUrl}/${encodeURIComponent(t.documentId)}/index`,{registryEntryId:t.registryEntryId})}getIndexingStatus(t){let r=new URLSearchParams({registryEntryId:t.registryEntryId}).toString();return this.http.get(`${this.baseUrl}/${encodeURIComponent(t.documentId)}/indexing-status?${r}`)}static \u0275fac=function(r){return new(r||e)};static \u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{p as a};
2
+ //# sourceMappingURL=chunk-JRM5W5XH.js.map
@@ -1,2 +1,2 @@
1
- import{a as k}from"./chunk-GBRJVJWI.js";import{a as C}from"./chunk-V3VQWJQL.js";import{I as U,L as P,t as A}from"./chunk-VRI47IVY.js";import{C as h,k as m,p as a,xb as M,y as b}from"./chunk-TBMJSIBB.js";var y=class{static readLlmCloudBucketsFromSectionResponse(n){return{anthropicLlm:v(n.anthropicSettings,{includeBaseUrl:!1}),googleLlm:v(n.googleSettings,{includeBaseUrl:!1}),deepseekLlm:v(n.deepseekSettings,{includeBaseUrl:!1}),fdpaiLlm:v(n.fdpaiSettings,{includeBaseUrl:!0})}}};function v(s,n){if(s==null||typeof s!="object"||Array.isArray(s))return{enabled:!1,defaultModel:"",baseUrl:"",apiKey:"",apiKeyMasked:""};let e=Reflect.get(s,"defaultModel"),o=Reflect.get(s,"apiKeyMasked"),i=Reflect.get(s,"baseUrl");return{enabled:Reflect.get(s,"enabled")===!0,defaultModel:typeof e=="string"?e:"",baseUrl:n.includeBaseUrl&&typeof i=="string"?i:"",apiKey:"",apiKeyMasked:typeof o=="string"?o:""}}var L=class{static parseLlmSettingsSectionForUi(n){let e=n.openAiSettings,o=!1,i="gpt-4o";if(e!=null&&typeof e=="object"&&!Array.isArray(e)){o=Reflect.get(e,"enabled")===!0;let t=Reflect.get(e,"defaultModel");typeof t=="string"&&(i=t)}let c=(Array.isArray(n.localAiSettings)?n.localAiSettings:[]).filter(t=>t!=null&&typeof t=="object"&&!Array.isArray(t)).map(t=>{let g=typeof t.key=="string"?t.key.trim():"";if(!g.length)return null;let S=typeof t.name=="string"?t.name:"",$=k.build({localAiKey:g}),T=S.trim().length>0?S.trim():"Local AI",_=t.enabled!==!1;return{id:$,baseUrl:(typeof t.baseUrl=="string"?t.baseUrl:"").trim(),model:(typeof t.defaultModel=="string"?t.defaultModel:"").trim(),label:T,enabled:_}}).filter(t=>t!=null),d=y.readLlmCloudBucketsFromSectionResponse(n),l=[];o&&l.push("open-ai"),d.anthropicLlm.enabled&&l.push("anthropic"),d.googleLlm.enabled&&l.push("google"),d.deepseekLlm.enabled&&l.push("deepseek"),d.fdpaiLlm.enabled&&l.push("fdp-ai");for(let t of c)t.enabled&&l.push(t.id);l.length===0&&l.push("open-ai");let F=c.map(t=>({id:t.id,label:t.label})),V=l.map(t=>({value:t,label:C.resolve(t,F)})),p=typeof n.defaultLlmProvider=="string"?n.defaultLlmProvider:"open-ai",u="";if(p==="open-ai")u=i;else if(p==="anthropic")u=d.anthropicLlm.defaultModel;else if(p==="google")u=d.googleLlm.defaultModel;else if(p==="deepseek")u=d.deepseekLlm.defaultModel;else if(p==="fdp-ai")u=d.fdpaiLlm.defaultModel;else{let t=c.find(g=>g.id===p);t&&(u=t.model)}return{enabledLlmProviderIds:l,llmProviderSelectOptions:V,defaultLlmProvider:p.trim(),defaultLlmModel:u.trim()}}};var I=(()=>{class s{baseUrl=`${U.api.baseUrl}/voice`;http=h(M);fetchVoiceNotesPoc(){return a(this.http.get(`${this.baseUrl}/poc/get-notes`))}fetchVoiceNotesQaSettings(){return a(this.http.get(`${this.baseUrl}/notes/qa-settings`))}saveVoiceNotesQaSettings(e){return a(this.http.put(`${this.baseUrl}/notes/qa-settings`,e,{headers:{"Content-Type":"application/json"}}))}saveVoiceNotesPoc(e){return a(this.http.put(`${this.baseUrl}/notes/poc`,e))}transcribeVoiceChunk(e){let o={qa:e.qaEnabled===!0?"1":"0",skip_classification:e.skipClassification!==!1?"true":"false"};e.confidenceThreshold!==void 0&&(o.confidence_threshold=String(e.confidenceThreshold)),e.noteContext!==void 0&&(o.note_context=e.noteContext);let i=Object.keys(o).map(c=>`${encodeURIComponent(c)}=${encodeURIComponent(o[c])}`).join("&"),f=`${this.baseUrl}/notes/transcribe${i?`?${i}`:""}`,r={"Content-Type":e.mimeType,Filename:e.filename};return a(this.http.post(f,e.blob,{headers:r}))}generateTtsSpeechBlob(e){return a(this.http.post(`${this.baseUrl}/tts/speech`,{input:e.text},{responseType:"blob"}))}getTtsMessageAudioUrl(e){let o=typeof e=="string"?e.trim():"";return o?`${this.baseUrl}/tts/message-audio/${encodeURIComponent(o)}`:""}getOrCreateTtsMessageAudio(e){return a(this.http.post(`${this.baseUrl}/tts/message-audio`,{sessionId:e.sessionId,role:e.role,content:e.content,timestamp:e.timestamp},{responseType:"blob",headers:{"Content-Type":"application/json"}}))}getVoiceSettings(){return a(this.http.get(`${this.baseUrl}/settings`))}saveTtsProvider(e){return a(this.http.post(`${this.baseUrl}/settings/tts-provider`,{provider:e}))}saveElevenLabsKey(e){return a(this.http.post(`${this.baseUrl}/settings/elevenlabs-key`,{apiKey:e}))}testElevenLabsApiKey(){return a(this.http.post(`${this.baseUrl}/settings/test-elevenlabs-key`,{}))}saveVoiceConfig(e){return a(this.http.post(`${this.baseUrl}/settings/voice-config`,{elevenLabsModelId:e.elevenLabsModelId,elevenLabsVoiceId:e.elevenLabsVoiceId}))}static \u0275fac=function(o){return new(o||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var Y=(()=>{class s{voice_AS=h(I);settings_AS=h(P);fetchQaEnabledFlag(){return m(this,null,function*(){try{return(yield this.voice_AS.fetchVoiceNotesQaSettings()).qaEnabled===!0}catch{return!1}})}loadSttQaSettingsPanelState(){return m(this,null,function*(){let e=yield this.voice_AS.fetchVoiceNotesQaSettings(),o=yield this.settings_AS.getSection(A.llmProviders),i=L.parseLlmSettingsSectionForUi(o),f=(e.providerName??"").trim(),r=[],c="";if(f.length>0){let d=yield this.fetchLlmModelsListForSttQa(f);r=[...d.models],c=d.errorMessage;let l=(e.modelName??"").trim();l.length>0&&!r.includes(l)&&(r=[l,...r])}return{qa:e,llmProviderSelectOptions:i.llmProviderSelectOptions,defaultLlmProvider:i.defaultLlmProvider,defaultLlmModel:i.defaultLlmModel,qaModelsForProvider:r,qaModelsListFetchError:c}})}fetchLlmModelsListForSttQa(e){return m(this,null,function*(){let o=e.trim();if(!o.length)return{models:[],errorMessage:""};try{let i=yield this.settings_AS.postListLlmModels({providerId:o}),f=i.models??[],r=typeof i.error=="string"?i.error.trim():"",c=i.success===!1;return f.length>0?{models:f,errorMessage:c?r.length>0?r:"Model list request failed.":""}:c?{models:[],errorMessage:r.length>0?r:"Model list request failed."}:{models:[],errorMessage:r}}catch(i){let f=i instanceof Error?i.message:String(i);return{models:[],errorMessage:f}}})}fetchLlmModelIdsForProvider(e){return m(this,null,function*(){return(yield this.fetchLlmModelsListForSttQa(e)).models})}normalizeConfusionMapEntries(e){return e.map(o=>({from:String(o.from).trim(),to:String(o.to).trim()})).filter(o=>o.from.length>0||o.to.length>0)}saveVoiceNotesQaSettings(e){return m(this,null,function*(){yield this.voice_AS.saveVoiceNotesQaSettings(e)})}fetchVoiceNotesPoc(){return this.voice_AS.fetchVoiceNotesPoc()}saveVoiceNotesPoc(e){return this.voice_AS.saveVoiceNotesPoc(e)}transcribeVoiceChunk(e){return this.voice_AS.transcribeVoiceChunk(e)}getTtsMessageAudioUrl(e){return this.voice_AS.getTtsMessageAudioUrl(e)}getOrCreateTtsMessageAudio(e){return this.voice_AS.getOrCreateTtsMessageAudio(e)}static \u0275fac=function(o){return new(o||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();export{y as a,I as b,Y as c};
2
- //# sourceMappingURL=chunk-56Q57BLF.js.map
1
+ import{a as k}from"./chunk-64VGC4TP.js";import{a as C}from"./chunk-V3VQWJQL.js";import{I as U,L as P,t as A}from"./chunk-762K6QXC.js";import{C as h,k as m,p as a,xb as M,y as b}from"./chunk-TBMJSIBB.js";var y=class{static readLlmCloudBucketsFromSectionResponse(n){return{anthropicLlm:v(n.anthropicSettings,{includeBaseUrl:!1}),googleLlm:v(n.googleSettings,{includeBaseUrl:!1}),deepseekLlm:v(n.deepseekSettings,{includeBaseUrl:!1}),fdpaiLlm:v(n.fdpaiSettings,{includeBaseUrl:!0})}}};function v(s,n){if(s==null||typeof s!="object"||Array.isArray(s))return{enabled:!1,defaultModel:"",baseUrl:"",apiKey:"",apiKeyMasked:""};let e=Reflect.get(s,"defaultModel"),o=Reflect.get(s,"apiKeyMasked"),i=Reflect.get(s,"baseUrl");return{enabled:Reflect.get(s,"enabled")===!0,defaultModel:typeof e=="string"?e:"",baseUrl:n.includeBaseUrl&&typeof i=="string"?i:"",apiKey:"",apiKeyMasked:typeof o=="string"?o:""}}var L=class{static parseLlmSettingsSectionForUi(n){let e=n.openAiSettings,o=!1,i="gpt-4o";if(e!=null&&typeof e=="object"&&!Array.isArray(e)){o=Reflect.get(e,"enabled")===!0;let t=Reflect.get(e,"defaultModel");typeof t=="string"&&(i=t)}let c=(Array.isArray(n.localAiSettings)?n.localAiSettings:[]).filter(t=>t!=null&&typeof t=="object"&&!Array.isArray(t)).map(t=>{let g=typeof t.key=="string"?t.key.trim():"";if(!g.length)return null;let S=typeof t.name=="string"?t.name:"",$=k.build({localAiKey:g}),T=S.trim().length>0?S.trim():"Local AI",_=t.enabled!==!1;return{id:$,baseUrl:(typeof t.baseUrl=="string"?t.baseUrl:"").trim(),model:(typeof t.defaultModel=="string"?t.defaultModel:"").trim(),label:T,enabled:_}}).filter(t=>t!=null),d=y.readLlmCloudBucketsFromSectionResponse(n),l=[];o&&l.push("open-ai"),d.anthropicLlm.enabled&&l.push("anthropic"),d.googleLlm.enabled&&l.push("google"),d.deepseekLlm.enabled&&l.push("deepseek"),d.fdpaiLlm.enabled&&l.push("fdp-ai");for(let t of c)t.enabled&&l.push(t.id);l.length===0&&l.push("open-ai");let F=c.map(t=>({id:t.id,label:t.label})),V=l.map(t=>({value:t,label:C.resolve(t,F)})),p=typeof n.defaultLlmProvider=="string"?n.defaultLlmProvider:"open-ai",u="";if(p==="open-ai")u=i;else if(p==="anthropic")u=d.anthropicLlm.defaultModel;else if(p==="google")u=d.googleLlm.defaultModel;else if(p==="deepseek")u=d.deepseekLlm.defaultModel;else if(p==="fdp-ai")u=d.fdpaiLlm.defaultModel;else{let t=c.find(g=>g.id===p);t&&(u=t.model)}return{enabledLlmProviderIds:l,llmProviderSelectOptions:V,defaultLlmProvider:p.trim(),defaultLlmModel:u.trim()}}};var I=(()=>{class s{baseUrl=`${U.api.baseUrl}/voice`;http=h(M);fetchVoiceNotesPoc(){return a(this.http.get(`${this.baseUrl}/poc/get-notes`))}fetchVoiceNotesQaSettings(){return a(this.http.get(`${this.baseUrl}/notes/qa-settings`))}saveVoiceNotesQaSettings(e){return a(this.http.put(`${this.baseUrl}/notes/qa-settings`,e,{headers:{"Content-Type":"application/json"}}))}saveVoiceNotesPoc(e){return a(this.http.put(`${this.baseUrl}/notes/poc`,e))}transcribeVoiceChunk(e){let o={qa:e.qaEnabled===!0?"1":"0",skip_classification:e.skipClassification!==!1?"true":"false"};e.confidenceThreshold!==void 0&&(o.confidence_threshold=String(e.confidenceThreshold)),e.noteContext!==void 0&&(o.note_context=e.noteContext);let i=Object.keys(o).map(c=>`${encodeURIComponent(c)}=${encodeURIComponent(o[c])}`).join("&"),f=`${this.baseUrl}/notes/transcribe${i?`?${i}`:""}`,r={"Content-Type":e.mimeType,Filename:e.filename};return a(this.http.post(f,e.blob,{headers:r}))}generateTtsSpeechBlob(e){return a(this.http.post(`${this.baseUrl}/tts/speech`,{input:e.text},{responseType:"blob"}))}getTtsMessageAudioUrl(e){let o=typeof e=="string"?e.trim():"";return o?`${this.baseUrl}/tts/message-audio/${encodeURIComponent(o)}`:""}getOrCreateTtsMessageAudio(e){return a(this.http.post(`${this.baseUrl}/tts/message-audio`,{sessionId:e.sessionId,role:e.role,content:e.content,timestamp:e.timestamp},{responseType:"blob",headers:{"Content-Type":"application/json"}}))}getVoiceSettings(){return a(this.http.get(`${this.baseUrl}/settings`))}saveTtsProvider(e){return a(this.http.post(`${this.baseUrl}/settings/tts-provider`,{provider:e}))}saveElevenLabsKey(e){return a(this.http.post(`${this.baseUrl}/settings/elevenlabs-key`,{apiKey:e}))}testElevenLabsApiKey(){return a(this.http.post(`${this.baseUrl}/settings/test-elevenlabs-key`,{}))}saveVoiceConfig(e){return a(this.http.post(`${this.baseUrl}/settings/voice-config`,{elevenLabsModelId:e.elevenLabsModelId,elevenLabsVoiceId:e.elevenLabsVoiceId}))}static \u0275fac=function(o){return new(o||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var Y=(()=>{class s{voice_AS=h(I);settings_AS=h(P);fetchQaEnabledFlag(){return m(this,null,function*(){try{return(yield this.voice_AS.fetchVoiceNotesQaSettings()).qaEnabled===!0}catch{return!1}})}loadSttQaSettingsPanelState(){return m(this,null,function*(){let e=yield this.voice_AS.fetchVoiceNotesQaSettings(),o=yield this.settings_AS.getSection(A.llmProviders),i=L.parseLlmSettingsSectionForUi(o),f=(e.providerName??"").trim(),r=[],c="";if(f.length>0){let d=yield this.fetchLlmModelsListForSttQa(f);r=[...d.models],c=d.errorMessage;let l=(e.modelName??"").trim();l.length>0&&!r.includes(l)&&(r=[l,...r])}return{qa:e,llmProviderSelectOptions:i.llmProviderSelectOptions,defaultLlmProvider:i.defaultLlmProvider,defaultLlmModel:i.defaultLlmModel,qaModelsForProvider:r,qaModelsListFetchError:c}})}fetchLlmModelsListForSttQa(e){return m(this,null,function*(){let o=e.trim();if(!o.length)return{models:[],errorMessage:""};try{let i=yield this.settings_AS.postListLlmModels({providerId:o}),f=i.models??[],r=typeof i.error=="string"?i.error.trim():"",c=i.success===!1;return f.length>0?{models:f,errorMessage:c?r.length>0?r:"Model list request failed.":""}:c?{models:[],errorMessage:r.length>0?r:"Model list request failed."}:{models:[],errorMessage:r}}catch(i){let f=i instanceof Error?i.message:String(i);return{models:[],errorMessage:f}}})}fetchLlmModelIdsForProvider(e){return m(this,null,function*(){return(yield this.fetchLlmModelsListForSttQa(e)).models})}normalizeConfusionMapEntries(e){return e.map(o=>({from:String(o.from).trim(),to:String(o.to).trim()})).filter(o=>o.from.length>0||o.to.length>0)}saveVoiceNotesQaSettings(e){return m(this,null,function*(){yield this.voice_AS.saveVoiceNotesQaSettings(e)})}fetchVoiceNotesPoc(){return this.voice_AS.fetchVoiceNotesPoc()}saveVoiceNotesPoc(e){return this.voice_AS.saveVoiceNotesPoc(e)}transcribeVoiceChunk(e){return this.voice_AS.transcribeVoiceChunk(e)}getTtsMessageAudioUrl(e){return this.voice_AS.getTtsMessageAudioUrl(e)}getOrCreateTtsMessageAudio(e){return this.voice_AS.getOrCreateTtsMessageAudio(e)}static \u0275fac=function(o){return new(o||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();export{y as a,I as b,Y as c};
2
+ //# sourceMappingURL=chunk-JWK54FLV.js.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-C4H7J567.js";import{a as u}from"./chunk-S2FEPCDW.js";import{L as c,t as l}from"./chunk-VRI47IVY.js";import{C as d,aa as n,k as i,p as r,y as a}from"./chunk-TBMJSIBB.js";var D=(()=>{class o{documents_$=n([]);selectedDocument_$=n(null);selectedChunkCount_$=n(0);isLoading_$=n(!1);uploadStatus_$=n("idle");error_$=n(null);defaultCorpusDocumentId_$=n("");registryEntries_$=n([]);registryLoading_$=n(!1);selectedRegistryEntryId_$=n("");indexingStatus_$=n(null);indexingActive_$=n(!1);indexingPollInterval=null;docLibrary_AS=d(g);erg_AS=d(u);settings_AS=d(c);loadDocuments(){return i(this,null,function*(){this.isLoading_$.set(!0),this.error_$.set(null);try{let e=yield r(this.docLibrary_AS.listDocuments());this.documents_$.set(e.items)}catch(e){let t=e instanceof Error?e.message:"Dokumentum-lista bet\xF6lt\xE9se sikertelen.";this.error_$.set(t)}finally{this.isLoading_$.set(!1)}})}loadDocumentDetail(e){return i(this,null,function*(){this.isLoading_$.set(!0),this.error_$.set(null);try{let t=yield r(this.docLibrary_AS.getDocument({documentId:e.documentId}));this.selectedDocument_$.set(t.document),this.selectedChunkCount_$.set(t.chunkCount)}catch(t){let s=t instanceof Error?t.message:"Dokumentum detail bet\xF6lt\xE9se sikertelen.";this.error_$.set(s)}finally{this.isLoading_$.set(!1)}})}uploadDocument(e){return i(this,null,function*(){this.uploadStatus_$.set("uploading"),this.error_$.set(null);let t=new FormData;t.append("file",e.file),t.append("name",e.name),e.description!==void 0&&e.description.trim()!==""&&t.append("description",e.description.trim());try{let s=yield r(this.docLibrary_AS.uploadDocument({formData:t}));return this.uploadStatus_$.set("done"),s}catch(s){let m=s instanceof Error?s.message:"Dokumentum felt\xF6lt\xE9se sikertelen.";throw this.error_$.set(m),this.uploadStatus_$.set("error"),s}})}deleteDocument(e){return i(this,null,function*(){this.error_$.set(null);try{yield r(this.docLibrary_AS.deleteDocument({documentId:e.documentId}));let t=this.documents_$();this.documents_$.set(t.filter(s=>s.id!==e.documentId))}catch(t){let s=t instanceof Error?t.message:"Dokumentum t\xF6rl\xE9se sikertelen.";throw this.error_$.set(s),t}})}loadRegistryEntries(){return i(this,null,function*(){this.registryLoading_$.set(!0);try{let e=yield this.erg_AS.getList({enabled:!0});this.registryEntries_$.set(e.list)}catch(e){let t=e instanceof Error?e.message:"Registry lista bet\xF6lt\xE9se sikertelen.";this.error_$.set(t)}finally{this.registryLoading_$.set(!1)}})}startIndexing(e){return i(this,null,function*(){this.error_$.set(null);try{yield r(this.docLibrary_AS.startIndexing({documentId:e.documentId,registryEntryId:e.registryEntryId})),this.indexingActive_$.set(!0),this.startIndexingPolling({documentId:e.documentId,registryEntryId:e.registryEntryId})}catch(t){let s=t instanceof Error?t.message:"Indexel\xE9s ind\xEDt\xE1sa sikertelen.";throw this.error_$.set(s),t}})}loadIndexingStatus(e){return i(this,null,function*(){try{let t=yield r(this.docLibrary_AS.getIndexingStatus({documentId:e.documentId,registryEntryId:e.registryEntryId}));this.indexingStatus_$.set(t)}catch{this.indexingStatus_$.set(null)}})}startIndexingPolling(e){this.stopIndexingPolling();let t=1500;this.indexingPollInterval=setInterval(()=>{this.pollIndexingStatus(e)},t),this.pollIndexingStatus(e)}pollIndexingStatus(e){return i(this,null,function*(){try{let t=yield r(this.docLibrary_AS.getIndexingStatus({documentId:e.documentId,registryEntryId:e.registryEntryId}));this.indexingStatus_$.set(t),t.total>0&&t.pending===0&&this.stopIndexingPolling()}catch{this.stopIndexingPolling()}})}stopIndexingPolling(){this.indexingPollInterval!==null&&(clearInterval(this.indexingPollInterval),this.indexingPollInterval=null),this.indexingActive_$.set(!1)}ngOnDestroy(){this.stopIndexingPolling()}loadDefaultCorpusDocumentId(){return i(this,null,function*(){try{let e=yield this.settings_AS.getSection(l.modelTesting),t=typeof e.embeddingTestCorpusDocumentId=="string"?e.embeddingTestCorpusDocumentId:"";this.defaultCorpusDocumentId_$.set(t)}catch{}})}setDefaultCorpusDocumentId(e){return i(this,null,function*(){this.error_$.set(null);try{let t=yield this.settings_AS.getSection(l.modelTesting),s={testAnalysisProvider:t.testAnalysisProvider??"open-ai",testAnalysisModel:t.testAnalysisModel??"",embeddingTestCorpusDocumentId:e.documentId};yield this.settings_AS.saveSection(l.modelTesting,s),this.defaultCorpusDocumentId_$.set(e.documentId)}catch(t){let s=t instanceof Error?t.message:"Default corpus be\xE1ll\xEDt\xE1sa sikertelen.";throw this.error_$.set(s),t}})}static \u0275fac=function(t){return new(t||o)};static \u0275prov=a({token:o,factory:o.\u0275fac})}return o})();export{D as a};
2
- //# sourceMappingURL=chunk-3GFRMENC.js.map
1
+ import{a as g}from"./chunk-JRM5W5XH.js";import{a as u}from"./chunk-WY3GPSWI.js";import{L as c,t as l}from"./chunk-762K6QXC.js";import{C as d,aa as n,k as i,p as r,y as a}from"./chunk-TBMJSIBB.js";var D=(()=>{class o{documents_$=n([]);selectedDocument_$=n(null);selectedChunkCount_$=n(0);isLoading_$=n(!1);uploadStatus_$=n("idle");error_$=n(null);defaultCorpusDocumentId_$=n("");registryEntries_$=n([]);registryLoading_$=n(!1);selectedRegistryEntryId_$=n("");indexingStatus_$=n(null);indexingActive_$=n(!1);indexingPollInterval=null;docLibrary_AS=d(g);erg_AS=d(u);settings_AS=d(c);loadDocuments(){return i(this,null,function*(){this.isLoading_$.set(!0),this.error_$.set(null);try{let e=yield r(this.docLibrary_AS.listDocuments());this.documents_$.set(e.items)}catch(e){let t=e instanceof Error?e.message:"Dokumentum-lista bet\xF6lt\xE9se sikertelen.";this.error_$.set(t)}finally{this.isLoading_$.set(!1)}})}loadDocumentDetail(e){return i(this,null,function*(){this.isLoading_$.set(!0),this.error_$.set(null);try{let t=yield r(this.docLibrary_AS.getDocument({documentId:e.documentId}));this.selectedDocument_$.set(t.document),this.selectedChunkCount_$.set(t.chunkCount)}catch(t){let s=t instanceof Error?t.message:"Dokumentum detail bet\xF6lt\xE9se sikertelen.";this.error_$.set(s)}finally{this.isLoading_$.set(!1)}})}uploadDocument(e){return i(this,null,function*(){this.uploadStatus_$.set("uploading"),this.error_$.set(null);let t=new FormData;t.append("file",e.file),t.append("name",e.name),e.description!==void 0&&e.description.trim()!==""&&t.append("description",e.description.trim());try{let s=yield r(this.docLibrary_AS.uploadDocument({formData:t}));return this.uploadStatus_$.set("done"),s}catch(s){let m=s instanceof Error?s.message:"Dokumentum felt\xF6lt\xE9se sikertelen.";throw this.error_$.set(m),this.uploadStatus_$.set("error"),s}})}deleteDocument(e){return i(this,null,function*(){this.error_$.set(null);try{yield r(this.docLibrary_AS.deleteDocument({documentId:e.documentId}));let t=this.documents_$();this.documents_$.set(t.filter(s=>s.id!==e.documentId))}catch(t){let s=t instanceof Error?t.message:"Dokumentum t\xF6rl\xE9se sikertelen.";throw this.error_$.set(s),t}})}loadRegistryEntries(){return i(this,null,function*(){this.registryLoading_$.set(!0);try{let e=yield this.erg_AS.getList({enabled:!0});this.registryEntries_$.set(e.list)}catch(e){let t=e instanceof Error?e.message:"Registry lista bet\xF6lt\xE9se sikertelen.";this.error_$.set(t)}finally{this.registryLoading_$.set(!1)}})}startIndexing(e){return i(this,null,function*(){this.error_$.set(null);try{yield r(this.docLibrary_AS.startIndexing({documentId:e.documentId,registryEntryId:e.registryEntryId})),this.indexingActive_$.set(!0),this.startIndexingPolling({documentId:e.documentId,registryEntryId:e.registryEntryId})}catch(t){let s=t instanceof Error?t.message:"Indexel\xE9s ind\xEDt\xE1sa sikertelen.";throw this.error_$.set(s),t}})}loadIndexingStatus(e){return i(this,null,function*(){try{let t=yield r(this.docLibrary_AS.getIndexingStatus({documentId:e.documentId,registryEntryId:e.registryEntryId}));this.indexingStatus_$.set(t)}catch{this.indexingStatus_$.set(null)}})}startIndexingPolling(e){this.stopIndexingPolling();let t=1500;this.indexingPollInterval=setInterval(()=>{this.pollIndexingStatus(e)},t),this.pollIndexingStatus(e)}pollIndexingStatus(e){return i(this,null,function*(){try{let t=yield r(this.docLibrary_AS.getIndexingStatus({documentId:e.documentId,registryEntryId:e.registryEntryId}));this.indexingStatus_$.set(t),t.total>0&&t.pending===0&&this.stopIndexingPolling()}catch{this.stopIndexingPolling()}})}stopIndexingPolling(){this.indexingPollInterval!==null&&(clearInterval(this.indexingPollInterval),this.indexingPollInterval=null),this.indexingActive_$.set(!1)}ngOnDestroy(){this.stopIndexingPolling()}loadDefaultCorpusDocumentId(){return i(this,null,function*(){try{let e=yield this.settings_AS.getSection(l.modelTesting),t=typeof e.embeddingTestCorpusDocumentId=="string"?e.embeddingTestCorpusDocumentId:"";this.defaultCorpusDocumentId_$.set(t)}catch{}})}setDefaultCorpusDocumentId(e){return i(this,null,function*(){this.error_$.set(null);try{let t=yield this.settings_AS.getSection(l.modelTesting),s={testAnalysisProvider:t.testAnalysisProvider??"open-ai",testAnalysisModel:t.testAnalysisModel??"",embeddingTestCorpusDocumentId:e.documentId};yield this.settings_AS.saveSection(l.modelTesting,s),this.defaultCorpusDocumentId_$.set(e.documentId)}catch(t){let s=t instanceof Error?t.message:"Default corpus be\xE1ll\xEDt\xE1sa sikertelen.";throw this.error_$.set(s),t}})}static \u0275fac=function(t){return new(t||o)};static \u0275prov=a({token:o,factory:o.\u0275fac})}return o})();export{D as a};
2
+ //# sourceMappingURL=chunk-KFWHTXCI.js.map
@@ -1,5 +1,5 @@
1
- import{a as S}from"./chunk-SNMSF3UC.js";import{M as m,t as g}from"./chunk-VRI47IVY.js";import{C as y,N as h,a as i,aa as u,b as c,k as d,y as f}from"./chunk-TBMJSIBB.js";function I(){return{instanceId:crypto.randomUUID(),label:"default",gatewayUrl:"ws://127.0.0.1:18789",authToken:void 0,isPrimary:!1,autoConnect:!1,testState:"idle"}}function p(o){let l=[],s=o.gatewayUrl??"",t=(o.message??"").toLowerCase(),e=o.failureType??"";return s.startsWith("wss://")&&(e==="ws-error"||e==="ws-close")&&l.push('A gateway wss:// (TLS) protokollt haszn\xE1l \u2014 ha self-signed certificate-et haszn\xE1l, enged\xE9lyezd az "Allow self-signed TLS" opci\xF3t.'),s.startsWith("ws://")&&!s.startsWith("wss://")&&(e==="ws-error"||e==="ws-close")&&l.push("Ha a gateway TLS-t (wss://) haszn\xE1l, cser\xE9ld az URL-t ws:// helyett wss://-re."),e==="timeout"&&l.push("A gateway nem v\xE1laszolt id\u0151ben. Ellen\u0151rizd, hogy fut-e a gateway process \xE9s el\xE9rhet\u0151-e a megadott c\xEDmen."),e==="ws-error"&&!l.length&&l.push("Nem siker\xFClt csatlakozni. Ellen\u0151rizd: 1) fut-e a gateway, 2) helyes-e az URL \xE9s port, 3) nincs-e t\u0171zfal az \xFAtban."),(t.includes("econnrefused")||t.includes("connection refused"))&&l.push("A kapcsolat visszautas\xEDtva \u2014 a gateway nem hallgat a megadott c\xEDmen/porton."),(t.includes("certificate")||t.includes("cert")||t.includes("ssl")||t.includes("tls"))&&l.push('TLS tan\xFAs\xEDtv\xE1ny hiba \u2014 self-signed certificate eset\xE9n enged\xE9lyezd az "Allow self-signed TLS" opci\xF3t.'),l.length?`
1
+ import{a as S}from"./chunk-CSBAACGJ.js";import{M as m,t as g}from"./chunk-762K6QXC.js";import{C as y,N as h,a as i,aa as u,b as c,k as d,y as f}from"./chunk-TBMJSIBB.js";function I(){return{instanceId:crypto.randomUUID(),label:"default",gatewayUrl:"ws://127.0.0.1:18789",authToken:void 0,isPrimary:!1,autoConnect:!1,testState:"idle"}}function p(o){let l=[],s=o.gatewayUrl??"",t=(o.message??"").toLowerCase(),e=o.failureType??"";return s.startsWith("wss://")&&(e==="ws-error"||e==="ws-close")&&l.push('A gateway wss:// (TLS) protokollt haszn\xE1l \u2014 ha self-signed certificate-et haszn\xE1l, enged\xE9lyezd az "Allow self-signed TLS" opci\xF3t.'),s.startsWith("ws://")&&!s.startsWith("wss://")&&(e==="ws-error"||e==="ws-close")&&l.push("Ha a gateway TLS-t (wss://) haszn\xE1l, cser\xE9ld az URL-t ws:// helyett wss://-re."),e==="timeout"&&l.push("A gateway nem v\xE1laszolt id\u0151ben. Ellen\u0151rizd, hogy fut-e a gateway process \xE9s el\xE9rhet\u0151-e a megadott c\xEDmen."),e==="ws-error"&&!l.length&&l.push("Nem siker\xFClt csatlakozni. Ellen\u0151rizd: 1) fut-e a gateway, 2) helyes-e az URL \xE9s port, 3) nincs-e t\u0171zfal az \xFAtban."),(t.includes("econnrefused")||t.includes("connection refused"))&&l.push("A kapcsolat visszautas\xEDtva \u2014 a gateway nem hallgat a megadott c\xEDmen/porton."),(t.includes("certificate")||t.includes("cert")||t.includes("ssl")||t.includes("tls"))&&l.push('TLS tan\xFAs\xEDtv\xE1ny hiba \u2014 self-signed certificate eset\xE9n enged\xE9lyezd az "Allow self-signed TLS" opci\xF3t.'),l.length?`
2
2
 
3
3
  `+l.join(`
4
4
  `):""}var _=(()=>{class o extends m{ociData_AS=y(S);section_$=u({form:{instances:[]}});updateForm(s){this.section_$.update(t=>c(i({},t),{form:i(i({},t.form),s)}))}setSection(s){this.section_$.set(s)}getSectionId(){return g.openclawRegistry}getSection_$(){return this.section_$}doLoad(){return d(this,null,function*(){let s=new Map;for(let a of this.section_$().form.instances)s.set(a.instanceId,{testState:a.testState,testLatencyMs:a.testLatencyMs,testError:a.testError,testResultMessage:a.testResultMessage,authTokenEditMode:a.authTokenEditMode,pairState:a.pairState,pairError:a.pairError,pairMessage:a.pairMessage,pairResultMessage:a.pairResultMessage,connectionStatus:a.connectionStatus,lastConnectedAt:a.lastConnectedAt});let e=(yield this.settings_AS.getSection(g.openclawRegistry)).instances,n=Array.isArray(e)?e.map(a=>{let r=s.get(a.instanceId);return c(i({},a),{authToken:void 0,testState:r?.testState??"idle",testLatencyMs:r?.testLatencyMs,testError:r?.testError,testResultMessage:r?.testResultMessage,authTokenEditMode:r?.authTokenEditMode??!1,pairState:r?.pairState??"idle",pairError:r?.pairError,pairMessage:r?.pairMessage,pairResultMessage:r?.pairResultMessage,connectionStatus:r?.connectionStatus,lastConnectedAt:r?.lastConnectedAt})}):[];this.section_$.set({form:{instances:n}}),this.enrichWithOciStatus().catch(()=>{})})}enrichWithOciStatus(){return d(this,null,function*(){let s=yield this.ociData_AS.listInstances(),t=new Map;for(let e of s.list)t.set(e.instanceId,e);this.section_$.update(e=>c(i({},e),{form:{instances:e.form.instances.map(n=>{let a=t.get(n.instanceId);return a?c(i({},n),{connectionStatus:a.connectionStatus,lastConnectedAt:a.lastConnectedAt}):n})}}))})}buildSaveBody(){return{instances:this.section_$().form.instances.map(t=>({instanceId:t.instanceId,label:t.label,gatewayUrl:t.gatewayUrl,authToken:t.authToken,isPrimary:t.isPrimary,autoConnect:t.autoConnect,allowSelfSignedTls:t.allowSelfSignedTls}))}}savingInstanceId_$=u(null);buildSaveBodyForInstance(s){let t=this.section_$().form.instances.find(e=>e.instanceId===s);return t?{openclawRegistrySaveScope:"instance",targetInstanceId:s,instances:[{instanceId:t.instanceId,label:t.label,gatewayUrl:t.gatewayUrl,authToken:t.authToken,isPrimary:t.isPrimary,autoConnect:t.autoConnect,allowSelfSignedTls:t.allowSelfSignedTls}]}:{}}saveInstance(s){return d(this,null,function*(){this.savingInstanceId_$.set(s),this.saveError_$.set(null);try{let t=this.buildSaveBodyForInstance(s);yield this.doSave(t),yield this.load()}catch(t){this.saveError_$.set(o.getErrorMessage(t))}finally{this.savingInstanceId_$.set(null)}})}addInstance(){let s=I();this.section_$().form.instances.length||(s.isPrimary=!0),this.section_$.update(t=>c(i({},t),{form:{instances:[...t.form.instances,s]}}))}removeInstance(s){this.section_$.update(t=>{let e=t.form.instances.filter((a,r)=>r!==s);return(t.form.instances[s]?.isPrimary??!1)&&e.length>0&&(e[0]=c(i({},e[0]),{isPrimary:!0})),c(i({},t),{form:{instances:e}})})}updateInstance(s,t){this.section_$.update(e=>{let n=e.form.instances.map((a,r)=>r!==s?a:i(i({},a),t));return c(i({},e),{form:{instances:n}})})}setPrimary(s){this.section_$.update(t=>{let e=t.form.instances.map((n,a)=>c(i({},n),{isPrimary:a===s}));return c(i({},t),{form:{instances:e}})})}testConnection(s){return d(this,null,function*(){let t=this.section_$().form.instances[s];if(t){this.updateInstance(s,{testState:"testing",testLatencyMs:void 0,testError:void 0,testResultMessage:void 0});try{let e=yield this.settings_AS.testOpenclawConnection({gatewayUrl:t.gatewayUrl,authToken:t.authToken,allowSelfSignedTls:t.allowSelfSignedTls,instanceId:t.instanceId});if(e.success){let n=e.checks,a=n?" | WS: OK | v3 Handshake: OK | Sessions: OK"+(typeof n.sessionCount=="number"?` (${n.sessionCount} session)`:""):"";this.updateInstance(s,{testState:"ok",testLatencyMs:e.latencyMs,testError:void 0,testResultMessage:`Gateway el\xE9rhet\u0151 \u2014 v\xE1laszid\u0151: ${e.latencyMs}ms${a}`})}else{let n=e.error?.context?.failureType?String(e.error.context.failureType):"unknown",a=p({failureType:n,gatewayUrl:typeof e.error?.context?.gatewayUrl=="string"?e.error.context.gatewayUrl:t.gatewayUrl,message:e.error?.message});this.updateInstance(s,{testState:"error",testLatencyMs:void 0,testError:e.error??new Error("Connection failed"),testResultMessage:`Kapcsol\xF3d\xE1s sikertelen (${n}): ${e.error?.message??"ismeretlen hiba"}${a}`})}}catch(e){let n=e&&typeof e=="object"&&"error"in e?e.error:void 0,a=n?.message?String(n.message):e instanceof Error?e.message:String(e),r=p({gatewayUrl:t.gatewayUrl,message:a});this.updateInstance(s,{testState:"error",testError:n??e,testResultMessage:`Teszt hiba: ${a}${r}`})}}})}pairingInstanceId_$=u(null);pairInstance(s){return d(this,null,function*(){let t=this.section_$().form.instances[s];if(t){this.pairingInstanceId_$.set(t.instanceId),this.updateInstance(s,{pairState:"pairing",pairError:void 0,pairMessage:void 0});try{let e=yield this.settings_AS.pairOpenclawInstance({instanceId:t.instanceId});if(e.status==="paired")this.updateInstance(s,{pairState:"paired",pairingStatus:"paired",pairedAt:e.pairedAt,deviceTokenMasked:e.deviceTokenMasked,ccapDeviceId:e.ccapDeviceId,pairMessage:e.message,pairError:void 0,pairResultMessage:`Sikeresen p\xE1ros\xEDtva \u2014 device token megkapva${e.pairedAt?" ("+e.pairedAt+")":""}`});else if(e.status==="pending")this.updateInstance(s,{pairState:"pending",pairingStatus:"pending",ccapDeviceId:e.ccapDeviceId,pairingRequestId:e.pairingRequestId,pairMessage:e.message,pairError:void 0,pairResultMessage:`J\xF3v\xE1hagy\xE1sra v\xE1r a gateway-en \u2014 Device ID: ${e.ccapDeviceId??"N/A"}`});else if(e.status==="rejected")this.updateInstance(s,{pairState:"rejected",pairingStatus:"rejected",ccapDeviceId:e.ccapDeviceId,pairMessage:e.message,pairError:void 0,pairResultMessage:`A gateway elutas\xEDtotta a p\xE1ros\xEDt\xE1st: ${e.message??"ismeretlen ok"}`});else{let n=e.error?.context,a=p({failureType:typeof n?.failureType=="string"?n.failureType:void 0,gatewayUrl:typeof n?.gatewayUrl=="string"?n.gatewayUrl:t.gatewayUrl,message:e.message??e.error?.message});this.updateInstance(s,{pairState:"error",pairError:e.error??new Error(e.message??"Pairing failed"),pairMessage:e.message,pairResultMessage:`P\xE1ros\xEDt\xE1s hiba: ${e.message??e.error?.message??"ismeretlen hiba"}${a}`})}yield this.load()}catch(e){let n=e&&typeof e=="object"&&"error"in e?e.error:void 0,a=n?.message?String(n.message):e instanceof Error?e.message:String(e),r=n?.context,w=p({failureType:typeof r?.failureType=="string"?r.failureType:void 0,gatewayUrl:typeof r?.gatewayUrl=="string"?r.gatewayUrl:t.gatewayUrl,message:a});this.updateInstance(s,{pairState:"error",pairError:n??e,pairMessage:void 0,pairResultMessage:`P\xE1ros\xEDt\xE1s hiba: ${a}${w}`})}finally{this.pairingInstanceId_$.set(null)}}})}static \u0275fac=(()=>{let s;return function(e){return(s||(s=h(o)))(e||o)}})();static \u0275prov=f({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();export{_ as a};
5
- //# sourceMappingURL=chunk-UOZVXYOQ.js.map
5
+ //# sourceMappingURL=chunk-KOQT2O67.js.map
@@ -1,2 +1,2 @@
1
- import{a as H,b as Ae}from"./chunk-BPWY4SOQ.js";import{a as we}from"./chunk-UFBTR2BG.js";import{a as te,b as p}from"./chunk-6Y7O2W4H.js";import{a as Ie,b as ge,c as ve,d as Re}from"./chunk-RJX7O3DI.js";import{a as Ce}from"./chunk-SNMSF3UC.js";import{e as ye}from"./chunk-M4CGCNOB.js";import{L as he,p as ee,t as ae}from"./chunk-VRI47IVY.js";import{C as x,a as R,aa as P,b as A,d as Se,h as J,hb as D,jb as me,k as $,wb as fe,y as Z}from"./chunk-TBMJSIBB.js";var M=function(i){return i.standing="standing",i.working="working",i.sitting="sitting",i.walkingIn="walking-in",i.walkingOut="walking-out",i.walkingBetween="walking-between",i.idleWalking="idle-walking",i}(M||{});var O=function(i){return i.workstation="workstation",i.rest="rest",i.meeting="meeting",i}(O||{});var C=function(i){return i.ccap="ccap",i.openclaw="openclaw",i.ccSession="cc-session",i.caSession="ca-session",i}(C||{});var X=function(i){return i.average="average",i.slim="slim",i.stocky="stocky",i.athletic="athletic",i}(X||{});var Y=function(i){return i.casual="casual",i.formal="formal",i.hoodie="hoodie",i.tshirt="tshirt",i}(Y||{});var j=function(i){return i.short="short",i.long="long",i.spiky="spiky",i.curly="curly",i.bald="bald",i.mohawk="mohawk",i}(j||{});var it=["#f5c592","#e8a96e","#d4845a","#c06a3c","#9b5930","#7a3d1c","#4a2412"],ot=["#1a1006","#3b2505","#6b3d11","#9b6720","#c9a227","#e8d5a3","#f0f0f0","#a0a0a0","#2a4080","#8b1a2a"],at=["#1e40af","#166534","#7f1d1d","#4c1d95","#134e4a","#713f12","#374151","#6b21a8","#0f766e","#1e3a5f","#b45309","#be185d","#475569"],rt=["#1e293b","#374151","#292524","#1e3a5f","#1a2e05","#2d1b69","#3b1a08","#1a1a2e"],ct=["#1a1a1a","#3b5998","#2d8a4e","#8b4513","#4b0082","#5f9ea0"],b={skinColor:"#e8a96e",hairColor:"#1a1006",hairStyle:j.short,shirtColor:"#1e40af",clothingStyle:Y.casual,pantsColor:"#1e293b",eyeColor:"#1a1a1a",bodyType:X.average,displayName:""},_={skinColor:"#b0bec5",hairColor:"#37474f",hairStyle:j.short,shirtColor:"#0288d1",clothingStyle:Y.tshirt,pantsColor:"#263238",eyeColor:"#00bcd4",bodyType:X.average,displayName:""},L={skinColor:"#d4c4a8",hairColor:"#2d1b0e",hairStyle:j.short,shirtColor:"#5b21b6",clothingStyle:Y.casual,pantsColor:"#312e81",eyeColor:"#4338ca",bodyType:X.average,displayName:""},N={skinColor:"#e2e8f0",hairColor:"#0f172a",hairStyle:j.short,shirtColor:"#0d9488",clothingStyle:Y.casual,pantsColor:"#134e4a",eyeColor:"#14b8a6",bodyType:X.average,displayName:""};var Me=2e3;var F=(()=>{class i{static officeInstanceIdPrefix="cai:";static build(e){return`${i.officeInstanceIdPrefix}${e.ccapId.trim()}`}static parseCcapId(e){let t=e.trim();if(!t.startsWith(i.officeInstanceIdPrefix))return null;let s=t.slice(i.officeInstanceIdPrefix.length).trim();return s.length>0?s:null}}return i})();var U=(()=>{class i{static officeInstanceIdPrefix="cci:";static build(e){return`${i.officeInstanceIdPrefix}${e.ccapId.trim()}`}static parseCcapId(e){let t=e.trim();if(!t.startsWith(i.officeInstanceIdPrefix))return null;let s=t.slice(i.officeInstanceIdPrefix.length).trim();return s.length>0?s:null}}return i})();var E=class i{static clampGrid(n){return{workstationCols:i.clampDim(n.workstationCols),workstationRows:i.clampDim(n.workstationRows),restCols:i.clampDim(n.restCols),restRows:i.clampDim(n.restRows),meetingCols:i.clampDim(n.meetingCols),meetingRows:i.clampDim(n.meetingRows)}}static computeDerived(n){let e=i.clampGrid(n),t=4*32,s=3*32,a=i.computeWorkspaceWidthPx(e.workstationCols),o=i.computeLoungeWidthPx(e.restCols),r=6*32,c=a+r+o,u=8*32,l=c+u,d=e.workstationRows*6*32,f=3*32+e.meetingRows*5*32+3*32,h=Math.max(2*32,Math.round(f/2)),I=s+d,S=2*32,m=I+h+32,g=t-32,w=S,y=c+2*32,v=m-w,k=m+3*32,T={x:t,y:s,w:a,h:d},G={x:t+a,y:s,w:r,h:m-s},B={x:t+a+r,y:s,w:o,h:m-s},oe={x:t,y:I,w:a,h},De=t+a,ue=t+a+r,Oe=I,be={x:G.x+Math.round(G.w/2),y:m-2*32},_e=i.buildWorkstationSlots(e,T),de=i.buildMeetingSlots(e,oe),Le=i.buildWorkstationDesks(e,T),pe=i.buildLoungeSeatingLayout(e,B),Ne=pe.restSlots,We=pe.loungeSofas,$e=i.buildConferenceFurniture(oe,de),Fe=t+Math.round(a/2),Ue=ue+Math.round(o/2),Ve=t+Math.round(a/2),Ge=s+32,Xe=S+32/2;return{worldW:l,worldH:k,environmentOverflowPx:3e3,buildingOuter:{x:g,y:w,w:y,h:v},floorWorkspace:T,floorLobby:G,floorLounge:B,floorConference:oe,zoneSplitX:De,zoneSplitLobbyLoungeX:ue,topFloorBottomY:Oe,door:be,workstationSlots:_e,restSlots:Ne,meetingSlots:de,workstationDesks:Le,loungeSofas:We,conference:$e,windowsNorthY:Xe,labelWorkspaceX:Fe,labelLoungeX:Ue,labelConferenceX:Ve,ceilingNeonY:Ge}}static workstationCapacity(n){let e=i.clampGrid(n);return e.workstationCols*e.workstationRows}static restCapacity(n){let e=i.clampGrid(n);return e.restCols*e.restRows*2}static meetingCapacity(n){return 2*i.clampGrid(n).meetingCols+2}static clampDim(n){if(!Number.isFinite(n))return 1;let e=Math.floor(n);return e<1?1:e>12?12:e}static computeWorkspaceWidthPx(n){let s=128+n*256;return Math.max(896,s)}static computeLoungeWidthPx(n){return 140+n*170}static buildWorkstationSlots(n,e){let t=[],s=i.workstationPitchX(n.workstationCols,e.w),a=e.x+64,o=i.workstationRowFeetY(n.workstationRows,e);for(let r=0;r<n.workstationRows;r++)for(let c=0;c<n.workstationCols;c++)t.push({x:Math.round(a+c*s),y:o[r]});return t}static workstationPitchX(n,e){return n<=1?0:n===3&&e===896?96:Math.max(96,Math.round((e-192)/(n-1)))}static workstationRowFeetY(n,e){if(n===3)return[e.y+112,e.y+250,e.y+452];let t=[],s=48,o=e.h-s-48,r=n<=1?0:o/(n-1);for(let c=0;c<n;c++)t.push(Math.round(e.y+s+c*r));return t}static buildWorkstationDesks(n,e){let t=[],s=i.workstationPitchX(n.workstationCols,e.w),a=e.x+64,o=i.workstationDeskTopY(n.workstationRows,e);for(let r=0;r<n.workstationRows;r++)for(let c=0;c<n.workstationCols;c++){let l=Math.round(a+c*s)-32,d=o[r],f=(r+c)%2===0;t.push({trackId:`ws-${r}-${c}`,x:l,y:d,monitorIsCyan:f})}return t}static workstationDeskTopY(n,e){return n===3?[e.y+64,e.y+256,e.y+404]:i.workstationRowFeetY(n,e).map(s=>s-48)}static buildLoungeSeatingLayout(n,e){let t=[],s=[],h=e.w-32,S=(e.h-2*18)/Math.max(1,n.restRows);for(let m=0;m<n.restRows;m++){let g=e.y+18+m*S,w=S-14;if(n.restCols<=1){let y=Math.min(188,Math.max(120,e.w-32)),v=e.x+Math.round((e.w-y)/2),k=Math.round(g+w*.12);t.push({trackId:`lounge-${m}-0`,x:v,y:k,w:y,h:36});let T=k+36+14;s.push({x:v+Math.round(y*.33),y:T}),s.push({x:v+Math.round(y*.67),y:T})}else{let y=(n.restCols-1)*12,v=Math.max(96,Math.round((h-y)/n.restCols));for(let k=0;k<n.restCols;k++){let T=e.x+16+k*(v+12),G=Math.round(g+w*.12);t.push({trackId:`lounge-${m}-${k}`,x:T,y:G,w:v,h:36});let B=G+36+14;s.push({x:T+Math.round(v*.33),y:B}),s.push({x:T+Math.round(v*.67),y:B})}}}return{restSlots:s,loungeSofas:t}}static buildMeetingSlots(n,e){return i.computeConferenceChairPositions(n,e)}static computeConferenceChairPositions(n,e){let t=[],s=Math.min(420,e.w-80),a=56,o=e.x+Math.round((e.w-s)/2),r=e.y+Math.round(e.h/2)-Math.round(a/2),c=26,u=Math.max(1,n.meetingCols);for(let d=0;d<u;d++){let f=o+Math.round((d+1)*s/(u+1));t.push({x:f,y:r-c})}for(let d=0;d<u;d++){let f=o+Math.round((d+1)*s/(u+1));t.push({x:f,y:r+a+c})}let l=r+Math.round(a/2);return t.push({x:o-c,y:l}),t.push({x:o+s+c,y:l}),t}static buildConferenceFurniture(n,e){let t=Math.min(420,n.w-80),s=56,a={x:n.x+Math.round((n.w-t)/2),y:n.y+Math.round(n.h/2)-Math.round(s/2),w:t,h:s},o=e.map((r,c)=>({trackId:`conf-chair-${c}`,x:r.x,y:r.y}));return{table:a,chairs:o}}};var se={workstationCols:3,workstationRows:3,restCols:2,restRows:3,meetingCols:2,meetingRows:2,maxEverWorkstationCols:3,maxEverWorkstationRows:3,maxEverRestCols:2,maxEverRestRows:3,maxEverMeetingCols:2,maxEverMeetingRows:2},ke=(()=>{class i{settings_AS=x(he);layoutPersisted_$=P(se);saveTimerId;grid_$=D(()=>{let e=this.layoutPersisted_$();return{workstationCols:e.workstationCols,workstationRows:e.workstationRows,restCols:e.restCols,restRows:e.restRows,meetingCols:e.meetingCols,meetingRows:e.meetingRows}});derived_$=D(()=>E.computeDerived(this.grid_$()));workstationCapacity_$=D(()=>E.workstationCapacity(this.grid_$()));restCapacity_$=D(()=>E.restCapacity(this.grid_$()));meetingCapacity_$=D(()=>E.meetingCapacity(this.grid_$()));maxEverDisplay_$=D(()=>this.layoutPersisted_$());constructor(){this.loadFromServer()}loadFromServer(){return $(this,null,function*(){try{let e=yield this.settings_AS.getSection(ae.darkOfficeLayout);if(e==null||Object.keys(e).length===0){this.layoutPersisted_$.set(se);return}let t=i.parsePayload(e);this.layoutPersisted_$.set(t)}catch{this.layoutPersisted_$.set(se)}})}ensureMinCapacitiesFromSceneCharacters(e){let t=0,s=0,a=0;for(let c of e)c.scenePlacement===O.meeting?a++:c.presence===p.working?t++:s++;let o=this.layoutPersisted_$(),r=R({},o);r=i.expandGridToFit(r,t,s,a),!i.isSamePersisted(o,r)&&(this.layoutPersisted_$.set(r),this.scheduleDebouncedSave())}applyPersistedFromUser(e){return $(this,null,function*(){this.layoutPersisted_$.set(R({},e)),yield this.saveNow()})}validateProposedGridAgainstSceneCharacters(e){let t=E.clampGrid(e.grid),s=0,a=0,o=0;for(let l of e.characters)l.scenePlacement===O.meeting?o++:l.presence===p.working?s++:a++;let r=E.workstationCapacity(t),c=E.restCapacity(t),u=E.meetingCapacity(t);return s<=r&&a<=c&&o<=u?null:`Dark office layout rejected: scene occupancy exceeds proposed capacity. workstation=${s}/${r}, rest=${a}/${c}, meeting=${o}/${u}.`}getWorkstationSlots(){return this.derived_$().workstationSlots}getRestSlots(){return this.derived_$().restSlots}getMeetingSlots(){return this.derived_$().meetingSlots}getDoorPosition(){return this.derived_$().door}scheduleDebouncedSave(){this.saveTimerId!==void 0&&clearTimeout(this.saveTimerId),this.saveTimerId=setTimeout(()=>{this.saveTimerId=void 0,this.saveNow()},500)}saveNow(){return $(this,null,function*(){let e={workstationCols:this.layoutPersisted_$().workstationCols,workstationRows:this.layoutPersisted_$().workstationRows,restCols:this.layoutPersisted_$().restCols,restRows:this.layoutPersisted_$().restRows,meetingCols:this.layoutPersisted_$().meetingCols,meetingRows:this.layoutPersisted_$().meetingRows,maxEverWorkstationCols:this.layoutPersisted_$().maxEverWorkstationCols,maxEverWorkstationRows:this.layoutPersisted_$().maxEverWorkstationRows,maxEverRestCols:this.layoutPersisted_$().maxEverRestCols,maxEverRestRows:this.layoutPersisted_$().maxEverRestRows,maxEverMeetingCols:this.layoutPersisted_$().maxEverMeetingCols,maxEverMeetingRows:this.layoutPersisted_$().maxEverMeetingRows};try{yield this.settings_AS.saveSection(ae.darkOfficeLayout,e)}catch{}})}static parsePayload(e){let t=(o,r)=>{let c=e[o];return typeof c=="number"&&Number.isFinite(c)?Math.floor(c):r},s=se,a={workstationCols:t("workstationCols",s.workstationCols),workstationRows:t("workstationRows",s.workstationRows),restCols:t("restCols",s.restCols),restRows:t("restRows",s.restRows),meetingCols:t("meetingCols",s.meetingCols),meetingRows:t("meetingRows",s.meetingRows),maxEverWorkstationCols:t("maxEverWorkstationCols",s.maxEverWorkstationCols),maxEverWorkstationRows:t("maxEverWorkstationRows",s.maxEverWorkstationRows),maxEverRestCols:t("maxEverRestCols",s.maxEverRestCols),maxEverRestRows:t("maxEverRestRows",s.maxEverRestRows),maxEverMeetingCols:t("maxEverMeetingCols",s.maxEverMeetingCols),maxEverMeetingRows:t("maxEverMeetingRows",s.maxEverMeetingRows)};return i.clampPersisted(a)}static clampPersisted(e){let t=a=>{if(!Number.isFinite(a))return 1;let o=Math.floor(a);return o<1?1:o>12?12:o},s={workstationCols:t(e.workstationCols),workstationRows:t(e.workstationRows),restCols:t(e.restCols),restRows:t(e.restRows),meetingCols:t(e.meetingCols),meetingRows:t(e.meetingRows),maxEverWorkstationCols:t(e.maxEverWorkstationCols),maxEverWorkstationRows:t(e.maxEverWorkstationRows),maxEverRestCols:t(e.maxEverRestCols),maxEverRestRows:t(e.maxEverRestRows),maxEverMeetingCols:t(e.maxEverMeetingCols),maxEverMeetingRows:t(e.maxEverMeetingRows)};return s.maxEverWorkstationCols=Math.max(s.maxEverWorkstationCols,s.workstationCols),s.maxEverWorkstationRows=Math.max(s.maxEverWorkstationRows,s.workstationRows),s.maxEverRestCols=Math.max(s.maxEverRestCols,s.restCols),s.maxEverRestRows=Math.max(s.maxEverRestRows,s.restRows),s.maxEverMeetingCols=Math.max(s.maxEverMeetingCols,s.meetingCols),s.maxEverMeetingRows=Math.max(s.maxEverMeetingRows,s.meetingRows),s}static isSamePersisted(e,t){return e.workstationCols===t.workstationCols&&e.workstationRows===t.workstationRows&&e.restCols===t.restCols&&e.restRows===t.restRows&&e.meetingCols===t.meetingCols&&e.meetingRows===t.meetingRows&&e.maxEverWorkstationCols===t.maxEverWorkstationCols&&e.maxEverWorkstationRows===t.maxEverWorkstationRows&&e.maxEverRestCols===t.maxEverRestCols&&e.maxEverRestRows===t.maxEverRestRows&&e.maxEverMeetingCols===t.maxEverMeetingCols&&e.maxEverMeetingRows===t.maxEverMeetingRows}static expandGridToFit(e,t,s,a){let o=e.workstationCols,r=e.workstationRows,c=e.restCols,u=e.restRows,l=e.meetingCols,d=e.meetingRows;for(;o*r<t&&(o<12||r<12);)o<=r?o=Math.min(12,o+1):r=Math.min(12,r+1);for(;c*u<s&&(c<12||u<12);)c<=u?c=Math.min(12,c+1):u=Math.min(12,u+1);for(;l*d<a&&(l<12||d<12);)l<=d?l=Math.min(12,l+1):d=Math.min(12,d+1);let f={workstationCols:o,workstationRows:r,restCols:c,restRows:u,meetingCols:l,meetingRows:d,maxEverWorkstationCols:Math.max(e.maxEverWorkstationCols,o),maxEverWorkstationRows:Math.max(e.maxEverWorkstationRows,r),maxEverRestCols:Math.max(e.maxEverRestCols,c),maxEverRestRows:Math.max(e.maxEverRestRows,u),maxEverMeetingCols:Math.max(e.maxEverMeetingCols,l),maxEverMeetingRows:Math.max(e.maxEverMeetingRows,d)};return i.clampPersisted(f)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=Z({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var ie=J(ee());var K=function(i){return i.connected="connected",i.disconnected="disconnected",i.error="error",i.unreachable="unreachable",i}(K||{});var W=class{static pickCcapPrimary(n){if(!n.length)return null;let e=(o,r)=>new Date(r.lastActivityAt).getTime()-new Date(o.lastActivityAt).getTime(),t=n.filter(o=>o.hasActiveRun===!0||o.presence===p.working);return t.length>0?[...t].sort(e)[0]??null:[...n].sort(e)[0]??null}static pickCciPrimary(n){if(!n.length)return null;let e=(o,r)=>new Date(r.lastActivityAt).getTime()-new Date(o.lastActivityAt).getTime(),t=n.filter(o=>o.hasActiveSession===!0||o.presence===p.working);return t.length>0?[...t].sort(e)[0]??null:[...n].sort(e)[0]??null}static pickCaiPrimary(n){if(!n.length)return null;let e=(o,r)=>new Date(r.lastActivityAt).getTime()-new Date(o.lastActivityAt).getTime(),t=n.filter(o=>o.hasActiveSession===!0||o.presence===p.working);return t.length>0?[...t].sort(e)[0]??null:[...n].sort(e)[0]??null}};var z=class{static pickPrimary(n){if(!n.length)return null;let e=(o,r)=>new Date(r.lastActivityAt).getTime()-new Date(o.lastActivityAt).getTime(),t=n.filter(o=>o.hasActiveSession);return t.length>0?[...t].sort(e)[0]??null:[...n].sort(e)[0]??null}};var xe=J(ee()),Pe=2*xe.minute;var ne=class i{static mapGatewaySessionsResponse(n){let e=[];for(let t of n.sessions){let s=i.mapOneSession(t);s!==null&&e.push(s)}return e}static mapOneSession(n){let e=typeof n.key=="string"?n.key:typeof n.sessionId=="string"?n.sessionId:typeof n.id=="string"?n.id:"";if(!e.trim())return null;let t=typeof n.status=="string"?n.status.trim().toLowerCase():"",s=i.resolvePresenceFromGatewaySession({statusLower:t,raw:n}),a=s===p.working,o=H.extractTimestamp(n,H.GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES)??new Date().toISOString(),r=typeof n.label=="string"?n.label:typeof n.name=="string"?n.name:typeof n.title=="string"?n.title:void 0,u=(typeof n.statusMessage=="string"?n.statusMessage:void 0)?.trim()||(t.length>0?t:"OpenClaw session"),l=typeof n.lastPrompt=="string"?n.lastPrompt:void 0;return{sessionId:e,sessionName:r,presence:s,lastActivityAt:o,hasActiveSession:a,activitySummary:u,lastMessage:l}}static resolvePresenceFromGatewaySession(n){let e=n.statusLower;return e==="connecting"?p.working:i.hasRecentGatewayOutputTimestamp(n.raw)?p.working:e?p.idle:p.idle}static hasRecentGatewayOutputTimestamp(n){let e=H.extractTimestamp(n,H.GATEWAY_OUTPUT_ONLY_TIMESTAMP_FIELD_NAMES);if(!e?.length)return!1;let t=Date.parse(e);return Number.isNaN(t)?!1:Date.now()-t<=Pe}};var re=function(i){return i.creating="creating",i.connecting="connecting",i.waitingInput="waiting-input",i.running="running",i.errored="errored",i.completed="completed",i.terminated="terminated",i.disconnected="disconnected",i}(re||{});var Ee=J(ee()),ce=(()=>{class i{static INTERESTING_SESSION_WINDOW_MS=5*Ee.minute;static prune(e,t){if(e.length===0)return[];let s=t.nowMs,a=t.recentWindowMs,o=[];for(let u of e){let l=new Date(u.lastActivityAt).getTime();Number.isNaN(l)||o.push({row:u,ms:l})}if(o.length===0)return[];let r=o.filter(u=>s-u.ms<=a),c=u=>{let d=[...u].sort((f,h)=>{let I=h.ms-f.ms;return I!==0?I:f.row.sessionId.localeCompare(h.row.sessionId)})[0];if(!d)throw new Error("DO_InstanceTrackerSessionStatuses_Prune_Util | empty sort");return d.row};if(r.length>0){let u=new Map;for(let l of r){let d=u.get(l.row.sessionId);(!d||l.ms>=d.ms)&&u.set(l.row.sessionId,l)}return[...u.values()].sort((l,d)=>d.ms-l.ms).map(l=>l.row)}return[c(o)]}}return i})();var V=class i{static resolveCcapSessionStatuses(n){let e=i.mapRawToCcapSessionStatuses(n.inst.rawSessionStatuses),t=e.length>0?e:i.snapshotCcapSessionStatuses({darkOffice_DS:n.darkOffice_DS,instanceId:n.inst.instanceId});return i.applyInterestingSessionWindow(t)}static resolveOciSessionStatuses(n){let e=i.mapRawToOciSessionStatuses(n.inst.rawSessionStatuses),t=e.length>0?e:i.snapshotOciSessionStatuses({darkOffice_DS:n.darkOffice_DS,instanceId:n.inst.instanceId});return i.applyInterestingSessionWindow(t)}static resolveCciSessionStatuses(n){let e=U.parseCcapId(n.inst.instanceId);if(!e)return[];let t=i.mapRawToCciSessionStatuses(n.inst.rawSessionStatuses),s=t.length>0?t:i.snapshotCciSessionStatuses({darkOffice_DS:n.darkOffice_DS,ccapId:e});return i.applyInterestingSessionWindow(s)}static resolveCaiSessionStatuses(n){let e=F.parseCcapId(n.inst.instanceId);if(!e)return[];let t=i.mapRawToCaiSessionStatuses(n.inst.rawSessionStatuses),s=t.length>0?t:i.snapshotCaiSessionStatuses({darkOffice_DS:n.darkOffice_DS,ccapId:e});return i.applyInterestingSessionWindow(s)}static applyInterestingSessionWindow(n){return ce.prune(n,{nowMs:Date.now(),recentWindowMs:ce.INTERESTING_SESSION_WINDOW_MS})}static snapshotCcapSessionStatuses(n){let t=n.darkOffice_DS.getCcapInstanceDataSnapshot(n.instanceId)?.sessionStatuses;return Array.isArray(t)?t:[]}static snapshotOciSessionStatuses(n){let t=n.darkOffice_DS.getOciInstanceDataSnapshot(n.instanceId)?.sessionStatuses;return Array.isArray(t)?t:[]}static snapshotCciSessionStatuses(n){let t=n.darkOffice_DS.getCciInstanceDataSnapshot(n.ccapId)?.sessionStatuses;return Array.isArray(t)?t:[]}static snapshotCaiSessionStatuses(n){let t=n.darkOffice_DS.getCaiInstanceDataSnapshot(n.ccapId)?.sessionStatuses;return Array.isArray(t)?t:[]}static mapRawToCcapSessionStatuses(n){if(!Array.isArray(n)||n.length===0)return[];let e=[];for(let t of n){if(!("hasActiveRun"in t))continue;let s=t.hasActiveRun;if(typeof s!="boolean")continue;let a=t.sessionId;if(typeof a!="string")continue;let o=t.presence;if(!i.isPresenceEnum(o))continue;let r=t.lastActivityAt;if(typeof r!="string")continue;let c=t.activitySummary;if(typeof c!="string")continue;let u=t.sessionName,l=t.lastMessage,d;if("activeRunPhase"in t){let h=t.activeRunPhase;if(h==null)d=void 0;else if(i.isRunFlowPhaseValue(h))d=h;else continue}let f;if("activeRunId"in t){let h=t.activeRunId;if(typeof h=="string")f=h;else if(h!=null)continue}e.push({sessionId:a,sessionName:typeof u=="string"?u:void 0,presence:o,lastActivityAt:r,hasActiveRun:s,activeRunId:f,activeRunPhase:d,activitySummary:c,lastMessage:typeof l=="string"?l:void 0})}return e}static mapRawToCaiSessionStatuses(n){if(!Array.isArray(n)||n.length===0)return[];let e=[];for(let t of n){if("hasActiveRun"in t||!("hasActiveSession"in t)||!("currentCaSessionStatus"in t))continue;let s=i.tryMapToOciOrCciShape(t);if(s===null)continue;let a=Reflect.get(t,"currentCaSessionStatus"),o;i.isCaSessionStatusValue(a)&&(o=a),e.push({sessionId:s.sessionId,sessionName:s.sessionName,presence:s.presence,lastActivityAt:s.lastActivityAt,hasActiveSession:s.hasActiveSession,currentCaSessionStatus:o,activitySummary:s.activitySummary,lastMessage:s.lastMessage})}return e}static mapRawToOciSessionStatuses(n){if(!Array.isArray(n)||n.length===0)return[];let e=[];for(let t of n){if("hasActiveRun"in t||!("hasActiveSession"in t))continue;let s=i.tryMapToOciOrCciShape(t);s!==null&&e.push(s)}return e}static mapRawToCciSessionStatuses(n){if(!Array.isArray(n)||n.length===0)return[];let e=[];for(let t of n){if("hasActiveRun"in t||!("hasActiveSession"in t))continue;let s=i.tryMapToOciOrCciShape(t);if(s===null)continue;let a;if("currentCcSessionStatus"in t){let o=t.currentCcSessionStatus;typeof o=="string"&&(a=o)}e.push({sessionId:s.sessionId,sessionName:s.sessionName,presence:s.presence,lastActivityAt:s.lastActivityAt,hasActiveSession:s.hasActiveSession,currentCcSessionStatus:a,activitySummary:s.activitySummary,lastMessage:s.lastMessage})}return e}static tryMapToOciOrCciShape(n){if(!("hasActiveSession"in n))return null;let e=Reflect.get(n,"hasActiveSession");if(typeof e!="boolean")return null;let t=n.sessionId;if(typeof t!="string")return null;let s=n.presence;if(!i.isPresenceEnum(s))return null;let a=n.lastActivityAt;if(typeof a!="string")return null;let o=n.activitySummary;if(typeof o!="string")return null;let r=n.sessionName,c=n.lastMessage;return{sessionId:t,sessionName:typeof r=="string"?r:void 0,presence:s,lastActivityAt:a,hasActiveSession:e,activitySummary:o,lastMessage:typeof c=="string"?c:void 0}}static isPresenceEnum(n){return typeof n!="string"?!1:Object.values(p).includes(n)}static isRunFlowPhaseValue(n){if(typeof n!="string")return!1;let e=Object.values(we);for(let t of e)if(t===n)return!0;return!1}static isCaSessionStatusValue(n){if(typeof n!="string")return!1;let e=Object.values(re);for(let t of e)if(t===n)return!0;return!1}};var Te=72,q=class i{static buildLastMessageDerivedStatusLabel(n){let e=n.trim();return e&&e.startsWith("[QUEUE]")?"Message queued":""}static buildPanelActiveSessionRows(n){let e=n.rawSessionStatuses;if(!e||e.length===0)return[];let t=n.characterType,s;return t===C.openclaw||t===C.ccSession||t===C.caSession?s=i.collectActiveOciOrCciFromUnion(e):s=i.collectActiveCcapFromUnion(e),s.length<=1?[]:s}static buildSessionDisplayLabel(n,e){let t=e?.trim();return t||i.shortenSessionId(n)}static truncateLastMessagePreview(n){let e=n.trim();return e?e.length<=Te?e:`${e.slice(0,Te-1)}\u2026`:""}static isCcapSessionRow(n){return"hasActiveRun"in n}static isOciOrCciSessionRow(n){return"hasActiveSession"in n}static isCcapSessionActive(n){return n.hasActiveRun===!0?!0:n.presence===p.working}static isOciOrCciSessionActive(n){return n.hasActiveSession===!0?!0:n.presence===p.working}static isSessionActiveForSceneDuplication(n){if(n.row.presence===p.offline)return!1;let e=n.characterType;return e===C.openclaw||e===C.ccSession||e===C.caSession?i.isOciOrCciSessionRow(n.row)?i.isOciOrCciSessionActive(n.row):!1:i.isCcapSessionRow(n.row)?i.isCcapSessionActive(n.row):!1}static shortenSessionId(n){return n.length<=10?n:`${n.slice(0,8)}\u2026`}static collectActiveCcapFromUnion(n){let e=[];for(let t of n){if(!i.isCcapSessionRow(t)||!i.isCcapSessionActive(t))continue;let s=i.truncateLastMessagePreview(t.lastMessage??"");e.push({sessionId:t.sessionId,displayLabel:i.buildSessionDisplayLabel(t.sessionId,t.sessionName),presence:t.presence,activitySummary:t.activitySummary,lastMessagePreview:s})}return e}static collectActiveOciOrCciFromUnion(n){let e=[];for(let t of n){if(!i.isOciOrCciSessionRow(t)||!i.isOciOrCciSessionActive(t))continue;let s=i.truncateLastMessagePreview(t.lastMessage??"");e.push({sessionId:t.sessionId,displayLabel:i.buildSessionDisplayLabel(t.sessionId,t.sessionName),presence:t.presence,activitySummary:t.activitySummary,lastMessagePreview:s})}return e}};var le=J(ee());var Q=(()=>{class i{static sceneRecentActivityWindowMs=5*le.minute;static sceneIdleWalkActivityWindowMs=15*le.minute;static parseLastActivityMs(e){let t=Date.parse(e);return Number.isNaN(t)?Number.NaN:t}static isSessionRecentAndOnline(e){if(e.presence===p.offline)return!1;let t=i.parseLastActivityMs(e.lastActivityAtIso);return Number.isNaN(t)?!1:e.nowMs-t<=e.windowMs}static rowLastActivityIso(e){return e.lastActivityAt??""}static isSessionWorkingForSceneCharacter(e){return e.presence===p.working||"hasActiveRun"in e&&e.hasActiveRun===!0||"hasActiveSession"in e&&e.hasActiveSession===!0}static isWorkingSessionRecentAndOnline(e){return i.isSessionWorkingForSceneCharacter(e.row)?i.isSessionRecentAndOnline({lastActivityAtIso:i.rowLastActivityIso(e.row),presence:e.row.presence,nowMs:e.nowMs,windowMs:e.windowMs}):!1}static isSessionInIdleWalkWindow(e){if(e.row.presence===p.offline||i.isWorkingSessionRecentAndOnline({row:e.row,nowMs:e.nowMs,windowMs:e.recentWindowMs}))return!1;let t=i.parseLastActivityMs(i.rowLastActivityIso(e.row));return Number.isNaN(t)?!1:e.nowMs-t<=e.idleWalkWindowMs}static pickNewestSessionByLastActivity(e){let t=e.sessions;return t.length===0?null:[...t].sort((o,r)=>{let c=i.parseLastActivityMs(i.rowLastActivityIso(o)),u=i.parseLastActivityMs(i.rowLastActivityIso(r)),l=!Number.isNaN(c),d=!Number.isNaN(u);return l&&d&&u!==c?u-c:l!==d?l?-1:1:o.sessionId.localeCompare(r.sessionId)})[0]??null}}return i})();var je="instance-data:session-status-updated",Be="openclaw-instance-data:status-updated",He="cci-instance-data:status-updated",Ke="cai-instance-data:status-updated",ys=(()=>{class i{instances_$=P([]);characters_$=D(()=>{let e=this.expandInstancesToCharacters(this.instances_$());return this.assignDistinctSlotsForScene(e)});loading_$=P(!1);loadError_$=P(null);isServerUnreachable_$=P(!1);selectedInstanceId_$=P(null);chatPopupSessionId_$=P(null);chatPopupSessionType_$=P(null);instanceStatusDetailInstanceId_$=P(null);instanceData_AS=x(ve);ociInstanceData_AS=x(Ce);cciInstanceData_AS=x(ge);caiInstanceData_AS=x(Ie);runtimeInstances_DS=x(Re);socket_CS=x(ye);ocSession_DS=x(Ae);darkOfficeLayout_DS=x(ke);constructor(){me(()=>{this.darkOfficeLayout_DS.ensureMinCapacitiesFromSceneCharacters(this.characters_$())},{allowSignalWrites:!0}),this.socket_CS.event$.subscribe(e=>{e.event===je?this.handleInstanceStatusUpdate(e.payload):e.event===Be?this.handleOciInstanceStatusUpdate(e.payload):e.event===He?this.handleCciInstanceStatusUpdate(e.payload):e.event===Ke&&this.handleCaiInstanceStatusUpdate(e.payload)})}workstationSlotMap=new Map;restSlotMap=new Map;patchTimerMap=new Map;meetingRoomLingerMs=2*ie.minute;sessionMeetingRoomUntilByKey=new Map;loadInstanceData(){return $(this,null,function*(){this.loading_$.set(!0),this.loadError_$.set(null);try{yield this.runtimeInstances_DS.loadCcapInstanceList();let e=this.runtimeInstances_DS.ccapInstanceListError_$();if(e){e instanceof fe&&e.status===0?this.isServerUnreachable_$.set(!0):this.loadError_$.set(e);return}yield this.runtimeInstances_DS.loadOciInstanceListAllowEmpty(),yield this.runtimeInstances_DS.loadCciInstanceListAllowEmpty(),yield this.runtimeInstances_DS.loadCaiInstanceListAllowEmpty(),this.isServerUnreachable_$.set(!1);let s=this.runtimeInstances_DS.ccapInstanceList_$().filter(d=>d.status===te.active),a=this.runtimeInstances_DS.ociInstanceList_$(),o=yield this.enrichOciListWithGatewaySessions({list:a}),c=this.runtimeInstances_DS.cciInstanceList_$().filter(d=>d.status===te.active),l=this.runtimeInstances_DS.caiInstanceList_$().filter(d=>d.status===te.active);this.applyAllInstanceData(s,o,c,l)}finally{this.loading_$.set(!1)}})}enrichOciListWithGatewaySessions(e){return $(this,null,function*(){return yield Promise.all(e.list.map(s=>$(this,null,function*(){let a=s.sessionStatuses??[];if(!(s.connectionStatus===K.connected)||a.length>0)return s;try{let r=yield this.ocSession_DS.fetchGatewaySessionsForInstance({instanceId:s.instanceId}),c=ne.mapGatewaySessionsResponse({sessions:r.rawSessions});return c.length===0?s:A(R({},s),{sessionStatuses:c})}catch(r){return ie.DyFM_Error.logSimple("CCAP_DarkOffice_DS | enrichOciListWithGatewaySessions failed",r),s}})))})}saveVisuals(e,t){this.instances_$.update(s=>s.map(a=>a.instanceId===e?A(R({},a),{visuals:t}):a)),this.schedulePatch(e,t)}dismissError(){this.loadError_$.set(null)}openChatPopup(e,t=null){this.chatPopupSessionId_$.set(e),this.chatPopupSessionType_$.set(t)}closeChatPopup(){this.chatPopupSessionId_$.set(null),this.chatPopupSessionType_$.set(null)}selectInstance(e){this.selectedInstanceId_$.set(e)}openInstanceStatusDetail(e){this.instanceStatusDetailInstanceId_$.set(e)}closeInstanceStatusDetail(){this.instanceStatusDetailInstanceId_$.set(null)}getCcapInstanceDataSnapshot(e){return this.runtimeInstances_DS.ccapInstanceList_$().find(t=>t.ccapId===e)}getOciInstanceDataSnapshot(e){return this.runtimeInstances_DS.ociInstanceList_$().find(t=>t.instanceId===e)}getCciInstanceDataSnapshot(e){return this.runtimeInstances_DS.cciInstanceList_$().find(t=>t.ccapId===e)}getCaiInstanceDataSnapshot(e){return this.runtimeInstances_DS.caiInstanceList_$().find(t=>t.ccapId===e)}resolveOfficeInstanceById(e){return e?this.instances_$().find(a=>a.instanceId===e)??null:null}resolveModalCcapSessionStatuses(e){return V.resolveCcapSessionStatuses({inst:e,darkOffice_DS:this})}resolveModalOciSessionStatuses(e){return V.resolveOciSessionStatuses({inst:e,darkOffice_DS:this})}resolveModalCciSessionStatuses(e){return V.resolveCciSessionStatuses({inst:e,darkOffice_DS:this})}resolveModalCaiSessionStatuses(e){return V.resolveCaiSessionStatuses({inst:e,darkOffice_DS:this})}buildInstanceStatusDetailRuntimeHint(e){let t=e.characterType??C.ccap;if(t===C.openclaw)return this.resolveModalOciSessionStatuses(e).length>0||this.getOciInstanceDataSnapshot(e.instanceId)?"":"No matching OCI row in runtime list (last load only; socket updates may not refresh this list).";if(t===C.ccSession){let o=U.parseCcapId(e.instanceId);return!o||this.resolveModalCciSessionStatuses(e).length>0||this.getCciInstanceDataSnapshot(o)?"":"No matching CCI row in runtime list (last load only; socket updates may not refresh this list)."}if(t===C.caSession){let o=F.parseCcapId(e.instanceId);return!o||this.resolveModalCaiSessionStatuses(e).length>0||this.getCaiInstanceDataSnapshot(o)?"":"No matching CAI row in runtime list (last load only; socket updates may not refresh this list)."}return this.resolveModalCcapSessionStatuses(e).length>0||this.getCcapInstanceDataSnapshot(e.instanceId)?"":"No matching CCAP row in runtime list (last load only; socket updates may not refresh this list)."}pruneExpiredMeetingRoomKeys(e){for(let t of[...this.sessionMeetingRoomUntilByKey.keys()]){let s=this.sessionMeetingRoomUntilByKey.get(t);s!==void 0&&s<=e&&this.sessionMeetingRoomUntilByKey.delete(t)}}applyMeetingRoomTransitionForSessionDiff(e){let t=Date.now();this.pruneExpiredMeetingRoomKeys(t);let s=new Map;for(let a of e.previousRows??[])s.set(a.sessionId,a.presence);for(let a of e.nextRows??[]){let o=s.get(a.sessionId),r=`${e.baseInstanceId}::${a.sessionId}`;o===p.working&&a.presence===p.idle&&this.sessionMeetingRoomUntilByKey.set(r,t+this.meetingRoomLingerMs)}}resolveScenePlacementForSessionKey(e){let t=`${e.baseInstanceId}::${e.sessionId}`,s=this.sessionMeetingRoomUntilByKey.get(t);if(s!==void 0&&Date.now()<s)return O.meeting}handleInstanceStatusUpdate(e){let t=typeof e.ccapId=="string"?e.ccapId:void 0,s=e.sessionStatuses,a=Array.isArray(s)?s:void 0;if(!t||!a)return;let o=this.instances_$(),r=o.findIndex(h=>h.instanceId===t);if(r<0){this.loadInstanceData();return}let c=o[r];this.applyMeetingRoomTransitionForSessionDiff({baseInstanceId:t,previousRows:c.rawSessionStatuses,nextRows:a});let u=this.resolveSessionInfoFromStatuses(a),l=this.assignSlot(t,u.presence,c),d=this.resolveAnimState(u.presence,c.presence),f=this.applyPanelCardProjection(A(R({},c),{presence:u.presence,activitySummary:u.activitySummary,currentRunFlowPhase:u.currentRunFlowPhase,latestSessionId:u.latestSessionId,lastMessage:u.lastMessage,animState:d,previousPresence:c.presence,assignedSlotIndex:l,rawSessionStatuses:a}));this.instances_$.update(h=>h.map(I=>I.instanceId===t?f:I))}resolveSessionInfoFromStatuses(e){if(e.length===0)return{presence:p.idle,activitySummary:"No CCAP Session activity",currentRunFlowPhase:null,latestSessionId:null,lastMessage:""};let s=W.pickCcapPrimary(e)??e[0];return{presence:s.presence,activitySummary:s.activitySummary,currentRunFlowPhase:s.activeRunPhase??null,latestSessionId:s.sessionId,lastMessage:s.lastMessage??""}}applyPanelCardProjection(e){let t=e.sessionName??"";if(!t&&e.latestSessionId&&e.rawSessionStatuses){for(let s of e.rawSessionStatuses)if(s.sessionId===e.latestSessionId){t=s.sessionName??"";break}}return A(R({},e),{sessionName:t,lastMessageDerivedStatusLabel:q.buildLastMessageDerivedStatusLabel(e.lastMessage),panelActiveSessionRows:q.buildPanelActiveSessionRows({characterType:e.characterType,rawSessionStatuses:e.rawSessionStatuses})})}applyAllInstanceData(e,t,s,a){let o=this.instances_$(),r=new Map(o.map(S=>[S.instanceId,S])),c=e.map(S=>{let m=r.get(S.ccapId),g=m?.visuals??this.mapToVisuals(S),w=this.resolveSessionInfo(S),y=this.assignSlot(S.ccapId,w.presence,m),v=this.resolveAnimState(w.presence,m?.presence??null);return this.applyPanelCardProjection({instanceId:S.ccapId,presence:w.presence,activitySummary:w.activitySummary,currentRunFlowPhase:w.currentRunFlowPhase,latestSessionId:w.latestSessionId,lastMessage:w.lastMessage,visuals:g,animState:v,previousPresence:m?.presence??null,assignedSlotIndex:y,characterType:C.ccap,connectionStatus:null,rawSessionStatuses:S.sessionStatuses??[],lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]})}),u=t.map(S=>{let m=r.get(S.instanceId),g=m?.visuals??this.mapOciToVisuals(S),w=this.resolveOciSessionInfo(S),y=this.assignSlot(S.instanceId,w.presence,m),v=this.resolveAnimState(w.presence,m?.presence??null);return this.applyPanelCardProjection({instanceId:S.instanceId,presence:w.presence,activitySummary:w.activitySummary,currentRunFlowPhase:null,latestSessionId:w.latestSessionId,lastMessage:w.lastMessage,visuals:g,animState:v,previousPresence:m?.presence??null,assignedSlotIndex:y,characterType:C.openclaw,connectionStatus:S.connectionStatus??null,rawSessionStatuses:S.sessionStatuses??[],lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]})}),l=s.map(S=>{let m=U.build({ccapId:S.ccapId}),g=r.get(m),w=g?.visuals??this.mapCciToVisuals(S),y=this.resolveCciSessionInfo(S),v=this.assignSlot(m,y.presence,g),k=this.resolveAnimState(y.presence,g?.presence??null);return this.applyPanelCardProjection({instanceId:m,presence:y.presence,activitySummary:y.activitySummary,currentRunFlowPhase:y.currentRunFlowPhase,latestSessionId:y.latestSessionId,lastMessage:y.lastMessage,visuals:w,animState:k,previousPresence:g?.presence??null,assignedSlotIndex:v,characterType:C.ccSession,connectionStatus:null,rawSessionStatuses:S.sessionStatuses??[],lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]})}),d=a.map(S=>{let m=F.build({ccapId:S.ccapId}),g=r.get(m),w=g?.visuals??this.mapCaiToVisuals(S),y=this.resolveCaiSessionInfo(S),v=this.assignSlot(m,y.presence,g),k=this.resolveAnimState(y.presence,g?.presence??null);return this.applyPanelCardProjection({instanceId:m,presence:y.presence,activitySummary:y.activitySummary,currentRunFlowPhase:y.currentRunFlowPhase,latestSessionId:y.latestSessionId,lastMessage:y.lastMessage,visuals:w,animState:k,previousPresence:g?.presence??null,assignedSlotIndex:v,characterType:C.caSession,connectionStatus:null,rawSessionStatuses:S.sessionStatuses??[],lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]})}),f=[...c,...u,...l,...d];for(let S of f){let m=r.get(S.instanceId);this.applyMeetingRoomTransitionForSessionDiff({baseInstanceId:S.instanceId,previousRows:m?.rawSessionStatuses,nextRows:S.rawSessionStatuses})}let h=new Set(f.map(S=>S.instanceId)),I=o.filter(S=>!h.has(S.instanceId)&&S.animState!==M.walkingOut).map(S=>this.applyPanelCardProjection(A(R({},S),{animState:M.walkingOut})));this.instances_$.set([...f,...I]),I.length>0&&setTimeout(()=>{this.instances_$.update(S=>S.filter(m=>h.has(m.instanceId)))},Me+200)}mapToVisuals(e){let t=e.darkOfficeVisuals;return{skinColor:t?.skinColor??b.skinColor,hairColor:t?.hairColor??b.hairColor,hairStyle:t?.hairStyle??b.hairStyle,shirtColor:t?.shirtColor??b.shirtColor,clothingStyle:t?.clothingStyle??b.clothingStyle,pantsColor:t?.pantsColor??b.pantsColor,eyeColor:t?.eyeColor??b.eyeColor,bodyType:t?.bodyType??b.bodyType,displayName:e.name??""}}resolveSessionInfo(e){let t=e.sessionStatuses;if(!t||t.length===0)return{presence:p.idle,activitySummary:"No CCAP Session activity",currentRunFlowPhase:null,latestSessionId:null,lastMessage:""};let a=W.pickCcapPrimary(t)??t[0];return{presence:a.presence,activitySummary:a.activitySummary,currentRunFlowPhase:a.activeRunPhase??null,latestSessionId:a.sessionId,lastMessage:a.lastMessage??""}}mapOciToVisuals(e){let t=e.darkOfficeVisuals;return{skinColor:t?.skinColor??_.skinColor,hairColor:t?.hairColor??_.hairColor,hairStyle:t?.hairStyle??_.hairStyle,shirtColor:t?.shirtColor??_.shirtColor,clothingStyle:t?.clothingStyle??_.clothingStyle,pantsColor:t?.pantsColor??_.pantsColor,eyeColor:t?.eyeColor??_.eyeColor,bodyType:t?.bodyType??_.bodyType,displayName:e.label??""}}mapCaiToVisuals(e){let t=e.darkOfficeVisuals;return{skinColor:t?.skinColor??N.skinColor,hairColor:t?.hairColor??N.hairColor,hairStyle:t?.hairStyle??N.hairStyle,shirtColor:t?.shirtColor??N.shirtColor,clothingStyle:t?.clothingStyle??N.clothingStyle,pantsColor:t?.pantsColor??N.pantsColor,eyeColor:t?.eyeColor??N.eyeColor,bodyType:t?.bodyType??N.bodyType,displayName:e.name??""}}resolveCaiSessionInfo(e){let t=e.sessionStatuses??[];if(t.length===0)return{presence:p.idle,activitySummary:"No CA Session activity",currentRunFlowPhase:null,latestSessionId:null,lastMessage:""};let a=W.pickCaiPrimary(t)??t[0];return{presence:a.presence,activitySummary:a.activitySummary,currentRunFlowPhase:a.currentCaSessionStatus??null,latestSessionId:a.sessionId,lastMessage:a.lastMessage??""}}mapCciToVisuals(e){let t=e.darkOfficeVisuals;return{skinColor:t?.skinColor??L.skinColor,hairColor:t?.hairColor??L.hairColor,hairStyle:t?.hairStyle??L.hairStyle,shirtColor:t?.shirtColor??L.shirtColor,clothingStyle:t?.clothingStyle??L.clothingStyle,pantsColor:t?.pantsColor??L.pantsColor,eyeColor:t?.eyeColor??L.eyeColor,bodyType:t?.bodyType??L.bodyType,displayName:e.name??""}}resolveCciSessionInfo(e){let t=e.sessionStatuses??[];if(t.length===0)return{presence:p.idle,activitySummary:"No CC Session activity",currentRunFlowPhase:null,latestSessionId:null,lastMessage:""};let a=W.pickCciPrimary(t)??t[0];return{presence:a.presence,activitySummary:a.activitySummary,currentRunFlowPhase:a.currentCcSessionStatus??null,latestSessionId:a.sessionId,lastMessage:a.lastMessage??""}}resolveOciSessionInfo(e){if(!(e.connectionStatus===K.connected))return{presence:p.offline,activitySummary:"Gateway disconnected",latestSessionId:null,lastMessage:""};let s=e.sessionStatuses??[];if(s.length===0)return{presence:p.idle,activitySummary:"Connected",latestSessionId:null,lastMessage:""};let a=z.pickPrimary(s);return a?{presence:a.presence,activitySummary:a.activitySummary,latestSessionId:a.sessionId,lastMessage:a.lastMessage??""}:{presence:p.idle,activitySummary:"Connected",latestSessionId:null,lastMessage:""}}handleOciInstanceStatusUpdate(e){let t=typeof e.instanceId=="string"?e.instanceId:void 0,s=e.sessionStatuses,a=Array.isArray(s)?s:void 0,o=typeof e.connectionStatus=="string"?e.connectionStatus:void 0;if(!t)return;let r=this.instances_$(),c=r.findIndex(m=>m.instanceId===t);if(!(o===K.connected)&&c>=0){let m=r[c],g=this.assignSlot(t,p.offline,m),w=this.resolveAnimState(p.offline,m.presence);this.instances_$.update(y=>y.map(v=>v.instanceId===t?this.applyPanelCardProjection(A(R({},v),{presence:p.offline,activitySummary:"Gateway disconnected",lastMessage:"",animState:w,previousPresence:m.presence,assignedSlotIndex:g,connectionStatus:o??v.connectionStatus})):v));return}if(c<0){this.loadInstanceData();return}let l=r[c],d=a??[];this.applyMeetingRoomTransitionForSessionDiff({baseInstanceId:t,previousRows:l.rawSessionStatuses,nextRows:d});let f;if(d.length>0){let m=z.pickPrimary(d);m?f={presence:m.presence,activitySummary:m.activitySummary,latestSessionId:m.sessionId,lastMessage:m.lastMessage??""}:f={presence:p.idle,activitySummary:"Connected",latestSessionId:null,lastMessage:""}}else f={presence:p.idle,activitySummary:"Connected",latestSessionId:null,lastMessage:""};let h=this.assignSlot(t,f.presence,l),I=this.resolveAnimState(f.presence,l.presence),S=this.applyPanelCardProjection(A(R({},l),{presence:f.presence,activitySummary:f.activitySummary,latestSessionId:f.latestSessionId,lastMessage:f.lastMessage,animState:I,previousPresence:l.presence,assignedSlotIndex:h,connectionStatus:o??l.connectionStatus,rawSessionStatuses:d}));this.instances_$.update(m=>m.map(g=>g.instanceId===t?S:g))}handleCciInstanceStatusUpdate(e){let t=typeof e.officeInstanceId=="string"?e.officeInstanceId:void 0,s=e.sessionStatuses,a=Array.isArray(s)?s:void 0;if(!t)return;let o=this.instances_$(),r=o.findIndex(I=>I.instanceId===t);if(r<0){this.loadInstanceData();return}let c=o[r],u=a??[];this.applyMeetingRoomTransitionForSessionDiff({baseInstanceId:t,previousRows:c.rawSessionStatuses,nextRows:u});let l=this.resolveSessionInfoFromCciStatuses(u),d=this.assignSlot(t,l.presence,c),f=this.resolveAnimState(l.presence,c.presence),h=this.applyPanelCardProjection(A(R({},c),{presence:l.presence,activitySummary:l.activitySummary,currentRunFlowPhase:l.currentRunFlowPhase,latestSessionId:l.latestSessionId,lastMessage:l.lastMessage,animState:f,previousPresence:c.presence,assignedSlotIndex:d,rawSessionStatuses:u}));this.instances_$.update(I=>I.map(S=>S.instanceId===t?h:S))}handleCaiInstanceStatusUpdate(e){let t=typeof e.officeInstanceId=="string"?e.officeInstanceId:void 0,s=e.sessionStatuses,a=Array.isArray(s)?s:void 0;if(!t)return;let o=this.instances_$(),r=o.findIndex(I=>I.instanceId===t);if(r<0){this.loadInstanceData();return}let c=o[r],u=a??[];this.applyMeetingRoomTransitionForSessionDiff({baseInstanceId:t,previousRows:c.rawSessionStatuses,nextRows:u});let l=this.resolveSessionInfoFromCaiStatuses(u),d=this.assignSlot(t,l.presence,c),f=this.resolveAnimState(l.presence,c.presence),h=this.applyPanelCardProjection(A(R({},c),{presence:l.presence,activitySummary:l.activitySummary,currentRunFlowPhase:l.currentRunFlowPhase,latestSessionId:l.latestSessionId,lastMessage:l.lastMessage,animState:f,previousPresence:c.presence,assignedSlotIndex:d,rawSessionStatuses:u}));this.instances_$.update(I=>I.map(S=>S.instanceId===t?h:S))}resolveSessionInfoFromCciStatuses(e){if(e.length===0)return{presence:p.idle,activitySummary:"No CC Session activity",currentRunFlowPhase:null,latestSessionId:null,lastMessage:""};let s=W.pickCciPrimary(e)??e[0];return{presence:s.presence,activitySummary:s.activitySummary,currentRunFlowPhase:s.currentCcSessionStatus??null,latestSessionId:s.sessionId,lastMessage:s.lastMessage??""}}resolveSessionInfoFromCaiStatuses(e){if(e.length===0)return{presence:p.idle,activitySummary:"No CA Session activity",currentRunFlowPhase:null,latestSessionId:null,lastMessage:""};let s=W.pickCaiPrimary(e)??e[0];return{presence:s.presence,activitySummary:s.activitySummary,currentRunFlowPhase:s.currentCaSessionStatus??null,latestSessionId:s.sessionId,lastMessage:s.lastMessage??""}}schedulePatch(e,t){let s=this.patchTimerMap.get(e);s!==void 0&&clearTimeout(s);let a=setTimeout(()=>{this.patchTimerMap.delete(e);let d=t,{displayName:o}=d,r=Se(d,["displayName"]),c=this.instances_$().find(f=>f.instanceId===e),u=F.parseCcapId(e),l=U.parseCcapId(e);u!==null?this.caiInstanceData_AS.patchByCcapId({ccapId:u,name:o||void 0,darkOfficeVisuals:r}):l!==null?this.cciInstanceData_AS.patchByCcapId({ccapId:l,name:o||void 0,darkOfficeVisuals:r}):c?.characterType===C.openclaw?this.ociInstanceData_AS.patchVisuals({instanceId:e,label:o||void 0,darkOfficeVisuals:r}):this.instanceData_AS.patchByCcapId({ccapId:e,name:o||void 0,darkOfficeVisuals:r})},300);this.patchTimerMap.set(e,a)}assignSlot(e,t,s){let a=t===p.working,o=a?this.workstationSlotMap:this.restSlotMap,r=a?this.darkOfficeLayout_DS.workstationCapacity_$():this.darkOfficeLayout_DS.restCapacity_$();if(o.has(e))return o.get(e);this.workstationSlotMap.delete(e),this.restSlotMap.delete(e);let c=new Set(o.values());for(let l=0;l<r;l++)if(!c.has(l))return o.set(e,l),l;let u=r;for(;c.has(u);)u++;return o.set(e,u),u}resolveAnimState(e,t){return t===p.offline&&e!==p.offline?M.walkingIn:t!==null&&t!==p.offline&&e===p.offline?M.walkingOut:t!==null&&t!==p.offline&&e!==p.offline&&t!==e?M.walkingBetween:e===p.working?M.working:e===p.idle?M.sitting:M.standing}assignDistinctSlotsForScene(e){let t=0,s=0,a=0;return e.map(o=>{let r;return o.scenePlacement===O.meeting?r=a++:o.presence===p.working?r=t++:r=s++,A(R({},o),{assignedSlotIndex:r})})}expandInstancesToCharacters(e){let t=[],s=Date.now(),a=Q.sceneRecentActivityWindowMs,o=Q.sceneIdleWalkActivityWindowMs,r=new Map;for(let c of e)c.characterType===C.ccap&&r.set(c.instanceId,c.presence);for(let c of e){if(c.presence===p.offline)continue;if(c.characterType===C.ccSession||c.characterType===C.caSession){let l=c.characterType===C.ccSession?U.parseCcapId(c.instanceId):F.parseCcapId(c.instanceId),d=l?r.get(l):void 0;if(d===void 0||d===p.offline)continue}t.push(this.buildInstanceBaselineCharacter(c));let u=c.rawSessionStatuses??[];for(let l of u){if(Q.isWorkingSessionRecentAndOnline({row:l,nowMs:s,windowMs:a})){t.push(this.buildPerSessionOfficeCharacter(c,l));continue}Q.isSessionInIdleWalkWindow({row:l,nowMs:s,recentWindowMs:a,idleWalkWindowMs:o})&&t.push(this.buildIdleWalkSessionCharacter(c,l))}}return t}buildIdleWalkSessionCharacter(e,t){let s=`${e.instanceId}::${t.sessionId}`;return this.applyPanelCardProjection(A(R({},e),{instanceId:s,sessionId:t.sessionId,sessionName:t.sessionName??"",presence:p.idle,activitySummary:t.activitySummary,lastMessage:t.lastMessage??"",latestSessionId:t.sessionId,currentRunFlowPhase:i.resolveSessionRunFlowPhaseLabel(t),assignedSlotIndex:0,animState:M.idleWalking,previousPresence:null,scenePlacement:void 0,rawSessionStatuses:void 0,lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]}))}buildInstanceBaselineCharacter(e){return this.applyPanelCardProjection(A(R({},e),{instanceId:e.instanceId,sessionId:void 0,sessionName:"",presence:p.idle,activitySummary:e.activitySummary,lastMessage:"",latestSessionId:null,currentRunFlowPhase:null,assignedSlotIndex:0,animState:M.sitting,previousPresence:null,scenePlacement:void 0,rawSessionStatuses:e.rawSessionStatuses,lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]}))}buildPerSessionOfficeCharacter(e,t){let s=`${e.instanceId}::${t.sessionId}`,o=(t.presence===p.working?void 0:this.resolveScenePlacementForSessionKey({baseInstanceId:e.instanceId,sessionId:t.sessionId}))===O.meeting?O.meeting:void 0;return this.applyPanelCardProjection(A(R({},e),{instanceId:s,sessionId:t.sessionId,sessionName:t.sessionName??"",presence:t.presence,activitySummary:t.activitySummary,lastMessage:t.lastMessage??"",latestSessionId:t.sessionId,currentRunFlowPhase:i.resolveSessionRunFlowPhaseLabel(t),assignedSlotIndex:0,animState:t.presence===p.working?M.working:M.sitting,previousPresence:null,scenePlacement:o,rawSessionStatuses:void 0,lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]}))}static resolveSessionRunFlowPhaseLabel(e){return"activeRunPhase"in e?e.activeRunPhase??null:"currentCcSessionStatus"in e?e.currentCcSessionStatus??null:"currentCaSessionStatus"in e?e.currentCaSessionStatus??null:null}static \u0275fac=function(t){return new(t||i)};static \u0275prov=Z({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{M as a,O as b,C as c,K as d,X as e,Y as f,j as g,it as h,ot as i,at as j,rt as k,ct as l,F as m,U as n,Q as o,ke as p,ys as q};
2
- //# sourceMappingURL=chunk-UPREBG2C.js.map
1
+ import{a as H,b as Ae}from"./chunk-M5NG4Q3Z.js";import{a as we}from"./chunk-UFBTR2BG.js";import{a as te,b as p}from"./chunk-6Y7O2W4H.js";import{a as Ie,b as ge,c as ve,d as Re}from"./chunk-MOASKRZP.js";import{a as Ce}from"./chunk-CSBAACGJ.js";import{e as ye}from"./chunk-5LANXE75.js";import{L as he,p as ee,t as ae}from"./chunk-762K6QXC.js";import{C as x,a as R,aa as P,b as A,d as Se,h as J,hb as D,jb as me,k as $,wb as fe,y as Z}from"./chunk-TBMJSIBB.js";var M=function(i){return i.standing="standing",i.working="working",i.sitting="sitting",i.walkingIn="walking-in",i.walkingOut="walking-out",i.walkingBetween="walking-between",i.idleWalking="idle-walking",i}(M||{});var O=function(i){return i.workstation="workstation",i.rest="rest",i.meeting="meeting",i}(O||{});var C=function(i){return i.ccap="ccap",i.openclaw="openclaw",i.ccSession="cc-session",i.caSession="ca-session",i}(C||{});var X=function(i){return i.average="average",i.slim="slim",i.stocky="stocky",i.athletic="athletic",i}(X||{});var Y=function(i){return i.casual="casual",i.formal="formal",i.hoodie="hoodie",i.tshirt="tshirt",i}(Y||{});var j=function(i){return i.short="short",i.long="long",i.spiky="spiky",i.curly="curly",i.bald="bald",i.mohawk="mohawk",i}(j||{});var it=["#f5c592","#e8a96e","#d4845a","#c06a3c","#9b5930","#7a3d1c","#4a2412"],ot=["#1a1006","#3b2505","#6b3d11","#9b6720","#c9a227","#e8d5a3","#f0f0f0","#a0a0a0","#2a4080","#8b1a2a"],at=["#1e40af","#166534","#7f1d1d","#4c1d95","#134e4a","#713f12","#374151","#6b21a8","#0f766e","#1e3a5f","#b45309","#be185d","#475569"],rt=["#1e293b","#374151","#292524","#1e3a5f","#1a2e05","#2d1b69","#3b1a08","#1a1a2e"],ct=["#1a1a1a","#3b5998","#2d8a4e","#8b4513","#4b0082","#5f9ea0"],b={skinColor:"#e8a96e",hairColor:"#1a1006",hairStyle:j.short,shirtColor:"#1e40af",clothingStyle:Y.casual,pantsColor:"#1e293b",eyeColor:"#1a1a1a",bodyType:X.average,displayName:""},_={skinColor:"#b0bec5",hairColor:"#37474f",hairStyle:j.short,shirtColor:"#0288d1",clothingStyle:Y.tshirt,pantsColor:"#263238",eyeColor:"#00bcd4",bodyType:X.average,displayName:""},L={skinColor:"#d4c4a8",hairColor:"#2d1b0e",hairStyle:j.short,shirtColor:"#5b21b6",clothingStyle:Y.casual,pantsColor:"#312e81",eyeColor:"#4338ca",bodyType:X.average,displayName:""},N={skinColor:"#e2e8f0",hairColor:"#0f172a",hairStyle:j.short,shirtColor:"#0d9488",clothingStyle:Y.casual,pantsColor:"#134e4a",eyeColor:"#14b8a6",bodyType:X.average,displayName:""};var Me=2e3;var F=(()=>{class i{static officeInstanceIdPrefix="cai:";static build(e){return`${i.officeInstanceIdPrefix}${e.ccapId.trim()}`}static parseCcapId(e){let t=e.trim();if(!t.startsWith(i.officeInstanceIdPrefix))return null;let s=t.slice(i.officeInstanceIdPrefix.length).trim();return s.length>0?s:null}}return i})();var U=(()=>{class i{static officeInstanceIdPrefix="cci:";static build(e){return`${i.officeInstanceIdPrefix}${e.ccapId.trim()}`}static parseCcapId(e){let t=e.trim();if(!t.startsWith(i.officeInstanceIdPrefix))return null;let s=t.slice(i.officeInstanceIdPrefix.length).trim();return s.length>0?s:null}}return i})();var E=class i{static clampGrid(n){return{workstationCols:i.clampDim(n.workstationCols),workstationRows:i.clampDim(n.workstationRows),restCols:i.clampDim(n.restCols),restRows:i.clampDim(n.restRows),meetingCols:i.clampDim(n.meetingCols),meetingRows:i.clampDim(n.meetingRows)}}static computeDerived(n){let e=i.clampGrid(n),t=4*32,s=3*32,a=i.computeWorkspaceWidthPx(e.workstationCols),o=i.computeLoungeWidthPx(e.restCols),r=6*32,c=a+r+o,u=8*32,l=c+u,d=e.workstationRows*6*32,f=3*32+e.meetingRows*5*32+3*32,h=Math.max(2*32,Math.round(f/2)),I=s+d,S=2*32,m=I+h+32,g=t-32,w=S,y=c+2*32,v=m-w,k=m+3*32,T={x:t,y:s,w:a,h:d},G={x:t+a,y:s,w:r,h:m-s},B={x:t+a+r,y:s,w:o,h:m-s},oe={x:t,y:I,w:a,h},De=t+a,ue=t+a+r,Oe=I,be={x:G.x+Math.round(G.w/2),y:m-2*32},_e=i.buildWorkstationSlots(e,T),de=i.buildMeetingSlots(e,oe),Le=i.buildWorkstationDesks(e,T),pe=i.buildLoungeSeatingLayout(e,B),Ne=pe.restSlots,We=pe.loungeSofas,$e=i.buildConferenceFurniture(oe,de),Fe=t+Math.round(a/2),Ue=ue+Math.round(o/2),Ve=t+Math.round(a/2),Ge=s+32,Xe=S+32/2;return{worldW:l,worldH:k,environmentOverflowPx:3e3,buildingOuter:{x:g,y:w,w:y,h:v},floorWorkspace:T,floorLobby:G,floorLounge:B,floorConference:oe,zoneSplitX:De,zoneSplitLobbyLoungeX:ue,topFloorBottomY:Oe,door:be,workstationSlots:_e,restSlots:Ne,meetingSlots:de,workstationDesks:Le,loungeSofas:We,conference:$e,windowsNorthY:Xe,labelWorkspaceX:Fe,labelLoungeX:Ue,labelConferenceX:Ve,ceilingNeonY:Ge}}static workstationCapacity(n){let e=i.clampGrid(n);return e.workstationCols*e.workstationRows}static restCapacity(n){let e=i.clampGrid(n);return e.restCols*e.restRows*2}static meetingCapacity(n){return 2*i.clampGrid(n).meetingCols+2}static clampDim(n){if(!Number.isFinite(n))return 1;let e=Math.floor(n);return e<1?1:e>12?12:e}static computeWorkspaceWidthPx(n){let s=128+n*256;return Math.max(896,s)}static computeLoungeWidthPx(n){return 140+n*170}static buildWorkstationSlots(n,e){let t=[],s=i.workstationPitchX(n.workstationCols,e.w),a=e.x+64,o=i.workstationRowFeetY(n.workstationRows,e);for(let r=0;r<n.workstationRows;r++)for(let c=0;c<n.workstationCols;c++)t.push({x:Math.round(a+c*s),y:o[r]});return t}static workstationPitchX(n,e){return n<=1?0:n===3&&e===896?96:Math.max(96,Math.round((e-192)/(n-1)))}static workstationRowFeetY(n,e){if(n===3)return[e.y+112,e.y+250,e.y+452];let t=[],s=48,o=e.h-s-48,r=n<=1?0:o/(n-1);for(let c=0;c<n;c++)t.push(Math.round(e.y+s+c*r));return t}static buildWorkstationDesks(n,e){let t=[],s=i.workstationPitchX(n.workstationCols,e.w),a=e.x+64,o=i.workstationDeskTopY(n.workstationRows,e);for(let r=0;r<n.workstationRows;r++)for(let c=0;c<n.workstationCols;c++){let l=Math.round(a+c*s)-32,d=o[r],f=(r+c)%2===0;t.push({trackId:`ws-${r}-${c}`,x:l,y:d,monitorIsCyan:f})}return t}static workstationDeskTopY(n,e){return n===3?[e.y+64,e.y+256,e.y+404]:i.workstationRowFeetY(n,e).map(s=>s-48)}static buildLoungeSeatingLayout(n,e){let t=[],s=[],h=e.w-32,S=(e.h-2*18)/Math.max(1,n.restRows);for(let m=0;m<n.restRows;m++){let g=e.y+18+m*S,w=S-14;if(n.restCols<=1){let y=Math.min(188,Math.max(120,e.w-32)),v=e.x+Math.round((e.w-y)/2),k=Math.round(g+w*.12);t.push({trackId:`lounge-${m}-0`,x:v,y:k,w:y,h:36});let T=k+36+14;s.push({x:v+Math.round(y*.33),y:T}),s.push({x:v+Math.round(y*.67),y:T})}else{let y=(n.restCols-1)*12,v=Math.max(96,Math.round((h-y)/n.restCols));for(let k=0;k<n.restCols;k++){let T=e.x+16+k*(v+12),G=Math.round(g+w*.12);t.push({trackId:`lounge-${m}-${k}`,x:T,y:G,w:v,h:36});let B=G+36+14;s.push({x:T+Math.round(v*.33),y:B}),s.push({x:T+Math.round(v*.67),y:B})}}}return{restSlots:s,loungeSofas:t}}static buildMeetingSlots(n,e){return i.computeConferenceChairPositions(n,e)}static computeConferenceChairPositions(n,e){let t=[],s=Math.min(420,e.w-80),a=56,o=e.x+Math.round((e.w-s)/2),r=e.y+Math.round(e.h/2)-Math.round(a/2),c=26,u=Math.max(1,n.meetingCols);for(let d=0;d<u;d++){let f=o+Math.round((d+1)*s/(u+1));t.push({x:f,y:r-c})}for(let d=0;d<u;d++){let f=o+Math.round((d+1)*s/(u+1));t.push({x:f,y:r+a+c})}let l=r+Math.round(a/2);return t.push({x:o-c,y:l}),t.push({x:o+s+c,y:l}),t}static buildConferenceFurniture(n,e){let t=Math.min(420,n.w-80),s=56,a={x:n.x+Math.round((n.w-t)/2),y:n.y+Math.round(n.h/2)-Math.round(s/2),w:t,h:s},o=e.map((r,c)=>({trackId:`conf-chair-${c}`,x:r.x,y:r.y}));return{table:a,chairs:o}}};var se={workstationCols:3,workstationRows:3,restCols:2,restRows:3,meetingCols:2,meetingRows:2,maxEverWorkstationCols:3,maxEverWorkstationRows:3,maxEverRestCols:2,maxEverRestRows:3,maxEverMeetingCols:2,maxEverMeetingRows:2},ke=(()=>{class i{settings_AS=x(he);layoutPersisted_$=P(se);saveTimerId;grid_$=D(()=>{let e=this.layoutPersisted_$();return{workstationCols:e.workstationCols,workstationRows:e.workstationRows,restCols:e.restCols,restRows:e.restRows,meetingCols:e.meetingCols,meetingRows:e.meetingRows}});derived_$=D(()=>E.computeDerived(this.grid_$()));workstationCapacity_$=D(()=>E.workstationCapacity(this.grid_$()));restCapacity_$=D(()=>E.restCapacity(this.grid_$()));meetingCapacity_$=D(()=>E.meetingCapacity(this.grid_$()));maxEverDisplay_$=D(()=>this.layoutPersisted_$());constructor(){this.loadFromServer()}loadFromServer(){return $(this,null,function*(){try{let e=yield this.settings_AS.getSection(ae.darkOfficeLayout);if(e==null||Object.keys(e).length===0){this.layoutPersisted_$.set(se);return}let t=i.parsePayload(e);this.layoutPersisted_$.set(t)}catch{this.layoutPersisted_$.set(se)}})}ensureMinCapacitiesFromSceneCharacters(e){let t=0,s=0,a=0;for(let c of e)c.scenePlacement===O.meeting?a++:c.presence===p.working?t++:s++;let o=this.layoutPersisted_$(),r=R({},o);r=i.expandGridToFit(r,t,s,a),!i.isSamePersisted(o,r)&&(this.layoutPersisted_$.set(r),this.scheduleDebouncedSave())}applyPersistedFromUser(e){return $(this,null,function*(){this.layoutPersisted_$.set(R({},e)),yield this.saveNow()})}validateProposedGridAgainstSceneCharacters(e){let t=E.clampGrid(e.grid),s=0,a=0,o=0;for(let l of e.characters)l.scenePlacement===O.meeting?o++:l.presence===p.working?s++:a++;let r=E.workstationCapacity(t),c=E.restCapacity(t),u=E.meetingCapacity(t);return s<=r&&a<=c&&o<=u?null:`Dark office layout rejected: scene occupancy exceeds proposed capacity. workstation=${s}/${r}, rest=${a}/${c}, meeting=${o}/${u}.`}getWorkstationSlots(){return this.derived_$().workstationSlots}getRestSlots(){return this.derived_$().restSlots}getMeetingSlots(){return this.derived_$().meetingSlots}getDoorPosition(){return this.derived_$().door}scheduleDebouncedSave(){this.saveTimerId!==void 0&&clearTimeout(this.saveTimerId),this.saveTimerId=setTimeout(()=>{this.saveTimerId=void 0,this.saveNow()},500)}saveNow(){return $(this,null,function*(){let e={workstationCols:this.layoutPersisted_$().workstationCols,workstationRows:this.layoutPersisted_$().workstationRows,restCols:this.layoutPersisted_$().restCols,restRows:this.layoutPersisted_$().restRows,meetingCols:this.layoutPersisted_$().meetingCols,meetingRows:this.layoutPersisted_$().meetingRows,maxEverWorkstationCols:this.layoutPersisted_$().maxEverWorkstationCols,maxEverWorkstationRows:this.layoutPersisted_$().maxEverWorkstationRows,maxEverRestCols:this.layoutPersisted_$().maxEverRestCols,maxEverRestRows:this.layoutPersisted_$().maxEverRestRows,maxEverMeetingCols:this.layoutPersisted_$().maxEverMeetingCols,maxEverMeetingRows:this.layoutPersisted_$().maxEverMeetingRows};try{yield this.settings_AS.saveSection(ae.darkOfficeLayout,e)}catch{}})}static parsePayload(e){let t=(o,r)=>{let c=e[o];return typeof c=="number"&&Number.isFinite(c)?Math.floor(c):r},s=se,a={workstationCols:t("workstationCols",s.workstationCols),workstationRows:t("workstationRows",s.workstationRows),restCols:t("restCols",s.restCols),restRows:t("restRows",s.restRows),meetingCols:t("meetingCols",s.meetingCols),meetingRows:t("meetingRows",s.meetingRows),maxEverWorkstationCols:t("maxEverWorkstationCols",s.maxEverWorkstationCols),maxEverWorkstationRows:t("maxEverWorkstationRows",s.maxEverWorkstationRows),maxEverRestCols:t("maxEverRestCols",s.maxEverRestCols),maxEverRestRows:t("maxEverRestRows",s.maxEverRestRows),maxEverMeetingCols:t("maxEverMeetingCols",s.maxEverMeetingCols),maxEverMeetingRows:t("maxEverMeetingRows",s.maxEverMeetingRows)};return i.clampPersisted(a)}static clampPersisted(e){let t=a=>{if(!Number.isFinite(a))return 1;let o=Math.floor(a);return o<1?1:o>12?12:o},s={workstationCols:t(e.workstationCols),workstationRows:t(e.workstationRows),restCols:t(e.restCols),restRows:t(e.restRows),meetingCols:t(e.meetingCols),meetingRows:t(e.meetingRows),maxEverWorkstationCols:t(e.maxEverWorkstationCols),maxEverWorkstationRows:t(e.maxEverWorkstationRows),maxEverRestCols:t(e.maxEverRestCols),maxEverRestRows:t(e.maxEverRestRows),maxEverMeetingCols:t(e.maxEverMeetingCols),maxEverMeetingRows:t(e.maxEverMeetingRows)};return s.maxEverWorkstationCols=Math.max(s.maxEverWorkstationCols,s.workstationCols),s.maxEverWorkstationRows=Math.max(s.maxEverWorkstationRows,s.workstationRows),s.maxEverRestCols=Math.max(s.maxEverRestCols,s.restCols),s.maxEverRestRows=Math.max(s.maxEverRestRows,s.restRows),s.maxEverMeetingCols=Math.max(s.maxEverMeetingCols,s.meetingCols),s.maxEverMeetingRows=Math.max(s.maxEverMeetingRows,s.meetingRows),s}static isSamePersisted(e,t){return e.workstationCols===t.workstationCols&&e.workstationRows===t.workstationRows&&e.restCols===t.restCols&&e.restRows===t.restRows&&e.meetingCols===t.meetingCols&&e.meetingRows===t.meetingRows&&e.maxEverWorkstationCols===t.maxEverWorkstationCols&&e.maxEverWorkstationRows===t.maxEverWorkstationRows&&e.maxEverRestCols===t.maxEverRestCols&&e.maxEverRestRows===t.maxEverRestRows&&e.maxEverMeetingCols===t.maxEverMeetingCols&&e.maxEverMeetingRows===t.maxEverMeetingRows}static expandGridToFit(e,t,s,a){let o=e.workstationCols,r=e.workstationRows,c=e.restCols,u=e.restRows,l=e.meetingCols,d=e.meetingRows;for(;o*r<t&&(o<12||r<12);)o<=r?o=Math.min(12,o+1):r=Math.min(12,r+1);for(;c*u<s&&(c<12||u<12);)c<=u?c=Math.min(12,c+1):u=Math.min(12,u+1);for(;l*d<a&&(l<12||d<12);)l<=d?l=Math.min(12,l+1):d=Math.min(12,d+1);let f={workstationCols:o,workstationRows:r,restCols:c,restRows:u,meetingCols:l,meetingRows:d,maxEverWorkstationCols:Math.max(e.maxEverWorkstationCols,o),maxEverWorkstationRows:Math.max(e.maxEverWorkstationRows,r),maxEverRestCols:Math.max(e.maxEverRestCols,c),maxEverRestRows:Math.max(e.maxEverRestRows,u),maxEverMeetingCols:Math.max(e.maxEverMeetingCols,l),maxEverMeetingRows:Math.max(e.maxEverMeetingRows,d)};return i.clampPersisted(f)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=Z({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var ie=J(ee());var K=function(i){return i.connected="connected",i.disconnected="disconnected",i.error="error",i.unreachable="unreachable",i}(K||{});var W=class{static pickCcapPrimary(n){if(!n.length)return null;let e=(o,r)=>new Date(r.lastActivityAt).getTime()-new Date(o.lastActivityAt).getTime(),t=n.filter(o=>o.hasActiveRun===!0||o.presence===p.working);return t.length>0?[...t].sort(e)[0]??null:[...n].sort(e)[0]??null}static pickCciPrimary(n){if(!n.length)return null;let e=(o,r)=>new Date(r.lastActivityAt).getTime()-new Date(o.lastActivityAt).getTime(),t=n.filter(o=>o.hasActiveSession===!0||o.presence===p.working);return t.length>0?[...t].sort(e)[0]??null:[...n].sort(e)[0]??null}static pickCaiPrimary(n){if(!n.length)return null;let e=(o,r)=>new Date(r.lastActivityAt).getTime()-new Date(o.lastActivityAt).getTime(),t=n.filter(o=>o.hasActiveSession===!0||o.presence===p.working);return t.length>0?[...t].sort(e)[0]??null:[...n].sort(e)[0]??null}};var z=class{static pickPrimary(n){if(!n.length)return null;let e=(o,r)=>new Date(r.lastActivityAt).getTime()-new Date(o.lastActivityAt).getTime(),t=n.filter(o=>o.hasActiveSession);return t.length>0?[...t].sort(e)[0]??null:[...n].sort(e)[0]??null}};var xe=J(ee()),Pe=2*xe.minute;var ne=class i{static mapGatewaySessionsResponse(n){let e=[];for(let t of n.sessions){let s=i.mapOneSession(t);s!==null&&e.push(s)}return e}static mapOneSession(n){let e=typeof n.key=="string"?n.key:typeof n.sessionId=="string"?n.sessionId:typeof n.id=="string"?n.id:"";if(!e.trim())return null;let t=typeof n.status=="string"?n.status.trim().toLowerCase():"",s=i.resolvePresenceFromGatewaySession({statusLower:t,raw:n}),a=s===p.working,o=H.extractTimestamp(n,H.GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES)??new Date().toISOString(),r=typeof n.label=="string"?n.label:typeof n.name=="string"?n.name:typeof n.title=="string"?n.title:void 0,u=(typeof n.statusMessage=="string"?n.statusMessage:void 0)?.trim()||(t.length>0?t:"OpenClaw session"),l=typeof n.lastPrompt=="string"?n.lastPrompt:void 0;return{sessionId:e,sessionName:r,presence:s,lastActivityAt:o,hasActiveSession:a,activitySummary:u,lastMessage:l}}static resolvePresenceFromGatewaySession(n){let e=n.statusLower;return e==="connecting"?p.working:i.hasRecentGatewayOutputTimestamp(n.raw)?p.working:e?p.idle:p.idle}static hasRecentGatewayOutputTimestamp(n){let e=H.extractTimestamp(n,H.GATEWAY_OUTPUT_ONLY_TIMESTAMP_FIELD_NAMES);if(!e?.length)return!1;let t=Date.parse(e);return Number.isNaN(t)?!1:Date.now()-t<=Pe}};var re=function(i){return i.creating="creating",i.connecting="connecting",i.waitingInput="waiting-input",i.running="running",i.errored="errored",i.completed="completed",i.terminated="terminated",i.disconnected="disconnected",i}(re||{});var Ee=J(ee()),ce=(()=>{class i{static INTERESTING_SESSION_WINDOW_MS=5*Ee.minute;static prune(e,t){if(e.length===0)return[];let s=t.nowMs,a=t.recentWindowMs,o=[];for(let u of e){let l=new Date(u.lastActivityAt).getTime();Number.isNaN(l)||o.push({row:u,ms:l})}if(o.length===0)return[];let r=o.filter(u=>s-u.ms<=a),c=u=>{let d=[...u].sort((f,h)=>{let I=h.ms-f.ms;return I!==0?I:f.row.sessionId.localeCompare(h.row.sessionId)})[0];if(!d)throw new Error("DO_InstanceTrackerSessionStatuses_Prune_Util | empty sort");return d.row};if(r.length>0){let u=new Map;for(let l of r){let d=u.get(l.row.sessionId);(!d||l.ms>=d.ms)&&u.set(l.row.sessionId,l)}return[...u.values()].sort((l,d)=>d.ms-l.ms).map(l=>l.row)}return[c(o)]}}return i})();var V=class i{static resolveCcapSessionStatuses(n){let e=i.mapRawToCcapSessionStatuses(n.inst.rawSessionStatuses),t=e.length>0?e:i.snapshotCcapSessionStatuses({darkOffice_DS:n.darkOffice_DS,instanceId:n.inst.instanceId});return i.applyInterestingSessionWindow(t)}static resolveOciSessionStatuses(n){let e=i.mapRawToOciSessionStatuses(n.inst.rawSessionStatuses),t=e.length>0?e:i.snapshotOciSessionStatuses({darkOffice_DS:n.darkOffice_DS,instanceId:n.inst.instanceId});return i.applyInterestingSessionWindow(t)}static resolveCciSessionStatuses(n){let e=U.parseCcapId(n.inst.instanceId);if(!e)return[];let t=i.mapRawToCciSessionStatuses(n.inst.rawSessionStatuses),s=t.length>0?t:i.snapshotCciSessionStatuses({darkOffice_DS:n.darkOffice_DS,ccapId:e});return i.applyInterestingSessionWindow(s)}static resolveCaiSessionStatuses(n){let e=F.parseCcapId(n.inst.instanceId);if(!e)return[];let t=i.mapRawToCaiSessionStatuses(n.inst.rawSessionStatuses),s=t.length>0?t:i.snapshotCaiSessionStatuses({darkOffice_DS:n.darkOffice_DS,ccapId:e});return i.applyInterestingSessionWindow(s)}static applyInterestingSessionWindow(n){return ce.prune(n,{nowMs:Date.now(),recentWindowMs:ce.INTERESTING_SESSION_WINDOW_MS})}static snapshotCcapSessionStatuses(n){let t=n.darkOffice_DS.getCcapInstanceDataSnapshot(n.instanceId)?.sessionStatuses;return Array.isArray(t)?t:[]}static snapshotOciSessionStatuses(n){let t=n.darkOffice_DS.getOciInstanceDataSnapshot(n.instanceId)?.sessionStatuses;return Array.isArray(t)?t:[]}static snapshotCciSessionStatuses(n){let t=n.darkOffice_DS.getCciInstanceDataSnapshot(n.ccapId)?.sessionStatuses;return Array.isArray(t)?t:[]}static snapshotCaiSessionStatuses(n){let t=n.darkOffice_DS.getCaiInstanceDataSnapshot(n.ccapId)?.sessionStatuses;return Array.isArray(t)?t:[]}static mapRawToCcapSessionStatuses(n){if(!Array.isArray(n)||n.length===0)return[];let e=[];for(let t of n){if(!("hasActiveRun"in t))continue;let s=t.hasActiveRun;if(typeof s!="boolean")continue;let a=t.sessionId;if(typeof a!="string")continue;let o=t.presence;if(!i.isPresenceEnum(o))continue;let r=t.lastActivityAt;if(typeof r!="string")continue;let c=t.activitySummary;if(typeof c!="string")continue;let u=t.sessionName,l=t.lastMessage,d;if("activeRunPhase"in t){let h=t.activeRunPhase;if(h==null)d=void 0;else if(i.isRunFlowPhaseValue(h))d=h;else continue}let f;if("activeRunId"in t){let h=t.activeRunId;if(typeof h=="string")f=h;else if(h!=null)continue}e.push({sessionId:a,sessionName:typeof u=="string"?u:void 0,presence:o,lastActivityAt:r,hasActiveRun:s,activeRunId:f,activeRunPhase:d,activitySummary:c,lastMessage:typeof l=="string"?l:void 0})}return e}static mapRawToCaiSessionStatuses(n){if(!Array.isArray(n)||n.length===0)return[];let e=[];for(let t of n){if("hasActiveRun"in t||!("hasActiveSession"in t)||!("currentCaSessionStatus"in t))continue;let s=i.tryMapToOciOrCciShape(t);if(s===null)continue;let a=Reflect.get(t,"currentCaSessionStatus"),o;i.isCaSessionStatusValue(a)&&(o=a),e.push({sessionId:s.sessionId,sessionName:s.sessionName,presence:s.presence,lastActivityAt:s.lastActivityAt,hasActiveSession:s.hasActiveSession,currentCaSessionStatus:o,activitySummary:s.activitySummary,lastMessage:s.lastMessage})}return e}static mapRawToOciSessionStatuses(n){if(!Array.isArray(n)||n.length===0)return[];let e=[];for(let t of n){if("hasActiveRun"in t||!("hasActiveSession"in t))continue;let s=i.tryMapToOciOrCciShape(t);s!==null&&e.push(s)}return e}static mapRawToCciSessionStatuses(n){if(!Array.isArray(n)||n.length===0)return[];let e=[];for(let t of n){if("hasActiveRun"in t||!("hasActiveSession"in t))continue;let s=i.tryMapToOciOrCciShape(t);if(s===null)continue;let a;if("currentCcSessionStatus"in t){let o=t.currentCcSessionStatus;typeof o=="string"&&(a=o)}e.push({sessionId:s.sessionId,sessionName:s.sessionName,presence:s.presence,lastActivityAt:s.lastActivityAt,hasActiveSession:s.hasActiveSession,currentCcSessionStatus:a,activitySummary:s.activitySummary,lastMessage:s.lastMessage})}return e}static tryMapToOciOrCciShape(n){if(!("hasActiveSession"in n))return null;let e=Reflect.get(n,"hasActiveSession");if(typeof e!="boolean")return null;let t=n.sessionId;if(typeof t!="string")return null;let s=n.presence;if(!i.isPresenceEnum(s))return null;let a=n.lastActivityAt;if(typeof a!="string")return null;let o=n.activitySummary;if(typeof o!="string")return null;let r=n.sessionName,c=n.lastMessage;return{sessionId:t,sessionName:typeof r=="string"?r:void 0,presence:s,lastActivityAt:a,hasActiveSession:e,activitySummary:o,lastMessage:typeof c=="string"?c:void 0}}static isPresenceEnum(n){return typeof n!="string"?!1:Object.values(p).includes(n)}static isRunFlowPhaseValue(n){if(typeof n!="string")return!1;let e=Object.values(we);for(let t of e)if(t===n)return!0;return!1}static isCaSessionStatusValue(n){if(typeof n!="string")return!1;let e=Object.values(re);for(let t of e)if(t===n)return!0;return!1}};var Te=72,q=class i{static buildLastMessageDerivedStatusLabel(n){let e=n.trim();return e&&e.startsWith("[QUEUE]")?"Message queued":""}static buildPanelActiveSessionRows(n){let e=n.rawSessionStatuses;if(!e||e.length===0)return[];let t=n.characterType,s;return t===C.openclaw||t===C.ccSession||t===C.caSession?s=i.collectActiveOciOrCciFromUnion(e):s=i.collectActiveCcapFromUnion(e),s.length<=1?[]:s}static buildSessionDisplayLabel(n,e){let t=e?.trim();return t||i.shortenSessionId(n)}static truncateLastMessagePreview(n){let e=n.trim();return e?e.length<=Te?e:`${e.slice(0,Te-1)}\u2026`:""}static isCcapSessionRow(n){return"hasActiveRun"in n}static isOciOrCciSessionRow(n){return"hasActiveSession"in n}static isCcapSessionActive(n){return n.hasActiveRun===!0?!0:n.presence===p.working}static isOciOrCciSessionActive(n){return n.hasActiveSession===!0?!0:n.presence===p.working}static isSessionActiveForSceneDuplication(n){if(n.row.presence===p.offline)return!1;let e=n.characterType;return e===C.openclaw||e===C.ccSession||e===C.caSession?i.isOciOrCciSessionRow(n.row)?i.isOciOrCciSessionActive(n.row):!1:i.isCcapSessionRow(n.row)?i.isCcapSessionActive(n.row):!1}static shortenSessionId(n){return n.length<=10?n:`${n.slice(0,8)}\u2026`}static collectActiveCcapFromUnion(n){let e=[];for(let t of n){if(!i.isCcapSessionRow(t)||!i.isCcapSessionActive(t))continue;let s=i.truncateLastMessagePreview(t.lastMessage??"");e.push({sessionId:t.sessionId,displayLabel:i.buildSessionDisplayLabel(t.sessionId,t.sessionName),presence:t.presence,activitySummary:t.activitySummary,lastMessagePreview:s})}return e}static collectActiveOciOrCciFromUnion(n){let e=[];for(let t of n){if(!i.isOciOrCciSessionRow(t)||!i.isOciOrCciSessionActive(t))continue;let s=i.truncateLastMessagePreview(t.lastMessage??"");e.push({sessionId:t.sessionId,displayLabel:i.buildSessionDisplayLabel(t.sessionId,t.sessionName),presence:t.presence,activitySummary:t.activitySummary,lastMessagePreview:s})}return e}};var le=J(ee());var Q=(()=>{class i{static sceneRecentActivityWindowMs=5*le.minute;static sceneIdleWalkActivityWindowMs=15*le.minute;static parseLastActivityMs(e){let t=Date.parse(e);return Number.isNaN(t)?Number.NaN:t}static isSessionRecentAndOnline(e){if(e.presence===p.offline)return!1;let t=i.parseLastActivityMs(e.lastActivityAtIso);return Number.isNaN(t)?!1:e.nowMs-t<=e.windowMs}static rowLastActivityIso(e){return e.lastActivityAt??""}static isSessionWorkingForSceneCharacter(e){return e.presence===p.working||"hasActiveRun"in e&&e.hasActiveRun===!0||"hasActiveSession"in e&&e.hasActiveSession===!0}static isWorkingSessionRecentAndOnline(e){return i.isSessionWorkingForSceneCharacter(e.row)?i.isSessionRecentAndOnline({lastActivityAtIso:i.rowLastActivityIso(e.row),presence:e.row.presence,nowMs:e.nowMs,windowMs:e.windowMs}):!1}static isSessionInIdleWalkWindow(e){if(e.row.presence===p.offline||i.isWorkingSessionRecentAndOnline({row:e.row,nowMs:e.nowMs,windowMs:e.recentWindowMs}))return!1;let t=i.parseLastActivityMs(i.rowLastActivityIso(e.row));return Number.isNaN(t)?!1:e.nowMs-t<=e.idleWalkWindowMs}static pickNewestSessionByLastActivity(e){let t=e.sessions;return t.length===0?null:[...t].sort((o,r)=>{let c=i.parseLastActivityMs(i.rowLastActivityIso(o)),u=i.parseLastActivityMs(i.rowLastActivityIso(r)),l=!Number.isNaN(c),d=!Number.isNaN(u);return l&&d&&u!==c?u-c:l!==d?l?-1:1:o.sessionId.localeCompare(r.sessionId)})[0]??null}}return i})();var je="instance-data:session-status-updated",Be="openclaw-instance-data:status-updated",He="cci-instance-data:status-updated",Ke="cai-instance-data:status-updated",ys=(()=>{class i{instances_$=P([]);characters_$=D(()=>{let e=this.expandInstancesToCharacters(this.instances_$());return this.assignDistinctSlotsForScene(e)});loading_$=P(!1);loadError_$=P(null);isServerUnreachable_$=P(!1);selectedInstanceId_$=P(null);chatPopupSessionId_$=P(null);chatPopupSessionType_$=P(null);instanceStatusDetailInstanceId_$=P(null);instanceData_AS=x(ve);ociInstanceData_AS=x(Ce);cciInstanceData_AS=x(ge);caiInstanceData_AS=x(Ie);runtimeInstances_DS=x(Re);socket_CS=x(ye);ocSession_DS=x(Ae);darkOfficeLayout_DS=x(ke);constructor(){me(()=>{this.darkOfficeLayout_DS.ensureMinCapacitiesFromSceneCharacters(this.characters_$())},{allowSignalWrites:!0}),this.socket_CS.event$.subscribe(e=>{e.event===je?this.handleInstanceStatusUpdate(e.payload):e.event===Be?this.handleOciInstanceStatusUpdate(e.payload):e.event===He?this.handleCciInstanceStatusUpdate(e.payload):e.event===Ke&&this.handleCaiInstanceStatusUpdate(e.payload)})}workstationSlotMap=new Map;restSlotMap=new Map;patchTimerMap=new Map;meetingRoomLingerMs=2*ie.minute;sessionMeetingRoomUntilByKey=new Map;loadInstanceData(){return $(this,null,function*(){this.loading_$.set(!0),this.loadError_$.set(null);try{yield this.runtimeInstances_DS.loadCcapInstanceList();let e=this.runtimeInstances_DS.ccapInstanceListError_$();if(e){e instanceof fe&&e.status===0?this.isServerUnreachable_$.set(!0):this.loadError_$.set(e);return}yield this.runtimeInstances_DS.loadOciInstanceListAllowEmpty(),yield this.runtimeInstances_DS.loadCciInstanceListAllowEmpty(),yield this.runtimeInstances_DS.loadCaiInstanceListAllowEmpty(),this.isServerUnreachable_$.set(!1);let s=this.runtimeInstances_DS.ccapInstanceList_$().filter(d=>d.status===te.active),a=this.runtimeInstances_DS.ociInstanceList_$(),o=yield this.enrichOciListWithGatewaySessions({list:a}),c=this.runtimeInstances_DS.cciInstanceList_$().filter(d=>d.status===te.active),l=this.runtimeInstances_DS.caiInstanceList_$().filter(d=>d.status===te.active);this.applyAllInstanceData(s,o,c,l)}finally{this.loading_$.set(!1)}})}enrichOciListWithGatewaySessions(e){return $(this,null,function*(){return yield Promise.all(e.list.map(s=>$(this,null,function*(){let a=s.sessionStatuses??[];if(!(s.connectionStatus===K.connected)||a.length>0)return s;try{let r=yield this.ocSession_DS.fetchGatewaySessionsForInstance({instanceId:s.instanceId}),c=ne.mapGatewaySessionsResponse({sessions:r.rawSessions});return c.length===0?s:A(R({},s),{sessionStatuses:c})}catch(r){return ie.DyFM_Error.logSimple("CCAP_DarkOffice_DS | enrichOciListWithGatewaySessions failed",r),s}})))})}saveVisuals(e,t){this.instances_$.update(s=>s.map(a=>a.instanceId===e?A(R({},a),{visuals:t}):a)),this.schedulePatch(e,t)}dismissError(){this.loadError_$.set(null)}openChatPopup(e,t=null){this.chatPopupSessionId_$.set(e),this.chatPopupSessionType_$.set(t)}closeChatPopup(){this.chatPopupSessionId_$.set(null),this.chatPopupSessionType_$.set(null)}selectInstance(e){this.selectedInstanceId_$.set(e)}openInstanceStatusDetail(e){this.instanceStatusDetailInstanceId_$.set(e)}closeInstanceStatusDetail(){this.instanceStatusDetailInstanceId_$.set(null)}getCcapInstanceDataSnapshot(e){return this.runtimeInstances_DS.ccapInstanceList_$().find(t=>t.ccapId===e)}getOciInstanceDataSnapshot(e){return this.runtimeInstances_DS.ociInstanceList_$().find(t=>t.instanceId===e)}getCciInstanceDataSnapshot(e){return this.runtimeInstances_DS.cciInstanceList_$().find(t=>t.ccapId===e)}getCaiInstanceDataSnapshot(e){return this.runtimeInstances_DS.caiInstanceList_$().find(t=>t.ccapId===e)}resolveOfficeInstanceById(e){return e?this.instances_$().find(a=>a.instanceId===e)??null:null}resolveModalCcapSessionStatuses(e){return V.resolveCcapSessionStatuses({inst:e,darkOffice_DS:this})}resolveModalOciSessionStatuses(e){return V.resolveOciSessionStatuses({inst:e,darkOffice_DS:this})}resolveModalCciSessionStatuses(e){return V.resolveCciSessionStatuses({inst:e,darkOffice_DS:this})}resolveModalCaiSessionStatuses(e){return V.resolveCaiSessionStatuses({inst:e,darkOffice_DS:this})}buildInstanceStatusDetailRuntimeHint(e){let t=e.characterType??C.ccap;if(t===C.openclaw)return this.resolveModalOciSessionStatuses(e).length>0||this.getOciInstanceDataSnapshot(e.instanceId)?"":"No matching OCI row in runtime list (last load only; socket updates may not refresh this list).";if(t===C.ccSession){let o=U.parseCcapId(e.instanceId);return!o||this.resolveModalCciSessionStatuses(e).length>0||this.getCciInstanceDataSnapshot(o)?"":"No matching CCI row in runtime list (last load only; socket updates may not refresh this list)."}if(t===C.caSession){let o=F.parseCcapId(e.instanceId);return!o||this.resolveModalCaiSessionStatuses(e).length>0||this.getCaiInstanceDataSnapshot(o)?"":"No matching CAI row in runtime list (last load only; socket updates may not refresh this list)."}return this.resolveModalCcapSessionStatuses(e).length>0||this.getCcapInstanceDataSnapshot(e.instanceId)?"":"No matching CCAP row in runtime list (last load only; socket updates may not refresh this list)."}pruneExpiredMeetingRoomKeys(e){for(let t of[...this.sessionMeetingRoomUntilByKey.keys()]){let s=this.sessionMeetingRoomUntilByKey.get(t);s!==void 0&&s<=e&&this.sessionMeetingRoomUntilByKey.delete(t)}}applyMeetingRoomTransitionForSessionDiff(e){let t=Date.now();this.pruneExpiredMeetingRoomKeys(t);let s=new Map;for(let a of e.previousRows??[])s.set(a.sessionId,a.presence);for(let a of e.nextRows??[]){let o=s.get(a.sessionId),r=`${e.baseInstanceId}::${a.sessionId}`;o===p.working&&a.presence===p.idle&&this.sessionMeetingRoomUntilByKey.set(r,t+this.meetingRoomLingerMs)}}resolveScenePlacementForSessionKey(e){let t=`${e.baseInstanceId}::${e.sessionId}`,s=this.sessionMeetingRoomUntilByKey.get(t);if(s!==void 0&&Date.now()<s)return O.meeting}handleInstanceStatusUpdate(e){let t=typeof e.ccapId=="string"?e.ccapId:void 0,s=e.sessionStatuses,a=Array.isArray(s)?s:void 0;if(!t||!a)return;let o=this.instances_$(),r=o.findIndex(h=>h.instanceId===t);if(r<0){this.loadInstanceData();return}let c=o[r];this.applyMeetingRoomTransitionForSessionDiff({baseInstanceId:t,previousRows:c.rawSessionStatuses,nextRows:a});let u=this.resolveSessionInfoFromStatuses(a),l=this.assignSlot(t,u.presence,c),d=this.resolveAnimState(u.presence,c.presence),f=this.applyPanelCardProjection(A(R({},c),{presence:u.presence,activitySummary:u.activitySummary,currentRunFlowPhase:u.currentRunFlowPhase,latestSessionId:u.latestSessionId,lastMessage:u.lastMessage,animState:d,previousPresence:c.presence,assignedSlotIndex:l,rawSessionStatuses:a}));this.instances_$.update(h=>h.map(I=>I.instanceId===t?f:I))}resolveSessionInfoFromStatuses(e){if(e.length===0)return{presence:p.idle,activitySummary:"No CCAP Session activity",currentRunFlowPhase:null,latestSessionId:null,lastMessage:""};let s=W.pickCcapPrimary(e)??e[0];return{presence:s.presence,activitySummary:s.activitySummary,currentRunFlowPhase:s.activeRunPhase??null,latestSessionId:s.sessionId,lastMessage:s.lastMessage??""}}applyPanelCardProjection(e){let t=e.sessionName??"";if(!t&&e.latestSessionId&&e.rawSessionStatuses){for(let s of e.rawSessionStatuses)if(s.sessionId===e.latestSessionId){t=s.sessionName??"";break}}return A(R({},e),{sessionName:t,lastMessageDerivedStatusLabel:q.buildLastMessageDerivedStatusLabel(e.lastMessage),panelActiveSessionRows:q.buildPanelActiveSessionRows({characterType:e.characterType,rawSessionStatuses:e.rawSessionStatuses})})}applyAllInstanceData(e,t,s,a){let o=this.instances_$(),r=new Map(o.map(S=>[S.instanceId,S])),c=e.map(S=>{let m=r.get(S.ccapId),g=m?.visuals??this.mapToVisuals(S),w=this.resolveSessionInfo(S),y=this.assignSlot(S.ccapId,w.presence,m),v=this.resolveAnimState(w.presence,m?.presence??null);return this.applyPanelCardProjection({instanceId:S.ccapId,presence:w.presence,activitySummary:w.activitySummary,currentRunFlowPhase:w.currentRunFlowPhase,latestSessionId:w.latestSessionId,lastMessage:w.lastMessage,visuals:g,animState:v,previousPresence:m?.presence??null,assignedSlotIndex:y,characterType:C.ccap,connectionStatus:null,rawSessionStatuses:S.sessionStatuses??[],lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]})}),u=t.map(S=>{let m=r.get(S.instanceId),g=m?.visuals??this.mapOciToVisuals(S),w=this.resolveOciSessionInfo(S),y=this.assignSlot(S.instanceId,w.presence,m),v=this.resolveAnimState(w.presence,m?.presence??null);return this.applyPanelCardProjection({instanceId:S.instanceId,presence:w.presence,activitySummary:w.activitySummary,currentRunFlowPhase:null,latestSessionId:w.latestSessionId,lastMessage:w.lastMessage,visuals:g,animState:v,previousPresence:m?.presence??null,assignedSlotIndex:y,characterType:C.openclaw,connectionStatus:S.connectionStatus??null,rawSessionStatuses:S.sessionStatuses??[],lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]})}),l=s.map(S=>{let m=U.build({ccapId:S.ccapId}),g=r.get(m),w=g?.visuals??this.mapCciToVisuals(S),y=this.resolveCciSessionInfo(S),v=this.assignSlot(m,y.presence,g),k=this.resolveAnimState(y.presence,g?.presence??null);return this.applyPanelCardProjection({instanceId:m,presence:y.presence,activitySummary:y.activitySummary,currentRunFlowPhase:y.currentRunFlowPhase,latestSessionId:y.latestSessionId,lastMessage:y.lastMessage,visuals:w,animState:k,previousPresence:g?.presence??null,assignedSlotIndex:v,characterType:C.ccSession,connectionStatus:null,rawSessionStatuses:S.sessionStatuses??[],lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]})}),d=a.map(S=>{let m=F.build({ccapId:S.ccapId}),g=r.get(m),w=g?.visuals??this.mapCaiToVisuals(S),y=this.resolveCaiSessionInfo(S),v=this.assignSlot(m,y.presence,g),k=this.resolveAnimState(y.presence,g?.presence??null);return this.applyPanelCardProjection({instanceId:m,presence:y.presence,activitySummary:y.activitySummary,currentRunFlowPhase:y.currentRunFlowPhase,latestSessionId:y.latestSessionId,lastMessage:y.lastMessage,visuals:w,animState:k,previousPresence:g?.presence??null,assignedSlotIndex:v,characterType:C.caSession,connectionStatus:null,rawSessionStatuses:S.sessionStatuses??[],lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]})}),f=[...c,...u,...l,...d];for(let S of f){let m=r.get(S.instanceId);this.applyMeetingRoomTransitionForSessionDiff({baseInstanceId:S.instanceId,previousRows:m?.rawSessionStatuses,nextRows:S.rawSessionStatuses})}let h=new Set(f.map(S=>S.instanceId)),I=o.filter(S=>!h.has(S.instanceId)&&S.animState!==M.walkingOut).map(S=>this.applyPanelCardProjection(A(R({},S),{animState:M.walkingOut})));this.instances_$.set([...f,...I]),I.length>0&&setTimeout(()=>{this.instances_$.update(S=>S.filter(m=>h.has(m.instanceId)))},Me+200)}mapToVisuals(e){let t=e.darkOfficeVisuals;return{skinColor:t?.skinColor??b.skinColor,hairColor:t?.hairColor??b.hairColor,hairStyle:t?.hairStyle??b.hairStyle,shirtColor:t?.shirtColor??b.shirtColor,clothingStyle:t?.clothingStyle??b.clothingStyle,pantsColor:t?.pantsColor??b.pantsColor,eyeColor:t?.eyeColor??b.eyeColor,bodyType:t?.bodyType??b.bodyType,displayName:e.name??""}}resolveSessionInfo(e){let t=e.sessionStatuses;if(!t||t.length===0)return{presence:p.idle,activitySummary:"No CCAP Session activity",currentRunFlowPhase:null,latestSessionId:null,lastMessage:""};let a=W.pickCcapPrimary(t)??t[0];return{presence:a.presence,activitySummary:a.activitySummary,currentRunFlowPhase:a.activeRunPhase??null,latestSessionId:a.sessionId,lastMessage:a.lastMessage??""}}mapOciToVisuals(e){let t=e.darkOfficeVisuals;return{skinColor:t?.skinColor??_.skinColor,hairColor:t?.hairColor??_.hairColor,hairStyle:t?.hairStyle??_.hairStyle,shirtColor:t?.shirtColor??_.shirtColor,clothingStyle:t?.clothingStyle??_.clothingStyle,pantsColor:t?.pantsColor??_.pantsColor,eyeColor:t?.eyeColor??_.eyeColor,bodyType:t?.bodyType??_.bodyType,displayName:e.label??""}}mapCaiToVisuals(e){let t=e.darkOfficeVisuals;return{skinColor:t?.skinColor??N.skinColor,hairColor:t?.hairColor??N.hairColor,hairStyle:t?.hairStyle??N.hairStyle,shirtColor:t?.shirtColor??N.shirtColor,clothingStyle:t?.clothingStyle??N.clothingStyle,pantsColor:t?.pantsColor??N.pantsColor,eyeColor:t?.eyeColor??N.eyeColor,bodyType:t?.bodyType??N.bodyType,displayName:e.name??""}}resolveCaiSessionInfo(e){let t=e.sessionStatuses??[];if(t.length===0)return{presence:p.idle,activitySummary:"No CA Session activity",currentRunFlowPhase:null,latestSessionId:null,lastMessage:""};let a=W.pickCaiPrimary(t)??t[0];return{presence:a.presence,activitySummary:a.activitySummary,currentRunFlowPhase:a.currentCaSessionStatus??null,latestSessionId:a.sessionId,lastMessage:a.lastMessage??""}}mapCciToVisuals(e){let t=e.darkOfficeVisuals;return{skinColor:t?.skinColor??L.skinColor,hairColor:t?.hairColor??L.hairColor,hairStyle:t?.hairStyle??L.hairStyle,shirtColor:t?.shirtColor??L.shirtColor,clothingStyle:t?.clothingStyle??L.clothingStyle,pantsColor:t?.pantsColor??L.pantsColor,eyeColor:t?.eyeColor??L.eyeColor,bodyType:t?.bodyType??L.bodyType,displayName:e.name??""}}resolveCciSessionInfo(e){let t=e.sessionStatuses??[];if(t.length===0)return{presence:p.idle,activitySummary:"No CC Session activity",currentRunFlowPhase:null,latestSessionId:null,lastMessage:""};let a=W.pickCciPrimary(t)??t[0];return{presence:a.presence,activitySummary:a.activitySummary,currentRunFlowPhase:a.currentCcSessionStatus??null,latestSessionId:a.sessionId,lastMessage:a.lastMessage??""}}resolveOciSessionInfo(e){if(!(e.connectionStatus===K.connected))return{presence:p.offline,activitySummary:"Gateway disconnected",latestSessionId:null,lastMessage:""};let s=e.sessionStatuses??[];if(s.length===0)return{presence:p.idle,activitySummary:"Connected",latestSessionId:null,lastMessage:""};let a=z.pickPrimary(s);return a?{presence:a.presence,activitySummary:a.activitySummary,latestSessionId:a.sessionId,lastMessage:a.lastMessage??""}:{presence:p.idle,activitySummary:"Connected",latestSessionId:null,lastMessage:""}}handleOciInstanceStatusUpdate(e){let t=typeof e.instanceId=="string"?e.instanceId:void 0,s=e.sessionStatuses,a=Array.isArray(s)?s:void 0,o=typeof e.connectionStatus=="string"?e.connectionStatus:void 0;if(!t)return;let r=this.instances_$(),c=r.findIndex(m=>m.instanceId===t);if(!(o===K.connected)&&c>=0){let m=r[c],g=this.assignSlot(t,p.offline,m),w=this.resolveAnimState(p.offline,m.presence);this.instances_$.update(y=>y.map(v=>v.instanceId===t?this.applyPanelCardProjection(A(R({},v),{presence:p.offline,activitySummary:"Gateway disconnected",lastMessage:"",animState:w,previousPresence:m.presence,assignedSlotIndex:g,connectionStatus:o??v.connectionStatus})):v));return}if(c<0){this.loadInstanceData();return}let l=r[c],d=a??[];this.applyMeetingRoomTransitionForSessionDiff({baseInstanceId:t,previousRows:l.rawSessionStatuses,nextRows:d});let f;if(d.length>0){let m=z.pickPrimary(d);m?f={presence:m.presence,activitySummary:m.activitySummary,latestSessionId:m.sessionId,lastMessage:m.lastMessage??""}:f={presence:p.idle,activitySummary:"Connected",latestSessionId:null,lastMessage:""}}else f={presence:p.idle,activitySummary:"Connected",latestSessionId:null,lastMessage:""};let h=this.assignSlot(t,f.presence,l),I=this.resolveAnimState(f.presence,l.presence),S=this.applyPanelCardProjection(A(R({},l),{presence:f.presence,activitySummary:f.activitySummary,latestSessionId:f.latestSessionId,lastMessage:f.lastMessage,animState:I,previousPresence:l.presence,assignedSlotIndex:h,connectionStatus:o??l.connectionStatus,rawSessionStatuses:d}));this.instances_$.update(m=>m.map(g=>g.instanceId===t?S:g))}handleCciInstanceStatusUpdate(e){let t=typeof e.officeInstanceId=="string"?e.officeInstanceId:void 0,s=e.sessionStatuses,a=Array.isArray(s)?s:void 0;if(!t)return;let o=this.instances_$(),r=o.findIndex(I=>I.instanceId===t);if(r<0){this.loadInstanceData();return}let c=o[r],u=a??[];this.applyMeetingRoomTransitionForSessionDiff({baseInstanceId:t,previousRows:c.rawSessionStatuses,nextRows:u});let l=this.resolveSessionInfoFromCciStatuses(u),d=this.assignSlot(t,l.presence,c),f=this.resolveAnimState(l.presence,c.presence),h=this.applyPanelCardProjection(A(R({},c),{presence:l.presence,activitySummary:l.activitySummary,currentRunFlowPhase:l.currentRunFlowPhase,latestSessionId:l.latestSessionId,lastMessage:l.lastMessage,animState:f,previousPresence:c.presence,assignedSlotIndex:d,rawSessionStatuses:u}));this.instances_$.update(I=>I.map(S=>S.instanceId===t?h:S))}handleCaiInstanceStatusUpdate(e){let t=typeof e.officeInstanceId=="string"?e.officeInstanceId:void 0,s=e.sessionStatuses,a=Array.isArray(s)?s:void 0;if(!t)return;let o=this.instances_$(),r=o.findIndex(I=>I.instanceId===t);if(r<0){this.loadInstanceData();return}let c=o[r],u=a??[];this.applyMeetingRoomTransitionForSessionDiff({baseInstanceId:t,previousRows:c.rawSessionStatuses,nextRows:u});let l=this.resolveSessionInfoFromCaiStatuses(u),d=this.assignSlot(t,l.presence,c),f=this.resolveAnimState(l.presence,c.presence),h=this.applyPanelCardProjection(A(R({},c),{presence:l.presence,activitySummary:l.activitySummary,currentRunFlowPhase:l.currentRunFlowPhase,latestSessionId:l.latestSessionId,lastMessage:l.lastMessage,animState:f,previousPresence:c.presence,assignedSlotIndex:d,rawSessionStatuses:u}));this.instances_$.update(I=>I.map(S=>S.instanceId===t?h:S))}resolveSessionInfoFromCciStatuses(e){if(e.length===0)return{presence:p.idle,activitySummary:"No CC Session activity",currentRunFlowPhase:null,latestSessionId:null,lastMessage:""};let s=W.pickCciPrimary(e)??e[0];return{presence:s.presence,activitySummary:s.activitySummary,currentRunFlowPhase:s.currentCcSessionStatus??null,latestSessionId:s.sessionId,lastMessage:s.lastMessage??""}}resolveSessionInfoFromCaiStatuses(e){if(e.length===0)return{presence:p.idle,activitySummary:"No CA Session activity",currentRunFlowPhase:null,latestSessionId:null,lastMessage:""};let s=W.pickCaiPrimary(e)??e[0];return{presence:s.presence,activitySummary:s.activitySummary,currentRunFlowPhase:s.currentCaSessionStatus??null,latestSessionId:s.sessionId,lastMessage:s.lastMessage??""}}schedulePatch(e,t){let s=this.patchTimerMap.get(e);s!==void 0&&clearTimeout(s);let a=setTimeout(()=>{this.patchTimerMap.delete(e);let d=t,{displayName:o}=d,r=Se(d,["displayName"]),c=this.instances_$().find(f=>f.instanceId===e),u=F.parseCcapId(e),l=U.parseCcapId(e);u!==null?this.caiInstanceData_AS.patchByCcapId({ccapId:u,name:o||void 0,darkOfficeVisuals:r}):l!==null?this.cciInstanceData_AS.patchByCcapId({ccapId:l,name:o||void 0,darkOfficeVisuals:r}):c?.characterType===C.openclaw?this.ociInstanceData_AS.patchVisuals({instanceId:e,label:o||void 0,darkOfficeVisuals:r}):this.instanceData_AS.patchByCcapId({ccapId:e,name:o||void 0,darkOfficeVisuals:r})},300);this.patchTimerMap.set(e,a)}assignSlot(e,t,s){let a=t===p.working,o=a?this.workstationSlotMap:this.restSlotMap,r=a?this.darkOfficeLayout_DS.workstationCapacity_$():this.darkOfficeLayout_DS.restCapacity_$();if(o.has(e))return o.get(e);this.workstationSlotMap.delete(e),this.restSlotMap.delete(e);let c=new Set(o.values());for(let l=0;l<r;l++)if(!c.has(l))return o.set(e,l),l;let u=r;for(;c.has(u);)u++;return o.set(e,u),u}resolveAnimState(e,t){return t===p.offline&&e!==p.offline?M.walkingIn:t!==null&&t!==p.offline&&e===p.offline?M.walkingOut:t!==null&&t!==p.offline&&e!==p.offline&&t!==e?M.walkingBetween:e===p.working?M.working:e===p.idle?M.sitting:M.standing}assignDistinctSlotsForScene(e){let t=0,s=0,a=0;return e.map(o=>{let r;return o.scenePlacement===O.meeting?r=a++:o.presence===p.working?r=t++:r=s++,A(R({},o),{assignedSlotIndex:r})})}expandInstancesToCharacters(e){let t=[],s=Date.now(),a=Q.sceneRecentActivityWindowMs,o=Q.sceneIdleWalkActivityWindowMs,r=new Map;for(let c of e)c.characterType===C.ccap&&r.set(c.instanceId,c.presence);for(let c of e){if(c.presence===p.offline)continue;if(c.characterType===C.ccSession||c.characterType===C.caSession){let l=c.characterType===C.ccSession?U.parseCcapId(c.instanceId):F.parseCcapId(c.instanceId),d=l?r.get(l):void 0;if(d===void 0||d===p.offline)continue}t.push(this.buildInstanceBaselineCharacter(c));let u=c.rawSessionStatuses??[];for(let l of u){if(Q.isWorkingSessionRecentAndOnline({row:l,nowMs:s,windowMs:a})){t.push(this.buildPerSessionOfficeCharacter(c,l));continue}Q.isSessionInIdleWalkWindow({row:l,nowMs:s,recentWindowMs:a,idleWalkWindowMs:o})&&t.push(this.buildIdleWalkSessionCharacter(c,l))}}return t}buildIdleWalkSessionCharacter(e,t){let s=`${e.instanceId}::${t.sessionId}`;return this.applyPanelCardProjection(A(R({},e),{instanceId:s,sessionId:t.sessionId,sessionName:t.sessionName??"",presence:p.idle,activitySummary:t.activitySummary,lastMessage:t.lastMessage??"",latestSessionId:t.sessionId,currentRunFlowPhase:i.resolveSessionRunFlowPhaseLabel(t),assignedSlotIndex:0,animState:M.idleWalking,previousPresence:null,scenePlacement:void 0,rawSessionStatuses:void 0,lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]}))}buildInstanceBaselineCharacter(e){return this.applyPanelCardProjection(A(R({},e),{instanceId:e.instanceId,sessionId:void 0,sessionName:"",presence:p.idle,activitySummary:e.activitySummary,lastMessage:"",latestSessionId:null,currentRunFlowPhase:null,assignedSlotIndex:0,animState:M.sitting,previousPresence:null,scenePlacement:void 0,rawSessionStatuses:e.rawSessionStatuses,lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]}))}buildPerSessionOfficeCharacter(e,t){let s=`${e.instanceId}::${t.sessionId}`,o=(t.presence===p.working?void 0:this.resolveScenePlacementForSessionKey({baseInstanceId:e.instanceId,sessionId:t.sessionId}))===O.meeting?O.meeting:void 0;return this.applyPanelCardProjection(A(R({},e),{instanceId:s,sessionId:t.sessionId,sessionName:t.sessionName??"",presence:t.presence,activitySummary:t.activitySummary,lastMessage:t.lastMessage??"",latestSessionId:t.sessionId,currentRunFlowPhase:i.resolveSessionRunFlowPhaseLabel(t),assignedSlotIndex:0,animState:t.presence===p.working?M.working:M.sitting,previousPresence:null,scenePlacement:o,rawSessionStatuses:void 0,lastMessageDerivedStatusLabel:"",panelActiveSessionRows:[]}))}static resolveSessionRunFlowPhaseLabel(e){return"activeRunPhase"in e?e.activeRunPhase??null:"currentCcSessionStatus"in e?e.currentCcSessionStatus??null:"currentCaSessionStatus"in e?e.currentCaSessionStatus??null:null}static \u0275fac=function(t){return new(t||i)};static \u0275prov=Z({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{M as a,O as b,C as c,K as d,X as e,Y as f,j as g,it as h,ot as i,at as j,rt as k,ct as l,F as m,U as n,Q as o,ke as p,ys as q};
2
+ //# sourceMappingURL=chunk-LMJG2I62.js.map
@@ -1,4 +1,4 @@
1
- import{a as G}from"./chunk-PWGYG7KG.js";import{a as K}from"./chunk-JDBS6ZXD.js";import{e as F}from"./chunk-M4CGCNOB.js";import{h as f,j as U}from"./chunk-TKAV5X35.js";import{I as D,p as H}from"./chunk-VRI47IVY.js";import{C as _,R as L,a as w,aa as p,b as $,d as k,h as O,k as h,p as d,vb as g,xb as P,y as M}from"./chunk-TBMJSIBB.js";var C=O(H());var I=(()=>{class l{static GATEWAY_CHAT_MESSAGE_TIMESTAMP_FIELD_NAMES=["timestamp","createdAt","updatedAt","ts","time","sentAt","messageTimestamp","created_at","updated_at","lastMessageAt","last_message_at","startedAt","started_at","lastActivityAt","last_activity_at"];static GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES=["lastActivityAt","updatedAt","lastMessageAt","updated_at","last_activity_at","last_message_at","startedAt","started_at","createdAt","created_at"];static GATEWAY_SESSION_STARTED_FIELD_NAMES=["startedAt","started_at","createdAt","created_at"];static GATEWAY_OUTPUT_ONLY_TIMESTAMP_FIELD_NAMES=["lastMessageAt","last_message_at","lastOutputAt","last_output_at"];static extractTimestamp(t,s){for(let e of s){let n=t[e];if(typeof n=="string"&&n)return n;if(typeof n=="number"&&n>0){let o=n<1e12?n*1e3:n;return new Date(o).toISOString()}}}}return l})();var E=class l{static buildGatewaySessionsFetch(y){let t=y.response._firstSessionKeys,s=Array.isArray(t)?t:[],e=Array.isArray(y.response.sessions)?y.response.sessions:[],n=e.map(i=>l.mapRawSessionToListItem({raw:i,gatewayUrl:y.response.gatewayUrl}));return{listItems:l.sortListItemsByLastActivityDesc({items:n}),rawSessions:e,gatewayUrl:y.response.gatewayUrl,source:y.response.source,instanceId:y.response.instanceId,firstSessionKeys:s}}static mapRawSessionToListItem(y){let t=y.raw;return{sessionId:typeof t.key=="string"?t.key:typeof t.sessionId=="string"?t.sessionId:typeof t.id=="string"?t.id:String(t.key??t.sessionId??t.id??""),label:typeof t.label=="string"?t.label:typeof t.name=="string"?t.name:typeof t.title=="string"?t.title:void 0,workspacePath:typeof t.workspacePath=="string"?t.workspacePath:typeof t.cwd=="string"?t.cwd:"",status:typeof t.status=="string"?t.status:"unknown",statusMessage:typeof t.statusMessage=="string"?t.statusMessage:void 0,gatewayUrl:y.gatewayUrl,openclawAgentName:typeof t.agentName=="string"?t.agentName:typeof t.agent=="string"?t.agent:void 0,promptCount:typeof t.promptCount=="number"?t.promptCount:typeof t.messageCount=="number"?t.messageCount:0,toolCallCount:typeof t.toolCallCount=="number"?t.toolCallCount:0,lastActivityAt:I.extractTimestamp(t,I.GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES),startedAt:I.extractTimestamp(t,I.GATEWAY_SESSION_STARTED_FIELD_NAMES),lastPrompt:typeof t.lastPrompt=="string"?t.lastPrompt:void 0,mode:typeof t.mode=="string"?t.mode:void 0,reasoningEffort:typeof t.reasoningEffort=="string"?t.reasoningEffort:typeof t.thinking=="string"?t.thinking:void 0,isArchived:typeof t.isArchived=="boolean"?t.isArchived:!1}}static sortListItemsByLastActivityDesc(y){return[...y.items].sort((t,s)=>{let e=t.lastActivityAt?new Date(t.lastActivityAt).getTime():0;return(s.lastActivityAt?new Date(s.lastActivityAt).getTime():0)-e})}};var N=(()=>{class l{baseUrl=`${D.api.baseUrl}/oc-session`;http=_(P);peiContext_DS=_(K);withCcapId(t){let s=this.peiContext_DS.activeCcapId_$();return s?t.set("ccapId",s):t}createSession(t){let s=this.withCcapId(new g);return d(this.http.post(this.baseUrl,t,{params:s}))}listSessions(t){let s=this.withCcapId(new g);return t?.status&&(s=s.set("status",t.status)),t?.workspacePath&&(s=s.set("workspacePath",t.workspacePath)),t?.gatewayUrl&&(s=s.set("gatewayUrl",t.gatewayUrl)),t?.includeArchived&&(s=s.set("includeArchived","1")),t?.limit!=null&&(s=s.set("limit",String(t.limit))),t?.offset!=null&&(s=s.set("offset",String(t.offset))),d(this.http.get(this.baseUrl,{params:s}))}listGatewaySessions(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.get(`${this.baseUrl}/gateway-sessions`,{params:s}))}getGatewaySessionHistory(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.get(`${this.baseUrl}/gateway-sessions/${t.sessionId}/history`,{params:s}))}sendGatewayPrompt(t){return d(this.http.post(`${this.baseUrl}/gateway-sessions/${t.sessionId}/send`,{instanceId:t.instanceId,content:t.content,agentName:t.agentName}))}abortGatewaySession(t){return d(this.http.post(`${this.baseUrl}/gateway-sessions/${t.sessionId}/abort`,{instanceId:t.instanceId}))}deleteGatewaySession(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.delete(`${this.baseUrl}/gateway-sessions/${t.sessionId}`,{params:s}))}getSession(t){let s=this.withCcapId(new g);return d(this.http.get(`${this.baseUrl}/${t.sessionId}`,{params:s}))}sendPrompt(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/prompt`,{content:t.content},{params:s}))}reconnectSession(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/reconnect`,{},{params:s}))}stopExecution(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/stop-execution`,{},{params:s}))}terminateSession(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/terminate`,{},{params:s}))}updateSessionConfig(t){let o=t,{sessionId:s}=o,e=k(o,["sessionId"]),n=this.withCcapId(new g);return d(this.http.patch(`${this.baseUrl}/${s}/config`,e,{params:n}))}setSessionArchived(t){let s=this.withCcapId(new g);return d(this.http.patch(`${this.baseUrl}/${t.sessionId}/archive`,{isArchived:t.isArchived},{params:s}))}getSessionEvents(t){let s=this.withCcapId(new g);return t.eventType&&(s=s.set("eventType",t.eventType)),t.since&&(s=s.set("since",t.since)),t.sinceSequence!=null&&(s=s.set("sinceSequence",String(t.sinceSequence))),t.limit!=null&&(s=s.set("limit",String(t.limit))),t.offset!=null&&(s=s.set("offset",String(t.offset))),t.latest&&(s=s.set("latest","1")),d(this.http.get(`${this.baseUrl}/${t.sessionId}/events`,{params:s}))}getSessionEventStreamUrl(t){let s=`${this.baseUrl}/${t.sessionId}/events/stream`,e=this.peiContext_DS.activeCcapId_$();return e?`${s}?ccapId=${encodeURIComponent(e)}`:s}static \u0275fac=function(s){return new(s||l)};static \u0275prov=M({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();var lt=(()=>{class l{sessions_$=p([]);sessionsLoading_$=p(!1);sessionsLoadError_$=p(null);selectedSession_$=p(null);selectedSessionLoading_$=p(!1);selectedSessionEvents_$=p([]);consoleMessages_$=p([]);assembledMessages_$=p([]);lastStatusUpdate_$=p(null);sessionUsage_$=p({inputTokens:0,outputTokens:0,costUsd:0});activeSessionId_$=p("");activeInstanceId_$=p("");gatewayFilter_$=p(null);extSessionMsg_AS=_(G);ocSession_AS=_(N);globalError_CS=_(U);socket_CS=_(F);ngZone=_(L);eventSubscription=null;reconnectSubscription=null;lastKnownEventSequence=-1;chatPollHandle=null;detailPollHandle=null;lastPolledHistoryFingerprint="";constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(t=>{this.handleSocketEvent(t)}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(t=>{if(t){let s=this.activeSessionId_$();s&&(this.socket_CS.emit("oc-session:subscribe",{sessionId:s}),this.loadAssembledMessages({sessionId:s}).catch(()=>{})),this.backfillMissedEvents()}})}ngOnDestroy(){this.stopChatPolling(),this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null),this.reconnectSubscription&&(this.reconnectSubscription.unsubscribe(),this.reconnectSubscription=null)}setGatewayFilter(t){this.gatewayFilter_$.set(t),this.loadSessions().catch(()=>{})}setGatewayFilterOnly(t){this.gatewayFilter_$.set(t)}loadSessions(t){return h(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let e=[...(yield this.ocSession_AS.listSessions({status:t?.status,workspacePath:t?.workspacePath,gatewayUrl:this.gatewayFilter_$()??void 0,includeArchived:t?.includeArchived})).sessions].sort((n,o)=>{let i=n.lastActivityAt?new Date(n.lastActivityAt).getTime():0;return(o.lastActivityAt?new Date(o.lastActivityAt).getTime():0)-i});this.sessions_$.set(e)}catch(s){this.sessionsLoadError_$.set(s),this.pushConsoleMessage({type:"error",text:`Load sessions failed: ${f.getErrorMessageForDisplay(s)}`})}finally{this.sessionsLoading_$.set(!1)}})}fetchGatewaySessionsForInstance(t){return h(this,null,function*(){let s=yield this.ocSession_AS.listGatewaySessions({instanceId:t.instanceId});return E.buildGatewaySessionsFetch({response:s})})}loadGatewaySessions(t){return h(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let s=yield this.fetchGatewaySessionsForInstance({instanceId:t.instanceId});!s.listItems.length&&s.rawSessions.length>0&&this.pushConsoleMessage({type:"error",text:`Gateway returned ${s.rawSessions.length} sessions but mapping produced 0.
1
+ import{a as G}from"./chunk-QDFXDY3C.js";import{a as K}from"./chunk-3JHGYF3K.js";import{e as F}from"./chunk-5LANXE75.js";import{h as f,j as U}from"./chunk-MMQ57B6R.js";import{I as D,p as H}from"./chunk-762K6QXC.js";import{C as _,R as L,a as w,aa as p,b as $,d as k,h as O,k as h,p as d,vb as g,xb as P,y as M}from"./chunk-TBMJSIBB.js";var C=O(H());var I=(()=>{class l{static GATEWAY_CHAT_MESSAGE_TIMESTAMP_FIELD_NAMES=["timestamp","createdAt","updatedAt","ts","time","sentAt","messageTimestamp","created_at","updated_at","lastMessageAt","last_message_at","startedAt","started_at","lastActivityAt","last_activity_at"];static GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES=["lastActivityAt","updatedAt","lastMessageAt","updated_at","last_activity_at","last_message_at","startedAt","started_at","createdAt","created_at"];static GATEWAY_SESSION_STARTED_FIELD_NAMES=["startedAt","started_at","createdAt","created_at"];static GATEWAY_OUTPUT_ONLY_TIMESTAMP_FIELD_NAMES=["lastMessageAt","last_message_at","lastOutputAt","last_output_at"];static extractTimestamp(t,s){for(let e of s){let n=t[e];if(typeof n=="string"&&n)return n;if(typeof n=="number"&&n>0){let o=n<1e12?n*1e3:n;return new Date(o).toISOString()}}}}return l})();var E=class l{static buildGatewaySessionsFetch(y){let t=y.response._firstSessionKeys,s=Array.isArray(t)?t:[],e=Array.isArray(y.response.sessions)?y.response.sessions:[],n=e.map(i=>l.mapRawSessionToListItem({raw:i,gatewayUrl:y.response.gatewayUrl}));return{listItems:l.sortListItemsByLastActivityDesc({items:n}),rawSessions:e,gatewayUrl:y.response.gatewayUrl,source:y.response.source,instanceId:y.response.instanceId,firstSessionKeys:s}}static mapRawSessionToListItem(y){let t=y.raw;return{sessionId:typeof t.key=="string"?t.key:typeof t.sessionId=="string"?t.sessionId:typeof t.id=="string"?t.id:String(t.key??t.sessionId??t.id??""),label:typeof t.label=="string"?t.label:typeof t.name=="string"?t.name:typeof t.title=="string"?t.title:void 0,workspacePath:typeof t.workspacePath=="string"?t.workspacePath:typeof t.cwd=="string"?t.cwd:"",status:typeof t.status=="string"?t.status:"unknown",statusMessage:typeof t.statusMessage=="string"?t.statusMessage:void 0,gatewayUrl:y.gatewayUrl,openclawAgentName:typeof t.agentName=="string"?t.agentName:typeof t.agent=="string"?t.agent:void 0,promptCount:typeof t.promptCount=="number"?t.promptCount:typeof t.messageCount=="number"?t.messageCount:0,toolCallCount:typeof t.toolCallCount=="number"?t.toolCallCount:0,lastActivityAt:I.extractTimestamp(t,I.GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES),startedAt:I.extractTimestamp(t,I.GATEWAY_SESSION_STARTED_FIELD_NAMES),lastPrompt:typeof t.lastPrompt=="string"?t.lastPrompt:void 0,mode:typeof t.mode=="string"?t.mode:void 0,reasoningEffort:typeof t.reasoningEffort=="string"?t.reasoningEffort:typeof t.thinking=="string"?t.thinking:void 0,isArchived:typeof t.isArchived=="boolean"?t.isArchived:!1}}static sortListItemsByLastActivityDesc(y){return[...y.items].sort((t,s)=>{let e=t.lastActivityAt?new Date(t.lastActivityAt).getTime():0;return(s.lastActivityAt?new Date(s.lastActivityAt).getTime():0)-e})}};var N=(()=>{class l{baseUrl=`${D.api.baseUrl}/oc-session`;http=_(P);peiContext_DS=_(K);withCcapId(t){let s=this.peiContext_DS.activeCcapId_$();return s?t.set("ccapId",s):t}createSession(t){let s=this.withCcapId(new g);return d(this.http.post(this.baseUrl,t,{params:s}))}listSessions(t){let s=this.withCcapId(new g);return t?.status&&(s=s.set("status",t.status)),t?.workspacePath&&(s=s.set("workspacePath",t.workspacePath)),t?.gatewayUrl&&(s=s.set("gatewayUrl",t.gatewayUrl)),t?.includeArchived&&(s=s.set("includeArchived","1")),t?.limit!=null&&(s=s.set("limit",String(t.limit))),t?.offset!=null&&(s=s.set("offset",String(t.offset))),d(this.http.get(this.baseUrl,{params:s}))}listGatewaySessions(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.get(`${this.baseUrl}/gateway-sessions`,{params:s}))}getGatewaySessionHistory(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.get(`${this.baseUrl}/gateway-sessions/${t.sessionId}/history`,{params:s}))}sendGatewayPrompt(t){return d(this.http.post(`${this.baseUrl}/gateway-sessions/${t.sessionId}/send`,{instanceId:t.instanceId,content:t.content,agentName:t.agentName}))}abortGatewaySession(t){return d(this.http.post(`${this.baseUrl}/gateway-sessions/${t.sessionId}/abort`,{instanceId:t.instanceId}))}deleteGatewaySession(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.delete(`${this.baseUrl}/gateway-sessions/${t.sessionId}`,{params:s}))}getSession(t){let s=this.withCcapId(new g);return d(this.http.get(`${this.baseUrl}/${t.sessionId}`,{params:s}))}sendPrompt(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/prompt`,{content:t.content},{params:s}))}reconnectSession(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/reconnect`,{},{params:s}))}stopExecution(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/stop-execution`,{},{params:s}))}terminateSession(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/terminate`,{},{params:s}))}updateSessionConfig(t){let o=t,{sessionId:s}=o,e=k(o,["sessionId"]),n=this.withCcapId(new g);return d(this.http.patch(`${this.baseUrl}/${s}/config`,e,{params:n}))}setSessionArchived(t){let s=this.withCcapId(new g);return d(this.http.patch(`${this.baseUrl}/${t.sessionId}/archive`,{isArchived:t.isArchived},{params:s}))}getSessionEvents(t){let s=this.withCcapId(new g);return t.eventType&&(s=s.set("eventType",t.eventType)),t.since&&(s=s.set("since",t.since)),t.sinceSequence!=null&&(s=s.set("sinceSequence",String(t.sinceSequence))),t.limit!=null&&(s=s.set("limit",String(t.limit))),t.offset!=null&&(s=s.set("offset",String(t.offset))),t.latest&&(s=s.set("latest","1")),d(this.http.get(`${this.baseUrl}/${t.sessionId}/events`,{params:s}))}getSessionEventStreamUrl(t){let s=`${this.baseUrl}/${t.sessionId}/events/stream`,e=this.peiContext_DS.activeCcapId_$();return e?`${s}?ccapId=${encodeURIComponent(e)}`:s}static \u0275fac=function(s){return new(s||l)};static \u0275prov=M({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();var lt=(()=>{class l{sessions_$=p([]);sessionsLoading_$=p(!1);sessionsLoadError_$=p(null);selectedSession_$=p(null);selectedSessionLoading_$=p(!1);selectedSessionEvents_$=p([]);consoleMessages_$=p([]);assembledMessages_$=p([]);lastStatusUpdate_$=p(null);sessionUsage_$=p({inputTokens:0,outputTokens:0,costUsd:0});activeSessionId_$=p("");activeInstanceId_$=p("");gatewayFilter_$=p(null);extSessionMsg_AS=_(G);ocSession_AS=_(N);globalError_CS=_(U);socket_CS=_(F);ngZone=_(L);eventSubscription=null;reconnectSubscription=null;lastKnownEventSequence=-1;chatPollHandle=null;detailPollHandle=null;lastPolledHistoryFingerprint="";constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(t=>{this.handleSocketEvent(t)}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(t=>{if(t){let s=this.activeSessionId_$();s&&(this.socket_CS.emit("oc-session:subscribe",{sessionId:s}),this.loadAssembledMessages({sessionId:s}).catch(()=>{})),this.backfillMissedEvents()}})}ngOnDestroy(){this.stopChatPolling(),this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null),this.reconnectSubscription&&(this.reconnectSubscription.unsubscribe(),this.reconnectSubscription=null)}setGatewayFilter(t){this.gatewayFilter_$.set(t),this.loadSessions().catch(()=>{})}setGatewayFilterOnly(t){this.gatewayFilter_$.set(t)}loadSessions(t){return h(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let e=[...(yield this.ocSession_AS.listSessions({status:t?.status,workspacePath:t?.workspacePath,gatewayUrl:this.gatewayFilter_$()??void 0,includeArchived:t?.includeArchived})).sessions].sort((n,o)=>{let i=n.lastActivityAt?new Date(n.lastActivityAt).getTime():0;return(o.lastActivityAt?new Date(o.lastActivityAt).getTime():0)-i});this.sessions_$.set(e)}catch(s){this.sessionsLoadError_$.set(s),this.pushConsoleMessage({type:"error",text:`Load sessions failed: ${f.getErrorMessageForDisplay(s)}`})}finally{this.sessionsLoading_$.set(!1)}})}fetchGatewaySessionsForInstance(t){return h(this,null,function*(){let s=yield this.ocSession_AS.listGatewaySessions({instanceId:t.instanceId});return E.buildGatewaySessionsFetch({response:s})})}loadGatewaySessions(t){return h(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let s=yield this.fetchGatewaySessionsForInstance({instanceId:t.instanceId});!s.listItems.length&&s.rawSessions.length>0&&this.pushConsoleMessage({type:"error",text:`Gateway returned ${s.rawSessions.length} sessions but mapping produced 0.
2
2
  First session keys: ${s.firstSessionKeys.join(", ")}`}),this.sessions_$.set(s.listItems)}catch(s){this.sessionsLoadError_$.set(s),this.pushConsoleMessage({type:"error",text:`Load gateway sessions failed: ${f.getErrorMessageForDisplay(s)}`})}finally{this.sessionsLoading_$.set(!1)}})}loadSessionDetail(t){return h(this,null,function*(){let s=t.isSilent===!0;s||this.selectedSessionLoading_$.set(!0);try{let e=yield this.ocSession_AS.getSession({sessionId:t.sessionId});this.selectedSession_$.set(e),this.loadAssembledMessages({sessionId:t.sessionId}).catch(()=>{})}catch(e){if(!s){this.selectedSession_$.set(null);let n=e instanceof Error?e.message:"Failed to load session details";this.pushConsoleMessage({type:"error",text:`Load session failed: ${n}`})}}finally{s||this.selectedSessionLoading_$.set(!1)}})}loadGatewaySessionHistory(t){return h(this,null,function*(){this.selectedSessionLoading_$.set(!0),this.consoleMessages_$.set([]);try{let s=yield this.ocSession_AS.getGatewaySessionHistory({sessionId:t.sessionId,instanceId:t.instanceId}),e=s,n=Array.isArray(e._rawKeys)?e._rawKeys:[],o=Array.isArray(s.history)?s.history:[],i=this.parseGatewayHistory(o),a=typeof e.messageCount=="number"?e.messageCount:0,r=Array.isArray(e._firstMessageKeys)?e._firstMessageKeys:[];i.length?this.consoleMessages_$.set(i):a>0?this.consoleMessages_$.set([{listKey:this.allocateConsoleListKey(),type:"error",text:`Gateway session has ${a} messages, but mapping failed.
3
3
  Message keys: ${r.join(", ")||"unknown"}
4
4
  Gateway response keys: ${n.join(", ")||"none"}`,timestamp:new Date().toISOString()}]):this.consoleMessages_$.set([{listKey:this.allocateConsoleListKey(),type:"info",text:"Gateway session loaded \u2014 session has no messages yet.",timestamp:new Date().toISOString()}]),this.selectedSession_$.set({session:{sessionId:t.sessionId,workspacePath:"",status:"unknown",promptCount:0,toolCallCount:0,isArchived:!1},runtime:{isLive:!1,runtimeStatus:null,outputBufferLength:0}}),this.lastPolledHistoryFingerprint=this.computeGatewayHistoryFingerprint(o),this.startChatPolling()}catch(s){this.selectedSession_$.set(null),this.pushConsoleMessage({type:"error",text:`Load gateway session history failed: ${f.getErrorMessageForDisplay(s)}`})}finally{this.selectedSessionLoading_$.set(!1)}})}loadSessionEvents(t){return h(this,null,function*(){try{let s=yield this.ocSession_AS.getSessionEvents({sessionId:t.sessionId,eventType:t.eventType,limit:t.limit??500,latest:!0});this.selectedSessionEvents_$.set(s.events),this.updateLastKnownSequence(s.events);for(let e of s.events)this.pushConsoleMessageFromEvent(e)}catch(s){this.selectedSessionEvents_$.set([]),this.pushConsoleMessage({type:"error",text:`Load events failed: ${f.getErrorMessageForDisplay(s)}`})}})}createSession(t){return h(this,null,function*(){try{let s=yield this.ocSession_AS.createSession(t),e=String(s.session.sessionId||"");return yield this.loadSessions(),e}catch(s){throw this.pushConsoleMessage({type:"error",text:`Create session failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}sendPrompt(t){return h(this,null,function*(){this.pushConsoleMessage({type:"prompt",text:t.content});try{let s=this.activeInstanceId_$();s?yield this.ocSession_AS.sendGatewayPrompt({sessionId:t.sessionId,instanceId:s,content:t.content}):yield this.ocSession_AS.sendPrompt(t)}catch(s){throw this.pushConsoleMessage({type:"error",text:`Send failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}reconnectSession(t){return h(this,null,function*(){try{yield this.ocSession_AS.reconnectSession(t),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Reconnect failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}stopExecution(t){return h(this,null,function*(){try{yield this.ocSession_AS.stopExecution(t)}catch(s){throw this.pushConsoleMessage({type:"error",text:`Stop execution failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}terminateSession(t){return h(this,null,function*(){try{yield this.ocSession_AS.terminateSession(t),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Terminate failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}setSessionArchived(t){return h(this,null,function*(){try{yield this.ocSession_AS.setSessionArchived(t),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Archive failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}updateSessionConfig(t){return h(this,null,function*(){try{yield this.ocSession_AS.updateSessionConfig(t);let s=this.selectedSession_$();if(s?.session.sessionId===t.sessionId){let e=w({},s.session);t.mode!=null&&(e.mode=t.mode),t.reasoningEffort!=null&&(e.reasoningEffort=t.reasoningEffort),t.openclawAgentName!=null&&(e.openclawAgentName=t.openclawAgentName),this.selectedSession_$.set($(w({},s),{session:e}))}}catch(s){throw this.pushConsoleMessage({type:"error",text:`Config update failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}setActiveSessionId(t){let s=this.activeSessionId_$();s&&s!==t&&this.socket_CS.emit("oc-session:unsubscribe",{sessionId:s}),this.activeSessionId_$.set(t),t&&this.socket_CS.emit("oc-session:subscribe",{sessionId:t})}clearLiveOutput(){this.stopChatPolling(),this.consoleMessages_$.set([]),this.sessionUsage_$.set({inputTokens:0,outputTokens:0,costUsd:0}),this.lastKnownEventSequence=-1}allocateConsoleListKey(){return globalThis.crypto.randomUUID()}pushConsoleMessage(t){let s=t.type==="assistant"||t.type==="prompt"?t.text.trim():t.text,e={listKey:t.listKey??this.allocateConsoleListKey(),type:t.type,text:s,timestamp:t.timestamp??new Date().toISOString(),expandableContent:t.expandableContent,rawData:t.rawData},n=this.consoleMessages_$();this.consoleMessages_$.set([...n,e])}static CHAT_POLL_INTERVAL_MS=5*C.second;static DETAIL_POLL_INTERVAL_MS=10*C.second;startChatPolling(){this.stopChatPolling(),this.chatPollHandle=setInterval(()=>{this.pollChatHistory()},l.CHAT_POLL_INTERVAL_MS),this.detailPollHandle=setInterval(()=>{let t=this.activeSessionId_$();t&&this.loadSessionDetail({sessionId:t,isSilent:!0})},l.DETAIL_POLL_INTERVAL_MS)}stopChatPolling(){this.chatPollHandle&&(clearInterval(this.chatPollHandle),this.chatPollHandle=null),this.detailPollHandle&&(clearInterval(this.detailPollHandle),this.detailPollHandle=null),this.lastPolledHistoryFingerprint=""}computeGatewayHistoryFingerprint(t){let s=t.length;if(!s)return"0";let e=t[s-1],n=typeof e.id=="string"?e.id:typeof e.messageId=="string"?e.messageId:"",o=l.extractGatewayChatMessageTimestamp(e),i=this.extractTextFromMessage(e),a=400,r=i.length>a?i.slice(0,a):i;return`${s}${n}${o}${r}`}pollChatHistory(){return h(this,null,function*(){let t=this.activeSessionId_$(),s=this.activeInstanceId_$();if(!(!t||!s))try{let e=yield this.ocSession_AS.getGatewaySessionHistory({sessionId:t,instanceId:s}),n=Array.isArray(e.history)?e.history:[],o=this.computeGatewayHistoryFingerprint(n);if(o===this.lastPolledHistoryFingerprint)return;this.lastPolledHistoryFingerprint=o;let i=this.parseGatewayHistory(n);this.ngZone.run(()=>{this.consoleMessages_$.set(i)})}catch{}})}parseGatewayHistory(t){let s=[],e=new Map,n=[];for(let i of t){let a=i.content;if(Array.isArray(a))for(let r of a){let u=typeof r.type=="string"?r.type:"";if(u==="tool_use"||u==="toolCall"){let S=typeof r.id=="string"?r.id:"";S&&n.push(S)}if(u==="tool_result"){let S=typeof r.tool_use_id=="string"?r.tool_use_id:"";S&&e.set(S,this.extractTextFromContentBlock(r))}}}let o=0;for(let i of t){let a=typeof i.role=="string"?i.role:"";if(a==="toolResult"||a==="tool_result"){let r=this.extractTextFromMessage(i);o<n.length&&(e.set(n[o],r),o++)}}for(let i of t){let a=typeof i.role=="string"?i.role:"unknown",r=i.content,u=l.extractGatewayChatMessageTimestamp(i);if(a==="toolResult"||a==="tool_result")continue;if(typeof r=="string"){s.push({listKey:this.allocateConsoleListKey(),type:a==="user"||a==="human"?"prompt":a==="assistant"?"assistant":"info",text:r,timestamp:u,rawData:i});continue}if(Array.isArray(r)){for(let c of r){let v=typeof c.type=="string"?c.type:"";if(v==="text")s.push({listKey:this.allocateConsoleListKey(),type:a==="user"||a==="human"?"prompt":"assistant",text:typeof c.text=="string"?c.text:"",timestamp:u,rawData:{_block:c,_message:{role:a,timestamp:u,contentBlockCount:r.length}}});else if(v==="tool_use"||v==="toolCall"){let b=typeof c.name=="string"?c.name:"unknown tool",T=typeof c.id=="string"?c.id:"",m=c.input??c.arguments,A=e.get(T);s.push({listKey:this.allocateConsoleListKey(),type:"tool",text:`${b}
@@ -6,4 +6,4 @@ ${JSON.stringify(m,null,2)}`,timestamp:u,expandableContent:A,rawData:{_block:c,_
6
6
  `):A=JSON.stringify(c,null,2),s.push({listKey:this.allocateConsoleListKey(),type:"tool-result",text:A,timestamp:u,rawData:{_block:c}})}}else v==="thinking"?s.push({listKey:this.allocateConsoleListKey(),type:"info",text:typeof c.thinking=="string"?c.thinking:JSON.stringify(c,null,2),timestamp:u,rawData:{_block:c}}):s.push({listKey:this.allocateConsoleListKey(),type:"info",text:JSON.stringify(c,null,2),timestamp:u,rawData:{_block:c}})}continue}let S=typeof i.text=="string"?i.text:typeof i.message=="string"?i.message:JSON.stringify(i,null,2);s.push({listKey:this.allocateConsoleListKey(),type:a==="user"||a==="human"?"prompt":a==="assistant"?"assistant":a==="tool"||a==="tool_result"||a==="tool_use"?"tool":"info",text:S,timestamp:u,rawData:i})}return s}backfillMissedEvents(){return h(this,null,function*(){let t=this.activeSessionId_$();if(!(!t||this.lastKnownEventSequence<0))try{let e=(yield this.ocSession_AS.getSessionEvents({sessionId:t,sinceSequence:this.lastKnownEventSequence})).events;if(!e.length)return;this.ngZone.run(()=>{let n=this.selectedSessionEvents_$();this.selectedSessionEvents_$.set([...n,...e]);for(let o of e)this.pushConsoleMessageFromEvent(o);this.updateLastKnownSequence(e)})}catch(s){C.DyFM_Log.warn("CCAP_OcSession_DS | backfill failed",s)}})}updateLastKnownSequence(t){for(let s of t)s.sequence>this.lastKnownEventSequence&&(this.lastKnownEventSequence=s.sequence)}handleSocketEvent(t){let s=t.event,e=t.payload;try{this.ngZone.run(()=>{switch(s){case"oc-session:status":this.handleStatusUpdate(e);break;case"oc-session:output":this.handleOutputChunk(e);break;case"oc-session:event":this.handleSessionEvent(e);break;case"oc-session:list-update":this.handleListUpdate(e);break;case"ext-session-msg:message":this.handleAssembledMessage(e);break;case"ext-session-msg:update":this.handleAssembledMessageUpdate(e);break}})}catch(n){C.DyFM_Log.error(`CCAP_OcSession_DS | socket event error | event: ${s}`,n)}}handleStatusUpdate(t){let s=t.sessionId??"",e=t.status??"",n=t.statusMessage;this.lastStatusUpdate_$.set({sessionId:s,status:e,statusMessage:n});let i=this.sessions_$().map(r=>r.sessionId===s?$(w({},r),{status:e,statusMessage:n}):r);this.sessions_$.set(i);let a=this.selectedSession_$();if(a?.session.sessionId===s){let r=e==="running"||e==="waiting-input";this.selectedSession_$.set($(w({},a),{session:$(w({},a.session),{status:e,statusMessage:n}),runtime:$(w({},a.runtime),{isLive:r,runtimeStatus:e})}))}if(e==="errored"){let r=n?`OC Session error (${s}): ${n}`:`OC Session error (${s}): session entered errored state`;this.globalError_CS.showError(new Error(r),"oc-session-status")}}handleOutputChunk(t){let s=t.sessionId??"";if(s&&s!==this.activeSessionId_$())return;let e=t.content??"",n=t.type??"response";e&&this.pushConsoleMessage({type:n==="error"?"error":"assistant",text:e})}handleSessionEvent(t){let s=t.sessionId??"";if(s&&s!==this.activeSessionId_$())return;let e=t.event??{},n={sessionId:s,eventType:e.eventType??"",timestamp:e.timestamp??"",data:e.data??{},sequence:e.sequence??0};if(n.sequence<=this.lastKnownEventSequence)return;this.lastKnownEventSequence=n.sequence;let o=this.selectedSessionEvents_$();this.selectedSessionEvents_$.set([...o,n]),this.pushConsoleMessageFromEvent(n)}handleListUpdate(t){this.loadSessions().catch(()=>{})}extractTextFromContentBlock(t){let s=t.content;return typeof s=="string"?s:Array.isArray(s)?s.map(e=>typeof e.text=="string"?e.text:JSON.stringify(e,null,2)).join(`
7
7
  `):typeof t.text=="string"?t.text:JSON.stringify(t,null,2)}extractTextFromMessage(t){let s=t.content;return typeof s=="string"?s:Array.isArray(s)?s.map(e=>typeof e.text=="string"?e.text:JSON.stringify(e,null,2)).join(`
8
8
  `):JSON.stringify(t,null,2)}pushConsoleMessageFromEvent(t){let s=t.data;switch(t.eventType){case"response-chunk":{let e=typeof s.content=="string"?s.content:"";e&&this.pushConsoleMessage({type:"assistant",text:e});break}case"response-complete":{let e=s.usage;if(e&&typeof e=="object"){let n=e,o=this.sessionUsage_$();this.sessionUsage_$.set({inputTokens:o.inputTokens+(typeof n.inputTokens=="number"?n.inputTokens:0),outputTokens:o.outputTokens+(typeof n.outputTokens=="number"?n.outputTokens:0),costUsd:o.costUsd+(typeof n.costUsd=="number"?n.costUsd:0)})}break}case"tool-call-start":{let e=typeof s.name=="string"?s.name:"unknown",n=s.input,o=n?this.summarizeToolInput(n):"",i=o?`${e}: ${o}`:e;this.pushConsoleMessage({type:"tool",text:i,rawData:s});break}case"tool-call-end":{let e=s.content??s.output,n=typeof e=="string"?e:JSON.stringify(e??{});this.pushConsoleMessage({type:"tool-result",text:n.length>200?n.substring(0,200)+"\u2026":n,expandableContent:n.length>200?n:void 0,rawData:s});break}case"error":{let e=s.message??s.content;typeof e=="string"&&e&&this.pushConsoleMessage({type:"error",text:e});break}case"connection-change":{let e=typeof s.state=="string"?s.state:"";e&&this.pushConsoleMessage({type:"info",text:`Gateway connection: ${e}`,rawData:s});break}default:break}}summarizeToolInput(t){if(typeof t=="string")return t.length>80?t.substring(0,80)+"\u2026":t;if(typeof t=="object"&&t!==null){let s=JSON.stringify(t);return s.length>80?s.substring(0,80)+"\u2026":s}return""}static extractGatewayChatMessageTimestamp(t){return I.extractTimestamp(t,I.GATEWAY_CHAT_MESSAGE_TIMESTAMP_FIELD_NAMES)??""}loadAssembledMessages(t){return h(this,null,function*(){try{let s=yield this.extSessionMsg_AS.getMessages({sessionId:t.sessionId,latest:!0});this.assembledMessages_$.set(s.messages)}catch(s){C.DyFM_Log.error(`CCAP_OcSession_DS | loadAssembledMessages failed | sessionId: ${t.sessionId}`,s)}})}handleAssembledMessage(t){let s=typeof t.sessionId=="string"?t.sessionId:"";if(!s||s!==this.activeSessionId_$())return;let e=t.message;if(!e||typeof e!="object")return;let n=e,o=this.assembledMessages_$();this.assembledMessages_$.set([...o,n])}handleAssembledMessageUpdate(t){let s=typeof t.sessionId=="string"?t.sessionId:"";if(!s||s!==this.activeSessionId_$())return;let e=typeof t.messageKey=="string"?t.messageKey:"";if(!e)return;let n=t.update;if(!n||typeof n!="object")return;let o=n,i=this.assembledMessages_$(),a=i.findIndex(S=>S.messageKey===e);if(a<0)return;let r=w({},i[a]);typeof o.bodyText=="string"&&(r.bodyText=o.bodyText),o.toolResult!==void 0&&(r.toolResult=o.toolResult),typeof o.toolStatus=="string"&&(r.toolStatus=o.toolStatus),o.headerStatusDot!==void 0&&(r.headerStatusDot=typeof o.headerStatusDot=="string"?o.headerStatusDot:void 0);let u=[...i];u[a]=r,this.assembledMessages_$.set(u)}static \u0275fac=function(s){return new(s||l)};static \u0275prov=M({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();export{I as a,lt as b};
9
- //# sourceMappingURL=chunk-BPWY4SOQ.js.map
9
+ //# sourceMappingURL=chunk-M5NG4Q3Z.js.map
@@ -1,2 +1,2 @@
1
- import{p as o}from"./chunk-VRI47IVY.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-44PQAFEL.js.map
1
+ import{p as o}from"./chunk-762K6QXC.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-MJGLT4C2.js.map
@@ -1,4 +1,4 @@
1
- import{I as _,K as T,N as D,p as U}from"./chunk-VRI47IVY.js";import{C,Gb as H,a as b,aa as I,b as j,h as w,k as L,p as g,q as h,wb as d,xb as M,y as F}from"./chunk-TBMJSIBB.js";var y=[{prefix:"/setup",hint:"Setup \u2014 client/src/app/_modules/config/_modules/setup/"},{prefix:"/settings",hint:"Settings \u2014 client/src/app/_modules/config/_modules/settings/"},{prefix:"/model-registry",hint:"Model registry \u2014 client/src/app/_modules/model-registry/"},{prefix:"/embedding-registry",hint:"Embedding registry \u2014 client/src/app/_modules/ai-systems/_modules/embedding-registry/"},{prefix:"/embedding-eval",hint:"Embedding eval \u2014 client/src/app/_modules/embedding-eval/"},{prefix:"/session",hint:"CCAP Session UI \u2014 client/src/app/_modules/session/"},{prefix:"/errors",hint:"Errors list \u2014 client/src/app/_modules/system/_modules/errors/"},{prefix:"/feedback",hint:"Feedback \u2014 client/src/app/_modules/feedback/"},{prefix:"/logs",hint:"Logs \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/logs/"},{prefix:"/host-runtime-mcp",hint:"Host runtime MCP \u2014 client/src/app/_modules/dev/_modules/host-runtime-mcp/"},{prefix:"/voice-notes-poc",hint:"Voice notes POC \u2014 client/src/app/_modules/dev/_modules/poc/voice-notes-poc/"},{prefix:"/master-control-remote-poc",hint:"Master control remote POC \u2014 client/src/app/_modules/dev/_modules/poc/master-control-remote-poc/"},{prefix:"/workflow-settings",hint:"Workflow settings \u2014 client/src/app/_modules/config/_modules/workflow-settings/"},{prefix:"/coordinator",hint:"Coordinator \u2014 client/src/app/_modules/coordinator/"},{prefix:"/dark-office",hint:"Dark Office \u2014 client/src/app/_modules/dark-office/"},{prefix:"/project-management",hint:"Project management \u2014 client/src/app/_modules/project-management/"},{prefix:"/cc-session",hint:"CC Session UI \u2014 client/src/app/_modules/cc-session/"},{prefix:"/mobile-app",hint:"Mobile app \u2014 client/src/app/_modules/dev/_modules/poc/mobile-app/"},{prefix:"/oc-session",hint:"OC Session \u2014 client/src/app/_modules/oc/"},{prefix:"/ca-session",hint:"CA Session \u2014 client/src/app/_modules/ca-session/"},{prefix:"/consultant",hint:"Consultant \u2014 client/src/app/_modules/consultant/"},{prefix:"/agent-instances",hint:"Agent instances \u2014 client/src/app/_modules/agent-instances/"},{prefix:"/terminals",hint:"Terminals \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/terminals/"},{prefix:"/live-development-pipeline",hint:"Live Development Pipeline \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/live-dev-pipeline/"},{prefix:"/system-status",hint:"Legacy route \u2192 redirects to /live-development-pipeline \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/live-dev-pipeline/"},{prefix:"/",hint:"Dashboard (root) \u2014 client/src/app/_modules/dashboard/"}];var q="NG0203",S=class r{static isNg0203Message(n){return n.trim()===q}static buildDiagnostics(n){let t={route:n.context.route,url:n.context.url,userAgent:n.context.userAgent,timestamp:n.context.timestamp},e=r.parseStackFrames(n.stack),i=typeof n.context.route=="string"?n.context.route:"",o=r.resolveRouteFeatureHints(i),s=r.buildStaticGuidance(),l=r.buildToolSteps({clientSnapshot:t,clientSource:n.clientSource,stackFrames:e,routeFeatureHints:o});return{summary:"Angular NG0203: inject() was called outside an injection context (constructor, field initializer, factory, or runInInjectionContext).",clientSource:n.clientSource,clientSnapshot:t,stackFrames:e,routeFeatureHints:o,staticGuidance:s,toolSteps:l}}static formatDiagnosticsAppendix(n){let t;try{t=JSON.stringify(n,null,2)}catch{t='{"ng0203Diagnostics":"JSON stringify failed"}'}return`
1
+ import{I as _,K as T,N as D,p as U}from"./chunk-762K6QXC.js";import{C,Gb as H,a as b,aa as I,b as j,h as w,k as L,p as g,q as h,wb as d,xb as M,y as F}from"./chunk-TBMJSIBB.js";var y=[{prefix:"/setup",hint:"Setup \u2014 client/src/app/_modules/config/_modules/setup/"},{prefix:"/settings",hint:"Settings \u2014 client/src/app/_modules/config/_modules/settings/"},{prefix:"/model-registry",hint:"Model registry \u2014 client/src/app/_modules/model-registry/"},{prefix:"/embedding-registry",hint:"Embedding registry \u2014 client/src/app/_modules/ai-systems/_modules/embedding-registry/"},{prefix:"/embedding-eval",hint:"Embedding eval \u2014 client/src/app/_modules/embedding-eval/"},{prefix:"/session",hint:"CCAP Session UI \u2014 client/src/app/_modules/session/"},{prefix:"/errors",hint:"Errors list \u2014 client/src/app/_modules/system/_modules/errors/"},{prefix:"/feedback",hint:"Feedback \u2014 client/src/app/_modules/feedback/"},{prefix:"/logs",hint:"Logs \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/logs/"},{prefix:"/host-runtime-mcp",hint:"Host runtime MCP \u2014 client/src/app/_modules/dev/_modules/host-runtime-mcp/"},{prefix:"/voice-notes-poc",hint:"Voice notes POC \u2014 client/src/app/_modules/dev/_modules/poc/voice-notes-poc/"},{prefix:"/master-control-remote-poc",hint:"Master control remote POC \u2014 client/src/app/_modules/dev/_modules/poc/master-control-remote-poc/"},{prefix:"/workflow-settings",hint:"Workflow settings \u2014 client/src/app/_modules/config/_modules/workflow-settings/"},{prefix:"/coordinator",hint:"Coordinator \u2014 client/src/app/_modules/coordinator/"},{prefix:"/dark-office",hint:"Dark Office \u2014 client/src/app/_modules/dark-office/"},{prefix:"/project-management",hint:"Project management \u2014 client/src/app/_modules/project-management/"},{prefix:"/cc-session",hint:"CC Session UI \u2014 client/src/app/_modules/cc-session/"},{prefix:"/mobile-app",hint:"Mobile app \u2014 client/src/app/_modules/dev/_modules/poc/mobile-app/"},{prefix:"/oc-session",hint:"OC Session \u2014 client/src/app/_modules/oc/"},{prefix:"/ca-session",hint:"CA Session \u2014 client/src/app/_modules/ca-session/"},{prefix:"/consultant",hint:"Consultant \u2014 client/src/app/_modules/consultant/"},{prefix:"/agent-instances",hint:"Agent instances \u2014 client/src/app/_modules/agent-instances/"},{prefix:"/terminals",hint:"Terminals \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/terminals/"},{prefix:"/live-development-pipeline",hint:"Live Development Pipeline \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/live-dev-pipeline/"},{prefix:"/system-status",hint:"Legacy route \u2192 redirects to /live-development-pipeline \u2014 client/src/app/_modules/dev/_modules/devtools/_modules/live-dev-pipeline/"},{prefix:"/",hint:"Dashboard (root) \u2014 client/src/app/_modules/dashboard/"}];var q="NG0203",S=class r{static isNg0203Message(n){return n.trim()===q}static buildDiagnostics(n){let t={route:n.context.route,url:n.context.url,userAgent:n.context.userAgent,timestamp:n.context.timestamp},e=r.parseStackFrames(n.stack),i=typeof n.context.route=="string"?n.context.route:"",o=r.resolveRouteFeatureHints(i),s=r.buildStaticGuidance(),l=r.buildToolSteps({clientSnapshot:t,clientSource:n.clientSource,stackFrames:e,routeFeatureHints:o});return{summary:"Angular NG0203: inject() was called outside an injection context (constructor, field initializer, factory, or runInInjectionContext).",clientSource:n.clientSource,clientSnapshot:t,stackFrames:e,routeFeatureHints:o,staticGuidance:s,toolSteps:l}}static formatDiagnosticsAppendix(n){let t;try{t=JSON.stringify(n,null,2)}catch{t='{"ng0203Diagnostics":"JSON stringify failed"}'}return`
2
2
 
3
3
  [NG0203 diagnostics]
4
4
  ${t}`}static parseStackFrames(n){if(n==null||!n.trim())return[];let t=n.split(`
@@ -24,4 +24,4 @@ ${String(n)}`}function nt(r){if(r instanceof Error&&typeof r.stack=="string"&&r.
24
24
  `),s=t!=null&&t.trim().length>0?t.trim():"(no stack)";return`${o}
25
25
 
26
26
  ${s}`}buildReportPayloadFromError(t,e){let i=this.getCurrentContext(),o=f.getErrorMessageForDisplay(t),s=r.enrichMessageForReport(t,o),l=f.getStackForReport(t),m=this.buildStackWithContext(l,i),R=r.extractErrorCode(t),E=r.extractAdditionalContent(t);return{message:s,stack:m,source:e??"client-app",errorCode:R,errorAdditionalContent:E,clientContext:i}}static enrichMessageForReport(t,e){if(!(t instanceof d))return e;let i=t.url?`URL: ${t.url}`:"URL: (?)",o=`status: ${t.status}`;return`${e} | ${i} | ${o}`}static extractErrorCode(t){if(t==null||typeof t!="object")return;let e=t;if(typeof e.errorCode=="string"&&e.errorCode.length>0)return e.errorCode;if(typeof e._errorCode=="string"&&e._errorCode.length>0)return e._errorCode}static extractAdditionalContent(t){if(t==null||typeof t!="object")return;let e=t;if(e.additionalContent!=null&&typeof e.additionalContent=="object")return e.additionalContent}buildReportPayloadFromParams(t){let e=this.getCurrentContext(),i=this.buildStackWithContext(t.stack,e);return{message:t.message,stack:i,source:t.source,clientContext:e}}showError(t,e){setTimeout(()=>{try{let i=f.getErrorMessageForDisplay(t),o=N.tryGetShortNotificationAffix({error:t});if(o.length>0&&(i=i+o),!(t instanceof d)&&!(this.settingsGeneral_DS.section_$().form.reportSocketConnectionErrorsToErrorList===!0)&&x.matchesDisplayMessage(i)){t instanceof Error&&p.DyFM_Log.error("[CCAP]",e??"client-app",t);return}let s=this.getCurrentContext(),l;if(k.isNg0600Message(i))try{l=k.buildDiagnostics({stack:f.getStackForReport(t),context:{route:s.route,url:s.url,userAgent:s.userAgent,timestamp:s.timestamp},clientSource:e})}catch(a){p.DyFM_Log.error("CCAP NG0600 diagnostics failed",a)}let m;if(S.isNg0203Message(i))try{m=S.buildDiagnostics({stack:f.getStackForReport(t),context:{route:s.route,url:s.url,userAgent:s.userAgent,timestamp:s.timestamp},clientSource:e})}catch(a){p.DyFM_Log.error("CCAP NG0203 diagnostics failed",a)}let R=e!=null&&e.trim().length>0?e.trim():void 0,E={id:this.nextNotificationId++,error:t,displayMessage:i,timestamp:Date.now(),isDismissing:!1,clientSource:R,ng0600Diagnostics:l,ng0203Diagnostics:m};if(this.errors_$.update(a=>{let u=[...a,E];return u.length>r.maxNotifications?u.slice(u.length-r.maxNotifications):u}),setTimeout(()=>{this.dismissNotification(E.id)},r.autoDismissMs),t instanceof Error&&p.DyFM_Log.error("[CCAP]",e??"client-app",t),!(t instanceof d)){let a=this.buildReportPayloadFromError(t,e??"client-app"),u="";l!=null?u=k.formatDiagnosticsAppendix(l):m!=null&&(u=S.formatDiagnosticsAppendix(m));let X=u.length>0?`${a.stack??""}${u}`:a.stack??"",Y={message:a.message,stack:X,source:a.source,sessionId:a.sessionId,runId:a.runId,errorCode:a.errorCode,errorAdditionalContent:a.errorAdditionalContent,clientContext:a.clientContext};this.errors_AS.reportError(Y).catch(()=>{})}}catch(i){p.DyFM_Log.error("CCAP showError set failed",i)}},0)}selectError(t){let e=this.errors_$().find(i=>i.id===t);e!=null&&this.selectedNotificationForModal_$.set(e)}dismissNotification(t){let i=this.errors_$().find(o=>o.id===t);i==null||i.isDismissing||(this.errors_$.update(o=>o.map(s=>s.id===t?j(b({},s),{isDismissing:!0}):s)),setTimeout(()=>{this.errors_$.update(o=>o.filter(s=>s.id!==t))},r.exitAnimationMs))}dismissSelected(){this.selectedNotificationForModal_$.set(null)}dismissAll(){this.errors_$.set([]),this.selectedNotificationForModal_$.set(null)}copyToClipboard(t){return L(this,null,function*(){return(yield this.tryWriteTextWithNavigatorClipboard(t))?{ok:!0}:this.copyTextWithExecCommand(t)?{ok:!0}:{ok:!1,error:new Error("Clipboard copy failed (secure Clipboard API unavailable or denied, and legacy execCommand copy failed)")}})}tryWriteTextWithNavigatorClipboard(t){return L(this,null,function*(){let e=typeof navigator<"u"?navigator.clipboard:void 0;if(e==null||typeof e.writeText!="function")return!1;try{return yield e.writeText(t),!0}catch{return!1}})}copyTextWithExecCommand(t){if(typeof document>"u"||typeof document.execCommand!="function")return!1;let e=document.createElement("textarea");e.value=t,e.setAttribute("readonly",""),e.setAttribute("aria-hidden","true"),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="1px",e.style.height="1px",e.style.padding="0",e.style.margin="0",e.style.border="none",e.style.outline="none",e.style.opacity="0",e.style.pointerEvents="none",document.body.appendChild(e),e.focus(),e.select();let i=t.length;e.setSelectionRange(0,i);let o=!1;try{o=document.execCommand("copy")}catch{o=!1}return e.remove(),o}reportErrorOnly(t){if(!(this.settingsGeneral_DS.section_$().form.reportSocketConnectionErrorsToErrorList===!0)&&(t.source==="client-socket"||x.matchesDisplayMessage(t.message)))return;let i=this.buildReportPayloadFromParams(t);this.errors_AS.reportError(i).catch(()=>{})}static \u0275fac=function(e){return new(e||r)};static \u0275prov=F({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{S as a,k as b,c,$ as d,v as e,z as f,N as g,f as h,V as i,Ot as j};
27
- //# sourceMappingURL=chunk-TKAV5X35.js.map
27
+ //# sourceMappingURL=chunk-MMQ57B6R.js.map