operator id

This commit is contained in:
lda
2026-07-15 23:24:31 +07:00 Verified
parent 27fc515fe7
commit 77824523f9
6 changed files with 505 additions and 172 deletions
+13 -1
View File
@@ -76,7 +76,10 @@ pub enum TerminalAgentHandshake {
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum TerminalOperatorHandshake {
Attach { attachment_token: String },
Attach {
attachment_token: String,
operator_id: String,
},
}
impl TryFrom<String> for RequestId {
@@ -339,6 +342,15 @@ mod tests {
let snapshot =
serde_json::to_string(&TerminalControl::Snapshot).expect("serialize snapshot");
assert_eq!(snapshot, r#"{"type":"snapshot"}"#);
let operator = TerminalOperatorHandshake::Attach {
attachment_token: "attach-secret".into(),
operator_id: "browser-tab".into(),
};
let json = serde_json::to_string(&operator).expect("serialize operator handshake");
assert_eq!(
json,
r#"{"type":"attach","attachment_token":"attach-secret","operator_id":"browser-tab"}"#
);
let inventory = ClientMessage::TerminalSessions {
sessions: vec![AgentTerminalSession {