(toolName: string, args: unknown)
| 513 | } |
| 514 | |
| 515 | function summarizeToolArgs(toolName: string, args: unknown) { |
| 516 | if (!args || typeof args !== "object") { |
| 517 | return undefined |
| 518 | } |
| 519 | |
| 520 | const record = args as Record<string, unknown> |
| 521 | const keyGroups = getToolSummaryKeys(toolName) |
| 522 | const parts: string[] = [] |
| 523 | |
| 524 | for (const keys of keyGroups) { |
| 525 | const part = summarizeFirstValue(record, keys) |
| 526 | if (part) { |
| 527 | parts.push(part) |
| 528 | } |
| 529 | } |
| 530 | |
| 531 | return parts.length > 0 ? parts.join(" ") : undefined |
| 532 | } |
| 533 | |
| 534 | function getToolSummaryKeys(toolName: string) { |
| 535 | const name = toolName.toLowerCase() |
no test coverage detected