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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentforge-multi",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Multi-agent CLI: Worker + Evaluator agents collaborate in a loop to achieve your goal",
5
5
  "keywords": [
6
6
  "ai",
@@ -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. rich
37
- const richOk = check('Python package: rich', () => {
38
- const r = spawnSync('python3', ['-c', 'import rich'], { encoding: 'utf8' });
39
- if (r.status !== 0) throw new Error();
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
- // 3. prompt_toolkit
43
- const ptOk = check('Python package: prompt_toolkit', () => {
44
- const r = spawnSync('python3', ['-c', 'import prompt_toolkit'], { encoding: 'utf8' });
45
- if (r.status !== 0) throw new Error();
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
- // 4. codex CLI
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
- if (!richOk || !ptOk) {
58
- console.log(`\n${YELLOW}▶ Python 패키지 설치 중...${RESET}`);
59
- const missing = [];
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}`);