Skip to main content

Module state

Module state 

Source
Expand description

Domain-scoped state traits for AppState decomposition.

Phase 1 of the AppState god-object decomposition: define traits that declare which domain surfaces a function actually needs. Functions should accept impl HasInference + HasAgent instead of &AppState when they only need those two domains.

Phase 2 (future): extract sub-states from AppState and implement these traits on the narrower types, enabling true separation.

Traitsยง

HasAgent
Agent tools: tool registry, capabilities, policy, approvals, plugins.
HasChannels
Channel adapters: router and per-platform adapters.
HasCore
Core infrastructure: database, config, HMAC, rate limiting.
HasInference
LLM inference: model routing, quality tracking, latency, caching.
HasMemory
Memory and retrieval: memory retriever, ANN index, obsidian vault.
HasWallet
Wallet and financial services.