{"id":51244611,"url":"https://github.com/agentruntimecontrolprotocol/rust-sdk","last_synced_at":"2026-06-29T03:03:08.386Z","repository":{"id":356978811,"uuid":"1234794689","full_name":"agentruntimecontrolprotocol/rust-sdk","owner":"agentruntimecontrolprotocol","description":"Rust reference SDK for ARCP (Agent Runtime Control Protocol).","archived":false,"fork":false,"pushed_at":"2026-06-16T21:30:23.000Z","size":1020,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-16T23:17:51.394Z","etag":null,"topics":["agent-protocol","agent-runtime-control-protocol","agents","ai-agents","arcp","durable-execution","llm","mcp","rust","sdk","streaming"],"latest_commit_sha":null,"homepage":"https://github.com/agentruntimecontrolprotocol/spec","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agentruntimecontrolprotocol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-10T16:45:34.000Z","updated_at":"2026-06-16T21:28:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/agentruntimecontrolprotocol/rust-sdk","commit_stats":null,"previous_names":["agentruntimecontrolprotocol/rust-sdk"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/agentruntimecontrolprotocol/rust-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentruntimecontrolprotocol%2Frust-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentruntimecontrolprotocol%2Frust-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentruntimecontrolprotocol%2Frust-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentruntimecontrolprotocol%2Frust-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agentruntimecontrolprotocol","download_url":"https://codeload.github.com/agentruntimecontrolprotocol/rust-sdk/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agentruntimecontrolprotocol%2Frust-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34911135,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent-protocol","agent-runtime-control-protocol","agents","ai-agents","arcp","durable-execution","llm","mcp","rust","sdk","streaming"],"created_at":"2026-06-29T03:03:07.497Z","updated_at":"2026-06-29T03:03:08.369Z","avatar_url":"https://github.com/agentruntimecontrolprotocol.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch3 align=\"center\"\u003eARCP Rust SDK\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\u003cstrong\u003eRust SDK for the Agent Runtime Control Protocol (ARCP) — submit, observe, and control long-running agent jobs from Rust.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/agentruntimecontrolprotocol/rust-sdk/actions/workflows/test.yml\"\u003e\u003cimg alt=\"CI\" src=\"https://github.com/agentruntimecontrolprotocol/rust-sdk/actions/workflows/test.yml/badge.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://codecov.io/gh/agentruntimecontrolprotocol/rust-sdk\"\u003e\u003cimg alt=\"codecov\" src=\"https://codecov.io/gh/agentruntimecontrolprotocol/rust-sdk/graph/badge.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/agentruntimecontrolprotocol/spec/blob/main/docs/draft-arcp-1.1.md\"\u003e\u003cimg alt=\"ARCP\" src=\"https://img.shields.io/badge/ARCP-v1.1%20draft-blue\"\u003e\u003c/a\u003e\n  \u003ca href=\"LICENSE-APACHE\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-lightgrey\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://crates.io/crates/arcp\"\u003e\u003cimg alt=\"arcp\" src=\"https://img.shields.io/crates/v/arcp.svg?label=arcp\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://crates.io/crates/arcp-core\"\u003e\u003cimg alt=\"arcp-core\" src=\"https://img.shields.io/crates/v/arcp-core.svg?label=arcp-core\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://crates.io/crates/arcp-client\"\u003e\u003cimg alt=\"arcp-client\" src=\"https://img.shields.io/crates/v/arcp-client.svg?label=arcp-client\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://crates.io/crates/arcp-runtime\"\u003e\u003cimg alt=\"arcp-runtime\" src=\"https://img.shields.io/crates/v/arcp-runtime.svg?label=arcp-runtime\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://docs.rs/arcp\"\u003e\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/docsrs/arcp?label=docs.rs\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/agentruntimecontrolprotocol/spec/blob/main/docs/draft-arcp-1.1.md\"\u003eSpecification\u003c/a\u003e ·\n  \u003ca href=\"#concepts\"\u003eConcepts\u003c/a\u003e ·\n  \u003ca href=\"#installation\"\u003eInstall\u003c/a\u003e ·\n  \u003ca href=\"#quick-start\"\u003eQuick start\u003c/a\u003e ·\n  \u003ca href=\"docs/\"\u003eGuides\u003c/a\u003e ·\n  \u003ca href=\"https://docs.rs/arcp\"\u003eAPI reference\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n`arcp` is the Rust reference implementation of [ARCP](https://github.com/agentruntimecontrolprotocol/spec/blob/main/docs/draft-arcp-1.1.md), the Agent Runtime Control Protocol. It covers both sides of the wire — `ARCPClient` for submitting and observing jobs, `ARCPRuntime` for hosting agents and tools — so either side can talk to any conformant peer in any language without hand-rolling the envelope, sequencing, or lease enforcement.\n\nARCP itself is a transport-agnostic wire protocol for long-running AI agent jobs. It owns the parts of agent infrastructure that don't change between products — sessions, durable event streams, capability leases, budgets, resume — and stays out of the parts that do. ARCP wraps the agent function; it does not define how agents are built, how tools are exposed (that's MCP), or how telemetry is exported (that's OpenTelemetry).\n\n## Installation\n\nRequires Rust 1.88 or later (the MSRV declared in `Cargo.toml`). The SDK is a Cargo workspace that publishes several independently-versioned crates on [crates.io](https://crates.io); most consumers want the umbrella `arcp` crate, which re-exports the protocol core, client, and runtime. Default features ship the WebSocket and stdio transports, and the in-memory transport is always available for tests.\n\n```sh\ncargo add arcp\n```\n\nTo drop the WebSocket dependency and keep only stdio plus the in-memory transport:\n\n```toml\n[dependencies]\narcp = { version = \"2\", default-features = false, features = [\"transport-stdio\"] }\n```\n\n### Workspace crates\n\nThe workspace publishes the following crates at independent versions. Pick `arcp` (the umbrella) unless you need to slim dependencies:\n\n| Crate | Version | Purpose |\n|---|---|---|\n| [`arcp`](https://crates.io/crates/arcp) | [![arcp](https://img.shields.io/crates/v/arcp.svg?label=)](https://crates.io/crates/arcp) | Umbrella — re-exports `arcp-core` + `arcp-client` + `arcp-runtime`. |\n| [`arcp-core`](https://crates.io/crates/arcp-core) | [![arcp-core](https://img.shields.io/crates/v/arcp-core.svg?label=)](https://crates.io/crates/arcp-core) | Wire types, error taxonomy, IDs, transports, `Authenticator` trait. No internal deps. |\n| [`arcp-client`](https://crates.io/crates/arcp-client) | [![arcp-client](https://img.shields.io/crates/v/arcp-client.svg?label=)](https://crates.io/crates/arcp-client) | `ARCPClient` and type-state `Session`. Pull this if you only submit and observe jobs. |\n| [`arcp-runtime`](https://crates.io/crates/arcp-runtime) | [![arcp-runtime](https://img.shields.io/crates/v/arcp-runtime.svg?label=)](https://crates.io/crates/arcp-runtime) | `ARCPRuntime`, SQLite eventlog, JWT/bearer auth, and the `arcp` CLI. Pull this to host agents. |\n| [`arcp-tower`](https://crates.io/crates/arcp-tower) | [![arcp-tower](https://img.shields.io/crates/v/arcp-tower.svg?label=)](https://crates.io/crates/arcp-tower) | Name-reservation stub for the forthcoming Tower middleware. |\n| [`arcp-axum`](https://crates.io/crates/arcp-axum) | [![arcp-axum](https://img.shields.io/crates/v/arcp-axum.svg?label=)](https://crates.io/crates/arcp-axum) | Name-reservation stub for the forthcoming Axum middleware. |\n| [`arcp-actix-web`](https://crates.io/crates/arcp-actix-web) | [![arcp-actix-web](https://img.shields.io/crates/v/arcp-actix-web.svg?label=)](https://crates.io/crates/arcp-actix-web) | Name-reservation stub for the forthcoming actix-web middleware. |\n| [`arcp-otel`](https://crates.io/crates/arcp-otel) | [![arcp-otel](https://img.shields.io/crates/v/arcp-otel.svg?label=)](https://crates.io/crates/arcp-otel) | Name-reservation stub for the forthcoming OpenTelemetry integration. |\n\n## Quick start\n\nConnect to a runtime, submit a job, stream its events to completion:\n\n```rust\nuse std::time::Duration;\n\nuse arcp::error::ARCPError;\nuse arcp::messages::{\n    AuthScheme, Capabilities, ClientIdentity, Credentials, MessageType, SessionOpenPayload,\n    ToolInvokePayload,\n};\nuse arcp::transport::{Transport, WebSocketTransport};\nuse arcp::Envelope;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let transport = WebSocketTransport::dial(\"wss://runtime.example.com/arcp\").await?;\n\n    let mut open = Envelope::new(MessageType::SessionOpen(SessionOpenPayload {\n        auth: Credentials { scheme: AuthScheme::Bearer, token: Some(std::env::var(\"ARCP_TOKEN\")?) },\n        client: ClientIdentity {\n            kind: \"quickstart\".into(),\n            version: env!(\"CARGO_PKG_VERSION\").into(),\n            fingerprint: None,\n            principal: None,\n        },\n        capabilities: Capabilities::default(),\n    }));\n    transport.send(open).await?;\n    let MessageType::SessionAccepted(welcome) = transport.recv().await?.ok_or(\"eof\")?.payload\n    else {\n        return Err(\"expected session.accepted\".into());\n    };\n\n    let mut invoke = Envelope::new(MessageType::ToolInvoke(ToolInvokePayload::new(\n        \"data-analyzer\",\n        serde_json::json!({ \"dataset\": \"s3://example/sales.csv\" }),\n    )));\n    invoke.session_id = Some(welcome.session_id);\n    transport.send(invoke).await?;\n\n    while let Some(env) = tokio::time::timeout(Duration::from_secs(30), transport.recv()).await?? {\n        match env.payload {\n            MessageType::JobAccepted(p) =\u003e println!(\"accepted: {}\", p.job_id),\n            MessageType::JobCompleted(p) =\u003e { println!(\"done: {:?}\", p.value); break; }\n            MessageType::JobFailed(p) =\u003e return Err(format!(\"{}: {}\", p.code, p.message).into()),\n            other =\u003e println!(\"[seq={:?}] {}\", env.event_seq, other.type_name()),\n        }\n    }\n    transport.close().await?;\n    Ok(())\n}\n```\n\nThis is the whole shape of the SDK: open a session, submit work, consume an ordered event stream, get a terminal result or error. Everything below is detail on those four moves.\n\n## Concepts\n\nARCP organizes everything around four concerns — **identity**, **durability**, **authority**, and **observability** — expressed through five core objects:\n\n- **Session** — a connection between a client and a runtime. A session carries identity (a bearer token), negotiates a feature set in a hello/welcome handshake (the SDK serializes these as `SessionOpen`/`SessionAccepted`), and is *resumable*: if the transport drops, you reconnect with a resume token and the runtime replays buffered events. Jobs outlive the session that started them. See [§6](https://github.com/agentruntimecontrolprotocol/spec/blob/main/docs/draft-arcp-1.1.md).\n- **Job** — one unit of agent work submitted into a session. A job has an identity, an optional idempotency key, a resolved agent version, and a lifecycle that ends in exactly one terminal state: `success`, `error`, `cancelled`, or `timed_out`. See [§7](https://github.com/agentruntimecontrolprotocol/spec/blob/main/docs/draft-arcp-1.1.md).\n- **Event** — the ordered, session-scoped stream a job emits: logs, thoughts, tool calls and results, status, metrics, artifact references, progress, and streamed result chunks. Events carry strictly monotonic sequence numbers so the stream survives reconnects gap-free. See [§8](https://github.com/agentruntimecontrolprotocol/spec/blob/main/docs/draft-arcp-1.1.md).\n- **Lease** — the authority a job runs under, expressed as capability grants (`fs.read`, `fs.write`, `net.fetch`, `tool.call`, `agent.delegate`, `cost.budget`, `model.use`). The runtime enforces the lease at every operation boundary; a job can never act outside it. Leases may carry a budget and an expiry, and may be subset and handed to sub-agents via delegation. See [§9](https://github.com/agentruntimecontrolprotocol/spec/blob/main/docs/draft-arcp-1.1.md).\n- **Subscription** — read-only attachment to a job started elsewhere (e.g. a dashboard watching a job a CLI submitted). A subscriber observes the live event stream but cannot cancel or mutate the job. Distinct from *resume*, which continues the original session and carries cancel authority. See [§7.6](https://github.com/agentruntimecontrolprotocol/spec/blob/main/docs/draft-arcp-1.1.md).\n\nThe SDK models each of these as first-class objects; the rest of this README shows how.\n\n## Guides\n\n### Sessions and resume\n\nOpen a session, negotiate features, and reconnect transparently after a transport drop using the resume token — jobs keep running server-side while you're gone.\n\n```rust\nuse arcp::messages::{\n    AuthScheme, Capabilities, ClientIdentity, Credentials, MessageType, SessionOpenPayload,\n};\nuse arcp::transport::{Transport, WebSocketTransport};\nuse arcp::Envelope;\n\nlet transport = WebSocketTransport::dial(\"wss://runtime.example.com/arcp\").await?;\nlet mut open = Envelope::new(MessageType::SessionOpen(SessionOpenPayload {\n    auth: Credentials { scheme: AuthScheme::Bearer, token: Some(token.clone()) },\n    client: ClientIdentity {\n        kind: \"resumable\".into(),\n        version: env!(\"CARGO_PKG_VERSION\").into(),\n        fingerprint: None,\n        principal: None,\n    },\n    capabilities: Capabilities::default(),\n}));\ntransport.send(open).await?;\nlet MessageType::SessionAccepted(welcome) = transport.recv().await?.ok_or(\"eof\")?.payload else {\n    return Err(\"expected session.accepted\".into());\n};\nlet session_id = welcome.session_id.clone();\nlet mut last_seq: u64 = 0;\n\n// ... read envelopes, tracking the highest env.event_seq in `last_seq` ...\n// ... transport drops ...\n\n// Reconnect on a fresh transport and resume from `last_seq`:\nlet transport = WebSocketTransport::dial(\"wss://runtime.example.com/arcp\").await?;\n// Re-open the session, then send `session.ack { last_processed_seq: last_seq }`\n// so the runtime trims its buffer; buffered envelopes with seq \u003e last_seq\n// will be replayed before live streaming resumes.\n```\n\n### Submitting jobs\n\nSubmit a job with an agent (optionally version-pinned as `name@version`), an input, and an optional lease request, idempotency key, and runtime limit.\n\n```rust\nuse chrono::{Duration, Utc};\n\nuse arcp::messages::{\n    CostBudget, CostBudgetAmount, LeaseRequest, MessageType, ToolInvokePayload,\n};\nuse arcp::Envelope;\n\nlet lease = LeaseRequest {\n    cost_budget: Some(CostBudget {\n        amounts: vec![CostBudgetAmount { currency: \"USD\".into(), amount: 1.00 }],\n    }),\n    expires_at: Some(Utc::now() + Duration::seconds(60)),\n    ..LeaseRequest::default()\n};\n\nlet mut invoke = Envelope::new(MessageType::ToolInvoke(ToolInvokePayload {\n    tool: \"weekly-report@2.1.0\".into(),\n    arguments: serde_json::json!({ \"week\": \"2026-W19\" }),\n    cost_budget: None,\n    lease_request: Some(lease),\n}));\ninvoke.session_id = Some(session_id.clone());\n// Idempotency keys ride on the envelope (§6.4); set `invoke.idempotency_key`\n// before sending if you need replay-safety.\ntransport.send(invoke).await?;\n\nif let Some(env) = transport.recv().await? {\n    if let MessageType::JobAccepted(accepted) = env.payload {\n        println!(\"job_id = {}\", accepted.job_id);\n        println!(\"effective lease = {:?}\", accepted.lease);\n    }\n}\n```\n\n### Consuming events\n\nIterate the ordered event stream — `log`, `thought`, `tool_call`, `tool_result`, `status`, `metric`, `artifact_ref`, `progress`, `result_chunk` — and optionally acknowledge progress so the runtime can release buffered events early.\n\n```rust\nuse arcp::messages::{MessageType, SessionAckPayload};\nuse arcp::Envelope;\n\nlet mut last_seq: u64 = 0;\nwhile let Some(env) = transport.recv().await? {\n    if let Some(seq) = env.event_seq {\n        last_seq = seq;\n    }\n    match env.payload {\n        MessageType::Log(p) =\u003e println!(\"[log {:?}] {}\", p.level, p.message),\n        MessageType::Metric(m) =\u003e println!(\"metric[{}] = {} {}\", m.name, m.value, m.unit),\n        MessageType::JobProgress(p) =\u003e println!(\"progress {}/{:?}\", p.current, p.total),\n        MessageType::JobResultChunk(c) =\u003e println!(\"chunk seq={} more={}\", c.chunk_seq, c.more),\n        MessageType::JobCompleted(_) | MessageType::JobFailed(_) | MessageType::JobCancelled(_) =\u003e break,\n        _ =\u003e {}\n    }\n\n    // Coalesced flow-control ack so the runtime can free buffered events.\n    if last_seq.is_multiple_of(32) {\n        let mut ack = Envelope::new(MessageType::SessionAck(SessionAckPayload {\n            last_processed_seq: last_seq,\n        }));\n        ack.session_id = Some(session_id.clone());\n        transport.send(ack).await?;\n    }\n}\n```\n\n### Leases and budgets\n\nRequest capabilities, a budget, and an expiry; read budget-remaining metrics as they arrive; handle the runtime's enforcement decisions.\n\n```rust\nuse chrono::{Duration, Utc};\n\nuse arcp::error::ErrorCode;\nuse arcp::messages::{\n    CostBudget, CostBudgetAmount, LeaseRequest, MessageType, ToolInvokePayload,\n};\nuse arcp::Envelope;\n\nlet lease = LeaseRequest {\n    cost_budget: Some(CostBudget {\n        amounts: vec![CostBudgetAmount { currency: \"USD\".into(), amount: 1.00 }],\n    }),\n    expires_at: Some(Utc::now() + Duration::seconds(600)),\n    ..LeaseRequest::default()\n};\n\nlet mut invoke = Envelope::new(MessageType::ToolInvoke(ToolInvokePayload {\n    tool: \"web-research\".into(),\n    arguments: serde_json::json!({ \"iterations\": 8, \"perCallUSD\": 0.30 }),\n    cost_budget: None,\n    lease_request: Some(lease),\n}));\ninvoke.session_id = Some(session_id.clone());\ntransport.send(invoke).await?;\n\nwhile let Some(env) = transport.recv().await? {\n    match env.payload {\n        MessageType::Metric(m) if m.name == \"cost.budget.remaining\" =\u003e {\n            println!(\"budget remaining: {:.2} {}\", m.value, m.unit);\n        }\n        MessageType::JobFailed(p) if p.code == ErrorCode::BudgetExhausted\n            || p.code == ErrorCode::LeaseExpired =\u003e\n        {\n            // BUDGET_EXHAUSTED and LEASE_EXPIRED are never retryable —\n            // a naive retry fails identically.\n            return Err(format!(\"{}: {}\", p.code, p.message).into());\n        }\n        MessageType::JobCompleted(_) =\u003e break,\n        _ =\u003e {}\n    }\n}\n```\n\n### Subscribing to jobs\n\nAttach read-only to a job submitted elsewhere and observe its live stream (with optional history replay) without cancel authority.\n\n```rust\nuse arcp::ids::JobId;\nuse arcp::messages::{JobSubscribePayload, JobUnsubscribePayload, MessageType};\nuse arcp::Envelope;\n\nlet job_id: JobId = /* discovered via session.list_jobs */;\n\nlet mut subscribe = Envelope::new(MessageType::JobSubscribe(JobSubscribePayload {\n    job_id: job_id.clone(),\n    from_event_seq: None,\n    history: true, // replay buffered events before live tail\n}));\nsubscribe.session_id = Some(session_id.clone());\ntransport.send(subscribe).await?;\n\nwhile let Some(env) = transport.recv().await? {\n    match env.payload {\n        MessageType::JobSubscribed(ack) =\u003e {\n            println!(\n                \"subscribed_from={} replayed={} status={}\",\n                ack.subscribed_from, ack.replayed, ack.current_status,\n            );\n        }\n        MessageType::JobCompleted(_) | MessageType::JobFailed(_) | MessageType::JobCancelled(_) =\u003e break,\n        _ =\u003e {}\n    }\n}\n\nlet mut unsubscribe = Envelope::new(MessageType::JobUnsubscribe(JobUnsubscribePayload {\n    job_id,\n}));\nunsubscribe.session_id = Some(session_id.clone());\ntransport.send(unsubscribe).await?;\n```\n\n### Error handling\n\nCatch the typed error taxonomy and respect the `retryable` flag — `LEASE_EXPIRED` and `BUDGET_EXHAUSTED` are never retryable; a naive retry fails identically.\n\n```rust\nuse arcp::error::{ARCPError, ErrorCode};\n\nmatch run_job(\u0026transport, session_id.clone()).await {\n    Ok(value) =\u003e println!(\"ok: {value}\"),\n    Err(err) =\u003e match err {\n        ARCPError::LeaseExpired { .. }\n        | ARCPError::LeaseRevoked { .. }\n        | ARCPError::BudgetExhausted { .. } =\u003e {\n            // Non-retryable: resubmit with a fresh lease / budget instead.\n            return Err(err.into());\n        }\n        e if e.code().retryable() =\u003e {\n            // Safe to retry with backoff: INTERNAL, UNAVAILABLE, ABORTED,\n            // DEADLINE_EXCEEDED, RESOURCE_EXHAUSTED.\n            backoff_and_retry(e).await?;\n        }\n        e =\u003e return Err(e.into()),\n    },\n}\n```\n\n## Feature support\n\n`Capabilities` (RFC §7) is the negotiated feature set, exchanged on\n`session.open` / `session.accepted`. The Rust SDK implements the following\ncapability fields:\n\n| `Capabilities` field | Status |\n|---|---|\n| `streaming` | Supported |\n| `durable_jobs` | Supported |\n| `checkpoints` | Not implemented (deferred) |\n| `binary_streams` | Not implemented (deferred) |\n| `agent_handoff` | Not implemented (deferred) |\n| `model_use` | Supported |\n| `provisioned_credentials` | Supported |\n| `artifacts` | Supported |\n| `subscriptions` | Supported |\n| `scheduled_jobs` | Not implemented (deferred) |\n| `interrupt` | Not implemented (deferred) |\n| `anonymous` | Supported |\n| `heartbeat_recovery` | Advertised; recovery modes not implemented |\n| `binary_encoding` | Advertised; payloads remain JSON |\n| `extensions` | Supported |\n| `artifact_retention` | Supported |\n| `agents` | Supported (v1.0 flat list and v1.1 rich form) |\n\nThe SDK also implements the ARCP v1.1 protocol-level surfaces that are not\nthemselves capability flags: `session.ack` flow control (§6.5),\n`session.ping`/`pong` heartbeats (§6.4), `session.list_jobs` (§6.6),\n`job.subscribe`/`job.unsubscribe` (§7.6), `job.progress`,\n`job.result_chunk` (§8.4), and `agent@version` resolution (§7.5).\n\n## Transport\n\nARCP is transport-agnostic. This SDK ships a WebSocket transport (default), a stdio transport for in-process child runtimes, and an in-memory transport for tests. WebSocket is the default for networked runtimes; stdio is used for in-process child runtimes. Select one by constructing the corresponding type (`WebSocketTransport::dial(url)`, `StdioTransport::process()`, or `arcp::transport::paired()` for the in-memory pair) and passing it to `ARCPClient::new(transport)`; WebSocket and stdio sit behind the `transport-ws` and `transport-stdio` Cargo features (both on by default), and the in-memory transport is always compiled in.\n\n## API reference\n\nFull API reference — every type, method, and event payload — is in [`docs/`](docs/) and at \u003chttps://docs.rs/arcp\u003e.\n\n## Versioning and compatibility\n\nThis SDK speaks **ARCP v1.1 (draft)**. The SDK follows semantic versioning independently of the protocol; the protocol version it negotiates is shown above and in the `SessionOpen` envelope (which the spec names `session.hello`). A runtime advertising a different ARCP MAJOR is not guaranteed compatible. Feature mismatches degrade gracefully: the effective feature set is the intersection of what the client and runtime advertise, and the SDK will not use a feature outside it.\n\n## Contributing\n\nSee [`CONTRIBUTING.md`](CONTRIBUTING.md). Protocol questions and proposed changes belong in the [spec repository](https://github.com/agentruntimecontrolprotocol/spec); SDK bugs and feature requests belong here.\n\n## License\n\nLicensed under either of [Apache License, Version 2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT) at your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentruntimecontrolprotocol%2Frust-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagentruntimecontrolprotocol%2Frust-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagentruntimecontrolprotocol%2Frust-sdk/lists"}