@anvil-js/client 0.0.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,728 @@
1
+ import { z } from 'zod';
2
+
3
+ // src/schemas/common.ts
4
+ var UUIDSchema = z.string().uuid();
5
+ var ISODateSchema = z.string().datetime({ offset: true });
6
+ var ArchSchema = z.enum(["x64", "arm64", "x86"]);
7
+ var PlatformSchema = z.enum(["windows", "macos", "linux"]);
8
+ var LoaderTypeSchema = z.enum(["vanilla", "fabric", "forge", "neoforge", "quilt"]);
9
+ var LocalizedStringSchema = z.record(z.string(), z.string());
10
+ var TRPCErrorSchema = z.object({
11
+ code: z.enum([
12
+ "BAD_REQUEST",
13
+ "UNAUTHORIZED",
14
+ "FORBIDDEN",
15
+ "NOT_FOUND",
16
+ "CONFLICT",
17
+ "TOO_MANY_REQUESTS",
18
+ "INTERNAL_SERVER_ERROR"
19
+ ]),
20
+ message: z.string()
21
+ });
22
+ var PaginationInputSchema = z.object({
23
+ page: z.number().int().min(1).default(1),
24
+ pageSize: z.number().int().min(1).max(200).default(50)
25
+ });
26
+ var PaginatedSchema = (item) => z.object({
27
+ items: z.array(item),
28
+ total: z.number().int().min(0),
29
+ page: z.number().int().min(1),
30
+ pageSize: z.number().int().min(1)
31
+ });
32
+ var UserSummarySchema = z.object({
33
+ uuid: UUIDSchema,
34
+ email: z.string().email(),
35
+ username: z.string().min(1).max(64),
36
+ displayName: z.string().min(1).max(128),
37
+ avatarUrl: z.string().url().nullable(),
38
+ role: z.enum(["USER", "MODERATOR", "ADMIN"]).default("USER")
39
+ });
40
+ var SessionSchema = z.object({
41
+ anvil: z.object({
42
+ user: UserSummarySchema,
43
+ accessToken: z.string(),
44
+ refreshToken: z.string(),
45
+ expiresAt: ISODateSchema
46
+ }),
47
+ mojang: z.object({
48
+ uuid: UUIDSchema,
49
+ username: z.string(),
50
+ accessToken: z.string(),
51
+ expiresAt: ISODateSchema
52
+ }).nullable()
53
+ });
54
+ var LoginInputSchema = z.object({
55
+ email: z.string().email(),
56
+ password: z.string().min(8).max(128)
57
+ });
58
+ var RegisterInputSchema = z.object({
59
+ email: z.string().email(),
60
+ username: z.string().min(3).max(64).regex(/^[a-zA-Z0-9_]+$/),
61
+ password: z.string().min(8).max(128)
62
+ });
63
+ var RefreshInputSchema = z.object({
64
+ refreshToken: z.string().min(1)
65
+ });
66
+ var ForgotPasswordInputSchema = z.object({
67
+ email: z.string().email()
68
+ });
69
+ var ResetPasswordInputSchema = z.object({
70
+ token: z.string().min(1),
71
+ newPassword: z.string().min(8).max(128)
72
+ });
73
+ var ValidateInputSchema = z.object({
74
+ token: z.string().min(1)
75
+ });
76
+ var BuildSummarySchema = z.object({
77
+ id: UUIDSchema,
78
+ slug: z.string(),
79
+ name: z.string(),
80
+ shortDescription: z.string(),
81
+ iconUrl: z.string().url().nullable(),
82
+ mcVersions: z.array(z.string()),
83
+ loaders: z.array(LoaderTypeSchema),
84
+ visibility: z.enum(["public", "private", "unlisted"]),
85
+ pricing: z.discriminatedUnion("model", [
86
+ z.object({ model: z.literal("free") }),
87
+ z.object({
88
+ model: z.literal("paid"),
89
+ priceCents: z.number().int().nonnegative(),
90
+ currency: z.string()
91
+ }),
92
+ z.object({
93
+ model: z.literal("subscription"),
94
+ tiers: z.array(
95
+ z.object({
96
+ id: z.string(),
97
+ name: z.string(),
98
+ priceCents: z.number().int().nonnegative(),
99
+ interval: z.enum(["month", "year"])
100
+ })
101
+ )
102
+ })
103
+ ]),
104
+ stats: z.object({
105
+ downloads: z.number().int().nonnegative(),
106
+ favorites: z.number().int().nonnegative(),
107
+ updatedAt: ISODateSchema
108
+ }),
109
+ // Provider source -- UI uses this to badge cards (Modrinth / Anvil).
110
+ source: z.enum(["modrinth", "anvil"]).default("anvil")
111
+ });
112
+ var BuildFileSchema = z.object({
113
+ url: z.string().url(),
114
+ sha256: z.string().regex(/^[a-f0-9]{64}$/),
115
+ sizeBytes: z.number().int().nonnegative(),
116
+ primary: z.boolean()
117
+ });
118
+ var BuildVersionSchema = z.object({
119
+ id: UUIDSchema,
120
+ buildId: UUIDSchema,
121
+ name: z.string(),
122
+ mcVersion: z.string(),
123
+ loader: LoaderTypeSchema,
124
+ loaderVersion: z.string(),
125
+ files: z.array(BuildFileSchema),
126
+ dependencies: z.array(
127
+ z.object({
128
+ kind: z.enum(["required", "optional", "incompatible", "embedded"]),
129
+ projectId: z.string(),
130
+ versionId: z.string().optional()
131
+ })
132
+ ),
133
+ changelog: z.string().optional(),
134
+ publishedAt: ISODateSchema
135
+ });
136
+ var BuildSchema = BuildSummarySchema.extend({
137
+ versions: z.array(BuildVersionSchema),
138
+ description: z.string().optional(),
139
+ longDescription: LocalizedStringSchema.optional()
140
+ });
141
+ var ListBuildsInputSchema = z.object({
142
+ search: z.string().optional(),
143
+ tags: z.array(z.string()).optional(),
144
+ mcVersions: z.array(z.string()).optional(),
145
+ loaders: z.array(LoaderTypeSchema).optional(),
146
+ visibility: z.array(z.enum(["public", "private", "unlisted"])).optional(),
147
+ source: z.array(z.enum(["modrinth", "anvil"])).optional(),
148
+ page: z.number().int().min(1).default(1),
149
+ pageSize: z.number().int().min(1).max(100).default(24),
150
+ sort: z.enum(["popular", "recent", "name"]).default("popular")
151
+ });
152
+ var GetBuildInputSchema = z.object({
153
+ idOrSlug: z.string().min(1)
154
+ });
155
+ var RequestDownloadInputSchema = z.object({
156
+ versionId: UUIDSchema,
157
+ clientArch: ArchSchema.optional()
158
+ });
159
+ var RequestDownloadOutputSchema = z.object({
160
+ installId: UUIDSchema,
161
+ downloadUrl: z.string().url(),
162
+ expiresAt: ISODateSchema,
163
+ sha256: z.string(),
164
+ sizeBytes: z.number().int().nonnegative()
165
+ });
166
+ var LicenseSchema = z.object({
167
+ id: UUIDSchema,
168
+ buildId: UUIDSchema,
169
+ buildName: z.string(),
170
+ status: z.enum(["active", "expired", "revoked"]),
171
+ source: z.enum(["purchase", "subscription", "gift", "promo", "dev_grant"]),
172
+ grantedAt: ISODateSchema,
173
+ expiresAt: ISODateSchema.nullable()
174
+ });
175
+ var ListLicensesInputSchema = z.object({
176
+ buildId: UUIDSchema.optional(),
177
+ status: z.enum(["active", "expired", "revoked"]).optional()
178
+ });
179
+ var CheckLicenseInputSchema = z.object({
180
+ buildId: UUIDSchema
181
+ });
182
+ var CheckLicenseOutputSchema = z.object({
183
+ hasAccess: z.boolean(),
184
+ license: LicenseSchema.optional(),
185
+ reason: z.enum(["no_license", "expired", "revoked", "region_locked"]).optional()
186
+ });
187
+ var LauncherModeSchema = z.enum(["anvil", "mojang", "hybrid"]);
188
+ var AuthProviderSchema = z.enum(["mojang", "anvil"]);
189
+ var ContentSourceSchema = z.enum(["modrinth", "anvil"]);
190
+ var AnvilConnectionSchema = z.object({
191
+ enabled: z.boolean(),
192
+ baseUrl: z.string().url().nullable(),
193
+ apiKey: z.string().nullable()
194
+ });
195
+ var AuthConfigSchema = z.object({
196
+ providers: z.array(AuthProviderSchema).min(1)
197
+ });
198
+ var ContentConfigSchema = z.object({
199
+ sources: z.array(ContentSourceSchema).min(1)
200
+ });
201
+ var LauncherConfigSchema = z.object({
202
+ mode: LauncherModeSchema,
203
+ auth: AuthConfigSchema,
204
+ content: ContentConfigSchema,
205
+ anvil: AnvilConnectionSchema,
206
+ telemetry: z.boolean(),
207
+ autoUpdate: z.boolean(),
208
+ region: z.string().optional(),
209
+ version: z.literal(1)
210
+ }).refine(
211
+ (c) => {
212
+ if (c.mode === "anvil") {
213
+ return c.auth.providers.length === 1 && c.auth.providers[0] === "anvil" && c.anvil.enabled;
214
+ }
215
+ if (c.mode === "mojang") {
216
+ return !c.auth.providers.includes("anvil") && !c.anvil.enabled;
217
+ }
218
+ const wantsAnvil = c.auth.providers.includes("anvil");
219
+ return !wantsAnvil || c.anvil.enabled;
220
+ },
221
+ {
222
+ message: "Auth providers must be consistent with mode and anvil.enabled",
223
+ path: ["auth", "providers"]
224
+ }
225
+ ).refine(
226
+ (c) => {
227
+ return !c.content.sources.includes("anvil") || c.anvil.enabled;
228
+ },
229
+ {
230
+ message: "anvil in content.sources requires anvil.enabled=true",
231
+ path: ["content", "sources"]
232
+ }
233
+ ).refine(
234
+ (c) => {
235
+ return !c.anvil.enabled || c.anvil.baseUrl !== null;
236
+ },
237
+ {
238
+ message: "anvil.enabled=true requires a non-null baseUrl",
239
+ path: ["anvil", "baseUrl"]
240
+ }
241
+ );
242
+ var defaultLauncherConfig = () => ({
243
+ mode: "hybrid",
244
+ // 'anvil' is included in the default provider list so the
245
+ // email/password login form is the first thing a fresh user
246
+ // sees. Q5 (Microsoft Azure App registration) will let us
247
+ // gate 'mojang' on NEXT_PUBLIC_MICROSOFT_CLIENT_ID being
248
+ // non-empty; until then both are listed.
249
+ auth: { providers: ["anvil", "mojang"] },
250
+ content: { sources: ["modrinth"] },
251
+ anvil: { enabled: false, baseUrl: null, apiKey: null },
252
+ telemetry: true,
253
+ autoUpdate: true,
254
+ version: 1
255
+ });
256
+ var isAuthProviderAnvil = (c) => c.mode === "anvil" || c.mode === "hybrid" && c.auth.providers.includes("anvil");
257
+ var RelationshipTypeSchema = z.enum(["FRIENDS", "BLOCKED", "NEUTRAL"]);
258
+ var RelationshipStatusSchema = z.enum(["PENDING", "VERIFIED"]);
259
+ var RelationshipDirectionSchema = z.enum(["INCOMING", "OUTGOING", "MUTUAL"]);
260
+ var RelationshipsListKindSchema = z.enum([
261
+ "FRIENDS",
262
+ "INCOMING_PENDING",
263
+ "OUTGOING_PENDING",
264
+ "BLOCKED"
265
+ ]);
266
+ var PresenceStatusSchema = z.enum(["ONLINE", "OFFLINE", "AWAY", "BUSY"]);
267
+ var RelationshipSchema = z.object({
268
+ id: UUIDSchema,
269
+ type: RelationshipTypeSchema,
270
+ status: RelationshipStatusSchema,
271
+ // 'MUTUAL' for verified friends, 'INCOMING' for pending requests
272
+ // sent to the current user, 'OUTGOING' for pending requests the
273
+ // current user sent.
274
+ direction: RelationshipDirectionSchema,
275
+ // The other side of the relationship.
276
+ otherUser: UserSummarySchema,
277
+ since: ISODateSchema,
278
+ // uuid of the user who sent the original request (FRIENDS only;
279
+ // for BLOCKED this is the user who created the block, which may
280
+ // be either side).
281
+ initiatorUuid: UUIDSchema
282
+ });
283
+ var TrustedHostSchema = z.object({
284
+ id: UUIDSchema,
285
+ name: z.string().min(1).max(64),
286
+ domains: z.array(z.string().min(1).max(255)).min(1).max(32),
287
+ addedAt: ISODateSchema
288
+ });
289
+ var UserActivitySchema = z.object({
290
+ // 'playing <buildId>' / 'building' / 'browsing' / 'afk'
291
+ type: z.string(),
292
+ metadata: z.record(z.string(), z.string())
293
+ });
294
+ var PresenceSchema = z.object({
295
+ uuid: UUIDSchema,
296
+ status: PresenceStatusSchema,
297
+ lastOnline: ISODateSchema,
298
+ currentActivity: UserActivitySchema.optional()
299
+ });
300
+ var LocalizedRuleSchema = z.object({
301
+ locale: z.string(),
302
+ title: z.string(),
303
+ body: z.string()
304
+ });
305
+ var CommunityRulesStatusSchema = z.object({
306
+ accepted: z.boolean(),
307
+ version: z.string(),
308
+ rules: z.array(LocalizedRuleSchema),
309
+ updatedAt: ISODateSchema
310
+ });
311
+ var SuspensionStatusSchema = z.object({
312
+ suspended: z.boolean(),
313
+ reason: z.string().optional(),
314
+ expiresAt: ISODateSchema.optional()
315
+ });
316
+ var CreateRelationshipInputSchema = z.object({
317
+ targetUuid: UUIDSchema,
318
+ type: z.enum(["FRIENDS", "BLOCKED", "NEUTRAL"])
319
+ });
320
+ var DeleteRelationshipInputSchema = z.object({
321
+ targetUuid: UUIDSchema,
322
+ type: z.enum(["FRIENDS", "BLOCKED", "NEUTRAL"])
323
+ });
324
+ var ListRelationshipsInputSchema = z.object({
325
+ type: RelationshipsListKindSchema.optional()
326
+ });
327
+ var AcceptRequestInputSchema = z.object({
328
+ fromUuid: UUIDSchema
329
+ });
330
+ var CancelRequestInputSchema = z.object({
331
+ toUuid: UUIDSchema
332
+ });
333
+ var LookupByNameInputSchema = z.object({
334
+ username: z.string().min(3).max(64).regex(/^[a-zA-Z0-9_]+$/)
335
+ });
336
+ var ReportActivityInputSchema = z.object({
337
+ type: z.string().min(1).max(64),
338
+ metadata: z.record(z.string(), z.string())
339
+ });
340
+ var InviteToServerInputSchema = z.object({
341
+ targetUuid: UUIDSchema,
342
+ address: z.string().min(1).max(512)
343
+ });
344
+ var CreateTrustedHostInputSchema = z.object({
345
+ name: z.string().min(1).max(64),
346
+ domains: z.array(z.string().min(1).max(255)).min(1).max(32)
347
+ });
348
+ var DeleteTrustedHostInputSchema = z.object({
349
+ id: UUIDSchema
350
+ });
351
+ var LookupByNameOutputSchema = z.object({
352
+ user: z.object({
353
+ uuid: UUIDSchema,
354
+ username: z.string(),
355
+ displayName: z.string()
356
+ }).nullable(),
357
+ nameMap: z.record(UUIDSchema, z.string())
358
+ });
359
+ var RELATIONSHIP_LABELS = {
360
+ FRIENDS: "Friends",
361
+ INCOMING_PENDING: "Incoming",
362
+ OUTGOING_PENDING: "Outgoing",
363
+ BLOCKED: "Blocked"
364
+ };
365
+ var PRESENCE_COLORS = {
366
+ ONLINE: "#10b981",
367
+ // emerald-500
368
+ AWAY: "#f59e0b",
369
+ // amber-500
370
+ BUSY: "#ef4444",
371
+ // red-500
372
+ OFFLINE: "#6b7280"
373
+ // gray-500
374
+ };
375
+ var ModrinthProjectTypeSchema = z.enum([
376
+ "mod",
377
+ "modpack",
378
+ "resourcepack",
379
+ "shader",
380
+ "world"
381
+ ]);
382
+ var ModrinthDonationLinkSchema = z.object({
383
+ id: z.string(),
384
+ platform: z.string(),
385
+ url: z.string().url()
386
+ });
387
+ var ModrinthProjectSchema = z.object({
388
+ project_id: z.string(),
389
+ project_type: ModrinthProjectTypeSchema,
390
+ slug: z.string(),
391
+ author: z.string(),
392
+ title: z.string(),
393
+ description: z.string(),
394
+ categories: z.array(z.string()),
395
+ display_categories: z.array(z.string()),
396
+ versions: z.array(z.string()),
397
+ // mcVersions
398
+ downloads: z.number().int().nonnegative(),
399
+ follows: z.number().int().nonnegative(),
400
+ icon_url: z.string().url().nullable(),
401
+ date_created: z.string().datetime({ offset: true }),
402
+ date_modified: z.string().datetime({ offset: true }),
403
+ latest_version: z.string().nullable(),
404
+ license: z.string().nullable(),
405
+ client_side: z.enum(["required", "optional", "unsupported"]),
406
+ server_side: z.enum(["required", "optional", "unsupported"]),
407
+ gallery: z.array(z.string().url())
408
+ });
409
+ var ModrinthSearchResponseSchema = z.object({
410
+ hits: z.array(ModrinthProjectSchema),
411
+ offset: z.number().int().nonnegative(),
412
+ limit: z.number().int().positive(),
413
+ total_hits: z.number().int().nonnegative()
414
+ });
415
+ var ModrinthSearchInputSchema = z.object({
416
+ query: z.string().optional(),
417
+ facets: z.array(z.string()).optional(),
418
+ index: z.enum(["relevance", "downloads", "follows", "newest", "updated"]).default("relevance"),
419
+ offset: z.number().int().min(0).default(0),
420
+ limit: z.number().int().min(1).max(100).default(20),
421
+ filters: z.string().optional()
422
+ });
423
+ var MODRINTH_CATEGORIES = [
424
+ { id: "mod", label: "Mods" },
425
+ { id: "modpack", label: "Modpacks" },
426
+ { id: "resourcepack", label: "Resource Packs" },
427
+ { id: "shader", label: "Shaders" },
428
+ { id: "world", label: "Worlds" }
429
+ ];
430
+ var MC_VERSIONS_POPULAR = [
431
+ "1.21.4",
432
+ "1.21.3",
433
+ "1.21.1",
434
+ "1.21",
435
+ "1.20.6",
436
+ "1.20.4",
437
+ "1.20.1",
438
+ "1.19.4",
439
+ "1.19.2",
440
+ "1.18.2",
441
+ "1.16.5",
442
+ "1.12.2"
443
+ ];
444
+ var CosmeticTypeSchema = z.enum([
445
+ "hat",
446
+ "body",
447
+ "back",
448
+ "face",
449
+ "hand",
450
+ "feet",
451
+ "particle",
452
+ "emote"
453
+ ]);
454
+ var CosmeticRaritySchema = z.enum(["common", "uncommon", "rare", "epic", "legendary"]);
455
+ var CosmeticSchema = z.object({
456
+ id: UUIDSchema,
457
+ type: CosmeticTypeSchema,
458
+ rarity: CosmeticRaritySchema,
459
+ name: LocalizedStringSchema,
460
+ description: LocalizedStringSchema.optional(),
461
+ iconUrl: z.string().url().nullable(),
462
+ modelUrl: z.string().url().nullable(),
463
+ owned: z.boolean().default(false),
464
+ equipped: z.boolean().default(false)
465
+ });
466
+ var OutfitSlotSchema = z.object({
467
+ type: CosmeticTypeSchema,
468
+ cosmeticId: UUIDSchema.nullable()
469
+ });
470
+ var OutfitSchema = z.object({
471
+ id: UUIDSchema,
472
+ name: z.string().min(1).max(64),
473
+ slots: z.array(OutfitSlotSchema).max(8),
474
+ createdAt: ISODateSchema,
475
+ updatedAt: ISODateSchema
476
+ });
477
+ var EmoteWheelSlotSchema = z.object({
478
+ position: z.number().int().min(0).max(7),
479
+ emoteId: UUIDSchema.nullable()
480
+ });
481
+ var EmoteWheelSchema = z.object({
482
+ id: UUIDSchema,
483
+ name: z.string().min(1).max(64),
484
+ slots: z.array(EmoteWheelSlotSchema).length(8),
485
+ createdAt: ISODateSchema
486
+ });
487
+ var SkinVariantSchema = z.enum(["classic", "slim"]);
488
+ var SkinSchema = z.object({
489
+ id: UUIDSchema,
490
+ name: z.string().min(1).max(64),
491
+ variant: SkinVariantSchema,
492
+ textureUrl: z.string().url(),
493
+ sha256: z.string().regex(/^[a-f0-9]{64}$/),
494
+ sizeBytes: z.number().int().nonnegative(),
495
+ source: z.enum(["uploaded", "mojang"]),
496
+ active: z.boolean().default(false),
497
+ createdAt: ISODateSchema
498
+ });
499
+ var EquipCosmeticInputSchema = z.object({
500
+ cosmeticId: UUIDSchema,
501
+ equipped: z.boolean()
502
+ });
503
+ var CreateOutfitInputSchema = z.object({
504
+ name: z.string().min(1).max(64),
505
+ slots: z.array(OutfitSlotSchema).max(8)
506
+ });
507
+ var UpdateOutfitInputSchema = z.object({
508
+ id: UUIDSchema,
509
+ name: z.string().min(1).max(64).optional(),
510
+ slots: z.array(OutfitSlotSchema).max(8).optional()
511
+ });
512
+ var DeleteOutfitInputSchema = z.object({ id: UUIDSchema });
513
+ var SaveEmoteWheelInputSchema = z.object({
514
+ id: UUIDSchema.nullable(),
515
+ name: z.string().min(1).max(64),
516
+ slots: z.array(EmoteWheelSlotSchema).length(8)
517
+ });
518
+ var UploadSkinInputSchema = z.object({
519
+ name: z.string().min(1).max(64),
520
+ variant: SkinVariantSchema,
521
+ // base64 of the PNG bytes
522
+ data: z.string().min(1)
523
+ });
524
+ var SetActiveSkinInputSchema = z.object({ id: UUIDSchema });
525
+ var COSMETIC_TYPE_LABELS = {
526
+ hat: "Hat",
527
+ body: "Body",
528
+ back: "Back",
529
+ face: "Face",
530
+ hand: "Hand",
531
+ feet: "Feet",
532
+ particle: "Particles",
533
+ emote: "Emote"
534
+ };
535
+ var RARITY_COLORS = {
536
+ common: "#9ca3af",
537
+ uncommon: "#10b981",
538
+ rare: "#3b82f6",
539
+ epic: "#a855f7",
540
+ legendary: "#f59e0b"
541
+ };
542
+ var ChannelKindSchema = z.enum(["DM", "GROUP", "ANNOUNCEMENT"]);
543
+ var ChatMemberSchema = z.object({
544
+ user: UserSummarySchema,
545
+ role: z.enum(["owner", "admin", "member"]),
546
+ joinedAt: ISODateSchema,
547
+ lastReadAt: ISODateSchema.nullable(),
548
+ muted: z.boolean().default(false)
549
+ });
550
+ var ChannelSchema = z.object({
551
+ id: UUIDSchema,
552
+ kind: ChannelKindSchema,
553
+ name: z.string().nullable(),
554
+ // null for DMs
555
+ members: z.array(ChatMemberSchema),
556
+ createdAt: ISODateSchema,
557
+ lastMessageAt: ISODateSchema.nullable(),
558
+ unreadCount: z.number().int().nonnegative().default(0)
559
+ });
560
+ var MessageSchema = z.object({
561
+ id: UUIDSchema,
562
+ channelId: UUIDSchema,
563
+ authorUuid: UUIDSchema,
564
+ authorDisplayName: z.string(),
565
+ body: z.string(),
566
+ // Markdown can be client-rendered; for the scaffold we ship it raw.
567
+ bodyMarkdown: z.string().optional(),
568
+ createdAt: ISODateSchema,
569
+ editedAt: ISODateSchema.nullable(),
570
+ deletedAt: ISODateSchema.nullable(),
571
+ // Optional references
572
+ replyTo: UUIDSchema.nullable().optional()
573
+ });
574
+ var ListChannelsInputSchema = z.object({
575
+ kind: ChannelKindSchema.optional()
576
+ });
577
+ var CreateDMInputSchema = z.object({
578
+ otherUserUuid: UUIDSchema
579
+ });
580
+ var CreateGroupInputSchema = z.object({
581
+ name: z.string().min(1).max(64),
582
+ memberUuids: z.array(UUIDSchema).min(1).max(64)
583
+ });
584
+ var ListMessagesInputSchema = z.object({
585
+ channelId: UUIDSchema,
586
+ before: ISODateSchema.optional(),
587
+ limit: z.number().int().min(1).max(200).default(50)
588
+ });
589
+ var SendMessageInputSchema = z.object({
590
+ channelId: UUIDSchema,
591
+ body: z.string().min(1).max(4e3),
592
+ replyTo: UUIDSchema.optional()
593
+ });
594
+ var EditMessageInputSchema = z.object({
595
+ id: UUIDSchema,
596
+ body: z.string().min(1).max(4e3)
597
+ });
598
+ var DeleteMessageInputSchema = z.object({
599
+ id: UUIDSchema
600
+ });
601
+ var MarkReadInputSchema = z.object({
602
+ channelId: UUIDSchema,
603
+ messageId: UUIDSchema
604
+ });
605
+ var ReportMessageInputSchema = z.object({
606
+ messageId: UUIDSchema,
607
+ reason: z.enum(["spam", "harassment", "illegal", "other"]),
608
+ note: z.string().max(500).optional()
609
+ });
610
+ var ChannelReportsInputSchema = z.object({
611
+ channelId: UUIDSchema,
612
+ start: ISODateSchema.optional(),
613
+ end: ISODateSchema.optional()
614
+ });
615
+ var CHANNEL_KIND_LABELS = {
616
+ DM: "Direct messages",
617
+ GROUP: "Groups",
618
+ ANNOUNCEMENT: "Announcements"
619
+ };
620
+ var MediaKindSchema = z.enum(["screenshot", "video", "world", "skin"]);
621
+ var MediaItemSchema = z.object({
622
+ id: UUIDSchema,
623
+ kind: MediaKindSchema,
624
+ url: z.string().url(),
625
+ thumbnailUrl: z.string().url().nullable(),
626
+ sha256: z.string().regex(/^[a-f0-9]{64}$/),
627
+ sizeBytes: z.number().int().nonnegative(),
628
+ width: z.number().int().positive().optional(),
629
+ height: z.number().int().positive().optional(),
630
+ durationSec: z.number().int().nonnegative().optional(),
631
+ createdAt: ISODateSchema
632
+ });
633
+ var ListMediaInputSchema = z.object({
634
+ kind: MediaKindSchema.optional(),
635
+ limit: z.number().int().min(1).max(200).default(50),
636
+ offset: z.number().int().min(0).default(0)
637
+ });
638
+ var UploadMediaInputSchema = z.object({
639
+ kind: MediaKindSchema,
640
+ // base64 of the file bytes
641
+ data: z.string().min(1),
642
+ filename: z.string().min(1).max(255),
643
+ width: z.number().int().positive().optional(),
644
+ height: z.number().int().positive().optional()
645
+ });
646
+ var DeleteMediaInputSchema = z.object({ id: UUIDSchema });
647
+ var SignalingKindSchema = z.enum(["offer", "answer", "candidate"]);
648
+ var SignalingMessageSchema = z.object({
649
+ id: UUIDSchema,
650
+ kind: SignalingKindSchema,
651
+ fromUuid: UUIDSchema,
652
+ toUuid: UUIDSchema,
653
+ payload: z.string(),
654
+ // JSON-encoded SDP / ICE
655
+ createdAt: ISODateSchema
656
+ });
657
+ var SendSignalingInputSchema = z.object({
658
+ toUuid: UUIDSchema,
659
+ kind: SignalingKindSchema,
660
+ payload: z.string()
661
+ });
662
+ var ListSignalingInputSchema = z.object({
663
+ fromUuid: UUIDSchema.optional(),
664
+ since: ISODateSchema.optional()
665
+ });
666
+ var UpnpSessionStatusSchema = z.enum(["pending", "active", "closed", "error"]);
667
+ var UpnpSessionSchema = z.object({
668
+ id: UUIDSchema,
669
+ ownerUuid: UUIDSchema,
670
+ ownerDisplayName: z.string(),
671
+ publicAddress: z.string(),
672
+ publicPort: z.number().int().min(1).max(65535),
673
+ localAddress: z.string(),
674
+ localPort: z.number().int().min(1).max(65535),
675
+ status: UpnpSessionStatusSchema,
676
+ createdAt: ISODateSchema,
677
+ closedAt: ISODateSchema.nullable(),
678
+ invitedUuids: z.array(UUIDSchema)
679
+ });
680
+ var CreateUpnpInputSchema = z.object({
681
+ localAddress: z.string(),
682
+ localPort: z.number().int().min(1).max(65535),
683
+ invitedUuids: z.array(UUIDSchema).default([])
684
+ });
685
+ var CloseUpnpInputSchema = z.object({ id: UUIDSchema });
686
+ var KnownServerSchema = z.object({
687
+ id: UUIDSchema,
688
+ name: z.string(),
689
+ address: z.string(),
690
+ description: z.string().optional(),
691
+ iconUrl: z.string().url().nullable(),
692
+ playerCount: z.number().int().nonnegative().nullable(),
693
+ maxPlayers: z.number().int().positive().nullable(),
694
+ version: z.string().nullable(),
695
+ pingMs: z.number().int().nonnegative().nullable(),
696
+ source: z.enum(["anvil", "community"])
697
+ });
698
+ var SystemStatusSchema = z.object({
699
+ status: z.enum(["operational", "degraded", "outage"]),
700
+ maintenanceUntil: ISODateSchema.nullable(),
701
+ message: z.string().nullable()
702
+ });
703
+ var InstalledInstanceSchema = z.object({
704
+ id: UUIDSchema,
705
+ name: z.string(),
706
+ mcVersion: z.string(),
707
+ loader: LoaderTypeSchema,
708
+ loaderVersion: z.string(),
709
+ path: z.string(),
710
+ sizeBytes: z.number().int().nonnegative(),
711
+ lastPlayedAt: ISODateSchema.nullable(),
712
+ installedAt: ISODateSchema
713
+ });
714
+ var ReportTelemetryInputSchema = z.object({
715
+ event: z.enum(["launch", "playtime", "crash"]),
716
+ metadata: z.record(z.string(), z.string()).default({})
717
+ });
718
+ var LauncherUpdateInfoSchema = z.object({
719
+ currentVersion: z.string(),
720
+ latestVersion: z.string(),
721
+ updateAvailable: z.boolean(),
722
+ changelog: z.string().nullable(),
723
+ downloadUrl: z.string().url().nullable()
724
+ });
725
+
726
+ export { AcceptRequestInputSchema, AnvilConnectionSchema, ArchSchema, AuthConfigSchema, AuthProviderSchema, BuildFileSchema, BuildSchema, BuildSummarySchema, BuildVersionSchema, CHANNEL_KIND_LABELS, COSMETIC_TYPE_LABELS, CancelRequestInputSchema, ChannelKindSchema, ChannelReportsInputSchema, ChannelSchema, ChatMemberSchema, CheckLicenseInputSchema, CheckLicenseOutputSchema, CloseUpnpInputSchema, CommunityRulesStatusSchema, ContentConfigSchema, ContentSourceSchema, CosmeticRaritySchema, CosmeticSchema, CosmeticTypeSchema, CreateDMInputSchema, CreateGroupInputSchema, CreateOutfitInputSchema, CreateRelationshipInputSchema, CreateTrustedHostInputSchema, CreateUpnpInputSchema, DeleteMediaInputSchema, DeleteMessageInputSchema, DeleteOutfitInputSchema, DeleteRelationshipInputSchema, DeleteTrustedHostInputSchema, EditMessageInputSchema, EmoteWheelSchema, EmoteWheelSlotSchema, EquipCosmeticInputSchema, ForgotPasswordInputSchema, GetBuildInputSchema, ISODateSchema, InstalledInstanceSchema, InviteToServerInputSchema, KnownServerSchema, LauncherConfigSchema, LauncherModeSchema, LauncherUpdateInfoSchema, LicenseSchema, ListBuildsInputSchema, ListChannelsInputSchema, ListLicensesInputSchema, ListMediaInputSchema, ListMessagesInputSchema, ListRelationshipsInputSchema, ListSignalingInputSchema, LoaderTypeSchema, LocalizedRuleSchema, LocalizedStringSchema, LoginInputSchema, LookupByNameInputSchema, LookupByNameOutputSchema, MC_VERSIONS_POPULAR, MODRINTH_CATEGORIES, MarkReadInputSchema, MediaItemSchema, MediaKindSchema, MessageSchema, ModrinthDonationLinkSchema, ModrinthProjectSchema, ModrinthProjectTypeSchema, ModrinthSearchInputSchema, ModrinthSearchResponseSchema, OutfitSchema, OutfitSlotSchema, PRESENCE_COLORS, PaginatedSchema, PaginationInputSchema, PlatformSchema, PresenceSchema, PresenceStatusSchema, RARITY_COLORS, RELATIONSHIP_LABELS, RefreshInputSchema, RegisterInputSchema, RelationshipDirectionSchema, RelationshipSchema, RelationshipStatusSchema, RelationshipTypeSchema, RelationshipsListKindSchema, ReportActivityInputSchema, ReportMessageInputSchema, ReportTelemetryInputSchema, RequestDownloadInputSchema, RequestDownloadOutputSchema, ResetPasswordInputSchema, SaveEmoteWheelInputSchema, SendMessageInputSchema, SendSignalingInputSchema, SessionSchema, SetActiveSkinInputSchema, SignalingKindSchema, SignalingMessageSchema, SkinSchema, SkinVariantSchema, SuspensionStatusSchema, SystemStatusSchema, TRPCErrorSchema, TrustedHostSchema, UUIDSchema, UpdateOutfitInputSchema, UploadMediaInputSchema, UploadSkinInputSchema, UpnpSessionSchema, UpnpSessionStatusSchema, UserActivitySchema, UserSummarySchema, ValidateInputSchema, defaultLauncherConfig, isAuthProviderAnvil };
727
+ //# sourceMappingURL=chunk-WIGN6UED.js.map
728
+ //# sourceMappingURL=chunk-WIGN6UED.js.map