dsh-wtq-pool 1.2.3 → 1.3.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/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.2.3",
5
+ "version": "1.3.1",
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": "pnpm run build",
55
+ "pretest": "npm run build",
56
56
  "test": "node --test --test-timeout=60000 \"tests/*.test.cjs\""
57
57
  },
58
58
  "dsh": {
@@ -80,7 +80,9 @@
80
80
  "@earendil-works/pi-ai": "1.5.0",
81
81
  "@types/node": "^22.20.0",
82
82
  "@types/react": "~18.3.31",
83
+ "@types/react-dom": "18.3.7",
83
84
  "react": "^18.3.1",
85
+ "react-dom": "18.3.1",
84
86
  "tsdown": "^0.22.2",
85
87
  "typescript": "^5.9.3"
86
88
  },
@@ -91,10 +93,5 @@
91
93
  "@deepseek-ai/dsh-settings": ">=0.2.0-rc.1 <0.2.1-0 || >=0.2.2-rc.1 <0.2.3-0",
92
94
  "@deepseek-ai/schemastery": "^3.18.4",
93
95
  "@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
96
  }
100
97
  }
@@ -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. It used to sit under the check-in card as a
809
- line of 12.5px muted text, which read as a caption for the block above it. */
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
@@ -72,6 +72,7 @@ var EN = {
72
72
  "login.openAgain": "Open the link again",
73
73
  "login.waiting": "Finish the sign-in in your browser; this panel picks the account up by itself.",
74
74
  "login.timeout": "The sign-in did not finish. Start again for a new link.",
75
+ "login.noLink": "The plugin did not return a sign-in link.",
75
76
  "login.added": "Added {name}",
76
77
  "login.addedNoName": "Account added",
77
78
  "trae.title": "Trae",
@@ -359,6 +360,7 @@ var ZH = {
359
360
  "login.openAgain": "再打开一次链接",
360
361
  "login.waiting": "在浏览器里完成登录即可,面板会自己把这个账号收进来。",
361
362
  "login.timeout": "登录没有完成。重新开始一次拿新链接。",
363
+ "login.noLink": "插件没有返回登录链接。",
362
364
  "login.added": "已添加 {name}",
363
365
  "login.addedNoName": "账号已添加",
364
366
  "trae.title": "Trae",
@@ -1571,11 +1573,10 @@ function claimSourceCheckins(source) {
1571
1573
  var counts = payload ? payload[source] : null;
1572
1574
  var claimed = counts && typeof counts.claimed === "number" ? counts.claimed : 0;
1573
1575
  var failed = counts && typeof counts.failed === "number" ? counts.failed : 0;
1574
- // A round that failed used to read as "every account is already checked in
1575
- // today": the counts carry `failed` (and the reason), a source whose round
1576
- // threw carries none of its own, and the panel read the missing number as
1577
- // "nothing to collect". The user was told the day was done while nothing
1578
- // had been collected. The same answer has to be visible, not only announced.
1576
+ // A failed round must not read as "every account is already checked in
1577
+ // today": the counts carry `failed` (and the reason), but a source whose
1578
+ // round threw carries none of its own. The missing number is a failure, not
1579
+ // "nothing to collect". The same answer has to be visible, not only announced.
1579
1580
  if (failed > 0) note(checkinFailureText(claimed, failed, counts && counts.reason), "warn");
1580
1581
  else if (claimed === 0) note(t("pool.checkinAllNone"));
1581
1582
  else announce(t("pool.checkinAllDone", { count: claimed }));
@@ -1605,7 +1606,7 @@ function startLogin() {
1605
1606
  render();
1606
1607
  invoke("xd.startLogin", { realm: realm }).then(function (answer) {
1607
1608
  loginUrl = answer && typeof answer.authUrl === "string" ? answer.authUrl : "";
1608
- if (loginUrl === "") throw new Error("the plugin did not return a login link");
1609
+ if (loginUrl === "") throw new Error(t("login.noLink"));
1609
1610
  // This page is a real browser tab, so the link opens the way its own footer
1610
1611
  // links do: a new tab, leaving the panel where it is.
1611
1612
  window.open(loginUrl, "_blank", "noopener,noreferrer");
@@ -1701,9 +1702,9 @@ function claimSourceCheckin(source, account) {
1701
1702
  note(null);
1702
1703
  var result = payload && payload.result ? payload.result : {};
1703
1704
  // A skipped claim can carry the upstream's own reason (Trae answers 9095
1704
- // "this device already checked in today"), which is worth reading. A
1705
- // skipped claim used to reach the screen reader only, so the button looked
1706
- // inert; the banner now says why on the visible page.
1705
+ // "this device already checked in today"), which is worth reading. It is
1706
+ // shown on the visible page, not only announced to the screen reader, so
1707
+ // the button does not look inert.
1707
1708
  //
1708
1709
  // A click can also land on a row the automatic pass has already collected:
1709
1710
  // the host answers `skipped` with `todayCheckedIn`. The account is in the
@@ -2363,7 +2364,7 @@ function paintAccounts(host) {
2363
2364
  }
2364
2365
 
2365
2366
  /**
2366
- * Accounts the user removed for good, each with a button that brings it back.
2367
+ * Accounts the user removed, each with a button that brings it back.
2367
2368
  *
2368
2369
  * Shown because "remove" would otherwise be a one-way door: the account stops
2369
2370
  * being scanned, so there is nothing left in the account list to click.
@@ -2420,9 +2421,9 @@ function accountCard(account) {
2420
2421
  // "Not right now" and "not mine any more" are different decisions, so they
2421
2422
  // stay separate controls: a switch the user flips, and a plain remove button.
2422
2423
  var controls = el("div", "acct-controls");
2423
- // Greys only while an action is actually touching an account. These used to
2424
- // follow the whole-panel `busy`, so a refresh or a doctor pass greyed every
2425
- // row and dropped the labels to a contrast the muted text could not carry.
2424
+ // Greys only while an action is actually touching an account. Following the
2425
+ // whole-panel `busy` would grey every row during a refresh or a doctor pass
2426
+ // and drop the labels to a contrast the muted text could not carry.
2426
2427
  // Any action in flight, not just the account ones: `setAccountState` answers a
2427
2428
  // press made while another control is busy with "nothing" - it returns without
2428
2429
  // even raising the busy banner - so a row that stayed enabled was a press that
@@ -3356,9 +3357,9 @@ var THINKING_LEVELS = ["off", "minimal", "low", "medium", "high", "xhigh", "max"
3356
3357
  * The host sizes its budget from what the declaration says, and `src/host.ts`
3357
3358
  * clamps an override to the catalog's figure before publishing — so an override
3358
3359
  * stored above it (the catalog shrank after it was saved) is not what the model
3359
- * runs at. Showing it verbatim put a number in the field that the field's own
3360
- * `max` then refused to accept, and the panel read as if the model had more room
3361
- * than it has.
3360
+ * runs at. Showing it verbatim puts a number in the field that the field's own
3361
+ * `max` then refuses to accept, and the panel reads as if the model has more
3362
+ * room than it has.
3362
3363
  */
3363
3364
  function withinCeiling(saved, ceiling) {
3364
3365
  if (typeof saved !== "number") return null;
@@ -3424,10 +3425,10 @@ function reclampEntry(entry, model) {
3424
3425
  // the ceiling. Handing the ceiling over would clamp the output to the Max tier's
3425
3426
  // smaller budget while the field is still showing the default window.
3426
3427
  //
3427
- // Through `clampOutput` rather than a bare `withinCeiling`, so the output is held
3428
- // the same way: a refresh that lowers the ceiling used to cut the draft's budget
3429
- // with no user action, which then read as an unsaved edit against the stored
3430
- // figure and let one unrelated save write the smaller number down.
3428
+ // Through `clampOutput` rather than a bare `withinCeiling`, so the output is
3429
+ // held the same way: a refresh that lowers the ceiling must not cut the draft's
3430
+ // budget with no user action, which would read as an unsaved edit against the
3431
+ // stored figure and let one unrelated save write the smaller number down.
3431
3432
  clampOutput(model, entry);
3432
3433
  // Half-typed text does not survive a ceiling that no longer admits it. Left in
3433
3434
  // place it became the field's value beside a `max` that now refuses it - the one
@@ -3825,9 +3826,9 @@ function numberInput(value, onChange, ceiling, onRefused, onText, committed) {
3825
3826
  input.value = String(value);
3826
3827
  // The whole sheet is rebuilt on every repaint, and a repaint really does land
3827
3828
  // between two keystrokes: the panel polls every 1.2 s while a refresh runs and
3828
- // every 2 s for the check-in log. Only the committed value used to survive, so
3829
- // a half-typed number was replaced mid-entry and the edit was silently lost.
3830
- // Holding the raw text lets the rebuilt field show what the user is typing.
3829
+ // every 2 s for the check-in log. Holding the committed value replaces a
3830
+ // half-typed number mid-entry and loses the edit; holding the raw text lets the
3831
+ // rebuilt field show what the user is typing.
3831
3832
  input.addEventListener("input", function () {
3832
3833
  if (typeof onText === "function") onText(input.value);
3833
3834
  });
@@ -4078,10 +4079,10 @@ function adopt(next) {
4078
4079
  }
4079
4080
 
4080
4081
  function runBusy(id, work) {
4081
- // A second action while one is running used to reject here and nowhere else:
4082
- // every caller answers with its own `.catch(function () {})`, so the click did
4083
- // nothing and said nothing. The banner is raised here, once, so a busy panel
4084
- // answers every control the same way.
4082
+ // A second action while one is running must answer here, once: every caller
4083
+ // answers with its own `.catch(function () {})`, so rejecting only here would
4084
+ // make the click do nothing and say nothing. The banner is raised here so a
4085
+ // busy panel answers every control the same way.
4085
4086
  if (busy !== null) {
4086
4087
  note(t("err.busy"), "warn");
4087
4088
  return Promise.reject(new Error("panel is busy"));