use super::{ProviderItem, ProviderResult};
pub trait ContextProvider: Send + Sync {
fn id(&self) -> &str;
fn display_name(&self) -> &str;
fn supported_actions(&self) -> &[&str];
fn execute(&self, action: &str, params: &ProviderParams) -> Result<ProviderResult, String>;
fn cache_ttl_secs(&self) -> u64 {
120
}
fn requires_auth(&self) -> bool {
true
}
fn is_available(&self) -> bool;
}
#[derive(Debug, Clone, Default)]
pub struct ProviderParams {
pub project: Option<String>,
pub state: Option<String>,
pub limit: Option<usize>,
pub query: Option<String>,
pub id: Option<String>,
}
#[derive(Debug, Clone)]
pub struct ContextPacket {
pub provider_id: String,
pub action: String,
pub items: Vec<ProviderItem>,
pub token_count_raw: usize,
pub token_count_compressed: usize,
pub cache_hit: bool,
}