@silbaram/artifact-driven-agent 0.1.3 → 0.1.4
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/src/commands/run.js +66 -11
package/package.json
CHANGED
package/src/commands/run.js
CHANGED
|
@@ -86,6 +86,11 @@ export async function run(role, tool) {
|
|
|
86
86
|
// 시스템 프롬프트 생성
|
|
87
87
|
const systemPrompt = buildSystemPrompt(workspace, role, roleContent);
|
|
88
88
|
|
|
89
|
+
// 시스템 프롬프트를 파일로 저장 (AI 도구가 읽을 수 있도록)
|
|
90
|
+
const promptFile = path.join(sessionDir, 'system-prompt.md');
|
|
91
|
+
fs.writeFileSync(promptFile, systemPrompt, 'utf-8');
|
|
92
|
+
logMessage('INFO', `시스템 프롬프트 저장: ${promptFile}`);
|
|
93
|
+
|
|
89
94
|
// 다른 활성 세션 확인
|
|
90
95
|
const activeSessions = getActiveSessions().filter(s => s.sessionId !== sessionId);
|
|
91
96
|
const pendingQuestions = getPendingQuestions();
|
|
@@ -122,7 +127,7 @@ export async function run(role, tool) {
|
|
|
122
127
|
|
|
123
128
|
// 도구별 실행
|
|
124
129
|
try {
|
|
125
|
-
await launchTool(tool, systemPrompt, logMessage);
|
|
130
|
+
await launchTool(tool, systemPrompt, promptFile, logMessage);
|
|
126
131
|
|
|
127
132
|
// 세션 완료 처리
|
|
128
133
|
sessionInfo.status = 'completed';
|
|
@@ -332,38 +337,88 @@ function buildSystemPrompt(workspace, role, roleContent) {
|
|
|
332
337
|
return prompt;
|
|
333
338
|
}
|
|
334
339
|
|
|
335
|
-
async function launchTool(tool, systemPrompt, logMessage) {
|
|
340
|
+
async function launchTool(tool, systemPrompt, promptFile, logMessage) {
|
|
341
|
+
// 프롬프트 파일의 상대 경로 (작업 디렉토리 기준)
|
|
342
|
+
const relativePromptPath = path.relative(process.cwd(), promptFile);
|
|
343
|
+
|
|
344
|
+
// 도구별 설정
|
|
336
345
|
const commands = {
|
|
337
|
-
claude: {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
346
|
+
claude: {
|
|
347
|
+
cmd: 'claude',
|
|
348
|
+
args: ['--system-prompt-file', promptFile],
|
|
349
|
+
automation: 'perfect'
|
|
350
|
+
},
|
|
351
|
+
gemini: {
|
|
352
|
+
cmd: 'gemini',
|
|
353
|
+
args: ['-i', `@${relativePromptPath}`],
|
|
354
|
+
automation: 'perfect'
|
|
355
|
+
},
|
|
356
|
+
codex: {
|
|
357
|
+
cmd: 'codex',
|
|
358
|
+
args: [],
|
|
359
|
+
automation: 'manual',
|
|
360
|
+
instruction: `@${relativePromptPath}`
|
|
361
|
+
},
|
|
362
|
+
copilot: {
|
|
363
|
+
cmd: 'gh',
|
|
364
|
+
args: ['copilot'],
|
|
365
|
+
automation: 'manual',
|
|
366
|
+
instruction: `@${relativePromptPath}`
|
|
367
|
+
}
|
|
341
368
|
};
|
|
342
369
|
|
|
343
|
-
const
|
|
370
|
+
const config = commands[tool];
|
|
371
|
+
const { cmd, args } = config;
|
|
344
372
|
|
|
345
373
|
// 도구 존재 확인
|
|
346
374
|
const which = spawn('which', [cmd], { shell: true });
|
|
347
|
-
|
|
375
|
+
|
|
348
376
|
return new Promise((resolve, reject) => {
|
|
349
377
|
which.on('close', (code) => {
|
|
350
378
|
if (code !== 0) {
|
|
351
379
|
console.log(chalk.yellow(`⚠️ ${tool} CLI가 설치되어 있지 않습니다.`));
|
|
352
380
|
console.log('');
|
|
353
|
-
console.log(chalk.white('시스템
|
|
381
|
+
console.log(chalk.white('시스템 프롬프트가 다음 파일에 저장되었습니다:'));
|
|
382
|
+
console.log(chalk.cyan(` ${relativePromptPath}`));
|
|
383
|
+
console.log('');
|
|
354
384
|
console.log(chalk.gray('─'.repeat(60)));
|
|
355
385
|
console.log(systemPrompt);
|
|
356
386
|
console.log(chalk.gray('─'.repeat(60)));
|
|
357
387
|
console.log('');
|
|
358
|
-
console.log(chalk.gray('위 내용을 복사하여 AI 도구에
|
|
388
|
+
console.log(chalk.gray('위 내용을 복사하여 AI 도구에 붙여넣거나, 파일을 읽도록 하세요.'));
|
|
359
389
|
logMessage('WARN', `${tool} CLI not found, prompt displayed`);
|
|
360
390
|
resolve();
|
|
361
391
|
return;
|
|
362
392
|
}
|
|
363
393
|
|
|
394
|
+
// 도구별 안내 메시지
|
|
395
|
+
console.log('');
|
|
396
|
+
if (config.automation === 'perfect') {
|
|
397
|
+
// 완전 자동화: 간단한 성공 메시지
|
|
398
|
+
console.log(chalk.green('━'.repeat(60)));
|
|
399
|
+
console.log(chalk.green.bold('✓ 역할이 자동으로 설정됩니다'));
|
|
400
|
+
console.log(chalk.green('━'.repeat(60)));
|
|
401
|
+
console.log('');
|
|
402
|
+
console.log(chalk.gray(`시스템 프롬프트: ${relativePromptPath}`));
|
|
403
|
+
console.log('');
|
|
404
|
+
} else {
|
|
405
|
+
// 수동 입력 필요: 명확한 안내
|
|
406
|
+
console.log(chalk.yellow('━'.repeat(60)));
|
|
407
|
+
console.log(chalk.yellow.bold('⚠️ 중요: AI 도구 시작 후 다음을 입력하세요'));
|
|
408
|
+
console.log(chalk.yellow('━'.repeat(60)));
|
|
409
|
+
console.log('');
|
|
410
|
+
console.log(chalk.cyan.bold(` ${config.instruction}`));
|
|
411
|
+
console.log('');
|
|
412
|
+
console.log(chalk.gray('그 다음 Enter를 눌러 역할을 수행하도록 하세요.'));
|
|
413
|
+
console.log('');
|
|
414
|
+
console.log(chalk.yellow('━'.repeat(60)));
|
|
415
|
+
console.log('');
|
|
416
|
+
}
|
|
417
|
+
|
|
364
418
|
// CLI 실행
|
|
365
419
|
console.log(chalk.green(`✓ ${tool} 실행 중...`));
|
|
366
|
-
|
|
420
|
+
console.log('');
|
|
421
|
+
logMessage('INFO', `${tool} CLI 실행 (automation: ${config.automation})`);
|
|
367
422
|
|
|
368
423
|
const child = spawn(cmd, args, {
|
|
369
424
|
stdio: 'inherit',
|