Skip to main content

ConfigToml

Struct ConfigToml 

Source
pub struct ConfigToml {
Show 25 fields pub api_key: Option<String>, pub base_url: Option<String>, pub http_headers: BTreeMap<String, String>, pub default_text_model: Option<String>, pub provider: ProviderKind, pub model: Option<String>, pub auth_mode: Option<String>, pub output_mode: Option<String>, pub verbosity: Option<String>, pub log_level: Option<String>, pub telemetry: Option<bool>, pub approval_policy: Option<String>, pub sandbox_mode: Option<String>, pub tools: Option<ToolsToml>, pub providers: ProvidersToml, pub fallback_providers: Vec<ProviderKind>, pub network: Option<NetworkPolicyToml>, pub skills: Option<SkillsToml>, pub snapshots: Option<SnapshotsToml>, pub lsp: Option<LspConfigToml>, pub harness_profiles: Vec<HarnessProfile>, pub hotbar: Option<Vec<HotbarBindingToml>>, pub hook_sinks: Option<HookSinksToml>, pub fleet: Option<FleetConfigToml>, pub extras: BTreeMap<String, Value>,
}

Fields§

§api_key: Option<String>

TUI-compatible DeepSeek API key. Kept at the root so both deepseek and codewhale-tui can share a single config file.

§base_url: Option<String>

TUI-compatible DeepSeek base URL.

§http_headers: BTreeMap<String, String>

Optional extra HTTP headers forwarded to model API requests.

§default_text_model: Option<String>

TUI-compatible default DeepSeek model.

§provider: ProviderKind§model: Option<String>§auth_mode: Option<String>§output_mode: Option<String>§verbosity: Option<String>§log_level: Option<String>§telemetry: Option<bool>§approval_policy: Option<String>§sandbox_mode: Option<String>§tools: Option<ToolsToml>

Native tool catalog controls shared with codewhale-tui.

§providers: ProvidersToml§fallback_providers: Vec<ProviderKind>

Provider fallback chain (#2574). TUI runtime code may advance through these providers after recoverable provider errors; config resolution itself still reports the selected primary provider.

§network: Option<NetworkPolicyToml>

Per-domain network policy (#135). When absent, network tools fall back to a permissive default that mirrors pre-v0.7.0 behavior.

§skills: Option<SkillsToml>

Community skill installer settings (#140). Mirrors SkillsToml from the TUI side; the dispatcher consults registry_url when running deepseek skill install.

§snapshots: Option<SnapshotsToml>

Workspace side-git snapshots (#137). The live TUI defaults this to enabled with 7-day retention when absent.

§lsp: Option<LspConfigToml>

Post-edit LSP diagnostics injection (#136). When absent, the engine applies the defaults documented in LspConfigToml.

§harness_profiles: Vec<HarnessProfile>

Per-model harness profiles (#2693). Runtime wiring lands in follow-up v0.9 slices; this is the durable config data model.

§hotbar: Option<Vec<HotbarBindingToml>>

Optional 1-8 hotbar slot bindings (#2064). When absent, the TUI falls back to the built-in default slots.

§hook_sinks: Option<HookSinksToml>

App-server hook sink configuration. Kept separate from the TUI lifecycle [hooks] table so config rewrites preserve existing hooks.

§fleet: Option<FleetConfigToml>

Agent Fleet trust and security policy (#3165). When absent, fleet workers inherit conservative Sandbox defaults.

§extras: BTreeMap<String, Value>

Implementations§

Source§

impl ConfigToml

Source

pub fn resolve_harness_profile( &self, provider_route: &str, model: &str, ) -> Option<&HarnessProfile>

Resolve the first configured harness profile for a provider/model route.

This helper is deliberately dormant for v0.9: callers may display or test the resolved profile, but runtime provider/model routing and prompt shaping remain unchanged until a later, explicit integration slice.

Source

pub fn resolve_hotbar_bindings( &self, known_action_ids: &[&str], ) -> HotbarConfigResolution

Resolve durable hotbar config into normalized 1-8 slot bindings.

known_action_ids is supplied by the TUI action registry in later slices. Unknown actions are preserved so the UI can render a disabled ? cell instead of silently deleting user config.

Source§

impl ConfigToml

Source

pub fn merge_project_overrides(&mut self, project: ConfigToml)

Merge safe project-level overrides from $WORKSPACE/.codewhale/config.toml or legacy $WORKSPACE/.deepseek/config.toml.

Repo-local config is untrusted input. This helper intentionally ignores credentials, endpoints, provider selection, auth/session values, telemetry, network policy, skill registry, LSP command tables, and unknown extras. Approval and sandbox values may only tighten the existing user/global posture.

Source

pub fn get_value(&self, key: &str) -> Option<String>

Source

pub fn get_display_value(&self, key: &str) -> Option<String>

Source

pub fn set_value(&mut self, key: &str, value: &str) -> Result<()>

Source

pub fn unset_value(&mut self, key: &str) -> Result<()>

Source

pub fn list_values(&self) -> BTreeMap<String, String>

Source

pub fn resolve_runtime_options( &self, cli: &CliRuntimeOverrides, ) -> ResolvedRuntimeOptions

Resolve runtime options without touching platform credential stores.

This method keeps library callers prompt-free: CLI flag → config file → environment. Call resolve_runtime_options_with_secrets when a user-facing dispatcher should recover credentials from the configured secret store.

Source

pub fn resolve_runtime_options_with_secrets( &self, cli: &CliRuntimeOverrides, secrets: &Secrets, ) -> ResolvedRuntimeOptions

Resolve runtime options using an explicit secrets façade.

API-key precedence is CLI flag → config-file → secret store → environment.

Trait Implementations§

Source§

impl Clone for ConfigToml

Source§

fn clone(&self) -> ConfigToml

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 ConfigToml

Source§

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

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

impl Default for ConfigToml

Source§

fn default() -> ConfigToml

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

impl<'de> Deserialize<'de> for ConfigToml

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 Serialize for ConfigToml

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more