MingaEditor.Agent.Activity (Minga v0.1.0)

Copy Markdown View Source

Turn-scoped activity projection for the agent UI.

The provider owns the underlying tool and todo state. This struct is the editor's render projection: it records the current turn start time, latest visible todo plan, active action, tool count, and touched file set.

Summary

Functions

Seeds the first visible timestamp without resetting the turn state.

Returns the number of touched files in the current projection.

Clears the active action after a tool finishes.

Marks the turn idle while preserving the last visible summary.

Creates an empty activity projection.

Records a touched file path for the current turn.

Replaces the visible todo plan.

Records that a tool started running.

Marks the beginning of a turn, preserving the visible plan.

Marks the beginning of a turn with a caller-provided timestamp.

Types

t()

@type t() :: %MingaEditor.Agent.Activity{
  active_action: String.t(),
  file_paths: MapSet.t(String.t()),
  started_at: DateTime.t() | nil,
  todos: [MingaAgent.TodoItem.t()],
  tool_count: non_neg_integer()
}

Functions

ensure_started_at(activity)

@spec ensure_started_at(t()) :: t()

Seeds the first visible timestamp without resetting the turn state.

file_count(activity)

@spec file_count(t()) :: non_neg_integer()

Returns the number of touched files in the current projection.

finish_tool(activity)

@spec finish_tool(t()) :: t()

Clears the active action after a tool finishes.

finish_turn(activity)

@spec finish_turn(t()) :: t()

Marks the turn idle while preserving the last visible summary.

new()

@spec new() :: t()

Creates an empty activity projection.

record_file(activity, path)

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

Records a touched file path for the current turn.

set_todos(activity, todos)

@spec set_todos(t(), [MingaAgent.TodoItem.t()]) :: t()

Replaces the visible todo plan.

start_tool(activity, tool_name)

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

Records that a tool started running.

start_turn(activity)

@spec start_turn(t()) :: t()

Marks the beginning of a turn, preserving the visible plan.

start_turn(activity, now)

@spec start_turn(t(), DateTime.t()) :: t()

Marks the beginning of a turn with a caller-provided timestamp.