Skip to main content

opencode_sdk/
lib.rs

1//! Rust SDK for OpenCode (HTTP-first hybrid with SSE streaming).
2//!
3//! This crate provides a native Rust interface to OpenCode's HTTP REST API
4//! and SSE streaming capabilities.
5
6#![deny(rust_2018_idioms)]
7
8// Unix-only support
9#[cfg(not(unix))]
10compile_error!(
11    "opencode_rs only supports Unix-like platforms (Linux/macOS). Windows is not supported."
12);
13
14pub mod error;
15pub mod types;
16
17#[cfg(feature = "http")]
18pub mod http;
19
20#[cfg(feature = "sse")]
21pub mod sse;
22
23#[cfg(feature = "server")]
24pub mod server;
25
26#[cfg(all(feature = "server", feature = "http"))]
27pub mod runtime;
28
29#[cfg(feature = "cli")]
30pub mod cli;
31
32// Public ergonomic API
33pub mod client;
34
35// Re-exports
36pub use crate::client::{Client, ClientBuilder};
37pub use crate::error::{OpencodeError, Result};
38
39// Version info
40pub const VERSION: &str = env!("CARGO_PKG_VERSION");