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;
11#[cfg(feature = "unstable_nes")]
12mod nes;
13mod plan;
14mod protocol_level;
15mod tool_call;
16
17pub use crate::rpc::{JsonRpcBatch, JsonRpcMessage, Notification, Request, RequestId};
18pub use agent::*;
19pub use client::*;
20pub use content::*;
21use derive_more::{Display, From};
22pub use elicitation::*;
23pub use error::*;
24pub use ext::*;
25#[cfg(feature = "unstable_mcp_over_acp")]
26pub use mcp::*;
27#[cfg(feature = "unstable_nes")]
28pub use nes::*;
29pub use plan::*;
30pub use protocol_level::*;
31pub use serde_json::value::RawValue;
32pub use tool_call::*;
33
34pub type Response<Result> = crate::rpc::Response<Result, Error>;
36
37use serde::{Deserialize, Serialize};
38use std::sync::Arc;
39
40#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
47#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash, Display, From)]
48#[serde(transparent)]
49#[from(Arc<str>, String, &'static str)]
50#[non_exhaustive]
51pub struct SessionId(pub Arc<str>);
52
53impl SessionId {
54 #[must_use]
56 pub fn new(id: impl Into<Arc<str>>) -> Self {
57 Self(id.into())
58 }
59}