local-cli-agent 5.0.8 → 5.0.10

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.
Files changed (49) hide show
  1. package/dist/agents/common/sub-agent.d.ts +0 -2
  2. package/dist/agents/common/sub-agent.d.ts.map +1 -1
  3. package/dist/agents/common/sub-agent.js +0 -3
  4. package/dist/agents/common/sub-agent.js.map +1 -1
  5. package/dist/agents/office/powerpoint-create-agent.d.ts.map +1 -1
  6. package/dist/agents/office/powerpoint-create-agent.js +0 -4
  7. package/dist/agents/office/powerpoint-create-agent.js.map +1 -1
  8. package/dist/agents/planner/index.d.ts.map +1 -1
  9. package/dist/agents/planner/index.js +12 -3
  10. package/dist/agents/planner/index.js.map +1 -1
  11. package/dist/constants.d.ts +1 -1
  12. package/dist/constants.d.ts.map +1 -1
  13. package/dist/constants.js +1 -1
  14. package/dist/constants.js.map +1 -1
  15. package/dist/core/llm/llm-client.d.ts.map +1 -1
  16. package/dist/core/llm/llm-client.js +2 -19
  17. package/dist/core/llm/llm-client.js.map +1 -1
  18. package/dist/core/llm/providers.d.ts +0 -1
  19. package/dist/core/llm/providers.d.ts.map +1 -1
  20. package/dist/core/llm/providers.js +0 -10
  21. package/dist/core/llm/providers.js.map +1 -1
  22. package/dist/orchestration/plan-executor.d.ts.map +1 -1
  23. package/dist/orchestration/plan-executor.js +7 -2
  24. package/dist/orchestration/plan-executor.js.map +1 -1
  25. package/dist/pipe/pipe-runner.d.ts +3 -1
  26. package/dist/pipe/pipe-runner.d.ts.map +1 -1
  27. package/dist/pipe/pipe-runner.js +117 -31
  28. package/dist/pipe/pipe-runner.js.map +1 -1
  29. package/dist/prompts/agents/planning.d.ts.map +1 -1
  30. package/dist/prompts/agents/planning.js +52 -23
  31. package/dist/prompts/agents/planning.js.map +1 -1
  32. package/dist/prompts/system/plan-execute.d.ts +1 -1
  33. package/dist/prompts/system/plan-execute.d.ts.map +1 -1
  34. package/dist/prompts/system/plan-execute.js +61 -7
  35. package/dist/prompts/system/plan-execute.js.map +1 -1
  36. package/dist/tools/llm/simple/background-bash-tool.js +1 -1
  37. package/dist/tools/llm/simple/background-bash-tool.js.map +1 -1
  38. package/dist/tools/llm/simple/background-powershell-tool.d.ts.map +1 -1
  39. package/dist/tools/llm/simple/background-powershell-tool.js +11 -14
  40. package/dist/tools/llm/simple/background-powershell-tool.js.map +1 -1
  41. package/dist/tools/llm/simple/read-image-tool.d.ts.map +1 -1
  42. package/dist/tools/llm/simple/read-image-tool.js +0 -1
  43. package/dist/tools/llm/simple/read-image-tool.js.map +1 -1
  44. package/dist/types/index.d.ts +0 -1
  45. package/dist/types/index.d.ts.map +1 -1
  46. package/dist/utils/platform-utils.d.ts.map +1 -1
  47. package/dist/utils/platform-utils.js +2 -1
  48. package/dist/utils/platform-utils.js.map +1 -1
  49. package/package.json +1 -3
@@ -6,6 +6,14 @@ import { setSubAgentToolCallLogger, setSubAgentPhaseLogger } from '../agents/com
6
6
  function log(msg) {
7
7
  process.stderr.write(msg + '\n');
8
8
  }
9
+ function ts() {
10
+ return chalk.gray(`[${new Date().toISOString().slice(11, 23)}]`);
11
+ }
12
+ function truncate(s, max = 1000) {
13
+ if (s.length <= max)
14
+ return s;
15
+ return s.slice(0, max) + chalk.gray(` ...(${s.length - max} chars truncated)`);
16
+ }
9
17
  export class PipeRunner {
10
18
  specific;
11
19
  llmClient = null;
@@ -13,6 +21,7 @@ export class PipeRunner {
13
21
  lastResponse = '';
14
22
  todos = [];
15
23
  prompt = '';
24
+ toolCallTimers = new Map();
16
25
  constructor(specific) {
17
26
  this.specific = specific;
18
27
  this.planExecutor = new PlanExecutor();
@@ -21,18 +30,24 @@ export class PipeRunner {
21
30
  this.prompt = prompt;
22
31
  try {
23
32
  if (this.specific) {
24
- setSubAgentToolCallLogger((_appName, toolName, args, _resultText, success, iteration, totalCalls) => {
25
- const summary = this.summarizeToolArgs(toolName, args);
33
+ setSubAgentToolCallLogger((_appName, toolName, args, resultText, success, iteration, totalCalls) => {
34
+ const summary = this.formatToolArgs(toolName, args);
26
35
  const prefix = ` [${iteration}/${totalCalls}]`;
27
36
  if (success) {
28
- log(chalk.dim(`${prefix} → ${toolName} ${summary}`));
37
+ log(chalk.dim(`${prefix} ${ts()} → ${chalk.blue(toolName)} ${summary}`));
38
+ if (resultText) {
39
+ log(chalk.dim(`${prefix} ← ${truncate(resultText, 500)}`));
40
+ }
29
41
  }
30
42
  else {
31
- log(chalk.red(`${prefix} → ${toolName} ${summary} FAILED`));
43
+ log(chalk.red(`${prefix} ${ts()} → ${toolName} ${summary} FAILED`));
44
+ if (resultText) {
45
+ log(chalk.red(`${prefix} ← ${truncate(resultText, 500)}`));
46
+ }
32
47
  }
33
48
  });
34
49
  setSubAgentPhaseLogger((appName, phase, detail) => {
35
- log(chalk.yellow(` [${appName}:${phase}] ${detail}`));
50
+ log(chalk.yellow(` ${ts()} [${appName}:${phase}] ${detail}`));
36
51
  });
37
52
  }
38
53
  await configManager.initialize();
@@ -41,10 +56,27 @@ export class PipeRunner {
41
56
  process.exit(1);
42
57
  }
43
58
  this.llmClient = createLLMClient();
59
+ if (this.specific) {
60
+ const endpoint = configManager.getCurrentEndpoint();
61
+ const model = configManager.getCurrentModel();
62
+ log(chalk.cyan(`\n${'═'.repeat(80)}`));
63
+ log(chalk.cyan(` Pipe Mode (-ps) | Model: ${model?.name || 'unknown'} | Endpoint: ${endpoint?.name || 'unknown'}`));
64
+ log(chalk.cyan(` Prompt: ${truncate(prompt, 200)}`));
65
+ log(chalk.cyan(`${'═'.repeat(80)}\n`));
66
+ }
44
67
  const messages = [];
45
68
  const isInterruptedRef = { current: false };
46
69
  const callbacks = this.createCallbacks();
70
+ const startTime = Date.now();
47
71
  await this.planExecutor.executeAutoMode(prompt, this.llmClient, messages, this.todos, isInterruptedRef, callbacks);
72
+ if (this.specific) {
73
+ const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
74
+ const completed = this.todos.filter(t => t.status === 'completed').length;
75
+ const failed = this.todos.filter(t => t.status === 'failed').length;
76
+ log(chalk.cyan(`\n${'═'.repeat(80)}`));
77
+ log(chalk.cyan(` Done in ${elapsed}s | TODOs: ${completed} completed, ${failed} failed / ${this.todos.length} total`));
78
+ log(chalk.cyan(`${'═'.repeat(80)}\n`));
79
+ }
48
80
  if (this.lastResponse) {
49
81
  console.log(this.lastResponse);
50
82
  }
@@ -69,29 +101,27 @@ export class PipeRunner {
69
101
  for (const todo of newTodos) {
70
102
  const existing = this.todos.find(t => t.id === todo.id);
71
103
  if (!existing) {
72
- log(chalk.dim(` #${newTodos.indexOf(todo) + 1} ${todo.title}`));
104
+ log(chalk.dim(` ${ts()} #${newTodos.indexOf(todo) + 1} ${todo.title}`));
73
105
  }
74
106
  else if (existing.status !== todo.status) {
75
107
  if (todo.status === 'in_progress') {
76
- log(chalk.cyan(`\n[Executing] #${newTodos.indexOf(todo) + 1} ${todo.title}`));
108
+ log(chalk.cyan(`\n${ts()} ${chalk.bold(`[Executing] #${newTodos.indexOf(todo) + 1} ${todo.title}`)}`));
77
109
  }
78
110
  else if (todo.status === 'completed') {
79
- log(chalk.green(` ✓ ${todo.title}`));
111
+ log(chalk.green(` ${ts()} ✓ ${todo.title}`));
80
112
  }
81
113
  else if (todo.status === 'failed') {
82
- log(chalk.red(` ✗ ${todo.title}`));
114
+ log(chalk.red(` ${ts()} ✗ ${todo.title}`));
83
115
  }
84
116
  }
85
117
  }
86
- if (this.todos.length === 0 && newTodos.length > 0) {
87
- }
88
118
  }
89
119
  this.todos = newTodos;
90
120
  },
91
121
  setCurrentTodoId: () => { },
92
122
  setExecutionPhase: (phase) => {
93
123
  if (this.specific && phase === 'planning') {
94
- log(chalk.yellow('\n[Planning] TODO 생성 중...'));
124
+ log(chalk.yellow(`\n${ts()} [Planning] TODO 생성 중...`));
95
125
  }
96
126
  },
97
127
  setIsInterrupted: () => { },
@@ -113,22 +143,36 @@ export class PipeRunner {
113
143
  this.lastResponse = args['message'];
114
144
  }
115
145
  if (this.specific) {
116
- const summary = this.summarizeToolArgs(toolCall.function.name, args);
117
- log(chalk.dim(` → ${toolCall.function.name} ${summary}`));
146
+ const toolName = toolCall.function.name;
147
+ const formatted = this.formatToolArgs(toolName, args);
148
+ log(` ${ts()} ${chalk.blue('→')} ${chalk.bold(toolName)} ${formatted}`);
149
+ this.toolCallTimers.set(toolCall.id || toolName, Date.now());
118
150
  }
119
151
  }
120
152
  }
121
153
  if (this.specific && msg.role === 'tool') {
122
- const isSuccess = !msg.content?.startsWith('Error:');
123
- if (isSuccess) {
124
- log(chalk.dim(` ← OK`));
154
+ const content = msg.content || '';
155
+ const isError = content.startsWith('Error:') || content.startsWith('error:');
156
+ const toolCallId = msg['tool_call_id'];
157
+ const elapsed = toolCallId && this.toolCallTimers.has(toolCallId)
158
+ ? `${Date.now() - this.toolCallTimers.get(toolCallId)}ms`
159
+ : '';
160
+ if (toolCallId)
161
+ this.toolCallTimers.delete(toolCallId);
162
+ const elapsedStr = elapsed ? chalk.gray(` (${elapsed})`) : '';
163
+ if (isError) {
164
+ log(chalk.red(` ${ts()} ← ERROR${elapsedStr}: ${truncate(content, 500)}`));
125
165
  }
126
166
  else {
127
- log(chalk.red(` ← Error: ${msg.content?.slice(0, 100)}`));
167
+ const preview = this.formatToolResult(content);
168
+ log(chalk.dim(` ${ts()} ← OK${elapsedStr}${preview ? ': ' + preview : ''}`));
128
169
  }
129
170
  }
130
171
  if (msg.role === 'assistant' && !msg.tool_calls && msg.content) {
131
172
  this.lastResponse = msg.content;
173
+ if (this.specific) {
174
+ log(chalk.white(` ${ts()} ${chalk.bold('[Agent Response]')} ${truncate(msg.content, 500)}`));
175
+ }
132
176
  }
133
177
  }
134
178
  previousMessages = newMessages;
@@ -159,7 +203,6 @@ Reply in Korean. No explanation, just the answer.`,
159
203
  },
160
204
  ],
161
205
  temperature: 0.3,
162
- max_tokens: 200,
163
206
  });
164
207
  const answer = response.choices?.[0]?.message?.content?.trim() || '';
165
208
  if (request.options.length > 0) {
@@ -167,37 +210,80 @@ Reply in Korean. No explanation, just the answer.`,
167
210
  const partial = !exact ? request.options.find(o => answer.includes(o) || o.includes(answer)) : undefined;
168
211
  const selected = exact ?? partial ?? request.options[0] ?? '';
169
212
  if (this.specific) {
170
- log(chalk.magenta(` [Auto] Q: ${request.question} → A: ${selected}`));
213
+ log(chalk.magenta(` ${ts()} [Auto] Q: ${request.question} → A: ${selected}`));
171
214
  }
172
215
  return { selectedOption: selected, isOther: false };
173
216
  }
174
217
  if (this.specific) {
175
- log(chalk.magenta(` [Auto] Q: ${request.question} → A: ${answer || 'Yes'}`));
218
+ log(chalk.magenta(` ${ts()} [Auto] Q: ${request.question} → A: ${answer || 'Yes'}`));
176
219
  }
177
220
  return { selectedOption: answer || 'Yes', isOther: true };
178
221
  }
179
222
  catch {
180
223
  const fallback = request.options[0] || 'Yes';
181
224
  if (this.specific) {
182
- log(chalk.magenta(` [Auto] Q: ${request.question} → A: ${fallback} (fallback)`));
225
+ log(chalk.magenta(` ${ts()} [Auto] Q: ${request.question} → A: ${fallback} (fallback)`));
183
226
  }
184
227
  return { selectedOption: fallback, isOther: false };
185
228
  }
186
229
  }
187
- summarizeToolArgs(toolName, args) {
188
- if (toolName === 'bash' && args['command'])
189
- return String(args['command']).slice(0, 80);
190
- if (toolName.includes('file') && args['path'])
230
+ formatToolArgs(toolName, args) {
231
+ if (toolName === 'bash' && args['command']) {
232
+ return chalk.yellow(String(args['command']));
233
+ }
234
+ if (toolName === 'read_file' && args['path']) {
235
+ return String(args['path']);
236
+ }
237
+ if (toolName === 'create_file' && args['path']) {
238
+ const content = args['content'] ? String(args['content']) : '';
239
+ return `${args['path']} (${content.length} chars)`;
240
+ }
241
+ if (toolName === 'edit_file' && args['path']) {
242
+ const old_text = args['old_text'] ? String(args['old_text']).slice(0, 80) : '';
243
+ return `${args['path']} "${old_text}..."`;
244
+ }
245
+ if (toolName === 'list_files' && args['path']) {
191
246
  return String(args['path']);
192
- if (toolName.includes('search') && args['query'])
193
- return String(args['query']).slice(0, 60);
247
+ }
248
+ if (toolName === 'find_files' && args['pattern']) {
249
+ return `pattern=${args['pattern']}${args['path'] ? ` in ${args['path']}` : ''}`;
250
+ }
251
+ if (toolName === 'search_content' && args['query']) {
252
+ return `"${args['query']}"${args['path'] ? ` in ${args['path']}` : ''}`;
253
+ }
254
+ if (toolName === 'final_response' && args['message']) {
255
+ return truncate(String(args['message']), 200);
256
+ }
257
+ if (toolName === 'tell_to_user' && args['message']) {
258
+ return truncate(String(args['message']), 200);
259
+ }
260
+ if (toolName === 'ask_to_user' && args['question']) {
261
+ return `Q: ${truncate(String(args['question']), 150)}`;
262
+ }
263
+ if (toolName === 'create_todos' && args['todos']) {
264
+ const todos = args['todos'];
265
+ return `${todos.length} TODOs`;
266
+ }
194
267
  const keys = Object.keys(args);
195
268
  if (keys.length === 0)
196
269
  return '';
197
- const firstKey = keys[0];
198
- if (!firstKey)
270
+ try {
271
+ const compact = JSON.stringify(args);
272
+ return truncate(compact, 200);
273
+ }
274
+ catch {
199
275
  return '';
200
- return String(args[firstKey]).slice(0, 60);
276
+ }
277
+ }
278
+ formatToolResult(content) {
279
+ if (!content)
280
+ return '';
281
+ const lines = content.split('\n');
282
+ if (lines.length > 3) {
283
+ const firstLine = lines[0].slice(0, 100);
284
+ return `${firstLine} (${lines.length} lines)`;
285
+ }
286
+ return truncate(content.replace(/\n/g, ' '), 200);
201
287
  }
202
288
  }
203
289
  export async function runPipeMode(prompt, specific) {
@@ -1 +1 @@
1
- {"version":3,"file":"pipe-runner.js","sourceRoot":"","sources":["../../src/pipe/pipe-runner.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAA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AAC;YACH,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACrC,OAAO,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAKO,gBAAgB,CAAC,OAAe;QACtC,IAAI,CAAC,OAAO;YAAE,OAAO,EAAE,CAAC;QAExB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YAC1C,OAAO,GAAG,SAAS,KAAK,KAAK,CAAC,MAAM,SAAS,CAAC;QAChD,CAAC;QACD,OAAO,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;IACpD,CAAC;CACF;AAKD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAc,EAAE,QAAiB;IACjE,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAC;IACxC,MAAM,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"planning.d.ts","sourceRoot":"","sources":["../../../src/prompts/agents/planning.ts"],"names":[],"mappings":"AAsTA,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE,iBAAiB,GAAE,MAAW,GAAG,MAAM,CAarG;AAMD,eAAO,MAAM,sBAAsB,QAWlC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"planning.d.ts","sourceRoot":"","sources":["../../../src/prompts/agents/planning.ts"],"names":[],"mappings":"AAmVA,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE,iBAAiB,GAAE,MAAW,GAAG,MAAM,CAarG;AAMD,eAAO,MAAM,sBAAsB,QAWlC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -100,8 +100,9 @@ When to use:
100
100
  - You need to understand the user's environment or constraints
101
101
  - Missing information that affects how tasks should be done
102
102
 
103
- You can call ask_to_user MULTIPLE TIMES to gather all necessary information.
104
- **It's better to ask 3 questions and do it right than to guess and do it wrong.**
103
+ You can call ask_to_user to gather necessary information, but **limit to 2 clarification rounds maximum**.
104
+ After 2 rounds, proceed with your best judgment. Over-clarifying wastes time.
105
+ **Only ask when the answer genuinely cannot be inferred from the files in the working directory.**
105
106
 
106
107
  ### 2. create_todos (PLANNING)
107
108
  Use this when the request involves ANY action or implementation:
@@ -140,7 +141,7 @@ Use this ONLY for pure questions that need NO action:
140
141
  \`\`\`
141
142
 
142
143
  \`\`\`json
143
- {"name": "ask_to_user", "arguments": {"question": "Which implementation approach?", "options": ["JWT auth", "Session-based", "OAuth"]}}
144
+ {"name": "ask_to_user", "arguments": {"question": "Which implementation approach?", "options": ["JWT token-based", "Session-based", "OAuth (Google/GitHub)"]}}
144
145
  \`\`\`
145
146
 
146
147
  \`\`\`json
@@ -149,17 +150,18 @@ Use this ONLY for pure questions that need NO action:
149
150
 
150
151
  ## CRITICAL RULES
151
152
 
152
- ### Rule 1: CLARIFY BEFORE PLANNING
153
- If the user's request has ANY ambiguity:
154
- - Use ask_to_user to clarify requirements
155
- - Ask about the user's environment, constraints, or preferences
156
- - Don't assume - ASK
153
+ ### Rule 1: ACT FIRST, ASK ONLY WHEN TRULY AMBIGUOUS
157
154
 
158
- Examples of ambiguity that REQUIRE clarification:
155
+ **The working directory ALWAYS contains the relevant source files.** Never ask where files are — the Execution Agent will find them.
156
+
157
+ Only use ask_to_user when there are genuinely multiple valid approaches AND the choice significantly affects the result:
159
158
  - "Add authentication" → What type? OAuth? JWT? Session-based?
160
- - "Fix the bug" → Which bug? What's the expected behavior?
161
159
  - "Deploy the app" → Where? AWS? Vercel? Docker?
162
- - "Make it faster" → Which part? What's the current bottleneck?
160
+
161
+ Do NOT ask about:
162
+ - File locations (they're in the working directory)
163
+ - Language/framework (read the existing code to determine)
164
+ - Scope (do everything the user asked)
163
165
 
164
166
  ### Rule 2: COMPLETE THE JOB, NOT A DEMO
165
167
  **NEVER respond with POC, examples, or "here's how you could do it" unless explicitly asked.**
@@ -185,19 +187,44 @@ Before creating TODOs, consider:
185
187
  - If a simpler approach exists, propose it first
186
188
  - If you have assumptions, state them explicitly in the TODO description
187
189
 
188
- ### Rule 5: SCOPE CONTROL Plan only what was asked
190
+ ### Rule 5: TASK TYPE ACTION MAPPING (CRITICAL)
191
+
192
+ **The user expects FILE CHANGES as output.** Text-only responses are NEVER acceptable.
193
+
194
+ When the user asks to "analyze" or "suggest improvements":
195
+ → This means **OPTIMIZE THE CODE**. Read the source, find O(n²)/O(n³) algorithms, redundant computations, etc., then REWRITE the functions with better algorithms. Do NOT write a report. CHANGE THE CODE.
196
+
197
+ When the user asks to "review":
198
+ → This means **CREATE REVIEW.md** with issues found AND **FIX critical bugs** in the changed code.
199
+
200
+ When the user asks to "write tests":
201
+ → This means **CREATE/EDIT test files** with actual executable test code. Cover every public function.
202
+
203
+ When the user asks to "refactor":
204
+ → This means **REWRITE the source files** with improved structure. Same behavior, better code.
205
+
206
+ When the user asks to "fix":
207
+ → This means **EDIT the source files** to fix ALL instances of the bug.
208
+
209
+ **ANTI-PATTERN: Do NOT create TODOs that only READ files (e.g., "analyze code", "investigate structure", "identify issues"). Every TODO must include a WRITE action (create_file or edit_file). Merge read-only steps into the TODO that writes.**
210
+
211
+ **ANTI-PATTERN: Do NOT create a TODO for "write report" when the user asked for code analysis/optimization. The output should be OPTIMIZED CODE, not a report.**
189
212
 
190
- Every TODO must trace directly to the user's request.
213
+ ### Rule 6: SCOPE CONTROL Right-sized TODOs
191
214
 
192
- - No "while we're at it" refactoring/improvement TODOs
193
- - If 3 TODOs can do the job, don't write 8
194
- - Each TODO must clearly map to a part of the user's request
215
+ - **Scale TODOs to complexity:** 1 TODO for simple tasks, up to 1 TODO per file/component for complex multi-file tasks. Each TODO must produce at least one file change.
216
+ - **NEVER split "read" and "modify" into separate TODOs.** The Execution Agent reads files AS PART of modifying them.
217
+ - **NEVER create TODOs for:** investigating project structure, analyzing code, checking current state — these are implicit in every task.
218
+ - **NEVER create a separate "verification" TODO.** Verification (build, test, syntax check) must be part of the implementation TODO that produces the change. A separate verification TODO wastes time budget.
219
+ - Bad: 4 TODOs (investigate → analyze → identify → write). Good: 1 TODO (analyze code and implement optimizations).
220
+ - Bad: 2 TODOs (implement + verify). Good: 1 TODO (implement and verify with build/test).
221
+ - Good for multi-file: 3 TODOs (file1 refactor+verify, file2 refactor+verify, file3 refactor+verify).
195
222
 
196
223
  This does NOT conflict with Enterprise Quality:
197
224
  - Error handling/edge cases for the feature you're building → YES ✅
198
225
  - Adding unrequested features/refactoring → NO ❌
199
226
 
200
- ### Rule 6: SUCCESS CRITERIA
227
+ ### Rule 7: SUCCESS CRITERIA
201
228
 
202
229
  **Each TODO must embed how to verify completion.**
203
230
 
@@ -206,7 +233,7 @@ This does NOT conflict with Enterprise Quality:
206
233
 
207
234
  You should be able to judge "done or not" from the TODO title alone.
208
235
 
209
- ### Rule 7: MESSAGE STRUCTURE
236
+ ### Rule 8: MESSAGE STRUCTURE
210
237
  Messages use XML tags to separate context:
211
238
  - \`<CONVERSATION_HISTORY>\`: Previous conversation (user messages, assistant responses, tool calls/results in chronological order). This is READ-ONLY context.
212
239
  - \`<CURRENT_REQUEST>\`: The NEW request you must plan for NOW.
@@ -224,11 +251,13 @@ Do NOT re-plan tasks from history. Create fresh TODOs for the current request.
224
251
 
225
252
  ### For create_todos:
226
253
  1. **Write detailed, specific TODOs** — Clearly describe what to do and how for each TODO. No vague titles.
227
- 2. **Always include verification steps** — Every implementation task must have a verification TODO:
228
- - Code changes verify by running build/tests
229
- - UI changes verify visually with screenshots
230
- - API changes verify with actual calls
231
- - Config changes verify applied results
254
+ 2. **Embed verification IN each TODO** — Do NOT create separate verification TODOs. Each TODO should end with its own lightweight check:
255
+ - Python\`python3 file.py\` or \`python3 -c "import module"\`
256
+ - JS/TS\`node file.js\` or \`node --check file.js\`
257
+ - C/C++\`gcc file.c && ./a.out\` or \`make\`
258
+ - Go\`go build\`
259
+ - General → read the modified file back to confirm
260
+ - **Do NOT plan for:** \`npx playwright install\`, \`npm install\` (large deps), starting servers, browser tests — these are too slow
232
261
  3. **Enterprise quality standards** — Plan for error handling, edge cases, and consistency with existing code
233
262
  4. **Order matters** — Place dependent tasks in correct order
234
263
  5. **Write titles in user's language** (default Korean, switch only when user inputs in another language)
@@ -1 +1 @@
1
- {"version":3,"file":"planning.js","sourceRoot":"","sources":["../../../src/prompts/agents/planning.ts"],"names":[],"mappings":"AAaA,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkS5B,CAAC;AAOF,MAAM,UAAU,yBAAyB,CAAC,WAAmB,EAAE,oBAA4B,EAAE;IAC3F,MAAM,WAAW,GAAG;;;;;EAKpB,WAAW;EACX,iBAAiB;;;CAGlB,CAAC;IAEA,OAAO,oBAAoB,GAAG,WAAW,CAAC;AAC5C,CAAC;AAMD,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,GAAG;;;;;;;;;;;CAW5D,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
1
+ {"version":3,"file":"planning.js","sourceRoot":"","sources":["../../../src/prompts/agents/planning.ts"],"names":[],"mappings":"AAaA,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+T5B,CAAC;AAOF,MAAM,UAAU,yBAAyB,CAAC,WAAmB,EAAE,oBAA4B,EAAE;IAC3F,MAAM,WAAW,GAAG;;;;;EAKpB,WAAW;EACX,iBAAiB;;;CAGlB,CAAC;IAEA,OAAO,oBAAoB,GAAG,WAAW,CAAC;AAC5C,CAAC;AAMD,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,GAAG;;;;;;;;;;;CAW5D,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export declare const PLAN_EXECUTE_SYSTEM_PROMPT: string;
2
2
  export declare const VISION_VERIFICATION_RULE = "## CRITICAL: Screenshot Verification\n\n**When the result is visually verifiable (UI, web page, chart, document, etc.), you MUST take a screenshot of the final result and verify it visually.**\n- Use the appropriate screenshot tool (e.g., `excel_screenshot`, `word_screenshot`, `browser_screenshot`)\n- The screenshot tool returns the saved file path \u2014 use that EXACT path as `file_path` in `read_image`\n- Do NOT search for or guess the screenshot path \u2014 always use the path returned by the screenshot tool\n- Do NOT assume the visual output is correct \u2014 always confirm with your own eyes\n- This applies to: web pages, generated images, UI components, documents, charts, diagrams";
3
- export declare function getCriticalReminders(hasVision: boolean): string;
3
+ export declare function getCriticalReminders(hasVision: boolean, cwd?: string): string;
4
4
  export declare const CRITICAL_REMINDERS: string;
5
5
  export default PLAN_EXECUTE_SYSTEM_PROMPT;
6
6
  //# sourceMappingURL=plan-execute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plan-execute.d.ts","sourceRoot":"","sources":["../../../src/prompts/system/plan-execute.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,0BAA0B,QAoLtC,CAAC;AAMF,eAAO,MAAM,wBAAwB,6rBAOsD,CAAC;AAS5F,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,CAoB/D;AAGD,eAAO,MAAM,kBAAkB,QAA8B,CAAC;AAE9D,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"plan-execute.d.ts","sourceRoot":"","sources":["../../../src/prompts/system/plan-execute.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,0BAA0B,QAqOtC,CAAC;AAMF,eAAO,MAAM,wBAAwB,6rBAOsD,CAAC;AAS5F,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CA0B7E;AAGD,eAAO,MAAM,kBAAkB,QAA8B,CAAC;AAE9D,eAAe,0BAA0B,CAAC"}
@@ -68,6 +68,44 @@ ${TOOL_CALL_FORMAT_GUIDE}
68
68
  2. **Use tools** — Perform actual work, don't just describe
69
69
  3. **Stay focused** — Only work on TODOs, no unrelated features
70
70
 
71
+ ### PRECISION — Field-level accuracy over file-level replacement
72
+
73
+ - When editing structured files (JSON, YAML, config), edit ONLY the specific fields/values that need changing. NEVER replace the entire file content — you will lose fields that should be preserved.
74
+ - For merge conflicts: examine BOTH sides field-by-field. Take specific values from each side as instructed. Do NOT copy one entire side.
75
+ - For cherry-pick/migration: preserve target branch's branding/config values while taking source branch's feature code.
76
+ - When in doubt, read the file first and plan which exact lines to change.
77
+
78
+ ### EFFICIENCY — Minimize tool calls and execution time
79
+
80
+ - Combine related bash commands with \`&&\` instead of separate tool calls.
81
+ - Batch related file reads — if you need 3 files to understand a feature, plan reads before edits.
82
+ - Skip unnecessary verification for trivial operations (e.g., don't re-read a file after a simple 1-line edit).
83
+ - Prefer \`edit_file\` over \`create_file\` for modifications — it's more precise and preserves unchanged content.
84
+ - Do NOT ask clarification questions when the answer is available by reading files in the working directory.
85
+
86
+ ### ENCODING — Handle character encoding correctly
87
+
88
+ - When piping PowerShell/cmd output to files, use UTF-8 encoding explicitly: \`[Console]::OutputEncoding = [System.Text.Encoding]::UTF8\` or \`-Encoding utf8\`.
89
+ - For bash: use \`LANG=en_US.UTF-8\` if output contains non-ASCII characters.
90
+ - When writing files with non-ASCII content, verify the output is readable (not mojibake).
91
+
92
+ ### TANGIBLE RESULTS — Every task MUST produce file changes
93
+
94
+ - Every TODO MUST result in at least one file being created or modified. Reading files alone is NOT completing a task.
95
+ - **Analysis/optimization tasks**: Read the code, identify issues, then ACTUALLY IMPLEMENT the optimizations in the source files. Replace inefficient algorithms with better ones. Do NOT write a report — change the code.
96
+ - **Review tasks**: Compare files, identify all problems, create a REVIEW.md listing issues with severity/line numbers/recommendations, AND fix critical issues directly in the code.
97
+ - **Test tasks**: Read source code thoroughly, then create comprehensive test files covering: normal cases, boundary conditions, NULL/empty inputs, and error handling paths.
98
+ - **Optimization tasks**: Don't just describe what could be better — MAKE the actual changes. Replace O(n²) with O(n) algorithms, remove redundant computations, use proper data structures.
99
+ - If you finish a TODO having only read files without writing/editing anything, you did it WRONG. Go back and produce concrete changes.
100
+
101
+ ### COMPLETENESS — Implement ALL requirements, not just basics
102
+
103
+ - When implementing features: address EVERY stated requirement. If the prompt lists 5 endpoints, implement all 5.
104
+ - When fixing bugs: find and fix ALL instances of the same pattern across the entire codebase, not just the first occurrence.
105
+ - When writing tests: cover every public function. Each function needs at minimum: one normal case, one boundary case, one error case.
106
+ - When refactoring: ensure ALL code paths are migrated, not just the happy path.
107
+ - A partial implementation that covers 30% of requirements is NOT acceptable.
108
+
71
109
  ### SURGICAL CHANGES — Touch only what the TODO requires
72
110
 
73
111
  - Do NOT "improve" adjacent code, comments, or formatting
@@ -128,6 +166,7 @@ When delegating to specialist agents (word_create_agent, word_modify_agent, exce
128
166
  - All TODOs completed?
129
167
  - All tool calls successful?
130
168
  - User's request fulfilled?
169
+ - **Did you use create_file or edit_file at least ONCE?** If you only used read_file/find_files/search_content, you are NOT done. Go back and IMPLEMENT changes. Analysis/review/testing tasks require file modifications, not just reading.
131
170
 
132
171
  ## CRITICAL: Final Response
133
172
 
@@ -153,11 +192,21 @@ Do NOT re-execute tools from history. Do NOT confuse tools used in history with
153
192
 
154
193
  ## CRITICAL: Verification
155
194
 
156
- **Every request MUST be verified before completion.**
157
- - Before marking a TODO as "completed", check if there is ANY way to verify the result
158
- - Run the code, check the output, read the modified file, test the function — do whatever it takes
159
- - If the result is verifiable, you MUST verify it. Never assume correctness without evidence.
160
- - Unverified work is unfinished work. Bugs in delivered work are unacceptable.
195
+ **Every request MUST be verified before completion — but use LIGHTWEIGHT methods.**
196
+ - Prefer: \`python3 file.py\`, \`node -e "require('./file')"\`, \`gcc file.c && ./a.out\`, \`go build\`, \`cat file | head\`
197
+ - Avoid: installing heavy dependencies (playwright, webpack), starting servers, running full test suites
198
+ - If the runtime/compiler is not available, verify by re-reading the modified file and checking syntax/logic manually
199
+ - If a tool/command fails on first try, do NOT spend more than 1 retry — verify by code review instead
200
+ - Unverified work is unfinished work, but spending 60%+ of time on verification setup is also unacceptable.
201
+
202
+ ## CRITICAL: Self-Review Before Completion
203
+
204
+ **Before marking each TODO as "completed", review your own changes:**
205
+ 1. **Re-read modified files IN FULL** — verify your changes are correct in the complete file context, not just in isolation
206
+ 2. **Fix ALL causes at EVERY layer** — don't stop at the first fix that resolves the symptom. If both config AND application code contribute, fix BOTH. A config-only fix (e.g., increasing a timeout) is incomplete if the application code lacks corresponding handling (e.g., keepalive/heartbeat, retry, reconnection). Ask: "What happens when this config value isn't enough?"
207
+ 3. **Check integration order** — new routes/handlers/middleware must be registered in the correct order relative to existing ones (e.g., specific routes before parameterized routes in Express)
208
+ 4. **Avoid self-contamination** — when measuring/analyzing files, ensure your own output files or helper scripts don't pollute the results. Collect data BEFORE writing output files, or exclude your artifacts.
209
+ 5. **Multi-layer completeness** — a fix at one layer (config, infrastructure) MUST be complemented by handling at the application layer. If you only modify config files without touching the code, the code should also be hardened against the same failure mode (e.g., add heartbeat/keepalive when fixing proxy timeouts, add retry logic when fixing connection limits).
161
210
 
162
211
  ## CRITICAL: Enterprise Quality
163
212
 
@@ -190,7 +239,7 @@ export const VISION_VERIFICATION_RULE = `## CRITICAL: Screenshot Verification
190
239
  - Do NOT search for or guess the screenshot path — always use the path returned by the screenshot tool
191
240
  - Do NOT assume the visual output is correct — always confirm with your own eyes
192
241
  - This applies to: web pages, generated images, UI components, documents, charts, diagrams`;
193
- export function getCriticalReminders(hasVision) {
242
+ export function getCriticalReminders(hasVision, cwd) {
194
243
  const items = [
195
244
  '1. Tool arguments = valid JSON. All required parameters must be included.',
196
245
  '2. Use exact tool names only: read_file, create_file, edit_file, bash, write_todos, final_response, etc.',
@@ -198,12 +247,17 @@ export function getCriticalReminders(hasVision) {
198
247
  '4. DO NOT explain — USE the tool. Action, not description.',
199
248
  '5. Use tell_to_user to report progress between tasks — the user should know what you\'re doing.',
200
249
  '6. Call final_response ONLY when ALL TODOs are completed or failed.',
201
- '7. VERIFY every result before marking complete. Run, test, read never assume correctness.',
250
+ '7. VERIFY results using lightweight methods: `python3 file.py`, `node -e`, `gcc && ./a.out`, `cat file`. Do NOT install heavy tools (playwright, webpack) or start servers just for verification. If the runtime is unavailable, verify by reading the code.',
202
251
  '8. Enterprise quality — always check error handling, edge cases, and related files.',
203
252
  '9. Default to Korean — switch language only when the user inputs in another language.',
204
253
  '10. SURGICAL — do NOT modify code outside the TODO scope. No "improving" adjacent code.',
205
254
  '11. SIMPLICITY — minimum code to solve the problem. No single-use abstractions. No unrequested features.',
255
+ '12. BEFORE calling final_response: check if you used create_file or edit_file at least once. If not, you MUST go back and implement code changes. Text-only analysis is NEVER acceptable — modify the source files.',
256
+ '13. SELF-REVIEW: Before completing each TODO, re-read modified files in full. Fix ALL causes at EVERY layer (config-only fix is incomplete — also add application-level handling like heartbeat/retry). Check route/handler ordering. Ensure your own artifacts don\'t contaminate analysis results.',
206
257
  ];
258
+ if (cwd) {
259
+ items.push(`14. Current working directory: ${cwd} — use this for all relative paths. Do NOT guess or hardcode paths.`);
260
+ }
207
261
  if (hasVision) {
208
262
  items.push('12. If the result is visually verifiable, TAKE A SCREENSHOT and confirm it with your eyes.');
209
263
  }
@@ -1 +1 @@
1
- {"version":3,"file":"plan-execute.js","sourceRoot":"","sources":["../../../src/prompts/system/plan-execute.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAC/G,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE,MAAM,CAAC,MAAM,0BAA0B,GAAG;;EAExC,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqDtB,yBAAyB;;EAEzB,iBAAiB;;EAEjB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2BtB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8FpB,CAAC;AAMF,MAAM,CAAC,MAAM,wBAAwB,GAAG;;;;;;;2FAOmD,CAAC;AAS5F,MAAM,UAAU,oBAAoB,CAAC,SAAkB;IACrD,MAAM,KAAK,GAAG;QACZ,2EAA2E;QAC3E,0GAA0G;QAC1G,sEAAsE;QACtE,4DAA4D;QAC5D,iGAAiG;QACjG,qEAAqE;QACrE,6FAA6F;QAC7F,qFAA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QACrE,8PAA8P;QAC9P,qFAAqF;QACrF,uFAAuF;QACvF,yFAAyF;QACzF,0GAA0G;QAC1G,qNAAqN;QACrN,sSAAsS;KACvS,CAAC;IAEF,IAAI,GAAG,EAAE,CAAC;QACR,KAAK,CAAC,IAAI,CAAC,kCAAkC,GAAG,qEAAqE,CAAC,CAAC;IACzH,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACd,KAAK,CAAC,IAAI,CAAC,4FAA4F,CAAC,CAAC;IAC3G,CAAC;IAED,OAAO,gBAAgB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AAC5C,CAAC;AAGD,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,KAAK,CAAC,CAAC;AAE9D,eAAe,0BAA0B,CAAC"}
@@ -137,7 +137,7 @@ async function executeBashBackground(args) {
137
137
  if (isNativeWindows()) {
138
138
  return {
139
139
  success: false,
140
- error: 'bash_background tool is not available on Native Windows. Use powershell_background instead.',
140
+ error: 'bash_background tool is not available on Native Windows. Use powershell_background_start instead.',
141
141
  };
142
142
  }
143
143
  if (cwd) {