-
Notifications
You must be signed in to change notification settings - Fork 76
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
2 changed files
with
117 additions
and
0 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
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,114 @@ | ||
// 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 "google/protobuf/timestamp.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_PARTICIPANT = 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; | ||
// name of pool for the worker. each job is given to a single worker in each pool | ||
string pool = 2; | ||
string worker_id = 3; | ||
string version = 4; | ||
string name = 5; | ||
} | ||
|
||
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; | ||
} |