pub struct TimelineRoom { /* private fields */ }Implementations§
Source§impl TimelineRoom
impl TimelineRoom
Sourcepub fn timeline_id(&self) -> String
pub fn timeline_id(&self) -> String
Client-facing timeline id within the current principal.
pub fn name(&self) -> String
pub fn agents(&self) -> HashMap<String, Agent>
pub fn polls(&self) -> HashMap<String, Poll>
pub fn runs(&self) -> HashMap<String, Run>
pub fn nodes(&self) -> HashMap<String, GraphNode>
pub fn edges(&self) -> HashMap<String, GraphEdge>
Sourcepub fn file_access_codes(&self) -> HashMap<String, FileAccessCodeMeta>
pub fn file_access_codes(&self) -> HashMap<String, FileAccessCodeMeta>
Short-lived Drive codes for file nodes (hydrate + upload + remint).
pub fn trust_edges(&self) -> HashMap<String, TrustEdge>
pub fn status(&self) -> String
Sourcepub fn repository(&self) -> Option<u64>
pub fn repository(&self) -> Option<u64>
The owner’s Termite repository personas start from, by id; None when it has none.
Sourcepub fn group(&self) -> Option<Group>
pub fn group(&self) -> Option<Group>
The group that owns the timeline, whose repositories it takes; None for a person’s.
Sourcepub async fn set_repository(
&self,
repository: Option<&Repository>,
) -> Result<()>
pub async fn set_repository( &self, repository: Option<&Repository>, ) -> Result<()>
Attach one of the owner’s repositories, or None to detach. Personas’ chat forks of the old one are deleted.
Sourcepub fn watch_repository(
&self,
listener: impl Fn(Option<u64>) + Send + Sync + 'static,
) -> Box<dyn FnOnce() + Send + Sync>
pub fn watch_repository( &self, listener: impl Fn(Option<u64>) + Send + Sync + 'static, ) -> Box<dyn FnOnce() + Send + Sync>
Hear about every repository change, from anyone in the room. Returns a function that stops listening.
Sourcepub async fn run_trust(&self, run_id: &str) -> Result<Vec<TrustEdge>>
pub async fn run_trust(&self, run_id: &str) -> Result<Vec<TrustEdge>>
The trust graph a run ended with: the timeline’s graph as the run started,
plus everything it changed. trust_edges is the graph every run starts from.
pub fn hydrate(&self, state: &Value)
Sourcepub fn handle_event(
&self,
packet: &Value,
) -> Option<BoxFuture<'static, Result<()>>>
pub fn handle_event( &self, packet: &Value, ) -> Option<BoxFuture<'static, Result<()>>>
Applies a domain frame. Returns the work still to do when a file node needs a fresh Drive code; run it to finish applying the frame.
pub fn upsert_graph_node(&self, node: GraphNode) -> GraphNode
pub fn remove_graph_node(&self, id: &str)
pub fn upsert_graph_edge(&self, edge: GraphEdge) -> GraphEdge
pub fn remove_graph_edge(&self, id: &str)
Sourcepub async fn upload_file_node(
&self,
file: Vec<u8>,
opts: UploadFileOptions,
) -> Result<UploadedFile>
pub async fn upload_file_node( &self, file: Vec<u8>, opts: UploadFileOptions, ) -> Result<UploadedFile>
Upload bytes to the host drive and create/update a durable file node.
pub async fn remint_file_access_code( &self, node_id: &str, ) -> Result<FileAccessCodeMeta>
Sourcepub async fn file_for_node(&self, node_id: &str) -> Result<File>
pub async fn file_for_node(&self, node_id: &str) -> Result<File>
Build a drive::File handle for a graph file node (remints if needed).
Sourcepub async fn open_graph_file(&self, node_id: &str) -> Result<FileAccessCodeMeta>
pub async fn open_graph_file(&self, node_id: &str) -> Result<FileAccessCodeMeta>
Remint if needed and return the short-lived Drive access code for a file node.
pub fn upsert_agent(&self, identity: Identity) -> Agent
pub fn remove_agent(&self, id: &str)
pub fn upsert_poll(&self, goal: &str, query: Vec<AntFormatOrFormat>) -> Poll
pub fn remove_poll(&self, id: &str)
Sourcepub async fn start_run(
&self,
goal: &str,
query: &[AntFormatOrFormat],
) -> Result<String>
pub async fn start_run( &self, goal: &str, query: &[AntFormatOrFormat], ) -> Result<String>
Create the poll and queue its run in one request. Resolves the run id;
the run itself arrives through the room’s upsert-run delta.
pub async fn abort_run(&self, run_id: &str) -> Result<()>
Sourcepub async fn get_chat(
&self,
hooks: Option<Arc<dyn RoomHooks>>,
) -> Result<TimelineChat>
pub async fn get_chat( &self, hooks: Option<Arc<dyn RoomHooks>>, ) -> Result<TimelineChat>
Lazily mint/open the architect Parrot ChatRoom.
Sourcepub async fn open_chat(
&self,
agent_id: &str,
hooks: Option<Arc<dyn RoomHooks>>,
) -> Result<TimelineChat>
pub async fn open_chat( &self, agent_id: &str, hooks: Option<Arc<dyn RoomHooks>>, ) -> Result<TimelineChat>
Ensure a Parrot chat (architect when agent_id is empty) and connect live.
Timeline members join by reference (non-guest); access-code guests use the
short-lived code so leave/reap semantics stay correct.
Sourcepub async fn connect(
authorization: &CredentialsOrApiKey,
target_id: &str,
opts: ConnectOptions,
) -> Result<(TimelineRoom, Presence)>
pub async fn connect( authorization: &CredentialsOrApiKey, target_id: &str, opts: ConnectOptions, ) -> Result<(TimelineRoom, Presence)>
Connect to an owned timeline. Principal is resolved server-side from auth (+ optional Group).
pub async fn join( authorization: &CredentialsOrApiKey, access_code: &str, hooks: Option<Arc<dyn Hooks>>, ) -> Result<(TimelineRoom, Presence)>
Methods from Deref<Target = Room>§
pub fn endpoint(&self) -> &str
pub fn ws(&self) -> RoomSocket
pub fn id(&self) -> &str
pub fn get_presences(&self) -> Vec<Presence>
The caller’s Credentials or ApiKey from the live authorization pack.