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

Pure owner for agent context-compaction threshold and execution state.

# `action`

```elixir
@type action() :: :none | {:warn, pct()} | :schedule
```

# `execution`

```elixir
@type execution() :: :idle | {:deferred, pct()} | :requested
```

# `pct`

```elixir
@type pct() :: non_neg_integer()
```

# `t`

```elixir
@type t() :: %MingaEditor.Agent.UIState.Compaction{
  execution: execution(),
  threshold: threshold()
}
```

# `threshold`

```elixir
@type threshold() :: :fresh | :warned | :triggered
```

# `finish`

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

# `new`

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

# `record_context_usage`

```elixir
@spec record_context_usage(t(), pct(), atom(), pct(), pct(), boolean()) ::
  {t(), action()}
```

# `requested?`

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

# `status_changed`

```elixir
@spec status_changed(t(), atom(), pct(), pct(), boolean()) :: {t(), action()}
```

---

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