MCPcopy Create free account
hub / github.com/apache/maka / computerCallSummary

Function computerCallSummary

packages/cli/src/pi-transcript-tools.ts:819–838  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

817 * this function exists to remove.
818 */
819function 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}

Callers 1

toolInputSummaryFunction · 0.85

Calls 4

limitTextFunction · 0.85
joinMethod · 0.80
textFunction · 0.70
pushMethod · 0.65

Tested by

no test coverage detected