decision_cockpit 0.1.0

Layer — product decision memory with MCP tools and an embedded review dashboard
Documentation
//! Parameter structs for the MCP tools.
//!
//! Each derives `JsonSchema` (via the `rmcp::schemars` re-export) so the SDK can
//! advertise an input schema in `tools/list`.

use rmcp::schemars;
use serde::Deserialize;
use serde_json::Value;

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct CreateDocumentParams {
    /// Human-readable title for the document.
    pub title: String,
    /// Origin of the document, e.g. meeting_note, customer_feedback, research.
    pub source_type: String,
    /// The full raw text to store.
    pub raw_text: String,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct GetDocumentParams {
    /// UUID of the document to fetch.
    pub document_id: String,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct ListLimitParams {
    /// Maximum number of items to return (default 20, max 200).
    pub limit: Option<i64>,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct ListRecentDocumentsParams {
    /// Optional processing-status filter: new, extracted, or archived. Pass
    /// "new" to fetch only documents that have not been mined yet.
    pub status: Option<String>,
    /// Maximum number of documents to return (default 20, max 200).
    pub limit: Option<i64>,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct CreateCandidateParams {
    /// UUID of the source document (optional).
    pub document_id: Option<String>,
    /// One of: decision, assumption, action, evidence, risk, goal, open_question.
    pub candidate_type: String,
    /// Free-form JSON object describing the extracted item. For assumption,
    /// action, and evidence candidates you may include "relates_to_decision_id"
    /// (a decision UUID) and an optional "relation_type" so that, on accept, the
    /// new entity is automatically linked under that decision.
    pub payload: Value,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct ListDecisionsParams {
    /// Optional status filter (matches the decision's stored status string).
    pub status: Option<String>,
    /// Maximum number of decisions to return (default 20, max 200).
    pub limit: Option<i64>,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct GetDecisionContextParams {
    /// UUID of the decision.
    pub decision_id: String,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct CreateDriftSignalParams {
    /// One of: assumption_challenged, decision_contradicted, action_stale, goal_mismatch, evidence_outdated.
    pub drift_type: String,
    /// UUID of the affected entity.
    pub target_entity_id: String,
    /// One of: decision, assumption, action, evidence, drift_signal, memo.
    pub target_entity_type: String,
    /// Short summary of the drift.
    pub summary: String,
    /// One of: low, medium, high.
    pub severity: String,
    /// Why the new evidence matters for the target entity.
    pub explanation: String,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct CreateMemoParams {
    /// Memo category, e.g. drift_memo, decision_memo.
    pub memo_type: String,
    /// Memo title.
    pub title: String,
    /// Memo body in Markdown.
    pub body_markdown: String,
    /// Lifecycle state: draft (default) or final.
    pub status: Option<String>,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct UpdateMemoParams {
    /// UUID of the memo to update.
    pub memo_id: String,
    /// New title (optional).
    pub title: Option<String>,
    /// New memo category (optional).
    pub memo_type: Option<String>,
    /// New Markdown body (optional). Use this to fill in a draft's TODOs.
    pub body_markdown: Option<String>,
    /// New lifecycle state: draft or final (optional).
    pub status: Option<String>,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct GetMemoParams {
    /// UUID of the memo to fetch.
    pub memo_id: String,
}

#[derive(Debug, Deserialize, schemars::JsonSchema)]
pub struct CreateRelationParams {
    /// UUID of the source entity.
    pub from_entity_id: String,
    /// Type of the source entity: decision, assumption, action, evidence, drift_signal, memo.
    pub from_entity_type: String,
    /// UUID of the target entity.
    pub to_entity_id: String,
    /// Type of the target entity: decision, assumption, action, evidence, drift_signal, memo.
    pub to_entity_type: String,
    /// One of: supports, depends_on, challenges, contradicts, produces, mitigates, replaces, related_to.
    pub relation_type: String,
}