Skip to content

feat(hsr): 迁移插件版管控与直控体验 - #345

Draft
qiyinxi wants to merge 2 commits into
AUTO-MAS-Project:devfrom
qiyinxi:work/hsr-olddev
Draft

feat(hsr): 迁移插件版管控与直控体验#345
qiyinxi wants to merge 2 commits into
AUTO-MAS-Project:devfrom
qiyinxi:work/hsr-olddev

Conversation

@qiyinxi

@qiyinxi qiyinxi commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

概要

  • 将插件版 HSR 的用户级 MAS 管控/脚本直控、SRA/M7A 动态任务字段与分引擎体力配置迁移到内置 HSRConfig/HSRUserConfig
  • 原生控制收敛为“在原脚本完成配置后导入快照”:删除原生编辑器会话与高成本测试版兼容契约,API 业务逻辑懒加载并归属 HSR task 层。
  • HSR 运行时仅保留 Daily、ReceiveRewards、DivergentUniverse、CurrencyWars,彻底移除三深渊/月常链路,同时保留直控、外部路径锁、临时分辨率恢复和兑换码变更策略。

验证

  • HSR Python 编译、真实 FastAPI 路由组装、SRA/M7A 动态配置与直控合成 smoke、残留扫描通过。
  • 前端 vue-tsc --noEmit、定向 Prettier/ESLint、Vite 生产构建通过。
  • 后端 unittest 90/96;其余 6 项均位于相对 upstream/dev 未改动的 game-sign notification 基线。

@sourcery-ai

sourcery-ai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Reviewer's Guide

将 HSR MAS 托管/直控(managed/direct control)交互从插件宿主迁移到旧版 dev 中,新增 capability / managed-config / native-control API、动态任务字段、直控会话,以及前端控制模式的用户/脚本编辑器;同时废弃月度深渊流程,并接入新的游戏分辨率和兑换码策略。

HSR 直控执行流程的序列图

sequenceDiagram
    participant HSRManager
    participant AutoProxy
    participant ExternalLockManager
    participant HSRAccountSwitcher
    participant NativeProvider
    participant DirectSession
    participant GameProcess

    HSRManager->>HSRManager: prepare()
    HSRManager->>ExternalLockManager: resolve_external_lock_paths(script_config, ("SRA","M7A"))
    HSRManager->>ExternalLockManager: acquire_external_path_locks(paths, wait=False)
    HSRManager->>HSRManager: _backup_external_configs()

    HSRManager->>AutoProxy: main_task()
    AutoProxy->>AutoProxy: resolve_user_control(user_config, script_config)
    AutoProxy->>HSRAccountSwitcher: ensure_game_started_by_mas()
    HSRAccountSwitcher->>HSRAccountSwitcher: prepare_game_resolution_if_needed(runtime, script_config, append_log)
    HSRAccountSwitcher->>GameProcess: start_game()

    AutoProxy->>NativeProvider: native_provider(engine)
    AutoProxy->>NativeProvider: open_direct_session(script_config, config_content, session_id, log)
    NativeProvider-->>DirectSession: SRADirectControlSession/M7ADirectControlSession
    AutoProxy->>DirectSession: run(timeout_seconds)
    DirectSession-->>AutoProxy: HSRRunResult

    AutoProxy->>DirectSession: close()
    HSRManager->>HSRAccountSwitcher: close_game_if_needed()
    HSRManager->>HSRAccountSwitcher: restore_game_resolution_if_needed(runtime, append_log)
    HSRManager->>ExternalLockManager: _release_external_path_lock()
    HSRManager->>HSRManager: final_task()
Loading

File-Level Changes

Change Details Files
重新设计 HSR 用户编辑 UI,以支持 MAS 托管模式 vs 直控模式、动态任务配置、按引擎的原生关卡选项以及 SRA 专属凭据,同时移除旧版深渊/月度 UI。
  • 面包屑现在通过 scriptId 链接回 HSR 脚本编辑路由
  • 在用户编辑表单顶部引入 capability 快照警告和信息提示
  • 用开关替换 Info.Status 选择器,并将 SRA Id/Password 移入受控制模式和 effectiveEngines 控制的 SRA 专区
  • 将 Info.Notes 改为 textarea,并新增控制模式选择器(managed/direct),带上下文提示
  • 移除静态每日/每周/每月任务区块和三深渊 UI,改用 StageConfigSection、ManagedTaskSection 和 DirectControlSection,并按 controlMode 分组展示内容
  • 新增响应式 formData 结构,包括 SRA、Control、Managed、Direct 以及更新后的 Stage 字段,用于按引擎存储 JSON
  • 集成 useHSRPluginApi 和 capabilityView 辅助函数,用于推导 effectiveEngines 和托管配置快照
  • 实现托管任务开关、任务映射、动态字段更新、直控引擎切换、直控配置导入以及打开原生配置器的处理逻辑
  • 更新关卡选项加载逻辑,使用新的 HSRPlugin API,根据每个用户的引擎槽位和转换后的 payload 加载
  • 确保 SRA 凭据在新的 SRA 分组和旧的 Info.Id/Password 之间保持镜像,以兼容旧版,并更新用户加载/保存逻辑
  • 调整进度/重置区块,只在托管模式下显示,并移除深渊月度进度字段
  • 微调样式以实现平铺的表单区块,并移除过时的 weekly-subblock 和 strategy-warning 样式
frontend/src/views/EditView/User/HSRUserEdit.vue
frontend/src/views/HSRUserEdit/StageConfigSection.vue
frontend/src/views/HSRUserEdit/types.ts
frontend/src/views/HSRUserEdit/capabilityView.ts
frontend/src/views/EditView/User/HSRUserEdit/ManagedTaskSection.vue
frontend/src/views/EditView/User/HSRUserEdit/DirectControlSection.vue
frontend/src/views/EditView/User/HSRUserEdit/DynamicManagedFields.vue
新增后端 HSR API 和基础设施,用于 capabilities、托管配置发现、原生配置器生命周期、直控配置导入以及安全的外部路径锁,同时提供旧版 dev 兼容垫片。
  • 定义 HSRConfigurator 会话注册表和辅助函数,用于关闭/监控会话以及释放外部路径锁,并在路由关闭钩子中进行清理
  • 新增辅助函数 _hsr_script_config 和 _hsr_user_config,用于验证脚本/用户 id 是否为 HSR 类型
  • 扩展 import_m7a_abyss_snapshot,使用新辅助函数、M7A.Path 回退、外部路径锁和标准化用户 id 处理,并改进错误码
  • 增强 get_hsr_stage_options_api,通过 _hsr_script_config/_hsr_user_config 验证脚本和可选用户 id,并优化错误处理
  • 新增 /hsr/capabilities 端点,检查原生适配器、候选/已配置/生效的引擎、任务模块,并构建 HSRCapabilitiesOut 快照
  • 新增 /hsr/managed-config 端点,使用 managed_config 辅助函数读取原生 M7A/SRA 配置,合并脚本级和用户级 TaskMapping,并返回按引擎划分的表单和警告
  • 新增 /hsr/native-configs、/hsr/native-config/status、/hsr/native-config/open 和 /hsr/native-config/stop 端点,用于检查和控制原生配置器进程,并加上外部路径锁
  • 新增 /hsr/direct-config/import 端点,以获取外部锁、导出原生配置快照、加密并存储到 HSRUser.Direct,并返回元数据
  • 在应用生命周期的 shutdown 阶段集成 close_hsr_configurator_sessions
  • 定义 external_locks 辅助函数,用于规范化外部路径、解析脚本引擎根路径,并实现具有等待/非等待语义的 HSRExternalPathLockLease
app/api/scripts.py
app/task/HSR/tools/external_locks.py
main.py
重构 M7A 和 SRA 运行时/配置处理,以支持动态托管选项、养成目标覆盖层、兑换码策略、按引擎的关卡容器以及直控原生配置执行。
  • 在 m7a_config 中新增 managed_modules_for_key 和 resolve_managed_options,用于将原生 M7A key 映射到 MAS 任务模块,并通过类型检查叠加用户 Managed.Options
  • 扩展每日补丁构建器,加入养成目标配置、build_target_* 字段,并将 script_config/user_config 传入 _apply_managed_patch
  • 重写 build_receive_rewards_patch,使其接收 script_config/redeem_codes_enabled,从 M7AReceiveRewards 配置中推导布尔值,应用托管补丁,然后根据策略重新限定 power/echo/build_target/cloud_game 和 reward_redemption_code_enable
  • 更新 divergent-universe 和 currency-wars 补丁构建器,从脚本级 M7ADivergentUniverse/M7ACurrencyWars 选项中读取配置,并应用托管补丁白名单
  • 简化深渊快照读取,仅保留旧版导入,缩窄 key 集,并移除运行时深渊补丁构建器
  • 在 sra_runtime 中新增辅助函数,用于读取脚本/用户选项(包括新的 SRADivergentUniverse/SRACurrencyWars/SRAReceiveRewards),叠加原生配置与 Managed.Options,并调整任务配置区块
  • 更新 SRA 启动游戏的凭据解析逻辑,优先使用 SRA 分组,回退到 Info,并通过 resolve_sra_profile 读取 SRA.Path/SRA.Config
  • 实现 run_sra_config,通过内联 run 命令对给定配置路径执行 SRA-cli,并返回 SRACommandResult
  • 调整开拓任务列表构建逻辑,使用按引擎的原生关卡读取器,并改进货币战争策略解析,优先使用 SRA.Path 或 Info.SRAPath
  • 修改 stage_runtime,从新的按引擎版本存储(byEngine)中选择关卡 payload,并更新原生关卡读取器以接受 engine 参数
app/task/HSR/tools/m7a_config.py
app/task/HSR/tools/sra_runtime.py
app/task/HSR/tools/stage_runtime.py
app/task/HSR/tools/stage_provider.py
扩展 HSR schema 和 ConfigBase,用于控制、托管选项、直控快照、动态适配器配置以及更新的通知机制,同时废弃月度/深渊标签。
  • 在 HSRConfig_Game 中新增 Backend、ForceResolution1920x1080 和 RedeemCodesOnlyWhenChanged 字段
  • 引入 HSRConfig_Control、HSRConfig_SRA、HSRConfig_M7A、HSRConfig_CultivationTarget,以及用于领取奖励、异界宇宙和货币战争的 SRA/M7A 子配置
  • 扩展 HSRConfig,纳入新的控制、适配器和动态选项分组
  • 新增 SRA 用户账号视图(HSRUserConfig_SRA)以及用户级 Control/Managed/Direct 视图,包括 SRARedeemCodeFingerprint/M7ARedeemCodeFingerprint 和 Notify.CustomWebhooks
  • 更新 HSRUserConfig,加入 SRA、Control、Managed、Direct 和 HSRUserConfig_Notify.CustomWebhooks
  • 引入 HSRNativeControlSnapshot、HSRCapability* 模型、HSRManagedField/Form/Task/Config 模型,以及原生配置/直控配置 API 输入/输出模型
  • 扩展 HSRUserConfig 的标签计算逻辑,移除深渊月度标签,仅保留每周/每日状态
  • 增强后端 ConfigBase 对 HSRUserConfig 的支持,包括新的 SRA_Id/SRA_Password,Control/Managed/Direct 条目、兑换码指纹、脚本级 Control/SRA/M7A 分组、动态 SRA/M7A 选项条目、Game backend/分辨率/兑换策略,以及 CultivationTarget 设置
app/models/schema.py
app/models/config.py
更新 AutoProxy 的 HSR manager 和运行模型,以支持新的托管选项、兑换码变更策略、控制模式、直控原生会话、外部路径锁和分辨率覆盖,同时移除月度/深渊流程。
  • 修改 PHASE_TIMEOUT_CONFIG 和 MODULE_KEYS_BY_PHASE,移除月度阶段和深渊模块
  • 删除深渊完成队列和跳过逻辑,仅保留每日/每周周期标记
  • 在 AutoProxy 中新增托管选项缓存和辅助函数,通过 list_managed_modules 读取动态托管字段值,并按引擎推导养成/活动标志以及兑换码策略
  • 将兑换码指纹集成到 ReceiveRewards 条目中,在成功后更新用户 Data 中的 SRARedeemCodeFingerprint/M7ARedeemCodeFingerprint
  • 确保每日可执行部分结合养成目标和原生活动开关,以支持仅周末或仅活动运行模式
  • 更新运行队列和重试逻辑,仅处理每日和每周阶段
  • 重构 HSR manager,使其使用 resolve_script_path/native_provider/resolve_user_control,校验直控模式用户,并在直控用户场景下跳过 MAS 模块队列
  • 实现 _run_direct_user,通过 MAS 启动游戏,然后基于用户 Direct 配置开启按引擎的原生直控会话(SRA 或 M7A),记录结果,并遵守超时/取消规则
  • 在 prepare() 中加入外部路径锁获取逻辑,在锁定期间备份配置并禁用 SRA Windows 通知,并在 final_task 中协调释放锁、恢复配置和分辨率
  • 在 manager 的 final_task 和运行模型状态中集成 restore_game_resolution_if_needed 和分辨率覆盖生命周期
app/task/HSR/AutoProxy.py
app/task/HSR/manager.py
app/task/HSR/tools/run_model.py
app/task/HSR/ManualReview.py
app/task/HSR/tools/account_switch.py
app/task/HSR/tools/notify.py
重构 HSR 脚本编辑 UI,聚焦引擎/游戏配置,引入 capability 警告,并增加游戏分辨率和兑换码策略,同时移除任务映射和月度超时设置。
  • 新增 capability 快照警告,以及关于运行模式迁移到用户配置的提示信息
  • 明确引擎路径提示,并将路径布局调整为简化的脚本/游戏配置区块
  • 新增 Game.ForceResolution1920x1080 和 Game.RedeemCodesOnlyWhenChanged 开关,并使用标签说明其运行时行为
  • 删除 MonthlyTimeLimit 字段、模块 TaskMapping 和每周策略 UI,将任务映射迁移到用户托管配置
  • 将 HSRScriptEdit 接入 useHSRPluginApi,用于加载 capabilities,并在 capability 端点失败时推导已配置引擎
  • 更新 hsrConfig,加入新的 Game 字段,并在客户端模型和 reconciler 中移除 TaskMapping
  • 调整路径选择和清空逻辑,使用新的 Info/M7A/SRA 分组,而不触碰用户任务映射
frontend/src/views/EditView/Script/HSRScriptEdit.vue
移除 M7A 深渊导入 UI 和用户 API 辅助函数,仅保留后端旧版导入支持,并简化用户计数标签。
  • 删除前端 AbyssConfigSection 组件及其在 HSRUserEdit 中的使用
  • 移除 parseAbyssSnapshots、HSRAbyssKey 类型、abyssSnapshotsReady、abyssCompletedThisMonth、markAbyssCompleted、resetAbyssProgress 及相关 UI
  • 删除用户 API 中的 importM7aAbyssSnapshot 辅助函数及相关日志
  • 简化 getTags,移除深渊月度完成标签
frontend/src/views/HSRUserEdit/AbyssConfigSection.vue
frontend/src/views/HSRUserEdit/snapshot.ts
frontend/src/composables/useUserApi.ts
app/models/config.py

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 来随时(重新)生成摘要。
  • 生成评审者指南: 在 Pull Request 上评论 @sourcery-ai guide,即可随时(重新)生成评审者指南。
  • 解决所有 Sourcery 评论: 在 Pull Request 上评论 @sourcery-ai resolve,以标记所有 Sourcery 评论为已解决。如果你已经处理完所有评论、且不想再看到它们,这会很有用。
  • 忽略所有 Sourcery 评审: 在 Pull Request 上评论 @sourcery-ai dismiss,以忽略所有现有的 Sourcery 评审。尤其适用于你希望从一个全新的评审开始——别忘了评论 @sourcery-ai review 来触发新的评审!

Customizing Your Experience

访问你的 dashboard 来:

  • 启用或禁用评审特性,例如 Sourcery 生成的 Pull Request 摘要、评审者指南等。
  • 更改评审语言。
  • 添加、移除或编辑自定义评审说明。
  • 调整其他评审设置。

Getting Help

Original review guide in English

Reviewer's Guide

Migrates HSR MAS managed/direct control UX from the plugin host into old dev, adding capability/managed-config/native-control APIs, dynamic task fields, direct control sessions, and front-end user/script editors for control modes, while deprecating monthly abyss flow and wiring new game resolution and redeem-code policies.

Sequence diagram for HSR direct control execution flow

sequenceDiagram
    participant HSRManager
    participant AutoProxy
    participant ExternalLockManager
    participant HSRAccountSwitcher
    participant NativeProvider
    participant DirectSession
    participant GameProcess

    HSRManager->>HSRManager: prepare()
    HSRManager->>ExternalLockManager: resolve_external_lock_paths(script_config, ("SRA","M7A"))
    HSRManager->>ExternalLockManager: acquire_external_path_locks(paths, wait=False)
    HSRManager->>HSRManager: _backup_external_configs()

    HSRManager->>AutoProxy: main_task()
    AutoProxy->>AutoProxy: resolve_user_control(user_config, script_config)
    AutoProxy->>HSRAccountSwitcher: ensure_game_started_by_mas()
    HSRAccountSwitcher->>HSRAccountSwitcher: prepare_game_resolution_if_needed(runtime, script_config, append_log)
    HSRAccountSwitcher->>GameProcess: start_game()

    AutoProxy->>NativeProvider: native_provider(engine)
    AutoProxy->>NativeProvider: open_direct_session(script_config, config_content, session_id, log)
    NativeProvider-->>DirectSession: SRADirectControlSession/M7ADirectControlSession
    AutoProxy->>DirectSession: run(timeout_seconds)
    DirectSession-->>AutoProxy: HSRRunResult

    AutoProxy->>DirectSession: close()
    HSRManager->>HSRAccountSwitcher: close_game_if_needed()
    HSRManager->>HSRAccountSwitcher: restore_game_resolution_if_needed(runtime, append_log)
    HSRManager->>ExternalLockManager: _release_external_path_lock()
    HSRManager->>HSRManager: final_task()
Loading

File-Level Changes

Change Details Files
Reworked HSR user edit UI to support MAS-managed vs direct control modes, dynamic task configuration, native stage options per engine, and SRA-specific credentials while removing legacy abyss/monthly UI.
  • Breadcrumb now links back to the HSR script edit route using scriptId
  • Introduced capability snapshot warnings and info alerts at the top of the user edit form
  • Replaced Info.Status select with a switch and moved SRA Id/Password into a dedicated SRA section gated by control mode and effectiveEngines
  • Changed Info.Notes to a textarea and added a control mode selector (managed/direct) with contextual alerts
  • Removed static daily/weekly/monthly task sections and three-abyss UI in favor of StageConfigSection, ManagedTaskSection, and DirectControlSection grouped under controlMode content
  • Added new reactive formData structure including SRA, Control, Managed, Direct, and updated Stage fields for per-engine JSON storage
  • Integrated useHSRPluginApi and capabilityView helpers to derive effectiveEngines and managed configuration snapshot
  • Implemented handlers for managed task switches, task mapping, dynamic field updates, direct engine toggles, direct config import, and native configurator opening
  • Updated stage options loading to use the new HSRPlugin API with per-user engine slot and transformed payload
  • Ensured SRA credentials are mirrored between new SRA group and legacy Info.Id/Password for backwards compatibility and updated user load/save logic
  • Adjusted progress/reset section to be shown only in managed mode and removed abyss monthly progress fields
  • Tweaked styling for flat form sections and removed obsolete weekly-subblock and strategy-warning styles
frontend/src/views/EditView/User/HSRUserEdit.vue
frontend/src/views/HSRUserEdit/StageConfigSection.vue
frontend/src/views/HSRUserEdit/types.ts
frontend/src/views/HSRUserEdit/capabilityView.ts
frontend/src/views/EditView/User/HSRUserEdit/ManagedTaskSection.vue
frontend/src/views/EditView/User/HSRUserEdit/DirectControlSection.vue
frontend/src/views/EditView/User/HSRUserEdit/DynamicManagedFields.vue
Added backend HSR APIs and infrastructure for capabilities, managed-config discovery, native configurator lifecycle, direct config import, and safe external path locking, including old-dev compatibility shims.
  • Defined HSRConfigurator session registries and helpers for closing/watching sessions and releasing external path locks, with router shutdown hook to clean them up
  • Introduced helper functions _hsr_script_config and _hsr_user_config to validate script/user ids as HSR types
  • Extended import_m7a_abyss_snapshot to use new helpers, M7A.Path fallback, external path locks, and canonical user id handling with better error codes
  • Enhanced get_hsr_stage_options_api to validate script and optional user id via _hsr_script_config/_hsr_user_config and refined error handling
  • Added /hsr/capabilities endpoint that inspects native adapters, candidate/configured/effective engines, task modules, and builds a HSRCapabilitiesOut snapshot
  • Added /hsr/managed-config endpoint that reads native M7A/SRA configs via managed_config helpers, merges script-level and user-level TaskMapping, and returns per-engine forms and warnings
  • Added /hsr/native-configs, /hsr/native-config/status, /hsr/native-config/open, and /hsr/native-config/stop endpoints to inspect and control native configurator processes, with external path locking
  • Added /hsr/direct-config/import endpoint to acquire external locks, export native config snapshots, encrypt and store them in HSRUser.Direct, and return metadata
  • Integrated close_hsr_configurator_sessions into application lifespan shutdown
  • Defined external_locks helpers to normalize external paths, resolve script engine roots, and implement HSRExternalPathLockLease with wait/non-wait semantics
app/api/scripts.py
app/task/HSR/tools/external_locks.py
main.py
Refactored M7A and SRA runtime/config handling to support dynamic managed options, cultivation target overlays, redeem-code policies, per-engine stage containers, and direct native config execution.
  • Added managed_modules_for_key and resolve_managed_options in m7a_config to map native M7A keys to MAS task modules and overlay user Managed.Options with type checks
  • Extended daily patch builder to include cultivation target config, build_target_* fields, and pass script_config/user_config into _apply_managed_patch
  • Reworked build_receive_rewards_patch to take script_config/redeem_codes_enabled, derive booleans from M7AReceiveRewards config, apply managed patch, then re-clamp power/echo/build_target/cloud_game and reward_redemption_code_enable based on policy
  • Updated divergent-universe and currency-wars patch builders to read script-level M7ADivergentUniverse/M7ACurrencyWars options and apply managed patch whitelist
  • Simplified abyss snapshot reading to legacy-only import with narrower keyset and removed runtime abyss patch builders
  • In sra_runtime, added helpers to read script/user options (including new SRADivergentUniverse/SRACurrencyWars/SRAReceiveRewards), overlay native config with Managed.Options, and adjust task config sections
  • Updated SRA start-game credential resolution to prefer SRA group but fall back to Info, and read SRA.Path/SRA.Config via resolve_sra_profile
  • Implemented run_sra_config to execute SRA-cli with an inline run command against a given config path and return SRACommandResult
  • Adjusted trailblaze tasklist building to use per-engine native stage readers and improved currency wars strategy resolution to use SRA.Path or Info.SRAPath
  • Modified stage_runtime to select per-engine stage payloads from new versioned storage (byEngine) and updated native stage readers to accept engine parameter
app/task/HSR/tools/m7a_config.py
app/task/HSR/tools/sra_runtime.py
app/task/HSR/tools/stage_runtime.py
app/task/HSR/tools/stage_provider.py
Extended HSR schema and ConfigBase for control, managed options, direct snapshots, dynamic adapter configuration, and updated notifications, while deprecating monthly/abyss tags.
  • Added new HSRConfig_Game fields for Backend, ForceResolution1920x1080, and RedeemCodesOnlyWhenChanged
  • Introduced HSRConfig_Control, HSRConfig_SRA, HSRConfig_M7A, HSRConfig_CultivationTarget, plus SRA/M7A sub-configs for receive rewards, divergent universe, and currency wars
  • Extended HSRConfig to include new control, adapter, and dynamic option groups
  • Added SRA user account view (HSRUserConfig_SRA) and Control/Managed/Direct views for users, including SRARedeemCodeFingerprint/M7ARedeemCodeFingerprint and Notify.CustomWebhooks
  • Updated HSRUserConfig to include SRA, Control, Managed, Direct, and HSRUserConfig_Notify.CustomWebhooks
  • Introduced HSRNativeControlSnapshot, HSRCapability* models, HSRManagedField/Form/Task/Config models, native-config/direct-config API in/out models
  • Extended HSRUserConfig tag computation to drop abyss monthly tag and keep weekly/daily status
  • Augmented backend ConfigBase for HSRUserConfig with new SRA_Id/SRA_Password, Control/Managed/Direct items, redeem code fingerprints, script Control/SRA/M7A groups, dynamic SRA/M7A option items, Game backend/resolution/redeem policy, and CultivationTarget settings
app/models/schema.py
app/models/config.py
Updated AutoProxy HSR manager and run model to honor new managed options, redeem-code change policy, control modes, direct native sessions, external path locks, and resolution override while removing monthly/abyss flows.
  • Changed PHASE_TIMEOUT_CONFIG and MODULE_KEYS_BY_PHASE to drop monthly phase and abyss module
  • Removed abyss completion queueing and skip logic, keeping only daily/weekly period markers
  • Added managed options cache and helpers in AutoProxy to read dynamic managed field values via list_managed_modules and to derive cultivation/activity flags and redeem-code policy per engine
  • Integrated redeem-code fingerprinting into ReceiveRewards items, updating user Data SRARedeemCodeFingerprint/M7ARedeemCodeFingerprint on success
  • Ensured daily runnable parts consider cultivation targets and native activity enable to allow eow-only or activity-only runs
  • Updated run queue and retry logic to process only daily and weekly phases
  • Refactored HSR manager to use resolve_script_path/native_provider/resolve_user_control, validate direct mode users, and skip MAS module queue for direct users
  • Implemented _run_direct_user to start game via MAS, then open per-engine native direct sessions (SRA or M7A) with user Direct config, log results, and respect timeouts/cancellation
  • Added external path lock acquisition in prepare(), backing up configs and disabling SRA Windows notifications under lock, with coordinated release in final_task after restoring configs and resolution
  • Integrated restore_game_resolution_if_needed and resolution override lifecycle into manager final_task and run model state
app/task/HSR/AutoProxy.py
app/task/HSR/manager.py
app/task/HSR/tools/run_model.py
app/task/HSR/ManualReview.py
app/task/HSR/tools/account_switch.py
app/task/HSR/tools/notify.py
Refactored HSR script edit UI to focus on engine/game configuration, introduce capability warnings, and add game resolution and redeem-code policies while removing task mapping and monthly timeout settings.
  • Added capability snapshot warnings and info alert about run mode moving to user config
  • Clarified engine path hint and changed path layout to simple script/game configuration section
  • Introduced Game.ForceResolution1920x1080 and Game.RedeemCodesOnlyWhenChanged switches with labels describing their runtime behavior
  • Removed MonthlyTimeLimit field and module TaskMapping and weekly strategy UI, shifting task mapping to user managed config
  • Hooked HSRScriptEdit into useHSRPluginApi to load capabilities and derive configured engines when capability endpoint fails
  • Updated hsrConfig to include new Game fields and removed TaskMapping from client-side model and reconciler
  • Adjusted path selection and clearing to use new Info/M7A/SRA groups without touching user task mapping
frontend/src/views/EditView/Script/HSRScriptEdit.vue
Removed M7A abyss import UI and user API helper, keeping only backend legacy import support, and simplified user count tags.
  • Deleted frontend AbyssConfigSection component and its usage from HSRUserEdit
  • Removed parseAbyssSnapshots, HSRAbyssKey types, abyssSnapshotsReady, abyssCompletedThisMonth, markAbyssCompleted, resetAbyssProgress, and related UI
  • Dropped user API importM7aAbyssSnapshot helper and associated logging
  • Simplified getTags to remove monthly abyss completion tag
frontend/src/views/HSRUserEdit/AbyssConfigSection.vue
frontend/src/views/HSRUserEdit/snapshot.ts
frontend/src/composables/useUserApi.ts
app/models/config.py

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

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