feat(controller): support Cloud (GeForce NOW) controller type - #284
Open
zeejaytan wants to merge 1 commit into
Open
feat(controller): support Cloud (GeForce NOW) controller type#284zeejaytan wants to merge 1 commit into
zeejaytan wants to merge 1 commit into
Conversation
Adds the `Cloud` controller type so downstream projects can declare a
cloud-streaming controller with just a provider + game title, e.g.:
{ "name": "GFN", "type": "Cloud",
"cloud": { "provider": "geforce_now", "game_title": "Endfield" } }
instead of hand-writing the CEFCLIENT class / title / PrintWindow / Seize
config. Mirrors the MaaFramework-side Cloud preset.
- types/interface.ts: add 'Cloud' to ControllerType + CloudConfig{provider,
game_title} + cloud? on ControllerItem.
- services/cloudProviders.ts: built-in provider registry (geforce_now =>
CEFCLIENT / "{game}.*on GeForce NOW" / PrintWindow / Seize) + desugar helper.
- services/interfaceLoader.ts: expand Cloud controllers to Win32 at load time
(game_title substituted into the title template), so all downstream logic —
window selection, connection, platform filtering — treats it as a normal
Win32 controller with no further changes. Cloud is Windows-only.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Hey - 我给了一些整体性的反馈:
- 目前,当 Cloud 提供商是未知时,控制器会被保留为类型
Cloud(可能还没有cloud配置),这和我们希望下游逻辑只看到 Win32 的意图相冲突;建议要么把这类控制器过滤掉,要么仍然将它们归一化为一个安全的 Win32 结构,这样下游使用方就不需要处理Cloud分支。 CloudConfig.provider和CLOUD_PROVIDERS映射目前都以普通字符串作为键;如果能把它们收紧为字符串字面量联合类型(例如'geforce_now'),或者从CLOUD_PROVIDERS推断键类型,会更容易发现拼写错误,并保持注册表和类型定义的一致。- 在
cloudProviders.ts中,screencap和input被声明为普通字符串类型;如果Win32Config已经把这些字段限制为特定取值,可以通过Win32Config来派生它们的类型(例如Win32Config['screencap']),以避免和实际的 Win32 配置选项产生偏差。
给 AI Agent 的提示词
Please address the comments from this code review:
## Overall Comments
- Right now an unknown Cloud provider leaves the controller as type 'Cloud' (possibly without a `cloud` config), which conflicts with the intent that all downstream logic only sees Win32; consider either filtering such controllers out or still normalizing them into a safe Win32 shape so no consumer has to handle a 'Cloud' branch.
- CloudConfig.provider and the CLOUD_PROVIDERS map are both keyed as plain strings; tightening these to a string literal union (e.g. `'geforce_now'`) or inferring keys from CLOUD_PROVIDERS would make it easier to catch typos and keep the registry and type definition in sync.
- In `cloudProviders.ts`, `screencap` and `input` are typed as generic strings; if `Win32Config` already constrains these to specific values, you could derive their types from `Win32Config` (e.g. `Win32Config['screencap']`) to avoid drifting from the actual Win32 configuration options.帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈改进后续的评审。
Original comment in English
Hey - I've left some high level feedback:
- Right now an unknown Cloud provider leaves the controller as type 'Cloud' (possibly without a
cloudconfig), which conflicts with the intent that all downstream logic only sees Win32; consider either filtering such controllers out or still normalizing them into a safe Win32 shape so no consumer has to handle a 'Cloud' branch. - CloudConfig.provider and the CLOUD_PROVIDERS map are both keyed as plain strings; tightening these to a string literal union (e.g.
'geforce_now') or inferring keys from CLOUD_PROVIDERS would make it easier to catch typos and keep the registry and type definition in sync. - In
cloudProviders.ts,screencapandinputare typed as generic strings; ifWin32Configalready constrains these to specific values, you could derive their types fromWin32Config(e.g.Win32Config['screencap']) to avoid drifting from the actual Win32 configuration options.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Right now an unknown Cloud provider leaves the controller as type 'Cloud' (possibly without a `cloud` config), which conflicts with the intent that all downstream logic only sees Win32; consider either filtering such controllers out or still normalizing them into a safe Win32 shape so no consumer has to handle a 'Cloud' branch.
- CloudConfig.provider and the CLOUD_PROVIDERS map are both keyed as plain strings; tightening these to a string literal union (e.g. `'geforce_now'`) or inferring keys from CLOUD_PROVIDERS would make it easier to catch typos and keep the registry and type definition in sync.
- In `cloudProviders.ts`, `screencap` and `input` are typed as generic strings; if `Win32Config` already constrains these to specific values, you could derive their types from `Win32Config` (e.g. `Win32Config['screencap']`) to avoid drifting from the actual Win32 configuration options.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
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.
What
Adds a Cloud controller type to MXU, so a downstream project can offer a cloud-streaming target with minimal config:
{ "name": "GFN", "type": "Cloud", "cloud": { "provider": "geforce_now", "game_title": "Endfield" } }instead of hand-writing the CEF window class / title /
PrintWindow/Seize. Mirrors the MaaFramework-side Cloud preset (MaaXYZ/MaaFramework#1400).How
Pure front-end desugaring — no Rust changes; all downstream paths (window selection, connection, platform filter) keep treating it as a normal Win32 controller.
src/types/interface.ts:'Cloud'inControllerType; newCloudConfig { provider, game_title }; optionalcloudonControllerItem.src/services/cloudProviders.ts(new): built-in provider registry (geforce_now→CEFCLIENT/{game}.*on GeForce NOW/PrintWindow/Seize) +cloudToWin32Configdesugar helper.src/services/interfaceLoader.ts:expandCloudControllers()runs in the existing platform-filter choke point, desugaringCloud→Win32at load time (game title substituted into the title template).Cloudis marked Windows-only.Testing
Verified end-to-end on Windows against a real GeForce NOW session running Arknights: Endfield: the GFN controller resolves the client window and connects through MXU, driving it via
PrintWindow+Seize. Confirmed the desugared controller flows through window selection + connection unchanged.Related
🤖 Generated with Claude Code
由 Sourcery 提供的摘要
添加一种 Cloud 控制器类型,在加载时将其解糖(desugar)为 Win32 控制器,以支持 GeForce NOW 等云串流客户端。
新特性:
cloudProviders注册表,内建 GeForce NOW 提供程序,用于将 Cloud 配置映射到 Win32 窗口签名和 IO 方法。增强项:
Original summary in English
Summary by Sourcery
Add a Cloud controller type that is desugared into a Win32 controller at load time to support cloud-streaming clients like GeForce NOW.
New Features:
Enhancements: