Skip to main content

FileConfig

Struct FileConfig 

Source
pub struct FileConfig {
Show 20 fields pub all: Option<bool>, pub harnesses: Option<Vec<String>>, pub exclude: Option<Vec<String>>, pub model: Option<String>, pub system: Option<String>, pub bypass: Option<bool>, pub mode: Option<PermissionMode>, pub timeout: Option<u64>, pub output_format: Option<OutputFormat>, pub schema_file: Option<String>, pub schema_max_retries: Option<u32>, pub max_parallel: Option<usize>, pub require_available: Option<bool>, pub history: Option<bool>, pub history_dir: Option<String>, pub allowed_tools: Option<Vec<String>>, pub denied_tools: Option<Vec<String>>, pub hooks: Option<Vec<HookEntry>>, pub env: BTreeMap<String, String>, pub harness: BTreeMap<String, HarnessConfig>,
}
Expand description

One config file, as written by the user. Every field is optional: an absent field defers to the next layer down. Unknown fields are rejected so a typo fails loudly instead of being silently ignored.

Fields§

§all: Option<bool>

Default selection: run every harness (like --all). Mutually exclusive with harnesses. Used only when the CLI passes no selection.

§harnesses: Option<Vec<String>>

Default selection: the harness ids to run (like --harness).

§exclude: Option<Vec<String>>

Harness ids excluded from an all selection (like --exclude).

§model: Option<String>

Model passed to each harness that supports a model flag (like --model).

§system: Option<String>

Portable system prompt (like --system).

§bypass: Option<bool>

Request each harness’s bypass mode (default true; like --no-bypass when false). The CLI’s --bypass / --no-bypass always win. Superseded by mode when both are set (mode is the richer spelling; bypass = false is exactly mode = "default").

§mode: Option<PermissionMode>

The normalized approval mode (like --mode): plan / default / edit / auto / bypass. Beats bypass when both are set. The CLI’s --mode (and --bypass / --no-bypass) always win.

§timeout: Option<u64>

Per-harness timeout in seconds (like --timeout).

§output_format: Option<OutputFormat>

Output format override (like --output-format).

§schema_file: Option<String>

Path to a JSON Schema file constraining each harness’s final answer (like --schema). Resolved relative to the working directory. Turns the run into a structured-output run: the schema is delivered to the harness (natively where supported, else via the prompt), the result is validated, and a failure is re-prompted up to schema_max_retries times.

§schema_max_retries: Option<u32>

Maximum retries per harness when a response fails schema validation (like --schema-max-retries; default 2). Only meaningful with a schema.

§max_parallel: Option<usize>

Concurrency cap (like --max-parallel).

§require_available: Option<bool>

Treat a missing harness as a failure (like --require-available).

§history: Option<bool>

Record a normalized, cross-harness history of each run to disk (opt-in, off by default; like --history / --no-history). Most naturally set in a user-level config.toml so one turns it on across every project.

§history_dir: Option<String>

Directory the history is written to and read from (like --history-dir). Defaults to <platform state dir>/oneharness/history when unset.

§allowed_tools: Option<Vec<String>>

Tool/permission rules the harness may use without prompting, in each harness’s native rule syntax. Delivered by oneharness sync, which merges them into the harness’s own project config file (Claude Code’s .claude/settings.json permissions.allow, Cursor’s .cursor/cli.json, Qwen’s .qwen/settings.json, crush’s crush.json) so the policy also applies outside oneharness. A harness with no mapping reports the rule as unmapped in the sync report rather than dropping it silently.

§denied_tools: Option<Vec<String>>

Deny rules; synced like allowed_tools (for crush this lands in options.disabled_tools, hiding the tool entirely).

§hooks: Option<Vec<HookEntry>>

Normalized pre-tool hooks, each fanned across the synced harnesses by oneharness sync and rendered into every harness’s native shape (a shared config file, a dedicated hooks file, or a plugin). Unlike the verbatim per-harness [harness.<id>.hooks] table — which is one harness’s own schema, limited to harnesses whose hooks share their config file — a [[hooks]] entry is harness-agnostic and reaches all of them. The two are independent and may both be set.

§env: BTreeMap<String, String>

Extra environment for every harness process (like repeated --env).

§harness: BTreeMap<String, HarnessConfig>

Per-harness overrides, keyed by canonical harness id.

Implementations§

Source§

impl FileConfig

Source

pub fn model_for(&self, id: &str) -> Option<&str>

The model for one harness: its [harness.<id>] override, else the top-level model. (A CLI --model beats both; the caller applies it.)

Source

pub fn bin_for(&self, id: &str) -> Option<&str>

The configured binary override for one harness, if any.

Source

pub fn args_for(&self, id: &str) -> &[String]

Extra args appended to one harness’s command (before CLI passthrough).

Source

pub fn allowed_tools_for(&self, id: &str) -> &[String]

Allow rules for one harness: its [harness.<id>] override, else the top-level allowed_tools. (CLI --allowed-tools beats both.)

Source

pub fn denied_tools_for(&self, id: &str) -> &[String]

Deny rules for one harness, resolved like Self::allowed_tools_for.

Source

pub fn hooks_for(&self, id: &str) -> Option<&Value>

The hooks table for one harness, if configured (per-harness only: hooks schemas are harness-specific, so there is no top-level form).

Source

pub fn hook_specs_for(&self, id: &str) -> Vec<HookSpec>

The normalized [[hooks]] that apply to harness id, ready to install: entries with no harnesses filter or one naming id, with {harness} substituted in the command. Order follows the config (later entries install after earlier ones).

Source

pub fn settings_for(&self, id: &str) -> Option<&Value>

The raw settings table for one harness, if configured (per-harness only: the shape is that harness’s own config schema).

Source

pub fn env_for(&self, id: &str) -> Vec<(String, String)>

The configured environment for one harness, in application order: top-level [env] first, then [harness.<id>.env] so it wins on a key collision. (The harness’s own default_env goes before these, and CLI --env after; the runner applies env last-write-wins.)

Trait Implementations§

Source§

impl Clone for FileConfig

Source§

fn clone(&self) -> FileConfig

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 FileConfig

Source§

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

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

impl Default for FileConfig

Source§

fn default() -> FileConfig

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

impl<'de> Deserialize<'de> for FileConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for FileConfig

Source§

fn eq(&self, other: &FileConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for FileConfig

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.