@fonlan/dsh-gitmemo 0.1.1 → 0.1.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 +1 -1
- package/README.zh.md +1 -1
- package/lib/index.js +6 -6
- package/lib/mem.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,7 +26,7 @@ work. Git is the only dependency, and no manual memory commands are ever needed.
|
|
|
26
26
|
| `mem_init` | Initialize the `.mem` repository (all other tools auto-initialize) |
|
|
27
27
|
| `mem_search` | Search memories: `keywords` (comma-separated), `skip` (pagination), `mode` (`and` / `or` / `auto` — AND first, OR fallback). Returns up to 20 hits as `hash\|title\|date` |
|
|
28
28
|
| `mem_read` | Read one memory entry by commit hash (full markdown) |
|
|
29
|
-
| `mem_write` | Store a task outcome: `title` + `content` (or `content_file` / `file`), optional `body`
|
|
29
|
+
| `mem_write` | Store a task outcome: `title` + `content` (or `content_file` / `file`), optional inline `body` (commit body; engine API still supports `body_file`). Commits `.mem/entries/<timestamp>-<slug>.md` and aligns the `.mem` branch |
|
|
30
30
|
| `mem_delete` | Delete a memory entry by commit hash (then redo and rewrite) |
|
|
31
31
|
| Always-on rules section | The complete workflow rules (gitmemo's `agents-template.md` equivalent) are injected into **every** session's system prompt — no skill load needed |
|
|
32
32
|
| Session-start injection | On every new **root** agent session, the N most recent memory titles (`hash\|title\|date`) are automatically injected into that session's system prompt, so prior-session context is visible before any tool call; subagents are skipped and the lookup never creates `.mem` |
|
package/README.zh.md
CHANGED
|
@@ -26,7 +26,7 @@ markdown 条目存入项目根目录的本地 **`.mem`** Git 仓库,并在开
|
|
|
26
26
|
| `mem_init` | 初始化 `.mem` 仓库(其余工具都会自动初始化) |
|
|
27
27
|
| `mem_search` | 搜索记忆:`keywords`(逗号分隔)、`skip`(分页)、`mode`(`and` / `or` / `auto`,auto 先 AND 后 OR 兜底)。每次最多返回 20 条 `hash\|title\|date` |
|
|
28
28
|
| `mem_read` | 按提交哈希读取一条记忆的完整 markdown |
|
|
29
|
-
| `mem_write` | 存储任务结论:`title` + `content`(或 `content_file` / `file
|
|
29
|
+
| `mem_write` | 存储任务结论:`title` + `content`(或 `content_file` / `file`),可选内联 `body`(commit body;引擎 API 仍支持 `body_file`)。提交为 `.mem/entries/<时间戳>-<slug>.md` 并对齐 `.mem` 分支 |
|
|
30
30
|
| `mem_delete` | 按提交哈希删除记忆条目(然后重做并重写) |
|
|
31
31
|
| 常驻规则片段 | 完整工作流规则(相当于 gitmemo 的 `agents-template.md`)注入**每个**会话的系统提示词——无需加载技能即可生效 |
|
|
32
32
|
| 会话开始注入 | 每个新**根** Agent 会话开始时,自动把最近 N 条记忆标题(`hash\|title\|date`)注入该系统提示词,跨会话上下文在调用任何工具前即可见;子代理被跳过,且该查询只读、绝不创建 `.mem` |
|
package/lib/index.js
CHANGED
|
@@ -187,11 +187,7 @@ function registerMemTools(ctx, config) {
|
|
|
187
187
|
},
|
|
188
188
|
body: {
|
|
189
189
|
type: "string",
|
|
190
|
-
description: "Optional commit body: 1-3 sentence summary + metadata. Not memory content."
|
|
191
|
-
},
|
|
192
|
-
body_file: {
|
|
193
|
-
type: "string",
|
|
194
|
-
description: "Path to a file holding the commit body (alternative to body)."
|
|
190
|
+
description: "Optional commit body: 1-3 sentence summary + metadata, passed inline. Not memory content."
|
|
195
191
|
}
|
|
196
192
|
},
|
|
197
193
|
output: {
|
|
@@ -206,7 +202,11 @@ function registerMemTools(ctx, config) {
|
|
|
206
202
|
render: (_args, value) => textBlock("OK: " + value.hash + "|" + value.file)
|
|
207
203
|
},
|
|
208
204
|
isConcurrencySafe: () => false,
|
|
209
|
-
async execute(
|
|
205
|
+
async execute(
|
|
206
|
+
// body_file is not model-facing anymore (removed from parameters above);
|
|
207
|
+
// it is still accepted here so legacy logged calls / direct dispatches map
|
|
208
|
+
// without breaking, and the engine still guards body vs body_file.
|
|
209
|
+
args, exec) {
|
|
210
210
|
const memo = engineFor(exec, config);
|
|
211
211
|
return await memo.write({
|
|
212
212
|
title: args.title,
|
package/lib/mem.js
CHANGED
|
@@ -430,7 +430,7 @@ export class GitMemo {
|
|
|
430
430
|
throw new Error("gitmemo: write requires --title");
|
|
431
431
|
}
|
|
432
432
|
if (body !== undefined && bodyFile !== undefined)
|
|
433
|
-
throw new Error("gitmemo: use only one of body or
|
|
433
|
+
throw new Error("gitmemo: use only one of body or body_file — pass the commit body inline via body and omit body_file");
|
|
434
434
|
if (content !== undefined && contentFile !== undefined)
|
|
435
435
|
throw new Error("gitmemo: use only one of content or contentFile");
|
|
436
436
|
// Resolve optional payload paths against the engine root when relative.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonlan/dsh-gitmemo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Git-backed long-term memory for DeepSeek Harness: a local .mem git repo with mem_search / mem_read / mem_write / mem_delete tools, auto-managed by the agent with zero manual steps.",
|
|
5
5
|
"author": "fonlan",
|
|
6
6
|
"publishConfig": {
|