@kira905/dsh-memory-toolkit 0.1.2 → 0.1.3
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 +38 -1
- package/README.md +28 -0
- package/cordis.patch.yml +32 -0
- package/package.json +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,43 @@
|
|
|
3
3
|
本仓的版本按**语义化版本**:改结论/改契约升主版本,加能力升次版本,修错别字与文档订正不升。
|
|
4
4
|
英文摘要见每节末尾的 *English* 行。
|
|
5
5
|
|
|
6
|
+
## v0.1.3 — 2026-10-30
|
|
7
|
+
|
|
8
|
+
**主包补 bundle 声明 + 子路径导出面**(修「装完不生效」;无插件行为变化):
|
|
9
|
+
|
|
10
|
+
根因是**声明层错位**:`dsh-memory-local/` 的 bundle 声明写在私有子包自己的 `package.json` 里,主包没有 `dsh.bundle`
|
|
11
|
+
⇒ `dsh plugin add` 只打一行 `declares no dsh.bundle` 警告、profile 的 `dsh.profile.bundles` 不变,**装了等于没装**
|
|
12
|
+
(rc 仍是 0,所以用户会当成装好了)。本版把声明提到主包根,并给出宿主 loader(ESM `import()`)能解析的子路径。
|
|
13
|
+
|
|
14
|
+
- 新增仓根 `cordis.patch.yml`:`id: kira905-memory`(**不是** `memory` —— 那个 id 归官方 `dsh-memory`,撞 id 会静默顶掉或启动抛错)、
|
|
15
|
+
`name: '@kira905/dsh-memory-toolkit/dsh-memory-local'`;`config` 与子包那份逐键相同(含 `path`)。
|
|
16
|
+
- 主包 `package.json` 新增 `dsh.bundle.patch = ./cordis.patch.yml`。
|
|
17
|
+
- 主包 `package.json` 新增 `exports`:`./dsh-memory-local` → `./dsh-memory-local/lib/index.js`(**文件**,不是目录)、
|
|
18
|
+
`./package.json` → `./package.json`;**没有** `"."` 条目(主包 `lib/` 没有 `index.js`,包根导入本来就不通)。
|
|
19
|
+
- `files` 补上 `cordis.patch.yml`(否则 tarball 里没有它,装了照样不生效)。
|
|
20
|
+
|
|
21
|
+
**迁移四条("收窄包面"变更 —— 只升 patch 号,但请读一遍)**:
|
|
22
|
+
|
|
23
|
+
1. **从包根导入的写法会失败**(`import '@kira905/dsh-memory-toolkit'`)—— 旧版本来也不通(没有 `main` / `exports`),
|
|
24
|
+
本版给它一个**明确的** `ERR_PACKAGE_PATH_NOT_EXPORTED`,而不是 "Cannot find package …/index.js" 这种像"文件丢了"的报错。
|
|
25
|
+
没有可迁移的既有用法。
|
|
26
|
+
2. **子路径导入改走 `exports`**:`@kira905/dsh-memory-toolkit/dsh-memory-local` 从 0.1.2 的
|
|
27
|
+
`ERR_UNSUPPORTED_DIR_IMPORT`(ESM 不认目录)变成**可用**;反过来,深路径
|
|
28
|
+
`@kira905/dsh-memory-toolkit/dsh-memory-local/lib/index.js` 从 0.1.2 的"可达"变成 **`ERR_PACKAGE_PATH_NOT_EXPORTED`**。
|
|
29
|
+
踩到的把 specifier 换成映射后的 `…/dsh-memory-local`(**不要**反过来删 `exports` 图省事 —— 那会把 ESM 这条路重新掐死)。
|
|
30
|
+
3. **与官方 `dsh-memory` 二选一**:本包定位是**替代实现**(`dsh-memory-local` 是 `dsh-memory@0.1.0` 的 fork),两者抢同一个
|
|
31
|
+
"记忆"位置。装之前读 `<profile>/package.json` 的 `dsh.profile.bundles`,含 `dsh-memory` 就**别装**(反之亦然);
|
|
32
|
+
要换实现先把另一个摘掉,别让两份同时加载。
|
|
33
|
+
4. **旧版仍在 npm、可回退**:`0.1.2` 及以前都在,`npm i @kira905/dsh-memory-toolkit@0.1.2` 可回退;回退后深路径恢复可达,
|
|
34
|
+
同时"不挂载"的老行为也回来(不坏,但等于白装)。
|
|
35
|
+
|
|
36
|
+
*English: 0.1.3 declares the bundle at the package root (new `cordis.patch.yml`, `id: kira905-memory`) and adds an
|
|
37
|
+
`exports` map that points the `./dsh-memory-local` subpath at a real file, so `dsh plugin add` mounts the fork instead
|
|
38
|
+
of printing "declares no dsh.bundle". No plugin behaviour changed. This narrows the package surface: the deep
|
|
39
|
+
`…/dsh-memory-local/lib/index.js` path is no longer importable (use the mapped subpath), the package root still has no
|
|
40
|
+
entry point (now with an explicit `ERR_PACKAGE_PATH_NOT_EXPORTED`), and this package replaces — never coexists with —
|
|
41
|
+
the official `dsh-memory`. 0.1.2 stays on npm for rollback.*
|
|
42
|
+
|
|
6
43
|
## v0.1.2 — 2026-10-30
|
|
7
44
|
|
|
8
45
|
**内部标识残留清剿**(无 API / 行为契约变化):
|
|
@@ -17,7 +54,7 @@
|
|
|
17
54
|
**部署面补齐 + 用语刷净**(无 API / 行为契约变化):
|
|
18
55
|
|
|
19
56
|
- `dsh-memory-local/` 部署侧支持 `.modules.yaml` profiles(主包 0.2.0-rc.x 的文件布局),新增「全新安装」分支,备份目录改为按需创建。
|
|
20
|
-
-
|
|
57
|
+
- 内部用语刷净:构建机的设备标记改为中性写法(原来的构建机设备标记),文档标签示例由设备名改为通用词(`工作记录`);对应单测断言同步更新,`memory-engine` 184 项全绿。
|
|
21
58
|
- 本版起 `npm publish` 走 `next` 标签、稳定后再挂 `latest`。
|
|
22
59
|
|
|
23
60
|
*English: deploy side now supports `.modules.yaml` profiles (host 0.2.0-rc.x) with a fresh-install branch and lazy backup-dir creation; internal build-machine wording scrubbed (no API/behaviour change).*
|
package/README.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# dsh-memory-toolkit
|
|
2
2
|
|
|
3
|
+
> **本仓装完即用**(0.1.3 起):`dsh plugin --profile <profile> add @kira905/dsh-memory-toolkit` 一条命令,`dsh.bundle` 会让它自动挂进 profile 的组合列表,**不需要再手工写 `cordis.patch.yml`**。包内 3 个 CLI(`dsh-memory-audit` / `dsh-memory-summary` / `dsh-memory-export`)与挂载无关,`npm i -g` 或 `npx` 直接用。
|
|
4
|
+
|
|
5
|
+
## 装完自检(三条只读验法)
|
|
6
|
+
|
|
7
|
+
`<profile>` 换成你实际用的 profile(默认 `web`),`<数据根>` 换成你的 DSH 数据根(默认 `~/.dsh`)。
|
|
8
|
+
|
|
9
|
+
```powershell
|
|
10
|
+
# ① 组合树里有没有它(只读、约 0.6 秒、不启服务)
|
|
11
|
+
dsh --profile <profile> --dump-config | Select-String "dsh-memory-toolkit"
|
|
12
|
+
# 期望:bundle 层出现一行 "# == <登记名>"、insert 层出现 "- id: <entry>"(问的都是「它挂上没」);
|
|
13
|
+
# 本仓包名 @kira905/dsh-memory-toolkit —— 带 scope 装的写带 scope 名、老工装 / 手写的可能是裸名,两种都搜一遍
|
|
14
|
+
# ⚠️ 若该包会 insert 一行,还要数一遍"同一个 id 出现了几次",必须 == 1
|
|
15
|
+
|
|
16
|
+
# ② 组合列表里有没有它(只读)
|
|
17
|
+
Get-Content <数据根>/profiles/<profile>/package.json | Select-String "@kira905/dsh-memory-toolkit"
|
|
18
|
+
# 期望:dependencies 与 dsh.profile.bundles 两处都有(CLI 类只需要 dependencies;bundles 里也可能写裸名 dsh-memory-toolkit)
|
|
19
|
+
|
|
20
|
+
# ③ 命令在不在 —— 【只查存在,不执行】
|
|
21
|
+
Test-Path <数据根>/profiles/<profile>/node_modules/.bin/dsh-memory-summary.CMD # 装进 profile 的
|
|
22
|
+
Test-Path "$env:APPDATA\npm\dsh-memory-summary.CMD" # npm i -g 装的
|
|
23
|
+
# 期望:True。两条路径按你实际用的装法挑一条
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> 探针只做存在性检查(只看命令文件在不在,不执行任何命令)。
|
|
27
|
+
> 要不要用 `--help` 验,见本仓当前说明与该命令的参数表。
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
3
31
|
**DSH(DeepSeek Harness)生态的记忆面工具集** —— 一个独立向量记忆引擎、一套记忆库只读体检工具链、
|
|
4
32
|
一个自持 fork 的本地记忆插件,以及一个 persona ↔ 记忆体检小工具。
|
|
5
33
|
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Package-root bundle patch for @kira905/dsh-memory-toolkit.
|
|
2
|
+
#
|
|
3
|
+
# Why this file exists at the package root (0.1.3): the fork's own patch lives
|
|
4
|
+
# inside the private sub-package `dsh-memory-local/`, so `dsh plugin add`
|
|
5
|
+
# reported "declares no dsh.bundle" and mounted nothing. The declaration now
|
|
6
|
+
# sits next to `dsh.bundle.patch` in the root package.json.
|
|
7
|
+
#
|
|
8
|
+
# `id` is deliberately NOT `memory`: that id belongs to the official
|
|
9
|
+
# `dsh-memory` bundle. Two entries carrying the same id either override each
|
|
10
|
+
# other silently (loader 1.0.x) or abort boot (older loaders), and
|
|
11
|
+
# `--dump-config` prints both rows with rc=0 either way. One memory slot, one
|
|
12
|
+
# implementation: install this package OR `dsh-memory`, never both.
|
|
13
|
+
#
|
|
14
|
+
# `config` is a deliberate full copy of `dsh-memory-local/cordis.patch.yml`
|
|
15
|
+
# (a patch replaces the targeted row's whole config, so a row cannot inherit
|
|
16
|
+
# keys from another file). `path` intentionally has no code-side default: a
|
|
17
|
+
# durable store of user facts must not land in whatever directory the harness
|
|
18
|
+
# happened to start in. The deployment value lives here, beside the row,
|
|
19
|
+
# resolved through the loader's `dshHomePath` so every profile on this machine
|
|
20
|
+
# shares one memory file.
|
|
21
|
+
|
|
22
|
+
- insert:
|
|
23
|
+
- id: kira905-memory
|
|
24
|
+
name: '@kira905/dsh-memory-toolkit/dsh-memory-local'
|
|
25
|
+
config:
|
|
26
|
+
path: !!js dshHomePath('memory/memory.db')
|
|
27
|
+
promptRecentCount: 10
|
|
28
|
+
promptMaxChars: 2000
|
|
29
|
+
maxTextChars: 2000
|
|
30
|
+
searchLimitDefault: 10
|
|
31
|
+
searchLimitMax: 50
|
|
32
|
+
promptOrder: 50
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kira905/dsh-memory-toolkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -30,12 +30,22 @@
|
|
|
30
30
|
"engines": {
|
|
31
31
|
"node": ">=22"
|
|
32
32
|
},
|
|
33
|
+
"exports": {
|
|
34
|
+
"./dsh-memory-local": "./dsh-memory-local/lib/index.js",
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
"dsh": {
|
|
38
|
+
"bundle": {
|
|
39
|
+
"patch": "./cordis.patch.yml"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
33
42
|
"bin": {
|
|
34
43
|
"dsh-memory-audit": "./persona-memory-audit.mjs",
|
|
35
44
|
"dsh-memory-summary": "./memory-db-tools/list-memory-summary.mjs",
|
|
36
45
|
"dsh-memory-export": "./memory-db-tools/audit-export.mjs"
|
|
37
46
|
},
|
|
38
47
|
"files": [
|
|
48
|
+
"cordis.patch.yml",
|
|
39
49
|
"memory-engine/",
|
|
40
50
|
"memory-db-tools/",
|
|
41
51
|
"dsh-memory-local/",
|