dsh-engramory 1.3.0 → 1.4.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/README.en.md +271 -254
- package/README.md +145 -141
- package/client.js +1376 -1202
- package/index.js +3495 -3402
- package/package.json +79 -79
package/README.en.md
CHANGED
|
@@ -1,254 +1,271 @@
|
|
|
1
|
-
[简体中文](README.md) | **English**
|
|
2
|
-
|
|
3
|
-
# dsh-engramory
|
|
4
|
-
|
|
5
|
-
[](https://unstone.github.io/dsh-xray/registry.html#tinqiao-oss__engramory)
|
|
6
|
-
|
|
7
|
-
Long-term memory for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
|
|
8
|
-
(dsh). What the AI remembers is kept as plain markdown files you can open and edit
|
|
9
|
-
at any time. It is the dsh build of [Engramory](https://github.com/tinqiao-oss/engramory),
|
|
10
|
-
which is general-purpose agent memory: Claude Code, Codex and others can use the same store.
|
|
11
|
-
|
|
12
|
-

|
|
13
|
-
|
|
14
|
-
## What it does
|
|
15
|
-
|
|
16
|
-
- **The memory index comes along by itself.** The index, `MEMORY.md`, lists the notes
|
|
17
|
-
by name. The plugin brings it into the conversation as a message, so the AI knows
|
|
18
|
-
what it has saved without reading a file first, and opens a note when it needs the
|
|
19
|
-
detail. It is sent again only when it changes (a write, another project, a
|
|
20
|
-
compacted conversation): a write shows up on the next request, and a long
|
|
21
|
-
conversation does not fill up with copies of it ([social mode](#social-mode) keeps it
|
|
22
|
-
in dsh's runtime context, as before). Whatever is past the cap is left out, and the AI
|
|
23
|
-
is told to compact.
|
|
24
|
-
- **The index has a hard cap.** 200 lines / 25 KB by default. When the AI writes the
|
|
25
|
-
index with dsh's file tools and the plugin can work out the result, a write that
|
|
26
|
-
would grow it past the cap is refused before it happens, and the AI is told to
|
|
27
|
-
compact; compaction still passes. Details in [How the cap decides](#how-the-cap-decides).
|
|
28
|
-
- **The rules come with it.** What to save, how, and when to clean up: the rules
|
|
29
|
-
(a skill) are registered by the plugin, with no files to install.
|
|
30
|
-
- **A reminder to save before dsh compacts.** When a conversation grows long, dsh
|
|
31
|
-
compacts what came before into a summary, which need not keep what is worth
|
|
32
|
-
remembering later. As a conversation nears that point, the plugin reminds the AI to
|
|
33
|
-
save that first; the AI is reminded, not you.
|
|
34
|
-
- **A Memory page in the sidebar.** Read-only; it lists the notes by name and opens
|
|
35
|
-
one in your computer's default app, with a check-up that flags broken links in the
|
|
36
|
-
index and notes left out of it.
|
|
37
|
-
|
|
38
|
-
## Install
|
|
39
|
-
|
|
40
|
-
Needs Node.js
|
|
41
|
-
app you can also search for `dsh-engramory` on the Plugins page.
|
|
42
|
-
|
|
43
|
-
```sh
|
|
44
|
-
dsh plugin --profile <name> add dsh-engramory
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
To uninstall, use `remove` instead of `add`.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
the
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
| The
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
|
|
|
209
|
-
|
|
|
210
|
-
|
|
|
211
|
-
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
1
|
+
[简体中文](README.md) | **English**
|
|
2
|
+
|
|
3
|
+
# dsh-engramory
|
|
4
|
+
|
|
5
|
+
[](https://unstone.github.io/dsh-xray/registry.html#tinqiao-oss__engramory)
|
|
6
|
+
|
|
7
|
+
Long-term memory for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)
|
|
8
|
+
(dsh). What the AI remembers is kept as plain markdown files you can open and edit
|
|
9
|
+
at any time. It is the dsh build of [Engramory](https://github.com/tinqiao-oss/engramory),
|
|
10
|
+
which is general-purpose agent memory: Claude Code, Codex and others can use the same store.
|
|
11
|
+
|
|
12
|
+

|
|
13
|
+
|
|
14
|
+
## What it does
|
|
15
|
+
|
|
16
|
+
- **The memory index comes along by itself.** The index, `MEMORY.md`, lists the notes
|
|
17
|
+
by name. The plugin brings it into the conversation as a message, so the AI knows
|
|
18
|
+
what it has saved without reading a file first, and opens a note when it needs the
|
|
19
|
+
detail. It is sent again only when it changes (a write, another project, a
|
|
20
|
+
compacted conversation): a write shows up on the next request, and a long
|
|
21
|
+
conversation does not fill up with copies of it ([social mode](#social-mode) keeps it
|
|
22
|
+
in dsh's runtime context, as before). Whatever is past the cap is left out, and the AI
|
|
23
|
+
is told to compact.
|
|
24
|
+
- **The index has a hard cap.** 200 lines / 25 KB by default. When the AI writes the
|
|
25
|
+
index with dsh's file tools and the plugin can work out the result, a write that
|
|
26
|
+
would grow it past the cap is refused before it happens, and the AI is told to
|
|
27
|
+
compact; compaction still passes. Details in [How the cap decides](#how-the-cap-decides).
|
|
28
|
+
- **The rules come with it.** What to save, how, and when to clean up: the rules
|
|
29
|
+
(a skill) are registered by the plugin, with no files to install.
|
|
30
|
+
- **A reminder to save before dsh compacts.** When a conversation grows long, dsh
|
|
31
|
+
compacts what came before into a summary, which need not keep what is worth
|
|
32
|
+
remembering later. As a conversation nears that point, the plugin reminds the AI to
|
|
33
|
+
save that first; the AI is reminded, not you.
|
|
34
|
+
- **A Memory page in the sidebar.** Read-only; it lists the notes by name and opens
|
|
35
|
+
one in your computer's default app, with a check-up that flags broken links in the
|
|
36
|
+
index and notes left out of it.
|
|
37
|
+
|
|
38
|
+
## Install
|
|
39
|
+
|
|
40
|
+
Needs Node.js 22.12+ (what dsh itself needs) and `pnpm` on PATH (dsh's plugin command uses
|
|
41
|
+
it). In dsh's desktop app you can also search for `dsh-engramory` on the Plugins page.
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
dsh plugin --profile <name> add dsh-engramory
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
To uninstall, use `remove` instead of `add`.
|
|
48
|
+
|
|
49
|
+
**Name the version to upgrade**, as in `dsh plugin --profile <name> add
|
|
50
|
+
dsh-engramory@1.4.0`: by name alone, pnpm 11 (the desktop app's own included) by default
|
|
51
|
+
installs only a version published at least 24 hours ago. The desktop app's Plugins page has no *Update*
|
|
52
|
+
for a plugin from outside dsh: uninstall it, search for `dsh-engramory@<version>` and
|
|
53
|
+
install that, then quit dsh from the tray and open it again. Your memory and settings stay.
|
|
54
|
+
*Check for updates* at the foot of the memory page finds the latest version and lists
|
|
55
|
+
these steps.
|
|
56
|
+
|
|
57
|
+
Compatible dsh releases are listed in
|
|
58
|
+
`dsh.compatibility.dshReleases` in [`package.json`](https://github.com/tinqiao-oss/engramory/blob/master/adapters/dsh/plugin/package.json); an unlisted release
|
|
59
|
+
is unverified.
|
|
60
|
+
|
|
61
|
+
**Where the memory lives:**
|
|
62
|
+
|
|
63
|
+
- **The global store**, `~/.dsh/.engramory-memory/` (under `$DSH_HOME` when it is set).
|
|
64
|
+
With the plugin alone this is the only store; the AI creates it on its first save.
|
|
65
|
+
- **A project store** (optional), `.engramory-memory/` in a project's root, is created
|
|
66
|
+
by you only: run `python tools/engramory_init.py dsh --project-root <project>` from
|
|
67
|
+
the Engramory repo, which also git-ignores it. Where one exists, what holds only in
|
|
68
|
+
that project goes there; everything else stays in the global store.
|
|
69
|
+
|
|
70
|
+
Only one AI may write a store; two writers overwrite each other. To share it, let the
|
|
71
|
+
others read it only: see [one writer, many readers](https://github.com/tinqiao-oss/engramory/blob/master/adapters/reader/README.md). Memories are plain text and carry machine-local detail. Inside a project's git repo
|
|
72
|
+
the store must be git-ignored; a dedicated private repo for the store is fine.
|
|
73
|
+
|
|
74
|
+
**Without the plugin:** `python tools/engramory_init.py dsh --install-skill` writes the
|
|
75
|
+
rules into `$DSH_HOME/AGENTS.md`, installs the skill in `$DSH_HOME/skills/engramory/`
|
|
76
|
+
(`$DSH_HOME` defaults to `~/.dsh`) and creates the global store. The AI still keeps memory, but reads the index itself, and
|
|
77
|
+
the cap holds only if it runs `engramory_check.py` after each write.
|
|
78
|
+
|
|
79
|
+
## Companion mode (大肥鱼模式)
|
|
80
|
+
|
|
81
|
+
For a character you chat with: the community's 大肥鱼, or any persona. Turn on the
|
|
82
|
+
companion switch on the settings page, or set `companion: true`.
|
|
83
|
+
|
|
84
|
+

|
|
85
|
+
|
|
86
|
+
- **Three more types for the character's own life** ([SKILL.md §2.2](https://github.com/tinqiao-oss/engramory/blob/master/SKILL.md)):
|
|
87
|
+
`moment`, something you shared, with its date, folded into a monthly archive when
|
|
88
|
+
the index fills; `upcoming`, something coming up in your life, asked about once its
|
|
89
|
+
date passes and rewritten as a moment once you say how it went; `self`, a change in
|
|
90
|
+
the character itself, such as a nickname. A moment or self note is deleted only when
|
|
91
|
+
you ask it to forget.
|
|
92
|
+
- **Recall in character.** Even a greeting may call for recall, and what it remembered,
|
|
93
|
+
or failed to save, is told in the character's voice, without naming files or tools.
|
|
94
|
+
- **The persona preset needs the file tools.** The memory arrives even under a preset
|
|
95
|
+
that turns optional context off (dsh's `minimal`, for one; from dsh 0.2 — 0.1 then sends
|
|
96
|
+
no runtime context at all). To save notes, though, the
|
|
97
|
+
preset needs dsh's file tools and the skill tool; a preset with only a shell reads the
|
|
98
|
+
memory, and its writes go past the cap.
|
|
99
|
+
|
|
100
|
+
## Social mode
|
|
101
|
+
|
|
102
|
+
A choice inside companion mode, for a character other people can talk to as well, such
|
|
103
|
+
as one wired to QQ, WeChat, Douyin or Bilibili through a bridge plugin. Choose *Social*
|
|
104
|
+
under *Memory access* on the settings page, or set `audience: social`. If only you talk
|
|
105
|
+
to this dsh, keep the default, *Private*.
|
|
106
|
+
|
|
107
|
+
With it on, **only your own conversations get the memory**: one is yours when you have
|
|
108
|
+
typed in it in dsh's own window (the desktop app or `dsh web`) and nobody else has.
|
|
109
|
+
A subagent goes with its parent. Messages from a bridge plugin (unless it marks them as
|
|
110
|
+
the owner's, below), `dsh headless`, other programs, and terminal or editor clients
|
|
111
|
+
count as someone else's. Once anyone else has written in a conversation it stays
|
|
112
|
+
theirs, and the memory already put into it stays in its history.
|
|
113
|
+
|
|
114
|
+
Someone else's conversation gets no index and is not told where the store is; dsh's
|
|
115
|
+
file tools there may name files only (every directory is refused), and any path into
|
|
116
|
+
a store is refused however it is spelled; dsh's session search (an optional, experimental
|
|
117
|
+
feature that reads the records of other conversations in the same directory) is refused
|
|
118
|
+
there outright. This is **not** a security boundary: a shell tool reads any file, and
|
|
119
|
+
another profile on the same account can read the store too. Real isolation needs
|
|
120
|
+
filesystem permissions or a sandbox. A custom `skill` (see
|
|
121
|
+
[Configuration](#configuration)) reaches every conversation as written, someone else's
|
|
122
|
+
included, so if it says where the store is, they are told too.
|
|
123
|
+
|
|
124
|
+
### For bridge authors
|
|
125
|
+
|
|
126
|
+
With social mode on, every message a bridge submits counts as someone else's. For a
|
|
127
|
+
message from the owner's own account (their private QQ chat with the character, say),
|
|
128
|
+
put a `speaker` on its source:
|
|
129
|
+
|
|
130
|
+
```js
|
|
131
|
+
agent.followup(createUserMessage({
|
|
132
|
+
content: [{ type: 'text', text }],
|
|
133
|
+
source: { kind: 'plugin:your-bridge', speaker: { role: 'owner' } },
|
|
134
|
+
}))
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
| `speaker.role` | Meaning |
|
|
138
|
+
|---|---|
|
|
139
|
+
| `owner` | The owner wrote it: it comes from the account the user set as theirs in your bridge. |
|
|
140
|
+
| `guest` | Someone else wrote it, the same as no `speaker` at all. |
|
|
141
|
+
| `none` | Nobody wrote it: your plugin's own report, reminder or notice. It does not make the owner's conversation someone else's. |
|
|
142
|
+
|
|
143
|
+
In a group chat, add `chat: 'group'` (`{ role: 'owner', chat: 'group' }`): the whole
|
|
144
|
+
group reads the reply, so the conversation counts as someone else's even while only the
|
|
145
|
+
owner has spoken in it. A private chat may say `chat: 'private'` or leave it out; any
|
|
146
|
+
other value counts as a group. A group conversation stays someone else's once anyone else in it
|
|
147
|
+
speaks. A program that talks to dsh only through dsh web's API cannot set a source, so its messages count
|
|
148
|
+
as someone else's; if it sends `clientTimeZone` with a prompt it is taken for the
|
|
149
|
+
owner, so a program forwarding other people's messages must leave it out.
|
|
150
|
+
|
|
151
|
+
## Settings page and memory page
|
|
152
|
+
|
|
153
|
+

|
|
154
|
+
|
|
155
|
+
- **Settings page:** on dsh's *Plugins* page, open *Engramory memory* to set companion
|
|
156
|
+
mode, memory access and the index cap. Saving goes through dsh's own profile editor,
|
|
157
|
+
which writes your profile's `cordis.patch.yml` and reloads the plugin. Only you, signed
|
|
158
|
+
in, can call it, so an agent cannot use it to switch social mode off.
|
|
159
|
+
- **Memory page:** *Memory* in the sidebar. A banner at the top, the plugin's version
|
|
160
|
+
beside its title, says how many notes, stores and archived files are listed and when
|
|
161
|
+
they were read, with the switches (companion mode, and memory access once it is on)
|
|
162
|
+
that save as you flip them. Below it,
|
|
163
|
+
tabs by note type and a filter by name, over the global store and each workspace's
|
|
164
|
+
project store (with an absolute `indexPath`, that store alone; with a relative one,
|
|
165
|
+
none). Each note is a row: a mark for its type, its name, its type and size; a plan's
|
|
166
|
+
row gives its day and how far off it is (a passed date is an outcome to confirm, as a
|
|
167
|
+
reminder: nothing is archived), and a note past 12 KB or one the index leaves out is
|
|
168
|
+
marked. Beside each store's name: its index fill as a bar (to the nearer of its two
|
|
169
|
+
caps), *Open the index* and *Open the folder*. What its check-up finds is listed under
|
|
170
|
+
it: the index's links to files that are not there, the notes not in the index (recall
|
|
171
|
+
starts from the index, so the AI will not find them unless another note links to
|
|
172
|
+
them), notes with no type, notes past 12 KB, an index over the cap; *Copy tidy-up
|
|
173
|
+
instructions* copies a request for the AI to paste into a conversation, and the plugin
|
|
174
|
+
itself changes no file. The check-up goes by file names and the index's links alone,
|
|
175
|
+
never through a symbolic link, and is skipped when the index is over the cap, there is
|
|
176
|
+
too much to check, or a file cannot be read; `engramory_doctor.py` still does the full
|
|
177
|
+
check. Where the listing was cut short or a store could not be read, the page says so,
|
|
178
|
+
rather than counting that as nothing. Read-only, never a note's text; a name, *Open
|
|
179
|
+
the index* and *Open the folder* open on the machine dsh runs on; a machine with no
|
|
180
|
+
desktop (a headless server, a session over SSH) shows none of them. A short *How to use
|
|
181
|
+
it* follows, open while there is no memory yet. At the foot, the plugin's version and
|
|
182
|
+
*Check for updates*: only when clicked, it asks npm (npmmirror when npm cannot be
|
|
183
|
+
reached) for the latest version number, with nothing from your memory, and lists the
|
|
184
|
+
steps that upgrade to a newer one, the version named. The plugin goes online at no other
|
|
185
|
+
time. Below that, where to send feedback: a new GitHub issue (its body pre-filled with
|
|
186
|
+
the plugin's version and the OS family, no path and no note), or an email, with a button
|
|
187
|
+
that copies the address.
|
|
188
|
+
|
|
189
|
+
## Configuration
|
|
190
|
+
|
|
191
|
+
Settings the page does not cover go in your profile's `cordis.patch.yml`. Patch the
|
|
192
|
+
EXISTING row by id; a second `- insert:` adds another engramory row and leaves the old
|
|
193
|
+
caps in force. A patch replaces the row's whole `config`, so list every key you keep:
|
|
194
|
+
|
|
195
|
+
```yaml
|
|
196
|
+
- id: engramory
|
|
197
|
+
config:
|
|
198
|
+
indexName: MEMORY.md
|
|
199
|
+
maxLines: 200
|
|
200
|
+
maxBytes: 25600
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
| Field | Default | Meaning |
|
|
204
|
+
|---|---|---|
|
|
205
|
+
| `indexName` | `MEMORY.md` | The file name treated as the index. The cap matches it case-insensitively; sending the index needs the exact name on a case-sensitive filesystem (Linux, say). An index not named `.md` is shown in its folder by the memory page's *Open the index*, never opened in the default app. |
|
|
206
|
+
| `maxLines` | `200` | Line cap for the index. |
|
|
207
|
+
| `maxBytes` | `25600` | UTF-8 byte cap for the index (25 KB). |
|
|
208
|
+
| `indexPath` | unset | The one index to use: absolute, or relative to the session's directory. Unset, a `MEMORY.md` in any project is capped as an index; a store outside the default places also needs it to be found. |
|
|
209
|
+
| `registerSkill` | `true` | `false` skips the built-in rules; the cap and the index sent along stay. |
|
|
210
|
+
| `injectIndex` | `true` | `false` stops sending the index; the AI reads it instead. |
|
|
211
|
+
| `compactionReminder` | `true` | `false` stops the reminder to save before dsh compacts. The plugin works out where dsh will compact from dsh's own compaction settings (on dsh 0.2 with DeepSeek's defaults, about 69% of the window, not 80%) and reminds at 85% of that. A best effort: a conversation that grows past the gap in one step goes unreminded; with no compaction, or automatic compaction off, there is no reminder. |
|
|
212
|
+
| `language` | dsh's | `zh` (or `zh-CN` and other regional forms) writes the store in Chinese: note names, headings such as `## 用户`, the Why/How labels. Any other string is English; a value that is not a string, or is empty, counts as unset. Unset, it follows dsh's language; a change applies once dsh restarts. Frontmatter keys and `type:` values stay English, so every host reads the store. |
|
|
213
|
+
| `companion` | `false` | `true` turns companion mode on. |
|
|
214
|
+
| `audience` | `private` | With companion mode on, `social` turns social mode on. |
|
|
215
|
+
| `skill` | built-in | Your own markdown in place of the built-in rules; it must then say where the store is. In social mode, others' conversations see it too. |
|
|
216
|
+
|
|
217
|
+
## How the cap decides
|
|
218
|
+
|
|
219
|
+
| Case | Decision |
|
|
220
|
+
|---|---|
|
|
221
|
+
| The index ends within the caps | allow |
|
|
222
|
+
| The write grows the index past a cap | **deny**, with the numbers and what to compact |
|
|
223
|
+
| The index is over a cap and the write shrinks it or keeps its size | allow, so compaction can go step by step (210 → 205 → 198) |
|
|
224
|
+
| A partial edit whose result can be worked out: `edit` (`old_string`/`new_string`), `str_replace_editor`'s replace (`old_str`/`new_str`) and `insert` | its result is worked out first, then judged as above; each tool from the arguments it uses and the way it matches |
|
|
225
|
+
| A partial edit whose result cannot be worked out (arguments missing or not recognised) | deny on an over-cap index, else allow |
|
|
226
|
+
| The index is missing, unreadable, or not a regular file | a whole-file write is judged as if it were empty; a partial edit passes |
|
|
227
|
+
| The index is past the read limit (`min(16 MiB, max(1 MiB, 4 × maxBytes))`) | not read whole: a whole-file write is judged on bytes alone; a partial edit passes |
|
|
228
|
+
| Reads, writes to other files, unknown tools or arguments | allow; reads are never blocked, even over the cap |
|
|
229
|
+
|
|
230
|
+
Lines and bytes are judged apart: only a dimension that is over its cap AND grew is
|
|
231
|
+
refused, so a write with fewer bytes but lines grown past the cap is still refused.
|
|
232
|
+
The line count ignores a trailing newline, so an index exactly at the cap stays
|
|
233
|
+
writable. This table is pinned by `node --test` in CI.
|
|
234
|
+
|
|
235
|
+
## Known limits
|
|
236
|
+
|
|
237
|
+
- **Only dsh's file tools are capped:** `write`, `edit`, and the `str_replace_editor`
|
|
238
|
+
some versions and presets carry; a tool of the same name from another plugin is
|
|
239
|
+
judged the same way. Shell tools, MCP file tools and external editors go past it: run
|
|
240
|
+
`engramory_check.py` after editing the index and `engramory_doctor.py` now and then.
|
|
241
|
+
- **Stores are found only where the installer puts them.** Elsewhere, or for a project
|
|
242
|
+
store that links out of the project, set `indexPath`. A project's root is found by
|
|
243
|
+
its `.git` only, and a project store created mid-session can take ten seconds to appear.
|
|
244
|
+
- **Social mode knows you by what dsh's window sends.** Apart from a bridge's owner
|
|
245
|
+
messages, only what you type in dsh's own window is yours, and not when the browser's
|
|
246
|
+
time zone cannot be read. A kind of
|
|
247
|
+
message a later dsh adds counts as someone else's until this plugin knows it: your
|
|
248
|
+
conversation may lose the memory, never the other way round.
|
|
249
|
+
- **What the memory page opens is checked by path.** dsh's opener resolves the path once
|
|
250
|
+
more before the desktop opens it, so a process changing the store's files at that
|
|
251
|
+
moment could redirect what opens (as with dsh's own opener for any workspace file).
|
|
252
|
+
- **Experimental:** companion mode, social mode, and the settings and memory pages may
|
|
253
|
+
change in a minor version.
|
|
254
|
+
|
|
255
|
+
## Feedback
|
|
256
|
+
|
|
257
|
+
For a problem or an idea, [open an issue on GitHub](https://github.com/tinqiao-oss/engramory/issues/new)
|
|
258
|
+
or email engramory@agent.qq.com. Emails are sorted with the help of an AI assistant, and issues
|
|
259
|
+
are public: do not paste your memory notes into either.
|
|
260
|
+
|
|
261
|
+
## Versions
|
|
262
|
+
|
|
263
|
+
This package carries Engramory's version: `dsh-engramory@X.Y.Z` is the repo's
|
|
264
|
+
`vX.Y.Z`. The cap's decisions (the table above) and the settings outside the
|
|
265
|
+
experimental features change incompatibly only in a major version. See Engramory's
|
|
266
|
+
[Versioning](https://github.com/tinqiao-oss/engramory/blob/master/README.en.md#versioning); history is in the
|
|
267
|
+
[CHANGELOG](https://github.com/tinqiao-oss/engramory/blob/master/CHANGELOG.md).
|
|
268
|
+
|
|
269
|
+
## License
|
|
270
|
+
|
|
271
|
+
MIT — see the [Engramory repository](https://github.com/tinqiao-oss/engramory).
|