@openviking/openclaw-plugin 2026.10.15 → 2026.10.20
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.
|
@@ -455,17 +455,21 @@ function looksLikeUnknownField(res) {
|
|
|
455
455
|
const text = JSON.stringify(res?.error ?? res?.result ?? res?.detail ?? "").toLowerCase();
|
|
456
456
|
return text.includes("extra") || text.includes("mode") || text.includes("unexpected");
|
|
457
457
|
}
|
|
458
|
+
// Recalled text is the user's own history. Without a provenance boundary a model
|
|
459
|
+
// may cite an internal decision as external evidence or industry practice.
|
|
460
|
+
export const RECALL_CONTEXT_TEMPLATE = [
|
|
461
|
+
"<openviking-context>",
|
|
462
|
+
"Relevant memory from OpenViking. It is this user's own saved history (past conversations, meetings, notes) as recorded then: internal context, not an external source or established fact. Use the search/read MCP tools to expand URIs.",
|
|
463
|
+
"{context}",
|
|
464
|
+
"</openviking-context>",
|
|
465
|
+
].join("\n");
|
|
458
466
|
function wrapContext(body) {
|
|
459
467
|
// Retrieved text cannot introduce a second capture delimiter inside ours.
|
|
460
468
|
const text = String(body)
|
|
461
469
|
.replace(/<\/?relevant-memor(?:y|ies)\b[^>]*>/gi, "legacy memory wrapper")
|
|
462
470
|
.replace(/<\/?openviking-context\b[^>]*>/gi, "openviking context marker");
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
"Relevant memory from OpenViking. Use the search/read MCP tools to expand URIs.",
|
|
466
|
-
text,
|
|
467
|
-
"</openviking-context>",
|
|
468
|
-
].join("\n");
|
|
471
|
+
// Use a replacer so recalled dollar sequences stay literal.
|
|
472
|
+
return RECALL_CONTEXT_TEMPLATE.replace("{context}", () => text);
|
|
469
473
|
}
|
|
470
474
|
/**
|
|
471
475
|
* Server-assembled context: the context face when the deployment has it, else
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openviking/openclaw-plugin",
|
|
3
|
-
"version": "2026.10.
|
|
3
|
+
"version": "2026.10.20",
|
|
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",
|
package/shared/recall-core.d.mts
CHANGED
|
@@ -85,3 +85,4 @@ export function estimateTokens(text: string): number;
|
|
|
85
85
|
export function isRecallEnabled(cfg?: Record<string, any>): boolean;
|
|
86
86
|
|
|
87
87
|
export function selectRecallContent(result?: { rendered?: string; digest?: string; stats?: Record<string, unknown> }): string;
|
|
88
|
+
export const RECALL_CONTEXT_TEMPLATE: string;
|
package/shared/recall-core.mjs
CHANGED
|
@@ -473,17 +473,22 @@ function looksLikeUnknownField(res) {
|
|
|
473
473
|
return text.includes("extra") || text.includes("mode") || text.includes("unexpected");
|
|
474
474
|
}
|
|
475
475
|
|
|
476
|
+
// Recalled text is the user's own history. Without a provenance boundary a model
|
|
477
|
+
// may cite an internal decision as external evidence or industry practice.
|
|
478
|
+
export const RECALL_CONTEXT_TEMPLATE = [
|
|
479
|
+
"<openviking-context>",
|
|
480
|
+
"Relevant memory from OpenViking. It is this user's own saved history (past conversations, meetings, notes) as recorded then: internal context, not an external source or established fact. Use the search/read MCP tools to expand URIs.",
|
|
481
|
+
"{context}",
|
|
482
|
+
"</openviking-context>",
|
|
483
|
+
].join("\n");
|
|
484
|
+
|
|
476
485
|
function wrapContext(body) {
|
|
477
486
|
// Retrieved text cannot introduce a second capture delimiter inside ours.
|
|
478
487
|
const text = String(body)
|
|
479
488
|
.replace(/<\/?relevant-memor(?:y|ies)\b[^>]*>/gi, "legacy memory wrapper")
|
|
480
489
|
.replace(/<\/?openviking-context\b[^>]*>/gi, "openviking context marker");
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
"Relevant memory from OpenViking. Use the search/read MCP tools to expand URIs.",
|
|
484
|
-
text,
|
|
485
|
-
"</openviking-context>",
|
|
486
|
-
].join("\n");
|
|
490
|
+
// Use a replacer so recalled dollar sequences stay literal.
|
|
491
|
+
return RECALL_CONTEXT_TEMPLATE.replace("{context}", () => text);
|
|
487
492
|
}
|
|
488
493
|
|
|
489
494
|
/**
|