use std::path::PathBuf;
use codewhale_core::request::{Message, SystemPrompt};
use crate::types::{
CommandApprovalMode, CommandCurrency, CommandMode, CommandProviderId, CommandReasoningEffort,
};
pub trait CommandSessionContext {
fn session_id(&self) -> Option<String>;
fn api_messages(&self) -> Vec<Message>;
fn add_message(&mut self, message: Message);
fn queued_message_count(&self) -> usize;
fn remove_queued_message(&mut self, index: usize) -> Result<(), String>;
fn total_tokens(&self) -> u64;
}
pub trait CommandModelContext {
fn current_model(&self) -> String;
fn auto_model(&self) -> bool;
fn set_model_selection(&mut self, model: String, provider: Option<CommandProviderId>);
fn reasoning_effort(&self) -> CommandReasoningEffort;
fn provider_identity(&self) -> Option<CommandProviderId>;
fn fallback_chain(&self) -> Vec<CommandProviderId>;
}
pub trait CommandCostContext {
fn display_currency(&self) -> CommandCurrency;
fn session_cost_for_currency(&self, currency: CommandCurrency) -> f64;
fn subagent_cost_for_currency(&self, currency: CommandCurrency) -> f64;
fn accrue_cost_estimate(&mut self, amount: f64, currency: CommandCurrency);
fn record_turn_cost(&mut self, amount: f64, currency: CommandCurrency, route_receipt: bool);
}
pub trait CommandModePolicyContext {
fn mode(&self) -> CommandMode;
fn set_mode(&mut self, mode: CommandMode);
fn approval_mode(&self) -> CommandApprovalMode;
fn allow_shell(&self) -> bool;
fn set_shell_access(&mut self, allow: bool);
fn policy_locked(&self) -> bool;
}
pub trait CommandSystemPromptContext {
fn system_prompt(&self) -> Option<SystemPrompt>;
}
pub trait CommandSkillsContext {
fn active_skill(&self) -> Option<String>;
fn active_skill_provenance(&self) -> Option<String>;
fn refresh_skill_cache(&mut self);
}
pub trait CommandWorkspaceContext {
fn workspace(&self) -> PathBuf;
fn work_state_snapshot(&self) -> Result<Option<String>, String>;
}