pub struct ResourceLoader { /* private fields */ }Expand description
Loads every markdown/JSON resource for one cwd; call Self::reload after construction and
whenever settings or trust change. Synchronous (run it on a blocking thread).
Implementations§
Source§impl ResourceLoader
impl ResourceLoader
Sourcepub fn new(options: ResourceLoaderOptions) -> Self
pub fn new(options: ResourceLoaderOptions) -> Self
A loader with nothing loaded yet.
Sourcepub fn options(&self) -> &ResourceLoaderOptions
pub fn options(&self) -> &ResourceLoaderOptions
The (absolutised) options.
Sourcepub fn reload(&mut self, settings: &Settings, project_trusted: bool)
pub fn reload(&mut self, settings: &Settings, project_trusted: bool)
Re-resolve everything for settings and the trust state (reload; extension
contributions from Self::extend are dropped).
Sourcepub fn extend(&mut self, paths: &ResourceExtensionPaths)
pub fn extend(&mut self, paths: &ResourceExtensionPaths)
Add package / resources_discover paths.
Sourcepub fn skill_diagnostics(&self) -> &[ResourceDiagnostic]
pub fn skill_diagnostics(&self) -> &[ResourceDiagnostic]
Skill diagnostics.
Sourcepub fn prompts(&self) -> &[PromptTemplate]
pub fn prompts(&self) -> &[PromptTemplate]
Loaded prompt templates (first-wins by name).
Sourcepub fn prompt_diagnostics(&self) -> &[ResourceDiagnostic]
pub fn prompt_diagnostics(&self) -> &[ResourceDiagnostic]
Prompt template diagnostics.
Sourcepub fn themes(&self) -> &[ThemeResource]
pub fn themes(&self) -> &[ThemeResource]
Theme files (first-wins by name).
Sourcepub fn theme_diagnostics(&self) -> &[ResourceDiagnostic]
pub fn theme_diagnostics(&self) -> &[ResourceDiagnostic]
Theme diagnostics.
Sourcepub fn context_files(&self) -> &[ContextFile]
pub fn context_files(&self) -> &[ContextFile]
Context files (empty with -nc).
Sourcepub fn system_prompt(&self) -> Option<&str>
pub fn system_prompt(&self) -> Option<&str>
The system prompt override (CLI, trusted .oino/SYSTEM.md, <agent>/SYSTEM.md).
Sourcepub fn system_prompt_source(&self) -> Option<&Path>
pub fn system_prompt_source(&self) -> Option<&Path>
File the system prompt came from, if any.
Sourcepub fn append_system_prompt(&self) -> &[String]
pub fn append_system_prompt(&self) -> &[String]
Append texts in order (joined with \n\n into the addendum section).
Sourcepub fn addendum(&self) -> String
pub fn addendum(&self) -> String
The addendum text: Self::append_system_prompt joined by \n\n.
Sourcepub fn append_system_prompt_sources(&self) -> &[PathBuf]
pub fn append_system_prompt_sources(&self) -> &[PathBuf]
Files the append texts came from.
Sourcepub fn diagnostics(&self) -> Vec<ResourceDiagnostic>
pub fn diagnostics(&self) -> Vec<ResourceDiagnostic>
Every diagnostic: skills, prompts, themes, context files, prompt sources.