pub struct KodaAgent {
pub project_root: PathBuf,
pub tools: ToolRegistry,
pub tool_defs: Vec<ToolDefinition>,
pub system_prompt: String,
}Expand description
Shared agent resources. Immutable after construction.
Create once, share via Arc<KodaAgent> across sessions and sub-agents.
Fields§
§project_root: PathBufProject root directory.
tools: ToolRegistryTool registry with all built-in tools.
tool_defs: Vec<ToolDefinition>Pre-computed tool definitions for the LLM.
system_prompt: StringAssembled system prompt.
Implementations§
Source§impl KodaAgent
impl KodaAgent
Sourcepub async fn new(
config: &KodaConfig,
project_root: PathBuf,
commands: &[(&str, &str)],
) -> Result<Self>
pub async fn new( config: &KodaConfig, project_root: PathBuf, commands: &[(&str, &str)], ) -> Result<Self>
Build a new agent from config and project root.
commands is a list of (name, description) pairs for user-facing
slash commands. The CLI passes its SLASH_COMMANDS registry here;
sub-agents pass &[].
Sourcepub fn rebuild_system_prompt(
&mut self,
config: &KodaConfig,
commands: &[(&str, &str)],
)
pub fn rebuild_system_prompt( &mut self, config: &KodaConfig, commands: &[(&str, &str)], )
Rebuild the system prompt from the agent’s current skill registry.
Call this after injecting additional skills (e.g. inject_builtin_skills)
so the rebuilt prompt includes all available skills in the ## Skills section.
Note: MCP server instructions are NOT included here — they are composed
per-turn in KodaSession::run_turn via render_mcp_instructions_section,
because MCP servers may attach after this static prompt is built (#922).
Sourcepub fn mcp_status_bar_info(&self) -> Option<McpStatusBarInfo>
pub fn mcp_status_bar_info(&self) -> Option<McpStatusBarInfo>
Compact MCP status for the TUI status bar.
Returns None if no MCP servers are configured.
Auto Trait Implementations§
impl !Freeze for KodaAgent
impl !RefUnwindSafe for KodaAgent
impl Send for KodaAgent
impl Sync for KodaAgent
impl Unpin for KodaAgent
impl UnsafeUnpin for KodaAgent
impl !UnwindSafe for KodaAgent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more