Skip to content

Merge:'fix/patches-4.2.6-above'| 小型更新合集#234

Merged
sunyink merged 23 commits intomainfrom
fix/patches-4.2.6-above
Mar 25, 2026
Merged

Merge:'fix/patches-4.2.6-above'| 小型更新合集#234
sunyink merged 23 commits intomainfrom
fix/patches-4.2.6-above

Conversation

@sunyink
Copy link
Copy Markdown
Owner

@sunyink sunyink commented Mar 25, 2026

Summary by Sourcery

提升全局自动化的健壮性和开发者工具体验,同时清理未使用的 Node 产物,并加强 CI 对提交元数据的处理。

New Features:

  • 添加一个基于浏览器的颜色范围选择开发工具,用于从 PNG 图像中提取 RGB/HSV/GRAY 阈值。
  • 为自动化资源引入一个默认的流水线配置文件。

Enhancements:

  • 为全局重置和导航流水线步骤增加超时时间和额外错误回退逻辑,以便恢复到已知的起始状态。
  • 通过增加基于 OCR 的检查来增强加载状态检测能力,以识别卡在 0% 进度的情况。
  • 为 AgentServer 模式下的代理初始化行为添加更清晰的注释说明。

Build:

  • 移除项目中已不再使用的 Node 包清单和锁定文件。

CI:

  • 调整安装工作流,从环境变量中读取提交信息、时间戳和 SHA,以更可靠地提取元数据。

Chores:

  • 作为配置和日常维护更新的一部分,修改多个流水线 JSON 文件和 .gitignore 文件。
Original summary in English

Summary by Sourcery

Improve global automation robustness and developer tooling, while cleaning up unused Node artifacts and hardening CI commit metadata handling.

New Features:

  • Add a browser-based color range picker devtool for extracting RGB/HSV/GRAY thresholds from PNG images.
  • Introduce a default pipeline configuration file for automation resources.

Enhancements:

  • Extend global reset and navigation pipeline steps with timeouts and additional error fallbacks to recover to known start points.
  • Enhance loading-state detection by adding OCR-based checks for stuck progress at 0%.
  • Clarify agent initialization behavior comments for AgentServer mode.

Build:

  • Remove Node package manifest and lockfile that are no longer used by the project.

CI:

  • Adjust the install workflow to read commit message, timestamp, and SHA from environment variables for more reliable metadata extraction.

Chores:

  • Touch multiple pipeline JSON and .gitignore files as part of configuration and housekeeping updates.

Summary by CodeRabbit

发布说明

  • 问题修复

    • 修复游戏导航流程中的多处问题,包括战斗结果处理和页面返回逻辑
    • 改进装备页面的路由导航
    • 优化错误恢复机制,添加多个容错路径
    • 增强加载状态检测,支持更多识别条件
  • 功能改进

    • 调整部分采集任务的执行优先级
    • 优化钓鱼流程的执行顺序
    • 优化游戏启动流程的超时设置和重试策略

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 25, 2026

Reviewer's Guide

此 PR 更新了若干自动化流水线和 CI 行为,澄清了一个与 Agent 初始化相关的注释,新增了基于浏览器的色彩范围选择开发工具,并进行了一些仓库清理(新增默认流水线配置并移除 Node 工具链)。

色彩范围选择器的图片分析与复制流程时序图

sequenceDiagram
  actor User
  participant Page as BrowserPage
  participant App as ColorRangeToolJS
  participant Canvas as HTMLCanvas

  User->>Page: 打开色彩范围提取页面
  Page->>App: 加载脚本与事件监听

  User->>Page: 点击或拖拽PNG到drop_area
  Page->>App: drop/click事件
  App->>App: 创建FileReader并读取文件
  App->>Page: FileReader.onload回调
  Page->>App: 传入图片数据URL
  App->>Page: 创建Image对象
  Page->>App: Image.onload回调
  App->>Canvas: 设置宽高并drawImage
  App->>Canvas: getImageData
  App->>App: 遍历像素(跳过非完全不透明)
  App->>App: 计算RGB_HSV_GRAY最小值与最大值
  App->>Page: 更新results_container显示各格式lower与upper

  User->>Page: 点击复制按钮
  Page->>App: copyText调用
  App->>Page: 创建隐藏textarea并执行复制
  App->>Page: 移除textarea
  App->>Page: 更新toast文本并滑入显示
  Page-->>User: 展示复制成功toast提示

  Note over App,Canvas: HSV计算中使用rgbToHsv辅助函数并映射到0-179和0-255范围
Loading

File-Level Changes

Change Details Files
通过增加超时、更丰富的错误回退以及额外的加载完成 OCR 检查,加强全局重置和加载检测流水线的健壮性。
  • Global_ToHomePage_Start 步骤中增加 8 秒超时和共享的跳转回退 on_error 处理器,使得在回到主页失败时,可以通过多个 StartGamePVP 恢复入口进行回退。
  • Global_ToHomePage_FromOther 步骤的 on_error 处理器列表扩展为同样包含这些 StartGamePVP 跳转回退条目,以保持不同入口点上的重置行为一致。
  • 在加载流程中增加针对特定 ROI 内字面量 "0%" 的 OCR 检查,使 Agent 能在继续之前检测卡在 0% 的加载卡死情况。
assets/resource/pipeline/Global.json
通过将 GitHub 上下文字段经由环境变量和 Shell 变量传递,使 install workflow 的提交元数据提取更加稳健。
  • 将 head commit 的提交信息和时间戳暴露为 RAW_COMMIT_MESSAGE / RAW_COMMIT_TIMESTAMP 环境变量,而不是在 Shell 脚本内部直接插入 GitHub 表达式。
  • 改为由这些环境变量初始化脚本中的 COMMIT_MSGCOMMIT_TIMESTAMP,并为手动触发的 workflow 提供回退逻辑。
  • COMMIT_SHA 直接使用 GITHUB_SHA 环境变量,而不是在脚本中重新插入 github.sha
.github/workflows/install.yml
澄清 Agent 入口中 Toolkit 初始化时的运行时行为。
  • 调整 Toolkit.init_option 上方的注释,说明在 AgentServer 模式下只有 set_log_dir 会生效,其他选项会被忽略,以反映上游的实际行为。
agent/main.py
新增一个独立的 Devtools HTML 页面,用于从 PNG 中交互式提取色彩范围。
  • 添加一个基于 HTML 的工具,允许用户拖拽或选择 PNG,对非透明像素进行扫描,并计算 RGB、HSV 和灰度下的最小/最大范围。
  • 包括复制到剪贴板的辅助功能、可折叠的使用说明/简介,以及复制成功时的视觉反馈,以支持流水线色彩调参工作流。
Devtools/[Devtools]color_range_picker_v2-HSVfixed.html
围绕流水线配置和 Node 工具进行了一些仓库清理工作。
  • 新增 default_pipeline.json 资源占位文件,用于流水线配置(具体内容未在 diff 中展示)。
  • 调整 .gitignore 条目(细节未展示),以与当前项目结构保持一致。
  • 移除 package.jsonpackage-lock.json,删除未使用的基于 Node 的工具或依赖。
  • “触碰”了若干流水线 JSON(Collect_*DailyEquipFishingPVPStartGame),很可能是为了与更新后的全局行为做轻微对齐(本片段中看不到具体改动)。
.gitignore
assets/resource/default_pipeline.json
assets/resource/pipeline/Collect_Launcher.json
assets/resource/pipeline/Collect_Navigation.json
assets/resource/pipeline/Daily.json
assets/resource/pipeline/Equip.json
assets/resource/pipeline/Fishing.json
assets/resource/pipeline/PVP.json
assets/resource/pipeline/StartGame.json
package.json
package-lock.json

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

This PR updates several automation pipelines and CI behavior, clarifies an agent initialization comment, adds a browser-based color range picker dev tool, and performs some repository housekeeping (new default pipeline config and Node tooling removal).

Sequence diagram for the color range picker image analysis and copy flow

sequenceDiagram
  actor User
  participant Page as BrowserPage
  participant App as ColorRangeToolJS
  participant Canvas as HTMLCanvas

  User->>Page: 打开色彩范围提取页面
  Page->>App: 加载脚本与事件监听

  User->>Page: 点击或拖拽PNG到drop_area
  Page->>App: drop/click事件
  App->>App: 创建FileReader并读取文件
  App->>Page: FileReader.onload回调
  Page->>App: 传入图片数据URL
  App->>Page: 创建Image对象
  Page->>App: Image.onload回调
  App->>Canvas: 设置宽高并drawImage
  App->>Canvas: getImageData
  App->>App: 遍历像素(跳过非完全不透明)
  App->>App: 计算RGB_HSV_GRAY最小值与最大值
  App->>Page: 更新results_container显示各格式lower与upper

  User->>Page: 点击复制按钮
  Page->>App: copyText调用
  App->>Page: 创建隐藏textarea并执行复制
  App->>Page: 移除textarea
  App->>Page: 更新toast文本并滑入显示
  Page-->>User: 展示复制成功toast提示

  Note over App,Canvas: HSV计算中使用rgbToHsv辅助函数并映射到0-179和0-255范围
Loading

File-Level Changes

Change Details Files
Harden global reset and loading detection pipelines with timeouts, richer error fallbacks, and an extra loading-completion OCR check.
  • Add an 8s timeout and shared jump-back on_error handlers to the Global_ToHomePage_Start step so failed home navigation can fall back through multiple StartGame and PVP recovery entries.
  • Extend the Global_ToHomePage_FromOther step on_error handler list with the same StartGame and PVP jump-back entries to keep reset behavior consistent across entry points.
  • Add an OCR-based check for the literal "0%" in a specific ROI to the loading sequence so the agent can detect stuck-at-0% situations before proceeding.
assets/resource/pipeline/Global.json
Make the install workflow’s commit metadata extraction more robust by routing GitHub context fields through environment variables and shell variables.
  • Expose head commit message and timestamp as RAW_COMMIT_MESSAGE/RAW_COMMIT_TIMESTAMP env vars instead of interpolating GitHub expressions directly inside the shell script.
  • Switch the script to initialize COMMIT_MSG and COMMIT_TIMESTAMP from those env vars, with fallbacks for manual workflow triggers.
  • Use the GITHUB_SHA environment variable directly for COMMIT_SHA instead of re-interpolating github.sha in the script.
.github/workflows/install.yml
Clarify runtime behavior of Toolkit initialization in the agent entrypoint.
  • Adjust the comment above Toolkit.init_option to document that in AgentServer mode only set_log_dir is honored and other options are ignored, reflecting upstream behavior.
agent/main.py
Introduce a standalone devtools HTML page for interactive color-range extraction from PNGs.
  • Add an HTML-based tool that lets users drag/drop or select a PNG, scans non-transparent pixels, and computes min/max ranges in RGB, HSV, and grayscale.
  • Include copy-to-clipboard helpers, collapsible usage/intro sections, and visual feedback for successful copies to support pipeline color tuning workflows.
Devtools/[Devtools]color_range_picker_v2-HSVfixed.html
Misc repo housekeeping around pipeline config and Node tooling.
  • Introduce a default_pipeline.json resource placeholder for pipeline configuration (content not shown in diff).
  • Adjust .gitignore entries (details not shown) to align with current project layout.
  • Remove package.json and package-lock.json, dropping unused Node-based tooling or dependencies.
  • Touch several pipeline JSONs (Collect_*, Daily, Equip, Fishing, PVP, StartGame) likely for minor alignment with the updated global behavior (exact changes not visible in this snippet).
.gitignore
assets/resource/default_pipeline.json
assets/resource/pipeline/Collect_Launcher.json
assets/resource/pipeline/Collect_Navigation.json
assets/resource/pipeline/Daily.json
assets/resource/pipeline/Equip.json
assets/resource/pipeline/Fishing.json
assets/resource/pipeline/PVP.json
assets/resource/pipeline/StartGame.json
package.json
package-lock.json

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • Devtools/[Devtools]color_range_picker_v2-HSVfixed.html is excluded by none and included by none
  • assets/resource/default_pipeline.json is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 998a3027-7b63-4adb-a7a1-805ca2bf144d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

总体概述

本次更改涉及 GitHub Actions 工作流配置优化、代码注释更新,以及多个游戏管道流程配置的调整。工作流步骤通过环境变量集中化提交信息,注释反映 AgentServer 模式的配置限制,管道配置涉及节点启用状态、执行顺序、识别逻辑和错误处理的多项修改。

变更内容

分组 / 文件 摘要
GitHub Actions 工作流
.github/workflows/install.yml
notify 任务的"提取提交信息"步骤中,通过 env 块(RAW_COMMIT_MESSAGERAW_COMMIT_TIMESTAMP)注入提交信息和时间戳到 Shell 变量,替代直接在脚本中插入 ${{ github.event.head_commit.* }} 表达式。控制流和默认值逻辑保持不变。
Python 代码注释
agent/main.py
更新 Toolkit.init_option(str(project_root)) 上方的行内注释,明确说明 AgentServer 模式下仅 set_log_dir 生效,其余上游配置被忽略。无逻辑或控制流变更。
管道节点启用状态
assets/resource/pipeline/Collect_Launcher.json
在两个管道节点中添加 "enabled": false 标记:Collect_Pack_Character_8Collect_Pack_Story_20,将其执行资格从隐式启用改为显式禁用。
收集导航流程
assets/resource/pipeline/Collect_Navigation.json
Collect_OperationsMain_Sandplaynext 序列中添加跳回恢复步骤 "[JumpBack]StartGame_PerPetTask";重新排列 Collect_OperationsMain_ToAreaMapnext 列表并添加 post_wait_freezes 守护;修改 Collect_MapLift 行为从单次延迟改为 5 次重复点击;扩展 Collect_QuickCart_TargetMapEnd 的 OCR 白名单。
日常任务配置
assets/resource/pipeline/Daily.json
移除 Daily_Busin_Claim 内分支层级的 target_offset 数组,添加顶层 target_offset: [0, -5, 0, 0],将点击偏移从条件分支级别提升至 Or 动作级别。
装备页面流程
assets/resource/pipeline/Equip.json
移除三个中枢节点(Equip_HomePageHub*),直接转向目标节点;修改 Equip_Skill_Tap3post_delay 从 2000 改为 800;将 Equip_Skill_Tap3_clr 的识别逻辑从单个 ColorMatch 重构为 And 复合结构,同时包含 TemplateMatchColorMatch 子检查。
钓鱼流程
assets/resource/pipeline/Fishing.json
交换 Fishing_InMap 节点内 next 执行顺序,Fishing_MapNavigateFishing_InMap 相对位置互换。
全局流程路由
assets/resource/pipeline/Global.json
Global_ToHomePage 添加 timeout: 8000 和四个跳回错误处理目标;扩展 Global_ToSandBoxon_error 列表;为 Global_WaitingForLoading 添加 OCR 识别条件(检测 "0%" 加载标记)。
PVP 战斗流程
assets/resource/pipeline/PVP.json
PVP_BattleResultPVP_BattleLeavenext 列表中添加自身循环;修改 PVP_BackPVEPage 移除点击动作并改变 next 目标为 Global_BackToQC1;删除四个下游节点(PVP_BackHomePage2PVP_PVEBookSwipePVP_TouchPVEBookPVP_FinBackMapPage)。
游戏启动流程
assets/resource/pipeline/StartGame.json
重新排列 StartGame_TouchStart.next 中的跳回位置;将超时时间从 120000 改为 30000;在 StartGame_BackMapPage 添加 repeat: 10 并将 max_hit 从 10 改为 1;移除 StartGame_PerPetTask 的自循环并添加 max_hit: 5;修正 StartGame_AtPack_GoldenColosseum.expected 文本。

代码审查工作量评估

🎯 3 (中等) | ⏱️ ~25 分钟

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题涉及多个文件的管道配置更新、工作流改进和代码注释调整,内容广泛且具体,清晰反映了更新集合的性质。

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/patches-4.2.6-above

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - 我发现了两个问题,并给出了一些高层次的反馈:

  • 在新的颜色范围选择器 HTML 中,被注入的 Kaspersky 脚本和样式表 URL 看起来与该工具无关,可能会引入不稳定因素或安全警告;建议移除这些外部资源,并将任何必需的资源本地托管或通过可信任的 CDN 提供。
  • 在颜色范围选择器的图像分析循环中(if (a < 255) continue;;),双分号是一个小的拼写错误,而且当前的 alpha 阈值逻辑会跳过所有半透明像素;如果你的意图只是排除完全透明的区域,建议将条件改为类似 if (a === 0) continue;,以提高可读性。
给 AI 代理的提示
请根据这次代码审查中的评论进行修改:

## Overall Comments
- 在新的颜色范围选择器 HTML 中,被注入的 Kaspersky 脚本和样式表 URL 看起来与该工具无关,可能会引入不稳定因素或安全警告;建议移除这些外部资源,并将任何必需的资源本地托管或通过可信任的 CDN 提供。
- 在颜色范围选择器的图像分析循环中(`if (a < 255) continue;;`),双分号是一个小的拼写错误,而且当前的 alpha 阈值逻辑会跳过所有半透明像素;如果你的意图只是排除完全透明的区域,建议将条件改为类似 `if (a === 0) continue;`,以提高可读性。

## Individual Comments

### Comment 1
<location path="Devtools/[Devtools]color_range_picker_v2-HSVfixed.html" line_range="6" />
<code_context>
+  <script type="text/javascript" src="https://gc.kis.v2.scr.kaspersky-labs.com/FD126C42-EBFA-4E12-B309-BB3FDD723AC1/main.js?attr=7zVFCnJdYTPjwPemot87xaPkQyk5vEDqzWI0H_8Tnp_Wsv853I4OFeoHaJMfjqcsvtB1IMO-ER1cEZ5WMHY02PJeTjf3iBTdYXXy8klM9f8gwayocN7WRWEMY9qhGRwtTQI9Zld8ZXBZioAS5LCHHvwIdHDdTiyk324Y2djI-nMn0FnINE31VgaIpFjKWpm0lZSAG36NnO74ccbR_BZmohcIuOQIVgW9XNfVNCit_wt4Hu5Gpq1FlSOBpjLKdU14GhLEYOBHFjbcFCtqlS4zL-EEX0EHj2bFPZqH2BKsV2jyfcsUDhTqbMxxSl0kmyrOSZ8jEcD_yKa8mT9Dl-e-rw" charset="UTF-8"></script><link rel="stylesheet" crossorigin="anonymous" href="https://gc.kis.v2.scr.kaspersky-labs.com/E3E8934C-235A-4B0E-825A-35A08381A191/abn/main.css?attr=aHR0cHM6Ly9jb250cmlidXRpb24udXNlcmNvbnRlbnQuZ29vZ2xlLmNvbS9kb3dubG9hZD9jPUNneGlZWEprWDNOMGIzSmhaMlVTVEJJSmRHVnRjRjlrWVhSaEdqOEtNREJtTXpkaU9XTmtPVGc1T0RFek1tTXdNREEyTkRsa01USmlPV0kzT0dNMk1EWTJZemN4WVdWaU5USmtOamd3TkJJTEVnY1FzUHVsd01ZYUdBRSZmaWxlbmFtZT1jb2xvcl9yYW5nZV9waWNrZXJfZml4ZWQuaHRtbCZvcGk9MTAzMTM1MDUw"/><style>
</code_context>
<issue_to_address>
**🚨 issue (security):** 避免在本地开发工具页面中提交第三方注入的 Kaspersky 脚本/CSS。

这些由 Kaspersky 托管的资源看起来更像是杀毒软件注入的,而不是有意添加的。它们会引入不必要的外部依赖和潜在的跟踪行为,所以请将它们移除,并在此页面上仅保留本地可控的资源。
</issue_to_address>

### Comment 2
<location path="Devtools/[Devtools]color_range_picker_v2-HSVfixed.html" line_range="329-337" />
<code_context>
+    return { h: Math.round(h * 179), s: Math.round(s * 255), v: Math.round(v * 255) };
+  }
+
+  function copyText(text, btn) {
+    const textarea = document.createElement('textarea');
+    textarea.value = text;
+    document.body.appendChild(textarea);
+    textarea.select();
+    document.execCommand('copy');
+    document.body.removeChild(textarea);
+    showToast(text);
</code_context>
<issue_to_address>
**suggestion:** 考虑使用现代的 Clipboard API 来替代已弃用的 `document.execCommand('copy')``execCommand('copy')` 已被弃用,并且在所有浏览器中可能都无法可靠工作。优先在可用时使用 `navigator.clipboard.writeText(text)`,并在此基础上保留该 textarea 方案作为回退,同时对剪贴板/权限失败场景进行显式处理。

```suggestion
  async function copyText(text, btn) {
    const fallbackCopy = () => {
      const textarea = document.createElement('textarea');
      textarea.value = text;
      textarea.style.position = 'fixed';
      textarea.style.top = '-9999px';
      document.body.appendChild(textarea);
      textarea.focus();
      textarea.select();
      let success = false;
      try {
        success = document.execCommand('copy');
      } catch (err) {
        success = false;
      }
      document.body.removeChild(textarea);
      return success;
    };

    let copied = false;

    if (navigator.clipboard && navigator.clipboard.writeText) {
      try {
        await navigator.clipboard.writeText(text);
        copied = true;
      } catch (err) {
        // fall back to textarea method
        copied = fallbackCopy();
      }
    } else {
      copied = fallbackCopy();
    }

    if (copied) {
      showToast(text);
    } else {
      console.error('Failed to copy text to clipboard:', text);
      showToast('Failed to copy to clipboard');
    }
  }
```
</issue_to_address>

Sourcery 对开源项目免费——如果你觉得这些审查有帮助,请考虑分享 ✨
帮我变得更有用!请对每条评论点 👍 或 👎,我会根据反馈改进后续的审查。
Original comment in English

Hey - I've found 2 issues, and left some high level feedback:

  • In the new color range picker HTML, the injected Kaspersky script and stylesheet URLs look unrelated to the tool and could introduce instability or security warnings; consider removing those external resources and hosting any required assets locally or via trusted CDNs.
  • In the image analysis loop of the color range picker (if (a < 255) continue;;), the double semicolon is a minor typo and the alpha-threshold logic currently skips any semi-transparent pixel; if your intent is only to exclude fully transparent areas, consider changing the condition to something like if (a === 0) continue; for clarity.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the new color range picker HTML, the injected Kaspersky script and stylesheet URLs look unrelated to the tool and could introduce instability or security warnings; consider removing those external resources and hosting any required assets locally or via trusted CDNs.
- In the image analysis loop of the color range picker (`if (a < 255) continue;;`), the double semicolon is a minor typo and the alpha-threshold logic currently skips any semi-transparent pixel; if your intent is only to exclude fully transparent areas, consider changing the condition to something like `if (a === 0) continue;` for clarity.

## Individual Comments

### Comment 1
<location path="Devtools/[Devtools]color_range_picker_v2-HSVfixed.html" line_range="6" />
<code_context>
+  <script type="text/javascript" src="https://gc.kis.v2.scr.kaspersky-labs.com/FD126C42-EBFA-4E12-B309-BB3FDD723AC1/main.js?attr=7zVFCnJdYTPjwPemot87xaPkQyk5vEDqzWI0H_8Tnp_Wsv853I4OFeoHaJMfjqcsvtB1IMO-ER1cEZ5WMHY02PJeTjf3iBTdYXXy8klM9f8gwayocN7WRWEMY9qhGRwtTQI9Zld8ZXBZioAS5LCHHvwIdHDdTiyk324Y2djI-nMn0FnINE31VgaIpFjKWpm0lZSAG36NnO74ccbR_BZmohcIuOQIVgW9XNfVNCit_wt4Hu5Gpq1FlSOBpjLKdU14GhLEYOBHFjbcFCtqlS4zL-EEX0EHj2bFPZqH2BKsV2jyfcsUDhTqbMxxSl0kmyrOSZ8jEcD_yKa8mT9Dl-e-rw" charset="UTF-8"></script><link rel="stylesheet" crossorigin="anonymous" href="https://gc.kis.v2.scr.kaspersky-labs.com/E3E8934C-235A-4B0E-825A-35A08381A191/abn/main.css?attr=aHR0cHM6Ly9jb250cmlidXRpb24udXNlcmNvbnRlbnQuZ29vZ2xlLmNvbS9kb3dubG9hZD9jPUNneGlZWEprWDNOMGIzSmhaMlVTVEJJSmRHVnRjRjlrWVhSaEdqOEtNREJtTXpkaU9XTmtPVGc1T0RFek1tTXdNREEyTkRsa01USmlPV0kzT0dNMk1EWTJZemN4WVdWaU5USmtOamd3TkJJTEVnY1FzUHVsd01ZYUdBRSZmaWxlbmFtZT1jb2xvcl9yYW5nZV9waWNrZXJfZml4ZWQuaHRtbCZvcGk9MTAzMTM1MDUw"/><style>
</code_context>
<issue_to_address>
**🚨 issue (security):** Avoid committing third-party injected Kaspersky script/CSS for a local devtool page.

These Kaspersky-hosted resources appear to be AV-injected rather than intentional. They introduce unnecessary external dependencies and potential tracking, so please remove them and keep only locally controlled assets on this page.
</issue_to_address>

### Comment 2
<location path="Devtools/[Devtools]color_range_picker_v2-HSVfixed.html" line_range="329-337" />
<code_context>
+    return { h: Math.round(h * 179), s: Math.round(s * 255), v: Math.round(v * 255) };
+  }
+
+  function copyText(text, btn) {
+    const textarea = document.createElement('textarea');
+    textarea.value = text;
+    document.body.appendChild(textarea);
+    textarea.select();
+    document.execCommand('copy');
+    document.body.removeChild(textarea);
+    showToast(text);
</code_context>
<issue_to_address>
**suggestion:** Consider using the modern Clipboard API instead of the deprecated `document.execCommand('copy')`.

`execCommand('copy')` is deprecated and may not work reliably in all browsers. Prefer `navigator.clipboard.writeText(text)` when available, with a fallback to this textarea approach and explicit handling of clipboard/permission failures.

```suggestion
  async function copyText(text, btn) {
    const fallbackCopy = () => {
      const textarea = document.createElement('textarea');
      textarea.value = text;
      textarea.style.position = 'fixed';
      textarea.style.top = '-9999px';
      document.body.appendChild(textarea);
      textarea.focus();
      textarea.select();
      let success = false;
      try {
        success = document.execCommand('copy');
      } catch (err) {
        success = false;
      }
      document.body.removeChild(textarea);
      return success;
    };

    let copied = false;

    if (navigator.clipboard && navigator.clipboard.writeText) {
      try {
        await navigator.clipboard.writeText(text);
        copied = true;
      } catch (err) {
        // fall back to textarea method
        copied = fallbackCopy();
      }
    } else {
      copied = fallbackCopy();
    }

    if (copied) {
      showToast(text);
    } else {
      console.error('Failed to copy text to clipboard:', text);
      showToast('Failed to copy to clipboard');
    }
  }
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
assets/resource/pipeline/Global.json (1)

1-603: ⚠️ Potential issue | 🔴 Critical

确认:Pipeline 加载失败,Global_null 节点未定义

Global_null 被引用于 assets/resource/default_pipeline.json 但在任何 pipeline JSON 文件中均未定义。

需修复:

  • 在相应的 pipeline 文件中定义 Global_null 节点,或
  • default_pipeline.json 中修正指向该节点的所有引用
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@assets/resource/pipeline/Global.json` around lines 1 - 603, The pipeline
fails because the node identifier "Global_null" is referenced but not defined;
locate all references to "Global_null" (e.g., in default_pipeline.json) and
either add a new node definition named "Global_null" in the pipeline JSON (use
the same structure as existing nodes like "Global_Index") or update those
references to point to an existing defined node (for example replace with
"Global_Index" or another appropriate node); ensure the new/updated node
includes required fields (recognition/action/next/doc or a minimal stub) and
validate the JSON after changes.
🧹 Nitpick comments (2)
assets/resource/pipeline/Global.json (1)

584-595: 新增 OCR 识别 "0%" 加载状态

Global_WaitingForLoadingany_of 中新增 OCR 条款识别 "0%" 文本。

建议expected 字段建议使用数组格式以保持一致性:

♻️ 建议修改
             {
                 "recognition": "OCR",
                 "roi": [
                     1213,
                     658,
                     30,
                     20
                 ],
-                "expected": "0%",
+                "expected": ["0%"],
                 "only_rec": true
             }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@assets/resource/pipeline/Global.json` around lines 584 - 595, Add a new OCR
clause inside the Global_WaitingForLoading any_of array that recognizes the "0%"
loading text (use the shown recognition "OCR" and roi values) and change the
clause's expected field from a string ("0%") to an array format (e.g., ["0%"])
to match the existing expected-field convention; update the same clause
name/structure as the existing any_of entries so it is treated consistently with
other OCR checks.
assets/resource/pipeline/PVP.json (1)

886-902: PVP_BackPVEPage 重构:简化退出流程

移除了原有的点击动作和复杂的导航链(PVP_BackHomePage2PVP_PVEBookSwipePVP_TouchPVEBookPVP_FinBackMapPage),改为直接路由到通用复位节点 Global_BackToQC1

注意doc 仍为 "找到图钉-点击返回主页",但节点已不包含 action,仅作为识别节点。建议更新 doc 描述以反映实际行为:

📝 建议更新文档描述
-    "doc": "找到图钉-点击返回主页"
+    "doc": "识别图钉后,跳转到通用卡带复位流程"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@assets/resource/pipeline/PVP.json` around lines 886 - 902, The node
PVP_BackPVEPage was converted to a recognition-only node (no "action" and it now
routes directly to Global_BackToQC1) but its "doc" still says "找到图钉-点击返回主页";
update the "doc" for PVP_BackPVEPage to accurately describe its behavior (e.g.,
"识别图钉并路由至通用复位节点 Global_BackToQC1(无点击动作)") so maintainers understand this is only
a detection node and not performing clicks or the previous navigation chain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@assets/resource/pipeline/Global.json`:
- Around line 1-603: The pipeline fails because the node identifier
"Global_null" is referenced but not defined; locate all references to
"Global_null" (e.g., in default_pipeline.json) and either add a new node
definition named "Global_null" in the pipeline JSON (use the same structure as
existing nodes like "Global_Index") or update those references to point to an
existing defined node (for example replace with "Global_Index" or another
appropriate node); ensure the new/updated node includes required fields
(recognition/action/next/doc or a minimal stub) and validate the JSON after
changes.

---

Nitpick comments:
In `@assets/resource/pipeline/Global.json`:
- Around line 584-595: Add a new OCR clause inside the Global_WaitingForLoading
any_of array that recognizes the "0%" loading text (use the shown recognition
"OCR" and roi values) and change the clause's expected field from a string
("0%") to an array format (e.g., ["0%"]) to match the existing expected-field
convention; update the same clause name/structure as the existing any_of entries
so it is treated consistently with other OCR checks.

In `@assets/resource/pipeline/PVP.json`:
- Around line 886-902: The node PVP_BackPVEPage was converted to a
recognition-only node (no "action" and it now routes directly to
Global_BackToQC1) but its "doc" still says "找到图钉-点击返回主页"; update the "doc" for
PVP_BackPVEPage to accurately describe its behavior (e.g., "识别图钉并路由至通用复位节点
Global_BackToQC1(无点击动作)") so maintainers understand this is only a detection
node and not performing clicks or the previous navigation chain.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ce747cd8-fba7-4aba-bab2-d84bbd12cbc0

📥 Commits

Reviewing files that changed from the base of the PR and between fbd4fb9 and e32b1b6.

⛔ Files ignored due to path filters (5)
  • .gitignore is excluded by none and included by none
  • Devtools/[Devtools]color_range_picker_v2-HSVfixed.html is excluded by none and included by none
  • assets/resource/default_pipeline.json is excluded by none and included by none
  • package-lock.json is excluded by !**/package-lock.json and included by none
  • package.json is excluded by none and included by none
📒 Files selected for processing (10)
  • .github/workflows/install.yml
  • agent/main.py
  • assets/resource/pipeline/Collect_Launcher.json
  • assets/resource/pipeline/Collect_Navigation.json
  • assets/resource/pipeline/Daily.json
  • assets/resource/pipeline/Equip.json
  • assets/resource/pipeline/Fishing.json
  • assets/resource/pipeline/Global.json
  • assets/resource/pipeline/PVP.json
  • assets/resource/pipeline/StartGame.json

@sunyink sunyink merged commit ca5c643 into main Mar 25, 2026
15 checks passed
@sunyink sunyink deleted the fix/patches-4.2.6-above branch March 25, 2026 08:07
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