diff --git a/.github/workflows/rust-lint-test.yml b/.github/workflows/rust-lint-test.yml index f11acedd80..60d8f67034 100644 --- a/.github/workflows/rust-lint-test.yml +++ b/.github/workflows/rust-lint-test.yml @@ -4,11 +4,11 @@ on: push: branches: [ "main" ] paths: - - "crates/**" - - ".github/workflows/rust.yml" - - "tests/**" - - "Cargo.toml" - - ".cargo/**" + - "sdks/community/rust/crates/**" + - ".github/workflows/rust-lint-test.yml" + - "sdks/community/rust/**/tests/**" + - "sdks/community/rust/Cargo.toml" + - "sdks/community/rust/.cargo/**" pull_request: branches: [ "main" ] paths: @@ -20,7 +20,7 @@ on: defaults: run: - working-directory: ./rust + working-directory: ./sdks/community/rust jobs: rust: @@ -40,6 +40,8 @@ jobs: # Built-in cache is fork-safe (fork PRs can't write to base repo cache) - uses: Swatinem/rust-cache@v2 + with: + workspaces: sdks/community/rust - name: Build run: cargo build --verbose @@ -54,7 +56,10 @@ jobs: run: cargo publish -p ag-ui-core --dry-run - name: Publish ag-ui-client dry-run - run: cargo publish -p ag-ui-client --dry-run + # --no-verify: the verification rebuild resolves ag-ui-core from + # crates.io (stale v0.1.0, missing types added since). Build + # correctness is already validated by the Build and Test steps. + run: cargo publish -p ag-ui-client --dry-run --no-verify - name: Run tests run: cargo test --verbose diff --git a/sdks/community/rust/README.md b/sdks/community/rust/README.md new file mode 100644 index 0000000000..743a4c6968 --- /dev/null +++ b/sdks/community/rust/README.md @@ -0,0 +1,27 @@ +# AG-UI Rust SDK + +> **Status:** This is a community-contributed SDK that is not actively maintained. The versions +> published to crates.io (`ag-ui-core` v0.1.0, `ag-ui-client` v0.1.0) are outdated and missing +> types required by the client. To use this SDK, build from source against the workspace in this +> repository. See [ag-ui-protocol/ag-ui#243](https://github.com/ag-ui-protocol/ag-ui/pull/243) +> for the original contribution. + +A Rust implementation of the [AG-UI protocol](https://docs.ag-ui.com), organized as a Cargo workspace with two crates: + +- **[`ag-ui-core`](crates/ag-ui-core)** -- Core protocol types (events, messages, state, tools) implemented with `serde` for (de)serialization. +- **[`ag-ui-client`](crates/ag-ui-client)** -- HTTP client for connecting to AG-UI agent endpoints, designed to mirror the TypeScript client API. + +## Building from source + +```bash +cd sdks/community/rust +cargo build +``` + +## Running examples + +```bash +cargo run --example +``` + +See the [examples folder](crates/ag-ui-client/examples) and individual crate READMEs for more details. diff --git a/sdks/community/rust/crates/ag-ui-client/README.md b/sdks/community/rust/crates/ag-ui-client/README.md index c4a40dc72c..181ad39129 100644 --- a/sdks/community/rust/crates/ag-ui-client/README.md +++ b/sdks/community/rust/crates/ag-ui-client/README.md @@ -1,5 +1,9 @@ # AG-UI Rust Client +> **Status:** This is a community-contributed crate that is not actively maintained. The version +> on crates.io (v0.1.0) is outdated and missing types required by the client. Build from source +> against the [workspace](../../) in this repository instead. + Rust client for working with the AG-UI protocol. The client API has been designed to mimic the Typescript client as close as possible. However, a key difference is that state & messages are not yet an attribute of an implementation of [`Agent`](src/agent.rs) because it would require `&mut self` for straightforward implementations. This is a work in @@ -11,7 +15,7 @@ For each example make sure to read the instructions on starting the associated A ### Basic -```rust +```rust,no_run use std::error::Error; use ag_ui_client::{core::types::Message, Agent, HttpAgent, RunAgentParams}; diff --git a/sdks/community/rust/crates/ag-ui-client/tests/http_agent_test.rs b/sdks/community/rust/crates/ag-ui-client/tests/http_agent_test.rs index 44c47ae06b..a07dd49854 100644 --- a/sdks/community/rust/crates/ag-ui-client/tests/http_agent_test.rs +++ b/sdks/community/rust/crates/ag-ui-client/tests/http_agent_test.rs @@ -3,6 +3,7 @@ use ag_ui_client::agent::{Agent, RunAgentParams}; use ag_ui_client::core::types::{Message, Role}; #[tokio::test] +#[ignore] // Requires a live server on localhost:3001 async fn test_http_agent_basic_functionality() { env_logger::init(); @@ -54,6 +55,7 @@ async fn test_http_agent_basic_functionality() { } #[tokio::test] +#[ignore] // Requires a live server on localhost:3001 async fn test_http_agent_tool_calls() { // Create an HttpAgent let agent = HttpAgent::builder() diff --git a/sdks/community/rust/crates/ag-ui-client/tests/sse_test.rs b/sdks/community/rust/crates/ag-ui-client/tests/sse_test.rs index 8b1abb85ce..2713454d66 100644 --- a/sdks/community/rust/crates/ag-ui-client/tests/sse_test.rs +++ b/sdks/community/rust/crates/ag-ui-client/tests/sse_test.rs @@ -4,6 +4,7 @@ use reqwest::Client; use serde::Deserialize; use std::time::Duration; +#[ignore] #[tokio::test] async fn test_sse_with_httpbun() { // Create a reqwest client diff --git a/sdks/community/rust/crates/ag-ui-core/README.md b/sdks/community/rust/crates/ag-ui-core/README.md index 749e5cff6f..d99c4b85e2 100644 --- a/sdks/community/rust/crates/ag-ui-core/README.md +++ b/sdks/community/rust/crates/ag-ui-core/README.md @@ -1,5 +1,9 @@ # AG-UI Core Types +> **Status:** This is a community-contributed crate that is not actively maintained. The version +> on crates.io (v0.1.0) is outdated and missing types required by `ag-ui-client`. Build from +> source against the [workspace](../../) in this repository instead. + This repo contains the Rust types needed to work with the AG-UI protocol. Implemented using `serde` to support (de)serialization.