Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Rename `livekit_server` to `livekit_api` (#24984)
Michael Sloanc7df2d787bfc
diff --git a/Cargo.lock b/Cargo.lockindex ea38dc54abe..e7cb404acc5 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -2792,9 +2792,9 @@ dependencies = ["jsonwebtoken","language","language_model",+ "livekit_api","livekit_client","livekit_client_macos",- "livekit_server","log","lsp","menu",@@ -7404,6 +7404,21 @@ dependencies = ["futures 0.3.31",]+[[package]]+name = "livekit_api"+version = "0.1.0"+dependencies = [+ "anyhow",+ "async-trait",+ "jsonwebtoken",+ "log",+ "prost 0.9.0",+ "prost-build 0.9.0",+ "prost-types 0.9.0",+ "reqwest 0.12.8",+ "serde",+]+[[package]]name = "livekit_client"version = "0.1.0"@@ -7420,7 +7435,7 @@ dependencies = ["http_client","image","livekit",- "livekit_server",+ "livekit_api","log","media","nanoid",@@ -7445,7 +7460,7 @@ dependencies = ["core-foundation 0.9.4","futures 0.3.31","gpui",- "livekit_server",+ "livekit_api","log","media","nanoid",@@ -7457,21 +7472,6 @@ dependencies = ["simplelog",]-[[package]]-name = "livekit_server"-version = "0.1.0"-dependencies = [- "anyhow",- "async-trait",- "jsonwebtoken",- "log",- "prost 0.9.0",- "prost-build 0.9.0",- "prost-types 0.9.0",- "reqwest 0.12.8",- "serde",-]-[[package]]name = "lmdb-master-sys"version = "0.2.4"diff --git a/Cargo.toml b/Cargo.tomlindex d2cff4d48d6..bb60f44394c 100644--- a/Cargo.toml+++ b/Cargo.toml@@ -74,9 +74,9 @@ members = ["crates/language_selector","crates/language_tools","crates/languages",+ "crates/livekit_api","crates/livekit_client","crates/livekit_client_macos",- "crates/livekit_server","crates/lmstudio","crates/lsp","crates/markdown",@@ -274,9 +274,9 @@ language_models = { path = "crates/language_models" }language_selector = { path = "crates/language_selector" }language_tools = { path = "crates/language_tools" }languages = { path = "crates/languages" }+livekit_api = { path = "crates/livekit_api" }livekit_client = { path = "crates/livekit_client" }livekit_client_macos = { path = "crates/livekit_client_macos" }-livekit_server = { path = "crates/livekit_server" }lmstudio = { path = "crates/lmstudio" }lsp = { path = "crates/lsp" }markdown = { path = "crates/markdown" }diff --git a/crates/collab/Cargo.toml b/crates/collab/Cargo.tomlindex 2dd571677ee..1af098416b7 100644--- a/crates/collab/Cargo.toml+++ b/crates/collab/Cargo.toml@@ -40,7 +40,7 @@ google_ai.workspace = truehex.workspace = truehttp_client.workspace = truejsonwebtoken.workspace = true-livekit_server.workspace = true+livekit_api.workspace = truelog.workspace = truenanoid.workspace = trueopen_ai.workspace = truediff --git a/crates/collab/src/lib.rs b/crates/collab/src/lib.rsindex a0f5fa371cf..334d015d4bb 100644--- a/crates/collab/src/lib.rs+++ b/crates/collab/src/lib.rs@@ -274,7 +274,7 @@ impl ServiceMode {pub struct AppState {pub db: Arc<Database>,pub llm_db: Option<Arc<LlmDatabase>>,- pub livekit_client: Option<Arc<dyn livekit_server::api::Client>>,+ pub livekit_client: Option<Arc<dyn livekit_api::Client>>,pub blob_store_client: Option<aws_sdk_s3::Client>,pub stripe_client: Option<Arc<stripe::Client>>,pub stripe_billing: Option<Arc<StripeBilling>>,@@ -311,11 +311,11 @@ impl AppState {.zip(config.livekit_key.as_ref()).zip(config.livekit_secret.as_ref()){- Some(Arc::new(livekit_server::api::LiveKitClient::new(+ Some(Arc::new(livekit_api::LiveKitClient::new(server.clone(),key.clone(),secret.clone(),- )) as Arc<dyn livekit_server::api::Client>)+ )) as Arc<dyn livekit_api::Client>)} else {None};diff --git a/crates/collab/src/rpc.rs b/crates/collab/src/rpc.rsindex e795a3f1d89..189a5e5471f 100644--- a/crates/collab/src/rpc.rs+++ b/crates/collab/src/rpc.rs@@ -1545,7 +1545,7 @@ async fn set_room_participant_role(.update_participant(livekit_room.clone(),request.user_id.to_string(),- livekit_server::proto::ParticipantPermission {+ livekit_api::proto::ParticipantPermission {can_subscribe: true,can_publish,can_publish_data: can_publish,diff --git a/crates/livekit_server/Cargo.toml b/crates/livekit_api/Cargo.tomlsimilarity index 90%rename from crates/livekit_server/Cargo.tomlrename to crates/livekit_api/Cargo.tomlindex afbdbf5c9a9..b087d6b451f 100644--- a/crates/livekit_server/Cargo.toml+++ b/crates/livekit_api/Cargo.toml@@ -1,5 +1,5 @@[package]-name = "livekit_server"+name = "livekit_api"version = "0.1.0"edition.workspace = truedescription = "SDK for the LiveKit server API"@@ -10,7 +10,7 @@ license = "AGPL-3.0-or-later"workspace = true[lib]-path = "src/livekit_server.rs"+path = "src/livekit_api.rs"doctest = false[dependencies]diff --git a/crates/livekit_server/LICENSE-AGPL b/crates/livekit_api/LICENSE-AGPLsimilarity index 100%rename from crates/livekit_server/LICENSE-AGPLrename to crates/livekit_api/LICENSE-AGPLdiff --git a/crates/livekit_server/build.rs b/crates/livekit_api/build.rssimilarity index 100%rename from crates/livekit_server/build.rsrename to crates/livekit_api/build.rsdiff --git a/crates/livekit_server/src/api.rs b/crates/livekit_api/src/livekit_api.rssimilarity index 99%rename from crates/livekit_server/src/api.rsrename to crates/livekit_api/src/livekit_api.rsindex e7e933c9c39..d68099c0e3b 100644--- a/crates/livekit_server/src/api.rs+++ b/crates/livekit_api/src/livekit_api.rs@@ -1,4 +1,6 @@-use crate::{proto, token};+pub mod proto;+pub mod token;+use anyhow::{anyhow, Result};use async_trait::async_trait;use prost::Message;diff --git a/crates/livekit_server/src/proto.rs b/crates/livekit_api/src/proto.rssimilarity index 100%rename from crates/livekit_server/src/proto.rsrename to crates/livekit_api/src/proto.rsdiff --git a/crates/livekit_server/src/token.rs b/crates/livekit_api/src/token.rssimilarity index 100%rename from crates/livekit_server/src/token.rsrename to crates/livekit_api/src/token.rsdiff --git a/crates/livekit_server/vendored/protocol/README.md b/crates/livekit_api/vendored/protocol/README.mdsimilarity index 100%rename from crates/livekit_server/vendored/protocol/README.mdrename to crates/livekit_api/vendored/protocol/README.mddiff --git a/crates/livekit_server/vendored/protocol/livekit_analytics.proto b/crates/livekit_api/vendored/protocol/livekit_analytics.protosimilarity index 100%rename from crates/livekit_server/vendored/protocol/livekit_analytics.protorename to crates/livekit_api/vendored/protocol/livekit_analytics.protodiff --git a/crates/livekit_server/vendored/protocol/livekit_egress.proto b/crates/livekit_api/vendored/protocol/livekit_egress.protosimilarity index 100%rename from crates/livekit_server/vendored/protocol/livekit_egress.protorename to crates/livekit_api/vendored/protocol/livekit_egress.protodiff --git a/crates/livekit_server/vendored/protocol/livekit_ingress.proto b/crates/livekit_api/vendored/protocol/livekit_ingress.protosimilarity index 100%rename from crates/livekit_server/vendored/protocol/livekit_ingress.protorename to crates/livekit_api/vendored/protocol/livekit_ingress.protodiff --git a/crates/livekit_server/vendored/protocol/livekit_internal.proto b/crates/livekit_api/vendored/protocol/livekit_internal.protosimilarity index 100%rename from crates/livekit_server/vendored/protocol/livekit_internal.protorename to crates/livekit_api/vendored/protocol/livekit_internal.protodiff --git a/crates/livekit_server/vendored/protocol/livekit_models.proto b/crates/livekit_api/vendored/protocol/livekit_models.protosimilarity index 100%rename from crates/livekit_server/vendored/protocol/livekit_models.protorename to crates/livekit_api/vendored/protocol/livekit_models.protodiff --git a/crates/livekit_server/vendored/protocol/livekit_room.proto b/crates/livekit_api/vendored/protocol/livekit_room.protosimilarity index 100%rename from crates/livekit_server/vendored/protocol/livekit_room.protorename to crates/livekit_api/vendored/protocol/livekit_room.protodiff --git a/crates/livekit_server/vendored/protocol/livekit_rpc_internal.proto b/crates/livekit_api/vendored/protocol/livekit_rpc_internal.protosimilarity index 100%rename from crates/livekit_server/vendored/protocol/livekit_rpc_internal.protorename to crates/livekit_api/vendored/protocol/livekit_rpc_internal.protodiff --git a/crates/livekit_server/vendored/protocol/livekit_rtc.proto b/crates/livekit_api/vendored/protocol/livekit_rtc.protosimilarity index 100%rename from crates/livekit_server/vendored/protocol/livekit_rtc.protorename to crates/livekit_api/vendored/protocol/livekit_rtc.protodiff --git a/crates/livekit_server/vendored/protocol/livekit_webhook.proto b/crates/livekit_api/vendored/protocol/livekit_webhook.protosimilarity index 100%rename from crates/livekit_server/vendored/protocol/livekit_webhook.protorename to crates/livekit_api/vendored/protocol/livekit_webhook.protodiff --git a/crates/livekit_client/Cargo.toml b/crates/livekit_client/Cargo.tomlindex 7e853f5b2fe..8d492984bae 100644--- a/crates/livekit_client/Cargo.toml+++ b/crates/livekit_client/Cargo.toml@@ -28,7 +28,7 @@ cpal = "0.15"futures.workspace = truegpui.workspace = truehttp_2 = { package = "http", version = "0.2.1" }-livekit_server.workspace = true+livekit_api.workspace = truelog.workspace = truemedia.workspace = truenanoid = { workspace = true, optional = true }diff --git a/crates/livekit_client/examples/test_app.rs b/crates/livekit_client/examples/test_app.rsindex 5d43c2b1910..c0ea6dd8559 100644--- a/crates/livekit_client/examples/test_app.rs+++ b/crates/livekit_client/examples/test_app.rs@@ -33,7 +33,7 @@ use livekit_client::{AudioStream, RemoteVideoTrackView, Room, RoomEvent,};-use livekit_server::token::{self, VideoGrant};+use livekit_api::token::{self, VideoGrant};use log::LevelFilter;use simplelog::SimpleLogger;diff --git a/crates/livekit_client/src/test.rs b/crates/livekit_client/src/test.rsindex 38af9a43e84..363b51c84b1 100644--- a/crates/livekit_client/src/test.rs+++ b/crates/livekit_client/src/test.rs@@ -14,7 +14,7 @@ use collections::{btree_map::Entry as BTreeEntry, hash_map::Entry, BTreeMap, Hasuse gpui::BackgroundExecutor;#[cfg(not(all(target_os = "windows", target_env = "gnu")))]use livekit::options::TrackPublishOptions;-use livekit_server::{proto, token};+use livekit_api::{proto, token};use parking_lot::Mutex;use postage::{mpsc, sink::Sink};use std::sync::{@@ -107,7 +107,7 @@ impl TestServer {async fn join_room(&self, token: String, client_room: Room) -> Result<ParticipantIdentity> {self.executor.simulate_random_delay().await;- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let identity = ParticipantIdentity(claims.sub.unwrap().to_string());let room_name = claims.video.room.unwrap();let mut server_rooms = self.rooms.lock();@@ -174,7 +174,7 @@ impl TestServer {async fn leave_room(&self, token: String) -> Result<()> {self.executor.simulate_random_delay().await;- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let identity = ParticipantIdentity(claims.sub.unwrap().to_string());let room_name = claims.video.room.unwrap();let mut server_rooms = self.rooms.lock();@@ -195,7 +195,7 @@ impl TestServer {&self,token: String,) -> Result<HashMap<ParticipantIdentity, RemoteParticipant>> {- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let local_identity = ParticipantIdentity(claims.sub.unwrap().to_string());let room_name = claims.video.room.unwrap().to_string();@@ -288,7 +288,7 @@ impl TestServer {) -> Result<TrackSid> {self.executor.simulate_random_delay().await;- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let identity = ParticipantIdentity(claims.sub.unwrap().to_string());let room_name = claims.video.room.unwrap();@@ -354,7 +354,7 @@ impl TestServer {) -> Result<TrackSid> {self.executor.simulate_random_delay().await;- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let identity = ParticipantIdentity(claims.sub.unwrap().to_string());let room_name = claims.video.room.unwrap();@@ -419,7 +419,7 @@ impl TestServer {}fn set_track_muted(&self, token: &str, track_sid: &TrackSid, muted: bool) -> Result<()> {- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let room_name = claims.video.room.unwrap();let identity = ParticipantIdentity(claims.sub.unwrap().to_string());let mut server_rooms = self.rooms.lock();@@ -473,7 +473,7 @@ impl TestServer {}fn is_track_muted(&self, token: &str, track_sid: &TrackSid) -> Option<bool> {- let claims = livekit_server::token::validate(&token, &self.secret_key).ok()?;+ let claims = livekit_api::token::validate(&token, &self.secret_key).ok()?;let room_name = claims.video.room.unwrap();let mut server_rooms = self.rooms.lock();@@ -488,7 +488,7 @@ impl TestServer {}fn video_tracks(&self, token: String) -> Result<Vec<RemoteVideoTrack>> {- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let room_name = claims.video.room.unwrap();let identity = ParticipantIdentity(claims.sub.unwrap().to_string());@@ -511,7 +511,7 @@ impl TestServer {}fn audio_tracks(&self, token: String) -> Result<Vec<RemoteAudioTrack>> {- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let room_name = claims.video.room.unwrap();let identity = ParticipantIdentity(claims.sub.unwrap().to_string());@@ -641,7 +641,7 @@ pub enum RoomEvent {#[cfg(not(all(target_os = "windows", target_env = "gnu")))]#[async_trait]-impl livekit_server::api::Client for TestApiClient {+impl livekit_api::Client for TestApiClient {fn url(&self) -> &str {&self.url}@@ -670,7 +670,7 @@ impl livekit_server::api::Client for TestApiClient {&self,room: String,identity: String,- permission: livekit_server::proto::ParticipantPermission,+ permission: livekit_api::proto::ParticipantPermission,) -> Result<()> {let server = TestServer::get(&self.url)?;serverdiff --git a/crates/livekit_client_macos/Cargo.toml b/crates/livekit_client_macos/Cargo.tomlindex 405515bf297..ddf55ceed96 100644--- a/crates/livekit_client_macos/Cargo.toml+++ b/crates/livekit_client_macos/Cargo.toml@@ -22,7 +22,7 @@ test-support = ["async-trait","collections/test-support","gpui/test-support",- "livekit_server",+ "livekit_api","nanoid",]@@ -33,7 +33,7 @@ async-trait = { workspace = true, optional = true }collections = { workspace = true, optional = true }futures.workspace = truegpui = { workspace = true, optional = true }-livekit_server = { workspace = true, optional = true }+livekit_api = { workspace = true, optional = true }log.workspace = truemedia.workspace = truenanoid = { workspace = true, optional = true}@@ -47,14 +47,14 @@ core-foundation.workspace = trueasync-trait = { workspace = true }collections = { workspace = true }gpui = { workspace = true }-livekit_server.workspace = true+livekit_api.workspace = truenanoid.workspace = true[dev-dependencies]async-trait.workspace = truecollections = { workspace = true, features = ["test-support"] }gpui = { workspace = true, features = ["test-support"] }-livekit_server.workspace = true+livekit_api.workspace = truenanoid.workspace = truesha2.workspace = truesimplelog.workspace = truediff --git a/crates/livekit_client_macos/examples/test_app_macos.rs b/crates/livekit_client_macos/examples/test_app_macos.rsindex 87aebdef0aa..fefe08e5f87 100644--- a/crates/livekit_client_macos/examples/test_app_macos.rs+++ b/crates/livekit_client_macos/examples/test_app_macos.rs@@ -2,8 +2,8 @@ use std::time::Duration;use futures::StreamExt;use gpui::{actions, KeyBinding, Menu, MenuItem};+use livekit_api::token::{self, VideoGrant};use livekit_client_macos::{LocalAudioTrack, LocalVideoTrack, Room, RoomUpdate};-use livekit_server::token::{self, VideoGrant};use log::LevelFilter;use simplelog::SimpleLogger;diff --git a/crates/livekit_client_macos/src/test.rs b/crates/livekit_client_macos/src/test.rsindex 9445a468caa..bccc713c878 100644--- a/crates/livekit_client_macos/src/test.rs+++ b/crates/livekit_client_macos/src/test.rs@@ -4,7 +4,7 @@ use async_trait::async_trait;use collections::{btree_map::Entry as BTreeEntry, hash_map::Entry, BTreeMap, HashMap, HashSet};use futures::Stream;use gpui::{BackgroundExecutor, SurfaceSource};-use livekit_server::{proto, token};+use livekit_api::{proto, token};use parking_lot::Mutex;use postage::watch;@@ -102,7 +102,7 @@ impl TestServer {#[cfg(any(test, feature = "test-support"))]self.executor.simulate_random_delay().await;- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let identity = claims.sub.unwrap().to_string();let room_name = claims.video.room.unwrap();let mut server_rooms = self.rooms.lock();@@ -150,7 +150,7 @@ impl TestServer {// todo(linux): Remove this once the cross-platform LiveKit implementation is merged#[cfg(any(test, feature = "test-support"))]self.executor.simulate_random_delay().await;- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let identity = claims.sub.unwrap().to_string();let room_name = claims.video.room.unwrap();let mut server_rooms = self.rooms.lock();@@ -224,7 +224,7 @@ impl TestServer {// todo(linux): Remove this once the cross-platform LiveKit implementation is merged#[cfg(any(test, feature = "test-support"))]self.executor.simulate_random_delay().await;- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let identity = claims.sub.unwrap().to_string();let room_name = claims.video.room.unwrap();@@ -280,7 +280,7 @@ impl TestServer {#[cfg(any(test, feature = "test-support"))]self.executor.simulate_random_delay().await;- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let identity = claims.sub.unwrap().to_string();let room_name = claims.video.room.unwrap();@@ -332,7 +332,7 @@ impl TestServer {}fn set_track_muted(&self, token: &str, track_sid: &str, muted: bool) -> Result<()> {- let claims = livekit_server::token::validate(token, &self.secret_key)?;+ let claims = livekit_api::token::validate(token, &self.secret_key)?;let room_name = claims.video.room.unwrap();let identity = claims.sub.unwrap();let mut server_rooms = self.rooms.lock();@@ -363,7 +363,7 @@ impl TestServer {}fn is_track_muted(&self, token: &str, track_sid: &str) -> Option<bool> {- let claims = livekit_server::token::validate(token, &self.secret_key).ok()?;+ let claims = livekit_api::token::validate(token, &self.secret_key).ok()?;let room_name = claims.video.room.unwrap();let mut server_rooms = self.rooms.lock();@@ -378,7 +378,7 @@ impl TestServer {}fn video_tracks(&self, token: String) -> Result<Vec<Arc<RemoteVideoTrack>>> {- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let room_name = claims.video.room.unwrap();let identity = claims.sub.unwrap();@@ -401,7 +401,7 @@ impl TestServer {}fn audio_tracks(&self, token: String) -> Result<Vec<Arc<RemoteAudioTrack>>> {- let claims = livekit_server::token::validate(&token, &self.secret_key)?;+ let claims = livekit_api::token::validate(&token, &self.secret_key)?;let room_name = claims.video.room.unwrap();let identity = claims.sub.unwrap();@@ -455,7 +455,7 @@ pub struct TestApiClient {}#[async_trait]-impl livekit_server::api::Client for TestApiClient {+impl livekit_api::Client for TestApiClient {fn url(&self) -> &str {&self.url}@@ -482,7 +482,7 @@ impl livekit_server::api::Client for TestApiClient {&self,room: String,identity: String,- permission: livekit_server::proto::ParticipantPermission,+ permission: livekit_api::proto::ParticipantPermission,) -> Result<()> {let server = TestServer::get(&self.url)?;serverdiff --git a/crates/livekit_server/src/livekit_server.rs b/crates/livekit_server/src/livekit_server.rsdeleted file mode 100644index aa7c1f2fd01..00000000000--- a/crates/livekit_server/src/livekit_server.rs+++ /dev/null@@ -1,3 +0,0 @@-pub mod api;-pub mod proto;-pub mod token;diff --git a/typos.toml b/typos.tomlindex 8deed5882d6..7c8bd02c744 100644--- a/typos.toml+++ b/typos.toml@@ -22,7 +22,7 @@ extend-exclude = [# Stripe IDs are flagged as typos."crates/collab/src/db/tests/processed_stripe_event_tests.rs",# Not our typos.- "crates/livekit_server/",+ "crates/livekit_api/",# Vim makes heavy use of partial typing tables."crates/vim/",# Editor and file finder rely on partial typing and custom in-string syntax.