recursive-llm-ts 1.0.1 → 1.0.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/README.md +7 -1
- package/package.json +4 -2
- package/scripts/install-python-deps.js +30 -0
package/README.md
CHANGED
|
@@ -8,7 +8,13 @@ TypeScript bridge for [recursive-llm](https://github.com/grigori-gvadzabia/recur
|
|
|
8
8
|
npm install recursive-llm-ts
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### Prerequisites
|
|
12
|
+
|
|
13
|
+
- **Node.js** (not Bun) - This package uses `pythonia` which requires Node.js internals
|
|
14
|
+
- **Python 3.9+** - Required for the underlying recursive-llm Python package
|
|
15
|
+
- **pip** - Python package manager
|
|
16
|
+
|
|
17
|
+
**Python dependencies are automatically installed** via the `postinstall` script when you `npm install`. The script will run `pip install -e` on the bundled Python package, installing `litellm`, `RestrictedPython`, and other dependencies.
|
|
12
18
|
|
|
13
19
|
## Usage
|
|
14
20
|
|
package/package.json
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "recursive-llm-ts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "TypeScript bridge for recursive-llm: Recursive Language Models for unbounded context processing",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
9
|
"recursive-llm/src",
|
|
10
|
-
"recursive-llm/pyproject.toml"
|
|
10
|
+
"recursive-llm/pyproject.toml",
|
|
11
|
+
"scripts/install-python-deps.js"
|
|
11
12
|
],
|
|
12
13
|
"scripts": {
|
|
13
14
|
"build": "tsc",
|
|
15
|
+
"postinstall": "node scripts/install-python-deps.js",
|
|
14
16
|
"prepublishOnly": "npm run build",
|
|
15
17
|
"release": "./scripts/release.sh",
|
|
16
18
|
"start": "ts-node test/test.ts",
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { execSync } = require('child_process');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
|
|
6
|
+
const pythonPackagePath = path.join(__dirname, '..', 'recursive-llm');
|
|
7
|
+
const pyprojectPath = path.join(pythonPackagePath, 'pyproject.toml');
|
|
8
|
+
|
|
9
|
+
// Check if pyproject.toml exists
|
|
10
|
+
if (!fs.existsSync(pyprojectPath)) {
|
|
11
|
+
console.error('Error: pyproject.toml not found at', pyprojectPath);
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
console.log('Installing Python dependencies for recursive-llm...');
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
// Install the Python package in editable mode
|
|
19
|
+
execSync(`pip install -e "${pythonPackagePath}"`, {
|
|
20
|
+
stdio: 'inherit',
|
|
21
|
+
cwd: pythonPackagePath
|
|
22
|
+
});
|
|
23
|
+
console.log('✓ Python dependencies installed successfully');
|
|
24
|
+
} catch (error) {
|
|
25
|
+
console.error('Failed to install Python dependencies.');
|
|
26
|
+
console.error('Please ensure Python 3.9+ and pip are installed.');
|
|
27
|
+
console.error('You can manually install by running:');
|
|
28
|
+
console.error(` cd ${pythonPackagePath} && pip install -e .`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|