@xtruder/opencode-claude-max-plugin 0.4.5 → 2.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -124
- package/build/index.d.ts +514 -19
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -1818
- package/build/model.d.ts +0 -5
- package/build/model.d.ts.map +1 -1
- package/build/server.d.ts +4 -11
- package/build/server.d.ts.map +1 -1
- package/build/server.js +68 -1818
- package/build/src-Dvxl6Bub.js +1527 -0
- package/build/tui-state.d.ts +12 -0
- package/build/tui-state.d.ts.map +1 -0
- package/build/tui.d.ts +11 -3
- package/build/tui.d.ts.map +1 -1
- package/build/tui.js +239 -0
- package/build/usage-pZdEiX94.js +336 -0
- package/build/usage.d.ts +1 -1
- package/build/usage.d.ts.map +1 -1
- package/package.json +34 -44
- package/src/credentials.ts +0 -156
- package/src/tui.tsx +0 -579
- package/src/usage.ts +0 -331
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { LanguageModelV3 } from "@ai-sdk/provider";
|
|
2
|
-
import type { Plugin } from "@opencode-ai/plugin";
|
|
3
2
|
export declare const CLAUDE_CODE_SYSTEM_PROMPT: string;
|
|
4
3
|
export declare const CLAUDE_CODE_NEW_SYSTEM_PROMPT: string;
|
|
5
4
|
export declare const CLAUDE_CODE_OPUS5_SYSTEM_PROMPT: string;
|
|
@@ -14,6 +13,515 @@ export declare const CLAUDE_CODE_FABLE5_SYSTEM_PROMPT: string;
|
|
|
14
13
|
* harness. Older models get the legacy long-form prompt.
|
|
15
14
|
*/
|
|
16
15
|
export declare function selectClaudePromptForModel(modelId: string): string;
|
|
16
|
+
export declare const PROVIDER_ID = "anthropic-sdk";
|
|
17
|
+
/** Register supported models with subscription or API-key pricing. */
|
|
18
|
+
export declare function buildPluginModels(isOAuth: boolean): {
|
|
19
|
+
"claude-haiku-4-5": {
|
|
20
|
+
name: string;
|
|
21
|
+
reasoning: boolean;
|
|
22
|
+
tool_call: boolean;
|
|
23
|
+
attachment: boolean;
|
|
24
|
+
temperature: boolean;
|
|
25
|
+
limit: {
|
|
26
|
+
context: number;
|
|
27
|
+
output: number;
|
|
28
|
+
};
|
|
29
|
+
cost: {
|
|
30
|
+
readonly input: 1;
|
|
31
|
+
readonly output: 5;
|
|
32
|
+
readonly cache_read: 0.1;
|
|
33
|
+
readonly cache_write: 1.25;
|
|
34
|
+
} | {
|
|
35
|
+
readonly input: 2;
|
|
36
|
+
readonly output: 10;
|
|
37
|
+
readonly cache_read: 0.2;
|
|
38
|
+
readonly cache_write: 2.5;
|
|
39
|
+
} | {
|
|
40
|
+
readonly input: 5;
|
|
41
|
+
readonly output: 25;
|
|
42
|
+
readonly cache_read: 0.5;
|
|
43
|
+
readonly cache_write: 6.25;
|
|
44
|
+
} | {
|
|
45
|
+
readonly input: 4;
|
|
46
|
+
readonly output: 20;
|
|
47
|
+
readonly cache_read: 0.2;
|
|
48
|
+
readonly cache_write: 5;
|
|
49
|
+
} | {
|
|
50
|
+
readonly input: 10;
|
|
51
|
+
readonly output: 50;
|
|
52
|
+
readonly cache_read: 1;
|
|
53
|
+
readonly cache_write: 12.5;
|
|
54
|
+
} | {
|
|
55
|
+
readonly input: 10;
|
|
56
|
+
readonly output: 50;
|
|
57
|
+
readonly cache_read: 0.25;
|
|
58
|
+
readonly cache_write: 12.5;
|
|
59
|
+
} | {
|
|
60
|
+
input: number;
|
|
61
|
+
output: number;
|
|
62
|
+
cache_read: number;
|
|
63
|
+
cache_write: number;
|
|
64
|
+
};
|
|
65
|
+
modalities: {
|
|
66
|
+
input: Array<"text" | "image">;
|
|
67
|
+
output: Array<"text">;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
"claude-sonnet-5": {
|
|
71
|
+
variants: {
|
|
72
|
+
low: {
|
|
73
|
+
effort: string;
|
|
74
|
+
};
|
|
75
|
+
medium: {
|
|
76
|
+
effort: string;
|
|
77
|
+
};
|
|
78
|
+
high: {
|
|
79
|
+
effort: string;
|
|
80
|
+
};
|
|
81
|
+
xhigh: {
|
|
82
|
+
effort: string;
|
|
83
|
+
};
|
|
84
|
+
max: {
|
|
85
|
+
effort: string;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
name: string;
|
|
89
|
+
reasoning: boolean;
|
|
90
|
+
tool_call: boolean;
|
|
91
|
+
attachment: boolean;
|
|
92
|
+
temperature: boolean;
|
|
93
|
+
limit: {
|
|
94
|
+
context: number;
|
|
95
|
+
output: number;
|
|
96
|
+
};
|
|
97
|
+
cost: {
|
|
98
|
+
readonly input: 1;
|
|
99
|
+
readonly output: 5;
|
|
100
|
+
readonly cache_read: 0.1;
|
|
101
|
+
readonly cache_write: 1.25;
|
|
102
|
+
} | {
|
|
103
|
+
readonly input: 2;
|
|
104
|
+
readonly output: 10;
|
|
105
|
+
readonly cache_read: 0.2;
|
|
106
|
+
readonly cache_write: 2.5;
|
|
107
|
+
} | {
|
|
108
|
+
readonly input: 5;
|
|
109
|
+
readonly output: 25;
|
|
110
|
+
readonly cache_read: 0.5;
|
|
111
|
+
readonly cache_write: 6.25;
|
|
112
|
+
} | {
|
|
113
|
+
readonly input: 4;
|
|
114
|
+
readonly output: 20;
|
|
115
|
+
readonly cache_read: 0.2;
|
|
116
|
+
readonly cache_write: 5;
|
|
117
|
+
} | {
|
|
118
|
+
readonly input: 10;
|
|
119
|
+
readonly output: 50;
|
|
120
|
+
readonly cache_read: 1;
|
|
121
|
+
readonly cache_write: 12.5;
|
|
122
|
+
} | {
|
|
123
|
+
readonly input: 10;
|
|
124
|
+
readonly output: 50;
|
|
125
|
+
readonly cache_read: 0.25;
|
|
126
|
+
readonly cache_write: 12.5;
|
|
127
|
+
} | {
|
|
128
|
+
input: number;
|
|
129
|
+
output: number;
|
|
130
|
+
cache_read: number;
|
|
131
|
+
cache_write: number;
|
|
132
|
+
};
|
|
133
|
+
modalities: {
|
|
134
|
+
input: Array<"text" | "image" | "pdf">;
|
|
135
|
+
output: Array<"text">;
|
|
136
|
+
};
|
|
137
|
+
options: {
|
|
138
|
+
effort: string;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
"claude-opus-4-8": {
|
|
142
|
+
variants: {
|
|
143
|
+
low: {
|
|
144
|
+
effort: string;
|
|
145
|
+
};
|
|
146
|
+
medium: {
|
|
147
|
+
effort: string;
|
|
148
|
+
};
|
|
149
|
+
high: {
|
|
150
|
+
effort: string;
|
|
151
|
+
};
|
|
152
|
+
xhigh: {
|
|
153
|
+
effort: string;
|
|
154
|
+
};
|
|
155
|
+
max: {
|
|
156
|
+
effort: string;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
name: string;
|
|
160
|
+
reasoning: boolean;
|
|
161
|
+
tool_call: boolean;
|
|
162
|
+
attachment: boolean;
|
|
163
|
+
temperature: boolean;
|
|
164
|
+
limit: {
|
|
165
|
+
context: number;
|
|
166
|
+
output: number;
|
|
167
|
+
};
|
|
168
|
+
cost: {
|
|
169
|
+
readonly input: 1;
|
|
170
|
+
readonly output: 5;
|
|
171
|
+
readonly cache_read: 0.1;
|
|
172
|
+
readonly cache_write: 1.25;
|
|
173
|
+
} | {
|
|
174
|
+
readonly input: 2;
|
|
175
|
+
readonly output: 10;
|
|
176
|
+
readonly cache_read: 0.2;
|
|
177
|
+
readonly cache_write: 2.5;
|
|
178
|
+
} | {
|
|
179
|
+
readonly input: 5;
|
|
180
|
+
readonly output: 25;
|
|
181
|
+
readonly cache_read: 0.5;
|
|
182
|
+
readonly cache_write: 6.25;
|
|
183
|
+
} | {
|
|
184
|
+
readonly input: 4;
|
|
185
|
+
readonly output: 20;
|
|
186
|
+
readonly cache_read: 0.2;
|
|
187
|
+
readonly cache_write: 5;
|
|
188
|
+
} | {
|
|
189
|
+
readonly input: 10;
|
|
190
|
+
readonly output: 50;
|
|
191
|
+
readonly cache_read: 1;
|
|
192
|
+
readonly cache_write: 12.5;
|
|
193
|
+
} | {
|
|
194
|
+
readonly input: 10;
|
|
195
|
+
readonly output: 50;
|
|
196
|
+
readonly cache_read: 0.25;
|
|
197
|
+
readonly cache_write: 12.5;
|
|
198
|
+
} | {
|
|
199
|
+
input: number;
|
|
200
|
+
output: number;
|
|
201
|
+
cache_read: number;
|
|
202
|
+
cache_write: number;
|
|
203
|
+
};
|
|
204
|
+
modalities: {
|
|
205
|
+
input: Array<"text" | "image" | "pdf">;
|
|
206
|
+
output: Array<"text">;
|
|
207
|
+
};
|
|
208
|
+
options: {
|
|
209
|
+
effort: string;
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Opus 5 — Anthropic's latest Opus model (released 2026-07-24).
|
|
214
|
+
*
|
|
215
|
+
* 1M context, 128K output, and $5/$25 per MTok. Adaptive thinking is on
|
|
216
|
+
* by default and supports low/medium/high/xhigh/max effort. Opus 5's
|
|
217
|
+
* safety classifiers can decline requests, so use Anthropic's default
|
|
218
|
+
* server-side fallback routing unless explicitly disabled.
|
|
219
|
+
*/
|
|
220
|
+
"claude-opus-5": {
|
|
221
|
+
variants: {
|
|
222
|
+
low: {
|
|
223
|
+
effort: string;
|
|
224
|
+
};
|
|
225
|
+
medium: {
|
|
226
|
+
effort: string;
|
|
227
|
+
};
|
|
228
|
+
high: {
|
|
229
|
+
effort: string;
|
|
230
|
+
};
|
|
231
|
+
xhigh: {
|
|
232
|
+
effort: string;
|
|
233
|
+
};
|
|
234
|
+
max: {
|
|
235
|
+
effort: string;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
name: string;
|
|
239
|
+
reasoning: boolean;
|
|
240
|
+
tool_call: boolean;
|
|
241
|
+
attachment: boolean;
|
|
242
|
+
temperature: boolean;
|
|
243
|
+
limit: {
|
|
244
|
+
context: number;
|
|
245
|
+
output: number;
|
|
246
|
+
};
|
|
247
|
+
cost: {
|
|
248
|
+
readonly input: 1;
|
|
249
|
+
readonly output: 5;
|
|
250
|
+
readonly cache_read: 0.1;
|
|
251
|
+
readonly cache_write: 1.25;
|
|
252
|
+
} | {
|
|
253
|
+
readonly input: 2;
|
|
254
|
+
readonly output: 10;
|
|
255
|
+
readonly cache_read: 0.2;
|
|
256
|
+
readonly cache_write: 2.5;
|
|
257
|
+
} | {
|
|
258
|
+
readonly input: 5;
|
|
259
|
+
readonly output: 25;
|
|
260
|
+
readonly cache_read: 0.5;
|
|
261
|
+
readonly cache_write: 6.25;
|
|
262
|
+
} | {
|
|
263
|
+
readonly input: 4;
|
|
264
|
+
readonly output: 20;
|
|
265
|
+
readonly cache_read: 0.2;
|
|
266
|
+
readonly cache_write: 5;
|
|
267
|
+
} | {
|
|
268
|
+
readonly input: 10;
|
|
269
|
+
readonly output: 50;
|
|
270
|
+
readonly cache_read: 1;
|
|
271
|
+
readonly cache_write: 12.5;
|
|
272
|
+
} | {
|
|
273
|
+
readonly input: 10;
|
|
274
|
+
readonly output: 50;
|
|
275
|
+
readonly cache_read: 0.25;
|
|
276
|
+
readonly cache_write: 12.5;
|
|
277
|
+
} | {
|
|
278
|
+
input: number;
|
|
279
|
+
output: number;
|
|
280
|
+
cache_read: number;
|
|
281
|
+
cache_write: number;
|
|
282
|
+
};
|
|
283
|
+
modalities: {
|
|
284
|
+
input: Array<"text" | "image" | "pdf">;
|
|
285
|
+
output: Array<"text">;
|
|
286
|
+
};
|
|
287
|
+
options: {
|
|
288
|
+
effort: string;
|
|
289
|
+
refusalFallback: string;
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
"claude-opus-5-5": {
|
|
293
|
+
variants: {
|
|
294
|
+
low: {
|
|
295
|
+
effort: string;
|
|
296
|
+
};
|
|
297
|
+
medium: {
|
|
298
|
+
effort: string;
|
|
299
|
+
};
|
|
300
|
+
high: {
|
|
301
|
+
effort: string;
|
|
302
|
+
};
|
|
303
|
+
xhigh: {
|
|
304
|
+
effort: string;
|
|
305
|
+
};
|
|
306
|
+
max: {
|
|
307
|
+
effort: string;
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
name: string;
|
|
311
|
+
reasoning: boolean;
|
|
312
|
+
tool_call: boolean;
|
|
313
|
+
attachment: boolean;
|
|
314
|
+
temperature: boolean;
|
|
315
|
+
limit: {
|
|
316
|
+
context: number;
|
|
317
|
+
output: number;
|
|
318
|
+
};
|
|
319
|
+
cost: {
|
|
320
|
+
readonly input: 1;
|
|
321
|
+
readonly output: 5;
|
|
322
|
+
readonly cache_read: 0.1;
|
|
323
|
+
readonly cache_write: 1.25;
|
|
324
|
+
} | {
|
|
325
|
+
readonly input: 2;
|
|
326
|
+
readonly output: 10;
|
|
327
|
+
readonly cache_read: 0.2;
|
|
328
|
+
readonly cache_write: 2.5;
|
|
329
|
+
} | {
|
|
330
|
+
readonly input: 5;
|
|
331
|
+
readonly output: 25;
|
|
332
|
+
readonly cache_read: 0.5;
|
|
333
|
+
readonly cache_write: 6.25;
|
|
334
|
+
} | {
|
|
335
|
+
readonly input: 4;
|
|
336
|
+
readonly output: 20;
|
|
337
|
+
readonly cache_read: 0.2;
|
|
338
|
+
readonly cache_write: 5;
|
|
339
|
+
} | {
|
|
340
|
+
readonly input: 10;
|
|
341
|
+
readonly output: 50;
|
|
342
|
+
readonly cache_read: 1;
|
|
343
|
+
readonly cache_write: 12.5;
|
|
344
|
+
} | {
|
|
345
|
+
readonly input: 10;
|
|
346
|
+
readonly output: 50;
|
|
347
|
+
readonly cache_read: 0.25;
|
|
348
|
+
readonly cache_write: 12.5;
|
|
349
|
+
} | {
|
|
350
|
+
input: number;
|
|
351
|
+
output: number;
|
|
352
|
+
cache_read: number;
|
|
353
|
+
cache_write: number;
|
|
354
|
+
};
|
|
355
|
+
modalities: {
|
|
356
|
+
input: Array<"text" | "image" | "pdf">;
|
|
357
|
+
output: Array<"text">;
|
|
358
|
+
};
|
|
359
|
+
options: {
|
|
360
|
+
effort: string;
|
|
361
|
+
refusalFallback: string;
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
/**
|
|
365
|
+
* Fable 5 — Anthropic's most capable widely released model (released 2026-06-09).
|
|
366
|
+
*
|
|
367
|
+
* First publicly available Mythos-class model; sits above the Opus family.
|
|
368
|
+
* 1M context window, up to 128K output. Pricing $10/$50 per MTok (double Opus 4.8).
|
|
369
|
+
*
|
|
370
|
+
* Adaptive thinking is always-on (the only thinking mode); raw chain-of-thought
|
|
371
|
+
* is never returned (thinking blocks are summarized or omitted). Uses the same
|
|
372
|
+
* effort levels as Opus 4.8 (low/medium/high/xhigh/max).
|
|
373
|
+
*
|
|
374
|
+
* Safety classifiers can decline requests in cyber/bio/frontier_llm/reasoning_extraction
|
|
375
|
+
* domains, returning stop_reason: "refusal" (HTTP 200). Per Anthropic's recommendation
|
|
376
|
+
* we fall back to Claude Opus 4.8 server-side (`refusalFallback` option → `fallbacks`
|
|
377
|
+
* request param). Disable with `"refusalFallback": false` in the model options of your
|
|
378
|
+
* opencode.json, or point it at a different model. See RESEARCH.md / model.ts.
|
|
379
|
+
*/
|
|
380
|
+
"claude-fable-5": {
|
|
381
|
+
variants: {
|
|
382
|
+
low: {
|
|
383
|
+
effort: string;
|
|
384
|
+
};
|
|
385
|
+
medium: {
|
|
386
|
+
effort: string;
|
|
387
|
+
};
|
|
388
|
+
high: {
|
|
389
|
+
effort: string;
|
|
390
|
+
};
|
|
391
|
+
xhigh: {
|
|
392
|
+
effort: string;
|
|
393
|
+
};
|
|
394
|
+
max: {
|
|
395
|
+
effort: string;
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
name: string;
|
|
399
|
+
reasoning: boolean;
|
|
400
|
+
tool_call: boolean;
|
|
401
|
+
attachment: boolean;
|
|
402
|
+
temperature: boolean;
|
|
403
|
+
limit: {
|
|
404
|
+
context: number;
|
|
405
|
+
output: number;
|
|
406
|
+
};
|
|
407
|
+
cost: {
|
|
408
|
+
readonly input: 1;
|
|
409
|
+
readonly output: 5;
|
|
410
|
+
readonly cache_read: 0.1;
|
|
411
|
+
readonly cache_write: 1.25;
|
|
412
|
+
} | {
|
|
413
|
+
readonly input: 2;
|
|
414
|
+
readonly output: 10;
|
|
415
|
+
readonly cache_read: 0.2;
|
|
416
|
+
readonly cache_write: 2.5;
|
|
417
|
+
} | {
|
|
418
|
+
readonly input: 5;
|
|
419
|
+
readonly output: 25;
|
|
420
|
+
readonly cache_read: 0.5;
|
|
421
|
+
readonly cache_write: 6.25;
|
|
422
|
+
} | {
|
|
423
|
+
readonly input: 4;
|
|
424
|
+
readonly output: 20;
|
|
425
|
+
readonly cache_read: 0.2;
|
|
426
|
+
readonly cache_write: 5;
|
|
427
|
+
} | {
|
|
428
|
+
readonly input: 10;
|
|
429
|
+
readonly output: 50;
|
|
430
|
+
readonly cache_read: 1;
|
|
431
|
+
readonly cache_write: 12.5;
|
|
432
|
+
} | {
|
|
433
|
+
readonly input: 10;
|
|
434
|
+
readonly output: 50;
|
|
435
|
+
readonly cache_read: 0.25;
|
|
436
|
+
readonly cache_write: 12.5;
|
|
437
|
+
} | {
|
|
438
|
+
input: number;
|
|
439
|
+
output: number;
|
|
440
|
+
cache_read: number;
|
|
441
|
+
cache_write: number;
|
|
442
|
+
};
|
|
443
|
+
modalities: {
|
|
444
|
+
input: Array<"text" | "image" | "pdf">;
|
|
445
|
+
output: Array<"text">;
|
|
446
|
+
};
|
|
447
|
+
options: {
|
|
448
|
+
effort: string;
|
|
449
|
+
refusalFallback: string;
|
|
450
|
+
};
|
|
451
|
+
};
|
|
452
|
+
"claude-fable-5-1": {
|
|
453
|
+
variants: {
|
|
454
|
+
low: {
|
|
455
|
+
effort: string;
|
|
456
|
+
};
|
|
457
|
+
medium: {
|
|
458
|
+
effort: string;
|
|
459
|
+
};
|
|
460
|
+
high: {
|
|
461
|
+
effort: string;
|
|
462
|
+
};
|
|
463
|
+
xhigh: {
|
|
464
|
+
effort: string;
|
|
465
|
+
};
|
|
466
|
+
max: {
|
|
467
|
+
effort: string;
|
|
468
|
+
};
|
|
469
|
+
};
|
|
470
|
+
name: string;
|
|
471
|
+
reasoning: boolean;
|
|
472
|
+
tool_call: boolean;
|
|
473
|
+
attachment: boolean;
|
|
474
|
+
temperature: boolean;
|
|
475
|
+
limit: {
|
|
476
|
+
context: number;
|
|
477
|
+
output: number;
|
|
478
|
+
};
|
|
479
|
+
cost: {
|
|
480
|
+
readonly input: 1;
|
|
481
|
+
readonly output: 5;
|
|
482
|
+
readonly cache_read: 0.1;
|
|
483
|
+
readonly cache_write: 1.25;
|
|
484
|
+
} | {
|
|
485
|
+
readonly input: 2;
|
|
486
|
+
readonly output: 10;
|
|
487
|
+
readonly cache_read: 0.2;
|
|
488
|
+
readonly cache_write: 2.5;
|
|
489
|
+
} | {
|
|
490
|
+
readonly input: 5;
|
|
491
|
+
readonly output: 25;
|
|
492
|
+
readonly cache_read: 0.5;
|
|
493
|
+
readonly cache_write: 6.25;
|
|
494
|
+
} | {
|
|
495
|
+
readonly input: 4;
|
|
496
|
+
readonly output: 20;
|
|
497
|
+
readonly cache_read: 0.2;
|
|
498
|
+
readonly cache_write: 5;
|
|
499
|
+
} | {
|
|
500
|
+
readonly input: 10;
|
|
501
|
+
readonly output: 50;
|
|
502
|
+
readonly cache_read: 1;
|
|
503
|
+
readonly cache_write: 12.5;
|
|
504
|
+
} | {
|
|
505
|
+
readonly input: 10;
|
|
506
|
+
readonly output: 50;
|
|
507
|
+
readonly cache_read: 0.25;
|
|
508
|
+
readonly cache_write: 12.5;
|
|
509
|
+
} | {
|
|
510
|
+
input: number;
|
|
511
|
+
output: number;
|
|
512
|
+
cache_read: number;
|
|
513
|
+
cache_write: number;
|
|
514
|
+
};
|
|
515
|
+
modalities: {
|
|
516
|
+
input: Array<"text" | "image" | "pdf">;
|
|
517
|
+
output: Array<"text">;
|
|
518
|
+
};
|
|
519
|
+
options: {
|
|
520
|
+
effort: string;
|
|
521
|
+
refusalFallback: string;
|
|
522
|
+
};
|
|
523
|
+
};
|
|
524
|
+
};
|
|
17
525
|
export interface AnthropicSDKProviderOptions {
|
|
18
526
|
/**
|
|
19
527
|
* Anthropic API key. Defaults to ANTHROPIC_API_KEY env var.
|
|
@@ -51,6 +559,11 @@ export interface AnthropicSDKProvider {
|
|
|
51
559
|
*/
|
|
52
560
|
languageModel(modelId: string): LanguageModelV3;
|
|
53
561
|
}
|
|
562
|
+
export declare function resolveAuth(options: AnthropicSDKProviderOptions): {
|
|
563
|
+
apiKey?: string | null;
|
|
564
|
+
authToken?: string | null;
|
|
565
|
+
isOAuth: boolean;
|
|
566
|
+
};
|
|
54
567
|
/**
|
|
55
568
|
* Create an Anthropic SDK provider for use with OpenCode / Vercel AI SDK.
|
|
56
569
|
*
|
|
@@ -62,23 +575,5 @@ export interface AnthropicSDKProvider {
|
|
|
62
575
|
* starts with "create" when loading the npm package as a provider.
|
|
63
576
|
*/
|
|
64
577
|
export declare function createAnthropicSDK(options?: AnthropicSDKProviderOptions): AnthropicSDKProvider;
|
|
65
|
-
/**
|
|
66
|
-
* OpenCode plugin that self-registers the anthropic-sdk provider and its
|
|
67
|
-
* supported models into the running config on startup.
|
|
68
|
-
*
|
|
69
|
-
* Add this package to the `plugin` array in your opencode.json:
|
|
70
|
-
*
|
|
71
|
-
* { "plugin": ["@xtruder/opencode-claude-max-plugin"] }
|
|
72
|
-
*
|
|
73
|
-
* The plugin uses the `config` hook which is called after config is loaded
|
|
74
|
-
* but before providers are initialized. We mutate the Config object in-place
|
|
75
|
-
* to inject the provider definition and model list.
|
|
76
|
-
*
|
|
77
|
-
* OpenCode's plugin loader iterates all module exports and calls each one
|
|
78
|
-
* as a Plugin function. `createAnthropicSDK` is also called — it returns
|
|
79
|
-
* { languageModel } which is harmlessly pushed to the hooks list with all
|
|
80
|
-
* hook slots undefined (no-ops).
|
|
81
|
-
*/
|
|
82
|
-
export declare const anthropicSDKPlugin: Plugin;
|
|
83
578
|
export default createAnthropicSDK;
|
|
84
579
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["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