use bitflags::bitflags;
use serde::{Deserialize, Serialize};
use crate::Json;
use crate::api::event::PendingMarkSpec;
bitflags! {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct ToolAttributes: u32 {
const REMOTE = 0b01;
}
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ToolExecutionInterceptOutcome {
pub result: Json,
#[serde(default)]
pub pending_marks: Vec<PendingMarkSpec>,
}
impl ToolExecutionInterceptOutcome {
pub fn new(result: Json) -> Self {
Self {
result,
pending_marks: Vec::new(),
}
}
#[must_use]
pub fn with_pending_mark(mut self, mark: PendingMarkSpec) -> Self {
self.pending_marks.push(mark);
self
}
}
impl From<Json> for ToolExecutionInterceptOutcome {
fn from(result: Json) -> Self {
Self::new(result)
}
}