* What one Computer Use call did, for the row that names it. * * Every other tool's row is legible from its name plus one headline argument. * This tool's name is `Maka Computer` for observing a window, clicking a * button and observing again alike, so ten calls in a turn printed ten * identica
(args: Record<string, unknown> | undefined)
| 817 | * this function exists to remove. |
| 818 | */ |
| 819 | function computerCallSummary(args: Record<string, unknown> | undefined): string | undefined { |
| 820 | if (!args) return undefined; |
| 821 | const text = (key: string): string | undefined => { |
| 822 | const value = args[key]; |
| 823 | return typeof value === 'string' && value.trim() ? value.trim() : undefined; |
| 824 | }; |
| 825 | const action = text('action'); |
| 826 | if (!action) return undefined; |
| 827 | const parts = [action]; |
| 828 | const elementId = text('element_id'); |
| 829 | if (elementId) parts.push(`element ${elementId}`); |
| 830 | const app = text('app'); |
| 831 | const windowId = args.window_id; |
| 832 | const target = |
| 833 | app && typeof windowId === 'number' |
| 834 | ? `${app} window ${windowId}` |
| 835 | : (app ?? (typeof windowId === 'number' ? `window ${windowId}` : undefined)); |
| 836 | if (target) parts.push(target); |
| 837 | return limitText(parts.join(' · '), 600); |
| 838 | } |
no test coverage detected