search-web-api 1.0.76 → 1.0.78

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 (77) hide show
  1. package/README.md +0 -3
  2. package/bun.lock +644 -0
  3. package/package.json +5 -2
  4. package/src/search/__tests__/public-searxng.test.ts +37 -17
  5. package/src/sources/academic/arxiv.ts +3 -0
  6. package/src/sources/academic/core.ts +3 -0
  7. package/src/sources/academic/crossref.ts +3 -0
  8. package/src/sources/academic/doaj.ts +3 -0
  9. package/src/sources/academic/google_scholar.ts +3 -0
  10. package/src/sources/academic/openalex.ts +3 -0
  11. package/src/sources/academic/pubmed.ts +3 -0
  12. package/src/sources/academic/semantic_scholar.ts +3 -0
  13. package/src/sources/academic/wikidata.ts +3 -0
  14. package/src/sources/general/baidu.ts +3 -0
  15. package/src/sources/general/bing.ts +3 -0
  16. package/src/sources/general/brave.ts +3 -0
  17. package/src/sources/general/duckduckgo.ts +3 -0
  18. package/src/sources/general/google.ts +3 -0
  19. package/src/sources/general/mojeek.ts +3 -0
  20. package/src/sources/general/qwant.ts +3 -0
  21. package/src/sources/general/startpage.ts +3 -0
  22. package/src/sources/general/yahoo.ts +3 -0
  23. package/src/sources/general/yandex.ts +3 -0
  24. package/src/sources/images/bing_images.ts +3 -0
  25. package/src/sources/images/deviantart.ts +3 -0
  26. package/src/sources/images/flickr.ts +3 -0
  27. package/src/sources/images/google_images.ts +3 -0
  28. package/src/sources/images/imgur.ts +3 -0
  29. package/src/sources/images/openclipart.ts +3 -0
  30. package/src/sources/images/pixabay.ts +3 -0
  31. package/src/sources/images/unsplash.ts +3 -0
  32. package/src/sources/images/wallhaven.ts +3 -0
  33. package/src/sources/it/crates.ts +3 -0
  34. package/src/sources/it/dockerhub.ts +3 -0
  35. package/src/sources/it/github.ts +3 -0
  36. package/src/sources/it/gitlab.ts +3 -0
  37. package/src/sources/it/npm.ts +3 -0
  38. package/src/sources/it/packagist.ts +3 -0
  39. package/src/sources/it/pypi.ts +3 -0
  40. package/src/sources/it/rubygems.ts +3 -0
  41. package/src/sources/it/stackoverflow.ts +3 -0
  42. package/src/sources/maps/apple_maps.ts +3 -0
  43. package/src/sources/maps/openstreetmap.ts +3 -0
  44. package/src/sources/maps/photon.ts +3 -0
  45. package/src/sources/news/bing_news.ts +3 -0
  46. package/src/sources/news/google_news.ts +3 -0
  47. package/src/sources/news/hackernews.ts +3 -0
  48. package/src/sources/news/yahoo_news.ts +3 -0
  49. package/src/sources/shopping/ebay.ts +3 -0
  50. package/src/sources/social/mastodon.ts +3 -0
  51. package/src/sources/social/medium.ts +3 -0
  52. package/src/sources/social/reddit.ts +3 -0
  53. package/src/sources/social/soundcloud.ts +3 -0
  54. package/src/sources/social/twitter.ts +3 -0
  55. package/src/sources/specialized/annas_archive.ts +3 -0
  56. package/src/sources/specialized/archive.ts +3 -0
  57. package/src/sources/specialized/genius.ts +3 -0
  58. package/src/sources/specialized/goodreads.ts +3 -0
  59. package/src/sources/specialized/imdb.ts +3 -0
  60. package/src/sources/specialized/openlibrary.ts +3 -0
  61. package/src/sources/specialized/wikipedia.ts +3 -0
  62. package/src/sources/specialized/wttr.ts +3 -0
  63. package/src/sources/torrents/1337x.ts +3 -0
  64. package/src/sources/torrents/eztv.ts +3 -0
  65. package/src/sources/torrents/kickass.ts +3 -0
  66. package/src/sources/torrents/nyaa.ts +3 -0
  67. package/src/sources/torrents/solidtorrents.ts +3 -0
  68. package/src/sources/torrents/thepiratebay.ts +3 -0
  69. package/src/sources/torrents/yts.ts +3 -0
  70. package/src/sources/videos/bing_videos.ts +3 -0
  71. package/src/sources/videos/dailymotion.ts +3 -0
  72. package/src/sources/videos/invidious.ts +3 -0
  73. package/src/sources/videos/peertube.ts +3 -0
  74. package/src/sources/videos/vimeo.ts +3 -0
  75. package/src/sources/videos/youtube.ts +3 -0
  76. package/src/suggest-next-words/autocomplete-ai.ts +41 -38
  77. package/src/types/search-engine-interface.ts +2 -2
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "search-web-api",
3
3
  "description": "70+ search engines across 10 categories and Scrape Extract API",
4
4
  "type": "module",
5
- "version": "1.0.76",
5
+ "version": "1.0.78",
6
6
  "author": "vtempest",
7
7
  "license": "rights.institute/PROSPER",
8
8
  "repository": {
@@ -12,10 +12,12 @@
12
12
  },
13
13
  "exports": {
14
14
  ".": {
15
+ "types": "./src/search.ts",
15
16
  "import": "./src/search.ts",
16
17
  "require": "./src/search.ts"
17
18
  },
18
19
  "./*": {
20
+ "types": "./src/*.ts",
19
21
  "import": "./src/*",
20
22
  "require": "./src/*"
21
23
  }
@@ -23,7 +25,8 @@
23
25
  "scripts": {
24
26
  "dev": "bun --watch demo/index.ts",
25
27
  "start": "bun demo/index.ts",
26
- "test": "vitest run"
28
+ "test": "vitest run",
29
+ "test:coverage": "vitest run --coverage"
27
30
  },
28
31
  "dependencies": {
29
32
  "@huggingface/transformers": "^3.8.1",
@@ -1,16 +1,17 @@
1
1
  /**
2
2
  * @fileoverview Unit tests for SearXNG search functionality
3
3
  */
4
+ import { beforeEach, describe, expect, it, vi, type MockedFunction } from "vitest";
4
5
  import { searchWeb, searchSearxng } from "../public-searxng";
5
6
  import grab from "grab-url";
6
7
 
7
8
  // Mock grab-url
8
- jest.mock("grab-url");
9
- const mockGrab = grab as jest.MockedFunction<typeof grab>;
9
+ vi.mock("grab-url");
10
+ const mockGrab = grab as MockedFunction<typeof grab>;
10
11
 
11
12
  describe("searchWeb", () => {
12
13
  beforeEach(() => {
13
- jest.clearAllMocks();
14
+ vi.clearAllMocks();
14
15
  });
15
16
 
16
17
  describe("Private SearXNG instance (JSON)", () => {
@@ -223,7 +224,7 @@ describe("searchWeb", () => {
223
224
  infoboxes: [],
224
225
  };
225
226
 
226
- const consoleSpy = jest.spyOn(console, "warn").mockImplementation();
227
+ const consoleSpy = vi.spyOn(console, "warn").mockImplementation(() => {});
227
228
  mockGrab.mockResolvedValueOnce(mockResults);
228
229
 
229
230
  const result = await searchWeb("test", {
@@ -316,15 +317,13 @@ describe("searchWeb", () => {
316
317
  </article>
317
318
  `;
318
319
 
319
- const consoleSpy = jest.spyOn(console, "warn").mockImplementation();
320
+ const consoleSpy = vi.spyOn(console, "warn").mockImplementation(() => {});
320
321
  mockGrab.mockResolvedValueOnce(mockHtml);
321
322
 
322
323
  await searchWeb("test", { privateSearxng: false });
323
324
 
324
- expect(consoleSpy).toHaveBeenCalledWith(
325
- expect.stringContaining("domain-only"),
326
- expect.any(String)
327
- );
325
+ // The public-scrape path logs a single formatted message.
326
+ expect(consoleSpy).toHaveBeenCalledWith(expect.stringContaining("domain-only"));
328
327
  consoleSpy.mockRestore();
329
328
  });
330
329
  });
@@ -491,15 +490,16 @@ describe("searchWeb", () => {
491
490
 
492
491
  describe("searchSearxng", () => {
493
492
  beforeEach(() => {
494
- jest.clearAllMocks();
493
+ vi.clearAllMocks();
495
494
  });
496
495
 
497
- it("should adapt options to searchWeb", async () => {
498
- mockGrab.mockResolvedValueOnce({
499
- results: [{ title: "Test", url: "https://example.com", content: "Content", score: 0.9 }],
500
- suggestions: ["test1"],
501
- infoboxes: [],
502
- });
496
+ it("should adapt its options onto the underlying search request", async () => {
497
+ mockGrab.mockResolvedValueOnce(`
498
+ <article class="result">
499
+ <h3><a href="https://example.com/article">Test</a></h3>
500
+ <p class="content">Content</p>
501
+ </article>
502
+ `);
503
503
 
504
504
  const result = await searchSearxng("test query", {
505
505
  categories: ["news"],
@@ -507,10 +507,30 @@ describe("searchSearxng", () => {
507
507
  language: "fr",
508
508
  });
509
509
 
510
+ // searchSearxng maps categories[0] -> category, pageno -> page, language -> lang.
511
+ expect(mockGrab).toHaveBeenCalledWith(
512
+ expect.any(String),
513
+ expect.objectContaining({ category_news: 1, pageno: 2, language: "fr" })
514
+ );
510
515
  expect(result).toHaveProperty("results");
511
516
  expect(result).toHaveProperty("suggestions");
512
517
  expect(result.results).toHaveLength(1);
513
- expect(result.suggestions).toHaveLength(1);
518
+ });
519
+
520
+ it("defaults category, page and language when no options are given", async () => {
521
+ mockGrab.mockResolvedValueOnce(`
522
+ <article class="result">
523
+ <h3><a href="https://example.com/article">Test</a></h3>
524
+ <p class="content">Content</p>
525
+ </article>
526
+ `);
527
+
528
+ await searchSearxng("test query");
529
+
530
+ expect(mockGrab).toHaveBeenCalledWith(
531
+ expect.any(String),
532
+ expect.objectContaining({ category_general: 1, pageno: 1, language: "en-US" })
533
+ );
514
534
  });
515
535
 
516
536
  it("should handle array results from searchWeb", async () => {
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the arXiv API for academic paper search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the CORE API for open-access academic papers (requires CORE_API_KEY).
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const core: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Crossref API for scholarly work metadata.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const crossref: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Directory of Open Access Journals (DOAJ) API.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const doaj: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Google Scholar search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the OpenAlex API for scholarly works, reconstructing abstracts from their inverted index.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  function reconstructAbstract(
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes PubMed search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Semantic Scholar API for academic papers.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const semantic_scholar: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Wikidata API for entity search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const wikidata: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Baidu web search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Bing web search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Brave web search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes DuckDuckGo HTML search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Google web search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Mojeek web search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Qwant search API.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const qwant: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Startpage web search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Yahoo web search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Yandex web search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Bing Images search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes DeviantArt search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Flickr API for photo search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const flickr: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Google Images search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const google_images: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Imgur search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Openclipart search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Pixabay API for image search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const pixabay: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Unsplash API for photo search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const unsplash: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Wallhaven API for wallpaper search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const wallhaven: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the crates.io API for Rust package search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const crates: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Docker Hub API for container image search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const dockerhub: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the GitHub API for repository search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const github: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the GitLab API for project search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const gitlab: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the npm registry search API.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const npm: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Packagist API for PHP package search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const packagist: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes PyPI search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const pypi: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the RubyGems API for gem search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const rubygems: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Stack Exchange API for Stack Overflow question results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const stackoverflow: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Apple Maps API for place search results, with automatic access-token caching/renewal.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  // Token management for Apple Maps API
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the OpenStreetMap Nominatim API for place search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const openstreetmap: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Photon (Komoot) geocoding API for place search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const photon: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Bing News search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Google News search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Hacker News (Algolia) API for story search results.
3
+ */
1
4
  import { EngineFunction } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const hackernews: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Yahoo News search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes eBay marketplace search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Mastodon public API for post search results.
3
+ */
1
4
  import { EngineFunction, EngineResult } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const mastodon: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Medium search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction, EngineResult } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Reddit search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction, EngineResult } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes SoundCloud search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction, EngineResult } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Twitter/X search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction, EngineResult } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Anna's Archive search results, trying multiple mirror domains.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction, EngineResult } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Internet Archive API for search results.
3
+ */
1
4
  import { EngineFunction, EngineResult } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const archive: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Genius API for song/lyrics search results.
3
+ */
1
4
  import { EngineFunction, EngineResult } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const genius: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes Goodreads search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction, EngineResult } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes IMDb search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction, EngineResult } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Open Library API for book search results.
3
+ */
1
4
  import { EngineFunction, EngineResult } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const openlibrary: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries the Wikipedia API for article search results.
3
+ */
1
4
  import { EngineFunction, EngineResult } from "../../types/search-engine-interface.js";
2
5
 
3
6
  export const wikipedia: EngineFunction = async (
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that queries wttr.in for weather data, mapping WWO condition codes to human-readable descriptions.
3
+ */
1
4
  import { EngineFunction, EngineResult } from "../../types/search-engine-interface.js";
2
5
 
3
6
  // Weather condition mapping
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes 1337x torrent search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes EZTV torrent search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @fileoverview Engine adapter that scrapes KickassTorrents search results.
3
+ */
1
4
  import { parseHTML } from "linkedom";
2
5
  import { EngineFunction } from "../../types/search-engine-interface.js";
3
6