opencode-codes 1.18.5

Typed Rust SDK for the opencode agent server: serde models of its OpenAPI 3.1 HTTP/SSE protocol, plus an async (Tokio) client and a managed local-server launcher for driving opencode sessions, prompts, and permission flows.
Documentation
// AUTO-GENERATED by scripts/codegen_opencode.py — DO NOT EDIT BY HAND.

use serde_json::{json, Value};

/// Minimal valid JSON samples for the primary types of the six hand-wrapped
/// endpoints, keyed by generated Rust type name. For round-trip tests.
pub fn endpoint_samples() -> Vec<(&'static str, Value)> {
    vec![
        ("SessionCreateParams", json!({})),
        ("PromptAsyncParams", json!({"parts": []})),
        ("PermissionReplyParams", json!({"response": "once"})),
        (
            "Session",
            json!({"id": "x", "slug": "x", "projectID": "x", "directory": "x", "title": "x", "version": "x", "time": {"created": 0, "updated": 0}}),
        ),
        (
            "MessageWithParts",
            json!({"info": {"id": "x", "sessionID": "x", "role": "user", "time": {"created": 0.0}, "agent": "x", "model": {"providerID": "x", "modelID": "x"}}, "parts": []}),
        ),
        (
            "Event",
            json!({"id": "x", "type": "models-dev.refreshed", "properties": {}}),
        ),
    ]
}