@loontail/minecraft-kit 0.6.0 → 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.
package/dist/index.d.ts CHANGED
@@ -1,28 +1,91 @@
1
+ /** Authentication modes accepted by the launch composer. */
2
+ declare const AuthModes: {
3
+ /** Offline-mode play with a chosen username and synthetic UUID. */
4
+ readonly OFFLINE: "offline";
5
+ /** Pre-authenticated session — caller provides the access token and identity. */
6
+ readonly ONLINE: "online";
7
+ };
8
+ /** Auth mode literal. */
9
+ type AuthMode = (typeof AuthModes)[keyof typeof AuthModes];
10
+ /** Offline authentication. */
11
+ type OfflineAuth = {
12
+ readonly mode: typeof AuthModes.OFFLINE;
13
+ readonly username: string;
14
+ /** Optional explicit UUID. When omitted, a deterministic UUID is derived from the username. */
15
+ readonly uuid?: string;
16
+ };
17
+ /** Online (token-based) authentication. */
18
+ type OnlineAuth = {
19
+ readonly mode: typeof AuthModes.ONLINE;
20
+ readonly username: string;
21
+ readonly uuid: string;
22
+ readonly accessToken: string;
23
+ readonly userType?: string;
24
+ readonly clientId?: string;
25
+ readonly xuid?: string;
26
+ };
27
+ /** Auth shape consumed by `kit.launch.compose`. */
28
+ type LaunchAuth = OfflineAuth | OnlineAuth;
1
29
  /**
2
- * Cooperative pause primitive. Consumers call {@link waitWhilePaused} at safe
3
- * checkpoints. Independent from `AbortSignal` abort wins at the next signal
4
- * check.
30
+ * Device-code prompt presented to the user. The caller renders these to the user, who then
31
+ * visits {@link verificationUri} in a browser and enters {@link userCode}.
5
32
  */
6
- declare class PauseController {
7
- #private;
8
- get paused(): boolean;
9
- pause(): void;
10
- resume(): void;
11
- waitWhilePaused(): Promise<void>;
12
- }
13
-
14
- /** Pluggable in-memory cache for HTTP metadata responses. */
15
- interface MetadataCache {
16
- get<T>(key: string): T | undefined;
17
- set<T>(key: string, value: T, ttlMs?: number): void;
18
- delete(key: string): void;
19
- clear(): void;
20
- }
33
+ type DeviceCodePrompt = {
34
+ /** Short alphanumeric code the user types on the verification page. */
35
+ readonly userCode: string;
36
+ /** URI the user opens to complete sign-in (typically `https://microsoft.com/link`). */
37
+ readonly verificationUri: string;
38
+ /** Human-readable instruction string suggested by Microsoft. */
39
+ readonly message: string;
40
+ /** Seconds before the device/user code pair becomes invalid. */
41
+ readonly expiresIn: number;
42
+ /** Recommended seconds between polling requests. */
43
+ readonly interval: number;
44
+ };
45
+ /** Opaque state returned by `start()` and consumed by `poll()`. */
46
+ type DeviceCodeState = {
47
+ readonly deviceCode: string;
48
+ readonly userCode: string;
49
+ readonly verificationUri: string;
50
+ readonly message: string;
51
+ readonly expiresIn: number;
52
+ readonly interval: number;
53
+ readonly clientId: string;
54
+ /** Wall-clock ms timestamp after which polling should stop. */
55
+ readonly expiresAt: number;
56
+ };
57
+ /**
58
+ * Combined Microsoft + Minecraft session returned by `kit.auth.login` and `kit.auth.refresh`.
59
+ *
60
+ * The fields under {@link minecraft} are everything {@link OnlineAuth} needs. The fields under
61
+ * {@link microsoft} are needed only by the launcher to refresh the session later — persist them
62
+ * to durable storage (encrypted) alongside the user's profile.
63
+ */
64
+ type MojangSession = {
65
+ readonly minecraft: {
66
+ /** Player display name. */
67
+ readonly username: string;
68
+ /** Player UUID, dashed (e.g. `f81d4fae-7dec-11d0-a765-00a0c91e6bf6`). */
69
+ readonly uuid: string;
70
+ /** Bearer token for `api.minecraftservices.com` and the game itself. */
71
+ readonly accessToken: string;
72
+ /** Wall-clock ms timestamp when {@link accessToken} expires. */
73
+ readonly expiresAt: number;
74
+ /** Xbox User ID (XUID) as a numeric string. */
75
+ readonly xuid: string;
76
+ };
77
+ readonly microsoft: {
78
+ /** Microsoft refresh token; used to obtain a fresh session without re-prompting. */
79
+ readonly refreshToken: string;
80
+ /** Azure AD application id used to mint the session. */
81
+ readonly clientId: string;
82
+ };
83
+ };
21
84
 
22
85
  /** Subset of fetch headers the library actually uses. */
23
86
  type HttpHeaders = Readonly<Record<string, string>>;
24
87
  /** Response delivered by the {@link HttpClient} interface. */
25
- interface HttpResponse {
88
+ type HttpResponse = {
26
89
  readonly status: number;
27
90
  readonly headers: HttpHeaders;
28
91
  readonly url: string;
@@ -31,24 +94,161 @@ interface HttpResponse {
31
94
  bytes(): Promise<Uint8Array>;
32
95
  /** Stream the body. The stream may be consumed at most once. */
33
96
  stream(): AsyncIterable<Uint8Array>;
34
- }
97
+ };
98
+ /** HTTP method supported by {@link HttpClient}. */
99
+ type HttpMethod = "GET" | "POST";
100
+ /** Body payload accepted on POST requests. */
101
+ type HttpRequestBody = string | Uint8Array;
35
102
  /** Options for an HTTP request. */
36
- interface HttpRequestOptions {
103
+ type HttpRequestOptions = {
37
104
  readonly headers?: HttpHeaders;
38
105
  readonly signal?: AbortSignal;
39
106
  readonly timeoutMs?: number;
40
107
  /** When true, do not consult the in-memory cache. */
41
108
  readonly noCache?: boolean;
42
- }
109
+ /** HTTP method. Defaults to `GET`. */
110
+ readonly method?: HttpMethod;
111
+ /** Request body. Ignored for GET. */
112
+ readonly body?: HttpRequestBody;
113
+ /**
114
+ * When `true`, the client returns the response even for non-2xx statuses
115
+ * instead of throwing. Useful for callers that must inspect the body of
116
+ * error responses (e.g. OAuth polling endpoints that return 400 with
117
+ * structured JSON like `{"error":"authorization_pending"}`).
118
+ */
119
+ readonly acceptNonOk?: boolean;
120
+ };
43
121
  /**
44
122
  * Pluggable HTTP client. The default implementation uses Node's built-in fetch; consumers
45
123
  * can inject a fake (e.g. for tests) by passing an `httpClient` to the {@link MinecraftKit}
46
124
  * constructor.
47
125
  */
48
- interface HttpClient {
126
+ type HttpClient = {
49
127
  request(url: string, options?: HttpRequestOptions): Promise<HttpResponse>;
128
+ };
129
+
130
+ /** Log levels accepted by the pluggable logger. */
131
+ declare const LogLevels: {
132
+ readonly DEBUG: "debug";
133
+ readonly INFO: "info";
134
+ readonly WARN: "warn";
135
+ readonly ERROR: "error";
136
+ };
137
+ /** Log-level literal. */
138
+ type LogLevel = (typeof LogLevels)[keyof typeof LogLevels];
139
+ /** Pluggable logger. Default implementation is a silent logger; pass your own to surface logs. */
140
+ type Logger = {
141
+ log(level: LogLevel, message: string, fields?: Readonly<Record<string, unknown>>): void;
142
+ };
143
+
144
+ /** Env var consulted when no explicit `clientId` is supplied. */
145
+ declare const CLIENT_ID_ENV_VAR = "MINECRAFT_KIT_MSA_CLIENT_ID";
146
+
147
+ /** Options accepted by {@link MojangAuthApi.login}. */
148
+ type LoginOptions = {
149
+ /**
150
+ * Azure AD application id. When omitted, the value of
151
+ * `process.env.MINECRAFT_KIT_MSA_CLIENT_ID` is used. Throws `AUTH_MISSING_CLIENT_ID` if
152
+ * neither is set — the library cannot ship a default client id.
153
+ */
154
+ readonly clientId?: string;
155
+ /**
156
+ * Called once with the URL + user code the user must enter in a browser. The promise
157
+ * returned by `login` resolves only after the user finishes signing in (or rejects on
158
+ * abort / decline / timeout).
159
+ */
160
+ readonly onPrompt: (prompt: DeviceCodePrompt) => void | Promise<void>;
161
+ /** Called once per polling tick — useful for UI "still waiting" feedback. */
162
+ readonly onPoll?: (info: {
163
+ readonly nextDelayMs: number;
164
+ readonly expiresAt: number;
165
+ }) => void;
166
+ readonly signal?: AbortSignal;
167
+ };
168
+ /** Options accepted by {@link MojangAuthApi.refresh}. */
169
+ type RefreshOptions = {
170
+ /** As in {@link LoginOptions.clientId}. */
171
+ readonly clientId?: string;
172
+ readonly signal?: AbortSignal;
173
+ };
174
+ /** Options accepted by {@link MojangAuthApi.deviceCode.start}. */
175
+ type StartDeviceCodeOptions = {
176
+ readonly clientId?: string;
177
+ readonly signal?: AbortSignal;
178
+ };
179
+ /** Options accepted by {@link MojangAuthApi.deviceCode.poll}. */
180
+ type PollDeviceCodeOptions = {
181
+ readonly signal?: AbortSignal;
182
+ readonly onTick?: (info: {
183
+ readonly nextDelayMs: number;
184
+ readonly expiresAt: number;
185
+ }) => void;
186
+ };
187
+ /**
188
+ * High-level Microsoft / Mojang auth surface attached to {@link import("../kit").MinecraftKit}
189
+ * as `kit.auth`. Implements the standard 5-step flow:
190
+ *
191
+ * 1. Microsoft OAuth2 device-code grant against the `consumers` tenant.
192
+ * 2. Xbox Live RPS exchange.
193
+ * 3. XSTS token bound to `rp://api.minecraftservices.com/`.
194
+ * 4. `login_with_xbox` to get a Minecraft bearer token.
195
+ * 5. `minecraft/profile` to resolve the player UUID + display name.
196
+ *
197
+ * Returns a {@link MojangSession} carrying everything launch composition needs plus the
198
+ * Microsoft refresh token. The library does NOT persist tokens — that's the launcher's job.
199
+ */
200
+ declare class MojangAuthApi {
201
+ private readonly http;
202
+ constructor(http: HttpClient);
203
+ /**
204
+ * Run the full device-code flow end-to-end. The caller supplies an `onPrompt` callback to
205
+ * render the URL + code to the user; this method polls until they finish.
206
+ */
207
+ login(options: LoginOptions): Promise<MojangSession>;
208
+ /** Refresh a previously obtained session. The Microsoft refresh token may be rotated. */
209
+ refresh(refreshToken: string, options?: RefreshOptions): Promise<MojangSession>;
210
+ /**
211
+ * Lower-level device-code surface — exposed so callers can decouple "show prompt" from
212
+ * "block on poll" (e.g. a GUI that lets the user dismiss the modal). Most callers should
213
+ * use {@link login} instead.
214
+ */
215
+ readonly deviceCode: {
216
+ start: (options?: StartDeviceCodeOptions) => Promise<{
217
+ readonly prompt: DeviceCodePrompt;
218
+ readonly state: DeviceCodeState;
219
+ }>;
220
+ poll: (state: DeviceCodeState, options?: PollDeviceCodeOptions) => Promise<MojangSession>;
221
+ };
222
+ /** Steps 2 → 5: given a Microsoft access token, finish the flow. */
223
+ private completeMicrosoftToken;
224
+ }
225
+ /**
226
+ * Project a {@link MojangSession} into the {@link OnlineAuth} shape that `kit.launch.compose`
227
+ * accepts.
228
+ */
229
+ declare const toOnlineAuth: (session: MojangSession) => OnlineAuth;
230
+
231
+ /**
232
+ * Cooperative pause primitive. Consumers call {@link waitWhilePaused} at safe
233
+ * checkpoints. Independent from `AbortSignal` — abort wins at the next signal
234
+ * check.
235
+ */
236
+ declare class PauseController {
237
+ #private;
238
+ get paused(): boolean;
239
+ pause(): void;
240
+ resume(): void;
241
+ waitWhilePaused(): Promise<void>;
50
242
  }
51
243
 
244
+ /** Pluggable in-memory cache for HTTP metadata responses. */
245
+ type MetadataCache = {
246
+ get<T>(key: string): T | undefined;
247
+ set<T>(key: string, value: T, ttlMs?: number): void;
248
+ delete(key: string): void;
249
+ clear(): void;
250
+ };
251
+
52
252
  /**
53
253
  * Minecraft release channels matching the `type` field of Mojang version manifest entries.
54
254
  */
@@ -66,7 +266,7 @@ type MinecraftChannel = (typeof MinecraftChannels)[keyof typeof MinecraftChannel
66
266
  * Note: this is a summary entry, not the full per-version manifest. Use
67
267
  * {@link ResolvedMinecraft} for the resolved/parsed full manifest.
68
268
  */
69
- interface MinecraftVersionSummary {
269
+ type MinecraftVersionSummary = {
70
270
  /** Version id (e.g. `"1.20.1"`). */
71
271
  readonly id: string;
72
272
  /** Release channel. */
@@ -81,9 +281,9 @@ interface MinecraftVersionSummary {
81
281
  readonly sha1: string;
82
282
  /** Compliance level: 0 = legacy, 1 = secure-chat / safety features. */
83
283
  readonly complianceLevel: number;
84
- }
284
+ };
85
285
  /** Subset of the per-version manifest used by resolvers and consumers. */
86
- interface MinecraftVersionManifest {
286
+ type MinecraftVersionManifest = {
87
287
  readonly id: string;
88
288
  readonly type: MinecraftChannel | string;
89
289
  readonly mainClass: string;
@@ -104,30 +304,30 @@ interface MinecraftVersionManifest {
104
304
  readonly time?: string;
105
305
  readonly minimumLauncherVersion?: number;
106
306
  readonly complianceLevel?: number;
107
- }
307
+ };
108
308
  /** Reference to the asset-index JSON file. */
109
- interface AssetIndexReference {
309
+ type AssetIndexReference = {
110
310
  readonly id: string;
111
311
  readonly sha1: string;
112
312
  readonly size: number;
113
313
  readonly totalSize: number;
114
314
  readonly url: string;
115
- }
315
+ };
116
316
  /** Per-platform downloads block of the Minecraft per-version manifest. */
117
- interface MinecraftDownloads {
317
+ type MinecraftDownloads = {
118
318
  readonly client: ArtifactDownload;
119
319
  readonly server?: ArtifactDownload;
120
320
  readonly client_mappings?: ArtifactDownload;
121
321
  readonly server_mappings?: ArtifactDownload;
122
- }
322
+ };
123
323
  /** A single hash-verified download. */
124
- interface ArtifactDownload {
324
+ type ArtifactDownload = {
125
325
  readonly sha1: string;
126
326
  readonly size: number;
127
327
  readonly url: string;
128
- }
328
+ };
129
329
  /** Library entry. Combines vanilla, modern-natives, and legacy-classifier shapes. */
130
- interface MinecraftLibrary {
330
+ type MinecraftLibrary = {
131
331
  readonly name: string;
132
332
  readonly downloads?: MinecraftLibraryDownloads;
133
333
  readonly natives?: Readonly<Record<string, string>>;
@@ -137,18 +337,18 @@ interface MinecraftLibrary {
137
337
  readonly rules?: readonly LibraryRule[];
138
338
  /** Some Fabric/Forge libraries carry only a Maven base URL plus a coordinate. */
139
339
  readonly url?: string;
140
- }
340
+ };
141
341
  /** Library downloads block. */
142
- interface MinecraftLibraryDownloads {
342
+ type MinecraftLibraryDownloads = {
143
343
  readonly artifact?: LibraryArtifact;
144
344
  readonly classifiers?: Readonly<Record<string, LibraryArtifact>>;
145
- }
345
+ };
146
346
  /** An individual library artifact (jar/zip). */
147
347
  interface LibraryArtifact extends ArtifactDownload {
148
348
  readonly path: string;
149
349
  }
150
350
  /** Rule entry used by libraries and modern arguments. */
151
- interface LibraryRule {
351
+ type LibraryRule = {
152
352
  readonly action: "allow" | "disallow";
153
353
  readonly os?: {
154
354
  readonly name?: string;
@@ -156,25 +356,25 @@ interface LibraryRule {
156
356
  readonly version?: string;
157
357
  };
158
358
  readonly features?: Readonly<Record<string, boolean>>;
159
- }
359
+ };
160
360
  /** Modern (1.13+) arguments structure. */
161
- interface MinecraftArguments {
361
+ type MinecraftArguments = {
162
362
  readonly game: readonly ArgumentEntry[];
163
363
  readonly jvm: readonly ArgumentEntry[];
164
- }
364
+ };
165
365
  /** A single argument entry: bare string or rule-gated value. */
166
366
  type ArgumentEntry = string | {
167
367
  readonly rules: readonly LibraryRule[];
168
368
  readonly value: string | readonly string[];
169
369
  };
170
370
  /** Required Java runtime descriptor from the version manifest. */
171
- interface MinecraftJavaVersion {
371
+ type MinecraftJavaVersion = {
172
372
  /** Mojang java-runtime component name (e.g. `java-runtime-gamma`). */
173
373
  readonly component: string;
174
374
  readonly majorVersion: number;
175
- }
375
+ };
176
376
  /** Logging-config entry from the version manifest. */
177
- interface MinecraftLogging {
377
+ type MinecraftLogging = {
178
378
  readonly client?: {
179
379
  readonly argument: string;
180
380
  readonly file: ArtifactDownload & {
@@ -182,49 +382,49 @@ interface MinecraftLogging {
182
382
  };
183
383
  readonly type: string;
184
384
  };
185
- }
385
+ };
186
386
  /**
187
387
  * Fully resolved Minecraft version: summary + parsed manifest, ready to feed into
188
388
  * `kit.targets.create` or `kit.install.plan`.
189
389
  */
190
- interface ResolvedMinecraft {
390
+ type ResolvedMinecraft = {
191
391
  /** Version id (e.g. `"1.20.1"`). */
192
392
  readonly version: string;
193
393
  readonly channel: MinecraftChannel;
194
394
  readonly manifest: MinecraftVersionManifest;
195
395
  readonly summary: MinecraftVersionSummary;
196
- }
396
+ };
197
397
  /** Asset index document body. */
198
- interface AssetIndexDocument {
398
+ type AssetIndexDocument = {
199
399
  readonly objects: Readonly<Record<string, AssetObject>>;
200
400
  readonly virtual?: boolean;
201
401
  readonly map_to_resources?: boolean;
202
- }
402
+ };
203
403
  /** A single asset object hash + size. */
204
- interface AssetObject {
404
+ type AssetObject = {
205
405
  readonly hash: string;
206
406
  readonly size: number;
207
- }
407
+ };
208
408
 
209
409
  /** Summary entry from `/v2/versions/loader`. */
210
- interface FabricLoaderSummary {
410
+ type FabricLoaderSummary = {
211
411
  readonly version: string;
212
412
  readonly stable: boolean;
213
413
  readonly maven: string;
214
414
  readonly build: number;
215
415
  readonly separator: string;
216
- }
416
+ };
217
417
  /** Compatibility entry from `/v2/versions/loader/{minecraftVersion}`. */
218
- interface FabricCompatibilityEntry {
418
+ type FabricCompatibilityEntry = {
219
419
  readonly loader: FabricLoaderSummary;
220
420
  readonly intermediary: {
221
421
  readonly version: string;
222
422
  readonly maven: string;
223
423
  readonly stable: boolean;
224
424
  };
225
- }
425
+ };
226
426
  /** Fabric profile JSON returned by `/v2/versions/loader/{mc}/{loader}/profile/json`. */
227
- interface FabricProfile {
427
+ type FabricProfile = {
228
428
  readonly id: string;
229
429
  readonly inheritsFrom: string;
230
430
  readonly type: string;
@@ -234,17 +434,17 @@ interface FabricProfile {
234
434
  readonly game?: readonly string[];
235
435
  readonly jvm?: readonly string[];
236
436
  };
237
- }
437
+ };
238
438
  /** Resolved Fabric loader for a specific Minecraft version. */
239
- interface ResolvedFabricLoader {
439
+ type ResolvedFabricLoader = {
240
440
  readonly type: typeof Loaders.FABRIC;
241
441
  readonly minecraftVersion: string;
242
442
  readonly loaderVersion: string;
243
443
  readonly profile: FabricProfile;
244
- }
444
+ };
245
445
 
246
446
  /** A Forge build entry derived from the Maven metadata XML. */
247
- interface ForgeBuildSummary {
447
+ type ForgeBuildSummary = {
248
448
  /** Full Maven version string e.g. `"1.20.1-47.2.0"`. */
249
449
  readonly fullVersion: string;
250
450
  /** Minecraft version e.g. `"1.20.1"`. */
@@ -255,9 +455,9 @@ interface ForgeBuildSummary {
255
455
  readonly isRecommended: boolean;
256
456
  /** True when this build is the latest one per `promotions_slim.json`. */
257
457
  readonly isLatest: boolean;
258
- }
458
+ };
259
459
  /** Modern Forge `install_profile.json` (spec 1) shape — only fields we actually consume. */
260
- interface ForgeInstallProfile {
460
+ type ForgeInstallProfile = {
261
461
  readonly spec: number;
262
462
  readonly profile: string;
263
463
  readonly version: string;
@@ -270,22 +470,22 @@ interface ForgeInstallProfile {
270
470
  readonly libraries: readonly MinecraftLibrary[];
271
471
  readonly processors: readonly ForgeProcessor[];
272
472
  readonly serverJarPath?: string;
273
- }
473
+ };
274
474
  /** Side-keyed data value pair. */
275
- interface ForgeProfileData {
475
+ type ForgeProfileData = {
276
476
  readonly client: string;
277
477
  readonly server: string;
278
- }
478
+ };
279
479
  /** A single processor invocation. */
280
- interface ForgeProcessor {
480
+ type ForgeProcessor = {
281
481
  readonly sides?: readonly ("client" | "server" | "extract")[];
282
482
  readonly jar: string;
283
483
  readonly classpath: readonly string[];
284
484
  readonly args: readonly string[];
285
485
  readonly outputs?: Readonly<Record<string, string>>;
286
- }
486
+ };
287
487
  /** The version.json stored inside the Forge installer JAR. */
288
- interface ForgeVersionJson {
488
+ type ForgeVersionJson = {
289
489
  readonly id: string;
290
490
  readonly inheritsFrom: string;
291
491
  readonly type: string;
@@ -295,27 +495,27 @@ interface ForgeVersionJson {
295
495
  readonly game?: readonly string[];
296
496
  readonly jvm?: readonly string[];
297
497
  };
298
- }
498
+ };
299
499
  /** Resolved Forge loader. */
300
- interface ResolvedForgeLoader {
500
+ type ResolvedForgeLoader = {
301
501
  readonly type: typeof Loaders.FORGE;
302
502
  readonly minecraftVersion: string;
303
503
  readonly forgeVersion: string;
304
504
  readonly fullVersion: string;
305
505
  readonly installerUrl: string;
306
- }
506
+ };
307
507
 
308
508
  /**
309
509
  * Trivial loader used when no mod loader is in play. Carries the resolved Minecraft so the
310
510
  * launch composer has a uniform view across vanilla / Fabric / Forge.
311
511
  */
312
- interface ResolvedVanillaLoader {
512
+ type ResolvedVanillaLoader = {
313
513
  readonly type: typeof Loaders.VANILLA;
314
514
  /** Minecraft version this loader is pinned to. */
315
515
  readonly minecraftVersion: string;
316
516
  /** The Minecraft manifest used for launch — same as the target's `minecraft.manifest`. */
317
517
  readonly minecraft: ResolvedMinecraft;
318
- }
518
+ };
319
519
 
320
520
  /**
321
521
  * Discriminator literal identifying which mod loader is active for a target.
@@ -377,14 +577,14 @@ type Architecture = (typeof Architectures)[keyof typeof Architectures];
377
577
  * Identifies the host system for the launcher. All resolvers consume this object to
378
578
  * pick the right artifacts (libraries, natives, runtime).
379
579
  */
380
- interface RuntimeSystem {
580
+ type RuntimeSystem = {
381
581
  /** OS identifier (mojang naming). */
382
582
  readonly os: OperatingSystem;
383
583
  /** CPU architecture (mojang naming). */
384
584
  readonly arch: Architecture;
385
585
  /** OS version string from `os.release()`. Used to evaluate library `os.version` regex rules. */
386
586
  readonly osVersion: string;
387
- }
587
+ };
388
588
 
389
589
  /**
390
590
  * Mojang Java-runtime component identifiers. New components appear over time
@@ -420,7 +620,7 @@ type RuntimeIndex = Readonly<Record<string, RuntimeIndexPlatform>>;
420
620
  /** Per-platform component map inside the runtime index. */
421
621
  type RuntimeIndexPlatform = Readonly<Record<string, readonly RuntimeIndexEntry[]>>;
422
622
  /** A single available runtime release. */
423
- interface RuntimeIndexEntry {
623
+ type RuntimeIndexEntry = {
424
624
  readonly availability: {
425
625
  readonly group: number;
426
626
  readonly progress: number;
@@ -434,15 +634,15 @@ interface RuntimeIndexEntry {
434
634
  readonly name: string;
435
635
  readonly released: string;
436
636
  };
437
- }
637
+ };
438
638
  /** Inner per-component file manifest. */
439
- interface RuntimeFilesManifest {
639
+ type RuntimeFilesManifest = {
440
640
  readonly files: Readonly<Record<string, RuntimeFileEntry>>;
441
- }
641
+ };
442
642
  /** A single file in the runtime manifest. */
443
643
  type RuntimeFileEntry = RuntimeFileFile | RuntimeFileDirectory | RuntimeFileLink;
444
644
  /** A file entry: real bytes to download, may have lzma sidecar. */
445
- interface RuntimeFileFile {
645
+ type RuntimeFileFile = {
446
646
  readonly type: "file";
447
647
  readonly executable: boolean;
448
648
  readonly downloads: {
@@ -457,18 +657,18 @@ interface RuntimeFileFile {
457
657
  readonly url: string;
458
658
  };
459
659
  };
460
- }
660
+ };
461
661
  /** A directory placeholder. */
462
- interface RuntimeFileDirectory {
662
+ type RuntimeFileDirectory = {
463
663
  readonly type: "directory";
464
- }
664
+ };
465
665
  /** A relative symlink. */
466
- interface RuntimeFileLink {
666
+ type RuntimeFileLink = {
467
667
  readonly type: "link";
468
668
  readonly target: string;
469
- }
669
+ };
470
670
  /** Resolved runtime ready to install or launch with. */
471
- interface ResolvedRuntime {
671
+ type ResolvedRuntime = {
472
672
  /** Mojang component name (e.g. `java-runtime-gamma`). */
473
673
  readonly component: string;
474
674
  /** Platform key inside the runtime index (e.g. `windows-x64`). */
@@ -487,7 +687,7 @@ interface ResolvedRuntime {
487
687
  * live at `<installRoot>/<component>/...`. When unset, defaults to `<target.directory>/runtime`.
488
688
  */
489
689
  readonly installRoot?: string;
490
- }
690
+ };
491
691
 
492
692
  /**
493
693
  * Fully resolved target: a concrete Minecraft + loader + runtime + directory.
@@ -496,7 +696,7 @@ interface ResolvedRuntime {
496
696
  * it. `kit.targets.create` produces a Target from already-resolved components;
497
697
  * `kit.targets.resolve` resolves them in one go.
498
698
  */
499
- interface Target {
699
+ type Target = {
500
700
  /** Stable identifier chosen by the consumer. Used for diagnostics, not persistence. */
501
701
  readonly id: string;
502
702
  /** Absolute or relative path to the per-target Minecraft directory. */
@@ -504,20 +704,20 @@ interface Target {
504
704
  readonly minecraft: ResolvedMinecraft;
505
705
  readonly loader: Loader;
506
706
  readonly runtime: ResolvedRuntime;
507
- }
707
+ };
508
708
  /** Inputs accepted by `kit.targets.create`. */
509
- interface TargetCreateInput {
709
+ type TargetCreateInput = {
510
710
  readonly id: string;
511
711
  readonly directory: string;
512
712
  readonly minecraft: ResolvedMinecraft;
513
713
  readonly loader: Loader;
514
714
  readonly runtime: ResolvedRuntime;
515
- }
715
+ };
516
716
  /**
517
717
  * Discovered installation found by scanning a root directory. Contains only what was
518
718
  * actually read from disk — no assumptions about correctness, completeness, or repair state.
519
719
  */
520
- interface DiscoveredTarget {
720
+ type DiscoveredTarget = {
521
721
  /** Subdirectory name under the scanned root. */
522
722
  readonly id: string;
523
723
  /** Absolute or normalized directory path. */
@@ -528,19 +728,19 @@ interface DiscoveredTarget {
528
728
  readonly loaders: readonly DiscoveredLoaderHint[];
529
729
  /** Detected Java executable, when one is present in the per-target `runtime/` folder. */
530
730
  readonly runtime?: DiscoveredRuntimeHint;
531
- }
731
+ };
532
732
  /** Inferred loader hint (does not assert correctness). */
533
- interface DiscoveredLoaderHint {
733
+ type DiscoveredLoaderHint = {
534
734
  readonly type: LoaderKind;
535
735
  readonly minecraftVersion?: string;
536
736
  readonly version?: string;
537
- }
737
+ };
538
738
  /** Detected runtime files. */
539
- interface DiscoveredRuntimeHint {
739
+ type DiscoveredRuntimeHint = {
540
740
  readonly component?: string;
541
741
  readonly javaPath?: string;
542
742
  readonly javaVersion?: string;
543
- }
743
+ };
544
744
 
545
745
  /**
546
746
  * Coarse-grained install phases. Used in `install:phase-changed` events so consumers can
@@ -573,50 +773,84 @@ declare const InstallActionKinds: {
573
773
  };
574
774
  /** Discriminator for an install action. */
575
775
  type InstallActionKind = (typeof InstallActionKinds)[keyof typeof InstallActionKinds];
776
+ /**
777
+ * Categorisation tag on every {@link DownloadAction}. Drives the install-phase mapping
778
+ * and lets consumers filter the plan to a subset (e.g. "runtime only").
779
+ */
780
+ declare const DownloadCategories: {
781
+ readonly CLIENT_JAR: "client-jar";
782
+ readonly LIBRARY: "library";
783
+ readonly ASSET_INDEX: "asset-index";
784
+ readonly ASSET: "asset";
785
+ readonly LOGGING_CONFIG: "logging-config";
786
+ readonly FABRIC_LIBRARY: "fabric-library";
787
+ readonly FORGE_LIBRARY: "forge-library";
788
+ readonly RUNTIME_FILE: "runtime-file";
789
+ readonly FORGE_INSTALLER: "forge-installer";
790
+ };
791
+ /** Download category literal — drives `runInstall` phase boundaries. */
792
+ type DownloadCategory = (typeof DownloadCategories)[keyof typeof DownloadCategories];
576
793
  /** A single download step. */
577
- interface DownloadAction {
794
+ type DownloadAction = {
578
795
  readonly kind: typeof InstallActionKinds.DOWNLOAD_FILE;
579
796
  readonly url: string;
580
797
  readonly target: string;
581
798
  readonly expectedSha1?: string;
582
799
  readonly expectedSize?: number;
583
- readonly category: "client-jar" | "library" | "asset-index" | "asset" | "logging-config" | "fabric-library" | "forge-library" | "runtime-file" | "forge-installer";
584
- }
800
+ readonly category: DownloadCategory;
801
+ };
585
802
  /** A native extraction step. Source jar must already exist on disk. */
586
- interface ExtractNativeAction {
803
+ type ExtractNativeAction = {
587
804
  readonly kind: typeof InstallActionKinds.EXTRACT_NATIVE;
588
805
  readonly source: string;
589
806
  readonly destination: string;
590
807
  readonly exclude: readonly string[];
591
- }
808
+ };
592
809
  /**
593
810
  * A Forge processor invocation. `Main-Class` is intentionally NOT carried here — the
594
811
  * runner reads it from `classpath[0]`'s manifest at execution time, because the JAR is
595
812
  * not guaranteed to exist on disk during planning (newer Forge versions ship some
596
813
  * processor JARs as regular Maven libraries instead of bundling them in the installer).
597
814
  */
598
- interface RunForgeProcessorAction {
815
+ type RunForgeProcessorAction = {
599
816
  readonly kind: typeof InstallActionKinds.RUN_FORGE_PROCESSOR;
600
817
  readonly index: number;
601
818
  /** First entry is the processor JAR; remaining entries are its declared classpath. */
602
819
  readonly classpath: readonly string[];
603
820
  readonly args: readonly string[];
604
821
  readonly outputs: Readonly<Record<string, string>>;
605
- }
822
+ };
606
823
  /** Write a version JSON to disk (Fabric / Forge). */
607
- interface WriteVersionJsonAction {
824
+ type WriteVersionJsonAction = {
608
825
  readonly kind: typeof InstallActionKinds.WRITE_VERSION_JSON;
609
826
  readonly path: string;
610
827
  readonly content: string;
611
- }
828
+ };
612
829
  /** Write a logging config (log4j XML) to disk. */
613
- interface WriteLoggingConfigAction {
830
+ type WriteLoggingConfigAction = {
614
831
  readonly kind: typeof InstallActionKinds.WRITE_LOGGING_CONFIG;
615
832
  readonly path: string;
616
833
  readonly content: string;
617
- }
834
+ };
618
835
  /** Discriminated union of install actions. */
619
836
  type InstallAction = DownloadAction | ExtractNativeAction | RunForgeProcessorAction | WriteVersionJsonAction | WriteLoggingConfigAction;
837
+ /**
838
+ * A "runtime-only" install plan target. Used by `planStandaloneRuntimeInstall` to plan a
839
+ * JRE-only install without a Minecraft version/loader pinned to the plan.
840
+ */
841
+ type RuntimeOnlyInstallTarget = {
842
+ readonly id: string;
843
+ readonly directory: string;
844
+ readonly runtime: ResolvedRuntime;
845
+ readonly minecraft?: undefined;
846
+ readonly loader?: undefined;
847
+ };
848
+ /**
849
+ * Shape of `InstallPlan.target`. Either a fully-resolved {@link import("./target").Target} or a
850
+ * runtime-only stand-in. The install runner only reads `target.minecraft`/`target.loader` when
851
+ * the plan actually contains those steps, so runtime-only plans are safe.
852
+ */
853
+ type InstallPlanTarget = Target | RuntimeOnlyInstallTarget;
620
854
  /**
621
855
  * Pre-computed install plan: a flat ordered list of actions plus computed totals.
622
856
  *
@@ -624,30 +858,30 @@ type InstallAction = DownloadAction | ExtractNativeAction | RunForgeProcessorAct
624
858
  * carries a reference to the resolved target so the runner does not need a second target
625
859
  * argument.
626
860
  */
627
- interface InstallPlan {
861
+ type InstallPlan = {
628
862
  readonly targetId: string;
629
863
  readonly directory: string;
630
- readonly target: Target;
864
+ readonly target: InstallPlanTarget;
631
865
  readonly actions: readonly InstallAction[];
632
866
  readonly totalBytes: number;
633
867
  readonly totalActions: number;
634
- }
868
+ };
635
869
  /** Outcome summary returned by `install.run`. */
636
- interface InstallReport {
870
+ type InstallReport = {
637
871
  readonly targetId: string;
638
872
  readonly bytesDownloaded: number;
639
873
  readonly actionsCompleted: number;
640
874
  readonly actionsSkipped: number;
641
875
  readonly durationMs: number;
642
- }
876
+ };
643
877
 
644
878
  /** Inputs to {@link planRuntimeInstall}. */
645
- interface PlanRuntimeInstallInput {
879
+ type PlanRuntimeInstallInput = {
646
880
  readonly target: Target;
647
881
  readonly http: HttpClient;
648
882
  readonly cache: MetadataCache;
649
883
  readonly signal?: AbortSignal;
650
- }
884
+ };
651
885
  /**
652
886
  * Build an install plan that downloads ONLY the Java runtime declared by `target.runtime`.
653
887
  *
@@ -659,9 +893,9 @@ interface PlanRuntimeInstallInput {
659
893
  * install runner — directory placeholders and symlinks declared by the runtime manifest are
660
894
  * still materialized after downloads complete.
661
895
  */
662
- declare function planRuntimeInstall(input: PlanRuntimeInstallInput): Promise<InstallPlan>;
896
+ declare const planRuntimeInstall: (input: PlanRuntimeInstallInput) => Promise<InstallPlan>;
663
897
  /** Inputs to {@link planStandaloneRuntimeInstall}. */
664
- interface PlanStandaloneRuntimeInstallInput {
898
+ type PlanStandaloneRuntimeInstallInput = {
665
899
  readonly id: string;
666
900
  /** Where the runtime files live. Used as `directory` if `runtime.installRoot` is unset. */
667
901
  readonly directory: string;
@@ -669,16 +903,15 @@ interface PlanStandaloneRuntimeInstallInput {
669
903
  readonly http: HttpClient;
670
904
  readonly cache: MetadataCache;
671
905
  readonly signal?: AbortSignal;
672
- }
906
+ };
673
907
  /**
674
908
  * Plan a runtime-only install **without a Minecraft target**. Useful for "Install Java/runtime"
675
909
  * flows where the user just wants a JRE on disk and never had a Minecraft version to choose
676
- * from. The returned plan is shaped exactly like a normal {@link InstallPlan} and runs through
677
- * the standard install runner but its `target.minecraft` and `target.loader` fields are
678
- * intentional placeholders. The runner only reads `target.runtime` for runtime-only plans, so
679
- * the placeholders are never accessed at runtime.
910
+ * from. The returned plan is shaped exactly like a normal {@link InstallPlan} but uses a
911
+ * {@link RuntimeOnlyInstallTarget} that carries only the runtime + directory the runner skips
912
+ * Minecraft/loader-specific stages because they have no actions in this plan.
680
913
  */
681
- declare function planStandaloneRuntimeInstall(input: PlanStandaloneRuntimeInstallInput): Promise<InstallPlan>;
914
+ declare const planStandaloneRuntimeInstall: (input: PlanStandaloneRuntimeInstallInput) => Promise<InstallPlan>;
682
915
 
683
916
  /** Aspect of an installation a verification result describes. */
684
917
  declare const VerificationKinds: {
@@ -712,7 +945,7 @@ declare const VerifyFileCategories: {
712
945
  /** Verification file category literal. */
713
946
  type VerifyFileCategory = (typeof VerifyFileCategories)[keyof typeof VerifyFileCategories];
714
947
  /** A single verified file. */
715
- interface VerificationFileResult {
948
+ type VerificationFileResult = {
716
949
  readonly path: string;
717
950
  readonly category: VerifyFileCategory;
718
951
  readonly status: VerifyFileStatus;
@@ -722,16 +955,16 @@ interface VerificationFileResult {
722
955
  readonly actualSize?: number;
723
956
  /** Optional URL where the file can be re-downloaded if it's broken. */
724
957
  readonly url?: string;
725
- }
958
+ };
726
959
  /** Aggregate verification result returned by each `verify.<kind>.run` API. */
727
- interface VerificationResult {
960
+ type VerificationResult = {
728
961
  readonly targetId: string;
729
962
  readonly kind: VerificationKind;
730
963
  readonly isValid: boolean;
731
964
  readonly issues: readonly VerificationFileResult[];
732
965
  readonly checkedFiles: number;
733
966
  readonly durationMs: number;
734
- }
967
+ };
735
968
 
736
969
  /** Coarse-grained repair phases used for `repair:phase-changed` events. */
737
970
  declare const RepairPhases: {
@@ -750,33 +983,33 @@ type RepairPhase = (typeof RepairPhases)[keyof typeof RepairPhases];
750
983
  * A repair plan is, structurally, an install plan limited to actions needed to fix the
751
984
  * issues reported by a previous {@link VerificationResult}. The runner is the same.
752
985
  */
753
- interface RepairPlan {
986
+ type RepairPlan = {
754
987
  readonly targetId: string;
755
988
  readonly directory: string;
756
989
  readonly target: Target;
757
990
  readonly actions: readonly InstallAction[];
758
991
  readonly totalBytes: number;
759
992
  readonly totalActions: number;
760
- }
993
+ };
761
994
  /** Repair report — same shape as install report. */
762
- interface RepairReport {
995
+ type RepairReport = {
763
996
  readonly targetId: string;
764
997
  readonly bytesDownloaded: number;
765
998
  readonly actionsCompleted: number;
766
999
  readonly durationMs: number;
767
- }
1000
+ };
768
1001
  /**
769
1002
  * Inputs accepted by every aspect-specific `planXxxRepair` (`planMinecraftRepair`,
770
1003
  * `planFabricRepair`, `planForgeRepair`, `planRuntimeRepair`). The per-aspect input types
771
1004
  * are aliases over this shape.
772
1005
  */
773
- interface AspectRepairInput {
1006
+ type AspectRepairInput = {
774
1007
  readonly target: Target;
775
1008
  readonly from: VerificationResult | readonly VerificationResult[];
776
1009
  readonly http: HttpClient;
777
1010
  readonly cache: MetadataCache;
778
1011
  readonly signal?: AbortSignal;
779
- }
1012
+ };
780
1013
 
781
1014
  /**
782
1015
  * Stable string constants for the `type` discriminator of every {@link ProgressEvent}.
@@ -808,16 +1041,16 @@ declare const EventTypes: {
808
1041
  /** Literal type of the `type` discriminator of a {@link ProgressEvent}. */
809
1042
  type EventType = (typeof EventTypes)[keyof typeof EventTypes];
810
1043
  /** Reference to a single file used in download events. */
811
- interface FileRef {
1044
+ type FileRef = {
812
1045
  readonly url: string;
813
1046
  readonly target: string;
814
1047
  readonly category?: string;
815
- }
1048
+ };
816
1049
  /** A single processor description used in Forge events. */
817
- interface ProcessorRef {
1050
+ type ProcessorRef = {
818
1051
  readonly index: number;
819
1052
  readonly mainClass: string;
820
- }
1053
+ };
821
1054
  /**
822
1055
  * Discriminated union of all runtime progress events. Pass an `onEvent` callback to
823
1056
  * `install.run`, `update.run`, `verify.run`, `repair.run`, or `launch.run` to receive these.
@@ -912,17 +1145,17 @@ type ProgressEvent = {
912
1145
  /** Listener signature accepted by every long-running operation. */
913
1146
  type ProgressListener = (event: ProgressEvent) => void;
914
1147
  /** Common options accepted by long-running operations. */
915
- interface OperationOptions {
1148
+ type OperationOptions = {
916
1149
  readonly signal?: AbortSignal;
917
1150
  readonly onEvent?: ProgressListener;
918
- }
1151
+ };
919
1152
 
920
1153
  /** Stream-of-text channel exposed by spawned processes. */
921
- interface ProcessStream {
1154
+ type ProcessStream = {
922
1155
  on(event: "data", listener: (chunk: string) => void): void;
923
- }
1156
+ };
924
1157
  /** Live handle for a child process. */
925
- interface SpawnedProcess {
1158
+ type SpawnedProcess = {
926
1159
  readonly pid: number;
927
1160
  readonly stdout: ProcessStream;
928
1161
  readonly stderr: ProcessStream;
@@ -933,71 +1166,57 @@ interface SpawnedProcess {
933
1166
  }>;
934
1167
  /** Send a termination signal. Returns true on success. */
935
1168
  kill(signal?: NodeJS.Signals): boolean;
936
- }
1169
+ };
937
1170
  /** Options accepted by the spawner. */
938
- interface SpawnOptions {
1171
+ type SpawnOptions = {
939
1172
  readonly cwd: string;
940
1173
  readonly env?: Readonly<Record<string, string>>;
941
- }
1174
+ };
942
1175
  /**
943
1176
  * Pluggable process spawner. The default implementation uses `node:child_process`; tests
944
1177
  * inject a fake to avoid spawning real processes.
945
1178
  */
946
- interface Spawner {
1179
+ type Spawner = {
947
1180
  spawn(command: string, args: readonly string[], options: SpawnOptions): SpawnedProcess;
948
- }
1181
+ };
949
1182
 
950
- interface RepairAllInput {
1183
+ type RepairAllInput = {
951
1184
  readonly target: Target;
952
1185
  readonly http: HttpClient;
953
1186
  readonly cache: MetadataCache;
954
1187
  readonly spawner: Spawner;
955
1188
  readonly signal?: AbortSignal;
956
1189
  readonly onEvent?: ProgressListener;
957
- }
958
- interface RepairAllReport {
1190
+ };
1191
+ type RepairAllReport = {
959
1192
  readonly verifications: readonly VerificationResult[];
960
1193
  /** Present only for aspects that actually needed work. */
961
1194
  readonly repairs: ReadonlyMap<VerificationKind, RepairReport>;
962
1195
  readonly bytesDownloaded: number;
963
1196
  readonly durationMs: number;
964
- }
965
- /** Verify every applicable aspect and repair each broken one. */
966
- declare function repairAll(input: RepairAllInput): Promise<RepairAllReport>;
967
-
968
- /** Log levels accepted by the pluggable logger. */
969
- declare const LogLevels: {
970
- readonly DEBUG: "debug";
971
- readonly INFO: "info";
972
- readonly WARN: "warn";
973
- readonly ERROR: "error";
974
1197
  };
975
- /** Log-level literal. */
976
- type LogLevel = (typeof LogLevels)[keyof typeof LogLevels];
977
- /** Pluggable logger. Default implementation is a silent logger; pass your own to surface logs. */
978
- interface Logger {
979
- log(level: LogLevel, message: string, fields?: Readonly<Record<string, unknown>>): void;
980
- }
1198
+ /** Verify every applicable aspect and repair each broken one. */
1199
+ declare const repairAll: (input: RepairAllInput) => Promise<RepairAllReport>;
981
1200
 
982
1201
  /** Shared context passed to every resolver. */
983
- interface ResolverContext {
1202
+ type ResolverContext = {
984
1203
  readonly http: HttpClient;
985
1204
  readonly cache: MetadataCache;
986
1205
  readonly logger: Logger;
987
- }
1206
+ };
988
1207
 
989
1208
  /** Inputs to {@link FabricVersionsApi.list}. */
990
- interface FabricListInput {
1209
+ type FabricListInput = {
991
1210
  readonly minecraftVersion?: string;
992
1211
  readonly signal?: AbortSignal;
993
- }
1212
+ };
994
1213
  /** Inputs to {@link FabricVersionsApi.resolve}. */
995
- interface FabricResolveInput {
1214
+ type FabricResolveInput = {
996
1215
  readonly minecraftVersion: string;
997
1216
  readonly preference?: VersionPreferenceKind;
998
1217
  readonly loaderVersion?: string;
999
1218
  readonly signal?: AbortSignal;
1000
- }
1219
+ };
1001
1220
  /** Public Fabric versions API surface. */
1002
1221
  declare class FabricVersionsApi {
1003
1222
  private readonly ctx;
@@ -1009,17 +1228,17 @@ declare class FabricVersionsApi {
1009
1228
  }
1010
1229
 
1011
1230
  /** Inputs to {@link ForgeVersionsApi.list}. */
1012
- interface ForgeListInput {
1231
+ type ForgeListInput = {
1013
1232
  readonly minecraftVersion?: string;
1014
1233
  readonly signal?: AbortSignal;
1015
- }
1234
+ };
1016
1235
  /** Inputs to {@link ForgeVersionsApi.resolve}. */
1017
- interface ForgeResolveInput {
1236
+ type ForgeResolveInput = {
1018
1237
  readonly minecraftVersion: string;
1019
1238
  readonly preference?: VersionPreferenceKind;
1020
1239
  readonly forgeVersion?: string;
1021
1240
  readonly signal?: AbortSignal;
1022
- }
1241
+ };
1023
1242
  /** Public Forge versions API surface. */
1024
1243
  declare class ForgeVersionsApi {
1025
1244
  private readonly ctx;
@@ -1031,20 +1250,20 @@ declare class ForgeVersionsApi {
1031
1250
  }
1032
1251
 
1033
1252
  /** Inputs to {@link MinecraftVersionsApi.list}. */
1034
- interface MinecraftListInput {
1253
+ type MinecraftListInput = {
1035
1254
  readonly channel?: MinecraftChannel;
1036
1255
  readonly signal?: AbortSignal;
1037
- }
1256
+ };
1038
1257
  /** Inputs to {@link MinecraftVersionsApi.latest}. */
1039
- interface MinecraftLatestInput {
1258
+ type MinecraftLatestInput = {
1040
1259
  readonly channel?: MinecraftChannel;
1041
1260
  readonly signal?: AbortSignal;
1042
- }
1261
+ };
1043
1262
  /** Inputs to {@link MinecraftVersionsApi.get} / `.resolve`. */
1044
- interface MinecraftGetInput {
1263
+ type MinecraftGetInput = {
1045
1264
  readonly version: string;
1046
1265
  readonly signal?: AbortSignal;
1047
- }
1266
+ };
1048
1267
  /** Public Minecraft versions API surface. */
1049
1268
  declare class MinecraftVersionsApi {
1050
1269
  private readonly ctx;
@@ -1061,27 +1280,27 @@ declare class MinecraftVersionsApi {
1061
1280
  }
1062
1281
 
1063
1282
  /** Inputs to {@link RuntimeVersionsApi.list}. */
1064
- interface RuntimeListInput {
1283
+ type RuntimeListInput = {
1065
1284
  readonly system: RuntimeSystem;
1066
1285
  readonly minecraftVersion?: string;
1067
1286
  readonly signal?: AbortSignal;
1068
- }
1287
+ };
1069
1288
  /** A summary entry for the list API. */
1070
- interface RuntimeListEntry {
1289
+ type RuntimeListEntry = {
1071
1290
  readonly component: string;
1072
1291
  readonly platformKey: string;
1073
1292
  readonly versionName: string;
1074
1293
  readonly released: string;
1075
1294
  readonly manifestUrl: string;
1076
- }
1295
+ };
1077
1296
  /** Inputs to {@link RuntimeVersionsApi.resolve}. */
1078
- interface RuntimeResolveInput {
1297
+ type RuntimeResolveInput = {
1079
1298
  readonly system: RuntimeSystem;
1080
1299
  readonly minecraftVersion?: string;
1081
1300
  readonly component?: string;
1082
1301
  readonly preference?: RuntimePreferenceKind;
1083
1302
  readonly signal?: AbortSignal;
1084
- }
1303
+ };
1085
1304
  /** Public runtime versions API surface. */
1086
1305
  declare class RuntimeVersionsApi {
1087
1306
  private readonly ctx;
@@ -1093,10 +1312,10 @@ declare class RuntimeVersionsApi {
1093
1312
  private fetchIndex;
1094
1313
  }
1095
1314
  /** Parse the leading integer from a runtime versionName (`"21.0.8"` → 21). */
1096
- declare function parseMajorVersion(versionName: string): number | undefined;
1315
+ declare const parseMajorVersion: (versionName: string) => number | undefined;
1097
1316
 
1098
1317
  /** Inputs to {@link TargetsApi.resolve}. */
1099
- interface TargetResolveInput {
1318
+ type TargetResolveInput = {
1100
1319
  readonly id: string;
1101
1320
  readonly directory: string;
1102
1321
  readonly minecraft: {
@@ -1115,7 +1334,7 @@ interface TargetResolveInput {
1115
1334
  };
1116
1335
  readonly system?: RuntimeSystem;
1117
1336
  readonly signal?: AbortSignal;
1118
- }
1337
+ };
1119
1338
  /** Loader input variants. */
1120
1339
  type TargetLoaderInput = {
1121
1340
  readonly type: typeof Loaders.VANILLA;
@@ -1129,17 +1348,17 @@ type TargetLoaderInput = {
1129
1348
  readonly version?: string;
1130
1349
  };
1131
1350
  /** Inputs to {@link TargetsApi.list}. */
1132
- interface TargetListInput {
1351
+ type TargetListInput = {
1133
1352
  readonly rootDir: string;
1134
- }
1353
+ };
1135
1354
  /** Constructor inputs for {@link TargetsApi}. */
1136
- interface TargetsApiContext {
1355
+ type TargetsApiContext = {
1137
1356
  readonly minecraft: MinecraftVersionsApi;
1138
1357
  readonly fabric: FabricVersionsApi;
1139
1358
  readonly forge: ForgeVersionsApi;
1140
1359
  readonly runtime: RuntimeVersionsApi;
1141
1360
  readonly system: RuntimeSystem;
1142
- }
1361
+ };
1143
1362
  /** Public Targets API surface. */
1144
1363
  declare class TargetsApi {
1145
1364
  private readonly ctx;
@@ -1154,47 +1373,18 @@ declare class TargetsApi {
1154
1373
  list(input: TargetListInput): Promise<readonly DiscoveredTarget[]>;
1155
1374
  }
1156
1375
 
1157
- /** Authentication modes accepted by the launch composer. */
1158
- declare const AuthModes: {
1159
- /** Offline-mode play with a chosen username and synthetic UUID. */
1160
- readonly OFFLINE: "offline";
1161
- /** Pre-authenticated session — caller provides the access token and identity. */
1162
- readonly ONLINE: "online";
1163
- };
1164
- /** Auth mode literal. */
1165
- type AuthMode = (typeof AuthModes)[keyof typeof AuthModes];
1166
- /** Offline authentication. */
1167
- interface OfflineAuth {
1168
- readonly mode: typeof AuthModes.OFFLINE;
1169
- readonly username: string;
1170
- /** Optional explicit UUID. When omitted, a deterministic UUID is derived from the username. */
1171
- readonly uuid?: string;
1172
- }
1173
- /** Online (token-based) authentication. */
1174
- interface OnlineAuth {
1175
- readonly mode: typeof AuthModes.ONLINE;
1176
- readonly username: string;
1177
- readonly uuid: string;
1178
- readonly accessToken: string;
1179
- readonly userType?: string;
1180
- readonly clientId?: string;
1181
- readonly xuid?: string;
1182
- }
1183
- /** Auth shape consumed by `kit.launch.compose`. */
1184
- type LaunchAuth = OfflineAuth | OnlineAuth;
1185
-
1186
1376
  /** Optional memory configuration. */
1187
- interface LaunchMemoryOptions {
1377
+ type LaunchMemoryOptions = {
1188
1378
  readonly minMb?: number;
1189
1379
  readonly maxMb?: number;
1190
- }
1380
+ };
1191
1381
  /** Optional resolution / window configuration. */
1192
- interface LaunchResolutionOptions {
1382
+ type LaunchResolutionOptions = {
1193
1383
  readonly width: number;
1194
1384
  readonly height: number;
1195
- }
1385
+ };
1196
1386
  /** Inputs for `kit.launch.compose` (and the lower-level `composeLaunch` helper). */
1197
- interface LaunchOptions {
1387
+ type LaunchOptions = {
1198
1388
  readonly auth: LaunchAuth;
1199
1389
  readonly memory?: LaunchMemoryOptions;
1200
1390
  readonly resolution?: LaunchResolutionOptions;
@@ -1209,9 +1399,9 @@ interface LaunchOptions {
1209
1399
  readonly extraGameArgs?: readonly string[];
1210
1400
  /** Set of feature flags evaluated by argument rules (e.g. `is_demo_user`). */
1211
1401
  readonly features?: Readonly<Record<string, boolean>>;
1212
- }
1402
+ };
1213
1403
  /** Fully composed launch command, ready to be passed to `kit.launch.run`. */
1214
- interface LaunchComposition {
1404
+ type LaunchComposition = {
1215
1405
  readonly targetId: string;
1216
1406
  readonly directory: string;
1217
1407
  readonly javaPath: string;
@@ -1225,57 +1415,57 @@ interface LaunchComposition {
1225
1415
  readonly workingDirectory: string;
1226
1416
  /** Environment variables to set on the spawned process. */
1227
1417
  readonly env?: Readonly<Record<string, string>>;
1228
- }
1418
+ };
1229
1419
  /** Live handle for a running game process. */
1230
- interface LaunchSession {
1420
+ type LaunchSession = {
1231
1421
  /** Operating-system process id. */
1232
1422
  readonly pid: number;
1233
1423
  /** Resolves with the exit code/signal when the process terminates. */
1234
1424
  readonly exited: Promise<LaunchExit>;
1235
1425
  /** Best-effort cancel — sends SIGTERM, then SIGKILL after the grace period. */
1236
1426
  abort(reason?: string): void;
1237
- }
1427
+ };
1238
1428
  /** Outcome of a finished launch. */
1239
- interface LaunchExit {
1429
+ type LaunchExit = {
1240
1430
  readonly code: number | null;
1241
1431
  readonly signal: NodeJS.Signals | null;
1242
1432
  readonly aborted: boolean;
1243
- }
1433
+ };
1244
1434
  /** Options for `kit.launch.run` (and the lower-level `runLaunch` helper). */
1245
- interface LaunchRunOptions {
1435
+ type LaunchRunOptions = {
1246
1436
  readonly signal?: AbortSignal;
1247
1437
  readonly onEvent?: (event: ProgressEvent) => void;
1248
1438
  /** Milliseconds to wait between SIGTERM and SIGKILL when aborting. */
1249
1439
  readonly killGracePeriodMs?: number;
1250
- }
1440
+ };
1251
1441
 
1252
1442
  /** Update plan — additive list of actions to bring an installation up to date. */
1253
- interface UpdatePlan {
1443
+ type UpdatePlan = {
1254
1444
  readonly targetId: string;
1255
1445
  readonly directory: string;
1256
- readonly target: Target;
1446
+ readonly target: InstallPlanTarget;
1257
1447
  readonly actions: readonly InstallAction[];
1258
1448
  readonly totalBytes: number;
1259
1449
  readonly totalActions: number;
1260
- }
1450
+ };
1261
1451
  /** Update report. */
1262
- interface UpdateReport {
1452
+ type UpdateReport = {
1263
1453
  readonly targetId: string;
1264
1454
  readonly bytesDownloaded: number;
1265
1455
  readonly actionsCompleted: number;
1266
1456
  /** Actions that found their target already correct on disk and were skipped. */
1267
1457
  readonly actionsSkipped: number;
1268
1458
  readonly durationMs: number;
1269
- }
1459
+ };
1270
1460
 
1271
1461
  /** Constructor options for {@link MinecraftKit}. */
1272
- interface MinecraftKitOptions {
1462
+ type MinecraftKitOptions = {
1273
1463
  readonly httpClient?: HttpClient;
1274
1464
  readonly cache?: MetadataCache;
1275
1465
  readonly logger?: Logger;
1276
1466
  readonly system?: RuntimeSystem;
1277
1467
  readonly spawner?: Spawner;
1278
- }
1468
+ };
1279
1469
  /**
1280
1470
  * Single facade for the entire library.
1281
1471
  *
@@ -1348,6 +1538,12 @@ declare class MinecraftKit {
1348
1538
  compose(target: Target, options: LaunchOptions): Promise<LaunchComposition>;
1349
1539
  run(composition: LaunchComposition, options?: LaunchRunOptions): LaunchSession;
1350
1540
  };
1541
+ /**
1542
+ * Microsoft / Mojang authentication. Implements the device-code flow against Microsoft
1543
+ * Entra, exchanges the resulting tokens for an XSTS + Minecraft session, and returns
1544
+ * everything needed to compose an `OnlineAuth` for `launch.compose`.
1545
+ */
1546
+ readonly auth: MojangAuthApi;
1351
1547
  /** Cache surface useful for advanced consumers (e.g. clearing between operations). */
1352
1548
  readonly cache: MetadataCache;
1353
1549
  constructor(options?: MinecraftKitOptions);
@@ -1358,158 +1554,223 @@ interface InstallRunOptions extends OperationOptions {
1358
1554
  readonly actionCategories?: ReadonlySet<DownloadAction["category"]>;
1359
1555
  }
1360
1556
  /** Options accepted by every `verify.<kind>.run`. */
1361
- interface VerifyOperationOptions {
1557
+ type VerifyOperationOptions = {
1362
1558
  readonly signal?: AbortSignal;
1363
1559
  readonly onEvent?: ProgressListener;
1364
- }
1560
+ };
1365
1561
  /** Options for any `repair.<aspect>.plan` call. Accepts one or many verification results. */
1366
- interface RepairPlanOptions {
1562
+ type RepairPlanOptions = {
1367
1563
  readonly from: VerificationResult | readonly VerificationResult[];
1368
1564
  readonly signal?: AbortSignal;
1369
- }
1565
+ };
1370
1566
  /** Shared shape of every aspect-specific repair surface (`repair.minecraft`, `.fabric`, …). */
1371
- interface RepairAspect {
1567
+ type RepairAspect = {
1372
1568
  plan(target: Target, options: RepairPlanOptions): Promise<RepairPlan>;
1373
1569
  run(plan: RepairPlan, options?: OperationOptions): Promise<RepairReport>;
1374
- }
1570
+ };
1375
1571
 
1376
- /** Result of resolving the on-disk version JSON for a target. */
1377
- interface ResolvedLaunchVersion {
1378
- /** Topmost version id (the one used as `${version_name}` and for the natives directory). */
1379
- readonly versionId: string;
1380
- /** Merged manifest with `inheritsFrom` chain folded together. */
1381
- readonly merged: MinecraftVersionManifest;
1382
- /** Inherits-from chain from top (`versionId`) down to the root vanilla version. */
1383
- readonly chain: readonly string[];
1384
- }
1385
- /** Read the installed version JSON appropriate for a target's loader and merge inheritsFrom. */
1386
- declare function resolveLaunchVersion(target: Target): Promise<ResolvedLaunchVersion>;
1387
1572
  /**
1388
- * Pick the version id whose `versions/<id>/<id>.jar` should land on the launch classpath.
1389
- * Walks the inherits-from chain from top to root and returns the first id whose jar exists
1390
- * on disk. Falls back to the root id when nothing is materialised yet.
1573
+ * Stable error code registry. `MinecraftKitError` carries one of these as `code`; consumers
1574
+ * can switch on it exhaustively via the derived {@link MinecraftKitErrorCode} union.
1391
1575
  *
1392
- * Why: Fabric's profile id is `fabric-loader-0.14.21-1.20.1`, but Fabric does not produce a
1393
- * matching `.jar`; the loader expects the **vanilla** client jar on the classpath and hooks
1394
- * it via `KnotClient`. Modern Forge similarly leaves `versions/<forge-id>/<forge-id>.jar`
1395
- * absent and routes the patched client jar through `libraries/`. Walking the chain picks
1396
- * the right id for both shapes without special-casing.
1576
+ * Codes are stable across releases adding new codes is non-breaking; removing or renaming
1577
+ * a code is a breaking change.
1397
1578
  */
1398
- declare function pickClientJarVersionId(directory: string, chain: readonly string[]): Promise<string>;
1399
-
1400
- /** Helpers for the per-target directory layout. */
1401
- declare const targetPaths: {
1402
- readonly versionsDir: (root: string) => string;
1403
- readonly versionDir: (root: string, versionId: string) => string;
1404
- readonly versionJar: (root: string, versionId: string) => string;
1405
- readonly versionJson: (root: string, versionId: string) => string;
1406
- readonly librariesDir: (root: string) => string;
1407
- readonly libraryFile: (root: string, libraryPath: string) => string;
1408
- readonly assetIndex: (root: string, indexId: string) => string;
1409
- readonly assetObject: (root: string, hash: string) => string;
1410
- readonly assetVirtual: (root: string, virtualPath: string) => string;
1411
- readonly assetLegacy: (root: string, virtualPath: string) => string;
1412
- readonly assetResource: (root: string, virtualPath: string) => string;
1413
- readonly loggingConfig: (root: string, id: string) => string;
1414
- readonly nativesDir: (root: string, versionId: string) => string;
1415
- /**
1416
- * Path to a runtime component's root directory. Honours `installRoot` (custom global
1417
- * runtime location) when present; otherwise falls back to `<directory>/runtime/<component>`.
1418
- */
1419
- readonly runtimeRoot: (directory: string, component: string, installRoot?: string) => string;
1420
- readonly runtimeJavaExecutable: (directory: string, component: string, os: OperatingSystem, installRoot?: string) => string;
1421
- readonly forgeInstaller: (root: string, mavenVersion: string) => string;
1579
+ declare const MinecraftKitErrorCodes: {
1580
+ readonly NETWORK_TIMEOUT: "NETWORK_TIMEOUT";
1581
+ readonly NETWORK_HTTP_ERROR: "NETWORK_HTTP_ERROR";
1582
+ readonly NETWORK_ABORTED: "NETWORK_ABORTED";
1583
+ readonly INTEGRITY_HASH_MISMATCH: "INTEGRITY_HASH_MISMATCH";
1584
+ readonly INTEGRITY_SIZE_MISMATCH: "INTEGRITY_SIZE_MISMATCH";
1585
+ readonly MANIFEST_INVALID: "MANIFEST_INVALID";
1586
+ readonly MANIFEST_NOT_FOUND: "MANIFEST_NOT_FOUND";
1587
+ readonly METADATA_PARSE_ERROR: "METADATA_PARSE_ERROR";
1588
+ readonly FILESYSTEM_PATH_TRAVERSAL: "FILESYSTEM_PATH_TRAVERSAL";
1589
+ readonly FILESYSTEM_WRITE_ERROR: "FILESYSTEM_WRITE_ERROR";
1590
+ readonly FILESYSTEM_READ_ERROR: "FILESYSTEM_READ_ERROR";
1591
+ readonly ARCHIVE_INVALID: "ARCHIVE_INVALID";
1592
+ readonly ARCHIVE_TOO_LARGE: "ARCHIVE_TOO_LARGE";
1593
+ readonly ARCHIVE_ENTRY_REJECTED: "ARCHIVE_ENTRY_REJECTED";
1594
+ readonly RUNTIME_NOT_FOUND: "RUNTIME_NOT_FOUND";
1595
+ readonly RUNTIME_UNSUPPORTED_PLATFORM: "RUNTIME_UNSUPPORTED_PLATFORM";
1596
+ readonly FORGE_PROCESSOR_FAILED: "FORGE_PROCESSOR_FAILED";
1597
+ readonly FORGE_INSTALLER_INVALID: "FORGE_INSTALLER_INVALID";
1598
+ readonly LAUNCH_JAVA_NOT_FOUND: "LAUNCH_JAVA_NOT_FOUND";
1599
+ readonly LAUNCH_PROCESS_FAILED: "LAUNCH_PROCESS_FAILED";
1600
+ readonly LAUNCH_ABORTED: "LAUNCH_ABORTED";
1601
+ readonly VERIFICATION_FAILED: "VERIFICATION_FAILED";
1602
+ readonly INVALID_INPUT: "INVALID_INPUT";
1603
+ readonly NOT_IMPLEMENTED: "NOT_IMPLEMENTED";
1604
+ readonly UNSUPPORTED_VERSION: "UNSUPPORTED_VERSION";
1605
+ readonly LZMA_DECODE_ERROR: "LZMA_DECODE_ERROR";
1606
+ readonly AUTH_DEVICE_CODE_EXPIRED: "AUTH_DEVICE_CODE_EXPIRED";
1607
+ readonly AUTH_DEVICE_CODE_DECLINED: "AUTH_DEVICE_CODE_DECLINED";
1608
+ readonly AUTH_DEVICE_CODE_FAILED: "AUTH_DEVICE_CODE_FAILED";
1609
+ readonly AUTH_REFRESH_FAILED: "AUTH_REFRESH_FAILED";
1610
+ readonly AUTH_XBOX_FAILED: "AUTH_XBOX_FAILED";
1611
+ readonly AUTH_XSTS_FAILED: "AUTH_XSTS_FAILED";
1612
+ readonly AUTH_MINECRAFT_FAILED: "AUTH_MINECRAFT_FAILED";
1613
+ readonly AUTH_NO_GAME_OWNERSHIP: "AUTH_NO_GAME_OWNERSHIP";
1614
+ readonly AUTH_MISSING_CLIENT_ID: "AUTH_MISSING_CLIENT_ID";
1615
+ readonly AUTH_CANCELLED: "AUTH_CANCELLED";
1616
+ };
1617
+ /** Union of all kit error codes. */
1618
+ type MinecraftKitErrorCode = (typeof MinecraftKitErrorCodes)[keyof typeof MinecraftKitErrorCodes];
1619
+ /** Structured context attached to errors. */
1620
+ type MinecraftKitErrorContext = {
1621
+ readonly url?: string;
1622
+ readonly filePath?: string;
1623
+ readonly expectedHash?: string;
1624
+ readonly actualHash?: string;
1625
+ readonly expectedSize?: number;
1626
+ readonly actualSize?: number;
1627
+ readonly httpStatus?: number;
1628
+ readonly exitCode?: number;
1629
+ readonly platform?: string;
1630
+ readonly version?: string;
1631
+ readonly [key: string]: unknown;
1422
1632
  };
1423
1633
 
1424
- /** Inputs to {@link createMemoryCache}. */
1425
- interface MemoryCacheOptions {
1426
- readonly maxEntries?: number;
1427
- readonly ttlMs?: number;
1634
+ /**
1635
+ * The single error class thrown by every public API in `@loontail/minecraft-kit`.
1636
+ *
1637
+ * Use {@link isMinecraftKitError} or {@link isErrorCode} for type-narrowing in `catch` blocks.
1638
+ */
1639
+ declare class MinecraftKitError extends Error {
1640
+ readonly name = "MinecraftKitError";
1641
+ /** Stable discriminator. */
1642
+ readonly code: MinecraftKitErrorCode;
1643
+ /** Structured context; safe to serialize. */
1644
+ readonly context: Readonly<MinecraftKitErrorContext>;
1645
+ constructor(code: MinecraftKitErrorCode, message: string, options?: {
1646
+ cause?: unknown;
1647
+ context?: MinecraftKitErrorContext;
1648
+ });
1649
+ /** JSON-friendly representation. */
1650
+ toJSON(): Record<string, unknown>;
1428
1651
  }
1429
- /** In-memory metadata cache backed by `lru-cache`. */
1430
- declare function createMemoryCache(options?: MemoryCacheOptions): MetadataCache;
1652
+ /** True when `e` is an {@link MinecraftKitError}. */
1653
+ declare const isMinecraftKitError: (e: unknown) => e is MinecraftKitError;
1654
+ /** True when `e` is an {@link MinecraftKitError} carrying the given code. */
1655
+ declare const isErrorCode: <C extends MinecraftKitErrorCode>(e: unknown, code: C) => e is MinecraftKitError & {
1656
+ code: C;
1657
+ };
1431
1658
 
1432
- /** Inputs allowing the host system to be derived from current Node values or overrides. */
1433
- interface DetectSystemInput {
1434
- readonly platform?: NodeJS.Platform;
1435
- readonly arch?: NodeJS.Architecture;
1436
- readonly osVersion?: string;
1437
- }
1438
1659
  /**
1439
- * Resolve the current host system identifiers.
1660
+ * Exhaustiveness sentinel for discriminated unions. Drop into the `default` of a switch on
1661
+ * `kind` / `type` / `status` so the compiler errors when a new variant is added but the
1662
+ * switch is not updated.
1440
1663
  *
1441
- * @throws {@link MinecraftKitError} with code `RUNTIME_UNSUPPORTED_PLATFORM` when the
1442
- * platform/arch combination is not understood.
1664
+ * ```ts
1665
+ * switch (action.kind) {
1666
+ * case "download-file": return ...;
1667
+ * case "write-version-json": return ...;
1668
+ * default: return assertNever(action);
1669
+ * }
1670
+ * ```
1443
1671
  */
1444
- declare function detectSystem(input?: DetectSystemInput): RuntimeSystem;
1672
+ declare const assertNever: (value: never) => never;
1673
+
1674
+ /** UI-oriented coarse progress stages, identical across install and repair flows. */
1675
+ declare const InstallStages: {
1676
+ readonly PREPARE: "prepare";
1677
+ readonly RUNTIME: "runtime";
1678
+ readonly MINECRAFT: "minecraft";
1679
+ readonly LOADER: "loader";
1680
+ readonly FINALIZE: "finalize";
1681
+ };
1682
+ type InstallStage = (typeof InstallStages)[keyof typeof InstallStages];
1683
+ type ProgressSnapshot = {
1684
+ readonly stage: InstallStage;
1685
+ readonly stagePercent: number;
1686
+ readonly overallPercent: number;
1687
+ readonly bytesDownloaded: number;
1688
+ readonly totalBytes: number;
1689
+ readonly currentFile?: string;
1690
+ };
1691
+ type ProgressTrackerOptions = {
1692
+ /** Milliseconds between snapshot pushes. Defaults to 100ms. */
1693
+ readonly throttleMs?: number;
1694
+ };
1695
+ type InstallProgressTracker = {
1696
+ /** Pass directly as the `onEvent` callback to `install.run` / `repair.run`. */
1697
+ readonly onEvent: ProgressListener;
1698
+ snapshot(): ProgressSnapshot;
1699
+ /** First push fires immediately with the initial snapshot. */
1700
+ subscribe(listener: (snapshot: ProgressSnapshot) => void): () => void;
1701
+ /** Force-emit a final 100% snapshot and stop the throttle timer. */
1702
+ finish(): void;
1703
+ };
1704
+ /** Aggregate `ProgressEvent`s from one install/repair run into throttled UI snapshots. */
1705
+ declare const createInstallProgressTracker: (plan: Pick<InstallPlan, "actions">, options?: ProgressTrackerOptions) => InstallProgressTracker;
1445
1706
 
1446
1707
  /** Inputs to {@link verifyMinecraft}. */
1447
- interface VerifyMinecraftInput {
1708
+ type VerifyMinecraftInput = {
1448
1709
  readonly target: Target;
1449
1710
  readonly http: HttpClient;
1450
1711
  readonly cache: MetadataCache;
1451
1712
  readonly signal?: AbortSignal;
1452
1713
  readonly onEvent?: ProgressListener;
1453
- }
1714
+ };
1454
1715
  /**
1455
1716
  * Verify the vanilla Minecraft slice of an installation: the client jar, version JSON,
1456
1717
  * libraries (incl. native jars), assets (index + objects), logging config, and the
1457
1718
  * extracted natives directory.
1458
1719
  */
1459
- declare function verifyMinecraft(input: VerifyMinecraftInput): Promise<VerificationResult>;
1720
+ declare const verifyMinecraft: (input: VerifyMinecraftInput) => Promise<VerificationResult>;
1460
1721
 
1461
1722
  /** Inputs to {@link verifyFabric}. */
1462
- interface VerifyFabricInput {
1723
+ type VerifyFabricInput = {
1463
1724
  readonly target: Target;
1464
1725
  readonly http: HttpClient;
1465
1726
  readonly cache: MetadataCache;
1466
1727
  readonly signal?: AbortSignal;
1467
1728
  readonly onEvent?: ProgressListener;
1468
- }
1729
+ };
1469
1730
  /** Verify the Fabric loader slice: profile JSON + every library it pulls in. */
1470
- declare function verifyFabric(input: VerifyFabricInput): Promise<VerificationResult>;
1731
+ declare const verifyFabric: (input: VerifyFabricInput) => Promise<VerificationResult>;
1471
1732
 
1472
1733
  /** Inputs to {@link verifyForge}. */
1473
- interface VerifyForgeInput {
1734
+ type VerifyForgeInput = {
1474
1735
  readonly target: Target;
1475
1736
  readonly http: HttpClient;
1476
1737
  readonly cache: MetadataCache;
1477
1738
  readonly signal?: AbortSignal;
1478
1739
  readonly onEvent?: ProgressListener;
1479
- }
1740
+ };
1480
1741
  /**
1481
1742
  * Verify the Forge loader slice: the on-disk Forge version JSON and every library it
1482
1743
  * declares. Libraries can only be enumerated once the JSON is present *and parsable*; a
1483
1744
  * malformed JSON is surfaced as a CORRUPT issue so repair rewrites it before re-running.
1484
1745
  */
1485
- declare function verifyForge(input: VerifyForgeInput): Promise<VerificationResult>;
1746
+ declare const verifyForge: (input: VerifyForgeInput) => Promise<VerificationResult>;
1486
1747
 
1487
1748
  /** Inputs to {@link verifyRuntime}. */
1488
- interface VerifyRuntimeInput {
1749
+ type VerifyRuntimeInput = {
1489
1750
  readonly target: Target;
1490
1751
  readonly http: HttpClient;
1491
1752
  readonly cache: MetadataCache;
1492
1753
  readonly signal?: AbortSignal;
1493
1754
  readonly onEvent?: ProgressListener;
1494
- }
1755
+ };
1495
1756
  /**
1496
1757
  * Verify the Java runtime files. Honours `target.runtime.installRoot` when set so a
1497
1758
  * shared/global runtime install is checked at its real location instead of the per-target
1498
1759
  * `runtime/` subfolder.
1499
1760
  */
1500
- declare function verifyRuntime(input: VerifyRuntimeInput): Promise<VerificationResult>;
1761
+ declare const verifyRuntime: (input: VerifyRuntimeInput) => Promise<VerificationResult>;
1501
1762
 
1502
1763
  /** Inputs to {@link runRepair}. Shared across all aspect-specific repair flows. */
1503
- interface RunRepairInput {
1764
+ type RunRepairInput = {
1504
1765
  readonly plan: RepairPlan;
1505
1766
  readonly http: HttpClient;
1506
1767
  readonly cache: MetadataCache;
1507
1768
  readonly spawner: Spawner;
1508
1769
  readonly signal?: AbortSignal;
1509
1770
  readonly onEvent?: ProgressListener;
1510
- }
1771
+ };
1511
1772
  /** Execute any repair plan. Reuses the install runner. */
1512
- declare function runRepair(input: RunRepairInput): Promise<RepairReport>;
1773
+ declare const runRepair: (input: RunRepairInput) => Promise<RepairReport>;
1513
1774
 
1514
1775
  /** Inputs to {@link planMinecraftRepair}. */
1515
1776
  type PlanMinecraftRepairInput = AspectRepairInput;
@@ -1517,12 +1778,12 @@ type PlanMinecraftRepairInput = AspectRepairInput;
1517
1778
  * Build a repair plan covering only the vanilla Minecraft slice: client jar, version JSON,
1518
1779
  * libraries (incl. native jars), assets, logging config, and native extractions.
1519
1780
  */
1520
- declare function planMinecraftRepair(input: PlanMinecraftRepairInput): Promise<RepairPlan>;
1781
+ declare const planMinecraftRepair: (input: PlanMinecraftRepairInput) => Promise<RepairPlan>;
1521
1782
 
1522
1783
  /** Inputs to {@link planFabricRepair}. */
1523
1784
  type PlanFabricRepairInput = AspectRepairInput;
1524
1785
  /** Build a repair plan covering the Fabric loader slice: profile JSON + libraries. */
1525
- declare function planFabricRepair(input: PlanFabricRepairInput): Promise<RepairPlan>;
1786
+ declare const planFabricRepair: (input: PlanFabricRepairInput) => Promise<RepairPlan>;
1526
1787
 
1527
1788
  /** Inputs to {@link planForgeRepair}. */
1528
1789
  type PlanForgeRepairInput = AspectRepairInput;
@@ -1532,7 +1793,7 @@ type PlanForgeRepairInput = AspectRepairInput;
1532
1793
  * version JSON was missing during verify (so libraries couldn't be enumerated), every
1533
1794
  * forge-library download is added defensively — `downloadFile` skips files already on disk.
1534
1795
  */
1535
- declare function planForgeRepair(input: PlanForgeRepairInput): Promise<RepairPlan>;
1796
+ declare const planForgeRepair: (input: PlanForgeRepairInput) => Promise<RepairPlan>;
1536
1797
 
1537
1798
  /** Inputs to {@link planRuntimeRepair}. */
1538
1799
  type PlanRuntimeRepairInput = AspectRepairInput;
@@ -1541,97 +1802,44 @@ type PlanRuntimeRepairInput = AspectRepairInput;
1541
1802
  * honoured automatically because both `planInstall` and the verify side resolve runtime
1542
1803
  * paths through the same `targetPaths.runtimeRoot(..., installRoot)` helper.
1543
1804
  */
1544
- declare function planRuntimeRepair(input: PlanRuntimeRepairInput): Promise<RepairPlan>;
1805
+ declare const planRuntimeRepair: (input: PlanRuntimeRepairInput) => Promise<RepairPlan>;
1545
1806
 
1546
- /** UI-oriented coarse progress stages, identical across install and repair flows. */
1547
- declare const InstallStages: {
1548
- readonly PREPARE: "prepare";
1549
- readonly RUNTIME: "runtime";
1550
- readonly MINECRAFT: "minecraft";
1551
- readonly LOADER: "loader";
1552
- readonly FINALIZE: "finalize";
1807
+ /** Result of resolving the on-disk version JSON for a target. */
1808
+ type ResolvedLaunchVersion = {
1809
+ /** Topmost version id (the one used as `${version_name}` and for the natives directory). */
1810
+ readonly versionId: string;
1811
+ /** Merged manifest with `inheritsFrom` chain folded together. */
1812
+ readonly merged: MinecraftVersionManifest;
1813
+ /** Inherits-from chain from top (`versionId`) down to the root vanilla version. */
1814
+ readonly chain: readonly string[];
1553
1815
  };
1554
- type InstallStage = (typeof InstallStages)[keyof typeof InstallStages];
1555
- interface ProgressSnapshot {
1556
- readonly stage: InstallStage;
1557
- readonly stagePercent: number;
1558
- readonly overallPercent: number;
1559
- readonly bytesDownloaded: number;
1560
- readonly totalBytes: number;
1561
- readonly currentFile?: string;
1562
- }
1563
- interface ProgressTrackerOptions {
1564
- /** Milliseconds between snapshot pushes. Defaults to 100ms. */
1565
- readonly throttleMs?: number;
1566
- }
1567
- interface InstallProgressTracker {
1568
- /** Pass directly as the `onEvent` callback to `install.run` / `repair.run`. */
1569
- readonly onEvent: ProgressListener;
1570
- snapshot(): ProgressSnapshot;
1571
- /** First push fires immediately with the initial snapshot. */
1572
- subscribe(listener: (snapshot: ProgressSnapshot) => void): () => void;
1573
- /** Force-emit a final 100% snapshot and stop the throttle timer. */
1574
- finish(): void;
1575
- }
1576
- /** Aggregate `ProgressEvent`s from one install/repair run into throttled UI snapshots. */
1577
- declare function createInstallProgressTracker(plan: Pick<InstallPlan, "actions">, options?: ProgressTrackerOptions): InstallProgressTracker;
1578
-
1816
+ /** Read the installed version JSON appropriate for a target's loader and merge inheritsFrom. */
1817
+ declare const resolveLaunchVersion: (target: Target) => Promise<ResolvedLaunchVersion>;
1579
1818
  /**
1580
- * Stable error code discriminator. Consumers can `switch (e.code)` exhaustively.
1819
+ * Pick the version id whose `versions/<id>/<id>.jar` should land on the launch classpath.
1820
+ * Walks the inherits-from chain from top to root and returns the first id whose jar exists
1821
+ * on disk. Falls back to the root id when nothing is materialised yet.
1581
1822
  *
1582
- * Codes are stable across releases adding new codes is non-breaking; removing or renaming
1583
- * a code is a breaking change.
1823
+ * Why: Fabric's profile id is `fabric-loader-0.14.21-1.20.1`, but Fabric does not produce a
1824
+ * matching `.jar`; the loader expects the **vanilla** client jar on the classpath and hooks
1825
+ * it via `KnotClient`. Modern Forge similarly leaves `versions/<forge-id>/<forge-id>.jar`
1826
+ * absent and routes the patched client jar through `libraries/`. Walking the chain picks
1827
+ * the right id for both shapes without special-casing.
1584
1828
  */
1585
- type MinecraftKitErrorCode = "NETWORK_TIMEOUT" | "NETWORK_HTTP_ERROR" | "NETWORK_ABORTED" | "INTEGRITY_HASH_MISMATCH" | "INTEGRITY_SIZE_MISMATCH" | "MANIFEST_INVALID" | "MANIFEST_NOT_FOUND" | "METADATA_PARSE_ERROR" | "FILESYSTEM_PATH_TRAVERSAL" | "FILESYSTEM_WRITE_ERROR" | "FILESYSTEM_READ_ERROR" | "ARCHIVE_INVALID" | "ARCHIVE_TOO_LARGE" | "ARCHIVE_ENTRY_REJECTED" | "RUNTIME_NOT_FOUND" | "RUNTIME_UNSUPPORTED_PLATFORM" | "FORGE_PROCESSOR_FAILED" | "FORGE_INSTALLER_INVALID" | "LAUNCH_JAVA_NOT_FOUND" | "LAUNCH_PROCESS_FAILED" | "LAUNCH_ABORTED" | "VERIFICATION_FAILED" | "INVALID_INPUT" | "NOT_IMPLEMENTED" | "UNSUPPORTED_VERSION" | "LZMA_DECODE_ERROR";
1586
- /** Structured context attached to errors. */
1587
- interface MinecraftKitErrorContext {
1588
- readonly url?: string;
1589
- readonly filePath?: string;
1590
- readonly expectedHash?: string;
1591
- readonly actualHash?: string;
1592
- readonly expectedSize?: number;
1593
- readonly actualSize?: number;
1594
- readonly httpStatus?: number;
1595
- readonly exitCode?: number;
1596
- readonly platform?: string;
1597
- readonly version?: string;
1598
- readonly [key: string]: unknown;
1599
- }
1829
+ declare const pickClientJarVersionId: (directory: string, chain: readonly string[]) => Promise<string>;
1600
1830
 
1601
- /**
1602
- * The single error class thrown by every public API in `@loontail/minecraft-kit`.
1603
- *
1604
- * Use {@link isMinecraftKitError} or {@link isErrorCode} for type-narrowing in `catch` blocks.
1605
- */
1606
- declare class MinecraftKitError extends Error {
1607
- readonly name = "MinecraftKitError";
1608
- /** Stable discriminator. */
1609
- readonly code: MinecraftKitErrorCode;
1610
- /** Structured context; safe to serialize. */
1611
- readonly context: Readonly<MinecraftKitErrorContext>;
1612
- constructor(code: MinecraftKitErrorCode, message: string, options?: {
1613
- cause?: unknown;
1614
- context?: MinecraftKitErrorContext;
1615
- });
1616
- /** JSON-friendly representation. */
1617
- toJSON(): Record<string, unknown>;
1831
+ /** Default spawner backed by `node:child_process.spawn`. */
1832
+ declare class ChildProcessSpawner implements Spawner {
1833
+ spawn(command: string, args: readonly string[], options: SpawnOptions): SpawnedProcess;
1618
1834
  }
1619
- /** True when `e` is an {@link MinecraftKitError}. */
1620
- declare function isMinecraftKitError(e: unknown): e is MinecraftKitError;
1621
- /** True when `e` is an {@link MinecraftKitError} carrying the given code. */
1622
- declare function isErrorCode<C extends MinecraftKitErrorCode>(e: unknown, code: C): e is MinecraftKitError & {
1623
- code: C;
1624
- };
1625
1835
 
1626
- /**
1627
- * Derive a stable v3-style UUID for an offline player username.
1628
- *
1629
- * Mojang's offline-mode formula: `MD5("OfflinePlayer:" + name)` with the version/variant
1630
- * bits patched to UUID v3.
1631
- */
1632
- declare function offlineUuidFor(username: string): string;
1633
- /** Strip the dashes from a UUID. Used by `${auth_uuid}`. */
1634
- declare function stripUuidDashes(uuid: string): string;
1836
+ /** Inputs to {@link createMemoryCache}. */
1837
+ type MemoryCacheOptions = {
1838
+ readonly maxEntries?: number;
1839
+ readonly ttlMs?: number;
1840
+ };
1841
+ /** In-memory metadata cache backed by `lru-cache`. */
1842
+ declare const createMemoryCache: (options?: MemoryCacheOptions) => MetadataCache;
1635
1843
 
1636
1844
  /**
1637
1845
  * Default {@link HttpClient} implementation backed by Node's built-in `fetch` (undici under
@@ -1641,15 +1849,68 @@ declare class FetchHttpClient implements HttpClient {
1641
1849
  request(url: string, options?: HttpRequestOptions): Promise<HttpResponse>;
1642
1850
  }
1643
1851
 
1644
- /** Default spawner backed by `node:child_process.spawn`. */
1645
- declare class ChildProcessSpawner implements Spawner {
1646
- spawn(command: string, args: readonly string[], options: SpawnOptions): SpawnedProcess;
1647
- }
1648
-
1649
1852
  /** Logger that drops every message. Default when no logger is supplied. */
1650
1853
  declare const silentLogger: Logger;
1651
1854
  /** Logger that mirrors messages to `console.<level>` with structured fields. */
1652
1855
  declare const consoleLogger: Logger;
1856
+ /**
1857
+ * Wrap a {@link Logger} so every message is prefixed with `[scope]`. Mirrors the
1858
+ * `scopedLogger(scope)` convention used by the launcher: each module reaches for one named
1859
+ * logger at the top of the file (e.g. `const log = scopedLogger(input.logger, "http")`)
1860
+ * instead of threading the scope through every callsite.
1861
+ *
1862
+ * The merged `fields` argument lets a scope attach default context (e.g. a request id) without
1863
+ * the call site repeating it on every message.
1864
+ */
1865
+ declare const scopedLogger: (base: Logger, scope: string, baseFields?: Readonly<Record<string, unknown>>) => Logger;
1866
+
1867
+ /** Inputs allowing the host system to be derived from current Node values or overrides. */
1868
+ type DetectSystemInput = {
1869
+ readonly platform?: NodeJS.Platform;
1870
+ readonly arch?: NodeJS.Architecture;
1871
+ readonly osVersion?: string;
1872
+ };
1873
+ /**
1874
+ * Resolve the current host system identifiers.
1875
+ *
1876
+ * @throws {@link MinecraftKitError} with code `RUNTIME_UNSUPPORTED_PLATFORM` when the
1877
+ * platform/arch combination is not understood.
1878
+ */
1879
+ declare const detectSystem: (input?: DetectSystemInput) => RuntimeSystem;
1880
+
1881
+ /**
1882
+ * Derive a stable v3-style UUID for an offline player username.
1883
+ *
1884
+ * Mojang's offline-mode formula: `MD5("OfflinePlayer:" + name)` with the version/variant
1885
+ * bits patched to UUID v3.
1886
+ */
1887
+ declare const offlineUuidFor: (username: string) => string;
1888
+ /** Strip the dashes from a UUID. Used by `${auth_uuid}`. */
1889
+ declare const stripUuidDashes: (uuid: string) => string;
1890
+
1891
+ /** Helpers for the per-target directory layout. */
1892
+ declare const targetPaths: {
1893
+ readonly versionsDir: (root: string) => string;
1894
+ readonly versionDir: (root: string, versionId: string) => string;
1895
+ readonly versionJar: (root: string, versionId: string) => string;
1896
+ readonly versionJson: (root: string, versionId: string) => string;
1897
+ readonly librariesDir: (root: string) => string;
1898
+ readonly libraryFile: (root: string, libraryPath: string) => string;
1899
+ readonly assetIndex: (root: string, indexId: string) => string;
1900
+ readonly assetObject: (root: string, hash: string) => string;
1901
+ readonly assetVirtual: (root: string, virtualPath: string) => string;
1902
+ readonly assetLegacy: (root: string, virtualPath: string) => string;
1903
+ readonly assetResource: (root: string, virtualPath: string) => string;
1904
+ readonly loggingConfig: (root: string, id: string) => string;
1905
+ readonly nativesDir: (root: string, versionId: string) => string;
1906
+ /**
1907
+ * Path to a runtime component's root directory. Honours `installRoot` (custom global
1908
+ * runtime location) when present; otherwise falls back to `<directory>/runtime/<component>`.
1909
+ */
1910
+ readonly runtimeRoot: (directory: string, component: string, installRoot?: string) => string;
1911
+ readonly runtimeJavaExecutable: (directory: string, component: string, os: OperatingSystem, installRoot?: string) => string;
1912
+ readonly forgeInstaller: (root: string, mavenVersion: string) => string;
1913
+ };
1653
1914
 
1654
1915
  /**
1655
1916
  * Endpoint builders for every external HTTP request the library makes. Code MUST go through
@@ -1832,4 +2093,4 @@ declare const RUNTIME_PLATFORM_KEYS: Readonly<Record<OperatingSystem, Readonly<R
1832
2093
  */
1833
2094
  declare const FALLBACK_COMPONENT: string;
1834
2095
 
1835
- export { ASSETS_DIR, ASSETS_INDEXES_DIR, ASSETS_LEGACY_DIR, ASSETS_LOG_CONFIGS_DIR, ASSETS_OBJECTS_DIR, ASSETS_RESOURCES_DIR, ASSETS_VIRTUAL_DIR, ApiEndpoints, type ApiEndpointsShape, type Architecture, Architectures, type ArgumentEntry, type ArtifactDownload, type AspectRepairInput, type AssetIndexDocument, type AssetIndexReference, type AssetObject, type AuthMode, AuthModes, BASE_JVM_ARGS, CACHE_MAX_ENTRIES, CACHE_TTL_MS, ChildProcessSpawner, DEFAULT_KILL_GRACE_MS, DEFAULT_LAUNCHER_NAME, DEFAULT_LAUNCHER_VERSION, DEFAULT_LIBRARY_REPOSITORY, DEFAULT_MAX_MB, DEFAULT_MIN_MB, DOWNLOAD_CONCURRENCY, type DetectSystemInput, type DiscoveredLoaderHint, type DiscoveredRuntimeHint, type DiscoveredTarget, type DownloadAction, EXTRACTION_MAX_COMPRESSION_RATIO, EXTRACTION_MAX_ENTRY_COUNT, EXTRACTION_MAX_FILE_SIZE, EXTRACTION_MAX_TOTAL_SIZE, type EventType, EventTypes, type ExtractNativeAction, FABRIC_MAVEN_BASE, FALLBACK_COMPONENT, FORGE_INSTALLERS_DIR, FORGE_INSTALLER_MAX_SIZE, FORGE_MAVEN_BASE, type FabricCompatibilityEntry, type FabricListInput, type FabricLoaderSummary, type FabricProfile, type FabricResolveInput, FabricVersionsApi, FetchHttpClient, type FileRef, type ForgeBuildSummary, type ForgeInstallProfile, type ForgeListInput, type ForgeProcessor, type ForgeProfileData, type ForgeResolveInput, type ForgeVersionJson, ForgeVersionsApi, HTTP_RETRY_BACKOFF_BASE_MS, HTTP_RETRY_BACKOFF_CAP_MS, HTTP_RETRY_MAX, HTTP_TIMEOUT_MS, type HttpClient, type HttpHeaders, type HttpRequestOptions, type HttpResponse, type InstallAction, type InstallActionKind, InstallActionKinds, type InstallPhase, InstallPhases, type InstallPlan, type InstallProgressTracker, type InstallReport, type InstallRunOptions, type InstallStage, InstallStages, JAVA_EXECUTABLE, LAUNCH_PLACEHOLDERS, LEGACY_JVM_ARGS, LIBRARIES_DIR, type LaunchAuth, type LaunchComposition, type LaunchExit, type LaunchMemoryOptions, type LaunchOptions, type LaunchPlaceholder, type LaunchResolutionOptions, type LaunchRunOptions, type LaunchSession, type LibraryArtifact, type LibraryRule, type Loader, type LoaderKind, Loaders, type LogLevel, LogLevels, type Logger, MACOS_JVM_ARGS, MAC_RUNTIME_PREFIX, MAX_PROCESSOR_STDERR_LINES, type MemoryCacheOptions, type MetadataCache, type MinecraftArguments, type MinecraftChannel, MinecraftChannels, type MinecraftDownloads, type MinecraftGetInput, type MinecraftJavaVersion, MinecraftKit, MinecraftKitError, type MinecraftKitErrorCode, type MinecraftKitErrorContext, type MinecraftKitOptions, type MinecraftLatestInput, type MinecraftLibrary, type MinecraftLibraryDownloads, type MinecraftListInput, type MinecraftLogging, type MinecraftVersionManifest, type MinecraftVersionSummary, MinecraftVersionsApi, NATIVES_DIR_NAME, NODE_ARCH_TO_MOJANG_ARCH, NODE_PLATFORM_TO_MOJANG_OS, type OfflineAuth, type OnlineAuth, type OperatingSystem, OperatingSystems, type OperationOptions, PROGRESS_EVENT_INTERVAL_MS, PauseController, type PlanFabricRepairInput, type PlanForgeRepairInput, type PlanMinecraftRepairInput, type PlanRuntimeInstallInput, type PlanRuntimeRepairInput, type PlanStandaloneRuntimeInstallInput, type ProcessStream, type ProcessorRef, type ProgressEvent, type ProgressListener, type ProgressSnapshot, type ProgressTrackerOptions, RUNTIMES_DIR, RUNTIME_PLATFORM_KEYS, type RepairAllInput, type RepairAllReport, type RepairAspect, type RepairPhase, RepairPhases, type RepairPlan, type RepairPlanOptions, type RepairReport, type ResolvedFabricLoader, type ResolvedForgeLoader, type ResolvedLaunchVersion, type ResolvedMinecraft, type ResolvedRuntime, type ResolvedVanillaLoader, type ResolverContext, type RunForgeProcessorAction, type RunRepairInput, type RuntimeComponent, RuntimeComponents, type RuntimeFileDirectory, type RuntimeFileEntry, type RuntimeFileFile, type RuntimeFileLink, type RuntimeFilesManifest, type RuntimeIndex, type RuntimeIndexEntry, type RuntimeIndexPlatform, type RuntimeListEntry, type RuntimeListInput, RuntimePreference, type RuntimePreferenceKind, type RuntimeResolveInput, type RuntimeSystem, RuntimeVersionsApi, SPAWNER_MAX_LINE_BYTES, type SpawnOptions, type SpawnedProcess, type Spawner, type Target, type TargetCreateInput, type TargetListInput, type TargetLoaderInput, type TargetResolveInput, TargetsApi, type TargetsApiContext, USER_AGENT, type UpdatePlan, type UpdateReport, VERSIONS_DIR, type VerificationFileResult, type VerificationKind, VerificationKinds, type VerificationResult, type VerifyFabricInput, VerifyFileCategories, type VerifyFileCategory, type VerifyFileStatus, VerifyFileStatuses, type VerifyForgeInput, type VerifyMinecraftInput, type VerifyOperationOptions, type VerifyRuntimeInput, VersionPreference, type VersionPreferenceKind, type WriteLoggingConfigAction, type WriteVersionJsonAction, consoleLogger, createInstallProgressTracker, createMemoryCache, detectSystem, isErrorCode, isMinecraftKitError, offlineUuidFor, parseMajorVersion, pickClientJarVersionId, planFabricRepair, planForgeRepair, planMinecraftRepair, planRuntimeInstall, planRuntimeRepair, planStandaloneRuntimeInstall, repairAll, resolveLaunchVersion, runRepair, silentLogger, stripUuidDashes, targetPaths, verifyFabric, verifyForge, verifyMinecraft, verifyRuntime };
2096
+ export { ASSETS_DIR, ASSETS_INDEXES_DIR, ASSETS_LEGACY_DIR, ASSETS_LOG_CONFIGS_DIR, ASSETS_OBJECTS_DIR, ASSETS_RESOURCES_DIR, ASSETS_VIRTUAL_DIR, ApiEndpoints, type ApiEndpointsShape, type Architecture, Architectures, type ArgumentEntry, type ArtifactDownload, type AspectRepairInput, type AssetIndexDocument, type AssetIndexReference, type AssetObject, type AuthMode, AuthModes, BASE_JVM_ARGS, CACHE_MAX_ENTRIES, CACHE_TTL_MS, CLIENT_ID_ENV_VAR, ChildProcessSpawner, DEFAULT_KILL_GRACE_MS, DEFAULT_LAUNCHER_NAME, DEFAULT_LAUNCHER_VERSION, DEFAULT_LIBRARY_REPOSITORY, DEFAULT_MAX_MB, DEFAULT_MIN_MB, DOWNLOAD_CONCURRENCY, type DetectSystemInput, type DeviceCodePrompt, type DeviceCodeState, type DiscoveredLoaderHint, type DiscoveredRuntimeHint, type DiscoveredTarget, type DownloadAction, DownloadCategories, type DownloadCategory, EXTRACTION_MAX_COMPRESSION_RATIO, EXTRACTION_MAX_ENTRY_COUNT, EXTRACTION_MAX_FILE_SIZE, EXTRACTION_MAX_TOTAL_SIZE, type EventType, EventTypes, type ExtractNativeAction, FABRIC_MAVEN_BASE, FALLBACK_COMPONENT, FORGE_INSTALLERS_DIR, FORGE_INSTALLER_MAX_SIZE, FORGE_MAVEN_BASE, type FabricCompatibilityEntry, type FabricListInput, type FabricLoaderSummary, type FabricProfile, type FabricResolveInput, FabricVersionsApi, FetchHttpClient, type FileRef, type ForgeBuildSummary, type ForgeInstallProfile, type ForgeListInput, type ForgeProcessor, type ForgeProfileData, type ForgeResolveInput, type ForgeVersionJson, ForgeVersionsApi, HTTP_RETRY_BACKOFF_BASE_MS, HTTP_RETRY_BACKOFF_CAP_MS, HTTP_RETRY_MAX, HTTP_TIMEOUT_MS, type HttpClient, type HttpHeaders, type HttpMethod, type HttpRequestBody, type HttpRequestOptions, type HttpResponse, type InstallAction, type InstallActionKind, InstallActionKinds, type InstallPhase, InstallPhases, type InstallPlan, type InstallPlanTarget, type InstallProgressTracker, type InstallReport, type InstallRunOptions, type InstallStage, InstallStages, JAVA_EXECUTABLE, LAUNCH_PLACEHOLDERS, LEGACY_JVM_ARGS, LIBRARIES_DIR, type LaunchAuth, type LaunchComposition, type LaunchExit, type LaunchMemoryOptions, type LaunchOptions, type LaunchPlaceholder, type LaunchResolutionOptions, type LaunchRunOptions, type LaunchSession, type LibraryArtifact, type LibraryRule, type Loader, type LoaderKind, Loaders, type LogLevel, LogLevels, type Logger, type LoginOptions, MACOS_JVM_ARGS, MAC_RUNTIME_PREFIX, MAX_PROCESSOR_STDERR_LINES, type MemoryCacheOptions, type MetadataCache, type MinecraftArguments, type MinecraftChannel, MinecraftChannels, type MinecraftDownloads, type MinecraftGetInput, type MinecraftJavaVersion, MinecraftKit, MinecraftKitError, type MinecraftKitErrorCode, MinecraftKitErrorCodes, type MinecraftKitErrorContext, type MinecraftKitOptions, type MinecraftLatestInput, type MinecraftLibrary, type MinecraftLibraryDownloads, type MinecraftListInput, type MinecraftLogging, type MinecraftVersionManifest, type MinecraftVersionSummary, MinecraftVersionsApi, MojangAuthApi, type MojangSession, NATIVES_DIR_NAME, NODE_ARCH_TO_MOJANG_ARCH, NODE_PLATFORM_TO_MOJANG_OS, type OfflineAuth, type OnlineAuth, type OperatingSystem, OperatingSystems, type OperationOptions, PROGRESS_EVENT_INTERVAL_MS, PauseController, type PlanFabricRepairInput, type PlanForgeRepairInput, type PlanMinecraftRepairInput, type PlanRuntimeInstallInput, type PlanRuntimeRepairInput, type PlanStandaloneRuntimeInstallInput, type PollDeviceCodeOptions, type ProcessStream, type ProcessorRef, type ProgressEvent, type ProgressListener, type ProgressSnapshot, type ProgressTrackerOptions, RUNTIMES_DIR, RUNTIME_PLATFORM_KEYS, type RefreshOptions, type RepairAllInput, type RepairAllReport, type RepairAspect, type RepairPhase, RepairPhases, type RepairPlan, type RepairPlanOptions, type RepairReport, type ResolvedFabricLoader, type ResolvedForgeLoader, type ResolvedLaunchVersion, type ResolvedMinecraft, type ResolvedRuntime, type ResolvedVanillaLoader, type ResolverContext, type RunForgeProcessorAction, type RunRepairInput, type RuntimeComponent, RuntimeComponents, type RuntimeFileDirectory, type RuntimeFileEntry, type RuntimeFileFile, type RuntimeFileLink, type RuntimeFilesManifest, type RuntimeIndex, type RuntimeIndexEntry, type RuntimeIndexPlatform, type RuntimeListEntry, type RuntimeListInput, type RuntimeOnlyInstallTarget, RuntimePreference, type RuntimePreferenceKind, type RuntimeResolveInput, type RuntimeSystem, RuntimeVersionsApi, SPAWNER_MAX_LINE_BYTES, type SpawnOptions, type SpawnedProcess, type Spawner, type StartDeviceCodeOptions, type Target, type TargetCreateInput, type TargetListInput, type TargetLoaderInput, type TargetResolveInput, TargetsApi, type TargetsApiContext, USER_AGENT, type UpdatePlan, type UpdateReport, VERSIONS_DIR, type VerificationFileResult, type VerificationKind, VerificationKinds, type VerificationResult, type VerifyFabricInput, VerifyFileCategories, type VerifyFileCategory, type VerifyFileStatus, VerifyFileStatuses, type VerifyForgeInput, type VerifyMinecraftInput, type VerifyOperationOptions, type VerifyRuntimeInput, VersionPreference, type VersionPreferenceKind, type WriteLoggingConfigAction, type WriteVersionJsonAction, assertNever, consoleLogger, createInstallProgressTracker, createMemoryCache, detectSystem, isErrorCode, isMinecraftKitError, offlineUuidFor, parseMajorVersion, pickClientJarVersionId, planFabricRepair, planForgeRepair, planMinecraftRepair, planRuntimeInstall, planRuntimeRepair, planStandaloneRuntimeInstall, repairAll, resolveLaunchVersion, runRepair, scopedLogger, silentLogger, stripUuidDashes, targetPaths, toOnlineAuth, verifyFabric, verifyForge, verifyMinecraft, verifyRuntime };