creditdaddy 1.4.0 → 1.5.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/build.json +8 -0
- package/package.json +6 -4
- package/src/accounts.js +3 -1
- package/src/buildInfo.js +32 -0
- package/src/checkin.js +443 -393
- package/src/constants.js +109 -99
- package/src/cookieSites.js +261 -0
- package/src/daemon.js +607 -11
- package/src/externalQuota.js +397 -0
- package/src/i18n/en.json +255 -2
- package/src/i18n/ja.json +255 -2
- package/src/i18n/ko.json +255 -2
- package/src/i18n/zh-TW.json +255 -2
- package/src/longcatClient.js +251 -0
- package/src/minimaxClient.js +25 -1
- package/src/minimaxGateway.js +27 -36
- package/src/mirasimClient.js +14 -0
- package/src/modelscopeClient.js +275 -0
- package/src/panel.html +4545 -4068
- package/src/quotaRefresh.js +114 -0
- package/src/refreshGuard.js +6 -0
- package/src/riverClient.js +329 -0
- package/src/store.js +5 -0
- package/src/tenrouter.js +62 -8
- package/src/tenrouterAccounts.js +16 -8
- package/src/traeClient.js +6 -3
- package/src/workbuddyClient.js +14 -0
- package/src/xiaomiMimoClient.js +206 -0
package/build.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "creditdaddy",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "CreditDaddy — Qoder / WorkBuddy / ZCode / mirasim / 妙手 / Trae / MiniMax
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "CreditDaddy — Qoder / WorkBuddy / ZCode / mirasim / 妙手 / Trae / MiniMax / ModelScope 多账号本地管理与每日积分自动签到助手,及 10Router 供应商 Cookie 会话捕获与外部配额(Token Harbor / 小米 MiMo / River / ModelScope 魔搭 / LongCat)",
|
|
5
5
|
"homepage": "https://github.com/techysy/CreditDaddy",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"bin",
|
|
16
16
|
"src",
|
|
17
17
|
"README.md",
|
|
18
|
-
"LICENSE"
|
|
18
|
+
"LICENSE",
|
|
19
|
+
"build.json"
|
|
19
20
|
],
|
|
20
21
|
"engines": {
|
|
21
22
|
"node": ">=20"
|
|
@@ -23,7 +24,8 @@
|
|
|
23
24
|
"scripts": {
|
|
24
25
|
"start": "node bin/creditdaddy.js daemon",
|
|
25
26
|
"test": "node --test",
|
|
26
|
-
"release-check": "bash scripts/release-check.sh"
|
|
27
|
+
"release-check": "bash scripts/release-check.sh",
|
|
28
|
+
"prepack": "node scripts/gen-build-info.js build.json"
|
|
27
29
|
},
|
|
28
30
|
"license": "MIT",
|
|
29
31
|
"devDependencies": {
|
package/src/accounts.js
CHANGED
|
@@ -17,7 +17,6 @@ export { displayNameFrom };
|
|
|
17
17
|
*/
|
|
18
18
|
async function attachPendingWebSession(target) {
|
|
19
19
|
if (!String(target.provider || '').startsWith('qoder') || !target.uid) return false;
|
|
20
|
-
if (target.meta?.qoderWebSession) return false;
|
|
21
20
|
// 与 daemon 写入暂存会话(/api/auth/qoder-web-session)共用 withSettings 队列,
|
|
22
21
|
// 否则两边同时「读 pending → 改 → 写回」会把对方的暂存项冲掉
|
|
23
22
|
const item = await withSettings((settings) => {
|
|
@@ -28,6 +27,9 @@ async function attachPendingWebSession(target) {
|
|
|
28
27
|
return found;
|
|
29
28
|
});
|
|
30
29
|
if (!item) return false;
|
|
30
|
+
// 新收割的会话**无条件替换**旧会话(刷新语义):旧守卫「已有会话就 return false」让
|
|
31
|
+
// 重新登录永远挂不上新 cookie(会话过期的账号走「浏览器登录」更新 = 死路——10R 卡上
|
|
32
|
+
// 「网页会话已失效」的账号因此无法在 CD 侧自愈)。与 cookie-site 捕获的原位更新对齐。
|
|
31
33
|
target.meta = { ...(target.meta || {}), qoderWebSession: { cookie: item.cookie, capturedAt: item.capturedAt || new Date().toISOString() } };
|
|
32
34
|
return true;
|
|
33
35
|
}
|
package/src/buildInfo.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** 构建身份(#21):读随包 build.json 与「同版本新构建」平局裁决。 */
|
|
2
|
+
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 读包根的 build.json(scripts/gen-build-info.js 生成)。文件不存在 / 损坏 → null,
|
|
9
|
+
* 调用方一律按「无构建身份」回退(不展示、不参与更新判定)。
|
|
10
|
+
*/
|
|
11
|
+
export function loadBuildInfo(baseDir) {
|
|
12
|
+
const root = baseDir || path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
|
|
13
|
+
try {
|
|
14
|
+
const b = JSON.parse(fs.readFileSync(path.join(root, 'build.json'), 'utf8'));
|
|
15
|
+
if (!b || typeof b.commit !== 'string') return null;
|
|
16
|
+
return b;
|
|
17
|
+
} catch { return null; }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* semver 相等时的平局裁决:线上是「同版本但更新的构建」吗?
|
|
22
|
+
* 仅在双侧都有构建身份、commit 不同、builtAt 更晚,且本机是 release 渠道时成立;
|
|
23
|
+
* 本地 dev / dirty / 缺元数据一律 false(永不误报「你有旧版」)。
|
|
24
|
+
*/
|
|
25
|
+
export function isNewerRebuild(installed, released) {
|
|
26
|
+
if (!installed || !released) return false;
|
|
27
|
+
if (installed.channel !== 'release') return false;
|
|
28
|
+
if (!installed.commit || !released.commit || installed.commit === released.commit) return false;
|
|
29
|
+
const tNew = Date.parse(released.builtAt || '');
|
|
30
|
+
const tOld = Date.parse(installed.builtAt || '');
|
|
31
|
+
return Number.isFinite(tNew) && Number.isFinite(tOld) && tNew > tOld;
|
|
32
|
+
}
|