openagents_sdk::terminal_chats
Saved terminal chats use the same account history and continuation IDs.
| Item | What it does |
|---|---|
Message struct | One message of a terminal chat. |
Role enum | Who wrote a terminal chat message. |
Saved struct | The saved chat, and whether this save changed it. |
Snapshot struct | A terminal chat to save: its computer, title, and messages. |
save fn | Publish an already screened transcript. |
Message
pub struct Message {
pub role: Role,
pub text: String,
pub step: Option<Value>,
}
One message of a terminal chat.
Role
pub enum Role {
User,
Assistant,
Thinking,
Tool,
}
Who wrote a terminal chat message.
Saved
pub struct Saved {
pub chat: ChatRef,
pub changed: bool,
}
The saved chat, and whether this save changed it.
Snapshot
pub struct Snapshot {
pub computer: String,
pub title: String,
pub messages: Vec<Message>,
pub repository: Option<String>,
pub active_unix: Option<u64>,
}
A terminal chat to save: its computer, title, and messages.
save
pub async fn save(
client: &Client,
session: &Session,
local_id: &str,
snapshot: &Snapshot,
cancel: &CancellationToken,
) -> Result<Saved, Error>
Publish an already screened transcript. The returned ID is also its Loro room ID; callers must not derive a separate ID from the terminal's local filename.