dsh-wtq-pool 1.2.3 → 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 +21 -0
- package/LICENSE +21 -21
- package/README.en.md +11 -11
- package/README.md +13 -11
- package/lib/client.js +1 -8
- package/lib/index.js +1027 -245
- package/package.json +2 -7
- package/renderer/panel.css +2 -2
- package/renderer/panel.js +24 -25
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",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"build": "node -e \"require('node:fs').rmSync('lib',{recursive:true,force:true})\" && tsdown",
|
|
53
53
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
54
54
|
"typecheck:client": "tsc -p tsconfig.client.json --noEmit",
|
|
55
|
-
"pretest": "
|
|
55
|
+
"pretest": "npm run build",
|
|
56
56
|
"test": "node --test --test-timeout=60000 \"tests/*.test.cjs\""
|
|
57
57
|
},
|
|
58
58
|
"dsh": {
|
|
@@ -91,10 +91,5 @@
|
|
|
91
91
|
"@deepseek-ai/dsh-settings": ">=0.2.0-rc.1 <0.2.1-0 || >=0.2.2-rc.1 <0.2.3-0",
|
|
92
92
|
"@deepseek-ai/schemastery": "^3.18.4",
|
|
93
93
|
"@earendil-works/pi-ai": ">=0.87.1 <0.88.0 || >=1.3.0 <2.0.0-0"
|
|
94
|
-
},
|
|
95
|
-
"peerDependenciesMeta": {
|
|
96
|
-
"@deepseek-ai/dsh-settings": {
|
|
97
|
-
"optional": true
|
|
98
|
-
}
|
|
99
94
|
}
|
|
100
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
|
@@ -1571,11 +1571,10 @@ function claimSourceCheckins(source) {
|
|
|
1571
1571
|
var counts = payload ? payload[source] : null;
|
|
1572
1572
|
var claimed = counts && typeof counts.claimed === "number" ? counts.claimed : 0;
|
|
1573
1573
|
var failed = counts && typeof counts.failed === "number" ? counts.failed : 0;
|
|
1574
|
-
// A round
|
|
1575
|
-
// today": the counts carry `failed` (and the reason), a source whose
|
|
1576
|
-
// threw carries none of its own
|
|
1577
|
-
// "nothing to collect". The
|
|
1578
|
-
// 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.
|
|
1579
1578
|
if (failed > 0) note(checkinFailureText(claimed, failed, counts && counts.reason), "warn");
|
|
1580
1579
|
else if (claimed === 0) note(t("pool.checkinAllNone"));
|
|
1581
1580
|
else announce(t("pool.checkinAllDone", { count: claimed }));
|
|
@@ -1701,9 +1700,9 @@ function claimSourceCheckin(source, account) {
|
|
|
1701
1700
|
note(null);
|
|
1702
1701
|
var result = payload && payload.result ? payload.result : {};
|
|
1703
1702
|
// A skipped claim can carry the upstream's own reason (Trae answers 9095
|
|
1704
|
-
// "this device already checked in today"), which is worth reading.
|
|
1705
|
-
//
|
|
1706
|
-
//
|
|
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.
|
|
1707
1706
|
//
|
|
1708
1707
|
// A click can also land on a row the automatic pass has already collected:
|
|
1709
1708
|
// the host answers `skipped` with `todayCheckedIn`. The account is in the
|
|
@@ -2420,9 +2419,9 @@ function accountCard(account) {
|
|
|
2420
2419
|
// "Not right now" and "not mine any more" are different decisions, so they
|
|
2421
2420
|
// stay separate controls: a switch the user flips, and a plain remove button.
|
|
2422
2421
|
var controls = el("div", "acct-controls");
|
|
2423
|
-
// Greys only while an action is actually touching an account.
|
|
2424
|
-
//
|
|
2425
|
-
//
|
|
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.
|
|
2426
2425
|
// Any action in flight, not just the account ones: `setAccountState` answers a
|
|
2427
2426
|
// press made while another control is busy with "nothing" - it returns without
|
|
2428
2427
|
// even raising the busy banner - so a row that stayed enabled was a press that
|
|
@@ -3356,9 +3355,9 @@ var THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"
|
|
|
3356
3355
|
* The host sizes its budget from what the declaration says, and `src/host.ts`
|
|
3357
3356
|
* clamps an override to the catalog's figure before publishing — so an override
|
|
3358
3357
|
* stored above it (the catalog shrank after it was saved) is not what the model
|
|
3359
|
-
* runs at. Showing it verbatim
|
|
3360
|
-
* `max` then
|
|
3361
|
-
* 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.
|
|
3362
3361
|
*/
|
|
3363
3362
|
function withinCeiling(saved, ceiling) {
|
|
3364
3363
|
if (typeof saved !== "number") return null;
|
|
@@ -3424,10 +3423,10 @@ function reclampEntry(entry, model) {
|
|
|
3424
3423
|
// the ceiling. Handing the ceiling over would clamp the output to the Max tier's
|
|
3425
3424
|
// smaller budget while the field is still showing the default window.
|
|
3426
3425
|
//
|
|
3427
|
-
// Through `clampOutput` rather than a bare `withinCeiling`, so the output is
|
|
3428
|
-
// the same way: a refresh that lowers the ceiling
|
|
3429
|
-
// with no user action, which
|
|
3430
|
-
// 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.
|
|
3431
3430
|
clampOutput(model, entry);
|
|
3432
3431
|
// Half-typed text does not survive a ceiling that no longer admits it. Left in
|
|
3433
3432
|
// place it became the field's value beside a `max` that now refuses it - the one
|
|
@@ -3825,9 +3824,9 @@ function numberInput(value, onChange, ceiling, onRefused, onText, committed) {
|
|
|
3825
3824
|
input.value = String(value);
|
|
3826
3825
|
// The whole sheet is rebuilt on every repaint, and a repaint really does land
|
|
3827
3826
|
// between two keystrokes: the panel polls every 1.2 s while a refresh runs and
|
|
3828
|
-
// every 2 s for the check-in log.
|
|
3829
|
-
//
|
|
3830
|
-
//
|
|
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.
|
|
3831
3830
|
input.addEventListener("input", function () {
|
|
3832
3831
|
if (typeof onText === "function") onText(input.value);
|
|
3833
3832
|
});
|
|
@@ -4078,10 +4077,10 @@ function adopt(next) {
|
|
|
4078
4077
|
}
|
|
4079
4078
|
|
|
4080
4079
|
function runBusy(id, work) {
|
|
4081
|
-
// A second action while one is running
|
|
4082
|
-
//
|
|
4083
|
-
// nothing and
|
|
4084
|
-
// 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.
|
|
4085
4084
|
if (busy !== null) {
|
|
4086
4085
|
note(t("err.busy"), "warn");
|
|
4087
4086
|
return Promise.reject(new Error("panel is busy"));
|