bluera-knowledge 0.9.25 → 0.9.26

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluera-knowledge",
3
- "version": "0.9.25",
3
+ "version": "0.9.26",
4
4
  "description": "Clone repos, crawl docs, search locally. Fast, authoritative answers for AI coding agents without web lookups.",
5
5
  "author": {
6
6
  "name": "Bluera Inc",
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
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.9.26](https://github.com/blueraai/bluera-knowledge/compare/v0.9.25...v0.9.26) (2026-01-06)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **tests:** make spawn-worker tests more robust ([05e3127](https://github.com/blueraai/bluera-knowledge/commit/05e312748d250592df1ce23395006954907f5387))
11
+
5
12
  ## [0.9.25](https://github.com/blueraai/bluera-knowledge/compare/v0.9.23...v0.9.25) (2026-01-06)
6
13
 
7
14
 
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # 🧠 Bluera Knowledge
2
2
 
3
3
  [![CI](https://github.com/blueraai/bluera-knowledge/actions/workflows/ci.yml/badge.svg)](https://github.com/blueraai/bluera-knowledge/actions/workflows/ci.yml)
4
- ![Version](https://img.shields.io/badge/version-0.9.25-blue)
4
+ ![Version](https://img.shields.io/badge/version-0.9.26-blue)
5
5
  ![License](https://img.shields.io/badge/license-MIT-green)
6
6
  ![Node](https://img.shields.io/badge/node-%3E%3D20-brightgreen)
7
7
  ![Python](https://img.shields.io/badge/python-%3E%3D3.8-blue)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bluera-knowledge",
3
- "version": "0.9.25",
3
+ "version": "0.9.26",
4
4
  "description": "CLI tool for managing knowledge stores with semantic search",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,27 +22,26 @@ describe('spawnBackgroundWorker', () => {
22
22
  it('should use tsx in development mode (src folder)', () => {
23
23
  spawnBackgroundWorker('test-job', '/test/data');
24
24
 
25
- const callArgs = mockSpawn.mock.calls[0];
26
- const command = callArgs?.[0];
27
- const args = callArgs?.[1];
25
+ expect(mockSpawn).toHaveBeenCalledTimes(1);
26
+ const [command, args] = mockSpawn.mock.calls[0] as [string, string[], object];
28
27
 
29
28
  // In development (src folder), should use npx tsx
30
29
  expect(command).toBe('npx');
31
- expect(args?.[0]).toBe('tsx');
30
+ expect(args[0]).toBe('tsx');
32
31
  });
33
32
 
34
33
  it('should spawn a background worker process', () => {
35
34
  spawnBackgroundWorker('test-job-id', '/test/data/dir');
36
35
 
37
- expect(mockSpawn).toHaveBeenCalled();
38
- expect(mockUnref).toHaveBeenCalled();
36
+ expect(mockSpawn).toHaveBeenCalledTimes(1);
37
+ expect(mockUnref).toHaveBeenCalledTimes(1);
39
38
  });
40
39
 
41
40
  it('should pass job ID as argument', () => {
42
41
  spawnBackgroundWorker('my-job-123', '/test/data/dir');
43
42
 
44
- const callArgs = mockSpawn.mock.calls[0];
45
- const args = callArgs?.[1];
43
+ expect(mockSpawn).toHaveBeenCalledTimes(1);
44
+ const [, args] = mockSpawn.mock.calls[0] as [string, string[], object];
46
45
 
47
46
  expect(args).toContain('my-job-123');
48
47
  });
@@ -50,8 +49,8 @@ describe('spawnBackgroundWorker', () => {
50
49
  it('should spawn detached process with ignored stdio', () => {
51
50
  spawnBackgroundWorker('test-job', '/test/data/dir');
52
51
 
53
- const callArgs = mockSpawn.mock.calls[0];
54
- const options = callArgs?.[2];
52
+ expect(mockSpawn).toHaveBeenCalledTimes(1);
53
+ const [, , options] = mockSpawn.mock.calls[0] as [string, string[], { detached: boolean; stdio: string }];
55
54
 
56
55
  expect(options).toMatchObject({
57
56
  detached: true,
@@ -63,10 +62,10 @@ describe('spawnBackgroundWorker', () => {
63
62
  const dataDir = '/custom/data/directory';
64
63
  spawnBackgroundWorker('test-job', dataDir);
65
64
 
66
- const callArgs = mockSpawn.mock.calls[0];
67
- const options = callArgs?.[2];
65
+ expect(mockSpawn).toHaveBeenCalledTimes(1);
66
+ const [, , options] = mockSpawn.mock.calls[0] as [string, string[], { env: Record<string, string> }];
68
67
 
69
- expect(options?.env).toMatchObject({
68
+ expect(options.env).toMatchObject({
70
69
  ...process.env,
71
70
  BLUERA_DATA_DIR: dataDir
72
71
  });
@@ -76,10 +75,10 @@ describe('spawnBackgroundWorker', () => {
76
75
  const testDataDir = '.bluera/bluera-knowledge/data';
77
76
  spawnBackgroundWorker('job-456', testDataDir);
78
77
 
79
- const callArgs = mockSpawn.mock.calls[0];
80
- const options = callArgs?.[2];
78
+ expect(mockSpawn).toHaveBeenCalledTimes(1);
79
+ const [, , options] = mockSpawn.mock.calls[0] as [string, string[], { env: Record<string, string> }];
81
80
 
82
- expect(options?.env?.BLUERA_DATA_DIR).toBe(testDataDir);
81
+ expect(options.env.BLUERA_DATA_DIR).toBe(testDataDir);
83
82
  });
84
83
  });
85
84
 
@@ -116,13 +115,12 @@ describe('spawnBackgroundWorker (production mode)', () => {
116
115
 
117
116
  spawnProd('test-job', '/test/data');
118
117
 
119
- const callArgs = mockSpawnProd.mock.calls[0];
120
- const command = callArgs?.[0];
121
- const args = callArgs?.[1];
118
+ expect(mockSpawnProd).toHaveBeenCalledTimes(1);
119
+ const [command, args] = mockSpawnProd.mock.calls[0] as [string, string[]];
122
120
 
123
121
  // In production (dist folder), should use Node.js directly
124
122
  expect(command).toBe(process.execPath);
125
- expect(args?.[0]).toContain('background-worker-cli.js');
126
- expect(args?.[1]).toBe('test-job');
123
+ expect(args[0]).toContain('background-worker-cli.js');
124
+ expect(args[1]).toBe('test-job');
127
125
  });
128
126
  });