agentforge-multi 0.1.7 → 0.1.8
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/package.json +1 -1
- package/scripts/postinstall.js +20 -16
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -33,19 +33,25 @@ const pyOk = check('Python 3.10+', () => {
|
|
|
33
33
|
if (ver[0] < 3 || (ver[0] === 3 && ver[1] < 10)) throw new Error('version too low');
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
// 2.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
36
|
+
// 2. Python 패키지 목록
|
|
37
|
+
// import명과 pip 패키지명이 다른 경우(rank_bm25 / rank-bm25 등) 분리
|
|
38
|
+
const pyPackages = [
|
|
39
|
+
{ import: 'rich', pip: 'rich' },
|
|
40
|
+
{ import: 'prompt_toolkit', pip: 'prompt_toolkit' },
|
|
41
|
+
{ import: 'requests', pip: 'requests' },
|
|
42
|
+
{ import: 'rank_bm25', pip: 'rank-bm25' }, // RAG 검색
|
|
43
|
+
{ import: 'tiktoken', pip: 'tiktoken' }, // 토큰 수 계산
|
|
44
|
+
];
|
|
41
45
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
const pkgResults = pyPackages.map(pkg => ({
|
|
47
|
+
...pkg,
|
|
48
|
+
ok: check(`Python package: ${pkg.import}`, () => {
|
|
49
|
+
const r = spawnSync('python3', ['-c', `import ${pkg.import}`], { encoding: 'utf8' });
|
|
50
|
+
if (r.status !== 0) throw new Error();
|
|
51
|
+
}),
|
|
52
|
+
}));
|
|
47
53
|
|
|
48
|
-
//
|
|
54
|
+
// 3. codex CLI
|
|
49
55
|
const codexOk = check('codex CLI', () => {
|
|
50
56
|
const r = spawnSync('which', ['codex'], { encoding: 'utf8' });
|
|
51
57
|
if (r.status !== 0) throw new Error();
|
|
@@ -54,11 +60,9 @@ const codexOk = check('codex CLI', () => {
|
|
|
54
60
|
console.log('─'.repeat(40));
|
|
55
61
|
|
|
56
62
|
// 누락 패키지 자동 설치 시도
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (!richOk) missing.push('rich');
|
|
61
|
-
if (!ptOk) missing.push('prompt_toolkit');
|
|
63
|
+
const missing = pkgResults.filter(p => !p.ok).map(p => p.pip);
|
|
64
|
+
if (missing.length > 0) {
|
|
65
|
+
console.log(`\n${YELLOW}▶ Python 패키지 설치 중: ${missing.join(', ')}${RESET}`);
|
|
62
66
|
try {
|
|
63
67
|
execSync(`pip install ${missing.join(' ')} --quiet`, { stdio: 'inherit' });
|
|
64
68
|
console.log(`${GREEN} ✓ 설치 완료: ${missing.join(', ')}${RESET}`);
|