@fonlan/dsh-gitmemo 0.3.1 → 0.3.2
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.md +3 -1
- package/README.zh.md +1 -1
- package/lib/index.js +4 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -103,7 +103,9 @@ git -C .mem show <commit-hash>
|
|
|
103
103
|
`mem_write` every completed repo-related task that still lacks a memory and whose outcome is
|
|
104
104
|
**valuable/reusable** (or was explicitly asked to be remembered). Never duplicate an
|
|
105
105
|
already-written entry. Never write for pure Q&A, incomplete tasks, non-repo work, or purely
|
|
106
|
-
operational git actions.
|
|
106
|
+
operational git actions. `keywords` should be task-related words NOT already present in
|
|
107
|
+
`title` / `summary` (中英文同义词 both fine) — words already there are searchable via
|
|
108
|
+
`title` / `summary` themselves, so repeating them does not improve recall.
|
|
107
109
|
4. **User correction.** If a stored conclusion is outdated and a replacement exists →
|
|
108
110
|
`mem_replace` (never delete-then-write). If it is obsolete with no replacement →
|
|
109
111
|
`mem_delete` with a `reason`.
|
package/README.zh.md
CHANGED
|
@@ -94,7 +94,7 @@ git -C .mem show <commit-hash>
|
|
|
94
94
|
`mem_read` 5 条最相关记忆;用 `skip` + 返回的 `snapshot` 翻页。
|
|
95
95
|
3. **会话结束检查点 —— 唯一的写入路径。** 对话即将结束时,`mem_write` **每一条**已完成、与仓库
|
|
96
96
|
相关、且结论**有价值/可复用**(或用户明确要求记住)但还没有记忆的任务。绝不重复写已存在的条目。
|
|
97
|
-
纯问答、未完成任务、与仓库无关的工作、纯操作性的 git
|
|
97
|
+
纯问答、未完成任务、与仓库无关的工作、纯操作性的 git 动作一律不写。`keywords` 应选用与任务相关但未出现在 `title` / `summary` 中的词(中英文同义词皆可)——`title` / `summary` 已有的词本身就能被检索到,重复它们不会提高召回率。
|
|
98
98
|
4. **用户更正。** 已存结论过时且有替代结论 → `mem_replace`(禁止先 delete 再 write);结论作废且无
|
|
99
99
|
替代 → 带 `reason` 的 `mem_delete`。
|
|
100
100
|
5. **子代理结果。** 是否形成一条会话级记忆,由根 Agent 汇总后决定。
|
package/lib/index.js
CHANGED
|
@@ -216,7 +216,7 @@ function registerMemTools(ctx, config) {
|
|
|
216
216
|
}));
|
|
217
217
|
ctx.tools.register(defineTool({
|
|
218
218
|
name: "mem_write",
|
|
219
|
-
description: "Store a completed task outcome in the gitmemo long-term memory (.mem git repo). Write ONLY when the task is complete AND repo-related AND the outcome is valuable/reusable OR the user explicitly asked to remember. Entries are immutable: title (single line, ≤200 chars, \"[module] action + object\"), summary (≤4000 chars), keywords (2-12, include 中英文同义词) and content (markdown body; the engine generates front matter) are all required; related_branches/related_paths are optional. Corrections use mem_replace, withdrawal uses mem_delete — never rewrite in place.",
|
|
219
|
+
description: "Store a completed task outcome in the gitmemo long-term memory (.mem git repo). Write ONLY when the task is complete AND repo-related AND the outcome is valuable/reusable OR the user explicitly asked to remember. Entries are immutable: title (single line, ≤200 chars, \"[module] action + object\"), summary (≤4000 chars), keywords (2-12, include 中英文同义词) and content (markdown body; the engine generates front matter) are all required; related_branches/related_paths are optional. Keywords must ADD new search angles — pick task-related terms (中英文同义词 both fine) that are NOT already present in title/summary: words already in title/summary are searchable via those fields themselves, so repeating them does not improve recall. Corrections use mem_replace, withdrawal uses mem_delete — never rewrite in place.",
|
|
220
220
|
parameters: {
|
|
221
221
|
title: {
|
|
222
222
|
type: "string",
|
|
@@ -231,7 +231,7 @@ function registerMemTools(ctx, config) {
|
|
|
231
231
|
keywords: {
|
|
232
232
|
...KEYWORDS_ARRAY,
|
|
233
233
|
required: true,
|
|
234
|
-
description: "2-12 keywords (1-64 chars each); include 中英文同义词, e.g. [\"auth\", \"rate-limit\", \"登录\", \"限流\"]."
|
|
234
|
+
description: "2-12 keywords (1-64 chars each); task-related words NOT already present in title/summary (重复 title/summary 已有的词不会提高召回率); include 中英文同义词, e.g. [\"auth\", \"rate-limit\", \"登录\", \"限流\"]."
|
|
235
235
|
},
|
|
236
236
|
content: {
|
|
237
237
|
type: "string",
|
|
@@ -333,7 +333,7 @@ function registerMemTools(ctx, config) {
|
|
|
333
333
|
keywords: {
|
|
334
334
|
...KEYWORDS_ARRAY,
|
|
335
335
|
required: true,
|
|
336
|
-
description: "2-12 keywords (1-64 chars each); include 中英文同义词."
|
|
336
|
+
description: "2-12 keywords (1-64 chars each); task-related words NOT already present in title/summary; include 中英文同义词."
|
|
337
337
|
},
|
|
338
338
|
content: {
|
|
339
339
|
type: "string",
|
|
@@ -386,6 +386,7 @@ function registerPromptSection(ctx) {
|
|
|
386
386
|
"- BEFORE WORK — search: 仓库相关任务开始前提取 1–12 个中英文关键词调用 mem_search(含中英文同义词);纯闲聊和通用问答无需搜索。",
|
|
387
387
|
"- RESULT PRESELECT — 根据 title、summary、keywords、score 和 matched keywords 选择最多 5 条执行 mem_read,复用相关结论;无相关结果时用返回的 snapshot + skip 翻页。",
|
|
388
388
|
"- END-OF-SESSION CHECKPOINT — the ONLY write path: 会话结束时回顾全程,仅当结论有价值、可复用或用户明确要求记住时 mem_write;纯问答、未完成任务、非仓库工作、纯操作类 git 动作(仅 commit/push)不写;避免语义重复。",
|
|
389
|
+
"- KEYWORD SELECTION — mem_write/mem_replace 的 keywords 应选择与任务相关但未出现在 title/summary 中的词(中英文同义词皆可);title/summary 里已有的词本身就能被检索到,重复它们不会提高召回率。",
|
|
389
390
|
"- USER CORRECTION — 用户更正已有结论:有替代结论时调用 mem_replace(不得先 delete 再 write);结论作废且无替代时调用带 reason 的 mem_delete。",
|
|
390
391
|
"- SUBAGENT RESULTS — 子代理结果由根 Agent 汇总后决定是否形成一条会话级记忆。"
|
|
391
392
|
].join("\n")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonlan/dsh-gitmemo",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Git-backed long-term memory for DeepSeek Harness: a local .mem git repo (single main branch, immutable entries, structured commit messages) with mem_search / mem_read / mem_write / mem_delete / mem_replace tools and fully automatic legacy migration (no CLI needed; the CLI remains for explicit control), auto-managed by the root agent with zero manual steps.",
|
|
5
5
|
"author": "fonlan",
|
|
6
6
|
"publishConfig": {
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"release:major": "npm version major && git push && git push --tags"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@deepseek-ai/dsh-tools": "^0.1.
|
|
53
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
52
|
+
"@deepseek-ai/dsh-tools": "^0.1.2-alpha.2",
|
|
53
|
+
"@deepseek-ai/schemastery": "^3.18.2",
|
|
54
54
|
"@types/node": "^26.2.0",
|
|
55
55
|
"typescript": "^5.5.0"
|
|
56
56
|
},
|