dsh-plugin-memory 0.18.3 → 0.19.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/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  所有记录跟随 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 风格;版本号与 `package.json` 保持一致。
4
4
 
5
+ ## [0.19.0] - 2026-11-11
6
+
7
+ ### Changed
8
+
9
+ - **兼容 DSH 0.2.2-rc.2**:`engines.dsh` 扩为 `^0.2.1-rc.5 || ^0.2.2-rc.2`,`@deepseek-ai/dsh-skill` / `dsh-system-prompt` 的 peer 范围同步覆盖 `^0.2.2-rc.2`——使用默认 semver 语义的工具/界面不再把插件误判成"不兼容 rc.2"(DSH 自身闸门本来就带 `includePrerelease`)。
10
+ - 设置分区(`settings.section`)注册加容错:宿主 slot 契约变化时,面板入口不显示,但 boot 注入、memory 技能、HTTP 路由、CLI 不受影响。
11
+
12
+ ### Fixed
13
+
14
+ - 按 0.2.2-rc.2 的客户端变更做了防御:侧栏导航服务继续用 `ctx.reflect.get` 懒解析、chip 下拉自绘定位、设置导航图标按文本认领,不依赖 rc.2 调整过的浮层定位与导航内部接口。
15
+
16
+ ## [0.18.4] - 2026-11-10
17
+
18
+ ### Fixed
19
+
20
+ - **双击打开报 `no registered tab type claims "dsh-resource://file/absolute/..."`**:host 在无 session id 时兜底选中的会话可能属于另一个项目(cwd 不含记忆库),客户端因此退回 `absolute` 地址;而侧栏只认 `session/<id>/<相对路径>` 地址。现在 host 兜底优先选「cwd 包含记忆库目录」的会话;文件确实在工作区外时客户端直接给出「不在当前工作区、已用系统文件管理器打开」的说明,不再尝试注定失败的 absolute 地址。
21
+
5
22
  ## [0.18.3] - 2026-11-10
6
23
 
7
24
  ### Fixed
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  > Long-term memory for DeepSeek Harness — a portable markdown memory store with a soul, injected at every session start.
14
14
 
15
- **macOS · Windows · Linux** · Node ≥ 18 · DSH `^0.2.1-rc.5` · MIT
15
+ **macOS · Windows · Linux** · Node ≥ 18 · DSH `^0.2.1-rc.5` / `0.2.2-rc.2` · MIT
16
16
 
17
17
  ## What it does
18
18
 
package/README.zh.md CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  > 给 DeepSeek Harness 的长期记忆 —— 一个可迁移的 markdown 记忆库,还带一份灵魂,每次会话启动自动注入。
14
14
 
15
- **macOS · Windows · Linux** 全平台支持 · Node ≥ 18 · DSH `^0.2.1-rc.5` · MIT
15
+ **macOS · Windows · Linux** 全平台支持 · Node ≥ 18 · DSH `^0.2.1-rc.5` / `0.2.2-rc.2` · MIT
16
16
 
17
17
  ## 它是干什么的
18
18
 
@@ -71,7 +71,7 @@ When every file fits inside its equal share this is byte-for-byte the old even-s
71
71
 
72
72
  ## Compatibility
73
73
 
74
- `package.json` declares `engines.dsh: "^0.2.1-rc.5"` and the host enforces it with `semver.satisfies(..., { includePrerelease: true })` — `^0.2.1` or `>=0.2.0` do **not** match the prerelease. The `locale` service (0.11+) and session projections (0.12+) are load-bearing. On older hosts the gate refuses the plugin instead of running it half-broken; at runtime a missing projection degrades gracefully.
74
+ `package.json` declares `engines.dsh: "^0.2.1-rc.5 || ^0.2.2-rc.2"` and the host enforces it with `semver.satisfies(..., { includePrerelease: true })` — `^0.2.1` or `>=0.2.0` do **not** match the prerelease. The `locale` service (0.11+) and session projections (0.12+) are load-bearing. On older hosts the gate refuses the plugin instead of running it half-broken; at runtime a missing projection degrades gracefully.
75
75
 
76
76
  ## Language
77
77
 
@@ -26,8 +26,8 @@
26
26
  },
27
27
  "versions": [
28
28
  {
29
- "version": "0.18.2",
30
- "publishTimestamp": 1794276764,
29
+ "version": "0.18.4",
30
+ "publishTimestamp": 1794277785,
31
31
  "source": {
32
32
  "type": "npm"
33
33
  },
package/lib/client.js CHANGED
@@ -178,6 +178,7 @@ window.__ModuleLoader__.load({
178
178
  graphCopyFailed: '复制路径失败',
179
179
  graphRevealFallback: '打开失败,已复制路径;在 Finder 里按 ⌘⇧G 粘贴路径即可跳转',
180
180
  graphSidebarFailed: '侧栏打开失败:',
181
+ graphSidebarOutside: '该文件不在当前会话的工作区内,侧栏无法预览;已用系统文件管理器打开',
181
182
  graphStats: '{pages} 页 · {links} 条页间互链 · {tagEdges} 条共享 tag',
182
183
  graphIndexRoutes: '{count} 条索引路由(虚线)',
183
184
  graphIsolated: '{count} 页暂时孤立',
@@ -336,6 +337,7 @@ window.__ModuleLoader__.load({
336
337
  graphCopyFailed: 'Could not copy the path',
337
338
  graphRevealFallback: 'Reveal failed; the path was copied — paste it in your file manager to jump there',
338
339
  graphSidebarFailed: 'Sidebar open failed: ',
340
+ graphSidebarOutside: 'This file is outside the current session workspace, so the sidebar cannot preview it; opened it in the OS file manager instead',
339
341
  graphStats: '{pages} pages · {links} page links · {tagEdges} shared tags',
340
342
  graphIndexRoutes: '{count} index routes (dashed)',
341
343
  graphIsolated: '{count} pages isolated',
@@ -2065,13 +2067,13 @@ window.__ModuleLoader__.load({
2065
2067
  const encodePath = (path) => path.split('/')
2066
2068
  .map((segment, index) => (index === 0 && /^[A-Za-z]:$/.test(segment) ? segment : encodeURIComponent(segment)))
2067
2069
  .join('/')
2068
- let address
2069
- if (root !== undefined && (absolute === root || absolute.startsWith(`${root}/`))) {
2070
- const relative = absolute.slice(root.length).replace(/^\/+/, '')
2071
- address = `dsh-resource://file/session/${encodeURIComponent(session.sessionId)}/${encodePath(relative)}`
2072
- } else {
2073
- address = `dsh-resource://file/absolute/${encodePath(absolute.replace(/^\/+/, ''))}`
2070
+ // The sidebar only opens `session/<id>/<relative>` addresses; an
2071
+ // absolute address has no authorized session and cannot be claimed.
2072
+ if (root === undefined || (absolute !== root && !absolute.startsWith(`${root}/`))) {
2073
+ return { ok: false, reason: 'outside-workspace' }
2074
2074
  }
2075
+ const relative = absolute.slice(root.length).replace(/^\/+/, '')
2076
+ const address = `dsh-resource://file/session/${encodeURIComponent(session.sessionId)}/${encodePath(relative)}`
2075
2077
  try {
2076
2078
  await sidebar.openResource(address)
2077
2079
  } catch (error) {
@@ -2080,11 +2082,14 @@ window.__ModuleLoader__.load({
2080
2082
  return { ok: true }
2081
2083
  }
2082
2084
  const openNode = (id) => {
2085
+ const message = (result) => result.reason === 'outside-workspace'
2086
+ ? t('graphSidebarOutside')
2087
+ : `${t('graphSidebarFailed')}${result.reason}`
2083
2088
  openInSidebar(id)
2084
2089
  .then((result) => {
2085
2090
  if (result.ok === true) return
2086
- setNotice(`${t('graphSidebarFailed')}${result.reason}`)
2087
- revealNode(id, `${t('graphSidebarFailed')}${result.reason}`)
2091
+ setNotice(message(result))
2092
+ revealNode(id, message(result))
2088
2093
  })
2089
2094
  .catch((error) => {
2090
2095
  const reason = error instanceof Error ? error.message : String(error)
@@ -2588,13 +2593,19 @@ window.__ModuleLoader__.load({
2588
2593
  }
2589
2594
  return sectionLabel(active)
2590
2595
  }
2591
- ctx.slots.inject('settings.section', () => ctx.slots.register({
2592
- name: 'settings.section',
2593
- id: 'memory',
2594
- order: 100,
2595
- locale: LOCALE_NS,
2596
- label: labelOf,
2597
- }, MemorySection))
2596
+ // The panel entry is the only slot we own; if a future host changes the
2597
+ // slot contract, keep the rest of the plugin (boot, skill, routes) alive.
2598
+ try {
2599
+ ctx.slots.inject('settings.section', () => ctx.slots.register({
2600
+ name: 'settings.section',
2601
+ id: 'memory',
2602
+ order: 100,
2603
+ locale: LOCALE_NS,
2604
+ label: labelOf,
2605
+ }, MemorySection))
2606
+ } catch {
2607
+ // no settings panel entry on this host
2608
+ }
2598
2609
  // 会话内开关(composer 工具行左侧 chip)。旧宿主可能不声明该 slot:
2599
2610
  // 注册失败只影响 chip,/memory 命令与设置面板入口仍然可用。
2600
2611
  try {
package/lib/index.js CHANGED
@@ -785,11 +785,22 @@ export function apply(ctx, config = {}) {
785
785
  || agent.session?.header?.id === id
786
786
  || agent.session?.id === id)
787
787
  }
788
- // 0.18.3: the Settings panel has no session id, and the tracker only
789
- // knows sessions that have spoken. Fall back to a mounted session
790
- // (preferring one with a workspace) so graph/sidebar actions can
791
- // still resolve a workspace while the user is in Settings.
792
- return roots.find((agent) => typeof agent.session?.header?.cwd === 'string' && agent.session.header.cwd.length > 0)
788
+ // 0.18.3/0.18.4: the Settings panel has no session id, and the
789
+ // tracker only knows sessions that have spoken. Fall back to a
790
+ // mounted session, preferring one whose workspace contains the
791
+ // memory store: the sidebar only opens `session/<id>/<relative>`
792
+ // addresses, so a session from another project cannot preview it.
793
+ const normalize = (value) => typeof value === 'string'
794
+ ? value.replace(/\\/g, '/').replace(/\/+$/, '')
795
+ : ''
796
+ const memoryRoot = normalize(currentMemoryDir)
797
+ const cwdOf = (agent) => normalize(agent.session?.header?.cwd)
798
+ const insideStore = (agent) => {
799
+ const dir = cwdOf(agent)
800
+ return dir.length > 0 && (memoryRoot === dir || memoryRoot.startsWith(`${dir}/`))
801
+ }
802
+ return roots.find(insideStore)
803
+ ?? roots.find((agent) => cwdOf(agent).length > 0)
793
804
  ?? roots[0]
794
805
  }
795
806
  const sendJson = (status, payload) => {
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.18.3",
4
+ "version": "0.19.0",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "engines": {
45
45
  "node": ">=18",
46
- "dsh": "^0.2.1-rc.5"
46
+ "dsh": "^0.2.1-rc.5 || ^0.2.2-rc.2"
47
47
  },
48
48
  "keywords": [
49
49
  "deepseek-harness",
@@ -58,8 +58,8 @@
58
58
  ],
59
59
  "peerDependencies": {
60
60
  "@deepseek-ai/cordis": "^4.0.1",
61
- "@deepseek-ai/dsh-skill": "^0.1.2-alpha.1 || ^0.2.0-rc.1",
62
- "@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.1 || ^0.2.0-rc.1",
61
+ "@deepseek-ai/dsh-skill": "^0.1.2-alpha.1 || ^0.2.0-rc.1 || ^0.2.2-rc.2",
62
+ "@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.1 || ^0.2.0-rc.1 || ^0.2.2-rc.2",
63
63
  "@deepseek-ai/schemastery": "^3.18.1"
64
64
  },
65
65
  "repository": {