pub enum PluginRequest {
Init {
cwd: String,
session_id: String,
project_name: Option<String>,
},
Hook {
name: String,
data: Value,
},
ToolCall {
tool_call_id: String,
name: String,
arguments: Value,
cwd: Option<String>,
session_id: Option<String>,
project_name: Option<String>,
},
CancelToolCall {
tool_call_id: String,
},
SessionStart {
cwd: String,
session_id: String,
project_name: Option<String>,
},
Idle,
ServerResponse {
request_id: String,
response: Response,
},
}Variants§
Init
Initialize the plugin with session context.
Hook
Call a hook.
ToolCall
Execute a tool call.
Fields
CancelToolCall
Cancel an in-flight tool call. The plugin should abort the tool by
its tool_call_id (e.g. kill the bash subprocess) and return a
normal ToolResult indicating cancellation. If the tool has already
completed, this is a no-op.
SessionStart
Notify session start.
Idle
Notify the plugin it has been idle. Plugin may exit in response.
ServerResponse
Server response (server -> plugin tunnel). Response to a PluginMessage::ServerRequest.
Trait Implementations§
Source§impl Clone for PluginRequest
impl Clone for PluginRequest
Source§fn clone(&self) -> PluginRequest
fn clone(&self) -> PluginRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PluginRequest
impl Debug for PluginRequest
Source§impl<'de> Deserialize<'de> for PluginRequest
impl<'de> Deserialize<'de> for PluginRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PluginRequest
impl RefUnwindSafe for PluginRequest
impl Send for PluginRequest
impl Sync for PluginRequest
impl Unpin for PluginRequest
impl UnsafeUnpin for PluginRequest
impl UnwindSafe for PluginRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more