opencode_rs 0.10.0

Rust SDK for OpenCode (HTTP-first hybrid with SSE streaming)
Documentation
use crate::error::Result;
use crate::http::HttpClient;
use reqwest::Method;

#[derive(Clone)]
pub struct WorkspacesApi {
    http: HttpClient,
}

impl WorkspacesApi {
    pub fn new(http: HttpClient) -> Self {
        Self { http }
    }
    pub async fn list(&self) -> Result<Vec<serde_json::Value>> {
        self.http
            .request_json(Method::GET, "/experimental/workspace", None)
            .await
    }
    pub async fn current(&self) -> Result<serde_json::Value> {
        self.http
            .request_json(Method::GET, "/experimental/workspace/current", None)
            .await
    }
}