bluera-knowledge 0.11.18 → 0.11.19

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.
Files changed (42) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/CHANGELOG.md +27 -0
  3. package/dist/{chunk-ZDEO4WJT.js → chunk-GOAOBPOA.js} +22 -70
  4. package/dist/chunk-GOAOBPOA.js.map +1 -0
  5. package/dist/{chunk-6FHWC36B.js → chunk-HRQD3MPH.js} +8 -6
  6. package/dist/chunk-HRQD3MPH.js.map +1 -0
  7. package/dist/{chunk-ZZNABJMQ.js → chunk-QEHSDQTL.js} +79 -13
  8. package/dist/chunk-QEHSDQTL.js.map +1 -0
  9. package/dist/{chunk-5NUI6JL6.js → chunk-VP4VZULK.js} +2 -2
  10. package/dist/index.js +36 -18
  11. package/dist/index.js.map +1 -1
  12. package/dist/mcp/server.js +3 -3
  13. package/dist/watch.service-OPLKIDFQ.js +7 -0
  14. package/dist/workers/background-worker-cli.js +3 -3
  15. package/package.json +1 -1
  16. package/src/cli/commands/crawl.ts +1 -1
  17. package/src/cli/commands/index-cmd.test.ts +14 -4
  18. package/src/cli/commands/index-cmd.ts +11 -4
  19. package/src/cli/commands/store.test.ts +211 -18
  20. package/src/cli/commands/store.ts +26 -8
  21. package/src/crawl/article-converter.test.ts +30 -61
  22. package/src/crawl/article-converter.ts +2 -8
  23. package/src/crawl/bridge.test.ts +14 -0
  24. package/src/crawl/bridge.ts +17 -5
  25. package/src/crawl/intelligent-crawler.test.ts +65 -76
  26. package/src/crawl/intelligent-crawler.ts +33 -69
  27. package/src/plugin/git-clone.test.ts +44 -0
  28. package/src/plugin/git-clone.ts +4 -0
  29. package/src/services/code-unit.service.test.ts +59 -6
  30. package/src/services/code-unit.service.ts +47 -2
  31. package/src/services/index.ts +19 -3
  32. package/src/services/job.service.test.ts +10 -7
  33. package/src/services/job.service.ts +12 -6
  34. package/src/services/services.test.ts +19 -6
  35. package/src/services/watch.service.test.ts +80 -56
  36. package/src/services/watch.service.ts +9 -6
  37. package/dist/chunk-6FHWC36B.js.map +0 -1
  38. package/dist/chunk-ZDEO4WJT.js.map +0 -1
  39. package/dist/chunk-ZZNABJMQ.js.map +0 -1
  40. package/dist/watch.service-BJV3TI3F.js +0 -7
  41. /package/dist/{chunk-5NUI6JL6.js.map → chunk-VP4VZULK.js.map} +0 -0
  42. /package/dist/{watch.service-BJV3TI3F.js.map → watch.service-OPLKIDFQ.js.map} +0 -0
@@ -6,7 +6,7 @@ import {
6
6
  createServices,
7
7
  createStoreId,
8
8
  summarizePayload
9
- } from "./chunk-ZZNABJMQ.js";
9
+ } from "./chunk-QEHSDQTL.js";
10
10
 
11
11
  // src/mcp/server.ts
12
12
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
@@ -2096,4 +2096,4 @@ export {
2096
2096
  createMCPServer,
2097
2097
  runMCPServer
2098
2098
  };
2099
- //# sourceMappingURL=chunk-5NUI6JL6.js.map
2099
+ //# sourceMappingURL=chunk-VP4VZULK.js.map
package/dist/index.js CHANGED
@@ -6,10 +6,10 @@ import {
6
6
  isRepoStoreDefinition,
7
7
  isWebStoreDefinition,
8
8
  runMCPServer
9
- } from "./chunk-5NUI6JL6.js";
9
+ } from "./chunk-VP4VZULK.js";
10
10
  import {
11
11
  IntelligentCrawler
12
- } from "./chunk-ZDEO4WJT.js";
12
+ } from "./chunk-GOAOBPOA.js";
13
13
  import {
14
14
  ASTParser,
15
15
  AdapterRegistry,
@@ -22,8 +22,8 @@ import {
22
22
  err,
23
23
  extractRepoName,
24
24
  ok
25
- } from "./chunk-ZZNABJMQ.js";
26
- import "./chunk-6FHWC36B.js";
25
+ } from "./chunk-QEHSDQTL.js";
26
+ import "./chunk-HRQD3MPH.js";
27
27
 
28
28
  // src/index.ts
29
29
  import { homedir as homedir2 } from "os";
@@ -74,7 +74,7 @@ function createCrawlCommand(getOptions) {
74
74
  } else {
75
75
  store = existingStore;
76
76
  }
77
- const maxPages = cmdOptions.maxPages !== void 0 ? parseInt(cmdOptions.maxPages) : 50;
77
+ const maxPages = cmdOptions.maxPages !== void 0 ? parseInt(cmdOptions.maxPages, 10) : 50;
78
78
  const isInteractive = process.stdout.isTTY && globalOpts.quiet !== true && globalOpts.format !== "json";
79
79
  let spinner;
80
80
  if (isInteractive) {
@@ -263,16 +263,23 @@ function createIndexCommand(getOptions) {
263
263
  console.error(`Error: File/repo store not found: ${storeIdOrName}`);
264
264
  process.exit(3);
265
265
  }
266
- const { WatchService } = await import("./watch.service-BJV3TI3F.js");
266
+ const { WatchService } = await import("./watch.service-OPLKIDFQ.js");
267
267
  const watchService = new WatchService(services.index, services.lance);
268
268
  if (globalOpts.quiet !== true) {
269
269
  console.log(`Watching ${store.name} for changes...`);
270
270
  }
271
- await watchService.watch(store, parseInt(options.debounce ?? "1000", 10), () => {
272
- if (globalOpts.quiet !== true) {
273
- console.log(`Re-indexed ${store.name}`);
271
+ await watchService.watch(
272
+ store,
273
+ parseInt(options.debounce ?? "1000", 10),
274
+ () => {
275
+ if (globalOpts.quiet !== true) {
276
+ console.log(`Re-indexed ${store.name}`);
277
+ }
278
+ },
279
+ (error) => {
280
+ console.error(`Watch error: ${error.message}`);
274
281
  }
275
- });
282
+ );
276
283
  process.on("SIGINT", () => {
277
284
  void (async () => {
278
285
  await watchService.unwatchAll();
@@ -1523,18 +1530,20 @@ Created store: ${result.data.name} (${result.data.id})
1523
1530
  await destroyServices(services);
1524
1531
  }
1525
1532
  if (exitCode !== 0) {
1526
- process.exit(exitCode);
1533
+ process.exitCode = exitCode;
1527
1534
  }
1528
1535
  }
1529
1536
  );
1530
1537
  store.command("info <store>").description("Show store details: ID, type, path/URL, timestamps").action(async (storeIdOrName) => {
1531
1538
  const globalOpts = getOptions();
1532
1539
  const services = await createServices(globalOpts.config, globalOpts.dataDir);
1533
- try {
1540
+ let exitCode = 0;
1541
+ storeInfo: try {
1534
1542
  const s = await services.store.getByIdOrName(storeIdOrName);
1535
1543
  if (s === void 0) {
1536
1544
  console.error(`Error: Store not found: ${storeIdOrName}`);
1537
- process.exit(3);
1545
+ exitCode = 3;
1546
+ break storeInfo;
1538
1547
  }
1539
1548
  if (globalOpts.format === "json") {
1540
1549
  console.log(JSON.stringify(s, null, 2));
@@ -1553,15 +1562,20 @@ Store: ${s.name}`);
1553
1562
  } finally {
1554
1563
  await destroyServices(services);
1555
1564
  }
1565
+ if (exitCode !== 0) {
1566
+ process.exitCode = exitCode;
1567
+ }
1556
1568
  });
1557
1569
  store.command("delete <store>").description("Remove store and its indexed documents from LanceDB").option("-f, --force", "Delete without confirmation prompt").option("-y, --yes", "Alias for --force").action(async (storeIdOrName, options) => {
1558
1570
  const globalOpts = getOptions();
1559
1571
  const services = await createServices(globalOpts.config, globalOpts.dataDir);
1560
- try {
1572
+ let exitCode = 0;
1573
+ storeDelete: try {
1561
1574
  const s = await services.store.getByIdOrName(storeIdOrName);
1562
1575
  if (s === void 0) {
1563
1576
  console.error(`Error: Store not found: ${storeIdOrName}`);
1564
- process.exit(3);
1577
+ exitCode = 3;
1578
+ break storeDelete;
1565
1579
  }
1566
1580
  const skipConfirmation = options.force === true || options.yes === true;
1567
1581
  if (!skipConfirmation) {
@@ -1569,7 +1583,8 @@ Store: ${s.name}`);
1569
1583
  console.error(
1570
1584
  "Error: Use --force or -y to delete without confirmation in non-interactive mode"
1571
1585
  );
1572
- process.exit(1);
1586
+ exitCode = 1;
1587
+ break storeDelete;
1573
1588
  }
1574
1589
  const readline = await import("readline");
1575
1590
  const rl = readline.createInterface({
@@ -1582,7 +1597,7 @@ Store: ${s.name}`);
1582
1597
  rl.close();
1583
1598
  if (answer.toLowerCase() !== "y" && answer.toLowerCase() !== "yes") {
1584
1599
  console.log("Cancelled.");
1585
- process.exit(0);
1600
+ break storeDelete;
1586
1601
  }
1587
1602
  }
1588
1603
  const result = await services.store.delete(s.id);
@@ -1590,11 +1605,14 @@ Store: ${s.name}`);
1590
1605
  console.log(`Deleted store: ${s.name}`);
1591
1606
  } else {
1592
1607
  console.error(`Error: ${result.error.message}`);
1593
- process.exit(1);
1608
+ exitCode = 1;
1594
1609
  }
1595
1610
  } finally {
1596
1611
  await destroyServices(services);
1597
1612
  }
1613
+ if (exitCode !== 0) {
1614
+ process.exitCode = exitCode;
1615
+ }
1598
1616
  });
1599
1617
  return store;
1600
1618
  }