npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-arknights-recruit

v0.1.0

Published

DSH 插件:明日方舟公开招募自动化 —— 侧边栏看实时画面与日志,对话里一句话启停,3星消耗1券后刷标签、4星以上拉满9小时并立即招募

Readme

dsh-arknights-recruit

DSH 插件:在 DeepSeek Harness 里刷《明日方舟》公开招募 —— 侧边栏看实时画面与日志,对话里一句话启停。

面板预览


⚠️ 先读这三条

  1. 账号风险自负。 使用自动化工具可能违反游戏用户协议,存在被封禁的风险。建议不要在高价值账号上使用。
  2. 只在本机用。 插件通过 ADB 控制你本机的安卓模拟器;它注册的前端路由只允许同源访问,但也不要把 DSH 暴露到不受信任的网络。
  3. 需要先装好 Python 依赖(见下方)。插件的界面部分很轻,真正的活在 Python 边车里。

它做什么

| 能力 | 说明 | |------|------| | 侧边栏面板 | 右下角浮动面板:实时画面、统计、启停按钮、运行日志。可拖动、可折叠,位置会记住 | | 对话里控制 | 注册了 5 个工具,你可以直接说「开始刷公招」「看看进度」「停一下」 | | 默认策略 | 保底 3 星 → 点「立即招募」消耗 1 张券、再点「停止招募」刷新标签列表;保底 4 星及以上 → 招募时限拉满 9 小时并立即招募 |

关于 3 星的规则:只有在确认招募并消耗券之后再点「停止招募」,标签列表才会刷新。直接停止而不消耗券刷不出新标签。

注册的工具

| 工具 | 作用 | |------|------| | arknights_status | 设备是否连上、游戏是否在跑、任务状态、统计计数、数据文件是否就绪 | | arknights_connect | 重新探测模拟器与数据文件(显示「设备未连接」时用) | | arknights_start | 开始刷(可选:三星也招募 / 最大轮数 / 仅识别不点击) | | arknights_stop | 请求停止(会把当前槽位做完再退,不会把游戏停在半个操作上) | | arknights_logs | 看最近运行日志,排查「为什么没招募」「为什么卡住」 |


安装

1. 安装插件

npm install -g dsh-arknights-recruit

或者从 DSH 的插件市场里搜索安装。

2. 装 Python 边车依赖

插件的自动化逻辑是一个 Python 进程,需要这些依赖:

pip install -r "$(npm root -g)/dsh-arknights-recruit/sidecar/requirements.txt"

如果 pip 不在 PATH,可以在插件面板上点「重连」,失败信息里会写明缺哪个包。

3. 准备模拟器

| 要求 | 说明 | |------|------| | 模拟器 | MuMu 12 / 雷电 / BlueStacks 等支持 ADB 调试的安卓模拟器 | | 分辨率 | 必须是 16:9(如 1920×1080)。游戏只支持 16:9 | | 游戏 | 已安装并已登录《明日方舟》 |

改分辨率(MuMu 12 示例):

adb connect 127.0.0.1:16384
adb -s 127.0.0.1:16384 shell wm size 1920x1080

4. 数据文件

星级判定需要一份「干员 / 标签」数据表。插件按以下顺序自动查找:

  1. 环境变量 RECRUIT_DATA 指向的 JSON
  2. 已安装的 MAA 的 resource/recruitment.json(D:\MAA、C:\MAA、~/MAA 等常见位置)

本项目不打包该数据文件,请从你已安装的 MAA 获取,或按 sidecar/core/recruit_calc.py 顶部注释里的格式自行准备。


用法

装好后 DSH 右下角会出现面板。也可以直接在对话里说:

开始刷公招 现在进度怎么样 停一下

面板上的按钮对应同样的操作。


架构

DSH 页面
  └─ client.js …… 浮动面板(同源调用 /arknights/*)
        │
        ▼
  index.js(Host 半边)
    ├─ 5 个工具          → 模型可调用
    └─ 7 条同源路由       → 面板可调用
        │  代理
        ▼
  Python 边车(sidecar/)  ← 懒启动,首次调用时才拉起
    └─ FastAPI + ADB + RapidOCR

几个刻意的设计决定:

  • 不重写引擎。ADB 控制、OCR、星级判定那套逻辑经过大量实机验证,重写成 JS 等于把验证过的正确性丢掉。 插件只负责「拉起来、盯着它、停掉它」。
  • 边车懒启动。它要加载 Python + opencv + onnxruntime(内存不小),DSH 一启动就常驻不值得。
  • 同源路由代理。面板跑在 DSH 页面里,直接打边车的随机端口会遇到跨域、还得先知道端口; 在 DSH 自己的 webServer 上挂代理路由就没这些问题。这些路由会校验同源并拒绝跨源 POST。

开发与测试

npm test                          # 边车生命周期 + 各 API
node test/test-tools.mjs          # 工具注册 + 路由 + 错误路径
node test/harness.mjs 8931        # 起一个不依赖 DSH 的测试宿主,浏览器打开看面板

test/harness.mjs 会用真实的 index.js 和 真实的 client.js 跑起来, 所以它能验证「面板 ↔ 路由 ↔ 边车」整条链路 —— 这是在没有 DSH 的情况下能做到的最强验证。


常见问题

面板显示「设备未连接」 模拟器没启动,或者模拟器的 ADB 调试没打开。先确认模拟器里游戏已登录,再点面板上的「重连」。 手动确认:adb connect 127.0.0.1:16384 然后 adb devices。

显示「缺数据文件」 没找到 recruitment.json。装一个 MAA,或设置环境变量 RECRUIT_DATA 指向你的数据文件。

启动时报 Python 依赖缺失 按提示执行 pip install -r .../sidecar/requirements.txt。

画面有黑边 / 点击位置全偏 分辨率不是 16:9。改成 1920×1080。

识别不到标签 游戏 UI 版本更新后坐标可能失效。坐标表在 sidecar/core/recruit_engine.py 顶部, 以及 docs/OPTIMIZATION.md 里记录了当初是怎么标定的。


致谢

本项目与鹰角网络、MAA 项目均无关联。

License

MIT

免责声明:本项目仅供学习自动化技术使用。使用本工具产生的任何后果(包括但不限于账号处罚)由使用者自行承担。