recursive-llm-ts 2.0.4 → 2.0.5
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/README.md +3 -3
- package/package.json +1 -1
- package/scripts/install-python-deps.js +24 -11
package/README.md
CHANGED
|
@@ -16,15 +16,15 @@ npm install recursive-llm-ts
|
|
|
16
16
|
|
|
17
17
|
### Python Dependencies
|
|
18
18
|
|
|
19
|
-
**
|
|
19
|
+
Python dependencies are **automatically installed** via the `postinstall` script when you run `npm install` or `bun install`. The script will install `litellm`, `RestrictedPython`, and other required Python packages.
|
|
20
|
+
|
|
21
|
+
If automatic installation fails (e.g., pip not in PATH), you can manually install:
|
|
20
22
|
|
|
21
23
|
```bash
|
|
22
24
|
cd node_modules/recursive-llm-ts/recursive-llm
|
|
23
25
|
pip install -e .
|
|
24
26
|
```
|
|
25
27
|
|
|
26
|
-
This installs `litellm`, `RestrictedPython`, and other required Python packages.
|
|
27
|
-
|
|
28
28
|
#### For Bun Users
|
|
29
29
|
Bunpy is included as a dependency, so no additional installation needed.
|
|
30
30
|
|
package/package.json
CHANGED
|
@@ -8,24 +8,37 @@ const pyprojectPath = path.join(pythonPackagePath, 'pyproject.toml');
|
|
|
8
8
|
|
|
9
9
|
// Check if pyproject.toml exists
|
|
10
10
|
if (!fs.existsSync(pyprojectPath)) {
|
|
11
|
-
console.
|
|
12
|
-
|
|
11
|
+
console.warn('[recursive-llm-ts] Warning: pyproject.toml not found at', pyprojectPath);
|
|
12
|
+
console.warn('[recursive-llm-ts] Python dependencies will need to be installed manually');
|
|
13
|
+
process.exit(0); // Don't fail the install
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
console.log('Installing Python dependencies
|
|
16
|
-
console.log('Note: Python source is vendored with patches pre-applied.');
|
|
16
|
+
console.log('[recursive-llm-ts] Installing Python dependencies...');
|
|
17
17
|
|
|
18
18
|
try {
|
|
19
|
+
// Check if pip is available
|
|
20
|
+
try {
|
|
21
|
+
execSync('pip --version', { stdio: 'pipe' });
|
|
22
|
+
} catch {
|
|
23
|
+
// Try pip3
|
|
24
|
+
execSync('pip3 --version', { stdio: 'pipe' });
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
// Install the Python package in editable mode
|
|
20
|
-
|
|
28
|
+
const pipCommand = process.platform === 'win32'
|
|
29
|
+
? `pip install -e "${pythonPackagePath}"`
|
|
30
|
+
: `pip install -e "${pythonPackagePath}" || pip3 install -e "${pythonPackagePath}"`;
|
|
31
|
+
|
|
32
|
+
execSync(pipCommand, {
|
|
21
33
|
stdio: 'inherit',
|
|
22
34
|
cwd: pythonPackagePath
|
|
23
35
|
});
|
|
24
|
-
console.log('✓ Python dependencies installed successfully');
|
|
36
|
+
console.log('[recursive-llm-ts] ✓ Python dependencies installed successfully');
|
|
25
37
|
} catch (error) {
|
|
26
|
-
console.
|
|
27
|
-
console.
|
|
28
|
-
console.
|
|
29
|
-
console.
|
|
30
|
-
|
|
38
|
+
console.warn('[recursive-llm-ts] Warning: Failed to auto-install Python dependencies');
|
|
39
|
+
console.warn('[recursive-llm-ts] This is not critical - you can install them manually:');
|
|
40
|
+
console.warn(`[recursive-llm-ts] cd node_modules/recursive-llm-ts/recursive-llm && pip install -e .`);
|
|
41
|
+
console.warn('[recursive-llm-ts] Or ensure Python 3.9+ and pip are in your PATH');
|
|
42
|
+
// Don't fail the npm install - exit with 0
|
|
43
|
+
process.exit(0);
|
|
31
44
|
}
|