librechat-data-provider 0.8.402 → 0.8.403

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.
Files changed (103) hide show
  1. package/dist/types/accessPermissions.d.ts +744 -0
  2. package/dist/types/actions.d.ts +118 -0
  3. package/dist/types/api-endpoints.d.ts +149 -0
  4. package/dist/types/artifacts.d.ts +97 -0
  5. package/dist/types/azure.d.ts +22 -0
  6. package/dist/types/bedrock.d.ts +1220 -0
  7. package/dist/types/config.d.ts +13916 -0
  8. package/dist/types/config.spec.d.ts +1 -0
  9. package/dist/types/createPayload.d.ts +5 -0
  10. package/dist/types/data-service.d.ts +284 -0
  11. package/dist/types/feedback.d.ts +36 -0
  12. package/dist/types/file-config.d.ts +263 -0
  13. package/dist/types/file-config.spec.d.ts +1 -0
  14. package/dist/types/generate.d.ts +597 -0
  15. package/dist/types/headers-helpers.d.ts +2 -0
  16. package/{src/index.ts → dist/types/index.d.ts} +0 -15
  17. package/dist/types/keys.d.ts +92 -0
  18. package/dist/types/mcp.d.ts +2760 -0
  19. package/dist/types/messages.d.ts +10 -0
  20. package/dist/types/models.d.ts +1677 -0
  21. package/dist/types/parameterSettings.d.ts +69 -0
  22. package/dist/types/parsers.d.ts +110 -0
  23. package/dist/types/permissions.d.ts +522 -0
  24. package/dist/types/react-query/react-query-service.d.ts +85 -0
  25. package/dist/types/request.d.ts +25 -0
  26. package/dist/types/roles.d.ts +554 -0
  27. package/dist/types/roles.spec.d.ts +1 -0
  28. package/dist/types/schemas.d.ts +4815 -0
  29. package/dist/types/schemas.spec.d.ts +1 -0
  30. package/dist/types/types/agents.d.ts +433 -0
  31. package/dist/types/types/assistants.d.ts +547 -0
  32. package/dist/types/types/files.d.ts +172 -0
  33. package/dist/types/types/graph.d.ts +135 -0
  34. package/{src/types/mcpServers.ts → dist/types/types/mcpServers.d.ts} +12 -18
  35. package/dist/types/types/mutations.d.ts +209 -0
  36. package/dist/types/types/queries.d.ts +169 -0
  37. package/dist/types/types/runs.d.ts +36 -0
  38. package/dist/types/types/web.d.ts +520 -0
  39. package/dist/types/types.d.ts +503 -0
  40. package/dist/types/utils.d.ts +12 -0
  41. package/package.json +4 -1
  42. package/babel.config.js +0 -4
  43. package/check_updates.sh +0 -52
  44. package/jest.config.js +0 -19
  45. package/react-query/package-lock.json +0 -292
  46. package/react-query/package.json +0 -10
  47. package/rollup.config.js +0 -74
  48. package/server-rollup.config.js +0 -40
  49. package/specs/actions.spec.ts +0 -2533
  50. package/specs/api-endpoints-subdir.spec.ts +0 -140
  51. package/specs/api-endpoints.spec.ts +0 -74
  52. package/specs/azure.spec.ts +0 -844
  53. package/specs/bedrock.spec.ts +0 -862
  54. package/specs/filetypes.spec.ts +0 -175
  55. package/specs/generate.spec.ts +0 -770
  56. package/specs/headers-helpers.spec.ts +0 -24
  57. package/specs/mcp.spec.ts +0 -147
  58. package/specs/openapiSpecs.ts +0 -524
  59. package/specs/parsers.spec.ts +0 -601
  60. package/specs/request-interceptor.spec.ts +0 -304
  61. package/specs/utils.spec.ts +0 -196
  62. package/src/accessPermissions.ts +0 -346
  63. package/src/actions.ts +0 -813
  64. package/src/api-endpoints.ts +0 -440
  65. package/src/artifacts.ts +0 -3104
  66. package/src/azure.ts +0 -328
  67. package/src/bedrock.ts +0 -425
  68. package/src/config.spec.ts +0 -315
  69. package/src/config.ts +0 -2006
  70. package/src/createPayload.ts +0 -46
  71. package/src/data-service.ts +0 -1087
  72. package/src/feedback.ts +0 -141
  73. package/src/file-config.spec.ts +0 -1248
  74. package/src/file-config.ts +0 -764
  75. package/src/generate.ts +0 -634
  76. package/src/headers-helpers.ts +0 -13
  77. package/src/keys.ts +0 -99
  78. package/src/mcp.ts +0 -271
  79. package/src/messages.ts +0 -50
  80. package/src/models.ts +0 -69
  81. package/src/parameterSettings.ts +0 -1111
  82. package/src/parsers.ts +0 -563
  83. package/src/permissions.ts +0 -188
  84. package/src/react-query/react-query-service.ts +0 -566
  85. package/src/request.ts +0 -171
  86. package/src/roles.spec.ts +0 -132
  87. package/src/roles.ts +0 -225
  88. package/src/schemas.spec.ts +0 -355
  89. package/src/schemas.ts +0 -1234
  90. package/src/types/agents.ts +0 -470
  91. package/src/types/assistants.ts +0 -654
  92. package/src/types/files.ts +0 -191
  93. package/src/types/graph.ts +0 -145
  94. package/src/types/mutations.ts +0 -422
  95. package/src/types/queries.ts +0 -208
  96. package/src/types/runs.ts +0 -40
  97. package/src/types/web.ts +0 -588
  98. package/src/types.ts +0 -676
  99. package/src/utils.ts +0 -85
  100. package/tsconfig.json +0 -28
  101. package/tsconfig.spec.json +0 -10
  102. /package/{src/react-query/index.ts → dist/types/react-query/index.d.ts} +0 -0
  103. /package/{src/types/index.ts → dist/types/types/index.d.ts} +0 -0
@@ -0,0 +1,520 @@
1
+ import type { Logger as WinstonLogger } from 'winston';
2
+ export type SearchRefType = 'search' | 'image' | 'news' | 'video' | 'ref';
3
+ export declare enum DATE_RANGE {
4
+ PAST_HOUR = "h",
5
+ PAST_24_HOURS = "d",
6
+ PAST_WEEK = "w",
7
+ PAST_MONTH = "m",
8
+ PAST_YEAR = "y"
9
+ }
10
+ export type SearchProvider = 'serper' | 'searxng';
11
+ export type RerankerType = 'infinity' | 'jina' | 'cohere' | 'none';
12
+ export interface Highlight {
13
+ score: number;
14
+ text: string;
15
+ references?: UsedReferences;
16
+ }
17
+ export type ProcessedSource = {
18
+ content?: string;
19
+ attribution?: string;
20
+ references?: References;
21
+ highlights?: Highlight[];
22
+ processed?: boolean;
23
+ };
24
+ export type ProcessedOrganic = OrganicResult & ProcessedSource;
25
+ export type ProcessedTopStory = TopStoryResult & ProcessedSource;
26
+ export type ValidSource = ProcessedOrganic | ProcessedTopStory;
27
+ export type ResultReference = {
28
+ link: string;
29
+ type: 'link' | 'image' | 'video' | 'file';
30
+ title?: string;
31
+ attribution?: string;
32
+ };
33
+ export interface SearchResultData {
34
+ turn?: number;
35
+ organic?: ProcessedOrganic[];
36
+ topStories?: ProcessedTopStory[];
37
+ images?: ImageResult[];
38
+ videos?: VideoResult[];
39
+ places?: PlaceResult[];
40
+ news?: NewsResult[];
41
+ shopping?: ShoppingResult[];
42
+ knowledgeGraph?: KnowledgeGraphResult;
43
+ answerBox?: AnswerBoxResult;
44
+ peopleAlsoAsk?: PeopleAlsoAskResult[];
45
+ relatedSearches?: Array<{
46
+ query: string;
47
+ }>;
48
+ references?: ResultReference[];
49
+ error?: string;
50
+ }
51
+ export interface SearchResult {
52
+ data?: SearchResultData;
53
+ error?: string;
54
+ success: boolean;
55
+ }
56
+ export interface Source {
57
+ link: string;
58
+ html?: string;
59
+ title?: string;
60
+ snippet?: string;
61
+ date?: string;
62
+ }
63
+ export interface SearchConfig {
64
+ searchProvider?: SearchProvider;
65
+ serperApiKey?: string;
66
+ searxngInstanceUrl?: string;
67
+ searxngApiKey?: string;
68
+ }
69
+ export type References = {
70
+ links: MediaReference[];
71
+ images: MediaReference[];
72
+ videos: MediaReference[];
73
+ };
74
+ export interface ScrapeResult {
75
+ url: string;
76
+ error?: boolean;
77
+ content: string;
78
+ attribution?: string;
79
+ references?: References;
80
+ highlights?: Highlight[];
81
+ }
82
+ export interface ProcessSourcesConfig {
83
+ topResults?: number;
84
+ strategies?: string[];
85
+ filterContent?: boolean;
86
+ reranker?: unknown;
87
+ logger?: Logger;
88
+ }
89
+ export interface FirecrawlConfig {
90
+ firecrawlApiKey?: string;
91
+ firecrawlApiUrl?: string;
92
+ firecrawlOptions?: {
93
+ formats?: string[];
94
+ includeTags?: string[];
95
+ excludeTags?: string[];
96
+ headers?: Record<string, string>;
97
+ waitFor?: number;
98
+ timeout?: number;
99
+ maxAge?: number;
100
+ mobile?: boolean;
101
+ skipTlsVerification?: boolean;
102
+ blockAds?: boolean;
103
+ removeBase64Images?: boolean;
104
+ parsePDF?: boolean;
105
+ storeInCache?: boolean;
106
+ zeroDataRetention?: boolean;
107
+ location?: {
108
+ country?: string;
109
+ languages?: string[];
110
+ };
111
+ onlyMainContent?: boolean;
112
+ changeTrackingOptions?: {
113
+ modes?: string[];
114
+ schema?: Record<string, unknown>;
115
+ prompt?: string;
116
+ tag?: string | null;
117
+ };
118
+ };
119
+ }
120
+ export interface ScraperContentResult {
121
+ content: string;
122
+ }
123
+ export interface ScraperExtractionResult {
124
+ no_extraction: ScraperContentResult;
125
+ }
126
+ export interface JinaRerankerResult {
127
+ index: number;
128
+ relevance_score: number;
129
+ document?: string | {
130
+ text: string;
131
+ };
132
+ }
133
+ export interface JinaRerankerResponse {
134
+ model: string;
135
+ usage: {
136
+ total_tokens: number;
137
+ };
138
+ results: JinaRerankerResult[];
139
+ }
140
+ export interface CohereRerankerResult {
141
+ index: number;
142
+ relevance_score: number;
143
+ }
144
+ export interface CohereRerankerResponse {
145
+ results: CohereRerankerResult[];
146
+ id: string;
147
+ meta: {
148
+ api_version: {
149
+ version: string;
150
+ is_experimental: boolean;
151
+ };
152
+ billed_units: {
153
+ search_units: number;
154
+ };
155
+ };
156
+ }
157
+ export type SafeSearchLevel = 0 | 1 | 2;
158
+ export type Logger = WinstonLogger;
159
+ export interface MediaReference {
160
+ originalUrl: string;
161
+ title?: string;
162
+ text?: string;
163
+ }
164
+ export type UsedReferences = {
165
+ type: 'link' | 'image' | 'video';
166
+ originalIndex: number;
167
+ reference: MediaReference;
168
+ }[];
169
+ /** Firecrawl */
170
+ export interface FirecrawlScrapeOptions {
171
+ formats?: string[];
172
+ includeTags?: string[];
173
+ excludeTags?: string[];
174
+ headers?: Record<string, string>;
175
+ waitFor?: number;
176
+ timeout?: number;
177
+ }
178
+ export interface ScrapeMetadata {
179
+ sourceURL?: string;
180
+ url?: string;
181
+ scrapeId?: string;
182
+ statusCode?: number;
183
+ title?: string;
184
+ description?: string;
185
+ language?: string;
186
+ favicon?: string;
187
+ viewport?: string;
188
+ robots?: string;
189
+ 'theme-color'?: string;
190
+ 'og:url'?: string;
191
+ 'og:title'?: string;
192
+ 'og:description'?: string;
193
+ 'og:type'?: string;
194
+ 'og:image'?: string;
195
+ 'og:image:width'?: string;
196
+ 'og:image:height'?: string;
197
+ 'og:site_name'?: string;
198
+ ogUrl?: string;
199
+ ogTitle?: string;
200
+ ogDescription?: string;
201
+ ogImage?: string;
202
+ ogSiteName?: string;
203
+ 'article:author'?: string;
204
+ 'article:published_time'?: string;
205
+ 'article:modified_time'?: string;
206
+ 'article:section'?: string;
207
+ 'article:tag'?: string;
208
+ 'article:publisher'?: string;
209
+ publishedTime?: string;
210
+ modifiedTime?: string;
211
+ 'twitter:site'?: string | boolean | number | null;
212
+ 'twitter:creator'?: string;
213
+ 'twitter:card'?: string;
214
+ 'twitter:image'?: string;
215
+ 'twitter:dnt'?: string;
216
+ 'twitter:app:name:iphone'?: string;
217
+ 'twitter:app:id:iphone'?: string;
218
+ 'twitter:app:url:iphone'?: string;
219
+ 'twitter:app:name:ipad'?: string;
220
+ 'twitter:app:id:ipad'?: string;
221
+ 'twitter:app:url:ipad'?: string;
222
+ 'twitter:app:name:googleplay'?: string;
223
+ 'twitter:app:id:googleplay'?: string;
224
+ 'twitter:app:url:googleplay'?: string;
225
+ 'fb:app_id'?: string;
226
+ 'al:ios:url'?: string;
227
+ 'al:ios:app_name'?: string;
228
+ 'al:ios:app_store_id'?: string;
229
+ [key: string]: string | number | boolean | null | undefined;
230
+ }
231
+ export interface FirecrawlScrapeResponse {
232
+ success: boolean;
233
+ data?: {
234
+ markdown?: string;
235
+ html?: string;
236
+ rawHtml?: string;
237
+ screenshot?: string;
238
+ links?: string[];
239
+ metadata?: ScrapeMetadata;
240
+ };
241
+ error?: string;
242
+ }
243
+ export interface FirecrawlScraperConfig {
244
+ apiKey?: string;
245
+ apiUrl?: string;
246
+ formats?: string[];
247
+ timeout?: number;
248
+ logger?: Logger;
249
+ }
250
+ /** Serper API */
251
+ export interface VideoResult {
252
+ title?: string;
253
+ link?: string;
254
+ snippet?: string;
255
+ imageUrl?: string;
256
+ duration?: string;
257
+ source?: string;
258
+ channel?: string;
259
+ date?: string;
260
+ position?: number;
261
+ }
262
+ export interface PlaceResult {
263
+ position?: number;
264
+ name?: string;
265
+ address?: string;
266
+ latitude?: number;
267
+ longitude?: number;
268
+ rating?: number;
269
+ ratingCount?: number;
270
+ category?: string;
271
+ identifier?: string;
272
+ }
273
+ export interface NewsResult {
274
+ title?: string;
275
+ link?: string;
276
+ snippet?: string;
277
+ date?: string;
278
+ source?: string;
279
+ imageUrl?: string;
280
+ position?: number;
281
+ }
282
+ export interface ShoppingResult {
283
+ title?: string;
284
+ source?: string;
285
+ link?: string;
286
+ price?: string;
287
+ delivery?: string;
288
+ imageUrl?: string;
289
+ rating?: number;
290
+ ratingCount?: number;
291
+ offers?: string;
292
+ productId?: string;
293
+ position?: number;
294
+ }
295
+ export interface ScholarResult {
296
+ title?: string;
297
+ link?: string;
298
+ publicationInfo?: string;
299
+ snippet?: string;
300
+ year?: number;
301
+ citedBy?: number;
302
+ }
303
+ export interface ImageResult {
304
+ title?: string;
305
+ imageUrl?: string;
306
+ imageWidth?: number;
307
+ imageHeight?: number;
308
+ thumbnailUrl?: string;
309
+ thumbnailWidth?: number;
310
+ thumbnailHeight?: number;
311
+ source?: string;
312
+ domain?: string;
313
+ link?: string;
314
+ googleUrl?: string;
315
+ position?: number;
316
+ }
317
+ export interface SerperSearchPayload extends SerperSearchInput {
318
+ /**
319
+ * Search type/vertical
320
+ * Options: "search" (web), "images", "news", "places", "videos"
321
+ */
322
+ type?: 'search' | 'images' | 'news' | 'places' | 'videos';
323
+ /**
324
+ * Starting index for search results pagination (used instead of page)
325
+ */
326
+ start?: number;
327
+ /**
328
+ * Filtering for safe search
329
+ * Options: "off", "moderate", "active"
330
+ */
331
+ safe?: 'off' | 'moderate' | 'active';
332
+ }
333
+ export type SerperSearchParameters = Pick<SerperSearchPayload, 'q' | 'type'> & {
334
+ engine: 'google';
335
+ };
336
+ export interface OrganicResult {
337
+ position?: number;
338
+ title?: string;
339
+ link: string;
340
+ snippet?: string;
341
+ date?: string;
342
+ sitelinks?: Array<{
343
+ title: string;
344
+ link: string;
345
+ }>;
346
+ }
347
+ export interface TopStoryResult {
348
+ title?: string;
349
+ link: string;
350
+ source?: string;
351
+ date?: string;
352
+ imageUrl?: string;
353
+ }
354
+ export interface KnowledgeGraphResult {
355
+ title?: string;
356
+ type?: string;
357
+ imageUrl?: string;
358
+ description?: string;
359
+ descriptionSource?: string;
360
+ descriptionLink?: string;
361
+ attributes?: Record<string, string>;
362
+ website?: string;
363
+ }
364
+ export interface AnswerBoxResult {
365
+ title?: string;
366
+ snippet?: string;
367
+ snippetHighlighted?: string[];
368
+ link?: string;
369
+ date?: string;
370
+ }
371
+ export interface PeopleAlsoAskResult {
372
+ question?: string;
373
+ snippet?: string;
374
+ title?: string;
375
+ link?: string;
376
+ }
377
+ export type RelatedSearches = Array<{
378
+ query: string;
379
+ }>;
380
+ export interface SerperSearchInput {
381
+ /**
382
+ * The search query string
383
+ */
384
+ q: string;
385
+ /**
386
+ * Country code for localized results
387
+ * Examples: "us", "uk", "ca", "de", etc.
388
+ */
389
+ gl?: string;
390
+ /**
391
+ * Interface language
392
+ * Examples: "en", "fr", "de", etc.
393
+ */
394
+ hl?: string;
395
+ /**
396
+ * Number of results to return (up to 100)
397
+ */
398
+ num?: number;
399
+ /**
400
+ * Specific location for contextual results
401
+ * Example: "New York, NY"
402
+ */
403
+ location?: string;
404
+ /**
405
+ * Search autocorrection setting
406
+ */
407
+ autocorrect?: boolean;
408
+ page?: number;
409
+ /**
410
+ * Date range for search results
411
+ * Options: "h" (past hour), "d" (past 24 hours), "w" (past week),
412
+ * "m" (past month), "y" (past year)
413
+ * `qdr:${DATE_RANGE}`
414
+ */
415
+ tbs?: string;
416
+ }
417
+ export type SerperResultData = {
418
+ searchParameters: SerperSearchPayload;
419
+ organic?: OrganicResult[];
420
+ topStories?: TopStoryResult[];
421
+ images?: ImageResult[];
422
+ videos?: VideoResult[];
423
+ places?: PlaceResult[];
424
+ news?: NewsResult[];
425
+ shopping?: ShoppingResult[];
426
+ peopleAlsoAsk?: PeopleAlsoAskResult[];
427
+ relatedSearches?: RelatedSearches;
428
+ knowledgeGraph?: KnowledgeGraphResult;
429
+ answerBox?: AnswerBoxResult;
430
+ credits?: number;
431
+ };
432
+ /** SearXNG */
433
+ export interface SearxNGSearchPayload {
434
+ /**
435
+ * The search query string
436
+ * Supports syntax specific to different search engines
437
+ * Example: "site:github.com SearXNG"
438
+ */
439
+ q: string;
440
+ /**
441
+ * Comma-separated list of search categories
442
+ * Example: "general,images,news"
443
+ */
444
+ categories?: string;
445
+ /**
446
+ * Comma-separated list of search engines to use
447
+ * Example: "google,bing,duckduckgo"
448
+ */
449
+ engines?: string;
450
+ /**
451
+ * Code of the language for search results
452
+ * Example: "en", "fr", "de", "es"
453
+ */
454
+ language?: string;
455
+ /**
456
+ * Search page number
457
+ * Default: 1
458
+ */
459
+ pageno?: number;
460
+ /**
461
+ * Time range filter for search results
462
+ * Options: "day", "month", "year"
463
+ */
464
+ time_range?: 'day' | 'month' | 'year';
465
+ /**
466
+ * Output format of results
467
+ * Options: "json", "csv", "rss"
468
+ */
469
+ format?: 'json' | 'csv' | 'rss';
470
+ /**
471
+ * Open search results on new tab
472
+ * Options: `0` (off), `1` (on)
473
+ */
474
+ results_on_new_tab?: 0 | 1;
475
+ /**
476
+ * Proxy image results through SearxNG
477
+ * Options: true, false
478
+ */
479
+ image_proxy?: boolean;
480
+ /**
481
+ * Service for autocomplete suggestions
482
+ * Options: "google", "dbpedia", "duckduckgo", "mwmbl",
483
+ * "startpage", "wikipedia", "stract", "swisscows", "qwant"
484
+ */
485
+ autocomplete?: string;
486
+ /**
487
+ * Safe search filtering level
488
+ * Options: "0" (off), "1" (moderate), "2" (strict)
489
+ */
490
+ safesearch?: 0 | 1 | 2;
491
+ /**
492
+ * Theme to use for results page
493
+ * Default: "simple" (other themes may be available per instance)
494
+ */
495
+ theme?: string;
496
+ /**
497
+ * List of enabled plugins
498
+ * Default: "Hash_plugin,Self_Information,Tracker_URL_remover,Ahmia_blacklist"
499
+ */
500
+ enabled_plugins?: string;
501
+ /**
502
+ * List of disabled plugins
503
+ */
504
+ disabled_plugins?: string;
505
+ /**
506
+ * List of enabled engines
507
+ */
508
+ enabled_engines?: string;
509
+ /**
510
+ * List of disabled engines
511
+ */
512
+ disabled_engines?: string;
513
+ }
514
+ export interface SearXNGResult {
515
+ title?: string;
516
+ url?: string;
517
+ content?: string;
518
+ publishedDate?: string;
519
+ img_src?: string;
520
+ }