dsh-seal-scripts 0.5.2 → 0.6.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 +185 -167
- package/README.md +179 -186
- package/lib/client.js +34 -4
- package/lib/core/index.js +8 -1
- package/lib/host/compact-delete.js +188 -24
- package/lib/host/delete.js +32 -4
- package/package.json +4 -3
package/README.en.md
CHANGED
|
@@ -7,326 +7,344 @@
|
|
|
7
7
|
[](https://www.npmjs.com/package/dsh-seal-scripts)
|
|
8
8
|
[](./LICENSE)
|
|
9
9
|
[](https://nodejs.org)
|
|
10
|
-
[](https://github.com/deepseek-ai/dsh)
|
|
11
11
|
[](./package.json)
|
|
12
12
|
|
|
13
|
-
**Sealed scripts
|
|
13
|
+
**Sealed scripts**: a chain that just worked is sealed into a tool script — a directory, a manifest entry, one line in the system prompt; next time it runs with a single sentence.
|
|
14
14
|
|
|
15
|
-
**Reviews
|
|
15
|
+
**Reviews**: when DSH compacts the context, the shadowed transcript is written to a review file, decays by calendar day and is injected back; the model can read the original from a clue. Reviews are also the raw material for sealing across sessions.
|
|
16
16
|
|
|
17
17
|
## Contents
|
|
18
18
|
|
|
19
|
-
- [Features](#features)
|
|
20
|
-
- [Install](#install)
|
|
21
|
-
- [Quick start](#
|
|
22
|
-
- [Sealed scripts](#
|
|
23
|
-
- [Reviews](#reviews
|
|
24
|
-
- [Configuration](#
|
|
25
|
-
- [
|
|
26
|
-
- [
|
|
27
|
-
- [
|
|
28
|
-
- [
|
|
29
|
-
|
|
19
|
+
- [Features](#sec-features)
|
|
20
|
+
- [Install](#sec-install)
|
|
21
|
+
- [Quick start](#sec-quickstart)
|
|
22
|
+
- [Sealed scripts](#sec-tools)
|
|
23
|
+
- [Reviews](#sec-reviews)
|
|
24
|
+
- [Configuration and settings page](#sec-config)
|
|
25
|
+
- [Data and backup](#sec-data)
|
|
26
|
+
- [Compatibility and degradation](#sec-compat)
|
|
27
|
+
- [Known limitations](#sec-limits)
|
|
28
|
+
- [Development](#sec-dev)
|
|
29
|
+
|
|
30
|
+
<a name="sec-features"></a>
|
|
30
31
|
|
|
31
32
|
## Features
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
#### Sealed scripts
|
|
35
|
+
|
|
36
|
+
- **One chain → one tool script**: full script text, entry, args, steps, provenance, per-file sha256.
|
|
37
|
+
- **In the system prompt**: the toolSequence block lists every sealed tool, one line each.
|
|
38
|
+
- **Runs as written**: args as an argv array, never through a shell; interpreter chosen by the run field.
|
|
39
|
+
- **Verifiable**: sha256 compared before running; a hand-edited script is refused unless explicitly allowed.
|
|
40
|
+
- **Portable**: store-only zip; import previews first, index rebuilt from the files on disk.
|
|
34
41
|
|
|
35
|
-
|
|
36
|
-
- **Present in the system prompt**: the tool list sits at the end of the prompt every turn (up to 24 entries), so the model knows what it can run.
|
|
37
|
-
- **Runs as written**: arguments travel as an argv array and never pass through a shell; the interpreter comes from the run field (bash / node / powershell / cmd).
|
|
38
|
-
- **Verifiable**: per-file sha256 is compared before running; a hand-edited script is refused unless you explicitly allow it.
|
|
39
|
-
- **Portable**: the whole set packs into a store-only zip; import previews before writing and rebuilds the index from the files on disk.
|
|
42
|
+
#### Context reviews
|
|
40
43
|
|
|
41
|
-
**
|
|
44
|
+
- **Captured on compaction**: no model call; tool calls and arguments kept verbatim.
|
|
45
|
+
- **Four-level decay**: original → summary → diary → keywords; a read bumps and pins the level.
|
|
46
|
+
- **Cross-workspace search**: workspace → children → siblings → parents; outer rings need permission.
|
|
47
|
+
- **Diary nudges**: asked once when the diary or keywords are empty.
|
|
42
48
|
|
|
43
|
-
|
|
44
|
-
- **Four-level decay**: today original → next-day summary → diary → keyword index; reading it bumps one level and pins it.
|
|
45
|
-
- **Cross-workspace search**: this workspace → children → siblings → parents; outer rings need explicit permission.
|
|
46
|
-
- **Diary nudges**: while keywords or the diary are still empty the model is asked to finish them in one call; the nudge disappears once they are written.
|
|
49
|
+
#### Engineering
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
- Zero runtime dependencies, Node built-ins only; UI and injected text follow DSH's 8 languages, model-facing errors and receipts are English.
|
|
52
|
+
- A missing host capability disables that block only.
|
|
53
|
+
- Plain-text data: copy `session-memory/` for a backup.
|
|
49
54
|
|
|
50
|
-
|
|
51
|
-
- A missing host capability disables that block only — no crash, no blank settings page.
|
|
52
|
-
- Plain-text data: copy `session-memory/` and you have a backup.
|
|
55
|
+
<a name="sec-install"></a>
|
|
53
56
|
|
|
54
57
|
## Install
|
|
55
58
|
|
|
56
|
-
Add the package in the
|
|
59
|
+
Add the package in the plugin manager (package name, local path, tarball, or Git URL). `--profile` is required, e.g. `web`:
|
|
57
60
|
|
|
58
61
|
~~~bash
|
|
59
|
-
# --profile is required (otherwise: required option "--profile" not specified)
|
|
60
62
|
dsh plugin --profile web add dsh-seal-scripts
|
|
61
|
-
|
|
62
|
-
# local directory: pnpm records it as a link dependency in that profile
|
|
63
63
|
dsh plugin --profile web add /path/to/dsh-seal-scripts
|
|
64
64
|
~~~
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
The second line is a local directory, registered as a link dependency. Restart the profile to load it.
|
|
67
67
|
|
|
68
|
-
Requirements:
|
|
69
|
-
|
|
70
|
-
- host `@deepseek-ai/dsh` `>=0.2.1-rc.2`, `<1.0.0` (peer dependency, not forced)
|
|
71
|
-
- Node `>=18` (without native zstd the built-in decoder takes over; functionality is unchanged)
|
|
68
|
+
Requirements: host `@deepseek-ai/dsh` `>=0.2.2-rc.1`, `<1.0.0` (peer, not forced); Node `>=18`.
|
|
72
69
|
|
|
73
70
|
After the restart, Settings shows **Tool (script) manager**.
|
|
74
71
|
|
|
72
|
+
<a name="sec-quickstart"></a>
|
|
73
|
+
|
|
75
74
|
## Quick start
|
|
76
75
|
|
|
77
|
-
1. **
|
|
78
|
-
2. **Run a chain end to end
|
|
76
|
+
1. **Master switch**: Settings → Tool (script) manager → Options → turn on **Auto review** (off by default; nothing is created while off).
|
|
77
|
+
2. **Run a chain end to end**.
|
|
79
78
|
3. **Seal it**: ask the model to turn the steps above into a tool.
|
|
80
|
-
4. **Reuse it**:
|
|
81
|
-
|
|
82
|
-
A sample session (output is illustrative):
|
|
79
|
+
4. **Reuse it**: "run <id>"; add "show me the commands first, do not run" to preview.
|
|
83
80
|
|
|
84
81
|
~~~text
|
|
85
82
|
You: turn that packaging flow into a tool
|
|
86
|
-
Model: (
|
|
87
|
-
entry pack.sh, params source_dir out_dir
|
|
83
|
+
Model: (session_tool_create_write) installed dsh-plugin-pack at .../toolSequence/dsh-plugin-pack
|
|
84
|
+
entry pack.sh, params source_dir out_dir
|
|
88
85
|
|
|
89
86
|
(new session)
|
|
90
|
-
You: run dsh-plugin-pack, the source dir is /sdcard/Download/
|
|
91
|
-
Model: (
|
|
87
|
+
You: run dsh-plugin-pack, the source dir is /sdcard/Download/my-src
|
|
88
|
+
Model: (session_tool_call) exit 0, N files, sha256 matches the manifest
|
|
92
89
|
~~~
|
|
93
90
|
|
|
91
|
+
<a name="sec-tools"></a>
|
|
92
|
+
|
|
94
93
|
## Sealed scripts
|
|
95
94
|
|
|
96
|
-
|
|
95
|
+
#### Why this is not a note
|
|
97
96
|
|
|
98
|
-
|
|
97
|
+
A note cannot run, and rebuilding commands on the spot differs every time. What gets stored is the script itself: the lines that worked, byte for byte, argument order included.
|
|
99
98
|
|
|
100
|
-
|
|
99
|
+
#### How to trigger it
|
|
101
100
|
|
|
102
101
|
| What you say | What happens | When to use |
|
|
103
102
|
|---|---|---|
|
|
104
103
|
| turn the steps above into a tool | seals the steps that just ran | same session, commands still in context |
|
|
105
|
-
| turn the workflow from an earlier session into a tool | reads review originals first with `session_tool_create_read
|
|
104
|
+
| turn the workflow from an earlier session into a tool | reads review originals first with `session_tool_create_read`, then seals | new session, new machine, old history |
|
|
106
105
|
|
|
107
|
-
The
|
|
106
|
+
The version that ran is stored, not a draft; editing after installing means re-sending the context.
|
|
108
107
|
|
|
109
|
-
|
|
108
|
+
#### What gets created
|
|
110
109
|
|
|
111
110
|
~~~
|
|
112
111
|
$DSH_HOME/session-memory/toolSequence/
|
|
113
112
|
_index.json registry: id, title, purpose, entry, args, steps, per-file sha256
|
|
114
113
|
<id>/
|
|
115
|
-
toolScript.json manifest: full script text, docs, hashes, provenance
|
|
114
|
+
toolScript.json manifest: full script text, docs, hashes, provenance
|
|
116
115
|
<script> the file that actually runs (.sh / .js .mjs .cjs / .ps1 / .bat .cmd)
|
|
117
|
-
README.md generated from the manifest
|
|
118
|
-
<notes>.md read-only notes
|
|
119
|
-
_runs/ full stdout/stderr log of every run
|
|
116
|
+
README.md generated from the manifest
|
|
117
|
+
<notes>.md read-only notes (never executed)
|
|
118
|
+
_runs/ full stdout/stderr log of every run
|
|
120
119
|
<id>.bak-<timestamp>/ previous directory kept on reinstall or import
|
|
121
120
|
~~~
|
|
122
121
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
The end of the system prompt gains a toolSequence block: every sealed toolScript is listed (0.4.11 removed the entry and character caps), one line each — `· id (title): purpose|entry <entry>|args <p1> <p2>`. The purpose is shown in full. After sealing you never have to remind the model that the tool exists.
|
|
122
|
+
#### How the model learns about it
|
|
126
123
|
|
|
127
|
-
|
|
124
|
+
The system prompt gains a toolSequence block, one line each: `· id (title): purpose|entry <entry>|args <p1> <p2>`. No entry or character cap; purpose shown in full.
|
|
128
125
|
|
|
129
126
|
| Mode | Behaviour | Cost |
|
|
130
127
|
|---|---|---|
|
|
131
|
-
| Before a new session (default) | computed
|
|
132
|
-
| Live per session | computed every turn | one cache miss on the next message
|
|
128
|
+
| Before a new session (default) | computed at the first assembly, fixed until the session ends | installing or removing a tool mid-session leaves the prompt unchanged |
|
|
129
|
+
| Live per session | computed every turn | one cache miss on the next message |
|
|
133
130
|
|
|
134
|
-
Changing
|
|
131
|
+
Changing the mode refreshes every remembered session immediately.
|
|
135
132
|
|
|
136
|
-
|
|
133
|
+
#### The three tools
|
|
137
134
|
|
|
138
135
|
| Tool | Purpose | Key arguments |
|
|
139
136
|
|---|---|---|
|
|
140
137
|
| `session_tool_create_write` | seal a chain | `toolScript{ id, title, purpose, entry, scripts[], docs[], params, steps, timeoutMs }`; `replace` overwrites |
|
|
141
|
-
| `session_tool_create_read` | read review originals
|
|
138
|
+
| `session_tool_create_read` | read review originals, read-only | `file` or `date`+`nth`; `mode` = outline / raw / block; `cursor`, `chars`, `line`, `span` |
|
|
142
139
|
| `session_tool_call` | run as written | `toolScript`, `step`, `args`, `stdin`, `cwd`, `dryRun`, `calls`, `stopOnError`, `allowDrift`, `timeoutMs`, `maxOutputBytes` |
|
|
143
140
|
|
|
144
|
-
-
|
|
145
|
-
- `dryRun: true
|
|
146
|
-
- `calls: []
|
|
141
|
+
- No arguments: lists every tool script.
|
|
142
|
+
- `dryRun: true`: echoes the arguments and cwd only.
|
|
143
|
+
- `calls: []`: runs in order, no count limit, reporting exit code, duration and logs per entry.
|
|
147
144
|
|
|
148
|
-
|
|
145
|
+
#### Validation when sealing
|
|
149
146
|
|
|
150
147
|
| Item | Rule |
|
|
151
148
|
|---|---|
|
|
152
|
-
| `id` | starts with a lowercase letter,
|
|
153
|
-
| file name | starts alphanumeric,
|
|
149
|
+
| `id` | starts with a lowercase letter, only `a-z0-9-`, no length limit |
|
|
150
|
+
| file name | starts alphanumeric, letters, digits and . _ - only, no paths, no leading dot |
|
|
154
151
|
| `run` vs extension | bash→`.sh`; node→`.js/.mjs/.cjs`; ps1→`.ps1`; cmd→`.bat/.cmd` |
|
|
155
|
-
| size | no cap
|
|
156
|
-
| `title` / `purpose` | non-empty; any length
|
|
157
|
-
| `entry` / `steps` | must name files in `scripts`; entry defaults to the first
|
|
158
|
-
| `timeoutMs` | any positive ms, clamped
|
|
159
|
-
| docs | must be `.md`,
|
|
160
|
-
| script body | non-empty; must not contain `<!--ovr:`
|
|
152
|
+
| size | no cap |
|
|
153
|
+
| `title` / `purpose` | non-empty; any length |
|
|
154
|
+
| `entry` / `steps` | must name files in `scripts`; entry defaults to the first |
|
|
155
|
+
| `timeoutMs` | any positive ms, clamped to the host maxTimeoutMs, defaults to the host timeoutMs |
|
|
156
|
+
| docs | must be `.md`, not `README.md`, no duplicates |
|
|
157
|
+
| script body | non-empty; must not contain `<!--ovr:` |
|
|
161
158
|
| same id exists | refused without `replace`; the error quotes the first 12 hex chars of the manifest sha256 |
|
|
162
159
|
|
|
163
|
-
`steps` only declares
|
|
160
|
+
`steps` only declares order and never chains; `params` only declares argv order and names are not validated.
|
|
164
161
|
|
|
165
|
-
|
|
162
|
+
#### Execution semantics
|
|
166
163
|
|
|
167
164
|
| Item | Value |
|
|
168
165
|
|---|---|
|
|
169
|
-
| interpreter | bash
|
|
170
|
-
| argv | interpreter
|
|
171
|
-
| cwd | `workspace
|
|
166
|
+
| interpreter | bash; node uses `process.execPath`; ps1 uses Windows PowerShell (`pwsh` elsewhere); cmd uses `%ComSpec% /d /c` (falls back to `sh` off Windows) |
|
|
167
|
+
| argv | interpreter args + absolute script path + args, as an array, never through a shell |
|
|
168
|
+
| cwd | `workspace`, `toolScript`, or an absolute path inside either |
|
|
172
169
|
| environment | inherits `process.env`, plus `TOOL_NAME`, `TOOL_SCRIPT`, `TOOL_ROOT`, `DSH_HOME` |
|
|
173
|
-
| timeout | follows the DSH terminal settings (120 s default, capped by
|
|
174
|
-
| output |
|
|
175
|
-
| result | `{ exitCode, signal, timedOut, stdout, stderr, truncated, spill }
|
|
176
|
-
| argument count | more
|
|
177
|
-
| drift | sha256
|
|
178
|
-
| containment | only files inside the
|
|
170
|
+
| timeout | follows the DSH terminal settings (120 s default, capped by maxTimeoutMs); on expiry it moves to the background and the reply carries pid and the log path; explicit stop: SIGTERM → 2 s → SIGKILL; process group on POSIX, `taskkill /T /F` on Windows |
|
|
171
|
+
| output | DSH maxOutputBytes; every run written to `_runs/` and the reply carries the file path |
|
|
172
|
+
| result | `{ exitCode, signal, timedOut, background, pid, logFile, stdout, stderr, truncated, spill }` |
|
|
173
|
+
| argument count | more than `params` declares fails before running; fewer is fine |
|
|
174
|
+
| drift | sha256 compared first; mismatch refuses, `allowDrift: true` allows it and marks `drift` |
|
|
175
|
+
| containment | only files inside the script directory run; unknown script names refused |
|
|
176
|
+
|
|
177
|
+
#### Import / export
|
|
179
178
|
|
|
180
|
-
|
|
179
|
+
- **Export**: Sealed tools tab → Export. Packs `toolSequence.zip` (store) into the session workspace and returns the path — no browser download.
|
|
180
|
+
- **Import**: pick a zip → `dryRun` preview → confirm to write; an existing directory is kept as `.bak-<timestamp>`.
|
|
181
|
+
- `_index.json` in the package is not trusted; the index is rebuilt from disk. `_runs`, backups, escaping paths and invalid ids are skipped.
|
|
182
|
+
- No size cap; the zip-bomb guard compares extracted bytes + 16 MB against free disk space. zip64 and encrypted archives are not supported.
|
|
181
183
|
|
|
182
|
-
|
|
183
|
-
- **Import**: pick a zip → `dryRun` preview of what will be installed, overwritten and skipped → confirm to write. An existing directory is kept as `.bak-<timestamp>`.
|
|
184
|
-
- `_index.json` inside the package is not trusted; the index is rebuilt from the files on disk. `_runs`, backup directories, escaping paths and invalid ids are skipped.
|
|
185
|
-
- Limits: 64 MB per entry, 128 MB total; zip64 and encrypted archives are not supported.
|
|
184
|
+
#### Clear cache
|
|
186
185
|
|
|
187
|
-
|
|
186
|
+
Two clicks (the first only changes the button label):
|
|
188
187
|
|
|
189
|
-
|
|
188
|
+
- **Deleted**: `<id>.bak-<timestamp>` rollback directories, every log in `_runs/`.
|
|
189
|
+
- **Kept**: `_index.json` and every `<id>/` directory.
|
|
190
|
+
- Only "valid id + `.bak-` + digits" directories count; a staged import package is skipped.
|
|
191
|
+
- One entry that cannot be removed does not abort the run; the receipt reports counts and bytes.
|
|
190
192
|
|
|
191
|
-
-
|
|
192
|
-
- **Kept**: `_index.json` and every `<id>/` toolScript directory — tools keep running and the index is not rebuilt. Those two live outside the index, which is exactly why the rest is safe to drop.
|
|
193
|
-
- Only directories named "valid id + `.bak-` + digits" count as rollback versions; anything else is left alone (better to under-delete).
|
|
194
|
-
- If an import is in flight, the package it staged inside `_runs/` is skipped and the receipt says how many were skipped.
|
|
195
|
-
- One entry that cannot be removed (in use or no permission) does not abort the run: the rest still go, and the receipt says "N could not be removed".
|
|
196
|
-
- The receipt reports how many rollback versions, how many run logs, and how many bytes were cleared.
|
|
193
|
+
<a name="sec-reviews"></a>
|
|
197
194
|
|
|
198
195
|
## Reviews and context memory
|
|
199
196
|
|
|
200
|
-
The
|
|
197
|
+
The shadowed transcript is kept as a file and can be read back when it matters.
|
|
201
198
|
|
|
202
|
-
|
|
199
|
+
#### When a review is created
|
|
203
200
|
|
|
204
|
-
- Only on **compaction**:
|
|
205
|
-
- Tool calls and
|
|
201
|
+
- Only on **compaction**: written as one review file (summary + original + empty diary).
|
|
202
|
+
- Tool calls and arguments are kept verbatim, never truncated.
|
|
206
203
|
- Spawned subagent sessions produce nothing; with Auto review off, not even detection happens.
|
|
207
|
-
- Delete + review
|
|
204
|
+
- Delete + review triggers one on purpose: compact → confirm the review landed → delete. Any failed step aborts.
|
|
205
|
+
- Compaction runs through the host command registry: the service is mounted per agent preset and isolated, so the plugin root never calls it — `/compact` is executed by the command handler.
|
|
206
|
+
- Once compaction ends, the plugin reads the newest `compaction/summary` and splits the review.
|
|
207
|
+
- Every failed step is logged to `session-memory/_compact-delete.log` (trimmed to its last 64 KB past 256 KB).
|
|
208
208
|
|
|
209
|
-
|
|
209
|
+
#### Four levels
|
|
210
210
|
|
|
211
211
|
| Day | Level | What the model sees |
|
|
212
212
|
|---|---|---|
|
|
213
|
-
| the day of compaction | 3 | the original dialogue (tool calls and errors filtered
|
|
213
|
+
| the day of compaction | 3 | the original dialogue (tool calls and errors filtered) |
|
|
214
214
|
| day 2 | 2 | the compaction summary |
|
|
215
|
-
| days 3–28 | 1 | the diary
|
|
216
|
-
| day 29 and later | 0 | keywords plus the file name
|
|
215
|
+
| days 3–28 | 1 | the diary |
|
|
216
|
+
| day 29 and later | 0 | keywords plus the file name |
|
|
217
217
|
|
|
218
|
-
|
|
218
|
+
Local calendar days. Only reading this workspace's own review bumps and pins the level (0→1, 1→2) and stops decay; child, sibling and parent reviews are read-only.
|
|
219
219
|
|
|
220
|
-
|
|
220
|
+
#### Cross-workspace search
|
|
221
221
|
|
|
222
|
-
The unit is a workspace review folder
|
|
222
|
+
The unit is a workspace review folder. Order: this workspace → children → siblings → the parent → the parent's siblings → their level-1 and level-2 children. Outer rings need `allowOuter`.
|
|
223
223
|
|
|
224
|
-
|
|
224
|
+
Hits go keywords first, then summary, then original; within a workspace they sort by level, matched terms, then compaction time.
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
#### Diary nudges
|
|
227
227
|
|
|
228
|
-
At level 1 or 0
|
|
228
|
+
At level 1 or 0, an empty diary or empty keywords trigger one nudge:
|
|
229
229
|
|
|
230
|
-
- **In context** (default): appended to the review text
|
|
231
|
-
- **In the system prompt**:
|
|
230
|
+
- **In context** (default): appended to the review text, disappears once written.
|
|
231
|
+
- **In the system prompt**: a trailing prompt section.
|
|
232
232
|
|
|
233
|
-
|
|
233
|
+
#### Injection and preview
|
|
234
234
|
|
|
235
235
|
- Reviews enter the context every turn, oldest first.
|
|
236
|
-
- The preview box
|
|
237
|
-
-
|
|
236
|
+
- The preview box runs the same assembly function as the real injection (selecting one review shows only that one).
|
|
237
|
+
- A failed assembly gives the model a diagnostic (how many, total size, largest file) instead of silently showing no reviews.
|
|
238
238
|
|
|
239
|
-
|
|
239
|
+
#### The two review tools
|
|
240
240
|
|
|
241
|
-
|
|
241
|
+
Installed only while Auto review is on.
|
|
242
242
|
|
|
243
243
|
| Tool | Purpose | Key arguments |
|
|
244
244
|
|---|---|---|
|
|
245
|
-
| `session_mem_read` | find a review from
|
|
246
|
-
| `session_mem_write` | read one
|
|
245
|
+
| `session_mem_read` | find a review from a clue, one hit per call | `need` (required), `skip`, `allowOuter` |
|
|
246
|
+
| `session_mem_write` | read one original; write keywords and diary, in batch | `file` or `date`+`nth`; `keywords`, `diary`; `writes[]` |
|
|
247
|
+
|
|
248
|
+
- Locator only = the Original section: dialogue only, tool calls stripped.
|
|
249
|
+
- Writing many uses `writes[]`; all-or-nothing.
|
|
250
|
+
- Neither tool changes depth.
|
|
251
|
+
|
|
252
|
+
#### How it relates to sealing
|
|
253
|
+
|
|
254
|
+
Reviews are the raw-material store: the model uses `session_tool_create_read` to recover commands and arguments, then `session_tool_create_write` to seal them.
|
|
247
255
|
|
|
248
|
-
|
|
249
|
-
- Writing many uses `writes[]`: all-or-nothing — one bad entry and the batch is not written.
|
|
250
|
-
- Neither tool changes depth: only a read that hits this workspace's own review raises it one level and pins it.
|
|
256
|
+
<a name="sec-config"></a>
|
|
251
257
|
|
|
252
|
-
|
|
258
|
+
## Configuration and settings page
|
|
253
259
|
|
|
254
|
-
|
|
260
|
+
There is one config file, `$DSH_HOME/session-memory/_options.json`; changes apply immediately and are shared by all workspaces. Settings → **Tool (script) manager** → **Options** edits the same file.
|
|
255
261
|
|
|
256
|
-
|
|
262
|
+
#### The four tabs
|
|
257
263
|
|
|
258
|
-
|
|
264
|
+
| Tab | Contents |
|
|
265
|
+
|---|---|
|
|
266
|
+
| Sealed tools (`toolList` in the English UI) | tool path, the injected prompt text, list toggle and refresh mode, import / export / clear cache |
|
|
267
|
+
| Sessions | sessions grouped by workspace; Delete, Delete + review (both confirmed) |
|
|
268
|
+
| Reviews | calendar filter, review list with depth badges, injection preview, delete one |
|
|
269
|
+
| Options | four groups: Sealed tools, Recall injection, Review content, Review depth |
|
|
270
|
+
|
|
271
|
+
#### Every option field
|
|
259
272
|
|
|
260
273
|
| Field | Values | Default | Meaning |
|
|
261
274
|
|---|---|---|---|
|
|
262
275
|
| `autoReviewEnabled` | bool | `false` | master switch: no reviews, no injection, no review tools when off |
|
|
263
|
-
| `injectEnabled` | bool | `true` | recall injection and diary nudges (
|
|
276
|
+
| `injectEnabled` | bool | `true` | recall injection and diary nudges (not the tool list) |
|
|
264
277
|
| `toolListEnabled` | bool | `true` | inject the toolSequence block and install/remove the three `session_tool_*` tools |
|
|
265
278
|
| `toolListRefresh` | `newSession` / `realtime` | `newSession` | when the list is recomputed |
|
|
266
|
-
| `fullLoad` | bool | `false` | keep tool calls and errors at level 3 (
|
|
267
|
-
| `reminderChannel` | `context` / `system` | `context` |
|
|
268
|
-
| `stopLowering` | bool | `false` |
|
|
269
|
-
| `loadLevel` | `follow` / 0–3 | `follow` | force a level at load time (
|
|
270
|
-
|
|
271
|
-
Two couplings: with Auto review off, the effective `injectEnabled` is always false (the stored value is untouched); with Stop lowering on, Load level falls back to follow.
|
|
279
|
+
| `fullLoad` | bool | `false` | keep tool calls and errors at level 3 (full re-injection) |
|
|
280
|
+
| `reminderChannel` | `context` / `system` | `context` | where the diary nudge goes |
|
|
281
|
+
| `stopLowering` | bool | `false` | reviews keep their recorded level, no daily decay |
|
|
282
|
+
| `loadLevel` | `follow` / 0–3 | `follow` | force a level at load time (recorded depth unchanged) |
|
|
272
283
|
|
|
273
|
-
|
|
284
|
+
Two couplings: with Auto review off, `injectEnabled` reads as off (the stored value is untouched); with Stop lowering on, Load level falls back to follow.
|
|
274
285
|
|
|
275
|
-
|
|
286
|
+
#### UI language
|
|
276
287
|
|
|
277
|
-
|
|
278
|
-
|---|---|
|
|
279
|
-
| Sealed tools (shown as `toolList` in the English UI) | tool path, the prompt text about to be injected, "Inject toolSequence list" toggle and refresh mode, import / export / clear cache |
|
|
288
|
+
Follows DSH: settings strings, injected review text, diary reminders and the toolSequence block all switch. A review file is written with the header and section titles of the language active **at capture time**; switching later only changes the display (all 8 spellings are accepted). Errors and receipts the tools return to the model are English.
|
|
280
289
|
|
|
281
|
-
|
|
282
|
-
| Sessions | sessions grouped by workspace (title, archived badge), Delete / Delete + review, both confirmed |
|
|
283
|
-
| Reviews | calendar range filter, review list with depth badges, injection preview, delete one review |
|
|
284
|
-
| Options | four groups: Sealed tools, Recall injection, Review content, Review depth |
|
|
290
|
+
<a name="sec-data"></a>
|
|
285
291
|
|
|
286
292
|
## Data and backup
|
|
287
293
|
|
|
288
294
|
~~~
|
|
289
295
|
$DSH_HOME/session-memory/
|
|
290
296
|
_options.json options
|
|
291
|
-
_locale.json language
|
|
297
|
+
_locale.json language
|
|
292
298
|
_health.json last success/failure per workspace
|
|
299
|
+
_compact-delete.log per-step diagnostics (trimmed past 256 KB)
|
|
293
300
|
<workspace key>/
|
|
294
|
-
<stamp>-<id>.md review text (
|
|
295
|
-
<same name>.json load cache
|
|
296
|
-
_assembly.json.migrated-* leftover of the old
|
|
297
|
-
toolSequence/ tool scripts (machine level, shared
|
|
301
|
+
<stamp>-<id>.md review text (plain text, readable and searchable)
|
|
302
|
+
<same name>.json load cache (rebuilt from file time if lost)
|
|
303
|
+
_assembly.json.migrated-* leftover of the old index (never auto-deleted)
|
|
304
|
+
toolSequence/ tool scripts (machine level, shared)
|
|
298
305
|
~~~
|
|
299
306
|
|
|
300
|
-
- The workspace key uses the
|
|
307
|
+
- The workspace key uses the host `sessions/` encoding: `/` becomes `-`, non-ASCII becomes `~XXXX`.
|
|
301
308
|
- Backup: copy the whole `session-memory/`. Migration: put it at the same place on the new machine and install the same plugin.
|
|
302
|
-
- Uninstalling
|
|
309
|
+
- Uninstalling deletes no data.
|
|
310
|
+
|
|
311
|
+
<a name="sec-compat"></a>
|
|
303
312
|
|
|
304
313
|
## Compatibility and degradation
|
|
305
314
|
|
|
306
|
-
Missing host capabilities disable the matching block
|
|
315
|
+
Missing host capabilities disable the matching block only (the settings page lists what is missing):
|
|
307
316
|
|
|
308
317
|
| Missing | Effect |
|
|
309
318
|
|---|---|
|
|
310
319
|
| `systemPrompt.context` | recall injection off |
|
|
311
320
|
| `systemPrompt.section` | diary nudge section and toolSequence block do not appear |
|
|
312
321
|
| `tools.register` | none of the five tools is installed |
|
|
313
|
-
| `webServer.register` |
|
|
314
|
-
| `agents.create` / `resume` |
|
|
322
|
+
| `webServer.register` | settings endpoints not installed |
|
|
323
|
+
| `agents.create` / `resume` | deleting a live session falls back to tier 2 (plugin-built teardown) |
|
|
324
|
+
| `commands.execute`, or `command-compact` not mounted | Delete + review is unavailable; plain delete still works |
|
|
315
325
|
|
|
316
|
-
|
|
326
|
+
Two tiers for deleting a live session: (1) the `dispose` returned by `agents.create` / `resume`, captured by the lifecycle hook; (2) no handle — the plugin builds its own `cancel({kind:'disposed'})` → `whenIdle()` → `scope.dispose()`. Tier 2 only stops the agent; unregistering belongs to the host closure with no public API, so the delete succeeds with a `warnings` entry (the settings page says the engine may still remember it until restart).
|
|
327
|
+
|
|
328
|
+
Session logs are multi-frame zstd, split by frame header; without native `zlib.zstdDecompressSync` the built-in decoder takes over.
|
|
329
|
+
|
|
330
|
+
<a name="sec-limits"></a>
|
|
317
331
|
|
|
318
332
|
## Known limitations
|
|
319
333
|
|
|
320
|
-
- Tool scripts have **no delete or edit in the UI**:
|
|
321
|
-
- `steps`
|
|
322
|
-
- Reviews are created on compaction only; the Reviews tab has
|
|
334
|
+
- Tool scripts have **no delete or edit in the UI**: reinstall to overwrite (a `.bak-` is kept) or remove the directory (the registry keeps the entry and later runs report a missing directory).
|
|
335
|
+
- `steps` never chain automatically; use `calls`.
|
|
336
|
+
- Reviews are created on compaction only; the Reviews tab has no full-text search.
|
|
323
337
|
- Subagent sessions produce no reviews and no diary nudges.
|
|
324
|
-
- Import and export cover tool scripts only
|
|
338
|
+
- Import and export cover tool scripts only; copy `session-memory/` for reviews.
|
|
339
|
+
- Delete + review needs `command-compact` mounted on that session's preset.
|
|
340
|
+
- With the plugin-built teardown, the engine may still remember the session until it restarts.
|
|
341
|
+
|
|
342
|
+
<a name="sec-dev"></a>
|
|
325
343
|
|
|
326
344
|
## Development
|
|
327
345
|
|
|
328
346
|
~~~
|
|
329
|
-
index.js plugin entry (exports name / apply / inject
|
|
347
|
+
index.js plugin entry (exports name / apply / inject)
|
|
330
348
|
cordis.patch.yml inserts the plugin into the host loader
|
|
331
349
|
lib/core/ host-side logic: storage, decay, tool definitions, script runner
|
|
332
350
|
lib/host/ host service adapters: 12 HTTP endpoints, capability probe, session delete
|
|
@@ -334,8 +352,8 @@ lib/client.js settings page (React, registered at settings.section)
|
|
|
334
352
|
~~~
|
|
335
353
|
|
|
336
354
|
- Zero runtime dependencies, ESM, Node `>=18`.
|
|
337
|
-
- Tests
|
|
338
|
-
- Packaging
|
|
355
|
+
- Tests `node --test test/*.test.mjs` (not shipped in the package).
|
|
356
|
+
- Packaging `npm pack`; whitelist is the `files` field of `package.json`.
|
|
339
357
|
|
|
340
358
|
## License
|
|
341
359
|
|