Publish harness and TUI open-source
initial sync from the monorepo
This commit is contained in:
commit
c68e39f604
2734 changed files with 1437016 additions and 0 deletions
22
crates/common/xai-tool-protocol/src/hook.rs
Normal file
22
crates/common/xai-tool-protocol/src/hook.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
//! Hook events delivered from the harness to tools.
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Internally-tagged hook payload. New variants land alongside `Custom`,
|
||||
/// which keeps unknown future kinds round-trippable.
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum HookEvent {
|
||||
/// Cancel an in-flight call. The owning `tool_call_id` travels in the
|
||||
/// enclosing `hook` frame.
|
||||
Cancel,
|
||||
Pause,
|
||||
Resume,
|
||||
/// Broadcast to every tool server bound to the session.
|
||||
SessionEnded,
|
||||
/// Forward-compatible escape hatch.
|
||||
Custom {
|
||||
kind: String,
|
||||
payload: serde_json::Value,
|
||||
},
|
||||
}
|
||||
Loading…
Reference in a new issue