Skip to main content

ResourceLoader

Trait ResourceLoader 

Source
pub trait ResourceLoader {
    // Required methods
    fn get_extensions(&self) -> &LoadExtensionsResult;
    fn get_skills(&self) -> (&[Skill], &[ResourceDiagnostic]);
    fn get_prompts(&self) -> (&[PromptTemplate], &[ResourceDiagnostic]);
    fn get_themes(&self) -> (&[LoadedTheme], &[ResourceDiagnostic]);
    fn get_agents_files(&self) -> &[AgentsFile];
    fn get_system_prompt(&self) -> Option<&str>;
    fn get_append_system_prompt(&self) -> &[String];
    fn extend_resources(&mut self, paths: ResourceExtensionPaths);
    fn reload(
        &mut self,
    ) -> impl Future<Output = Result<(), ResourceLoaderError>>;
}
Expand description

Resource loading surface matching TypeScript ResourceLoader.

Required Methods§

Source

fn get_extensions(&self) -> &LoadExtensionsResult

Extension paths (Phase 3: no execution).

Source

fn get_skills(&self) -> (&[Skill], &[ResourceDiagnostic])

Skills + diagnostics.

Source

fn get_prompts(&self) -> (&[PromptTemplate], &[ResourceDiagnostic])

Prompts + diagnostics.

Source

fn get_themes(&self) -> (&[LoadedTheme], &[ResourceDiagnostic])

Themes + diagnostics.

Source

fn get_agents_files(&self) -> &[AgentsFile]

Context files.

Source

fn get_system_prompt(&self) -> Option<&str>

Resolved system prompt text, if any.

Source

fn get_append_system_prompt(&self) -> &[String]

Resolved append-system-prompt texts.

Source

fn extend_resources(&mut self, paths: ResourceExtensionPaths)

Extend skill/prompt/theme paths after load.

Source

fn reload(&mut self) -> impl Future<Output = Result<(), ResourceLoaderError>>

Reload settings, packages, and all resource snapshots.

§Errors

Returns ResourceLoaderError when package resolve fails or the blocking resolve task panics.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§