@openviking/openclaw-plugin 2026.5.21 → 2026.5.26
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 +355 -355
- package/INSTALL-ZH.md +345 -345
- package/INSTALL.md +362 -362
- package/README.md +338 -338
- package/auto-recall.ts +257 -257
- package/client.ts +939 -939
- package/commands/setup.ts +1002 -1002
- package/config.ts +476 -476
- package/context-engine.ts +1737 -1737
- package/dist/index.js +18 -18
- package/index.ts +1985 -1985
- package/install-manifest.json +47 -47
- package/memory-ranking.ts +267 -267
- package/openclaw.plugin.json +335 -335
- package/package.json +76 -76
- package/process-manager.ts +45 -45
- package/runtime-utils.ts +5 -5
- package/session-transcript-repair.ts +530 -530
- package/skills/install-openviking-memory/SKILL.md +665 -665
- package/text-utils.ts +507 -507
- package/tool-call-id.ts +331 -331
package/INSTALL-AGENT.md
CHANGED
|
@@ -1,355 +1,355 @@
|
|
|
1
|
-
# OpenViking Plugin Agent Install Guide
|
|
2
|
-
|
|
3
|
-
This guide is for AI agents and operator automation. Prefer deterministic commands, parse JSON output, and ask the user only when a choice changes the outcome.
|
|
4
|
-
|
|
5
|
-
User-facing docs:
|
|
6
|
-
|
|
7
|
-
- [INSTALL.md](./INSTALL.md)
|
|
8
|
-
- [INSTALL-ZH.md](./INSTALL-ZH.md)
|
|
9
|
-
|
|
10
|
-
## Identity
|
|
11
|
-
|
|
12
|
-
This package is the OpenClaw plugin `@openviking/openclaw-plugin`.
|
|
13
|
-
|
|
14
|
-
| User intent | Command |
|
|
15
|
-
| --- | --- |
|
|
16
|
-
| Fresh install, latest | `openclaw plugins install clawhub:@openviking/openclaw-plugin` |
|
|
17
|
-
| Upgrade plugin to latest | `openclaw plugins install clawhub:@openviking/openclaw-plugin` |
|
|
18
|
-
| Install or upgrade a specific release | Use the published ClawHub package selector if available; otherwise ask before using backup `ov-install --plugin-version=<REF>` |
|
|
19
|
-
| Upgrade only the plugin | `openclaw plugins install clawhub:@openviking/openclaw-plugin` |
|
|
20
|
-
| Show installed plugins | `openclaw plugins list` |
|
|
21
|
-
| Backup install when ClawHub is unavailable | `npx -y openclaw-openviking-setup-helper@latest --base-url <URL> [--api-key <KEY>]` |
|
|
22
|
-
| Operate on a specific OpenClaw instance | add `--workdir <path>` |
|
|
23
|
-
| Start missing OpenViking server | `openviking-server init && openviking-server doctor && openviking-server` |
|
|
24
|
-
|
|
25
|
-
Do not install it with:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
clawhub install openviking
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
That installs an AgentSkill, not the plugin. The plugin install command is:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
openclaw plugins install clawhub:@openviking/openclaw-plugin
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Required Inputs
|
|
38
|
-
|
|
39
|
-
Before setup, determine:
|
|
40
|
-
|
|
41
|
-
| Input | Required | How to get it |
|
|
42
|
-
| --- | --- | --- |
|
|
43
|
-
| OpenViking base URL | Yes | Ask user or read `OPENVIKING_BASE_URL` |
|
|
44
|
-
| API key | Usually | Ask user or read `OPENVIKING_API_KEY` |
|
|
45
|
-
| Account ID | Only for root API keys | Ask user if setup reports root-key tenant context is needed |
|
|
46
|
-
| User ID | Only for root API keys | Ask user if setup reports root-key tenant context is needed |
|
|
47
|
-
| Slot replacement approval | Only if another context engine owns the slot | Ask user before using `--force-slot` |
|
|
48
|
-
|
|
49
|
-
Never silently replace another context engine.
|
|
50
|
-
|
|
51
|
-
## Primary Workflow
|
|
52
|
-
|
|
53
|
-
Use this workflow for normal installs and upgrades from published packages.
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
openclaw plugins install clawhub:@openviking/openclaw-plugin
|
|
57
|
-
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --json
|
|
58
|
-
openclaw gateway restart
|
|
59
|
-
openclaw openviking status --json
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
If the registry prefix is required:
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
openclaw plugins install clawhub:@openviking/openclaw-plugin
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Setup JSON Contract
|
|
69
|
-
|
|
70
|
-
Run setup with `--json` whenever possible:
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --json
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Branch on the result:
|
|
77
|
-
|
|
78
|
-
| JSON result | Meaning | Agent action |
|
|
79
|
-
| --- | --- | --- |
|
|
80
|
-
| `success: true` | Setup completed | Restart gateway, then run status |
|
|
81
|
-
| `success: false`, `action: "slot_blocked"` | Another plugin owns `plugins.slots.contextEngine` | Ask user before rerunning with `--force-slot` |
|
|
82
|
-
| `success: false`, `action: "error"` | Validation failed | Report `error`; do not continue as success |
|
|
83
|
-
| `health.ok: false` | Server unreachable | Check URL/service; use `--allow-offline` only with user approval |
|
|
84
|
-
| `keyProbe.keyType: "root_key"` | Root key requires tenant fields | Rerun with `--account-id <ACCOUNT_ID> --user-id <USER_ID>` |
|
|
85
|
-
| `health.compatibility: "server_too_old"` | Server may not support plugin features | Warn user and recommend server upgrade |
|
|
86
|
-
| `health.compatibility: "server_too_new"` | Plugin may be too old | Warn user and recommend plugin upgrade |
|
|
87
|
-
|
|
88
|
-
Root-key retry:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
openclaw openviking setup \
|
|
92
|
-
--base-url <OPENVIKING_URL> \
|
|
93
|
-
--api-key <ROOT_API_KEY> \
|
|
94
|
-
--account-id <ACCOUNT_ID> \
|
|
95
|
-
--user-id <USER_ID> \
|
|
96
|
-
--json
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
Custom agent routing prefix (optional; only when the user explicitly requests a prefix):
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --agent-prefix <PREFIX> --json
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Slot replacement retry, only after user approval:
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --force-slot --json
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Offline config save, only after user approval:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --allow-offline --json
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Status JSON Contract
|
|
118
|
-
|
|
119
|
-
After restart, run:
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
openclaw openviking status --json
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Ready state:
|
|
126
|
-
|
|
127
|
-
```json
|
|
128
|
-
{
|
|
129
|
-
"configured": true,
|
|
130
|
-
"slotActive": true
|
|
131
|
-
}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
Also inspect:
|
|
135
|
-
|
|
136
|
-
| Field | Use |
|
|
137
|
-
| --- | --- |
|
|
138
|
-
| `health.ok` | Confirms server reachability |
|
|
139
|
-
| `health.version` | Records server version |
|
|
140
|
-
| `health.compatibility` | Determines whether to warn |
|
|
141
|
-
| `config.hasApiKey` | Confirms whether an API key was saved |
|
|
142
|
-
| `config.agent_prefix` | Confirms configured agent prefix when present |
|
|
143
|
-
|
|
144
|
-
## Environment Detection
|
|
145
|
-
|
|
146
|
-
Check tools:
|
|
147
|
-
|
|
148
|
-
```bash
|
|
149
|
-
node -v
|
|
150
|
-
openclaw --version
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
Requirements:
|
|
154
|
-
|
|
155
|
-
- Node.js >= 22
|
|
156
|
-
- OpenClaw >= 2026.4.8
|
|
157
|
-
|
|
158
|
-
Version boundaries:
|
|
159
|
-
|
|
160
|
-
- `2026.4.8` is the minimum supported OpenClaw version for the current `@openviking/openclaw-plugin` plugin.
|
|
161
|
-
- `2026.5.3` starts requiring compiled JavaScript runtime output during package install when a plugin package declares TypeScript entries.
|
|
162
|
-
- `2026.5.4` and later no longer fall back to `.ts` source for installed/global plugin runtime loading when the compiled JavaScript output is missing; the plugin may be skipped.
|
|
163
|
-
- Published ClawHub packages are built before release and include `dist/*.js`, so normal users do not need to build locally.
|
|
164
|
-
- `ov-install` is the backup/source install path. Use it only after the OpenClaw plugin manager or ClawHub path is unavailable/rate-limited, or when the user explicitly asks to install a source ref. For OpenClaw `>= 2026.5.3`, it builds the plugin during installation.
|
|
165
|
-
|
|
166
|
-
### 3. Detect or start OpenViking server
|
|
167
|
-
|
|
168
|
-
The OpenClaw plugin only connects to an OpenViking HTTP server. It does not start the server.
|
|
169
|
-
|
|
170
|
-
Check the default local server first:
|
|
171
|
-
|
|
172
|
-
```bash
|
|
173
|
-
curl -fsS http://127.0.0.1:1933/health
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
If no OpenViking server is running and the user wants a local server:
|
|
177
|
-
|
|
178
|
-
```bash
|
|
179
|
-
pip install openviking --upgrade --force-reinstall
|
|
180
|
-
openviking-server init
|
|
181
|
-
openviking-server doctor
|
|
182
|
-
openviking-server
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
Keep `openviking-server` running while OpenClaw uses the plugin. Use `http://127.0.0.1:1933` as the plugin `baseUrl` for the default local setup.
|
|
186
|
-
|
|
187
|
-
For a remote server, confirm the reachable URL with the user and use that URL as `baseUrl`.
|
|
188
|
-
|
|
189
|
-
If OpenClaw is missing, tell the user to install and initialize OpenClaw:
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
npm install -g openclaw
|
|
193
|
-
openclaw onboard
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### 4. Detect existing install state
|
|
197
|
-
|
|
198
|
-
If the user has multiple OpenClaw state directories, ask which one to operate on before changing config.
|
|
199
|
-
|
|
200
|
-
## Existing State Detection
|
|
201
|
-
|
|
202
|
-
Try status first:
|
|
203
|
-
|
|
204
|
-
```bash
|
|
205
|
-
openclaw openviking status --json
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
If the command is unavailable, install the plugin first. If it returns `configured: true` and `slotActive: true`, do not reinstall unless the user requested upgrade or reconfigure.
|
|
209
|
-
|
|
210
|
-
Manual inspection:
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
openclaw config get plugins.entries.openviking.config
|
|
214
|
-
openclaw config get plugins.slots.contextEngine
|
|
215
|
-
openclaw plugins list
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
## Standard Operations
|
|
219
|
-
|
|
220
|
-
Fresh install:
|
|
221
|
-
|
|
222
|
-
```bash
|
|
223
|
-
openclaw plugins install clawhub:@openviking/openclaw-plugin
|
|
224
|
-
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --json
|
|
225
|
-
openclaw gateway restart
|
|
226
|
-
openclaw openviking status --json
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
Reconfigure:
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
openclaw openviking setup --reconfigure
|
|
233
|
-
openclaw gateway restart
|
|
234
|
-
openclaw openviking status --json
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
Upgrade:
|
|
238
|
-
|
|
239
|
-
```bash
|
|
240
|
-
openclaw plugins update openviking
|
|
241
|
-
openclaw gateway restart
|
|
242
|
-
openclaw openviking status --json
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
Uninstall:
|
|
246
|
-
|
|
247
|
-
```bash
|
|
248
|
-
openclaw plugins uninstall openviking
|
|
249
|
-
openclaw config set plugins.slots.contextEngine legacy
|
|
250
|
-
openclaw gateway restart
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
Native uninstall may not reset `plugins.slots.contextEngine`. Always run the explicit `config set` step after uninstall.
|
|
254
|
-
|
|
255
|
-
## Config Fields
|
|
256
|
-
|
|
257
|
-
Config path:
|
|
258
|
-
|
|
259
|
-
```text
|
|
260
|
-
plugins.entries.openviking.config
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
Core fields:
|
|
264
|
-
|
|
265
|
-
| Field | Meaning |
|
|
266
|
-
| --- | --- |
|
|
267
|
-
| `mode` | Legacy compatibility field. Expected value: `remote`. |
|
|
268
|
-
| `baseUrl` | OpenViking HTTP endpoint |
|
|
269
|
-
| `apiKey` | OpenViking API key |
|
|
270
|
-
| `agent_prefix` | Optional; prefix for OpenClaw agent IDs when set. Interactive setup accepts only letters, digits, `_`, and `-`. If unset, the plugin follows session agent IDs. |
|
|
271
|
-
| `accountId` | Required for root API keys |
|
|
272
|
-
| `userId` | Required for root API keys |
|
|
273
|
-
|
|
274
|
-
## Verification
|
|
275
|
-
|
|
276
|
-
Quick verification:
|
|
277
|
-
|
|
278
|
-
```bash
|
|
279
|
-
openclaw openviking status --json
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
Manual verification:
|
|
283
|
-
|
|
284
|
-
```bash
|
|
285
|
-
openclaw config get plugins.slots.contextEngine
|
|
286
|
-
openclaw config get plugins.entries.openviking.config
|
|
287
|
-
openclaw logs --follow
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
Expected log signal:
|
|
291
|
-
|
|
292
|
-
```text
|
|
293
|
-
openviking: registered context-engine
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
Optional end-to-end health check from a repository checkout:
|
|
297
|
-
|
|
298
|
-
```bash
|
|
299
|
-
python examples/openclaw-plugin/health_check_tools/ov-healthcheck.py
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
## Migrate From ov-install
|
|
303
|
-
|
|
304
|
-
If ov-install was previously used, clean up before switching to `openclaw plugins install`:
|
|
305
|
-
|
|
306
|
-
Same plugin ID (openviking, >= 0.3.x):
|
|
307
|
-
|
|
308
|
-
```bash
|
|
309
|
-
rm -rf ~/.openclaw/extensions/openviking/
|
|
310
|
-
openclaw plugins install clawhub:@openviking/openclaw-plugin
|
|
311
|
-
openclaw openviking setup --reconfigure
|
|
312
|
-
openclaw gateway restart
|
|
313
|
-
openclaw openviking status --json
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
Old plugin ID (memory-openviking, < 0.3.x):
|
|
317
|
-
|
|
318
|
-
```bash
|
|
319
|
-
openclaw plugins uninstall memory-openviking 2>/dev/null || true
|
|
320
|
-
openclaw config set plugins.slots.memory none
|
|
321
|
-
rm -rf ~/.openclaw/extensions/memory-openviking/
|
|
322
|
-
openclaw plugins install clawhub:@openviking/openclaw-plugin
|
|
323
|
-
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --json
|
|
324
|
-
openclaw gateway restart
|
|
325
|
-
openclaw openviking status --json
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
Existing config fields are preserved during migration. The new plugin reads old field names at runtime.
|
|
329
|
-
|
|
330
|
-
- `baseUrl`
|
|
331
|
-
- `apiKey`
|
|
332
|
-
- `agent_prefix`: optional; interactive setup accepts only letters, digits, `_`, and `-`
|
|
333
|
-
|
|
334
|
-
## Backup Path: ov-install
|
|
335
|
-
|
|
336
|
-
`ov-install` is the backup path, not the primary user install path. Use it when `openclaw plugins install clawhub:@openviking/openclaw-plugin` cannot reach ClawHub, is rate-limited, or when the user explicitly wants a source ref / Git branch install.
|
|
337
|
-
|
|
338
|
-
Backup install:
|
|
339
|
-
|
|
340
|
-
```bash
|
|
341
|
-
npm install -g openclaw-openviking-setup-helper
|
|
342
|
-
ov-install
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
Backup/source commands:
|
|
346
|
-
|
|
347
|
-
| Intent | Command |
|
|
348
|
-
| --- | --- |
|
|
349
|
-
| Install from a source ref | `ov-install --plugin-version=<REF>` |
|
|
350
|
-
| Non-interactive backup install | `ov-install --base-url <URL> --api-key <KEY>` |
|
|
351
|
-
| Target a non-default OpenClaw state directory | `ov-install --workdir <PATH>` |
|
|
352
|
-
| Show helper-tracked version | `ov-install --current-version` |
|
|
353
|
-
| Update helper-managed install | `ov-install --update` |
|
|
354
|
-
|
|
355
|
-
For user installs, always try `openclaw plugins install clawhub:@openviking/openclaw-plugin` first. Choose `ov-install` only as the backup path.
|
|
1
|
+
# OpenViking Plugin Agent Install Guide
|
|
2
|
+
|
|
3
|
+
This guide is for AI agents and operator automation. Prefer deterministic commands, parse JSON output, and ask the user only when a choice changes the outcome.
|
|
4
|
+
|
|
5
|
+
User-facing docs:
|
|
6
|
+
|
|
7
|
+
- [INSTALL.md](./INSTALL.md)
|
|
8
|
+
- [INSTALL-ZH.md](./INSTALL-ZH.md)
|
|
9
|
+
|
|
10
|
+
## Identity
|
|
11
|
+
|
|
12
|
+
This package is the OpenClaw plugin `@openviking/openclaw-plugin`.
|
|
13
|
+
|
|
14
|
+
| User intent | Command |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| Fresh install, latest | `openclaw plugins install clawhub:@openviking/openclaw-plugin` |
|
|
17
|
+
| Upgrade plugin to latest | `openclaw plugins install clawhub:@openviking/openclaw-plugin` |
|
|
18
|
+
| Install or upgrade a specific release | Use the published ClawHub package selector if available; otherwise ask before using backup `ov-install --plugin-version=<REF>` |
|
|
19
|
+
| Upgrade only the plugin | `openclaw plugins install clawhub:@openviking/openclaw-plugin` |
|
|
20
|
+
| Show installed plugins | `openclaw plugins list` |
|
|
21
|
+
| Backup install when ClawHub is unavailable | `npx -y openclaw-openviking-setup-helper@latest --base-url <URL> [--api-key <KEY>]` |
|
|
22
|
+
| Operate on a specific OpenClaw instance | add `--workdir <path>` |
|
|
23
|
+
| Start missing OpenViking server | `openviking-server init && openviking-server doctor && openviking-server` |
|
|
24
|
+
|
|
25
|
+
Do not install it with:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
clawhub install openviking
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
That installs an AgentSkill, not the plugin. The plugin install command is:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
openclaw plugins install clawhub:@openviking/openclaw-plugin
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Required Inputs
|
|
38
|
+
|
|
39
|
+
Before setup, determine:
|
|
40
|
+
|
|
41
|
+
| Input | Required | How to get it |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| OpenViking base URL | Yes | Ask user or read `OPENVIKING_BASE_URL` |
|
|
44
|
+
| API key | Usually | Ask user or read `OPENVIKING_API_KEY` |
|
|
45
|
+
| Account ID | Only for root API keys | Ask user if setup reports root-key tenant context is needed |
|
|
46
|
+
| User ID | Only for root API keys | Ask user if setup reports root-key tenant context is needed |
|
|
47
|
+
| Slot replacement approval | Only if another context engine owns the slot | Ask user before using `--force-slot` |
|
|
48
|
+
|
|
49
|
+
Never silently replace another context engine.
|
|
50
|
+
|
|
51
|
+
## Primary Workflow
|
|
52
|
+
|
|
53
|
+
Use this workflow for normal installs and upgrades from published packages.
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
openclaw plugins install clawhub:@openviking/openclaw-plugin
|
|
57
|
+
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --json
|
|
58
|
+
openclaw gateway restart
|
|
59
|
+
openclaw openviking status --json
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
If the registry prefix is required:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
openclaw plugins install clawhub:@openviking/openclaw-plugin
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Setup JSON Contract
|
|
69
|
+
|
|
70
|
+
Run setup with `--json` whenever possible:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --json
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Branch on the result:
|
|
77
|
+
|
|
78
|
+
| JSON result | Meaning | Agent action |
|
|
79
|
+
| --- | --- | --- |
|
|
80
|
+
| `success: true` | Setup completed | Restart gateway, then run status |
|
|
81
|
+
| `success: false`, `action: "slot_blocked"` | Another plugin owns `plugins.slots.contextEngine` | Ask user before rerunning with `--force-slot` |
|
|
82
|
+
| `success: false`, `action: "error"` | Validation failed | Report `error`; do not continue as success |
|
|
83
|
+
| `health.ok: false` | Server unreachable | Check URL/service; use `--allow-offline` only with user approval |
|
|
84
|
+
| `keyProbe.keyType: "root_key"` | Root key requires tenant fields | Rerun with `--account-id <ACCOUNT_ID> --user-id <USER_ID>` |
|
|
85
|
+
| `health.compatibility: "server_too_old"` | Server may not support plugin features | Warn user and recommend server upgrade |
|
|
86
|
+
| `health.compatibility: "server_too_new"` | Plugin may be too old | Warn user and recommend plugin upgrade |
|
|
87
|
+
|
|
88
|
+
Root-key retry:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
openclaw openviking setup \
|
|
92
|
+
--base-url <OPENVIKING_URL> \
|
|
93
|
+
--api-key <ROOT_API_KEY> \
|
|
94
|
+
--account-id <ACCOUNT_ID> \
|
|
95
|
+
--user-id <USER_ID> \
|
|
96
|
+
--json
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Custom agent routing prefix (optional; only when the user explicitly requests a prefix):
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --agent-prefix <PREFIX> --json
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Slot replacement retry, only after user approval:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --force-slot --json
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Offline config save, only after user approval:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --allow-offline --json
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Status JSON Contract
|
|
118
|
+
|
|
119
|
+
After restart, run:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
openclaw openviking status --json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Ready state:
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
{
|
|
129
|
+
"configured": true,
|
|
130
|
+
"slotActive": true
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Also inspect:
|
|
135
|
+
|
|
136
|
+
| Field | Use |
|
|
137
|
+
| --- | --- |
|
|
138
|
+
| `health.ok` | Confirms server reachability |
|
|
139
|
+
| `health.version` | Records server version |
|
|
140
|
+
| `health.compatibility` | Determines whether to warn |
|
|
141
|
+
| `config.hasApiKey` | Confirms whether an API key was saved |
|
|
142
|
+
| `config.agent_prefix` | Confirms configured agent prefix when present |
|
|
143
|
+
|
|
144
|
+
## Environment Detection
|
|
145
|
+
|
|
146
|
+
Check tools:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
node -v
|
|
150
|
+
openclaw --version
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
Requirements:
|
|
154
|
+
|
|
155
|
+
- Node.js >= 22
|
|
156
|
+
- OpenClaw >= 2026.4.8
|
|
157
|
+
|
|
158
|
+
Version boundaries:
|
|
159
|
+
|
|
160
|
+
- `2026.4.8` is the minimum supported OpenClaw version for the current `@openviking/openclaw-plugin` plugin.
|
|
161
|
+
- `2026.5.3` starts requiring compiled JavaScript runtime output during package install when a plugin package declares TypeScript entries.
|
|
162
|
+
- `2026.5.4` and later no longer fall back to `.ts` source for installed/global plugin runtime loading when the compiled JavaScript output is missing; the plugin may be skipped.
|
|
163
|
+
- Published ClawHub packages are built before release and include `dist/*.js`, so normal users do not need to build locally.
|
|
164
|
+
- `ov-install` is the backup/source install path. Use it only after the OpenClaw plugin manager or ClawHub path is unavailable/rate-limited, or when the user explicitly asks to install a source ref. For OpenClaw `>= 2026.5.3`, it builds the plugin during installation.
|
|
165
|
+
|
|
166
|
+
### 3. Detect or start OpenViking server
|
|
167
|
+
|
|
168
|
+
The OpenClaw plugin only connects to an OpenViking HTTP server. It does not start the server.
|
|
169
|
+
|
|
170
|
+
Check the default local server first:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
curl -fsS http://127.0.0.1:1933/health
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
If no OpenViking server is running and the user wants a local server:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
pip install openviking --upgrade --force-reinstall
|
|
180
|
+
openviking-server init
|
|
181
|
+
openviking-server doctor
|
|
182
|
+
openviking-server
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Keep `openviking-server` running while OpenClaw uses the plugin. Use `http://127.0.0.1:1933` as the plugin `baseUrl` for the default local setup.
|
|
186
|
+
|
|
187
|
+
For a remote server, confirm the reachable URL with the user and use that URL as `baseUrl`.
|
|
188
|
+
|
|
189
|
+
If OpenClaw is missing, tell the user to install and initialize OpenClaw:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
npm install -g openclaw
|
|
193
|
+
openclaw onboard
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### 4. Detect existing install state
|
|
197
|
+
|
|
198
|
+
If the user has multiple OpenClaw state directories, ask which one to operate on before changing config.
|
|
199
|
+
|
|
200
|
+
## Existing State Detection
|
|
201
|
+
|
|
202
|
+
Try status first:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
openclaw openviking status --json
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
If the command is unavailable, install the plugin first. If it returns `configured: true` and `slotActive: true`, do not reinstall unless the user requested upgrade or reconfigure.
|
|
209
|
+
|
|
210
|
+
Manual inspection:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
openclaw config get plugins.entries.openviking.config
|
|
214
|
+
openclaw config get plugins.slots.contextEngine
|
|
215
|
+
openclaw plugins list
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Standard Operations
|
|
219
|
+
|
|
220
|
+
Fresh install:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
openclaw plugins install clawhub:@openviking/openclaw-plugin
|
|
224
|
+
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --json
|
|
225
|
+
openclaw gateway restart
|
|
226
|
+
openclaw openviking status --json
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Reconfigure:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
openclaw openviking setup --reconfigure
|
|
233
|
+
openclaw gateway restart
|
|
234
|
+
openclaw openviking status --json
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Upgrade:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
openclaw plugins update openviking
|
|
241
|
+
openclaw gateway restart
|
|
242
|
+
openclaw openviking status --json
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Uninstall:
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
openclaw plugins uninstall openviking
|
|
249
|
+
openclaw config set plugins.slots.contextEngine legacy
|
|
250
|
+
openclaw gateway restart
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Native uninstall may not reset `plugins.slots.contextEngine`. Always run the explicit `config set` step after uninstall.
|
|
254
|
+
|
|
255
|
+
## Config Fields
|
|
256
|
+
|
|
257
|
+
Config path:
|
|
258
|
+
|
|
259
|
+
```text
|
|
260
|
+
plugins.entries.openviking.config
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
Core fields:
|
|
264
|
+
|
|
265
|
+
| Field | Meaning |
|
|
266
|
+
| --- | --- |
|
|
267
|
+
| `mode` | Legacy compatibility field. Expected value: `remote`. |
|
|
268
|
+
| `baseUrl` | OpenViking HTTP endpoint |
|
|
269
|
+
| `apiKey` | OpenViking API key |
|
|
270
|
+
| `agent_prefix` | Optional; prefix for OpenClaw agent IDs when set. Interactive setup accepts only letters, digits, `_`, and `-`. If unset, the plugin follows session agent IDs. |
|
|
271
|
+
| `accountId` | Required for root API keys |
|
|
272
|
+
| `userId` | Required for root API keys |
|
|
273
|
+
|
|
274
|
+
## Verification
|
|
275
|
+
|
|
276
|
+
Quick verification:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
openclaw openviking status --json
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Manual verification:
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
openclaw config get plugins.slots.contextEngine
|
|
286
|
+
openclaw config get plugins.entries.openviking.config
|
|
287
|
+
openclaw logs --follow
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Expected log signal:
|
|
291
|
+
|
|
292
|
+
```text
|
|
293
|
+
openviking: registered context-engine
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
Optional end-to-end health check from a repository checkout:
|
|
297
|
+
|
|
298
|
+
```bash
|
|
299
|
+
python examples/openclaw-plugin/health_check_tools/ov-healthcheck.py
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## Migrate From ov-install
|
|
303
|
+
|
|
304
|
+
If ov-install was previously used, clean up before switching to `openclaw plugins install`:
|
|
305
|
+
|
|
306
|
+
Same plugin ID (openviking, >= 0.3.x):
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
rm -rf ~/.openclaw/extensions/openviking/
|
|
310
|
+
openclaw plugins install clawhub:@openviking/openclaw-plugin
|
|
311
|
+
openclaw openviking setup --reconfigure
|
|
312
|
+
openclaw gateway restart
|
|
313
|
+
openclaw openviking status --json
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Old plugin ID (memory-openviking, < 0.3.x):
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
openclaw plugins uninstall memory-openviking 2>/dev/null || true
|
|
320
|
+
openclaw config set plugins.slots.memory none
|
|
321
|
+
rm -rf ~/.openclaw/extensions/memory-openviking/
|
|
322
|
+
openclaw plugins install clawhub:@openviking/openclaw-plugin
|
|
323
|
+
openclaw openviking setup --base-url <OPENVIKING_URL> --api-key <API_KEY> --json
|
|
324
|
+
openclaw gateway restart
|
|
325
|
+
openclaw openviking status --json
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Existing config fields are preserved during migration. The new plugin reads old field names at runtime.
|
|
329
|
+
|
|
330
|
+
- `baseUrl`
|
|
331
|
+
- `apiKey`
|
|
332
|
+
- `agent_prefix`: optional; interactive setup accepts only letters, digits, `_`, and `-`
|
|
333
|
+
|
|
334
|
+
## Backup Path: ov-install
|
|
335
|
+
|
|
336
|
+
`ov-install` is the backup path, not the primary user install path. Use it when `openclaw plugins install clawhub:@openviking/openclaw-plugin` cannot reach ClawHub, is rate-limited, or when the user explicitly wants a source ref / Git branch install.
|
|
337
|
+
|
|
338
|
+
Backup install:
|
|
339
|
+
|
|
340
|
+
```bash
|
|
341
|
+
npm install -g openclaw-openviking-setup-helper
|
|
342
|
+
ov-install
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
Backup/source commands:
|
|
346
|
+
|
|
347
|
+
| Intent | Command |
|
|
348
|
+
| --- | --- |
|
|
349
|
+
| Install from a source ref | `ov-install --plugin-version=<REF>` |
|
|
350
|
+
| Non-interactive backup install | `ov-install --base-url <URL> --api-key <KEY>` |
|
|
351
|
+
| Target a non-default OpenClaw state directory | `ov-install --workdir <PATH>` |
|
|
352
|
+
| Show helper-tracked version | `ov-install --current-version` |
|
|
353
|
+
| Update helper-managed install | `ov-install --update` |
|
|
354
|
+
|
|
355
|
+
For user installs, always try `openclaw plugins install clawhub:@openviking/openclaw-plugin` first. Choose `ov-install` only as the backup path.
|