agent_client_protocol/
ext.rs

1//! Extension types and constants for protocol extensibility.
2
3use schemars::JsonSchema;
4use serde::{Deserialize, Serialize};
5use serde_json::value::RawValue;
6use std::sync::Arc;
7
8#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
9#[serde(transparent)]
10#[schemars(with = "serde_json::Value")]
11pub struct ExtRequest {
12    #[serde(skip)] // this is used for routing, but when serializing we only want the params
13    pub method: Arc<str>,
14    pub params: Arc<RawValue>,
15}
16
17pub type ExtResponse = Arc<RawValue>;
18
19#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
20#[serde(transparent)]
21#[schemars(with = "serde_json::Value")]
22pub struct ExtNotification {
23    #[serde(skip)] // this is used for routing, but when serializing we only want the params
24    pub method: Arc<str>,
25    pub params: Arc<RawValue>,
26}