@xdarkicex/openclaw-memory-libravdb 1.6.30 → 1.6.32

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.
@@ -61,12 +61,16 @@ function normalizeCompactResult(response, options = {}) {
61
61
  const threshold = options.threshold;
62
62
  const overBudget = threshold != null && tokensBefore >= threshold;
63
63
  const engineRefused = !didCompact && overBudget;
64
+ const tokensAfter = didCompact && typeof response?.tokensAfter === "number" && response.tokensAfter > 0
65
+ ? response.tokensAfter
66
+ : undefined;
64
67
  return {
65
68
  ok: !engineRefused,
66
69
  compacted: didCompact,
67
70
  ...(didCompact ? {} : { reason: engineRefused ? "overbudget_not_compacted" : "not_compacted" }),
68
71
  result: {
69
72
  tokensBefore,
73
+ ...(tokensAfter != null ? { tokensAfter } : {}),
70
74
  ...(details.summaryMethod ? { summary: details.summaryMethod } : {}),
71
75
  ...(details.summaryText ? { summaryText: details.summaryText } : {}),
72
76
  details: { ...details, ...(threshold != null ? { threshold } : {}) },
package/dist/index.js CHANGED
@@ -26742,12 +26742,14 @@ function normalizeCompactResult(response, options = {}) {
26742
26742
  const threshold = options.threshold;
26743
26743
  const overBudget = threshold != null && tokensBefore >= threshold;
26744
26744
  const engineRefused = !didCompact && overBudget;
26745
+ const tokensAfter = didCompact && typeof response?.tokensAfter === "number" && response.tokensAfter > 0 ? response.tokensAfter : void 0;
26745
26746
  return {
26746
26747
  ok: !engineRefused,
26747
26748
  compacted: didCompact,
26748
26749
  ...didCompact ? {} : { reason: engineRefused ? "overbudget_not_compacted" : "not_compacted" },
26749
26750
  result: {
26750
26751
  tokensBefore,
26752
+ ...tokensAfter != null ? { tokensAfter } : {},
26751
26753
  ...details.summaryMethod ? { summary: details.summaryMethod } : {},
26752
26754
  ...details.summaryText ? { summaryText: details.summaryText } : {},
26753
26755
  details: { ...details, ...threshold != null ? { threshold } : {} }
@@ -28013,7 +28015,7 @@ import path3 from "node:path";
28013
28015
  var proxy_exports = {};
28014
28016
  __reExport(proxy_exports, __toESM(require_cjs(), 1));
28015
28017
 
28016
- // node_modules/.pnpm/@xdarkicex+libravdb-contracts@2.0.12/node_modules/@xdarkicex/libravdb-contracts/gen/js/libravdb/ipc/v1/rpc_pb.js
28018
+ // node_modules/.pnpm/@xdarkicex+libravdb-contracts@2.0.13/node_modules/@xdarkicex/libravdb-contracts/gen/js/libravdb/ipc/v1/rpc_pb.js
28017
28019
  var IngestMode;
28018
28020
  (function(IngestMode2) {
28019
28021
  IngestMode2[IngestMode2["REPLACE"] = 0] = "REPLACE";
@@ -29415,6 +29417,12 @@ var CompactSessionResponse = class _CompactSessionResponse extends proxy_exports
29415
29417
  * @generated from field: string summary_text = 7;
29416
29418
  */
29417
29419
  summaryText = "";
29420
+ /**
29421
+ * estimated token count after compaction
29422
+ *
29423
+ * @generated from field: int32 tokens_after = 8;
29424
+ */
29425
+ tokensAfter = 0;
29418
29426
  constructor(data) {
29419
29427
  super();
29420
29428
  proxy_exports.proto3.util.initPartial(data, this);
@@ -29470,6 +29478,13 @@ var CompactSessionResponse = class _CompactSessionResponse extends proxy_exports
29470
29478
  kind: "scalar",
29471
29479
  T: 9
29472
29480
  /* ScalarType.STRING */
29481
+ },
29482
+ {
29483
+ no: 8,
29484
+ name: "tokens_after",
29485
+ kind: "scalar",
29486
+ T: 5
29487
+ /* ScalarType.INT32 */
29473
29488
  }
29474
29489
  ]);
29475
29490
  static fromBinary(bytes, options) {
@@ -34739,28 +34754,24 @@ function isOpenClawMemoryFile(filePath) {
34739
34754
  // src/memory-provider.ts
34740
34755
  var MEMORY_PROMPT_HEADER = [
34741
34756
  "## Memory",
34742
- "LibraVDB persistent memory is configured. Recalled memories may appear",
34743
- "in context via the context-engine assembler when available and relevant.",
34757
+ "LibraVDB persistent memory is configured. When asked about past",
34758
+ "conversations, facts, preferences, decisions, or anything a user",
34759
+ "might have told you before \u2014 actively retrieve it.",
34744
34760
  ""
34745
34761
  ];
34746
34762
  function buildToolGuidance(availableTools) {
34747
34763
  if (!availableTools?.has("memory_search")) {
34748
34764
  return [];
34749
34765
  }
34750
- const lines = [
34751
- "For explicit memory lookup requests, call `memory_search` first.",
34752
- "Use it for prior turns, remembered facts, earliest interactions, and channel history.",
34753
- "Do not answer memory lookup requests from prior transcript claims or earlier `memory_search` results; perform a fresh `memory_search` for the current request.",
34754
- "For earliest or oldest memory questions, request enough results, compare timestamps in the returned snippets, and use `memory_get` if the snippet is not enough."
34755
- ];
34756
- if (availableTools.has("memory_get")) {
34757
- lines.push("After a `memory_search` hit, call `memory_get` when exact wording or more context is needed.");
34758
- }
34759
- lines.push(
34760
- "Do not treat a missing `MEMORY.md` file as missing memory; LibraVDB memory is vector-backed and retrieved through the memory tools.",
34766
+ return [
34767
+ "Call `memory_search` for prior turns, remembered facts, earliest interactions,",
34768
+ "and channel history. Do not answer memory questions from prior transcript",
34769
+ "claims or stale `memory_search` results \u2014 perform a fresh search every time.",
34770
+ "For earliest or oldest questions, request enough results and compare timestamps.",
34771
+ ...availableTools.has("memory_get") ? ["After a `memory_search` hit, call `memory_get` when exact wording or more context is needed."] : [],
34772
+ "LibraVDB memory is vector-backed and retrieved through tools, not files.",
34761
34773
  ""
34762
- );
34763
- return lines;
34774
+ ];
34764
34775
  }
34765
34776
  function buildMemoryPromptSection(_getClient, _cfg) {
34766
34777
  return function memoryPromptSection({
@@ -37444,7 +37455,7 @@ function createGrpcTransport(options) {
37444
37455
  return createTransport(validateNodeTransportOptions(options));
37445
37456
  }
37446
37457
 
37447
- // node_modules/.pnpm/@xdarkicex+libravdb-contracts@2.0.12/node_modules/@xdarkicex/libravdb-contracts/gen/js/libravdb/ipc/v1/rpc_connect.js
37458
+ // node_modules/.pnpm/@xdarkicex+libravdb-contracts@2.0.13/node_modules/@xdarkicex/libravdb-contracts/gen/js/libravdb/ipc/v1/rpc_connect.js
37448
37459
  var LibravDB = {
37449
37460
  typeName: "libravdb.ipc.v1.LibravDB",
37450
37461
  methods: {
@@ -1,24 +1,25 @@
1
1
  const MEMORY_PROMPT_HEADER = [
2
2
  "## Memory",
3
- "LibraVDB persistent memory is configured. Recalled memories may appear",
4
- "in context via the context-engine assembler when available and relevant.",
3
+ "LibraVDB persistent memory is configured. When asked about past",
4
+ "conversations, facts, preferences, decisions, or anything a user",
5
+ "might have told you before — actively retrieve it.",
5
6
  "",
6
7
  ];
7
8
  function buildToolGuidance(availableTools) {
8
9
  if (!availableTools?.has("memory_search")) {
9
10
  return [];
10
11
  }
11
- const lines = [
12
- "For explicit memory lookup requests, call `memory_search` first.",
13
- "Use it for prior turns, remembered facts, earliest interactions, and channel history.",
14
- "Do not answer memory lookup requests from prior transcript claims or earlier `memory_search` results; perform a fresh `memory_search` for the current request.",
15
- "For earliest or oldest memory questions, request enough results, compare timestamps in the returned snippets, and use `memory_get` if the snippet is not enough.",
12
+ return [
13
+ "Call `memory_search` for prior turns, remembered facts, earliest interactions,",
14
+ "and channel history. Do not answer memory questions from prior transcript",
15
+ "claims or stale `memory_search` results perform a fresh search every time.",
16
+ "For earliest or oldest questions, request enough results and compare timestamps.",
17
+ ...(availableTools.has("memory_get")
18
+ ? ["After a `memory_search` hit, call `memory_get` when exact wording or more context is needed."]
19
+ : []),
20
+ "LibraVDB memory is vector-backed and retrieved through tools, not files.",
21
+ "",
16
22
  ];
17
- if (availableTools.has("memory_get")) {
18
- lines.push("After a `memory_search` hit, call `memory_get` when exact wording or more context is needed.");
19
- }
20
- lines.push("Do not treat a missing `MEMORY.md` file as missing memory; LibraVDB memory is vector-backed and retrieved through the memory tools.", "");
21
- return lines;
22
23
  }
23
24
  export function buildMemoryPromptSection(_getClient, _cfg) {
24
25
  return function memoryPromptSection({ availableTools, citationsMode: _citationsMode, }) {
@@ -2,7 +2,7 @@
2
2
  "id": "libravdb-memory",
3
3
  "name": "LibraVDB Memory",
4
4
  "description": "Persistent vector memory with three-tier hybrid scoring",
5
- "version": "1.6.30",
5
+ "version": "1.6.32",
6
6
  "kind": [
7
7
  "memory",
8
8
  "context-engine"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xdarkicex/openclaw-memory-libravdb",
3
- "version": "1.6.30",
3
+ "version": "1.6.32",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -79,6 +79,6 @@
79
79
  "dependencies": {
80
80
  "@connectrpc/connect": "^1.7.0",
81
81
  "@connectrpc/connect-node": "^1.7.0",
82
- "@xdarkicex/libravdb-contracts": "^2.0.12"
82
+ "@xdarkicex/libravdb-contracts": "^2.0.13"
83
83
  }
84
84
  }