@eddyskywalker/dsh-chatgpt-subscription 0.19.0 → 0.19.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/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.19.1 - 2026-10-11
6
+ - **[GLM(ZCode 账号)] 账号管理一行的三个按钮排不下,第三个被挤到下一行**
7
+ - **问题**:「账号管理(已登录 N 个账号)」与右侧按钮区共用一行(`.dsha-grouphead` 是 `justify-content:space-between`),而按钮容器带 `flex-wrap:wrap`。标题占掉宽度后,三个按钮(添加国区账号 / 添加国际区账号 / 导入本机 ZCode 登录态)里第三个必然折行。WorkBuddy 与 Claude 都只有两个按钮,所以这条线路是**唯一**有三个的,问题也只在它身上显形。
8
+ - **修法:按「同类操作聚在一起」重排,而不是去调共享样式。** 两个「添加账号」留在标题行,第三个下移到下面的「登录授权」区。理由是它本来就是**另一条登录路径**——浏览器授权与读本机已有登录态是同一件事的两种做法,放在同一个区才读得出「怎么登录」;位置取状态提示之后、手工粘贴之前,既不打断「流程状态 → 结果」的阅读顺序,又与同为免浏览器路径的手工粘贴相邻。导入结果的提示一并跟着移,否则用户点了按钮却在远处看到结果。
9
+ - **一处必要的连带改动**:登录区原先整块包在 `login !== null` 的判断里。按钮移进来后会跟着这个判断一起消失——host 一次流程状态都不报时,用户就再也点不到「导入本机 ZCode 登录态」。因此把判断收窄到只包住状态块,标题、导入按钮、导入结果、手工粘贴四样常驻。真实 host 永远会报 `login`(`routes.ts` 的 `loginStatusOf(null)` 返回 `idle`,且每次 `/status` 都带上它),所以**线上画面不变**,这个改动只是堵掉「入口会消失」这个洞。
10
+ - **测试**:改写原先断言「三个按钮都在标题行」的那条用例——它验的正是被推翻的布局。新护栏断言标题行**恰好两个**按钮,且导入按钮落在登录区内。护栏做过变异验证:把第三个按钮塞回标题行,该用例立刻失败。另新增一条断言导入结果与按钮同区、可当场关闭。
11
+ - **验证:`npm run typecheck` 0 错误;全量 `npm test` 208 passed | 1 skipped(209 文件)、3430 passed | 7 skipped | 0 failed。**
12
+
5
13
  ## 0.19.0 - 2026-10-11
6
14
  - **[GLM(ZCode 账号)] 新增第九条 Provider 线路:用 ZCode 账号 OAuth 登录 GLM Coding Plan,国区与国际区两套部署各自独立**
7
15
  - **问题:GLM Coding Plan 此前只能以「粘贴 API Key」的形态接入,而公开的 OpenAI 兼容面根本不生效套餐额度。** 官方文档的 Common mistakes 段写明走通用面 `/api/paas/v4` 会变成按量计费——用户明明买了订阅,却在一条声称提供 GLM 的线路上看着余额被扣。要拿到真正吃套餐额度的端点,必须先有 Coding Plan Key,而 Key 又只能由 ZCode **账号**授权换出来。
package/lib/client.js CHANGED
@@ -8111,7 +8111,7 @@ window.__ModuleLoader__.load({
8111
8111
  })]
8112
8112
  })]
8113
8113
  }),
8114
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(AccountPoolSection, {
8114
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccountPoolSection, {
8115
8115
  accounts,
8116
8116
  activeAccountId: status?.activeAccountId,
8117
8117
  rotationStrategy: status?.rotationStrategy ?? "sequential",
@@ -8126,26 +8126,17 @@ window.__ModuleLoader__.load({
8126
8126
  onSetStrategy: (strategy) => void setStrategy(strategy),
8127
8127
  renderLoginActions: () => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8128
8128
  className: "dsha-account-add-actions",
8129
- children: [
8130
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
8131
- className: "dsha-btn dsha-btn-primary",
8132
- disabled: busy !== null,
8133
- onClick: () => void startLogin("cn"),
8134
- children: busy === "login:cn" ? t.authorizing : t.addCnAccount
8135
- }),
8136
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
8137
- className: "dsha-btn dsha-btn-primary",
8138
- disabled: busy !== null,
8139
- onClick: () => void startLogin("intl"),
8140
- children: busy === "login:intl" ? t.authorizing : t.addIntlAccount
8141
- }),
8142
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
8143
- className: "dsha-btn",
8144
- disabled: busy !== null,
8145
- onClick: () => void adopt(),
8146
- children: busy === "adopt" ? t.adopting : t.adopt
8147
- })
8148
- ]
8129
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
8130
+ className: "dsha-btn dsha-btn-primary",
8131
+ disabled: busy !== null,
8132
+ onClick: () => void startLogin("cn"),
8133
+ children: busy === "login:cn" ? t.authorizing : t.addCnAccount
8134
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
8135
+ className: "dsha-btn dsha-btn-primary",
8136
+ disabled: busy !== null,
8137
+ onClick: () => void startLogin("intl"),
8138
+ children: busy === "login:intl" ? t.authorizing : t.addIntlAccount
8139
+ })]
8149
8140
  }),
8150
8141
  renderDetails: (account) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
8151
8142
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
@@ -8160,82 +8151,105 @@ window.__ModuleLoader__.load({
8160
8151
  children: account.organizationId
8161
8152
  }) : null
8162
8153
  ] }),
8163
- children: [login !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8154
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8164
8155
  className: "dshglm-flow",
8165
8156
  children: [
8166
8157
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: t.loginSection }),
8167
- login.status === "idle" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8168
- className: "dsha-muted",
8169
- children: t.loginIdle
8170
- }),
8171
- login.status === "pending" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
8172
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8158
+ login !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
8159
+ login.status === "idle" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8173
8160
  className: "dsha-muted",
8174
- children: t.loginPending
8161
+ children: t.loginIdle
8175
8162
  }),
8176
- login.authorizeUrl !== void 0 && login.authorizeUrl !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
8177
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8178
- className: "dsha-label",
8179
- children: t.authorizeUrl
8180
- }),
8181
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
8182
- className: "dshglm-flow-url",
8183
- children: login.authorizeUrl
8163
+ login.status === "pending" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
8164
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8165
+ className: "dsha-muted",
8166
+ children: t.loginPending
8184
8167
  }),
8185
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8186
- className: "dsha-actions",
8187
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
8188
- className: "dsha-btn",
8189
- href: login.authorizeUrl,
8190
- target: "_blank",
8191
- rel: "noreferrer noopener",
8192
- children: t.openAuthorizeUrl
8168
+ login.authorizeUrl !== void 0 && login.authorizeUrl !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
8169
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8170
+ className: "dsha-label",
8171
+ children: t.authorizeUrl
8172
+ }),
8173
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", {
8174
+ className: "dshglm-flow-url",
8175
+ children: login.authorizeUrl
8176
+ }),
8177
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8178
+ className: "dsha-actions",
8179
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
8180
+ className: "dsha-btn",
8181
+ href: login.authorizeUrl,
8182
+ target: "_blank",
8183
+ rel: "noreferrer noopener",
8184
+ children: t.openAuthorizeUrl
8185
+ })
8193
8186
  })
8187
+ ] }),
8188
+ login.progress !== void 0 && login.progress !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8189
+ className: "dsha-row",
8190
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8191
+ className: "dsha-label",
8192
+ children: t.progress
8193
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8194
+ className: "dsha-value",
8195
+ children: login.progress
8196
+ })]
8197
+ }),
8198
+ login.pollIntervalSec !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8199
+ className: "dsha-muted",
8200
+ children: t.pollEvery.replace("{seconds}", String(login.pollIntervalSec))
8201
+ }),
8202
+ login.expiresAt !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8203
+ className: "dsha-muted",
8204
+ children: t.loginExpiresAt.replace("{time}", formatDate(login.expiresAt))
8194
8205
  })
8195
8206
  ] }),
8196
- login.progress !== void 0 && login.progress !== "" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8197
- className: "dsha-row",
8198
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8199
- className: "dsha-label",
8200
- children: t.progress
8201
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8202
- className: "dsha-value",
8203
- children: login.progress
8204
- })]
8205
- }),
8206
- login.pollIntervalSec !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8207
+ login.status === "complete" && !authenticated && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8207
8208
  className: "dsha-muted",
8208
- children: t.pollEvery.replace("{seconds}", String(login.pollIntervalSec))
8209
+ children: t.loginCompleteNoAccount
8209
8210
  }),
8210
- login.expiresAt !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8211
+ login.status === "complete" && authenticated && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
8212
+ className: "dsha-notice",
8213
+ children: [t.loginComplete, login.email !== void 0 && login.email !== "" ? ` ${login.email}` : ""]
8214
+ }), login.completedAt !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8211
8215
  className: "dsha-muted",
8212
- children: t.loginExpiresAt.replace("{time}", formatDate(login.expiresAt))
8216
+ children: t.loginCompletedAt.replace("{time}", formatDate(login.completedAt))
8217
+ })] }),
8218
+ login.status === "error" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8219
+ className: "dsha-error",
8220
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: login.error !== void 0 && login.error !== "" ? `${t.loginError} ${login.error}` : t.loginError }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: login.retryable === true ? t.loginRetryable : t.loginNotRetryable })]
8221
+ }),
8222
+ login.status === "pending" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8223
+ className: "dsha-actions",
8224
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
8225
+ className: "dsha-btn",
8226
+ disabled: busy !== null,
8227
+ onClick: () => void cancelLogin(),
8228
+ children: busy === "login:cancel" ? t.cancelLoginBusy : t.cancelLogin
8229
+ })
8213
8230
  })
8214
8231
  ] }),
8215
- login.status === "complete" && !authenticated && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8216
- className: "dsha-muted",
8217
- children: t.loginCompleteNoAccount
8218
- }),
8219
- login.status === "complete" && authenticated && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", {
8220
- className: "dsha-notice",
8221
- children: [t.loginComplete, login.email !== void 0 && login.email !== "" ? ` ${login.email}` : ""]
8222
- }), login.completedAt !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8223
- className: "dsha-muted",
8224
- children: t.loginCompletedAt.replace("{time}", formatDate(login.completedAt))
8225
- })] }),
8226
- login.status === "error" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8227
- className: "dsha-error",
8228
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: login.error !== void 0 && login.error !== "" ? `${t.loginError} ${login.error}` : t.loginError }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: login.retryable === true ? t.loginRetryable : t.loginNotRetryable })]
8229
- }),
8230
- login.status === "pending" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8232
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8231
8233
  className: "dsha-actions",
8232
8234
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
8233
8235
  className: "dsha-btn",
8234
8236
  disabled: busy !== null,
8235
- onClick: () => void cancelLogin(),
8236
- children: busy === "login:cancel" ? t.cancelLoginBusy : t.cancelLogin
8237
+ onClick: () => void adopt(),
8238
+ children: busy === "adopt" ? t.adopting : t.adopt
8237
8239
  })
8238
8240
  }),
8241
+ adoptResult !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8242
+ className: "dsha-row",
8243
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8244
+ className: "dsha-value",
8245
+ children: adoptResult.adopted ? t.adoptAdopted.replace("{region}", regionLabel(adoptResult.region ?? region)) : adoptResult.reason === void 0 ? t.adoptNoAttempt : `${adoptReasonText(adoptResult.reason, t)} ${t.adoptFallback}`
8246
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
8247
+ className: "dsha-btn",
8248
+ disabled: busy !== null,
8249
+ onClick: clearAdoptResult,
8250
+ children: t.dismiss
8251
+ })]
8252
+ }),
8239
8253
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8240
8254
  className: "dshglm-paste",
8241
8255
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
@@ -8273,18 +8287,7 @@ window.__ModuleLoader__.load({
8273
8287
  })]
8274
8288
  })
8275
8289
  ]
8276
- }), adoptResult !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
8277
- className: "dsha-row",
8278
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
8279
- className: "dsha-value",
8280
- children: adoptResult.adopted ? t.adoptAdopted.replace("{region}", regionLabel(adoptResult.region ?? region)) : adoptResult.reason === void 0 ? t.adoptNoAttempt : `${adoptReasonText(adoptResult.reason, t)} ${t.adoptFallback}`
8281
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
8282
- className: "dsha-btn",
8283
- disabled: busy !== null,
8284
- onClick: clearAdoptResult,
8285
- children: t.dismiss
8286
- })]
8287
- })]
8290
+ })
8288
8291
  }),
8289
8292
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
8290
8293
  className: "dsha-group",