@kovalenko-tech/cortex-ai 0.1.0
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 +15 -0
- package/bin/cortex.js +35 -0
- package/bin/install.js +11 -0
- package/package.json +29 -0
package/README.md
ADDED
package/bin/cortex.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { execSync, spawnSync } = require('child_process');
|
|
3
|
+
|
|
4
|
+
function findPython() {
|
|
5
|
+
for (const cmd of ['python3.11', 'python3.12', 'python3.13', 'python3', 'python']) {
|
|
6
|
+
try {
|
|
7
|
+
execSync(`${cmd} -c "import sys; exit(0 if sys.version_info >= (3,11) else 1)"`, { stdio: 'pipe' });
|
|
8
|
+
return cmd;
|
|
9
|
+
} catch {}
|
|
10
|
+
}
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function isCortexInstalled(python) {
|
|
15
|
+
try { execSync(`${python} -m cortex --version`, { stdio: 'pipe' }); return true; } catch { return false; }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function installCortex(python) {
|
|
19
|
+
console.log('Installing cortex...');
|
|
20
|
+
try {
|
|
21
|
+
execSync(`${python} -m pip install git+https://github.com/kovalenko-tech/cortex.git --quiet`, { stdio: 'inherit' });
|
|
22
|
+
return true;
|
|
23
|
+
} catch { return false; }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const python = findPython();
|
|
27
|
+
if (!python) {
|
|
28
|
+
console.error('Error: Python 3.11+ is required. Install from https://python.org/downloads');
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
if (!isCortexInstalled(python)) {
|
|
32
|
+
if (!installCortex(python)) { console.error('Error: Failed to install cortex.'); process.exit(1); }
|
|
33
|
+
}
|
|
34
|
+
const result = spawnSync(python, ['-m', 'cortex', ...process.argv.slice(2)], { stdio: 'inherit', env: process.env });
|
|
35
|
+
process.exit(result.status || 0);
|
package/bin/install.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { execSync } = require('child_process');
|
|
3
|
+
function findPython() {
|
|
4
|
+
for (const cmd of ['python3.11', 'python3.12', 'python3.13', 'python3', 'python']) {
|
|
5
|
+
try { execSync(`${cmd} -c "import sys; exit(0 if sys.version_info >= (3,11) else 1)"`, { stdio: 'pipe' }); return cmd; } catch {}
|
|
6
|
+
}
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
if (!findPython()) {
|
|
10
|
+
console.warn('\n⚠️ cortex-ai: Python 3.11+ not found. Install from https://python.org/downloads\n');
|
|
11
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kovalenko-tech/cortex-ai",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Project knowledge base for Claude Code",
|
|
5
|
+
"bin": {
|
|
6
|
+
"cortex": "./bin/cortex.js",
|
|
7
|
+
"cortex-ai": "./bin/cortex.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"postinstall": "node bin/install.js"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [
|
|
13
|
+
"claude",
|
|
14
|
+
"claude-code",
|
|
15
|
+
"ai",
|
|
16
|
+
"context",
|
|
17
|
+
"codebase"
|
|
18
|
+
],
|
|
19
|
+
"author": "Kyrylo Kovalenko",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/kovalenko-tech/cortex"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://kovalenko-tech.github.io/cortex/",
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=16"
|
|
28
|
+
}
|
|
29
|
+
}
|