pub struct HostSession {
pub bot_name: String,
pub session_id: String,
pub agent_id: Option<String>,
pub routine_url: Option<String>,
pub routine_bearer: Option<String>,
pub invite: Option<String>,
pub routine_file: Option<PathBuf>,
pub tier: BackendKind,
}Expand description
One bot session the host says lives on this machine.
routine_url and routine_bearer are optional and stay in memory.
They are not part of a session record on disk.
Fields§
§bot_name: StringDisplay name the host already shows (Alice, Привет мир).
session_id: StringSession id the host already assigned. This is the mail session, not the Grok Bot agent id.
agent_id: Option<String>Grok Bot agent id for [createAgentAutomation]. Absent means this
session does not get a webhook routine.
routine_url: Option<String>Routine URL for this session, if the host has one. Not a file.
routine_bearer: Option<String>Bearer for that routine POST. Memory only.
invite: Option<String>The operator’s one-time invite code, needed only until this session’s identity is enrolled. Read by the client, never given to the agent.
routine_file: Option<PathBuf>Path of an owner-placed file (mode 0600) with the routine’s webhook {"url","key"}. The
client reads it itself at open; the values never go to the agent or the log.
tier: BackendKindserver tier (default) or matrix.
Implementations§
Source§impl HostSession
impl HostSession
Sourcepub fn new(bot_name: impl Into<String>, session_id: impl Into<String>) -> Self
pub fn new(bot_name: impl Into<String>, session_id: impl Into<String>) -> Self
A session with no routine and no stored device bearer.
Sourcepub fn with_routine_file(self, path: impl Into<PathBuf>) -> Self
pub fn with_routine_file(self, path: impl Into<PathBuf>) -> Self
A routine webhook the owner put in a file (see Self::routine_file).
Sourcepub fn with_invite(self, invite: impl Into<String>) -> Self
pub fn with_invite(self, invite: impl Into<String>) -> Self
The operator’s invite for this session’s first login.
Sourcepub fn with_tier(self, tier: BackendKind) -> Self
pub fn with_tier(self, tier: BackendKind) -> Self
Which tier this session logs in on.