Skip to main content

zeph_config/
cocoon.rs

1// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4use serde::{Deserialize, Serialize};
5
6use crate::defaults::default_true;
7
8/// Cocoon-level display and behaviour settings.
9///
10/// These options govern how Cocoon-specific information is presented in the TUI.
11/// They are independent of the Cocoon LLM provider entry in `[[llm.providers]]`.
12///
13/// # Examples
14///
15/// ```toml
16/// [cocoon]
17/// show_balance = false  # redact TON balance in the TUI status bar
18/// ```
19#[derive(Debug, Clone, Serialize, Deserialize)]
20pub struct CocoonConfig {
21    /// Show the Cocoon TON balance in the TUI status bar.
22    ///
23    /// When `false`, the balance is rendered as `*** TON` instead of the real
24    /// value, implementing the redaction option described in spec ยง15.2.
25    /// Default is `true` (balance visible), matching the current behaviour.
26    #[serde(default = "default_true")]
27    pub show_balance: bool,
28}
29
30impl Default for CocoonConfig {
31    fn default() -> Self {
32        Self { show_balance: true }
33    }
34}