use std::collections::BTreeMap;
use serde::{Deserialize, Serialize};
use super::ContractModel;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
#[non_exhaustive]
pub struct SeedResult {
pub raw_turns: i32,
pub raw_turns_deduped: i64,
pub raw_turns_inserted: i64,
pub sessions: i32,
}
impl ContractModel for SeedResult {
const SCHEMA: &'static str = "SeedResult";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
pub struct SeedDemoRequest {
pub overwrite: bool,
}
impl ContractModel for SeedDemoRequest {
const SCHEMA: &'static str = "seedDemoRequest";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
#[non_exhaustive]
pub struct DeriveRunResponse {
#[serde(deserialize_with = "super::null_default")]
pub orgs: BTreeMap<String, RederiveReport>,
}
impl ContractModel for DeriveRunResponse {
const SCHEMA: &'static str = "deriveRunResponse";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
#[non_exhaustive]
pub struct RederiveReport {
pub attached_verdicts: i32,
#[serde(deserialize_with = "super::null_default")]
pub call_kinds: BTreeMap<String, i32>,
pub judged_actions: i32,
#[serde(deserialize_with = "super::null_default")]
pub node_kinds: BTreeMap<String, i32>,
pub nodes: i32,
#[serde(deserialize_with = "super::null_default")]
pub parse_failures: Vec<String>,
pub parsed_turns: i32,
pub plans_attached: i32,
pub raw_only_turns: i32,
pub raw_turns: i32,
#[serde(deserialize_with = "super::null_default")]
pub reconcile: ReconcileStats,
#[serde(deserialize_with = "super::null_default")]
pub unattached_actions: Vec<String>,
pub web_summary_attached: i32,
}
impl ContractModel for RederiveReport {
const SCHEMA: &'static str = "RederiveReport";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
#[non_exhaustive]
pub struct ReconcileStats {
pub codex_interacted_rows: i32,
pub codex_threads_anchored: i32,
pub codex_threads_unanchored: i32,
pub conversation_joined: i32,
pub conversation_total: i32,
pub forked_chains: i32,
pub main_chains_joined: i32,
pub subagent_forks: i32,
pub transcript_files: i32,
}
impl ContractModel for ReconcileStats {
const SCHEMA: &'static str = "ReconcileStats";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
#[serde(default)]
#[non_exhaustive]
pub struct StatsResponse {
pub completed_count: i32,
pub input_tokens: i64,
pub output_tokens: i64,
pub session_count: i32,
pub tool_calls: i32,
pub total_cost: f64,
pub total_duration_ms: i64,
pub turn_count: i32,
}
impl ContractModel for StatsResponse {
const SCHEMA: &'static str = "StatsResponse";
}