MingaEditor.Agent.UIState.Compaction (Minga v0.1.0)

Copy Markdown View Source

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

Summary

Types

action()

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

execution()

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

pct()

@type pct() :: non_neg_integer()

t()

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

threshold()

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

Functions

finish(compaction)

@spec finish(t()) :: t()

new()

@spec new() :: t()

record_context_usage(compaction, fill_pct, status, warn, auto, schedulable?)

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

requested?(compaction)

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

status_changed(state, arg2, warn, auto, schedulable?)

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