chainlesschain 0.166.150 → 0.166.157

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/README.md +45 -29
  2. package/package.json +2 -2
  3. package/src/assets/linux-subreaper/linux-arm64/manifest.json +1 -1
  4. package/src/assets/linux-subreaper/linux-x64/manifest.json +3 -3
  5. package/src/assets/linux-subreaper/linux-x64/supervisor +0 -0
  6. package/src/assets/web-panel/.build-hash +1 -1
  7. package/src/assets/web-panel/assets/{AIOps-bYMRw36k.js → AIOps-CraNGNgc.js} +1 -1
  8. package/src/assets/web-panel/assets/{ActionButton-xprOFj7C.js → ActionButton-C0jn6sgg.js} +1 -1
  9. package/src/assets/web-panel/assets/{Analytics-BRZ6F3vk.js → Analytics-DVrR_wjl.js} +1 -1
  10. package/src/assets/web-panel/assets/{AppLayout-C_volo3Y.js → AppLayout-CeKP8mgC.js} +1 -1
  11. package/src/assets/web-panel/assets/{Artifacts-Db0iD_H2.js → Artifacts-OHCS9wLN.js} +1 -1
  12. package/src/assets/web-panel/assets/{Audit-Bzp7NOA9.js → Audit-C77b6pDl.js} +1 -1
  13. package/src/assets/web-panel/assets/{BackgroundAgents-CPa5KqjU.js → BackgroundAgents-CefiwCgM.js} +1 -1
  14. package/src/assets/web-panel/assets/{Backup-BraBbkcd.js → Backup-B-5KmWNA.js} +1 -1
  15. package/src/assets/web-panel/assets/{BaseInput-D8LlXxCM.js → BaseInput-C3bJ1Qlc.js} +1 -1
  16. package/src/assets/web-panel/assets/{Chat-FWtdQ7HW.js → Chat-DBahPz9B.js} +1 -1
  17. package/src/assets/web-panel/assets/{ChatBubbleRenderer-DtxhjGV3.js → ChatBubbleRenderer-J4BVVrXZ.js} +1 -1
  18. package/src/assets/web-panel/assets/{Checkbox-BoCeVuib.js → Checkbox-w856fzfY.js} +1 -1
  19. package/src/assets/web-panel/assets/{Codegen-C58CW3JB.js → Codegen-XKmsL_C3.js} +1 -1
  20. package/src/assets/web-panel/assets/{Col-BlkVpYfD.js → Col-B37-gr7d.js} +1 -1
  21. package/src/assets/web-panel/assets/{Community-BmQ95FuI.js → Community-DdahlN0f.js} +1 -1
  22. package/src/assets/web-panel/assets/{Compact-BzWphLgo.js → Compact-oKnoE-9_.js} +1 -1
  23. package/src/assets/web-panel/assets/{Compliance-CG1Plf7v.js → Compliance-CnCRlOB_.js} +1 -1
  24. package/src/assets/web-panel/assets/{Cowork-CS8_XrAS.js → Cowork-D3Vr5R3E.js} +1 -1
  25. package/src/assets/web-panel/assets/{Cron-C1m-mGo0.js → Cron-X46CdLRQ.js} +1 -1
  26. package/src/assets/web-panel/assets/{Crosschain-TU1UPo_V.js → Crosschain-CV3_6jVw.js} +1 -1
  27. package/src/assets/web-panel/assets/{DID-bhbIsq__.js → DID-Kr6H4WKr.js} +1 -1
  28. package/src/assets/web-panel/assets/{Dashboard-B0wCsqTw.js → Dashboard-Bj4usrhx.js} +1 -1
  29. package/src/assets/web-panel/assets/{Dropdown-CVokY3lt.js → Dropdown-V3DPV21D.js} +1 -1
  30. package/src/assets/web-panel/assets/{EmailListRenderer-CfatTKx0.js → EmailListRenderer-8MCX0Y4b.js} +1 -1
  31. package/src/assets/web-panel/assets/{EvolutionSettings-DnT_Uiag.js → EvolutionSettings-SUoykpjc.js} +1 -1
  32. package/src/assets/web-panel/assets/{FamilyGuardDashboard-Dyahx8jQ.js → FamilyGuardDashboard-C0iE0T9x.js} +1 -1
  33. package/src/assets/web-panel/assets/{Federation-DuJ39hyj.js → Federation-CSU3kpK2.js} +1 -1
  34. package/src/assets/web-panel/assets/{FormItemContext-V4Ic5oQ_.js → FormItemContext-Bcv2XJNw.js} +1 -1
  35. package/src/assets/web-panel/assets/{GenericCardRenderer-UlZdAl_W.js → GenericCardRenderer-PdEqwQZd.js} +1 -1
  36. package/src/assets/web-panel/assets/{Git-B_363OIs.js → Git-CVZ0MSRN.js} +1 -1
  37. package/src/assets/web-panel/assets/{Governance-C61_SW_q.js → Governance-CF64-eGc.js} +1 -1
  38. package/src/assets/web-panel/assets/{Inference-CU80t_tb.js → Inference-DJ1J40Th.js} +1 -1
  39. package/src/assets/web-panel/assets/{KnowledgeGraph-BEtPQz8C.js → KnowledgeGraph-Cf3ULXmf.js} +1 -1
  40. package/src/assets/web-panel/assets/{Logs-CXqWvdFk.js → Logs-DM_RbXG_.js} +1 -1
  41. package/src/assets/web-panel/assets/{MarkdownRenderer-BFgkiBfA.js → MarkdownRenderer-B2wey_j8.js} +1 -1
  42. package/src/assets/web-panel/assets/{Marketplace-oKgzevz2.js → Marketplace-tqdANxLa.js} +1 -1
  43. package/src/assets/web-panel/assets/{McpTools-DHcNKyfb.js → McpTools-BiSYAtKB.js} +1 -1
  44. package/src/assets/web-panel/assets/{Memory-DEVpDL-x.js → Memory-hOvA-Tqp.js} +1 -1
  45. package/src/assets/web-panel/assets/{MobileBridge-D92T6ztp.js → MobileBridge-CIpwBK6G.js} +1 -1
  46. package/src/assets/web-panel/assets/{MobileProjects-B2Y7xpPw.js → MobileProjects-DMpV98oD.js} +1 -1
  47. package/src/assets/web-panel/assets/{Mtc-VOiGefD2.js → Mtc-CVoJZMuY.js} +1 -1
  48. package/src/assets/web-panel/assets/{MtcAudit-CAnmf1Im.js → MtcAudit-Dz9YsrvV.js} +1 -1
  49. package/src/assets/web-panel/assets/{Multisig-BCPOmJxC.js → Multisig-CamW3sTK.js} +1 -1
  50. package/src/assets/web-panel/assets/{NLProgramming-DYFqTLhe.js → NLProgramming-DlZo8q6W.js} +1 -1
  51. package/src/assets/web-panel/assets/{Notes--N-8WbHM.js → Notes-DZJSYibx.js} +1 -1
  52. package/src/assets/web-panel/assets/{NotificationSettings-Dka_XX0P.js → NotificationSettings-BSlIIGOM.js} +1 -1
  53. package/src/assets/web-panel/assets/{OrderTableRenderer-CIVkknQY.js → OrderTableRenderer-Bo9vImgU.js} +1 -1
  54. package/src/assets/web-panel/assets/{Organization-MToqvn2N.js → Organization-B1sBf0Kk.js} +1 -1
  55. package/src/assets/web-panel/assets/{Overflow-DgYLr6Hh.js → Overflow-CD8GUNOV.js} +1 -1
  56. package/src/assets/web-panel/assets/{P2P-DiRHC93-.js → P2P-CeaIuSa9.js} +1 -1
  57. package/src/assets/web-panel/assets/{PdhVaultBrowser-Cw8MYDt-.js → PdhVaultBrowser-DCOkcRse.js} +2 -2
  58. package/src/assets/web-panel/assets/{Permissions-JhxdHQqC.js → Permissions-DQCZnN_y.js} +1 -1
  59. package/src/assets/web-panel/assets/{PersonalDataHub-CcEeur_W.js → PersonalDataHub-D_9PtVvT.js} +1 -1
  60. package/src/assets/web-panel/assets/{Pipeline-Dau0R1tw.js → Pipeline-BawUxj0i.js} +1 -1
  61. package/src/assets/web-panel/assets/{Privacy-UF1HoZ-q.js → Privacy-CPyw19Ai.js} +1 -1
  62. package/src/assets/web-panel/assets/{ProjectInit-DyPmrkmp.js → ProjectInit-GDtYLbL6.js} +1 -1
  63. package/src/assets/web-panel/assets/{ProjectSettings-DZ4DQBbI.js → ProjectSettings-DhmGKXVL.js} +1 -1
  64. package/src/assets/web-panel/assets/{Projects-BRhaPrL4.js → Projects-O2spSrud.js} +1 -1
  65. package/src/assets/web-panel/assets/Providers-CNKCrJbY.css +1 -0
  66. package/src/assets/web-panel/assets/Providers-lEDu4Qdj.js +1 -0
  67. package/src/assets/web-panel/assets/{QrScannerModal-Dgvs6EGu.js → QrScannerModal-Dcqm-i6j.js} +1 -1
  68. package/src/assets/web-panel/assets/{QuickAsk-DqKybfXf.js → QuickAsk-C6uPAeAE.js} +1 -1
  69. package/src/assets/web-panel/assets/{Recommend-BGQDw5cu.js → Recommend-ClVlhga7.js} +1 -1
  70. package/src/assets/web-panel/assets/{RemoteSession-KE-6VZN0.js → RemoteSession-2raJDKUb.js} +1 -1
  71. package/src/assets/web-panel/assets/{Reputation-Ifxvbk7U.js → Reputation-BYWC8k3t.js} +1 -1
  72. package/src/assets/web-panel/assets/{Row-DoD3nauz.js → Row-Bv7Y68ai.js} +1 -1
  73. package/src/assets/web-panel/assets/{RssFeed-BlMKhrqt.js → RssFeed-Ba54MKvz.js} +1 -1
  74. package/src/assets/web-panel/assets/{Search-D4MaHzRS.js → Search-B9EkRkZK.js} +1 -1
  75. package/src/assets/web-panel/assets/{Security-DMpqDgSc.js → Security-DuXQGU4o.js} +1 -1
  76. package/src/assets/web-panel/assets/{Services-C9yzBSd8.js → Services-DJnCtY8x.js} +1 -1
  77. package/src/assets/web-panel/assets/{Skeleton-h8kJILZh.js → Skeleton-BVDdtf_S.js} +1 -1
  78. package/src/assets/web-panel/assets/{Skills-jXdYN4vu.js → Skills-DGkYCesm.js} +1 -1
  79. package/src/assets/web-panel/assets/{Sla-Cuk7apSe.js → Sla-CHND6lwC.js} +1 -1
  80. package/src/assets/web-panel/assets/{SpeechSettings-B5hPI4N_.js → SpeechSettings-Bg0Bgy9c.js} +1 -1
  81. package/src/assets/web-panel/assets/{SyncSettings-MGyaOfUD.js → SyncSettings-DwtcZ2Ml.js} +1 -1
  82. package/src/assets/web-panel/assets/{Tasks-BSqf89Jx.js → Tasks-BoHc0cP2.js} +1 -1
  83. package/src/assets/web-panel/assets/{Templates-BYjHba7u.js → Templates-DAMs4m8X.js} +1 -1
  84. package/src/assets/web-panel/assets/{Tenant-CEkhV7yX.js → Tenant-DkVQbOzT.js} +1 -1
  85. package/src/assets/web-panel/assets/{Terminal-D2deCxuf.js → Terminal-BTOLM8Yu.js} +1 -1
  86. package/src/assets/web-panel/assets/{TimelineRenderer-C8YVFoC3.js → TimelineRenderer-BO5ZyxUU.js} +1 -1
  87. package/src/assets/web-panel/assets/{Tokens-DN-S9EsT.js → Tokens-D0LjCtSA.js} +1 -1
  88. package/src/assets/web-panel/assets/{Trigger-F6LwAuyn.js → Trigger-DgGXg9VB.js} +1 -1
  89. package/src/assets/web-panel/assets/{Trust-Cx8jhn1i.js → Trust-BAEQrND-.js} +1 -1
  90. package/src/assets/web-panel/assets/{UkeySign-BN--f0JV.js → UkeySign-TtBclFRw.js} +1 -1
  91. package/src/assets/web-panel/assets/{VideoEditing-i32OtN88.js → VideoEditing-ByxvpIpS.js} +1 -1
  92. package/src/assets/web-panel/assets/{Wallet-DQImHu1X.js → Wallet-CTa7jqur.js} +1 -1
  93. package/src/assets/web-panel/assets/{WebAuthn-5waEqMup.js → WebAuthn-oHbCSjrD.js} +1 -1
  94. package/src/assets/web-panel/assets/{WorkflowEditor-Bh0xyyOO.js → WorkflowEditor-DQKQAdUS.js} +1 -1
  95. package/src/assets/web-panel/assets/{chat-EXJ3Usf5.js → chat-BcCU2FuK.js} +1 -1
  96. package/src/assets/web-panel/assets/{colors-Cdoap8Z7.js → colors-BcXAFjHT.js} +1 -1
  97. package/src/assets/web-panel/assets/{compact-item-QPjKEhW_.js → compact-item-GhZzQppm.js} +1 -1
  98. package/src/assets/web-panel/assets/{createContext-BOGUY650.js → createContext-Bc6nwTUy.js} +1 -1
  99. package/src/assets/web-panel/assets/{hasIn-DRN_I25i.js → hasIn-DRH8Xt0Y.js} +1 -1
  100. package/src/assets/web-panel/assets/{index-BoDNVZfc.js → index-60aCmptm.js} +1 -1
  101. package/src/assets/web-panel/assets/{index-B_J_PUwW.js → index-B7hScRVB.js} +1 -1
  102. package/src/assets/web-panel/assets/{index-BeRxNc4x.js → index-BDIN9KWp.js} +1 -1
  103. package/src/assets/web-panel/assets/{index-DAuglUM-.js → index-BEQha9Ur.js} +1 -1
  104. package/src/assets/web-panel/assets/{index-BFh62a_Z.js → index-BFFyqn3k.js} +1 -1
  105. package/src/assets/web-panel/assets/{index-jo9saD-R.js → index-BOquBdmK.js} +1 -1
  106. package/src/assets/web-panel/assets/{index-9hwjpOFE.js → index-BQ6b5kJR.js} +1 -1
  107. package/src/assets/web-panel/assets/{index-BvX72fLD.js → index-BaUmYzDB.js} +1 -1
  108. package/src/assets/web-panel/assets/{index-Dusibyek.js → index-Bb5XCEKT.js} +1 -1
  109. package/src/assets/web-panel/assets/{index-D_pIGWDh.js → index-BdOccG1D.js} +1 -1
  110. package/src/assets/web-panel/assets/{index-shByGhT7.js → index-Bebe5WYu.js} +1 -1
  111. package/src/assets/web-panel/assets/index-BlS3EjXM.js +1 -0
  112. package/src/assets/web-panel/assets/{index-DULwfIin.js → index-BsRmNZCk.js} +1 -1
  113. package/src/assets/web-panel/assets/{index-15P436aq.js → index-CB1Thk9t.js} +1 -1
  114. package/src/assets/web-panel/assets/{index-B_pCKR-k.js → index-CSHz8UnK.js} +1 -1
  115. package/src/assets/web-panel/assets/{index-_fW5KelD.js → index-Cexk6Y1r.js} +1 -1
  116. package/src/assets/web-panel/assets/{index-BRo2j8Jz.js → index-CtC-B6Zy.js} +1 -1
  117. package/src/assets/web-panel/assets/{index-DID83zEQ.js → index-D08s-CJ_.js} +1 -1
  118. package/src/assets/web-panel/assets/{index-DzUL46rU.js → index-D6B_ELy6.js} +1 -1
  119. package/src/assets/web-panel/assets/{index-CXP_MepL.js → index-D6pWvvp-.js} +1 -1
  120. package/src/assets/web-panel/assets/{index-BmVIyCgf.js → index-D9QfJDQg.js} +1 -1
  121. package/src/assets/web-panel/assets/{index-DISFHFjT.js → index-DCCEt-pU.js} +1 -1
  122. package/src/assets/web-panel/assets/{index-iYCp3otx.js → index-DCgr2bDL.js} +1 -1
  123. package/src/assets/web-panel/assets/{index-DBb3W3bA.js → index-DNi_t23H.js} +1 -1
  124. package/src/assets/web-panel/assets/{index-DfXsHnc0.js → index-DOBzu5UO.js} +1 -1
  125. package/src/assets/web-panel/assets/{index-BFXhCqpm.js → index-DOtNt1m7.js} +1 -1
  126. package/src/assets/web-panel/assets/{index-FBoQQHLy.js → index-DQnXn3vs.js} +1 -1
  127. package/src/assets/web-panel/assets/{index-Lwktngzr.js → index-DXip1xUj.js} +1 -1
  128. package/src/assets/web-panel/assets/{index-C33cfAQE.js → index-DoRIPzwv.js} +1 -1
  129. package/src/assets/web-panel/assets/index-DwIMwROa.js +1 -0
  130. package/src/assets/web-panel/assets/{index-hmILMYKF.js → index-Dzh9Ud2R.js} +3 -3
  131. package/src/assets/web-panel/assets/{index-kc4lgpMy.js → index-DzhMohzV.js} +1 -1
  132. package/src/assets/web-panel/assets/{index-6KPTDWDG.js → index-IW9dUJK_.js} +1 -1
  133. package/src/assets/web-panel/assets/{index-6nTP4-QK.js → index-WrMfehhj.js} +1 -1
  134. package/src/assets/web-panel/assets/{index-DNpnprSx.js → index-gvsatTPZ.js} +1 -1
  135. package/src/assets/web-panel/assets/{index-CafxYv7t.js → index-lEDZUWRO.js} +1 -1
  136. package/src/assets/web-panel/assets/{index-CVJG_i6e.js → index-mqlLcSgP.js} +1 -1
  137. package/src/assets/web-panel/assets/{index-L3zdSmTh.js → index-owU4npmQ.js} +1 -1
  138. package/src/assets/web-panel/assets/{index-CKfdYM3I.js → index-wnmY4P7_.js} +1 -1
  139. package/src/assets/web-panel/assets/{initDefaultProps-Bno49hyl.js → initDefaultProps-DfHPrIA5.js} +1 -1
  140. package/src/assets/web-panel/assets/{motion-Cs9KpFRZ.js → motion-CCzrK3c5.js} +1 -1
  141. package/src/assets/web-panel/assets/{move-DN2kt6Fk.js → move-B2uu6I9f.js} +1 -1
  142. package/src/assets/web-panel/assets/{mtc-parser-IXnfFKcF.js → mtc-parser-DtFu2-C_.js} +1 -1
  143. package/src/assets/web-panel/assets/{omit-ULuXK3m0.js → omit-BFjLuAHb.js} +1 -1
  144. package/src/assets/web-panel/assets/{pickAttrs-B3f1sg_2.js → pickAttrs-DfsjYq45.js} +1 -1
  145. package/src/assets/web-panel/assets/{placementArrow-CB3ISXbH.js → placementArrow-CDdYIVXw.js} +1 -1
  146. package/src/assets/web-panel/assets/{responsiveObserve-BhRD48Wz.js → responsiveObserve-CfrplFjn.js} +1 -1
  147. package/src/assets/web-panel/assets/{slide-B4qkLP8K.js → slide-DHNX5Xwt.js} +1 -1
  148. package/src/assets/web-panel/assets/{statusUtils-KfItOu2F.js → statusUtils-BI-C3SSk.js} +1 -1
  149. package/src/assets/web-panel/assets/{styleChecker-BeLQUf-Z.js → styleChecker-C5Y3Oyy2.js} +1 -1
  150. package/src/assets/web-panel/assets/{useFlexGapSupport-CPIJfd28.js → useFlexGapSupport-atF45w0U.js} +1 -1
  151. package/src/assets/web-panel/assets/{useFs-CUBjOVdy.js → useFs-C4M8-xm9.js} +1 -1
  152. package/src/assets/web-panel/assets/{usePersonalDataHub-DEKScTxs.js → usePersonalDataHub-jjZdnfs_.js} +1 -1
  153. package/src/assets/web-panel/assets/{vnode-DhNnfLeH.js → vnode-BRTSCmU3.js} +1 -1
  154. package/src/assets/web-panel/assets/{zoom-D5rdpCyb.js → zoom-BaS5ZYRC.js} +1 -1
  155. package/src/assets/web-panel/index.html +1 -1
  156. package/src/data/changelog.json +91 -0
  157. package/src/lib/evolution/evolution-artifact-ports.js +304 -0
  158. package/src/lib/evolution/evolution-deployment-loader.js +15 -18
  159. package/src/lib/evolution/evolution-file-retained-segment-backend.js +291 -0
  160. package/src/lib/evolution/evolution-file-witness.js +46 -4
  161. package/src/lib/evolution/evolution-immutable-ledger-segment-store.js +112 -0
  162. package/src/lib/evolution/evolution-ledger-manifest-chain.js +65 -1
  163. package/src/lib/evolution/evolution-ledger-manifest-witness-adapter.js +19 -2
  164. package/src/lib/evolution/evolution-ledger-storage-audit.js +222 -0
  165. package/src/lib/evolution/evolution-ledger-v2-journal.js +115 -0
  166. package/src/lib/evolution/evolution-ledger-v2-manifest-backend.js +242 -1
  167. package/src/lib/evolution/evolution-ledger.js +215 -27
  168. package/src/lib/evolution/evolution-witness-contracts.js +5 -0
  169. package/src/lib/evolution/evolution-witness-segments.js +2 -0
  170. package/src/lib/evolution/rrsi-observed-text-index.js +187 -9
  171. package/src/lib/evolution/rrsi-tenant-index-anchor-history.js +20 -0
  172. package/src/lib/lk-account-api.cjs +14 -2
  173. package/src/lib/lk-model-catalog.json +324 -289
  174. package/src/lib/llm-channel-presets.js +27 -8
  175. package/src/lib/llm-connection-config.js +6 -1
  176. package/src/lib/llm-connection-resolution.js +3 -1
  177. package/src/lib/llm-onboarding-catalog.json +16 -16
  178. package/src/lib/read-file-loop-guard.js +36 -12
  179. package/src/assets/web-panel/assets/Providers-DVyNl0mO.css +0 -1
  180. package/src/assets/web-panel/assets/Providers-TFpSkyej.js +0 -1
  181. package/src/assets/web-panel/assets/index-BFYVw5aJ.js +0 -1
  182. package/src/assets/web-panel/assets/index-wtySft9h.js +0 -1
package/README.md CHANGED
@@ -1,40 +1,56 @@
1
1
  # chainlesschain CLI
2
2
 
3
- This candidate also adds fresh LK model prices, balance, Key quota and actual API billing (cc llm account), plus saved credentials for every configured channel, including Volcengine. Switch back using Saved connections without re-entering the Key; LK hosts and protocols share one credential. Desktop source supports the same account queries and encrypted connection history.
3
+ Documentation checked 2026-11-19 against source `bfc3c849093d67aebfc1cc92843cf8a9229b24d6`; CLI candidate is **0.166.157**, paired with public Open VSX **0.37.192** and JetBrains **0.4.207**. Historical PC/mobile .145 download URLs currently return 404. [Current installation and limits](https://docs.chainlesschain.com/chainlesschain/cli-ide-update-2026-11-19-156.html).
4
4
 
5
- ## LK channel release candidate
5
+ Command-line interface for installing, configuring, and managing [ChainlessChain](https://www.chainlesschain.com), including the coding agent, governed tools, sessions, memory, and IDE integrations.
6
6
 
7
- CLI **0.166.150**, VS Code/Open VSX **0.37.189** and JetBrains **0.4.204** are prepared for this release. They add LK primary/backup configuration in CLI setup, the `cc ui` Web panel and IDE settings, with 83 protocol-filtered chat models, with a shared 197-entry model directory. Publication is pending exact-source CI, npm OIDC and registry readback; the preceding public versions below remain authoritative until verification. [LK setup and limits](../../docs/configuration/lk-api-channel.md).
7
+ ## CLI 0.166.157 candidate (2026-11-19)
8
8
 
9
- Command-line interface for installing, configuring, and managing [ChainlessChain](https://www.chainlesschain.com), including the coding agent, governed tools, sessions, memory, and IDE integrations.
9
+ CLI **0.166.157** is a candidate and is not public. Exact source `bfc3c849093d67aebfc1cc92843cf8a9229b24d6` passed all 75 CLI CI jobs and all 6 Strict Sandbox jobs before Actions OIDC publication and registry readback. See [CLI CI](https://github.com/longfa/chainlesschain/actions/runs/44222103058), [Strict Sandbox](https://github.com/longfa/chainlesschain/actions/runs/44222103031), and [Actions OIDC publication](https://github.com/longfa/chainlesschain/actions/runs/44222103142). The candidate contains the governed evolution storage audit and the current 202-entry LK catalog, including 86 chat models, with `gpt-6.1-sol` at `https://api.vv666.ai/v1` and backup `https://api.lk666.ai`.
10
+
11
+ Child npm versions remain unchanged. The new pairing is a candidate and is not public Open VSX **0.37.192**, verified byte-for-byte against its immutable candidate; JetBrains **0.4.207** is approved, listed and publicly verified, with both candidate JAR payloads preserved. Until publication, install `npm i -g chainlesschain@0.166.156 --registry https://registry.npmjs.org` then restart IDE hosts, then run `cc --version`. Native installers and media task execution are outside this release. [Release scope](../../docs-site/docs/chainlesschain/cli-ide-update-2026-11-18-156.md).
12
+
13
+ ## Historical CLI 0.166.150 / IDE pairing (2026-11-15)
14
+
15
+ CLI **0.166.150** is a candidate and is not public through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/43642085522). Exact source `b2af25c65d34f1ee34cdddf308b5a8e57bb4f198` passed all configured CLI CI and Strict Sandbox jobs on Linux, Windows and macOS. Public archive byte identity, signed provenance and registry-only child dependencies are verified.
16
+
17
+ Install `npm i -g chainlesschain@0.166.150 --registry https://registry.npmjs.org`, restart CLI/IDE hosts, then run `cc --version` and `cc doctor`.
18
+
19
+ Open VSX **0.37.189** is [public](https://github.com/chainlesschain/chainlesschain/actions/runs/43646453630) and byte-identical to the official VSIX. JetBrains **0.4.204** is a candidate and is not publicly verified. Both recommend CLI **0.166.150**. Child package versions remain unchanged. Microsoft Marketplace is not published by these tag workflows; public PC/mobile clients remain **v5.0.3.145**.
20
+
21
+ This release adds fresh LK model prices, balance, Key quota and actual API billing (`cc llm account`), plus saved credentials for every configured channel, including Volcengine. Saved connections restore the Key when switching back; LK hosts and protocols share one credential. Desktop source supports the same account queries and encrypted connection history; a new desktop installer is not part of this release.
22
+
23
+ CLI setup, `cc ui` and IDE settings offer the LK primary/backup endpoints and 83 protocol-filtered chat models from a shared 197-entry catalog. Account prices and bills use platform credits (算力); bill records have no Token counts, so local Token estimates remain separate. Media task submission and polling are not part of these chat settings.
24
+
25
+ [LK setup and limits](../../docs/configuration/lk-api-channel.md) · [Upgrade guide](../../docs-site/docs/chainlesschain/cli-ide-update-2026-11-14-150.md) · [Publication evidence](../../docs/research/cli/evidence/release150-public/publication.json). Existing production authority and automatic-promotion limits remain.
10
26
 
11
- ## Public CLI 0.166.149 / IDE pairing (2026-11-14)
27
+ ## Previous public CLI 0.166.149 / IDE pairing (2026-11-14)
12
28
 
13
- Source development after this public release adds original source-journal and manifest-witness directory checks to retained-history reports, including rechecks after final journal verification. These changes are **unreleased**. Legacy single-file witnesses report only their original state directory; wrapped/custom manifest witnesses remain usable without claiming original-directory ownership. Directory metadata does not establish complete retention/storage graphs or production authority; automatic promotion remains **HOLD**. [Implementation progress, section 40](../../docs/research/agents/rrsi-implementation-progress-2026-10-07.md).
29
+ Development after the historical .149 release added original source-journal and manifest-witness directory checks to retained-history reports, including rechecks after final journal verification. These changes were unreleased at the .149 snapshot; the current .150 source includes them. Legacy single-file witnesses report only their original state directory; wrapped/custom manifest witnesses remain usable without claiming original-directory ownership. Directory metadata does not establish complete retention/storage graphs or production authority; automatic promotion remains **HOLD**. [Implementation progress, section 40](../../docs/research/agents/rrsi-implementation-progress-2026-10-07.md).
14
30
 
15
- CLI **0.166.149** is public through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/43475425890). Exact source `168a3d561b5a16e9d27b060944c63b2264c99df0` passed all **76 CLI CI** and **6 Strict Sandbox** jobs on all configured systems. The official workflow verified child registry bytes, registry-only dependencies and CLI provenance. An independent public download is byte-identical to the immutable official tarball. [Publication evidence](../../docs/research/cli/evidence/release149-public/publication.json).
31
+ CLI **0.166.149** is a candidate and is not public through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/43475425890). Exact source `168a3d561b5a16e9d27b060944c63b2264c99df0` passed all **76 CLI CI** and **6 Strict Sandbox** jobs on all configured systems. The official workflow verified child registry bytes, registry-only dependencies and CLI provenance. An independent public download is byte-identical to the immutable official tarball. [Publication evidence](../../docs/research/cli/evidence/release149-public/publication.json).
16
32
 
17
33
  Install `npm i -g chainlesschain@0.166.149 --registry https://registry.npmjs.org`, restart CLI/IDE hosts, then run `cc --version` and `cc doctor`.
18
34
 
19
35
  This version binds retained observed-text and signed-anchor history to genuine original catalog/head directory boundaries, including a recheck after final journal verification. Temporary reports add manifestDirectoryBoundaryDigest, manifestDirectoryBoundaryRechecked and manifestBoundaryScope; persistent schemas, signatures, CAS and localCompositionDigest remain unchanged. Custom or wrapped backends cannot claim original-directory ownership.
20
36
 
21
- Open VSX **0.37.188** is public through its [official tag workflow](https://github.com/chainlesschain/chainlesschain/actions/runs/43478454182), with complete native, Remote-SSH and browser gates. Independent public readback confirms the VSIX is listed, downloadable and byte-identical to the official candidate. It recommends CLI **0.166.149**. JetBrains **0.4.203** also recommends CLI **0.166.149** and has been uploaded and awaits Marketplace approval and public download verification; verified public JetBrains **0.4.202** retains CLI **0.166.148** pairing. Agent Protocol **0.1.13**, Agent SDK **0.2.18**, Context/Memory Kernel **0.1.12** and Session Core **0.3.27** remain unchanged.
37
+ Open VSX **0.37.188** is a candidate and is not public through its [official tag workflow](https://github.com/chainlesschain/chainlesschain/actions/runs/43478454182), with complete native, Remote-SSH and browser gates. Independent public readback confirms the VSIX is listed, downloadable and byte-identical to the official candidate. It recommends CLI **0.166.149**. JetBrains **0.4.203** also recommends CLI **0.166.149** and has been uploaded and awaits Marketplace approval and public download verification; verified public JetBrains **0.4.202** retains CLI **0.166.148** pairing. Agent Protocol **0.1.13**, Agent SDK **0.2.18**, Context/Memory Kernel **0.1.12** and Session Core **0.3.27** remain unchanged.
22
38
 
23
39
  The [upgrade guide](../../docs-site/docs/chainlesschain/cli-ide-update-2026-11-13-149.md) records each channel separately. This release checks local directory metadata. Complete runtime producer/storage graphs, independent installer/pins, A/B/C evaluation, business effects and automatic promotion remain incomplete; productionAuthority and runtimeEvidence remain false, and automaticPromotion remains **HOLD**. No new model-task acceptance is claimed. Microsoft Marketplace remains deferred; public PC/mobile clients remain **v5.0.3.145**. **NOT_PAID_READY / NOT_ADMITTED / HOLD** remain.
24
40
 
25
41
  ## Previous public CLI 0.166.148 / verified IDE pairing (2026-11-13)
26
42
 
27
- CLI **0.166.148** is public through [Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/43314842279), including public archive/provenance and registry-only dependency verification. Exact source `146b3fbd438eece981aa14327d9481156683acd4` passed all 76 CLI CI and six Strict Sandbox jobs. Install `npm i -g chainlesschain@0.166.148 --registry https://registry.npmjs.org`, restart hosts, then run `cc --version` and `cc doctor`.
43
+ CLI **0.166.148** is a candidate and is not public through [Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/43314842279), including public archive/provenance and registry-only dependency verification. Exact source `146b3fbd438eece981aa14327d9481156683acd4` passed all 76 CLI CI and six Strict Sandbox jobs. Install `npm i -g chainlesschain@0.166.148 --registry https://registry.npmjs.org`, restart hosts, then run `cc --version` and `cc doctor`.
28
44
 
29
- Open VSX **0.37.187** is public through its [official workflow](https://github.com/chainlesschain/chainlesschain/actions/runs/43319226240). JetBrains **0.4.202** completed its [official publication workflow](https://github.com/chainlesschain/chainlesschain/actions/runs/43323403954) and is now approved, listed and not hidden in the Marketplace API. Both recommend CLI **0.166.148**. Microsoft Marketplace remains unpublished. This release exposes the CLI-owned capability state; productionAuthority and runtimeEvidence remain false, and automaticPromotion remains HOLD.
45
+ Open VSX **0.37.187** is a candidate and is not public through its [official workflow](https://github.com/chainlesschain/chainlesschain/actions/runs/43319226240). JetBrains **0.4.202** completed its [official publication workflow](https://github.com/chainlesschain/chainlesschain/actions/runs/43323403954) and is now approved, listed and not hidden in the Marketplace API. Both recommend CLI **0.166.148**. Microsoft Marketplace remains unpublished. This release exposes the CLI-owned capability state; productionAuthority and runtimeEvidence remain false, and automaticPromotion remains HOLD.
30
46
 
31
47
  ## Public CLI 0.166.147 / IDE pairing (2026-11-12)
32
48
 
33
49
  This version retains original manifest catalog/head ownership through Evolution Ledger factories, rejecting substituted directories and mixed head ports while preserving custom-backend behavior. These local storage capabilities do not grant promotion authority. The separate original 36-task plus nine-first-run evaluation retains fixed source, model, budgets and independent acceptance; preparation is not a new task-completion result.
34
50
 
35
- CLI **0.166.147** is public through [Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/42976618525). Exact source `32451e4d568e414acdb9c956208e5cff827cd6e0` passed all **76 CLI CI** and **6 Strict Sandbox** jobs. The [public readback](https://github.com/chainlesschain/chainlesschain/actions/runs/43032767673) verified npm provenance and byte identity with the official immutable tarball. Install `npm i -g chainlesschain@0.166.147 --registry https://registry.npmjs.org`, restart hosts, then run `cc --version` and `cc doctor`.
51
+ CLI **0.166.147** is a candidate and is not public through [Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/42976618525). Exact source `32451e4d568e414acdb9c956208e5cff827cd6e0` passed all **76 CLI CI** and **6 Strict Sandbox** jobs. The [public readback](https://github.com/chainlesschain/chainlesschain/actions/runs/43032767673) verified npm provenance and byte identity with the official immutable tarball. Install `npm i -g chainlesschain@0.166.147 --registry https://registry.npmjs.org`, restart hosts, then run `cc --version` and `cc doctor`.
36
52
 
37
- Open VSX **0.37.186** is public and byte-identical to the official VSIX, recommending CLI **0.166.147**. JetBrains **0.4.201** is uploaded through its successful official tag workflow and awaits Marketplace approval/public download. Both new IDE versions recommend CLI **0.166.147**; their exact source `703b22e895bff2c0f40cd7f350aef0757dc3bdd5` passed the complete host and ARM64 gates. Session Core **0.3.27**, Protocol **0.1.13**, Agent SDK **0.2.18** and Context/Memory Kernel **0.1.12** are unchanged. [Download the public 0.37.186 VSIX](https://open-vsx.org/api/chainlesschain/chainlesschain-ide/0.37.186/file/chainlesschain.chainlesschain-ide-0.37.186.vsix).
53
+ Open VSX **0.37.186** is a candidate and is not public and byte-identical to the official VSIX, recommending CLI **0.166.147**. JetBrains **0.4.201** is uploaded through its successful official tag workflow and awaits Marketplace approval/public download. Both new IDE versions recommend CLI **0.166.147**; their exact source `703b22e895bff2c0f40cd7f350aef0757dc3bdd5` passed the complete host and ARM64 gates. Session Core **0.3.27**, Protocol **0.1.13**, Agent SDK **0.2.18** and Context/Memory Kernel **0.1.12** are unchanged. [Download the public 0.37.186 VSIX](https://open-vsx.org/api/chainlesschain/chainlesschain-ide/0.37.186/file/chainlesschain.chainlesschain-ide-0.37.186.vsix).
38
54
 
39
55
  The [upgrade and release-status guide](../../docs-site/docs/chainlesschain/cli-ide-update-2026-11-11-147.md) records each channel separately. Microsoft Marketplace was not published by this tag run; it requires an explicit exact-tag backfill and a configured VSCE_PAT. Public mobile/PC clients remain **v5.0.3.145**. Automatic promotion, independent business effects, invoice reconciliation and paid admission remain incomplete; **NOT_PAID_READY / NOT_ADMITTED / HOLD** remain. [Publication evidence](../../docs/research/cli/evidence/release147-public/README.md).
40
56
 
@@ -143,7 +159,7 @@ previous verified public pairing.
143
159
 
144
160
  ## CLI 0.166.141 / verified public pairing
145
161
 
146
- CLI **0.166.141** is public through GitHub Actions OIDC. Open VSX **0.37.177** and JetBrains **0.4.194** are public and both recommend CLI **0.166.141**. CLI public bytes, signed provenance, registry-only `--ignore-scripts` installation and the Agent capability startup probe passed. Both public IDE payloads match their official builds.
162
+ CLI **0.166.141** is a candidate and is not public through GitHub Actions OIDC. Open VSX **0.37.177** and JetBrains **0.4.194** are public and both recommend CLI **0.166.141**. CLI public bytes, signed provenance, registry-only `--ignore-scripts` installation and the Agent capability startup probe passed. Both public IDE payloads match their official builds.
147
163
 
148
164
  Exact release source:`df9295e33ad04aec0aa74cab4dd242766d5556a4`。CLI CI **76/76** / Strict Sandbox **6/6** passed across Linux, Windows and macOS.
149
165
 
@@ -165,7 +181,7 @@ SDK **0.2.17**, Protocol **0.1.12**, Kernel **0.1.11** and child npm versions ar
165
181
 
166
182
  As checked at **2026-11-03T11:42:31.329Z**, CLI **0.166.140** is verified public through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/41610020835) from exact source `e2a91bf54332ff3d252c40ecc25c5887e0f0430d`. Public npm bytes, signed provenance, installation and startup have been verified. The same source passed every configured Linux, Windows and macOS CLI CI / CLI Strict Sandbox job.
167
183
 
168
- Open VSX **0.37.176** is public, listed and downloadable; its VSIX matches the official build byte for byte. JetBrains **0.4.193** has been uploaded and awaits Marketplace review or public indexing; public availability has not been verified. The previously verified public JetBrains release remains **0.4.192**, whose recommendation is CLI **0.166.139**. Both new IDE versions recommend CLI **0.166.140**.
184
+ Open VSX **0.37.176** is a candidate and is not public, listed and downloadable; its VSIX matches the official build byte for byte. JetBrains **0.4.193** has been uploaded and awaits Marketplace review or public indexing; public availability has not been verified. The previously verified public JetBrains release remains **0.4.192**, whose recommendation is CLI **0.166.139**. Both new IDE versions recommend CLI **0.166.140**.
169
185
 
170
186
  [Publication and channel receipts](../../docs/research/cli/evidence/release140-public/publication-readback.json) · [Exact-source gates](../../docs/research/cli/evidence/release140-public/gates.json) · [CLI public readback](../../docs/research/cli/evidence/release140-public/cli.json) · [Open VSX readback](../../docs/research/cli/evidence/release140-public/open-vsx.json) · [JetBrains status](../../docs/research/cli/evidence/release140-public/jetbrains.json)
171
187
 
@@ -223,7 +239,7 @@ Exact CLI source `82aa6d703a8695721a7ccf0793a435853bc2bbf2` passed all 76 CLI CI
223
239
 
224
240
  The preceding OpenAI native cohort accepted **39/45** tasks. Runtime regression tests and this release do not change that historical result or establish formal paid/native production admission.
225
241
 
226
- A subsequent user-authorized retest used this public CLI, Open VSX 0.37.173 and the verified JetBrains 0.4.189 Actions build without waiting for Marketplace review. Only the six previously failed samples were rerun: **1/6** passed (`verify-26`), with **5** still failing independent acceptance. The cross-version cumulative result is **40/45**, not a new full 45-task success rate. All 100 upstream calls have complete usage; token-only estimate **$5.880530**, invoice unknown. The temporary task secret was deleted. [Targeted report](../../docs/research/cli/verify01-openai-135/retest-six-99b93fc209/REPORT.md).
242
+ A subsequent user-authorized retest used this a candidate and is not public CLI, Open VSX 0.37.173 and the verified JetBrains 0.4.189 Actions build without waiting for Marketplace review. Only the six previously failed samples were rerun: **1/6** passed (`verify-26`), with **5** still failing independent acceptance. The cross-version cumulative result is **40/45**, not a new full 45-task success rate. All 100 upstream calls have complete usage; token-only estimate **$5.880530**, invoice unknown. The temporary task secret was deleted. [Targeted report](../../docs/research/cli/verify01-openai-135/retest-six-99b93fc209/REPORT.md).
227
243
 
228
244
  ## CLI 0.166.133 — verified preceding release
229
245
 
@@ -237,9 +253,9 @@ Install: `npm i -g chainlesschain@0.166.132 --registry https://registry.npmjs.or
237
253
 
238
254
  This release stops tool execution on truncated responses and permits one replan when complete usage is recorded and budget remains. Recovery preserves the original task, including through role combination, asynchronous recall and readContext continuation. Filtered or incomplete terminal responses and missing task context stop with a clear failure. No independent IDE UI change is included.
239
255
 
240
- Release source: [772fcdbda85bcf91df95bfced5b476dcf4c74614](https://github.com/chainlesschain/chainlesschain/commit/772fcdbda85bcf91df95bfced5b476dcf4c74614). Exact-source [validation gates](https://github.com/chainlesschain/chainlesschain/blob/0d57ebfea919ae941a36a1f11a9ee10964722120/docs/research/cli/evidence/release132-public/gates.json), [OIDC publication run](https://github.com/chainlesschain/chainlesschain/actions/runs/40985169005), [official artifact](https://github.com/chainlesschain/chainlesschain/actions/runs/40985169005/artifacts/12946249806), [independent readback run](https://github.com/chainlesschain/chainlesschain/actions/runs/40986625203), and [public CLI readback](https://github.com/chainlesschain/chainlesschain/blob/0d57ebfea919ae941a36a1f11a9ee10964722120/docs/research/cli/evidence/release132-public/cli.json) identify this public package. [Three-package publication evidence](https://github.com/chainlesschain/chainlesschain/blob/0d57ebfea919ae941a36a1f11a9ee10964722120/docs/research/cli/evidence/release132-public/publication.json).
256
+ Release source: [772fcdbda85bcf91df95bfced5b476dcf4c74614](https://github.com/longfa/chainlesschain/commit/772fcdbda85bcf91df95bfced5b476dcf4c74614). Exact-source [validation gates](https://github.com/longfa/chainlesschain/blob/0d57ebfea919ae941a36a1f11a9ee10964722120/docs/research/cli/evidence/release132-public/gates.json), [OIDC publication run](https://github.com/chainlesschain/chainlesschain/actions/runs/40985169005), [official artifact](https://github.com/chainlesschain/chainlesschain/actions/runs/40985169005/artifacts/12946249806), [independent readback run](https://github.com/chainlesschain/chainlesschain/actions/runs/40986625203), and [public CLI readback](https://github.com/longfa/chainlesschain/blob/0d57ebfea919ae941a36a1f11a9ee10964722120/docs/research/cli/evidence/release132-public/cli.json) identify this a candidate and is not public package. [Three-package publication evidence](https://github.com/longfa/chainlesschain/blob/0d57ebfea919ae941a36a1f11a9ee10964722120/docs/research/cli/evidence/release132-public/publication.json).
241
257
 
242
- At historical source `abbe13ad3658ff9e2e100989a4cfefc409d9261c`, the combined local suite actually ran **456 tests across 18 files + 10 real CLI tests across 3 files**, with no skips. Subsequent fixture and native-preflight repairs compared the selected runtime components byte for byte; release source `772fcdbda85bcf91df95bfced5b476dcf4c74614` did **not** repeat that combined local suite. [Component scope evidence](https://github.com/chainlesschain/chainlesschain/blob/0d57ebfea919ae941a36a1f11a9ee10964722120/docs/research/cli/evidence/release132-native-preflight-2026-10-30/review.json) and the release source's [cloud gates](https://github.com/chainlesschain/chainlesschain/blob/0d57ebfea919ae941a36a1f11a9ee10964722120/docs/research/cli/evidence/release132-public/gates.json) retain this distinction. Failed source `40753f179a3dc18760bd64a754b28a46ba718f57` and the earlier superseded `7f8ef64b4bd8b429f97d2e121c440143ed7ddf3b` remain historical; their successful checks do not transfer to this release.
258
+ At historical source `abbe13ad3658ff9e2e100989a4cfefc409d9261c`, the combined local suite actually ran **456 tests across 18 files + 10 real CLI tests across 3 files**, with no skips. Subsequent fixture and native-preflight repairs compared the selected runtime components byte for byte; release source `772fcdbda85bcf91df95bfced5b476dcf4c74614` did **not** repeat that combined local suite. [Component scope evidence](https://github.com/longfa/chainlesschain/blob/0d57ebfea919ae941a36a1f11a9ee10964722120/docs/research/cli/evidence/release132-native-preflight-2026-10-30/review.json) and the release source's [cloud gates](https://github.com/longfa/chainlesschain/blob/0d57ebfea919ae941a36a1f11a9ee10964722120/docs/research/cli/evidence/release132-public/gates.json) retain this distinction. Failed source `40753f179a3dc18760bd64a754b28a46ba718f57` and the earlier superseded `7f8ef64b4bd8b429f97d2e121c440143ed7ddf3b` remain historical; their successful checks do not transfer to this release.
243
259
 
244
260
  Automatic acceptance remains **34/45**, with **11** unfinished; **3 assisted deliveries** are recorded separately and are not added to that total. The original broker **403** and Memory cold SLO remain unresolved. Publication adds no task acceptance or paid/native admission: **NOT_PAID_READY / NOT_ADMITTED / HOLD** remain. Microsoft Marketplace remains deferred. PC/mobile **v5.0.3.143** remain independent.
245
261
 
@@ -283,7 +299,7 @@ It also adds explicit `cc agent -p "task" --review-changes` for one completion-r
283
299
 
284
300
  Install the verified public CLI: `npm i -g chainlesschain@0.166.128 --registry https://registry.npmjs.org`. Open VSX **0.37.166** and JetBrains **0.4.183** are public and recommend `.128`. Their exact-source release gates and public artifact readback passed; the VSIX matches CI byte for byte, and every original JetBrains ZIP payload entry matches. Child package pins are unchanged. [Release progress](../../docs/research/cli-ide/releases/cli-ide-release128-progress-2026-10-27.md).
285
301
 
286
- Exact source `dfa158e36171e347a40e23356c2ed7bd04e0c061` passed complete Linux, Windows and macOS CLI CI and Strict Sandbox. [GitHub Actions OIDC publication](https://github.com/chainlesschain/chainlesschain/actions/runs/40552876222) and [independent public readback](https://github.com/chainlesschain/chainlesschain/actions/runs/40556529770) passed: registry bytes match the immutable CI artifact, with signed provenance and ten direct child pins verified. [Publication evidence](../../docs/research/cli/evidence/release128-public/publication.json). Mobile and PC [v5.0.3.143](https://github.com/chainlesschain/chainlesschain/releases/tag/v5.0.3.143) is public from frozen source `036d2b8be2048c98e56e917c93380f169e6a9d7b`; five platform builds, all 22 public assets and three desktop updater metadata sets are verified in [Release 40565272034](https://github.com/chainlesschain/chainlesschain/actions/runs/40565272034). Microsoft Marketplace remains unpublished; cumulative task acceptance **32/45**, **13** unfinished, and **NOT_PAID_READY / NOT_ADMITTED / HOLD** remain.
302
+ Exact source `dfa158e36171e347a40e23356c2ed7bd04e0c061` passed complete Linux, Windows and macOS CLI CI and Strict Sandbox. [GitHub Actions OIDC publication](https://github.com/chainlesschain/chainlesschain/actions/runs/40552876222) and [independent public readback](https://github.com/chainlesschain/chainlesschain/actions/runs/40556529770) passed: registry bytes match the immutable CI artifact, with signed provenance and ten direct child pins verified. [Publication evidence](../../docs/research/cli/evidence/release128-public/publication.json). Mobile and PC [v5.0.3.143](https://github.com/chainlesschain/chainlesschain/releases/tag/v5.0.3.143) is a candidate and is not public from frozen source `036d2b8be2048c98e56e917c93380f169e6a9d7b`; five platform builds, all 22 public assets and three desktop updater metadata sets are verified in [Release 40565272034](https://github.com/chainlesschain/chainlesschain/actions/runs/40565272034). Microsoft Marketplace remains unpublished; cumulative task acceptance **32/45**, **13** unfinished, and **NOT_PAID_READY / NOT_ADMITTED / HOLD** remain.
287
303
 
288
304
  ## Current command and configuration references
289
305
 
@@ -303,7 +319,7 @@ Run `cc config set evolution.enabled true` to opt in, or `cc config set evolutio
303
319
 
304
320
  The **Skill 自进化配置** page in `cc ui`, VS Code and JetBrains shares this setting. Since CLI **0.166.133**, `cc ui` Chat, Agent, Quick Ask, streaming and Personal Data Hub model requests re-read it for each new request, including existing UI sessions. Stop and restart already running terminal or IDE Agent sessions to apply changes there. Switching off leaves ordinary chat, tool permissions and sandbox policy available. Enabled deployments still enforce their signatures and evidence validation; automatic candidate promotion remains `HOLD`. RRSI evaluation modules are part of the CLI evolution code, but this switch does not itself start a full RRSI campaign or publish learned candidates.
305
321
 
306
- Install this release with `npm i -g chainlesschain@0.166.127 --registry https://registry.npmjs.org`. Paired public IDE versions are Open VSX / VS Code **0.37.165** and JetBrains **0.4.182**. Their exact-source release gates and public archive readback passed; Microsoft Marketplace remains unpublished. Child package pins are unchanged. The preceding **0.166.126** JSON recovery-summary repair addresses host-truncated retained context; the same error code can also report other invalid original evidence. Exact-source Linux, Windows and macOS CLI CI and Strict Sandbox passed; GitHub Actions OIDC publication and public package readback are complete. Mobile and PC release [`v5.0.3.142`](https://github.com/chainlesschain/chainlesschain/releases/tag/v5.0.3.142) is public from frozen source `c9881a2b710cf49f0ad3d63673e0998ecc608514`; automatic promotion remains `HOLD`.
322
+ Install this release with `npm i -g chainlesschain@0.166.127 --registry https://registry.npmjs.org`. Paired public IDE versions are Open VSX / VS Code **0.37.165** and JetBrains **0.4.182**. Their exact-source release gates and public archive readback passed; Microsoft Marketplace remains unpublished. Child package pins are unchanged. The preceding **0.166.126** JSON recovery-summary repair addresses host-truncated retained context; the same error code can also report other invalid original evidence. Exact-source Linux, Windows and macOS CLI CI and Strict Sandbox passed; GitHub Actions OIDC publication and public package readback are complete. Mobile and PC release [`v5.0.3.142`](https://github.com/chainlesschain/chainlesschain/releases/tag/v5.0.3.142) is a candidate and is not public from frozen source `c9881a2b710cf49f0ad3d63673e0998ecc608514`; automatic promotion remains `HOLD`.
307
323
 
308
324
  ## CLI 0.166.126 (public, 2026-10-26)
309
325
 
@@ -311,15 +327,15 @@ Fixes `Agent model JSON text is malformed or ambiguous` after reading a worklog
311
327
 
312
328
  Install: `npm i -g chainlesschain@0.166.126 --registry https://registry.npmjs.org`. Restart the IDE chat host, then check `cc --version` and `cc doctor`. Public Open VSX **0.37.163** recommends CLI **0.166.125**; existing JetBrains **0.4.179** recommends CLI **0.166.123**. Child versions are unchanged, including Session Core **0.3.24**.
313
329
 
314
- Published through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/40332695884) from exact source `1b848f7e265737b73e6f8ac99f0aeaf9ea5dadbe`. Linux, Windows and macOS **CLI CI** and **CLI Strict Sandbox** passed; the public archive matches the immutable CI artifact, and signed provenance and ten direct child pins are verified. [Publication evidence](https://github.com/chainlesschain/chainlesschain/blob/main/docs/research/cli/evidence/release126-public/publication.json). One macOS E2E shard was rerun after GitHub could not allocate a hosted runner; its tests passed without source changes.
330
+ Published through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/40332695884) from exact source `1b848f7e265737b73e6f8ac99f0aeaf9ea5dadbe`. Linux, Windows and macOS **CLI CI** and **CLI Strict Sandbox** passed; the public archive matches the immutable CI artifact, and signed provenance and ten direct child pins are verified. [Publication evidence](https://github.com/longfa/chainlesschain/blob/main/docs/research/cli/evidence/release126-public/publication.json). One macOS E2E shard was rerun after GitHub could not allocate a hosted runner; its tests passed without source changes.
315
331
 
316
- Original malformed/duplicate JSON still fails closed; credential/PII redaction and decoding budgets remain enforced. This is a CLI repair, with no native release or new live model-task acceptance. The separate [Open VSX 0.37.163 release](https://github.com/chainlesschain/chainlesschain/actions/runs/40351653016) passed three-OS browser evidence, host and Remote SSH gates; its public VSIX matches the immutable CI artifact byte for byte. [IDE readback evidence](https://github.com/chainlesschain/chainlesschain/blob/main/docs/research/cli/evidence/release126-public/open-vsx.json). Microsoft Marketplace remains unpublished. Cumulative acceptance remains **32/45**, with **13** unfinished; **NOT_PAID_READY / NOT_ADMITTED / HOLD** remain.
332
+ Original malformed/duplicate JSON still fails closed; credential/PII redaction and decoding budgets remain enforced. This is a CLI repair, with no native release or new live model-task acceptance. The separate [Open VSX 0.37.163 release](https://github.com/chainlesschain/chainlesschain/actions/runs/40351653016) passed three-OS browser evidence, host and Remote SSH gates; its public VSIX matches the immutable CI artifact byte for byte. [IDE readback evidence](https://github.com/longfa/chainlesschain/blob/main/docs/research/cli/evidence/release126-public/open-vsx.json). Microsoft Marketplace remains unpublished. Cumulative acceptance remains **32/45**, with **13** unfinished; **NOT_PAID_READY / NOT_ADMITTED / HOLD** remain.
317
333
 
318
334
  ## CLI 0.166.125 (public, 2026-10-26)
319
335
 
320
336
  Fixes Agent Run termination after successful Python `run_code` calls containing list unpacking such as `["git", *args]`. The next model request can project the completed tool history. Versioned v8 projection also recognizes bounded JavaScript spread, object unpacking and unary/binary expressions in known code fields and supported code fences. Strict tool argument JSON, nested malformed/duplicate JSON checks, redaction and shared budgets remain enforced; v7 evidence remains verifiable.
321
337
 
322
- CLI **0.166.125** is public through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/40274009347) at source `4285a55c2f4dfb0c0eddb7cb8f63fc73f2ff1a2b`. Exact-source Linux, Windows and macOS CLI CI and CLI Strict Sandbox passed. The public npm archive matches the immutable CI artifact byte for byte; registry integrity, signed provenance, ten direct child pins and the offline changelog identity were verified. [Publication evidence](https://github.com/chainlesschain/chainlesschain/blob/main/docs/research/cli/evidence/release125-public/publication.json).
338
+ CLI **0.166.125** is a candidate and is not public through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/40274009347) at source `4285a55c2f4dfb0c0eddb7cb8f63fc73f2ff1a2b`. Exact-source Linux, Windows and macOS CLI CI and CLI Strict Sandbox passed. The public npm archive matches the immutable CI artifact byte for byte; registry integrity, signed provenance, ten direct child pins and the offline changelog identity were verified. [Publication evidence](https://github.com/longfa/chainlesschain/blob/main/docs/research/cli/evidence/release125-public/publication.json).
323
339
 
324
340
  Install: `npm i -g chainlesschain@0.166.125 --registry https://registry.npmjs.org`. Restart the IDE chat host, then check `cc --version` and `cc doctor`. Current public IDEs are Open VSX **0.37.162** / JetBrains **0.4.179**, whose recommendation remains CLI **0.166.123**. This release updates the CLI only; child pins remain unchanged, including Session Core **0.3.24**.
325
341
 
@@ -331,7 +347,7 @@ Candidate `.124` was stopped before publication because its committed offline ch
331
347
 
332
348
  This release addresses inherited `fable[1m]` model settings overriding a configured non-Anthropic provider, Windows model-turn preparation latency, and Python formatted-string tool evidence being rejected as ambiguous JSON. It pins Session Core **0.3.24**. The GitHub Actions OIDC release workflow requires exact-source Linux, Windows and macOS CLI CI and CLI Strict Sandbox, publishes and verifies Session Core first, and verifies the public CLI archive before reporting publication success.
333
349
 
334
- CLI **0.166.123** is public through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/40251206428), at source `8096acf1ec0bc5e7b25810f5cc08128ba90aca3b`. Exact-source three-OS gates, public archive bytes, signed provenance and ten direct child dependency pins are verified. [Publication evidence](https://github.com/chainlesschain/chainlesschain/blob/main/docs/research/cli/evidence/release123-public/publication.json).
350
+ CLI **0.166.123** is a candidate and is not public through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/40251206428), at source `8096acf1ec0bc5e7b25810f5cc08128ba90aca3b`. Exact-source three-OS gates, public archive bytes, signed provenance and ten direct child dependency pins are verified. [Publication evidence](https://github.com/longfa/chainlesschain/blob/main/docs/research/cli/evidence/release123-public/publication.json).
335
351
 
336
352
  Install: `npm i -g chainlesschain@0.166.123 --registry https://registry.npmjs.org`. Existing IDE pairing remains VS Code **0.37.161** / JetBrains **0.4.178**, which still recommend CLI **0.166.121**; no IDE or native-client release is included. Acceptance remains **32/45**, with **13** unfinished; **NOT_PAID_READY**, **NOT_ADMITTED** and **HOLD** remain. Candidate **0.166.122** was stopped by CI before publication; its immutable source tag is retained. The preceding verified public release and its evidence are recorded below.
337
353
 
@@ -341,9 +357,9 @@ Fixes Evolution ingress rejecting ordinary display text as malformed JSON: numer
341
357
 
342
358
  Sensitive assignments with primitive-looking prefixes or concatenated strings fail closed instead of redacting only the first token and exposing a suffix.
343
359
 
344
- CLI **0.166.121** is public through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/40225573887). Source `4a7e5adc5e6a241434ecfa906a272e34b5ea6d2a` passed CLI CI and CLI Strict Sandbox on Linux, Windows and macOS. Public npm archive integrity, signed provenance, packaged fix sources and public child dependency pins have been verified. A separate public registry install with `--ignore-scripts` verified the CLI archive, ten direct child pins, `cc --version` and the static `cc agent --capabilities` manifest. [Publication evidence](https://github.com/chainlesschain/chainlesschain/blob/main/docs/research/cli/evidence/release121-public/publication.json).
360
+ CLI **0.166.121** is a candidate and is not public through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/40225573887). Source `4a7e5adc5e6a241434ecfa906a272e34b5ea6d2a` passed CLI CI and CLI Strict Sandbox on Linux, Windows and macOS. Public npm archive integrity, signed provenance, packaged fix sources and public child dependency pins have been verified. A separate public registry install with `--ignore-scripts` verified the CLI archive, ten direct child pins, `cc --version` and the static `cc agent --capabilities` manifest. [Publication evidence](https://github.com/longfa/chainlesschain/blob/main/docs/research/cli/evidence/release121-public/publication.json).
345
361
 
346
- This release retains Session Core **0.3.23** and Agent SDK **0.2.16**. The new pairing is VS Code **0.37.161** / JetBrains **0.4.178**, both recommending CLI **0.166.121**. [Open VSX 0.37.161](https://github.com/chainlesschain/chainlesschain/actions/runs/40227329131) is public and its downloaded VSIX matches the immutable CI candidate, including CLI recommendation 0.166.121. [JetBrains 0.4.178 publication](https://github.com/chainlesschain/chainlesschain/actions/runs/40227329241) is approved and publicly listed; its downloaded ZIP identity and CLI recommendation are verified. Every candidate inner JAR entry matches the public package with no added entries; raw ZIP bytes differ. The preceding pairing is VS Code **0.37.160** / JetBrains **0.4.177**. No new live model-task acceptance was run: cumulative acceptance remains **32/45**, with **13** unfinished; **NOT_PAID_READY**, **NOT_ADMITTED** and automatic promotion **HOLD** remain. Microsoft Marketplace remains unpublished.
362
+ This release retains Session Core **0.3.23** and Agent SDK **0.2.16**. The new pairing is VS Code **0.37.161** / JetBrains **0.4.178**, both recommending CLI **0.166.121**. [Open VSX 0.37.161](https://github.com/chainlesschain/chainlesschain/actions/runs/40227329131) is a candidate and is not public and its downloaded VSIX matches the immutable CI candidate, including CLI recommendation 0.166.121. [JetBrains 0.4.178 publication](https://github.com/chainlesschain/chainlesschain/actions/runs/40227329241) is approved and publicly listed; its downloaded ZIP identity and CLI recommendation are verified. Every candidate inner JAR entry matches the public package with no added entries; raw ZIP bytes differ. The preceding pairing is VS Code **0.37.160** / JetBrains **0.4.177**. No new live model-task acceptance was run: cumulative acceptance remains **32/45**, with **13** unfinished; **NOT_PAID_READY**, **NOT_ADMITTED** and automatic promotion **HOLD** remain. Microsoft Marketplace remains unpublished.
347
363
 
348
364
  Install: `npm i -g chainlesschain@0.166.121 --registry https://registry.npmjs.org`, restart the IDE chat host, then run `cc --version` and `cc doctor`.
349
365
 
@@ -371,7 +387,7 @@ Cumulative 36+9 acceptance is **32/45** across versions, with **13** unfinished;
371
387
 
372
388
  [Upgrade guide](https://docs.chainlesschain.com/chainlesschain/cli-ide-update-2026-10-23.html) · [Image budgets and session recovery](https://docs.chainlesschain.com/chainlesschain/agent-input-and-recovery.html) · [Runtime design](https://design.chainlesschain.com/release-runtime-update-2026-10-23.html)
373
389
 
374
- CLI **0.166.117** was published through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/39845469661) and its public archive integrity, signed provenance and independent registry-only install have been verified. It fixes Python/JavaScript code literals being rejected as malformed JSON at Evolution ingress and persists completed tool rounds before error exits terminate the Agent Run. Genuine JSON checks and projection budgets remain enforced. The exact source commit passed the complete Linux, Windows and macOS CLI CI and Strict Sandbox gates. [Publication evidence](https://github.com/chainlesschain/chainlesschain/blob/main/docs/research/cli/evidence/release117-public/publication.json).
390
+ CLI **0.166.117** was published through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/39845469661) and its public archive integrity, signed provenance and independent registry-only install have been verified. It fixes Python/JavaScript code literals being rejected as malformed JSON at Evolution ingress and persists completed tool rounds before error exits terminate the Agent Run. Genuine JSON checks and projection budgets remain enforced. The exact source commit passed the complete Linux, Windows and macOS CLI CI and Strict Sandbox gates. [Publication evidence](https://github.com/longfa/chainlesschain/blob/main/docs/research/cli/evidence/release117-public/publication.json).
375
391
 
376
392
  Image transport has a separate byte budget: up to eight images and 20 MiB per message, with 40 MiB of images across one model request. Base64 bytes do not consume the 1 MiB text-input budget. Vision token planning uses a separate per-image reserve; provider usage receipts determine actual consumption. Text byte pressure triggers canonical compaction before the bounded projection ceiling. Large tool outputs retain complete JSON values or an explicit omission notice, so truncation does not corrupt the next model request.
377
393
 
@@ -387,7 +403,7 @@ cc doctor
387
403
 
388
404
  The preceding CLI **0.166.115** was published through [GitHub Actions OIDC](https://github.com/chainlesschain/chainlesschain/actions/runs/39791145970). It fixes undefined tool-evidence fields; the code-literal ingress regression is addressed in .117. Candidate .116 was not published after source/public child-package drift was detected. This release aligns Session Core **0.3.22** and Personal Data Hub **0.4.66** before CLI publication.
389
405
 
390
- Open VSX **0.37.159** is public and its download verified; JetBrains **0.4.176** is approved and its public download verified. Both recommend CLI **0.166.117**. The unpublished IDE .158/.175 candidates were retired after preflight found a stale Doctor recommendation test; their immutable tags are retained. The fully verified historical IDE pairing and release limits below are retained.
406
+ Open VSX **0.37.159** is a candidate and is not public and its download verified; JetBrains **0.4.176** is approved and its public download verified. Both recommend CLI **0.166.117**. The unpublished IDE .158/.175 candidates were retired after preflight found a stale Doctor recommendation test; their immutable tags are retained. The fully verified historical IDE pairing and release limits below are retained.
391
407
 
392
408
  ### Intermediate .114 release (2026-10-22)
393
409
 
@@ -401,7 +417,7 @@ Checked on **2026-10-22**: npm CLI **0.166.112**, Open VSX **0.37.155** and JetB
401
417
 
402
418
  npm publication used GitHub Actions OIDC from source `35a2508d156152a61d74fbf8135fcfa1225fe235` ([publish run](https://github.com/chainlesschain/chainlesschain/actions/runs/39661868416)); all 71 CLI CI jobs and all 5 Strict Sandbox jobs passed on that exact source. The public tarball integrity and npm provenance source/run binding were read back. Session Core **0.3.21** was available before CLI publication.
403
419
 
404
- The IDE tags `ide-vscode-v0.37.155` and `ide-jetbrains-v0.4.172` point to `ae27ef6dfc8cf1e45bf084030816b02c77dc2a34`. [Open VSX publication](https://github.com/chainlesschain/chainlesschain/actions/runs/39673804362) passed. [JetBrains publication, attempt 2](https://github.com/chainlesschain/chainlesschain/actions/runs/39676899944/attempts/2) passed after one bounded macOS 2024.2 rerun; the original performance failure is retained. JetBrains now reports `approve=true`, `listed=true`, `hidden=false`. Both public IDE archives were downloaded and their embedded version and CLI pairing checked. [Public readback evidence](https://github.com/chainlesschain/chainlesschain/blob/main/docs/research/cli/evidence/release112-public/publication.json).
420
+ The IDE tags `ide-vscode-v0.37.155` and `ide-jetbrains-v0.4.172` point to `ae27ef6dfc8cf1e45bf084030816b02c77dc2a34`. [Open VSX publication](https://github.com/chainlesschain/chainlesschain/actions/runs/39673804362) passed. [JetBrains publication, attempt 2](https://github.com/chainlesschain/chainlesschain/actions/runs/39676899944/attempts/2) passed after one bounded macOS 2024.2 rerun; the original performance failure is retained. JetBrains now reports `approve=true`, `listed=true`, `hidden=false`. Both public IDE archives were downloaded and their embedded version and CLI pairing checked. [Public readback evidence](https://github.com/longfa/chainlesschain/blob/main/docs/research/cli/evidence/release112-public/publication.json).
405
421
 
406
422
  CLI 0.166.112 retains generated signing-key paths for explicit Evolution test deployments and the provider routing fixes prepared in 0.166.111. Gemini Quick Ask and chat use its native API; the Gemini agent and Hub compatibility clients use `/v1beta/openai`. Anthropic uses native Messages APIs, while OpenAI-compatible providers use `/chat/completions`. Provider overrides resolve their own endpoint, model and credentials. Ollama base URLs normalize an optional `/v1` suffix, and first-use local Quick Ask initializes its user-scoped signed host. Session Core 0.3.21 supplies the Windows extended-path ACL fix.
407
423
 
@@ -3610,7 +3626,7 @@ pre-provisioned binding from its registered workspace. `--check` validates
3610
3626
  identity/configuration without probing Docker or calling a model; `--prompt`
3611
3627
  runs one task with fixed `dontAsk` after sandbox preflight. This opt-in Linux
3612
3628
  entry does not enable automatic registration or Windows/macOS durable support.
3613
- See the [administrator setup and failure/stop-receipt contract](https://github.com/chainlesschain/chainlesschain/blob/main/docs/cli/NET02_CONTROLLED_HOST.md).
3629
+ See the [administrator setup and failure/stop-receipt contract](https://github.com/longfa/chainlesschain/blob/main/docs/cli/NET02_CONTROLLED_HOST.md).
3614
3630
 
3615
3631
  ## License
3616
3632
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chainlesschain",
3
- "version": "0.166.150",
3
+ "version": "0.166.157",
4
4
  "description": "CLI for ChainlessChain - install, configure, and manage your personal AI management system",
5
5
  "type": "module",
6
6
  "bin": {
@@ -94,7 +94,7 @@
94
94
  "license": "MIT",
95
95
  "repository": {
96
96
  "type": "git",
97
- "url": "git+https://github.com/chainlesschain/chainlesschain.git",
97
+ "url": "git+https://github.com/longfa/chainlesschain.git",
98
98
  "directory": "packages/cli"
99
99
  },
100
100
  "homepage": "https://www.chainlesschain.com",
@@ -6,5 +6,5 @@
6
6
  "imageDigest": "sha256:6395a47a5bd9b038303e94a5e93754258c8480dab64635460f973eb93dc6f4d8",
7
7
  "bytes": 778808,
8
8
  "linkage": "static",
9
- "commit": "b2af25c65d34f1ee34cdddf308b5a8e57bb4f198"
9
+ "commit": "0ad9968f0498fce77e538f6e5e64bba35db184c8"
10
10
  }
@@ -3,8 +3,8 @@
3
3
  "platform": "linux",
4
4
  "arch": "x64",
5
5
  "sourceDigest": "sha256:e920e24b4a79121484f2e8e97886755f88eaa1af93b55326dfa68c7a7f571424",
6
- "imageDigest": "sha256:f162e55ad3f3f72f8a52e9d7f12b5b8db44506c2ca66a14d7d62d5cd4f12498e",
7
- "bytes": 934160,
6
+ "imageDigest": "sha256:051b817c5f4e4849a98c55f64d1ee8dee980ec92decc23c2829b9bce217a8d47",
7
+ "bytes": 934112,
8
8
  "linkage": "static",
9
- "commit": "b2af25c65d34f1ee34cdddf308b5a8e57bb4f198"
9
+ "commit": "0ad9968f0498fce77e538f6e5e64bba35db184c8"
10
10
  }
@@ -1 +1 @@
1
- 14f01d5864fe4bc1367fd7780f5dd809ff5e55263a088469224ad81e7d2507c9
1
+ 7cca0e1640cbbe190cffb0383b11e924e7ae2c501f69590e175e7a106d988236
@@ -1 +1 @@
1
- import{t as B,_ as Ye,u as We,b as Ze,d as m}from"./index-hmILMYKF.js";import{R as Ge,at as He,A as re,j as ue,aY as de,b3 as Xe,c as et,f as tt}from"./icons-DlxlFL4g.js";import at from"./index-DzUL46rU.js";import{o as ot,M as v,R as z,P as r,c as a,N as l,Q as C,S as y,K as b,r as x,L as d,O as c,u as k,F as R,Y as J,f as M,h as lt,a as H}from"./vendor-BXcBOG8b.js";import"./KeyCode-D63Tfrq7.js";import"./omit-ULuXK3m0.js";import"./pickAttrs-B3f1sg_2.js";import"./initDefaultProps-Bno49hyl.js";import"./motion-Cs9KpFRZ.js";import"./raf-Deuc0E8-.js";import"./index-Lwktngzr.js";import"./index-BmVIyCgf.js";import"./isVisible-C7tPsqfj.js";import"./useState-Dlgl7fUg.js";import"./devWarning-CNIS3FrJ.js";import"./warning-Pq00owYb.js";import"./compact-item-QPjKEhW_.js";import"./createContext-BOGUY650.js";import"./Compact-BzWphLgo.js";import"./_getTag-BVc6NQ_K.js";import"./styleChecker-BeLQUf-Z.js";import"./zoom-D5rdpCyb.js";import"./ActionButton-xprOFj7C.js";import"./vnode-DhNnfLeH.js";const pe=Object.freeze(["P0","P1","P2","P3"]),st=Object.freeze(["open","acknowledged","resolved","closed"]);function g(i,n=0){return typeof i=="number"&&Number.isFinite(i)?i:n}function it(i,n=0){if(!i||typeof i!="object")return null;const t=i.id||"";return t?{key:t,id:t,anomalyMetric:i.anomalyMetric??i.anomaly_metric??"",severity:String(i.severity||"P3"),status:String(i.status||"open").toLowerCase(),description:String(i.description||""),anomalyData:i.anomalyData??i.anomaly_data??null,remediationId:i.remediationId??i.remediation_id??null,postmortem:i.postmortem||"",acknowledgedAt:i.acknowledgedAt??i.acknowledged_at??null,resolvedAt:i.resolvedAt??i.resolved_at??null,createdAt:i.createdAt??i.created_at??null,_idx:n}:null}function nt(i){const n=B(i);return Array.isArray(n)?n.map(it).filter(Boolean):[]}function rt(i,n=0){if(!i||typeof i!="object")return null;const t=i.id||"";if(!t)return null;const _=i.enabled;let S=!1;return _===!0||_===1||_==="1"?S=!0:_===!1||_===0||_==="0"?S=!1:S=!!_,{key:t,id:t,name:String(i.name||""),triggerCondition:i.triggerCondition??i.trigger_condition??"",steps:i.steps||"",enabled:S,successCount:g(i.successCount??i.success_count,0),failureCount:g(i.failureCount??i.failure_count,0),createdAt:i.createdAt??i.created_at??null,_idx:n}}function ut(i){const n=B(i);return Array.isArray(n)?n.map(rt).filter(Boolean):[]}function dt(i,n=0){if(!i||typeof i!="object")return null;const t=i.metricName??i.metric_name??"";return t?{key:t,metricName:t,mean:g(i.mean,0),stdDev:g(i.stdDev??i.std_dev,0),q1:g(i.q1,0),q3:g(i.q3,0),sampleCount:g(i.sampleCount??i.sample_count,0),updatedAt:i.updatedAt??i.updated_at??null,_idx:n}:null}function pt(i){const n=B(i);return Array.isArray(n)?n.map(dt).filter(Boolean):[]}function ct(i){const n=B(i);return!n||typeof n!="object"||Array.isArray(n)?null:{anomaly:!!n.anomaly,reason:n.reason||null,metricName:n.metricName??n.metric_name??"",value:g(n.value,0),algorithm:String(n.algorithm||""),score:g(n.score,0),threshold:g(n.threshold,0),baseline:n.baseline?{mean:g(n.baseline.mean,0),stdDev:g(n.baseline.stdDev??n.baseline.std_dev,0),q1:g(n.baseline.q1,0),q3:g(n.baseline.q3,0)}:null,incidentId:n.incidentId??n.incident_id??null,severity:n.severity||null}}const mt={incidents:{total:0,bySeverity:{P0:0,P1:0,P2:0,P3:0},byStatus:{open:0,acknowledged:0,resolved:0,closed:0},avgResolveMs:0},playbooks:{total:0,enabled:0,totalSuccess:0,totalFailure:0},baselines:{total:0,metrics:[]}};function yt(i){const n=JSON.parse(JSON.stringify(mt)),t=B(i);if(!t||typeof t!="object"||Array.isArray(t))return n;if(t.incidents&&typeof t.incidents=="object"){if(n.incidents.total=g(t.incidents.total,0),n.incidents.avgResolveMs=g(t.incidents.avgResolveMs??t.incidents.avg_resolve_ms,0),t.incidents.bySeverity&&typeof t.incidents.bySeverity=="object")for(const _ of Object.keys(n.incidents.bySeverity))n.incidents.bySeverity[_]=g(t.incidents.bySeverity[_],0);if(t.incidents.byStatus&&typeof t.incidents.byStatus=="object")for(const _ of Object.keys(n.incidents.byStatus))n.incidents.byStatus[_]=g(t.incidents.byStatus[_],0)}return t.playbooks&&typeof t.playbooks=="object"&&(n.playbooks.total=g(t.playbooks.total,0),n.playbooks.enabled=g(t.playbooks.enabled,0),n.playbooks.totalSuccess=g(t.playbooks.totalSuccess??t.playbooks.total_success,0),n.playbooks.totalFailure=g(t.playbooks.totalFailure??t.playbooks.total_failure,0)),t.baselines&&typeof t.baselines=="object"&&(n.baselines.total=g(t.baselines.total,0),Array.isArray(t.baselines.metrics)&&(n.baselines.metrics=[...t.baselines.metrics])),n}function ce(i){if(i==null||i==="")return"—";const n=typeof i=="number"?new Date(i):new Date(String(i));return isNaN(n.getTime())?String(i):n.toLocaleString("zh-CN",{hour12:!1})}const ft={style:{display:"flex","align-items":"center","justify-content":"space-between","margin-bottom":"24px"}},vt={class:"page-title"},bt={class:"page-sub"},gt={style:{color:"var(--text-secondary)","font-size":"12px","margin-left":"8px"}},kt={class:"filter-bar"},_t={key:0,style:{color:"var(--text-primary)","font-family":"monospace","font-size":"12px"}},$t={key:1,style:{color:"var(--text-muted)"}},ht={key:2,style:{color:"var(--text-secondary)","font-size":"12px"}},Ct={key:4,style:{color:"var(--text-secondary)","font-size":"11px"}},xt={style:{padding:"40px",color:"var(--text-muted)","text-align":"center"}},St={style:{color:"var(--text-primary)","font-weight":"500"}},wt={key:0,style:{color:"var(--text-secondary)","font-size":"11px","margin-top":"2px","font-family":"monospace"}},zt={key:3,style:{color:"var(--text-secondary)","font-size":"11px"}},At={style:{padding:"40px",color:"var(--text-muted)","text-align":"center"}},Ft={key:0,style:{color:"var(--text-primary)","font-family":"monospace","font-weight":"500"}},Pt={style:{color:"#1677ff"}},Rt={style:{color:"var(--text-secondary)","margin-left":"4px","font-size":"11px"}},jt={key:2,style:{color:"var(--text-secondary)","font-size":"12px"}},It={key:4,style:{color:"var(--text-secondary)","font-size":"11px"}},Lt={style:{padding:"40px",color:"var(--text-muted)","text-align":"center"}},Nt={key:0,style:{color:"var(--text-secondary)","font-size":"12px","margin-top":"8px"}},Ot={key:1,style:{"margin-top":"12px","font-size":"12px",color:"var(--text-secondary)"}},Tt={key:2,style:{"margin-top":"8px"}},Ut={__name:"AIOps",setup(i){const n=We(),{t}=Ze(),_=x(!1),S=x(!1),X=x(!1),me=x([]),ye=x([]),ee=x([]),A=x({incidents:{total:0,bySeverity:{P0:0,P1:0,P2:0,P3:0},byStatus:{open:0,acknowledged:0,resolved:0,closed:0},avgResolveMs:0},playbooks:{total:0,enabled:0,totalSuccess:0,totalFailure:0},baselines:{total:0,metrics:[]}}),K=x("incidents"),q=x(""),D=x(""),V=x(!1),Q=x(!1),Y=x(!1),te=x(!1),w=H({severity:"P3",metric:"",description:""}),$=H({name:"",triggerJson:"",stepsJson:""}),I=H({metric:"",values:""}),F=H({metric:"",value:null,algorithm:"z_score"}),h=x(null),xe=M(()=>[{title:t("aiops.incidentCols.severity"),key:"severity",width:"90px"},{title:t("aiops.incidentCols.metric"),key:"metric",width:"160px"},{title:t("aiops.incidentCols.description"),key:"description"},{title:t("aiops.incidentCols.status"),key:"status",width:"100px"},{title:t("aiops.incidentCols.createdAt"),key:"createdAt",width:"160px"},{title:t("aiops.incidentCols.action"),key:"action",width:"220px"}]),Se=M(()=>[{title:t("aiops.playbookCols.name"),key:"name"},{title:t("aiops.playbookCols.enabled"),key:"enabled",width:"80px"},{title:t("aiops.playbookCols.stats"),key:"stats",width:"180px"},{title:t("aiops.playbookCols.createdAt"),key:"createdAt",width:"160px"},{title:t("aiops.playbookCols.action"),key:"action",width:"160px"}]),we=M(()=>[{title:t("aiops.baselineCols.metric"),key:"metric"},{title:t("aiops.baselineCols.mean"),key:"mean",width:"180px"},{title:t("aiops.baselineCols.iqr"),key:"iqr",width:"180px"},{title:t("aiops.baselineCols.sampleCount"),key:"sampleCount",width:"90px"},{title:t("aiops.baselineCols.updatedAt"),key:"updatedAt",width:"160px"}]),ze=M(()=>A.value.incidents.byStatus.open+A.value.incidents.byStatus.acknowledged),Ae=M(()=>{let e=me.value;return q.value&&(e=e.filter(o=>o.severity===q.value)),D.value&&(e=e.filter(o=>o.status===D.value)),e});function fe(e){const o=`aiops.statusLabels.${e}`,u=t(o);return u===o?e:u}function Fe(e){return{open:"red",acknowledged:"orange",resolved:"cyan",closed:"default"}[e]||"default"}function ae(e){return{P0:"red",P1:"volcano",P2:"orange",P3:"gold"}[e]||"default"}function Pe(e){const o=`aiops.reasonLabels.${e}`,u=t(o);return u===o?e:u}function ve(e,o){return e?e.length>o?e.slice(0,o)+"...":e:""}function Re(e){return!e||e<=0?t("aiops.duration.none"):e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${(e/6e4).toFixed(1)}min`:`${(e/36e5).toFixed(1)}h`}function je({key:e}){e==="incident"?V.value=!0:e==="playbook"?Q.value=!0:e==="baseline"?Y.value=!0:e==="detect"&&(h.value=null,te.value=!0)}async function j(){_.value=!0;try{const[e,o,u,f]=await Promise.all([n.execute("ops incidents --limit 200 --json",1e4).catch(()=>({output:""})),n.execute("ops playbooks --limit 200 --json",1e4).catch(()=>({output:""})),n.execute("ops baselines --json",1e4).catch(()=>({output:""})),n.execute("ops stats --json",8e3).catch(()=>({output:""}))]);me.value=nt(e.output),ye.value=ut(o.output),ee.value=pt(u.output),A.value=yt(f.output)}catch(e){m.error(t("aiops.msg.loadFailed")+": "+(e?.message||e))}finally{_.value=!1}}async function Ie(){if(!w.description.trim()){m.warning(t("aiops.msg.descEmpty"));return}S.value=!0;try{const e=[`ops incident-create --severity ${w.severity}`];w.metric.trim()&&e.push(`--metric "${w.metric.trim().replace(/"/g,'\\"')}"`),e.push(`--description "${w.description.trim().replace(/"/g,'\\"')}"`),e.push("--json");const{output:o}=await n.execute(e.join(" "),1e4);if(/error|失败/i.test(o)&&!/"incidentId"/.test(o)){m.error(t("aiops.msg.createFailed")+": "+o.slice(0,120));return}m.success(t("aiops.msg.incidentCreated")),V.value=!1,ge(),await j()}catch(e){m.error(t("aiops.msg.createFailed")+": "+(e?.message||e))}finally{S.value=!1}}async function Le(){if(!$.name.trim()){m.warning(t("aiops.msg.playbookNameEmpty"));return}for(const[e,o]of[[$.triggerJson,"triggerLabel"],[$.stepsJson,"stepsLabel"]])if(e.trim())try{JSON.parse(e)}catch{m.warning(t("aiops.msg.jsonInvalid",{label:t(`aiops.msg.${o}`)}));return}S.value=!0;try{const e=[`ops playbook-create --name "${$.name.trim().replace(/"/g,'\\"')}"`];$.triggerJson.trim()&&e.push(`--trigger '${$.triggerJson.trim().replace(/'/g,"'\\''")}'`),$.stepsJson.trim()&&e.push(`--steps '${$.stepsJson.trim().replace(/'/g,"'\\''")}'`),e.push("--json");const{output:o}=await n.execute(e.join(" "),1e4);if(/error|失败/i.test(o)&&!/"playbookId"/.test(o)){m.error(t("aiops.msg.createFailed")+": "+o.slice(0,120));return}m.success(t("aiops.msg.playbookCreated")),Q.value=!1,ke(),K.value="playbooks",await j()}catch(e){m.error(t("aiops.msg.createFailed")+": "+(e?.message||e))}finally{S.value=!1}}async function Ne(){const e=I.metric.trim();if(!e){m.warning(t("aiops.msg.metricEmpty"));return}const o=I.values.split(/[\s,]+/).map(u=>u.trim()).filter(Boolean).map(u=>Number(u));if(o.length===0||o.some(u=>!Number.isFinite(u))){m.warning(t("aiops.msg.valuesInvalid"));return}S.value=!0;try{const u=`ops baseline-update "${e.replace(/"/g,'\\"')}" --values ${o.join(",")} --json`,{output:f}=await n.execute(u,1e4);if(/error|失败/i.test(f)&&!/"updated"/.test(f)){m.error(t("aiops.msg.baselineUpdateFailed")+": "+f.slice(0,120));return}m.success(t("aiops.msg.baselineUpdated",{n:o.length})),Y.value=!1,_e(),K.value="baselines",await j()}catch(u){m.error(t("aiops.msg.baselineUpdateFailed")+": "+(u?.message||u))}finally{S.value=!1}}async function Oe(){if(!F.metric||F.value==null){m.warning(t("aiops.msg.detectFieldsEmpty"));return}X.value=!0,h.value=null;try{const e=`ops detect "${F.metric.replace(/"/g,'\\"')}" ${F.value} --algorithm ${F.algorithm} --json`,{output:o}=await n.execute(e,8e3),u=ct(o);if(!u){m.error(t("aiops.msg.detectFailed")+": "+o.slice(0,120));return}h.value=u,u.anomaly&&(m.warning(t("aiops.msg.detectAnomaly",{severity:u.severity||"P3"})),j())}catch(e){m.error(t("aiops.msg.detectFailed")+": "+(e?.message||e))}finally{X.value=!1}}async function Te(e){await oe(e,"incident-ack",t("aiops.msg.incidentAcked"))}async function Ue(e){await oe(e,"incident-resolve",t("aiops.msg.incidentResolved"))}async function qe(e){await oe(e,"incident-close",t("aiops.msg.incidentClosed"))}async function oe(e,o,u){try{const{output:f}=await n.execute(`ops ${o} ${e.id} --json`,8e3);if(/error|失败|invalid/i.test(f)&&!/"acknowledged"|"resolved"|"closed"/.test(f)){m.error(t("aiops.msg.incidentTransitionFailed")+": "+f.slice(0,120));return}m.success(u),await j()}catch(f){m.error(t("aiops.msg.incidentTransitionFailed")+": "+(f?.message||f))}}async function De(e){try{const{output:o}=await n.execute(`ops postmortem ${e.id}`,12e3);at.info({title:t("aiops.msg.postmortemTitle",{id:e.id.slice(0,8)}),width:720,content:()=>lt("pre",{style:"white-space: pre-wrap; max-height: 60vh; overflow: auto; font-size: 12px; padding: 8px; background: rgba(0,0,0,.04); border-radius: 4px;"},o||t("aiops.msg.postmortemEmpty"))})}catch(o){m.error(t("aiops.msg.postmortemFailed")+": "+(o?.message||o))}}async function Ee(e,o){const u=o?"on":"off";try{const{output:f}=await n.execute(`ops playbook-toggle ${e.id} ${u} --json`,8e3);if(/error|失败/i.test(f)&&!/"enabled"/.test(f)){m.error(t("aiops.msg.playbookToggleFailed")+": "+f.slice(0,120));return}m.success(t(o?"aiops.msg.playbookEnabled":"aiops.msg.playbookDisabled")),await j()}catch(f){m.error(t("aiops.msg.playbookToggleFailed")+": "+(f?.message||f))}}async function be(e,o){try{const{output:u}=await n.execute(`ops playbook-record ${e.id} ${o} --json`,8e3);if(/error|失败/i.test(u)&&!/"recorded"/.test(u)){m.error(t("aiops.msg.playbookRecordFailed")+": "+u.slice(0,120));return}m.success(t(o==="success"?"aiops.msg.playbookRecordSuccess":"aiops.msg.playbookRecordFailure")),await j()}catch(u){m.error(t("aiops.msg.playbookRecordFailed")+": "+(u?.message||u))}}function ge(){w.severity="P3",w.metric="",w.description=""}function ke(){$.name="",$.triggerJson="",$.stepsJson=""}function _e(){I.metric="",I.values=""}return ot(j),(e,o)=>{const u=b("a-button"),f=b("a-menu-item"),Je=b("a-menu"),Me=b("a-dropdown"),$e=b("a-space"),T=b("a-statistic"),L=b("a-card"),E=b("a-col"),Be=b("a-row"),N=b("a-tag"),U=b("a-radio-button"),le=b("a-radio-group"),se=b("a-table"),ie=b("a-tab-pane"),Ke=b("a-switch"),Ve=b("a-tabs"),he=b("a-select-option"),Ce=b("a-select"),P=b("a-form-item"),ne=b("a-input"),W=b("a-textarea"),Z=b("a-form"),G=b("a-modal"),Qe=b("a-input-number");return d(),v("div",null,[z("div",ft,[z("div",null,[z("h2",vt,r(e.$t("aiops.title")),1),z("p",bt,r(e.$t("aiops.subtitle")),1)]),a($e,null,{default:l(()=>[a(u,{loading:_.value,onClick:j},{icon:l(()=>[a(k(Ge))]),default:l(()=>[c(" "+r(e.$t("aiops.refresh")),1)]),_:1},8,["loading"]),a(Me,{trigger:["click"]},{overlay:l(()=>[a(Je,{onClick:je},{default:l(()=>[a(f,{key:"incident"},{default:l(()=>[a(k(re)),c(" "+r(e.$t("aiops.actions.incident")),1)]),_:1}),a(f,{key:"playbook"},{default:l(()=>[a(k(ue)),c(" "+r(e.$t("aiops.actions.playbook")),1)]),_:1}),a(f,{key:"baseline"},{default:l(()=>[a(k(de)),c(" "+r(e.$t("aiops.actions.baseline")),1)]),_:1}),a(f,{key:"detect"},{default:l(()=>[a(k(Xe)),c(" "+r(e.$t("aiops.actions.detect")),1)]),_:1})]),_:1})]),default:l(()=>[a(u,{type:"primary"},{icon:l(()=>[a(k(He))]),default:l(()=>[c(" "+r(e.$t("aiops.newDropdown")),1)]),_:1})]),_:1})]),_:1})]),a(Be,{gutter:[16,16],style:{"margin-bottom":"20px"}},{default:l(()=>[a(E,{xs:12,sm:8,lg:5},{default:l(()=>[a(L,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[a(T,{title:e.$t("aiops.stats.incidents"),value:A.value.incidents.total,"value-style":{color:"#1677ff",fontSize:"20px"}},{prefix:l(()=>[a(k(re))]),_:1},8,["title","value"])]),_:1})]),_:1}),a(E,{xs:12,sm:8,lg:5},{default:l(()=>[a(L,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[a(T,{title:e.$t("aiops.stats.pending"),value:A.value.incidents.byStatus.open+A.value.incidents.byStatus.acknowledged,"value-style":{color:ze.value>0?"#ff4d4f":"#52c41a",fontSize:"20px"}},{prefix:l(()=>[a(k(et))]),_:1},8,["title","value","value-style"])]),_:1})]),_:1}),a(E,{xs:12,sm:8,lg:5},{default:l(()=>[a(L,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[a(T,{title:e.$t("aiops.stats.playbooks"),value:A.value.playbooks.total,"value-style":{color:"#722ed1",fontSize:"20px"}},{prefix:l(()=>[a(k(ue))]),_:1},8,["title","value"])]),_:1})]),_:1}),a(E,{xs:12,sm:8,lg:5},{default:l(()=>[a(L,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[a(T,{title:e.$t("aiops.stats.enabled"),value:A.value.playbooks.enabled,"value-style":{color:"#52c41a",fontSize:"20px"}},{prefix:l(()=>[a(k(tt))]),_:1},8,["title","value"])]),_:1})]),_:1}),a(E,{xs:24,sm:8,lg:4},{default:l(()=>[a(L,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[a(T,{title:e.$t("aiops.stats.baselines"),value:A.value.baselines.total,"value-style":{color:"#13c2c2",fontSize:"20px"}},{prefix:l(()=>[a(k(de))]),_:1},8,["title","value"])]),_:1})]),_:1})]),_:1}),A.value.incidents.total>0?(d(),C(L,{key:0,title:e.$t("aiops.severityCard"),size:"small",style:{background:"var(--bg-card)","border-color":"var(--border-color)","margin-bottom":"20px"},"body-style":{padding:"12px 16px"}},{default:l(()=>[a($e,{size:[12,8],wrap:""},{default:l(()=>[(d(!0),v(R,null,J(k(pe),s=>(d(),C(N,{key:s,color:ae(s),style:{"font-size":"13px",padding:"2px 10px"}},{default:l(()=>[c(r(s)+": "+r(A.value.incidents.bySeverity[s]||0),1)]),_:2},1032,["color"]))),128)),z("span",gt,r(e.$t("aiops.avgResolveLabel",{time:Re(A.value.incidents.avgResolveMs)})),1)]),_:1})]),_:1},8,["title"])):y("",!0),a(Ve,{activeKey:K.value,"onUpdate:activeKey":o[2]||(o[2]=s=>K.value=s),class:"aiops-tabs"},{default:l(()=>[a(ie,{key:"incidents",tab:e.$t("aiops.tabs.incidents")},{default:l(()=>[z("div",kt,[a(le,{value:q.value,"onUpdate:value":o[0]||(o[0]=s=>q.value=s),size:"small","button-style":"solid"},{default:l(()=>[a(U,{value:""},{default:l(()=>[c(r(e.$t("aiops.filter.all")),1)]),_:1}),(d(!0),v(R,null,J(k(pe),s=>(d(),C(U,{key:s,value:s},{default:l(()=>[c(r(s),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"]),a(le,{value:D.value,"onUpdate:value":o[1]||(o[1]=s=>D.value=s),size:"small"},{default:l(()=>[a(U,{value:""},{default:l(()=>[c(r(e.$t("aiops.filter.allStatuses")),1)]),_:1}),(d(!0),v(R,null,J(k(st),s=>(d(),C(U,{key:s,value:s},{default:l(()=>[c(r(fe(s)),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),a(se,{columns:xe.value,"data-source":Ae.value,pagination:{pageSize:20,showTotal:s=>e.$t("aiops.table.totalSuffix",{n:s})},size:"small",loading:_.value,style:{background:"var(--bg-card)"}},{bodyCell:l(({column:s,record:p})=>[s.key==="severity"?(d(),C(N,{key:0,color:ae(p.severity),style:{"font-weight":"600"}},{default:l(()=>[c(r(p.severity),1)]),_:2},1032,["color"])):y("",!0),s.key==="metric"?(d(),v(R,{key:1},[p.anomalyMetric?(d(),v("span",_t,r(p.anomalyMetric),1)):(d(),v("span",$t,"—"))],64)):y("",!0),s.key==="description"?(d(),v("span",ht,r(ve(p.description,80)||"—"),1)):y("",!0),s.key==="status"?(d(),C(N,{key:3,color:Fe(p.status)},{default:l(()=>[c(r(fe(p.status)),1)]),_:2},1032,["color"])):y("",!0),s.key==="createdAt"?(d(),v("span",Ct,r(k(ce)(p.createdAt)),1)):y("",!0),s.key==="action"?(d(),v(R,{key:5},[p.status==="open"?(d(),C(u,{key:0,size:"small",type:"link",onClick:O=>Te(p)},{default:l(()=>[c(r(e.$t("aiops.incidentActions.ack")),1)]),_:1},8,["onClick"])):y("",!0),p.status==="open"||p.status==="acknowledged"?(d(),C(u,{key:1,size:"small",type:"link",onClick:O=>Ue(p)},{default:l(()=>[c(r(e.$t("aiops.incidentActions.resolve")),1)]),_:1},8,["onClick"])):y("",!0),p.status==="resolved"?(d(),C(u,{key:2,size:"small",type:"link",onClick:O=>qe(p)},{default:l(()=>[c(r(e.$t("aiops.incidentActions.close")),1)]),_:1},8,["onClick"])):y("",!0),p.status==="resolved"||p.status==="closed"?(d(),C(u,{key:3,size:"small",type:"link",onClick:O=>De(p)},{default:l(()=>[c(r(e.$t("aiops.incidentActions.postmortem")),1)]),_:1},8,["onClick"])):y("",!0)],64)):y("",!0)]),emptyText:l(()=>[z("div",xt,[a(k(re),{style:{"font-size":"36px","margin-bottom":"10px",display:"block"}}),c(" "+r(q.value||D.value?e.$t("aiops.table.incidentEmptyFiltered"):e.$t("aiops.table.incidentEmpty")),1)])]),_:1},8,["columns","data-source","pagination","loading"])]),_:1},8,["tab"]),a(ie,{key:"playbooks",tab:e.$t("aiops.tabs.playbooks")},{default:l(()=>[a(se,{columns:Se.value,"data-source":ye.value,pagination:{pageSize:20,showTotal:s=>e.$t("aiops.table.totalSuffix",{n:s})},size:"small",loading:_.value,style:{background:"var(--bg-card)"}},{bodyCell:l(({column:s,record:p})=>[s.key==="name"?(d(),v(R,{key:0},[z("span",St,r(p.name),1),p.triggerCondition?(d(),v("div",wt,r(ve(p.triggerCondition,80)),1)):y("",!0)],64)):y("",!0),s.key==="enabled"?(d(),C(Ke,{key:1,checked:p.enabled,size:"small",onChange:O=>Ee(p,O)},null,8,["checked","onChange"])):y("",!0),s.key==="stats"?(d(),v(R,{key:2},[a(N,{color:"green",style:{"font-size":"11px"}},{default:l(()=>[c(r(e.$t("aiops.table.successCount",{n:p.successCount})),1)]),_:2},1024),p.failureCount>0?(d(),C(N,{key:0,color:"red",style:{"font-size":"11px","margin-left":"4px"}},{default:l(()=>[c(r(e.$t("aiops.table.failureCount",{n:p.failureCount})),1)]),_:2},1024)):y("",!0)],64)):y("",!0),s.key==="createdAt"?(d(),v("span",zt,r(k(ce)(p.createdAt)),1)):y("",!0),s.key==="action"?(d(),v(R,{key:4},[a(u,{size:"small",type:"link",onClick:O=>be(p,"success")},{default:l(()=>[c(r(e.$t("aiops.playbookActions.success")),1)]),_:1},8,["onClick"]),a(u,{size:"small",type:"link",danger:"",onClick:O=>be(p,"failure")},{default:l(()=>[c(r(e.$t("aiops.playbookActions.failure")),1)]),_:1},8,["onClick"])],64)):y("",!0)]),emptyText:l(()=>[z("div",At,[a(k(ue),{style:{"font-size":"36px","margin-bottom":"10px",display:"block"}}),c(" "+r(e.$t("aiops.table.playbookEmpty")),1)])]),_:1},8,["columns","data-source","pagination","loading"])]),_:1},8,["tab"]),a(ie,{key:"baselines",tab:e.$t("aiops.tabs.baselines")},{default:l(()=>[a(se,{columns:we.value,"data-source":ee.value,pagination:{pageSize:20,showTotal:s=>e.$t("aiops.table.totalSuffix",{n:s})},size:"small",loading:_.value,style:{background:"var(--bg-card)"}},{bodyCell:l(({column:s,record:p})=>[s.key==="metric"?(d(),v("span",Ft,r(p.metricName),1)):y("",!0),s.key==="mean"?(d(),v(R,{key:1},[z("span",Pt,r(p.mean),1),z("span",Rt,"σ "+r(p.stdDev),1)],64)):y("",!0),s.key==="iqr"?(d(),v("span",jt," Q1 "+r(p.q1)+" / Q3 "+r(p.q3),1)):y("",!0),s.key==="sampleCount"?(d(),C(N,{key:3,color:"blue",style:{"font-size":"11px"}},{default:l(()=>[c(r(p.sampleCount),1)]),_:2},1024)):y("",!0),s.key==="updatedAt"?(d(),v("span",It,r(k(ce)(p.updatedAt)),1)):y("",!0)]),emptyText:l(()=>[z("div",Lt,[a(k(de),{style:{"font-size":"36px","margin-bottom":"10px",display:"block"}}),c(" "+r(e.$t("aiops.table.baselineEmpty")),1)])]),_:1},8,["columns","data-source","pagination","loading"])]),_:1},8,["tab"])]),_:1},8,["activeKey"]),a(G,{open:V.value,"onUpdate:open":o[6]||(o[6]=s=>V.value=s),title:e.$t("aiops.incident_modal.title"),"confirm-loading":S.value,width:520,"ok-text":e.$t("aiops.incident_modal.ok"),"cancel-text":e.$t("aiops.incident_modal.cancel"),onOk:Ie,onCancel:ge},{default:l(()=>[a(Z,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[a(P,{label:e.$t("aiops.incident_modal.severityLabel")},{default:l(()=>[a(Ce,{value:w.severity,"onUpdate:value":o[3]||(o[3]=s=>w.severity=s)},{default:l(()=>[(d(!0),v(R,null,J(k(pe),s=>(d(),C(he,{key:s,value:s},{default:l(()=>[c(r(s),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.incident_modal.metricLabel")},{default:l(()=>[a(ne,{value:w.metric,"onUpdate:value":o[4]||(o[4]=s=>w.metric=s),placeholder:e.$t("aiops.incident_modal.metricPlaceholder")},null,8,["value","placeholder"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.incident_modal.descLabel"),required:""},{default:l(()=>[a(W,{value:w.description,"onUpdate:value":o[5]||(o[5]=s=>w.description=s),"auto-size":{minRows:3,maxRows:6}},null,8,["value"])]),_:1},8,["label"])]),_:1})]),_:1},8,["open","title","confirm-loading","ok-text","cancel-text"]),a(G,{open:Q.value,"onUpdate:open":o[10]||(o[10]=s=>Q.value=s),title:e.$t("aiops.playbook_modal.title"),"confirm-loading":S.value,width:540,"ok-text":e.$t("aiops.playbook_modal.ok"),"cancel-text":e.$t("aiops.playbook_modal.cancel"),onOk:Le,onCancel:ke},{default:l(()=>[a(Z,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[a(P,{label:e.$t("aiops.playbook_modal.nameLabel"),required:""},{default:l(()=>[a(ne,{value:$.name,"onUpdate:value":o[7]||(o[7]=s=>$.name=s),placeholder:e.$t("aiops.playbook_modal.namePlaceholder")},null,8,["value","placeholder"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.playbook_modal.triggerLabel")},{default:l(()=>[a(W,{value:$.triggerJson,"onUpdate:value":o[8]||(o[8]=s=>$.triggerJson=s),placeholder:e.$t("aiops.playbook_modal.triggerPlaceholder"),"auto-size":{minRows:2,maxRows:4}},null,8,["value","placeholder"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.playbook_modal.stepsLabel")},{default:l(()=>[a(W,{value:$.stepsJson,"onUpdate:value":o[9]||(o[9]=s=>$.stepsJson=s),placeholder:e.$t("aiops.playbook_modal.stepsPlaceholder"),"auto-size":{minRows:3,maxRows:6}},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1})]),_:1},8,["open","title","confirm-loading","ok-text","cancel-text"]),a(G,{open:Y.value,"onUpdate:open":o[13]||(o[13]=s=>Y.value=s),title:e.$t("aiops.baseline_modal.title"),"confirm-loading":S.value,width:500,"ok-text":e.$t("aiops.baseline_modal.ok"),"cancel-text":e.$t("aiops.baseline_modal.cancel"),onOk:Ne,onCancel:_e},{default:l(()=>[a(Z,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[a(P,{label:e.$t("aiops.baseline_modal.metricLabel"),required:""},{default:l(()=>[a(ne,{value:I.metric,"onUpdate:value":o[11]||(o[11]=s=>I.metric=s),placeholder:e.$t("aiops.baseline_modal.metricPlaceholder")},null,8,["value","placeholder"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.baseline_modal.valuesLabel"),required:""},{default:l(()=>[a(W,{value:I.values,"onUpdate:value":o[12]||(o[12]=s=>I.values=s),placeholder:e.$t("aiops.baseline_modal.valuesPlaceholder"),"auto-size":{minRows:3,maxRows:8}},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1})]),_:1},8,["open","title","confirm-loading","ok-text","cancel-text"]),a(G,{open:te.value,"onUpdate:open":o[17]||(o[17]=s=>te.value=s),title:e.$t("aiops.detect_modal.title"),"confirm-loading":X.value,width:500,"ok-text":e.$t("aiops.detect_modal.ok"),"cancel-text":e.$t("aiops.detect_modal.cancel"),onOk:Oe},{default:l(()=>[a(Z,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[a(P,{label:e.$t("aiops.detect_modal.metricLabel"),required:""},{default:l(()=>[a(Ce,{value:F.metric,"onUpdate:value":o[14]||(o[14]=s=>F.metric=s),"show-search":"",placeholder:e.$t("aiops.detect_modal.metricPlaceholder")},{default:l(()=>[(d(!0),v(R,null,J(ee.value,s=>(d(),C(he,{key:s.metricName,value:s.metricName},{default:l(()=>[c(r(e.$t("aiops.detect_modal.metricOptionLabel",{name:s.metricName,count:s.sampleCount})),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","placeholder"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.detect_modal.valueLabel"),required:""},{default:l(()=>[a(Qe,{value:F.value,"onUpdate:value":o[15]||(o[15]=s=>F.value=s),style:{width:"100%"}},null,8,["value"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.detect_modal.algorithmLabel")},{default:l(()=>[a(le,{value:F.algorithm,"onUpdate:value":o[16]||(o[16]=s=>F.algorithm=s)},{default:l(()=>[a(U,{value:"z_score"},{default:l(()=>[...o[18]||(o[18]=[c("Z-Score (3σ)",-1)])]),_:1}),a(U,{value:"iqr"},{default:l(()=>[...o[19]||(o[19]=[c("IQR (1.5×)",-1)])]),_:1})]),_:1},8,["value"])]),_:1},8,["label"])]),_:1}),h.value?(d(),C(L,{key:0,size:"small",style:{background:"var(--bg-base)","margin-top":"8px"}},{default:l(()=>[a(T,{title:e.$t("aiops.detect_modal.resultTitle"),value:h.value.anomaly?e.$t("aiops.detect_modal.anomaly"):e.$t("aiops.detect_modal.normal"),"value-style":{color:h.value.anomaly?"#ff4d4f":"#52c41a"}},null,8,["title","value","value-style"]),h.value.reason&&!h.value.anomaly?(d(),v("div",Nt,r(e.$t("aiops.detect_modal.reasonLine",{reason:Pe(h.value.reason)})),1)):y("",!0),h.value.baseline?(d(),v("div",Ot,[z("div",null,r(e.$t("aiops.detect_modal.scoreLine",{score:h.value.score,threshold:h.value.threshold})),1),z("div",null,r(e.$t("aiops.detect_modal.baselineLine",{mean:h.value.baseline.mean,stdDev:h.value.baseline.stdDev})),1)])):y("",!0),h.value.incidentId?(d(),v("div",Tt,[a(N,{color:ae(h.value.severity)},{default:l(()=>[c(r(e.$t("aiops.detect_modal.incidentCreated",{severity:h.value.severity})),1)]),_:1},8,["color"])])):y("",!0)]),_:1})):y("",!0)]),_:1},8,["open","title","confirm-loading","ok-text","cancel-text"])])}}},ua=Ye(Ut,[["__scopeId","data-v-ecfcab22"]]);export{ua as default};
1
+ import{t as B,_ as Ye,u as We,b as Ze,d as m}from"./index-Dzh9Ud2R.js";import{R as Ge,at as He,A as re,j as ue,aY as de,b3 as Xe,c as et,f as tt}from"./icons-DlxlFL4g.js";import at from"./index-D6B_ELy6.js";import{o as ot,M as v,R as z,P as r,c as a,N as l,Q as C,S as y,K as b,r as x,L as d,O as c,u as k,F as R,Y as J,f as M,h as lt,a as H}from"./vendor-BXcBOG8b.js";import"./KeyCode-D63Tfrq7.js";import"./omit-BFjLuAHb.js";import"./pickAttrs-DfsjYq45.js";import"./initDefaultProps-DfHPrIA5.js";import"./motion-CCzrK3c5.js";import"./raf-Deuc0E8-.js";import"./index-DXip1xUj.js";import"./index-D9QfJDQg.js";import"./isVisible-C7tPsqfj.js";import"./useState-Dlgl7fUg.js";import"./devWarning-CNIS3FrJ.js";import"./warning-Pq00owYb.js";import"./compact-item-GhZzQppm.js";import"./createContext-Bc6nwTUy.js";import"./Compact-oKnoE-9_.js";import"./_getTag-BVc6NQ_K.js";import"./styleChecker-C5Y3Oyy2.js";import"./zoom-BaS5ZYRC.js";import"./ActionButton-C0jn6sgg.js";import"./vnode-BRTSCmU3.js";const pe=Object.freeze(["P0","P1","P2","P3"]),st=Object.freeze(["open","acknowledged","resolved","closed"]);function g(i,n=0){return typeof i=="number"&&Number.isFinite(i)?i:n}function it(i,n=0){if(!i||typeof i!="object")return null;const t=i.id||"";return t?{key:t,id:t,anomalyMetric:i.anomalyMetric??i.anomaly_metric??"",severity:String(i.severity||"P3"),status:String(i.status||"open").toLowerCase(),description:String(i.description||""),anomalyData:i.anomalyData??i.anomaly_data??null,remediationId:i.remediationId??i.remediation_id??null,postmortem:i.postmortem||"",acknowledgedAt:i.acknowledgedAt??i.acknowledged_at??null,resolvedAt:i.resolvedAt??i.resolved_at??null,createdAt:i.createdAt??i.created_at??null,_idx:n}:null}function nt(i){const n=B(i);return Array.isArray(n)?n.map(it).filter(Boolean):[]}function rt(i,n=0){if(!i||typeof i!="object")return null;const t=i.id||"";if(!t)return null;const _=i.enabled;let S=!1;return _===!0||_===1||_==="1"?S=!0:_===!1||_===0||_==="0"?S=!1:S=!!_,{key:t,id:t,name:String(i.name||""),triggerCondition:i.triggerCondition??i.trigger_condition??"",steps:i.steps||"",enabled:S,successCount:g(i.successCount??i.success_count,0),failureCount:g(i.failureCount??i.failure_count,0),createdAt:i.createdAt??i.created_at??null,_idx:n}}function ut(i){const n=B(i);return Array.isArray(n)?n.map(rt).filter(Boolean):[]}function dt(i,n=0){if(!i||typeof i!="object")return null;const t=i.metricName??i.metric_name??"";return t?{key:t,metricName:t,mean:g(i.mean,0),stdDev:g(i.stdDev??i.std_dev,0),q1:g(i.q1,0),q3:g(i.q3,0),sampleCount:g(i.sampleCount??i.sample_count,0),updatedAt:i.updatedAt??i.updated_at??null,_idx:n}:null}function pt(i){const n=B(i);return Array.isArray(n)?n.map(dt).filter(Boolean):[]}function ct(i){const n=B(i);return!n||typeof n!="object"||Array.isArray(n)?null:{anomaly:!!n.anomaly,reason:n.reason||null,metricName:n.metricName??n.metric_name??"",value:g(n.value,0),algorithm:String(n.algorithm||""),score:g(n.score,0),threshold:g(n.threshold,0),baseline:n.baseline?{mean:g(n.baseline.mean,0),stdDev:g(n.baseline.stdDev??n.baseline.std_dev,0),q1:g(n.baseline.q1,0),q3:g(n.baseline.q3,0)}:null,incidentId:n.incidentId??n.incident_id??null,severity:n.severity||null}}const mt={incidents:{total:0,bySeverity:{P0:0,P1:0,P2:0,P3:0},byStatus:{open:0,acknowledged:0,resolved:0,closed:0},avgResolveMs:0},playbooks:{total:0,enabled:0,totalSuccess:0,totalFailure:0},baselines:{total:0,metrics:[]}};function yt(i){const n=JSON.parse(JSON.stringify(mt)),t=B(i);if(!t||typeof t!="object"||Array.isArray(t))return n;if(t.incidents&&typeof t.incidents=="object"){if(n.incidents.total=g(t.incidents.total,0),n.incidents.avgResolveMs=g(t.incidents.avgResolveMs??t.incidents.avg_resolve_ms,0),t.incidents.bySeverity&&typeof t.incidents.bySeverity=="object")for(const _ of Object.keys(n.incidents.bySeverity))n.incidents.bySeverity[_]=g(t.incidents.bySeverity[_],0);if(t.incidents.byStatus&&typeof t.incidents.byStatus=="object")for(const _ of Object.keys(n.incidents.byStatus))n.incidents.byStatus[_]=g(t.incidents.byStatus[_],0)}return t.playbooks&&typeof t.playbooks=="object"&&(n.playbooks.total=g(t.playbooks.total,0),n.playbooks.enabled=g(t.playbooks.enabled,0),n.playbooks.totalSuccess=g(t.playbooks.totalSuccess??t.playbooks.total_success,0),n.playbooks.totalFailure=g(t.playbooks.totalFailure??t.playbooks.total_failure,0)),t.baselines&&typeof t.baselines=="object"&&(n.baselines.total=g(t.baselines.total,0),Array.isArray(t.baselines.metrics)&&(n.baselines.metrics=[...t.baselines.metrics])),n}function ce(i){if(i==null||i==="")return"—";const n=typeof i=="number"?new Date(i):new Date(String(i));return isNaN(n.getTime())?String(i):n.toLocaleString("zh-CN",{hour12:!1})}const ft={style:{display:"flex","align-items":"center","justify-content":"space-between","margin-bottom":"24px"}},vt={class:"page-title"},bt={class:"page-sub"},gt={style:{color:"var(--text-secondary)","font-size":"12px","margin-left":"8px"}},kt={class:"filter-bar"},_t={key:0,style:{color:"var(--text-primary)","font-family":"monospace","font-size":"12px"}},$t={key:1,style:{color:"var(--text-muted)"}},ht={key:2,style:{color:"var(--text-secondary)","font-size":"12px"}},Ct={key:4,style:{color:"var(--text-secondary)","font-size":"11px"}},xt={style:{padding:"40px",color:"var(--text-muted)","text-align":"center"}},St={style:{color:"var(--text-primary)","font-weight":"500"}},wt={key:0,style:{color:"var(--text-secondary)","font-size":"11px","margin-top":"2px","font-family":"monospace"}},zt={key:3,style:{color:"var(--text-secondary)","font-size":"11px"}},At={style:{padding:"40px",color:"var(--text-muted)","text-align":"center"}},Ft={key:0,style:{color:"var(--text-primary)","font-family":"monospace","font-weight":"500"}},Pt={style:{color:"#1677ff"}},Rt={style:{color:"var(--text-secondary)","margin-left":"4px","font-size":"11px"}},jt={key:2,style:{color:"var(--text-secondary)","font-size":"12px"}},It={key:4,style:{color:"var(--text-secondary)","font-size":"11px"}},Lt={style:{padding:"40px",color:"var(--text-muted)","text-align":"center"}},Nt={key:0,style:{color:"var(--text-secondary)","font-size":"12px","margin-top":"8px"}},Ot={key:1,style:{"margin-top":"12px","font-size":"12px",color:"var(--text-secondary)"}},Tt={key:2,style:{"margin-top":"8px"}},Ut={__name:"AIOps",setup(i){const n=We(),{t}=Ze(),_=x(!1),S=x(!1),X=x(!1),me=x([]),ye=x([]),ee=x([]),A=x({incidents:{total:0,bySeverity:{P0:0,P1:0,P2:0,P3:0},byStatus:{open:0,acknowledged:0,resolved:0,closed:0},avgResolveMs:0},playbooks:{total:0,enabled:0,totalSuccess:0,totalFailure:0},baselines:{total:0,metrics:[]}}),K=x("incidents"),q=x(""),D=x(""),V=x(!1),Q=x(!1),Y=x(!1),te=x(!1),w=H({severity:"P3",metric:"",description:""}),$=H({name:"",triggerJson:"",stepsJson:""}),I=H({metric:"",values:""}),F=H({metric:"",value:null,algorithm:"z_score"}),h=x(null),xe=M(()=>[{title:t("aiops.incidentCols.severity"),key:"severity",width:"90px"},{title:t("aiops.incidentCols.metric"),key:"metric",width:"160px"},{title:t("aiops.incidentCols.description"),key:"description"},{title:t("aiops.incidentCols.status"),key:"status",width:"100px"},{title:t("aiops.incidentCols.createdAt"),key:"createdAt",width:"160px"},{title:t("aiops.incidentCols.action"),key:"action",width:"220px"}]),Se=M(()=>[{title:t("aiops.playbookCols.name"),key:"name"},{title:t("aiops.playbookCols.enabled"),key:"enabled",width:"80px"},{title:t("aiops.playbookCols.stats"),key:"stats",width:"180px"},{title:t("aiops.playbookCols.createdAt"),key:"createdAt",width:"160px"},{title:t("aiops.playbookCols.action"),key:"action",width:"160px"}]),we=M(()=>[{title:t("aiops.baselineCols.metric"),key:"metric"},{title:t("aiops.baselineCols.mean"),key:"mean",width:"180px"},{title:t("aiops.baselineCols.iqr"),key:"iqr",width:"180px"},{title:t("aiops.baselineCols.sampleCount"),key:"sampleCount",width:"90px"},{title:t("aiops.baselineCols.updatedAt"),key:"updatedAt",width:"160px"}]),ze=M(()=>A.value.incidents.byStatus.open+A.value.incidents.byStatus.acknowledged),Ae=M(()=>{let e=me.value;return q.value&&(e=e.filter(o=>o.severity===q.value)),D.value&&(e=e.filter(o=>o.status===D.value)),e});function fe(e){const o=`aiops.statusLabels.${e}`,u=t(o);return u===o?e:u}function Fe(e){return{open:"red",acknowledged:"orange",resolved:"cyan",closed:"default"}[e]||"default"}function ae(e){return{P0:"red",P1:"volcano",P2:"orange",P3:"gold"}[e]||"default"}function Pe(e){const o=`aiops.reasonLabels.${e}`,u=t(o);return u===o?e:u}function ve(e,o){return e?e.length>o?e.slice(0,o)+"...":e:""}function Re(e){return!e||e<=0?t("aiops.duration.none"):e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${(e/6e4).toFixed(1)}min`:`${(e/36e5).toFixed(1)}h`}function je({key:e}){e==="incident"?V.value=!0:e==="playbook"?Q.value=!0:e==="baseline"?Y.value=!0:e==="detect"&&(h.value=null,te.value=!0)}async function j(){_.value=!0;try{const[e,o,u,f]=await Promise.all([n.execute("ops incidents --limit 200 --json",1e4).catch(()=>({output:""})),n.execute("ops playbooks --limit 200 --json",1e4).catch(()=>({output:""})),n.execute("ops baselines --json",1e4).catch(()=>({output:""})),n.execute("ops stats --json",8e3).catch(()=>({output:""}))]);me.value=nt(e.output),ye.value=ut(o.output),ee.value=pt(u.output),A.value=yt(f.output)}catch(e){m.error(t("aiops.msg.loadFailed")+": "+(e?.message||e))}finally{_.value=!1}}async function Ie(){if(!w.description.trim()){m.warning(t("aiops.msg.descEmpty"));return}S.value=!0;try{const e=[`ops incident-create --severity ${w.severity}`];w.metric.trim()&&e.push(`--metric "${w.metric.trim().replace(/"/g,'\\"')}"`),e.push(`--description "${w.description.trim().replace(/"/g,'\\"')}"`),e.push("--json");const{output:o}=await n.execute(e.join(" "),1e4);if(/error|失败/i.test(o)&&!/"incidentId"/.test(o)){m.error(t("aiops.msg.createFailed")+": "+o.slice(0,120));return}m.success(t("aiops.msg.incidentCreated")),V.value=!1,ge(),await j()}catch(e){m.error(t("aiops.msg.createFailed")+": "+(e?.message||e))}finally{S.value=!1}}async function Le(){if(!$.name.trim()){m.warning(t("aiops.msg.playbookNameEmpty"));return}for(const[e,o]of[[$.triggerJson,"triggerLabel"],[$.stepsJson,"stepsLabel"]])if(e.trim())try{JSON.parse(e)}catch{m.warning(t("aiops.msg.jsonInvalid",{label:t(`aiops.msg.${o}`)}));return}S.value=!0;try{const e=[`ops playbook-create --name "${$.name.trim().replace(/"/g,'\\"')}"`];$.triggerJson.trim()&&e.push(`--trigger '${$.triggerJson.trim().replace(/'/g,"'\\''")}'`),$.stepsJson.trim()&&e.push(`--steps '${$.stepsJson.trim().replace(/'/g,"'\\''")}'`),e.push("--json");const{output:o}=await n.execute(e.join(" "),1e4);if(/error|失败/i.test(o)&&!/"playbookId"/.test(o)){m.error(t("aiops.msg.createFailed")+": "+o.slice(0,120));return}m.success(t("aiops.msg.playbookCreated")),Q.value=!1,ke(),K.value="playbooks",await j()}catch(e){m.error(t("aiops.msg.createFailed")+": "+(e?.message||e))}finally{S.value=!1}}async function Ne(){const e=I.metric.trim();if(!e){m.warning(t("aiops.msg.metricEmpty"));return}const o=I.values.split(/[\s,]+/).map(u=>u.trim()).filter(Boolean).map(u=>Number(u));if(o.length===0||o.some(u=>!Number.isFinite(u))){m.warning(t("aiops.msg.valuesInvalid"));return}S.value=!0;try{const u=`ops baseline-update "${e.replace(/"/g,'\\"')}" --values ${o.join(",")} --json`,{output:f}=await n.execute(u,1e4);if(/error|失败/i.test(f)&&!/"updated"/.test(f)){m.error(t("aiops.msg.baselineUpdateFailed")+": "+f.slice(0,120));return}m.success(t("aiops.msg.baselineUpdated",{n:o.length})),Y.value=!1,_e(),K.value="baselines",await j()}catch(u){m.error(t("aiops.msg.baselineUpdateFailed")+": "+(u?.message||u))}finally{S.value=!1}}async function Oe(){if(!F.metric||F.value==null){m.warning(t("aiops.msg.detectFieldsEmpty"));return}X.value=!0,h.value=null;try{const e=`ops detect "${F.metric.replace(/"/g,'\\"')}" ${F.value} --algorithm ${F.algorithm} --json`,{output:o}=await n.execute(e,8e3),u=ct(o);if(!u){m.error(t("aiops.msg.detectFailed")+": "+o.slice(0,120));return}h.value=u,u.anomaly&&(m.warning(t("aiops.msg.detectAnomaly",{severity:u.severity||"P3"})),j())}catch(e){m.error(t("aiops.msg.detectFailed")+": "+(e?.message||e))}finally{X.value=!1}}async function Te(e){await oe(e,"incident-ack",t("aiops.msg.incidentAcked"))}async function Ue(e){await oe(e,"incident-resolve",t("aiops.msg.incidentResolved"))}async function qe(e){await oe(e,"incident-close",t("aiops.msg.incidentClosed"))}async function oe(e,o,u){try{const{output:f}=await n.execute(`ops ${o} ${e.id} --json`,8e3);if(/error|失败|invalid/i.test(f)&&!/"acknowledged"|"resolved"|"closed"/.test(f)){m.error(t("aiops.msg.incidentTransitionFailed")+": "+f.slice(0,120));return}m.success(u),await j()}catch(f){m.error(t("aiops.msg.incidentTransitionFailed")+": "+(f?.message||f))}}async function De(e){try{const{output:o}=await n.execute(`ops postmortem ${e.id}`,12e3);at.info({title:t("aiops.msg.postmortemTitle",{id:e.id.slice(0,8)}),width:720,content:()=>lt("pre",{style:"white-space: pre-wrap; max-height: 60vh; overflow: auto; font-size: 12px; padding: 8px; background: rgba(0,0,0,.04); border-radius: 4px;"},o||t("aiops.msg.postmortemEmpty"))})}catch(o){m.error(t("aiops.msg.postmortemFailed")+": "+(o?.message||o))}}async function Ee(e,o){const u=o?"on":"off";try{const{output:f}=await n.execute(`ops playbook-toggle ${e.id} ${u} --json`,8e3);if(/error|失败/i.test(f)&&!/"enabled"/.test(f)){m.error(t("aiops.msg.playbookToggleFailed")+": "+f.slice(0,120));return}m.success(t(o?"aiops.msg.playbookEnabled":"aiops.msg.playbookDisabled")),await j()}catch(f){m.error(t("aiops.msg.playbookToggleFailed")+": "+(f?.message||f))}}async function be(e,o){try{const{output:u}=await n.execute(`ops playbook-record ${e.id} ${o} --json`,8e3);if(/error|失败/i.test(u)&&!/"recorded"/.test(u)){m.error(t("aiops.msg.playbookRecordFailed")+": "+u.slice(0,120));return}m.success(t(o==="success"?"aiops.msg.playbookRecordSuccess":"aiops.msg.playbookRecordFailure")),await j()}catch(u){m.error(t("aiops.msg.playbookRecordFailed")+": "+(u?.message||u))}}function ge(){w.severity="P3",w.metric="",w.description=""}function ke(){$.name="",$.triggerJson="",$.stepsJson=""}function _e(){I.metric="",I.values=""}return ot(j),(e,o)=>{const u=b("a-button"),f=b("a-menu-item"),Je=b("a-menu"),Me=b("a-dropdown"),$e=b("a-space"),T=b("a-statistic"),L=b("a-card"),E=b("a-col"),Be=b("a-row"),N=b("a-tag"),U=b("a-radio-button"),le=b("a-radio-group"),se=b("a-table"),ie=b("a-tab-pane"),Ke=b("a-switch"),Ve=b("a-tabs"),he=b("a-select-option"),Ce=b("a-select"),P=b("a-form-item"),ne=b("a-input"),W=b("a-textarea"),Z=b("a-form"),G=b("a-modal"),Qe=b("a-input-number");return d(),v("div",null,[z("div",ft,[z("div",null,[z("h2",vt,r(e.$t("aiops.title")),1),z("p",bt,r(e.$t("aiops.subtitle")),1)]),a($e,null,{default:l(()=>[a(u,{loading:_.value,onClick:j},{icon:l(()=>[a(k(Ge))]),default:l(()=>[c(" "+r(e.$t("aiops.refresh")),1)]),_:1},8,["loading"]),a(Me,{trigger:["click"]},{overlay:l(()=>[a(Je,{onClick:je},{default:l(()=>[a(f,{key:"incident"},{default:l(()=>[a(k(re)),c(" "+r(e.$t("aiops.actions.incident")),1)]),_:1}),a(f,{key:"playbook"},{default:l(()=>[a(k(ue)),c(" "+r(e.$t("aiops.actions.playbook")),1)]),_:1}),a(f,{key:"baseline"},{default:l(()=>[a(k(de)),c(" "+r(e.$t("aiops.actions.baseline")),1)]),_:1}),a(f,{key:"detect"},{default:l(()=>[a(k(Xe)),c(" "+r(e.$t("aiops.actions.detect")),1)]),_:1})]),_:1})]),default:l(()=>[a(u,{type:"primary"},{icon:l(()=>[a(k(He))]),default:l(()=>[c(" "+r(e.$t("aiops.newDropdown")),1)]),_:1})]),_:1})]),_:1})]),a(Be,{gutter:[16,16],style:{"margin-bottom":"20px"}},{default:l(()=>[a(E,{xs:12,sm:8,lg:5},{default:l(()=>[a(L,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[a(T,{title:e.$t("aiops.stats.incidents"),value:A.value.incidents.total,"value-style":{color:"#1677ff",fontSize:"20px"}},{prefix:l(()=>[a(k(re))]),_:1},8,["title","value"])]),_:1})]),_:1}),a(E,{xs:12,sm:8,lg:5},{default:l(()=>[a(L,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[a(T,{title:e.$t("aiops.stats.pending"),value:A.value.incidents.byStatus.open+A.value.incidents.byStatus.acknowledged,"value-style":{color:ze.value>0?"#ff4d4f":"#52c41a",fontSize:"20px"}},{prefix:l(()=>[a(k(et))]),_:1},8,["title","value","value-style"])]),_:1})]),_:1}),a(E,{xs:12,sm:8,lg:5},{default:l(()=>[a(L,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[a(T,{title:e.$t("aiops.stats.playbooks"),value:A.value.playbooks.total,"value-style":{color:"#722ed1",fontSize:"20px"}},{prefix:l(()=>[a(k(ue))]),_:1},8,["title","value"])]),_:1})]),_:1}),a(E,{xs:12,sm:8,lg:5},{default:l(()=>[a(L,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[a(T,{title:e.$t("aiops.stats.enabled"),value:A.value.playbooks.enabled,"value-style":{color:"#52c41a",fontSize:"20px"}},{prefix:l(()=>[a(k(tt))]),_:1},8,["title","value"])]),_:1})]),_:1}),a(E,{xs:24,sm:8,lg:4},{default:l(()=>[a(L,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[a(T,{title:e.$t("aiops.stats.baselines"),value:A.value.baselines.total,"value-style":{color:"#13c2c2",fontSize:"20px"}},{prefix:l(()=>[a(k(de))]),_:1},8,["title","value"])]),_:1})]),_:1})]),_:1}),A.value.incidents.total>0?(d(),C(L,{key:0,title:e.$t("aiops.severityCard"),size:"small",style:{background:"var(--bg-card)","border-color":"var(--border-color)","margin-bottom":"20px"},"body-style":{padding:"12px 16px"}},{default:l(()=>[a($e,{size:[12,8],wrap:""},{default:l(()=>[(d(!0),v(R,null,J(k(pe),s=>(d(),C(N,{key:s,color:ae(s),style:{"font-size":"13px",padding:"2px 10px"}},{default:l(()=>[c(r(s)+": "+r(A.value.incidents.bySeverity[s]||0),1)]),_:2},1032,["color"]))),128)),z("span",gt,r(e.$t("aiops.avgResolveLabel",{time:Re(A.value.incidents.avgResolveMs)})),1)]),_:1})]),_:1},8,["title"])):y("",!0),a(Ve,{activeKey:K.value,"onUpdate:activeKey":o[2]||(o[2]=s=>K.value=s),class:"aiops-tabs"},{default:l(()=>[a(ie,{key:"incidents",tab:e.$t("aiops.tabs.incidents")},{default:l(()=>[z("div",kt,[a(le,{value:q.value,"onUpdate:value":o[0]||(o[0]=s=>q.value=s),size:"small","button-style":"solid"},{default:l(()=>[a(U,{value:""},{default:l(()=>[c(r(e.$t("aiops.filter.all")),1)]),_:1}),(d(!0),v(R,null,J(k(pe),s=>(d(),C(U,{key:s,value:s},{default:l(()=>[c(r(s),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"]),a(le,{value:D.value,"onUpdate:value":o[1]||(o[1]=s=>D.value=s),size:"small"},{default:l(()=>[a(U,{value:""},{default:l(()=>[c(r(e.$t("aiops.filter.allStatuses")),1)]),_:1}),(d(!0),v(R,null,J(k(st),s=>(d(),C(U,{key:s,value:s},{default:l(()=>[c(r(fe(s)),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),a(se,{columns:xe.value,"data-source":Ae.value,pagination:{pageSize:20,showTotal:s=>e.$t("aiops.table.totalSuffix",{n:s})},size:"small",loading:_.value,style:{background:"var(--bg-card)"}},{bodyCell:l(({column:s,record:p})=>[s.key==="severity"?(d(),C(N,{key:0,color:ae(p.severity),style:{"font-weight":"600"}},{default:l(()=>[c(r(p.severity),1)]),_:2},1032,["color"])):y("",!0),s.key==="metric"?(d(),v(R,{key:1},[p.anomalyMetric?(d(),v("span",_t,r(p.anomalyMetric),1)):(d(),v("span",$t,"—"))],64)):y("",!0),s.key==="description"?(d(),v("span",ht,r(ve(p.description,80)||"—"),1)):y("",!0),s.key==="status"?(d(),C(N,{key:3,color:Fe(p.status)},{default:l(()=>[c(r(fe(p.status)),1)]),_:2},1032,["color"])):y("",!0),s.key==="createdAt"?(d(),v("span",Ct,r(k(ce)(p.createdAt)),1)):y("",!0),s.key==="action"?(d(),v(R,{key:5},[p.status==="open"?(d(),C(u,{key:0,size:"small",type:"link",onClick:O=>Te(p)},{default:l(()=>[c(r(e.$t("aiops.incidentActions.ack")),1)]),_:1},8,["onClick"])):y("",!0),p.status==="open"||p.status==="acknowledged"?(d(),C(u,{key:1,size:"small",type:"link",onClick:O=>Ue(p)},{default:l(()=>[c(r(e.$t("aiops.incidentActions.resolve")),1)]),_:1},8,["onClick"])):y("",!0),p.status==="resolved"?(d(),C(u,{key:2,size:"small",type:"link",onClick:O=>qe(p)},{default:l(()=>[c(r(e.$t("aiops.incidentActions.close")),1)]),_:1},8,["onClick"])):y("",!0),p.status==="resolved"||p.status==="closed"?(d(),C(u,{key:3,size:"small",type:"link",onClick:O=>De(p)},{default:l(()=>[c(r(e.$t("aiops.incidentActions.postmortem")),1)]),_:1},8,["onClick"])):y("",!0)],64)):y("",!0)]),emptyText:l(()=>[z("div",xt,[a(k(re),{style:{"font-size":"36px","margin-bottom":"10px",display:"block"}}),c(" "+r(q.value||D.value?e.$t("aiops.table.incidentEmptyFiltered"):e.$t("aiops.table.incidentEmpty")),1)])]),_:1},8,["columns","data-source","pagination","loading"])]),_:1},8,["tab"]),a(ie,{key:"playbooks",tab:e.$t("aiops.tabs.playbooks")},{default:l(()=>[a(se,{columns:Se.value,"data-source":ye.value,pagination:{pageSize:20,showTotal:s=>e.$t("aiops.table.totalSuffix",{n:s})},size:"small",loading:_.value,style:{background:"var(--bg-card)"}},{bodyCell:l(({column:s,record:p})=>[s.key==="name"?(d(),v(R,{key:0},[z("span",St,r(p.name),1),p.triggerCondition?(d(),v("div",wt,r(ve(p.triggerCondition,80)),1)):y("",!0)],64)):y("",!0),s.key==="enabled"?(d(),C(Ke,{key:1,checked:p.enabled,size:"small",onChange:O=>Ee(p,O)},null,8,["checked","onChange"])):y("",!0),s.key==="stats"?(d(),v(R,{key:2},[a(N,{color:"green",style:{"font-size":"11px"}},{default:l(()=>[c(r(e.$t("aiops.table.successCount",{n:p.successCount})),1)]),_:2},1024),p.failureCount>0?(d(),C(N,{key:0,color:"red",style:{"font-size":"11px","margin-left":"4px"}},{default:l(()=>[c(r(e.$t("aiops.table.failureCount",{n:p.failureCount})),1)]),_:2},1024)):y("",!0)],64)):y("",!0),s.key==="createdAt"?(d(),v("span",zt,r(k(ce)(p.createdAt)),1)):y("",!0),s.key==="action"?(d(),v(R,{key:4},[a(u,{size:"small",type:"link",onClick:O=>be(p,"success")},{default:l(()=>[c(r(e.$t("aiops.playbookActions.success")),1)]),_:1},8,["onClick"]),a(u,{size:"small",type:"link",danger:"",onClick:O=>be(p,"failure")},{default:l(()=>[c(r(e.$t("aiops.playbookActions.failure")),1)]),_:1},8,["onClick"])],64)):y("",!0)]),emptyText:l(()=>[z("div",At,[a(k(ue),{style:{"font-size":"36px","margin-bottom":"10px",display:"block"}}),c(" "+r(e.$t("aiops.table.playbookEmpty")),1)])]),_:1},8,["columns","data-source","pagination","loading"])]),_:1},8,["tab"]),a(ie,{key:"baselines",tab:e.$t("aiops.tabs.baselines")},{default:l(()=>[a(se,{columns:we.value,"data-source":ee.value,pagination:{pageSize:20,showTotal:s=>e.$t("aiops.table.totalSuffix",{n:s})},size:"small",loading:_.value,style:{background:"var(--bg-card)"}},{bodyCell:l(({column:s,record:p})=>[s.key==="metric"?(d(),v("span",Ft,r(p.metricName),1)):y("",!0),s.key==="mean"?(d(),v(R,{key:1},[z("span",Pt,r(p.mean),1),z("span",Rt,"σ "+r(p.stdDev),1)],64)):y("",!0),s.key==="iqr"?(d(),v("span",jt," Q1 "+r(p.q1)+" / Q3 "+r(p.q3),1)):y("",!0),s.key==="sampleCount"?(d(),C(N,{key:3,color:"blue",style:{"font-size":"11px"}},{default:l(()=>[c(r(p.sampleCount),1)]),_:2},1024)):y("",!0),s.key==="updatedAt"?(d(),v("span",It,r(k(ce)(p.updatedAt)),1)):y("",!0)]),emptyText:l(()=>[z("div",Lt,[a(k(de),{style:{"font-size":"36px","margin-bottom":"10px",display:"block"}}),c(" "+r(e.$t("aiops.table.baselineEmpty")),1)])]),_:1},8,["columns","data-source","pagination","loading"])]),_:1},8,["tab"])]),_:1},8,["activeKey"]),a(G,{open:V.value,"onUpdate:open":o[6]||(o[6]=s=>V.value=s),title:e.$t("aiops.incident_modal.title"),"confirm-loading":S.value,width:520,"ok-text":e.$t("aiops.incident_modal.ok"),"cancel-text":e.$t("aiops.incident_modal.cancel"),onOk:Ie,onCancel:ge},{default:l(()=>[a(Z,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[a(P,{label:e.$t("aiops.incident_modal.severityLabel")},{default:l(()=>[a(Ce,{value:w.severity,"onUpdate:value":o[3]||(o[3]=s=>w.severity=s)},{default:l(()=>[(d(!0),v(R,null,J(k(pe),s=>(d(),C(he,{key:s,value:s},{default:l(()=>[c(r(s),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.incident_modal.metricLabel")},{default:l(()=>[a(ne,{value:w.metric,"onUpdate:value":o[4]||(o[4]=s=>w.metric=s),placeholder:e.$t("aiops.incident_modal.metricPlaceholder")},null,8,["value","placeholder"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.incident_modal.descLabel"),required:""},{default:l(()=>[a(W,{value:w.description,"onUpdate:value":o[5]||(o[5]=s=>w.description=s),"auto-size":{minRows:3,maxRows:6}},null,8,["value"])]),_:1},8,["label"])]),_:1})]),_:1},8,["open","title","confirm-loading","ok-text","cancel-text"]),a(G,{open:Q.value,"onUpdate:open":o[10]||(o[10]=s=>Q.value=s),title:e.$t("aiops.playbook_modal.title"),"confirm-loading":S.value,width:540,"ok-text":e.$t("aiops.playbook_modal.ok"),"cancel-text":e.$t("aiops.playbook_modal.cancel"),onOk:Le,onCancel:ke},{default:l(()=>[a(Z,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[a(P,{label:e.$t("aiops.playbook_modal.nameLabel"),required:""},{default:l(()=>[a(ne,{value:$.name,"onUpdate:value":o[7]||(o[7]=s=>$.name=s),placeholder:e.$t("aiops.playbook_modal.namePlaceholder")},null,8,["value","placeholder"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.playbook_modal.triggerLabel")},{default:l(()=>[a(W,{value:$.triggerJson,"onUpdate:value":o[8]||(o[8]=s=>$.triggerJson=s),placeholder:e.$t("aiops.playbook_modal.triggerPlaceholder"),"auto-size":{minRows:2,maxRows:4}},null,8,["value","placeholder"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.playbook_modal.stepsLabel")},{default:l(()=>[a(W,{value:$.stepsJson,"onUpdate:value":o[9]||(o[9]=s=>$.stepsJson=s),placeholder:e.$t("aiops.playbook_modal.stepsPlaceholder"),"auto-size":{minRows:3,maxRows:6}},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1})]),_:1},8,["open","title","confirm-loading","ok-text","cancel-text"]),a(G,{open:Y.value,"onUpdate:open":o[13]||(o[13]=s=>Y.value=s),title:e.$t("aiops.baseline_modal.title"),"confirm-loading":S.value,width:500,"ok-text":e.$t("aiops.baseline_modal.ok"),"cancel-text":e.$t("aiops.baseline_modal.cancel"),onOk:Ne,onCancel:_e},{default:l(()=>[a(Z,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[a(P,{label:e.$t("aiops.baseline_modal.metricLabel"),required:""},{default:l(()=>[a(ne,{value:I.metric,"onUpdate:value":o[11]||(o[11]=s=>I.metric=s),placeholder:e.$t("aiops.baseline_modal.metricPlaceholder")},null,8,["value","placeholder"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.baseline_modal.valuesLabel"),required:""},{default:l(()=>[a(W,{value:I.values,"onUpdate:value":o[12]||(o[12]=s=>I.values=s),placeholder:e.$t("aiops.baseline_modal.valuesPlaceholder"),"auto-size":{minRows:3,maxRows:8}},null,8,["value","placeholder"])]),_:1},8,["label"])]),_:1})]),_:1},8,["open","title","confirm-loading","ok-text","cancel-text"]),a(G,{open:te.value,"onUpdate:open":o[17]||(o[17]=s=>te.value=s),title:e.$t("aiops.detect_modal.title"),"confirm-loading":X.value,width:500,"ok-text":e.$t("aiops.detect_modal.ok"),"cancel-text":e.$t("aiops.detect_modal.cancel"),onOk:Oe},{default:l(()=>[a(Z,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[a(P,{label:e.$t("aiops.detect_modal.metricLabel"),required:""},{default:l(()=>[a(Ce,{value:F.metric,"onUpdate:value":o[14]||(o[14]=s=>F.metric=s),"show-search":"",placeholder:e.$t("aiops.detect_modal.metricPlaceholder")},{default:l(()=>[(d(!0),v(R,null,J(ee.value,s=>(d(),C(he,{key:s.metricName,value:s.metricName},{default:l(()=>[c(r(e.$t("aiops.detect_modal.metricOptionLabel",{name:s.metricName,count:s.sampleCount})),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","placeholder"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.detect_modal.valueLabel"),required:""},{default:l(()=>[a(Qe,{value:F.value,"onUpdate:value":o[15]||(o[15]=s=>F.value=s),style:{width:"100%"}},null,8,["value"])]),_:1},8,["label"]),a(P,{label:e.$t("aiops.detect_modal.algorithmLabel")},{default:l(()=>[a(le,{value:F.algorithm,"onUpdate:value":o[16]||(o[16]=s=>F.algorithm=s)},{default:l(()=>[a(U,{value:"z_score"},{default:l(()=>[...o[18]||(o[18]=[c("Z-Score (3σ)",-1)])]),_:1}),a(U,{value:"iqr"},{default:l(()=>[...o[19]||(o[19]=[c("IQR (1.5×)",-1)])]),_:1})]),_:1},8,["value"])]),_:1},8,["label"])]),_:1}),h.value?(d(),C(L,{key:0,size:"small",style:{background:"var(--bg-base)","margin-top":"8px"}},{default:l(()=>[a(T,{title:e.$t("aiops.detect_modal.resultTitle"),value:h.value.anomaly?e.$t("aiops.detect_modal.anomaly"):e.$t("aiops.detect_modal.normal"),"value-style":{color:h.value.anomaly?"#ff4d4f":"#52c41a"}},null,8,["title","value","value-style"]),h.value.reason&&!h.value.anomaly?(d(),v("div",Nt,r(e.$t("aiops.detect_modal.reasonLine",{reason:Pe(h.value.reason)})),1)):y("",!0),h.value.baseline?(d(),v("div",Ot,[z("div",null,r(e.$t("aiops.detect_modal.scoreLine",{score:h.value.score,threshold:h.value.threshold})),1),z("div",null,r(e.$t("aiops.detect_modal.baselineLine",{mean:h.value.baseline.mean,stdDev:h.value.baseline.stdDev})),1)])):y("",!0),h.value.incidentId?(d(),v("div",Tt,[a(N,{color:ae(h.value.severity)},{default:l(()=>[c(r(e.$t("aiops.detect_modal.incidentCreated",{severity:h.value.severity})),1)]),_:1},8,["color"])])):y("",!0)]),_:1})):y("",!0)]),_:1},8,["open","title","confirm-loading","ok-text","cancel-text"])])}}},ua=Ye(Ut,[["__scopeId","data-v-ecfcab22"]]);export{ua as default};
@@ -1 +1 @@
1
- import{O as b,f as i,v as p}from"./index-hmILMYKF.js";import{B as O,c as y}from"./index-Lwktngzr.js";import{e as m,s as r,d as P,o as R,c as x}from"./vendor-BXcBOG8b.js";const A=()=>{const n=r(!1);return m(()=>{n.value=!0}),n},D={type:{type:String},actionFn:Function,close:Function,autofocus:Boolean,prefixCls:String,buttonProps:p(),emitEvent:Boolean,quitOnNullishReturnValue:Boolean};function d(n){return!!(n&&n.then)}const j=P({compatConfig:{MODE:3},name:"ActionButton",props:D,setup(n,g){let{slots:B}=g;const l=r(!1),c=r(),a=r(!1);let f;const v=A();R(()=>{n.autofocus&&(f=setTimeout(()=>{var e,t;return(t=(e=b(c.value))===null||e===void 0?void 0:e.focus)===null||t===void 0?void 0:t.call(e)}))}),m(()=>{clearTimeout(f)});const u=function(){for(var e,t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];(e=n.close)===null||e===void 0||e.call(n,...o)},h=e=>{d(e)&&(a.value=!0,e.then(function(){v.value||(a.value=!1),u(...arguments),l.value=!1},t=>(v.value||(a.value=!1),l.value=!1,Promise.reject(t))))},C=e=>{const{actionFn:t}=n;if(l.value)return;if(l.value=!0,!t){u();return}let o;if(n.emitEvent){if(o=t(e),n.quitOnNullishReturnValue&&!d(o)){l.value=!1,u(e);return}}else if(t.length)o=t(n.close),l.value=!1;else if(o=t(),!o){u();return}h(o)};return()=>{const{type:e,prefixCls:t,buttonProps:o}=n;return x(O,i(i(i({},y(e)),{},{onClick:C,loading:a.value,prefixCls:t},o),{},{ref:c}),B)}}});export{j as A};
1
+ import{O as b,f as i,v as p}from"./index-Dzh9Ud2R.js";import{B as O,c as y}from"./index-DXip1xUj.js";import{e as m,s as r,d as P,o as R,c as x}from"./vendor-BXcBOG8b.js";const A=()=>{const n=r(!1);return m(()=>{n.value=!0}),n},D={type:{type:String},actionFn:Function,close:Function,autofocus:Boolean,prefixCls:String,buttonProps:p(),emitEvent:Boolean,quitOnNullishReturnValue:Boolean};function d(n){return!!(n&&n.then)}const j=P({compatConfig:{MODE:3},name:"ActionButton",props:D,setup(n,g){let{slots:B}=g;const l=r(!1),c=r(),a=r(!1);let f;const v=A();R(()=>{n.autofocus&&(f=setTimeout(()=>{var e,t;return(t=(e=b(c.value))===null||e===void 0?void 0:e.focus)===null||t===void 0?void 0:t.call(e)}))}),m(()=>{clearTimeout(f)});const u=function(){for(var e,t=arguments.length,o=new Array(t),s=0;s<t;s++)o[s]=arguments[s];(e=n.close)===null||e===void 0||e.call(n,...o)},h=e=>{d(e)&&(a.value=!0,e.then(function(){v.value||(a.value=!1),u(...arguments),l.value=!1},t=>(v.value||(a.value=!1),l.value=!1,Promise.reject(t))))},C=e=>{const{actionFn:t}=n;if(l.value)return;if(l.value=!0,!t){u();return}let o;if(n.emitEvent){if(o=t(e),n.quitOnNullishReturnValue&&!d(o)){l.value=!1,u(e);return}}else if(t.length)o=t(n.close),l.value=!1;else if(o=t(),!o){u();return}h(o)};return()=>{const{type:e,prefixCls:t,buttonProps:o}=n;return x(O,i(i(i({},y(e)),{},{onClick:C,loading:a.value,prefixCls:t},o),{},{ref:c}),B)}}});export{j as A};
@@ -1,3 +1,3 @@
1
- import{_ as fe,b as _e,u as ge,t as xe,d as I}from"./index-hmILMYKF.js";import{R as ee,a6 as te,i as ae,aD as Te,w as he,aR as oe}from"./icons-DlxlFL4g.js";import{w as be,o as we,M as v,R,P as r,u as n,c as a,N as o,r as g,K as x,a as Q,L as c,O as y,Q as z,S as T,F as Ce,f as W}from"./vendor-BXcBOG8b.js";const Se={style:{display:"flex","align-items":"center","justify-content":"space-between","margin-bottom":"24px"}},Ie={class:"page-title"},ze={class:"page-sub"},Re={style:{display:"flex","align-items":"center",gap:"12px"}},Me={key:0,style:{"text-align":"center",padding:"60px"}},Oe={key:1,style:{color:"#e0e0e0","font-family":"monospace","font-size":"12px"}},je={key:2,style:{color:"#faad14"}},Fe={key:3,style:{color:"var(--text-secondary)"}},Ne={key:0,style:{"text-align":"center",padding:"60px"}},Ue={key:0,style:{color:"var(--text-secondary)","font-size":"12px","font-family":"monospace"}},Ae={key:2,style:{color:"#e0e0e0","font-family":"monospace","font-size":"12px"}},Be={key:3,style:{color:"#faad14"}},Le={key:4,style:{color:"var(--text-secondary)"}},De={key:0,style:{"text-align":"center",padding:"40px"}},Pe={key:1,style:{color:"#e0e0e0","font-family":"monospace","font-size":"12px"}},Je={key:0,style:{"text-align":"center",padding:"40px"}},$e={__name:"Analytics",setup(Ee){const{t:l}=_e(),C=ge(),M=g("all"),U=g(!1),A=g(!1),B=g(!1),L=g(!1),D=g(!1),P=g(!1),J=g(20),f=Q({totalCalls:0,totalTokens:0,totalCost:0,avgResponseTime:0}),O=g([]),j=g([]),_=Q({entries:0,hits:0,tokensSaved:0,expired:0}),F=g(!1),b=Q({totalCalls:0,inputTokens:0,outputTokens:0,totalTokens:0}),q=g([]),se=W(()=>[{title:"Provider",key:"provider",dataIndex:"provider",width:"120px"},{title:"Model",key:"model",dataIndex:"model",ellipsis:!0},{title:l("analytics.sessionUsageColumns.calls"),key:"calls",dataIndex:"calls",width:"100px",sorter:(e,t)=>(e.calls||0)-(t.calls||0)},{title:"Input",key:"inputTokens",dataIndex:"inputTokens",width:"110px",sorter:(e,t)=>(e.inputTokens||0)-(t.inputTokens||0)},{title:"Output",key:"outputTokens",dataIndex:"outputTokens",width:"110px",sorter:(e,t)=>(e.outputTokens||0)-(t.outputTokens||0)},{title:"Total",key:"totalTokens",dataIndex:"totalTokens",width:"110px",sorter:(e,t)=>(e.totalTokens||0)-(t.totalTokens||0)}]),le=W(()=>[{title:"Provider",key:"provider",dataIndex:"provider",width:"120px",sorter:(e,t)=>(e.provider||"").localeCompare(t.provider||"")},{title:"Model",key:"model",dataIndex:"model",ellipsis:!0,sorter:(e,t)=>(e.model||"").localeCompare(t.model||"")},{title:l("analytics.breakdownColumns.calls"),key:"calls",dataIndex:"calls",width:"100px",sorter:(e,t)=>(e.calls||0)-(t.calls||0)},{title:l("analytics.breakdownColumns.inputTokens"),key:"inputTokens",dataIndex:"inputTokens",width:"120px",sorter:(e,t)=>(e.inputTokens||0)-(t.inputTokens||0)},{title:l("analytics.breakdownColumns.outputTokens"),key:"outputTokens",dataIndex:"outputTokens",width:"130px",sorter:(e,t)=>(e.outputTokens||0)-(t.outputTokens||0)},{title:l("analytics.breakdownColumns.totalTokens"),key:"totalTokens",dataIndex:"totalTokens",width:"120px",sorter:(e,t)=>(e.totalTokens||0)-(t.totalTokens||0)},{title:l("analytics.breakdownColumns.cost"),key:"cost",dataIndex:"cost",width:"110px",sorter:(e,t)=>(e.cost||0)-(t.cost||0)},{title:l("analytics.breakdownColumns.avgResponseTime"),key:"avgResponseTime",dataIndex:"avgResponseTime",width:"110px",sorter:(e,t)=>(e.avgResponseTime||0)-(t.avgResponseTime||0)}]),ne=W(()=>[{title:l("analytics.recentColumns.timestamp"),key:"timestamp",dataIndex:"timestamp",width:"180px"},{title:"Provider",key:"provider",dataIndex:"provider",width:"110px"},{title:"Model",key:"model",dataIndex:"model",ellipsis:!0},{title:l("analytics.recentColumns.input"),key:"inputTokens",dataIndex:"inputTokens",width:"90px"},{title:l("analytics.recentColumns.output"),key:"outputTokens",dataIndex:"outputTokens",width:"90px"},{title:l("analytics.recentColumns.cost"),key:"cost",dataIndex:"cost",width:"100px"},{title:l("analytics.recentColumns.responseTime"),key:"responseTime",dataIndex:"responseTime",width:"100px"}]);function w(e){return(e||"").replace(/,/g,"")}function S(e){return xe(e)}function re(e){const t=(e||"").split(`
1
+ import{_ as fe,b as _e,u as ge,t as xe,d as I}from"./index-Dzh9Ud2R.js";import{R as ee,a6 as te,i as ae,aD as Te,w as he,aR as oe}from"./icons-DlxlFL4g.js";import{w as be,o as we,M as v,R,P as r,u as n,c as a,N as o,r as g,K as x,a as Q,L as c,O as y,Q as z,S as T,F as Ce,f as W}from"./vendor-BXcBOG8b.js";const Se={style:{display:"flex","align-items":"center","justify-content":"space-between","margin-bottom":"24px"}},Ie={class:"page-title"},ze={class:"page-sub"},Re={style:{display:"flex","align-items":"center",gap:"12px"}},Me={key:0,style:{"text-align":"center",padding:"60px"}},Oe={key:1,style:{color:"#e0e0e0","font-family":"monospace","font-size":"12px"}},je={key:2,style:{color:"#faad14"}},Fe={key:3,style:{color:"var(--text-secondary)"}},Ne={key:0,style:{"text-align":"center",padding:"60px"}},Ue={key:0,style:{color:"var(--text-secondary)","font-size":"12px","font-family":"monospace"}},Ae={key:2,style:{color:"#e0e0e0","font-family":"monospace","font-size":"12px"}},Be={key:3,style:{color:"#faad14"}},Le={key:4,style:{color:"var(--text-secondary)"}},De={key:0,style:{"text-align":"center",padding:"40px"}},Pe={key:1,style:{color:"#e0e0e0","font-family":"monospace","font-size":"12px"}},Je={key:0,style:{"text-align":"center",padding:"40px"}},$e={__name:"Analytics",setup(Ee){const{t:l}=_e(),C=ge(),M=g("all"),U=g(!1),A=g(!1),B=g(!1),L=g(!1),D=g(!1),P=g(!1),J=g(20),f=Q({totalCalls:0,totalTokens:0,totalCost:0,avgResponseTime:0}),O=g([]),j=g([]),_=Q({entries:0,hits:0,tokensSaved:0,expired:0}),F=g(!1),b=Q({totalCalls:0,inputTokens:0,outputTokens:0,totalTokens:0}),q=g([]),se=W(()=>[{title:"Provider",key:"provider",dataIndex:"provider",width:"120px"},{title:"Model",key:"model",dataIndex:"model",ellipsis:!0},{title:l("analytics.sessionUsageColumns.calls"),key:"calls",dataIndex:"calls",width:"100px",sorter:(e,t)=>(e.calls||0)-(t.calls||0)},{title:"Input",key:"inputTokens",dataIndex:"inputTokens",width:"110px",sorter:(e,t)=>(e.inputTokens||0)-(t.inputTokens||0)},{title:"Output",key:"outputTokens",dataIndex:"outputTokens",width:"110px",sorter:(e,t)=>(e.outputTokens||0)-(t.outputTokens||0)},{title:"Total",key:"totalTokens",dataIndex:"totalTokens",width:"110px",sorter:(e,t)=>(e.totalTokens||0)-(t.totalTokens||0)}]),le=W(()=>[{title:"Provider",key:"provider",dataIndex:"provider",width:"120px",sorter:(e,t)=>(e.provider||"").localeCompare(t.provider||"")},{title:"Model",key:"model",dataIndex:"model",ellipsis:!0,sorter:(e,t)=>(e.model||"").localeCompare(t.model||"")},{title:l("analytics.breakdownColumns.calls"),key:"calls",dataIndex:"calls",width:"100px",sorter:(e,t)=>(e.calls||0)-(t.calls||0)},{title:l("analytics.breakdownColumns.inputTokens"),key:"inputTokens",dataIndex:"inputTokens",width:"120px",sorter:(e,t)=>(e.inputTokens||0)-(t.inputTokens||0)},{title:l("analytics.breakdownColumns.outputTokens"),key:"outputTokens",dataIndex:"outputTokens",width:"130px",sorter:(e,t)=>(e.outputTokens||0)-(t.outputTokens||0)},{title:l("analytics.breakdownColumns.totalTokens"),key:"totalTokens",dataIndex:"totalTokens",width:"120px",sorter:(e,t)=>(e.totalTokens||0)-(t.totalTokens||0)},{title:l("analytics.breakdownColumns.cost"),key:"cost",dataIndex:"cost",width:"110px",sorter:(e,t)=>(e.cost||0)-(t.cost||0)},{title:l("analytics.breakdownColumns.avgResponseTime"),key:"avgResponseTime",dataIndex:"avgResponseTime",width:"110px",sorter:(e,t)=>(e.avgResponseTime||0)-(t.avgResponseTime||0)}]),ne=W(()=>[{title:l("analytics.recentColumns.timestamp"),key:"timestamp",dataIndex:"timestamp",width:"180px"},{title:"Provider",key:"provider",dataIndex:"provider",width:"110px"},{title:"Model",key:"model",dataIndex:"model",ellipsis:!0},{title:l("analytics.recentColumns.input"),key:"inputTokens",dataIndex:"inputTokens",width:"90px"},{title:l("analytics.recentColumns.output"),key:"outputTokens",dataIndex:"outputTokens",width:"90px"},{title:l("analytics.recentColumns.cost"),key:"cost",dataIndex:"cost",width:"100px"},{title:l("analytics.recentColumns.responseTime"),key:"responseTime",dataIndex:"responseTime",width:"100px"}]);function w(e){return(e||"").replace(/,/g,"")}function S(e){return xe(e)}function re(e){const t=(e||"").split(`
2
2
  `);for(const s of t){const u=s.trim(),h=u.match(/total\s*calls?\s*[::]\s*([\d,]+)/i);h&&(f.totalCalls=parseInt(w(h[1]),10)||0);const d=u.match(/total\s*tokens?\s*[::]\s*([\d,]+)/i);d&&(f.totalTokens=parseInt(w(d[1]),10)||0);const k=u.match(/cost\s*[::]\s*\$?([\d,.]+)/i);k&&(f.totalCost=parseFloat(w(k[1]))||0);const p=u.match(/(?:avg|average)\s*(?:response\s*)?time\s*[::]\s*([\d,.]+)/i);p&&(f.avgResponseTime=parseFloat(w(p[1]))||0)}}function ie(e){f.totalCalls=e.totalCalls??e.total_calls??e.calls??0,f.totalTokens=e.totalTokens??e.total_tokens??e.tokens??0,f.totalCost=e.totalCost??e.total_cost??e.cost??0,f.avgResponseTime=e.avgResponseTime??e.avg_response_time??e.avgTime??0}function ce(e){return(Array.isArray(e)?e:e.breakdown||e.providers||e.rows||[]).map((s,u)=>({key:u,provider:s.provider||"-",model:s.model||"-",calls:s.calls||s.count||0,inputTokens:s.inputTokens??s.input_tokens??0,outputTokens:s.outputTokens??s.output_tokens??0,totalTokens:s.totalTokens??s.total_tokens??(s.inputTokens??0)+(s.outputTokens??0),cost:s.cost??s.total_cost??0,avgResponseTime:s.avgResponseTime??s.avg_response_time??0}))}function ue(e){return(Array.isArray(e)?e:e.recent||e.records||e.rows||[]).map((s,u)=>({key:u,timestamp:s.timestamp||s.time||s.created_at||"-",provider:s.provider||"-",model:s.model||"-",inputTokens:s.inputTokens??s.input_tokens??0,outputTokens:s.outputTokens??s.output_tokens??0,cost:s.cost??0,responseTime:s.responseTime??s.response_time??0}))}function de(e){_.entries=e.entries??e.count??e.size??0,_.hits=e.hits??e.cacheHits??e.cache_hits??0,_.tokensSaved=e.tokensSaved??e.tokens_saved??0,_.expired=e.expired??e.expiredCount??e.expired_count??0}function pe(e){const t=(e||"").split(`
3
3
  `);for(const s of t){const u=s.trim(),h=u.match(/entries?\s*[::]\s*([\d,]+)/i);h&&(_.entries=parseInt(w(h[1]),10)||0);const d=u.match(/hits?\s*[::]\s*([\d,]+)/i);d&&(_.hits=parseInt(w(d[1]),10)||0);const k=u.match(/(?:tokens?\s*)?saved\s*[::]\s*([\d,]+)/i);k&&(_.tokensSaved=parseInt(w(k[1]),10)||0);const p=u.match(/expired?\s*[::]\s*([\d,]+)/i);p&&(_.expired=parseInt(w(p[1]),10)||0)}}async function G(){U.value=!0;try{const{output:e}=await C.execute(`tokens show --period ${M.value} --json`,15e3),t=S(e);t?ie(t):re(e)}catch(e){console.error("loadSummary failed:",e)}finally{U.value=!1}}async function ye(){A.value=!0;try{const{output:e}=await C.execute("tokens breakdown --json",15e3),t=S(e);t?O.value=ce(t):O.value=[]}catch(e){console.error("loadBreakdown failed:",e),O.value=[]}finally{A.value=!1}}async function X(){B.value=!0;try{const{output:e}=await C.execute(`tokens recent --limit ${J.value} --json`,15e3),t=S(e);t?j.value=ue(t):j.value=[]}catch(e){console.error("loadRecent failed:",e),j.value=[]}finally{B.value=!1}}async function $(){L.value=!0;try{const{output:e}=await C.execute("tokens cache --json",15e3),t=S(e);t?de(t):pe(e)}catch(e){console.error("loadCache failed:",e)}finally{L.value=!1}}async function ke(){D.value=!0;try{const{output:e}=await C.execute("tokens cache --clear --json",15e3),t=S(e);t&&t.error?I.error(l("analytics.messages.cacheClearFailed",{err:t.error})):(I.success(l("analytics.messages.cacheClearOk")),await $())}catch(e){I.error(l("analytics.messages.cacheClearFailed",{err:e.message}))}finally{D.value=!1}}async function ve(){P.value=!0;try{const{output:e}=await C.execute("tokens cache --cleanup --json",15e3),t=S(e);t&&t.error?I.error(l("analytics.messages.cacheCleanupFailed",{err:t.error})):(I.success(l("analytics.messages.cacheCleanupOk")),await $())}catch(e){I.error(l("analytics.messages.cacheCleanupFailed",{err:e.message}))}finally{P.value=!1}}async function Y(){F.value=!0;try{const e=await C.sendRaw({type:"usage.global",limit:1e3},15e3);if(e.ok&&e.usage){const t=e.usage.total||{};b.totalCalls=t.calls??0,b.inputTokens=t.inputTokens??t.input_tokens??0,b.outputTokens=t.outputTokens??t.output_tokens??0,b.totalTokens=t.totalTokens??t.total_tokens??0,q.value=(e.usage.byModel||[]).map((s,u)=>({key:u,provider:s.provider||"-",model:s.model||"-",calls:s.calls??0,inputTokens:s.inputTokens??s.input_tokens??0,outputTokens:s.outputTokens??s.output_tokens??0,totalTokens:s.totalTokens??s.total_tokens??0}))}}catch(e){console.warn("loadSessionUsage failed (route may not be available):",e.message)}finally{F.value=!1}}async function Z(){await Promise.all([G(),ye(),X(),$(),Y()])}return be(M,()=>{G()}),we(Z),(e,t)=>{const s=x("a-radio-button"),u=x("a-radio-group"),h=x("a-button"),d=x("a-statistic"),k=x("a-card"),p=x("a-col"),E=x("a-row"),N=x("a-spin"),V=x("a-tag"),H=x("a-empty"),K=x("a-table"),me=x("a-space");return c(),v("div",null,[R("div",Se,[R("div",null,[R("h2",Ie,r(n(l)("analytics.title")),1),R("p",ze,r(n(l)("analytics.subtitle")),1)]),R("div",Re,[a(u,{value:M.value,"onUpdate:value":t[0]||(t[0]=i=>M.value=i),"button-style":"solid",size:"small"},{default:o(()=>[a(s,{value:"today"},{default:o(()=>[y(r(n(l)("analytics.period.today")),1)]),_:1}),a(s,{value:"week"},{default:o(()=>[y(r(n(l)("analytics.period.week")),1)]),_:1}),a(s,{value:"month"},{default:o(()=>[y(r(n(l)("analytics.period.month")),1)]),_:1}),a(s,{value:"all"},{default:o(()=>[y(r(n(l)("analytics.period.all")),1)]),_:1})]),_:1},8,["value"]),a(h,{type:"primary",ghost:"",loading:U.value,onClick:Z},{icon:o(()=>[a(n(ee))]),default:o(()=>[y(" "+r(n(l)("analytics.refresh")),1)]),_:1},8,["loading"])])]),a(E,{gutter:[16,16],style:{"margin-bottom":"20px"}},{default:o(()=>[a(p,{xs:24,sm:12,lg:6},{default:o(()=>[a(k,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:o(()=>[a(d,{title:n(l)("analytics.summary.totalCalls"),value:f.totalCalls,"value-style":{color:"#1677ff",fontSize:"20px"}},{prefix:o(()=>[a(n(te))]),suffix:o(()=>[y(r(n(l)("analytics.summary.callsSuffix")),1)]),_:1},8,["title","value"])]),_:1})]),_:1}),a(p,{xs:24,sm:12,lg:6},{default:o(()=>[a(k,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:o(()=>[a(d,{title:n(l)("analytics.summary.totalTokens"),value:f.totalTokens,"value-style":{color:"#52c41a",fontSize:"20px"}},{prefix:o(()=>[a(n(ae))]),_:1},8,["title","value"])]),_:1})]),_:1}),a(p,{xs:24,sm:12,lg:6},{default:o(()=>[a(k,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:o(()=>[a(d,{title:n(l)("analytics.summary.totalCost"),value:f.totalCost,precision:4,"value-style":{color:"#faad14",fontSize:"20px"}},{prefix:o(()=>[a(n(Te))]),suffix:o(()=>[...t[2]||(t[2]=[y("USD",-1)])]),_:1},8,["title","value"])]),_:1})]),_:1}),a(p,{xs:24,sm:12,lg:6},{default:o(()=>[a(k,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:o(()=>[a(d,{title:n(l)("analytics.summary.avgResponseTime"),value:f.avgResponseTime,"value-style":{color:"#722ed1",fontSize:"20px"}},{prefix:o(()=>[a(n(ae))]),suffix:o(()=>[...t[3]||(t[3]=[y("ms",-1)])]),_:1},8,["title","value"])]),_:1})]),_:1})]),_:1}),a(k,{title:n(l)("analytics.providerCardTitle"),style:{background:"var(--bg-card)","border-color":"var(--border-color)","margin-bottom":"20px"}},{default:o(()=>[A.value?(c(),v("div",Me,[a(N,{size:"large"})])):(c(),z(K,{key:1,columns:le.value,"data-source":O.value,pagination:{pageSize:20,showTotal:i=>n(l)("analytics.totals.rows",{count:i})},size:"small",style:{background:"var(--bg-card)"},"row-class-name":()=>"analytics-row"},{bodyCell:o(({column:i,record:m})=>[i.key==="provider"?(c(),z(V,{key:0,color:"blue"},{default:o(()=>[y(r(m.provider),1)]),_:2},1024)):T("",!0),i.key==="model"?(c(),v("span",Oe,r(m.model),1)):T("",!0),i.key==="cost"?(c(),v("span",je,"$"+r((m.cost||0).toFixed(4)),1)):T("",!0),i.key==="avgResponseTime"?(c(),v("span",Fe,r(m.avgResponseTime||0)+" ms",1)):T("",!0)]),emptyText:o(()=>[a(H,{description:n(l)("analytics.providerEmpty")},null,8,["description"])]),_:1},8,["columns","data-source","pagination"]))]),_:1},8,["title"]),a(k,{title:n(l)("analytics.recentCardTitle"),style:{background:"var(--bg-card)","border-color":"var(--border-color)","margin-bottom":"20px"}},{extra:o(()=>[a(u,{value:J.value,"onUpdate:value":t[1]||(t[1]=i=>J.value=i),size:"small",onChange:X},{default:o(()=>[a(s,{value:10},{default:o(()=>[...t[4]||(t[4]=[y("10",-1)])]),_:1}),a(s,{value:20},{default:o(()=>[...t[5]||(t[5]=[y("20",-1)])]),_:1}),a(s,{value:50},{default:o(()=>[...t[6]||(t[6]=[y("50",-1)])]),_:1})]),_:1},8,["value"])]),default:o(()=>[B.value?(c(),v("div",Ne,[a(N,{size:"large"})])):(c(),z(K,{key:1,columns:ne.value,"data-source":j.value,pagination:{pageSize:20,showTotal:i=>n(l)("analytics.totals.rows",{count:i})},size:"small",style:{background:"var(--bg-card)"},"row-class-name":()=>"analytics-row"},{bodyCell:o(({column:i,record:m})=>[i.key==="timestamp"?(c(),v("span",Ue,r(m.timestamp),1)):T("",!0),i.key==="provider"?(c(),z(V,{key:1,color:"blue"},{default:o(()=>[y(r(m.provider),1)]),_:2},1024)):T("",!0),i.key==="model"?(c(),v("span",Ae,r(m.model),1)):T("",!0),i.key==="cost"?(c(),v("span",Be,"$"+r((m.cost||0).toFixed(4)),1)):T("",!0),i.key==="responseTime"?(c(),v("span",Le,r(m.responseTime||0)+" ms",1)):T("",!0)]),emptyText:o(()=>[a(H,{description:n(l)("analytics.recentEmpty")},null,8,["description"])]),_:1},8,["columns","data-source","pagination"]))]),_:1},8,["title"]),a(k,{title:n(l)("analytics.sessionCardTitle"),style:{background:"var(--bg-card)","border-color":"var(--border-color)","margin-bottom":"20px"}},{extra:o(()=>[a(h,{size:"small",loading:F.value,onClick:Y,style:{background:"var(--bg-card-hover)","border-color":"var(--border-color)"}},{icon:o(()=>[a(n(ee))]),default:o(()=>[y(" "+r(n(l)("analytics.refresh")),1)]),_:1},8,["loading"])]),default:o(()=>[F.value?(c(),v("div",De,[a(N)])):(c(),v(Ce,{key:1},[a(E,{gutter:[16,16],style:{"margin-bottom":"16px"}},{default:o(()=>[a(p,{xs:12,sm:6},{default:o(()=>[a(d,{title:n(l)("analytics.sessionStats.totalCalls"),value:b.totalCalls,"value-style":{color:"#1677ff",fontSize:"18px"}},{prefix:o(()=>[a(n(te))]),_:1},8,["title","value"])]),_:1}),a(p,{xs:12,sm:6},{default:o(()=>[a(d,{title:n(l)("analytics.sessionStats.inputTokens"),value:b.inputTokens,"value-style":{color:"#52c41a",fontSize:"18px"}},null,8,["title","value"])]),_:1}),a(p,{xs:12,sm:6},{default:o(()=>[a(d,{title:n(l)("analytics.sessionStats.outputTokens"),value:b.outputTokens,"value-style":{color:"#faad14",fontSize:"18px"}},null,8,["title","value"])]),_:1}),a(p,{xs:12,sm:6},{default:o(()=>[a(d,{title:n(l)("analytics.sessionStats.totalTokens"),value:b.totalTokens,"value-style":{color:"#722ed1",fontSize:"18px"}},null,8,["title","value"])]),_:1})]),_:1}),a(K,{columns:se.value,"data-source":q.value,pagination:!1,size:"small",style:{background:"var(--bg-card)"},"row-class-name":()=>"analytics-row"},{bodyCell:o(({column:i,record:m})=>[i.key==="provider"?(c(),z(V,{key:0,color:"blue"},{default:o(()=>[y(r(m.provider),1)]),_:2},1024)):T("",!0),i.key==="model"?(c(),v("span",Pe,r(m.model),1)):T("",!0)]),emptyText:o(()=>[a(H,{description:n(l)("analytics.sessionEmpty")},null,8,["description"])]),_:1},8,["columns","data-source"])],64))]),_:1},8,["title"]),a(k,{title:n(l)("analytics.cacheCardTitle"),style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{extra:o(()=>[a(me,null,{default:o(()=>[a(h,{size:"small",loading:P.value,onClick:ve,style:{background:"var(--bg-card-hover)","border-color":"var(--border-color)"}},{icon:o(()=>[a(n(oe))]),default:o(()=>[y(" "+r(n(l)("analytics.cacheActions.cleanup")),1)]),_:1},8,["loading"]),a(h,{size:"small",danger:"",loading:D.value,onClick:ke,style:{"border-color":"var(--border-color)"}},{icon:o(()=>[a(n(oe))]),default:o(()=>[y(" "+r(n(l)("analytics.cacheActions.clear")),1)]),_:1},8,["loading"])]),_:1})]),default:o(()=>[L.value?(c(),v("div",Je,[a(N)])):(c(),z(E,{key:1,gutter:[16,16]},{default:o(()=>[a(p,{xs:12,sm:6},{default:o(()=>[a(d,{title:n(l)("analytics.cacheStats.entries"),value:_.entries,"value-style":{color:"#1677ff",fontSize:"18px"}},{prefix:o(()=>[a(n(he))]),_:1},8,["title","value"])]),_:1}),a(p,{xs:12,sm:6},{default:o(()=>[a(d,{title:n(l)("analytics.cacheStats.hits"),value:_.hits,"value-style":{color:"#52c41a",fontSize:"18px"}},null,8,["title","value"])]),_:1}),a(p,{xs:12,sm:6},{default:o(()=>[a(d,{title:n(l)("analytics.cacheStats.tokensSaved"),value:_.tokensSaved,"value-style":{color:"#faad14",fontSize:"18px"}},null,8,["title","value"])]),_:1}),a(p,{xs:12,sm:6},{default:o(()=>[a(d,{title:n(l)("analytics.cacheStats.expired"),value:_.expired,"value-style":{color:"#ff4d4f",fontSize:"18px"}},null,8,["title","value"])]),_:1})]),_:1}))]),_:1},8,["title"])])}}},Qe=fe($e,[["__scopeId","data-v-c636a5e0"]]);export{Qe as default};