supercode-interchange 0.4.16

Canonical, provider-neutral session interchange primitives for Supercode
Documentation
//! A channel: one platform block of `config.yaml` (§2.4). Credential values
//! never enter the model; they are references.

use std::collections::BTreeMap;

use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use serde_json::Value;

use crate::ontology::SecretRef;

/// One platform's configuration.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
pub struct ChannelConfig {
    /// The platform name (`telegram`, `slack`, `api_server`, …).
    pub platform: String,
    /// Whether the adapter is enabled.
    #[serde(default = "default_true")]
    pub enabled: bool,
    /// Credential keys by reference; presence is checked at load, values never held.
    #[serde(default)]
    pub credentials: BTreeMap<String, SecretRef>,
    /// Adapter-specific settings, verbatim (`extra.<key>` for the nested block).
    #[serde(default)]
    pub extra: BTreeMap<String, Value>,
}

fn default_true() -> bool {
    true
}