@openviking/openclaw-plugin 2026.10.23 → 2026.10.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/client.ts +1 -10
- package/commands/setup.ts +0 -1
- package/config.ts +1 -23
- package/dist/client.js +1 -8
- package/dist/commands/setup.js +0 -1
- package/dist/config.js +0 -12
- package/dist/plugin/openviking-client-runtime.js +0 -1
- package/install-manifest.json +1 -1
- package/openclaw.plugin.json +0 -14
- package/package.json +1 -1
- package/plugin/openviking-client-runtime.ts +0 -3
- package/dist/shared/redact.mjs +0 -546
- package/dist/shared/secret-rules.mjs +0 -289
- package/dist/shared/workspace-identity.mjs +0 -339
- package/shared/redact.d.mts +0 -26
- package/shared/redact.mjs +0 -522
- package/shared/secret-rules.mjs +0 -294
- package/shared/workspace-identity.mjs +0 -334
package/client.ts
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
contextRequestTimeoutMs,
|
|
9
9
|
normalizeContextEntry,
|
|
10
10
|
} from "./shared/recall-core.mjs";
|
|
11
|
-
import { redactPayload } from "./shared/redact.mjs";
|
|
12
11
|
|
|
13
12
|
export type FindResultItem = {
|
|
14
13
|
uri: string;
|
|
@@ -69,8 +68,6 @@ function userSessionUri(sessionId: string): string {
|
|
|
69
68
|
|
|
70
69
|
export type OpenVikingClientOptions = {
|
|
71
70
|
transport?: HttpTransport;
|
|
72
|
-
/** Secret-redaction tier for session messages (`captureRedact`); default "standard". */
|
|
73
|
-
captureRedact?: string;
|
|
74
71
|
headers?: Record<string, string>;
|
|
75
72
|
resourcePackager?: ResourcePackager;
|
|
76
73
|
now?: () => number;
|
|
@@ -254,7 +251,6 @@ export class OpenVikingClient {
|
|
|
254
251
|
private readonly now: () => number;
|
|
255
252
|
private readonly sleep: (ms: number) => Promise<void>;
|
|
256
253
|
private readonly resourcePackager: ResourcePackager;
|
|
257
|
-
private readonly captureRedact: string | undefined;
|
|
258
254
|
|
|
259
255
|
constructor(
|
|
260
256
|
private readonly baseUrl: string,
|
|
@@ -279,7 +275,6 @@ export class OpenVikingClient {
|
|
|
279
275
|
this.now = options.now ?? Date.now;
|
|
280
276
|
this.sleep = options.sleep ?? sleep;
|
|
281
277
|
this.resourcePackager = options.resourcePackager ?? defaultResourcePackager;
|
|
282
|
-
this.captureRedact = options.captureRedact;
|
|
283
278
|
}
|
|
284
279
|
|
|
285
280
|
getDefaultAgentId(): string {
|
|
@@ -792,15 +787,11 @@ export class OpenVikingClient {
|
|
|
792
787
|
},
|
|
793
788
|
actorPeerId,
|
|
794
789
|
);
|
|
795
|
-
// Secrets in the captured text (a `cat .env`, a token in a tool result)
|
|
796
|
-
// are replaced before the message leaves the machine; ids, roles and
|
|
797
|
-
// URIs are left as they are. The caller's parts are not mutated.
|
|
798
|
-
const redacted = redactPayload(body, { tier: this.captureRedact });
|
|
799
790
|
await this.request<{ session_id: string }>(
|
|
800
791
|
`/api/v1/sessions/${encodeURIComponent(sessionId)}/messages`,
|
|
801
792
|
{
|
|
802
793
|
method: "POST",
|
|
803
|
-
body: JSON.stringify(
|
|
794
|
+
body: JSON.stringify(body),
|
|
804
795
|
},
|
|
805
796
|
undefined,
|
|
806
797
|
actorPeerId,
|
package/commands/setup.ts
CHANGED
package/config.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { homedir } from "node:os";
|
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
|
|
4
4
|
import { getEnv } from "./runtime-utils.js";
|
|
5
|
-
import { normalizeRedactTier } from "./shared/redact.mjs";
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Subset of OpenClaw's standard `SecretRef` shape supported by the OpenViking
|
|
@@ -47,12 +46,6 @@ export type MemoryOpenVikingConfig = {
|
|
|
47
46
|
autoCapture?: boolean;
|
|
48
47
|
captureMode?: "semantic" | "keyword";
|
|
49
48
|
captureMaxLength?: number;
|
|
50
|
-
/**
|
|
51
|
-
* Secret redaction applied to every session message before it is sent:
|
|
52
|
-
* "off", "standard" (default) or "strict". `false` means "off"; an unknown
|
|
53
|
-
* tier name means "standard". OPENVIKING_CAPTURE_REDACT outranks this.
|
|
54
|
-
*/
|
|
55
|
-
captureRedact?: "off" | "standard" | "strict" | boolean;
|
|
56
49
|
autoRecall?: boolean;
|
|
57
50
|
/** Outer time budget for the whole server-assembled auto-recall flow. */
|
|
58
51
|
autoRecallTimeoutMs?: number;
|
|
@@ -140,10 +133,8 @@ export type MemoryOpenVikingConfig = {
|
|
|
140
133
|
|
|
141
134
|
/** Runtime config after memoryOpenVikingConfigSchema.parse() has applied defaults. */
|
|
142
135
|
export type ParsedMemoryOpenVikingConfig = Required<
|
|
143
|
-
Omit<MemoryOpenVikingConfig, "agentExperience" | "recallTargetTypes" | "apiKey" | "peer_role"
|
|
136
|
+
Omit<MemoryOpenVikingConfig, "agentExperience" | "recallTargetTypes" | "apiKey" | "peer_role">
|
|
144
137
|
> & {
|
|
145
|
-
/** Always a tier name after parse(). */
|
|
146
|
-
captureRedact: "off" | "standard" | "strict";
|
|
147
138
|
/** parse() resolves SecretRef values, so the runtime shape is always a plain string. */
|
|
148
139
|
apiKey: string;
|
|
149
140
|
/** Runtime uses the canonical name; legacy `person` input normalizes to `sender`. */
|
|
@@ -545,7 +536,6 @@ export const memoryOpenVikingConfigSchema = {
|
|
|
545
536
|
"autoCapture",
|
|
546
537
|
"captureMode",
|
|
547
538
|
"captureMaxLength",
|
|
548
|
-
"captureRedact",
|
|
549
539
|
"autoRecall",
|
|
550
540
|
"autoRecallTimeoutMs",
|
|
551
541
|
"recallCompress",
|
|
@@ -677,12 +667,6 @@ export const memoryOpenVikingConfigSchema = {
|
|
|
677
667
|
200,
|
|
678
668
|
Math.min(200_000, Math.floor(toNumber(cfg.captureMaxLength, DEFAULT_CAPTURE_MAX_LENGTH))),
|
|
679
669
|
),
|
|
680
|
-
// The env var outranks the file, as for every other harness. Never
|
|
681
|
-
// throws: an unknown tier redacts at the default rather than failing the
|
|
682
|
-
// plugin's config load.
|
|
683
|
-
captureRedact: normalizeRedactTier(
|
|
684
|
-
getEnv("OPENVIKING_CAPTURE_REDACT")?.trim() || cfg.captureRedact,
|
|
685
|
-
) as "off" | "standard" | "strict",
|
|
686
670
|
autoRecall: cfg.autoRecall !== false,
|
|
687
671
|
autoRecallTimeoutMs: Math.max(
|
|
688
672
|
1000,
|
|
@@ -894,12 +878,6 @@ export const memoryOpenVikingConfigSchema = {
|
|
|
894
878
|
advanced: true,
|
|
895
879
|
help: "Maximum sanitized user text length allowed for auto-capture.",
|
|
896
880
|
},
|
|
897
|
-
captureRedact: {
|
|
898
|
-
label: "Capture Secret Redaction",
|
|
899
|
-
placeholder: "standard",
|
|
900
|
-
advanced: true,
|
|
901
|
-
help: 'Replace secrets (API keys, tokens, private keys) in captured messages with {{ov_redacted:<rule>:<tag>}} before they are sent. "standard" (default), "strict" (adds the generic key=value rule) or "off". Env: OPENVIKING_CAPTURE_REDACT.',
|
|
902
|
-
},
|
|
903
881
|
autoRecall: {
|
|
904
882
|
label: "Auto-Recall",
|
|
905
883
|
help: "Inject relevant OpenViking memories into agent context",
|
package/dist/client.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { defaultHttpTransport } from "./adapters/http-transport.js";
|
|
2
2
|
import { defaultResourcePackager, } from "./adapters/resource-packager.js";
|
|
3
3
|
import { buildContextSearchBody, contextRequestTimeoutMs, normalizeContextEntry, } from "./shared/recall-core.mjs";
|
|
4
|
-
import { redactPayload } from "./shared/redact.mjs";
|
|
5
4
|
function userSessionUri(sessionId) {
|
|
6
5
|
return `viking://~/sessions/${encodeURIComponent(sessionId)}`;
|
|
7
6
|
}
|
|
@@ -22,7 +21,6 @@ export class OpenVikingClient {
|
|
|
22
21
|
now;
|
|
23
22
|
sleep;
|
|
24
23
|
resourcePackager;
|
|
25
|
-
captureRedact;
|
|
26
24
|
constructor(baseUrl, apiKey, defaultAgentId, timeoutMs,
|
|
27
25
|
/** When set, sent so ROOT keys or trusted deployments can select tenant identity. */
|
|
28
26
|
accountId = "", userId = "",
|
|
@@ -43,7 +41,6 @@ export class OpenVikingClient {
|
|
|
43
41
|
this.now = options.now ?? Date.now;
|
|
44
42
|
this.sleep = options.sleep ?? sleep;
|
|
45
43
|
this.resourcePackager = options.resourcePackager ?? defaultResourcePackager;
|
|
46
|
-
this.captureRedact = options.captureRedact;
|
|
47
44
|
}
|
|
48
45
|
getDefaultAgentId() {
|
|
49
46
|
return this.defaultAgentId;
|
|
@@ -385,13 +382,9 @@ export class OpenVikingClient {
|
|
|
385
382
|
partCount: parts.length,
|
|
386
383
|
created_at: createdAt ?? null,
|
|
387
384
|
}, actorPeerId);
|
|
388
|
-
// Secrets in the captured text (a `cat .env`, a token in a tool result)
|
|
389
|
-
// are replaced before the message leaves the machine; ids, roles and
|
|
390
|
-
// URIs are left as they are. The caller's parts are not mutated.
|
|
391
|
-
const redacted = redactPayload(body, { tier: this.captureRedact });
|
|
392
385
|
await this.request(`/api/v1/sessions/${encodeURIComponent(sessionId)}/messages`, {
|
|
393
386
|
method: "POST",
|
|
394
|
-
body: JSON.stringify(
|
|
387
|
+
body: JSON.stringify(body),
|
|
395
388
|
}, undefined, actorPeerId);
|
|
396
389
|
}
|
|
397
390
|
/** GET session — server auto-creates if absent; returns session meta including message stats and token usage. */
|
package/dist/commands/setup.js
CHANGED
package/dist/config.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { homedir } from "node:os";
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
3
|
import { getEnv } from "./runtime-utils.js";
|
|
4
|
-
import { normalizeRedactTier } from "./shared/redact.mjs";
|
|
5
4
|
const DEFAULT_BASE_URL = "http://127.0.0.1:1933";
|
|
6
5
|
const DEFAULT_TARGET_URI = "viking://~/memories";
|
|
7
6
|
const DEFAULT_TIMEOUT_MS = 15000;
|
|
@@ -348,7 +347,6 @@ export const memoryOpenVikingConfigSchema = {
|
|
|
348
347
|
"autoCapture",
|
|
349
348
|
"captureMode",
|
|
350
349
|
"captureMaxLength",
|
|
351
|
-
"captureRedact",
|
|
352
350
|
"autoRecall",
|
|
353
351
|
"autoRecallTimeoutMs",
|
|
354
352
|
"recallCompress",
|
|
@@ -446,10 +444,6 @@ export const memoryOpenVikingConfigSchema = {
|
|
|
446
444
|
autoCapture: cfg.autoCapture !== false,
|
|
447
445
|
captureMode: captureMode ?? DEFAULT_CAPTURE_MODE,
|
|
448
446
|
captureMaxLength: Math.max(200, Math.min(200_000, Math.floor(toNumber(cfg.captureMaxLength, DEFAULT_CAPTURE_MAX_LENGTH)))),
|
|
449
|
-
// The env var outranks the file, as for every other harness. Never
|
|
450
|
-
// throws: an unknown tier redacts at the default rather than failing the
|
|
451
|
-
// plugin's config load.
|
|
452
|
-
captureRedact: normalizeRedactTier(getEnv("OPENVIKING_CAPTURE_REDACT")?.trim() || cfg.captureRedact),
|
|
453
447
|
autoRecall: cfg.autoRecall !== false,
|
|
454
448
|
autoRecallTimeoutMs: Math.max(1000, Math.min(300_000, Math.floor(toNumber(cfg.autoRecallTimeoutMs, DEFAULT_AUTO_RECALL_TIMEOUT_MS)))),
|
|
455
449
|
recallResources,
|
|
@@ -573,12 +567,6 @@ export const memoryOpenVikingConfigSchema = {
|
|
|
573
567
|
advanced: true,
|
|
574
568
|
help: "Maximum sanitized user text length allowed for auto-capture.",
|
|
575
569
|
},
|
|
576
|
-
captureRedact: {
|
|
577
|
-
label: "Capture Secret Redaction",
|
|
578
|
-
placeholder: "standard",
|
|
579
|
-
advanced: true,
|
|
580
|
-
help: 'Replace secrets (API keys, tokens, private keys) in captured messages with {{ov_redacted:<rule>:<tag>}} before they are sent. "standard" (default), "strict" (adds the generic key=value rule) or "off". Env: OPENVIKING_CAPTURE_REDACT.',
|
|
581
|
-
},
|
|
582
570
|
autoRecall: {
|
|
583
571
|
label: "Auto-Recall",
|
|
584
572
|
help: "Inject relevant OpenViking memories into agent context",
|
|
@@ -22,7 +22,6 @@ export function createOpenVikingClientRuntime(options) {
|
|
|
22
22
|
: undefined;
|
|
23
23
|
const clientPromise = Promise.resolve(new OpenVikingClient(cfg.baseUrl, cfg.apiKey, cfg.peer_prefix, cfg.timeoutMs, cfg.accountId, cfg.userId, routingDebugLog, {
|
|
24
24
|
transport: options.transport,
|
|
25
|
-
captureRedact: cfg.captureRedact,
|
|
26
25
|
headers: resolveOpenVikingRequestHeaders({
|
|
27
26
|
headers: cfg.headers,
|
|
28
27
|
}),
|
package/install-manifest.json
CHANGED
package/openclaw.plugin.json
CHANGED
|
@@ -138,12 +138,6 @@
|
|
|
138
138
|
"advanced": true,
|
|
139
139
|
"help": "Maximum sanitized user text length allowed for auto-capture"
|
|
140
140
|
},
|
|
141
|
-
"captureRedact": {
|
|
142
|
-
"label": "Capture Secret Redaction",
|
|
143
|
-
"placeholder": "standard",
|
|
144
|
-
"advanced": true,
|
|
145
|
-
"help": "Replace secrets in captured messages with {{ov_redacted:<rule>:<tag>}} before they are sent: standard (default), strict (adds the generic key=value rule) or off. Env: OPENVIKING_CAPTURE_REDACT"
|
|
146
|
-
},
|
|
147
141
|
"autoRecall": {
|
|
148
142
|
"label": "Auto-Recall",
|
|
149
143
|
"help": "Inject relevant OpenViking memories into agent context"
|
|
@@ -375,14 +369,6 @@
|
|
|
375
369
|
"captureMaxLength": {
|
|
376
370
|
"type": "number"
|
|
377
371
|
},
|
|
378
|
-
"captureRedact": {
|
|
379
|
-
"oneOf": [
|
|
380
|
-
{ "type": "string" },
|
|
381
|
-
{ "type": "boolean" }
|
|
382
|
-
],
|
|
383
|
-
"default": "standard",
|
|
384
|
-
"description": "Secret redaction for captured session messages: off, standard (default) or strict. false means off; any other unknown value means standard (left to the plugin, so a newer tier name never fails the config). OPENVIKING_CAPTURE_REDACT outranks this."
|
|
385
|
-
},
|
|
386
372
|
"autoRecall": {
|
|
387
373
|
"type": "boolean"
|
|
388
374
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openviking/openclaw-plugin",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.26",
|
|
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",
|
|
@@ -16,8 +16,6 @@ type ClientRuntimeConfig = {
|
|
|
16
16
|
userId?: string;
|
|
17
17
|
headers?: Record<string, string>;
|
|
18
18
|
logFindRequests: boolean;
|
|
19
|
-
/** Secret-redaction tier for session messages; the client defaults to "standard". */
|
|
20
|
-
captureRedact?: string;
|
|
21
19
|
};
|
|
22
20
|
|
|
23
21
|
export function createOpenVikingClientRuntime(options: {
|
|
@@ -67,7 +65,6 @@ export function createOpenVikingClientRuntime(options: {
|
|
|
67
65
|
routingDebugLog,
|
|
68
66
|
{
|
|
69
67
|
transport: options.transport,
|
|
70
|
-
captureRedact: cfg.captureRedact,
|
|
71
68
|
headers: resolveOpenVikingRequestHeaders({
|
|
72
69
|
headers: cfg.headers,
|
|
73
70
|
}),
|