dsh-memory-recall 0.1.0 → 0.2.1
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.md +15 -10
- package/dsh.plugin.json +2 -2
- package/lib/client.js +1490 -1090
- package/package.json +2 -2
- package/src/index.js +217 -156
- package/src/inject.js +87 -0
- package/src/memory-tool.js +167 -136
- package/src/routes.js +205 -153
- package/src/snapshot.js +71 -63
package/README.md
CHANGED
|
@@ -8,9 +8,10 @@ A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) plugin tha
|
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
11
|
-
It does
|
|
11
|
+
It does six things:
|
|
12
12
|
|
|
13
|
-
- **A `memory` tool** — the model keeps two short files: a **user profile** (who you are, how you like to work) and its **own notes** (environment facts, conventions, lessons). Every
|
|
13
|
+
- **A `memory` tool** — the model keeps two short files: a **user profile** (who you are, how you like to work) and its **own notes** (environment facts, conventions, lessons). Every chat gets both, as a context message you can see in the chat — at the start, again after a change or a compaction.
|
|
14
|
+
- **A 🧠 button in the message box** — lit when this chat has memory, dim when it has none, amber when the memory changed since; click it to see what this chat is running on.
|
|
14
15
|
- **A `session_search` tool** — the model reads your earlier chats to answer *"what did we decide last time?"*. dsh's own approval prompt asks you first, saying what it wants to look for.
|
|
15
16
|
- **A 🧠 Saved to memory note in the chat** — every save shows what changed and how full memory is, so nothing is remembered behind your back.
|
|
16
17
|
- **A sidebar 🧠 Memory panel** — everything kept, in two tabs, with edit, delete, add and search.
|
|
@@ -61,7 +62,7 @@ Just talk. The model saves what will matter later — that you use PowerShell, t
|
|
|
61
62
|
|
|
62
63
|
You can also ask directly: *"remember that I prefer short answers"*, *"forget that I use npm"*.
|
|
63
64
|
|
|
64
|
-
Memory
|
|
65
|
+
Memory reaches the model as a context message — logged in the chat as 🧠 **Memory loaded** — before its first answer, and again after anything changes or the conversation is compacted, so a save made mid-chat is used in that same chat from the next step. The system prompt keeps only the short how-to, which never changes, so dsh's prompt cache holds.
|
|
65
66
|
|
|
66
67
|
### Looking back through earlier chats
|
|
67
68
|
|
|
@@ -78,11 +79,12 @@ It returns the chats' actual messages — nothing summarised, nothing invented
|
|
|
78
79
|
- **Notes** and **Profile** tabs, each with a ring and a bar showing how full it is.
|
|
79
80
|
- **Edit** or **delete** any entry in place (hover it), with an inline confirm for delete.
|
|
80
81
|
- **Add** an entry yourself, and **search** once a tab holds a few.
|
|
82
|
+
- **⚙ Display settings** — turn the 🧠 button in the message box and the chats and workspaces in `@` on or off, per browser.
|
|
81
83
|
- With the sidebar collapsed, it becomes a single icon, like Settings.
|
|
82
84
|
|
|
83
85
|

|
|
84
86
|
|
|
85
|
-
Edits you make here are your own words, so they are not scanned (see [Safety](#safety)), but they still respect the budget. Hand edits to the files show in the panel at once and in
|
|
87
|
+
Edits you make here are your own words, so they are not scanned (see [Safety](#safety)), but they still respect the budget. Hand edits to the files show in the panel at once and in open chats from their next step.
|
|
86
88
|
|
|
87
89
|
### Chats and workspaces in the @ menu
|
|
88
90
|
|
|
@@ -105,9 +107,12 @@ Every chat gets a readable name — its title, or the start of its first message
|
|
|
105
107
|
|
|
106
108
|
If dsh runs in `danger-full-access` mode its approval policy is `never`, which **rejects** every approval request without prompting — so recall is refused there. Set `askBeforeRecall: false` if you want recall without asking in that mode.
|
|
107
109
|
|
|
108
|
-
## What
|
|
110
|
+
## What the model gets
|
|
109
111
|
|
|
110
|
-
|
|
112
|
+
Two parts, so dsh's prompt cache holds:
|
|
113
|
+
|
|
114
|
+
1. **The how-to** — a short, unchanging system-prompt note on how memory works. It is the only memory in the prompt prefix, so it never invalidates the cache.
|
|
115
|
+
2. **The memory itself** — a context message, logged in the chat as 🧠 **Memory loaded**, with the two stores rendered as Hermes renders them:
|
|
111
116
|
|
|
112
117
|
```
|
|
113
118
|
══════════════════════════════════════════════
|
|
@@ -120,7 +125,7 @@ Prefers short answers with the command first, explanation after.
|
|
|
120
125
|
|
|
121
126
|
The budgets are small on purpose — **2,200 characters of notes and 1,375 of profile**, Hermes's defaults, together roughly 900 tokens — because they are paid in every chat. When a store is full, a save that would overflow it is refused whole, never cut; the model is shown the entries and consolidates in one batch that merges or drops stale entries and adds the new one, checked against the final size. Raise the budgets with `limits` (below) if you would rather pay more per chat.
|
|
122
127
|
|
|
123
|
-
Sub-agent sessions do not get the
|
|
128
|
+
Sub-agent sessions do not get the message; they are the model's own workers.
|
|
124
129
|
|
|
125
130
|
## Configuration
|
|
126
131
|
|
|
@@ -155,8 +160,8 @@ Other guards:
|
|
|
155
160
|
|
|
156
161
|
## How it works
|
|
157
162
|
|
|
158
|
-
- **Host side** (`src/index.js`): registers the `memory` and `session_search` tools,
|
|
159
|
-
- **Client side** (`lib/client.js`, plain JavaScript, no build step): the in-chat chip and recall card replace dsh's own rows for those two tools through the `tool.call.toolview` slot; the panel mounts into `sidebar.footer.action`; the `@` rows are an `inputTriggers` source.
|
|
163
|
+
- **Host side** (`src/index.js`, `src/inject.js`): registers the `memory` and `session_search` tools, keeps a short how-to in each new top-level chat's system prompt on `agent/session-start`, and before every model step (`agent/pre-step`) appends the current memory to the step's messages as a logged context message when the chat does not already see it — at the start, after a change, and after a compaction. It serves the panel's routes under `/plugin-data/dsh-memory-recall/`. Recall goes through dsh's `sessionQuery` service and its `approval` service; nothing talks to the network.
|
|
164
|
+
- **Client side** (`lib/client.js`, plain JavaScript, no build step): the in-chat chip and recall card replace dsh's own rows for those two tools through the `tool.call.toolview` slot; the 🧠 **Memory loaded / reloaded / updated** row is a `conversation.chat.node` that shadows the plugin's own context message at priority −10 and delegates every other row; the 🧠 button mounts into `conversation.input.right`; the panel mounts into `sidebar.footer.action`; the `@` rows are an `inputTriggers` source.
|
|
160
165
|
- **Files**:
|
|
161
166
|
|
|
162
167
|
```
|
|
@@ -168,7 +173,7 @@ Other guards:
|
|
|
168
173
|
|
|
169
174
|
## Requirements
|
|
170
175
|
|
|
171
|
-
- dsh 0.1.5 or later, with a `web` profile
|
|
176
|
+
- dsh 0.1.5 or later, with a `web` profile — from 0.2.1 also dsh 0.1.7+ and 0.2.x
|
|
172
177
|
- Node 22+
|
|
173
178
|
- No runtime dependencies — the client bundle requires only `react`
|
|
174
179
|
|
package/dsh.plugin.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-memory-recall",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
|
-
"description": "Persistent memory for dsh in the style of Hermes Agent: a memory tool that keeps a user profile and the model's own notes
|
|
5
|
+
"description": "Persistent memory for dsh in the style of Hermes Agent: a memory tool that keeps a user profile and the model's own notes, delivered to every chat as a logged context message — at the start, after a change and after compaction — and a session_search tool that reads earlier chats only after the user approves, with a Memory panel to see and edit what is kept.",
|
|
6
6
|
"engines": {
|
|
7
7
|
"dsh": ">=0.1.5-rc.2"
|
|
8
8
|
},
|