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

Function share_session

crates/opencode-server/src/routes.rs:507–519  ·  view source on GitHub ↗
(
    State(state): State<Arc<ServerState>>,
    Path(id): Path<String>,
)

Source from the content-addressed store, hash-verified

505}
506
507async fn share_session(
508 State(state): State<Arc<ServerState>>,
509 Path(id): Path<String>,
510) -> Result<Json<SessionShareInfo>> {
511 let mut sessions = state.sessions.lock().await;
512 let share_url = format!("https://share.opencode.ai/{}", id);
513 sessions
514 .share(&id, share_url.clone())
515 .ok_or_else(|| ApiError::SessionNotFound(id.clone()))?;
516 drop(sessions);
517 persist_sessions_if_enabled(&state).await;
518 Ok(Json(SessionShareInfo { url: share_url }))
519}
520
521async fn unshare_session(
522 State(state): State<Arc<ServerState>>,

Callers

nothing calls this directly

Calls 3

shareMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected