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.
package/dist/bin/cli.js CHANGED
@@ -494,6 +494,64 @@ var TaskExecutor = class extends EventEmitter {
494
494
  if (!existsSync2(logPath)) return null;
495
495
  return readFileSync4(logPath, "utf-8");
496
496
  }
497
+ /**
498
+ * Format tool use for display in logs
499
+ */
500
+ formatToolUse(toolName, input) {
501
+ const truncate = (str, maxLen = 80) => {
502
+ if (str.length <= maxLen) return str;
503
+ return str.slice(0, maxLen) + "...";
504
+ };
505
+ switch (toolName) {
506
+ case "Bash":
507
+ return `[Bash] $ ${truncate(String(input.command || ""))}
508
+ `;
509
+ case "Read":
510
+ return `[Read] ${input.file_path}
511
+ `;
512
+ case "Edit":
513
+ return `[Edit] ${input.file_path}
514
+ `;
515
+ case "Write":
516
+ return `[Write] ${input.file_path}
517
+ `;
518
+ case "Grep":
519
+ return `[Grep] "${truncate(String(input.pattern || ""))}" in ${input.path || "."}
520
+ `;
521
+ case "Glob":
522
+ return `[Glob] ${input.pattern} in ${input.path || "."}
523
+ `;
524
+ case "Task":
525
+ return `[Task] ${input.description || truncate(String(input.prompt || ""))}
526
+ `;
527
+ case "TodoWrite":
528
+ const todos = input.todos;
529
+ if (todos && Array.isArray(todos)) {
530
+ const summary = todos.map((t) => ` ${t.status === "completed" ? "\u2713" : t.status === "in_progress" ? "\u2192" : "\u25CB"} ${truncate(t.content, 60)}`).join("\n");
531
+ return `[TodoWrite]
532
+ ${summary}
533
+ `;
534
+ }
535
+ return `[TodoWrite]
536
+ `;
537
+ case "WebFetch":
538
+ return `[WebFetch] ${input.url}
539
+ `;
540
+ case "WebSearch":
541
+ return `[WebSearch] "${truncate(String(input.query || ""))}"
542
+ `;
543
+ default:
544
+ const meaningfulParams = ["file_path", "path", "command", "query", "url", "pattern", "target"];
545
+ for (const param of meaningfulParams) {
546
+ if (input[param]) {
547
+ return `[${toolName}] ${truncate(String(input[param]))}
548
+ `;
549
+ }
550
+ }
551
+ return `[${toolName}]
552
+ `;
553
+ }
554
+ }
497
555
  /**
498
556
  * Check if project is a git repository
499
557
  */
@@ -788,8 +846,7 @@ Focus only on this task. When successfully complete, output: <promise>COMPLETE</
788
846
  if (block.type === "text") {
789
847
  text += block.text;
790
848
  } else if (block.type === "tool_use") {
791
- text += `[Tool: ${block.name}]
792
- `;
849
+ text += this.formatToolUse(block.name, block.input);
793
850
  }
794
851
  }
795
852
  } else if (json.type === "content_block_delta" && json.delta?.text) {