@futdevpro/ccap 1.1.3130 → 1.1.3138
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.
- package/client-dist/{agent-instances.module-KE64PSK7.js → agent-instances.module-ZOPVXJSY.js} +2 -2
- package/client-dist/{ca.module-JJZX5YKQ.js → ca.module-GBPPQBR7.js} +2 -2
- package/client-dist/{cc-usage-dashboard.component-ODAXHZHU.js → cc-usage-dashboard.component-WDBF2MIW.js} +2 -2
- package/client-dist/{cc.module-4MS5M5XW.js → cc.module-OMMM5NND.js} +2 -2
- package/client-dist/{chunk-QNLMNKP4.js → chunk-2KRQFVFS.js} +2 -2
- package/client-dist/{chunk-CUA2OS6E.js → chunk-32QF7M34.js} +2 -2
- package/client-dist/{chunk-HSO5WM67.js → chunk-3J5EVPQU.js} +2 -2
- package/client-dist/{chunk-CBMKN4SJ.js → chunk-4CKMY7CX.js} +2 -2
- package/client-dist/{chunk-ISPLVKBM.js → chunk-5OL2PVPJ.js} +2 -2
- package/client-dist/{chunk-EVYE6YII.js → chunk-65M4TV2B.js} +2 -2
- package/client-dist/{chunk-CIO2T2KX.js → chunk-7G4XAXDE.js} +2 -2
- package/client-dist/{chunk-EFH7L2PM.js → chunk-AXUASUMT.js} +2 -2
- package/client-dist/{chunk-URXIWUNP.js → chunk-CRU2A5CR.js} +2 -2
- package/client-dist/{chunk-5E5W3DFK.js → chunk-DVN2VXDE.js} +2 -2
- package/client-dist/{chunk-PR5VADUQ.js → chunk-EUZSCL5E.js} +2 -2
- package/client-dist/{chunk-4CLON3UX.js → chunk-FFMRDDGL.js} +2 -2
- package/client-dist/{chunk-U6B7OBXY.js → chunk-FJPTWDXS.js} +2 -2
- package/client-dist/{chunk-S5PG5OUU.js → chunk-G3IBMD7V.js} +2 -2
- package/client-dist/{chunk-KNTOPF7C.js → chunk-G3LGRE4Z.js} +2 -2
- package/client-dist/{chunk-LBG3XMYU.js → chunk-GBICGH5D.js} +2 -2
- package/client-dist/{chunk-HK2TYWE7.js → chunk-HVY3GMOZ.js} +2 -2
- package/client-dist/{chunk-VL2H6COO.js → chunk-I5ISS4IO.js} +2 -2
- package/client-dist/{chunk-RNXGBUU3.js → chunk-J772S2PU.js} +2 -2
- package/client-dist/{chunk-7TYUDNTP.js → chunk-JDAN7XYD.js} +2 -2
- package/client-dist/{chunk-FQL5FQFW.js → chunk-JEI7TDG4.js} +2 -2
- package/client-dist/{chunk-NIMLWXGM.js → chunk-JN3M2D7S.js} +2 -2
- package/client-dist/{chunk-EG7MEKVY.js → chunk-K3GAHTZ5.js} +2 -2
- package/client-dist/{chunk-CAUXU2ZC.js → chunk-K73EM3FB.js} +2 -2
- package/client-dist/{chunk-5KQZGU6O.js → chunk-K7GP33XJ.js} +2 -2
- package/client-dist/{chunk-L4CLV44N.js → chunk-KGYOX5HP.js} +2 -2
- package/client-dist/{chunk-QHZI4F2F.js → chunk-KNBMYOHX.js} +2 -2
- package/client-dist/{chunk-Y3DARUXQ.js → chunk-KPYMFKWR.js} +2 -2
- package/client-dist/{chunk-Y3DARUXQ.js.map → chunk-KPYMFKWR.js.map} +1 -1
- package/client-dist/{chunk-XZTQ4YC7.js → chunk-KVUXI6MR.js} +2 -2
- package/client-dist/{chunk-SWJLLCFC.js → chunk-LRRV7Y7L.js} +2 -2
- package/client-dist/{chunk-RLXJG6ZF.js → chunk-LTAFFTQP.js} +2 -2
- package/client-dist/{chunk-FBZDKQ4K.js → chunk-LXYDSYHF.js} +2 -2
- package/client-dist/{chunk-O6KFG5LW.js → chunk-LZFMN6MP.js} +2 -2
- package/client-dist/{chunk-NHKJYR4C.js → chunk-M6ZBHGHC.js} +2 -2
- package/client-dist/{chunk-VORYOEWH.js → chunk-MM3O33UM.js} +2 -2
- package/client-dist/{chunk-CF3BLCVD.js → chunk-ND5WRBGC.js} +2 -2
- package/client-dist/{chunk-TCDXJTTX.js → chunk-NJRFLQOC.js} +2 -2
- package/client-dist/{chunk-NBH53JWT.js → chunk-NPAZDIJ4.js} +2 -2
- package/client-dist/{chunk-ZTB2RW6R.js → chunk-PXZCAGLZ.js} +2 -2
- package/client-dist/{chunk-4O4UDIWG.js → chunk-Q4RH77GU.js} +2 -2
- package/client-dist/{chunk-3HLEHUE4.js → chunk-Q6OVG3PN.js} +2 -2
- package/client-dist/{chunk-X4IBG3WG.js → chunk-RE7V257C.js} +2 -2
- package/client-dist/{chunk-GOPRHQFC.js → chunk-RIPYHGQD.js} +2 -2
- package/client-dist/{chunk-5XJR5EAR.js → chunk-RJDAL72T.js} +2 -2
- package/client-dist/{chunk-R2C7U5TP.js → chunk-RO3VS3XW.js} +2 -2
- package/client-dist/{chunk-EC4VBEIV.js → chunk-RSDVRIME.js} +2 -2
- package/client-dist/{chunk-DB33SOJ3.js → chunk-TCW2TUTP.js} +2 -2
- package/client-dist/{chunk-C2ZXKTHA.js → chunk-UMIUBD3R.js} +2 -2
- package/client-dist/{chunk-FBF7RSNU.js → chunk-UO6KY2TS.js} +2 -2
- package/client-dist/{chunk-EGWEYXZW.js → chunk-WL2WTWXX.js} +2 -2
- package/client-dist/{chunk-UTJQVE4E.js → chunk-Y3WDXITT.js} +2 -2
- package/client-dist/{chunk-36BCBGXK.js → chunk-Z4WIK4FR.js} +2 -2
- package/client-dist/{chunk-KC7UN4VT.js → chunk-Z5C7EZ67.js} +2 -2
- package/client-dist/{chunk-JWXM6QMF.js → chunk-ZAIWCKXJ.js} +2 -2
- package/client-dist/{chunk-VU76JPZM.js → chunk-ZLMUL7S4.js} +2 -2
- package/client-dist/{chunk-V6QEYU4X.js → chunk-ZTOURJ46.js} +2 -2
- package/client-dist/{consultant.module-S4UQA3UJ.js → consultant.module-H36X7I4H.js} +2 -2
- package/client-dist/{crd.module-XHOTNUXY.js → crd.module-PHBM5USN.js} +2 -2
- package/client-dist/{dashboard.module-YZMJUPDH.js → dashboard.module-DKD6EVE6.js} +2 -2
- package/client-dist/{do.module-ESWOBSRO.js → do.module-HNYYKF5M.js} +2 -2
- package/client-dist/{document-library.module-S2IATB7C.js → document-library.module-XR6BXCSU.js} +2 -2
- package/client-dist/{embedding-eval.module-OAUL3HRQ.js → embedding-eval.module-4HGGOYW5.js} +2 -2
- package/client-dist/{embedding-registry.module-T4Q57QWS.js → embedding-registry.module-T3RG2V42.js} +2 -2
- package/client-dist/{err.module-YM7F2DFM.js → err.module-C6HAAWFO.js} +2 -2
- package/client-dist/{feedback.module-4ZLA4O5I.js → feedback.module-ZDWYCOVW.js} +2 -2
- package/client-dist/{host-runtime-mcp.module-OIK42CRE.js → host-runtime-mcp.module-SOUQHK2I.js} +2 -2
- package/client-dist/index.html +1 -1
- package/client-dist/{live-dev-pipeline.module-AFWGOCMO.js → live-dev-pipeline.module-TR7XBOXT.js} +2 -2
- package/client-dist/{logs.module-OSZVMRRI.js → logs.module-VVDZLW7V.js} +2 -2
- package/client-dist/{main-3KSHNVCW.js → main-NHMXKD2O.js} +3 -3
- package/client-dist/{master-control-remote-poc.module-T5NK5KD7.js → master-control-remote-poc.module-LSZYOHDO.js} +2 -2
- package/client-dist/{mobile-app.module-GPFLEVWR.js → mobile-app.module-AVY75HHG.js} +2 -2
- package/client-dist/{model-registry.module-SKRFHTWQ.js → model-registry.module-GW7D2VQ5.js} +2 -2
- package/client-dist/{oc.module-562ZP6BM.js → oc.module-YYYU75GK.js} +2 -2
- package/client-dist/{orc.module-SCMVZ535.js → orc.module-SECLSICH.js} +2 -2
- package/client-dist/{project-management.module-LA7M6MXA.js → project-management.module-CTU3GS3P.js} +2 -2
- package/client-dist/project-source-routed.module-EPBJI5KC.js +2 -0
- package/client-dist/{scheduler.module-QNWITVDV.js → scheduler.module-RET3QOQA.js} +2 -2
- package/client-dist/{session.module-LJNWNXN7.js → session.module-YXMACPSW.js} +2 -2
- package/client-dist/{set.module-FINVUQYD.js → set.module-7GLQMJ36.js} +2 -2
- package/client-dist/{setup.module-5FOSEQWI.js → setup.module-3UUHPGTT.js} +2 -2
- package/client-dist/{terminals.module-LMW6DR3T.js → terminals.module-ZQHRH4VJ.js} +2 -2
- package/client-dist/{voice-notes-poc.module-R3ECC3V3.js → voice-notes-poc.module-HDQAMMDM.js} +2 -2
- package/client-dist/{wfs.module-TAZFZ2BH.js → wfs.module-XPB56MOB.js} +2 -2
- package/package.json +1 -1
- package/client-dist/project-source-routed.module-QQBPIDUK.js +0 -2
- /package/client-dist/{agent-instances.module-KE64PSK7.js.map → agent-instances.module-ZOPVXJSY.js.map} +0 -0
- /package/client-dist/{ca.module-JJZX5YKQ.js.map → ca.module-GBPPQBR7.js.map} +0 -0
- /package/client-dist/{cc-usage-dashboard.component-ODAXHZHU.js.map → cc-usage-dashboard.component-WDBF2MIW.js.map} +0 -0
- /package/client-dist/{cc.module-4MS5M5XW.js.map → cc.module-OMMM5NND.js.map} +0 -0
- /package/client-dist/{chunk-QNLMNKP4.js.map → chunk-2KRQFVFS.js.map} +0 -0
- /package/client-dist/{chunk-CUA2OS6E.js.map → chunk-32QF7M34.js.map} +0 -0
- /package/client-dist/{chunk-HSO5WM67.js.map → chunk-3J5EVPQU.js.map} +0 -0
- /package/client-dist/{chunk-CBMKN4SJ.js.map → chunk-4CKMY7CX.js.map} +0 -0
- /package/client-dist/{chunk-ISPLVKBM.js.map → chunk-5OL2PVPJ.js.map} +0 -0
- /package/client-dist/{chunk-EVYE6YII.js.map → chunk-65M4TV2B.js.map} +0 -0
- /package/client-dist/{chunk-CIO2T2KX.js.map → chunk-7G4XAXDE.js.map} +0 -0
- /package/client-dist/{chunk-EFH7L2PM.js.map → chunk-AXUASUMT.js.map} +0 -0
- /package/client-dist/{chunk-URXIWUNP.js.map → chunk-CRU2A5CR.js.map} +0 -0
- /package/client-dist/{chunk-5E5W3DFK.js.map → chunk-DVN2VXDE.js.map} +0 -0
- /package/client-dist/{chunk-PR5VADUQ.js.map → chunk-EUZSCL5E.js.map} +0 -0
- /package/client-dist/{chunk-4CLON3UX.js.map → chunk-FFMRDDGL.js.map} +0 -0
- /package/client-dist/{chunk-U6B7OBXY.js.map → chunk-FJPTWDXS.js.map} +0 -0
- /package/client-dist/{chunk-S5PG5OUU.js.map → chunk-G3IBMD7V.js.map} +0 -0
- /package/client-dist/{chunk-KNTOPF7C.js.map → chunk-G3LGRE4Z.js.map} +0 -0
- /package/client-dist/{chunk-LBG3XMYU.js.map → chunk-GBICGH5D.js.map} +0 -0
- /package/client-dist/{chunk-HK2TYWE7.js.map → chunk-HVY3GMOZ.js.map} +0 -0
- /package/client-dist/{chunk-VL2H6COO.js.map → chunk-I5ISS4IO.js.map} +0 -0
- /package/client-dist/{chunk-RNXGBUU3.js.map → chunk-J772S2PU.js.map} +0 -0
- /package/client-dist/{chunk-7TYUDNTP.js.map → chunk-JDAN7XYD.js.map} +0 -0
- /package/client-dist/{chunk-FQL5FQFW.js.map → chunk-JEI7TDG4.js.map} +0 -0
- /package/client-dist/{chunk-NIMLWXGM.js.map → chunk-JN3M2D7S.js.map} +0 -0
- /package/client-dist/{chunk-EG7MEKVY.js.map → chunk-K3GAHTZ5.js.map} +0 -0
- /package/client-dist/{chunk-CAUXU2ZC.js.map → chunk-K73EM3FB.js.map} +0 -0
- /package/client-dist/{chunk-5KQZGU6O.js.map → chunk-K7GP33XJ.js.map} +0 -0
- /package/client-dist/{chunk-L4CLV44N.js.map → chunk-KGYOX5HP.js.map} +0 -0
- /package/client-dist/{chunk-QHZI4F2F.js.map → chunk-KNBMYOHX.js.map} +0 -0
- /package/client-dist/{chunk-XZTQ4YC7.js.map → chunk-KVUXI6MR.js.map} +0 -0
- /package/client-dist/{chunk-SWJLLCFC.js.map → chunk-LRRV7Y7L.js.map} +0 -0
- /package/client-dist/{chunk-RLXJG6ZF.js.map → chunk-LTAFFTQP.js.map} +0 -0
- /package/client-dist/{chunk-FBZDKQ4K.js.map → chunk-LXYDSYHF.js.map} +0 -0
- /package/client-dist/{chunk-O6KFG5LW.js.map → chunk-LZFMN6MP.js.map} +0 -0
- /package/client-dist/{chunk-NHKJYR4C.js.map → chunk-M6ZBHGHC.js.map} +0 -0
- /package/client-dist/{chunk-VORYOEWH.js.map → chunk-MM3O33UM.js.map} +0 -0
- /package/client-dist/{chunk-CF3BLCVD.js.map → chunk-ND5WRBGC.js.map} +0 -0
- /package/client-dist/{chunk-TCDXJTTX.js.map → chunk-NJRFLQOC.js.map} +0 -0
- /package/client-dist/{chunk-NBH53JWT.js.map → chunk-NPAZDIJ4.js.map} +0 -0
- /package/client-dist/{chunk-ZTB2RW6R.js.map → chunk-PXZCAGLZ.js.map} +0 -0
- /package/client-dist/{chunk-4O4UDIWG.js.map → chunk-Q4RH77GU.js.map} +0 -0
- /package/client-dist/{chunk-3HLEHUE4.js.map → chunk-Q6OVG3PN.js.map} +0 -0
- /package/client-dist/{chunk-X4IBG3WG.js.map → chunk-RE7V257C.js.map} +0 -0
- /package/client-dist/{chunk-GOPRHQFC.js.map → chunk-RIPYHGQD.js.map} +0 -0
- /package/client-dist/{chunk-5XJR5EAR.js.map → chunk-RJDAL72T.js.map} +0 -0
- /package/client-dist/{chunk-R2C7U5TP.js.map → chunk-RO3VS3XW.js.map} +0 -0
- /package/client-dist/{chunk-EC4VBEIV.js.map → chunk-RSDVRIME.js.map} +0 -0
- /package/client-dist/{chunk-DB33SOJ3.js.map → chunk-TCW2TUTP.js.map} +0 -0
- /package/client-dist/{chunk-C2ZXKTHA.js.map → chunk-UMIUBD3R.js.map} +0 -0
- /package/client-dist/{chunk-FBF7RSNU.js.map → chunk-UO6KY2TS.js.map} +0 -0
- /package/client-dist/{chunk-EGWEYXZW.js.map → chunk-WL2WTWXX.js.map} +0 -0
- /package/client-dist/{chunk-UTJQVE4E.js.map → chunk-Y3WDXITT.js.map} +0 -0
- /package/client-dist/{chunk-36BCBGXK.js.map → chunk-Z4WIK4FR.js.map} +0 -0
- /package/client-dist/{chunk-KC7UN4VT.js.map → chunk-Z5C7EZ67.js.map} +0 -0
- /package/client-dist/{chunk-JWXM6QMF.js.map → chunk-ZAIWCKXJ.js.map} +0 -0
- /package/client-dist/{chunk-VU76JPZM.js.map → chunk-ZLMUL7S4.js.map} +0 -0
- /package/client-dist/{chunk-V6QEYU4X.js.map → chunk-ZTOURJ46.js.map} +0 -0
- /package/client-dist/{consultant.module-S4UQA3UJ.js.map → consultant.module-H36X7I4H.js.map} +0 -0
- /package/client-dist/{crd.module-XHOTNUXY.js.map → crd.module-PHBM5USN.js.map} +0 -0
- /package/client-dist/{dashboard.module-YZMJUPDH.js.map → dashboard.module-DKD6EVE6.js.map} +0 -0
- /package/client-dist/{do.module-ESWOBSRO.js.map → do.module-HNYYKF5M.js.map} +0 -0
- /package/client-dist/{document-library.module-S2IATB7C.js.map → document-library.module-XR6BXCSU.js.map} +0 -0
- /package/client-dist/{embedding-eval.module-OAUL3HRQ.js.map → embedding-eval.module-4HGGOYW5.js.map} +0 -0
- /package/client-dist/{embedding-registry.module-T4Q57QWS.js.map → embedding-registry.module-T3RG2V42.js.map} +0 -0
- /package/client-dist/{err.module-YM7F2DFM.js.map → err.module-C6HAAWFO.js.map} +0 -0
- /package/client-dist/{feedback.module-4ZLA4O5I.js.map → feedback.module-ZDWYCOVW.js.map} +0 -0
- /package/client-dist/{host-runtime-mcp.module-OIK42CRE.js.map → host-runtime-mcp.module-SOUQHK2I.js.map} +0 -0
- /package/client-dist/{live-dev-pipeline.module-AFWGOCMO.js.map → live-dev-pipeline.module-TR7XBOXT.js.map} +0 -0
- /package/client-dist/{logs.module-OSZVMRRI.js.map → logs.module-VVDZLW7V.js.map} +0 -0
- /package/client-dist/{main-3KSHNVCW.js.map → main-NHMXKD2O.js.map} +0 -0
- /package/client-dist/{master-control-remote-poc.module-T5NK5KD7.js.map → master-control-remote-poc.module-LSZYOHDO.js.map} +0 -0
- /package/client-dist/{mobile-app.module-GPFLEVWR.js.map → mobile-app.module-AVY75HHG.js.map} +0 -0
- /package/client-dist/{model-registry.module-SKRFHTWQ.js.map → model-registry.module-GW7D2VQ5.js.map} +0 -0
- /package/client-dist/{oc.module-562ZP6BM.js.map → oc.module-YYYU75GK.js.map} +0 -0
- /package/client-dist/{orc.module-SCMVZ535.js.map → orc.module-SECLSICH.js.map} +0 -0
- /package/client-dist/{project-management.module-LA7M6MXA.js.map → project-management.module-CTU3GS3P.js.map} +0 -0
- /package/client-dist/{project-source-routed.module-QQBPIDUK.js.map → project-source-routed.module-EPBJI5KC.js.map} +0 -0
- /package/client-dist/{scheduler.module-QNWITVDV.js.map → scheduler.module-RET3QOQA.js.map} +0 -0
- /package/client-dist/{session.module-LJNWNXN7.js.map → session.module-YXMACPSW.js.map} +0 -0
- /package/client-dist/{set.module-FINVUQYD.js.map → set.module-7GLQMJ36.js.map} +0 -0
- /package/client-dist/{setup.module-5FOSEQWI.js.map → setup.module-3UUHPGTT.js.map} +0 -0
- /package/client-dist/{terminals.module-LMW6DR3T.js.map → terminals.module-ZQHRH4VJ.js.map} +0 -0
- /package/client-dist/{voice-notes-poc.module-R3ECC3V3.js.map → voice-notes-poc.module-HDQAMMDM.js.map} +0 -0
- /package/client-dist/{wfs.module-TAZFZ2BH.js.map → wfs.module-XPB56MOB.js.map} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as O}from"./chunk-
|
|
1
|
+
import{a as O}from"./chunk-3J5EVPQU.js";import{a as q}from"./chunk-ND5WRBGC.js";import{d as F}from"./chunk-JN3M2D7S.js";import{e as D}from"./chunk-KNBMYOHX.js";import{h as A,j as k}from"./chunk-G3LGRE4Z.js";import{I as R,p as j}from"./chunk-KPYMFKWR.js";import{C as I,R as P,a as S,aa as m,b,h as U,k as f,p as y,vb as g,xb as K,y as E}from"./chunk-TBMJSIBB.js";var M=class{static compareMirrorEventsAsc(i,e){let t=(i.sequence??0)-(e.sequence??0);if(t!==0)return t;let s=typeof i.timestamp=="string"?i.timestamp:"",n=typeof e.timestamp=="string"?e.timestamp:"",o=s.localeCompare(n);if(o!==0)return o;let r=typeof i.eventType=="string"?i.eventType:"",a=typeof e.eventType=="string"?e.eventType:"";return r.localeCompare(a)}};var C=class c{static messageIdsCompatibleForStreamMerge(i,e){let t=(i??"").trim(),s=(e??"").trim();return t.length>0&&s.length>0?t===s:!0}static parseStreamChunkFromMirrorData(i){let e=i.update;if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=c.toPlainRecord(e),s=t.sessionUpdate,n=null;if(s==="agent_message_chunk"&&(n="agent"),s==="user_message_chunk"&&(n="user"),s==="agent_thought_chunk"&&(n="thought"),n===null)return null;let o=t.content;if(o===null||typeof o!="object"||Array.isArray(o))return null;let a=c.toPlainRecord(o).text;if(typeof a!="string"||!a.length)return null;let l=t.messageId,d=typeof l=="string"&&l.length>0?l:void 0;return{role:n,text:a,messageId:d}}static canMergeConsoleTailWithChunk(i){let e=i.prev;if(e.streamTextRole===void 0||e.streamTextRole!==i.parsed.role)return!1;let t=e.streamMessageId,s=i.parsed.messageId;if(!c.messageIdsCompatibleForStreamMerge(t,s))return!1;let n=i.ev.sequence??0,o=e.streamLastSequence??0;return!(n<=o)}static canMergeMirrorChunkEvents(i,e,t){let s=c.parseStreamChunkFromMirrorData(i.data??{});if(s===null||s.role!==t.role)return!1;let n=s.messageId,o=t.messageId;if(!c.messageIdsCompatibleForStreamMerge(n,o))return!1;let r=i.sequence??0;return!((e.sequence??0)<=r)}static foldEventsToTimelineRows(i){let e=[];for(let t of i){let s=c.parseStreamChunkFromMirrorData(t.data??{});if(s!==null){let n=e.length>0?e[e.length-1]:void 0,o=n!==void 0&&n.events.length>0?n.events[n.events.length-1]:void 0;if(n!==void 0&&o!==void 0&&c.canMergeMirrorChunkEvents(o,t,s)){let r=[...n.events,t];e[e.length-1]={rowKey:c.mergedTimelineRowKey(r),events:r}}else e.push({rowKey:`evt-${String(t.sequence??0)}`,events:[t]})}else e.push({rowKey:`evt-${String(t.sequence??0)}`,events:[t]})}return e}static mergedTimelineRowKey(i){if(!i.length)return"evt-empty";let e=i[0].sequence??0,t=i[i.length-1].sequence??0;return`merged-chunk-${String(e)}-${String(t)}`}static toPlainRecord(i){let e={};for(let t of Object.keys(i))e[t]=Reflect.get(i,t);return e}};var v=U(j());var x=class c{static prettyStringifyUnknown(i){try{let e=c.expandEmbeddedJsonStrings(i);return JSON.stringify(e,null,2)}catch{return i==null?String(i):typeof i=="object"?"[Object stringify failed]":String(i)}}static expandEmbeddedJsonStrings(i){if(i==null)return i;if(typeof i=="string"){let t=i;if(!F.looksLikeJson(t))return t;try{let s=JSON.parse(t.trim());return c.expandEmbeddedJsonStrings(s)}catch{return t}}if(typeof i!="object")return i;if(Array.isArray(i))return i.map(t=>c.expandEmbeddedJsonStrings(t));let e={};for(let t of Object.keys(i)){let s=Reflect.get(i,t);e[t]=c.expandEmbeddedJsonStrings(s)}return e}};var T=class c{static buildFromMirrorEvent(i){let e=i.sequence??0,t=i.data!==void 0?i.data:{},s=typeof i.eventType=="string"?i.eventType:"";return s==="prompt-sent"?c.buildPromptSentBrief(e,t):s==="ca-session-update"?c.buildCaSessionUpdateBrief(e,t):c.buildGenericBrief(s,e,t)}static extractSessionUpdateKind(i){let e=i.update;if(e===null||typeof e!="object"||Array.isArray(e))return;let s=c.toPlainRecord(e).sessionUpdate;return typeof s=="string"&&s.length?s:void 0}static buildPromptSentBrief(i,e){let t=e.content;return typeof t!="string"||!t.length?null:{listKey:`mirror-prompt-${String(i)}`,consoleType:"prompt",bodyText:t,mirrorEventType:"prompt-sent",useRawBubbleKind:!1,rawData:e}}static buildCaSessionUpdateBrief(i,e){let t=C.parseStreamChunkFromMirrorData(e);if(t!==null){let n=c.extractSessionUpdateKind(e),o=t.role==="thought";return{listKey:`mirror-chunk-${String(i)}`,consoleType:o?"thinking":"assistant",bodyText:t.text,mirrorEventType:"ca-session-update",briefSubtype:n,useRawBubbleKind:!1,rawData:e,isStreamingTextChunk:!0,streamTextRole:t.role,streamMessageId:t.messageId}}let s=x.prettyStringifyUnknown(e);return{listKey:`mirror-ca-session-update-${String(i)}`,consoleType:"info",bodyText:s,mirrorEventType:"ca-session-update",useRawBubbleKind:!0,rawData:e}}static buildGenericBrief(i,e,t){let s=c.safeListKeySegment(i),n={eventType:i.length?i:"unknown",sequence:e,data:t},o=x.prettyStringifyUnknown(n);return{listKey:`mirror-${s}-${String(e)}`,consoleType:"info",bodyText:o,mirrorEventType:i.length?i:"unknown",useRawBubbleKind:!0,rawData:t}}static safeListKeySegment(i){let e=i.replace(/[^a-zA-Z0-9_-]+/g,"_").replace(/^_+|_+$/g,"");return e.length?e:"event"}static toPlainRecord(i){let e={};for(let t of Object.keys(i))e[t]=Reflect.get(i,t);return e}};var u=class c{static listKeyStart(i){return`ca-tc-${i}-start`}static listKeyProgress(i){return`ca-tc-${i}-progress`}static listKeyResult(i){return`ca-tc-${i}-result`}static listKeyError(i){return`ca-tc-${i}-error`}static tryParseStableListKey(i){let e="ca-tc-";if(!i.startsWith(e))return null;let t=[{suffix:"-progress",role:"progress"},{suffix:"-start",role:"start"},{suffix:"-result",role:"result"},{suffix:"-error",role:"error"}];for(let s of t){if(!i.endsWith(s.suffix))continue;let n=i.slice(e.length,i.length-s.suffix.length);return n.length?{toolCallId:n,role:s.role}:null}return null}static tryParseMirrorData(i){let e=i.update;if(e===null||typeof e!="object"||Array.isArray(e))return null;let t=c.toPlainRecord(e),s=t.sessionUpdate;if(s!=="tool_call"&&s!=="tool_call_update")return null;let n=t.toolCallId;if(typeof n!="string"||!n.trim().length)return null;let o=t.status,r=typeof o=="string"?o:"",a=t.title,l=typeof a=="string"&&a.trim().length?a.trim():void 0,d=t.kind,h=typeof d=="string"&&d.trim().length?d.trim():void 0,p=t.rawOutput,_=t.rawInput,w=t.content,$=t.locations;return{sessionUpdate:s,toolCallId:n.trim(),status:r,title:l,toolKind:h,rawOutput:p!==void 0?p:void 0,rawInput:_!==void 0?_:void 0,content:Array.isArray(w)&&w.length?w:void 0,locations:Array.isArray($)&&$.length?$:void 0}}static hasRawOutputError(i){if(i===null||typeof i!="object"||Array.isArray(i))return!1;let e=c.toPlainRecord(i);return Object.prototype.hasOwnProperty.call(e,"error")}static summarizeRawOutputError(i){if(i===null||typeof i!="object"||Array.isArray(i))return"Tool call failed";let t=c.toPlainRecord(i).error;if(typeof t=="string"&&t.trim().length)return t.trim();try{return JSON.stringify(i)}catch{return"Tool call failed"}}static summarizeRawOutputSuccess(i){if(i===void 0)return"Completed";try{let e=JSON.stringify(i),t=400;return e.length>t?`${e.substring(0,t)}\u2026`:e}catch{return"Completed"}}static formatRawInput(i){if(i==null)return"";try{return JSON.stringify(i,null,2)}catch{return String(i)}}static formatLocations(i){if(!i?.length)return"";let e=[];for(let t of i){if(t===null||typeof t!="object"||Array.isArray(t))continue;let s=c.toPlainRecord(t),n=s.path;if(typeof n!="string"||!n.length)continue;let o=s.line,r=typeof o=="number"?`:${o}`:"";e.push(`${n}${r}`)}return e.join(`
|
|
2
2
|
`)}static formatContent(i){if(!i?.length)return"";let e=[];for(let t of i){if(t===null||typeof t!="object"||Array.isArray(t))continue;let s=c.toPlainRecord(t),n=s.type;if(n==="diff"){let o=s.path,r=s.oldText,a=s.newText,d=[`--- ${typeof o=="string"?o:"(unknown)"}`];typeof r=="string"&&r.length&&d.push(`- ${r.substring(0,500)}${r.length>500?"\u2026":""}`),typeof a=="string"&&a.length&&d.push(`+ ${a.substring(0,500)}${a.length>500?"\u2026":""}`),e.push(d.join(`
|
|
3
3
|
`))}else if(n==="terminal")try{e.push(`[terminal] ${JSON.stringify(s,null,2)}`)}catch{e.push("[terminal output]")}else if(n==="content"){let o=s.parts;if(Array.isArray(o)){for(let r of o)if(r!==null&&typeof r=="object"&&!Array.isArray(r)){let a=c.toPlainRecord(r);typeof a.text=="string"&&e.push(a.text)}}}}return e.join(`
|
|
4
4
|
|
|
5
5
|
`)}static toPlainRecord(i){let e={};for(let t of Object.keys(i))e[t]=Reflect.get(i,t);return e}};var L=(()=>{class c{baseUrl=`${R.api.baseUrl}/ca-session`;http=I(K);peiContext_DS=I(q);withCcapId(e){let t=this.peiContext_DS.activeCcapId_$();return t?e.set("ccapId",t):e}createSession(e){let t=this.withCcapId(new g);return y(this.http.post(this.baseUrl,e,{params:t}))}listSessions(e){let t=this.withCcapId(new g);return e?.status&&(t=t.set("status",e.status)),e?.workspacePath&&(t=t.set("workspacePath",e.workspacePath)),e?.includeArchived&&(t=t.set("includeArchived","1")),y(this.http.get(this.baseUrl,{params:t}))}syncFromAgent(e){let t=this.withCcapId(new g);return y(this.http.post(`${this.baseUrl}/sync`,{cwd:e?.cwd},{params:t}))}getSession(e){let t=this.withCcapId(new g);return y(this.http.get(`${this.baseUrl}/${e}`,{params:t}))}sendPrompt(e){let t=this.withCcapId(new g);return y(this.http.post(`${this.baseUrl}/${e.sessionId}/prompt`,{content:e.content},{params:t}))}stopExecution(e){let t=this.withCcapId(new g);return y(this.http.post(`${this.baseUrl}/${e}/stop-execution`,{},{params:t}))}terminateSession(e){let t=this.withCcapId(new g);return y(this.http.post(`${this.baseUrl}/${e}/terminate`,{},{params:t}))}setSessionArchived(e){let t=this.withCcapId(new g);return y(this.http.patch(`${this.baseUrl}/${e.sessionId}/archive`,{isArchived:e.isArchived},{params:t}))}getSessionEvents(e){let t=this.withCcapId(new g);return e.sinceSequence!=null&&(t=t.set("sinceSequence",String(e.sinceSequence))),e.limit!=null&&(t=t.set("limit",String(e.limit))),y(this.http.get(`${this.baseUrl}/${e.sessionId}/events`,{params:t}))}hydrateSession(e){return y(this.http.post(`${this.baseUrl}/${e.sessionId}/hydrate`,{force:e.force===!0},{params:this.withCcapId(new g)}))}static \u0275fac=function(t){return new(t||c)};static \u0275prov=E({token:c,factory:c.\u0275fac,providedIn:"root"})}return c})();var fe=(()=>{class c{sessions_$=m([]);sessionsLoading_$=m(!1);sessionsLoadError_$=m(null);selectedSession_$=m(null);selectedSessionLoading_$=m(!1);selectedSessionEvents_$=m([]);sessionEventsHasMore_$=m(!1);mirrorRuntime_$=m(null);consoleMessages_$=m([]);assembledMessages_$=m([]);assembledMessagesHasMore_$=m(!1);isLoadingOlderMessages_$=m(!1);lastStatusUpdate_$=m(null);activeSessionId_$=m("");sessionDetailError_$=m(null);caSession_AS=I(L);extSessionMsg_AS=I(O);globalError_CS=I(k);socket_CS=I(D);ngZone=I(P);eventSubscription=null;reconnectSubscription=null;lastKnownEventSequence=-1;openSessionPollTimer=null;openSessionPollTargetId="";pendingOptimisticPrompts=[];sessionEventsNextSince=null;constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(e=>{this.handleSocketEvent(e)}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(e=>{if(e){let t=this.activeSessionId_$();t&&(this.socket_CS.emit("ca-session:subscribe",{sessionId:t}),this.loadAssembledMessages({sessionId:t}).catch(()=>{}))}})}ngOnDestroy(){this.stopOpenSessionPolling(),this.eventSubscription?.unsubscribe(),this.reconnectSubscription?.unsubscribe()}loadSessions(e){return f(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let t=yield this.caSession_AS.listSessions({includeArchived:e?.includeArchived}),s=t.sessions,o=(Array.isArray(s)?s:[]).map(_=>this.mapSessionRecord(this.toRecord(_)));this.sessions_$.set(o);let r=t.mirrorRuntime,a=this.toRecord(r),l=a.isAcpConnected,d=a.loadSessionSupported,h=a.isTerminalMode,p=a.isTerminalRunnerConnected;typeof l=="boolean"&&typeof d=="boolean"?this.mirrorRuntime_$.set({isAcpConnected:l,loadSessionSupported:d,isTerminalMode:h===!0,isTerminalRunnerConnected:p===!0}):this.mirrorRuntime_$.set(null)}catch(t){this.sessionsLoadError_$.set(t),this.globalError_CS.showError(t,"ca-session-list")}finally{this.sessionsLoading_$.set(!1)}})}syncFromAgent(e){return f(this,null,function*(){try{yield this.caSession_AS.syncFromAgent({cwd:e?.cwd}),yield this.loadSessions()}catch(t){throw this.globalError_CS.showError(t,"ca-session-sync"),t}})}loadSessionDetail(e){return f(this,null,function*(){this.sessionDetailError_$.set(null),this.selectedSessionLoading_$.set(!0);try{let s=(yield this.caSession_AS.getSession(e.sessionId)).session;this.selectedSession_$.set(this.mapSessionRecord(s)),this.sessionEventsNextSince=null,this.sessionEventsHasMore_$.set(!1);let n=yield this.caSession_AS.getSessionEvents({sessionId:e.sessionId,limit:200}),o=n.events.map(a=>({sessionId:typeof a.sessionId=="string"?a.sessionId:e.sessionId,eventType:typeof a.eventType=="string"?a.eventType:"",timestamp:typeof a.timestamp=="string"?a.timestamp:"",data:this.asRecord(a.data),sequence:typeof a.sequence=="number"?a.sequence:0}));this.selectedSessionEvents_$.set(o),this.sessionEventsHasMore_$.set(n.hasMore===!0);let r=n.nextSinceSequence;return this.sessionEventsNextSince=typeof r=="number"?r:null,this.lastKnownEventSequence=Math.max(-1,...this.selectedSessionEvents_$().map(a=>a.sequence??0)),this.seedConsoleFromMirrorEvents(o),this.loadAssembledMessages({sessionId:e.sessionId}).catch(()=>{}),!0}catch(t){return this.sessionDetailError_$.set(t),this.selectedSession_$.set(null),this.selectedSessionEvents_$.set([]),this.globalError_CS.showError(t,"ca-session-detail"),!1}finally{this.selectedSessionLoading_$.set(!1)}})}loadMoreSessionEvents(e){return f(this,null,function*(){let t=this.sessionEventsNextSince;if(t!=null)try{let s=yield this.caSession_AS.getSessionEvents({sessionId:e.sessionId,sinceSequence:t,limit:200}),n=s.events.map(a=>({sessionId:typeof a.sessionId=="string"?a.sessionId:e.sessionId,eventType:typeof a.eventType=="string"?a.eventType:"",timestamp:typeof a.timestamp=="string"?a.timestamp:"",data:this.asRecord(a.data),sequence:typeof a.sequence=="number"?a.sequence:0})),o=[...this.selectedSessionEvents_$(),...n];o.sort(M.compareMirrorEventsAsc),this.selectedSessionEvents_$.set(o),this.sessionEventsHasMore_$.set(s.hasMore===!0);let r=s.nextSinceSequence;this.sessionEventsNextSince=typeof r=="number"?r:null,this.lastKnownEventSequence=Math.max(this.lastKnownEventSequence,...n.map(a=>a.sequence??0))}catch(s){this.globalError_CS.showError(s,"ca-session-events-page")}})}hydrateFromAgent(e){return f(this,null,function*(){try{yield this.caSession_AS.hydrateSession({sessionId:e.sessionId,force:e.force})}catch(s){throw this.globalError_CS.showError(s,"ca-session-hydrate"),s}if(!(yield this.loadSessionDetail({sessionId:e.sessionId}))){let s=this.sessionDetailError_$();throw s instanceof Error?s:new Error("CA session detail reload after hydrate failed")}})}setActiveSessionId(e){let t=this.activeSessionId_$();t&&t!==e&&this.socket_CS.emit("ca-session:unsubscribe",{sessionId:t}),this.activeSessionId_$.set(e),e&&this.socket_CS.emit("ca-session:subscribe",{sessionId:e})}clearLiveOutput(){this.consoleMessages_$.set([]),this.lastKnownEventSequence=-1,this.pendingOptimisticPrompts.length=0}createSession(e){return f(this,null,function*(){try{let t=yield this.caSession_AS.createSession({workspacePath:e.workspacePath,label:e.label}),n=this.toRecord(t.session).sessionId,o=typeof n=="string"?n:"";return yield this.loadSessions(),o}catch(t){throw t}})}sendPrompt(e){return f(this,null,function*(){let t=`optimistic-prompt-${globalThis.crypto.randomUUID()}`;this.pendingOptimisticPrompts.push({listKey:t,text:e.content}),this.pushConsoleMessage({listKey:t,type:"prompt",text:e.content});try{yield this.caSession_AS.sendPrompt(e)}catch(s){let n=this.pendingOptimisticPrompts.findIndex(o=>o.listKey===t);throw n>=0&&this.pendingOptimisticPrompts.splice(n,1),this.pushConsoleMessage({type:"error",text:A.getErrorMessageForDisplay(s)}),this.globalError_CS.showError(s,"ca-session-prompt"),s}})}stopExecution(e){return f(this,null,function*(){try{yield this.caSession_AS.stopExecution(e)}catch(t){throw this.globalError_CS.showError(t,"ca-session-stop-execution"),t}})}terminateSession(e){return f(this,null,function*(){try{yield this.caSession_AS.terminateSession(e),yield this.loadSessions()}catch(t){throw this.globalError_CS.showError(t,"ca-session-terminate"),t}})}setSessionArchived(e){return f(this,null,function*(){try{let t=yield this.caSession_AS.setSessionArchived(e);yield this.loadSessions(),this.selectedSession_$()?.sessionId===e.sessionId&&t.session!==null&&typeof t.session=="object"&&this.selectedSession_$.set(this.mapSessionRecord(this.toRecord(t.session)))}catch(t){throw this.globalError_CS.showError(t,"ca-session-archive"),t}})}startOpenSessionPolling(e){if(this.stopOpenSessionPolling(),!e)return;this.openSessionPollTargetId=e;let t=10*v.second;this.openSessionPollTimer=globalThis.setInterval(()=>{this.runOpenSessionPollTick(e)},t)}stopOpenSessionPolling(){this.openSessionPollTimer!==null&&(globalThis.clearInterval(this.openSessionPollTimer),this.openSessionPollTimer=null),this.openSessionPollTargetId=""}pushConsoleMessage(e){let t=this.materializeConsoleLineFromPushParams({listKey:e.listKey,type:e.type,text:e.text,timestamp:e.timestamp??new Date().toISOString(),rawData:e.rawData,mirrorEventType:e.mirrorEventType,briefSubtype:e.briefSubtype,useRawBubbleKind:e.useRawBubbleKind,streamTextRole:e.streamTextRole,streamLastSequence:e.streamLastSequence,streamMessageId:e.streamMessageId,streamPartData:e.streamPartData,toolDisplayName:e.toolDisplayName,isToolCallFailedIndicator:e.isToolCallFailedIndicator}),s=this.consoleMessages_$();this.consoleMessages_$.set([...s,t])}appendConsoleMirrorEventOne(e){if(e.eventType==="ca-session-update"){let o=u.tryParseMirrorData(e.data??{});if(o!==null&&this.applyToolCallMirrorEventToLiveConsole({ev:e,parsed:o}))return}let t=T.buildFromMirrorEvent(e);if(t===null||(e.eventType==="prompt-sent"&&t.consoleType==="prompt"&&this.removePendingOptimisticPromptBubbleIfTextMatchesMirror(t.bodyText),this.consoleMessages_$().some(o=>o.listKey===t.listKey))||t.isStreamingTextChunk===!0&&this.tryMergeStreamingMirrorChunkIntoConsole({ev:e,brief:t}))return;let n=typeof e.timestamp=="string"&&e.timestamp.length?e.timestamp:new Date().toISOString();this.pushConsoleMessage(this.buildConsolePushParamsFromBrief({ev:e,brief:t,timestampIso:n}))}tryMergeStreamingMirrorChunkIntoConsole(e){let t=this.consoleMessages_$();if(t.length===0)return!1;let s=t[t.length-1],n=C.parseStreamChunkFromMirrorData(e.ev.data??{});if(n===null||!C.canMergeConsoleTailWithChunk({prev:s,ev:e.ev,parsed:n}))return!1;let o=s.streamPartData!==void 0?[...s.streamPartData]:[];o.push(e.ev.data??{});let r=e.brief.streamMessageId,a=r!==void 0&&r.trim().length>0?r.trim():s.streamMessageId,l=b(S({},s),{text:s.text+e.brief.bodyText,streamLastSequence:e.ev.sequence??s.streamLastSequence,streamMessageId:a,streamPartData:o,rawData:{streamMerged:!0,partCount:o.length,lastChunkSequence:e.ev.sequence,chunkSnapshots:o}}),d=[...t];return d[d.length-1]=l,this.consoleMessages_$.set(d),!0}buildConsolePushParamsFromBrief(e){let t=e.brief;return t.isStreamingTextChunk===!0?{listKey:t.listKey,type:t.consoleType,text:t.bodyText,timestamp:e.timestampIso,rawData:t.rawData,mirrorEventType:t.mirrorEventType,briefSubtype:t.briefSubtype,useRawBubbleKind:t.useRawBubbleKind,streamTextRole:t.streamTextRole,streamLastSequence:e.ev.sequence,streamMessageId:t.streamMessageId,streamPartData:[e.ev.data??{}]}:{listKey:t.listKey,type:t.consoleType,text:t.bodyText,timestamp:e.timestampIso,rawData:t.rawData,mirrorEventType:t.mirrorEventType,briefSubtype:t.briefSubtype,useRawBubbleKind:t.useRawBubbleKind}}buildFoldedConsoleMessagesFromMirrorEvents(e){let t=[];for(let s of e){if(this.tryFoldToolCallMirrorEventIntoOut(t,s))continue;let o=T.buildFromMirrorEvent(s);if(o===null)continue;let r=typeof s.timestamp=="string"&&s.timestamp.length?s.timestamp:new Date().toISOString();if(o.isStreamingTextChunk===!0){let a=C.parseStreamChunkFromMirrorData(s.data??{});if(a===null)continue;let l=t.length>0?t[t.length-1]:void 0;if(l!==void 0&&C.canMergeConsoleTailWithChunk({prev:l,ev:s,parsed:a})){let d=l.streamPartData!==void 0?[...l.streamPartData]:[];d.push(s.data??{});let h=o.streamMessageId,p=h!==void 0&&h.trim().length>0?h.trim():l.streamMessageId;t[t.length-1]=b(S({},l),{text:l.text+o.bodyText,streamLastSequence:s.sequence??l.streamLastSequence,streamMessageId:p,streamPartData:d,rawData:{streamMerged:!0,partCount:d.length,lastChunkSequence:s.sequence,chunkSnapshots:d}})}else t.push(this.materializeConsoleLineFromPushParams(this.buildConsolePushParamsFromBrief({ev:s,brief:o,timestampIso:r})))}else t.push(this.materializeConsoleLineFromPushParams(this.buildConsolePushParamsFromBrief({ev:s,brief:o,timestampIso:r})))}return t}materializeConsoleLineFromPushParams(e){return{listKey:e.listKey??globalThis.crypto.randomUUID(),type:e.type,text:e.text,timestamp:e.timestamp,rawData:e.rawData,mirrorEventType:e.mirrorEventType,briefSubtype:e.briefSubtype,useRawBubbleKind:e.useRawBubbleKind,streamTextRole:e.streamTextRole,streamLastSequence:e.streamLastSequence,streamMessageId:e.streamMessageId,streamPartData:e.streamPartData,toolDisplayName:e.toolDisplayName,isToolCallFailedIndicator:e.isToolCallFailedIndicator}}applyToolCallMirrorEventToLiveConsole(e){let t=e.parsed,s=t.toolCallId,n=typeof e.ev.timestamp=="string"&&e.ev.timestamp.length?e.ev.timestamp:new Date().toISOString(),o=e.ev.data??{};if(t.sessionUpdate==="tool_call"){let r=u.listKeyStart(s);if(this.consoleMessages_$().some(h=>h.listKey===r))return!0;let l=c.toolCallDisplayName(t),d=c.buildToolCallBodyText({displayName:l,parsed:t});return this.pushConsoleMessage({listKey:r,type:"tool",text:d,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call",toolDisplayName:l}),!0}if(t.sessionUpdate==="tool_call_update"&&t.status==="in_progress"){t.rawInput!==void 0&&this.patchLiveToolCallStartInput({toolCallId:s,parsed:t});let r=u.listKeyProgress(s),a="in_progress",l=this.consoleMessages_$(),d=l.findIndex(p=>p.listKey===r),h=this.materializeConsoleLineFromPushParams({listKey:r,type:"status-update",text:a,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"});if(d>=0){let p=[...l];p[d]=h,this.consoleMessages_$.set(p)}else this.consoleMessages_$.set([...l,h]);return!0}if(t.sessionUpdate==="tool_call_update"&&t.status==="completed"){if(u.hasRawOutputError(t.rawOutput)){let d=u.listKeyError(s);if(!this.consoleMessages_$().some(p=>p.listKey===d)){let p=u.summarizeRawOutputError(t.rawOutput);this.pushConsoleMessage({listKey:d,type:"error",text:p,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"}),this.patchLiveConsoleToolCallStartFailed({toolCallId:s})}return!0}let a=u.listKeyResult(s);if(!this.consoleMessages_$().some(d=>d.listKey===a)){let d=u.summarizeRawOutputSuccess(t.rawOutput);this.pushConsoleMessage({listKey:a,type:"tool-result",text:d,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"})}return!0}return!1}tryFoldToolCallMirrorEventIntoOut(e,t){if(t.eventType!=="ca-session-update")return!1;let s=u.tryParseMirrorData(t.data??{});if(s===null)return!1;let n=typeof t.timestamp=="string"&&t.timestamp.length?t.timestamp:new Date().toISOString(),o=t.data??{};if(s.sessionUpdate==="tool_call"){let r=u.listKeyStart(s.toolCallId);if(!e.some(l=>l.listKey===r)){let l=c.toolCallDisplayName(s),d=c.buildToolCallBodyText({displayName:l,parsed:s});e.push(this.materializeConsoleLineFromPushParams({listKey:r,type:"tool",text:d,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call",toolDisplayName:l}))}return!0}if(s.sessionUpdate==="tool_call_update"&&s.status==="in_progress"){s.rawInput!==void 0&&c.patchOutArrayToolCallStartInput(e,s);let r=u.listKeyProgress(s.toolCallId),a=this.materializeConsoleLineFromPushParams({listKey:r,type:"status-update",text:"in_progress",timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"}),l=e.findIndex(d=>d.listKey===r);return l>=0?e[l]=a:e.push(a),!0}if(s.sessionUpdate==="tool_call_update"&&s.status==="completed"){if(u.hasRawOutputError(s.rawOutput)){let d=u.listKeyError(s.toolCallId);if(!e.some(p=>p.listKey===d)){let p=u.summarizeRawOutputError(s.rawOutput);e.push(this.materializeConsoleLineFromPushParams({listKey:d,type:"error",text:p,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"})),c.patchOutArrayToolCallStartFailed(e,s.toolCallId)}return!0}let a=u.listKeyResult(s.toolCallId);if(!e.some(d=>d.listKey===a)){let d=u.summarizeRawOutputSuccess(s.rawOutput);e.push(this.materializeConsoleLineFromPushParams({listKey:a,type:"tool-result",text:d,timestamp:n,rawData:o,mirrorEventType:"ca-session-update",briefSubtype:"tool_call_update"}))}return!0}return!1}patchLiveToolCallStartInput(e){let t=u.listKeyStart(e.toolCallId),s=this.consoleMessages_$(),n=s.findIndex(l=>l.listKey===t);if(n<0)return;let o=s[n].toolDisplayName??"Tool call",r=c.buildToolCallBodyText({displayName:o,parsed:e.parsed}),a=[...s];a[n]=b(S({},a[n]),{text:r}),this.consoleMessages_$.set(a)}patchLiveConsoleToolCallStartFailed(e){let t=u.listKeyStart(e.toolCallId),s=this.consoleMessages_$(),n=s.findIndex(r=>r.listKey===t);if(n<0)return;let o=[...s];o[n]=b(S({},o[n]),{isToolCallFailedIndicator:!0}),this.consoleMessages_$.set(o)}static patchOutArrayToolCallStartFailed(e,t){let s=u.listKeyStart(t),n=e.findIndex(o=>o.listKey===s);n<0||(e[n]=b(S({},e[n]),{isToolCallFailedIndicator:!0}))}static patchOutArrayToolCallStartInput(e,t){let s=u.listKeyStart(t.toolCallId),n=e.findIndex(a=>a.listKey===s);if(n<0)return;let o=e[n].toolDisplayName??"Tool call",r=c.buildToolCallBodyText({displayName:o,parsed:t});e[n]=b(S({},e[n]),{text:r})}static toolCallDisplayName(e){return e.title!==void 0&&e.title.length?e.title:e.toolKind!==void 0&&e.toolKind.length?e.toolKind:"Tool call"}static buildToolCallBodyText(e){let t=[e.displayName],s=u.formatRawInput(e.parsed.rawInput);s.length&&t.push(s);let n=u.formatLocations(e.parsed.locations);return n.length&&t.push(`[locations]
|
|
6
6
|
${n}`),t.join(`
|
|
7
7
|
`)}runOpenSessionPollTick(e){return f(this,null,function*(){if(!(e!==this.activeSessionId_$()||e!==this.openSessionPollTargetId))try{let t=yield this.caSession_AS.getSession(e);this.ngZone.run(()=>{e===this.activeSessionId_$()&&this.selectedSession_$.set(this.mapSessionRecord(this.toRecord(t.session)))});let s=this.lastKnownEventSequence,o=(yield this.caSession_AS.getSessionEvents({sessionId:e,sinceSequence:s>=0?s:void 0,limit:200})).events.map(r=>({sessionId:typeof r.sessionId=="string"?r.sessionId:e,eventType:typeof r.eventType=="string"?r.eventType:"",timestamp:typeof r.timestamp=="string"?r.timestamp:"",data:this.asRecord(r.data),sequence:typeof r.sequence=="number"?r.sequence:0}));if(!o.length)return;this.ngZone.run(()=>{if(e!==this.activeSessionId_$())return;let r=new Map;for(let l of this.selectedSessionEvents_$())r.set(l.sequence??0,l);for(let l of o)r.set(l.sequence??0,l);let a=[...r.values()].sort(M.compareMirrorEventsAsc);this.selectedSessionEvents_$.set(a);for(let l of o)(l.sequence??0)>s&&this.appendConsoleMirrorEventOne(l);this.lastKnownEventSequence=Math.max(s,...o.map(l=>l.sequence??0))})}catch{}})}handleSocketEvent(e){let t=e.event,s=e.payload;try{this.ngZone.run(()=>{switch(t){case"ca-session:status":this.handleStatusUpdate(s);break;case"ca-session:output":this.handleOutputChunk(s);break;case"ca-session:event":this.handleSessionEvent(s);break;case"ca-session:list-update":this.loadSessions().catch(()=>{});break;case"ext-session-msg:message":this.handleAssembledMessage(s);break;case"ext-session-msg:update":this.handleAssembledMessageUpdate(s);break;default:break}})}catch(n){v.DyFM_Log.error(`CCAP_CaSession_DS | socket error | ${t}`,n)}}handleStatusUpdate(e){let t=typeof e.sessionId=="string"?e.sessionId:"",s=typeof e.status=="string"?e.status:"",n=typeof e.statusMessage=="string"?e.statusMessage:void 0;this.lastStatusUpdate_$.set({sessionId:t,status:s,statusMessage:n});let o=this.sessions_$();this.sessions_$.set(o.map(a=>a.sessionId===t?b(S({},a),{status:s,statusMessage:n}):a));let r=this.selectedSession_$();r?.sessionId===t&&this.selectedSession_$.set(b(S({},r),{status:s,statusMessage:n})),s==="errored"&&this.globalError_CS.showError(new Error(n?`CA session error: ${n}`:"CA session errored"),"ca-session-status")}handleOutputChunk(e){let t=typeof e.sessionId=="string"?e.sessionId:"";if(t&&t!==this.activeSessionId_$())return;let s=typeof e.content=="string"?e.content:"",n=typeof e.type=="string"?e.type:"response";if(s){let o={};for(let r of Object.keys(e))o[r]=Reflect.get(e,r);this.pushConsoleMessage({type:n==="error"?"error":"assistant",text:s,rawData:o,mirrorEventType:"ca-session:output"})}}handleSessionEvent(e){let t=typeof e.sessionId=="string"?e.sessionId:"";if(t&&t!==this.activeSessionId_$())return;let s=this.asRecord(e.event),n=typeof s.sequence=="number"?s.sequence:0;if(n<=this.lastKnownEventSequence)return;this.lastKnownEventSequence=n;let o=s.timestamp,r={sessionId:t,eventType:typeof s.eventType=="string"?s.eventType:"",timestamp:typeof o=="string"&&o.length?o:new Date().toISOString(),data:this.asRecord(s.data),sequence:n},a=this.selectedSessionEvents_$();this.selectedSessionEvents_$.set([...a,r]),this.appendConsoleMirrorEventOne(r)}seedConsoleFromMirrorEvents(e){this.pendingOptimisticPrompts.length=0;let t=[...e].sort(M.compareMirrorEventsAsc);this.consoleMessages_$.set(this.buildFoldedConsoleMessagesFromMirrorEvents(t))}removePendingOptimisticPromptBubbleIfTextMatchesMirror(e){let t=this.pendingOptimisticPrompts.findIndex(o=>o.text===e||o.text.trim()===e.trim());if(t<0)return;let s=this.pendingOptimisticPrompts[t];this.pendingOptimisticPrompts.splice(t,1);let n=this.consoleMessages_$().filter(o=>o.listKey!==s.listKey);this.consoleMessages_$.set(n)}mapSessionRecord(e){return{sessionId:typeof e.sessionId=="string"?e.sessionId:void 0,acpSessionId:typeof e.acpSessionId=="string"?e.acpSessionId:void 0,label:typeof e.label=="string"?e.label:void 0,workspacePath:typeof e.workspacePath=="string"?e.workspacePath:void 0,status:typeof e.status=="string"?e.status:void 0,statusMessage:typeof e.statusMessage=="string"?e.statusMessage:void 0,promptCount:typeof e.promptCount=="number"?e.promptCount:void 0,lastPrompt:typeof e.lastPrompt=="string"?e.lastPrompt:void 0,lastActivityAt:typeof e.lastActivityAt=="string"?e.lastActivityAt:void 0,isArchived:e.isArchived===!0,parentSessionId:typeof e.parentSessionId=="string"?e.parentSessionId:void 0,lastSyncAt:typeof e.lastSyncAt=="string"?e.lastSyncAt:void 0,lastSyncError:typeof e.lastSyncError=="string"?e.lastSyncError:void 0,agentInfoName:typeof e.agentInfoName=="string"?e.agentInfoName:void 0,agentInfoVersion:typeof e.agentInfoVersion=="string"?e.agentInfoVersion:void 0,isAcpConnected:typeof e.isAcpConnected=="boolean"?e.isAcpConnected:void 0,loadSessionSupported:typeof e.loadSessionSupported=="boolean"?e.loadSessionSupported:void 0,isTerminalMode:typeof e.isTerminalMode=="boolean"?e.isTerminalMode:void 0,isTerminalRunnerConnected:typeof e.isTerminalRunnerConnected=="boolean"?e.isTerminalRunnerConnected:void 0}}asRecord(e){return this.toRecord(e)}toRecord(e){if(e!==null&&typeof e=="object"&&!Array.isArray(e)){let t={};for(let s of Object.keys(e))t[s]=Reflect.get(e,s);return t}return{}}loadAssembledMessages(e){return f(this,null,function*(){try{let t=yield this.extSessionMsg_AS.getMessages({sessionId:e.sessionId,latest:!0});this.assembledMessages_$.set(t.messages),this.assembledMessagesHasMore_$.set(t.hasMore===!0)}catch(t){v.DyFM_Log.error(`CCAP_CaSession_DS | loadAssembledMessages failed | sessionId: ${e.sessionId}`,t)}})}loadOlderAssembledMessages(e){return f(this,null,function*(){if(this.isLoadingOlderMessages_$()||!this.assembledMessagesHasMore_$())return;let t=this.assembledMessages_$();if(!t.length)return;let s=t.reduce((n,o)=>(o.sequence??0)<n?o.sequence??0:n,t[0].sequence??0);this.isLoadingOlderMessages_$.set(!0);try{let n=yield this.extSessionMsg_AS.getMessages({sessionId:e.sessionId,beforeSequence:s,limit:e.limit??50});n.messages.length&&this.assembledMessages_$.set([...n.messages,...t]),this.assembledMessagesHasMore_$.set(n.hasMore===!0)}catch(n){v.DyFM_Log.error(`CCAP_CaSession_DS | loadOlderAssembledMessages failed | sessionId: ${e.sessionId}`,n)}finally{this.isLoadingOlderMessages_$.set(!1)}})}handleAssembledMessage(e){let t=typeof e.sessionId=="string"?e.sessionId:"";if(!t||t!==this.activeSessionId_$())return;let s=e.message;if(!s||typeof s!="object")return;let n=s,o=this.assembledMessages_$();this.assembledMessages_$.set([...o,n])}handleAssembledMessageUpdate(e){let t=typeof e.sessionId=="string"?e.sessionId:"";if(!t||t!==this.activeSessionId_$())return;let s=typeof e.messageKey=="string"?e.messageKey:"";if(!s)return;let n=e.update;if(!n||typeof n!="object")return;let o=n,r=this.assembledMessages_$(),a=r.findIndex(h=>h.messageKey===s);if(a<0)return;let l=S({},r[a]);typeof o.bodyText=="string"&&(l.bodyText=o.bodyText),o.toolResult!==void 0&&(l.toolResult=o.toolResult),typeof o.toolStatus=="string"&&(l.toolStatus=o.toolStatus),o.headerStatusDot!==void 0&&(l.headerStatusDot=typeof o.headerStatusDot=="string"?o.headerStatusDot:void 0);let d=[...r];d[a]=l,this.assembledMessages_$.set(d)}static \u0275fac=function(t){return new(t||c)};static \u0275prov=E({token:c,factory:c.\u0275fac,providedIn:"root"})}return c})();export{M as a,C as b,x as c,u as d,fe as e};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-J772S2PU.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as O}from"./chunk-
|
|
1
|
+
import{a as O}from"./chunk-3J5EVPQU.js";import{a as K}from"./chunk-ND5WRBGC.js";import{e as F}from"./chunk-KNBMYOHX.js";import{h as f,j as U}from"./chunk-G3LGRE4Z.js";import{I as D,p as H}from"./chunk-KPYMFKWR.js";import{C as _,R as k,a as I,aa as u,b as C,d as L,h as N,k as d,p as h,vb as g,xb as P,y as v}from"./chunk-TBMJSIBB.js";var A=N(H());var w=(()=>{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(s,t){for(let e of t){let n=s[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 s=y.response._firstSessionKeys,t=Array.isArray(s)?s:[],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:t}}static mapRawSessionToListItem(y){let s=y.raw;return{sessionId:typeof s.key=="string"?s.key:typeof s.sessionId=="string"?s.sessionId:typeof s.id=="string"?s.id:String(s.key??s.sessionId??s.id??""),label:typeof s.label=="string"?s.label:typeof s.name=="string"?s.name:typeof s.title=="string"?s.title:void 0,workspacePath:typeof s.workspacePath=="string"?s.workspacePath:typeof s.cwd=="string"?s.cwd:"",status:typeof s.status=="string"?s.status:"unknown",statusMessage:typeof s.statusMessage=="string"?s.statusMessage:void 0,gatewayUrl:y.gatewayUrl,openclawAgentName:typeof s.agentName=="string"?s.agentName:typeof s.agent=="string"?s.agent:void 0,promptCount:typeof s.promptCount=="number"?s.promptCount:typeof s.messageCount=="number"?s.messageCount:0,toolCallCount:typeof s.toolCallCount=="number"?s.toolCallCount:0,lastActivityAt:w.extractTimestamp(s,w.GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES),startedAt:w.extractTimestamp(s,w.GATEWAY_SESSION_STARTED_FIELD_NAMES),lastPrompt:typeof s.lastPrompt=="string"?s.lastPrompt:void 0,mode:typeof s.mode=="string"?s.mode:void 0,reasoningEffort:typeof s.reasoningEffort=="string"?s.reasoningEffort:typeof s.thinking=="string"?s.thinking:void 0,isArchived:typeof s.isArchived=="boolean"?s.isArchived:!1}}static sortListItemsByLastActivityDesc(y){return[...y.items].sort((s,t)=>{let e=s.lastActivityAt?new Date(s.lastActivityAt).getTime():0;return(t.lastActivityAt?new Date(t.lastActivityAt).getTime():0)-e})}};var G=(()=>{class l{baseUrl=`${D.api.baseUrl}/oc-session`;http=_(P);peiContext_DS=_(K);withCcapId(s){let t=this.peiContext_DS.activeCcapId_$();return t?s.set("ccapId",t):s}createSession(s){let t=this.withCcapId(new g);return h(this.http.post(this.baseUrl,s,{params:t}))}listSessions(s){let t=this.withCcapId(new g);return s?.status&&(t=t.set("status",s.status)),s?.workspacePath&&(t=t.set("workspacePath",s.workspacePath)),s?.gatewayUrl&&(t=t.set("gatewayUrl",s.gatewayUrl)),s?.includeArchived&&(t=t.set("includeArchived","1")),s?.limit!=null&&(t=t.set("limit",String(s.limit))),s?.offset!=null&&(t=t.set("offset",String(s.offset))),h(this.http.get(this.baseUrl,{params:t}))}listGatewaySessions(s){let t=new g().set("instanceId",s.instanceId);return h(this.http.get(`${this.baseUrl}/gateway-sessions`,{params:t}))}getGatewaySessionHistory(s){let t=new g().set("instanceId",s.instanceId);return h(this.http.get(`${this.baseUrl}/gateway-sessions/${s.sessionId}/history`,{params:t}))}sendGatewayPrompt(s){return h(this.http.post(`${this.baseUrl}/gateway-sessions/${s.sessionId}/send`,{instanceId:s.instanceId,content:s.content,agentName:s.agentName}))}abortGatewaySession(s){return h(this.http.post(`${this.baseUrl}/gateway-sessions/${s.sessionId}/abort`,{instanceId:s.instanceId}))}deleteGatewaySession(s){let t=new g().set("instanceId",s.instanceId);return h(this.http.delete(`${this.baseUrl}/gateway-sessions/${s.sessionId}`,{params:t}))}getSession(s){let t=this.withCcapId(new g);return h(this.http.get(`${this.baseUrl}/${s.sessionId}`,{params:t}))}sendPrompt(s){let t=this.withCcapId(new g);return h(this.http.post(`${this.baseUrl}/${s.sessionId}/prompt`,{content:s.content},{params:t}))}reconnectSession(s){let t=this.withCcapId(new g);return h(this.http.post(`${this.baseUrl}/${s.sessionId}/reconnect`,{},{params:t}))}stopExecution(s){let t=this.withCcapId(new g);return h(this.http.post(`${this.baseUrl}/${s.sessionId}/stop-execution`,{},{params:t}))}terminateSession(s){let t=this.withCcapId(new g);return h(this.http.post(`${this.baseUrl}/${s.sessionId}/terminate`,{},{params:t}))}updateSessionConfig(s){let o=s,{sessionId:t}=o,e=L(o,["sessionId"]),n=this.withCcapId(new g);return h(this.http.patch(`${this.baseUrl}/${t}/config`,e,{params:n}))}setSessionArchived(s){let t=this.withCcapId(new g);return h(this.http.patch(`${this.baseUrl}/${s.sessionId}/archive`,{isArchived:s.isArchived},{params:t}))}getSessionEvents(s){let t=this.withCcapId(new g);return s.eventType&&(t=t.set("eventType",s.eventType)),s.since&&(t=t.set("since",s.since)),s.sinceSequence!=null&&(t=t.set("sinceSequence",String(s.sinceSequence))),s.limit!=null&&(t=t.set("limit",String(s.limit))),s.offset!=null&&(t=t.set("offset",String(s.offset))),s.latest&&(t=t.set("latest","1")),h(this.http.get(`${this.baseUrl}/${s.sessionId}/events`,{params:t}))}getSessionEventStreamUrl(s){let t=`${this.baseUrl}/${s.sessionId}/events/stream`,e=this.peiContext_DS.activeCcapId_$();return e?`${t}?ccapId=${encodeURIComponent(e)}`:t}static \u0275fac=function(t){return new(t||l)};static \u0275prov=v({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();var ls=(()=>{class l{sessions_$=u([]);sessionsLoading_$=u(!1);sessionsLoadError_$=u(null);selectedSession_$=u(null);selectedSessionLoading_$=u(!1);selectedSessionEvents_$=u([]);consoleMessages_$=u([]);assembledMessages_$=u([]);assembledMessagesHasMore_$=u(!1);isLoadingOlderMessages_$=u(!1);lastStatusUpdate_$=u(null);sessionUsage_$=u({inputTokens:0,outputTokens:0,costUsd:0});activeSessionId_$=u("");activeInstanceId_$=u("");gatewayFilter_$=u(null);extSessionMsg_AS=_(O);ocSession_AS=_(G);globalError_CS=_(U);socket_CS=_(F);ngZone=_(k);eventSubscription=null;reconnectSubscription=null;lastKnownEventSequence=-1;chatPollHandle=null;detailPollHandle=null;lastPolledHistoryFingerprint="";constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(s=>{this.handleSocketEvent(s)}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(s=>{if(s){let t=this.activeSessionId_$();t&&(this.socket_CS.emit("oc-session:subscribe",{sessionId:t}),this.loadAssembledMessages({sessionId:t}).catch(()=>{})),this.backfillMissedEvents()}})}ngOnDestroy(){this.stopChatPolling(),this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null),this.reconnectSubscription&&(this.reconnectSubscription.unsubscribe(),this.reconnectSubscription=null)}setGatewayFilter(s){this.gatewayFilter_$.set(s),this.loadSessions().catch(()=>{})}setGatewayFilterOnly(s){this.gatewayFilter_$.set(s)}loadSessions(s){return d(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let e=[...(yield this.ocSession_AS.listSessions({status:s?.status,workspacePath:s?.workspacePath,gatewayUrl:this.gatewayFilter_$()??void 0,includeArchived:s?.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(t){this.sessionsLoadError_$.set(t),this.pushConsoleMessage({type:"error",text:`Load sessions failed: ${f.getErrorMessageForDisplay(t)}`})}finally{this.sessionsLoading_$.set(!1)}})}fetchGatewaySessionsForInstance(s){return d(this,null,function*(){let t=yield this.ocSession_AS.listGatewaySessions({instanceId:s.instanceId});return E.buildGatewaySessionsFetch({response:t})})}loadGatewaySessions(s){return d(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let t=yield this.fetchGatewaySessionsForInstance({instanceId:s.instanceId});!t.listItems.length&&t.rawSessions.length>0&&this.pushConsoleMessage({type:"error",text:`Gateway returned ${t.rawSessions.length} sessions but mapping produced 0.
|
|
2
2
|
First session keys: ${t.firstSessionKeys.join(", ")}`}),this.sessions_$.set(t.listItems)}catch(t){this.sessionsLoadError_$.set(t),this.pushConsoleMessage({type:"error",text:`Load gateway sessions failed: ${f.getErrorMessageForDisplay(t)}`})}finally{this.sessionsLoading_$.set(!1)}})}loadSessionDetail(s){return d(this,null,function*(){let t=s.isSilent===!0;t||this.selectedSessionLoading_$.set(!0);try{let e=yield this.ocSession_AS.getSession({sessionId:s.sessionId});this.selectedSession_$.set(e),this.loadAssembledMessages({sessionId:s.sessionId}).catch(()=>{})}catch(e){if(!t){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{t||this.selectedSessionLoading_$.set(!1)}})}loadGatewaySessionHistory(s){return d(this,null,function*(){this.selectedSessionLoading_$.set(!0),this.consoleMessages_$.set([]);try{let t=yield this.ocSession_AS.getGatewaySessionHistory({sessionId:s.sessionId,instanceId:s.instanceId}),e=t,n=Array.isArray(e._rawKeys)?e._rawKeys:[],o=Array.isArray(t.history)?t.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:s.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(t){this.selectedSession_$.set(null),this.pushConsoleMessage({type:"error",text:`Load gateway session history failed: ${f.getErrorMessageForDisplay(t)}`})}finally{this.selectedSessionLoading_$.set(!1)}})}loadSessionEvents(s){return d(this,null,function*(){try{let t=yield this.ocSession_AS.getSessionEvents({sessionId:s.sessionId,eventType:s.eventType,limit:s.limit??500,latest:!0});this.selectedSessionEvents_$.set(t.events),this.updateLastKnownSequence(t.events);for(let e of t.events)this.pushConsoleMessageFromEvent(e)}catch(t){this.selectedSessionEvents_$.set([]),this.pushConsoleMessage({type:"error",text:`Load events failed: ${f.getErrorMessageForDisplay(t)}`})}})}createSession(s){return d(this,null,function*(){try{let t=yield this.ocSession_AS.createSession(s),e=String(t.session.sessionId||"");return yield this.loadSessions(),e}catch(t){throw this.pushConsoleMessage({type:"error",text:`Create session failed: ${f.getErrorMessageForDisplay(t)}`}),t}})}sendPrompt(s){return d(this,null,function*(){this.pushConsoleMessage({type:"prompt",text:s.content});try{let t=this.activeInstanceId_$();t?yield this.ocSession_AS.sendGatewayPrompt({sessionId:s.sessionId,instanceId:t,content:s.content}):yield this.ocSession_AS.sendPrompt(s)}catch(t){throw this.pushConsoleMessage({type:"error",text:`Send failed: ${f.getErrorMessageForDisplay(t)}`}),t}})}reconnectSession(s){return d(this,null,function*(){try{yield this.ocSession_AS.reconnectSession(s),yield this.loadSessions()}catch(t){throw this.pushConsoleMessage({type:"error",text:`Reconnect failed: ${f.getErrorMessageForDisplay(t)}`}),t}})}stopExecution(s){return d(this,null,function*(){try{yield this.ocSession_AS.stopExecution(s)}catch(t){throw this.pushConsoleMessage({type:"error",text:`Stop execution failed: ${f.getErrorMessageForDisplay(t)}`}),t}})}terminateSession(s){return d(this,null,function*(){try{yield this.ocSession_AS.terminateSession(s),yield this.loadSessions()}catch(t){throw this.pushConsoleMessage({type:"error",text:`Terminate failed: ${f.getErrorMessageForDisplay(t)}`}),t}})}setSessionArchived(s){return d(this,null,function*(){try{yield this.ocSession_AS.setSessionArchived(s),yield this.loadSessions()}catch(t){throw this.pushConsoleMessage({type:"error",text:`Archive failed: ${f.getErrorMessageForDisplay(t)}`}),t}})}updateSessionConfig(s){return d(this,null,function*(){try{yield this.ocSession_AS.updateSessionConfig(s);let t=this.selectedSession_$();if(t?.session.sessionId===s.sessionId){let e=I({},t.session);s.mode!=null&&(e.mode=s.mode),s.reasoningEffort!=null&&(e.reasoningEffort=s.reasoningEffort),s.openclawAgentName!=null&&(e.openclawAgentName=s.openclawAgentName),this.selectedSession_$.set(C(I({},t),{session:e}))}}catch(t){throw this.pushConsoleMessage({type:"error",text:`Config update failed: ${f.getErrorMessageForDisplay(t)}`}),t}})}setActiveSessionId(s){let t=this.activeSessionId_$();t&&t!==s&&this.socket_CS.emit("oc-session:unsubscribe",{sessionId:t}),this.activeSessionId_$.set(s),s&&this.socket_CS.emit("oc-session:subscribe",{sessionId:s})}clearLiveOutput(){this.stopChatPolling(),this.consoleMessages_$.set([]),this.sessionUsage_$.set({inputTokens:0,outputTokens:0,costUsd:0}),this.lastKnownEventSequence=-1}allocateConsoleListKey(){return globalThis.crypto.randomUUID()}pushConsoleMessage(s){let t=s.type==="assistant"||s.type==="prompt"?s.text.trim():s.text,e={listKey:s.listKey??this.allocateConsoleListKey(),type:s.type,text:t,timestamp:s.timestamp??new Date().toISOString(),expandableContent:s.expandableContent,rawData:s.rawData},n=this.consoleMessages_$();this.consoleMessages_$.set([...n,e])}static CHAT_POLL_INTERVAL_MS=5*A.second;static DETAIL_POLL_INTERVAL_MS=10*A.second;startChatPolling(){this.stopChatPolling(),this.chatPollHandle=setInterval(()=>{this.pollChatHistory()},l.CHAT_POLL_INTERVAL_MS),this.detailPollHandle=setInterval(()=>{let s=this.activeSessionId_$();s&&this.loadSessionDetail({sessionId:s,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(s){let t=s.length;if(!t)return"0";let e=s[t-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`${t}${n}${o}${r}`}pollChatHistory(){return d(this,null,function*(){let s=this.activeSessionId_$(),t=this.activeInstanceId_$();if(!(!s||!t))try{let e=yield this.ocSession_AS.getGatewaySessionHistory({sessionId:s,instanceId:t}),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(s){let t=[],e=new Map,n=[];for(let i of s){let a=i.content;if(Array.isArray(a))for(let r of a){let p=typeof r.type=="string"?r.type:"";if(p==="tool_use"||p==="toolCall"){let S=typeof r.id=="string"?r.id:"";S&&n.push(S)}if(p==="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 s){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 s){let a=typeof i.role=="string"?i.role:"unknown",r=i.content,p=l.extractGatewayChatMessageTimestamp(i);if(a==="toolResult"||a==="tool_result")continue;if(typeof r=="string"){t.push({listKey:this.allocateConsoleListKey(),type:a==="user"||a==="human"?"prompt":a==="assistant"?"assistant":"info",text:r,timestamp:p,rawData:i});continue}if(Array.isArray(r)){for(let c of r){let M=typeof c.type=="string"?c.type:"";if(M==="text")t.push({listKey:this.allocateConsoleListKey(),type:a==="user"||a==="human"?"prompt":"assistant",text:typeof c.text=="string"?c.text:"",timestamp:p,rawData:{_block:c,_message:{role:a,timestamp:p,contentBlockCount:r.length}}});else if(M==="tool_use"||M==="toolCall"){let b=typeof c.name=="string"?c.name:"unknown tool",T=typeof c.id=="string"?c.id:"",m=c.input??c.arguments,$=e.get(T);t.push({listKey:this.allocateConsoleListKey(),type:"tool",text:`${b}
|
|
@@ -6,4 +6,4 @@ ${JSON.stringify(m,null,2)}`,timestamp:p,expandableContent:$,rawData:{_block:c,_
|
|
|
6
6
|
`):$=JSON.stringify(c,null,2),t.push({listKey:this.allocateConsoleListKey(),type:"tool-result",text:$,timestamp:p,rawData:{_block:c}})}}else M==="thinking"?t.push({listKey:this.allocateConsoleListKey(),type:"info",text:typeof c.thinking=="string"?c.thinking:JSON.stringify(c,null,2),timestamp:p,rawData:{_block:c}}):t.push({listKey:this.allocateConsoleListKey(),type:"info",text:JSON.stringify(c,null,2),timestamp:p,rawData:{_block:c}})}continue}let S=typeof i.text=="string"?i.text:typeof i.message=="string"?i.message:JSON.stringify(i,null,2);t.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:p,rawData:i})}return t}backfillMissedEvents(){return d(this,null,function*(){let s=this.activeSessionId_$();if(!(!s||this.lastKnownEventSequence<0))try{let e=(yield this.ocSession_AS.getSessionEvents({sessionId:s,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(t){A.DyFM_Log.warn("CCAP_OcSession_DS | backfill failed",t)}})}updateLastKnownSequence(s){for(let t of s)t.sequence>this.lastKnownEventSequence&&(this.lastKnownEventSequence=t.sequence)}handleSocketEvent(s){let t=s.event,e=s.payload;try{this.ngZone.run(()=>{switch(t){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){A.DyFM_Log.error(`CCAP_OcSession_DS | socket event error | event: ${t}`,n)}}handleStatusUpdate(s){let t=s.sessionId??"",e=s.status??"",n=s.statusMessage;this.lastStatusUpdate_$.set({sessionId:t,status:e,statusMessage:n});let i=this.sessions_$().map(r=>r.sessionId===t?C(I({},r),{status:e,statusMessage:n}):r);this.sessions_$.set(i);let a=this.selectedSession_$();if(a?.session.sessionId===t){let r=e==="running"||e==="waiting-input";this.selectedSession_$.set(C(I({},a),{session:C(I({},a.session),{status:e,statusMessage:n}),runtime:C(I({},a.runtime),{isLive:r,runtimeStatus:e})}))}if(e==="errored"){let r=n?`OC Session error (${t}): ${n}`:`OC Session error (${t}): session entered errored state`;this.globalError_CS.showError(new Error(r),"oc-session-status")}}handleOutputChunk(s){let t=s.sessionId??"";if(t&&t!==this.activeSessionId_$())return;let e=s.content??"",n=s.type??"response";e&&this.pushConsoleMessage({type:n==="error"?"error":"assistant",text:e})}handleSessionEvent(s){let t=s.sessionId??"";if(t&&t!==this.activeSessionId_$())return;let e=s.event??{},n={sessionId:t,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(s){this.loadSessions().catch(()=>{})}extractTextFromContentBlock(s){let t=s.content;return typeof t=="string"?t:Array.isArray(t)?t.map(e=>typeof e.text=="string"?e.text:JSON.stringify(e,null,2)).join(`
|
|
7
7
|
`):typeof s.text=="string"?s.text:JSON.stringify(s,null,2)}extractTextFromMessage(s){let t=s.content;return typeof t=="string"?t:Array.isArray(t)?t.map(e=>typeof e.text=="string"?e.text:JSON.stringify(e,null,2)).join(`
|
|
8
8
|
`):JSON.stringify(s,null,2)}pushConsoleMessageFromEvent(s){let t=s.data;switch(s.eventType){case"response-chunk":{let e=typeof t.content=="string"?t.content:"";e&&this.pushConsoleMessage({type:"assistant",text:e});break}case"response-complete":{let e=t.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 t.name=="string"?t.name:"unknown",n=t.input,o=n?this.summarizeToolInput(n):"",i=o?`${e}: ${o}`:e;this.pushConsoleMessage({type:"tool",text:i,rawData:t});break}case"tool-call-end":{let e=t.content??t.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:t});break}case"error":{let e=t.message??t.content;typeof e=="string"&&e&&this.pushConsoleMessage({type:"error",text:e});break}case"connection-change":{let e=typeof t.state=="string"?t.state:"";e&&this.pushConsoleMessage({type:"info",text:`Gateway connection: ${e}`,rawData:t});break}default:break}}summarizeToolInput(s){if(typeof s=="string")return s.length>80?s.substring(0,80)+"\u2026":s;if(typeof s=="object"&&s!==null){let t=JSON.stringify(s);return t.length>80?t.substring(0,80)+"\u2026":t}return""}static extractGatewayChatMessageTimestamp(s){return w.extractTimestamp(s,w.GATEWAY_CHAT_MESSAGE_TIMESTAMP_FIELD_NAMES)??""}loadAssembledMessages(s){return d(this,null,function*(){try{let t=yield this.extSessionMsg_AS.getMessages({sessionId:s.sessionId,latest:!0});this.assembledMessages_$.set(t.messages),this.assembledMessagesHasMore_$.set(t.hasMore===!0)}catch(t){A.DyFM_Log.error(`CCAP_OcSession_DS | loadAssembledMessages failed | sessionId: ${s.sessionId}`,t)}})}loadOlderAssembledMessages(s){return d(this,null,function*(){if(this.isLoadingOlderMessages_$()||!this.assembledMessagesHasMore_$())return;let t=this.assembledMessages_$();if(!t.length)return;let e=t.reduce((n,o)=>(o.sequence??0)<n?o.sequence??0:n,t[0].sequence??0);this.isLoadingOlderMessages_$.set(!0);try{let n=yield this.extSessionMsg_AS.getMessages({sessionId:s.sessionId,beforeSequence:e,limit:s.limit??50});n.messages.length&&this.assembledMessages_$.set([...n.messages,...t]),this.assembledMessagesHasMore_$.set(n.hasMore===!0)}catch(n){A.DyFM_Log.error(`CCAP_OcSession_DS | loadOlderAssembledMessages failed | sessionId: ${s.sessionId}`,n)}finally{this.isLoadingOlderMessages_$.set(!1)}})}handleAssembledMessage(s){let t=typeof s.sessionId=="string"?s.sessionId:"";if(!t||t!==this.activeSessionId_$())return;let e=s.message;if(!e||typeof e!="object")return;let n=e,o=this.assembledMessages_$();this.assembledMessages_$.set([...o,n])}handleAssembledMessageUpdate(s){let t=typeof s.sessionId=="string"?s.sessionId:"";if(!t||t!==this.activeSessionId_$())return;let e=typeof s.messageKey=="string"?s.messageKey:"";if(!e)return;let n=s.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=I({},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 p=[...i];p[a]=r,this.assembledMessages_$.set(p)}static \u0275fac=function(t){return new(t||l)};static \u0275prov=v({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();export{w as a,ls as b};
|
|
9
|
-
//# sourceMappingURL=chunk-
|
|
9
|
+
//# sourceMappingURL=chunk-JDAN7XYD.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{I as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{I as l}from"./chunk-KPYMFKWR.js";import{C as d,aa as r,k as c,p as o,xb as n,y as s}from"./chunk-TBMJSIBB.js";var f=(()=>{class i{baseUrl=`${l.api.baseUrl}/agent-feedback`;http=d(n);listFeedback(e){let t=[];e?.type!==void 0&&e.type!==""&&t.push(`type=${encodeURIComponent(e.type)}`),e?.limit!==void 0&&t.push(`limit=${e.limit}`),e?.skip!==void 0&&t.push(`skip=${e.skip}`);let a=`${this.baseUrl}/list`,b=t.length?`${a}?${t.join("&")}`:a;return o(this.http.get(b))}deleteFeedback(e){return o(this.http.delete(`${this.baseUrl}/delete/${encodeURIComponent(e)}`))}deleteAllFeedback(){return o(this.http.delete(`${this.baseUrl}/delete-all`))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=s({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var A=(()=>{class i{feedback_$=r([]);feedbackLoading_$=r(!1);feedbackLoadError_$=r(null);filterType_$=r(void 0);feedbackTotalCount_$=r(0);feedback_AS=d(f);loadFeedback(){return c(this,null,function*(){this.feedbackLoading_$.set(!0),this.feedbackLoadError_$.set(null);try{let e=this.filterType_$(),a=(yield this.feedback_AS.listFeedback({type:e})).feedback??[];this.feedback_$.set(a),e===void 0&&this.feedbackTotalCount_$.set(a.length)}catch(e){this.feedbackLoadError_$.set(e),this.feedback_$.set([])}finally{this.feedbackLoading_$.set(!1)}})}setFilterType(e){this.filterType_$.set(e),this.loadFeedback()}clearAll(){return c(this,null,function*(){try{yield this.feedback_AS.deleteAllFeedback(),this.feedbackTotalCount_$.set(0),yield this.loadFeedback()}catch(e){this.feedbackLoadError_$.set(e)}})}clearOne(e){return c(this,null,function*(){try{yield this.feedback_AS.deleteFeedback(e),this.feedback_$.update(t=>t.filter(a=>a._id!==e)),this.feedbackTotalCount_$.update(t=>Math.max(0,t-1))}catch(t){this.feedbackLoadError_$.set(t)}})}static \u0275fac=function(t){return new(t||i)};static \u0275prov=s({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{A as a};
|
|
2
|
+
//# sourceMappingURL=chunk-JEI7TDG4.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{a as n}from"./chunk-Z5C7EZ67.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-
|
|
3
|
+
//# sourceMappingURL=chunk-JN3M2D7S.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{I as a}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{I as a}from"./chunk-KPYMFKWR.js";import{C as n,p as t,xb as o,y as i}from"./chunk-TBMJSIBB.js";var m=(()=>{class r{baseUrl=`${a.api.baseUrl}/setup`;http=n(o);getSetupStatus(){return t(this.http.get(`${this.baseUrl}/status`))}getVaultStatus(){return t(this.http.get(`${this.baseUrl}/vault-status`))}getVaultKeyGenerate(){return t(this.http.get(`${this.baseUrl}/vault-key/generate`))}postVaultKey(e){return t(this.http.post(`${this.baseUrl}/vault-key`,{vaultKey:e}))}postSetup(e){return t(this.http.post(this.baseUrl,e))}putSetupConfig(e){let s=`${a.api.baseUrl}/settings`;return t(this.http.put(`${s}/config`,e))}static \u0275fac=function(s){return new(s||r)};static \u0275prov=i({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{m as a};
|
|
2
|
+
//# sourceMappingURL=chunk-K3GAHTZ5.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as h}from"./chunk-Q4RH77GU.js";import{I as c,p as _}from"./chunk-KPYMFKWR.js";import{C as a,aa as r,h as u,k as n,p as o,xb as f,y as l}from"./chunk-TBMJSIBB.js";var p=u(_());var $=6e4,y=(()=>{class i{api_AS=a(h);instancePresenceMap_$=r(new Map);intervalHandle=void 0;lastRefreshAt_$=r(null);startPeriodicRefresh(){this.intervalHandle===void 0&&(this.refreshNow(),this.intervalHandle=setInterval(()=>{this.refreshNow()},$))}stopPeriodicRefresh(){this.intervalHandle!==void 0&&(clearInterval(this.intervalHandle),this.intervalHandle=void 0)}refreshNow(){return n(this,null,function*(){try{let t=yield this.api_AS.getPresence(),e=new Map;for(let s of t.list??[])s.instanceKey&&e.set(s.instanceKey,s);this.instancePresenceMap_$.set(e),this.lastRefreshAt_$.set(new Date().toISOString())}catch(t){p.DyFM_Log.warn(`[CCAP] ExS_InstancePresence_DataService refresh failed (non-fatal): ${t instanceof Error?t.message:String(t)}`)}})}getPresence(t){let e=this.instancePresenceMap_$().get(t);return e||{instanceKey:t,presence:"unknown",wsConnected:!1,reason:"presence map not loaded yet"}}ngOnDestroy(){this.stopPeriodicRefresh()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var g=5e3,P=18,v=5e3,L=(()=>{class i{versionInfo_$=r(null);loading_$=r(!1);loadError_$=r(null);lastLoadedAt_$=r(null);triggering_$=r(!1);triggerResult_$=r(null);triggerError_$=r(null);pollingPostUpdate_$=r(!1);triggerSucceeded_$=r(null);triggerTimedOut_$=r(!1);http=a(f);pollTimer=null;loadVersionInfo(){return n(this,null,function*(){this.loading_$.set(!0),this.loadError_$.set(null);try{let t=`${c.api.baseUrl}/server/health/version-info`,e=yield o(this.http.get(t));this.versionInfo_$.set(e),this.lastLoadedAt_$.set(new Date)}catch(t){let e=t instanceof Error?t.message:String(t);this.loadError_$.set(e),this.versionInfo_$.set(null)}finally{this.loading_$.set(!1)}})}triggerUpdate(t){return n(this,null,function*(){this.cancelPostUpdatePolling(),this.triggerSucceeded_$.set(null),this.triggerTimedOut_$.set(!1),this.triggering_$.set(!0),this.triggerError_$.set(null),this.triggerResult_$.set(null);try{let e=`${c.api.baseUrl}/server/health/trigger-update`,s=yield o(this.http.post(e,{force:t===!0}));this.triggerResult_$.set(s),s.status==="started"&&s.currentVersion&&this.startPostUpdatePolling(s.currentVersion)}catch(e){let s=e instanceof Error?e.message:String(e);this.triggerError_$.set(s)}finally{this.triggering_$.set(!1)}})}startPostUpdatePolling(t){this.pollingPostUpdate_$.set(!0);let e=0,s=()=>n(this,null,function*(){e+=1;let d=yield this.pollHealthPid();if(d&&d!==t){this.triggerSucceeded_$.set({oldVersion:t,newVersion:d,detectedAtMs:Date.now()}),this.pollingPostUpdate_$.set(!1),this.pollTimer=null,setTimeout(()=>{typeof window<"u"&&window?.location&&window.location.reload()},v);return}if(e>=P){this.triggerTimedOut_$.set(!0),this.pollingPostUpdate_$.set(!1),this.pollTimer=null;return}this.pollTimer=setTimeout(()=>{s()},g)});this.pollTimer=setTimeout(()=>{s()},g)}cancelPostUpdatePolling(){this.pollTimer&&(clearTimeout(this.pollTimer),this.pollTimer=null),this.pollingPostUpdate_$.set(!1)}pollHealthPid(){return n(this,null,function*(){try{let t=`${c.api.baseUrl}/server/health/pid`,e=yield o(this.http.get(t));return typeof e?.ccapVersion=="string"?e.ccapVersion:null}catch{return null}})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{y as a,L as b};
|
|
2
|
+
//# sourceMappingURL=chunk-K73EM3FB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as k}from"./chunk-RIPYHGQD.js";import{a as C}from"./chunk-V3VQWJQL.js";import{I as U,L as P,t as A}from"./chunk-KPYMFKWR.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-K7GP33XJ.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as l}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{p as l}from"./chunk-KPYMFKWR.js";import{G as i,h as f}from"./chunk-TBMJSIBB.js";var o=f(l()),u=10*o.second,_=20*o.second,a=5,c=7;var n=class{static getDurationBand(r){if(r==null)return null;let e=typeof r=="number"?r:Number(r);return Number.isNaN(e)||e<0?null:e<=u?"green":e<=_?"yellow":"red"}static getScoreBand(r){return r<a?"red":r>=c?"green":"yellow"}};var m=(()=>{class t{transform(e){return e!=null?n.getScoreBand(Number(e)):"yellow"}static \u0275fac=function(p){return new(p||t)};static \u0275pipe=i({name:"ccapScoreBand",type:t,pure:!0,standalone:!0})}return t})();export{n as a,m as b};
|
|
2
|
+
//# sourceMappingURL=chunk-KGYOX5HP.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as ks}from"./chunk-
|
|
1
|
+
import{j as ks}from"./chunk-G3LGRE4Z.js";import{I as $,N as Es,a as _s,b as ys,c as gs,d as ur,e as gt,f as ms,g as lr,i as hr,l as bs,n as dr,p as fr}from"./chunk-KPYMFKWR.js";import{C as oe,H as _t,O as fs,P as De,a as as,aa as z,e as cr,f,g as ar,h as us,hb as ps,i as K,ib as yt,jb as Fe,k as u,l as ls,m as hs,w as pt,y as ds}from"./chunk-TBMJSIBB.js";var qe=f(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.DyFM_SocketEvent_Key=void 0;var vs=function(s){return s.incomingNewConnection="connection",s.outgoingNewConnection="connect",s.subscribe="subscribe",s.subscriptionSuccessful="subscriptionSuccessful",s.unsubscribe="unsubscribe",s.unsubscribeSuccessful="unsubscribeSuccessful",s.disconnect="disconnect",s.ping="ping",s.event="event",s.error="error",s}(vs||(Me.DyFM_SocketEvent_Key=vs={}))});var Ss=f(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.DyFM_SocketClient_Params=void 0;var yr=ur(),gr=gt(),bt=class{name;service;address;port;reconnectDelay=yr.second*30;reconnect=!0;socketOptions;constructor(e){Object.assign(this,e),this.reconnect=!!this.reconnectDelay,(this.socketOptions?.autoConnect||this.socketOptions?.reconnection||this.socketOptions?.reconnectionDelay)&&(gr.DyFM_Log.warn("autoConnect or reconnection is set to true in socketOptions, so reconnect is set to false",`
|
|
2
2
|
This means that the reconnection will use the socket.io reconnection logic, `,"not the Dynamo implementations."),this.reconnect=!1)}};xe.DyFM_SocketClient_Params=bt});var kt=f(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.DyFM_SocketEvent=void 0;var Ie=gs(),ws=ms(),Ee=gt(),mr=hr(),br=bs(),ke=qe(),Et=class{name;eventKey;serviceName;preProcesses;tasks;logEvent;logEventContent;stackLocation;constructor(e){try{this.name=e.name??e.eventKey,this.eventKey=e.eventKey,this.serviceName=e.serviceName??"UnknownSocketService",this.preProcesses=e.preProcesses??[],this.tasks=e.tasks??[],this.stackLocation=(0,mr.DyFM_getConstructionStackLocation)(),e.logEvent!==void 0?this.logEvent=e.logEvent:this.eventKey===ke.DyFM_SocketEvent_Key.subscribe?this.logEvent=!1:[ke.DyFM_SocketEvent_Key.incomingNewConnection,ke.DyFM_SocketEvent_Key.outgoingNewConnection,ke.DyFM_SocketEvent_Key.disconnect].includes(this.eventKey)?this.logEvent=Ie.DyFM_global_settings.log_settings.socket_allEvents||Ie.DyFM_global_settings.log_settings.socket_mainEvents:this.logEvent=Ie.DyFM_global_settings.log_settings.socket_allEvents,this.logEventContent=e.logEventContent??Ie.DyFM_global_settings.log_settings.socket_eventContent}catch(t){throw Ee.DyFM_Log.error(`
|
|
3
3
|
Socket Event params setup failed (${this.serviceName}): ${e.eventKey}`,t),t}}getPreLog(e){return u(this,null,function*(){try{this.logEventContent&&this.eventKey!==ke.DyFM_SocketEvent_Key.incomingNewConnection?Ee.DyFM_Log.log(`---> incoming socket(${this.serviceName}) event: ${this.eventKey};
|
|
4
4
|
|
|
@@ -8,4 +8,4 @@ socket-client(${this.params?.name}) Service setup finished`),yield this.connectS
|
|
|
8
8
|
Fn:. setupDefaultEvents`),this.defaultEvents.forEach(e=>{e.serviceName=this.params.name;let t=this.incomingEvents.find(n=>n.eventKey===e.eventKey);t?t.tasks.unshift(...e.tasks):this.incomingEvents.push(e)})}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Setup Default Events failed, ERROR:`,e),e}})}setupSocketEvents(){return u(this,null,function*(){try{this.debugLog&&console.log(`Setup socket-client(${this.params.name}) Events...`),yield Lo.DyFM_Array.asyncForEach(this.incomingEvents,e=>u(this,null,function*(){e.serviceName=this.params.name,this.socket.on(e.eventKey,t=>u(this,null,function*(){try{yield e.executeEventTasks(t,this.params.service)}catch(n){k.DyFM_Log.error(`socket-client(${this.params.name}) Event failed, ERROR:`,n),yield this.emitEvent(X.DyFM_SocketEvent_Key.error,n)}}))}))}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Setup Socket Events failed, ERROR:`,e),e}})}connectSocket(){return u(this,null,function*(){try{k.DyFM_Log.info(`< .. > socket-client(${this.params.name}) connecting to ${this.params.address}:${this.params.port} ...`),this.socket.connect(),this.params.reconnect&&(yield this.tryReconnectIfNeeded())}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Connect Socket failed, ERROR:`,e),e}})}tryingToReconnect=!1;tryReconnectIfNeeded(){return u(this,null,function*(){try{if(console.log("tryReconnectIfNeeded",this._params.reconnectDelay),this.tryingToReconnect){k.DyFM_Log.warn(`socket-client(${this.params.name}) already trying to reconnect!`);return}if(!this.params.reconnect){k.DyFM_Log.warn(`socket-client(${this.params.name}) Dynamo reconnection is disabled!`);return}this.tryingToReconnect=!0,this.logFn&&console.log(`
|
|
9
9
|
Fn:. tryReconnectIfNeeded`),yield vn.DyFM_Async.delay(this._params.reconnectDelay),this.connected||(this.tryingToReconnect=!1,yield this.connectSocket())}catch(e){throw k.DyFM_Log.error(`socket-client(${this.params.name}) Service Try Reconnect failed, ERROR:`,e),this.tryingToReconnect=!1,e}})}reconnect(){this.tryingToReconnect=!1,this.socket&&this.socket.disconnect(),this.connectSocket()}};lt.DyFM_SocketClient_ServiceBase=os});var wn=f(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});var ht=(ys(),K(_s));ht.__exportStar(qe(),be);ht.__exportStar(Ss(),be);ht.__exportStar(kt(),be);ht.__exportStar(Sn(),be)});function pr(s,e){!e?.injector&&_t(pr);let t=e?.injector??oe(fs),n=new hs(1),r=Fe(()=>{let i;try{i=s()}catch(o){yt(()=>n.error(o));return}yt(()=>n.next(i))},{injector:t,manualCleanup:!0});return t.get(De).onDestroy(()=>{r.destroy(),n.complete()}),n.asObservable()}function mt(s,e){let t=!e?.manualCleanup;t&&!e?.injector&&_t(mt);let n=t?e?.injector?.get(De)??oe(De):null,r=_r(e?.equal),i;e?.requireSync?i=z({kind:0},{equal:r}):i=z({kind:1,value:e?.initialValue},{equal:r});let o=s.subscribe({next:c=>i.set({kind:1,value:c}),error:c=>{if(e?.rejectErrors)throw c;i.set({kind:2,error:c})}});if(e?.requireSync&&i().kind===0)throw new pt(601,!1);return n?.onDestroy(o.unsubscribe.bind(o)),ps(()=>{let c=i();switch(c.kind){case 1:return c.value;case 2:throw c.error;case 0:throw new pt(601,!1)}},{equal:e?.equal})}function _r(s=Object.is){return(e,t)=>e.kind===1&&t.kind===1&&s(e.value,t.value)}var C=us(fr()),d=us(wn());var j=function(s){return s.connecting="connecting",s.connected="connected",s.error="error",s}(j||{});function dt(){if($.socketUrl!==void 0&&$.socketUrl.trim()!=="")return $.socketUrl.trim();if(typeof window<"u"){let s=new URL(window.location.href).origin;return C.DyFM_Log.warn("CCAP_Socket | socketUrl not set, using same-origin fallback:",s),s}return""}function U(s){return s!=null&&typeof s=="object"&&!(s instanceof Error)}function Cn(){return typeof globalThis>"u"?!1:globalThis.jasmine!==void 0}var Tn="answer",On="notify-user",Rn="agent-events",Pn="context:updated",An="monitoring:event",Nn="user-notification",Dn="cc-session:status",Fn="cc-session:output",Mn="cc-session:event",qn="cc-session:list-update",xn="cc-session:session-update",In="ca-session:status",jn="ca-session:output",Ln="ca-session:event",Bn="ca-session:list-update",Un="ext-session-msg:message",Kn="ext-session-msg:update",$n="user-interaction:request",Vn="instance-data:session-status-updated",Wn="instance:presence-update",Hn="openclaw-instance-data:status-updated",Yn="cci-instance-data:status-updated",Xn="cai-instance-data:status-updated",Jn="terminal:list:result",zn="terminal:start:result",Gn="terminal:command-result",Qn="terminal:command-output",Zn="cc:rate-limit-update",er="cc:account-usage-update",tr="cc:account-list-update",sr="session-queue:updated",nr="session-queue:lock-changed",Uo="system-error",Ko="terminal-error",$o="server:start-id",Vo="connect_error",Wo=8*C.second,Yc=(()=>{class s extends d.DyFM_SocketClient_ServiceBase{status_$=z(j.connecting);lastError_$=z(null);connectAttemptCount_$=z(0);hasEverConnected=!1;connectionTimeoutId=null;knownServerStartId=null;eventSubject_S=new ls;event$=this.eventSubject_S.asObservable();connected_$=mt(this.connected$,{initialValue:!1});get socketAddress(){return dt()||(this.params?.address??"")}globalError_CS=oe(ks);settingsGeneral_DS=oe(Es);constructor(){super(),Cn()||this.startConnectionTimeout(),Fe(()=>{this.connected&&!this.subscribed&&this.subscribe()})}startConnectionTimeout(){this.clearConnectionTimeout(),this.connectionTimeoutId=setTimeout(()=>{if(this.connectionTimeoutId=null,this.status_$()===j.connecting){let t=new Error("Socket connection timeout \u2013 server unreachable or setup failed. Click to reconnect.");this.status_$.set(j.error),this.lastError_$.set(t),C.DyFM_Log.warn("CCAP_Socket | Connection timeout")}},Wo)}clearConnectionTimeout(){this.connectionTimeoutId!==null&&(clearTimeout(this.connectionTimeoutId),this.connectionTimeoutId=null)}getParams(){let t=dt(),n=Cn(),r={path:"/socket",transports:["polling","websocket"],reconnectionDelay:1e3};return n&&(r.reconnection=!1),new d.DyFM_SocketClient_Params({name:"CCAP Client",address:t,reconnect:!n,reconnectDelay:C.minute,socketOptions:r})}getIncomingEvents(){let t=this,n=(r,i)=>{try{let o=U(i)?i:{};if(!t.eventSubject_S){let c=`Socket event dropped: eventSubject not initialized | event: ${r} | This means the socket event system is not functional \u2014 no live updates will arrive.`;C.DyFM_Log.error(`[CCAP_Socket] ${c}`),t.globalError_CS.showError(new Error(c),"client-socket-event-subject");return}t.eventSubject_S.next({event:r,payload:o})}catch(o){let c=o instanceof Error?o.message:String(o);C.DyFM_Log.error(`[CCAP_Socket] pushEnvelope failed | event: ${r} | ${c}`),t.globalError_CS.showError(o instanceof Error?o:new Error(`Socket event processing failed: ${r} \u2014 ${c}`),"client-socket-push-envelope")}};return[new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.outgoingNewConnection,tasks:[()=>u(this,null,function*(){t.clearConnectionTimeout(),t.hasEverConnected=!0,t.status_$.set(j.connected),t.lastError_$.set(null),t.connectAttemptCount_$.set(0),C.DyFM_Log.info("CCAP_Socket | Connected")})]}),new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.disconnect,tasks:[()=>u(this,null,function*(){t.hasEverConnected&&t.status_$.set(j.error),C.DyFM_Log.info("CCAP_Socket | Disconnected")})]}),new d.DyFM_SocketEvent({eventKey:Vo,tasks:[r=>u(this,null,function*(){t.clearConnectionTimeout(),t.connectAttemptCount_$.update(a=>a+1);let i=r instanceof Error?r:new Error(String(r)),o=U(r)?r.description:void 0,c=U(r)?r.type:void 0;C.DyFM_Log.info("CCAP_Socket | connect_error",`attempt #${t.connectAttemptCount_$()}`,i?.message??String(r),o!==void 0?String(o):"",c!==void 0?String(c):""),t.status_$.set(j.error);let h=t.params?.address??"",_=t.buildSocketErrorDisplay({err:i,socketUrl:h,eventType:"connect_error",raw:r});t.lastError_$.set(_),t.shouldReportSocketConnectionErrorsToErrorList()&&t.globalError_CS.reportErrorOnly({message:String(_.fullMessage??_.message??i.message),stack:typeof _.stack=="string"?_.stack:void 0,source:"client-socket"})})]}),new d.DyFM_SocketEvent({eventKey:d.DyFM_SocketEvent_Key.error,tasks:[r=>u(this,null,function*(){t.clearConnectionTimeout(),t.status_$.set(j.error);let i=r instanceof Error?r:new Error(String(r)),o=t.params?.address??"",c=t.buildSocketErrorDisplay({err:i,socketUrl:o,eventType:"error",raw:r});t.lastError_$.set(c),t.shouldReportSocketConnectionErrorsToErrorList()&&t.globalError_CS.reportErrorOnly({message:String(c.fullMessage??c.message??i.message),stack:typeof c.stack=="string"?c.stack:void 0,source:"client-socket"})})]}),new d.DyFM_SocketEvent({eventKey:Tn,tasks:[r=>u(this,null,function*(){n(Tn,r)})]}),new d.DyFM_SocketEvent({eventKey:On,tasks:[r=>u(this,null,function*(){n(On,r)})]}),new d.DyFM_SocketEvent({eventKey:Rn,tasks:[r=>u(this,null,function*(){n(Rn,r)})]}),new d.DyFM_SocketEvent({eventKey:Pn,tasks:[r=>u(this,null,function*(){n(Pn,r)})]}),new d.DyFM_SocketEvent({eventKey:An,tasks:[r=>u(this,null,function*(){n(An,r)})]}),new d.DyFM_SocketEvent({eventKey:Nn,tasks:[r=>u(this,null,function*(){let i=U(r)?r:{};if(n(Nn,r),i.type===Uo){let o=t.buildServerErrorDisplay(i);t.globalError_CS.showError(o,"client-socket")}else if(i.type===Ko){let o=t.buildTerminalErrorDisplay(i);t.globalError_CS.showError(o,"client-socket")}})]}),new d.DyFM_SocketEvent({eventKey:$o,tasks:[r=>u(this,null,function*(){let i=U(r)?r:{},o=typeof i.serverStartId=="number"?i.serverStartId:void 0;o!==void 0&&(t.knownServerStartId===null?(t.knownServerStartId=o,C.DyFM_Log.info("CCAP_Socket | Server start ID stored:",o)):t.knownServerStartId!==o&&(C.DyFM_Log.warn("CCAP_Socket | Server restarted (start ID changed), reloading page"),window.location.reload()))})]}),new d.DyFM_SocketEvent({eventKey:Dn,tasks:[r=>u(this,null,function*(){n(Dn,r)})]}),new d.DyFM_SocketEvent({eventKey:Fn,tasks:[r=>u(this,null,function*(){n(Fn,r)})]}),new d.DyFM_SocketEvent({eventKey:Mn,tasks:[r=>u(this,null,function*(){n(Mn,r)})]}),new d.DyFM_SocketEvent({eventKey:qn,tasks:[r=>u(this,null,function*(){n(qn,r)})]}),new d.DyFM_SocketEvent({eventKey:xn,tasks:[r=>u(this,null,function*(){n(xn,r)})]}),new d.DyFM_SocketEvent({eventKey:In,tasks:[r=>u(this,null,function*(){n(In,r)})]}),new d.DyFM_SocketEvent({eventKey:jn,tasks:[r=>u(this,null,function*(){n(jn,r)})]}),new d.DyFM_SocketEvent({eventKey:Ln,tasks:[r=>u(this,null,function*(){n(Ln,r)})]}),new d.DyFM_SocketEvent({eventKey:Bn,tasks:[r=>u(this,null,function*(){n(Bn,r)})]}),new d.DyFM_SocketEvent({eventKey:Un,tasks:[r=>u(this,null,function*(){n(Un,r)})]}),new d.DyFM_SocketEvent({eventKey:Kn,tasks:[r=>u(this,null,function*(){n(Kn,r)})]}),new d.DyFM_SocketEvent({eventKey:$n,tasks:[r=>u(this,null,function*(){n($n,r)})]}),new d.DyFM_SocketEvent({eventKey:Vn,tasks:[r=>u(this,null,function*(){n(Vn,r)})]}),new d.DyFM_SocketEvent({eventKey:Wn,tasks:[r=>u(this,null,function*(){n(Wn,r)})]}),new d.DyFM_SocketEvent({eventKey:Hn,tasks:[r=>u(this,null,function*(){n(Hn,r)})]}),new d.DyFM_SocketEvent({eventKey:Yn,tasks:[r=>u(this,null,function*(){n(Yn,r)})]}),new d.DyFM_SocketEvent({eventKey:Xn,tasks:[r=>u(this,null,function*(){n(Xn,r)})]}),new d.DyFM_SocketEvent({eventKey:Jn,tasks:[r=>u(this,null,function*(){n(Jn,r)})]}),new d.DyFM_SocketEvent({eventKey:zn,tasks:[r=>u(this,null,function*(){n(zn,r)})]}),new d.DyFM_SocketEvent({eventKey:Gn,tasks:[r=>u(this,null,function*(){n(Gn,r)})]}),new d.DyFM_SocketEvent({eventKey:Qn,tasks:[r=>u(this,null,function*(){n(Qn,r)})]}),new d.DyFM_SocketEvent({eventKey:sr,tasks:[r=>u(this,null,function*(){n(sr,r)})]}),new d.DyFM_SocketEvent({eventKey:nr,tasks:[r=>u(this,null,function*(){n(nr,r)})]}),new d.DyFM_SocketEvent({eventKey:Zn,tasks:[r=>u(this,null,function*(){n(Zn,r)})]}),new d.DyFM_SocketEvent({eventKey:er,tasks:[r=>u(this,null,function*(){n(er,r)})]}),new d.DyFM_SocketEvent({eventKey:tr,tasks:[r=>u(this,null,function*(){n(tr,r)})]})]}getSubscriptionContent(){return u(this,null,function*(){let t=this.socket?.id;return Promise.resolve({clientId:t})})}shouldReportSocketConnectionErrorsToErrorList(){return this.settingsGeneral_DS.section_$().form.reportSocketConnectionErrorsToErrorList===!0}buildSocketErrorDisplay(t){let n=t.err.message?.trim()?t.err.message:"WebSocket connection failed",r=t.socketUrl.trim()?`WebSocket: ${n} \u2014 ${t.socketUrl}`:`WebSocket: ${n}`,i={message:r,fullMessage:r,name:t.err.name,stack:t.err.stack??null,socketUrl:t.socketUrl,transport:"websocket",eventType:t.eventType,attemptedAt:new Date().toISOString(),connectAttempt:this.connectAttemptCount_$()},o=$.socketUrl!==void 0&&$.socketUrl.trim()!=="";i.socketUrlSource=o?"environment.socketUrl":"same-origin fallback";let c=this.params?.socketOptions?.transports??[];if(c.length>0&&(i.configuredTransports=c.join(", ")),typeof window<"u"&&(i.pageOrigin=window.location.origin),U(t.raw)){let _=t.raw,a=_.description;if(typeof a=="string"&&a.trim())i.description=a.trim();else if(a instanceof Error)i.description=a.message,a.stack&&(i.descriptionStack=a.stack);else if(a instanceof Event)i.description=this.extractDomEventInfo(a);else if(U(a)){let l=a,y=[];typeof l.message=="string"&&l.message.trim()&&y.push(l.message.trim()),typeof l.status=="number"&&(i.httpStatus=l.status,y.push(`HTTP ${l.status}`)),typeof l.statusText=="string"&&l.statusText.trim()&&(i.httpStatusText=l.statusText.trim(),y.push(l.statusText.trim())),typeof l.responseURL=="string"&&l.responseURL.trim()&&(i.responseUrl=l.responseURL.trim()),y.length>0&&(i.description=y.join(" \u2013 "))}typeof _.type=="string"&&_.type.trim()&&(i.type=_.type.trim()),U(_.context)&&(i.errorContext=_.context)}t.raw instanceof Event&&!i.description&&(i.description=this.extractDomEventInfo(t.raw));let h=[r];if(typeof i.description=="string"&&h.push(`Cause: ${i.description}`),typeof i.httpStatus=="number"){let _=typeof i.httpStatusText=="string"?` ${i.httpStatusText}`:"";h.push(`HTTP: ${i.httpStatus}${_}`)}return typeof i.responseUrl=="string"&&h.push(`Response URL: ${i.responseUrl}`),h.push(`Attempt: #${i.connectAttempt}`),h.push(`Source: ${i.socketUrlSource}`),i.fullMessage=h.join(" | "),i}extractDomEventInfo(t){let n=[];n.push(`type=${t.type}`);let r=t.target;return U(r)&&(typeof r.readyState=="number"&&n.push(`readyState=${r.readyState}`),typeof r.url=="string"&&r.url&&n.push(`url=${r.url}`),typeof r.responseURL=="string"&&r.responseURL&&n.push(`responseURL=${r.responseURL}`),typeof r.status=="number"&&n.push(`status=${r.status}`)),n.push("(DOM Event - tipikusan SSL cert reject, CORS, vagy network unreachable)"),n.join(", ")}buildTerminalErrorDisplay(t){let n=typeof t.message=="string"?t.message:String(t.message??""),r=typeof t.code=="string"?t.code:String(t.code??""),i=[n];r&&i.push(`K\xF3d: ${r}`),typeof t.terminalId=="string"&&t.terminalId.trim()&&i.push(`Termin\xE1l ID: ${t.terminalId.trim()}`),typeof t.path=="string"&&t.path.trim()&&i.push(`Path: ${t.path.trim()}`);let o=i.join(`
|
|
10
10
|
`),c=typeof t.timestamp=="number"?t.timestamp:Date.now();return{source:"server",message:n,stack:null,detailsText:o,timestamp:c}}buildServerErrorDisplay(t){let n=typeof t.message=="string"?t.message:String(t.message??""),r=t.stack,i=typeof r=="string"?r:r!=null?String(r):null,o=typeof t.detailsText=="string"?t.detailsText:JSON.stringify(t,null,2),c=typeof t.timestamp=="number"?t.timestamp:Date.now();return{source:"server",message:n,stack:i,detailsText:o,timestamp:c}}reconnect(){if(this.socket){this.clearConnectionTimeout(),this.status_$.set(j.connecting),this.lastError_$.set(null),this.connectAttemptCount_$.set(0),this.startConnectionTimeout();let t=this.params?.address??dt();C.DyFM_Log.info("CCAP_Socket | Reconnecting to",t),this.socket.disconnect(),this.socket.connect()}}emit(t,n){this.socket?.connected&&this.socket.emit(t,n)}diagnoseConnection(){return u(this,null,function*(){let t=this.params?.address??dt(),n={timestamp:new Date().toISOString(),socketUrl:t,socketUrlSource:$.socketUrl!==void 0&&$.socketUrl.trim()!==""?"environment.socketUrl":"same-origin fallback",pageOrigin:typeof window<"u"?window.location.origin:"",socketConnected:this.socket?.connected??!1,socketId:this.socket?.id??null,connectAttemptCount:this.connectAttemptCount_$(),currentStatus:this.status_$()},r=yield s.probeEndpoint("/api/server/status","serverStatusApi");if(n.serverStatusApi=r,r.ok===!0&&r.body!==void 0){let _=r.body;if(_!==null&&typeof _=="object"){let a=_;n.serverReportedHttpPort=a.httpPort??null,n.serverReportedSocketPort=a.socketPort??null}}let i=this.params?.socketOptions?.path??"/socket",o=`${t}${i}/?EIO=4&transport=polling&t=${Date.now()}`,c=yield s.probeEndpoint(o,"socketIoPolling");n.socketIoPolling=c;let h=n.serverReportedSocketPort;if(typeof h=="number"&&h>0){let _=`http://localhost:${h}${i}/?EIO=4&transport=polling&t=${Date.now()}`,a=yield s.probeEndpoint(_,"socketIoDirectPort");n.socketIoDirectPort=a}return n})}static probeEndpoint(t,n){return u(this,null,function*(){let r={url:t,label:n},i=performance.now();try{let o=yield fetch(t,{method:"GET",cache:"no-store"}),c=Math.round(performance.now()-i);r.ok=o.ok,r.httpStatus=o.status,r.httpStatusText=o.statusText,r.elapsedMs=c;try{let h=yield o.text();try{r.body=JSON.parse(h)}catch{r.bodyPreview=h.substring(0,300)}}catch{r.bodyReadError="Failed to read response body"}}catch(o){let c=Math.round(performance.now()-i);r.elapsedMs=c,r.ok=!1,r.fetchError=o instanceof Error?o.message:String(o),o instanceof TypeError&&(r.fetchErrorType="TypeError (network/CORS/SSL)")}return r})}ngOnDestroy(){this.clearConnectionTimeout(),this.socket&&this.socket.disconnect()}static \u0275fac=function(n){return new(n||s)};static \u0275prov=ds({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();export{pr as a,mt as b,wn as c,j as d,Yc as e};
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-KNBMYOHX.js.map
|
|
@@ -208,5 +208,5 @@ stackLocation: ${this.stackLocation}
|
|
|
208
208
|
DynamoPoll: "${this.name}" pollDo was UNSUCCESSFUL`,error:r})})})),this.running=!0}catch(r){throw new ru.DyFM_Error({message:`DYNAMO ERROR:
|
|
209
209
|
DynamoPoll: startPoll was UNSUCCESSFUL`,error:r})}})}restartPoll(e){try{e?this.startPoll(e):this.startPoll(this.args)}catch(r){throw new ru.DyFM_Error({message:`DYNAMO ERROR:
|
|
210
210
|
DynamoPoll: restartPoll was UNSUCCESSFUL`,error:r})}}stop(){this.poll.unsubscribe(),this.running=!1}end(e){this.poll.unsubscribe(),this.pollEnd?.(e),this.running=!1}};tu.DyFM_Poll=Jc});var ly=f(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.DyFM_RangeValue=void 0;var Gc=class t{isRange=!0;from;to;constructor(e,r){if(e?.isRange){this.from=e.from,this.to=e.to;return}else this.from=e,this.to=r??e}constructed(){return!0}newValues(e){this.from=e.from,this.to=e.to}addRange(e){this.from+=e.from,this.to+=e.to}subtractRange(e){this.from-=e.from,this.to-=e.to}multiplyRange(e){this.from*=e.from,this.to*=e.to}divideRange(e){this.from/=e.from,this.to/=e.to}add(e){this.from+=e,this.to+=e}subtract(e){this.from-=e,this.to-=e}multiply(e){this.from*=e,this.to*=e}divide(e){this.from/=e,this.to/=e}clone(){return new t(this.from,this.to)}applyTransform(e){return new t(e(this.from),e(this.to))}toString=this.stringify;stringify(e=!0,r=!0){return r&&this.from===this.to?`${this.from}`:e?`${this.from} - ${this.to}`:`${this.from}-${this.to}`}static reType(e){return new t(e.from,e.to)}static addRange(e,r){return new t(e.from+r.from,e.to+r.to)}static subtractRange(e,r){return new t(e.from-r.from,e.to-r.to)}static multiplyRange(e,r){return new t(e.from*r.from,e.to*r.to)}static divideRange(e,r){return new t(e.from/r.from,e.to/r.to)}static add(e,r){return new t(e.from+r,e.to+r)}static subtract(e,r){return new t(e.from-r,e.to-r)}static multiply(e,r){return new t(e.from*r,e.to*r)}static divide(e,r){return new t(e.from/r,e.to/r)}static isInRange(e,r){return r.from<=e&&e<=r.to}};nu.DyFM_RangeValue=Gc});var fy=f(Ot=>{"use strict";Object.defineProperty(Ot,"__esModule",{value:!0});Ot.DyFM_serverStatus_dataParams=Ot.DyFM_ServerStatus=void 0;var Uk=iu(),Tk=kr(),Hc=class extends Tk.DyFM_Metadata{status;systemName;systemShortCode;clientVersionOk;latestClientVersion;latestClientVersionNumeric;serverVersion;serverNumericVersion;uptime;serverMessage;memoryUsage;cpuUsage;serverConnections;constructor(e){super(e),e&&Object.assign(this,e)}};Ot.DyFM_ServerStatus=Hc;Ot.DyFM_serverStatus_dataParams=new Uk.DyFM_DataModel_Params({dataName:"server_status",properties:{status:{type:"string"},systemName:{type:"string"},systemShortCode:{type:"string"},clientVersionOk:{type:"boolean"},latestClientVersion:{type:"string"},latestClientVersionNumeric:{type:"number"},serverVersion:{type:"string"},serverNumericVersion:{type:"number"},uptime:{type:"number"},serverMessage:{type:"string"},memoryUsage:{type:"object"},cpuUsage:{type:"object"},serverConnections:{type:"object"}}})});var vy=f(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.DyFM_API_Input_Type=ur.DyFM_ServerRoute_SettingsBase=ur.DyFM_Endpoint_SettingsBase=void 0;var Wk=Fr(),ou=class{name;type;endpoint;pathParamKeys=[];constructor(e){if(!e.endpoint)throw new Error(`endpoint not setted up for this endpoint (${e.name??(0,Wk.DyFM_getConstructionStackLocation)()})`);e.endpoint.includes("{")&&(console.warn(`using {param} brackets in endpoint definitions will be deprecated...
|
|
211
|
-
use :param instead ({pathParam} --> :pathParam) (${e.name})`),e.endpoint=e.endpoint.replace(/{/g,":").replace(/}/g,"")),Object.assign(this,e),this.pathParamKeys=this.endpoint.split("/").filter(r=>r.startsWith(":")).map(r=>r.replace(":",""))}};ur.DyFM_Endpoint_SettingsBase=ou;var Zc=class extends ou{preProcesses;tasks;simpleTask;constructor(e){super(e),Object.assign(this,e)}};ur.DyFM_ServerRoute_SettingsBase=Zc;var dy=function(t){return t.body="body",t.queryParams="queryParams",t}(dy||(ur.DyFM_API_Input_Type=dy={}))});var hy=f(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.DyFM_errors_dataParams=xe.DyFM_Errors=xe.DyFM_errorsFlag=void 0;var Bk=Ds(),Vk=kr();xe.DyFM_errorsFlag="DyFM-ERRORS-OBJECT";var Kc=class extends Vk.DyFM_Metadata{flag=xe.DyFM_errorsFlag;source;issuer;username;versions=[];localTime;region;message;exception;exceptionObj;stackTrace=[];error;count=1;d_error;additionalContent;level;priority;duplications=[];constructor(e){super(e),e&&Object.assign(this,e)}};xe.DyFM_Errors=Kc;xe.DyFM_errors_dataParams=new Bk.DyFM_DataModel_Params({dataName:"errors",properties:{flag:{type:"string"},issuer:{type:"string"},username:{type:"string"},versions:{type:"string[]"},localTime:{type:"string"},region:{type:"string"},message:{type:"string"},exception:{type:"string"},exceptionObj:{type:"any"},stackTrace:{type:"string[]"},error:{type:"any"},count:{type:"number"},d_error:{type:"DyFM_Error"},additionalContent:{type:"any"},level:{type:"DyFM_ErrorLevel"},priority:{type:"number"},duplications:{type:"DyNTS_Error[]"}}})});var yy=f(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0})});var my=f(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0})});var gy=f(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0})});var Sy=f(Oy=>{"use strict";Object.defineProperty(Oy,"__esModule",{value:!0})});var qy=f(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0})});var jy=f(My=>{"use strict";Object.defineProperty(My,"__esModule",{value:!0})});var Ay=f(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0})});var Ey=f(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0})});var Dy=f(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0})});var Iy=f(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0})});var Cy=f(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0})});var Ny=f(Ry=>{"use strict";Object.defineProperty(Ry,"__esModule",{value:!0})});var Uy=f($y=>{"use strict";Object.defineProperty($y,"__esModule",{value:!0})});var Wy=f(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.DyFM_SpecialSearch_Type=void 0;var Ty=function(t){return t.stringListSearchAny="stringListSearchAny",t.stringListSearch="stringListSearch",t.stringListSearchOrdered="stringListSearchOrdered",t}(Ty||(au.DyFM_SpecialSearch_Type=Ty={}))});var Vy=f(By=>{"use strict";Object.defineProperty(By,"__esModule",{value:!0})});var iu=f(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});var S=(hu(),tl(vu));S.__exportStar(pu(),O);S.__exportStar(yu(),O);S.__exportStar(Al(),O);S.__exportStar(Fl(),O);S.__exportStar(wt(),O);S.__exportStar(El(),O);S.__exportStar(Fu(),O);S.__exportStar(Il(),O);S.__exportStar(Du(),O);S.__exportStar(he(),O);S.__exportStar(Ll(),O);S.__exportStar(bn(),O);S.__exportStar(Fr(),O);S.__exportStar(Ru(),O);S.__exportStar(Lu(),O);S.__exportStar(ju(),O);S.__exportStar(Cl(),O);S.__exportStar(Uu(),O);S.__exportStar(vf(),O);S.__exportStar(pf(),O);S.__exportStar(Mt(),O);S.__exportStar(yf(),O);S.__exportStar(ds(),O);S.__exportStar(hs(),O);S.__exportStar(_f(),O);S.__exportStar(mf(),O);S.__exportStar(bf(),O);S.__exportStar(jt(),O);S.__exportStar(ms(),O);S.__exportStar(gf(),O);S.__exportStar(gs(),O);S.__exportStar(qt(),O);S.__exportStar(wf(),O);S.__exportStar(jf(),O);S.__exportStar(Af(),O);S.__exportStar(Ef(),O);S.__exportStar(Ou(),O);S.__exportStar(gu(),O);S.__exportStar(Su(),O);S.__exportStar(Ds(),O);S.__exportStar(ws(),O);S.__exportStar(Bn(),O);S.__exportStar(cy(),O);S.__exportStar(ly(),O);S.__exportStar(fy(),O);S.__exportStar(vy(),O);S.__exportStar(Fs(),O);S.__exportStar(Ms(),O);S.__exportStar(Ps(),O);S.__exportStar(hy(),O);S.__exportStar(kr(),O);S.__exportStar(yy(),O);S.__exportStar(my(),O);S.__exportStar(gy(),O);S.__exportStar(Sy(),O);S.__exportStar(qy(),O);S.__exportStar(jy(),O);S.__exportStar(Ay(),O);S.__exportStar(Ey(),O);S.__exportStar(Dy(),O);S.__exportStar(Iy(),O);S.__exportStar(Cy(),O);S.__exportStar(Ny(),O);S.__exportStar(Uy(),O);S.__exportStar(Wy(),O);S.__exportStar(Vy(),O)});var zy="1.1.3130";var Yy={baseUrl:"MISSING",api:{baseUrl:"MISSING"},production:!1,version:zy};var zk=function(t){return t.openAi="open-ai",t.anthropic="anthropic",t.google="google",t.deepseek="deepseek",t.fdpAi="fdp-ai",t.customLocalAi="custom-local-ai",t}(zk||{});var Yk=function(t){return t.openAi="open-ai",t.localAi="local-ai",t.routing="routing",t}(Yk||{});var Jk=function(t){return t.discord="discord",t.signal="signal",t.teams="teams",t.routing="routing",t}(Jk||{});var uu=function(t){return t.vaultKey="vault-key",t.instanceRegistry="instance-registry",t.general="general",t.llmProviders="llm-providers",t.messageProviders="message-providers",t.modelTesting="model-testing",t.discordAccess="discord-access",t.voice="voice",t.visuals="visuals",t.soul="soul",t.mcp="mcp",t.cliTools="cli-tools",t.secretVault="secret-vault",t.agentEmail="agent-email",t.embedding="embedding",t.rag="rag",t.developer="developer",t.agentRuntime="agent-runtime",t.agentCronJobs="agent-cron-jobs",t.scheduler="scheduler",t.github="github",t.openclawRegistry="openclaw-registry",t.deviceIdentity="device-identity",t.consultant="consultant",t.caAgent="ca-agent",t.darkOfficeLayout="dark-office-layout",t.cluster="cluster",t}(uu||{});var Gk=function(t){return t.openAi="open-ai",t.leonardo="leonardo",t.fdpai="fdpai",t.routing="routing",t}(Gk||{});var Hk=function(t){return t.elevenLabs="elevenlabs",t.fdpai="fdpai",t.routing="routing",t}(Hk||{});var Zk=function(t){return t.pending="pending",t.running="running",t.completed="completed",t.failed="failed",t}(Zk||{});var Kk=function(t){return t.apiKey="api-key",t.credentials="credentials",t}(Kk||{});var Qk=function(t){return t.req="req",t.bug="bug",t.feature="feature",t.improvement="improvement",t.task="task",t.question="question",t.research="research",t}(Qk||{});var Xk=function(t){return t.low="low",t.medium="medium",t.high="high",t.urgent="urgent",t}(Xk||{});var eI=function(t){return t.todo="todo",t.backlog="backlog",t.bugs="bugs",t.changelog="changelog",t.userInput="user-input",t.status="status",t.testErrorReports="test-error-reports",t}(eI||{});var rI=function(t){return t.update="update",t.remove="remove",t}(rI||{});var tI=function(t){return t.e2e="e2e",t.serverUnit="server-unit",t.clientUnit="client-unit",t.cli="cli",t}(tI||{});var nI=function(t){return t.instant="instant",t.agenticAny="agentic-any",t.ask="ask",t.plan="plan",t}(nI||{});var iI=function(t){return t.full="full",t.askOnly="ask-only",t.planOnly="plan-only",t}(iI||{});var oI=function(t){return t.draft="draft",t.promotedUserInput="promoted-user-input",t.promotedBug="promoted-bug",t.discarded="discarded",t}(oI||{});var aI=function(t){return t.userInput="user-input",t.bugReport="bug-report",t.unspecified="unspecified",t}(aI||{});var uI=function(t){return t.easy="easy",t.medium="medium",t.hard="hard",t.komplex="komplex",t}(uI||{});var Qc="mongodb://200.33.0.101:29017";var sI="A k\xE9r\xE9s nem jutott el a szerverig, vagy nem \xE9rkezett v\xE1lasz. Lehets\xE9ges okok: a szerver nem fut vagy m\xE1s porton hallgat, h\xE1l\xF3zati hiba, a kliens megszak\xEDtotta a k\xE9r\xE9st, vagy m\xE1s origin eset\xE9n CORS blokkolja. Ellen\u0151rizd, hogy a szerver fut-e \xE9s a megadott c\xEDm/port helyes.",cI="Szerver 500-as hiba. A v\xE1lasz body \xFCres vagy nem el\xE9rhet\u0151.",su=class t{static isLikelyHtmlErrorPage(e){let r=e.trim();if(!r.startsWith("<"))return!1;let n=r.toLowerCase();return n.includes("<!doctype")||n.includes("<html")||n.includes("<title>")||n.includes("cannot get")||n.includes("cannot post")||n.includes("cannot put")||n.includes("cannot delete")}static getMessageForHtmlHttpErrorBody(e){let r="R\xE9szletek: szerver log vagy DevTools Network tab.";return e===404?`Az endpoint nem tal\xE1lhat\xF3 (HTTP ${e}). Ellen\u0151rizd az API base URL-t \xE9s a szerver route-okat. `+r:`A szerver HTML error oldalt adott vissza (nem JSON API v\xE1lasz), HTTP ${e}. ${r}`}static getHttpErrorMessage(e,r){if(e.status===0)return sI;let n=r!=null&&typeof r=="string"&&r.trim().length>0?r:null;return n==null&&typeof e.error=="string"&&e.error.trim().length>0&&(n=e.error),n!=null&&t.isLikelyHtmlErrorPage(n)?t.getMessageForHtmlHttpErrorBody(e.status):e.status===500&&!(n!=null&&typeof n=="string"&&n.trim().length>0)?cI:n??e.message??e.statusText??`HTTP ${e.status}`}};var Jy=(()=>{class t{settingsBaseUrl=`${Yy.api.baseUrl}/settings`;http=en(ol);getDefaultWorkspace(){return R(this.http.get(`${this.settingsBaseUrl}/default-workspace`))}getSection(r){return R(this.http.get(`${this.settingsBaseUrl}/get-section/${r}`))}getRequiredWarningsSummary(){return R(this.http.get(`${this.settingsBaseUrl}/required-warnings-summary`))}saveSection(r,n){return R(this.http.patch(`${this.settingsBaseUrl}/save-section/${r}`,n))}postProviderAccessAllow(r){return R(this.http.post(`${this.settingsBaseUrl}/provider-access/allow`,r))}getSoulStatus(){return R(this.http.get(`${this.settingsBaseUrl}/soul-status`))}getSoulContent(){return R(this.http.get(`${this.settingsBaseUrl}/soul-content`))}postGenerateSoul(r){return R(this.http.post(`${this.settingsBaseUrl}/generate-soul`,r))}postTestLlmProvider(r){return R(this.http.post(`${this.settingsBaseUrl}/test-llm-provider`,r))}postListLlmModels(r){return R(this.http.post(`${this.settingsBaseUrl}/list-llm-models`,r))}postListEmbeddingModels(r){return R(this.http.post(`${this.settingsBaseUrl}/list-embedding-models`,r))}postTestMessagingProvider(r){return R(this.http.post(`${this.settingsBaseUrl}/test-messaging-provider`,r))}postMcpSync(r){return R(this.http.post(`${this.settingsBaseUrl}/mcp-sync`,r))}postCliHelpProbe(r){return R(this.http.post(`${this.settingsBaseUrl}/cli-help-probe`,r))}postCliHelpSuggest(r){return R(this.http.post(`${this.settingsBaseUrl}/cli-help-suggest`,r))}postTestAgentEmail(){return R(this.http.post(`${this.settingsBaseUrl}/test-agent-email`,{}))}testOpenclawConnection(r){return R(this.http.post(`${this.settingsBaseUrl}/test-openclaw-connection`,r))}pairOpenclawInstance(r){return R(this.http.post(`${this.settingsBaseUrl}/openclaw-registry/${r.instanceId}/pair`,{}))}getClusterDiagnostics(){return R(this.http.get(`${this.settingsBaseUrl}/cluster/diagnostics`))}postClusterReBootstrap(){return R(this.http.post(`${this.settingsBaseUrl}/cluster/re-bootstrap`,{}))}postClusterReconnectWs(){return R(this.http.post(`${this.settingsBaseUrl}/cluster/reconnect-ws`,{}))}postClusterReconnectPeer(r){let n=encodeURIComponent(r);return R(this.http.post(`${this.settingsBaseUrl}/cluster/reconnect-ws/${n}`,{}))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Xt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Gy=rl(iu());var Xc=rl(iu());var cu=class{_master;get master(){return this._master}setupMaster(e){this._master=e}};var lu=class t extends cu{settings_AS=en(Jy);loading_$=ke(!1);loadError_$=ke(null);saving_$=ke(!1);saveError_$=ke(null);load(){return U(this,null,function*(){this.loading_$.set(!0),this.loadError_$.set(null);try{yield this.doLoad()}catch(e){Xc.DyFM_Error.logSimple(`${this.constructor.name} | Failed to load section`,e);let r=t.getErrorMessage(e);this.loadError_$.set(r)}finally{this.loading_$.set(!1)}})}save(){return U(this,null,function*(){this.saving_$.set(!0),this.saveError_$.set(null);try{let e=this.buildSaveBody(),r=yield this.doSave(e);return r.success?yield this.load():this.saveError_$.set(r.error??"Ment\xE9s sikertelen."),r}catch(e){Xc.DyFM_Error.logSimple(`${this.constructor.name} | Failed to save section`,e);let r=t.getErrorMessage(e);return this.saveError_$.set(r),{success:!1,error:r}}finally{this.saving_$.set(!1)}})}doSave(e){return U(this,null,function*(){return this.settings_AS.saveSection(this.getSectionId(),e)})}static getErrorMessage(e){if(e instanceof il){let r=e.error,n=null;if(r!==null&&typeof r=="object"){let i=r;typeof i.error=="string"?n=i.error:i.error!=null?n=String(i.error):typeof i.message=="string"&&(n=i.message);let o=i.errorCode,a=typeof o=="string"&&o.trim().length>0?o.trim():void 0;a!==void 0&&(n!=null&&n.trim().length>0?n=`${a}: ${n}`:n=a)}else typeof r=="string"&&(n=r);return su.getHttpErrorMessage(e,n)}return e instanceof Error?e.message||"M\u0171velet sikertelen.":String(e)||"M\u0171velet sikertelen."}};var X4=(()=>{class t extends lu{defaultWorkspacePath_$=ke("");section_$=ke({form:{mongodbUri:Qc,useOpenClawPath:!1,defaultPathOverride:"",autoStartWithSystem:!1,useLiveContext:!0,reportSocketConnectionErrorsToErrorList:!1,agenticLoopDebriefEnabled:!1,mobileAutoUpdateEnabled:!1,serverAutoUpdateEnabled:!1,serverAutoUpdateCheckInterval:"daily",ccSessionRunnerGracePeriodSec:null,ccSessionRunnerIdleTimeoutSec:null,ccSessionAutoArchiveScanIntervalSec:null,ccSessionAutoArchiveAgeDays:null,ccSessionAutoArchiveCountThreshold:null},runtime:{}});updateForm(r){this.section_$.update(n=>Sr(oe({},n),{form:oe(oe({},n.form),r)}))}setSection(r){this.section_$.set(r)}updateGeneralForm(r){this.updateForm(r),this.master?.bumpDigest()}getSectionId(){return uu.general}getSection_$(){return this.section_$}loadDefaultWorkspacePath(){return U(this,null,function*(){try{let r=yield this.settings_AS.getDefaultWorkspace();this.defaultWorkspacePath_$.set(r.workspacePath?.trim()??"")}catch(r){Gy.DyFM_Error.logSimple("CCAP_SettingsGeneral_DS | loadDefaultWorkspacePath failed",r),this.defaultWorkspacePath_$.set("")}})}doLoad(){return U(this,null,function*(){let r=yield this.settings_AS.getSection(uu.general);this.setSection({form:{mongodbUri:typeof r.mongodbUri=="string"?r.mongodbUri:Qc,useOpenClawPath:typeof r.useOpenClawPath=="boolean"?r.useOpenClawPath:!1,defaultPathOverride:typeof r.defaultPathOverride=="string"?r.defaultPathOverride:"",autoStartWithSystem:typeof r.autoStartWithSystem=="boolean"?r.autoStartWithSystem:!1,useLiveContext:typeof r.useLiveContext=="boolean"?r.useLiveContext:!0,reportSocketConnectionErrorsToErrorList:typeof r.reportSocketConnectionErrorsToErrorList=="boolean"?r.reportSocketConnectionErrorsToErrorList:!1,agenticLoopDebriefEnabled:typeof r.agenticLoopDebriefEnabled=="boolean"?r.agenticLoopDebriefEnabled:!1,mobileAutoUpdateEnabled:typeof r.mobileAutoUpdateEnabled=="boolean"?r.mobileAutoUpdateEnabled:!1,serverAutoUpdateEnabled:typeof r.serverAutoUpdateEnabled=="boolean"?r.serverAutoUpdateEnabled:!1,serverAutoUpdateCheckInterval:r.serverAutoUpdateCheckInterval==="daily"?"daily":r.serverAutoUpdateCheckInterval==="weekly"?"weekly":"daily",ccSessionRunnerGracePeriodSec:typeof r.ccSessionRunnerGracePeriodSec=="number"&&r.ccSessionRunnerGracePeriodSec>0?r.ccSessionRunnerGracePeriodSec:null,ccSessionRunnerIdleTimeoutSec:typeof r.ccSessionRunnerIdleTimeoutSec=="number"&&r.ccSessionRunnerIdleTimeoutSec>0?r.ccSessionRunnerIdleTimeoutSec:null,ccSessionAutoArchiveScanIntervalSec:typeof r.ccSessionAutoArchiveScanIntervalSec=="number"&&r.ccSessionAutoArchiveScanIntervalSec>0?r.ccSessionAutoArchiveScanIntervalSec:null,ccSessionAutoArchiveAgeDays:typeof r.ccSessionAutoArchiveAgeDays=="number"&&r.ccSessionAutoArchiveAgeDays>0?r.ccSessionAutoArchiveAgeDays:null,ccSessionAutoArchiveCountThreshold:typeof r.ccSessionAutoArchiveCountThreshold=="number"&&r.ccSessionAutoArchiveCountThreshold>0?r.ccSessionAutoArchiveCountThreshold:null},runtime:{}})})}buildSaveBody(){let r=this.section_$().form;return{mongodbUri:r.mongodbUri,useOpenClawPath:r.useOpenClawPath,defaultPathOverride:r.defaultPathOverride,autoStartWithSystem:r.autoStartWithSystem,useLiveContext:r.useLiveContext,reportSocketConnectionErrorsToErrorList:r.reportSocketConnectionErrorsToErrorList,agenticLoopDebriefEnabled:r.agenticLoopDebriefEnabled,mobileAutoUpdateEnabled:r.mobileAutoUpdateEnabled,serverAutoUpdateEnabled:r.serverAutoUpdateEnabled,serverAutoUpdateCheckInterval:r.serverAutoUpdateCheckInterval,ccSessionRunnerGracePeriodSec:r.ccSessionRunnerGracePeriodSec??void 0,ccSessionRunnerIdleTimeoutSec:r.ccSessionRunnerIdleTimeoutSec??void 0,ccSessionAutoArchiveScanIntervalSec:r.ccSessionAutoArchiveScanIntervalSec??void 0,ccSessionAutoArchiveAgeDays:r.ccSessionAutoArchiveAgeDays??void 0,ccSessionAutoArchiveCountThreshold:r.ccSessionAutoArchiveCountThreshold??void 0}}static \u0275fac=(()=>{let r;return function(i){return(r||(r=nl(t)))(i||t)}})();static \u0275prov=Xt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{vu as a,hu as b,Al as c,wt as d,he as e,El as f,Fu as g,bn as h,Fr as i,ds as j,kr as k,Bn as l,Ds as m,uy as n,ly as o,iu as p,zk as q,Yk as r,Jk as s,uu as t,Gk as u,Hk as v,Zk as w,Kk as x,Qk as y,oI as z,aI as A,uI as B,Xk as C,eI as D,rI as E,tI as F,nI as G,iI as H,Yy as I,Qc as J,su as K,Jy as L,lu as M,X4 as N};
|
|
212
|
-
//# sourceMappingURL=chunk-
|
|
211
|
+
use :param instead ({pathParam} --> :pathParam) (${e.name})`),e.endpoint=e.endpoint.replace(/{/g,":").replace(/}/g,"")),Object.assign(this,e),this.pathParamKeys=this.endpoint.split("/").filter(r=>r.startsWith(":")).map(r=>r.replace(":",""))}};ur.DyFM_Endpoint_SettingsBase=ou;var Zc=class extends ou{preProcesses;tasks;simpleTask;constructor(e){super(e),Object.assign(this,e)}};ur.DyFM_ServerRoute_SettingsBase=Zc;var dy=function(t){return t.body="body",t.queryParams="queryParams",t}(dy||(ur.DyFM_API_Input_Type=dy={}))});var hy=f(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.DyFM_errors_dataParams=xe.DyFM_Errors=xe.DyFM_errorsFlag=void 0;var Bk=Ds(),Vk=kr();xe.DyFM_errorsFlag="DyFM-ERRORS-OBJECT";var Kc=class extends Vk.DyFM_Metadata{flag=xe.DyFM_errorsFlag;source;issuer;username;versions=[];localTime;region;message;exception;exceptionObj;stackTrace=[];error;count=1;d_error;additionalContent;level;priority;duplications=[];constructor(e){super(e),e&&Object.assign(this,e)}};xe.DyFM_Errors=Kc;xe.DyFM_errors_dataParams=new Bk.DyFM_DataModel_Params({dataName:"errors",properties:{flag:{type:"string"},issuer:{type:"string"},username:{type:"string"},versions:{type:"string[]"},localTime:{type:"string"},region:{type:"string"},message:{type:"string"},exception:{type:"string"},exceptionObj:{type:"any"},stackTrace:{type:"string[]"},error:{type:"any"},count:{type:"number"},d_error:{type:"DyFM_Error"},additionalContent:{type:"any"},level:{type:"DyFM_ErrorLevel"},priority:{type:"number"},duplications:{type:"DyNTS_Error[]"}}})});var yy=f(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0})});var my=f(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0})});var gy=f(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0})});var Sy=f(Oy=>{"use strict";Object.defineProperty(Oy,"__esModule",{value:!0})});var qy=f(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0})});var jy=f(My=>{"use strict";Object.defineProperty(My,"__esModule",{value:!0})});var Ay=f(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0})});var Ey=f(Fy=>{"use strict";Object.defineProperty(Fy,"__esModule",{value:!0})});var Dy=f(xy=>{"use strict";Object.defineProperty(xy,"__esModule",{value:!0})});var Iy=f(ky=>{"use strict";Object.defineProperty(ky,"__esModule",{value:!0})});var Cy=f(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0})});var Ny=f(Ry=>{"use strict";Object.defineProperty(Ry,"__esModule",{value:!0})});var Uy=f($y=>{"use strict";Object.defineProperty($y,"__esModule",{value:!0})});var Wy=f(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.DyFM_SpecialSearch_Type=void 0;var Ty=function(t){return t.stringListSearchAny="stringListSearchAny",t.stringListSearch="stringListSearch",t.stringListSearchOrdered="stringListSearchOrdered",t}(Ty||(au.DyFM_SpecialSearch_Type=Ty={}))});var Vy=f(By=>{"use strict";Object.defineProperty(By,"__esModule",{value:!0})});var iu=f(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});var S=(hu(),tl(vu));S.__exportStar(pu(),O);S.__exportStar(yu(),O);S.__exportStar(Al(),O);S.__exportStar(Fl(),O);S.__exportStar(wt(),O);S.__exportStar(El(),O);S.__exportStar(Fu(),O);S.__exportStar(Il(),O);S.__exportStar(Du(),O);S.__exportStar(he(),O);S.__exportStar(Ll(),O);S.__exportStar(bn(),O);S.__exportStar(Fr(),O);S.__exportStar(Ru(),O);S.__exportStar(Lu(),O);S.__exportStar(ju(),O);S.__exportStar(Cl(),O);S.__exportStar(Uu(),O);S.__exportStar(vf(),O);S.__exportStar(pf(),O);S.__exportStar(Mt(),O);S.__exportStar(yf(),O);S.__exportStar(ds(),O);S.__exportStar(hs(),O);S.__exportStar(_f(),O);S.__exportStar(mf(),O);S.__exportStar(bf(),O);S.__exportStar(jt(),O);S.__exportStar(ms(),O);S.__exportStar(gf(),O);S.__exportStar(gs(),O);S.__exportStar(qt(),O);S.__exportStar(wf(),O);S.__exportStar(jf(),O);S.__exportStar(Af(),O);S.__exportStar(Ef(),O);S.__exportStar(Ou(),O);S.__exportStar(gu(),O);S.__exportStar(Su(),O);S.__exportStar(Ds(),O);S.__exportStar(ws(),O);S.__exportStar(Bn(),O);S.__exportStar(cy(),O);S.__exportStar(ly(),O);S.__exportStar(fy(),O);S.__exportStar(vy(),O);S.__exportStar(Fs(),O);S.__exportStar(Ms(),O);S.__exportStar(Ps(),O);S.__exportStar(hy(),O);S.__exportStar(kr(),O);S.__exportStar(yy(),O);S.__exportStar(my(),O);S.__exportStar(gy(),O);S.__exportStar(Sy(),O);S.__exportStar(qy(),O);S.__exportStar(jy(),O);S.__exportStar(Ay(),O);S.__exportStar(Ey(),O);S.__exportStar(Dy(),O);S.__exportStar(Iy(),O);S.__exportStar(Cy(),O);S.__exportStar(Ny(),O);S.__exportStar(Uy(),O);S.__exportStar(Wy(),O);S.__exportStar(Vy(),O)});var zy="1.1.3138";var Yy={baseUrl:"MISSING",api:{baseUrl:"MISSING"},production:!1,version:zy};var zk=function(t){return t.openAi="open-ai",t.anthropic="anthropic",t.google="google",t.deepseek="deepseek",t.fdpAi="fdp-ai",t.customLocalAi="custom-local-ai",t}(zk||{});var Yk=function(t){return t.openAi="open-ai",t.localAi="local-ai",t.routing="routing",t}(Yk||{});var Jk=function(t){return t.discord="discord",t.signal="signal",t.teams="teams",t.routing="routing",t}(Jk||{});var uu=function(t){return t.vaultKey="vault-key",t.instanceRegistry="instance-registry",t.general="general",t.llmProviders="llm-providers",t.messageProviders="message-providers",t.modelTesting="model-testing",t.discordAccess="discord-access",t.voice="voice",t.visuals="visuals",t.soul="soul",t.mcp="mcp",t.cliTools="cli-tools",t.secretVault="secret-vault",t.agentEmail="agent-email",t.embedding="embedding",t.rag="rag",t.developer="developer",t.agentRuntime="agent-runtime",t.agentCronJobs="agent-cron-jobs",t.scheduler="scheduler",t.github="github",t.openclawRegistry="openclaw-registry",t.deviceIdentity="device-identity",t.consultant="consultant",t.caAgent="ca-agent",t.darkOfficeLayout="dark-office-layout",t.cluster="cluster",t}(uu||{});var Gk=function(t){return t.openAi="open-ai",t.leonardo="leonardo",t.fdpai="fdpai",t.routing="routing",t}(Gk||{});var Hk=function(t){return t.elevenLabs="elevenlabs",t.fdpai="fdpai",t.routing="routing",t}(Hk||{});var Zk=function(t){return t.pending="pending",t.running="running",t.completed="completed",t.failed="failed",t}(Zk||{});var Kk=function(t){return t.apiKey="api-key",t.credentials="credentials",t}(Kk||{});var Qk=function(t){return t.req="req",t.bug="bug",t.feature="feature",t.improvement="improvement",t.task="task",t.question="question",t.research="research",t}(Qk||{});var Xk=function(t){return t.low="low",t.medium="medium",t.high="high",t.urgent="urgent",t}(Xk||{});var eI=function(t){return t.todo="todo",t.backlog="backlog",t.bugs="bugs",t.changelog="changelog",t.userInput="user-input",t.status="status",t.testErrorReports="test-error-reports",t}(eI||{});var rI=function(t){return t.update="update",t.remove="remove",t}(rI||{});var tI=function(t){return t.e2e="e2e",t.serverUnit="server-unit",t.clientUnit="client-unit",t.cli="cli",t}(tI||{});var nI=function(t){return t.instant="instant",t.agenticAny="agentic-any",t.ask="ask",t.plan="plan",t}(nI||{});var iI=function(t){return t.full="full",t.askOnly="ask-only",t.planOnly="plan-only",t}(iI||{});var oI=function(t){return t.draft="draft",t.promotedUserInput="promoted-user-input",t.promotedBug="promoted-bug",t.discarded="discarded",t}(oI||{});var aI=function(t){return t.userInput="user-input",t.bugReport="bug-report",t.unspecified="unspecified",t}(aI||{});var uI=function(t){return t.easy="easy",t.medium="medium",t.hard="hard",t.komplex="komplex",t}(uI||{});var Qc="mongodb://200.33.0.101:29017";var sI="A k\xE9r\xE9s nem jutott el a szerverig, vagy nem \xE9rkezett v\xE1lasz. Lehets\xE9ges okok: a szerver nem fut vagy m\xE1s porton hallgat, h\xE1l\xF3zati hiba, a kliens megszak\xEDtotta a k\xE9r\xE9st, vagy m\xE1s origin eset\xE9n CORS blokkolja. Ellen\u0151rizd, hogy a szerver fut-e \xE9s a megadott c\xEDm/port helyes.",cI="Szerver 500-as hiba. A v\xE1lasz body \xFCres vagy nem el\xE9rhet\u0151.",su=class t{static isLikelyHtmlErrorPage(e){let r=e.trim();if(!r.startsWith("<"))return!1;let n=r.toLowerCase();return n.includes("<!doctype")||n.includes("<html")||n.includes("<title>")||n.includes("cannot get")||n.includes("cannot post")||n.includes("cannot put")||n.includes("cannot delete")}static getMessageForHtmlHttpErrorBody(e){let r="R\xE9szletek: szerver log vagy DevTools Network tab.";return e===404?`Az endpoint nem tal\xE1lhat\xF3 (HTTP ${e}). Ellen\u0151rizd az API base URL-t \xE9s a szerver route-okat. `+r:`A szerver HTML error oldalt adott vissza (nem JSON API v\xE1lasz), HTTP ${e}. ${r}`}static getHttpErrorMessage(e,r){if(e.status===0)return sI;let n=r!=null&&typeof r=="string"&&r.trim().length>0?r:null;return n==null&&typeof e.error=="string"&&e.error.trim().length>0&&(n=e.error),n!=null&&t.isLikelyHtmlErrorPage(n)?t.getMessageForHtmlHttpErrorBody(e.status):e.status===500&&!(n!=null&&typeof n=="string"&&n.trim().length>0)?cI:n??e.message??e.statusText??`HTTP ${e.status}`}};var Jy=(()=>{class t{settingsBaseUrl=`${Yy.api.baseUrl}/settings`;http=en(ol);getDefaultWorkspace(){return R(this.http.get(`${this.settingsBaseUrl}/default-workspace`))}getSection(r){return R(this.http.get(`${this.settingsBaseUrl}/get-section/${r}`))}getRequiredWarningsSummary(){return R(this.http.get(`${this.settingsBaseUrl}/required-warnings-summary`))}saveSection(r,n){return R(this.http.patch(`${this.settingsBaseUrl}/save-section/${r}`,n))}postProviderAccessAllow(r){return R(this.http.post(`${this.settingsBaseUrl}/provider-access/allow`,r))}getSoulStatus(){return R(this.http.get(`${this.settingsBaseUrl}/soul-status`))}getSoulContent(){return R(this.http.get(`${this.settingsBaseUrl}/soul-content`))}postGenerateSoul(r){return R(this.http.post(`${this.settingsBaseUrl}/generate-soul`,r))}postTestLlmProvider(r){return R(this.http.post(`${this.settingsBaseUrl}/test-llm-provider`,r))}postListLlmModels(r){return R(this.http.post(`${this.settingsBaseUrl}/list-llm-models`,r))}postListEmbeddingModels(r){return R(this.http.post(`${this.settingsBaseUrl}/list-embedding-models`,r))}postTestMessagingProvider(r){return R(this.http.post(`${this.settingsBaseUrl}/test-messaging-provider`,r))}postMcpSync(r){return R(this.http.post(`${this.settingsBaseUrl}/mcp-sync`,r))}postCliHelpProbe(r){return R(this.http.post(`${this.settingsBaseUrl}/cli-help-probe`,r))}postCliHelpSuggest(r){return R(this.http.post(`${this.settingsBaseUrl}/cli-help-suggest`,r))}postTestAgentEmail(){return R(this.http.post(`${this.settingsBaseUrl}/test-agent-email`,{}))}testOpenclawConnection(r){return R(this.http.post(`${this.settingsBaseUrl}/test-openclaw-connection`,r))}pairOpenclawInstance(r){return R(this.http.post(`${this.settingsBaseUrl}/openclaw-registry/${r.instanceId}/pair`,{}))}getClusterDiagnostics(){return R(this.http.get(`${this.settingsBaseUrl}/cluster/diagnostics`))}postClusterReBootstrap(){return R(this.http.post(`${this.settingsBaseUrl}/cluster/re-bootstrap`,{}))}postClusterReconnectWs(){return R(this.http.post(`${this.settingsBaseUrl}/cluster/reconnect-ws`,{}))}postClusterReconnectPeer(r){let n=encodeURIComponent(r);return R(this.http.post(`${this.settingsBaseUrl}/cluster/reconnect-ws/${n}`,{}))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=Xt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Gy=rl(iu());var Xc=rl(iu());var cu=class{_master;get master(){return this._master}setupMaster(e){this._master=e}};var lu=class t extends cu{settings_AS=en(Jy);loading_$=ke(!1);loadError_$=ke(null);saving_$=ke(!1);saveError_$=ke(null);load(){return U(this,null,function*(){this.loading_$.set(!0),this.loadError_$.set(null);try{yield this.doLoad()}catch(e){Xc.DyFM_Error.logSimple(`${this.constructor.name} | Failed to load section`,e);let r=t.getErrorMessage(e);this.loadError_$.set(r)}finally{this.loading_$.set(!1)}})}save(){return U(this,null,function*(){this.saving_$.set(!0),this.saveError_$.set(null);try{let e=this.buildSaveBody(),r=yield this.doSave(e);return r.success?yield this.load():this.saveError_$.set(r.error??"Ment\xE9s sikertelen."),r}catch(e){Xc.DyFM_Error.logSimple(`${this.constructor.name} | Failed to save section`,e);let r=t.getErrorMessage(e);return this.saveError_$.set(r),{success:!1,error:r}}finally{this.saving_$.set(!1)}})}doSave(e){return U(this,null,function*(){return this.settings_AS.saveSection(this.getSectionId(),e)})}static getErrorMessage(e){if(e instanceof il){let r=e.error,n=null;if(r!==null&&typeof r=="object"){let i=r;typeof i.error=="string"?n=i.error:i.error!=null?n=String(i.error):typeof i.message=="string"&&(n=i.message);let o=i.errorCode,a=typeof o=="string"&&o.trim().length>0?o.trim():void 0;a!==void 0&&(n!=null&&n.trim().length>0?n=`${a}: ${n}`:n=a)}else typeof r=="string"&&(n=r);return su.getHttpErrorMessage(e,n)}return e instanceof Error?e.message||"M\u0171velet sikertelen.":String(e)||"M\u0171velet sikertelen."}};var X4=(()=>{class t extends lu{defaultWorkspacePath_$=ke("");section_$=ke({form:{mongodbUri:Qc,useOpenClawPath:!1,defaultPathOverride:"",autoStartWithSystem:!1,useLiveContext:!0,reportSocketConnectionErrorsToErrorList:!1,agenticLoopDebriefEnabled:!1,mobileAutoUpdateEnabled:!1,serverAutoUpdateEnabled:!1,serverAutoUpdateCheckInterval:"daily",ccSessionRunnerGracePeriodSec:null,ccSessionRunnerIdleTimeoutSec:null,ccSessionAutoArchiveScanIntervalSec:null,ccSessionAutoArchiveAgeDays:null,ccSessionAutoArchiveCountThreshold:null},runtime:{}});updateForm(r){this.section_$.update(n=>Sr(oe({},n),{form:oe(oe({},n.form),r)}))}setSection(r){this.section_$.set(r)}updateGeneralForm(r){this.updateForm(r),this.master?.bumpDigest()}getSectionId(){return uu.general}getSection_$(){return this.section_$}loadDefaultWorkspacePath(){return U(this,null,function*(){try{let r=yield this.settings_AS.getDefaultWorkspace();this.defaultWorkspacePath_$.set(r.workspacePath?.trim()??"")}catch(r){Gy.DyFM_Error.logSimple("CCAP_SettingsGeneral_DS | loadDefaultWorkspacePath failed",r),this.defaultWorkspacePath_$.set("")}})}doLoad(){return U(this,null,function*(){let r=yield this.settings_AS.getSection(uu.general);this.setSection({form:{mongodbUri:typeof r.mongodbUri=="string"?r.mongodbUri:Qc,useOpenClawPath:typeof r.useOpenClawPath=="boolean"?r.useOpenClawPath:!1,defaultPathOverride:typeof r.defaultPathOverride=="string"?r.defaultPathOverride:"",autoStartWithSystem:typeof r.autoStartWithSystem=="boolean"?r.autoStartWithSystem:!1,useLiveContext:typeof r.useLiveContext=="boolean"?r.useLiveContext:!0,reportSocketConnectionErrorsToErrorList:typeof r.reportSocketConnectionErrorsToErrorList=="boolean"?r.reportSocketConnectionErrorsToErrorList:!1,agenticLoopDebriefEnabled:typeof r.agenticLoopDebriefEnabled=="boolean"?r.agenticLoopDebriefEnabled:!1,mobileAutoUpdateEnabled:typeof r.mobileAutoUpdateEnabled=="boolean"?r.mobileAutoUpdateEnabled:!1,serverAutoUpdateEnabled:typeof r.serverAutoUpdateEnabled=="boolean"?r.serverAutoUpdateEnabled:!1,serverAutoUpdateCheckInterval:r.serverAutoUpdateCheckInterval==="daily"?"daily":r.serverAutoUpdateCheckInterval==="weekly"?"weekly":"daily",ccSessionRunnerGracePeriodSec:typeof r.ccSessionRunnerGracePeriodSec=="number"&&r.ccSessionRunnerGracePeriodSec>0?r.ccSessionRunnerGracePeriodSec:null,ccSessionRunnerIdleTimeoutSec:typeof r.ccSessionRunnerIdleTimeoutSec=="number"&&r.ccSessionRunnerIdleTimeoutSec>0?r.ccSessionRunnerIdleTimeoutSec:null,ccSessionAutoArchiveScanIntervalSec:typeof r.ccSessionAutoArchiveScanIntervalSec=="number"&&r.ccSessionAutoArchiveScanIntervalSec>0?r.ccSessionAutoArchiveScanIntervalSec:null,ccSessionAutoArchiveAgeDays:typeof r.ccSessionAutoArchiveAgeDays=="number"&&r.ccSessionAutoArchiveAgeDays>0?r.ccSessionAutoArchiveAgeDays:null,ccSessionAutoArchiveCountThreshold:typeof r.ccSessionAutoArchiveCountThreshold=="number"&&r.ccSessionAutoArchiveCountThreshold>0?r.ccSessionAutoArchiveCountThreshold:null},runtime:{}})})}buildSaveBody(){let r=this.section_$().form;return{mongodbUri:r.mongodbUri,useOpenClawPath:r.useOpenClawPath,defaultPathOverride:r.defaultPathOverride,autoStartWithSystem:r.autoStartWithSystem,useLiveContext:r.useLiveContext,reportSocketConnectionErrorsToErrorList:r.reportSocketConnectionErrorsToErrorList,agenticLoopDebriefEnabled:r.agenticLoopDebriefEnabled,mobileAutoUpdateEnabled:r.mobileAutoUpdateEnabled,serverAutoUpdateEnabled:r.serverAutoUpdateEnabled,serverAutoUpdateCheckInterval:r.serverAutoUpdateCheckInterval,ccSessionRunnerGracePeriodSec:r.ccSessionRunnerGracePeriodSec??void 0,ccSessionRunnerIdleTimeoutSec:r.ccSessionRunnerIdleTimeoutSec??void 0,ccSessionAutoArchiveScanIntervalSec:r.ccSessionAutoArchiveScanIntervalSec??void 0,ccSessionAutoArchiveAgeDays:r.ccSessionAutoArchiveAgeDays??void 0,ccSessionAutoArchiveCountThreshold:r.ccSessionAutoArchiveCountThreshold??void 0}}static \u0275fac=(()=>{let r;return function(i){return(r||(r=nl(t)))(i||t)}})();static \u0275prov=Xt({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{vu as a,hu as b,Al as c,wt as d,he as e,El as f,Fu as g,bn as h,Fr as i,ds as j,kr as k,Bn as l,Ds as m,uy as n,ly as o,iu as p,zk as q,Yk as r,Jk as s,uu as t,Gk as u,Hk as v,Zk as w,Kk as x,Qk as y,oI as z,aI as A,uI as B,Xk as C,eI as D,rI as E,tI as F,nI as G,iI as H,Yy as I,Qc as J,su as K,Jy as L,lu as M,X4 as N};
|
|
212
|
+
//# sourceMappingURL=chunk-KPYMFKWR.js.map
|