dsh-mnemon 0.1.2 → 0.1.4

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.
Files changed (138) hide show
  1. package/README.md +103 -129
  2. package/README.zh-CN.md +173 -0
  3. package/SECURITY.md +2 -2
  4. package/docs/README.md +4 -4
  5. package/docs/assets/diagrams/en/memory-system-flow.png +0 -0
  6. package/docs/assets/diagrams/zh-CN/memory-system-flow.png +0 -0
  7. package/docs/assets/media/dsh-mnemon-memory-system-demo-poster.jpg +0 -0
  8. package/docs/assets/media/dsh-mnemon-memory-system-demo.gif +0 -0
  9. package/docs/assets/media/dsh-mnemon-memory-system-demo.mp4 +0 -0
  10. package/docs/assets/screenshots/conversation-memory-jump.png +0 -0
  11. package/docs/assets/screenshots/conversation-save-dialog.png +0 -0
  12. package/docs/assets/screenshots/conversation-turn-memory.png +0 -0
  13. package/docs/assets/screenshots/document-create-dialog.png +0 -0
  14. package/docs/assets/screenshots/documents-markdown.png +0 -0
  15. package/docs/assets/screenshots/entities-context.png +0 -0
  16. package/docs/assets/screenshots/memory-content.png +0 -0
  17. package/docs/assets/screenshots/overview-memory-graph.png +0 -0
  18. package/docs/assets/screenshots/recall-agent-answer.png +0 -0
  19. package/docs/assets/screenshots/remember-dialog.png +0 -0
  20. package/docs/assets/screenshots/runtime-memory-add.png +0 -0
  21. package/docs/assets/screenshots/runtime-memory.png +0 -0
  22. package/docs/assets/screenshots/settings-memory-system.png +0 -0
  23. package/docs/assets/screenshots/status-overview.png +0 -0
  24. package/docs/assets/screenshots/version-check.png +0 -0
  25. package/docs/en/README.md +40 -32
  26. package/docs/en/architecture.md +6 -2
  27. package/docs/en/configuration.md +15 -6
  28. package/docs/en/development.md +24 -4
  29. package/docs/en/getting-started.md +77 -87
  30. package/docs/en/interfaces.md +98 -90
  31. package/docs/en/operations.md +103 -93
  32. package/docs/en/project-overview.md +90 -194
  33. package/docs/en/storage-model.md +6 -0
  34. package/docs/en/ui-guide.md +156 -0
  35. package/docs/zh-CN/README.md +37 -29
  36. package/docs/zh-CN/architecture.md +6 -2
  37. package/docs/zh-CN/configuration.md +15 -6
  38. package/docs/zh-CN/development.md +24 -4
  39. package/docs/zh-CN/getting-started.md +70 -80
  40. package/docs/zh-CN/interfaces.md +84 -76
  41. package/docs/zh-CN/operations.md +96 -86
  42. package/docs/zh-CN/project-overview.md +86 -190
  43. package/docs/zh-CN/storage-model.md +6 -0
  44. package/docs/zh-CN/ui-guide.md +160 -0
  45. package/lib/client.js +2354 -1944
  46. package/lib/client.js.map +1 -1
  47. package/lib/index.js +446 -39
  48. package/lib/types/channels.d.ts +4 -0
  49. package/lib/types/channels.d.ts.map +1 -0
  50. package/lib/types/channels.js +4 -0
  51. package/lib/types/channels.js.map +1 -0
  52. package/lib/types/client/MnemonSaveAction.d.ts.map +1 -1
  53. package/lib/types/client/MnemonSaveAction.js +4 -55
  54. package/lib/types/client/MnemonSaveAction.js.map +1 -1
  55. package/lib/types/client/MnemonSettingsCard.d.ts.map +1 -1
  56. package/lib/types/client/MnemonSettingsCard.js +4 -5
  57. package/lib/types/client/MnemonSettingsCard.js.map +1 -1
  58. package/lib/types/client/MnemonTurnTail.d.ts +3 -0
  59. package/lib/types/client/MnemonTurnTail.d.ts.map +1 -1
  60. package/lib/types/client/MnemonTurnTail.js +15 -3
  61. package/lib/types/client/MnemonTurnTail.js.map +1 -1
  62. package/lib/types/client/MnemonView.d.ts +4 -0
  63. package/lib/types/client/MnemonView.d.ts.map +1 -1
  64. package/lib/types/client/MnemonView.js +424 -97
  65. package/lib/types/client/MnemonView.js.map +1 -1
  66. package/lib/types/client/MnemonViewAppearance.d.ts +21 -0
  67. package/lib/types/client/MnemonViewAppearance.d.ts.map +1 -0
  68. package/lib/types/client/MnemonViewAppearance.js +67 -0
  69. package/lib/types/client/MnemonViewAppearance.js.map +1 -0
  70. package/lib/types/client/anchor.d.ts +1 -1
  71. package/lib/types/client/anchor.js +1 -1
  72. package/lib/types/client/api.d.ts +4 -0
  73. package/lib/types/client/api.d.ts.map +1 -1
  74. package/lib/types/client/api.js +10 -1
  75. package/lib/types/client/api.js.map +1 -1
  76. package/lib/types/client/index.d.ts.map +1 -1
  77. package/lib/types/client/index.js +22 -25
  78. package/lib/types/client/index.js.map +1 -1
  79. package/lib/types/client/locales.d.ts +126 -294
  80. package/lib/types/client/locales.d.ts.map +1 -1
  81. package/lib/types/client/locales.js +140 -308
  82. package/lib/types/client/locales.js.map +1 -1
  83. package/lib/types/client/settings.d.ts +1 -1
  84. package/lib/types/client/settings.d.ts.map +1 -1
  85. package/lib/types/client/settings.js +1 -1
  86. package/lib/types/client/settings.js.map +1 -1
  87. package/lib/types/client/sidebar-entry.d.ts +1 -1
  88. package/lib/types/client/sidebar-entry.d.ts.map +1 -1
  89. package/lib/types/client/sidebar-entry.js +3 -1
  90. package/lib/types/client/sidebar-entry.js.map +1 -1
  91. package/lib/types/client/workspace-mount.d.ts.map +1 -1
  92. package/lib/types/client/workspace-mount.js +8 -5
  93. package/lib/types/client/workspace-mount.js.map +1 -1
  94. package/lib/types/config.d.ts +1 -3
  95. package/lib/types/config.d.ts.map +1 -1
  96. package/lib/types/config.js +10 -12
  97. package/lib/types/config.js.map +1 -1
  98. package/lib/types/index.d.ts +2 -1
  99. package/lib/types/index.d.ts.map +1 -1
  100. package/lib/types/index.js +2 -1
  101. package/lib/types/index.js.map +1 -1
  102. package/lib/types/lifecycle.js +3 -3
  103. package/lib/types/lifecycle.js.map +1 -1
  104. package/lib/types/memory-bodies.d.ts +1 -0
  105. package/lib/types/memory-bodies.d.ts.map +1 -1
  106. package/lib/types/memory-bodies.js +7 -0
  107. package/lib/types/memory-bodies.js.map +1 -1
  108. package/lib/types/rpc.d.ts +5 -7
  109. package/lib/types/rpc.d.ts.map +1 -1
  110. package/lib/types/rpc.js +28 -8
  111. package/lib/types/rpc.js.map +1 -1
  112. package/lib/types/service.d.ts +2 -0
  113. package/lib/types/service.d.ts.map +1 -1
  114. package/lib/types/service.js +4 -0
  115. package/lib/types/service.js.map +1 -1
  116. package/lib/types/settings.d.ts.map +1 -1
  117. package/lib/types/settings.js +1 -2
  118. package/lib/types/settings.js.map +1 -1
  119. package/lib/types/version-updates.d.ts +61 -0
  120. package/lib/types/version-updates.d.ts.map +1 -0
  121. package/lib/types/version-updates.js +377 -0
  122. package/lib/types/version-updates.js.map +1 -0
  123. package/package.json +23 -8
  124. package/README.en.md +0 -199
  125. package/docs/zh-CN/assets/screenshots/conversation-recall.png +0 -0
  126. package/docs/zh-CN/assets/screenshots/conversation-writeback.png +0 -0
  127. package/docs/zh-CN/assets/screenshots/documents-markdown.png +0 -0
  128. package/docs/zh-CN/assets/screenshots/entities-context.png +0 -0
  129. package/docs/zh-CN/assets/screenshots/memory-content.png +0 -0
  130. package/docs/zh-CN/assets/screenshots/overview-memory-graph.png +0 -0
  131. package/docs/zh-CN/assets/screenshots/recall-agent-answer.png +0 -0
  132. package/docs/zh-CN/assets/screenshots/runtime-memory.png +0 -0
  133. package/lib/types/client/MnemonToolviews.d.ts +0 -19
  134. package/lib/types/client/MnemonToolviews.d.ts.map +0 -1
  135. package/lib/types/client/MnemonToolviews.js +0 -172
  136. package/lib/types/client/MnemonToolviews.js.map +0 -1
  137. /package/docs/{en/assets → assets/diagrams/en}/project-architecture.svg +0 -0
  138. /package/docs/{zh-CN/assets → assets/diagrams/zh-CN}/project-architecture.svg +0 -0
package/README.md CHANGED
@@ -1,199 +1,173 @@
1
1
  <h1 align="center">dsh-mnemon</h1>
2
2
 
3
- <p align="center"><strong>简体中文</strong> | <a href="./README.en.md">English</a></p>
3
+ <p align="center"><strong>English</strong> · <a href="./README.zh-CN.md">简体中文</a></p>
4
4
 
5
5
  <p align="center">
6
- <a href="./docs/zh-CN/project-overview.md">
7
- <img src="./docs/assets/dsh-mnemon-memory-system-demo-poster.jpg" alt="Mnemon 记忆体页:多记忆体目录、激活状态与实时关系图" width="720">
6
+ <a href="./docs/en/ui-guide.md">
7
+ <img src="./docs/assets/media/dsh-mnemon-memory-system-demo-poster.jpg" alt="dsh-mnemon Sidebar Memory System with Memory Space catalog and relationship graph" width="760">
8
8
  </a>
9
9
  </p>
10
10
 
11
- > **[Mnemon](https://github.com/mnemon-dev/mnemon) 与 DSH 的深度集成,为 DSH 提供完备的记忆系统能力。**
11
+ <p align="center"><strong>Local, layered, supervised memory for DeepSeek Harness—with cross-agent sharing through Mnemon.</strong></p>
12
12
 
13
- `dsh-mnemon` 是 DeepSeek Harness(DSH)的本地 Mnemon 记忆插件。它把每轮可见的运行时热记忆、可直接阅读的项目档案(Documents)和按需召回的长期记忆体(Memory Spaces)组织成一个受监督、可检索、可维护的三层体系。
13
+ `dsh-mnemon` integrates [Mnemon](https://github.com/mnemon-dev/mnemon) with DeepSeek Harness (DSH). It brings hot memory needed every turn, full project Documents, and on-demand long-term Memory Spaces into one workbench. Other agents can share DSH's long-term memory when they also integrate Mnemon and use the same accessible local Mnemon storage.
14
14
 
15
- 插件把 Mnemon 的长期记忆体能力接入 DSH,并补充 Runtime Memory、Documents、生命周期、受限子 Agent、WebUI、命令和权限边界。当前用户指令和仓库事实始终高于历史记忆。
15
+ - **Local first**: memory stays in local SQLite, JSON, and Markdown; no remote memory service is required.
16
+ - **Cross-agent sharing**: Mnemon-enabled agents can read and reuse DSH's Mnemon Memory Spaces.
17
+ - **Three cooperating tiers**: Runtime Memory, Project Documents, and Memory Spaces retain information at the right granularity.
18
+ - **Supervised writes**: isolated memory subagents make semantic decisions; the Host enforces paths, permissions, capacity, locks, and revisions.
19
+ - **Native DSH experience**: a Sidebar workbench by default, turn memory, a Save-to-memory dialog, bilingual copy, and global themes.
16
20
 
17
- > **What's more?** 更多 DSH Native 能力支持正在路上。**Memory to View.**
21
+ Current user instructions, repository files, and live tool results always take precedence over historical memory.
18
22
 
19
- ## 实机演示
23
+ ## Live demo
20
24
 
21
- ![dsh-mnemon 记忆系统实机演示:状态、运行时记忆、多记忆体图谱、档案、检索、实体与监督写回](./docs/assets/dsh-mnemon-memory-system-demo.gif)
25
+ ![dsh-mnemon Sidebar Memory System and in-conversation interaction demo](./docs/assets/media/dsh-mnemon-memory-system-demo.gif)
22
26
 
23
- ## 三层记忆
27
+ See the [Sidebar and conversation UI guide](./docs/en/ui-guide.md) for the complete visual walkthrough.
24
28
 
25
- | 层级 | 适合保存 | 如何记住 | 如何进入上下文 |
26
- |---|---|---|---|
27
- | 运行时热记忆 | 用户偏好、稳定约定、环境事实、常用经验 | 显式操作或合格的后台审查更新 `memories.json`,再生成 `USER.md` / `MEMORY.md` 投影 | 每轮直接注入 |
28
- | 项目档案 | 设计、调查、流程、架构理由、交接材料 | 创建或更新受管 Markdown 与 `index.json`;整理容量时先建立 Mnemon 冷引用,再迁移原文 | 先检索 active Documents,再按需读取全文 |
29
- | 记忆体 | 跨会话的长期事实、决策、实体与关系 | 受限 `spawn` worker 选择最窄空间并查重,通过 Mnemon `remember` / `link` 写入四图 | 只从已激活 Memory Spaces 按需召回 |
29
+ ## Start in five minutes
30
30
 
31
- ```text
32
- 当前任务产生的可复用信息
33
- |
34
- +-- 短小、稳定、每轮常用
35
- | 主 Agent / 合格的 fork 审查
36
- | |
37
- | add | replace | remove
38
- | v
39
- | memories.json(权威源)
40
- | |
41
- | USER.md + MEMORY.md ----------> 每轮 prompt
42
- |
43
- +-- 完整设计、调查、流程与交接
44
- | 主 Agent / 合格的 fork 审查
45
- | |
46
- | create | update
47
- | v
48
- | index.json + active/*.md ------> 检索后按需全文
49
- | |
50
- | Mnemon 冷引用 -> archived/*.md(容量整理)
51
- |
52
- `-- 跨会话事实、决策、实体与关系
53
- 主 Agent
54
- |
55
- spawn:选空间 / 查重 / 写入
56
- v
57
- Mnemon CLI -> <space>/mnemon.db
58
- |
59
- spawn:仅召回 active 空间 -------> 有界证据
60
- ```
61
-
62
- ## 核心能力
63
-
64
- - 主动记忆路由:内置 Prompt、生命周期提示与工具说明会启发 LLM 按需调用全部读写能力;用户明确要求回顾、记住、修改、忘记或建档时,会自动选择对应层级和操作。
65
- - 统一的 `global`、`workspace` 或 `custom` 存储范围,覆盖三层数据。
66
- - 多记忆体目录:每个记忆体拥有稳定 ID、名称、路由说明、激活状态和独立 `mnemon.db`。
67
- - 受限子 Agent:长期召回与语义写入使用隔离的 `spawn` worker;后台审查使用继承已完成 checkpoint 的 `fork` worker。
68
- - 可靠容量维护:USER 热记忆在本地保守合并,MEMORY 热记忆先归档再压缩,Documents 先建立冷索引再迁移;revision 冲突时保留原数据。
69
- - DSH 原生体验:模型工具、`/mnemon` 命令、双语 Web 工作台、全局明暗主题和诊断状态页。
70
- - 本地优先:CLI 以参数数组启动且禁用 shell;数据库和文档不需要远程记忆服务。
71
-
72
- ## 前置条件
73
-
74
- - 可用的 DSH Web profile。
75
- - 本地 `mnemon` CLI。
76
- - 支持 `outputSchema`、`toolFilter`、`persona` 和 `depthLimit` 的子 Agent provider。常规语义操作优先使用 `spawn`;默认后台审查还需要名为 `fork`、可继承父上下文的 provider。
77
-
78
- **兼容基线**:`dsh-mnemon` 0.1.0 已在 `@deepseek-ai/dsh` 0.1.0-rc.6(2026-08-13 快照)的 live web profile 上实测通过,最后验证日期 2026-08-14。插件不声明固定的最低版本矩阵;DSH 迭代快,升级前先在隔离 profile 或已备份的数据目录中复跑[快速开始](./docs/zh-CN/getting-started.md)的验证步骤。
79
-
80
- ## 快速开始
81
-
82
- 安装 Mnemon:
31
+ ### 1. Install Mnemon
83
32
 
84
33
  ```sh
85
34
  # macOS
86
35
  brew install --cask mnemon-dev/tap/mnemon
87
36
 
88
- # macOS / Linux,也可通过 Go 安装
37
+ # macOS / Linux via Go
89
38
  go install github.com/mnemon-dev/mnemon@latest
90
39
 
91
40
  mnemon --version
92
41
  ```
93
42
 
94
- 安装插件并重启 DSH Web profile:
43
+ ### 2. Install the plugin
95
44
 
96
45
  ```sh
97
46
  dsh plugin --profile web add dsh-mnemon
98
47
  dsh --profile web
99
48
  ```
100
49
 
101
- 未发布到 npm 的预发布版本可从 git 安装:
50
+ Use an absolute path for a local development checkout:
102
51
 
103
52
  ```sh
104
- dsh plugin --profile web add "github:omdsh-dev/dsh-mnemon"
53
+ dsh plugin --profile web add "link:/absolute/path/to/dsh-mnemon"
105
54
  ```
106
55
 
107
- 本地开发检出使用绝对路径:
56
+ ### 3. Open Memory System
108
57
 
109
- ```sh
110
- dsh plugin --profile web add "link:/absolute/path/to/dsh-mnemon"
111
- ```
58
+ New installations use `sidebar` by default. Click **Memory System** in the DSH sidebar, then follow this first-run path:
112
59
 
113
- 打开 DSH 的“设置 -> 记忆系统”独立配置页即可选择展示形态与存储范围。默认 `sidebar` 从左侧栏进入独立“记忆系统”工作台;切换为 `buildin` 则恢复原有的对话区内嵌标签页,保存后实时切换且不会重复挂载。`workspace` 范围下可在侧边栏工作台顶部独立切换要查看和维护的 DSH 工作区;Agent、工具和生命周期仍始终使用当前会话工作区。两者不一致时全局提示会同时显示查看目录和实际生效目录,并可一键对齐。存储根会在新目录初始化成功后原子切换,切换范围不会自动迁移、合并或删除旧数据。
60
+ 1. Confirm the Mnemon CLI, Runtime, Memory Spaces, and Documents are healthy under **Status**.
61
+ 2. Create a narrowly scoped Memory Space under **Memory Spaces → Overview**.
62
+ 3. Submit one stable, future-useful item through **Remember**.
63
+ 4. Verify it with a focused question under **Recall**.
64
+ 5. Return to the conversation and expand **Turn memory** below the answer.
114
65
 
115
- 升级与卸载(`dsh plugin` 转发给 profile 目录下的 pnpm):
66
+ See [Getting Started](./docs/en/getting-started.md) for provider requirements and complete verification.
116
67
 
117
- ```sh
118
- # 升级
119
- dsh plugin --profile web update dsh-mnemon
68
+ ## One workbench, three memory tiers
120
69
 
121
- # 卸载(同时从 profile 移除其 bundle 注册)
122
- dsh plugin --profile web remove dsh-mnemon
123
- ```
70
+ | Tier | Best for | How it reaches context |
71
+ |---|---|---|
72
+ | **Runtime** | User preferences, collaboration rules, project conventions, environment facts | Compact `USER.md` / `MEMORY.md` projections on every turn |
73
+ | **Documents** | Designs, investigations, procedures, postmortems, and handoffs | Deterministic search of active Documents, then full text on demand |
74
+ | **Memory Spaces** | Cross-session facts, decisions, entities, and relations | Bounded evidence recalled on demand from active spaces only |
124
75
 
125
- 卸载不会删除记忆数据:`global` 范围数据留在 `~/.mnemon`,`workspace` / `custom` 范围数据留在对应目录,重新安装后即可继续使用。若只想临时停用自动读写而不卸载,可在插件配置里关闭 `writebackMode` / `recallMode` / `lifecycleEnabled`;`tabEnabled=false` 可隐藏当前展示形态的 Web 入口(详见[配置参考](./docs/zh-CN/configuration.md))。
76
+ The tiers are not simple copies of the same content. Knowledge is routed by frequency, narrative length, and retrieval needs. See [Storage and the three-tier model](./docs/en/storage-model.md).
126
77
 
127
- ## 最小配置
78
+ ### Share long-term memory with other agents
128
79
 
129
- 配置位于 `$DSH_HOME/settings.yaml`(默认通常为 `~/.dsh/settings.yaml`):
80
+ Cross-agent sharing applies to the **Memory Spaces** backed by Mnemon. Another Mnemon-enabled agent can recall from or contribute to the same durable facts, entities, and relations when it targets the same `storageRoot` and Store. DSH-managed Runtime Memory and Project Documents are not automatically exposed to other agents.
130
81
 
131
- ```yaml
132
- mnemon:
133
- displayMode: sidebar # sidebar | buildin;默认 sidebar
134
- storageScope: global # global | workspace | custom
135
- ```
82
+ The default `global` scope uses `~/.mnemon`, making it the simplest shared memory root for local agents. `custom` and `workspace` roots can also be shared, but every participant must align its directory explicitly. A shared root is shared data: establish a trust boundary first, and avoid incompatible offline migration or directory operations while another process is using it.
83
+
84
+ ## Sidebar workbench
136
85
 
137
- - `global`:`MNEMON_DATA_DIR`,未设置时为 `~/.mnemon`。
138
- - `workspace`:每个 DSH 工作区各自根目录下的 `.mnemon`;Agent 执行跟随当前会话工作区,Web 工作台可独立选择查看目标。
139
- - `custom`:`dataDir` 指定的绝对路径或 `~/...` 路径。
86
+ | Page | Main purpose |
87
+ |---|---|
88
+ | **Status** | Inspect connection, storage root, tier summaries, and Mnemon / dsh-mnemon versions |
89
+ | **Runtime** | Inspect USER / MEMORY capacity; filter, add, edit, or remove hot memory |
90
+ | **Memory Spaces** | Manage activation; switch among Overview, Recall, Content, and Entities; open Remember |
91
+ | **Documents** | Search, read, create, edit, and archive managed Markdown documents |
140
92
 
141
- 完整配置、覆盖优先级和只读模式见[配置参考](./docs/zh-CN/configuration.md)。
93
+ Add and edit use consistent dialogs, destructive actions require confirmation, long collections expose filters and progressive loading, and Documents use a dedicated reader.
142
94
 
143
- ## 使用入口
95
+ ### Memory inside conversations
144
96
 
145
- Web 工作台提供状态、运行时、记忆体、档案、沉淀、检索、实体、内容八个页面,分为三组:「状态」独立成第一组;「运行时、记忆体、档案」对应三层存储;「沉淀、检索、实体、内容」为读写工具。主要界面随 DSH 全局语言在中文与英文间切换。
97
+ | Turn memory | Save to memory |
98
+ |---|---|
99
+ | [![Expanded Turn memory with exact tool links](./docs/assets/screenshots/conversation-turn-memory.png)](./docs/assets/screenshots/conversation-turn-memory.png) | [![Confirm save to memory dialog](./docs/assets/screenshots/conversation-save-dialog.png)](./docs/assets/screenshots/conversation-save-dialog.png) |
146
100
 
147
- 记忆也会在对话流中直接体现(对话内交互,**默认关闭**,可在「设置 → 记忆系统 → 对话界面」中逐项开启,保存即实时生效):
101
+ - **Turn memory** summarizes recalls, writes, and Document searches for the turn; expand it to jump to the matching page.
102
+ - **Save to memory** loads an editable candidate. Only confirmation sends it to the memory subagent for qualification, deduplication, distillation, and writing.
148
103
 
149
- - **记忆工具卡**:每个 `mnemon_*` 工具调用都以记忆风格的卡片呈现——召回显示查询与命中数、写入显示对象摘要,可展开查看参数与结构化结果,并可一键跳到记忆视图对应页面;
150
- - **回合记忆条**:完成的回合若触及记忆,回合尾会按成功结果区分召回、沉淀、档案检索和检查,并单独标出失败数;展开可见具体工具名;
151
- - **存入记忆**:每条已定稿的助手回复旁有「存入记忆」按钮,候选内容可编辑,提交后由隔离的记忆子 Agent 判断、查重并沉淀,不占用主对话上下文。
104
+ Both are on by default. Disable them independently under **Settings → Memory System → Conversation interface**; saved changes apply live.
152
105
 
153
- 常用命令:
106
+ ## Display and storage
107
+
108
+ Configuration lives in `$DSH_HOME/settings.yaml` (commonly `~/.dsh/settings.yaml`):
109
+
110
+ ```yaml
111
+ mnemon:
112
+ displayMode: sidebar # sidebar | buildin; sidebar by default
113
+ storageScope: global # global | workspace | custom
114
+ ```
115
+
116
+ | Choice | Behavior |
117
+ |---|---|
118
+ | `sidebar` | Default dedicated workbench aligned with official DSH panel styling |
119
+ | `buildin` | Preserves the original conversation-area presentation and visuals |
120
+ | `global` | Shares `~/.mnemon` (or `MNEMON_DATA_DIR`) across workspaces |
121
+ | `workspace` | Uses `<workspace>/.mnemon`; the workbench may inspect another workspace while the Agent still follows the current session |
122
+ | `custom` | Uses an absolute or `~/...` path supplied through `dataDir` |
123
+
124
+ Saved settings apply live without a manual refresh. Changing scope never migrates, merges, or deletes old data. If the inspected workspace differs from the session's effective workspace, the header explains the mismatch and offers one-click alignment.
125
+
126
+ ## Common commands
154
127
 
155
128
  ```text
156
129
  /mnemon status
157
- /mnemon recall <查询>
158
- /mnemon related <完整记忆 ID>
159
- /mnemon remember <稳定、自包含的长期洞察>
160
- /mnemon forget <完整记忆 ID>
130
+ /mnemon recall <query>
131
+ /mnemon related <full memory ID>
132
+ /mnemon remember <stable, self-contained durable insight>
133
+ /mnemon forget <full memory ID>
161
134
  ```
162
135
 
163
- 推荐的查询顺序是:热记忆 -> active Documents -> 已激活记忆体 -> 命中记录指向的归档原文。不要把临时进度、原始日志、秘密或可直接从仓库重新获得的普通事实写入长期记忆。
136
+ Recommended lookup order: Runtime Memory → active Documents → active Memory Spaces → archived original referenced by a hit.
137
+
138
+ ## Data and security boundaries
139
+
140
+ - The plugin reaches durable memory through the local `mnemon` CLI. The WebUI neither reads SQLite directly nor starts processes.
141
+ - CLI calls use argument arrays with shell disabled, bounded output, timeouts, and cancellation.
142
+ - The plugin stores no API keys. Subagent inference uses the provider already configured in DSH.
143
+ - There is no deterministic secret scanner yet. Never store keys, tokens, private keys, or raw sensitive logs in any tier.
144
+ - Uninstalling the plugin does not remove data under `~/.mnemon`, workspace `.mnemon` roots, or custom directories.
164
145
 
165
- ## 权限与数据
146
+ See [Operations, security, and troubleshooting](./docs/en/operations.md) for complete boundaries, backup, recovery, and diagnostics.
166
147
 
167
- - **文件**:通过本地 `mnemon` CLI 读写数据目录——`global` 范围是 `~/.mnemon`,`workspace` / `custom` 范围是用户指定的目录;插件不直接写这些目录,WebUI 也不直接读 SQLite。`sourcePaths` 不能逃出发起会话的工作区,也不能指向受管 Documents 目录。
168
- - **进程**:`mnemon` 以参数数组启动且禁用 shell,输出有上限,超时先 `SIGTERM` 再 `SIGKILL`。
169
- - **网络**:插件与 Mnemon 均本地运行,不发起远程调用;子 Agent 的模型推理走 DSH 已有的 provider 连接。
170
- - **凭据**:插件不存储、不读取任何凭据或 API key,模型凭据完全由 DSH 与 provider 管理。
171
- - **用户数据**:记忆内容(用户画像、项目档案、长期记忆)全部落在本地 SQLite / JSON,不会上传。
172
- - **诚实披露**:当前没有确定性的凭据/秘密检测器,请勿向热记忆、Documents 或 Memory Spaces 写入密钥、token 或私钥。完整边界(进程/文件/Web/模型)与备份恢复见[运维、安全与故障排查](./docs/zh-CN/operations.md)。
148
+ ## Documentation
173
149
 
174
- ## 文档
150
+ | I want to… | Start here |
151
+ |---|---|
152
+ | Install and complete first-run verification | [Getting Started](./docs/en/getting-started.md) |
153
+ | Learn every page and conversation entry | [Sidebar and conversation UI guide](./docs/en/ui-guide.md) |
154
+ | Understand the three tiers and complete flow | [Project overview](./docs/en/project-overview.md) · [Lifecycle and workflows](./docs/en/workflows.md) |
155
+ | Choose storage scope or advanced switches | [Configuration reference](./docs/en/configuration.md) |
156
+ | Back up, update, or troubleshoot | [Operations, security, and troubleshooting](./docs/en/operations.md) |
157
+ | Integrate tools, commands, or RPC | [Interface reference](./docs/en/interfaces.md) |
158
+ | Develop, test, or publish | [Development and verification](./docs/en/development.md) |
175
159
 
176
- - [文档中心](./docs/zh-CN/README.md)
177
- - [项目介绍](./docs/zh-CN/project-overview.md)
178
- - [快速开始](./docs/zh-CN/getting-started.md)
179
- - [架构设计](./docs/zh-CN/architecture.md)
180
- - [存储与三层记忆模型](./docs/zh-CN/storage-model.md)
181
- - [生命周期与核心流程](./docs/zh-CN/workflows.md)
182
- - [配置参考](./docs/zh-CN/configuration.md)
183
- - [WebUI、工具、命令与 RPC](./docs/zh-CN/interfaces.md)
184
- - [运维、安全与故障排查](./docs/zh-CN/operations.md)
185
- - [开发与验证](./docs/zh-CN/development.md)
186
- - [Roadmap](./docs/zh-CN/roadmap.md)
160
+ See the [documentation hub](./docs/en/README.md) for the full map.
187
161
 
188
- ## 开发
162
+ ## Development
189
163
 
190
164
  ```sh
191
165
  pnpm install
192
166
  pnpm run verify
193
167
  ```
194
168
 
195
- `verify` 依次运行 TypeScript 检查、Vitest 测试和生产构建。构建产物写入并提交到 `lib/`;详细发布与真实 WebUI 验证流程见[开发文档](./docs/zh-CN/development.md)。
169
+ `verify` runs TypeScript checks, Vitest, and the production build. Generated artifacts are committed under `lib/`.
196
170
 
197
171
  ## License
198
172
 
199
- MIT。发现安全问题请通过 [SECURITY.md](./SECURITY.md) 中的渠道私下报告,不要直接开公开 issue。
173
+ MIT. Report security issues privately through [SECURITY.md](./SECURITY.md), not a public issue.
@@ -0,0 +1,173 @@
1
+ <h1 align="center">dsh-mnemon</h1>
2
+
3
+ <p align="center"><a href="./README.md">English</a> · <strong>简体中文</strong></p>
4
+
5
+ <p align="center">
6
+ <a href="./docs/zh-CN/ui-guide.md">
7
+ <img src="./docs/assets/media/dsh-mnemon-memory-system-demo-poster.jpg" alt="dsh-mnemon Sidebar 记忆系统:记忆体目录与关系图" width="760">
8
+ </a>
9
+ </p>
10
+
11
+ <p align="center"><strong>让 DeepSeek Harness 拥有可跨 Agent 共享的本地、分层、可监督长期记忆。</strong></p>
12
+
13
+ `dsh-mnemon` 将 [Mnemon](https://github.com/mnemon-dev/mnemon) 接入 DeepSeek Harness(DSH),并把每轮需要的热记忆、需要完整阅读的项目档案和按需召回的长期记忆体组织在同一个工作台中。其他 Agent 只要同样接入 Mnemon,并使用同一套可访问的本地 Mnemon 存储,就可以与 DSH 共享长期记忆。
14
+
15
+ - **本地优先**:记忆保存在本机 SQLite、JSON 与 Markdown 中,不依赖远程记忆服务。
16
+ - **跨 Agent 共享**:DSH 的 Mnemon 记忆体可以被其他支持 Mnemon 的 Agent 读取和复用。
17
+ - **三层协作**:运行时记忆、项目档案、记忆体各自保存适合自己的信息粒度。
18
+ - **受监督写入**:语义判断交给隔离的记忆子 Agent,路径、权限、容量、锁与 revision 由 Host 控制。
19
+ - **DSH 原生体验**:默认 Sidebar 工作台、对话内回合记忆、存入记忆弹窗、双语界面与明暗主题。
20
+
21
+ 当前用户指令、仓库文件与实时工具结果始终高于历史记忆。
22
+
23
+ ## 实机演示
24
+
25
+ ![dsh-mnemon Sidebar 记忆系统与对话内交互演示](./docs/assets/media/dsh-mnemon-memory-system-demo.gif)
26
+
27
+ 完整逐页说明见 [Sidebar 与对话交互指南](./docs/zh-CN/ui-guide.md)。
28
+
29
+ ## 5 分钟开始使用
30
+
31
+ ### 1. 安装 Mnemon
32
+
33
+ ```sh
34
+ # macOS
35
+ brew install --cask mnemon-dev/tap/mnemon
36
+
37
+ # macOS / Linux,也可以通过 Go 安装
38
+ go install github.com/mnemon-dev/mnemon@latest
39
+
40
+ mnemon --version
41
+ ```
42
+
43
+ ### 2. 安装插件
44
+
45
+ ```sh
46
+ dsh plugin --profile web add dsh-mnemon
47
+ dsh --profile web
48
+ ```
49
+
50
+ 本地开发检出使用绝对路径:
51
+
52
+ ```sh
53
+ dsh plugin --profile web add "link:/absolute/path/to/dsh-mnemon"
54
+ ```
55
+
56
+ ### 3. 打开记忆系统
57
+
58
+ 安装后默认使用 `sidebar`:点击 DSH 左侧栏的“记忆系统”即可进入。第一次使用建议按以下顺序:
59
+
60
+ 1. 在“状态”确认 Mnemon CLI、运行时、记忆体与档案均正常;
61
+ 2. 在“记忆体 → 概览”创建一个边界明确的记忆体;
62
+ 3. 用“沉淀记忆”提交一条稳定、未来仍有用的信息;
63
+ 4. 在“检索”用一个聚焦问题验证召回;
64
+ 5. 回到对话,展开回复下方的“本回合记忆”查看工具轨迹。
65
+
66
+ 更完整的安装、Provider 要求与验证步骤见[快速开始](./docs/zh-CN/getting-started.md)。
67
+
68
+ ## 一个工作台,三层记忆
69
+
70
+ | 层级 | 适合保存 | 如何进入上下文 |
71
+ |---|---|---|
72
+ | **运行时** | 用户偏好、协作要求、项目约定、环境事实 | `USER.md` / `MEMORY.md` 每轮紧凑注入 |
73
+ | **档案** | 设计、调查、流程、复盘、交接材料 | 先确定性检索 active Documents,再按需阅读全文 |
74
+ | **记忆体** | 跨会话事实、决策、实体与关系 | 只从已激活 Memory Spaces 按需召回有界证据 |
75
+
76
+ 三层不是同一内容的简单复制:信息会按使用频率、叙事长度和召回方式进入最合适的层级。完整规则见[存储与三层记忆模型](./docs/zh-CN/storage-model.md)。
77
+
78
+ ### 与其他 Agent 共享长期记忆
79
+
80
+ 跨 Agent 共享发生在 Mnemon 提供的**记忆体**层。其他支持 Mnemon 的 Agent 指向相同的 `storageRoot` 和 Store 后,可以召回或继续沉淀同一批长期事实、实体与关系。DSH 专有的运行时记忆和项目档案不会因此自动暴露给其他 Agent。
81
+
82
+ 默认 `global` 模式使用 `~/.mnemon`,最适合作为本机 Agent 之间的共享记忆根;`custom` 和 `workspace` 也可以共享,但所有参与方必须显式对齐目录。共享同一目录意味着共享同一份数据,请先确认信任边界,并避免并发执行不兼容的离线迁移或目录操作。
83
+
84
+ ## Sidebar 工作台
85
+
86
+ | 页面 | 主要用途 |
87
+ |---|---|
88
+ | **状态** | 检查连接、存储根、三层数据摘要,以及 Mnemon / dsh-mnemon 版本 |
89
+ | **运行时** | 查看 USER / MEMORY 容量,筛选、添加、编辑或移除热记忆 |
90
+ | **记忆体** | 管理激活边界;在概览、检索、内容、实体之间切换;打开“沉淀记忆” |
91
+ | **档案** | 搜索、阅读、新建、编辑与归档受管 Markdown 文档 |
92
+
93
+ 添加与编辑使用统一弹窗;危险操作需要二次确认;长列表采用筛选、计数与“加载更多”,档案正文使用独立阅读区域。
94
+
95
+ ### 对话内记忆
96
+
97
+ | 本回合记忆 | 存入记忆 |
98
+ |---|---|
99
+ | [![展开本回合记忆并查看工具入口](./docs/assets/screenshots/conversation-turn-memory.png)](./docs/assets/screenshots/conversation-turn-memory.png) | [![确认存入记忆弹窗](./docs/assets/screenshots/conversation-save-dialog.png)](./docs/assets/screenshots/conversation-save-dialog.png) |
100
+
101
+ - **本回合记忆**汇总本轮的召回、沉淀与档案检索;展开后可以跳到对应页面。
102
+ - **存入记忆**先加载可编辑候选,只有确认后才交给记忆子 Agent 判断、查重、提炼并写入。
103
+
104
+ 这两个入口默认开启,可在“设置 → 记忆系统 → 对话界面”中分别关闭,保存后实时生效。
105
+
106
+ ## 展示与存储
107
+
108
+ 配置位于 `$DSH_HOME/settings.yaml`(通常为 `~/.dsh/settings.yaml`):
109
+
110
+ ```yaml
111
+ mnemon:
112
+ displayMode: sidebar # sidebar | buildin;默认 sidebar
113
+ storageScope: global # global | workspace | custom
114
+ ```
115
+
116
+ | 选择 | 行为 |
117
+ |---|---|
118
+ | `sidebar` | 默认;左侧栏独立工作台,采用与 DSH 官方面板一致的极简外观 |
119
+ | `buildin` | 保留原有对话区内嵌形态及其既有视觉 |
120
+ | `global` | 多个工作区共享 `~/.mnemon`(或 `MNEMON_DATA_DIR`) |
121
+ | `workspace` | 每个工作区使用自己的 `<workspace>/.mnemon`;工作台可查看其他工作区,Agent 仍跟随当前会话 |
122
+ | `custom` | 使用 `dataDir` 指定的绝对路径或 `~/...` |
123
+
124
+ 设置保存后实时生效,无需手动刷新。切换存储范围不会自动迁移、合并或删除旧数据;工作区查看目标与会话实际目录不一致时,顶部会提示并提供一键对齐。
125
+
126
+ ## 常用命令
127
+
128
+ ```text
129
+ /mnemon status
130
+ /mnemon recall <查询>
131
+ /mnemon related <完整记忆 ID>
132
+ /mnemon remember <稳定、自包含的长期洞察>
133
+ /mnemon forget <完整记忆 ID>
134
+ ```
135
+
136
+ 推荐查询顺序:运行时热记忆 → active Documents → 已激活记忆体 → 命中记录指向的归档原文。
137
+
138
+ ## 数据与安全边界
139
+
140
+ - 插件通过本地 `mnemon` CLI 访问长期记忆;WebUI 不直接读取 SQLite,也不直接启动进程。
141
+ - CLI 使用参数数组且禁用 shell;输出、超时和取消均有边界。
142
+ - 插件不保存 API key;子 Agent 推理复用 DSH 已配置的 Provider。
143
+ - 当前没有确定性的秘密扫描器。不要把密钥、token、私钥或原始敏感日志写入任何记忆层。
144
+ - 卸载插件不会删除 `~/.mnemon`、工作区 `.mnemon` 或自定义目录中的数据。
145
+
146
+ 完整边界、备份恢复与故障排查见[运维指南](./docs/zh-CN/operations.md)。
147
+
148
+ ## 文档
149
+
150
+ | 我想要…… | 从这里开始 |
151
+ |---|---|
152
+ | 安装并完成第一次验证 | [快速开始](./docs/zh-CN/getting-started.md) |
153
+ | 认识每个页面与对话内入口 | [Sidebar 与对话交互指南](./docs/zh-CN/ui-guide.md) |
154
+ | 理解三层模型和完整流转 | [项目介绍](./docs/zh-CN/project-overview.md) · [生命周期与核心流程](./docs/zh-CN/workflows.md) |
155
+ | 选择存储范围或高级开关 | [配置参考](./docs/zh-CN/configuration.md) |
156
+ | 备份、更新或排查问题 | [运维、安全与故障排查](./docs/zh-CN/operations.md) |
157
+ | 集成工具、命令或 RPC | [接口参考](./docs/zh-CN/interfaces.md) |
158
+ | 开发、测试或发布 | [开发与验证](./docs/zh-CN/development.md) |
159
+
160
+ 完整目录见[文档中心](./docs/zh-CN/README.md)。
161
+
162
+ ## 开发
163
+
164
+ ```sh
165
+ pnpm install
166
+ pnpm run verify
167
+ ```
168
+
169
+ `verify` 依次运行 TypeScript 检查、Vitest 和生产构建。构建产物提交在 `lib/` 中。
170
+
171
+ ## License
172
+
173
+ MIT。安全问题请按 [SECURITY.md](./SECURITY.md) 私下报告,不要直接创建公开 issue。
package/SECURITY.md CHANGED
@@ -8,7 +8,7 @@
8
8
  |---|---|
9
9
  | 0.1.x (npm `dsh-mnemon`) | ✅ |
10
10
 
11
- Only the latest published version receives security fixes. The plugin targets the DSH mainline snapshot it was verified against; see the compatibility baseline in [README.en.md](./README.en.md).
11
+ Only the latest published version receives security fixes. The plugin targets the DSH mainline snapshot it was verified against; see the compatibility baseline in [README.md](./README.md).
12
12
 
13
13
  ## Reporting a vulnerability
14
14
 
@@ -61,7 +61,7 @@ Out of scope:
61
61
  |---|---|
62
62
  | 0.1.x(npm `dsh-mnemon`) | ✅ |
63
63
 
64
- 仅最新发布版本获得安全修复。插件以验证时的 DSH mainline 快照为兼容基线,见 [README.md](./README.md)。
64
+ 仅最新发布版本获得安全修复。插件以验证时的 DSH mainline 快照为兼容基线,见 [README.zh-CN.md](./README.zh-CN.md)。
65
65
 
66
66
  ### 报告漏洞
67
67
 
package/docs/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # dsh-mnemon 文档 / Documentation
1
+ # dsh-mnemon Documentation / 文档
2
2
 
3
- - [简体中文](./zh-CN/README.md)
4
3
  - [English](./en/README.md)
5
-
6
- 根目录 README 只保留项目概览和快速开始;架构、数据模型、生命周期、接口、运维和开发细节在此维护。
4
+ - [简体中文](./zh-CN/README.md)
7
5
 
8
6
  The root README stays focused on orientation and quick start. Architecture, data model, lifecycle, interfaces, operations, and development details live here.
7
+
8
+ 根目录 README 只保留项目概览和快速开始;架构、数据模型、生命周期、接口、运维和开发细节在此维护。