par-term-acp 0.2.5

Agent Communication Protocol (ACP) implementation for par-term
Documentation
//! Content block types for ACP prompts and responses.

use serde::{Deserialize, Serialize};

/// A typed content block used in prompts and responses.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum ContentBlock {
    /// Plain text content.
    Text { text: String },
    /// An embedded resource (file content, blob, etc.).
    Resource { resource: ResourceContent },
}

/// The payload of a `Resource` content block.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ResourceContent {
    pub uri: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub blob: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mime_type: Option<String>,
}