@xdarkicex/openclaw-memory-libravdb 1.9.10-beta.11 → 1.9.10-beta.12
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/dist/context-engine.js +2 -1
- package/dist/index.js +2 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/context-engine.js
CHANGED
|
@@ -16,6 +16,7 @@ const EXACT_RECALL_MAX_TOKENS = 4;
|
|
|
16
16
|
const RESERVED_CURRENT_TURN_TOKENS = 150;
|
|
17
17
|
const AFTER_TURN_INGEST_MAX_TOKENS = 2048;
|
|
18
18
|
const OPENCLAW_LEADING_TIMESTAMP_PREFIX_RE = /^\[[A-Za-z]{3} \d{4}-\d{2}-\d{2} \d{2}:\d{2}[^\]]*\] */;
|
|
19
|
+
const OPENCLAW_CONTEXT_PREFIX_RE = /^\[OpenClaw context: [^\]]*\][\r\n]*/;
|
|
19
20
|
const SELECTED_CONTEXT_HEADER = "Conversation context (untrusted, chronological, selected for current message):";
|
|
20
21
|
const RETRIEVAL_QUERY_MAX_CHARS = 1000;
|
|
21
22
|
const SELECTED_CONTEXT_TURN_RE = /^#\d+\s+[A-Za-z]{3}\s+\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}(?::\d{2})?\s+\S+\s+([^:\n]{1,80}):\s*(.*)$/;
|
|
@@ -208,6 +209,7 @@ function normalizeRetrievalQuery(primaryText, fallbackText = "") {
|
|
|
208
209
|
}
|
|
209
210
|
function normalizeRetrievalCandidate(text) {
|
|
210
211
|
const normalized = text
|
|
212
|
+
.replace(OPENCLAW_CONTEXT_PREFIX_RE, "")
|
|
211
213
|
.replace(OPENCLAW_LEADING_TIMESTAMP_PREFIX_RE, "")
|
|
212
214
|
.replace(/\r\n/g, "\n")
|
|
213
215
|
.trim();
|
|
@@ -1394,7 +1396,6 @@ export function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
1394
1396
|
// Then run the standard metadata envelope stripping.
|
|
1395
1397
|
return stripOpenClawUntrustedMetadataEnvelope(stripped);
|
|
1396
1398
|
}
|
|
1397
|
-
const OPENCLAW_CONTEXT_PREFIX_RE = /^\[OpenClaw context: [^\]]*\][\r\n]*/;
|
|
1398
1399
|
function formatRetrievedMemory(predictions) {
|
|
1399
1400
|
if (!predictions?.length)
|
|
1400
1401
|
return "";
|
package/dist/index.js
CHANGED
|
@@ -35491,6 +35491,7 @@ var EXACT_RECALL_MAX_TOKENS = 4;
|
|
|
35491
35491
|
var RESERVED_CURRENT_TURN_TOKENS = 150;
|
|
35492
35492
|
var AFTER_TURN_INGEST_MAX_TOKENS = 2048;
|
|
35493
35493
|
var OPENCLAW_LEADING_TIMESTAMP_PREFIX_RE = /^\[[A-Za-z]{3} \d{4}-\d{2}-\d{2} \d{2}:\d{2}[^\]]*\] */;
|
|
35494
|
+
var OPENCLAW_CONTEXT_PREFIX_RE = /^\[OpenClaw context: [^\]]*\][\r\n]*/;
|
|
35494
35495
|
var SELECTED_CONTEXT_HEADER = "Conversation context (untrusted, chronological, selected for current message):";
|
|
35495
35496
|
var RETRIEVAL_QUERY_MAX_CHARS = 1e3;
|
|
35496
35497
|
var SELECTED_CONTEXT_TURN_RE = /^#\d+\s+[A-Za-z]{3}\s+\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}(?::\d{2})?\s+\S+\s+([^:\n]{1,80}):\s*(.*)$/;
|
|
@@ -35666,7 +35667,7 @@ function normalizeRetrievalQuery(primaryText, fallbackText = "") {
|
|
|
35666
35667
|
return normalizeRetrievalCandidate(fallbackText);
|
|
35667
35668
|
}
|
|
35668
35669
|
function normalizeRetrievalCandidate(text) {
|
|
35669
|
-
const normalized = text.replace(OPENCLAW_LEADING_TIMESTAMP_PREFIX_RE, "").replace(/\r\n/g, "\n").trim();
|
|
35670
|
+
const normalized = text.replace(OPENCLAW_CONTEXT_PREFIX_RE, "").replace(OPENCLAW_LEADING_TIMESTAMP_PREFIX_RE, "").replace(/\r\n/g, "\n").trim();
|
|
35670
35671
|
if (!normalized) return "";
|
|
35671
35672
|
const selected = extractLatestSelectedContextUtterance(normalized);
|
|
35672
35673
|
const candidate = selected || normalized;
|
|
@@ -36637,7 +36638,6 @@ function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
36637
36638
|
const stripped = text.replace(OPENCLAW_CONTEXT_PREFIX_RE, "").trimStart();
|
|
36638
36639
|
return stripOpenClawUntrustedMetadataEnvelope(stripped);
|
|
36639
36640
|
}
|
|
36640
|
-
const OPENCLAW_CONTEXT_PREFIX_RE = /^\[OpenClaw context: [^\]]*\][\r\n]*/;
|
|
36641
36641
|
function formatRetrievedMemory(predictions) {
|
|
36642
36642
|
if (!predictions?.length) return "";
|
|
36643
36643
|
if (cfg.beforeTurnDebug) {
|
package/openclaw.plugin.json
CHANGED