dsh-memoir 0.6.0 → 0.6.1
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.en.md +17 -10
- package/README.md +17 -10
- package/lib/autodistill.d.ts +12 -1
- package/lib/autodistill.js +7 -1
- package/lib/client.js +687 -151
- package/lib/client.js.map +3 -3
- package/lib/routes.js +4 -0
- package/lib/tools.js +3 -2
- package/package.json +15 -15
package/README.en.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
No embeddings, vector database, or cloud memory service. The npm package has zero bundled runtime dependencies; DSH peers are supplied by the host.
|
|
13
13
|
|
|
14
14
|
> [!IMPORTANT]
|
|
15
|
-
> `dsh-memoir@0.6.
|
|
15
|
+
> npm `latest` is `dsh-memoir@0.6.1` for `@deepseek-ai/dsh >=0.1.2-alpha.2 <0.1.3`, validated against DSH alpha.4 and the current alpha.5. Users remaining on `0.1.1-rc.2` should pin `dsh-memoir@0.5.6`.
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
npm install --global @deepseek-ai/dsh@alpha
|
|
@@ -35,7 +35,7 @@ Restart `dsh web`. Memory remains local and is not automatically deleted when th
|
|
|
35
35
|
|
|
36
36
|
It fits personal and local development workflows where a new agent should continue understanding a project. It is not a raw chat backup, multi-user cloud sync service, or vector-semantic knowledge base.
|
|
37
37
|
|
|
38
|
-

|
|
39
39
|
|
|
40
40
|
## How it works
|
|
41
41
|
|
|
@@ -98,17 +98,24 @@ Top-5 recall on the fixed quality set is 100%; the repository gate requires at l
|
|
|
98
98
|
|
|
99
99
|
Installing into a DSH-alpha `web` profile registers a native Memory Conversation view and Memory Settings section through official slots. The DSH shell owns layout, navigation, and unload lifecycle; Memoir no longer takes over the legacy sidebar through DOM selectors.
|
|
100
100
|
|
|
101
|
-
- Project memory and all-project global memory;
|
|
101
|
+
- Project memory and all-project global memory, with project groups collapsed by default and complete lifecycle totals;
|
|
102
102
|
- status, section, and keyword filters with BM25 scores;
|
|
103
103
|
- add, edit, pin, archive, restore, and supersede;
|
|
104
104
|
- copy and best-effort navigation for session/turn provenance;
|
|
105
105
|
- Hot Memory Inspector: what the next session will inherit;
|
|
106
106
|
- Retrieval Diagnostics: index, query cache, last query, and session snapshot;
|
|
107
|
-
-
|
|
107
|
+
- permanent `Browse / Settings / Hot Memory / Diagnostics` navigation with an independent bounded scroll position per surface;
|
|
108
|
+
- progressive batches of 20 entries or projects, plus a controlled six-line preview for long memory bodies;
|
|
109
|
+
- the native DSH composer-overlay contract, keeping the final memory visible above the conversation composer while the list scrolls fully;
|
|
110
|
+
- arrow-key, Home, and End navigation for surface tabs, plus `aria-expanded` project disclosures and visible focus states;
|
|
108
111
|
- live GUI Chinese/English switching from `<html lang>`, with a separate `language` setting for agent-facing copy.
|
|
109
112
|
|
|
110
113
|
<details>
|
|
111
|
-
<summary>More
|
|
114
|
+
<summary>More GUI screenshots</summary>
|
|
115
|
+
|
|
116
|
+

|
|
117
|
+
|
|
118
|
+

|
|
112
119
|
|
|
113
120
|

|
|
114
121
|
|
|
@@ -124,11 +131,11 @@ Installing into a DSH-alpha `web` profile registers a native Memory Conversation
|
|
|
124
131
|
|
|
125
132
|
| Channel | DSH baseline | Installation | Status |
|
|
126
133
|
| --- | --- | --- | --- |
|
|
127
|
-
| npm `latest` (`0.6.
|
|
134
|
+
| npm `latest` (`0.6.1`) | `>=0.1.2-alpha.2 <0.1.3` | `dsh plugin --profile web add dsh-memoir@latest` | Current release; alpha.4 compile and alpha.5 + dsh-web-all browser validated |
|
|
128
135
|
| pinned npm `0.5.6` | `0.1.1-rc.2` | `dsh plugin --profile web add dsh-memoir@0.5.6` | rc2 compatibility line |
|
|
129
|
-
| GitHub `main` | `>=0.1.2-alpha.2 <0.1.3` | source clone + `link:` | 0.6.
|
|
136
|
+
| GitHub `main` (`0.6.1`) | `>=0.1.2-alpha.2 <0.1.3` | source clone + `link:` | Synchronized with npm `0.6.1`; intended for development and debugging |
|
|
130
137
|
|
|
131
|
-
Node.js `^22.19.0 || >=24.0.0` is required. v0.6.
|
|
138
|
+
Node.js `^22.19.0 || >=24.0.0` is required. v0.6.x uses the native DSH-alpha `conversation.view` / `settings.section` slots and the Remote-era client module architecture. v0.6.1 supports both the public `session.events` surface in alpha.2/alpha.3 and `session.snapshotEvents()` in alpha.4+. `dsh.engines.dsh` rejects incompatible hosts.
|
|
132
139
|
|
|
133
140
|
<details>
|
|
134
141
|
<summary>Install from source</summary>
|
|
@@ -197,7 +204,7 @@ v0.5.6 benchmark (Node 24.19, 900/1200-token budget; full data in [`bench/report
|
|
|
197
204
|
|
|
198
205
|
Numbers vary by machine and corpus. The important properties are that injection remains bounded and the cache-hit path is independent of total memory size.
|
|
199
206
|
|
|
200
|
-
v0.6.
|
|
207
|
+
v0.6.1 has 189 automated tests covering store/settings migration and locks, Hot Memory, BM25 quality/cache, lifecycle, provenance anti-spoofing, similar-memory governance, automatic distillation, bilingual agent and GUI surfaces, project disclosure/progressive loading, scrolling, and DSH-alpha compatibility. An isolated DSH alpha.5 + `@linxin666/dsh-web-all@0.3.12` profile also passed Settings and real-session browser regression; alpha.4 type compilation passed separately.
|
|
201
208
|
|
|
202
209
|
## FAQ
|
|
203
210
|
|
|
@@ -226,6 +233,6 @@ pnpm test
|
|
|
226
233
|
npm run bench
|
|
227
234
|
```
|
|
228
235
|
|
|
229
|
-
Read [CONTRIBUTING.md](./CONTRIBUTING.md) before submitting changes. See [CHANGELOG.md](./CHANGELOG.md) for version history. Formal packages are published by the tag workflow through npm OIDC. The current release is [v0.6.
|
|
236
|
+
Read [CONTRIBUTING.md](./CONTRIBUTING.md) before submitting changes. See [CHANGELOG.md](./CHANGELOG.md) for version history. Formal packages are published by the tag workflow through npm OIDC. The current npm release is [v0.6.1](https://github.com/Qinling-Melon-Farmers/dsh-memoir/releases/tag/v0.6.1), and `main` is synchronized with it.
|
|
230
237
|
|
|
231
238
|
Apache-2.0
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
无需 embedding、向量数据库或云端记忆服务;npm 包零捆绑运行时依赖,DSH peer 由宿主提供。
|
|
12
12
|
|
|
13
13
|
> [!IMPORTANT]
|
|
14
|
-
> `dsh-memoir@0.6.
|
|
14
|
+
> npm `latest` 为 `dsh-memoir@0.6.1`,适用于 `@deepseek-ai/dsh >=0.1.2-alpha.2 <0.1.3`,已验证 DSH alpha.4 与当前 alpha.5。仍使用 `0.1.1-rc.2` 的用户应固定安装 `dsh-memoir@0.5.6`。
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
17
|
npm install --global @deepseek-ai/dsh@alpha
|
|
@@ -34,7 +34,7 @@ dsh plugin --profile web add dsh-memoir@latest
|
|
|
34
34
|
|
|
35
35
|
适合需要“新 Agent 接手时继续理解项目”的个人或本地开发工作流。它不是原始聊天记录备份、多人云同步服务或向量语义知识库。
|
|
36
36
|
|
|
37
|
-

|
|
38
38
|
|
|
39
39
|
## 工作原理
|
|
40
40
|
|
|
@@ -97,17 +97,24 @@ memoir_record / memoir_update
|
|
|
97
97
|
|
|
98
98
|
安装到 DSH alpha 的 `web` profile 后,Memoir 通过官方 slot 注册原生「记忆」会话视图和「记忆」Settings 分区;布局、导航与卸载生命周期均由 DSH shell 管理,不再通过 DOM 选择器接管旧侧边栏。
|
|
99
99
|
|
|
100
|
-
-
|
|
100
|
+
- 项目记忆与所有项目的全局记忆;全局视图按项目默认折叠并显示完整生命周期计数;
|
|
101
101
|
- 状态、分类和关键词筛选,BM25 分数展示;
|
|
102
102
|
- 新增、编辑、置顶、归档、恢复和替代;
|
|
103
103
|
- session/turn 来源复制与尽力跳转;
|
|
104
104
|
- Hot Memory Inspector:下一会话将继承什么;
|
|
105
105
|
- Retrieval Diagnostics:索引、查询缓存、最近查询和会话快照;
|
|
106
|
-
-
|
|
106
|
+
- 常驻 `记忆浏览 / 记忆设置 / Hot Memory / 诊断` 二级导航,各功能区拥有独立有界滚动位置;
|
|
107
|
+
- 每批渐进展示 20 条记忆或 20 个项目,长正文默认折叠为六行并可显式展开;
|
|
108
|
+
- 使用 DSH 原生 composer-overlay 契约,长列表可完整滚动且最后一项不会被对话输入框遮挡;
|
|
109
|
+
- 页签支持方向键、Home、End,项目折叠具备 `aria-expanded` 与清晰焦点状态;
|
|
107
110
|
- GUI 跟随 `<html lang>` 在中文和英文间即时切换;Agent 侧语言由独立的 `language` 设置控制。
|
|
108
111
|
|
|
109
112
|
<details>
|
|
110
|
-
<summary
|
|
113
|
+
<summary>查看更多 GUI 截图</summary>
|
|
114
|
+
|
|
115
|
+

|
|
116
|
+
|
|
117
|
+

|
|
111
118
|
|
|
112
119
|

|
|
113
120
|
|
|
@@ -123,11 +130,11 @@ memoir_record / memoir_update
|
|
|
123
130
|
|
|
124
131
|
| 渠道 | DSH 基线 | 安装方式 | 状态 |
|
|
125
132
|
| --- | --- | --- | --- |
|
|
126
|
-
| npm `latest`(`0.6.
|
|
133
|
+
| npm `latest`(`0.6.1`) | `>=0.1.2-alpha.2 <0.1.3` | `dsh plugin --profile web add dsh-memoir@latest` | 当前正式版;已验证 alpha.4 编译及 alpha.5 + dsh-web-all 实机 UI |
|
|
127
134
|
| npm 固定版 `0.5.6` | `0.1.1-rc.2` | `dsh plugin --profile web add dsh-memoir@0.5.6` | rc2 兼容线 |
|
|
128
|
-
| GitHub `main
|
|
135
|
+
| GitHub `main`(`0.6.1`) | `>=0.1.2-alpha.2 <0.1.3` | 源码 clone + `link:` | 与 npm `0.6.1` 同步;供开发和调试使用 |
|
|
129
136
|
|
|
130
|
-
需要 Node.js `^22.19.0 || >=24.0.0`。`0.6.
|
|
137
|
+
需要 Node.js `^22.19.0 || >=24.0.0`。`0.6.x` 使用 DSH alpha 的原生 `conversation.view` / `settings.section` 与 Remote 时代客户端模块;`0.6.1` 同时兼容 alpha.2/alpha.3 的公开 `session.events` 与 alpha.4+ 的 `session.snapshotEvents()`。manifest 的 `dsh.engines.dsh` 会拒绝不兼容宿主。
|
|
131
138
|
|
|
132
139
|
<details>
|
|
133
140
|
<summary>从源码安装</summary>
|
|
@@ -196,7 +203,7 @@ v0.5.6 基准(Node 24.19,900/1200 token;完整数据见 [`bench/report.md`
|
|
|
196
203
|
|
|
197
204
|
基准值取决于机器和语料;它证明的重点是注入预算保持有界、缓存命中路径与记忆总量解耦。
|
|
198
205
|
|
|
199
|
-
v0.6.
|
|
206
|
+
v0.6.1 有 189 项自动化测试,覆盖存储/设置迁移与锁、Hot Memory、BM25 质量/缓存、生命周期、来源防伪、相似治理、自动蒸馏、Agent 侧与 GUI 双语、项目折叠/渐进加载、滚动布局及 DSH alpha 兼容。另在隔离 profile 中以 DSH alpha.5 + `@linxin666/dsh-web-all@0.3.12` 完成 Settings 与真实会话页浏览器回归;alpha.4 类型编译也已通过。
|
|
200
207
|
|
|
201
208
|
## 常见问题
|
|
202
209
|
|
|
@@ -225,6 +232,6 @@ pnpm test
|
|
|
225
232
|
npm run bench
|
|
226
233
|
```
|
|
227
234
|
|
|
228
|
-
提交前请阅读 [CONTRIBUTING.md](./CONTRIBUTING.md)。版本变化见 [CHANGELOG.md](./CHANGELOG.md),正式包由 tag 工作流通过 npm OIDC
|
|
235
|
+
提交前请阅读 [CONTRIBUTING.md](./CONTRIBUTING.md)。版本变化见 [CHANGELOG.md](./CHANGELOG.md),正式包由 tag 工作流通过 npm OIDC 发布。当前 npm 正式版是 [v0.6.1](https://github.com/Qinling-Melon-Farmers/dsh-memoir/releases/tag/v0.6.1),`main` 与该版本同步。
|
|
229
236
|
|
|
230
237
|
Apache-2.0
|
package/lib/autodistill.d.ts
CHANGED
|
@@ -27,6 +27,16 @@ export interface TurnActivity {
|
|
|
27
27
|
recorded: boolean;
|
|
28
28
|
toolCalls: number;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Session-log compatibility surface. DSH <= alpha.3 exposed `events` while
|
|
32
|
+
* alpha.4+ keeps the log private and exposes an immutable snapshot method.
|
|
33
|
+
*/
|
|
34
|
+
export interface SessionEventSource {
|
|
35
|
+
readonly events?: readonly TurnEventLike[];
|
|
36
|
+
snapshotEvents?: () => readonly TurnEventLike[];
|
|
37
|
+
}
|
|
38
|
+
/** Read a stable session event snapshot across the old and new DSH APIs. */
|
|
39
|
+
export declare function sessionEventSnapshot(session: SessionEventSource | undefined): readonly TurnEventLike[];
|
|
30
40
|
/** Scan the tail of a session log for one turn's tool activity. */
|
|
31
41
|
export declare function turnActivity(events: readonly TurnEventLike[], turn: number): TurnActivity;
|
|
32
42
|
/** The agent surface the turn-stopping listener needs. */
|
|
@@ -37,7 +47,8 @@ export interface AutoDistillAgentLike {
|
|
|
37
47
|
origin?: string;
|
|
38
48
|
delegationDepth?: number;
|
|
39
49
|
};
|
|
40
|
-
events
|
|
50
|
+
readonly events?: readonly TurnEventLike[];
|
|
51
|
+
snapshotEvents?: () => readonly TurnEventLike[];
|
|
41
52
|
};
|
|
42
53
|
steer(message: UserMessage): void;
|
|
43
54
|
}
|
package/lib/autodistill.js
CHANGED
|
@@ -19,6 +19,12 @@ export function distillPrompt(language = DEFAULT_MEMOIR_LANGUAGE) {
|
|
|
19
19
|
export const DISTILL_PROMPT = distillPrompt();
|
|
20
20
|
/** Plugin identity stamped on the steering message source. */
|
|
21
21
|
export const AUTO_DISTILL_PLUGIN = 'dsh-memoir';
|
|
22
|
+
/** Read a stable session event snapshot across the old and new DSH APIs. */
|
|
23
|
+
export function sessionEventSnapshot(session) {
|
|
24
|
+
if (typeof session?.snapshotEvents === 'function')
|
|
25
|
+
return session.snapshotEvents();
|
|
26
|
+
return session?.events ?? [];
|
|
27
|
+
}
|
|
22
28
|
/** Scan the tail of a session log for one turn's tool activity. */
|
|
23
29
|
export function turnActivity(events, turn) {
|
|
24
30
|
let recorded = false;
|
|
@@ -100,7 +106,7 @@ export function installAutoDistill(wire, options) {
|
|
|
100
106
|
return;
|
|
101
107
|
if (signal.aborted)
|
|
102
108
|
return;
|
|
103
|
-
const { worked, recorded, toolCalls } = turnActivity(agent.session
|
|
109
|
+
const { worked, recorded, toolCalls } = turnActivity(sessionEventSnapshot(agent.session), turn);
|
|
104
110
|
if (!worked || recorded)
|
|
105
111
|
return;
|
|
106
112
|
const live = options.policy?.();
|