@yuku123/z-cognition-component 2.0.2 → 2.0.3
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/dist-lib/BaseInput-DHrGPDB9.js +1096 -0
- package/dist-lib/ClockCircleOutlined-DP6fSLgk.js +12 -0
- package/dist-lib/Collapse-B77SsmFh.js +523 -0
- package/dist-lib/{ConceptsPage-BOeKdDKI.js → ConceptsPage-DOf_CJlz.js} +13 -16
- package/dist-lib/DeleteOutlined-BAZSAooQ.js +12 -0
- package/dist-lib/{DocsPage-BZOBFp3c.js → DocsPage-CiC7TU96.js} +4 -4
- package/dist-lib/EllipsisOutlined-Dr4orLLw.js +1109 -0
- package/dist-lib/EvidenceFormList-CrE2FzHk.js +90 -0
- package/dist-lib/{EyeOutlined-DGSrX-0M.js → EyeOutlined-CudyDdjH.js} +1 -1
- package/dist-lib/ImpactPage-CYiuqy0S.js +68 -0
- package/dist-lib/{LeftOutlined-Cgo6Izj-.js → LeftOutlined-CJasZIyX.js} +1 -1
- package/dist-lib/{OntologyDetailPage-B8DyU8WW.js → OntologyDetailPage-mgK_NQxP.js} +99 -93
- package/dist-lib/{OntologyInferPage-CvcjxpBB.js → OntologyInferPage-NUaoaQpN.js} +38 -40
- package/dist-lib/{OntologyListPage-Cb0XfpWE.js → OntologyListPage-C9wH01y0.js} +47 -49
- package/dist-lib/OntologyMaterializePage-D_fDqYHY.js +134 -0
- package/dist-lib/OntologyNodesPage-5kH7RHwE.js +2844 -0
- package/dist-lib/{OntologyValidatePage-abQVJwzV.js → OntologyValidatePage-DtkYK_l4.js} +49 -52
- package/dist-lib/Pagination-BJ8wnqAa.js +1112 -0
- package/dist-lib/PlusOutlined-BSTPGLOH.js +21 -0
- package/dist-lib/{ReloadOutlined-CS-e-TmN.js → ReloadOutlined-B26pDoyV.js} +19 -10
- package/dist-lib/{ResolvePage-rbQ-8nNZ.js → ResolvePage-Cz9HORZ3.js} +31 -33
- package/dist-lib/{RotateRightOutlined-q7zp2e47.js → RotateRightOutlined-DqyspFCO.js} +1 -1
- package/dist-lib/Skeleton-CxFsInYI.js +671 -0
- package/dist-lib/Table-Civ838nE.js +20514 -0
- package/dist-lib/{Table-CDagah-g.js → Table-J_7eBbi7.js} +414 -414
- package/dist-lib/TermDetailPage-BtkOpbPT.js +263 -0
- package/dist-lib/{TermsPage-CuufAyuL.js → TermsPage-BuzCMYov.js} +28 -31
- package/dist-lib/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist-lib/accessAk-CA30m5eX.js +64 -0
- package/dist-lib/{agents-CvgRLQw2.js → agents-eZDKzePP.js} +41 -41
- package/dist-lib/{ai-DYDhijtn.js → ai-CNSn3-sd.js} +32 -32
- package/dist-lib/{ai-chat-share-DJnybJtS.js → ai-chat-share-Yrqt_J6a.js} +13 -14
- package/dist-lib/ak-manage-DklVFT5I.js +805 -0
- package/dist-lib/{approval-3IbhY8Lp.js → approval-B-bCSmfi.js} +25 -26
- package/dist-lib/{approvals-Cd6CVzz4.js → approvals-B0ggYiyD.js} +42 -43
- package/dist-lib/{assistant-cIXgilaE.js → assistant-Of0mgMsM.js} +33 -34
- package/dist-lib/{assistant-history-BQzH4ChB.js → assistant-history-DcyDhUzJ.js} +5 -5
- package/dist-lib/{assistant-summary-LKTj_HKM.js → assistant-summary-CjLaTyFz.js} +1 -1
- package/dist-lib/{audit-CxuJ5unU.js → audit-wDNCfmOy.js} +1 -1
- package/dist-lib/{bios-BplnCOF4.js → bios-CIwO1AUK.js} +128 -130
- package/dist-lib/callSuper-CpMOVGin.js +7 -0
- package/dist-lib/callSuper-CwIeyYoc.js +7 -0
- package/dist-lib/category-9gqNseEa.js +76 -0
- package/dist-lib/causal-CzAYukj9.js +789 -0
- package/dist-lib/{changelog-BoGqt_81.js → changelog-CQfIMS51.js} +2 -2
- package/dist-lib/changelog-sKJMQrlV.js +103 -0
- package/dist-lib/chat-panel-BPbqKckR.js +1543 -0
- package/dist-lib/chunk-6KYCQHYJ-DcgZQlO5.js +1627 -0
- package/dist-lib/code-space-D_ZE966E.js +1070 -0
- package/dist-lib/{colors-sdAcAcU3.js → colors-DpKdb8L-.js} +3 -3
- package/dist-lib/community-9_7ExHcm.js +70 -0
- package/dist-lib/community-CfWXxujB.js +217 -0
- package/dist-lib/community-material-page-Z_EZuBPl.js +747 -0
- package/dist-lib/connections-Bcqsp11M.js +1065 -0
- package/dist-lib/context-T27uno74.js +54 -0
- package/dist-lib/{createForOfIteratorHelper-DEx_aTey.js → createForOfIteratorHelper-CasBzL_Q.js} +1 -1
- package/dist-lib/{dayjs.min-BauDENhn.js → dayjs.min-DoEf5yCX.js} +1 -1
- package/dist-lib/detail-CV6xp_Jp.js +84 -0
- package/dist-lib/{detail-BaX7WiWV.js → detail-DioaWKWj.js} +5847 -7224
- package/dist-lib/{detail-Cx5c4KJH.js → detail-EyLdjGpX.js} +71 -72
- package/dist-lib/development-CFcOIUKc.js +167 -0
- package/dist-lib/{docx-preview-B5nQuTwk.js → docx-preview-D4v2g8Yg.js} +1 -1
- package/dist-lib/{downloads-C3Oz04OW.js → downloads-DtV5hOQv.js} +3 -4
- package/dist-lib/{edit-Cbn2eJaJ.js → edit-NtXUNj5N.js} +262 -266
- package/dist-lib/{editor-mtaJBQXz.js → editor-KZhj-rwT.js} +25 -26
- package/dist-lib/editor-page-BaxK_OYm.js +1169 -0
- package/dist-lib/embed-mf8t3QXh.js +51841 -0
- package/dist-lib/embed.css +2 -2
- package/dist-lib/{evaluation-BoHiY8yT.js → evaluation-CZTpC9v3.js} +14 -15
- package/dist-lib/execution-B6HmOA2_.js +159 -0
- package/dist-lib/focus-set-lt52maBX.js +38 -0
- package/dist-lib/{format-UGmYKemG.js → format-CWI99NCN.js} +1 -1
- package/dist-lib/graph-BllA9bmL.js +44 -0
- package/dist-lib/graph-DHV-rdiK.js +640 -0
- package/dist-lib/{index-o65vKUwa.js → index--AI-htgA.js} +44 -45
- package/dist-lib/index-2SysmGHo.js +1166 -0
- package/dist-lib/{index-Bm1sK-VN.js → index-3J47mTL1.js} +10 -10
- package/dist-lib/index-4tbtbcAt.js +550 -0
- package/dist-lib/index-B12ZggsE.js +77 -0
- package/dist-lib/{index-D3GHtSlM.js → index-B5Roo82U.js} +49 -50
- package/dist-lib/{index-nQSVLWfW.js → index-B7SfTpox.js} +79 -81
- package/dist-lib/index-BEO8itgt.js +566 -0
- package/dist-lib/index-BPbOPT2j.js +413 -0
- package/dist-lib/index-BVgdmf6r.js +2487 -0
- package/dist-lib/index-Bd7AGv4a.js +34 -0
- package/dist-lib/index-BkJjYgKD.js +5012 -0
- package/dist-lib/{index-DBlG9uXV.js → index-BkTegt8T.js} +513 -590
- package/dist-lib/{index-B22_2Dzh.js → index-Bln3mJfp.js} +2 -2
- package/dist-lib/index-BoCtPJD4.js +915 -0
- package/dist-lib/{index-DMTPsTna.js → index-BqTsLClH.js} +3 -4
- package/dist-lib/index-Bs4MevzC.js +16075 -0
- package/dist-lib/index-BsoHetYT.js +236 -0
- package/dist-lib/{index-9aQ4BzIK.js → index-BvJ35WL3.js} +13 -14
- package/dist-lib/{index-BEjXaDfk.js → index-Bw4M9KLv.js} +84 -85
- package/dist-lib/index-C2CV4bte.js +242 -0
- package/dist-lib/{index-BSlCGnzo.js → index-CF0ucN_K.js} +12 -12
- package/dist-lib/{index-B57Fj7Y0.js → index-CLhLA2ig.js} +92 -94
- package/dist-lib/{index-Vu6sPBci.js → index-CSJA8wvL.js} +301 -296
- package/dist-lib/index-CSnvcFg-.js +543 -0
- package/dist-lib/{index-C3AMwzIi.js → index-CZipVp1G.js} +1 -1
- package/dist-lib/{index-ounfql2z.js → index-CdJ5ggvp.js} +26 -28
- package/dist-lib/index-CgwK2maq.js +1987 -0
- package/dist-lib/{index-Bc-Vin3j.js → index-CtqUgNxs.js} +53 -55
- package/dist-lib/index-CvxfA0ZK.js +215 -0
- package/dist-lib/{index-y7jVGGI0.js → index-CwyFMPcr.js} +16 -18
- package/dist-lib/index-D35Ry0PG.js +1162 -0
- package/dist-lib/{index-Cj4DDWyj.js → index-D6ns_Xmf.js} +10 -11
- package/dist-lib/{index-DsuUGhTA.js → index-DGbjbjBY.js} +46 -48
- package/dist-lib/index-DKAGVWMX.js +390 -0
- package/dist-lib/index-DQ16Zb7x.js +546 -0
- package/dist-lib/index-DRcTwC17.js +418 -0
- package/dist-lib/index-DU6bO95v.js +2075 -0
- package/dist-lib/index-DaMLYomP.js +853 -0
- package/dist-lib/index-Dd9pPAT3.js +2192 -0
- package/dist-lib/{index-CHBNrCMy.js → index-DgfIEgir.js} +29 -29
- package/dist-lib/{index-Cy9i4Kx7.js → index-DhSCFLtV.js} +113 -117
- package/dist-lib/index-DxzorPvG.js +13960 -0
- package/dist-lib/index-If4xc1-H.js +559 -0
- package/dist-lib/index-QZ9JPfVR.js +251 -0
- package/dist-lib/index-VeAMz0iC.js +1719 -0
- package/dist-lib/index-mUlorJxp.js +3279 -0
- package/dist-lib/{index-CLTfICbf.js → index-xQmDaKK3.js} +6 -6
- package/dist-lib/{index-BwVZgt5s.js → index-zXwXfn-X.js} +48 -50
- package/dist-lib/index.js +3 -4
- package/dist-lib/json-field-COcz5F2R.js +196 -0
- package/dist-lib/{jszip.min-DcEHhn-b.js → jszip.min-dcaDnWUw.js} +1 -1
- package/dist-lib/{kb-form-modal-B0rM1ZvV.js → kb-form-modal-D9gnvXbE.js} +67 -67
- package/dist-lib/{kbTeam-Bh_FQH28.js → kbTeam-CorrPJFr.js} +3 -3
- package/dist-lib/{knowledge-base-Cl1Ka1e6.js → knowledge-base-DJkjMFHW.js} +103 -104
- package/dist-lib/{knowledge-hub-CPuzdRiq.js → knowledge-hub-DKiDlaZz.js} +54 -55
- package/dist-lib/login-56zv4aLO.js +36 -0
- package/dist-lib/{markdown-lite-Cu62Fl7J.js → markdown-lite-p1tiuSZM.js} +198 -202
- package/dist-lib/material-DtPASeqq.js +204 -0
- package/dist-lib/material-draft-markdown-281d5_GN.js +443 -0
- package/dist-lib/material-original-preview-CPGjdmbe.js +214 -0
- package/dist-lib/{material-preview-docx-CH-09KeC.js → material-preview-docx-lp_xPipj.js} +1 -1
- package/dist-lib/{material-preview-pptx-D8XGDF-u.js → material-preview-pptx-6Byitp0J.js} +1 -1
- package/dist-lib/material-workspace-model-QLsU5qUO.js +328 -0
- package/dist-lib/{member-DKDx77PD.js → member-Cz-OIdj9.js} +1 -1
- package/dist-lib/memory-reorganization-DgJnWIrW.js +8 -0
- package/dist-lib/memory-spaces-D-orVNR7.js +2340 -0
- package/dist-lib/{message-Dievi8Jw.js → message-C9gfvpGg.js} +1 -1
- package/dist-lib/{message-BrooQ3Q7.js → message-D6FhzB7J.js} +24 -25
- package/dist-lib/{messages-xTNmTS9g.js → messages-cctmEVcG.js} +15 -16
- package/dist-lib/meta-DT_O4zM9.js +708 -0
- package/dist-lib/{metrics-DiHYqBKB.js → metrics-BNeVcI8-.js} +2 -2
- package/dist-lib/mobile-D8kZjfQU.js +2413 -0
- package/dist-lib/{monitor-BXsdMJSV.js → monitor-DTUyqumg.js} +4 -4
- package/dist-lib/{monitor-BBCu3zRe.js → monitor-DexMYjzF.js} +8 -8
- package/dist-lib/{my-access-CEGErUgv.js → my-access-DWBV6ohp.js} +120 -132
- package/dist-lib/{my-permissions-wSr5zv7g.js → my-permissions-B-gJZQYM.js} +22 -23
- package/dist-lib/navigation-DVlyWnpD.js +102 -0
- package/dist-lib/{new-BevAuTe5.js → new-JmARyD88.js} +14 -15
- package/dist-lib/{ontology-DXGSJC-y.js → ontology-B4rkO33J.js} +50 -52
- package/dist-lib/ontology-dataprep-BwD5TKs2.js +322 -0
- package/dist-lib/{ontology-domains-jTG7CZm8.js → ontology-domains-zxFrjn0v.js} +89 -92
- package/dist-lib/ontology-extract-BHOxruRO.js +3199 -0
- package/dist-lib/ontology-extract-iR_rXxFe.js +295 -0
- package/dist-lib/ontology-flow-CW0SzeK7.js +456 -0
- package/dist-lib/ontology-flow-Dv5iQ20f.js +154 -0
- package/dist-lib/ontology-modeling-B9wswveh.js +510 -0
- package/dist-lib/ontology-modeling-hakCluBi.js +15136 -0
- package/dist-lib/{ontology-scenarios-J5kw6xgi.js → ontology-scenarios-C2kp7Rs-.js} +1466 -1482
- package/dist-lib/ontology-scenarios-DKnfydG6.js +675 -0
- package/dist-lib/ontology-task-config-DmnWyCCB.js +122 -0
- package/dist-lib/ontology-terms-BoNB-5ar.js +66 -0
- package/dist-lib/ontology-terms-C-NhpcIZ.js +1195 -0
- package/dist-lib/pages-CticGC6S.js +512 -0
- package/dist-lib/pages.js +3 -3
- package/dist-lib/{permission-BUXo69Ne.js → permission-Dq1-AOQw.js} +41 -41
- package/dist-lib/pipeline-layout-CJlOMXJF.js +70 -0
- package/dist-lib/{pptx-preview.es-AUrdYKu3.js → pptx-preview.es-D4ODiBv2.js} +2 -2
- package/dist-lib/preset-Bp_mvsJm.js +56827 -0
- package/dist-lib/{preset-gh5SGoYT.js → preset-DCNSE--Y.js} +8 -8
- package/dist-lib/progress-CZxOOnIs.js +778 -0
- package/dist-lib/{quota-D31cXjul.js → quota-oICQRHFU.js} +4 -4
- package/dist-lib/row-By17TCiW.js +154 -0
- package/dist-lib/runs-DQTDpPaN.js +565 -0
- package/dist-lib/{save-blob-CiWNK-cX.js → save-blob-CwCZE1Dn.js} +2 -2
- package/dist-lib/{scenario-mapping-preview-DQ_OBV4Z.js → scenario-mapping-preview-sJtjgmry.js} +46 -48
- package/dist-lib/scenario-simple-form-BvKSPFzw.js +989 -0
- package/dist-lib/{schedule-BktxwX3S.js → schedule-CwkPPSuT.js} +8 -8
- package/dist-lib/script-gYJAFobb.js +2709 -0
- package/dist-lib/{settings-dsB3H65I.js → settings-CJd5Jj4y.js} +133 -134
- package/dist-lib/{shared-CTCzvhyE.js → shared-DG5-VCDM.js} +1 -1
- package/dist-lib/{shared-utils-BstybhBG.js → shared-utils-CFHws1DA.js} +2 -2
- package/dist-lib/{skills-CHPlMsgO.js → skills-lxpJ5Lzx.js} +39 -40
- package/dist-lib/{source-selection-tXqc855k.js → source-selection-DJnQQckl.js} +16 -16
- package/dist-lib/sources-C83LpCcV.js +279 -0
- package/dist-lib/style-B5THvtDY.js +191 -0
- package/dist-lib/{task-config-BiTOiZj0.js → task-config-BNYoOb79.js} +4 -4
- package/dist-lib/{tech-BKlGPkV0.js → tech-LuZvKDo6.js} +3 -4
- package/dist-lib/templates-a-kbCamr.js +58 -0
- package/dist-lib/tenant-login-COB-5h_2.js +338 -0
- package/dist-lib/{tools-CouQ4FWk.js → tools-CrA6GrY6.js} +14 -14
- package/dist-lib/{use-domain-access-BPlNfoiP.js → use-domain-access-ehGJBGvU.js} +15 -15
- package/dist-lib/{use-g6-graph-WLX0PweO.js → use-g6-graph-DfRnsBS6.js} +1 -1
- package/dist-lib/{use-graph-layers-ja-ZIC_R.js → use-graph-layers-CrhEeHfD.js} +48 -50
- package/dist-lib/use-resizable-columns-BpMCRKif.js +59 -0
- package/dist-lib/useBreakpoint-Cul9y9Cu.js +87 -0
- package/dist-lib/{useForm-Byp1LopG.js → useForm-B-dwOwJ8.js} +11 -11
- package/dist-lib/{version-control-panel-CkBm36Yk.js → version-control-panel-mWXkC-uB.js} +26 -27
- package/dist-lib/{version-management-B4kIbdVc.js → version-management-nPlG7wQO.js} +6 -7
- package/dist-lib/{welcome-F5iZoFB1.js → welcome-Cqv1-rXT.js} +3 -4
- package/package.json +1 -1
- package/dist-lib/ApartmentOutlined-M6qSurnE.js +0 -12
- package/dist-lib/ArrowLeftOutlined-DowsrSUj.js +0 -12
- package/dist-lib/EvidenceFormList-DXqqSpPV.js +0 -91
- package/dist-lib/ImpactPage-DyhUR6fT.js +0 -71
- package/dist-lib/OntologyMaterializePage-B0f9TnJa.js +0 -136
- package/dist-lib/OntologyNodesPage-D4MWlm6q.js +0 -1268
- package/dist-lib/Pagination-Dxslodkq.js +0 -1344
- package/dist-lib/PlusOutlined-B_dXo_97.js +0 -12
- package/dist-lib/SearchOutlined-puH6bCY6.js +0 -979
- package/dist-lib/Skeleton-DXcERb5r.js +0 -557
- package/dist-lib/TagsOutlined-B4_qkn6-.js +0 -20
- package/dist-lib/TermDetailPage-CP0D6OvA.js +0 -242
- package/dist-lib/TextArea-DTpTS5HL.js +0 -1897
- package/dist-lib/ThunderboltOutlined-Bf54AaFE.js +0 -20
- package/dist-lib/callSuper-DZEfdkXG.js +0 -7
- package/dist-lib/changelog-Cn81Dvgk.js +0 -69
- package/dist-lib/chunk-YDNE64FV-DGyyfCo0.js +0 -2004
- package/dist-lib/context-Buz0ggsK.js +0 -710
- package/dist-lib/context-DpmyNOn3.js +0 -21
- package/dist-lib/embed-CR8XVkMy.js +0 -31148
- package/dist-lib/focus-set-h0YtOUB2.js +0 -427
- package/dist-lib/index-CaXylbQR.js +0 -3419
- package/dist-lib/index-Cfu1W1H6.js +0 -535
- package/dist-lib/index-CrMcNEAZ.js +0 -9656
- package/dist-lib/index-CyKWCYMK.js +0 -218
- package/dist-lib/index-DBtGE89a.js +0 -168
- package/dist-lib/index-DjFPRXl5.js +0 -1484
- package/dist-lib/index-DvWHYX81.js +0 -450
- package/dist-lib/index-PBT9GksC.js +0 -340
- package/dist-lib/index-bOY1cBol.js +0 -4890
- package/dist-lib/meta-BD_qYTZu.js +0 -540
- package/dist-lib/ontology-modeling-CjRsa-DR.js +0 -1039
- package/dist-lib/ontology-modeling-DOj68TuI.js +0 -38946
- package/dist-lib/ontology-scenarios-CcAagMiP.js +0 -660
- package/dist-lib/pages-CsexFuEz.js +0 -73
- package/dist-lib/row-B5MnGm9M.js +0 -156
- package/dist-lib/scenario-simple-form-DESMvU7A.js +0 -2396
- package/dist-lib/useClosable-BY7FgWKy.js +0 -59
|
@@ -0,0 +1,789 @@
|
|
|
1
|
+
import { jsxs as r, jsx as n, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as de, useId as Ie, useMemo as le, useState as E, useCallback as ke, useEffect as he } from "react";
|
|
3
|
+
import { u as Te } from "./use-split-width-SsLqbGjr.js";
|
|
4
|
+
import { H as X } from "./index-mmwKYfDC.js";
|
|
5
|
+
import { S as xe } from "./index-QZ9JPfVR.js";
|
|
6
|
+
import { B as P, ab as ue, S as Ne, h as be, r as J, R as ze, A as Le } from "./embed-mf8t3QXh.js";
|
|
7
|
+
import { T as ge } from "./index-CtqUgNxs.js";
|
|
8
|
+
import { T as Ue } from "./index-CLhLA2ig.js";
|
|
9
|
+
import { D as Oe } from "./index-DhSCFLtV.js";
|
|
10
|
+
const $e = { drive: "动力", action: "动作", seam: "接口缝", artifact: "产物" };
|
|
11
|
+
function Z(e) {
|
|
12
|
+
return JSON.stringify([e.from, e.to, e.kind, e.when, e.evidence, e.derived, e.source]);
|
|
13
|
+
}
|
|
14
|
+
function Pe(e, t) {
|
|
15
|
+
return {
|
|
16
|
+
nodes: [...new Map([...e.nodes, ...t.nodes].map((s) => [s.id, s])).values()],
|
|
17
|
+
edges: [...new Map([...e.edges, ...t.edges].map((s) => [Z(s), s])).values()]
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function Ee(e) {
|
|
21
|
+
const t = e.nodes.find((u) => u.id === "entry:login"), s = new Set(e.edges.filter((u) => u.kind !== "SUPPRESSES").map((u) => u.to)), l = e.nodes.filter((u) => u.kind === "drive"), o = l.filter((u) => !s.has(u.id));
|
|
22
|
+
return { nodes: t ? [t] : o.length ? o : l.slice(0, 1), edges: [] };
|
|
23
|
+
}
|
|
24
|
+
function Me(e, t) {
|
|
25
|
+
var c;
|
|
26
|
+
const s = new Map(e.nodes.map((d) => [d.id, d])), l = Ae(e.edges.filter((d) => d.kind !== "SUPPRESSES")), o = /* @__PURE__ */ new Set(), u = [t];
|
|
27
|
+
for (let d = 0; d < u.length; d++)
|
|
28
|
+
for (const f of l.get(u[d]) ?? [])
|
|
29
|
+
((c = s.get(f.to)) == null ? void 0 : c.kind) === "seam" && !o.has(f.to) && f.to !== t && (o.add(f.to), u.push(f.to));
|
|
30
|
+
return [...o];
|
|
31
|
+
}
|
|
32
|
+
function Ae(e) {
|
|
33
|
+
const t = /* @__PURE__ */ new Map();
|
|
34
|
+
return e.forEach((s) => t.set(s.from, [...t.get(s.from) ?? [], s])), t;
|
|
35
|
+
}
|
|
36
|
+
function Fe(e, t, s) {
|
|
37
|
+
const l = new Set(e.nodes.filter((d) => s || d.kind !== "seam" || t.includes(d.id)).map((d) => d.id)), o = new Set(e.nodes.map((d) => d.id)), u = Ae(e.edges), c = [];
|
|
38
|
+
for (const d of l) {
|
|
39
|
+
const f = [d], m = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map();
|
|
40
|
+
for (let w = 0; w < f.length; w++) {
|
|
41
|
+
const y = f[w];
|
|
42
|
+
for (const i of u.get(y) ?? [])
|
|
43
|
+
if (o.has(i.to) && !(i.kind === "SUPPRESSES" && (y !== d || !l.has(i.to))))
|
|
44
|
+
if (l.has(i.to))
|
|
45
|
+
y === d ? c.push({ key: `${d}:${Z(i)}`, from: d, to: i.to, edges: [i], folded: 0 }) : N.set(Z(i), i);
|
|
46
|
+
else {
|
|
47
|
+
const p = m.get(i.to);
|
|
48
|
+
p ? p.push(i) : (m.set(i.to, [i]), f.push(i.to));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
for (const w of N.values()) {
|
|
52
|
+
const y = /* @__PURE__ */ new Map([[Z(w), w]]), i = [w.from], p = new Set(i);
|
|
53
|
+
for (let v = 0; v < i.length; v++)
|
|
54
|
+
for (const a of m.get(i[v]) ?? [])
|
|
55
|
+
y.set(Z(a), a), !l.has(a.from) && !p.has(a.from) && (p.add(a.from), i.push(a.from));
|
|
56
|
+
c.push({
|
|
57
|
+
key: JSON.stringify([d, [...y.keys()].sort()]),
|
|
58
|
+
from: d,
|
|
59
|
+
to: w.to,
|
|
60
|
+
edges: [...y.values()].reverse(),
|
|
61
|
+
folded: p.size
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return { nodes: e.nodes.filter((d) => l.has(d.id)), edges: c };
|
|
66
|
+
}
|
|
67
|
+
function je(e, t) {
|
|
68
|
+
const s = new Set(e.map((i) => i.id)), l = t.filter((i) => i.edges.every((p) => p.kind !== "SUPPRESSES")), o = new Set(l.map((i) => i.to)), u = /* @__PURE__ */ new Map();
|
|
69
|
+
l.forEach((i) => u.set(i.from, [...u.get(i.from) ?? [], i.to]));
|
|
70
|
+
const c = [...e].sort((i, p) => i.id.localeCompare(p.id)), d = c.filter((i) => !o.has(i.id)), f = /* @__PURE__ */ new Map(), m = [];
|
|
71
|
+
for (const i of d)
|
|
72
|
+
f.set(i.id, 0), m.push(i.id);
|
|
73
|
+
const N = () => {
|
|
74
|
+
for (let i = 0; i < m.length; i++) {
|
|
75
|
+
const p = m[i];
|
|
76
|
+
for (const v of u.get(p) ?? [])
|
|
77
|
+
s.has(v) && !f.has(v) && (f.set(v, Math.min(5, (f.get(p) ?? 0) + 1)), m.push(v));
|
|
78
|
+
}
|
|
79
|
+
m.length = 0;
|
|
80
|
+
};
|
|
81
|
+
N();
|
|
82
|
+
for (const i of c)
|
|
83
|
+
f.has(i.id) || (f.set(i.id, 0), m.push(i.id), N());
|
|
84
|
+
const w = /* @__PURE__ */ new Map(), y = c.map((i) => {
|
|
85
|
+
const p = f.get(i.id) ?? 0, v = w.get(p) ?? 0;
|
|
86
|
+
return w.set(p, v + 1), { ...i, x: 48 + p * 272, y: 48 + v * 112 };
|
|
87
|
+
});
|
|
88
|
+
return { nodes: y, width: Math.max(360, ...y.map((i) => i.x + 240)), height: Math.max(240, ...y.map((i) => i.y + 120)) };
|
|
89
|
+
}
|
|
90
|
+
function Ce(e, t) {
|
|
91
|
+
return t === 0 ? "N/A(分母 0)" : typeof e != "number" || t == null ? "未提供" : `${Number((e * 100).toFixed(1))}%(分母 ${String(t)})`;
|
|
92
|
+
}
|
|
93
|
+
function I(e) {
|
|
94
|
+
return e == null || e === "" ? "未标注" : typeof e == "string" ? e : JSON.stringify(e, null, 2);
|
|
95
|
+
}
|
|
96
|
+
function Ge({ slice: e, expanded: t, full: s, selected: l, onSelect: o, onEdge: u }) {
|
|
97
|
+
const c = de(null), d = Ie().replace(/:/g, ""), f = le(() => Fe(e, t, s), [e, t, s]), m = le(() => je(f.nodes, f.edges), [f]), N = le(() => new Map(m.nodes.map((a) => [a.id, a])), [m]), [w, y] = E({ x: 0, y: 0, scale: 1 }), i = de(null), p = ke(() => {
|
|
98
|
+
var S;
|
|
99
|
+
const a = (S = c.current) == null ? void 0 : S.getBoundingClientRect();
|
|
100
|
+
if (!(a != null && a.width) || !a.height) return;
|
|
101
|
+
const k = Math.min(1, (a.width - 32) / m.width, (a.height - 32) / m.height);
|
|
102
|
+
y({ x: (a.width - m.width * k) / 2, y: (a.height - m.height * k) / 2, scale: k });
|
|
103
|
+
}, [m]);
|
|
104
|
+
he(() => {
|
|
105
|
+
p();
|
|
106
|
+
const a = new ResizeObserver(p);
|
|
107
|
+
return c.current && a.observe(c.current), () => a.disconnect();
|
|
108
|
+
}, [p]);
|
|
109
|
+
const v = (a) => {
|
|
110
|
+
var S;
|
|
111
|
+
const k = (S = c.current) == null ? void 0 : S.getBoundingClientRect();
|
|
112
|
+
y((C) => {
|
|
113
|
+
const g = Math.max(0.03, Math.min(2.5, C.scale * a)), x = ((k == null ? void 0 : k.width) ?? 0) / 2, R = ((k == null ? void 0 : k.height) ?? 0) / 2;
|
|
114
|
+
return { scale: g, x: x - (x - C.x) * g / C.scale, y: R - (R - C.y) * g / C.scale };
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
return /* @__PURE__ */ r("div", { className: "causal-canvas", children: [
|
|
118
|
+
/* @__PURE__ */ r("div", { className: "causal-canvas-tools", children: [
|
|
119
|
+
/* @__PURE__ */ r("span", { children: [
|
|
120
|
+
s ? "全图视角" : "人视角",
|
|
121
|
+
" · ",
|
|
122
|
+
f.nodes.length,
|
|
123
|
+
" 节点"
|
|
124
|
+
] }),
|
|
125
|
+
/* @__PURE__ */ r(xe, { size: 4, children: [
|
|
126
|
+
/* @__PURE__ */ n(P, { size: "small", onClick: () => v(1.2), children: "放大" }),
|
|
127
|
+
/* @__PURE__ */ n(P, { size: "small", onClick: () => v(1 / 1.2), children: "缩小" }),
|
|
128
|
+
/* @__PURE__ */ n(P, { size: "small", onClick: p, children: "适配屏幕" }),
|
|
129
|
+
/* @__PURE__ */ r("span", { children: [
|
|
130
|
+
Math.round(w.scale * 100),
|
|
131
|
+
"%"
|
|
132
|
+
] })
|
|
133
|
+
] })
|
|
134
|
+
] }),
|
|
135
|
+
/* @__PURE__ */ n(
|
|
136
|
+
"div",
|
|
137
|
+
{
|
|
138
|
+
className: "causal-viewport",
|
|
139
|
+
ref: c,
|
|
140
|
+
"aria-label": "因果图画布",
|
|
141
|
+
onPointerDown: (a) => {
|
|
142
|
+
a.button !== 0 || a.target instanceof Element && a.target.closest("button, [data-edge]") || (i.current = { x: a.clientX, y: a.clientY }, a.currentTarget.setPointerCapture(a.pointerId));
|
|
143
|
+
},
|
|
144
|
+
onPointerMove: (a) => {
|
|
145
|
+
if (!i.current) return;
|
|
146
|
+
const k = a.clientX - i.current.x, S = a.clientY - i.current.y;
|
|
147
|
+
i.current = { x: a.clientX, y: a.clientY }, y((C) => ({ ...C, x: C.x + k, y: C.y + S }));
|
|
148
|
+
},
|
|
149
|
+
onPointerUp: () => {
|
|
150
|
+
i.current = null;
|
|
151
|
+
},
|
|
152
|
+
onPointerCancel: () => {
|
|
153
|
+
i.current = null;
|
|
154
|
+
},
|
|
155
|
+
children: m.nodes.length ? /* @__PURE__ */ r("div", { className: "causal-stage", style: { width: m.width, height: m.height, transform: `translate(${w.x}px, ${w.y}px) scale(${w.scale})` }, children: [
|
|
156
|
+
/* @__PURE__ */ r("svg", { width: m.width, height: m.height, className: "causal-lines", "aria-label": "有向关系", children: [
|
|
157
|
+
/* @__PURE__ */ n("defs", { children: /* @__PURE__ */ n("marker", { id: d, viewBox: "0 0 10 10", refX: "9", refY: "5", markerWidth: "7", markerHeight: "7", orient: "auto-start-reverse", children: /* @__PURE__ */ n("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: "context-stroke" }) }) }),
|
|
158
|
+
f.edges.map((a, k) => {
|
|
159
|
+
const S = N.get(a.from), C = N.get(a.to);
|
|
160
|
+
if (!S || !C) return null;
|
|
161
|
+
const g = a.edges.some((B) => B.kind === "SUPPRESSES"), x = C.x > S.x, R = S.x + 184, M = S.y + 33, U = x ? C.x : C.x + 184, O = C.y + 33, te = x ? (R + U) / 2 : Math.max(R, U) + 32 + k % 4 * 9, G = S.id === C.id ? `M ${R} ${M} C ${R + 72} ${M - 80}, ${R + 72} ${M + 80}, ${R} ${M + 16}` : `M ${R} ${M} C ${te} ${M}, ${te} ${O}, ${U} ${O}`, ie = a.folded ? `折叠 ${a.folded} 个缝` : a.edges[0].kind;
|
|
162
|
+
return /* @__PURE__ */ r("g", { "data-edge": "true", className: g ? "causal-edge suppressed" : "causal-edge", role: "button", tabIndex: 0, "aria-label": `${a.from} → ${a.to} ${ie}`, onClick: () => u(a), onKeyDown: (B) => {
|
|
163
|
+
(B.key === "Enter" || B.key === " ") && (B.preventDefault(), u(a));
|
|
164
|
+
}, children: [
|
|
165
|
+
/* @__PURE__ */ n("path", { className: "causal-edge-hit", d: G }),
|
|
166
|
+
/* @__PURE__ */ n("path", { className: "causal-edge-line", d: G, markerEnd: `url(#${d})` }),
|
|
167
|
+
/* @__PURE__ */ n("text", { x: x ? (R + U) / 2 : te, y: (M + O) / 2 - 7, textAnchor: "middle", children: ie })
|
|
168
|
+
] }, a.key);
|
|
169
|
+
})
|
|
170
|
+
] }),
|
|
171
|
+
m.nodes.map((a) => /* @__PURE__ */ n("div", { className: "causal-node-wrap", style: { left: a.x, top: a.y }, children: /* @__PURE__ */ n(X, { hint: `${a.label} · ${a.id}${a.note ? ` · ${a.note}` : ""}`, children: /* @__PURE__ */ r("button", { type: "button", className: `causal-node ${a.kind}${a.id === l ? " selected" : ""}`, onClick: () => o(a.id), "aria-label": `探索 ${a.label}`, children: [
|
|
172
|
+
/* @__PURE__ */ r("span", { className: "causal-node-kind", children: [
|
|
173
|
+
$e[a.kind],
|
|
174
|
+
" · ",
|
|
175
|
+
a.domain || "未分域"
|
|
176
|
+
] }),
|
|
177
|
+
/* @__PURE__ */ n("strong", { children: a.label })
|
|
178
|
+
] }) }) }, a.id))
|
|
179
|
+
] }) : /* @__PURE__ */ n(ue, { description: "没有开场节点,请搜索节点或切换全图" })
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
/* @__PURE__ */ n("div", { className: "causal-legend", children: "拖动画布平移 · 关系语义见连线标签 · 红色虚线为抑制(不可通行)" })
|
|
183
|
+
] });
|
|
184
|
+
}
|
|
185
|
+
function ee({ edges: e }) {
|
|
186
|
+
return e.length ? /* @__PURE__ */ n("div", { className: "causal-evidence-list", children: e.map((t) => /* @__PURE__ */ r("section", { children: [
|
|
187
|
+
/* @__PURE__ */ r("div", { children: [
|
|
188
|
+
/* @__PURE__ */ n(ge, { color: t.kind === "SUPPRESSES" ? "red" : void 0, children: t.kind }),
|
|
189
|
+
/* @__PURE__ */ n(ge, { children: t.derived === !0 ? "推导 derived" : t.derived === !1 ? "显式标注" : "来源类型未标注" })
|
|
190
|
+
] }),
|
|
191
|
+
/* @__PURE__ */ r("p", { className: "causal-id", children: [
|
|
192
|
+
t.from,
|
|
193
|
+
" → ",
|
|
194
|
+
t.to
|
|
195
|
+
] }),
|
|
196
|
+
/* @__PURE__ */ r("dl", { children: [
|
|
197
|
+
/* @__PURE__ */ n("dt", { children: "条件 when" }),
|
|
198
|
+
/* @__PURE__ */ n("dd", { children: I(t.when) }),
|
|
199
|
+
/* @__PURE__ */ n("dt", { children: "证据 evidence" }),
|
|
200
|
+
/* @__PURE__ */ n("dd", { children: I(t.evidence) }),
|
|
201
|
+
/* @__PURE__ */ n("dt", { children: "来源 source" }),
|
|
202
|
+
/* @__PURE__ */ n("dd", { children: I(t.source) })
|
|
203
|
+
] }),
|
|
204
|
+
t.kind === "SUPPRESSES" && /* @__PURE__ */ n("p", { className: "causal-muted", children: "抑制关系,不是可行路径。" })
|
|
205
|
+
] }, Z(t))) }) : /* @__PURE__ */ n("p", { className: "causal-muted", children: "未标注关系" });
|
|
206
|
+
}
|
|
207
|
+
function Be({ node: e, entry: t, edge: s, loading: l, error: o, retry: u }) {
|
|
208
|
+
if (s) return /* @__PURE__ */ r("section", { className: "causal-evidence", children: [
|
|
209
|
+
/* @__PURE__ */ n("h3", { children: "关系证据" }),
|
|
210
|
+
s.folded > 0 && /* @__PURE__ */ r("p", { children: [
|
|
211
|
+
"已折叠 ",
|
|
212
|
+
s.folded,
|
|
213
|
+
" 个接口缝,下列为支持该关系的原始关系子图,可能包含多条分支或环,并非唯一的单链路径。"
|
|
214
|
+
] }),
|
|
215
|
+
/* @__PURE__ */ n(ee, { edges: s.edges })
|
|
216
|
+
] });
|
|
217
|
+
if (!e) return /* @__PURE__ */ n(ue, { description: "选择节点查看证据", image: ue.PRESENTED_IMAGE_SIMPLE });
|
|
218
|
+
const c = t == null ? void 0 : t.details, d = (t == null ? void 0 : t.path) ?? e.path, f = (t == null ? void 0 : t.httpMethod) ?? e.httpMethod, m = (t == null ? void 0 : t.agentVisible) ?? e.agentVisible;
|
|
219
|
+
return /* @__PURE__ */ r("section", { className: "causal-evidence", children: [
|
|
220
|
+
/* @__PURE__ */ n("h3", { children: e.label }),
|
|
221
|
+
/* @__PURE__ */ n(ge, { children: $e[e.kind] }),
|
|
222
|
+
/* @__PURE__ */ n("span", { className: "causal-muted", children: e.domain }),
|
|
223
|
+
/* @__PURE__ */ n("p", { className: "causal-id", children: e.id }),
|
|
224
|
+
e.note && /* @__PURE__ */ n("p", { children: e.note }),
|
|
225
|
+
e.kind === "seam" && /* @__PURE__ */ n("p", { className: "causal-warning", children: "接口缝不可直接调用。" }),
|
|
226
|
+
/* @__PURE__ */ r("dl", { children: [
|
|
227
|
+
/* @__PURE__ */ n("dt", { children: "调用入口" }),
|
|
228
|
+
/* @__PURE__ */ n("dd", { children: e.kind === "seam" ? "不可直调" : d ? `${f || "方法未标注"} ${d}` : "未标注可调用入口" }),
|
|
229
|
+
/* @__PURE__ */ n("dt", { children: "Agent 可见" }),
|
|
230
|
+
/* @__PURE__ */ n("dd", { children: m == null ? "未标注" : m ? "是(不代表已获调用授权)" : "否" }),
|
|
231
|
+
/* @__PURE__ */ n("dt", { children: "来源" }),
|
|
232
|
+
/* @__PURE__ */ n("dd", { children: I((t == null ? void 0 : t.source) ?? e.source) })
|
|
233
|
+
] }),
|
|
234
|
+
l ? /* @__PURE__ */ r("div", { role: "status", children: [
|
|
235
|
+
/* @__PURE__ */ n(Ne, { size: "small" }),
|
|
236
|
+
" 正在读取调用与证据…"
|
|
237
|
+
] }) : o ? /* @__PURE__ */ r("div", { role: "alert", children: [
|
|
238
|
+
o,
|
|
239
|
+
/* @__PURE__ */ n(P, { size: "small", onClick: u, children: "重试详情" })
|
|
240
|
+
] }) : t ? /* @__PURE__ */ r(Q, { children: [
|
|
241
|
+
/* @__PURE__ */ r("dl", { children: [
|
|
242
|
+
/* @__PURE__ */ n("dt", { children: "输入" }),
|
|
243
|
+
/* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n("pre", { children: I(c == null ? void 0 : c.params) }) }),
|
|
244
|
+
/* @__PURE__ */ n("dt", { children: "输出" }),
|
|
245
|
+
/* @__PURE__ */ n("dd", { children: /* @__PURE__ */ n("pre", { children: I((c == null ? void 0 : c.responseFields) ?? (c == null ? void 0 : c.responseType)) }) }),
|
|
246
|
+
/* @__PURE__ */ n("dt", { children: "前置条件" }),
|
|
247
|
+
/* @__PURE__ */ n("dd", { children: I(c == null ? void 0 : c.pre) })
|
|
248
|
+
] }),
|
|
249
|
+
/* @__PURE__ */ n("h4", { children: "因果标注" }),
|
|
250
|
+
/* @__PURE__ */ n(ee, { edges: t.causes }),
|
|
251
|
+
/* @__PURE__ */ r("details", { children: [
|
|
252
|
+
/* @__PURE__ */ n("summary", { children: "完整调用元数据" }),
|
|
253
|
+
/* @__PURE__ */ n("pre", { children: I(c) })
|
|
254
|
+
] })
|
|
255
|
+
] }) : null,
|
|
256
|
+
/* @__PURE__ */ n("p", { className: "causal-muted", children: "候选路径不等于运行成功;未标注出边不等于业务完成。" })
|
|
257
|
+
] });
|
|
258
|
+
}
|
|
259
|
+
function ye({ nodes: e, value: t, onChange: s, label: l }) {
|
|
260
|
+
return /* @__PURE__ */ n(
|
|
261
|
+
be,
|
|
262
|
+
{
|
|
263
|
+
showSearch: !0,
|
|
264
|
+
"aria-label": l,
|
|
265
|
+
placeholder: l,
|
|
266
|
+
value: t || void 0,
|
|
267
|
+
onChange: s,
|
|
268
|
+
optionFilterProp: "searchText",
|
|
269
|
+
options: e.map((o) => ({ value: o.id, label: o.label, searchText: `${o.label} ${o.id} ${o.domain}` })),
|
|
270
|
+
optionRender: (o) => /* @__PURE__ */ n(X, { hint: String(o.data.searchText), children: /* @__PURE__ */ n("span", { children: o.label }) }),
|
|
271
|
+
labelRender: (o) => /* @__PURE__ */ n(X, { hint: `${String(o.label ?? "")} · ${String(o.value)}`, children: /* @__PURE__ */ n("span", { children: o.label }) })
|
|
272
|
+
}
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
function Ve({ result: e }) {
|
|
276
|
+
if (e.kind === "suppressions") return /* @__PURE__ */ r(Q, { children: [
|
|
277
|
+
/* @__PURE__ */ r("p", { children: [
|
|
278
|
+
"抑制关系 · ",
|
|
279
|
+
e.data.length,
|
|
280
|
+
" 条"
|
|
281
|
+
] }),
|
|
282
|
+
/* @__PURE__ */ n(ee, { edges: e.data })
|
|
283
|
+
] });
|
|
284
|
+
const t = e.data;
|
|
285
|
+
return /* @__PURE__ */ r(Q, { children: [
|
|
286
|
+
t.truncated && /* @__PURE__ */ n("p", { className: "causal-warning", role: "status", children: "结果已截断,未覆盖全部关系;可调整深度重新查询。" }),
|
|
287
|
+
e.kind === "next" && /* @__PURE__ */ r(Q, { children: [
|
|
288
|
+
/* @__PURE__ */ n("p", { children: e.data.transitions.length ? `下一步候选 · ${e.data.transitions.length} 个` : "没有已标注的下一步,不代表业务完成。" }),
|
|
289
|
+
e.data.transitions.map((s, l) => /* @__PURE__ */ r("p", { children: [
|
|
290
|
+
s.target,
|
|
291
|
+
" · 停止原因:",
|
|
292
|
+
s.stoppedReason || "未提供"
|
|
293
|
+
] }, `${s.target}-${l}`)),
|
|
294
|
+
!!e.data.suppressions.length && /* @__PURE__ */ r("details", { children: [
|
|
295
|
+
/* @__PURE__ */ r("summary", { children: [
|
|
296
|
+
"抑制关系 · ",
|
|
297
|
+
e.data.suppressions.length
|
|
298
|
+
] }),
|
|
299
|
+
/* @__PURE__ */ n(ee, { edges: e.data.suppressions })
|
|
300
|
+
] })
|
|
301
|
+
] }),
|
|
302
|
+
e.kind === "path" && /* @__PURE__ */ r(Q, { children: [
|
|
303
|
+
/* @__PURE__ */ n("p", { children: e.data.found ? "找到候选路径(不代表运行成功)" : e.data.truncated ? "当前深度内未找到路径,不能判定不可达。" : "未找到可行路径。" }),
|
|
304
|
+
e.data.reason && /* @__PURE__ */ r("p", { children: [
|
|
305
|
+
"原因:",
|
|
306
|
+
e.data.reason
|
|
307
|
+
] }),
|
|
308
|
+
e.data.edges.some((s) => s.kind === "SUPPRESSES") && /* @__PURE__ */ n("p", { className: "causal-warning", children: "结果含抑制边,已从候选路径画布排除。" })
|
|
309
|
+
] }),
|
|
310
|
+
e.kind === "impact" && /* @__PURE__ */ r(Q, { children: [
|
|
311
|
+
/* @__PURE__ */ r("p", { children: [
|
|
312
|
+
"上游 ",
|
|
313
|
+
e.data.upstream.length,
|
|
314
|
+
" · 下游 ",
|
|
315
|
+
e.data.downstream.length
|
|
316
|
+
] }),
|
|
317
|
+
/* @__PURE__ */ r("details", { open: !0, children: [
|
|
318
|
+
/* @__PURE__ */ n("summary", { children: "影响节点" }),
|
|
319
|
+
/* @__PURE__ */ r("p", { children: [
|
|
320
|
+
"上游:",
|
|
321
|
+
e.data.upstream.map((s) => s.label).join("、") || "无"
|
|
322
|
+
] }),
|
|
323
|
+
/* @__PURE__ */ r("p", { children: [
|
|
324
|
+
"下游:",
|
|
325
|
+
e.data.downstream.map((s) => s.label).join("、") || "无"
|
|
326
|
+
] })
|
|
327
|
+
] }),
|
|
328
|
+
/* @__PURE__ */ r("details", { children: [
|
|
329
|
+
/* @__PURE__ */ r("summary", { children: [
|
|
330
|
+
"入边证据 · ",
|
|
331
|
+
e.data.incoming.length
|
|
332
|
+
] }),
|
|
333
|
+
/* @__PURE__ */ n(ee, { edges: e.data.incoming })
|
|
334
|
+
] }),
|
|
335
|
+
/* @__PURE__ */ r("details", { children: [
|
|
336
|
+
/* @__PURE__ */ r("summary", { children: [
|
|
337
|
+
"抑制关系 · ",
|
|
338
|
+
e.data.suppressions.length
|
|
339
|
+
] }),
|
|
340
|
+
/* @__PURE__ */ n(ee, { edges: e.data.suppressions })
|
|
341
|
+
] })
|
|
342
|
+
] })
|
|
343
|
+
] });
|
|
344
|
+
}
|
|
345
|
+
function We({ nodes: e, selected: t, result: s, loading: l, error: o, query: u }) {
|
|
346
|
+
const [c, d] = E("next"), [f, m] = E({ selected: t, id: t ?? "" }), N = f.selected === t ? f.id : t ?? "", [w, y] = E(""), [i, p] = E(6);
|
|
347
|
+
return /* @__PURE__ */ r("section", { className: "causal-query", "aria-label": "因果查询", children: [
|
|
348
|
+
/* @__PURE__ */ r("div", { className: "causal-query-mode", children: [
|
|
349
|
+
/* @__PURE__ */ n(be, { "aria-label": "查询类型", value: c, onChange: (v) => {
|
|
350
|
+
d(v), p(v === "next" ? 6 : 16);
|
|
351
|
+
}, options: [
|
|
352
|
+
{ value: "next", label: "下一步 next" },
|
|
353
|
+
{ value: "path", label: "路径 path" },
|
|
354
|
+
{ value: "impact", label: "影响 impact" },
|
|
355
|
+
{ value: "suppressions", label: "抑制 suppressions" }
|
|
356
|
+
] }),
|
|
357
|
+
/* @__PURE__ */ n(Ue, { "aria-label": "最大深度", min: 1, max: 32, disabled: c === "suppressions", value: i, onChange: (v) => p(v ?? 6) })
|
|
358
|
+
] }),
|
|
359
|
+
/* @__PURE__ */ n(ye, { nodes: e, label: "查询起点", value: N, onChange: (v) => m({ selected: t, id: v }) }),
|
|
360
|
+
c === "path" && /* @__PURE__ */ n(ye, { nodes: e, label: "查询终点", value: w, onChange: y }),
|
|
361
|
+
/* @__PURE__ */ n(P, { type: "primary", disabled: !N || c === "path" && !w, onClick: () => void u(c, N, w, i), children: l ? "重新查询" : "查询" }),
|
|
362
|
+
l && /* @__PURE__ */ n("p", { role: "status", children: "查询中…" }),
|
|
363
|
+
o && /* @__PURE__ */ r("p", { role: "alert", children: [
|
|
364
|
+
o,
|
|
365
|
+
" 可重新查询。"
|
|
366
|
+
] }),
|
|
367
|
+
s && /* @__PURE__ */ n("div", { className: "causal-query-result", "aria-live": "polite", children: /* @__PURE__ */ n(Ve, { result: s }) })
|
|
368
|
+
] });
|
|
369
|
+
}
|
|
370
|
+
const Re = "/kb/v1/meta";
|
|
371
|
+
function L(e) {
|
|
372
|
+
if (!e || typeof e != "object" || Array.isArray(e)) throw new Error("因果接口数据格式不正确");
|
|
373
|
+
return e;
|
|
374
|
+
}
|
|
375
|
+
function T(e) {
|
|
376
|
+
if (!Array.isArray(e)) throw new Error("因果接口缺少列表字段");
|
|
377
|
+
return e;
|
|
378
|
+
}
|
|
379
|
+
function W(e) {
|
|
380
|
+
return typeof e == "string" ? e : void 0;
|
|
381
|
+
}
|
|
382
|
+
function j(e) {
|
|
383
|
+
if (typeof e == "string" && e) return e;
|
|
384
|
+
if (typeof e == "number" && Number.isSafeInteger(e)) return String(e);
|
|
385
|
+
throw new Error("因果接口 ID 无效:长整数必须以字符串返回");
|
|
386
|
+
}
|
|
387
|
+
function V(e) {
|
|
388
|
+
if (e == null) return null;
|
|
389
|
+
if (typeof e == "number" && Number.isFinite(e)) {
|
|
390
|
+
if (Number.isInteger(e) && !Number.isSafeInteger(e)) throw new Error("因果指标长整数必须以字符串返回");
|
|
391
|
+
return e;
|
|
392
|
+
}
|
|
393
|
+
if (typeof e == "string" && e.trim()) {
|
|
394
|
+
const t = Number(e);
|
|
395
|
+
return Number.isFinite(t) && Math.abs(t) <= Number.MAX_SAFE_INTEGER ? t : e;
|
|
396
|
+
}
|
|
397
|
+
throw new Error("因果指标格式不正确");
|
|
398
|
+
}
|
|
399
|
+
function ne(e) {
|
|
400
|
+
const t = L(e), s = t.kind;
|
|
401
|
+
if (s !== "drive" && s !== "action" && s !== "seam" && s !== "artifact") throw new Error("未知因果节点类型");
|
|
402
|
+
return {
|
|
403
|
+
id: j(t.id),
|
|
404
|
+
kind: s,
|
|
405
|
+
domain: W(t.domain) ?? "",
|
|
406
|
+
label: W(t.label) || j(t.id),
|
|
407
|
+
note: W(t.note),
|
|
408
|
+
source: W(t.source),
|
|
409
|
+
path: W(t.path),
|
|
410
|
+
httpMethod: W(t.httpMethod),
|
|
411
|
+
agentVisible: typeof t.agentVisible == "boolean" ? t.agentVisible : void 0
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
function H(e) {
|
|
415
|
+
const t = L(e), s = t.kind;
|
|
416
|
+
if (s !== "DIRECT" && s !== "EVENTUAL" && s !== "ENABLES" && s !== "SUPPRESSES" && s !== "VIA") throw new Error("未知因果关系类型");
|
|
417
|
+
return {
|
|
418
|
+
from: j(t.from),
|
|
419
|
+
to: j(t.to),
|
|
420
|
+
kind: s,
|
|
421
|
+
when: t.when,
|
|
422
|
+
evidence: t.evidence,
|
|
423
|
+
derived: typeof t.derived == "boolean" ? t.derived : void 0,
|
|
424
|
+
source: t.source
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
function pe(e) {
|
|
428
|
+
if (typeof e != "boolean") throw new Error("因果接口缺少状态字段");
|
|
429
|
+
return e;
|
|
430
|
+
}
|
|
431
|
+
function z(e, t = {}) {
|
|
432
|
+
const s = new URLSearchParams();
|
|
433
|
+
return Object.entries(t).forEach(([l, o]) => {
|
|
434
|
+
o !== void 0 && o !== "" && s.set(l, String(o));
|
|
435
|
+
}), `${Re}/causal/${e}${s.size ? `?${s}` : ""}`;
|
|
436
|
+
}
|
|
437
|
+
function we(e) {
|
|
438
|
+
if (!Number.isInteger(e) || e < 1 || e > 32) throw new Error("查询深度须为 1–32 的整数");
|
|
439
|
+
return e;
|
|
440
|
+
}
|
|
441
|
+
async function He(e, t) {
|
|
442
|
+
const s = L(await J(`${Re}/graph`, {
|
|
443
|
+
method: "get",
|
|
444
|
+
params: new URLSearchParams(e ? { domain: e } : {}),
|
|
445
|
+
signal: t
|
|
446
|
+
})), l = L(s.quality);
|
|
447
|
+
return {
|
|
448
|
+
nodes: T(s.nodes).map(ne),
|
|
449
|
+
edges: T(s.edges).map(H),
|
|
450
|
+
version: s.version == null ? "未提供" : j(s.version),
|
|
451
|
+
quality: {
|
|
452
|
+
nodeCount: V(l.nodeCount),
|
|
453
|
+
edgeCount: V(l.edgeCount),
|
|
454
|
+
danglingCount: V(l.danglingCount),
|
|
455
|
+
evidenceCoverage: V(l.evidenceCoverage),
|
|
456
|
+
evidenceDenominator: V(l.evidenceDenominator),
|
|
457
|
+
conditionalSuppressionCoverage: V(l.conditionalSuppressionCoverage),
|
|
458
|
+
conditionalSuppressionDenominator: V(l.conditionalSuppressionDenominator),
|
|
459
|
+
annotatedActionCount: V(l.annotatedActionCount)
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
async function Je(e, t = 6, s) {
|
|
464
|
+
const l = L(await J(z("next", { id: e, maxDepth: we(t) }), { signal: s }));
|
|
465
|
+
return { id: j(l.id), transitions: T(l.transitions).map((o) => {
|
|
466
|
+
const u = L(o);
|
|
467
|
+
return {
|
|
468
|
+
target: j(typeof u.target == "object" ? L(u.target).id : u.target),
|
|
469
|
+
nodes: T(u.nodes).map(ne),
|
|
470
|
+
edges: T(u.edges).map(H),
|
|
471
|
+
stoppedReason: W(u.stoppedReason)
|
|
472
|
+
};
|
|
473
|
+
}), suppressions: T(l.suppressions).map(H), truncated: pe(l.truncated) };
|
|
474
|
+
}
|
|
475
|
+
async function Ke(e, t, s = 16, l) {
|
|
476
|
+
const o = L(await J(z("path", { from: e, to: t, maxDepth: we(s) }), { signal: l }));
|
|
477
|
+
return {
|
|
478
|
+
from: j(o.from),
|
|
479
|
+
to: j(o.to),
|
|
480
|
+
found: pe(o.found),
|
|
481
|
+
nodes: T(o.nodes).map(ne),
|
|
482
|
+
edges: T(o.edges).map(H),
|
|
483
|
+
truncated: pe(o.truncated),
|
|
484
|
+
reason: W(o.reason)
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
async function Qe(e, t = 16, s) {
|
|
488
|
+
const l = L(await J(z("impact", { id: e, maxDepth: we(t) }), { signal: s }));
|
|
489
|
+
return {
|
|
490
|
+
id: j(l.id),
|
|
491
|
+
incoming: T(l.incoming).map(H),
|
|
492
|
+
upstream: T(l.upstream).map(ne),
|
|
493
|
+
downstream: T(l.downstream).map(ne),
|
|
494
|
+
suppressions: T(l.suppressions).map(H),
|
|
495
|
+
truncated: pe(l.truncated)
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
async function Xe(e, t) {
|
|
499
|
+
return T(await J(z("suppressions", { id: e }), { signal: t })).map(H);
|
|
500
|
+
}
|
|
501
|
+
async function Ye(e, t) {
|
|
502
|
+
const s = L(await J(z("entry", { id: e }), { signal: t }));
|
|
503
|
+
return { ...ne(s.node), causes: T(s.causes).map(H), details: s.metadata == null ? {} : L(s.metadata) };
|
|
504
|
+
}
|
|
505
|
+
async function _e(e, t) {
|
|
506
|
+
const s = await J(z("compact", { domain: e }), { signal: t });
|
|
507
|
+
if (typeof s != "string") throw new Error("紧凑图接口尚未返回字符串");
|
|
508
|
+
return s;
|
|
509
|
+
}
|
|
510
|
+
function Ze(e) {
|
|
511
|
+
return J(z("tools"), { signal: e });
|
|
512
|
+
}
|
|
513
|
+
function ce(e) {
|
|
514
|
+
return e instanceof ze && (e.status === 403 || String(e.code) === "403") ? "当前账号无因果空间访问权限(403),请联系管理员后重试。" : e instanceof Error ? e.message : "因果查询失败,请重试";
|
|
515
|
+
}
|
|
516
|
+
const en = { nodes: [], edges: [] };
|
|
517
|
+
function nn() {
|
|
518
|
+
const [e, t] = E(""), [s, l] = E([]), [o, u] = E(0), [c, d] = E(), [f, m] = E(!0), [N, w] = E(""), [y, i] = E(), [p, v] = E(), [a, k] = E(0), S = JSON.stringify([e, c == null ? void 0 : c.version, y, o, a]), C = (p == null ? void 0 : p.key) === S ? p.entry : void 0, g = (p == null ? void 0 : p.key) === S ? p.error ?? "" : "", x = !!y && (p == null ? void 0 : p.key) !== S, [R, M] = E(!1), [U, O] = E([]), [te, G] = E(), [ie, B] = E(!1), [De, me] = E(""), re = de(null), Y = U.at(-1), oe = (Y == null ? void 0 : Y.slice) ?? en, se = (Y == null ? void 0 : Y.expanded) ?? [], ae = ke(() => {
|
|
519
|
+
var h;
|
|
520
|
+
(h = re.current) == null || h.abort(), B(!1), me(""), G(void 0);
|
|
521
|
+
}, []), ve = () => {
|
|
522
|
+
ae(), m(!0), w(""), d(void 0), i(void 0), O([]), M(!1);
|
|
523
|
+
};
|
|
524
|
+
he(() => {
|
|
525
|
+
const h = new AbortController();
|
|
526
|
+
return (async () => {
|
|
527
|
+
var b;
|
|
528
|
+
try {
|
|
529
|
+
const $ = await He(e || void 0, h.signal);
|
|
530
|
+
if (h.signal.aborted) return;
|
|
531
|
+
d($), l((_) => [.../* @__PURE__ */ new Set([..._, ...$.nodes.map((A) => A.domain).filter(Boolean)])].sort());
|
|
532
|
+
const D = Ee($), q = (b = D.nodes[0]) == null ? void 0 : b.id;
|
|
533
|
+
O([{ label: "开场", slice: D, expanded: [], selected: q }]), i(q);
|
|
534
|
+
} catch ($) {
|
|
535
|
+
h.signal.aborted || w(ce($));
|
|
536
|
+
} finally {
|
|
537
|
+
h.signal.aborted || m(!1);
|
|
538
|
+
}
|
|
539
|
+
})(), () => {
|
|
540
|
+
var b;
|
|
541
|
+
h.abort(), (b = re.current) == null || b.abort();
|
|
542
|
+
};
|
|
543
|
+
}, [e, o]), he(() => {
|
|
544
|
+
const h = new AbortController();
|
|
545
|
+
return y && (async () => {
|
|
546
|
+
let b, $;
|
|
547
|
+
try {
|
|
548
|
+
b = await Ye(y, h.signal);
|
|
549
|
+
} catch (D) {
|
|
550
|
+
$ = ce(D);
|
|
551
|
+
} finally {
|
|
552
|
+
h.signal.aborted || v({ key: S, entry: b, error: $ });
|
|
553
|
+
}
|
|
554
|
+
})(), () => h.abort();
|
|
555
|
+
}, [y, S]);
|
|
556
|
+
const fe = (h, b, $) => {
|
|
557
|
+
O((D) => [...D, { label: h, slice: b, selected: $, expanded: se }]);
|
|
558
|
+
}, Se = async (h, b, $ = "", D = h === "next" ? 6 : 16) => {
|
|
559
|
+
var _;
|
|
560
|
+
if (!c || !b || h === "path" && !$) return;
|
|
561
|
+
(_ = re.current) == null || _.abort();
|
|
562
|
+
const q = new AbortController();
|
|
563
|
+
re.current = q, B(!0), me(""), G(void 0), i(b);
|
|
564
|
+
try {
|
|
565
|
+
if (h === "next") {
|
|
566
|
+
const A = await Je(b, D, q.signal);
|
|
567
|
+
if (q.signal.aborted) return;
|
|
568
|
+
const F = c.nodes.find((K) => K.id === b) ?? oe.nodes.find((K) => K.id === b), qe = Pe(oe, {
|
|
569
|
+
nodes: [...F ? [F] : [], ...A.transitions.flatMap((K) => K.nodes)],
|
|
570
|
+
edges: [...A.transitions.flatMap((K) => K.edges), ...A.suppressions]
|
|
571
|
+
});
|
|
572
|
+
fe(`下一步 · ${(F == null ? void 0 : F.label) ?? b}`, qe, b), M(!1), G({ kind: h, data: A });
|
|
573
|
+
} else if (h === "path") {
|
|
574
|
+
const A = await Ke(b, $, D, q.signal);
|
|
575
|
+
if (q.signal.aborted) return;
|
|
576
|
+
G({ kind: h, data: A }), A.found ? fe("候选路径", { nodes: A.nodes, edges: A.edges.filter((F) => F.kind !== "SUPPRESSES") }, b) : fe(A.truncated ? "路径查询未完成" : "无路径", { nodes: c.nodes.filter((F) => F.id === b || F.id === $), edges: [] }, b), M(!1);
|
|
577
|
+
} else if (h === "impact") {
|
|
578
|
+
const A = await Qe(b, D, q.signal);
|
|
579
|
+
q.signal.aborted || G({ kind: h, data: A });
|
|
580
|
+
} else {
|
|
581
|
+
const A = await Xe(b, q.signal);
|
|
582
|
+
q.signal.aborted || G({ kind: h, data: A });
|
|
583
|
+
}
|
|
584
|
+
} catch (A) {
|
|
585
|
+
q.signal.aborted || me(ce(A));
|
|
586
|
+
} finally {
|
|
587
|
+
q.signal.aborted || B(!1);
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
return {
|
|
591
|
+
domain: e,
|
|
592
|
+
setDomain: (h) => {
|
|
593
|
+
h !== e && (ve(), t(h));
|
|
594
|
+
},
|
|
595
|
+
domains: s,
|
|
596
|
+
graph: c,
|
|
597
|
+
loading: f,
|
|
598
|
+
error: N,
|
|
599
|
+
refresh: () => {
|
|
600
|
+
ve(), u((h) => h + 1);
|
|
601
|
+
},
|
|
602
|
+
selected: y,
|
|
603
|
+
select: (h) => {
|
|
604
|
+
i(h), R ? ae() : Se("next", h);
|
|
605
|
+
},
|
|
606
|
+
entry: C,
|
|
607
|
+
entryLoading: x,
|
|
608
|
+
entryError: g,
|
|
609
|
+
retryEntry: () => k((h) => h + 1),
|
|
610
|
+
full: R,
|
|
611
|
+
toggleFull: () => {
|
|
612
|
+
ae(), M((h) => !h);
|
|
613
|
+
},
|
|
614
|
+
history: U,
|
|
615
|
+
slice: oe,
|
|
616
|
+
expanded: se,
|
|
617
|
+
result: te,
|
|
618
|
+
query: Se,
|
|
619
|
+
queryLoading: ie,
|
|
620
|
+
queryError: De,
|
|
621
|
+
reset: () => {
|
|
622
|
+
var h, b;
|
|
623
|
+
if (ae(), M(!1), c) {
|
|
624
|
+
const $ = Ee(c);
|
|
625
|
+
O([{ label: "开场", slice: $, expanded: [], selected: (h = $.nodes[0]) == null ? void 0 : h.id }]), i((b = $.nodes[0]) == null ? void 0 : b.id);
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
back: (h = U.length - 2) => {
|
|
629
|
+
const b = U[h];
|
|
630
|
+
b && (ae(), M(!1), O(U.slice(0, h + 1)), i(b.selected));
|
|
631
|
+
},
|
|
632
|
+
toggleSeams: () => {
|
|
633
|
+
if (!y) return;
|
|
634
|
+
const h = Me(oe, y), $ = h.every((D) => se.includes(D)) ? se.filter((D) => !h.includes(D)) : [.../* @__PURE__ */ new Set([...se, ...h])];
|
|
635
|
+
O((D) => D.map((q, _) => _ === D.length - 1 ? { ...q, expanded: $ } : q));
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
function tn({ open: e, onClose: t, domain: s, selected: l, graph: o, result: u }) {
|
|
640
|
+
const { message: c } = Le.useApp(), [d, f] = E(), [m, N] = E(!1), [w, y] = E(""), [i, p] = E(""), v = de(null);
|
|
641
|
+
he(() => () => {
|
|
642
|
+
var g;
|
|
643
|
+
return (g = v.current) == null ? void 0 : g.abort();
|
|
644
|
+
}, []);
|
|
645
|
+
const a = async (g) => {
|
|
646
|
+
var x;
|
|
647
|
+
try {
|
|
648
|
+
if (!((x = navigator.clipboard) != null && x.writeText)) throw new Error("clipboard unavailable");
|
|
649
|
+
await navigator.clipboard.writeText(g), p("已复制"), c.success("已复制");
|
|
650
|
+
} catch {
|
|
651
|
+
p("复制失败,请手动选择内容复制"), c.error("复制失败,请手动选择内容复制");
|
|
652
|
+
}
|
|
653
|
+
}, k = async (g) => {
|
|
654
|
+
var R;
|
|
655
|
+
(R = v.current) == null || R.abort();
|
|
656
|
+
const x = new AbortController();
|
|
657
|
+
v.current = x, N(!0), y(""), f(void 0);
|
|
658
|
+
try {
|
|
659
|
+
const M = g === "compact" ? await _e(s || void 0, x.signal) : await Ze(x.signal);
|
|
660
|
+
x.signal.aborted || f(M);
|
|
661
|
+
} catch (M) {
|
|
662
|
+
x.signal.aborted || y(ce(M));
|
|
663
|
+
} finally {
|
|
664
|
+
x.signal.aborted || N(!1);
|
|
665
|
+
}
|
|
666
|
+
}, S = l || "<节点ID>", C = [
|
|
667
|
+
{ name: "下一步", url: z("next", { id: S, maxDepth: 6 }) },
|
|
668
|
+
{ name: "候选路径", url: z("path", { from: S, to: "<目标节点ID>", maxDepth: 16 }) },
|
|
669
|
+
{ name: "影响分析", url: z("impact", { id: S, maxDepth: 16 }) },
|
|
670
|
+
{ name: "抑制关系", url: z("suppressions", { id: S }) }
|
|
671
|
+
];
|
|
672
|
+
return /* @__PURE__ */ r(Oe, { title: "AI 接入", open: e, onClose: t, width: 560, className: "causal-ai", children: [
|
|
673
|
+
/* @__PURE__ */ n("p", { children: "以下为只读 HTTP 工具用法,需携带当前账号授权;未执行 AI 工作流。" }),
|
|
674
|
+
C.map((g) => /* @__PURE__ */ r("section", { children: [
|
|
675
|
+
/* @__PURE__ */ n("h4", { children: g.name }),
|
|
676
|
+
/* @__PURE__ */ r("pre", { children: [
|
|
677
|
+
"GET ",
|
|
678
|
+
g.url
|
|
679
|
+
] }),
|
|
680
|
+
/* @__PURE__ */ r(P, { size: "small", onClick: () => void a(`GET ${g.url}`), children: [
|
|
681
|
+
"复制",
|
|
682
|
+
g.name,
|
|
683
|
+
"查询"
|
|
684
|
+
] })
|
|
685
|
+
] }, g.name)),
|
|
686
|
+
/* @__PURE__ */ r(xe, { wrap: !0, children: [
|
|
687
|
+
/* @__PURE__ */ n(P, { disabled: !u, onClick: () => void a(JSON.stringify({ version: o == null ? void 0 : o.version, quality: o == null ? void 0 : o.quality, result: u }, null, 2)), children: "复制结构化结果" }),
|
|
688
|
+
/* @__PURE__ */ n(P, { onClick: () => void k("compact"), children: "获取紧凑包" }),
|
|
689
|
+
/* @__PURE__ */ n(P, { onClick: () => void k("tools"), children: "读取工具清单" })
|
|
690
|
+
] }),
|
|
691
|
+
m && /* @__PURE__ */ n("p", { role: "status", children: "正在读取接口…" }),
|
|
692
|
+
w && /* @__PURE__ */ r("p", { role: "alert", children: [
|
|
693
|
+
w,
|
|
694
|
+
" 可再次点击重试。"
|
|
695
|
+
] }),
|
|
696
|
+
d !== void 0 && /* @__PURE__ */ r("section", { children: [
|
|
697
|
+
/* @__PURE__ */ n("h4", { children: "接口原始结果" }),
|
|
698
|
+
/* @__PURE__ */ n(P, { size: "small", onClick: () => void a(typeof d == "string" ? d : JSON.stringify(d, null, 2)), children: "复制接口结果" }),
|
|
699
|
+
/* @__PURE__ */ n("pre", { children: I(d) })
|
|
700
|
+
] }),
|
|
701
|
+
u && /* @__PURE__ */ r("details", { children: [
|
|
702
|
+
/* @__PURE__ */ n("summary", { children: "当前结构化查询结果" }),
|
|
703
|
+
/* @__PURE__ */ n("pre", { children: I(u) })
|
|
704
|
+
] }),
|
|
705
|
+
i && /* @__PURE__ */ n("p", { role: "status", children: i }),
|
|
706
|
+
/* @__PURE__ */ n("p", { className: "causal-muted", children: "后端数据质量(接口原值)" }),
|
|
707
|
+
/* @__PURE__ */ n("pre", { children: I(o == null ? void 0 : o.quality) })
|
|
708
|
+
] });
|
|
709
|
+
}
|
|
710
|
+
function yn() {
|
|
711
|
+
var k, S, C;
|
|
712
|
+
const e = nn(), { width: t, containerRef: s, startResize: l, resetWidth: o } = Te({ storageKey: "causal.inspectorWidth", defaultWidth: 340, minWidth: 280, maxWidth: 520, minOtherWidth: 320, side: "right" }), [u, c] = E(!1), [d, f] = E(), m = (d == null ? void 0 : d.history) === e.history && d.graph === e.graph && d.selected === e.selected && d.full === e.full ? d.edge : void 0, N = (g) => f(g ? { edge: g, history: e.history, graph: e.graph, selected: e.selected, full: e.full } : void 0), w = le(() => Pe(e.graph ?? { nodes: [], edges: [] }, e.slice).nodes, [e.graph, e.slice]), y = w.find((g) => g.id === e.selected), i = e.selected ? Me(e.slice, e.selected) : [], p = i.length > 0 && i.every((g) => e.expanded.includes(g)), v = (g) => {
|
|
713
|
+
N(void 0), e.select(g);
|
|
714
|
+
}, a = (k = e.graph) == null ? void 0 : k.quality;
|
|
715
|
+
return /* @__PURE__ */ r("div", { className: "view causal-page", children: [
|
|
716
|
+
/* @__PURE__ */ r("header", { className: "causal-topbar", children: [
|
|
717
|
+
/* @__PURE__ */ n(be, { "aria-label": "因果域", value: e.domain, onChange: e.setDomain, options: [{ value: "", label: "全部域" }, ...e.domains.map((g) => ({ value: g, label: g }))] }),
|
|
718
|
+
/* @__PURE__ */ n(ye, { nodes: w, label: "搜索节点", value: e.selected, onChange: v }),
|
|
719
|
+
/* @__PURE__ */ n(P, { onClick: e.refresh, children: e.loading ? "重新刷新" : "刷新" }),
|
|
720
|
+
/* @__PURE__ */ n(P, { disabled: !e.graph, onClick: e.toggleFull, children: e.full ? "返回人视角" : "看全图" }),
|
|
721
|
+
/* @__PURE__ */ n(P, { disabled: !e.graph, onClick: e.reset, children: "重置" }),
|
|
722
|
+
/* @__PURE__ */ n(P, { onClick: () => c(!0), children: "AI 接入" })
|
|
723
|
+
] }),
|
|
724
|
+
e.loading ? /* @__PURE__ */ r("div", { className: "causal-state", role: "status", children: [
|
|
725
|
+
/* @__PURE__ */ n(Ne, {}),
|
|
726
|
+
/* @__PURE__ */ n("p", { children: "正在加载因果图…" })
|
|
727
|
+
] }) : e.error ? /* @__PURE__ */ r("div", { className: "causal-state", role: "alert", children: [
|
|
728
|
+
/* @__PURE__ */ n("p", { children: e.error }),
|
|
729
|
+
/* @__PURE__ */ n(P, { onClick: e.refresh, children: "重试加载" })
|
|
730
|
+
] }) : (S = e.graph) != null && S.nodes.length ? /* @__PURE__ */ r("div", { className: "causal-workspace split-layout", ref: s, style: { "--split-w": `${t}px` }, children: [
|
|
731
|
+
/* @__PURE__ */ r("main", { className: "causal-main", children: [
|
|
732
|
+
/* @__PURE__ */ r("div", { className: "causal-trail", "aria-label": "探索足迹", children: [
|
|
733
|
+
/* @__PURE__ */ n(P, { size: "small", disabled: e.history.length < 2, onClick: () => e.back(), children: "回退" }),
|
|
734
|
+
/* @__PURE__ */ n("div", { className: "causal-trail-items", children: e.history.map((g, x) => /* @__PURE__ */ n(X, { hint: g.label, children: /* @__PURE__ */ r(P, { size: "small", type: "text", onClick: () => e.back(x), children: [
|
|
735
|
+
x + 1,
|
|
736
|
+
". ",
|
|
737
|
+
g.label
|
|
738
|
+
] }) }, x)) }),
|
|
739
|
+
!e.full && i.length > 0 && /* @__PURE__ */ n(P, { size: "small", onClick: e.toggleSeams, children: p ? "收起局部缝" : `展开局部缝 (${i.length})` })
|
|
740
|
+
] }),
|
|
741
|
+
/* @__PURE__ */ n(Ge, { slice: e.full ? e.graph : e.slice, expanded: e.expanded, full: e.full, selected: e.selected, onSelect: v, onEdge: N }),
|
|
742
|
+
/* @__PURE__ */ r("div", { className: "causal-quality", "aria-label": "数据质量", children: [
|
|
743
|
+
/* @__PURE__ */ n(X, { hint: `版本 ${e.graph.version}`, children: /* @__PURE__ */ r("span", { children: [
|
|
744
|
+
"版本 ",
|
|
745
|
+
e.graph.version
|
|
746
|
+
] }) }),
|
|
747
|
+
a && /* @__PURE__ */ r(Q, { children: [
|
|
748
|
+
/* @__PURE__ */ r("span", { children: [
|
|
749
|
+
"节点 ",
|
|
750
|
+
I(a.nodeCount)
|
|
751
|
+
] }),
|
|
752
|
+
/* @__PURE__ */ r("span", { children: [
|
|
753
|
+
"边 ",
|
|
754
|
+
I(a.edgeCount)
|
|
755
|
+
] }),
|
|
756
|
+
/* @__PURE__ */ r("span", { children: [
|
|
757
|
+
"悬空 ",
|
|
758
|
+
I(a.danglingCount)
|
|
759
|
+
] }),
|
|
760
|
+
/* @__PURE__ */ r("span", { children: [
|
|
761
|
+
"已标注动作 ",
|
|
762
|
+
I(a.annotatedActionCount)
|
|
763
|
+
] }),
|
|
764
|
+
/* @__PURE__ */ n(X, { hint: "仅统计已接入声明的边证据完整率,不代表全系统覆盖或运行成功", children: /* @__PURE__ */ r("span", { children: [
|
|
765
|
+
"证据覆盖 ",
|
|
766
|
+
Ce(a.evidenceCoverage, a.evidenceDenominator)
|
|
767
|
+
] }) }),
|
|
768
|
+
/* @__PURE__ */ n(X, { hint: "仅统计已接入抑制边的条件完整率;没有抑制边时为 N/A", children: /* @__PURE__ */ r("span", { children: [
|
|
769
|
+
"条件抑制覆盖 ",
|
|
770
|
+
Ce(a.conditionalSuppressionCoverage, a.conditionalSuppressionDenominator)
|
|
771
|
+
] }) })
|
|
772
|
+
] })
|
|
773
|
+
] })
|
|
774
|
+
] }),
|
|
775
|
+
/* @__PURE__ */ n("div", { className: "split-handle", role: "separator", "aria-label": "调整证据栏宽度", "aria-orientation": "vertical", title: "拖动调整宽度,双击复位", onPointerDown: l, onDoubleClick: o }),
|
|
776
|
+
/* @__PURE__ */ r("aside", { className: "causal-inspector", "aria-label": "查询与证据详情", children: [
|
|
777
|
+
/* @__PURE__ */ n(We, { nodes: w, selected: e.selected, result: e.result, loading: e.queryLoading, error: e.queryError, query: e.query }, e.domain),
|
|
778
|
+
/* @__PURE__ */ n(Be, { node: y, entry: e.entry, edge: m, loading: e.entryLoading, error: e.entryError, retry: e.retryEntry })
|
|
779
|
+
] })
|
|
780
|
+
] }) : /* @__PURE__ */ r("div", { className: "causal-state", children: [
|
|
781
|
+
/* @__PURE__ */ n(ue, { description: "当前域暂无因果数据" }),
|
|
782
|
+
/* @__PURE__ */ n(P, { onClick: e.refresh, children: "刷新数据" })
|
|
783
|
+
] }),
|
|
784
|
+
u && /* @__PURE__ */ n(tn, { open: !0, onClose: () => c(!1), domain: e.domain, selected: e.selected, graph: e.graph, result: e.result }, `${e.domain}:${((C = e.graph) == null ? void 0 : C.version) ?? "loading"}`)
|
|
785
|
+
] });
|
|
786
|
+
}
|
|
787
|
+
export {
|
|
788
|
+
yn as default
|
|
789
|
+
};
|