@a9i5k4/dsh-auto-memory 3.1.0 → 3.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/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/docs/CONTRIBUTORS.html +2 -2
- package/docs/HANDBOOK.md +13 -9
- package/lib/client.js +786 -134
- package/lib/config-io.js +59 -6
- package/lib/context-host.js +10 -1
- package/lib/evidence-store.js +27 -1
- package/lib/index.js +937 -51
- package/lib/jsonl-tail-cursor.js +75 -0
- package/lib/m7-index-sync-host.js +4 -6
- package/lib/memory-hub.js +25 -2
- package/lib/migrate-pack.js +431 -0
- package/lib/python-setup.js +109 -27
- package/lib/recall-stats.js +242 -0
- package/lib/rules-layer.js +106 -15
- package/lib/semantic-js.js +25 -7
- package/lib/shadow-host.js +41 -2
- package/lib/subagent-gc.js +5 -1
- package/lib/wb-sidecar.js +8 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -651,7 +651,7 @@ Full credits, including infrastructure sponsors: **[Contributors & Sponsors](htt
|
|
|
651
651
|
|
|
652
652
|
Development resources for this project are partly provided by:
|
|
653
653
|
|
|
654
|
-
- **[DSH API](https://api.dshapi.icu/)** — API relay station providing the model endpoints used for development, testing, and the semantic-engine research behind the M-series features. Thank you for keeping the lights on.
|
|
654
|
+
- **[DSH API](https://api.dshapi.icu/register?aff=HJU27P7JL39N)** — API relay station providing the model endpoints used for development, testing, and the semantic-engine research behind the M-series features. Thank you for keeping the lights on.
|
|
655
655
|
|
|
656
656
|
Infrastructure and API-quota sponsors are listed on the **[Contributors & Sponsors](https://htmlpreview.github.io/?https://github.com/Aik358/dsh-auto-memory/blob/main/docs/CONTRIBUTORS.html)** page. If you would like to support the project, open an issue or join the QQ group.
|
|
657
657
|
|
package/README.zh-CN.md
CHANGED
|
@@ -653,7 +653,7 @@ DeepSeek Harness (Node, 127.0.0.1:3080)
|
|
|
653
653
|
|
|
654
654
|
本项目部分开发资源由以下方提供:
|
|
655
655
|
|
|
656
|
-
- **[DSH API](https://api.dshapi.icu/)** — API 中转站,为本项目的开发、测试以及 M 系列语义引擎研究提供模型端点。感谢一路同行。
|
|
656
|
+
- **[DSH API](https://api.dshapi.icu/register?aff=HJU27P7JL39N)** — API 中转站,为本项目的开发、测试以及 M 系列语义引擎研究提供模型端点。感谢一路同行。
|
|
657
657
|
|
|
658
658
|
基础设施与 API 额度赞助方列在 **[贡献者与赞助](https://htmlpreview.github.io/?https://github.com/Aik358/dsh-auto-memory/blob/main/docs/CONTRIBUTORS.html)** 页面。如希望支持本项目,欢迎提 issue 或加入 QQ 交流群。
|
|
659
659
|
|
package/docs/CONTRIBUTORS.html
CHANGED
|
@@ -395,7 +395,7 @@
|
|
|
395
395
|
<div class="sponsor">
|
|
396
396
|
<div class="mark">DSH</div>
|
|
397
397
|
<div class="body">
|
|
398
|
-
<h3><a href="https://api.dshapi.icu/" target="_blank" rel="noopener">DSH API · api.dshapi.icu</a></h3>
|
|
398
|
+
<h3><a href="https://api.dshapi.icu/register?aff=HJU27P7JL39N" target="_blank" rel="noopener">DSH API · api.dshapi.icu</a></h3>
|
|
399
399
|
<p class="zh">API 中转站,为本项目的开发、回归测试,以及 M 系列语义引擎的选型与激活策略研究提供模型端点。没有这些额度,那些基准实验根本跑不起来。</p>
|
|
400
400
|
<p class="en">An API relay station providing the model endpoints used for development, regression testing, and the M-series semantic-engine selection / activation research. Without that quota, those benchmark runs simply would not have happened.</p>
|
|
401
401
|
<div class="tag"><span class="zh">API 额度赞助</span><span class="en">API quota sponsor</span></div>
|
|
@@ -442,7 +442,7 @@
|
|
|
442
442
|
<a href="https://github.com/Aik358/dsh-auto-memory">README</a> ·
|
|
443
443
|
<a href="https://github.com/Aik358/dsh-auto-memory/blob/main/docs/USER-GUIDE.zh-CN.md">用户文档</a> ·
|
|
444
444
|
<a href="https://github.com/Aik358/dsh-auto-memory" target="_blank" rel="noopener">GitHub</a> ·
|
|
445
|
-
<a href="https://api.dshapi.icu/" target="_blank" rel="noopener">DSH API</a>
|
|
445
|
+
<a href="https://api.dshapi.icu/register?aff=HJU27P7JL39N" target="_blank" rel="noopener">DSH API</a>
|
|
446
446
|
</p>
|
|
447
447
|
<p style="margin-top:10px;opacity:.6">dsh-auto-memory · BSD-3-Clause</p>
|
|
448
448
|
</footer>
|
package/docs/HANDBOOK.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
| **命名口径(发布名 vs pre 名)** | 同一份身份在两条线上拼写不同,**本手册正文一律给「发布名」——即用户实际装到的那个**;pre 开发树各加 `-pre`。成对关系:端点前缀 `/api/dsh-auto-memory/` ↔ `/api/dsh-auto-memory-pre/`;诊断日志 `dsh-auto-memory-diagnose.log` ↔ `dsh-auto-memory-pre-diagnose.log`;配置 `dsh-auto-memory.json` ↔ `dsh-auto-memory-pre.json`;目录 `memory/hub/` ↔ `memory/hub-pre/`、`memory/evidence/` ↔ `memory/evidence-pre/`、`memory/index/` ↔ `memory/index-pre/`、`memory/semantic/` ↔ `memory/semantic-pre/`。**★例外:`memory/degrade-pre/` 转换表里没有对应规则 ⇒ 发布物里仍叫 `degrade-pre`,不要改成 `degrade`**。依据:`tools/release.mjs` 转换表 + 已发布产物 `D:\dsh_debug\_publish_dsh-auto-memory\lib\index.js` |
|
|
18
18
|
| **宿主侧 / 后端** | `lib/index.js`,运行在 Node 进程里,负责存储、检索、端点、工具、调度 |
|
|
19
19
|
| **浏览器侧 / 前端** | `lib/client.js`,注入到 DSH 浏览器 UI,负责面板与设置页 |
|
|
20
|
-
| **工具(tool)** | 供模型调用的函数(类似 MCP 工具)。本插件注册 **
|
|
20
|
+
| **工具(tool)** | 供模型调用的函数(类似 MCP 工具)。本插件注册 **18 个**;pre 树名字以 `_pre` 结尾,发布名去掉 `_pre`(如 `memory_recall`) |
|
|
21
21
|
| **水位(water level)** | 当前会话上下文占用比例(0–1)。用于决定何时触发接续 |
|
|
22
22
|
| **接续 / handoff** | 上下文将满时,把进度交接给一个新会话继续工作的机制 |
|
|
23
23
|
| **主动联想** | 不等用户询问,由系统主动判断"该想起什么"并注入上下文——本插件的核心差异化能力 |
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
| **BM25** | 经典词法相关性算法 |
|
|
28
28
|
| **M8 / 记忆中枢** | 三层记忆存储(fact 事实/episodic 经历/procedure 技能)与编排器 memory-hub 的合称 |
|
|
29
29
|
| **evidence(证据)** | 记忆被使用情况的记录,六类:`seen`(曝光)/`read`(读到原文)/`cite`(回复引用)/`reuse`(跨会话复用)/`success`(任务成功)/`correction`(用户纠正) |
|
|
30
|
-
| **endpoint / 端点** | 后端 HTTP 接口,路径前缀统一为 `/api/dsh-auto-memory/`(pre 树为 `/api/dsh-auto-memory-pre/`),共
|
|
30
|
+
| **endpoint / 端点** | 后端 HTTP 接口,路径前缀统一为 `/api/dsh-auto-memory/`(pre 树为 `/api/dsh-auto-memory-pre/`),共 54 条 |
|
|
31
31
|
|
|
32
32
|
---
|
|
33
33
|
|
|
@@ -78,8 +78,8 @@ dsh web --no-open --port 0
|
|
|
78
78
|
│ HTTP /api/dsh-auto-memory/*(pre 树为 /api/dsh-auto-memory-pre/*)
|
|
79
79
|
┌───────────────▼───────────────────────────────────────────┐
|
|
80
80
|
│ 宿主侧(后端)lib/index.js + lib/*-pre.js │
|
|
81
|
-
│ · 端点路由(
|
|
82
|
-
│ · 工具(
|
|
81
|
+
│ · 端点路由(54 个) │
|
|
82
|
+
│ · 工具(18 个,供模型调用) │
|
|
83
83
|
│ · 存储:记忆文件、M8 三层 JSON、evidence 事件 JSONL │
|
|
84
84
|
│ · 检索:C1 词法 / C2 语义 / C3 Python 语义 │
|
|
85
85
|
│ · 决策:主动联想门控、接续调度、水位监测 │
|
|
@@ -169,7 +169,7 @@ dsh web --no-open --port 0
|
|
|
169
169
|
|
|
170
170
|
## 5. 后端状态来源(如何确认前端操作已生效)
|
|
171
171
|
|
|
172
|
-
### 5.1 主要端点(`lib/index.js` 注册,共 **
|
|
172
|
+
### 5.1 主要端点(`lib/index.js` 注册,共 **54** 条,前缀 `/api/dsh-auto-memory/`)
|
|
173
173
|
|
|
174
174
|
| 端点 | 用途 | 关键返回字段 |
|
|
175
175
|
|---|---|---|
|
|
@@ -184,15 +184,18 @@ dsh web --no-open --port 0
|
|
|
184
184
|
| `storage-manage` | 存储管理 | 文件/统计 |
|
|
185
185
|
| `workspaces` | 工作区列表 | 工作区标识 |
|
|
186
186
|
| `update` / `update-check` | 更新 | 版本信息 |
|
|
187
|
+
| `migrate-export` | **迁移搬包:导出本工作区**(POST,`outPath` 可选) | `path` / `stats` / `checksum` |
|
|
188
|
+
| `migrate-inspect` | **迁移搬包:预演差异**(POST,`packPath`;**只读,不写任何文件**) | `plan`(`pathChanged` / `additions` / `overwrites` / `rewrite`) |
|
|
189
|
+
| `migrate-import` | **迁移搬包:确认导入**(POST,`packPath` / `onConflict`) | `written` / `backup` / `summaryAction` |
|
|
187
190
|
| `calendar`、`file`、`browse-dir`、`external*`、`summarize`、`shadow-recent`、`subagent-gc`、`greet` | 其余辅助端点 | — |
|
|
188
191
|
|
|
189
|
-
> 端点名与条数以代码为准(**一条命令自核**,`
|
|
192
|
+
> 端点名与条数以代码为准(**一条命令自核**,`50` 与 `/api/dsh-auto-memory/` 都由它推出,不是写死的):
|
|
190
193
|
>
|
|
191
194
|
> ```bash
|
|
192
195
|
> node -e "const f=require('fs');const s=f.readFileSync('lib/index.js','utf8'),r=f.readFileSync('tools/release.mjs','utf8');const P=[...r.matchAll(/\['([^']+)',\s*'([^']+)'\]/g)].map(m=>[m[1],m[2]]);const c=x=>P.reduce((a,[b,d])=>a.split(b).join(d),x);const e=[...new Set([...s.matchAll(/'(\/api\/dsh-auto-memory[^']*)'/g)].map(m=>m[1]))];console.log('端点条数:',e.length);console.log('发布名前缀:',c(e[0]).split('/').slice(0,3).join('/')+'/')"
|
|
193
196
|
> ```
|
|
194
197
|
>
|
|
195
|
-
> 在工程根执行,输出应为 `端点条数:
|
|
198
|
+
> 在工程根执行,输出应为 `端点条数: 54` / `发布名前缀: /api/dsh-auto-memory/`。命令读的是**源码 + 发布转换表**,所以两条线的拼写都能对上。
|
|
196
199
|
|
|
197
200
|
### 5.2 日志
|
|
198
201
|
|
|
@@ -231,7 +234,7 @@ dsh web --no-open --port 0
|
|
|
231
234
|
|
|
232
235
|
---
|
|
233
236
|
|
|
234
|
-
## 6. 工具(模型可调用,
|
|
237
|
+
## 6. 工具(模型可调用,18 个)
|
|
235
238
|
|
|
236
239
|
> 下表给的是**发布名**;pre 树各加 `_pre` 后缀(`memory_recall` ↔ `memory_recall_pre`)。
|
|
237
240
|
> 自核(数一遍源码里的注册调用):`node -e "const s=require('fs').readFileSync('lib/index.js','utf8');const n=[...s.matchAll(/defineTool\('([a-z_]+)'/g)].map(m=>m[1]);console.log(n.length,'个:',n.sort().join(' '))"`
|
|
@@ -249,6 +252,7 @@ dsh web --no-open --port 0
|
|
|
249
252
|
| `memory_user` | `memory_user_pre` | 用户级记忆读写 |
|
|
250
253
|
| `memory_external` | `memory_external_pre` | 外部记忆源管理(list / import) |
|
|
251
254
|
| `memory_procedure` | `memory_procedure_pre` | 流程(技能)直写:write 进审批列表 / activate 写入+晋升+激活 |
|
|
255
|
+
| `memory_rules` | `memory_rules_pre` | 用户级硬约束的条目级增删改:list / add / update / remove(删改须带 `expect` 内容锚定) |
|
|
252
256
|
| `memory_expand` | `memory_expand_pre` | 白板结构化展开(需 `boardMode=graph`) |
|
|
253
257
|
| `memory_trace` | `memory_trace_pre` | 白板结构化回溯(需 `boardMode=graph`) |
|
|
254
258
|
| `calendar_add` | `calendar_add_pre` | 添加日历事项 |
|
|
@@ -380,7 +384,7 @@ node tests/smoke/smoke-test-continue-chain-pre.mjs # 58
|
|
|
380
384
|
| 工程根 | `D:\dsh-auto-memory` |
|
|
381
385
|
| 宿主侧入口 | `lib/index.js` |
|
|
382
386
|
| 浏览器侧入口 | `lib/client.js` |
|
|
383
|
-
| 端点前缀 | `/api/dsh-auto-memory/`(
|
|
387
|
+
| 端点前缀 | `/api/dsh-auto-memory/`(54 条;pre 树 `/api/dsh-auto-memory-pre/`) |
|
|
384
388
|
| 工具 | 10 个,`memory_*_pre` |
|
|
385
389
|
| 记忆根 | `C:\Users\JH Z\.dsh\memory` |
|
|
386
390
|
| 证据事件 | `...\memory\evidence\events\YYYY-MM-DD.jsonl`(时间戳在 `event.ts`) |
|