Skip to main content

oino_resources/
lib.rs

1//! `oino-resources`: resource loading for Oino — context files (`AGENTS.md` & co.),
2//! SYSTEM/APPEND prompt sources, skills, prompt templates, theme files, the structured system
3//! prompt, project trust and the keybindings file.
4//!
5//! Boundary: synchronous std I/O, no async runtime; `oino-core` calls it on blocking threads.
6//! Packages and extensions are resolved by `oino-core` and contribute paths through
7//! [`ResourceLoader::extend`].
8//!
9//! # API map
10//!
11//! | Module | Contents |
12//! |---|---|---|
13//! | [`loader`] | [`ResourceLoader`], [`ResourceLoaderOptions`], [`ResourceExtensionPaths`], [`ThemeResource`] |
14//! | [`discovery`] | settings arrays + auto-discovery with `!glob`/`+path`/`-path`, precedence |
15//! | [`context_files`] | [`ContextFile`], [`context_files::load_project_context_files`] |
16//! | [`system_prompt`] | [`BuildSystemPromptOptions`], [`SystemPromptState`], [`system_prompt::build_system_prompt_sections`], [`system_prompt::build_system_prompt_state`], [`system_prompt::diff_system_prompt_sections`] |
17//! | [`skills`] | [`Skill`], [`skills::load_skills`], [`skills::format_skills_for_prompt`], [`skills::expand_skill_command`] |
18//! | [`templates`] | [`PromptTemplate`], [`templates::parse_command_args`], [`templates::substitute_args`], [`templates::expand_prompt_template`] |
19//! | [`trust`] | [`trust::TrustStore`], [`trust::has_protected_resources`], [`trust::resolve_project_trust`] |
20//! | [`keybindings`] | [`keybindings::KeybindingsFile`], [`keybindings::migrate_keybindings_config`], [`keybindings::is_valid_key_id`] |
21//! | [`frontmatter`] | [`frontmatter::parse_frontmatter`] |
22//! | [`diagnostics`], [`source`] | `diagnostics.ts`, `source-info.ts` | [`ResourceDiagnostic`], [`SourceInfo`], [`source::PathMetadata`] |
23//!
24//! Product substitutions (D13): the default preamble names Oino, the docs section points at the
25//! bundled Oino docs (`docs_root`), and the bash env guideline is [`system_prompt::ENV_GUIDELINE`].
26
27#![forbid(unsafe_code)]
28#![cfg_attr(
29    test,
30    allow(
31        clippy::unwrap_used,
32        clippy::expect_used,
33        clippy::panic,
34        reason = "tests assert by unwrapping"
35    )
36)]
37
38pub mod context_files;
39pub mod diagnostics;
40pub mod discovery;
41pub mod frontmatter;
42pub mod keybindings;
43pub mod loader;
44pub mod skills;
45pub mod source;
46pub mod system_prompt;
47pub mod templates;
48pub mod trust;
49mod walk;
50
51pub use context_files::ContextFile;
52pub use diagnostics::{DiagnosticKind, ResourceDiagnostic};
53pub use loader::{
54    ExtraResourcePath, ResourceExtensionPaths, ResourceLoader, ResourceLoaderOptions, ThemeResource,
55};
56pub use skills::Skill;
57pub use source::SourceInfo;
58pub use system_prompt::{BuildSystemPromptOptions, SystemPromptState};
59pub use templates::PromptTemplate;