Skip to main content

Crate oino_settings

Crate oino_settings 

Source
Expand description

oino-settings: settings for Oino — global/project layering, migrations, typed getters, locked atomic writes, and the filesystem layout of the agent and project dirs.

Boundary: synchronous std I/O only (no async runtime); oino-core owns one SettingsManager per cwd and hands Settings snapshots to blocking tasks.

§API map

ModuleContents
managerSettingsManager: create / in-memory, trust gating, reload, scoped writes, typed setters
viewSettings: typed getters with defaults, layer access, extension settings layering
typesQueueMode, CacheWarmingMode, ProjectTrustDefault, UiDensity, resolved setting structs, PackageSource, ResourceKind, defaults
errorSettingsScope, SettingsError, SettingsErrorKind, InvalidSettingError
jsonmerge/migrate/path helpers over JsonObject
toolstools::resolve_default_tools, tools::apply_tool_modifiers, tools::tool_list_error
pathspaths::agent_dir, paths::project_dir, file-name constants, paths::env names, tilde/file:// resolution
storagestorage::FileLock (<file>.lock), storage::write_atomic (shared with other agent-dir files)
secretsSecretStore: <agent>/secrets.json (0600, locked), extension secrets and secret settings fields

§Semantics

  • Project settings (<cwd>/.oino/settings.json) load only when the project is trusted and override global ones (<agent>/settings.json); nested objects deep-merge, arrays replace.
  • Resource arrays are read per layer with Settings::resource_entries; resolution (in oino-resources) combines both layers, project entries first.
  • httpProxy, cacheWarming, defaultProjectTrust and deviceId read the global layer only.
  • Unknown keys are preserved on write; legacy keys are migrated on load and on write.

Oino keys: extensionSettings, disabledExtensions, serve.*, ui.density.

Re-exports§

pub use error::InvalidSettingError;
pub use error::SettingsError;
pub use error::SettingsErrorKind;
pub use error::SettingsScope;
pub use json::JsonObject;
pub use manager::SettingsManager;
pub use secrets::SecretStore;
pub use types::BranchSummarySettings;
pub use types::CacheWarmingMode;
pub use types::CompactionSettings;
pub use types::FilteredPackageSource;
pub use types::ImageSettings;
pub use types::PackageSource;
pub use types::ProjectTrustDefault;
pub use types::ProviderRetrySettings;
pub use types::QueueMode;
pub use types::ResourceKind;
pub use types::RetrySettings;
pub use types::ServeSettings;
pub use types::UiDensity;
pub use types::defaults;
pub use view::CompactionTokenField;
pub use view::Settings;

Modules§

error
Settings scopes and errors.
json
JSON-object helpers: deep merge, migrations, path edits and JS-style value coercions used by the typed getters.
manager
SettingsManager: layered load, trust gating, scoped writes.
paths
Filesystem layout and path helpers.
secrets
<agent>/secrets.json (extension-api §5.9): a flat {key: value} string map, mode 0600, guarded by the same <file>.lock advisory lock as settings files and replaced atomically.
storage
Settings storage: files (locked, atomic) or memory (FileSettingsStorage, InMemorySettingsStorage).
tools
defaultTools selection rules.
types
Typed setting values and defaults.
view
Settings: an immutable, typed view over the global, project and merged layers (the settings-manager getters).