@triplef/agent 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/intent.schema-BbIiFHUW.d.ts +100 -0
- package/dist/prompts/index.d.ts +286 -0
- package/dist/prompts/index.mjs +3206 -0
- package/dist/schemas/index.d.ts +895 -0
- package/dist/schemas/index.mjs +1052 -0
- package/dist/tools/index.d.ts +699 -0
- package/dist/tools/index.mjs +1637 -0
- package/package.json +98 -0
|
@@ -0,0 +1,699 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Tool } from 'ai';
|
|
3
|
+
|
|
4
|
+
interface ProviderEndpointConfig {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
results: number;
|
|
7
|
+
}
|
|
8
|
+
interface SerperConfig {
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
web: ProviderEndpointConfig;
|
|
12
|
+
images: ProviderEndpointConfig;
|
|
13
|
+
news: ProviderEndpointConfig;
|
|
14
|
+
places: ProviderEndpointConfig;
|
|
15
|
+
shopping: ProviderEndpointConfig;
|
|
16
|
+
reviews: ProviderEndpointConfig;
|
|
17
|
+
videos: ProviderEndpointConfig;
|
|
18
|
+
scrape: {
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
interface BrightDataConfig {
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
apiKey?: string;
|
|
25
|
+
serpZone?: string;
|
|
26
|
+
unlockerZone?: string;
|
|
27
|
+
web: ProviderEndpointConfig;
|
|
28
|
+
images: ProviderEndpointConfig;
|
|
29
|
+
news: ProviderEndpointConfig;
|
|
30
|
+
places: ProviderEndpointConfig;
|
|
31
|
+
shopping: ProviderEndpointConfig;
|
|
32
|
+
videos: ProviderEndpointConfig;
|
|
33
|
+
scrape: {
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
interface EodhdNewsConfig extends ProviderEndpointConfig {
|
|
38
|
+
snippetChars?: number;
|
|
39
|
+
}
|
|
40
|
+
interface EodhdConfig {
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
apiKey?: string;
|
|
43
|
+
search: ProviderEndpointConfig;
|
|
44
|
+
quote: ProviderEndpointConfig;
|
|
45
|
+
history: ProviderEndpointConfig;
|
|
46
|
+
technical: ProviderEndpointConfig;
|
|
47
|
+
intraday: ProviderEndpointConfig;
|
|
48
|
+
news: EodhdNewsConfig;
|
|
49
|
+
fundamentals: ProviderEndpointConfig;
|
|
50
|
+
}
|
|
51
|
+
interface YoutubeConfig {
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
apiKey?: string;
|
|
54
|
+
videos: ProviderEndpointConfig;
|
|
55
|
+
}
|
|
56
|
+
interface SourcesConfig {
|
|
57
|
+
preferred: string[];
|
|
58
|
+
blocked: string[];
|
|
59
|
+
imageTaskReferenceCount: number;
|
|
60
|
+
}
|
|
61
|
+
interface ToolConfigSnapshot {
|
|
62
|
+
serper: SerperConfig;
|
|
63
|
+
brightData: BrightDataConfig;
|
|
64
|
+
sources: SourcesConfig;
|
|
65
|
+
youtube: YoutubeConfig;
|
|
66
|
+
eodhd: EodhdConfig;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface ToolLogger {
|
|
70
|
+
log: (message: string, ...args: unknown[]) => void;
|
|
71
|
+
warn: (message: string, ...args: unknown[]) => void;
|
|
72
|
+
error: (message: string, ...args: unknown[]) => void;
|
|
73
|
+
debug?: (message: string, ...args: unknown[]) => void;
|
|
74
|
+
}
|
|
75
|
+
interface MarketDailyBar {
|
|
76
|
+
date: string;
|
|
77
|
+
open: number;
|
|
78
|
+
high: number;
|
|
79
|
+
low: number;
|
|
80
|
+
close: number;
|
|
81
|
+
adjustedClose?: number;
|
|
82
|
+
volume: number;
|
|
83
|
+
}
|
|
84
|
+
interface ToolDependencies {
|
|
85
|
+
getLiveConfig: () => ToolConfigSnapshot;
|
|
86
|
+
logger: ToolLogger;
|
|
87
|
+
compactContent: (content: string, opts?: {
|
|
88
|
+
model?: string;
|
|
89
|
+
notify?: (event: string, data?: unknown) => void;
|
|
90
|
+
}) => Promise<{
|
|
91
|
+
text: string;
|
|
92
|
+
}>;
|
|
93
|
+
model?: string;
|
|
94
|
+
notify?: (event: string, data?: unknown) => void;
|
|
95
|
+
getOrFetchHistory?: (ticker: string, from: string, to: string) => Promise<MarketDailyBar[]>;
|
|
96
|
+
defaultLang?: string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
declare const SOURCE = "brightData";
|
|
100
|
+
declare function buildGoogleUrl(query: string, params: Record<string, unknown>): string;
|
|
101
|
+
declare function engineEnabled(deps: ToolDependencies, endpoint: keyof ReturnType<ToolDependencies['getLiveConfig']>['brightData']): string | undefined;
|
|
102
|
+
|
|
103
|
+
declare function requestBrightData(apiKey: string, zone: string, url: string, opts: {
|
|
104
|
+
markdown?: boolean;
|
|
105
|
+
timeoutMs: number;
|
|
106
|
+
}): Promise<unknown>;
|
|
107
|
+
|
|
108
|
+
declare const brightDataImageSearchSchema: z.ZodObject<{
|
|
109
|
+
query: z.ZodString;
|
|
110
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
114
|
+
recency: z.ZodOptional<z.ZodEnum<{
|
|
115
|
+
day: "day";
|
|
116
|
+
week: "week";
|
|
117
|
+
month: "month";
|
|
118
|
+
year: "year";
|
|
119
|
+
}>>;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
type BrightDataImageSearchInput = z.infer<typeof brightDataImageSearchSchema>;
|
|
122
|
+
|
|
123
|
+
declare function createBrightDataImageSearch(deps: ToolDependencies): Tool;
|
|
124
|
+
|
|
125
|
+
interface BrightDataImageItem {
|
|
126
|
+
title?: string;
|
|
127
|
+
original_image?: string;
|
|
128
|
+
image?: string;
|
|
129
|
+
image_url?: string;
|
|
130
|
+
imageUrl?: string;
|
|
131
|
+
link?: string;
|
|
132
|
+
source_link?: string;
|
|
133
|
+
width?: number;
|
|
134
|
+
height?: number;
|
|
135
|
+
source?: string;
|
|
136
|
+
}
|
|
137
|
+
interface BrightDataImageSearchResponse {
|
|
138
|
+
images?: BrightDataImageItem[];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
declare const brightDataNewsSearchSchema: z.ZodObject<{
|
|
142
|
+
query: z.ZodString;
|
|
143
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
recency: z.ZodOptional<z.ZodEnum<{
|
|
145
|
+
day: "day";
|
|
146
|
+
week: "week";
|
|
147
|
+
month: "month";
|
|
148
|
+
year: "year";
|
|
149
|
+
}>>;
|
|
150
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
151
|
+
}, z.core.$strip>;
|
|
152
|
+
type BrightDataNewsSearchInput = z.infer<typeof brightDataNewsSearchSchema>;
|
|
153
|
+
|
|
154
|
+
declare function createBrightDataNewsSearch(deps: ToolDependencies): Tool;
|
|
155
|
+
|
|
156
|
+
interface BrightDataNewsItem {
|
|
157
|
+
title: string;
|
|
158
|
+
link: string;
|
|
159
|
+
description: string;
|
|
160
|
+
date: string;
|
|
161
|
+
source: string;
|
|
162
|
+
image_url?: string;
|
|
163
|
+
}
|
|
164
|
+
interface BrightDataNewsSearchResponse {
|
|
165
|
+
news?: BrightDataNewsItem[];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
declare const brightDataPlacesSearchSchema: z.ZodObject<{
|
|
169
|
+
query: z.ZodString;
|
|
170
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
type BrightDataPlacesSearchInput = z.infer<typeof brightDataPlacesSearchSchema>;
|
|
174
|
+
|
|
175
|
+
declare function createBrightDataPlacesSearch(deps: ToolDependencies): Tool;
|
|
176
|
+
|
|
177
|
+
interface BrightDataPlaceItem {
|
|
178
|
+
title?: string;
|
|
179
|
+
address?: string;
|
|
180
|
+
phone?: string;
|
|
181
|
+
latitude?: number;
|
|
182
|
+
longitude?: number;
|
|
183
|
+
rating?: number;
|
|
184
|
+
reviews_cnt?: number;
|
|
185
|
+
type?: string;
|
|
186
|
+
website?: string;
|
|
187
|
+
}
|
|
188
|
+
interface BrightDataPlacesSearchResponse {
|
|
189
|
+
local_results?: BrightDataPlaceItem[];
|
|
190
|
+
places?: BrightDataPlaceItem[];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
declare const brightDataShoppingSearchSchema: z.ZodObject<{
|
|
194
|
+
query: z.ZodString;
|
|
195
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
196
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
197
|
+
}, z.core.$strip>;
|
|
198
|
+
type BrightDataShoppingSearchInput = z.infer<typeof brightDataShoppingSearchSchema>;
|
|
199
|
+
|
|
200
|
+
declare function createBrightDataShoppingSearch(deps: ToolDependencies): Tool;
|
|
201
|
+
|
|
202
|
+
interface BrightDataShoppingItem {
|
|
203
|
+
title?: string;
|
|
204
|
+
link?: string;
|
|
205
|
+
price?: string;
|
|
206
|
+
source?: string;
|
|
207
|
+
image_url?: string;
|
|
208
|
+
image?: string;
|
|
209
|
+
delivery?: string;
|
|
210
|
+
rating?: number;
|
|
211
|
+
rating_count?: number;
|
|
212
|
+
}
|
|
213
|
+
interface BrightDataShoppingSearchResponse {
|
|
214
|
+
shopping?: BrightDataShoppingItem[];
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
declare const brightDataVideoSearchSchema: z.ZodObject<{
|
|
218
|
+
query: z.ZodString;
|
|
219
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
220
|
+
recency: z.ZodOptional<z.ZodEnum<{
|
|
221
|
+
day: "day";
|
|
222
|
+
week: "week";
|
|
223
|
+
month: "month";
|
|
224
|
+
year: "year";
|
|
225
|
+
}>>;
|
|
226
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
227
|
+
}, z.core.$strip>;
|
|
228
|
+
type BrightDataVideoSearchInput = z.infer<typeof brightDataVideoSearchSchema>;
|
|
229
|
+
|
|
230
|
+
declare function createBrightDataVideoSearch(deps: ToolDependencies): Tool;
|
|
231
|
+
|
|
232
|
+
interface BrightDataVideoItem {
|
|
233
|
+
title?: string;
|
|
234
|
+
link?: string;
|
|
235
|
+
description?: string;
|
|
236
|
+
duration?: string;
|
|
237
|
+
image?: string;
|
|
238
|
+
}
|
|
239
|
+
interface BrightDataVideoSearchResponse {
|
|
240
|
+
organic?: BrightDataVideoItem[];
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
declare const brightDataWebSearchSchema: z.ZodObject<{
|
|
244
|
+
query: z.ZodString;
|
|
245
|
+
recency: z.ZodOptional<z.ZodEnum<{
|
|
246
|
+
day: "day";
|
|
247
|
+
week: "week";
|
|
248
|
+
month: "month";
|
|
249
|
+
year: "year";
|
|
250
|
+
}>>;
|
|
251
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
252
|
+
}, z.core.$strip>;
|
|
253
|
+
type BrightDataWebSearchInput = z.infer<typeof brightDataWebSearchSchema>;
|
|
254
|
+
|
|
255
|
+
declare function createBrightDataWebSearch(deps: ToolDependencies): Tool;
|
|
256
|
+
|
|
257
|
+
interface BrightDataOrganicResult {
|
|
258
|
+
title: string;
|
|
259
|
+
link: string;
|
|
260
|
+
description: string;
|
|
261
|
+
}
|
|
262
|
+
interface BrightDataWebSearchResponse {
|
|
263
|
+
organic?: BrightDataOrganicResult[];
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
declare const brightDataWebpageScrapeSchema: z.ZodObject<{
|
|
267
|
+
url: z.ZodString;
|
|
268
|
+
}, z.core.$strip>;
|
|
269
|
+
type BrightDataWebpageScrapeInput = z.infer<typeof brightDataWebpageScrapeSchema>;
|
|
270
|
+
|
|
271
|
+
declare function createBrightDataWebpageScrape(deps: ToolDependencies): Tool;
|
|
272
|
+
|
|
273
|
+
interface BrightDataWebpageScrapeResponse {
|
|
274
|
+
text?: string;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
declare const MIN_IMAGE_WIDTH = 1280;
|
|
278
|
+
declare const MIN_IMAGE_HEIGHT = 720;
|
|
279
|
+
declare function meetsMinimumImageDimensions(width: number | undefined | null, height: number | undefined | null, minWidth?: number, minHeight?: number): boolean;
|
|
280
|
+
|
|
281
|
+
declare const RECENCY_DESCRIPTION = "Restrict results to the given past period (day=24 hours, week=7 days, month=1 month, year=1 year). Use for fresh content such as news, recent releases, or trending topics; leave unset for evergreen, historical, or general queries.";
|
|
282
|
+
|
|
283
|
+
declare const SEARCH_TIMEOUT_MS = 10000;
|
|
284
|
+
declare const BRIGHT_DATA_TIMEOUT_MS = 30000;
|
|
285
|
+
declare const SEARCH_RETRIES = 1;
|
|
286
|
+
|
|
287
|
+
declare const STANDALONE_QUERY_DESCRIPTION = "A standalone, self-contained search query that explicitly names the subject (title, entity, brand, person, place, or topic). Never copy the user message verbatim: rewrite short follow-ups (e.g. \"what do the reviews say?\") into a full query that names the established subject from the conversation (e.g. \"Neverness to Everness NTE reviews\").";
|
|
288
|
+
declare const STANDALONE_QUERY_TOOL_CLAUSE = "Always pass a standalone query that names the subject explicitly \u2014 never the user message verbatim.";
|
|
289
|
+
|
|
290
|
+
declare function applyLocaleParams(body: Record<string, unknown>, lang?: string): void;
|
|
291
|
+
|
|
292
|
+
type SearchRecency = keyof typeof QDR_BY_RECENCY;
|
|
293
|
+
declare const QDR_BY_RECENCY: Record<'day' | 'week' | 'month' | 'year', string>;
|
|
294
|
+
declare function applyRecencyParam(body: Record<string, unknown>, recency?: SearchRecency): void;
|
|
295
|
+
|
|
296
|
+
declare function buildYoutubeThumbnailUrl(url: string): string | undefined;
|
|
297
|
+
|
|
298
|
+
declare function fetchWithTimeout(url: string, init: RequestInit, options?: {
|
|
299
|
+
timeoutMs?: number;
|
|
300
|
+
retries?: number;
|
|
301
|
+
}): Promise<Response>;
|
|
302
|
+
|
|
303
|
+
declare function tbsSizeLabelForPixels(pixels: number): string;
|
|
304
|
+
|
|
305
|
+
declare function isGoogleHostUrl(url: string): boolean;
|
|
306
|
+
|
|
307
|
+
declare function localizedQuerySuffix(lang?: string): string;
|
|
308
|
+
|
|
309
|
+
declare function pickMerchantResult(results: Array<{
|
|
310
|
+
url?: string;
|
|
311
|
+
}>, storeToken: string): string | undefined;
|
|
312
|
+
|
|
313
|
+
type ResolvableOffer = {
|
|
314
|
+
title?: string;
|
|
315
|
+
link: string;
|
|
316
|
+
source?: string;
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
declare function resolveSerperShopOfferLinks<T extends ResolvableOffer>(offers: T[], deps: {
|
|
320
|
+
apiKey: string;
|
|
321
|
+
lang?: string;
|
|
322
|
+
logger: ToolLogger;
|
|
323
|
+
}): Promise<T[]>;
|
|
324
|
+
|
|
325
|
+
declare function storeHostToken(source: string): string;
|
|
326
|
+
|
|
327
|
+
type Variant = 'original' | 'grayscale' | 'denoised' | 'sharpened' | 'clahe';
|
|
328
|
+
type FilterVariant = Exclude<Variant, 'original'>;
|
|
329
|
+
|
|
330
|
+
declare const variantRequestSchema: z.ZodObject<{}, z.core.$strip>;
|
|
331
|
+
|
|
332
|
+
declare function createVariantRequestTool(variant: FilterVariant): Tool;
|
|
333
|
+
|
|
334
|
+
declare const memoryDeleteSchema: z.ZodObject<{
|
|
335
|
+
text: z.ZodOptional<z.ZodString>;
|
|
336
|
+
cognition: z.ZodOptional<z.ZodBoolean>;
|
|
337
|
+
}, z.core.$strip>;
|
|
338
|
+
type MemoryDeleteInput = z.infer<typeof memoryDeleteSchema>;
|
|
339
|
+
|
|
340
|
+
interface MemoryToolScope {
|
|
341
|
+
memoryPartition: string;
|
|
342
|
+
memoryCognition?: string;
|
|
343
|
+
sessionId?: string;
|
|
344
|
+
conversationId?: string;
|
|
345
|
+
requestId?: string;
|
|
346
|
+
}
|
|
347
|
+
interface MemoryRememberDeps {
|
|
348
|
+
scope: MemoryToolScope;
|
|
349
|
+
storeRecord: (input: {
|
|
350
|
+
memoryPartition: string;
|
|
351
|
+
sessionId?: string;
|
|
352
|
+
conversationId?: string;
|
|
353
|
+
requestId?: string;
|
|
354
|
+
text: string;
|
|
355
|
+
tags?: string[];
|
|
356
|
+
}) => Promise<string>;
|
|
357
|
+
}
|
|
358
|
+
declare function createMemoryRememberTool(deps: MemoryRememberDeps): Tool;
|
|
359
|
+
|
|
360
|
+
interface MemoryDeleteDeps {
|
|
361
|
+
scope: MemoryToolScope;
|
|
362
|
+
deleteRecords: (input: {
|
|
363
|
+
memoryPartition: string;
|
|
364
|
+
text?: string;
|
|
365
|
+
}) => Promise<{
|
|
366
|
+
deleted: number;
|
|
367
|
+
texts: string[];
|
|
368
|
+
matched: number;
|
|
369
|
+
}>;
|
|
370
|
+
deleteCognition: (memoryCognition: string) => Promise<string[]>;
|
|
371
|
+
}
|
|
372
|
+
declare function createMemoryDeleteTool(deps: MemoryDeleteDeps): Tool;
|
|
373
|
+
|
|
374
|
+
type MemoryRole = 'user' | 'assistant';
|
|
375
|
+
interface MemoryPoint {
|
|
376
|
+
id: string;
|
|
377
|
+
memoryPartition?: string;
|
|
378
|
+
memoryCognition?: string;
|
|
379
|
+
role: MemoryRole;
|
|
380
|
+
sessionId?: string;
|
|
381
|
+
conversationId?: string;
|
|
382
|
+
requestId?: string;
|
|
383
|
+
text: string;
|
|
384
|
+
tags: string[];
|
|
385
|
+
path?: string;
|
|
386
|
+
createdAt: string;
|
|
387
|
+
score?: number;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
declare const memoryRecallSchema: z.ZodObject<{
|
|
391
|
+
query: z.ZodString;
|
|
392
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
393
|
+
contains: z.ZodOptional<z.ZodString>;
|
|
394
|
+
topK: z.ZodOptional<z.ZodNumber>;
|
|
395
|
+
}, z.core.$strip>;
|
|
396
|
+
type MemoryRecallInput = z.infer<typeof memoryRecallSchema>;
|
|
397
|
+
|
|
398
|
+
interface MemoryRecallDeps {
|
|
399
|
+
scope: MemoryToolScope;
|
|
400
|
+
searchByText: (input: {
|
|
401
|
+
memoryPartition: string;
|
|
402
|
+
text: string;
|
|
403
|
+
tags?: string[];
|
|
404
|
+
contains?: string;
|
|
405
|
+
limit?: number;
|
|
406
|
+
}) => Promise<MemoryPoint[]>;
|
|
407
|
+
}
|
|
408
|
+
declare function createMemoryRecallTool(deps: MemoryRecallDeps): Tool;
|
|
409
|
+
|
|
410
|
+
declare const memoryRememberSchema: z.ZodObject<{
|
|
411
|
+
text: z.ZodString;
|
|
412
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
413
|
+
}, z.core.$strip>;
|
|
414
|
+
type MemoryRememberInput = z.infer<typeof memoryRememberSchema>;
|
|
415
|
+
|
|
416
|
+
declare const serperBusinessReviewsSearchSchema: z.ZodObject<{
|
|
417
|
+
query: z.ZodOptional<z.ZodString>;
|
|
418
|
+
placeId: z.ZodOptional<z.ZodString>;
|
|
419
|
+
cid: z.ZodOptional<z.ZodString>;
|
|
420
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
421
|
+
}, z.core.$strip>;
|
|
422
|
+
type SerperBusinessReviewsSearchInput = z.infer<typeof serperBusinessReviewsSearchSchema>;
|
|
423
|
+
|
|
424
|
+
declare function createSerperBusinessReviewsSearch(deps: ToolDependencies): Tool;
|
|
425
|
+
|
|
426
|
+
interface SerperReviewAuthor {
|
|
427
|
+
name?: string;
|
|
428
|
+
}
|
|
429
|
+
interface SerperReviewItem {
|
|
430
|
+
snippet?: string;
|
|
431
|
+
rating?: number;
|
|
432
|
+
date?: string;
|
|
433
|
+
isoDate?: string;
|
|
434
|
+
likes?: number | null;
|
|
435
|
+
user?: SerperReviewAuthor;
|
|
436
|
+
}
|
|
437
|
+
interface SerperPlaceInfo {
|
|
438
|
+
title?: string;
|
|
439
|
+
address?: string;
|
|
440
|
+
rating?: number;
|
|
441
|
+
ratingCount?: number;
|
|
442
|
+
}
|
|
443
|
+
interface SerperBusinessReviewsSearchResponse {
|
|
444
|
+
placeInfo?: SerperPlaceInfo;
|
|
445
|
+
reviews?: SerperReviewItem[];
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
declare const serperImageSearchSchema: z.ZodObject<{
|
|
449
|
+
query: z.ZodString;
|
|
450
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
451
|
+
minWidth: z.ZodOptional<z.ZodNumber>;
|
|
452
|
+
minHeight: z.ZodOptional<z.ZodNumber>;
|
|
453
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
454
|
+
recency: z.ZodOptional<z.ZodEnum<{
|
|
455
|
+
day: "day";
|
|
456
|
+
week: "week";
|
|
457
|
+
month: "month";
|
|
458
|
+
year: "year";
|
|
459
|
+
}>>;
|
|
460
|
+
}, z.core.$strip>;
|
|
461
|
+
type SerperImageSearchInput = z.infer<typeof serperImageSearchSchema>;
|
|
462
|
+
|
|
463
|
+
declare function createSerperImageSearch(deps: ToolDependencies): Tool;
|
|
464
|
+
|
|
465
|
+
interface SerperImageItem {
|
|
466
|
+
title?: string;
|
|
467
|
+
imageUrl?: string;
|
|
468
|
+
image?: string;
|
|
469
|
+
link?: string;
|
|
470
|
+
imageWidth?: number;
|
|
471
|
+
imageHeight?: number;
|
|
472
|
+
width?: number;
|
|
473
|
+
height?: number;
|
|
474
|
+
source?: string;
|
|
475
|
+
domain?: string;
|
|
476
|
+
}
|
|
477
|
+
interface SerperImageSearchResponse {
|
|
478
|
+
images?: SerperImageItem[];
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
declare const serperNewsSearchSchema: z.ZodObject<{
|
|
482
|
+
query: z.ZodString;
|
|
483
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
484
|
+
recency: z.ZodOptional<z.ZodEnum<{
|
|
485
|
+
day: "day";
|
|
486
|
+
week: "week";
|
|
487
|
+
month: "month";
|
|
488
|
+
year: "year";
|
|
489
|
+
}>>;
|
|
490
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
491
|
+
}, z.core.$strip>;
|
|
492
|
+
type SerperNewsSearchInput = z.infer<typeof serperNewsSearchSchema>;
|
|
493
|
+
|
|
494
|
+
declare function createSerperNewsSearch(deps: ToolDependencies): Tool;
|
|
495
|
+
|
|
496
|
+
interface SerperNewsItem {
|
|
497
|
+
title: string;
|
|
498
|
+
link: string;
|
|
499
|
+
snippet: string;
|
|
500
|
+
date: string;
|
|
501
|
+
source: string;
|
|
502
|
+
imageUrl?: string;
|
|
503
|
+
}
|
|
504
|
+
interface SerperNewsSearchResponse {
|
|
505
|
+
news?: SerperNewsItem[];
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
declare const serperPlacesSearchSchema: z.ZodObject<{
|
|
509
|
+
query: z.ZodString;
|
|
510
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
511
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
512
|
+
}, z.core.$strip>;
|
|
513
|
+
type SerperPlacesSearchInput = z.infer<typeof serperPlacesSearchSchema>;
|
|
514
|
+
|
|
515
|
+
declare function createSerperPlacesSearch(deps: ToolDependencies): Tool;
|
|
516
|
+
|
|
517
|
+
interface SerperPlaceItem {
|
|
518
|
+
title: string;
|
|
519
|
+
address: string;
|
|
520
|
+
phoneNumber?: string;
|
|
521
|
+
latitude?: number;
|
|
522
|
+
longitude?: number;
|
|
523
|
+
rating?: number;
|
|
524
|
+
ratingCount?: number;
|
|
525
|
+
type?: string;
|
|
526
|
+
website?: string;
|
|
527
|
+
cid?: string;
|
|
528
|
+
}
|
|
529
|
+
interface SerperPlacesSearchResponse {
|
|
530
|
+
places?: SerperPlaceItem[];
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
declare const HEADERS: (apiKey: string) => {
|
|
534
|
+
'X-API-KEY': string;
|
|
535
|
+
'Content-Type': string;
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
declare const serperShoppingSearchSchema: z.ZodObject<{
|
|
539
|
+
query: z.ZodString;
|
|
540
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
541
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
542
|
+
}, z.core.$strip>;
|
|
543
|
+
type SerperShoppingSearchInput = z.infer<typeof serperShoppingSearchSchema>;
|
|
544
|
+
|
|
545
|
+
declare function createSerperShoppingSearch(deps: ToolDependencies): Tool;
|
|
546
|
+
|
|
547
|
+
interface SerperShoppingItem {
|
|
548
|
+
title: string;
|
|
549
|
+
link: string;
|
|
550
|
+
price: string;
|
|
551
|
+
source: string;
|
|
552
|
+
imageUrl?: string;
|
|
553
|
+
delivery?: string;
|
|
554
|
+
rating?: number;
|
|
555
|
+
ratingCount?: number;
|
|
556
|
+
}
|
|
557
|
+
interface SerperShoppingSearchResponse {
|
|
558
|
+
shopping?: SerperShoppingItem[];
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
declare const serperVideoSearchSchema: z.ZodObject<{
|
|
562
|
+
query: z.ZodString;
|
|
563
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
564
|
+
recency: z.ZodOptional<z.ZodEnum<{
|
|
565
|
+
day: "day";
|
|
566
|
+
week: "week";
|
|
567
|
+
month: "month";
|
|
568
|
+
year: "year";
|
|
569
|
+
}>>;
|
|
570
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
571
|
+
}, z.core.$strip>;
|
|
572
|
+
type SerperVideoSearchInput = z.infer<typeof serperVideoSearchSchema>;
|
|
573
|
+
|
|
574
|
+
declare function createSerperVideoSearch(deps: ToolDependencies): Tool;
|
|
575
|
+
|
|
576
|
+
interface SerperVideoItem {
|
|
577
|
+
title: string;
|
|
578
|
+
link: string;
|
|
579
|
+
snippet: string;
|
|
580
|
+
channel: string;
|
|
581
|
+
duration: string;
|
|
582
|
+
date: string;
|
|
583
|
+
imageUrl: string;
|
|
584
|
+
source?: string;
|
|
585
|
+
views: number;
|
|
586
|
+
}
|
|
587
|
+
interface SerperVideoSearchResponse {
|
|
588
|
+
videos?: SerperVideoItem[];
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
declare const serperWebSearchSchema: z.ZodObject<{
|
|
592
|
+
query: z.ZodString;
|
|
593
|
+
recency: z.ZodOptional<z.ZodEnum<{
|
|
594
|
+
day: "day";
|
|
595
|
+
week: "week";
|
|
596
|
+
month: "month";
|
|
597
|
+
year: "year";
|
|
598
|
+
}>>;
|
|
599
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
600
|
+
}, z.core.$strip>;
|
|
601
|
+
type SerperWebSearchInput = z.infer<typeof serperWebSearchSchema>;
|
|
602
|
+
|
|
603
|
+
declare function createSerperWebSearch(deps: ToolDependencies): Tool;
|
|
604
|
+
|
|
605
|
+
interface SerperOrganicResult {
|
|
606
|
+
title: string;
|
|
607
|
+
link: string;
|
|
608
|
+
snippet: string;
|
|
609
|
+
}
|
|
610
|
+
interface SerperWebSearchResponse {
|
|
611
|
+
organic?: SerperOrganicResult[];
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
declare const serperWebpageScrapeSchema: z.ZodObject<{
|
|
615
|
+
url: z.ZodString;
|
|
616
|
+
}, z.core.$strip>;
|
|
617
|
+
type SerperWebpageScrapeInput = z.infer<typeof serperWebpageScrapeSchema>;
|
|
618
|
+
|
|
619
|
+
declare function createSerperWebpageScrape(deps: ToolDependencies): Tool;
|
|
620
|
+
|
|
621
|
+
interface SerperWebpageScrapeResponse {
|
|
622
|
+
text?: string;
|
|
623
|
+
title?: string;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
type ToolSummaryFn = (data: Record<string, unknown>) => Record<string, unknown>;
|
|
627
|
+
|
|
628
|
+
type ToolWithSummary = Tool & {
|
|
629
|
+
summarize?: ToolSummaryFn;
|
|
630
|
+
};
|
|
631
|
+
declare const summarizeResults: ToolSummaryFn;
|
|
632
|
+
declare const summarizeContent: ToolSummaryFn;
|
|
633
|
+
declare const summarizeFound: ToolSummaryFn;
|
|
634
|
+
declare const defaultSummarize: ToolSummaryFn;
|
|
635
|
+
declare function withSummary(tool: Tool, summarize?: ToolSummaryFn): ToolWithSummary;
|
|
636
|
+
|
|
637
|
+
declare const webFetchSchema: z.ZodObject<{
|
|
638
|
+
url: z.ZodString;
|
|
639
|
+
}, z.core.$strip>;
|
|
640
|
+
type WebFetchInput = z.infer<typeof webFetchSchema>;
|
|
641
|
+
|
|
642
|
+
declare function createWebFetchTool(): Tool;
|
|
643
|
+
|
|
644
|
+
declare function createYoutubeVideoSearch(deps: ToolDependencies): Tool;
|
|
645
|
+
|
|
646
|
+
declare const youtubeVideoSearchSchema: z.ZodObject<{
|
|
647
|
+
query: z.ZodString;
|
|
648
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
649
|
+
recency: z.ZodOptional<z.ZodEnum<{
|
|
650
|
+
day: "day";
|
|
651
|
+
week: "week";
|
|
652
|
+
month: "month";
|
|
653
|
+
year: "year";
|
|
654
|
+
}>>;
|
|
655
|
+
lang: z.ZodOptional<z.ZodString>;
|
|
656
|
+
}, z.core.$strip>;
|
|
657
|
+
type YoutubeVideoSearchInput = z.infer<typeof youtubeVideoSearchSchema>;
|
|
658
|
+
|
|
659
|
+
interface YoutubeSearchResponseItem {
|
|
660
|
+
id?: {
|
|
661
|
+
kind?: string;
|
|
662
|
+
videoId?: string;
|
|
663
|
+
};
|
|
664
|
+
snippet?: {
|
|
665
|
+
title?: string;
|
|
666
|
+
description?: string;
|
|
667
|
+
channelTitle?: string;
|
|
668
|
+
publishedAt?: string;
|
|
669
|
+
thumbnails?: Record<string, {
|
|
670
|
+
url?: string;
|
|
671
|
+
} | undefined>;
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
interface YoutubeSearchResponse {
|
|
675
|
+
items?: YoutubeSearchResponseItem[];
|
|
676
|
+
}
|
|
677
|
+
interface YoutubeVideosResponseItem {
|
|
678
|
+
id?: string;
|
|
679
|
+
statistics?: {
|
|
680
|
+
viewCount?: string;
|
|
681
|
+
};
|
|
682
|
+
contentDetails?: {
|
|
683
|
+
duration?: string;
|
|
684
|
+
};
|
|
685
|
+
snippet?: {
|
|
686
|
+
defaultLanguage?: string;
|
|
687
|
+
defaultAudioLanguage?: string;
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
interface YoutubeVideosResponse {
|
|
691
|
+
items?: YoutubeVideosResponseItem[];
|
|
692
|
+
}
|
|
693
|
+
interface VideoStats {
|
|
694
|
+
viewCount: number;
|
|
695
|
+
duration?: string;
|
|
696
|
+
lang?: string;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
export { BRIGHT_DATA_TIMEOUT_MS, type BrightDataConfig, type BrightDataImageSearchInput, type BrightDataImageSearchResponse, type BrightDataNewsSearchInput, type BrightDataNewsSearchResponse, type BrightDataPlacesSearchInput, type BrightDataPlacesSearchResponse, type BrightDataShoppingSearchInput, type BrightDataShoppingSearchResponse, type BrightDataVideoSearchInput, type BrightDataVideoSearchResponse, type BrightDataWebSearchInput, type BrightDataWebSearchResponse, type BrightDataWebpageScrapeInput, type BrightDataWebpageScrapeResponse, type EodhdConfig, type EodhdNewsConfig, type FilterVariant, HEADERS, MIN_IMAGE_HEIGHT, MIN_IMAGE_WIDTH, type MarketDailyBar, type MemoryDeleteInput, type MemoryPoint, type MemoryRecallInput, type MemoryRememberInput, type MemoryRole, type MemoryToolScope, type ProviderEndpointConfig, RECENCY_DESCRIPTION, type ResolvableOffer, SEARCH_RETRIES, SEARCH_TIMEOUT_MS, SOURCE, STANDALONE_QUERY_DESCRIPTION, STANDALONE_QUERY_TOOL_CLAUSE, type SearchRecency, type SerperBusinessReviewsSearchInput, type SerperBusinessReviewsSearchResponse, type SerperConfig, type SerperImageSearchInput, type SerperImageSearchResponse, type SerperNewsSearchInput, type SerperNewsSearchResponse, type SerperPlacesSearchInput, type SerperPlacesSearchResponse, type SerperShoppingSearchInput, type SerperShoppingSearchResponse, type SerperVideoSearchInput, type SerperVideoSearchResponse, type SerperWebSearchInput, type SerperWebSearchResponse, type SerperWebpageScrapeInput, type SerperWebpageScrapeResponse, type SourcesConfig, type ToolConfigSnapshot, type ToolDependencies, type ToolLogger, type ToolSummaryFn, type ToolWithSummary, type Variant, type VideoStats, type WebFetchInput, type YoutubeConfig, type YoutubeSearchResponse, type YoutubeVideoSearchInput, type YoutubeVideosResponse, applyLocaleParams, applyRecencyParam, brightDataImageSearchSchema, brightDataNewsSearchSchema, brightDataPlacesSearchSchema, brightDataShoppingSearchSchema, brightDataVideoSearchSchema, brightDataWebSearchSchema, brightDataWebpageScrapeSchema, buildGoogleUrl, buildYoutubeThumbnailUrl, createBrightDataImageSearch, createBrightDataNewsSearch, createBrightDataPlacesSearch, createBrightDataShoppingSearch, createBrightDataVideoSearch, createBrightDataWebSearch, createBrightDataWebpageScrape, createMemoryDeleteTool, createMemoryRecallTool, createMemoryRememberTool, createSerperBusinessReviewsSearch, createSerperImageSearch, createSerperNewsSearch, createSerperPlacesSearch, createSerperShoppingSearch, createSerperVideoSearch, createSerperWebSearch, createSerperWebpageScrape, createVariantRequestTool, createWebFetchTool, createYoutubeVideoSearch, defaultSummarize, engineEnabled, fetchWithTimeout, isGoogleHostUrl, localizedQuerySuffix, meetsMinimumImageDimensions, memoryDeleteSchema, memoryRecallSchema, memoryRememberSchema, pickMerchantResult, requestBrightData, resolveSerperShopOfferLinks, serperBusinessReviewsSearchSchema, serperImageSearchSchema, serperNewsSearchSchema, serperPlacesSearchSchema, serperShoppingSearchSchema, serperVideoSearchSchema, serperWebSearchSchema, serperWebpageScrapeSchema, storeHostToken, summarizeContent, summarizeFound, summarizeResults, tbsSizeLabelForPixels, variantRequestSchema, webFetchSchema, withSummary, youtubeVideoSearchSchema };
|