@openviking/dsh-memory-plugin 0.5.5 → 0.5.7
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 +43 -7
- package/config.mjs +1 -1
- package/icon.svg +17 -0
- package/index.mjs +5 -1
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +10 -5
- package/runtime.mjs +3 -2
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ It also needs `node examples/memory-plugin-shared/sync.mjs` run first: the
|
|
|
34
34
|
|
|
35
35
|
## Requirements
|
|
36
36
|
|
|
37
|
-
- `@deepseek-ai/dsh` `0.1.0-rc.6`, `0.1.5-rc.1`, or `0.1.
|
|
37
|
+
- `@deepseek-ai/dsh` `0.1.0-rc.6`, `0.1.5-rc.1`, `0.1.5-rc.2`, or `0.1.7-rc.2`; stable `0.1.x` releases are also admitted by the peer range
|
|
38
38
|
- Node.js `^22.19.0` or `>=24`
|
|
39
39
|
- A reachable OpenViking server
|
|
40
40
|
|
|
@@ -48,9 +48,10 @@ individual DSH core packages to the profile. DSH initializes profiles with
|
|
|
48
48
|
available through its module fallback at boot. A missing-peer warning during
|
|
49
49
|
`dsh plugin add` alone does not prove startup is broken.
|
|
50
50
|
|
|
51
|
-
The peer range is `>=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1
|
|
52
|
-
|
|
53
|
-
in the first clause merely because
|
|
51
|
+
The peer range is `>=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1 || ^0.1.7-rc.2`. Each
|
|
52
|
+
pre-release clause admits one series explicitly: semver does not include a
|
|
53
|
+
release candidate in the first clause merely because it compares above
|
|
54
|
+
`0.1.0-rc.6`, so every verified pre-release series is listed on its own. Other
|
|
54
55
|
pre-release series need separate verification. Local devDependencies and
|
|
55
56
|
`overrides` stay pinned to rc.6 to exercise the minimum supported contract.
|
|
56
57
|
|
|
@@ -137,7 +138,7 @@ effect for the tools when DSH restarts the bundle, as it does for the runtime.
|
|
|
137
138
|
|
|
138
139
|
Two consequences follow from the proxy being one process per profile:
|
|
139
140
|
|
|
140
|
-
- **
|
|
141
|
+
- **MCP actor scope is process-level.** With the default `recallPeerScope: all`, MCP tool calls omit the actor peer header. With `actor`, they use the peer resolved at boot. Automatic recall, capture, and commit resolve their peer from each session's workspace.
|
|
141
142
|
- **`remember` is not session-scoped.** The server's MCP `remember` stores into
|
|
142
143
|
its own short-lived session rather than the live `dsh-<session-id>` stream —
|
|
143
144
|
the same behavior the Claude Code, Codex, and Cursor integrations have.
|
|
@@ -189,7 +190,7 @@ The patch can also carry plugin config:
|
|
|
189
190
|
name: '@openviking/dsh-memory-plugin'
|
|
190
191
|
config:
|
|
191
192
|
endpoint: http://127.0.0.1:1933
|
|
192
|
-
|
|
193
|
+
recallMaxTokens: 2000
|
|
193
194
|
scoreThreshold: 0.35
|
|
194
195
|
captureToolResults: false
|
|
195
196
|
skipSubagentSessions: true
|
|
@@ -197,6 +198,30 @@ The patch can also carry plugin config:
|
|
|
197
198
|
mcpToolCallTimeoutMs: 60000
|
|
198
199
|
```
|
|
199
200
|
|
|
201
|
+
Recall normally uses `POST /api/v1/search/search` with `mode: "context"`.
|
|
202
|
+
`recallMaxTokens` (`OPENVIKING_RECALL_MAX_TOKENS`) sets this request's
|
|
203
|
+
`max_tokens` budget for server-assembled context. When it is unset, the plugin
|
|
204
|
+
omits `max_tokens` and uses the server's default budget.
|
|
205
|
+
|
|
206
|
+
`recallLimit` (`OPENVIKING_RECALL_LIMIT`) scales the category quotas for context
|
|
207
|
+
recall; it is not a strict cap on the final number of entries. When explicitly
|
|
208
|
+
set, it allocates at least one slot to each of the six categories: events,
|
|
209
|
+
entities, preferences, experiences, resources, and skills. For example,
|
|
210
|
+
`recallLimit: 4` sends six one-slot quotas, so the result can contain more than
|
|
211
|
+
four entries. Lowering it does not expand the set of categories searched.
|
|
212
|
+
Actual results still depend on matching content, score filtering, deduplication,
|
|
213
|
+
and the token budget. When unset, the server's coding preset supplies the quotas.
|
|
214
|
+
|
|
215
|
+
The older size settings apply to fallback recall, not the primary context request:
|
|
216
|
+
|
|
217
|
+
- `recallTokenBudget` (`OPENVIKING_RECALL_TOKEN_BUDGET`) controls the estimated
|
|
218
|
+
token budget of the locally rendered block when both server-side context and
|
|
219
|
+
the legacy `/api/v1/search/recall` endpoint are unavailable and recall falls
|
|
220
|
+
back to raw search results.
|
|
221
|
+
- `recallMaxContentChars` (`OPENVIKING_RECALL_MAX_CONTENT_CHARS`) limits each
|
|
222
|
+
item's content in that local fallback. It also sets the legacy `/recall`
|
|
223
|
+
request's `max_chars` to `max(1000, recallMaxContentChars * recallLimit)`.
|
|
224
|
+
|
|
200
225
|
## Behavior
|
|
201
226
|
|
|
202
227
|
- `agent/session-start` injects the OpenViking profile, the available-memory index, and the `<available-skills>` catalog through `agent.inject()`.
|
|
@@ -210,7 +235,18 @@ The patch can also carry plugin config:
|
|
|
210
235
|
- `tools/pre-execute` denies a DSH filesystem tool (`read`, `glob`, `grep`, `edit`, `write`, `str_replace_editor`) whose path argument is a `viking://` URI, pointing the model at the bridged `mcp__openviking__*` tools instead. A `write` or `edit` under a skill directory (`viking://~/skills/...`, `viking://user/<id>/skills/...`, `viking://agent/skills/...`) points at `mcp__openviking__add_skill` instead, which creates or replaces a whole skill from its `SKILL.md` text. A `grep` whose pattern is `viking://` text still runs.
|
|
211
236
|
- `tools/post-execute` lets a `bash` command that carries a `viking://` URI run unchanged and attaches a notice for the model: use the bridged tools if it meant OpenViking content, or ignore the notice when the URI is intentional data such as an `ov` argument or an HTTP payload.
|
|
212
237
|
|
|
213
|
-
Each DSH session maps to `dsh-<session-id>` in OpenViking. Workspace-derived actor peers are resolved per session and sent on every session-specific request: the peer is the git identity of the session's workspace — the normalized `origin` URL (`git@github.com:volcengine/OpenViking.git` becomes `github.com-volcengine-openviking`), else the repository root path, that fallback keeping the older rule where every non-letter-or-digit character becomes `-`.
|
|
238
|
+
Each DSH session maps to `dsh-<session-id>` in OpenViking. Workspace-derived actor peers are resolved per session and sent on every session-specific request: the peer is the git identity of the session's workspace — the normalized `origin` URL (`git@github.com:volcengine/OpenViking.git` becomes `github.com-volcengine-openviking`), else the repository root path, that fallback keeping the older rule where every non-letter-or-digit character becomes `-`. With the default peer settings, no peer is sent outside a git repository, and what is remembered there goes to the user-level space `viking://user/<you>/memories`. One repository therefore keeps one peer across subdirectories, worktrees, clones and machines, while a fork's different origin keeps it separate. Memories written under the older path-derived peer stay reachable: the default `recallPeerScope: all` sweeps every peer under the user.
|
|
239
|
+
|
|
240
|
+
Workspace peer settings are loaded from `session.header.cwd` when the session first uses memory. A workspace can set `peer.id` to name its project explicitly, or `peer.source` to choose a preset or template chain. For example, `<root>/.openviking/config.json` can contain:
|
|
241
|
+
|
|
242
|
+
```json
|
|
243
|
+
{
|
|
244
|
+
"version": 1,
|
|
245
|
+
"peer": { "id": "my-project" }
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
The shared loader also applies `config.local.json` and machine registry overrides. Explicit host `peerId`, environment overrides and pinned `ovcli.conf` credentials retain their existing precedence. The resolved peer stays fixed for the session's runtime state; new sessions load the current workspace settings. A session without a cwd falls back to the process's working directory.
|
|
214
250
|
|
|
215
251
|
## Tools
|
|
216
252
|
|
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.7";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Namespace for the bridged OpenViking MCP tools. DSH publishes every MCP tool
|
package/icon.svg
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-label="OpenViking" focusable="false">
|
|
2
|
+
<title>OpenViking</title>
|
|
3
|
+
<style>
|
|
4
|
+
/* Monochrome mark. The plugin card renders this file as an image document,
|
|
5
|
+
which cannot read the page palette, so the two inks are declared here and
|
|
6
|
+
the scheme flip comes from the only signal an image document gets:
|
|
7
|
+
prefers-color-scheme. The base fill attribute keeps the black ink in
|
|
8
|
+
renderers that lack that query, and the class is named after the product
|
|
9
|
+
to stay unique if this file is ever inlined. */
|
|
10
|
+
@media (prefers-color-scheme: dark) {
|
|
11
|
+
.openviking-mark { fill: #ffffff; }
|
|
12
|
+
}
|
|
13
|
+
</style>
|
|
14
|
+
<path class="openviking-mark" fill="#000000" d="M21.9136 11.2875C21.8311 15.6708 18.953 19.691 14.5292 21.0217C10.1055 22.3524 5.48691 20.587 3 16.9758L6.35328 15.9668C8.52232 18.6563 12.1802 19.9123 15.6932 18.8558C19.2062 17.7993 21.5646 14.7335 21.8903 11.2938L21.9136 11.2867V11.2875Z"/>
|
|
15
|
+
<path class="openviking-mark" fill="#000000" d="M11.9754 2.26476C14.2745 3.4155 19.0247 7.27598 19.1416 14.5217L9.68011 17.3709C10.3938 16.4998 11.0303 15.5158 11.5546 14.4446L15.4019 13.2751C16.6438 8.11275 14.2504 4.18838 11.9941 2.3115C11.9878 2.29592 11.9816 2.28034 11.9754 2.26398V2.26476ZM11.9941 2.31228C13.7548 6.71269 13.2274 11.0251 11.5546 14.4446L8.98047 15.2268C12.4085 10.0457 12.4865 5.64375 11.9699 2.29125C11.9785 2.29826 11.9863 2.30527 11.9941 2.3115V2.31228Z"/>
|
|
16
|
+
<path class="openviking-mark" fill="#000000" d="M11.9909 2.31144C13.7517 6.71185 13.2243 11.0242 11.5515 14.4437L8.97656 15.2259C12.4046 10.0449 12.4826 5.64291 11.966 2.29041C11.9746 2.29742 11.9824 2.30443 11.9902 2.31066L11.9909 2.31144Z"/>
|
|
17
|
+
</svg>
|
package/index.mjs
CHANGED
|
@@ -12,7 +12,11 @@ export const inject = ["agents", "sessions", "tools"];
|
|
|
12
12
|
export function apply(ctx, input = {}) {
|
|
13
13
|
const config = resolveConfig(input);
|
|
14
14
|
const client = new OpenVikingClient(config);
|
|
15
|
-
const runtime = new OpenVikingRuntime(client, config, ctx.logger
|
|
15
|
+
const runtime = new OpenVikingRuntime(client, config, ctx.logger, cwd => (
|
|
16
|
+
// Rebuild from the host input, not the config already merged for boot's cwd.
|
|
17
|
+
// The shared loader preserves host/env precedence over workspace peers.
|
|
18
|
+
resolveConfig(input, process.env, cwd).effectivePeer
|
|
19
|
+
));
|
|
16
20
|
const skipMemory = session => (
|
|
17
21
|
config.skipSubagentSessions && session?.header?.origin === "subagent"
|
|
18
22
|
);
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openviking/dsh-memory-plugin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "OpenViking memory and context bundle for DeepSeek Harness",
|
|
5
|
+
"icon": "./icon.svg",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"main": "index.mjs",
|
|
7
8
|
"exports": {
|
|
8
|
-
".": "./index.mjs"
|
|
9
|
+
".": "./index.mjs",
|
|
10
|
+
"./package.json": "./package.json",
|
|
11
|
+
"./locale/*.json": "./locale/*.json"
|
|
9
12
|
},
|
|
10
13
|
"files": [
|
|
14
|
+
"icon.svg",
|
|
11
15
|
"index.mjs",
|
|
12
16
|
"client.mjs",
|
|
13
17
|
"config.mjs",
|
|
@@ -21,6 +25,7 @@
|
|
|
21
25
|
"servers/",
|
|
22
26
|
"shared/",
|
|
23
27
|
"skills/",
|
|
28
|
+
"locale/",
|
|
24
29
|
"cordis.patch.yml",
|
|
25
30
|
"README.md"
|
|
26
31
|
],
|
|
@@ -37,9 +42,9 @@
|
|
|
37
42
|
"prepublishOnly": "npm run prepack && npm run check && npm test"
|
|
38
43
|
},
|
|
39
44
|
"peerDependencies": {
|
|
40
|
-
"@deepseek-ai/dsh-llm": ">=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1",
|
|
41
|
-
"@deepseek-ai/dsh-mcp-client": ">=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1",
|
|
42
|
-
"@deepseek-ai/dsh-skill-filesystem": ">=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1"
|
|
45
|
+
"@deepseek-ai/dsh-llm": ">=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1 || ^0.1.7-rc.2",
|
|
46
|
+
"@deepseek-ai/dsh-mcp-client": ">=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1 || ^0.1.7-rc.2",
|
|
47
|
+
"@deepseek-ai/dsh-skill-filesystem": ">=0.1.0-rc.6 <0.2.0 || ^0.1.5-rc.1 || ^0.1.7-rc.2"
|
|
43
48
|
},
|
|
44
49
|
"devDependencies": {
|
|
45
50
|
"@deepseek-ai/dsh-llm": "0.1.0-rc.6",
|
package/runtime.mjs
CHANGED
|
@@ -18,10 +18,11 @@ import {
|
|
|
18
18
|
} from "./capture.mjs";
|
|
19
19
|
|
|
20
20
|
export class OpenVikingRuntime {
|
|
21
|
-
constructor(client, config, logger = console) {
|
|
21
|
+
constructor(client, config, logger = console, resolveSessionPeer = null) {
|
|
22
22
|
this.client = client;
|
|
23
23
|
this.config = config;
|
|
24
24
|
this.logger = logger;
|
|
25
|
+
this.resolveSessionPeer = resolveSessionPeer;
|
|
25
26
|
this.states = new Map();
|
|
26
27
|
this.drainTimer = null;
|
|
27
28
|
this.drainRunning = false;
|
|
@@ -33,7 +34,7 @@ export class OpenVikingRuntime {
|
|
|
33
34
|
let state = this.states.get(session.id);
|
|
34
35
|
if (state) return state;
|
|
35
36
|
const cwd = session.header?.cwd || process.cwd();
|
|
36
|
-
const peer = resolveEffectivePeerId({
|
|
37
|
+
const peer = this.resolveSessionPeer?.(cwd) ?? resolveEffectivePeerId({
|
|
37
38
|
cfg: {
|
|
38
39
|
peerId: this.config.explicitPeerId,
|
|
39
40
|
peerSource: this.config.peerSource,
|