pub(crate) mod attempt;
pub(crate) mod mutation;
pub(crate) mod push;
pub(crate) mod tool_buffer;
pub(crate) mod tool_lines;
#[cfg(test)]
#[allow(unused_imports)]
pub(crate) use super::Transcript;
use super::chapters;
#[allow(dead_code)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(crate) enum BlockKind {
User,
Assistant,
System,
Error,
Tool,
Table,
Thinking,
}
#[allow(dead_code)]
#[derive(Debug, Clone)]
pub(crate) struct Block {
pub(crate) kind: BlockKind,
pub(crate) text: String,
pub(crate) chapter: u32,
pub(crate) group: Option<ToolGroupView>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct ToolGroupView {
pub(crate) expanded: bool,
pub(crate) detail: Vec<String>,
pub(crate) open_header: String,
}
impl Block {
pub(crate) fn tool_group(summary: String, detail: Vec<String>, open_header: String) -> Self {
Self {
kind: BlockKind::Tool,
text: summary,
chapter: chapters::PRE_CHAPTER,
group: Some(ToolGroupView {
expanded: false,
detail,
open_header,
}),
}
}
pub(crate) fn is_collapsible(&self) -> bool {
self.group.is_some()
}
}
#[derive(Debug, Clone)]
pub(crate) struct PendingToolCall {
pub(crate) name: String,
pub(crate) arguments: serde_json::Value,
pub(crate) effect: Option<saya_agent::ToolEffect>,
pub(crate) summary: Option<String>,
pub(crate) live_blocks: usize,
pub(crate) open: bool,
}