@alanzhao/dsh-memory-lite 0.4.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +18 -3
- package/README.md +18 -3
- package/lib/config.d.ts +20 -0
- package/lib/config.js +28 -0
- package/lib/config.js.map +1 -1
- package/lib/extract/decision.d.ts +16 -0
- package/lib/extract/decision.js +60 -2
- package/lib/extract/decision.js.map +1 -1
- package/lib/extract/index.d.ts +35 -2
- package/lib/extract/index.js +138 -41
- package/lib/extract/index.js.map +1 -1
- package/lib/extract/prompt.d.ts +4 -0
- package/lib/extract/prompt.js +46 -1
- package/lib/extract/prompt.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/memory-store.d.ts +44 -5
- package/lib/memory-store.js +116 -18
- package/lib/memory-store.js.map +1 -1
- package/lib/patch.d.ts +67 -0
- package/lib/patch.js +179 -0
- package/lib/patch.js.map +1 -0
- package/lib/status.js +2 -0
- package/lib/status.js.map +1 -1
- package/lib/tools/remember.js +3 -1
- package/lib/tools/remember.js.map +1 -1
- package/lib/tools/update-memory.js +2 -2
- package/lib/tools/update-memory.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ import { normalizeContent, summaryOf } from '../memory-store.js';
|
|
|
10
10
|
export function applyUpdateMemoryTool(ctx, deps) {
|
|
11
11
|
ctx.tools.register(defineTool({
|
|
12
12
|
name: 'update_memory',
|
|
13
|
-
description: "Replace a memory's current content with new content; the previous
|
|
13
|
+
description: "Replace a memory's current content with new content; the previous file is archived (History keeps a one-line note). Use when a memory is outdated or contradicts new facts.",
|
|
14
14
|
parameters: {
|
|
15
15
|
path: { type: 'string', required: true, description: 'Memory file path relative to the memory root, e.g. preferences/coding.md.' },
|
|
16
16
|
content: { type: 'string', required: true, description: 'The new current content of the memory.' },
|
|
@@ -35,7 +35,7 @@ export function applyUpdateMemoryTool(ctx, deps) {
|
|
|
35
35
|
if (content === '')
|
|
36
36
|
throw new Error('content must be a non-empty string');
|
|
37
37
|
await deps.store.updateCurrent(peer, args.path, content);
|
|
38
|
-
await deps.store.
|
|
38
|
+
await deps.store.ensureIndexEntry(peer, args.path, summaryOf(content));
|
|
39
39
|
return { path: args.path, content };
|
|
40
40
|
},
|
|
41
41
|
presentCall(args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-memory.js","sourceRoot":"","sources":["../../src/tools/update-memory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGnD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEhE,8BAA8B;AAC9B,MAAM,UAAU,qBAAqB,CAAC,GAAY,EAAE,IAAgB;IAClE,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC5B,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"update-memory.js","sourceRoot":"","sources":["../../src/tools/update-memory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGnD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEhE,8BAA8B;AAC9B,MAAM,UAAU,qBAAqB,CAAC,GAAY,EAAE,IAAgB;IAClE,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC5B,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,6KAA6K;QAC1L,UAAU,EAAE;YACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,E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;YACd,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAA;QACjH,CAAC;KACF,CAAC,CAAC,CAAA;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alanzhao/dsh-memory-lite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Lightweight zero-dependency memory plugin for DeepSeek Harness: Markdown-file memory store, L0 catalog injection, and 5 model-facing tools.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|