-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
68 changed files
with
396 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 🙏. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package unavi:button; | ||
|
||
world button { | ||
use hover.{hover-state}; | ||
|
||
export press: func(state: hover-state); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 🙏. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package unavi:button; | ||
|
||
world button { | ||
use hover.{hover-state}; | ||
|
||
export press: func(state: hover-state); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# wired-protocol-proto | ||
|
||
[Protobuf](https://protobuf.dev/) specification for [The Wired 🔌](https://github.com/unavi-xyz/wired-protocol). |
23 changes: 23 additions & 0 deletions
23
crates/wired-protocol-proto/protos/world/webrtc/common.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
11 changes: 11 additions & 0 deletions
11
crates/wired-protocol-proto/protos/world/webrtc/request.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
syntax = "proto3"; | ||
|
||
package world.webrtc.request; | ||
|
||
import "world/webrtc/common.proto"; | ||
|
||
message Request { | ||
oneof message { | ||
common.Location publish_location = 1; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
crates/wired-protocol-proto/protos/world/webrtc/response.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
17 changes: 17 additions & 0 deletions
17
crates/wired-protocol-proto/protos/world/websocket/request.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
crates/wired-protocol-proto/protos/world/websocket/response.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
132 changes: 132 additions & 0 deletions
132
crates/wired-protocol-proto/protos/world/websocket/signaling/common.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
33 changes: 33 additions & 0 deletions
33
crates/wired-protocol-proto/protos/world/websocket/signaling/request.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
Oops, something went wrong.