diff --git a/src/gateway/pty-guard.ts b/src/gateway/pty-guard.ts index 678134e..e4f683c 100644 --- a/src/gateway/pty-guard.ts +++ b/src/gateway/pty-guard.ts @@ -53,6 +53,7 @@ export function resolvePcbCwd(workspace: string | undefined, name: unknown): str export function allowedAutorun(v: unknown): string | null { if (v === 'claude') return 'claude'; if (v === 'claude-chrome') return 'claude --chrome'; + if (v === 'claude-ollama') return 'ollama launch claude'; // ~/.bashrc 의 ollama() 가 launch-claude.sh 로 돌려 컨텍스트 설정까지 넣는다 return null; } diff --git a/tests/pty-workshop-cwd.test.ts b/tests/pty-workshop-cwd.test.ts index 771612b..bf0dd7c 100644 --- a/tests/pty-workshop-cwd.test.ts +++ b/tests/pty-workshop-cwd.test.ts @@ -38,9 +38,10 @@ describe('allowedAutorun', () => { test('claude와 크롬 연동 claude만 허용하고, 입력되는 명령은 고정 문자열이다', () => { assert.equal(allowedAutorun('claude'), 'claude'); assert.equal(allowedAutorun('claude-chrome'), 'claude --chrome'); + assert.equal(allowedAutorun('claude-ollama'), 'ollama launch claude'); }); test('그 밖의 명령·주입 시도는 모두 null', () => { - for (const bad of ['rm -rf /', 'claude; id', 'claude && ls', 'claude --chrome', 'claude-chrome; id', 'bash', '', undefined, 1, ['claude']]) { + for (const bad of ['rm -rf /', 'claude; id', 'claude && ls', 'claude --chrome', 'claude-chrome; id', 'claude-ollama; id', 'ollama launch claude', 'bash', '', undefined, 1, ['claude']]) { assert.equal(allowedAutorun(bad), null, JSON.stringify(bad)); } }); diff --git a/web-ui/html/pcb-app.html b/web-ui/html/pcb-app.html index 5793dc0..dd35500 100644 --- a/web-ui/html/pcb-app.html +++ b/web-ui/html/pcb-app.html @@ -139,6 +139,7 @@ details{margin-bottom:6px}summary{cursor:pointer;font-weight:700;font-size:12.5p + diff --git a/web-ui/html/workshop-app.html b/web-ui/html/workshop-app.html index 3bf868b..438e3b4 100644 --- a/web-ui/html/workshop-app.html +++ b/web-ui/html/workshop-app.html @@ -146,6 +146,7 @@ + diff --git a/web-ui/js/app/workshop-console.js b/web-ui/js/app/workshop-console.js index c0b038e..4cbeac3 100644 --- a/web-ui/js/app/workshop-console.js +++ b/web-ui/js/app/workshop-console.js @@ -85,10 +85,10 @@ async function consoleStart(mode) { consoleShellId = 'wsc_' + Date.now().toString(36); consoleTerm.reset(); consoleRefit(); - const autorun = mode === 'claude' ? 'claude' : mode === 'claude-chrome' ? 'claude-chrome' : null; + const autorun = (mode === 'claude' || mode === 'claude-chrome' || mode === 'claude-ollama') ? mode : null; consoleSend({ type: 'pty_spawn', shellId: consoleShellId, cols: consoleTerm.cols, rows: consoleTerm.rows, ...(proj.pcb ? { pcbProject: proj.name } : { workshopProjectId: proj.id }), ...(autorun ? { autorun } : {}) }); - consoleStatus((mode === 'claude' ? 'Claude Code' : mode === 'claude-chrome' ? 'Claude Code + 크롬' : '셸') + ' 실행 중 — ' + proj.name, '#22c55e'); + consoleStatus((mode === 'claude' ? 'Claude Code' : mode === 'claude-chrome' ? 'Claude Code + 크롬' : mode === 'claude-ollama' ? 'Claude Code (올라마 모델)' : '셸') + ' 실행 중 — ' + proj.name, '#22c55e'); consoleTerm.focus(); } const CONSOLE_HINT = '\x1b[90m▶ claude 시작을 누르면 이 프로젝트 폴더에서 Claude Code가 실행됩니다.\x1b[0m\r\n';