Skip to main content

opencode_codes/protocol_generated/
samples.rs

1// AUTO-GENERATED by scripts/codegen_opencode.py — DO NOT EDIT BY HAND.
2
3use serde_json::{json, Value};
4
5/// Minimal valid JSON samples for the primary types of the six hand-wrapped
6/// endpoints, keyed by generated Rust type name. For round-trip tests.
7pub fn endpoint_samples() -> Vec<(&'static str, Value)> {
8    vec![
9        ("SessionCreateParams", json!({})),
10        ("PromptAsyncParams", json!({"parts": []})),
11        ("PermissionReplyParams", json!({"response": "once"})),
12        (
13            "Session",
14            json!({"id": "x", "slug": "x", "projectID": "x", "directory": "x", "title": "x", "version": "x", "time": {"created": 0, "updated": 0}}),
15        ),
16        (
17            "MessageWithParts",
18            json!({"info": {"id": "x", "sessionID": "x", "role": "user", "time": {"created": 0.0}, "agent": "x", "model": {"providerID": "x", "modelID": "x"}}, "parts": []}),
19        ),
20        (
21            "Event",
22            json!({"id": "x", "type": "models-dev.refreshed", "properties": {}}),
23        ),
24    ]
25}