@mars-sea/dsh-commandcode-provider 0.13.3 → 0.13.4

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
@@ -61,7 +61,7 @@ type CommandCodeProtocol = 'cli' | 'openai' | 'messages';
61
61
  declare const DEFAULT_MAX_OUTPUT_TOKENS = 131072;
62
62
  //#endregion
63
63
  //#region src/adapter.d.ts
64
- declare const COMMAND_CODE_CLI_VERSION = "1.82.2";
64
+ declare const COMMAND_CODE_CLI_VERSION = "1.82.5";
65
65
  declare const DEFAULT_API_BASE = "https://api.commandcode.ai";
66
66
  /**
67
67
  * The output budget this bundle asks for, and the ceiling it will never exceed.
@@ -184,6 +184,18 @@ interface CommandCodeConnectionOptions {
184
184
  * before, so composition configs and the web page are unaffected.
185
185
  */
186
186
  modelVisibility?: Readonly<Record<string, boolean>> | undefined;
187
+ /**
188
+ * 自定义上下文长度(全局值,issue #86):对没有 {@link contextWindowOverrides}
189
+ * 条目的目录模型,宣告给宿主的上下文窗口改用此值而非目录的
190
+ * `context_length`;选择器标注、`defaultMaxTokens` 预算同样跟随。
191
+ * 留空表示完全跟随目录。
192
+ */
193
+ contextWindow?: number | undefined;
194
+ /**
195
+ * 按模型的自定义上下文长度,键为目录模型 id;优先于 {@link contextWindow}。
196
+ * 非法条目在 `resolveAdapterOptions` 已被清洗,这里只读已判定的值。
197
+ */
198
+ contextWindowOverrides?: Readonly<Record<string, number>> | undefined;
187
199
  /**
188
200
  * Optional protocol hint. `'auto'` (default) uses billing/cache plus
189
201
  * Provider API fallback; `'cli'` forces `/alpha/generate`; `'openai'`
@@ -1001,14 +1013,16 @@ declare const KNOWN_EFFORTS: Readonly<Record<string, readonly string[]>>;
1001
1013
  */
1002
1014
  declare const KNOWN_IMAGE_MODELS: ReadonlySet<string>;
1003
1015
  /**
1004
- * Models WITHOUT a zero-data-retention upstream, per the official CLI's own
1005
- * registry (`command-code@1.82.1` `dist/cli.mjs`): `modelSupportsZdr(id)` is
1006
- * exactly `!nonZdrSet.has(canonicalize(id))`, and `knownModelSupportsZdr`
1007
- * carries the same membership in the sibling route table — the UNION of both
1008
- * is this set. Reading only the sibling route table dropped
1009
- * `meituan/LongCat-2.0`, which sat in `modelSupportsZdr` alone through
1010
- * 1.73.0; the 1.74.3 table lists it in NEITHER set, so as of this snapshot it
1011
- * is no longer excluded. The official docs (commandcode.ai/docs/resources/
1016
+ * Models WITHOUT a zero-data-retention upstream. Through command-code@1.82.2
1017
+ * the CLI's own registry answered this: `modelSupportsZdr(id)` was exactly
1018
+ * `!nonZdrSet.has(canonicalize(id))`, and `knownModelSupportsZdr` carried the
1019
+ * membership in the sibling route table — the UNION of both was this set, and
1020
+ * the two anchors disagreed by one id (`meituan/LongCat-2.0:free`, which 1.74.1
1021
+ * dropped from the first anchor while the canonical helper kept it).
1022
+ * command-code@1.82.4 removes that disagreement by making the verdict a catalog
1023
+ * lookup — `resolveKnownCatalogModel({model,catalog})?.zdr ?? false` — so this
1024
+ * set is now the live catalog's `zdr:false` membership and nothing more. The
1025
+ * official docs (commandcode.ai/docs/resources/
1012
1026
  * zdr) put coverage in prose — "99% of our models have ZDR-capable upstreams … only
1013
1027
  * a small handful of models are affected" — so the CLI's exclusion list is
1014
1028
  * the only per-model evidence there is; a ZDR request naming one of these
@@ -1021,10 +1035,19 @@ declare const KNOWN_IMAGE_MODELS: ReadonlySet<string>;
1021
1035
  * switch is on — the provider remains the routing authority and refuses an
1022
1036
  * unsupported model rather than silently dropping the privacy guarantee.
1023
1037
  *
1024
- * `minimax/minimax-m3-free` is the one entry the public catalog
1025
- * (`/provider/v1/models`) does not serve (it is CLI/pricing-visible and hidden
1026
- * from the picker); it stays listed because the CLI carries it and a Go-plan
1027
- * request can still name it.
1038
+ * `minimax/minimax-m3-free` is the one entry the public catalog's default view
1039
+ * (`/provider/v1/models`) does not serve through the picker (it is CLI/pricing-visible
1040
+ * and hidden from the picker); it stays listed because the CLI carries it and a Go-plan
1041
+ * request can still name it. Both this row and `stealth/cat-jam:free` ARE served
1042
+ * by the `?view=client` catalog, which is where the 1.82.4 verdict comes from.
1043
+ *
1044
+ * command-code@1.82.4 moved the authority for this verdict: `knownModelSupportsZdr`
1045
+ * no longer negates a bundled Set, it returns `resolveKnownCatalogModel({model,
1046
+ * catalog})?.zdr ?? false`, so an id the catalog does not carry (or carries with
1047
+ * `zdr:false`) is NOT covered. That inverts the default this helper was built on
1048
+ * ("not listed" answered TRUE); the snapshot keeps its negative-set shape because
1049
+ * 99% of the catalog is still covered, but membership is now read from the
1050
+ * `?view=client` catalog and confirmed against the canonical helper set.
1028
1051
  *
1029
1052
  * Keep in sync via the dsh-commandcode-upstream skill: the CLI's registry data
1030
1053
  * (its `zdr:{only:[…]}` provider routes and the per-provider `zdr`/`noTraining`
@@ -1045,6 +1068,11 @@ declare const KNOWN_IMAGE_MODELS: ReadonlySet<string>;
1045
1068
  * `listSelectableModelIds()`, so they are pruned along with the rest of the
1046
1069
  * tables and `supportsZeroDataRetention` now answers TRUE for them, matching
1047
1070
  * what the current CLI says.
1071
+ *
1072
+ * 1.82.4 then reversed 1.74.1's removal of `meituan/LongCat-2.0:free` and added
1073
+ * the `stealth/cat-jam:free` preview, taking this set to 24 members — the size
1074
+ * of the live catalog's `zdr:false` list. The canonical helper set still carries
1075
+ * 23 because `cat-jam:free` postdates the artifact's embedded snapshot.
1048
1076
  */
1049
1077
  declare const KNOWN_NON_ZDR_MODELS: ReadonlySet<string>;
1050
1078
  /**
@@ -1074,15 +1102,20 @@ declare const KNOWN_THINKING_MODELS: ReadonlySet<string>;
1074
1102
  * `/docs/plans/max` and `/docs/resources/pricing-limits`). Each plan's model
1075
1103
  * list is a superset of the one below it: Go ⊂ GOAT ⊂ Pro ⊂ Provider/Max.
1076
1104
  * Models absent from every plan list (Claude Opus/Fable, Fugu Ultra) are
1077
- * Provider-tier. Re-verified at command-code@1.82.1 (2026-10-14): 89 catalog
1078
- * ids at 54/64/79/87/89 cumulative, a strict superset chain. Mistral Large 4
1105
+ * Provider-tier. Re-verified at command-code@1.82.4 (2026-10-16) against the
1106
+ * live `?view=client` catalog: 93 ids, still a strict superset chain. Mistral
1107
+ * Large 4
1079
1108
  * (1.75.0) was the only addition at the 1.77.0 check; the 1.78.0/1.79.0 pair
1080
1109
  * added Claude Haiku 5.5 at Pro and the free Glyph Cluster preview at Go.
1081
1110
  * 1.79.2 lowers Haiku 5.5's minimum plan to GOAT; 1.80.0 adds Muse Wonder at
1082
- * Max; 1.82.0 adds Gemini 4 Argon at Pro and nothing else moves. Every other
1111
+ * Max; 1.82.0 adds Gemini 4 Argon at Pro and nothing else moves. The 1.82.4
1112
+ * train adds Qwen 3.8 Max Prime at GOAT plus Muse Spark Open, Nemotron 3.5
1113
+ * Super VL and the free Cat Jam preview at Go, and drops Ling 3.0 Flash Sante,
1114
+ * which left the live catalog. Every other
1083
1115
  * tier is unchanged.
1084
1116
  * The only removals since 1.49.0 are the two retired stealth previews (Pixel
1085
- * Canary at 1.73.1, Space Bunny Alpha at 1.74.3). Per-entry tags below name the
1117
+ * Canary at 1.73.1, Space Bunny Alpha at 1.74.3) and Ling 3.0 Flash Sante
1118
+ * (2026-10-16). Per-entry tags below name the
1086
1119
  * releases that added or moved each row.
1087
1120
  *
1088
1121
  * The Provider API exposes no plan metadata, so this snapshot is the source of
@@ -2192,6 +2225,20 @@ interface Config {
2192
2225
  * path per model — a map.
2193
2226
  */
2194
2227
  modelVisibility?: Record<string, boolean>;
2228
+ /**
2229
+ * 自定义上下文长度(全局值,issue #86):宣告给宿主的上下文窗口不再取
2230
+ * 模型目录的 `context_length`,而用这个值——上下文计量、自动压缩时机与
2231
+ * 选择器上的上下文标注都跟随它。对没有 {@link contextWindowOverrides}
2232
+ * 条目的每个目录模型生效;留空(默认)跟随目录。只对目录中存在的模型
2233
+ * 生效,未知模型保持既有的「无上下文宣告」。范围 1 – 10 000 000 个整数 token。
2234
+ */
2235
+ contextWindow?: number;
2236
+ /**
2237
+ * 按模型的自定义上下文长度,键为目录模型 id;优先于全局
2238
+ * {@link contextWindow}。配置校验拒绝非整数及越界值;绕过校验的程序化
2239
+ * 调用还会丢弃无效条目,按全局值、目录值的顺序回落。
2240
+ */
2241
+ contextWindowOverrides?: Record<string, number>;
2195
2242
  /**
2196
2243
  * Extra accounts for multi-account rotation. The top-level
2197
2244
  * `apiKey`/`apiKeyEnv` (plus the CLI auth file) always form the first
package/lib/index.js CHANGED
@@ -103,7 +103,7 @@ const PLAN_ORDER = Object.fromEntries(PLAN_TIER_ORDER.map((tier, index) => [tier
103
103
  * subscription-plan labels, deals, and hourly (peak/off-peak) pricing.
104
104
  *
105
105
  * Everything here is synced from official sources — the command-code CLI
106
- * bundle's model table (`dist/cli.mjs`, re-verified at command-code@1.82.1) and
106
+ * bundle's model table (`dist/cli.mjs`, re-verified at command-code@1.82.5) and
107
107
  * the official plan/pricing/model docs; see the dsh-commandcode-upstream skill
108
108
  * for the extraction procedures. Keeping the snapshot in its own module
109
109
  * confines those frequent sync diffs here: src/adapter.ts holds only the stable
@@ -138,6 +138,11 @@ const KNOWN_EFFORTS = {
138
138
  "medium",
139
139
  "xhigh"
140
140
  ],
141
+ "Qwen/Qwen3.8-Max-Prime": [
142
+ "low",
143
+ "medium",
144
+ "xhigh"
145
+ ],
141
146
  "claude-fable-5-1": [
142
147
  "low",
143
148
  "medium",
@@ -391,6 +396,16 @@ const KNOWN_EFFORTS = {
391
396
  "high",
392
397
  "xhigh"
393
398
  ],
399
+ "meta/muse-spark-open": [
400
+ "low",
401
+ "medium",
402
+ "high"
403
+ ],
404
+ "nvidia/nemotron-3.5-super-vl": [
405
+ "low",
406
+ "medium",
407
+ "high"
408
+ ],
394
409
  "gpt-6-astra": [
395
410
  "low",
396
411
  "medium",
@@ -453,6 +468,13 @@ const KNOWN_EFFORTS = {
453
468
  "medium",
454
469
  "high",
455
470
  "xhigh"
471
+ ],
472
+ "stealth/cat-jam:free": [
473
+ "low",
474
+ "medium",
475
+ "high",
476
+ "xhigh",
477
+ "max"
456
478
  ]
457
479
  };
458
480
  /**
@@ -480,6 +502,7 @@ const KNOWN_IMAGE_MODELS = /* @__PURE__ */ new Set([
480
502
  "Qwen/Qwen3.8-Max",
481
503
  "Qwen/Qwen3.8-Max-0902",
482
504
  "Qwen/Qwen3.8-Omni-Flash",
505
+ "Qwen/Qwen3.8-Max-Prime",
483
506
  "claude-fable-5-1",
484
507
  "claude-fable-5",
485
508
  "claude-haiku-4-5-20251001",
@@ -518,6 +541,8 @@ const KNOWN_IMAGE_MODELS = /* @__PURE__ */ new Set([
518
541
  "meta/muse-spark-1.3",
519
542
  "meta/muse-spark-1.3-contributor",
520
543
  "meta/muse-wonder-1.0",
544
+ "meta/muse-spark-open",
545
+ "nvidia/nemotron-3.5-super-vl",
521
546
  "mistral/mistral-large-4",
522
547
  "moonshotai/Kimi-K2.5",
523
548
  "moonshotai/Kimi-K2.6",
@@ -540,14 +565,16 @@ const KNOWN_IMAGE_MODELS = /* @__PURE__ */ new Set([
540
565
  "z-ai/glm-5.3-flashx"
541
566
  ]);
542
567
  /**
543
- * Models WITHOUT a zero-data-retention upstream, per the official CLI's own
544
- * registry (`command-code@1.82.1` `dist/cli.mjs`): `modelSupportsZdr(id)` is
545
- * exactly `!nonZdrSet.has(canonicalize(id))`, and `knownModelSupportsZdr`
546
- * carries the same membership in the sibling route table — the UNION of both
547
- * is this set. Reading only the sibling route table dropped
548
- * `meituan/LongCat-2.0`, which sat in `modelSupportsZdr` alone through
549
- * 1.73.0; the 1.74.3 table lists it in NEITHER set, so as of this snapshot it
550
- * is no longer excluded. The official docs (commandcode.ai/docs/resources/
568
+ * Models WITHOUT a zero-data-retention upstream. Through command-code@1.82.2
569
+ * the CLI's own registry answered this: `modelSupportsZdr(id)` was exactly
570
+ * `!nonZdrSet.has(canonicalize(id))`, and `knownModelSupportsZdr` carried the
571
+ * membership in the sibling route table — the UNION of both was this set, and
572
+ * the two anchors disagreed by one id (`meituan/LongCat-2.0:free`, which 1.74.1
573
+ * dropped from the first anchor while the canonical helper kept it).
574
+ * command-code@1.82.4 removes that disagreement by making the verdict a catalog
575
+ * lookup — `resolveKnownCatalogModel({model,catalog})?.zdr ?? false` — so this
576
+ * set is now the live catalog's `zdr:false` membership and nothing more. The
577
+ * official docs (commandcode.ai/docs/resources/
551
578
  * zdr) put coverage in prose — "99% of our models have ZDR-capable upstreams … only
552
579
  * a small handful of models are affected" — so the CLI's exclusion list is
553
580
  * the only per-model evidence there is; a ZDR request naming one of these
@@ -560,10 +587,19 @@ const KNOWN_IMAGE_MODELS = /* @__PURE__ */ new Set([
560
587
  * switch is on — the provider remains the routing authority and refuses an
561
588
  * unsupported model rather than silently dropping the privacy guarantee.
562
589
  *
563
- * `minimax/minimax-m3-free` is the one entry the public catalog
564
- * (`/provider/v1/models`) does not serve (it is CLI/pricing-visible and hidden
565
- * from the picker); it stays listed because the CLI carries it and a Go-plan
566
- * request can still name it.
590
+ * `minimax/minimax-m3-free` is the one entry the public catalog's default view
591
+ * (`/provider/v1/models`) does not serve through the picker (it is CLI/pricing-visible
592
+ * and hidden from the picker); it stays listed because the CLI carries it and a Go-plan
593
+ * request can still name it. Both this row and `stealth/cat-jam:free` ARE served
594
+ * by the `?view=client` catalog, which is where the 1.82.4 verdict comes from.
595
+ *
596
+ * command-code@1.82.4 moved the authority for this verdict: `knownModelSupportsZdr`
597
+ * no longer negates a bundled Set, it returns `resolveKnownCatalogModel({model,
598
+ * catalog})?.zdr ?? false`, so an id the catalog does not carry (or carries with
599
+ * `zdr:false`) is NOT covered. That inverts the default this helper was built on
600
+ * ("not listed" answered TRUE); the snapshot keeps its negative-set shape because
601
+ * 99% of the catalog is still covered, but membership is now read from the
602
+ * `?view=client` catalog and confirmed against the canonical helper set.
567
603
  *
568
604
  * Keep in sync via the dsh-commandcode-upstream skill: the CLI's registry data
569
605
  * (its `zdr:{only:[…]}` provider routes and the per-provider `zdr`/`noTraining`
@@ -584,6 +620,11 @@ const KNOWN_IMAGE_MODELS = /* @__PURE__ */ new Set([
584
620
  * `listSelectableModelIds()`, so they are pruned along with the rest of the
585
621
  * tables and `supportsZeroDataRetention` now answers TRUE for them, matching
586
622
  * what the current CLI says.
623
+ *
624
+ * 1.82.4 then reversed 1.74.1's removal of `meituan/LongCat-2.0:free` and added
625
+ * the `stealth/cat-jam:free` preview, taking this set to 24 members — the size
626
+ * of the live catalog's `zdr:false` list. The canonical helper set still carries
627
+ * 23 because `cat-jam:free` postdates the artifact's embedded snapshot.
587
628
  */
588
629
  const KNOWN_NON_ZDR_MODELS = /* @__PURE__ */ new Set([
589
630
  "MiniMaxAI/MiniMax-M3",
@@ -595,10 +636,12 @@ const KNOWN_NON_ZDR_MODELS = /* @__PURE__ */ new Set([
595
636
  "meta/muse-spark-1.3",
596
637
  "meta/muse-spark-1.3-contributor",
597
638
  "meta/muse-wonder-1.0",
639
+ "meituan/LongCat-2.0:free",
598
640
  "minimax/minimax-m3-free",
599
641
  "poolside/laguna-s-2.1-free",
600
642
  "sakana/fugu-ultra",
601
643
  "stealth/glyph-cluster:free",
644
+ "stealth/cat-jam:free",
602
645
  "stepfun/Step-3.7-Flash",
603
646
  "stepfun/Step-5-Preview",
604
647
  "xai/grok-4.5",
@@ -646,8 +689,7 @@ const KNOWN_THINKING_MODELS = /* @__PURE__ */ new Set([
646
689
  "thinkingmachines/inkling",
647
690
  "thinkingmachines/inkling-small",
648
691
  "poolside/laguna-s-2.1-free",
649
- "meituan/LongCat-2.0",
650
- "inclusionai/ling-3.0-flash-sante:free"
692
+ "meituan/LongCat-2.0"
651
693
  ]);
652
694
  /**
653
695
  * Catalog models the Provider API serves ONLY through `/provider/v1/messages`
@@ -715,11 +757,12 @@ function requiresMessagesEndpoint(modelId) {
715
757
  * catalog ids as of 2026-10-15. Each row carries a comment naming the entry it
716
758
  * came from.
717
759
  *
718
- * One of those 76 rests on more than a vendor lookup, hand-recorded in the
719
- * script's `MANUAL_CEILINGS`: `inclusionai/ling-3.0-flash-sante:free` (32768)
720
- * lost both its vendor row and its unanimous third-party vote (vercel files
721
- * 32000), and is pinned so a regeneration cannot drop a live model's ceiling
722
- * back to the default. (`gpt-6.1-sol` (128000) needs no pin — OpenAI's own row
760
+ * No row needs a hand-recorded pin as of 2026-10-16: the one that did
761
+ * (`inclusionai/ling-3.0-flash-sante:free`, pinned at 32768 because it had lost
762
+ * both its vendor row and its unanimous third-party vote) left the live catalog
763
+ * with the 1.82.4 catalog migration, so the script's `MANUAL_CEILINGS` map is
764
+ * now empty and every remaining row resolves from a vendor row or a unanimous
765
+ * third-party vote. (`gpt-6.1-sol` (128000) never needed a pin — OpenAI's own row
723
766
  * carries it and every other provider carrying the id agrees.) All are still
724
767
  * correctable — a stricter gateway costs one refused request, and
725
768
  * `streamRequest()` remembers what the endpoint said.
@@ -769,7 +812,6 @@ const MODEL_OUTPUT_TOKEN_LIMITS = /* @__PURE__ */ new Map([
769
812
  ["gpt-6-luna", 128e3],
770
813
  ["gpt-6-sol", 128e3],
771
814
  ["gpt-6.1-sol", 128e3],
772
- ["inclusionai/ling-3.0-flash-sante:free", 32768],
773
815
  ["meituan/LongCat-2.0", 131072],
774
816
  ["meta/muse-spark-1.1", 131072],
775
817
  ["meta/muse-spark-1.2", 131072],
@@ -820,15 +862,20 @@ const MODEL_OUTPUT_TOKEN_LIMITS = /* @__PURE__ */ new Map([
820
862
  * `/docs/plans/max` and `/docs/resources/pricing-limits`). Each plan's model
821
863
  * list is a superset of the one below it: Go ⊂ GOAT ⊂ Pro ⊂ Provider/Max.
822
864
  * Models absent from every plan list (Claude Opus/Fable, Fugu Ultra) are
823
- * Provider-tier. Re-verified at command-code@1.82.1 (2026-10-14): 89 catalog
824
- * ids at 54/64/79/87/89 cumulative, a strict superset chain. Mistral Large 4
865
+ * Provider-tier. Re-verified at command-code@1.82.4 (2026-10-16) against the
866
+ * live `?view=client` catalog: 93 ids, still a strict superset chain. Mistral
867
+ * Large 4
825
868
  * (1.75.0) was the only addition at the 1.77.0 check; the 1.78.0/1.79.0 pair
826
869
  * added Claude Haiku 5.5 at Pro and the free Glyph Cluster preview at Go.
827
870
  * 1.79.2 lowers Haiku 5.5's minimum plan to GOAT; 1.80.0 adds Muse Wonder at
828
- * Max; 1.82.0 adds Gemini 4 Argon at Pro and nothing else moves. Every other
871
+ * Max; 1.82.0 adds Gemini 4 Argon at Pro and nothing else moves. The 1.82.4
872
+ * train adds Qwen 3.8 Max Prime at GOAT plus Muse Spark Open, Nemotron 3.5
873
+ * Super VL and the free Cat Jam preview at Go, and drops Ling 3.0 Flash Sante,
874
+ * which left the live catalog. Every other
829
875
  * tier is unchanged.
830
876
  * The only removals since 1.49.0 are the two retired stealth previews (Pixel
831
- * Canary at 1.73.1, Space Bunny Alpha at 1.74.3). Per-entry tags below name the
877
+ * Canary at 1.73.1, Space Bunny Alpha at 1.74.3) and Ling 3.0 Flash Sante
878
+ * (2026-10-16). Per-entry tags below name the
832
879
  * releases that added or moved each row.
833
880
  *
834
881
  * The Provider API exposes no plan metadata, so this snapshot is the source of
@@ -852,6 +899,7 @@ const KNOWN_PLANS = {
852
899
  "Qwen/Qwen3.8-Flash": "go",
853
900
  "Qwen/Qwen3.8-Max": "go",
854
901
  "Qwen/Qwen3.8-Max-0902": "go",
902
+ "Qwen/Qwen3.8-Max-Prime": "goat",
855
903
  "Qwen/Qwen3.8-Omni-Flash": "go",
856
904
  "deepseek/deepseek-v4-flash-fast": "go",
857
905
  "deepseek/deepseek-v4.1-flash": "go",
@@ -862,10 +910,10 @@ const KNOWN_PLANS = {
862
910
  "gpt-5.6-luna": "go",
863
911
  "gpt-6-luna": "go",
864
912
  "meituan/LongCat-2.0": "go",
865
- "inclusionai/ling-3.0-flash-sante:free": "go",
866
913
  "inclusionai/ling-3.1-flash": "go",
867
914
  "meta/muse-spark-1.2-contributor": "go",
868
915
  "meta/muse-spark-1.3-contributor": "go",
916
+ "meta/muse-spark-open": "go",
869
917
  "mistral/mistral-large-4": "go",
870
918
  "moonshotai/Kimi-K2.5": "go",
871
919
  "moonshotai/Kimi-K2.6": "go",
@@ -873,10 +921,12 @@ const KNOWN_PLANS = {
873
921
  "moonshotai/Kimi-K2.7-Code-Highspeed": "go",
874
922
  "moonshotai/Kimi-K3": "go",
875
923
  "nvidia/nemotron-3-ultra-550b-a55b": "go",
924
+ "nvidia/nemotron-3.5-super-vl": "go",
876
925
  "poolside/laguna-s-2.1-free": "go",
877
926
  "stepfun/Step-3.5-Flash": "go",
878
927
  "stepfun/Step-3.7-Flash": "go",
879
928
  "stepfun/Step-5-Preview": "go",
929
+ "stealth/cat-jam:free": "go",
880
930
  "stealth/glyph-cluster:free": "go",
881
931
  "tencent/hy3-paid": "go",
882
932
  "tencent/hy4-preview": "go",
@@ -1069,7 +1119,7 @@ const KNOWN_DEALS = {
1069
1119
  label: "FREE",
1070
1120
  free: true
1071
1121
  },
1072
- "inclusionai/ling-3.0-flash-sante:free": {
1122
+ "stealth/cat-jam:free": {
1073
1123
  label: "FREE",
1074
1124
  free: true
1075
1125
  },
@@ -1825,8 +1875,8 @@ const MODEL_PRICE_ROWS = [
1825
1875
  ],
1826
1876
  allowance: {
1827
1877
  go: 6,
1828
- goat: 70,
1829
- pro: 80
1878
+ goat: 20,
1879
+ pro: 30
1830
1880
  },
1831
1881
  contextTiers: [{
1832
1882
  "maxContext": 272e3,
@@ -2146,8 +2196,8 @@ const MODEL_PRICE_ROWS = [
2146
2196
  ],
2147
2197
  allowance: {
2148
2198
  go: 6,
2149
- goat: 20,
2150
- pro: 30
2199
+ goat: 100,
2200
+ pro: 110
2151
2201
  }
2152
2202
  },
2153
2203
  {
@@ -2360,6 +2410,19 @@ const MODEL_PRICE_ROWS = [
2360
2410
  pro: 30
2361
2411
  }
2362
2412
  },
2413
+ {
2414
+ id: "muse-spark-open",
2415
+ rates: [
2416
+ 1.25,
2417
+ 4.25,
2418
+ .15
2419
+ ],
2420
+ allowance: {
2421
+ go: 6,
2422
+ goat: 20,
2423
+ pro: 30
2424
+ }
2425
+ },
2363
2426
  {
2364
2427
  id: "muse-wonder-1.0",
2365
2428
  rates: [
@@ -2386,6 +2449,19 @@ const MODEL_PRICE_ROWS = [
2386
2449
  pro: 30
2387
2450
  }
2388
2451
  },
2452
+ {
2453
+ id: "nemotron-3.5-super-vl",
2454
+ rates: [
2455
+ .2,
2456
+ .5,
2457
+ .04
2458
+ ],
2459
+ allowance: {
2460
+ go: 6,
2461
+ goat: 20,
2462
+ pro: 30
2463
+ }
2464
+ },
2389
2465
  {
2390
2466
  id: "qwen-3.6-max",
2391
2467
  rates: [
@@ -2664,6 +2740,19 @@ const MODEL_PRICE_ROWS = [
2664
2740
  goat: 20,
2665
2741
  pro: 30
2666
2742
  }
2743
+ },
2744
+ {
2745
+ id: "typesafe/jev-1.14.0",
2746
+ rates: [
2747
+ .042,
2748
+ 0,
2749
+ 0
2750
+ ],
2751
+ allowance: {
2752
+ go: 6,
2753
+ goat: 20,
2754
+ pro: 30
2755
+ }
2667
2756
  }
2668
2757
  ];
2669
2758
  /**
@@ -3552,6 +3641,41 @@ function modelIsVisible(id, allowlist, overrides) {
3552
3641
  const flag = overrides !== null && typeof overrides === "object" && !Array.isArray(overrides) ? overrides[id] : void 0;
3553
3642
  return typeof flag === "boolean" ? flag : allowlist.length === 0 || allowlist.includes(id);
3554
3643
  }
3644
+ /** 自定义上下文长度接受的上界(token);覆盖任何已知模型窗口仍留有余量。 */
3645
+ const CONTEXT_WINDOW_MAX = 1e7;
3646
+ /**
3647
+ * 判定一个值能否作为自定义上下文长度:边界内的安全整数,符合宿主模型元数据约束。
3648
+ *
3649
+ * 程序化构造的连接可能绕过 schemastery 归一化,所以 `resolveAdapterOptions`
3650
+ * 也要重新判定——越界或非数值直接丢弃,回落到目录公布值,而不是让请求带着
3651
+ * 一个网关会拒绝的窗口上线。
3652
+ */
3653
+ function isValidContextWindow(value) {
3654
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= 1 && value <= 1e7;
3655
+ }
3656
+ /**
3657
+ * 只接收合法条目的按模型覆盖表;空表、非对象与非法数值一律视为未设置。
3658
+ * 配置校验会拒绝非整数或越界值;本函数额外保护绕过配置校验的程序化调用,
3659
+ * 丢弃坏条目,不把非法窗口交给宿主。返回新对象;未设置时为 `undefined`。
3660
+ */
3661
+ function readContextWindowOverrides(raw) {
3662
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return void 0;
3663
+ const entries = Object.entries(raw).filter((entry) => entry[0] !== "" && isValidContextWindow(entry[1]));
3664
+ return entries.length === 0 ? void 0 : Object.fromEntries(entries);
3665
+ }
3666
+ /**
3667
+ * 一次模型解析的有效上下文长度:按模型覆盖 → 全局值 → 目录公布值。
3668
+ *
3669
+ * 适配器只在有目录条目时调用(未知模型保持既有的「无上下文宣告」形状),
3670
+ * 所以 `catalog` 是已知的正数;按模型覆盖与全局值在 `resolveAdapterOptions`
3671
+ * 已清洗,这里对程序化构造的连接再判一次,坏值静默回落到目录值。
3672
+ */
3673
+ function effectiveContextWindow(catalog, model, options) {
3674
+ const perModel = options.contextWindowOverrides?.[model];
3675
+ if (isValidContextWindow(perModel)) return perModel;
3676
+ if (isValidContextWindow(options.contextWindow)) return options.contextWindow;
3677
+ return catalog;
3678
+ }
3555
3679
  const THROTTLED_CODE = "THROTTLED";
3556
3680
  const boundedCodes = /* @__PURE__ */ new Set([
3557
3681
  "EMPTY_RESPONSE",
@@ -5858,6 +5982,13 @@ function learnedOutputLimit(apiBase, model) {
5858
5982
  function modelOutputTokenLimit(apiBase, model) {
5859
5983
  return Math.min(published.get(apiBase)?.get(model) ?? fallbackLimit(model), learnedOutputLimit(apiBase, model));
5860
5984
  }
5985
+ /**
5986
+ * 从本次目录记录的独立输出上限重新推导预算,不能复用已经被旧窗口压低的 maxTokens。
5987
+ * 公布值固定在该记录,不读取并发刷新后的共享目录;只继续采纳同网关更低的学习上限。
5988
+ */
5989
+ function catalogModelMaxTokens(apiBase, model, contextWindow = model.contextWindow) {
5990
+ return Math.min(contextWindow, model.publishedMaxTokens ?? fallbackLimit(model.id), learnedOutputLimit(apiBase, model.id));
5991
+ }
5861
5992
  /** 是否更新共享事实与是否值得重试是两个问题;以本次实发预算判断拒绝。 */
5862
5993
  function outputCeilingRefusal(apiBase, model, sent, error) {
5863
5994
  if (!(error instanceof LlmError) || !OUTPUT_LIMIT_REJECTION.test(error.message)) return void 0;
@@ -6013,7 +6144,7 @@ var GatewayFacts = class {
6013
6144
  * per-request options thunk and an API-key resolver from the plugin entry
6014
6145
  * (src/index.ts), so a settings change reaches the very next request.
6015
6146
  */
6016
- const COMMAND_CODE_CLI_VERSION = "1.82.2";
6147
+ const COMMAND_CODE_CLI_VERSION = "1.82.5";
6017
6148
  const DEFAULT_API_BASE = "https://api.commandcode.ai";
6018
6149
  /**
6019
6150
  * The output budget this bundle asks for, and the ceiling it will never exceed.
@@ -7676,7 +7807,7 @@ var CommandCodeAdapter = class CommandCodeAdapter extends LlmAdapter {
7676
7807
  provider,
7677
7808
  id: model.id,
7678
7809
  name: `${model.name} (CC)`,
7679
- description: capabilityDescription(model.id, model.contextWindow),
7810
+ description: capabilityDescription(model.id, effectiveContextWindow(model.contextWindow, model.id, connection)),
7680
7811
  inputModalities: vision ? ["text", "image"] : ["text"]
7681
7812
  };
7682
7813
  };
@@ -7716,16 +7847,17 @@ var CommandCodeAdapter = class CommandCodeAdapter extends LlmAdapter {
7716
7847
  const entry = this.gatewayFacts.knownModel(connection, model) ?? (await this.gatewayFacts.refresh(connection, signal)).find((m) => m.id === model);
7717
7848
  const efforts = KNOWN_EFFORTS[model];
7718
7849
  const vision = KNOWN_IMAGE_MODELS.has(model);
7850
+ const contextWindow = entry === void 0 ? void 0 : effectiveContextWindow(entry.contextWindow, model, connection);
7719
7851
  return {
7720
7852
  provider,
7721
7853
  id: model,
7722
7854
  name: entry ? `${entry.name} (CC)` : model,
7723
- description: capabilityDescription(model, entry?.contextWindow),
7855
+ description: capabilityDescription(model, contextWindow),
7724
7856
  inputModalities: vision ? ["text", "image"] : ["text"],
7725
7857
  toolUpdate: "addition-only",
7726
- ...entry ? {
7727
- context: { contextWindow: entry.contextWindow },
7728
- defaultMaxTokens: Math.min(entry.maxTokens, DEFAULT_GENERATE_MAX_TOKENS)
7858
+ ...entry !== void 0 && contextWindow !== void 0 ? {
7859
+ context: { contextWindow },
7860
+ defaultMaxTokens: Math.min(catalogModelMaxTokens(connection.apiBase, entry, contextWindow), DEFAULT_GENERATE_MAX_TOKENS)
7729
7861
  } : {},
7730
7862
  ...efforts ? { reasoning: { efforts: efforts.map((effort) => ({
7731
7863
  id: ReasoningEffortId(effort),
@@ -8148,7 +8280,8 @@ var CommandCodeAdapter = class CommandCodeAdapter extends LlmAdapter {
8148
8280
  const catalog = await facts.catalog;
8149
8281
  options.signal?.throwIfAborted();
8150
8282
  const modelEntry = catalog.find((row) => row.id === options.model);
8151
- const initialMax = Math.min(options.maxTokens ?? Infinity, modelEntry?.maxTokens ?? facts.fallbackLimit, DEFAULT_GENERATE_MAX_TOKENS);
8283
+ const modelMax = modelEntry === void 0 ? facts.fallbackLimit : catalogModelMaxTokens(connection.apiBase, modelEntry, effectiveContextWindow(modelEntry.contextWindow, options.model, connection));
8284
+ const initialMax = Math.min(options.maxTokens ?? Infinity, modelMax, DEFAULT_GENERATE_MAX_TOKENS);
8152
8285
  const budget = {
8153
8286
  max: initialMax,
8154
8287
  sent: initialMax
@@ -8188,8 +8321,8 @@ var CommandCodeAdapter = class CommandCodeAdapter extends LlmAdapter {
8188
8321
  }
8189
8322
  options.signal?.throwIfAborted();
8190
8323
  let maxTokens = Math.min(budget.max, learnedOutputLimit(connection.apiBase, options.model));
8191
- const effort = options.reasoningEffort;
8192
8324
  const supported = KNOWN_EFFORTS[options.model];
8325
+ const effort = options.purpose === "session-title" && supported?.includes("off") ? "off" : options.reasoningEffort;
8193
8326
  const declared = effort !== void 0 && supported?.includes(effort) ? effort : void 0;
8194
8327
  const reasoningEffort = effort === "off" && declared === void 0 ? void 0 : declared;
8195
8328
  const systemText = [options.system ?? "", ...options.messages.filter((m) => m.role === "system").map((m) => m.content.map(blockText).filter(Boolean).join("\n"))].filter(Boolean).join("\n\n");
@@ -8447,12 +8580,33 @@ function formatMoney(value) {
8447
8580
  function formatMoneyExact(value) {
8448
8581
  return `$${value.toFixed(4)}`;
8449
8582
  }
8450
- function formatTokensCompact(value) {
8451
- if (value >= 1e9) return `${(value / 1e9).toFixed(1)}B`;
8452
- if (value >= 1e6) return `${(value / 1e6).toFixed(1)}M`;
8453
- if (value >= 1e3) return `${(value / 1e3).toFixed(1)}K`;
8583
+ /**
8584
+ * 紧凑数字:K/M/B 三级,一切档位决策的唯一实现。
8585
+ *
8586
+ * 档位必须**回头判断**:先除以档位再四舍五入会算出 `999_999 → "1000.0K"`、
8587
+ * `999_999_999 → "1000.0M"` 这类既超长、又落在并不存在的档位上的结果,
8588
+ * 因此每个档位算完后若已经够到下一档,就改用下一档重算一次。
8589
+ *
8590
+ * @param value - 非负计数或词元数。
8591
+ * @param keepZeroDecimal - 整数值是否保留一位小数。词元显示沿用 `3.0B` 的旧样式;
8592
+ * 计数显示去掉多余的 `.0`,见 {@link formatCompactCount}。
8593
+ * @returns 紧凑文本;不足 1000 时原样返回该整数。
8594
+ */
8595
+ function compact(value, keepZeroDecimal) {
8596
+ const rounded = (scaled) => Math.round(scaled * 10) / 10;
8597
+ const text = (scaled) => {
8598
+ const fixed = rounded(scaled);
8599
+ return keepZeroDecimal ? fixed.toFixed(1) : String(fixed);
8600
+ };
8601
+ if (value >= 1e9) return `${text(value / 1e9)}B`;
8602
+ if (value >= 1e6) return rounded(value / 1e6) >= 1e3 ? `${text(value / 1e9)}B` : `${text(value / 1e6)}M`;
8603
+ if (value >= 1e3) return rounded(value / 1e3) >= 1e3 ? `${text(value / 1e6)}M` : `${text(value / 1e3)}K`;
8454
8604
  return String(value);
8455
8605
  }
8606
+ /** 紧凑词元数:与 {@link formatCompactCount} 共用档位,但整数值保留一位小数(`3.0B`)。 */
8607
+ function formatTokensCompact(value) {
8608
+ return compact(value, true);
8609
+ }
8456
8610
  /** The input is already in percent units; callers add the percent sign. */
8457
8611
  function formatSuccessRate(value) {
8458
8612
  return String(Number(value.toFixed(2)));
@@ -10780,6 +10934,8 @@ const Config = z.object(markVolatileFields({
10780
10934
  filterModelsByPlan: z.boolean(),
10781
10935
  visibleModels: z.array(z.string()),
10782
10936
  modelVisibility: z.dict(z.boolean()),
10937
+ contextWindow: z.number().min(1).max(CONTEXT_WINDOW_MAX).step(1),
10938
+ contextWindowOverrides: z.dict(z.number().min(1).max(CONTEXT_WINDOW_MAX).step(1)),
10783
10939
  webSearch: z.boolean().default(true),
10784
10940
  showSidebarQuota: z.boolean().default(false),
10785
10941
  accounts: z.array(z.object({
@@ -10825,6 +10981,8 @@ function resolveAdapterOptions(config) {
10825
10981
  filterModelsByPlan: config.filterModelsByPlan ?? true,
10826
10982
  visibleModels: Array.isArray(config.visibleModels) ? config.visibleModels.filter((id) => typeof id === "string" && id !== "") : void 0,
10827
10983
  modelVisibility: readModelVisibility(config.modelVisibility),
10984
+ contextWindow: isValidContextWindow(config.contextWindow) ? config.contextWindow : void 0,
10985
+ contextWindowOverrides: readContextWindowOverrides(config.contextWindowOverrides),
10828
10986
  zdr: config.zdr === true
10829
10987
  };
10830
10988
  }