dsh-mnemon 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.en.md +169 -0
- package/README.md +169 -0
- package/cordis.patch.yml +15 -0
- package/docs/README.md +8 -0
- package/docs/en/README.md +39 -0
- package/docs/en/architecture.md +129 -0
- package/docs/en/assets/project-architecture.svg +182 -0
- package/docs/en/configuration.md +204 -0
- package/docs/en/development.md +178 -0
- package/docs/en/getting-started.md +147 -0
- package/docs/en/interfaces.md +159 -0
- package/docs/en/operations.md +151 -0
- package/docs/en/project-overview.md +247 -0
- package/docs/en/roadmap.md +41 -0
- package/docs/en/storage-model.md +179 -0
- package/docs/en/workflows.md +290 -0
- package/docs/zh-CN/README.md +39 -0
- package/docs/zh-CN/architecture.md +129 -0
- package/docs/zh-CN/assets/project-architecture.svg +182 -0
- package/docs/zh-CN/assets/screenshots/conversation-recall.png +0 -0
- package/docs/zh-CN/assets/screenshots/conversation-writeback.png +0 -0
- package/docs/zh-CN/assets/screenshots/documents-markdown.png +0 -0
- package/docs/zh-CN/assets/screenshots/entities-context.png +0 -0
- package/docs/zh-CN/assets/screenshots/memory-content.png +0 -0
- package/docs/zh-CN/assets/screenshots/overview-memory-graph.png +0 -0
- package/docs/zh-CN/assets/screenshots/recall-agent-answer.png +0 -0
- package/docs/zh-CN/assets/screenshots/runtime-memory.png +0 -0
- package/docs/zh-CN/configuration.md +204 -0
- package/docs/zh-CN/development.md +178 -0
- package/docs/zh-CN/getting-started.md +147 -0
- package/docs/zh-CN/interfaces.md +159 -0
- package/docs/zh-CN/operations.md +151 -0
- package/docs/zh-CN/project-overview.md +247 -0
- package/docs/zh-CN/roadmap.md +41 -0
- package/docs/zh-CN/storage-model.md +179 -0
- package/docs/zh-CN/workflows.md +290 -0
- package/lib/client.js +6288 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +4453 -0
- package/lib/types/client/MnemonLogo.d.ts +7 -0
- package/lib/types/client/MnemonLogo.d.ts.map +1 -0
- package/lib/types/client/MnemonLogo.js +6 -0
- package/lib/types/client/MnemonLogo.js.map +1 -0
- package/lib/types/client/MnemonSettingsCard.d.ts +9 -0
- package/lib/types/client/MnemonSettingsCard.d.ts.map +1 -0
- package/lib/types/client/MnemonSettingsCard.js +109 -0
- package/lib/types/client/MnemonSettingsCard.js.map +1 -0
- package/lib/types/client/MnemonView.d.ts +11 -0
- package/lib/types/client/MnemonView.d.ts.map +1 -0
- package/lib/types/client/MnemonView.js +1239 -0
- package/lib/types/client/MnemonView.js.map +1 -0
- package/lib/types/client/api.d.ts +68 -0
- package/lib/types/client/api.d.ts.map +1 -0
- package/lib/types/client/api.js +80 -0
- package/lib/types/client/api.js.map +1 -0
- package/lib/types/client/index.d.ts +4 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/index.js +36 -0
- package/lib/types/client/index.js.map +1 -0
- package/lib/types/client/locales.d.ts +1054 -0
- package/lib/types/client/locales.d.ts.map +1 -0
- package/lib/types/client/locales.js +1062 -0
- package/lib/types/client/locales.js.map +1 -0
- package/lib/types/client/settings.d.ts +17 -0
- package/lib/types/client/settings.d.ts.map +1 -0
- package/lib/types/client/settings.js +49 -0
- package/lib/types/client/settings.js.map +1 -0
- package/lib/types/commands.d.ts +6 -0
- package/lib/types/commands.d.ts.map +1 -0
- package/lib/types/commands.js +100 -0
- package/lib/types/commands.js.map +1 -0
- package/lib/types/config-values.d.ts +4 -0
- package/lib/types/config-values.d.ts.map +1 -0
- package/lib/types/config-values.js +4 -0
- package/lib/types/config-values.js.map +1 -0
- package/lib/types/config.d.ts +49 -0
- package/lib/types/config.d.ts.map +1 -0
- package/lib/types/config.js +55 -0
- package/lib/types/config.js.map +1 -0
- package/lib/types/contracts.d.ts +272 -0
- package/lib/types/contracts.d.ts.map +1 -0
- package/lib/types/contracts.js +2 -0
- package/lib/types/contracts.js.map +1 -0
- package/lib/types/documents.d.ts +149 -0
- package/lib/types/documents.d.ts.map +1 -0
- package/lib/types/documents.js +503 -0
- package/lib/types/documents.js.map +1 -0
- package/lib/types/guidance.d.ts +9 -0
- package/lib/types/guidance.d.ts.map +1 -0
- package/lib/types/guidance.js +18 -0
- package/lib/types/guidance.js.map +1 -0
- package/lib/types/index.d.ts +15 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +45 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/lifecycle.d.ts +75 -0
- package/lib/types/lifecycle.d.ts.map +1 -0
- package/lib/types/lifecycle.js +380 -0
- package/lib/types/lifecycle.js.map +1 -0
- package/lib/types/memory-bodies.d.ts +47 -0
- package/lib/types/memory-bodies.d.ts.map +1 -0
- package/lib/types/memory-bodies.js +160 -0
- package/lib/types/memory-bodies.js.map +1 -0
- package/lib/types/process.d.ts +14 -0
- package/lib/types/process.d.ts.map +1 -0
- package/lib/types/process.js +65 -0
- package/lib/types/process.js.map +1 -0
- package/lib/types/review-activity.d.ts +33 -0
- package/lib/types/review-activity.d.ts.map +1 -0
- package/lib/types/review-activity.js +37 -0
- package/lib/types/review-activity.js.map +1 -0
- package/lib/types/rpc.d.ts +12 -0
- package/lib/types/rpc.d.ts.map +1 -0
- package/lib/types/rpc.js +225 -0
- package/lib/types/rpc.js.map +1 -0
- package/lib/types/runner.d.ts +29 -0
- package/lib/types/runner.d.ts.map +1 -0
- package/lib/types/runner.js +150 -0
- package/lib/types/runner.js.map +1 -0
- package/lib/types/runtime-memory.d.ts +104 -0
- package/lib/types/runtime-memory.d.ts.map +1 -0
- package/lib/types/runtime-memory.js +415 -0
- package/lib/types/runtime-memory.js.map +1 -0
- package/lib/types/service.d.ts +173 -0
- package/lib/types/service.d.ts.map +1 -0
- package/lib/types/service.js +508 -0
- package/lib/types/service.js.map +1 -0
- package/lib/types/settings.d.ts +6 -0
- package/lib/types/settings.d.ts.map +1 -0
- package/lib/types/settings.js +75 -0
- package/lib/types/settings.js.map +1 -0
- package/lib/types/storage-scope.d.ts +39 -0
- package/lib/types/storage-scope.d.ts.map +1 -0
- package/lib/types/storage-scope.js +179 -0
- package/lib/types/storage-scope.js.map +1 -0
- package/lib/types/subagent.d.ts +97 -0
- package/lib/types/subagent.d.ts.map +1 -0
- package/lib/types/subagent.js +619 -0
- package/lib/types/subagent.js.map +1 -0
- package/lib/types/tools.d.ts +8 -0
- package/lib/types/tools.d.ts.map +1 -0
- package/lib/types/tools.js +328 -0
- package/lib/types/tools.js.map +1 -0
- package/package.json +111 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1600" height="1040" viewBox="0 0 1600 1040" role="img" aria-labelledby="title description" lang="en">
|
|
2
|
+
<title id="title">dsh-mnemon runtime architecture</title>
|
|
3
|
+
<desc id="description">DSH Web, the root Agent, and tools and commands enter the dsh-mnemon control and supervision layer, which connects to Runtime Memory, Project Documents, and long-term Mnemon Memory Spaces.</desc>
|
|
4
|
+
<style>
|
|
5
|
+
text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif; fill: #172033; }
|
|
6
|
+
.canvas { fill: #f7f9fc; }
|
|
7
|
+
.section { fill: #f0f3f8; stroke: #d7deea; stroke-width: 1.5; }
|
|
8
|
+
.card { fill: #ffffff; stroke: #d7deea; stroke-width: 1.5; filter: url(#shadow); }
|
|
9
|
+
.card-hot { fill: #fff3df; stroke: #c66a09; }
|
|
10
|
+
.card-doc { fill: #e8f1ff; stroke: #2563be; }
|
|
11
|
+
.card-long { fill: #e2f7ef; stroke: #087c5b; }
|
|
12
|
+
.title { font-size: 34px; font-weight: 720; letter-spacing: -0.6px; }
|
|
13
|
+
.subtitle { font-size: 17px; fill: #647086; }
|
|
14
|
+
.section-title { font-size: 17px; font-weight: 700; fill: #6558d9; letter-spacing: 0.4px; }
|
|
15
|
+
.node-title { font-size: 21px; font-weight: 700; }
|
|
16
|
+
.node-copy { font-size: 15px; fill: #647086; }
|
|
17
|
+
.node-code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; fill: #647086; }
|
|
18
|
+
.store-title { font-size: 23px; font-weight: 740; }
|
|
19
|
+
.store-copy { font-size: 15px; fill: #647086; }
|
|
20
|
+
.pill { fill: #f0f3f8; stroke: #d7deea; }
|
|
21
|
+
.pill-text { font-size: 13px; font-weight: 650; fill: #647086; }
|
|
22
|
+
.flow { fill: none; stroke: #aeb9ca; stroke-width: 2.5; marker-end: url(#arrow); }
|
|
23
|
+
.flow-hot { stroke: #c66a09; marker-end: url(#arrow-hot); }
|
|
24
|
+
.flow-doc { stroke: #2563be; marker-end: url(#arrow-doc); }
|
|
25
|
+
.flow-long { stroke: #087c5b; marker-end: url(#arrow-long); }
|
|
26
|
+
.flow-supervised { stroke: #6558d9; stroke-dasharray: 8 7; marker-end: url(#arrow-accent); }
|
|
27
|
+
.flow-label { font-size: 13px; font-weight: 650; fill: #647086; }
|
|
28
|
+
.legend { font-size: 13px; fill: #647086; }
|
|
29
|
+
.legend-line, .bus-line { marker-end: none; }
|
|
30
|
+
.bar-hot { fill: #c66a09; }
|
|
31
|
+
.bar-doc { fill: #2563be; }
|
|
32
|
+
.bar-long { fill: #087c5b; }
|
|
33
|
+
</style>
|
|
34
|
+
<defs>
|
|
35
|
+
<filter id="shadow" x="-10%" y="-20%" width="120%" height="150%">
|
|
36
|
+
<feDropShadow dx="0" dy="7" stdDeviation="10" flood-color="#21314d" flood-opacity="0.08"/>
|
|
37
|
+
</filter>
|
|
38
|
+
<marker id="arrow" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
|
39
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="#aeb9ca"/>
|
|
40
|
+
</marker>
|
|
41
|
+
<marker id="arrow-hot" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
|
42
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="#c66a09"/>
|
|
43
|
+
</marker>
|
|
44
|
+
<marker id="arrow-doc" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
|
45
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="#2563be"/>
|
|
46
|
+
</marker>
|
|
47
|
+
<marker id="arrow-long" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
|
48
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="#087c5b"/>
|
|
49
|
+
</marker>
|
|
50
|
+
<marker id="arrow-accent" viewBox="0 0 10 10" refX="8.5" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
|
51
|
+
<path d="M 0 0 L 10 5 L 0 10 z" fill="#6558d9"/>
|
|
52
|
+
</marker>
|
|
53
|
+
</defs>
|
|
54
|
+
|
|
55
|
+
<rect class="canvas" width="1600" height="1040" rx="24"/>
|
|
56
|
+
<text class="title" x="64" y="58">dsh-mnemon runtime architecture</text>
|
|
57
|
+
<text class="subtitle" x="64" y="87">DSH supervises and orchestrates · Mnemon provides deterministic durable storage · all three tiers stay local</text>
|
|
58
|
+
<rect class="section" x="48" y="300" width="1504" height="394" rx="24"/>
|
|
59
|
+
|
|
60
|
+
<g aria-label="DSH interaction surfaces">
|
|
61
|
+
<rect class="card" x="64" y="124" width="430" height="126" rx="18"/>
|
|
62
|
+
<rect class="pill" x="88" y="146" width="96" height="27" rx="13.5"/>
|
|
63
|
+
<text class="pill-text" x="136" y="165" text-anchor="middle">DSH WEB</text>
|
|
64
|
+
<text class="node-title" x="88" y="204">Memory workspace and settings</text>
|
|
65
|
+
<text class="node-copy" x="88" y="231">Eight pages · Chinese/English · global theme</text>
|
|
66
|
+
|
|
67
|
+
<rect class="card" x="585" y="124" width="430" height="126" rx="18"/>
|
|
68
|
+
<rect class="pill" x="609" y="146" width="112" height="27" rx="13.5"/>
|
|
69
|
+
<text class="pill-text" x="665" y="165" text-anchor="middle">ROOT AGENT</text>
|
|
70
|
+
<text class="node-title" x="609" y="204">Current task and main context</text>
|
|
71
|
+
<text class="node-copy" x="609" y="231">Current instructions and live facts stay authoritative</text>
|
|
72
|
+
|
|
73
|
+
<rect class="card" x="1106" y="124" width="430" height="126" rx="18"/>
|
|
74
|
+
<rect class="pill" x="1130" y="146" width="142" height="27" rx="13.5"/>
|
|
75
|
+
<text class="pill-text" x="1201" y="165" text-anchor="middle">TOOLS · COMMANDS</text>
|
|
76
|
+
<text class="node-title" x="1130" y="204">Model tools and /mnemon</text>
|
|
77
|
+
<text class="node-copy" x="1130" y="231">Explicit recall, distill, links, status, maintenance</text>
|
|
78
|
+
</g>
|
|
79
|
+
|
|
80
|
+
<g aria-hidden="true">
|
|
81
|
+
<path class="flow" d="M279 250 V281 H1298 V350"/>
|
|
82
|
+
<path class="flow flow-supervised" d="M800 250 V350"/>
|
|
83
|
+
<path class="flow" d="M1321 250 V292 H800 V350"/>
|
|
84
|
+
<text class="flow-label" x="1042" y="276">typed RPC</text>
|
|
85
|
+
<text class="flow-label" x="815" y="302">tool calls</text>
|
|
86
|
+
</g>
|
|
87
|
+
|
|
88
|
+
<text class="section-title" x="80" y="337">DSH HOST · DSH-MNEMON CONTROL AND SUPERVISION LAYER</text>
|
|
89
|
+
|
|
90
|
+
<g aria-hidden="true">
|
|
91
|
+
<path class="flow bus-line" d="M300 476 V498"/>
|
|
92
|
+
<path class="flow flow-supervised bus-line" d="M800 476 V498"/>
|
|
93
|
+
<path class="flow bus-line" d="M1300 476 V498"/>
|
|
94
|
+
<path class="flow bus-line" d="M245 498 H1300"/>
|
|
95
|
+
<path class="flow" d="M245 498 V520"/>
|
|
96
|
+
<path class="flow" d="M615 498 V520"/>
|
|
97
|
+
<path class="flow" d="M985 498 V520"/>
|
|
98
|
+
<path class="flow" d="M990 630 H1190"/>
|
|
99
|
+
</g>
|
|
100
|
+
|
|
101
|
+
<g aria-label="Supervision and permission components">
|
|
102
|
+
<rect class="card" x="100" y="350" width="400" height="126" rx="17"/>
|
|
103
|
+
<text class="node-title" x="126" y="390">Prompt and lifecycle</text>
|
|
104
|
+
<text class="node-copy" x="126" y="420">Hot-context injection · short cues · activity score</text>
|
|
105
|
+
<text class="node-code" x="126" y="448">pre-step · turn/end · idle review</text>
|
|
106
|
+
|
|
107
|
+
<rect class="card" x="600" y="350" width="400" height="126" rx="17"/>
|
|
108
|
+
<text class="node-title" x="626" y="390">Subagent Coordinator</text>
|
|
109
|
+
<text class="node-copy" x="626" y="420">isolated spawn · completed-checkpoint fork</text>
|
|
110
|
+
<text class="node-code" x="626" y="448">persona · allowlist · schema · depth=1</text>
|
|
111
|
+
|
|
112
|
+
<rect class="card" x="1100" y="350" width="400" height="126" rx="17"/>
|
|
113
|
+
<text class="node-title" x="1126" y="390">RPC and permission boundary</text>
|
|
114
|
+
<text class="node-copy" x="1126" y="420">trusted-host reads · loopback writes</text>
|
|
115
|
+
<text class="node-code" x="1126" y="448">read · write · settings channels</text>
|
|
116
|
+
</g>
|
|
117
|
+
|
|
118
|
+
<g aria-label="Deterministic control components">
|
|
119
|
+
<rect class="card" x="80" y="520" width="330" height="110" rx="16"/>
|
|
120
|
+
<text class="node-title" x="104" y="559">Runtime Memory</text>
|
|
121
|
+
<text class="node-copy" x="104" y="587">JSON authority · Markdown projections</text>
|
|
122
|
+
<text class="node-code" x="104" y="612">lock · revision · UTF-8</text>
|
|
123
|
+
|
|
124
|
+
<rect class="card" x="450" y="520" width="330" height="110" rx="16"/>
|
|
125
|
+
<text class="node-title" x="474" y="559">Documents</text>
|
|
126
|
+
<text class="node-copy" x="474" y="587">index · search · active / archived</text>
|
|
127
|
+
<text class="node-code" x="474" y="612">path boundary · LRU · SHA-256</text>
|
|
128
|
+
|
|
129
|
+
<rect class="card" x="820" y="520" width="330" height="110" rx="16"/>
|
|
130
|
+
<text class="node-title" x="844" y="559">Mnemon Service</text>
|
|
131
|
+
<text class="node-copy" x="844" y="587">space routing · recall · links · graph</text>
|
|
132
|
+
<text class="node-code" x="844" y="612">active read · targeted write</text>
|
|
133
|
+
|
|
134
|
+
<rect class="card" x="1190" y="520" width="280" height="110" rx="16"/>
|
|
135
|
+
<text class="node-title" x="1214" y="559">CLI Runner</text>
|
|
136
|
+
<text class="node-copy" x="1214" y="587">argument arrays · no shell</text>
|
|
137
|
+
<text class="node-code" x="1214" y="612">serialized · timeout</text>
|
|
138
|
+
</g>
|
|
139
|
+
|
|
140
|
+
<g aria-hidden="true">
|
|
141
|
+
<path class="flow flow-hot" d="M245 630 V760"/>
|
|
142
|
+
<path class="flow flow-doc" d="M615 630 V724 H800 V760"/>
|
|
143
|
+
<path class="flow flow-long" d="M1330 630 V724 H1310 V760"/>
|
|
144
|
+
<text class="flow-label" x="262" y="718">every-turn projection</text>
|
|
145
|
+
<text class="flow-label" x="632" y="714">managed Markdown</text>
|
|
146
|
+
<text class="flow-label" x="1344" y="713">local CLI</text>
|
|
147
|
+
</g>
|
|
148
|
+
|
|
149
|
+
<g aria-label="Three local storage tiers">
|
|
150
|
+
<rect class="card card-hot" x="64" y="760" width="440" height="194" rx="20"/>
|
|
151
|
+
<rect class="bar-hot" x="88" y="784" width="9" height="48" rx="4.5"/>
|
|
152
|
+
<text class="store-title" x="116" y="809">Runtime hot memory</text>
|
|
153
|
+
<text class="node-code" x="116" y="834"><storageRoot>/runtime</text>
|
|
154
|
+
<text class="store-copy" x="88" y="870">memories.json is the only authority</text>
|
|
155
|
+
<text class="store-copy" x="88" y="898">USER.md 4 KiB · MEMORY.md 10 KiB</text>
|
|
156
|
+
<text class="store-copy" x="88" y="926">compact context enters every root turn</text>
|
|
157
|
+
|
|
158
|
+
<rect class="card card-doc" x="580" y="760" width="440" height="194" rx="20"/>
|
|
159
|
+
<rect class="bar-doc" x="604" y="784" width="9" height="48" rx="4.5"/>
|
|
160
|
+
<text class="store-title" x="632" y="809">Project Documents</text>
|
|
161
|
+
<text class="node-code" x="632" y="834"><storageRoot>/documents</text>
|
|
162
|
+
<text class="store-copy" x="604" y="870">index.json · active/ · archived/</text>
|
|
163
|
+
<text class="store-copy" x="604" y="898">complete Markdown narrative and provenance</text>
|
|
164
|
+
<text class="store-copy" x="604" y="926">cold-reference first, then move the original</text>
|
|
165
|
+
|
|
166
|
+
<rect class="card card-long" x="1096" y="760" width="440" height="194" rx="20"/>
|
|
167
|
+
<rect class="bar-long" x="1120" y="784" width="9" height="48" rx="4.5"/>
|
|
168
|
+
<text class="store-title" x="1148" y="809">Mnemon Memory Spaces</text>
|
|
169
|
+
<text class="node-code" x="1148" y="834"><storageRoot>/data/<space-id>/mnemon.db</text>
|
|
170
|
+
<text class="store-copy" x="1120" y="870">isolated SQLite Stores · active read boundary</text>
|
|
171
|
+
<text class="store-copy" x="1120" y="898">temporal · semantic · causal · entity</text>
|
|
172
|
+
<text class="store-copy" x="1120" y="926">cross-session, on-demand, attributed evidence</text>
|
|
173
|
+
</g>
|
|
174
|
+
|
|
175
|
+
<g aria-label="Legend">
|
|
176
|
+
<line x1="70" y1="996" x2="112" y2="996" class="flow legend-line"/>
|
|
177
|
+
<text class="legend" x="124" y="1001">deterministic data / control path</text>
|
|
178
|
+
<line x1="390" y1="996" x2="432" y2="996" class="flow flow-supervised legend-line"/>
|
|
179
|
+
<text class="legend" x="444" y="1001">LLM-supervised path</text>
|
|
180
|
+
<text class="legend" x="1532" y="1001" text-anchor="end">all persistent data stays under the selected storageRoot</text>
|
|
181
|
+
</g>
|
|
182
|
+
</svg>
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# Configuration Reference
|
|
2
|
+
|
|
3
|
+
[简体中文](../zh-CN/configuration.md) | **English** | [Documentation Center](./README.md)
|
|
4
|
+
|
|
5
|
+
## Configuration Location and Activation
|
|
6
|
+
|
|
7
|
+
The plugin registers the `mnemon` namespace with the DSH settings service. User configuration is stored in:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
$DSH_HOME/settings.yaml
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The default is commonly `~/.dsh/settings.yaml`. All current settings are marked as taking effect on `restart`; restart the DSH Host after saving them.
|
|
14
|
+
|
|
15
|
+
The Web settings card edits only `storageScope` and `dataDir`. Other advanced settings must be changed directly in YAML.
|
|
16
|
+
|
|
17
|
+
## Complete Example
|
|
18
|
+
|
|
19
|
+
```yaml
|
|
20
|
+
mnemon:
|
|
21
|
+
storageScope: global # global | workspace | custom
|
|
22
|
+
# dataDir: ~/mnemon-data # required for custom
|
|
23
|
+
# cliPath: /opt/homebrew/bin/mnemon
|
|
24
|
+
# store: legacy-store # compatibility discovery hint, not a regular routing target
|
|
25
|
+
timeoutMs: 10000
|
|
26
|
+
defaultRecallLimit: 10
|
|
27
|
+
routingGuidance: true
|
|
28
|
+
lifecycleEnabled: true
|
|
29
|
+
recallMode: guided
|
|
30
|
+
writebackMode: guided
|
|
31
|
+
idleReviewMs: 30000
|
|
32
|
+
tabEnabled: true
|
|
33
|
+
writeEnabled: true
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Options
|
|
37
|
+
|
|
38
|
+
| Setting | Default | Range | Implementation Semantics |
|
|
39
|
+
|---|---:|---|---|
|
|
40
|
+
| `storageScope` | `global` | `global` / `workspace` / `custom` | Controls the root for Runtime, Documents, Memory Spaces, and reserved state as one unit |
|
|
41
|
+
| `dataDir` | unset | absolute path, `~`, or `~/...` | Required for `custom`; legacy configurations that set only this option automatically resolve to `custom` |
|
|
42
|
+
| `cliPath` | auto-discovered | executable path | Explicitly selects the Mnemon CLI |
|
|
43
|
+
| `store` | unset | `[A-Za-z0-9][A-Za-z0-9_-]*` | Compatibility discovery/preference hint for legacy Stores; semantic operations are routed through Memory Spaces |
|
|
44
|
+
| `timeoutMs` | `10000` | 100–120000 ms | Hard timeout for a single CLI call |
|
|
45
|
+
| `defaultRecallLimit` | `10` | 1–50 | Default recall count for the service and UI; individual entry points may impose a lower limit |
|
|
46
|
+
| `routingGuidance` | `true` | boolean | Whether to register an additional tiered-routing system section |
|
|
47
|
+
| `lifecycleEnabled` | `true` | boolean | Whether to enable the pre-step cue and score-based background review |
|
|
48
|
+
| `recallMode` | `guided` | `guided` / `off` | Whether to inject an on-demand recall cue; does not remove explicit recall |
|
|
49
|
+
| `writebackMode` | `guided` | `guided` / `off` | Whether to inject the hot-memory cue and enable score-based background review; does not remove explicit writes |
|
|
50
|
+
| `idleReviewMs` | `30000` | 5000–600000 ms | Required continuous idle time after the threshold is reached |
|
|
51
|
+
| `tabEnabled` | `true` | boolean | Currently gates only Host Mnemon data RPC; the client Tab is still registered—see the limitation below |
|
|
52
|
+
| `writeEnabled` | `true` | boolean | Whether to expose semantic write tools, write RPC, and write commands |
|
|
53
|
+
|
|
54
|
+
## Storage Scopes
|
|
55
|
+
|
|
56
|
+
### `global`
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
MNEMON_DATA_DIR when non-empty
|
|
60
|
+
otherwise ~/.mnemon
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Suitable for users who want Runtime, Documents, and Memory Spaces shared across multiple workspaces.
|
|
64
|
+
|
|
65
|
+
### `workspace`
|
|
66
|
+
|
|
67
|
+
```text
|
|
68
|
+
resolve(process.cwd(), ".mnemon")
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Here, cwd is the DSH Host process launch directory. It is not the current browser-page directory and does not necessarily match the cwd recorded for every session. Start DSH from the target project directory.
|
|
72
|
+
|
|
73
|
+
### `custom`
|
|
74
|
+
|
|
75
|
+
```yaml
|
|
76
|
+
mnemon:
|
|
77
|
+
storageScope: custom
|
|
78
|
+
dataDir: /absolute/path/to/mnemon-data
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`~` and `~/...` are also allowed. Relative paths are rejected.
|
|
82
|
+
|
|
83
|
+
## CLI Discovery Precedence
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
config.cliPath
|
|
87
|
+
-> executable MNEMON_CLI_PATH
|
|
88
|
+
-> each PATH directory
|
|
89
|
+
-> ~/.local/bin/mnemon
|
|
90
|
+
-> /opt/homebrew/bin/mnemon
|
|
91
|
+
-> /usr/local/bin/mnemon
|
|
92
|
+
-> /usr/bin/mnemon
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
An explicit `cliPath` is accepted as configured; if it is not executable, actual calls return a launch error.
|
|
96
|
+
|
|
97
|
+
## Compatibility Store Hint Precedence
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
config.store
|
|
101
|
+
-> MNEMON_STORE
|
|
102
|
+
-> <storageRoot>/active
|
|
103
|
+
-> default
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
After the Memory Space directory has been established, long-term semantic operations use explicit Memory Space IDs and do not rely on the global active Store for routing.
|
|
107
|
+
|
|
108
|
+
## Provider Requirements
|
|
109
|
+
|
|
110
|
+
Regular workers prefer `spawn`. If no provider has that name, another provider with all of the following capabilities can be selected:
|
|
111
|
+
|
|
112
|
+
```text
|
|
113
|
+
outputSchema = true
|
|
114
|
+
toolFilter = true
|
|
115
|
+
persona = true
|
|
116
|
+
depthLimit = true
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Background review has no fallback: a compatible provider named `fork` must exist and must have:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
inheritsParentContext = true
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
A missing `fork` does not block deterministic state or regular UI reads, but a subagent failure is recorded when the review threshold is reached.
|
|
126
|
+
|
|
127
|
+
## Read-Only Configuration
|
|
128
|
+
|
|
129
|
+
```yaml
|
|
130
|
+
mnemon:
|
|
131
|
+
writeEnabled: false
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Effects:
|
|
135
|
+
|
|
136
|
+
- Model write tools are not registered;
|
|
137
|
+
- `/dsh-mnemon-write` RPC is not registered;
|
|
138
|
+
- `/mnemon remember` and `/mnemon forget` are rejected;
|
|
139
|
+
- semantic mutations through `MnemonService` are rejected.
|
|
140
|
+
|
|
141
|
+
This is feature-level read-only behavior, not a read-only filesystem mode: the Runtime controller may still initialize or repair projections, Document search updates LRU access times, and Mnemon read commands may trigger upstream database migrations. Do not treat `writeEnabled=false` as a safety guarantee for read-only mounts.
|
|
142
|
+
|
|
143
|
+
## Switch Interactions
|
|
144
|
+
|
|
145
|
+
```text
|
|
146
|
+
writeEnabled=false
|
|
147
|
+
-> overrides all explicit semantic writes
|
|
148
|
+
|
|
149
|
+
writebackMode=off
|
|
150
|
+
-> no write cue, no scored review
|
|
151
|
+
-> explicit writes remain when writeEnabled=true
|
|
152
|
+
|
|
153
|
+
recallMode=off
|
|
154
|
+
-> no recall cue
|
|
155
|
+
-> explicit recall remains
|
|
156
|
+
|
|
157
|
+
lifecycleEnabled=false
|
|
158
|
+
-> no lifecycle cues or review
|
|
159
|
+
-> UI, commands, and explicit tools remain
|
|
160
|
+
|
|
161
|
+
routingGuidance=false
|
|
162
|
+
-> removes only mnemon:routing
|
|
163
|
+
-> runtime-memory prompt section remains
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Current `tabEnabled` Limitation
|
|
167
|
+
|
|
168
|
+
When `tabEnabled=false`, the Host does not register Mnemon read/write RPC, but the Web client still registers its conversation view slot unconditionally. The current result is therefore “the Tab entry may still appear while its data interface is unavailable,” not complete Tab removal. This is an implementation gap; do not rely on the setting to uninstall the UI.
|
|
169
|
+
|
|
170
|
+
## Profile Patch Overrides
|
|
171
|
+
|
|
172
|
+
The bundled `cordis.patch.yml` provides the default config row. A DSH profile configuration with the same ID may replace that row as a whole. When customizing a patch, retain every key that must remain enabled instead of assuming a deep merge.
|
|
173
|
+
|
|
174
|
+
## Common Configurations
|
|
175
|
+
|
|
176
|
+
Workspace isolation:
|
|
177
|
+
|
|
178
|
+
```yaml
|
|
179
|
+
mnemon:
|
|
180
|
+
storageScope: workspace
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
A custom data volume and a longer CLI timeout:
|
|
184
|
+
|
|
185
|
+
```yaml
|
|
186
|
+
mnemon:
|
|
187
|
+
storageScope: custom
|
|
188
|
+
dataDir: /Volumes/AgentData/mnemon
|
|
189
|
+
timeoutMs: 30000
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Keep explicit tools while disabling lifecycle behavior:
|
|
193
|
+
|
|
194
|
+
```yaml
|
|
195
|
+
mnemon:
|
|
196
|
+
lifecycleEnabled: false
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Disable only background writeback decisions:
|
|
200
|
+
|
|
201
|
+
```yaml
|
|
202
|
+
mnemon:
|
|
203
|
+
writebackMode: off
|
|
204
|
+
```
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Development and Verification
|
|
2
|
+
|
|
3
|
+
[简体中文](../zh-CN/development.md) | **English** | [Documentation Center](./README.md)
|
|
4
|
+
|
|
5
|
+
## Environment
|
|
6
|
+
|
|
7
|
+
The repository does not declare minimum Node, pnpm, DSH, or Mnemon versions in `package.json`. Use the current DSH development environment and verify compatibility through the full validation chain whenever dependencies are upgraded.
|
|
8
|
+
|
|
9
|
+
Install dependencies:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
pnpm install
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Standard Commands
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
pnpm run typecheck # tsc --noEmit
|
|
19
|
+
pnpm test # vitest run
|
|
20
|
+
pnpm run build # declarations + host/client bundles
|
|
21
|
+
pnpm run verify # typecheck + test + build
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Directory Structure
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
src/
|
|
28
|
+
+-- index.ts # Host composition root
|
|
29
|
+
+-- config.ts # settings schema
|
|
30
|
+
+-- process.ts / runner.ts # local CLI execution
|
|
31
|
+
+-- service.ts # durable-memory facade
|
|
32
|
+
+-- memory-bodies.ts # Memory Space registry
|
|
33
|
+
+-- runtime-memory.ts # hot-memory authority
|
|
34
|
+
+-- documents.ts # managed Documents
|
|
35
|
+
+-- subagent.ts # bounded workers
|
|
36
|
+
+-- lifecycle.ts # root-Agent hooks
|
|
37
|
+
+-- review-activity.ts # activity score
|
|
38
|
+
+-- tools.ts / commands.ts # model and human interfaces
|
|
39
|
+
+-- rpc.ts / settings.ts # Web bridges
|
|
40
|
+
+-- storage-scope.ts # storage inventory
|
|
41
|
+
+-- client/ # React workspace and locales
|
|
42
|
+
tests/ # Vitest suites
|
|
43
|
+
lib/ # committed build artifacts
|
|
44
|
+
docs/zh-CN/ # Chinese documentation
|
|
45
|
+
docs/en/ # English mirror
|
|
46
|
+
cordis.patch.yml # DSH profile bundle patch
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Build Artifacts
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
tsc -p tsconfig.build.json
|
|
53
|
+
-> lib/types/* declarations, maps, intermediate ESM
|
|
54
|
+
|
|
55
|
+
tsdown host bundle
|
|
56
|
+
-> lib/index.js Node ES2024 ESM
|
|
57
|
+
|
|
58
|
+
tsdown client bundle
|
|
59
|
+
-> lib/client.js DSH browser module wrapper
|
|
60
|
+
-> lib/client.js.map
|
|
61
|
+
|
|
62
|
+
lightningcss plugin
|
|
63
|
+
-> CSS Modules compiled and injected as scoped <style>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The Host keeps `cordis` and `schemastery` external. The client keeps React, ReactDOM, the JSX runtime, and Cordis external; all other dependencies are included in the bundle.
|
|
67
|
+
|
|
68
|
+
`lib/` is part of the publishing input. After modifying `src/`, rebuild and inspect the generated diff. Do not edit `lib/` manually.
|
|
69
|
+
|
|
70
|
+
## Test Layers
|
|
71
|
+
|
|
72
|
+
The existing Vitest suites cover:
|
|
73
|
+
|
|
74
|
+
- configuration parsing, CLI discovery, and process serialization;
|
|
75
|
+
- Memory Space discovery, activation, routing, and merge;
|
|
76
|
+
- recall-payload compatibility and graph parsing;
|
|
77
|
+
- Runtime JSON/Markdown consistency, locks, capacity, UTF-8, and revisions;
|
|
78
|
+
- Document paths, frontmatter, search, LRU, archiving, and conflicts;
|
|
79
|
+
- worker tool isolation, the schema subset, and structured receipts;
|
|
80
|
+
- lifecycle cues, scoring, idle debounce, cancellation, and watermark retention;
|
|
81
|
+
- RPC authority, read-only behavior, and settings revisions;
|
|
82
|
+
- the Web workspace, bilingual copy, and key interactions.
|
|
83
|
+
|
|
84
|
+
These are primarily integration tests using temporary directories, fake runners, and a mock Host. They are not equivalent to automated end-to-end tests of the real DSH + Mnemon WebUI.
|
|
85
|
+
|
|
86
|
+
## Real WebUI Verification
|
|
87
|
+
|
|
88
|
+
Use an isolated environment before release to avoid contaminating personal memory:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
temporary DSH_HOME
|
|
92
|
+
temporary MNEMON_DATA_DIR or custom storageScope
|
|
93
|
+
temporary workspace
|
|
94
|
+
independent Web port
|
|
95
|
+
local link installation
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Recommended scenarios:
|
|
99
|
+
|
|
100
|
+
1. Empty root: the UI reports no errors and can create the first Memory Space.
|
|
101
|
+
2. Regular conversation: only a short cue appears; recall and writes are not forced.
|
|
102
|
+
3. Historical question: the Agent independently recalls and returns the correct space provenance.
|
|
103
|
+
4. Explicit distillation: the worker deduplicates, selects a scope, and writes content that can be recalled again.
|
|
104
|
+
5. Multiple spaces: reads cover only active spaces; writing to an inactive space activates it automatically afterward.
|
|
105
|
+
6. Runtime: USER / MEMORY add, replace, remove, and projection consistency.
|
|
106
|
+
7. Documents: create, retrieve, update, manually archive, and leave original project files unchanged.
|
|
107
|
+
8. Score-based review: light tasks do not trigger it; after reaching the threshold it waits for idle; a new turn can cancel it while preserving the watermark.
|
|
108
|
+
9. Read-only: write tools, write commands, and write RPC are rejected while reads remain available.
|
|
109
|
+
10. Status and browser console: no unhandled errors or warnings.
|
|
110
|
+
|
|
111
|
+
Capacity limits, CLI timeouts, revision conflicts, and Host restarts should be verified in a dedicated fault-injection environment.
|
|
112
|
+
|
|
113
|
+
## Modifying Subagent Schemas
|
|
114
|
+
|
|
115
|
+
DSH structured output supports only a compact JSON Schema subset:
|
|
116
|
+
|
|
117
|
+
```text
|
|
118
|
+
type, oneOf, properties, required, additionalProperties,
|
|
119
|
+
items, enum, const, and annotation keywords
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Do not add unsupported keywords such as `maxItems`. `assertDshOutputSchema()` recursively rejects unknown schema keys before starting a worker; result-count and similar limits are enforced by both the persona and the Host parser.
|
|
123
|
+
|
|
124
|
+
## Modifying Storage Formats
|
|
125
|
+
|
|
126
|
+
Runtime, Documents, and the Memory Space registry each have a version field or fixed structure. Changes require:
|
|
127
|
+
|
|
128
|
+
1. Define how the old format is parsed;
|
|
129
|
+
2. add a migration or rejection path;
|
|
130
|
+
3. preserve temporary-file and atomic-rename behavior;
|
|
131
|
+
4. add tests for concurrency and damaged inputs;
|
|
132
|
+
5. update the Chinese and English storage, operations, and Roadmap documents;
|
|
133
|
+
6. verify upgrade and rollback against a copied data root.
|
|
134
|
+
|
|
135
|
+
There is currently no formal schema-migration framework, so persistent formats must not change silently.
|
|
136
|
+
|
|
137
|
+
## Maintaining Documentation Internationalization
|
|
138
|
+
|
|
139
|
+
`docs/zh-CN` and `docs/en` should contain matching filenames with the same section responsibilities. When changing defaults, workflows, or limitations:
|
|
140
|
+
|
|
141
|
+
- update both languages;
|
|
142
|
+
- keep commands, configuration keys, paths, and code symbols exactly the same;
|
|
143
|
+
- cross-link corresponding language pages with relative paths;
|
|
144
|
+
- prefer accessible SVGs with no scripts or external resources for architecture overviews; keep directory trees, commands, formulas, and short protocols as copyable `text` / ASCII;
|
|
145
|
+
- keep only summaries in the root READMEs and place details on one authoritative docs page.
|
|
146
|
+
|
|
147
|
+
When the Web locale changes, the Chinese key set remains the type source of truth. The English dictionary must satisfy `Record<MnemonKey, string>` and preserve the same placeholders.
|
|
148
|
+
|
|
149
|
+
## Release Checklist
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
[ ] pnpm run verify
|
|
153
|
+
[ ] review source and generated lib diffs
|
|
154
|
+
[ ] validate package file list includes README.en.md and docs
|
|
155
|
+
[ ] install the built/local bundle into an isolated Web profile
|
|
156
|
+
[ ] run real Mnemon CLI and WebUI smoke tests
|
|
157
|
+
[ ] verify Chinese and English workspaces
|
|
158
|
+
[ ] verify global/workspace/custom paths as applicable
|
|
159
|
+
[ ] record tested DSH and Mnemon versions
|
|
160
|
+
[ ] back up any data root used for upgrade testing
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
`package.json.files` currently publishes `lib`, the patch, both root READMEs, the public bilingual docs, and the License; the historical research ledger is excluded from the installed package.
|
|
164
|
+
|
|
165
|
+
## Publishing to npm
|
|
166
|
+
|
|
167
|
+
After publication, `dsh plugin --profile web add dsh-mnemon` resolves by registry name — the same path as dsh-better-sidebar. Steps:
|
|
168
|
+
|
|
169
|
+
```sh
|
|
170
|
+
npm pack --dry-run # inspect the tarball file list (cordis.patch.yml, lib, docs)
|
|
171
|
+
pnpm publish --access public # prepublishOnly runs pnpm run verify first
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Credential convention: write NPM_TOKEN only to the user-level `~/.npmrc` (`npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}" --userconfig ~/.npmrc`) and remove it after publishing. Do **not** commit the credential line to the repository `.npmrc`: pnpm 11 deliberately ignores unexpanded environment-variable credentials in project-level `.npmrc` (with a warning), and that file travels with the repo.
|
|
175
|
+
|
|
176
|
+
2FA note: when the npm account has publish-level two-factor authentication, an interactive `pnpm publish --access public` prompts for the OTP; scripted/CI publishing needs a Classic **Automation** token or a Granular token allowed to bypass 2FA (a plain token from `npm login` cannot publish and fails with 403 Two-factor authentication required).
|
|
177
|
+
|
|
178
|
+
Before publishing, check that `package.json` `repository`/`homepage`/`bugs` point at `omdsh-dev/dsh-mnemon` (npm page consistent with GitHub) and that the version has been bumped.
|