@futdevpro/ccap 1.1.3441 → 1.1.3447
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-4ADMPXCV.js → agent-instances.module-W3REXD56.js} +2 -2
- package/client-dist/{ca.module-RVGC3WQC.js → ca.module-TQ4WHOMF.js} +2 -2
- package/client-dist/{cc-usage-dashboard.component-OQS2BC4L.js → cc-usage-dashboard.component-TGLYNCLF.js} +2 -2
- package/client-dist/{cc.module-SPB35JNX.js → cc.module-YMTBVD35.js} +2 -2
- package/client-dist/{chunk-R2IBKJ4K.js → chunk-2EBLV6GJ.js} +2 -2
- package/client-dist/{chunk-OKTAADTQ.js → chunk-4GTK6NMH.js} +2 -2
- package/client-dist/{chunk-BQTJHETS.js → chunk-5HNAJSRW.js} +2 -2
- package/client-dist/{chunk-2ATSF4KC.js → chunk-6AFPKEHZ.js} +2 -2
- package/client-dist/{chunk-Y6V4NGLU.js → chunk-6TE4LLRT.js} +2 -2
- package/client-dist/{chunk-Y6V4NGLU.js.map → chunk-6TE4LLRT.js.map} +1 -1
- package/client-dist/{chunk-MO37SUK2.js → chunk-6XSACJBG.js} +2 -2
- package/client-dist/{chunk-VMXIXZV2.js → chunk-77JJATPE.js} +2 -2
- package/client-dist/{chunk-3HJWN4W6.js → chunk-7GEAKPVD.js} +2 -2
- package/client-dist/{chunk-RAHCHCWR.js → chunk-A3CDBCDP.js} +2 -2
- package/client-dist/{chunk-KBMXCICX.js → chunk-ACWNNQIT.js} +2 -2
- package/client-dist/{chunk-RCCUSGIN.js → chunk-AGMHTMQA.js} +2 -2
- package/client-dist/{chunk-AMROWQBM.js → chunk-BFYF3IU4.js} +2 -2
- package/client-dist/{chunk-B25EGDHU.js → chunk-BNU5THES.js} +2 -2
- package/client-dist/{chunk-ZCHMBEHT.js → chunk-BQAILW64.js} +2 -2
- package/client-dist/{chunk-PZN2OI7U.js → chunk-C6J25IMQ.js} +2 -2
- package/client-dist/{chunk-N55GOFVU.js → chunk-CZLRKXDU.js} +2 -2
- package/client-dist/{chunk-RL5LPTPO.js → chunk-DEAFTFFH.js} +2 -2
- package/client-dist/{chunk-YN4H6MW2.js → chunk-E6C6MLAE.js} +2 -2
- package/client-dist/{chunk-WRI37SX4.js → chunk-F455BZKF.js} +2 -2
- package/client-dist/{chunk-FRVRMJQF.js → chunk-FOLWKVUD.js} +2 -2
- package/client-dist/{chunk-EVMDNGBK.js → chunk-GIEG6TTL.js} +3 -3
- package/client-dist/chunk-GIEG6TTL.js.map +1 -0
- package/client-dist/{chunk-OYB7GU43.js → chunk-GYSREL5Z.js} +2 -2
- package/client-dist/{chunk-NNUHTCXG.js → chunk-HFDLUJ4U.js} +2 -2
- package/client-dist/{chunk-IVLMVAVJ.js → chunk-HS5KMAZC.js} +2 -2
- package/client-dist/{chunk-VDQROW6J.js → chunk-HZ3SDWNT.js} +2 -2
- package/client-dist/{chunk-KIKSSJKL.js → chunk-I7XAQJ7K.js} +2 -2
- package/client-dist/{chunk-HD4CODAD.js → chunk-ITSH6RYG.js} +2 -2
- package/client-dist/{chunk-AM5URSKV.js → chunk-K3UWZKRD.js} +2 -2
- package/client-dist/{chunk-TWK7BOB7.js → chunk-KDPOJH6B.js} +2 -2
- package/client-dist/{chunk-U62YECNK.js → chunk-KKDWUDRS.js} +2 -2
- package/client-dist/{chunk-ESIGVRCK.js → chunk-LUV3FOSG.js} +2 -2
- package/client-dist/{chunk-F6VMAVI5.js → chunk-MY244SUO.js} +2 -2
- package/client-dist/{chunk-QUEYZI42.js → chunk-O3CN5GI3.js} +2 -2
- package/client-dist/{chunk-TNLHQRL7.js → chunk-O4EWDG7M.js} +2 -2
- package/client-dist/{chunk-XLSL262Q.js → chunk-P7TYGGJE.js} +2 -2
- package/client-dist/{chunk-UOC6UYZT.js → chunk-PG4M4ZHN.js} +2 -2
- package/client-dist/{chunk-Z5FUR5ZW.js → chunk-PIQK6O5O.js} +2 -2
- package/client-dist/{chunk-AR6EOT63.js → chunk-PQEIFO6Y.js} +2 -2
- package/client-dist/{chunk-SDVXPGB7.js → chunk-QSN7KY5M.js} +2 -2
- package/client-dist/{chunk-4EV32FFZ.js → chunk-QTOWXHVD.js} +2 -2
- package/client-dist/{chunk-4LCJ4GNK.js → chunk-ROLHXND4.js} +2 -2
- package/client-dist/{chunk-PVSQ5ZEZ.js → chunk-RPTXBYC4.js} +2 -2
- package/client-dist/{chunk-5NW5UGVZ.js → chunk-RZBXT5HF.js} +2 -2
- package/client-dist/{chunk-COOWEMEW.js → chunk-SDRBFR4F.js} +2 -2
- package/client-dist/{chunk-GBOES7QW.js → chunk-T4OXQXNG.js} +2 -2
- package/client-dist/{chunk-IUAZJ3PT.js → chunk-UFASD7B2.js} +2 -2
- package/client-dist/{chunk-E3JXFFHE.js → chunk-UKRECFE4.js} +2 -2
- package/client-dist/{chunk-QUD3BEHN.js → chunk-VJ343CWZ.js} +2 -2
- package/client-dist/{chunk-IFYHOOVA.js → chunk-VOEXOXIB.js} +2 -2
- package/client-dist/{chunk-ZPJ6KYMA.js → chunk-VPHQR3SZ.js} +2 -2
- package/client-dist/{chunk-GTERKRTR.js → chunk-WDUO4IJE.js} +2 -2
- package/client-dist/{chunk-VQ4GBHH7.js → chunk-WJCSS2XZ.js} +2 -2
- package/client-dist/{chunk-LPNQ5PRN.js → chunk-WW4VCBEU.js} +2 -2
- package/client-dist/{chunk-I3FSMGMK.js → chunk-XLKBCO5O.js} +2 -2
- package/client-dist/{chunk-4H3E32UH.js → chunk-XZRD3UM5.js} +2 -2
- package/client-dist/{chunk-ONS7XQYD.js → chunk-YWVKQVNA.js} +2 -2
- package/client-dist/{chunk-MYVEHPA7.js → chunk-Z3OBNB3J.js} +2 -2
- package/client-dist/{consultant.module-UWXLFLDS.js → consultant.module-2SDJBVP3.js} +2 -2
- package/client-dist/{crd.module-2I2BDC3A.js → crd.module-IWMW2SSQ.js} +2 -2
- package/client-dist/{dashboard.module-X2A6LOTA.js → dashboard.module-AIDMW46S.js} +2 -2
- package/client-dist/{do.module-CJWEKZ4L.js → do.module-X7OAX4DD.js} +2 -2
- package/client-dist/{document-library.module-WJSFZPA7.js → document-library.module-IOCM265I.js} +2 -2
- package/client-dist/{embedding-eval.module-FOALIAQW.js → embedding-eval.module-KCJREZY3.js} +2 -2
- package/client-dist/{embedding-registry.module-SS646R4H.js → embedding-registry.module-XQXYNVGG.js} +2 -2
- package/client-dist/{err.module-SR4ZAOQH.js → err.module-VWGZT7Z4.js} +2 -2
- package/client-dist/{feedback.module-T3MZQKXV.js → feedback.module-P4XLXCPD.js} +2 -2
- package/client-dist/{host-runtime-mcp.module-FBZZGQGD.js → host-runtime-mcp.module-JBSXKARK.js} +2 -2
- package/client-dist/index.html +1 -1
- package/client-dist/{live-dev-pipeline.module-OKQYFSJL.js → live-dev-pipeline.module-B66G4DQO.js} +2 -2
- package/client-dist/{logs.module-SHHOD5XW.js → logs.module-F7SAEBD3.js} +2 -2
- package/client-dist/{main-L3WW2VTB.js → main-FD4U5Q57.js} +3 -3
- package/client-dist/{master-control-remote-poc.module-ITXHYU5K.js → master-control-remote-poc.module-M66UBNEO.js} +2 -2
- package/client-dist/{mobile-app.module-Q3W3PU4O.js → mobile-app.module-Z22J4W6C.js} +2 -2
- package/client-dist/{model-registry.module-DGN55LTQ.js → model-registry.module-CWMA4CT5.js} +2 -2
- package/client-dist/{oc.module-DYSATWML.js → oc.module-HIXCQOOF.js} +2 -2
- package/client-dist/{orc.module-NQO6OLPK.js → orc.module-YEZN4Q7U.js} +2 -2
- package/client-dist/{project-management.module-T7NBKKSR.js → project-management.module-CB6D2EUD.js} +2 -2
- package/client-dist/project-source-routed.module-CYG342BA.js +2 -0
- package/client-dist/{scheduler.module-4CMBOTGZ.js → scheduler.module-V5JCK6QF.js} +2 -2
- package/client-dist/{session.module-V4SRPQRZ.js → session.module-QZLOBMOL.js} +2 -2
- package/client-dist/{set.module-32SVEWTG.js → set.module-EVAQ6TXH.js} +2 -2
- package/client-dist/{setup.module-5T6MCMR4.js → setup.module-D2TCNKBN.js} +2 -2
- package/client-dist/{terminals.module-AQO2TVO2.js → terminals.module-LABJDNT5.js} +2 -2
- package/client-dist/{voice-notes-poc.module-EI2HY7YJ.js → voice-notes-poc.module-IST3HNZW.js} +2 -2
- package/client-dist/{wfs.module-AHRZE5WB.js → wfs.module-ETTOPBME.js} +2 -2
- package/package.json +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/cc-stream-parser.util.d.ts +23 -0
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/cc-stream-parser.util.d.ts.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/cc-stream-parser.util.js +109 -3
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/cc-stream-parser.util.js.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-manager.control-service.d.ts +14 -73
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-manager.control-service.d.ts.map +1 -1
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-manager.control-service.js +18 -89
- package/server/build/src/_modules/external-sessions/_modules/claude-code/_services/core/cc-manager.control-service.js.map +1 -1
- package/server/build/src/_modules/setup-config/_collections/utils/auto-update/sc-server-auto-update.util.d.ts.map +1 -1
- package/server/build/src/_modules/setup-config/_collections/utils/auto-update/sc-server-auto-update.util.js +19 -32
- package/server/build/src/_modules/setup-config/_collections/utils/auto-update/sc-server-auto-update.util.js.map +1 -1
- package/server/build/src/_modules/setup-config/_collections/utils/auto-update/sc-server-auto-update.util.spec.js +32 -79
- package/server/build/src/_modules/setup-config/_collections/utils/auto-update/sc-server-auto-update.util.spec.js.map +1 -1
- package/server/build/src/_modules/setup-config/_collections/utils/npm-latest-cache/sc-npm-latest-cache-entry.interface.d.ts +14 -0
- package/server/build/src/_modules/setup-config/_collections/utils/npm-latest-cache/sc-npm-latest-cache-entry.interface.d.ts.map +1 -0
- package/server/build/src/_modules/setup-config/_collections/utils/npm-latest-cache/sc-npm-latest-cache-entry.interface.js +3 -0
- package/server/build/src/_modules/setup-config/_collections/utils/npm-latest-cache/sc-npm-latest-cache-entry.interface.js.map +1 -0
- package/server/build/src/_modules/setup-config/_collections/utils/npm-latest-cache/sc-npm-latest-cache.util.d.ts +59 -0
- package/server/build/src/_modules/setup-config/_collections/utils/npm-latest-cache/sc-npm-latest-cache.util.d.ts.map +1 -0
- package/server/build/src/_modules/setup-config/_collections/utils/npm-latest-cache/sc-npm-latest-cache.util.js +166 -0
- package/server/build/src/_modules/setup-config/_collections/utils/npm-latest-cache/sc-npm-latest-cache.util.js.map +1 -0
- package/server/build/src/_modules/setup-config/_collections/utils/npm-latest-cache/sc-npm-latest-cache.util.spec.d.ts +6 -0
- package/server/build/src/_modules/setup-config/_collections/utils/npm-latest-cache/sc-npm-latest-cache.util.spec.d.ts.map +1 -0
- package/server/build/src/_modules/setup-config/_collections/utils/npm-latest-cache/sc-npm-latest-cache.util.spec.js +135 -0
- package/server/build/src/_modules/setup-config/_collections/utils/npm-latest-cache/sc-npm-latest-cache.util.spec.js.map +1 -0
- package/server/build/src/_modules/setup-config/_collections/utils/spawn-ccap-update/sc-spawn-ccap-update-result.interface.d.ts +18 -0
- package/server/build/src/_modules/setup-config/_collections/utils/spawn-ccap-update/sc-spawn-ccap-update-result.interface.d.ts.map +1 -0
- package/server/build/src/_modules/setup-config/_collections/utils/spawn-ccap-update/sc-spawn-ccap-update-result.interface.js +3 -0
- package/server/build/src/_modules/setup-config/_collections/utils/spawn-ccap-update/sc-spawn-ccap-update-result.interface.js.map +1 -0
- package/server/build/src/_modules/setup-config/_collections/utils/spawn-ccap-update/sc-spawn-ccap-update.util.d.ts +37 -0
- package/server/build/src/_modules/setup-config/_collections/utils/spawn-ccap-update/sc-spawn-ccap-update.util.d.ts.map +1 -0
- package/server/build/src/_modules/setup-config/_collections/utils/spawn-ccap-update/sc-spawn-ccap-update.util.js +135 -0
- package/server/build/src/_modules/setup-config/_collections/utils/spawn-ccap-update/sc-spawn-ccap-update.util.js.map +1 -0
- package/server/build/src/_modules/setup-config/_collections/utils/spawn-ccap-update/sc-spawn-ccap-update.util.spec.d.ts +8 -0
- package/server/build/src/_modules/setup-config/_collections/utils/spawn-ccap-update/sc-spawn-ccap-update.util.spec.d.ts.map +1 -0
- package/server/build/src/_modules/setup-config/_collections/utils/spawn-ccap-update/sc-spawn-ccap-update.util.spec.js +109 -0
- package/server/build/src/_modules/setup-config/_collections/utils/spawn-ccap-update/sc-spawn-ccap-update.util.spec.js.map +1 -0
- package/server/build/src/_modules/setup-config/_collections/utils/update-error-buffer-replay/sc-update-error-buffer-replay.util.d.ts +6 -0
- package/server/build/src/_modules/setup-config/_collections/utils/update-error-buffer-replay/sc-update-error-buffer-replay.util.d.ts.map +1 -1
- package/server/build/src/_modules/setup-config/_collections/utils/update-error-buffer-replay/sc-update-error-buffer-replay.util.js +12 -0
- package/server/build/src/_modules/setup-config/_collections/utils/update-error-buffer-replay/sc-update-error-buffer-replay.util.js.map +1 -1
- package/server/build/src/_modules/setup-config/_services/control-services/sc-server-status.control-service.d.ts +13 -17
- package/server/build/src/_modules/setup-config/_services/control-services/sc-server-status.control-service.d.ts.map +1 -1
- package/server/build/src/_modules/setup-config/_services/control-services/sc-server-status.control-service.js +44 -50
- package/server/build/src/_modules/setup-config/_services/control-services/sc-server-status.control-service.js.map +1 -1
- package/server/build/src/app.server.d.ts.map +1 -1
- package/server/build/src/app.server.js +4 -9
- package/server/build/src/app.server.js.map +1 -1
- package/client-dist/chunk-EVMDNGBK.js.map +0 -1
- package/client-dist/project-source-routed.module-YO54LEGN.js +0 -2
- /package/client-dist/{agent-instances.module-4ADMPXCV.js.map → agent-instances.module-W3REXD56.js.map} +0 -0
- /package/client-dist/{ca.module-RVGC3WQC.js.map → ca.module-TQ4WHOMF.js.map} +0 -0
- /package/client-dist/{cc-usage-dashboard.component-OQS2BC4L.js.map → cc-usage-dashboard.component-TGLYNCLF.js.map} +0 -0
- /package/client-dist/{cc.module-SPB35JNX.js.map → cc.module-YMTBVD35.js.map} +0 -0
- /package/client-dist/{chunk-R2IBKJ4K.js.map → chunk-2EBLV6GJ.js.map} +0 -0
- /package/client-dist/{chunk-OKTAADTQ.js.map → chunk-4GTK6NMH.js.map} +0 -0
- /package/client-dist/{chunk-BQTJHETS.js.map → chunk-5HNAJSRW.js.map} +0 -0
- /package/client-dist/{chunk-2ATSF4KC.js.map → chunk-6AFPKEHZ.js.map} +0 -0
- /package/client-dist/{chunk-MO37SUK2.js.map → chunk-6XSACJBG.js.map} +0 -0
- /package/client-dist/{chunk-VMXIXZV2.js.map → chunk-77JJATPE.js.map} +0 -0
- /package/client-dist/{chunk-3HJWN4W6.js.map → chunk-7GEAKPVD.js.map} +0 -0
- /package/client-dist/{chunk-RAHCHCWR.js.map → chunk-A3CDBCDP.js.map} +0 -0
- /package/client-dist/{chunk-KBMXCICX.js.map → chunk-ACWNNQIT.js.map} +0 -0
- /package/client-dist/{chunk-RCCUSGIN.js.map → chunk-AGMHTMQA.js.map} +0 -0
- /package/client-dist/{chunk-AMROWQBM.js.map → chunk-BFYF3IU4.js.map} +0 -0
- /package/client-dist/{chunk-B25EGDHU.js.map → chunk-BNU5THES.js.map} +0 -0
- /package/client-dist/{chunk-ZCHMBEHT.js.map → chunk-BQAILW64.js.map} +0 -0
- /package/client-dist/{chunk-PZN2OI7U.js.map → chunk-C6J25IMQ.js.map} +0 -0
- /package/client-dist/{chunk-N55GOFVU.js.map → chunk-CZLRKXDU.js.map} +0 -0
- /package/client-dist/{chunk-RL5LPTPO.js.map → chunk-DEAFTFFH.js.map} +0 -0
- /package/client-dist/{chunk-YN4H6MW2.js.map → chunk-E6C6MLAE.js.map} +0 -0
- /package/client-dist/{chunk-WRI37SX4.js.map → chunk-F455BZKF.js.map} +0 -0
- /package/client-dist/{chunk-FRVRMJQF.js.map → chunk-FOLWKVUD.js.map} +0 -0
- /package/client-dist/{chunk-OYB7GU43.js.map → chunk-GYSREL5Z.js.map} +0 -0
- /package/client-dist/{chunk-NNUHTCXG.js.map → chunk-HFDLUJ4U.js.map} +0 -0
- /package/client-dist/{chunk-IVLMVAVJ.js.map → chunk-HS5KMAZC.js.map} +0 -0
- /package/client-dist/{chunk-VDQROW6J.js.map → chunk-HZ3SDWNT.js.map} +0 -0
- /package/client-dist/{chunk-KIKSSJKL.js.map → chunk-I7XAQJ7K.js.map} +0 -0
- /package/client-dist/{chunk-HD4CODAD.js.map → chunk-ITSH6RYG.js.map} +0 -0
- /package/client-dist/{chunk-AM5URSKV.js.map → chunk-K3UWZKRD.js.map} +0 -0
- /package/client-dist/{chunk-TWK7BOB7.js.map → chunk-KDPOJH6B.js.map} +0 -0
- /package/client-dist/{chunk-U62YECNK.js.map → chunk-KKDWUDRS.js.map} +0 -0
- /package/client-dist/{chunk-ESIGVRCK.js.map → chunk-LUV3FOSG.js.map} +0 -0
- /package/client-dist/{chunk-F6VMAVI5.js.map → chunk-MY244SUO.js.map} +0 -0
- /package/client-dist/{chunk-QUEYZI42.js.map → chunk-O3CN5GI3.js.map} +0 -0
- /package/client-dist/{chunk-TNLHQRL7.js.map → chunk-O4EWDG7M.js.map} +0 -0
- /package/client-dist/{chunk-XLSL262Q.js.map → chunk-P7TYGGJE.js.map} +0 -0
- /package/client-dist/{chunk-UOC6UYZT.js.map → chunk-PG4M4ZHN.js.map} +0 -0
- /package/client-dist/{chunk-Z5FUR5ZW.js.map → chunk-PIQK6O5O.js.map} +0 -0
- /package/client-dist/{chunk-AR6EOT63.js.map → chunk-PQEIFO6Y.js.map} +0 -0
- /package/client-dist/{chunk-SDVXPGB7.js.map → chunk-QSN7KY5M.js.map} +0 -0
- /package/client-dist/{chunk-4EV32FFZ.js.map → chunk-QTOWXHVD.js.map} +0 -0
- /package/client-dist/{chunk-4LCJ4GNK.js.map → chunk-ROLHXND4.js.map} +0 -0
- /package/client-dist/{chunk-PVSQ5ZEZ.js.map → chunk-RPTXBYC4.js.map} +0 -0
- /package/client-dist/{chunk-5NW5UGVZ.js.map → chunk-RZBXT5HF.js.map} +0 -0
- /package/client-dist/{chunk-COOWEMEW.js.map → chunk-SDRBFR4F.js.map} +0 -0
- /package/client-dist/{chunk-GBOES7QW.js.map → chunk-T4OXQXNG.js.map} +0 -0
- /package/client-dist/{chunk-IUAZJ3PT.js.map → chunk-UFASD7B2.js.map} +0 -0
- /package/client-dist/{chunk-E3JXFFHE.js.map → chunk-UKRECFE4.js.map} +0 -0
- /package/client-dist/{chunk-QUD3BEHN.js.map → chunk-VJ343CWZ.js.map} +0 -0
- /package/client-dist/{chunk-IFYHOOVA.js.map → chunk-VOEXOXIB.js.map} +0 -0
- /package/client-dist/{chunk-ZPJ6KYMA.js.map → chunk-VPHQR3SZ.js.map} +0 -0
- /package/client-dist/{chunk-GTERKRTR.js.map → chunk-WDUO4IJE.js.map} +0 -0
- /package/client-dist/{chunk-VQ4GBHH7.js.map → chunk-WJCSS2XZ.js.map} +0 -0
- /package/client-dist/{chunk-LPNQ5PRN.js.map → chunk-WW4VCBEU.js.map} +0 -0
- /package/client-dist/{chunk-I3FSMGMK.js.map → chunk-XLKBCO5O.js.map} +0 -0
- /package/client-dist/{chunk-4H3E32UH.js.map → chunk-XZRD3UM5.js.map} +0 -0
- /package/client-dist/{chunk-ONS7XQYD.js.map → chunk-YWVKQVNA.js.map} +0 -0
- /package/client-dist/{chunk-MYVEHPA7.js.map → chunk-Z3OBNB3J.js.map} +0 -0
- /package/client-dist/{consultant.module-UWXLFLDS.js.map → consultant.module-2SDJBVP3.js.map} +0 -0
- /package/client-dist/{crd.module-2I2BDC3A.js.map → crd.module-IWMW2SSQ.js.map} +0 -0
- /package/client-dist/{dashboard.module-X2A6LOTA.js.map → dashboard.module-AIDMW46S.js.map} +0 -0
- /package/client-dist/{do.module-CJWEKZ4L.js.map → do.module-X7OAX4DD.js.map} +0 -0
- /package/client-dist/{document-library.module-WJSFZPA7.js.map → document-library.module-IOCM265I.js.map} +0 -0
- /package/client-dist/{embedding-eval.module-FOALIAQW.js.map → embedding-eval.module-KCJREZY3.js.map} +0 -0
- /package/client-dist/{embedding-registry.module-SS646R4H.js.map → embedding-registry.module-XQXYNVGG.js.map} +0 -0
- /package/client-dist/{err.module-SR4ZAOQH.js.map → err.module-VWGZT7Z4.js.map} +0 -0
- /package/client-dist/{feedback.module-T3MZQKXV.js.map → feedback.module-P4XLXCPD.js.map} +0 -0
- /package/client-dist/{host-runtime-mcp.module-FBZZGQGD.js.map → host-runtime-mcp.module-JBSXKARK.js.map} +0 -0
- /package/client-dist/{live-dev-pipeline.module-OKQYFSJL.js.map → live-dev-pipeline.module-B66G4DQO.js.map} +0 -0
- /package/client-dist/{logs.module-SHHOD5XW.js.map → logs.module-F7SAEBD3.js.map} +0 -0
- /package/client-dist/{main-L3WW2VTB.js.map → main-FD4U5Q57.js.map} +0 -0
- /package/client-dist/{master-control-remote-poc.module-ITXHYU5K.js.map → master-control-remote-poc.module-M66UBNEO.js.map} +0 -0
- /package/client-dist/{mobile-app.module-Q3W3PU4O.js.map → mobile-app.module-Z22J4W6C.js.map} +0 -0
- /package/client-dist/{model-registry.module-DGN55LTQ.js.map → model-registry.module-CWMA4CT5.js.map} +0 -0
- /package/client-dist/{oc.module-DYSATWML.js.map → oc.module-HIXCQOOF.js.map} +0 -0
- /package/client-dist/{orc.module-NQO6OLPK.js.map → orc.module-YEZN4Q7U.js.map} +0 -0
- /package/client-dist/{project-management.module-T7NBKKSR.js.map → project-management.module-CB6D2EUD.js.map} +0 -0
- /package/client-dist/{project-source-routed.module-YO54LEGN.js.map → project-source-routed.module-CYG342BA.js.map} +0 -0
- /package/client-dist/{scheduler.module-4CMBOTGZ.js.map → scheduler.module-V5JCK6QF.js.map} +0 -0
- /package/client-dist/{session.module-V4SRPQRZ.js.map → session.module-QZLOBMOL.js.map} +0 -0
- /package/client-dist/{set.module-32SVEWTG.js.map → set.module-EVAQ6TXH.js.map} +0 -0
- /package/client-dist/{setup.module-5T6MCMR4.js.map → setup.module-D2TCNKBN.js.map} +0 -0
- /package/client-dist/{terminals.module-AQO2TVO2.js.map → terminals.module-LABJDNT5.js.map} +0 -0
- /package/client-dist/{voice-notes-poc.module-EI2HY7YJ.js.map → voice-notes-poc.module-IST3HNZW.js.map} +0 -0
- /package/client-dist/{wfs.module-AHRZE5WB.js.map → wfs.module-ETTOPBME.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{I as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{I as p}from"./chunk-6TE4LLRT.js";import{C as l,G as h,aa as a,hb as b,k as i,p as o,xb as d,y as n}from"./chunk-TBMJSIBB.js";var g=(()=>{class r{http=l(d);baseUrl=`${p.api.baseUrl}/sch`;listJobs(){return o(this.http.get(`${this.baseUrl}/jobs`))}getJob(e){return o(this.http.get(`${this.baseUrl}/jobs/${e}`))}createJob(e){return o(this.http.post(`${this.baseUrl}/jobs`,e))}updateJob(e,t){return o(this.http.patch(`${this.baseUrl}/jobs/${e}`,t))}deleteJob(e){return o(this.http.delete(`${this.baseUrl}/jobs/${e}`))}enableJob(e){return o(this.http.post(`${this.baseUrl}/jobs/${e}/enable`,{}))}disableJob(e){return o(this.http.post(`${this.baseUrl}/jobs/${e}/disable`,{}))}pauseJob(e){return o(this.http.post(`${this.baseUrl}/jobs/${e}/pause`,{}))}resumeJob(e){return o(this.http.post(`${this.baseUrl}/jobs/${e}/resume`,{}))}triggerNow(e){let t=[];e.bypass&&t.push("bypass=true"),e.forcePolicy&&t.push(`forcePolicy=${encodeURIComponent(e.forcePolicy)}`),e.dryRun&&t.push("dryRun=true");let s=t.length?`?${t.join("&")}`:"";return o(this.http.post(`${this.baseUrl}/jobs/${e.jobId}/trigger-now${s}`,{reason:e.reason}))}listExecutions(e){let t=[];e.jobId&&t.push(`jobId=${encodeURIComponent(e.jobId)}`),e.status&&t.push(`status=${encodeURIComponent(e.status)}`),e.targetSessionId&&t.push(`targetSessionId=${encodeURIComponent(e.targetSessionId)}`),e.from&&t.push(`from=${encodeURIComponent(e.from)}`),e.to&&t.push(`to=${encodeURIComponent(e.to)}`);let s=t.length?`?${t.join("&")}`:"";return o(this.http.get(`${this.baseUrl}/executions${s}`))}getExecution(e){return o(this.http.get(`${this.baseUrl}/executions/${e}`))}getDefaults(){return o(this.http.get(`${this.baseUrl}/defaults`))}applyDefaults(){return o(this.http.post(`${this.baseUrl}/defaults/apply`,{}))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=n({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var F=(()=>{class r{jobs_AS=l(g);jobs_$=a([]);recentExecutions_$=a(new Map);isLoading_$=a(!1);errorMessage_$=a(null);scheduledSessionIds_$=b(()=>{let e=new Set;for(let t of this.jobs_$()){if(t.enabled===!1)continue;let s=t.target?.payload?.sessionId?.trim();s&&e.add(s)}return e});loadAll(){return i(this,null,function*(){this.isLoading_$.set(!0),this.errorMessage_$.set(null);try{let t=(yield this.jobs_AS.listJobs()).jobs??[];this.jobs_$.set(t),this.loadRecentExecutionsForJobs(t)}catch(e){this.errorMessage_$.set(e?.message??"Failed to load scheduler jobs")}finally{this.isLoading_$.set(!1)}})}loadRecentExecutionsForJobs(e){return i(this,null,function*(){let t=new Map;try{let $=(yield this.jobs_AS.listExecutions({})).executions??[];for(let j of e){let c=j._id??"";if(!c)continue;let y=$.filter(u=>u.jobId===c).sort((u,m)=>(m.scheduledAt??"").localeCompare(u.scheduledAt??"")).slice(0,10);t.set(c,y)}}catch{}this.recentExecutions_$.set(t)})}getJob(e){return i(this,null,function*(){try{return(yield this.jobs_AS.getJob(e)).job}catch(t){return this.errorMessage_$.set(t?.message??"Failed to load job"),null}})}create(e){return i(this,null,function*(){try{let t=yield this.jobs_AS.createJob(e);return yield this.loadAll(),t.job}catch(t){return this.errorMessage_$.set(t?.message??"Failed to create job"),null}})}update(e,t){return i(this,null,function*(){try{let s=yield this.jobs_AS.updateJob(e,t);return yield this.loadAll(),s.job}catch(s){return this.errorMessage_$.set(s?.message??"Failed to update job"),null}})}remove(e){return i(this,null,function*(){try{let t=yield this.jobs_AS.deleteJob(e);return yield this.loadAll(),t.deleted}catch(t){return this.errorMessage_$.set(t?.message??"Failed to delete job"),!1}})}toggleEnabled(e,t){return i(this,null,function*(){try{t?yield this.jobs_AS.enableJob(e):yield this.jobs_AS.disableJob(e),yield this.loadAll()}catch(s){this.errorMessage_$.set(s?.message??"Failed to toggle enabled state")}})}togglePaused(e,t){return i(this,null,function*(){try{t?yield this.jobs_AS.pauseJob(e):yield this.jobs_AS.resumeJob(e),yield this.loadAll()}catch(s){this.errorMessage_$.set(s?.message??"Failed to toggle paused state")}})}triggerNow(e){return i(this,null,function*(){try{return(yield this.jobs_AS.triggerNow(e)).triggered}catch(t){return this.errorMessage_$.set(t?.message??"Failed to trigger job"),!1}})}listExecutions(e){return i(this,null,function*(){try{return(yield this.jobs_AS.listExecutions({jobId:e.jobId})).executions??[]}catch(t){return this.errorMessage_$.set(t?.message??"Failed to load executions"),[]}})}getDefaults(){return i(this,null,function*(){try{return(yield this.jobs_AS.getDefaults()).defaults}catch(e){return this.errorMessage_$.set(e?.message??"Failed to load defaults"),null}})}static \u0275fac=function(t){return new(t||r)};static \u0275prov=n({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var E=(()=>{class r{transform(e){if(!e||!e.preset)return"\u2014";let t=e.preset,s=e.intervalValue;if(s===void 0||!isFinite(s))return t;switch(t){case"every-n-minutes":return`every ${s} minutes`;case"every-n-hours":return`every ${s} hours`;case"every-n-days":return`every ${s} days`;case"windowed-interval":return`every ${s} min (window)`;default:return t}}static \u0275fac=function(t){return new(t||r)};static \u0275pipe=h({name:"schSchedulePresetLabel",type:r,pure:!0,standalone:!0})}return r})();export{F as a,E as b};
|
|
2
|
+
//# sourceMappingURL=chunk-6XSACJBG.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as S}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as S}from"./chunk-QSN7KY5M.js";import{I as m}from"./chunk-6TE4LLRT.js";import{C as d,d as l,p as n,vb as r,xb as I,y as f}from"./chunk-TBMJSIBB.js";var P=(()=>{class i{baseUrl=`${m.api.baseUrl}/cc-session`;http=d(I);peiContext_DS=d(S);currentCcapId(){return this.peiContext_DS.activeCcapId_$()}withCcapId(t){let e=this.currentCcapId();return e?t.set("ccapId",e):t}createSession(t){let e=this.withCcapId(new r);return n(this.http.post(this.baseUrl,t,{params:e}))}listSessions(t){let e=this.withCcapId(new r);return t?.status&&(e=e.set("status",t.status)),t?.workspacePath&&(e=e.set("workspacePath",t.workspacePath)),t?.includeArchived&&(e=e.set("includeArchived","1")),t?.limit!=null&&(e=e.set("limit",String(t.limit))),t?.offset!=null&&(e=e.set("offset",String(t.offset))),n(this.http.get(this.baseUrl,{params:e}))}getSession(t){let e=this.withCcapId(new r);return n(this.http.get(`${this.baseUrl}/${t.sessionId}`,{params:e}))}sendPrompt(t){let e={content:t.content};t.attachments?.length&&(e.attachments=t.attachments);let s=this.withCcapId(new r);return n(this.http.post(`${this.baseUrl}/${t.sessionId}/prompt`,e,{params:s}))}resumeSession(t){let e=this.withCcapId(new r);return n(this.http.post(`${this.baseUrl}/${t.sessionId}/resume`,{},{params:e}))}forkSession(t){let e={};t.label&&(e.label=t.label);let s=this.withCcapId(new r);return n(this.http.post(`${this.baseUrl}/${t.sessionId}/fork`,e,{params:s}))}stopExecution(t){let e=this.withCcapId(new r);return n(this.http.post(`${this.baseUrl}/${t.sessionId}/stop-execution`,{},{params:e}))}terminateSession(t){let e=this.withCcapId(new r);return n(this.http.post(`${this.baseUrl}/${t.sessionId}/terminate`,{},{params:e}))}restartRunner(t){let e=this.withCcapId(new r);return n(this.http.post(`${this.baseUrl}/${t.sessionId}/runner-restart`,{},{params:e}))}updateSessionConfig(t){let a=t,{sessionId:e}=a,s=l(a,["sessionId"]),o=this.withCcapId(new r);return n(this.http.patch(`${this.baseUrl}/${e}/config`,s,{params:o}))}setSessionArchived(t){let e=this.withCcapId(new r);return n(this.http.patch(`${this.baseUrl}/${t.sessionId}/archive`,{isArchived:t.isArchived},{params:e}))}getSessionEvents(t){let e=this.withCcapId(new r);return t.eventType&&(e=e.set("eventType",t.eventType)),t.since&&(e=e.set("since",t.since)),t.sinceSequence!=null&&(e=e.set("sinceSequence",String(t.sinceSequence))),t.limit!=null&&(e=e.set("limit",String(t.limit))),t.offset!=null&&(e=e.set("offset",String(t.offset))),t.latest&&(e=e.set("latest","1")),n(this.http.get(`${this.baseUrl}/${t.sessionId}/events`,{params:e}))}getRateLimitState(t){let e=new r;return n(this.http.get(`${this.baseUrl}/rate-limit-state/${encodeURIComponent(t.ccapId)}`,{params:e}))}getDiagnostic(t){return n(this.http.get(`${this.baseUrl}/${encodeURIComponent(t.sessionId)}/diagnostic`))}getSessionEventStreamUrl(t){let e=`${this.baseUrl}/${t.sessionId}/events/stream`,s=this.currentCcapId();return s?`${e}?ccapId=${encodeURIComponent(s)}`:e}static \u0275fac=function(e){return new(e||i)};static \u0275prov=f({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var y=(()=>{class i{static DEFAULT_SURPASSED_THRESHOLD=.8;static mapServerItemsToClientInfo(t){if(!t||!Array.isArray(t)||t.length===0)return null;let e=t.filter(u=>typeof u?.rateLimitType=="string"&&u.rateLimitType.length>0);if(e.length===0)return null;let s=i.pickMostRelevantItem(e),o=typeof s.utilization=="number"?Math.max(0,Math.min(1,s.utilization)):0,a=typeof s.resetsAtMs=="number"&&s.resetsAtMs>0?s.resetsAtMs:0,c=a>0?Math.floor(a/1e3):0,h=i.mapStatus(s.lastObservedStatus),p=i.readObservedAtIso(s.observedAt);return{status:h,resetsAt:c,rateLimitType:s.rateLimitType??"",utilization:o,surpassedThreshold:i.DEFAULT_SURPASSED_THRESHOLD,isUsingOverage:!1,receivedAt:p}}static pickMostRelevantItem(t){let e=o=>o==="reached"?2:o==="approaching"?1:0;return[...t].sort((o,a)=>{let c=e(a.lastObservedStatus)-e(o.lastObservedStatus);if(c!==0)return c;let h=(a.utilization??0)-(o.utilization??0);if(Math.abs(h)>1e-4)return h>0?1:-1;let p=i.readObservedAtMs(o.observedAt);return i.readObservedAtMs(a.observedAt)-p})[0]}static mapStatus(t){return t==="reached"?"limited":t==="approaching"?"allowed_warning":"allowed"}static readObservedAtMs(t){if(!t)return 0;if(t instanceof Date)return t.getTime();let e=Date.parse(t);return isNaN(e)?0:e}static readObservedAtIso(t){if(!t)return new Date().toISOString();if(t instanceof Date)return t.toISOString();let e=Date.parse(t);return isNaN(e)?new Date().toISOString():new Date(e).toISOString()}}return i})();export{P as a,y as b};
|
|
2
|
+
//# sourceMappingURL=chunk-77JJATPE.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{k as F}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{k as F}from"./chunk-ROLHXND4.js";import{D as h,Fa as _,Ga as C,Ha as T,J as x,K as u,T as E,Ta as L,U as l,Ua as k,Z as a,da as c,ga as S,la as d,ma as f,oa as v,pa as g,qa as o,ra as r,sa as p,ua as y,ub as R,va as b,wa as i,xa as M,ya as w}from"./chunk-TBMJSIBB.js";var I=["*","*"],D=()=>[];function j(t,n){if(t&1){let e=y();o(0,"div",2)(1,"button",3),b("click",function(){x(e);let m=i(3);return u(m.handleRetry())}),_(2," \xDAjrapr\xF3b\xE1l\xE1s "),r()()}}function V(t,n){if(t&1&&(o(0,"div"),p(1,"app-ccap-error-display",1),c(2,j,3,0,"div",2),r()),t&2){let e=i(2);a(),S("error",e.error())("sourceLabelOverride",e.errorSourceLabel()),a(),d(e.showRetry()?2:-1)}}function A(t,n){t&1&&(o(0,"div",6),p(1,"div",9)(2,"div",10),r())}function P(t,n){if(t&1&&(o(0,"div",4),v(1,A,3,0,"div",6,f),o(3,"div",7),p(4,"span",8),_(5),r()()),t&2){let e=i(3);a(),g(k(1,D).constructor(e.skeletonRows())),a(4),T(" ",e.loadingMessage()," ")}}function B(t,n){if(t&1&&(o(0,"p",5),_(1),r()),t&2){let e=i(3);a(),C(e.loadingMessage())}}function O(t,n){if(t&1&&c(0,P,6,2,"div",4)(1,B,2,1,"p",5),t&2){let e=i(2);d(e.showSkeleton()?0:1)}}function N(t,n){if(t&1&&(o(0,"p",0),_(1),r()),t&2){let e=i(2);a(),C(e.emptyMessage())}}function q(t,n){t&1&&w(0)}function z(t,n){if(t&1&&c(0,V,3,3,"div")(1,O,2,1)(2,N,2,1,"p",0)(3,q,1,0),t&2){let e=i();d(e.error()?0:e.isLoading()?1:e.isEmpty()?2:3)}}function G(t,n){t&1&&(o(0,"div",6),p(1,"div",9)(2,"div",10),r())}function H(t,n){if(t&1&&(o(0,"div",4),v(1,G,3,0,"div",6,f),o(3,"div",7),p(4,"span",8),_(5),r()()),t&2){let e=i(3);a(),g(k(1,D).constructor(e.skeletonRows())),a(4),T(" ",e.loadingMessage()," ")}}function J(t,n){if(t&1&&(o(0,"p",5),_(1),r()),t&2){let e=i(3);a(),C(e.loadingMessage())}}function K(t,n){if(t&1&&c(0,H,6,2,"div",4)(1,J,2,1,"p",5),t&2){let e=i(2);d(e.showSkeleton()?0:1)}}function Q(t,n){if(t&1){let e=y();o(0,"div",2)(1,"button",3),b("click",function(){x(e);let m=i(3);return u(m.handleRetry())}),_(2," \xDAjrapr\xF3b\xE1l\xE1s "),r()()}}function U(t,n){if(t&1&&(o(0,"div"),p(1,"app-ccap-error-display",1),c(2,Q,3,0,"div",2),r()),t&2){let e=i(2);a(),S("error",e.error())("sourceLabelOverride",e.errorSourceLabel()),a(),d(e.showRetry()?2:-1)}}function W(t,n){if(t&1&&(o(0,"p",0),_(1),r()),t&2){let e=i(2);a(),C(e.emptyMessage())}}function X(t,n){t&1&&w(0,1)}function Y(t,n){if(t&1&&c(0,K,2,1)(1,U,3,3,"div")(2,W,2,1,"p",0)(3,X,1,0),t&2){let e=i();d(e.isLoading()?0:e.error()?1:e.isEmpty()?2:3)}}var ot=(()=>{class t{isLoading=l(!1);error=l(null);isEmpty=l(!1);errorSourceLabel=l("");emptyMessage=l("Nincs megjelen\xEDthet\u0151 elem.");loadingMessage=l("Bet\xF6lt\xE9s\u2026");skeletonRows=l(2);showSkeleton=l(!1);showRetry=l(!0);errorTakesPrecedence=l(!1);retry=E();handleRetry(){this.retry.emit()}static \u0275fac=function(s){return new(s||t)};static \u0275cmp=h({type:t,selectors:[["app-s-content-state"]],hostAttrs:[1,"block"],inputs:{isLoading:[1,"isLoading"],error:[1,"error"],isEmpty:[1,"isEmpty"],errorSourceLabel:[1,"errorSourceLabel"],emptyMessage:[1,"emptyMessage"],loadingMessage:[1,"loadingMessage"],skeletonRows:[1,"skeletonRows"],showSkeleton:[1,"showSkeleton"],showRetry:[1,"showRetry"],errorTakesPrecedence:[1,"errorTakesPrecedence"]},outputs:{retry:"retry"},standalone:!0,features:[L],ngContentSelectors:I,decls:2,vars:1,consts:[[1,"text-neutral-500","py-4"],[1,"mb-3","block",3,"error","sourceLabelOverride"],[1,"text-center"],["type","button",1,"mt-1","px-3","py-1.5","text-sm","border","border-neonCyan","rounded-md","bg-transparent","text-neutral-200","hover:bg-neutral-800","hover:shadow-neon-glow-cyan","transition-colors",3,"click"],[1,"flex","flex-col","gap-2","py-4"],[1,"text-neutral-400"],[1,"px-4","py-3","border","border-neonDefault","rounded-lg","animate-pulse"],[1,"flex","items-center","gap-2","text-neutral-500","text-sm"],[1,"inline-block","w-2","h-2","rounded-full","bg-ccapAccent","animate-pulse"],[1,"h-4","w-3/4","bg-neutral-600","rounded","mb-2"],[1,"h-3","w-1/2","bg-neutral-700","rounded"]],template:function(s,m){s&1&&(M(I),c(0,z,4,1)(1,Y,4,1)),s&2&&d(m.errorTakesPrecedence()?0:1)},dependencies:[R,F],encapsulation:2})}return t})();export{ot as a};
|
|
2
|
+
//# sourceMappingURL=chunk-7GEAKPVD.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as c}from"./chunk-LUV3FOSG.js";import{I as d,p as h}from"./chunk-6TE4LLRT.js";import{C as l,aa as o,h as u,k as r,y as s}from"./chunk-TBMJSIBB.js";var e=function(t){return t.idle="idle",t.downloading="downloading",t.installing="installing",t.completed="completed",t.failed="failed",t}(e||{});var p=u(h());function m(){return typeof window.Capacitor<"u"&&window.Capacitor.isNativePlatform?.()===!0}function w(){let a=window.Capacitor?.Plugins?.AppUpdater;return a||null}var y=(()=>{class t{versionCheck_CS=l(c);downloadUrl=d.api.baseUrl+"/mobile/download";phase_$=o(e.idle);lastError_$=o("");startUpdate(){return r(this,null,function*(){let n=this.phase_$();if(!(n===e.downloading||n===e.installing)){this.lastError_$.set(""),this.phase_$.set(e.downloading);try{let i=w();if(i){this.phase_$.set(e.installing),yield i.downloadAndInstall({downloadUrl:this.downloadUrl}),this.phase_$.set(e.completed);return}this.openInSystemBrowser(this.downloadUrl),this.phase_$.set(e.completed)}catch(i){let f=i instanceof Error?i.message:String(i);this.lastError_$.set(f),this.phase_$.set(e.failed),p.DyFM_Error.logSimple("CCAP_MobileAppUpdater | startUpdate failed",i)}}})}autoUpdateIfAvailable(){return r(this,null,function*(){m()&&(yield this.versionCheck_CS.checkNow(),this.versionCheck_CS.updateAvailable_$()&&(yield this.startUpdate()))})}openInSystemBrowser(n){window.open(n,"_system")}static \u0275fac=function(i){return new(i||t)};static \u0275prov=s({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{e as a,y as b};
|
|
2
|
+
//# sourceMappingURL=chunk-A3CDBCDP.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e as rt}from"./chunk-TWK7BOB7.js";import{I as st}from"./chunk-Y6V4NGLU.js";import{$a as N,C as v,D as Z,Fa as u,Ga as V,Ha as T,J as L,K as R,L as S,M as q,Pa as W,Qa as K,R as J,Ra as U,Ta as tt,Ua as et,Z as o,aa as y,bb as B,da as C,fa as w,ga as H,ha as G,hb as nt,ia as b,ja as E,jb as j,k as h,la as x,na as Q,oa as D,p as g,pa as k,pb as it,qa as s,ra as a,sa as M,ua as P,ub as ot,va as F,wa as d,xb as at,y as I}from"./chunk-TBMJSIBB.js";var lt=(()=>{class n{baseUrl=`${st.api.baseUrl}/cc-account`;http=v(at);listAccounts(){return g(this.http.get(`${this.baseUrl}/list`))}refreshLocalAccounts(){return g(this.http.post(`${this.baseUrl}/refresh`,{}))}getInstanceMapping(){return g(this.http.get(`${this.baseUrl}/instance-mapping`))}getAccount(t){return g(this.http.get(`${this.baseUrl}/${t}`))}getAccountUsage(t){return g(this.http.get(`${this.baseUrl}/${t}/usage`))}getAccountUsageHistory(t){let e=[];t.windowType!=null&&t.windowType!==""&&e.push(`windowType=${encodeURIComponent(t.windowType)}`),t.fromMs!=null&&e.push(`fromMs=${t.fromMs}`),t.toMs!=null&&e.push(`toMs=${t.toMs}`);let i=e.length>0?`?${e.join("&")}`:"";return g(this.http.get(`${this.baseUrl}/${t.accountKey}/usage-history${i}`))}refreshAccountUsage(t){return g(this.http.post(`${this.baseUrl}/${t}/refresh-usage`,{}))}renameAccount(t){let e={};return t.displayName!==void 0&&(e.displayName=t.displayName),t.email!==void 0&&(e.email=t.email),g(this.http.patch(`${this.baseUrl}/${t.accountKey}`,e))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var pt="cc:account-usage-update",_t="cc:account-list-update",ut=(()=>{class n{account_AS=v(lt);socket_CS=v(rt);ngZone=v(J);socketSubscription=null;accounts_$=y([]);accountUsageMap_$=y(new Map);instanceMapping_$=y(null);usageHistoryMap_$=y(new Map);isLoading_$=y(!1);loadError_$=y(null);loadDashboardBootstrap(){return h(this,null,function*(){this.isLoading_$.set(!0),this.loadError_$.set(null);try{let[t,e]=yield Promise.all([this.account_AS.listAccounts(),this.account_AS.getInstanceMapping()]);this.accounts_$.set(t.items),this.instanceMapping_$.set(e);let i=t.items.map(p=>this.account_AS.getAccountUsage(p.accountKey)),c=yield Promise.all(i),_=new Map(this.accountUsageMap_$());for(let p=0;p<t.items.length;p++)_.set(t.items[p].accountKey,c[p].items);this.accountUsageMap_$.set(_)}catch(t){this.loadError_$.set(this.errorMessageOf(t))}finally{this.isLoading_$.set(!1)}})}loadAccounts(){return h(this,null,function*(){try{let t=yield this.account_AS.listAccounts();this.accounts_$.set(t.items)}catch(t){this.loadError_$.set(this.errorMessageOf(t))}})}loadAccountUsage(t){return h(this,null,function*(){try{let e=yield this.account_AS.getAccountUsage(t),i=new Map(this.accountUsageMap_$());i.set(t,e.items),this.accountUsageMap_$.set(i)}catch(e){this.loadError_$.set(this.errorMessageOf(e))}})}loadAccountUsageHistory(t){return h(this,null,function*(){try{let e=yield this.account_AS.getAccountUsageHistory(t),i=new Map(this.usageHistoryMap_$());i.set(t.accountKey,e.items),this.usageHistoryMap_$.set(i)}catch(e){this.loadError_$.set(this.errorMessageOf(e))}})}loadInstanceMapping(){return h(this,null,function*(){try{let t=yield this.account_AS.getInstanceMapping();this.instanceMapping_$.set(t)}catch(t){this.loadError_$.set(this.errorMessageOf(t))}})}refreshAccounts(){return h(this,null,function*(){this.isLoading_$.set(!0),this.loadError_$.set(null);try{let t=yield this.account_AS.refreshLocalAccounts();return yield this.loadAccounts(),t}catch(t){return this.loadError_$.set(this.errorMessageOf(t)),{refreshedKeys:[],scannedPaths:0}}finally{this.isLoading_$.set(!1)}})}refreshAccountUsage(t){return h(this,null,function*(){try{let e=yield this.account_AS.refreshAccountUsage(t);return yield this.loadAccountUsage(t),yield this.loadAccounts(),e}catch(e){return this.loadError_$.set(this.errorMessageOf(e)),{status:"error",windowsUpserted:0,email:null}}})}renameAccount(t){return h(this,null,function*(){try{let e=yield this.account_AS.renameAccount(t),i=this.accounts_$().map(c=>c.accountKey===t.accountKey?e:c);this.accounts_$.set(i)}catch(e){this.loadError_$.set(this.errorMessageOf(e))}})}startLiveUpdates(){this.socketSubscription==null&&(this.socketSubscription=this.socket_CS.event$.subscribe(t=>{this.ngZone.run(()=>{t.event===pt?this.handleAccountUsageUpdate(t.payload):t.event===_t&&this.handleAccountListUpdate(t.payload)})}))}stopLiveUpdates(){this.socketSubscription!=null&&(this.socketSubscription.unsubscribe(),this.socketSubscription=null)}ngOnDestroy(){this.stopLiveUpdates()}handleAccountUsageUpdate(t){let e=t.accountKey,i=t.windowType;if(typeof e!="string"||e===""||typeof i!="string")return;let c={accountKey:e,windowType:i,utilization:typeof t.utilization=="number"?t.utilization:void 0,resetsAtMs:typeof t.resetsAtMs=="number"?t.resetsAtMs:void 0,lastObservedStatus:typeof t.lastObservedStatus=="string"?t.lastObservedStatus:void 0,observedAt:typeof t.observedAt=="string"?t.observedAt:void 0,lastObservedByCcapId:typeof t.lastObservedByCcapId=="string"?t.lastObservedByCcapId:void 0,lastObservedBySessionId:typeof t.lastObservedBySessionId=="string"?t.lastObservedBySessionId:void 0},_=new Map(this.accountUsageMap_$()),l=(_.get(e)??[]).filter(f=>f.windowType!==i);l.push(c),_.set(e,l),this.accountUsageMap_$.set(_)}handleAccountListUpdate(t){this.loadAccounts()}errorMessageOf(t){if(t instanceof Error)return t.message;if(typeof t=="object"&&t!==null){let e=t;if(typeof e.message=="string")return e.message}return String(t)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var $=(()=>{class n{static CHART_WIDTH=100;static CHART_HEIGHT=40;static COLOR_MAP={five_hour:"#10b981",seven_day:"#06b6d4",seven_day_opus:"#a855f7",seven_day_sonnet:"#f59e0b",extra_usage:"#f43f5e"};static WINDOW_LABEL_MAP={five_hour:"5h",seven_day:"Weekly",seven_day_opus:"Opus",seven_day_sonnet:"Sonnet",extra_usage:"Extra"};static WINDOW_ORDER=["five_hour","seven_day","seven_day_opus","seven_day_sonnet","extra_usage"];static buildChart(t){let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,c=0;for(let l of t){if(typeof l.observedAt!="string"||l.observedAt===""||typeof l.utilization!="number"||!isFinite(l.utilization))continue;let f=Date.parse(l.observedAt);isFinite(f)&&(f<e&&(e=f),f>i&&(i=f),c++)}if(c===0)return{lines:n.WINDOW_ORDER.map(l=>({windowType:l,label:n.WINDOW_LABEL_MAP[l]??l,colorHex:n.COLOR_MAP[l]??"#9ca3af",pathPoints:"",hasData:!1,pointCount:0,lastX:0,lastY:0})),hasAnyData:!1,minTimeMs:0,maxTimeMs:0};i-e<1&&(i=e+36e5);let _=i-e,p=n.WINDOW_ORDER.map(l=>{let f=[];for(let m of t){if(m.windowType!==l||typeof m.observedAt!="string"||m.observedAt===""||typeof m.utilization!="number"||!isFinite(m.utilization))continue;let A=Date.parse(m.observedAt);isFinite(A)&&f.push({t:A,u:Math.max(0,Math.min(1,m.utilization))})}f.sort((m,A)=>m.t-A.t);let O=[],z=0,Y=0;for(let m of f){let A=(m.t-e)/_*n.CHART_WIDTH,X=n.CHART_HEIGHT-m.u*n.CHART_HEIGHT;O.push(`${A.toFixed(2)},${X.toFixed(2)}`),z=A,Y=X}return{windowType:l,label:n.WINDOW_LABEL_MAP[l]??l,colorHex:n.COLOR_MAP[l]??"#9ca3af",pathPoints:O.join(" "),hasData:O.length>0,pointCount:O.length,lastX:z,lastY:Y}});return{lines:p,hasAnyData:p.some(l=>l.hasData),minTimeMs:e,maxTimeMs:i}}}return n})();var dt=(n,r)=>r.windowType,mt=()=>["five_hour","seven_day","seven_day_opus","seven_day_sonnet","extra_usage"];function ht(n,r){if(n&1&&M(0,"div"),n&2){d();let t=U(0),e=d();E("h-full transition-all "+e.utilizationBarColorClass(t.utilization)),G("width",e.utilizationPercent(t.utilization),"%")}}function ft(n,r){if(n&1&&(W(0),s(1,"div")(2,"div",4),u(3),a(),s(4,"div",5)(5,"div"),C(6,ht,1,4,"div",6),a(),s(7,"span",7),u(8),a()(),s(9,"div",8),u(10),a()()),n&2){let t,e=r.$implicit,i=d(),c=K(i.usageItemOfWindow(e));o(),E(i.compact?"grid grid-cols-[90px_1fr_56px] items-center gap-2 text-[10px]":"grid grid-cols-[110px_1fr_64px] items-center gap-2 text-[11px]"),b("opacity-50",!c),o(),H("title",e),o(),T(" ",i.windowLabelOf(e)," "),o(2),E(i.compact?"flex-1 h-1.5 bg-neutral-800 rounded-full overflow-hidden":"flex-1 h-2 bg-neutral-800 rounded-full overflow-hidden"),o(),x(c?6:-1),o(),E(i.compact?"w-8 text-[10px]":"w-9"),o(),T(" ",i.formatUtilization((t=c==null?null:c.utilization)!==null&&t!==void 0?t:null)," "),o(),H("title","Resets in "+i.formatResetCountdown(c==null?null:c.resetsAtMs)),o(),T(" ",i.formatResetCountdown(c==null?null:c.resetsAtMs)," ")}}function xt(n,r){n&1&&(s(0,"div",2),u(1," No data yet \u2014 click "),s(2,"strong",9),u(3,"Pull"),a(),u(4," or wait for the next rate-limit event. "),a())}function Ct(n,r){n&1&&(s(0,"div",14),u(1," No graph data yet \u2014 pull usage or wait for a CC session rate-limit event. "),a())}function gt(n,r){if(n&1&&(S(),M(0,"circle",25)),n&2){let t=d(2).$implicit;w("cx",t.lastX)("cy",t.lastY)("fill",t.colorHex)}}function yt(n,r){if(n&1&&(S(),M(0,"polyline",26)(1,"circle",27)),n&2){let t=d(2).$implicit;w("points",t.pathPoints)("stroke",t.colorHex),o(),w("cx",t.lastX)("cy",t.lastY)("fill",t.colorHex)}}function vt(n,r){if(n&1&&C(0,gt,1,3,":svg:circle",25)(1,yt,2,5),n&2){let t=d().$implicit;x(t.pointCount===1?0:1)}}function wt(n,r){if(n&1&&C(0,vt,2,1),n&2){let t=r.$implicit;x(t.hasData?0:-1)}}function At(n,r){if(n&1&&(s(0,"span",31),u(1,"\xB7"),a(),s(2,"span",32),u(3),a()),n&2){let t=d().$implicit,e=d(4);o(3),T(" ",((e.chartH-t.lastY)/e.chartH*100).toFixed(0),"% ")}}function bt(n,r){if(n&1&&(s(0,"div",28),M(1,"span",29),s(2,"span",30),u(3),a(),C(4,At,4,1),a()),n&2){let t=r.$implicit;b("opacity-40",!t.hasData),o(),G("background-color",t.colorHex),o(2),V(t.label),o(),x(t.hasData?4:-1)}}function Mt(n,r){if(n&1&&(s(0,"span"),u(1),N(2,"date"),a()),n&2){d(2);let t=U(0);o(),V(B(2,1,t.minTimeMs,"yyyy-MM-dd HH:mm"))}}function $t(n,r){n&1&&(s(0,"span"),u(1,"\u2014"),a())}function Tt(n,r){if(n&1&&(s(0,"span"),u(1),N(2,"date"),a()),n&2){d(2);let t=U(0);o(),V(B(2,1,t.maxTimeMs,"yyyy-MM-dd HH:mm"))}}function St(n,r){n&1&&(s(0,"span"),u(1,"\u2014"),a())}function Et(n,r){if(n&1){let t=P();s(0,"div",15),S(),s(1,"svg",16),M(2,"line",17)(3,"line",18)(4,"line",19),D(5,wt,1,1,null,null,dt),a(),q(),s(7,"div",20)(8,"span"),u(9,"100%"),a(),s(10,"span"),u(11,"50%"),a(),s(12,"span"),u(13,"0%"),a()()(),s(14,"div",21),D(15,bt,5,6,"div",22,dt),a(),s(17,"div",23),C(18,Mt,3,4,"span")(19,$t,2,0,"span"),s(20,"button",24),F("click",function(){L(t);let i=d(3);return R(i.handleRefreshGraph())}),u(21," \u21BB Refresh "),a(),C(22,Tt,3,4,"span")(23,St,2,0,"span"),a()}if(n&2){d();let t=U(0),e=d(2);o(),b("h-24",e.compact)("h-32",!e.compact),w("viewBox",e.chartViewBox),o(),w("y1",e.chartH)("x2",e.chartW)("y2",e.chartH),o(),w("y1",e.chartMidY)("x2",e.chartW)("y2",e.chartMidY),o(),w("x2",e.chartW),o(),k(t.lines),o(10),k(t.lines),o(3),x(t.minTimeMs?18:19),o(4),x(t.maxTimeMs?22:23)}}function Ut(n,r){if(n&1&&(W(0),s(1,"div",13),C(2,Ct,2,0,"div",14)(3,Et,24,14),a()),n&2){let t=K(d(2).chart_$());o(2),x(t.hasAnyData?3:2)}}function Ot(n,r){if(n&1){let t=P();s(0,"div",3)(1,"button",10),F("click",function(){L(t);let i=d();return R(i.handleToggleGraph())}),S(),s(2,"svg",11),M(3,"path",12),a(),u(4),a(),C(5,Ut,4,2,"div",13),a()}if(n&2){let t=d();o(),H("title",t.isGraphOpen_$()?"Hide usage graph":"Show usage graph (utilization over time per window)"),o(),b("rotate-90",t.isGraphOpen_$()),o(2),T(" \u{1F4C8} ",t.isGraphOpen_$()?"Hide":"Show"," graph "),o(),x(t.isGraphOpen_$()?5:-1)}}var Jt=(()=>{class n{account_DS=v(ut);accountKey="";compact=!1;showGraphToggle=!0;initiallyOpenGraph=!1;isGraphOpen_$=y(!1);chart_$=nt(()=>$.buildChart(this.account_DS.usageHistoryMap_$().get(this.accountKey)??[]));chartViewBox=`0 0 ${$.CHART_WIDTH} ${$.CHART_HEIGHT}`;chartW=$.CHART_WIDTH;chartH=$.CHART_HEIGHT;chartMidY=$.CHART_HEIGHT/2;usageEffect=j(()=>{let t=this.accountKey;t&&(this.account_DS.accountUsageMap_$().has(t)||this.account_DS.loadAccountUsage(t))});initialOpenEffect=j(()=>{this.initiallyOpenGraph&&this.isGraphOpen_$.set(!0)});handleToggleGraph(){return h(this,null,function*(){let t=!this.isGraphOpen_$();this.isGraphOpen_$.set(t),t&&!this.account_DS.usageHistoryMap_$().has(this.accountKey)&&(yield this.account_DS.loadAccountUsageHistory({accountKey:this.accountKey}))})}handleRefreshGraph(){return h(this,null,function*(){yield this.account_DS.loadAccountUsageHistory({accountKey:this.accountKey})})}usageItemOfWindow(t){let e=this.account_DS.accountUsageMap_$().get(this.accountKey)??[];for(let i of e)if(i.windowType===t)return i;return null}hasAnyUsageData(){return(this.account_DS.accountUsageMap_$().get(this.accountKey)??[]).length>0}windowLabelOf(t){switch(t){case"five_hour":return"5-hour session";case"seven_day":return"Weekly";case"seven_day_opus":return"Weekly \xB7 Opus";case"seven_day_sonnet":return"Weekly \xB7 Sonnet";case"extra_usage":return"Extra (pay-as-you-go)";default:return t}}utilizationPercent(t){return t==null||!isFinite(t)?0:Math.max(0,Math.min(100,Math.round(t*100)))}formatUtilization(t){return t==null?"\u2014":`${Math.round(t*100)}%`}utilizationBarColorClass(t){return t==null||!isFinite(t)?"bg-neutral-600":t>=.85?"bg-red-500":t>=.5?"bg-amber-500":"bg-emerald-500"}formatResetCountdown(t){if(t==null||!isFinite(t)||t<=0)return"\u2014";let e=t-Date.now();if(e<=0)return"expired";let i=Math.floor(e/6e4),c=Math.floor(i/(60*24)),_=Math.floor(i%(60*24)/60),p=i%60;return c>0?`${c}d ${_}h`:_>0?`${_}h ${p}m`:`${p}m`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Z({type:n,selectors:[["app-cc-account-usage-view"]],inputs:{accountKey:"accountKey",compact:"compact",showGraphToggle:"showGraphToggle",initiallyOpenGraph:"initiallyOpenGraph"},standalone:!0,features:[tt],decls:6,vars:11,consts:[[1,"flex","flex-col"],[3,"class","opacity-50"],[1,"text-[10px]","text-neutral-500","italic","pt-1","border-t","border-neutral-800/40"],[1,"border-t","border-neutral-800/40","pt-2"],[1,"text-neutral-300","font-medium","truncate",3,"title"],[1,"flex","items-center","gap-2","min-w-0"],[3,"class","width"],[1,"font-mono","text-neutral-200","text-right","shrink-0"],[1,"font-mono","text-neutral-500","text-right","text-[10px]","truncate",3,"title"],[1,"text-neutral-400"],["type","button",1,"text-[11px]","text-neutral-400","hover:text-neonCyan","flex","items-center","gap-1","transition-colors",3,"click","title"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","aria-hidden","true",1,"w-3","h-3","transition-transform"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M9 5l7 7-7 7"],[1,"mt-2","rounded-md","border","border-neutral-800","bg-neutral-950/40","p-2"],[1,"text-[11px]","text-neutral-500","italic","px-2","py-3","text-center"],[1,"relative","w-full"],["preserveAspectRatio","none",1,"w-full","block"],["x1","0","stroke","#3f3f46","stroke-width","0.3"],["x1","0","stroke","#3f3f46","stroke-width","0.2","stroke-dasharray","1,1"],["x1","0","y1","0","y2","0","stroke","#3f3f46","stroke-width","0.2","stroke-dasharray","1,1"],[1,"absolute","inset-y-0","left-0","flex","flex-col","justify-between","text-[8px]","text-neutral-600","font-mono","pointer-events-none"],[1,"mt-2","flex","flex-wrap","items-center","gap-2","text-[10px]"],[1,"flex","items-center","gap-1",3,"opacity-40"],[1,"mt-1","flex","items-center","justify-between","text-[9px]","text-neutral-600"],["type","button","title","Re-fetch usage event history for this graph.",1,"text-[10px]","text-neutral-400","hover:text-neonCyan","border","border-neutral-700","hover:border-neonCyan","rounded","px-1.5","py-0.5","transition-colors",3,"click"],["r","0.8"],["fill","none","stroke-width","0.6","stroke-linecap","round","stroke-linejoin","round","vector-effect","non-scaling-stroke"],["r","0.6"],[1,"flex","items-center","gap-1"],[1,"inline-block","w-2","h-2","rounded-sm"],[1,"text-neutral-300"],[1,"text-neutral-500"],[1,"font-mono","text-neutral-400"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div"),D(2,ft,11,15,"div",1,Q),a(),C(4,xt,5,0,"div",2)(5,Ot,6,5,"div",3),a()),e&2&&(b("gap-1",i.compact)("gap-2",!i.compact),o(),b("space-y-1",i.compact)("space-y-2",!i.compact),o(),k(et(10,mt)),o(2),x(i.hasAnyUsageData()?-1:4),o(),x(i.showGraphToggle?5:-1))},dependencies:[ot,it],encapsulation:2})}return n})();export{ut as a,Jt as b};
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{e as rt}from"./chunk-KDPOJH6B.js";import{I as st}from"./chunk-6TE4LLRT.js";import{$a as N,C as v,D as Z,Fa as u,Ga as V,Ha as T,J as L,K as R,L as S,M as q,Pa as W,Qa as K,R as J,Ra as U,Ta as tt,Ua as et,Z as o,aa as y,bb as B,da as C,fa as w,ga as H,ha as G,hb as nt,ia as b,ja as E,jb as j,k as h,la as x,na as Q,oa as D,p as g,pa as k,pb as it,qa as s,ra as a,sa as M,ua as P,ub as ot,va as F,wa as d,xb as at,y as I}from"./chunk-TBMJSIBB.js";var lt=(()=>{class n{baseUrl=`${st.api.baseUrl}/cc-account`;http=v(at);listAccounts(){return g(this.http.get(`${this.baseUrl}/list`))}refreshLocalAccounts(){return g(this.http.post(`${this.baseUrl}/refresh`,{}))}getInstanceMapping(){return g(this.http.get(`${this.baseUrl}/instance-mapping`))}getAccount(t){return g(this.http.get(`${this.baseUrl}/${t}`))}getAccountUsage(t){return g(this.http.get(`${this.baseUrl}/${t}/usage`))}getAccountUsageHistory(t){let e=[];t.windowType!=null&&t.windowType!==""&&e.push(`windowType=${encodeURIComponent(t.windowType)}`),t.fromMs!=null&&e.push(`fromMs=${t.fromMs}`),t.toMs!=null&&e.push(`toMs=${t.toMs}`);let i=e.length>0?`?${e.join("&")}`:"";return g(this.http.get(`${this.baseUrl}/${t.accountKey}/usage-history${i}`))}refreshAccountUsage(t){return g(this.http.post(`${this.baseUrl}/${t}/refresh-usage`,{}))}renameAccount(t){let e={};return t.displayName!==void 0&&(e.displayName=t.displayName),t.email!==void 0&&(e.email=t.email),g(this.http.patch(`${this.baseUrl}/${t.accountKey}`,e))}static \u0275fac=function(e){return new(e||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var pt="cc:account-usage-update",_t="cc:account-list-update",ut=(()=>{class n{account_AS=v(lt);socket_CS=v(rt);ngZone=v(J);socketSubscription=null;accounts_$=y([]);accountUsageMap_$=y(new Map);instanceMapping_$=y(null);usageHistoryMap_$=y(new Map);isLoading_$=y(!1);loadError_$=y(null);loadDashboardBootstrap(){return h(this,null,function*(){this.isLoading_$.set(!0),this.loadError_$.set(null);try{let[t,e]=yield Promise.all([this.account_AS.listAccounts(),this.account_AS.getInstanceMapping()]);this.accounts_$.set(t.items),this.instanceMapping_$.set(e);let i=t.items.map(p=>this.account_AS.getAccountUsage(p.accountKey)),c=yield Promise.all(i),_=new Map(this.accountUsageMap_$());for(let p=0;p<t.items.length;p++)_.set(t.items[p].accountKey,c[p].items);this.accountUsageMap_$.set(_)}catch(t){this.loadError_$.set(this.errorMessageOf(t))}finally{this.isLoading_$.set(!1)}})}loadAccounts(){return h(this,null,function*(){try{let t=yield this.account_AS.listAccounts();this.accounts_$.set(t.items)}catch(t){this.loadError_$.set(this.errorMessageOf(t))}})}loadAccountUsage(t){return h(this,null,function*(){try{let e=yield this.account_AS.getAccountUsage(t),i=new Map(this.accountUsageMap_$());i.set(t,e.items),this.accountUsageMap_$.set(i)}catch(e){this.loadError_$.set(this.errorMessageOf(e))}})}loadAccountUsageHistory(t){return h(this,null,function*(){try{let e=yield this.account_AS.getAccountUsageHistory(t),i=new Map(this.usageHistoryMap_$());i.set(t.accountKey,e.items),this.usageHistoryMap_$.set(i)}catch(e){this.loadError_$.set(this.errorMessageOf(e))}})}loadInstanceMapping(){return h(this,null,function*(){try{let t=yield this.account_AS.getInstanceMapping();this.instanceMapping_$.set(t)}catch(t){this.loadError_$.set(this.errorMessageOf(t))}})}refreshAccounts(){return h(this,null,function*(){this.isLoading_$.set(!0),this.loadError_$.set(null);try{let t=yield this.account_AS.refreshLocalAccounts();return yield this.loadAccounts(),t}catch(t){return this.loadError_$.set(this.errorMessageOf(t)),{refreshedKeys:[],scannedPaths:0}}finally{this.isLoading_$.set(!1)}})}refreshAccountUsage(t){return h(this,null,function*(){try{let e=yield this.account_AS.refreshAccountUsage(t);return yield this.loadAccountUsage(t),yield this.loadAccounts(),e}catch(e){return this.loadError_$.set(this.errorMessageOf(e)),{status:"error",windowsUpserted:0,email:null}}})}renameAccount(t){return h(this,null,function*(){try{let e=yield this.account_AS.renameAccount(t),i=this.accounts_$().map(c=>c.accountKey===t.accountKey?e:c);this.accounts_$.set(i)}catch(e){this.loadError_$.set(this.errorMessageOf(e))}})}startLiveUpdates(){this.socketSubscription==null&&(this.socketSubscription=this.socket_CS.event$.subscribe(t=>{this.ngZone.run(()=>{t.event===pt?this.handleAccountUsageUpdate(t.payload):t.event===_t&&this.handleAccountListUpdate(t.payload)})}))}stopLiveUpdates(){this.socketSubscription!=null&&(this.socketSubscription.unsubscribe(),this.socketSubscription=null)}ngOnDestroy(){this.stopLiveUpdates()}handleAccountUsageUpdate(t){let e=t.accountKey,i=t.windowType;if(typeof e!="string"||e===""||typeof i!="string")return;let c={accountKey:e,windowType:i,utilization:typeof t.utilization=="number"?t.utilization:void 0,resetsAtMs:typeof t.resetsAtMs=="number"?t.resetsAtMs:void 0,lastObservedStatus:typeof t.lastObservedStatus=="string"?t.lastObservedStatus:void 0,observedAt:typeof t.observedAt=="string"?t.observedAt:void 0,lastObservedByCcapId:typeof t.lastObservedByCcapId=="string"?t.lastObservedByCcapId:void 0,lastObservedBySessionId:typeof t.lastObservedBySessionId=="string"?t.lastObservedBySessionId:void 0},_=new Map(this.accountUsageMap_$()),l=(_.get(e)??[]).filter(f=>f.windowType!==i);l.push(c),_.set(e,l),this.accountUsageMap_$.set(_)}handleAccountListUpdate(t){this.loadAccounts()}errorMessageOf(t){if(t instanceof Error)return t.message;if(typeof t=="object"&&t!==null){let e=t;if(typeof e.message=="string")return e.message}return String(t)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=I({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var $=(()=>{class n{static CHART_WIDTH=100;static CHART_HEIGHT=40;static COLOR_MAP={five_hour:"#10b981",seven_day:"#06b6d4",seven_day_opus:"#a855f7",seven_day_sonnet:"#f59e0b",extra_usage:"#f43f5e"};static WINDOW_LABEL_MAP={five_hour:"5h",seven_day:"Weekly",seven_day_opus:"Opus",seven_day_sonnet:"Sonnet",extra_usage:"Extra"};static WINDOW_ORDER=["five_hour","seven_day","seven_day_opus","seven_day_sonnet","extra_usage"];static buildChart(t){let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,c=0;for(let l of t){if(typeof l.observedAt!="string"||l.observedAt===""||typeof l.utilization!="number"||!isFinite(l.utilization))continue;let f=Date.parse(l.observedAt);isFinite(f)&&(f<e&&(e=f),f>i&&(i=f),c++)}if(c===0)return{lines:n.WINDOW_ORDER.map(l=>({windowType:l,label:n.WINDOW_LABEL_MAP[l]??l,colorHex:n.COLOR_MAP[l]??"#9ca3af",pathPoints:"",hasData:!1,pointCount:0,lastX:0,lastY:0})),hasAnyData:!1,minTimeMs:0,maxTimeMs:0};i-e<1&&(i=e+36e5);let _=i-e,p=n.WINDOW_ORDER.map(l=>{let f=[];for(let m of t){if(m.windowType!==l||typeof m.observedAt!="string"||m.observedAt===""||typeof m.utilization!="number"||!isFinite(m.utilization))continue;let A=Date.parse(m.observedAt);isFinite(A)&&f.push({t:A,u:Math.max(0,Math.min(1,m.utilization))})}f.sort((m,A)=>m.t-A.t);let O=[],z=0,Y=0;for(let m of f){let A=(m.t-e)/_*n.CHART_WIDTH,X=n.CHART_HEIGHT-m.u*n.CHART_HEIGHT;O.push(`${A.toFixed(2)},${X.toFixed(2)}`),z=A,Y=X}return{windowType:l,label:n.WINDOW_LABEL_MAP[l]??l,colorHex:n.COLOR_MAP[l]??"#9ca3af",pathPoints:O.join(" "),hasData:O.length>0,pointCount:O.length,lastX:z,lastY:Y}});return{lines:p,hasAnyData:p.some(l=>l.hasData),minTimeMs:e,maxTimeMs:i}}}return n})();var dt=(n,r)=>r.windowType,mt=()=>["five_hour","seven_day","seven_day_opus","seven_day_sonnet","extra_usage"];function ht(n,r){if(n&1&&M(0,"div"),n&2){d();let t=U(0),e=d();E("h-full transition-all "+e.utilizationBarColorClass(t.utilization)),G("width",e.utilizationPercent(t.utilization),"%")}}function ft(n,r){if(n&1&&(W(0),s(1,"div")(2,"div",4),u(3),a(),s(4,"div",5)(5,"div"),C(6,ht,1,4,"div",6),a(),s(7,"span",7),u(8),a()(),s(9,"div",8),u(10),a()()),n&2){let t,e=r.$implicit,i=d(),c=K(i.usageItemOfWindow(e));o(),E(i.compact?"grid grid-cols-[90px_1fr_56px] items-center gap-2 text-[10px]":"grid grid-cols-[110px_1fr_64px] items-center gap-2 text-[11px]"),b("opacity-50",!c),o(),H("title",e),o(),T(" ",i.windowLabelOf(e)," "),o(2),E(i.compact?"flex-1 h-1.5 bg-neutral-800 rounded-full overflow-hidden":"flex-1 h-2 bg-neutral-800 rounded-full overflow-hidden"),o(),x(c?6:-1),o(),E(i.compact?"w-8 text-[10px]":"w-9"),o(),T(" ",i.formatUtilization((t=c==null?null:c.utilization)!==null&&t!==void 0?t:null)," "),o(),H("title","Resets in "+i.formatResetCountdown(c==null?null:c.resetsAtMs)),o(),T(" ",i.formatResetCountdown(c==null?null:c.resetsAtMs)," ")}}function xt(n,r){n&1&&(s(0,"div",2),u(1," No data yet \u2014 click "),s(2,"strong",9),u(3,"Pull"),a(),u(4," or wait for the next rate-limit event. "),a())}function Ct(n,r){n&1&&(s(0,"div",14),u(1," No graph data yet \u2014 pull usage or wait for a CC session rate-limit event. "),a())}function gt(n,r){if(n&1&&(S(),M(0,"circle",25)),n&2){let t=d(2).$implicit;w("cx",t.lastX)("cy",t.lastY)("fill",t.colorHex)}}function yt(n,r){if(n&1&&(S(),M(0,"polyline",26)(1,"circle",27)),n&2){let t=d(2).$implicit;w("points",t.pathPoints)("stroke",t.colorHex),o(),w("cx",t.lastX)("cy",t.lastY)("fill",t.colorHex)}}function vt(n,r){if(n&1&&C(0,gt,1,3,":svg:circle",25)(1,yt,2,5),n&2){let t=d().$implicit;x(t.pointCount===1?0:1)}}function wt(n,r){if(n&1&&C(0,vt,2,1),n&2){let t=r.$implicit;x(t.hasData?0:-1)}}function At(n,r){if(n&1&&(s(0,"span",31),u(1,"\xB7"),a(),s(2,"span",32),u(3),a()),n&2){let t=d().$implicit,e=d(4);o(3),T(" ",((e.chartH-t.lastY)/e.chartH*100).toFixed(0),"% ")}}function bt(n,r){if(n&1&&(s(0,"div",28),M(1,"span",29),s(2,"span",30),u(3),a(),C(4,At,4,1),a()),n&2){let t=r.$implicit;b("opacity-40",!t.hasData),o(),G("background-color",t.colorHex),o(2),V(t.label),o(),x(t.hasData?4:-1)}}function Mt(n,r){if(n&1&&(s(0,"span"),u(1),N(2,"date"),a()),n&2){d(2);let t=U(0);o(),V(B(2,1,t.minTimeMs,"yyyy-MM-dd HH:mm"))}}function $t(n,r){n&1&&(s(0,"span"),u(1,"\u2014"),a())}function Tt(n,r){if(n&1&&(s(0,"span"),u(1),N(2,"date"),a()),n&2){d(2);let t=U(0);o(),V(B(2,1,t.maxTimeMs,"yyyy-MM-dd HH:mm"))}}function St(n,r){n&1&&(s(0,"span"),u(1,"\u2014"),a())}function Et(n,r){if(n&1){let t=P();s(0,"div",15),S(),s(1,"svg",16),M(2,"line",17)(3,"line",18)(4,"line",19),D(5,wt,1,1,null,null,dt),a(),q(),s(7,"div",20)(8,"span"),u(9,"100%"),a(),s(10,"span"),u(11,"50%"),a(),s(12,"span"),u(13,"0%"),a()()(),s(14,"div",21),D(15,bt,5,6,"div",22,dt),a(),s(17,"div",23),C(18,Mt,3,4,"span")(19,$t,2,0,"span"),s(20,"button",24),F("click",function(){L(t);let i=d(3);return R(i.handleRefreshGraph())}),u(21," \u21BB Refresh "),a(),C(22,Tt,3,4,"span")(23,St,2,0,"span"),a()}if(n&2){d();let t=U(0),e=d(2);o(),b("h-24",e.compact)("h-32",!e.compact),w("viewBox",e.chartViewBox),o(),w("y1",e.chartH)("x2",e.chartW)("y2",e.chartH),o(),w("y1",e.chartMidY)("x2",e.chartW)("y2",e.chartMidY),o(),w("x2",e.chartW),o(),k(t.lines),o(10),k(t.lines),o(3),x(t.minTimeMs?18:19),o(4),x(t.maxTimeMs?22:23)}}function Ut(n,r){if(n&1&&(W(0),s(1,"div",13),C(2,Ct,2,0,"div",14)(3,Et,24,14),a()),n&2){let t=K(d(2).chart_$());o(2),x(t.hasAnyData?3:2)}}function Ot(n,r){if(n&1){let t=P();s(0,"div",3)(1,"button",10),F("click",function(){L(t);let i=d();return R(i.handleToggleGraph())}),S(),s(2,"svg",11),M(3,"path",12),a(),u(4),a(),C(5,Ut,4,2,"div",13),a()}if(n&2){let t=d();o(),H("title",t.isGraphOpen_$()?"Hide usage graph":"Show usage graph (utilization over time per window)"),o(),b("rotate-90",t.isGraphOpen_$()),o(2),T(" \u{1F4C8} ",t.isGraphOpen_$()?"Hide":"Show"," graph "),o(),x(t.isGraphOpen_$()?5:-1)}}var Jt=(()=>{class n{account_DS=v(ut);accountKey="";compact=!1;showGraphToggle=!0;initiallyOpenGraph=!1;isGraphOpen_$=y(!1);chart_$=nt(()=>$.buildChart(this.account_DS.usageHistoryMap_$().get(this.accountKey)??[]));chartViewBox=`0 0 ${$.CHART_WIDTH} ${$.CHART_HEIGHT}`;chartW=$.CHART_WIDTH;chartH=$.CHART_HEIGHT;chartMidY=$.CHART_HEIGHT/2;usageEffect=j(()=>{let t=this.accountKey;t&&(this.account_DS.accountUsageMap_$().has(t)||this.account_DS.loadAccountUsage(t))});initialOpenEffect=j(()=>{this.initiallyOpenGraph&&this.isGraphOpen_$.set(!0)});handleToggleGraph(){return h(this,null,function*(){let t=!this.isGraphOpen_$();this.isGraphOpen_$.set(t),t&&!this.account_DS.usageHistoryMap_$().has(this.accountKey)&&(yield this.account_DS.loadAccountUsageHistory({accountKey:this.accountKey}))})}handleRefreshGraph(){return h(this,null,function*(){yield this.account_DS.loadAccountUsageHistory({accountKey:this.accountKey})})}usageItemOfWindow(t){let e=this.account_DS.accountUsageMap_$().get(this.accountKey)??[];for(let i of e)if(i.windowType===t)return i;return null}hasAnyUsageData(){return(this.account_DS.accountUsageMap_$().get(this.accountKey)??[]).length>0}windowLabelOf(t){switch(t){case"five_hour":return"5-hour session";case"seven_day":return"Weekly";case"seven_day_opus":return"Weekly \xB7 Opus";case"seven_day_sonnet":return"Weekly \xB7 Sonnet";case"extra_usage":return"Extra (pay-as-you-go)";default:return t}}utilizationPercent(t){return t==null||!isFinite(t)?0:Math.max(0,Math.min(100,Math.round(t*100)))}formatUtilization(t){return t==null?"\u2014":`${Math.round(t*100)}%`}utilizationBarColorClass(t){return t==null||!isFinite(t)?"bg-neutral-600":t>=.85?"bg-red-500":t>=.5?"bg-amber-500":"bg-emerald-500"}formatResetCountdown(t){if(t==null||!isFinite(t)||t<=0)return"\u2014";let e=t-Date.now();if(e<=0)return"expired";let i=Math.floor(e/6e4),c=Math.floor(i/(60*24)),_=Math.floor(i%(60*24)/60),p=i%60;return c>0?`${c}d ${_}h`:_>0?`${_}h ${p}m`:`${p}m`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Z({type:n,selectors:[["app-cc-account-usage-view"]],inputs:{accountKey:"accountKey",compact:"compact",showGraphToggle:"showGraphToggle",initiallyOpenGraph:"initiallyOpenGraph"},standalone:!0,features:[tt],decls:6,vars:11,consts:[[1,"flex","flex-col"],[3,"class","opacity-50"],[1,"text-[10px]","text-neutral-500","italic","pt-1","border-t","border-neutral-800/40"],[1,"border-t","border-neutral-800/40","pt-2"],[1,"text-neutral-300","font-medium","truncate",3,"title"],[1,"flex","items-center","gap-2","min-w-0"],[3,"class","width"],[1,"font-mono","text-neutral-200","text-right","shrink-0"],[1,"font-mono","text-neutral-500","text-right","text-[10px]","truncate",3,"title"],[1,"text-neutral-400"],["type","button",1,"text-[11px]","text-neutral-400","hover:text-neonCyan","flex","items-center","gap-1","transition-colors",3,"click","title"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","aria-hidden","true",1,"w-3","h-3","transition-transform"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M9 5l7 7-7 7"],[1,"mt-2","rounded-md","border","border-neutral-800","bg-neutral-950/40","p-2"],[1,"text-[11px]","text-neutral-500","italic","px-2","py-3","text-center"],[1,"relative","w-full"],["preserveAspectRatio","none",1,"w-full","block"],["x1","0","stroke","#3f3f46","stroke-width","0.3"],["x1","0","stroke","#3f3f46","stroke-width","0.2","stroke-dasharray","1,1"],["x1","0","y1","0","y2","0","stroke","#3f3f46","stroke-width","0.2","stroke-dasharray","1,1"],[1,"absolute","inset-y-0","left-0","flex","flex-col","justify-between","text-[8px]","text-neutral-600","font-mono","pointer-events-none"],[1,"mt-2","flex","flex-wrap","items-center","gap-2","text-[10px]"],[1,"flex","items-center","gap-1",3,"opacity-40"],[1,"mt-1","flex","items-center","justify-between","text-[9px]","text-neutral-600"],["type","button","title","Re-fetch usage event history for this graph.",1,"text-[10px]","text-neutral-400","hover:text-neonCyan","border","border-neutral-700","hover:border-neonCyan","rounded","px-1.5","py-0.5","transition-colors",3,"click"],["r","0.8"],["fill","none","stroke-width","0.6","stroke-linecap","round","stroke-linejoin","round","vector-effect","non-scaling-stroke"],["r","0.6"],[1,"flex","items-center","gap-1"],[1,"inline-block","w-2","h-2","rounded-sm"],[1,"text-neutral-300"],[1,"text-neutral-500"],[1,"font-mono","text-neutral-400"]],template:function(e,i){e&1&&(s(0,"div",0)(1,"div"),D(2,ft,11,15,"div",1,Q),a(),C(4,xt,5,0,"div",2)(5,Ot,6,5,"div",3),a()),e&2&&(b("gap-1",i.compact)("gap-2",!i.compact),o(),b("space-y-1",i.compact)("space-y-2",!i.compact),o(),k(et(10,mt)),o(2),x(i.hasAnyUsageData()?-1:4),o(),x(i.showGraphToggle?5:-1))},dependencies:[ot,it],encapsulation:2})}return n})();export{ut as a,Jt as b};
|
|
2
|
+
//# sourceMappingURL=chunk-ACWNNQIT.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as S}from"./chunk-
|
|
1
|
+
import{a as S}from"./chunk-RZBXT5HF.js";import{M as m,t as g}from"./chunk-6TE4LLRT.js";import{C as y,N as h,a as i,aa as u,b as c,k as d,y as f}from"./chunk-TBMJSIBB.js";function I(){return{instanceId:crypto.randomUUID(),label:"default",gatewayUrl:"ws://127.0.0.1:18789",authToken:void 0,isPrimary:!1,autoConnect:!1,testState:"idle"}}function p(o){let l=[],s=o.gatewayUrl??"",t=(o.message??"").toLowerCase(),e=o.failureType??"";return s.startsWith("wss://")&&(e==="ws-error"||e==="ws-close")&&l.push('A gateway wss:// (TLS) protokollt haszn\xE1l \u2014 ha self-signed certificate-et haszn\xE1l, enged\xE9lyezd az "Allow self-signed TLS" opci\xF3t.'),s.startsWith("ws://")&&!s.startsWith("wss://")&&(e==="ws-error"||e==="ws-close")&&l.push("Ha a gateway TLS-t (wss://) haszn\xE1l, cser\xE9ld az URL-t ws:// helyett wss://-re."),e==="timeout"&&l.push("A gateway nem v\xE1laszolt id\u0151ben. Ellen\u0151rizd, hogy fut-e a gateway process \xE9s el\xE9rhet\u0151-e a megadott c\xEDmen."),e==="ws-error"&&!l.length&&l.push("Nem siker\xFClt csatlakozni. Ellen\u0151rizd: 1) fut-e a gateway, 2) helyes-e az URL \xE9s port, 3) nincs-e t\u0171zfal az \xFAtban."),(t.includes("econnrefused")||t.includes("connection refused"))&&l.push("A kapcsolat visszautas\xEDtva \u2014 a gateway nem hallgat a megadott c\xEDmen/porton."),(t.includes("certificate")||t.includes("cert")||t.includes("ssl")||t.includes("tls"))&&l.push('TLS tan\xFAs\xEDtv\xE1ny hiba \u2014 self-signed certificate eset\xE9n enged\xE9lyezd az "Allow self-signed TLS" opci\xF3t.'),l.length?`
|
|
2
2
|
|
|
3
3
|
`+l.join(`
|
|
4
4
|
`):""}var _=(()=>{class o extends m{ociData_AS=y(S);section_$=u({form:{instances:[]}});updateForm(s){this.section_$.update(t=>c(i({},t),{form:i(i({},t.form),s)}))}setSection(s){this.section_$.set(s)}getSectionId(){return g.openclawRegistry}getSection_$(){return this.section_$}doLoad(){return d(this,null,function*(){let s=new Map;for(let a of this.section_$().form.instances)s.set(a.instanceId,{testState:a.testState,testLatencyMs:a.testLatencyMs,testError:a.testError,testResultMessage:a.testResultMessage,authTokenEditMode:a.authTokenEditMode,pairState:a.pairState,pairError:a.pairError,pairMessage:a.pairMessage,pairResultMessage:a.pairResultMessage,connectionStatus:a.connectionStatus,lastConnectedAt:a.lastConnectedAt});let e=(yield this.settings_AS.getSection(g.openclawRegistry)).instances,n=Array.isArray(e)?e.map(a=>{let r=s.get(a.instanceId);return c(i({},a),{authToken:void 0,testState:r?.testState??"idle",testLatencyMs:r?.testLatencyMs,testError:r?.testError,testResultMessage:r?.testResultMessage,authTokenEditMode:r?.authTokenEditMode??!1,pairState:r?.pairState??"idle",pairError:r?.pairError,pairMessage:r?.pairMessage,pairResultMessage:r?.pairResultMessage,connectionStatus:r?.connectionStatus,lastConnectedAt:r?.lastConnectedAt})}):[];this.section_$.set({form:{instances:n}}),this.enrichWithOciStatus().catch(()=>{})})}enrichWithOciStatus(){return d(this,null,function*(){let s=yield this.ociData_AS.listInstances(),t=new Map;for(let e of s.list)t.set(e.instanceId,e);this.section_$.update(e=>c(i({},e),{form:{instances:e.form.instances.map(n=>{let a=t.get(n.instanceId);return a?c(i({},n),{connectionStatus:a.connectionStatus,lastConnectedAt:a.lastConnectedAt}):n})}}))})}buildSaveBody(){return{instances:this.section_$().form.instances.map(t=>({instanceId:t.instanceId,label:t.label,gatewayUrl:t.gatewayUrl,authToken:t.authToken,isPrimary:t.isPrimary,autoConnect:t.autoConnect,allowSelfSignedTls:t.allowSelfSignedTls}))}}savingInstanceId_$=u(null);buildSaveBodyForInstance(s){let t=this.section_$().form.instances.find(e=>e.instanceId===s);return t?{openclawRegistrySaveScope:"instance",targetInstanceId:s,instances:[{instanceId:t.instanceId,label:t.label,gatewayUrl:t.gatewayUrl,authToken:t.authToken,isPrimary:t.isPrimary,autoConnect:t.autoConnect,allowSelfSignedTls:t.allowSelfSignedTls}]}:{}}saveInstance(s){return d(this,null,function*(){this.savingInstanceId_$.set(s),this.saveError_$.set(null);try{let t=this.buildSaveBodyForInstance(s);yield this.doSave(t),yield this.load()}catch(t){this.saveError_$.set(o.getErrorMessage(t))}finally{this.savingInstanceId_$.set(null)}})}addInstance(){let s=I();this.section_$().form.instances.length||(s.isPrimary=!0),this.section_$.update(t=>c(i({},t),{form:{instances:[...t.form.instances,s]}}))}removeInstance(s){this.section_$.update(t=>{let e=t.form.instances.filter((a,r)=>r!==s);return(t.form.instances[s]?.isPrimary??!1)&&e.length>0&&(e[0]=c(i({},e[0]),{isPrimary:!0})),c(i({},t),{form:{instances:e}})})}updateInstance(s,t){this.section_$.update(e=>{let n=e.form.instances.map((a,r)=>r!==s?a:i(i({},a),t));return c(i({},e),{form:{instances:n}})})}setPrimary(s){this.section_$.update(t=>{let e=t.form.instances.map((n,a)=>c(i({},n),{isPrimary:a===s}));return c(i({},t),{form:{instances:e}})})}testConnection(s){return d(this,null,function*(){let t=this.section_$().form.instances[s];if(t){this.updateInstance(s,{testState:"testing",testLatencyMs:void 0,testError:void 0,testResultMessage:void 0});try{let e=yield this.settings_AS.testOpenclawConnection({gatewayUrl:t.gatewayUrl,authToken:t.authToken,allowSelfSignedTls:t.allowSelfSignedTls,instanceId:t.instanceId});if(e.success){let n=e.checks,a=n?" | WS: OK | v3 Handshake: OK | Sessions: OK"+(typeof n.sessionCount=="number"?` (${n.sessionCount} session)`:""):"";this.updateInstance(s,{testState:"ok",testLatencyMs:e.latencyMs,testError:void 0,testResultMessage:`Gateway el\xE9rhet\u0151 \u2014 v\xE1laszid\u0151: ${e.latencyMs}ms${a}`})}else{let n=e.error?.context?.failureType?String(e.error.context.failureType):"unknown",a=p({failureType:n,gatewayUrl:typeof e.error?.context?.gatewayUrl=="string"?e.error.context.gatewayUrl:t.gatewayUrl,message:e.error?.message});this.updateInstance(s,{testState:"error",testLatencyMs:void 0,testError:e.error??new Error("Connection failed"),testResultMessage:`Kapcsol\xF3d\xE1s sikertelen (${n}): ${e.error?.message??"ismeretlen hiba"}${a}`})}}catch(e){let n=e&&typeof e=="object"&&"error"in e?e.error:void 0,a=n?.message?String(n.message):e instanceof Error?e.message:String(e),r=p({gatewayUrl:t.gatewayUrl,message:a});this.updateInstance(s,{testState:"error",testError:n??e,testResultMessage:`Teszt hiba: ${a}${r}`})}}})}pairingInstanceId_$=u(null);pairInstance(s){return d(this,null,function*(){let t=this.section_$().form.instances[s];if(t){this.pairingInstanceId_$.set(t.instanceId),this.updateInstance(s,{pairState:"pairing",pairError:void 0,pairMessage:void 0});try{let e=yield this.settings_AS.pairOpenclawInstance({instanceId:t.instanceId});if(e.status==="paired")this.updateInstance(s,{pairState:"paired",pairingStatus:"paired",pairedAt:e.pairedAt,deviceTokenMasked:e.deviceTokenMasked,ccapDeviceId:e.ccapDeviceId,pairMessage:e.message,pairError:void 0,pairResultMessage:`Sikeresen p\xE1ros\xEDtva \u2014 device token megkapva${e.pairedAt?" ("+e.pairedAt+")":""}`});else if(e.status==="pending")this.updateInstance(s,{pairState:"pending",pairingStatus:"pending",ccapDeviceId:e.ccapDeviceId,pairingRequestId:e.pairingRequestId,pairMessage:e.message,pairError:void 0,pairResultMessage:`J\xF3v\xE1hagy\xE1sra v\xE1r a gateway-en \u2014 Device ID: ${e.ccapDeviceId??"N/A"}`});else if(e.status==="rejected")this.updateInstance(s,{pairState:"rejected",pairingStatus:"rejected",ccapDeviceId:e.ccapDeviceId,pairMessage:e.message,pairError:void 0,pairResultMessage:`A gateway elutas\xEDtotta a p\xE1ros\xEDt\xE1st: ${e.message??"ismeretlen ok"}`});else{let n=e.error?.context,a=p({failureType:typeof n?.failureType=="string"?n.failureType:void 0,gatewayUrl:typeof n?.gatewayUrl=="string"?n.gatewayUrl:t.gatewayUrl,message:e.message??e.error?.message});this.updateInstance(s,{pairState:"error",pairError:e.error??new Error(e.message??"Pairing failed"),pairMessage:e.message,pairResultMessage:`P\xE1ros\xEDt\xE1s hiba: ${e.message??e.error?.message??"ismeretlen hiba"}${a}`})}yield this.load()}catch(e){let n=e&&typeof e=="object"&&"error"in e?e.error:void 0,a=n?.message?String(n.message):e instanceof Error?e.message:String(e),r=n?.context,w=p({failureType:typeof r?.failureType=="string"?r.failureType:void 0,gatewayUrl:typeof r?.gatewayUrl=="string"?r.gatewayUrl:t.gatewayUrl,message:a});this.updateInstance(s,{pairState:"error",pairError:n??e,pairMessage:void 0,pairResultMessage:`P\xE1ros\xEDt\xE1s hiba: ${a}${w}`})}finally{this.pairingInstanceId_$.set(null)}}})}static \u0275fac=(()=>{let s;return function(e){return(s||(s=h(o)))(e||o)}})();static \u0275prov=f({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();export{_ as a};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-AGMHTMQA.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{I as d}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{I as d}from"./chunk-6TE4LLRT.js";import{C as o,p as n,xb as l,y as s}from"./chunk-TBMJSIBB.js";var p=(()=>{class r{baseUrl=`${d.api.baseUrl}/model-registry`;http=o(l);getList(e){let t=new URLSearchParams;e?.provider!==void 0&&e.provider.trim()!==""&&t.set("provider",e.provider.trim()),e?.modelName!==void 0&&e.modelName.trim()!==""&&t.set("modelName",e.modelName.trim()),e?.enabled===!0?t.set("enabled","true"):e?.enabled===!1&&t.set("enabled","false"),e?.inactiveProviderOnly===!0&&t.set("inactiveProviderOnly","true");let i=t.toString(),u=`${this.baseUrl}/list${i!==""?`?${i}`:""}`;return n(this.http.get(u))}sync(){return n(this.http.post(`${this.baseUrl}/sync`,{}))}setEnabled(e,t){return n(this.http.patch(`${this.baseUrl}/patch/${encodeURIComponent(e)}`,{enabled:t}))}patchEntry(e,t){let i={};return t.enabled!==void 0&&(i.enabled=t.enabled),t.reasoningLevelForTest!==void 0&&(i.reasoningLevelForTest=t.reasoningLevelForTest),t.capabilities!==void 0&&(i.capabilities=t.capabilities),n(this.http.patch(`${this.baseUrl}/patch/${encodeURIComponent(e)}`,i))}bulkSetEnabled(e,t){return n(this.http.patch(`${this.baseUrl}/bulk-enabled`,{ids:e,enabled:t}))}deleteEntry(e){return n(this.http.delete(`${this.baseUrl}/entry/${encodeURIComponent(e)}`))}deleteEntries(e){return n(this.http.post(`${this.baseUrl}/delete-entries`,{ids:e}))}getTestResults(e){let t=new URLSearchParams;e.provider&&t.set("provider",e.provider),e.model&&t.set("model",e.model),e.limit!==void 0&&t.set("limit",String(e.limit)),e.reasoningLevel!==void 0&&e.reasoningLevel.trim()!==""&&t.set("reasoningLevel",e.reasoningLevel.trim());let i=t.toString();return n(this.http.get(`${this.baseUrl}/test-results${i?`?${i}`:""}`))}getPrompts(){return n(this.http.get(`${this.baseUrl}/prompts`))}startTestRun(e,t){let i={modelIds:e};return t!==void 0&&t.length>0&&(i.promptIds=t),n(this.http.post(`${this.baseUrl}/test-run`,i))}getTestRunStatus(e){return n(this.http.get(`${this.baseUrl}/test-run/${e}`))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=s({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{p as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BFYF3IU4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{I as f,p as h}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{I as f,p as h}from"./chunk-6TE4LLRT.js";import{C as o,aa as i,h as g,k as s,p as n,xb as u,y as a}from"./chunk-TBMJSIBB.js";var l=g(h());var d=(()=>{class e{baseUrl=`${f.api.baseUrl}/instance-registry`;http=o(u);getList(){return n(this.http.get(`${this.baseUrl}/list`))}getCurrent(){return n(this.http.get(`${this.baseUrl}/current`))}getListUnified(){return n(this.http.get(`${this.baseUrl}/list-unified`))}getPresence(){return n(this.http.get(`${this.baseUrl}/presence`))}static \u0275fac=function(r){return new(r||e)};static \u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var E=(()=>{class e{list_$=i([]);listLoading_$=i(!1);listError_$=i(null);current_$=i(null);currentLoading_$=i(!1);currentError_$=i(null);unifiedList_$=i([]);unifiedListLoading_$=i(!1);unifiedListError_$=i(null);instanceRegistry_AS=o(d);loadList(){return s(this,null,function*(){this.listLoading_$.set(!0),this.listError_$.set(null);try{let r=(yield this.instanceRegistry_AS.getList()).list??[];return this.list_$.set(r),r}catch(t){return l.DyFM_Error.logSimple("CCAP_InstanceRegistryDS | loadList failed",t),this.listError_$.set(t),[]}finally{this.listLoading_$.set(!1)}})}loadCurrent(){return s(this,null,function*(){this.currentLoading_$.set(!0),this.currentError_$.set(null);try{let r=(yield this.instanceRegistry_AS.getCurrent()).current??null;return this.current_$.set(r),r}catch(t){return l.DyFM_Error.logSimple("CCAP_InstanceRegistryDS | loadCurrent failed",t),this.currentError_$.set(t),this.current_$.set(null),null}finally{this.currentLoading_$.set(!1)}})}loadAll(){return s(this,null,function*(){yield Promise.all([this.loadList(),this.loadCurrent()])})}loadUnifiedList(){return s(this,null,function*(){this.unifiedListLoading_$.set(!0),this.unifiedListError_$.set(null);try{let r=(yield this.instanceRegistry_AS.getListUnified()).list??[];return this.unifiedList_$.set(r),r}catch(t){return l.DyFM_Error.logSimple("CCAP_InstanceRegistryDS | loadUnifiedList failed",t),this.unifiedListError_$.set(t),[]}finally{this.unifiedListLoading_$.set(!1)}})}isCurrentRow(t){let r=this.current_$()?.instanceKey?.trim(),c=t.instanceKey?.trim();return!r||!c?!1:r===c}formatMetadataDate(t){if(t==null)return"\u2014";if(t instanceof Date)return Number.isNaN(t.getTime())?"\u2014":t.toISOString();let r=new Date(t);return Number.isNaN(r.getTime())?String(t):r.toISOString()}static \u0275fac=function(r){return new(r||e)};static \u0275prov=a({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{d as a,E as b};
|
|
2
|
+
//# sourceMappingURL=chunk-BNU5THES.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as R,b as O}from"./chunk-
|
|
1
|
+
import{a as R,b as O}from"./chunk-77JJATPE.js";import{a as q}from"./chunk-XLKBCO5O.js";import{a as g}from"./chunk-UFBTR2BG.js";import{a as U}from"./chunk-QSN7KY5M.js";import{e as P}from"./chunk-KDPOJH6B.js";import{h as y,j as L}from"./chunk-RPTXBYC4.js";import{p as D}from"./chunk-6TE4LLRT.js";import{C as v,R as T,a as h,aa as p,b as S,h as E,k as d,y as A}from"./chunk-TBMJSIBB.js";var f=E(D());var _=class u{static compareAsc(C,e){let s=(C.sequence??0)-(e.sequence??0);if(s!==0)return s;let n=typeof C.timestamp=="string"?C.timestamp:"",t=typeof e.timestamp=="string"?e.timestamp:"",o=n.localeCompare(t);if(o!==0)return o;let i=typeof C.messageKey=="string"?C.messageKey:"",r=typeof e.messageKey=="string"?e.messageKey:"";return i.localeCompare(r)}static sortAsc(C){return[...C].sort(u.compareAsc)}};var M=E(D());var x=(()=>{class u{parent;agentToolUseIds=new Set;activeSubAgentId="";toolUseIdToName=new Map;init(e){this.parent=e}resetTrackingState(){this.toolUseIdToName.clear(),this.agentToolUseIds.clear(),this.activeSubAgentId=""}handleSocketEvent(e,s){let n=e.event,t=e.payload;try{let o=typeof t.ccapId=="string"?t.ccapId:"";if(n!=="cc:rate-limit-update"&&n!=="ext-session-msg:message"&&n!=="ext-session-msg:update"&&o&&s.selectedCcapId&&o!==s.selectedCcapId){M.DyFM_Log.info(`CCAP_CcSession_DS | socket event dropped by instance filter | event: ${n} | eventCcapId: ${o} | selectedCcapId: ${s.selectedCcapId}`);return}switch(n){case"cc-session:status":this.handleStatusUpdate(t);break;case"cc-session:output":this.handleOutputChunk(t);break;case"cc-session:event":this.handleSessionEvent(t);break;case"cc-session:list-update":this.handleListUpdate(t);break;case"cc-session:session-update":this.handleSessionItemUpdate(t);break;case"agent-events":this.handleAgentEvent(t);break;case"ext-session-msg:message":this.handleAssembledMessage(t);break;case"ext-session-msg:update":this.handleAssembledMessageUpdate(t);break;case"cc:rate-limit-update":this.handleRateLimitBroadcast(t);break}}catch(o){let i=o instanceof Error?o.message:String(o);M.DyFM_Log.error(`CCAP_CcSession_DS | socket event error | event: ${n}`,o),s.globalErrorShowError(o instanceof Error?o:new Error(`CC Session socket event processing failed: ${n} \u2014 ${i}`),"cc-session-socket-event")}}pushConsoleMessageFromEvent(e,s,n){let t=e.data;switch(e.eventType){case"response-chunk":{this.pushResponseChunkBlocks(t);break}case"tool-call-start":{let o=t.name??t.tool_name??"unknown",i=typeof t.id=="string"?t.id:"";i&&this.toolUseIdToName.set(i,o),o==="Agent"&&i&&this.agentToolUseIds.add(i);let r=t.input,a=r?u.summarizeToolInput(r):"",l=a?`${o}: ${a}`:o,c=o==="Edit"?u.buildEditExpandableContent(r):void 0,m=o==="Agent"?"":this.activeSubAgentId;this.parent.pushConsoleMessage({type:"tool",text:l,expandableContent:c,rawData:t,parentAgentId:m||void 0});break}case"tool-call-end":{let o=t.content??t.output,i=typeof o=="string"?o:"",r=i.length>200?i.substring(0,200)+"\u2026":i;if(r){let a=i.length>200?i:void 0;this.parent.pushConsoleMessage({type:"tool-result",text:r,expandableContent:a,rawData:t,parentAgentId:this.activeSubAgentId||void 0})}break}case"response-complete":{this.activeSubAgentId="";let o=t.cost_usd,i=typeof o=="number"?` ($${o.toFixed(4)})`:"",r=typeof t.model=="string"?` \xB7 ${t.model}`:"";this.parent.pushConsoleMessage({type:"result",text:`Response complete${r}${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)}),this.accumulateUsage(t);break}case"prompt-sent":{let o=typeof t.content=="string"?t.content:"";o&&(this.parent.consoleMessages_$().some(a=>a.type==="prompt"&&a.text===o.trim())||this.parent.pushConsoleMessage({type:"prompt",text:o,rawData:t,expandableContent:JSON.stringify(t,null,2)}));break}case"status-change":{let o=typeof t.from=="string"?t.from:"",i=typeof t.to=="string"?t.to:"";if(i){let r=typeof t.statusMessage=="string"?t.statusMessage:void 0,a=o?`${o} \u2192 ${i}`:i,l=r?`${a} \u2014 ${r}`:a;this.parent.pushConsoleMessage({type:"status",text:l,isStatus:!0,rawData:t,expandableContent:JSON.stringify(t,null,2)})}break}case"config-change":{let o=t.update,i=o&&typeof o=="object"?Object.keys(o).join(", "):"unknown";this.parent.pushConsoleMessage({type:"info",text:`Config updated: ${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"error":{let o=typeof t.message=="string"?t.message:"Unknown error";this.parent.pushConsoleMessage({type:"error",text:o,rawData:t,expandableContent:JSON.stringify(t,null,2)}),s&&n(new Error(`CC Session error: ${o}`),"cc-session-event");break}case"usage-update":{this.accumulateUsage(t);break}case"cli-chunk":{this.handleCliChunkEvent(t);break}case"runner-overflow":{let i=`Runner buffer overflow: ${typeof t.droppedCount=="number"?t.droppedCount:0} output items lost during server disconnect`;this.parent.pushConsoleMessage({type:"error",text:i,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"interrupted-prompt":{let o=typeof t.reason=="string"?t.reason:"",i=typeof t.lastPrompt=="string"?t.lastPrompt:"",r=i.length>80?i.substring(0,80)+"\u2026":i,a=r?`Prompt interrupted (${o}): "${r}"`:`Prompt interrupted${o?" ("+o+")":""}`;this.parent.pushConsoleMessage({type:"status",text:a,isStatus:!0,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"session-init":{let o=typeof t.model=="string"?t.model:"",i=typeof t.claudeCodeVersion=="string"?t.claudeCodeVersion:"",r=typeof t.permissionMode=="string"?t.permissionMode:"",a=[];o&&a.push(o),r&&a.push(r),i&&a.push(`v${i}`);let l=a.length>0?`CLI init: ${a.join(" \xB7 ")}`:"CLI initialized",c=JSON.stringify(t,null,2);this.parent.pushConsoleMessage({type:"info",text:l,rawData:t,expandableContent:c});break}case"config-mismatch":{let o=t.mismatches,i=Array.isArray(o)?o.map(r=>`${r.field}: requested "${r.requested}" \u2192 actual "${r.actual}"`).join(", "):"unknown mismatch";this.parent.pushConsoleMessage({type:"error",text:`Config mismatch: ${i}`,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"cli-args-record":{let o=typeof t.model=="string"?t.model:"default",i=typeof t.reasoningEffort=="string"?t.reasoningEffort:"default",r=typeof t.mode=="string"?t.mode:"normal",a=typeof t.permissionPolicy=="string"?t.permissionPolicy:"default",l=`CLI spawn: model=${o} \xB7 effort=${i} \xB7 mode=${r} \xB7 permission=${a}`;this.parent.pushConsoleMessage({type:"info",text:l,rawData:t,expandableContent:JSON.stringify(t,null,2)});break}case"stdout-line":case"stderr-line":break;default:{let o=e.eventType;this.parent.pushConsoleMessage({type:"raw",text:o,rawData:t});break}}}handleStatusUpdate(e){let s=e.sessionId??"",n=e.status??"",t=e.statusMessage;this.parent.lastStatusUpdate_$.set({sessionId:s,status:n,statusMessage:t});let i=this.parent.sessions_$().map(a=>a.sessionId===s?S(h({},a),{status:n,statusMessage:t}):a);this.parent.sessions_$.set(i);let r=this.parent.selectedSession_$();if(r?.session.sessionId===s){let a=u.isLiveCcSessionStatus(n);this.parent.selectedSession_$.set(S(h({},r),{session:S(h({},r.session),{status:n,statusMessage:t}),runtime:S(h({},r.runtime),{isLive:a,runtimeStatus:n})}))}if(n==="errored"){let a=(t??"").trim();if(a.startsWith("Auto-recovery: terminal runner dropped silently")||a.startsWith("Exit code:"))M.DyFM_Log.warn(`CCAP_CcSession | user-task-fail diagnostic (NOT recorded to /errors) | sessionId: ${s} | statusMessage: ${a}`);else{let c=t?`CC Session error (${s}): ${t}`:`CC Session error (${s}): session entered errored state`;this.parent.showGlobalError(new Error(c),"cc-session-status")}}this.parent.evaluateSessionEventsPolling()}handleOutputChunk(e){let s=e.sessionId??"";if(s&&s!==this.parent.activeSessionId_$())return;let n=e.content??"",t=e.type??"stdout",o=this.parent.liveOutput_$(),i=n.split(`
|
|
2
2
|
`),r=3e3;if(t==="stderr"){let c=new Set(this.parent.liveStderrLines_$()),m=o.length;for(let I=0;I<i.length;I++)c.add(m+I);this.parent.liveStderrLines_$.set(c)}let l=[...o,...i];if(l.length>r){let c=l.length-r,m=l.slice(c),I=this.parent.liveStderrLines_$(),b=new Set;for(let w of I){let $=w-c;$>=0&&b.add($)}this.parent.liveStderrLines_$.set(b),this.parent.liveOutput_$.set(m)}else this.parent.liveOutput_$.set(l)}handleSessionEvent(e){let s=e.sessionId??"";if(s&&s!==this.parent.activeSessionId_$())return;let n=e.event??{},t={sessionId:s,eventType:n.eventType??"",timestamp:n.timestamp??"",data:n.data??{},sequence:n.sequence??0,eventSource:typeof n.eventSource=="string"?n.eventSource:void 0};if(t.sequence<=this.parent.getLastKnownEventSequence())return;this.parent.setLastKnownEventSequence(t.sequence);let o=this.parent.selectedSessionEvents_$();this.parent.selectedSessionEvents_$.set([...o,t]),this.pushConsoleMessageFromEvent(t,!0,(i,r)=>{this.parent.showGlobalError(i,r)})}handleAgentEvent(e){let s=typeof e.phase=="string"?e.phase:void 0;if(s)switch(s){case g.runInitialization:this.parent.pushConsoleMessage({type:"status",text:"RUN initialization",isStatus:!0});break;case g.analyze:this.parent.pushConsoleMessage({type:"status",text:"Analyzing incoming message",isStatus:!0});break;case g.analyzeResult:{let n=typeof e.runIntent=="string"?e.runIntent:"";n&&this.parent.pushConsoleMessage({type:"run-intent",text:n,isStatus:!1});break}case g.assemble:this.parent.pushConsoleMessage({type:"status",text:"Refreshing Context",isStatus:!0});break;case g.executionStart:this.parent.pushConsoleMessage({type:"status",text:"Starting Agent",isStatus:!0});break;case g.llmAgenticLoop:this.parent.pushConsoleMessage({type:"status",text:"Selecting next move",isStatus:!0});break;case g.agenticLoopIteration:{let n=typeof e.action=="string"?e.action:"",t=typeof e.tool=="string"?e.tool:"",o=typeof e.intent=="string"?e.intent:"",i=[];n&&i.push(n),t&&i.push(t),o&&i.push(o);let r=i.join(" \xB7 ");r&&this.parent.pushConsoleMessage({type:"iteration",text:r,isStatus:!1});break}case g.llmToolDescription:this.parent.pushConsoleMessage({type:"status",text:"Assembling tool inputs",isStatus:!0});break;case g.llmToolErrorRetry:this.parent.pushConsoleMessage({type:"status",text:"Figuring out what's wrong",isStatus:!0});break;case g.toolErrorRetry:this.parent.pushConsoleMessage({type:"status",text:"Trying to fix inputs",isStatus:!0});break;case g.executionEnd:this.parent.pushConsoleMessage({type:"status",text:"Finishing run",isStatus:!0});break;case g.finalization:case g.llmRunFinalization:this.parent.pushConsoleMessage({type:"status",text:"Gathering what we've done",isStatus:!0});break;case g.postFinalization:this.parent.pushConsoleMessage({type:"status",text:"Memorizing stuff",isStatus:!0});break;case g.runFlowComplete:this.parent.pushConsoleMessage({type:"status",text:"Getting back to user",isStatus:!0});break}}handleRateLimitBroadcast(e){let s=e.rate_limit_info;if(!s||typeof s!="object")return;let n=s,t={status:typeof n.status=="string"?n.status:"",resetsAt:typeof n.resetsAt=="number"?n.resetsAt:0,rateLimitType:typeof n.rateLimitType=="string"?n.rateLimitType:"",utilization:typeof n.utilization=="number"?n.utilization:0,surpassedThreshold:typeof n.surpassedThreshold=="number"?n.surpassedThreshold:0,isUsingOverage:n.isUsingOverage===!0,receivedAt:new Date().toISOString()};this.parent.rateLimitInfo_$.set(t)}handleListUpdate(e){let s=e.sessions??[],o=[...this.parent.sessions_$().some(i=>i.isArchived===!0)?s:s.filter(i=>!i.isArchived)].sort((i,r)=>{let a=i.lastActivityAt?new Date(i.lastActivityAt).getTime():0;return(r.lastActivityAt?new Date(r.lastActivityAt).getTime():0)-a});this.parent.sessions_$.set(o),this.mergeActiveSessionDetail(s)}handleSessionItemUpdate(e){let s=typeof e.sessionId=="string"?e.sessionId:"";if(!s)return;let n=typeof e.update=="object"&&e.update!==null?e.update:{},o=this.parent.sessions_$().map(r=>r.sessionId!==s?r:u.applySessionFieldUpdate(r,n));this.parent.sessions_$.set(o);let i=this.parent.selectedSession_$();i?.session.sessionId===s&&this.parent.selectedSession_$.set(S(h({},i),{session:u.applySessionFieldUpdate(i.session,n)}))}static applySessionFieldUpdate(e,s){let n=h({},e);return typeof s.toolCallCountIncrement=="number"&&(n.toolCallCount=(n.toolCallCount??0)+s.toolCallCountIncrement),typeof s.promptCountIncrement=="number"&&(n.promptCount=(n.promptCount??0)+s.promptCountIncrement),typeof s.inputTokensIncrement=="number"&&(n.inputTokensTotal=(n.inputTokensTotal??0)+s.inputTokensIncrement),typeof s.outputTokensIncrement=="number"&&(n.outputTokensTotal=(n.outputTokensTotal??0)+s.outputTokensIncrement),typeof s.costUsdIncrement=="number"&&(n.costUsdTotal=(n.costUsdTotal??0)+s.costUsdIncrement),typeof s.status=="string"&&(n.status=s.status),(typeof s.statusMessage=="string"||s.statusMessage===void 0)&&(n.statusMessage=s.statusMessage),typeof s.lastActivityAt=="string"&&(n.lastActivityAt=s.lastActivityAt),typeof s.lastPrompt=="string"&&(n.lastPrompt=s.lastPrompt),typeof s.activeModel=="string"&&(n.activeModel=s.activeModel),n}mergeActiveSessionDetail(e){let s=this.parent.activeSessionId_$();if(!s)return;let n=this.parent.selectedSession_$();if(!n)return;let t=e.find(o=>o.sessionId===s);t&&this.parent.selectedSession_$.set(S(h({},n),{session:h(h({},n.session),t)}))}handleAssembledMessage(e){let s=typeof e.sessionId=="string"?e.sessionId:"",n=this.parent.activeSessionId_$();if(!s||s!==n)return;let t=e.message;if(!t||typeof t!="object"){M.DyFM_Log.warn("CCAP_CcSession_DS | handleAssembledMessage dropped: invalid message payload",{sessionId:s,payloadKeys:Object.keys(e)});return}let o=t,i=this.parent.assembledMessages_$(),r=typeof o.messageKey=="string"?o.messageKey:"";r&&i.some(a=>a.messageKey===r)||this.parent.assembledMessages_$.set(_.sortAsc([...i,o]))}handleAssembledMessageUpdate(e){let s=typeof e.sessionId=="string"?e.sessionId:"";if(!s||s!==this.parent.activeSessionId_$())return;let n=typeof e.messageKey=="string"?e.messageKey:"";if(!n)return;let t=e.update;if(!t||typeof t!="object")return;let o=t,i=this.parent.assembledMessages_$(),r=i.findIndex(c=>c.messageKey===n);if(r<0)return;let a=h({},i[r]);typeof o.bodyText=="string"&&(a.bodyText=o.bodyText),o.toolResult!==void 0&&(a.toolResult=o.toolResult),typeof o.toolStatus=="string"&&(a.toolStatus=o.toolStatus),o.headerStatusDot!==void 0&&(a.headerStatusDot=typeof o.headerStatusDot=="string"?o.headerStatusDot:void 0);let l=[...i];l[r]=a,this.parent.assembledMessages_$.set(l)}handleCliChunkEvent(e){let s=typeof e.type=="string"?e.type:"";if(s==="rate_limit_event"){let n=e.rate_limit_info;if(n&&typeof n=="object"){let t=n,o={status:typeof t.status=="string"?t.status:"",resetsAt:typeof t.resetsAt=="number"?t.resetsAt:0,rateLimitType:typeof t.rateLimitType=="string"?t.rateLimitType:"",utilization:typeof t.utilization=="number"?t.utilization:0,surpassedThreshold:typeof t.surpassedThreshold=="number"?t.surpassedThreshold:0,isUsingOverage:t.isUsingOverage===!0,receivedAt:new Date().toISOString()};this.parent.rateLimitInfo_$.set(o)}return}if(s==="system"){this.handleCliChunkSystemEvent(e);return}this.handleCliChunkToolResults(e)||this.parent.pushConsoleMessage({type:"raw",text:s||"cli-chunk",rawData:e})}handleCliChunkSystemEvent(e){let s=typeof e.subtype=="string"?e.subtype:"",n=typeof e.description=="string"?e.description:u.buildSystemEventBrief({subtype:s,data:e}),t=typeof e.tool_use_id=="string"?e.tool_use_id:"";t&&this.agentToolUseIds.has(t)&&(this.activeSubAgentId=t);let o=t&&this.agentToolUseIds.has(t)?t:this.activeSubAgentId||void 0,i=typeof e.last_tool_name=="string"?e.last_tool_name:"";if(s==="task_progress"&&i){this.parent.pushConsoleMessage({type:"tool",text:`${i}: ${n}`,isStatus:!1,rawData:e,parentAgentId:o});return}this.parent.pushConsoleMessage({type:"status-update",text:n,subtype:s,isStatus:!1,rawData:e,parentAgentId:o})}pushResponseChunkBlocks(e){let s=e.message,n=s&&typeof s=="object"?s.content:e.content;if(Array.isArray(n)){for(let t of n){if(!t||typeof t!="object")continue;let o=t,i=typeof o.type=="string"?o.type:"";if(i==="text"){let r=typeof o.text=="string"?o.text:"";r&&(this.activeSubAgentId="",this.parent.pushConsoleMessage({type:"assistant",text:r,rawData:e}))}else if(i==="tool_use")this.handleResponseChunkToolUse(o,e);else if(i==="tool_result")this.handleResponseChunkToolResult(o);else if(i==="thinking"){let r=typeof o.thinking=="string"?o.thinking:"";r&&this.parent.pushConsoleMessage({type:"thinking",text:r,rawData:o,parentAgentId:this.activeSubAgentId||void 0})}else i&&this.parent.pushConsoleMessage({type:"raw",text:i,rawData:o})}return}if(typeof n=="string"&&n){this.parent.pushConsoleMessage({type:"assistant",text:n,rawData:e});return}this.parent.pushConsoleMessage({type:"raw",text:"response-chunk",rawData:e})}handleResponseChunkToolUse(e,s){let n=typeof e.name=="string"?e.name:"unknown",t=typeof e.id=="string"?e.id:"";t&&this.toolUseIdToName.set(t,n),n==="Agent"&&t&&this.agentToolUseIds.add(t);let o=e.input,i=o?u.summarizeToolInput(o):"",r=i?`${n}: ${i}`:n,a=n==="Edit"?u.buildEditExpandableContent(o):void 0,l=n==="Agent"?"":this.activeSubAgentId;this.parent.pushConsoleMessage({type:"tool",text:r,expandableContent:a,rawData:e,parentAgentId:l||void 0})}handleResponseChunkToolResult(e){let s=typeof e.tool_use_id=="string"?e.tool_use_id:"",n=s&&this.agentToolUseIds.has(s)?s:this.activeSubAgentId||"",t=e.content??e.output,o=typeof t=="string"?t:"",i=o.length>200?o.substring(0,200)+"\u2026":o||"tool_result";this.parent.pushConsoleMessage({type:"tool-result",text:i,expandableContent:o.length>200?o:void 0,rawData:e,parentAgentId:n||void 0})}handleCliChunkToolResults(e){if((typeof e.type=="string"?e.type:"")!=="user")return!1;let n=e.message,t=n&&typeof n=="object"?n.content:null;if(!Array.isArray(t))return!1;let o=typeof e.parent_tool_use_id=="string"?e.parent_tool_use_id:"",i=!1;for(let r of t){if(!r||typeof r!="object")continue;let a=r,l=typeof a.type=="string"?a.type:"";if(l==="tool_result"){let c=typeof a.tool_use_id=="string"?a.tool_use_id:"",m=c?this.toolUseIdToName.get(c)??"":"",I=a.content,b=typeof I=="string"?I:"",w=a.is_error===!0,$=m?`${m}: `:"",k=b.length>200?b.substring(0,200)+"\u2026":b||"tool result",F=w?`${$}ERROR \u2014 ${k}`:`${$}${k}`;this.parent.pushConsoleMessage({type:"tool-result",text:F,expandableContent:b.length>200?b:void 0,rawData:S(h({},a),{parent_tool_use_id:o||void 0}),parentAgentId:o||void 0}),i=!0}else if(l==="text"&&o){let c=typeof a.text=="string"?a.text:"";if(c){let m=c.length>200?c.substring(0,200)+"\u2026":c;this.parent.pushConsoleMessage({type:"tool-result",text:m,expandableContent:c.length>200?c:void 0,rawData:{tool_use_id:o,type:"sub-agent-prompt",text:c},parentAgentId:o}),i=!0}}}return i}static isLiveCcSessionStatus(e){return e==="running"||e==="waiting-input"||e==="starting"}static buildSystemEventBrief(e){switch(e.subtype){case"init":{let s=typeof e.data.cwd=="string"?e.data.cwd:"",n=typeof e.data.model=="string"?e.data.model:"",t=["init"];return s&&t.push(s),n&&t.push(n),t.join(" \xB7 ")}case"task_updated":{let s=e.data.patch,n=s&&typeof s=="object"&&typeof s.status=="string"?s.status:"";return n?`task ${n}`:"task updated"}case"task_notification":{let s=typeof e.data.status=="string"?e.data.status:"";return s?`task ${s}`:"task notification"}default:return e.subtype||"system"}}static buildEditExpandableContent(e){if(!e||typeof e!="object")return;let s=e,n=s.old_string,t=s.new_string;if(typeof n!="string"||typeof t!="string")return;let o=500,i=n.length>o?n.substring(0,o)+"\u2026":n,r=t.length>o?t.substring(0,o)+"\u2026":t;return JSON.stringify({old:i,new:r})}static summarizeToolInput(e){if(typeof e=="string")return e.length>120?e.substring(0,120)+"\u2026":e;if(e&&typeof e=="object"){let s=e,n=s.file_path??s.path,t=s.command,o=s.pattern;if(typeof n=="string")return n;if(typeof t=="string")return t.length>120?t.substring(0,120)+"\u2026":t;if(typeof o=="string")return o}return""}accumulateUsage(e){let s=e.usage,n=typeof e.cost_usd=="number"?e.cost_usd:0,t=0,o=0;if(s&&typeof s=="object"){let r=s;t=typeof r.input_tokens=="number"?r.input_tokens:typeof r.promptTokens=="number"?r.promptTokens:0,o=typeof r.output_tokens=="number"?r.output_tokens:typeof r.completionTokens=="number"?r.completionTokens:0}let i=this.parent.sessionUsage_$();this.parent.sessionUsage_$.set({promptTokens:i.promptTokens+t,completionTokens:i.completionTokens+o,totalTokens:i.totalTokens+t+o,costUsd:i.costUsd+n})}static \u0275fac=function(s){return new(s||u)};static \u0275prov=A({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();var ne=(()=>{class u{sessions_$=p([]);sessionsLoading_$=p(!1);sessionsLoadError_$=p(null);selectedSession_$=p(null);selectedSessionLoading_$=p(!1);selectedSessionEvents_$=p([]);liveOutput_$=p([]);liveStderrLines_$=p(new Set);consoleMessages_$=p([]);assembledMessages_$=p([]);assembledMessagesHasMore_$=p(!1);isLoadingOlderMessages_$=p(!1);assembledMessagesLoaded_$=p(!1);lastStatusUpdate_$=p(null);sessionUsage_$=p({promptTokens:0,completionTokens:0,totalTokens:0,costUsd:0});rateLimitInfo_$=p(null);activeSessionId_$=p("");ccSession_AS=v(R);extSessionMsg_AS=v(q);globalError_CS=v(L);socket_CS=v(P);ngZone=v(T);peiContext_DS=v(U);socketEventHandler_CS=v(x);eventSubscription=null;reconnectSubscription=null;lastKnownEventSequence=-1;static SESSION_EVENTS_POLL_INTERVAL_MS=5*f.second;sessionEventsPollHandle=null;isSessionEventsPollInFlight=!1;constructor(){this.socketEventHandler_CS.init(this),this.eventSubscription=this.socket_CS.event$.subscribe(e=>{this.ngZone.run(()=>{this.socketEventHandler_CS.handleSocketEvent(e,{selectedCcapId:this.peiContext_DS.activeCcapId_$(),globalErrorShowError:(s,n)=>{this.globalError_CS.showError(s,n)}})})}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(e=>{if(!e)return;let s=this.activeSessionId_$();s&&(this.socket_CS.emit("cc-session:subscribe",{sessionId:s}),this.loadAssembledMessages({sessionId:s}).catch(()=>{}),this.loadSessionDetail({sessionId:s}).catch(()=>{})),this.loadSessions().catch(()=>{}),this.backfillMissedEvents()})}ngOnDestroy(){this.stopSessionEventsPolling(),this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null),this.reconnectSubscription&&(this.reconnectSubscription.unsubscribe(),this.reconnectSubscription=null)}showGlobalError(e,s){this.globalError_CS.showError(e,s)}getLastKnownEventSequence(){return this.lastKnownEventSequence}setLastKnownEventSequence(e){this.lastKnownEventSequence=e}evaluateSessionEventsPolling(){let e=this.activeSessionId_$(),s=this.resolveActiveSessionStatusForEventsPolling();!!(e&&this.lastKnownEventSequence>=0&&s!=null&&x.isLiveCcSessionStatus(s))?this.ensureSessionEventsPollingStarted():this.stopSessionEventsPolling()}loadSessions(e){return d(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let n=[...(yield this.ccSession_AS.listSessions({status:e?.status,workspacePath:e?.workspacePath,includeArchived:e?.includeArchived})).sessions].sort((t,o)=>{let i=t.lastActivityAt?new Date(t.lastActivityAt).getTime():0;return(o.lastActivityAt?new Date(o.lastActivityAt).getTime():0)-i});this.sessions_$.set(n)}catch(s){this.sessionsLoadError_$.set(s)}finally{this.sessionsLoading_$.set(!1)}})}loadPersistedRateLimitState(e){return d(this,null,function*(){let s=e.ccapId?.trim()??"";if(s)try{let n=yield this.ccSession_AS.getRateLimitState({ccapId:s});this.mergePersistedRateLimitState(n.items)}catch(n){f.DyFM_Log.warn(`ClaudeCode_DS | loadPersistedRateLimitState failed (non-blocking) | ccapId: ${s} | ${n instanceof Error?n.message:String(n)}`)}})}mergePersistedRateLimitState(e){if(this.rateLimitInfo_$()!==null)return;let s=O.mapServerItemsToClientInfo(e);s!==null&&this.rateLimitInfo_$.set(s)}loadSessionDetail(e){return d(this,null,function*(){this.selectedSessionLoading_$.set(!0);try{let s=yield this.ccSession_AS.getSession({sessionId:e.sessionId}),n=this.activeSessionId_$();if(n&&n!==e.sessionId){f.DyFM_Log.info(`CCAP_CcSession_DS | loadSessionDetail stale response \u2014 discarded | requestedSessionId: ${e.sessionId} | currentActiveSessionId: ${n}`);return}this.selectedSession_$.set(s)}catch(s){let n=this.activeSessionId_$();if(n&&n!==e.sessionId)return;this.selectedSession_$.set(null);let t=s instanceof Error?s.message:"Failed to load session details";this.pushConsoleMessage({type:"error",text:`Load session failed: ${t}`})}finally{this.selectedSessionLoading_$.set(!1),this.evaluateSessionEventsPolling()}})}loadSessionEvents(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.getSessionEvents({sessionId:e.sessionId,eventType:e.eventType,limit:e.limit??500,latest:!0}),n=this.activeSessionId_$();if(n&&n!==e.sessionId){f.DyFM_Log.info(`CCAP_CcSession_DS | loadSessionEvents stale response \u2014 discarded | requestedSessionId: ${e.sessionId} | currentActiveSessionId: ${n}`);return}this.selectedSessionEvents_$.set(s.events),this.updateLastKnownSequence(s.events);for(let t of s.events)this.socketEventHandler_CS.pushConsoleMessageFromEvent(t,!1,(o,i)=>{this.globalError_CS.showError(o,i)});this.loadAssembledMessages({sessionId:e.sessionId}).catch(()=>{})}catch{let n=this.activeSessionId_$();if(n&&n!==e.sessionId)return;this.selectedSessionEvents_$.set([])}finally{this.evaluateSessionEventsPolling()}})}createSession(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.createSession(e),n=String(s.session.sessionId||"");return yield this.loadSessions(),n}catch(s){throw this.pushConsoleMessage({type:"error",text:`Create session failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}sendPrompt(e){return d(this,null,function*(){let s=e.attachments?.filter(n=>n.isImage&&!!n.base64).map(n=>`data:${n.mimeType};base64,${n.base64}`);this.pushConsoleMessage({type:"prompt",text:e.content,imageDataUrls:s?.length?s:void 0});try{let n=yield this.ccSession_AS.sendPrompt(e);n.relayed&&(n.targetOnline?this.pushConsoleMessage({type:"info",text:`Prompt relayed to remote instance (task: ${n.taskId?.substring(0,8)}\u2026)`}):this.pushConsoleMessage({type:"error",text:`\u26A0 A t\xE1voli instance jelenleg offline \u2014 a prompt queue-ban v\xE1rakozik (task: ${n.taskId?.substring(0,8)}\u2026) \xE9s csak akkor k\xE9zbes\xEDt\u0151dik, ha a target instance online lesz. Ellen\u0151rizd, hogy mindk\xE9t instance fut, \xE9s a Settings \u2192 Cluster sharedSecret azonos.`})),this.evaluateSessionEventsPolling()}catch(n){throw this.pushConsoleMessage({type:"error",text:`Send failed: ${y.getErrorMessageForDisplay(n)}`}),this.globalError_CS.showError(n,"CC Session sendPrompt"),n}})}forkSession(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.forkSession({sessionId:e.sessionId,label:e.label}),n=String(s.session.sessionId||"");return yield this.loadSessions(),n}catch(s){throw this.pushConsoleMessage({type:"error",text:`Fork session failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}resumeSession(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.resumeSession(e);s.relayed&&this.pushConsoleMessage({type:"info",text:s.targetOnline?"Resume relayed to remote instance":"Resume queued for offline remote instance"}),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Resume failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}stopExecution(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.stopExecution(e);if(s.relayed){this.pushSystemAssembledMessage({sessionId:e.sessionId,text:s.targetOnline?"Stop execution relayed to remote instance":"Stop execution queued for offline remote instance",role:"info"});return}let n=s.message||"Execution stopped";this.pushSystemAssembledMessage({sessionId:e.sessionId,text:n,role:"info"})}catch(s){throw this.pushSystemAssembledMessage({sessionId:e.sessionId,text:`Stop execution failed: ${y.getErrorMessageForDisplay(s)}`,role:"error"}),s}})}loadDiagnostic(e){return d(this,null,function*(){try{return yield this.ccSession_AS.getDiagnostic({sessionId:e.sessionId})}catch(s){return f.DyFM_Log.error(`CCAP_CcSession_DS | loadDiagnostic failed | sessionId: ${e.sessionId}`,s),null}})}terminateSession(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.terminateSession(e);s.relayed?this.pushSystemAssembledMessage({sessionId:e.sessionId,text:s.targetOnline?"Terminate relayed to remote instance":"Terminate queued for offline remote instance",role:"info"}):this.pushSystemAssembledMessage({sessionId:e.sessionId,text:"Session terminated",role:"status"}),yield this.loadSessions()}catch(s){throw this.pushSystemAssembledMessage({sessionId:e.sessionId,text:`Terminate failed: ${y.getErrorMessageForDisplay(s)}`,role:"error"}),s}})}restartRunner(e){return d(this,null,function*(){try{let s=yield this.ccSession_AS.restartRunner(e);this.pushSystemAssembledMessage({sessionId:e.sessionId,text:`Runner restarted (new terminalId: ${s.newTerminalId.slice(0,8)}\u2026). New terminal window should open shortly.`,role:"info"})}catch(s){throw this.pushSystemAssembledMessage({sessionId:e.sessionId,text:`Runner restart failed: ${y.getErrorMessageForDisplay(s)}`,role:"error"}),s}})}setSessionArchived(e){return d(this,null,function*(){try{yield this.ccSession_AS.setSessionArchived(e),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Archive failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}updateSessionConfig(e){return d(this,null,function*(){try{yield this.ccSession_AS.updateSessionConfig(e);let s=this.selectedSession_$();if(s?.session.sessionId===e.sessionId){let n=h({},s.session);e.label!=null&&(n.label=e.label),e.mode!=null&&(n.mode=e.mode),e.permissionPolicy!=null&&(n.permissionPolicy=e.permissionPolicy),e.reasoningEffort!=null&&(n.reasoningEffort=e.reasoningEffort),e.model!=null&&(n.model=e.model),e.isDebugMode!=null&&(n.isDebugMode=e.isDebugMode),this.selectedSession_$.set(S(h({},s),{session:n}))}if(e.label!=null){let n=this.sessions_$(),t=n.findIndex(o=>o.sessionId===e.sessionId);if(t>=0){let o=[...n];o[t]=S(h({},o[t]),{label:e.label}),this.sessions_$.set(o)}}}catch(s){throw this.pushConsoleMessage({type:"error",text:`Config update failed: ${y.getErrorMessageForDisplay(s)}`}),s}})}setActiveSessionId(e){let s=this.activeSessionId_$();s!==e&&this.stopSessionEventsPolling(),s&&s!==e&&this.socket_CS.emit("cc-session:unsubscribe",{sessionId:s}),this.activeSessionId_$.set(e),e&&this.socket_CS.emit("cc-session:subscribe",{sessionId:e})}clearLiveOutput(){this.stopSessionEventsPolling(),this.liveOutput_$.set([]),this.liveStderrLines_$.set(new Set),this.consoleMessages_$.set([]),this.assembledMessages_$.set([]),this.assembledMessagesHasMore_$.set(!1),this.isLoadingOlderMessages_$.set(!1),this.assembledMessagesLoaded_$.set(!1),this.selectedSession_$.set(null),this.selectedSessionEvents_$.set([]),this.lastStatusUpdate_$.set(null),this.sessionUsage_$.set({promptTokens:0,completionTokens:0,totalTokens:0,costUsd:0}),this.lastKnownEventSequence=-1,this.socketEventHandler_CS.resetTrackingState()}pushConsoleMessage(e){let s=e.type==="assistant"||e.type==="prompt"?e.text.trim():e.text,n={listKey:e.listKey??this.allocateConsoleListKey(),type:e.type,text:s,timestamp:e.timestamp??new Date().toISOString(),isStatus:e.isStatus??!1,expandableContent:e.expandableContent,rawData:e.rawData,subtype:e.subtype,parentAgentId:e.parentAgentId,imageDataUrls:e.imageDataUrls},t=this.consoleMessages_$();this.consoleMessages_$.set([...t,n])}loadAssembledMessages(e){return d(this,null,function*(){try{let s=yield this.extSessionMsg_AS.getMessages({sessionId:e.sessionId,latest:!0}),n=this.activeSessionId_$();if(n&&n!==e.sessionId){f.DyFM_Log.info(`CCAP_CcSession_DS | loadAssembledMessages stale \u2014 discarded | requestedSessionId: ${e.sessionId} | currentActiveSessionId: ${n} | restMessageCount: ${s.messages.length}`);return}let t=this.assembledMessages_$(),o=new Set(s.messages.map(r=>r.messageKey).filter(r=>typeof r=="string"&&r.length>0)),i=t.filter(r=>!o.has(r.messageKey));this.assembledMessages_$.set(_.sortAsc([...s.messages,...i])),this.assembledMessagesHasMore_$.set(s.hasMore)}catch(s){f.DyFM_Log.error(`CCAP_CcSession_DS | loadAssembledMessages failed | sessionId: ${e.sessionId}`,s)}finally{this.assembledMessagesLoaded_$.set(!0)}})}loadOlderAssembledMessages(e){return d(this,null,function*(){if(this.isLoadingOlderMessages_$()||!this.assembledMessagesHasMore_$())return;let s=this.assembledMessages_$();if(!s.length)return;let n=s.reduce((t,o)=>(o.sequence??0)<t?o.sequence??0:t,s[0].sequence??0);this.isLoadingOlderMessages_$.set(!0);try{let t=yield this.extSessionMsg_AS.getMessages({sessionId:e.sessionId,beforeSequence:n,limit:e.limit??50});t.messages.length&&this.assembledMessages_$.set(_.sortAsc([...t.messages,...s])),this.assembledMessagesHasMore_$.set(t.hasMore)}catch(t){f.DyFM_Log.error(`CCAP_CcSession_DS | loadOlderAssembledMessages failed | sessionId: ${e.sessionId}`,t)}finally{this.isLoadingOlderMessages_$.set(!1)}})}pushSystemAssembledMessage(e){let s=this.assembledMessages_$(),n=s.length?s.reduce((o,i)=>(i.sequence??0)>o?i.sequence??0:o,0):0,t={messageKey:`sys-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,sessionId:e.sessionId,sessionType:"cc",messageRole:e.role,bodyText:e.text,timestamp:new Date().toISOString(),sequence:n+1};this.assembledMessages_$.set(_.sortAsc([...s,t])),this.pushConsoleMessage({type:e.role==="error"?"error":e.role==="status"?"status":"info",text:e.text,isStatus:e.role==="status"})}allocateConsoleListKey(){return globalThis.crypto.randomUUID()}pullEventsSinceLastKnownSequence(e){return d(this,null,function*(){let s=this.activeSessionId_$();if(!(!s||this.lastKnownEventSequence<0))try{let t=(yield this.ccSession_AS.getSessionEvents({sessionId:s,sinceSequence:this.lastKnownEventSequence})).events;if(!t.length)return;this.ngZone.run(()=>{let o=this.activeSessionId_$();if(o!==s){f.DyFM_Log.info(`CCAP_CcSession_DS | pull(${e}) stale \u2014 discarded | requestedSessionId: ${s} | currentActiveSessionId: ${o} | newEventCount: ${t.length}`);return}let i=this.selectedSessionEvents_$();this.selectedSessionEvents_$.set([...i,...t]);for(let r of t)this.socketEventHandler_CS.pushConsoleMessageFromEvent(r,!0,(a,l)=>{this.globalError_CS.showError(a,l)});this.updateLastKnownSequence(t)})}catch(n){let t=e==="poll"?"session events poll failed":"backfill failed";f.DyFM_Log.warn(`CCAP_CcSession_DS | ${t}`,n)}})}backfillMissedEvents(){return d(this,null,function*(){yield this.pullEventsSinceLastKnownSequence("backfill")})}updateLastKnownSequence(e){for(let s of e)s.sequence>this.lastKnownEventSequence&&(this.lastKnownEventSequence=s.sequence)}resolveActiveSessionStatusForEventsPolling(){let e=this.activeSessionId_$();if(!e)return null;let s=this.selectedSession_$();if(s?.session.sessionId===e)return s.session.status;let n=this.lastStatusUpdate_$();return n?.sessionId===e?n.status:this.sessions_$().find(o=>o.sessionId===e)?.status??null}ensureSessionEventsPollingStarted(){this.sessionEventsPollHandle===null&&(this.sessionEventsPollHandle=setInterval(()=>{this.onSessionEventsPollTick()},u.SESSION_EVENTS_POLL_INTERVAL_MS))}stopSessionEventsPolling(){this.sessionEventsPollHandle!==null&&(clearInterval(this.sessionEventsPollHandle),this.sessionEventsPollHandle=null),this.isSessionEventsPollInFlight=!1}onSessionEventsPollTick(){return d(this,null,function*(){if(!this.isSessionEventsPollInFlight){this.isSessionEventsPollInFlight=!0;try{yield this.pullEventsSinceLastKnownSequence("poll");let e=this.activeSessionId_$();e&&(yield this.loadAssembledMessages({sessionId:e}))}finally{this.isSessionEventsPollInFlight=!1}}})}static \u0275fac=function(s){return new(s||u)};static \u0275prov=A({token:u,factory:u.\u0275fac,providedIn:"root"})}return u})();export{ne as a};
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
3
|
+
//# sourceMappingURL=chunk-BQAILW64.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as c}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as c}from"./chunk-PQEIFO6Y.js";import{K as p,L as S}from"./chunk-6TE4LLRT.js";import{C as i,k as e,wb as a,y as u}from"./chunk-TBMJSIBB.js";var h=(()=>{class n{setup_AS=i(c);settings_AS=i(S);static getErrorMessageForConfig(t){if(t instanceof a){let s=t.error,o=null;if(s!==null&&typeof s=="object"){let r=s;typeof r.error=="string"?o=r.error:r.error!=null?o=String(r.error):typeof r.message=="string"&&(o=r.message)}else typeof s=="string"&&(o=s);return p.getHttpErrorMessage(t,o)}return t instanceof Error?t.message||"Bet\xF6lt\xE9s sikertelen.":String(t)||"Bet\xF6lt\xE9s sikertelen."}getSetupStatus(){return e(this,null,function*(){return this.setup_AS.getSetupStatus()})}getVaultStatus(){return e(this,null,function*(){return this.setup_AS.getVaultStatus()})}getVaultKeyGenerate(){return e(this,null,function*(){return this.setup_AS.getVaultKeyGenerate()})}postVaultKey(t){return e(this,null,function*(){return this.setup_AS.postVaultKey(t)})}postProviderAccessAllow(t){return e(this,null,function*(){return this.settings_AS.postProviderAccessAllow(t)})}getSoulStatus(){return e(this,null,function*(){return this.settings_AS.getSoulStatus()})}getSoulContent(){return e(this,null,function*(){return this.settings_AS.getSoulContent()})}postGenerateSoul(t){return e(this,null,function*(){return this.settings_AS.postGenerateSoul(t)})}postSetup(t){return e(this,null,function*(){return this.setup_AS.postSetup(t)})}postTestLlmProvider(t){return e(this,null,function*(){return this.settings_AS.postTestLlmProvider(t)})}postListLlmModels(t){return e(this,null,function*(){return this.settings_AS.postListLlmModels(t)})}postTestMessagingProvider(t){return e(this,null,function*(){return this.settings_AS.postTestMessagingProvider(t)})}postMcpSync(t){return e(this,null,function*(){return this.settings_AS.postMcpSync(t)})}getSection(t){return e(this,null,function*(){return this.settings_AS.getSection(t)})}putSetupConfig(t){return e(this,null,function*(){return this.setup_AS.putSetupConfig(t)})}static \u0275fac=function(s){return new(s||n)};static \u0275prov=u({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();export{h as a};
|
|
2
|
+
//# sourceMappingURL=chunk-C6J25IMQ.js.map
|