agentforge-multi 0.1.7 → 0.1.9
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/agentforge +15 -0
- package/package.json +1 -1
- package/scripts/postinstall.js +20 -16
package/agentforge
CHANGED
|
@@ -332,6 +332,7 @@ SLASH_COMMANDS = [
|
|
|
332
332
|
("/mode code", "코딩 모드로 전환"),
|
|
333
333
|
("/mode research", "연구 모드로 전환"),
|
|
334
334
|
("/eval-every <N>", "N번마다 Evaluator 실행"),
|
|
335
|
+
("/dir <path>", "작업 디렉토리 변경"),
|
|
335
336
|
("/status", "현재 설정 확인"),
|
|
336
337
|
("/help", "커맨드 목록 표시"),
|
|
337
338
|
]
|
|
@@ -1587,6 +1588,20 @@ def main():
|
|
|
1587
1588
|
except ValueError:
|
|
1588
1589
|
console.print("[red]숫자를 입력하세요. 예: /eval-every 3[/red]")
|
|
1589
1590
|
|
|
1591
|
+
elif cmd_name == 'dir':
|
|
1592
|
+
if not cmd_arg:
|
|
1593
|
+
console.print(f"현재 작업 디렉토리: [cyan]{workdir}[/cyan]")
|
|
1594
|
+
console.print("[dim]변경: /dir <경로> 예) /dir ~/AgentForge[/dim]")
|
|
1595
|
+
else:
|
|
1596
|
+
new_dir = Path(cmd_arg).expanduser().resolve()
|
|
1597
|
+
if not new_dir.exists():
|
|
1598
|
+
console.print(f"[red]존재하지 않는 경로: {new_dir}[/red]")
|
|
1599
|
+
elif not new_dir.is_dir():
|
|
1600
|
+
console.print(f"[red]디렉토리가 아닙니다: {new_dir}[/red]")
|
|
1601
|
+
else:
|
|
1602
|
+
workdir = str(new_dir)
|
|
1603
|
+
console.print(f"[cyan]작업 디렉토리 변경: {workdir}[/cyan]")
|
|
1604
|
+
|
|
1590
1605
|
elif cmd_name == 'status':
|
|
1591
1606
|
console.print(f"모드: [cyan]{current_mode}[/cyan] | eval-every: [cyan]{eval_every}[/cyan] | dir: [cyan]{workdir}[/cyan]")
|
|
1592
1607
|
|
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}`);
|