import type { AgentExecution } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/api_pb";
import type { FileChange } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
/** Return value of {@link useSessionFileChanges}. */
export interface UseSessionFileChangesReturn {
    /**
     * One {@link FileChange} per file touched in the session — the *net*
     * change for that path (see the net-diff note below) — ordered for a
     * file-list (modified, then created/renamed, then deleted; alphabetical
     * within each group).
     */
    readonly fileChanges: readonly FileChange[];
    /** `true` when at least one file was changed across all executions. */
    readonly hasFileChanges: boolean;
    /** Number of distinct files changed. */
    readonly fileChangeCount: number;
}
/**
 * Pure derivation hook that aggregates an agent's file changes across every
 * execution in a session into one net change per file. A headless building
 * block for platform builders composing a consolidated session-changes surface
 * (typically paired with {@link FileChangesView}); the Console itself renders
 * file changes in the transcript (stamped edit rows + the per-turn decision
 * bar) and does not consume this hook.
 *
 * **Source (ledger-first).** Under apply-then-review the changes live in the
 * file-review ledger; {@link displayFileChangeSets} reads the server's live
 * projection or folds the durable ledger for a terminal execution (whose
 * projection is nil), and each captured change is projected onto the display
 * {@link FileChange} via {@link toDisplayFileChange}. A pre-capture
 * (legacy) execution has no ledger, so it falls back to the tool-call-coupled
 * `ToolCall.file_changes` (#186; removed in a later slice with that field). The
 * two sources are mutually exclusive per execution, so there is no double count.
 *
 * **Traversal.** The ledger is execution-scoped and already includes sub-agent
 * captures (DD-19), so the primary path is one pass per execution. The legacy
 * fallback walks the same surfaces the server-side approval recompute and
 * `MessageThread` walk: `status.messages[].toolCalls` **and**
 * `status.subAgentExecutions[].messages[].toolCalls`. Executions are visited in
 * chronological order, so each path's change list is chronological.
 *
 * **Net-diff (not latest-wins).** `useSessionWriteBacks`/`useSessionArtifacts`
 * dedup by "latest wins" because each entry is a *snapshot* (a PR; a file's
 * final bytes). A {@link FileChange} is a *delta* — an agent often rewrites the
 * same file several times in a turn, and showing only the last edit's diff
 * would misrepresent what changed. So changes to the same path are reduced to a
 * single net change: `before` from the first change, `after` from the last.
 * Because a WHOLE_FILE `after` is a complete file snapshot, `first.before →
 * last.after` is exactly the net change. A group with one change (the common
 * case) is passed through untouched; multi-edit groups synthesize a net
 * {@link FileChange} so every consumer speaks one proto type (DD-007).
 *
 * Counts and unified diffs for whole-file captures stay derivable by the
 * presentation layer (the runner emits 0/"" sentinels), matching the contract
 * the SDK `tool-view` established.
 *
 * @param executions - All executions for a session, in chronological order.
 *   Pass both completed and active-stream executions.
 *
 * @example
 * ```tsx
 * const allExecutions = [
 *   ...conv.completedExecutions,
 *   ...(conv.activeStreamExecution ? [conv.activeStreamExecution] : []),
 * ];
 * const { fileChanges, hasFileChanges } = useSessionFileChanges(allExecutions);
 * ```
 *
 * @see useSessionWriteBacks — git-mode (PR) counterpart, which does drive the
 *   inspector's Changes tab
 * @see useFileChangeContent — resolves a change's before/after text for diffing
 * @see FileChangesView — component that renders this data
 */
export declare function useSessionFileChanges(executions: readonly AgentExecution[]): UseSessionFileChangesReturn;
//# sourceMappingURL=useSessionFileChanges.d.ts.map