import { Text } from "@earendil-works/pi-tui"; export function compactRenderCall(label: string) { return (args: Record, theme: { fg(name: string, text: string): string; bold(text: string): string }) => new Text(`${theme.fg("toolTitle", theme.bold(label))} ${theme.fg("muted", String(args.path ?? args.revisionId ?? args.beforePath ?? ""))}`, 0, 0); } export function compactRenderResult(result: { details?: Record; content?: Array<{ type: string; text?: string }> }, options: { isPartial?: boolean; expanded?: boolean }, theme: { fg(name: string, text: string): string }) { if (options.isPartial) return new Text(theme.fg("warning", "Working…"), 0, 0); const details = result.details ?? {}, status = details.ok === false ? "error" : "success", summary = [details.revisionId ? `revision ${details.revisionId}` : undefined, details.sourceSha256 ? `sha ${String(details.sourceSha256).slice(0, 12)}` : undefined, details.destinationPath ? `→ ${details.destinationPath}` : undefined, details.truncated ? `full report: ${details.artifactPath}` : undefined].filter(Boolean).join(" ") || result.content?.find((item) => item.type === "text")?.text?.split("\n")[0] || "Done"; return new Text(theme.fg(status, summary), 0, 0); }