@openviking/dsh-memory-plugin 0.5.14 → 0.5.16

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
@@ -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(message => !isOpenVikingPluginMessage(message))
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.14";
4
+ export const PLUGIN_VERSION = "0.5.16";
5
5
 
6
6
  /**
7
7
  * Namespace for the bridged OpenViking MCP tools. DSH publishes every MCP tool
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openviking/dsh-memory-plugin",
3
- "version": "0.5.14",
3
+ "version": "0.5.16",
4
4
  "description": "OpenViking memory and context bundle for DeepSeek Harness",
5
5
  "icon": "./icon.svg",
6
6
  "type": "module",
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,
@@ -160,7 +160,7 @@ export const KNOBS = [
160
160
  { name: "noAutoInject", type: "bool", default: false, env: "OPENVIKING_NO_AUTO_INJECT", capability: "session" },
161
161
  { name: "profileTokenBudget", type: "int", default: 10000, min: 500, max: 50000, env: "OPENVIKING_PROFILE_TOKEN_BUDGET", aliases: ["profileBudget"], capability: "session" },
162
162
  { name: "resumeContextBudget", type: "int", default: 32000, min: 1024, max: 128000, env: "OPENVIKING_RESUME_CONTEXT_BUDGET", capability: "session" },
163
- { name: "resumeArchiveInject", type: "bool", default: true, env: "OPENVIKING_RESUME_ARCHIVE_INJECT", capability: "session" },
163
+ { name: "resumeArchiveInject", type: "bool", default: false, env: "OPENVIKING_RESUME_ARCHIVE_INJECT", capability: "session" },
164
164
  { name: "resumeArchiveTokenBudget", type: "int", default: 32000, min: 0, max: 128000, env: "OPENVIKING_RESUME_ARCHIVE_TOKEN_BUDGET", capability: "session" },
165
165
  { name: "resumeArchiveMaxChars", type: "int", default: 6000, min: 1000, max: 200000, env: "OPENVIKING_RESUME_ARCHIVE_MAX_CHARS", capability: "session" },
166
166
  { name: "skillExperience", type: "bool", default: false, env: "OPENVIKING_SKILL_EXPERIENCE", capability: "session" },
@@ -184,7 +184,7 @@ export const KNOBS = [
184
184
  { name: "repoContext", type: "bool", default: true, capability: "session" },
185
185
  { name: "repoContextCacheTtlMs", type: "int", default: 60000, min: 1000, max: 3600000, capability: "session" },
186
186
 
187
- { name: "takeoverEnabled", type: "bool", default: true, env: "OPENVIKING_TAKEOVER", capability: "session" },
187
+ { name: "takeoverEnabled", type: "bool", default: false, env: "OPENVIKING_TAKEOVER", capability: "session" },
188
188
  { name: "takeoverTokenThreshold", type: "int", default: 30000, min: 1, max: 1000000, capability: "session" },
189
189
  { name: "takeoverKeepRecentTurns", type: "int", default: 3, min: 0, max: 100, capability: "session" },
190
190
  { name: "takeoverOverviewBudget", type: "int", default: 3000, min: 100, max: 50000, capability: "session" },