AUTO-MAS MaaFW Adapter
通用 MFW 专项插件:托管 MaaFWConfig,用宿主迁来的脚本级管理器跑通一轮,并提供外壳配置导入的 3 个端点(/api/scripts/maafw/shell-instances、/import、/apply)。
依赖
auto-mas-core:插件 SDK。要带托管生命周期钩子、ScriptTypeDecl.game_kind/desktop_session和teardown_blockers的宿主;SDK 的发行号带不带这些出口都一样,所以在导入时检查,没有就拒绝加载。auto-mas-maafw-interface、auto-mas-maafw-native:两块库。auto-mas-maafw-adapter-kit:专项共用库(属主入口、密码字段加解密、默认任务队列、保存前整理、备份归档)。auto-mas-maafw-agent-env、auto-mas-maafw-runner、auto-mas-maafw-project-update:三块服务插件。插件声明requires这三块的服务,还直接 import 它们的模块,所以依赖都写到次版本上限<0.3。
宿主必须是不再内置 MFW / M9A / MSS 的让位分支;仍内置时加载会报 ImportError。
做法
- 执行:
expander.MaaFWExpander只是外壳,整轮交给manager.MaaFWEmbeddedManager。L2 已经持有托管 X 锁,管理器以「宿主已持锁」模式运行,_check里不再自己拿锁。管理器记的「跳过」交给 L3 收尾保留,托管级检查没过时 L3 记「异常」。 - 托管生命周期钩子(
plugin.Plugin,实现在lifecycle和共用库里):prepare_user_update:保存账号前全局选项双写到各任务,再加密任务快照里按 interface 认出的密码字段;prepare_user_read、on_user_added:任务队列为空的账号按项目默认写成实打实的队列(项目还没导入时留到以后);on_script_cloned:关掉开发者模式,从来源的载荷物化新托管的项目副本,副本记本插件为属主;on_script_removed:删掉这个托管的项目副本(副本记着别的属主时不删),再起一次运行池对账。
- 声明函数:
game_kind按所选控制器收窄游戏类型(Adb 是模拟器,其余是客户端,判断不了返回None);desktop_session在这次运行会选出的控制器是 Win32 时为真。 - 停用前:有托管还没收尾时
teardown_blockers给出原因,宿主拒绝停用、重载、卸载。 - 跨插件调用:真正走服务的只有属主登记(
maafw.project.v1的owner.register/owner.unregister,本插件提供maafw.owner.maafw_adapter.v1)。其余直接 import 三块服务插件的模块,全部写在函数体内,或者放在只会在函数体内首次导入的模块(manager、account_run、shell_api、shell_instances)里。 - 宿主能力经
auto_mas_core.host的出口取;还没有出口的只剩通知任务基类app.core.notify.lifecycle.NotificationTaskBase和通知格式app.core.notify.formats.maafw,只在宿主进程里跑。
开发与测试
本地联调时把本仓库以目录联接放到联调宿主的 plugins/maafw_adapter。单元测试不随仓库提交。
Metadata
Release files for auto-mas-maafw-adapter 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| auto_mas_maafw_adapter-0.2.0.tar.gz | 93.0 kB | With provenance | Details for auto_mas_maafw_adapter-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| auto_mas_maafw_adapter-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for auto_mas_maafw_adapter-0.2.0-py3-none-any.whl |
Total release size: 194.0 kB
Release files / auto_mas_maafw_adapter-0.2.0.tar.gz
| Download URL | auto_mas_maafw_adapter-0.2.0.tar.gz |
|---|---|
| Size | 93.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a11da1490cbb8ff19d7faa15cddd68d981bf336426db63dd44bba623e59650d
|
|
BLAKE2b-256 checksum How to use checksums |
b83cef4c183e799f50d2b22394bc77009d50d95cca60c1dea4f14db713072233
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / auto_mas_maafw_adapter-0.2.0-py3-none-any.whl
| Download URL | auto_mas_maafw_adapter-0.2.0-py3-none-any.whl |
|---|---|
| Size | 101.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e4eb689d708e0ab4ea0b7f31529c480cb830d277357b38f34fb5ccb4c8cf68cf
|
|
BLAKE2b-256 checksum How to use checksums |
ca2df6a71560a21a116dae07866b96b0f917e1096f84c3ff1a78b98559354781
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logSecurity for auto-mas-maafw-adapter 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for auto_mas_maafw_adapter-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.