bluera-knowledge 0.26.0 → 0.27.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [0.27.0](https://github.com/blueraai/bluera-knowledge/compare/v0.26.0...v0.27.0) (2026-02-05)
6
+
7
+
8
+ ### Features
9
+
10
+ * **hooks:** conditional BK enforcement on library reads ([1d7ff96](https://github.com/blueraai/bluera-knowledge/commit/1d7ff96ea38c1afda970c1cbaae3b3edb2b1bd0f))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **lance:** remove .lance directory on store deletion ([08cccef](https://github.com/blueraai/bluera-knowledge/commit/08cccef8dae943abf4f71b0f65a6a21b1a8b5110))
16
+
5
17
  ## [0.26.0](https://github.com/blueraai/bluera-knowledge/compare/v0.25.1...v0.26.0) (2026-02-04)
6
18
 
7
19
 
@@ -6062,6 +6062,8 @@ var EmbeddingEngine = class {
6062
6062
  };
6063
6063
 
6064
6064
  // src/db/lance.ts
6065
+ import { rm as rm2 } from "fs/promises";
6066
+ import { join as join12 } from "path";
6065
6067
  import * as lancedb from "@lancedb/lancedb";
6066
6068
  import { LanceSchema } from "@lancedb/lancedb/embedding";
6067
6069
  import { Utf8 } from "apache-arrow";
@@ -6162,6 +6164,7 @@ var DocumentMetadataSchema = z5.object({
6162
6164
  }).loose();
6163
6165
 
6164
6166
  // src/db/lance.ts
6167
+ var logger6 = createLogger("lance");
6165
6168
  function isSearchHit(value) {
6166
6169
  if (typeof value !== "object" || value === null) return false;
6167
6170
  return "id" in value && "content" in value && "metadata" in value && "_distance" in value && typeof value.id === "string" && typeof value.content === "string" && typeof value.metadata === "string" && typeof value._distance === "number";
@@ -6339,7 +6342,13 @@ var LanceStore = class {
6339
6342
  const tableNames = await this.connection.tableNames();
6340
6343
  if (tableNames.includes(tableName)) {
6341
6344
  await this.connection.dropTable(tableName);
6342
- this.tables.delete(tableName);
6345
+ }
6346
+ this.tables.delete(tableName);
6347
+ const lanceDir = join12(this.dataDir, `${tableName}.lance`);
6348
+ try {
6349
+ await rm2(lanceDir, { recursive: true, force: true });
6350
+ } catch (error) {
6351
+ logger6.warn({ lanceDir, error }, "Failed to remove .lance directory");
6343
6352
  }
6344
6353
  }
6345
6354
  close() {
@@ -6376,7 +6385,7 @@ var LanceStore = class {
6376
6385
  };
6377
6386
 
6378
6387
  // src/services/index.ts
6379
- var logger6 = createLogger("services");
6388
+ var logger7 = createLogger("services");
6380
6389
  var LazyServiceContainer = class {
6381
6390
  // Eagerly initialized (lightweight)
6382
6391
  config;
@@ -6407,7 +6416,7 @@ var LazyServiceContainer = class {
6407
6416
  */
6408
6417
  get embeddings() {
6409
6418
  if (this._embeddings === null) {
6410
- logger6.debug("Lazy-initializing EmbeddingEngine");
6419
+ logger7.debug("Lazy-initializing EmbeddingEngine");
6411
6420
  this._embeddings = new EmbeddingEngine(this.appConfig.embedding);
6412
6421
  }
6413
6422
  return this._embeddings;
@@ -6417,7 +6426,7 @@ var LazyServiceContainer = class {
6417
6426
  */
6418
6427
  get codeGraph() {
6419
6428
  if (this._codeGraph === null) {
6420
- logger6.debug("Lazy-initializing CodeGraphService");
6429
+ logger7.debug("Lazy-initializing CodeGraphService");
6421
6430
  this._codeGraph = new CodeGraphService(this.dataDir, this.pythonBridge);
6422
6431
  }
6423
6432
  return this._codeGraph;
@@ -6427,7 +6436,7 @@ var LazyServiceContainer = class {
6427
6436
  */
6428
6437
  get search() {
6429
6438
  if (this._search === null) {
6430
- logger6.debug("Lazy-initializing SearchService");
6439
+ logger7.debug("Lazy-initializing SearchService");
6431
6440
  this._search = new SearchService(this.lance, this.codeGraph, this.appConfig.search);
6432
6441
  }
6433
6442
  return this._search;
@@ -6437,7 +6446,7 @@ var LazyServiceContainer = class {
6437
6446
  */
6438
6447
  get index() {
6439
6448
  if (this._index === null) {
6440
- logger6.debug("Lazy-initializing IndexService");
6449
+ logger7.debug("Lazy-initializing IndexService");
6441
6450
  this._index = new IndexService(this.lance, this.embeddings, {
6442
6451
  codeGraphService: this.codeGraph,
6443
6452
  manifestService: this.manifest,
@@ -6454,7 +6463,7 @@ var LazyServiceContainer = class {
6454
6463
  */
6455
6464
  get manifest() {
6456
6465
  if (this._manifest === null) {
6457
- logger6.debug("Lazy-initializing ManifestService");
6466
+ logger7.debug("Lazy-initializing ManifestService");
6458
6467
  this._manifest = new ManifestService(this.dataDir);
6459
6468
  }
6460
6469
  return this._manifest;
@@ -6473,7 +6482,7 @@ var LazyServiceContainer = class {
6473
6482
  }
6474
6483
  };
6475
6484
  async function createLazyServices(configPath, dataDir, projectRoot) {
6476
- logger6.info({ configPath, dataDir, projectRoot }, "Initializing lazy services");
6485
+ logger7.info({ configPath, dataDir, projectRoot }, "Initializing lazy services");
6477
6486
  const startTime = Date.now();
6478
6487
  const config = new ConfigService(configPath, dataDir, projectRoot);
6479
6488
  const appConfig = await config.load();
@@ -6494,14 +6503,14 @@ async function createLazyServices(configPath, dataDir, projectRoot) {
6494
6503
  await store.initialize();
6495
6504
  await lance.setEmbeddingFunction(appConfig.embedding);
6496
6505
  const durationMs = Date.now() - startTime;
6497
- logger6.info(
6506
+ logger7.info(
6498
6507
  { dataDir: resolvedDataDir, projectRoot: resolvedProjectRoot, durationMs },
6499
6508
  "Lazy services initialized"
6500
6509
  );
6501
6510
  return new LazyServiceContainer(config, appConfig, resolvedDataDir, store, lance, pythonBridge);
6502
6511
  }
6503
6512
  async function createServices(configPath, dataDir, projectRoot) {
6504
- logger6.info({ configPath, dataDir, projectRoot }, "Initializing services");
6513
+ logger7.info({ configPath, dataDir, projectRoot }, "Initializing services");
6505
6514
  const config = new ConfigService(configPath, dataDir, projectRoot);
6506
6515
  const appConfig = await config.load();
6507
6516
  const resolvedDataDir = config.resolveDataDir();
@@ -6533,7 +6542,7 @@ async function createServices(configPath, dataDir, projectRoot) {
6533
6542
  concurrency: appConfig.indexing.concurrency,
6534
6543
  ignorePatterns: appConfig.indexing.ignorePatterns
6535
6544
  });
6536
- logger6.info(
6545
+ logger7.info(
6537
6546
  { dataDir: resolvedDataDir, projectRoot: resolvedProjectRoot },
6538
6547
  "Services initialized successfully"
6539
6548
  );
@@ -6550,20 +6559,20 @@ async function createServices(configPath, dataDir, projectRoot) {
6550
6559
  };
6551
6560
  }
6552
6561
  async function destroyServices(services) {
6553
- logger6.info("Shutting down services");
6562
+ logger7.info("Shutting down services");
6554
6563
  const errors = [];
6555
6564
  const isLazyContainer = services instanceof LazyServiceContainer;
6556
6565
  const shouldCleanupSearch = !isLazyContainer || services.hasSearch;
6557
6566
  if (shouldCleanupSearch) {
6558
6567
  services.search.cleanup();
6559
6568
  } else {
6560
- logger6.debug("Skipping search cleanup (not initialized)");
6569
+ logger7.debug("Skipping search cleanup (not initialized)");
6561
6570
  }
6562
6571
  try {
6563
6572
  await services.pythonBridge.stop();
6564
6573
  } catch (e) {
6565
6574
  const error = e instanceof Error ? e : new Error(String(e));
6566
- logger6.error({ error }, "Error stopping Python bridge");
6575
+ logger7.error({ error }, "Error stopping Python bridge");
6567
6576
  errors.push(error);
6568
6577
  }
6569
6578
  const shouldDisposeEmbeddings = !isLazyContainer || services.hasEmbeddings;
@@ -6572,17 +6581,17 @@ async function destroyServices(services) {
6572
6581
  await services.embeddings.dispose();
6573
6582
  } catch (e) {
6574
6583
  const error = e instanceof Error ? e : new Error(String(e));
6575
- logger6.error({ error }, "Error disposing EmbeddingEngine");
6584
+ logger7.error({ error }, "Error disposing EmbeddingEngine");
6576
6585
  errors.push(error);
6577
6586
  }
6578
6587
  } else {
6579
- logger6.debug("Skipping embeddings disposal (not initialized)");
6588
+ logger7.debug("Skipping embeddings disposal (not initialized)");
6580
6589
  }
6581
6590
  try {
6582
6591
  await services.lance.closeAsync();
6583
6592
  } catch (e) {
6584
6593
  const error = e instanceof Error ? e : new Error(String(e));
6585
- logger6.error({ error }, "Error closing LanceStore");
6594
+ logger7.error({ error }, "Error closing LanceStore");
6586
6595
  errors.push(error);
6587
6596
  }
6588
6597
  await shutdownLogger();
@@ -6616,4 +6625,4 @@ export {
6616
6625
  createServices,
6617
6626
  destroyServices
6618
6627
  };
6619
- //# sourceMappingURL=chunk-XWVZG26U.js.map
6628
+ //# sourceMappingURL=chunk-GB5WKUBX.js.map