memory-eternal 0.8.0 → 0.9.0

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 CHANGED
@@ -379,46 +379,6 @@ export async function search(root, query, { limit = 30, minScore = 0, semantic =
379
379
  return out.slice(0, limit)
380
380
  }
381
381
 
382
- /** 当日简报。 */
383
- export function dailyBrief(cardsToday) {
384
- if (!cardsToday || cardsToday.length === 0) return '今天还没有新的记忆沉淀。'
385
- return cardsToday.map((c) => `- ${c.kind}|${c.title}`).join('\n')
386
- }
387
-
388
- /** 生成今日简报卡(INSERT into cards)。 */
389
- export async function generateDailyBrief(root) {
390
- const d = new Date()
391
- const date = `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`
392
- try {
393
- const db = getDb(root)
394
- // 幂等:检查是否已存在
395
- const existing = db.prepare("SELECT 1 FROM cards WHERE title = ? AND status = 'approved'").get(`每日回顾 ${date}`)
396
- if (existing) return { ok: true, existed: true }
397
-
398
- const s = await stats(root)
399
- const body = `今日新增 ${s.today} · 近 7 天 ${s.week} · 总 ${s.total}\n\n## 今日沉淀\n${dailyBrief(s.todayCards)}`
400
- const now = new Date().toISOString()
401
- db.prepare(`
402
- INSERT INTO cards (path, kind, title, tags, body, summary, status, source, created_at, updated_at)
403
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
404
- `).run(
405
- `00-System/daily-${date}.md`,
406
- 'prompt',
407
- `每日回顾 ${date}`,
408
- JSON.stringify(['每日回顾', '统计']),
409
- body,
410
- body.slice(0, 200),
411
- 'approved',
412
- 'daily-brief',
413
- now,
414
- now,
415
- )
416
- return { ok: true, existed: false }
417
- } catch (e) {
418
- return { ok: false, error: String(e.message || e) }
419
- }
420
- }
421
-
422
382
  /** 用量趋势:最近 N 天每天新增卡片数。 */
423
383
  export async function dailyCounts(root, days = 30) {
424
384
  const db = getDb(root)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memory-eternal",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "记忆核心(Memory Eternal):自研的 DeepSeek Harness 记忆插件,不移植任何既有记忆框架——对话结束后自动沉淀知识卡到本地 Markdown Vault(自研去重、自研 CJK 检索、可 git 管理),设置页提供图形化知识库(统计 / 搜索 / 知识图谱 + 侧边栏一键弹窗),Agent 通过 memory_recall 工具按需召回历史上下文。零人工干预。",
5
5
  "license": "MIT",
6
6
  "repository": {