dsh-mnemon 0.1.4 → 0.1.6

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 (215) hide show
  1. package/README.md +19 -5
  2. package/README.zh-CN.md +19 -5
  3. package/cordis.patch.yml +3 -2
  4. package/lib/client.js +380 -348
  5. package/lib/index.js +203 -82
  6. package/lib/types/activity.d.ts +2 -18
  7. package/lib/types/channels.d.ts +1 -4
  8. package/lib/types/client/MnemonLogo.d.ts +0 -1
  9. package/lib/types/client/MnemonPackSection.d.ts +1 -2
  10. package/lib/types/client/MnemonSaveAction.d.ts +1 -2
  11. package/lib/types/client/MnemonSettingsCard.d.ts +1 -3
  12. package/lib/types/client/MnemonTurnTail.d.ts +1 -2
  13. package/lib/types/client/MnemonView.d.ts +1 -3
  14. package/lib/types/client/MnemonViewAppearance.d.ts +0 -1
  15. package/lib/types/client/anchor.d.ts +0 -1
  16. package/lib/types/client/api.d.ts +1 -9
  17. package/lib/types/client/dsh-compat.d.ts +0 -1
  18. package/lib/types/client/index.d.ts +0 -1
  19. package/lib/types/client/locales.d.ts +14 -1
  20. package/lib/types/client/settings.d.ts +1 -2
  21. package/lib/types/client/sidebar-entry.d.ts +0 -1
  22. package/lib/types/client/workspace-controller.d.ts +0 -1
  23. package/lib/types/client/workspace-mount.d.ts +1 -3
  24. package/lib/types/commands.d.ts +0 -1
  25. package/lib/types/config-values.d.ts +0 -1
  26. package/lib/types/config.d.ts +6 -80
  27. package/lib/types/contracts.d.ts +2 -60
  28. package/lib/types/documents.d.ts +2 -79
  29. package/lib/types/guidance.d.ts +0 -1
  30. package/lib/types/index.d.ts +0 -1
  31. package/lib/types/lifecycle.d.ts +3 -45
  32. package/lib/types/live-runtime.d.ts +0 -1
  33. package/lib/types/memory-bodies.d.ts +3 -20
  34. package/lib/types/pack.d.ts +2 -48
  35. package/lib/types/process.d.ts +0 -1
  36. package/lib/types/review-activity.d.ts +2 -16
  37. package/lib/types/rpc.d.ts +0 -1
  38. package/lib/types/runner.d.ts +22 -12
  39. package/lib/types/runtime-memory.d.ts +2 -59
  40. package/lib/types/service.d.ts +3 -149
  41. package/lib/types/settings.d.ts +1 -4
  42. package/lib/types/shared/contracts.d.ts +609 -0
  43. package/lib/types/storage-scope.d.ts +2 -29
  44. package/lib/types/subagent.d.ts +2 -15
  45. package/lib/types/tools.d.ts +0 -1
  46. package/lib/types/version-updates.d.ts +2 -26
  47. package/package.json +8 -7
  48. package/docs/README.md +0 -8
  49. package/docs/assets/diagrams/en/memory-system-flow.png +0 -0
  50. package/docs/assets/diagrams/en/project-architecture.svg +0 -182
  51. package/docs/assets/diagrams/zh-CN/memory-system-flow.png +0 -0
  52. package/docs/assets/diagrams/zh-CN/project-architecture.svg +0 -182
  53. package/docs/assets/media/dsh-mnemon-memory-system-demo-poster.jpg +0 -0
  54. package/docs/assets/media/dsh-mnemon-memory-system-demo.gif +0 -0
  55. package/docs/assets/media/dsh-mnemon-memory-system-demo.mp4 +0 -0
  56. package/docs/assets/screenshots/conversation-memory-jump.png +0 -0
  57. package/docs/assets/screenshots/conversation-save-dialog.png +0 -0
  58. package/docs/assets/screenshots/conversation-turn-memory.png +0 -0
  59. package/docs/assets/screenshots/document-create-dialog.png +0 -0
  60. package/docs/assets/screenshots/documents-markdown.png +0 -0
  61. package/docs/assets/screenshots/entities-context.png +0 -0
  62. package/docs/assets/screenshots/memory-content.png +0 -0
  63. package/docs/assets/screenshots/overview-memory-graph.png +0 -0
  64. package/docs/assets/screenshots/recall-agent-answer.png +0 -0
  65. package/docs/assets/screenshots/remember-dialog.png +0 -0
  66. package/docs/assets/screenshots/runtime-memory-add.png +0 -0
  67. package/docs/assets/screenshots/runtime-memory.png +0 -0
  68. package/docs/assets/screenshots/settings-memory-system.png +0 -0
  69. package/docs/assets/screenshots/status-overview.png +0 -0
  70. package/docs/assets/screenshots/version-check.png +0 -0
  71. package/docs/en/README.md +0 -48
  72. package/docs/en/architecture.md +0 -133
  73. package/docs/en/configuration.md +0 -223
  74. package/docs/en/development.md +0 -198
  75. package/docs/en/getting-started.md +0 -155
  76. package/docs/en/interfaces.md +0 -181
  77. package/docs/en/operations.md +0 -166
  78. package/docs/en/project-overview.md +0 -145
  79. package/docs/en/roadmap.md +0 -41
  80. package/docs/en/storage-model.md +0 -185
  81. package/docs/en/ui-guide.md +0 -156
  82. package/docs/en/workflows.md +0 -290
  83. package/docs/zh-CN/README.md +0 -48
  84. package/docs/zh-CN/architecture.md +0 -133
  85. package/docs/zh-CN/configuration.md +0 -223
  86. package/docs/zh-CN/development.md +0 -198
  87. package/docs/zh-CN/getting-started.md +0 -155
  88. package/docs/zh-CN/interfaces.md +0 -181
  89. package/docs/zh-CN/operations.md +0 -166
  90. package/docs/zh-CN/project-overview.md +0 -145
  91. package/docs/zh-CN/roadmap.md +0 -41
  92. package/docs/zh-CN/storage-model.md +0 -185
  93. package/docs/zh-CN/ui-guide.md +0 -160
  94. package/docs/zh-CN/workflows.md +0 -290
  95. package/lib/client.js.map +0 -1
  96. package/lib/types/activity.d.ts.map +0 -1
  97. package/lib/types/activity.js +0 -93
  98. package/lib/types/activity.js.map +0 -1
  99. package/lib/types/channels.d.ts.map +0 -1
  100. package/lib/types/channels.js +0 -4
  101. package/lib/types/channels.js.map +0 -1
  102. package/lib/types/client/MnemonLogo.d.ts.map +0 -1
  103. package/lib/types/client/MnemonLogo.js +0 -6
  104. package/lib/types/client/MnemonLogo.js.map +0 -1
  105. package/lib/types/client/MnemonPackSection.d.ts.map +0 -1
  106. package/lib/types/client/MnemonPackSection.js +0 -136
  107. package/lib/types/client/MnemonPackSection.js.map +0 -1
  108. package/lib/types/client/MnemonSaveAction.d.ts.map +0 -1
  109. package/lib/types/client/MnemonSaveAction.js +0 -90
  110. package/lib/types/client/MnemonSaveAction.js.map +0 -1
  111. package/lib/types/client/MnemonSettingsCard.d.ts.map +0 -1
  112. package/lib/types/client/MnemonSettingsCard.js +0 -155
  113. package/lib/types/client/MnemonSettingsCard.js.map +0 -1
  114. package/lib/types/client/MnemonTurnTail.d.ts.map +0 -1
  115. package/lib/types/client/MnemonTurnTail.js +0 -56
  116. package/lib/types/client/MnemonTurnTail.js.map +0 -1
  117. package/lib/types/client/MnemonView.d.ts.map +0 -1
  118. package/lib/types/client/MnemonView.js +0 -1585
  119. package/lib/types/client/MnemonView.js.map +0 -1
  120. package/lib/types/client/MnemonViewAppearance.d.ts.map +0 -1
  121. package/lib/types/client/MnemonViewAppearance.js +0 -67
  122. package/lib/types/client/MnemonViewAppearance.js.map +0 -1
  123. package/lib/types/client/anchor.d.ts.map +0 -1
  124. package/lib/types/client/anchor.js +0 -46
  125. package/lib/types/client/anchor.js.map +0 -1
  126. package/lib/types/client/api.d.ts.map +0 -1
  127. package/lib/types/client/api.js +0 -150
  128. package/lib/types/client/api.js.map +0 -1
  129. package/lib/types/client/dsh-compat.d.ts.map +0 -1
  130. package/lib/types/client/dsh-compat.js +0 -2
  131. package/lib/types/client/dsh-compat.js.map +0 -1
  132. package/lib/types/client/index.d.ts.map +0 -1
  133. package/lib/types/client/index.js +0 -161
  134. package/lib/types/client/index.js.map +0 -1
  135. package/lib/types/client/locales.d.ts.map +0 -1
  136. package/lib/types/client/locales.js +0 -1162
  137. package/lib/types/client/locales.js.map +0 -1
  138. package/lib/types/client/settings.d.ts.map +0 -1
  139. package/lib/types/client/settings.js +0 -70
  140. package/lib/types/client/settings.js.map +0 -1
  141. package/lib/types/client/sidebar-entry.d.ts.map +0 -1
  142. package/lib/types/client/sidebar-entry.js +0 -134
  143. package/lib/types/client/sidebar-entry.js.map +0 -1
  144. package/lib/types/client/workspace-controller.d.ts.map +0 -1
  145. package/lib/types/client/workspace-controller.js +0 -21
  146. package/lib/types/client/workspace-controller.js.map +0 -1
  147. package/lib/types/client/workspace-mount.d.ts.map +0 -1
  148. package/lib/types/client/workspace-mount.js +0 -138
  149. package/lib/types/client/workspace-mount.js.map +0 -1
  150. package/lib/types/commands.d.ts.map +0 -1
  151. package/lib/types/commands.js +0 -104
  152. package/lib/types/commands.js.map +0 -1
  153. package/lib/types/config-values.d.ts.map +0 -1
  154. package/lib/types/config-values.js +0 -4
  155. package/lib/types/config-values.js.map +0 -1
  156. package/lib/types/config.d.ts.map +0 -1
  157. package/lib/types/config.js +0 -127
  158. package/lib/types/config.js.map +0 -1
  159. package/lib/types/contracts.d.ts.map +0 -1
  160. package/lib/types/contracts.js +0 -2
  161. package/lib/types/contracts.js.map +0 -1
  162. package/lib/types/documents.d.ts.map +0 -1
  163. package/lib/types/documents.js +0 -495
  164. package/lib/types/documents.js.map +0 -1
  165. package/lib/types/guidance.d.ts.map +0 -1
  166. package/lib/types/guidance.js +0 -34
  167. package/lib/types/guidance.js.map +0 -1
  168. package/lib/types/index.d.ts.map +0 -1
  169. package/lib/types/index.js +0 -55
  170. package/lib/types/index.js.map +0 -1
  171. package/lib/types/lifecycle.d.ts.map +0 -1
  172. package/lib/types/lifecycle.js +0 -456
  173. package/lib/types/lifecycle.js.map +0 -1
  174. package/lib/types/live-runtime.d.ts.map +0 -1
  175. package/lib/types/live-runtime.js +0 -146
  176. package/lib/types/live-runtime.js.map +0 -1
  177. package/lib/types/memory-bodies.d.ts.map +0 -1
  178. package/lib/types/memory-bodies.js +0 -186
  179. package/lib/types/memory-bodies.js.map +0 -1
  180. package/lib/types/pack.d.ts.map +0 -1
  181. package/lib/types/pack.js +0 -709
  182. package/lib/types/pack.js.map +0 -1
  183. package/lib/types/process.d.ts.map +0 -1
  184. package/lib/types/process.js +0 -65
  185. package/lib/types/process.js.map +0 -1
  186. package/lib/types/review-activity.d.ts.map +0 -1
  187. package/lib/types/review-activity.js +0 -37
  188. package/lib/types/review-activity.js.map +0 -1
  189. package/lib/types/rpc.d.ts.map +0 -1
  190. package/lib/types/rpc.js +0 -384
  191. package/lib/types/rpc.js.map +0 -1
  192. package/lib/types/runner.d.ts.map +0 -1
  193. package/lib/types/runner.js +0 -155
  194. package/lib/types/runner.js.map +0 -1
  195. package/lib/types/runtime-memory.d.ts.map +0 -1
  196. package/lib/types/runtime-memory.js +0 -415
  197. package/lib/types/runtime-memory.js.map +0 -1
  198. package/lib/types/service.d.ts.map +0 -1
  199. package/lib/types/service.js +0 -512
  200. package/lib/types/service.js.map +0 -1
  201. package/lib/types/settings.d.ts.map +0 -1
  202. package/lib/types/settings.js +0 -103
  203. package/lib/types/settings.js.map +0 -1
  204. package/lib/types/storage-scope.d.ts.map +0 -1
  205. package/lib/types/storage-scope.js +0 -179
  206. package/lib/types/storage-scope.js.map +0 -1
  207. package/lib/types/subagent.d.ts.map +0 -1
  208. package/lib/types/subagent.js +0 -624
  209. package/lib/types/subagent.js.map +0 -1
  210. package/lib/types/tools.d.ts.map +0 -1
  211. package/lib/types/tools.js +0 -341
  212. package/lib/types/tools.js.map +0 -1
  213. package/lib/types/version-updates.d.ts.map +0 -1
  214. package/lib/types/version-updates.js +0 -377
  215. package/lib/types/version-updates.js.map +0 -1
@@ -1,155 +0,0 @@
1
- # Getting Started
2
-
3
- [简体中文](../zh-CN/getting-started.md) | **English** | [Documentation hub](./README.md)
4
-
5
- This guide goes from a blank environment to the first verified recall. It uses Sidebar and global storage by default. If installation is complete, jump to [First verification](#6-complete-first-verification).
6
-
7
- ## 1. Prerequisites
8
-
9
- You need:
10
-
11
- - a DSH Web profile that starts successfully;
12
- - a locally executable `mnemon` CLI;
13
- - a DSH subagent provider for isolated memory tasks.
14
-
15
- Regular semantic work prefers a provider named `spawn` with `outputSchema`, `toolFilter`, `persona`, and `depthLimit`. Optional score-based background review additionally requires a provider named `fork` with `inheritsParentContext=true`. Missing `fork` does not block deterministic pages or regular manual actions.
16
-
17
- The project does not declare a fixed minimum DSH / Mnemon matrix. This guide and its screenshots target dsh-mnemon v0.1.4. Back up and repeat this verification against an isolated root before upgrading.
18
-
19
- ## 2. Install Mnemon
20
-
21
- Homebrew Cask is recommended on macOS:
22
-
23
- ```sh
24
- brew install --cask mnemon-dev/tap/mnemon
25
- ```
26
-
27
- On macOS or Linux, Go is another option:
28
-
29
- ```sh
30
- go install github.com/mnemon-dev/mnemon@latest
31
- ```
32
-
33
- Verify the binary:
34
-
35
- ```sh
36
- mnemon --version
37
- ```
38
-
39
- If DSH cannot find it on `PATH`, set `MNEMON_CLI_PATH` or configure an absolute `mnemon.cliPath`. `mnemon status` opens the effective Store and may initialize data or run upstream migrations, so it is not a side-effect-free installation probe.
40
-
41
- ## 3. Install dsh-mnemon
42
-
43
- Install into the Web profile:
44
-
45
- ```sh
46
- dsh plugin --profile web add dsh-mnemon
47
- ```
48
-
49
- Use an absolute path for a development checkout:
50
-
51
- ```sh
52
- dsh plugin --profile web add "link:/absolute/path/to/dsh-mnemon"
53
- ```
54
-
55
- Then start or restart the profile:
56
-
57
- ```sh
58
- dsh --profile web
59
- ```
60
-
61
- Upgrade and uninstall:
62
-
63
- ```sh
64
- dsh plugin --profile web update dsh-mnemon
65
- dsh plugin --profile web remove dsh-mnemon
66
- ```
67
-
68
- Uninstall removes the plugin registration, not memory data in global, workspace, or custom roots.
69
-
70
- ## 4. Choose entry point and storage
71
-
72
- Open **Settings → Memory System**:
73
-
74
- [![Memory System settings for display, storage, conversation UI, and backup](../assets/screenshots/settings-memory-system.png)](../assets/screenshots/settings-memory-system.png)
75
-
76
- ### Display mode
77
-
78
- - **Sidebar** (default): a dedicated workbench opened from the DSH sidebar; recommended for most users.
79
- - **Buildin**: the original conversation-area tab with its established visuals.
80
-
81
- ### Storage location
82
-
83
- | Scope | Root | Best suited for |
84
- |---|---|---|
85
- | **Global** (default) | `MNEMON_DATA_DIR` or `~/.mnemon` | Sharing one memory set across workspaces |
86
- | **Workspace** | `<workspace>/.mnemon` | Project isolation with cross-workspace inspection in the workbench |
87
- | **Custom** | `dataDir` | A dedicated disk, mounted volume, or explicit directory |
88
-
89
- Save initializes a candidate runtime graph before atomically switching the Host. The page clears stale state and reloads automatically—no browser refresh is needed. Changing scope never migrates, merges, or deletes old data.
90
-
91
- In Workspace mode, the workbench selector changes only what data is being inspected. Agents, tools, and lifecycle hooks always use the current conversation's effective root. The header reports a mismatch and offers one-click alignment.
92
-
93
- ## 5. Open the Sidebar workbench
94
-
95
- Click **Memory System** in the sidebar, then start on **Status**:
96
-
97
- [![Status with CLI, versions, Runtime, Memory Spaces, Documents, and storage root](../assets/screenshots/status-overview.png)](../assets/screenshots/status-overview.png)
98
-
99
- Confirm that:
100
-
101
- - the top right says Connected;
102
- - Mnemon and dsh-mnemon show installed versions;
103
- - the storage root matches your chosen scope;
104
- - Runtime, Memory Spaces, and Documents report no errors.
105
-
106
- If Mnemon is unavailable, run `command -v mnemon` and `mnemon --version`. See [Troubleshooting](./operations.md#troubleshooting) for other symptoms.
107
-
108
- ## 6. Complete first verification
109
-
110
- ### Create a Memory Space
111
-
112
- 1. Open **Memory Spaces → Overview**.
113
- 2. Select **Create Memory Space**.
114
- 3. Use a narrow name such as “Project Decisions.”
115
- 4. Describe what belongs there and which tasks should recall it.
116
- 5. Enable read activation.
117
-
118
- ### Remember one test item
119
-
120
- Open **Remember** and enter something stable, self-contained, future-useful, and secret-free. Leave advanced options collapsed so the memory subagent can select a target, deduplicate, and distill.
121
-
122
- Writing starts only after confirmation. Canceling the dialog changes no state.
123
-
124
- ### Verify recall
125
-
126
- 1. Open **Memory Spaces → Recall**.
127
- 2. Ask a concrete question that should match the item.
128
- 3. Use **Direct recall** first to inspect raw evidence.
129
- 4. Confirm the result retains its Memory Space, category, importance, score, and ID.
130
-
131
- You can also use conversation commands:
132
-
133
- ```text
134
- /mnemon status
135
- /mnemon recall <focused query>
136
- ```
137
-
138
- ## 7. Verify memory inside a conversation
139
-
140
- Ask a question that genuinely depends on history and allow the Agent to decide whether recall helps. After completion:
141
-
142
- - Turn memory appears below the reply if the turn used memory tools.
143
- - Expanding shows exact tools and links to their pages.
144
- - Save to memory opens an editable confirmation; canceling performs no write.
145
-
146
- [![Turn memory and exact tool navigation](../assets/screenshots/conversation-turn-memory.png)](../assets/screenshots/conversation-turn-memory.png)
147
-
148
- Ordinary conversation should not force recall. Current requests, repository files, and live tool results outrank historical content.
149
-
150
- ## 8. Next steps
151
-
152
- - Use the [Sidebar and conversation UI guide](./ui-guide.md) to learn every page.
153
- - Use the [storage model](./storage-model.md) to choose Runtime, Documents, or Memory Spaces.
154
- - Use the [configuration reference](./configuration.md) for Workspace scope, read-only behavior, and lifecycle switches.
155
- - Use the [operations guide](./operations.md) to export your first ZIP backup and establish a pre-upgrade checklist.
@@ -1,181 +0,0 @@
1
- # WebUI, Tools, Commands, and RPC
2
-
3
- [简体中文](../zh-CN/interfaces.md) | **English** | [Documentation hub](./README.md)
4
-
5
- This page is an integration reference. For daily use, start with the [Sidebar and conversation UI guide](./ui-guide.md).
6
-
7
- ## User-facing entry points
8
-
9
- | Entry | Default | Description |
10
- |---|---:|---|
11
- | Sidebar | Yes | Dedicated Memory System workbench with Status, Runtime, Memory Spaces, and Documents |
12
- | Buildin | No | Original `conversation.view` tab with established visuals |
13
- | Turn memory | Yes | Memory-tool summary for a completed turn, with exact page links |
14
- | Save to memory | Yes | Action beside finalized assistant replies; confirmation invokes supervised writing |
15
- | `/mnemon` | — | Conversation command entry |
16
- | Model tools | — | Structured Root Agent read/write entry |
17
-
18
- Sidebar and Buildin are live, mutually exclusive mounts that share functionality, data, and Host services. The two conversation entries can be disabled independently through `mnemon-ui` settings.
19
-
20
- ## Model tools
21
-
22
- ### Read-only tools
23
-
24
- | Tool | Purpose | Root Agent path |
25
- |---|---|---|
26
- | `mnemon_status` | Aggregated CLI, configuration, storage, and directory status | Direct service |
27
- | `mnemon_memory_bodies` | Read Memory Space directory and statistics | Direct service |
28
- | `mnemon_recall` | Recall from one or more active spaces | `spawn` recall worker |
29
- | `mnemon_related` | Traverse from a known ID | `spawn` related worker; Root defaults to two hops |
30
- | `mnemon_document_search` | Deterministically search managed Documents | Documents control layer |
31
-
32
- “Read only” means managed bodies and durable semantics do not change. `mnemon_document_search` still updates `lastAccessedAt` for LRU ordering, so feature read-only is not disk read-only.
33
-
34
- ### Tools available with `writeEnabled=true`
35
-
36
- | Tool | Purpose | Root Agent path |
37
- |---|---|---|
38
- | `mnemon_runtime_memory` | `add` / `replace` / `remove` hot memory | Deterministic control; add overflow may start a worker |
39
- | `mnemon_document_manage` | Create, update, or archive a Document | Create/update deterministic; archive uses a worker |
40
- | `mnemon_remember` | Retain one durable insight | `spawn` write worker |
41
- | `mnemon_link` | Create a typed relationship | `spawn` write worker |
42
- | `mnemon_forget` | Soft-delete an exact ID | `spawn` write worker |
43
- | `mnemon_memory_body_create` | Create an independent Memory Space | `spawn` write worker |
44
- | `mnemon_memory_body_update` | Update name, description, or active state | `spawn` write worker |
45
- | `mnemon_memory_body_merge` | Non-destructive import merge | `spawn` write worker |
46
-
47
- When a worker invokes the same tool name, it reaches the service directly and is not delegated recursively.
48
-
49
- ## Tool admission
50
-
51
- - **Runtime**: explicit preferences, stable project conventions, environment facts, and high-frequency lessons.
52
- - **Documents**: designs, investigations, procedures, postmortems, or handoffs with complete structure and rationale.
53
- - **Memory Spaces**: stable facts, decisions, and insights that must survive across tasks or benefit from graph relationships.
54
- - **Skip**: questions, guesses, temporary progress, completion logs, raw output, secrets, and ordinary repository facts that are easy to rediscover.
55
-
56
- `mnemon_forget` is a destructive semantic action. Use it only on explicit request or after confirming that content is wrong or obsolete.
57
-
58
- ## `/mnemon` commands
59
-
60
- ```text
61
- /mnemon
62
- /mnemon status
63
- /mnemon recall <query>
64
- /mnemon related <full memory ID>
65
- /mnemon remember <content>
66
- /mnemon forget <exact ID>
67
- ```
68
-
69
- - Empty `/mnemon` equals `status`.
70
- - `status` is deterministic and starts no model.
71
- - `recall`, `related`, `remember`, and `forget` use the live Agent containing the command as worker parent.
72
- - Command recall returns at most 10 results.
73
- - `forget` requires one exact ID without spaces.
74
-
75
- ## In-conversation contracts
76
-
77
- | DSH slot | Registration | Behavior |
78
- |---|---|---|
79
- | `conversation.chat.turnTail` | chain | `turn-activity` summarizes `mnemon_*` calls from completed turns; open turns and turns without activity render nothing |
80
- | `conversation.chat.assistant-actions` | list, `id=mnemon-save` | `assistant-message` reads finalized text; `supervise` runs only after confirmation |
81
-
82
- Both are additive and replace no official DSH rendering. The assistant-message candidate is editable and long replies are bounded by the UI preview limit. Persistence is complete only after a memory-subagent receipt.
83
-
84
- ## Workspace routing
85
-
86
- Workbench requests carry `sessionId` and an optional `workspaceId`. The Host accepts only IDs registered in `workspaceRegistry`:
87
-
88
- - deterministic reads and manual maintenance may route to the inspected root selected by `workspaceId`;
89
- - Agents, tools, commands, and lifecycle hooks still route by the Agent cwd associated with `sessionId`;
90
- - `status.workspaceContext` returns selected / effective roots and `aligned`;
91
- - Agent-backed operations are rejected while misaligned.
92
-
93
- ## RPC channels
94
-
95
- RPC is an internal Host-to-client bridge, not a stable external HTTP API.
96
-
97
- ### Read channel
98
-
99
- ```text
100
- channel: /dsh-mnemon-read
101
- authority: trusted-host
102
- ```
103
-
104
- | Endpoint | Behavior |
105
- |---|---|
106
- | `status` | Aggregated service, version, lifecycle, Documents, and workspace/storage context |
107
- | `versions` | Check installed/latest Mnemon and dsh-mnemon versions and installation sources |
108
- | `runtime-memory` | Runtime snapshot |
109
- | `documents` / `document` / `document-search` | Directory, body, and deterministic search |
110
- | `graph` / `bodies` | Active multi-space graph and Memory Space directory |
111
- | `list` / `entities` | Durable content list and entity aggregation |
112
- | `search` / `agent-search` / `related` | Direct retrieval, evidence answer, and relation traversal |
113
- | `turn-activities` / `turn-activity` | Session-wide or single-turn memory-tool activity |
114
- | `assistant-message` | Finalized assistant text by messageId |
115
-
116
- ### Write channel
117
-
118
- ```text
119
- channel: /dsh-mnemon-write
120
- authority: loopback
121
- ```
122
-
123
- | Endpoint | Behavior |
124
- |---|---|
125
- | `runtime-memory` | Hot-memory mutation |
126
- | `supervise` | Submit a candidate to the memory worker |
127
- | `document` | create / update / archive |
128
- | `remember` / `link` / `forget` | Durable semantic write, relation, and soft deletion |
129
- | `body-create` / `body-update` / `body-delete` | Create, edit, or physically delete a confirmed Memory Space |
130
- | `version-update` | Update a named component with Host-fixed commands and arguments |
131
-
132
- With `writeEnabled=false`, the channel remains registered but mutations are rejected at the Host boundary.
133
-
134
- ### Backup channel
135
-
136
- ```text
137
- channel: /dsh-mnemon-pack
138
- authority: loopback
139
- ```
140
-
141
- | Endpoint | Behavior |
142
- |---|---|
143
- | `target` | Effective root and scope |
144
- | `export` | Export a complete ZIP with manifest and SHA-256 checksums |
145
- | `inspect` | Parse and verify an import ZIP, returning component and occupancy preview |
146
- | `import` | Safely merge into the effective root; rejected in read-only mode |
147
-
148
- Backups contain private memory, so the entire channel is loopback-only.
149
-
150
- ### Settings channel
151
-
152
- ```text
153
- channel: /dsh-mnemon-settings
154
- authority: loopback
155
- namespaces: mnemon, mnemon-ui
156
- endpoints: get, mutate
157
- ```
158
-
159
- Mutations use settings revisions to prevent overwriting concurrent edits. `mnemon` owns Host/storage settings; `mnemon-ui` owns `turnBar` and `saveAction`.
160
-
161
- ## npm exports
162
-
163
- The root package exposes Host composition and core classes:
164
-
165
- ```text
166
- apply
167
- Config / resolveConfig
168
- createRunner
169
- MnemonService
170
- RuntimeMemoryController
171
- DocumentManager
172
- StorageScopeInspector
173
- MnemonSubagentCoordinator
174
- MnemonLifecycle
175
- ```
176
-
177
- `dsh-mnemon/client` exports `apply` and `inject` for the DSH client bundle. Client implementation classes and RPC endpoints are internal and should not be treated as a stable public SDK.
178
-
179
- ## Internationalization
180
-
181
- The main Sidebar / Buildin workbench, settings, and conversation entries support Chinese and English and follow DSH locale live. Brand names, tool names, and configuration keys are not translated. `/mnemon` commands, model-tool cards, some Host errors, and compatibility metadata remain partially untranslated.
@@ -1,166 +0,0 @@
1
- # Operations, Security, and Troubleshooting
2
-
3
- [简体中文](../zh-CN/operations.md) | **English** | [Documentation hub](./README.md)
4
-
5
- ## Health checks
6
-
7
- Check the binary, then open **Status** in the workbench:
8
-
9
- ```sh
10
- command -v mnemon
11
- mnemon --version
12
- ```
13
-
14
- ```text
15
- /mnemon status
16
- ```
17
-
18
- [![Status with component versions, three-tier data, and effective directories](../assets/screenshots/status-overview.png)](../assets/screenshots/status-overview.png)
19
-
20
- Status shows Mnemon / dsh-mnemon versions, Runtime, Memory Spaces, Documents, and effective directories. `mnemon status` opens the effective Store and may initialize data or run upstream migrations, so it is not a completely side-effect-free probe.
21
-
22
- ## Version checks and updates
23
-
24
- **Check versions** on Status opens the version panel:
25
-
26
- [![Check and update Mnemon CLI and dsh-mnemon](../assets/screenshots/version-check.png)](../assets/screenshots/version-check.png)
27
-
28
- - **Mnemon CLI**: installed from `mnemon --version`; latest from Mnemon GitHub Releases.
29
- - **dsh-mnemon**: installed from the running package; latest from the npm registry.
30
-
31
- Checking is read-only and never installs automatically. Update appears only when a newer version exists and the source is safely recognized. Mnemon supports Homebrew Cask / Formula and `go install`; dsh-mnemon supports npm installations managed by pnpm in the owning DSH Profile. `link:` / `file:` development builds and unrecognized manual installs show guidance only.
32
-
33
- The Host fixes update commands and arguments. The browser cannot supply either; shell is disabled and execution/output are bounded. After an update, the UI rechecks both components and refreshes Status automatically. Mnemon applies on the next CLI call. Restart `dsh web` after updating dsh-mnemon.
34
-
35
- ## Backup and recovery
36
-
37
- ### Recommended: Settings ZIP
38
-
39
- **Settings → Memory System → Backup and migration** operates on the **currently effective root**:
40
-
41
- - **Export ZIP** includes Runtime, Documents, and every Memory Space.
42
- - **Import ZIP** previews, validates, then merges into the effective root.
43
- - Packs include `manifest.json`, SHA-256 inventory, and component summaries.
44
- - Export/import hold component locks; a Memory Space with an uncheckpointed WAL is rejected.
45
- - Import checks paths, counts, compressed/expanded limits, JSON schemas, Document hashes, registry consistency, and SQLite headers.
46
- - Merge is staged before replacing component directories; commit failure restores pre-import directories.
47
-
48
- The UI offers safe merge, not “overwrite everything”:
49
-
50
- - Runtime deduplicates by target and content.
51
- - Identical Document ID + hash is skipped; conflicting content receives a new ID.
52
- - Identical Memory Space ID + database is skipped; conflicting content receives a new ID.
53
-
54
- Import is governed by `writeEnabled` and is rejected in read-only deployments. A ZIP contains private memory—encrypt it, restrict access, and rehearse recovery.
55
-
56
- ### Recovery rehearsal
57
-
58
- 1. Select an isolated `custom` directory and save.
59
- 2. Confirm **Current directory ZIP** points to that root.
60
- 3. Select the backup, review its preview, then import.
61
- 4. Check Runtime, Documents, Memory Spaces, and directories on Status.
62
- 5. Run one focused direct recall and read one Document.
63
- 6. Only after verification decide whether to switch a production scope.
64
-
65
- Never restore directly into the only production root without another backup.
66
-
67
- ### Filesystem snapshot
68
-
69
- To preserve reserved `state` or take an offline complete snapshot, stop every DSH / Mnemon process using the root and copy:
70
-
71
- ```text
72
- <storageRoot>/runtime
73
- <storageRoot>/documents
74
- <storageRoot>/data
75
- <storageRoot>/state # when present; outside the built-in Pack's three data components
76
- ```
77
-
78
- Generate an inventory or checksums and rehearse recovery in isolation. A normal directory copy while writers are running is not a consistent snapshot.
79
-
80
- ## Changing storage scope
81
-
82
- Saving `global` / `workspace` / `custom` initializes a new runtime graph before switching atomically. The page reloads automatically, but **data is not migrated**:
83
-
84
- ```text
85
- old scope -- save --> new empty or existing root
86
-
87
- no automatic copy
88
- no automatic merge
89
- no automatic delete
90
- ```
91
-
92
- Recommended migration: export from the old scope → switch and confirm the new root → import → verify. In Workspace mode, confirm both inspection and execution targets.
93
-
94
- ## Security boundaries
95
-
96
- ### Process
97
-
98
- - CLI uses `spawn(command, args, { shell: false })`.
99
- - stdout + stderr are capped at 2 MiB by default.
100
- - Calls use `timeoutMs` and AbortSignal; cancellation sends `SIGTERM`, then `SIGKILL` after 1.5 seconds.
101
- - One Runner serializes calls; separate DSH processes still rely on Mnemon / SQLite concurrency.
102
-
103
- ### Files
104
-
105
- - Runtime, Documents, and Pack operations use in-process queues or component locks.
106
- - Lock wait defaults to 5 seconds; stale threshold is 30 seconds.
107
- - Writes use temporary files, staging, and rename.
108
- - Runtime revisions block stale compaction; Document revisions block movement of updated originals.
109
- - `sourcePaths` cannot escape the initiating workspace or point into managed Documents.
110
-
111
- ### Web and model
112
-
113
- - Read RPC is `trusted-host`; write, settings, and backup RPC are `loopback`.
114
- - The WebUI neither reads SQLite directly, starts processes, nor supplies arbitrary update commands.
115
- - Workers use persona, tool allowlists, structured output, and `maxDepth: 1`.
116
- - Queries, candidates, Document bodies, and historical memory are treated as untrusted data.
117
-
118
- These boundaries are not a secret scanner. There is no deterministic credential detection; never submit keys, tokens, private keys, or raw sensitive logs.
119
-
120
- ### Security reporting
121
-
122
- Report vulnerabilities privately through [SECURITY.md](../../SECURITY.md), not a public issue. Data loss, path traversal, lock/revision bypasses, subagent-isolation breaks, and injection through rendered memory are in scope.
123
-
124
- ## Troubleshooting
125
-
126
- | Symptom | Check and resolution |
127
- |---|---|
128
- | Mnemon unavailable | Run `command -v mnemon`, `mnemon --version`; set `MNEMON_CLI_PATH` or `cliPath`, then restart |
129
- | Memory System missing from sidebar | Check `tabEnabled=true`, `displayMode=sidebar`; Buildin is in the conversation area; for a local link run `pnpm run build`, then restart |
130
- | Status healthy but recall empty | Check active spaces, storage scope, inspected root, effective session root, and query focus |
131
- | Header reports misalignment | The workbench is inspecting another workspace; align or keep deliberate read-only inspection; Agent-backed actions are rejected |
132
- | Saved settings appear unchanged | Inspect the save error; success applies live and reloads automatically without refresh |
133
- | Custom directory rejected | Use an absolute path, `~`, or `~/...` |
134
- | `memoryBodyId is required...` | Active count is not exactly one; select a target explicitly |
135
- | `memory body is not active for reading` | Activate it in Overview; inactive writes are allowed, reads are not |
136
- | Provider error | Semantic work needs full isolation capabilities; background review additionally needs `fork + inheritsParentContext` |
137
- | Runtime replace exceeds capacity | Shorten it or organize first; automatic maintenance handles add overflow only |
138
- | Document source path rejected | Keep it inside the session workspace and outside managed Documents |
139
- | CLI timeout | Increase `timeoutMs`; large Stores may need more than 10 seconds for status or graph |
140
- | Lock timeout | Check other writers; never delete a lock owned by a live process |
141
- | ZIP export reports WAL busy | Wait for Memory Space writes to settle; do not bypass the uncheckpointed-WAL guard |
142
- | ZIP import checksum/schema failure | The backup is damaged or incompatible; preserve the current root and never unzip over it manually |
143
- | No Update button | Already current, remote check failed, or the source is link/manual; follow panel guidance |
144
- | Remote page reads but cannot write | Write, settings, and backup RPC enforce loopback by design |
145
-
146
- ## Known limitations
147
-
148
- ### Feature read-only is not disk read-only
149
-
150
- `writeEnabled=false` disables semantic mutation and Pack import, but startup may initialize/repair Runtime, Document search updates `lastAccessedAt`, and Mnemon reads may migrate a database.
151
-
152
- ### Shared Documents scope
153
-
154
- `global` and `custom` can share one Document index across workspaces; records have no independent workspace-ownership field. `sourcePaths` are checked against the initiating cwd only when written.
155
-
156
- ### Cross-system transactions
157
-
158
- Cold-index-first protects active content but is not a rollback-capable distributed transaction across Mnemon SQLite and the filesystem. A revision conflict after indexing may leave a duplicate reference; the system preserves data.
159
-
160
- ### Background watermark
161
-
162
- Activity score, latest checkpoint, and retry state are not persisted. Host restart clears unprocessed activity. Failure backoff, circuit breaking, and manual retry are not implemented yet.
163
-
164
- ### Versions and internationalization
165
-
166
- There is no formal fixed DSH / Mnemon support matrix. The main Web interface is bilingual, while commands, tool cards, compatibility metadata, and some errors remain partially untranslated.
@@ -1,145 +0,0 @@
1
- # Project Overview: Local Three-Tier and Cross-Agent Memory for DSH
2
-
3
- [简体中文](../zh-CN/project-overview.md) | **English** | [Documentation hub](./README.md)
4
-
5
- `dsh-mnemon` integrates [Mnemon](https://github.com/mnemon-dev/mnemon) Memory Spaces with DeepSeek Harness, then adds Runtime hot memory, Project Documents, lifecycle routing, bounded subagents, a deterministic control layer, and native DSH interfaces. Because the durable tier uses native Mnemon Stores, DSH can reuse the same local long-term memory with other Mnemon-enabled agents.
6
-
7
- Its goal is not to store more text. It balances long-term continuity, current-fact priority, context cost, and recoverable writes.
8
-
9
- [![Memory Space overview with catalog, activation boundary, and multi-space graph](../assets/screenshots/overview-memory-graph.png)](../assets/screenshots/overview-memory-graph.png)
10
-
11
- ## Why three tiers
12
-
13
- One memory tier cannot serve frequent injection, full-document reading, and cross-session recall equally well:
14
-
15
- | Need | With one memory tier | dsh-mnemon's choice |
16
- |---|---|---|
17
- | Know stable preferences and rules on the next turn | Retrieval adds latency and may miss | Inject compact Runtime projections every turn |
18
- | Read a complete design, investigation, or procedure | Fragmentation loses narrative and provenance | Keep managed Markdown Documents |
19
- | Find cross-session facts, decisions, and relations | Full loading pollutes context | Recall bounded graph-enhanced evidence on demand |
20
- | Preserve traceability for cold long-form material | Keeping it hot consumes capacity forever | Create a cold reference before moving the original |
21
- | Let a model judge value without owning system safety | An LLM cannot guarantee paths, locks, or transactions | Workers own semantics; the Host owns hard boundaries |
22
-
23
- Priority always remains: **current user instructions → live tools and repository facts → historical memory**.
24
-
25
- ## The three-tier model
26
-
27
- ### 1. Runtime Memory
28
-
29
- Runtime retains compact, high-frequency information useful on many turns:
30
-
31
- - `USER.md`: identity, roles, preferences, habits, and explicit collaboration requirements;
32
- - `MEMORY.md`: project conventions, environment facts, decisions, tool behavior, and reusable lessons.
33
-
34
- `runtime/memories.json` is the source of truth; both Markdown files are deterministic projections. USER is capped at 4 KiB and MEMORY at 10 KiB, measured in UTF-8 bytes. Regular mutations are deterministic; only capacity maintenance may start a worker.
35
-
36
- ### 2. Project Documents
37
-
38
- Documents preserve complete designs, investigations, procedures, postmortems, and handoffs. Title, retrieval description, and body participate in deterministic search; the body keeps Markdown structure.
39
-
40
- One body may be up to 2 MiB and active rendered content up to 10 MiB. Before manual or capacity archiving, a bounded worker writes a Mnemon cold reference containing a summary and SHA-256. The original moves only if its revision is unchanged. Failure or conflict preserves active content.
41
-
42
- ### 3. Memory Spaces
43
-
44
- Each Memory Space maps to an independent Mnemon Store and `mnemon.db`, with a stable ID, name, routing description, and activation state.
45
-
46
- - Reads cover active spaces only.
47
- - Writes may target any registered space and activate it after success.
48
- - Durable memory preserves temporal, semantic, causal, and entity relations.
49
- - Recall retains Memory Space provenance and memory IDs for related traversal.
50
-
51
- See [Storage and the three-tier model](./storage-model.md) for authoritative files, capacities, and directories.
52
-
53
- ## Cross-agent sharing boundary
54
-
55
- “Sharing” does not mean that dsh-mnemon broadcasts conversations or files to arbitrary agents. It means that multiple Mnemon-enabled agents use the same local Mnemon data:
56
-
57
- 1. every participant installs and integrates Mnemon;
58
- 2. every participant can access the same `storageRoot`;
59
- 3. durable memories intended for sharing live in Mnemon Stores recognized by those participants.
60
-
61
- Under those conditions, another Mnemon-enabled agent can recall durable facts, entities, and relations written through DSH, and DSH can discover compatible memories written in the other direction. This boundary covers Mnemon Memory Spaces only. `runtime/` and `documents/` are DSH layers managed by dsh-mnemon and do not automatically become another agent's context merely because the root is shared.
62
-
63
- The default `global` root, `~/.mnemon`, is the simplest choice for several local agents. Use `custom` for an explicitly agreed shared root, or `workspace` to constrain sharing to one project. Concurrent processes rely on Mnemon and SQLite concurrency semantics; stop every user before offline copying, migration, or direct database changes.
64
-
65
- ## Architecture
66
-
67
- [![dsh-mnemon runtime architecture with DSH Web, Root Agent, supervised control, and three local tiers](../assets/diagrams/en/project-architecture.svg)](../assets/diagrams/en/project-architecture.svg)
68
-
69
- Four boundaries shape the system:
70
-
71
- 1. **Interaction**: conversation, Sidebar / Buildin workbench, `/mnemon` commands, and model tools.
72
- 2. **Supervision**: durable recall, semantic writes, and archiving run in bounded workers; lifecycle hooks provide short cues and scheduling signals.
73
- 3. **Deterministic control**: the Host enforces schema, paths, permissions, capacity, locks, revisions, CLI arguments, timeouts, and cancellation.
74
- 4. **Local data**: Runtime, Documents, and Memory Spaces share the effective `storageRoot` and require no remote memory service.
75
-
76
- ### Memory System flow
77
-
78
- This diagram describes stable execution boundaries, not a live status dashboard. Solid lines are deterministic Host paths; dashed lines require supervised LLM judgment.
79
-
80
- [![Memory System flow across per-turn context, on-demand semantics, maintenance, and archive](../assets/diagrams/en/memory-system-flow.png)](../assets/diagrams/en/memory-system-flow.png)
81
-
82
- The three major flows are:
83
-
84
- - **Per-turn context**: Runtime projections enter the prompt; the Root Agent searches active Documents deterministically when needed.
85
- - **On-demand semantics**: the Root Agent dispatches a `spawn` worker through the Host Bridge to active Memory Spaces; only bounded evidence or receipts return.
86
- - **Maintenance and archive**: the Host applies ordinary mutations atomically; idle review uses `fork` from a completed checkpoint; Document archive verifies a cold index before moving the original across a revision fence.
87
-
88
- See [Lifecycle and workflows](./workflows.md) for thresholds, cancellation, and failure semantics.
89
-
90
- ## Read path: near to far
91
-
92
- A history-dependent request expands in this order:
93
-
94
- 1. current request, live tool results, and repository files;
95
- 2. Runtime Memory already in the prompt;
96
- 3. deterministic search and on-demand full text from active Documents;
97
- 4. supervised recall from active Memory Spaces;
98
- 5. archived originals only after following a cold-reference hit.
99
-
100
- `mnemon_recall` starts an isolated worker. It selects the narrowest spaces from names and descriptions and can use only allowed recall/related tools. The complete catalog and routing trace do not fill the root conversation.
101
-
102
- Direct recall in the Web returns raw evidence. Agent query retrieves the same evidence, then gives it to an evidence-only worker with no Mnemon tools.
103
-
104
- ## Write path: semantics versus guarantees
105
-
106
- | Memory worker | Host guarantees |
107
- |---|---|
108
- | Decide whether a candidate is durable | Input schema and operation permissions |
109
- | Select the narrowest space and deduplicate | Workspace and path confinement |
110
- | Distill self-contained content and relation rationale | Shell-free CLI, bounded output, timeout, and cancellation |
111
- | Decide when long-form work belongs in Documents | Locks, temporary files, rename, and revision fences |
112
- | Maintain conservatively within its persona | UTF-8 capacity and original-data preservation on failure |
113
-
114
- Durable recall and writes prefer isolated `spawn`. Score-based background review uses `fork` only after a completed turn crosses its threshold and remains idle. A new turn cancels pending or running review.
115
-
116
- ## What users see
117
-
118
- The default Sidebar has four primary pages: Status, Runtime, Memory Spaces, and Documents. Memory Spaces adds Overview, Recall, Content, and Entities. Add, edit, and Remember use consistent dialogs; long collections use filters and progressive loading.
119
-
120
- Two additive entries surface memory in conversations:
121
-
122
- - **Turn memory** summarizes this turn's memory tools and links to matching pages.
123
- - **Save to memory** loads a finalized reply into an editable confirmation; supervised writing starts only after confirmation.
124
-
125
- See the [Sidebar and conversation UI guide](./ui-guide.md) for screenshots and workspace inspection/execution semantics. See [Interfaces](./interfaces.md) for tools, commands, and RPC.
126
-
127
- ## Local-first reliability
128
-
129
- - CLI calls use argument arrays with `shell=false`, bounded output, timeout, and cancellation.
130
- - Runtime and Documents use in-process queues, cross-instance locks, temporary files, and rename.
131
- - Runtime revisions block stale compaction; Document revisions block movement of updated originals.
132
- - Subagents use persona, tool allowlists, structured output, and depth limits.
133
- - The WebUI never reads SQLite directly or supplies arbitrary update commands.
134
- - The plugin stores no model credentials, but it does not yet include a deterministic secret scanner.
135
-
136
- These guarantees are not a rollback-capable distributed transaction across Mnemon SQLite and the filesystem. When uncertain, the system preserves original data. See [Operations](./operations.md) for complete boundaries and limitations.
137
-
138
- ## Continue reading
139
-
140
- - [Getting Started](./getting-started.md): installation and first verification.
141
- - [Sidebar and conversation UI guide](./ui-guide.md): complete visual workflow.
142
- - [Architecture](./architecture.md): modules, workers, and trust boundaries.
143
- - [Storage model](./storage-model.md): directories, capacity, and authority.
144
- - [Lifecycle and workflows](./workflows.md): injection, recall, writing, review, and archive.
145
- - [Configuration](./configuration.md): display, storage, and advanced switches.