@xdarkicex/openclaw-memory-libravdb 1.4.55 → 1.4.57

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.
@@ -3,6 +3,7 @@ export interface GrpcClientOptions {
3
3
  secret?: string;
4
4
  timeoutMs?: number;
5
5
  }
6
+ export declare function resolveGrpcTarget(endpoint: string): string;
6
7
  export declare class GrpcKernelClient {
7
8
  private client;
8
9
  private readonly secret;
@@ -7,6 +7,9 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
7
  // The proto file is expected to be copied to dist/proto/ at build time.
8
8
  // In source, it's at api/proto/.
9
9
  const PROTO_PATH = path.resolve(__dirname, "./proto/intelligence_kernel/v1/kernel.proto");
10
+ export function resolveGrpcTarget(endpoint) {
11
+ return endpoint.startsWith("tcp:") ? endpoint.substring(4) : endpoint;
12
+ }
10
13
  export class GrpcKernelClient {
11
14
  client;
12
15
  secret;
@@ -24,11 +27,7 @@ export class GrpcKernelClient {
24
27
  });
25
28
  const protoDescriptor = grpc.loadPackageDefinition(packageDefinition);
26
29
  const kernelService = protoDescriptor.intelligence_kernel.v1.IntelligenceKernel;
27
- const target = options.endpoint.startsWith("tcp:")
28
- ? options.endpoint.substring(4)
29
- : options.endpoint.startsWith("unix:")
30
- ? options.endpoint.substring(5)
31
- : options.endpoint;
30
+ const target = resolveGrpcTarget(options.endpoint);
32
31
  this.client = new kernelService(target, grpc.credentials.createInsecure());
33
32
  }
34
33
  getMetadata(signed = true) {
package/dist/index.js CHANGED
@@ -38840,22 +38840,32 @@ function matchesGlob(value, pattern) {
38840
38840
  return new RegExp(`^${escaped}$`).test(value);
38841
38841
  }
38842
38842
  function looksLikeObsidianNote(filePath, text) {
38843
- if (!text.startsWith("---\n")) {
38843
+ const frontmatterStart = parseFrontmatterStart(text);
38844
+ if (frontmatterStart == null) {
38844
38845
  return hasInlineObsidianTag(text);
38845
38846
  }
38846
- const frontmatterEnd = findFrontmatterEnd(text, 4);
38847
- if (frontmatterEnd < 0) {
38847
+ const parsed = findFrontmatterEnd(text, frontmatterStart);
38848
+ if (!parsed) {
38848
38849
  return hasInlineObsidianTag(text);
38849
38850
  }
38850
- const frontmatter = text.slice(4, frontmatterEnd);
38851
- const lines = frontmatter.split("\n");
38851
+ const frontmatter = text.slice(frontmatterStart, parsed.position);
38852
+ const lines = frontmatter.split(/\r?\n/);
38852
38853
  for (const line of lines) {
38853
38854
  const trimmed = line.trimStart();
38854
38855
  if (trimmed.startsWith("tags:") || trimmed.startsWith("tag:") || trimmed.startsWith("openclaw:") || trimmed.startsWith("memory:")) {
38855
38856
  return true;
38856
38857
  }
38857
38858
  }
38858
- return hasInlineObsidianTag(text.slice(frontmatterEnd + 4));
38859
+ return hasInlineObsidianTag(text.slice(parsed.bodyOffset));
38860
+ }
38861
+ function parseFrontmatterStart(text) {
38862
+ if (text.startsWith("---\n")) {
38863
+ return 4;
38864
+ }
38865
+ if (text.startsWith("---\r\n")) {
38866
+ return 5;
38867
+ }
38868
+ return null;
38859
38869
  }
38860
38870
  function findFrontmatterEnd(text, offset) {
38861
38871
  for (let i = offset; i < text.length - 3; i++) {
@@ -38864,13 +38874,13 @@ function findFrontmatterEnd(text, offset) {
38864
38874
  }
38865
38875
  const next = text.charCodeAt(i + 3);
38866
38876
  if (next === 10) {
38867
- return i;
38877
+ return { position: i, bodyOffset: i + 4 };
38868
38878
  }
38869
38879
  if (next === 13 && text.charCodeAt(i + 4) === 10) {
38870
- return i;
38880
+ return { position: i, bodyOffset: i + 5 };
38871
38881
  }
38872
38882
  }
38873
- return -1;
38883
+ return null;
38874
38884
  }
38875
38885
  function hasInlineObsidianTag(text) {
38876
38886
  let inFence = false;
@@ -38884,10 +38894,8 @@ function hasInlineObsidianTag(text) {
38884
38894
  if (inFence) {
38885
38895
  continue;
38886
38896
  }
38887
- if (trimmed.startsWith("#")) {
38888
- continue;
38889
- }
38890
- if (/(^|[^A-Za-z0-9_])#([A-Za-z][A-Za-z0-9/_-]*)\b/.test(line)) {
38897
+ const searchable = trimmed.replace(/^#{1,6}\s+/, "");
38898
+ if (/(^|[^A-Za-z0-9_])#([A-Za-z][A-Za-z0-9/_-]*)\b/.test(searchable)) {
38891
38899
  return true;
38892
38900
  }
38893
38901
  }
@@ -39260,6 +39268,9 @@ import path3 from "node:path";
39260
39268
  import { fileURLToPath } from "node:url";
39261
39269
  var __dirname2 = path3.dirname(fileURLToPath(import.meta.url));
39262
39270
  var PROTO_PATH = path3.resolve(__dirname2, "./proto/intelligence_kernel/v1/kernel.proto");
39271
+ function resolveGrpcTarget(endpoint) {
39272
+ return endpoint.startsWith("tcp:") ? endpoint.substring(4) : endpoint;
39273
+ }
39263
39274
  var GrpcKernelClient = class {
39264
39275
  client;
39265
39276
  secret;
@@ -39277,7 +39288,7 @@ var GrpcKernelClient = class {
39277
39288
  });
39278
39289
  const protoDescriptor = grpc.loadPackageDefinition(packageDefinition);
39279
39290
  const kernelService = protoDescriptor.intelligence_kernel.v1.IntelligenceKernel;
39280
- const target = options.endpoint.startsWith("tcp:") ? options.endpoint.substring(4) : options.endpoint.startsWith("unix:") ? options.endpoint.substring(5) : options.endpoint;
39291
+ const target = resolveGrpcTarget(options.endpoint);
39281
39292
  this.client = new kernelService(target, grpc.credentials.createInsecure());
39282
39293
  }
39283
39294
  getMetadata(signed = true) {
@@ -436,15 +436,16 @@ function matchesGlob(value, pattern) {
436
436
  return new RegExp(`^${escaped}$`).test(value);
437
437
  }
438
438
  function looksLikeObsidianNote(filePath, text) {
439
- if (!text.startsWith("---\n")) {
439
+ const frontmatterStart = parseFrontmatterStart(text);
440
+ if (frontmatterStart == null) {
440
441
  return hasInlineObsidianTag(text);
441
442
  }
442
- const frontmatterEnd = findFrontmatterEnd(text, 4);
443
- if (frontmatterEnd < 0) {
443
+ const parsed = findFrontmatterEnd(text, frontmatterStart);
444
+ if (!parsed) {
444
445
  return hasInlineObsidianTag(text);
445
446
  }
446
- const frontmatter = text.slice(4, frontmatterEnd);
447
- const lines = frontmatter.split("\n");
447
+ const frontmatter = text.slice(frontmatterStart, parsed.position);
448
+ const lines = frontmatter.split(/\r?\n/);
448
449
  for (const line of lines) {
449
450
  const trimmed = line.trimStart();
450
451
  if (trimmed.startsWith("tags:") ||
@@ -454,7 +455,16 @@ function looksLikeObsidianNote(filePath, text) {
454
455
  return true;
455
456
  }
456
457
  }
457
- return hasInlineObsidianTag(text.slice(frontmatterEnd + 4));
458
+ return hasInlineObsidianTag(text.slice(parsed.bodyOffset));
459
+ }
460
+ function parseFrontmatterStart(text) {
461
+ if (text.startsWith("---\n")) {
462
+ return 4;
463
+ }
464
+ if (text.startsWith("---\r\n")) {
465
+ return 5;
466
+ }
467
+ return null;
458
468
  }
459
469
  function findFrontmatterEnd(text, offset) {
460
470
  for (let i = offset; i < text.length - 3; i++) {
@@ -463,13 +473,13 @@ function findFrontmatterEnd(text, offset) {
463
473
  }
464
474
  const next = text.charCodeAt(i + 3);
465
475
  if (next === 10) {
466
- return i;
476
+ return { position: i, bodyOffset: i + 4 };
467
477
  }
468
478
  if (next === 13 && text.charCodeAt(i + 4) === 10) {
469
- return i;
479
+ return { position: i, bodyOffset: i + 5 };
470
480
  }
471
481
  }
472
- return -1;
482
+ return null;
473
483
  }
474
484
  function hasInlineObsidianTag(text) {
475
485
  let inFence = false;
@@ -483,10 +493,8 @@ function hasInlineObsidianTag(text) {
483
493
  if (inFence) {
484
494
  continue;
485
495
  }
486
- if (trimmed.startsWith("#")) {
487
- continue;
488
- }
489
- if (/(^|[^A-Za-z0-9_])#([A-Za-z][A-Za-z0-9/_-]*)\b/.test(line)) {
496
+ const searchable = trimmed.replace(/^#{1,6}\s+/, "");
497
+ if (/(^|[^A-Za-z0-9_])#([A-Za-z][A-Za-z0-9/_-]*)\b/.test(searchable)) {
490
498
  return true;
491
499
  }
492
500
  }
@@ -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.4.55",
5
+ "version": "1.4.57",
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.4.55",
3
+ "version": "1.4.57",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",