@helyx/bot 0.3.1 → 0.4.2

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,751 @@
1
+ import { z } from "zod";
2
+ import type { BotControlHandler } from "./control-server.js";
3
+ export declare const SHARD_CONTRACT_VERSION: 1;
4
+ export declare const SHARD_CONTROL_MAX_BYTES: number;
5
+ export declare const SHARD_CONTROL_TIMEOUT_MS = 10000;
6
+ export declare const SHARD_HEALTH_STALE_MS = 30000;
7
+ export declare const SHARD_LEASE_HEARTBEAT_TIMEOUT_MS = 20000;
8
+ export declare const shardIdentitySchema: z.ZodObject<{
9
+ version: z.ZodLiteral<1>;
10
+ mode: z.ZodEnum<{
11
+ fixed: "fixed";
12
+ auto: "auto";
13
+ }>;
14
+ scope: z.ZodEnum<{
15
+ local: "local";
16
+ coordinated: "coordinated";
17
+ }>;
18
+ generation: z.ZodString;
19
+ deploymentOrder: z.ZodOptional<z.ZodNumber>;
20
+ supervisorId: z.ZodUUID;
21
+ shardId: z.ZodNumber;
22
+ shardCount: z.ZodNumber;
23
+ fencingToken: z.ZodNumber;
24
+ }, z.core.$strict>;
25
+ export type ShardIdentity = z.infer<typeof shardIdentitySchema>;
26
+ export declare const gatewayBotInformationSchema: z.ZodObject<{
27
+ url: z.ZodURL;
28
+ shards: z.ZodNumber;
29
+ session_start_limit: z.ZodObject<{
30
+ total: z.ZodNumber;
31
+ remaining: z.ZodNumber;
32
+ reset_after: z.ZodNumber;
33
+ max_concurrency: z.ZodNumber;
34
+ }, z.core.$strict>;
35
+ }, z.core.$strict>;
36
+ export type GatewayBotInformation = z.infer<typeof gatewayBotInformationSchema>;
37
+ export declare const shardProcessHealthSchema: z.ZodObject<{
38
+ shardId: z.ZodNumber;
39
+ status: z.ZodEnum<{
40
+ ready: "ready";
41
+ starting: "starting";
42
+ disconnected: "disconnected";
43
+ reconnecting: "reconnecting";
44
+ stopped: "stopped";
45
+ failed: "failed";
46
+ }>;
47
+ guildCount: z.ZodNumber;
48
+ gatewayPingMs: z.ZodNumber;
49
+ uptimeSeconds: z.ZodNumber;
50
+ restartCount: z.ZodNumber;
51
+ eventLoopDelayMs: z.ZodNumber;
52
+ memoryRssBytes: z.ZodNumber;
53
+ queueDepth: z.ZodNumber;
54
+ observedAt: z.ZodISODateTime;
55
+ }, z.core.$strict>;
56
+ export type ShardProcessHealth = z.infer<typeof shardProcessHealthSchema>;
57
+ export declare const shardHealthSnapshotSchema: z.ZodObject<{
58
+ version: z.ZodLiteral<1>;
59
+ mode: z.ZodEnum<{
60
+ fixed: "fixed";
61
+ auto: "auto";
62
+ off: "off";
63
+ }>;
64
+ scope: z.ZodEnum<{
65
+ local: "local";
66
+ coordinated: "coordinated";
67
+ }>;
68
+ status: z.ZodEnum<{
69
+ starting: "starting";
70
+ healthy: "healthy";
71
+ degraded: "degraded";
72
+ unavailable: "unavailable";
73
+ stale: "stale";
74
+ }>;
75
+ observedAt: z.ZodISODateTime;
76
+ generation: z.ZodString;
77
+ supervisorId: z.ZodUUID;
78
+ configuredShardCount: z.ZodNumber;
79
+ readyShardCount: z.ZodNumber;
80
+ coordination: z.ZodObject<{
81
+ redis: z.ZodEnum<{
82
+ healthy: "healthy";
83
+ degraded: "degraded";
84
+ unavailable: "unavailable";
85
+ not_required: "not_required";
86
+ }>;
87
+ database: z.ZodEnum<{
88
+ healthy: "healthy";
89
+ degraded: "degraded";
90
+ unavailable: "unavailable";
91
+ }>;
92
+ }, z.core.$strict>;
93
+ sessionStarts: z.ZodOptional<z.ZodObject<{
94
+ total: z.ZodNumber;
95
+ remaining: z.ZodNumber;
96
+ resetAt: z.ZodISODateTime;
97
+ maxConcurrency: z.ZodNumber;
98
+ observedAt: z.ZodISODateTime;
99
+ }, z.core.$strict>>;
100
+ shards: z.ZodArray<z.ZodObject<{
101
+ shardId: z.ZodNumber;
102
+ status: z.ZodEnum<{
103
+ ready: "ready";
104
+ starting: "starting";
105
+ disconnected: "disconnected";
106
+ reconnecting: "reconnecting";
107
+ stopped: "stopped";
108
+ failed: "failed";
109
+ }>;
110
+ guildCount: z.ZodNumber;
111
+ gatewayPingMs: z.ZodNumber;
112
+ uptimeSeconds: z.ZodNumber;
113
+ restartCount: z.ZodNumber;
114
+ eventLoopDelayMs: z.ZodNumber;
115
+ memoryRssBytes: z.ZodNumber;
116
+ queueDepth: z.ZodNumber;
117
+ observedAt: z.ZodISODateTime;
118
+ }, z.core.$strict>>;
119
+ }, z.core.$strict>;
120
+ export type ShardHealthSnapshot = z.infer<typeof shardHealthSnapshotSchema>;
121
+ export declare const shardControlOperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
122
+ kind: z.ZodLiteral<"guild.state.get">;
123
+ guildId: z.ZodString;
124
+ }, z.core.$strict>, z.ZodObject<{
125
+ actorUserId: z.ZodString;
126
+ correlationId: z.ZodString;
127
+ kind: z.ZodLiteral<"guild.module.status.set">;
128
+ guildId: z.ZodString;
129
+ moduleId: z.ZodString;
130
+ enabled: z.ZodBoolean;
131
+ }, z.core.$strict>, z.ZodObject<{
132
+ actorUserId: z.ZodString;
133
+ correlationId: z.ZodString;
134
+ kind: z.ZodLiteral<"guild.module.configuration.update">;
135
+ guildId: z.ZodString;
136
+ moduleId: z.ZodString;
137
+ value: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodString>]>>;
138
+ expectedVersion: z.ZodNullable<z.ZodNumber>;
139
+ }, z.core.$strict>, z.ZodObject<{
140
+ actorUserId: z.ZodString;
141
+ correlationId: z.ZodString;
142
+ kind: z.ZodLiteral<"guild.module.permissions.update">;
143
+ guildId: z.ZodString;
144
+ moduleId: z.ZodString;
145
+ state: z.ZodObject<{
146
+ version: z.ZodNumber;
147
+ module: z.ZodObject<{
148
+ preset: z.ZodEnum<{
149
+ everyone: "everyone";
150
+ moderators: "moderators";
151
+ administrators: "administrators";
152
+ custom: "custom";
153
+ }>;
154
+ allowedRoleIds: z.ZodArray<z.ZodString>;
155
+ deniedRoleIds: z.ZodArray<z.ZodString>;
156
+ }, z.core.$strict>;
157
+ commands: z.ZodArray<z.ZodObject<{
158
+ commandId: z.ZodString;
159
+ version: z.ZodNumber;
160
+ enabled: z.ZodBoolean;
161
+ policy: z.ZodObject<{
162
+ preset: z.ZodEnum<{
163
+ everyone: "everyone";
164
+ moderators: "moderators";
165
+ administrators: "administrators";
166
+ custom: "custom";
167
+ }>;
168
+ allowedRoleIds: z.ZodArray<z.ZodString>;
169
+ deniedRoleIds: z.ZodArray<z.ZodString>;
170
+ }, z.core.$strict>;
171
+ }, z.core.$strict>>;
172
+ }, z.core.$strict>;
173
+ }, z.core.$strict>, z.ZodObject<{
174
+ actorUserId: z.ZodString;
175
+ correlationId: z.ZodString;
176
+ kind: z.ZodLiteral<"guild.module.logging.update">;
177
+ guildId: z.ZodString;
178
+ moduleId: z.ZodString;
179
+ eventId: z.ZodString;
180
+ enabled: z.ZodBoolean;
181
+ expectedVersion: z.ZodNumber;
182
+ }, z.core.$strict>, z.ZodObject<{
183
+ actorUserId: z.ZodString;
184
+ correlationId: z.ZodString;
185
+ kind: z.ZodLiteral<"guild.module.action.execute">;
186
+ guildId: z.ZodString;
187
+ moduleId: z.ZodString;
188
+ actionId: z.ZodString;
189
+ }, z.core.$strict>, z.ZodObject<{
190
+ kind: z.ZodLiteral<"privacy.providers.list">;
191
+ }, z.core.$strict>, z.ZodObject<{
192
+ kind: z.ZodLiteral<"privacy.capture">;
193
+ providerId: z.ZodString;
194
+ providerVersion: z.ZodNumber;
195
+ requestId: z.ZodUUID;
196
+ subjectUserId: z.ZodString;
197
+ cutoffAt: z.ZodISODateTime;
198
+ cursor: z.ZodOptional<z.ZodString>;
199
+ }, z.core.$strict>, z.ZodObject<{
200
+ kind: z.ZodLiteral<"privacy.erase">;
201
+ providerId: z.ZodString;
202
+ providerVersion: z.ZodNumber;
203
+ requestId: z.ZodUUID;
204
+ subjectUserId: z.ZodString;
205
+ executeThrough: z.ZodISODateTime;
206
+ cursor: z.ZodOptional<z.ZodString>;
207
+ }, z.core.$strict>], "kind">;
208
+ export type ShardControlOperation = z.infer<typeof shardControlOperationSchema>;
209
+ export declare const shardControlRequestSchema: z.ZodObject<{
210
+ version: z.ZodLiteral<1>;
211
+ type: z.ZodLiteral<"helyx.control.request">;
212
+ requestId: z.ZodUUID;
213
+ generation: z.ZodString;
214
+ fencingToken: z.ZodNumber;
215
+ deadlineAt: z.ZodISODateTime;
216
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
217
+ kind: z.ZodLiteral<"guild.state.get">;
218
+ guildId: z.ZodString;
219
+ }, z.core.$strict>, z.ZodObject<{
220
+ actorUserId: z.ZodString;
221
+ correlationId: z.ZodString;
222
+ kind: z.ZodLiteral<"guild.module.status.set">;
223
+ guildId: z.ZodString;
224
+ moduleId: z.ZodString;
225
+ enabled: z.ZodBoolean;
226
+ }, z.core.$strict>, z.ZodObject<{
227
+ actorUserId: z.ZodString;
228
+ correlationId: z.ZodString;
229
+ kind: z.ZodLiteral<"guild.module.configuration.update">;
230
+ guildId: z.ZodString;
231
+ moduleId: z.ZodString;
232
+ value: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodString>]>>;
233
+ expectedVersion: z.ZodNullable<z.ZodNumber>;
234
+ }, z.core.$strict>, z.ZodObject<{
235
+ actorUserId: z.ZodString;
236
+ correlationId: z.ZodString;
237
+ kind: z.ZodLiteral<"guild.module.permissions.update">;
238
+ guildId: z.ZodString;
239
+ moduleId: z.ZodString;
240
+ state: z.ZodObject<{
241
+ version: z.ZodNumber;
242
+ module: z.ZodObject<{
243
+ preset: z.ZodEnum<{
244
+ everyone: "everyone";
245
+ moderators: "moderators";
246
+ administrators: "administrators";
247
+ custom: "custom";
248
+ }>;
249
+ allowedRoleIds: z.ZodArray<z.ZodString>;
250
+ deniedRoleIds: z.ZodArray<z.ZodString>;
251
+ }, z.core.$strict>;
252
+ commands: z.ZodArray<z.ZodObject<{
253
+ commandId: z.ZodString;
254
+ version: z.ZodNumber;
255
+ enabled: z.ZodBoolean;
256
+ policy: z.ZodObject<{
257
+ preset: z.ZodEnum<{
258
+ everyone: "everyone";
259
+ moderators: "moderators";
260
+ administrators: "administrators";
261
+ custom: "custom";
262
+ }>;
263
+ allowedRoleIds: z.ZodArray<z.ZodString>;
264
+ deniedRoleIds: z.ZodArray<z.ZodString>;
265
+ }, z.core.$strict>;
266
+ }, z.core.$strict>>;
267
+ }, z.core.$strict>;
268
+ }, z.core.$strict>, z.ZodObject<{
269
+ actorUserId: z.ZodString;
270
+ correlationId: z.ZodString;
271
+ kind: z.ZodLiteral<"guild.module.logging.update">;
272
+ guildId: z.ZodString;
273
+ moduleId: z.ZodString;
274
+ eventId: z.ZodString;
275
+ enabled: z.ZodBoolean;
276
+ expectedVersion: z.ZodNumber;
277
+ }, z.core.$strict>, z.ZodObject<{
278
+ actorUserId: z.ZodString;
279
+ correlationId: z.ZodString;
280
+ kind: z.ZodLiteral<"guild.module.action.execute">;
281
+ guildId: z.ZodString;
282
+ moduleId: z.ZodString;
283
+ actionId: z.ZodString;
284
+ }, z.core.$strict>, z.ZodObject<{
285
+ kind: z.ZodLiteral<"privacy.providers.list">;
286
+ }, z.core.$strict>, z.ZodObject<{
287
+ kind: z.ZodLiteral<"privacy.capture">;
288
+ providerId: z.ZodString;
289
+ providerVersion: z.ZodNumber;
290
+ requestId: z.ZodUUID;
291
+ subjectUserId: z.ZodString;
292
+ cutoffAt: z.ZodISODateTime;
293
+ cursor: z.ZodOptional<z.ZodString>;
294
+ }, z.core.$strict>, z.ZodObject<{
295
+ kind: z.ZodLiteral<"privacy.erase">;
296
+ providerId: z.ZodString;
297
+ providerVersion: z.ZodNumber;
298
+ requestId: z.ZodUUID;
299
+ subjectUserId: z.ZodString;
300
+ executeThrough: z.ZodISODateTime;
301
+ cursor: z.ZodOptional<z.ZodString>;
302
+ }, z.core.$strict>], "kind">;
303
+ }, z.core.$strict>;
304
+ export type ShardControlRequest = z.infer<typeof shardControlRequestSchema>;
305
+ export declare const shardControlResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
306
+ version: z.ZodLiteral<1>;
307
+ type: z.ZodLiteral<"helyx.control.response">;
308
+ requestId: z.ZodUUID;
309
+ ok: z.ZodLiteral<true>;
310
+ result: z.ZodUnknown;
311
+ }, z.core.$strict>, z.ZodObject<{
312
+ version: z.ZodLiteral<1>;
313
+ type: z.ZodLiteral<"helyx.control.response">;
314
+ requestId: z.ZodUUID;
315
+ ok: z.ZodLiteral<false>;
316
+ status: z.ZodNumber;
317
+ message: z.ZodString;
318
+ }, z.core.$strict>], "ok">;
319
+ export type ShardControlResponse = z.infer<typeof shardControlResponseSchema>;
320
+ declare const shardCloudOperationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
321
+ kind: z.ZodLiteral<"cloud.status">;
322
+ }, z.core.$strict>, z.ZodObject<{
323
+ kind: z.ZodLiteral<"cloud.consent.get">;
324
+ }, z.core.$strict>, z.ZodObject<{
325
+ kind: z.ZodLiteral<"cloud.consent.update">;
326
+ supportInspectionEnabled: z.ZodBoolean;
327
+ supportDataClasses: z.ZodArray<z.ZodString>;
328
+ diagnosticsEnabled: z.ZodBoolean;
329
+ }, z.core.$strict>, z.ZodObject<{
330
+ kind: z.ZodLiteral<"cloud.enrol">;
331
+ token: z.ZodString;
332
+ source: z.ZodEnum<{
333
+ file: "file";
334
+ discord: "discord";
335
+ startup: "startup";
336
+ }>;
337
+ }, z.core.$strict>, z.ZodObject<{
338
+ kind: z.ZodLiteral<"cloud.disconnect">;
339
+ }, z.core.$strict>, z.ZodObject<{
340
+ kind: z.ZodLiteral<"cloud.rotate">;
341
+ }, z.core.$strict>], "kind">;
342
+ export type ShardCloudOperation = z.infer<typeof shardCloudOperationSchema>;
343
+ export declare const shardCloudRequestSchema: z.ZodObject<{
344
+ version: z.ZodLiteral<1>;
345
+ type: z.ZodLiteral<"helyx.cloud.request">;
346
+ requestId: z.ZodUUID;
347
+ deadlineAt: z.ZodISODateTime;
348
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
349
+ kind: z.ZodLiteral<"cloud.status">;
350
+ }, z.core.$strict>, z.ZodObject<{
351
+ kind: z.ZodLiteral<"cloud.consent.get">;
352
+ }, z.core.$strict>, z.ZodObject<{
353
+ kind: z.ZodLiteral<"cloud.consent.update">;
354
+ supportInspectionEnabled: z.ZodBoolean;
355
+ supportDataClasses: z.ZodArray<z.ZodString>;
356
+ diagnosticsEnabled: z.ZodBoolean;
357
+ }, z.core.$strict>, z.ZodObject<{
358
+ kind: z.ZodLiteral<"cloud.enrol">;
359
+ token: z.ZodString;
360
+ source: z.ZodEnum<{
361
+ file: "file";
362
+ discord: "discord";
363
+ startup: "startup";
364
+ }>;
365
+ }, z.core.$strict>, z.ZodObject<{
366
+ kind: z.ZodLiteral<"cloud.disconnect">;
367
+ }, z.core.$strict>, z.ZodObject<{
368
+ kind: z.ZodLiteral<"cloud.rotate">;
369
+ }, z.core.$strict>], "kind">;
370
+ }, z.core.$strict>;
371
+ export declare const shardCloudResponseSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
372
+ version: z.ZodLiteral<1>;
373
+ type: z.ZodLiteral<"helyx.cloud.response">;
374
+ requestId: z.ZodUUID;
375
+ ok: z.ZodLiteral<true>;
376
+ result: z.ZodUnknown;
377
+ }, z.core.$strict>, z.ZodObject<{
378
+ version: z.ZodLiteral<1>;
379
+ type: z.ZodLiteral<"helyx.cloud.response">;
380
+ requestId: z.ZodUUID;
381
+ ok: z.ZodLiteral<false>;
382
+ message: z.ZodString;
383
+ }, z.core.$strict>], "ok">;
384
+ export type ShardCloudRequest = z.infer<typeof shardCloudRequestSchema>;
385
+ export type ShardCloudResponse = z.infer<typeof shardCloudResponseSchema>;
386
+ export declare const shardOperationsHealthRequestSchema: z.ZodObject<{
387
+ version: z.ZodLiteral<1>;
388
+ type: z.ZodLiteral<"helyx.operations.health.request">;
389
+ requestId: z.ZodUUID;
390
+ deadlineAt: z.ZodISODateTime;
391
+ }, z.core.$strict>;
392
+ export declare const shardOperationsHealthResponseSchema: z.ZodObject<{
393
+ version: z.ZodLiteral<1>;
394
+ type: z.ZodLiteral<"helyx.operations.health.response">;
395
+ requestId: z.ZodUUID;
396
+ health: z.ZodObject<{
397
+ version: z.ZodLiteral<1>;
398
+ mode: z.ZodEnum<{
399
+ fixed: "fixed";
400
+ auto: "auto";
401
+ off: "off";
402
+ }>;
403
+ scope: z.ZodEnum<{
404
+ local: "local";
405
+ coordinated: "coordinated";
406
+ }>;
407
+ status: z.ZodEnum<{
408
+ starting: "starting";
409
+ healthy: "healthy";
410
+ degraded: "degraded";
411
+ unavailable: "unavailable";
412
+ stale: "stale";
413
+ }>;
414
+ observedAt: z.ZodISODateTime;
415
+ generation: z.ZodString;
416
+ supervisorId: z.ZodUUID;
417
+ configuredShardCount: z.ZodNumber;
418
+ readyShardCount: z.ZodNumber;
419
+ coordination: z.ZodObject<{
420
+ redis: z.ZodEnum<{
421
+ healthy: "healthy";
422
+ degraded: "degraded";
423
+ unavailable: "unavailable";
424
+ not_required: "not_required";
425
+ }>;
426
+ database: z.ZodEnum<{
427
+ healthy: "healthy";
428
+ degraded: "degraded";
429
+ unavailable: "unavailable";
430
+ }>;
431
+ }, z.core.$strict>;
432
+ sessionStarts: z.ZodOptional<z.ZodObject<{
433
+ total: z.ZodNumber;
434
+ remaining: z.ZodNumber;
435
+ resetAt: z.ZodISODateTime;
436
+ maxConcurrency: z.ZodNumber;
437
+ observedAt: z.ZodISODateTime;
438
+ }, z.core.$strict>>;
439
+ shards: z.ZodArray<z.ZodObject<{
440
+ shardId: z.ZodNumber;
441
+ status: z.ZodEnum<{
442
+ ready: "ready";
443
+ starting: "starting";
444
+ disconnected: "disconnected";
445
+ reconnecting: "reconnecting";
446
+ stopped: "stopped";
447
+ failed: "failed";
448
+ }>;
449
+ guildCount: z.ZodNumber;
450
+ gatewayPingMs: z.ZodNumber;
451
+ uptimeSeconds: z.ZodNumber;
452
+ restartCount: z.ZodNumber;
453
+ eventLoopDelayMs: z.ZodNumber;
454
+ memoryRssBytes: z.ZodNumber;
455
+ queueDepth: z.ZodNumber;
456
+ observedAt: z.ZodISODateTime;
457
+ }, z.core.$strict>>;
458
+ }, z.core.$strict>;
459
+ }, z.core.$strict>;
460
+ export declare const supervisorMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
461
+ version: z.ZodLiteral<1>;
462
+ type: z.ZodLiteral<"helyx.control.request">;
463
+ requestId: z.ZodUUID;
464
+ generation: z.ZodString;
465
+ fencingToken: z.ZodNumber;
466
+ deadlineAt: z.ZodISODateTime;
467
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
468
+ kind: z.ZodLiteral<"guild.state.get">;
469
+ guildId: z.ZodString;
470
+ }, z.core.$strict>, z.ZodObject<{
471
+ actorUserId: z.ZodString;
472
+ correlationId: z.ZodString;
473
+ kind: z.ZodLiteral<"guild.module.status.set">;
474
+ guildId: z.ZodString;
475
+ moduleId: z.ZodString;
476
+ enabled: z.ZodBoolean;
477
+ }, z.core.$strict>, z.ZodObject<{
478
+ actorUserId: z.ZodString;
479
+ correlationId: z.ZodString;
480
+ kind: z.ZodLiteral<"guild.module.configuration.update">;
481
+ guildId: z.ZodString;
482
+ moduleId: z.ZodString;
483
+ value: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodArray<z.ZodString>]>>;
484
+ expectedVersion: z.ZodNullable<z.ZodNumber>;
485
+ }, z.core.$strict>, z.ZodObject<{
486
+ actorUserId: z.ZodString;
487
+ correlationId: z.ZodString;
488
+ kind: z.ZodLiteral<"guild.module.permissions.update">;
489
+ guildId: z.ZodString;
490
+ moduleId: z.ZodString;
491
+ state: z.ZodObject<{
492
+ version: z.ZodNumber;
493
+ module: z.ZodObject<{
494
+ preset: z.ZodEnum<{
495
+ everyone: "everyone";
496
+ moderators: "moderators";
497
+ administrators: "administrators";
498
+ custom: "custom";
499
+ }>;
500
+ allowedRoleIds: z.ZodArray<z.ZodString>;
501
+ deniedRoleIds: z.ZodArray<z.ZodString>;
502
+ }, z.core.$strict>;
503
+ commands: z.ZodArray<z.ZodObject<{
504
+ commandId: z.ZodString;
505
+ version: z.ZodNumber;
506
+ enabled: z.ZodBoolean;
507
+ policy: z.ZodObject<{
508
+ preset: z.ZodEnum<{
509
+ everyone: "everyone";
510
+ moderators: "moderators";
511
+ administrators: "administrators";
512
+ custom: "custom";
513
+ }>;
514
+ allowedRoleIds: z.ZodArray<z.ZodString>;
515
+ deniedRoleIds: z.ZodArray<z.ZodString>;
516
+ }, z.core.$strict>;
517
+ }, z.core.$strict>>;
518
+ }, z.core.$strict>;
519
+ }, z.core.$strict>, z.ZodObject<{
520
+ actorUserId: z.ZodString;
521
+ correlationId: z.ZodString;
522
+ kind: z.ZodLiteral<"guild.module.logging.update">;
523
+ guildId: z.ZodString;
524
+ moduleId: z.ZodString;
525
+ eventId: z.ZodString;
526
+ enabled: z.ZodBoolean;
527
+ expectedVersion: z.ZodNumber;
528
+ }, z.core.$strict>, z.ZodObject<{
529
+ actorUserId: z.ZodString;
530
+ correlationId: z.ZodString;
531
+ kind: z.ZodLiteral<"guild.module.action.execute">;
532
+ guildId: z.ZodString;
533
+ moduleId: z.ZodString;
534
+ actionId: z.ZodString;
535
+ }, z.core.$strict>, z.ZodObject<{
536
+ kind: z.ZodLiteral<"privacy.providers.list">;
537
+ }, z.core.$strict>, z.ZodObject<{
538
+ kind: z.ZodLiteral<"privacy.capture">;
539
+ providerId: z.ZodString;
540
+ providerVersion: z.ZodNumber;
541
+ requestId: z.ZodUUID;
542
+ subjectUserId: z.ZodString;
543
+ cutoffAt: z.ZodISODateTime;
544
+ cursor: z.ZodOptional<z.ZodString>;
545
+ }, z.core.$strict>, z.ZodObject<{
546
+ kind: z.ZodLiteral<"privacy.erase">;
547
+ providerId: z.ZodString;
548
+ providerVersion: z.ZodNumber;
549
+ requestId: z.ZodUUID;
550
+ subjectUserId: z.ZodString;
551
+ executeThrough: z.ZodISODateTime;
552
+ cursor: z.ZodOptional<z.ZodString>;
553
+ }, z.core.$strict>], "kind">;
554
+ }, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
555
+ version: z.ZodLiteral<1>;
556
+ type: z.ZodLiteral<"helyx.cloud.response">;
557
+ requestId: z.ZodUUID;
558
+ ok: z.ZodLiteral<true>;
559
+ result: z.ZodUnknown;
560
+ }, z.core.$strict>, z.ZodObject<{
561
+ version: z.ZodLiteral<1>;
562
+ type: z.ZodLiteral<"helyx.cloud.response">;
563
+ requestId: z.ZodUUID;
564
+ ok: z.ZodLiteral<false>;
565
+ message: z.ZodString;
566
+ }, z.core.$strict>], "ok">, z.ZodObject<{
567
+ version: z.ZodLiteral<1>;
568
+ type: z.ZodLiteral<"helyx.operations.health.response">;
569
+ requestId: z.ZodUUID;
570
+ health: z.ZodObject<{
571
+ version: z.ZodLiteral<1>;
572
+ mode: z.ZodEnum<{
573
+ fixed: "fixed";
574
+ auto: "auto";
575
+ off: "off";
576
+ }>;
577
+ scope: z.ZodEnum<{
578
+ local: "local";
579
+ coordinated: "coordinated";
580
+ }>;
581
+ status: z.ZodEnum<{
582
+ starting: "starting";
583
+ healthy: "healthy";
584
+ degraded: "degraded";
585
+ unavailable: "unavailable";
586
+ stale: "stale";
587
+ }>;
588
+ observedAt: z.ZodISODateTime;
589
+ generation: z.ZodString;
590
+ supervisorId: z.ZodUUID;
591
+ configuredShardCount: z.ZodNumber;
592
+ readyShardCount: z.ZodNumber;
593
+ coordination: z.ZodObject<{
594
+ redis: z.ZodEnum<{
595
+ healthy: "healthy";
596
+ degraded: "degraded";
597
+ unavailable: "unavailable";
598
+ not_required: "not_required";
599
+ }>;
600
+ database: z.ZodEnum<{
601
+ healthy: "healthy";
602
+ degraded: "degraded";
603
+ unavailable: "unavailable";
604
+ }>;
605
+ }, z.core.$strict>;
606
+ sessionStarts: z.ZodOptional<z.ZodObject<{
607
+ total: z.ZodNumber;
608
+ remaining: z.ZodNumber;
609
+ resetAt: z.ZodISODateTime;
610
+ maxConcurrency: z.ZodNumber;
611
+ observedAt: z.ZodISODateTime;
612
+ }, z.core.$strict>>;
613
+ shards: z.ZodArray<z.ZodObject<{
614
+ shardId: z.ZodNumber;
615
+ status: z.ZodEnum<{
616
+ ready: "ready";
617
+ starting: "starting";
618
+ disconnected: "disconnected";
619
+ reconnecting: "reconnecting";
620
+ stopped: "stopped";
621
+ failed: "failed";
622
+ }>;
623
+ guildCount: z.ZodNumber;
624
+ gatewayPingMs: z.ZodNumber;
625
+ uptimeSeconds: z.ZodNumber;
626
+ restartCount: z.ZodNumber;
627
+ eventLoopDelayMs: z.ZodNumber;
628
+ memoryRssBytes: z.ZodNumber;
629
+ queueDepth: z.ZodNumber;
630
+ observedAt: z.ZodISODateTime;
631
+ }, z.core.$strict>>;
632
+ }, z.core.$strict>;
633
+ }, z.core.$strict>, z.ZodObject<{
634
+ version: z.ZodLiteral<1>;
635
+ type: z.ZodLiteral<"helyx.lease.heartbeat">;
636
+ identity: z.ZodObject<{
637
+ version: z.ZodLiteral<1>;
638
+ mode: z.ZodEnum<{
639
+ fixed: "fixed";
640
+ auto: "auto";
641
+ }>;
642
+ scope: z.ZodEnum<{
643
+ local: "local";
644
+ coordinated: "coordinated";
645
+ }>;
646
+ generation: z.ZodString;
647
+ deploymentOrder: z.ZodOptional<z.ZodNumber>;
648
+ supervisorId: z.ZodUUID;
649
+ shardId: z.ZodNumber;
650
+ shardCount: z.ZodNumber;
651
+ fencingToken: z.ZodNumber;
652
+ }, z.core.$strict>;
653
+ }, z.core.$strict>, z.ZodObject<{
654
+ version: z.ZodLiteral<1>;
655
+ type: z.ZodLiteral<"helyx.health.request">;
656
+ }, z.core.$strict>, z.ZodObject<{
657
+ version: z.ZodLiteral<1>;
658
+ type: z.ZodLiteral<"helyx.shutdown">;
659
+ reason: z.ZodString;
660
+ }, z.core.$strict>], "type">;
661
+ export declare const workerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
662
+ version: z.ZodLiteral<1>;
663
+ type: z.ZodLiteral<"helyx.control.response">;
664
+ requestId: z.ZodUUID;
665
+ ok: z.ZodLiteral<true>;
666
+ result: z.ZodUnknown;
667
+ }, z.core.$strict>, z.ZodObject<{
668
+ version: z.ZodLiteral<1>;
669
+ type: z.ZodLiteral<"helyx.control.response">;
670
+ requestId: z.ZodUUID;
671
+ ok: z.ZodLiteral<false>;
672
+ status: z.ZodNumber;
673
+ message: z.ZodString;
674
+ }, z.core.$strict>], "ok">, z.ZodObject<{
675
+ version: z.ZodLiteral<1>;
676
+ type: z.ZodLiteral<"helyx.cloud.request">;
677
+ requestId: z.ZodUUID;
678
+ deadlineAt: z.ZodISODateTime;
679
+ operation: z.ZodDiscriminatedUnion<[z.ZodObject<{
680
+ kind: z.ZodLiteral<"cloud.status">;
681
+ }, z.core.$strict>, z.ZodObject<{
682
+ kind: z.ZodLiteral<"cloud.consent.get">;
683
+ }, z.core.$strict>, z.ZodObject<{
684
+ kind: z.ZodLiteral<"cloud.consent.update">;
685
+ supportInspectionEnabled: z.ZodBoolean;
686
+ supportDataClasses: z.ZodArray<z.ZodString>;
687
+ diagnosticsEnabled: z.ZodBoolean;
688
+ }, z.core.$strict>, z.ZodObject<{
689
+ kind: z.ZodLiteral<"cloud.enrol">;
690
+ token: z.ZodString;
691
+ source: z.ZodEnum<{
692
+ file: "file";
693
+ discord: "discord";
694
+ startup: "startup";
695
+ }>;
696
+ }, z.core.$strict>, z.ZodObject<{
697
+ kind: z.ZodLiteral<"cloud.disconnect">;
698
+ }, z.core.$strict>, z.ZodObject<{
699
+ kind: z.ZodLiteral<"cloud.rotate">;
700
+ }, z.core.$strict>], "kind">;
701
+ }, z.core.$strict>, z.ZodObject<{
702
+ version: z.ZodLiteral<1>;
703
+ type: z.ZodLiteral<"helyx.operations.health.request">;
704
+ requestId: z.ZodUUID;
705
+ deadlineAt: z.ZodISODateTime;
706
+ }, z.core.$strict>, z.ZodObject<{
707
+ version: z.ZodLiteral<1>;
708
+ type: z.ZodLiteral<"helyx.health.update">;
709
+ identity: z.ZodObject<{
710
+ version: z.ZodLiteral<1>;
711
+ mode: z.ZodEnum<{
712
+ fixed: "fixed";
713
+ auto: "auto";
714
+ }>;
715
+ scope: z.ZodEnum<{
716
+ local: "local";
717
+ coordinated: "coordinated";
718
+ }>;
719
+ generation: z.ZodString;
720
+ deploymentOrder: z.ZodOptional<z.ZodNumber>;
721
+ supervisorId: z.ZodUUID;
722
+ shardId: z.ZodNumber;
723
+ shardCount: z.ZodNumber;
724
+ fencingToken: z.ZodNumber;
725
+ }, z.core.$strict>;
726
+ health: z.ZodObject<{
727
+ shardId: z.ZodNumber;
728
+ status: z.ZodEnum<{
729
+ ready: "ready";
730
+ starting: "starting";
731
+ disconnected: "disconnected";
732
+ reconnecting: "reconnecting";
733
+ stopped: "stopped";
734
+ failed: "failed";
735
+ }>;
736
+ guildCount: z.ZodNumber;
737
+ gatewayPingMs: z.ZodNumber;
738
+ uptimeSeconds: z.ZodNumber;
739
+ restartCount: z.ZodNumber;
740
+ eventLoopDelayMs: z.ZodNumber;
741
+ memoryRssBytes: z.ZodNumber;
742
+ queueDepth: z.ZodNumber;
743
+ observedAt: z.ZodISODateTime;
744
+ }, z.core.$strict>;
745
+ }, z.core.$strict>], "type">;
746
+ export declare function guildIdToShardId(guildId: string, shardCount: number): number;
747
+ export declare function controlOperationGuildId(operation: ShardControlOperation): string | undefined;
748
+ export declare function assertShardMessageSize(value: unknown): void;
749
+ export declare function executeShardControlOperation(handler: BotControlHandler, operation: ShardControlOperation): Promise<unknown>;
750
+ export {};
751
+ //# sourceMappingURL=shard-contracts.d.ts.map