use serde::{Deserialize, Serialize};
pub const SYSTEM_SESSION_UUID: &str = "00000000-0000-0000-0000-000000000000";
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "method", content = "params")]
pub enum KernelRequest {
InstallCapsule {
source: String,
workspace: bool,
},
ApproveCapability {
request_id: String,
signature: String,
},
ListCapsules,
ReloadCapsules,
GetCommands,
GetCapsuleMetadata,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "status", content = "data")]
pub enum KernelResponse {
Success(serde_json::Value),
Commands(Vec<CommandInfo>),
CapsuleMetadata(Vec<CapsuleMetadataEntry>),
Error(String),
ApprovalRequired {
request_id: String,
description: String,
capabilities: Vec<String>,
},
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CapsuleMetadataEntry {
pub name: String,
pub llm_providers: Vec<LlmProviderInfo>,
pub interceptor_events: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LlmProviderInfo {
pub id: String,
pub description: String,
pub capabilities: Vec<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CommandInfo {
pub name: String,
pub description: String,
pub provider_capsule: String,
}