Planck.Agent.TurnContext (Planck.Agent v0.1.7)

Copy Markdown View Source

Pure queries over an agent's in-memory message history.

These functions inspect lists of Planck.Agent.Message values without touching the database or modifying any state.

Summary

Functions

Return true if any user or agent-response message arrived at or after stream_start (i.e. was appended during streaming and not yet seen by the LLM).

Return the messages since the last {:custom, :summary} checkpoint.

Functions

has_pending_input?(messages, stream_start)

@spec has_pending_input?([Planck.Agent.Message.t()], non_neg_integer()) :: boolean()

Return true if any user or agent-response message arrived at or after stream_start (i.e. was appended during streaming and not yet seen by the LLM).

messages_since_last_summary(messages)

@spec messages_since_last_summary([Planck.Agent.Message.t()]) :: [
  Planck.Agent.Message.t()
]

Return the messages since the last {:custom, :summary} checkpoint.

When no summary exists the full list is returned. When one exists the summary message itself is included as the head.