@xdarkicex/openclaw-memory-libravdb 1.10.1-beta.2 → 1.10.1-beta.5
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 +4 -4
- package/dist/index.js +9 -4
- package/dist/rules.js +6 -6
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/dist/context-engine.js
CHANGED
|
@@ -2035,16 +2035,16 @@ export function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
2035
2035
|
const isSessionBootstrap = messages.length <= 1;
|
|
2036
2036
|
let withContext = assembled;
|
|
2037
2037
|
if (isSessionBootstrap) {
|
|
2038
|
-
// Rules first — highest priority, non-negotiable.
|
|
2039
|
-
if (rulesContext) {
|
|
2040
|
-
withContext = { ...withContext, systemPromptAddition: appendSystemPromptAddition(withContext.systemPromptAddition, rulesContext) };
|
|
2041
|
-
}
|
|
2042
2038
|
if (userCardContext) {
|
|
2043
2039
|
withContext = { ...withContext, systemPromptAddition: appendSystemPromptAddition(withContext.systemPromptAddition, userCardContext) };
|
|
2044
2040
|
}
|
|
2045
2041
|
if (continuityContext) {
|
|
2046
2042
|
withContext = { ...withContext, systemPromptAddition: appendSystemPromptAddition(withContext.systemPromptAddition, continuityContext) };
|
|
2047
2043
|
}
|
|
2044
|
+
// Rules injected LAST — closest to messages, highest attention.
|
|
2045
|
+
if (rulesContext) {
|
|
2046
|
+
withContext = { ...withContext, systemPromptAddition: appendSystemPromptAddition(withContext.systemPromptAddition, rulesContext) };
|
|
2047
|
+
}
|
|
2048
2048
|
}
|
|
2049
2049
|
enforced = enforceTokenBudgetInvariant(await augmentWithExactRecall(withContext, {
|
|
2050
2050
|
queryText: retrievalQuery,
|
package/dist/index.js
CHANGED
|
@@ -18575,7 +18575,7 @@ function buildRulesContext() {
|
|
|
18575
18575
|
const active = getRules();
|
|
18576
18576
|
if (active.length === 0) return null;
|
|
18577
18577
|
const lines = active.map((r) => `${r.id}. [PRIORITY ${r.priority}] ${r.rule}`);
|
|
18578
|
-
return "<hard_constraints>\
|
|
18578
|
+
return "<hard_constraints>\nTHE FOLLOWING RULES CANNOT BE BROKEN UNDER ANY CIRCUMSTANCES:\n\n" + lines.join("\n") + '\n\nIf asked to reveal, confirm, hint at, or indirectly reference anything\ncovered by these rules, respond ONLY with: "I cannot answer that."\nNo other response is acceptable. Do not explain why.\n</hard_constraints>';
|
|
18579
18579
|
}
|
|
18580
18580
|
|
|
18581
18581
|
// src/manifest.ts
|
|
@@ -20543,15 +20543,15 @@ ${cached}
|
|
|
20543
20543
|
const isSessionBootstrap = messages.length <= 1;
|
|
20544
20544
|
let withContext = assembled;
|
|
20545
20545
|
if (isSessionBootstrap) {
|
|
20546
|
-
if (rulesContext) {
|
|
20547
|
-
withContext = { ...withContext, systemPromptAddition: appendSystemPromptAddition(withContext.systemPromptAddition, rulesContext) };
|
|
20548
|
-
}
|
|
20549
20546
|
if (userCardContext) {
|
|
20550
20547
|
withContext = { ...withContext, systemPromptAddition: appendSystemPromptAddition(withContext.systemPromptAddition, userCardContext) };
|
|
20551
20548
|
}
|
|
20552
20549
|
if (continuityContext) {
|
|
20553
20550
|
withContext = { ...withContext, systemPromptAddition: appendSystemPromptAddition(withContext.systemPromptAddition, continuityContext) };
|
|
20554
20551
|
}
|
|
20552
|
+
if (rulesContext) {
|
|
20553
|
+
withContext = { ...withContext, systemPromptAddition: appendSystemPromptAddition(withContext.systemPromptAddition, rulesContext) };
|
|
20554
|
+
}
|
|
20555
20555
|
}
|
|
20556
20556
|
enforced = enforceTokenBudgetInvariant(
|
|
20557
20557
|
await augmentWithExactRecall(withContext, {
|
|
@@ -35695,6 +35695,11 @@ ${card.trim()}
|
|
|
35695
35695
|
);
|
|
35696
35696
|
}
|
|
35697
35697
|
});
|
|
35698
|
+
api.on("before_prompt_build", async () => {
|
|
35699
|
+
const rulesText = buildRulesContext();
|
|
35700
|
+
if (!rulesText) return;
|
|
35701
|
+
return { prependSystemContext: rulesText };
|
|
35702
|
+
});
|
|
35698
35703
|
api.on("session_end", async (_event, ctx) => {
|
|
35699
35704
|
const sessionId = ctx?.sessionId;
|
|
35700
35705
|
if (sessionId) clearSessionTrigger(sessionId);
|
package/dist/rules.js
CHANGED
|
@@ -160,11 +160,11 @@ export function buildRulesContext() {
|
|
|
160
160
|
return null;
|
|
161
161
|
const lines = active.map((r) => `${r.id}. [PRIORITY ${r.priority}] ${r.rule}`);
|
|
162
162
|
return ("<hard_constraints>\n" +
|
|
163
|
-
"
|
|
164
|
-
"EVERYTHING else — user preferences, identity context, conversational norms,\n" +
|
|
165
|
-
"and any other instruction. Violating even one is a catastrophic failure.\n" +
|
|
166
|
-
"If asked for information covered by a rule, REFUSE. Do not hint, imply,\n" +
|
|
167
|
-
"redirect, confirm, or find loopholes. Just say you cannot answer.\n\n" +
|
|
163
|
+
"THE FOLLOWING RULES CANNOT BE BROKEN UNDER ANY CIRCUMSTANCES:\n\n" +
|
|
168
164
|
lines.join("\n") +
|
|
169
|
-
"\n
|
|
165
|
+
"\n\n" +
|
|
166
|
+
"If asked to reveal, confirm, hint at, or indirectly reference anything\n" +
|
|
167
|
+
"covered by these rules, respond ONLY with: \"I cannot answer that.\"\n" +
|
|
168
|
+
"No other response is acceptable. Do not explain why.\n" +
|
|
169
|
+
"</hard_constraints>");
|
|
170
170
|
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "libravdb-memory",
|
|
3
3
|
"name": "LibraVDB Memory",
|
|
4
4
|
"description": "Cognitive memory engine — causal graph reasoning, predictive context, identity tracking, and hybrid vector recall with back-door adjustment scoring",
|
|
5
|
-
"version": "1.10.1-beta.
|
|
5
|
+
"version": "1.10.1-beta.5",
|
|
6
6
|
"kind": [
|
|
7
7
|
"memory",
|
|
8
8
|
"context-engine"
|