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
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.4.3 (2025-09-25)

### Protocol

- Defined `Resource not found` error type as code `-32002` (same as MCP)

### Rust

- impl `Agent` and `Client` for `Rc<T>` and `Arc<T>` where `T` implements either trait.

## 0.4.2 (2025-09-22)

### Rust
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "agent-client-protocol"
authors = ["Zed <hi@zed.dev>"]
version = "0.4.2"
version = "0.4.3"
edition = "2024"
license = "Apache-2.0"
description = "A protocol for standardizing communication between code editors and AI coding agents"
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@zed-industries/agent-client-protocol",
"version": "0.4.2",
"version": "0.4.3",
"publishConfig": {
"access": "public"
},
Expand Down
18 changes: 18 additions & 0 deletions rust/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ impl Error {
Error::new(ErrorCode::AUTH_REQUIRED)
}

/// A given resource, such as a file, was not found.
#[must_use]
pub fn resource_not_found(uri: Option<String>) -> Self {
let err = Error::new(ErrorCode::RESOURCE_NOT_FOUND);
if let Some(uri) = uri {
err.with_data(serde_json::json!({ "uri": uri }))
} else {
err
}
}

/// Converts a standard error into an internal JSON-RPC error.
///
/// The error's string representation is included as additional data.
Expand Down Expand Up @@ -153,6 +164,13 @@ impl ErrorCode {
code: -32000,
message: "Authentication required",
};

/// A given resource, such as a file, was not found.
/// This is an ACP-specific error code in the reserved range.
pub const RESOURCE_NOT_FOUND: ErrorCode = ErrorCode {
code: -32002,
message: "Resource not found",
};
}

impl From<ErrorCode> for (i32, String) {
Expand Down
7 changes: 7 additions & 0 deletions typescript/acp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,13 @@ export class RequestError extends Error {
return new RequestError(-32000, "Authentication required", data);
}

/**
* Resource, such as a file, was not found
*/
static resourceNotFound(uri?: string): RequestError {
return new RequestError(-32002, "Resource not found", uri && { uri });
}

toResult<T>(): Result<T> {
return {
error: {
Expand Down