# `MingaEditor.Shell.Board.Card`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/shell/board/card.ex#L1)

A card on The Board representing an agent session or manual workspace.

Each card carries a workspace snapshot (buffers, editing state) that
gets restored when the user zooms in and captured when they zoom out.
This is the same pattern as tab context snapshots in Shell.Traditional.

The "You" card has `session: nil` and provides the traditional editing
experience without an agent.

## Status lifecycle

    :idle → :working → :iterating → :done
                ↓           ↓
            :needs_you   :errored

`:working` means the agent is actively generating. `:iterating` means
it's running tests or linter feedback loops. `:needs_you` means it
hit a wall and needs human input (approval, clarifying question).

# `id`

```elixir
@type id() :: pos_integer()
```

# `status`

```elixir
@type status() :: :idle | :working | :iterating | :needs_you | :done | :errored
```

# `t`

```elixir
@type t() :: %MingaEditor.Shell.Board.Card{
  created_at: DateTime.t(),
  id: id(),
  kind: :you | :agent,
  model: String.t() | nil,
  recent_files: [String.t()],
  session: pid() | nil,
  sparkline: [float()],
  status: status(),
  task: String.t(),
  workspace: map() | nil
}
```

# `attach_session`

```elixir
@spec attach_session(t(), pid()) :: t()
```

Attaches an agent session PID to the card.

# `clear_workspace`

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

Clears the stored workspace snapshot.

# `new`

```elixir
@spec new(
  id(),
  keyword()
) :: t()
```

Creates a new card with the given attributes.

# `set_recent_files`

```elixir
@spec set_recent_files(t(), [String.t()]) :: t()
```

Updates the list of recently touched files.

# `set_status`

```elixir
@spec set_status(t(), status()) :: t()
```

Transitions the card to a new status.

# `store_workspace`

```elixir
@spec store_workspace(t(), map()) :: t()
```

Stores a workspace snapshot on the card.

# `you_card?`

```elixir
@spec you_card?(t()) :: boolean()
```

Returns true if this is the 'You' card (manual editing).

---

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