creditdaddy 1.7.0 → 1.7.2
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 +440 -423
- package/build.json +3 -3
- package/package.json +2 -2
- package/src/authDevice.js +7 -0
- package/src/buildInfo.js +33 -0
- package/src/catpawLocal.js +8 -1
- package/src/checkin.js +7 -3
- package/src/constants.js +8 -4
- package/src/cookieSites.js +14 -0
- package/src/daemon.js +2443 -2311
- package/src/externalQuota.js +44 -1
- package/src/i18n/en.json +113 -24
- package/src/i18n/ja.json +113 -24
- package/src/i18n/ko.json +113 -24
- package/src/i18n/zh-TW.json +113 -24
- package/src/lingxiClient.js +373 -0
- package/src/loomyClient.js +58 -0
- package/src/loomyLocal.js +7 -1
- package/src/minimaxAuth.js +17 -13
- package/src/minimaxClient.js +136 -37
- package/src/minimaxGateway.js +11 -5
- package/src/minimaxLocal.js +344 -304
- package/src/mirasimLocal.js +392 -386
- package/src/panel.html +365 -82
- package/src/providers.js +30 -5
- package/src/qoderApp.js +578 -550
- package/src/riverClient.js +55 -12
- package/src/store.js +1 -0
- package/src/tenrouterAccounts.js +232 -211
- package/src/traeAuth.js +599 -0
- package/src/traeClient.js +25 -2
- package/src/traeGateway.js +104 -37
- package/src/traeLocal.js +371 -347
- package/src/transfer.js +20 -1
- package/src/winProc.js +134 -36
- package/src/workbuddyLocal.js +35 -4
- package/src/zcodeAutoClaim.js +25 -6
- package/src/zcodeClient.js +18 -0
- package/src/zcodeGateway.js +38 -0
- package/src/zcodeLocal.js +340 -334
package/build.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "creditdaddy",
|
|
3
|
-
"version": "1.7.
|
|
4
|
-
"description": "CreditDaddy — Qoder / WorkBuddy / ZCode / mirasim / 妙手 / Trae / MiniMax / ModelScope / 豆包 Doubao / 讯飞 Loomy
|
|
3
|
+
"version": "1.7.2",
|
|
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,11 @@ 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-intl 走国际站(www.trae.ai,同协议同 client_id,#99 10R 侧全链验证)
|
|
137
|
+
trae: { start: startTraeLogin, poll: pollTraeLogin },
|
|
138
|
+
'trae-intl': { start: startTraeLogin, poll: pollTraeLogin },
|
|
132
139
|
};
|
|
133
140
|
export const LOGIN_KINDS = Object.keys(FLOWS);
|
|
134
141
|
const KIND_LABEL = { 'zcode-bigmodel': 'ZCode(BigModel)', 'zcode-zai': 'ZCode(Z.ai)' };
|
package/src/buildInfo.js
CHANGED
|
@@ -30,3 +30,36 @@ export function isNewerRebuild(installed, released) {
|
|
|
30
30
|
const tOld = Date.parse(installed.builtAt || '');
|
|
31
31
|
return Number.isFinite(tNew) && Number.isFinite(tOld) && tNew > tOld;
|
|
32
32
|
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 版本号比较(semver 口径):主 / 次 / 补丁逐段比较,其次预发布——**预发布 < 正式版**
|
|
36
|
+
* (1.7.1-test.4 < 1.7.1),预发布标识符逐个比、纯数字按数值(test.2 < test.10)。
|
|
37
|
+
* 旧实现 parseInt('1-test')===1 把预发布段整段丢掉,测试包被当成同号正式版,
|
|
38
|
+
* 「检查更新」永远说已是最新,测试包用户升不上同号正式版(1.7.1-test.4 → 1.7.1 用户实测)。
|
|
39
|
+
* 解析不了的一律 false:宁可不报新版本,不误报。
|
|
40
|
+
*/
|
|
41
|
+
export function isNewerVersion(next, cur) {
|
|
42
|
+
const parse = (s) => {
|
|
43
|
+
const m = /^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(String(s ?? '').trim());
|
|
44
|
+
return m ? { nums: [Number(m[1]), Number(m[2]), Number(m[3])], pre: m[4] === undefined ? null : m[4].split('.') } : null;
|
|
45
|
+
};
|
|
46
|
+
const a = parse(next);
|
|
47
|
+
const b = parse(cur);
|
|
48
|
+
if (!a || !b) return false;
|
|
49
|
+
for (let i = 0; i < 3; i++) {
|
|
50
|
+
if (a.nums[i] !== b.nums[i]) return a.nums[i] > b.nums[i];
|
|
51
|
+
}
|
|
52
|
+
if (!a.pre && !b.pre) return false; // 同号正式版
|
|
53
|
+
if (!a.pre) return true; // next 是正式版、cur 是预发布 → 新
|
|
54
|
+
if (!b.pre) return false; // next 是预发布、cur 是正式版 → 不更新(预发布 < 正式版)
|
|
55
|
+
for (let i = 0; i < a.pre.length || i < b.pre.length; i++) {
|
|
56
|
+
const x = a.pre[i], y = b.pre[i];
|
|
57
|
+
if (x === undefined) return false; // 前缀相同,短的一方更小(semver: alpha < alpha.1)
|
|
58
|
+
if (y === undefined) return true;
|
|
59
|
+
const nx = /^\d+$/.test(x), ny = /^\d+$/.test(y);
|
|
60
|
+
if (nx && ny) { if (Number(x) !== Number(y)) return Number(x) > Number(y); }
|
|
61
|
+
else if (nx !== ny) return nx; // semver:数字标识符 < 字母标识符
|
|
62
|
+
else if (x !== y) return x > y;
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}
|
package/src/catpawLocal.js
CHANGED
|
@@ -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:
|
|
144
|
+
running: catpawRunningCached(),
|
|
138
145
|
};
|
|
139
146
|
}
|
|
140
147
|
|
package/src/checkin.js
CHANGED
|
@@ -34,6 +34,8 @@ const ZCODE_FIRST_DELAY_MS = 2 * 60 * 1000;
|
|
|
34
34
|
// 各产品「业务日」刷新时点(UTC+8):Qoder 每日 10:00 放出/重置领取资格,其余产品按 00:00。
|
|
35
35
|
// 签到日 = 对应时点起的日历日:dayKey(now, provider) = (now + (8 - 刷新小时)h) 的 UTC 日期
|
|
36
36
|
const DAY_REFRESH_HOUR_UTC8 = { qoder: 10, 'qoder-cn': 10 };
|
|
37
|
+
// 领取日志的积分单位:默认 Credits(Qoder/WorkBuddy 系),网页会话线各自带单位
|
|
38
|
+
const CHECKIN_UNIT = { lingxi: '灵点', doubao: '额度' };
|
|
37
39
|
|
|
38
40
|
let timerHandle = null;
|
|
39
41
|
let zcodeTimerHandle = null;
|
|
@@ -170,7 +172,7 @@ function runZcodeTick(accountIds, { force = false } = {}) {
|
|
|
170
172
|
try {
|
|
171
173
|
const outcome = await zcodeAutoClaim(account);
|
|
172
174
|
if (!outcome) continue;
|
|
173
|
-
if (outcome.status === 'checked-in') {
|
|
175
|
+
if (outcome.status === 'checked-in' || outcome.status === 'partial') {
|
|
174
176
|
claimedIds.push(account.id);
|
|
175
177
|
await clearQuotaMark(account.id);
|
|
176
178
|
}
|
|
@@ -231,9 +233,11 @@ async function runTickNow(opts) {
|
|
|
231
233
|
async function runTickInner(opts) {
|
|
232
234
|
const allAccounts = await loadAccounts();
|
|
233
235
|
// workbuddy-intl 无 checkin 动作(providers.js 的 intl 分支已删),providers 过滤天然跳过;
|
|
236
|
+
// trae-intl 同理(ug 签到接口只在国内站注册,国际号连排程都不进——10R traeCheckin 同口径)。
|
|
234
237
|
// 「活跃请求」全局开关随该机制一并删除(设置项不再读写)
|
|
235
238
|
const accounts = allAccounts.filter(
|
|
236
|
-
(a) =>
|
|
239
|
+
(a) => a.provider !== 'trae-intl'
|
|
240
|
+
&& (!opts.provider || a.provider === opts.provider)
|
|
237
241
|
&& (!opts.product || productOf(a.provider) === opts.product)
|
|
238
242
|
&& (!opts.onlyAccountId || a.id === opts.onlyAccountId)
|
|
239
243
|
&& typeof productImpl(a.provider)?.checkin === 'function'
|
|
@@ -291,7 +295,7 @@ async function runTickInner(opts) {
|
|
|
291
295
|
if (outcome.status === 'checked-in') {
|
|
292
296
|
memo[account.id] = todayFor;
|
|
293
297
|
account.lastCheckin = new Date().toISOString();
|
|
294
|
-
logger.info('CHECKIN', '{label} 领取成功 +{amount}
|
|
298
|
+
logger.info('CHECKIN', '{label} 领取成功 +{amount} {unit}', { label, amount: outcome.claimedAmount, unit: CHECKIN_UNIT[account.provider] || 'Credits' });
|
|
295
299
|
} else if (outcome.status === 'already') {
|
|
296
300
|
memo[account.id] = todayFor;
|
|
297
301
|
account.lastCheckin = account.lastCheckin || new Date().toISOString();
|
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', 'trae-intl', '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 国内版',
|
|
@@ -44,8 +44,10 @@ export const PROVIDER_LABEL = {
|
|
|
44
44
|
zcode: 'ZCode',
|
|
45
45
|
mirasim: 'mirasim',
|
|
46
46
|
catpaw: '妙手',
|
|
47
|
-
trae: 'Trae',
|
|
48
|
-
|
|
47
|
+
trae: 'Trae 国内版',
|
|
48
|
+
'trae-intl': 'Trae 国际版',
|
|
49
|
+
minimax: 'MiniMax 国内版',
|
|
50
|
+
'minimax-global': 'MiniMax 国际版',
|
|
49
51
|
tokenharbor: 'Token Harbor',
|
|
50
52
|
'xiaomi-mimo': '小米 MiMo',
|
|
51
53
|
river: 'River AI',
|
|
@@ -53,6 +55,7 @@ export const PROVIDER_LABEL = {
|
|
|
53
55
|
longcat: 'LongCat',
|
|
54
56
|
doubao: '豆包',
|
|
55
57
|
loomy: '讯飞 Loomy',
|
|
58
|
+
lingxi: 'WPS 灵犀',
|
|
56
59
|
};
|
|
57
60
|
/** provider → 产品线(qoder / workbuddy / zcode / mirasim / catpaw / trae / minimax / tokenharbor / xiaomi-mimo / river) */
|
|
58
61
|
export const productOf = (provider) => {
|
|
@@ -62,7 +65,7 @@ export const productOf = (provider) => {
|
|
|
62
65
|
if (p === 'mirasim') return 'mirasim';
|
|
63
66
|
if (p === 'catpaw') return 'catpaw';
|
|
64
67
|
if (p.startsWith('trae')) return 'trae';
|
|
65
|
-
if (p === 'minimax') return 'minimax';
|
|
68
|
+
if (p === 'minimax' || p === 'minimax-global') return 'minimax';
|
|
66
69
|
if (p === 'tokenharbor') return 'tokenharbor';
|
|
67
70
|
if (p === 'xiaomi-mimo') return 'xiaomi-mimo';
|
|
68
71
|
if (p === 'river') return 'river';
|
|
@@ -70,6 +73,7 @@ export const productOf = (provider) => {
|
|
|
70
73
|
if (p === 'longcat') return 'longcat';
|
|
71
74
|
if (p === 'doubao') return 'doubao';
|
|
72
75
|
if (p === 'loomy') return 'loomy';
|
|
76
|
+
if (p === 'lingxi') return 'lingxi';
|
|
73
77
|
return 'qoder';
|
|
74
78
|
};
|
|
75
79
|
/** provider 是否国内版 */
|
package/src/cookieSites.js
CHANGED
|
@@ -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+ 天有效期)。多号:各号走「网页版 / 粘贴捕获」分别登录捕获,按 WPS 账号 uid 分行并存;同一登录分区换号前先「清除已存会话」。',
|
|
186
|
+
},
|
|
173
187
|
// ⚠ 码道 CodeArts(issue #40)已于 2026-10-30 撤下,不再提供:
|
|
174
188
|
// 华为云控制台会话受闲置超时 + WAF 指印(HWWAFSESID / browserCheckResult)绑定,
|
|
175
189
|
// 浏览器里能靠 SPA 持续续期,本机无法续 —— 实测新鲜会话当日内即失效(网关回登录页),
|