MingaEditor.Agent.EditTimeline (Minga v0.1.0)

Copy Markdown View Source

Per-file ordered sequence of agent edit snapshots.

Records a snapshot after each tool-driven file change so the user can scrub through the agent's edit history. Each entry stores the file content after that edit, keyed by tool call ID.

Cumulative hunks are the per-path review authority. They represent the first pre-agent content to latest post-image without storing another full baseline copy.

Summary

Types

file_summary()

@type file_summary() :: %{
  path: String.t(),
  entry_count: pos_integer(),
  lines_added: non_neg_integer(),
  lines_removed: non_neg_integer(),
  review_status: review_status()
}

review_status()

@type review_status() :: :pending | :reviewing

t()

@type t() :: %MingaEditor.Agent.EditTimeline{
  cumulative_hunks: %{required(String.t()) => [Minga.Core.Diff.hunk()]},
  entries: %{required(String.t()) => [MingaEditor.Agent.EditTimeline.Entry.t()]},
  viewing: %{required(String.t()) => non_neg_integer() | nil}
}

Functions

content_at(timeline, path, index)

@spec content_at(t(), String.t(), non_neg_integer()) :: {:ok, String.t()} | :error

cumulative_hunks(edit_timeline, path)

@spec cumulative_hunks(t(), String.t()) :: [Minga.Core.Diff.hunk()]

entries_for(edit_timeline, path)

@spec entries_for(t(), String.t()) :: [MingaEditor.Agent.EditTimeline.Entry.t()]

entry_count(edit_timeline, path)

@spec entry_count(t(), String.t()) :: non_neg_integer()

file_summaries(timeline)

@spec file_summaries(t()) :: [file_summary()]

go_live(timeline, path)

@spec go_live(t(), String.t()) :: t()

has_entries?(edit_timeline, path)

@spec has_entries?(t(), String.t()) :: boolean()

new()

@spec new() :: t()

record_edit(timeline, path, tool_call_id, tool_name, before_content, after_content)

@spec record_edit(t(), String.t(), String.t(), String.t(), String.t(), String.t()) ::
  t()

reproject(timeline, path, original_lines, materialized_lines)

@spec reproject(t(), String.t(), [String.t()], [String.t()]) :: t()

reset(timeline)

@spec reset(t()) :: t()

set_viewing(timeline, path, index)

@spec set_viewing(t(), String.t(), non_neg_integer()) :: t()

viewing_index(edit_timeline, path)

@spec viewing_index(t(), String.t()) :: non_neg_integer() | nil