Skip to main content

ResourceLoader

Struct ResourceLoader 

Source
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

Source

pub fn new(options: ResourceLoaderOptions) -> Self

A loader with nothing loaded yet.

Source

pub fn options(&self) -> &ResourceLoaderOptions

The (absolutised) options.

Source

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).

Source

pub fn extend(&mut self, paths: &ResourceExtensionPaths)

Add package / resources_discover paths.

Source

pub fn skills(&self) -> &[Skill]

Loaded skills (first-wins by name).

Source

pub fn skill_diagnostics(&self) -> &[ResourceDiagnostic]

Skill diagnostics.

Source

pub fn prompts(&self) -> &[PromptTemplate]

Loaded prompt templates (first-wins by name).

Source

pub fn prompt_diagnostics(&self) -> &[ResourceDiagnostic]

Prompt template diagnostics.

Source

pub fn themes(&self) -> &[ThemeResource]

Theme files (first-wins by name).

Source

pub fn theme_diagnostics(&self) -> &[ResourceDiagnostic]

Theme diagnostics.

Source

pub fn context_files(&self) -> &[ContextFile]

Context files (empty with -nc).

Source

pub fn system_prompt(&self) -> Option<&str>

The system prompt override (CLI, trusted .oino/SYSTEM.md, <agent>/SYSTEM.md).

Source

pub fn system_prompt_source(&self) -> Option<&Path>

File the system prompt came from, if any.

Source

pub fn append_system_prompt(&self) -> &[String]

Append texts in order (joined with \n\n into the addendum section).

Source

pub fn addendum(&self) -> String

The addendum text: Self::append_system_prompt joined by \n\n.

Source

pub fn append_system_prompt_sources(&self) -> &[PathBuf]

Files the append texts came from.

Source

pub fn diagnostics(&self) -> Vec<ResourceDiagnostic>

Every diagnostic: skills, prompts, themes, context files, prompt sources.

Trait Implementations§

Source§

impl Clone for ResourceLoader

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ResourceLoader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ResourceLoader

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.