Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/sacp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ repository = "https://github.com/symposium-dev/symposium-acp"
keywords = ["acp", "agent", "protocol", "ai"]
categories = ["development-tools"]

[features]
default = []

# Forward unstable features from agent-client-protocol-schema.
# Enable these to get support for the corresponding unstable ACP methods.
unstable = [
"unstable_session_model",
"unstable_session_fork",
"unstable_session_resume",
"unstable_session_close",
]
unstable_session_model = ["agent-client-protocol-schema/unstable_session_model"]
unstable_session_fork = ["agent-client-protocol-schema/unstable_session_fork"]
unstable_session_resume = ["agent-client-protocol-schema/unstable_session_resume"]
unstable_session_close = ["agent-client-protocol-schema/unstable_session_close"]

[dependencies]
agent-client-protocol-schema.workspace = true
sacp-derive = { version = "11.0.0", path = "../sacp-derive" }
Expand Down
31 changes: 1 addition & 30 deletions src/sacp/src/schema/agent_to_client/notifications.rs
Original file line number Diff line number Diff line change
@@ -1,32 +1,3 @@
use crate::schema::SessionNotification;
use serde::Serialize;

use crate::jsonrpc::{JsonRpcMessage, JsonRpcNotification};

const METHOD_SESSION_UPDATE: &str = "session/update";

// Agent -> Client notifications
// These are one-way messages that agents send to clients/editors

impl JsonRpcMessage for SessionNotification {
fn matches_method(method: &str) -> bool {
method == METHOD_SESSION_UPDATE
}

fn method(&self) -> &str {
METHOD_SESSION_UPDATE
}

fn to_untyped_message(&self) -> Result<crate::UntypedMessage, crate::Error> {
crate::UntypedMessage::new(self.method(), self)
}

fn parse_message(method: &str, params: &impl Serialize) -> Result<Self, crate::Error> {
if !Self::matches_method(method) {
return Err(crate::Error::method_not_found());
}
crate::util::json_cast(params)
}
}

impl JsonRpcNotification for SessionNotification {}
impl_jsonrpc_notification!(SessionNotification, "session/update");
Loading
Loading