MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / share_session

Method share_session

crates/opencode-tui/src/api.rs:617–631  ·  view source on GitHub ↗
(&self, session_id: &str)

Source from the content-addressed store, hash-verified

615 }
616
617 pub fn share_session(&self, session_id: &str) -> anyhow::Result<ShareResponse> {
618 let url = format!("{}/session/{}/share", self.base_url, session_id);
619 let response = self.client.post(&url).send()?;
620 if !response.status().is_success() {
621 let status = response.status();
622 let text = response.text().unwrap_or_default();
623 anyhow::bail!(
624 "Failed to share session `{}`: {} - {}",
625 session_id,
626 status,
627 text
628 );
629 }
630 Ok(response.json::<ShareResponse>()?)
631 }
632
633 pub fn unshare_session(&self, session_id: &str) -> anyhow::Result<bool> {
634 let url = format!("{}/session/{}/share", self.base_url, session_id);

Callers 1

handle_share_sessionMethod · 0.45

Calls 3

sendMethod · 0.45
statusMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected