{
  "name": "forge-settings",
  "language": "rust",
  "version": "0.2.0",
  "description": "Forge \u2014 provider settings introspection. Each provider crate exposes its configurable fields through `ProviderSettings`, letting external runtimes (TUIs, dashboards) render and edit those fields without coupling to each provider's concrete `Config` type.",
  "manifest": "forge-rs/crates/forge-settings/Cargo.toml",
  "manifestSha256": "06fc4b4ee642368b8bf75905b0ca93074258925db46b763f3fe412ca20fd7511",
  "status": "source-reference",
  "registryPublicationVerified": false,
  "route": "/libraries/rust/forge-settings",
  "features": {},
  "files": [
    {
      "path": "forge-rs/crates/forge-settings/src/lib.rs",
      "sha256": "52dd3b7cafa5724a3d1ffa5c9792ae487221de94cec38aa107d1289e54d9dc69",
      "artifactSha256": "fd13b2c68eb7e6f6c385263149940d6ed731ae04a75f3fdf01ff3cb01a0443ce",
      "url": "/reference/source/forge-rs/crates/forge-settings/src/lib.rs.txt",
      "declarations": [
        {
          "name": "::ProviderSettingField",
          "line": 72,
          "signature": "#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]\npub struct ProviderSettingField {\n/// Stable identifier (e.g. `\"api_key\"`, `\"base_url\"`).\n\npub id: String,\n/// User-visible label.\n\npub label: String,\n/// One-line description.\n\npub description: String,\n/// What kind of value the field holds.\n\npub kind: ProviderSettingKind,\n/// Current value, already redacted for secret fields.\n\npub value: String,\n/// `true` when the value is sensitive \u2014 runtimes should never\n\n/// log it and should display it as `\u2022\u2022\u2022\u2022\u2022\u2022` by default.\n\npub secret: bool,\n/// `true` when this field is the currently-active enum / picker\n\n/// selection.\n\npub active: bool\n}",
          "documentation": "One configurable field surfaced by a provider."
        },
        {
          "name": "::ProviderSettingField::text",
          "line": 94,
          "signature": "#[must_use]\npub fn text(id: impl Into<String>, label: impl Into<String>, value: impl Into<String>) -> Self;",
          "documentation": "Convenience: text field with the given current value."
        },
        {
          "name": "::ProviderSettingField::secret_text",
          "line": 110,
          "signature": "#[must_use]\npub fn secret_text(\n        id: impl Into<String>,\n        label: impl Into<String>,\n        value: impl Into<String>,\n    ) -> Self;",
          "documentation": "Convenience: secret text field. The supplied value is\nreturned verbatim \u2014 runtimes are expected to redact it on\ndisplay. Pass an empty string when the value is unset."
        },
        {
          "name": "::ProviderSettingField::integer",
          "line": 128,
          "signature": "#[must_use]\npub fn integer(id: impl Into<String>, label: impl Into<String>, value: i64) -> Self;",
          "documentation": "Convenience: integer field."
        },
        {
          "name": "::ProviderSettingField::boolean",
          "line": 142,
          "signature": "#[must_use]\npub fn boolean(id: impl Into<String>, label: impl Into<String>, value: bool) -> Self;",
          "documentation": "Convenience: boolean toggle field."
        },
        {
          "name": "::ProviderSettingField::picker",
          "line": 157,
          "signature": "#[must_use]\npub fn picker(\n        id: impl Into<String>,\n        label: impl Into<String>,\n        current_id: impl Into<String>,\n        options: Vec<ProviderSettingOption>,\n    ) -> Self;",
          "documentation": "Convenience: enum/picker field with a fixed set of options.\n`current_id` is the id of the currently-selected option."
        },
        {
          "name": "::ProviderSettingField::description",
          "line": 177,
          "signature": "#[must_use]\npub fn description(mut self, text: impl Into<String>) -> Self;",
          "documentation": "Builder-style description."
        },
        {
          "name": "::ProviderSettingField::active",
          "line": 184,
          "signature": "#[must_use]\npub fn active(mut self, on: bool) -> Self;",
          "documentation": "Builder-style active flag."
        },
        {
          "name": "::ProviderSettingKind",
          "line": 193,
          "signature": "#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]\n#[serde(tag = \"kind\", rename_all = \"kebab-case\")]\npub enum ProviderSettingKind {\n    /// Free-form string (api keys, urls, region names).\n    Text,\n    /// Whole-number integer (timeouts, retries).\n    Integer,\n    /// Boolean toggle.\n    Bool,\n    /// Enum picker with a fixed option list.\n    Picker {\n        /// Available choices \u2014 the runtime renders these as a sub-page.\n        options: Vec<ProviderSettingOption>,\n    },\n}",
          "documentation": "Kind of value a field holds."
        },
        {
          "name": "::ProviderSettingOption",
          "line": 209,
          "signature": "#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]\npub struct ProviderSettingOption {\n/// Stable identifier of the option.\n\npub id: String,\n/// User-visible label.\n\npub label: String,\n/// Optional one-line description.\n\npub description: String\n}",
          "documentation": "One option of a [`ProviderSettingKind::Picker`] field."
        },
        {
          "name": "::ProviderSettingOption::new",
          "line": 221,
          "signature": "#[must_use]\npub fn new(id: impl Into<String>, label: impl Into<String>) -> Self;",
          "documentation": "Convenience constructor."
        },
        {
          "name": "::ProviderSettingOption::description",
          "line": 231,
          "signature": "#[must_use]\npub fn description(mut self, text: impl Into<String>) -> Self;",
          "documentation": "Builder-style description."
        },
        {
          "name": "::FieldError",
          "line": 240,
          "signature": "#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]\n#[serde(tag = \"kind\", rename_all = \"kebab-case\")]\npub enum FieldError {\n    /// The field id is not recognized by this provider.\n    UnknownField(String),\n    /// The supplied value failed validation.\n    InvalidValue(String),\n    /// The field is read-only.\n    ReadOnly(String),\n}",
          "documentation": "Errors returned by [`ProviderSettings::set_field`]."
        },
        {
          "name": "::ProviderSettings",
          "line": 263,
          "signature": "pub trait ProviderSettings {\n    /// Stable provider identifier (e.g. `\"anthropic\"`, `\"openai\"`).\n    fn provider_id(&self) -> &str;\n\n    /// All fields the runtime should display, in render order.\n    fn fields(&self) -> Vec<ProviderSettingField>;\n\n    /// Update one field. The provider validates the value and\n    /// returns [`FieldError`] on rejection. Default implementation\n    /// returns `ReadOnly` for every field \u2014 providers that want to\n    /// support editing must override.\n    ///\n    /// # Errors\n    ///\n    /// Returns [`FieldError`] for unknown fields, invalid values, or\n    /// read-only fields.\n    fn set_field(&mut self, id: &str, _value: &str) -> Result<(), FieldError> ;\n}",
          "documentation": "Trait every Forge provider config implements so external\nruntimes can render + edit its fields generically."
        }
      ]
    }
  ]
}
