agent_client_protocol_schema/v1/
mod.rs1mod agent;
4mod client;
5mod content;
6mod elicitation;
7mod error;
8mod ext;
9#[cfg(feature = "unstable_mcp_over_acp")]
10mod mcp;
11mod plan;
12mod protocol_level;
13mod tool_call;
14
15pub use crate::rpc::{JsonRpcBatch, JsonRpcMessage, Notification, Request, RequestId};
16pub use agent::*;
17pub use client::*;
18pub use content::*;
19use derive_more::{Display, From};
20pub use elicitation::*;
21pub use error::*;
22pub use ext::*;
23#[cfg(feature = "unstable_mcp_over_acp")]
24pub use mcp::*;
25pub use plan::*;
26pub use protocol_level::*;
27pub use serde_json::value::RawValue;
28pub use tool_call::*;
29
30pub type Response<Result> = crate::rpc::Response<Result, Error>;
32
33use serde::{Deserialize, Serialize};
34use std::sync::Arc;
35
36#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
43#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Display, From)]
44#[serde(transparent)]
45#[from(Arc<str>, String, &'static str)]
46#[non_exhaustive]
47pub struct SessionId(pub Arc<str>);
48
49impl SessionId {
50 #[must_use]
52 pub fn new(id: impl Into<Arc<str>>) -> Self {
53 Self(id.into())
54 }
55}