@anvil-js/client 0.0.1 → 0.0.3

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