@jacklika/dsh-memory-curator 0.1.0-alpha.7 → 0.1.0-alpha.8

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 CHANGED
@@ -5,7 +5,7 @@ Curator tools for the DSH memory vault. This package is a member of the `@jackli
5
5
  ## Tools
6
6
 
7
7
  - `memory_recall(query)` — Search the vault for prior notes before starting a task. Returns `{ query, hits, total }`, where `total` is the vault-wide match count passed through from `wiki_search` and can exceed `hits.length` when the search layer caps its results — so a caller can tell "these are all the matches" from "there are more".
8
- - `memory_capture(title, summary, ...)` — Persist durable knowledge after significant work, with conflict detection and optional user approval.
8
+ - `memory_capture(title, summary, ...)` — Persist durable knowledge after significant work, with conflict detection and optional user approval. Returns `{ written, id, mode, conflict, version, created?, updated?, committed? }`: `version` is the SHA-1 of the persisted note text, `created` is present on first capture, `updated` is present on appends, and `committed` is present when `memory-git` completed the commit.
9
9
 
10
10
  ## Note ids
11
11
 
package/README.zh.md CHANGED
@@ -5,7 +5,7 @@ DSH 记忆库的策展工具。本包是 `@jacklika/dsh-memory` Bundle 的成员
5
5
  ## 工具
6
6
 
7
7
  - `memory_recall(query)` — 在任务开始前搜索知识库中的相关笔记。返回 `{ query, hits, total }`,其中 `total` 是从 `wiki_search` 透传的全库命中数,在搜索层截断结果时可能大于 `hits.length`——调用方因此能区分“这就是全部命中”与“还有更多”。
8
- - `memory_capture(title, summary, ...)` — 在有意义的任务结束后持久化知识,支持冲突检测与可选的用户审批。
8
+ - `memory_capture(title, summary, ...)` — 在有意义的任务结束后持久化知识,支持冲突检测与可选的用户审批。返回 `{ written, id, mode, conflict, version, created?, updated?, committed? }`:`version` 是持久化笔记文本的 SHA-1 指纹;首次入库返回 `created`;追加写入返回 `updated`;挂载 `memory-git` 完成提交时还会返回 `committed`。
9
9
 
10
10
  ## 笔记 id
11
11
 
package/lib/index.js CHANGED
@@ -295,17 +295,25 @@ export function apply(ctx, config) {
295
295
  const content = appending
296
296
  ? appendContent
297
297
  : `---\n${yaml.dump(frontmatter).trim()}\n---\n\n# ${args.title}\n\n${appendContent}`;
298
- await callTool(ctx, exec, 'wiki_write', {
298
+ const writeResult = await callTool(ctx, exec, 'wiki_write', {
299
299
  id: finalId,
300
300
  content,
301
301
  mode: writeMode,
302
302
  });
303
- return {
303
+ const response = {
304
304
  written: true,
305
305
  id: finalId,
306
306
  mode: writeMode,
307
307
  conflict: conflictExists,
308
+ version: writeResult.version,
308
309
  };
310
+ if (typeof writeResult.created === 'string' && writeResult.created !== '')
311
+ response.created = writeResult.created;
312
+ if (typeof writeResult.updated === 'string' && writeResult.updated !== '')
313
+ response.updated = writeResult.updated;
314
+ if (typeof writeResult.committed === 'boolean')
315
+ response.committed = writeResult.committed;
316
+ return response;
309
317
  },
310
318
  })));
311
319
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jacklika/dsh-memory-curator",
3
3
  "description": "Curator tools for the DSH memory vault: memory_recall before acting and memory_capture after significant work, with conflict detection and optional user approval.",
4
- "version": "0.1.0-alpha.7",
4
+ "version": "0.1.0-alpha.8",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },