dsh-plugin-memory 0.9.0 → 0.9.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/CHANGELOG.md CHANGED
@@ -2,6 +2,40 @@
2
2
 
3
3
  所有记录跟随 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 风格;版本号与 `package.json` 保持一致。
4
4
 
5
+ ## [0.9.2] - 2026-10-08
6
+
7
+ ### Fixed(Windows 路径分隔符)
8
+
9
+ - **Windows 上 `lint` 不再把每个页面都报成 orphan**(贡献者 [@lukiriun-bit](https://github.com/lukiriun-bit),[PR #1](https://github.com/LittleBlackTong/dsh-plugin-memory/pull/1))。`pages()` 原样返回 `path.relative()` 的结果,在 Windows 上是 `user\a.md`,而 `index.md` 的链接写的是 `/`——于是**每个已被索引的页面**都被判成 `orphan page not in index.md`,健康的库也会让 `lint` 退出 1。现在统一规范成 POSIX 分隔符。
10
+ - **与既有约定对齐**:`lib/pages.js` 的 `listPagePaths()` 早就是 `relative(...).split(sep).join('/')`,文件头注释也写明 `store-relative paths using / separators`。这次是把 `scripts/memory.mjs` 这处**漏网的**补齐,写法与其逐字一致。
11
+ - **影响面逐个核对过**(改分隔符最怕破坏调用方):
12
+ | 调用点 | 判定 |
13
+ |---|---|
14
+ | `cmdLint` | ✅ 正是修复目标(与 `index.md` 链接比较) |
15
+ | `cmdQuery` | ✅ 比较对象 `matched` 来自 `lib/pages.js`,本来就是 `/` |
16
+ | `cmdTouch` | ✅ 由「全被判 orphan」变正确 |
17
+ | `cmdStatus` / `pack` | ✅ Node 的 fs 在 Windows 同样接受 `/` |
18
+
19
+ ### Tests
20
+
21
+ - 新增 `test/lint-index-separators.test.mjs`(贡献者提供):断言「被索引链接的页面不得被判 orphan」。
22
+ - ⚠️ **该测试在 POSIX 上没有区分度**(`sep` 就是 `/`,改前改后都通过)。它能锁定行为,但**无法在 macOS/Linux CI 上证明 Windows 端的修复**——这一点在合并评审时已说明。
23
+ - 全量 **174/174 通过**(基线 173/173,增量正是上面这个测试)。
24
+ - `npm test`(self-test:`init` / `pack` / `unpack`)通过。
25
+
26
+ ### Notes
27
+
28
+ - `scripts/memory.mjs` 的 `manifestFor()`(pack 用的文件清单)仍是原生 `relative()`,属**同类残留**;它同平台自洽,只有跨平台迁移(Windows pack → Linux unpack)才可能出问题,留待后续顺手统一。
29
+
30
+ ## [0.9.1] - 2026-09-29
31
+
32
+ ### Fixed(DSH 0.2.0 兼容)
33
+
34
+ - **声明支持 DSH 0.2.x 运行时**:`peerDependencies` 中 `@deepseek-ai/dsh-skill` 与 `@deepseek-ai/dsh-system-prompt` 的范围由 `^0.1.2-alpha.1` 扩为 **`^0.1.2-alpha.1 || ^0.2.0-rc.1`**。
35
+ - **症状**:DSH 运行时升级到 `0.2.0-rc.1` 后,插件被兼容性闸门判定为 incompatible,启动时**整个 bundle 被静默跳过**(`skipping profile bundle "dsh-plugin-memory"`),记忆注入与全部 remember/recall 工作流一起失效——插件不是报错降级,而是**根本没加载**。
36
+ - **原因**:DSH 的 `evaluatePluginCompatibility` **只按 `peerDependencies` 里的 `@deepseek-ai/dsh-*` 范围**与运行版本做 semver 匹配(`includePrerelease`),旧范围不含 `0.2.x`,于是被拒。
37
+ - **说明**:本插件实际使用的 `ctx.skills.register()`(`{name, description, content, source, resourceBase}`)与 `ctx.systemPrompt.context()` 在 0.2.0 中**签名未变**,属声明过时而非接口破裂;沿用旧范围可继续兼容 `0.1.x` 运行时。
38
+
5
39
  ## [0.9.0] - 2026-09-28
6
40
 
7
41
  ### Added
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.9.0",
4
+ "version": "0.9.2",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "main": "lib/index.js",
@@ -56,8 +56,8 @@
56
56
  ],
57
57
  "peerDependencies": {
58
58
  "@deepseek-ai/cordis": "^4.0.1",
59
- "@deepseek-ai/dsh-skill": "^0.1.2-alpha.1",
60
- "@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.1",
59
+ "@deepseek-ai/dsh-skill": "^0.1.2-alpha.1 || ^0.2.0-rc.1",
60
+ "@deepseek-ai/dsh-system-prompt": "^0.1.2-alpha.1 || ^0.2.0-rc.1",
61
61
  "@deepseek-ai/schemastery": "^3.18.1"
62
62
  },
63
63
  "repository": {
@@ -22,7 +22,7 @@ import {
22
22
  readdirSync, readFileSync, writeFileSync, existsSync, statSync,
23
23
  mkdirSync, cpSync, rmSync,
24
24
  } from 'node:fs'
25
- import { join, resolve, relative, basename } from 'node:path'
25
+ import { join, resolve, relative, basename, sep } from 'node:path'
26
26
  import { execFileSync } from 'node:child_process'
27
27
  import { tmpdir, homedir } from 'node:os'
28
28
  import { createHash } from 'node:crypto'
@@ -55,8 +55,10 @@ function walk(dir, out = []) {
55
55
  }
56
56
 
57
57
  function pages(store) {
58
+ // POSIX separators on every platform: index.md links are written with `/`,
59
+ // so a Windows `\` would make every page look like an orphan in `lint`.
58
60
  return walk(store).filter((f) => f.endsWith('.md'))
59
- .map((f) => relative(store, f))
61
+ .map((f) => relative(store, f).split(sep).join('/'))
60
62
  .filter((r) => !META.has(basename(r)))
61
63
  }
62
64