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 compaction;
50pub mod consolidation;
51pub mod context;
52pub mod device;
53pub mod digest;
54pub mod discovery;
55pub mod governor;
56pub mod ingest;
57pub mod injection;
58pub mod interview;
59pub mod knowledge;
60pub mod learning;
61pub mod manifest;
62pub mod mcp;
63pub mod mcp_handler;
64pub mod memory;
65pub mod normalization;
66pub mod obsidian;
67pub mod obsidian_tools;
68pub mod orchestration;
69pub mod policy;
70pub mod prompt;
71pub mod ranking;
72pub mod recommendations;
73pub mod retrieval;
74pub mod retrieval_strategy;
75#[cfg(target_os = "windows")]
76pub mod sandbox_windows;
77pub mod script_runner;
78pub mod services;
79pub mod skills;
80pub mod speculative;
81pub mod subagents;
82pub mod task_state;
83pub mod tool_output_filter;
84pub mod tool_search;
85pub mod tools;
86pub mod topic;
87pub mod typestate;
88pub mod wasm;
89pub mod workspace;
90
91#[cfg(test)]
92#[allow(dead_code)] // Used by unix-gated script_runner tests
93mod test_support;