forked from livekit/protocol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
livekit_agent.proto
111 lines (94 loc) · 2.6 KB
/
livekit_agent.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// Copyright 2023 LiveKit, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package livekit;
option go_package = "github.com/livekit/protocol/livekit";
option csharp_namespace = "LiveKit.Proto";
option ruby_package = "LiveKit::Proto";
import "livekit_models.proto";
message AgentInfo {
string id = 1;
string name = 2;
string version = 3;
}
message Job {
string id = 1;
JobType type = 2;
Room room = 3;
optional ParticipantInfo participant = 4;
}
// from Worker to Server
message WorkerMessage {
oneof message {
// agent workers need to register themselves with the server first
RegisterWorkerRequest register = 1;
// worker confirms to server that it's available for a job, or declines it
AvailabilityResponse availability = 2;
// worker can update its status to the server, including taking itself out of the pool
UpdateWorkerStatus status = 3;
JobStatusUpdate job_update = 4;
};
}
// from Server to Worker
message ServerMessage {
oneof message {
// server confirms the registration, from this moment on, the worker is considered active
RegisterWorkerResponse register = 1;
// server asks worker to confirm availability for a job
AvailabilityRequest availability = 2;
JobAssignment assignment = 3;
}
}
enum JobType {
JT_ROOM = 0;
JT_PUBLISHER = 1;
}
enum WorkerStatus {
WS_AVAILABLE = 0;
WS_FULL = 1;
}
enum JobStatus {
JS_UNKNOWN = 0;
JS_SUCCESS = 1;
JS_FAILED = 2;
}
message RegisterWorkerRequest {
JobType type = 1;
string worker_id = 2;
string version = 3;
string name = 4;
}
message RegisterWorkerResponse {
string worker_id = 1;
string server_version = 2;
}
message AvailabilityRequest {
Job job = 1;
}
message AvailabilityResponse {
string job_id = 1;
bool available = 2;
}
message JobStatusUpdate {
string job_id = 1;
JobStatus status = 2;
string error = 3;
string user_data = 4;
}
message JobAssignment {
Job job = 1;
}
message UpdateWorkerStatus {
WorkerStatus status = 1;
}