@openviking/openclaw-plugin 2026.6.2 → 2026.6.17-dev.2

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.
Files changed (108) hide show
  1. package/INSTALL-AGENT.md +4 -4
  2. package/INSTALL-ZH.md +68 -8
  3. package/INSTALL.md +12 -8
  4. package/README.md +45 -35
  5. package/adapters/http-transport.ts +3 -0
  6. package/adapters/resource-packager.ts +141 -0
  7. package/auto-recall.ts +258 -27
  8. package/client.ts +201 -177
  9. package/commands/setup.ts +200 -33
  10. package/config/feature-gates.json +10 -0
  11. package/config.ts +428 -85
  12. package/context-engine.ts +71 -1402
  13. package/dist/adapters/http-transport.js +1 -0
  14. package/dist/adapters/resource-packager.js +114 -0
  15. package/dist/auto-recall.js +201 -25
  16. package/dist/client.js +125 -161
  17. package/dist/commands/setup.js +170 -32
  18. package/dist/config.js +285 -64
  19. package/dist/context-engine.js +62 -1173
  20. package/dist/index.js +209 -1489
  21. package/dist/memory-ranking.js +35 -12
  22. package/dist/plugin/command-registration.js +5 -0
  23. package/dist/plugin/openviking-archive-tools.js +210 -0
  24. package/dist/plugin/openviking-bypass-runtime.js +8 -0
  25. package/dist/plugin/openviking-client-runtime.js +28 -0
  26. package/dist/plugin/openviking-command-args.js +146 -0
  27. package/dist/plugin/openviking-command-definitions.js +206 -0
  28. package/dist/plugin/openviking-context-engine-ref.js +11 -0
  29. package/dist/plugin/openviking-context-engine-registration.js +23 -0
  30. package/dist/plugin/openviking-feature-gates.js +250 -0
  31. package/dist/plugin/openviking-import-runtime.js +50 -0
  32. package/dist/plugin/openviking-import-tools.js +86 -0
  33. package/dist/plugin/openviking-lifecycle-hooks.js +33 -0
  34. package/dist/plugin/openviking-memory-recall-tools.js +233 -0
  35. package/dist/plugin/openviking-memory-tools.js +199 -0
  36. package/dist/plugin/openviking-query-config-command.js +203 -0
  37. package/dist/plugin/openviking-query-runtime.js +367 -0
  38. package/dist/plugin/openviking-query-tools.js +91 -0
  39. package/dist/plugin/openviking-recall-trace-runtime.js +387 -0
  40. package/dist/plugin/openviking-recall-trace-tools.js +38 -0
  41. package/dist/plugin/openviking-runtime-state.js +26 -0
  42. package/dist/plugin/openviking-runtime-utils.js +62 -0
  43. package/dist/plugin/openviking-services.js +20 -0
  44. package/dist/plugin/openviking-session-routing-runtime.js +61 -0
  45. package/dist/plugin/openviking-tool-result-tools.js +268 -0
  46. package/dist/plugin/recall-trace-routes.js +77 -0
  47. package/dist/plugin/tool-registration.js +23 -0
  48. package/dist/process-manager.js +1 -1
  49. package/dist/query-config.js +336 -0
  50. package/dist/recall-trace.js +309 -0
  51. package/dist/registries/recall-resource-types.js +58 -0
  52. package/dist/routing/identity-routing.js +152 -0
  53. package/dist/routing/memory-uri.js +7 -0
  54. package/dist/services/context-lifecycle-service.js +847 -0
  55. package/dist/services/context-message-adapter.js +340 -0
  56. package/dist/session-transcript-repair.js +0 -1
  57. package/dist/text-utils.js +14 -31
  58. package/index.ts +271 -1873
  59. package/install-manifest.json +10 -1
  60. package/memory-ranking.ts +46 -10
  61. package/openclaw.plugin.json +198 -36
  62. package/package.json +14 -4
  63. package/plugin/command-registration.ts +34 -0
  64. package/plugin/openviking-archive-tools.ts +301 -0
  65. package/plugin/openviking-bypass-runtime.ts +26 -0
  66. package/plugin/openviking-client-runtime.ts +74 -0
  67. package/plugin/openviking-command-args.ts +187 -0
  68. package/plugin/openviking-command-definitions.ts +294 -0
  69. package/plugin/openviking-context-engine-ref.ts +16 -0
  70. package/plugin/openviking-context-engine-registration.ts +97 -0
  71. package/plugin/openviking-feature-gates.ts +335 -0
  72. package/plugin/openviking-import-runtime.ts +105 -0
  73. package/plugin/openviking-import-tools.ts +133 -0
  74. package/plugin/openviking-lifecycle-hooks.ts +65 -0
  75. package/plugin/openviking-memory-recall-tools.ts +368 -0
  76. package/plugin/openviking-memory-tools.ts +299 -0
  77. package/plugin/openviking-query-config-command.ts +230 -0
  78. package/plugin/openviking-query-formatters.ts +108 -0
  79. package/plugin/openviking-query-runtime.ts +476 -0
  80. package/plugin/openviking-query-tools.ts +161 -0
  81. package/plugin/openviking-recall-trace-runtime.ts +482 -0
  82. package/plugin/openviking-recall-trace-tools.ts +99 -0
  83. package/plugin/openviking-runtime-state.ts +52 -0
  84. package/plugin/openviking-runtime-utils.ts +67 -0
  85. package/plugin/openviking-services.ts +49 -0
  86. package/plugin/openviking-session-routing-runtime.ts +105 -0
  87. package/plugin/openviking-tool-result-tools.ts +397 -0
  88. package/plugin/recall-trace-routes.ts +133 -0
  89. package/plugin/tool-registration.ts +51 -0
  90. package/process-manager.ts +1 -1
  91. package/query-config.ts +400 -0
  92. package/recall-trace.ts +442 -0
  93. package/registries/openviking-tools.ts +84 -0
  94. package/registries/recall-resource-types.ts +74 -0
  95. package/routing/identity-routing.ts +210 -0
  96. package/routing/memory-uri.ts +8 -0
  97. package/services/context-lifecycle-service.ts +1209 -0
  98. package/services/context-message-adapter.ts +375 -0
  99. package/services/setup/config-writer.ts +125 -0
  100. package/services/setup/exit-utils.ts +5 -0
  101. package/services/setup/package-metadata.ts +56 -0
  102. package/services/setup/probe-service.ts +143 -0
  103. package/services/setup/setup-flow.ts +306 -0
  104. package/services/setup/version-compatibility.ts +41 -0
  105. package/session-transcript-repair.ts +0 -2
  106. package/skills/install-openviking-memory/SKILL.md +123 -50
  107. package/skills/openviking-context-database/SKILL.md +286 -0
  108. package/text-utils.ts +15 -34
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifestVersion": "1.0",
3
- "pluginVersion": "2026.5.8",
3
+ "pluginVersion": "2026.6.11",
4
4
  "plugin": {
5
5
  "id": "openviking",
6
6
  "kind": "context-engine",
@@ -20,7 +20,15 @@
20
20
  "tool-call-id.ts",
21
21
  "session-transcript-repair.ts",
22
22
  "runtime-utils.ts",
23
+ "recall-trace.ts",
24
+ "query-config.ts",
25
+ "adapters/",
26
+ "registries/",
27
+ "routing/",
28
+ "plugin/",
29
+ "services/",
23
30
  "commands/setup.ts",
31
+ "config/feature-gates.json",
24
32
  "tsconfig.json",
25
33
  "tsconfig.build.json",
26
34
  "package.json",
@@ -30,6 +38,7 @@
30
38
  "package-lock.json",
31
39
  ".gitignore",
32
40
  "skills/install-openviking-memory/SKILL.md",
41
+ "skills/openviking-context-database/SKILL.md",
33
42
  "INSTALL-AGENT.md"
34
43
  ]
35
44
  },
package/memory-ranking.ts CHANGED
@@ -182,6 +182,28 @@ type RecallQueryProfile = {
182
182
  wantsTemporal: boolean;
183
183
  };
184
184
 
185
+ export type RankingWeights = {
186
+ baseScore?: number;
187
+ leaf?: number;
188
+ event?: number;
189
+ preference?: number;
190
+ lexicalOverlapMax?: number;
191
+ };
192
+
193
+ export type RankingOptions = {
194
+ weights?: RankingWeights;
195
+ categoryWeights?: Record<string, number>;
196
+ resourceTypeWeights?: Record<string, number>;
197
+ };
198
+
199
+ const DEFAULT_RANKING_WEIGHTS = {
200
+ baseScore: 1,
201
+ leaf: 0.12,
202
+ event: 0.1,
203
+ preference: 0.08,
204
+ lexicalOverlapMax: 0.2,
205
+ };
206
+
185
207
  function buildRecallQueryProfile(query: string): RecallQueryProfile {
186
208
  const text = query.trim();
187
209
  const allTokens = text.toLowerCase().match(QUERY_TOKEN_RE) ?? [];
@@ -193,7 +215,7 @@ function buildRecallQueryProfile(query: string): RecallQueryProfile {
193
215
  };
194
216
  }
195
217
 
196
- function lexicalOverlapBoost(tokens: string[], text: string): number {
218
+ function lexicalOverlapBoost(tokens: string[], text: string, maxBoost = DEFAULT_RANKING_WEIGHTS.lexicalOverlapMax): number {
197
219
  if (tokens.length === 0 || !text) {
198
220
  return 0;
199
221
  }
@@ -204,18 +226,31 @@ function lexicalOverlapBoost(tokens: string[], text: string): number {
204
226
  matched += 1;
205
227
  }
206
228
  }
207
- return Math.min(0.2, (matched / Math.min(tokens.length, 4)) * 0.2);
229
+ return Math.min(maxBoost, (matched / Math.min(tokens.length, 4)) * maxBoost);
230
+ }
231
+
232
+ function inferResourceType(item: FindResultItem): string | undefined {
233
+ if (item.uri.startsWith("viking://resources")) return "resource";
234
+ if (item.uri.startsWith("viking://session/")) return "session";
235
+ if (item.uri.startsWith("viking://user/skills") || item.uri.startsWith("viking://skills")) return "agent";
236
+ if (item.uri.startsWith("viking://user/")) return "user";
237
+ return undefined;
208
238
  }
209
239
 
210
- function rankForInjection(item: FindResultItem, query: RecallQueryProfile): number {
240
+ function rankForInjection(item: FindResultItem, query: RecallQueryProfile, options?: RankingOptions): number {
211
241
  // Keep ranking simple and stable: semantic score + light query-aware boosts.
212
- const baseScore = clampScore(item.score);
242
+ const weights = { ...DEFAULT_RANKING_WEIGHTS, ...(options?.weights ?? {}) };
243
+ const baseScore = clampScore(item.score) * weights.baseScore;
213
244
  const abstract = (item.abstract ?? item.overview ?? "").trim();
214
- const leafBoost = isLeafLikeMemory(item) ? 0.12 : 0;
215
- const eventBoost = query.wantsTemporal && isEventMemory(item) ? 0.1 : 0;
216
- const preferenceBoost = query.wantsPreference && isPreferencesMemory(item) ? 0.08 : 0;
217
- const overlapBoost = lexicalOverlapBoost(query.tokens, `${item.uri} ${abstract}`);
218
- return baseScore + leafBoost + eventBoost + preferenceBoost + overlapBoost;
245
+ const leafBoost = isLeafLikeMemory(item) ? weights.leaf : 0;
246
+ const eventBoost = query.wantsTemporal && isEventMemory(item) ? weights.event : 0;
247
+ const preferenceBoost = query.wantsPreference && isPreferencesMemory(item) ? weights.preference : 0;
248
+ const overlapBoost = lexicalOverlapBoost(query.tokens, `${item.uri} ${abstract}`, weights.lexicalOverlapMax);
249
+ const category = (item.category ?? "").toLowerCase();
250
+ const categoryBoost = category ? (options?.categoryWeights?.[category] ?? options?.categoryWeights?.[item.category ?? ""] ?? 0) : 0;
251
+ const resourceType = inferResourceType(item);
252
+ const resourceTypeBoost = resourceType ? (options?.resourceTypeWeights?.[resourceType] ?? 0) : 0;
253
+ return baseScore + leafBoost + eventBoost + preferenceBoost + overlapBoost + categoryBoost + resourceTypeBoost;
219
254
  }
220
255
 
221
256
  export function pickMemoriesForInjection(
@@ -223,13 +258,14 @@ export function pickMemoriesForInjection(
223
258
  limit: number,
224
259
  queryText: string,
225
260
  scoreThreshold: number = 0,
261
+ rankingOptions?: RankingOptions,
226
262
  ): FindResultItem[] {
227
263
  if (items.length === 0 || limit <= 0) {
228
264
  return [];
229
265
  }
230
266
 
231
267
  const query = buildRecallQueryProfile(queryText);
232
- const sorted = [...items].sort((a, b) => rankForInjection(b, query) - rankForInjection(a, query));
268
+ const sorted = [...items].sort((a, b) => rankForInjection(b, query, rankingOptions) - rankForInjection(a, query, rankingOptions));
233
269
  const deduped: FindResultItem[] = [];
234
270
  const seen = new Set<string>();
235
271
  for (const item of sorted) {
@@ -12,10 +12,13 @@
12
12
  },
13
13
  "contracts": {
14
14
  "tools": [
15
- "add_resource",
16
15
  "add_skill",
17
16
  "ov_search",
17
+ "ov_read",
18
+ "ov_multi_read",
19
+ "ov_list",
18
20
  "memory_recall",
21
+ "ov_recall_trace",
19
22
  "memory_store",
20
23
  "memory_forget",
21
24
  "ov_archive_search",
@@ -44,7 +47,8 @@
44
47
  ]
45
48
  },
46
49
  "skills": [
47
- "./skills/install-openviking-memory"
50
+ "./skills/install-openviking-memory",
51
+ "./skills/openviking-context-database"
48
52
  ],
49
53
  "setup": {
50
54
  "providers": [
@@ -78,10 +82,15 @@
78
82
  "placeholder": "http://127.0.0.1:1933",
79
83
  "help": "HTTP URL when mode is remote (or ${OPENVIKING_BASE_URL})"
80
84
  },
81
- "agent_prefix": {
82
- "label": "Agent Prefix",
85
+ "peer_role": {
86
+ "label": "Peer Role",
87
+ "placeholder": "assistant",
88
+ "help": "Controls which messages include peer_id: none, assistant, or person. New installs default to assistant."
89
+ },
90
+ "peer_prefix": {
91
+ "label": "Peer Prefix",
83
92
  "placeholder": "optional-prefix",
84
- "help": "Optional OpenViking agent prefix. Empty: follow OpenClaw ctx.agentId directly. Non-empty: use `<prefix>_<OpenClaw ctx.agentId>` (sanitized to letters/digits/_/-). If OpenClaw ctx.agentId is unavailable, use OpenClaw default agent `main`."
93
+ "help": "Optional prefix for assistant peer_id values derived from OpenClaw runtime agent IDs."
85
94
  },
86
95
  "apiKey": {
87
96
  "label": "OpenViking API Key",
@@ -101,24 +110,6 @@
101
110
  "help": "Advanced option. Tenant user ID. Only needed when explicitly sending identity headers.",
102
111
  "advanced": true
103
112
  },
104
- "isolateUserScopeByAgent": {
105
- "label": "Isolate User Scope By Agent",
106
- "placeholder": "false",
107
- "help": "Canonical namespace policy. false (default): user alias expands to viking://user/<user_id>/... . true: expands to viking://user/<user_id>/agent/<agent_id>/... . Must match the server-side account namespace policy.",
108
- "advanced": true
109
- },
110
- "isolateAgentScopeByUser": {
111
- "label": "Isolate Agent Scope By User",
112
- "placeholder": "false",
113
- "help": "Canonical namespace policy. false (default): agent alias expands to viking://agent/<agent_id>/... . true: expands to viking://agent/<agent_id>/user/<user_id>/... . Must match the server-side account namespace policy.",
114
- "advanced": true
115
- },
116
- "agentScopeMode": {
117
- "label": "Deprecated Agent Scope Mode",
118
- "placeholder": "agent",
119
- "help": "Deprecated compatibility alias for older routing. Prefer isolateUserScopeByAgent / isolateAgentScopeByUser. Explicit user_agent => false/true, explicit agent => false/false. When fully unset, the plugin defaults to false/false to match the current server-side policy.",
120
- "advanced": true
121
- },
122
113
  "targetUri": {
123
114
  "label": "Search Target URI",
124
115
  "placeholder": "viking://user/memories",
@@ -149,11 +140,23 @@
149
140
  "label": "Auto-Recall",
150
141
  "help": "Inject relevant OpenViking memories into agent context"
151
142
  },
143
+ "autoRecallTimeoutMs": {
144
+ "label": "Auto-Recall Timeout (ms)",
145
+ "placeholder": "5000",
146
+ "advanced": true,
147
+ "help": "Outer time budget for the whole auto-recall flow, including search, ranking, and memory reads."
148
+ },
152
149
  "recallResources": {
153
150
  "label": "Recall Resources",
154
151
  "help": "Include resources (viking://resources) in auto-recall and default memory_recall search. Enables account-level shared knowledge retrieval.",
155
152
  "advanced": true
156
153
  },
154
+ "recallTargetTypes": {
155
+ "label": "Recall Target Types",
156
+ "placeholder": "user,agent",
157
+ "help": "Comma-separated auto-recall and default memory_recall targets: user, agent, resource. Session history is available through ov_archive_search and ov_archive_expand.",
158
+ "advanced": true
159
+ },
157
160
  "recallLimit": {
158
161
  "label": "Recall Limit",
159
162
  "placeholder": "6",
@@ -214,6 +217,42 @@
214
217
  "label": "Log find requests",
215
218
  "help": "Log tenant routing: /search/find + session messages/commit (X-OpenViking-*; not apiKey). Or set env OPENVIKING_LOG_ROUTING=1 or OPENVIKING_DEBUG=1.",
216
219
  "advanced": true
220
+ },
221
+ "traceRecall": {
222
+ "label": "Trace Recall",
223
+ "placeholder": "false",
224
+ "help": "Enable best-effort recall trace recording for debugging recall and search decisions.",
225
+ "advanced": true
226
+ },
227
+ "traceRecallPersist": {
228
+ "label": "Persist Recall Trace",
229
+ "placeholder": "false",
230
+ "help": "Persist recall traces to local JSONL files. Disabled by default.",
231
+ "advanced": true
232
+ },
233
+ "traceRecallDir": {
234
+ "label": "Recall Trace Directory",
235
+ "placeholder": "~/.openclaw/openviking/recall-traces",
236
+ "help": "Directory for persisted recall trace JSONL files.",
237
+ "advanced": true
238
+ },
239
+ "enableAddResourceTool": {
240
+ "label": "Enable Add Resource Tool",
241
+ "placeholder": "false",
242
+ "help": "Disabled by default so search and read flows cannot call add_resource. Set true only when agents should import resources; manual /add-resource remains available.",
243
+ "advanced": true
244
+ },
245
+ "enabledTools": {
246
+ "label": "Enabled Tools",
247
+ "placeholder": "default",
248
+ "help": "Agent-visible tool allowlist. Accepts tool names or groups: default, all, memory, resource_query, import, recall_trace, archive, tool_result. add_resource also requires enableAddResourceTool=true.",
249
+ "advanced": true
250
+ },
251
+ "disabledTools": {
252
+ "label": "Disabled Tools",
253
+ "placeholder": "memory",
254
+ "help": "Agent-visible tool blocklist applied after enabledTools. Accepts the same tool names or groups.",
255
+ "advanced": true
217
256
  }
218
257
  },
219
258
  "configSchema": {
@@ -227,12 +266,19 @@
227
266
  "baseUrl": {
228
267
  "type": "string"
229
268
  },
230
- "agent_prefix": {
231
- "type": "string"
269
+ "peer_role": {
270
+ "type": "string",
271
+ "enum": [
272
+ "none",
273
+ "assistant",
274
+ "person"
275
+ ],
276
+ "default": "assistant",
277
+ "description": "Controls which session messages include peer_id."
232
278
  },
233
- "agentId": {
279
+ "peer_prefix": {
234
280
  "type": "string",
235
- "description": "Deprecated: use agent_prefix instead"
281
+ "description": "Optional prefix for assistant peer_id values."
236
282
  },
237
283
  "serverAuthMode": {
238
284
  "type": "string",
@@ -247,15 +293,6 @@
247
293
  "userId": {
248
294
  "type": "string"
249
295
  },
250
- "isolateUserScopeByAgent": {
251
- "type": "boolean"
252
- },
253
- "isolateAgentScopeByUser": {
254
- "type": "boolean"
255
- },
256
- "agentScopeMode": {
257
- "type": "string"
258
- },
259
296
  "targetUri": {
260
297
  "type": "string"
261
298
  },
@@ -274,9 +311,32 @@
274
311
  "autoRecall": {
275
312
  "type": "boolean"
276
313
  },
314
+ "autoRecallTimeoutMs": {
315
+ "type": "number",
316
+ "minimum": 1000,
317
+ "maximum": 300000
318
+ },
277
319
  "recallResources": {
278
320
  "type": "boolean"
279
321
  },
322
+ "recallTargetTypes": {
323
+ "oneOf": [
324
+ {
325
+ "type": "string"
326
+ },
327
+ {
328
+ "type": "array",
329
+ "items": {
330
+ "type": "string",
331
+ "enum": [
332
+ "resource",
333
+ "user",
334
+ "agent"
335
+ ]
336
+ }
337
+ }
338
+ ]
339
+ },
280
340
  "recallLimit": {
281
341
  "type": "number"
282
342
  },
@@ -329,6 +389,108 @@
329
389
  },
330
390
  "logFindRequests": {
331
391
  "type": "boolean"
392
+ },
393
+ "traceRecall": {
394
+ "type": "boolean"
395
+ },
396
+ "traceRecallPersist": {
397
+ "type": "boolean"
398
+ },
399
+ "traceRecallDir": {
400
+ "type": "string"
401
+ },
402
+ "traceRecallRetentionDays": {
403
+ "type": "number",
404
+ "minimum": 1,
405
+ "maximum": 3650
406
+ },
407
+ "traceRecallLoadRecentDays": {
408
+ "type": "number",
409
+ "minimum": 0,
410
+ "maximum": 3650
411
+ },
412
+ "traceRecallMaxEntries": {
413
+ "type": "number",
414
+ "minimum": 1,
415
+ "maximum": 1000000
416
+ },
417
+ "traceRecallMaxResultsPerSearch": {
418
+ "type": "number",
419
+ "minimum": 1,
420
+ "maximum": 1000
421
+ },
422
+ "traceRecallPreviewChars": {
423
+ "type": "number",
424
+ "minimum": 20,
425
+ "maximum": 10000
426
+ },
427
+ "traceRecallQueryMaxChars": {
428
+ "type": "number",
429
+ "minimum": 200,
430
+ "maximum": 200000
431
+ },
432
+ "traceRecallQueryMaxDays": {
433
+ "type": "number",
434
+ "minimum": 1,
435
+ "maximum": 3650
436
+ },
437
+ "traceRecallIncludeContentByDefault": {
438
+ "type": "boolean"
439
+ },
440
+ "traceRecallIncludeRawUserPreview": {
441
+ "type": "boolean"
442
+ },
443
+ "enableAddResourceTool": {
444
+ "type": "boolean"
445
+ },
446
+ "enabledTools": {
447
+ "oneOf": [
448
+ {
449
+ "type": "array",
450
+ "items": {
451
+ "type": "string"
452
+ }
453
+ },
454
+ {
455
+ "type": "string"
456
+ }
457
+ ]
458
+ },
459
+ "disabledTools": {
460
+ "oneOf": [
461
+ {
462
+ "type": "array",
463
+ "items": {
464
+ "type": "string"
465
+ }
466
+ },
467
+ {
468
+ "type": "string"
469
+ }
470
+ ]
471
+ },
472
+ "agentExperience": {
473
+ "type": "object",
474
+ "additionalProperties": false,
475
+ "properties": {
476
+ "enabled": {
477
+ "type": "boolean",
478
+ "default": false,
479
+ "description": "Enable agent experience memory recall. Default is false for conservative rollout."
480
+ },
481
+ "recallLimit": {
482
+ "type": "number"
483
+ },
484
+ "scoreThreshold": {
485
+ "type": "number"
486
+ },
487
+ "maxInjectedChars": {
488
+ "type": "number"
489
+ },
490
+ "minQueryChars": {
491
+ "type": "number"
492
+ }
493
+ }
332
494
  }
333
495
  }
334
496
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openviking/openclaw-plugin",
3
- "version": "2026.6.2",
3
+ "version": "2026.6.17-dev.2",
4
4
  "displayName": "OpenViking",
5
5
  "description": "OpenClaw context-engine plugin — OpenViking AI memory, long-term memory, knowledge base, semantic search, RAG, context engine. 长期记忆 · 知识库 · 语义检索 · 上下文引擎",
6
6
  "type": "module",
@@ -21,7 +21,13 @@
21
21
  "files": [
22
22
  "dist/",
23
23
  "*.ts",
24
+ "adapters/",
24
25
  "commands/setup.ts",
26
+ "config/feature-gates.json",
27
+ "registries/",
28
+ "routing/",
29
+ "plugin/",
30
+ "services/",
25
31
  "!vitest.config.ts",
26
32
  "install-manifest.json",
27
33
  "openclaw.plugin.json",
@@ -34,7 +40,7 @@
34
40
  "skills/"
35
41
  ],
36
42
  "scripts": {
37
- "build": "tsc -p tsconfig.build.json",
43
+ "build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && tsc -p tsconfig.build.json",
38
44
  "prepack": "npm run build",
39
45
  "test": "vitest run",
40
46
  "typecheck": "tsc -p tsconfig.json",
@@ -51,14 +57,17 @@
51
57
  "type": "git",
52
58
  "url": "https://github.com/volcengine/OpenViking"
53
59
  },
60
+ "overrides": {
61
+ "axios": "^1.16.1"
62
+ },
54
63
  "homepage": "https://github.com/volcengine/OpenViking/tree/main/examples/openclaw-plugin",
55
64
  "license": "MIT",
56
65
  "author": "OpenViking Contributors",
57
66
  "openclaw": {
58
67
  "extensions": [
59
- "./index.ts"
68
+ "./dist/index.js"
60
69
  ],
61
- "setupEntry": "./commands/setup.ts",
70
+ "setupEntry": "./dist/commands/setup.js",
62
71
  "compat": {
63
72
  "pluginApi": ">=2026.4.8",
64
73
  "minGatewayVersion": "2026.4.8"
@@ -70,6 +79,7 @@
70
79
  },
71
80
  "devDependencies": {
72
81
  "@types/node": "^25.3.5",
82
+ "@volcengine/tos-sdk": "^2.9.1",
73
83
  "typescript": "^5.8.0",
74
84
  "vitest": "^4.1.0"
75
85
  }
@@ -0,0 +1,34 @@
1
+ export type PluginCommandContext = {
2
+ args?: string;
3
+ commandBody?: string;
4
+ sessionKey?: string;
5
+ sessionId?: string;
6
+ agentId?: string;
7
+ ovSessionId?: string;
8
+ };
9
+
10
+ export type CommandResult = {
11
+ text: string;
12
+ details?: Record<string, unknown>;
13
+ };
14
+
15
+ export type CommandDefinition = {
16
+ name: string;
17
+ description: string;
18
+ acceptsArgs?: boolean;
19
+ requireAuth?: boolean;
20
+ handler: (ctx: PluginCommandContext) => CommandResult | Promise<CommandResult>;
21
+ };
22
+
23
+ export type OpenVikingCommandRegistrationApi = {
24
+ registerCommand?: (command: CommandDefinition) => void;
25
+ };
26
+
27
+ export function registerOpenVikingCommands(
28
+ api: OpenVikingCommandRegistrationApi,
29
+ commands: CommandDefinition[],
30
+ ): void {
31
+ for (const command of commands) {
32
+ api.registerCommand?.(command);
33
+ }
34
+ }