Repository navigation
feat: add composable addon system with vpatch/patch, catalog, and registry - #324
Merged
Merged
Conversation
Move Origin, OriginPolicy, OriginEndpoints, OriginError, and URL helpers into elemental_core::url behind the http feature, and add OriginPolicyMap for global + scoped mirror layering.
Add MetadataPatch, PatchMode (Virtual/Physical), topological before/after ordering, per-step PatchTrace diffs, baseline-first InstanceProbe detection, and VersionJsonLaunchBuilder::with_metadata. Re-export elemental_core::url and remove LiteLoader driver. BREAKING CHANGE: LITELOADER_DRIVER, elemental_driver::drivers::liteloader, and Error::LiteLoader* variants were removed; LiteLoader now lives in elemental-addon.
…and built-in addons Introduce the Addon trait, PatchModeSupport/AddonPatchMode monotonic scoping, .elemental/addons.json state management, reorder/trace helpers, catalog query types, and built-in LiteLoaderAddon, CustomPatchAddon, and JvmAgentAddon.
…and existing-instance install Add AddonRegistry, AddonSpec, Launcher::install_addons, reorder_addons, set_addon_patch_mode, set_instance_patch_mode, trace_instance_patches, per-addon DriverOrigins support, and integration tests; expose addon features in elemental-kit and remove driver-liteloader from launchpad. BREAKING CHANGE: Instance gained pub addons: Vec<InstalledAddon>; driver-liteloader and DriverOrigins::liteloader were replaced by addon-liteloader and DriverOrigins::liteloader_addon / for_addon; Launcher::set_instance_patch_mode now returns Result<PatchTrace>.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 889 |
| Duplication | 26 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Closed
…ilderExt - Split crates/core/src/http into config, client, request, and tests submodules - Add SwappableClient::request, get, scoped headers (with_header/with_headers), RequestBuilderExt, and HttpRequestError - Remove elemental_driver::http::HttpClient and migrate driver and addon sources - Add Launcher::register_addon_with for constructor-time dependency injection of shared SwappableClient
…l Addon registration - Implement Addon for Arc<T> and accept impl Addon + 'static in Launcher::register_addon and builders - Remove Launcher::register_addon_with - Convert with_http_client on LiteLoaderSource, VanillaSource, LoaderMetaSource, InstallerMavenSource, and RiftSource to fluent mut self -> Self - Add LiteLoaderAddon::with_http_client
…via VersionJsonInstanceResource - Replace manual .elemental/base-version.json path joining in patch storage with VersionJsonInstanceResource::Elemental - Replace manual .elemental/addons.json path joining in addon state storage with VersionJsonInstanceResource::Elemental - Update load_addon_state and save_addon_state to take &InstanceStorage and update launcher callers
…d expose AddonRegistry::addon - Drop required game_version from AddonRelease and make AddonCatalogQuery filters optional - Simplify LiteLoaderAddon::available_versions to filter source releases directly - Replace AddonRegistry catalog forwarding methods with AddonRegistry::addon(id) -> Result<Arc<dyn Addon>>
…iteLoader exports
… support launch-scoped addons - Implement version-selectable AuthlibInjectorAddon in elemental-addon with OriginPolicy mirror support, SwappableClient, SHA-256 cache verification, and optional embedded fallback - Add LaunchOptions::addon(AddonSpec) supporting full unified ephemeral launch-scoped addons (prepare, in-memory MetadataPatch overlay, augment_launch) without disk writes - Store game_version on PreparedInstance and replace Launcher::install_authlib_injector / implicit inject_authlib_injector with explicit AuthlibInjectorAddon registration
…ement and patch mode handling
- Replaced compile error for missing TLS backend with a macro call to `elemental_core::require_tls_backend!()`. - Removed dead code and unnecessary feature flags from `origin.rs`. - Streamlined imports and organized driver-related code in `registration.rs`, enhancing readability and maintainability. - Added comprehensive documentation on using addons, including architecture overview, built-in addons, installation methods, patch modes, and custom addon authoring in `addons.md`.
- Introduced `ActionScope` struct to encapsulate scoped operations for instance preparation and addon installation. - Refactored methods to utilize `ActionScope` for preparing instances, installing addons, and launching commands. - Updated tests to align with the new scoped operation model, ensuring proper handling of addon patch modes and session management. - Modified documentation to reflect the new usage patterns for instance preparation and addon management.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduce Elemental's composable Addon system across
core,driver,addon,launcher,elemental-kit, andlaunchpad:elemental-core::url(058f87d): MoveOrigin,OriginPolicy,OriginEndpoints,OriginError, and URL helpers fromelemental-driverintoelemental-corebehind thehttpfeature, and addOriginPolicyMapfor global + scoped mirror layering.elemental-driverPatch Engine & LiteLoader Retirement (b528dc0):MetadataPatch,PatchMode(Virtual/Physical), topologicalbefore/afterordering with cycle detection, per-stepPatchTrace/MetadataPatchStepDiff, baseline-firstInstanceProbe::collect, andVersionJsonLaunchBuilder::with_metadata.LITELOADER_DRIVERandcrates/driver/src/drivers/liteloader/.elemental-addonCrate (08df741):Addontrait, monotonic two-level patch scoping (PatchModeSupport+AddonPatchMode),.elemental/addons.jsonpersistence,reorder_instance_addons,trace_instance_patches, catalog support (AddonRelease/AddonCatalogQuery), and built-inLiteLoaderAddon,CustomPatchAddon, andJvmAgentAddon.elemental-launcher/elemental-kit/launchpadIntegration (4d88c7f):AddonRegistry(supporting both built-in and third-party addons with data-only degradation and explicit failure for missing runtime hooks),AddonSpec,Launcher::install_addons,reorder_addons,set_addon_patch_mode,set_instance_patch_mode,trace_instance_patches, per-addonDriverOriginssupport, and integration tests (crates/launcher/tests/addon_system.rs).Breaking Changes
LITELOADER_DRIVER,elemental_driver::drivers::liteloader,driver-liteloader, andDriverOrigins::liteloaderwere removed; useDriverSpec::vanilla/DriverSpec::forge+AddonSpec::new("liteloader")withaddon-liteloaderandDriverOrigins::liteloader_addon()/for_addon().elemental_launcher::Instancenow includespub addons: Vec<InstalledAddon>.InstalledAddonnow includespub effective_patch_mode: PatchMode.AddonSpecnow includespub patch_mode: AddonPatchMode.Launcher::set_instance_patch_modenow returnsResult<PatchTrace>instead ofResult<()>.Verification
cargo fmt --all -- --check— passedcargo test -p elemental-core url— 5 passedcargo test -p elemental-driver— 7 passedcargo test -p elemental-addon— compiled and doc-tested (0 tests)cargo test -p elemental-launcher --test addon_system --test driver_registry --test inspect_instances— 13 passedcargo test -p elemental-launcher origin— 2 passedcargo check --workspace— all 7 workspace crates passed