@xdarkicex/openclaw-memory-libravdb 1.8.7 → 1.8.8
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
CHANGED
|
@@ -1628,10 +1628,14 @@ export function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
1628
1628
|
}
|
|
1629
1629
|
async function injectContinuityContext(params) {
|
|
1630
1630
|
try {
|
|
1631
|
+
// Use a natural-language query that semantically matches the
|
|
1632
|
+
// pointer record text ("Previous session continuity — ...").
|
|
1633
|
+
// Fetch enough results so the exact ID match isn't crowded out
|
|
1634
|
+
// by stronger semantic hits in the user collection.
|
|
1631
1635
|
const continuityHits = await params.client.searchTextCollections({
|
|
1632
1636
|
collections: [resolveUserCollection(params.userId)],
|
|
1633
|
-
text: "
|
|
1634
|
-
k:
|
|
1637
|
+
text: "previous session context continuity",
|
|
1638
|
+
k: 8,
|
|
1635
1639
|
excludeByCollection: {},
|
|
1636
1640
|
});
|
|
1637
1641
|
const continuityHit = continuityHits.results?.find((r) => r.id === "__session_continuity__");
|
package/dist/index.js
CHANGED
|
@@ -28148,8 +28148,8 @@ function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
28148
28148
|
try {
|
|
28149
28149
|
const continuityHits = await params.client.searchTextCollections({
|
|
28150
28150
|
collections: [resolveUserCollection(params.userId)],
|
|
28151
|
-
text: "
|
|
28152
|
-
k:
|
|
28151
|
+
text: "previous session context continuity",
|
|
28152
|
+
k: 8,
|
|
28153
28153
|
excludeByCollection: {}
|
|
28154
28154
|
});
|
|
28155
28155
|
const continuityHit = continuityHits.results?.find(
|
|
@@ -36120,7 +36120,7 @@ function createMemoryDescribeTool(getClient, getSessionId = () => void 0, logger
|
|
|
36120
36120
|
}
|
|
36121
36121
|
};
|
|
36122
36122
|
}
|
|
36123
|
-
function createMemoryExpandTool(getClient, getSessionKey, logger = console) {
|
|
36123
|
+
function createMemoryExpandTool(getClient, getSessionKey, logger = console, getSessionId = () => void 0) {
|
|
36124
36124
|
return {
|
|
36125
36125
|
name: "memory_expand",
|
|
36126
36126
|
label: "Memory Expand",
|
|
@@ -36133,7 +36133,7 @@ function createMemoryExpandTool(getClient, getSessionKey, logger = console) {
|
|
|
36133
36133
|
if (summaryIds.length === 0) throw new Error("memory_expand requires at least one summaryId");
|
|
36134
36134
|
const maxDepth = readNum(params, "maxDepth", { integer: true, min: 0 }) ?? 1;
|
|
36135
36135
|
let maxTokens = readNum(params, "maxTokens", { integer: true }) ?? MAX_EXPAND_TOKENS;
|
|
36136
|
-
const sessionId = readStr(params, "sessionId") ?? "";
|
|
36136
|
+
const sessionId = readStr(params, "sessionId") ?? getSessionId() ?? "";
|
|
36137
36137
|
const sessionKey = getSessionKey();
|
|
36138
36138
|
if (sessionKey) {
|
|
36139
36139
|
const grantedTokens = consumeSubagentBudget(sessionKey, maxTokens);
|
|
@@ -40017,7 +40017,8 @@ function register(api) {
|
|
|
40017
40017
|
api.registerTool?.((ctx) => {
|
|
40018
40018
|
const getClient = runtimeOrNull.getClient;
|
|
40019
40019
|
const getSessionKey = () => ctx.sessionKey;
|
|
40020
|
-
|
|
40020
|
+
const getSessionId = () => ctx.sessionId;
|
|
40021
|
+
return createMemoryExpandTool(getClient, getSessionKey, logger, getSessionId);
|
|
40021
40022
|
}, { names: ["memory_expand"] });
|
|
40022
40023
|
api.registerTool?.((ctx) => {
|
|
40023
40024
|
const getClient = runtimeOrNull.getClient;
|
|
@@ -67,7 +67,7 @@ export declare function createMemoryDescribeTool(getClient: ClientGetter, getSes
|
|
|
67
67
|
};
|
|
68
68
|
execute: (_toolCallId: string, rawParams: unknown) => Promise<ToolResult<MemoryDescribeDetails>>;
|
|
69
69
|
};
|
|
70
|
-
export declare function createMemoryExpandTool(getClient: ClientGetter, getSessionKey: () => string | undefined, logger?: LoggerLike): {
|
|
70
|
+
export declare function createMemoryExpandTool(getClient: ClientGetter, getSessionKey: () => string | undefined, logger?: LoggerLike, getSessionId?: () => string | undefined): {
|
|
71
71
|
name: string;
|
|
72
72
|
label: string;
|
|
73
73
|
description: string;
|
|
@@ -187,7 +187,7 @@ export function createMemoryDescribeTool(getClient, getSessionId = () => undefin
|
|
|
187
187
|
},
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
-
export function createMemoryExpandTool(getClient, getSessionKey, logger = console) {
|
|
190
|
+
export function createMemoryExpandTool(getClient, getSessionKey, logger = console, getSessionId = () => undefined) {
|
|
191
191
|
return {
|
|
192
192
|
name: "memory_expand",
|
|
193
193
|
label: "Memory Expand",
|
|
@@ -204,7 +204,7 @@ export function createMemoryExpandTool(getClient, getSessionKey, logger = consol
|
|
|
204
204
|
throw new Error("memory_expand requires at least one summaryId");
|
|
205
205
|
const maxDepth = readNum(params, "maxDepth", { integer: true, min: 0 }) ?? 1;
|
|
206
206
|
let maxTokens = readNum(params, "maxTokens", { integer: true }) ?? MAX_EXPAND_TOKENS;
|
|
207
|
-
const sessionId = readStr(params, "sessionId") ?? "";
|
|
207
|
+
const sessionId = readStr(params, "sessionId") ?? getSessionId() ?? "";
|
|
208
208
|
// Subagent budget gate: if this is a subagent, check remaining expansion budget.
|
|
209
209
|
const sessionKey = getSessionKey();
|
|
210
210
|
if (sessionKey) {
|
package/openclaw.plugin.json
CHANGED