1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! # aonyx-agent
//!
//! The agent loop and its inner subsystems.
//!
//! ## Subsystems
//! - [`runner`] — the main `AgentRunner::run(session, msg)` loop.
//! - [`compaction`] — context-window pressure monitor + summarization triggers.
//! - [`classifier`] — routes user input to a prompt template (chitchat / task / recall / code / research).
//! - [`approval`] — gate around destructive tool calls.
//! - [`subagent`] — spawn isolated child agents with a whitelisted tool set (V2).
//!
//! ## Loop sketch
//! ```text
//! loop {
//! inject(skills_active(query, project));
//! inject(memory_recall(query, k=10));
//! chunks = llm.chat_stream(messages, tools).await;
//! for tool_call in chunks.tool_calls() {
//! approval.check(tool_call)?;
//! result = tools.invoke(tool_call).await?;
//! messages.push(result);
//! }
//! if chunks.no_tool_call() { break; }
//! }
//! post_turn::maybe_diary_append();
//! post_turn::maybe_kg_upsert();
//! ```
pub use ApprovalPolicy;
pub use ;