@openviking/openclaw-plugin 2026.9.1 → 2026.9.4-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/INSTALL-AGENT.md +25 -4
- package/INSTALL-ZH.md +22 -4
- package/INSTALL.md +22 -4
- package/README.md +19 -15
- package/auto-recall.ts +126 -135
- package/client.ts +95 -0
- package/commands/setup.ts +22 -8
- package/config.ts +31 -16
- package/context-engine.ts +2 -2
- package/dist/auto-recall.js +113 -114
- package/dist/client.js +54 -0
- package/dist/commands/setup.js +15 -6
- package/dist/config.js +18 -11
- package/dist/plugin/openviking-memory-tools.js +1 -1
- package/dist/plugin/openviking-session-routing-runtime.js +2 -2
- package/dist/routing/identity-routing.js +5 -5
- package/dist/services/context-lifecycle-service.js +4 -4
- package/dist/shared/recall-compress-core.mjs +188 -0
- package/dist/shared/recall-core.mjs +645 -0
- package/install-manifest.json +1 -0
- package/openclaw.plugin.json +9 -8
- package/package.json +2 -1
- package/plugin/openviking-client-runtime.ts +1 -1
- package/plugin/openviking-memory-tools.ts +1 -1
- package/plugin/openviking-session-routing-runtime.ts +2 -2
- package/routing/identity-routing.ts +8 -8
- package/services/context-lifecycle-service.ts +4 -4
- package/services/setup/setup-flow.ts +8 -6
- package/shared/recall-compress-core.mjs +195 -0
- package/shared/recall-core.d.mts +39 -0
- package/shared/recall-core.mjs +678 -0
- package/skills/install-openviking-memory/SKILL.md +33 -10
- package/skills/openviking-context-database/SKILL.md +2 -2
|
@@ -106,7 +106,7 @@ Send this message:
|
|
|
106
106
|
> 我需要 3 条信息,不知道的可以问你的管理员:
|
|
107
107
|
> 1. **OpenViking 服务地址** —— 例如 `https://ov.example.com` 或 `http://192.168.1.100:1933`,本机服务可以直接说"本机"
|
|
108
108
|
> 2. **API Key** —— 用来鉴权;服务没开认证可以说"没有"
|
|
109
|
-
> 3.
|
|
109
|
+
> 3. **记忆归属**(可选) —— 所有对话共用 user 记忆(默认),还是在 `peers/<assistant_id>` 或 `peers/<sender_id>` 下分开存放
|
|
110
110
|
>
|
|
111
111
|
> 先告诉我服务地址吧?
|
|
112
112
|
|
|
@@ -115,7 +115,7 @@ Send this message:
|
|
|
115
115
|
> I need 3 things (ask your admin if unsure):
|
|
116
116
|
> 1. **OpenViking server URL** — e.g. `https://ov.example.com` or `http://192.168.1.100:1933`. For a local server, just say "local".
|
|
117
117
|
> 2. **API Key** — for auth. Say "none" if the server has no auth.
|
|
118
|
-
> 3. **
|
|
118
|
+
> 3. **Memory scope** (optional) — shared user memory (default), or peer memory under `peers/<assistant_id>` / `peers/<sender_id>`.
|
|
119
119
|
>
|
|
120
120
|
> What's the server URL?
|
|
121
121
|
|
|
@@ -141,15 +141,36 @@ Collect 3 values through natural conversation. Be flexible: if the user gives se
|
|
|
141
141
|
- "no" / "none" / "没有" / "空" / empty → `API_KEY=""` (you will skip the flag later).
|
|
142
142
|
- Otherwise store as-is.
|
|
143
143
|
|
|
144
|
-
### 4c. `
|
|
144
|
+
### 4c. `PEER_ROLE` (OPTIONAL)
|
|
145
|
+
|
|
146
|
+
> (CN) 记忆要存在哪一层?默认共享在 `viking://user/<user_id>/memories`(`none`)。也可以按 OpenClaw 助手存到 `.../peers/<assistant_id>/memories`(`assistant`),或按发送者存到 `.../peers/<sender_id>/memories`(`sender`)。
|
|
147
|
+
> (EN) Where should memory live? The default is shared `viking://user/<user_id>/memories` (`none`). You can instead use `.../peers/<assistant_id>/memories` (`assistant`) or `.../peers/<sender_id>/memories` (`sender`).
|
|
148
|
+
|
|
149
|
+
Default to `none`. **Never silently pick another value** — the three options mean different storage layouts and are awkward to change later:
|
|
150
|
+
|
|
151
|
+
| Value | Concrete layout | Choose it when |
|
|
152
|
+
|---|---|---|
|
|
153
|
+
| `none` (default) | Shared memory under `viking://user/<user_id>/memories/...`; no concrete `peers/<peer_id>/memories` subtree is used. | General case. All conversations for this OpenViking user share user-level memory. |
|
|
154
|
+
| `assistant` | Assistant-attributed peer memory under `viking://user/<user_id>/peers/<assistant_id>/memories/...`, keyed by the resolved OpenClaw agent id (fallback `main`; optional prefix supported). | **Human as OpenViking user**: one human uses multiple assistants and wants their peer memories separated. Example: Alice's `main` and `research` assistants use `.../peers/main/...` and `.../peers/research/...`. |
|
|
155
|
+
| `sender` | Sender-attributed peer memory under `viking://user/<user_id>/peers/<sender_id>/memories/...`, keyed by the sender identity supplied by OpenClaw. | **Agent as OpenViking user**: one agent talks to multiple humans and wants their peer memories separated. Example: `support-agent` stores `customer-42` and `customer-99` under different peer subtrees. |
|
|
156
|
+
|
|
157
|
+
`person` is a legacy alias for `sender`. Accept it from an existing config or explicit user input, but normalize/write new setup values as `sender`.
|
|
158
|
+
|
|
159
|
+
OpenViking initializes the managed `peers/` container for every user. Do not tell the user that `none` removes that container: it only avoids a concrete peer memory subtree. With `assistant` or `sender`, actor-peer recall includes shared user memory plus the current peer memory; it hides other peer subtrees. Changing this setting does not move existing memories.
|
|
160
|
+
|
|
161
|
+
- Empty / "default" / "默认" / "共用" → leave unset (plugin defaults to `none`).
|
|
162
|
+
- Otherwise pass `--peer-role none|assistant|sender`. Treat explicit legacy `person` as `sender`. Any other value → ask again.
|
|
163
|
+
|
|
164
|
+
### 4d. `PEER_PREFIX` (OPTIONAL, only when `PEER_ROLE=assistant`)
|
|
145
165
|
|
|
146
166
|
> (CN) 想给这个 agent 一个记忆前缀吗?留空就用默认。只能用字母、数字、`_`、`-`。
|
|
147
167
|
> (EN) Want to set an peer prefix? Leave blank for the default. Letters, digits, `_`, `-` only.
|
|
148
168
|
|
|
169
|
+
- Only meaningful when `PEER_ROLE=assistant`; skip the question otherwise.
|
|
149
170
|
- Empty / "default" / "默认" → leave unset (plugin defaults to `""`).
|
|
150
171
|
- Otherwise validate against `/^[A-Za-z0-9_-]+$/`. If invalid, ask again.
|
|
151
172
|
|
|
152
|
-
###
|
|
173
|
+
### 4e. (Conditional) Multi-Tenant Root-Key Fields
|
|
153
174
|
|
|
154
175
|
Only ask for these if STEP 7 detects a root key (`Root API key detected. Missing: --account-id, --user-id`). Don't ask up front.
|
|
155
176
|
|
|
@@ -259,14 +280,15 @@ Tell the user:
|
|
|
259
280
|
Run the installer with `npx` (no global install needed):
|
|
260
281
|
|
|
261
282
|
```bash
|
|
262
|
-
npx -y openclaw-openviking-setup-helper@latest --base-url BASE_URL [--api-key API_KEY] [--peer-prefix PEER_PREFIX] [--account-id ACCOUNT_ID] [--user-id USER_ID]
|
|
283
|
+
npx -y openclaw-openviking-setup-helper@latest --base-url BASE_URL [--api-key API_KEY] [--peer-role PEER_ROLE] [--peer-prefix PEER_PREFIX] [--account-id ACCOUNT_ID] [--user-id USER_ID]
|
|
263
284
|
```
|
|
264
285
|
|
|
265
286
|
Build the flag list according to what the user gave you:
|
|
266
287
|
|
|
267
288
|
- Always pass `--base-url BASE_URL`.
|
|
268
289
|
- Pass `--api-key API_KEY` only if `API_KEY` is non-empty.
|
|
269
|
-
- Pass `--peer-
|
|
290
|
+
- Pass `--peer-role PEER_ROLE` only if the user chose `assistant` or `sender`; omit it for the `none` default. Normalize legacy `person` to `sender` first.
|
|
291
|
+
- Pass `--peer-prefix PEER_PREFIX` only if the user gave one and `PEER_ROLE=assistant`.
|
|
270
292
|
- `--account-id` / `--user-id` only if the root-key path requires them.
|
|
271
293
|
|
|
272
294
|
`ov-install` will, in one shot:
|
|
@@ -287,14 +309,15 @@ If `ov-install` exits non-zero, capture the last 30 lines of its output, show th
|
|
|
287
309
|
Run the setup wizard non-interactively. Build flags from collected values:
|
|
288
310
|
|
|
289
311
|
```bash
|
|
290
|
-
openclaw openviking setup --base-url BASE_URL --json [--api-key API_KEY] [--peer-prefix PEER_PREFIX] [--account-id ACCOUNT_ID] [--user-id USER_ID] [--allow-offline] [--force-slot]
|
|
312
|
+
openclaw openviking setup --base-url BASE_URL --json [--api-key API_KEY] [--peer-role PEER_ROLE] [--peer-prefix PEER_PREFIX] [--account-id ACCOUNT_ID] [--user-id USER_ID] [--allow-offline] [--force-slot]
|
|
291
313
|
```
|
|
292
314
|
|
|
293
315
|
Rules:
|
|
294
316
|
|
|
295
317
|
- `--base-url BASE_URL` is **required** under `--json`. Without it, the wizard prints `--json requires --base-url for non-interactive mode`.
|
|
296
318
|
- `--api-key` only if `API_KEY` is non-empty.
|
|
297
|
-
- `--peer-
|
|
319
|
+
- `--peer-role` only if the user chose `assistant` or `sender`; omit it for the `none` default. Normalize legacy `person` to `sender` first.
|
|
320
|
+
- `--peer-prefix` only if the user gave one and `--peer-role assistant` is in play. Use **`--peer-prefix`** for assistant peer prefixes; the old ID-style setup flag is no longer supported.
|
|
298
321
|
- `--account-id` / `--user-id` only after STEP 7 root-key detection (see below).
|
|
299
322
|
- `--allow-offline` only if the user explicitly approved it in STEP 5.
|
|
300
323
|
- `--force-slot` **never** in the first attempt. Add only after the user confirms (see slot_blocked handling below).
|
|
@@ -583,8 +606,8 @@ These are the keys under `plugins.entries.openviking.config` in `openclaw.json`.
|
|
|
583
606
|
| `mode` | `"remote"` (forced by plugin) | Always remote in this skill. Don't set manually. |
|
|
584
607
|
| `baseUrl` | `http://127.0.0.1:1933` | OpenViking server URL. |
|
|
585
608
|
| `apiKey` | — | API key. Optional if server has no auth. |
|
|
586
|
-
| `peer_role` | `
|
|
587
|
-
| `peer_prefix` | `""` | Optional prefix for assistant `peer_id` / actor peer values when `peer_role=assistant`. Letters / digits / `_` / `-`. |
|
|
609
|
+
| `peer_role` | `none` | Memory scope: `none` (shared `viking://user/<user_id>/memories`), `assistant` (`.../peers/<assistant_id>/memories`), or `sender` (`.../peers/<sender_id>/memories`). Legacy `person` is accepted as `sender`. Session messages use body `peer_id`; data-plane recall/search uses `X-OpenViking-Actor-Peer`. |
|
|
610
|
+
| `peer_prefix` | `""` | Optional prefix for assistant `peer_id` / actor peer values. Only used when `peer_role=assistant`. Letters / digits / `_` / `-`. |
|
|
588
611
|
| `accountId` | — | Required when `apiKey` is a root key. |
|
|
589
612
|
| `userId` | — | Required when `apiKey` is a root key. |
|
|
590
613
|
| `targetUri` | `viking://~/memories` | Default search scope URI. |
|
|
@@ -64,7 +64,7 @@ Core config lives under `plugins.entries.openviking.config`:
|
|
|
64
64
|
|---|---:|---|
|
|
65
65
|
| `baseUrl` | `http://127.0.0.1:1933` | OpenViking HTTP endpoint. Can also come from `OPENVIKING_BASE_URL` / `OPENVIKING_URL`. |
|
|
66
66
|
| `apiKey` | empty | Optional API key. Can also come from `OPENVIKING_API_KEY`. |
|
|
67
|
-
| `peer_role` | `
|
|
67
|
+
| `peer_role` | `none` | Memory scope: `none` (shared `viking://user/<user_id>/memories`), `assistant` (assistant-attributed memory under `.../peers/<assistant_id>/memories`), or `sender` (sender-attributed memory under `.../peers/<sender_id>/memories`). Legacy `person` is accepted as `sender`. |
|
|
68
68
|
| `peer_prefix` | empty | Optional prefix for assistant `peer_id` / actor peer values when `peer_role=assistant`. |
|
|
69
69
|
| `accountId` / `userId` | empty | Advanced tenant identity headers for root-key or trusted deployments. |
|
|
70
70
|
| `targetUri` | `viking://~/memories` | Default search scope for legacy targeted memory search. |
|
|
@@ -95,7 +95,7 @@ openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --json
|
|
|
95
95
|
Useful variants:
|
|
96
96
|
|
|
97
97
|
```bash
|
|
98
|
-
openclaw openviking setup --base-url <URL> --api-key <KEY> --peer-prefix openclaw-prod --json
|
|
98
|
+
openclaw openviking setup --base-url <URL> --api-key <KEY> --peer-role assistant --peer-prefix openclaw-prod --json
|
|
99
99
|
openclaw openviking setup --base-url <URL> --api-key <ROOT_KEY> --account-id <ACCOUNT_ID> --user-id <USER_ID> --json
|
|
100
100
|
openclaw openviking setup --base-url <URL> --api-key <KEY> --recall-target-types resource --json
|
|
101
101
|
openclaw openviking setup --base-url <URL> --api-key <KEY> --allow-offline --json
|