Skip to main content

matrixcode_core/
lib.rs

1//! MatrixCode Core - Agent Logic, No UI
2//!
3//! This crate contains only Agent core logic, no UI handling.
4//! All outputs are structured AgentEvent, UI layer renders them.
5
6pub mod agent;
7pub mod approval;
8pub mod cancel;
9pub mod command;
10pub mod compress;
11pub mod config;
12pub mod constants;
13pub mod debug;
14pub mod event;
15pub mod lsp;
16pub mod mcp;
17pub mod matrixrpc;
18pub mod memory;
19pub mod models;
20pub mod overview;
21pub mod path_validator;
22pub mod prompt;
23pub mod protocol;
24pub mod providers;
25pub mod session;
26pub mod skills;
27pub mod tokenizer;
28pub mod tools;
29pub mod truncate;
30pub mod workflow;
31pub mod workspace;
32
33// Public exports
34pub use agent::{Agent, AgentBuilder};
35pub use approval::ApproveMode;
36pub use config::Config;
37pub use debug::{DebugLog, DebugStats, debug_log, set_debug_event_sender};
38pub use event::{AgentEvent, EventCollector, EventData, EventType, HistoryMessage, SessionListItem};
39pub use lsp::{LspManager, LspServerInfo, LspServerStatus};
40pub use providers::{
41    ChatRequest, ChatResponse, ContentBlock, Message, MessageContent, Provider, ProviderType, Role,
42    create_minimal_provider, create_provider, create_provider_with_headers, infer_provider_type,
43};
44pub use session::{
45    MessageSummary, Session, SessionFileLock, SessionIndex, SessionManager, SessionMetadata,
46};
47pub use truncate::{find_boundary, truncate_bytes, truncate_chars, truncate_with_suffix};
48
49// Workflow exports
50pub use workflow::{
51    AiExecutor, ConditionExecutor, EdgeDef, ExecutorFactory, FailureStrategy, NodeDef,
52    NodeExecutor, NodeType, Rule, RuleEngine, TemplateRenderer, ToolExecutor, ValidateExecutor,
53    ValidationResult, WorkflowContext, WorkflowDef, WorkflowEngine, WorkflowPersistence,
54    WorkflowStatus, evaluate_expression, parse_workflow, parse_workflow_from_file, render_template,
55    to_yaml,
56};
57
58/// Core version
59pub const VERSION: &str = env!("CARGO_PKG_VERSION");