chainlesschain 0.164.0 → 0.165.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +248 -2
- package/package.json +7 -4
- package/src/assets/web-panel/.build-hash +1 -1
- package/src/assets/web-panel/assets/{AIOps-D2MEn7fI.js → AIOps-lS1R0Cza.js} +1 -1
- package/src/assets/web-panel/assets/{ActionButton-lCW_4Gf0.js → ActionButton-BmlgBPsj.js} +1 -1
- package/src/assets/web-panel/assets/{Analytics-Bs7i-nsS.js → Analytics-CNKczv1S.js} +3 -3
- package/src/assets/web-panel/assets/{AppLayout-CK7B6S_j.js → AppLayout-BuZGJARQ.js} +5 -5
- package/src/assets/web-panel/assets/{Artifacts-C8ILjpyo.js → Artifacts-Dm73Sl-O.js} +1 -1
- package/src/assets/web-panel/assets/{Audit-Bb9cNaWc.js → Audit-BGMW7A5e.js} +1 -1
- package/src/assets/web-panel/assets/{BackgroundAgents-sC9ooXIf.js → BackgroundAgents-BQ6M54JR.js} +1 -1
- package/src/assets/web-panel/assets/{Backup-D-DrsplT.js → Backup-DBzGP0bR.js} +1 -1
- package/src/assets/web-panel/assets/{BaseInput-uCNZpwSK.js → BaseInput-D1mLCoOV.js} +1 -1
- package/src/assets/web-panel/assets/{Chat-CsDK1uE9.js → Chat-BUfcN7p8.js} +6 -6
- package/src/assets/web-panel/assets/{ChatBubbleRenderer-OqSDt50w.js → ChatBubbleRenderer-CY5m8ZHg.js} +1 -1
- package/src/assets/web-panel/assets/{Checkbox-JhTXM1-K.js → Checkbox-Du0Yg5Pi.js} +1 -1
- package/src/assets/web-panel/assets/{Codegen-BbzZLnyD.js → Codegen-B2RXziHW.js} +1 -1
- package/src/assets/web-panel/assets/{Col-D4VW4m4j.js → Col-DWhekOrR.js} +1 -1
- package/src/assets/web-panel/assets/{Community-BXrYawxV.js → Community-HQhrkon4.js} +1 -1
- package/src/assets/web-panel/assets/{Compact-DCihGy1u.js → Compact-izHNb4uz.js} +1 -1
- package/src/assets/web-panel/assets/{Compliance-DlyZ-lk8.js → Compliance-BDwLy41-.js} +1 -1
- package/src/assets/web-panel/assets/{Cowork-DvGZrhbO.js → Cowork-DFJhLa7K.js} +3 -3
- package/src/assets/web-panel/assets/{Cron-DUncZi8h.js → Cron-DYY9RG7-.js} +2 -2
- package/src/assets/web-panel/assets/{Crosschain-C_hLuUcm.js → Crosschain-rr7tJTtv.js} +1 -1
- package/src/assets/web-panel/assets/{DID-b6YSUqxr.js → DID-D2sfHRLi.js} +2 -2
- package/src/assets/web-panel/assets/{Dashboard-uvM15Cfb.js → Dashboard-q_eGdhha.js} +2 -2
- package/src/assets/web-panel/assets/{Dropdown-D1-Nd4qY.js → Dropdown-Cufrh2Bz.js} +1 -1
- package/src/assets/web-panel/assets/{EmailListRenderer-8ApvL6Zc.js → EmailListRenderer-B-kdv10f.js} +1 -1
- package/src/assets/web-panel/assets/{FamilyGuardDashboard-LYJt8811.js → FamilyGuardDashboard-D21XjgfG.js} +1 -1
- package/src/assets/web-panel/assets/{Federation-BbI3HGpv.js → Federation-CAwRTLZH.js} +1 -1
- package/src/assets/web-panel/assets/{FormItemContext-DSoEKuFu.js → FormItemContext-vx3daNDF.js} +1 -1
- package/src/assets/web-panel/assets/{GenericCardRenderer-B0S9OWd5.js → GenericCardRenderer-CRWY2wU4.js} +1 -1
- package/src/assets/web-panel/assets/{Git-DIs9Zhf3.js → Git-Q6SwauyD.js} +2 -2
- package/src/assets/web-panel/assets/{Governance-jzZXrxcl.js → Governance-BJ1q4IQZ.js} +1 -1
- package/src/assets/web-panel/assets/{Inference-JUPjf2ZI.js → Inference-CSWjROgD.js} +1 -1
- package/src/assets/web-panel/assets/{KnowledgeGraph-DxnfJvlP.js → KnowledgeGraph-fzuQsWuY.js} +1 -1
- package/src/assets/web-panel/assets/{Logs-iXiz8BEE.js → Logs-DVF8Mnns.js} +2 -2
- package/src/assets/web-panel/assets/MarkdownRenderer-BLif4QSg.js +1 -0
- package/src/assets/web-panel/assets/{Marketplace-Y3Xch312.js → Marketplace-BQP7LOA4.js} +1 -1
- package/src/assets/web-panel/assets/{McpTools-D7kGGbO7.js → McpTools-BNlJCmNc.js} +4 -4
- package/src/assets/web-panel/assets/{Memory-Do_hVxzh.js → Memory-DLLg5WQ4.js} +2 -2
- package/src/assets/web-panel/assets/{MobileBridge-CtrR0Tas.js → MobileBridge-CR2skNAF.js} +1 -1
- package/src/assets/web-panel/assets/MobileProjects-BxVavObl.js +1 -0
- package/src/assets/web-panel/assets/{Mtc-qo5QCTGd.js → Mtc-B17pgqMI.js} +4 -4
- package/src/assets/web-panel/assets/{MtcAudit-cq5mnjYj.js → MtcAudit-4UmV5cIL.js} +2 -2
- package/src/assets/web-panel/assets/{Multisig-Bq0MAQHw.js → Multisig-DoMEXEcU.js} +3 -3
- package/src/assets/web-panel/assets/{NLProgramming-DdWE6Vi2.js → NLProgramming-h9DMXFX4.js} +1 -1
- package/src/assets/web-panel/assets/{Notes-BxMBFcIp.js → Notes-Cihn-xX8.js} +3 -3
- package/src/assets/web-panel/assets/{NotificationSettings-RTrAcbUe.js → NotificationSettings-BE6ZGa3R.js} +1 -1
- package/src/assets/web-panel/assets/{OrderTableRenderer-DJbpGqzT.js → OrderTableRenderer-CnwojoSI.js} +1 -1
- package/src/assets/web-panel/assets/{Organization-SQzIPdqC.js → Organization-B2vpwmjb.js} +4 -4
- package/src/assets/web-panel/assets/{Overflow-02yECh22.js → Overflow-C4z28R0-.js} +1 -1
- package/src/assets/web-panel/assets/{P2P-BNg4pNCM.js → P2P-BVlFkwhW.js} +2 -2
- package/src/assets/web-panel/assets/{PdhVaultBrowser-BxPJZsD3.js → PdhVaultBrowser-BXbEdL5B.js} +3 -3
- package/src/assets/web-panel/assets/{Permissions-CLnDnPAz.js → Permissions-C28xs4lp.js} +4 -4
- package/src/assets/web-panel/assets/{PersonalDataHub-C5m0AjGf.js → PersonalDataHub-Dgl_rBjM.js} +4 -4
- package/src/assets/web-panel/assets/{Pipeline-VwOf5Dhv.js → Pipeline-3QUIhrKI.js} +1 -1
- package/src/assets/web-panel/assets/{Privacy-CC0W2hZd.js → Privacy-8Gh33OZ5.js} +1 -1
- package/src/assets/web-panel/assets/{ProjectInit-Dz893Bob.js → ProjectInit-BNmg4tZi.js} +2 -2
- package/src/assets/web-panel/assets/{ProjectSettings-CxQkvl0k.js → ProjectSettings-vgMfeCf9.js} +2 -2
- package/src/assets/web-panel/assets/Projects-BhtAVilc.js +1 -0
- package/src/assets/web-panel/assets/{Providers-DeB9IkxK.js → Providers-CXoOa8eX.js} +1 -1
- package/src/assets/web-panel/assets/{QrScannerModal-OCeoaswn.js → QrScannerModal-BhfTF0oS.js} +1 -1
- package/src/assets/web-panel/assets/{QuickAsk-DenotaAj.js → QuickAsk-C746HEAj.js} +1 -1
- package/src/assets/web-panel/assets/{Recommend-Cies_jjI.js → Recommend-BSej8Eo0.js} +1 -1
- package/src/assets/web-panel/assets/RemoteSession-f3gmnlG3.js +5 -0
- package/src/assets/web-panel/assets/{Reputation-CW0mvxgZ.js → Reputation-CyvybpkN.js} +1 -1
- package/src/assets/web-panel/assets/{Row-SEd32qZU.js → Row-DwV2PeYn.js} +1 -1
- package/src/assets/web-panel/assets/{RssFeed-BSwnJ3Lm.js → RssFeed-11GrzjZy.js} +3 -3
- package/src/assets/web-panel/assets/{Search-xe2m8bkC.js → Search-BjKXkrAY.js} +1 -1
- package/src/assets/web-panel/assets/{Security-Mq2F9Nro.js → Security-eWiFb9Yk.js} +4 -4
- package/src/assets/web-panel/assets/{Services-BKGw2V3P.js → Services-CdCsMAtt.js} +2 -2
- package/src/assets/web-panel/assets/{Skeleton-DW95-Rxf.js → Skeleton-4Q2UTKQ5.js} +1 -1
- package/src/assets/web-panel/assets/{Skills-CHgChCv_.js → Skills-v4rtYrRj.js} +1 -1
- package/src/assets/web-panel/assets/{Sla-tKh6k3R7.js → Sla-CRhsFvd_.js} +1 -1
- package/src/assets/web-panel/assets/SpeechSettings-DLjKsDVu.js +1 -0
- package/src/assets/web-panel/assets/{SyncSettings-D0Fw8fVL.js → SyncSettings-D16zonl7.js} +2 -2
- package/src/assets/web-panel/assets/{Tasks-20x1GB3D.js → Tasks-Xxozz0i_.js} +1 -1
- package/src/assets/web-panel/assets/{Templates-DJ-lts-a.js → Templates-CXJpPtCT.js} +1 -1
- package/src/assets/web-panel/assets/{Tenant-BFdGpbs7.js → Tenant-XRV0L1ZF.js} +1 -1
- package/src/assets/web-panel/assets/{Terminal-Xpx61vHL.js → Terminal-CYuO1i_w.js} +2 -2
- package/src/assets/web-panel/assets/{TimelineRenderer-C6UIvyZQ.js → TimelineRenderer-BXqitWsu.js} +1 -1
- package/src/assets/web-panel/assets/{Tokens-Dellq08f.js → Tokens-BvPrDHIy.js} +1 -1
- package/src/assets/web-panel/assets/{Trigger-VKw8d0J-.js → Trigger-DhCrSTf5.js} +1 -1
- package/src/assets/web-panel/assets/{Trust-DNftdKT5.js → Trust-DmsuZD6K.js} +1 -1
- package/src/assets/web-panel/assets/{UkeySign-DX9VAKJI.js → UkeySign-D_yrts5C.js} +1 -1
- package/src/assets/web-panel/assets/{VideoEditing-B2h3jO8q.js → VideoEditing-B01ihPrm.js} +1 -1
- package/src/assets/web-panel/assets/{Wallet-CjGkof7f.js → Wallet-DpUjKa-N.js} +4 -4
- package/src/assets/web-panel/assets/{WebAuthn-2Zfcu55P.js → WebAuthn-CL07yON6.js} +4 -4
- package/src/assets/web-panel/assets/{WorkflowEditor-B9eZ8UxZ.js → WorkflowEditor-CLMflnRr.js} +1 -1
- package/src/assets/web-panel/assets/{chat-CQNfD-YO.js → chat-DtUqe8h_.js} +1 -1
- package/src/assets/web-panel/assets/{colors-D4usyFT2.js → colors-DPKrgVfy.js} +1 -1
- package/src/assets/web-panel/assets/{compact-item-s4TpjvjX.js → compact-item-BTt2GtOm.js} +1 -1
- package/src/assets/web-panel/assets/{createContext-BRCSvYxj.js → createContext-D_VeUc1J.js} +1 -1
- package/src/assets/web-panel/assets/devWarning-Bj5nUW2v.js +1 -0
- package/src/assets/web-panel/assets/{hasIn-AdkUbkV-.js → hasIn-1kndiylj.js} +1 -1
- package/src/assets/web-panel/assets/{index-BIoG5yYf.js → index-2eyAXE3d.js} +1 -1
- package/src/assets/web-panel/assets/{index-nXyk8GZ9.js → index-4bna2_SR.js} +1 -1
- package/src/assets/web-panel/assets/{index-B2V-eKfK.js → index-8nz_fmlj.js} +1 -1
- package/src/assets/web-panel/assets/{index-D_XBHopw.js → index-B9KvcS7R.js} +1 -1
- package/src/assets/web-panel/assets/{index-s_buFMEG.js → index-BAXfRKfG.js} +1 -1
- package/src/assets/web-panel/assets/{index-DZT36ZYq.js → index-BHpBMWCh.js} +1 -1
- package/src/assets/web-panel/assets/{index-BMcimU-2.js → index-BaZAbw9A.js} +1 -1
- package/src/assets/web-panel/assets/{index-DzRjHxEv.js → index-BepLZwgB.js} +1 -1
- package/src/assets/web-panel/assets/{index--00U6vXZ.js → index-Bhudc_Ez.js} +1 -1
- package/src/assets/web-panel/assets/{index-C7Y8Aluc.js → index-BlDNVgBt.js} +1 -1
- package/src/assets/web-panel/assets/{index-BtobShro.js → index-By5n8up9.js} +1 -1
- package/src/assets/web-panel/assets/{index-Cvyt-zhm.js → index-CHG-KcS4.js} +1 -1
- package/src/assets/web-panel/assets/index-CPcM-eqo.js +1 -0
- package/src/assets/web-panel/assets/{index-MMN9V6JF.js → index-CX81qSM4.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bad4VNvz.js → index-CauoBQkH.js} +1 -1
- package/src/assets/web-panel/assets/{index-CCsM_Ybx.js → index-CcO04eDn.js} +1 -1
- package/src/assets/web-panel/assets/{index-DARsAyUp.js → index-CtF7EN49.js} +1 -1
- package/src/assets/web-panel/assets/{index-C5KAQFPQ.js → index-CzjkKUmR.js} +1 -1
- package/src/assets/web-panel/assets/{index-RfMr79MW.js → index-D95OFht7.js} +1 -1
- package/src/assets/web-panel/assets/{index-DdCB70SS.js → index-DFIZ_1Sf.js} +1 -1
- package/src/assets/web-panel/assets/{index-CYdoQsa1.js → index-DG2MZQ3f.js} +1 -1
- package/src/assets/web-panel/assets/{index-BPhkFZ1I.js → index-DJ8vXGOa.js} +1 -1
- package/src/assets/web-panel/assets/{index-_IRVsV9X.js → index-Dbbymxpj.js} +1 -1
- package/src/assets/web-panel/assets/{index-DVKfQ0Ux.js → index-DdkplL9R.js} +1 -1
- package/src/assets/web-panel/assets/{index-CkwiSLhU.js → index-DfGl8CqG.js} +1 -1
- package/src/assets/web-panel/assets/{index-CJVEOa4i.js → index-DfKBRdSS.js} +1 -1
- package/src/assets/web-panel/assets/{index-C1mJtE6q.js → index-DsJCDUJG.js} +1 -1
- package/src/assets/web-panel/assets/{index-BgiXR_-_.js → index-Dwqmtk65.js} +1 -1
- package/src/assets/web-panel/assets/{index-CJCFe2Qf.js → index-DxdTdBix.js} +1 -1
- package/src/assets/web-panel/assets/{index-C484EJiS.js → index-FzdwcSy2.js} +1 -1
- package/src/assets/web-panel/assets/{index-B4JJCfQ2.js → index-GsoUQ2M7.js} +1 -1
- package/src/assets/web-panel/assets/{index-CQhAVU5t.js → index-brCInrzq.js} +1 -1
- package/src/assets/web-panel/assets/{index-CKC1t3Ic.js → index-dVc-CXY4.js} +1 -1
- package/src/assets/web-panel/assets/{index-BQ3DXBtD.js → index-fk2Rjacw.js} +3 -3
- package/src/assets/web-panel/assets/{index-Cduu2Hhr.js → index-l1BETrDb.js} +1 -1
- package/src/assets/web-panel/assets/{index-Bw2MEnUk.js → index-m31Ka8hZ.js} +1 -1
- package/src/assets/web-panel/assets/{index-D2GjI2oe.js → index-ocf06EVQ.js} +1 -1
- package/src/assets/web-panel/assets/{index-CJdQrZth.js → index-sDoMHTNA.js} +1 -1
- package/src/assets/web-panel/assets/index-xeSyVoRe.js +1 -0
- package/src/assets/web-panel/assets/{initDefaultProps-Blmpk7HL.js → initDefaultProps-CvyYJd7z.js} +1 -1
- package/src/assets/web-panel/assets/{motion-DPBJMv1n.js → motion-DYZkhUdz.js} +1 -1
- package/src/assets/web-panel/assets/{move-ButdzCM7.js → move-slnJRVT1.js} +1 -1
- package/src/assets/web-panel/assets/{mtc-parser-cyRC_QCe.js → mtc-parser-DVc0CKmy.js} +1 -1
- package/src/assets/web-panel/assets/{omit-1epSV7hz.js → omit-BCXAtHCq.js} +1 -1
- package/src/assets/web-panel/assets/{pickAttrs-DuPY8xJs.js → pickAttrs-DBsemz_K.js} +1 -1
- package/src/assets/web-panel/assets/{placementArrow-6XZqarhe.js → placementArrow-BRtkJ-nv.js} +1 -1
- package/src/assets/web-panel/assets/{responsiveObserve-B40pXBWM.js → responsiveObserve-Cebq7EZn.js} +1 -1
- package/src/assets/web-panel/assets/{slide-jbZ9Wu4n.js → slide-DT7qvId2.js} +1 -1
- package/src/assets/web-panel/assets/{statusUtils-BKQQcVy4.js → statusUtils-pQiITLkG.js} +1 -1
- package/src/assets/web-panel/assets/{styleChecker-NiKfWjUT.js → styleChecker-c-19BVKQ.js} +1 -1
- package/src/assets/web-panel/assets/{useFlexGapSupport-bQUCvPeb.js → useFlexGapSupport-DsS5-0bE.js} +1 -1
- package/src/assets/web-panel/assets/{useFs-CUGji7ph.js → useFs-CxGiMe5n.js} +1 -1
- package/src/assets/web-panel/assets/{usePersonalDataHub-4veyN2N2.js → usePersonalDataHub-D9btVID5.js} +1 -1
- package/src/assets/web-panel/assets/{vnode-1-nLug-Z.js → vnode-CUYFsFEN.js} +1 -1
- package/src/assets/web-panel/assets/{zoom-dhCeRDMo.js → zoom-CXmn_35j.js} +1 -1
- package/src/assets/web-panel/index.html +1 -1
- package/src/command-help-index.json +1 -1
- package/src/commands/cowork.js +559 -62
- package/src/commands/plugin.js +819 -64
- package/src/commands/session-location.js +318 -7
- package/src/constants.js +2 -2
- package/src/data/changelog.json +28 -2
- package/src/gateways/ws/action-protocol.js +293 -19
- package/src/gateways/ws/message-dispatcher.js +30 -0
- package/src/gateways/ws/remote-session-protocol.js +542 -35
- package/src/gateways/ws/ws-approval-gate.js +5 -0
- package/src/gateways/ws/ws-server.js +462 -38
- package/src/harness/jsonl-session-store.js +638 -2
- package/src/harness/prompt-compressor.js +4 -0
- package/src/harness/remote-session-audit.js +1 -0
- package/src/harness/remote-session-crypto.js +750 -50
- package/src/harness/remote-session-registry.js +795 -27
- package/src/lib/auto-mode-config.js +98 -3
- package/src/lib/background-agent-keeper-client.js +29 -0
- package/src/lib/background-agent-keeper-protocol.js +158 -10
- package/src/lib/background-agent-supervisor.js +870 -48
- package/src/lib/background-session-transport.js +23 -6
- package/src/lib/background-turn-bootstrap-protocol.js +64 -0
- package/src/lib/cowork-task-runner.js +70 -0
- package/src/lib/cowork-workflow.js +887 -62
- package/src/lib/delivery-production-adapter.js +38 -2
- package/src/lib/doctor-checkup.js +34 -10
- package/src/lib/dynamic-workflow-draft.js +535 -0
- package/src/lib/dynamic-workflow-facade.js +1105 -17
- package/src/lib/dynamic-workflow-runtime.js +2974 -0
- package/src/lib/execution-location-contract.js +111 -7
- package/src/lib/execution-location-runtime.js +3 -1
- package/src/lib/execution-location-target.js +910 -0
- package/src/lib/llm-providers.js +1 -0
- package/src/lib/mcp-call-ledger-store.js +35 -0
- package/src/lib/mcp-call-ledger.js +30 -0
- package/src/lib/mcp-stdio-package-materialization.js +1 -1
- package/src/lib/plugin-runtime/__tests__/remote-source.test.js +34 -16
- package/src/lib/plugin-runtime/install.js +4956 -657
- package/src/lib/plugin-runtime/manifest.js +3 -1
- package/src/lib/plugin-runtime/marketplace-artifact-readback.js +671 -31
- package/src/lib/plugin-runtime/marketplace-catalog.js +68 -2
- package/src/lib/plugin-runtime/marketplace-impact.js +208 -15
- package/src/lib/plugin-runtime/marketplace-network.js +317 -0
- package/src/lib/plugin-runtime/marketplace-pac-worker.js +15 -0
- package/src/lib/plugin-runtime/marketplace-remote-artifacts.js +25 -2
- package/src/lib/plugin-runtime/marketplace-source-cache.js +359 -0
- package/src/lib/plugin-runtime/policy.js +21 -6
- package/src/lib/plugin-runtime/publisher-trust.js +332 -0
- package/src/lib/plugin-runtime/remote-source.js +323 -27
- package/src/lib/plugin-runtime/scopes.js +317 -41
- package/src/lib/plugin-runtime/transaction-journal.js +806 -0
- package/src/lib/public-ide-capability-manifest.js +1 -1
- package/src/lib/remote-approval-bridge.js +745 -108
- package/src/lib/remote-control.js +2 -0
- package/src/lib/remote-membership-coordinator.js +612 -46
- package/src/lib/remote-membership-host-store.js +59 -10
- package/src/lib/runtime-provenance-ledger.js +171 -46
- package/src/lib/shell-approval.js +169 -6
- package/src/lib/sub-agent-context.js +268 -2
- package/src/lib/task-model-selector.js +1 -1
- package/src/lib/with-file-lock.js +167 -42
- package/src/repl/agent-repl.js +70 -29
- package/src/repl/remote-approval.js +29 -7
- package/src/runtime/agent-core.js +1695 -194
- package/src/runtime/headless-runner.js +22 -5
- package/src/runtime/headless-stream.js +19 -3
- package/src/workers/background-agent-keeper.js +279 -58
- package/src/workers/background-agent-worker.js +7 -0
- package/src/workers/background-turn-bootstrap.js +29 -2
- package/src/assets/web-panel/assets/MarkdownRenderer-GmB6DOr6.js +0 -1
- package/src/assets/web-panel/assets/MobileProjects-BL0Czcoj.js +0 -1
- package/src/assets/web-panel/assets/Projects-DDAjkUkT.js +0 -1
- package/src/assets/web-panel/assets/RemoteSession-Dxzl5n2T.js +0 -5
- package/src/assets/web-panel/assets/SpeechSettings-D6UL3dA5.js +0 -1
- package/src/assets/web-panel/assets/devWarning-DKJjSWRn.js +0 -1
- package/src/assets/web-panel/assets/index-C61cnl3K.js +0 -1
- package/src/assets/web-panel/assets/index-D4XFHxBr.js +0 -1
package/README.md
CHANGED
|
@@ -395,7 +395,33 @@ chainlesschain session show <id> # Show session details
|
|
|
395
395
|
chainlesschain session resume <id> # Resume a session
|
|
396
396
|
chainlesschain session export <id> # Export as Markdown
|
|
397
397
|
chainlesschain session delete <id> # Delete a session
|
|
398
|
-
|
|
398
|
+
chainlesschain session location compare # Local/WSL/SSH/Container/Cloud catalog
|
|
399
|
+
chainlesschain session location handoff <id> <target> --facts <facts.json>
|
|
400
|
+
chainlesschain session location attest <id> <target> \
|
|
401
|
+
--facts <facts.json> --profile <target-profile.json> --json
|
|
402
|
+
chainlesschain session location resume <id> <target> \
|
|
403
|
+
--facts <facts.json> --profile <target-profile.json> \
|
|
404
|
+
--expected-target-facts-digest sha256:<digest>
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
Target attestation and resume support configured WSL, SSH, and existing
|
|
408
|
+
Container hosts. The launcher invokes only fixed ChainlessChain commands. SSH
|
|
409
|
+
requires a digest-pinned `known_hosts` file, uses strict host-key checking, and
|
|
410
|
+
materializes the verified bytes into a private temporary authority file for the
|
|
411
|
+
actual invocation. Resume re-runs the ambient host probe, verifies the accepted
|
|
412
|
+
stable facts digest, then handles the declared session-store mode. A
|
|
413
|
+
`replicated` profile streams the source's locked, verified transcript bytes to
|
|
414
|
+
the fixed target-side `session location receive` command; the target validates
|
|
415
|
+
strict UTF-8, a 64 MiB boundary, transcript structure/hash chain, exact byte
|
|
416
|
+
digest, head hash, and event count before atomic publication and creation of
|
|
417
|
+
its own sidecar and machine-local anti-rollback witness. It never replaces a
|
|
418
|
+
divergent or tombstoned target session, while an exact retry is idempotent. A
|
|
419
|
+
`shared` profile performs no copy. Both modes re-read the target's canonical
|
|
420
|
+
authority and revalidate that the source session head has not advanced before
|
|
421
|
+
the fixed `session resume` invocation. This is whole-revision transfer, not
|
|
422
|
+
incremental/bidirectional synchronization or a cross-host writer fence;
|
|
423
|
+
remote network/sandbox policy and disconnect/reconnect durability remain
|
|
424
|
+
unattested.
|
|
399
425
|
|
|
400
426
|
---
|
|
401
427
|
|
|
@@ -623,8 +649,106 @@ chainlesschain plugin info <name> # Plugin details
|
|
|
623
649
|
chainlesschain plugin search <query> # Search registry
|
|
624
650
|
chainlesschain plugin registry # List all registry plugins
|
|
625
651
|
chainlesschain plugin summary # Installation summary
|
|
652
|
+
chainlesschain plugin installed --all-scopes # Physical inventory + effective authority
|
|
653
|
+
chainlesschain plugin transaction <name> --scope project --json
|
|
654
|
+
# Inspect redacted durable transaction authority
|
|
655
|
+
chainlesschain plugin recover <name> --scope project --action rollback
|
|
656
|
+
# Recover a transaction after its owner dies
|
|
657
|
+
chainlesschain plugin provenance-plan <name> --scope project --version 1.0.0 --metadata source.json
|
|
658
|
+
# Emit exact bytes for an external Ed25519 signature
|
|
659
|
+
chainlesschain plugin provenance-migrate <name> --scope project --version 1.0.0 --attestation signed.json --expected-signer-sha256 <hex> --yes
|
|
660
|
+
# Backfill one legacy install without replacing payload bytes
|
|
661
|
+
chainlesschain plugin catalog --registry https://plugins.example/index.json --offline --registry-digest https://plugins.example/index.json=<sha256>
|
|
662
|
+
# Review one exact immutable cached registry document without network
|
|
663
|
+
chainlesschain plugin add <name> --registry https://plugins.example/index.json --proxy http://proxy.example:8080 --ca-file enterprise-ca.pem
|
|
664
|
+
# Private registry through an explicit proxy and appended custom CA
|
|
665
|
+
chainlesschain plugin browse --registry https://plugins.example/index.json --pac-file enterprise.pac
|
|
666
|
+
# Resolve PROXY/HTTPS/DIRECT in a bounded, terminable PAC worker
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
When enabling, disabling, uninstalling, or replacing a scoped plugin would
|
|
670
|
+
switch the effective `local > project > user` source, review `plugin impact`
|
|
671
|
+
and pass `--allow-source-switch` explicitly. Semantic SBOM downgrades remain
|
|
672
|
+
blocked even with that approval.
|
|
673
|
+
|
|
674
|
+
Plugin lifecycle mutation holds one same-user, same-name OS coordinator across
|
|
675
|
+
`user`, `project`, and `local` scopes. Add/upgrade keeps that owner through
|
|
676
|
+
validation, consent, finalize, or rollback, while the journal binds the exact
|
|
677
|
+
target scope and workspace context. Enable/disable records the exact prior and
|
|
678
|
+
intended marker bytes before publication. Version uninstall quarantines the
|
|
679
|
+
immutable version before publishing its pointer/marker fallback, while
|
|
680
|
+
whole-name uninstall quarantines the complete name directory before physical
|
|
681
|
+
collection. Each can therefore be explicitly finalized or rolled back after a
|
|
682
|
+
process crash. Ordinary commands never steal an abandoned owner. Inspect it
|
|
683
|
+
with `plugin transaction`, then use `plugin recover` only after the recorded
|
|
684
|
+
process has died. `--force-owner` overrides a live or cross-host owner and
|
|
685
|
+
therefore requires external operator adjudication; it is not automatic
|
|
686
|
+
stale-lock cleanup.
|
|
687
|
+
|
|
688
|
+
Legacy provenance migration is explicit and non-overwriting. The plan binds the
|
|
689
|
+
installed name, version, scope, canonical path, complete payload digest, source
|
|
690
|
+
metadata, and issuance time. Sign the decoded `signingPayloadBase64` bytes with
|
|
691
|
+
an Ed25519 key, then supply an attestation containing `authority`,
|
|
692
|
+
`publicKeyPem`, and `signatureBase64`. Apply requires the exact SPKI fingerprint
|
|
693
|
+
and `--yes`; managed trusted-key policy is also enforced when configured. The
|
|
694
|
+
signed record is checked on every strict provenance read and participates in
|
|
695
|
+
the same crash-recoverable lifecycle journal. It proves the reviewed migration
|
|
696
|
+
authority only—it does not invent Marketplace publisher identity. Existing
|
|
697
|
+
provenance and installs with a component-SBOM signature lock must be reinstalled
|
|
698
|
+
instead of rewritten.
|
|
699
|
+
|
|
700
|
+
An organization can require registry publisher identity with managed settings:
|
|
701
|
+
|
|
702
|
+
```json
|
|
703
|
+
{
|
|
704
|
+
"requireTrustedPluginPublishers": true,
|
|
705
|
+
"trustedPluginPublishers": [
|
|
706
|
+
{
|
|
707
|
+
"trustRootId": "acme-marketplace-2026",
|
|
708
|
+
"publisherId": "tools-team",
|
|
709
|
+
"organizationId": "acme",
|
|
710
|
+
"pluginNames": ["@acme/reviewer"],
|
|
711
|
+
"registryOrigins": ["https://plugins.acme.example"],
|
|
712
|
+
"signingKeySha256": ["<ed25519-spki-sha256>"],
|
|
713
|
+
"notBefore": "2026-01-01T00:00:00.000Z",
|
|
714
|
+
"notAfter": "2027-01-01T00:00:00.000Z"
|
|
715
|
+
}
|
|
716
|
+
],
|
|
717
|
+
"revokedPluginPublisherKeys": []
|
|
718
|
+
}
|
|
626
719
|
```
|
|
627
720
|
|
|
721
|
+
The registry entry must declare matching `publisher.id` and
|
|
722
|
+
`publisher.organizationId`, and the mapped key must cryptographically verify
|
|
723
|
+
the installed manifest. The persisted authority is re-evaluated against the
|
|
724
|
+
current managed policy on strict read and runtime admission; adding the key to
|
|
725
|
+
`revokedPluginPublisherKeys` fails closed immediately. This direct managed
|
|
726
|
+
binding does not by itself provide an external transparency service.
|
|
727
|
+
|
|
728
|
+
Remote registry documents are capped at 4 MiB and cached immutably by complete
|
|
729
|
+
URL plus document SHA-256. `--offline` never opens a network transport; an
|
|
730
|
+
unpinned URL with multiple valid cached revisions is rejected as ambiguous, so
|
|
731
|
+
use repeatable `--registry-digest <url=sha256>` pins. Remote signature, public
|
|
732
|
+
key, and SBOM documents use their existing bounded digest-addressed cache. For
|
|
733
|
+
`plugin add` and `plugin upgrade`, a successful online Git materialization is
|
|
734
|
+
also copied into an immutable source-package cache only when the registry binds
|
|
735
|
+
both the manifest digest and a repository-defined semantic payload SBOM. An
|
|
736
|
+
offline replay recomputes both anchors before installation; payload or cache
|
|
737
|
+
authority tampering, symlinks, hard-linked payload files, and exact cache misses
|
|
738
|
+
fail closed. Registries without that full payload anchor
|
|
739
|
+
must reference an existing local plugin directory for offline use and are not
|
|
740
|
+
silently treated as cacheable.
|
|
741
|
+
|
|
742
|
+
Private registries support `--proxy`, a bounded local `--pac-file`, and an
|
|
743
|
+
appended `--ca-file`; the dedicated environment equivalents are
|
|
744
|
+
`CC_PLUGIN_REGISTRY_PROXY`, `CC_PLUGIN_REGISTRY_PAC_FILE`, and
|
|
745
|
+
`CC_PLUGIN_REGISTRY_CA_FILE`. Proxy credentials are removed from persisted
|
|
746
|
+
authority, while the sanitized proxy origin, PAC SHA-256, and CA SHA-256 are
|
|
747
|
+
bound into the catalog/provenance record. PAC execution uses QuickJS in a
|
|
748
|
+
resource-limited worker with a hard timeout. Proxy URL and PAC are mutually
|
|
749
|
+
exclusive, PAC supports `PROXY`, `HTTP`, `HTTPS`, and `DIRECT`, and ambient
|
|
750
|
+
`HTTP_PROXY`/`HTTPS_PROXY` values are not silently adopted.
|
|
751
|
+
|
|
628
752
|
---
|
|
629
753
|
|
|
630
754
|
## Project Initialization & Collaboration
|
|
@@ -771,9 +895,131 @@ Web-based daily task collaboration via the `/#/cowork` page. Powered by SubAgent
|
|
|
771
895
|
|
|
772
896
|
Form-based Cowork Workflow editor at `/#/workflow` in the Web Panel. Create, edit, run, and export multi-step Cowork DAG workflows — each step invokes a Cowork task with placeholder substitution (`${step.<id>.summary}`) from upstream step outputs. Client-side DFS cycle detection mirrors the backend `validateWorkflow` guard.
|
|
773
897
|
|
|
898
|
+
The CLI can also generate a model-proposed definition without granting it
|
|
899
|
+
write authority. `draft` emits a secret-scanned, digest-bound
|
|
900
|
+
`pending-review` JSON artifact; `review` requires a human to repeat that exact
|
|
901
|
+
digest before an accepted definition enters the immutable version store.
|
|
902
|
+
Generation and review provenance remain inside the saved definition, while the
|
|
903
|
+
runtime continues to declare durable pause/resume and post-resume exactly-once
|
|
904
|
+
as unsupported.
|
|
905
|
+
|
|
906
|
+
```bash
|
|
907
|
+
chainlesschain cowork workflow draft "Review a release" --provider ollama > workflow-draft.json
|
|
908
|
+
chainlesschain cowork workflow review workflow-draft.json \
|
|
909
|
+
--expected-draft-digest sha256:<digest> --reviewer <identity> --accept
|
|
910
|
+
```
|
|
911
|
+
|
|
912
|
+
Accepted or hand-authored versioned definitions can opt into the bounded-parallel
|
|
913
|
+
durable runtime. Every concurrently scheduled dispatch group is persisted as one
|
|
914
|
+
atomic effect batch before any provider call. Each step/iteration/attempt keeps
|
|
915
|
+
its own stable effect identity plus batch identity, index, and size. A second
|
|
916
|
+
persisted marker distinguishes a requested-but-not-dispatched effect from one
|
|
917
|
+
whose provider call may have started. If a provider throws or its settlement
|
|
918
|
+
response is lost, the run becomes `blocked` and will not replay an outcome-
|
|
919
|
+
unknown effect until an operator supplies a bounded result file at the exact
|
|
920
|
+
runtime revision and in the recorded recovery order.
|
|
921
|
+
|
|
922
|
+
```bash
|
|
923
|
+
chainlesschain cowork workflow run <workflow-id> \
|
|
924
|
+
--execution-authority-session <session-id> --durable-run-id <run-id>
|
|
925
|
+
chainlesschain cowork workflow runtime-status <run-id> --json
|
|
926
|
+
chainlesschain cowork workflow runtime-pause <run-id> --expected-revision <n>
|
|
927
|
+
chainlesschain cowork workflow runtime-resume <run-id> --expected-revision <n>
|
|
928
|
+
chainlesschain cowork workflow runtime-stop <run-id> --expected-revision <n>
|
|
929
|
+
chainlesschain cowork workflow runtime-reconcile <run-id> <effect-id> <result.json> \
|
|
930
|
+
--expected-revision <n>
|
|
931
|
+
```
|
|
932
|
+
|
|
933
|
+
The durable runtime accepts `maxParallel` only within the digest-bound admission,
|
|
934
|
+
the workflow budget, and the hard 64-effect batch limit. A pause remains
|
|
935
|
+
`pause_requested` until every already-requested parallel provider has physically
|
|
936
|
+
settled; an unknown outcome keeps the run blocked. Multi-effect reconciliation
|
|
937
|
+
is ordered by the persisted batch sequence, and the run becomes `ready` only
|
|
938
|
+
after every outcome-unknown pending effect is settled. Retry and timeout steps
|
|
939
|
+
use attempt-scoped effect identities: an explicit failed result may advance to
|
|
940
|
+
the next attempt, a timeout before dispatch is recorded as
|
|
941
|
+
`runtime-not-dispatched`, a late completed result is accepted without retry,
|
|
942
|
+
and a late unknown outcome blocks. A crash with no dispatch marker may safely
|
|
943
|
+
resume that same effect; a persisted dispatch marker requires provider return
|
|
944
|
+
or reconciliation. Reconciliation is an explicit operator assertion about an
|
|
945
|
+
outcome-unknown provider call, not an automatic retry or a third-party receipt.
|
|
946
|
+
|
|
947
|
+
For a durable workflow effect, the production Cowork runner now validates the
|
|
948
|
+
canonical `sha256:` effect identity before constructing a child agent and locks
|
|
949
|
+
that identity into the child loop. Each ordinary model turn and each automatic
|
|
950
|
+
semantic-compaction provider query derives a source-separated, stable
|
|
951
|
+
`ccwf_...` request identity. Injected compaction adapters receive the same
|
|
952
|
+
frozen binding context. The OpenAI transport sends that value as
|
|
953
|
+
`X-Client-Request-Id` only for the official `https://api.openai.com` origin and
|
|
954
|
+
retains a bounded receipt only when OpenAI returns an `x-request-id` header or
|
|
955
|
+
response object ID; a custom OpenAI-compatible gateway receives no official
|
|
956
|
+
contract claim. Workflow-bound turns disable
|
|
957
|
+
transparent streaming retries and cross-provider fallback so one durable model
|
|
958
|
+
boundary cannot hide another physical provider attempt. The child records a
|
|
959
|
+
`cc-provider-request-attempt/v1` boundary before every bound transport; a
|
|
960
|
+
completed Cowork result matches each returned receipt to the exact provider,
|
|
961
|
+
call, source, sequence and client request ID. A normal-model or
|
|
962
|
+
semantic-compaction provider exception,
|
|
963
|
+
invalid receipt, unknown compaction usage, or post-provider compaction
|
|
964
|
+
settlement failure is propagated to the outer durable runtime as an unknown
|
|
965
|
+
outcome; it is never downgraded to an ordinary failed task that step retry could
|
|
966
|
+
replay. These identifiers are
|
|
967
|
+
explicitly `trace-only`: they do not provide native provider idempotency or an
|
|
968
|
+
independently readable receipt, and unsupported providers return no receipt.
|
|
969
|
+
Nested tool/MCP/external-system effects remain outside this provider-call
|
|
970
|
+
receipt slice.
|
|
971
|
+
|
|
972
|
+
The dynamic runtime also installs synchronous durable-call observers around the
|
|
973
|
+
Cowork child. Before each bound provider or directly dispatched tool call can
|
|
974
|
+
continue to transport, the runtime appends a bounded `started` row under the
|
|
975
|
+
pending outer effect with the exact provider request or child-effect identity.
|
|
976
|
+
The matching callback persists `completed`, `failed`, or `outcome_unknown`
|
|
977
|
+
independently of the eventual Cowork result. A crash therefore leaves an
|
|
978
|
+
independently readable started row instead of relying on a completed-result
|
|
979
|
+
projection. When the provider returned a trace receipt, that same synchronous
|
|
980
|
+
settlement validates its effect owner, provider, call, request source, sequence,
|
|
981
|
+
client request ID, and trace-only semantics, then stores only the bounded
|
|
982
|
+
provider request/response IDs in the call row. The receipt therefore survives a
|
|
983
|
+
crash before outer task settlement, including for descendant provider calls;
|
|
984
|
+
it remains neither provider-native idempotency nor independently readable from
|
|
985
|
+
the provider. Duplicate, malformed, mismatched, or tampered rows fail closed. Explicit outer
|
|
986
|
+
effect reconciliation marks any still-started rows as operator reconciled but
|
|
987
|
+
does not turn trace-only request identities into third-party idempotency.
|
|
988
|
+
Spawned sub-agents and isolated skills inherit the already-persisted parent
|
|
989
|
+
tool child-effect as their workflow owner. Their internal provider/tool calls
|
|
990
|
+
therefore enter the same store with a verified owner chain; an orphan or
|
|
991
|
+
rewritten owner fails closed, and descendant unknown outcomes prevent normal
|
|
992
|
+
outer provider-return settlement.
|
|
993
|
+
|
|
994
|
+
`runtime-status --json` also returns a digest-bound `observability` projection.
|
|
995
|
+
It exposes effect/result lineage, provider-return/operator-reconciled/runtime-
|
|
996
|
+
not-dispatched settlement counts, provider dispatch and timeout timestamps,
|
|
997
|
+
request-to-settlement wall time, effect-bound trace-only provider request
|
|
998
|
+
attempts and receipts, runtime-derived nested-tool attempt/settlement lineage,
|
|
999
|
+
the independently persisted durable-call status/digest projection plus its
|
|
1000
|
+
provider-receipt count and bounded receipt IDs, the Cowork
|
|
1001
|
+
result's heuristic token estimate, and digest-only artifact/checkpoint
|
|
1002
|
+
references. Receipt projection rejects an
|
|
1003
|
+
effect/provider/call/source/request mismatch or any claim of
|
|
1004
|
+
idempotency/independent readback, and reports a gap for every valid attempt with
|
|
1005
|
+
no matching provider receipt. The projection is intentionally
|
|
1006
|
+
`complete: false` and lists every missing authority: the current Cowork runner
|
|
1007
|
+
does not return provider token usage or USD cost, native provider idempotency
|
|
1008
|
+
and independent receipt readback remain unavailable, checkpoint and artifact-
|
|
1009
|
+
store readback are not yet wired, and the full completed-result receipt collection
|
|
1010
|
+
plus local/host child payload projections remain result-bound. MCP calls bind the
|
|
1011
|
+
same outer/child effect tuple into the canonical session ledger before
|
|
1012
|
+
transport and report persisted start/settlement facts. Any workflow-bound
|
|
1013
|
+
nested outcome-unknown result or post-boundary tool exception blocks the outer
|
|
1014
|
+
effect for reconciliation instead of becoming an ordinary failed task. The
|
|
1015
|
+
runtime-owned provider/tool call rows are independently readable from a
|
|
1016
|
+
pending or crashed run, including calls directly owned by spawned sub-agents
|
|
1017
|
+
and isolated skills. Hook/checkpoint/artifact side effects, native third-party
|
|
1018
|
+
idempotency, and provider-side receipt lookup remain open.
|
|
1019
|
+
|
|
774
1020
|
**WS protocol**: `workflow-list` / `workflow-get` / `workflow-save` / `workflow-remove` / `workflow-run` (streams `workflow:started` / `step-start` / `step-complete` / `workflow:done`).
|
|
775
1021
|
|
|
776
|
-
**Key files**: `src/gateways/ws/action-protocol.js` (5 handlers), `src/lib/cowork-workflow.js` (CRUD + `executeWorkflow`), `packages/web-panel/src/stores/workflow.js` (Pinia store + `validateLocal`), `packages/web-panel/src/views/WorkflowEditor.vue`. **
|
|
1022
|
+
**Key files**: `src/gateways/ws/action-protocol.js` (5 handlers), `src/lib/cowork-workflow.js` (CRUD + `executeWorkflow`), `src/lib/dynamic-workflow-draft.js` (model proposal + human review authority), `src/lib/dynamic-workflow-runtime.js` (atomic parallel durable effect protocol), `packages/web-panel/src/stores/workflow.js` (Pinia store + `validateLocal`), `packages/web-panel/src/views/WorkflowEditor.vue`. **Governed CLI regression**: 584 tests across draft/review, durable runtime, façade, DAG, WebSocket, admission, provider/tool/descendant call binding, durable provider receipt settlement, and MCP ledger coverage; the original editor slice retains its 39 backend/frontend/integration/E2E tests.
|
|
777
1023
|
|
|
778
1024
|
> Vue Flow visual canvas (drag-to-connect, branch rendering) is planned as M2.
|
|
779
1025
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chainlesschain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.165.2",
|
|
4
4
|
"description": "CLI for ChainlessChain - install, configure, and manage your personal AI management system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -86,20 +86,23 @@
|
|
|
86
86
|
"@chainlesschain/core-infra": "0.1.1",
|
|
87
87
|
"@chainlesschain/core-mtc": "0.2.3",
|
|
88
88
|
"@chainlesschain/core-multisig": "0.1.4",
|
|
89
|
-
"@chainlesschain/personal-data-hub": "0.4.
|
|
90
|
-
"@chainlesschain/session-core": "0.3.
|
|
89
|
+
"@chainlesschain/personal-data-hub": "0.4.58",
|
|
90
|
+
"@chainlesschain/session-core": "0.3.5",
|
|
91
91
|
"@chainlesschain/shared-logger": "0.1.1",
|
|
92
92
|
"@inquirer/prompts": "^7.2.0",
|
|
93
93
|
"@noble/curves": "^1.9.7",
|
|
94
|
+
"@tootallnate/quickjs-emscripten": "^0.23.0",
|
|
94
95
|
"ajv": "^8.20.0",
|
|
95
96
|
"ajv-formats": "^3.0.1",
|
|
96
97
|
"chalk": "^5.4.1",
|
|
97
98
|
"commander": "^12.1.0",
|
|
98
99
|
"esbuild-wasm": "0.28.1",
|
|
99
|
-
"js-yaml": "^3.
|
|
100
|
+
"js-yaml": "^3.15.1",
|
|
100
101
|
"ora": "^8.1.1",
|
|
102
|
+
"pac-resolver": "^7.0.1",
|
|
101
103
|
"semver": "^7.6.3",
|
|
102
104
|
"sql.js": "^1.14.1",
|
|
105
|
+
"undici": "^7.29.0",
|
|
103
106
|
"webdav": "^5.10.0",
|
|
104
107
|
"ws": "^8.14.2"
|
|
105
108
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
7501ce7991944fc2f8f59425dd357617431dca3c12f0059d15e4ca10e63b4df7
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as b,J as v,U as S,R as r,c as o,K as l,V as p,S as h,o as se,h as re,a as G,b as Q,r as C,P as u,Q as y,F as z,Z as H}from"./vendor-Bn1JzzAn.js";import{t as X,_ as ze,u as de,b as ce,d as f}from"./index-BQ3DXBtD.js";import ue from"./index-Cduu2Hhr.js";import{f as Ie,c as Oe,b3 as Pe,aZ as Te,ab as Ee,t as Le,at as je,R as Ne}from"./icons-DG5UD-6K.js";import"./KeyCode-D63Tfrq7.js";import"./omit-1epSV7hz.js";import"./pickAttrs-DuPY8xJs.js";import"./initDefaultProps-Blmpk7HL.js";import"./motion-DPBJMv1n.js";import"./raf-Deuc0E8-.js";import"./index-CJdQrZth.js";import"./index-BIoG5yYf.js";import"./isVisible-C7tPsqfj.js";import"./useState-CnxtbLoC.js";import"./devWarning-DKJjSWRn.js";import"./compact-item-s4TpjvjX.js";import"./createContext-BRCSvYxj.js";import"./Compact-DCihGy1u.js";import"./_getTag-DnrRH4E6.js";import"./styleChecker-NiKfWjUT.js";import"./zoom-dhCeRDMo.js";import"./ActionButton-lCW_4Gf0.js";import"./vnode-1-nLug-Z.js";const Ue=Object.freeze(["P0","P1","P2","P3"]),Me=Object.freeze(["open","acknowledged","resolved","closed"]);function g(t,a=0){return typeof t=="number"&&Number.isFinite(t)?t:a}function De(t,a=0){if(!t||typeof t!="object")return null;const s=t.id||"";return s?{key:s,id:s,anomalyMetric:t.anomalyMetric??t.anomaly_metric??"",severity:String(t.severity||"P3"),status:String(t.status||"open").toLowerCase(),description:String(t.description||""),anomalyData:t.anomalyData??t.anomaly_data??null,remediationId:t.remediationId??t.remediation_id??null,postmortem:t.postmortem||"",acknowledgedAt:t.acknowledgedAt??t.acknowledged_at??null,resolvedAt:t.resolvedAt??t.resolved_at??null,createdAt:t.createdAt??t.created_at??null,_idx:a}:null}function pe(t){const a=X(t);return Array.isArray(a)?a.map(De).filter(Boolean):[]}function qe(t,a=0){if(!t||typeof t!="object")return null;const s=t.id||"";if(!s)return null;const e=t.enabled;let P=!1;return e===!0||e===1||e==="1"?P=!0:e===!1||e===0||e==="0"?P=!1:P=!!e,{key:s,id:s,name:String(t.name||""),triggerCondition:t.triggerCondition??t.trigger_condition??"",steps:t.steps||"",enabled:P,successCount:g(t.successCount??t.success_count,0),failureCount:g(t.failureCount??t.failure_count,0),createdAt:t.createdAt??t.created_at??null,_idx:a}}function me(t){const a=X(t);return Array.isArray(a)?a.map(qe).filter(Boolean):[]}function Je(t,a=0){if(!t||typeof t!="object")return null;const s=t.metricName??t.metric_name??"";return s?{key:s,metricName:s,mean:g(t.mean,0),stdDev:g(t.stdDev??t.std_dev,0),q1:g(t.q1,0),q3:g(t.q3,0),sampleCount:g(t.sampleCount??t.sample_count,0),updatedAt:t.updatedAt??t.updated_at??null,_idx:a}:null}function ye(t){const a=X(t);return Array.isArray(a)?a.map(Je).filter(Boolean):[]}function fe(t){const a=X(t);return!a||typeof a!="object"||Array.isArray(a)?null:{anomaly:!!a.anomaly,reason:a.reason||null,metricName:a.metricName??a.metric_name??"",value:g(a.value,0),algorithm:String(a.algorithm||""),score:g(a.score,0),threshold:g(a.threshold,0),baseline:a.baseline?{mean:g(a.baseline.mean,0),stdDev:g(a.baseline.stdDev??a.baseline.std_dev,0),q1:g(a.baseline.q1,0),q3:g(a.baseline.q3,0)}:null,incidentId:a.incidentId??a.incident_id??null,severity:a.severity||null}}const Be={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 be(t){const a=JSON.parse(JSON.stringify(Be)),s=X(t);if(!s||typeof s!="object"||Array.isArray(s))return a;if(s.incidents&&typeof s.incidents=="object"){if(a.incidents.total=g(s.incidents.total,0),a.incidents.avgResolveMs=g(s.incidents.avgResolveMs??s.incidents.avg_resolve_ms,0),s.incidents.bySeverity&&typeof s.incidents.bySeverity=="object")for(const e of Object.keys(a.incidents.bySeverity))a.incidents.bySeverity[e]=g(s.incidents.bySeverity[e],0);if(s.incidents.byStatus&&typeof s.incidents.byStatus=="object")for(const e of Object.keys(a.incidents.byStatus))a.incidents.byStatus[e]=g(s.incidents.byStatus[e],0)}return s.playbooks&&typeof s.playbooks=="object"&&(a.playbooks.total=g(s.playbooks.total,0),a.playbooks.enabled=g(s.playbooks.enabled,0),a.playbooks.totalSuccess=g(s.playbooks.totalSuccess??s.playbooks.total_success,0),a.playbooks.totalFailure=g(s.playbooks.totalFailure??s.playbooks.total_failure,0)),s.baselines&&typeof s.baselines=="object"&&(a.baselines.total=g(s.baselines.total,0),Array.isArray(s.baselines.metrics)&&(a.baselines.metrics=[...s.baselines.metrics])),a}function Ve(t){if(t==null||t==="")return"—";const a=typeof t=="number"?new Date(t):new Date(String(t));return isNaN(a.getTime())?String(t):a.toLocaleString("zh-CN",{hour12:!1})}const Ke={__name:"AIOps",setup(t,{expose:a}){a();const s=de(),{t:e}=ce(),P=C(!1),j=C(!1),w=C(!1),N=C([]),Y=C([]),$=C([]),M=C({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:[]}}),I=C("incidents"),A=C(""),T=C(""),Z=C(!1),R=C(!1),O=C(!1),J=C(!1),x=G({severity:"P3",metric:"",description:""}),_=G({name:"",triggerJson:"",stepsJson:""}),D=G({metric:"",values:""}),U=G({metric:"",value:null,algorithm:"z_score"}),q=C(null),ee=Q(()=>[{title:e("aiops.incidentCols.severity"),key:"severity",width:"90px"},{title:e("aiops.incidentCols.metric"),key:"metric",width:"160px"},{title:e("aiops.incidentCols.description"),key:"description"},{title:e("aiops.incidentCols.status"),key:"status",width:"100px"},{title:e("aiops.incidentCols.createdAt"),key:"createdAt",width:"160px"},{title:e("aiops.incidentCols.action"),key:"action",width:"220px"}]),F=Q(()=>[{title:e("aiops.playbookCols.name"),key:"name"},{title:e("aiops.playbookCols.enabled"),key:"enabled",width:"80px"},{title:e("aiops.playbookCols.stats"),key:"stats",width:"180px"},{title:e("aiops.playbookCols.createdAt"),key:"createdAt",width:"160px"},{title:e("aiops.playbookCols.action"),key:"action",width:"160px"}]),W=Q(()=>[{title:e("aiops.baselineCols.metric"),key:"metric"},{title:e("aiops.baselineCols.mean"),key:"mean",width:"180px"},{title:e("aiops.baselineCols.iqr"),key:"iqr",width:"180px"},{title:e("aiops.baselineCols.sampleCount"),key:"sampleCount",width:"90px"},{title:e("aiops.baselineCols.updatedAt"),key:"updatedAt",width:"160px"}]),B=Q(()=>M.value.incidents.byStatus.open+M.value.incidents.byStatus.acknowledged),V=Q(()=>{let n=N.value;return A.value&&(n=n.filter(d=>d.severity===A.value)),T.value&&(n=n.filter(d=>d.status===T.value)),n});function K(n){const d=`aiops.statusLabels.${n}`,m=e(d);return m===d?n:m}function ae(n){return{open:"red",acknowledged:"orange",resolved:"cyan",closed:"default"}[n]||"default"}function i(n){return{P0:"red",P1:"volcano",P2:"orange",P3:"gold"}[n]||"default"}function c(n){const d=`aiops.reasonLabels.${n}`,m=e(d);return m===d?n:m}function E(n,d){return n?n.length>d?n.slice(0,d)+"...":n:""}function ve(n){return!n||n<=0?e("aiops.duration.none"):n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:n<36e5?`${(n/6e4).toFixed(1)}min`:`${(n/36e5).toFixed(1)}h`}function ge({key:n}){n==="incident"?Z.value=!0:n==="playbook"?R.value=!0:n==="baseline"?O.value=!0:n==="detect"&&(q.value=null,J.value=!0)}async function L(){P.value=!0;try{const[n,d,m,k]=await Promise.all([s.execute("ops incidents --limit 200 --json",1e4).catch(()=>({output:""})),s.execute("ops playbooks --limit 200 --json",1e4).catch(()=>({output:""})),s.execute("ops baselines --json",1e4).catch(()=>({output:""})),s.execute("ops stats --json",8e3).catch(()=>({output:""}))]);N.value=pe(n.output),Y.value=me(d.output),$.value=ye(m.output),M.value=be(k.output)}catch(n){f.error(e("aiops.msg.loadFailed")+": "+(n?.message||n))}finally{P.value=!1}}async function ke(){if(!x.description.trim()){f.warning(e("aiops.msg.descEmpty"));return}j.value=!0;try{const n=[`ops incident-create --severity ${x.severity}`];x.metric.trim()&&n.push(`--metric "${x.metric.trim().replace(/"/g,'\\"')}"`),n.push(`--description "${x.description.trim().replace(/"/g,'\\"')}"`),n.push("--json");const{output:d}=await s.execute(n.join(" "),1e4);if(/error|失败/i.test(d)&&!/"incidentId"/.test(d)){f.error(e("aiops.msg.createFailed")+": "+d.slice(0,120));return}f.success(e("aiops.msg.incidentCreated")),Z.value=!1,oe(),await L()}catch(n){f.error(e("aiops.msg.createFailed")+": "+(n?.message||n))}finally{j.value=!1}}async function _e(){if(!_.name.trim()){f.warning(e("aiops.msg.playbookNameEmpty"));return}for(const[n,d]of[[_.triggerJson,"triggerLabel"],[_.stepsJson,"stepsLabel"]])if(n.trim())try{JSON.parse(n)}catch{f.warning(e("aiops.msg.jsonInvalid",{label:e(`aiops.msg.${d}`)}));return}j.value=!0;try{const n=[`ops playbook-create --name "${_.name.trim().replace(/"/g,'\\"')}"`];_.triggerJson.trim()&&n.push(`--trigger '${_.triggerJson.trim().replace(/'/g,"'\\''")}'`),_.stepsJson.trim()&&n.push(`--steps '${_.stepsJson.trim().replace(/'/g,"'\\''")}'`),n.push("--json");const{output:d}=await s.execute(n.join(" "),1e4);if(/error|失败/i.test(d)&&!/"playbookId"/.test(d)){f.error(e("aiops.msg.createFailed")+": "+d.slice(0,120));return}f.success(e("aiops.msg.playbookCreated")),R.value=!1,le(),I.value="playbooks",await L()}catch(n){f.error(e("aiops.msg.createFailed")+": "+(n?.message||n))}finally{j.value=!1}}async function he(){const n=D.metric.trim();if(!n){f.warning(e("aiops.msg.metricEmpty"));return}const d=D.values.split(/[\s,]+/).map(m=>m.trim()).filter(Boolean).map(m=>Number(m));if(d.length===0||d.some(m=>!Number.isFinite(m))){f.warning(e("aiops.msg.valuesInvalid"));return}j.value=!0;try{const m=`ops baseline-update "${n.replace(/"/g,'\\"')}" --values ${d.join(",")} --json`,{output:k}=await s.execute(m,1e4);if(/error|失败/i.test(k)&&!/"updated"/.test(k)){f.error(e("aiops.msg.baselineUpdateFailed")+": "+k.slice(0,120));return}f.success(e("aiops.msg.baselineUpdated",{n:d.length})),O.value=!1,ie(),I.value="baselines",await L()}catch(m){f.error(e("aiops.msg.baselineUpdateFailed")+": "+(m?.message||m))}finally{j.value=!1}}async function Ce(){if(!U.metric||U.value==null){f.warning(e("aiops.msg.detectFieldsEmpty"));return}w.value=!0,q.value=null;try{const n=`ops detect "${U.metric.replace(/"/g,'\\"')}" ${U.value} --algorithm ${U.algorithm} --json`,{output:d}=await s.execute(n,8e3),m=fe(d);if(!m){f.error(e("aiops.msg.detectFailed")+": "+d.slice(0,120));return}q.value=m,m.anomaly&&(f.warning(e("aiops.msg.detectAnomaly",{severity:m.severity||"P3"})),L())}catch(n){f.error(e("aiops.msg.detectFailed")+": "+(n?.message||n))}finally{w.value=!1}}async function Se(n){await te(n,"incident-ack",e("aiops.msg.incidentAcked"))}async function xe(n){await te(n,"incident-resolve",e("aiops.msg.incidentResolved"))}async function Fe(n){await te(n,"incident-close",e("aiops.msg.incidentClosed"))}async function te(n,d,m){try{const{output:k}=await s.execute(`ops ${d} ${n.id} --json`,8e3);if(/error|失败|invalid/i.test(k)&&!/"acknowledged"|"resolved"|"closed"/.test(k)){f.error(e("aiops.msg.incidentTransitionFailed")+": "+k.slice(0,120));return}f.success(m),await L()}catch(k){f.error(e("aiops.msg.incidentTransitionFailed")+": "+(k?.message||k))}}async function we(n){try{const{output:d}=await s.execute(`ops postmortem ${n.id}`,12e3);ue.info({title:e("aiops.msg.postmortemTitle",{id:n.id.slice(0,8)}),width:720,content:()=>re("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;"},d||e("aiops.msg.postmortemEmpty"))})}catch(d){f.error(e("aiops.msg.postmortemFailed")+": "+(d?.message||d))}}async function Ae(n,d){const m=d?"on":"off";try{const{output:k}=await s.execute(`ops playbook-toggle ${n.id} ${m} --json`,8e3);if(/error|失败/i.test(k)&&!/"enabled"/.test(k)){f.error(e("aiops.msg.playbookToggleFailed")+": "+k.slice(0,120));return}f.success(e(d?"aiops.msg.playbookEnabled":"aiops.msg.playbookDisabled")),await L()}catch(k){f.error(e("aiops.msg.playbookToggleFailed")+": "+(k?.message||k))}}async function Re(n,d){try{const{output:m}=await s.execute(`ops playbook-record ${n.id} ${d} --json`,8e3);if(/error|失败/i.test(m)&&!/"recorded"/.test(m)){f.error(e("aiops.msg.playbookRecordFailed")+": "+m.slice(0,120));return}f.success(e(d==="success"?"aiops.msg.playbookRecordSuccess":"aiops.msg.playbookRecordFailure")),await L()}catch(m){f.error(e("aiops.msg.playbookRecordFailed")+": "+(m?.message||m))}}function oe(){x.severity="P3",x.metric="",x.description=""}function le(){_.name="",_.triggerJson="",_.stepsJson=""}function ie(){D.metric="",D.values=""}se(L);const ne={ws:s,t:e,loading:P,creating:j,detecting:w,incidents:N,playbooks:Y,baselines:$,stats:M,activeTab:I,incidentSeverityFilter:A,incidentStatusFilter:T,showIncidentModal:Z,showPlaybookModal:R,showBaselineModal:O,showDetectModal:J,incidentForm:x,playbookForm:_,baselineForm:D,detectForm:U,detectResult:q,incidentColumns:ee,playbookColumns:F,baselineColumns:W,openCount:B,filteredIncidents:V,statusLabel:K,statusColor:ae,severityColor:i,reasonLabel:c,truncate:E,formatDurationMs:ve,handleNewClick:ge,loadAll:L,createIncident:ke,createPlaybook:_e,updateBaseline:he,detectAnomaly:Ce,ackIncident:Se,resolveIncident:xe,closeIncident:Fe,runIncidentTransition:te,generatePostmortem:we,togglePlaybook:Ae,recordRun:Re,resetIncidentForm:oe,resetPlaybookForm:le,resetBaselineForm:ie,ref:C,computed:Q,onMounted:se,reactive:G,h:re,get ReloadOutlined(){return Ne},get PlusOutlined(){return je},get AlertOutlined(){return Le},get RocketOutlined(){return Ee},get LineChartOutlined(){return Te},get FundOutlined(){return Pe},get ExclamationCircleOutlined(){return Oe},get CheckCircleOutlined(){return Ie},get message(){return f},get Modal(){return ue},get useI18n(){return ce},get useWsStore(){return de},get parseIncidents(){return pe},get parsePlaybooks(){return me},get parseBaselines(){return ye},get parseDetectResult(){return fe},get parseStats(){return be},get formatOpsTime(){return Ve},get SEVERITIES(){return Ue},get INCIDENT_STATUSES(){return Me}};return Object.defineProperty(ne,"__isScriptSetup",{enumerable:!1,value:!0}),ne}},Qe={style:{display:"flex","align-items":"center","justify-content":"space-between","margin-bottom":"24px"}},Ze={class:"page-title"},We={class:"page-sub"},Ge={style:{color:"var(--text-secondary)","font-size":"12px","margin-left":"8px"}},He={class:"filter-bar"},Xe={key:0,style:{color:"var(--text-primary)","font-family":"monospace","font-size":"12px"}},Ye={key:1,style:{color:"var(--text-muted)"}},$e={key:2,style:{color:"var(--text-secondary)","font-size":"12px"}},et={key:4,style:{color:"var(--text-secondary)","font-size":"11px"}},tt={style:{padding:"40px",color:"var(--text-muted)","text-align":"center"}},at={style:{color:"var(--text-primary)","font-weight":"500"}},ot={key:0,style:{color:"var(--text-secondary)","font-size":"11px","margin-top":"2px","font-family":"monospace"}},lt={key:3,style:{color:"var(--text-secondary)","font-size":"11px"}},it={style:{padding:"40px",color:"var(--text-muted)","text-align":"center"}},nt={key:0,style:{color:"var(--text-primary)","font-family":"monospace","font-weight":"500"}},st={style:{color:"#1677ff"}},rt={style:{color:"var(--text-secondary)","margin-left":"4px","font-size":"11px"}},dt={key:2,style:{color:"var(--text-secondary)","font-size":"12px"}},ct={key:4,style:{color:"var(--text-secondary)","font-size":"11px"}},ut={style:{padding:"40px",color:"var(--text-muted)","text-align":"center"}},pt={key:0,style:{color:"var(--text-secondary)","font-size":"12px","margin-top":"8px"}},mt={key:1,style:{"margin-top":"12px","font-size":"12px",color:"var(--text-secondary)"}},yt={key:2,style:{"margin-top":"8px"}};function ft(t,a,s,e,P,j){const w=b("a-button"),N=b("a-menu-item"),Y=b("a-menu"),$=b("a-dropdown"),M=b("a-space"),I=b("a-statistic"),A=b("a-card"),T=b("a-col"),Z=b("a-row"),R=b("a-tag"),O=b("a-radio-button"),J=b("a-radio-group"),x=b("a-table"),_=b("a-tab-pane"),D=b("a-switch"),U=b("a-tabs"),q=b("a-select-option"),ee=b("a-select"),F=b("a-form-item"),W=b("a-input"),B=b("a-textarea"),V=b("a-form"),K=b("a-modal"),ae=b("a-input-number");return u(),v("div",null,[S("div",Qe,[S("div",null,[S("h2",Ze,r(t.$t("aiops.title")),1),S("p",We,r(t.$t("aiops.subtitle")),1)]),o(M,null,{default:l(()=>[o(w,{loading:e.loading,onClick:e.loadAll},{icon:l(()=>[o(e.ReloadOutlined)]),default:l(()=>[y(" "+r(t.$t("aiops.refresh")),1)]),_:1},8,["loading"]),o($,{trigger:["click"]},{overlay:l(()=>[o(Y,{onClick:e.handleNewClick},{default:l(()=>[o(N,{key:"incident"},{default:l(()=>[o(e.AlertOutlined),y(" "+r(t.$t("aiops.actions.incident")),1)]),_:1}),o(N,{key:"playbook"},{default:l(()=>[o(e.RocketOutlined),y(" "+r(t.$t("aiops.actions.playbook")),1)]),_:1}),o(N,{key:"baseline"},{default:l(()=>[o(e.LineChartOutlined),y(" "+r(t.$t("aiops.actions.baseline")),1)]),_:1}),o(N,{key:"detect"},{default:l(()=>[o(e.FundOutlined),y(" "+r(t.$t("aiops.actions.detect")),1)]),_:1})]),_:1})]),default:l(()=>[o(w,{type:"primary"},{icon:l(()=>[o(e.PlusOutlined)]),default:l(()=>[y(" "+r(t.$t("aiops.newDropdown")),1)]),_:1})]),_:1})]),_:1})]),p(" Stats overview "),o(Z,{gutter:[16,16],style:{"margin-bottom":"20px"}},{default:l(()=>[o(T,{xs:12,sm:8,lg:5},{default:l(()=>[o(A,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[o(I,{title:t.$t("aiops.stats.incidents"),value:e.stats.incidents.total,"value-style":{color:"#1677ff",fontSize:"20px"}},{prefix:l(()=>[o(e.AlertOutlined)]),_:1},8,["title","value"])]),_:1})]),_:1}),o(T,{xs:12,sm:8,lg:5},{default:l(()=>[o(A,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[o(I,{title:t.$t("aiops.stats.pending"),value:e.stats.incidents.byStatus.open+e.stats.incidents.byStatus.acknowledged,"value-style":{color:e.openCount>0?"#ff4d4f":"#52c41a",fontSize:"20px"}},{prefix:l(()=>[o(e.ExclamationCircleOutlined)]),_:1},8,["title","value","value-style"])]),_:1})]),_:1}),o(T,{xs:12,sm:8,lg:5},{default:l(()=>[o(A,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[o(I,{title:t.$t("aiops.stats.playbooks"),value:e.stats.playbooks.total,"value-style":{color:"#722ed1",fontSize:"20px"}},{prefix:l(()=>[o(e.RocketOutlined)]),_:1},8,["title","value"])]),_:1})]),_:1}),o(T,{xs:12,sm:8,lg:5},{default:l(()=>[o(A,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[o(I,{title:t.$t("aiops.stats.enabled"),value:e.stats.playbooks.enabled,"value-style":{color:"#52c41a",fontSize:"20px"}},{prefix:l(()=>[o(e.CheckCircleOutlined)]),_:1},8,["title","value"])]),_:1})]),_:1}),o(T,{xs:24,sm:8,lg:4},{default:l(()=>[o(A,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[o(I,{title:t.$t("aiops.stats.baselines"),value:e.stats.baselines.total,"value-style":{color:"#13c2c2",fontSize:"20px"}},{prefix:l(()=>[o(e.LineChartOutlined)]),_:1},8,["title","value"])]),_:1})]),_:1})]),_:1}),p(" Severity breakdown bar "),e.stats.incidents.total>0?(u(),h(A,{key:0,title:t.$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(()=>[o(M,{size:[12,8],wrap:""},{default:l(()=>[(u(!0),v(z,null,H(e.SEVERITIES,i=>(u(),h(R,{key:i,color:e.severityColor(i),style:{"font-size":"13px",padding:"2px 10px"}},{default:l(()=>[y(r(i)+": "+r(e.stats.incidents.bySeverity[i]||0),1)]),_:2},1032,["color"]))),128)),S("span",Ge,r(t.$t("aiops.avgResolveLabel",{time:e.formatDurationMs(e.stats.incidents.avgResolveMs)})),1)]),_:1})]),_:1},8,["title"])):p("v-if",!0),p(" Tabs "),o(U,{activeKey:e.activeTab,"onUpdate:activeKey":a[2]||(a[2]=i=>e.activeTab=i),class:"aiops-tabs"},{default:l(()=>[p(" ── Incidents tab ─────────────────────────────────────────── "),o(_,{key:"incidents",tab:t.$t("aiops.tabs.incidents")},{default:l(()=>[S("div",He,[o(J,{value:e.incidentSeverityFilter,"onUpdate:value":a[0]||(a[0]=i=>e.incidentSeverityFilter=i),size:"small","button-style":"solid"},{default:l(()=>[o(O,{value:""},{default:l(()=>[y(r(t.$t("aiops.filter.all")),1)]),_:1}),(u(!0),v(z,null,H(e.SEVERITIES,i=>(u(),h(O,{key:i,value:i},{default:l(()=>[y(r(i),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"]),o(J,{value:e.incidentStatusFilter,"onUpdate:value":a[1]||(a[1]=i=>e.incidentStatusFilter=i),size:"small"},{default:l(()=>[o(O,{value:""},{default:l(()=>[y(r(t.$t("aiops.filter.allStatuses")),1)]),_:1}),(u(!0),v(z,null,H(e.INCIDENT_STATUSES,i=>(u(),h(O,{key:i,value:i},{default:l(()=>[y(r(e.statusLabel(i)),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),o(x,{columns:e.incidentColumns,"data-source":e.filteredIncidents,pagination:{pageSize:20,showTotal:i=>t.$t("aiops.table.totalSuffix",{n:i})},size:"small",loading:e.loading,style:{background:"var(--bg-card)"}},{bodyCell:l(({column:i,record:c})=>[i.key==="severity"?(u(),h(R,{key:0,color:e.severityColor(c.severity),style:{"font-weight":"600"}},{default:l(()=>[y(r(c.severity),1)]),_:2},1032,["color"])):p("v-if",!0),i.key==="metric"?(u(),v(z,{key:1},[c.anomalyMetric?(u(),v("span",Xe,r(c.anomalyMetric),1)):(u(),v("span",Ye,"—"))],64)):p("v-if",!0),i.key==="description"?(u(),v("span",$e,r(e.truncate(c.description,80)||"—"),1)):p("v-if",!0),i.key==="status"?(u(),h(R,{key:3,color:e.statusColor(c.status)},{default:l(()=>[y(r(e.statusLabel(c.status)),1)]),_:2},1032,["color"])):p("v-if",!0),i.key==="createdAt"?(u(),v("span",et,r(e.formatOpsTime(c.createdAt)),1)):p("v-if",!0),i.key==="action"?(u(),v(z,{key:5},[c.status==="open"?(u(),h(w,{key:0,size:"small",type:"link",onClick:E=>e.ackIncident(c)},{default:l(()=>[y(r(t.$t("aiops.incidentActions.ack")),1)]),_:1},8,["onClick"])):p("v-if",!0),c.status==="open"||c.status==="acknowledged"?(u(),h(w,{key:1,size:"small",type:"link",onClick:E=>e.resolveIncident(c)},{default:l(()=>[y(r(t.$t("aiops.incidentActions.resolve")),1)]),_:1},8,["onClick"])):p("v-if",!0),c.status==="resolved"?(u(),h(w,{key:2,size:"small",type:"link",onClick:E=>e.closeIncident(c)},{default:l(()=>[y(r(t.$t("aiops.incidentActions.close")),1)]),_:1},8,["onClick"])):p("v-if",!0),c.status==="resolved"||c.status==="closed"?(u(),h(w,{key:3,size:"small",type:"link",onClick:E=>e.generatePostmortem(c)},{default:l(()=>[y(r(t.$t("aiops.incidentActions.postmortem")),1)]),_:1},8,["onClick"])):p("v-if",!0)],64)):p("v-if",!0)]),emptyText:l(()=>[S("div",tt,[o(e.AlertOutlined,{style:{"font-size":"36px","margin-bottom":"10px",display:"block"}}),y(" "+r(e.incidentSeverityFilter||e.incidentStatusFilter?t.$t("aiops.table.incidentEmptyFiltered"):t.$t("aiops.table.incidentEmpty")),1)])]),_:1},8,["columns","data-source","pagination","loading"])]),_:1},8,["tab"]),p(" ── Playbooks tab ─────────────────────────────────────────── "),o(_,{key:"playbooks",tab:t.$t("aiops.tabs.playbooks")},{default:l(()=>[o(x,{columns:e.playbookColumns,"data-source":e.playbooks,pagination:{pageSize:20,showTotal:i=>t.$t("aiops.table.totalSuffix",{n:i})},size:"small",loading:e.loading,style:{background:"var(--bg-card)"}},{bodyCell:l(({column:i,record:c})=>[i.key==="name"?(u(),v(z,{key:0},[S("span",at,r(c.name),1),c.triggerCondition?(u(),v("div",ot,r(e.truncate(c.triggerCondition,80)),1)):p("v-if",!0)],64)):p("v-if",!0),i.key==="enabled"?(u(),h(D,{key:1,checked:c.enabled,size:"small",onChange:E=>e.togglePlaybook(c,E)},null,8,["checked","onChange"])):p("v-if",!0),i.key==="stats"?(u(),v(z,{key:2},[o(R,{color:"green",style:{"font-size":"11px"}},{default:l(()=>[y(r(t.$t("aiops.table.successCount",{n:c.successCount})),1)]),_:2},1024),c.failureCount>0?(u(),h(R,{key:0,color:"red",style:{"font-size":"11px","margin-left":"4px"}},{default:l(()=>[y(r(t.$t("aiops.table.failureCount",{n:c.failureCount})),1)]),_:2},1024)):p("v-if",!0)],64)):p("v-if",!0),i.key==="createdAt"?(u(),v("span",lt,r(e.formatOpsTime(c.createdAt)),1)):p("v-if",!0),i.key==="action"?(u(),v(z,{key:4},[o(w,{size:"small",type:"link",onClick:E=>e.recordRun(c,"success")},{default:l(()=>[y(r(t.$t("aiops.playbookActions.success")),1)]),_:1},8,["onClick"]),o(w,{size:"small",type:"link",danger:"",onClick:E=>e.recordRun(c,"failure")},{default:l(()=>[y(r(t.$t("aiops.playbookActions.failure")),1)]),_:1},8,["onClick"])],64)):p("v-if",!0)]),emptyText:l(()=>[S("div",it,[o(e.RocketOutlined,{style:{"font-size":"36px","margin-bottom":"10px",display:"block"}}),y(" "+r(t.$t("aiops.table.playbookEmpty")),1)])]),_:1},8,["columns","data-source","pagination","loading"])]),_:1},8,["tab"]),p(" ── Baselines tab ─────────────────────────────────────────── "),o(_,{key:"baselines",tab:t.$t("aiops.tabs.baselines")},{default:l(()=>[o(x,{columns:e.baselineColumns,"data-source":e.baselines,pagination:{pageSize:20,showTotal:i=>t.$t("aiops.table.totalSuffix",{n:i})},size:"small",loading:e.loading,style:{background:"var(--bg-card)"}},{bodyCell:l(({column:i,record:c})=>[i.key==="metric"?(u(),v("span",nt,r(c.metricName),1)):p("v-if",!0),i.key==="mean"?(u(),v(z,{key:1},[S("span",st,r(c.mean),1),S("span",rt,"σ "+r(c.stdDev),1)],64)):p("v-if",!0),i.key==="iqr"?(u(),v("span",dt," Q1 "+r(c.q1)+" / Q3 "+r(c.q3),1)):p("v-if",!0),i.key==="sampleCount"?(u(),h(R,{key:3,color:"blue",style:{"font-size":"11px"}},{default:l(()=>[y(r(c.sampleCount),1)]),_:2},1024)):p("v-if",!0),i.key==="updatedAt"?(u(),v("span",ct,r(e.formatOpsTime(c.updatedAt)),1)):p("v-if",!0)]),emptyText:l(()=>[S("div",ut,[o(e.LineChartOutlined,{style:{"font-size":"36px","margin-bottom":"10px",display:"block"}}),y(" "+r(t.$t("aiops.table.baselineEmpty")),1)])]),_:1},8,["columns","data-source","pagination","loading"])]),_:1},8,["tab"])]),_:1},8,["activeKey"]),p(" ── Create incident modal ─────────────────────────────────── "),o(K,{open:e.showIncidentModal,"onUpdate:open":a[6]||(a[6]=i=>e.showIncidentModal=i),title:t.$t("aiops.incident_modal.title"),"confirm-loading":e.creating,width:520,"ok-text":t.$t("aiops.incident_modal.ok"),"cancel-text":t.$t("aiops.incident_modal.cancel"),onOk:e.createIncident,onCancel:e.resetIncidentForm},{default:l(()=>[o(V,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[o(F,{label:t.$t("aiops.incident_modal.severityLabel")},{default:l(()=>[o(ee,{value:e.incidentForm.severity,"onUpdate:value":a[3]||(a[3]=i=>e.incidentForm.severity=i)},{default:l(()=>[(u(!0),v(z,null,H(e.SEVERITIES,i=>(u(),h(q,{key:i,value:i},{default:l(()=>[y(r(i),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.incident_modal.metricLabel")},{default:l(()=>[o(W,{value:e.incidentForm.metric,"onUpdate:value":a[4]||(a[4]=i=>e.incidentForm.metric=i),placeholder:t.$t("aiops.incident_modal.metricPlaceholder")},null,8,["value","placeholder"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.incident_modal.descLabel"),required:""},{default:l(()=>[o(B,{value:e.incidentForm.description,"onUpdate:value":a[5]||(a[5]=i=>e.incidentForm.description=i),"auto-size":{minRows:3,maxRows:6}},null,8,["value"])]),_:1},8,["label"])]),_:1})]),_:1},8,["open","title","confirm-loading","ok-text","cancel-text"]),p(" ── Create playbook modal ─────────────────────────────────── "),o(K,{open:e.showPlaybookModal,"onUpdate:open":a[10]||(a[10]=i=>e.showPlaybookModal=i),title:t.$t("aiops.playbook_modal.title"),"confirm-loading":e.creating,width:540,"ok-text":t.$t("aiops.playbook_modal.ok"),"cancel-text":t.$t("aiops.playbook_modal.cancel"),onOk:e.createPlaybook,onCancel:e.resetPlaybookForm},{default:l(()=>[o(V,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[o(F,{label:t.$t("aiops.playbook_modal.nameLabel"),required:""},{default:l(()=>[o(W,{value:e.playbookForm.name,"onUpdate:value":a[7]||(a[7]=i=>e.playbookForm.name=i),placeholder:t.$t("aiops.playbook_modal.namePlaceholder")},null,8,["value","placeholder"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.playbook_modal.triggerLabel")},{default:l(()=>[o(B,{value:e.playbookForm.triggerJson,"onUpdate:value":a[8]||(a[8]=i=>e.playbookForm.triggerJson=i),placeholder:t.$t("aiops.playbook_modal.triggerPlaceholder"),"auto-size":{minRows:2,maxRows:4}},null,8,["value","placeholder"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.playbook_modal.stepsLabel")},{default:l(()=>[o(B,{value:e.playbookForm.stepsJson,"onUpdate:value":a[9]||(a[9]=i=>e.playbookForm.stepsJson=i),placeholder:t.$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"]),p(" ── Update baseline modal ─────────────────────────────────── "),o(K,{open:e.showBaselineModal,"onUpdate:open":a[13]||(a[13]=i=>e.showBaselineModal=i),title:t.$t("aiops.baseline_modal.title"),"confirm-loading":e.creating,width:500,"ok-text":t.$t("aiops.baseline_modal.ok"),"cancel-text":t.$t("aiops.baseline_modal.cancel"),onOk:e.updateBaseline,onCancel:e.resetBaselineForm},{default:l(()=>[o(V,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[o(F,{label:t.$t("aiops.baseline_modal.metricLabel"),required:""},{default:l(()=>[o(W,{value:e.baselineForm.metric,"onUpdate:value":a[11]||(a[11]=i=>e.baselineForm.metric=i),placeholder:t.$t("aiops.baseline_modal.metricPlaceholder")},null,8,["value","placeholder"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.baseline_modal.valuesLabel"),required:""},{default:l(()=>[o(B,{value:e.baselineForm.values,"onUpdate:value":a[12]||(a[12]=i=>e.baselineForm.values=i),placeholder:t.$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"]),p(" ── Detect anomaly modal ──────────────────────────────────── "),o(K,{open:e.showDetectModal,"onUpdate:open":a[17]||(a[17]=i=>e.showDetectModal=i),title:t.$t("aiops.detect_modal.title"),"confirm-loading":e.detecting,width:500,"ok-text":t.$t("aiops.detect_modal.ok"),"cancel-text":t.$t("aiops.detect_modal.cancel"),onOk:e.detectAnomaly},{default:l(()=>[o(V,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[o(F,{label:t.$t("aiops.detect_modal.metricLabel"),required:""},{default:l(()=>[o(ee,{value:e.detectForm.metric,"onUpdate:value":a[14]||(a[14]=i=>e.detectForm.metric=i),"show-search":"",placeholder:t.$t("aiops.detect_modal.metricPlaceholder")},{default:l(()=>[(u(!0),v(z,null,H(e.baselines,i=>(u(),h(q,{key:i.metricName,value:i.metricName},{default:l(()=>[y(r(t.$t("aiops.detect_modal.metricOptionLabel",{name:i.metricName,count:i.sampleCount})),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","placeholder"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.detect_modal.valueLabel"),required:""},{default:l(()=>[o(ae,{value:e.detectForm.value,"onUpdate:value":a[15]||(a[15]=i=>e.detectForm.value=i),style:{width:"100%"}},null,8,["value"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.detect_modal.algorithmLabel")},{default:l(()=>[o(J,{value:e.detectForm.algorithm,"onUpdate:value":a[16]||(a[16]=i=>e.detectForm.algorithm=i)},{default:l(()=>[o(O,{value:"z_score"},{default:l(()=>[...a[18]||(a[18]=[y("Z-Score (3σ)",-1)])]),_:1}),o(O,{value:"iqr"},{default:l(()=>[...a[19]||(a[19]=[y("IQR (1.5×)",-1)])]),_:1})]),_:1},8,["value"])]),_:1},8,["label"])]),_:1}),e.detectResult?(u(),h(A,{key:0,size:"small",style:{background:"var(--bg-base)","margin-top":"8px"}},{default:l(()=>[o(I,{title:t.$t("aiops.detect_modal.resultTitle"),value:e.detectResult.anomaly?t.$t("aiops.detect_modal.anomaly"):t.$t("aiops.detect_modal.normal"),"value-style":{color:e.detectResult.anomaly?"#ff4d4f":"#52c41a"}},null,8,["title","value","value-style"]),e.detectResult.reason&&!e.detectResult.anomaly?(u(),v("div",pt,r(t.$t("aiops.detect_modal.reasonLine",{reason:e.reasonLabel(e.detectResult.reason)})),1)):p("v-if",!0),e.detectResult.baseline?(u(),v("div",mt,[S("div",null,r(t.$t("aiops.detect_modal.scoreLine",{score:e.detectResult.score,threshold:e.detectResult.threshold})),1),S("div",null,r(t.$t("aiops.detect_modal.baselineLine",{mean:e.detectResult.baseline.mean,stdDev:e.detectResult.baseline.stdDev})),1)])):p("v-if",!0),e.detectResult.incidentId?(u(),v("div",yt,[o(R,{color:e.severityColor(e.detectResult.severity)},{default:l(()=>[y(r(t.$t("aiops.detect_modal.incidentCreated",{severity:e.detectResult.severity})),1)]),_:1},8,["color"])])):p("v-if",!0)]),_:1})):p("v-if",!0)]),_:1},8,["open","title","confirm-loading","ok-text","cancel-text"])])}const Mt=ze(Ke,[["render",ft],["__scopeId","data-v-b804918b"],["__file","/tmp/cc-web-panel-J6U3Mt/repo/packages/web-panel/src/views/AIOps.vue"]]);export{Mt as default};
|
|
1
|
+
import{I as b,J as v,U as S,R as r,c as o,K as l,V as p,S as h,o as se,h as re,a as G,b as Q,r as C,P as u,Q as y,F as z,Z as H}from"./vendor-Bn1JzzAn.js";import{t as X,_ as ze,u as de,b as ce,d as f}from"./index-fk2Rjacw.js";import ue from"./index-l1BETrDb.js";import{f as Ie,c as Oe,b3 as Pe,aZ as Te,ab as Ee,t as Le,at as je,R as Ne}from"./icons-DG5UD-6K.js";import"./KeyCode-D63Tfrq7.js";import"./omit-BCXAtHCq.js";import"./pickAttrs-DBsemz_K.js";import"./initDefaultProps-CvyYJd7z.js";import"./motion-DYZkhUdz.js";import"./raf-Deuc0E8-.js";import"./index-sDoMHTNA.js";import"./index-2eyAXE3d.js";import"./isVisible-C7tPsqfj.js";import"./useState-CnxtbLoC.js";import"./devWarning-Bj5nUW2v.js";import"./compact-item-BTt2GtOm.js";import"./createContext-D_VeUc1J.js";import"./Compact-izHNb4uz.js";import"./_getTag-DnrRH4E6.js";import"./styleChecker-c-19BVKQ.js";import"./zoom-CXmn_35j.js";import"./ActionButton-BmlgBPsj.js";import"./vnode-CUYFsFEN.js";const Ue=Object.freeze(["P0","P1","P2","P3"]),De=Object.freeze(["open","acknowledged","resolved","closed"]);function g(t,a=0){return typeof t=="number"&&Number.isFinite(t)?t:a}function Me(t,a=0){if(!t||typeof t!="object")return null;const s=t.id||"";return s?{key:s,id:s,anomalyMetric:t.anomalyMetric??t.anomaly_metric??"",severity:String(t.severity||"P3"),status:String(t.status||"open").toLowerCase(),description:String(t.description||""),anomalyData:t.anomalyData??t.anomaly_data??null,remediationId:t.remediationId??t.remediation_id??null,postmortem:t.postmortem||"",acknowledgedAt:t.acknowledgedAt??t.acknowledged_at??null,resolvedAt:t.resolvedAt??t.resolved_at??null,createdAt:t.createdAt??t.created_at??null,_idx:a}:null}function pe(t){const a=X(t);return Array.isArray(a)?a.map(Me).filter(Boolean):[]}function qe(t,a=0){if(!t||typeof t!="object")return null;const s=t.id||"";if(!s)return null;const e=t.enabled;let P=!1;return e===!0||e===1||e==="1"?P=!0:e===!1||e===0||e==="0"?P=!1:P=!!e,{key:s,id:s,name:String(t.name||""),triggerCondition:t.triggerCondition??t.trigger_condition??"",steps:t.steps||"",enabled:P,successCount:g(t.successCount??t.success_count,0),failureCount:g(t.failureCount??t.failure_count,0),createdAt:t.createdAt??t.created_at??null,_idx:a}}function me(t){const a=X(t);return Array.isArray(a)?a.map(qe).filter(Boolean):[]}function Be(t,a=0){if(!t||typeof t!="object")return null;const s=t.metricName??t.metric_name??"";return s?{key:s,metricName:s,mean:g(t.mean,0),stdDev:g(t.stdDev??t.std_dev,0),q1:g(t.q1,0),q3:g(t.q3,0),sampleCount:g(t.sampleCount??t.sample_count,0),updatedAt:t.updatedAt??t.updated_at??null,_idx:a}:null}function ye(t){const a=X(t);return Array.isArray(a)?a.map(Be).filter(Boolean):[]}function fe(t){const a=X(t);return!a||typeof a!="object"||Array.isArray(a)?null:{anomaly:!!a.anomaly,reason:a.reason||null,metricName:a.metricName??a.metric_name??"",value:g(a.value,0),algorithm:String(a.algorithm||""),score:g(a.score,0),threshold:g(a.threshold,0),baseline:a.baseline?{mean:g(a.baseline.mean,0),stdDev:g(a.baseline.stdDev??a.baseline.std_dev,0),q1:g(a.baseline.q1,0),q3:g(a.baseline.q3,0)}:null,incidentId:a.incidentId??a.incident_id??null,severity:a.severity||null}}const Je={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 be(t){const a=JSON.parse(JSON.stringify(Je)),s=X(t);if(!s||typeof s!="object"||Array.isArray(s))return a;if(s.incidents&&typeof s.incidents=="object"){if(a.incidents.total=g(s.incidents.total,0),a.incidents.avgResolveMs=g(s.incidents.avgResolveMs??s.incidents.avg_resolve_ms,0),s.incidents.bySeverity&&typeof s.incidents.bySeverity=="object")for(const e of Object.keys(a.incidents.bySeverity))a.incidents.bySeverity[e]=g(s.incidents.bySeverity[e],0);if(s.incidents.byStatus&&typeof s.incidents.byStatus=="object")for(const e of Object.keys(a.incidents.byStatus))a.incidents.byStatus[e]=g(s.incidents.byStatus[e],0)}return s.playbooks&&typeof s.playbooks=="object"&&(a.playbooks.total=g(s.playbooks.total,0),a.playbooks.enabled=g(s.playbooks.enabled,0),a.playbooks.totalSuccess=g(s.playbooks.totalSuccess??s.playbooks.total_success,0),a.playbooks.totalFailure=g(s.playbooks.totalFailure??s.playbooks.total_failure,0)),s.baselines&&typeof s.baselines=="object"&&(a.baselines.total=g(s.baselines.total,0),Array.isArray(s.baselines.metrics)&&(a.baselines.metrics=[...s.baselines.metrics])),a}function Ve(t){if(t==null||t==="")return"—";const a=typeof t=="number"?new Date(t):new Date(String(t));return isNaN(a.getTime())?String(t):a.toLocaleString("zh-CN",{hour12:!1})}const Ke={__name:"AIOps",setup(t,{expose:a}){a();const s=de(),{t:e}=ce(),P=C(!1),j=C(!1),w=C(!1),N=C([]),Y=C([]),$=C([]),D=C({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:[]}}),I=C("incidents"),A=C(""),T=C(""),Z=C(!1),R=C(!1),O=C(!1),B=C(!1),x=G({severity:"P3",metric:"",description:""}),_=G({name:"",triggerJson:"",stepsJson:""}),M=G({metric:"",values:""}),U=G({metric:"",value:null,algorithm:"z_score"}),q=C(null),ee=Q(()=>[{title:e("aiops.incidentCols.severity"),key:"severity",width:"90px"},{title:e("aiops.incidentCols.metric"),key:"metric",width:"160px"},{title:e("aiops.incidentCols.description"),key:"description"},{title:e("aiops.incidentCols.status"),key:"status",width:"100px"},{title:e("aiops.incidentCols.createdAt"),key:"createdAt",width:"160px"},{title:e("aiops.incidentCols.action"),key:"action",width:"220px"}]),F=Q(()=>[{title:e("aiops.playbookCols.name"),key:"name"},{title:e("aiops.playbookCols.enabled"),key:"enabled",width:"80px"},{title:e("aiops.playbookCols.stats"),key:"stats",width:"180px"},{title:e("aiops.playbookCols.createdAt"),key:"createdAt",width:"160px"},{title:e("aiops.playbookCols.action"),key:"action",width:"160px"}]),W=Q(()=>[{title:e("aiops.baselineCols.metric"),key:"metric"},{title:e("aiops.baselineCols.mean"),key:"mean",width:"180px"},{title:e("aiops.baselineCols.iqr"),key:"iqr",width:"180px"},{title:e("aiops.baselineCols.sampleCount"),key:"sampleCount",width:"90px"},{title:e("aiops.baselineCols.updatedAt"),key:"updatedAt",width:"160px"}]),J=Q(()=>D.value.incidents.byStatus.open+D.value.incidents.byStatus.acknowledged),V=Q(()=>{let n=N.value;return A.value&&(n=n.filter(d=>d.severity===A.value)),T.value&&(n=n.filter(d=>d.status===T.value)),n});function K(n){const d=`aiops.statusLabels.${n}`,m=e(d);return m===d?n:m}function ae(n){return{open:"red",acknowledged:"orange",resolved:"cyan",closed:"default"}[n]||"default"}function i(n){return{P0:"red",P1:"volcano",P2:"orange",P3:"gold"}[n]||"default"}function c(n){const d=`aiops.reasonLabels.${n}`,m=e(d);return m===d?n:m}function E(n,d){return n?n.length>d?n.slice(0,d)+"...":n:""}function ve(n){return!n||n<=0?e("aiops.duration.none"):n<1e3?`${n}ms`:n<6e4?`${(n/1e3).toFixed(1)}s`:n<36e5?`${(n/6e4).toFixed(1)}min`:`${(n/36e5).toFixed(1)}h`}function ge({key:n}){n==="incident"?Z.value=!0:n==="playbook"?R.value=!0:n==="baseline"?O.value=!0:n==="detect"&&(q.value=null,B.value=!0)}async function L(){P.value=!0;try{const[n,d,m,k]=await Promise.all([s.execute("ops incidents --limit 200 --json",1e4).catch(()=>({output:""})),s.execute("ops playbooks --limit 200 --json",1e4).catch(()=>({output:""})),s.execute("ops baselines --json",1e4).catch(()=>({output:""})),s.execute("ops stats --json",8e3).catch(()=>({output:""}))]);N.value=pe(n.output),Y.value=me(d.output),$.value=ye(m.output),D.value=be(k.output)}catch(n){f.error(e("aiops.msg.loadFailed")+": "+(n?.message||n))}finally{P.value=!1}}async function ke(){if(!x.description.trim()){f.warning(e("aiops.msg.descEmpty"));return}j.value=!0;try{const n=[`ops incident-create --severity ${x.severity}`];x.metric.trim()&&n.push(`--metric "${x.metric.trim().replace(/"/g,'\\"')}"`),n.push(`--description "${x.description.trim().replace(/"/g,'\\"')}"`),n.push("--json");const{output:d}=await s.execute(n.join(" "),1e4);if(/error|失败/i.test(d)&&!/"incidentId"/.test(d)){f.error(e("aiops.msg.createFailed")+": "+d.slice(0,120));return}f.success(e("aiops.msg.incidentCreated")),Z.value=!1,oe(),await L()}catch(n){f.error(e("aiops.msg.createFailed")+": "+(n?.message||n))}finally{j.value=!1}}async function _e(){if(!_.name.trim()){f.warning(e("aiops.msg.playbookNameEmpty"));return}for(const[n,d]of[[_.triggerJson,"triggerLabel"],[_.stepsJson,"stepsLabel"]])if(n.trim())try{JSON.parse(n)}catch{f.warning(e("aiops.msg.jsonInvalid",{label:e(`aiops.msg.${d}`)}));return}j.value=!0;try{const n=[`ops playbook-create --name "${_.name.trim().replace(/"/g,'\\"')}"`];_.triggerJson.trim()&&n.push(`--trigger '${_.triggerJson.trim().replace(/'/g,"'\\''")}'`),_.stepsJson.trim()&&n.push(`--steps '${_.stepsJson.trim().replace(/'/g,"'\\''")}'`),n.push("--json");const{output:d}=await s.execute(n.join(" "),1e4);if(/error|失败/i.test(d)&&!/"playbookId"/.test(d)){f.error(e("aiops.msg.createFailed")+": "+d.slice(0,120));return}f.success(e("aiops.msg.playbookCreated")),R.value=!1,le(),I.value="playbooks",await L()}catch(n){f.error(e("aiops.msg.createFailed")+": "+(n?.message||n))}finally{j.value=!1}}async function he(){const n=M.metric.trim();if(!n){f.warning(e("aiops.msg.metricEmpty"));return}const d=M.values.split(/[\s,]+/).map(m=>m.trim()).filter(Boolean).map(m=>Number(m));if(d.length===0||d.some(m=>!Number.isFinite(m))){f.warning(e("aiops.msg.valuesInvalid"));return}j.value=!0;try{const m=`ops baseline-update "${n.replace(/"/g,'\\"')}" --values ${d.join(",")} --json`,{output:k}=await s.execute(m,1e4);if(/error|失败/i.test(k)&&!/"updated"/.test(k)){f.error(e("aiops.msg.baselineUpdateFailed")+": "+k.slice(0,120));return}f.success(e("aiops.msg.baselineUpdated",{n:d.length})),O.value=!1,ie(),I.value="baselines",await L()}catch(m){f.error(e("aiops.msg.baselineUpdateFailed")+": "+(m?.message||m))}finally{j.value=!1}}async function Ce(){if(!U.metric||U.value==null){f.warning(e("aiops.msg.detectFieldsEmpty"));return}w.value=!0,q.value=null;try{const n=`ops detect "${U.metric.replace(/"/g,'\\"')}" ${U.value} --algorithm ${U.algorithm} --json`,{output:d}=await s.execute(n,8e3),m=fe(d);if(!m){f.error(e("aiops.msg.detectFailed")+": "+d.slice(0,120));return}q.value=m,m.anomaly&&(f.warning(e("aiops.msg.detectAnomaly",{severity:m.severity||"P3"})),L())}catch(n){f.error(e("aiops.msg.detectFailed")+": "+(n?.message||n))}finally{w.value=!1}}async function Se(n){await te(n,"incident-ack",e("aiops.msg.incidentAcked"))}async function xe(n){await te(n,"incident-resolve",e("aiops.msg.incidentResolved"))}async function Fe(n){await te(n,"incident-close",e("aiops.msg.incidentClosed"))}async function te(n,d,m){try{const{output:k}=await s.execute(`ops ${d} ${n.id} --json`,8e3);if(/error|失败|invalid/i.test(k)&&!/"acknowledged"|"resolved"|"closed"/.test(k)){f.error(e("aiops.msg.incidentTransitionFailed")+": "+k.slice(0,120));return}f.success(m),await L()}catch(k){f.error(e("aiops.msg.incidentTransitionFailed")+": "+(k?.message||k))}}async function we(n){try{const{output:d}=await s.execute(`ops postmortem ${n.id}`,12e3);ue.info({title:e("aiops.msg.postmortemTitle",{id:n.id.slice(0,8)}),width:720,content:()=>re("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;"},d||e("aiops.msg.postmortemEmpty"))})}catch(d){f.error(e("aiops.msg.postmortemFailed")+": "+(d?.message||d))}}async function Ae(n,d){const m=d?"on":"off";try{const{output:k}=await s.execute(`ops playbook-toggle ${n.id} ${m} --json`,8e3);if(/error|失败/i.test(k)&&!/"enabled"/.test(k)){f.error(e("aiops.msg.playbookToggleFailed")+": "+k.slice(0,120));return}f.success(e(d?"aiops.msg.playbookEnabled":"aiops.msg.playbookDisabled")),await L()}catch(k){f.error(e("aiops.msg.playbookToggleFailed")+": "+(k?.message||k))}}async function Re(n,d){try{const{output:m}=await s.execute(`ops playbook-record ${n.id} ${d} --json`,8e3);if(/error|失败/i.test(m)&&!/"recorded"/.test(m)){f.error(e("aiops.msg.playbookRecordFailed")+": "+m.slice(0,120));return}f.success(e(d==="success"?"aiops.msg.playbookRecordSuccess":"aiops.msg.playbookRecordFailure")),await L()}catch(m){f.error(e("aiops.msg.playbookRecordFailed")+": "+(m?.message||m))}}function oe(){x.severity="P3",x.metric="",x.description=""}function le(){_.name="",_.triggerJson="",_.stepsJson=""}function ie(){M.metric="",M.values=""}se(L);const ne={ws:s,t:e,loading:P,creating:j,detecting:w,incidents:N,playbooks:Y,baselines:$,stats:D,activeTab:I,incidentSeverityFilter:A,incidentStatusFilter:T,showIncidentModal:Z,showPlaybookModal:R,showBaselineModal:O,showDetectModal:B,incidentForm:x,playbookForm:_,baselineForm:M,detectForm:U,detectResult:q,incidentColumns:ee,playbookColumns:F,baselineColumns:W,openCount:J,filteredIncidents:V,statusLabel:K,statusColor:ae,severityColor:i,reasonLabel:c,truncate:E,formatDurationMs:ve,handleNewClick:ge,loadAll:L,createIncident:ke,createPlaybook:_e,updateBaseline:he,detectAnomaly:Ce,ackIncident:Se,resolveIncident:xe,closeIncident:Fe,runIncidentTransition:te,generatePostmortem:we,togglePlaybook:Ae,recordRun:Re,resetIncidentForm:oe,resetPlaybookForm:le,resetBaselineForm:ie,ref:C,computed:Q,onMounted:se,reactive:G,h:re,get ReloadOutlined(){return Ne},get PlusOutlined(){return je},get AlertOutlined(){return Le},get RocketOutlined(){return Ee},get LineChartOutlined(){return Te},get FundOutlined(){return Pe},get ExclamationCircleOutlined(){return Oe},get CheckCircleOutlined(){return Ie},get message(){return f},get Modal(){return ue},get useI18n(){return ce},get useWsStore(){return de},get parseIncidents(){return pe},get parsePlaybooks(){return me},get parseBaselines(){return ye},get parseDetectResult(){return fe},get parseStats(){return be},get formatOpsTime(){return Ve},get SEVERITIES(){return Ue},get INCIDENT_STATUSES(){return De}};return Object.defineProperty(ne,"__isScriptSetup",{enumerable:!1,value:!0}),ne}},Qe={style:{display:"flex","align-items":"center","justify-content":"space-between","margin-bottom":"24px"}},Ze={class:"page-title"},We={class:"page-sub"},Ge={style:{color:"var(--text-secondary)","font-size":"12px","margin-left":"8px"}},He={class:"filter-bar"},Xe={key:0,style:{color:"var(--text-primary)","font-family":"monospace","font-size":"12px"}},Ye={key:1,style:{color:"var(--text-muted)"}},$e={key:2,style:{color:"var(--text-secondary)","font-size":"12px"}},et={key:4,style:{color:"var(--text-secondary)","font-size":"11px"}},tt={style:{padding:"40px",color:"var(--text-muted)","text-align":"center"}},at={style:{color:"var(--text-primary)","font-weight":"500"}},ot={key:0,style:{color:"var(--text-secondary)","font-size":"11px","margin-top":"2px","font-family":"monospace"}},lt={key:3,style:{color:"var(--text-secondary)","font-size":"11px"}},it={style:{padding:"40px",color:"var(--text-muted)","text-align":"center"}},nt={key:0,style:{color:"var(--text-primary)","font-family":"monospace","font-weight":"500"}},st={style:{color:"#1677ff"}},rt={style:{color:"var(--text-secondary)","margin-left":"4px","font-size":"11px"}},dt={key:2,style:{color:"var(--text-secondary)","font-size":"12px"}},ct={key:4,style:{color:"var(--text-secondary)","font-size":"11px"}},ut={style:{padding:"40px",color:"var(--text-muted)","text-align":"center"}},pt={key:0,style:{color:"var(--text-secondary)","font-size":"12px","margin-top":"8px"}},mt={key:1,style:{"margin-top":"12px","font-size":"12px",color:"var(--text-secondary)"}},yt={key:2,style:{"margin-top":"8px"}};function ft(t,a,s,e,P,j){const w=b("a-button"),N=b("a-menu-item"),Y=b("a-menu"),$=b("a-dropdown"),D=b("a-space"),I=b("a-statistic"),A=b("a-card"),T=b("a-col"),Z=b("a-row"),R=b("a-tag"),O=b("a-radio-button"),B=b("a-radio-group"),x=b("a-table"),_=b("a-tab-pane"),M=b("a-switch"),U=b("a-tabs"),q=b("a-select-option"),ee=b("a-select"),F=b("a-form-item"),W=b("a-input"),J=b("a-textarea"),V=b("a-form"),K=b("a-modal"),ae=b("a-input-number");return u(),v("div",null,[S("div",Qe,[S("div",null,[S("h2",Ze,r(t.$t("aiops.title")),1),S("p",We,r(t.$t("aiops.subtitle")),1)]),o(D,null,{default:l(()=>[o(w,{loading:e.loading,onClick:e.loadAll},{icon:l(()=>[o(e.ReloadOutlined)]),default:l(()=>[y(" "+r(t.$t("aiops.refresh")),1)]),_:1},8,["loading"]),o($,{trigger:["click"]},{overlay:l(()=>[o(Y,{onClick:e.handleNewClick},{default:l(()=>[o(N,{key:"incident"},{default:l(()=>[o(e.AlertOutlined),y(" "+r(t.$t("aiops.actions.incident")),1)]),_:1}),o(N,{key:"playbook"},{default:l(()=>[o(e.RocketOutlined),y(" "+r(t.$t("aiops.actions.playbook")),1)]),_:1}),o(N,{key:"baseline"},{default:l(()=>[o(e.LineChartOutlined),y(" "+r(t.$t("aiops.actions.baseline")),1)]),_:1}),o(N,{key:"detect"},{default:l(()=>[o(e.FundOutlined),y(" "+r(t.$t("aiops.actions.detect")),1)]),_:1})]),_:1})]),default:l(()=>[o(w,{type:"primary"},{icon:l(()=>[o(e.PlusOutlined)]),default:l(()=>[y(" "+r(t.$t("aiops.newDropdown")),1)]),_:1})]),_:1})]),_:1})]),p(" Stats overview "),o(Z,{gutter:[16,16],style:{"margin-bottom":"20px"}},{default:l(()=>[o(T,{xs:12,sm:8,lg:5},{default:l(()=>[o(A,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[o(I,{title:t.$t("aiops.stats.incidents"),value:e.stats.incidents.total,"value-style":{color:"#1677ff",fontSize:"20px"}},{prefix:l(()=>[o(e.AlertOutlined)]),_:1},8,["title","value"])]),_:1})]),_:1}),o(T,{xs:12,sm:8,lg:5},{default:l(()=>[o(A,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[o(I,{title:t.$t("aiops.stats.pending"),value:e.stats.incidents.byStatus.open+e.stats.incidents.byStatus.acknowledged,"value-style":{color:e.openCount>0?"#ff4d4f":"#52c41a",fontSize:"20px"}},{prefix:l(()=>[o(e.ExclamationCircleOutlined)]),_:1},8,["title","value","value-style"])]),_:1})]),_:1}),o(T,{xs:12,sm:8,lg:5},{default:l(()=>[o(A,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[o(I,{title:t.$t("aiops.stats.playbooks"),value:e.stats.playbooks.total,"value-style":{color:"#722ed1",fontSize:"20px"}},{prefix:l(()=>[o(e.RocketOutlined)]),_:1},8,["title","value"])]),_:1})]),_:1}),o(T,{xs:12,sm:8,lg:5},{default:l(()=>[o(A,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[o(I,{title:t.$t("aiops.stats.enabled"),value:e.stats.playbooks.enabled,"value-style":{color:"#52c41a",fontSize:"20px"}},{prefix:l(()=>[o(e.CheckCircleOutlined)]),_:1},8,["title","value"])]),_:1})]),_:1}),o(T,{xs:24,sm:8,lg:4},{default:l(()=>[o(A,{style:{background:"var(--bg-card)","border-color":"var(--border-color)"}},{default:l(()=>[o(I,{title:t.$t("aiops.stats.baselines"),value:e.stats.baselines.total,"value-style":{color:"#13c2c2",fontSize:"20px"}},{prefix:l(()=>[o(e.LineChartOutlined)]),_:1},8,["title","value"])]),_:1})]),_:1})]),_:1}),p(" Severity breakdown bar "),e.stats.incidents.total>0?(u(),h(A,{key:0,title:t.$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(()=>[o(D,{size:[12,8],wrap:""},{default:l(()=>[(u(!0),v(z,null,H(e.SEVERITIES,i=>(u(),h(R,{key:i,color:e.severityColor(i),style:{"font-size":"13px",padding:"2px 10px"}},{default:l(()=>[y(r(i)+": "+r(e.stats.incidents.bySeverity[i]||0),1)]),_:2},1032,["color"]))),128)),S("span",Ge,r(t.$t("aiops.avgResolveLabel",{time:e.formatDurationMs(e.stats.incidents.avgResolveMs)})),1)]),_:1})]),_:1},8,["title"])):p("v-if",!0),p(" Tabs "),o(U,{activeKey:e.activeTab,"onUpdate:activeKey":a[2]||(a[2]=i=>e.activeTab=i),class:"aiops-tabs"},{default:l(()=>[p(" ── Incidents tab ─────────────────────────────────────────── "),o(_,{key:"incidents",tab:t.$t("aiops.tabs.incidents")},{default:l(()=>[S("div",He,[o(B,{value:e.incidentSeverityFilter,"onUpdate:value":a[0]||(a[0]=i=>e.incidentSeverityFilter=i),size:"small","button-style":"solid"},{default:l(()=>[o(O,{value:""},{default:l(()=>[y(r(t.$t("aiops.filter.all")),1)]),_:1}),(u(!0),v(z,null,H(e.SEVERITIES,i=>(u(),h(O,{key:i,value:i},{default:l(()=>[y(r(i),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"]),o(B,{value:e.incidentStatusFilter,"onUpdate:value":a[1]||(a[1]=i=>e.incidentStatusFilter=i),size:"small"},{default:l(()=>[o(O,{value:""},{default:l(()=>[y(r(t.$t("aiops.filter.allStatuses")),1)]),_:1}),(u(!0),v(z,null,H(e.INCIDENT_STATUSES,i=>(u(),h(O,{key:i,value:i},{default:l(()=>[y(r(e.statusLabel(i)),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),o(x,{columns:e.incidentColumns,"data-source":e.filteredIncidents,pagination:{pageSize:20,showTotal:i=>t.$t("aiops.table.totalSuffix",{n:i})},size:"small",loading:e.loading,style:{background:"var(--bg-card)"}},{bodyCell:l(({column:i,record:c})=>[i.key==="severity"?(u(),h(R,{key:0,color:e.severityColor(c.severity),style:{"font-weight":"600"}},{default:l(()=>[y(r(c.severity),1)]),_:2},1032,["color"])):p("v-if",!0),i.key==="metric"?(u(),v(z,{key:1},[c.anomalyMetric?(u(),v("span",Xe,r(c.anomalyMetric),1)):(u(),v("span",Ye,"—"))],64)):p("v-if",!0),i.key==="description"?(u(),v("span",$e,r(e.truncate(c.description,80)||"—"),1)):p("v-if",!0),i.key==="status"?(u(),h(R,{key:3,color:e.statusColor(c.status)},{default:l(()=>[y(r(e.statusLabel(c.status)),1)]),_:2},1032,["color"])):p("v-if",!0),i.key==="createdAt"?(u(),v("span",et,r(e.formatOpsTime(c.createdAt)),1)):p("v-if",!0),i.key==="action"?(u(),v(z,{key:5},[c.status==="open"?(u(),h(w,{key:0,size:"small",type:"link",onClick:E=>e.ackIncident(c)},{default:l(()=>[y(r(t.$t("aiops.incidentActions.ack")),1)]),_:1},8,["onClick"])):p("v-if",!0),c.status==="open"||c.status==="acknowledged"?(u(),h(w,{key:1,size:"small",type:"link",onClick:E=>e.resolveIncident(c)},{default:l(()=>[y(r(t.$t("aiops.incidentActions.resolve")),1)]),_:1},8,["onClick"])):p("v-if",!0),c.status==="resolved"?(u(),h(w,{key:2,size:"small",type:"link",onClick:E=>e.closeIncident(c)},{default:l(()=>[y(r(t.$t("aiops.incidentActions.close")),1)]),_:1},8,["onClick"])):p("v-if",!0),c.status==="resolved"||c.status==="closed"?(u(),h(w,{key:3,size:"small",type:"link",onClick:E=>e.generatePostmortem(c)},{default:l(()=>[y(r(t.$t("aiops.incidentActions.postmortem")),1)]),_:1},8,["onClick"])):p("v-if",!0)],64)):p("v-if",!0)]),emptyText:l(()=>[S("div",tt,[o(e.AlertOutlined,{style:{"font-size":"36px","margin-bottom":"10px",display:"block"}}),y(" "+r(e.incidentSeverityFilter||e.incidentStatusFilter?t.$t("aiops.table.incidentEmptyFiltered"):t.$t("aiops.table.incidentEmpty")),1)])]),_:1},8,["columns","data-source","pagination","loading"])]),_:1},8,["tab"]),p(" ── Playbooks tab ─────────────────────────────────────────── "),o(_,{key:"playbooks",tab:t.$t("aiops.tabs.playbooks")},{default:l(()=>[o(x,{columns:e.playbookColumns,"data-source":e.playbooks,pagination:{pageSize:20,showTotal:i=>t.$t("aiops.table.totalSuffix",{n:i})},size:"small",loading:e.loading,style:{background:"var(--bg-card)"}},{bodyCell:l(({column:i,record:c})=>[i.key==="name"?(u(),v(z,{key:0},[S("span",at,r(c.name),1),c.triggerCondition?(u(),v("div",ot,r(e.truncate(c.triggerCondition,80)),1)):p("v-if",!0)],64)):p("v-if",!0),i.key==="enabled"?(u(),h(M,{key:1,checked:c.enabled,size:"small",onChange:E=>e.togglePlaybook(c,E)},null,8,["checked","onChange"])):p("v-if",!0),i.key==="stats"?(u(),v(z,{key:2},[o(R,{color:"green",style:{"font-size":"11px"}},{default:l(()=>[y(r(t.$t("aiops.table.successCount",{n:c.successCount})),1)]),_:2},1024),c.failureCount>0?(u(),h(R,{key:0,color:"red",style:{"font-size":"11px","margin-left":"4px"}},{default:l(()=>[y(r(t.$t("aiops.table.failureCount",{n:c.failureCount})),1)]),_:2},1024)):p("v-if",!0)],64)):p("v-if",!0),i.key==="createdAt"?(u(),v("span",lt,r(e.formatOpsTime(c.createdAt)),1)):p("v-if",!0),i.key==="action"?(u(),v(z,{key:4},[o(w,{size:"small",type:"link",onClick:E=>e.recordRun(c,"success")},{default:l(()=>[y(r(t.$t("aiops.playbookActions.success")),1)]),_:1},8,["onClick"]),o(w,{size:"small",type:"link",danger:"",onClick:E=>e.recordRun(c,"failure")},{default:l(()=>[y(r(t.$t("aiops.playbookActions.failure")),1)]),_:1},8,["onClick"])],64)):p("v-if",!0)]),emptyText:l(()=>[S("div",it,[o(e.RocketOutlined,{style:{"font-size":"36px","margin-bottom":"10px",display:"block"}}),y(" "+r(t.$t("aiops.table.playbookEmpty")),1)])]),_:1},8,["columns","data-source","pagination","loading"])]),_:1},8,["tab"]),p(" ── Baselines tab ─────────────────────────────────────────── "),o(_,{key:"baselines",tab:t.$t("aiops.tabs.baselines")},{default:l(()=>[o(x,{columns:e.baselineColumns,"data-source":e.baselines,pagination:{pageSize:20,showTotal:i=>t.$t("aiops.table.totalSuffix",{n:i})},size:"small",loading:e.loading,style:{background:"var(--bg-card)"}},{bodyCell:l(({column:i,record:c})=>[i.key==="metric"?(u(),v("span",nt,r(c.metricName),1)):p("v-if",!0),i.key==="mean"?(u(),v(z,{key:1},[S("span",st,r(c.mean),1),S("span",rt,"σ "+r(c.stdDev),1)],64)):p("v-if",!0),i.key==="iqr"?(u(),v("span",dt," Q1 "+r(c.q1)+" / Q3 "+r(c.q3),1)):p("v-if",!0),i.key==="sampleCount"?(u(),h(R,{key:3,color:"blue",style:{"font-size":"11px"}},{default:l(()=>[y(r(c.sampleCount),1)]),_:2},1024)):p("v-if",!0),i.key==="updatedAt"?(u(),v("span",ct,r(e.formatOpsTime(c.updatedAt)),1)):p("v-if",!0)]),emptyText:l(()=>[S("div",ut,[o(e.LineChartOutlined,{style:{"font-size":"36px","margin-bottom":"10px",display:"block"}}),y(" "+r(t.$t("aiops.table.baselineEmpty")),1)])]),_:1},8,["columns","data-source","pagination","loading"])]),_:1},8,["tab"])]),_:1},8,["activeKey"]),p(" ── Create incident modal ─────────────────────────────────── "),o(K,{open:e.showIncidentModal,"onUpdate:open":a[6]||(a[6]=i=>e.showIncidentModal=i),title:t.$t("aiops.incident_modal.title"),"confirm-loading":e.creating,width:520,"ok-text":t.$t("aiops.incident_modal.ok"),"cancel-text":t.$t("aiops.incident_modal.cancel"),onOk:e.createIncident,onCancel:e.resetIncidentForm},{default:l(()=>[o(V,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[o(F,{label:t.$t("aiops.incident_modal.severityLabel")},{default:l(()=>[o(ee,{value:e.incidentForm.severity,"onUpdate:value":a[3]||(a[3]=i=>e.incidentForm.severity=i)},{default:l(()=>[(u(!0),v(z,null,H(e.SEVERITIES,i=>(u(),h(q,{key:i,value:i},{default:l(()=>[y(r(i),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.incident_modal.metricLabel")},{default:l(()=>[o(W,{value:e.incidentForm.metric,"onUpdate:value":a[4]||(a[4]=i=>e.incidentForm.metric=i),placeholder:t.$t("aiops.incident_modal.metricPlaceholder")},null,8,["value","placeholder"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.incident_modal.descLabel"),required:""},{default:l(()=>[o(J,{value:e.incidentForm.description,"onUpdate:value":a[5]||(a[5]=i=>e.incidentForm.description=i),"auto-size":{minRows:3,maxRows:6}},null,8,["value"])]),_:1},8,["label"])]),_:1})]),_:1},8,["open","title","confirm-loading","ok-text","cancel-text"]),p(" ── Create playbook modal ─────────────────────────────────── "),o(K,{open:e.showPlaybookModal,"onUpdate:open":a[10]||(a[10]=i=>e.showPlaybookModal=i),title:t.$t("aiops.playbook_modal.title"),"confirm-loading":e.creating,width:540,"ok-text":t.$t("aiops.playbook_modal.ok"),"cancel-text":t.$t("aiops.playbook_modal.cancel"),onOk:e.createPlaybook,onCancel:e.resetPlaybookForm},{default:l(()=>[o(V,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[o(F,{label:t.$t("aiops.playbook_modal.nameLabel"),required:""},{default:l(()=>[o(W,{value:e.playbookForm.name,"onUpdate:value":a[7]||(a[7]=i=>e.playbookForm.name=i),placeholder:t.$t("aiops.playbook_modal.namePlaceholder")},null,8,["value","placeholder"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.playbook_modal.triggerLabel")},{default:l(()=>[o(J,{value:e.playbookForm.triggerJson,"onUpdate:value":a[8]||(a[8]=i=>e.playbookForm.triggerJson=i),placeholder:t.$t("aiops.playbook_modal.triggerPlaceholder"),"auto-size":{minRows:2,maxRows:4}},null,8,["value","placeholder"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.playbook_modal.stepsLabel")},{default:l(()=>[o(J,{value:e.playbookForm.stepsJson,"onUpdate:value":a[9]||(a[9]=i=>e.playbookForm.stepsJson=i),placeholder:t.$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"]),p(" ── Update baseline modal ─────────────────────────────────── "),o(K,{open:e.showBaselineModal,"onUpdate:open":a[13]||(a[13]=i=>e.showBaselineModal=i),title:t.$t("aiops.baseline_modal.title"),"confirm-loading":e.creating,width:500,"ok-text":t.$t("aiops.baseline_modal.ok"),"cancel-text":t.$t("aiops.baseline_modal.cancel"),onOk:e.updateBaseline,onCancel:e.resetBaselineForm},{default:l(()=>[o(V,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[o(F,{label:t.$t("aiops.baseline_modal.metricLabel"),required:""},{default:l(()=>[o(W,{value:e.baselineForm.metric,"onUpdate:value":a[11]||(a[11]=i=>e.baselineForm.metric=i),placeholder:t.$t("aiops.baseline_modal.metricPlaceholder")},null,8,["value","placeholder"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.baseline_modal.valuesLabel"),required:""},{default:l(()=>[o(J,{value:e.baselineForm.values,"onUpdate:value":a[12]||(a[12]=i=>e.baselineForm.values=i),placeholder:t.$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"]),p(" ── Detect anomaly modal ──────────────────────────────────── "),o(K,{open:e.showDetectModal,"onUpdate:open":a[17]||(a[17]=i=>e.showDetectModal=i),title:t.$t("aiops.detect_modal.title"),"confirm-loading":e.detecting,width:500,"ok-text":t.$t("aiops.detect_modal.ok"),"cancel-text":t.$t("aiops.detect_modal.cancel"),onOk:e.detectAnomaly},{default:l(()=>[o(V,{"label-col":{span:5},"wrapper-col":{span:19},style:{"margin-top":"16px"}},{default:l(()=>[o(F,{label:t.$t("aiops.detect_modal.metricLabel"),required:""},{default:l(()=>[o(ee,{value:e.detectForm.metric,"onUpdate:value":a[14]||(a[14]=i=>e.detectForm.metric=i),"show-search":"",placeholder:t.$t("aiops.detect_modal.metricPlaceholder")},{default:l(()=>[(u(!0),v(z,null,H(e.baselines,i=>(u(),h(q,{key:i.metricName,value:i.metricName},{default:l(()=>[y(r(t.$t("aiops.detect_modal.metricOptionLabel",{name:i.metricName,count:i.sampleCount})),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value","placeholder"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.detect_modal.valueLabel"),required:""},{default:l(()=>[o(ae,{value:e.detectForm.value,"onUpdate:value":a[15]||(a[15]=i=>e.detectForm.value=i),style:{width:"100%"}},null,8,["value"])]),_:1},8,["label"]),o(F,{label:t.$t("aiops.detect_modal.algorithmLabel")},{default:l(()=>[o(B,{value:e.detectForm.algorithm,"onUpdate:value":a[16]||(a[16]=i=>e.detectForm.algorithm=i)},{default:l(()=>[o(O,{value:"z_score"},{default:l(()=>[...a[18]||(a[18]=[y("Z-Score (3σ)",-1)])]),_:1}),o(O,{value:"iqr"},{default:l(()=>[...a[19]||(a[19]=[y("IQR (1.5×)",-1)])]),_:1})]),_:1},8,["value"])]),_:1},8,["label"])]),_:1}),e.detectResult?(u(),h(A,{key:0,size:"small",style:{background:"var(--bg-base)","margin-top":"8px"}},{default:l(()=>[o(I,{title:t.$t("aiops.detect_modal.resultTitle"),value:e.detectResult.anomaly?t.$t("aiops.detect_modal.anomaly"):t.$t("aiops.detect_modal.normal"),"value-style":{color:e.detectResult.anomaly?"#ff4d4f":"#52c41a"}},null,8,["title","value","value-style"]),e.detectResult.reason&&!e.detectResult.anomaly?(u(),v("div",pt,r(t.$t("aiops.detect_modal.reasonLine",{reason:e.reasonLabel(e.detectResult.reason)})),1)):p("v-if",!0),e.detectResult.baseline?(u(),v("div",mt,[S("div",null,r(t.$t("aiops.detect_modal.scoreLine",{score:e.detectResult.score,threshold:e.detectResult.threshold})),1),S("div",null,r(t.$t("aiops.detect_modal.baselineLine",{mean:e.detectResult.baseline.mean,stdDev:e.detectResult.baseline.stdDev})),1)])):p("v-if",!0),e.detectResult.incidentId?(u(),v("div",yt,[o(R,{color:e.severityColor(e.detectResult.severity)},{default:l(()=>[y(r(t.$t("aiops.detect_modal.incidentCreated",{severity:e.detectResult.severity})),1)]),_:1},8,["color"])])):p("v-if",!0)]),_:1})):p("v-if",!0)]),_:1},8,["open","title","confirm-loading","ok-text","cancel-text"])])}const Dt=ze(Ke,[["render",ft],["__scopeId","data-v-b804918b"],["__file","/tmp/cc-web-panel-7zjqPd/repo/packages/web-panel/src/views/AIOps.vue"]]);export{Dt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{O as b,f as i,v as p}from"./index-
|
|
1
|
+
import{O as b,f as i,v as p}from"./index-fk2Rjacw.js";import{f as m,s as r,d as O,o as y,c as P}from"./vendor-Bn1JzzAn.js";import{B as R,c as x}from"./index-sDoMHTNA.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=O({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();y(()=>{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 P(R,i(i(i({},x(e)),{},{onClick:C,loading:a.value,prefixCls:t},o),{},{ref:c}),B)}}});export{j as A};
|