dsh-wtq-pool 1.2.2 → 1.3.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/CHANGELOG.md +42 -5
- package/LICENSE +21 -21
- package/README.en.md +18 -16
- package/README.md +20 -16
- package/lib/client.js +12 -13
- package/lib/index.js +3048 -1086
- package/package.json +15 -23
- package/renderer/panel.css +2 -2
- package/renderer/panel.js +35 -35
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dsh-wtq-pool",
|
|
3
3
|
"displayName": "WTQ Pool",
|
|
4
4
|
"description": "把本机 WorkBuddy、Trae、Qoder 的桌面登录接入 DeepSeek Harness。限流或额度用尽时自动换号,三家各自开关,国内与国际账号分别成组。",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.3.0",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "chengzhi-c",
|
|
8
8
|
"homepage": "https://github.com/chengzhi-c/dsh-wtq-pool#readme",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"type": "module",
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": "^22.19.0 || >=24.0.0",
|
|
29
|
-
"dsh": ">=0.2.0-rc.1 <0.2.1"
|
|
29
|
+
"dsh": ">=0.2.0-rc.1 <0.2.1-0 || >=0.2.2-rc.1 <0.2.3-0"
|
|
30
30
|
},
|
|
31
31
|
"main": "lib/index.js",
|
|
32
32
|
"types": "lib/index.d.ts",
|
|
@@ -49,13 +49,10 @@
|
|
|
49
49
|
"LICENSE"
|
|
50
50
|
],
|
|
51
51
|
"scripts": {
|
|
52
|
-
"build": "tsdown",
|
|
53
|
-
"prepare": "pnpm run build",
|
|
54
|
-
"prepack": "tsdown",
|
|
55
|
-
"prepublishOnly": "tsdown",
|
|
52
|
+
"build": "node -e \"require('node:fs').rmSync('lib',{recursive:true,force:true})\" && tsdown",
|
|
56
53
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
57
54
|
"typecheck:client": "tsc -p tsconfig.client.json --noEmit",
|
|
58
|
-
"pretest": "
|
|
55
|
+
"pretest": "npm run build",
|
|
59
56
|
"test": "node --test --test-timeout=60000 \"tests/*.test.cjs\""
|
|
60
57
|
},
|
|
61
58
|
"dsh": {
|
|
@@ -74,13 +71,13 @@
|
|
|
74
71
|
}
|
|
75
72
|
},
|
|
76
73
|
"devDependencies": {
|
|
77
|
-
"@deepseek-ai/cordis": "
|
|
78
|
-
"@deepseek-ai/dsh-host-webserver": "0.2.
|
|
79
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
80
|
-
"@deepseek-ai/dsh-llm-pi-ai": "0.2.
|
|
81
|
-
"@deepseek-ai/dsh-settings": "0.2.
|
|
82
|
-
"@deepseek-ai/schemastery": "
|
|
83
|
-
"@earendil-works/pi-ai": "
|
|
74
|
+
"@deepseek-ai/cordis": "~4.1.0",
|
|
75
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.2-rc.1",
|
|
76
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.1",
|
|
77
|
+
"@deepseek-ai/dsh-llm-pi-ai": "0.2.2-rc.1",
|
|
78
|
+
"@deepseek-ai/dsh-settings": "0.2.2-rc.1",
|
|
79
|
+
"@deepseek-ai/schemastery": "~3.19.0",
|
|
80
|
+
"@earendil-works/pi-ai": "1.5.0",
|
|
84
81
|
"@types/node": "^22.20.0",
|
|
85
82
|
"@types/react": "~18.3.31",
|
|
86
83
|
"react": "^18.3.1",
|
|
@@ -89,15 +86,10 @@
|
|
|
89
86
|
},
|
|
90
87
|
"peerDependencies": {
|
|
91
88
|
"@deepseek-ai/cordis": ">=4.0.4 <5.0.0",
|
|
92
|
-
"@deepseek-ai/dsh-llm": ">=0.2.0-rc.1 <0.2.1",
|
|
93
|
-
"@deepseek-ai/dsh-llm-pi-ai": ">=0.2.0-rc.1 <0.2.1",
|
|
94
|
-
"@deepseek-ai/dsh-settings": ">=0.2.0-rc.1 <0.2.1",
|
|
89
|
+
"@deepseek-ai/dsh-llm": ">=0.2.0-rc.1 <0.2.1-0 || >=0.2.2-rc.1 <0.2.3-0",
|
|
90
|
+
"@deepseek-ai/dsh-llm-pi-ai": ">=0.2.0-rc.1 <0.2.1-0 || >=0.2.2-rc.1 <0.2.3-0",
|
|
91
|
+
"@deepseek-ai/dsh-settings": ">=0.2.0-rc.1 <0.2.1-0 || >=0.2.2-rc.1 <0.2.3-0",
|
|
95
92
|
"@deepseek-ai/schemastery": "^3.18.4",
|
|
96
|
-
"@earendil-works/pi-ai": ">=0.
|
|
97
|
-
},
|
|
98
|
-
"peerDependenciesMeta": {
|
|
99
|
-
"@deepseek-ai/dsh-settings": {
|
|
100
|
-
"optional": true
|
|
101
|
-
}
|
|
93
|
+
"@earendil-works/pi-ai": ">=0.87.1 <0.88.0 || >=1.3.0 <2.0.0-0"
|
|
102
94
|
}
|
|
103
95
|
}
|
package/renderer/panel.css
CHANGED
|
@@ -805,8 +805,8 @@ button.park:hover:not(:disabled) { filter: brightness(1.08); background: var(--x
|
|
|
805
805
|
.auto-hours .search { width: 6em; padding-left: 9px; background-image: none; }
|
|
806
806
|
|
|
807
807
|
/* A switch the user has to find on their own: its own card, a real heading, and
|
|
808
|
-
a click row wide enough to hit.
|
|
809
|
-
|
|
808
|
+
a click row wide enough to hit. A line of 12.5px muted text under the check-in
|
|
809
|
+
card reads as a caption for the block above it. */
|
|
810
810
|
.switch-row { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; }
|
|
811
811
|
/* The composer readout switch. Rounded like the other controls inside a card —
|
|
812
812
|
the pill shape belongs to the outer category tabs, and a second pill one level
|
package/renderer/panel.js
CHANGED
|
@@ -246,7 +246,7 @@ var EN = {
|
|
|
246
246
|
"auto.rowGrowth": "Streak: {streak} tier(s) · +{credit} credits · {failed} failed",
|
|
247
247
|
"auto.rowKeepAlive": "Token keep-alive {when}: {refreshed} refreshed · {fresh} already fresh · {failed} failed · {noToken} with no refresh token",
|
|
248
248
|
"auto.rowTravelCounts": "{label}: {departed} sent · {claimed} claimed · {adopted} adopted",
|
|
249
|
-
"auto.hint": "Claims
|
|
249
|
+
"auto.hint": "Claims daily rewards for WorkBuddy, Trae and Qoder, and WorkBuddy streak rewards. Streak claims can use make-up cards and lottery draws. Cat travel runs for domestic accounts only. A slot already collected today is skipped; a missed slot is collected at the next start that day.",
|
|
250
250
|
"keepAlive.runNow": "Refresh now",
|
|
251
251
|
"keepAlive.running": "Refreshing…",
|
|
252
252
|
"keepAlive.label": "Token keep-alive",
|
|
@@ -564,7 +564,7 @@ var ZH = {
|
|
|
564
564
|
"auto.rowGrowth": "连登:{streak} 档 · +{credit} 积分 · 失败 {failed}",
|
|
565
565
|
"auto.rowKeepAlive": "令牌保活 {when}:刷新 {refreshed} 个 · 已是最新 {fresh} 个 · 失败 {failed} 个 · 无刷新令牌 {noToken} 个",
|
|
566
566
|
"auto.rowTravelCounts": "{label}:派出 {departed} · 领奖 {claimed} · 领养 {adopted}",
|
|
567
|
-
"auto.hint": "
|
|
567
|
+
"auto.hint": "按时领取 WorkBuddy、Trae、Qoder 的签到奖励和 WorkBuddy 连登奖励。连登奖励可能使用补签卡和抽奖次数;猫猫旅行仅处理国内账号。当天已领取的时段会跳过,错过的时段会在当天后续运行时补领。",
|
|
568
568
|
"keepAlive.runNow": "立即刷新",
|
|
569
569
|
"keepAlive.running": "刷新中…",
|
|
570
570
|
"keepAlive.label": "登录令牌保活",
|
|
@@ -1273,10 +1273,10 @@ function sourceGroupHead(source, titleKey, count, claimable, busyHere, offerChec
|
|
|
1273
1273
|
/**
|
|
1274
1274
|
* Whether an account has a check-in surface worth drawing.
|
|
1275
1275
|
*
|
|
1276
|
-
*
|
|
1277
|
-
*
|
|
1278
|
-
*
|
|
1279
|
-
*
|
|
1276
|
+
* An account whose upstream answer carries no round and no opening hour has
|
|
1277
|
+
* nothing to show: a disabled button and a "no check-in" line read as a broken
|
|
1278
|
+
* control, so the card has no check-in at all. `campaignsUnavailable` keeps the
|
|
1279
|
+
* surface for a failed read, which is a state to report rather than to hide.
|
|
1280
1280
|
*/
|
|
1281
1281
|
function checkinOffered(checkin) {
|
|
1282
1282
|
return checkin !== undefined && checkin !== null
|
|
@@ -1340,8 +1340,8 @@ function sourceAccountCard(account, kind) {
|
|
|
1340
1340
|
// say so instead of offering a click the upstream will refuse (9095).
|
|
1341
1341
|
var doneToday = checkin.todayCheckedIn === true;
|
|
1342
1342
|
var deviceDone = doneToday !== true && checkin.deviceCheckedIn === true;
|
|
1343
|
-
//
|
|
1344
|
-
// names
|
|
1343
|
+
// The opening hour comes from the campaign list's own start, so the card
|
|
1344
|
+
// names it rather than claiming there is no check-in at all.
|
|
1345
1345
|
var opensLabel = doneToday || deviceDone || typeof checkin.opensAtHour !== "number"
|
|
1346
1346
|
? ""
|
|
1347
1347
|
: t("source.claimableAt", { time: clockHour(checkin.opensAtHour) });
|
|
@@ -1490,8 +1490,9 @@ function renderSourceStrip(source) {
|
|
|
1490
1490
|
}).length;
|
|
1491
1491
|
if (regions.indexOf(activeRegionOf(source)) < 0) setActiveRegion(source, regions[0]);
|
|
1492
1492
|
var region = activeRegionOf(source);
|
|
1493
|
-
//
|
|
1494
|
-
//
|
|
1493
|
+
// The source-wide button follows the accounts of the region on screen: it
|
|
1494
|
+
// appears where one of them has a check-in surface, and stays off a region
|
|
1495
|
+
// whose accounts carry none, where it would read as an action on nothing.
|
|
1495
1496
|
var offerCheckin = accounts.some(function (account) {
|
|
1496
1497
|
return account.region === region && checkinOffered(account.checkin);
|
|
1497
1498
|
});
|
|
@@ -1570,11 +1571,10 @@ function claimSourceCheckins(source) {
|
|
|
1570
1571
|
var counts = payload ? payload[source] : null;
|
|
1571
1572
|
var claimed = counts && typeof counts.claimed === "number" ? counts.claimed : 0;
|
|
1572
1573
|
var failed = counts && typeof counts.failed === "number" ? counts.failed : 0;
|
|
1573
|
-
// A round
|
|
1574
|
-
// today": the counts carry `failed` (and the reason), a source whose
|
|
1575
|
-
// threw carries none of its own
|
|
1576
|
-
// "nothing to collect". The
|
|
1577
|
-
// had been collected. The same answer has to be visible, not only announced.
|
|
1574
|
+
// A failed round must not read as "every account is already checked in
|
|
1575
|
+
// today": the counts carry `failed` (and the reason), but a source whose
|
|
1576
|
+
// round threw carries none of its own. The missing number is a failure, not
|
|
1577
|
+
// "nothing to collect". The same answer has to be visible, not only announced.
|
|
1578
1578
|
if (failed > 0) note(checkinFailureText(claimed, failed, counts && counts.reason), "warn");
|
|
1579
1579
|
else if (claimed === 0) note(t("pool.checkinAllNone"));
|
|
1580
1580
|
else announce(t("pool.checkinAllDone", { count: claimed }));
|
|
@@ -1700,9 +1700,9 @@ function claimSourceCheckin(source, account) {
|
|
|
1700
1700
|
note(null);
|
|
1701
1701
|
var result = payload && payload.result ? payload.result : {};
|
|
1702
1702
|
// A skipped claim can carry the upstream's own reason (Trae answers 9095
|
|
1703
|
-
// "this device already checked in today"), which is worth reading.
|
|
1704
|
-
//
|
|
1705
|
-
//
|
|
1703
|
+
// "this device already checked in today"), which is worth reading. It is
|
|
1704
|
+
// shown on the visible page, not only announced to the screen reader, so
|
|
1705
|
+
// the button does not look inert.
|
|
1706
1706
|
//
|
|
1707
1707
|
// A click can also land on a row the automatic pass has already collected:
|
|
1708
1708
|
// the host answers `skipped` with `todayCheckedIn`. The account is in the
|
|
@@ -2419,9 +2419,9 @@ function accountCard(account) {
|
|
|
2419
2419
|
// "Not right now" and "not mine any more" are different decisions, so they
|
|
2420
2420
|
// stay separate controls: a switch the user flips, and a plain remove button.
|
|
2421
2421
|
var controls = el("div", "acct-controls");
|
|
2422
|
-
// Greys only while an action is actually touching an account.
|
|
2423
|
-
//
|
|
2424
|
-
//
|
|
2422
|
+
// Greys only while an action is actually touching an account. Following the
|
|
2423
|
+
// whole-panel `busy` would grey every row during a refresh or a doctor pass
|
|
2424
|
+
// and drop the labels to a contrast the muted text could not carry.
|
|
2425
2425
|
// Any action in flight, not just the account ones: `setAccountState` answers a
|
|
2426
2426
|
// press made while another control is busy with "nothing" - it returns without
|
|
2427
2427
|
// even raising the busy banner - so a row that stayed enabled was a press that
|
|
@@ -3355,9 +3355,9 @@ var THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"
|
|
|
3355
3355
|
* The host sizes its budget from what the declaration says, and `src/host.ts`
|
|
3356
3356
|
* clamps an override to the catalog's figure before publishing — so an override
|
|
3357
3357
|
* stored above it (the catalog shrank after it was saved) is not what the model
|
|
3358
|
-
* runs at. Showing it verbatim
|
|
3359
|
-
* `max` then
|
|
3360
|
-
* than it has.
|
|
3358
|
+
* runs at. Showing it verbatim puts a number in the field that the field's own
|
|
3359
|
+
* `max` then refuses to accept, and the panel reads as if the model has more
|
|
3360
|
+
* room than it has.
|
|
3361
3361
|
*/
|
|
3362
3362
|
function withinCeiling(saved, ceiling) {
|
|
3363
3363
|
if (typeof saved !== "number") return null;
|
|
@@ -3423,10 +3423,10 @@ function reclampEntry(entry, model) {
|
|
|
3423
3423
|
// the ceiling. Handing the ceiling over would clamp the output to the Max tier's
|
|
3424
3424
|
// smaller budget while the field is still showing the default window.
|
|
3425
3425
|
//
|
|
3426
|
-
// Through `clampOutput` rather than a bare `withinCeiling`, so the output is
|
|
3427
|
-
// the same way: a refresh that lowers the ceiling
|
|
3428
|
-
// with no user action, which
|
|
3429
|
-
// figure and let one unrelated save write the smaller number down.
|
|
3426
|
+
// Through `clampOutput` rather than a bare `withinCeiling`, so the output is
|
|
3427
|
+
// held the same way: a refresh that lowers the ceiling must not cut the draft's
|
|
3428
|
+
// budget with no user action, which would read as an unsaved edit against the
|
|
3429
|
+
// stored figure and let one unrelated save write the smaller number down.
|
|
3430
3430
|
clampOutput(model, entry);
|
|
3431
3431
|
// Half-typed text does not survive a ceiling that no longer admits it. Left in
|
|
3432
3432
|
// place it became the field's value beside a `max` that now refuses it - the one
|
|
@@ -3824,9 +3824,9 @@ function numberInput(value, onChange, ceiling, onRefused, onText, committed) {
|
|
|
3824
3824
|
input.value = String(value);
|
|
3825
3825
|
// The whole sheet is rebuilt on every repaint, and a repaint really does land
|
|
3826
3826
|
// between two keystrokes: the panel polls every 1.2 s while a refresh runs and
|
|
3827
|
-
// every 2 s for the check-in log.
|
|
3828
|
-
//
|
|
3829
|
-
//
|
|
3827
|
+
// every 2 s for the check-in log. Holding the committed value replaces a
|
|
3828
|
+
// half-typed number mid-entry and loses the edit; holding the raw text lets the
|
|
3829
|
+
// rebuilt field show what the user is typing.
|
|
3830
3830
|
input.addEventListener("input", function () {
|
|
3831
3831
|
if (typeof onText === "function") onText(input.value);
|
|
3832
3832
|
});
|
|
@@ -4077,10 +4077,10 @@ function adopt(next) {
|
|
|
4077
4077
|
}
|
|
4078
4078
|
|
|
4079
4079
|
function runBusy(id, work) {
|
|
4080
|
-
// A second action while one is running
|
|
4081
|
-
//
|
|
4082
|
-
// nothing and
|
|
4083
|
-
// answers every control the same way.
|
|
4080
|
+
// A second action while one is running must answer here, once: every caller
|
|
4081
|
+
// answers with its own `.catch(function () {})`, so rejecting only here would
|
|
4082
|
+
// make the click do nothing and say nothing. The banner is raised here so a
|
|
4083
|
+
// busy panel answers every control the same way.
|
|
4084
4084
|
if (busy !== null) {
|
|
4085
4085
|
note(t("err.busy"), "warn");
|
|
4086
4086
|
return Promise.reject(new Error("panel is busy"));
|