From b0356d8556e548a7b7cbb9a4f6491e603485be99 Mon Sep 17 00:00:00 2001 From: Kayh Date: Sun, 26 Nov 2023 22:16:50 -0500 Subject: [PATCH] move to crates folder --- Cargo.toml | 12 +- {unavi-app => crates/unavi-app}/Cargo.toml | 0 {unavi-app => crates/unavi-app}/README.md | 0 .../unavi-app}/examples/demo.rs | 2 +- {unavi-app => crates/unavi-app}/src/avatar.rs | 0 {unavi-app => crates/unavi-app}/src/lib.rs | 0 .../unavi-app}/src/networking/mod.rs | 0 .../unavi-app}/src/player/controls.rs | 0 .../unavi-app}/src/player/events.rs | 0 .../unavi-app}/src/player/input.rs | 0 .../unavi-app}/src/player/look.rs | 0 .../unavi-app}/src/player/mod.rs | 0 .../unavi-app}/src/settings/mod.rs | 0 .../unavi-app}/src/settings/shadows.rs | 0 .../unavi-app}/src/world/mod.rs | 0 .../unavi-app}/src/world/skybox.rs | 0 .../unavi-native}/Cargo.toml | 0 .../unavi-native}/README.md | 0 .../unavi-native}/src/main.rs | 2 +- .../unavi-server}/Cargo.toml | 2 +- .../unavi-server}/README.md | 0 .../unavi-server}/examples/web_transport.rs | 0 .../unavi-server}/src/lib.rs | 0 .../unavi-server}/src/main.rs | 0 .../unavi-server}/src/web/fileserve.rs | 0 .../unavi-server}/src/web/mod.rs | 0 .../unavi-server}/src/world/cert.rs | 0 .../unavi-server}/src/world/mod.rs | 0 .../unavi-system-api}/Cargo.toml | 0 .../unavi-system-api}/README.md | 0 .../unavi-system-api}/src/lib.rs | 0 {unavi-ui => crates/unavi-ui}/Cargo.toml | 0 {unavi-ui => crates/unavi-ui}/README.md | 0 {unavi-ui => crates/unavi-ui}/src/button.rs | 0 {unavi-ui => crates/unavi-ui}/src/lib.rs | 0 crates/unavi-ui/wit/README.md | 9 ++ crates/unavi-ui/wit/unavi_button.wit | 7 + crates/unavi-ui/wit/wired_input.wit | 15 ++ .../unavi-web-client}/Cargo.toml | 4 +- .../unavi-web-client}/README.md | 0 .../unavi-web-client}/src/lib.rs | 0 .../unavi-web-common}/Cargo.toml | 0 .../unavi-web-common}/README.md | 0 .../unavi-web-common}/src/error_template.rs | 0 .../unavi-web-common}/src/lib.rs | 0 .../unavi-web-common}/style.css | 0 .../unavi-wired-api}/Cargo.toml | 0 .../unavi-wired-api}/README.md | 0 .../unavi-wired-api}/src/lib.rs | 0 crates/unavi-wired-api/wit/README.md | 9 ++ crates/unavi-wired-api/wit/button.wit | 7 + crates/unavi-wired-api/wit/input.wit | 15 ++ .../wired-protocol-proto}/Cargo.toml | 0 .../wired-protocol-proto}/README.md | 0 .../wired-protocol-proto}/build.rs | 0 crates/wired-protocol-proto/protos/README.md | 3 + .../protos/world/webrtc/common.proto | 23 +++ .../protos/world/webrtc/request.proto | 11 ++ .../protos/world/webrtc/response.proto | 16 +++ .../protos/world/websocket/request.proto | 17 +++ .../protos/world/websocket/response.proto | 17 +++ .../world/websocket/signaling/common.proto | 132 ++++++++++++++++++ .../world/websocket/signaling/request.proto | 33 +++++ .../world/websocket/signaling/response.proto | 75 ++++++++++ .../wired-protocol-proto}/src/lib.rs | 0 unavi-ui/wit | 1 - unavi-wired-api/wit | 1 - wired-protocol-proto/protos | 1 - 68 files changed, 396 insertions(+), 18 deletions(-) rename {unavi-app => crates/unavi-app}/Cargo.toml (100%) rename {unavi-app => crates/unavi-app}/README.md (100%) rename {unavi-app => crates/unavi-app}/examples/demo.rs (99%) rename {unavi-app => crates/unavi-app}/src/avatar.rs (100%) rename {unavi-app => crates/unavi-app}/src/lib.rs (100%) rename {unavi-app => crates/unavi-app}/src/networking/mod.rs (100%) rename {unavi-app => crates/unavi-app}/src/player/controls.rs (100%) rename {unavi-app => crates/unavi-app}/src/player/events.rs (100%) rename {unavi-app => crates/unavi-app}/src/player/input.rs (100%) rename {unavi-app => crates/unavi-app}/src/player/look.rs (100%) rename {unavi-app => crates/unavi-app}/src/player/mod.rs (100%) rename {unavi-app => crates/unavi-app}/src/settings/mod.rs (100%) rename {unavi-app => crates/unavi-app}/src/settings/shadows.rs (100%) rename {unavi-app => crates/unavi-app}/src/world/mod.rs (100%) rename {unavi-app => crates/unavi-app}/src/world/skybox.rs (100%) rename {unavi-native => crates/unavi-native}/Cargo.toml (100%) rename {unavi-native => crates/unavi-native}/README.md (100%) rename {unavi-native => crates/unavi-native}/src/main.rs (80%) rename {unavi-server => crates/unavi-server}/Cargo.toml (95%) rename {unavi-server => crates/unavi-server}/README.md (100%) rename {unavi-server => crates/unavi-server}/examples/web_transport.rs (100%) rename {unavi-server => crates/unavi-server}/src/lib.rs (100%) rename {unavi-server => crates/unavi-server}/src/main.rs (100%) rename {unavi-server => crates/unavi-server}/src/web/fileserve.rs (100%) rename {unavi-server => crates/unavi-server}/src/web/mod.rs (100%) rename {unavi-server => crates/unavi-server}/src/world/cert.rs (100%) rename {unavi-server => crates/unavi-server}/src/world/mod.rs (100%) rename {unavi-system-api => crates/unavi-system-api}/Cargo.toml (100%) rename {unavi-system-api => crates/unavi-system-api}/README.md (100%) rename {unavi-system-api => crates/unavi-system-api}/src/lib.rs (100%) rename {unavi-ui => crates/unavi-ui}/Cargo.toml (100%) rename {unavi-ui => crates/unavi-ui}/README.md (100%) rename {unavi-ui => crates/unavi-ui}/src/button.rs (100%) rename {unavi-ui => crates/unavi-ui}/src/lib.rs (100%) create mode 100644 crates/unavi-ui/wit/README.md create mode 100644 crates/unavi-ui/wit/unavi_button.wit create mode 100644 crates/unavi-ui/wit/wired_input.wit rename {unavi-web/client => crates/unavi-web-client}/Cargo.toml (73%) rename {unavi-web/client => crates/unavi-web-client}/README.md (100%) rename {unavi-web/client => crates/unavi-web-client}/src/lib.rs (100%) rename {unavi-web/common => crates/unavi-web-common}/Cargo.toml (100%) rename {unavi-web/common => crates/unavi-web-common}/README.md (100%) rename {unavi-web/common => crates/unavi-web-common}/src/error_template.rs (100%) rename {unavi-web/common => crates/unavi-web-common}/src/lib.rs (100%) rename {unavi-web/common => crates/unavi-web-common}/style.css (100%) rename {unavi-wired-api => crates/unavi-wired-api}/Cargo.toml (100%) rename {unavi-wired-api => crates/unavi-wired-api}/README.md (100%) rename {unavi-wired-api => crates/unavi-wired-api}/src/lib.rs (100%) create mode 100644 crates/unavi-wired-api/wit/README.md create mode 100644 crates/unavi-wired-api/wit/button.wit create mode 100644 crates/unavi-wired-api/wit/input.wit rename {wired-protocol-proto => crates/wired-protocol-proto}/Cargo.toml (100%) rename {wired-protocol-proto => crates/wired-protocol-proto}/README.md (100%) rename {wired-protocol-proto => crates/wired-protocol-proto}/build.rs (100%) create mode 100644 crates/wired-protocol-proto/protos/README.md create mode 100644 crates/wired-protocol-proto/protos/world/webrtc/common.proto create mode 100644 crates/wired-protocol-proto/protos/world/webrtc/request.proto create mode 100644 crates/wired-protocol-proto/protos/world/webrtc/response.proto create mode 100644 crates/wired-protocol-proto/protos/world/websocket/request.proto create mode 100644 crates/wired-protocol-proto/protos/world/websocket/response.proto create mode 100644 crates/wired-protocol-proto/protos/world/websocket/signaling/common.proto create mode 100644 crates/wired-protocol-proto/protos/world/websocket/signaling/request.proto create mode 100644 crates/wired-protocol-proto/protos/world/websocket/signaling/response.proto rename {wired-protocol-proto => crates/wired-protocol-proto}/src/lib.rs (100%) delete mode 160000 unavi-ui/wit delete mode 160000 unavi-wired-api/wit delete mode 160000 wired-protocol-proto/protos diff --git a/Cargo.toml b/Cargo.toml index a53241ced..ddd612fdc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,7 @@ [workspace] resolver = "2" members = [ - "unavi-app", - "unavi-native", - "unavi-server", - "unavi-system-api", - "unavi-ui", - "unavi-web/client", - "unavi-web/common", - "unavi-wired-api", - "wired-protocol-proto" + "crates/*", ] [workspace.package] @@ -27,7 +19,7 @@ bin-package = "unavi-server" bin-default-features = true lib-package = "unavi-web-client" lib-profile-release = "wasm-release" -style-file = "unavi-web/common/style.css" +style-file = "crates/unavi-web-common/style.css" [profile.dev] opt-level = 1 diff --git a/unavi-app/Cargo.toml b/crates/unavi-app/Cargo.toml similarity index 100% rename from unavi-app/Cargo.toml rename to crates/unavi-app/Cargo.toml diff --git a/unavi-app/README.md b/crates/unavi-app/README.md similarity index 100% rename from unavi-app/README.md rename to crates/unavi-app/README.md diff --git a/unavi-app/examples/demo.rs b/crates/unavi-app/examples/demo.rs similarity index 99% rename from unavi-app/examples/demo.rs rename to crates/unavi-app/examples/demo.rs index a3b648dc0..3c60f5ee4 100644 --- a/unavi-app/examples/demo.rs +++ b/crates/unavi-app/examples/demo.rs @@ -7,7 +7,7 @@ use unavi_app::networking::JoinWorld; fn main() { unavi_app::App::new() .add_plugins(unavi_app::UnaviPlugin { - file_path: "../assets".to_string(), + file_path: "../../assets".to_string(), log_level: tracing::Level::DEBUG, }) .add_systems(Startup, setup_world) diff --git a/unavi-app/src/avatar.rs b/crates/unavi-app/src/avatar.rs similarity index 100% rename from unavi-app/src/avatar.rs rename to crates/unavi-app/src/avatar.rs diff --git a/unavi-app/src/lib.rs b/crates/unavi-app/src/lib.rs similarity index 100% rename from unavi-app/src/lib.rs rename to crates/unavi-app/src/lib.rs diff --git a/unavi-app/src/networking/mod.rs b/crates/unavi-app/src/networking/mod.rs similarity index 100% rename from unavi-app/src/networking/mod.rs rename to crates/unavi-app/src/networking/mod.rs diff --git a/unavi-app/src/player/controls.rs b/crates/unavi-app/src/player/controls.rs similarity index 100% rename from unavi-app/src/player/controls.rs rename to crates/unavi-app/src/player/controls.rs diff --git a/unavi-app/src/player/events.rs b/crates/unavi-app/src/player/events.rs similarity index 100% rename from unavi-app/src/player/events.rs rename to crates/unavi-app/src/player/events.rs diff --git a/unavi-app/src/player/input.rs b/crates/unavi-app/src/player/input.rs similarity index 100% rename from unavi-app/src/player/input.rs rename to crates/unavi-app/src/player/input.rs diff --git a/unavi-app/src/player/look.rs b/crates/unavi-app/src/player/look.rs similarity index 100% rename from unavi-app/src/player/look.rs rename to crates/unavi-app/src/player/look.rs diff --git a/unavi-app/src/player/mod.rs b/crates/unavi-app/src/player/mod.rs similarity index 100% rename from unavi-app/src/player/mod.rs rename to crates/unavi-app/src/player/mod.rs diff --git a/unavi-app/src/settings/mod.rs b/crates/unavi-app/src/settings/mod.rs similarity index 100% rename from unavi-app/src/settings/mod.rs rename to crates/unavi-app/src/settings/mod.rs diff --git a/unavi-app/src/settings/shadows.rs b/crates/unavi-app/src/settings/shadows.rs similarity index 100% rename from unavi-app/src/settings/shadows.rs rename to crates/unavi-app/src/settings/shadows.rs diff --git a/unavi-app/src/world/mod.rs b/crates/unavi-app/src/world/mod.rs similarity index 100% rename from unavi-app/src/world/mod.rs rename to crates/unavi-app/src/world/mod.rs diff --git a/unavi-app/src/world/skybox.rs b/crates/unavi-app/src/world/skybox.rs similarity index 100% rename from unavi-app/src/world/skybox.rs rename to crates/unavi-app/src/world/skybox.rs diff --git a/unavi-native/Cargo.toml b/crates/unavi-native/Cargo.toml similarity index 100% rename from unavi-native/Cargo.toml rename to crates/unavi-native/Cargo.toml diff --git a/unavi-native/README.md b/crates/unavi-native/README.md similarity index 100% rename from unavi-native/README.md rename to crates/unavi-native/README.md diff --git a/unavi-native/src/main.rs b/crates/unavi-native/src/main.rs similarity index 80% rename from unavi-native/src/main.rs rename to crates/unavi-native/src/main.rs index dcfd62390..4dd97c83b 100644 --- a/unavi-native/src/main.rs +++ b/crates/unavi-native/src/main.rs @@ -5,7 +5,7 @@ use bevy::prelude::*; fn main() { App::new() .add_plugins(unavi_app::UnaviPlugin { - file_path: "../assets".to_string(), + file_path: "../../assets".to_string(), ..default() }) .run(); diff --git a/unavi-server/Cargo.toml b/crates/unavi-server/Cargo.toml similarity index 95% rename from unavi-server/Cargo.toml rename to crates/unavi-server/Cargo.toml index 9a9e1504f..6a4579cc2 100644 --- a/unavi-server/Cargo.toml +++ b/crates/unavi-server/Cargo.toml @@ -37,7 +37,7 @@ tracing-subscriber = "0.3.18" leptos = { version = "0.5.1", features = ["ssr"], optional = true } leptos_axum = { version = "0.5.1", optional = true } -unavi-web-common= { path = "../unavi-web/common", features = ["ssr"], optional = true } +unavi-web-common= { path = "../unavi-web-common", features = ["ssr"], optional = true } aeronet = { version = "0.3.0", features = ["bevy"], optional = true } aeronet_wt_core = { version = "0.3.0", optional = true } diff --git a/unavi-server/README.md b/crates/unavi-server/README.md similarity index 100% rename from unavi-server/README.md rename to crates/unavi-server/README.md diff --git a/unavi-server/examples/web_transport.rs b/crates/unavi-server/examples/web_transport.rs similarity index 100% rename from unavi-server/examples/web_transport.rs rename to crates/unavi-server/examples/web_transport.rs diff --git a/unavi-server/src/lib.rs b/crates/unavi-server/src/lib.rs similarity index 100% rename from unavi-server/src/lib.rs rename to crates/unavi-server/src/lib.rs diff --git a/unavi-server/src/main.rs b/crates/unavi-server/src/main.rs similarity index 100% rename from unavi-server/src/main.rs rename to crates/unavi-server/src/main.rs diff --git a/unavi-server/src/web/fileserve.rs b/crates/unavi-server/src/web/fileserve.rs similarity index 100% rename from unavi-server/src/web/fileserve.rs rename to crates/unavi-server/src/web/fileserve.rs diff --git a/unavi-server/src/web/mod.rs b/crates/unavi-server/src/web/mod.rs similarity index 100% rename from unavi-server/src/web/mod.rs rename to crates/unavi-server/src/web/mod.rs diff --git a/unavi-server/src/world/cert.rs b/crates/unavi-server/src/world/cert.rs similarity index 100% rename from unavi-server/src/world/cert.rs rename to crates/unavi-server/src/world/cert.rs diff --git a/unavi-server/src/world/mod.rs b/crates/unavi-server/src/world/mod.rs similarity index 100% rename from unavi-server/src/world/mod.rs rename to crates/unavi-server/src/world/mod.rs diff --git a/unavi-system-api/Cargo.toml b/crates/unavi-system-api/Cargo.toml similarity index 100% rename from unavi-system-api/Cargo.toml rename to crates/unavi-system-api/Cargo.toml diff --git a/unavi-system-api/README.md b/crates/unavi-system-api/README.md similarity index 100% rename from unavi-system-api/README.md rename to crates/unavi-system-api/README.md diff --git a/unavi-system-api/src/lib.rs b/crates/unavi-system-api/src/lib.rs similarity index 100% rename from unavi-system-api/src/lib.rs rename to crates/unavi-system-api/src/lib.rs diff --git a/unavi-ui/Cargo.toml b/crates/unavi-ui/Cargo.toml similarity index 100% rename from unavi-ui/Cargo.toml rename to crates/unavi-ui/Cargo.toml diff --git a/unavi-ui/README.md b/crates/unavi-ui/README.md similarity index 100% rename from unavi-ui/README.md rename to crates/unavi-ui/README.md diff --git a/unavi-ui/src/button.rs b/crates/unavi-ui/src/button.rs similarity index 100% rename from unavi-ui/src/button.rs rename to crates/unavi-ui/src/button.rs diff --git a/unavi-ui/src/lib.rs b/crates/unavi-ui/src/lib.rs similarity index 100% rename from unavi-ui/src/lib.rs rename to crates/unavi-ui/src/lib.rs diff --git a/crates/unavi-ui/wit/README.md b/crates/unavi-ui/wit/README.md new file mode 100644 index 000000000..dd8bb3527 --- /dev/null +++ b/crates/unavi-ui/wit/README.md @@ -0,0 +1,9 @@ +# wired-protocol-wit + +[WIT](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md) specification for [The Wired 🔌](https://github.com/unavi-xyz/wired-protocol). + +### (!) Contains extraneous code + +This repo contains additional `.wit` files beyond the scope of The Wired. +This is a temporary solution to ease development of [UNAVI](https://github.com/unavi-xyz/unavi), as WIT tooling is very young with no good solution for dependency management. +Hopefully a solution is merged upstream soon 🙏. diff --git a/crates/unavi-ui/wit/unavi_button.wit b/crates/unavi-ui/wit/unavi_button.wit new file mode 100644 index 000000000..c4814ff53 --- /dev/null +++ b/crates/unavi-ui/wit/unavi_button.wit @@ -0,0 +1,7 @@ +package unavi:button; + +world button { + use hover.{hover-state}; + + export press: func(state: hover-state); +} diff --git a/crates/unavi-ui/wit/wired_input.wit b/crates/unavi-ui/wit/wired_input.wit new file mode 100644 index 000000000..99bf4af13 --- /dev/null +++ b/crates/unavi-ui/wit/wired_input.wit @@ -0,0 +1,15 @@ +interface hover { + enum hover-state { + hovering, + not-hovering + } + + record hover-event { + cursor: u32, + state: hover-state, + time: u64 + } + + on-hover-enter: func(event: hover-event); + on-hover-leave: func(event: hover-event); +} diff --git a/unavi-web/client/Cargo.toml b/crates/unavi-web-client/Cargo.toml similarity index 73% rename from unavi-web/client/Cargo.toml rename to crates/unavi-web-client/Cargo.toml index 385dd7e08..676bde354 100644 --- a/unavi-web/client/Cargo.toml +++ b/crates/unavi-web-client/Cargo.toml @@ -13,6 +13,6 @@ crate-type = ["cdylib", "rlib"] [dependencies] leptos = { version = "0.5.1", features = ["hydrate"] } -unavi-web-common = { path = "../common", features = ["hydrate"] } -unavi-app = { path = "../../unavi-app" } +unavi-web-common = { path = "../unavi-web-common", features = ["hydrate"] } +unavi-app = { path = "../unavi-app" } console_error_panic_hook = "0.1.7" diff --git a/unavi-web/client/README.md b/crates/unavi-web-client/README.md similarity index 100% rename from unavi-web/client/README.md rename to crates/unavi-web-client/README.md diff --git a/unavi-web/client/src/lib.rs b/crates/unavi-web-client/src/lib.rs similarity index 100% rename from unavi-web/client/src/lib.rs rename to crates/unavi-web-client/src/lib.rs diff --git a/unavi-web/common/Cargo.toml b/crates/unavi-web-common/Cargo.toml similarity index 100% rename from unavi-web/common/Cargo.toml rename to crates/unavi-web-common/Cargo.toml diff --git a/unavi-web/common/README.md b/crates/unavi-web-common/README.md similarity index 100% rename from unavi-web/common/README.md rename to crates/unavi-web-common/README.md diff --git a/unavi-web/common/src/error_template.rs b/crates/unavi-web-common/src/error_template.rs similarity index 100% rename from unavi-web/common/src/error_template.rs rename to crates/unavi-web-common/src/error_template.rs diff --git a/unavi-web/common/src/lib.rs b/crates/unavi-web-common/src/lib.rs similarity index 100% rename from unavi-web/common/src/lib.rs rename to crates/unavi-web-common/src/lib.rs diff --git a/unavi-web/common/style.css b/crates/unavi-web-common/style.css similarity index 100% rename from unavi-web/common/style.css rename to crates/unavi-web-common/style.css diff --git a/unavi-wired-api/Cargo.toml b/crates/unavi-wired-api/Cargo.toml similarity index 100% rename from unavi-wired-api/Cargo.toml rename to crates/unavi-wired-api/Cargo.toml diff --git a/unavi-wired-api/README.md b/crates/unavi-wired-api/README.md similarity index 100% rename from unavi-wired-api/README.md rename to crates/unavi-wired-api/README.md diff --git a/unavi-wired-api/src/lib.rs b/crates/unavi-wired-api/src/lib.rs similarity index 100% rename from unavi-wired-api/src/lib.rs rename to crates/unavi-wired-api/src/lib.rs diff --git a/crates/unavi-wired-api/wit/README.md b/crates/unavi-wired-api/wit/README.md new file mode 100644 index 000000000..dd8bb3527 --- /dev/null +++ b/crates/unavi-wired-api/wit/README.md @@ -0,0 +1,9 @@ +# wired-protocol-wit + +[WIT](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md) specification for [The Wired 🔌](https://github.com/unavi-xyz/wired-protocol). + +### (!) Contains extraneous code + +This repo contains additional `.wit` files beyond the scope of The Wired. +This is a temporary solution to ease development of [UNAVI](https://github.com/unavi-xyz/unavi), as WIT tooling is very young with no good solution for dependency management. +Hopefully a solution is merged upstream soon 🙏. diff --git a/crates/unavi-wired-api/wit/button.wit b/crates/unavi-wired-api/wit/button.wit new file mode 100644 index 000000000..c4814ff53 --- /dev/null +++ b/crates/unavi-wired-api/wit/button.wit @@ -0,0 +1,7 @@ +package unavi:button; + +world button { + use hover.{hover-state}; + + export press: func(state: hover-state); +} diff --git a/crates/unavi-wired-api/wit/input.wit b/crates/unavi-wired-api/wit/input.wit new file mode 100644 index 000000000..99bf4af13 --- /dev/null +++ b/crates/unavi-wired-api/wit/input.wit @@ -0,0 +1,15 @@ +interface hover { + enum hover-state { + hovering, + not-hovering + } + + record hover-event { + cursor: u32, + state: hover-state, + time: u64 + } + + on-hover-enter: func(event: hover-event); + on-hover-leave: func(event: hover-event); +} diff --git a/wired-protocol-proto/Cargo.toml b/crates/wired-protocol-proto/Cargo.toml similarity index 100% rename from wired-protocol-proto/Cargo.toml rename to crates/wired-protocol-proto/Cargo.toml diff --git a/wired-protocol-proto/README.md b/crates/wired-protocol-proto/README.md similarity index 100% rename from wired-protocol-proto/README.md rename to crates/wired-protocol-proto/README.md diff --git a/wired-protocol-proto/build.rs b/crates/wired-protocol-proto/build.rs similarity index 100% rename from wired-protocol-proto/build.rs rename to crates/wired-protocol-proto/build.rs diff --git a/crates/wired-protocol-proto/protos/README.md b/crates/wired-protocol-proto/protos/README.md new file mode 100644 index 000000000..106dc884e --- /dev/null +++ b/crates/wired-protocol-proto/protos/README.md @@ -0,0 +1,3 @@ +# wired-protocol-proto + +[Protobuf](https://protobuf.dev/) specification for [The Wired 🔌](https://github.com/unavi-xyz/wired-protocol). diff --git a/crates/wired-protocol-proto/protos/world/webrtc/common.proto b/crates/wired-protocol-proto/protos/world/webrtc/common.proto new file mode 100644 index 000000000..e5b5e4b18 --- /dev/null +++ b/crates/wired-protocol-proto/protos/world/webrtc/common.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; + +package world.webrtc.common; + +message Position { + float x = 1; + float y = 2; + float z = 3; +} + +message Rotation { + float x = 1; + float y = 2; + float z = 3; + float w = 4; +} + + +message Location { + Position body_position = 1; + float body_rotation = 2; + Rotation head_rotation = 3; +} diff --git a/crates/wired-protocol-proto/protos/world/webrtc/request.proto b/crates/wired-protocol-proto/protos/world/webrtc/request.proto new file mode 100644 index 000000000..4be398709 --- /dev/null +++ b/crates/wired-protocol-proto/protos/world/webrtc/request.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package world.webrtc.request; + +import "world/webrtc/common.proto"; + +message Request { + oneof message { + common.Location publish_location = 1; + } +} diff --git a/crates/wired-protocol-proto/protos/world/webrtc/response.proto b/crates/wired-protocol-proto/protos/world/webrtc/response.proto new file mode 100644 index 000000000..516cb49e6 --- /dev/null +++ b/crates/wired-protocol-proto/protos/world/webrtc/response.proto @@ -0,0 +1,16 @@ +syntax = "proto3"; + +package world.webrtc.response; + +import "world/webrtc/common.proto"; + +message Response { + oneof message { + PlayerLocation player_location = 1; + } +} + +message PlayerLocation { + uint32 player_id = 1; + common.Location location = 2; +} diff --git a/crates/wired-protocol-proto/protos/world/websocket/request.proto b/crates/wired-protocol-proto/protos/world/websocket/request.proto new file mode 100644 index 000000000..9991e835f --- /dev/null +++ b/crates/wired-protocol-proto/protos/world/websocket/request.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package world.websocket.request; + +import "world/websocket/signaling/request.proto"; + +message Request { + oneof message { + signaling.request.PauseAudio pause_audio = 1; + signaling.request.ConnectTransport connect_transport = 2; + signaling.request.CreateTransport create_transport = 3; + signaling.request.GetRouterRtpCapabilities get_router_rtp_capabilities = 4; + signaling.request.SetRtpCapabilities set_rtp_capabilities = 5; + signaling.request.Produce produce = 6; + signaling.request.ProduceData produce_data = 7; + } +} diff --git a/crates/wired-protocol-proto/protos/world/websocket/response.proto b/crates/wired-protocol-proto/protos/world/websocket/response.proto new file mode 100644 index 000000000..4b0f65bf3 --- /dev/null +++ b/crates/wired-protocol-proto/protos/world/websocket/response.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package world.websocket.response; + +import "world/websocket/signaling/response.proto"; + +message Response { + oneof response { + signaling.response.CreateConsumer create_consumer = 1; + signaling.response.CreateDataConsumer create_data_consumer = 2; + signaling.response.ProducerId producer_id = 3; + signaling.response.DataProducerId data_producer_id = 4; + signaling.response.RouterRtpCapabilities router_rtp_capabilities = 5; + signaling.response.TransportCreated transport_created = 6; + signaling.response.TransportConnected transport_connected = 13; + } +} diff --git a/crates/wired-protocol-proto/protos/world/websocket/signaling/common.proto b/crates/wired-protocol-proto/protos/world/websocket/signaling/common.proto new file mode 100644 index 000000000..9d5a254d3 --- /dev/null +++ b/crates/wired-protocol-proto/protos/world/websocket/signaling/common.proto @@ -0,0 +1,132 @@ +syntax = "proto3"; + +package world.websocket.signaling.common; + +enum TransportType { + CONSUMER = 0; + PRODUCER = 1; +} + +message DtlsParameters { + enum Role { + AUTO = 0; + CLIENT = 1; + SERVER = 2; + } + + message Fingerprint { + string algorithm = 1; + string value = 2; + } + + Role role = 1; + repeated Fingerprint fingerprints = 2; +} + +message IceCandidate { + enum Protocol { + UDP = 0; + TCP = 1; + } + + enum Type { + HOST = 0; + SRFLX = 1; + PRFLX = 2; + RELAY = 3; + } + + enum TcpType { + ACTIVE = 0; + PASSIVE = 1; + SO = 2; + } + + string foundation = 1; + int32 priority = 2; + string ip = 3; + int32 port = 4; + Protocol protocol = 5; + Type type = 6; + optional TcpType tcp_type = 7; +} + +message RtcpFeedback { + string type = 1; + optional string parameter = 2; +} + + +message RtpCapabilities { + enum MediaKind { + AUDIO = 0; + VIDEO = 1; + } + + message Codec { + MediaKind kind = 1; + string mime_type = 2; + int32 clock_rate = 3; + optional int32 channels = 4; + repeated RtcpFeedback rtcp_feedback = 5; + } + + message HeaderExtension { + enum Direction { + SENDRECV = 0; + SENDONLY = 1; + RECVONLY = 2; + INACTIVE = 3; + } + + string uri = 1; + MediaKind kind = 2; + int32 preferred_id = 3; + optional bool preferred_encrypt = 4; + optional Direction direction = 5; + } + + repeated Codec codecs = 1; + repeated HeaderExtension header_extensions = 2; +} + +message RtpParameters { + message Codec { + string mime_type = 1; + int32 payload_type = 2; + int32 clock_rate = 3; + optional int32 channels = 4; + repeated RtcpFeedback rtcp_feedback = 5; + } + + message HeaderExtension { + string uri = 1; + int32 id = 2; + } + + repeated Codec codecs = 1; + repeated HeaderExtension header_extensions = 2; +} + +message SctpParameters { + message PartialReliability { + optional bool allowed = 1; + optional int32 max_retransmits = 2; + optional int32 max_packet_life_time = 3; + } + + int32 port = 1; + optional int32 max_message_size = 2; + optional int32 max_retransmits = 3; + optional bool negotiated = 4; + optional bool stream_reset = 5; + optional PartialReliability partial_reliability = 6; +} + +message SctpStreamParameters { + int32 stream_id = 1; + optional bool ordered = 2; + optional int32 max_packet_life_time = 3; + optional int32 max_retransmits = 4; + optional string protocol = 6; +} diff --git a/crates/wired-protocol-proto/protos/world/websocket/signaling/request.proto b/crates/wired-protocol-proto/protos/world/websocket/signaling/request.proto new file mode 100644 index 000000000..733492d3a --- /dev/null +++ b/crates/wired-protocol-proto/protos/world/websocket/signaling/request.proto @@ -0,0 +1,33 @@ +syntax = "proto3"; + +package world.websocket.signaling.request; + +import "world/websocket/signaling/common.proto"; + +message PauseAudio { + bool paused = 1; +} + +message ConnectTransport { + common.TransportType type = 1; + common.DtlsParameters dtlsParameters = 2; +} + +message CreateTransport { + common.TransportType type = 1; +} + +message GetRouterRtpCapabilities { +} + +message SetRtpCapabilities { + common.RtpCapabilities rtpCapabilities = 1; +} + +message Produce { + common.RtpParameters rtpParameters = 1; +} + +message ProduceData { + common.SctpStreamParameters sctpStreamParameters = 1; +} diff --git a/crates/wired-protocol-proto/protos/world/websocket/signaling/response.proto b/crates/wired-protocol-proto/protos/world/websocket/signaling/response.proto new file mode 100644 index 000000000..611f4fcd2 --- /dev/null +++ b/crates/wired-protocol-proto/protos/world/websocket/signaling/response.proto @@ -0,0 +1,75 @@ +syntax = "proto3"; + +package world.websocket.signaling.response; + +import "world/websocket/signaling/common.proto"; + +message CreateConsumer { + int32 player_id = 1; + string consumer_id = 2; + string producer_id = 3; + common.RtpParameters rtp_parameters = 4; +} + +message CreateDataConsumer { + int32 player_id = 1; + string data_consumer_id = 2; + string data_producer_id = 3; + common.SctpStreamParameters sctp_stream_parameters = 4; +} + +message ProducerId { + string producer_id = 1; +} + +message DataProducerId { + string data_producer_id = 1; +} + +message RouterRtpCapabilities { + common.RtpCapabilities rtp_capabilities = 1; +} + +message TransportCreated { + message TransportOptions { + message IceParameters { + string username_fragment = 1; + string password = 2; + optional bool iceLite = 3; + } + + message IceServer { + repeated string urls = 1; + optional string username = 2; + optional string credential = 3; + } + + message SctpParameters { + int32 port = 1; + int32 os = 2; + int32 mis = 3; + int32 max_message_size = 4; + } + + enum IceTransportPolicy { + ALL = 0; + RELAY = 1; + } + + string id = 1; + IceParameters ice_parameters = 2; + common.DtlsParameters dtls_parameters = 3; + repeated common.IceCandidate ice_candidates = 4; + optional SctpParameters sctp_parameters = 5; + optional IceTransportPolicy ice_transport_policy = 6; + repeated IceServer ice_servers = 7; + } + + common.TransportType type = 1; + TransportOptions options = 2; +} + +message TransportConnected { + common.TransportType type = 1; + bool success = 2; +} diff --git a/wired-protocol-proto/src/lib.rs b/crates/wired-protocol-proto/src/lib.rs similarity index 100% rename from wired-protocol-proto/src/lib.rs rename to crates/wired-protocol-proto/src/lib.rs diff --git a/unavi-ui/wit b/unavi-ui/wit deleted file mode 160000 index 9f405fbf2..000000000 --- a/unavi-ui/wit +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9f405fbf29f95a0fe07de10bb019f8c218319882 diff --git a/unavi-wired-api/wit b/unavi-wired-api/wit deleted file mode 160000 index 9f405fbf2..000000000 --- a/unavi-wired-api/wit +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9f405fbf29f95a0fe07de10bb019f8c218319882 diff --git a/wired-protocol-proto/protos b/wired-protocol-proto/protos deleted file mode 160000 index daaf12b6f..000000000 --- a/wired-protocol-proto/protos +++ /dev/null @@ -1 +0,0 @@ -Subproject commit daaf12b6f0b0785c121e9227f1f601179f2239a3