@myrialabs/clopen 0.4.44 → 0.4.46
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/backend/artifacts/project/bridge.ts +218 -0
- package/backend/artifacts/project/edit.ts +243 -0
- package/backend/artifacts/project/index.ts +38 -0
- package/backend/artifacts/project/project.test.ts +181 -0
- package/backend/artifacts/project/scan.ts +368 -0
- package/backend/artifacts/project/sources.ts +100 -0
- package/backend/artifacts/sync.ts +1 -1
- package/backend/auth/permissions.ts +15 -0
- package/backend/chat/stream-manager.ts +20 -3
- package/backend/database/migrations/083_create_project_mcp_trust.ts +32 -0
- package/backend/database/migrations/index.ts +7 -0
- package/backend/database/queries/index.ts +2 -0
- package/backend/database/queries/project-mcp-trust-queries.ts +43 -0
- package/backend/engine/adapters/claude/models.test.ts +49 -0
- package/backend/engine/adapters/claude/models.ts +81 -562
- package/backend/engine/adapters/claude/stream.ts +32 -5
- package/backend/engine/adapters/cline/credential.ts +42 -18
- package/backend/engine/adapters/cline/mcp-tools.ts +26 -4
- package/backend/engine/adapters/cline/message-converter.ts +31 -1
- package/backend/engine/adapters/cline/models.test.ts +77 -0
- package/backend/engine/adapters/cline/models.ts +89 -3
- package/backend/engine/adapters/cline/presets.ts +5 -0
- package/backend/engine/adapters/cline/stream.ts +29 -8
- package/backend/engine/adapters/codex/message-converter.ts +1 -1
- package/backend/engine/adapters/codex/models.ts +54 -31
- package/backend/engine/adapters/codex/patch-rollout.test.ts +36 -1
- package/backend/engine/adapters/codex/patch-rollout.ts +60 -29
- package/backend/engine/adapters/codex/session-fork.ts +5 -0
- package/backend/engine/adapters/codex/stream.ts +29 -11
- package/backend/engine/adapters/copilot/models.test.ts +40 -0
- package/backend/engine/adapters/copilot/models.ts +51 -24
- package/backend/engine/adapters/copilot/permissions.test.ts +47 -0
- package/backend/engine/adapters/copilot/permissions.ts +72 -0
- package/backend/engine/adapters/copilot/stream.ts +83 -70
- package/backend/engine/adapters/cursor/stream.ts +27 -12
- package/backend/engine/adapters/opencode/server.ts +14 -4
- package/backend/engine/adapters/opencode/stream.ts +18 -3
- package/backend/engine/adapters/pi/credential.test.ts +83 -0
- package/backend/engine/adapters/pi/credential.ts +68 -12
- package/backend/engine/adapters/pi/environment.ts +9 -5
- package/backend/engine/adapters/pi/mcp.test.ts +194 -0
- package/backend/engine/adapters/pi/mcp.ts +88 -0
- package/backend/engine/adapters/pi/message-converter.ts +6 -4
- package/backend/engine/adapters/pi/presets.ts +10 -5
- package/backend/engine/adapters/pi/stream.ts +77 -41
- package/backend/engine/adapters/qwen/environment.ts +39 -2
- package/backend/engine/adapters/qwen/message-converter.test.ts +64 -0
- package/backend/engine/adapters/qwen/message-converter.ts +40 -23
- package/backend/engine/adapters/qwen/models.test.ts +25 -0
- package/backend/engine/adapters/qwen/models.ts +42 -5
- package/backend/engine/adapters/qwen/session-store.test.ts +39 -0
- package/backend/engine/adapters/qwen/session-store.ts +66 -0
- package/backend/engine/adapters/qwen/stream.ts +118 -87
- package/backend/engine/artifact-sync.ts +12 -5
- package/backend/engine/docs/adapter-contract.md +7 -4
- package/backend/engine/docs/lessons-learned.md +405 -62
- package/backend/engine/docs/quick-reference.md +2 -2
- package/backend/engine/docs/stack.md +17 -4
- package/backend/engine/docs/websocket-routes.md +5 -5
- package/backend/engine/install-recipes.test.ts +105 -5
- package/backend/engine/install-recipes.ts +102 -42
- package/backend/engine/install-runner.ts +56 -2
- package/backend/engine/stack-project.ts +71 -1
- package/backend/files/file-watcher.test.ts +77 -0
- package/backend/files/file-watcher.ts +92 -60
- package/backend/files/watch-ignore.test.ts +182 -0
- package/backend/files/watch-ignore.ts +244 -0
- package/backend/git/git-executor.ts +14 -4
- package/backend/index.ts +16 -1
- package/backend/instructions/service.ts +5 -3
- package/backend/instructions/sync.ts +10 -27
- package/backend/mcp/README.md +2 -2
- package/backend/mcp/external/config.ts +83 -23
- package/backend/mcp/external/project.ts +124 -0
- package/backend/mcp/external/proxy.ts +65 -11
- package/backend/mcp/index.ts +22 -9
- package/backend/mcp/internal/config.ts +42 -3
- package/backend/mcp/internal/remote-server.ts +11 -1
- package/backend/memory/embedding/install.ts +29 -1
- package/backend/skills/marketplace.ts +1 -1
- package/backend/snapshot/blob-store.ts +9 -5
- package/backend/snapshot/git-attribution.test.ts +42 -0
- package/backend/snapshot/git-attribution.ts +306 -0
- package/backend/snapshot/gitignore.test.ts +62 -0
- package/backend/snapshot/gitignore.ts +158 -78
- package/backend/snapshot/snapshot-service.test.ts +270 -0
- package/backend/snapshot/snapshot-service.ts +412 -136
- package/backend/snapshot/turn-activity.test.ts +52 -0
- package/backend/snapshot/turn-activity.ts +83 -0
- package/backend/snapshot/turn-changes.test.ts +58 -1
- package/backend/snapshot/turn-changes.ts +66 -0
- package/backend/utils/keyed-lock.test.ts +33 -0
- package/backend/utils/keyed-lock.ts +17 -0
- package/backend/utils/port-utils.test.ts +29 -0
- package/backend/utils/port-utils.ts +19 -0
- package/backend/worktrees/tree.ts +1 -1
- package/backend/ws/chat/composer.ts +504 -0
- package/backend/ws/chat/index.ts +3 -1
- package/backend/ws/chat/stream.ts +252 -440
- package/backend/ws/engine/cline/accounts.ts +26 -6
- package/backend/ws/engine/codex/accounts.test.ts +49 -0
- package/backend/ws/engine/codex/accounts.ts +17 -13
- package/backend/ws/engine/pi/accounts.ts +61 -6
- package/backend/ws/index.ts +4 -0
- package/backend/ws/project-artifacts/index.ts +236 -0
- package/backend/ws/snapshot/changes.ts +66 -31
- package/dist/assets/{index-DX5OwLOc.js → index-BTcR1byF.js} +1 -1
- package/dist/assets/{index-BWyhqUi5.js → index-CwuKQelV.js} +1 -1
- package/dist/assets/main-BiDNMWb3.css +1 -0
- package/dist/assets/main-BlhKWz2B.js +1241 -0
- package/dist/index.html +2 -2
- package/package.json +19 -15
- package/shared/types/stores/settings.ts +5 -0
- package/shared/types/unified/message.ts +2 -0
- package/backend/engine/adapters/pi/mcp-tools.ts +0 -131
- package/backend/engine/adapters/qwen/session-fork.ts +0 -109
- package/dist/assets/main-DOkwqXRU.js +0 -1215
- package/dist/assets/main-DzCY0n-j.css +0 -1
|
@@ -7,7 +7,16 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Only models with `Current state: Active` on
|
|
9
9
|
* https://platform.claude.com/docs/en/about-claude/model-deprecations are
|
|
10
|
-
* listed here
|
|
10
|
+
* listed here, and of those only the ones whose retirement is not imminent —
|
|
11
|
+
* deprecated, retired and about-to-retire models are dropped, never listed as
|
|
12
|
+
* legacy.
|
|
13
|
+
*
|
|
14
|
+
* The bundled CLI decides what a model can actually do: the pinned SDK ships
|
|
15
|
+
* the CLI binary, and that binary carries its own model table (capabilities
|
|
16
|
+
* `effort`, `xhigh_effort`, `adaptive_thinking`, `rejects_disabled_thinking`).
|
|
17
|
+
* A slug the CLI does not know fails at runtime, and a reasoning level the
|
|
18
|
+
* model does not support is silently rewritten — so both the slugs and the
|
|
19
|
+
* per-model levels below are taken from that table (CLI 2.1.296).
|
|
11
20
|
*/
|
|
12
21
|
|
|
13
22
|
import type { EngineModel, ReasoningControl } from '$shared/types/unified';
|
|
@@ -16,579 +25,89 @@ import { toReasoningOptions } from '$shared/constants/engines';
|
|
|
16
25
|
/**
|
|
17
26
|
* Claude's reasoning knob is the Agent SDK `effort` option plus `thinking`.
|
|
18
27
|
* `off` disables thinking; `auto` is adaptive thinking (Claude decides — the
|
|
19
|
-
* historical default); the rest are the SDK's native `EffortLevel` values
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
28
|
+
* historical default); the rest are the SDK's native `EffortLevel` values.
|
|
29
|
+
* The stream adapter translates the chosen token.
|
|
30
|
+
*
|
|
31
|
+
* Levels are per-model because the CLI rewrites what a model cannot take
|
|
32
|
+
* instead of failing: `off` becomes adaptive thinking on models that reject
|
|
33
|
+
* disabled thinking, `effort` is dropped on models without it, and `xhigh`
|
|
34
|
+
* only exists from Opus 4.7 on. Offering those levels anyway put options in
|
|
35
|
+
* the picker that did nothing.
|
|
23
36
|
*/
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
37
|
+
const ALWAYS_THINKING = ['auto', 'low', 'medium', 'high', 'xhigh', 'max'];
|
|
38
|
+
const FULL_EFFORT = ['off', ...ALWAYS_THINKING];
|
|
39
|
+
const EFFORT_TO_MAX = ['off', 'auto', 'low', 'medium', 'high', 'max'];
|
|
40
|
+
const THINKING_ONLY = ['off', 'auto'];
|
|
28
41
|
|
|
29
|
-
|
|
30
|
-
{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
limit: {
|
|
44
|
-
input: 1_000_000,
|
|
45
|
-
output: 128_000,
|
|
46
|
-
},
|
|
47
|
-
modalities: {
|
|
48
|
-
input: {
|
|
49
|
-
text: true,
|
|
50
|
-
image: true,
|
|
51
|
-
audio: false,
|
|
52
|
-
video: false,
|
|
53
|
-
pdf: true,
|
|
54
|
-
},
|
|
55
|
-
output: {
|
|
56
|
-
text: true,
|
|
57
|
-
image: false,
|
|
58
|
-
audio: false,
|
|
59
|
-
video: false,
|
|
60
|
-
pdf: false,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
capabilities: {
|
|
64
|
-
reasoning: true,
|
|
65
|
-
tools: true,
|
|
66
|
-
structuredOutput: true,
|
|
67
|
-
},
|
|
68
|
-
cost: {
|
|
69
|
-
input: 10,
|
|
70
|
-
output: 50,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
engine: {
|
|
75
|
-
type: 'claude-code',
|
|
76
|
-
provider: 'anthropic',
|
|
77
|
-
model: {
|
|
78
|
-
id: 'claude-opus-5-5',
|
|
79
|
-
name: 'Claude Opus 5.5',
|
|
80
|
-
},
|
|
81
|
-
account: {
|
|
82
|
-
id: 0,
|
|
83
|
-
name: '',
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
limit: {
|
|
87
|
-
input: 1_000_000,
|
|
88
|
-
output: 128_000,
|
|
89
|
-
},
|
|
90
|
-
modalities: {
|
|
91
|
-
input: {
|
|
92
|
-
text: true,
|
|
93
|
-
image: true,
|
|
94
|
-
audio: false,
|
|
95
|
-
video: false,
|
|
96
|
-
pdf: true,
|
|
97
|
-
},
|
|
98
|
-
output: {
|
|
99
|
-
text: true,
|
|
100
|
-
image: false,
|
|
101
|
-
audio: false,
|
|
102
|
-
video: false,
|
|
103
|
-
pdf: false,
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
capabilities: {
|
|
107
|
-
reasoning: true,
|
|
108
|
-
tools: true,
|
|
109
|
-
structuredOutput: true,
|
|
110
|
-
},
|
|
111
|
-
cost: {
|
|
112
|
-
input: 4,
|
|
113
|
-
output: 20,
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
engine: {
|
|
118
|
-
type: 'claude-code',
|
|
119
|
-
provider: 'anthropic',
|
|
120
|
-
model: {
|
|
121
|
-
id: 'claude-sonnet-5-5',
|
|
122
|
-
name: 'Claude Sonnet 5.5',
|
|
123
|
-
},
|
|
124
|
-
account: {
|
|
125
|
-
id: 0,
|
|
126
|
-
name: '',
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
limit: {
|
|
130
|
-
input: 1_000_000,
|
|
131
|
-
output: 128_000,
|
|
132
|
-
},
|
|
133
|
-
modalities: {
|
|
134
|
-
input: {
|
|
135
|
-
text: true,
|
|
136
|
-
image: true,
|
|
137
|
-
audio: false,
|
|
138
|
-
video: false,
|
|
139
|
-
pdf: true,
|
|
140
|
-
},
|
|
141
|
-
output: {
|
|
142
|
-
text: true,
|
|
143
|
-
image: false,
|
|
144
|
-
audio: false,
|
|
145
|
-
video: false,
|
|
146
|
-
pdf: false,
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
capabilities: {
|
|
150
|
-
reasoning: true,
|
|
151
|
-
tools: true,
|
|
152
|
-
structuredOutput: true,
|
|
153
|
-
},
|
|
154
|
-
cost: {
|
|
155
|
-
input: 2,
|
|
156
|
-
output: 10,
|
|
157
|
-
},
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
engine: {
|
|
161
|
-
type: 'claude-code',
|
|
162
|
-
provider: 'anthropic',
|
|
163
|
-
model: {
|
|
164
|
-
id: 'claude-haiku-4-5',
|
|
165
|
-
name: 'Claude Haiku 4.5',
|
|
166
|
-
},
|
|
167
|
-
account: {
|
|
168
|
-
id: 0,
|
|
169
|
-
name: '',
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
limit: {
|
|
173
|
-
input: 200_000,
|
|
174
|
-
output: 64_000,
|
|
175
|
-
},
|
|
176
|
-
modalities: {
|
|
177
|
-
input: {
|
|
178
|
-
text: true,
|
|
179
|
-
image: true,
|
|
180
|
-
audio: false,
|
|
181
|
-
video: false,
|
|
182
|
-
pdf: true,
|
|
183
|
-
},
|
|
184
|
-
output: {
|
|
185
|
-
text: true,
|
|
186
|
-
image: false,
|
|
187
|
-
audio: false,
|
|
188
|
-
video: false,
|
|
189
|
-
pdf: false,
|
|
190
|
-
},
|
|
191
|
-
},
|
|
192
|
-
capabilities: {
|
|
193
|
-
reasoning: true,
|
|
194
|
-
tools: true,
|
|
195
|
-
structuredOutput: true,
|
|
196
|
-
},
|
|
197
|
-
cost: {
|
|
198
|
-
input: 1,
|
|
199
|
-
output: 5,
|
|
200
|
-
},
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
engine: {
|
|
204
|
-
type: 'claude-code',
|
|
205
|
-
provider: 'anthropic',
|
|
206
|
-
model: {
|
|
207
|
-
id: 'claude-fable-5',
|
|
208
|
-
name: 'Claude Fable 5',
|
|
209
|
-
},
|
|
210
|
-
account: {
|
|
211
|
-
id: 0,
|
|
212
|
-
name: '',
|
|
213
|
-
},
|
|
214
|
-
},
|
|
215
|
-
limit: {
|
|
216
|
-
input: 1_000_000,
|
|
217
|
-
output: 128_000,
|
|
218
|
-
},
|
|
219
|
-
modalities: {
|
|
220
|
-
input: {
|
|
221
|
-
text: true,
|
|
222
|
-
image: true,
|
|
223
|
-
audio: false,
|
|
224
|
-
video: false,
|
|
225
|
-
pdf: true,
|
|
226
|
-
},
|
|
227
|
-
output: {
|
|
228
|
-
text: true,
|
|
229
|
-
image: false,
|
|
230
|
-
audio: false,
|
|
231
|
-
video: false,
|
|
232
|
-
pdf: false,
|
|
233
|
-
},
|
|
234
|
-
},
|
|
235
|
-
capabilities: {
|
|
236
|
-
reasoning: true,
|
|
237
|
-
tools: true,
|
|
238
|
-
structuredOutput: true,
|
|
239
|
-
},
|
|
240
|
-
cost: {
|
|
241
|
-
input: 10,
|
|
242
|
-
output: 50,
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
engine: {
|
|
247
|
-
type: 'claude-code',
|
|
248
|
-
provider: 'anthropic',
|
|
249
|
-
model: {
|
|
250
|
-
id: 'claude-opus-5',
|
|
251
|
-
name: 'Claude Opus 5',
|
|
252
|
-
},
|
|
253
|
-
account: {
|
|
254
|
-
id: 0,
|
|
255
|
-
name: '',
|
|
256
|
-
},
|
|
257
|
-
},
|
|
258
|
-
limit: {
|
|
259
|
-
input: 1_000_000,
|
|
260
|
-
output: 128_000,
|
|
261
|
-
},
|
|
262
|
-
modalities: {
|
|
263
|
-
input: {
|
|
264
|
-
text: true,
|
|
265
|
-
image: true,
|
|
266
|
-
audio: false,
|
|
267
|
-
video: false,
|
|
268
|
-
pdf: true,
|
|
269
|
-
},
|
|
270
|
-
output: {
|
|
271
|
-
text: true,
|
|
272
|
-
image: false,
|
|
273
|
-
audio: false,
|
|
274
|
-
video: false,
|
|
275
|
-
pdf: false,
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
capabilities: {
|
|
279
|
-
reasoning: true,
|
|
280
|
-
tools: true,
|
|
281
|
-
structuredOutput: true,
|
|
282
|
-
},
|
|
283
|
-
cost: {
|
|
284
|
-
input: 5,
|
|
285
|
-
output: 25,
|
|
286
|
-
},
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
engine: {
|
|
290
|
-
type: 'claude-code',
|
|
291
|
-
provider: 'anthropic',
|
|
292
|
-
model: {
|
|
293
|
-
id: 'claude-sonnet-5',
|
|
294
|
-
name: 'Claude Sonnet 5',
|
|
295
|
-
},
|
|
296
|
-
account: {
|
|
297
|
-
id: 0,
|
|
298
|
-
name: '',
|
|
299
|
-
},
|
|
300
|
-
},
|
|
301
|
-
limit: {
|
|
302
|
-
input: 1_000_000,
|
|
303
|
-
output: 128_000,
|
|
304
|
-
},
|
|
305
|
-
modalities: {
|
|
306
|
-
input: {
|
|
307
|
-
text: true,
|
|
308
|
-
image: true,
|
|
309
|
-
audio: false,
|
|
310
|
-
video: false,
|
|
311
|
-
pdf: true,
|
|
312
|
-
},
|
|
313
|
-
output: {
|
|
314
|
-
text: true,
|
|
315
|
-
image: false,
|
|
316
|
-
audio: false,
|
|
317
|
-
video: false,
|
|
318
|
-
pdf: false,
|
|
319
|
-
},
|
|
320
|
-
},
|
|
321
|
-
capabilities: {
|
|
322
|
-
reasoning: true,
|
|
323
|
-
tools: true,
|
|
324
|
-
structuredOutput: true,
|
|
325
|
-
},
|
|
326
|
-
cost: {
|
|
327
|
-
input: 3,
|
|
328
|
-
output: 15,
|
|
329
|
-
},
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
engine: {
|
|
333
|
-
type: 'claude-code',
|
|
334
|
-
provider: 'anthropic',
|
|
335
|
-
model: {
|
|
336
|
-
id: 'claude-opus-4-8',
|
|
337
|
-
name: 'Claude Opus 4.8',
|
|
338
|
-
},
|
|
339
|
-
account: {
|
|
340
|
-
id: 0,
|
|
341
|
-
name: '',
|
|
342
|
-
},
|
|
343
|
-
},
|
|
344
|
-
limit: {
|
|
345
|
-
input: 1_000_000,
|
|
346
|
-
output: 128_000,
|
|
347
|
-
},
|
|
348
|
-
modalities: {
|
|
349
|
-
input: {
|
|
350
|
-
text: true,
|
|
351
|
-
image: true,
|
|
352
|
-
audio: false,
|
|
353
|
-
video: false,
|
|
354
|
-
pdf: true,
|
|
355
|
-
},
|
|
356
|
-
output: {
|
|
357
|
-
text: true,
|
|
358
|
-
image: false,
|
|
359
|
-
audio: false,
|
|
360
|
-
video: false,
|
|
361
|
-
pdf: false,
|
|
362
|
-
},
|
|
363
|
-
},
|
|
364
|
-
capabilities: {
|
|
365
|
-
reasoning: true,
|
|
366
|
-
tools: true,
|
|
367
|
-
structuredOutput: true,
|
|
368
|
-
},
|
|
369
|
-
cost: {
|
|
370
|
-
input: 5,
|
|
371
|
-
output: 25,
|
|
372
|
-
},
|
|
373
|
-
},
|
|
374
|
-
{
|
|
375
|
-
engine: {
|
|
376
|
-
type: 'claude-code',
|
|
377
|
-
provider: 'anthropic',
|
|
378
|
-
model: {
|
|
379
|
-
id: 'claude-opus-4-7',
|
|
380
|
-
name: 'Claude Opus 4.7',
|
|
381
|
-
},
|
|
382
|
-
account: {
|
|
383
|
-
id: 0,
|
|
384
|
-
name: '',
|
|
385
|
-
},
|
|
386
|
-
},
|
|
387
|
-
limit: {
|
|
388
|
-
input: 1_000_000,
|
|
389
|
-
output: 128_000,
|
|
390
|
-
},
|
|
391
|
-
modalities: {
|
|
392
|
-
input: {
|
|
393
|
-
text: true,
|
|
394
|
-
image: true,
|
|
395
|
-
audio: false,
|
|
396
|
-
video: false,
|
|
397
|
-
pdf: true,
|
|
398
|
-
},
|
|
399
|
-
output: {
|
|
400
|
-
text: true,
|
|
401
|
-
image: false,
|
|
402
|
-
audio: false,
|
|
403
|
-
video: false,
|
|
404
|
-
pdf: false,
|
|
405
|
-
},
|
|
406
|
-
},
|
|
407
|
-
capabilities: {
|
|
408
|
-
reasoning: true,
|
|
409
|
-
tools: true,
|
|
410
|
-
structuredOutput: true,
|
|
411
|
-
},
|
|
412
|
-
cost: {
|
|
413
|
-
input: 5,
|
|
414
|
-
output: 25,
|
|
415
|
-
},
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
engine: {
|
|
419
|
-
type: 'claude-code',
|
|
420
|
-
provider: 'anthropic',
|
|
421
|
-
model: {
|
|
422
|
-
id: 'claude-opus-4-6',
|
|
423
|
-
name: 'Claude Opus 4.6',
|
|
424
|
-
},
|
|
425
|
-
account: {
|
|
426
|
-
id: 0,
|
|
427
|
-
name: '',
|
|
428
|
-
},
|
|
429
|
-
},
|
|
430
|
-
limit: {
|
|
431
|
-
input: 1_000_000,
|
|
432
|
-
output: 128_000,
|
|
433
|
-
},
|
|
434
|
-
modalities: {
|
|
435
|
-
input: {
|
|
436
|
-
text: true,
|
|
437
|
-
image: true,
|
|
438
|
-
audio: false,
|
|
439
|
-
video: false,
|
|
440
|
-
pdf: true,
|
|
441
|
-
},
|
|
442
|
-
output: {
|
|
443
|
-
text: true,
|
|
444
|
-
image: false,
|
|
445
|
-
audio: false,
|
|
446
|
-
video: false,
|
|
447
|
-
pdf: false,
|
|
448
|
-
},
|
|
449
|
-
},
|
|
450
|
-
capabilities: {
|
|
451
|
-
reasoning: true,
|
|
452
|
-
tools: true,
|
|
453
|
-
structuredOutput: true,
|
|
454
|
-
},
|
|
455
|
-
cost: {
|
|
456
|
-
input: 5,
|
|
457
|
-
output: 25,
|
|
458
|
-
},
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
engine: {
|
|
462
|
-
type: 'claude-code',
|
|
463
|
-
provider: 'anthropic',
|
|
464
|
-
model: {
|
|
465
|
-
id: 'claude-sonnet-4-6',
|
|
466
|
-
name: 'Claude Sonnet 4.6',
|
|
467
|
-
},
|
|
468
|
-
account: {
|
|
469
|
-
id: 0,
|
|
470
|
-
name: '',
|
|
471
|
-
},
|
|
472
|
-
},
|
|
473
|
-
limit: {
|
|
474
|
-
input: 1_000_000,
|
|
475
|
-
output: 128_000,
|
|
476
|
-
},
|
|
477
|
-
modalities: {
|
|
478
|
-
input: {
|
|
479
|
-
text: true,
|
|
480
|
-
image: true,
|
|
481
|
-
audio: false,
|
|
482
|
-
video: false,
|
|
483
|
-
pdf: true,
|
|
484
|
-
},
|
|
485
|
-
output: {
|
|
486
|
-
text: true,
|
|
487
|
-
image: false,
|
|
488
|
-
audio: false,
|
|
489
|
-
video: false,
|
|
490
|
-
pdf: false,
|
|
491
|
-
},
|
|
492
|
-
},
|
|
493
|
-
capabilities: {
|
|
494
|
-
reasoning: true,
|
|
495
|
-
tools: true,
|
|
496
|
-
structuredOutput: true,
|
|
497
|
-
},
|
|
498
|
-
cost: {
|
|
499
|
-
input: 3,
|
|
500
|
-
output: 15,
|
|
501
|
-
},
|
|
502
|
-
},
|
|
503
|
-
{
|
|
504
|
-
engine: {
|
|
505
|
-
type: 'claude-code',
|
|
506
|
-
provider: 'anthropic',
|
|
507
|
-
model: {
|
|
508
|
-
id: 'claude-opus-4-5',
|
|
509
|
-
name: 'Claude Opus 4.5',
|
|
510
|
-
},
|
|
511
|
-
account: {
|
|
512
|
-
id: 0,
|
|
513
|
-
name: '',
|
|
514
|
-
},
|
|
515
|
-
},
|
|
516
|
-
limit: {
|
|
517
|
-
input: 200_000,
|
|
518
|
-
output: 64_000,
|
|
519
|
-
},
|
|
520
|
-
modalities: {
|
|
521
|
-
input: {
|
|
522
|
-
text: true,
|
|
523
|
-
image: true,
|
|
524
|
-
audio: false,
|
|
525
|
-
video: false,
|
|
526
|
-
pdf: true,
|
|
527
|
-
},
|
|
528
|
-
output: {
|
|
529
|
-
text: true,
|
|
530
|
-
image: false,
|
|
531
|
-
audio: false,
|
|
532
|
-
video: false,
|
|
533
|
-
pdf: false,
|
|
534
|
-
},
|
|
535
|
-
},
|
|
536
|
-
capabilities: {
|
|
537
|
-
reasoning: true,
|
|
538
|
-
tools: true,
|
|
539
|
-
structuredOutput: true,
|
|
540
|
-
},
|
|
541
|
-
cost: {
|
|
542
|
-
input: 5,
|
|
543
|
-
output: 25,
|
|
544
|
-
},
|
|
545
|
-
},
|
|
546
|
-
{
|
|
42
|
+
function claudeReasoning(levels: string[]): ReasoningControl {
|
|
43
|
+
return { levels: toReasoningOptions(levels), default: 'auto' };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Shared shape for a Claude catalog entry; only id, limits, cost and reasoning vary. */
|
|
47
|
+
function claudeModel(
|
|
48
|
+
id: string,
|
|
49
|
+
name: string,
|
|
50
|
+
limit: { input: number; output: number },
|
|
51
|
+
cost: { input: number; output: number },
|
|
52
|
+
reasoningLevels: string[],
|
|
53
|
+
): EngineModel {
|
|
54
|
+
return {
|
|
547
55
|
engine: {
|
|
548
56
|
type: 'claude-code',
|
|
549
57
|
provider: 'anthropic',
|
|
550
|
-
model: {
|
|
551
|
-
|
|
552
|
-
name: 'Claude Sonnet 4.5',
|
|
553
|
-
},
|
|
554
|
-
account: {
|
|
555
|
-
id: 0,
|
|
556
|
-
name: '',
|
|
557
|
-
},
|
|
558
|
-
},
|
|
559
|
-
limit: {
|
|
560
|
-
input: 200_000,
|
|
561
|
-
output: 64_000,
|
|
58
|
+
model: { id, name },
|
|
59
|
+
account: { id: 0, name: '' },
|
|
562
60
|
},
|
|
61
|
+
limit,
|
|
563
62
|
modalities: {
|
|
564
|
-
input: {
|
|
565
|
-
|
|
566
|
-
image: true,
|
|
567
|
-
audio: false,
|
|
568
|
-
video: false,
|
|
569
|
-
pdf: true,
|
|
570
|
-
},
|
|
571
|
-
output: {
|
|
572
|
-
text: true,
|
|
573
|
-
image: false,
|
|
574
|
-
audio: false,
|
|
575
|
-
video: false,
|
|
576
|
-
pdf: false,
|
|
577
|
-
},
|
|
63
|
+
input: { text: true, image: true, audio: false, video: false, pdf: true },
|
|
64
|
+
output: { text: true, image: false, audio: false, video: false, pdf: false },
|
|
578
65
|
},
|
|
579
66
|
capabilities: {
|
|
580
67
|
reasoning: true,
|
|
581
68
|
tools: true,
|
|
582
69
|
structuredOutput: true,
|
|
70
|
+
reasoningControl: claudeReasoning(reasoningLevels),
|
|
583
71
|
},
|
|
584
|
-
cost
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
72
|
+
cost,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const WINDOW_1M = { input: 1_000_000, output: 128_000 };
|
|
77
|
+
const WINDOW_200K = { input: 200_000, output: 64_000 };
|
|
78
|
+
|
|
79
|
+
/** Latest generation first, then legacy models newest to oldest. */
|
|
80
|
+
export const CLAUDE_CODE_MODELS: EngineModel[] = [
|
|
81
|
+
claudeModel('claude-fable-5-1', 'Claude Fable 5.1', WINDOW_1M, { input: 10, output: 50 }, ALWAYS_THINKING),
|
|
82
|
+
claudeModel('claude-opus-5-5', 'Claude Opus 5.5', WINDOW_1M, { input: 4, output: 20 }, ALWAYS_THINKING),
|
|
83
|
+
claudeModel('claude-sonnet-5-5', 'Claude Sonnet 5.5', WINDOW_1M, { input: 2, output: 10 }, ALWAYS_THINKING),
|
|
84
|
+
// Haiku 5.5 is priced in tiers: $0.50 / $2.50 once a prompt passes 100K
|
|
85
|
+
// tokens. Only the base tier is listed — the catalog cost is metadata, while
|
|
86
|
+
// the cost shown for a chat is the CLI's own, which applies the tiers.
|
|
87
|
+
claudeModel('claude-haiku-5-5', 'Claude Haiku 5.5', WINDOW_1M, { input: 0.1, output: 0.5 }, ALWAYS_THINKING),
|
|
88
|
+
claudeModel('claude-fable-5', 'Claude Fable 5', WINDOW_1M, { input: 10, output: 50 }, ALWAYS_THINKING),
|
|
89
|
+
claudeModel('claude-opus-5', 'Claude Opus 5', WINDOW_1M, { input: 5, output: 25 }, FULL_EFFORT),
|
|
90
|
+
claudeModel('claude-sonnet-5', 'Claude Sonnet 5', WINDOW_1M, { input: 3, output: 15 }, FULL_EFFORT),
|
|
91
|
+
claudeModel('claude-opus-4-8', 'Claude Opus 4.8', WINDOW_1M, { input: 5, output: 25 }, FULL_EFFORT),
|
|
92
|
+
claudeModel('claude-opus-4-7', 'Claude Opus 4.7', WINDOW_1M, { input: 5, output: 25 }, FULL_EFFORT),
|
|
93
|
+
claudeModel('claude-opus-4-6', 'Claude Opus 4.6', WINDOW_1M, { input: 5, output: 25 }, EFFORT_TO_MAX),
|
|
94
|
+
claudeModel('claude-sonnet-4-6', 'Claude Sonnet 4.6', WINDOW_1M, { input: 3, output: 15 }, EFFORT_TO_MAX),
|
|
95
|
+
claudeModel('claude-opus-4-5', 'Claude Opus 4.5', WINDOW_200K, { input: 5, output: 25 }, THINKING_ONLY),
|
|
589
96
|
];
|
|
590
97
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Resolve the reasoning level to send for a turn: the requested level when that
|
|
100
|
+
* model offers it, otherwise that model's own default.
|
|
101
|
+
*
|
|
102
|
+
* The picker only offers per-model levels, but a stored preference outlives a
|
|
103
|
+
* catalog change — an `off` saved before Opus 5.5 lost it must not reach the
|
|
104
|
+
* CLI, which would quietly run adaptive thinking under a label saying "Off".
|
|
105
|
+
* A model outside the catalog (an alias such as `haiku`) has no known levels,
|
|
106
|
+
* so its request passes through unchanged.
|
|
107
|
+
*/
|
|
108
|
+
export function resolveClaudeReasoning(modelId: string | undefined, requested: string | undefined): string | undefined {
|
|
109
|
+
const control = CLAUDE_CODE_MODELS.find(m => m.engine.model.id === modelId)?.capabilities.reasoningControl;
|
|
110
|
+
if (!control || requested === undefined) return requested;
|
|
111
|
+
if (control.levels.some(level => level.value === requested)) return requested;
|
|
112
|
+
return control.default;
|
|
113
|
+
}
|