Skip to content

[Feature] Introduce a headless CLI API#106

Merged
NoobNotFound merged 5 commits into
mainfrom
noobnotfound/headless
May 27, 2026
Merged

[Feature] Introduce a headless CLI API#106
NoobNotFound merged 5 commits into
mainfrom
noobnotfound/headless

Conversation

@NoobNotFound
Copy link
Copy Markdown
Member

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.

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.
NoobNotFound and others added 3 commits May 26, 2026 10:56
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.
@NoobNotFound NoobNotFound marked this pull request as ready for review May 27, 2026 14:37
@NoobNotFound NoobNotFound requested a review from a team as a code owner May 27, 2026 14:37
@NoobNotFound NoobNotFound merged commit b22aba7 into main May 27, 2026
6 of 7 checks passed
@NoobNotFound NoobNotFound deleted the noobnotfound/headless branch May 27, 2026 14:37
@github-project-automation github-project-automation Bot moved this from 📋 To do to ✅ Complete in Emerald May 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Complete

Development

Successfully merging this pull request may close these issues.

2 participants