Update to new schema

This commit is contained in:
Agus Zubiaga 2025-07-28 18:02:21 -03:00
parent a55bd49c8d
commit 0f395df9a8
5 changed files with 17 additions and 22 deletions

4
Cargo.lock generated
View file

@ -138,9 +138,7 @@ dependencies = [
[[package]]
name = "agent-client-protocol"
version = "0.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72ec54650c1fc2d63498bab47eeeaa9eddc7d239d53f615b797a0e84f7ccc87b"
version = "0.0.12"
dependencies = [
"schemars",
"serde",

View file

@ -413,7 +413,7 @@ zlog_settings = { path = "crates/zlog_settings" }
#
agentic-coding-protocol = "0.0.10"
agent-client-protocol = "0.0.11"
agent-client-protocol = {path="../agent-client-protocol"}
aho-corasick = "1.1"
alacritty_terminal = { git = "https://github.com/zed-industries/alacritty.git", branch = "add-hush-login-flag" }
any_vec = "0.14"

View file

@ -391,7 +391,7 @@ impl ToolCallContent {
cx: &mut App,
) -> Self {
match content {
acp::ToolCallContent::ContentBlock(content) => Self::ContentBlock {
acp::ToolCallContent::Content { content } => Self::ContentBlock {
content: ContentBlock::new(content, &language_registry, cx),
},
acp::ToolCallContent::Diff { diff } => Self::Diff {
@ -682,14 +682,14 @@ impl AcpThread {
cx: &mut Context<Self>,
) -> Result<()> {
match update {
acp::SessionUpdate::UserMessage(content_block) => {
self.push_user_content_block(content_block, cx);
acp::SessionUpdate::UserMessageChunk { content } => {
self.push_user_content_block(content, cx);
}
acp::SessionUpdate::AgentMessageChunk(content_block) => {
self.push_assistant_content_block(content_block, false, cx);
acp::SessionUpdate::AgentMessageChunk { content } => {
self.push_assistant_content_block(content, false, cx);
}
acp::SessionUpdate::AgentThoughtChunk(content_block) => {
self.push_assistant_content_block(content_block, true, cx);
acp::SessionUpdate::AgentThoughtChunk { content } => {
self.push_assistant_content_block(content, true, cx);
}
acp::SessionUpdate::ToolCall(tool_call) => {
self.upsert_tool_call(tool_call, cx);

View file

@ -73,7 +73,7 @@ impl AgentServer for Codex {
client
.client()
.context("Failed to subscribe")?
.on_notification(acp::SESSION_UPDATE_METHOD_NAME, {
.on_notification(acp::AGENT_METHODS.session_update, {
move |notification, _cx| {
let notification_tx = notification_tx.clone();
log::trace!(
@ -149,13 +149,9 @@ impl AgentConnection for CodexConnection {
let response = client
.request::<requests::CallTool>(context_server::types::CallToolParams {
name: acp::NEW_SESSION_TOOL_NAME.into(),
name: acp::AGENT_METHODS.new_session.into(),
arguments: Some(serde_json::to_value(acp::NewSessionArguments {
mcp_servers: [(
mcp_server::SERVER_NAME.to_string(),
mcp_server.server_config()?,
)]
.into(),
mcp_servers: vec![mcp_server.server_config()?],
client_tools: acp::ClientTools {
request_permission: Some(acp::McpToolId {
mcp_server: mcp_server::SERVER_NAME.into(),
@ -227,7 +223,7 @@ impl AgentConnection for CodexConnection {
let result = client
.request_with::<requests::CallTool>(
context_server::types::CallToolParams {
name: acp::PROMPT_TOOL_NAME.into(),
name: acp::AGENT_METHODS.prompt.into(),
arguments: Some(serde_json::to_value(params)?),
meta: None,
},

View file

@ -37,7 +37,7 @@ impl ZedMcpServer {
Ok(Self { server: mcp_server })
}
pub fn server_config(&self) -> Result<acp::McpServerConfig> {
pub fn server_config(&self) -> Result<acp::McpServer> {
#[cfg(not(test))]
let zed_path = anyhow::Context::context(
std::env::current_exe(),
@ -47,13 +47,14 @@ impl ZedMcpServer {
#[cfg(test)]
let zed_path = crate::e2e_tests::get_zed_path();
Ok(acp::McpServerConfig {
Ok(acp::McpServer {
name: SERVER_NAME.into(),
command: zed_path,
args: vec![
"--nc".into(),
self.server.socket_path().display().to_string(),
],
env: None,
env: vec![],
})
}