@librechat/agents 2.4.31 → 2.4.33

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 (115) hide show
  1. package/dist/cjs/events.cjs +3 -3
  2. package/dist/cjs/events.cjs.map +1 -1
  3. package/dist/cjs/graphs/Graph.cjs +2 -1
  4. package/dist/cjs/graphs/Graph.cjs.map +1 -1
  5. package/dist/cjs/main.cjs +5 -2
  6. package/dist/cjs/main.cjs.map +1 -1
  7. package/dist/cjs/messages/ids.cjs +23 -0
  8. package/dist/cjs/messages/ids.cjs.map +1 -0
  9. package/dist/cjs/splitStream.cjs +2 -1
  10. package/dist/cjs/splitStream.cjs.map +1 -1
  11. package/dist/cjs/stream.cjs +87 -154
  12. package/dist/cjs/stream.cjs.map +1 -1
  13. package/dist/cjs/tools/ToolNode.cjs +14 -3
  14. package/dist/cjs/tools/ToolNode.cjs.map +1 -1
  15. package/dist/cjs/tools/handlers.cjs +144 -0
  16. package/dist/cjs/tools/handlers.cjs.map +1 -0
  17. package/dist/cjs/tools/search/content.cjs +140 -0
  18. package/dist/cjs/tools/search/content.cjs.map +1 -0
  19. package/dist/cjs/tools/search/firecrawl.cjs +23 -41
  20. package/dist/cjs/tools/search/firecrawl.cjs.map +1 -1
  21. package/dist/cjs/tools/search/format.cjs +161 -74
  22. package/dist/cjs/tools/search/format.cjs.map +1 -1
  23. package/dist/cjs/tools/search/highlights.cjs +64 -12
  24. package/dist/cjs/tools/search/highlights.cjs.map +1 -1
  25. package/dist/cjs/tools/search/rerankers.cjs +43 -36
  26. package/dist/cjs/tools/search/rerankers.cjs.map +1 -1
  27. package/dist/cjs/tools/search/schema.cjs +70 -0
  28. package/dist/cjs/tools/search/schema.cjs.map +1 -0
  29. package/dist/cjs/tools/search/search.cjs +150 -69
  30. package/dist/cjs/tools/search/search.cjs.map +1 -1
  31. package/dist/cjs/tools/search/tool.cjs +247 -58
  32. package/dist/cjs/tools/search/tool.cjs.map +1 -1
  33. package/dist/cjs/tools/search/utils.cjs +66 -0
  34. package/dist/cjs/tools/search/utils.cjs.map +1 -0
  35. package/dist/esm/events.mjs +1 -1
  36. package/dist/esm/events.mjs.map +1 -1
  37. package/dist/esm/graphs/Graph.mjs +2 -1
  38. package/dist/esm/graphs/Graph.mjs.map +1 -1
  39. package/dist/esm/main.mjs +3 -1
  40. package/dist/esm/main.mjs.map +1 -1
  41. package/dist/esm/messages/ids.mjs +21 -0
  42. package/dist/esm/messages/ids.mjs.map +1 -0
  43. package/dist/esm/splitStream.mjs +2 -1
  44. package/dist/esm/splitStream.mjs.map +1 -1
  45. package/dist/esm/stream.mjs +87 -152
  46. package/dist/esm/stream.mjs.map +1 -1
  47. package/dist/esm/tools/ToolNode.mjs +14 -3
  48. package/dist/esm/tools/ToolNode.mjs.map +1 -1
  49. package/dist/esm/tools/handlers.mjs +141 -0
  50. package/dist/esm/tools/handlers.mjs.map +1 -0
  51. package/dist/esm/tools/search/content.mjs +119 -0
  52. package/dist/esm/tools/search/content.mjs.map +1 -0
  53. package/dist/esm/tools/search/firecrawl.mjs +24 -41
  54. package/dist/esm/tools/search/firecrawl.mjs.map +1 -1
  55. package/dist/esm/tools/search/format.mjs +161 -74
  56. package/dist/esm/tools/search/format.mjs.map +1 -1
  57. package/dist/esm/tools/search/highlights.mjs +64 -12
  58. package/dist/esm/tools/search/highlights.mjs.map +1 -1
  59. package/dist/esm/tools/search/rerankers.mjs +43 -36
  60. package/dist/esm/tools/search/rerankers.mjs.map +1 -1
  61. package/dist/esm/tools/search/schema.mjs +61 -0
  62. package/dist/esm/tools/search/schema.mjs.map +1 -0
  63. package/dist/esm/tools/search/search.mjs +150 -69
  64. package/dist/esm/tools/search/search.mjs.map +1 -1
  65. package/dist/esm/tools/search/tool.mjs +246 -57
  66. package/dist/esm/tools/search/tool.mjs.map +1 -1
  67. package/dist/esm/tools/search/utils.mjs +61 -0
  68. package/dist/esm/tools/search/utils.mjs.map +1 -0
  69. package/dist/types/graphs/Graph.d.ts +1 -1
  70. package/dist/types/index.d.ts +1 -0
  71. package/dist/types/messages/ids.d.ts +3 -0
  72. package/dist/types/messages/index.d.ts +1 -0
  73. package/dist/types/stream.d.ts +0 -8
  74. package/dist/types/tools/ToolNode.d.ts +6 -0
  75. package/dist/types/tools/example.d.ts +23 -3
  76. package/dist/types/tools/handlers.d.ts +8 -0
  77. package/dist/types/tools/search/content.d.ts +4 -0
  78. package/dist/types/tools/search/firecrawl.d.ts +7 -86
  79. package/dist/types/tools/search/format.d.ts +4 -1
  80. package/dist/types/tools/search/highlights.d.ts +1 -1
  81. package/dist/types/tools/search/rerankers.d.ts +8 -4
  82. package/dist/types/tools/search/schema.d.ts +16 -0
  83. package/dist/types/tools/search/search.d.ts +2 -2
  84. package/dist/types/tools/search/test.d.ts +1 -0
  85. package/dist/types/tools/search/tool.d.ts +25 -4
  86. package/dist/types/tools/search/types.d.ts +443 -53
  87. package/dist/types/tools/search/utils.d.ts +10 -0
  88. package/package.json +9 -7
  89. package/src/events.ts +49 -15
  90. package/src/graphs/Graph.ts +6 -2
  91. package/src/index.ts +1 -0
  92. package/src/messages/ids.ts +26 -0
  93. package/src/messages/index.ts +1 -0
  94. package/src/scripts/search.ts +8 -3
  95. package/src/splitStream.test.ts +132 -71
  96. package/src/splitStream.ts +2 -1
  97. package/src/stream.ts +94 -183
  98. package/src/tools/ToolNode.ts +37 -14
  99. package/src/tools/handlers.ts +167 -0
  100. package/src/tools/search/content.test.ts +173 -0
  101. package/src/tools/search/content.ts +147 -0
  102. package/src/tools/search/firecrawl.ts +36 -148
  103. package/src/tools/search/format.ts +205 -74
  104. package/src/tools/search/highlights.ts +99 -16
  105. package/src/tools/search/output.md +2775 -0
  106. package/src/tools/search/rerankers.ts +57 -36
  107. package/src/tools/search/schema.ts +63 -0
  108. package/src/tools/search/search.ts +230 -117
  109. package/src/tools/search/test.html +884 -0
  110. package/src/tools/search/test.md +643 -0
  111. package/src/tools/search/test.ts +159 -0
  112. package/src/tools/search/tool.ts +363 -87
  113. package/src/tools/search/types.ts +503 -61
  114. package/src/tools/search/utils.ts +79 -0
  115. package/src/utils/llmConfig.ts +1 -1
@@ -1,65 +1,47 @@
1
+ import { z } from 'zod';
2
+ import type { Logger as WinstonLogger } from 'winston';
1
3
  import type { RunnableConfig } from '@langchain/core/runnables';
2
4
  import type { BaseReranker } from './rerankers';
5
+ import { DATE_RANGE } from './schema';
3
6
  export type SearchProvider = 'serper' | 'searxng';
4
7
  export type RerankerType = 'infinity' | 'jina' | 'cohere' | 'none';
5
- export interface OrganicResult {
6
- position?: number;
7
- title?: string;
8
- link: string;
9
- snippet?: string;
10
- date?: string;
11
- }
12
- export interface TopStoryResult {
13
- title?: string;
14
- link: string;
15
- source?: string;
16
- date?: string;
17
- imageUrl?: string;
18
- }
19
- export interface ImageResult {
20
- title?: string;
21
- imageUrl?: string;
22
- }
23
- export interface KnowledgeGraphResult {
24
- title?: string;
25
- type?: string;
26
- description?: string;
27
- attributes?: Record<string, string>;
28
- imageUrl?: string;
29
- }
30
- export interface AnswerBoxResult {
31
- title?: string;
32
- answer?: string;
33
- snippet?: string;
34
- date?: string;
35
- }
36
- export interface PeopleAlsoAskResult {
37
- question?: string;
38
- answer?: string;
39
- }
40
8
  export interface Highlight {
41
9
  score: number;
42
10
  text: string;
11
+ references?: UsedReferences;
43
12
  }
44
- export interface ValidSource {
45
- link: string;
46
- position?: number;
47
- title?: string;
48
- snippet?: string;
49
- date?: string;
13
+ export type ProcessedSource = {
50
14
  content?: string;
51
15
  attribution?: string;
16
+ references?: References;
52
17
  highlights?: Highlight[];
53
- }
18
+ processed?: boolean;
19
+ };
20
+ export type ProcessedOrganic = OrganicResult & ProcessedSource;
21
+ export type ProcessedTopStory = TopStoryResult & ProcessedSource;
22
+ export type ValidSource = ProcessedOrganic | ProcessedTopStory;
23
+ export type ResultReference = {
24
+ link: string;
25
+ type: 'link' | 'image' | 'video';
26
+ title?: string;
27
+ attribution?: string;
28
+ };
54
29
  export interface SearchResultData {
55
- organic?: ValidSource[];
56
- topStories?: ValidSource[];
30
+ turn?: number;
31
+ organic?: ProcessedOrganic[];
32
+ topStories?: ProcessedTopStory[];
57
33
  images?: ImageResult[];
34
+ videos?: VideoResult[];
35
+ places?: PlaceResult[];
36
+ news?: NewsResult[];
37
+ shopping?: ShoppingResult[];
58
38
  knowledgeGraph?: KnowledgeGraphResult;
59
39
  answerBox?: AnswerBoxResult;
60
40
  peopleAlsoAsk?: PeopleAlsoAskResult[];
61
- relatedSearches?: string[];
62
- suggestions?: string[];
41
+ relatedSearches?: Array<{
42
+ query: string;
43
+ }>;
44
+ references?: ResultReference[];
63
45
  error?: string;
64
46
  }
65
47
  export interface SearchResult {
@@ -80,11 +62,17 @@ export interface SearchConfig {
80
62
  searxngInstanceUrl?: string;
81
63
  searxngApiKey?: string;
82
64
  }
65
+ export type References = {
66
+ links: MediaReference[];
67
+ images: MediaReference[];
68
+ videos: MediaReference[];
69
+ };
83
70
  export interface ScrapeResult {
84
71
  url: string;
85
72
  error?: boolean;
86
73
  content: string;
87
74
  attribution?: string;
75
+ references?: References;
88
76
  highlights?: Highlight[];
89
77
  }
90
78
  export interface ProcessSourcesConfig {
@@ -92,6 +80,7 @@ export interface ProcessSourcesConfig {
92
80
  strategies?: string[];
93
81
  filterContent?: boolean;
94
82
  reranker?: BaseReranker;
83
+ logger?: Logger;
95
84
  }
96
85
  export interface FirecrawlConfig {
97
86
  firecrawlApiKey?: string;
@@ -104,13 +93,6 @@ export interface ScraperContentResult {
104
93
  export interface ScraperExtractionResult {
105
94
  no_extraction: ScraperContentResult;
106
95
  }
107
- export interface SearXNGResult {
108
- title?: string;
109
- url?: string;
110
- content?: string;
111
- publishedDate?: string;
112
- img_src?: string;
113
- }
114
96
  export interface JinaRerankerResult {
115
97
  index: number;
116
98
  relevance_score: number;
@@ -142,9 +124,417 @@ export interface CohereRerankerResponse {
142
124
  };
143
125
  };
144
126
  }
127
+ export type SafeSearchLevel = 0 | 1 | 2;
128
+ export type Logger = WinstonLogger;
145
129
  export interface SearchToolConfig extends SearchConfig, ProcessSourcesConfig, FirecrawlConfig {
130
+ logger?: Logger;
131
+ safeSearch?: SafeSearchLevel;
146
132
  jinaApiKey?: string;
147
133
  cohereApiKey?: string;
148
134
  rerankerType?: RerankerType;
149
135
  onSearchResults?: (results: SearchResult, runnableConfig?: RunnableConfig) => void;
136
+ onGetHighlights?: (link: string) => void;
137
+ }
138
+ export interface MediaReference {
139
+ originalUrl: string;
140
+ title?: string;
141
+ text?: string;
142
+ }
143
+ export type UsedReferences = {
144
+ type: 'link' | 'image' | 'video';
145
+ originalIndex: number;
146
+ reference: MediaReference;
147
+ }[];
148
+ /** Firecrawl */
149
+ export interface FirecrawlScrapeOptions {
150
+ formats?: string[];
151
+ includeTags?: string[];
152
+ excludeTags?: string[];
153
+ headers?: Record<string, string>;
154
+ waitFor?: number;
155
+ timeout?: number;
156
+ }
157
+ export interface ScrapeMetadata {
158
+ sourceURL?: string;
159
+ url?: string;
160
+ scrapeId?: string;
161
+ statusCode?: number;
162
+ title?: string;
163
+ description?: string;
164
+ language?: string;
165
+ favicon?: string;
166
+ viewport?: string;
167
+ robots?: string;
168
+ 'theme-color'?: string;
169
+ 'og:url'?: string;
170
+ 'og:title'?: string;
171
+ 'og:description'?: string;
172
+ 'og:type'?: string;
173
+ 'og:image'?: string;
174
+ 'og:image:width'?: string;
175
+ 'og:image:height'?: string;
176
+ 'og:site_name'?: string;
177
+ ogUrl?: string;
178
+ ogTitle?: string;
179
+ ogDescription?: string;
180
+ ogImage?: string;
181
+ ogSiteName?: string;
182
+ 'article:author'?: string;
183
+ 'article:published_time'?: string;
184
+ 'article:modified_time'?: string;
185
+ 'article:section'?: string;
186
+ 'article:tag'?: string;
187
+ 'article:publisher'?: string;
188
+ publishedTime?: string;
189
+ modifiedTime?: string;
190
+ 'twitter:site'?: string | boolean | number | null;
191
+ 'twitter:creator'?: string;
192
+ 'twitter:card'?: string;
193
+ 'twitter:image'?: string;
194
+ 'twitter:dnt'?: string;
195
+ 'twitter:app:name:iphone'?: string;
196
+ 'twitter:app:id:iphone'?: string;
197
+ 'twitter:app:url:iphone'?: string;
198
+ 'twitter:app:name:ipad'?: string;
199
+ 'twitter:app:id:ipad'?: string;
200
+ 'twitter:app:url:ipad'?: string;
201
+ 'twitter:app:name:googleplay'?: string;
202
+ 'twitter:app:id:googleplay'?: string;
203
+ 'twitter:app:url:googleplay'?: string;
204
+ 'fb:app_id'?: string;
205
+ 'al:ios:url'?: string;
206
+ 'al:ios:app_name'?: string;
207
+ 'al:ios:app_store_id'?: string;
208
+ [key: string]: string | number | boolean | null | undefined;
209
+ }
210
+ export interface FirecrawlScrapeResponse {
211
+ success: boolean;
212
+ data?: {
213
+ markdown?: string;
214
+ html?: string;
215
+ rawHtml?: string;
216
+ screenshot?: string;
217
+ links?: string[];
218
+ metadata?: ScrapeMetadata;
219
+ };
220
+ error?: string;
221
+ }
222
+ export interface FirecrawlScraperConfig {
223
+ apiKey?: string;
224
+ apiUrl?: string;
225
+ formats?: string[];
226
+ timeout?: number;
227
+ logger?: Logger;
228
+ }
229
+ export type GetSourcesParams = {
230
+ query: string;
231
+ date?: DATE_RANGE;
232
+ country?: string;
233
+ numResults?: number;
234
+ safeSearch?: SearchToolConfig['safeSearch'];
235
+ images?: boolean;
236
+ videos?: boolean;
237
+ news?: boolean;
238
+ type?: 'search' | 'images' | 'videos' | 'news';
239
+ };
240
+ /** Serper API */
241
+ export interface VideoResult {
242
+ title?: string;
243
+ link?: string;
244
+ snippet?: string;
245
+ imageUrl?: string;
246
+ duration?: string;
247
+ source?: string;
248
+ channel?: string;
249
+ date?: string;
250
+ position?: number;
251
+ }
252
+ export interface PlaceResult {
253
+ position?: number;
254
+ name?: string;
255
+ address?: string;
256
+ latitude?: number;
257
+ longitude?: number;
258
+ rating?: number;
259
+ ratingCount?: number;
260
+ category?: string;
261
+ identifier?: string;
262
+ }
263
+ export interface NewsResult {
264
+ title?: string;
265
+ link?: string;
266
+ snippet?: string;
267
+ date?: string;
268
+ source?: string;
269
+ imageUrl?: string;
270
+ position?: number;
271
+ }
272
+ export interface ShoppingResult {
273
+ title?: string;
274
+ source?: string;
275
+ link?: string;
276
+ price?: string;
277
+ delivery?: string;
278
+ imageUrl?: string;
279
+ rating?: number;
280
+ ratingCount?: number;
281
+ offers?: string;
282
+ productId?: string;
283
+ position?: number;
284
+ }
285
+ export interface ScholarResult {
286
+ title?: string;
287
+ link?: string;
288
+ publicationInfo?: string;
289
+ snippet?: string;
290
+ year?: number;
291
+ citedBy?: number;
292
+ }
293
+ export interface ImageResult {
294
+ title?: string;
295
+ imageUrl?: string;
296
+ imageWidth?: number;
297
+ imageHeight?: number;
298
+ thumbnailUrl?: string;
299
+ thumbnailWidth?: number;
300
+ thumbnailHeight?: number;
301
+ source?: string;
302
+ domain?: string;
303
+ link?: string;
304
+ googleUrl?: string;
305
+ position?: number;
306
+ }
307
+ export interface SerperSearchPayload extends SerperSearchInput {
308
+ /**
309
+ * Search type/vertical
310
+ * Options: "search" (web), "images", "news", "places", "videos"
311
+ */
312
+ type?: 'search' | 'images' | 'news' | 'places' | 'videos';
313
+ /**
314
+ * Starting index for search results pagination (used instead of page)
315
+ */
316
+ start?: number;
317
+ /**
318
+ * Filtering for safe search
319
+ * Options: "off", "moderate", "active"
320
+ */
321
+ safe?: 'off' | 'moderate' | 'active';
322
+ }
323
+ export type SerperSearchParameters = Pick<SerperSearchPayload, 'q' | 'type'> & {
324
+ engine: 'google';
325
+ };
326
+ export interface OrganicResult {
327
+ position?: number;
328
+ title?: string;
329
+ link: string;
330
+ snippet?: string;
331
+ date?: string;
332
+ sitelinks?: Array<{
333
+ title: string;
334
+ link: string;
335
+ }>;
336
+ }
337
+ export interface TopStoryResult {
338
+ title?: string;
339
+ link: string;
340
+ source?: string;
341
+ date?: string;
342
+ imageUrl?: string;
343
+ }
344
+ export interface KnowledgeGraphResult {
345
+ title?: string;
346
+ type?: string;
347
+ imageUrl?: string;
348
+ description?: string;
349
+ descriptionSource?: string;
350
+ descriptionLink?: string;
351
+ attributes?: Record<string, string>;
352
+ website?: string;
353
+ }
354
+ export interface AnswerBoxResult {
355
+ title?: string;
356
+ snippet?: string;
357
+ snippetHighlighted?: string[];
358
+ link?: string;
359
+ date?: string;
360
+ }
361
+ export interface PeopleAlsoAskResult {
362
+ question?: string;
363
+ snippet?: string;
364
+ title?: string;
365
+ link?: string;
366
+ }
367
+ export type RelatedSearches = Array<{
368
+ query: string;
369
+ }>;
370
+ export interface SerperSearchInput {
371
+ /**
372
+ * The search query string
373
+ */
374
+ q: string;
375
+ /**
376
+ * Country code for localized results
377
+ * Examples: "us", "uk", "ca", "de", etc.
378
+ */
379
+ gl?: string;
380
+ /**
381
+ * Interface language
382
+ * Examples: "en", "fr", "de", etc.
383
+ */
384
+ hl?: string;
385
+ /**
386
+ * Number of results to return (up to 100)
387
+ */
388
+ num?: number;
389
+ /**
390
+ * Specific location for contextual results
391
+ * Example: "New York, NY"
392
+ */
393
+ location?: string;
394
+ /**
395
+ * Search autocorrection setting
396
+ */
397
+ autocorrect?: boolean;
398
+ page?: number;
399
+ /**
400
+ * Date range for search results
401
+ * Options: "h" (past hour), "d" (past 24 hours), "w" (past week),
402
+ * "m" (past month), "y" (past year)
403
+ * `qdr:${DATE_RANGE}`
404
+ */
405
+ tbs?: string;
406
+ }
407
+ export type SerperResultData = {
408
+ searchParameters: SerperSearchPayload;
409
+ organic?: OrganicResult[];
410
+ topStories?: TopStoryResult[];
411
+ images?: ImageResult[];
412
+ videos?: VideoResult[];
413
+ places?: PlaceResult[];
414
+ news?: NewsResult[];
415
+ shopping?: ShoppingResult[];
416
+ peopleAlsoAsk?: PeopleAlsoAskResult[];
417
+ relatedSearches?: RelatedSearches;
418
+ knowledgeGraph?: KnowledgeGraphResult;
419
+ answerBox?: AnswerBoxResult;
420
+ credits?: number;
421
+ };
422
+ /** SearXNG */
423
+ export interface SearxNGSearchPayload {
424
+ /**
425
+ * The search query string
426
+ * Supports syntax specific to different search engines
427
+ * Example: "site:github.com SearXNG"
428
+ */
429
+ q: string;
430
+ /**
431
+ * Comma-separated list of search categories
432
+ * Example: "general,images,news"
433
+ */
434
+ categories?: string;
435
+ /**
436
+ * Comma-separated list of search engines to use
437
+ * Example: "google,bing,duckduckgo"
438
+ */
439
+ engines?: string;
440
+ /**
441
+ * Code of the language for search results
442
+ * Example: "en", "fr", "de", "es"
443
+ */
444
+ language?: string;
445
+ /**
446
+ * Search page number
447
+ * Default: 1
448
+ */
449
+ pageno?: number;
450
+ /**
451
+ * Time range filter for search results
452
+ * Options: "day", "month", "year"
453
+ */
454
+ time_range?: 'day' | 'month' | 'year';
455
+ /**
456
+ * Output format of results
457
+ * Options: "json", "csv", "rss"
458
+ */
459
+ format?: 'json' | 'csv' | 'rss';
460
+ /**
461
+ * Open search results on new tab
462
+ * Options: `0` (off), `1` (on)
463
+ */
464
+ results_on_new_tab?: 0 | 1;
465
+ /**
466
+ * Proxy image results through SearxNG
467
+ * Options: true, false
468
+ */
469
+ image_proxy?: boolean;
470
+ /**
471
+ * Service for autocomplete suggestions
472
+ * Options: "google", "dbpedia", "duckduckgo", "mwmbl",
473
+ * "startpage", "wikipedia", "stract", "swisscows", "qwant"
474
+ */
475
+ autocomplete?: string;
476
+ /**
477
+ * Safe search filtering level
478
+ * Options: "0" (off), "1" (moderate), "2" (strict)
479
+ */
480
+ safesearch?: 0 | 1 | 2;
481
+ /**
482
+ * Theme to use for results page
483
+ * Default: "simple" (other themes may be available per instance)
484
+ */
485
+ theme?: string;
486
+ /**
487
+ * List of enabled plugins
488
+ * Default: "Hash_plugin,Self_Information,Tracker_URL_remover,Ahmia_blacklist"
489
+ */
490
+ enabled_plugins?: string;
491
+ /**
492
+ * List of disabled plugins
493
+ */
494
+ disabled_plugins?: string;
495
+ /**
496
+ * List of enabled engines
497
+ */
498
+ enabled_engines?: string;
499
+ /**
500
+ * List of disabled engines
501
+ */
502
+ disabled_engines?: string;
503
+ }
504
+ export interface SearXNGResult {
505
+ title?: string;
506
+ url?: string;
507
+ content?: string;
508
+ publishedDate?: string;
509
+ img_src?: string;
150
510
  }
511
+ export type ProcessSourcesFields = {
512
+ result: SearchResult;
513
+ numElements: number;
514
+ query: string;
515
+ news: boolean;
516
+ proMode: boolean;
517
+ onGetHighlights: SearchToolConfig['onGetHighlights'];
518
+ };
519
+ export type SearchToolSchema = z.ZodObject<{
520
+ query: z.ZodString;
521
+ date: z.ZodOptional<z.ZodNativeEnum<typeof DATE_RANGE>>;
522
+ country?: z.ZodOptional<z.ZodString>;
523
+ images: z.ZodOptional<z.ZodBoolean>;
524
+ videos: z.ZodOptional<z.ZodBoolean>;
525
+ news: z.ZodOptional<z.ZodBoolean>;
526
+ }, 'strip', z.ZodTypeAny, {
527
+ query: string;
528
+ date?: DATE_RANGE;
529
+ country?: unknown;
530
+ images?: boolean;
531
+ videos?: boolean;
532
+ news?: boolean;
533
+ }, {
534
+ query: string;
535
+ date?: DATE_RANGE;
536
+ country?: unknown;
537
+ images?: boolean;
538
+ videos?: boolean;
539
+ news?: boolean;
540
+ }>;
@@ -0,0 +1,10 @@
1
+ import type * as t from './types';
2
+ /**
3
+ * Creates a default logger that maps to console methods
4
+ * Uses a singleton pattern to avoid creating multiple instances
5
+ * @returns A default logger that implements the Logger interface
6
+ */
7
+ export declare const createDefaultLogger: () => t.Logger;
8
+ export declare const fileExtRegex: RegExp;
9
+ export declare const getDomainName: (link: string, metadata?: t.ScrapeMetadata, logger?: t.Logger) => string | undefined;
10
+ export declare function getAttribution(link: string, metadata?: t.ScrapeMetadata, logger?: t.Logger): string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@librechat/agents",
3
- "version": "2.4.31",
3
+ "version": "2.4.33",
4
4
  "main": "./dist/cjs/main.cjs",
5
5
  "module": "./dist/esm/main.mjs",
6
6
  "types": "./dist/types/index.d.ts",
@@ -73,17 +73,18 @@
73
73
  },
74
74
  "dependencies": {
75
75
  "@langchain/anthropic": "^0.3.20",
76
- "@langchain/aws": "^0.1.9",
76
+ "@langchain/aws": "0.1.8",
77
77
  "@langchain/community": "^0.3.42",
78
- "@langchain/core": "^0.3.51",
78
+ "@langchain/core": "^0.3.55",
79
79
  "@langchain/deepseek": "^0.0.1",
80
- "@langchain/google-genai": "^0.2.5",
81
- "@langchain/google-vertexai": "^0.2.5",
82
- "@langchain/langgraph": "^0.2.67",
80
+ "@langchain/google-genai": "^0.2.8",
81
+ "@langchain/google-vertexai": "^0.2.8",
82
+ "@langchain/langgraph": "^0.2.72",
83
83
  "@langchain/mistralai": "^0.2.0",
84
84
  "@langchain/ollama": "^0.2.0",
85
85
  "@langchain/openai": "^0.5.10",
86
86
  "@langchain/xai": "^0.0.2",
87
+ "cheerio": "^1.0.0",
87
88
  "dotenv": "^16.4.7",
88
89
  "https-proxy-agent": "^7.0.6",
89
90
  "nanoid": "^3.3.7"
@@ -121,7 +122,8 @@
121
122
  "tsc-alias": "^1.8.10",
122
123
  "tsconfig-paths": "^4.2.0",
123
124
  "tslib": "^2.6.3",
124
- "typescript": "^5.5.3"
125
+ "typescript": "^5.5.3",
126
+ "winston": "^3.17.0"
125
127
  },
126
128
  "lint-staged": {
127
129
  "*.{js,ts}": [