Owns transcript save intent, timer correlation, and retry state.
Session performs each write synchronously, so a dirty flag is sufficient: no transcript change can overtake an in-flight write. Session owns timer and storage effects; this value only calculates bookkeeping transitions.
Summary
Types
Focused transcript persistence bookkeeping.
A semantic timer token paired with the runtime timer reference.
Functions
Cancels bookkeeping for the current timer and returns its runtime effect handle.
Marks the transcript dirty and returns the timer Session must cancel.
Returns whether the transcript has unsaved changes.
Returns whether transcript persistence is enabled.
Records a failed write and returns the next retry delay.
Creates persistence bookkeeping for one Session.
Marks a restored transcript as already persisted.
Consumes a due save token or rejects stale timer delivery.
Records a successful synchronous write.
Installs a runtime timer under its semantic delivery token.
Types
@type t() :: %MingaAgent.Session.Persistence{ dirty?: boolean(), enabled?: boolean(), retry_count: non_neg_integer(), timer: timer() | nil }
Focused transcript persistence bookkeeping.
A semantic timer token paired with the runtime timer reference.
Functions
Cancels bookkeeping for the current timer and returns its runtime effect handle.
Marks the transcript dirty and returns the timer Session must cancel.
Returns whether the transcript has unsaved changes.
Returns whether transcript persistence is enabled.
@spec failed(t()) :: {t(), pos_integer()}
Records a failed write and returns the next retry delay.
Creates persistence bookkeeping for one Session.
Marks a restored transcript as already persisted.
Consumes a due save token or rejects stale timer delivery.
Records a successful synchronous write.
Installs a runtime timer under its semantic delivery token.