speiidev 1.4.1 → 1.4.2

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/bin/speiidev.js CHANGED
@@ -1,16 +1,39 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const { spawnSync } = require('child_process');
4
+ const path = require('path');
4
5
  const os = require('os');
5
6
 
6
7
  const isWin = os.platform() === 'win32';
7
8
  const pythonCmd = isWin ? 'python' : 'python3';
8
9
 
9
- // Force pip to bypass cache and pull the latest version of speiidev from PyPI
10
- console.log('🔄 Checking/updating speiidev core engine...');
11
- spawnSync(pythonCmd, ['-m', 'pip', 'install', '--user', '--no-cache-dir', '--upgrade', 'speiidev'], { stdio: 'inherit' });
10
+ // 1. Check Python installation
11
+ const checkPython = spawnSync(pythonCmd, ['--version'], { stdio: 'ignore' });
12
+ if (checkPython.error || checkPython.status !== 0) {
13
+ console.error('❌ Error: Python 3 is required to run speiidev, but it was not found.');
14
+ console.error('💡 Please install Python 3: https://www.python.org/downloads/');
15
+ process.exit(1);
16
+ }
12
17
 
13
- // Launch your Python CLI module entry point
18
+ // 2. Ensure core dependencies (rich, prompt_toolkit) are available
19
+ const checkDeps = spawnSync(pythonCmd, ['-c', 'import rich, prompt_toolkit'], { stdio: 'ignore' });
20
+ if (checkDeps.status !== 0) {
21
+ console.log('📦 Installing required dependencies (rich, prompt_toolkit)...');
22
+ const installResult = spawnSync(pythonCmd, ['-m', 'pip', 'install', 'rich>=13.0.0', 'prompt_toolkit>=3.0.0'], { stdio: 'inherit' });
23
+ if (installResult.status !== 0) {
24
+ // Retry with --break-system-packages / --user for modern PEP 668 managed environments (Homebrew, Ubuntu 24+)
25
+ spawnSync(pythonCmd, ['-m', 'pip', 'install', '--user', '--break-system-packages', 'rich>=13.0.0', 'prompt_toolkit>=3.0.0'], { stdio: 'inherit' });
26
+ }
27
+ }
28
+
29
+ // 3. Resolve bundled Python source code from the npm package
30
+ const srcDir = path.resolve(__dirname, '..', 'src');
14
31
  const args = process.argv.slice(2);
15
- const result = spawnSync(pythonCmd, ['-m', 'autodev.cli', ...args], { stdio: 'inherit' });
16
- process.exit(result.status);
32
+ const env = {
33
+ ...process.env,
34
+ PYTHONPATH: srcDir + (process.env.PYTHONPATH ? path.delimiter + process.env.PYTHONPATH : ''),
35
+ };
36
+
37
+ // 4. Launch the exact bundled code
38
+ const result = spawnSync(pythonCmd, ['-m', 'autodev.cli', ...args], { stdio: 'inherit', env });
39
+ process.exit(result.status !== null ? result.status : 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "speiidev",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "Multi-agent terminal orchestrator wrapper",
5
5
  "author": "Toek Sopanha",
6
6
  "bin": {
@@ -11,4 +11,4 @@ To release a new version, change it in ONE place:
11
11
 
12
12
  """
13
13
 
14
- __version__ = "1.4.1"
14
+ __version__ = "1.4.2"