use serde::{Deserialize, Serialize};
use super::super::Kind;
const ROW_DEPTH: usize = 127;
pub fn depth(kind: Kind, call: Option<u64>) -> usize {
let around = match kind {
Kind::ToolCall => 5,
Kind::Extra if call.is_some() => 5,
Kind::Attachment => 4,
_ => 3,
};
ROW_DEPTH - around
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum Shape {
Any,
Object,
Block,
}
impl Shape {
pub fn of(kind: Kind) -> Option<Self> {
match kind {
Kind::ToolCall => Some(Self::Object),
Kind::Attachment => Some(Self::Block),
Kind::Reasoning | Kind::Extra => Some(Self::Any),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
pub enum Top {
Null,
Falsy,
#[default]
Truthy,
}