2026-09-13 07:42:59 +00:00
|
|
|
//! GrokBoy core: config, streaming chat, tools, ReAct agent, sessions.
|
2026-09-13 07:25:02 +00:00
|
|
|
|
2026-09-13 07:42:59 +00:00
|
|
|
mod agent;
|
2026-09-13 07:57:57 +00:00
|
|
|
mod browser;
|
2026-09-13 08:37:51 +00:00
|
|
|
mod confirm;
|
2026-09-13 07:25:02 +00:00
|
|
|
mod config;
|
|
|
|
|
mod model;
|
2026-09-13 07:42:59 +00:00
|
|
|
mod session;
|
|
|
|
|
mod tools;
|
2026-09-13 07:25:02 +00:00
|
|
|
|
2026-09-13 07:51:13 +00:00
|
|
|
pub use agent::{
|
2026-09-13 09:02:23 +00:00
|
|
|
AGENT_SYSTEM, AgentVerdict, DEFAULT_CONTEXT_CHARS, DEFAULT_MAX_ROUNDS,
|
|
|
|
|
DEFAULT_MAX_ROUNDS_TOTAL, LOOP_GUARD_REPEAT, context_char_budget, max_rounds_budget,
|
|
|
|
|
max_rounds_total_budget, message_char_len, messages_char_len, round_signature, run_agent,
|
|
|
|
|
run_agent_with, tool_call_signature, truncate_messages,
|
2026-09-13 07:51:13 +00:00
|
|
|
};
|
2026-09-13 08:15:27 +00:00
|
|
|
pub use browser::{INSTALL_HINT as BROWSER_INSTALL_HINT, HandoffWait, browser_oneshot, browser_self_test, find_helper_script, wait_for_handoff_resume};
|
2026-09-13 08:37:51 +00:00
|
|
|
pub use confirm::{ConfirmWait, confirm_tool_definition, execute_request_user_confirm, wait_for_user_confirm};
|
2026-09-13 07:25:02 +00:00
|
|
|
pub use config::Config;
|
2026-09-13 07:42:59 +00:00
|
|
|
pub use model::{ChatMessage, FunctionCall, Role, ToolCall, chat_completion, stream_chat};
|
|
|
|
|
pub use session::{Session, load_or_create, load_session, save_session, sessions_dir};
|
2026-09-13 07:51:13 +00:00
|
|
|
pub use tools::{ToolContext, execute_tool, is_completion_tool, tool_definitions};
|
2026-09-13 08:54:48 +00:00
|
|
|
|
|
|
|
|
/// Serialize tests that mutate process env (CONFIRM_AUTO / HANDOFF_AUTO).
|
|
|
|
|
#[cfg(test)]
|
|
|
|
|
pub(crate) mod test_env {
|
|
|
|
|
use std::sync::{Mutex, MutexGuard, OnceLock};
|
|
|
|
|
|
|
|
|
|
pub(crate) fn lock() -> MutexGuard<'static, ()> {
|
|
|
|
|
static M: OnceLock<Mutex<()>> = OnceLock::new();
|
|
|
|
|
M.get_or_init(|| Mutex::new(()))
|
|
|
|
|
.lock()
|
|
|
|
|
.unwrap_or_else(|e| e.into_inner())
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|