creditdaddy 1.7.0 → 1.7.1

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/build.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
- "version": "1.7.0",
3
- "commit": "0b573f6",
2
+ "version": "1.7.1",
3
+ "commit": "06ec23f",
4
4
  "branch": "main",
5
- "builtAt": "2026-11-06T10:13:35.722Z",
5
+ "builtAt": "2026-11-07T14:49:13.017Z",
6
6
  "channel": "local",
7
7
  "dirty": true
8
8
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "creditdaddy",
3
- "version": "1.7.0",
4
- "description": "CreditDaddy — Qoder / WorkBuddy / ZCode / mirasim / 妙手 / Trae / MiniMax / ModelScope / 豆包 Doubao / 讯飞 Loomy 多账号本地管理与每日积分自动签到助手,及 10Router 供应商 Cookie 会话捕获与外部配额(Token Harbor / 小米 MiMo / River / ModelScope 魔搭 / LongCat)",
3
+ "version": "1.7.1",
4
+ "description": "CreditDaddy — Qoder / WorkBuddy / ZCode / mirasim / 妙手 / Trae / MiniMax / ModelScope / 豆包 Doubao / 讯飞 Loomy / WPS 灵犀多账号本地管理与每日积分自动签到助手,及 10Router 供应商 Cookie 会话捕获与外部配额(Token Harbor / 小米 MiMo / River / ModelScope 魔搭 / LongCat)",
5
5
  "homepage": "https://github.com/techysy/CreditDaddy",
6
6
  "repository": {
7
7
  "type": "git",
package/src/authDevice.js CHANGED
@@ -5,6 +5,7 @@
5
5
  * workbuddy / workbuddy-intl WorkBuddy / CodeBuddy 登录(state 轮询,见 workbuddyAuth.js)
6
6
  * zcode-bigmodel / zcode-zai ZCode 登录(客户端 CLI 轮询流程,见 zcodeAuth.js)
7
7
  * minimax MiniMax Code 登录(OAuth 设备码 + S256 PKCE,见 minimaxAuth.js)
8
+ * trae Trae 登录(官方同款授权码 + PKCE + 本机回调监听,见 traeAuth.js)
8
9
  *
9
10
  * Qoder 流程:
10
11
  * 1. 本地生成 PKCE 对 (verifier/challenge-S256) + nonce + machine_id
@@ -29,6 +30,7 @@ import { t } from './i18n.js';
29
30
  import { startWorkbuddyLogin, pollWorkbuddyLogin } from './workbuddyAuth.js';
30
31
  import { startZcodeLogin, pollZcodeLogin } from './zcodeAuth.js';
31
32
  import { startMiniMaxLogin, pollMiniMaxLogin } from './minimaxAuth.js';
33
+ import { startTraeLogin, pollTraeLogin } from './traeAuth.js';
32
34
 
33
35
  const FETCH_TIMEOUT_MS = 15000;
34
36
  const QODER_TTL_MS = 5 * 60 * 1000; // Qoder 授权链接 5 分钟有效
@@ -129,6 +131,9 @@ const FLOWS = {
129
131
  'zcode-bigmodel': { start: startZcodeLogin, poll: pollZcodeLogin },
130
132
  'zcode-zai': { start: startZcodeLogin, poll: pollZcodeLogin },
131
133
  minimax: { start: startMiniMaxLogin, poll: pollMiniMaxLogin },
134
+ 'minimax-global': { start: (kind) => startMiniMaxLogin('global'), poll: pollMiniMaxLogin },
135
+ // Trae:授权码 + PKCE 的本地回调流(与设备码轮询不同,poll 查的是本机回调监听抓没抓到)
136
+ trae: { start: startTraeLogin, poll: pollTraeLogin },
132
137
  };
133
138
  export const LOGIN_KINDS = Object.keys(FLOWS);
134
139
  const KIND_LABEL = { 'zcode-bigmodel': 'ZCode(BigModel)', 'zcode-zai': 'ZCode(Z.ai)' };
@@ -20,6 +20,7 @@ import os from 'node:os';
20
20
  import path from 'node:path';
21
21
  import crypto from 'node:crypto';
22
22
  import { execFileSync } from 'node:child_process';
23
+ import { procRunningCached } from './winProc.js';
23
24
 
24
25
  const EXE_NAME = '妙手.exe';
25
26
 
@@ -117,6 +118,12 @@ export function catpawRunning() {
117
118
  } catch { return false; }
118
119
  }
119
120
 
121
+ /** 轮询口径(/api/status 用):读 winProc 全量快照,不 spawn;switchTo/terminate 仍走 catpawRunning()。 */
122
+ export function catpawRunningCached() {
123
+ if (runningOverride !== null) return runningOverride; // 测试钩子
124
+ return procRunningCached([EXE_NAME]);
125
+ }
126
+
120
127
  export function candidateClientPath() {
121
128
  if (process.platform !== 'win32') return null;
122
129
  const local = process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local');
@@ -134,7 +141,7 @@ export function detectCatpaw() {
134
141
  signedIn: Boolean(cred),
135
142
  clientInstalled: Boolean(clientPath),
136
143
  clientPath,
137
- running: catpawRunning(),
144
+ running: catpawRunningCached(),
138
145
  };
139
146
  }
140
147
 
package/src/checkin.js CHANGED
@@ -170,7 +170,7 @@ function runZcodeTick(accountIds, { force = false } = {}) {
170
170
  try {
171
171
  const outcome = await zcodeAutoClaim(account);
172
172
  if (!outcome) continue;
173
- if (outcome.status === 'checked-in') {
173
+ if (outcome.status === 'checked-in' || outcome.status === 'partial') {
174
174
  claimedIds.push(account.id);
175
175
  await clearQuotaMark(account.id);
176
176
  }
package/src/constants.js CHANGED
@@ -35,7 +35,7 @@ export const WEB_USAGE_PATH = '/api/v2/me/usages/big_model_credits';
35
35
  export const JOB_TOKEN_EXCHANGE_PATH = '/api/v1/jobToken/exchange';
36
36
 
37
37
  // 账号的 provider = 产品 + 区域。新增产品时在此登记,并在 providers.js 挂上对应实现。
38
- export const PROVIDERS = ['qoder', 'qoder-cn', 'workbuddy', 'workbuddy-intl', 'zcode', 'mirasim', 'catpaw', 'trae', 'minimax', 'tokenharbor', 'xiaomi-mimo', 'river', 'modelscope', 'longcat', 'doubao', 'loomy'];
38
+ export const PROVIDERS = ['qoder', 'qoder-cn', 'workbuddy', 'workbuddy-intl', 'zcode', 'mirasim', 'catpaw', 'trae', 'minimax', 'minimax-global', 'tokenharbor', 'xiaomi-mimo', 'river', 'modelscope', 'longcat', 'doubao', 'loomy', 'lingxi'];
39
39
  export const PROVIDER_LABEL = {
40
40
  qoder: 'Qoder 国际版',
41
41
  'qoder-cn': 'Qoder 国内版',
@@ -45,7 +45,8 @@ export const PROVIDER_LABEL = {
45
45
  mirasim: 'mirasim',
46
46
  catpaw: '妙手',
47
47
  trae: 'Trae',
48
- minimax: 'MiniMax',
48
+ minimax: 'MiniMax 国内版',
49
+ 'minimax-global': 'MiniMax 国际版',
49
50
  tokenharbor: 'Token Harbor',
50
51
  'xiaomi-mimo': '小米 MiMo',
51
52
  river: 'River AI',
@@ -53,6 +54,7 @@ export const PROVIDER_LABEL = {
53
54
  longcat: 'LongCat',
54
55
  doubao: '豆包',
55
56
  loomy: '讯飞 Loomy',
57
+ lingxi: 'WPS 灵犀',
56
58
  };
57
59
  /** provider → 产品线(qoder / workbuddy / zcode / mirasim / catpaw / trae / minimax / tokenharbor / xiaomi-mimo / river) */
58
60
  export const productOf = (provider) => {
@@ -62,7 +64,7 @@ export const productOf = (provider) => {
62
64
  if (p === 'mirasim') return 'mirasim';
63
65
  if (p === 'catpaw') return 'catpaw';
64
66
  if (p.startsWith('trae')) return 'trae';
65
- if (p === 'minimax') return 'minimax';
67
+ if (p === 'minimax' || p === 'minimax-global') return 'minimax';
66
68
  if (p === 'tokenharbor') return 'tokenharbor';
67
69
  if (p === 'xiaomi-mimo') return 'xiaomi-mimo';
68
70
  if (p === 'river') return 'river';
@@ -70,6 +72,7 @@ export const productOf = (provider) => {
70
72
  if (p === 'longcat') return 'longcat';
71
73
  if (p === 'doubao') return 'doubao';
72
74
  if (p === 'loomy') return 'loomy';
75
+ if (p === 'lingxi') return 'lingxi';
73
76
  return 'qoder';
74
77
  };
75
78
  /** provider 是否国内版 */
@@ -170,6 +170,20 @@ export const COOKIE_SITES = [
170
170
  entryOnly: true, // 只出「打开豆包」按钮,无会话捕获 / 无探测 / 无账号行
171
171
  hint: '在豆包客户端(或网页)登录后捕获会话,CD 只读展示体验额度与每日签到状态(+200/天);签到请在「打开豆包」里手动完成——活动在客户端内,CD 不代签;仅个人账号可参与(飞书企业号被排除),凭据只存本机。'
172
172
  },
173
+ {
174
+ id: 'lingxi',
175
+ name: 'WPS 灵犀',
176
+ provider: 'lingxi',
177
+ label: 'WPS 灵犀',
178
+ loginUrl: 'https://lingxi.kdocs.cn',
179
+ homeUrl: 'https://lingxi.kdocs.cn',
180
+ // 探测 = 任务列表接口本身(issue #53,提案者 2026-11-06 实测):带会话 cookie 返 200
181
+ // 含 data.tasks[];未登录 401/403。签到状态在这里读(daily_check_in 的 status)。
182
+ verify: 'api',
183
+ cookieUrls: ['https://lingxi.kdocs.cn', 'https://www.kdocs.cn'],
184
+ accountName: 'WPS 灵犀',
185
+ hint: '登录 lingxi.kdocs.cn 后自动抓取每日签到状态与灵点余额(每天 100 灵点,七天一轮第七天 200);CD 每日自动签到 + 推送 10Router 出余额卡,Cookie 只存本机(约 300+ 天有效期)。',
186
+ },
173
187
  // ⚠ 码道 CodeArts(issue #40)已于 2026-10-30 撤下,不再提供:
174
188
  // 华为云控制台会话受闲置超时 + WAF 指印(HWWAFSESID / browserCheckResult)绑定,
175
189
  // 浏览器里能靠 SPA 持续续期,本机无法续 —— 实测新鲜会话当日内即失效(网关回登录页),