@xdarkicex/openclaw-memory-libravdb 1.6.15 → 1.6.16
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/README.md +13 -0
- package/dist/context-engine.d.ts +1 -0
- package/dist/context-engine.js +11 -1
- package/dist/index.js +9 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,6 +33,19 @@ brew install libravdbd
|
|
|
33
33
|
brew services start libravdbd
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
> **After upgrades:** Always restart the daemon so the newly installed binary takes effect:
|
|
37
|
+
> ```bash
|
|
38
|
+
> # macOS (Homebrew)
|
|
39
|
+
> brew services restart libravdbd
|
|
40
|
+
>
|
|
41
|
+
> # Linux (systemd)
|
|
42
|
+
> systemctl --user restart libravdbd
|
|
43
|
+
>
|
|
44
|
+
> # Linux (no systemd — kill and restart manually)
|
|
45
|
+
> killall libravdbd && libravdbd &
|
|
46
|
+
> ```
|
|
47
|
+
> Failing to restart leaves the old process running — it will not auto-replace a live background service. If you see "Protocol error" or connection failures after an upgrade, this is almost always the cause.
|
|
48
|
+
|
|
36
49
|
**Linux (APT)**
|
|
37
50
|
|
|
38
51
|
```bash
|
package/dist/context-engine.d.ts
CHANGED
|
@@ -99,5 +99,6 @@ export declare function buildContextEngineFactory(runtime: PluginRuntime, cfg: P
|
|
|
99
99
|
tokenBudget?: number;
|
|
100
100
|
runtimeContext?: Record<string, unknown>;
|
|
101
101
|
}): Promise<import("@xdarkicex/libravdb-contracts").AfterTurnKernelResponse>;
|
|
102
|
+
dispose(): Promise<void>;
|
|
102
103
|
};
|
|
103
104
|
export {};
|
package/dist/context-engine.js
CHANGED
|
@@ -521,6 +521,7 @@ export function normalizeAssembleResult(result) {
|
|
|
521
521
|
}
|
|
522
522
|
export function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
523
523
|
const predictiveContextCache = new Map();
|
|
524
|
+
const PREDICTIVE_CACHE_MAX_SIZE = 100;
|
|
524
525
|
let cachedIdentity = null;
|
|
525
526
|
let cachedSessionKey;
|
|
526
527
|
function resolveUserId(args) {
|
|
@@ -743,6 +744,7 @@ export function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
743
744
|
ownsCompaction: true,
|
|
744
745
|
async bootstrap(args) {
|
|
745
746
|
const sessionId = requireSessionId(args.sessionId, "bootstrap");
|
|
747
|
+
predictiveContextCache.delete(sessionId);
|
|
746
748
|
const userId = resolveUserId({
|
|
747
749
|
userIdOverride: args.userId,
|
|
748
750
|
sessionKey: args.sessionKey,
|
|
@@ -925,6 +927,11 @@ export function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
925
927
|
});
|
|
926
928
|
const predictions = result.predictions;
|
|
927
929
|
if (Array.isArray(predictions) && predictions.length > 0) {
|
|
930
|
+
if (predictiveContextCache.size >= PREDICTIVE_CACHE_MAX_SIZE) {
|
|
931
|
+
const oldest = predictiveContextCache.keys().next().value;
|
|
932
|
+
if (oldest !== undefined)
|
|
933
|
+
predictiveContextCache.delete(oldest);
|
|
934
|
+
}
|
|
928
935
|
predictiveContextCache.set(sessionId, predictions);
|
|
929
936
|
}
|
|
930
937
|
return result;
|
|
@@ -934,6 +941,9 @@ export function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
934
941
|
`${error instanceof Error ? error.message : String(error)}`);
|
|
935
942
|
throw error;
|
|
936
943
|
}
|
|
937
|
-
}
|
|
944
|
+
},
|
|
945
|
+
async dispose() {
|
|
946
|
+
predictiveContextCache.clear();
|
|
947
|
+
},
|
|
938
948
|
};
|
|
939
949
|
}
|
package/dist/index.js
CHANGED
|
@@ -27036,6 +27036,7 @@ function normalizeAssembleResult(result) {
|
|
|
27036
27036
|
}
|
|
27037
27037
|
function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
27038
27038
|
const predictiveContextCache = /* @__PURE__ */ new Map();
|
|
27039
|
+
const PREDICTIVE_CACHE_MAX_SIZE = 100;
|
|
27039
27040
|
let cachedIdentity = null;
|
|
27040
27041
|
let cachedSessionKey;
|
|
27041
27042
|
function resolveUserId(args) {
|
|
@@ -27245,6 +27246,7 @@ function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
27245
27246
|
ownsCompaction: true,
|
|
27246
27247
|
async bootstrap(args) {
|
|
27247
27248
|
const sessionId = requireSessionId(args.sessionId, "bootstrap");
|
|
27249
|
+
predictiveContextCache.delete(sessionId);
|
|
27248
27250
|
const userId = resolveUserId({
|
|
27249
27251
|
userIdOverride: args.userId,
|
|
27250
27252
|
sessionKey: args.sessionKey
|
|
@@ -27438,6 +27440,10 @@ function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
27438
27440
|
});
|
|
27439
27441
|
const predictions = result.predictions;
|
|
27440
27442
|
if (Array.isArray(predictions) && predictions.length > 0) {
|
|
27443
|
+
if (predictiveContextCache.size >= PREDICTIVE_CACHE_MAX_SIZE) {
|
|
27444
|
+
const oldest = predictiveContextCache.keys().next().value;
|
|
27445
|
+
if (oldest !== void 0) predictiveContextCache.delete(oldest);
|
|
27446
|
+
}
|
|
27441
27447
|
predictiveContextCache.set(sessionId, predictions);
|
|
27442
27448
|
}
|
|
27443
27449
|
return result;
|
|
@@ -27447,6 +27453,9 @@ function buildContextEngineFactory(runtime, cfg, logger = console) {
|
|
|
27447
27453
|
);
|
|
27448
27454
|
throw error2;
|
|
27449
27455
|
}
|
|
27456
|
+
},
|
|
27457
|
+
async dispose() {
|
|
27458
|
+
predictiveContextCache.clear();
|
|
27450
27459
|
}
|
|
27451
27460
|
};
|
|
27452
27461
|
}
|
package/openclaw.plugin.json
CHANGED