dsh-xdpool 2.7.0 → 2.7.2

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/lib/index.d.ts CHANGED
@@ -192,7 +192,20 @@ interface ChatMessage {
192
192
  //#endregion
193
193
  //#region src/upstream.d.ts
194
194
  /** Upstream failure classes the shim maps onto distinct HTTP answers. */
195
- type UpstreamErrorKind = 'hard_credit' | 'soft_rate' | 'session_dead' | 'not_found' | 'server' | 'client';
195
+ type UpstreamErrorKind = 'hard_credit' | 'soft_rate' | 'session_dead' |
196
+ /**
197
+ * The account is blocked by the vendor's risk control — issue #127.
198
+ *
199
+ * A 403 whose body carries `code 11140` means "this account is flagged", not "this
200
+ * credential is invalid". The two were merged into `session_dead`, so the card printed
201
+ * "API 密钥无效" and the user was sent to re-authenticate over and over for a problem that
202
+ * re-authentication cannot fix — the sign-in succeeds, the flag remains.
203
+ *
204
+ * Separated because the remedy differs: a dead session wants a refresh, a flagged account
205
+ * wants the other accounts in the pool and, if all of them are flagged, a word with the
206
+ * vendor.
207
+ */
208
+ 'risk_blocked' | 'not_found' | 'server' | 'client';
196
209
  /** Token-refresh answer; fields the upstream omits stay absent. */
197
210
  interface WorkBuddyRefreshOutcome {
198
211
  accessToken: string;
@@ -322,11 +335,6 @@ interface UpstreamClientOptions {
322
335
  /** Region for a login domain; an empty domain means CN (matching upstream tooling). */
323
336
  /** The two gateways WorkBuddy serves: the domestic one and the international one. */
324
337
  type WorkBuddyRegion = 'cn' | 'global';
325
- /**
326
- * Classify an upstream failure from its HTTP status and body excerpt.
327
- * Body markers win over status, because the upstream reuses 400/200 for
328
- * several distinct conditions.
329
- */
330
338
  export declare function classifyUpstreamError(status: number, body: string): UpstreamErrorKind;
331
339
  /**
332
340
  * Parse the reset time the upstream reports for a rate limit, when present.
@@ -1957,6 +1965,8 @@ interface PoolWebChannel {
1957
1965
  * the user reads the message.
1958
1966
  */
1959
1967
  smsHint?: boolean;
1968
+ /** A sentence shown beside the button, for a login that needs explaining. */
1969
+ loginHint?: 'doubao';
1960
1970
  /**
1961
1971
  * What the pack can report about this vendor's credits, when it can report
1962
1972
  * something at all.