research-copilot 0.1.0 → 0.1.1

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 (3) hide show
  1. package/README.md +0 -9
  2. package/bin/cli.mjs +21 -14
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -88,19 +88,10 @@ Attach files directly in the chat input via the paperclip button, drag & drop, o
88
88
  ### Option A: Install via npm (recommended)
89
89
 
90
90
  ```bash
91
- # Install globally
92
91
  npm install -g research-copilot
93
-
94
- # Launch
95
92
  research-copilot
96
93
  ```
97
94
 
98
- Or run directly without installing:
99
-
100
- ```bash
101
- npx research-copilot
102
- ```
103
-
104
95
  ### Option B: Clone from source
105
96
 
106
97
  ```bash
package/bin/cli.mjs CHANGED
@@ -4,7 +4,6 @@
4
4
  * CLI entry point for Research Copilot.
5
5
  *
6
6
  * Usage:
7
- * npx research-copilot # Run directly
8
7
  * npm i -g research-copilot # Install globally
9
8
  * research-copilot # Then run anywhere
10
9
  */
@@ -19,15 +18,17 @@ const __filename = fileURLToPath(import.meta.url)
19
18
  const __dirname = dirname(__filename)
20
19
  const require = createRequire(import.meta.url)
21
20
 
22
- // Resolve the Electron binary from this package's node_modules
21
+ // Resolve the Electron binary
23
22
  let electronPath
24
23
  try {
25
- electronPath = require('electron')
24
+ electronPath = String(require('electron'))
26
25
  } catch {
27
- console.error(
28
- 'Error: Electron is not installed.\n' +
29
- 'Run: npm install\n'
30
- )
26
+ console.error('Error: Electron is not installed. Run: npm install')
27
+ process.exit(1)
28
+ }
29
+
30
+ if (!existsSync(electronPath)) {
31
+ console.error(`Error: Electron binary not found at ${electronPath}`)
31
32
  process.exit(1)
32
33
  }
33
34
 
@@ -36,21 +37,27 @@ const appDir = join(__dirname, '..', 'app')
36
37
  const mainEntry = join(appDir, 'out', 'main', 'index.mjs')
37
38
 
38
39
  if (!existsSync(mainEntry)) {
39
- console.error(
40
- 'Error: App has not been built yet.\n' +
41
- 'Run: npm run build\n'
42
- )
40
+ console.error(`Error: App not built. Expected: ${mainEntry}`)
43
41
  process.exit(1)
44
42
  }
45
43
 
44
+ console.log('Starting Research Copilot...')
45
+
46
46
  // Launch Electron with the app directory
47
- const child = spawn(String(electronPath), [appDir], {
48
- stdio: 'inherit',
47
+ const child = spawn(electronPath, [appDir], {
48
+ stdio: ['inherit', 'inherit', 'inherit'],
49
49
  env: { ...process.env },
50
50
  })
51
51
 
52
- child.on('close', (code) => process.exit(code ?? 0))
52
+ child.on('close', (code) => {
53
+ process.exit(code ?? 0)
54
+ })
55
+
53
56
  child.on('error', (err) => {
54
57
  console.error('Failed to start Electron:', err.message)
55
58
  process.exit(1)
56
59
  })
60
+
61
+ // Forward signals to Electron
62
+ process.on('SIGINT', () => child.kill('SIGINT'))
63
+ process.on('SIGTERM', () => child.kill('SIGTERM'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "research-copilot",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "AI-powered research assistant for scientists — literature search, data analysis, academic writing, and project management",
5
5
  "type": "module",
6
6
  "bin": {