supercode-interchange 0.4.19

Canonical, provider-neutral session interchange primitives for Supercode
Documentation
//! Harness identity: the one list every registry, ledger and codec keys on.

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

/// Extensible identifier for a coding harness.
#[derive(
    Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize, JsonSchema,
)]
#[serde(transparent)]
pub struct HarnessId(pub String);

impl HarnessId {
    /// Claude Code's stable identifier.
    pub const CLAUDE_CODE: &'static str = "claude-code";
    /// Codex's stable identifier.
    pub const CODEX: &'static str = "codex";
    /// Pi's stable identifier.
    pub const PI: &'static str = "pi";
    /// OpenCode's stable identifier.
    pub const OPENCODE: &'static str = "opencode";
    /// Grok's stable identifier.
    pub const GROK: &'static str = "grok";
    /// Gemini CLI's stable identifier.
    pub const GEMINI: &'static str = "gemini";
    /// Goose's stable identifier.
    pub const GOOSE: &'static str = "goose";
    /// Hermes Agent's stable identifier.
    pub const HERMES: &'static str = "hermes";
    /// OpenClaw's stable identifier.
    pub const OPENCLAW: &'static str = "openclaw";
    /// Supercode's native saved-session store.
    pub const SUPERCODE: &'static str = "supercode";
    /// The supercode orchestrator's stable identifier (ORC-7). Its home is a
    /// Hermes-shaped folder tree, not a transcript store: it owns bindings
    /// that point AT other harnesses' sessions.
    pub const ORCHESTRATOR: &'static str = "orchestrator";

    /// Construct an identifier without restricting third-party harness names.
    pub fn new(value: impl Into<String>) -> Self {
        Self(value.into())
    }

    /// Return the identifier as a string slice.
    pub fn as_str(&self) -> &str {
        &self.0
    }
}

impl From<&str> for HarnessId {
    fn from(value: &str) -> Self {
        Self::new(value)
    }
}