# `MingaEditor.State.AgentGroup`
[🔗](https://github.com/jsmestad/minga/blob/main/lib/minga_editor/state/agent_group.ex#L1)

An agent group in the tab bar.

Each agent session gets its own group. The group tracks the agent's
status, the files it modified, and provides visual identity (icon,
color, label) in the tab bar.

Tabs with `group_id: 0` are ungrouped (the user's own tabs). Tabs
with `group_id > 0` belong to an agent group. There is no "manual
workspace" concept; ungrouped tabs are simply tabs without a group.

## Colors

Each group has a 24-bit RGB accent color for group separators and
capsule rendering. Colors cycle through a 6-color palette.

# `agent_status`

```elixir
@type agent_status() :: :idle | :thinking | :tool_executing | :error | nil
```

Agent status for group display.

# `icon`

```elixir
@type icon() :: String.t()
```

SF Symbol name for group icon.

# `t`

```elixir
@type t() :: %MingaEditor.State.AgentGroup{
  agent_status: agent_status(),
  color: non_neg_integer(),
  custom_name: boolean(),
  icon: icon(),
  id: pos_integer(),
  label: String.t(),
  session: pid() | nil
}
```

An agent group.

# `auto_name`

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

Auto-names the group from an agent prompt, unless the user has
set a custom name. Takes first line, truncates to 30 chars.

# `new`

```elixir
@spec new(pos_integer(), String.t(), pid() | nil) :: t()
```

Creates a new agent group with a unique id.

# `rename`

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

Renames the group (marks as custom so auto-naming stops).

# `set_agent_status`

```elixir
@spec set_agent_status(t(), agent_status()) :: t()
```

Sets the agent status on the group.

# `set_icon`

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

Sets the group icon (SF Symbol name).

# `set_label`

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

Updates the group label.

---

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