@eddyskywalker/dsh-chatgpt-subscription 0.15.0 → 0.16.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/lib/index.js CHANGED
@@ -30217,6 +30217,25 @@ function refreshSourceForDomain(domain) {
30217
30217
  }
30218
30218
  //#endregion
30219
30219
  //#region src/shared/workbuddy-contracts.ts
30220
+ /**
30221
+ * Parse one gateway \`credits\` string into the bare multiplier it names.
30222
+ *
30223
+ * Measured shapes: \`x6.67\` (intl), \`x0.79 credits\` (cn), and \`''\` for a model
30224
+ * whose publisher declares no rate. \`x0.00\` is deliberately kept — it is a real
30225
+ * declaration ("this model does not consume allowance"), not a missing value,
30226
+ * so it must not be confused with the empty string that means nothing is known.
30227
+ *
30228
+ * The return is \`null\` rather than \`0\` for anything unparseable, so a caller can
30229
+ * tell "no rate published" from "a rate of zero".
30230
+ */
30231
+ function parseWorkBuddyCreditMultiplier(raw) {
30232
+ if (typeof raw !== "string") return null;
30233
+ const stripped = raw.replace(/\s*credits\s*$/i, "").trim().replace(/^[x×]/i, "").trim();
30234
+ if (stripped === "") return null;
30235
+ const value = Number(stripped);
30236
+ if (!Number.isFinite(value) || value < 0) return null;
30237
+ return stripped;
30238
+ }
30220
30239
  /** Every level this route can name, in escalating order (the card's sort key). */
30221
30240
  const WORKBUDDY_REASONING_EFFORTS = [
30222
30241
  "minimal",
@@ -30390,6 +30409,7 @@ const FALLBACK_MODELS$1 = [
30390
30409
  maxContextWindow: 56e3,
30391
30410
  maxTokens: 24e3,
30392
30411
  regions: ["cn"],
30412
+ credits: { cn: "2.00" },
30393
30413
  supportsImage: false,
30394
30414
  reasoningEfforts: [],
30395
30415
  defaultReasoningEffort: null,
@@ -30403,6 +30423,7 @@ const FALLBACK_MODELS$1 = [
30403
30423
  maxContextWindow: 2e5,
30404
30424
  maxTokens: 32e3,
30405
30425
  regions: ["intl"],
30426
+ credits: { intl: "0.34" },
30406
30427
  supportsImage: true,
30407
30428
  reasoningEfforts: [
30408
30429
  "low",
@@ -30420,6 +30441,7 @@ const FALLBACK_MODELS$1 = [
30420
30441
  maxContextWindow: 256e3,
30421
30442
  maxTokens: 32e3,
30422
30443
  regions: ["intl"],
30444
+ credits: { intl: "0.59" },
30423
30445
  supportsImage: true,
30424
30446
  reasoningEfforts: [
30425
30447
  "low",
@@ -30437,6 +30459,7 @@ const FALLBACK_MODELS$1 = [
30437
30459
  maxContextWindow: 272e3,
30438
30460
  maxTokens: 72e3,
30439
30461
  regions: ["intl"],
30462
+ credits: { intl: "3.31" },
30440
30463
  supportsImage: true,
30441
30464
  reasoningEfforts: [
30442
30465
  "low",
@@ -30454,6 +30477,7 @@ const FALLBACK_MODELS$1 = [
30454
30477
  maxContextWindow: 2e5,
30455
30478
  maxTokens: 24e3,
30456
30479
  regions: ["intl"],
30480
+ credits: { intl: "3.33" },
30457
30481
  supportsImage: true,
30458
30482
  reasoningEfforts: [],
30459
30483
  defaultReasoningEffort: null,
@@ -30468,6 +30492,7 @@ const FALLBACK_MODELS$1 = [
30468
30492
  maxContextWindow: 1e6,
30469
30493
  maxTokens: 128e3,
30470
30494
  regions: ["intl"],
30495
+ credits: { intl: "6.67" },
30471
30496
  supportsImage: true,
30472
30497
  reasoningEfforts: [
30473
30498
  "low",
@@ -30487,6 +30512,7 @@ const FALLBACK_MODELS$1 = [
30487
30512
  maxContextWindow: 1e6,
30488
30513
  maxTokens: 128e3,
30489
30514
  regions: ["intl"],
30515
+ credits: { intl: "3.47" },
30490
30516
  supportsImage: true,
30491
30517
  reasoningEfforts: [
30492
30518
  "low",
@@ -30506,6 +30532,7 @@ const FALLBACK_MODELS$1 = [
30506
30532
  maxContextWindow: 1e6,
30507
30533
  maxTokens: 128e3,
30508
30534
  regions: ["intl"],
30535
+ credits: { intl: "1.39" },
30509
30536
  supportsImage: true,
30510
30537
  reasoningEfforts: [
30511
30538
  "low",
@@ -30525,6 +30552,7 @@ const FALLBACK_MODELS$1 = [
30525
30552
  maxContextWindow: 1e6,
30526
30553
  maxTokens: 128e3,
30527
30554
  regions: ["intl"],
30555
+ credits: { intl: "0.14" },
30528
30556
  supportsImage: true,
30529
30557
  reasoningEfforts: [
30530
30558
  "low",
@@ -30544,6 +30572,7 @@ const FALLBACK_MODELS$1 = [
30544
30572
  maxContextWindow: 1e6,
30545
30573
  maxTokens: 128e3,
30546
30574
  regions: ["intl"],
30575
+ credits: { intl: "3.31" },
30547
30576
  supportsImage: true,
30548
30577
  reasoningEfforts: [
30549
30578
  "low",
@@ -30562,6 +30591,7 @@ const FALLBACK_MODELS$1 = [
30562
30591
  maxContextWindow: 272e3,
30563
30592
  maxTokens: 72e3,
30564
30593
  regions: ["intl"],
30594
+ credits: { intl: "1.65" },
30565
30595
  supportsImage: true,
30566
30596
  reasoningEfforts: [
30567
30597
  "low",
@@ -30580,6 +30610,10 @@ const FALLBACK_MODELS$1 = [
30580
30610
  maxContextWindow: 1e6,
30581
30611
  maxTokens: 48e3,
30582
30612
  regions: ["intl", "cn"],
30613
+ credits: {
30614
+ cn: "0.79",
30615
+ intl: "0.79"
30616
+ },
30583
30617
  supportsImage: true,
30584
30618
  reasoningEfforts: [
30585
30619
  "low",
@@ -30597,6 +30631,10 @@ const FALLBACK_MODELS$1 = [
30597
30631
  maxContextWindow: 1e6,
30598
30632
  maxTokens: 32e3,
30599
30633
  regions: ["intl", "cn"],
30634
+ credits: {
30635
+ cn: "0.06",
30636
+ intl: "0.06"
30637
+ },
30600
30638
  supportsImage: true,
30601
30639
  reasoningEfforts: [
30602
30640
  "low",
@@ -30614,6 +30652,10 @@ const FALLBACK_MODELS$1 = [
30614
30652
  maxContextWindow: 1e6,
30615
30653
  maxTokens: 48e3,
30616
30654
  regions: ["intl", "cn"],
30655
+ credits: {
30656
+ cn: "0.79",
30657
+ intl: "0.79"
30658
+ },
30617
30659
  supportsImage: true,
30618
30660
  reasoningEfforts: ["high", "xhigh"],
30619
30661
  defaultReasoningEffort: "high",
@@ -30627,6 +30669,7 @@ const FALLBACK_MODELS$1 = [
30627
30669
  maxContextWindow: 2e5,
30628
30670
  maxTokens: 48e3,
30629
30671
  regions: ["cn"],
30672
+ credits: { cn: "0.79" },
30630
30673
  supportsImage: true,
30631
30674
  reasoningEfforts: [
30632
30675
  "low",
@@ -30644,6 +30687,7 @@ const FALLBACK_MODELS$1 = [
30644
30687
  maxContextWindow: 2e5,
30645
30688
  maxTokens: 64e3,
30646
30689
  regions: ["cn"],
30690
+ credits: { cn: "0.71" },
30647
30691
  supportsImage: true,
30648
30692
  reasoningEfforts: [
30649
30693
  "low",
@@ -30661,6 +30705,7 @@ const FALLBACK_MODELS$1 = [
30661
30705
  maxContextWindow: 2e5,
30662
30706
  maxTokens: 48e3,
30663
30707
  regions: ["cn"],
30708
+ credits: { cn: "0.80" },
30664
30709
  supportsImage: false,
30665
30710
  reasoningEfforts: [],
30666
30711
  defaultReasoningEffort: null,
@@ -30674,6 +30719,7 @@ const FALLBACK_MODELS$1 = [
30674
30719
  maxContextWindow: 2e5,
30675
30720
  maxTokens: 48e3,
30676
30721
  regions: ["cn"],
30722
+ credits: { cn: "0.95" },
30677
30723
  supportsImage: false,
30678
30724
  reasoningEfforts: [
30679
30725
  "low",
@@ -30691,6 +30737,7 @@ const FALLBACK_MODELS$1 = [
30691
30737
  maxContextWindow: 2e5,
30692
30738
  maxTokens: 48e3,
30693
30739
  regions: ["cn"],
30740
+ credits: { cn: "0.23" },
30694
30741
  supportsImage: false,
30695
30742
  reasoningEfforts: [],
30696
30743
  defaultReasoningEffort: null,
@@ -30704,6 +30751,7 @@ const FALLBACK_MODELS$1 = [
30704
30751
  maxContextWindow: 128e3,
30705
30752
  maxTokens: 32e3,
30706
30753
  regions: ["cn"],
30754
+ credits: { cn: "0.11" },
30707
30755
  supportsImage: true,
30708
30756
  reasoningEfforts: [
30709
30757
  "low",
@@ -30721,6 +30769,7 @@ const FALLBACK_MODELS$1 = [
30721
30769
  maxContextWindow: 168e3,
30722
30770
  maxTokens: 32e3,
30723
30771
  regions: ["cn"],
30772
+ credits: { cn: "0.23" },
30724
30773
  supportsImage: false,
30725
30774
  reasoningEfforts: [],
30726
30775
  defaultReasoningEffort: null,
@@ -30734,6 +30783,7 @@ const FALLBACK_MODELS$1 = [
30734
30783
  maxContextWindow: 1e6,
30735
30784
  maxTokens: 32e3,
30736
30785
  regions: ["intl"],
30786
+ credits: { intl: "1.62" },
30737
30787
  supportsImage: true,
30738
30788
  reasoningEfforts: [
30739
30789
  "low",
@@ -30751,6 +30801,7 @@ const FALLBACK_MODELS$1 = [
30751
30801
  maxContextWindow: 1e6,
30752
30802
  maxTokens: 32e3,
30753
30803
  regions: ["cn"],
30804
+ credits: { cn: "1.62" },
30754
30805
  supportsImage: true,
30755
30806
  reasoningEfforts: [
30756
30807
  "low",
@@ -30768,6 +30819,10 @@ const FALLBACK_MODELS$1 = [
30768
30819
  maxContextWindow: 1e6,
30769
30820
  maxTokens: 32e3,
30770
30821
  regions: ["intl", "cn"],
30822
+ credits: {
30823
+ cn: "0.77",
30824
+ intl: "0.77"
30825
+ },
30771
30826
  supportsImage: true,
30772
30827
  reasoningEfforts: [
30773
30828
  "low",
@@ -30785,6 +30840,7 @@ const FALLBACK_MODELS$1 = [
30785
30840
  maxContextWindow: 256e3,
30786
30841
  maxTokens: 32e3,
30787
30842
  regions: ["cn"],
30843
+ credits: { cn: "0.57" },
30788
30844
  supportsImage: true,
30789
30845
  reasoningEfforts: [
30790
30846
  "low",
@@ -30802,6 +30858,10 @@ const FALLBACK_MODELS$1 = [
30802
30858
  maxContextWindow: 256e3,
30803
30859
  maxTokens: 32e3,
30804
30860
  regions: ["intl", "cn"],
30861
+ credits: {
30862
+ cn: "0.52",
30863
+ intl: "0.52"
30864
+ },
30805
30865
  supportsImage: true,
30806
30866
  reasoningEfforts: [
30807
30867
  "low",
@@ -30819,6 +30879,7 @@ const FALLBACK_MODELS$1 = [
30819
30879
  maxContextWindow: 164e3,
30820
30880
  maxTokens: 32e3,
30821
30881
  regions: ["cn"],
30882
+ credits: { cn: "0.45" },
30822
30883
  supportsImage: true,
30823
30884
  reasoningEfforts: [
30824
30885
  "low",
@@ -30836,6 +30897,7 @@ const FALLBACK_MODELS$1 = [
30836
30897
  maxContextWindow: 164e3,
30837
30898
  maxTokens: 32e3,
30838
30899
  regions: ["cn"],
30900
+ credits: { cn: "0.54" },
30839
30901
  supportsImage: false,
30840
30902
  reasoningEfforts: [
30841
30903
  "low",
@@ -30853,6 +30915,10 @@ const FALLBACK_MODELS$1 = [
30853
30915
  maxContextWindow: 1e6,
30854
30916
  maxTokens: 128e3,
30855
30917
  regions: ["intl", "cn"],
30918
+ credits: {
30919
+ cn: "0.11",
30920
+ intl: "0.00"
30921
+ },
30856
30922
  supportsImage: true,
30857
30923
  reasoningEfforts: [
30858
30924
  "low",
@@ -30870,6 +30936,7 @@ const FALLBACK_MODELS$1 = [
30870
30936
  maxContextWindow: 1e6,
30871
30937
  maxTokens: 128e3,
30872
30938
  regions: ["intl"],
30939
+ credits: { intl: "0.03" },
30873
30940
  supportsImage: true,
30874
30941
  reasoningEfforts: [
30875
30942
  "low",
@@ -30887,6 +30954,7 @@ const FALLBACK_MODELS$1 = [
30887
30954
  maxContextWindow: 1e6,
30888
30955
  maxTokens: 128e3,
30889
30956
  regions: ["cn"],
30957
+ credits: { cn: "0.51" },
30890
30958
  supportsImage: true,
30891
30959
  reasoningEfforts: [
30892
30960
  "low",
@@ -30904,6 +30972,7 @@ const FALLBACK_MODELS$1 = [
30904
30972
  maxContextWindow: 1e6,
30905
30973
  maxTokens: 5e4,
30906
30974
  regions: ["cn"],
30975
+ credits: { cn: "0.17" },
30907
30976
  supportsImage: true,
30908
30977
  reasoningEfforts: [
30909
30978
  "low",
@@ -30921,6 +30990,7 @@ const FALLBACK_MODELS$1 = [
30921
30990
  maxContextWindow: 96e3,
30922
30991
  maxTokens: 32e3,
30923
30992
  regions: ["cn"],
30993
+ credits: { cn: "0.29" },
30924
30994
  supportsImage: false,
30925
30995
  reasoningEfforts: [
30926
30996
  "low",
@@ -30938,6 +31008,10 @@ const FALLBACK_MODELS$1 = [
30938
31008
  maxContextWindow: 1e6,
30939
31009
  maxTokens: 64e3,
30940
31010
  regions: ["intl", "cn"],
31011
+ credits: {
31012
+ cn: "0.29",
31013
+ intl: "0.29"
31014
+ },
30941
31015
  supportsImage: true,
30942
31016
  reasoningEfforts: ["high"],
30943
31017
  defaultReasoningEffort: "high",
@@ -30951,6 +31025,7 @@ const FALLBACK_MODELS$1 = [
30951
31025
  maxContextWindow: 1e6,
30952
31026
  maxTokens: 64e3,
30953
31027
  regions: ["cn"],
31028
+ credits: { cn: "0.00" },
30954
31029
  supportsImage: true,
30955
31030
  reasoningEfforts: ["high"],
30956
31031
  defaultReasoningEffort: "high",
@@ -30964,6 +31039,10 @@ const FALLBACK_MODELS$1 = [
30964
31039
  maxContextWindow: 192e3,
30965
31040
  maxTokens: 64e3,
30966
31041
  regions: ["intl", "cn"],
31042
+ credits: {
31043
+ cn: "0.00",
31044
+ intl: "0.00"
31045
+ },
30967
31046
  supportsImage: true,
30968
31047
  reasoningEfforts: ["low", "high"],
30969
31048
  defaultReasoningEffort: "high",
@@ -30977,6 +31056,7 @@ const FALLBACK_MODELS$1 = [
30977
31056
  maxContextWindow: 192e3,
30978
31057
  maxTokens: 64e3,
30979
31058
  regions: ["cn"],
31059
+ credits: { cn: "0.05" },
30980
31060
  supportsImage: true,
30981
31061
  reasoningEfforts: [
30982
31062
  "low",
@@ -30994,6 +31074,7 @@ const FALLBACK_MODELS$1 = [
30994
31074
  maxContextWindow: 2e5,
30995
31075
  maxTokens: 8192,
30996
31076
  regions: ["cn"],
31077
+ credits: { cn: "0.10" },
30997
31078
  supportsImage: false,
30998
31079
  reasoningEfforts: [],
30999
31080
  defaultReasoningEffort: null,
@@ -31007,6 +31088,7 @@ const FALLBACK_MODELS$1 = [
31007
31088
  maxContextWindow: 1e6,
31008
31089
  maxTokens: 128e3,
31009
31090
  regions: ["cn"],
31091
+ credits: { cn: "0.08" },
31010
31092
  supportsImage: true,
31011
31093
  reasoningEfforts: [
31012
31094
  "low",
@@ -31026,6 +31108,7 @@ const FALLBACK_MODELS$1 = [
31026
31108
  maxContextWindow: 512e3,
31027
31109
  maxTokens: 64e3,
31028
31110
  regions: ["cn"],
31111
+ credits: { cn: "0.25" },
31029
31112
  supportsImage: true,
31030
31113
  reasoningEfforts: [
31031
31114
  "low",
@@ -31043,6 +31126,7 @@ const FALLBACK_MODELS$1 = [
31043
31126
  maxContextWindow: 2e5,
31044
31127
  maxTokens: 48e3,
31045
31128
  regions: ["cn"],
31129
+ credits: { cn: "0.19" },
31046
31130
  supportsImage: true,
31047
31131
  reasoningEfforts: [
31048
31132
  "low",
@@ -31060,6 +31144,7 @@ const FALLBACK_MODELS$1 = [
31060
31144
  maxContextWindow: 2e5,
31061
31145
  maxTokens: 48e3,
31062
31146
  regions: ["cn"],
31147
+ credits: { cn: "0.18" },
31063
31148
  supportsImage: false,
31064
31149
  reasoningEfforts: [
31065
31150
  "low",
@@ -31078,6 +31163,7 @@ const FALLBACK_MODELS$1 = [
31078
31163
  maxContextWindow: 1e6,
31079
31164
  maxTokens: 65536,
31080
31165
  regions: ["intl"],
31166
+ credits: { intl: "0.99" },
31081
31167
  supportsImage: true,
31082
31168
  reasoningEfforts: [
31083
31169
  "low",
@@ -31145,6 +31231,7 @@ function resolveWorkBuddyModel(id, catalog = FALLBACK_MODELS$1) {
31145
31231
  maxContextWindow: DEFAULT_CONTEXT_WINDOW$1,
31146
31232
  maxTokens: FALLBACK_MAX_TOKENS,
31147
31233
  regions: ["cn", "intl"],
31234
+ credits: {},
31148
31235
  supportsImage: false,
31149
31236
  reasoningEfforts: [],
31150
31237
  defaultReasoningEffort: null,
@@ -32151,6 +32238,14 @@ async function fetchAccountIdentity$1(credentials, options = {}) {
32151
32238
  * inferred from the model's name. Image-generation tools (`tags` naming
32152
32239
  * `text-to-image`/`image-to-image`) are skipped: they are not chat models and
32153
32240
  * carry no context window.
32241
+ *
32242
+ * `credits` is read here rather than left to the shipped table because a
32243
+ * reachable gateway **replaces** that table entirely: a multiplier transcribed
32244
+ * offline would be the only one a signed-in user ever saw, and it would stay
32245
+ * wrong the moment the subscription repriced a model. A string this route cannot
32246
+ * turn into a number (`''`, which `default-model` publishes, or a value a
32247
+ * future gateway invents) leaves the field off the entry altogether instead of
32248
+ * writing a plausible-looking `0` — see `parseWorkBuddyCreditMultiplier`.
32154
32249
  */
32155
32250
  function parseConfigModels(payload, region) {
32156
32251
  const root = asRecord$4(payload) ?? {};
@@ -32172,6 +32267,7 @@ function parseConfigModels(payload, region) {
32172
32267
  const declaredDefault = asString$5(reasoning.defaultEffort) ?? single ?? null;
32173
32268
  const modelDefault = declaredDefault === null || efforts.includes(declaredDefault) ? declaredDefault : convergeWorkBuddyEffort(declaredDefault, efforts);
32174
32269
  const servedDefault = asNumber$1(asRecord$4(record.contextWindow)?.defaultLength);
32270
+ const multiplier = parseWorkBuddyCreditMultiplier(record.credits);
32175
32271
  models.push({
32176
32272
  id,
32177
32273
  name: asString$5(record.name) ?? id,
@@ -32179,6 +32275,7 @@ function parseConfigModels(payload, region) {
32179
32275
  maxContextWindow,
32180
32276
  maxTokens: asNumber$1(record.maxOutputTokens) ?? 32768,
32181
32277
  regions: [region],
32278
+ ...multiplier === null ? {} : { credits: { [region]: multiplier } },
32182
32279
  supportsImage: record.supportsImages === true,
32183
32280
  reasoningEfforts: efforts,
32184
32281
  defaultReasoningEffort: modelDefault,
@@ -32792,6 +32889,13 @@ function resolveEnabledModelIds$2(stored, available, enabled = true) {
32792
32889
  * Order comes from the caller, which passes a vendor-grouped list so a family
32793
32890
  * is not interleaved with the next one; this preserves whatever order it is
32794
32891
  * given rather than imposing a second one.
32892
+ *
32893
+ * `credits` is passed through whole, every region the entry carries. Trimming
32894
+ * it to one account's region is tempting and wrong: this DTO is also read with
32895
+ * no account in hand (the harness resolves a model list before a credential is
32896
+ * chosen), and such a caller would be told nothing rather than everything. The
32897
+ * region key the reader actually has is already on each entry as `regions`, so
32898
+ * picking a value is the renderer's job, not this one's.
32795
32899
  */
32796
32900
  function buildModelOptions(catalog, available, enabledModelIds, overrides) {
32797
32901
  const enabled = new Set(enabledModelIds);
@@ -32809,6 +32913,7 @@ function buildModelOptions(catalog, available, enabledModelIds, overrides) {
32809
32913
  reasoningEfforts: [...workBuddyReasoningEfforts(id, catalog)],
32810
32914
  supportsImage: workBuddyModelSupportsImage(id, catalog),
32811
32915
  regions: [...entry.regions],
32916
+ ...entry.credits === void 0 || Object.keys(entry.credits).length === 0 ? {} : { credits: { ...entry.credits } },
32812
32917
  description: entry.description
32813
32918
  };
32814
32919
  });
@@ -7,7 +7,43 @@
7
7
  * behaviour is unchanged, and this one should stay render-shaped.
8
8
  */
9
9
  import React from 'react';
10
+ import type { WorkBuddyModelCredits, WorkBuddyRegion } from '../../shared/workbuddy-contracts.ts';
10
11
  import { type WorkBuddySectionProps } from './useWorkBuddySection.ts';
12
+ /**
13
+ * The consumption rate of one model, as the settings row states it.
14
+ *
15
+ * The gateway publishes one rate per region and the official CodeBuddy picker
16
+ * spells it beside a model as `6.67x`; the row uses the same shape behind the
17
+ * section's own label. Which rates reach the row depends on what the card knows
18
+ * about the account, and the two cases are deliberately different:
19
+ *
20
+ * - A KNOWN region shows that region's rate and nothing else. Borrowing the
21
+ * sibling region's number would state a price this account never pays —
22
+ * measured 2026-10-09, `deepseek-v4.1-flash` is `0.11` on cn against `0.00`
23
+ * on intl, and the backends reject a model asked of the wrong region anyway.
24
+ * - An UNKNOWN region (no account read back yet) shows both rates when the
25
+ * backends disagree, so the row is honest about the range instead of picking
26
+ * one of them. When they agree there is nothing to disambiguate.
27
+ *
28
+ * The two-region form is assembled entirely from the caller's labels: the
29
+ * qualifier comes from `labels.region(value, key)` and the join from
30
+ * `labels.pair(first, second)`, so the dictionary owns the region nouns, the
31
+ * bracket glyphs AND the separator. Nothing about the two-region string is
32
+ * spelled in this file, which is the point — the glyphs differ per language
33
+ * (`倍率 0.11x(国区) / 0.00x(国际区)` in Chinese,
34
+ * `Multiplier 0.11x (China) / 0.00x (International)` in English) and a
35
+ * separator chosen here would be right in at most one of them.
36
+ *
37
+ * `null` means "this row states no rate"; the caller drops it from the hint
38
+ * array rather than rendering a placeholder, because a guessed rate on a spend
39
+ * figure is worse than a missing one. `'0.00'` is a declaration — this model
40
+ * consumes no allowance — so it renders like any other value.
41
+ */
42
+ export declare function creditMultiplierHint(credits: WorkBuddyModelCredits | undefined, region: WorkBuddyRegion | null, labels: {
43
+ multiplier: string;
44
+ region: (value: string, key: WorkBuddyRegion) => string;
45
+ pair: (first: string, second: string) => string;
46
+ }): string | null;
11
47
  /** Mask a UIN so the card shows identity without publishing the full number. */
12
48
  export declare function maskUin(uin?: string | null): string;
13
49
  export declare function WorkBuddySection({ onModelChange, loadModelDirectory }: WorkBuddySectionProps): React.ReactElement;
@@ -1 +1 @@
1
- {"version":3,"file":"WorkBuddySection.d.ts","sourceRoot":"","sources":["../../../../src/client/workbuddy/WorkBuddySection.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAgB1F,gFAAgF;AAChF,wBAAgB,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAInD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,CAyVjH"}
1
+ {"version":3,"file":"WorkBuddySection.d.ts","sourceRoot":"","sources":["../../../../src/client/workbuddy/WorkBuddySection.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAEV,qBAAqB,EAGrB,eAAe,EAChB,MAAM,qCAAqC,CAAA;AAK5C,OAAO,EAAuB,KAAK,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAgB1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,qBAAqB,GAAG,SAAS,EAC1C,MAAM,EAAE,eAAe,GAAG,IAAI,EAC9B,MAAM,EAAE;IACN,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,eAAe,KAAK,MAAM,CAAA;IACvD,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAA;CAChD,GACA,MAAM,GAAG,IAAI,CA4Bf;AAED,gFAAgF;AAChF,wBAAgB,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAInD;AAED,wBAAgB,gBAAgB,CAAC,EAAE,aAAa,EAAE,kBAAkB,EAAE,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,CA4WjH"}
@@ -40,6 +40,9 @@ export declare const zh: {
40
40
  readonly unselectAll: "全不选";
41
41
  readonly imageSupport: "图片";
42
42
  readonly textOnly: "纯文本";
43
+ readonly creditMultiplier: "倍率";
44
+ readonly creditMultiplierRegion: "{value}({region})";
45
+ readonly creditMultiplierPair: "{first} / {second}";
43
46
  readonly regionBadge: "区域";
44
47
  readonly unavailableHere: "当前区域不可用";
45
48
  readonly enhanced: "增强功能";
@@ -123,6 +126,9 @@ export declare const en: {
123
126
  readonly unselectAll: "Deselect all";
124
127
  readonly imageSupport: "Images";
125
128
  readonly textOnly: "Text only";
129
+ readonly creditMultiplier: "Multiplier";
130
+ readonly creditMultiplierRegion: "{value} ({region})";
131
+ readonly creditMultiplierPair: "{first} / {second}";
126
132
  readonly regionBadge: "Regions";
127
133
  readonly unavailableHere: "Unavailable in this region";
128
134
  readonly enhanced: "Enhanced features";
@@ -207,6 +213,9 @@ export declare const dictionaries: {
207
213
  readonly unselectAll: "全不选";
208
214
  readonly imageSupport: "图片";
209
215
  readonly textOnly: "纯文本";
216
+ readonly creditMultiplier: "倍率";
217
+ readonly creditMultiplierRegion: "{value}({region})";
218
+ readonly creditMultiplierPair: "{first} / {second}";
210
219
  readonly regionBadge: "区域";
211
220
  readonly unavailableHere: "当前区域不可用";
212
221
  readonly enhanced: "增强功能";
@@ -290,6 +299,9 @@ export declare const dictionaries: {
290
299
  readonly unselectAll: "全不选";
291
300
  readonly imageSupport: "图片";
292
301
  readonly textOnly: "纯文本";
302
+ readonly creditMultiplier: "倍率";
303
+ readonly creditMultiplierRegion: "{value}({region})";
304
+ readonly creditMultiplierPair: "{first} / {second}";
293
305
  readonly regionBadge: "区域";
294
306
  readonly unavailableHere: "当前区域不可用";
295
307
  readonly enhanced: "增强功能";
@@ -373,6 +385,9 @@ export declare const dictionaries: {
373
385
  readonly unselectAll: "Deselect all";
374
386
  readonly imageSupport: "Images";
375
387
  readonly textOnly: "Text only";
388
+ readonly creditMultiplier: "Multiplier";
389
+ readonly creditMultiplierRegion: "{value} ({region})";
390
+ readonly creditMultiplierPair: "{first} / {second}";
376
391
  readonly regionBadge: "Regions";
377
392
  readonly unavailableHere: "Unavailable in this region";
378
393
  readonly enhanced: "Enhanced features";
@@ -456,6 +471,9 @@ export declare const dictionaries: {
456
471
  readonly unselectAll: "Deselect all";
457
472
  readonly imageSupport: "Images";
458
473
  readonly textOnly: "Text only";
474
+ readonly creditMultiplier: "Multiplier";
475
+ readonly creditMultiplierRegion: "{value} ({region})";
476
+ readonly creditMultiplierPair: "{first} / {second}";
459
477
  readonly regionBadge: "Regions";
460
478
  readonly unavailableHere: "Unavailable in this region";
461
479
  readonly enhanced: "Enhanced features";
@@ -1 +1 @@
1
- {"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../../../src/client/workbuddy/locales.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,kBAAkB,CAAA;AAE3C,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKxB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,EAAE,CAAA"}
@@ -49,6 +49,14 @@ export declare function fetchAccountIdentity(credentials: WorkBuddyCredentials,
49
49
  * inferred from the model's name. Image-generation tools (`tags` naming
50
50
  * `text-to-image`/`image-to-image`) are skipped: they are not chat models and
51
51
  * carry no context window.
52
+ *
53
+ * `credits` is read here rather than left to the shipped table because a
54
+ * reachable gateway **replaces** that table entirely: a multiplier transcribed
55
+ * offline would be the only one a signed-in user ever saw, and it would stay
56
+ * wrong the moment the subscription repriced a model. A string this route cannot
57
+ * turn into a number (`''`, which `default-model` publishes, or a value a
58
+ * future gateway invents) leaves the field off the entry altogether instead of
59
+ * writing a plausible-looking `0` — see `parseWorkBuddyCreditMultiplier`.
52
60
  */
53
61
  export declare function parseConfigModels(payload: unknown, region: WorkBuddyCredentials['region']): WorkBuddyModelEntry[];
54
62
  export declare function getCachedCatalog(): WorkBuddyModelEntry[];
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../src/host/workbuddy/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,EACf,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAiBL,WAAW,EACX,aAAa,EAKd,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,mBAAmB,EAAsB,KAAK,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;A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;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,qBAAqB,GAAG,SAAS,CAG9F;AAED,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,sBAA4B,EACjC,OAAO,GAAE,OAAO,KAAa,EAC7B,KAAK,UAAQ,EACb,SAAS,GAAE,MAAM,GAAG,IAAW,EAC/B,gBAAgB,GAAE,SAAS,MAAM,EAAO,GACvC,OAAO,CAAC,qBAAqB,CAAC,CAmEhC;AAED,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,CAAA"}
@@ -39,6 +39,17 @@
39
39
  * shipped default selection excludes them anyway. The adapter's failure message
40
40
  * names this case so a user knows to pick another model rather than to retry.
41
41
  *
42
+ * `credits` is the consumption multiplier the same payload publishes as a
43
+ * string (`x0.79 credits` on cn, `x6.67` on intl), stored here in the bare
44
+ * numeric form the settings card renders. It is kept per region because the two
45
+ * backends do not always agree — measured 2026-10-09, `deepseek-v4.1-flash`
46
+ * is `0.11` on cn against `0.00` on intl — and a key is written only for a
47
+ * region that actually published one (every `gpt-5.x` and `gpt-6-astra` is
48
+ * intl-only, the `minimax` and `glm-5.0`/`glm-4.x` rows carry no intl key).
49
+ * An empty string (`default-model`) means no rate was declared at all, so that
50
+ * row has no `credits` field rather than a zeroed one: a guessed rate on a
51
+ * spend figure is worse than a missing one.
52
+ *
42
53
  * `reasoningEfforts` carries the ladder a model accepts, transcribed from the
43
54
  * gateway's own declaration. `/v3/config` uses two shapes and they were once
44
55
  * conflated, in opposite directions: a lone `{ effort: 'high' }` (no
@@ -49,7 +60,7 @@
49
60
  * three the gateway declares explicitly for `glm-5.3-flash` and
50
61
  * `kimi-k2.8-preview`, and routes any other value into the nearest of them.
51
62
  */
52
- import type { WorkBuddyRegion } from '../../shared/workbuddy-contracts.ts';
63
+ import type { WorkBuddyModelCredits, WorkBuddyRegion } from '../../shared/workbuddy-contracts.ts';
53
64
  export interface WorkBuddyModelEntry {
54
65
  id: string;
55
66
  name: string;
@@ -68,6 +79,16 @@ export interface WorkBuddyModelEntry {
68
79
  maxTokens: number;
69
80
  /** Regions whose backend serves this id. */
70
81
  regions: readonly WorkBuddyRegion[];
82
+ /**
83
+ * Consumption multiplier per region, as `/v3/config` publishes it.
84
+ *
85
+ * Optional on purpose: the multiplier is the one field the gateway may omit
86
+ * for a model it otherwise describes (`default-model` ships an empty string),
87
+ * so every catalog literal in this repo — test fixtures and the live parser
88
+ * alike — must stay valid without it. Absent therefore means "nothing usable
89
+ * was published", never "zero": `x0.00` is a real declaration and is kept.
90
+ */
91
+ credits?: WorkBuddyModelCredits;
71
92
  /** Whether the model accepts image input. */
72
93
  supportsImage: boolean;
73
94
  /** Reasoning ladder the model accepts; empty for a non-reasoning model. */
@@ -174,6 +195,14 @@ export declare function modelsForRegion(region: WorkBuddyRegion, catalog?: reado
174
195
  export declare function workBuddyModelSupportsImage(id: string, catalog?: readonly WorkBuddyModelEntry[]): boolean;
175
196
  /** Reasoning ladder one model accepts. */
176
197
  export declare function workBuddyReasoningEfforts(id: string, catalog?: readonly WorkBuddyModelEntry[]): readonly string[];
198
+ /**
199
+ * Consumption multiplier per region one model publishes.
200
+ *
201
+ * Read through {@link resolveWorkBuddyModel} like the other accessors, so an id
202
+ * no catalog describes reports `{}` — "no rate published" rather than a rate
203
+ * of zero.
204
+ */
205
+ export declare function workBuddyModelCredits(id: string, catalog?: readonly WorkBuddyModelEntry[]): WorkBuddyModelCredits;
177
206
  /** Output cap requested when the caller omits one. */
178
207
  export declare function maxOutputTokensFor(id: string, catalog?: readonly WorkBuddyModelEntry[]): number;
179
208
  /** Context window assumed when no override is saved. */
@@ -1 +1 @@
1
- {"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/workbuddy/model-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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X,OAAO,GAAE,SAAS,mBAAmB,EAAoB,GACxD,EAAE,IAAI,MAAM,CAEd;AAoCD,8CAA8C;AAC9C,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAMvD;AAwCD;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAWhG;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,eAAe,EACvB,OAAO,GAAE,SAAS,mBAAmB,EAAoB,GACxD,mBAAmB,EAAE,CAEvB;AAED,6CAA6C;AAC7C,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,SAAS,mBAAmB,EAAoB,GACxD,OAAO,CAET;AAED,0CAA0C;AAC1C,wBAAgB,yBAAyB,CACvC,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,SAAS,mBAAmB,EAAoB,GACxD,SAAS,MAAM,EAAE,CAEnB;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,SAAS,mBAAmB,EAAoB,GACxD,qBAAqB,CAEvB;AAED,sDAAsD;AACtD,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,SAAS,mBAAmB,EAAoB,GACxD,MAAM,CAER;AAED,wDAAwD;AACxD,wBAAgB,uBAAuB,CACrC,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,SAAS,mBAAmB,EAAoB,GACxD,MAAM,CAER"}
@@ -21,6 +21,13 @@ export declare function resolveEnabledModelIds(stored: readonly string[], availa
21
21
  * Order comes from the caller, which passes a vendor-grouped list so a family
22
22
  * is not interleaved with the next one; this preserves whatever order it is
23
23
  * given rather than imposing a second one.
24
+ *
25
+ * `credits` is passed through whole, every region the entry carries. Trimming
26
+ * it to one account's region is tempting and wrong: this DTO is also read with
27
+ * no account in hand (the harness resolves a model list before a credential is
28
+ * chosen), and such a caller would be told nothing rather than everything. The
29
+ * region key the reader actually has is already on each entry as `regions`, so
30
+ * picking a value is the renderer's job, not this one's.
24
31
  */
25
32
  export declare function buildModelOptions(catalog: readonly WorkBuddyModelEntry[], available: readonly string[], enabledModelIds: readonly string[], overrides: Record<string, number>): WorkBuddyModelOption[];
26
33
  export interface WorkBuddyStatusOptions {