behest-runtime 0.5.7

Async runtime glue connecting sans-IO state machine to real I/O for the behest agent runtime
Documentation

Async runtime glue connecting the sans-IO state machine to real I/O.

The [Runtime] struct orchestrates the full agent execution loop:

  1. Receives a user message
  2. Builds context (system prompt + history)
  3. Drives the sans-IO state machine via [transition]
  4. Executes actions: model calls, tool execution, memory compaction, approval
  5. Emits events through the hook stack
  6. Returns when the run finishes or is aborted

Architecture

User Message
    │
    ▼
Runtime::run()
    │
    ├─► build context (system prompt + history + RAG)
    ├─► transition(state, input) → (new_state, actions)
    │       │
    │       ├─► RequestModel  → provider.stream() → events → ModelCompleted
    │       ├─► ExecuteTool   → tool_registry.execute() → ToolResultReceived
    │       ├─► RequestToolApproval → approval_gate.request() → await decision
    │       ├─► CompactMemory → memory compaction → MemoryCompactionCompleted
    │       ├─► FinishRun     → return RunOutput
    │       └─► AbortRun      → return error
    │
    └─► emit events → HookStack.dispatch() → EventActions