oxicode_agent/advisor/mod.rs
1//! Advisor subsystem — a read-only reviewer agent that shadows the primary
2//! agent and surfaces advice (`nit`/`concern`/`blocker`) via an `advise` tool.
3//!
4//! Ported from omp `packages/coding-agent/src/advisor/`. The **engine** lives
5//! here (in oxicode-agent) so the SDK can expose it; **host wiring** —
6//! `AgentSession` integration, the file-backed transcript recorder, WATCHDOG.md
7//! discovery, and the `/advisor` slash command — lives in the product
8//! (oxicode-cli).
9//!
10//! # Attribution
11//!
12//! Translated to Rust from omp (oh-my-pi), which is MIT licensed
13//! (Copyright (c) 2025 Mario Zechner; Copyright (c) 2025-2026 Can Bölük).
14//! oxicode's translation remains under oxicode's own MIT license.
15
16pub mod advise_tool;
17pub mod agent_advisor;
18pub mod channels;
19pub mod emission_guard;
20pub mod runtime;
21pub mod types;
22
23pub use advise_tool::{AdviseTool, EnqueueAdviceFn};
24pub use agent_advisor::AgentAdvisor;
25pub use channels::{
26 format_advisory_batch, is_immune_turn_active, is_interrupting_severity,
27 resolve_delivery_channel,
28};
29pub use emission_guard::{AdvisorEmissionGuard, normalize_advisor_note};
30pub use runtime::{AdvisorAgent, AdvisorRuntime, AdvisorRuntimeHost};
31pub use types::{
32 ADVISOR_GUIDANCE, AdvisorDeliveryChannel, AdvisorNote, AdvisorSeverity, DeliveryOpts,
33};
34
35/// Tool names handed to the advisor agent — side-effect-free investigation
36/// only. omp `ADVISOR_READONLY_TOOL_NAMES` is `read`/`grep`/`glob`; oxicode's glob
37/// equivalent is `find`.
38pub const ADVISOR_READONLY_TOOL_NAMES: &[&str] = &["read", "grep", "find"];
39
40/// The advisor agent's system prompt (omp `prompts/advisor/system.md`). The
41/// host assembles the full advisor system prompt from this + optional
42/// context-files/watchdog blocks.
43pub const ADVISOR_SYSTEM_PROMPT: &str = include_str!("prompts/system.md");