Skip to content

feat(maafw): 收口普通 MaaFW 并迁出内置 M9A - #340

Closed
qiyinxi wants to merge 5 commits into
AUTO-MAS-Project:dev_v2from
qiyinxi:dev2/maafw-m9a-plugin-clean-20260805
Closed

feat(maafw): 收口普通 MaaFW 并迁出内置 M9A#340
qiyinxi wants to merge 5 commits into
AUTO-MAS-Project:dev_v2from
qiyinxi:dev2/maafw-m9a-plugin-clean-20260805

Conversation

@qiyinxi

@qiyinxi qiyinxi commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

摘要

  • 宿主只保留通用插件 HTTP/WebSocket 网关、脚本类型 registry、配置写事务与运行 reservation;普通 MaaFW 业务位于 automas-script-maafw 0.1.13。
  • 删除宿主内置 M9A 实现;M9A 入口、图标、共享编辑器与 satellite 由插件注册表声明。
  • plugin bootstrap 固定普通 MaaFW 精确版本;声明缺失/损坏、安装失败、缺入口、错版本或重复 dist-info 全部 fail-closed。跳过安装前也会重验实际包与历史失败状态。
  • 不引入 Managed UI/宿主业务;Project Store/Managed 等待 conversion API。
  • 已同步 upstream/dev_v2@b6cc0fcb

验证

  • Electron build:main、Vite 生产构建、完整 format 通过;lint 0 error、2 个既有 v-html warning。
  • 前端测试 36 passed、3 个既有基线失败(更新下载 2、WebSocket subscription 1)。
  • bootstrap 定向 TypeScript、ESLint、Prettier、版本/重复 dist-info 验证通过。
  • 宿主此前后端 pytest:69 passed、4 个 dev_v2 既有 Update/OK-WW 基线失败。
  • MaaFW unittest:345 passed、2 skipped;M9A pytest:29 passed、1 skipped;12 个 distribution 新鲜构建与 24 个 artifact twine strict 通过。
  • Luna Max 最终只读终审无 P0/P1。

依赖与范围

@sourcery-ai

sourcery-ai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Reviewer's Guide

重构 MaaFW 主机与前端,使其围绕基于 Runtime Pool 的新环境生命周期运作;新增脚本配置写入序列化事务与执行保留机制;通过 WebSocket 暴露更详细的 MaaFW 项目更新/环境进度;并完全移除内置 M9A schema/路由,改为由插件管理相关条目。

MaaFW 项目更新与环境预热的时序图

sequenceDiagram
    actor Editor
    participant MaaFWScriptConfigComposable as useMaaFWScriptConfig
    participant ScriptsApi as update_maafw_project
    participant UpdateService as MaaFWProjectUpdateService
    participant RunnerService as MaaFWRunnerService
    participant RuntimePool as maafw.runtime_pool.v1
    participant WS as Publisher

    Editor->>MaaFWScriptConfigComposable: handleManualProjectUpdate
    MaaFWScriptConfigComposable->>ScriptsApi: update_maafw_project(scriptId, apply)
    ScriptsApi->>UpdateService: discover_update()/update_if_needed()
    UpdateService-->>ScriptsApi: MaaFWProjectUpdateResult
    Note over ScriptsApi,WS: publish_update_progress(..., stage=checking...)

    alt update_result.updated
        ScriptsApi->>RuntimePool: _maafw_runtime_pool_route()
        RuntimePool-->>ScriptsApi: (runtime_pool_root, pool_id)
        ScriptsApi->>RunnerService: prepare_project_environment(project_path, interface_model,...)
        RunnerService-->>ScriptsApi: prepared_result (agents, projectFingerprint, runtime)
        ScriptsApi->>ScriptsApi: _build_maafw_runtime_cache_fields()
        ScriptsApi->>ScriptsApi: _save_maafw_agent_env_state_if_current(..., expected_fingerprint)
        ScriptsApi->>WS: Publisher.send(MAAFW_PROJECT_UPDATE_PROGRESS, stage=completed)
    else no update or check only
        ScriptsApi->>WS: Publisher.send(MAAFW_PROJECT_UPDATE_PROGRESS, stage=completed, status=no_update|version_discovered)
    end

    ScriptsApi-->>MaaFWScriptConfigComposable: MaaFWProjectUpdateOut
    MaaFWScriptConfigComposable-->>Editor: updateProjectResources result and logs
Loading

带缓存的 MaaFW Agent 环境准备时序图

sequenceDiagram
    actor Editor
    participant MaaFWScriptConfigComposable as useMaaFWScriptConfig
    participant MaaFWApi as prepare_maafw_agent_env
    participant EnvState as maafw_agent_env_state
    participant RuntimePool as maafw.runtime_pool.v1
    participant RunnerService as MaaFWRunnerService
    participant WS as Publisher

    Editor->>MaaFWScriptConfigComposable: handlePrepareAgentEnv
    MaaFWScriptConfigComposable->>MaaFWApi: prepareAgentEnv(path, scriptId)
    MaaFWApi->>MaaFWApi: _load_maafw_agent_env_state_for_request(scriptId, path)
    alt cached_data found and valid
        MaaFWApi->>WS: Publisher.send(MAAFW_ENV_PREPARE_PROGRESS, stage=completed, status=ready)
        MaaFWApi-->>MaaFWScriptConfigComposable: MaaFWAgentEnvPrepareOut(data=cached)
    else cache miss
        MaaFWApi->>RuntimePool: _maafw_runtime_pool_route()
        RuntimePool-->>MaaFWApi: (runtime_pool_root, pool_id)
        MaaFWApi->>RunnerService: prepare_project_environment(root_path, interface,...)
        RunnerService-->>MaaFWApi: prepared_result (agents, projectFingerprint, runtime)
        MaaFWApi->>EnvState: save_maafw_agent_env_state(scriptId, path, prepared_data, expected_fingerprint)
        EnvState-->>MaaFWApi: saved/failed
        MaaFWApi->>WS: Publisher.send(MAAFW_ENV_PREPARE_PROGRESS, stage=completed, status=completed)
        MaaFWApi-->>MaaFWScriptConfigComposable: MaaFWAgentEnvPrepareOut(data=prepared)
    end

    MaaFWScriptConfigComposable-->>Editor: agentEnvResult and progress UI
Loading

文件级改动

Change Details Files
引入脚本配置写入序列化事务、按脚本的执行保留机制,以及跨主机配置与适配器更安全的锁/维护语义。
  • 新增 _script_config_write 装饰器和 AppConfig 中基于 asyncio.Lock 与 ContextVar 追踪事务所有权和可重入性的异步上下文管理写入作用域。
  • 实现 script_config_transactionscript_config_write_scope,用于保护主机配置维护与对外写入之间的边界;同时增加按脚本的 try_reserve_script_execution / release_script_execution,以在删除与维护时协调任务调度。
  • 将所有脚本/用户/计划/模拟器/webhook 的新增/更新/删除/重排/设置操作接入新的写入闸门;增加 provider 可创建性检查,并在脚本 id 无效时返回空记录。
  • 更新任务管理器(MAA、SRC、MaaEnd、general、ok-script、okww),通过 Config 方法在写入事务下对脚本配置加锁/解锁,并仅在受保护的作用域内回写用户配置。
app/core/config.py
app/models/ConfigBase.py
app/task_manager.py
app/task/MAA/manager.py
app/task/SRC/manager.py
app/task/MaaEnd/manager.py
app/task/general/manager.py
plugins/ok_script_adapter/src/ok_script_adapter/adapter/runtime.py
plugins/okww_adapter/src/okww_adapter/adapter/runtime.py
app/plugins/script_config_store.py
app/plugins/manager.py
围绕 Runtime Pool、可缓存的预热状态和 WebSocket 进度上报,重构 MaaFW 项目更新与 Agent 环境准备流程。
  • 新增 MaaFW Runtime Pool 路由与运行时入口校验工具函数,以及基于线程的助手,用于在带指纹与 Runtime Pool 身份校验的前提下加载/保存 MaaFW Agent 环境缓存。
  • 用两阶段检查/应用流程替换旧的 MaaFW 项目更新端点,包括项目路径保留、WebSocket 进度桥接、资源更新后的环境预热,以及详细的状态码/提供方错误传播。
  • 扩展 MaaFW Agent 环境准备端点,在安全的前提下重用缓存环境,强制 scriptId/进度头一致性,支持仅检查缓存(cache-only),项目路径保留,并通过 WebSocket 流式推送进度。
  • 新增 maafw_agent_env_state 辅助模块,以每脚本、每项目的预热结果为单位进行存储,按照项目指纹与 Runtime Pool 身份进行键控,并提供安全的读/写与失效(invalidation)API。
  • 在脚本删除 API 中增加 MaaFW 环境状态失效与更好的错误报告。
  • 让 MaaFW win32 预览与资源文件访问使用 asyncio.to_thread 处理 I/O 密集工作,并使 MaaFW 接口预览线程安全。
app/api/scripts.py
app/api/scripts2.py
app/core/maafw_agent_env_state.py
app/core/ws/protocol.py
app/core/ws/publisher.py
automas_* MaaFW backend package version bumps in pyproject.toml
在前端暴露 MaaFW 项目更新与环境准备进度,集成支持 Runtime Pool 的缓存,并改进 MaaFW 脚本向导/编辑器的用户体验。
  • 扩展 useMaaFWScriptConfig,增加 MaaFW 项目更新/环境准备进度的 WebSocket 订阅、更丰富的进度状态(阶段、字节数、提供方错误码)、以及在更新/准备/预览之间更严格的并发保护和改进的模拟器选项/设备加载与缓存。
  • 更新 BasicInfoSectionUpdateSettingsSectionMaaFWScriptEditMaaFWSetupWizardMaaFWUserEdit,以展示新的进度条,在更新/预热运行时禁用冲突操作,并在合适时机在加载时自动准备环境。
  • 新增 MaaFWConfigurationReusePanel 组件与 useMaaFWConfigurationReuse 组合式函数,用于发现外部 MaaFW 配置,规划/应用项目+用户复用或用户拷贝,并整合进 MaaFW 设置向导与用户创建流程。
  • 调整 MaaFW 更新默认值(自动源选择、GitHub 支持、MirrorChyan CDK 处理),并阻止无 CDK 的仅 MirrorChyan 安装,同时提供相应的 UI 提示。
  • 在 MaaFW 任务选项编辑器中,将热键选项从 MAS 中的可编辑选项中过滤掉。
frontend/src/composables/useMaaFWScriptConfig.ts
frontend/src/composables/useMaaFWApi.ts
frontend/src/composables/useMaaFWConfigurationReuse.ts
frontend/src/components/MaaFWConfigurationReusePanel.vue
frontend/src/views/EditView/Script/MaaFWScriptEdit.vue
frontend/src/views/EditView/Script/MaaFWSetupWizard.vue
frontend/src/views/EditView/Script/MaaFWScriptEdit/BasicInfoSection.vue
frontend/src/views/EditView/Script/MaaFWScriptEdit/UpdateSettingsSection.vue
frontend/src/views/EditView/Script/MaaFWScriptEdit/ControlConfigSection.vue
frontend/src/views/EditView/User/MaaFWUserEdit.vue
frontend/src/views/EditView/User/MaaFWUserEdit/MaaFWTaskOptionEditor.vue
frontend/src/services/websocket/types.ts
移除内置 M9A schema、配置、路由与 UI,使 M9A 成为仅通过插件提供的 MaaFW 项目类型,不再由主机管理其 schema 或创建流程。
  • 从主机配置、schema 以及脚本/用户 API 中删除 M9AConfig/M9AUserConfig 定义及引用,并停止在 ScriptIndexItem/UserIndexItem 及相关 API 模型中暴露 M9A。
  • 将 M9A 从内置脚本类型注册表、任务导出/管理器、常量、路由别名、脚本创建流程以及前端脚本类型枚举/类型中移除。
  • 确保脚本类型描述符与 UI 将不可创建的提供方(包括 M9A 包)视为不可选择,同时仍允许插件注册的 M9A 条目通过注册表显示,并使用插件提供的图标与 editor_kind 路由。
  • 更新脚本编辑路径助手与脚本列表过滤逻辑,将 MaaFW/M9A 视为 MaaFW 编辑器类型,并移除遗留的 M9A 专用资源/测试与统计 HTML。
app/models/config.py
app/models/schema.py
app/core/script_types.py
app/utils/constants.py
app/task/__init__.py
app/task/M9A/* (deleted)
frontend/src/types/script.ts
frontend/src/api/models/*M9A*.ts (deleted)
frontend/src/api/index.ts
frontend/src/composables/useScriptApi.ts
frontend/src/utils/scriptRegistry.ts
frontend/src/views/scripts/components/scriptCreateFlow.ts
frontend/src/views/scripts/components/scriptCreateFlow.test.ts
frontend/src/router/index.ts
frontend/src/views/Scripts.vue
res/html/m9a_statistics.html
为新的 MaaFW runtime 工具收紧 MaaFW 项目更新源配置以及 UV 后端默认值。
  • 允许 MaaFW Update.Source 为空或 GitHub,当脚本级字段为空时,从全局设置派生有效的 source 与 MirrorChyan CDK,并通过 MaaFWProjectUpdateData 与前端模型传播提供方错误码。
  • 扩展 MaaFW 配置 schema 与 API 模型,增加 GitHub 仓库/标签/资源模式字段,供更新后的 MaaFW 项目更新后端使用。
  • 更新 uv_backend 以遵守 AUTO_MAS_UV_EXE,并在未配置时通过 AUTO_MAS_UV_INDEX_URL_ENV 设置默认索引 URL,使其与新的 MaaFW runtime 工具预期保持一致。
app/models/config.py
app/models/schema.py
frontend/src/api/models/MaaFWConfig_Update.ts
frontend/src/api/models/MaaFWProjectUpdateData.ts
frontend/src/api/models/MaaFWProjectUpdateIn.ts
frontend/src/api/services/MaaFwService.ts
frontend/src/api/services/Service.ts
app/plugins/uv_backend.py

可能关联的 Issue

  • #共用MAA Framework:Issue 询问是否可以共用一个 Maa-FW;本 PR 通过共享 MaaFW Runtime Pool 与脚本写事务来实现共用需求。

Tips and commands

Interacting with Sourcery

  • 触发新的代码审查: 在 pull request 中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub issue: 在审查评论中请求 Sourcery 创建 issue。你也可以在审查评论中回复 @sourcery-ai issue,从该评论创建一个 issue。
  • 生成 pull request 标题: 在 pull request 标题中任意位置写入 @sourcery-ai,即可随时生成标题。你也可以在 pull request 中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成 pull request 摘要: 在 pull request 正文任意位置写入 @sourcery-ai summary,即可在指定位置生成 PR 摘要。你也可以在 pull request 中评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成 Reviewer's Guide: 在 pull request 中评论 @sourcery-ai guide,可随时(重新)生成 Reviewer 的指南。
  • 一次性解决所有 Sourcery 评论: 在 pull request 中评论 @sourcery-ai resolve,将所有 Sourcery 评论标记为已解决。如果你已经处理完所有评论且不想再看到它们,这将很有用。
  • 清除所有 Sourcery 审查: 在 pull request 中评论 @sourcery-ai dismiss,以关闭所有现有的 Sourcery 审查。若你希望从一个全新的审查开始,这尤其有用——别忘了再评论 @sourcery-ai review 来触发新的审查!

Customizing Your Experience

访问你的 dashboard 以:

  • 启用或禁用诸如 Sourcery 生成的 pull request 摘要、Reviewer 指南等审查功能。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查指令。
  • 调整其他审查设置。

Getting Help

Original review guide in English

Reviewer's Guide

Refactors MaaFW host and frontend around a new Runtime Pool-based environment lifecycle, adds serialized script config write transactions and execution reservations, exposes detailed MaaFW project update/environment progress over WebSocket, and fully removes built‑in M9A schema/routes in favor of plugin-managed entries.

Sequence diagram for MaaFW project update and environment prewarm

sequenceDiagram
    actor Editor
    participant MaaFWScriptConfigComposable as useMaaFWScriptConfig
    participant ScriptsApi as update_maafw_project
    participant UpdateService as MaaFWProjectUpdateService
    participant RunnerService as MaaFWRunnerService
    participant RuntimePool as maafw.runtime_pool.v1
    participant WS as Publisher

    Editor->>MaaFWScriptConfigComposable: handleManualProjectUpdate
    MaaFWScriptConfigComposable->>ScriptsApi: update_maafw_project(scriptId, apply)
    ScriptsApi->>UpdateService: discover_update()/update_if_needed()
    UpdateService-->>ScriptsApi: MaaFWProjectUpdateResult
    Note over ScriptsApi,WS: publish_update_progress(..., stage=checking...)

    alt update_result.updated
        ScriptsApi->>RuntimePool: _maafw_runtime_pool_route()
        RuntimePool-->>ScriptsApi: (runtime_pool_root, pool_id)
        ScriptsApi->>RunnerService: prepare_project_environment(project_path, interface_model,...)
        RunnerService-->>ScriptsApi: prepared_result (agents, projectFingerprint, runtime)
        ScriptsApi->>ScriptsApi: _build_maafw_runtime_cache_fields()
        ScriptsApi->>ScriptsApi: _save_maafw_agent_env_state_if_current(..., expected_fingerprint)
        ScriptsApi->>WS: Publisher.send(MAAFW_PROJECT_UPDATE_PROGRESS, stage=completed)
    else no update or check only
        ScriptsApi->>WS: Publisher.send(MAAFW_PROJECT_UPDATE_PROGRESS, stage=completed, status=no_update|version_discovered)
    end

    ScriptsApi-->>MaaFWScriptConfigComposable: MaaFWProjectUpdateOut
    MaaFWScriptConfigComposable-->>Editor: updateProjectResources result and logs
Loading

Sequence diagram for MaaFW agent environment prepare with cache

sequenceDiagram
    actor Editor
    participant MaaFWScriptConfigComposable as useMaaFWScriptConfig
    participant MaaFWApi as prepare_maafw_agent_env
    participant EnvState as maafw_agent_env_state
    participant RuntimePool as maafw.runtime_pool.v1
    participant RunnerService as MaaFWRunnerService
    participant WS as Publisher

    Editor->>MaaFWScriptConfigComposable: handlePrepareAgentEnv
    MaaFWScriptConfigComposable->>MaaFWApi: prepareAgentEnv(path, scriptId)
    MaaFWApi->>MaaFWApi: _load_maafw_agent_env_state_for_request(scriptId, path)
    alt cached_data found and valid
        MaaFWApi->>WS: Publisher.send(MAAFW_ENV_PREPARE_PROGRESS, stage=completed, status=ready)
        MaaFWApi-->>MaaFWScriptConfigComposable: MaaFWAgentEnvPrepareOut(data=cached)
    else cache miss
        MaaFWApi->>RuntimePool: _maafw_runtime_pool_route()
        RuntimePool-->>MaaFWApi: (runtime_pool_root, pool_id)
        MaaFWApi->>RunnerService: prepare_project_environment(root_path, interface,...)
        RunnerService-->>MaaFWApi: prepared_result (agents, projectFingerprint, runtime)
        MaaFWApi->>EnvState: save_maafw_agent_env_state(scriptId, path, prepared_data, expected_fingerprint)
        EnvState-->>MaaFWApi: saved/failed
        MaaFWApi->>WS: Publisher.send(MAAFW_ENV_PREPARE_PROGRESS, stage=completed, status=completed)
        MaaFWApi-->>MaaFWScriptConfigComposable: MaaFWAgentEnvPrepareOut(data=prepared)
    end

    MaaFWScriptConfigComposable-->>Editor: agentEnvResult and progress UI
Loading

File-Level Changes

Change Details Files
Introduce serialized script config write transactions, per-script execution reservations, and safer lock/maintenance semantics across host config and adapters.
  • Add _script_config_write decorator and async context-managed write scopes in AppConfig, backed by an asyncio.Lock and ContextVar tracking for transaction ownership and reentrancy.
  • Implement script_config_transaction and script_config_write_scope to guard host config maintenance vs. public writes, plus per-script try_reserve_script_execution/release_script_execution to coordinate task scheduling with deletion and maintenance.
  • Wire all script/user/plan/emulator/webhook add/update/delete/reorder/set operations through the new write gates; add provider creatable checks and return empty records when a script id is invalid.
  • Update task managers (MAA, SRC, MaaEnd, general, ok-script, okww) to lock/unlock script configs via Config methods under write transactions, and to write back user configs only inside these guarded scopes.
app/core/config.py
app/models/ConfigBase.py
app/task_manager.py
app/task/MAA/manager.py
app/task/SRC/manager.py
app/task/MaaEnd/manager.py
app/task/general/manager.py
plugins/ok_script_adapter/src/ok_script_adapter/adapter/runtime.py
plugins/okww_adapter/src/okww_adapter/adapter/runtime.py
app/plugins/script_config_store.py
app/plugins/manager.py
Rework MaaFW project update and agent environment preparation around Runtime Pool, cacheable prewarm state, and WebSocket progress reporting.
  • Add helpers for MaaFW Runtime Pool routing and runtime entry validation, plus threaded helpers to load/save MaaFW agent env cache with fingerprint and Runtime Pool identity checks.
  • Replace old MaaFW project update endpoint with a two-phase check/apply flow, including project path reservation, WebSocket progress bridging, environment prewarm after resource updates, and detailed status codes/provider error propagation.
  • Extend MaaFW agent env prepare endpoint to reuse cached environments when safe, enforce scriptId/progress header consistency, support cache-only checks, project path reservations, and to stream progress over WebSocket.
  • Add maafw_agent_env_state sidecar module to store per-script, per-project prewarm results keyed by project fingerprint and Runtime Pool identity, with safe read/write and invalidation APIs.
  • Guard script deletion APIs with MaaFW env state invalidation and improved error reporting.
  • Teach MaaFW win32 preview and asset file access to use asyncio.to_thread for I/O-bound work, and make MaaFW interface preview thread-safe.
app/api/scripts.py
app/api/scripts2.py
app/core/maafw_agent_env_state.py
app/core/ws/protocol.py
app/core/ws/publisher.py
automas_* MaaFW backend package version bumps in pyproject.toml
Expose MaaFW project update and env prepare progress in the frontend, integrate Runtime Pool-aware caching, and improve MaaFW script wizard/editor UX.
  • Extend useMaaFWScriptConfig with WebSocket subscriptions for MaaFW project update/env prepare progress, richer progress state (stages, bytes, provider error codes), tighter concurrency guards between update/prepare/preview, and improved emulator option/device loading with caching.
  • Update BasicInfoSection, UpdateSettingsSection, MaaFWScriptEdit, MaaFWSetupWizard, and MaaFWUserEdit to display new progress bars, disable conflicting actions while update/prewarm is running, and to auto-prepare env on load when appropriate.
  • Introduce MaaFWConfigurationReusePanel and useMaaFWConfigurationReuse composable to discover external MaaFW configs, plan/apply project+user reuse or user copies, and integrate into MaaFW setup wizard and user creation flow.
  • Adjust MaaFW update defaults (auto source selection, GitHub support, MirrorChyan CDK handling) and block MirrorChyan-only installs without CDK, with corresponding UI hints.
  • Filter out hotkey options from the MaaFW task option editor as non-editable in MAS.
frontend/src/composables/useMaaFWScriptConfig.ts
frontend/src/composables/useMaaFWApi.ts
frontend/src/composables/useMaaFWConfigurationReuse.ts
frontend/src/components/MaaFWConfigurationReusePanel.vue
frontend/src/views/EditView/Script/MaaFWScriptEdit.vue
frontend/src/views/EditView/Script/MaaFWSetupWizard.vue
frontend/src/views/EditView/Script/MaaFWScriptEdit/BasicInfoSection.vue
frontend/src/views/EditView/Script/MaaFWScriptEdit/UpdateSettingsSection.vue
frontend/src/views/EditView/Script/MaaFWScriptEdit/ControlConfigSection.vue
frontend/src/views/EditView/User/MaaFWUserEdit.vue
frontend/src/views/EditView/User/MaaFWUserEdit/MaaFWTaskOptionEditor.vue
frontend/src/services/websocket/types.ts
Remove built-in M9A schema, config, routing, and UI, making M9A a plugin-only MaaFW project type with no host-managed schema or creator.
  • Delete M9AConfig/M9AUserConfig definitions and references from host config, schema, and script/user APIs, and stop exposing M9A in ScriptIndexItem/UserIndexItem and related API models.
  • Drop M9A from builtin script type registry, task exports/managers, constants, router aliases, script creation flow, and script type enums/types in the frontend.
  • Ensure script type descriptors and UI treat non-creatable providers (including M9A pack) as non-selectable, while still allowing plugin-registered M9A entries through the registry with plugin-provided icons and editor_kind routing.
  • Update script edit path helpers and script list filtering to treat MaaFW/M9A as MaaFW editor kind, and remove legacy M9A-specific assets/tests and statistics HTML.
app/models/config.py
app/models/schema.py
app/core/script_types.py
app/utils/constants.py
app/task/__init__.py
app/task/M9A/* (deleted)
frontend/src/types/script.ts
frontend/src/api/models/*M9A*.ts (deleted)
frontend/src/api/index.ts
frontend/src/composables/useScriptApi.ts
frontend/src/utils/scriptRegistry.ts
frontend/src/views/scripts/components/scriptCreateFlow.ts
frontend/src/views/scripts/components/scriptCreateFlow.test.ts
frontend/src/router/index.ts
frontend/src/views/Scripts.vue
res/html/m9a_statistics.html
Tighten MaaFW project update source configuration and UV backend defaults for the new MaaFW runtime tooling.
  • Allow MaaFW Update.Source to be blank or GitHub, derive effective source and MirrorChyan CDK from global settings when script-level fields are empty, and propagate provider error codes through MaaFWProjectUpdateData and frontend models.
  • Extend MaaFW config schema and API models with GitHub repo/tag/asset pattern fields, used by updated MaaFW project update backend.
  • Update uv_backend to respect AUTO_MAS_UV_EXE and set a default index URL via AUTO_MAS_UV_INDEX_URL_ENV when none is configured, aligning with new MaaFW runtime tooling expectations.
app/models/config.py
app/models/schema.py
frontend/src/api/models/MaaFWConfig_Update.ts
frontend/src/api/models/MaaFWProjectUpdateData.ts
frontend/src/api/models/MaaFWProjectUpdateIn.ts
frontend/src/api/services/MaaFwService.ts
frontend/src/api/services/Service.ts
app/plugins/uv_backend.py

Possibly linked issues

  • #共用MAA Framework: Issue询问共用一个Maa-FW;PR实现共享MaaFW Runtime Pool与脚本写事务,满足共用需求。

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

qiyinxi added 3 commits August 6, 2026 07:18
…ugin-clean-20260805

# Conflicts:
#	app/models/schema.py
#	frontend/src/api/models/ScriptCreateIn.ts
#	frontend/src/api/models/ScriptCreateOut.ts
#	frontend/src/api/models/ScriptGetOut.ts
#	frontend/src/api/models/ScriptUpdateIn.ts
#	frontend/src/api/models/UserCreateOut.ts
#	frontend/src/api/models/UserGetOut.ts
#	frontend/src/api/models/UserUpdateIn.ts
#	frontend/src/types/script.ts
#	frontend/src/utils/scriptRegistry.ts
#	frontend/src/views/scripts/components/scriptCreateFlow.test.ts
#	frontend/src/views/scripts/components/scriptCreateFlow.ts
#	plugins/ok_script_adapter/src/ok_script_adapter/adapter/runtime.py
Comment thread app/core/config.py
async def unlock_script_config(self, script_id: str) -> None:
"""在宿主写门内解锁一个运行结束的脚本配置。"""

await self.ScriptConfig[uuid.UUID(script_id)].unlock()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这块等一下群主的配置基类_(:」∠)

Comment thread app/models/ConfigBase.py
self.is_locked = False

def _write_locked(self) -> bool:
owner = self._maintenance_owner

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

爱信等配置基类

@qiyinxi

qiyinxi commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Closed it.

@qiyinxi qiyinxi closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant