@eddyskywalker/dsh-chatgpt-subscription 0.8.5 → 0.9.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/CHANGELOG.md +36 -0
- package/README.md +93 -38
- package/lib/client.js +2126 -1693
- package/lib/client.js.map +1 -1
- package/lib/index.js +7588 -2772
- package/lib/types/client/claude/ClaudeComposerQuota.d.ts +33 -0
- package/lib/types/client/claude/ClaudeComposerQuota.d.ts.map +1 -0
- package/lib/types/client/{zhipu/ZhipuSection.d.ts → claude/ClaudeSection.d.ts} +2 -2
- package/lib/types/client/claude/ClaudeSection.d.ts.map +1 -0
- package/lib/types/client/claude/locales.d.ts +444 -0
- package/lib/types/client/claude/locales.d.ts.map +1 -0
- package/lib/types/client/claude/styles.d.ts +15 -0
- package/lib/types/client/claude/styles.d.ts.map +1 -0
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/host/claude/__probe-assert.d.ts +2 -0
- package/lib/types/host/claude/__probe-assert.d.ts.map +1 -0
- package/lib/types/host/claude/account-pool.d.ts +580 -0
- package/lib/types/host/claude/account-pool.d.ts.map +1 -0
- package/lib/types/host/claude/adapter.d.ts +267 -0
- package/lib/types/host/claude/adapter.d.ts.map +1 -0
- package/lib/types/host/claude/adopt.d.ts +292 -0
- package/lib/types/host/claude/adopt.d.ts.map +1 -0
- package/lib/types/host/claude/client.d.ts +513 -0
- package/lib/types/host/claude/client.d.ts.map +1 -0
- package/lib/types/host/claude/mapper.d.ts +510 -0
- package/lib/types/host/claude/mapper.d.ts.map +1 -0
- package/lib/types/host/claude/model-catalog.d.ts +365 -0
- package/lib/types/host/claude/model-catalog.d.ts.map +1 -0
- package/lib/types/host/claude/oauth.d.ts +393 -0
- package/lib/types/host/claude/oauth.d.ts.map +1 -0
- package/lib/types/host/claude/routes.d.ts +128 -0
- package/lib/types/host/claude/routes.d.ts.map +1 -0
- package/lib/types/host/claude/token-store.d.ts +312 -0
- package/lib/types/host/claude/token-store.d.ts.map +1 -0
- package/lib/types/host/claude/types.d.ts +237 -0
- package/lib/types/host/claude/types.d.ts.map +1 -0
- package/lib/types/index.d.ts +10 -7
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/shared/__probe-claude-import.d.ts +2 -0
- package/lib/types/shared/__probe-claude-import.d.ts.map +1 -0
- package/lib/types/shared/claude-contracts.d.ts +337 -0
- package/lib/types/shared/claude-contracts.d.ts.map +1 -0
- package/package.json +1 -1
- package/lib/types/client/zhipu/ZhipuComposerQuota.d.ts +0 -26
- package/lib/types/client/zhipu/ZhipuComposerQuota.d.ts.map +0 -1
- package/lib/types/client/zhipu/ZhipuSection.d.ts.map +0 -1
- package/lib/types/client/zhipu/locales.d.ts +0 -275
- package/lib/types/client/zhipu/locales.d.ts.map +0 -1
- package/lib/types/client/zhipu/styles.d.ts +0 -12
- package/lib/types/client/zhipu/styles.d.ts.map +0 -1
- package/lib/types/host/zhipu/account-pool.d.ts +0 -43
- package/lib/types/host/zhipu/account-pool.d.ts.map +0 -1
- package/lib/types/host/zhipu/adapter.d.ts +0 -93
- package/lib/types/host/zhipu/adapter.d.ts.map +0 -1
- package/lib/types/host/zhipu/client.d.ts +0 -153
- package/lib/types/host/zhipu/client.d.ts.map +0 -1
- package/lib/types/host/zhipu/mapper.d.ts +0 -111
- package/lib/types/host/zhipu/mapper.d.ts.map +0 -1
- package/lib/types/host/zhipu/model-catalog.d.ts +0 -73
- package/lib/types/host/zhipu/model-catalog.d.ts.map +0 -1
- package/lib/types/host/zhipu/routes.d.ts +0 -33
- package/lib/types/host/zhipu/routes.d.ts.map +0 -1
- package/lib/types/host/zhipu/token-store.d.ts +0 -112
- package/lib/types/host/zhipu/token-store.d.ts.map +0 -1
- package/lib/types/host/zhipu/types.d.ts +0 -125
- package/lib/types/host/zhipu/types.d.ts.map +0 -1
- package/lib/types/shared/zhipu-contracts.d.ts +0 -164
- package/lib/types/shared/zhipu-contracts.d.ts.map +0 -1
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-model capabilities for the Claude subscription line.
|
|
3
|
+
*
|
|
4
|
+
* TRANSCRIPTION NOTICE — read this before trusting any row below.
|
|
5
|
+
*
|
|
6
|
+
* This table is a transcription of a snapshot catalog that ships inside a
|
|
7
|
+
* locally installed reference implementation
|
|
8
|
+
* (`@earendil-works/pi-ai`, `dist/providers/data/anthropic.json`, key
|
|
9
|
+
* `anthropic-messages`). It is therefore **not proof that the server accepts
|
|
10
|
+
* these models**, not proof of the context window or output cap it grants this
|
|
11
|
+
* account, and not proof that any of them is entitled on the signed-in plan. It
|
|
12
|
+
* is a starting point that is at least *read* rather than guessed, and nothing
|
|
13
|
+
* more.
|
|
14
|
+
*
|
|
15
|
+
* The authority is the server's own `GET /v1/models`, read through this
|
|
16
|
+
* account's credential. Where that listing speaks, it wins over every row here.
|
|
17
|
+
*
|
|
18
|
+
* Two kinds of row live in this file, and the difference is load-bearing:
|
|
19
|
+
* transcribed rows, whose authority is the snapshot and which the fidelity lock
|
|
20
|
+
* in `test/claude-model-catalog.test.ts` checks field by field, and LOCALLY
|
|
21
|
+
* CURATED rows the snapshot predates, whose authority is the vendor's own
|
|
22
|
+
* published documentation instead. The curated ids are named in the
|
|
23
|
+
* "LOCAL ADDITIONS" section at the end of this notice; a row that is in neither
|
|
24
|
+
* set is a mistake, not a third category, and the test fails on one.
|
|
25
|
+
*
|
|
26
|
+
* Nothing in this file is inferred from a model's name. Image support and the
|
|
27
|
+
* thinking form are per-model facts that the family name does not decide:
|
|
28
|
+
* `claude-sonnet-4-5` and `claude-sonnet-4-6` share a family and disagree on
|
|
29
|
+
* the thinking form, and `claude-opus-4-6` accepts a temperature its immediate
|
|
30
|
+
* successor `claude-opus-4-7` refuses.
|
|
31
|
+
*
|
|
32
|
+
* ---------------------------------------------------------------------------
|
|
33
|
+
* The mapping rules, each derived from the reference's own code
|
|
34
|
+
* ---------------------------------------------------------------------------
|
|
35
|
+
*
|
|
36
|
+
* **thinkingMode** — FOUR cases, and the order of the guards is the whole point.
|
|
37
|
+
* Source: `dist/api/anthropic-messages.js` lines 842-874, evaluated in this
|
|
38
|
+
* order:
|
|
39
|
+
*
|
|
40
|
+
* 1. `compat.supportsMidConvoEffort === true` (lines 842-849) -> `'mid-convo'`.
|
|
41
|
+
* This branch is checked FIRST and it is unconditional: it applies even when
|
|
42
|
+
* the caller asked for thinking off. It sends `{ type: 'adaptive', display,
|
|
43
|
+
* block_binding: { prefix_mismatch_behavior: 'drop_block' } }` AND
|
|
44
|
+
* `output_config = { effort: 'high' }`. The reference's own comment states
|
|
45
|
+
* why the block_binding is not optional: "Managed effort models always use
|
|
46
|
+
* adaptive thinking so prefix mismatches can be dropped instead of surfacing
|
|
47
|
+
* as persistent 400 responses."
|
|
48
|
+
* 2. else `compat.forceAdaptiveThinking === true` (line 855) -> `'adaptive'`,
|
|
49
|
+
* sending `{ type: 'adaptive', display }` (+ `output_config.effort` when the
|
|
50
|
+
* caller named an effort). The budget form is rejected by these models.
|
|
51
|
+
* 3. else `reasoning === true` (line 863) -> `'budget'`, sending
|
|
52
|
+
* `{ type: 'enabled', budget_tokens: ..., display }` — the branch the
|
|
53
|
+
* reference comments "Budget-based thinking for older models".
|
|
54
|
+
* 4. else -> `'none'`, no thinking field at all.
|
|
55
|
+
*
|
|
56
|
+
* Both guards are strict `=== true` comparisons, so an absent flag means the
|
|
57
|
+
* weaker behaviour. Collapsing cases 1 and 2 into one value loses a real wire
|
|
58
|
+
* requirement: `block_binding` and `output_config` would not be sent, and the
|
|
59
|
+
* reference documents that omission as producing persistent 400s.
|
|
60
|
+
*
|
|
61
|
+
* **supportsTemperature** — `compat.supportsTemperature ?? true`, i.e. absent
|
|
62
|
+
* means supported.
|
|
63
|
+
* Source: `dist/api/anthropic-messages.js` line 126
|
|
64
|
+
* (`supportsTemperature: model.compat?.supportsTemperature ?? true`), consumed at
|
|
65
|
+
* line 831 where a temperature is only attached when the flag is true. Three
|
|
66
|
+
* entries declare `false`; the other eleven are silent and therefore true.
|
|
67
|
+
*
|
|
68
|
+
* **reasoningEfforts** — the ladder a model exposes, derived in two steps, both
|
|
69
|
+
* from the reference's own code rather than from the raw map.
|
|
70
|
+
*
|
|
71
|
+
* 1. Which levels a model *has*: `dist/models.js` lines 550-562
|
|
72
|
+
* (`getSupportedThinkingLevels`). A model with `reasoning !== true` has no
|
|
73
|
+
* ladder at all. Otherwise the fixed order
|
|
74
|
+
* `['off','minimal','low','medium','high','xhigh','max']` is filtered, and the
|
|
75
|
+
* two conditions are the ones that matter:
|
|
76
|
+
* - a level mapped to `null` is REMOVED (`mapped === null -> false`), which is
|
|
77
|
+
* how `off: null` states "this model cannot be told to stop thinking";
|
|
78
|
+
* - `xhigh` and `max` exist only when the map literally names them
|
|
79
|
+
* (`mapped !== undefined`) — silence means the level is not offered.
|
|
80
|
+
* Every other level defaults to available. The map is an *exclusion* list for
|
|
81
|
+
* the middle rungs and an *inclusion* list for the top two, which is why a
|
|
82
|
+
* model with no map at all still has `minimal` through `high`.
|
|
83
|
+
*
|
|
84
|
+
* 2. What each level is called on the wire: `dist/api/anthropic-messages.js`
|
|
85
|
+
* lines 638-653 (`mapThinkingLevelToEffort`). A string in the map is sent
|
|
86
|
+
* verbatim; `minimal` and `low` both collapse to `low`, `medium` to
|
|
87
|
+
* `medium`, `high` to `high`, and anything else to `high`.
|
|
88
|
+
*
|
|
89
|
+
* The ladder stored below is the de-duplicated wire vocabulary in that order, and
|
|
90
|
+
* its distinct values are exactly the levels worth exposing: offering two rungs
|
|
91
|
+
* that both send `high` would advertise a distinction the model cannot make.
|
|
92
|
+
* `off` is NOT in the ladder — it is carried separately as
|
|
93
|
+
* {@link ClaudeModelEntry.canDisableThinking}, because "stop thinking" is the
|
|
94
|
+
* absence of a thinking block rather than an effort level, and `off: null`
|
|
95
|
+
* forbids it outright (line 871 only sends `{ type: 'disabled' }` when
|
|
96
|
+
* `thinkingLevelMap.off !== null`).
|
|
97
|
+
*
|
|
98
|
+
* The de-duplication is the one deliberate departure from the raw reference map,
|
|
99
|
+
* and it is applied uniformly to every row: no entry is special-cased.
|
|
100
|
+
*
|
|
101
|
+
* ---------------------------------------------------------------------------
|
|
102
|
+
* RULE 4 — the budget form's clamp, carried here for the mapper chunk
|
|
103
|
+
* ---------------------------------------------------------------------------
|
|
104
|
+
*
|
|
105
|
+
* This table decides WHICH form a model takes; it does not send anything. The
|
|
106
|
+
* arithmetic below is recorded here because the budget branch is the one that
|
|
107
|
+
* can silently produce a wrong request, and the chunk that builds the body must
|
|
108
|
+
* reproduce it rather than re-derive it.
|
|
109
|
+
*
|
|
110
|
+
* `adjustMaxTokensForThinking` and `clampMaxTokensToContext` are called at
|
|
111
|
+
* `dist/api/anthropic-messages.js` lines 676-685 and are **not defined** in that
|
|
112
|
+
* file — they are imported from `./simple-options.js` (line 14). Their exact
|
|
113
|
+
* arithmetic, transcribed from `dist/api/simple-options.js`:
|
|
114
|
+
*
|
|
115
|
+
* ```text
|
|
116
|
+
* CONTEXT_SAFETY_TOKENS = 4096 // line 2
|
|
117
|
+
* MIN_MAX_TOKENS = 1 // line 3
|
|
118
|
+
* MIN_ANSWER_TOKENS = 1024 // line 37
|
|
119
|
+
* DEFAULT_THINKING_BUDGETS = { minimal: 1024, low: 2048,
|
|
120
|
+
* medium: 8192, high: 16384 } // lines 38-43
|
|
121
|
+
*
|
|
122
|
+
* clampReasoning(effort) // lines 44-46
|
|
123
|
+
* = (effort === 'xhigh' || effort === 'max') ? 'high' : effort
|
|
124
|
+
*
|
|
125
|
+
* thinkingBudgetForLevel(level, customBudgets) // lines 47-51
|
|
126
|
+
* = { ...DEFAULT_THINKING_BUDGETS, ...customBudgets }[clampReasoning(level)]
|
|
127
|
+
*
|
|
128
|
+
* clampThinkingBudgetToAnswerRoom(budget, ceiling) // lines 52-55
|
|
129
|
+
* = Math.min(budget, Math.max(0, ceiling - MIN_ANSWER_TOKENS))
|
|
130
|
+
*
|
|
131
|
+
* adjustMaxTokensForThinking(baseMaxTokens, modelMaxTokens,
|
|
132
|
+
* reasoningLevel, customBudgets) // lines 56-65
|
|
133
|
+
* let thinkingBudget = thinkingBudgetForLevel(reasoningLevel, customBudgets)
|
|
134
|
+
* const maxTokens = baseMaxTokens === undefined
|
|
135
|
+
* ? modelMaxTokens
|
|
136
|
+
* : Math.min(baseMaxTokens + thinkingBudget, modelMaxTokens)
|
|
137
|
+
* if (maxTokens <= thinkingBudget)
|
|
138
|
+
* thinkingBudget = clampThinkingBudgetToAnswerRoom(thinkingBudget, maxTokens)
|
|
139
|
+
* return { maxTokens, thinkingBudget }
|
|
140
|
+
*
|
|
141
|
+
* clampMaxTokensToContext(model, context, maxTokens) // lines 4-9
|
|
142
|
+
* = model.contextWindow <= 0
|
|
143
|
+
* ? Math.max(MIN_MAX_TOKENS, maxTokens)
|
|
144
|
+
* : Math.min(maxTokens, Math.max(MIN_MAX_TOKENS,
|
|
145
|
+
* model.contextWindow - estimateContextTokens(context).tokens
|
|
146
|
+
* - CONTEXT_SAFETY_TOKENS))
|
|
147
|
+
* ```
|
|
148
|
+
*
|
|
149
|
+
* The caller side (`dist/api/anthropic-messages.js` lines 676-685) then sends
|
|
150
|
+
*
|
|
151
|
+
* ```text
|
|
152
|
+
* const adjusted = adjustMaxTokensForThinking(base.maxTokens, model.maxTokens,
|
|
153
|
+
* options.reasoning, options.thinkingBudgets);
|
|
154
|
+
* const maxTokens = clampMaxTokensToContext(model, context, adjusted.maxTokens);
|
|
155
|
+
* ... thinkingBudgetTokens: Math.min(adjusted.thinkingBudget,
|
|
156
|
+
* Math.max(0, maxTokens - 1024))
|
|
157
|
+
* ```
|
|
158
|
+
*
|
|
159
|
+
* Two traps the mapper must not walk into:
|
|
160
|
+
*
|
|
161
|
+
* 1. `base.maxTokens` is already resolved — `buildBaseOptions`
|
|
162
|
+
* (`simple-options.js` line 17) does
|
|
163
|
+
* `clampMaxTokensToContext(model, context, options?.maxTokens ?? model.maxTokens)`.
|
|
164
|
+
* Feeding an unresolved `options.maxTokens` into the helper changes which
|
|
165
|
+
* argument is `undefined` and therefore which cap wins.
|
|
166
|
+
* 2. An undefined output cap must NOT be coerced to 0 first. The reference
|
|
167
|
+
* comments this on `simple-options.js` line 57 — "Undefined means no explicit
|
|
168
|
+
* caller cap. Use the model cap and fit thinking inside it." — and on
|
|
169
|
+
* `anthropic-messages.js` lines 676-677 — "Do not coerce to 0 here, or the
|
|
170
|
+
* thinking budget would become the entire max_tokens value." Under the
|
|
171
|
+
* helper's own branch, a 0 base cap yields `Math.min(0 + budget, modelMax)`,
|
|
172
|
+
* i.e. the thinking budget becomes the whole response ceiling and no room is
|
|
173
|
+
* left for an answer.
|
|
174
|
+
*
|
|
175
|
+
* ---------------------------------------------------------------------------
|
|
176
|
+
* LOCAL ADDITIONS — the rows the reference snapshot predates
|
|
177
|
+
* ---------------------------------------------------------------------------
|
|
178
|
+
*
|
|
179
|
+
* `claude-opus-5-5` is the only such row today. The mirror list in the test is
|
|
180
|
+
* `LOCALLY_CURATED_MODEL_IDS`; the two must be changed together.
|
|
181
|
+
*
|
|
182
|
+
* It is CURATED rather than transcribed because the snapshot this table copies
|
|
183
|
+
* has no entry for it, and the one thing a transcription table must never do is
|
|
184
|
+
* invent a row and let it read as if it had been read from somewhere. An
|
|
185
|
+
* invented row that mimics the format of a checked one is worse than a missing
|
|
186
|
+
* row: it is unverifiable and it looks verified. So the row below is marked at
|
|
187
|
+
* the row itself, the test asserts the id is on the curated list, and the test
|
|
188
|
+
* asserts the curated list is exactly the ids the snapshot lacks — which keeps
|
|
189
|
+
* the lock narrow instead of merely weaker.
|
|
190
|
+
*
|
|
191
|
+
* Its fields come from the vendor's own published documentation for the model
|
|
192
|
+
* (the model overview page plus the extended-thinking effort page), NOT from the
|
|
193
|
+
* snapshot, and they are the values a person read off those pages. That is a
|
|
194
|
+
* weaker source than the snapshot and it is labelled as such: nothing here
|
|
195
|
+
* proves the account is entitled to the model, and the server's own
|
|
196
|
+
* `GET /v1/models` still outranks it.
|
|
197
|
+
*
|
|
198
|
+
* Two of its fields are the ones worth recording a WHY for, because both look
|
|
199
|
+
* like mistakes against their neighbours:
|
|
200
|
+
*
|
|
201
|
+
* 1. `canDisableThinking: false`. The vendor documents that thinking cannot be
|
|
202
|
+
* turned off on this model at all: sending `thinking: { type: 'disabled' }`
|
|
203
|
+
* is a 400 `invalid_request_error`, and so is the manual budget form
|
|
204
|
+
* `{ type: 'enabled', budget_tokens: N }`. Only an omitted `thinking` field
|
|
205
|
+
* or `{ type: 'adaptive' }` is accepted. The snapshot's own rule for this
|
|
206
|
+
* flag is `thinkingLevelMap.off !== null` — an explicit `off: null` — so a
|
|
207
|
+
* reading of "no map means nothing forbids it" would set this true and
|
|
208
|
+
* produce a request the model rejects.
|
|
209
|
+
* 2. `thinkingMode: 'adaptive'`, NOT `'mid-convo'`. The two are easy to confuse
|
|
210
|
+
* here because every model in this line that refuses a temperature is also,
|
|
211
|
+
* so far, a managed-effort model. That is a coincidence of `compat`, not a
|
|
212
|
+
* rule: this row carries no `supportsMidConvoEffort` flag, and 'mid-convo'
|
|
213
|
+
* additionally forces `output_config = { effort: 'high' }` when the caller
|
|
214
|
+
* names no effort. That forced high is correct for the rows that DO carry the
|
|
215
|
+
* flag, because the vendor makes `high` their default effort; this model's
|
|
216
|
+
* documented default effort is `medium`. Labelling it 'mid-convo' would
|
|
217
|
+
* silently override the vendor's own default and make every request think —
|
|
218
|
+
* and cost — harder than the user asked for.
|
|
219
|
+
*
|
|
220
|
+
* A future reader who notices the shared `supportsTemperature: false` and
|
|
221
|
+
* "fixes" item 2 to 'mid-convo' has reintroduced exactly that bug.
|
|
222
|
+
*/
|
|
223
|
+
/** One model's shipped capability entry. */
|
|
224
|
+
export interface ClaudeModelEntry {
|
|
225
|
+
/** Exact model id to put on the wire. */
|
|
226
|
+
id: string;
|
|
227
|
+
/** Display name. Transcribed from the reference, including its "(latest)" suffix. */
|
|
228
|
+
name: string;
|
|
229
|
+
/** Context window DSH assumes before the server's own listing contradicts it. */
|
|
230
|
+
contextWindow: number;
|
|
231
|
+
/** Output cap requested when the caller omits one. */
|
|
232
|
+
maxTokens: number;
|
|
233
|
+
/** Whether the model accepts image input. */
|
|
234
|
+
supportsImage: boolean;
|
|
235
|
+
/** Whether a `temperature` may be sent at all. */
|
|
236
|
+
supportsTemperature: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Which thinking form this model needs.
|
|
239
|
+
*
|
|
240
|
+
* - `mid-convo` — the model is managed under mid-conversation effort. The
|
|
241
|
+
* request MUST send `{ type: 'adaptive', block_binding: { prefix_mismatch_behavior:
|
|
242
|
+
* 'drop_block' } }` plus `output_config.effort`; the reference's own comment
|
|
243
|
+
* says why: "Managed effort models always use adaptive thinking so prefix
|
|
244
|
+
* mismatches can be dropped instead of surfacing as persistent 400
|
|
245
|
+
* responses." This is the strictest case and it is checked FIRST.
|
|
246
|
+
* - `adaptive` — the model decides when and how much to think; the request
|
|
247
|
+
* sends `{ type: 'adaptive' }` and names an effort separately. The
|
|
248
|
+
* budget form is rejected.
|
|
249
|
+
* - `budget` — the older form: `{ type: 'enabled', budget_tokens }`.
|
|
250
|
+
* - `none` — the model does not reason, so no thinking field is sent.
|
|
251
|
+
*/
|
|
252
|
+
thinkingMode: 'mid-convo' | 'adaptive' | 'budget' | 'none';
|
|
253
|
+
/**
|
|
254
|
+
* Thinking levels this model exposes, in escalating order.
|
|
255
|
+
*
|
|
256
|
+
* These are the *wire* effort values, already collapsed by the reference's own
|
|
257
|
+
* mapper, so a caller picks one of these and it is sent unchanged. Empty means
|
|
258
|
+
* the model exposes no selectable level.
|
|
259
|
+
*/
|
|
260
|
+
reasoningEfforts: readonly string[];
|
|
261
|
+
/**
|
|
262
|
+
* Whether thinking can be turned off.
|
|
263
|
+
*
|
|
264
|
+
* False means the model states `off: null` (or has no map and no reasoning
|
|
265
|
+
* at all): sending `{ type: 'disabled' }` is not a supported request.
|
|
266
|
+
*/
|
|
267
|
+
canDisableThinking: boolean;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Fifteen rows: the snapshot's own 14, in the snapshot's own declaration order,
|
|
271
|
+
* followed by the curated row the snapshot predates (see LOCAL ADDITIONS above).
|
|
272
|
+
*
|
|
273
|
+
* The order matters and is not cosmetic. The test asserts the snapshot's ids
|
|
274
|
+
* appear in the table as a SUBSEQUENCE, so a curated row may be appended or
|
|
275
|
+
* placed anywhere that leaves the transcribed rows in their relative order —
|
|
276
|
+
* but the snapshot's order is the one a reader can diff against, so the
|
|
277
|
+
* transcribed rows keep it and a curated row is appended rather than dropped
|
|
278
|
+
* into the middle of them.
|
|
279
|
+
*
|
|
280
|
+
* `claude-haiku-4-5` and `claude-sonnet-4-5` are the dated aliases that
|
|
281
|
+
* track the newest build; each has a pinned sibling below it. Offering both is
|
|
282
|
+
* intentional: the alias follows an upstream upgrade without a config change,
|
|
283
|
+
* while the pinned id is what a caller repeats when it must not move.
|
|
284
|
+
*
|
|
285
|
+
* Quoting is deliberately inconsistent below, because the `name` field is
|
|
286
|
+
* transcribed rather than formatted: the snapshot quotes two of these names —
|
|
287
|
+
* `'Claude Opus 4.5'` and `'Claude Sonnet 4.5'` — to distinguish them from
|
|
288
|
+
* their `(latest)` aliases, and leaves every other name bare. Formatting the
|
|
289
|
+
* table `name` to match this repository's style is therefore not free: it
|
|
290
|
+
* breaks the fidelity lock on those two rows. A curated row has no snapshot
|
|
291
|
+
* name to match, so it follows the majority and is left bare.
|
|
292
|
+
*
|
|
293
|
+
* `claude-fable-5` carries an `allowedFallbackModels` list in the reference
|
|
294
|
+
* (Opus 4.8 and Opus 5). That is a server-side routing hint for the
|
|
295
|
+
* `server-side-fallback` beta, outside this table's scope, and no later chunk
|
|
296
|
+
* in this line may read it from here — it is not transcribed.
|
|
297
|
+
*/
|
|
298
|
+
export declare const CLAUDE_MODELS: readonly ClaudeModelEntry[];
|
|
299
|
+
/** Every id the fallback table knows, in declaration order. */
|
|
300
|
+
export declare const CLAUDE_MODEL_IDS: readonly string[];
|
|
301
|
+
/**
|
|
302
|
+
* The shipped table in the shape the adapter reads before a live listing answers.
|
|
303
|
+
*
|
|
304
|
+
* Identical to {@link CLAUDE_MODELS}: the table is already the full snapshot, and
|
|
305
|
+
* hiding an entry from the fallback would leave the user no way to reach a model
|
|
306
|
+
* the account may well be entitled to. The live `GET /v1/models` narrows it.
|
|
307
|
+
*/
|
|
308
|
+
export declare const FALLBACK_MODELS: readonly ClaudeModelEntry[];
|
|
309
|
+
/**
|
|
310
|
+
* Models the picker offers on a fresh install.
|
|
311
|
+
*
|
|
312
|
+
* `claude-opus-5-5` leads: it is the newest flagship in the table, and a fresh
|
|
313
|
+
* install that has to find the best model in the model card is a worse first
|
|
314
|
+
* run than one that starts on it.
|
|
315
|
+
*
|
|
316
|
+
* Deliberately short. The table holds both the moving alias and its pinned twin
|
|
317
|
+
* for two families, so a fresh picker that leads with every row is harder to use
|
|
318
|
+
* than one that leads with the general-purpose ids. The rest stay selectable
|
|
319
|
+
* from the model card and are one click away.
|
|
320
|
+
*
|
|
321
|
+
* This list is the SHIPPED DEFAULT, and edits to it are a deliberate onboarding
|
|
322
|
+
* decision rather than a no-op: a stored list that still equals the shipped
|
|
323
|
+
* default counts as "never edited", and the routes and adapter read it that way
|
|
324
|
+
* (see `resolveEnabledModelIds`), treating an untouched default as "the user
|
|
325
|
+
* cannot have meant to hide a model the catalog added later" and falling back to
|
|
326
|
+
* everything the account can call. Changing this list therefore changes what a
|
|
327
|
+
* fresh install — and every install still sitting on the unedited default —
|
|
328
|
+
* ends up with, not just the checkbox a new user sees ticked.
|
|
329
|
+
*/
|
|
330
|
+
export declare const DEFAULT_VISIBLE_MODEL_IDS: readonly string[];
|
|
331
|
+
/**
|
|
332
|
+
* Look one model up, or receive a stub that claims nothing.
|
|
333
|
+
*
|
|
334
|
+
* An unknown id is treated conservatively rather than optimistically, and the
|
|
335
|
+
* reasoning is asymmetric: a wrong "supports images" claim sends image bytes to
|
|
336
|
+
* an endpoint that rejects the whole request, while a wrong "no images" claim
|
|
337
|
+
* only makes DSH show a placeholder the user can correct. The same asymmetry
|
|
338
|
+
* picks the weakest thinking form and the smaller default window — a window that
|
|
339
|
+
* overstates what the server grants is the error that fails hard.
|
|
340
|
+
*
|
|
341
|
+
* The id and name are echoed back unchanged so nothing is hidden from the user.
|
|
342
|
+
*/
|
|
343
|
+
export declare function resolveClaudeModel(modelId: string, catalog?: readonly ClaudeModelEntry[]): ClaudeModelEntry;
|
|
344
|
+
/** Context window this route assumes for one model, before any override. */
|
|
345
|
+
export declare function defaultContextWindowFor(modelId: string, catalog?: readonly ClaudeModelEntry[]): number;
|
|
346
|
+
/** Output cap one request asks for when the caller omits one. */
|
|
347
|
+
export declare function maxOutputTokensFor(modelId: string, catalog?: readonly ClaudeModelEntry[]): number;
|
|
348
|
+
/**
|
|
349
|
+
* Thinking levels one model exposes, as a COPY.
|
|
350
|
+
*
|
|
351
|
+
* A copy rather than the table's own array: callers converge a configured effort
|
|
352
|
+
* onto the ladder and a few of them sort or mutate what they are handed, and a
|
|
353
|
+
* mutation that escaped into the frozen table would silently change every later
|
|
354
|
+
* request in the process.
|
|
355
|
+
*/
|
|
356
|
+
export declare function claudeReasoningEfforts(modelId: string, catalog?: readonly ClaudeModelEntry[]): string[];
|
|
357
|
+
/** Whether one model accepts image input. */
|
|
358
|
+
export declare function claudeModelSupportsImage(modelId: string, catalog?: readonly ClaudeModelEntry[]): boolean;
|
|
359
|
+
/** Which thinking form one model needs. */
|
|
360
|
+
export declare function claudeThinkingMode(modelId: string, catalog?: readonly ClaudeModelEntry[]): ClaudeModelEntry['thinkingMode'];
|
|
361
|
+
/** Whether one model accepts a temperature. */
|
|
362
|
+
export declare function claudeModelSupportsTemperature(modelId: string, catalog?: readonly ClaudeModelEntry[]): boolean;
|
|
363
|
+
/** Whether thinking can be turned off for one model. */
|
|
364
|
+
export declare function claudeModelCanDisableThinking(modelId: string, catalog?: readonly ClaudeModelEntry[]): boolean;
|
|
365
|
+
//# sourceMappingURL=model-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-catalog.d.ts","sourceRoot":"","sources":["../../../../src/host/claude/model-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6NG;AAIH,4CAA4C;AAC5C,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAA;IACZ,iFAAiF;IACjF,aAAa,EAAE,MAAM,CAAA;IACrB,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAA;IACjB,6CAA6C;IAC7C,aAAa,EAAE,OAAO,CAAA;IACtB,kDAAkD;IAClD,mBAAmB,EAAE,OAAO,CAAA;IAC5B;;;;;;;;;;;;;;OAcG;IACH,YAAY,EAAE,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAA;IAC1D;;;;;;OAMG;IACH,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC;;;;;OAKG;IACH,kBAAkB,EAAE,OAAO,CAAA;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,gBAAgB,EAiMX,CAAA;AAE1C,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAA2C,CAAA;AAEzF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,SAAS,gBAAgB,EAAkB,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAMtD,CAAA;AAID;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,SAAS,gBAAgB,EAAkB,GAAG,gBAAgB,CAkB1H;AAED,4EAA4E;AAC5E,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,CAEtG;AAED,iEAAiE;AACjE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,CAEjG;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,EAAE,CAEvG;AAED,6CAA6C;AAC7C,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,gBAAgB,EAAE,GAAG,OAAO,CAExG;AAED,2CAA2C;AAC3C,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,gBAAgB,EAAE,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAE3H;AAED,+CAA+C;AAC/C,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,gBAAgB,EAAE,GAAG,OAAO,CAE9G;AAED,wDAAwD;AACxD,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,gBAAgB,EAAE,GAAG,OAAO,CAE7G"}
|