codex-mobile-contracts 0.2.0

Shared domain contracts for codex-mobile client and bridge.
Documentation
use codex_mobile_contracts::RuntimeStatus;

#[test]
fn runtime_status_deserialization_accepts_missing_default_handshake_fields() {
    let json = r#"
        {
          "runtimeId": "primary",
          "status": "running",
          "appServerHandshake": {
            "state": "ready",
            "experimentalApiEnabled": true,
            "detail": "握手完成,initialized 已发送",
            "updatedAtMs": 1234
          }
        }
    "#;

    let status: RuntimeStatus = serde_json::from_str(json).expect("runtime status 应可解析");

    assert_eq!(status.runtime_id, "primary");
    assert_eq!(status.status, "running");
    assert_eq!(status.app_server_handshake.state, "ready");
    assert_eq!(status.app_server_handshake.protocol, "jsonrpc2.0");
    assert_eq!(status.app_server_handshake.transport, "stdio");
    assert_eq!(status.app_server_handshake.notification_mode, "full");
    assert!(status.updated_at_ms > 0);
}