@xdarkicex/openclaw-memory-libravdb 1.6.12 → 1.6.13

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.
@@ -2,6 +2,7 @@ import { resolveIdentity } from "./identity.js";
2
2
  import { resolveUserCollection } from "./memory-scopes.js";
3
3
  const APPROX_CHARS_PER_TOKEN = 4;
4
4
  const ASSEMBLE_BUDGET_HEADROOM_TOKENS = 256;
5
+ const ASSEMBLE_BUDGET_HEADROOM_FRACTION = 0.2;
5
6
  const DEFAULT_COMPACTION_THRESHOLD_FRACTION = 0.8;
6
7
  const STRUCTURED_MARKER_RE = /\b[A-Z][A-Z0-9]*(?:_[A-Z0-9]+){2,}_\d{6,}\b/g;
7
8
  const DISTINCTIVE_IDENTIFIER_RE = /\b([A-Za-z][A-Za-z0-9]*(?:[_-][A-Za-z0-9]+){1,})\b/g;
@@ -138,7 +139,9 @@ function normalizeTokenBudget(tokenBudget) {
138
139
  }
139
140
  function resolveEffectiveAssembleBudget(tokenBudget) {
140
141
  const normalized = normalizeTokenBudget(tokenBudget) ?? 1;
141
- return Math.max(1, normalized - ASSEMBLE_BUDGET_HEADROOM_TOKENS);
142
+ const proportionalHeadroom = Math.max(1, Math.floor(normalized * ASSEMBLE_BUDGET_HEADROOM_FRACTION));
143
+ const headroom = Math.min(ASSEMBLE_BUDGET_HEADROOM_TOKENS, proportionalHeadroom);
144
+ return Math.max(1, normalized - headroom);
142
145
  }
143
146
  function normalizeThresholdFraction(fraction) {
144
147
  if (typeof fraction !== "number" || !Number.isFinite(fraction)) {
package/dist/index.js CHANGED
@@ -26504,6 +26504,7 @@ function resolveCliMemoryOperationScope(opts) {
26504
26504
  // src/context-engine.ts
26505
26505
  var APPROX_CHARS_PER_TOKEN = 4;
26506
26506
  var ASSEMBLE_BUDGET_HEADROOM_TOKENS = 256;
26507
+ var ASSEMBLE_BUDGET_HEADROOM_FRACTION = 0.2;
26507
26508
  var DEFAULT_COMPACTION_THRESHOLD_FRACTION = 0.8;
26508
26509
  var STRUCTURED_MARKER_RE = /\b[A-Z][A-Z0-9]*(?:_[A-Z0-9]+){2,}_\d{6,}\b/g;
26509
26510
  var DISTINCTIVE_IDENTIFIER_RE = /\b([A-Za-z][A-Za-z0-9]*(?:[_-][A-Za-z0-9]+){1,})\b/g;
@@ -26656,7 +26657,9 @@ function normalizeTokenBudget(tokenBudget) {
26656
26657
  }
26657
26658
  function resolveEffectiveAssembleBudget(tokenBudget) {
26658
26659
  const normalized = normalizeTokenBudget(tokenBudget) ?? 1;
26659
- return Math.max(1, normalized - ASSEMBLE_BUDGET_HEADROOM_TOKENS);
26660
+ const proportionalHeadroom = Math.max(1, Math.floor(normalized * ASSEMBLE_BUDGET_HEADROOM_FRACTION));
26661
+ const headroom = Math.min(ASSEMBLE_BUDGET_HEADROOM_TOKENS, proportionalHeadroom);
26662
+ return Math.max(1, normalized - headroom);
26660
26663
  }
26661
26664
  function normalizeThresholdFraction(fraction) {
26662
26665
  if (typeof fraction !== "number" || !Number.isFinite(fraction)) {
@@ -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.12",
5
+ "version": "1.6.13",
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.12",
3
+ "version": "1.6.13",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",