dsh-mnemon-source-runtime 0.5.5 → 0.5.7
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/lib/index.js +7 -2
- package/package.json +20 -4
package/lib/index.js
CHANGED
|
@@ -207,7 +207,9 @@ function prepareMutation(before, request, now) {
|
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
209
|
const oldText = normalizeContent(request.oldText, "oldText");
|
|
210
|
-
const
|
|
210
|
+
const substringMatches = entries.map((entry, index) => entry.target === request.target && entry.content.includes(oldText) ? index : -1).filter((index) => index >= 0);
|
|
211
|
+
const exactMatches = substringMatches.filter((index) => entries[index].content === oldText);
|
|
212
|
+
const matches = exactMatches.length > 0 ? exactMatches : substringMatches;
|
|
211
213
|
if (matches.length === 0) throw new Error(`No ${request.target} entry contains ${JSON.stringify(oldText)}.`);
|
|
212
214
|
if (matches.length > 1) throw new Error(`Multiple ${request.target} entries contain ${JSON.stringify(oldText)}; use a unique substring.`);
|
|
213
215
|
const index = matches[0];
|
|
@@ -732,7 +734,10 @@ function createRuntimeMemorySource(config = {}) {
|
|
|
732
734
|
enum: ["memory", "user"]
|
|
733
735
|
},
|
|
734
736
|
content: { type: "string" },
|
|
735
|
-
oldText: {
|
|
737
|
+
oldText: {
|
|
738
|
+
type: "string",
|
|
739
|
+
description: "Full content of the existing entry, or a unique substring. A unique full-content match takes precedence within the selected target. Required for replace and remove."
|
|
740
|
+
},
|
|
736
741
|
importance: {
|
|
737
742
|
type: "string",
|
|
738
743
|
enum: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mnemon-source-runtime",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "Self-contained runtime Source for Composable View Memory.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -56,19 +56,35 @@
|
|
|
56
56
|
"react": "^18.2.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.1.
|
|
59
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.1.5-rc.1",
|
|
60
60
|
"@testing-library/react": "^16.3.0",
|
|
61
61
|
"@types/node": "^22.0.0",
|
|
62
62
|
"@types/react": "^18.3.0",
|
|
63
63
|
"@types/react-dom": "^18.3.0",
|
|
64
|
-
"dsh-mnemon": "^0.5.
|
|
64
|
+
"dsh-mnemon": "^0.5.10",
|
|
65
65
|
"jsdom": "^26.0.0",
|
|
66
66
|
"react": "^18.2.0",
|
|
67
67
|
"react-dom": "^18.2.0",
|
|
68
68
|
"tsdown": "^0.22.0",
|
|
69
69
|
"typescript": "^5.9.0",
|
|
70
70
|
"vitest": "^3.2.0",
|
|
71
|
-
"lightningcss": "^1.33.0"
|
|
71
|
+
"lightningcss": "^1.33.0",
|
|
72
|
+
"clsx": "^2.1.1",
|
|
73
|
+
"@shikijs/langs": "^4.3.1",
|
|
74
|
+
"anser": "^2.3.5",
|
|
75
|
+
"katex": "^0.16.47",
|
|
76
|
+
"mdast-util-from-markdown": "^2.0.3",
|
|
77
|
+
"mdast-util-gfm": "^3.1.0",
|
|
78
|
+
"mdast-util-math": "^3.0.0",
|
|
79
|
+
"micromark-core-commonmark": "^2.0.3",
|
|
80
|
+
"micromark-extension-gfm": "^3.0.0",
|
|
81
|
+
"micromark-extension-math": "^3.1.0",
|
|
82
|
+
"micromark-factory-space": "^2.0.1",
|
|
83
|
+
"micromark-util-character": "^2.1.1",
|
|
84
|
+
"micromark-util-classify-character": "^2.0.1",
|
|
85
|
+
"micromark-util-sanitize-uri": "^2.0.1",
|
|
86
|
+
"micromark-util-symbol": "^2.0.1",
|
|
87
|
+
"shiki": "^4.3.1"
|
|
72
88
|
},
|
|
73
89
|
"peerDependenciesMeta": {
|
|
74
90
|
"react": {
|