claude-kanban 0.2.0 → 0.2.1

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.
@@ -256,6 +256,64 @@ var TaskExecutor = class extends EventEmitter {
256
256
  if (!existsSync2(logPath)) return null;
257
257
  return readFileSync4(logPath, "utf-8");
258
258
  }
259
+ /**
260
+ * Format tool use for display in logs
261
+ */
262
+ formatToolUse(toolName, input) {
263
+ const truncate = (str, maxLen = 80) => {
264
+ if (str.length <= maxLen) return str;
265
+ return str.slice(0, maxLen) + "...";
266
+ };
267
+ switch (toolName) {
268
+ case "Bash":
269
+ return `[Bash] $ ${truncate(String(input.command || ""))}
270
+ `;
271
+ case "Read":
272
+ return `[Read] ${input.file_path}
273
+ `;
274
+ case "Edit":
275
+ return `[Edit] ${input.file_path}
276
+ `;
277
+ case "Write":
278
+ return `[Write] ${input.file_path}
279
+ `;
280
+ case "Grep":
281
+ return `[Grep] "${truncate(String(input.pattern || ""))}" in ${input.path || "."}
282
+ `;
283
+ case "Glob":
284
+ return `[Glob] ${input.pattern} in ${input.path || "."}
285
+ `;
286
+ case "Task":
287
+ return `[Task] ${input.description || truncate(String(input.prompt || ""))}
288
+ `;
289
+ case "TodoWrite":
290
+ const todos = input.todos;
291
+ if (todos && Array.isArray(todos)) {
292
+ const summary = todos.map((t) => ` ${t.status === "completed" ? "\u2713" : t.status === "in_progress" ? "\u2192" : "\u25CB"} ${truncate(t.content, 60)}`).join("\n");
293
+ return `[TodoWrite]
294
+ ${summary}
295
+ `;
296
+ }
297
+ return `[TodoWrite]
298
+ `;
299
+ case "WebFetch":
300
+ return `[WebFetch] ${input.url}
301
+ `;
302
+ case "WebSearch":
303
+ return `[WebSearch] "${truncate(String(input.query || ""))}"
304
+ `;
305
+ default:
306
+ const meaningfulParams = ["file_path", "path", "command", "query", "url", "pattern", "target"];
307
+ for (const param of meaningfulParams) {
308
+ if (input[param]) {
309
+ return `[${toolName}] ${truncate(String(input[param]))}
310
+ `;
311
+ }
312
+ }
313
+ return `[${toolName}]
314
+ `;
315
+ }
316
+ }
259
317
  /**
260
318
  * Check if project is a git repository
261
319
  */
@@ -550,8 +608,7 @@ Focus only on this task. When successfully complete, output: <promise>COMPLETE</
550
608
  if (block.type === "text") {
551
609
  text += block.text;
552
610
  } else if (block.type === "tool_use") {
553
- text += `[Tool: ${block.name}]
554
- `;
611
+ text += this.formatToolUse(block.name, block.input);
555
612
  }
556
613
  }
557
614
  } else if (json.type === "content_block_delta" && json.delta?.text) {