use crate::provider::{Message, ToolCall};
pub(crate) const TOOL_CALL_ID: &str = "call_cu_resume_1";
pub(crate) fn completed_computer_turn_history() -> Vec<Message> {
vec![
Message::user("Check the preview page for layout drift.".to_string()),
Message::assistant_with_tools(
String::new(),
vec![ToolCall::function(
TOOL_CALL_ID.to_string(),
"computer_use".to_string(),
"{\"task\":\"open the preview page and confirm the header renders\"}".to_string(),
)],
),
Message::tool_response(
TOOL_CALL_ID.to_string(),
"Computer turn completed: 2 actions (click, type) on browser target; screenshot sent to the model."
.to_string(),
),
Message::user("Now summarize what you saw.".to_string()),
]
}
pub(crate) fn interrupted_computer_turn_history() -> Vec<Message> {
vec![
Message::user("Check the preview page for layout drift.".to_string()),
Message::assistant_with_tools(
String::new(),
vec![ToolCall::function(
TOOL_CALL_ID.to_string(),
"computer_use".to_string(),
"{\"task\":\"open the preview page and confirm the header renders\"}".to_string(),
)],
),
]
}
#[must_use]
pub(crate) fn leaked_native_artifacts(serialized: &str) -> Vec<&'static str> {
const LEAK_MARKERS: &[&str] = &[
"computer_call\"",
"\"computer_call",
"computer_toolset_",
"\"toolset_name\":\"computer\"",
"data:image/",
"iVBORw0KGgo",
];
LEAK_MARKERS
.iter()
.copied()
.filter(|marker| serialized.contains(marker))
.collect()
}
#[cfg(test)]
mod tests;