Skip to content

Constants reference

Every URL and tunable number lives in src/constants/. Code never hard-codes either — call sites import from these modules.

API endpoints

ts
import { ApiEndpoints } from "@loontail/minecraft-kit";

ApiEndpoints.mojang.versionManifest();        // version_manifest_v2.json
ApiEndpoints.mojang.runtimeIndex();           // java-runtime/.../all.json
ApiEndpoints.resources.asset(hash);           // asset object
ApiEndpoints.fabric.gameVersions();
ApiEndpoints.fabric.loaderVersions();
ApiEndpoints.fabric.loaderForGame(mc);
ApiEndpoints.fabric.profile(mc, loader);
ApiEndpoints.forge.mavenMetadata();
ApiEndpoints.forge.promotions();
ApiEndpoints.forge.installer(fullVersion);

Defaults

ConstantValue
HTTP_TIMEOUT_MS30_000
HTTP_RETRY_MAX4
HTTP_RETRY_BACKOFF_BASE_MS500
HTTP_RETRY_BACKOFF_CAP_MS30_000
DOWNLOAD_CONCURRENCY32
CACHE_TTL_MS300_000
CACHE_MAX_ENTRIES256
USER_AGENTminecraft-kit/0.1
DEFAULT_LAUNCHER_NAMEminecraft-kit
DEFAULT_LAUNCHER_VERSION0.1.0
DEFAULT_MIN_MB1024
DEFAULT_MAX_MB4096
DEFAULT_KILL_GRACE_MS5_000
PROGRESS_EVENT_INTERVAL_MS100
MAX_PROCESSOR_STDERR_LINES20
SPAWNER_MAX_LINE_BYTES65_536

Layout segments

src/constants/files.ts exports the relative-path segments used by targetPaths.*: VERSIONS_DIR, LIBRARIES_DIR, ASSETS_DIR, ASSETS_OBJECTS_DIR, ASSETS_INDEXES_DIR, ASSETS_VIRTUAL_DIR, ASSETS_LEGACY_DIR, ASSETS_RESOURCES_DIR, ASSETS_LOG_CONFIGS_DIR, RUNTIMES_DIR, NATIVES_DIR_NAME, FORGE_INSTALLERS_DIR, plus JAVA_EXECUTABLE and MAC_RUNTIME_PREFIX.

Archive limits

src/constants/limits.ts defines extraction caps that defeat zip-bombs and zip-slip: EXTRACTION_MAX_FILE_SIZE (256 MiB), EXTRACTION_MAX_TOTAL_SIZE (2 GiB), EXTRACTION_MAX_COMPRESSION_RATIO (200), EXTRACTION_MAX_ENTRY_COUNT (100 000), FORGE_INSTALLER_MAX_SIZE (256 MiB).

Placeholders

src/constants/placeholders.ts exports LAUNCH_PLACEHOLDERS — every ${...} token used during launch, with a one-line description per token.

MIT License