@xdarkicex/openclaw-memory-libravdb 1.6.20 → 1.6.22

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/index.js CHANGED
@@ -5162,7 +5162,7 @@ var require_create_descriptor_set = __commonJS({
5162
5162
  return `enum ${this.typeName}`;
5163
5163
  },
5164
5164
  getComments() {
5165
- const path4 = this.parent ? [
5165
+ const path5 = this.parent ? [
5166
5166
  ...this.parent.getComments().sourcePath,
5167
5167
  FieldNumber.DescriptorProto_EnumType,
5168
5168
  this.parent.proto.enumType.indexOf(this.proto)
@@ -5170,7 +5170,7 @@ var require_create_descriptor_set = __commonJS({
5170
5170
  FieldNumber.FileDescriptorProto_EnumType,
5171
5171
  this.file.proto.enumType.indexOf(this.proto)
5172
5172
  ];
5173
- return findComments(file.proto.sourceCodeInfo, path4);
5173
+ return findComments(file.proto.sourceCodeInfo, path5);
5174
5174
  },
5175
5175
  getFeatures() {
5176
5176
  var _a2, _b2;
@@ -5201,12 +5201,12 @@ var require_create_descriptor_set = __commonJS({
5201
5201
  return str;
5202
5202
  },
5203
5203
  getComments() {
5204
- const path4 = [
5204
+ const path5 = [
5205
5205
  ...this.parent.getComments().sourcePath,
5206
5206
  FieldNumber.EnumDescriptorProto_Value,
5207
5207
  this.parent.proto.value.indexOf(this.proto)
5208
5208
  ];
5209
- return findComments(file.proto.sourceCodeInfo, path4);
5209
+ return findComments(file.proto.sourceCodeInfo, path5);
5210
5210
  },
5211
5211
  getFeatures() {
5212
5212
  var _a3;
@@ -5237,7 +5237,7 @@ var require_create_descriptor_set = __commonJS({
5237
5237
  return `message ${this.typeName}`;
5238
5238
  },
5239
5239
  getComments() {
5240
- const path4 = this.parent ? [
5240
+ const path5 = this.parent ? [
5241
5241
  ...this.parent.getComments().sourcePath,
5242
5242
  FieldNumber.DescriptorProto_NestedType,
5243
5243
  this.parent.proto.nestedType.indexOf(this.proto)
@@ -5245,7 +5245,7 @@ var require_create_descriptor_set = __commonJS({
5245
5245
  FieldNumber.FileDescriptorProto_MessageType,
5246
5246
  this.file.proto.messageType.indexOf(this.proto)
5247
5247
  ];
5248
- return findComments(file.proto.sourceCodeInfo, path4);
5248
+ return findComments(file.proto.sourceCodeInfo, path5);
5249
5249
  },
5250
5250
  getFeatures() {
5251
5251
  var _a2, _b2;
@@ -5280,11 +5280,11 @@ var require_create_descriptor_set = __commonJS({
5280
5280
  return `service ${this.typeName}`;
5281
5281
  },
5282
5282
  getComments() {
5283
- const path4 = [
5283
+ const path5 = [
5284
5284
  FieldNumber.FileDescriptorProto_Service,
5285
5285
  this.file.proto.service.indexOf(this.proto)
5286
5286
  ];
5287
- return findComments(file.proto.sourceCodeInfo, path4);
5287
+ return findComments(file.proto.sourceCodeInfo, path5);
5288
5288
  },
5289
5289
  getFeatures() {
5290
5290
  var _a2;
@@ -5344,12 +5344,12 @@ var require_create_descriptor_set = __commonJS({
5344
5344
  return `rpc ${parent.typeName}.${name}`;
5345
5345
  },
5346
5346
  getComments() {
5347
- const path4 = [
5347
+ const path5 = [
5348
5348
  ...this.parent.getComments().sourcePath,
5349
5349
  FieldNumber.ServiceDescriptorProto_Method,
5350
5350
  this.parent.proto.method.indexOf(this.proto)
5351
5351
  ];
5352
- return findComments(parent.file.proto.sourceCodeInfo, path4);
5352
+ return findComments(parent.file.proto.sourceCodeInfo, path5);
5353
5353
  },
5354
5354
  getFeatures() {
5355
5355
  var _a2;
@@ -5370,12 +5370,12 @@ var require_create_descriptor_set = __commonJS({
5370
5370
  return `oneof ${parent.typeName}.${this.name}`;
5371
5371
  },
5372
5372
  getComments() {
5373
- const path4 = [
5373
+ const path5 = [
5374
5374
  ...this.parent.getComments().sourcePath,
5375
5375
  FieldNumber.DescriptorProto_OneofDecl,
5376
5376
  this.parent.proto.oneofDecl.indexOf(this.proto)
5377
5377
  ];
5378
- return findComments(parent.file.proto.sourceCodeInfo, path4);
5378
+ return findComments(parent.file.proto.sourceCodeInfo, path5);
5379
5379
  },
5380
5380
  getFeatures() {
5381
5381
  var _a;
@@ -5411,12 +5411,12 @@ var require_create_descriptor_set = __commonJS({
5411
5411
  return `field ${this.parent.typeName}.${this.name}`;
5412
5412
  },
5413
5413
  getComments() {
5414
- const path4 = [
5414
+ const path5 = [
5415
5415
  ...this.parent.getComments().sourcePath,
5416
5416
  FieldNumber.DescriptorProto_Field,
5417
5417
  this.parent.proto.field.indexOf(this.proto)
5418
5418
  ];
5419
- return findComments(file.proto.sourceCodeInfo, path4);
5419
+ return findComments(file.proto.sourceCodeInfo, path5);
5420
5420
  },
5421
5421
  getFeatures() {
5422
5422
  var _a2;
@@ -5493,7 +5493,7 @@ var require_create_descriptor_set = __commonJS({
5493
5493
  return `extension ${this.typeName}`;
5494
5494
  },
5495
5495
  getComments() {
5496
- const path4 = this.parent ? [
5496
+ const path5 = this.parent ? [
5497
5497
  ...this.parent.getComments().sourcePath,
5498
5498
  FieldNumber.DescriptorProto_Extension,
5499
5499
  this.parent.proto.extension.indexOf(proto)
@@ -5501,7 +5501,7 @@ var require_create_descriptor_set = __commonJS({
5501
5501
  FieldNumber.FileDescriptorProto_Extension,
5502
5502
  this.file.proto.extension.indexOf(proto)
5503
5503
  ];
5504
- return findComments(file.proto.sourceCodeInfo, path4);
5504
+ return findComments(file.proto.sourceCodeInfo, path5);
5505
5505
  },
5506
5506
  getFeatures() {
5507
5507
  var _a;
@@ -8624,14 +8624,14 @@ var require_util = __commonJS({
8624
8624
  }
8625
8625
  const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;
8626
8626
  let origin = url.origin != null ? url.origin : `${url.protocol}//${url.hostname}:${port}`;
8627
- let path4 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
8627
+ let path5 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;
8628
8628
  if (origin.endsWith("/")) {
8629
8629
  origin = origin.substring(0, origin.length - 1);
8630
8630
  }
8631
- if (path4 && !path4.startsWith("/")) {
8632
- path4 = `/${path4}`;
8631
+ if (path5 && !path5.startsWith("/")) {
8632
+ path5 = `/${path5}`;
8633
8633
  }
8634
- url = new URL(origin + path4);
8634
+ url = new URL(origin + path5);
8635
8635
  }
8636
8636
  return url;
8637
8637
  }
@@ -10245,20 +10245,20 @@ var require_parseParams = __commonJS({
10245
10245
  var require_basename = __commonJS({
10246
10246
  "node_modules/.pnpm/@fastify+busboy@2.1.1/node_modules/@fastify/busboy/lib/utils/basename.js"(exports, module) {
10247
10247
  "use strict";
10248
- module.exports = function basename(path4) {
10249
- if (typeof path4 !== "string") {
10248
+ module.exports = function basename(path5) {
10249
+ if (typeof path5 !== "string") {
10250
10250
  return "";
10251
10251
  }
10252
- for (var i = path4.length - 1; i >= 0; --i) {
10253
- switch (path4.charCodeAt(i)) {
10252
+ for (var i = path5.length - 1; i >= 0; --i) {
10253
+ switch (path5.charCodeAt(i)) {
10254
10254
  case 47:
10255
10255
  // '/'
10256
10256
  case 92:
10257
- path4 = path4.slice(i + 1);
10258
- return path4 === ".." || path4 === "." ? "" : path4;
10257
+ path5 = path5.slice(i + 1);
10258
+ return path5 === ".." || path5 === "." ? "" : path5;
10259
10259
  }
10260
10260
  }
10261
- return path4 === ".." || path4 === "." ? "" : path4;
10261
+ return path5 === ".." || path5 === "." ? "" : path5;
10262
10262
  };
10263
10263
  }
10264
10264
  });
@@ -13288,7 +13288,7 @@ var require_request = __commonJS({
13288
13288
  }
13289
13289
  var Request = class _Request {
13290
13290
  constructor(origin, {
13291
- path: path4,
13291
+ path: path5,
13292
13292
  method,
13293
13293
  body,
13294
13294
  headers,
@@ -13302,11 +13302,11 @@ var require_request = __commonJS({
13302
13302
  throwOnError,
13303
13303
  expectContinue
13304
13304
  }, handler) {
13305
- if (typeof path4 !== "string") {
13305
+ if (typeof path5 !== "string") {
13306
13306
  throw new InvalidArgumentError("path must be a string");
13307
- } else if (path4[0] !== "/" && !(path4.startsWith("http://") || path4.startsWith("https://")) && method !== "CONNECT") {
13307
+ } else if (path5[0] !== "/" && !(path5.startsWith("http://") || path5.startsWith("https://")) && method !== "CONNECT") {
13308
13308
  throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
13309
- } else if (invalidPathRegex.exec(path4) !== null) {
13309
+ } else if (invalidPathRegex.exec(path5) !== null) {
13310
13310
  throw new InvalidArgumentError("invalid request path");
13311
13311
  }
13312
13312
  if (typeof method !== "string") {
@@ -13369,7 +13369,7 @@ var require_request = __commonJS({
13369
13369
  this.completed = false;
13370
13370
  this.aborted = false;
13371
13371
  this.upgrade = upgrade || null;
13372
- this.path = query ? util.buildURL(path4, query) : path4;
13372
+ this.path = query ? util.buildURL(path5, query) : path5;
13373
13373
  this.origin = origin;
13374
13374
  this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
13375
13375
  this.blocking = blocking == null ? false : blocking;
@@ -14377,9 +14377,9 @@ var require_RedirectHandler = __commonJS({
14377
14377
  return this.handler.onHeaders(statusCode, headers, resume, statusText);
14378
14378
  }
14379
14379
  const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
14380
- const path4 = search ? `${pathname}${search}` : pathname;
14380
+ const path5 = search ? `${pathname}${search}` : pathname;
14381
14381
  this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
14382
- this.opts.path = path4;
14382
+ this.opts.path = path5;
14383
14383
  this.opts.origin = origin;
14384
14384
  this.opts.maxRedirections = 0;
14385
14385
  this.opts.query = null;
@@ -15619,7 +15619,7 @@ var require_client = __commonJS({
15619
15619
  writeH2(client, client[kHTTP2Session], request3);
15620
15620
  return;
15621
15621
  }
15622
- const { body, method, path: path4, host, upgrade, headers, blocking, reset } = request3;
15622
+ const { body, method, path: path5, host, upgrade, headers, blocking, reset } = request3;
15623
15623
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
15624
15624
  if (body && typeof body.read === "function") {
15625
15625
  body.read(0);
@@ -15669,7 +15669,7 @@ var require_client = __commonJS({
15669
15669
  if (blocking) {
15670
15670
  socket[kBlocking] = true;
15671
15671
  }
15672
- let header = `${method} ${path4} HTTP/1.1\r
15672
+ let header = `${method} ${path5} HTTP/1.1\r
15673
15673
  `;
15674
15674
  if (typeof host === "string") {
15675
15675
  header += `host: ${host}\r
@@ -15732,7 +15732,7 @@ upgrade: ${upgrade}\r
15732
15732
  return true;
15733
15733
  }
15734
15734
  function writeH2(client, session, request3) {
15735
- const { body, method, path: path4, host, upgrade, expectContinue, signal, headers: reqHeaders } = request3;
15735
+ const { body, method, path: path5, host, upgrade, expectContinue, signal, headers: reqHeaders } = request3;
15736
15736
  let headers;
15737
15737
  if (typeof reqHeaders === "string") headers = Request[kHTTP2CopyHeaders](reqHeaders.trim());
15738
15738
  else headers = reqHeaders;
@@ -15775,7 +15775,7 @@ upgrade: ${upgrade}\r
15775
15775
  });
15776
15776
  return true;
15777
15777
  }
15778
- headers[HTTP2_HEADER_PATH] = path4;
15778
+ headers[HTTP2_HEADER_PATH] = path5;
15779
15779
  headers[HTTP2_HEADER_SCHEME] = "https";
15780
15780
  const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
15781
15781
  if (body && typeof body.read === "function") {
@@ -18015,20 +18015,20 @@ var require_mock_utils = __commonJS({
18015
18015
  }
18016
18016
  return true;
18017
18017
  }
18018
- function safeUrl(path4) {
18019
- if (typeof path4 !== "string") {
18020
- return path4;
18018
+ function safeUrl(path5) {
18019
+ if (typeof path5 !== "string") {
18020
+ return path5;
18021
18021
  }
18022
- const pathSegments = path4.split("?");
18022
+ const pathSegments = path5.split("?");
18023
18023
  if (pathSegments.length !== 2) {
18024
- return path4;
18024
+ return path5;
18025
18025
  }
18026
18026
  const qp = new URLSearchParams(pathSegments.pop());
18027
18027
  qp.sort();
18028
18028
  return [...pathSegments, qp.toString()].join("?");
18029
18029
  }
18030
- function matchKey(mockDispatch2, { path: path4, method, body, headers }) {
18031
- const pathMatch = matchValue(mockDispatch2.path, path4);
18030
+ function matchKey(mockDispatch2, { path: path5, method, body, headers }) {
18031
+ const pathMatch = matchValue(mockDispatch2.path, path5);
18032
18032
  const methodMatch = matchValue(mockDispatch2.method, method);
18033
18033
  const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true;
18034
18034
  const headersMatch = matchHeaders(mockDispatch2, headers);
@@ -18046,7 +18046,7 @@ var require_mock_utils = __commonJS({
18046
18046
  function getMockDispatch(mockDispatches, key) {
18047
18047
  const basePath = key.query ? buildURL(key.path, key.query) : key.path;
18048
18048
  const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
18049
- let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path4 }) => matchValue(safeUrl(path4), resolvedPath));
18049
+ let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path5 }) => matchValue(safeUrl(path5), resolvedPath));
18050
18050
  if (matchedMockDispatches.length === 0) {
18051
18051
  throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
18052
18052
  }
@@ -18083,9 +18083,9 @@ var require_mock_utils = __commonJS({
18083
18083
  }
18084
18084
  }
18085
18085
  function buildKey(opts) {
18086
- const { path: path4, method, body, headers, query } = opts;
18086
+ const { path: path5, method, body, headers, query } = opts;
18087
18087
  return {
18088
- path: path4,
18088
+ path: path5,
18089
18089
  method,
18090
18090
  body,
18091
18091
  headers,
@@ -18534,10 +18534,10 @@ var require_pending_interceptors_formatter = __commonJS({
18534
18534
  }
18535
18535
  format(pendingInterceptors) {
18536
18536
  const withPrettyHeaders = pendingInterceptors.map(
18537
- ({ method, path: path4, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
18537
+ ({ method, path: path5, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
18538
18538
  Method: method,
18539
18539
  Origin: origin,
18540
- Path: path4,
18540
+ Path: path5,
18541
18541
  "Status code": statusCode,
18542
18542
  Persistent: persist ? "\u2705" : "\u274C",
18543
18543
  Invocations: timesInvoked,
@@ -23157,8 +23157,8 @@ var require_util6 = __commonJS({
23157
23157
  }
23158
23158
  }
23159
23159
  }
23160
- function validateCookiePath(path4) {
23161
- for (const char of path4) {
23160
+ function validateCookiePath(path5) {
23161
+ for (const char of path5) {
23162
23162
  const code = char.charCodeAt(0);
23163
23163
  if (code < 33 || char === ";") {
23164
23164
  throw new Error("Invalid cookie path");
@@ -24838,11 +24838,11 @@ var require_undici = __commonJS({
24838
24838
  if (typeof opts.path !== "string") {
24839
24839
  throw new InvalidArgumentError("invalid opts.path");
24840
24840
  }
24841
- let path4 = opts.path;
24841
+ let path5 = opts.path;
24842
24842
  if (!opts.path.startsWith("/")) {
24843
- path4 = `/${path4}`;
24843
+ path5 = `/${path5}`;
24844
24844
  }
24845
- url = new URL(util.parseOrigin(url).origin + path4);
24845
+ url = new URL(util.parseOrigin(url).origin + path5);
24846
24846
  } else {
24847
24847
  if (!opts) {
24848
24848
  opts = typeof url === "object" ? url : {};
@@ -25030,7 +25030,7 @@ function deriveIdentityParts() {
25030
25030
  function deriveAutoId(parts) {
25031
25031
  return `${parts.username}@${parts.host}#${parts.homeHash}`;
25032
25032
  }
25033
- function writeIdentityFile(path4, userId, parts) {
25033
+ function writeIdentityFile(path5, userId, parts) {
25034
25034
  const identity = {
25035
25035
  userId,
25036
25036
  derivedFrom: {
@@ -25041,15 +25041,15 @@ function writeIdentityFile(path4, userId, parts) {
25041
25041
  },
25042
25042
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
25043
25043
  };
25044
- const dir = dirname(path4);
25044
+ const dir = dirname(path5);
25045
25045
  mkdirSync(dir, { recursive: true });
25046
- const tmp = `${path4}.${process.pid}.${Math.random().toString(36).slice(2, 8)}.tmp`;
25046
+ const tmp = `${path5}.${process.pid}.${Math.random().toString(36).slice(2, 8)}.tmp`;
25047
25047
  writeFileSync(tmp, JSON.stringify(identity, null, 2) + "\n", { mode: 384 });
25048
- renameSync(tmp, path4);
25048
+ renameSync(tmp, path5);
25049
25049
  if (process.platform === "win32") {
25050
25050
  try {
25051
25051
  execSync(
25052
- `icacls "${path4}" /inheritance:r /grant:r "%USERNAME%:(R,W)"`,
25052
+ `icacls "${path5}" /inheritance:r /grant:r "%USERNAME%:(R,W)"`,
25053
25053
  { stdio: "ignore", timeout: 5e3 }
25054
25054
  );
25055
25055
  } catch {
@@ -26571,7 +26571,8 @@ function normalizeCompactResult(response, options = {}) {
26571
26571
  clustersDeclined: typeof response?.clustersDeclined === "number" ? response.clustersDeclined : void 0,
26572
26572
  turnsRemoved: typeof response?.turnsRemoved === "number" ? response.turnsRemoved : void 0,
26573
26573
  summaryMethod: typeof response?.summaryMethod === "string" && response.summaryMethod.length > 0 ? response.summaryMethod : void 0,
26574
- meanConfidence: typeof response?.meanConfidence === "number" ? response.meanConfidence : void 0
26574
+ meanConfidence: typeof response?.meanConfidence === "number" ? response.meanConfidence : void 0,
26575
+ summaryText: typeof response?.summaryText === "string" && response.summaryText.length > 0 ? response.summaryText : void 0
26575
26576
  };
26576
26577
  return {
26577
26578
  ok: true,
@@ -26580,6 +26581,7 @@ function normalizeCompactResult(response, options = {}) {
26580
26581
  result: {
26581
26582
  tokensBefore,
26582
26583
  ...details.summaryMethod ? { summary: details.summaryMethod } : {},
26584
+ ...details.summaryText ? { summaryText: details.summaryText } : {},
26583
26585
  details
26584
26586
  }
26585
26587
  };
@@ -27619,7 +27621,7 @@ import path2 from "node:path";
27619
27621
  var proxy_exports = {};
27620
27622
  __reExport(proxy_exports, __toESM(require_cjs(), 1));
27621
27623
 
27622
- // node_modules/.pnpm/@xdarkicex+libravdb-contracts@0.3.0/node_modules/@xdarkicex/libravdb-contracts/gen/js/libravdb/ipc/v1/rpc_pb.js
27624
+ // node_modules/.pnpm/@xdarkicex+libravdb-contracts@2.0.8/node_modules/@xdarkicex/libravdb-contracts/gen/js/libravdb/ipc/v1/rpc_pb.js
27623
27625
  var IngestMode;
27624
27626
  (function(IngestMode2) {
27625
27627
  IngestMode2[IngestMode2["REPLACE"] = 0] = "REPLACE";
@@ -28962,6 +28964,10 @@ var CompactSessionResponse = class _CompactSessionResponse extends proxy_exports
28962
28964
  * @generated from field: double mean_confidence = 6;
28963
28965
  */
28964
28966
  meanConfidence = 0;
28967
+ /**
28968
+ * @generated from field: string summary_text = 7;
28969
+ */
28970
+ summaryText = "";
28965
28971
  constructor(data) {
28966
28972
  super();
28967
28973
  proxy_exports.proto3.util.initPartial(data, this);
@@ -29010,6 +29016,13 @@ var CompactSessionResponse = class _CompactSessionResponse extends proxy_exports
29010
29016
  kind: "scalar",
29011
29017
  T: 1
29012
29018
  /* ScalarType.DOUBLE */
29019
+ },
29020
+ {
29021
+ no: 7,
29022
+ name: "summary_text",
29023
+ kind: "scalar",
29024
+ T: 9
29025
+ /* ScalarType.STRING */
29013
29026
  }
29014
29027
  ]);
29015
29028
  static fromBinary(bytes, options) {
@@ -30513,6 +30526,13 @@ var CompactSessionRequest = class _CompactSessionRequest extends proxy_exports.M
30513
30526
  * @generated from field: int32 current_token_count = 7;
30514
30527
  */
30515
30528
  currentTokenCount = 0;
30529
+ /**
30530
+ * Model's context window size in tokens. Enables daemon-side 80% threshold
30531
+ * calculation when client doesn't send force=true.
30532
+ *
30533
+ * @generated from field: int32 context_window_size = 8;
30534
+ */
30535
+ contextWindowSize = 0;
30516
30536
  constructor(data) {
30517
30537
  super();
30518
30538
  proxy_exports.proto3.util.initPartial(data, this);
@@ -30568,6 +30588,13 @@ var CompactSessionRequest = class _CompactSessionRequest extends proxy_exports.M
30568
30588
  kind: "scalar",
30569
30589
  T: 5
30570
30590
  /* ScalarType.INT32 */
30591
+ },
30592
+ {
30593
+ no: 8,
30594
+ name: "context_window_size",
30595
+ kind: "scalar",
30596
+ T: 5
30597
+ /* ScalarType.INT32 */
30571
30598
  }
30572
30599
  ]);
30573
30600
  static fromBinary(bytes, options) {
@@ -35670,11 +35697,11 @@ var Http2SessionManager = class {
35670
35697
  * Clients must call notifyResponseByteRead() whenever they successfully read
35671
35698
  * data from the http2.ClientHttp2Stream.
35672
35699
  */
35673
- async request(method, path4, headers, options) {
35700
+ async request(method, path5, headers, options) {
35674
35701
  for (; ; ) {
35675
35702
  const ready2 = await this.gotoReady();
35676
35703
  try {
35677
- const stream = ready2.conn.request(Object.assign(Object.assign({}, headers), { ":method": method, ":path": path4 }), options);
35704
+ const stream = ready2.conn.request(Object.assign(Object.assign({}, headers), { ":method": method, ":path": path5 }), options);
35678
35705
  ready2.registerRequest(stream);
35679
35706
  return stream;
35680
35707
  } catch (e) {
@@ -36312,7 +36339,7 @@ function createGrpcTransport(options) {
36312
36339
  return createTransport(validateNodeTransportOptions(options));
36313
36340
  }
36314
36341
 
36315
- // node_modules/.pnpm/@xdarkicex+libravdb-contracts@0.3.0/node_modules/@xdarkicex/libravdb-contracts/gen/js/libravdb/ipc/v1/rpc_connect.js
36342
+ // node_modules/.pnpm/@xdarkicex+libravdb-contracts@2.0.8/node_modules/@xdarkicex/libravdb-contracts/gen/js/libravdb/ipc/v1/rpc_connect.js
36316
36343
  var LibravDB = {
36317
36344
  typeName: "libravdb.ipc.v1.LibravDB",
36318
36345
  methods: {
@@ -36983,12 +37010,39 @@ function loadSecretFromEnv(logger) {
36983
37010
  }
36984
37011
 
36985
37012
  // src/plugin-runtime.ts
37013
+ import { existsSync as existsSync2, statSync } from "node:fs";
37014
+ import path4 from "node:path";
36986
37015
  var DEFAULT_RPC_TIMEOUT_MS = 3e4;
36987
37016
  var VALID_TLS_MODES = ["auto", "tls", "insecure"];
36988
37017
  var isTlsModeValid = (m) => VALID_TLS_MODES.includes(m);
36989
37018
  function daemonProvisioningHint() {
36990
37019
  return "If you installed the npm package, install and start libravdbd separately; the package does not provision the daemon binary, ONNX Runtime, or model assets.";
36991
37020
  }
37021
+ function validateEmbeddingConfig(cfg) {
37022
+ if (cfg.embeddingBackend !== "onnx-local") {
37023
+ return;
37024
+ }
37025
+ const runtimePath = cfg.embeddingRuntimePath?.trim();
37026
+ const modelPath = cfg.embeddingModelPath?.trim();
37027
+ if (!runtimePath || !modelPath) {
37028
+ throw new Error(
37029
+ `LibraVDB: embeddingBackend="onnx-local" requires embeddingRuntimePath and embeddingModelPath. Start libravdbd with matching LIBRAVDB_ONNX_RUNTIME and LIBRAVDB_EMBEDDING_MODEL values.`
37030
+ );
37031
+ }
37032
+ if (!shouldValidateLocalEmbeddingPaths(cfg)) {
37033
+ return;
37034
+ }
37035
+ if (!pathExistsAsFile(runtimePath)) {
37036
+ throw new Error(
37037
+ `LibraVDB: embeddingRuntimePath must point to a readable ONNX Runtime library: ${runtimePath}`
37038
+ );
37039
+ }
37040
+ if (!pathExistsAsDirectory(modelPath) || !pathExistsAsFile(path4.join(modelPath, "embedding.json"))) {
37041
+ throw new Error(
37042
+ `LibraVDB: embeddingModelPath must point to a directory containing embedding.json: ${modelPath}`
37043
+ );
37044
+ }
37045
+ }
36992
37046
  function createPluginRuntime(cfg, logger = console) {
36993
37047
  let started = null;
36994
37048
  let stopped = false;
@@ -37001,6 +37055,7 @@ function createPluginRuntime(cfg, logger = console) {
37001
37055
  if (!started) {
37002
37056
  let client;
37003
37057
  started = (async () => {
37058
+ validateEmbeddingConfig(cfg);
37004
37059
  validateTlsConfig(cfg, logger);
37005
37060
  client = new LibravDBClient({
37006
37061
  endpoint: cfg.grpcEndpoint || cfg.sidecarPath,
@@ -37070,6 +37125,32 @@ function createPluginRuntime(cfg, logger = console) {
37070
37125
  }
37071
37126
  };
37072
37127
  }
37128
+ function shouldValidateLocalEmbeddingPaths(cfg) {
37129
+ const endpoint = resolveClientEndpoint(cfg.grpcEndpoint || cfg.sidecarPath).trim();
37130
+ if (!endpoint || endpoint === "auto" || endpoint.startsWith("unix:")) {
37131
+ return true;
37132
+ }
37133
+ if (!endpoint.startsWith("tcp:")) {
37134
+ return false;
37135
+ }
37136
+ const target = endpoint.slice("tcp:".length);
37137
+ const host = target.startsWith("[") ? target.slice(1, target.indexOf("]")) : target.split(":")[0];
37138
+ return host === "localhost" || host === "127.0.0.1" || host === "::1";
37139
+ }
37140
+ function pathExistsAsFile(filePath) {
37141
+ try {
37142
+ return existsSync2(filePath) && statSync(filePath).isFile();
37143
+ } catch {
37144
+ return false;
37145
+ }
37146
+ }
37147
+ function pathExistsAsDirectory(dirPath) {
37148
+ try {
37149
+ return existsSync2(dirPath) && statSync(dirPath).isDirectory();
37150
+ } catch {
37151
+ return false;
37152
+ }
37153
+ }
37073
37154
  function validateTlsConfig(cfg, logger) {
37074
37155
  if (cfg.grpcEndpointTlsMode !== void 0 && !isTlsModeValid(cfg.grpcEndpointTlsMode)) {
37075
37156
  throw new Error(
@@ -28,5 +28,6 @@ export interface PluginRuntime {
28
28
  shutdown(): Promise<void>;
29
29
  }
30
30
  export declare function daemonProvisioningHint(): string;
31
+ export declare function validateEmbeddingConfig(cfg: PluginConfig): void;
31
32
  export declare function createPluginRuntime(cfg: PluginConfig, logger?: LoggerLike): PluginRuntime;
32
33
  export declare function enrichStartupError(error: unknown, healthMessage?: string): Error;
@@ -1,5 +1,7 @@
1
- import { LibravDBClient } from "./libravdb-client.js";
1
+ import { LibravDBClient, resolveClientEndpoint } from "./libravdb-client.js";
2
2
  import { formatError } from "./format-error.js";
3
+ import { existsSync, statSync } from "node:fs";
4
+ import path from "node:path";
3
5
  export const DEFAULT_RPC_TIMEOUT_MS = 30000;
4
6
  export const STARTUP_HEALTH_TIMEOUT_MS = 2000;
5
7
  export const VALID_TLS_MODES = ["auto", "tls", "insecure"];
@@ -10,6 +12,26 @@ export function resolveStartupHealthTimeoutMs(cfg) {
10
12
  export function daemonProvisioningHint() {
11
13
  return "If you installed the npm package, install and start libravdbd separately; the package does not provision the daemon binary, ONNX Runtime, or model assets.";
12
14
  }
15
+ export function validateEmbeddingConfig(cfg) {
16
+ if (cfg.embeddingBackend !== "onnx-local") {
17
+ return;
18
+ }
19
+ const runtimePath = cfg.embeddingRuntimePath?.trim();
20
+ const modelPath = cfg.embeddingModelPath?.trim();
21
+ if (!runtimePath || !modelPath) {
22
+ throw new Error(`LibraVDB: embeddingBackend="onnx-local" requires embeddingRuntimePath and embeddingModelPath. ` +
23
+ `Start libravdbd with matching LIBRAVDB_ONNX_RUNTIME and LIBRAVDB_EMBEDDING_MODEL values.`);
24
+ }
25
+ if (!shouldValidateLocalEmbeddingPaths(cfg)) {
26
+ return;
27
+ }
28
+ if (!pathExistsAsFile(runtimePath)) {
29
+ throw new Error(`LibraVDB: embeddingRuntimePath must point to a readable ONNX Runtime library: ${runtimePath}`);
30
+ }
31
+ if (!pathExistsAsDirectory(modelPath) || !pathExistsAsFile(path.join(modelPath, "embedding.json"))) {
32
+ throw new Error(`LibraVDB: embeddingModelPath must point to a directory containing embedding.json: ${modelPath}`);
33
+ }
34
+ }
13
35
  export function createPluginRuntime(cfg, logger = console) {
14
36
  let started = null;
15
37
  let stopped = false;
@@ -22,6 +44,7 @@ export function createPluginRuntime(cfg, logger = console) {
22
44
  if (!started) {
23
45
  let client;
24
46
  started = (async () => {
47
+ validateEmbeddingConfig(cfg);
25
48
  validateTlsConfig(cfg, logger);
26
49
  client = new LibravDBClient({
27
50
  endpoint: cfg.grpcEndpoint || cfg.sidecarPath,
@@ -97,6 +120,37 @@ export function createPluginRuntime(cfg, logger = console) {
97
120
  },
98
121
  };
99
122
  }
123
+ function shouldValidateLocalEmbeddingPaths(cfg) {
124
+ // Resolve the same endpoint the client will use — respects LIBRAVDB_GRPC_ENDPOINT env var
125
+ const endpoint = resolveClientEndpoint(cfg.grpcEndpoint || cfg.sidecarPath).trim();
126
+ if (!endpoint || endpoint === "auto" || endpoint.startsWith("unix:")) {
127
+ return true;
128
+ }
129
+ if (!endpoint.startsWith("tcp:")) {
130
+ return false;
131
+ }
132
+ const target = endpoint.slice("tcp:".length);
133
+ const host = target.startsWith("[")
134
+ ? target.slice(1, target.indexOf("]"))
135
+ : target.split(":")[0];
136
+ return host === "localhost" || host === "127.0.0.1" || host === "::1";
137
+ }
138
+ function pathExistsAsFile(filePath) {
139
+ try {
140
+ return existsSync(filePath) && statSync(filePath).isFile();
141
+ }
142
+ catch {
143
+ return false;
144
+ }
145
+ }
146
+ function pathExistsAsDirectory(dirPath) {
147
+ try {
148
+ return existsSync(dirPath) && statSync(dirPath).isDirectory();
149
+ }
150
+ catch {
151
+ return false;
152
+ }
153
+ }
100
154
  function validateTlsConfig(cfg, logger) {
101
155
  if (cfg.grpcEndpointTlsMode !== undefined &&
102
156
  !isTlsModeValid(cfg.grpcEndpointTlsMode)) {
package/dist/types.d.ts CHANGED
@@ -15,6 +15,8 @@ export interface PluginConfig {
15
15
  crossSessionRecall?: boolean;
16
16
  useSessionRecallProjection?: boolean;
17
17
  useSessionSummarySearchExperiment?: boolean;
18
+ /** Path to the daemon-visible ONNX Runtime library.
19
+ * Required when embeddingBackend is "onnx-local". */
18
20
  embeddingRuntimePath?: string;
19
21
  /** Optional ONNX execution provider override passed through to libravdbd.
20
22
  * Use "cpu" to bypass CoreML/MPS on Intel Macs or fragile GPU/NPU providers. */
@@ -22,6 +24,8 @@ export interface PluginConfig {
22
24
  embeddingBackend?: "bundled" | "onnx-local" | "gguf" | "custom-local" | "remote";
23
25
  embeddingProfile?: string;
24
26
  fallbackProfile?: string;
27
+ /** Path to a daemon-visible model directory containing embedding.json.
28
+ * Required when embeddingBackend is "onnx-local". */
25
29
  embeddingModelPath?: string;
26
30
  embeddingTokenizerPath?: string;
27
31
  embeddingDimensions?: number;
@@ -87,10 +87,10 @@ address, explicitly set `grpcEndpointTlsMode: "tls"` to match:
87
87
  |---|---|---|---|
88
88
  | `embeddingProfile` | string | `nomic-embed-text-v1.5` | Primary embedding model |
89
89
  | `fallbackProfile` | string | `bge-small-en-v1.5` | Fallback when primary model fails dimension checks |
90
- | `embeddingBackend` | string | — | `bundled`, `onnx-local`, or `custom-local` |
90
+ | `embeddingBackend` | string | — | `bundled`, `onnx-local`, `custom-local`, or `remote` |
91
91
  | `onnxDevice` | string | `auto` | ONNX execution provider: `auto`, `cpu`, `coreml` (macOS), `cuda` (Linux/Windows), `directml` (Windows), `openvino` (Linux) |
92
- | `embeddingRuntimePath` | string | — | Path to ONNX runtime library (maps to `LIBRAVDB_ONNX_RUNTIME`) |
93
- | `embeddingModelPath` | string | — | Path to custom embedding model `.onnx` file |
92
+ | `embeddingRuntimePath` | string | — | Path to ONNX runtime library visible to the daemon (maps to `LIBRAVDB_ONNX_RUNTIME`; required with `embeddingBackend: "onnx-local"`) |
93
+ | `embeddingModelPath` | string | — | Path to the model directory containing `embedding.json`, `model.onnx`, and `tokenizer.json` (maps to `LIBRAVDB_EMBEDDING_MODEL`; required with `embeddingBackend: "onnx-local"`) |
94
94
  | `embeddingTokenizerPath` | string | — | Path to custom tokenizer file |
95
95
  | `embeddingDimensions` | number | — | Embedding dimension override |
96
96
  | `embeddingNormalize` | boolean | — | Enable embedding normalization |