memory-eternal 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/lib/vault.js +2 -2
- package/package.json +1 -1
package/lib/vault.js
CHANGED
|
@@ -262,7 +262,7 @@ export async function mergeCards(root, paths) {
|
|
|
262
262
|
combined += (i ? '\n\n---\n\n' : '') + body.trim()
|
|
263
263
|
})
|
|
264
264
|
const title = (first.meta.title || '合并记忆') + '(合并)'
|
|
265
|
-
const r = await writeCard(root, { kind: first.meta.kind || 'knowledge', title, tags: [...tags], body: combined, source: 'merge', status: '
|
|
265
|
+
const r = await writeCard(root, { kind: first.meta.kind || 'knowledge', title, tags: [...tags], body: combined, source: 'merge', status: 'pending', submittedBy: 'merge', reason: '多卡合并' }, { dedup: false })
|
|
266
266
|
if (!r.ok) return { ok: false, error: '写入失败' }
|
|
267
267
|
for (const t of texts) { try { await deleteCard(root, t.path, { permanent: true }) } catch { /* 尽力删除 */ } }
|
|
268
268
|
return { ok: true, path: r.path, merged: texts.length }
|
|
@@ -364,7 +364,7 @@ export async function setCardStatus(root, rel, status) {
|
|
|
364
364
|
}
|
|
365
365
|
|
|
366
366
|
/** 原子写卡;先去重(target 目录内),命中返回 {duplicate}。 */
|
|
367
|
-
export async function writeCard(root, { kind, title, tags = [], body, source = '', status = '
|
|
367
|
+
export async function writeCard(root, { kind, title, tags = [], body, source = '', status = 'pending', submittedBy = '', severity = 'info', reason = '', deletedAt = '' }, { threshold = 0.62, dedup = true } = {}) {
|
|
368
368
|
const kindRoot = KIND_ROOTS[kind] || KIND_ROOTS.knowledge
|
|
369
369
|
const dir = path.join(root, kindRoot)
|
|
370
370
|
await fs.mkdir(dir, { recursive: true })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memory-eternal",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "记忆核心(Memory Eternal):自研的 DeepSeek Harness 记忆插件,不移植任何既有记忆框架——对话结束后自动沉淀知识卡到本地 Markdown Vault(自研去重、自研 CJK 检索、可 git 管理),设置页提供图形化知识库(统计 / 搜索 / 知识图谱 + 侧边栏一键弹窗),Agent 通过 memory_recall 工具按需召回历史上下文。零人工干预。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|