memory-eternal 0.26.0 → 0.27.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.
@@ -186,3 +186,20 @@ export function workingPrompt(sessionId, env = process.env) {
186
186
  w.text,
187
187
  ].join('\n')
188
188
  }
189
+
190
+ /**
191
+ * 闲置归档:超过 maxAgeMs 没动过的工作区移到 archive/。
192
+ *
193
+ * 为什么需要:DSH 没有必到的「会话结束」事件,只靠数量上限淘汰会让「正在用但很久没写」的
194
+ * 会话被误伤(虽然按 mtime 淘汰风险低)。按时间归档更符合直觉:一天没碰,就当它结束了。
195
+ */
196
+ export function archiveStaleWorking(env, maxAgeMs = 24 * 3600 * 1000, now = Date.now()) {
197
+ const archived = []
198
+ for (const item of listWorking(env)) {
199
+ const t = Date.parse(item.updatedAt)
200
+ if (!Number.isFinite(t) || now - t < maxAgeMs) continue
201
+ const r = archiveWorking(env, item.session)
202
+ if (r.ok && r.archived) archived.push(item.session)
203
+ }
204
+ return { ok: true, archived }
205
+ }
@@ -3,7 +3,7 @@
3
3
  "id": "memory-eternal",
4
4
  "publisher": "eternalnight996",
5
5
  "name": "memory-eternal",
6
- "version": "0.26.0",
6
+ "version": "0.27.0",
7
7
  "description": "Memory Atlas for Orca: open the local memory vault, pending review and knowledge graph from a sandboxed Orca panel.",
8
8
  "author": {
9
9
  "name": "EternalNight996",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memory-eternal",
3
- "version": "0.26.0",
3
+ "version": "0.27.0",
4
4
  "description": "记忆核心(Memory Eternal):自研的 DeepSeek Harness 记忆插件,不移植任何既有记忆框架——对话结束后自动沉淀知识卡到本地 Markdown Vault(自研去重、自研 CJK 检索、可 git 管理),设置页提供图形化知识库(统计 / 搜索 / 知识图谱 + 侧边栏一键弹窗),Agent 通过 memory_recall 工具按需召回历史上下文。零人工干预。",
5
5
  "icon": "assets/icon.png",
6
6
  "license": "MIT",