Skip to content

Commit 2b4fcab

Browse files
authored
chore(rust): Move schema crate into workspace subdirectory (#1456)
1 parent 015e151 commit 2b4fcab

36 files changed

Lines changed: 99 additions & 78 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Read MSRV from Cargo.toml
2929
id: msrv
3030
run: |
31-
msrv="$(sed -n 's/^rust-version[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' Cargo.toml)"
31+
msrv="$(sed -n 's/^rust-version[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' agent-client-protocol-schema/Cargo.toml)"
3232
test -n "$msrv"
3333
echo "version=$msrv" >> "$GITHUB_OUTPUT"
3434

.release-plz.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ release_always = false
44

55
[[package]]
66
name = "agent-client-protocol-schema"
7+
changelog_path = "CHANGELOG.md"
78
git_release_latest = false
89
git_release_name = "Rust Crate v{{ version }}"
910
git_tag_name = "v{{ version }}"

Cargo.toml

Lines changed: 12 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,17 @@
1-
[package]
2-
name = "agent-client-protocol-schema"
3-
authors = ["Zed <hi@zed.dev>"]
4-
version = "0.13.7"
5-
edition = "2024"
6-
license = "Apache-2.0"
7-
description = "A protocol for standardizing communication between code editors and AI coding agents"
8-
repository = "https://github.com/agentclientprotocol/agent-client-protocol"
9-
homepage = "https://github.com/agentclientprotocol/agent-client-protocol"
10-
documentation = "https://docs.rs/agent-client-protocol-schema"
11-
readme = "README.md"
12-
keywords = ["agent", "client", "protocol", "ai", "editor"]
13-
categories = ["development-tools", "api-bindings"]
14-
include = ["/src/**/*.rs", "/README.md", "/LICENSE", "/Cargo.toml"]
15-
rust-version = "1.88.0"
16-
171
[workspace]
18-
default-members = [".", "schema/v1", "schema/v2", "schema-generator"]
19-
members = ["schema/v1", "schema/v2", "schema-generator"]
20-
resolver = "3"
21-
22-
[package.metadata.docs.rs]
23-
all-features = true
24-
rustdoc-args = ["--cfg", "docsrs"]
25-
26-
[lints]
27-
workspace = true
28-
29-
[features]
30-
unstable = [
31-
"unstable_auth_methods",
32-
"unstable_cancel_request",
33-
"unstable_elicitation",
34-
"unstable_llm_providers",
35-
"unstable_mcp_over_acp",
36-
"unstable_nes",
37-
"unstable_plan_operations",
38-
"unstable_session_fork",
39-
"unstable_end_turn_token_usage",
40-
"unstable_boolean_config",
41-
"unstable_model_config_category",
2+
default-members = [
3+
"agent-client-protocol-schema",
4+
"schema/v1",
5+
"schema/v2",
6+
"schema-generator",
427
]
43-
# Protocol v2 is intentionally NOT part of the `unstable` umbrella.
44-
# It introduces a parallel `v2` module and (eventually) a different wire
45-
# version, so it must be opted into explicitly to avoid silently
46-
# changing `ProtocolVersion::LATEST` for `unstable` users.
47-
unstable_protocol_v2 = []
48-
unstable_auth_methods = []
49-
unstable_cancel_request = []
50-
unstable_elicitation = []
51-
unstable_llm_providers = []
52-
unstable_mcp_over_acp = []
53-
unstable_nes = []
54-
unstable_plan_operations = []
55-
unstable_session_fork = []
56-
unstable_end_turn_token_usage = []
57-
unstable_boolean_config = []
58-
unstable_model_config_category = []
59-
60-
# Emit `tracing::warn!` events when `VecSkipError` drops a malformed list
61-
# entry during deserialization. When disabled (the default), the inspector
62-
# hook compiles down to serde_with's built-in no-op and has zero runtime cost.
63-
tracing = ["dep:tracing"]
64-
65-
[dependencies]
66-
anyhow = "1"
67-
derive_more = { version = "2", features = ["from", "display"] }
68-
schemars = { version = "1" }
69-
# `rc` is required for Arc-based protocol strings and RawValue payloads.
70-
serde = { version = "1", features = ["derive", "rc"] }
71-
# `raw_value` powers extension passthrough payloads; `preserve_order` keeps
72-
# caller-supplied object key order in arbitrary JSON values and maps.
73-
serde_json = { version = "1", features = ["preserve_order", "raw_value"] }
74-
serde_with = { version = "3.20.0", features = ["json", "schemars_1"] }
75-
strum = { version = "0.28", features = ["derive"] }
76-
tracing = { version = "0.1", default-features = false, optional = true }
8+
members = [
9+
"agent-client-protocol-schema",
10+
"schema/v1",
11+
"schema/v2",
12+
"schema-generator",
13+
]
14+
resolver = "3"
7715

7816
[workspace.lints.rust]
7917
future_incompatible = { level = "warn", priority = -1 }
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
[package]
2+
name = "agent-client-protocol-schema"
3+
authors = ["Zed <hi@zed.dev>"]
4+
version = "0.13.7"
5+
edition = "2024"
6+
license = "Apache-2.0"
7+
description = "A protocol for standardizing communication between code editors and AI coding agents"
8+
repository = "https://github.com/agentclientprotocol/agent-client-protocol"
9+
homepage = "https://github.com/agentclientprotocol/agent-client-protocol"
10+
documentation = "https://docs.rs/agent-client-protocol-schema"
11+
readme = "../README.md"
12+
keywords = ["agent", "client", "protocol", "ai", "editor"]
13+
categories = ["development-tools", "api-bindings"]
14+
include = ["/src/**/*.rs", "/Cargo.toml"]
15+
rust-version = "1.88.0"
16+
17+
[package.metadata.docs.rs]
18+
all-features = true
19+
rustdoc-args = ["--cfg", "docsrs"]
20+
21+
[lints]
22+
workspace = true
23+
24+
[features]
25+
unstable = [
26+
"unstable_auth_methods",
27+
"unstable_cancel_request",
28+
"unstable_elicitation",
29+
"unstable_llm_providers",
30+
"unstable_mcp_over_acp",
31+
"unstable_nes",
32+
"unstable_plan_operations",
33+
"unstable_session_fork",
34+
"unstable_end_turn_token_usage",
35+
"unstable_boolean_config",
36+
"unstable_model_config_category",
37+
]
38+
# Protocol v2 is intentionally NOT part of the `unstable` umbrella.
39+
# It introduces a parallel `v2` module and (eventually) a different wire
40+
# version, so it must be opted into explicitly to avoid silently
41+
# changing `ProtocolVersion::LATEST` for `unstable` users.
42+
unstable_protocol_v2 = []
43+
unstable_auth_methods = []
44+
unstable_cancel_request = []
45+
unstable_elicitation = []
46+
unstable_llm_providers = []
47+
unstable_mcp_over_acp = []
48+
unstable_nes = []
49+
unstable_plan_operations = []
50+
unstable_session_fork = []
51+
unstable_end_turn_token_usage = []
52+
unstable_boolean_config = []
53+
unstable_model_config_category = []
54+
55+
# Emit `tracing::warn!` events when `VecSkipError` drops a malformed list
56+
# entry during deserialization. When disabled (the default), the inspector
57+
# hook compiles down to serde_with's built-in no-op and has zero runtime cost.
58+
tracing = ["dep:tracing"]
59+
60+
[dependencies]
61+
anyhow = "1"
62+
derive_more = { version = "2", features = ["from", "display"] }
63+
schemars = { version = "1" }
64+
# `rc` is required for Arc-based protocol strings and RawValue payloads.
65+
serde = { version = "1", features = ["derive", "rc"] }
66+
# `raw_value` powers extension passthrough payloads; `preserve_order` keeps
67+
# caller-supplied object key order in arbitrary JSON values and maps.
68+
serde_json = { version = "1", features = ["preserve_order", "raw_value"] }
69+
serde_with = { version = "3.20.0", features = ["json", "schemars_1"] }
70+
strum = { version = "0.28", features = ["derive"] }
71+
tracing = { version = "0.1", default-features = false, optional = true }

src/serde_util.rs renamed to agent-client-protocol-schema/src/serde_util.rs

File renamed without changes.

src/v1/agent.rs renamed to agent-client-protocol-schema/src/v1/agent.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5001,10 +5001,12 @@ mod test_serialization {
50015001
use super::*;
50025002
use serde_json::json;
50035003

5004+
#[cfg(feature = "unstable_boolean_config")]
50045005
fn test_meta() -> Meta {
50055006
json!({ "source": "test" }).as_object().unwrap().clone()
50065007
}
50075008

5009+
#[cfg(feature = "unstable_boolean_config")]
50085010
fn serialized_meta_key_count(value: &impl serde::Serialize) -> usize {
50095011
serde_json::to_string(value)
50105012
.unwrap()

src/v1/client.rs renamed to agent-client-protocol-schema/src/v1/client.rs

File renamed without changes.

src/v1/content.rs renamed to agent-client-protocol-schema/src/v1/content.rs

File renamed without changes.

0 commit comments

Comments
 (0)