dsh-plugin-memory 0.19.4 → 0.19.5

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/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  所有记录跟随 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 风格;版本号与 `package.json` 保持一致。
4
4
 
5
+ ## [0.19.5] - 2026-11-12
6
+
7
+ ### Fixed
8
+
9
+ - **page-access 记账健壮性**:`agent/inbox/inserted` 监听器整体 try/catch(写盘/渲染异常只 warn,不污染宿主事件分发);`stamped` 集合在 agent 销毁时删除,长期多会话不再累积会话 id。
10
+
11
+ ### Changed
12
+
13
+ - 商店条目更新到 0.19.x(README 与市场描述同步 rc.2 兼容要求:rc.2 用户必须 ≥0.19.2)。
14
+
5
15
  ## [0.19.4] - 2026-11-12
6
16
 
7
17
  ### Fixed
@@ -26,8 +26,8 @@
26
26
  },
27
27
  "versions": [
28
28
  {
29
- "version": "0.19.3",
30
- "publishTimestamp": 1794411755,
29
+ "version": "0.19.4",
30
+ "publishTimestamp": 1794412124,
31
31
  "source": {
32
32
  "type": "npm"
33
33
  },
package/lib/index.js CHANGED
@@ -586,26 +586,36 @@ export function apply(ctx, config = {}) {
586
586
  if (!isRootAgent(agent)) return
587
587
  agent.ctx.effect(() => {
588
588
  const stopInserted = ctx.on('agent/inbox/inserted', ({ agent: target, message }) => {
589
- if (target?.id !== agent.id) return
590
- if (message?.source?.kind !== 'user') return
591
- if (stamped.has(agent.id)) return
592
- const resolved = store.get()
593
- if (!sessionEnabled(agent, resolved)) return
594
- if (!tracker.shouldInject(agent.id, resolved)) return
595
- stamped.add(agent.id)
589
+ // Never let bookkeeping throw inside the host's event dispatch.
596
590
  try {
597
- const memoryDir = currentMemoryDir
598
- const block = renderBootBlock(memoryDir, { bootFiles, bootMaxChars, bootFileBudgets })
599
- const referenced = extractReferencedPages(block, memoryDir)
600
- const touched = touchPages(memoryDir, [...bootFiles, ...referenced])
601
- if (touched.length > 0) {
602
- ctx.logger?.info?.(`memory: last_access stamped on ${touched.length} page(s)`)
591
+ if (target?.id !== agent.id) return
592
+ if (message?.source?.kind !== 'user') return
593
+ if (stamped.has(agent.id)) return
594
+ const resolved = store.get()
595
+ if (!sessionEnabled(agent, resolved)) return
596
+ if (!tracker.shouldInject(agent.id, resolved)) return
597
+ stamped.add(agent.id)
598
+ try {
599
+ const memoryDir = currentMemoryDir
600
+ const block = renderBootBlock(memoryDir, { bootFiles, bootMaxChars, bootFileBudgets })
601
+ const referenced = extractReferencedPages(block, memoryDir)
602
+ const touched = touchPages(memoryDir, [...bootFiles, ...referenced])
603
+ if (touched.length > 0) {
604
+ ctx.logger?.info?.(`memory: last_access stamped on ${touched.length} page(s)`)
605
+ }
606
+ } catch (error) {
607
+ ctx.logger?.warn?.(`memory: last_access stamp failed: ${error instanceof Error ? error.message : String(error)}`)
603
608
  }
604
609
  } catch (error) {
605
- ctx.logger?.warn?.(`memory: last_access stamp failed: ${error instanceof Error ? error.message : String(error)}`)
610
+ ctx.logger?.warn?.(`memory: page-access listener failed: ${error instanceof Error ? error.message : String(error)}`)
606
611
  }
607
612
  })
608
- return () => stopInserted?.()
613
+ return () => {
614
+ // The session id is unique, so forgetting it on teardown only
615
+ // releases memory; it can never cause a re-stamp of a live session.
616
+ stamped.delete(agent.id)
617
+ stopInserted?.()
618
+ }
609
619
  })
610
620
 
611
621
  } catch (error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-plugin-memory",
3
3
  "description": "Long-term memory plugin for DeepSeek Harness: persistent cross-session markdown memory with a soul/persona file, auto-injected at every session start, plus remember/recall/consolidate/forget workflows and portable migration tooling.",
4
- "version": "0.19.4",
4
+ "version": "0.19.5",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",