System Shape
Dependency direction runs from host-owned surfaces inward to the runtime, then into the sans-IO protocol model. Providers, protocol plugins, tools, stores, and plugins are replaceable edges around the runtime core.
TUI, setup, resume/fork, --print
(bin + lib half hosting LashConfig)"] Facade["lash (facade)
app-facing core/session/turn API"] Export["lash-export
multi-session tree → HTML / JSON"] TraceViewer["lash-trace-viewer
JSONL trace browser"] end subgraph Runtime["Async host runtime"] L["lash-core
LashRuntime, Session, Store, PluginHost"] EffectController["RuntimeEffectController
durable side-effect boundary"] Env["RuntimeEnvironment
shared runtime infrastructure"] Graph["SessionGraph
durable event graph"] Read["SessionReadView
public read seam"] Tools["Tool dispatch
dynamic tools, built-ins"] Stores["lash-sqlite-store / lash-postgres-store
runtime persistence"] Trace["lash-trace
JSONL trace records"] end subgraph Kernel["Pure protocol kernel"] S["lash-sansio
TurnMachine, Effect, Response"] end subgraph LangRuntime["RLM language runtime"] LLR["lash-lashlang-runtime
Lashlang surface, artifacts, process engine"] LL["lashlang
parser, AST, VM, persistent REPL state"] end subgraph Extensions["Replaceable edges"] Protocols["protocol plugins
standard + rlm"] Providers["provider crates
OpenAI, Codex, Anthropic, Google"] Plugins["tool/plugin crates
llm_query, plan, memory, context, UI activity"] Mcp["lash-plugin-mcp
rmcp-based MCP plugin
stdio / streamable-http / sse"] Subagents["lash-subagents
spawn_agent host + RLM bridge"] end CLI --> Facade CLI --> L Facade --> L Export --> Read TraceViewer --> Trace L --> Env L --> S L --> EffectController EffectController --> Env L --> Graph L --> Stores L --> Trace Graph --> Read L --> Tools Protocols --> L Protocols --> LLR LLR --> L LLR --> LL Providers --> L Plugins --> L Mcp --> L Subagents --> L
Current KPIs
These figures are workspace-level and exclude generated build output.
*.rs outside target; Rust dominates the workspace.standard uses native tool calls; rlm drives work through Lashlang and can switch to a fresh AgentFrame via continue_as.Authority Boundaries
The durable source of truth is the session graph. Everything else is either an execution environment, an external transport, or a projection.
-
Graph is durable.
SessionGraphstores conversation records, tool events, protocol events, plugin nodes, active-path metadata, checkpoint references, and replay material. -
Projection is derived.
SessionReadViewandChronologicalProjectionread graph state into semantic order. The CLI'sUiTimelineis downstream of that and never writes persistence. -
Protocol plugins own protocol behavior.
ProtocolBuildInput,TurnDriverPreamble,ContextProjector, andProtocolDriverHandledecide what providers see and how model output advances a turn. Runtime-ownedProtocolBuildInputcarries the effective tool catalog and generic protocol context into the protocol plugin; RLM builds its Lashlang host environment and projected read-only bindings (e.g.,history) in the RLM/Lashlang runtime path. -
Tool output is projected, not raw.
The durable session graph stores each tool call's full
ToolCallOutput, while theToolOutputBudgetPluginFactoryruns a single tool-result projector to derive the budgeted model-facingModelToolReturnthat the next request and rolled-up history see. -
AgentFrame switches are runtime continuations.
A turn can finish as
TurnOutcome::AgentFrameSwitch { frame_id, task }, which transparently activates an RLM AgentFrame with a fresh window. App hosts that useTurnBuilder::stream_to,run, or pull-stylestreamget the finalTurnResult; lower-level runtime hosts can still inspect the underlying AgentFrame chain. -
Runtime host capabilities are trait-shaped.
RuntimeSessionServicesimplements focused plugin host traits for snapshots, tool catalogs, session tool state, session lifecycle, turns, processes, the session graph, prompt state, direct completion, durable tool effects, and tracing. Public tools see these through namedToolContextcapabilities, not through a general host escape hatch. A configured process registry enables the generic process admin plane; protocol/language runtimes decide how that plane is exposed to authored code.ProcessCancelAbilitylets the host customize intentional cancellation.