[Feature] Introduce a headless CLI API#106
Merged
Merged
Conversation
Replace direct DispatcherQueue usage with an IUiDispatcher abstraction in GameRuntimeService to decouple runtime logic from the platform dispatcher. Update RunOnUI helpers to call IUiDispatcher.Invoke instead of using TryEnqueue/TaskCompletionSource. Make IUiDispatcher and InlineUiDispatcher public so they can be resolved via DI, and adapt App.xaml.cs to wrap the platform DispatcherQueue with Services.DispatcherQueueUiDispatcher when constructing the service. Also update the GameRuntimeService constructor signature to accept IUiDispatcher.
Introduce a new Emerald.ApiHost ASP.NET Core project that provides a headless API and WebSocket event hub for CoreX. Adds project file and Program.cs which configures Kestrel (supports listening on a Unix socket or localhost), registers CoreX services (accounts, auth, runtime, stores, installers, notifications), and exposes REST endpoints for accounts, games, versions, launches/stops, and global settings. Includes a /ws/events WebSocket endpoint and background initialization of the Core engine. Adds EventHub service to broadcast game session and notification events to connected WebSocket clients. Adds HeadlessElyByOAuthBrowser implementation to perform loopback OAuth flow for Ely.by. Also updates AssemblyInfo to grant InternalsVisibleTo Emerald.ApiHost and adds the new project to the solution file.
Expose many new HTTP APIs and switch to a thread-safe UI dispatcher. Changes include: update default port, register ThreadSafeUiDispatcher and add its implementation to serialize collection mutations; register CommunityToolkit DI; add /api/status and multiple account endpoints (Microsoft/Ely.by start/status/cancel/password flows) with cancellable login handling; extend game APIs: create/launch/install endpoints with validation, loader/version lookup, and install error handling; add game settings CRUD endpoints and session log pagination; add notifications listing/cancel/delete endpoints; extend CreateGameRequest with LoaderType and ModVersion. These changes enable headless REST control of accounts, installs, launches, settings and logs.
Introduce a headless HTTP API host for Emerald CoreX: add new Emerald.ApiHost project files (routes, services registration, startup, request DTOs, and headless runtime settings) and refactor Program into partials. Implement REST endpoints for status, accounts, games, versions, runtime, settings, Java runtimes and notifications, plus a WebSocket event socket and background Core initialization. Configure Kestrel (including optional Unix socket), JSON enum serialization, Swagger/OpenAPI support and cleanup of stale socket files. Add package references for OpenAPI/Swashbuckle and update Directory.Packages.props accordingly.
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.
Introduce an CLI for Emerald.CoreX, with local http and unix socket connection support.
This has nothing to do with Emerald Uno Platform, this for making a native MacOS fronted with the same backend process.