dsh-checkin-all 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,12 +5,12 @@
5
5
  [![license](https://img.shields.io/npm/l/dsh-checkin-all?style=flat-square&color=green)](./LICENSE)
6
6
  [![node](https://img.shields.io/node/v/dsh-checkin-all?style=flat-square&logo=node.js)](https://nodejs.org)
7
7
  [![dsh](https://img.shields.io/badge/dsh-%E2%89%A50.2.0-4B32C3?style=flat-square)](https://github.com/deepseek-ai/dsh)
8
- [![tests](https://img.shields.io/badge/tests-124%20passing-brightgreen?style=flat-square)](./test)
9
- [![services](https://img.shields.io/badge/%E5%86%85%E7%BD%AE%E6%9C%8D%E5%8A%A1-9-2f6bff?style=flat-square)](#支持的服务)
8
+ [![tests](https://img.shields.io/badge/tests-183%20passing-brightgreen?style=flat-square)](./test)
9
+ [![services](https://img.shields.io/badge/%E5%86%85%E7%BD%AE%E6%9C%8D%E5%8A%A1-11-2f6bff?style=flat-square)](#支持的服务)
10
10
 
11
11
  **签到 / 自动签到 / 每日签到 / 打卡 / 领积分 / 多账号 / DIY 自定义签到 / DeepSeek Harness 插件**
12
12
 
13
- 每天自动给 **MiniMax Code**、**WPS 灵犀**、**百度 DuMate(搭子)**、**AStudio(星火)**、**Qoder**、**Trae**、**豆包**、**华为 CodeArts**、**腾讯 WorkBuddy** 签到领积分。
13
+ 每天自动给 **MiniMax Code**、**WPS 灵犀**、**百度 DuMate(搭子)**、**AStudio(星火)**、**Qoder**、**Trae**、**豆包**、**华为 CodeArts**、**腾讯 WorkBuddy**、**商汤小浣熊**、**天翼 AI(TeleAgent)** 签到领积分。
14
14
 
15
15
  **没在列表里的服务,可以自己 DIY 签到**——面板点「+ 添加签到服务」,让 DSH 的 AI 帮你查接口,或直接贴一份 JSON,导入就变成新卡片。
16
16
 
@@ -24,7 +24,7 @@
24
24
 
25
25
  ## 三个重点能力
26
26
 
27
- ### 1. 内置 9 个服务,开箱即用
27
+ ### 1. 内置 11 个服务,开箱即用
28
28
 
29
29
  装上就能签,凭据自动从本机 App 里读,不用手动配。详见下方「支持的服务」。
30
30
 
@@ -99,6 +99,8 @@ node bin/dsh-checkin-all.js set lingxi "<sid>" --name 小号
99
99
  | 豆包 | 登录 Cookie(面板「配置 Cookie」,或从本机豆包/浏览器读) | 额度 | ✅ | **北京时间** |
100
100
  | 华为 CodeArts | 浏览器登录(点一下授权,自动拿 AK/SK;也可手填) | 积分 | ✅ | **北京时间** |
101
101
  | 腾讯 WorkBuddy | 浏览器登录(点一下授权;也可手贴 token) | 积分 | ✅ | **北京时间** |
102
+ | 商汤小浣熊 | 点「登录」弹一个独立浏览器窗口,自己登录即自动取 token(也可手贴 Cookie) | 积分 | ✅ | **北京时间** |
103
+ | 天翼 AI(TeleAgent) | 点「登录」弹一个独立浏览器窗口,自己登录即自动取 token(也可手贴 operationToken) | 积分 | ✅ | **北京时间** |
102
104
  | **自定义服务** | 面板「添加签到服务」,AI 生成或自己贴 JSON | 自定义 | ✅ | **北京时间** |
103
105
 
104
106
  **全部服务一律按北京时间算「今天」和签到窗口,不跟随本机时区。**
@@ -191,11 +193,11 @@ node bin/dsh-checkin-all.js unset lingxi # 删除某个服务的手动凭据
191
193
 
192
194
  命令:`/checkin 状态|签到 [服务]|时间 09:00|开启|关闭|登录`(`/minimax` 是别名)
193
195
 
194
- 服务名:`minimax`(MiniMax Code)/ `lingxi`(WPS 灵犀)/ `dumate`(百度 DuMate)/ `astudio`(AStudio)/ `qoder`(Qoder)/ `trae`(Trae)/ `doubao`(豆包)/ `codearts`(华为 CodeArts)/ `buddy`(腾讯 WorkBuddy)
196
+ 服务名:`minimax`(MiniMax Code)/ `lingxi`(WPS 灵犀)/ `dumate`(百度 DuMate)/ `astudio`(AStudio)/ `qoder`(Qoder)/ `trae`(Trae)/ `doubao`(豆包)/ `codearts`(华为 CodeArts)/ `buddy`(腾讯 WorkBuddy)/ `xiaohuanxiong`(商汤小浣熊)/ `teleagent`(天翼 AI)
195
197
 
196
198
  ## 加新的签到服务(不写代码)
197
199
 
198
- 内置 9 个服务,但外面还有一堆能签到的站点。面板底部有个 **「+ 添加签到服务」**,
200
+ 内置 11 个服务,但外面还有一堆能签到的站点。面板底部有个 **「+ 添加签到服务」**,
199
201
  点开有两条路:
200
202
 
201
203
  ### 方式一:让 DSH 的 AI 帮你做(推荐)
@@ -288,7 +290,7 @@ node bin/dsh-checkin-all.js set lingxi "<另一个 wps_sid>" --name 小号
288
290
  汇总规则:任一账号签上就算 `claimed`,积分累加,连续天数取最大的那个;
289
291
  部分账号失败不影响其他账号,消息里会点名是哪个失败了。
290
292
 
291
- 支持多账号的:灵犀、DuMate、AStudio、Qoder、Trae、豆包、CodeArts、WorkBuddy。
293
+ 支持多账号的:灵犀、DuMate、AStudio、Qoder、Trae、豆包、CodeArts、WorkBuddy、小浣熊、TeleAgent。
292
294
  **MiniMax 例外**——它的凭据是 App 里的 OAuth 文件(`~/.minimax/auth/`),
293
295
  天然只有一份,且 refresh token 一次性,不适合手动塞多份 token。
294
296
 
@@ -609,9 +611,106 @@ POST {endpoint}/v2/billing/meter/get-user-resource 余额
609
611
  - 错误码:`10001`/`1001` = 今天已领;`1002` = 无资格;`1003` = 活动结束(后两个按 `no_task` 处理,不当故障重试)
610
612
  - 支持多个 token(多账号),存 `manual.buddy.accounts[]`
611
613
 
612
- > **没做的渠道**:dsh-free-model 里另有 LobsterAI、Loomy、ZCode、Cline、Raccoon、Gemini,
613
- > 但 Cline / Gemini / Raccoon / WorkBuddy 国际版**本身没有每日领取**(只有余额或额度查询),
614
+ > **没做的渠道**:dsh-free-model 里另有 LobsterAI、Loomy、ZCode、Cline、Gemini,
615
+ > 但 Cline / Gemini / WorkBuddy 国际版**本身没有每日领取**(只有余额或额度查询),
614
616
  > 另外三个需要另外的账号体系(有道 / 讯飞微信 / 智谱),本机没有登录态,没做。
617
+ > (Raccoon 就是下面的「商汤小浣熊」,已经做了。)
618
+
619
+ ### 商汤小浣熊
620
+
621
+ 商汤「小浣熊」([xiaohuanxiong.com](https://xiaohuanxiong.com))的每日积分(`lib/providers/xiaohuanxiong.js`)。
622
+
623
+ **它没有「点一下签到」的按钮**——每日积分是服务端发的:
624
+
625
+ - 每天 **00:00(北京时间)** 自动发当日额度,默认当天 24:00 清零
626
+ - **当天登录一次**,有效期就从「当天 24:00」延长到 **7 天**(这就是「打卡」的全部意义)
627
+ - 免费版 300 积分/日;个人升级版 500/日 + 10000/月;企业版 1000/日/人 + 30000/月
628
+
629
+ 所以插件的「签到」= 用你的登录态读一遍账户,确认今天的额度到账了、顺手发一次心跳续期:
630
+
631
+ ```
632
+ GET /api/web/points/v1/balance 余额(available_points / user_category)
633
+ GET /api/web/points/v2/bills?paging.limit=20&type=all 积分流水(biz_type=daily_grant / daily_expire)
634
+ POST /api/web/auth/v1/devices_current_heartbeat 登录心跳(当日登录 → 有效期延长到 7 天)
635
+ ```
636
+
637
+ 判定:流水里今天有 `biz_type=daily_grant` → `already_claimed`(已到账,不动);
638
+ 没有 → 发心跳 → 再查一次流水,到账了就 `claimed`,还没到就 `not_yet`(服务端延迟,稍后自动重试)。
639
+
640
+ **登录:点卡片上的「登录」,弹一个窗口,你自己登(`lib/providers/xiaohuanxiong-login.js`)**
641
+
642
+ 不用复制粘贴 Cookie。点「登录」之后插件会:
643
+
644
+ 1. 用**独立 profile** 起一个真的 Chrome 窗口(`~/.dsh/dsh-checkin-all/browser/xiaohuanxiong`),
645
+ 直接打开登录页 <https://xiaohuanxiong.com/login?product_code=work&redirect_url=%2Fwork%2Fhome>
646
+ (手机号 / 微信扫码都在这个页面上,登完自动回办公端)
647
+ 2. 你在那个窗口里照常登录 —— **账号密码只输给官网,插件全程不碰**
648
+ 3. 插件通过 CDP 读那个窗口里 `xiaohuanxiong.com` 域的 cookie,挑出 `xhx_token` /
649
+ `raccoon_token`,先调一次余额接口**验证真的能用**(游客 token 换不出余额,会被判为还没登录)
650
+ 4. 验证通过 → 关窗口、把凭据写进 `secrets.json`、顺手把昵称记成账号名
651
+
652
+ 窗口默认等 5 分钟;profile 会留着,下次点「登录」通常已经是登录态,一秒就取到 token。
653
+ 同一个号重复登录会覆盖原来那条账号记录,不会越登越多;**要换另一个号**,先删掉
654
+ `~/.dsh/dsh-checkin-all/browser/xiaohuanxiong` 再点「登录」(新 profile 是干净的未登录态)。
655
+
656
+ 也可以手填(不想开窗口的话):浏览器打开 xiaohuanxiong.com 登录 → 开发者工具 → Application →
657
+ Cookies → 复制 `xhx_token` 的值,粘到面板「配置凭据」。整条 Cookie 或裸 Bearer token 都认;
658
+ 旧版的 `<前缀>raccoon_token` 也认。
659
+
660
+ ```bash
661
+ dsh-checkin-all set xiaohuanxiong xhx_token的值
662
+ dsh-checkin-all set xiaohuanxiong "整条 Cookie 串" --name 主号
663
+ ```
664
+
665
+ > 为什么是「弹窗口」而不是直接读你日常浏览器的 Cookie:macOS 上读 Chrome/Edge 的 Cookies 库要过
666
+ > 沙箱和钥匙串两道(`Operation not permitted`),读不了;而且那样会把用户的浏览数据一起碰。
667
+ > 独立 profile 只装小浣熊这一件事,干净、可复用、还能随时删掉。
668
+ > 只在装了 Chrome / Edge / Brave / Chromium 的机器上可用;没有浏览器时退回手填。
669
+ > token 失效时返回 `needs_login`,面板会提示重新贴一次,不会当故障反复重试。
670
+
671
+ ### 天翼 AI(TeleAgent)
672
+
673
+ 中国电信「天翼 AI」([agent.teleai.com.cn/teleagent](https://agent.teleai.com.cn/teleagent))的每日积分
674
+ (`lib/providers/teleagent.js`)。
675
+
676
+ 它的签到在「积分福利社」里:服务端每天挂一条活动,用户点「立即领取」才到账。
677
+ 插件的流程和网页端一模一样:
678
+
679
+ ```
680
+ GET /user/portal/companyStore/userCenter 账户(current_points_balance 余额)
681
+ GET /user/portal/companyStore/v3/checkDayTask?theme=light 当日活动 activity_data[]
682
+ GET <activity.jump_url> 领取(jump_url 就是领取地址)
683
+ GET /user/portal/companyStore/checkTask 首登礼 / 月度礼
684
+ ```
685
+
686
+ - 可领判定:`action_status` ∈ `incomplete` / `not_joined` / `fixed`(和前端同一个集合)
687
+ - 领取地址:直接取 `jump_url`,把 `/superCowork/sapi` 前缀去掉后 GET(前端就是这么干的)
688
+ - `action_type === 'web'` 的活动只是跳转(不产生领取),跳过
689
+ - 接口前缀两套都试:先 `/meter/super-agent/user/portal`(web 门户),不通再退回
690
+ `/superCowork/sapi/user/portal`(桌面端)
691
+
692
+ 判定:有可领活动 → 逐个领 → 重读一次状态 → `claimed`(带本次拿到的积分);
693
+ 都已经领完 → `already_claimed`;有活动但服务端没给结果 → `not_yet`(稍后自动重试)。
694
+
695
+ **登录:和小浣熊一样,点「登录」弹窗口,你自己登**(`lib/providers/teleagent-login.js`)
696
+
697
+ 1. 用独立 profile 起一个 Chrome(`~/.dsh/dsh-checkin-all/browser/teleagent`),打开
698
+ <https://agent.teleai.com.cn/meter/teleagent-login/login>
699
+ 2. 你在窗口里照常登录(手机号 / 扫码都行,账号密码只输给官网,插件不碰)
700
+ 3. 插件通过 CDP 读那个窗口 `teleai.com.cn` 域的 cookie,挑出 `operationToken`
701
+ (读不到就读 localStorage 的 `user_token` / `sso_token` / `console_token`),
702
+ 先调一次 userCenter **验证真的能用**,通过才写进 `secrets.json`
703
+
704
+ 也可以手填:浏览器登录后开发者工具 → Application → Cookies 复制 `operationToken`,
705
+ 粘到面板「配置凭据」;整条 Cookie 或裸 token 都认。
706
+
707
+ ```bash
708
+ dsh-checkin-all set teleagent operationToken的值
709
+ dsh-checkin-all set teleagent "整条 Cookie 串" --name 主号
710
+ ```
711
+
712
+ > token 失效(HTTP 401 / `code:"4001"`)时返回 `needs_login`,面板提示重新登一次,
713
+ > 不会当故障反复重试。要换另一个号,先删掉 `~/.dsh/dsh-checkin-all/browser/teleagent` 再点「登录」。
615
714
 
616
715
  ## 隐私
617
716
 
@@ -674,7 +773,8 @@ node --test "test/*.test.js"
674
773
 
675
774
  **服务**
676
775
  `MiniMax Code` `WPS 灵犀` `百度 DuMate` `搭子` `AStudio` `星火` `Qoder` `Trae` `豆包`
677
- `华为 CodeArts` `华为云` `腾讯 WorkBuddy` `CodeBuddy`
776
+ `华为 CodeArts` `华为云` `腾讯 WorkBuddy` `CodeBuddy` `商汤小浣熊` `小浣熊` `xiaohuanxiong`
777
+ `天翼 AI` `TeleAgent` `teleagent` `agent.teleai.com.cn`
678
778
 
679
779
  **技术**
680
780
  `DeepSeek Harness` `dsh` `dsh-plugin` `cordis` `插件` `面板` `dashboard`
@@ -3,12 +3,12 @@
3
3
  //
4
4
  // dsh-checkin-all status 所有服务:登录状态 + 本周签到表 + 连续天数
5
5
  // dsh-checkin-all checkin [服务] 立刻签到(--dry 只看不领);不指定服务就全签
6
- // dsh-checkin-all login [服务] 登录(minimax 设备码 / codearts、buddy 浏览器授权)
6
+ // dsh-checkin-all login [服务] 登录(minimax 设备码 / codearts、buddy 浏览器授权 / xiaohuanxiong、teleagent 弹窗口自登)
7
7
  // dsh-checkin-all time 08:30 改自动签到时间
8
8
  // dsh-checkin-all on | off 开 / 关自动签到
9
9
  // dsh-checkin-all cron 给系统 crontab 用的静默签到
10
10
  //
11
- // 服务名:minimax(MiniMax Code)/ lingxi(WPS 灵犀)/ dumate(百度 DuMate)/ astudio(AStudio)/ qoder(Qoder)/ trae(Trae)/ doubao(豆包)
11
+ // 服务名:minimax(MiniMax Code)/ lingxi(WPS 灵犀)/ dumate(百度 DuMate)/ astudio(AStudio)/ qoder(Qoder)/ trae(Trae)/ doubao(豆包)/ codearts(华为 CodeArts)/ buddy(腾讯 WorkBuddy)/ xiaohuanxiong(商汤小浣熊)/ teleagent(天翼 AI)
12
12
  //
13
13
  // 系统 crontab 里可以这样挂(不想依赖 DSH 常驻时):
14
14
  // 0 9 * * * /path/to/dsh-checkin-all cron >> ~/.dsh/dsh-checkin-all/cron.log 2>&1
@@ -114,7 +114,13 @@ async function main() {
114
114
  const loginOpts = (target === 'buddy' && regionArg) ? { region: regionArg } : {}
115
115
  const info = await runner.loginStart(target, loginOpts)
116
116
  const browserFlow = !info.userCode
117
- console.log(`在浏览器打开:${info.verificationUri}`)
117
+ if (info.mode === 'browser-window') {
118
+ // 弹窗口自登的服务:插件自己拉起了窗口,不需要用户去复制网址
119
+ console.log(`已弹出登录窗口:${info.verificationUri}`)
120
+ console.log('在窗口里用手机验证码或微信扫码登录,登完窗口会自动关掉、凭据自动保存。')
121
+ } else {
122
+ console.log(`在浏览器打开:${info.verificationUri}`)
123
+ }
118
124
  if (!browserFlow) console.log(`设备码:${info.userCode}`)
119
125
  if (info.verificationUriComplete && info.verificationUriComplete !== info.verificationUri) {
120
126
  console.log(`(或直接打开 ${info.verificationUriComplete})`)
@@ -125,6 +131,8 @@ async function main() {
125
131
  const result = await runner.loginWait(target, { ...loginOpts, timeoutMs: info.expiresInSec * 1000 })
126
132
  if (target === 'codearts') console.log(`登录成功,华为云凭据已保存(${result.expiresAt} 过期)`)
127
133
  else if (target === 'buddy') console.log(`登录成功,${result.product || 'WorkBuddy'} 凭据已保存`)
134
+ else if (target === 'xiaohuanxiong') console.log(`登录成功,小浣熊凭据已保存(${result.account || '账号'},当前 ${result.points ?? '?'} 积分)`)
135
+ else if (target === 'teleagent') console.log(`登录成功,TeleAgent 凭据已保存(${result.account || '账号'},当前 ${result.points ?? '?'} 积分)`)
128
136
  else console.log(`登录成功,凭据已写回 MiniMax Code(${result.expiresAt} 过期)`)
129
137
  return
130
138
  }
@@ -185,6 +193,8 @@ async function main() {
185
193
  console.error(' trae → Cloud-IDE-JWT token')
186
194
  console.error(' codearts → "access_key_id,secret_access_key[,security_token]"')
187
195
  console.error(' buddy → access_token(可用 --region cn|intl 指定产品线)')
196
+ console.error(' xiaohuanxiong → xhx_token 的值,或整条 Cookie')
197
+ console.error(' teleagent → operationToken 的值,或整条 Cookie')
188
198
  process.exitCode = 2
189
199
  return
190
200
  }
@@ -215,8 +225,18 @@ async function main() {
215
225
  entry = { access_key_id, secret_access_key, ...(security_token ? { security_token } : {}) }
216
226
  } else if (provider === 'buddy') {
217
227
  entry = { access_token: value, region: regionArg === 'intl' ? 'intl' : 'cn' }
228
+ } else if (provider === 'xiaohuanxiong' || provider === 'raccoon') {
229
+ // 整条 Cookie 里有 = 就整条存,否则当成裸 token(两种都能用)
230
+ entry = value.includes('=')
231
+ ? { cookie: value }
232
+ : { cookie: `xhx_token=${value}`, token: value }
233
+ } else if (provider === 'teleagent') {
234
+ // 整条 Cookie 里有 = 就整条存,否则当成裸 operationToken
235
+ entry = value.includes('=')
236
+ ? { cookie: value }
237
+ : { cookie: `operationToken=${value}`, token: value }
218
238
  } else {
219
- console.error(`不认识的服务:${provider}(lingxi / dumate / astudio / trae / codearts / buddy)`)
239
+ console.error(`不认识的服务:${provider}(lingxi / dumate / astudio / trae / codearts / buddy / xiaohuanxiong / teleagent)`)
220
240
  process.exitCode = 2
221
241
  return
222
242
  }
@@ -242,8 +262,8 @@ async function main() {
242
262
  console.log(`用法:
243
263
  dsh-checkin-all status 所有服务:登录状态 + 本周签到表
244
264
  dsh-checkin-all checkin [服务] 立刻签到(--dry 只看不领)
245
- dsh-checkin-all login [服务] 登录(minimax 设备码 / codearts、buddy 浏览器授权)
246
- dsh-checkin-all set <服务> <值> 手动配置凭据(lingxi/dumate/astudio/trae/codearts/buddy)
265
+ dsh-checkin-all login [服务] 登录(minimax 设备码 / codearts、buddy 浏览器授权 / xiaohuanxiong、teleagent 弹窗口自登)
266
+ dsh-checkin-all set <服务> <值> 手动配置凭据(lingxi/dumate/astudio/trae/codearts/buddy/xiaohuanxiong/teleagent)
247
267
  dsh-checkin-all unset <服务> 删除某个服务的手动凭据
248
268
  dsh-checkin-all time 08:30 改自动签到时间
249
269
  dsh-checkin-all on | off 开 / 关自动签到
@@ -46,6 +46,7 @@ export function customServicesPath(env = process.env) {
46
46
  const ID_RE = /^[a-zA-Z][a-zA-Z0-9_-]{1,31}$/
47
47
  export const BUILTIN_IDS = new Set([
48
48
  'minimax', 'lingxi', 'dumate', 'astudio', 'qoder', 'trae', 'doubao', 'codearts', 'buddy',
49
+ 'xiaohuanxiong', 'teleagent',
49
50
  ])
50
51
 
51
52
  export class CustomServiceError extends Error {
@@ -1,6 +1,6 @@
1
1
  // lib/providers/index.js — 签到服务注册表
2
2
  //
3
- // 内置 9 个服务 + 用户自定义的服务(custom-services.json)。
3
+ // 内置 11 个服务 + 用户自定义的服务(custom-services.json)。
4
4
  // 加内置服务就在下面登记一行;自定义服务由 loadCustomServices() 动态加载,
5
5
  // 面板的索引卡片、调度器、AI 工具都会自动带上。
6
6
 
@@ -13,6 +13,8 @@ import { createTraeProvider } from './trae.js'
13
13
  import { createDoubaoProvider } from './doubao.js'
14
14
  import { createCodeArtsProvider } from './codearts.js'
15
15
  import { createBuddyProvider } from './buddy.js'
16
+ import { createXiaohuanxiongProvider } from './xiaohuanxiong.js'
17
+ import { createTeleagentProvider } from './teleagent.js'
16
18
  import { createCustomProvider } from './custom.js'
17
19
  import { loadCustomServices } from '../custom-services.js'
18
20
 
@@ -27,6 +29,8 @@ export function createProviders({ log = () => {}, config = async () => ({}), env
27
29
  createDoubaoProvider({ log, env }),
28
30
  createCodeArtsProvider({ log, env }),
29
31
  createBuddyProvider({ log, env }),
32
+ createXiaohuanxiongProvider({ log, env }),
33
+ createTeleagentProvider({ log, env }),
30
34
  ]
31
35
 
32
36
  // 自定义服务:传了就用传的(同步场景),没传就现读