# `MingaEditor.Agent.Activity`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/agent/activity.ex#L1)

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.

# `t`

```elixir
@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()
}
```

# `ensure_started_at`

```elixir
@spec ensure_started_at(t()) :: t()
```

Seeds the first visible timestamp without resetting the turn state.

# `file_count`

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

Returns the number of touched files in the current projection.

# `finish_tool`

```elixir
@spec finish_tool(t()) :: t()
```

Clears the active action after a tool finishes.

# `finish_turn`

```elixir
@spec finish_turn(t()) :: t()
```

Marks the turn idle while preserving the last visible summary.

# `new`

```elixir
@spec new() :: t()
```

Creates an empty activity projection.

# `record_file`

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

Records a touched file path for the current turn.

# `set_todos`

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

Replaces the visible todo plan.

# `start_tool`

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

Records that a tool started running.

# `start_turn`

```elixir
@spec start_turn(t()) :: t()
```

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

# `start_turn`

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

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
