A context compactor that maintains a single persistent 'Scratchpad' or 'State Tracker' event at the top of the context history.
When compaction is triggered, it merges new raw events into the existing Scratchpad event and discards them from the active history view.
Compacts the context in place.
The current invocation context.
Determines whether the context should be compacted.
A boolean or a promise resolving to a boolean indicating if compaction should occur.
A context compactor that maintains a single persistent 'Scratchpad' or 'State Tracker' event at the top of the context history.
When compaction is triggered, it merges new raw events into the existing Scratchpad event and discards them from the active history view.