One small interface

A provider adapter implements two methods.
Agent.run() calls complete(). Agent.streamEvents() calls stream() and forwards its provider tokens and metadata before parsing the complete action envelope. Implement both methods when building an adapter.
Keep adapters thin. Do not rebuild transcripts or summarize state inside the adapter. input.prompt is already the compiled causal view.

Included adapters

  • MockModel: deterministic tests, no provider.
  • AnthropicModel: a thin HTTP adapter, no Anthropic SDK dependency.
  • createModelFromEnv(): picks mock or Anthropic from environment variables.

What the agent receives

The provider gets:
The provider still sees a linear token sequence. That sequence is a temporary compilation of graph state, not stored chat history.
stream() and streamText() remain convenience methods that yield the accepted final answer after the complete action has been parsed and committed. Provider streaming is observable through streamEvents(); partial action text is not executed before the envelope is complete. Next: Persist and stream.