import type { ToolCall } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
import type { ToolCategory } from "./tool-categories.js";
/**
 * One renderable unit of a turn's tool activity.
 *
 * - `row` — a single tool call rendered as a persistent timeline row.
 * - `run` — a maximal run of >= {@link MIN_RUN_LENGTH} consecutive low-signal
 *   same-category calls (e.g. reads), folded into one collapsible chip.
 */
export type ToolSegment = {
    readonly kind: "row";
    readonly toolCall: ToolCall;
    readonly key: string;
} | {
    readonly kind: "run";
    readonly category: ToolCategory;
    readonly toolCalls: readonly ToolCall[];
    readonly key: string;
};
/**
 * Partitions a turn's tool calls into a chronological sequence of {@link
 * ToolSegment}s: maximal runs of consecutive low-signal same-category calls
 * (read / list / search) fold into one `run` chip, while every other call —
 * and any groupable call that has no same-kind neighbour — stays a persistent
 * `row`.
 *
 * This is the layout pass behind the "persistent-row timeline": instead of
 * hiding a whole turn behind one collapse, only repetitive noise is compressed,
 * and high-signal rows (edits, shell, MCP, sub-agents) always remain visible.
 * Chronology is preserved — a run never reorders calls, and an interleaving of
 * categories (read, search, read) yields three separate segments, not one.
 *
 * Pure and dependency-light so it can be unit-tested exhaustively and memoized
 * by the caller; groupability is resolved through {@link resolveRunGroupable},
 * so a consumer's registry override is honoured here exactly as in the
 * component layer.
 *
 * @example
 * ```ts
 * // read, read, read, edit  ->  [run(read x3), row(edit)]
 * // read, search, read      ->  [row(read), row(search), row(read)]
 * const segments = segmentToolCalls(message.toolCalls);
 * ```
 */
export declare function segmentToolCalls(toolCalls: readonly ToolCall[]): ToolSegment[];
//# sourceMappingURL=segment-tool-calls.d.ts.map