Skip to main content

roboticus_agent/
lib.rs

1//! # roboticus-agent
2//!
3//! Agent core for the Roboticus runtime. The central module is `agent_loop`
4//! (mapped from `loop.rs`), which implements a ReAct reasoning loop as a typed
5//! state machine: Think → Act → Observe → Persist, with idle/loop detection
6//! and financial guards.
7//!
8//! ## Key Types
9//!
10//! - `agent_loop` -- ReAct state machine with typed transitions via `typestate`
11//! - [`tools::ToolRegistry`] -- Trait-based tool system (10 categories)
12//! - [`policy::PolicyEngine`] -- Rule-based policy evaluation
13//! - [`retrieval::MemoryRetriever`] -- Hybrid RAG pipeline (FTS5 + vector cosine)
14//! - [`analyzer::ContextAnalyzer`] -- Topic extraction, sentiment, complexity
15//! - [`recommendations::RecommendationEngine`] -- Proactive suggestions
16//! - [`obsidian::ObsidianVault`] -- Obsidian vault integration
17//! - [`skills::SkillLoader`] / [`skills::SkillRegistry`] -- Dual-format skill system
18//!
19//! ## Modules
20//!
21//! - `context` -- Progressive context loading (4 levels) and compression
22//! - `injection` -- 4-layer prompt injection defense
23//! - `prompt` -- System prompt builder with HMAC trust boundaries
24//! - `memory` -- Memory budget manager and turn ingestion
25//! - `retrieval` -- Hybrid search RAG pipeline with content chunking
26//! - `knowledge` -- KnowledgeSource trait and aggregation
27//! - `discovery` -- Capability discovery across tools, skills, plugins
28//! - `digest` -- Turn digest and history summarization
29//! - `device` -- Device context and hardware info
30//! - `workspace` -- Workspace state (file tree, git status, project metadata)
31//! - `orchestration` -- Multi-agent task decomposition
32//! - `governor` -- Rate governor and concurrency limits
33//! - `typestate` -- Compile-time valid state transitions
34//! - `speculative` -- Parallel branch evaluation with best-result selection
35//! - `manifest` -- Agent capability declarations
36//! - `services` -- Service locator and dependency wiring
37//! - `mcp` -- Model Context Protocol client integration
38//! - `wasm` -- WASM plugin runtime
39//! - `obsidian` / `obsidian_tools` -- Vault integration and read/write/search tools
40//! - `skills` / `script_runner` -- Skill loading, execution, sandboxed scripts
41//! - `analyzer` / `recommendations` -- Conversation analysis and proactive suggestions
42
43pub mod action_planner;
44#[path = "loop.rs"]
45pub mod agent_loop;
46pub mod analyzer;
47pub mod approvals;
48pub mod capability;
49pub mod context;
50pub mod device;
51pub mod digest;
52pub mod discovery;
53pub mod governor;
54pub mod ingest;
55pub mod injection;
56pub mod interview;
57pub mod knowledge;
58pub mod learning;
59pub mod manifest;
60pub mod mcp;
61pub mod mcp_handler;
62pub mod memory;
63pub mod normalization;
64pub mod obsidian;
65pub mod obsidian_tools;
66pub mod orchestration;
67pub mod policy;
68pub mod prompt;
69pub mod ranking;
70pub mod recommendations;
71pub mod retrieval;
72pub mod retrieval_strategy;
73pub mod script_runner;
74pub mod services;
75pub mod skills;
76pub mod speculative;
77pub mod subagents;
78pub mod task_state;
79pub mod tool_output_filter;
80pub mod tool_search;
81pub mod tools;
82pub mod typestate;
83pub mod wasm;
84pub mod workspace;
85
86#[cfg(test)]
87#[allow(dead_code)] // Used by unix-gated script_runner tests
88mod test_support;