Expand description
Library crate for mahbot.
The binary (main.rs) uses the same module tree. This crate root
provides the public API for both the daemon and external crates.
Modules§
- agent
- board
- Ticket/board system — Turso-backed task management.
- channels
- chat_
history - Chat history persistence — stores all chat messages (both user and agent)
for GUI display and history loading. Messages are written at the point of
delivery: incoming user messages from the GUI send path, outgoing agent
responses from
GuiChannel::send(). - config
- config_
db - Config key-value and per-role model overrides stored in
config.db. - debug
- Debug query tool — read-only SQL diagnostics for mahbot’s databases.
- diff_
parse - Git diff parsing — parse unified diff output into structured data.
- embedder
- Semantic (vector/embedding) search for archived tickets.
- extraction
- Structured extraction from conversation history.
- gui
- Native Iced dashboard — application entry point, navigation, and shared state.
- logs
- Turso-backed log storage.
- maintainer
- Maintainer — autonomous periodic codebase investigation agent.
- management
- Board poller — picks up tickets from the board and dispatches agents.
- manager_
queue - Manager queue — serializes all Manager agent requests through a single consumer task. Eliminates concurrent Manager agent races by processing one job at a time.
- prompt
- providers
- Provider subsystem for model inference backends.
- registry
- Global registry of running agents with cancellation support.
- role
- Role metadata consolidation — single source of truth for all static
Roleproperties. - search_
engine - Shared per-workspace search engine registry.
- self_
update - Self-update logic — single-instance guarding, build, binary swap, and restart.
- session
- Session persistence — Turso-backed store + native history decoding.
- shutdown
- Global shutdown infrastructure.
- skills
- Skills subsystem — loads workspace skills and injects them into prompts.
- stats
- Per-agent tool usage statistics stored in
stats.db. - ticket_
buffer - Ticket status accumulation buffer — piggyback non-critical transitions onto critical notifications and user messages.
- tools
- Tool implementations for agent-callable capabilities.
- turso
- users
- Per-user identity, permissions, workspace and role preferences, and channel bindings.
- util
- Utility modules for shared helper functions.
- vector
- Vector operations — cosine similarity, hybrid merge, serialization.
- workspace
- Workspace storage — persisted workspace metadata and contexts.
Macros§
- global_
store - Declare a global
OnceCell-backed store withinit_global()andstore().
Structs§
- Agent
- Running context for an agent turn.
- Channel
Message - Channel
Registry - Registry of all active channels, keyed by
Channel::name(). - Chat
Message - Chat
Request - Chat
Response - Diagnostics
Commands - Discovered diagnostic commands for a workspace.
- Provider
Usage - Reasoning
- Role
Iter - An iterator over the variants of Role
- Send
Message - An outbound message to deliver on a channel.
- Skill
- A skill is a user-defined or community-built capability.
Skills live in
<workspace>/skills/<name>/(also<workspace>/.claude/skills/<name>/and<workspace>/.agents/skills/<name>/) and are defined viaSKILL.md. They provide instructions and context for the agent. - Stream
Chunk - Tool
Call - Tool
Spec - Tool
Usage - Accumulated usage stats for a single tool, collected in-memory during
an agent’s work loop and flushed to
stats.dbon session finalization. - Verdict
- Result of a single review or QA verification pass.
- Workspace
- A persisted workspace entry.
Enums§
- Chat
Direction - Direction of a chat message: from the user or from an agent.
- Chat
Event - A chat event broadcast to GUI subscribers.
- Command
- Role
- Typed role identifier for agents.
- Stream
Error - Structured error for streaming responses.
- Stream
Event - Tool
Output Phase - Phase of tool output notification.
Statics§
- CHANNEL_
REGISTRY - Global channel registry — channels register during startup.
- CHAT_
BROADCAST - Global broadcast channel for live chat events in the GUI.
Set during
init_message_pipeline. Capacity 256 to preventLaggederrors in burst scenarios. - GUI_
MESSAGE_ TX - Global sender for GUI-to-channel messages.
The Iced UI pushes
ChannelMessagevalues here;GuiChannel::listen()reads them from the paired receiver and forwards them into the pipeline. - MESSAGE_
TX - Global sender for the pipeline message channel.
Set during
init_message_pipeline, used byGuiChannel::listen()to forward GUI-originated messages into the shared pipeline.
Traits§
Functions§
- channel_
registry - Shorthand to get the global channel registry. Panics if not initialized — call during startup after channels are set up.
- generate_
id - Generate a unique identifier (10-char NanoID, ~60 bits entropy).
- generate_
suffix - Generate a short unique suffix (6-char NanoID, ~36 bits entropy). Used to disambiguate retry cycles in parallel agent dispatches.