opencode_rs/
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(feature = "cli")]
27pub mod cli;
28
29// Public ergonomic API
30pub mod client;
31
32// Re-exports
33pub use crate::client::{Client, ClientBuilder};
34pub use crate::error::{OpencodeError, Result};
35
36// Version info
37pub const VERSION: &str = env!("CARGO_PKG_VERSION");