bluera-knowledge 0.13.2 → 0.13.3

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,7 +3,7 @@ import {
3
3
  createLogger,
4
4
  summarizePayload,
5
5
  truncateForLog
6
- } from "./chunk-6ZVW2P2F.js";
6
+ } from "./chunk-AJI5DCKY.js";
7
7
 
8
8
  // src/crawl/intelligent-crawler.ts
9
9
  import { EventEmitter } from "events";
@@ -753,4 +753,4 @@ var IntelligentCrawler = class extends EventEmitter {
753
753
  export {
754
754
  IntelligentCrawler
755
755
  };
756
- //# sourceMappingURL=chunk-GCUKVV33.js.map
756
+ //# sourceMappingURL=chunk-AOSDVRRH.js.map
@@ -7,7 +7,7 @@ import {
7
7
  createStoreId,
8
8
  destroyServices,
9
9
  summarizePayload
10
- } from "./chunk-6ZVW2P2F.js";
10
+ } from "./chunk-AJI5DCKY.js";
11
11
 
12
12
  // src/mcp/server.ts
13
13
  import { Server } from "@modelcontextprotocol/sdk/server/index.js";
@@ -2151,4 +2151,4 @@ export {
2151
2151
  createMCPServer,
2152
2152
  runMCPServer
2153
2153
  };
2154
- //# sourceMappingURL=chunk-H5AKKHY7.js.map
2154
+ //# sourceMappingURL=chunk-XL2UHMBL.js.map
package/dist/index.js CHANGED
@@ -7,10 +7,10 @@ import {
7
7
  isWebStoreDefinition,
8
8
  runMCPServer,
9
9
  spawnBackgroundWorker
10
- } from "./chunk-H5AKKHY7.js";
10
+ } from "./chunk-XL2UHMBL.js";
11
11
  import {
12
12
  IntelligentCrawler
13
- } from "./chunk-GCUKVV33.js";
13
+ } from "./chunk-AOSDVRRH.js";
14
14
  import {
15
15
  ASTParser,
16
16
  AdapterRegistry,
@@ -24,7 +24,7 @@ import {
24
24
  err,
25
25
  extractRepoName,
26
26
  ok
27
- } from "./chunk-6ZVW2P2F.js";
27
+ } from "./chunk-AJI5DCKY.js";
28
28
  import "./chunk-HRQD3MPH.js";
29
29
 
30
30
  // src/index.ts
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createMCPServer,
3
3
  runMCPServer
4
- } from "../chunk-H5AKKHY7.js";
5
- import "../chunk-6ZVW2P2F.js";
4
+ } from "../chunk-XL2UHMBL.js";
5
+ import "../chunk-AJI5DCKY.js";
6
6
  import "../chunk-HRQD3MPH.js";
7
7
  export {
8
8
  createMCPServer,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  IntelligentCrawler
4
- } from "../chunk-GCUKVV33.js";
4
+ } from "../chunk-AOSDVRRH.js";
5
5
  import {
6
6
  JobService,
7
7
  createDocumentId,
@@ -10,7 +10,7 @@ import {
10
10
  createStoreId,
11
11
  destroyServices,
12
12
  shutdownLogger
13
- } from "../chunk-6ZVW2P2F.js";
13
+ } from "../chunk-AJI5DCKY.js";
14
14
  import "../chunk-HRQD3MPH.js";
15
15
 
16
16
  // src/workers/background-worker-cli.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluera-knowledge",
3
- "version": "0.13.2",
3
+ "version": "0.13.3",
4
4
  "description": "CLI tool for managing knowledge stores with semantic search",
5
5
  "type": "module",
6
6
  "bin": {
@@ -78,7 +78,7 @@ describe('PythonBridge', () => {
78
78
 
79
79
  expect(spawn).toHaveBeenCalledWith(
80
80
  'python3',
81
- ['python/crawl_worker.py'],
81
+ [expect.stringMatching(/.*\/python\/crawl_worker\.py$/)],
82
82
  expect.objectContaining({
83
83
  stdio: ['pipe', 'pipe', 'pipe'],
84
84
  })
@@ -1,6 +1,8 @@
1
1
  import { spawn, type ChildProcess } from 'node:child_process';
2
2
  import { randomUUID } from 'node:crypto';
3
+ import path from 'node:path';
3
4
  import { createInterface, type Interface as ReadlineInterface } from 'node:readline';
5
+ import { fileURLToPath } from 'node:url';
4
6
  import { ZodError } from 'zod';
5
7
  import {
6
8
  type CrawlResult,
@@ -37,9 +39,30 @@ export class PythonBridge {
37
39
  start(): Promise<void> {
38
40
  if (this.process) return Promise.resolve();
39
41
 
40
- logger.debug('Starting Python bridge process');
42
+ // Compute absolute path to Python worker using import.meta.url
43
+ // This works both in development (src/) and production (dist/)
44
+ const currentFilePath = fileURLToPath(import.meta.url);
45
+ const isProduction = currentFilePath.includes('/dist/');
46
+
47
+ let pythonWorkerPath: string;
48
+ if (isProduction) {
49
+ // Production: Find dist dir and go to sibling python/ directory
50
+ const distIndex = currentFilePath.indexOf('/dist/');
51
+ const pluginRoot = currentFilePath.substring(0, distIndex);
52
+ pythonWorkerPath = path.join(pluginRoot, 'python', 'crawl_worker.py');
53
+ } else {
54
+ // Development: Go up from src/crawl to find python/
55
+ const srcDir = path.dirname(path.dirname(currentFilePath));
56
+ const projectRoot = path.dirname(srcDir);
57
+ pythonWorkerPath = path.join(projectRoot, 'python', 'crawl_worker.py');
58
+ }
59
+
60
+ logger.debug(
61
+ { pythonWorkerPath, currentFilePath, isProduction },
62
+ 'Starting Python bridge process'
63
+ );
41
64
 
42
- this.process = spawn('python3', ['python/crawl_worker.py'], {
65
+ this.process = spawn('python3', [pythonWorkerPath], {
43
66
  stdio: ['pipe', 'pipe', 'pipe'],
44
67
  });
45
68