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.
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: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.