@livekit/protocol 1.52.1 → 1.53.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -79,6 +79,51 @@ export declare enum JobStatus {
79
79
  * @generated from enum value: JS_FAILED = 3;
80
80
  */
81
81
  JS_FAILED = 3,
82
+
83
+ /**
84
+ * the job ended before it was assigned to an agent
85
+ *
86
+ * @generated from enum value: JS_CANCELLED = 4;
87
+ */
88
+ JS_CANCELLED = 4,
89
+ }
90
+
91
+ /**
92
+ * @generated from enum livekit.JobStateReason
93
+ */
94
+ export declare enum JobStateReason {
95
+ /**
96
+ * @generated from enum value: JSR_UNSPECIFIED = 0;
97
+ */
98
+ JSR_UNSPECIFIED = 0,
99
+
100
+ /**
101
+ * no agent was available to accept the job
102
+ *
103
+ * @generated from enum value: JSR_NO_CAPACITY = 1;
104
+ */
105
+ JSR_NO_CAPACITY = 1,
106
+
107
+ /**
108
+ * the room closed before an agent was assigned
109
+ *
110
+ * @generated from enum value: JSR_ROOM_CLOSED = 2;
111
+ */
112
+ JSR_ROOM_CLOSED = 2,
113
+
114
+ /**
115
+ * the dispatch was deleted before an agent was assigned
116
+ *
117
+ * @generated from enum value: JSR_DISPATCH_DELETED = 3;
118
+ */
119
+ JSR_DISPATCH_DELETED = 3,
120
+
121
+ /**
122
+ * the job failed and is being dispatched again
123
+ *
124
+ * @generated from enum value: JSR_RETRYING = 4;
125
+ */
126
+ JSR_RETRYING = 4,
82
127
  }
83
128
 
84
129
  /**
@@ -210,6 +255,13 @@ export declare class JobState extends Message<JobState> {
210
255
  */
211
256
  agentId: string;
212
257
 
258
+ /**
259
+ * why the job has no agent, for JS_PENDING and JS_CANCELLED jobs
260
+ *
261
+ * @generated from field: livekit.JobStateReason reason = 9;
262
+ */
263
+ reason: JobStateReason;
264
+
213
265
  constructor(data?: PartialMessage<JobState>);
214
266
 
215
267
  static readonly runtime: typeof proto3;
@@ -344,6 +396,15 @@ export declare class ServerMessage extends Message<ServerMessage> {
344
396
  */
345
397
  value: WorkerPong;
346
398
  case: "pong";
399
+ } | {
400
+ /**
401
+ * the server is draining this control connection: re-register elsewhere,
402
+ * in-flight agent HTTP streams run to completion
403
+ *
404
+ * @generated from field: livekit.AgentHttp.GoAway go_away = 6;
405
+ */
406
+ value: AgentHttp_GoAway;
407
+ case: "goAway";
347
408
  } | { case: undefined; value?: undefined };
348
409
 
349
410
  constructor(data?: PartialMessage<ServerMessage>);
@@ -463,15 +524,11 @@ export declare class RegisterWorkerRequest extends Message<RegisterWorkerRequest
463
524
  agentName: string;
464
525
 
465
526
  /**
466
- * string worker_id = 2;
467
- *
468
527
  * @generated from field: string version = 3;
469
528
  */
470
529
  version: string;
471
530
 
472
531
  /**
473
- * string name = 4 [deprecated = true];
474
- *
475
532
  * @generated from field: uint32 ping_interval = 5;
476
533
  */
477
534
  pingInterval: number;
@@ -491,6 +548,29 @@ export declare class RegisterWorkerRequest extends Message<RegisterWorkerRequest
491
548
  */
492
549
  deployment: string;
493
550
 
551
+ /**
552
+ * HTTP endpoints this worker serves through the data plane, in route order.
553
+ * Empty means the worker exposes no endpoints and needs no data connections.
554
+ *
555
+ * @generated from field: repeated livekit.AgentHttp.AgentEndpoint endpoints = 10;
556
+ */
557
+ endpoints: AgentHttp_AgentEndpoint[];
558
+
559
+ /**
560
+ * random per process; a re-registration with a new instance_id supersedes the
561
+ * previous epoch and closes its remaining connections
562
+ *
563
+ * @generated from field: string instance_id = 11;
564
+ */
565
+ instanceId: string;
566
+
567
+ /**
568
+ * highest data-plane protocol version the worker supports; 0 = unsupported
569
+ *
570
+ * @generated from field: uint32 endpoint_protocol = 12;
571
+ */
572
+ endpointProtocol: number;
573
+
494
574
  constructor(data?: PartialMessage<RegisterWorkerRequest>);
495
575
 
496
576
  static readonly runtime: typeof proto3;
@@ -520,6 +600,13 @@ export declare class RegisterWorkerResponse extends Message<RegisterWorkerRespon
520
600
  */
521
601
  serverInfo?: ServerInfo;
522
602
 
603
+ /**
604
+ * present iff the registration carried endpoints and the server supports the data plane
605
+ *
606
+ * @generated from field: livekit.AgentHttp.AgentEndpointSettings endpoint_settings = 4;
607
+ */
608
+ endpointSettings?: AgentHttp_AgentEndpointSettings;
609
+
523
610
  constructor(data?: PartialMessage<RegisterWorkerResponse>);
524
611
 
525
612
  static readonly runtime: typeof proto3;
@@ -546,6 +633,14 @@ export declare class MigrateJobRequest extends Message<MigrateJobRequest> {
546
633
  */
547
634
  jobIds: string[];
548
635
 
636
+ /**
637
+ * the jobs in job_ids as they were assigned, with state.participant_identity
638
+ * set to the identity the worker accepted them with
639
+ *
640
+ * @generated from field: repeated livekit.Job jobs = 3;
641
+ */
642
+ jobs: Job[];
643
+
549
644
  constructor(data?: PartialMessage<MigrateJobRequest>);
550
645
 
551
646
  static readonly runtime: typeof proto3;
@@ -702,8 +797,6 @@ export declare class UpdateWorkerStatus extends Message<UpdateWorkerStatus> {
702
797
  status?: WorkerStatus;
703
798
 
704
799
  /**
705
- * optional string metadata = 2 [deprecated=true];
706
- *
707
800
  * @generated from field: float load = 3;
708
801
  */
709
802
  load: number;
@@ -713,6 +806,21 @@ export declare class UpdateWorkerStatus extends Message<UpdateWorkerStatus> {
713
806
  */
714
807
  jobCount: number;
715
808
 
809
+ /**
810
+ * worker wants no new streams; existing streams run to completion
811
+ *
812
+ * @generated from field: bool draining = 5;
813
+ */
814
+ draining: boolean;
815
+
816
+ /**
817
+ * monotonic per registration; status updates may interleave across connections
818
+ * and a stale report must not regress newer state
819
+ *
820
+ * @generated from field: uint64 seq = 6;
821
+ */
822
+ seq: bigint;
823
+
716
824
  constructor(data?: PartialMessage<UpdateWorkerStatus>);
717
825
 
718
826
  static readonly runtime: typeof proto3;
@@ -786,3 +894,315 @@ export declare class JobTermination extends Message<JobTermination> {
786
894
  static equals(a: JobTermination | PlainMessage<JobTermination> | undefined, b: JobTermination | PlainMessage<JobTermination> | undefined): boolean;
787
895
  }
788
896
 
897
+ /**
898
+ * ----- agent HTTP endpoints data plane -----
899
+ *
900
+ * AgentHttp namespaces the data plane: workers expose HTTP endpoints served at
901
+ * /agents/{agent_name}/{deployment}/{path} without binding any local listener.
902
+ * The worker opens ONE WebTransport (QUIC) session to /agent that carries both
903
+ * its control stream (the same WorkerMessage/ServerMessage exchange as the
904
+ * WebSocket control connection, length-delimited) and every HTTP exchange: the
905
+ * node opens one bidirectional QUIC stream per request. QUIC provides the
906
+ * multiplexing and per-stream flow control, so there is no credit accounting
907
+ * and no attach handshake.
908
+ *
909
+ * Each exchange stream is:
910
+ *
911
+ * [len:u32be][StreamPreamble] the only LiveKit framing
912
+ * [ ... opaque bytes ... ] one HTTP/1.1 exchange, to FIN or RESET_STREAM
913
+ *
914
+ * After the preamble the stream is byte-transparent: the node writes a
915
+ * canonical HTTP/1.1 request and the worker replies with an HTTP/1.1 response,
916
+ * each parsed by whatever HTTP implementation the side already has. A WebSocket
917
+ * upgrade is therefore an ordinary request whose response is a 101, after which
918
+ * the stream is a byte pipe. The protocol evolves by version negotiation at
919
+ * registration, so the preamble carries no version of its own.
920
+ *
921
+ * Bodies use ordinary HTTP/1.1 framing, Content-Length or chunked, and are
922
+ * unbounded: a body may be many gigabytes and must be streamed. Request and
923
+ * response size limits are policy for the layer above.
924
+ *
925
+ * How one direction ends:
926
+ *
927
+ * success end of message per the body's own framing, then FIN.
928
+ * failed mid-body chunked trailer fields x-lk-completion and x-lk-error,
929
+ * in band, so the outcome cannot race the bytes it
930
+ * describes.
931
+ * failed before any RESET_STREAM carrying an HttpStreamResetCode, sound
932
+ * bytes only here, where nothing is in flight.
933
+ *
934
+ * FIN before the body's own framing says it is complete is truncation, and a
935
+ * receiver must surface it as such.
936
+ *
937
+ * The x-lk- header prefix is reserved for this signalling in both directions.
938
+ * A node strips it from client-supplied request headers, so a client cannot
939
+ * forge one, and strips it from responses, so it never reaches the end client.
940
+ *
941
+ * @generated from message livekit.AgentHttp
942
+ */
943
+ export declare class AgentHttp extends Message<AgentHttp> {
944
+ constructor(data?: PartialMessage<AgentHttp>);
945
+
946
+ static readonly runtime: typeof proto3;
947
+ static readonly typeName = "livekit.AgentHttp";
948
+ static readonly fields: FieldList;
949
+
950
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AgentHttp;
951
+
952
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AgentHttp;
953
+
954
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AgentHttp;
955
+
956
+ static equals(a: AgentHttp | PlainMessage<AgentHttp> | undefined, b: AgentHttp | PlainMessage<AgentHttp> | undefined): boolean;
957
+ }
958
+
959
+ /**
960
+ * @generated from enum livekit.AgentHttp.AgentEndpointKind
961
+ */
962
+ export declare enum AgentHttp_AgentEndpointKind {
963
+ /**
964
+ * @generated from enum value: AEK_HTTP = 0;
965
+ */
966
+ AEK_HTTP = 0,
967
+
968
+ /**
969
+ * reserved for future text-mode endpoints
970
+ *
971
+ * @generated from enum value: AEK_TEXT = 1;
972
+ */
973
+ AEK_TEXT = 1,
974
+ }
975
+
976
+ /**
977
+ * why a stream was reset before any HTTP bytes flowed. This travels as the
978
+ * QUIC RESET_STREAM / STOP_SENDING error code, so it is a number with no room
979
+ * for detail: the reason string is logged by the side that reset and joined
980
+ * to this by request_id. An outcome after bytes have flowed travels in
981
+ * trailers instead, where it cannot race them.
982
+ *
983
+ * @generated from enum livekit.AgentHttp.HttpStreamResetCode
984
+ */
985
+ export declare enum AgentHttp_HttpStreamResetCode {
986
+ /**
987
+ * no information. The ordinary cancel code, sent whenever a stream is torn
988
+ * down without a specific outcome, so it must stay the zero value and must
989
+ * not imply that anything was or was not applied.
990
+ *
991
+ * @generated from enum value: HSR_ABORT = 0;
992
+ */
993
+ HSR_ABORT = 0,
994
+
995
+ /**
996
+ * the worker aborted before any application code observed the request, so
997
+ * nothing was applied and the exchange is safe to retry. Requires that the
998
+ * application was never entered; a 404 it returned is an ordinary response.
999
+ *
1000
+ * @generated from enum value: HSR_REFUSED = 1;
1001
+ */
1002
+ HSR_REFUSED = 1,
1003
+
1004
+ /**
1005
+ * the application was entered and then failed before producing a response
1006
+ * head; side effects may already have happened, so this is not safe to
1007
+ * retry.
1008
+ *
1009
+ * @generated from enum value: HSR_INTERNAL = 2;
1010
+ */
1011
+ HSR_INTERNAL = 2,
1012
+
1013
+ /**
1014
+ * the deadline elapsed before a response head was produced
1015
+ *
1016
+ * @generated from enum value: HSR_TIMEOUT = 3;
1017
+ */
1018
+ HSR_TIMEOUT = 3,
1019
+
1020
+ /**
1021
+ * the peer's bytes were not valid HTTP/1.1
1022
+ *
1023
+ * @generated from enum value: HSR_PROTOCOL = 4;
1024
+ */
1025
+ HSR_PROTOCOL = 4,
1026
+ }
1027
+
1028
+ /**
1029
+ * @generated from message livekit.AgentHttp.AgentEndpoint
1030
+ */
1031
+ export declare class AgentHttp_AgentEndpoint extends Message<AgentHttp_AgentEndpoint> {
1032
+ /**
1033
+ * starlette-style path template rooted at '/': {name} (one segment, default),
1034
+ * {name:int}, {name:float}, {name:uuid} (constrained single segments),
1035
+ * {name:path} (multi-segment). Custom converters are rejected.
1036
+ *
1037
+ * @generated from field: string path = 1;
1038
+ */
1039
+ path: string;
1040
+
1041
+ /**
1042
+ * uppercase, exactly as the application routes them (FastAPI does not imply
1043
+ * HEAD from GET)
1044
+ *
1045
+ * @generated from field: repeated string methods = 2;
1046
+ */
1047
+ methods: string[];
1048
+
1049
+ /**
1050
+ * @generated from field: livekit.AgentHttp.AgentEndpointKind kind = 3;
1051
+ */
1052
+ kind: AgentHttp_AgentEndpointKind;
1053
+
1054
+ /**
1055
+ * reachable without a project token
1056
+ *
1057
+ * @generated from field: bool public = 4;
1058
+ */
1059
+ public: boolean;
1060
+
1061
+ constructor(data?: PartialMessage<AgentHttp_AgentEndpoint>);
1062
+
1063
+ static readonly runtime: typeof proto3;
1064
+ static readonly typeName = "livekit.AgentHttp.AgentEndpoint";
1065
+ static readonly fields: FieldList;
1066
+
1067
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AgentHttp_AgentEndpoint;
1068
+
1069
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AgentHttp_AgentEndpoint;
1070
+
1071
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AgentHttp_AgentEndpoint;
1072
+
1073
+ static equals(a: AgentHttp_AgentEndpoint | PlainMessage<AgentHttp_AgentEndpoint> | undefined, b: AgentHttp_AgentEndpoint | PlainMessage<AgentHttp_AgentEndpoint> | undefined): boolean;
1074
+ }
1075
+
1076
+ /**
1077
+ * registration-level settings negotiated on the control connection, returned
1078
+ * in RegisterWorkerResponse when the worker declares endpoints and the server
1079
+ * supports the data plane.
1080
+ *
1081
+ * @generated from message livekit.AgentHttp.AgentEndpointSettings
1082
+ */
1083
+ export declare class AgentHttp_AgentEndpointSettings extends Message<AgentHttp_AgentEndpointSettings> {
1084
+ /**
1085
+ * the negotiated data-plane protocol version; the worker speaks exactly this
1086
+ * or closes the session
1087
+ *
1088
+ * @generated from field: uint32 protocol = 1;
1089
+ */
1090
+ protocol: number;
1091
+
1092
+ constructor(data?: PartialMessage<AgentHttp_AgentEndpointSettings>);
1093
+
1094
+ static readonly runtime: typeof proto3;
1095
+ static readonly typeName = "livekit.AgentHttp.AgentEndpointSettings";
1096
+ static readonly fields: FieldList;
1097
+
1098
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AgentHttp_AgentEndpointSettings;
1099
+
1100
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AgentHttp_AgentEndpointSettings;
1101
+
1102
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AgentHttp_AgentEndpointSettings;
1103
+
1104
+ static equals(a: AgentHttp_AgentEndpointSettings | PlainMessage<AgentHttp_AgentEndpointSettings> | undefined, b: AgentHttp_AgentEndpointSettings | PlainMessage<AgentHttp_AgentEndpointSettings> | undefined): boolean;
1105
+ }
1106
+
1107
+ /**
1108
+ * the first thing on every exchange stream, node -> worker. It carries only
1109
+ * what the worker cannot derive from the HTTP bytes that follow and what it
1110
+ * must not infer from client-supplied headers - identity above all.
1111
+ *
1112
+ * @generated from message livekit.AgentHttp.StreamPreamble
1113
+ */
1114
+ export declare class AgentHttp_StreamPreamble extends Message<AgentHttp_StreamPreamble> {
1115
+ /**
1116
+ * what the bytes after this preamble are. A field rather than a framing
1117
+ * tag, so a new stream semantic costs no new mechanism.
1118
+ *
1119
+ * @generated from field: livekit.AgentHttp.AgentEndpointKind kind = 1;
1120
+ */
1121
+ kind: AgentHttp_AgentEndpointKind;
1122
+
1123
+ /**
1124
+ * @generated from field: string request_id = 2;
1125
+ */
1126
+ requestId: string;
1127
+
1128
+ /**
1129
+ * the caller holds agent-endpoint call permission for this agent and
1130
+ * deployment. Always true on a non-public route.
1131
+ *
1132
+ * @generated from field: bool authorized = 3;
1133
+ */
1134
+ authorized: boolean;
1135
+
1136
+ /**
1137
+ * the manifest template that matched, e.g. "/items/{id}"
1138
+ *
1139
+ * @generated from field: string route = 4;
1140
+ */
1141
+ route: string;
1142
+
1143
+ /**
1144
+ * relative, because node and worker clocks are not synchronized. 0 imposes
1145
+ * no deadline.
1146
+ *
1147
+ * @generated from field: uint32 timeout_ms = 5;
1148
+ */
1149
+ timeoutMs: number;
1150
+
1151
+ /**
1152
+ * end client address, host only
1153
+ *
1154
+ * @generated from field: string client_addr = 6;
1155
+ */
1156
+ clientAddr: string;
1157
+
1158
+ /**
1159
+ * "http" or "https" as the end client saw it; not derivable worker-side
1160
+ *
1161
+ * NEXT_ID: 8
1162
+ *
1163
+ * @generated from field: string scheme = 7;
1164
+ */
1165
+ scheme: string;
1166
+
1167
+ constructor(data?: PartialMessage<AgentHttp_StreamPreamble>);
1168
+
1169
+ static readonly runtime: typeof proto3;
1170
+ static readonly typeName = "livekit.AgentHttp.StreamPreamble";
1171
+ static readonly fields: FieldList;
1172
+
1173
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AgentHttp_StreamPreamble;
1174
+
1175
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AgentHttp_StreamPreamble;
1176
+
1177
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AgentHttp_StreamPreamble;
1178
+
1179
+ static equals(a: AgentHttp_StreamPreamble | PlainMessage<AgentHttp_StreamPreamble> | undefined, b: AgentHttp_StreamPreamble | PlainMessage<AgentHttp_StreamPreamble> | undefined): boolean;
1180
+ }
1181
+
1182
+ /**
1183
+ * the server is draining: the worker should re-register elsewhere; in-flight
1184
+ * HTTP exchanges run to completion
1185
+ *
1186
+ * @generated from message livekit.AgentHttp.GoAway
1187
+ */
1188
+ export declare class AgentHttp_GoAway extends Message<AgentHttp_GoAway> {
1189
+ /**
1190
+ * @generated from field: string reason = 1;
1191
+ */
1192
+ reason: string;
1193
+
1194
+ constructor(data?: PartialMessage<AgentHttp_GoAway>);
1195
+
1196
+ static readonly runtime: typeof proto3;
1197
+ static readonly typeName = "livekit.AgentHttp.GoAway";
1198
+ static readonly fields: FieldList;
1199
+
1200
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): AgentHttp_GoAway;
1201
+
1202
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): AgentHttp_GoAway;
1203
+
1204
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AgentHttp_GoAway;
1205
+
1206
+ static equals(a: AgentHttp_GoAway | PlainMessage<AgentHttp_GoAway> | undefined, b: AgentHttp_GoAway | PlainMessage<AgentHttp_GoAway> | undefined): boolean;
1207
+ }
1208
+