@ankorcs/protocol 0.0.0-stage → 0.6.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.
@@ -0,0 +1,3927 @@
1
+ /**
2
+ * Outbound agent WebSocket authenticated by bearer token.
3
+ *
4
+ * Requests carry `id`. A reply echoes it in `reply_to` and names the request's `type` in `request`.
5
+ * Unsolicited frames omit correlation fields.
6
+ */
7
+ import { z } from 'zod';
8
+ /** The `code` of a failed {@link AgentReply | reply}. `detail` carries the human-readable rest. */
9
+ export declare const AGENT_ERRORS: {
10
+ /** No slot is idle, unreserved and on a token Steam has not refused. */
11
+ readonly noFreeSlot: "no_free_slot";
12
+ /**
13
+ * A newer public CS2 build is out and the node has not updated to it yet, so its `cs2.build_id`
14
+ * is behind `cs2.latest_build_id`. The node takes launches again once it has updated. A node
15
+ * whose `auto_update` is `false` never refuses with this.
16
+ */
17
+ readonly cs2Outdated: "cs2_outdated";
18
+ /**
19
+ * CS2 is not installed on the node, so its `cs2.build_id` is `null`. The node takes launches once
20
+ * an {@link ControllerUpdateCs2 | update_cs2} has installed it.
21
+ */
22
+ readonly cs2NotInstalled: "cs2_not_installed";
23
+ /** The node reports `unavailable` for a reason other than `maintenance`. */
24
+ readonly nodeUnavailable: "node_unavailable";
25
+ /**
26
+ * An operation that needs every slot idle found one held: {@link ControllerUpdateCs2 | update_cs2}, or a
27
+ * {@link ControllerSetConfig | set_config} that changes any key under `controller`.
28
+ */
29
+ readonly slotsHeld: "slots_held";
30
+ /**
31
+ * A slot holds a server that is `starting`, `running` or `stopping`, and
32
+ * {@link ControllerSetConfig | set_config} would remove or re-port the slot or give its server's token
33
+ * to another slot, or {@link ControllerReserveSlot | reserve_slot} asked for it. `detail` names the
34
+ * slots.
35
+ */
36
+ readonly slotHeld: "slot_held";
37
+ /** The node has no slot with that id. */
38
+ readonly unknownSlot: "unknown_slot";
39
+ /**
40
+ * {@link ControllerSetConfig | set_config} kept the token of a slot the node does not have yet. A new
41
+ * slot needs a new token.
42
+ */
43
+ readonly slotTokenRequired: "slot_token_required";
44
+ /**
45
+ * {@link ControllerSetConfig | set_config} kept the value of a demo upload header the node does not
46
+ * send. A new header needs its value.
47
+ */
48
+ readonly demoHeaderValueRequired: "demo_header_value_required";
49
+ /** No server with that allocation id. */
50
+ readonly unknownAllocation: "unknown_allocation";
51
+ /**
52
+ * A maintenance operation runs on the node. That operation is unaffected, and `unavailable` shows
53
+ * it as `maintenance`.
54
+ */
55
+ readonly maintenanceRunning: "maintenance_running";
56
+ /**
57
+ * The image is not on the node and the request asked for no pull. Asking again with `pull`
58
+ * fetches it.
59
+ */
60
+ readonly imageMissing: "image_missing";
61
+ /**
62
+ * The image is not an official one, and the node's `official_images_only` is on. The node's
63
+ * operator decides which images it runs.
64
+ */
65
+ readonly imageNotAllowed: "image_not_allowed";
66
+ /** The demo is uploading. It can be deleted once the upload ends. */
67
+ readonly demoUploading: "demo_uploading";
68
+ /** The slot has no demo of that name, such as one an upload or a delete has already removed. */
69
+ readonly unknownDemo: "unknown_demo";
70
+ /** The demo is still being recorded. It can be deleted once its server ends the recording. */
71
+ readonly demoRecording: "demo_recording";
72
+ /** The server's plugin is not connected to the agent, or left before it answered. */
73
+ readonly pluginOffline: "plugin_offline";
74
+ /**
75
+ * The plugin did not answer {@link ControllerGetServerStatus | get_server_status},
76
+ * {@link ControllerConsoleCommand | console_command}, {@link ControllerStartMatch | start_match} or
77
+ * {@link ControllerRestoreRound | restore_round} within {@link SERVER_STATUS_TIMEOUT_MS}.
78
+ */
79
+ readonly pluginStatusTimeout: "plugin_status_timeout";
80
+ /** The server runs without a match. */
81
+ readonly noMatch: "no_match";
82
+ /** The match is past its warmup. */
83
+ readonly notInWarmup: "not_in_warmup";
84
+ /** A team has no player connected. */
85
+ readonly teamEmpty: "team_empty";
86
+ /** The match is not live, such as in warmup, during the knife round or after it ended. */
87
+ readonly notLive: "not_live";
88
+ /**
89
+ * The match is in its halftime break, while the sides are about to swap. Ask again once the next
90
+ * round has started.
91
+ */
92
+ readonly atHalftime: "at_halftime";
93
+ /**
94
+ * The node has no backup of the round that {@link ControllerRestoreRound | restore_round} named for that
95
+ * server.
96
+ */
97
+ readonly noBackup: "no_backup";
98
+ /** The request did not match its schema. */
99
+ readonly invalidRequest: "invalid_request";
100
+ /**
101
+ * {@link ControllerStartServer | start_server} named an allocation this node is already launching or
102
+ * running. Its server exists or is on its way, as after a {@link ControllerStartServer | start_server}
103
+ * sent again when its reply was slow.
104
+ */
105
+ readonly allocationInUse: "allocation_in_use";
106
+ /**
107
+ * {@link ControllerStartServer | start_server} named an allocation that this node launched before, among
108
+ * the last {@link REMEMBERED_ALLOCATIONS}. The node files a server's events and demos under its
109
+ * allocation, so every launch needs a new one.
110
+ */
111
+ readonly allocationReused: "allocation_reused";
112
+ /** The agent does not know the request's `type`, or the plugin the command's. */
113
+ readonly unsupportedRequest: "unsupported_request";
114
+ /**
115
+ * The agent is stopping and started no work for the request, as after its
116
+ * {@link AgentShutdown | shutdown}. Send the request again once the node reconnects.
117
+ */
118
+ readonly shuttingDown: "shutting_down";
119
+ /** Any failure that no other code names, such as a Docker failure. */
120
+ readonly failed: "failed";
121
+ };
122
+ /** The `code` of a failed reply, one of the values of {@link AGENT_ERRORS}. */
123
+ export declare const AgentErrorCode: z.ZodEnum<{
124
+ /** No slot is idle, unreserved and on a token Steam has not refused. */
125
+ readonly noFreeSlot: "no_free_slot";
126
+ /**
127
+ * A newer public CS2 build is out and the node has not updated to it yet, so its `cs2.build_id`
128
+ * is behind `cs2.latest_build_id`. The node takes launches again once it has updated. A node
129
+ * whose `auto_update` is `false` never refuses with this.
130
+ */
131
+ readonly cs2Outdated: "cs2_outdated";
132
+ /**
133
+ * CS2 is not installed on the node, so its `cs2.build_id` is `null`. The node takes launches once
134
+ * an {@link ControllerUpdateCs2 | update_cs2} has installed it.
135
+ */
136
+ readonly cs2NotInstalled: "cs2_not_installed";
137
+ /** The node reports `unavailable` for a reason other than `maintenance`. */
138
+ readonly nodeUnavailable: "node_unavailable";
139
+ /**
140
+ * An operation that needs every slot idle found one held: {@link ControllerUpdateCs2 | update_cs2}, or a
141
+ * {@link ControllerSetConfig | set_config} that changes any key under `controller`.
142
+ */
143
+ readonly slotsHeld: "slots_held";
144
+ /**
145
+ * A slot holds a server that is `starting`, `running` or `stopping`, and
146
+ * {@link ControllerSetConfig | set_config} would remove or re-port the slot or give its server's token
147
+ * to another slot, or {@link ControllerReserveSlot | reserve_slot} asked for it. `detail` names the
148
+ * slots.
149
+ */
150
+ readonly slotHeld: "slot_held";
151
+ /** The node has no slot with that id. */
152
+ readonly unknownSlot: "unknown_slot";
153
+ /**
154
+ * {@link ControllerSetConfig | set_config} kept the token of a slot the node does not have yet. A new
155
+ * slot needs a new token.
156
+ */
157
+ readonly slotTokenRequired: "slot_token_required";
158
+ /**
159
+ * {@link ControllerSetConfig | set_config} kept the value of a demo upload header the node does not
160
+ * send. A new header needs its value.
161
+ */
162
+ readonly demoHeaderValueRequired: "demo_header_value_required";
163
+ /** No server with that allocation id. */
164
+ readonly unknownAllocation: "unknown_allocation";
165
+ /**
166
+ * A maintenance operation runs on the node. That operation is unaffected, and `unavailable` shows
167
+ * it as `maintenance`.
168
+ */
169
+ readonly maintenanceRunning: "maintenance_running";
170
+ /**
171
+ * The image is not on the node and the request asked for no pull. Asking again with `pull`
172
+ * fetches it.
173
+ */
174
+ readonly imageMissing: "image_missing";
175
+ /**
176
+ * The image is not an official one, and the node's `official_images_only` is on. The node's
177
+ * operator decides which images it runs.
178
+ */
179
+ readonly imageNotAllowed: "image_not_allowed";
180
+ /** The demo is uploading. It can be deleted once the upload ends. */
181
+ readonly demoUploading: "demo_uploading";
182
+ /** The slot has no demo of that name, such as one an upload or a delete has already removed. */
183
+ readonly unknownDemo: "unknown_demo";
184
+ /** The demo is still being recorded. It can be deleted once its server ends the recording. */
185
+ readonly demoRecording: "demo_recording";
186
+ /** The server's plugin is not connected to the agent, or left before it answered. */
187
+ readonly pluginOffline: "plugin_offline";
188
+ /**
189
+ * The plugin did not answer {@link ControllerGetServerStatus | get_server_status},
190
+ * {@link ControllerConsoleCommand | console_command}, {@link ControllerStartMatch | start_match} or
191
+ * {@link ControllerRestoreRound | restore_round} within {@link SERVER_STATUS_TIMEOUT_MS}.
192
+ */
193
+ readonly pluginStatusTimeout: "plugin_status_timeout";
194
+ /** The server runs without a match. */
195
+ readonly noMatch: "no_match";
196
+ /** The match is past its warmup. */
197
+ readonly notInWarmup: "not_in_warmup";
198
+ /** A team has no player connected. */
199
+ readonly teamEmpty: "team_empty";
200
+ /** The match is not live, such as in warmup, during the knife round or after it ended. */
201
+ readonly notLive: "not_live";
202
+ /**
203
+ * The match is in its halftime break, while the sides are about to swap. Ask again once the next
204
+ * round has started.
205
+ */
206
+ readonly atHalftime: "at_halftime";
207
+ /**
208
+ * The node has no backup of the round that {@link ControllerRestoreRound | restore_round} named for that
209
+ * server.
210
+ */
211
+ readonly noBackup: "no_backup";
212
+ /** The request did not match its schema. */
213
+ readonly invalidRequest: "invalid_request";
214
+ /**
215
+ * {@link ControllerStartServer | start_server} named an allocation this node is already launching or
216
+ * running. Its server exists or is on its way, as after a {@link ControllerStartServer | start_server}
217
+ * sent again when its reply was slow.
218
+ */
219
+ readonly allocationInUse: "allocation_in_use";
220
+ /**
221
+ * {@link ControllerStartServer | start_server} named an allocation that this node launched before, among
222
+ * the last {@link REMEMBERED_ALLOCATIONS}. The node files a server's events and demos under its
223
+ * allocation, so every launch needs a new one.
224
+ */
225
+ readonly allocationReused: "allocation_reused";
226
+ /** The agent does not know the request's `type`, or the plugin the command's. */
227
+ readonly unsupportedRequest: "unsupported_request";
228
+ /**
229
+ * The agent is stopping and started no work for the request, as after its
230
+ * {@link AgentShutdown | shutdown}. Send the request again once the node reconnects.
231
+ */
232
+ readonly shuttingDown: "shutting_down";
233
+ /** Any failure that no other code names, such as a Docker failure. */
234
+ readonly failed: "failed";
235
+ }>;
236
+ export type AgentErrorCode = z.infer<typeof AgentErrorCode>;
237
+ /** Longest `detail` a refused request carries. The agent cuts the message to it. */
238
+ export declare const AGENT_ERROR_DETAIL_MAX_CHARS = 512;
239
+ /** Why a request failed. Branch on `code`. `detail` is for people. */
240
+ export declare const AgentError: z.ZodObject<{
241
+ code: z.ZodEnum<{
242
+ /** No slot is idle, unreserved and on a token Steam has not refused. */
243
+ readonly noFreeSlot: "no_free_slot";
244
+ /**
245
+ * A newer public CS2 build is out and the node has not updated to it yet, so its `cs2.build_id`
246
+ * is behind `cs2.latest_build_id`. The node takes launches again once it has updated. A node
247
+ * whose `auto_update` is `false` never refuses with this.
248
+ */
249
+ readonly cs2Outdated: "cs2_outdated";
250
+ /**
251
+ * CS2 is not installed on the node, so its `cs2.build_id` is `null`. The node takes launches once
252
+ * an {@link ControllerUpdateCs2 | update_cs2} has installed it.
253
+ */
254
+ readonly cs2NotInstalled: "cs2_not_installed";
255
+ /** The node reports `unavailable` for a reason other than `maintenance`. */
256
+ readonly nodeUnavailable: "node_unavailable";
257
+ /**
258
+ * An operation that needs every slot idle found one held: {@link ControllerUpdateCs2 | update_cs2}, or a
259
+ * {@link ControllerSetConfig | set_config} that changes any key under `controller`.
260
+ */
261
+ readonly slotsHeld: "slots_held";
262
+ /**
263
+ * A slot holds a server that is `starting`, `running` or `stopping`, and
264
+ * {@link ControllerSetConfig | set_config} would remove or re-port the slot or give its server's token
265
+ * to another slot, or {@link ControllerReserveSlot | reserve_slot} asked for it. `detail` names the
266
+ * slots.
267
+ */
268
+ readonly slotHeld: "slot_held";
269
+ /** The node has no slot with that id. */
270
+ readonly unknownSlot: "unknown_slot";
271
+ /**
272
+ * {@link ControllerSetConfig | set_config} kept the token of a slot the node does not have yet. A new
273
+ * slot needs a new token.
274
+ */
275
+ readonly slotTokenRequired: "slot_token_required";
276
+ /**
277
+ * {@link ControllerSetConfig | set_config} kept the value of a demo upload header the node does not
278
+ * send. A new header needs its value.
279
+ */
280
+ readonly demoHeaderValueRequired: "demo_header_value_required";
281
+ /** No server with that allocation id. */
282
+ readonly unknownAllocation: "unknown_allocation";
283
+ /**
284
+ * A maintenance operation runs on the node. That operation is unaffected, and `unavailable` shows
285
+ * it as `maintenance`.
286
+ */
287
+ readonly maintenanceRunning: "maintenance_running";
288
+ /**
289
+ * The image is not on the node and the request asked for no pull. Asking again with `pull`
290
+ * fetches it.
291
+ */
292
+ readonly imageMissing: "image_missing";
293
+ /**
294
+ * The image is not an official one, and the node's `official_images_only` is on. The node's
295
+ * operator decides which images it runs.
296
+ */
297
+ readonly imageNotAllowed: "image_not_allowed";
298
+ /** The demo is uploading. It can be deleted once the upload ends. */
299
+ readonly demoUploading: "demo_uploading";
300
+ /** The slot has no demo of that name, such as one an upload or a delete has already removed. */
301
+ readonly unknownDemo: "unknown_demo";
302
+ /** The demo is still being recorded. It can be deleted once its server ends the recording. */
303
+ readonly demoRecording: "demo_recording";
304
+ /** The server's plugin is not connected to the agent, or left before it answered. */
305
+ readonly pluginOffline: "plugin_offline";
306
+ /**
307
+ * The plugin did not answer {@link ControllerGetServerStatus | get_server_status},
308
+ * {@link ControllerConsoleCommand | console_command}, {@link ControllerStartMatch | start_match} or
309
+ * {@link ControllerRestoreRound | restore_round} within {@link SERVER_STATUS_TIMEOUT_MS}.
310
+ */
311
+ readonly pluginStatusTimeout: "plugin_status_timeout";
312
+ /** The server runs without a match. */
313
+ readonly noMatch: "no_match";
314
+ /** The match is past its warmup. */
315
+ readonly notInWarmup: "not_in_warmup";
316
+ /** A team has no player connected. */
317
+ readonly teamEmpty: "team_empty";
318
+ /** The match is not live, such as in warmup, during the knife round or after it ended. */
319
+ readonly notLive: "not_live";
320
+ /**
321
+ * The match is in its halftime break, while the sides are about to swap. Ask again once the next
322
+ * round has started.
323
+ */
324
+ readonly atHalftime: "at_halftime";
325
+ /**
326
+ * The node has no backup of the round that {@link ControllerRestoreRound | restore_round} named for that
327
+ * server.
328
+ */
329
+ readonly noBackup: "no_backup";
330
+ /** The request did not match its schema. */
331
+ readonly invalidRequest: "invalid_request";
332
+ /**
333
+ * {@link ControllerStartServer | start_server} named an allocation this node is already launching or
334
+ * running. Its server exists or is on its way, as after a {@link ControllerStartServer | start_server}
335
+ * sent again when its reply was slow.
336
+ */
337
+ readonly allocationInUse: "allocation_in_use";
338
+ /**
339
+ * {@link ControllerStartServer | start_server} named an allocation that this node launched before, among
340
+ * the last {@link REMEMBERED_ALLOCATIONS}. The node files a server's events and demos under its
341
+ * allocation, so every launch needs a new one.
342
+ */
343
+ readonly allocationReused: "allocation_reused";
344
+ /** The agent does not know the request's `type`, or the plugin the command's. */
345
+ readonly unsupportedRequest: "unsupported_request";
346
+ /**
347
+ * The agent is stopping and started no work for the request, as after its
348
+ * {@link AgentShutdown | shutdown}. Send the request again once the node reconnects.
349
+ */
350
+ readonly shuttingDown: "shutting_down";
351
+ /** Any failure that no other code names, such as a Docker failure. */
352
+ readonly failed: "failed";
353
+ }>;
354
+ detail: z.ZodString;
355
+ }, z.core.$strip>;
356
+ export type AgentError = z.infer<typeof AgentError>;
357
+ /**
358
+ * The {@link ControllerStartServer | start_server} refusals the agent sends before reserving a slot.
359
+ * Nothing started, so another node may take the launch.
360
+ */
361
+ export declare const StartRefusal: z.ZodEnum<{
362
+ no_free_slot: "no_free_slot";
363
+ cs2_outdated: "cs2_outdated";
364
+ cs2_not_installed: "cs2_not_installed";
365
+ node_unavailable: "node_unavailable";
366
+ maintenance_running: "maintenance_running";
367
+ shutting_down: "shutting_down";
368
+ }>;
369
+ export type StartRefusal = z.infer<typeof StartRefusal>;
370
+ /**
371
+ * What a slot is doing.
372
+ *
373
+ * - `idle`: the slot has no server.
374
+ * - `starting`: the slot holds a server that its plugin has not yet reported ready for players with
375
+ * a `server_status` with `ready`. A server that a restarted agent took over starts here too.
376
+ * - `running`: the plugin has reported the server ready.
377
+ * - `stopping`: the server is being stopped.
378
+ */
379
+ export declare const SlotState: z.ZodEnum<{
380
+ idle: "idle";
381
+ starting: "starting";
382
+ running: "running";
383
+ stopping: "stopping";
384
+ }>;
385
+ export type SlotState = z.infer<typeof SlotState>;
386
+ /**
387
+ * Why the agent stopped a server on its own.
388
+ *
389
+ * - `idle_empty`: the server stayed empty for its launch's `idle_shutdown_seconds`.
390
+ * - `config_rejected`: the plugin refused its match config, as `config_error` says.
391
+ * - `start_timeout`: the server was still `starting` {@link START_TIMEOUT_SECONDS} after its
392
+ * launch, or after a restarted agent took it over.
393
+ * - `quit_timeout`: the server was still running {@link QUIT_TIMEOUT_SECONDS} after its plugin sent
394
+ * `quitting`.
395
+ * - `slot_removed`: a restarted agent found the server running on a slot that `agent.yml` no longer
396
+ * has.
397
+ */
398
+ export declare const AgentStopReason: z.ZodEnum<{
399
+ idle_empty: "idle_empty";
400
+ config_rejected: "config_rejected";
401
+ start_timeout: "start_timeout";
402
+ quit_timeout: "quit_timeout";
403
+ slot_removed: "slot_removed";
404
+ }>;
405
+ export type AgentStopReason = z.infer<typeof AgentStopReason>;
406
+ /**
407
+ * Why a server ended: one of the {@link AgentStopReason} values when the agent stopped it on its
408
+ * own, or one of these.
409
+ *
410
+ * - `requested`: a {@link ControllerStopServer | stop_server} from the controller stopped it.
411
+ * - `clean_exit`: it ended on its own with exit code `0`, as after its match or a console `quit`.
412
+ * - `crashed`: it ended on its own with another exit code.
413
+ * - `launch_failed`: its container never started.
414
+ * - `lost`: it ended and the agent did not see how, such as a container removed by hand.
415
+ */
416
+ export declare const ServerExitReason: z.ZodEnum<{
417
+ idle_empty: "idle_empty";
418
+ config_rejected: "config_rejected";
419
+ start_timeout: "start_timeout";
420
+ quit_timeout: "quit_timeout";
421
+ slot_removed: "slot_removed";
422
+ requested: "requested";
423
+ clean_exit: "clean_exit";
424
+ crashed: "crashed";
425
+ launch_failed: "launch_failed";
426
+ lost: "lost";
427
+ }>;
428
+ export type ServerExitReason = z.infer<typeof ServerExitReason>;
429
+ /**
430
+ * A slot as {@link ControllerSetConfig | set_config} asks for it.
431
+ *
432
+ * `gslt` is a new token, which may replace the token of a slot that runs a server. That server
433
+ * keeps the token it started with, and no other slot may use that token until the server ends
434
+ * (`slot_held`). Without `gslt` the slot keeps its current token, so a slot the node does not have
435
+ * yet needs one (`slot_token_required`), and a slot from a {@link AgentHello | hello} can be sent
436
+ * back unchanged.
437
+ */
438
+ export declare const SlotEdit: z.ZodObject<{
439
+ id: z.ZodString;
440
+ port: z.ZodNumber;
441
+ tv_port: z.ZodNumber;
442
+ gslt: z.ZodOptional<z.ZodString>;
443
+ }, z.core.$strip>;
444
+ export type SlotEdit = z.infer<typeof SlotEdit>;
445
+ /** The id Docker gives an image: `sha256:` and 64 hex digits. */
446
+ export declare const ImageId: z.ZodString;
447
+ /** A Steam build id, in decimal. */
448
+ export declare const BuildId: z.ZodString;
449
+ /**
450
+ * One slot as the agent sees it.
451
+ *
452
+ * Rejected when an `idle` slot names an `allocation_id`, a `match_id` or a `server_steam_id`, or
453
+ * when a slot in any other state has no `allocation_id`. It is also rejected when a slot that is
454
+ * not `idle` is `reserved`.
455
+ */
456
+ export declare const SlotStatus: z.ZodObject<{
457
+ slot_id: z.ZodString;
458
+ state: z.ZodEnum<{
459
+ idle: "idle";
460
+ starting: "starting";
461
+ running: "running";
462
+ stopping: "stopping";
463
+ }>;
464
+ allocation_id: z.ZodNullable<z.ZodUUID>;
465
+ match_id: z.ZodNullable<z.ZodUUID>;
466
+ plugin_online: z.ZodBoolean;
467
+ gslt_state: z.ZodEnum<{
468
+ ok: "ok";
469
+ invalid: "invalid";
470
+ unchecked: "unchecked";
471
+ }>;
472
+ reserved: z.ZodBoolean;
473
+ server_steam_id: z.ZodNullable<z.ZodString>;
474
+ }, z.core.$strip>;
475
+ export type SlotStatus = z.infer<typeof SlotStatus>;
476
+ /**
477
+ * The part of `agent.yml` that the controller may edit, as {@link AgentHello | hello} reports it
478
+ * applied.
479
+ */
480
+ export declare const NodeSettings: z.ZodObject<{
481
+ slots: z.ZodArray<z.ZodObject<{
482
+ id: z.ZodString;
483
+ port: z.ZodNumber;
484
+ tv_port: z.ZodNumber;
485
+ gslt_hint: z.ZodString;
486
+ }, z.core.$strip>>;
487
+ pinned_ip: z.ZodNullable<z.ZodString>;
488
+ controller: z.ZodObject<{
489
+ host: z.ZodString;
490
+ tls: z.ZodBoolean;
491
+ socket_path: z.ZodString;
492
+ events_path: z.ZodString;
493
+ }, z.core.$strip>;
494
+ auto_update: z.ZodBoolean;
495
+ demo_upload: z.ZodNullable<z.ZodObject<{
496
+ url: z.ZodURL;
497
+ limit_mbit: z.ZodNullable<z.ZodNumber>;
498
+ header: z.ZodNullable<z.ZodObject<{
499
+ name: z.ZodString;
500
+ value_sha256: z.ZodString;
501
+ }, z.core.$strip>>;
502
+ }, z.core.$strip>>;
503
+ memory_mb: z.ZodNullable<z.ZodNumber>;
504
+ }, z.core.$strip>;
505
+ export type NodeSettings = z.infer<typeof NodeSettings>;
506
+ /**
507
+ * {@link NodeSettings} as {@link ControllerSetConfig | set_config} asks for them. A missing field keeps
508
+ * the node's value. Null is a value, as {@link NodeSettings} describes. `slots`, when present, is
509
+ * the whole layout.
510
+ */
511
+ export declare const NodeSettingsEdit: z.ZodObject<{
512
+ pinned_ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
513
+ controller: z.ZodOptional<z.ZodObject<{
514
+ host: z.ZodString;
515
+ tls: z.ZodBoolean;
516
+ socket_path: z.ZodString;
517
+ events_path: z.ZodString;
518
+ }, z.core.$strip>>;
519
+ auto_update: z.ZodOptional<z.ZodBoolean>;
520
+ memory_mb: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
521
+ slots: z.ZodOptional<z.ZodArray<z.ZodObject<{
522
+ id: z.ZodString;
523
+ port: z.ZodNumber;
524
+ tv_port: z.ZodNumber;
525
+ gslt: z.ZodOptional<z.ZodString>;
526
+ }, z.core.$strip>>>;
527
+ demo_upload: z.ZodOptional<z.ZodNullable<z.ZodObject<{
528
+ url: z.ZodURL;
529
+ limit_mbit: z.ZodNullable<z.ZodNumber>;
530
+ header: z.ZodNullable<z.ZodObject<{
531
+ name: z.ZodString;
532
+ value: z.ZodOptional<z.ZodString>;
533
+ }, z.core.$strip>>;
534
+ }, z.core.$strip>>>;
535
+ }, z.core.$strip>;
536
+ export type NodeSettingsEdit = z.infer<typeof NodeSettingsEdit>;
537
+ /** Longer os-release names are cut to this many characters. */
538
+ export declare const OS_NAME_MAX_CHARS = 256;
539
+ /** Longest demo file name a node reports, `.dem` included. */
540
+ export declare const DEMO_FILE_NAME_MAX_CHARS = 160;
541
+ /**
542
+ * A demo's file name, as it sits in its launch's directory, `demos/<allocation_id>/` in its slot.
543
+ */
544
+ export declare const DemoFileName: z.ZodString;
545
+ /** Longest `upload_error` a demo carries. The agent cuts the failure's message to it. */
546
+ export declare const DEMO_UPLOAD_ERROR_MAX_CHARS = 512;
547
+ /** A demo kept on the node. */
548
+ export declare const DemoFile: z.ZodObject<{
549
+ slot_id: z.ZodString;
550
+ file_name: z.ZodString;
551
+ size_bytes: z.ZodNumber;
552
+ modified_at: z.ZodNumber;
553
+ recording: z.ZodBoolean;
554
+ uploading: z.ZodBoolean;
555
+ upload_error: z.ZodNullable<z.ZodString>;
556
+ }, z.core.$strip>;
557
+ export type DemoFile = z.infer<typeof DemoFile>;
558
+ /** Longer reasons a node cannot run servers are cut to this many characters. */
559
+ export declare const NODE_UNAVAILABLE_DETAIL_MAX_CHARS = 512;
560
+ /** Free space a node needs on its data disk to take launches, in bytes. */
561
+ export declare const DISK_SPACE_MIN_BYTES: number;
562
+ /** Why a node cannot run servers. */
563
+ export declare const NODE_UNAVAILABLE: {
564
+ /** The {@link MaintenanceOperation} in `operation` runs. It clears when the operation ends. */
565
+ readonly maintenance: "maintenance";
566
+ /**
567
+ * The agent cannot use the local store that keeps gameplay events until the controller takes
568
+ * them. `detail` says why.
569
+ * - If a call to the store waits past its limit, as on a disk that hangs, the code clears once
570
+ * the store answers. Deleting the store or restarting the agent loses what waits to be written.
571
+ * - If the agent cannot open the store, such as one that a newer agent wrote, a corrupt file or
572
+ * one it cannot write, the code lasts until a restart. Update the agent, or delete the store on
573
+ * the host and restart the agent. Deleting it loses the events and server exits it keeps.
574
+ */
575
+ readonly eventStorage: "event_storage";
576
+ /**
577
+ * The disk under the agent's data directory has less than {@link DISK_SPACE_MIN_BYTES} free, too
578
+ * little for a match's events and demo. The agent asks the disk every 30 seconds and before each
579
+ * launch, so the code clears within 30 seconds of space being freed, and a launch that arrives
580
+ * sooner is taken if the disk has room by then.
581
+ */
582
+ readonly diskSpace: "disk_space";
583
+ };
584
+ /** Why a node cannot run servers, one of the values of {@link NODE_UNAVAILABLE}. */
585
+ export declare const NodeUnavailableCode: z.ZodEnum<{
586
+ /** The {@link MaintenanceOperation} in `operation` runs. It clears when the operation ends. */
587
+ readonly maintenance: "maintenance";
588
+ /**
589
+ * The agent cannot use the local store that keeps gameplay events until the controller takes
590
+ * them. `detail` says why.
591
+ * - If a call to the store waits past its limit, as on a disk that hangs, the code clears once
592
+ * the store answers. Deleting the store or restarting the agent loses what waits to be written.
593
+ * - If the agent cannot open the store, such as one that a newer agent wrote, a corrupt file or
594
+ * one it cannot write, the code lasts until a restart. Update the agent, or delete the store on
595
+ * the host and restart the agent. Deleting it loses the events and server exits it keeps.
596
+ */
597
+ readonly eventStorage: "event_storage";
598
+ /**
599
+ * The disk under the agent's data directory has less than {@link DISK_SPACE_MIN_BYTES} free, too
600
+ * little for a match's events and demo. The agent asks the disk every 30 seconds and before each
601
+ * launch, so the code clears within 30 seconds of space being freed, and a launch that arrives
602
+ * sooner is taken if the disk has room by then.
603
+ */
604
+ readonly diskSpace: "disk_space";
605
+ }>;
606
+ export type NodeUnavailableCode = z.infer<typeof NodeUnavailableCode>;
607
+ /**
608
+ * The maintenance operation that runs on the node.
609
+ *
610
+ * - `cs2_update`: a CS2 install or update, also one an earlier agent started.
611
+ * - `agent_update`: an {@link ControllerUpdateAgent | update_agent}, until its replacement has proved it
612
+ * stays up.
613
+ * - `cs2_image_update`: an {@link ControllerUpdateCs2Image | update_cs2_image}.
614
+ * - `image_cleanup`: the agent's removal of replaced images when it starts.
615
+ */
616
+ export declare const MaintenanceOperation: z.ZodEnum<{
617
+ cs2_update: "cs2_update";
618
+ agent_update: "agent_update";
619
+ cs2_image_update: "cs2_image_update";
620
+ image_cleanup: "image_cleanup";
621
+ }>;
622
+ export type MaintenanceOperation = z.infer<typeof MaintenanceOperation>;
623
+ /**
624
+ * Why the node cannot run servers now, with `maintenance` first while it lasts. Meanwhile
625
+ * {@link ControllerStartServer | start_server} is refused with `maintenance_running` for `maintenance` and
626
+ * `node_unavailable` otherwise. Everything else works.
627
+ *
628
+ * Rejected when `operation` is null while `code` is `maintenance`, or set while `code` is another
629
+ * value.
630
+ */
631
+ export declare const NodeUnavailable: z.ZodObject<{
632
+ code: z.ZodEnum<{
633
+ /** The {@link MaintenanceOperation} in `operation` runs. It clears when the operation ends. */
634
+ readonly maintenance: "maintenance";
635
+ /**
636
+ * The agent cannot use the local store that keeps gameplay events until the controller takes
637
+ * them. `detail` says why.
638
+ * - If a call to the store waits past its limit, as on a disk that hangs, the code clears once
639
+ * the store answers. Deleting the store or restarting the agent loses what waits to be written.
640
+ * - If the agent cannot open the store, such as one that a newer agent wrote, a corrupt file or
641
+ * one it cannot write, the code lasts until a restart. Update the agent, or delete the store on
642
+ * the host and restart the agent. Deleting it loses the events and server exits it keeps.
643
+ */
644
+ readonly eventStorage: "event_storage";
645
+ /**
646
+ * The disk under the agent's data directory has less than {@link DISK_SPACE_MIN_BYTES} free, too
647
+ * little for a match's events and demo. The agent asks the disk every 30 seconds and before each
648
+ * launch, so the code clears within 30 seconds of space being freed, and a launch that arrives
649
+ * sooner is taken if the disk has room by then.
650
+ */
651
+ readonly diskSpace: "disk_space";
652
+ }>;
653
+ operation: z.ZodNullable<z.ZodEnum<{
654
+ cs2_update: "cs2_update";
655
+ agent_update: "agent_update";
656
+ cs2_image_update: "cs2_image_update";
657
+ image_cleanup: "image_cleanup";
658
+ }>>;
659
+ detail: z.ZodString;
660
+ }, z.core.$strip>;
661
+ export type NodeUnavailable = z.infer<typeof NodeUnavailable>;
662
+ /** The running agent. */
663
+ export declare const AgentInfo: z.ZodObject<{
664
+ version: z.ZodString;
665
+ image: z.ZodString;
666
+ image_id: z.ZodString;
667
+ }, z.core.$strip>;
668
+ export type AgentInfo = z.infer<typeof AgentInfo>;
669
+ /** Longest `detail` an agent update carries. The agent cuts the swap's message to it. */
670
+ export declare const AGENT_UPDATE_DETAIL_MAX_CHARS = 512;
671
+ /**
672
+ * Where an {@link ControllerUpdateAgent | update_agent} or {@link ControllerUpdateCs2Image | update_cs2_image}
673
+ * is.
674
+ *
675
+ * - `pulling`: the image is being pulled.
676
+ * - `switching`: the image is on the node and is put into use. A switch of the agent replaces its
677
+ * container, so the node goes offline and comes back. A switch of the cs2 image extracts its
678
+ * plugin files for future launches.
679
+ */
680
+ export declare const ImageUpdateStep: z.ZodEnum<{
681
+ pulling: "pulling";
682
+ switching: "switching";
683
+ }>;
684
+ export type ImageUpdateStep = z.infer<typeof ImageUpdateStep>;
685
+ /**
686
+ * How an {@link ControllerUpdateAgent | update_agent} ended.
687
+ *
688
+ * - `completed`: the replacement agent stayed up and the old container is removed.
689
+ * - `unchanged`: the node already ran that image, so nothing was swapped.
690
+ * - `pull_failed`: the image could not be pulled, so the node never tried it.
691
+ * - `failed`: the swap did not hold and the old agent was put back, or its helper did not start.
692
+ */
693
+ export declare const AgentUpdateOutcome: z.ZodEnum<{
694
+ failed: "failed";
695
+ completed: "completed";
696
+ unchanged: "unchanged";
697
+ pull_failed: "pull_failed";
698
+ }>;
699
+ export type AgentUpdateOutcome = z.infer<typeof AgentUpdateOutcome>;
700
+ /** An agent update: the one in progress, one this agent saw end, or the last one to fail. */
701
+ export declare const AgentUpdate: z.ZodObject<{
702
+ image: z.ZodString;
703
+ step: z.ZodNullable<z.ZodEnum<{
704
+ pulling: "pulling";
705
+ switching: "switching";
706
+ }>>;
707
+ outcome: z.ZodNullable<z.ZodEnum<{
708
+ failed: "failed";
709
+ completed: "completed";
710
+ unchanged: "unchanged";
711
+ pull_failed: "pull_failed";
712
+ }>>;
713
+ detail: z.ZodNullable<z.ZodString>;
714
+ }, z.core.$strip>;
715
+ export type AgentUpdate = z.infer<typeof AgentUpdate>;
716
+ /** The machine the agent runs on. */
717
+ export declare const HostInfo: z.ZodObject<{
718
+ cpu_count: z.ZodNumber;
719
+ os_name: z.ZodNullable<z.ZodString>;
720
+ kernel: z.ZodString;
721
+ }, z.core.$strip>;
722
+ export type HostInfo = z.infer<typeof HostInfo>;
723
+ /**
724
+ * How thoroughly a CS2 install or update runs.
725
+ *
726
+ * - `update`: downloads what changed.
727
+ * - `verify`: also re-hashes every file.
728
+ * - `reinstall`: wipes the install volume first and downloads all of it.
729
+ */
730
+ export declare const Cs2UpdateMode: z.ZodEnum<{
731
+ update: "update";
732
+ verify: "verify";
733
+ reinstall: "reinstall";
734
+ }>;
735
+ export type Cs2UpdateMode = z.infer<typeof Cs2UpdateMode>;
736
+ /**
737
+ * How a CS2 install or update ended.
738
+ *
739
+ * - `completed`: the game files are installed.
740
+ * - `pull_failed`: the cs2 image could not be pulled.
741
+ * - `overlay_failed`: its addon overlay could not be extracted.
742
+ * - `failed`: any other failure, such as the update container exiting with an error.
743
+ * - `unobserved`: an update container that an earlier agent process started exited, and the agent
744
+ * did not see the exit.
745
+ *
746
+ * An update container that an earlier agent process started reports progress again until it exits.
747
+ * It ends `completed` or `failed` by its exit code, or `unobserved`.
748
+ */
749
+ export declare const Cs2UpdateOutcome: z.ZodEnum<{
750
+ failed: "failed";
751
+ completed: "completed";
752
+ pull_failed: "pull_failed";
753
+ overlay_failed: "overlay_failed";
754
+ unobserved: "unobserved";
755
+ }>;
756
+ export type Cs2UpdateOutcome = z.infer<typeof Cs2UpdateOutcome>;
757
+ /** Longest `detail` a CS2 update carries. The agent cuts the failure's message to it. */
758
+ export declare const CS2_UPDATE_DETAIL_MAX_CHARS = 512;
759
+ /**
760
+ * Chosen by the agent for each CS2 install or update it runs or finds running. A lowercase UUID.
761
+ */
762
+ export declare const UpdateId: z.ZodUUID;
763
+ /**
764
+ * A CS2 install or update on the node: one running, or the last one to end since the agent started.
765
+ */
766
+ export declare const Cs2Update: z.ZodObject<{
767
+ id: z.ZodUUID;
768
+ mode: z.ZodEnum<{
769
+ update: "update";
770
+ verify: "verify";
771
+ reinstall: "reinstall";
772
+ }>;
773
+ automatic: z.ZodBoolean;
774
+ outcome: z.ZodNullable<z.ZodEnum<{
775
+ failed: "failed";
776
+ completed: "completed";
777
+ pull_failed: "pull_failed";
778
+ overlay_failed: "overlay_failed";
779
+ unobserved: "unobserved";
780
+ }>>;
781
+ detail: z.ZodNullable<z.ZodString>;
782
+ }, z.core.$strip>;
783
+ export type Cs2Update = z.infer<typeof Cs2Update>;
784
+ /**
785
+ * How an {@link ControllerUpdateCs2Image | update_cs2_image} ended.
786
+ *
787
+ * - `completed`: future launches use the image.
788
+ * - `pull_failed`: the image could not be pulled.
789
+ * - `overlay_failed`: its addon overlay could not be extracted.
790
+ * - `failed`: anything else, such as the agent not saving the image setting.
791
+ */
792
+ export declare const Cs2ImageUpdateOutcome: z.ZodEnum<{
793
+ failed: "failed";
794
+ completed: "completed";
795
+ pull_failed: "pull_failed";
796
+ overlay_failed: "overlay_failed";
797
+ }>;
798
+ export type Cs2ImageUpdateOutcome = z.infer<typeof Cs2ImageUpdateOutcome>;
799
+ /**
800
+ * A switch of the cs2 image: the one running now, or the last one to end since the agent started.
801
+ */
802
+ export declare const Cs2ImageUpdate: z.ZodObject<{
803
+ image: z.ZodString;
804
+ step: z.ZodNullable<z.ZodEnum<{
805
+ pulling: "pulling";
806
+ switching: "switching";
807
+ }>>;
808
+ outcome: z.ZodNullable<z.ZodEnum<{
809
+ failed: "failed";
810
+ completed: "completed";
811
+ pull_failed: "pull_failed";
812
+ overlay_failed: "overlay_failed";
813
+ }>>;
814
+ detail: z.ZodNullable<z.ZodString>;
815
+ }, z.core.$strip>;
816
+ export type Cs2ImageUpdate = z.infer<typeof Cs2ImageUpdate>;
817
+ /** The node's game install and image. */
818
+ export declare const Cs2State: z.ZodObject<{
819
+ build_id: z.ZodNullable<z.ZodString>;
820
+ latest_build_id: z.ZodNullable<z.ZodString>;
821
+ image: z.ZodString;
822
+ image_id: z.ZodNullable<z.ZodString>;
823
+ update: z.ZodNullable<z.ZodObject<{
824
+ id: z.ZodUUID;
825
+ mode: z.ZodEnum<{
826
+ update: "update";
827
+ verify: "verify";
828
+ reinstall: "reinstall";
829
+ }>;
830
+ automatic: z.ZodBoolean;
831
+ outcome: z.ZodNullable<z.ZodEnum<{
832
+ failed: "failed";
833
+ completed: "completed";
834
+ pull_failed: "pull_failed";
835
+ overlay_failed: "overlay_failed";
836
+ unobserved: "unobserved";
837
+ }>>;
838
+ detail: z.ZodNullable<z.ZodString>;
839
+ }, z.core.$strip>>;
840
+ image_update: z.ZodNullable<z.ZodObject<{
841
+ image: z.ZodString;
842
+ step: z.ZodNullable<z.ZodEnum<{
843
+ pulling: "pulling";
844
+ switching: "switching";
845
+ }>>;
846
+ outcome: z.ZodNullable<z.ZodEnum<{
847
+ failed: "failed";
848
+ completed: "completed";
849
+ pull_failed: "pull_failed";
850
+ overlay_failed: "overlay_failed";
851
+ }>>;
852
+ detail: z.ZodNullable<z.ZodString>;
853
+ }, z.core.$strip>>;
854
+ }, z.core.$strip>;
855
+ export type Cs2State = z.infer<typeof Cs2State>;
856
+ /** An ISO 3166-1 alpha-2 country code: `DK`, `FR`, or `GB` for the United Kingdom. */
857
+ export declare const CountryCode: z.ZodString;
858
+ /** Longest `detail` a server's exit carries. The agent cuts the message to it. */
859
+ export declare const SERVER_EXIT_DETAIL_MAX_CHARS = 512;
860
+ /** A server whose container is gone, and why. */
861
+ export declare const ServerExit: z.ZodObject<{
862
+ slot_id: z.ZodString;
863
+ allocation_id: z.ZodUUID;
864
+ reason: z.ZodEnum<{
865
+ idle_empty: "idle_empty";
866
+ config_rejected: "config_rejected";
867
+ start_timeout: "start_timeout";
868
+ quit_timeout: "quit_timeout";
869
+ slot_removed: "slot_removed";
870
+ requested: "requested";
871
+ clean_exit: "clean_exit";
872
+ crashed: "crashed";
873
+ launch_failed: "launch_failed";
874
+ lost: "lost";
875
+ }>;
876
+ exit_code: z.ZodNullable<z.ZodNumber>;
877
+ detail: z.ZodNullable<z.ZodString>;
878
+ }, z.core.$strip>;
879
+ export type ServerExit = z.infer<typeof ServerExit>;
880
+ /** Longest `reason` an event backlog carries. The agent cuts the failure's message to it. */
881
+ export declare const EVENT_BACKLOG_REASON_MAX_CHARS = 512;
882
+ /** A server whose events wait on the node. */
883
+ export declare const StuckServer: z.ZodObject<{
884
+ allocation_id: z.ZodUUID;
885
+ pending: z.ZodNumber;
886
+ }, z.core.$strip>;
887
+ export type StuckServer = z.infer<typeof StuckServer>;
888
+ /**
889
+ * The events that wait on the node because uploading them fails, as the agent read them. While
890
+ * uploads work, nothing is stuck, so `servers` is empty, the counts are zero and `reason` is
891
+ * `null`.
892
+ *
893
+ * Rejected unless `servers` holds as many entries as `server_count`, or
894
+ * {@link MAX_REPORTED_BACKLOGS} when `server_count` is larger. It is also rejected when
895
+ * `event_count` is below the sum of `pending` over `servers`. A `reason` is rejected when
896
+ * `server_count` is zero, and a null `reason` when it is not.
897
+ */
898
+ export declare const EventBacklog: z.ZodObject<{
899
+ servers: z.ZodArray<z.ZodObject<{
900
+ allocation_id: z.ZodUUID;
901
+ pending: z.ZodNumber;
902
+ }, z.core.$strip>>;
903
+ server_count: z.ZodNumber;
904
+ event_count: z.ZodNumber;
905
+ reason: z.ZodNullable<z.ZodString>;
906
+ }, z.core.$strip>;
907
+ export type EventBacklog = z.infer<typeof EventBacklog>;
908
+ /**
909
+ * A server has ended and its container is gone. Sent ahead of the `idle`
910
+ * {@link AgentSlotStatus | slot_status} of its slot, also for a launch that failed before or while
911
+ * its container started.
912
+ *
913
+ * A server that ended while no connection was welcomed goes in `server_exits` of the next
914
+ * {@link AgentHello | hello} instead. If it ended after that {@link AgentHello | hello} went out,
915
+ * it is sent after the {@link ControllerWelcome | welcome}, ahead of the slot statuses.
916
+ *
917
+ * The agent keeps a {@link AgentServerExited | server_exited} until the socket takes its write,
918
+ * across its restarts, for up to {@link EVENT_SPOOL_RETENTION_MS}, so one may also come again after
919
+ * a restart. One the socket took is not sent again, even if the connection drops before the
920
+ * controller reads it. The agent does not keep them while it cannot open that store, which it reports as
921
+ * `unavailable` with `event_storage`. While the store does not answer, the agent keeps one only
922
+ * once the store answers again. A server that ends while the agent is not running is missing
923
+ * from its next {@link AgentHello | hello}.
924
+ */
925
+ export declare const AgentServerExited: z.ZodObject<{
926
+ slot_id: z.ZodString;
927
+ allocation_id: z.ZodUUID;
928
+ reason: z.ZodEnum<{
929
+ idle_empty: "idle_empty";
930
+ config_rejected: "config_rejected";
931
+ start_timeout: "start_timeout";
932
+ quit_timeout: "quit_timeout";
933
+ slot_removed: "slot_removed";
934
+ requested: "requested";
935
+ clean_exit: "clean_exit";
936
+ crashed: "crashed";
937
+ launch_failed: "launch_failed";
938
+ lost: "lost";
939
+ }>;
940
+ exit_code: z.ZodNullable<z.ZodNumber>;
941
+ detail: z.ZodNullable<z.ZodString>;
942
+ type: z.ZodLiteral<"server_exited">;
943
+ }, z.core.$strip>;
944
+ export type AgentServerExited = z.infer<typeof AgentServerExited>;
945
+ /**
946
+ * The agent's first message on every connection, and sent only then. An applied
947
+ * {@link ControllerSetConfig | set_config} answers with the settings instead.
948
+ *
949
+ * Answer an accepted {@link AgentHello | hello} with {@link ControllerWelcome | welcome}. Until then the
950
+ * agent sends only replies, or a {@link AgentShutdown | shutdown} when it stops. Runtime changes
951
+ * use status messages. Reconnecting never changes the node's configuration.
952
+ *
953
+ * Rejected unless `slot_status` names each slot of `config.slots` once and names no other slot.
954
+ */
955
+ export declare const AgentHello: z.ZodObject<{
956
+ type: z.ZodLiteral<"hello">;
957
+ agent: z.ZodObject<{
958
+ version: z.ZodString;
959
+ image: z.ZodString;
960
+ image_id: z.ZodString;
961
+ }, z.core.$strip>;
962
+ host: z.ZodObject<{
963
+ cpu_count: z.ZodNumber;
964
+ os_name: z.ZodNullable<z.ZodString>;
965
+ kernel: z.ZodString;
966
+ }, z.core.$strip>;
967
+ public_ip: z.ZodNullable<z.ZodString>;
968
+ country: z.ZodNullable<z.ZodString>;
969
+ config: z.ZodObject<{
970
+ slots: z.ZodArray<z.ZodObject<{
971
+ id: z.ZodString;
972
+ port: z.ZodNumber;
973
+ tv_port: z.ZodNumber;
974
+ gslt_hint: z.ZodString;
975
+ }, z.core.$strip>>;
976
+ pinned_ip: z.ZodNullable<z.ZodString>;
977
+ controller: z.ZodObject<{
978
+ host: z.ZodString;
979
+ tls: z.ZodBoolean;
980
+ socket_path: z.ZodString;
981
+ events_path: z.ZodString;
982
+ }, z.core.$strip>;
983
+ auto_update: z.ZodBoolean;
984
+ demo_upload: z.ZodNullable<z.ZodObject<{
985
+ url: z.ZodURL;
986
+ limit_mbit: z.ZodNullable<z.ZodNumber>;
987
+ header: z.ZodNullable<z.ZodObject<{
988
+ name: z.ZodString;
989
+ value_sha256: z.ZodString;
990
+ }, z.core.$strip>>;
991
+ }, z.core.$strip>>;
992
+ memory_mb: z.ZodNullable<z.ZodNumber>;
993
+ }, z.core.$strip>;
994
+ slot_status: z.ZodArray<z.ZodObject<{
995
+ slot_id: z.ZodString;
996
+ state: z.ZodEnum<{
997
+ idle: "idle";
998
+ starting: "starting";
999
+ running: "running";
1000
+ stopping: "stopping";
1001
+ }>;
1002
+ allocation_id: z.ZodNullable<z.ZodUUID>;
1003
+ match_id: z.ZodNullable<z.ZodUUID>;
1004
+ plugin_online: z.ZodBoolean;
1005
+ gslt_state: z.ZodEnum<{
1006
+ ok: "ok";
1007
+ invalid: "invalid";
1008
+ unchecked: "unchecked";
1009
+ }>;
1010
+ reserved: z.ZodBoolean;
1011
+ server_steam_id: z.ZodNullable<z.ZodString>;
1012
+ }, z.core.$strip>>;
1013
+ cs2: z.ZodObject<{
1014
+ build_id: z.ZodNullable<z.ZodString>;
1015
+ latest_build_id: z.ZodNullable<z.ZodString>;
1016
+ image: z.ZodString;
1017
+ image_id: z.ZodNullable<z.ZodString>;
1018
+ update: z.ZodNullable<z.ZodObject<{
1019
+ id: z.ZodUUID;
1020
+ mode: z.ZodEnum<{
1021
+ update: "update";
1022
+ verify: "verify";
1023
+ reinstall: "reinstall";
1024
+ }>;
1025
+ automatic: z.ZodBoolean;
1026
+ outcome: z.ZodNullable<z.ZodEnum<{
1027
+ failed: "failed";
1028
+ completed: "completed";
1029
+ pull_failed: "pull_failed";
1030
+ overlay_failed: "overlay_failed";
1031
+ unobserved: "unobserved";
1032
+ }>>;
1033
+ detail: z.ZodNullable<z.ZodString>;
1034
+ }, z.core.$strip>>;
1035
+ image_update: z.ZodNullable<z.ZodObject<{
1036
+ image: z.ZodString;
1037
+ step: z.ZodNullable<z.ZodEnum<{
1038
+ pulling: "pulling";
1039
+ switching: "switching";
1040
+ }>>;
1041
+ outcome: z.ZodNullable<z.ZodEnum<{
1042
+ failed: "failed";
1043
+ completed: "completed";
1044
+ pull_failed: "pull_failed";
1045
+ overlay_failed: "overlay_failed";
1046
+ }>>;
1047
+ detail: z.ZodNullable<z.ZodString>;
1048
+ }, z.core.$strip>>;
1049
+ }, z.core.$strip>;
1050
+ unavailable: z.ZodNullable<z.ZodObject<{
1051
+ code: z.ZodEnum<{
1052
+ /** The {@link MaintenanceOperation} in `operation` runs. It clears when the operation ends. */
1053
+ readonly maintenance: "maintenance";
1054
+ /**
1055
+ * The agent cannot use the local store that keeps gameplay events until the controller takes
1056
+ * them. `detail` says why.
1057
+ * - If a call to the store waits past its limit, as on a disk that hangs, the code clears once
1058
+ * the store answers. Deleting the store or restarting the agent loses what waits to be written.
1059
+ * - If the agent cannot open the store, such as one that a newer agent wrote, a corrupt file or
1060
+ * one it cannot write, the code lasts until a restart. Update the agent, or delete the store on
1061
+ * the host and restart the agent. Deleting it loses the events and server exits it keeps.
1062
+ */
1063
+ readonly eventStorage: "event_storage";
1064
+ /**
1065
+ * The disk under the agent's data directory has less than {@link DISK_SPACE_MIN_BYTES} free, too
1066
+ * little for a match's events and demo. The agent asks the disk every 30 seconds and before each
1067
+ * launch, so the code clears within 30 seconds of space being freed, and a launch that arrives
1068
+ * sooner is taken if the disk has room by then.
1069
+ */
1070
+ readonly diskSpace: "disk_space";
1071
+ }>;
1072
+ operation: z.ZodNullable<z.ZodEnum<{
1073
+ cs2_update: "cs2_update";
1074
+ agent_update: "agent_update";
1075
+ cs2_image_update: "cs2_image_update";
1076
+ image_cleanup: "image_cleanup";
1077
+ }>>;
1078
+ detail: z.ZodString;
1079
+ }, z.core.$strip>>;
1080
+ demos: z.ZodArray<z.ZodObject<{
1081
+ slot_id: z.ZodString;
1082
+ file_name: z.ZodString;
1083
+ size_bytes: z.ZodNumber;
1084
+ modified_at: z.ZodNumber;
1085
+ recording: z.ZodBoolean;
1086
+ uploading: z.ZodBoolean;
1087
+ upload_error: z.ZodNullable<z.ZodString>;
1088
+ }, z.core.$strip>>;
1089
+ server_exits: z.ZodArray<z.ZodObject<{
1090
+ slot_id: z.ZodString;
1091
+ allocation_id: z.ZodUUID;
1092
+ reason: z.ZodEnum<{
1093
+ idle_empty: "idle_empty";
1094
+ config_rejected: "config_rejected";
1095
+ start_timeout: "start_timeout";
1096
+ quit_timeout: "quit_timeout";
1097
+ slot_removed: "slot_removed";
1098
+ requested: "requested";
1099
+ clean_exit: "clean_exit";
1100
+ crashed: "crashed";
1101
+ launch_failed: "launch_failed";
1102
+ lost: "lost";
1103
+ }>;
1104
+ exit_code: z.ZodNullable<z.ZodNumber>;
1105
+ detail: z.ZodNullable<z.ZodString>;
1106
+ }, z.core.$strip>>;
1107
+ event_backlog: z.ZodObject<{
1108
+ servers: z.ZodArray<z.ZodObject<{
1109
+ allocation_id: z.ZodUUID;
1110
+ pending: z.ZodNumber;
1111
+ }, z.core.$strip>>;
1112
+ server_count: z.ZodNumber;
1113
+ event_count: z.ZodNumber;
1114
+ reason: z.ZodNullable<z.ZodString>;
1115
+ }, z.core.$strip>;
1116
+ agent_update: z.ZodNullable<z.ZodObject<{
1117
+ image: z.ZodString;
1118
+ step: z.ZodNullable<z.ZodEnum<{
1119
+ pulling: "pulling";
1120
+ switching: "switching";
1121
+ }>>;
1122
+ outcome: z.ZodNullable<z.ZodEnum<{
1123
+ failed: "failed";
1124
+ completed: "completed";
1125
+ unchanged: "unchanged";
1126
+ pull_failed: "pull_failed";
1127
+ }>>;
1128
+ detail: z.ZodNullable<z.ZodString>;
1129
+ }, z.core.$strip>>;
1130
+ }, z.core.$strip>;
1131
+ export type AgentHello = z.infer<typeof AgentHello>;
1132
+ /**
1133
+ * Replaces `cs2`, `unavailable` and `agent_update` of the last {@link AgentHello | hello}.
1134
+ *
1135
+ * Sent when they change:
1136
+ *
1137
+ * - When a maintenance operation starts or ends, so also when a CS2 install or update finishes,
1138
+ * whoever started it, or {@link ControllerUpdateCs2Image | update_cs2_image} has switched the image.
1139
+ * - When `agent_update` or `cs2.image_update` moves from `pulling` to `switching`.
1140
+ * - When the newest public build changes.
1141
+ * - When an agent swap that is still proving its replacement ends.
1142
+ *
1143
+ * Each frame is the node's state when it was read, not a step in a history, so a change that is
1144
+ * over before its report reads the state may go unreported.
1145
+ */
1146
+ export declare const AgentNodeStatus: z.ZodObject<{
1147
+ type: z.ZodLiteral<"node_status">;
1148
+ cs2: z.ZodObject<{
1149
+ build_id: z.ZodNullable<z.ZodString>;
1150
+ latest_build_id: z.ZodNullable<z.ZodString>;
1151
+ image: z.ZodString;
1152
+ image_id: z.ZodNullable<z.ZodString>;
1153
+ update: z.ZodNullable<z.ZodObject<{
1154
+ id: z.ZodUUID;
1155
+ mode: z.ZodEnum<{
1156
+ update: "update";
1157
+ verify: "verify";
1158
+ reinstall: "reinstall";
1159
+ }>;
1160
+ automatic: z.ZodBoolean;
1161
+ outcome: z.ZodNullable<z.ZodEnum<{
1162
+ failed: "failed";
1163
+ completed: "completed";
1164
+ pull_failed: "pull_failed";
1165
+ overlay_failed: "overlay_failed";
1166
+ unobserved: "unobserved";
1167
+ }>>;
1168
+ detail: z.ZodNullable<z.ZodString>;
1169
+ }, z.core.$strip>>;
1170
+ image_update: z.ZodNullable<z.ZodObject<{
1171
+ image: z.ZodString;
1172
+ step: z.ZodNullable<z.ZodEnum<{
1173
+ pulling: "pulling";
1174
+ switching: "switching";
1175
+ }>>;
1176
+ outcome: z.ZodNullable<z.ZodEnum<{
1177
+ failed: "failed";
1178
+ completed: "completed";
1179
+ pull_failed: "pull_failed";
1180
+ overlay_failed: "overlay_failed";
1181
+ }>>;
1182
+ detail: z.ZodNullable<z.ZodString>;
1183
+ }, z.core.$strip>>;
1184
+ }, z.core.$strip>;
1185
+ unavailable: z.ZodNullable<z.ZodObject<{
1186
+ code: z.ZodEnum<{
1187
+ /** The {@link MaintenanceOperation} in `operation` runs. It clears when the operation ends. */
1188
+ readonly maintenance: "maintenance";
1189
+ /**
1190
+ * The agent cannot use the local store that keeps gameplay events until the controller takes
1191
+ * them. `detail` says why.
1192
+ * - If a call to the store waits past its limit, as on a disk that hangs, the code clears once
1193
+ * the store answers. Deleting the store or restarting the agent loses what waits to be written.
1194
+ * - If the agent cannot open the store, such as one that a newer agent wrote, a corrupt file or
1195
+ * one it cannot write, the code lasts until a restart. Update the agent, or delete the store on
1196
+ * the host and restart the agent. Deleting it loses the events and server exits it keeps.
1197
+ */
1198
+ readonly eventStorage: "event_storage";
1199
+ /**
1200
+ * The disk under the agent's data directory has less than {@link DISK_SPACE_MIN_BYTES} free, too
1201
+ * little for a match's events and demo. The agent asks the disk every 30 seconds and before each
1202
+ * launch, so the code clears within 30 seconds of space being freed, and a launch that arrives
1203
+ * sooner is taken if the disk has room by then.
1204
+ */
1205
+ readonly diskSpace: "disk_space";
1206
+ }>;
1207
+ operation: z.ZodNullable<z.ZodEnum<{
1208
+ cs2_update: "cs2_update";
1209
+ agent_update: "agent_update";
1210
+ cs2_image_update: "cs2_image_update";
1211
+ image_cleanup: "image_cleanup";
1212
+ }>>;
1213
+ detail: z.ZodString;
1214
+ }, z.core.$strip>>;
1215
+ agent_update: z.ZodNullable<z.ZodObject<{
1216
+ image: z.ZodString;
1217
+ step: z.ZodNullable<z.ZodEnum<{
1218
+ pulling: "pulling";
1219
+ switching: "switching";
1220
+ }>>;
1221
+ outcome: z.ZodNullable<z.ZodEnum<{
1222
+ failed: "failed";
1223
+ completed: "completed";
1224
+ unchanged: "unchanged";
1225
+ pull_failed: "pull_failed";
1226
+ }>>;
1227
+ detail: z.ZodNullable<z.ZodString>;
1228
+ }, z.core.$strip>>;
1229
+ }, z.core.$strip>;
1230
+ export type AgentNodeStatus = z.infer<typeof AgentNodeStatus>;
1231
+ /**
1232
+ * A slot's status changed since the last {@link AgentHello | hello} or
1233
+ * {@link AgentSlotStatus | slot_status} for it. Rejected when it breaks a rule of
1234
+ * {@link SlotStatus}.
1235
+ */
1236
+ export declare const AgentSlotStatus: z.ZodObject<{
1237
+ slot_id: z.ZodString;
1238
+ state: z.ZodEnum<{
1239
+ idle: "idle";
1240
+ starting: "starting";
1241
+ running: "running";
1242
+ stopping: "stopping";
1243
+ }>;
1244
+ allocation_id: z.ZodNullable<z.ZodUUID>;
1245
+ match_id: z.ZodNullable<z.ZodUUID>;
1246
+ plugin_online: z.ZodBoolean;
1247
+ gslt_state: z.ZodEnum<{
1248
+ ok: "ok";
1249
+ invalid: "invalid";
1250
+ unchecked: "unchecked";
1251
+ }>;
1252
+ reserved: z.ZodBoolean;
1253
+ server_steam_id: z.ZodNullable<z.ZodString>;
1254
+ type: z.ZodLiteral<"slot_status">;
1255
+ }, z.core.$strip>;
1256
+ export type AgentSlotStatus = z.infer<typeof AgentSlotStatus>;
1257
+ /** How serious an agent log line is. */
1258
+ export declare const AgentLogLevel: z.ZodEnum<{
1259
+ error: "error";
1260
+ info: "info";
1261
+ warn: "warn";
1262
+ }>;
1263
+ export type AgentLogLevel = z.infer<typeof AgentLogLevel>;
1264
+ /** Longer log lines, from the agent, a server or a CS2 update, are cut to this many characters. */
1265
+ export declare const LOG_LINE_MAX_CHARS = 2000;
1266
+ /** The agent keeps this many lines of its log. */
1267
+ export declare const AGENT_LOG_LINES = 500;
1268
+ /**
1269
+ * The agent keeps this many lines of each server's output and of each CS2 install or update's
1270
+ * output.
1271
+ */
1272
+ export declare const SERVER_LOG_LINES = 2000;
1273
+ /** Servers that ended and whose output the agent still keeps, oldest dropped first. */
1274
+ export declare const ENDED_SERVER_LOGS = 10;
1275
+ /**
1276
+ * CS2 installs and updates that ended and whose output the agent still keeps, oldest dropped first.
1277
+ */
1278
+ export declare const ENDED_UPDATE_LOGS = 1;
1279
+ /**
1280
+ * A {@link AgentLogBatch | log_batch} stays under this many bytes of JSON, so a replay spans as
1281
+ * many frames as it needs.
1282
+ */
1283
+ export declare const LOG_BATCH_MAX_BYTES: number;
1284
+ /**
1285
+ * One log of a node: the agent's log, one CS2 install or update's output, or one server's output.
1286
+ */
1287
+ export declare const LogSource: z.ZodDiscriminatedUnion<[z.ZodObject<{
1288
+ kind: z.ZodLiteral<"agent">;
1289
+ }, z.core.$strip>, z.ZodObject<{
1290
+ kind: z.ZodLiteral<"cs2_update">;
1291
+ update_id: z.ZodUUID;
1292
+ }, z.core.$strip>, z.ZodObject<{
1293
+ kind: z.ZodLiteral<"server">;
1294
+ allocation_id: z.ZodUUID;
1295
+ }, z.core.$strip>], "kind">;
1296
+ export type LogSource = z.infer<typeof LogSource>;
1297
+ /** One log line. */
1298
+ export declare const LogLine: z.ZodObject<{
1299
+ at: z.ZodNumber;
1300
+ level: z.ZodNullable<z.ZodEnum<{
1301
+ error: "error";
1302
+ info: "info";
1303
+ warn: "warn";
1304
+ }>>;
1305
+ line: z.ZodString;
1306
+ }, z.core.$strip>;
1307
+ export type LogLine = z.infer<typeof LogLine>;
1308
+ /** Identifies one watcher's replay, so the frames answering it reach only that watcher. */
1309
+ export declare const ReplayId: z.ZodString;
1310
+ /**
1311
+ * One source's lines, sent only while a {@link ControllerWatchLogs | watch_logs} holds the lease of that
1312
+ * source. A replay of the source starts with `reset` and may span several frames. Between replays,
1313
+ * new lines follow in batches. A replay larger than the remaining log budget of the agent leaves
1314
+ * out the oldest lines.
1315
+ */
1316
+ export declare const AgentLogBatch: z.ZodObject<{
1317
+ type: z.ZodLiteral<"log_batch">;
1318
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1319
+ kind: z.ZodLiteral<"agent">;
1320
+ }, z.core.$strip>, z.ZodObject<{
1321
+ kind: z.ZodLiteral<"cs2_update">;
1322
+ update_id: z.ZodUUID;
1323
+ }, z.core.$strip>, z.ZodObject<{
1324
+ kind: z.ZodLiteral<"server">;
1325
+ allocation_id: z.ZodUUID;
1326
+ }, z.core.$strip>], "kind">;
1327
+ replay_id: z.ZodNullable<z.ZodString>;
1328
+ reset: z.ZodBoolean;
1329
+ lines: z.ZodArray<z.ZodObject<{
1330
+ at: z.ZodNumber;
1331
+ level: z.ZodNullable<z.ZodEnum<{
1332
+ error: "error";
1333
+ info: "info";
1334
+ warn: "warn";
1335
+ }>>;
1336
+ line: z.ZodString;
1337
+ }, z.core.$strip>>;
1338
+ }, z.core.$strip>;
1339
+ export type AgentLogBatch = z.infer<typeof AgentLogBatch>;
1340
+ /** One source the agent keeps. */
1341
+ export declare const LogSourceSummary: z.ZodObject<{
1342
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1343
+ kind: z.ZodLiteral<"agent">;
1344
+ }, z.core.$strip>, z.ZodObject<{
1345
+ kind: z.ZodLiteral<"cs2_update">;
1346
+ update_id: z.ZodUUID;
1347
+ }, z.core.$strip>, z.ZodObject<{
1348
+ kind: z.ZodLiteral<"server">;
1349
+ allocation_id: z.ZodUUID;
1350
+ }, z.core.$strip>], "kind">;
1351
+ line_count: z.ZodNumber;
1352
+ last_line_at: z.ZodNullable<z.ZodNumber>;
1353
+ ended: z.ZodBoolean;
1354
+ }, z.core.$strip>;
1355
+ export type LogSourceSummary = z.infer<typeof LogSourceSummary>;
1356
+ /**
1357
+ * Milliseconds between {@link AgentLogIndex | log_index} frames that only bring counts and
1358
+ * `last_line_at` up to date while lines arrive. A source's newest line shows in an index within
1359
+ * this long.
1360
+ */
1361
+ export declare const LOG_INDEX_REFRESH_MS = 30000;
1362
+ /**
1363
+ * Every source the agent keeps, whole every time: its log, each CS2 install or update running or
1364
+ * among the last {@link ENDED_UPDATE_LOGS} ended, and each server with output, running or among the
1365
+ * last {@link ENDED_SERVER_LOGS} ended.
1366
+ *
1367
+ * Sent while any log lease runs, with each lease that starts and each replay asked for. Also sent
1368
+ * when an update starts or ends, a server's first line arrives, a server ends, or a source's output
1369
+ * is dropped, and every {@link LOG_INDEX_REFRESH_MS} while lines arrive. Counts and `last_line_at`
1370
+ * are as of that frame. A source missing from it is no longer kept.
1371
+ */
1372
+ export declare const AgentLogIndex: z.ZodObject<{
1373
+ type: z.ZodLiteral<"log_index">;
1374
+ sources: z.ZodArray<z.ZodObject<{
1375
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1376
+ kind: z.ZodLiteral<"agent">;
1377
+ }, z.core.$strip>, z.ZodObject<{
1378
+ kind: z.ZodLiteral<"cs2_update">;
1379
+ update_id: z.ZodUUID;
1380
+ }, z.core.$strip>, z.ZodObject<{
1381
+ kind: z.ZodLiteral<"server">;
1382
+ allocation_id: z.ZodUUID;
1383
+ }, z.core.$strip>], "kind">;
1384
+ line_count: z.ZodNumber;
1385
+ last_line_at: z.ZodNullable<z.ZodNumber>;
1386
+ ended: z.ZodBoolean;
1387
+ }, z.core.$strip>>;
1388
+ }, z.core.$strip>;
1389
+ export type AgentLogIndex = z.infer<typeof AgentLogIndex>;
1390
+ /** Longest `message` a CS2 update's progress carries. The agent cuts the line to it. */
1391
+ export declare const CS2_UPDATE_MESSAGE_MAX_CHARS = 512;
1392
+ /**
1393
+ * Progress of a CS2 install or update while it runs. `cs2.update` in
1394
+ * {@link AgentNodeStatus | node_status} says how it ended.
1395
+ */
1396
+ export declare const AgentCs2UpdateProgress: z.ZodObject<{
1397
+ type: z.ZodLiteral<"cs2_update_progress">;
1398
+ update_id: z.ZodUUID;
1399
+ percent: z.ZodNullable<z.ZodNumber>;
1400
+ message: z.ZodString;
1401
+ }, z.core.$strip>;
1402
+ export type AgentCs2UpdateProgress = z.infer<typeof AgentCs2UpdateProgress>;
1403
+ /**
1404
+ * One demo as it is now, sent when it appears or changes: its file, its upload starting or
1405
+ * stopping, or its `upload_error`. It replaces the demo with the same `slot_id` and `file_name`, or
1406
+ * adds it. {@link AgentHello | hello} lists the newest {@link MAX_REPORTED_DEMOS}. A demo that
1407
+ * appears after the {@link AgentHello | hello} is added, however many the node keeps.
1408
+ */
1409
+ export declare const AgentDemo: z.ZodObject<{
1410
+ slot_id: z.ZodString;
1411
+ file_name: z.ZodString;
1412
+ size_bytes: z.ZodNumber;
1413
+ modified_at: z.ZodNumber;
1414
+ recording: z.ZodBoolean;
1415
+ uploading: z.ZodBoolean;
1416
+ upload_error: z.ZodNullable<z.ZodString>;
1417
+ type: z.ZodLiteral<"demo">;
1418
+ }, z.core.$strip>;
1419
+ export type AgentDemo = z.infer<typeof AgentDemo>;
1420
+ /**
1421
+ * Why a demo is no longer on the node.
1422
+ *
1423
+ * - `uploaded`: the target took it and the agent removed it.
1424
+ * - `deleted`: {@link ControllerDeleteDemo | delete_demo} or anything else removed it.
1425
+ */
1426
+ export declare const DemoRemovedReason: z.ZodEnum<{
1427
+ uploaded: "uploaded";
1428
+ deleted: "deleted";
1429
+ }>;
1430
+ export type DemoRemovedReason = z.infer<typeof DemoRemovedReason>;
1431
+ /** A demo that the controller knows of is no longer on the node. */
1432
+ export declare const AgentDemoRemoved: z.ZodObject<{
1433
+ type: z.ZodLiteral<"demo_removed">;
1434
+ slot_id: z.ZodString;
1435
+ file_name: z.ZodString;
1436
+ reason: z.ZodEnum<{
1437
+ uploaded: "uploaded";
1438
+ deleted: "deleted";
1439
+ }>;
1440
+ }, z.core.$strip>;
1441
+ export type AgentDemoRemoved = z.infer<typeof AgentDemoRemoved>;
1442
+ /** How far the uploading demo is, at most once a second while it uploads. */
1443
+ export declare const AgentDemoProgress: z.ZodObject<{
1444
+ type: z.ZodLiteral<"demo_progress">;
1445
+ slot_id: z.ZodString;
1446
+ file_name: z.ZodString;
1447
+ sent_bytes: z.ZodNumber;
1448
+ bytes_per_second: z.ZodNumber;
1449
+ }, z.core.$strip>;
1450
+ export type AgentDemoProgress = z.infer<typeof AgentDemoProgress>;
1451
+ /**
1452
+ * Milliseconds between the agent's pings to the controller. The agent drops the connection when
1453
+ * the last ping went unanswered.
1454
+ */
1455
+ export declare const AGENT_PING_INTERVAL_MS = 30000;
1456
+ /**
1457
+ * Milliseconds an agent may send nothing before the controller drops it, which allows two pings
1458
+ * and slack.
1459
+ */
1460
+ export declare const AGENT_PING_TIMEOUT_MS = 65000;
1461
+ /** Milliseconds each agent dial has to finish the WebSocket upgrade. */
1462
+ export declare const AGENT_HANDSHAKE_TIMEOUT_MS = 10000;
1463
+ /**
1464
+ * Milliseconds of the agent's first redial delay. Each failed attempt doubles it, and a
1465
+ * {@link ControllerWelcome | welcome} or a redial to a new address resets it.
1466
+ */
1467
+ export declare const AGENT_RECONNECT_MIN_MS = 1000;
1468
+ /** Milliseconds of the agent's longest redial delay, before jitter. */
1469
+ export declare const AGENT_RECONNECT_MAX_MS = 30000;
1470
+ /**
1471
+ * Each redial delay is randomised by up to this fraction either way, never below
1472
+ * {@link AGENT_RECONNECT_MIN_MS}.
1473
+ */
1474
+ export declare const AGENT_RECONNECT_JITTER = 0.25;
1475
+ /** Milliseconds between the agent's resource ticks, taken while it runs, watched or not. */
1476
+ export declare const RESOURCE_TICK_MS = 3000;
1477
+ /** Ticks that the agent holds and the controller shows per node, the newest last. */
1478
+ export declare const RESOURCE_TICKS_HELD = 100;
1479
+ /**
1480
+ * Milliseconds a {@link ControllerWatchResources | watch_resources} or {@link ControllerWatchLogs | watch_logs}
1481
+ * keeps its stream flowing. The next one resets it.
1482
+ */
1483
+ export declare const WATCH_LEASE_MS = 120000;
1484
+ /** A capacity and how much of it is in use, in bytes. */
1485
+ export declare const ResourceUsage: z.ZodObject<{
1486
+ cap: z.ZodNumber;
1487
+ used: z.ZodNumber;
1488
+ }, z.core.$strip>;
1489
+ export type ResourceUsage = z.infer<typeof ResourceUsage>;
1490
+ /** One sample of the node's disk, memory and CPU, taken every {@link RESOURCE_TICK_MS}. */
1491
+ export declare const ResourceTick: z.ZodObject<{
1492
+ at: z.ZodNumber;
1493
+ disk: z.ZodNullable<z.ZodObject<{
1494
+ cap: z.ZodNumber;
1495
+ used: z.ZodNumber;
1496
+ }, z.core.$strip>>;
1497
+ memory: z.ZodObject<{
1498
+ cap: z.ZodNumber;
1499
+ used: z.ZodNumber;
1500
+ }, z.core.$strip>;
1501
+ cpu: z.ZodNullable<z.ZodObject<{
1502
+ max: z.ZodNumber;
1503
+ average: z.ZodNumber;
1504
+ }, z.core.$strip>>;
1505
+ }, z.core.$strip>;
1506
+ export type ResourceTick = z.infer<typeof ResourceTick>;
1507
+ /**
1508
+ * The agent's resource ticks, oldest first. A {@link ControllerWatchResources | watch_resources} lease
1509
+ * that starts receives every tick the agent holds, then each new tick while it runs. The agent
1510
+ * sends nothing while nobody watches, and nothing is stored.
1511
+ */
1512
+ export declare const AgentResourceBatch: z.ZodObject<{
1513
+ type: z.ZodLiteral<"resource_batch">;
1514
+ ticks: z.ZodArray<z.ZodObject<{
1515
+ at: z.ZodNumber;
1516
+ disk: z.ZodNullable<z.ZodObject<{
1517
+ cap: z.ZodNumber;
1518
+ used: z.ZodNumber;
1519
+ }, z.core.$strip>>;
1520
+ memory: z.ZodObject<{
1521
+ cap: z.ZodNumber;
1522
+ used: z.ZodNumber;
1523
+ }, z.core.$strip>;
1524
+ cpu: z.ZodNullable<z.ZodObject<{
1525
+ max: z.ZodNumber;
1526
+ average: z.ZodNumber;
1527
+ }, z.core.$strip>>;
1528
+ }, z.core.$strip>>;
1529
+ reset: z.ZodBoolean;
1530
+ }, z.core.$strip>;
1531
+ export type AgentResourceBatch = z.infer<typeof AgentResourceBatch>;
1532
+ /**
1533
+ * The node's {@link EventBacklog} now, replacing the backlog of the last {@link AgentHello | hello}
1534
+ * or {@link AgentEventBacklog | event_backlog}. Sent when it changes: after each failed upload, as
1535
+ * its counts grow, and once, with nothing stuck, when uploads work again. Rejected when it breaks a
1536
+ * rule of {@link EventBacklog}.
1537
+ */
1538
+ export declare const AgentEventBacklog: z.ZodObject<{
1539
+ servers: z.ZodArray<z.ZodObject<{
1540
+ allocation_id: z.ZodUUID;
1541
+ pending: z.ZodNumber;
1542
+ }, z.core.$strip>>;
1543
+ server_count: z.ZodNumber;
1544
+ event_count: z.ZodNumber;
1545
+ reason: z.ZodNullable<z.ZodString>;
1546
+ type: z.ZodLiteral<"event_backlog">;
1547
+ }, z.core.$strip>;
1548
+ export type AgentEventBacklog = z.infer<typeof AgentEventBacklog>;
1549
+ /**
1550
+ * Milliseconds a stopping agent waits for the requests it is running before it closes the socket,
1551
+ * counted from its {@link AgentShutdown | shutdown}. A request still running then is cut off.
1552
+ */
1553
+ export declare const SHUTDOWN_REQUEST_WAIT_MS = 5000;
1554
+ /**
1555
+ * The agent is stopping cleanly and starts no new work. It answers a request that arrives after
1556
+ * this frame with `shutting_down` at once. Replies to the requests it is running may still follow
1557
+ * for up to {@link SHUTDOWN_REQUEST_WAIT_MS}, and then it closes with code `1000`.
1558
+ *
1559
+ * Send no new requests after it. A request without a reply when the socket closes may or may not
1560
+ * have run; the node's reports after it reconnects say which. Its servers keep running, and the
1561
+ * agent takes them over when it returns. It is sent whether or not the controller has welcomed the
1562
+ * {@link AgentHello | hello}.
1563
+ */
1564
+ export declare const AgentShutdown: z.ZodObject<{
1565
+ type: z.ZodLiteral<"shutdown">;
1566
+ signal: z.ZodEnum<{
1567
+ SIGINT: "SIGINT";
1568
+ SIGTERM: "SIGTERM";
1569
+ SIGQUIT: "SIGQUIT";
1570
+ }>;
1571
+ }, z.core.$strip>;
1572
+ /**
1573
+ * Launch a server on an idle slot the agent picks. The server logs in with the slot's token. The
1574
+ * agent reports the slot `starting` before any container work, so two launches never share one.
1575
+ *
1576
+ * The reply comes once the container has started, before the server is up, and
1577
+ * {@link AgentSlotStatus | slot_status} reports it `running` later. The agent pulls no image here.
1578
+ * A launch on a `cs2_image` whose plugin files the agent has not extracted yet waits while it does.
1579
+ * Refused with:
1580
+ *
1581
+ * - A {@link StartRefusal} when the node cannot take the launch.
1582
+ * - `allocation_in_use` when the node is already launching the allocation or its server holds a
1583
+ * slot.
1584
+ * - `allocation_reused` when the node launched the allocation before.
1585
+ * - `failed` when Docker fails the launch, once its container is gone, after a
1586
+ * {@link AgentServerExited | server_exited} with `launch_failed`.
1587
+ */
1588
+ export declare const ControllerStartServer: z.ZodObject<{
1589
+ allocation_id: z.ZodUUID;
1590
+ launch: z.ZodObject<{
1591
+ hostname: z.ZodDefault<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodString>>>;
1592
+ steam_web_api_key: z.ZodDefault<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>>;
1593
+ game_password: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1594
+ chat_tag: z.ZodPrefault<z.ZodObject<{
1595
+ text: z.ZodDefault<z.ZodString>;
1596
+ color: z.ZodDefault<z.ZodEnum<{
1597
+ white: "white";
1598
+ darkred: "darkred";
1599
+ lightpurple: "lightpurple";
1600
+ green: "green";
1601
+ olive: "olive";
1602
+ lime: "lime";
1603
+ red: "red";
1604
+ gray: "gray";
1605
+ lightyellow: "lightyellow";
1606
+ yellow: "yellow";
1607
+ silver: "silver";
1608
+ bluegrey: "bluegrey";
1609
+ lightblue: "lightblue";
1610
+ blue: "blue";
1611
+ darkblue: "darkblue";
1612
+ purple: "purple";
1613
+ magenta: "magenta";
1614
+ lightred: "lightred";
1615
+ gold: "gold";
1616
+ orange: "orange";
1617
+ }>>;
1618
+ }, z.core.$strip>>;
1619
+ game_mode: z.ZodDefault<z.ZodEnum<{
1620
+ custom: "custom";
1621
+ casual: "casual";
1622
+ competitive: "competitive";
1623
+ wingman: "wingman";
1624
+ rush: "rush";
1625
+ arms_race: "arms_race";
1626
+ demolition: "demolition";
1627
+ deathmatch: "deathmatch";
1628
+ }>>;
1629
+ max_players: z.ZodNumber;
1630
+ workshop_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1631
+ map_name: z.ZodNullable<z.ZodString>;
1632
+ gotv: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1633
+ password: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1634
+ delay_seconds: z.ZodNumber;
1635
+ }, z.core.$strip>>>;
1636
+ idle_shutdown_seconds: z.ZodNullable<z.ZodNumber>;
1637
+ exec: z.ZodArray<z.ZodString>;
1638
+ commands: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodString>>;
1639
+ match: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1640
+ match_id: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
1641
+ send_statistics: z.ZodDefault<z.ZodBoolean>;
1642
+ roster: z.ZodObject<{
1643
+ team1: z.ZodObject<{
1644
+ name: z.ZodString;
1645
+ players: z.ZodArray<z.ZodString>;
1646
+ }, z.core.$strip>;
1647
+ team2: z.ZodObject<{
1648
+ name: z.ZodString;
1649
+ players: z.ZodArray<z.ZodString>;
1650
+ }, z.core.$strip>;
1651
+ spectators: z.ZodArray<z.ZodString>;
1652
+ }, z.core.$strip>;
1653
+ sides: z.ZodEnum<{
1654
+ knife: "knife";
1655
+ team1_ct: "team1_ct";
1656
+ team1_t: "team1_t";
1657
+ }>;
1658
+ knife_decision_seconds: z.ZodDefault<z.ZodNumber>;
1659
+ ready_mode: z.ZodDefault<z.ZodEnum<{
1660
+ auto: "auto";
1661
+ manual: "manual";
1662
+ external: "external";
1663
+ }>>;
1664
+ spectators_ready_up: z.ZodDefault<z.ZodBoolean>;
1665
+ ready_timeout_seconds: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1666
+ record_demo: z.ZodBoolean;
1667
+ debug_capture: z.ZodDefault<z.ZodBoolean>;
1668
+ rules: z.ZodPrefault<z.ZodObject<{
1669
+ max_rounds: z.ZodDefault<z.ZodNumber>;
1670
+ overtime: z.ZodDefault<z.ZodBoolean>;
1671
+ overtime_max_rounds: z.ZodDefault<z.ZodNumber>;
1672
+ friendly_fire: z.ZodDefault<z.ZodBoolean>;
1673
+ }, z.core.$strip>>;
1674
+ restore: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1675
+ team1_side: z.ZodEnum<{
1676
+ t: "t";
1677
+ ct: "ct";
1678
+ }>;
1679
+ rules: z.ZodObject<{
1680
+ max_rounds: z.ZodNumber;
1681
+ overtime: z.ZodBoolean;
1682
+ overtime_max_rounds: z.ZodNumber;
1683
+ friendly_fire: z.ZodBoolean;
1684
+ }, z.core.$strip>;
1685
+ file: z.ZodString;
1686
+ }, z.core.$strip>>>;
1687
+ }, z.core.$strip>>>;
1688
+ }, z.core.$strip>;
1689
+ id: z.ZodString;
1690
+ type: z.ZodLiteral<"start_server">;
1691
+ }, z.core.$strip>;
1692
+ export type ControllerStartServer = z.infer<typeof ControllerStartServer>;
1693
+ /** The server that started, and the slot the agent picked for it. */
1694
+ export declare const StartServerReply: z.ZodObject<{
1695
+ allocation_id: z.ZodUUID;
1696
+ slot_id: z.ZodString;
1697
+ }, z.core.$strip>;
1698
+ export type StartServerReply = z.infer<typeof StartServerReply>;
1699
+ /** Seconds of grace before `SIGKILL` for an ordinary stop. */
1700
+ export declare const STOP_TIMEOUT_SECONDS = 10;
1701
+ /**
1702
+ * Milliseconds the agent waits for an answer from the Docker daemon on its host before it fails the
1703
+ * call. A stop waits its grace on top.
1704
+ */
1705
+ export declare const DOCKER_ANSWER_TIMEOUT_MS = 30000;
1706
+ /**
1707
+ * Seconds a stop's reply may take beyond its grace: Docker's answer to the stop, which the agent
1708
+ * waits for up to {@link DOCKER_ANSWER_TIMEOUT_MS}, and the reply.
1709
+ */
1710
+ export declare const STOP_REPLY_MARGIN_SECONDS = 35;
1711
+ /**
1712
+ * Stop an allocation's server. Once asked, the agent stops it: a stop that Docker fails is answered
1713
+ * with `failed`, and the agent tries it again until the server is gone. The slot stays held until
1714
+ * then.
1715
+ *
1716
+ * The reply comes once its container has stopped: up to {@link STOP_TIMEOUT_SECONDS} before the kill, then up
1717
+ * to {@link STOP_REPLY_MARGIN_SECONDS} seconds for the kill and the reply. A stop during a launch
1718
+ * of the allocation first waits for the launch's current step to end. That step can take minutes on
1719
+ * the first launch after an image switch, which extracts the overlay, so the reply can come after
1720
+ * the session's wait. If the launch is stopped between its steps, it starts no server and its
1721
+ * `start_server` fails. If it is stopped while Docker starts its container, its `start_server`
1722
+ * succeeds and the server is then stopped. Refused with `unknown_allocation` for an allocation the
1723
+ * node does not run.
1724
+ */
1725
+ export declare const ControllerStopServer: z.ZodObject<{
1726
+ id: z.ZodString;
1727
+ type: z.ZodLiteral<"stop_server">;
1728
+ allocation_id: z.ZodUUID;
1729
+ }, z.core.$strip>;
1730
+ /** The server that stopped. */
1731
+ export declare const StopServerReply: z.ZodObject<{
1732
+ allocation_id: z.ZodUUID;
1733
+ }, z.core.$strip>;
1734
+ export type StopServerReply = z.infer<typeof StopServerReply>;
1735
+ /**
1736
+ * Install or update CS2 on the node's shared volume. The first install happens only through this
1737
+ * request.
1738
+ *
1739
+ * The reply comes immediately with the update's id, as {@link UpdateCs2Reply}, and the update runs
1740
+ * after it, which can take tens of minutes. Refused with `slots_held` while any slot is held and
1741
+ * `maintenance_running` while a maintenance operation runs.
1742
+ *
1743
+ * `cs2.update` in {@link AgentNodeStatus | node_status} reports the update from `outcome: null` to
1744
+ * how it ended, a failed pull of the cs2 image included. Meanwhile
1745
+ * {@link AgentCs2UpdateProgress | cs2_update_progress} and {@link AgentLogBatch | log_batch} report
1746
+ * on it, each naming it by that id.
1747
+ *
1748
+ * An installed node also updates itself to `cs2.latest_build_id` once every slot is idle, unless
1749
+ * its `auto_update` is `false`.
1750
+ */
1751
+ export declare const ControllerUpdateCs2: z.ZodObject<{
1752
+ mode: z.ZodEnum<{
1753
+ update: "update";
1754
+ verify: "verify";
1755
+ reinstall: "reinstall";
1756
+ }>;
1757
+ id: z.ZodString;
1758
+ type: z.ZodLiteral<"update_cs2">;
1759
+ }, z.core.$strip>;
1760
+ /** The update an accepted {@link ControllerUpdateCs2 | update_cs2} started. */
1761
+ export declare const UpdateCs2Reply: z.ZodObject<{
1762
+ update_id: z.ZodUUID;
1763
+ }, z.core.$strip>;
1764
+ export type UpdateCs2Reply = z.infer<typeof UpdateCs2Reply>;
1765
+ /**
1766
+ * Read the newest public CS2 build from Steam now instead of at the next scheduled read, which
1767
+ * comes every {@link CS2_BUILD_POLL_INTERVAL_MS}.
1768
+ *
1769
+ * It receives no reply. The agent handles at most one per {@link CS2_BUILD_CHECK_INTERVAL_MS} and
1770
+ * drops any sooner one. One sent during a scheduled read shares it. Neither busy slots nor
1771
+ * maintenance stop it. A changed build arrives as {@link AgentNodeStatus | node_status}, and an
1772
+ * installed node updates to it once every slot is idle, as it always does.
1773
+ */
1774
+ export declare const ControllerCheckCs2Build: z.ZodObject<{
1775
+ type: z.ZodLiteral<"check_cs2_build">;
1776
+ }, z.core.$strip>;
1777
+ /**
1778
+ * Delete one demo by slot and file name.
1779
+ *
1780
+ * The reply comes once the file is removed. Refused with:
1781
+ *
1782
+ * - `unknown_slot` when the node has no directory for the slot.
1783
+ * - `unknown_demo` when the slot has no demo of that name.
1784
+ * - `demo_recording` while its server records the demo.
1785
+ * - `demo_uploading` while the demo uploads.
1786
+ * - `invalid_request` when the name is outside the slot's `demos/` directory.
1787
+ * - `failed` when the removal fails.
1788
+ */
1789
+ export declare const ControllerDeleteDemo: z.ZodObject<{
1790
+ slot_id: z.ZodString;
1791
+ file_name: z.ZodString;
1792
+ id: z.ZodString;
1793
+ type: z.ZodLiteral<"delete_demo">;
1794
+ }, z.core.$strip>;
1795
+ /** The demo that was removed. */
1796
+ export declare const DeleteDemoReply: z.ZodObject<{
1797
+ slot_id: z.ZodString;
1798
+ file_name: z.ZodString;
1799
+ }, z.core.$strip>;
1800
+ export type DeleteDemoReply = z.infer<typeof DeleteDemoReply>;
1801
+ /**
1802
+ * Seconds a {@link ControllerReserveSlot | reserve_slot} lasts, unless a {@link ControllerSetConfig | set_config}
1803
+ * with the slot's new token ends it first.
1804
+ */
1805
+ export declare const SLOT_RESERVATION_SECONDS = 60;
1806
+ /**
1807
+ * Keep an idle slot from launches while the controller replaces its token, so that no server
1808
+ * starts on a token that the controller is about to revoke at Steam.
1809
+ *
1810
+ * The agent marks the slot `reserved` before it replies, the same way a launch marks its slot
1811
+ * `starting`, so no {@link ControllerStartServer | start_server} can take the slot once the reply is sent.
1812
+ * The reply comes immediately. Refused with `slot_held` for a slot holding a server, and with
1813
+ * `unknown_slot` for a slot the node does not have.
1814
+ *
1815
+ * The reservation ends with the {@link ControllerSetConfig | set_config} that gives the slot a new token,
1816
+ * with the slot's removal, after {@link SLOT_RESERVATION_SECONDS}, or with the agent's restart.
1817
+ * Asking again restarts the wait.
1818
+ */
1819
+ export declare const ControllerReserveSlot: z.ZodObject<{
1820
+ slot_id: z.ZodString;
1821
+ id: z.ZodString;
1822
+ type: z.ZodLiteral<"reserve_slot">;
1823
+ }, z.core.$strip>;
1824
+ export type ControllerReserveSlot = z.infer<typeof ControllerReserveSlot>;
1825
+ /** The slot that is reserved. */
1826
+ export declare const ReserveSlotReply: z.ZodObject<{
1827
+ slot_id: z.ZodString;
1828
+ }, z.core.$strip>;
1829
+ export type ReserveSlotReply = z.infer<typeof ReserveSlotReply>;
1830
+ /**
1831
+ * Apply an edit to `agent.yml`, or refuse it without saving any part. Nothing is queued.
1832
+ *
1833
+ * The reply comes once the edit is saved and applied, and carries the node's current settings, the
1834
+ * {@link NodeSettings} that `hello.config` reports. An edit that changes nothing is not saved
1835
+ * again. A slot missing from the reply's `slots` has been removed. Refused with:
1836
+ *
1837
+ * - `slot_held` when the edit would remove or re-port a held slot, or give its server's token to
1838
+ * another slot.
1839
+ * - `slots_held` when the edit changes any key under `controller` (its address, TLS or paths) while any
1840
+ * slot is held.
1841
+ * - `slot_token_required` or `demo_header_value_required` when the edit keeps a value that the
1842
+ * node does not have.
1843
+ * - `invalid_request` when two slots have one token or anything else fails validation.
1844
+ *
1845
+ * After the reply, the agent sends a {@link AgentSlotStatus | slot_status} for each slot that the
1846
+ * edit added or gave a new token. The slot reads `unchecked` until the agent has logged the new
1847
+ * token on to Steam, which the agent starts then unless a server on the node is using the token. A
1848
+ * change to `controller` closes the socket with `1000` once the reply has gone, and the agent sends its
1849
+ * {@link AgentHello | hello} to the new address.
1850
+ *
1851
+ * Required of a controller that hands nodes an `agent.yml` without slots, because it is how they
1852
+ * receive any.
1853
+ */
1854
+ export declare const ControllerSetConfig: z.ZodObject<{
1855
+ config: z.ZodObject<{
1856
+ pinned_ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1857
+ controller: z.ZodOptional<z.ZodObject<{
1858
+ host: z.ZodString;
1859
+ tls: z.ZodBoolean;
1860
+ socket_path: z.ZodString;
1861
+ events_path: z.ZodString;
1862
+ }, z.core.$strip>>;
1863
+ auto_update: z.ZodOptional<z.ZodBoolean>;
1864
+ memory_mb: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1865
+ slots: z.ZodOptional<z.ZodArray<z.ZodObject<{
1866
+ id: z.ZodString;
1867
+ port: z.ZodNumber;
1868
+ tv_port: z.ZodNumber;
1869
+ gslt: z.ZodOptional<z.ZodString>;
1870
+ }, z.core.$strip>>>;
1871
+ demo_upload: z.ZodOptional<z.ZodNullable<z.ZodObject<{
1872
+ url: z.ZodURL;
1873
+ limit_mbit: z.ZodNullable<z.ZodNumber>;
1874
+ header: z.ZodNullable<z.ZodObject<{
1875
+ name: z.ZodString;
1876
+ value: z.ZodOptional<z.ZodString>;
1877
+ }, z.core.$strip>>;
1878
+ }, z.core.$strip>>>;
1879
+ }, z.core.$strip>;
1880
+ id: z.ZodString;
1881
+ type: z.ZodLiteral<"set_config">;
1882
+ }, z.core.$strip>;
1883
+ export type ControllerSetConfig = z.infer<typeof ControllerSetConfig>;
1884
+ /**
1885
+ * Replace the agent container with another image. Running servers keep running.
1886
+ *
1887
+ * The reply comes immediately with what happens next, as {@link UpdateAgentReply}, and
1888
+ * `agent_update` reports the rest: its `step` while it runs, then how it ended. Refused with
1889
+ * `maintenance_running` while a maintenance operation runs, with `image_missing` for an image the
1890
+ * node lacks without `pull`, and with `image_not_allowed` for an image outside the official agent
1891
+ * repository while the node's `official_images_only` is on.
1892
+ *
1893
+ * Switching stops this agent, and the agent that comes up, the new one or the old one put back,
1894
+ * reports how it went. The update counts as a maintenance operation until it ends, and a switch
1895
+ * until its replacement has proved it stays up.
1896
+ */
1897
+ export declare const ControllerUpdateAgent: z.ZodObject<{
1898
+ image: z.ZodString;
1899
+ pull: z.ZodBoolean;
1900
+ id: z.ZodString;
1901
+ type: z.ZodLiteral<"update_agent">;
1902
+ }, z.core.$strip>;
1903
+ /**
1904
+ * What follows an accepted {@link ControllerUpdateAgent | update_agent}: the update's first
1905
+ * {@link ImageUpdateStep}, or `unchanged` when the node runs that image already, as the registry or
1906
+ * the local image says, and nothing more happens.
1907
+ */
1908
+ export declare const UpdateAgentReply: z.ZodObject<{
1909
+ image: z.ZodString;
1910
+ step: z.ZodEnum<{
1911
+ pulling: "pulling";
1912
+ switching: "switching";
1913
+ unchanged: "unchanged";
1914
+ }>;
1915
+ }, z.core.$strip>;
1916
+ export type UpdateAgentReply = z.infer<typeof UpdateAgentReply>;
1917
+ /**
1918
+ * Switch future launches to another cs2 image. Running servers keep theirs, and so does a launch
1919
+ * that took its slot before the switch.
1920
+ *
1921
+ * The reply comes immediately with what happens next, as {@link UpdateCs2ImageReply}. Refused with
1922
+ * `maintenance_running` while a maintenance operation runs, with `image_missing` for an image the
1923
+ * node lacks without `pull`, and with `image_not_allowed` for an image outside the official cs2
1924
+ * repository while the node's `official_images_only` is on.
1925
+ *
1926
+ * The agent then pulls the image when asked to, extracts its plugin files and removes the images
1927
+ * it supersedes. `cs2.image_update` in {@link AgentNodeStatus | node_status} reports its `step`
1928
+ * while it runs, then how it ended, in the same {@link AgentNodeStatus | node_status} as the new
1929
+ * `cs2.image`.
1930
+ */
1931
+ export declare const ControllerUpdateCs2Image: z.ZodObject<{
1932
+ image: z.ZodString;
1933
+ pull: z.ZodBoolean;
1934
+ id: z.ZodString;
1935
+ type: z.ZodLiteral<"update_cs2_image">;
1936
+ }, z.core.$strip>;
1937
+ /**
1938
+ * What follows an accepted {@link ControllerUpdateCs2Image | update_cs2_image}: its first
1939
+ * {@link ImageUpdateStep}.
1940
+ */
1941
+ export declare const UpdateCs2ImageReply: z.ZodObject<{
1942
+ image: z.ZodString;
1943
+ step: z.ZodEnum<{
1944
+ pulling: "pulling";
1945
+ switching: "switching";
1946
+ }>;
1947
+ }, z.core.$strip>;
1948
+ export type UpdateCs2ImageReply = z.infer<typeof UpdateCs2ImageReply>;
1949
+ /**
1950
+ * Start or renew the resource lease, which lasts {@link WATCH_LEASE_MS}. It receives no reply.
1951
+ *
1952
+ * While the lease runs, the agent streams {@link AgentResourceBatch | resource_batch}. A lease that
1953
+ * starts first sends every tick the agent holds.
1954
+ */
1955
+ export declare const ControllerWatchResources: z.ZodObject<{
1956
+ type: z.ZodLiteral<"watch_resources">;
1957
+ replay: z.ZodBoolean;
1958
+ }, z.core.$strip>;
1959
+ export type ControllerWatchResources = z.infer<typeof ControllerWatchResources>;
1960
+ /**
1961
+ * Start or renew the lease of one log source, which lasts {@link WATCH_LEASE_MS}. It receives no
1962
+ * reply.
1963
+ *
1964
+ * While the lease runs, the agent streams the source's {@link AgentLogBatch | log_batch} frames.
1965
+ * While any source's lease runs, the agent also sends {@link AgentLogIndex | log_index}. A lease
1966
+ * that starts replays the source, to every watcher unless a `replay_id` names the one that asked.
1967
+ * Any number of sources can be watched together, each on a lease of its own.
1968
+ */
1969
+ export declare const ControllerWatchLogs: z.ZodObject<{
1970
+ type: z.ZodLiteral<"watch_logs">;
1971
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
1972
+ kind: z.ZodLiteral<"agent">;
1973
+ }, z.core.$strip>, z.ZodObject<{
1974
+ kind: z.ZodLiteral<"cs2_update">;
1975
+ update_id: z.ZodUUID;
1976
+ }, z.core.$strip>, z.ZodObject<{
1977
+ kind: z.ZodLiteral<"server">;
1978
+ allocation_id: z.ZodUUID;
1979
+ }, z.core.$strip>], "kind">;
1980
+ replay_id: z.ZodNullable<z.ZodString>;
1981
+ }, z.core.$strip>;
1982
+ export type ControllerWatchLogs = z.infer<typeof ControllerWatchLogs>;
1983
+ /**
1984
+ * The controller's answer to a {@link AgentHello | hello} it accepted, before anything else on the
1985
+ * socket. Without one the agent redials after {@link AGENT_WELCOME_TIMEOUT_MS}.
1986
+ *
1987
+ * After each {@link ControllerWelcome | welcome} the agent sends what changed since the
1988
+ * {@link AgentHello | hello}, its pending {@link AgentServerExited | server_exited} first and then
1989
+ * the changed statuses, demos, backlog and watched streams. It sends each state once, so a slot
1990
+ * that went from `starting` to `running` arrives as `running`.
1991
+ */
1992
+ export declare const ControllerWelcome: z.ZodObject<{
1993
+ type: z.ZodLiteral<"welcome">;
1994
+ }, z.core.$strip>;
1995
+ /**
1996
+ * Why the controller refused a {@link AgentHello | hello}: `invalid_hello`, the
1997
+ * {@link AgentHello | hello} fails its schema. A controller refuses nothing else at hello: an agent
1998
+ * on a version it does not support connects, so it can still be updated, and receives no launches.
1999
+ */
2000
+ export declare const HelloRefusedReason: z.ZodEnum<{
2001
+ invalid_hello: "invalid_hello";
2002
+ }>;
2003
+ export type HelloRefusedReason = z.infer<typeof HelloRefusedReason>;
2004
+ /**
2005
+ * The controller's answer to a {@link AgentHello | hello} it will not accept, followed by a close
2006
+ * with code `1008` and reason `hello_refused`. The agent stops dialling until it is restarted,
2007
+ * because the same {@link AgentHello | hello} would be refused again.
2008
+ */
2009
+ export declare const ControllerHelloRefused: z.ZodObject<{
2010
+ type: z.ZodLiteral<"hello_refused">;
2011
+ reason: z.ZodEnum<{
2012
+ invalid_hello: "invalid_hello";
2013
+ }>;
2014
+ detail: z.ZodString;
2015
+ }, z.core.$strip>;
2016
+ export type ControllerHelloRefused = z.infer<typeof ControllerHelloRefused>;
2017
+ /**
2018
+ * Longest console command line, in characters. CS2 refuses a longer one with `Command too long...
2019
+ * ignoring!` somewhere past 500 (tested in October 2026), and reports it only in its log.
2020
+ */
2021
+ export declare const CONSOLE_COMMAND_MAX_CHARS = 500;
2022
+ /**
2023
+ * Run a console command on a server through its plugin.
2024
+ *
2025
+ * The reply comes once the plugin has handed the command to the engine, which reports nothing
2026
+ * back, so the reply cannot say that it worked. Refused with:
2027
+ *
2028
+ * - `unknown_allocation` when the node does not run the server.
2029
+ * - `plugin_offline` while the slot's `plugin_online` is `false`.
2030
+ * - `plugin_status_timeout` when the plugin does not answer.
2031
+ *
2032
+ * The output of the command joins the server's log, which {@link AgentLogBatch | log_batch} streams
2033
+ * while a {@link ControllerWatchLogs | watch_logs} lease covers it and replays when one starts.
2034
+ */
2035
+ export declare const ControllerConsoleCommand: z.ZodObject<{
2036
+ allocation_id: z.ZodUUID;
2037
+ command: z.ZodString;
2038
+ id: z.ZodString;
2039
+ type: z.ZodLiteral<"console_command">;
2040
+ }, z.core.$strip>;
2041
+ export type ControllerConsoleCommand = z.infer<typeof ControllerConsoleCommand>;
2042
+ /** The server the command was handed to. */
2043
+ export declare const ConsoleCommandReply: z.ZodObject<{
2044
+ allocation_id: z.ZodUUID;
2045
+ }, z.core.$strip>;
2046
+ export type ConsoleCommandReply = z.infer<typeof ConsoleCommandReply>;
2047
+ /**
2048
+ * Play a running match on from one of its earlier rounds, on the same server, without a new
2049
+ * launch. The engine writes a backup as each live round starts, and the node keeps the backups for
2050
+ * the server's life. This request loads the one for `round`.
2051
+ *
2052
+ * The reply comes once the plugin has asked the engine to load the backup. The
2053
+ * {@link MatchRestored | match_restored} event, which the plugin sends ahead of the restored
2054
+ * round's {@link RoundStart | round_start}, confirms that the engine did. Refused with:
2055
+ *
2056
+ * - `unknown_allocation` when the node does not run the server.
2057
+ * - `no_backup` when the node has no backup of that round, as in a game mode without backups
2058
+ * ({@link GameMode}).
2059
+ * - `plugin_offline` while the slot's `plugin_online` is `false`.
2060
+ * - `plugin_status_timeout` when the plugin does not answer.
2061
+ * - `no_match`, `not_live` or `at_halftime` when the plugin refuses the restore.
2062
+ *
2063
+ * The node keeps the backup of every round it has played, including rounds after one it was
2064
+ * restored to. If `round` is past the current round, the server loads play that the match has
2065
+ * since left. Whether to allow that is the controller's rule.
2066
+ */
2067
+ export declare const ControllerRestoreRound: z.ZodObject<{
2068
+ allocation_id: z.ZodUUID;
2069
+ round: z.ZodNumber;
2070
+ id: z.ZodString;
2071
+ type: z.ZodLiteral<"restore_round">;
2072
+ }, z.core.$strip>;
2073
+ export type ControllerRestoreRound = z.infer<typeof ControllerRestoreRound>;
2074
+ /** The server and round the restore was handed to. */
2075
+ export declare const RestoreRoundReply: z.ZodObject<{
2076
+ allocation_id: z.ZodUUID;
2077
+ round: z.ZodNumber;
2078
+ }, z.core.$strip>;
2079
+ export type RestoreRoundReply = z.infer<typeof RestoreRoundReply>;
2080
+ /**
2081
+ * Start a match in warmup whatever its `ready_mode`, without waiting for anyone to be ready. An
2082
+ * admin can always start the match this way, and under `external` it is the only way to.
2083
+ *
2084
+ * The reply comes once the plugin has started the countdown to the knife round or live play.
2085
+ * Refused with:
2086
+ *
2087
+ * - `unknown_allocation` when the node does not run the server.
2088
+ * - `plugin_offline` while the slot's `plugin_online` is `false`.
2089
+ * - `plugin_status_timeout` when the plugin does not answer.
2090
+ * - `no_match`, `not_in_warmup` or `team_empty` when the plugin refuses the start.
2091
+ *
2092
+ * A repeat while the countdown runs is accepted and changes nothing.
2093
+ */
2094
+ export declare const ControllerStartMatch: z.ZodObject<{
2095
+ allocation_id: z.ZodUUID;
2096
+ id: z.ZodString;
2097
+ type: z.ZodLiteral<"start_match">;
2098
+ }, z.core.$strip>;
2099
+ export type ControllerStartMatch = z.infer<typeof ControllerStartMatch>;
2100
+ /** The server the start was handed to. */
2101
+ export declare const StartMatchReply: z.ZodObject<{
2102
+ allocation_id: z.ZodUUID;
2103
+ }, z.core.$strip>;
2104
+ export type StartMatchReply = z.infer<typeof StartMatchReply>;
2105
+ /**
2106
+ * Milliseconds the agent waits for the plugin to answer
2107
+ * {@link ControllerGetServerStatus | get_server_status}, {@link ControllerConsoleCommand | console_command},
2108
+ * {@link ControllerRestoreRound | restore_round} or {@link ControllerStartMatch | start_match}. Past it, the
2109
+ * request fails with `plugin_status_timeout`.
2110
+ */
2111
+ export declare const SERVER_STATUS_TIMEOUT_MS = 10000;
2112
+ /**
2113
+ * Read a server's state as its plugin reports it now.
2114
+ *
2115
+ * The reply comes within {@link SERVER_STATUS_TIMEOUT_MS}. Refused with:
2116
+ *
2117
+ * - `unknown_allocation` when the node does not run the server.
2118
+ * - `plugin_offline` while the slot's `plugin_online` is `false` or when the plugin leaves before
2119
+ * answering.
2120
+ * - `plugin_status_timeout` after {@link SERVER_STATUS_TIMEOUT_MS}.
2121
+ */
2122
+ export declare const ControllerGetServerStatus: z.ZodObject<{
2123
+ allocation_id: z.ZodUUID;
2124
+ id: z.ZodString;
2125
+ type: z.ZodLiteral<"get_server_status">;
2126
+ }, z.core.$strip>;
2127
+ /**
2128
+ * Where a match is.
2129
+ *
2130
+ * - `loading`: its map is loading.
2131
+ * - `warmup`: warmup.
2132
+ * - `pending_restore`: a launch with a restore went here from warmup while the engine loads the
2133
+ * backup, and goes to `live` once the restored round starts. A load that fails leaves the match
2134
+ * here, where the plugin reports nothing, until a load is tried again or the server is stopped.
2135
+ * - `knife`: the knife round.
2136
+ * - `side_choice`: the side choice.
2137
+ * - `live`: live play.
2138
+ * - `post_live`: after the last round.
2139
+ */
2140
+ export declare const MatchPhase: z.ZodEnum<{
2141
+ side_choice: "side_choice";
2142
+ knife: "knife";
2143
+ loading: "loading";
2144
+ warmup: "warmup";
2145
+ pending_restore: "pending_restore";
2146
+ live: "live";
2147
+ post_live: "post_live";
2148
+ }>;
2149
+ export type MatchPhase = z.infer<typeof MatchPhase>;
2150
+ /** Longest `map_name` a server's state carries. The plugin cuts the engine's name to it. */
2151
+ export declare const MAP_NAME_MAX_CHARS = 64;
2152
+ /** Longest `config_error` a server's state carries. The plugin cuts its reason to it. */
2153
+ export declare const CONFIG_ERROR_MAX_CHARS = 512;
2154
+ /** A game server's state as its plugin reports it. */
2155
+ export declare const ServerState: z.ZodObject<{
2156
+ map_name: z.ZodString;
2157
+ match: z.ZodNullable<z.ZodObject<{
2158
+ match_id: z.ZodNullable<z.ZodUUID>;
2159
+ phase: z.ZodEnum<{
2160
+ side_choice: "side_choice";
2161
+ knife: "knife";
2162
+ loading: "loading";
2163
+ warmup: "warmup";
2164
+ pending_restore: "pending_restore";
2165
+ live: "live";
2166
+ post_live: "post_live";
2167
+ }>;
2168
+ team1_side: z.ZodEnum<{
2169
+ t: "t";
2170
+ ct: "ct";
2171
+ }>;
2172
+ team2_side: z.ZodEnum<{
2173
+ t: "t";
2174
+ ct: "ct";
2175
+ }>;
2176
+ team1_score: z.ZodNumber;
2177
+ team2_score: z.ZodNumber;
2178
+ }, z.core.$strip>>;
2179
+ players: z.ZodArray<z.ZodObject<{
2180
+ steam_id: z.ZodString;
2181
+ name: z.ZodString;
2182
+ side: z.ZodEnum<{
2183
+ t: "t";
2184
+ ct: "ct";
2185
+ spec: "spec";
2186
+ }>;
2187
+ }, z.core.$strip>>;
2188
+ config_error: z.ZodNullable<z.ZodString>;
2189
+ ready: z.ZodBoolean;
2190
+ server_steam_id: z.ZodNullable<z.ZodString>;
2191
+ }, z.core.$strip>;
2192
+ export type ServerState = z.infer<typeof ServerState>;
2193
+ /** The server asked about, and its state as its plugin reports it now. */
2194
+ export declare const GetServerStatusReply: z.ZodObject<{
2195
+ map_name: z.ZodString;
2196
+ match: z.ZodNullable<z.ZodObject<{
2197
+ match_id: z.ZodNullable<z.ZodUUID>;
2198
+ phase: z.ZodEnum<{
2199
+ side_choice: "side_choice";
2200
+ knife: "knife";
2201
+ loading: "loading";
2202
+ warmup: "warmup";
2203
+ pending_restore: "pending_restore";
2204
+ live: "live";
2205
+ post_live: "post_live";
2206
+ }>;
2207
+ team1_side: z.ZodEnum<{
2208
+ t: "t";
2209
+ ct: "ct";
2210
+ }>;
2211
+ team2_side: z.ZodEnum<{
2212
+ t: "t";
2213
+ ct: "ct";
2214
+ }>;
2215
+ team1_score: z.ZodNumber;
2216
+ team2_score: z.ZodNumber;
2217
+ }, z.core.$strip>>;
2218
+ players: z.ZodArray<z.ZodObject<{
2219
+ steam_id: z.ZodString;
2220
+ name: z.ZodString;
2221
+ side: z.ZodEnum<{
2222
+ t: "t";
2223
+ ct: "ct";
2224
+ spec: "spec";
2225
+ }>;
2226
+ }, z.core.$strip>>;
2227
+ config_error: z.ZodNullable<z.ZodString>;
2228
+ ready: z.ZodBoolean;
2229
+ server_steam_id: z.ZodNullable<z.ZodString>;
2230
+ allocation_id: z.ZodUUID;
2231
+ }, z.core.$strip>;
2232
+ export type GetServerStatusReply = z.infer<typeof GetServerStatusReply>;
2233
+ /**
2234
+ * A match moved to another phase, as its plugin reports it, whether or not the match sends
2235
+ * statistics. An {@link EventBatch | event_batch} carries the events behind it, such as
2236
+ * {@link GoingLive | going_live} and {@link MapEnd | map_end}.
2237
+ *
2238
+ * The agent sends it once. If the plugin is not connected to the agent, or the controller has not
2239
+ * welcomed the agent's {@link AgentHello | hello}, it is lost, and
2240
+ * {@link ControllerGetServerStatus | get_server_status} reads the phase again.
2241
+ */
2242
+ export declare const AgentPhaseChange: z.ZodObject<{
2243
+ type: z.ZodLiteral<"phase_change">;
2244
+ allocation_id: z.ZodUUID;
2245
+ phase: z.ZodEnum<{
2246
+ side_choice: "side_choice";
2247
+ knife: "knife";
2248
+ loading: "loading";
2249
+ warmup: "warmup";
2250
+ pending_restore: "pending_restore";
2251
+ live: "live";
2252
+ post_live: "post_live";
2253
+ }>;
2254
+ }, z.core.$strip>;
2255
+ export type AgentPhaseChange = z.infer<typeof AgentPhaseChange>;
2256
+ /**
2257
+ * A match's score changed, as its plugin reads it off the scoreboard, whether or not the match
2258
+ * sends statistics: after a round, when going live resets it, or after a restore. An
2259
+ * {@link EventBatch | event_batch} carries the rounds behind it as {@link RoundEnd | round_end}
2260
+ * and {@link MatchRestored | match_restored}.
2261
+ *
2262
+ * Like {@link AgentPhaseChange | phase_change}, it is sent once, and
2263
+ * {@link ControllerGetServerStatus | get_server_status} reads the score again.
2264
+ */
2265
+ export declare const AgentScore: z.ZodObject<{
2266
+ type: z.ZodLiteral<"score">;
2267
+ allocation_id: z.ZodUUID;
2268
+ team1_score: z.ZodNumber;
2269
+ team2_score: z.ZodNumber;
2270
+ }, z.core.$strip>;
2271
+ export type AgentScore = z.infer<typeof AgentScore>;
2272
+ /**
2273
+ * The {@link RoundBackup | round_backup} of a match that sends no statistics, which a match with
2274
+ * statistics carries in its {@link EventBatch | event_batch} instead. Keep the newest of each match
2275
+ * to restore it on a new server.
2276
+ *
2277
+ * The message wraps the complete event, unchanged, so code that reads a `round_backup` from the
2278
+ * event stream reads `backup` the same way. The wrapper adds only the server that sent it.
2279
+ *
2280
+ * Like {@link AgentPhaseChange | phase_change}, it is sent once, so a backup is lost if the plugin
2281
+ * or the agent is not connected when the round starts. The next round's backup replaces it.
2282
+ */
2283
+ export declare const AgentBackup: z.ZodObject<{
2284
+ type: z.ZodLiteral<"backup">;
2285
+ allocation_id: z.ZodUUID;
2286
+ backup: z.ZodObject<{
2287
+ roster: z.ZodObject<{
2288
+ team1: z.ZodObject<{
2289
+ name: z.ZodString;
2290
+ players: z.ZodArray<z.ZodString>;
2291
+ }, z.core.$strip>;
2292
+ team2: z.ZodObject<{
2293
+ name: z.ZodString;
2294
+ players: z.ZodArray<z.ZodString>;
2295
+ }, z.core.$strip>;
2296
+ spectators: z.ZodArray<z.ZodString>;
2297
+ }, z.core.$strip>;
2298
+ team1_side: z.ZodEnum<{
2299
+ t: "t";
2300
+ ct: "ct";
2301
+ }>;
2302
+ rules: z.ZodObject<{
2303
+ max_rounds: z.ZodNumber;
2304
+ overtime: z.ZodBoolean;
2305
+ overtime_max_rounds: z.ZodNumber;
2306
+ friendly_fire: z.ZodBoolean;
2307
+ }, z.core.$strip>;
2308
+ file: z.ZodString;
2309
+ round: z.ZodNumber;
2310
+ team1_score: z.ZodNumber;
2311
+ team2_score: z.ZodNumber;
2312
+ timestamp: z.ZodNumber;
2313
+ tick: z.ZodNumber;
2314
+ type: z.ZodLiteral<"round_backup">;
2315
+ }, z.core.$strip>;
2316
+ }, z.core.$strip>;
2317
+ export type AgentBackup = z.infer<typeof AgentBackup>;
2318
+ /**
2319
+ * What the controller sends:
2320
+ *
2321
+ * - The {@link ControllerWelcome | welcome} that accepts a {@link AgentHello | hello}, or the
2322
+ * {@link ControllerHelloRefused | hello_refused} that refuses it.
2323
+ * - Requests, which carry an `id` and receive one {@link AgentReply | reply} each.
2324
+ * - The watches that start or renew a stream of logs or resource samples.
2325
+ * - {@link ControllerCheckCs2Build | check_cs2_build}, which receives no answer.
2326
+ */
2327
+ export declare const ControllerToAgentMessage: z.ZodDiscriminatedUnion<[z.ZodObject<{
2328
+ allocation_id: z.ZodUUID;
2329
+ launch: z.ZodObject<{
2330
+ hostname: z.ZodDefault<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodString>>>;
2331
+ steam_web_api_key: z.ZodDefault<z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>>;
2332
+ game_password: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2333
+ chat_tag: z.ZodPrefault<z.ZodObject<{
2334
+ text: z.ZodDefault<z.ZodString>;
2335
+ color: z.ZodDefault<z.ZodEnum<{
2336
+ white: "white";
2337
+ darkred: "darkred";
2338
+ lightpurple: "lightpurple";
2339
+ green: "green";
2340
+ olive: "olive";
2341
+ lime: "lime";
2342
+ red: "red";
2343
+ gray: "gray";
2344
+ lightyellow: "lightyellow";
2345
+ yellow: "yellow";
2346
+ silver: "silver";
2347
+ bluegrey: "bluegrey";
2348
+ lightblue: "lightblue";
2349
+ blue: "blue";
2350
+ darkblue: "darkblue";
2351
+ purple: "purple";
2352
+ magenta: "magenta";
2353
+ lightred: "lightred";
2354
+ gold: "gold";
2355
+ orange: "orange";
2356
+ }>>;
2357
+ }, z.core.$strip>>;
2358
+ game_mode: z.ZodDefault<z.ZodEnum<{
2359
+ custom: "custom";
2360
+ casual: "casual";
2361
+ competitive: "competitive";
2362
+ wingman: "wingman";
2363
+ rush: "rush";
2364
+ arms_race: "arms_race";
2365
+ demolition: "demolition";
2366
+ deathmatch: "deathmatch";
2367
+ }>>;
2368
+ max_players: z.ZodNumber;
2369
+ workshop_id: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2370
+ map_name: z.ZodNullable<z.ZodString>;
2371
+ gotv: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2372
+ password: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2373
+ delay_seconds: z.ZodNumber;
2374
+ }, z.core.$strip>>>;
2375
+ idle_shutdown_seconds: z.ZodNullable<z.ZodNumber>;
2376
+ exec: z.ZodArray<z.ZodString>;
2377
+ commands: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodString>>;
2378
+ match: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2379
+ match_id: z.ZodDefault<z.ZodNullable<z.ZodUUID>>;
2380
+ send_statistics: z.ZodDefault<z.ZodBoolean>;
2381
+ roster: z.ZodObject<{
2382
+ team1: z.ZodObject<{
2383
+ name: z.ZodString;
2384
+ players: z.ZodArray<z.ZodString>;
2385
+ }, z.core.$strip>;
2386
+ team2: z.ZodObject<{
2387
+ name: z.ZodString;
2388
+ players: z.ZodArray<z.ZodString>;
2389
+ }, z.core.$strip>;
2390
+ spectators: z.ZodArray<z.ZodString>;
2391
+ }, z.core.$strip>;
2392
+ sides: z.ZodEnum<{
2393
+ knife: "knife";
2394
+ team1_ct: "team1_ct";
2395
+ team1_t: "team1_t";
2396
+ }>;
2397
+ knife_decision_seconds: z.ZodDefault<z.ZodNumber>;
2398
+ ready_mode: z.ZodDefault<z.ZodEnum<{
2399
+ auto: "auto";
2400
+ manual: "manual";
2401
+ external: "external";
2402
+ }>>;
2403
+ spectators_ready_up: z.ZodDefault<z.ZodBoolean>;
2404
+ ready_timeout_seconds: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
2405
+ record_demo: z.ZodBoolean;
2406
+ debug_capture: z.ZodDefault<z.ZodBoolean>;
2407
+ rules: z.ZodPrefault<z.ZodObject<{
2408
+ max_rounds: z.ZodDefault<z.ZodNumber>;
2409
+ overtime: z.ZodDefault<z.ZodBoolean>;
2410
+ overtime_max_rounds: z.ZodDefault<z.ZodNumber>;
2411
+ friendly_fire: z.ZodDefault<z.ZodBoolean>;
2412
+ }, z.core.$strip>>;
2413
+ restore: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2414
+ team1_side: z.ZodEnum<{
2415
+ t: "t";
2416
+ ct: "ct";
2417
+ }>;
2418
+ rules: z.ZodObject<{
2419
+ max_rounds: z.ZodNumber;
2420
+ overtime: z.ZodBoolean;
2421
+ overtime_max_rounds: z.ZodNumber;
2422
+ friendly_fire: z.ZodBoolean;
2423
+ }, z.core.$strip>;
2424
+ file: z.ZodString;
2425
+ }, z.core.$strip>>>;
2426
+ }, z.core.$strip>>>;
2427
+ }, z.core.$strip>;
2428
+ id: z.ZodString;
2429
+ type: z.ZodLiteral<"start_server">;
2430
+ }, z.core.$strip>, z.ZodObject<{
2431
+ id: z.ZodString;
2432
+ type: z.ZodLiteral<"stop_server">;
2433
+ allocation_id: z.ZodUUID;
2434
+ }, z.core.$strip>, z.ZodObject<{
2435
+ allocation_id: z.ZodUUID;
2436
+ id: z.ZodString;
2437
+ type: z.ZodLiteral<"get_server_status">;
2438
+ }, z.core.$strip>, z.ZodObject<{
2439
+ mode: z.ZodEnum<{
2440
+ update: "update";
2441
+ verify: "verify";
2442
+ reinstall: "reinstall";
2443
+ }>;
2444
+ id: z.ZodString;
2445
+ type: z.ZodLiteral<"update_cs2">;
2446
+ }, z.core.$strip>, z.ZodObject<{
2447
+ type: z.ZodLiteral<"check_cs2_build">;
2448
+ }, z.core.$strip>, z.ZodObject<{
2449
+ slot_id: z.ZodString;
2450
+ file_name: z.ZodString;
2451
+ id: z.ZodString;
2452
+ type: z.ZodLiteral<"delete_demo">;
2453
+ }, z.core.$strip>, z.ZodObject<{
2454
+ slot_id: z.ZodString;
2455
+ id: z.ZodString;
2456
+ type: z.ZodLiteral<"reserve_slot">;
2457
+ }, z.core.$strip>, z.ZodObject<{
2458
+ config: z.ZodObject<{
2459
+ pinned_ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2460
+ controller: z.ZodOptional<z.ZodObject<{
2461
+ host: z.ZodString;
2462
+ tls: z.ZodBoolean;
2463
+ socket_path: z.ZodString;
2464
+ events_path: z.ZodString;
2465
+ }, z.core.$strip>>;
2466
+ auto_update: z.ZodOptional<z.ZodBoolean>;
2467
+ memory_mb: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2468
+ slots: z.ZodOptional<z.ZodArray<z.ZodObject<{
2469
+ id: z.ZodString;
2470
+ port: z.ZodNumber;
2471
+ tv_port: z.ZodNumber;
2472
+ gslt: z.ZodOptional<z.ZodString>;
2473
+ }, z.core.$strip>>>;
2474
+ demo_upload: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2475
+ url: z.ZodURL;
2476
+ limit_mbit: z.ZodNullable<z.ZodNumber>;
2477
+ header: z.ZodNullable<z.ZodObject<{
2478
+ name: z.ZodString;
2479
+ value: z.ZodOptional<z.ZodString>;
2480
+ }, z.core.$strip>>;
2481
+ }, z.core.$strip>>>;
2482
+ }, z.core.$strip>;
2483
+ id: z.ZodString;
2484
+ type: z.ZodLiteral<"set_config">;
2485
+ }, z.core.$strip>, z.ZodObject<{
2486
+ image: z.ZodString;
2487
+ pull: z.ZodBoolean;
2488
+ id: z.ZodString;
2489
+ type: z.ZodLiteral<"update_agent">;
2490
+ }, z.core.$strip>, z.ZodObject<{
2491
+ image: z.ZodString;
2492
+ pull: z.ZodBoolean;
2493
+ id: z.ZodString;
2494
+ type: z.ZodLiteral<"update_cs2_image">;
2495
+ }, z.core.$strip>, z.ZodObject<{
2496
+ type: z.ZodLiteral<"watch_resources">;
2497
+ replay: z.ZodBoolean;
2498
+ }, z.core.$strip>, z.ZodObject<{
2499
+ type: z.ZodLiteral<"watch_logs">;
2500
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
2501
+ kind: z.ZodLiteral<"agent">;
2502
+ }, z.core.$strip>, z.ZodObject<{
2503
+ kind: z.ZodLiteral<"cs2_update">;
2504
+ update_id: z.ZodUUID;
2505
+ }, z.core.$strip>, z.ZodObject<{
2506
+ kind: z.ZodLiteral<"server">;
2507
+ allocation_id: z.ZodUUID;
2508
+ }, z.core.$strip>], "kind">;
2509
+ replay_id: z.ZodNullable<z.ZodString>;
2510
+ }, z.core.$strip>, z.ZodObject<{
2511
+ type: z.ZodLiteral<"welcome">;
2512
+ }, z.core.$strip>, z.ZodObject<{
2513
+ type: z.ZodLiteral<"hello_refused">;
2514
+ reason: z.ZodEnum<{
2515
+ invalid_hello: "invalid_hello";
2516
+ }>;
2517
+ detail: z.ZodString;
2518
+ }, z.core.$strip>, z.ZodObject<{
2519
+ allocation_id: z.ZodUUID;
2520
+ command: z.ZodString;
2521
+ id: z.ZodString;
2522
+ type: z.ZodLiteral<"console_command">;
2523
+ }, z.core.$strip>, z.ZodObject<{
2524
+ allocation_id: z.ZodUUID;
2525
+ round: z.ZodNumber;
2526
+ id: z.ZodString;
2527
+ type: z.ZodLiteral<"restore_round">;
2528
+ }, z.core.$strip>, z.ZodObject<{
2529
+ allocation_id: z.ZodUUID;
2530
+ id: z.ZodString;
2531
+ type: z.ZodLiteral<"start_match">;
2532
+ }, z.core.$strip>], "type">;
2533
+ export type ControllerToAgentMessage = z.infer<typeof ControllerToAgentMessage>;
2534
+ /**
2535
+ * The `type` of each request the controller sends, which its {@link AgentReply | reply} repeats as
2536
+ * `request`.
2537
+ */
2538
+ export declare const RequestType: z.ZodEnum<{
2539
+ start_server: "start_server";
2540
+ stop_server: "stop_server";
2541
+ update_cs2: "update_cs2";
2542
+ delete_demo: "delete_demo";
2543
+ reserve_slot: "reserve_slot";
2544
+ set_config: "set_config";
2545
+ update_agent: "update_agent";
2546
+ update_cs2_image: "update_cs2_image";
2547
+ console_command: "console_command";
2548
+ restore_round: "restore_round";
2549
+ start_match: "start_match";
2550
+ get_server_status: "get_server_status";
2551
+ }>;
2552
+ export type RequestType = z.infer<typeof RequestType>;
2553
+ /**
2554
+ * A request that succeeded. `request` names the request, so `data` can be read without the request
2555
+ * that `reply_to` answers. The settings in a {@link ControllerSetConfig | set_config} reply are the
2556
+ * node's, whichever edit asked.
2557
+ */
2558
+ export declare const AgentReplySuccess: z.ZodDiscriminatedUnion<[z.ZodObject<{
2559
+ type: z.ZodLiteral<"reply">;
2560
+ reply_to: z.ZodString;
2561
+ ok: z.ZodLiteral<true>;
2562
+ request: z.ZodLiteral<"start_server">;
2563
+ data: z.ZodObject<{
2564
+ allocation_id: z.ZodUUID;
2565
+ slot_id: z.ZodString;
2566
+ }, z.core.$strip>;
2567
+ }, z.core.$strip>, z.ZodObject<{
2568
+ type: z.ZodLiteral<"reply">;
2569
+ reply_to: z.ZodString;
2570
+ ok: z.ZodLiteral<true>;
2571
+ request: z.ZodLiteral<"stop_server">;
2572
+ data: z.ZodObject<{
2573
+ allocation_id: z.ZodUUID;
2574
+ }, z.core.$strip>;
2575
+ }, z.core.$strip>, z.ZodObject<{
2576
+ type: z.ZodLiteral<"reply">;
2577
+ reply_to: z.ZodString;
2578
+ ok: z.ZodLiteral<true>;
2579
+ request: z.ZodLiteral<"get_server_status">;
2580
+ data: z.ZodObject<{
2581
+ map_name: z.ZodString;
2582
+ match: z.ZodNullable<z.ZodObject<{
2583
+ match_id: z.ZodNullable<z.ZodUUID>;
2584
+ phase: z.ZodEnum<{
2585
+ side_choice: "side_choice";
2586
+ knife: "knife";
2587
+ loading: "loading";
2588
+ warmup: "warmup";
2589
+ pending_restore: "pending_restore";
2590
+ live: "live";
2591
+ post_live: "post_live";
2592
+ }>;
2593
+ team1_side: z.ZodEnum<{
2594
+ t: "t";
2595
+ ct: "ct";
2596
+ }>;
2597
+ team2_side: z.ZodEnum<{
2598
+ t: "t";
2599
+ ct: "ct";
2600
+ }>;
2601
+ team1_score: z.ZodNumber;
2602
+ team2_score: z.ZodNumber;
2603
+ }, z.core.$strip>>;
2604
+ players: z.ZodArray<z.ZodObject<{
2605
+ steam_id: z.ZodString;
2606
+ name: z.ZodString;
2607
+ side: z.ZodEnum<{
2608
+ t: "t";
2609
+ ct: "ct";
2610
+ spec: "spec";
2611
+ }>;
2612
+ }, z.core.$strip>>;
2613
+ config_error: z.ZodNullable<z.ZodString>;
2614
+ ready: z.ZodBoolean;
2615
+ server_steam_id: z.ZodNullable<z.ZodString>;
2616
+ allocation_id: z.ZodUUID;
2617
+ }, z.core.$strip>;
2618
+ }, z.core.$strip>, z.ZodObject<{
2619
+ type: z.ZodLiteral<"reply">;
2620
+ reply_to: z.ZodString;
2621
+ ok: z.ZodLiteral<true>;
2622
+ request: z.ZodLiteral<"update_cs2">;
2623
+ data: z.ZodObject<{
2624
+ update_id: z.ZodUUID;
2625
+ }, z.core.$strip>;
2626
+ }, z.core.$strip>, z.ZodObject<{
2627
+ type: z.ZodLiteral<"reply">;
2628
+ reply_to: z.ZodString;
2629
+ ok: z.ZodLiteral<true>;
2630
+ request: z.ZodLiteral<"delete_demo">;
2631
+ data: z.ZodObject<{
2632
+ slot_id: z.ZodString;
2633
+ file_name: z.ZodString;
2634
+ }, z.core.$strip>;
2635
+ }, z.core.$strip>, z.ZodObject<{
2636
+ type: z.ZodLiteral<"reply">;
2637
+ reply_to: z.ZodString;
2638
+ ok: z.ZodLiteral<true>;
2639
+ request: z.ZodLiteral<"reserve_slot">;
2640
+ data: z.ZodObject<{
2641
+ slot_id: z.ZodString;
2642
+ }, z.core.$strip>;
2643
+ }, z.core.$strip>, z.ZodObject<{
2644
+ type: z.ZodLiteral<"reply">;
2645
+ reply_to: z.ZodString;
2646
+ ok: z.ZodLiteral<true>;
2647
+ request: z.ZodLiteral<"set_config">;
2648
+ data: z.ZodObject<{
2649
+ slots: z.ZodArray<z.ZodObject<{
2650
+ id: z.ZodString;
2651
+ port: z.ZodNumber;
2652
+ tv_port: z.ZodNumber;
2653
+ gslt_hint: z.ZodString;
2654
+ }, z.core.$strip>>;
2655
+ pinned_ip: z.ZodNullable<z.ZodString>;
2656
+ controller: z.ZodObject<{
2657
+ host: z.ZodString;
2658
+ tls: z.ZodBoolean;
2659
+ socket_path: z.ZodString;
2660
+ events_path: z.ZodString;
2661
+ }, z.core.$strip>;
2662
+ auto_update: z.ZodBoolean;
2663
+ demo_upload: z.ZodNullable<z.ZodObject<{
2664
+ url: z.ZodURL;
2665
+ limit_mbit: z.ZodNullable<z.ZodNumber>;
2666
+ header: z.ZodNullable<z.ZodObject<{
2667
+ name: z.ZodString;
2668
+ value_sha256: z.ZodString;
2669
+ }, z.core.$strip>>;
2670
+ }, z.core.$strip>>;
2671
+ memory_mb: z.ZodNullable<z.ZodNumber>;
2672
+ }, z.core.$strip>;
2673
+ }, z.core.$strip>, z.ZodObject<{
2674
+ type: z.ZodLiteral<"reply">;
2675
+ reply_to: z.ZodString;
2676
+ ok: z.ZodLiteral<true>;
2677
+ request: z.ZodLiteral<"update_agent">;
2678
+ data: z.ZodObject<{
2679
+ image: z.ZodString;
2680
+ step: z.ZodEnum<{
2681
+ pulling: "pulling";
2682
+ switching: "switching";
2683
+ unchanged: "unchanged";
2684
+ }>;
2685
+ }, z.core.$strip>;
2686
+ }, z.core.$strip>, z.ZodObject<{
2687
+ type: z.ZodLiteral<"reply">;
2688
+ reply_to: z.ZodString;
2689
+ ok: z.ZodLiteral<true>;
2690
+ request: z.ZodLiteral<"update_cs2_image">;
2691
+ data: z.ZodObject<{
2692
+ image: z.ZodString;
2693
+ step: z.ZodEnum<{
2694
+ pulling: "pulling";
2695
+ switching: "switching";
2696
+ }>;
2697
+ }, z.core.$strip>;
2698
+ }, z.core.$strip>, z.ZodObject<{
2699
+ type: z.ZodLiteral<"reply">;
2700
+ reply_to: z.ZodString;
2701
+ ok: z.ZodLiteral<true>;
2702
+ request: z.ZodLiteral<"console_command">;
2703
+ data: z.ZodObject<{
2704
+ allocation_id: z.ZodUUID;
2705
+ }, z.core.$strip>;
2706
+ }, z.core.$strip>, z.ZodObject<{
2707
+ type: z.ZodLiteral<"reply">;
2708
+ reply_to: z.ZodString;
2709
+ ok: z.ZodLiteral<true>;
2710
+ request: z.ZodLiteral<"restore_round">;
2711
+ data: z.ZodObject<{
2712
+ allocation_id: z.ZodUUID;
2713
+ round: z.ZodNumber;
2714
+ }, z.core.$strip>;
2715
+ }, z.core.$strip>, z.ZodObject<{
2716
+ type: z.ZodLiteral<"reply">;
2717
+ reply_to: z.ZodString;
2718
+ ok: z.ZodLiteral<true>;
2719
+ request: z.ZodLiteral<"start_match">;
2720
+ data: z.ZodObject<{
2721
+ allocation_id: z.ZodUUID;
2722
+ }, z.core.$strip>;
2723
+ }, z.core.$strip>], "request">;
2724
+ /** A request that failed. */
2725
+ export declare const AgentReplyFailure: z.ZodObject<{
2726
+ type: z.ZodLiteral<"reply">;
2727
+ reply_to: z.ZodString;
2728
+ request: z.ZodNullable<z.ZodEnum<{
2729
+ start_server: "start_server";
2730
+ stop_server: "stop_server";
2731
+ update_cs2: "update_cs2";
2732
+ delete_demo: "delete_demo";
2733
+ reserve_slot: "reserve_slot";
2734
+ set_config: "set_config";
2735
+ update_agent: "update_agent";
2736
+ update_cs2_image: "update_cs2_image";
2737
+ console_command: "console_command";
2738
+ restore_round: "restore_round";
2739
+ start_match: "start_match";
2740
+ get_server_status: "get_server_status";
2741
+ }>>;
2742
+ ok: z.ZodLiteral<false>;
2743
+ error: z.ZodObject<{
2744
+ code: z.ZodEnum<{
2745
+ /** No slot is idle, unreserved and on a token Steam has not refused. */
2746
+ readonly noFreeSlot: "no_free_slot";
2747
+ /**
2748
+ * A newer public CS2 build is out and the node has not updated to it yet, so its `cs2.build_id`
2749
+ * is behind `cs2.latest_build_id`. The node takes launches again once it has updated. A node
2750
+ * whose `auto_update` is `false` never refuses with this.
2751
+ */
2752
+ readonly cs2Outdated: "cs2_outdated";
2753
+ /**
2754
+ * CS2 is not installed on the node, so its `cs2.build_id` is `null`. The node takes launches once
2755
+ * an {@link ControllerUpdateCs2 | update_cs2} has installed it.
2756
+ */
2757
+ readonly cs2NotInstalled: "cs2_not_installed";
2758
+ /** The node reports `unavailable` for a reason other than `maintenance`. */
2759
+ readonly nodeUnavailable: "node_unavailable";
2760
+ /**
2761
+ * An operation that needs every slot idle found one held: {@link ControllerUpdateCs2 | update_cs2}, or a
2762
+ * {@link ControllerSetConfig | set_config} that changes any key under `controller`.
2763
+ */
2764
+ readonly slotsHeld: "slots_held";
2765
+ /**
2766
+ * A slot holds a server that is `starting`, `running` or `stopping`, and
2767
+ * {@link ControllerSetConfig | set_config} would remove or re-port the slot or give its server's token
2768
+ * to another slot, or {@link ControllerReserveSlot | reserve_slot} asked for it. `detail` names the
2769
+ * slots.
2770
+ */
2771
+ readonly slotHeld: "slot_held";
2772
+ /** The node has no slot with that id. */
2773
+ readonly unknownSlot: "unknown_slot";
2774
+ /**
2775
+ * {@link ControllerSetConfig | set_config} kept the token of a slot the node does not have yet. A new
2776
+ * slot needs a new token.
2777
+ */
2778
+ readonly slotTokenRequired: "slot_token_required";
2779
+ /**
2780
+ * {@link ControllerSetConfig | set_config} kept the value of a demo upload header the node does not
2781
+ * send. A new header needs its value.
2782
+ */
2783
+ readonly demoHeaderValueRequired: "demo_header_value_required";
2784
+ /** No server with that allocation id. */
2785
+ readonly unknownAllocation: "unknown_allocation";
2786
+ /**
2787
+ * A maintenance operation runs on the node. That operation is unaffected, and `unavailable` shows
2788
+ * it as `maintenance`.
2789
+ */
2790
+ readonly maintenanceRunning: "maintenance_running";
2791
+ /**
2792
+ * The image is not on the node and the request asked for no pull. Asking again with `pull`
2793
+ * fetches it.
2794
+ */
2795
+ readonly imageMissing: "image_missing";
2796
+ /**
2797
+ * The image is not an official one, and the node's `official_images_only` is on. The node's
2798
+ * operator decides which images it runs.
2799
+ */
2800
+ readonly imageNotAllowed: "image_not_allowed";
2801
+ /** The demo is uploading. It can be deleted once the upload ends. */
2802
+ readonly demoUploading: "demo_uploading";
2803
+ /** The slot has no demo of that name, such as one an upload or a delete has already removed. */
2804
+ readonly unknownDemo: "unknown_demo";
2805
+ /** The demo is still being recorded. It can be deleted once its server ends the recording. */
2806
+ readonly demoRecording: "demo_recording";
2807
+ /** The server's plugin is not connected to the agent, or left before it answered. */
2808
+ readonly pluginOffline: "plugin_offline";
2809
+ /**
2810
+ * The plugin did not answer {@link ControllerGetServerStatus | get_server_status},
2811
+ * {@link ControllerConsoleCommand | console_command}, {@link ControllerStartMatch | start_match} or
2812
+ * {@link ControllerRestoreRound | restore_round} within {@link SERVER_STATUS_TIMEOUT_MS}.
2813
+ */
2814
+ readonly pluginStatusTimeout: "plugin_status_timeout";
2815
+ /** The server runs without a match. */
2816
+ readonly noMatch: "no_match";
2817
+ /** The match is past its warmup. */
2818
+ readonly notInWarmup: "not_in_warmup";
2819
+ /** A team has no player connected. */
2820
+ readonly teamEmpty: "team_empty";
2821
+ /** The match is not live, such as in warmup, during the knife round or after it ended. */
2822
+ readonly notLive: "not_live";
2823
+ /**
2824
+ * The match is in its halftime break, while the sides are about to swap. Ask again once the next
2825
+ * round has started.
2826
+ */
2827
+ readonly atHalftime: "at_halftime";
2828
+ /**
2829
+ * The node has no backup of the round that {@link ControllerRestoreRound | restore_round} named for that
2830
+ * server.
2831
+ */
2832
+ readonly noBackup: "no_backup";
2833
+ /** The request did not match its schema. */
2834
+ readonly invalidRequest: "invalid_request";
2835
+ /**
2836
+ * {@link ControllerStartServer | start_server} named an allocation this node is already launching or
2837
+ * running. Its server exists or is on its way, as after a {@link ControllerStartServer | start_server}
2838
+ * sent again when its reply was slow.
2839
+ */
2840
+ readonly allocationInUse: "allocation_in_use";
2841
+ /**
2842
+ * {@link ControllerStartServer | start_server} named an allocation that this node launched before, among
2843
+ * the last {@link REMEMBERED_ALLOCATIONS}. The node files a server's events and demos under its
2844
+ * allocation, so every launch needs a new one.
2845
+ */
2846
+ readonly allocationReused: "allocation_reused";
2847
+ /** The agent does not know the request's `type`, or the plugin the command's. */
2848
+ readonly unsupportedRequest: "unsupported_request";
2849
+ /**
2850
+ * The agent is stopping and started no work for the request, as after its
2851
+ * {@link AgentShutdown | shutdown}. Send the request again once the node reconnects.
2852
+ */
2853
+ readonly shuttingDown: "shutting_down";
2854
+ /** Any failure that no other code names, such as a Docker failure. */
2855
+ readonly failed: "failed";
2856
+ }>;
2857
+ detail: z.ZodString;
2858
+ }, z.core.$strip>;
2859
+ }, z.core.$strip>;
2860
+ /**
2861
+ * The answer to a request, in any order. A success carries the request's data, and a failure its
2862
+ * reason.
2863
+ */
2864
+ export declare const AgentReply: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
2865
+ type: z.ZodLiteral<"reply">;
2866
+ reply_to: z.ZodString;
2867
+ ok: z.ZodLiteral<true>;
2868
+ request: z.ZodLiteral<"start_server">;
2869
+ data: z.ZodObject<{
2870
+ allocation_id: z.ZodUUID;
2871
+ slot_id: z.ZodString;
2872
+ }, z.core.$strip>;
2873
+ }, z.core.$strip>, z.ZodObject<{
2874
+ type: z.ZodLiteral<"reply">;
2875
+ reply_to: z.ZodString;
2876
+ ok: z.ZodLiteral<true>;
2877
+ request: z.ZodLiteral<"stop_server">;
2878
+ data: z.ZodObject<{
2879
+ allocation_id: z.ZodUUID;
2880
+ }, z.core.$strip>;
2881
+ }, z.core.$strip>, z.ZodObject<{
2882
+ type: z.ZodLiteral<"reply">;
2883
+ reply_to: z.ZodString;
2884
+ ok: z.ZodLiteral<true>;
2885
+ request: z.ZodLiteral<"get_server_status">;
2886
+ data: z.ZodObject<{
2887
+ map_name: z.ZodString;
2888
+ match: z.ZodNullable<z.ZodObject<{
2889
+ match_id: z.ZodNullable<z.ZodUUID>;
2890
+ phase: z.ZodEnum<{
2891
+ side_choice: "side_choice";
2892
+ knife: "knife";
2893
+ loading: "loading";
2894
+ warmup: "warmup";
2895
+ pending_restore: "pending_restore";
2896
+ live: "live";
2897
+ post_live: "post_live";
2898
+ }>;
2899
+ team1_side: z.ZodEnum<{
2900
+ t: "t";
2901
+ ct: "ct";
2902
+ }>;
2903
+ team2_side: z.ZodEnum<{
2904
+ t: "t";
2905
+ ct: "ct";
2906
+ }>;
2907
+ team1_score: z.ZodNumber;
2908
+ team2_score: z.ZodNumber;
2909
+ }, z.core.$strip>>;
2910
+ players: z.ZodArray<z.ZodObject<{
2911
+ steam_id: z.ZodString;
2912
+ name: z.ZodString;
2913
+ side: z.ZodEnum<{
2914
+ t: "t";
2915
+ ct: "ct";
2916
+ spec: "spec";
2917
+ }>;
2918
+ }, z.core.$strip>>;
2919
+ config_error: z.ZodNullable<z.ZodString>;
2920
+ ready: z.ZodBoolean;
2921
+ server_steam_id: z.ZodNullable<z.ZodString>;
2922
+ allocation_id: z.ZodUUID;
2923
+ }, z.core.$strip>;
2924
+ }, z.core.$strip>, z.ZodObject<{
2925
+ type: z.ZodLiteral<"reply">;
2926
+ reply_to: z.ZodString;
2927
+ ok: z.ZodLiteral<true>;
2928
+ request: z.ZodLiteral<"update_cs2">;
2929
+ data: z.ZodObject<{
2930
+ update_id: z.ZodUUID;
2931
+ }, z.core.$strip>;
2932
+ }, z.core.$strip>, z.ZodObject<{
2933
+ type: z.ZodLiteral<"reply">;
2934
+ reply_to: z.ZodString;
2935
+ ok: z.ZodLiteral<true>;
2936
+ request: z.ZodLiteral<"delete_demo">;
2937
+ data: z.ZodObject<{
2938
+ slot_id: z.ZodString;
2939
+ file_name: z.ZodString;
2940
+ }, z.core.$strip>;
2941
+ }, z.core.$strip>, z.ZodObject<{
2942
+ type: z.ZodLiteral<"reply">;
2943
+ reply_to: z.ZodString;
2944
+ ok: z.ZodLiteral<true>;
2945
+ request: z.ZodLiteral<"reserve_slot">;
2946
+ data: z.ZodObject<{
2947
+ slot_id: z.ZodString;
2948
+ }, z.core.$strip>;
2949
+ }, z.core.$strip>, z.ZodObject<{
2950
+ type: z.ZodLiteral<"reply">;
2951
+ reply_to: z.ZodString;
2952
+ ok: z.ZodLiteral<true>;
2953
+ request: z.ZodLiteral<"set_config">;
2954
+ data: z.ZodObject<{
2955
+ slots: z.ZodArray<z.ZodObject<{
2956
+ id: z.ZodString;
2957
+ port: z.ZodNumber;
2958
+ tv_port: z.ZodNumber;
2959
+ gslt_hint: z.ZodString;
2960
+ }, z.core.$strip>>;
2961
+ pinned_ip: z.ZodNullable<z.ZodString>;
2962
+ controller: z.ZodObject<{
2963
+ host: z.ZodString;
2964
+ tls: z.ZodBoolean;
2965
+ socket_path: z.ZodString;
2966
+ events_path: z.ZodString;
2967
+ }, z.core.$strip>;
2968
+ auto_update: z.ZodBoolean;
2969
+ demo_upload: z.ZodNullable<z.ZodObject<{
2970
+ url: z.ZodURL;
2971
+ limit_mbit: z.ZodNullable<z.ZodNumber>;
2972
+ header: z.ZodNullable<z.ZodObject<{
2973
+ name: z.ZodString;
2974
+ value_sha256: z.ZodString;
2975
+ }, z.core.$strip>>;
2976
+ }, z.core.$strip>>;
2977
+ memory_mb: z.ZodNullable<z.ZodNumber>;
2978
+ }, z.core.$strip>;
2979
+ }, z.core.$strip>, z.ZodObject<{
2980
+ type: z.ZodLiteral<"reply">;
2981
+ reply_to: z.ZodString;
2982
+ ok: z.ZodLiteral<true>;
2983
+ request: z.ZodLiteral<"update_agent">;
2984
+ data: z.ZodObject<{
2985
+ image: z.ZodString;
2986
+ step: z.ZodEnum<{
2987
+ pulling: "pulling";
2988
+ switching: "switching";
2989
+ unchanged: "unchanged";
2990
+ }>;
2991
+ }, z.core.$strip>;
2992
+ }, z.core.$strip>, z.ZodObject<{
2993
+ type: z.ZodLiteral<"reply">;
2994
+ reply_to: z.ZodString;
2995
+ ok: z.ZodLiteral<true>;
2996
+ request: z.ZodLiteral<"update_cs2_image">;
2997
+ data: z.ZodObject<{
2998
+ image: z.ZodString;
2999
+ step: z.ZodEnum<{
3000
+ pulling: "pulling";
3001
+ switching: "switching";
3002
+ }>;
3003
+ }, z.core.$strip>;
3004
+ }, z.core.$strip>, z.ZodObject<{
3005
+ type: z.ZodLiteral<"reply">;
3006
+ reply_to: z.ZodString;
3007
+ ok: z.ZodLiteral<true>;
3008
+ request: z.ZodLiteral<"console_command">;
3009
+ data: z.ZodObject<{
3010
+ allocation_id: z.ZodUUID;
3011
+ }, z.core.$strip>;
3012
+ }, z.core.$strip>, z.ZodObject<{
3013
+ type: z.ZodLiteral<"reply">;
3014
+ reply_to: z.ZodString;
3015
+ ok: z.ZodLiteral<true>;
3016
+ request: z.ZodLiteral<"restore_round">;
3017
+ data: z.ZodObject<{
3018
+ allocation_id: z.ZodUUID;
3019
+ round: z.ZodNumber;
3020
+ }, z.core.$strip>;
3021
+ }, z.core.$strip>, z.ZodObject<{
3022
+ type: z.ZodLiteral<"reply">;
3023
+ reply_to: z.ZodString;
3024
+ ok: z.ZodLiteral<true>;
3025
+ request: z.ZodLiteral<"start_match">;
3026
+ data: z.ZodObject<{
3027
+ allocation_id: z.ZodUUID;
3028
+ }, z.core.$strip>;
3029
+ }, z.core.$strip>], "request">, z.ZodObject<{
3030
+ type: z.ZodLiteral<"reply">;
3031
+ reply_to: z.ZodString;
3032
+ request: z.ZodNullable<z.ZodEnum<{
3033
+ start_server: "start_server";
3034
+ stop_server: "stop_server";
3035
+ update_cs2: "update_cs2";
3036
+ delete_demo: "delete_demo";
3037
+ reserve_slot: "reserve_slot";
3038
+ set_config: "set_config";
3039
+ update_agent: "update_agent";
3040
+ update_cs2_image: "update_cs2_image";
3041
+ console_command: "console_command";
3042
+ restore_round: "restore_round";
3043
+ start_match: "start_match";
3044
+ get_server_status: "get_server_status";
3045
+ }>>;
3046
+ ok: z.ZodLiteral<false>;
3047
+ error: z.ZodObject<{
3048
+ code: z.ZodEnum<{
3049
+ /** No slot is idle, unreserved and on a token Steam has not refused. */
3050
+ readonly noFreeSlot: "no_free_slot";
3051
+ /**
3052
+ * A newer public CS2 build is out and the node has not updated to it yet, so its `cs2.build_id`
3053
+ * is behind `cs2.latest_build_id`. The node takes launches again once it has updated. A node
3054
+ * whose `auto_update` is `false` never refuses with this.
3055
+ */
3056
+ readonly cs2Outdated: "cs2_outdated";
3057
+ /**
3058
+ * CS2 is not installed on the node, so its `cs2.build_id` is `null`. The node takes launches once
3059
+ * an {@link ControllerUpdateCs2 | update_cs2} has installed it.
3060
+ */
3061
+ readonly cs2NotInstalled: "cs2_not_installed";
3062
+ /** The node reports `unavailable` for a reason other than `maintenance`. */
3063
+ readonly nodeUnavailable: "node_unavailable";
3064
+ /**
3065
+ * An operation that needs every slot idle found one held: {@link ControllerUpdateCs2 | update_cs2}, or a
3066
+ * {@link ControllerSetConfig | set_config} that changes any key under `controller`.
3067
+ */
3068
+ readonly slotsHeld: "slots_held";
3069
+ /**
3070
+ * A slot holds a server that is `starting`, `running` or `stopping`, and
3071
+ * {@link ControllerSetConfig | set_config} would remove or re-port the slot or give its server's token
3072
+ * to another slot, or {@link ControllerReserveSlot | reserve_slot} asked for it. `detail` names the
3073
+ * slots.
3074
+ */
3075
+ readonly slotHeld: "slot_held";
3076
+ /** The node has no slot with that id. */
3077
+ readonly unknownSlot: "unknown_slot";
3078
+ /**
3079
+ * {@link ControllerSetConfig | set_config} kept the token of a slot the node does not have yet. A new
3080
+ * slot needs a new token.
3081
+ */
3082
+ readonly slotTokenRequired: "slot_token_required";
3083
+ /**
3084
+ * {@link ControllerSetConfig | set_config} kept the value of a demo upload header the node does not
3085
+ * send. A new header needs its value.
3086
+ */
3087
+ readonly demoHeaderValueRequired: "demo_header_value_required";
3088
+ /** No server with that allocation id. */
3089
+ readonly unknownAllocation: "unknown_allocation";
3090
+ /**
3091
+ * A maintenance operation runs on the node. That operation is unaffected, and `unavailable` shows
3092
+ * it as `maintenance`.
3093
+ */
3094
+ readonly maintenanceRunning: "maintenance_running";
3095
+ /**
3096
+ * The image is not on the node and the request asked for no pull. Asking again with `pull`
3097
+ * fetches it.
3098
+ */
3099
+ readonly imageMissing: "image_missing";
3100
+ /**
3101
+ * The image is not an official one, and the node's `official_images_only` is on. The node's
3102
+ * operator decides which images it runs.
3103
+ */
3104
+ readonly imageNotAllowed: "image_not_allowed";
3105
+ /** The demo is uploading. It can be deleted once the upload ends. */
3106
+ readonly demoUploading: "demo_uploading";
3107
+ /** The slot has no demo of that name, such as one an upload or a delete has already removed. */
3108
+ readonly unknownDemo: "unknown_demo";
3109
+ /** The demo is still being recorded. It can be deleted once its server ends the recording. */
3110
+ readonly demoRecording: "demo_recording";
3111
+ /** The server's plugin is not connected to the agent, or left before it answered. */
3112
+ readonly pluginOffline: "plugin_offline";
3113
+ /**
3114
+ * The plugin did not answer {@link ControllerGetServerStatus | get_server_status},
3115
+ * {@link ControllerConsoleCommand | console_command}, {@link ControllerStartMatch | start_match} or
3116
+ * {@link ControllerRestoreRound | restore_round} within {@link SERVER_STATUS_TIMEOUT_MS}.
3117
+ */
3118
+ readonly pluginStatusTimeout: "plugin_status_timeout";
3119
+ /** The server runs without a match. */
3120
+ readonly noMatch: "no_match";
3121
+ /** The match is past its warmup. */
3122
+ readonly notInWarmup: "not_in_warmup";
3123
+ /** A team has no player connected. */
3124
+ readonly teamEmpty: "team_empty";
3125
+ /** The match is not live, such as in warmup, during the knife round or after it ended. */
3126
+ readonly notLive: "not_live";
3127
+ /**
3128
+ * The match is in its halftime break, while the sides are about to swap. Ask again once the next
3129
+ * round has started.
3130
+ */
3131
+ readonly atHalftime: "at_halftime";
3132
+ /**
3133
+ * The node has no backup of the round that {@link ControllerRestoreRound | restore_round} named for that
3134
+ * server.
3135
+ */
3136
+ readonly noBackup: "no_backup";
3137
+ /** The request did not match its schema. */
3138
+ readonly invalidRequest: "invalid_request";
3139
+ /**
3140
+ * {@link ControllerStartServer | start_server} named an allocation this node is already launching or
3141
+ * running. Its server exists or is on its way, as after a {@link ControllerStartServer | start_server}
3142
+ * sent again when its reply was slow.
3143
+ */
3144
+ readonly allocationInUse: "allocation_in_use";
3145
+ /**
3146
+ * {@link ControllerStartServer | start_server} named an allocation that this node launched before, among
3147
+ * the last {@link REMEMBERED_ALLOCATIONS}. The node files a server's events and demos under its
3148
+ * allocation, so every launch needs a new one.
3149
+ */
3150
+ readonly allocationReused: "allocation_reused";
3151
+ /** The agent does not know the request's `type`, or the plugin the command's. */
3152
+ readonly unsupportedRequest: "unsupported_request";
3153
+ /**
3154
+ * The agent is stopping and started no work for the request, as after its
3155
+ * {@link AgentShutdown | shutdown}. Send the request again once the node reconnects.
3156
+ */
3157
+ readonly shuttingDown: "shutting_down";
3158
+ /** Any failure that no other code names, such as a Docker failure. */
3159
+ readonly failed: "failed";
3160
+ }>;
3161
+ detail: z.ZodString;
3162
+ }, z.core.$strip>;
3163
+ }, z.core.$strip>], "ok">;
3164
+ /** What a request comes to, without the correlation fields of the frame. */
3165
+ export type AgentReplyOutcome = {
3166
+ ok: true;
3167
+ data: unknown;
3168
+ } | {
3169
+ ok: false;
3170
+ error: AgentError;
3171
+ };
3172
+ /** What a successful reply to that request carries as `data`. */
3173
+ export type ReplyData<T extends RequestType> = Extract<z.infer<typeof AgentReplySuccess>, {
3174
+ request: T;
3175
+ }>['data'];
3176
+ /**
3177
+ * What the agent sends: its {@link AgentHello | hello}, one {@link AgentReply | reply} to each
3178
+ * request, and reports of the node as it changes. Until a {@link ControllerWelcome | welcome} answers the
3179
+ * {@link AgentHello | hello}, only replies follow it, and a {@link AgentShutdown | shutdown} if the
3180
+ * agent stops.
3181
+ */
3182
+ export declare const AgentToControllerMessage: z.ZodDiscriminatedUnion<[z.ZodObject<{
3183
+ type: z.ZodLiteral<"hello">;
3184
+ agent: z.ZodObject<{
3185
+ version: z.ZodString;
3186
+ image: z.ZodString;
3187
+ image_id: z.ZodString;
3188
+ }, z.core.$strip>;
3189
+ host: z.ZodObject<{
3190
+ cpu_count: z.ZodNumber;
3191
+ os_name: z.ZodNullable<z.ZodString>;
3192
+ kernel: z.ZodString;
3193
+ }, z.core.$strip>;
3194
+ public_ip: z.ZodNullable<z.ZodString>;
3195
+ country: z.ZodNullable<z.ZodString>;
3196
+ config: z.ZodObject<{
3197
+ slots: z.ZodArray<z.ZodObject<{
3198
+ id: z.ZodString;
3199
+ port: z.ZodNumber;
3200
+ tv_port: z.ZodNumber;
3201
+ gslt_hint: z.ZodString;
3202
+ }, z.core.$strip>>;
3203
+ pinned_ip: z.ZodNullable<z.ZodString>;
3204
+ controller: z.ZodObject<{
3205
+ host: z.ZodString;
3206
+ tls: z.ZodBoolean;
3207
+ socket_path: z.ZodString;
3208
+ events_path: z.ZodString;
3209
+ }, z.core.$strip>;
3210
+ auto_update: z.ZodBoolean;
3211
+ demo_upload: z.ZodNullable<z.ZodObject<{
3212
+ url: z.ZodURL;
3213
+ limit_mbit: z.ZodNullable<z.ZodNumber>;
3214
+ header: z.ZodNullable<z.ZodObject<{
3215
+ name: z.ZodString;
3216
+ value_sha256: z.ZodString;
3217
+ }, z.core.$strip>>;
3218
+ }, z.core.$strip>>;
3219
+ memory_mb: z.ZodNullable<z.ZodNumber>;
3220
+ }, z.core.$strip>;
3221
+ slot_status: z.ZodArray<z.ZodObject<{
3222
+ slot_id: z.ZodString;
3223
+ state: z.ZodEnum<{
3224
+ idle: "idle";
3225
+ starting: "starting";
3226
+ running: "running";
3227
+ stopping: "stopping";
3228
+ }>;
3229
+ allocation_id: z.ZodNullable<z.ZodUUID>;
3230
+ match_id: z.ZodNullable<z.ZodUUID>;
3231
+ plugin_online: z.ZodBoolean;
3232
+ gslt_state: z.ZodEnum<{
3233
+ ok: "ok";
3234
+ invalid: "invalid";
3235
+ unchecked: "unchecked";
3236
+ }>;
3237
+ reserved: z.ZodBoolean;
3238
+ server_steam_id: z.ZodNullable<z.ZodString>;
3239
+ }, z.core.$strip>>;
3240
+ cs2: z.ZodObject<{
3241
+ build_id: z.ZodNullable<z.ZodString>;
3242
+ latest_build_id: z.ZodNullable<z.ZodString>;
3243
+ image: z.ZodString;
3244
+ image_id: z.ZodNullable<z.ZodString>;
3245
+ update: z.ZodNullable<z.ZodObject<{
3246
+ id: z.ZodUUID;
3247
+ mode: z.ZodEnum<{
3248
+ update: "update";
3249
+ verify: "verify";
3250
+ reinstall: "reinstall";
3251
+ }>;
3252
+ automatic: z.ZodBoolean;
3253
+ outcome: z.ZodNullable<z.ZodEnum<{
3254
+ failed: "failed";
3255
+ completed: "completed";
3256
+ pull_failed: "pull_failed";
3257
+ overlay_failed: "overlay_failed";
3258
+ unobserved: "unobserved";
3259
+ }>>;
3260
+ detail: z.ZodNullable<z.ZodString>;
3261
+ }, z.core.$strip>>;
3262
+ image_update: z.ZodNullable<z.ZodObject<{
3263
+ image: z.ZodString;
3264
+ step: z.ZodNullable<z.ZodEnum<{
3265
+ pulling: "pulling";
3266
+ switching: "switching";
3267
+ }>>;
3268
+ outcome: z.ZodNullable<z.ZodEnum<{
3269
+ failed: "failed";
3270
+ completed: "completed";
3271
+ pull_failed: "pull_failed";
3272
+ overlay_failed: "overlay_failed";
3273
+ }>>;
3274
+ detail: z.ZodNullable<z.ZodString>;
3275
+ }, z.core.$strip>>;
3276
+ }, z.core.$strip>;
3277
+ unavailable: z.ZodNullable<z.ZodObject<{
3278
+ code: z.ZodEnum<{
3279
+ /** The {@link MaintenanceOperation} in `operation` runs. It clears when the operation ends. */
3280
+ readonly maintenance: "maintenance";
3281
+ /**
3282
+ * The agent cannot use the local store that keeps gameplay events until the controller takes
3283
+ * them. `detail` says why.
3284
+ * - If a call to the store waits past its limit, as on a disk that hangs, the code clears once
3285
+ * the store answers. Deleting the store or restarting the agent loses what waits to be written.
3286
+ * - If the agent cannot open the store, such as one that a newer agent wrote, a corrupt file or
3287
+ * one it cannot write, the code lasts until a restart. Update the agent, or delete the store on
3288
+ * the host and restart the agent. Deleting it loses the events and server exits it keeps.
3289
+ */
3290
+ readonly eventStorage: "event_storage";
3291
+ /**
3292
+ * The disk under the agent's data directory has less than {@link DISK_SPACE_MIN_BYTES} free, too
3293
+ * little for a match's events and demo. The agent asks the disk every 30 seconds and before each
3294
+ * launch, so the code clears within 30 seconds of space being freed, and a launch that arrives
3295
+ * sooner is taken if the disk has room by then.
3296
+ */
3297
+ readonly diskSpace: "disk_space";
3298
+ }>;
3299
+ operation: z.ZodNullable<z.ZodEnum<{
3300
+ cs2_update: "cs2_update";
3301
+ agent_update: "agent_update";
3302
+ cs2_image_update: "cs2_image_update";
3303
+ image_cleanup: "image_cleanup";
3304
+ }>>;
3305
+ detail: z.ZodString;
3306
+ }, z.core.$strip>>;
3307
+ demos: z.ZodArray<z.ZodObject<{
3308
+ slot_id: z.ZodString;
3309
+ file_name: z.ZodString;
3310
+ size_bytes: z.ZodNumber;
3311
+ modified_at: z.ZodNumber;
3312
+ recording: z.ZodBoolean;
3313
+ uploading: z.ZodBoolean;
3314
+ upload_error: z.ZodNullable<z.ZodString>;
3315
+ }, z.core.$strip>>;
3316
+ server_exits: z.ZodArray<z.ZodObject<{
3317
+ slot_id: z.ZodString;
3318
+ allocation_id: z.ZodUUID;
3319
+ reason: z.ZodEnum<{
3320
+ idle_empty: "idle_empty";
3321
+ config_rejected: "config_rejected";
3322
+ start_timeout: "start_timeout";
3323
+ quit_timeout: "quit_timeout";
3324
+ slot_removed: "slot_removed";
3325
+ requested: "requested";
3326
+ clean_exit: "clean_exit";
3327
+ crashed: "crashed";
3328
+ launch_failed: "launch_failed";
3329
+ lost: "lost";
3330
+ }>;
3331
+ exit_code: z.ZodNullable<z.ZodNumber>;
3332
+ detail: z.ZodNullable<z.ZodString>;
3333
+ }, z.core.$strip>>;
3334
+ event_backlog: z.ZodObject<{
3335
+ servers: z.ZodArray<z.ZodObject<{
3336
+ allocation_id: z.ZodUUID;
3337
+ pending: z.ZodNumber;
3338
+ }, z.core.$strip>>;
3339
+ server_count: z.ZodNumber;
3340
+ event_count: z.ZodNumber;
3341
+ reason: z.ZodNullable<z.ZodString>;
3342
+ }, z.core.$strip>;
3343
+ agent_update: z.ZodNullable<z.ZodObject<{
3344
+ image: z.ZodString;
3345
+ step: z.ZodNullable<z.ZodEnum<{
3346
+ pulling: "pulling";
3347
+ switching: "switching";
3348
+ }>>;
3349
+ outcome: z.ZodNullable<z.ZodEnum<{
3350
+ failed: "failed";
3351
+ completed: "completed";
3352
+ unchanged: "unchanged";
3353
+ pull_failed: "pull_failed";
3354
+ }>>;
3355
+ detail: z.ZodNullable<z.ZodString>;
3356
+ }, z.core.$strip>>;
3357
+ }, z.core.$strip>, z.ZodObject<{
3358
+ type: z.ZodLiteral<"node_status">;
3359
+ cs2: z.ZodObject<{
3360
+ build_id: z.ZodNullable<z.ZodString>;
3361
+ latest_build_id: z.ZodNullable<z.ZodString>;
3362
+ image: z.ZodString;
3363
+ image_id: z.ZodNullable<z.ZodString>;
3364
+ update: z.ZodNullable<z.ZodObject<{
3365
+ id: z.ZodUUID;
3366
+ mode: z.ZodEnum<{
3367
+ update: "update";
3368
+ verify: "verify";
3369
+ reinstall: "reinstall";
3370
+ }>;
3371
+ automatic: z.ZodBoolean;
3372
+ outcome: z.ZodNullable<z.ZodEnum<{
3373
+ failed: "failed";
3374
+ completed: "completed";
3375
+ pull_failed: "pull_failed";
3376
+ overlay_failed: "overlay_failed";
3377
+ unobserved: "unobserved";
3378
+ }>>;
3379
+ detail: z.ZodNullable<z.ZodString>;
3380
+ }, z.core.$strip>>;
3381
+ image_update: z.ZodNullable<z.ZodObject<{
3382
+ image: z.ZodString;
3383
+ step: z.ZodNullable<z.ZodEnum<{
3384
+ pulling: "pulling";
3385
+ switching: "switching";
3386
+ }>>;
3387
+ outcome: z.ZodNullable<z.ZodEnum<{
3388
+ failed: "failed";
3389
+ completed: "completed";
3390
+ pull_failed: "pull_failed";
3391
+ overlay_failed: "overlay_failed";
3392
+ }>>;
3393
+ detail: z.ZodNullable<z.ZodString>;
3394
+ }, z.core.$strip>>;
3395
+ }, z.core.$strip>;
3396
+ unavailable: z.ZodNullable<z.ZodObject<{
3397
+ code: z.ZodEnum<{
3398
+ /** The {@link MaintenanceOperation} in `operation` runs. It clears when the operation ends. */
3399
+ readonly maintenance: "maintenance";
3400
+ /**
3401
+ * The agent cannot use the local store that keeps gameplay events until the controller takes
3402
+ * them. `detail` says why.
3403
+ * - If a call to the store waits past its limit, as on a disk that hangs, the code clears once
3404
+ * the store answers. Deleting the store or restarting the agent loses what waits to be written.
3405
+ * - If the agent cannot open the store, such as one that a newer agent wrote, a corrupt file or
3406
+ * one it cannot write, the code lasts until a restart. Update the agent, or delete the store on
3407
+ * the host and restart the agent. Deleting it loses the events and server exits it keeps.
3408
+ */
3409
+ readonly eventStorage: "event_storage";
3410
+ /**
3411
+ * The disk under the agent's data directory has less than {@link DISK_SPACE_MIN_BYTES} free, too
3412
+ * little for a match's events and demo. The agent asks the disk every 30 seconds and before each
3413
+ * launch, so the code clears within 30 seconds of space being freed, and a launch that arrives
3414
+ * sooner is taken if the disk has room by then.
3415
+ */
3416
+ readonly diskSpace: "disk_space";
3417
+ }>;
3418
+ operation: z.ZodNullable<z.ZodEnum<{
3419
+ cs2_update: "cs2_update";
3420
+ agent_update: "agent_update";
3421
+ cs2_image_update: "cs2_image_update";
3422
+ image_cleanup: "image_cleanup";
3423
+ }>>;
3424
+ detail: z.ZodString;
3425
+ }, z.core.$strip>>;
3426
+ agent_update: z.ZodNullable<z.ZodObject<{
3427
+ image: z.ZodString;
3428
+ step: z.ZodNullable<z.ZodEnum<{
3429
+ pulling: "pulling";
3430
+ switching: "switching";
3431
+ }>>;
3432
+ outcome: z.ZodNullable<z.ZodEnum<{
3433
+ failed: "failed";
3434
+ completed: "completed";
3435
+ unchanged: "unchanged";
3436
+ pull_failed: "pull_failed";
3437
+ }>>;
3438
+ detail: z.ZodNullable<z.ZodString>;
3439
+ }, z.core.$strip>>;
3440
+ }, z.core.$strip>, z.ZodObject<{
3441
+ type: z.ZodLiteral<"shutdown">;
3442
+ signal: z.ZodEnum<{
3443
+ SIGINT: "SIGINT";
3444
+ SIGTERM: "SIGTERM";
3445
+ SIGQUIT: "SIGQUIT";
3446
+ }>;
3447
+ }, z.core.$strip>, z.ZodObject<{
3448
+ slot_id: z.ZodString;
3449
+ state: z.ZodEnum<{
3450
+ idle: "idle";
3451
+ starting: "starting";
3452
+ running: "running";
3453
+ stopping: "stopping";
3454
+ }>;
3455
+ allocation_id: z.ZodNullable<z.ZodUUID>;
3456
+ match_id: z.ZodNullable<z.ZodUUID>;
3457
+ plugin_online: z.ZodBoolean;
3458
+ gslt_state: z.ZodEnum<{
3459
+ ok: "ok";
3460
+ invalid: "invalid";
3461
+ unchecked: "unchecked";
3462
+ }>;
3463
+ reserved: z.ZodBoolean;
3464
+ server_steam_id: z.ZodNullable<z.ZodString>;
3465
+ type: z.ZodLiteral<"slot_status">;
3466
+ }, z.core.$strip>, z.ZodObject<{
3467
+ slot_id: z.ZodString;
3468
+ allocation_id: z.ZodUUID;
3469
+ reason: z.ZodEnum<{
3470
+ idle_empty: "idle_empty";
3471
+ config_rejected: "config_rejected";
3472
+ start_timeout: "start_timeout";
3473
+ quit_timeout: "quit_timeout";
3474
+ slot_removed: "slot_removed";
3475
+ requested: "requested";
3476
+ clean_exit: "clean_exit";
3477
+ crashed: "crashed";
3478
+ launch_failed: "launch_failed";
3479
+ lost: "lost";
3480
+ }>;
3481
+ exit_code: z.ZodNullable<z.ZodNumber>;
3482
+ detail: z.ZodNullable<z.ZodString>;
3483
+ type: z.ZodLiteral<"server_exited">;
3484
+ }, z.core.$strip>, z.ZodObject<{
3485
+ type: z.ZodLiteral<"log_batch">;
3486
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
3487
+ kind: z.ZodLiteral<"agent">;
3488
+ }, z.core.$strip>, z.ZodObject<{
3489
+ kind: z.ZodLiteral<"cs2_update">;
3490
+ update_id: z.ZodUUID;
3491
+ }, z.core.$strip>, z.ZodObject<{
3492
+ kind: z.ZodLiteral<"server">;
3493
+ allocation_id: z.ZodUUID;
3494
+ }, z.core.$strip>], "kind">;
3495
+ replay_id: z.ZodNullable<z.ZodString>;
3496
+ reset: z.ZodBoolean;
3497
+ lines: z.ZodArray<z.ZodObject<{
3498
+ at: z.ZodNumber;
3499
+ level: z.ZodNullable<z.ZodEnum<{
3500
+ error: "error";
3501
+ info: "info";
3502
+ warn: "warn";
3503
+ }>>;
3504
+ line: z.ZodString;
3505
+ }, z.core.$strip>>;
3506
+ }, z.core.$strip>, z.ZodObject<{
3507
+ type: z.ZodLiteral<"log_index">;
3508
+ sources: z.ZodArray<z.ZodObject<{
3509
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
3510
+ kind: z.ZodLiteral<"agent">;
3511
+ }, z.core.$strip>, z.ZodObject<{
3512
+ kind: z.ZodLiteral<"cs2_update">;
3513
+ update_id: z.ZodUUID;
3514
+ }, z.core.$strip>, z.ZodObject<{
3515
+ kind: z.ZodLiteral<"server">;
3516
+ allocation_id: z.ZodUUID;
3517
+ }, z.core.$strip>], "kind">;
3518
+ line_count: z.ZodNumber;
3519
+ last_line_at: z.ZodNullable<z.ZodNumber>;
3520
+ ended: z.ZodBoolean;
3521
+ }, z.core.$strip>>;
3522
+ }, z.core.$strip>, z.ZodObject<{
3523
+ type: z.ZodLiteral<"cs2_update_progress">;
3524
+ update_id: z.ZodUUID;
3525
+ percent: z.ZodNullable<z.ZodNumber>;
3526
+ message: z.ZodString;
3527
+ }, z.core.$strip>, z.ZodObject<{
3528
+ slot_id: z.ZodString;
3529
+ file_name: z.ZodString;
3530
+ size_bytes: z.ZodNumber;
3531
+ modified_at: z.ZodNumber;
3532
+ recording: z.ZodBoolean;
3533
+ uploading: z.ZodBoolean;
3534
+ upload_error: z.ZodNullable<z.ZodString>;
3535
+ type: z.ZodLiteral<"demo">;
3536
+ }, z.core.$strip>, z.ZodObject<{
3537
+ type: z.ZodLiteral<"demo_removed">;
3538
+ slot_id: z.ZodString;
3539
+ file_name: z.ZodString;
3540
+ reason: z.ZodEnum<{
3541
+ uploaded: "uploaded";
3542
+ deleted: "deleted";
3543
+ }>;
3544
+ }, z.core.$strip>, z.ZodObject<{
3545
+ type: z.ZodLiteral<"demo_progress">;
3546
+ slot_id: z.ZodString;
3547
+ file_name: z.ZodString;
3548
+ sent_bytes: z.ZodNumber;
3549
+ bytes_per_second: z.ZodNumber;
3550
+ }, z.core.$strip>, z.ZodObject<{
3551
+ type: z.ZodLiteral<"resource_batch">;
3552
+ ticks: z.ZodArray<z.ZodObject<{
3553
+ at: z.ZodNumber;
3554
+ disk: z.ZodNullable<z.ZodObject<{
3555
+ cap: z.ZodNumber;
3556
+ used: z.ZodNumber;
3557
+ }, z.core.$strip>>;
3558
+ memory: z.ZodObject<{
3559
+ cap: z.ZodNumber;
3560
+ used: z.ZodNumber;
3561
+ }, z.core.$strip>;
3562
+ cpu: z.ZodNullable<z.ZodObject<{
3563
+ max: z.ZodNumber;
3564
+ average: z.ZodNumber;
3565
+ }, z.core.$strip>>;
3566
+ }, z.core.$strip>>;
3567
+ reset: z.ZodBoolean;
3568
+ }, z.core.$strip>, z.ZodObject<{
3569
+ servers: z.ZodArray<z.ZodObject<{
3570
+ allocation_id: z.ZodUUID;
3571
+ pending: z.ZodNumber;
3572
+ }, z.core.$strip>>;
3573
+ server_count: z.ZodNumber;
3574
+ event_count: z.ZodNumber;
3575
+ reason: z.ZodNullable<z.ZodString>;
3576
+ type: z.ZodLiteral<"event_backlog">;
3577
+ }, z.core.$strip>, z.ZodObject<{
3578
+ type: z.ZodLiteral<"phase_change">;
3579
+ allocation_id: z.ZodUUID;
3580
+ phase: z.ZodEnum<{
3581
+ side_choice: "side_choice";
3582
+ knife: "knife";
3583
+ loading: "loading";
3584
+ warmup: "warmup";
3585
+ pending_restore: "pending_restore";
3586
+ live: "live";
3587
+ post_live: "post_live";
3588
+ }>;
3589
+ }, z.core.$strip>, z.ZodObject<{
3590
+ type: z.ZodLiteral<"score">;
3591
+ allocation_id: z.ZodUUID;
3592
+ team1_score: z.ZodNumber;
3593
+ team2_score: z.ZodNumber;
3594
+ }, z.core.$strip>, z.ZodObject<{
3595
+ type: z.ZodLiteral<"backup">;
3596
+ allocation_id: z.ZodUUID;
3597
+ backup: z.ZodObject<{
3598
+ roster: z.ZodObject<{
3599
+ team1: z.ZodObject<{
3600
+ name: z.ZodString;
3601
+ players: z.ZodArray<z.ZodString>;
3602
+ }, z.core.$strip>;
3603
+ team2: z.ZodObject<{
3604
+ name: z.ZodString;
3605
+ players: z.ZodArray<z.ZodString>;
3606
+ }, z.core.$strip>;
3607
+ spectators: z.ZodArray<z.ZodString>;
3608
+ }, z.core.$strip>;
3609
+ team1_side: z.ZodEnum<{
3610
+ t: "t";
3611
+ ct: "ct";
3612
+ }>;
3613
+ rules: z.ZodObject<{
3614
+ max_rounds: z.ZodNumber;
3615
+ overtime: z.ZodBoolean;
3616
+ overtime_max_rounds: z.ZodNumber;
3617
+ friendly_fire: z.ZodBoolean;
3618
+ }, z.core.$strip>;
3619
+ file: z.ZodString;
3620
+ round: z.ZodNumber;
3621
+ team1_score: z.ZodNumber;
3622
+ team2_score: z.ZodNumber;
3623
+ timestamp: z.ZodNumber;
3624
+ tick: z.ZodNumber;
3625
+ type: z.ZodLiteral<"round_backup">;
3626
+ }, z.core.$strip>;
3627
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
3628
+ type: z.ZodLiteral<"reply">;
3629
+ reply_to: z.ZodString;
3630
+ ok: z.ZodLiteral<true>;
3631
+ request: z.ZodLiteral<"start_server">;
3632
+ data: z.ZodObject<{
3633
+ allocation_id: z.ZodUUID;
3634
+ slot_id: z.ZodString;
3635
+ }, z.core.$strip>;
3636
+ }, z.core.$strip>, z.ZodObject<{
3637
+ type: z.ZodLiteral<"reply">;
3638
+ reply_to: z.ZodString;
3639
+ ok: z.ZodLiteral<true>;
3640
+ request: z.ZodLiteral<"stop_server">;
3641
+ data: z.ZodObject<{
3642
+ allocation_id: z.ZodUUID;
3643
+ }, z.core.$strip>;
3644
+ }, z.core.$strip>, z.ZodObject<{
3645
+ type: z.ZodLiteral<"reply">;
3646
+ reply_to: z.ZodString;
3647
+ ok: z.ZodLiteral<true>;
3648
+ request: z.ZodLiteral<"get_server_status">;
3649
+ data: z.ZodObject<{
3650
+ map_name: z.ZodString;
3651
+ match: z.ZodNullable<z.ZodObject<{
3652
+ match_id: z.ZodNullable<z.ZodUUID>;
3653
+ phase: z.ZodEnum<{
3654
+ side_choice: "side_choice";
3655
+ knife: "knife";
3656
+ loading: "loading";
3657
+ warmup: "warmup";
3658
+ pending_restore: "pending_restore";
3659
+ live: "live";
3660
+ post_live: "post_live";
3661
+ }>;
3662
+ team1_side: z.ZodEnum<{
3663
+ t: "t";
3664
+ ct: "ct";
3665
+ }>;
3666
+ team2_side: z.ZodEnum<{
3667
+ t: "t";
3668
+ ct: "ct";
3669
+ }>;
3670
+ team1_score: z.ZodNumber;
3671
+ team2_score: z.ZodNumber;
3672
+ }, z.core.$strip>>;
3673
+ players: z.ZodArray<z.ZodObject<{
3674
+ steam_id: z.ZodString;
3675
+ name: z.ZodString;
3676
+ side: z.ZodEnum<{
3677
+ t: "t";
3678
+ ct: "ct";
3679
+ spec: "spec";
3680
+ }>;
3681
+ }, z.core.$strip>>;
3682
+ config_error: z.ZodNullable<z.ZodString>;
3683
+ ready: z.ZodBoolean;
3684
+ server_steam_id: z.ZodNullable<z.ZodString>;
3685
+ allocation_id: z.ZodUUID;
3686
+ }, z.core.$strip>;
3687
+ }, z.core.$strip>, z.ZodObject<{
3688
+ type: z.ZodLiteral<"reply">;
3689
+ reply_to: z.ZodString;
3690
+ ok: z.ZodLiteral<true>;
3691
+ request: z.ZodLiteral<"update_cs2">;
3692
+ data: z.ZodObject<{
3693
+ update_id: z.ZodUUID;
3694
+ }, z.core.$strip>;
3695
+ }, z.core.$strip>, z.ZodObject<{
3696
+ type: z.ZodLiteral<"reply">;
3697
+ reply_to: z.ZodString;
3698
+ ok: z.ZodLiteral<true>;
3699
+ request: z.ZodLiteral<"delete_demo">;
3700
+ data: z.ZodObject<{
3701
+ slot_id: z.ZodString;
3702
+ file_name: z.ZodString;
3703
+ }, z.core.$strip>;
3704
+ }, z.core.$strip>, z.ZodObject<{
3705
+ type: z.ZodLiteral<"reply">;
3706
+ reply_to: z.ZodString;
3707
+ ok: z.ZodLiteral<true>;
3708
+ request: z.ZodLiteral<"reserve_slot">;
3709
+ data: z.ZodObject<{
3710
+ slot_id: z.ZodString;
3711
+ }, z.core.$strip>;
3712
+ }, z.core.$strip>, z.ZodObject<{
3713
+ type: z.ZodLiteral<"reply">;
3714
+ reply_to: z.ZodString;
3715
+ ok: z.ZodLiteral<true>;
3716
+ request: z.ZodLiteral<"set_config">;
3717
+ data: z.ZodObject<{
3718
+ slots: z.ZodArray<z.ZodObject<{
3719
+ id: z.ZodString;
3720
+ port: z.ZodNumber;
3721
+ tv_port: z.ZodNumber;
3722
+ gslt_hint: z.ZodString;
3723
+ }, z.core.$strip>>;
3724
+ pinned_ip: z.ZodNullable<z.ZodString>;
3725
+ controller: z.ZodObject<{
3726
+ host: z.ZodString;
3727
+ tls: z.ZodBoolean;
3728
+ socket_path: z.ZodString;
3729
+ events_path: z.ZodString;
3730
+ }, z.core.$strip>;
3731
+ auto_update: z.ZodBoolean;
3732
+ demo_upload: z.ZodNullable<z.ZodObject<{
3733
+ url: z.ZodURL;
3734
+ limit_mbit: z.ZodNullable<z.ZodNumber>;
3735
+ header: z.ZodNullable<z.ZodObject<{
3736
+ name: z.ZodString;
3737
+ value_sha256: z.ZodString;
3738
+ }, z.core.$strip>>;
3739
+ }, z.core.$strip>>;
3740
+ memory_mb: z.ZodNullable<z.ZodNumber>;
3741
+ }, z.core.$strip>;
3742
+ }, z.core.$strip>, z.ZodObject<{
3743
+ type: z.ZodLiteral<"reply">;
3744
+ reply_to: z.ZodString;
3745
+ ok: z.ZodLiteral<true>;
3746
+ request: z.ZodLiteral<"update_agent">;
3747
+ data: z.ZodObject<{
3748
+ image: z.ZodString;
3749
+ step: z.ZodEnum<{
3750
+ pulling: "pulling";
3751
+ switching: "switching";
3752
+ unchanged: "unchanged";
3753
+ }>;
3754
+ }, z.core.$strip>;
3755
+ }, z.core.$strip>, z.ZodObject<{
3756
+ type: z.ZodLiteral<"reply">;
3757
+ reply_to: z.ZodString;
3758
+ ok: z.ZodLiteral<true>;
3759
+ request: z.ZodLiteral<"update_cs2_image">;
3760
+ data: z.ZodObject<{
3761
+ image: z.ZodString;
3762
+ step: z.ZodEnum<{
3763
+ pulling: "pulling";
3764
+ switching: "switching";
3765
+ }>;
3766
+ }, z.core.$strip>;
3767
+ }, z.core.$strip>, z.ZodObject<{
3768
+ type: z.ZodLiteral<"reply">;
3769
+ reply_to: z.ZodString;
3770
+ ok: z.ZodLiteral<true>;
3771
+ request: z.ZodLiteral<"console_command">;
3772
+ data: z.ZodObject<{
3773
+ allocation_id: z.ZodUUID;
3774
+ }, z.core.$strip>;
3775
+ }, z.core.$strip>, z.ZodObject<{
3776
+ type: z.ZodLiteral<"reply">;
3777
+ reply_to: z.ZodString;
3778
+ ok: z.ZodLiteral<true>;
3779
+ request: z.ZodLiteral<"restore_round">;
3780
+ data: z.ZodObject<{
3781
+ allocation_id: z.ZodUUID;
3782
+ round: z.ZodNumber;
3783
+ }, z.core.$strip>;
3784
+ }, z.core.$strip>, z.ZodObject<{
3785
+ type: z.ZodLiteral<"reply">;
3786
+ reply_to: z.ZodString;
3787
+ ok: z.ZodLiteral<true>;
3788
+ request: z.ZodLiteral<"start_match">;
3789
+ data: z.ZodObject<{
3790
+ allocation_id: z.ZodUUID;
3791
+ }, z.core.$strip>;
3792
+ }, z.core.$strip>], "request">, z.ZodObject<{
3793
+ type: z.ZodLiteral<"reply">;
3794
+ reply_to: z.ZodString;
3795
+ request: z.ZodNullable<z.ZodEnum<{
3796
+ start_server: "start_server";
3797
+ stop_server: "stop_server";
3798
+ update_cs2: "update_cs2";
3799
+ delete_demo: "delete_demo";
3800
+ reserve_slot: "reserve_slot";
3801
+ set_config: "set_config";
3802
+ update_agent: "update_agent";
3803
+ update_cs2_image: "update_cs2_image";
3804
+ console_command: "console_command";
3805
+ restore_round: "restore_round";
3806
+ start_match: "start_match";
3807
+ get_server_status: "get_server_status";
3808
+ }>>;
3809
+ ok: z.ZodLiteral<false>;
3810
+ error: z.ZodObject<{
3811
+ code: z.ZodEnum<{
3812
+ /** No slot is idle, unreserved and on a token Steam has not refused. */
3813
+ readonly noFreeSlot: "no_free_slot";
3814
+ /**
3815
+ * A newer public CS2 build is out and the node has not updated to it yet, so its `cs2.build_id`
3816
+ * is behind `cs2.latest_build_id`. The node takes launches again once it has updated. A node
3817
+ * whose `auto_update` is `false` never refuses with this.
3818
+ */
3819
+ readonly cs2Outdated: "cs2_outdated";
3820
+ /**
3821
+ * CS2 is not installed on the node, so its `cs2.build_id` is `null`. The node takes launches once
3822
+ * an {@link ControllerUpdateCs2 | update_cs2} has installed it.
3823
+ */
3824
+ readonly cs2NotInstalled: "cs2_not_installed";
3825
+ /** The node reports `unavailable` for a reason other than `maintenance`. */
3826
+ readonly nodeUnavailable: "node_unavailable";
3827
+ /**
3828
+ * An operation that needs every slot idle found one held: {@link ControllerUpdateCs2 | update_cs2}, or a
3829
+ * {@link ControllerSetConfig | set_config} that changes any key under `controller`.
3830
+ */
3831
+ readonly slotsHeld: "slots_held";
3832
+ /**
3833
+ * A slot holds a server that is `starting`, `running` or `stopping`, and
3834
+ * {@link ControllerSetConfig | set_config} would remove or re-port the slot or give its server's token
3835
+ * to another slot, or {@link ControllerReserveSlot | reserve_slot} asked for it. `detail` names the
3836
+ * slots.
3837
+ */
3838
+ readonly slotHeld: "slot_held";
3839
+ /** The node has no slot with that id. */
3840
+ readonly unknownSlot: "unknown_slot";
3841
+ /**
3842
+ * {@link ControllerSetConfig | set_config} kept the token of a slot the node does not have yet. A new
3843
+ * slot needs a new token.
3844
+ */
3845
+ readonly slotTokenRequired: "slot_token_required";
3846
+ /**
3847
+ * {@link ControllerSetConfig | set_config} kept the value of a demo upload header the node does not
3848
+ * send. A new header needs its value.
3849
+ */
3850
+ readonly demoHeaderValueRequired: "demo_header_value_required";
3851
+ /** No server with that allocation id. */
3852
+ readonly unknownAllocation: "unknown_allocation";
3853
+ /**
3854
+ * A maintenance operation runs on the node. That operation is unaffected, and `unavailable` shows
3855
+ * it as `maintenance`.
3856
+ */
3857
+ readonly maintenanceRunning: "maintenance_running";
3858
+ /**
3859
+ * The image is not on the node and the request asked for no pull. Asking again with `pull`
3860
+ * fetches it.
3861
+ */
3862
+ readonly imageMissing: "image_missing";
3863
+ /**
3864
+ * The image is not an official one, and the node's `official_images_only` is on. The node's
3865
+ * operator decides which images it runs.
3866
+ */
3867
+ readonly imageNotAllowed: "image_not_allowed";
3868
+ /** The demo is uploading. It can be deleted once the upload ends. */
3869
+ readonly demoUploading: "demo_uploading";
3870
+ /** The slot has no demo of that name, such as one an upload or a delete has already removed. */
3871
+ readonly unknownDemo: "unknown_demo";
3872
+ /** The demo is still being recorded. It can be deleted once its server ends the recording. */
3873
+ readonly demoRecording: "demo_recording";
3874
+ /** The server's plugin is not connected to the agent, or left before it answered. */
3875
+ readonly pluginOffline: "plugin_offline";
3876
+ /**
3877
+ * The plugin did not answer {@link ControllerGetServerStatus | get_server_status},
3878
+ * {@link ControllerConsoleCommand | console_command}, {@link ControllerStartMatch | start_match} or
3879
+ * {@link ControllerRestoreRound | restore_round} within {@link SERVER_STATUS_TIMEOUT_MS}.
3880
+ */
3881
+ readonly pluginStatusTimeout: "plugin_status_timeout";
3882
+ /** The server runs without a match. */
3883
+ readonly noMatch: "no_match";
3884
+ /** The match is past its warmup. */
3885
+ readonly notInWarmup: "not_in_warmup";
3886
+ /** A team has no player connected. */
3887
+ readonly teamEmpty: "team_empty";
3888
+ /** The match is not live, such as in warmup, during the knife round or after it ended. */
3889
+ readonly notLive: "not_live";
3890
+ /**
3891
+ * The match is in its halftime break, while the sides are about to swap. Ask again once the next
3892
+ * round has started.
3893
+ */
3894
+ readonly atHalftime: "at_halftime";
3895
+ /**
3896
+ * The node has no backup of the round that {@link ControllerRestoreRound | restore_round} named for that
3897
+ * server.
3898
+ */
3899
+ readonly noBackup: "no_backup";
3900
+ /** The request did not match its schema. */
3901
+ readonly invalidRequest: "invalid_request";
3902
+ /**
3903
+ * {@link ControllerStartServer | start_server} named an allocation this node is already launching or
3904
+ * running. Its server exists or is on its way, as after a {@link ControllerStartServer | start_server}
3905
+ * sent again when its reply was slow.
3906
+ */
3907
+ readonly allocationInUse: "allocation_in_use";
3908
+ /**
3909
+ * {@link ControllerStartServer | start_server} named an allocation that this node launched before, among
3910
+ * the last {@link REMEMBERED_ALLOCATIONS}. The node files a server's events and demos under its
3911
+ * allocation, so every launch needs a new one.
3912
+ */
3913
+ readonly allocationReused: "allocation_reused";
3914
+ /** The agent does not know the request's `type`, or the plugin the command's. */
3915
+ readonly unsupportedRequest: "unsupported_request";
3916
+ /**
3917
+ * The agent is stopping and started no work for the request, as after its
3918
+ * {@link AgentShutdown | shutdown}. Send the request again once the node reconnects.
3919
+ */
3920
+ readonly shuttingDown: "shutting_down";
3921
+ /** Any failure that no other code names, such as a Docker failure. */
3922
+ readonly failed: "failed";
3923
+ }>;
3924
+ detail: z.ZodString;
3925
+ }, z.core.$strip>;
3926
+ }, z.core.$strip>], "ok">], "type">;
3927
+ export type AgentToControllerMessage = z.infer<typeof AgentToControllerMessage>;