@fffangchenghao/dsh-web-search 0.10.0 → 0.11.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.
@@ -0,0 +1,539 @@
1
+ import { SearchError } from "./errors.js";
2
+ import { text } from "./parsers.js";
3
+ import { proxyGet } from "./proxy.js";
4
+ /** Every supported source, in the order results are interleaved. */
5
+ export const VERTICAL_IDS = [
6
+ 'github',
7
+ 'npm',
8
+ 'pypi',
9
+ 'arxiv',
10
+ 'wikipedia',
11
+ 'hn',
12
+ 'stackexchange',
13
+ 'crates',
14
+ ];
15
+ /** Default and maximum result budget for one source. */
16
+ export const DEFAULT_VERTICAL_LIMIT = 5;
17
+ /** Upper bound the tool and the adapters both respect. */
18
+ export const MAX_VERTICAL_LIMIT = 20;
19
+ /** The user agent every source sees. GitHub and crates.io both require one. */
20
+ const USER_AGENT = 'dsh-web-search/0.10 (+https://github.com/fangchenghao/dsh-web-search-bing)';
21
+ /** Scripts that make a query CJK rather than ASCII. */
22
+ const CJK = /[\u3000-\u303f\u3040-\u30ff\u3400-\u9fff\uf900-\ufaff\uff00-\uffef]/u;
23
+ /** True for a value usable as a JSON record. */
24
+ function isRecord(value) {
25
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
26
+ }
27
+ /** Parse JSON without throwing; `undefined` means "not JSON". */
28
+ function parseJson(payload) {
29
+ try {
30
+ return JSON.parse(payload);
31
+ }
32
+ catch {
33
+ return undefined;
34
+ }
35
+ }
36
+ /** Read a string field, trimmed; anything else becomes the empty string. */
37
+ function str(value) {
38
+ return typeof value === 'string' ? value.trim() : '';
39
+ }
40
+ /** Turn one URL into a citable http(s) URL, or drop it. */
41
+ function webUrl(raw) {
42
+ if (typeof raw !== 'string' || raw.trim().length === 0)
43
+ return undefined;
44
+ try {
45
+ const url = new URL(raw.trim());
46
+ if (url.protocol !== 'http:' && url.protocol !== 'https:')
47
+ return undefined;
48
+ return url.toString();
49
+ }
50
+ catch {
51
+ return undefined;
52
+ }
53
+ }
54
+ /** Strip markup and collapse whitespace, then bound the snippet length. */
55
+ function snippetOf(value, max = 400) {
56
+ const clean = text(value);
57
+ return clean.length > max ? `${clean.slice(0, max).trimEnd()}…` : clean;
58
+ }
59
+ /** Build one source, dropping rows that carry no citable URL. */
60
+ function sourceOf(rawUrl, title, snippet, publishedAt) {
61
+ const url = webUrl(rawUrl);
62
+ if (url === undefined)
63
+ return undefined;
64
+ return {
65
+ url,
66
+ ...(title.length > 0 ? { title } : {}),
67
+ ...(snippet.length > 0 ? { snippet } : {}),
68
+ ...(publishedAt !== undefined && publishedAt.length > 0 ? { publishedAt } : {}),
69
+ };
70
+ }
71
+ /** Clamp a caller budget into the range every adapter can serve. */
72
+ function clampLimit(value) {
73
+ if (typeof value !== 'number' || !Number.isFinite(value))
74
+ return DEFAULT_VERTICAL_LIMIT;
75
+ return Math.max(1, Math.min(MAX_VERTICAL_LIMIT, Math.floor(value)));
76
+ }
77
+ /** Read one XML/Atom tag's text, with entities decoded. */
78
+ function tag(block, name) {
79
+ const match = new RegExp(`<${name}\\b[^>]*>([\\s\\S]*?)<\\/${name}>`, 'i').exec(block);
80
+ return match === null ? '' : text(match[1]);
81
+ }
82
+ /**
83
+ * Parse GitHub's repository search envelope.
84
+ * @param payload - `api.github.com/search/repositories` JSON.
85
+ * @param _url - request URL, unused by this JSON shape.
86
+ * @param limit - rows to keep.
87
+ * @returns repositories as sources, in API order.
88
+ */
89
+ export function parseGithub(payload, _url, limit = MAX_VERTICAL_LIMIT) {
90
+ const body = parseJson(payload);
91
+ if (!isRecord(body) || !Array.isArray(body.items))
92
+ return [];
93
+ const sources = [];
94
+ for (const row of body.items) {
95
+ if (!isRecord(row))
96
+ continue;
97
+ const name = str(row.full_name) || str(row.name);
98
+ const source = sourceOf(str(row.html_url) || (name.length > 0 ? `https://github.com/${name}` : undefined), name, snippetOf(row.description), str(row.pushed_at) || str(row.updated_at));
99
+ if (source !== undefined)
100
+ sources.push(source);
101
+ if (sources.length >= limit)
102
+ break;
103
+ }
104
+ return sources;
105
+ }
106
+ /**
107
+ * Parse npm's registry search envelope.
108
+ * @param payload - `registry.npmjs.org/-/v1/search` JSON.
109
+ * @param _url - request URL, unused by this JSON shape.
110
+ * @param limit - rows to keep.
111
+ * @returns packages as sources.
112
+ */
113
+ export function parseNpm(payload, _url, limit = MAX_VERTICAL_LIMIT) {
114
+ const body = parseJson(payload);
115
+ if (!isRecord(body) || !Array.isArray(body.objects))
116
+ return [];
117
+ const sources = [];
118
+ for (const row of body.objects) {
119
+ if (!isRecord(row) || !isRecord(row.package))
120
+ continue;
121
+ const pkg = row.package;
122
+ const name = str(pkg.name);
123
+ if (name.length === 0)
124
+ continue;
125
+ const version = str(pkg.version);
126
+ const links = isRecord(pkg.links) ? pkg.links : undefined;
127
+ const source = sourceOf(str(links?.npm) || str(links?.homepage) || `https://www.npmjs.com/package/${name}`, version.length > 0 ? `${name}@${version}` : name, snippetOf(pkg.description), str(row.date) || str(row.updated));
128
+ if (source !== undefined)
129
+ sources.push(source);
130
+ if (sources.length >= limit)
131
+ break;
132
+ }
133
+ return sources;
134
+ }
135
+ /**
136
+ * Parse PyPI's exact-package envelope.
137
+ *
138
+ * PyPI no longer publishes a credential-free search API, so the adapter asks
139
+ * for the query as a package name. A 404 is handled by the orchestrator
140
+ * (`notFoundIsEmpty`) and never reaches this parser; a body without `info`
141
+ * still parses to `[]`.
142
+ * @param payload - `pypi.org/pypi/<name>/json`.
143
+ * @param _url - request URL, unused by this JSON shape.
144
+ * @param limit - rows to keep (PyPI answers one).
145
+ * @returns the package as one source, or `[]`.
146
+ */
147
+ export function parsePypi(payload, _url, limit = MAX_VERTICAL_LIMIT) {
148
+ if (limit < 1)
149
+ return [];
150
+ const body = parseJson(payload);
151
+ if (!isRecord(body) || !isRecord(body.info))
152
+ return [];
153
+ const info = body.info;
154
+ const name = str(info.name);
155
+ if (name.length === 0)
156
+ return [];
157
+ const version = str(info.version);
158
+ const urls = Array.isArray(body.urls) ? body.urls : [];
159
+ const first = isRecord(urls[0]) ? urls[0] : undefined;
160
+ const source = sourceOf(str(info.package_url) || `https://pypi.org/project/${encodeURIComponent(name)}/`, version.length > 0 ? `${name} ${version}` : name, snippetOf(info.summary), str(first?.upload_time_iso_8601) || str(first?.upload_time));
161
+ return source === undefined ? [] : [source];
162
+ }
163
+ /**
164
+ * Parse the arXiv Atom feed.
165
+ * @param payload - `export.arxiv.org/api/query` XML.
166
+ * @param _url - request URL, unused by this XML shape.
167
+ * @param limit - entries to keep.
168
+ * @returns papers as sources, in feed order.
169
+ */
170
+ export function parseArxiv(payload, _url, limit = MAX_VERTICAL_LIMIT) {
171
+ if (typeof payload !== 'string')
172
+ return [];
173
+ const sources = [];
174
+ for (const match of payload.matchAll(/<entry\b[^>]*>([\s\S]*?)<\/entry>/gi)) {
175
+ const block = match[1] ?? '';
176
+ const id = tag(block, 'id');
177
+ const title = tag(block, 'title');
178
+ const summary = tag(block, 'summary');
179
+ const published = tag(block, 'published') || tag(block, 'updated');
180
+ // The feed's own id uses plain http; the canonical page is https.
181
+ const page = id.replace(/^http:\/\//i, 'https://');
182
+ const source = sourceOf(page, title, snippetOf(summary), published);
183
+ if (source !== undefined)
184
+ sources.push(source);
185
+ if (sources.length >= limit)
186
+ break;
187
+ }
188
+ return sources;
189
+ }
190
+ /**
191
+ * Parse Wikipedia's REST search envelope (zh or en host).
192
+ * @param payload - `*.wikipedia.org/w/rest.php/v1/search/page` JSON.
193
+ * @param finalUrl - the request URL, whose host decides the wiki language.
194
+ * @param limit - pages to keep.
195
+ * @returns wiki pages as sources.
196
+ */
197
+ export function parseWikipedia(payload, finalUrl, limit = MAX_VERTICAL_LIMIT) {
198
+ const body = parseJson(payload);
199
+ if (!isRecord(body) || !Array.isArray(body.pages))
200
+ return [];
201
+ let language = 'en';
202
+ try {
203
+ if (new URL(finalUrl).hostname.startsWith('zh.'))
204
+ language = 'zh';
205
+ }
206
+ catch {
207
+ // Keep the English default; the parser still answers.
208
+ }
209
+ const sources = [];
210
+ for (const row of body.pages) {
211
+ if (!isRecord(row))
212
+ continue;
213
+ const key = str(row.key) || str(row.title);
214
+ if (key.length === 0)
215
+ continue;
216
+ const title = str(row.title) || key;
217
+ const excerpt = snippetOf(row.excerpt) || snippetOf(row.description);
218
+ const page = `https://${language}.wikipedia.org/wiki/${encodeURIComponent(key.replace(/ /g, '_'))}`;
219
+ const source = sourceOf(page, title, excerpt);
220
+ if (source !== undefined)
221
+ sources.push(source);
222
+ if (sources.length >= limit)
223
+ break;
224
+ }
225
+ return sources;
226
+ }
227
+ /**
228
+ * Parse Hacker News's Algolia search envelope.
229
+ * @param payload - `hn.algolia.com/api/v1/search` JSON.
230
+ * @param _url - request URL, unused by this JSON shape.
231
+ * @param limit - hits to keep.
232
+ * @returns stories or comments as sources.
233
+ */
234
+ export function parseHn(payload, _url, limit = MAX_VERTICAL_LIMIT) {
235
+ const body = parseJson(payload);
236
+ if (!isRecord(body) || !Array.isArray(body.hits))
237
+ return [];
238
+ const sources = [];
239
+ for (const row of body.hits) {
240
+ if (!isRecord(row))
241
+ continue;
242
+ const objectId = str(row.objectID);
243
+ const fallback = objectId.length > 0 ? `https://news.ycombinator.com/item?id=${objectId}` : undefined;
244
+ const highlighted = isRecord(row._highlightResult) && isRecord(row._highlightResult.title)
245
+ ? row._highlightResult.title.value
246
+ : undefined;
247
+ const title = str(row.title) || str(row.story_title) || snippetOf(highlighted, 120);
248
+ const snippet = snippetOf(row.story_text) || snippetOf(row.comment_text);
249
+ const source = sourceOf(str(row.url) || fallback, title, snippet, str(row.created_at));
250
+ if (source !== undefined)
251
+ sources.push(source);
252
+ if (sources.length >= limit)
253
+ break;
254
+ }
255
+ return sources;
256
+ }
257
+ /**
258
+ * Parse Stack Exchange's advanced-search envelope.
259
+ * @param payload - `api.stackexchange.com/2.3/search/advanced` JSON.
260
+ * @param _url - request URL, unused by this JSON shape.
261
+ * @param limit - questions to keep.
262
+ * @returns questions as sources.
263
+ */
264
+ export function parseStackExchange(payload, _url, limit = MAX_VERTICAL_LIMIT) {
265
+ const body = parseJson(payload);
266
+ if (!isRecord(body) || !Array.isArray(body.items))
267
+ return [];
268
+ const sources = [];
269
+ for (const row of body.items) {
270
+ if (!isRecord(row))
271
+ continue;
272
+ const created = typeof row.creation_date === 'number' && Number.isFinite(row.creation_date)
273
+ ? new Date(row.creation_date * 1000).toISOString()
274
+ : undefined;
275
+ const source = sourceOf(str(row.link), str(row.title), snippetOf(row.body), created);
276
+ if (source !== undefined)
277
+ sources.push(source);
278
+ if (sources.length >= limit)
279
+ break;
280
+ }
281
+ return sources;
282
+ }
283
+ /**
284
+ * Parse crates.io's crate search envelope.
285
+ * @param payload - `crates.io/api/v1/crates` JSON.
286
+ * @param _url - request URL, unused by this JSON shape.
287
+ * @param limit - crates to keep.
288
+ * @returns crates as sources.
289
+ */
290
+ export function parseCrates(payload, _url, limit = MAX_VERTICAL_LIMIT) {
291
+ const body = parseJson(payload);
292
+ if (!isRecord(body) || !Array.isArray(body.crates))
293
+ return [];
294
+ const sources = [];
295
+ for (const row of body.crates) {
296
+ if (!isRecord(row))
297
+ continue;
298
+ const name = str(row.name);
299
+ if (name.length === 0)
300
+ continue;
301
+ const version = str(row.max_version) || str(row.newest_version);
302
+ const source = sourceOf(`https://crates.io/crates/${encodeURIComponent(name)}`, version.length > 0 ? `${name} ${version}` : name, snippetOf(row.description), str(row.updated_at));
303
+ if (source !== undefined)
304
+ sources.push(source);
305
+ if (sources.length >= limit)
306
+ break;
307
+ }
308
+ return sources;
309
+ }
310
+ /** A source id that this module actually knows. */
311
+ export function isVerticalId(value) {
312
+ return typeof value === 'string' && VERTICAL_IDS.includes(value);
313
+ }
314
+ /** Every adapter, keyed by id. */
315
+ export const VERTICALS = [
316
+ {
317
+ id: 'github',
318
+ label: 'GitHub',
319
+ accept: 'application/vnd.github+json',
320
+ headers: { 'x-github-api-version': '2022-11-28' },
321
+ build: (query, limit) => `https://api.github.com/search/repositories?q=${encodeURIComponent(query)}&per_page=${limit}`,
322
+ parse: parseGithub,
323
+ },
324
+ {
325
+ id: 'npm',
326
+ label: 'npm',
327
+ accept: 'application/json',
328
+ build: (query, limit) => `https://registry.npmjs.org/-/v1/search?text=${encodeURIComponent(query)}&size=${limit}`,
329
+ parse: parseNpm,
330
+ },
331
+ {
332
+ id: 'pypi',
333
+ label: 'PyPI',
334
+ accept: 'application/json',
335
+ notFoundIsEmpty: true,
336
+ // PyPI has no credential-free search API. The first token is the package
337
+ // name; a descriptive query (`requests http`) still resolves `requests`.
338
+ build: (query, _limit) => {
339
+ const name = query.trim().split(/\s+/)[0] ?? query.trim();
340
+ return `https://pypi.org/pypi/${encodeURIComponent(name)}/json`;
341
+ },
342
+ parse: parsePypi,
343
+ },
344
+ {
345
+ id: 'arxiv',
346
+ label: 'arXiv',
347
+ accept: 'application/atom+xml',
348
+ build: (query, limit) => `https://export.arxiv.org/api/query?search_query=all:${encodeURIComponent(query)}&start=0&max_results=${limit}`,
349
+ parse: parseArxiv,
350
+ },
351
+ {
352
+ id: 'wikipedia',
353
+ label: 'Wikipedia',
354
+ accept: 'application/json',
355
+ build: (query, limit) => {
356
+ const language = CJK.test(query) ? 'zh' : 'en';
357
+ return `https://${language}.wikipedia.org/w/rest.php/v1/search/page?q=${encodeURIComponent(query)}&limit=${limit}`;
358
+ },
359
+ parse: parseWikipedia,
360
+ },
361
+ {
362
+ id: 'hn',
363
+ label: 'Hacker News',
364
+ accept: 'application/json',
365
+ build: (query, limit) => `https://hn.algolia.com/api/v1/search?query=${encodeURIComponent(query)}&hitsPerPage=${limit}`,
366
+ parse: parseHn,
367
+ },
368
+ {
369
+ id: 'stackexchange',
370
+ label: 'Stack Exchange',
371
+ accept: 'application/json',
372
+ build: (query, limit) => `https://api.stackexchange.com/2.3/search/advanced?order=desc&sort=relevance&q=${encodeURIComponent(query)}&site=stackoverflow&pagesize=${limit}&filter=withbody`,
373
+ parse: parseStackExchange,
374
+ },
375
+ {
376
+ id: 'crates',
377
+ label: 'crates.io',
378
+ accept: 'application/json',
379
+ build: (query, limit) => `https://crates.io/api/v1/crates?q=${encodeURIComponent(query)}&per_page=${limit}`,
380
+ parse: parseCrates,
381
+ },
382
+ ];
383
+ /** One adapter by id, or `undefined` for a typo. */
384
+ export function verticalById(id) {
385
+ return VERTICALS.find((spec) => spec.id === id);
386
+ }
387
+ /** Classify a non-2xx status into the shared business codes. */
388
+ function statusError(status) {
389
+ if (status === 429)
390
+ return new SearchError('HTTP 429', 'SEARCH_THROTTLED');
391
+ if (status === 403)
392
+ return new SearchError('HTTP 403', 'SEARCH_BLOCKED');
393
+ if (status >= 500)
394
+ return new SearchError(`HTTP ${status}`, 'SEARCH_NETWORK');
395
+ if (status === 0)
396
+ return new SearchError('no response', 'SEARCH_NETWORK');
397
+ return new SearchError(`HTTP ${status}`, 'SEARCH_BLOCKED');
398
+ }
399
+ /** Classify a thrown transport failure. */
400
+ function thrownError(error) {
401
+ const message = error instanceof Error ? error.message : String(error);
402
+ const name = error instanceof Error ? error.name : '';
403
+ if (name === 'TimeoutError' || /timed out|timeout/i.test(message)) {
404
+ return new SearchError(message, 'SEARCH_TIMEOUT');
405
+ }
406
+ return new SearchError(message, 'SEARCH_NETWORK');
407
+ }
408
+ /** Combine the caller signal with this request's own deadline. */
409
+ function deadline(timeoutMs, signal) {
410
+ const timer = AbortSignal.timeout(timeoutMs);
411
+ return signal === undefined ? timer : AbortSignal.any([signal, timer]);
412
+ }
413
+ /**
414
+ * Ask one source once and return its payload.
415
+ *
416
+ * Non-2xx answers become {@link SearchError}; a 404 for a source marked
417
+ * `notFoundIsEmpty` is returned as an empty payload so the parser reports "no
418
+ * such record" instead of the run reporting a broken source.
419
+ * @param spec - the adapter.
420
+ * @param url - absolute request URL.
421
+ * @param options - deadline, cancellation, optional tunnel and fetch seam.
422
+ * @returns the response body, or `''` for an accepted 404.
423
+ */
424
+ async function fetchPayload(spec, url, options, timeoutMs) {
425
+ const headers = {
426
+ 'user-agent': USER_AGENT,
427
+ accept: spec.accept,
428
+ 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8',
429
+ ...spec.headers,
430
+ };
431
+ let status = 0;
432
+ let payload = '';
433
+ try {
434
+ if (options.proxy !== undefined && options.proxy.length > 0) {
435
+ const response = await proxyGet(url, {
436
+ proxy: options.proxy,
437
+ headers,
438
+ timeoutMs,
439
+ ...(options.signal === undefined ? {} : { signal: options.signal }),
440
+ });
441
+ status = response.status;
442
+ payload = response.text;
443
+ }
444
+ else {
445
+ const send = options.fetch ?? fetch;
446
+ const response = await send(url, {
447
+ headers,
448
+ redirect: 'follow',
449
+ signal: deadline(timeoutMs, options.signal),
450
+ });
451
+ status = response.status;
452
+ payload = response.ok ? await response.text() : '';
453
+ }
454
+ }
455
+ catch (error) {
456
+ if (options.signal?.aborted === true)
457
+ throw error;
458
+ throw thrownError(error);
459
+ }
460
+ if (status === 404 && spec.notFoundIsEmpty === true)
461
+ return '';
462
+ if (status < 200 || status >= 300)
463
+ throw statusError(status);
464
+ return payload;
465
+ }
466
+ /** Render one failure as `id: reason`, without doubling an existing id. */
467
+ function failureText(id, error) {
468
+ const message = error instanceof Error ? error.message : String(error);
469
+ return message.startsWith(`${id}: `) ? message : `${id}: ${message}`;
470
+ }
471
+ /**
472
+ * Query every requested vertical concurrently and merge the answers.
473
+ *
474
+ * One source failing never fails the run: its reason is recorded in
475
+ * `failures`, its count stays `0`, and the other sources still answer. Answers
476
+ * are interleaved by rank (one row from each source, then the second row from
477
+ * each) so a single prolific source cannot crowd the others out.
478
+ *
479
+ * @param query - what to search for; must be non-empty.
480
+ * @param options - sources, budget, deadline, cancellation, tunnel, fetch seam.
481
+ * @returns merged sources plus per-source counts and failures.
482
+ * @throws SearchError `SEARCH_ABORTED` when the caller cancelled the run.
483
+ */
484
+ export async function searchVerticals(query, options = {}) {
485
+ const trimmed = typeof query === 'string' ? query.trim() : '';
486
+ if (trimmed.length === 0)
487
+ return { sources: [], failures: [], counts: {}, truncated: false };
488
+ const limit = clampLimit(options.limit);
489
+ const timeoutMs = typeof options.timeoutMs === 'number' && Number.isFinite(options.timeoutMs) && options.timeoutMs > 0
490
+ ? options.timeoutMs
491
+ : 8000;
492
+ const requested = (options.ids ?? []).filter(isVerticalId);
493
+ const specs = (requested.length > 0 ? VERTICAL_IDS.filter((id) => requested.includes(id)) : VERTICAL_IDS)
494
+ .map((id) => verticalById(id))
495
+ .filter((spec) => spec !== undefined);
496
+ const answers = await Promise.all(specs.map(async (spec) => {
497
+ try {
498
+ const url = spec.build(trimmed, limit);
499
+ const payload = await fetchPayload(spec, url, options, timeoutMs);
500
+ const sources = spec.parse(payload, url, limit);
501
+ return { id: spec.id, sources };
502
+ }
503
+ catch (error) {
504
+ return { id: spec.id, failure: failureText(spec.id, error) };
505
+ }
506
+ }));
507
+ if (options.signal?.aborted === true) {
508
+ throw new SearchError('domain search was cancelled', 'SEARCH_ABORTED', false);
509
+ }
510
+ const counts = {};
511
+ const failures = [];
512
+ let sourceRanks = 0;
513
+ for (const answer of answers) {
514
+ counts[answer.id] = 'sources' in answer ? answer.sources.length : 0;
515
+ if ('sources' in answer)
516
+ sourceRanks = Math.max(sourceRanks, answer.sources.length);
517
+ if ('failure' in answer)
518
+ failures.push(answer.failure);
519
+ }
520
+ const merged = [];
521
+ const seen = new Set();
522
+ for (let rank = 0; rank < sourceRanks; rank += 1) {
523
+ for (const answer of answers) {
524
+ if (!('sources' in answer))
525
+ continue;
526
+ const source = answer.sources[rank];
527
+ if (source === undefined || seen.has(source.url))
528
+ continue;
529
+ seen.add(source.url);
530
+ merged.push(source);
531
+ }
532
+ }
533
+ return {
534
+ sources: merged.slice(0, limit),
535
+ failures,
536
+ counts,
537
+ truncated: merged.length > limit,
538
+ };
539
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fffangchenghao/dsh-web-search",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "DSH bundle: a key-free web search provider. Leads with the anonymous AnySearch API and falls back to public result pages (DuckDuckGo, Bing, 360), merged by reciprocal-rank fusion with a bilingual region policy, an engine cooldown and a TTL cache.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -65,11 +65,11 @@
65
65
  "author": "fangchenghao",
66
66
  "repository": {
67
67
  "type": "git",
68
- "url": "git+https://github.com/fangchenghao/dsh-web-search-bing.git"
68
+ "url": "git+https://github.com/fangchenghao/dsh-web-search.git"
69
69
  },
70
- "homepage": "https://github.com/fangchenghao/dsh-web-search-bing#readme",
70
+ "homepage": "https://github.com/fangchenghao/dsh-web-search#readme",
71
71
  "bugs": {
72
- "url": "https://github.com/fangchenghao/dsh-web-search-bing/issues"
72
+ "url": "https://github.com/fangchenghao/dsh-web-search/issues"
73
73
  },
74
74
  "publishConfig": {
75
75
  "access": "public"