@openviking/dsh-memory-plugin 0.5.14 → 0.5.15
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 +9 -0
- package/capture.mjs +10 -1
- package/config.mjs +1 -1
- package/package.json +1 -1
- package/runtime.mjs +1 -1
package/README.md
CHANGED
|
@@ -117,6 +117,15 @@ context under such presets with no error. Pre-step injection also makes each
|
|
|
117
117
|
injection a session event that replays, is visible to compaction, and never
|
|
118
118
|
reaches `request/header`.
|
|
119
119
|
|
|
120
|
+
### What triggers recall
|
|
121
|
+
|
|
122
|
+
Recall runs on a pre-step whose entering batch contains user-authored input.
|
|
123
|
+
The query is built only from those messages: user-role messages with
|
|
124
|
+
`source.kind` absent or `user`. Messages that DSH or other plugins inject
|
|
125
|
+
(`time-context`, `plugin:*` notices, this plugin's own blocks) and tool results
|
|
126
|
+
are excluded, using the same rule capture uses. A batch made only of injected
|
|
127
|
+
context sends no search request.
|
|
128
|
+
|
|
120
129
|
### How the tool surface is mounted
|
|
121
130
|
|
|
122
131
|
`mcp.mjs` mounts `@deepseek-ai/dsh-mcp-client` on `servers/mcp-proxy.mjs`, the
|
package/capture.mjs
CHANGED
|
@@ -96,9 +96,18 @@ function captureMessage(event, message, config, toolNames) {
|
|
|
96
96
|
return payload;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
// Recall queries use only what the user typed. Injected context (time-context,
|
|
100
|
+
// job notices, other plugins' blocks, our own recall) and tool results would
|
|
101
|
+
// otherwise trigger recall on their own and pollute the query text.
|
|
102
|
+
function isUserInput(message) {
|
|
103
|
+
if (!message || message.role !== "user") return false;
|
|
104
|
+
if (message.source?.kind === "tool") return false;
|
|
105
|
+
return !isSyntheticUserMessage(message);
|
|
106
|
+
}
|
|
107
|
+
|
|
99
108
|
export function promptText(messages) {
|
|
100
109
|
return (messages || [])
|
|
101
|
-
.filter(
|
|
110
|
+
.filter(isUserInput)
|
|
102
111
|
.map(message => extractTextFromPayload(message))
|
|
103
112
|
.filter(Boolean)
|
|
104
113
|
.join("\n\n")
|
package/config.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { buildPluginConfig } from "./shared/plugin-config.mjs";
|
|
2
2
|
import { loadCredentialFiles } from "./shared/credentials.mjs";
|
|
3
3
|
|
|
4
|
-
export const PLUGIN_VERSION = "0.5.
|
|
4
|
+
export const PLUGIN_VERSION = "0.5.15";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Namespace for the bridged OpenViking MCP tools. DSH publishes every MCP tool
|
package/package.json
CHANGED
package/runtime.mjs
CHANGED
|
@@ -131,7 +131,7 @@ export class OpenVikingRuntime {
|
|
|
131
131
|
const state = await this.initialize(agent);
|
|
132
132
|
if (!state.ready || !isRecallEnabled(state.config)) return null;
|
|
133
133
|
const query = promptText(messages);
|
|
134
|
-
if (query.length < state.config.minQueryLength) return null;
|
|
134
|
+
if (!query || query.length < state.config.minQueryLength) return null;
|
|
135
135
|
const block = await buildRecallBlock(
|
|
136
136
|
(path, init, options) => this.client.fetchJSON(path, init, options),
|
|
137
137
|
state.config,
|