Skip to content

Commit f5aae50

Browse files
authored
refactor(rust): Move to a more typical rust lib setup (#299)
1 parent 6e58ea3 commit f5aae50

File tree

15 files changed

+7
-10
lines changed

15 files changed

+7
-10
lines changed

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ All paths in the protocol should be absolute
22

33
## Adding new methods
44

5-
- Create empty params and output structs in rust/client.rs or rust/agent.rs under the corresponding section. I'll add the fields myself.
5+
- Create empty params and output structs in src/client.rs or src/agent.rs under the corresponding section. I'll add the fields myself.
66
- If the protocol method name is `noun/verb`, use `verb_noun` for the user facing methods and structs.
77

88
Example 1 (`noun/noun`):
@@ -20,7 +20,7 @@ All paths in the protocol should be absolute
2020
- Do not write any tests or docs at all!
2121
- Add constants for the method names
2222
- Add variants to {Agent|Client}{Request|Response} enums
23-
- Add the methods to the Client/Agent impl of {Agent|Client}SideConnection in rust/acp.rs
23+
- Add the methods to the Client/Agent impl of {Agent|Client}SideConnection in src/acp.rs
2424
- Handle the new method in the `Side::decode_request`/`Side::decode_notification` implementation
2525
- Handle the new request in the blanket impl of MessageHandler<{Agent|Client}Side>
2626
- Add the method to markdown_generator.rs SideDocs functions

Cargo.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,16 @@ documentation = "https://docs.rs/agent-client-protocol-schema"
1111
readme = "README.md"
1212
keywords = ["agent", "client", "protocol", "ai", "editor"]
1313
categories = ["development-tools", "api-bindings"]
14-
include = ["/rust/**/*.rs", "/README.md", "/LICENSE", "/Cargo.toml"]
14+
include = ["/src/**/*.rs", "/README.md", "/LICENSE", "/Cargo.toml"]
1515

1616
[features]
1717
unstable = ["unstable_session_model", "unstable_session_list"]
1818
unstable_session_model = []
1919
unstable_session_list = []
2020

21-
[lib]
22-
path = "rust/acp.rs"
23-
2421
[[bin]]
2522
name = "generate"
26-
path = "rust/bin/generate.rs"
23+
path = "src/bin/generate.rs"
2724

2825
[dependencies]
2926
anyhow = "1"

docs/rfds/session-list.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Agents that implement this feature gain:
188188

189189
### Phase 2: Reference Implementation
190190

191-
3. **Implement in Rust SDK** (`rust/agent.rs` and `rust/client.rs`):
191+
3. **Implement in Rust SDK** (`src/agent.rs` and `src/client.rs`):
192192
- Add `list_sessions` method to agent trait
193193
- Provide default implementation (empty list) for agents without persistence
194194
- Add client method to call `session/list`

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
],
2222
"type": "module",
2323
"scripts": {
24-
"generate:json-schema": "cd rust && cargo run --bin generate",
25-
"generate:json-schema:unstable": "cd rust && cargo run --bin generate --features unstable",
24+
"generate:json-schema": "cargo run --bin generate",
25+
"generate:json-schema:unstable": "cargo run --bin generate --features unstable",
2626
"generate": "npm run generate:json-schema && npm run generate:json-schema:unstable && npm run format",
2727
"format": "prettier --write . && cargo fmt",
2828
"format:check": "prettier --check . && cargo fmt -- --check",
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)