dsh-mnemon 0.1.0 → 0.1.2

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 (148) hide show
  1. package/README.en.md +33 -3
  2. package/README.md +33 -3
  3. package/SECURITY.md +89 -0
  4. package/cordis.patch.yml +1 -0
  5. package/docs/en/README.md +1 -0
  6. package/docs/en/configuration.md +17 -7
  7. package/docs/en/getting-started.md +23 -5
  8. package/docs/en/interfaces.md +17 -3
  9. package/docs/en/operations.md +9 -4
  10. package/docs/en/project-overview.md +3 -1
  11. package/docs/en/roadmap.md +1 -1
  12. package/docs/en/storage-model.md +1 -1
  13. package/docs/zh-CN/README.md +1 -0
  14. package/docs/zh-CN/configuration.md +17 -7
  15. package/docs/zh-CN/getting-started.md +23 -5
  16. package/docs/zh-CN/interfaces.md +17 -3
  17. package/docs/zh-CN/operations.md +9 -4
  18. package/docs/zh-CN/project-overview.md +3 -1
  19. package/docs/zh-CN/roadmap.md +1 -1
  20. package/docs/zh-CN/storage-model.md +1 -1
  21. package/lib/client.js +2545 -620
  22. package/lib/client.js.map +1 -1
  23. package/lib/index.js +3816 -2481
  24. package/lib/types/activity.d.ts +32 -0
  25. package/lib/types/activity.d.ts.map +1 -0
  26. package/lib/types/activity.js +93 -0
  27. package/lib/types/activity.js.map +1 -0
  28. package/lib/types/client/MnemonPackSection.d.ts +11 -0
  29. package/lib/types/client/MnemonPackSection.d.ts.map +1 -0
  30. package/lib/types/client/MnemonPackSection.js +136 -0
  31. package/lib/types/client/MnemonPackSection.js.map +1 -0
  32. package/lib/types/client/MnemonSaveAction.d.ts +13 -0
  33. package/lib/types/client/MnemonSaveAction.d.ts.map +1 -0
  34. package/lib/types/client/MnemonSaveAction.js +141 -0
  35. package/lib/types/client/MnemonSaveAction.js.map +1 -0
  36. package/lib/types/client/MnemonSettingsCard.d.ts +9 -3
  37. package/lib/types/client/MnemonSettingsCard.d.ts.map +1 -1
  38. package/lib/types/client/MnemonSettingsCard.js +98 -51
  39. package/lib/types/client/MnemonSettingsCard.js.map +1 -1
  40. package/lib/types/client/MnemonToolviews.d.ts +19 -0
  41. package/lib/types/client/MnemonToolviews.d.ts.map +1 -0
  42. package/lib/types/client/MnemonToolviews.js +172 -0
  43. package/lib/types/client/MnemonToolviews.js.map +1 -0
  44. package/lib/types/client/MnemonTurnTail.d.ts +18 -0
  45. package/lib/types/client/MnemonTurnTail.d.ts.map +1 -0
  46. package/lib/types/client/MnemonTurnTail.js +44 -0
  47. package/lib/types/client/MnemonTurnTail.js.map +1 -0
  48. package/lib/types/client/MnemonView.d.ts +13 -0
  49. package/lib/types/client/MnemonView.d.ts.map +1 -1
  50. package/lib/types/client/MnemonView.js +33 -14
  51. package/lib/types/client/MnemonView.js.map +1 -1
  52. package/lib/types/client/anchor.d.ts +28 -0
  53. package/lib/types/client/anchor.d.ts.map +1 -0
  54. package/lib/types/client/anchor.js +46 -0
  55. package/lib/types/client/anchor.js.map +1 -0
  56. package/lib/types/client/api.d.ts +17 -2
  57. package/lib/types/client/api.d.ts.map +1 -1
  58. package/lib/types/client/api.js +86 -25
  59. package/lib/types/client/api.js.map +1 -1
  60. package/lib/types/client/dsh-compat.d.ts +21 -0
  61. package/lib/types/client/dsh-compat.d.ts.map +1 -0
  62. package/lib/types/client/dsh-compat.js +2 -0
  63. package/lib/types/client/dsh-compat.js.map +1 -0
  64. package/lib/types/client/index.d.ts +1 -1
  65. package/lib/types/client/index.d.ts.map +1 -1
  66. package/lib/types/client/index.js +140 -12
  67. package/lib/types/client/index.js.map +1 -1
  68. package/lib/types/client/locales.d.ts +272 -4
  69. package/lib/types/client/locales.d.ts.map +1 -1
  70. package/lib/types/client/locales.js +292 -24
  71. package/lib/types/client/locales.js.map +1 -1
  72. package/lib/types/client/settings.d.ts +10 -5
  73. package/lib/types/client/settings.d.ts.map +1 -1
  74. package/lib/types/client/settings.js +32 -11
  75. package/lib/types/client/settings.js.map +1 -1
  76. package/lib/types/client/sidebar-entry.d.ts +6 -0
  77. package/lib/types/client/sidebar-entry.d.ts.map +1 -0
  78. package/lib/types/client/sidebar-entry.js +132 -0
  79. package/lib/types/client/sidebar-entry.js.map +1 -0
  80. package/lib/types/client/workspace-controller.d.ts +15 -0
  81. package/lib/types/client/workspace-controller.d.ts.map +1 -0
  82. package/lib/types/client/workspace-controller.js +21 -0
  83. package/lib/types/client/workspace-controller.js.map +1 -0
  84. package/lib/types/client/workspace-mount.d.ts +8 -0
  85. package/lib/types/client/workspace-mount.d.ts.map +1 -0
  86. package/lib/types/client/workspace-mount.js +135 -0
  87. package/lib/types/client/workspace-mount.js.map +1 -0
  88. package/lib/types/commands.d.ts +10 -2
  89. package/lib/types/commands.d.ts.map +1 -1
  90. package/lib/types/commands.js +5 -1
  91. package/lib/types/commands.js.map +1 -1
  92. package/lib/types/config.d.ts +42 -3
  93. package/lib/types/config.d.ts.map +1 -1
  94. package/lib/types/config.js +80 -6
  95. package/lib/types/config.js.map +1 -1
  96. package/lib/types/contracts.d.ts +27 -37
  97. package/lib/types/contracts.d.ts.map +1 -1
  98. package/lib/types/documents.d.ts.map +1 -1
  99. package/lib/types/documents.js +6 -14
  100. package/lib/types/documents.js.map +1 -1
  101. package/lib/types/guidance.d.ts +5 -2
  102. package/lib/types/guidance.d.ts.map +1 -1
  103. package/lib/types/guidance.js +18 -2
  104. package/lib/types/guidance.js.map +1 -1
  105. package/lib/types/index.d.ts +4 -2
  106. package/lib/types/index.d.ts.map +1 -1
  107. package/lib/types/index.js +29 -20
  108. package/lib/types/index.js.map +1 -1
  109. package/lib/types/lifecycle.d.ts +23 -3
  110. package/lib/types/lifecycle.d.ts.map +1 -1
  111. package/lib/types/lifecycle.js +89 -13
  112. package/lib/types/lifecycle.js.map +1 -1
  113. package/lib/types/live-runtime.d.ts +66 -0
  114. package/lib/types/live-runtime.d.ts.map +1 -0
  115. package/lib/types/live-runtime.js +146 -0
  116. package/lib/types/live-runtime.js.map +1 -0
  117. package/lib/types/memory-bodies.d.ts +2 -0
  118. package/lib/types/memory-bodies.d.ts.map +1 -1
  119. package/lib/types/memory-bodies.js +29 -10
  120. package/lib/types/memory-bodies.js.map +1 -1
  121. package/lib/types/pack.d.ts +74 -0
  122. package/lib/types/pack.d.ts.map +1 -0
  123. package/lib/types/pack.js +709 -0
  124. package/lib/types/pack.js.map +1 -0
  125. package/lib/types/rpc.d.ts +10 -3
  126. package/lib/types/rpc.d.ts.map +1 -1
  127. package/lib/types/rpc.js +158 -19
  128. package/lib/types/rpc.js.map +1 -1
  129. package/lib/types/runner.d.ts +3 -1
  130. package/lib/types/runner.d.ts.map +1 -1
  131. package/lib/types/runner.js +7 -2
  132. package/lib/types/runner.js.map +1 -1
  133. package/lib/types/service.d.ts +16 -0
  134. package/lib/types/service.d.ts.map +1 -1
  135. package/lib/types/service.js.map +1 -1
  136. package/lib/types/settings.d.ts +1 -0
  137. package/lib/types/settings.d.ts.map +1 -1
  138. package/lib/types/settings.js +45 -16
  139. package/lib/types/settings.js.map +1 -1
  140. package/lib/types/subagent.d.ts +11 -2
  141. package/lib/types/subagent.d.ts.map +1 -1
  142. package/lib/types/subagent.js +34 -29
  143. package/lib/types/subagent.js.map +1 -1
  144. package/lib/types/tools.d.ts +11 -1
  145. package/lib/types/tools.d.ts.map +1 -1
  146. package/lib/types/tools.js +29 -16
  147. package/lib/types/tools.js.map +1 -1
  148. package/package.json +23 -12
package/README.en.md CHANGED
@@ -75,6 +75,8 @@ Reusable knowledge produced by current work
75
75
  - A local `mnemon` CLI.
76
76
  - A subagent provider supporting `outputSchema`, `toolFilter`, `persona`, and `depthLimit`. Regular semantic work prefers `spawn`; the default background review also requires a provider named `fork` that inherits parent context.
77
77
 
78
+ **Compatibility baseline**: `dsh-mnemon` 0.1.0 has been verified end-to-end on a live web profile running `@deepseek-ai/dsh` 0.1.0-rc.6 (2026-08-13 snapshot); last verified 2026-08-14. The plugin declares no fixed minimum-version matrix. DSH moves fast: before upgrading, re-run the [Getting Started](./docs/en/getting-started.md) verification steps in an isolated profile or a backed-up data directory.
79
+
78
80
  ## Quick start
79
81
 
80
82
  Install Mnemon:
@@ -108,7 +110,19 @@ For a local checkout, use an absolute path:
108
110
  dsh plugin --profile web add "link:/absolute/path/to/dsh-mnemon"
109
111
  ```
110
112
 
111
- Open “Settings -> Plugin Configuration -> Mnemon” to select a storage scope, then create or activate a Memory Space in the conversation's “Memory System” tab. Configuration applies after restart. Changing the scope never migrates, merges, or deletes old data automatically.
113
+ Open the dedicated “Settings -> Memory System” page to choose both a display mode and storage scope. The default `sidebar` mode opens a dedicated “Memory System” workbench from the sidebar; switching to `buildin` restores the original conversation-area tab. Saving switches live without mounting duplicate entries. Under the `workspace` scope, the sidebar workbench selector independently chooses which DSH workspace to inspect and maintain; agents, tools, and lifecycle hooks always continue to use the current session workspace. A global banner shows both paths when they diverge and aligns them with one click. The storage root switches atomically after the new directory initializes successfully, and changing the scope never migrates, merges, or deletes old data automatically.
114
+
115
+ Upgrade and uninstall (`dsh plugin` forwards to pnpm inside the profile directory):
116
+
117
+ ```sh
118
+ # Upgrade
119
+ dsh plugin --profile web update dsh-mnemon
120
+
121
+ # Uninstall (also removes its bundle registration from the profile)
122
+ dsh plugin --profile web remove dsh-mnemon
123
+ ```
124
+
125
+ Uninstalling never deletes memory data: `global` data stays in `~/.mnemon`, and `workspace` / `custom` data stays in their directories, so reinstalling picks up where you left off. To pause automatic reads/writes without uninstalling, turn off `writebackMode` / `recallMode` / `lifecycleEnabled`; set `tabEnabled=false` to hide the currently selected Web entry (see the [configuration reference](./docs/en/configuration.md)).
112
126
 
113
127
  ## Minimal configuration
114
128
 
@@ -116,11 +130,12 @@ Configuration lives in `$DSH_HOME/settings.yaml` (commonly `~/.dsh/settings.yaml
116
130
 
117
131
  ```yaml
118
132
  mnemon:
133
+ displayMode: sidebar # sidebar | buildin; sidebar by default
119
134
  storageScope: global # global | workspace | custom
120
135
  ```
121
136
 
122
137
  - `global`: `MNEMON_DATA_DIR`, or `~/.mnemon` when unset.
123
- - `workspace`: `.mnemon` under the DSH Host launch directory.
138
+ - `workspace`: `.mnemon` under each DSH workspace root; Agent execution follows the current session workspace while the Web workbench may inspect another target.
124
139
  - `custom`: an absolute or `~/...` path supplied through `dataDir`.
125
140
 
126
141
  See the [configuration reference](./docs/en/configuration.md) for every option, precedence rules, and read-only mode.
@@ -129,6 +144,12 @@ See the [configuration reference](./docs/en/configuration.md) for every option,
129
144
 
130
145
  The Web workspace contains Status, Runtime, Memory Spaces, Documents, Distill, Recall, Entities, and Content pages in three divider-separated groups: “Status” stands alone; “Runtime, Memory Spaces, Documents” cover the three storage tiers; “Distill, Recall, Entities, Content” are the read/write tools. Its main interface follows DSH's global Chinese/English locale.
131
146
 
147
+ Memory also surfaces inside the conversation flow (conversation interface, **off by default**; enable each surface under Settings → Memory System → Conversation interface — changes apply live on save):
148
+
149
+ - **Memory tool cards**: every `mnemon_*` tool call renders as a memory-flavoured card — recalls show the query and hit count, writes show the subject summary — expandable to the raw arguments and structured result, with a one-click jump to the matching Memory view page;
150
+ - **Turn memory bar**: completed calls are separated into successful recalls, writes, document searches, and inspections, with failures reported independently; expand it for the exact tool names;
151
+ - **Save to memory**: every finalized assistant reply carries a “Save to memory” action; the candidate is editable, and submission routes through the isolated memory subagent (judgment, dedupe, distillation) without filling the main conversation context.
152
+
132
153
  Common commands:
133
154
 
134
155
  ```text
@@ -141,6 +162,15 @@ Common commands:
141
162
 
142
163
  The recommended lookup order is: hot memory -> active Documents -> active Memory Spaces -> the archived original referenced by a hit. Do not persist temporary progress, raw logs, secrets, or ordinary facts that can be recovered directly from the repository.
143
164
 
165
+ ## Permissions & data
166
+
167
+ - **Files**: reads/writes data directories through the local `mnemon` CLI — `~/.mnemon` for the `global` scope, a user-chosen directory for `workspace` / `custom`. The plugin never writes those directories directly, and the WebUI never reads SQLite directly. `sourcePaths` cannot escape the originating session workspace or point into the managed Documents directory.
168
+ - **Processes**: `mnemon` is started as an argument array with shell disabled, bounded output, and `SIGTERM` then `SIGKILL` on timeout.
169
+ - **Network**: the plugin and Mnemon both run locally and make no remote calls; subagent model inference uses DSH's existing provider connection.
170
+ - **Credentials**: the plugin stores and reads no credentials or API keys; model credentials are fully managed by DSH and your provider.
171
+ - **User data**: all memory content (user profile, project Documents, long-term memory) stays in local SQLite / JSON and is never uploaded.
172
+ - **Honest disclosure**: there is no deterministic credential/secret scanner yet — do not write keys, tokens, or private keys into hot memory, Documents, or Memory Spaces. For the full boundaries (process/file/Web/model) and backup/restore, see [Operations, security, and troubleshooting](./docs/en/operations.md).
173
+
144
174
  ## Documentation
145
175
 
146
176
  - [Documentation hub](./docs/en/README.md)
@@ -166,4 +196,4 @@ pnpm run verify
166
196
 
167
197
  ## License
168
198
 
169
- MIT.
199
+ MIT. For security issues, please report privately through the channels in [SECURITY.md](./SECURITY.md) instead of opening a public issue.
package/README.md CHANGED
@@ -75,6 +75,8 @@
75
75
  - 本地 `mnemon` CLI。
76
76
  - 支持 `outputSchema`、`toolFilter`、`persona` 和 `depthLimit` 的子 Agent provider。常规语义操作优先使用 `spawn`;默认后台审查还需要名为 `fork`、可继承父上下文的 provider。
77
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
+
78
80
  ## 快速开始
79
81
 
80
82
  安装 Mnemon:
@@ -108,7 +110,19 @@ dsh plugin --profile web add "github:omdsh-dev/dsh-mnemon"
108
110
  dsh plugin --profile web add "link:/absolute/path/to/dsh-mnemon"
109
111
  ```
110
112
 
111
- 打开 DSH 的“设置 -> 插件配置 -> Mnemon”选择存储范围,再进入会话的“记忆系统”Tab 创建或激活记忆体。配置重启后生效;切换范围不会自动迁移、合并或删除旧数据。
113
+ 打开 DSH 的“设置 -> 记忆系统”独立配置页即可选择展示形态与存储范围。默认 `sidebar` 从左侧栏进入独立“记忆系统”工作台;切换为 `buildin` 则恢复原有的对话区内嵌标签页,保存后实时切换且不会重复挂载。`workspace` 范围下可在侧边栏工作台顶部独立切换要查看和维护的 DSH 工作区;Agent、工具和生命周期仍始终使用当前会话工作区。两者不一致时全局提示会同时显示查看目录和实际生效目录,并可一键对齐。存储根会在新目录初始化成功后原子切换,切换范围不会自动迁移、合并或删除旧数据。
114
+
115
+ 升级与卸载(`dsh plugin` 转发给 profile 目录下的 pnpm):
116
+
117
+ ```sh
118
+ # 升级
119
+ dsh plugin --profile web update dsh-mnemon
120
+
121
+ # 卸载(同时从 profile 移除其 bundle 注册)
122
+ dsh plugin --profile web remove dsh-mnemon
123
+ ```
124
+
125
+ 卸载不会删除记忆数据:`global` 范围数据留在 `~/.mnemon`,`workspace` / `custom` 范围数据留在对应目录,重新安装后即可继续使用。若只想临时停用自动读写而不卸载,可在插件配置里关闭 `writebackMode` / `recallMode` / `lifecycleEnabled`;`tabEnabled=false` 可隐藏当前展示形态的 Web 入口(详见[配置参考](./docs/zh-CN/configuration.md))。
112
126
 
113
127
  ## 最小配置
114
128
 
@@ -116,11 +130,12 @@ dsh plugin --profile web add "link:/absolute/path/to/dsh-mnemon"
116
130
 
117
131
  ```yaml
118
132
  mnemon:
133
+ displayMode: sidebar # sidebar | buildin;默认 sidebar
119
134
  storageScope: global # global | workspace | custom
120
135
  ```
121
136
 
122
137
  - `global`:`MNEMON_DATA_DIR`,未设置时为 `~/.mnemon`。
123
- - `workspace`:启动 DSH Host 时工作目录下的 `.mnemon`。
138
+ - `workspace`:每个 DSH 工作区各自根目录下的 `.mnemon`;Agent 执行跟随当前会话工作区,Web 工作台可独立选择查看目标。
124
139
  - `custom`:`dataDir` 指定的绝对路径或 `~/...` 路径。
125
140
 
126
141
  完整配置、覆盖优先级和只读模式见[配置参考](./docs/zh-CN/configuration.md)。
@@ -129,6 +144,12 @@ mnemon:
129
144
 
130
145
  Web 工作台提供状态、运行时、记忆体、档案、沉淀、检索、实体、内容八个页面,分为三组:「状态」独立成第一组;「运行时、记忆体、档案」对应三层存储;「沉淀、检索、实体、内容」为读写工具。主要界面随 DSH 全局语言在中文与英文间切换。
131
146
 
147
+ 记忆也会在对话流中直接体现(对话内交互,**默认关闭**,可在「设置 → 记忆系统 → 对话界面」中逐项开启,保存即实时生效):
148
+
149
+ - **记忆工具卡**:每个 `mnemon_*` 工具调用都以记忆风格的卡片呈现——召回显示查询与命中数、写入显示对象摘要,可展开查看参数与结构化结果,并可一键跳到记忆视图对应页面;
150
+ - **回合记忆条**:完成的回合若触及记忆,回合尾会按成功结果区分召回、沉淀、档案检索和检查,并单独标出失败数;展开可见具体工具名;
151
+ - **存入记忆**:每条已定稿的助手回复旁有「存入记忆」按钮,候选内容可编辑,提交后由隔离的记忆子 Agent 判断、查重并沉淀,不占用主对话上下文。
152
+
132
153
  常用命令:
133
154
 
134
155
  ```text
@@ -141,6 +162,15 @@ Web 工作台提供状态、运行时、记忆体、档案、沉淀、检索、
141
162
 
142
163
  推荐的查询顺序是:热记忆 -> active Documents -> 已激活记忆体 -> 命中记录指向的归档原文。不要把临时进度、原始日志、秘密或可直接从仓库重新获得的普通事实写入长期记忆。
143
164
 
165
+ ## 权限与数据
166
+
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)。
173
+
144
174
  ## 文档
145
175
 
146
176
  - [文档中心](./docs/zh-CN/README.md)
@@ -166,4 +196,4 @@ pnpm run verify
166
196
 
167
197
  ## License
168
198
 
169
- MIT。
199
+ MIT。发现安全问题请通过 [SECURITY.md](./SECURITY.md) 中的渠道私下报告,不要直接开公开 issue。
package/SECURITY.md ADDED
@@ -0,0 +1,89 @@
1
+ # Security Policy
2
+
3
+ **English** | [简体中文](#简体中文)
4
+
5
+ ## Supported versions
6
+
7
+ | Version | Supported |
8
+ |---|---|
9
+ | 0.1.x (npm `dsh-mnemon`) | ✅ |
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).
12
+
13
+ ## Reporting a vulnerability
14
+
15
+ Please **do not open a public issue** for security vulnerabilities.
16
+
17
+ Report privately through one of these channels, in order of preference:
18
+
19
+ 1. **GitHub Security Advisories** — use the “Report a vulnerability” flow on the [Security tab](../../security) of this repository (private vulnerability reporting).
20
+ 2. **Email** — `grivn.wang@gmail.com` (maintainer). Use a subject prefix like `[dsh-mnemon security]`.
21
+
22
+ Please include, when possible:
23
+
24
+ - affected version(s);
25
+ - a minimal reproduction or proof of concept;
26
+ - whether the issue is already exploited publicly;
27
+ - your disclosure preference (e.g., coordinated disclosure, credit, embargo).
28
+
29
+ ## What to expect
30
+
31
+ - Acknowledge receipt within **7 days**.
32
+ - A fix or a reasoned “not a vulnerability” response within **30 days** where feasible.
33
+ - Credit in the release notes unless you prefer to stay anonymous.
34
+
35
+ ## Scope
36
+
37
+ In scope:
38
+
39
+ - The plugin bundle (`lib/`, `cordis.patch.yml`): data-loss, privilege-escalation, path-traversal, secret-leak, and memory-corruption style issues in plugin code.
40
+ - The control plane: lock handling, revision conflict checks, atomic writes, and subagent isolation boundaries.
41
+ - The WebUI: XSS or injection via rendered memory content.
42
+
43
+ Out of scope:
44
+
45
+ - Issues in upstream dependencies (`mnemon`, `cordis`, DSH core, React) — report those upstream; we will still help triage and pin workarounds.
46
+ - Missing features, documentation gaps, and non-security bugs — use regular issues.
47
+ - Credentials or secrets you intentionally stored in memory data yourself; the plugin has no secret scanner (see the disclosure in the README).
48
+
49
+ ## Known limitations
50
+
51
+ - There is no deterministic credential/secret detection today. Do not write keys, tokens, or private keys into Runtime Memory, Documents, or Memory Spaces.
52
+ - Memory data is local; the plugin makes no remote calls, so remote-code-execution exposure is limited to what DSH and your providers already expose.
53
+
54
+ ---
55
+
56
+ ## 简体中文
57
+
58
+ ### 支持的版本
59
+
60
+ | 版本 | 支持 |
61
+ |---|---|
62
+ | 0.1.x(npm `dsh-mnemon`) | ✅ |
63
+
64
+ 仅最新发布版本获得安全修复。插件以验证时的 DSH mainline 快照为兼容基线,见 [README.md](./README.md)。
65
+
66
+ ### 报告漏洞
67
+
68
+ 请**不要**为安全漏洞开公开 issue,按优先级使用以下渠道私下报告:
69
+
70
+ 1. **GitHub Security Advisories**:在本仓库 [Security 页](../../security) 使用“Report a vulnerability”(私密漏洞报告)。
71
+ 2. **邮件**:`grivn.wang@gmail.com`(维护者),主题加 `[dsh-mnemon security]` 前缀。
72
+
73
+ 请尽量附上:受影响版本、最小复现或 PoC、是否已被公开利用、披露偏好(协调披露 / 署名 / 保密期)。
74
+
75
+ ### 预期
76
+
77
+ - **7 天**内确认收到;可行情况下 **30 天**内给出修复或“非漏洞”的结论。
78
+ - 除非你要求匿名,否则在发布说明中致谢。
79
+
80
+ ### 范围
81
+
82
+ **范围内**:插件 bundle 与 `cordis.patch.yml` 中的数据丢失、提权、路径穿越、秘密泄露类问题;控制面(锁、revision 冲突检查、原子写、子 Agent 隔离);WebUI 对记忆内容渲染的 XSS/注入。
83
+
84
+ **范围外**:上游依赖(`mnemon`、`cordis`、DSH 核心、React)自身的问题(报告给上游,我们可协助定位与临时规避);功能缺失、文档问题(走普通 issue);你自行写入记忆数据中的凭据或秘密(插件当前没有秘密检测器,见 README 披露)。
85
+
86
+ ### 已知限制
87
+
88
+ - 当前没有确定性的凭据/秘密检测,请勿向热记忆、Documents 或 Memory Spaces 写入密钥、token、私钥。
89
+ - 记忆数据全部本地存储,插件不发起远程调用;远程代码执行面受限于 DSH 与你的 provider 既有暴露面。
package/cordis.patch.yml CHANGED
@@ -5,6 +5,7 @@
5
5
  name: dsh-mnemon
6
6
  config:
7
7
  routingGuidance: true
8
+ displayMode: sidebar
8
9
  lifecycleEnabled: true
9
10
  recallMode: guided
10
11
  writebackMode: guided
package/docs/en/README.md CHANGED
@@ -16,6 +16,7 @@ These documents use the current implementation as the source of truth. The root
16
16
  8. [Operations, Security, and Troubleshooting](./operations.md): locks, permissions, backup, recovery, and known limitations.
17
17
  9. [Development and Verification](./development.md): module structure, tests, builds, and release checks.
18
18
  10. [Roadmap](./roadmap.md): unfinished reliability, operations, and internationalization work.
19
+ 11. [Security Policy](../../SECURITY.md): supported versions, private vulnerability-reporting channels, and scope.
19
20
 
20
21
  ## Terminology
21
22
 
@@ -10,14 +10,15 @@ The plugin registers the `mnemon` namespace with the DSH settings service. User
10
10
  $DSH_HOME/settings.yaml
11
11
  ```
12
12
 
13
- The default is commonly `~/.dsh/settings.yaml`. All current settings are marked as taking effect on `restart`; restart the DSH Host after saving them.
13
+ The default is commonly `~/.dsh/settings.yaml`. All current settings are marked `live`; after Save, the Host initializes a candidate runtime graph and then switches to it atomically.
14
14
 
15
- The Web settings card edits only `storageScope` and `dataDir`. Other advanced settings must be changed directly in YAML.
15
+ The Web settings card edits `displayMode`, `storageScope`, and `dataDir`. Other advanced settings must be changed directly in YAML.
16
16
 
17
17
  ## Complete Example
18
18
 
19
19
  ```yaml
20
20
  mnemon:
21
+ displayMode: sidebar # sidebar | buildin
21
22
  storageScope: global # global | workspace | custom
22
23
  # dataDir: ~/mnemon-data # required for custom
23
24
  # cliPath: /opt/homebrew/bin/mnemon
@@ -37,6 +38,7 @@ mnemon:
37
38
 
38
39
  | Setting | Default | Range | Implementation Semantics |
39
40
  |---|---:|---|---|
41
+ | `displayMode` | `sidebar` | `sidebar` / `buildin` | `sidebar` mounts the dedicated sidebar workbench; `buildin` restores the native DSH conversation-area tab; saving switches live and never mounts both entries together |
40
42
  | `storageScope` | `global` | `global` / `workspace` / `custom` | Controls the root for Runtime, Documents, Memory Spaces, and reserved state as one unit |
41
43
  | `dataDir` | unset | absolute path, `~`, or `~/...` | Required for `custom`; legacy configurations that set only this option automatically resolve to `custom` |
42
44
  | `cliPath` | auto-discovered | executable path | Explicitly selects the Mnemon CLI |
@@ -48,8 +50,13 @@ mnemon:
48
50
  | `recallMode` | `guided` | `guided` / `off` | Whether to inject an on-demand recall cue; does not remove explicit recall |
49
51
  | `writebackMode` | `guided` | `guided` / `off` | Whether to inject the hot-memory cue and enable score-based background review; does not remove explicit writes |
50
52
  | `idleReviewMs` | `30000` | 5000–600000 ms | Required continuous idle time after the threshold is reached |
51
- | `tabEnabled` | `true` | boolean | Currently gates only Host Mnemon data RPC; the client Tab is still registered—see the limitation below |
53
+ | `tabEnabled` | `true` | boolean | Whether to mount the Web entry selected by `displayMode`; Host RPC, commands, and Agent tools remain registered when off |
52
54
  | `writeEnabled` | `true` | boolean | Whether to expose semantic write tools, write RPC, and write commands |
55
+ | `mnemon-ui.toolviews` | `false` | boolean | In-conversation memory tool cards for `mnemon_*` calls; off by default (opt-in), **applies live after saving** |
56
+ | `mnemon-ui.turnBar` | `false` | boolean | Turn-tail memory activity bar; off by default (opt-in), **applies live after saving** |
57
+ | `mnemon-ui.saveAction` | `false` | boolean | “Save to memory” action on finalized assistant replies; off by default (opt-in), **applies live after saving** |
58
+
59
+ Both the `mnemon` Host/storage namespace and the `mnemon-ui` browser-presentation namespace apply live. The storage root switches atomically only after the new runtime graph initializes successfully. Legacy `mnemon.conversationInteraction` values remain a migration default, but new saves write only to `mnemon-ui`.
53
60
 
54
61
  ## Storage Scopes
55
62
 
@@ -65,10 +72,11 @@ Suitable for users who want Runtime, Documents, and Memory Spaces shared across
65
72
  ### `workspace`
66
73
 
67
74
  ```text
68
- resolve(process.cwd(), ".mnemon")
75
+ Agent / tool / lifecycle: resolve(currentSession.header.cwd, ".mnemon")
76
+ Web workbench inspection: resolve(workspaceRegistry.get(selectedWorkspaceId).path, ".mnemon")
69
77
  ```
70
78
 
71
- Here, cwd is the DSH Host process launch directory. It is not the current browser-page directory and does not necessarily match the cwd recorded for every session. Start DSH from the target project directory.
79
+ Each DSH workspace owns an independent three-tier memory root. Agents, model tools, commands, and lifecycle hooks route by the current session cwd and are unaffected by the Web workbench's inspection target. The workbench can select only Host-registered workspaces, never an arbitrary path. When inspection and execution differ, the header shows both paths and offers one-click alignment with the current session. Agent-backed actions are rejected while misaligned to prevent writes to the wrong project.
72
80
 
73
81
  ### `custom`
74
82
 
@@ -163,9 +171,11 @@ routingGuidance=false
163
171
  -> runtime-memory prompt section remains
164
172
  ```
165
173
 
166
- ## Current `tabEnabled` Limitation
174
+ ## Display Mode and the `tabEnabled` UI Switch
175
+
176
+ `displayMode=sidebar` (the default) mounts the “Memory System” sidebar entry and its dedicated center-column workbench. `displayMode=buildin` instead registers the original DSH `conversation.view` tab. Saving first disposes the active entry and then mounts the target, so the two modes never appear simultaneously.
167
177
 
168
- When `tabEnabled=false`, the Host does not register Mnemon read/write RPC, but the Web client still registers its conversation view slot unconditionally. The current result is therefore “the Tab entry may still appear while its data interface is unavailable,” not complete Tab removal. This is an implementation gap; do not rely on the setting to uninstall the UI.
178
+ `tabEnabled=false` removes the currently selected Web entry live. Host RPC, commands, and tools remain registered across display-mode and enablement changes so an Agent or command already in progress stays valid.
169
179
 
170
180
  ## Profile Patch Overrides
171
181
 
@@ -28,7 +28,7 @@ both paths require
28
28
  -> depthLimit
29
29
  ```
30
30
 
31
- The plugin does not declare a fixed minimum-version matrix for DSH and Mnemon in its code. Before upgrading, run the verification steps on this page against an isolated data directory.
31
+ The plugin does not declare a fixed minimum-version matrix for DSH and Mnemon in its code. **Verified baseline**: `dsh-mnemon` 0.1.0 has been verified end-to-end on a live web profile running `@deepseek-ai/dsh` 0.1.0-rc.6 (2026-08-13 snapshot); last verified 2026-08-14. Before upgrading, run the verification steps on this page against an isolated data directory.
32
32
 
33
33
  ## 2. Install Mnemon
34
34
 
@@ -76,6 +76,22 @@ dsh plugin --profile web add "link:/absolute/path/to/dsh-mnemon"
76
76
 
77
77
  The plugin package's `cordis.patch.yml` mounts the Host plugin; the Web client bundle registers the session workspace and plugin settings card.
78
78
 
79
+ ### Upgrade and uninstall
80
+
81
+ `dsh plugin` is a pnpm forwarder that runs inside the profile directory:
82
+
83
+ ```sh
84
+ # Upgrade
85
+ dsh plugin --profile web update dsh-mnemon
86
+
87
+ # Uninstall (also removes its bundle registration from the profile)
88
+ dsh plugin --profile web remove dsh-mnemon
89
+ ```
90
+
91
+ Uninstalling never deletes memory data: `global` data stays in `~/.mnemon`, and `workspace` / `custom` data stays in their directories, so reinstalling picks up where you left off.
92
+
93
+ To pause automatic reads/writes without uninstalling, turn off `writebackMode` / `recallMode` / `lifecycleEnabled` in the plugin configuration (see the [configuration reference](./configuration.md), “Toggle interactions”). To hide only the Web workspace, set `tabEnabled=false`; Host RPC, commands, and Agent tools remain available.
94
+
79
95
  ## 4. Choose a Storage Scope
80
96
 
81
97
  Start the DSH Web profile:
@@ -84,19 +100,21 @@ Start the DSH Web profile:
84
100
  dsh --profile web
85
101
  ```
86
102
 
87
- Under “Settings -> Plugin Configuration -> Mnemon,” choose:
103
+ On the dedicated “Settings -> Memory System” page, first choose a display mode: the default `sidebar` uses a dedicated sidebar workbench, while `buildin` uses the original conversation-area tab. Saving switches live. Then choose a storage scope:
88
104
 
89
105
  | Scope | Root directory | Best suited for |
90
106
  |---|---|---|
91
107
  | `global` | `MNEMON_DATA_DIR` or `~/.mnemon` | Sharing one memory set across multiple workspaces |
92
- | `workspace` | `.mnemon` under the DSH Host startup directory | Project isolation |
108
+ | `workspace` | `.mnemon` under each DSH workspace root | Project isolation and cross-workspace inspection |
93
109
  | `custom` | `dataDir` | An explicit disk, mounted volume, or dedicated data directory |
94
110
 
95
- Settings are written to `$DSH_HOME/settings.yaml` and take effect after restarting DSH. Switching scopes does not move existing data; to preserve it, stop all writes first and manually copy the entire old root directory.
111
+ Settings are written to `$DSH_HOME/settings.yaml` and apply live after Save. Switching scopes does not move existing data; to preserve it, stop writes first and migrate with a complete ZIP backup.
112
+
113
+ After selecting `workspace`, the workbench header can switch the workspace being inspected. This choice controls only which memory set the workbench displays and maintains; Agent execution always follows the current session. A global warning appears when the two differ and offers one-click alignment.
96
114
 
97
115
  ## 5. Create Your First Memory Space
98
116
 
99
- Open the “Memory System” tab in any session:
117
+ With the default `sidebar` mode, click “Memory System” in the DSH sidebar. With `buildin`, open the “Memory System” tab in the conversation area:
100
118
 
101
119
  1. Open the “Memory Spaces” page.
102
120
  2. Create a narrowly scoped Memory Space, such as “Project Decisions.”
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Web Workspace
6
6
 
7
- The main Web interface follows DSH's global language and light/dark theme. The top navigation is split into three divider-separated groups: “Status” stands alone; “Runtime, Memory Spaces, Documents” cover the three storage tiers; “Distill, Recall, Entities, Content” are the read/write tools. The “Status” page opens by default.
7
+ `displayMode=sidebar` (the default) opens a dedicated workbench from the sidebar, while `displayMode=buildin` opens the same functional interface through the original DSH `conversation.view` tab. The settings page switches the two modes live and never mounts both simultaneously. The main Web interface follows DSH's global language and light/dark theme. The top navigation is split into three divider-separated groups: “Status” stands alone; “Runtime, Memory Spaces, Documents” cover the three storage tiers; “Distill, Recall, Entities, Content” are the read/write tools. The “Status” page opens by default.
8
8
 
9
9
  | Page | Purpose | Call Boundary |
10
10
  |---|---|---|
@@ -19,6 +19,18 @@ The main Web interface follows DSH's global language and light/dark theme. The t
19
19
 
20
20
  The graph synchronizes every 15 seconds and can also be refreshed manually. Natural layout, uniform reset, dragging, and keyboard adjustments affect only client-side presentation and do not modify Mnemon data.
21
21
 
22
+ ### In-Conversation Interaction
23
+
24
+ The memory system surfaces inside the conversation flow through three native DSH slots, all purely additive registrations that replace no official rendering:
25
+
26
+ | Slot | Presentation | Data and interaction |
27
+ |---|---|---|
28
+ | `tool.call.toolview` (keyed by tool name) | Every `mnemon_*` tool call renders as a memory-flavoured card row: state dot, Mnemon mark, recall/write title, and a tool-specific summary; hovering reveals “Open in Memory view” and “Inspect” | Summaries derive from the call arguments and the settled result JSON (recall/document-search hit counts, engine health for status, catalogue stats for bodies, …); expanding shows the raw arguments and result; jumps use the `mnemon:anchor` event channel to open the matching Memory view page (with a query seed) |
29
+ | `conversation.chat.turnTail` (chain) | One “Turn memory · recalled N · wrote M · document search K” line above the turn-tail actions; expanding lists the exact tool names and offers a jump to the Status page | The read-only RPC `turn-activity` counts `mnemon_*` calls per turn from the Host's durable session log; the chain `select` declines open turns, and turns without memory activity render nothing |
30
+ | `conversation.chat.assistant-actions` (list, id `mnemon-save`) | A “Save to memory” action beside finalized assistant replies (next to feedback); clicking opens the candidate panel | The panel extracts the message text by messageId through the read-only RPC `assistant-message` into an editable candidate; submission goes through the existing `supervise` write RPC (supervised writeback: memory subagent judgment, dedupe, Memory Space choice) and shows the subagent receipt; read-only deployments are disabled up front with a note |
31
+
32
+ `turn-activity` and `assistant-message` are new read-only endpoints sharing the existing Host channel and error semantics. The rendering-extension contracts behind the in-conversation interaction and the follow-up inline memory-highlight plan are recorded in the Mnemon document “dsh-mnemon 对话内记忆交互侦察”.
33
+
22
34
  ## Model Tools
23
35
 
24
36
  ### Read-Only Tools
@@ -79,6 +91,8 @@ When a worker calls a tool with the same name, the call goes directly to the ser
79
91
 
80
92
  RPC is the internal bridge between the DSH Host and this plugin's Web client. It is not a promised stable external HTTP API.
81
93
 
94
+ Workbench data requests carry `sessionId` and an optional `workspaceId`. The Host accepts only workspace IDs registered in `workspaceRegistry`: deterministic reads and human maintenance route to the inspected root selected by `workspaceId`, while agents, tools, and lifecycle hooks continue to route by the Agent cwd for `sessionId`. `status.workspaceContext` returns both roots and their `aligned` state; Agent-backed writes are rejected while they differ.
95
+
82
96
  ### Read Channel
83
97
 
84
98
  ```text
@@ -111,7 +125,7 @@ authority: loopback
111
125
  | Endpoint | Behavior |
112
126
  |---|---|
113
127
  | `runtime-memory` | Hot-memory mutation |
114
- | `supervise` | Submit a Tab candidate to a memory worker |
128
+ | `supervise` | Submit a workspace candidate to a memory worker |
115
129
  | `document` | create / update / archive |
116
130
  | `remember` | Semantic write with optional advanced constraints |
117
131
  | `link` | Create a relationship |
@@ -119,7 +133,7 @@ authority: loopback
119
133
  | `body-create` | Create a Memory Space |
120
134
  | `body-update` | Update metadata or active state |
121
135
 
122
- The entire write channel is not registered when `writeEnabled=false`.
136
+ When `writeEnabled=false`, the write channel remains stably registered but every mutation is rejected at the Host boundary.
123
137
 
124
138
  ### Settings Channel
125
139
 
@@ -53,6 +53,10 @@ The serial queue does not replace coordination across DSH processes. When multip
53
53
 
54
54
  These boundaries are not a secret scanner. There is currently no deterministic credential/secret detection. Do not submit keys, tokens, private keys, or raw sensitive logs to hot memory, Documents, or Memory Spaces.
55
55
 
56
+ ### Security reporting
57
+
58
+ Report vulnerabilities privately through the channels in [SECURITY.md](../../SECURITY.md) (GitHub Security Advisories or maintainer email) — do not open a public issue. Typical in-scope issues include data loss, path traversal, lock/revision-check bypasses, subagent isolation breaks, and injection via memory content rendered by the WebUI.
59
+
56
60
  ## Backup
57
61
 
58
62
  All three tiers share `storageRoot`. A consistent backup should cover the entire root, not just `mnemon.db`:
@@ -90,7 +94,7 @@ If `USER.md` / `MEMORY.md` is damaged, the control layer can repair it from a va
90
94
  The plugin does not migrate data automatically:
91
95
 
92
96
  ```text
93
- old scope -- change setting + restart --> new empty or existing scope
97
+ old scope -- change setting + save --> new empty or existing scope
94
98
 
95
99
  no implicit copy
96
100
  no implicit merge
@@ -104,11 +108,12 @@ When migration is required, stop writes and copy the complete root. Two roots ca
104
108
  | Symptom | Check and Resolution |
105
109
  |---|---|
106
110
  | Mnemon is unavailable | Run `command -v mnemon` and `mnemon --version`; set `MNEMON_CLI_PATH` or `cliPath`, then restart |
107
- | Status is healthy but recall is empty | Check that a Memory Space is active, inspect the current `storageScope` and DSH launch cwd, and make sure the query is focused enough |
111
+ | Status is healthy but recall is empty | Check that a Memory Space is active, inspect `storageScope`, the workbench inspection root, the current session's effective root, and make sure the query is focused enough |
112
+ | Workbench reports a directory mismatch | This is a safety notice: the workbench is inspecting another workspace while the Agent still follows the current session; align with the session or intentionally keep cross-workspace inspection |
108
113
  | `memoryBodyId is required...` | The active count is not exactly 1; have the worker or caller select a target explicitly |
109
114
  | `memory body is not active for reading` | Activate the target in Overview; writing to an inactive space is allowed, but reading is not |
110
115
  | Subagent provider error | Regular tasks require the full isolation capabilities; background review additionally requires `fork + inheritsParentContext` |
111
- | Settings have no effect after saving | All options take effect after restart |
116
+ | Settings have no effect after saving | Check the UI error; all options should apply live after a successful Save |
112
117
  | Custom directory is rejected | Use an absolute path, `~`, or `~/...` |
113
118
  | Document has no workspace | The session must correspond to a live root Agent and include cwd in its session header |
114
119
  | Source path is rejected | The path must stay within the session workspace and must not reference the managed Documents directory |
@@ -117,7 +122,7 @@ When migration is required, stop writes and copy the complete root. Two roots ca
117
122
  | Lock timeout | Check whether another instance is writing; do not delete a lock that still belongs to a live process |
118
123
  | Invalid JSON / unexpected viz | The CLI output protocol may be incompatible; validate the version against an isolated root and do not continue writing production data |
119
124
  | A remote page can read but not write | Write RPC enforces loopback by design |
120
- | `tabEnabled=false` still shows the Tab | The setting currently stops only Host data RPC and does not remove the client slot |
125
+ | “Memory System” is missing from the sidebar | Check `tabEnabled=true` and `displayMode=sidebar`; `buildin` appears as a conversation-area tab; after changing a local link, run `pnpm run build` and restart the DSH profile |
121
126
  | Local link does not reflect source | Run `pnpm run build`, then restart the DSH profile |
122
127
 
123
128
  ## Known Limitations
@@ -170,7 +170,9 @@ These workflows can be initiated proactively through Agent tools and can also be
170
170
 
171
171
  ### Web Workspace
172
172
 
173
- The conversation's “Memory System” tab contains eight pages in three divider-separated groups: “Status” stands alone; “Runtime, Memory Spaces, Documents” cover the three storage tiers; “Distill, Recall, Entities, Content” are the read/write tools:
173
+ The default `sidebar` mode opens a dedicated center-column workspace from the “Memory System” sidebar entry. Settings can switch to `buildin`, which restores the original conversation-area tab. Both modes reuse the same functional interface and are mounted mutually exclusively. It contains eight pages in three divider-separated groups: “Status” stands alone; “Runtime, Memory Spaces, Documents” cover the three storage tiers; “Distill, Recall, Entities, Content” are the read/write tools:
174
+
175
+ Under the `workspace` storage scope, the header selector is an independent inspection context: it can display and maintain another registered DSH workspace without changing the current conversation. The execution context used by agents, tools, and lifecycle hooks always follows the current session cwd. When inspection and execution differ, the whole workbench shows both paths and a one-click alignment action; operations that need to start an Agent do not run while misaligned.
174
176
 
175
177
  | Page | Primary purpose |
176
178
  |---|---|
@@ -11,7 +11,6 @@ The Roadmap records work beyond the current implementation; it is not a commitme
11
11
  - [ ] **Backoff, circuit breaking, and manual retry**: apply bounded backoff after consecutive failures, show the reason on the Status page, and allow explicit recovery.
12
12
  - [ ] **Deterministic sensitive-data defenses**: add secret/credential pattern detection, size limits, and audit receipts beyond LLM admission.
13
13
  - [ ] **Automated real-WebUI E2E**: isolate DSH_HOME, storageRoot, workspace, and the port; cover light tasks, score-based review, cancellation, and failures without partial writes.
14
- - [ ] **Correct `tabEnabled` semantics**: have the Host and client use the same switch so the complete Tab capability is actually registered or removed.
15
14
  - [ ] **Correct cold-reference paths**: under every storage scope, write resolvable references that match the actual managed path.
16
15
 
17
16
  ## P1: Long-Term Maintenance and Data Operations
@@ -27,6 +26,7 @@ The Roadmap records work beyond the current implementation; it is not a commitme
27
26
  ## P2: Observability, Experience, and Release Engineering
28
27
 
29
28
  - [ ] **Background-review history**: show recent scores, checkpoints, waiting/running/failed states, worker receipts, and resulting changes.
29
+ - [ ] **Switch to DSH's shared directory picker** (blocked on [dsh-external/issues#603](https://github.com/dsh-external/issues/issues/603)): custom storage temporarily uses a manually entered Host path because remote `browse` deployments cannot invoke the `native` picker; once DSH exposes a reusable directory-picker service for plugins, move to the provider-selected native / browse flow and retain manual entry only as a fallback if needed.
30
30
  - [ ] **Complete internationalization**: cover commands, tool cards, Host errors, compatibility default metadata, and confirmation copy.
31
31
  - [ ] **Multi-Memory-Space E2E**: cover automatic space creation, cross-space recall, one-pass migration routing, multiple relationship types, merge, and controlled forget.
32
32
  - [ ] **Capacity and fault injection**: exercise real USER/MEMORY boundaries, Document LRU, revision conflicts, CLI timeouts, and mid-operation Host restarts.
@@ -50,7 +50,7 @@ follow an exact cold reference when full text is required
50
50
  +-- state/ # reserved; no persistent reviewer yet
51
51
  ```
52
52
 
53
- `storageScope` determines the entire root, not just the Mnemon databases. `state/` is currently recognized only by the status inspector; scored review watermarks remain in the running Host's memory.
53
+ `storageScope` determines the entire root, not just the Mnemon databases. The `workspace` scope resolves an independent `<workspace>/.mnemon` for every registered DSH workspace. The Web inspection target and current-session execution target are independent; only the latter drives agents, tools, and lifecycle hooks. `state/` is currently recognized only by the status inspector; scored review watermarks remain in the running Host's memory.
54
54
 
55
55
  ## Runtime Memory
56
56
 
@@ -16,6 +16,7 @@
16
16
  8. [运维、安全与故障排查](./operations.md):锁、权限、备份、恢复和已知限制。
17
17
  9. [开发与验证](./development.md):模块结构、测试、构建和发布检查。
18
18
  10. [Roadmap](./roadmap.md):尚未完成的可靠性、运维和国际化工作。
19
+ 11. [安全策略](../../SECURITY.md):支持版本、漏洞私密报告渠道与范围。
19
20
 
20
21
  ## 术语
21
22
 
@@ -10,14 +10,15 @@
10
10
  $DSH_HOME/settings.yaml
11
11
  ```
12
12
 
13
- 默认通常是 `~/.dsh/settings.yaml`。当前全部配置标记为 `restart` 生效;保存后需要重启 DSH Host。
13
+ 默认通常是 `~/.dsh/settings.yaml`。当前全部配置标记为 `live` 生效;保存后会先初始化候选运行图,再原子切换 Host 服务。
14
14
 
15
- Web 设置卡只编辑 `storageScope` 和 `dataDir`。其他高级项需要直接修改 YAML。
15
+ Web 设置卡编辑 `displayMode`、`storageScope` 和 `dataDir`。其他高级项需要直接修改 YAML。
16
16
 
17
17
  ## 完整示例
18
18
 
19
19
  ```yaml
20
20
  mnemon:
21
+ displayMode: sidebar # sidebar | buildin
21
22
  storageScope: global # global | workspace | custom
22
23
  # dataDir: ~/mnemon-data # custom 时必填
23
24
  # cliPath: /opt/homebrew/bin/mnemon
@@ -37,6 +38,7 @@ mnemon:
37
38
 
38
39
  | 配置 | 默认值 | 范围 | 实现语义 |
39
40
  |---|---:|---|---|
41
+ | `displayMode` | `sidebar` | `sidebar` / `buildin` | `sidebar` 挂载左侧栏独立工作台;`buildin` 恢复 DSH 原生对话区标签页;保存后实时切换且不会同时挂载两个入口 |
40
42
  | `storageScope` | `global` | `global` / `workspace` / `custom` | 统一控制 Runtime、Documents、Memory Spaces 和预留 state 根目录 |
41
43
  | `dataDir` | 未设置 | 绝对路径、`~` 或 `~/...` | `custom` 时必填;旧配置只设置它时自动解析为 `custom` |
42
44
  | `cliPath` | 自动发现 | 可执行路径 | 显式指定 Mnemon CLI |
@@ -48,8 +50,13 @@ mnemon:
48
50
  | `recallMode` | `guided` | `guided` / `off` | 是否注入按需 recall cue;不移除显式召回 |
49
51
  | `writebackMode` | `guided` | `guided` / `off` | 是否注入热记忆 cue 并启用评分后台审查;不移除显式写入 |
50
52
  | `idleReviewMs` | `30000` | 5000–600000 ms | 达标后需要连续空闲的时间 |
51
- | `tabEnabled` | `true` | boolean | 当前只门控 Host Mnemon 数据 RPC;客户端 Tab 仍会注册,见下方限制 |
53
+ | `tabEnabled` | `true` | boolean | 是否挂载 `displayMode` 指定的 Web 入口;关闭后 Host RPC、命令和 Agent 工具保持注册 |
52
54
  | `writeEnabled` | `true` | boolean | 是否暴露语义写工具、写 RPC 和写命令 |
55
+ | `mnemon-ui.toolviews` | `false` | boolean | 对话内记忆工具卡(`mnemon_*` 调用的记忆风格卡片);默认关闭(opt-in),**保存后实时生效** |
56
+ | `mnemon-ui.turnBar` | `false` | boolean | 回合尾记忆活动条;默认关闭(opt-in),**保存后实时生效** |
57
+ | `mnemon-ui.saveAction` | `false` | boolean | 已定稿助手回复旁的「存入记忆」按钮;默认关闭(opt-in),**保存后实时生效** |
58
+
59
+ `mnemon` Host/存储命名空间和 `mnemon-ui` 浏览器呈现命名空间都实时生效。存储根只会在新运行图初始化成功后原子切换;旧版 `mnemon.conversationInteraction` 仍会作为迁移默认值读取,但新保存只写入 `mnemon-ui`。
53
60
 
54
61
  ## 存储范围
55
62
 
@@ -65,10 +72,11 @@ MNEMON_DATA_DIR when non-empty
65
72
  ### `workspace`
66
73
 
67
74
  ```text
68
- resolve(process.cwd(), ".mnemon")
75
+ Agent / 工具 / 生命周期:resolve(currentSession.header.cwd, ".mnemon")
76
+ Web 工作台查看:resolve(workspaceRegistry.get(selectedWorkspaceId).path, ".mnemon")
69
77
  ```
70
78
 
71
- 这里的 cwd 是 DSH Host 进程启动目录,不是浏览器页面当前目录,也不一定等于每个会话记录的 cwd。应从目标项目目录启动 DSH。
79
+ 每个 DSH 工作区拥有独立的三层记忆根。Agent、模型工具、命令和生命周期按当前会话的 cwd 路由,不受 Web 工作台查看目标影响。工作台只能从 Host 已登记的工作区中选择,不能提交任意路径;查看目标与会话实际目录不一致时,顶部会显示两条路径并提供“一键对齐当前会话”。需要 Agent 子任务的操作在未对齐时会被 Host 拒绝,避免写入错误项目。
72
80
 
73
81
  ### `custom`
74
82
 
@@ -163,9 +171,11 @@ routingGuidance=false
163
171
  -> runtime-memory prompt section remains
164
172
  ```
165
173
 
166
- ## `tabEnabled` 当前限制
174
+ ## 展示形态与 `tabEnabled` 界面开关
175
+
176
+ `displayMode=sidebar`(默认)会挂载“记忆系统”侧边栏入口和独立主内容区工作台;`displayMode=buildin` 会改为注册原有的 DSH `conversation.view` 内嵌标签页。设置页保存后会先卸载当前入口再挂载目标入口,因此两种形态不会同时出现。
167
177
 
168
- Host 在 `tabEnabled=false` 时不注册 Mnemon read/write RPC,但 Web client 仍无条件注册 conversation view slot。因此当前效果是“Tab 入口仍可能出现但数据接口不可用”,而不是完整隐藏 Tab。这是实现缺口,不应依赖它进行 UI 卸载。
178
+ `tabEnabled=false` 会实时移除当前形态的 Web 入口。为避免运行中的 Agent 或命令因界面设置变化而失效,Host RPC、命令和工具不会随展示形态或总开关卸载。
169
179
 
170
180
  ## Profile patch 覆盖
171
181