dsh-mnemon 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/README.en.md +88 -120
  2. package/README.md +89 -121
  3. package/cordis.patch.yml +1 -0
  4. package/docs/assets/diagrams/en/memory-system-flow.png +0 -0
  5. package/docs/assets/diagrams/zh-CN/memory-system-flow.png +0 -0
  6. package/docs/assets/media/dsh-mnemon-memory-system-demo-poster.jpg +0 -0
  7. package/docs/assets/media/dsh-mnemon-memory-system-demo.gif +0 -0
  8. package/docs/assets/media/dsh-mnemon-memory-system-demo.mp4 +0 -0
  9. package/docs/assets/screenshots/conversation-memory-jump.png +0 -0
  10. package/docs/assets/screenshots/conversation-save-dialog.png +0 -0
  11. package/docs/assets/screenshots/conversation-turn-memory.png +0 -0
  12. package/docs/assets/screenshots/document-create-dialog.png +0 -0
  13. package/docs/assets/screenshots/documents-markdown.png +0 -0
  14. package/docs/assets/screenshots/entities-context.png +0 -0
  15. package/docs/assets/screenshots/memory-content.png +0 -0
  16. package/docs/assets/screenshots/overview-memory-graph.png +0 -0
  17. package/docs/assets/screenshots/recall-agent-answer.png +0 -0
  18. package/docs/assets/screenshots/remember-dialog.png +0 -0
  19. package/docs/assets/screenshots/runtime-memory-add.png +0 -0
  20. package/docs/assets/screenshots/runtime-memory.png +0 -0
  21. package/docs/assets/screenshots/settings-memory-system.png +0 -0
  22. package/docs/assets/screenshots/status-overview.png +0 -0
  23. package/docs/assets/screenshots/version-check.png +0 -0
  24. package/docs/en/README.md +38 -32
  25. package/docs/en/architecture.md +3 -1
  26. package/docs/en/configuration.md +13 -9
  27. package/docs/en/development.md +24 -4
  28. package/docs/en/getting-started.md +78 -86
  29. package/docs/en/interfaces.md +99 -89
  30. package/docs/en/operations.md +103 -92
  31. package/docs/en/project-overview.md +82 -196
  32. package/docs/en/roadmap.md +1 -1
  33. package/docs/en/storage-model.md +1 -1
  34. package/docs/en/ui-guide.md +156 -0
  35. package/docs/zh-CN/README.md +35 -29
  36. package/docs/zh-CN/architecture.md +3 -1
  37. package/docs/zh-CN/configuration.md +13 -9
  38. package/docs/zh-CN/development.md +24 -4
  39. package/docs/zh-CN/getting-started.md +71 -79
  40. package/docs/zh-CN/interfaces.md +84 -74
  41. package/docs/zh-CN/operations.md +96 -85
  42. package/docs/zh-CN/project-overview.md +78 -192
  43. package/docs/zh-CN/roadmap.md +1 -1
  44. package/docs/zh-CN/storage-model.md +1 -1
  45. package/docs/zh-CN/ui-guide.md +160 -0
  46. package/lib/client.js +2836 -2041
  47. package/lib/client.js.map +1 -1
  48. package/lib/index.js +715 -124
  49. package/lib/types/channels.d.ts +4 -0
  50. package/lib/types/channels.d.ts.map +1 -0
  51. package/lib/types/channels.js +4 -0
  52. package/lib/types/channels.js.map +1 -0
  53. package/lib/types/client/MnemonSaveAction.d.ts.map +1 -1
  54. package/lib/types/client/MnemonSaveAction.js +4 -55
  55. package/lib/types/client/MnemonSaveAction.js.map +1 -1
  56. package/lib/types/client/MnemonSettingsCard.d.ts +1 -3
  57. package/lib/types/client/MnemonSettingsCard.d.ts.map +1 -1
  58. package/lib/types/client/MnemonSettingsCard.js +13 -31
  59. package/lib/types/client/MnemonSettingsCard.js.map +1 -1
  60. package/lib/types/client/MnemonTurnTail.d.ts +3 -0
  61. package/lib/types/client/MnemonTurnTail.d.ts.map +1 -1
  62. package/lib/types/client/MnemonTurnTail.js +15 -3
  63. package/lib/types/client/MnemonTurnTail.js.map +1 -1
  64. package/lib/types/client/MnemonView.d.ts +17 -0
  65. package/lib/types/client/MnemonView.d.ts.map +1 -1
  66. package/lib/types/client/MnemonView.js +431 -96
  67. package/lib/types/client/MnemonView.js.map +1 -1
  68. package/lib/types/client/MnemonViewAppearance.d.ts +21 -0
  69. package/lib/types/client/MnemonViewAppearance.d.ts.map +1 -0
  70. package/lib/types/client/MnemonViewAppearance.js +67 -0
  71. package/lib/types/client/MnemonViewAppearance.js.map +1 -0
  72. package/lib/types/client/anchor.d.ts +1 -1
  73. package/lib/types/client/anchor.js +1 -1
  74. package/lib/types/client/api.d.ts +7 -1
  75. package/lib/types/client/api.d.ts.map +1 -1
  76. package/lib/types/client/api.js +41 -24
  77. package/lib/types/client/api.js.map +1 -1
  78. package/lib/types/client/index.d.ts +1 -1
  79. package/lib/types/client/index.d.ts.map +1 -1
  80. package/lib/types/client/index.js +63 -53
  81. package/lib/types/client/index.js.map +1 -1
  82. package/lib/types/client/locales.d.ts +158 -306
  83. package/lib/types/client/locales.d.ts.map +1 -1
  84. package/lib/types/client/locales.js +180 -328
  85. package/lib/types/client/locales.js.map +1 -1
  86. package/lib/types/client/settings.d.ts +1 -1
  87. package/lib/types/client/settings.d.ts.map +1 -1
  88. package/lib/types/client/settings.js +1 -1
  89. package/lib/types/client/settings.js.map +1 -1
  90. package/lib/types/client/sidebar-entry.d.ts +6 -0
  91. package/lib/types/client/sidebar-entry.d.ts.map +1 -0
  92. package/lib/types/client/sidebar-entry.js +134 -0
  93. package/lib/types/client/sidebar-entry.js.map +1 -0
  94. package/lib/types/client/workspace-controller.d.ts +15 -0
  95. package/lib/types/client/workspace-controller.d.ts.map +1 -0
  96. package/lib/types/client/workspace-controller.js +21 -0
  97. package/lib/types/client/workspace-controller.js.map +1 -0
  98. package/lib/types/client/workspace-mount.d.ts +8 -0
  99. package/lib/types/client/workspace-mount.d.ts.map +1 -0
  100. package/lib/types/client/workspace-mount.js +138 -0
  101. package/lib/types/client/workspace-mount.js.map +1 -0
  102. package/lib/types/commands.d.ts +10 -2
  103. package/lib/types/commands.d.ts.map +1 -1
  104. package/lib/types/commands.js +5 -1
  105. package/lib/types/commands.js.map +1 -1
  106. package/lib/types/config.d.ts +6 -5
  107. package/lib/types/config.d.ts.map +1 -1
  108. package/lib/types/config.js +12 -12
  109. package/lib/types/config.js.map +1 -1
  110. package/lib/types/contracts.d.ts +11 -0
  111. package/lib/types/contracts.d.ts.map +1 -1
  112. package/lib/types/documents.d.ts.map +1 -1
  113. package/lib/types/documents.js +6 -14
  114. package/lib/types/documents.js.map +1 -1
  115. package/lib/types/guidance.d.ts +3 -1
  116. package/lib/types/guidance.d.ts.map +1 -1
  117. package/lib/types/guidance.js +12 -0
  118. package/lib/types/guidance.js.map +1 -1
  119. package/lib/types/index.d.ts +2 -1
  120. package/lib/types/index.d.ts.map +1 -1
  121. package/lib/types/index.js +9 -8
  122. package/lib/types/index.js.map +1 -1
  123. package/lib/types/lifecycle.d.ts +9 -2
  124. package/lib/types/lifecycle.d.ts.map +1 -1
  125. package/lib/types/lifecycle.js +11 -4
  126. package/lib/types/lifecycle.js.map +1 -1
  127. package/lib/types/live-runtime.d.ts +26 -2
  128. package/lib/types/live-runtime.d.ts.map +1 -1
  129. package/lib/types/live-runtime.js +73 -3
  130. package/lib/types/live-runtime.js.map +1 -1
  131. package/lib/types/memory-bodies.d.ts +1 -0
  132. package/lib/types/memory-bodies.d.ts.map +1 -1
  133. package/lib/types/memory-bodies.js +7 -0
  134. package/lib/types/memory-bodies.js.map +1 -1
  135. package/lib/types/rpc.d.ts +7 -6
  136. package/lib/types/rpc.d.ts.map +1 -1
  137. package/lib/types/rpc.js +139 -22
  138. package/lib/types/rpc.js.map +1 -1
  139. package/lib/types/runner.d.ts +1 -1
  140. package/lib/types/runner.d.ts.map +1 -1
  141. package/lib/types/runner.js +2 -2
  142. package/lib/types/runner.js.map +1 -1
  143. package/lib/types/service.d.ts +18 -0
  144. package/lib/types/service.d.ts.map +1 -1
  145. package/lib/types/service.js +4 -0
  146. package/lib/types/service.js.map +1 -1
  147. package/lib/types/settings.d.ts.map +1 -1
  148. package/lib/types/settings.js +2 -3
  149. package/lib/types/settings.js.map +1 -1
  150. package/lib/types/subagent.d.ts +11 -2
  151. package/lib/types/subagent.d.ts.map +1 -1
  152. package/lib/types/subagent.js +34 -29
  153. package/lib/types/subagent.js.map +1 -1
  154. package/lib/types/tools.d.ts +11 -1
  155. package/lib/types/tools.d.ts.map +1 -1
  156. package/lib/types/tools.js +27 -16
  157. package/lib/types/tools.js.map +1 -1
  158. package/lib/types/version-updates.d.ts +61 -0
  159. package/lib/types/version-updates.d.ts.map +1 -0
  160. package/lib/types/version-updates.js +377 -0
  161. package/lib/types/version-updates.js.map +1 -0
  162. package/package.json +4 -1
  163. package/docs/zh-CN/assets/screenshots/conversation-recall.png +0 -0
  164. package/docs/zh-CN/assets/screenshots/conversation-writeback.png +0 -0
  165. package/docs/zh-CN/assets/screenshots/documents-markdown.png +0 -0
  166. package/docs/zh-CN/assets/screenshots/entities-context.png +0 -0
  167. package/docs/zh-CN/assets/screenshots/memory-content.png +0 -0
  168. package/docs/zh-CN/assets/screenshots/overview-memory-graph.png +0 -0
  169. package/docs/zh-CN/assets/screenshots/recall-agent-answer.png +0 -0
  170. package/docs/zh-CN/assets/screenshots/runtime-memory.png +0 -0
  171. package/lib/types/client/MnemonToolviews.d.ts +0 -19
  172. package/lib/types/client/MnemonToolviews.d.ts.map +0 -1
  173. package/lib/types/client/MnemonToolviews.js +0 -172
  174. package/lib/types/client/MnemonToolviews.js.map +0 -1
  175. /package/docs/{en/assets → assets/diagrams/en}/project-architecture.svg +0 -0
  176. /package/docs/{zh-CN/assets → assets/diagrams/zh-CN}/project-architecture.svg +0 -0
@@ -1,75 +1,61 @@
1
1
  # WebUI, Tools, Commands, and RPC
2
2
 
3
- [简体中文](../zh-CN/interfaces.md) | **English** | [Documentation Center](./README.md)
3
+ [简体中文](../zh-CN/interfaces.md) | **English** | [Documentation hub](./README.md)
4
4
 
5
- ## Web Workspace
5
+ This page is an integration reference. For daily use, start with the [Sidebar and conversation UI guide](./ui-guide.md).
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
+ ## User-facing entry points
8
8
 
9
- | Page | Purpose | Call Boundary |
10
- |---|---|---|
11
- | Status | Diagnostics for the CLI, runtime hot memory, storage scope, Memory Spaces, Documents, lifecycle, and workers | Aggregated reads |
12
- | Runtime | Inspect and maintain USER / MEMORY hot memory and capacity | Regular mutations are deterministic; capacity maintenance may start a worker |
13
- | Memory Spaces | Memory Space directory, activation switches and metadata editing, a live multi-space graph, and node inspection | Deterministic RPC reads; switches and metadata edits use write RPC |
14
- | Documents | Search, read, create, update, and archive Documents | Search/edit operations use the control layer; archiving starts a worker |
15
- | Distill | Let a memory worker select scope, deduplicate, and write; supports advanced constraints | `spawn` semantic write |
16
- | Recall | Direct smart / keyword / basic retrieval; optional evidence-bounded Agent answers | Direct service reads; Agent answers use a worker with no tools |
17
- | Entities | Frequent entities and entity-related context | Direct service reads |
18
- | Content | Browse active Memory Spaces without recall side effects, copy or clone content, or soft-delete it | Graph reads; deletion uses a worker |
19
-
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
-
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 |
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 |
31
17
 
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 对话内记忆交互侦察”.
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.
33
19
 
34
- ## Model Tools
20
+ ## Model tools
35
21
 
36
- ### Read-Only Tools
22
+ ### Read-only tools
37
23
 
38
- | Tool | Purpose | Root Agent Path |
24
+ | Tool | Purpose | Root Agent path |
39
25
  |---|---|---|
40
- | `mnemon_memory_bodies` | Read the Memory Space directory and statistics | Direct service |
26
+ | `mnemon_status` | Aggregated CLI, configuration, storage, and directory status | Direct service |
27
+ | `mnemon_memory_bodies` | Read Memory Space directory and statistics | Direct service |
41
28
  | `mnemon_recall` | Recall from one or more active spaces | `spawn` recall worker |
42
- | `mnemon_related` | Traverse relationships from a known ID | `spawn` related worker; the root path always requests two hops |
43
- | `mnemon_status` | Aggregate CLI, configuration, and active-space status | Direct service |
44
- | `mnemon_document_search` | Deterministically search managed Documents | Direct Documents control layer |
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 |
45
31
 
46
- Here, “read-only” means that managed bodies and long-term semantic content are not modified. After a hit, `mnemon_document_search` still updates `lastAccessedAt` and rewrites the Document index for LRU ordering.
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.
47
33
 
48
- ### Tools Available When `writeEnabled=true`
34
+ ### Tools available with `writeEnabled=true`
49
35
 
50
- | Tool | Purpose | Root Agent Path |
36
+ | Tool | Purpose | Root Agent path |
51
37
  |---|---|---|
52
- | `mnemon_runtime_memory` | `add` / `replace` / `remove` hot memory | Deterministic control layer; a worker is used when add overflows |
53
- | `mnemon_document_manage` | Create, update, or archive a Document | Create/update are deterministic; archive uses a worker |
54
- | `mnemon_remember` | Distill one insight into long-term memory | `spawn` write worker |
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 |
55
41
  | `mnemon_link` | Create a typed relationship | `spawn` write worker |
56
- | `mnemon_forget` | Soft-delete by exact ID | `spawn` write worker |
42
+ | `mnemon_forget` | Soft-delete an exact ID | `spawn` write worker |
57
43
  | `mnemon_memory_body_create` | Create an independent Memory Space | `spawn` write worker |
58
44
  | `mnemon_memory_body_update` | Update name, description, or active state | `spawn` write worker |
59
- | `mnemon_memory_body_merge` | Perform a non-destructive import merge | `spawn` write worker |
45
+ | `mnemon_memory_body_merge` | Non-destructive import merge | `spawn` write worker |
60
46
 
61
- When a worker calls a tool with the same name, the call goes directly to the service layer and is not delegated again.
47
+ When a worker invokes the same tool name, it reaches the service directly and is not delegated recursively.
62
48
 
63
- ## Tool Admission Guidelines
49
+ ## Tool admission
64
50
 
65
- - Hot memory: explicit user preferences, stable project conventions, environment facts, and frequently useful lessons.
66
- - Document: designs, investigations, procedures, or handoffs with complete structure and rationale.
67
- - Long-term Memory Space: stable insights that explicitly need to persist across tasks or benefit from graph relationships and deep recall.
68
- - Skip: questions, guesses, temporary progress, completion logs, raw output, secrets, and repository facts that are easy to rediscover.
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.
69
55
 
70
- `mnemon_forget` is a destructive semantic operation. It should run only when the user explicitly requests it or when content has been verified as incorrect or obsolete.
56
+ `mnemon_forget` is a destructive semantic action. Use it only on explicit request or after confirming that content is wrong or obsolete.
71
57
 
72
- ## `/mnemon` Commands
58
+ ## `/mnemon` commands
73
59
 
74
60
  ```text
75
61
  /mnemon
@@ -80,18 +66,35 @@ When a worker calls a tool with the same name, the call goes directly to the ser
80
66
  /mnemon forget <exact ID>
81
67
  ```
82
68
 
83
- - An empty `/mnemon` is equivalent to `status`.
84
- - `status` is a deterministic read and does not start a model.
85
- - `recall`, `related`, `remember`, and `forget` use the live Agent containing the command as the worker parent.
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.
86
72
  - Command recall returns at most 10 results.
87
- - The `forget` argument must be one exact ID containing no spaces.
88
- - Current command help and results are primarily in Chinese and do not yet follow the Web locale.
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`:
89
87
 
90
- ## RPC Channels
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.
91
92
 
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.
93
+ ## RPC channels
93
94
 
94
- ### Read Channel
95
+ RPC is an internal Host-to-client bridge, not a stable external HTTP API.
96
+
97
+ ### Read channel
95
98
 
96
99
  ```text
97
100
  channel: /dsh-mnemon-read
@@ -100,20 +103,17 @@ authority: trusted-host
100
103
 
101
104
  | Endpoint | Behavior |
102
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 |
103
108
  | `runtime-memory` | Runtime snapshot |
104
- | `status` | Aggregated service, lifecycle, Documents, and storage-scope status |
105
- | `documents` | Document directory snapshot |
106
- | `document` | Read one Document |
107
- | `document-search` | Deterministic search; hits update LRU metadata |
108
- | `graph` | Aggregated graph of active Memory Spaces |
109
- | `bodies` | Memory Space directory |
110
- | `list` | Content list |
111
- | `entities` | Entity statistics or entity-related context |
112
- | `search` | Direct Mnemon retrieval |
113
- | `agent-search` | Evidence-bounded answer after direct retrieval |
114
- | `related` | Direct relationship traversal |
115
-
116
- ### Write Channel
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
117
 
118
118
  ```text
119
119
  channel: /dsh-mnemon-write
@@ -123,29 +123,44 @@ authority: loopback
123
123
  | Endpoint | Behavior |
124
124
  |---|---|
125
125
  | `runtime-memory` | Hot-memory mutation |
126
- | `supervise` | Submit a Tab candidate to a memory worker |
126
+ | `supervise` | Submit a candidate to the memory worker |
127
127
  | `document` | create / update / archive |
128
- | `remember` | Semantic write with optional advanced constraints |
129
- | `link` | Create a relationship |
130
- | `forget` | Soft-delete |
131
- | `body-create` | Create a Memory Space |
132
- | `body-update` | Update metadata or active state |
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 |
133
147
 
134
- The entire write channel is not registered when `writeEnabled=false`.
148
+ Backups contain private memory, so the entire channel is loopback-only.
135
149
 
136
- ### Settings Channel
150
+ ### Settings channel
137
151
 
138
152
  ```text
139
153
  channel: /dsh-mnemon-settings
140
154
  authority: loopback
155
+ namespaces: mnemon, mnemon-ui
141
156
  endpoints: get, mutate
142
157
  ```
143
158
 
144
- Mutations use the settings revision to prevent overwriting concurrent edits.
159
+ Mutations use settings revisions to prevent overwriting concurrent edits. `mnemon` owns Host/storage settings; `mnemon-ui` owns `turnBar` and `saveAction`.
145
160
 
146
- ## npm Exports
161
+ ## npm exports
147
162
 
148
- The root package exposes Host-side composition and core classes:
163
+ The root package exposes Host composition and core classes:
149
164
 
150
165
  ```text
151
166
  apply
@@ -159,13 +174,8 @@ MnemonSubagentCoordinator
159
174
  MnemonLifecycle
160
175
  ```
161
176
 
162
- `dsh-mnemon/client` provides `apply` and `inject` for the DSH client bundle. `MnemonClient` and the RPC endpoints are currently internal implementations and should not be treated as a stable public SDK.
163
-
164
- ## Internationalization Scope
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.
165
178
 
166
- The Web dictionaries keep Chinese and English keys in one-to-one correspondence. Brand names, tool names, and configuration keys are not translated. Surfaces that are not yet fully internationalized include:
179
+ ## Internationalization
167
180
 
168
- - `/mnemon` command output;
169
- - model-tool card titles;
170
- - some Host validation and diagnostic errors;
171
- - default names and descriptions written during legacy Store compatibility discovery.
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,10 +1,10 @@
1
1
  # Operations, Security, and Troubleshooting
2
2
 
3
- [简体中文](../zh-CN/operations.md) | **English** | [Documentation Center](./README.md)
3
+ [简体中文](../zh-CN/operations.md) | **English** | [Documentation hub](./README.md)
4
4
 
5
- ## Health Checks
5
+ ## Health checks
6
6
 
7
- Check the binary first, then the plugin's aggregated status:
7
+ Check the binary, then open **Status** in the workbench:
8
8
 
9
9
  ```sh
10
10
  command -v mnemon
@@ -15,141 +15,152 @@ mnemon --version
15
15
  /mnemon status
16
16
  ```
17
17
 
18
- `mnemon status` opens the effective Store, so the upstream CLI may initialize default data or run migrations. It is not a completely side-effect-free read probe. The plugin's Status page also checks active Memory Spaces, Documents, lifecycle state, and subagent counts.
18
+ [![Status with component versions, three-tier data, and effective directories](../assets/screenshots/status-overview.png)](../assets/screenshots/status-overview.png)
19
19
 
20
- ## Security Boundaries
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
21
 
22
- ### Process
22
+ ## Version checks and updates
23
23
 
24
- - `spawn(command, args, { shell: false })`; shell commands are never concatenated.
25
- - stdout + stderr have a combined default limit of 2 MiB.
26
- - Every CLI call is governed by `timeoutMs` and an AbortSignal.
27
- - On timeout or cancellation, the process first receives `SIGTERM`, then `SIGKILL` if it has not exited after 1.5 seconds.
28
- - CLI calls within one `MnemonRunner` are serialized to avoid SQLite lock conflicts from concurrent migrations in the same process.
24
+ **Check versions** on Status opens the version panel:
29
25
 
30
- The serial queue does not replace coordination across DSH processes. When multiple Hosts access the same Mnemon Store concurrently, they still rely on Mnemon/SQLite's own concurrency semantics.
26
+ [![Check and update Mnemon CLI and dsh-mnemon](../assets/screenshots/version-check.png)](../assets/screenshots/version-check.png)
31
27
 
32
- ### Files
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.
33
30
 
34
- - Runtime and Documents both use an in-process queue and a cross-instance lock file.
35
- - Lock acquisition waits up to 5 seconds by default; a lock is considered stale only after 30 seconds.
36
- - Writes use temporary files and rename.
37
- - Runtime uses a revision to prevent stale compaction from overwriting concurrent changes.
38
- - Document archiving uses a numeric revision to prevent moving active source text that has since been updated.
39
- - `sourcePaths` cannot escape the initiating session's workspace or point into the managed Documents directory.
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.
40
32
 
41
- ### Web
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.
42
34
 
43
- - Read RPC: `trusted-host`.
44
- - Memory write RPC: `loopback`.
45
- - Settings RPC: `loopback`.
46
- - The WebUI neither reads SQLite directly nor starts processes.
35
+ ## Backup and recovery
47
36
 
48
- ### Model
37
+ ### Recommended: Settings ZIP
49
38
 
50
- - Workers use a persona, a tool allowlist, structured output, and `maxDepth: 1`.
51
- - User queries, candidate content, Document bodies, and historical memories are all treated as untrusted data.
52
- - The evidence-answer worker has no Mnemon tools and can use only the hits supplied by the Host.
39
+ **Settings → Memory System → Backup and migration** operates on the **currently effective root**:
53
40
 
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.
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.
55
47
 
56
- ### Security reporting
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.
57
55
 
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.
56
+ ### Recovery rehearsal
59
57
 
60
- ## Backup
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.
61
64
 
62
- All three tiers share `storageRoot`. A consistent backup should cover the entire root, not just `mnemon.db`:
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:
63
70
 
64
71
  ```text
65
72
  <storageRoot>/runtime
66
73
  <storageRoot>/documents
67
74
  <storageRoot>/data
68
- <storageRoot>/state # when present
75
+ <storageRoot>/state # when present; outside the built-in Pack's three data components
69
76
  ```
70
77
 
71
- Recommended procedure:
78
+ Generate an inventory or checksums and rehearse recovery in isolation. A normal directory copy while writers are running is not a consistent snapshot.
72
79
 
73
- 1. Stop the DSH Host and any other process writing to the same root.
74
- 2. Record the current plugin, DSH, and `mnemon --version` versions.
75
- 3. Copy the entire root to a new timestamped directory.
76
- 4. Generate a file inventory or checksums for the backup.
77
- 5. Complete a recovery rehearsal in an isolated path before relying on the backup.
80
+ ## Changing storage scope
78
81
 
79
- The project currently has no built-in consistent snapshot, export, or recovery command. Copying while the system is running may capture an inconsistent state across files.
82
+ Saving `global` / `workspace` / `custom` initializes a new runtime graph before switching atomically. The page reloads automatically, but **data is not migrated**:
80
83
 
81
- ## Recovery
84
+ ```text
85
+ old scope -- save --> new empty or existing root
82
86
 
83
- 1. Stop every DSH/Mnemon process using the target root.
84
- 2. Preserve a second copy of the existing root; do not overwrite the only copy of the data.
85
- 3. Restore the complete backup to a new directory.
86
- 4. First point `storageScope=custom` at the new directory.
87
- 5. Start the system and inspect the Runtime projections, Document index, Memory Space directory, and recall.
88
- 6. After verification, decide whether to replace the original root.
87
+ no automatic copy
88
+ no automatic merge
89
+ no automatic delete
90
+ ```
89
91
 
90
- If `USER.md` / `MEMORY.md` is damaged, the control layer can repair it from a valid `memories.json`. There is no general automatic repair flow for damaged JSON, the Document index, or SQLite.
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.
91
93
 
92
- ## Changing Storage Scope
94
+ ## Security boundaries
93
95
 
94
- The plugin does not migrate data automatically:
96
+ ### Process
95
97
 
96
- ```text
97
- old scope -- change setting + save --> new empty or existing scope
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.
98
102
 
99
- no implicit copy
100
- no implicit merge
101
- no implicit delete
102
- ```
103
+ ### Files
103
104
 
104
- When migration is required, stop writes and copy the complete root. Two roots cannot be merged by overwriting directories because JSON indexes, the registry, and multiple databases may conflict. Design an explicit merge procedure against backups instead.
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.
105
110
 
106
- ## Troubleshooting
111
+ ### Web and model
107
112
 
108
- | Symptom | Check and Resolution |
109
- |---|---|
110
- | Mnemon is unavailable | Run `command -v mnemon` and `mnemon --version`; set `MNEMON_CLI_PATH` or `cliPath`, then restart |
111
- | 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 |
112
- | `memoryBodyId is required...` | The active count is not exactly 1; have the worker or caller select a target explicitly |
113
- | `memory body is not active for reading` | Activate the target in Overview; writing to an inactive space is allowed, but reading is not |
114
- | Subagent provider error | Regular tasks require the full isolation capabilities; background review additionally requires `fork + inheritsParentContext` |
115
- | Settings have no effect after saving | Check the UI error; all options should apply live after a successful Save |
116
- | Custom directory is rejected | Use an absolute path, `~`, or `~/...` |
117
- | Document has no workspace | The session must correspond to a live root Agent and include cwd in its session header |
118
- | Source path is rejected | The path must stay within the session workspace and must not reference the managed Documents directory |
119
- | Runtime replace exceeds capacity | Shorten the replacement or organize it explicitly first; current automatic maintenance handles only add overflow |
120
- | CLI timeout | Increase `timeoutMs`; status and graph exports for large Stores may take longer than 10 seconds |
121
- | Lock timeout | Check whether another instance is writing; do not delete a lock that still belongs to a live process |
122
- | 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 |
123
- | A remote page can read but not write | Write RPC enforces loopback by design |
124
- | `tabEnabled=false` still shows the Tab | The setting currently stops only Host data RPC and does not remove the client slot |
125
- | Local link does not reflect source | Run `pnpm run build`, then restart the DSH profile |
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.
126
117
 
127
- ## Known Limitations
118
+ These boundaries are not a secret scanner. There is no deterministic credential detection; never submit keys, tokens, private keys, or raw sensitive logs.
128
119
 
129
- ### Feature Read-Only Is Not Disk Read-Only
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.
130
123
 
131
- `writeEnabled=false` disables semantic mutations, but startup may still create or repair Runtime files, Document search updates `lastAccessedAt`, and Mnemon reads may trigger upstream migrations. Do not assume it can operate without writes on a genuinely read-only filesystem.
124
+ ## Troubleshooting
132
125
 
133
- ### Shared Scope of Documents
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 |
134
145
 
135
- `global` and `custom` may cause multiple workspaces to share one Document index; records do not have a separate workspace-ownership field. `sourcePaths` are validated against the initiating session's cwd only when written.
146
+ ## Known limitations
136
147
 
137
- ### Cold-Reference Paths
148
+ ### Feature read-only is not disk read-only
138
149
 
139
- The current archive-worker prompt uses `.mnemon/documents/archived/<filename>` as its planned reference. Under global/custom scope, the actual file is at `<storageRoot>/documents/archived/<filename>`. When locating the original, use `documents/index.json` or the `relativePath` shown in the UI as the source of truth. This path-expression difference remains to be fixed.
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.
140
151
 
141
- ### Cross-System Transactions
152
+ ### Shared Documents scope
142
153
 
143
- “Index first, move second” protects the active source text but is not a rollback-capable distributed transaction across Mnemon SQLite and the filesystem. If a revision conflict occurs after indexing succeeds, the index may retain a duplicate reference; the plugin chooses to preserve data instead of rolling back a completed long-term write.
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.
144
155
 
145
- ### Background Watermarks
156
+ ### Cross-system transactions
146
157
 
147
- Scores, the latest checkpoint, and retry state are not persisted. Restarting the Host clears activity that has not yet been processed. Failure backoff, circuit breaking, and a manual retry entry point are not yet implemented either.
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.
148
159
 
149
- ### Version Matrix
160
+ ### Background watermark
150
161
 
151
- The project does not yet declare a formal DSH/Mnemon support matrix or schema-migration policy. Back up first and validate against an isolated root before upgrading.
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.
152
163
 
153
- ### Internationalization
164
+ ### Versions and internationalization
154
165
 
155
- The main Web workspace is bilingual in Chinese and English, but commands, tool cards, compatibility default metadata, and some error messages are not yet fully internationalized.
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.