/** * Pure per-agent tool-call aggregation for compact fleet-chat mode. * * In `compact` mode the director bridge does not emit one chat line per * subagent tool call; instead each call is folded into a per-agent * `ToolAgg` and committed as ONE summary line at the same turn * boundaries that flush the buffered assistant text (session end, task * completion, effect teardown). Kept hook-free so it is unit-testable * without React or a Director. */ export interface ToolAgg { /** Total tool calls in this turn. */ total: number; /** Calls that reported ok === false. */ fails: number; /** Sum of reported durations (calls without a duration contribute 0). */ totalMs: number; /** Call count per tool name, insertion-ordered. */ byTool: Map; } export declare function newToolAgg(): ToolAgg; export declare function addTool(agg: ToolAgg, name: string, ok?: boolean | undefined, durationMs?: number | undefined): void; /** * Render an aggregate as a single chat line: * `14 tools · grep×9 read×5 · 3.2s · 1 ✗` * * The top `maxTools` tools by count are listed; any remainder collapses * into `+N more`. Segments with nothing to say (no duration, no * failures) are omitted. Returns '' for an empty aggregate. */ export declare function formatToolSummary(agg: ToolAgg, maxTools?: number): string; //# sourceMappingURL=fleet-chat-coalescer.d.ts.map