@easbot/llm 0.3.19

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.
@@ -0,0 +1,1903 @@
1
+ import * as _ai_sdk_provider from '@ai-sdk/provider';
2
+ import { JSONSchema7, LanguageModelV3 } from '@ai-sdk/provider';
3
+ import z from 'zod';
4
+ import { LanguageModel, EmbeddingModel, RerankingModel, APICallError, ModelMessage } from 'ai';
5
+ import { JSONSchema } from 'zod/v4/core';
6
+ import { FetchFunction } from '@ai-sdk/provider-utils';
7
+
8
+ declare namespace ModelsDev {
9
+ const Model: z.ZodObject<{
10
+ id: z.ZodString;
11
+ name: z.ZodString;
12
+ family: z.ZodOptional<z.ZodString>;
13
+ release_date: z.ZodString;
14
+ attachment: z.ZodBoolean;
15
+ reasoning: z.ZodBoolean;
16
+ temperature: z.ZodBoolean;
17
+ tool_call: z.ZodBoolean;
18
+ interleaved: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
19
+ field: z.ZodEnum<{
20
+ reasoning_content: "reasoning_content";
21
+ reasoning_details: "reasoning_details";
22
+ }>;
23
+ }, z.core.$strict>]>>;
24
+ cost: z.ZodOptional<z.ZodObject<{
25
+ input: z.ZodNumber;
26
+ output: z.ZodNumber;
27
+ cache_read: z.ZodOptional<z.ZodNumber>;
28
+ cache_write: z.ZodOptional<z.ZodNumber>;
29
+ context_over_200k: z.ZodOptional<z.ZodObject<{
30
+ input: z.ZodNumber;
31
+ output: z.ZodNumber;
32
+ cache_read: z.ZodOptional<z.ZodNumber>;
33
+ cache_write: z.ZodOptional<z.ZodNumber>;
34
+ }, z.core.$strip>>;
35
+ }, z.core.$strip>>;
36
+ limit: z.ZodObject<{
37
+ context: z.ZodNumber;
38
+ input: z.ZodOptional<z.ZodNumber>;
39
+ output: z.ZodNumber;
40
+ }, z.core.$strip>;
41
+ modalities: z.ZodOptional<z.ZodObject<{
42
+ input: z.ZodArray<z.ZodEnum<{
43
+ text: "text";
44
+ audio: "audio";
45
+ image: "image";
46
+ video: "video";
47
+ pdf: "pdf";
48
+ }>>;
49
+ output: z.ZodArray<z.ZodEnum<{
50
+ text: "text";
51
+ audio: "audio";
52
+ image: "image";
53
+ video: "video";
54
+ pdf: "pdf";
55
+ }>>;
56
+ }, z.core.$strip>>;
57
+ experimental: z.ZodOptional<z.ZodBoolean>;
58
+ status: z.ZodOptional<z.ZodEnum<{
59
+ alpha: "alpha";
60
+ beta: "beta";
61
+ deprecated: "deprecated";
62
+ }>>;
63
+ options: z.ZodRecord<z.ZodString, z.ZodAny>;
64
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
65
+ provider: z.ZodOptional<z.ZodObject<{
66
+ npm: z.ZodString;
67
+ }, z.core.$strip>>;
68
+ variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>>>;
69
+ }, z.core.$strip>;
70
+ type Model = z.infer<typeof Model>;
71
+ const Provider: z.ZodObject<{
72
+ api: z.ZodOptional<z.ZodString>;
73
+ name: z.ZodString;
74
+ env: z.ZodArray<z.ZodString>;
75
+ id: z.ZodString;
76
+ npm: z.ZodOptional<z.ZodString>;
77
+ models: z.ZodRecord<z.ZodString, z.ZodObject<{
78
+ id: z.ZodString;
79
+ name: z.ZodString;
80
+ family: z.ZodOptional<z.ZodString>;
81
+ release_date: z.ZodString;
82
+ attachment: z.ZodBoolean;
83
+ reasoning: z.ZodBoolean;
84
+ temperature: z.ZodBoolean;
85
+ tool_call: z.ZodBoolean;
86
+ interleaved: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
87
+ field: z.ZodEnum<{
88
+ reasoning_content: "reasoning_content";
89
+ reasoning_details: "reasoning_details";
90
+ }>;
91
+ }, z.core.$strict>]>>;
92
+ cost: z.ZodOptional<z.ZodObject<{
93
+ input: z.ZodNumber;
94
+ output: z.ZodNumber;
95
+ cache_read: z.ZodOptional<z.ZodNumber>;
96
+ cache_write: z.ZodOptional<z.ZodNumber>;
97
+ context_over_200k: z.ZodOptional<z.ZodObject<{
98
+ input: z.ZodNumber;
99
+ output: z.ZodNumber;
100
+ cache_read: z.ZodOptional<z.ZodNumber>;
101
+ cache_write: z.ZodOptional<z.ZodNumber>;
102
+ }, z.core.$strip>>;
103
+ }, z.core.$strip>>;
104
+ limit: z.ZodObject<{
105
+ context: z.ZodNumber;
106
+ input: z.ZodOptional<z.ZodNumber>;
107
+ output: z.ZodNumber;
108
+ }, z.core.$strip>;
109
+ modalities: z.ZodOptional<z.ZodObject<{
110
+ input: z.ZodArray<z.ZodEnum<{
111
+ text: "text";
112
+ audio: "audio";
113
+ image: "image";
114
+ video: "video";
115
+ pdf: "pdf";
116
+ }>>;
117
+ output: z.ZodArray<z.ZodEnum<{
118
+ text: "text";
119
+ audio: "audio";
120
+ image: "image";
121
+ video: "video";
122
+ pdf: "pdf";
123
+ }>>;
124
+ }, z.core.$strip>>;
125
+ experimental: z.ZodOptional<z.ZodBoolean>;
126
+ status: z.ZodOptional<z.ZodEnum<{
127
+ alpha: "alpha";
128
+ beta: "beta";
129
+ deprecated: "deprecated";
130
+ }>>;
131
+ options: z.ZodRecord<z.ZodString, z.ZodAny>;
132
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
133
+ provider: z.ZodOptional<z.ZodObject<{
134
+ npm: z.ZodString;
135
+ }, z.core.$strip>>;
136
+ variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>>>;
137
+ }, z.core.$strip>>;
138
+ }, z.core.$strip>;
139
+ type Provider = z.infer<typeof Provider>;
140
+ const Data: {
141
+ (): Promise<Record<string, {
142
+ name: string;
143
+ env: string[];
144
+ id: string;
145
+ models: Record<string, {
146
+ id: string;
147
+ name: string;
148
+ release_date: string;
149
+ attachment: boolean;
150
+ reasoning: boolean;
151
+ temperature: boolean;
152
+ tool_call: boolean;
153
+ limit: {
154
+ context: number;
155
+ output: number;
156
+ input?: number | undefined;
157
+ };
158
+ options: Record<string, any>;
159
+ family?: string | undefined;
160
+ interleaved?: true | {
161
+ field: "reasoning_content" | "reasoning_details";
162
+ } | undefined;
163
+ cost?: {
164
+ input: number;
165
+ output: number;
166
+ cache_read?: number | undefined;
167
+ cache_write?: number | undefined;
168
+ context_over_200k?: {
169
+ input: number;
170
+ output: number;
171
+ cache_read?: number | undefined;
172
+ cache_write?: number | undefined;
173
+ } | undefined;
174
+ } | undefined;
175
+ modalities?: {
176
+ input: ("text" | "audio" | "image" | "video" | "pdf")[];
177
+ output: ("text" | "audio" | "image" | "video" | "pdf")[];
178
+ } | undefined;
179
+ experimental?: boolean | undefined;
180
+ status?: "alpha" | "beta" | "deprecated" | undefined;
181
+ headers?: Record<string, string> | undefined;
182
+ provider?: {
183
+ npm: string;
184
+ } | undefined;
185
+ variants?: Record<string, Record<string, any>> | undefined;
186
+ }>;
187
+ api?: string | undefined;
188
+ npm?: string | undefined;
189
+ }>>;
190
+ reset(): void;
191
+ };
192
+ function get(): Promise<Record<string, {
193
+ name: string;
194
+ env: string[];
195
+ id: string;
196
+ models: Record<string, {
197
+ id: string;
198
+ name: string;
199
+ release_date: string;
200
+ attachment: boolean;
201
+ reasoning: boolean;
202
+ temperature: boolean;
203
+ tool_call: boolean;
204
+ limit: {
205
+ context: number;
206
+ output: number;
207
+ input?: number | undefined;
208
+ };
209
+ options: Record<string, any>;
210
+ family?: string | undefined;
211
+ interleaved?: true | {
212
+ field: "reasoning_content" | "reasoning_details";
213
+ } | undefined;
214
+ cost?: {
215
+ input: number;
216
+ output: number;
217
+ cache_read?: number | undefined;
218
+ cache_write?: number | undefined;
219
+ context_over_200k?: {
220
+ input: number;
221
+ output: number;
222
+ cache_read?: number | undefined;
223
+ cache_write?: number | undefined;
224
+ } | undefined;
225
+ } | undefined;
226
+ modalities?: {
227
+ input: ("text" | "audio" | "image" | "video" | "pdf")[];
228
+ output: ("text" | "audio" | "image" | "video" | "pdf")[];
229
+ } | undefined;
230
+ experimental?: boolean | undefined;
231
+ status?: "alpha" | "beta" | "deprecated" | undefined;
232
+ headers?: Record<string, string> | undefined;
233
+ provider?: {
234
+ npm: string;
235
+ } | undefined;
236
+ variants?: Record<string, Record<string, any>> | undefined;
237
+ }>;
238
+ api?: string | undefined;
239
+ npm?: string | undefined;
240
+ }>>;
241
+ function refresh(): Promise<void>;
242
+ }
243
+ declare function initModelsRefresh(): void;
244
+
245
+ declare namespace Provider {
246
+ function registerPluginAuthLoader(entry: {
247
+ providerId: string;
248
+ authProvider: string;
249
+ loader: (getAuth: () => Promise<any>, authProviderData: any) => Promise<any>;
250
+ }): void;
251
+ function clearPluginAuthLoaders(): void;
252
+ const DEFAULT_CONTEXT_LIMIT = 200000;
253
+ const DEFAULT_INPUT_LIMIT_RATIO = 0.9;
254
+ const DEFAULT_OUTPUT_LIMIT = 8192;
255
+ function getDefaultInputLimit(contextLimit?: number): number;
256
+ const Model: z.ZodObject<{
257
+ id: z.ZodString;
258
+ providerId: z.ZodString;
259
+ api: z.ZodObject<{
260
+ id: z.ZodString;
261
+ url: z.ZodString;
262
+ npm: z.ZodString;
263
+ }, z.core.$strip>;
264
+ name: z.ZodString;
265
+ family: z.ZodOptional<z.ZodString>;
266
+ capabilities: z.ZodObject<{
267
+ temperature: z.ZodBoolean;
268
+ reasoning: z.ZodBoolean;
269
+ attachment: z.ZodBoolean;
270
+ toolcall: z.ZodBoolean;
271
+ input: z.ZodObject<{
272
+ text: z.ZodBoolean;
273
+ audio: z.ZodBoolean;
274
+ image: z.ZodBoolean;
275
+ video: z.ZodBoolean;
276
+ pdf: z.ZodBoolean;
277
+ }, z.core.$strip>;
278
+ output: z.ZodObject<{
279
+ text: z.ZodBoolean;
280
+ audio: z.ZodBoolean;
281
+ image: z.ZodBoolean;
282
+ video: z.ZodBoolean;
283
+ pdf: z.ZodBoolean;
284
+ }, z.core.$strip>;
285
+ interleaved: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
286
+ field: z.ZodEnum<{
287
+ reasoning_content: "reasoning_content";
288
+ reasoning_details: "reasoning_details";
289
+ }>;
290
+ }, z.core.$strip>]>;
291
+ }, z.core.$strip>;
292
+ cost: z.ZodObject<{
293
+ input: z.ZodNumber;
294
+ output: z.ZodNumber;
295
+ cache: z.ZodObject<{
296
+ read: z.ZodNumber;
297
+ write: z.ZodNumber;
298
+ }, z.core.$strip>;
299
+ experimentalOver200K: z.ZodOptional<z.ZodObject<{
300
+ input: z.ZodNumber;
301
+ output: z.ZodNumber;
302
+ cache: z.ZodObject<{
303
+ read: z.ZodNumber;
304
+ write: z.ZodNumber;
305
+ }, z.core.$strip>;
306
+ }, z.core.$strip>>;
307
+ }, z.core.$strip>;
308
+ limit: z.ZodObject<{
309
+ context: z.ZodNumber;
310
+ input: z.ZodOptional<z.ZodNumber>;
311
+ output: z.ZodNumber;
312
+ }, z.core.$strip>;
313
+ status: z.ZodEnum<{
314
+ alpha: "alpha";
315
+ beta: "beta";
316
+ deprecated: "deprecated";
317
+ active: "active";
318
+ }>;
319
+ options: z.ZodRecord<z.ZodString, z.ZodAny>;
320
+ headers: z.ZodRecord<z.ZodString, z.ZodString>;
321
+ release_date: z.ZodString;
322
+ variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>>>;
323
+ }, z.core.$strip>;
324
+ type Model = z.infer<typeof Model>;
325
+ const Info: z.ZodObject<{
326
+ id: z.ZodString;
327
+ name: z.ZodString;
328
+ source: z.ZodEnum<{
329
+ api: "api";
330
+ env: "env";
331
+ custom: "custom";
332
+ config: "config";
333
+ }>;
334
+ env: z.ZodArray<z.ZodString>;
335
+ key: z.ZodOptional<z.ZodString>;
336
+ options: z.ZodRecord<z.ZodString, z.ZodAny>;
337
+ models: z.ZodRecord<z.ZodString, z.ZodObject<{
338
+ id: z.ZodString;
339
+ providerId: z.ZodString;
340
+ api: z.ZodObject<{
341
+ id: z.ZodString;
342
+ url: z.ZodString;
343
+ npm: z.ZodString;
344
+ }, z.core.$strip>;
345
+ name: z.ZodString;
346
+ family: z.ZodOptional<z.ZodString>;
347
+ capabilities: z.ZodObject<{
348
+ temperature: z.ZodBoolean;
349
+ reasoning: z.ZodBoolean;
350
+ attachment: z.ZodBoolean;
351
+ toolcall: z.ZodBoolean;
352
+ input: z.ZodObject<{
353
+ text: z.ZodBoolean;
354
+ audio: z.ZodBoolean;
355
+ image: z.ZodBoolean;
356
+ video: z.ZodBoolean;
357
+ pdf: z.ZodBoolean;
358
+ }, z.core.$strip>;
359
+ output: z.ZodObject<{
360
+ text: z.ZodBoolean;
361
+ audio: z.ZodBoolean;
362
+ image: z.ZodBoolean;
363
+ video: z.ZodBoolean;
364
+ pdf: z.ZodBoolean;
365
+ }, z.core.$strip>;
366
+ interleaved: z.ZodUnion<readonly [z.ZodBoolean, z.ZodObject<{
367
+ field: z.ZodEnum<{
368
+ reasoning_content: "reasoning_content";
369
+ reasoning_details: "reasoning_details";
370
+ }>;
371
+ }, z.core.$strip>]>;
372
+ }, z.core.$strip>;
373
+ cost: z.ZodObject<{
374
+ input: z.ZodNumber;
375
+ output: z.ZodNumber;
376
+ cache: z.ZodObject<{
377
+ read: z.ZodNumber;
378
+ write: z.ZodNumber;
379
+ }, z.core.$strip>;
380
+ experimentalOver200K: z.ZodOptional<z.ZodObject<{
381
+ input: z.ZodNumber;
382
+ output: z.ZodNumber;
383
+ cache: z.ZodObject<{
384
+ read: z.ZodNumber;
385
+ write: z.ZodNumber;
386
+ }, z.core.$strip>;
387
+ }, z.core.$strip>>;
388
+ }, z.core.$strip>;
389
+ limit: z.ZodObject<{
390
+ context: z.ZodNumber;
391
+ input: z.ZodOptional<z.ZodNumber>;
392
+ output: z.ZodNumber;
393
+ }, z.core.$strip>;
394
+ status: z.ZodEnum<{
395
+ alpha: "alpha";
396
+ beta: "beta";
397
+ deprecated: "deprecated";
398
+ active: "active";
399
+ }>;
400
+ options: z.ZodRecord<z.ZodString, z.ZodAny>;
401
+ headers: z.ZodRecord<z.ZodString, z.ZodString>;
402
+ release_date: z.ZodString;
403
+ variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>>>;
404
+ }, z.core.$strip>>;
405
+ }, z.core.$strip>;
406
+ type Info = z.infer<typeof Info>;
407
+ function fromModelsDevProvider(provider: ModelsDev.Provider): Info;
408
+ function resetState(): void;
409
+ function list(): Promise<{
410
+ [providerId: string]: {
411
+ id: string;
412
+ name: string;
413
+ source: "api" | "env" | "custom" | "config";
414
+ env: string[];
415
+ options: Record<string, any>;
416
+ models: Record<string, {
417
+ id: string;
418
+ providerId: string;
419
+ api: {
420
+ id: string;
421
+ url: string;
422
+ npm: string;
423
+ };
424
+ name: string;
425
+ capabilities: {
426
+ temperature: boolean;
427
+ reasoning: boolean;
428
+ attachment: boolean;
429
+ toolcall: boolean;
430
+ input: {
431
+ text: boolean;
432
+ audio: boolean;
433
+ image: boolean;
434
+ video: boolean;
435
+ pdf: boolean;
436
+ };
437
+ output: {
438
+ text: boolean;
439
+ audio: boolean;
440
+ image: boolean;
441
+ video: boolean;
442
+ pdf: boolean;
443
+ };
444
+ interleaved: boolean | {
445
+ field: "reasoning_content" | "reasoning_details";
446
+ };
447
+ };
448
+ cost: {
449
+ input: number;
450
+ output: number;
451
+ cache: {
452
+ read: number;
453
+ write: number;
454
+ };
455
+ experimentalOver200K?: {
456
+ input: number;
457
+ output: number;
458
+ cache: {
459
+ read: number;
460
+ write: number;
461
+ };
462
+ } | undefined;
463
+ };
464
+ limit: {
465
+ context: number;
466
+ output: number;
467
+ input?: number | undefined;
468
+ };
469
+ status: "alpha" | "beta" | "deprecated" | "active";
470
+ options: Record<string, any>;
471
+ headers: Record<string, string>;
472
+ release_date: string;
473
+ family?: string | undefined;
474
+ variants?: Record<string, Record<string, any>> | undefined;
475
+ }>;
476
+ key?: string | undefined;
477
+ };
478
+ }>;
479
+ function getLocalProxy(): Promise<Map<string, string | _ai_sdk_provider.LanguageModelV3 | (string & {}) | _ai_sdk_provider.LanguageModelV2 | _ai_sdk_provider.EmbeddingModelV3 | _ai_sdk_provider.EmbeddingModelV2<string> | _ai_sdk_provider.RerankingModelV3>>;
480
+ function getProvider(providerId: string): Promise<{
481
+ id: string;
482
+ name: string;
483
+ source: "api" | "env" | "custom" | "config";
484
+ env: string[];
485
+ options: Record<string, any>;
486
+ models: Record<string, {
487
+ id: string;
488
+ providerId: string;
489
+ api: {
490
+ id: string;
491
+ url: string;
492
+ npm: string;
493
+ };
494
+ name: string;
495
+ capabilities: {
496
+ temperature: boolean;
497
+ reasoning: boolean;
498
+ attachment: boolean;
499
+ toolcall: boolean;
500
+ input: {
501
+ text: boolean;
502
+ audio: boolean;
503
+ image: boolean;
504
+ video: boolean;
505
+ pdf: boolean;
506
+ };
507
+ output: {
508
+ text: boolean;
509
+ audio: boolean;
510
+ image: boolean;
511
+ video: boolean;
512
+ pdf: boolean;
513
+ };
514
+ interleaved: boolean | {
515
+ field: "reasoning_content" | "reasoning_details";
516
+ };
517
+ };
518
+ cost: {
519
+ input: number;
520
+ output: number;
521
+ cache: {
522
+ read: number;
523
+ write: number;
524
+ };
525
+ experimentalOver200K?: {
526
+ input: number;
527
+ output: number;
528
+ cache: {
529
+ read: number;
530
+ write: number;
531
+ };
532
+ } | undefined;
533
+ };
534
+ limit: {
535
+ context: number;
536
+ output: number;
537
+ input?: number | undefined;
538
+ };
539
+ status: "alpha" | "beta" | "deprecated" | "active";
540
+ options: Record<string, any>;
541
+ headers: Record<string, string>;
542
+ release_date: string;
543
+ family?: string | undefined;
544
+ variants?: Record<string, Record<string, any>> | undefined;
545
+ }>;
546
+ key?: string | undefined;
547
+ } | undefined>;
548
+ function getModel(providerId: string, modelId: string): Promise<{
549
+ id: string;
550
+ providerId: string;
551
+ api: {
552
+ id: string;
553
+ url: string;
554
+ npm: string;
555
+ };
556
+ name: string;
557
+ capabilities: {
558
+ temperature: boolean;
559
+ reasoning: boolean;
560
+ attachment: boolean;
561
+ toolcall: boolean;
562
+ input: {
563
+ text: boolean;
564
+ audio: boolean;
565
+ image: boolean;
566
+ video: boolean;
567
+ pdf: boolean;
568
+ };
569
+ output: {
570
+ text: boolean;
571
+ audio: boolean;
572
+ image: boolean;
573
+ video: boolean;
574
+ pdf: boolean;
575
+ };
576
+ interleaved: boolean | {
577
+ field: "reasoning_content" | "reasoning_details";
578
+ };
579
+ };
580
+ cost: {
581
+ input: number;
582
+ output: number;
583
+ cache: {
584
+ read: number;
585
+ write: number;
586
+ };
587
+ experimentalOver200K?: {
588
+ input: number;
589
+ output: number;
590
+ cache: {
591
+ read: number;
592
+ write: number;
593
+ };
594
+ } | undefined;
595
+ };
596
+ limit: {
597
+ context: number;
598
+ output: number;
599
+ input?: number | undefined;
600
+ };
601
+ status: "alpha" | "beta" | "deprecated" | "active";
602
+ options: Record<string, any>;
603
+ headers: Record<string, string>;
604
+ release_date: string;
605
+ family?: string | undefined;
606
+ variants?: Record<string, Record<string, any>> | undefined;
607
+ }>;
608
+ function getLanguage(model: Model): Promise<LanguageModel>;
609
+ function getEmbedding(providerId: string, modelId: string): Promise<EmbeddingModel>;
610
+ function getRerank(providerId: string, modelId: string): Promise<RerankingModel>;
611
+ function closest(providerId: string, query: string[]): Promise<{
612
+ providerId: string;
613
+ modelId: string;
614
+ } | undefined>;
615
+ function getSmallModel(providerId: string): Promise<{
616
+ id: string;
617
+ providerId: string;
618
+ api: {
619
+ id: string;
620
+ url: string;
621
+ npm: string;
622
+ };
623
+ name: string;
624
+ capabilities: {
625
+ temperature: boolean;
626
+ reasoning: boolean;
627
+ attachment: boolean;
628
+ toolcall: boolean;
629
+ input: {
630
+ text: boolean;
631
+ audio: boolean;
632
+ image: boolean;
633
+ video: boolean;
634
+ pdf: boolean;
635
+ };
636
+ output: {
637
+ text: boolean;
638
+ audio: boolean;
639
+ image: boolean;
640
+ video: boolean;
641
+ pdf: boolean;
642
+ };
643
+ interleaved: boolean | {
644
+ field: "reasoning_content" | "reasoning_details";
645
+ };
646
+ };
647
+ cost: {
648
+ input: number;
649
+ output: number;
650
+ cache: {
651
+ read: number;
652
+ write: number;
653
+ };
654
+ experimentalOver200K?: {
655
+ input: number;
656
+ output: number;
657
+ cache: {
658
+ read: number;
659
+ write: number;
660
+ };
661
+ } | undefined;
662
+ };
663
+ limit: {
664
+ context: number;
665
+ output: number;
666
+ input?: number | undefined;
667
+ };
668
+ status: "alpha" | "beta" | "deprecated" | "active";
669
+ options: Record<string, any>;
670
+ headers: Record<string, string>;
671
+ release_date: string;
672
+ family?: string | undefined;
673
+ variants?: Record<string, Record<string, any>> | undefined;
674
+ } | undefined>;
675
+ function sort(models: Model[]): {
676
+ id: string;
677
+ providerId: string;
678
+ api: {
679
+ id: string;
680
+ url: string;
681
+ npm: string;
682
+ };
683
+ name: string;
684
+ capabilities: {
685
+ temperature: boolean;
686
+ reasoning: boolean;
687
+ attachment: boolean;
688
+ toolcall: boolean;
689
+ input: {
690
+ text: boolean;
691
+ audio: boolean;
692
+ image: boolean;
693
+ video: boolean;
694
+ pdf: boolean;
695
+ };
696
+ output: {
697
+ text: boolean;
698
+ audio: boolean;
699
+ image: boolean;
700
+ video: boolean;
701
+ pdf: boolean;
702
+ };
703
+ interleaved: boolean | {
704
+ field: "reasoning_content" | "reasoning_details";
705
+ };
706
+ };
707
+ cost: {
708
+ input: number;
709
+ output: number;
710
+ cache: {
711
+ read: number;
712
+ write: number;
713
+ };
714
+ experimentalOver200K?: {
715
+ input: number;
716
+ output: number;
717
+ cache: {
718
+ read: number;
719
+ write: number;
720
+ };
721
+ } | undefined;
722
+ };
723
+ limit: {
724
+ context: number;
725
+ output: number;
726
+ input?: number | undefined;
727
+ };
728
+ status: "alpha" | "beta" | "deprecated" | "active";
729
+ options: Record<string, any>;
730
+ headers: Record<string, string>;
731
+ release_date: string;
732
+ family?: string | undefined;
733
+ variants?: Record<string, Record<string, any>> | undefined;
734
+ }[];
735
+ function defaultModel(): Promise<{
736
+ providerId: string;
737
+ modelId: string;
738
+ }>;
739
+ function parseModel(model: string): {
740
+ providerId: string;
741
+ modelId: string;
742
+ };
743
+ const ModelNotFoundError: {
744
+ new (data: {
745
+ providerId: string;
746
+ modelId: string;
747
+ suggestions?: string[] | undefined;
748
+ }, options?: ErrorOptions): {
749
+ readonly name: "ProviderModelNotFoundError";
750
+ readonly data: {
751
+ providerId: string;
752
+ modelId: string;
753
+ suggestions?: string[] | undefined;
754
+ };
755
+ schema(): z.ZodObject<{
756
+ name: z.ZodLiteral<"ProviderModelNotFoundError">;
757
+ data: z.ZodObject<{
758
+ providerId: z.ZodString;
759
+ modelId: z.ZodString;
760
+ suggestions: z.ZodOptional<z.ZodArray<z.ZodString>>;
761
+ }, z.core.$strip>;
762
+ }, z.core.$strip>;
763
+ toObject(): {
764
+ name: "ProviderModelNotFoundError";
765
+ data: {
766
+ providerId: string;
767
+ modelId: string;
768
+ suggestions?: string[] | undefined;
769
+ };
770
+ };
771
+ message: string;
772
+ stack?: string;
773
+ cause?: unknown;
774
+ };
775
+ readonly Schema: z.ZodObject<{
776
+ name: z.ZodLiteral<"ProviderModelNotFoundError">;
777
+ data: z.ZodObject<{
778
+ providerId: z.ZodString;
779
+ modelId: z.ZodString;
780
+ suggestions: z.ZodOptional<z.ZodArray<z.ZodString>>;
781
+ }, z.core.$strip>;
782
+ }, z.core.$strip>;
783
+ isInstance(input: any): input is InstanceType<any>;
784
+ create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
785
+ readonly Unknown: {
786
+ new (data: {
787
+ message: string;
788
+ }, options?: ErrorOptions): {
789
+ readonly name: "UnknownError";
790
+ readonly data: {
791
+ message: string;
792
+ };
793
+ schema(): z.ZodObject<{
794
+ name: z.ZodLiteral<"UnknownError">;
795
+ data: z.ZodObject<{
796
+ message: z.ZodString;
797
+ }, z.core.$strip>;
798
+ }, z.core.$strip>;
799
+ toObject(): {
800
+ name: "UnknownError";
801
+ data: {
802
+ message: string;
803
+ };
804
+ };
805
+ message: string;
806
+ stack?: string;
807
+ cause?: unknown;
808
+ };
809
+ readonly Schema: z.ZodObject<{
810
+ name: z.ZodLiteral<"UnknownError">;
811
+ data: z.ZodObject<{
812
+ message: z.ZodString;
813
+ }, z.core.$strip>;
814
+ }, z.core.$strip>;
815
+ isInstance(input: any): input is {
816
+ readonly name: "UnknownError";
817
+ readonly data: {
818
+ message: string;
819
+ };
820
+ schema(): z.ZodObject<{
821
+ name: z.ZodLiteral<"UnknownError">;
822
+ data: z.ZodObject<{
823
+ message: z.ZodString;
824
+ }, z.core.$strip>;
825
+ }, z.core.$strip>;
826
+ toObject(): {
827
+ name: "UnknownError";
828
+ data: {
829
+ message: string;
830
+ };
831
+ };
832
+ message: string;
833
+ stack?: string;
834
+ cause?: unknown;
835
+ };
836
+ create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
837
+ readonly Unknown: any;
838
+ isError(error: unknown): error is Error;
839
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
840
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
841
+ stackTraceLimit: number;
842
+ };
843
+ isError(error: unknown): error is Error;
844
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
845
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
846
+ stackTraceLimit: number;
847
+ };
848
+ const InitError: {
849
+ new (data: {
850
+ providerId: string;
851
+ }, options?: ErrorOptions): {
852
+ readonly name: "ProviderInitError";
853
+ readonly data: {
854
+ providerId: string;
855
+ };
856
+ schema(): z.ZodObject<{
857
+ name: z.ZodLiteral<"ProviderInitError">;
858
+ data: z.ZodObject<{
859
+ providerId: z.ZodString;
860
+ }, z.core.$strip>;
861
+ }, z.core.$strip>;
862
+ toObject(): {
863
+ name: "ProviderInitError";
864
+ data: {
865
+ providerId: string;
866
+ };
867
+ };
868
+ message: string;
869
+ stack?: string;
870
+ cause?: unknown;
871
+ };
872
+ readonly Schema: z.ZodObject<{
873
+ name: z.ZodLiteral<"ProviderInitError">;
874
+ data: z.ZodObject<{
875
+ providerId: z.ZodString;
876
+ }, z.core.$strip>;
877
+ }, z.core.$strip>;
878
+ isInstance(input: any): input is InstanceType<any>;
879
+ create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
880
+ readonly Unknown: {
881
+ new (data: {
882
+ message: string;
883
+ }, options?: ErrorOptions): {
884
+ readonly name: "UnknownError";
885
+ readonly data: {
886
+ message: string;
887
+ };
888
+ schema(): z.ZodObject<{
889
+ name: z.ZodLiteral<"UnknownError">;
890
+ data: z.ZodObject<{
891
+ message: z.ZodString;
892
+ }, z.core.$strip>;
893
+ }, z.core.$strip>;
894
+ toObject(): {
895
+ name: "UnknownError";
896
+ data: {
897
+ message: string;
898
+ };
899
+ };
900
+ message: string;
901
+ stack?: string;
902
+ cause?: unknown;
903
+ };
904
+ readonly Schema: z.ZodObject<{
905
+ name: z.ZodLiteral<"UnknownError">;
906
+ data: z.ZodObject<{
907
+ message: z.ZodString;
908
+ }, z.core.$strip>;
909
+ }, z.core.$strip>;
910
+ isInstance(input: any): input is {
911
+ readonly name: "UnknownError";
912
+ readonly data: {
913
+ message: string;
914
+ };
915
+ schema(): z.ZodObject<{
916
+ name: z.ZodLiteral<"UnknownError">;
917
+ data: z.ZodObject<{
918
+ message: z.ZodString;
919
+ }, z.core.$strip>;
920
+ }, z.core.$strip>;
921
+ toObject(): {
922
+ name: "UnknownError";
923
+ data: {
924
+ message: string;
925
+ };
926
+ };
927
+ message: string;
928
+ stack?: string;
929
+ cause?: unknown;
930
+ };
931
+ create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
932
+ readonly Unknown: any;
933
+ isError(error: unknown): error is Error;
934
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
935
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
936
+ stackTraceLimit: number;
937
+ };
938
+ isError(error: unknown): error is Error;
939
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
940
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
941
+ stackTraceLimit: number;
942
+ };
943
+ }
944
+
945
+ declare namespace ProviderError {
946
+ type ParsedStreamError = {
947
+ type: 'context_overflow';
948
+ message: string;
949
+ responseBody: string;
950
+ } | {
951
+ type: 'api_error';
952
+ message: string;
953
+ isRetryable: boolean;
954
+ responseBody: string;
955
+ };
956
+ function parseStreamError(input: unknown): ParsedStreamError | undefined;
957
+ type ParsedAPICallError = {
958
+ type: 'context_overflow';
959
+ message: string;
960
+ responseBody?: string;
961
+ } | {
962
+ type: 'api_error';
963
+ message: string;
964
+ statusCode?: number;
965
+ isRetryable: boolean;
966
+ responseHeaders?: Record<string, string>;
967
+ responseBody?: string;
968
+ metadata?: Record<string, string>;
969
+ };
970
+ function parseAPICallError(input: {
971
+ providerId: string;
972
+ error: APICallError;
973
+ }): ParsedAPICallError;
974
+ }
975
+
976
+ declare namespace ProviderAuth {
977
+ function registerPluginAuthProvider(entry: {
978
+ providerId: string;
979
+ methods: Array<{
980
+ type: 'oauth' | 'api';
981
+ label: string;
982
+ [key: string]: any;
983
+ }>;
984
+ }): void;
985
+ function clearPluginAuthProviders(): void;
986
+ function resetState(): void;
987
+ const Method: z.ZodObject<{
988
+ type: z.ZodUnion<readonly [z.ZodLiteral<"oauth">, z.ZodLiteral<"api">]>;
989
+ label: z.ZodString;
990
+ }, z.core.$strip>;
991
+ type Method = z.infer<typeof Method>;
992
+ function methods(): Promise<{
993
+ [x: string]: any;
994
+ }>;
995
+ const Authorization: z.ZodObject<{
996
+ url: z.ZodString;
997
+ method: z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"code">]>;
998
+ instructions: z.ZodString;
999
+ }, z.core.$strip>;
1000
+ type Authorization = z.infer<typeof Authorization>;
1001
+ const authorize: {
1002
+ (input: {
1003
+ providerId: string;
1004
+ method: number;
1005
+ }): Promise<{
1006
+ url: string;
1007
+ method: "auto" | "code";
1008
+ instructions: string;
1009
+ } | undefined>;
1010
+ force(input: {
1011
+ providerId: string;
1012
+ method: number;
1013
+ }): Promise<{
1014
+ url: string;
1015
+ method: "auto" | "code";
1016
+ instructions: string;
1017
+ } | undefined>;
1018
+ schema: z.ZodObject<{
1019
+ providerId: z.ZodString;
1020
+ method: z.ZodNumber;
1021
+ }, z.core.$strip>;
1022
+ };
1023
+ const callback: {
1024
+ (input: {
1025
+ providerId: string;
1026
+ method: number;
1027
+ code?: string | undefined;
1028
+ }): Promise<void>;
1029
+ force(input: {
1030
+ providerId: string;
1031
+ method: number;
1032
+ code?: string | undefined;
1033
+ }): Promise<void>;
1034
+ schema: z.ZodObject<{
1035
+ providerId: z.ZodString;
1036
+ method: z.ZodNumber;
1037
+ code: z.ZodOptional<z.ZodString>;
1038
+ }, z.core.$strip>;
1039
+ };
1040
+ const api: {
1041
+ (input: {
1042
+ providerId: string;
1043
+ key: string;
1044
+ }): Promise<void>;
1045
+ force(input: {
1046
+ providerId: string;
1047
+ key: string;
1048
+ }): Promise<void>;
1049
+ schema: z.ZodObject<{
1050
+ providerId: z.ZodString;
1051
+ key: z.ZodString;
1052
+ }, z.core.$strip>;
1053
+ };
1054
+ const OauthMissing: {
1055
+ new (data: {
1056
+ providerId: string;
1057
+ }, options?: ErrorOptions): {
1058
+ readonly name: "ProviderAuthOauthMissing";
1059
+ readonly data: {
1060
+ providerId: string;
1061
+ };
1062
+ schema(): z.ZodObject<{
1063
+ name: z.ZodLiteral<"ProviderAuthOauthMissing">;
1064
+ data: z.ZodObject<{
1065
+ providerId: z.ZodString;
1066
+ }, z.core.$strip>;
1067
+ }, z.core.$strip>;
1068
+ toObject(): {
1069
+ name: "ProviderAuthOauthMissing";
1070
+ data: {
1071
+ providerId: string;
1072
+ };
1073
+ };
1074
+ message: string;
1075
+ stack?: string;
1076
+ cause?: unknown;
1077
+ };
1078
+ readonly Schema: z.ZodObject<{
1079
+ name: z.ZodLiteral<"ProviderAuthOauthMissing">;
1080
+ data: z.ZodObject<{
1081
+ providerId: z.ZodString;
1082
+ }, z.core.$strip>;
1083
+ }, z.core.$strip>;
1084
+ isInstance(input: any): input is InstanceType<any>;
1085
+ create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
1086
+ readonly Unknown: {
1087
+ new (data: {
1088
+ message: string;
1089
+ }, options?: ErrorOptions): {
1090
+ readonly name: "UnknownError";
1091
+ readonly data: {
1092
+ message: string;
1093
+ };
1094
+ schema(): z.ZodObject<{
1095
+ name: z.ZodLiteral<"UnknownError">;
1096
+ data: z.ZodObject<{
1097
+ message: z.ZodString;
1098
+ }, z.core.$strip>;
1099
+ }, z.core.$strip>;
1100
+ toObject(): {
1101
+ name: "UnknownError";
1102
+ data: {
1103
+ message: string;
1104
+ };
1105
+ };
1106
+ message: string;
1107
+ stack?: string;
1108
+ cause?: unknown;
1109
+ };
1110
+ readonly Schema: z.ZodObject<{
1111
+ name: z.ZodLiteral<"UnknownError">;
1112
+ data: z.ZodObject<{
1113
+ message: z.ZodString;
1114
+ }, z.core.$strip>;
1115
+ }, z.core.$strip>;
1116
+ isInstance(input: any): input is {
1117
+ readonly name: "UnknownError";
1118
+ readonly data: {
1119
+ message: string;
1120
+ };
1121
+ schema(): z.ZodObject<{
1122
+ name: z.ZodLiteral<"UnknownError">;
1123
+ data: z.ZodObject<{
1124
+ message: z.ZodString;
1125
+ }, z.core.$strip>;
1126
+ }, z.core.$strip>;
1127
+ toObject(): {
1128
+ name: "UnknownError";
1129
+ data: {
1130
+ message: string;
1131
+ };
1132
+ };
1133
+ message: string;
1134
+ stack?: string;
1135
+ cause?: unknown;
1136
+ };
1137
+ create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
1138
+ readonly Unknown: any;
1139
+ isError(error: unknown): error is Error;
1140
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1141
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1142
+ stackTraceLimit: number;
1143
+ };
1144
+ isError(error: unknown): error is Error;
1145
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1146
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1147
+ stackTraceLimit: number;
1148
+ };
1149
+ const OauthCodeMissing: {
1150
+ new (data: {
1151
+ providerId: string;
1152
+ }, options?: ErrorOptions): {
1153
+ readonly name: "ProviderAuthOauthCodeMissing";
1154
+ readonly data: {
1155
+ providerId: string;
1156
+ };
1157
+ schema(): z.ZodObject<{
1158
+ name: z.ZodLiteral<"ProviderAuthOauthCodeMissing">;
1159
+ data: z.ZodObject<{
1160
+ providerId: z.ZodString;
1161
+ }, z.core.$strip>;
1162
+ }, z.core.$strip>;
1163
+ toObject(): {
1164
+ name: "ProviderAuthOauthCodeMissing";
1165
+ data: {
1166
+ providerId: string;
1167
+ };
1168
+ };
1169
+ message: string;
1170
+ stack?: string;
1171
+ cause?: unknown;
1172
+ };
1173
+ readonly Schema: z.ZodObject<{
1174
+ name: z.ZodLiteral<"ProviderAuthOauthCodeMissing">;
1175
+ data: z.ZodObject<{
1176
+ providerId: z.ZodString;
1177
+ }, z.core.$strip>;
1178
+ }, z.core.$strip>;
1179
+ isInstance(input: any): input is InstanceType<any>;
1180
+ create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
1181
+ readonly Unknown: {
1182
+ new (data: {
1183
+ message: string;
1184
+ }, options?: ErrorOptions): {
1185
+ readonly name: "UnknownError";
1186
+ readonly data: {
1187
+ message: string;
1188
+ };
1189
+ schema(): z.ZodObject<{
1190
+ name: z.ZodLiteral<"UnknownError">;
1191
+ data: z.ZodObject<{
1192
+ message: z.ZodString;
1193
+ }, z.core.$strip>;
1194
+ }, z.core.$strip>;
1195
+ toObject(): {
1196
+ name: "UnknownError";
1197
+ data: {
1198
+ message: string;
1199
+ };
1200
+ };
1201
+ message: string;
1202
+ stack?: string;
1203
+ cause?: unknown;
1204
+ };
1205
+ readonly Schema: z.ZodObject<{
1206
+ name: z.ZodLiteral<"UnknownError">;
1207
+ data: z.ZodObject<{
1208
+ message: z.ZodString;
1209
+ }, z.core.$strip>;
1210
+ }, z.core.$strip>;
1211
+ isInstance(input: any): input is {
1212
+ readonly name: "UnknownError";
1213
+ readonly data: {
1214
+ message: string;
1215
+ };
1216
+ schema(): z.ZodObject<{
1217
+ name: z.ZodLiteral<"UnknownError">;
1218
+ data: z.ZodObject<{
1219
+ message: z.ZodString;
1220
+ }, z.core.$strip>;
1221
+ }, z.core.$strip>;
1222
+ toObject(): {
1223
+ name: "UnknownError";
1224
+ data: {
1225
+ message: string;
1226
+ };
1227
+ };
1228
+ message: string;
1229
+ stack?: string;
1230
+ cause?: unknown;
1231
+ };
1232
+ create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
1233
+ readonly Unknown: any;
1234
+ isError(error: unknown): error is Error;
1235
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1236
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1237
+ stackTraceLimit: number;
1238
+ };
1239
+ isError(error: unknown): error is Error;
1240
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1241
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1242
+ stackTraceLimit: number;
1243
+ };
1244
+ const OauthCallbackFailed: {
1245
+ new (data: Record<string, never>, options?: ErrorOptions): {
1246
+ readonly name: "ProviderAuthOauthCallbackFailed";
1247
+ readonly data: Record<string, never>;
1248
+ schema(): z.ZodObject<{
1249
+ name: z.ZodLiteral<"ProviderAuthOauthCallbackFailed">;
1250
+ data: z.ZodObject<{}, z.core.$strip>;
1251
+ }, z.core.$strip>;
1252
+ toObject(): {
1253
+ name: "ProviderAuthOauthCallbackFailed";
1254
+ data: Record<string, never>;
1255
+ };
1256
+ message: string;
1257
+ stack?: string;
1258
+ cause?: unknown;
1259
+ };
1260
+ readonly Schema: z.ZodObject<{
1261
+ name: z.ZodLiteral<"ProviderAuthOauthCallbackFailed">;
1262
+ data: z.ZodObject<{}, z.core.$strip>;
1263
+ }, z.core.$strip>;
1264
+ isInstance(input: any): input is InstanceType<any>;
1265
+ create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
1266
+ readonly Unknown: {
1267
+ new (data: {
1268
+ message: string;
1269
+ }, options?: ErrorOptions): {
1270
+ readonly name: "UnknownError";
1271
+ readonly data: {
1272
+ message: string;
1273
+ };
1274
+ schema(): z.ZodObject<{
1275
+ name: z.ZodLiteral<"UnknownError">;
1276
+ data: z.ZodObject<{
1277
+ message: z.ZodString;
1278
+ }, z.core.$strip>;
1279
+ }, z.core.$strip>;
1280
+ toObject(): {
1281
+ name: "UnknownError";
1282
+ data: {
1283
+ message: string;
1284
+ };
1285
+ };
1286
+ message: string;
1287
+ stack?: string;
1288
+ cause?: unknown;
1289
+ };
1290
+ readonly Schema: z.ZodObject<{
1291
+ name: z.ZodLiteral<"UnknownError">;
1292
+ data: z.ZodObject<{
1293
+ message: z.ZodString;
1294
+ }, z.core.$strip>;
1295
+ }, z.core.$strip>;
1296
+ isInstance(input: any): input is {
1297
+ readonly name: "UnknownError";
1298
+ readonly data: {
1299
+ message: string;
1300
+ };
1301
+ schema(): z.ZodObject<{
1302
+ name: z.ZodLiteral<"UnknownError">;
1303
+ data: z.ZodObject<{
1304
+ message: z.ZodString;
1305
+ }, z.core.$strip>;
1306
+ }, z.core.$strip>;
1307
+ toObject(): {
1308
+ name: "UnknownError";
1309
+ data: {
1310
+ message: string;
1311
+ };
1312
+ };
1313
+ message: string;
1314
+ stack?: string;
1315
+ cause?: unknown;
1316
+ };
1317
+ create<Name extends string, Data extends z.core.$ZodType>(name: Name, data: Data): any;
1318
+ readonly Unknown: any;
1319
+ isError(error: unknown): error is Error;
1320
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1321
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1322
+ stackTraceLimit: number;
1323
+ };
1324
+ isError(error: unknown): error is Error;
1325
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
1326
+ prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
1327
+ stackTraceLimit: number;
1328
+ };
1329
+ }
1330
+
1331
+ declare namespace ProviderTransform {
1332
+ function getOutputTokenMax(): number;
1333
+ function message(msgs: ModelMessage[], model: Provider.Model, options: Record<string, unknown>): ModelMessage[];
1334
+ function temperature(model: Provider.Model): 1 | 0.6 | 0.55 | undefined;
1335
+ function topP(model: Provider.Model): 1 | 0.95 | undefined;
1336
+ function topK(model: Provider.Model): 20 | 40 | 64 | undefined;
1337
+ function variants(model: Provider.Model): Record<string, Record<string, any>>;
1338
+ function options(input: {
1339
+ model: Provider.Model;
1340
+ sessionId: string;
1341
+ providerOptions?: Record<string, any>;
1342
+ }): Record<string, any>;
1343
+ function smallOptions(model: Provider.Model): {
1344
+ store: boolean;
1345
+ reasoningEffort: string;
1346
+ thinkingConfig?: undefined;
1347
+ reasoning?: undefined;
1348
+ } | {
1349
+ store: boolean;
1350
+ reasoningEffort?: undefined;
1351
+ thinkingConfig?: undefined;
1352
+ reasoning?: undefined;
1353
+ } | {
1354
+ thinkingConfig: {
1355
+ thinkingLevel: string;
1356
+ thinkingBudget?: undefined;
1357
+ };
1358
+ store?: undefined;
1359
+ reasoningEffort?: undefined;
1360
+ reasoning?: undefined;
1361
+ } | {
1362
+ thinkingConfig: {
1363
+ thinkingBudget: number;
1364
+ thinkingLevel?: undefined;
1365
+ };
1366
+ store?: undefined;
1367
+ reasoningEffort?: undefined;
1368
+ reasoning?: undefined;
1369
+ } | {
1370
+ reasoning: {
1371
+ enabled: boolean;
1372
+ };
1373
+ store?: undefined;
1374
+ reasoningEffort?: undefined;
1375
+ thinkingConfig?: undefined;
1376
+ } | {
1377
+ reasoningEffort: string;
1378
+ store?: undefined;
1379
+ thinkingConfig?: undefined;
1380
+ reasoning?: undefined;
1381
+ } | {
1382
+ store?: undefined;
1383
+ reasoningEffort?: undefined;
1384
+ thinkingConfig?: undefined;
1385
+ reasoning?: undefined;
1386
+ };
1387
+ function providerOptions(model: Provider.Model, options: {
1388
+ [x: string]: any;
1389
+ }): Record<string, any>;
1390
+ function maxOutputTokens(model: Provider.Model): number;
1391
+ function schema(model: Provider.Model, schema: JSONSchema.BaseSchema | JSONSchema7): JSONSchema7;
1392
+ }
1393
+
1394
+ declare const DEFAULT_ENABLED_PROVIDERS: readonly string[];
1395
+ declare const CUSTOM_PROVIDER_DEFINITIONS: Record<string, ModelsDev.Provider>;
1396
+ declare const PROVIDER_DISPLAY_NAMES: Record<string, string>;
1397
+
1398
+ type OpenaiCompatibleModelId = string;
1399
+ interface OpenaiCompatibleProviderSettings {
1400
+ apiKey?: string;
1401
+ baseURL?: string;
1402
+ name?: string;
1403
+ headers?: Record<string, string>;
1404
+ fetch?: FetchFunction;
1405
+ }
1406
+ interface OpenaiCompatibleProvider {
1407
+ (modelId: OpenaiCompatibleModelId): LanguageModelV3;
1408
+ chat(modelId: OpenaiCompatibleModelId): LanguageModelV3;
1409
+ responses(modelId: OpenaiCompatibleModelId): LanguageModelV3;
1410
+ languageModel(modelId: OpenaiCompatibleModelId): LanguageModelV3;
1411
+ }
1412
+ declare function createOpenaiCompatible(options?: OpenaiCompatibleProviderSettings): OpenaiCompatibleProvider;
1413
+ declare const openaiCompatible: OpenaiCompatibleProvider;
1414
+
1415
+ declare namespace RerankProvider {
1416
+ type RerankInput = {
1417
+ query: string;
1418
+ documents: string[];
1419
+ model?: Provider.Model | RerankingModel;
1420
+ topN?: number;
1421
+ abortSignal?: AbortSignal;
1422
+ };
1423
+ type RerankResult = {
1424
+ index: number;
1425
+ document: string;
1426
+ score: number;
1427
+ reason?: string;
1428
+ };
1429
+ function rerankDocuments(input: RerankInput, abortSignal?: AbortSignal): Promise<RerankResult[]>;
1430
+ }
1431
+
1432
+ declare function inferEntityType(name: string): string;
1433
+ declare function sanitizeEntityToken(value: string): string;
1434
+
1435
+ interface GraphEntityTypeDef {
1436
+ readonly type: string;
1437
+ readonly rule: string;
1438
+ }
1439
+ interface GraphRelationTypeDef {
1440
+ readonly type: string;
1441
+ readonly rule: string;
1442
+ }
1443
+ interface ExtractedEntity {
1444
+ name: string;
1445
+ type: string;
1446
+ properties?: Record<string, unknown>;
1447
+ }
1448
+ interface ExtractedRelation {
1449
+ source: string;
1450
+ target: string;
1451
+ relation: string;
1452
+ }
1453
+ interface ExtractionResult {
1454
+ summary: string;
1455
+ entities: ExtractedEntity[];
1456
+ relations: ExtractedRelation[];
1457
+ }
1458
+
1459
+ declare function extractEntitiesByRules(content: string): ExtractionResult;
1460
+
1461
+ interface BuildPromptOptions {
1462
+ maxContentLength?: number;
1463
+ maxChunks?: number;
1464
+ includeSummary?: boolean;
1465
+ }
1466
+ declare function buildEntityExtractionPrompt(chunks: string[], entityTypes: ReadonlyArray<GraphEntityTypeDef>, relationTypes: ReadonlyArray<GraphRelationTypeDef>, options?: BuildPromptOptions): string;
1467
+
1468
+ declare function parseEntityExtractionResult(text: string, allowedEntities: ReadonlyArray<GraphEntityTypeDef>, allowedRelations: ReadonlyArray<GraphRelationTypeDef>): ExtractionResult;
1469
+ declare function normalizeExtractionResult(input: unknown, allowedEntities: ReadonlyArray<GraphEntityTypeDef>, allowedRelations: ReadonlyArray<GraphRelationTypeDef>): ExtractionResult;
1470
+
1471
+ declare namespace GraphProvider {
1472
+ interface GraphInput {
1473
+ text?: string;
1474
+ chunks?: ReadonlyArray<string>;
1475
+ model?: Provider.Model | LanguageModel;
1476
+ maxEntities?: number;
1477
+ includeRules?: boolean;
1478
+ abortSignal?: AbortSignal;
1479
+ maxOutputTokens?: number;
1480
+ prompt?: BuildPromptOptions & {
1481
+ maxConcurrency?: number;
1482
+ };
1483
+ promptOverride?: string;
1484
+ }
1485
+ function generateGraph(input: GraphInput, abortSignal?: AbortSignal): Promise<ExtractionResult>;
1486
+ }
1487
+
1488
+ declare namespace SummaryProvider {
1489
+ type NoteSummaryInput = {
1490
+ query: string;
1491
+ chunks: Array<{
1492
+ path: string;
1493
+ content: string;
1494
+ startLine?: number;
1495
+ endLine?: number;
1496
+ score?: number;
1497
+ updatedAt?: number;
1498
+ nodes?: Array<{
1499
+ id: number;
1500
+ name: string;
1501
+ type: string;
1502
+ properties?: Record<string, unknown>;
1503
+ edges?: Array<{
1504
+ direction: 'out' | 'in';
1505
+ relation: string;
1506
+ targetId?: number;
1507
+ targetName: string;
1508
+ targetType: string;
1509
+ }>;
1510
+ }>;
1511
+ }>;
1512
+ model?: Provider.Model | LanguageModel;
1513
+ maxLength?: number;
1514
+ abortSignal?: AbortSignal;
1515
+ };
1516
+ type MemorySummaryInput = {
1517
+ query: string;
1518
+ facts: Array<{
1519
+ content: string;
1520
+ category: string;
1521
+ importance: number;
1522
+ source: string;
1523
+ score?: number;
1524
+ createdAt?: string;
1525
+ nodes?: Array<{
1526
+ id: number;
1527
+ name: string;
1528
+ type: string;
1529
+ edges?: Array<{
1530
+ source: number;
1531
+ target: number;
1532
+ relation: string;
1533
+ direction?: 'in' | 'out';
1534
+ targetNode?: {
1535
+ name: string;
1536
+ type: string;
1537
+ };
1538
+ }>;
1539
+ }>;
1540
+ }>;
1541
+ model?: Provider.Model | LanguageModel;
1542
+ maxLength?: number;
1543
+ abortSignal?: AbortSignal;
1544
+ };
1545
+ function summarizeNote(input: NoteSummaryInput, abortSignal?: AbortSignal): Promise<string>;
1546
+ function summarizeMemoryFacts(input: MemorySummaryInput, abortSignal?: AbortSignal): Promise<string>;
1547
+ }
1548
+
1549
+ declare namespace EmbeddingProvider {
1550
+ type EmbedInput = {
1551
+ value: string;
1552
+ model?: Provider.Model | EmbeddingModel;
1553
+ abortSignal?: AbortSignal;
1554
+ };
1555
+ type EmbedBatchInput = {
1556
+ values: string[];
1557
+ model?: Provider.Model | EmbeddingModel;
1558
+ abortSignal?: AbortSignal;
1559
+ };
1560
+ type EmbedOutput = {
1561
+ embedding: number[];
1562
+ usage: {
1563
+ tokens: number;
1564
+ };
1565
+ };
1566
+ type EmbedBatchOutput = {
1567
+ embeddings: number[][];
1568
+ usage: {
1569
+ tokens: number;
1570
+ };
1571
+ };
1572
+ const DEFAULT_MODEL = "easbot-local/bge-base-zh-v1.5";
1573
+ function embedText(input: EmbedInput, abortSignal?: AbortSignal): Promise<EmbedOutput>;
1574
+ function embedTexts(inputs: EmbedBatchInput, abortSignal?: AbortSignal): Promise<EmbedBatchOutput>;
1575
+ function cosineSimilarity(a: number[], b: number[]): number;
1576
+ function euclideanDistance(a: number[], b: number[]): number;
1577
+ function normalize(vector: number[]): number[];
1578
+ }
1579
+
1580
+ interface IConfigProvider {
1581
+ getInfo(): Promise<{
1582
+ provider?: Record<string, Record<string, unknown>>;
1583
+ disabled_providers?: string[];
1584
+ enabled_providers?: string[];
1585
+ model?: string;
1586
+ small_model?: string;
1587
+ embedding_model?: string;
1588
+ graph_model?: string;
1589
+ rerank_model?: string;
1590
+ }>;
1591
+ getProviderConfig(providerId: string): Promise<Record<string, unknown> | undefined>;
1592
+ getEnabledProviders(): Promise<string[]>;
1593
+ }
1594
+ interface IInstanceProvider {
1595
+ getDirectory(): string;
1596
+ getWorktree(): string;
1597
+ }
1598
+ interface IGlobalPathProvider {
1599
+ home: string;
1600
+ data: string;
1601
+ cache: string;
1602
+ config: string;
1603
+ state: string;
1604
+ log: string;
1605
+ bin: string;
1606
+ }
1607
+ interface IInstallationProvider {
1608
+ getVersion(): string;
1609
+ getChannel(): string;
1610
+ getUserAgent(): string;
1611
+ }
1612
+ interface AdapterRegistry {
1613
+ config?: IConfigProvider;
1614
+ instance?: IInstanceProvider;
1615
+ global?: IGlobalPathProvider;
1616
+ installation?: IInstallationProvider;
1617
+ }
1618
+ declare namespace Flag {
1619
+ const EASBOT_CONFIG: string | undefined;
1620
+ const EASBOT_CONFIG_DIR: string | undefined;
1621
+ const EASBOT_CONFIG_CONTENT: string | undefined;
1622
+ const EASBOT_DISABLE_PROJECT_CONFIG: boolean;
1623
+ const EASBOT_MODELS_FETCH: boolean;
1624
+ const EASBOT_MODELS_URL: string | undefined;
1625
+ const EASBOT_MODELS_PATH: string | undefined;
1626
+ const EASBOT_OUTPUT_TOKEN_MAX: number;
1627
+ const EASBOT_ENABLE_EXPERIMENTAL_MODELS: boolean;
1628
+ const EASBOT_DEFAULT_MODEL: string | undefined;
1629
+ }
1630
+ declare function setAdapterRegistry(registry: AdapterRegistry | undefined): void;
1631
+ declare function getAdapterRegistry(): AdapterRegistry | undefined;
1632
+ declare function hasAdapterRegistry(): boolean;
1633
+ declare function getIConfigProvider(): IConfigProvider;
1634
+ declare function getIInstanceProvider(): IInstanceProvider;
1635
+ declare function getIGlobalPathProvider(): IGlobalPathProvider;
1636
+ declare function getIInstallationProvider(): IInstallationProvider;
1637
+ declare function readFlagBool(key: string): boolean;
1638
+ declare function readFlagNumber(key: string, defaultValue: number): number;
1639
+ declare function readEnvString(key: string): string | undefined;
1640
+
1641
+ declare const ProviderAuthMethod: z.ZodObject<{
1642
+ type: z.ZodUnion<readonly [z.ZodLiteral<"oauth">, z.ZodLiteral<"api">]>;
1643
+ label: z.ZodString;
1644
+ }, z.core.$strip>;
1645
+ type ProviderAuthMethod = z.infer<typeof ProviderAuthMethod>;
1646
+ declare const ProviderConfig: z.ZodObject<{
1647
+ api: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1648
+ name: z.ZodOptional<z.ZodString>;
1649
+ env: z.ZodOptional<z.ZodArray<z.ZodString>>;
1650
+ id: z.ZodOptional<z.ZodString>;
1651
+ npm: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1652
+ whitelist: z.ZodOptional<z.ZodArray<z.ZodString>>;
1653
+ blacklist: z.ZodOptional<z.ZodArray<z.ZodString>>;
1654
+ models: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1655
+ id: z.ZodOptional<z.ZodString>;
1656
+ name: z.ZodOptional<z.ZodString>;
1657
+ family: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1658
+ release_date: z.ZodOptional<z.ZodString>;
1659
+ attachment: z.ZodOptional<z.ZodBoolean>;
1660
+ reasoning: z.ZodOptional<z.ZodBoolean>;
1661
+ temperature: z.ZodOptional<z.ZodBoolean>;
1662
+ tool_call: z.ZodOptional<z.ZodBoolean>;
1663
+ interleaved: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
1664
+ field: z.ZodEnum<{
1665
+ reasoning_content: "reasoning_content";
1666
+ reasoning_details: "reasoning_details";
1667
+ }>;
1668
+ }, z.core.$strict>]>>>;
1669
+ cost: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1670
+ input: z.ZodNumber;
1671
+ output: z.ZodNumber;
1672
+ cache_read: z.ZodOptional<z.ZodNumber>;
1673
+ cache_write: z.ZodOptional<z.ZodNumber>;
1674
+ context_over_200k: z.ZodOptional<z.ZodObject<{
1675
+ input: z.ZodNumber;
1676
+ output: z.ZodNumber;
1677
+ cache_read: z.ZodOptional<z.ZodNumber>;
1678
+ cache_write: z.ZodOptional<z.ZodNumber>;
1679
+ }, z.core.$strip>>;
1680
+ }, z.core.$strip>>>;
1681
+ limit: z.ZodOptional<z.ZodObject<{
1682
+ context: z.ZodNumber;
1683
+ input: z.ZodOptional<z.ZodNumber>;
1684
+ output: z.ZodNumber;
1685
+ }, z.core.$strip>>;
1686
+ modalities: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1687
+ input: z.ZodArray<z.ZodEnum<{
1688
+ text: "text";
1689
+ audio: "audio";
1690
+ image: "image";
1691
+ video: "video";
1692
+ pdf: "pdf";
1693
+ }>>;
1694
+ output: z.ZodArray<z.ZodEnum<{
1695
+ text: "text";
1696
+ audio: "audio";
1697
+ image: "image";
1698
+ video: "video";
1699
+ pdf: "pdf";
1700
+ }>>;
1701
+ }, z.core.$strip>>>;
1702
+ experimental: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1703
+ status: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
1704
+ alpha: "alpha";
1705
+ beta: "beta";
1706
+ deprecated: "deprecated";
1707
+ }>>>;
1708
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1709
+ headers: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
1710
+ provider: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1711
+ npm: z.ZodString;
1712
+ }, z.core.$strip>>>;
1713
+ variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1714
+ disabled: z.ZodOptional<z.ZodBoolean>;
1715
+ }, z.core.$catchall<z.ZodAny>>>>;
1716
+ }, z.core.$strip>>>;
1717
+ options: z.ZodOptional<z.ZodObject<{
1718
+ apiKey: z.ZodOptional<z.ZodString>;
1719
+ baseURL: z.ZodOptional<z.ZodString>;
1720
+ enterpriseUrl: z.ZodOptional<z.ZodString>;
1721
+ setCacheKey: z.ZodOptional<z.ZodBoolean>;
1722
+ timeout: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
1723
+ }, z.core.$catchall<z.ZodAny>>>;
1724
+ }, z.core.$strict>;
1725
+ type ProviderConfig = z.infer<typeof ProviderConfig>;
1726
+ declare const LLMConfig: z.ZodObject<{
1727
+ provider: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1728
+ api: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1729
+ name: z.ZodOptional<z.ZodString>;
1730
+ env: z.ZodOptional<z.ZodArray<z.ZodString>>;
1731
+ id: z.ZodOptional<z.ZodString>;
1732
+ npm: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1733
+ whitelist: z.ZodOptional<z.ZodArray<z.ZodString>>;
1734
+ blacklist: z.ZodOptional<z.ZodArray<z.ZodString>>;
1735
+ models: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1736
+ id: z.ZodOptional<z.ZodString>;
1737
+ name: z.ZodOptional<z.ZodString>;
1738
+ family: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1739
+ release_date: z.ZodOptional<z.ZodString>;
1740
+ attachment: z.ZodOptional<z.ZodBoolean>;
1741
+ reasoning: z.ZodOptional<z.ZodBoolean>;
1742
+ temperature: z.ZodOptional<z.ZodBoolean>;
1743
+ tool_call: z.ZodOptional<z.ZodBoolean>;
1744
+ interleaved: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
1745
+ field: z.ZodEnum<{
1746
+ reasoning_content: "reasoning_content";
1747
+ reasoning_details: "reasoning_details";
1748
+ }>;
1749
+ }, z.core.$strict>]>>>;
1750
+ cost: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1751
+ input: z.ZodNumber;
1752
+ output: z.ZodNumber;
1753
+ cache_read: z.ZodOptional<z.ZodNumber>;
1754
+ cache_write: z.ZodOptional<z.ZodNumber>;
1755
+ context_over_200k: z.ZodOptional<z.ZodObject<{
1756
+ input: z.ZodNumber;
1757
+ output: z.ZodNumber;
1758
+ cache_read: z.ZodOptional<z.ZodNumber>;
1759
+ cache_write: z.ZodOptional<z.ZodNumber>;
1760
+ }, z.core.$strip>>;
1761
+ }, z.core.$strip>>>;
1762
+ limit: z.ZodOptional<z.ZodObject<{
1763
+ context: z.ZodNumber;
1764
+ input: z.ZodOptional<z.ZodNumber>;
1765
+ output: z.ZodNumber;
1766
+ }, z.core.$strip>>;
1767
+ modalities: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1768
+ input: z.ZodArray<z.ZodEnum<{
1769
+ text: "text";
1770
+ audio: "audio";
1771
+ image: "image";
1772
+ video: "video";
1773
+ pdf: "pdf";
1774
+ }>>;
1775
+ output: z.ZodArray<z.ZodEnum<{
1776
+ text: "text";
1777
+ audio: "audio";
1778
+ image: "image";
1779
+ video: "video";
1780
+ pdf: "pdf";
1781
+ }>>;
1782
+ }, z.core.$strip>>>;
1783
+ experimental: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
1784
+ status: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
1785
+ alpha: "alpha";
1786
+ beta: "beta";
1787
+ deprecated: "deprecated";
1788
+ }>>>;
1789
+ options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1790
+ headers: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
1791
+ provider: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1792
+ npm: z.ZodString;
1793
+ }, z.core.$strip>>>;
1794
+ variants: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1795
+ disabled: z.ZodOptional<z.ZodBoolean>;
1796
+ }, z.core.$catchall<z.ZodAny>>>>;
1797
+ }, z.core.$strip>>>;
1798
+ options: z.ZodOptional<z.ZodObject<{
1799
+ apiKey: z.ZodOptional<z.ZodString>;
1800
+ baseURL: z.ZodOptional<z.ZodString>;
1801
+ enterpriseUrl: z.ZodOptional<z.ZodString>;
1802
+ setCacheKey: z.ZodOptional<z.ZodBoolean>;
1803
+ timeout: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<false>]>>;
1804
+ }, z.core.$catchall<z.ZodAny>>>;
1805
+ }, z.core.$strict>>>;
1806
+ disabled_providers: z.ZodOptional<z.ZodArray<z.ZodString>>;
1807
+ enabled_providers: z.ZodOptional<z.ZodArray<z.ZodString>>;
1808
+ model: z.ZodOptional<z.ZodString>;
1809
+ small_model: z.ZodOptional<z.ZodString>;
1810
+ embedding_model: z.ZodOptional<z.ZodString>;
1811
+ graph_model: z.ZodOptional<z.ZodString>;
1812
+ rerank_model: z.ZodOptional<z.ZodString>;
1813
+ }, z.core.$strip>;
1814
+ type LLMConfig = z.infer<typeof LLMConfig>;
1815
+
1816
+ declare namespace Config {
1817
+ function get(): Promise<LLMConfig>;
1818
+ function provider(providerId: string): Promise<ProviderConfig | undefined>;
1819
+ function enabledProviders(): Promise<string[]>;
1820
+ function isLoaded(): boolean;
1821
+ function clearCache(): void;
1822
+ }
1823
+
1824
+ interface ProbeEmbeddingOptions {
1825
+ signal?: AbortSignal;
1826
+ probeText?: string;
1827
+ timeoutMs?: number;
1828
+ }
1829
+ declare class ProbeEmbeddingError extends Error {
1830
+ readonly modelId: string;
1831
+ readonly cause: unknown;
1832
+ constructor(modelId: string, cause: unknown);
1833
+ }
1834
+ declare function probeEmbeddingDims(model: EmbeddingModel, options?: ProbeEmbeddingOptions): Promise<number | undefined>;
1835
+
1836
+ interface SyncMetaCompatibleDB {
1837
+ prepare: (sql: string) => {
1838
+ run: (...params: unknown[]) => unknown;
1839
+ };
1840
+ transaction: <T extends (...args: never[]) => unknown>(fn: T) => T & (() => unknown);
1841
+ }
1842
+ type MetaEntry = readonly [key: string, value: string];
1843
+ declare function syncMeta(db: SyncMetaCompatibleDB, entries: ReadonlyArray<MetaEntry>): void;
1844
+
1845
+ interface ILLMModels {
1846
+ embeddingLlm?: EmbeddingModel;
1847
+ graphLlm?: LanguageModel;
1848
+ rerankLlm?: RerankingModel;
1849
+ }
1850
+ interface ILLMInitConfig {
1851
+ models: ILLMModels;
1852
+ }
1853
+ interface ILLMCapabilities {
1854
+ embedding?: boolean;
1855
+ graphLlm?: boolean;
1856
+ rerankLlm?: boolean;
1857
+ }
1858
+ interface ILLM {
1859
+ init(config: ILLMInitConfig): void;
1860
+ isInitialized(): boolean;
1861
+ capabilities?(): ILLMCapabilities;
1862
+ reset?(): void;
1863
+ getEmbeddingLlm?(): EmbeddingModel | undefined;
1864
+ getGraphLlm?(): LanguageModel | undefined;
1865
+ getRerankLlm?(): RerankingModel | undefined;
1866
+ }
1867
+
1868
+ interface BootstrapModels {
1869
+ embeddingLlm?: EmbeddingModel;
1870
+ graphLlm?: LanguageModel;
1871
+ rerankLlm?: RerankingModel;
1872
+ }
1873
+ interface BootstrapLlmOptions {
1874
+ target: ILLM;
1875
+ cwd: string;
1876
+ subConfigPath?: string;
1877
+ embedding?: boolean;
1878
+ graph?: boolean;
1879
+ rerank?: boolean;
1880
+ }
1881
+ interface BootstrapLlmResult {
1882
+ loaded: {
1883
+ embedding: boolean;
1884
+ graph: boolean;
1885
+ rerank: boolean;
1886
+ };
1887
+ hasFallback: boolean;
1888
+ sources: {
1889
+ embedding?: 'sub' | 'top';
1890
+ graph?: 'sub' | 'top';
1891
+ rerank?: 'sub' | 'top';
1892
+ };
1893
+ }
1894
+ declare function bootstrapLlm(options: BootstrapLlmOptions): Promise<BootstrapLlmResult>;
1895
+ declare function bootstrapLlmStandalone(options: {
1896
+ global: IGlobalPathProvider;
1897
+ instance: {
1898
+ directory: string;
1899
+ worktree: string;
1900
+ };
1901
+ }): void;
1902
+
1903
+ export { type AdapterRegistry, type BootstrapLlmOptions, type BootstrapLlmResult, type BootstrapModels, type BuildPromptOptions, CUSTOM_PROVIDER_DEFINITIONS, Config, DEFAULT_ENABLED_PROVIDERS, EmbeddingProvider, type ExtractedEntity, type ExtractedRelation, type ExtractionResult, Flag, type GraphEntityTypeDef, GraphProvider, type GraphRelationTypeDef, type IConfigProvider, type IGlobalPathProvider, type IInstallationProvider, type IInstanceProvider, type ILLM, type ILLMCapabilities, type ILLMInitConfig, type ILLMModels, LLMConfig, LLMConfig as LLMConfigType, type MetaEntry, ModelsDev, type OpenaiCompatibleProvider, type OpenaiCompatibleProviderSettings, PROVIDER_DISPLAY_NAMES, ProbeEmbeddingError, type ProbeEmbeddingOptions, Provider, ProviderAuth, ProviderAuthMethod, ProviderAuthMethod as ProviderAuthMethodType, ProviderConfig, ProviderConfig as ProviderConfigType, ProviderError, ProviderTransform, RerankProvider, SummaryProvider, bootstrapLlm, bootstrapLlmStandalone, buildEntityExtractionPrompt, createOpenaiCompatible, extractEntitiesByRules, getAdapterRegistry, getIConfigProvider, getIGlobalPathProvider, getIInstallationProvider, getIInstanceProvider, hasAdapterRegistry, inferEntityType, initModelsRefresh, normalizeExtractionResult, openaiCompatible, parseEntityExtractionResult, probeEmbeddingDims, readEnvString, readFlagBool, readFlagNumber, sanitizeEntityToken, setAdapterRegistry, syncMeta };