Update to new schema
This commit is contained in:
parent
a55bd49c8d
commit
0f395df9a8
5 changed files with 17 additions and 22 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -138,9 +138,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "agent-client-protocol"
|
name = "agent-client-protocol"
|
||||||
version = "0.0.11"
|
version = "0.0.12"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "72ec54650c1fc2d63498bab47eeeaa9eddc7d239d53f615b797a0e84f7ccc87b"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"schemars",
|
"schemars",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
|
@ -413,7 +413,7 @@ zlog_settings = { path = "crates/zlog_settings" }
|
||||||
#
|
#
|
||||||
|
|
||||||
agentic-coding-protocol = "0.0.10"
|
agentic-coding-protocol = "0.0.10"
|
||||||
agent-client-protocol = "0.0.11"
|
agent-client-protocol = {path="../agent-client-protocol"}
|
||||||
aho-corasick = "1.1"
|
aho-corasick = "1.1"
|
||||||
alacritty_terminal = { git = "https://github.com/zed-industries/alacritty.git", branch = "add-hush-login-flag" }
|
alacritty_terminal = { git = "https://github.com/zed-industries/alacritty.git", branch = "add-hush-login-flag" }
|
||||||
any_vec = "0.14"
|
any_vec = "0.14"
|
||||||
|
|
|
@ -391,7 +391,7 @@ impl ToolCallContent {
|
||||||
cx: &mut App,
|
cx: &mut App,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
match content {
|
match content {
|
||||||
acp::ToolCallContent::ContentBlock(content) => Self::ContentBlock {
|
acp::ToolCallContent::Content { content } => Self::ContentBlock {
|
||||||
content: ContentBlock::new(content, &language_registry, cx),
|
content: ContentBlock::new(content, &language_registry, cx),
|
||||||
},
|
},
|
||||||
acp::ToolCallContent::Diff { diff } => Self::Diff {
|
acp::ToolCallContent::Diff { diff } => Self::Diff {
|
||||||
|
@ -682,14 +682,14 @@ impl AcpThread {
|
||||||
cx: &mut Context<Self>,
|
cx: &mut Context<Self>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
match update {
|
match update {
|
||||||
acp::SessionUpdate::UserMessage(content_block) => {
|
acp::SessionUpdate::UserMessageChunk { content } => {
|
||||||
self.push_user_content_block(content_block, cx);
|
self.push_user_content_block(content, cx);
|
||||||
}
|
}
|
||||||
acp::SessionUpdate::AgentMessageChunk(content_block) => {
|
acp::SessionUpdate::AgentMessageChunk { content } => {
|
||||||
self.push_assistant_content_block(content_block, false, cx);
|
self.push_assistant_content_block(content, false, cx);
|
||||||
}
|
}
|
||||||
acp::SessionUpdate::AgentThoughtChunk(content_block) => {
|
acp::SessionUpdate::AgentThoughtChunk { content } => {
|
||||||
self.push_assistant_content_block(content_block, true, cx);
|
self.push_assistant_content_block(content, true, cx);
|
||||||
}
|
}
|
||||||
acp::SessionUpdate::ToolCall(tool_call) => {
|
acp::SessionUpdate::ToolCall(tool_call) => {
|
||||||
self.upsert_tool_call(tool_call, cx);
|
self.upsert_tool_call(tool_call, cx);
|
||||||
|
|
|
@ -73,7 +73,7 @@ impl AgentServer for Codex {
|
||||||
client
|
client
|
||||||
.client()
|
.client()
|
||||||
.context("Failed to subscribe")?
|
.context("Failed to subscribe")?
|
||||||
.on_notification(acp::SESSION_UPDATE_METHOD_NAME, {
|
.on_notification(acp::AGENT_METHODS.session_update, {
|
||||||
move |notification, _cx| {
|
move |notification, _cx| {
|
||||||
let notification_tx = notification_tx.clone();
|
let notification_tx = notification_tx.clone();
|
||||||
log::trace!(
|
log::trace!(
|
||||||
|
@ -149,13 +149,9 @@ impl AgentConnection for CodexConnection {
|
||||||
|
|
||||||
let response = client
|
let response = client
|
||||||
.request::<requests::CallTool>(context_server::types::CallToolParams {
|
.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 {
|
arguments: Some(serde_json::to_value(acp::NewSessionArguments {
|
||||||
mcp_servers: [(
|
mcp_servers: vec![mcp_server.server_config()?],
|
||||||
mcp_server::SERVER_NAME.to_string(),
|
|
||||||
mcp_server.server_config()?,
|
|
||||||
)]
|
|
||||||
.into(),
|
|
||||||
client_tools: acp::ClientTools {
|
client_tools: acp::ClientTools {
|
||||||
request_permission: Some(acp::McpToolId {
|
request_permission: Some(acp::McpToolId {
|
||||||
mcp_server: mcp_server::SERVER_NAME.into(),
|
mcp_server: mcp_server::SERVER_NAME.into(),
|
||||||
|
@ -227,7 +223,7 @@ impl AgentConnection for CodexConnection {
|
||||||
let result = client
|
let result = client
|
||||||
.request_with::<requests::CallTool>(
|
.request_with::<requests::CallTool>(
|
||||||
context_server::types::CallToolParams {
|
context_server::types::CallToolParams {
|
||||||
name: acp::PROMPT_TOOL_NAME.into(),
|
name: acp::AGENT_METHODS.prompt.into(),
|
||||||
arguments: Some(serde_json::to_value(params)?),
|
arguments: Some(serde_json::to_value(params)?),
|
||||||
meta: None,
|
meta: None,
|
||||||
},
|
},
|
||||||
|
|
|
@ -37,7 +37,7 @@ impl ZedMcpServer {
|
||||||
Ok(Self { server: mcp_server })
|
Ok(Self { server: mcp_server })
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn server_config(&self) -> Result<acp::McpServerConfig> {
|
pub fn server_config(&self) -> Result<acp::McpServer> {
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
let zed_path = anyhow::Context::context(
|
let zed_path = anyhow::Context::context(
|
||||||
std::env::current_exe(),
|
std::env::current_exe(),
|
||||||
|
@ -47,13 +47,14 @@ impl ZedMcpServer {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
let zed_path = crate::e2e_tests::get_zed_path();
|
let zed_path = crate::e2e_tests::get_zed_path();
|
||||||
|
|
||||||
Ok(acp::McpServerConfig {
|
Ok(acp::McpServer {
|
||||||
|
name: SERVER_NAME.into(),
|
||||||
command: zed_path,
|
command: zed_path,
|
||||||
args: vec![
|
args: vec![
|
||||||
"--nc".into(),
|
"--nc".into(),
|
||||||
self.server.socket_path().display().to_string(),
|
self.server.socket_path().display().to_string(),
|
||||||
],
|
],
|
||||||
env: None,
|
env: vec![],
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue