dsh-engram 0.5.1 → 0.6.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/README.md +118 -39
- package/README.zh.md +101 -40
- package/docs/CONTEXT-GC-GUIDE.zh.md +15 -9
- package/docs/PROPOSAL-evolution.zh.md +684 -0
- package/docs/RELEASE-NOTES-v0.6.0.md +64 -0
- package/lib/api.js +5 -0
- package/lib/boundary-prune.js +27 -1
- package/lib/client.js +88 -2
- package/lib/index.js +165 -18
- package/lib/jit.js +224 -0
- package/lib/ledger.js +458 -0
- package/lib/settings.js +12 -4
- package/package.json +1 -1
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
> 适用范围:dsh web(preset 平面)+ headless/TUI/base(host 平面)。
|
|
4
4
|
> 一句话:**用「机械驱逐 + 重取指针」替代 DSH 自带的有损 LLM 全量摘要压缩。**
|
|
5
|
+
>
|
|
6
|
+
> **v0.6 起是 opt-in**:`gcReplacesCompaction` 与 `autoWebCompaction` 默认都是 `false`,
|
|
7
|
+
> 插件默认保留 DSH 自己的摘要。要启用 Context GC,先打开这两个开关(见第 3 步)。
|
|
5
8
|
|
|
6
9
|
---
|
|
7
10
|
|
|
@@ -26,8 +29,8 @@ dsh-engram 的 Context GC 把这一步换成:
|
|
|
26
29
|
|
|
27
30
|
| 平面 | 覆盖 | 接管方式 |
|
|
28
31
|
|---|---|---|
|
|
29
|
-
| host 平面 | headless / TUI / base 型 profile |
|
|
30
|
-
| web 平面 | dsh web 的 agent preset(shipped + 用户预设) |
|
|
32
|
+
| host 平面 | headless / TUI / base 型 profile | 打开 `gcReplacesCompaction` 后,插件启动时注册 ContextGcEngine;否则挂裸 `BasicCompactionEngine`(宿主摘要) |
|
|
33
|
+
| web 平面 | dsh web 的 agent preset(shipped + 用户预设) | 打开 `autoWebCompaction` 后,启动时把 stock 预设的 `compaction-basic` 行换成 `dsh-engram/compaction` 行 |
|
|
31
34
|
|
|
32
35
|
---
|
|
33
36
|
|
|
@@ -41,29 +44,32 @@ dsh-engram 的 Context GC 把这一步换成:
|
|
|
41
44
|
|
|
42
45
|
---
|
|
43
46
|
|
|
44
|
-
## 3. 从 0 安装并启用(
|
|
47
|
+
## 3. 从 0 安装并启用(4 步 + 1 条铁律)
|
|
45
48
|
|
|
46
49
|
```bash
|
|
47
50
|
# ① 安装(源码开发方式;生产用 npm install dsh-engram)
|
|
48
51
|
cd /path/to/dsh-loom && npm link # 或 profile package.json 加 "dsh-engram": "link:..."
|
|
49
52
|
|
|
50
|
-
# ②
|
|
51
|
-
#
|
|
53
|
+
# ② 打开两个 opt-in 开关(设置卡「记忆 GC」区,或 profile patch)
|
|
54
|
+
# gcReplacesCompaction: true # host 平面换 ContextGcEngine
|
|
55
|
+
# autoWebCompaction: true # web 预设自动改写(带 .engram.bak)
|
|
56
|
+
|
|
57
|
+
# ③ 启动一次 dsh web —— 这一步做「自动装配」
|
|
58
|
+
# - host 平面:按 gcReplacesCompaction 注册 Context GC 为 compaction 服务
|
|
52
59
|
# - web 平面:改写每个 stock 预设文件(compaction-basic 行 → dsh-engram/compaction 行,
|
|
53
60
|
# 每个文件旁留 agent.cordis.yml.engram.bak)
|
|
54
61
|
dsh web
|
|
55
62
|
|
|
56
|
-
#
|
|
63
|
+
# ④ 再重启一次 dsh web —— 让已接管的预设真正生效
|
|
57
64
|
dsh web
|
|
58
65
|
```
|
|
59
66
|
|
|
60
67
|
**铁律:代码/预设改动后必须重启 dsh。** 运行中的进程把旧 `lib/*.js` 和旧预设行都缓存/装载在内存里,
|
|
61
|
-
|
|
62
|
-
加载新代码并接管 web 预设。
|
|
68
|
+
磁盘上的修复与文件改写不会热生效;只有在两个开关打开的前提下重启,才会加载新代码并接管 web 预设。
|
|
63
69
|
|
|
64
70
|
> 也可以先手动预写再一次性重启:
|
|
65
71
|
> ```bash
|
|
66
|
-
> npx dsh-engram enable #
|
|
72
|
+
> npx dsh-engram enable # 等价于启动时的自动装配(需 autoWebCompaction;通常 no-op)
|
|
67
73
|
> npx dsh-engram status # 确认 preset 已 wired
|
|
68
74
|
> # 然后重启 dsh web 一次
|
|
69
75
|
> ```
|