dsh-prime-memory 0.26.32 → 0.26.33
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/client.js +270 -32
- package/dsh.plugin.json +1 -1
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -42548,6 +42548,43 @@ var __create = Object.create;
|
|
|
42548
42548
|
return name;
|
|
42549
42549
|
}
|
|
42550
42550
|
var STAR_COUNT = 90;
|
|
42551
|
+
var EGO_SUBGRAPH_HOPS = 3;
|
|
42552
|
+
var EGO_SUBGRAPH_CAP = 400;
|
|
42553
|
+
function egoSubgraph2(full, rootId, hops = EGO_SUBGRAPH_HOPS, cap = EGO_SUBGRAPH_CAP) {
|
|
42554
|
+
const byId = new Map(full.nodes.map((n) => [n.id, n]));
|
|
42555
|
+
const root = byId.get(rootId);
|
|
42556
|
+
if (!root) return { nodes: [], edges: [], truncated: false };
|
|
42557
|
+
const adj = /* @__PURE__ */ new Map();
|
|
42558
|
+
for (const e of full.edges) {
|
|
42559
|
+
if (!adj.has(e.from)) adj.set(e.from, []);
|
|
42560
|
+
if (!adj.has(e.to)) adj.set(e.to, []);
|
|
42561
|
+
adj.get(e.from).push(e.to);
|
|
42562
|
+
adj.get(e.to).push(e.from);
|
|
42563
|
+
}
|
|
42564
|
+
const depth = /* @__PURE__ */ new Map([[rootId, 0]]);
|
|
42565
|
+
const order = [rootId];
|
|
42566
|
+
let cutByCap = false;
|
|
42567
|
+
for (let i = 0; i < order.length; i++) {
|
|
42568
|
+
const cur = order[i];
|
|
42569
|
+
const d = depth.get(cur);
|
|
42570
|
+
if (d >= hops) continue;
|
|
42571
|
+
for (const nb of adj.get(cur) ?? []) {
|
|
42572
|
+
if (depth.has(nb)) continue;
|
|
42573
|
+
if (order.length >= cap) {
|
|
42574
|
+
cutByCap = true;
|
|
42575
|
+
break;
|
|
42576
|
+
}
|
|
42577
|
+
depth.set(nb, d + 1);
|
|
42578
|
+
order.push(nb);
|
|
42579
|
+
}
|
|
42580
|
+
}
|
|
42581
|
+
const keep = new Set(order);
|
|
42582
|
+
return {
|
|
42583
|
+
nodes: order.map((id) => byId.get(id)),
|
|
42584
|
+
edges: full.edges.filter((e) => keep.has(e.from) && keep.has(e.to)),
|
|
42585
|
+
truncated: full.truncated || cutByCap
|
|
42586
|
+
};
|
|
42587
|
+
}
|
|
42551
42588
|
var STAR_R_MIN = 0.12;
|
|
42552
42589
|
var STAR_O_MIN = 0.12;
|
|
42553
42590
|
function radiusForDegree(deg) {
|
|
@@ -45602,12 +45639,19 @@ var __create = Object.create;
|
|
|
45602
45639
|
const [linksError, setLinksError] = (0, import_react33.useState)(null);
|
|
45603
45640
|
const [emphasisId, setEmphasisId] = (0, import_react33.useState)(void 0);
|
|
45604
45641
|
const [view, setView] = (0, import_react33.useState)("3d");
|
|
45642
|
+
const [egoRoot, setEgoRoot] = (0, import_react33.useState)(null);
|
|
45643
|
+
const [searchText, setSearchText] = (0, import_react33.useState)("");
|
|
45644
|
+
const [searchMiss, setSearchMiss] = (0, import_react33.useState)(false);
|
|
45645
|
+
const [searchOpen, setSearchOpen] = (0, import_react33.useState)(false);
|
|
45605
45646
|
const linksSeq = (0, import_react33.useRef)(0);
|
|
45606
45647
|
const [mode, setMode] = (0, import_react33.useState)("query");
|
|
45648
|
+
const [entryPane, setEntryPane] = (0, import_react33.useState)(false);
|
|
45607
45649
|
const [detailOpen, setDetailOpen] = (0, import_react33.useState)(false);
|
|
45608
45650
|
const [detailW, setDetailW] = (0, import_react33.useState)(DETAIL_DEFAULT);
|
|
45609
45651
|
const containerRef = (0, import_react33.useRef)(null);
|
|
45610
45652
|
const dragWRef = (0, import_react33.useRef)(null);
|
|
45653
|
+
const modeRef = (0, import_react33.useRef)(mode);
|
|
45654
|
+
modeRef.current = mode;
|
|
45611
45655
|
const startDrag = (0, import_react33.useCallback)((ev) => {
|
|
45612
45656
|
ev.preventDefault();
|
|
45613
45657
|
dragWRef.current = { startX: ev.clientX, startW: detailW };
|
|
@@ -45630,6 +45674,7 @@ var __create = Object.create;
|
|
|
45630
45674
|
const loadGraph = (0, import_react33.useCallback)(() => {
|
|
45631
45675
|
setGraphLoading(true);
|
|
45632
45676
|
setGraphError(null);
|
|
45677
|
+
setEgoRoot(null);
|
|
45633
45678
|
rpc("dsh-memory/graph-preview", { mode: "full" }).then((r) => {
|
|
45634
45679
|
if (!r.ok) throw new Error(r.error.message);
|
|
45635
45680
|
setStats(r.value.stats);
|
|
@@ -45643,13 +45688,13 @@ var __create = Object.create;
|
|
|
45643
45688
|
for (const it of items) if (it.content) labels.current.set(it.id, it.content);
|
|
45644
45689
|
}, []);
|
|
45645
45690
|
const openRecord = (0, import_react33.useCallback)(
|
|
45646
|
-
(id) => {
|
|
45691
|
+
(id, opts) => {
|
|
45647
45692
|
const token = ++linksSeq.current;
|
|
45648
45693
|
setRecordId(id);
|
|
45649
45694
|
setLinksLoading(true);
|
|
45650
45695
|
setLinksError(null);
|
|
45651
|
-
|
|
45652
|
-
setDetailOpen(true);
|
|
45696
|
+
setEntryPane(true);
|
|
45697
|
+
if (modeRef.current === "graph") setDetailOpen(true);
|
|
45653
45698
|
rpc("dsh-memory/record-links", { recordId: id }).then((r) => {
|
|
45654
45699
|
if (token !== linksSeq.current) return;
|
|
45655
45700
|
if (!r.ok) throw new Error(r.error.message);
|
|
@@ -45658,6 +45703,7 @@ var __create = Object.create;
|
|
|
45658
45703
|
remember(v.records);
|
|
45659
45704
|
setLinks(v);
|
|
45660
45705
|
setEmphasisId(v.entities[0]?.id);
|
|
45706
|
+
if (!opts?.keepEgo && v.entities[0]) setEgoRoot(v.entities[0].id);
|
|
45661
45707
|
}).catch((e) => {
|
|
45662
45708
|
if (token !== linksSeq.current) return;
|
|
45663
45709
|
setLinksError(String(e?.message ?? e));
|
|
@@ -45675,26 +45721,81 @@ var __create = Object.create;
|
|
|
45675
45721
|
const known = links?.entities.find((e) => e.id === nodeId) ?? links?.neighbors.find((n) => n.id === nodeId);
|
|
45676
45722
|
const first = known?.recordIds[0];
|
|
45677
45723
|
if (first) {
|
|
45678
|
-
openRecord(first);
|
|
45724
|
+
openRecord(first, { keepEgo: true });
|
|
45679
45725
|
return;
|
|
45680
45726
|
}
|
|
45681
45727
|
rpc("dsh-memory/graph-node-get", { id: nodeId }).then((r) => {
|
|
45682
45728
|
const node = r.ok ? r.value.node : null;
|
|
45683
45729
|
const id = node?.sourceRecordIds?.[0];
|
|
45684
|
-
if (id) openRecord(id);
|
|
45730
|
+
if (id) openRecord(id, { keepEgo: true });
|
|
45685
45731
|
}).catch(() => {
|
|
45686
45732
|
});
|
|
45687
45733
|
},
|
|
45688
45734
|
[links, openRecord, rpc]
|
|
45689
45735
|
);
|
|
45736
|
+
const onPickNode2d = (0, import_react33.useCallback)(
|
|
45737
|
+
(nodeId) => {
|
|
45738
|
+
setEgoRoot(nodeId);
|
|
45739
|
+
onPickNode(nodeId);
|
|
45740
|
+
},
|
|
45741
|
+
[onPickNode]
|
|
45742
|
+
);
|
|
45743
|
+
const graphData = (0, import_react33.useMemo)(
|
|
45744
|
+
() => full && egoRoot ? egoSubgraph2(full, egoRoot) : full,
|
|
45745
|
+
[full, egoRoot]
|
|
45746
|
+
);
|
|
45747
|
+
const locateNode = (0, import_react33.useCallback)(
|
|
45748
|
+
(nodeId) => {
|
|
45749
|
+
setEmphasisId(nodeId);
|
|
45750
|
+
if (view === "2d") setEgoRoot(nodeId);
|
|
45751
|
+
setSearchOpen(false);
|
|
45752
|
+
},
|
|
45753
|
+
[view]
|
|
45754
|
+
);
|
|
45755
|
+
const searchHits = (0, import_react33.useMemo)(() => {
|
|
45756
|
+
const q = searchText.trim().toLowerCase();
|
|
45757
|
+
if (!q || !full) return [];
|
|
45758
|
+
const hits = full.nodes.filter((n) => n.name.toLowerCase().includes(q));
|
|
45759
|
+
return hits.slice(0, 200);
|
|
45760
|
+
}, [searchText, full]);
|
|
45761
|
+
const locateFirstHit = (0, import_react33.useCallback)(() => {
|
|
45762
|
+
const q = searchText.trim().toLowerCase();
|
|
45763
|
+
if (!q || !full) return;
|
|
45764
|
+
const hit = full.nodes.find((n) => n.name.toLowerCase().includes(q));
|
|
45765
|
+
if (!hit) {
|
|
45766
|
+
setSearchMiss(true);
|
|
45767
|
+
setTimeout(() => setSearchMiss(false), 1500);
|
|
45768
|
+
return;
|
|
45769
|
+
}
|
|
45770
|
+
setSearchMiss(false);
|
|
45771
|
+
locateNode(hit.id);
|
|
45772
|
+
}, [searchText, full, locateNode]);
|
|
45773
|
+
const jumpToGraph = (0, import_react33.useCallback)(
|
|
45774
|
+
(target) => {
|
|
45775
|
+
const root = links?.entities[0]?.id;
|
|
45776
|
+
setView(target);
|
|
45777
|
+
setMode("graph");
|
|
45778
|
+
setDetailOpen(true);
|
|
45779
|
+
if (root) {
|
|
45780
|
+
setEmphasisId(root);
|
|
45781
|
+
if (target === "2d") setEgoRoot(root);
|
|
45782
|
+
}
|
|
45783
|
+
},
|
|
45784
|
+
[links]
|
|
45785
|
+
);
|
|
45786
|
+
const backToEntry = (0, import_react33.useCallback)(() => {
|
|
45787
|
+
setMode("query");
|
|
45788
|
+
setEntryPane(true);
|
|
45789
|
+
}, []);
|
|
45690
45790
|
const labelOfRecord = (0, import_react33.useCallback)((id) => labels.current.get(id) ?? id.slice(0, 10), []);
|
|
45691
45791
|
const building = stats && stats.jobsTotal > 0 && stats.pendingJobs > 0;
|
|
45692
45792
|
const summary = (0, import_react33.useMemo)(() => {
|
|
45693
45793
|
if (!stats) return "统计未到";
|
|
45694
|
-
const drawn =
|
|
45695
|
-
const
|
|
45696
|
-
|
|
45697
|
-
|
|
45794
|
+
const drawn = graphData ? graphData.nodes.length : 0;
|
|
45795
|
+
const egoNote = egoRoot ? ` · ego ≤3 跳(${drawn} 节点)` : "";
|
|
45796
|
+
const cut = graphData?.truncated ? "(已截断,仅画部分)" : "";
|
|
45797
|
+
return `节点 ${drawn}/${stats.nodes} · 边 ${graphData ? graphData.edges.length : 0}/${stats.edges} · 因果边 ${stats.causalEdges}${cut}${egoNote}`;
|
|
45798
|
+
}, [stats, graphData, egoRoot]);
|
|
45698
45799
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { ref: containerRef, style: { display: "flex", flexDirection: "column", gap: 8, padding: 12, height: "calc(100vh - 48px)", minHeight: 0 }, children: [
|
|
45699
45800
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 10, flexWrap: "wrap" }, children: [
|
|
45700
45801
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h2", { style: { margin: 0, fontSize: 16 }, children: "记忆库" }),
|
|
@@ -45737,6 +45838,86 @@ var __create = Object.create;
|
|
|
45737
45838
|
)
|
|
45738
45839
|
] }),
|
|
45739
45840
|
mode === "graph" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
45841
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { style: { position: "relative", display: "inline-flex" }, children: [
|
|
45842
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
45843
|
+
NInput,
|
|
45844
|
+
{
|
|
45845
|
+
value: searchText,
|
|
45846
|
+
onChange: (e) => {
|
|
45847
|
+
setSearchText(e.target.value);
|
|
45848
|
+
setSearchOpen(true);
|
|
45849
|
+
},
|
|
45850
|
+
onFocus: () => setSearchOpen(true),
|
|
45851
|
+
onBlur: () => setTimeout(() => setSearchOpen(false), 180),
|
|
45852
|
+
onKeyDown: (e) => {
|
|
45853
|
+
if (e.key === "Enter") locateFirstHit();
|
|
45854
|
+
if (e.key === "Escape") setSearchOpen(false);
|
|
45855
|
+
},
|
|
45856
|
+
placeholder: searchMiss ? "未命中该实体" : "搜实体名…",
|
|
45857
|
+
style: { width: 160, fontSize: 12 }
|
|
45858
|
+
}
|
|
45859
|
+
),
|
|
45860
|
+
searchOpen && searchText.trim() && searchHits.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
45861
|
+
"div",
|
|
45862
|
+
{
|
|
45863
|
+
style: {
|
|
45864
|
+
position: "absolute",
|
|
45865
|
+
top: "calc(100% + 4px)",
|
|
45866
|
+
left: 0,
|
|
45867
|
+
zIndex: 20,
|
|
45868
|
+
width: 240,
|
|
45869
|
+
maxHeight: 260,
|
|
45870
|
+
overflow: "auto",
|
|
45871
|
+
background: "var(--dsh-mem-bg-card)",
|
|
45872
|
+
border: "1px solid var(--dsh-mem-border)",
|
|
45873
|
+
borderRadius: 8,
|
|
45874
|
+
boxShadow: "0 6px 18px rgba(0,0,0,.25)"
|
|
45875
|
+
},
|
|
45876
|
+
children: searchHits.map((n) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
45877
|
+
"div",
|
|
45878
|
+
{
|
|
45879
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
45880
|
+
onClick: () => locateNode(n.id),
|
|
45881
|
+
style: { padding: "5px 10px", fontSize: 12, cursor: "pointer", display: "flex", gap: 6, alignItems: "center" },
|
|
45882
|
+
title: `${n.type}${n.aging != null ? ` · 老化 ${n.aging.toFixed(2)}` : ""}`,
|
|
45883
|
+
children: [
|
|
45884
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { style: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: n.name }),
|
|
45885
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { style: { fontSize: 10, color: "var(--dsh-mem-text-3)" }, children: n.type })
|
|
45886
|
+
]
|
|
45887
|
+
},
|
|
45888
|
+
n.id
|
|
45889
|
+
))
|
|
45890
|
+
}
|
|
45891
|
+
) : null,
|
|
45892
|
+
searchOpen && searchText.trim() && searchHits.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
45893
|
+
"div",
|
|
45894
|
+
{
|
|
45895
|
+
style: {
|
|
45896
|
+
position: "absolute",
|
|
45897
|
+
top: "calc(100% + 4px)",
|
|
45898
|
+
left: 0,
|
|
45899
|
+
zIndex: 20,
|
|
45900
|
+
width: 240,
|
|
45901
|
+
padding: "6px 10px",
|
|
45902
|
+
fontSize: 12,
|
|
45903
|
+
background: "var(--dsh-mem-bg-card)",
|
|
45904
|
+
border: "1px solid var(--dsh-mem-border)",
|
|
45905
|
+
borderRadius: 8,
|
|
45906
|
+
color: "var(--dsh-mem-text-3)"
|
|
45907
|
+
},
|
|
45908
|
+
children: "图里没有匹配的实体"
|
|
45909
|
+
}
|
|
45910
|
+
) : null
|
|
45911
|
+
] }),
|
|
45912
|
+
view === "2d" && egoRoot ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
45913
|
+
NButton,
|
|
45914
|
+
{
|
|
45915
|
+
onClick: () => setEgoRoot(null),
|
|
45916
|
+
title: "退出 ego 聚焦,重新渲染全图",
|
|
45917
|
+
style: { color: "var(--dsh-mem-accent)", borderColor: "var(--dsh-mem-accent)" },
|
|
45918
|
+
children: "回全图"
|
|
45919
|
+
}
|
|
45920
|
+
) : null,
|
|
45740
45921
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
45741
45922
|
NButton,
|
|
45742
45923
|
{
|
|
@@ -45751,26 +45932,77 @@ var __create = Object.create;
|
|
|
45751
45932
|
children: "详情"
|
|
45752
45933
|
}
|
|
45753
45934
|
),
|
|
45754
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.
|
|
45755
|
-
|
|
45756
|
-
|
|
45757
|
-
|
|
45758
|
-
|
|
45759
|
-
|
|
45760
|
-
|
|
45761
|
-
|
|
45762
|
-
|
|
45935
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { style: { display: "inline-flex", border: "1px solid var(--dsh-mem-border)", borderRadius: 6, overflow: "hidden", fontSize: 12 }, children: [
|
|
45936
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
45937
|
+
"span",
|
|
45938
|
+
{
|
|
45939
|
+
onClick: () => setView("2d"),
|
|
45940
|
+
title: "G6 力导星图",
|
|
45941
|
+
style: { padding: "3px 10px", cursor: "pointer", background: view === "2d" ? "var(--dsh-mem-accent)" : "transparent", color: view === "2d" ? "#fff" : "var(--dsh-mem-text-2)" },
|
|
45942
|
+
children: "2D"
|
|
45943
|
+
}
|
|
45944
|
+
),
|
|
45945
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
45946
|
+
"span",
|
|
45947
|
+
{
|
|
45948
|
+
onClick: () => setView("3d"),
|
|
45949
|
+
title: "Canvas 三维投影记忆海",
|
|
45950
|
+
style: { padding: "3px 10px", cursor: "pointer", background: view === "3d" ? "var(--dsh-mem-accent)" : "transparent", color: view === "3d" ? "#fff" : "var(--dsh-mem-text-2)" },
|
|
45951
|
+
children: "3D"
|
|
45952
|
+
}
|
|
45953
|
+
)
|
|
45954
|
+
] })
|
|
45763
45955
|
] }) : null,
|
|
45764
45956
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(NButton, { onClick: loadGraph, title: "重新拉取图与统计", children: "刷新图" }),
|
|
45765
45957
|
onClose ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(NButton, { onClick: onClose, title: "关闭", children: "关闭" }) : null
|
|
45766
45958
|
] }),
|
|
45767
|
-
mode === "query" ? /* @__PURE__ */ (0, import_jsx_runtime33.
|
|
45959
|
+
mode === "query" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { style: { display: "flex", flex: 1, minHeight: 0, gap: 0 }, children: [
|
|
45960
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { flex: 1, minWidth: 0, minHeight: 0, overflow: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(RecordPane, { rpc, activeId: recordId, onPick: openRecord }) }),
|
|
45961
|
+
entryPane && recordId ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
45962
|
+
"div",
|
|
45963
|
+
{
|
|
45964
|
+
style: {
|
|
45965
|
+
width: 420,
|
|
45966
|
+
minWidth: DETAIL_MIN,
|
|
45967
|
+
flexShrink: 0,
|
|
45968
|
+
minHeight: 0,
|
|
45969
|
+
overflow: "auto",
|
|
45970
|
+
borderLeft: "1px solid var(--dsh-mem-border)",
|
|
45971
|
+
paddingLeft: 10,
|
|
45972
|
+
display: "flex",
|
|
45973
|
+
flexDirection: "column",
|
|
45974
|
+
gap: 8
|
|
45975
|
+
},
|
|
45976
|
+
children: [
|
|
45977
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center", flexWrap: "wrap" }, children: [
|
|
45978
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { style: { fontSize: 12, color: "var(--dsh-mem-text-3)" }, children: "在图中定位本条目的实体:" }),
|
|
45979
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(NButton, { onClick: () => jumpToGraph("2d"), disabled: !links || links.entities.length === 0, title: "切到 2D 力导星图并 ego 聚焦首实体", children: "2D 图" }),
|
|
45980
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(NButton, { onClick: () => jumpToGraph("3d"), disabled: !links || links.entities.length === 0, title: "切到 3D 记忆海并 ego 聚焦首实体", children: "3D 图" }),
|
|
45981
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { style: { flex: 1 } }),
|
|
45982
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(NButton, { onClick: () => setEntryPane(false), title: "收起条目面板", children: "收起" })
|
|
45983
|
+
] }),
|
|
45984
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
45985
|
+
LinkPane,
|
|
45986
|
+
{
|
|
45987
|
+
recordId,
|
|
45988
|
+
links,
|
|
45989
|
+
loading: linksLoading,
|
|
45990
|
+
error: linksError,
|
|
45991
|
+
onPickRecord: openRecord,
|
|
45992
|
+
onEmphasisNode: setEmphasisId,
|
|
45993
|
+
labelOfRecord
|
|
45994
|
+
}
|
|
45995
|
+
)
|
|
45996
|
+
]
|
|
45997
|
+
}
|
|
45998
|
+
) : null
|
|
45999
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { style: { display: "flex", flex: 1, minHeight: 0, gap: 0 }, children: [
|
|
45768
46000
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { flex: 1, minWidth: 0, minHeight: 0, display: "flex", flexDirection: "column" }, children: graphError ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { style: { fontSize: 12, color: "var(--dsh-mem-accent)", padding: 8 }, children: [
|
|
45769
46001
|
"图数据读取失败:",
|
|
45770
46002
|
graphError,
|
|
45771
46003
|
" ",
|
|
45772
46004
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(NButton, { onClick: loadGraph, children: "重试" })
|
|
45773
|
-
] }) : graphLoading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { fontSize: 12, color: "var(--dsh-mem-text-3)", padding: 8 }, children: "图加载中…" }) : full && full.nodes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { fontSize: 12, color: "var(--dsh-mem-text-3)", padding: 8 }, children: "图里还没有节点。图谱投影默认关闭——在设置页「概览 → 知识图谱」打开开关后,存量记忆会逐批投影成实体与关系。" }) : full ? view === "3d" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Scene3D, { full, onPick: onPickNode, emphasisId, height: canvasHeight }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GraphCanvas, { full, onPick:
|
|
46005
|
+
] }) : graphLoading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { fontSize: 12, color: "var(--dsh-mem-text-3)", padding: 8 }, children: "图加载中…" }) : full && full.nodes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { style: { fontSize: 12, color: "var(--dsh-mem-text-3)", padding: 8 }, children: "图里还没有节点。图谱投影默认关闭——在设置页「概览 → 知识图谱」打开开关后,存量记忆会逐批投影成实体与关系。" }) : full ? view === "3d" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Scene3D, { full, onPick: onPickNode, emphasisId, height: canvasHeight }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GraphCanvas, { full: graphData ?? full, onPick: onPickNode2d, emphasisId, fit: "view", height: "fill" }) : null }),
|
|
45774
46006
|
detailOpen ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
45775
46007
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
45776
46008
|
"div",
|
|
@@ -45780,18 +46012,24 @@ var __create = Object.create;
|
|
|
45780
46012
|
title: "拖动调整详情宽度"
|
|
45781
46013
|
}
|
|
45782
46014
|
),
|
|
45783
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.
|
|
45784
|
-
|
|
45785
|
-
|
|
45786
|
-
recordId,
|
|
45787
|
-
|
|
45788
|
-
|
|
45789
|
-
|
|
45790
|
-
|
|
45791
|
-
|
|
45792
|
-
|
|
45793
|
-
|
|
45794
|
-
|
|
46015
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { style: { width: detailW, minWidth: DETAIL_MIN, flexShrink: 0, overflow: "auto", minHeight: 0, borderLeft: "1px solid var(--dsh-mem-border)", paddingLeft: 10, display: "flex", flexDirection: "column", gap: 8 }, children: [
|
|
46016
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { style: { display: "flex", gap: 6, alignItems: "center", flexWrap: "wrap" }, children: [
|
|
46017
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { style: { fontSize: 12, color: "var(--dsh-mem-text-3)" }, children: "本条目:" }),
|
|
46018
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(NButton, { onClick: backToEntry, disabled: !recordId, title: "切回查询视图并展开本条目(保留当前选点)", children: "按条目展示" })
|
|
46019
|
+
] }),
|
|
46020
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
46021
|
+
LinkPane,
|
|
46022
|
+
{
|
|
46023
|
+
recordId,
|
|
46024
|
+
links,
|
|
46025
|
+
loading: linksLoading,
|
|
46026
|
+
error: linksError,
|
|
46027
|
+
onPickRecord: openRecord,
|
|
46028
|
+
onEmphasisNode: setEmphasisId,
|
|
46029
|
+
labelOfRecord
|
|
46030
|
+
}
|
|
46031
|
+
)
|
|
46032
|
+
] })
|
|
45795
46033
|
] }) : null
|
|
45796
46034
|
] })
|
|
45797
46035
|
] });
|
package/dsh.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-prime-memory",
|
|
3
3
|
"name": "dsh-prime-memory",
|
|
4
|
-
"version": "0.26.
|
|
4
|
+
"version": "0.26.33",
|
|
5
5
|
"description": {
|
|
6
6
|
"en": "Layered distilled memory plugin (L0 capture → L1 atomic memory → L2 scenes → L3 persona) with automatic recall injection before each model step.",
|
|
7
7
|
"zh": "L0~L3 分层蒸馏记忆插件:自动捕获对话、抽取原子记忆、整合场景块、蒸馏核心画像,并在模型步骤前自动召回注入。"
|