@modusensus/dsh-mneme 0.6.8 → 0.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +468 -463
  3. package/cordis.patch.yml +15 -15
  4. package/lib/api.js +783 -783
  5. package/lib/client.js +1754 -1757
  6. package/lib/commands.js +64 -64
  7. package/lib/config.js +298 -288
  8. package/lib/dream/clustering.js +118 -118
  9. package/lib/dream/decisions.js +488 -439
  10. package/lib/dream/sleep.js +561 -561
  11. package/lib/dream/tag-extractor.js +156 -156
  12. package/lib/dream.js +958 -935
  13. package/lib/embedding.js +154 -154
  14. package/lib/entities/extractor.js +242 -242
  15. package/lib/hot-memory.js +53 -53
  16. package/lib/index.js +361 -361
  17. package/lib/inject.js +208 -208
  18. package/lib/local-embedder.js +282 -282
  19. package/lib/mirror.js +170 -170
  20. package/lib/parser/tag.js +59 -59
  21. package/lib/parser/wiki-link.js +38 -38
  22. package/lib/quality-filter.js +123 -123
  23. package/lib/reranker.js +218 -218
  24. package/lib/search/adaptive.js +22 -22
  25. package/lib/search/bm25.js +96 -96
  26. package/lib/search/tag-boost.js +61 -61
  27. package/lib/service.js +1726 -1726
  28. package/lib/settings.js +172 -172
  29. package/lib/store.js +2238 -2238
  30. package/lib/summarize.js +236 -236
  31. package/lib/tools.js +290 -290
  32. package/lib/vector-index.js +116 -116
  33. package/package.json +80 -80
  34. package/scripts/benchmark-embed.js +201 -201
  35. package/scripts/benchmark-recall.js +133 -133
  36. package/scripts/benchmark-rerank.js +166 -166
  37. package/scripts/e2e-dsh.js +218 -218
  38. package/scripts/stress-dsh.js +255 -255
  39. package/scripts/sync-lib.js +52 -52
  40. package/src/api.js +783 -783
  41. package/src/commands.js +64 -64
  42. package/src/config.js +298 -288
  43. package/src/dream/clustering.js +118 -118
  44. package/src/dream/decisions.js +488 -439
  45. package/src/dream/sleep.js +561 -561
  46. package/src/dream/tag-extractor.js +156 -156
  47. package/src/dream.js +958 -935
  48. package/src/embedding.js +154 -154
  49. package/src/entities/extractor.js +242 -242
  50. package/src/hot-memory.js +53 -53
  51. package/src/index.js +361 -361
  52. package/src/inject.js +208 -208
  53. package/src/local-embedder.js +282 -282
  54. package/src/mirror.js +170 -170
  55. package/src/parser/tag.js +59 -59
  56. package/src/parser/wiki-link.js +38 -38
  57. package/src/quality-filter.js +123 -123
  58. package/src/reranker.js +218 -218
  59. package/src/search/adaptive.js +22 -22
  60. package/src/search/bm25.js +96 -96
  61. package/src/search/tag-boost.js +61 -61
  62. package/src/service.js +1726 -1726
  63. package/src/settings.js +172 -172
  64. package/src/store.js +2238 -2238
  65. package/src/summarize.js +236 -236
  66. package/src/tools.js +290 -290
  67. package/src/vector-index.js +116 -116
  68. package/test/api.test.js +594 -594
  69. package/test/audit.test.js +448 -448
  70. package/test/benchmark.test.js +35 -35
  71. package/test/boundary-v0625.test.js +82 -82
  72. package/test/client.test.js +368 -368
  73. package/test/clustering.test.js +100 -100
  74. package/test/commands.test.js +69 -69
  75. package/test/config.test.js +50 -50
  76. package/test/conflict-freeze.test.js +290 -290
  77. package/test/directory.test.js +134 -134
  78. package/test/dream.test.js +1060 -903
  79. package/test/entities.test.js +522 -522
  80. package/test/epistemic.test.js +298 -298
  81. package/test/fnew-0112.test.js +311 -311
  82. package/test/fnew-03.test.js +422 -422
  83. package/test/graph-api.test.js +175 -175
  84. package/test/helpers/dream-mock.js +82 -82
  85. package/test/hot-memory.test.js +174 -174
  86. package/test/inject.test.js +103 -103
  87. package/test/llm-audit.test.js +279 -279
  88. package/test/local-embedder.test.js +227 -227
  89. package/test/mirror-dirty.test.js +424 -424
  90. package/test/mirror-edit-digest.test.js +187 -187
  91. package/test/mirror-generation.test.js +499 -499
  92. package/test/mirror.test.js +249 -249
  93. package/test/normalize-decisions.test.js +120 -120
  94. package/test/peer-blockers.test.js +190 -190
  95. package/test/policy-epoch.test.js +259 -259
  96. package/test/provenance.test.js +103 -103
  97. package/test/quality-filter.test.js +118 -118
  98. package/test/reasoning-effort.test.js +199 -199
  99. package/test/recall-evals.test.js +235 -235
  100. package/test/recall-layer.test.js +315 -315
  101. package/test/receipt-chain.test.js +451 -451
  102. package/test/reflection.test.js +226 -226
  103. package/test/reranker.test.js +240 -240
  104. package/test/search-fusion.test.js +90 -90
  105. package/test/semantic.test.js +124 -124
  106. package/test/service-search.test.js +199 -199
  107. package/test/service.test.js +435 -435
  108. package/test/settings.test.js +118 -118
  109. package/test/sleep.test.js +365 -365
  110. package/test/store.test.js +436 -436
  111. package/test/stress.test.js +209 -209
  112. package/test/summarize.test.js +191 -191
  113. package/test/tag-boost.test.js +125 -125
  114. package/test/tag.test.js +312 -312
  115. package/test/tools.test.js +285 -285
  116. package/test/vector-index.test.js +221 -221
  117. package/test/wiki-link.test.js +332 -332
package/src/inject.js CHANGED
@@ -1,208 +1,208 @@
1
- import { createHotMemory } from "./hot-memory.js";
2
-
3
- // Best-effort extraction of the current user's latest message text from the
4
- // live session, for semantic-first injection (Bug4). The system-prompt
5
- // interpolator renders synchronously, so this walks the already-materialized
6
- // session event log (same event shape summarize.js consumes) and returns the
7
- // most recent human message. Any failure degrades to "" — the injector then
8
- // falls back to the legacy rule-based pick, never breaking the render.
9
- function lastUserQuery(ctx) {
10
- try {
11
- const events = ctx?.agent?.session?.events;
12
- if (!Array.isArray(events) || events.length === 0) return "";
13
- for (let i = events.length - 1; i >= 0; i--) {
14
- const event = events[i];
15
- if (event?.type !== "user/message") continue;
16
- const kind = event.data?.source?.kind;
17
- if (kind !== undefined && kind !== "user") continue;
18
- const parts = event.data?.content;
19
- if (!Array.isArray(parts) || parts.length === 0) continue;
20
- return parts
21
- .map((p) => (typeof p === "string" ? p : p?.text ?? ""))
22
- .filter(Boolean)
23
- .join("\n")
24
- .slice(0, 500);
25
- }
26
- } catch { /* session internals unavailable: degrade to no query */ }
27
- return "";
28
- }
29
-
30
- // Hot-memory round extraction (v0.5.0 1.3): pairs each user/message with the
31
- // next assistant reply from the materialized session log. Tolerates shapes
32
- // where assistant events carry a different type tag — anything whose payload
33
- // has content parts and is not a user message counts as a reply. Best-effort:
34
- // returns [] on any failure, and the hot block simply does not render.
35
- function extractRounds(ctx, maxRounds) {
36
- try {
37
- const events = ctx?.agent?.session?.events;
38
- if (!Array.isArray(events) || events.length === 0) return [];
39
- const rounds = [];
40
- let pendingQuery = null;
41
- const textOf = (event) => {
42
- const parts = event?.data?.content;
43
- if (!Array.isArray(parts)) return "";
44
- return parts
45
- .map((p) => (typeof p === "string" ? p : p?.text ?? ""))
46
- .filter(Boolean)
47
- .join("\n")
48
- .trim();
49
- };
50
- for (const event of events) {
51
- const kind = event?.data?.source?.kind;
52
- const isUser = event?.type === "user/message" && (kind === undefined || kind === "user");
53
- if (isUser) {
54
- if (pendingQuery) rounds.push({ query: pendingQuery, response: "" });
55
- pendingQuery = textOf(event).slice(0, 500);
56
- continue;
57
- }
58
- // Only assistant-originated events close a round; tool/system events
59
- // carrying text must not be mistaken for the model's reply.
60
- const isAssistant = typeof event?.type === "string" && event.type.includes("assistant")
61
- || kind === "assistant";
62
- const body = isAssistant ? textOf(event) : "";
63
- if (!body || !pendingQuery) continue;
64
- rounds.push({ query: pendingQuery, response: body.slice(0, 800) });
65
- pendingQuery = null;
66
- }
67
- if (pendingQuery) rounds.push({ query: pendingQuery, response: "" });
68
- return rounds.slice(-maxRounds);
69
- } catch {
70
- return [];
71
- }
72
- }
73
-
74
- export function createInjector(ctx, service, settings, config) {
75
- const maxItems = config.maxInjectedItems ?? 5;
76
- const threshold = config.importanceThreshold ?? 3;
77
-
78
- // Bug6: bound the injected memory block. Each entry's content is truncated to
79
- // MAX_CONTENT chars (trailing `…`); the whole block gets a MAX_BLOCK budget
80
- // and an entry that would exceed it collapses to its title only, so a long
81
- // memory can never push the injected context past a few thousand chars.
82
- const MAX_CONTENT = 300;
83
- const MAX_BLOCK = 1500;
84
-
85
- // Compressed injection (v0.5.0 2.1): a sleep-demoted row already carries its
86
- // summary in `content` with the original parked in `_full_content` — inject
87
- // the summary verbatim instead of re-truncating the (already short) text.
88
- // Regular long rows keep the hard truncate.
89
- function injectMemory(m, maxLength = MAX_CONTENT) {
90
- if (m?._full_content) return String(m.content ?? "");
91
- const text = String(m?.content ?? "");
92
- return text.length <= maxLength ? text : `${text.slice(0, maxLength)}…`;
93
- }
94
-
95
- // Hot memory (v0.5.0 1.3): the latest rounds of THIS session, rebuilt from
96
- // the materialized event log on every render — stateless, so it survives
97
- // session switches and never persists anywhere.
98
- const hot = createHotMemory({
99
- maxRounds: config.hotMemoryRounds ?? 5,
100
- maxTokens: config.hotMemoryMaxTokens ?? 2000
101
- });
102
-
103
- function renderHotContext(ctx) {
104
- if (config.hotMemoryEnabled === false) return "";
105
- const rounds = extractRounds(ctx, config.hotMemoryRounds ?? 5);
106
- if (!rounds.length) return "";
107
- hot.clear();
108
- for (const r of rounds) hot.add(r);
109
- const body = hot.getContext();
110
- if (!body) return "";
111
- return `[短期上下文] 最近对话(共 ${rounds.length} 轮):\n${body}`;
112
- }
113
-
114
- function render(candidates) {
115
- if (!candidates.length) return "";
116
- const header = "[记忆库] 来自 dsh-mneme 的跨会话记忆(用户偏好与高优先级项目/决策):";
117
- const lines = [header];
118
- let budget = MAX_BLOCK - header.length;
119
- for (const m of candidates) {
120
- // Epistemic trust (v0.4.5): when enabled, measured observations are
121
- // flagged so the agent can weigh them above guesses/opinions.
122
- const verified = config.trustEpistemicWeighting === true && m.epistemic_status === "observation"
123
- ? "[verified] "
124
- : "";
125
- const title = `${m.title}(重要性 ${m.importance})`;
126
- const content = injectMemory(m);
127
- const full = `- [${m.type}] ${verified}${title}:${content}`;
128
- if (budget - full.length >= 0) {
129
- lines.push(full);
130
- budget -= full.length;
131
- } else {
132
- lines.push(`- [${m.type}] ${verified}${title}`);
133
- }
134
- }
135
- return lines.join("\n");
136
- }
137
-
138
- // Bug4: the system-prompt render is synchronous, so the semantic query vector
139
- // must be prefetched asynchronously and cached for the next assembly. The
140
- // first render after a new user message may still fall back to the rule-based
141
- // pick; later assemblies in the same session reuse the cached vector. Bounded
142
- // cache (cap 8, drop oldest) so a long session never grows it unbounded.
143
- const QUERY_VECTOR_CACHE_MAX = 8;
144
- const queryVectorCache = new Map();
145
- let lastPrefetched = "";
146
-
147
- function prefetchQueryVector(query) {
148
- if (!query || query === lastPrefetched || queryVectorCache.has(query)) return;
149
- lastPrefetched = query;
150
- service.embedQuery(query).then((vec) => {
151
- if (Array.isArray(vec) && vec.length) {
152
- queryVectorCache.set(query, vec);
153
- if (queryVectorCache.size > QUERY_VECTOR_CACHE_MAX) {
154
- queryVectorCache.delete(queryVectorCache.keys().next().value);
155
- }
156
- }
157
- }).catch(() => { /* prefetch is best-effort */ });
158
- }
159
-
160
- // User profile + rules: injected ahead of the memory block because they are
161
- // always-relevant instructions the agent should follow every turn.
162
- function renderUserSettings() {
163
- const profile = settings.getProfile().trim();
164
- const rules = settings.getRules();
165
- if (!profile && !rules.length) return "";
166
- const lines = ["[用户设置] 来自 dsh-mneme 的用户画像与规则:"];
167
- if (profile) lines.push(`- 用户画像:${profile}`);
168
- for (const rule of rules) lines.push(`- 规则:${rule}`);
169
- return lines.join("\n");
170
- }
171
-
172
- const disposers = [
173
- ctx.systemPrompt.context({
174
- name: "memory",
175
- order: 90,
176
- text: (ctx) => {
177
- // Bug4: pass the latest user query so injection prefers semantically
178
- // relevant memories; lastUserQuery is best-effort (empty → legacy).
179
- // The query vector is prefetched asynchronously (cached) because the
180
- // render itself must stay synchronous.
181
- const query = lastUserQuery(ctx);
182
- if (query) prefetchQueryVector(query);
183
- const queryVector = queryVectorCache.get(query);
184
- const candidates = service.injectCandidates({ query, queryVector, maxItems, threshold });
185
- // Hot memory (v0.5.0 1.3) leads the single memory block: the agent
186
- // sees the short-term rounds first, then the cross-session recall —
187
- // the documented injection order 1→2. Folding it here (instead of a
188
- // separate context) keeps the prompt assembly stable at two blocks.
189
- const hotText = renderHotContext(ctx);
190
- const body = render(candidates);
191
- if (!hotText) return body;
192
- return body ? `${hotText}\n\n${body}` : hotText;
193
- }
194
- }),
195
- ctx.systemPrompt.context({
196
- name: "user-settings",
197
- order: 85,
198
- text: renderUserSettings
199
- })
200
- ];
201
-
202
- return () => {
203
- queryVectorCache.clear();
204
- for (const dispose of disposers) {
205
- if (typeof dispose === "function") dispose();
206
- }
207
- };
208
- }
1
+ import { createHotMemory } from "./hot-memory.js";
2
+
3
+ // Best-effort extraction of the current user's latest message text from the
4
+ // live session, for semantic-first injection (Bug4). The system-prompt
5
+ // interpolator renders synchronously, so this walks the already-materialized
6
+ // session event log (same event shape summarize.js consumes) and returns the
7
+ // most recent human message. Any failure degrades to "" — the injector then
8
+ // falls back to the legacy rule-based pick, never breaking the render.
9
+ function lastUserQuery(ctx) {
10
+ try {
11
+ const events = ctx?.agent?.session?.events;
12
+ if (!Array.isArray(events) || events.length === 0) return "";
13
+ for (let i = events.length - 1; i >= 0; i--) {
14
+ const event = events[i];
15
+ if (event?.type !== "user/message") continue;
16
+ const kind = event.data?.source?.kind;
17
+ if (kind !== undefined && kind !== "user") continue;
18
+ const parts = event.data?.content;
19
+ if (!Array.isArray(parts) || parts.length === 0) continue;
20
+ return parts
21
+ .map((p) => (typeof p === "string" ? p : p?.text ?? ""))
22
+ .filter(Boolean)
23
+ .join("\n")
24
+ .slice(0, 500);
25
+ }
26
+ } catch { /* session internals unavailable: degrade to no query */ }
27
+ return "";
28
+ }
29
+
30
+ // Hot-memory round extraction (v0.5.0 1.3): pairs each user/message with the
31
+ // next assistant reply from the materialized session log. Tolerates shapes
32
+ // where assistant events carry a different type tag — anything whose payload
33
+ // has content parts and is not a user message counts as a reply. Best-effort:
34
+ // returns [] on any failure, and the hot block simply does not render.
35
+ function extractRounds(ctx, maxRounds) {
36
+ try {
37
+ const events = ctx?.agent?.session?.events;
38
+ if (!Array.isArray(events) || events.length === 0) return [];
39
+ const rounds = [];
40
+ let pendingQuery = null;
41
+ const textOf = (event) => {
42
+ const parts = event?.data?.content;
43
+ if (!Array.isArray(parts)) return "";
44
+ return parts
45
+ .map((p) => (typeof p === "string" ? p : p?.text ?? ""))
46
+ .filter(Boolean)
47
+ .join("\n")
48
+ .trim();
49
+ };
50
+ for (const event of events) {
51
+ const kind = event?.data?.source?.kind;
52
+ const isUser = event?.type === "user/message" && (kind === undefined || kind === "user");
53
+ if (isUser) {
54
+ if (pendingQuery) rounds.push({ query: pendingQuery, response: "" });
55
+ pendingQuery = textOf(event).slice(0, 500);
56
+ continue;
57
+ }
58
+ // Only assistant-originated events close a round; tool/system events
59
+ // carrying text must not be mistaken for the model's reply.
60
+ const isAssistant = typeof event?.type === "string" && event.type.includes("assistant")
61
+ || kind === "assistant";
62
+ const body = isAssistant ? textOf(event) : "";
63
+ if (!body || !pendingQuery) continue;
64
+ rounds.push({ query: pendingQuery, response: body.slice(0, 800) });
65
+ pendingQuery = null;
66
+ }
67
+ if (pendingQuery) rounds.push({ query: pendingQuery, response: "" });
68
+ return rounds.slice(-maxRounds);
69
+ } catch {
70
+ return [];
71
+ }
72
+ }
73
+
74
+ export function createInjector(ctx, service, settings, config) {
75
+ const maxItems = config.maxInjectedItems ?? 5;
76
+ const threshold = config.importanceThreshold ?? 3;
77
+
78
+ // Bug6: bound the injected memory block. Each entry's content is truncated to
79
+ // MAX_CONTENT chars (trailing `…`); the whole block gets a MAX_BLOCK budget
80
+ // and an entry that would exceed it collapses to its title only, so a long
81
+ // memory can never push the injected context past a few thousand chars.
82
+ const MAX_CONTENT = 300;
83
+ const MAX_BLOCK = 1500;
84
+
85
+ // Compressed injection (v0.5.0 2.1): a sleep-demoted row already carries its
86
+ // summary in `content` with the original parked in `_full_content` — inject
87
+ // the summary verbatim instead of re-truncating the (already short) text.
88
+ // Regular long rows keep the hard truncate.
89
+ function injectMemory(m, maxLength = MAX_CONTENT) {
90
+ if (m?._full_content) return String(m.content ?? "");
91
+ const text = String(m?.content ?? "");
92
+ return text.length <= maxLength ? text : `${text.slice(0, maxLength)}…`;
93
+ }
94
+
95
+ // Hot memory (v0.5.0 1.3): the latest rounds of THIS session, rebuilt from
96
+ // the materialized event log on every render — stateless, so it survives
97
+ // session switches and never persists anywhere.
98
+ const hot = createHotMemory({
99
+ maxRounds: config.hotMemoryRounds ?? 5,
100
+ maxTokens: config.hotMemoryMaxTokens ?? 2000
101
+ });
102
+
103
+ function renderHotContext(ctx) {
104
+ if (config.hotMemoryEnabled === false) return "";
105
+ const rounds = extractRounds(ctx, config.hotMemoryRounds ?? 5);
106
+ if (!rounds.length) return "";
107
+ hot.clear();
108
+ for (const r of rounds) hot.add(r);
109
+ const body = hot.getContext();
110
+ if (!body) return "";
111
+ return `[短期上下文] 最近对话(共 ${rounds.length} 轮):\n${body}`;
112
+ }
113
+
114
+ function render(candidates) {
115
+ if (!candidates.length) return "";
116
+ const header = "[记忆库] 来自 dsh-mneme 的跨会话记忆(用户偏好与高优先级项目/决策):";
117
+ const lines = [header];
118
+ let budget = MAX_BLOCK - header.length;
119
+ for (const m of candidates) {
120
+ // Epistemic trust (v0.4.5): when enabled, measured observations are
121
+ // flagged so the agent can weigh them above guesses/opinions.
122
+ const verified = config.trustEpistemicWeighting === true && m.epistemic_status === "observation"
123
+ ? "[verified] "
124
+ : "";
125
+ const title = `${m.title}(重要性 ${m.importance})`;
126
+ const content = injectMemory(m);
127
+ const full = `- [${m.type}] ${verified}${title}:${content}`;
128
+ if (budget - full.length >= 0) {
129
+ lines.push(full);
130
+ budget -= full.length;
131
+ } else {
132
+ lines.push(`- [${m.type}] ${verified}${title}`);
133
+ }
134
+ }
135
+ return lines.join("\n");
136
+ }
137
+
138
+ // Bug4: the system-prompt render is synchronous, so the semantic query vector
139
+ // must be prefetched asynchronously and cached for the next assembly. The
140
+ // first render after a new user message may still fall back to the rule-based
141
+ // pick; later assemblies in the same session reuse the cached vector. Bounded
142
+ // cache (cap 8, drop oldest) so a long session never grows it unbounded.
143
+ const QUERY_VECTOR_CACHE_MAX = 8;
144
+ const queryVectorCache = new Map();
145
+ let lastPrefetched = "";
146
+
147
+ function prefetchQueryVector(query) {
148
+ if (!query || query === lastPrefetched || queryVectorCache.has(query)) return;
149
+ lastPrefetched = query;
150
+ service.embedQuery(query).then((vec) => {
151
+ if (Array.isArray(vec) && vec.length) {
152
+ queryVectorCache.set(query, vec);
153
+ if (queryVectorCache.size > QUERY_VECTOR_CACHE_MAX) {
154
+ queryVectorCache.delete(queryVectorCache.keys().next().value);
155
+ }
156
+ }
157
+ }).catch(() => { /* prefetch is best-effort */ });
158
+ }
159
+
160
+ // User profile + rules: injected ahead of the memory block because they are
161
+ // always-relevant instructions the agent should follow every turn.
162
+ function renderUserSettings() {
163
+ const profile = settings.getProfile().trim();
164
+ const rules = settings.getRules();
165
+ if (!profile && !rules.length) return "";
166
+ const lines = ["[用户设置] 来自 dsh-mneme 的用户画像与规则:"];
167
+ if (profile) lines.push(`- 用户画像:${profile}`);
168
+ for (const rule of rules) lines.push(`- 规则:${rule}`);
169
+ return lines.join("\n");
170
+ }
171
+
172
+ const disposers = [
173
+ ctx.systemPrompt.context({
174
+ name: "memory",
175
+ order: 90,
176
+ text: (ctx) => {
177
+ // Bug4: pass the latest user query so injection prefers semantically
178
+ // relevant memories; lastUserQuery is best-effort (empty → legacy).
179
+ // The query vector is prefetched asynchronously (cached) because the
180
+ // render itself must stay synchronous.
181
+ const query = lastUserQuery(ctx);
182
+ if (query) prefetchQueryVector(query);
183
+ const queryVector = queryVectorCache.get(query);
184
+ const candidates = service.injectCandidates({ query, queryVector, maxItems, threshold });
185
+ // Hot memory (v0.5.0 1.3) leads the single memory block: the agent
186
+ // sees the short-term rounds first, then the cross-session recall —
187
+ // the documented injection order 1→2. Folding it here (instead of a
188
+ // separate context) keeps the prompt assembly stable at two blocks.
189
+ const hotText = renderHotContext(ctx);
190
+ const body = render(candidates);
191
+ if (!hotText) return body;
192
+ return body ? `${hotText}\n\n${body}` : hotText;
193
+ }
194
+ }),
195
+ ctx.systemPrompt.context({
196
+ name: "user-settings",
197
+ order: 85,
198
+ text: renderUserSettings
199
+ })
200
+ ];
201
+
202
+ return () => {
203
+ queryVectorCache.clear();
204
+ for (const dispose of disposers) {
205
+ if (typeof dispose === "function") dispose();
206
+ }
207
+ };
208
+ }