@jacklika/dsh-memory-curator 0.1.0-alpha.6 → 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
@@ -172,8 +172,10 @@ export function apply(ctx, config) {
172
172
  const search = await callTool(ctx, exec, 'wiki_search', { query: args.query });
173
173
  // Mechanical per-turn summaries are useful for session replay, but they
174
174
  // are not curated knowledge. Keep them out of proactive recall unless a
175
- // caller explicitly searches the wiki.
176
- const curated = search.hits.filter(hit => !hit.id.startsWith('shared/notes/auto-capture/'));
175
+ // caller explicitly searches the wiki. The prefix covers both the legacy
176
+ // flat form `auto-capture-<session>.md` and the new isolated subdir
177
+ // `auto-capture/<session>.md`.
178
+ const curated = search.hits.filter(hit => !hit.id.startsWith('shared/notes/auto-capture'));
177
179
  // `search.total` is the vault-wide count before the search-layer cap. If
178
180
  // any auto-capture hits made it into the capped `hits` list, remove them
179
181
  // from the total so curated numbers stay truthful.
@@ -293,17 +295,25 @@ export function apply(ctx, config) {
293
295
  const content = appending
294
296
  ? appendContent
295
297
  : `---\n${yaml.dump(frontmatter).trim()}\n---\n\n# ${args.title}\n\n${appendContent}`;
296
- await callTool(ctx, exec, 'wiki_write', {
298
+ const writeResult = await callTool(ctx, exec, 'wiki_write', {
297
299
  id: finalId,
298
300
  content,
299
301
  mode: writeMode,
300
302
  });
301
- return {
303
+ const response = {
302
304
  written: true,
303
305
  id: finalId,
304
306
  mode: writeMode,
305
307
  conflict: conflictExists,
308
+ version: writeResult.version,
306
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;
307
317
  },
308
318
  })));
309
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.6",
4
+ "version": "0.1.0-alpha.8",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },