x0x 0.31.1

Agent-to-agent gossip network for AI systems — no winners, no losers, just cooperation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! `x0x auth` — session-token management (#127 / WS1.6).

use anyhow::Result;

use crate::cli::DaemonClient;

/// `x0x auth session` — POST /auth/session.
///
/// Exchanges the durable API bearer token for a short-lived browser session
/// token. The session token is the only kind accepted via `?token=` query
/// strings on WS/SSE endpoints; the durable token is never valid in a URL.
pub async fn session(client: &DaemonClient) -> Result<()> {
    let r = client.post_empty("/auth/session").await?;
    println!("{}", serde_json::to_string_pretty(&r)?);
    Ok(())
}