dsh-memory-recall 0.1.0 → 0.2.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.md CHANGED
@@ -8,9 +8,10 @@ A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) plugin tha
8
8
 
9
9
  ![The Memory panel: the model's notes, with a budget bar and inline edit](assets/memory-panel.png)
10
10
 
11
- It does five things:
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 new chat starts with both in its prompt.
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 is pasted into each new chat's prompt once, when the chat starts, and is **fixed for the life of that chat** — rewriting the prompt mid-chat would throw away dsh's cached prompt prefix. A save made mid-chat is on disk at once and reaches the prompt from the **next** new chat. The model is told this, so it does not save twice.
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
  ![The Profile tab in the light theme](assets/memory-panel-light.png)
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 the prompt from the next new chat.
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 goes into the prompt
110
+ ## What the model gets
109
111
 
110
- Each new chat gets one prompt section: a short note on how memory works, then the two stores, rendered as Hermes renders them:
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 section; they are the model's own workers.
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, adds the memory section to each new top-level chat's system prompt on `agent/session-start`, and 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.
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
  ```
package/dsh.plugin.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "id": "dsh-memory-recall",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
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 in every new chat's prompt, 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.",
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
  },