pub enum WsInbound {
Show 31 variants
SendMessage {
content: String,
},
ToolConfirm {
action: String,
reason: Option<String>,
},
AskResponse {
answers: HashMap<String, String>,
},
Cancel,
Sync,
KeyExchange {
client_pk: String,
},
Ping,
ListSessions,
SwitchSession {
session_id: String,
},
NewSession,
SelectModel {
index: usize,
},
SelectTheme {
index: usize,
},
RequestConfig {
tab: String,
},
ConfigEditSubmit {
value: String,
},
ConfigToggle {
index: usize,
},
StartArchive,
ArchiveWithDefault,
ArchiveWithCustom {
name: String,
},
ClearSession,
StartArchiveList,
RestoreArchive {
index: usize,
},
DeleteArchive {
index: usize,
},
DeleteSession {
index: usize,
},
AgentPermConfirm {
approve: bool,
},
PlanApproval {
approve: bool,
content: Option<String>,
},
ToggleAutoApprove,
FileList {
path: String,
},
FileRead {
path: String,
},
FileWrite {
path: String,
content: String,
},
TerminalExec {
command: String,
},
TerminalInterrupt,
}Expand description
客户端 → 服务端 消息
Variants§
SendMessage
发送聊天消息
ToolConfirm
工具确认(allow / allow_always / reject / reject_with_reason)
AskResponse
Ask 工具回答
Cancel
取消当前流式请求
Sync
请求全量状态同步
KeyExchange
ECDH 密钥交换(客户端发送公钥)
Ping
心跳 ping
ListSessions
请求会话列表
SwitchSession
切换到指定会话
NewSession
新建会话
SelectModel
选择模型(按索引)
SelectTheme
选择主题(按索引)
RequestConfig
请求配置数据
ConfigEditSubmit
配置编辑提交
ConfigToggle
配置项切换(toggle enabled/disabled)
StartArchive
开始归档确认
ArchiveWithDefault
使用默认名称归档
ArchiveWithCustom
使用自定义名称归档
ClearSession
不归档,直接清空会话
StartArchiveList
请求归档列表
RestoreArchive
恢复归档(按索引)
DeleteArchive
删除归档(按索引)
DeleteSession
删除会话(按索引,在会话列表中)
AgentPermConfirm
Agent 权限确认
PlanApproval
Plan 审批
ToggleAutoApprove
切换自动审批
FileList
列出目录内容
FileRead
读取文件内容
FileWrite
写入文件内容
TerminalExec
执行终端命令
TerminalInterrupt
终端中断 (Ctrl-C)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WsInbound
impl<'de> Deserialize<'de> for WsInbound
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 WsInbound
impl RefUnwindSafe for WsInbound
impl Send for WsInbound
impl Sync for WsInbound
impl Unpin for WsInbound
impl UnsafeUnpin for WsInbound
impl UnwindSafe for WsInbound
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.