@herbertgao/pi-extensions 2026.10.17 → 2026.10.19

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 (170) hide show
  1. package/README.md +6 -7
  2. package/THIRD_PARTY_NOTICES.md +0 -1
  3. package/node_modules/@dietrichgebert/ponytail/.qoder-plugin/plugin.json +1 -1
  4. package/node_modules/@dietrichgebert/ponytail/hooks/band/metrics.ts +5 -11
  5. package/node_modules/@dietrichgebert/ponytail/hooks/band/register.tsx +69 -46
  6. package/node_modules/@dietrichgebert/ponytail/hooks/band/types.d.ts +0 -1
  7. package/node_modules/@dietrichgebert/ponytail/hooks/claude-codex-hooks.json +3 -3
  8. package/node_modules/@dietrichgebert/ponytail/hooks/copilot-hooks.json +2 -2
  9. package/node_modules/@dietrichgebert/ponytail/hooks/cursor-hooks.json +2 -2
  10. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-activate.js +4 -3
  11. package/node_modules/@dietrichgebert/ponytail/hooks/ponytail-map.js +4 -1
  12. package/node_modules/@dietrichgebert/ponytail/package.json +1 -1
  13. package/node_modules/@narumitw/pi-btw/README.md +3 -1
  14. package/node_modules/@narumitw/pi-btw/dist/index.ts +26 -5
  15. package/node_modules/@narumitw/pi-btw/dist/index.ts.map +2 -2
  16. package/node_modules/@narumitw/pi-btw/docs/core-alignment.md +40 -0
  17. package/node_modules/@narumitw/pi-btw/docs/workflows.md +3 -0
  18. package/node_modules/@narumitw/pi-btw/package.json +1 -1
  19. package/node_modules/@narumitw/pi-btw/src/btw.ts +31 -5
  20. package/node_modules/@narumitw/pi-btw/src/fullscreen-ui.ts +13 -0
  21. package/node_modules/pi-lens/CHANGELOG.md +83 -0
  22. package/node_modules/pi-lens/README.md +5 -1
  23. package/node_modules/pi-lens/dist/{chunk-JL6CXUMW.js → chunk-24BILSZW.js} +1 -1
  24. package/node_modules/pi-lens/dist/{chunk-S67UJDGQ.js → chunk-2TF6RXWB.js} +5 -5
  25. package/node_modules/pi-lens/dist/{chunk-ARD426WI.js → chunk-3F6BMY53.js} +1 -1
  26. package/node_modules/pi-lens/dist/{chunk-5ZR3APIM.js → chunk-3FRLWYBG.js} +26 -26
  27. package/node_modules/pi-lens/dist/{chunk-T7FTXGS3.js → chunk-3K2F6UDZ.js} +30 -30
  28. package/node_modules/pi-lens/dist/{chunk-HK6JVFZC.js → chunk-3YY7IXIL.js} +2 -2
  29. package/node_modules/pi-lens/dist/chunk-46TNM7XZ.js +88 -0
  30. package/node_modules/pi-lens/dist/{chunk-4AVZ3TG7.js → chunk-4L36HG27.js} +8 -8
  31. package/node_modules/pi-lens/dist/{chunk-PO45POGF.js → chunk-4LM3VAZH.js} +1 -1
  32. package/node_modules/pi-lens/dist/{chunk-UN4TEBWN.js → chunk-4LOE5R5P.js} +9 -9
  33. package/node_modules/pi-lens/dist/{chunk-KLQVC3XC.js → chunk-4YHYPW2G.js} +30 -7
  34. package/node_modules/pi-lens/dist/{chunk-W5LGKNET.js → chunk-4ZYJHQMB.js} +6 -6
  35. package/node_modules/pi-lens/dist/{chunk-W2V54OCL.js → chunk-6IR3ZYIB.js} +2 -2
  36. package/node_modules/pi-lens/dist/{chunk-FJIVKLPH.js → chunk-72OKUXSD.js} +10 -10
  37. package/node_modules/pi-lens/dist/{chunk-7RQXA5GG.js → chunk-75GAYVNO.js} +10 -9
  38. package/node_modules/pi-lens/dist/{chunk-V3APN3DY.js → chunk-7E2563GA.js} +12 -12
  39. package/node_modules/pi-lens/dist/{chunk-4WX4CTUE.js → chunk-7GLOLOSH.js} +25 -25
  40. package/node_modules/pi-lens/dist/{chunk-BWYQUPOS.js → chunk-ABPKUVA4.js} +1 -1
  41. package/node_modules/pi-lens/dist/{chunk-IPDG45G5.js → chunk-AKUUMGD5.js} +9 -9
  42. package/node_modules/pi-lens/dist/{chunk-Q6D6VMI4.js → chunk-ASUXV767.js} +6 -6
  43. package/node_modules/pi-lens/dist/{chunk-BM5GS6ZH.js → chunk-AWDSEDER.js} +2 -2
  44. package/node_modules/pi-lens/dist/{chunk-MA77RSFN.js → chunk-BZARLRJW.js} +4 -4
  45. package/node_modules/pi-lens/dist/{chunk-EVDGNG4F.js → chunk-CB4WHS4H.js} +3 -3
  46. package/node_modules/pi-lens/dist/{chunk-FA5LDARD.js → chunk-CCV2EU7T.js} +7 -7
  47. package/node_modules/pi-lens/dist/{chunk-U6OC3QEM.js → chunk-CE6VMBCB.js} +15 -15
  48. package/node_modules/pi-lens/dist/{chunk-AMXIUN2R.js → chunk-CPSR3AVL.js} +2 -2
  49. package/node_modules/pi-lens/dist/{chunk-SXGD4ANG.js → chunk-CTADOKYM.js} +7 -7
  50. package/node_modules/pi-lens/dist/{chunk-63RIVFQI.js → chunk-DH5JPM3K.js} +1 -1
  51. package/node_modules/pi-lens/dist/{chunk-MT6BVNFW.js → chunk-DPGEAHZT.js} +3 -3
  52. package/node_modules/pi-lens/dist/{chunk-4PCQCU47.js → chunk-DQZFQSR5.js} +2 -2
  53. package/node_modules/pi-lens/dist/{chunk-BHUWL2Y3.js → chunk-E7HJ56Y7.js} +5 -5
  54. package/node_modules/pi-lens/dist/{chunk-DQXSPYRI.js → chunk-EAOK7MIZ.js} +2 -2
  55. package/node_modules/pi-lens/dist/{chunk-2RLWJO5K.js → chunk-EKWX4WD3.js} +3 -3
  56. package/node_modules/pi-lens/dist/{chunk-WIZWZR4C.js → chunk-F7K5IBZG.js} +30 -28
  57. package/node_modules/pi-lens/dist/{chunk-VQH24FIP.js → chunk-FB5SCCPT.js} +9 -9
  58. package/node_modules/pi-lens/dist/{chunk-GZE7WOI4.js → chunk-FZKFVUEC.js} +438 -140
  59. package/node_modules/pi-lens/dist/{chunk-TIYGSODX.js → chunk-H7OR7DFZ.js} +15 -13
  60. package/node_modules/pi-lens/dist/{chunk-CJYKEW2L.js → chunk-HO6LWE2E.js} +1 -1
  61. package/node_modules/pi-lens/dist/{chunk-YSBHPOY6.js → chunk-HR3OJ3TH.js} +8 -8
  62. package/node_modules/pi-lens/dist/{chunk-CFRQMBGP.js → chunk-HWDAVBFU.js} +14 -14
  63. package/node_modules/pi-lens/dist/{chunk-2X4VLOCC.js → chunk-JJ2RRESP.js} +8 -5
  64. package/node_modules/pi-lens/dist/{chunk-YBSONGSZ.js → chunk-JMEKXFOL.js} +24 -24
  65. package/node_modules/pi-lens/dist/{chunk-MKVZQUEG.js → chunk-KDX35VXP.js} +69 -13
  66. package/node_modules/pi-lens/dist/{chunk-75SY4F24.js → chunk-KKCK636N.js} +7 -7
  67. package/node_modules/pi-lens/dist/{chunk-OLAWH5UQ.js → chunk-KPPJTH44.js} +2 -1
  68. package/node_modules/pi-lens/dist/{chunk-5APMQ2IJ.js → chunk-KW5JQPO5.js} +1 -1
  69. package/node_modules/pi-lens/dist/{chunk-SCIUNBPF.js → chunk-L3CMBQMH.js} +11 -11
  70. package/node_modules/pi-lens/dist/{chunk-GAACZY6R.js → chunk-L5JYIU47.js} +7 -7
  71. package/node_modules/pi-lens/dist/{chunk-2DDDCJDL.js → chunk-LBLBAFG3.js} +3 -3
  72. package/node_modules/pi-lens/dist/{chunk-NNKXDXXS.js → chunk-LLS45EWB.js} +8 -0
  73. package/node_modules/pi-lens/dist/{chunk-WQOIR3QY.js → chunk-LS3QJRUB.js} +7 -7
  74. package/node_modules/pi-lens/dist/{chunk-XCUHKYCQ.js → chunk-LSC3VADM.js} +6 -6
  75. package/node_modules/pi-lens/dist/{chunk-GMTFDAOK.js → chunk-LUBPZN36.js} +6 -6
  76. package/node_modules/pi-lens/dist/{chunk-DMSLNKF7.js → chunk-LV4UMYVH.js} +19 -19
  77. package/node_modules/pi-lens/dist/{chunk-XAIT2YGS.js → chunk-MB6PXBUA.js} +2 -2
  78. package/node_modules/pi-lens/dist/{chunk-AE37FEGH.js → chunk-MNJIXFX4.js} +1 -1
  79. package/node_modules/pi-lens/dist/{chunk-OJLTLYHB.js → chunk-MPKRJBPK.js} +30 -10
  80. package/node_modules/pi-lens/dist/{chunk-QGSTQH4D.js → chunk-N5WSK2K7.js} +6 -6
  81. package/node_modules/pi-lens/dist/{chunk-Z7IGUAXL.js → chunk-NA7SEXHE.js} +10 -6
  82. package/node_modules/pi-lens/dist/{chunk-UHGF5UT5.js → chunk-O4BJFESU.js} +1 -1
  83. package/node_modules/pi-lens/dist/{chunk-UCGQT677.js → chunk-OE5ZBP7F.js} +10 -10
  84. package/node_modules/pi-lens/dist/{chunk-KSR7RGQY.js → chunk-OXOI55RU.js} +4 -4
  85. package/node_modules/pi-lens/dist/{chunk-NDMCVUYK.js → chunk-PR6PO3ES.js} +2 -2
  86. package/node_modules/pi-lens/dist/{chunk-NIU2IPC5.js → chunk-PUZ3E2J4.js} +3 -3
  87. package/node_modules/pi-lens/dist/{chunk-2DMLM3ZO.js → chunk-QHSNL7B2.js} +8 -8
  88. package/node_modules/pi-lens/dist/{chunk-ZYNI26MI.js → chunk-QOE342SU.js} +1 -1
  89. package/node_modules/pi-lens/dist/{chunk-3WEPUD2V.js → chunk-R5MOQM2H.js} +98 -31
  90. package/node_modules/pi-lens/dist/{chunk-PPIBVH4R.js → chunk-RC2Z6K47.js} +4 -4
  91. package/node_modules/pi-lens/dist/{chunk-LEJOJDXL.js → chunk-RORGS5II.js} +4 -4
  92. package/node_modules/pi-lens/dist/{chunk-K2YGBXOA.js → chunk-RQS4QQSD.js} +1 -1
  93. package/node_modules/pi-lens/dist/{chunk-XQCSWV2G.js → chunk-RRV3FNNM.js} +10 -10
  94. package/node_modules/pi-lens/dist/{chunk-GTAI2J6U.js → chunk-SHLDT3OI.js} +8 -8
  95. package/node_modules/pi-lens/dist/{chunk-VPBIMOAQ.js → chunk-SNDXCFRS.js} +11 -9
  96. package/node_modules/pi-lens/dist/{chunk-Q4FCYCRE.js → chunk-T7A2HK2B.js} +10 -10
  97. package/node_modules/pi-lens/dist/{chunk-MN7MHUXQ.js → chunk-U5HPROLA.js} +1 -1
  98. package/node_modules/pi-lens/dist/{chunk-ZUUI3ZSA.js → chunk-U6VN4NVL.js} +1 -1
  99. package/node_modules/pi-lens/dist/{chunk-W5R5SABV.js → chunk-U7BD2QL7.js} +6 -6
  100. package/node_modules/pi-lens/dist/{chunk-P4QNXS6I.js → chunk-UF7RTZSO.js} +8 -8
  101. package/node_modules/pi-lens/dist/{chunk-A3YNG5KP.js → chunk-URCQWAQ4.js} +11 -11
  102. package/node_modules/pi-lens/dist/{chunk-FFL3A2VP.js → chunk-VUZWQ7UG.js} +4 -4
  103. package/node_modules/pi-lens/dist/{chunk-YRD4ISED.js → chunk-W4WP2ERB.js} +10 -10
  104. package/node_modules/pi-lens/dist/{chunk-OOU2WZZE.js → chunk-WDBICWH3.js} +1 -1
  105. package/node_modules/pi-lens/dist/{chunk-BI5LAQ3Y.js → chunk-WGRJOXED.js} +114 -148
  106. package/node_modules/pi-lens/dist/{chunk-ZQ6NZZTB.js → chunk-WME2OQST.js} +33 -0
  107. package/node_modules/pi-lens/dist/{chunk-DC4CFXM5.js → chunk-XT2HTCJ5.js} +1 -1
  108. package/node_modules/pi-lens/dist/{chunk-SJJYRZB4.js → chunk-Y7F7IEE3.js} +55 -23
  109. package/node_modules/pi-lens/dist/{chunk-2F47TQOA.js → chunk-YES5CACN.js} +29 -29
  110. package/node_modules/pi-lens/dist/{chunk-H7HTEQUZ.js → chunk-YHC2O2WO.js} +7 -7
  111. package/node_modules/pi-lens/dist/{chunk-Q3UZHW6N.js → chunk-YVHBNSME.js} +6 -10
  112. package/node_modules/pi-lens/dist/{chunk-3MYEA7QD.js → chunk-ZE3KXHS7.js} +2 -2
  113. package/node_modules/pi-lens/dist/{chunk-VG5JS5SW.js → chunk-ZGSJDWQU.js} +2 -2
  114. package/node_modules/pi-lens/dist/{chunk-5CV5ITZF.js → chunk-ZJTT47IG.js} +1 -1
  115. package/node_modules/pi-lens/dist/{chunk-Q4EMRFNA.js → chunk-ZMAUPOMG.js} +24 -24
  116. package/node_modules/pi-lens/dist/index.js +1925 -944
  117. package/node_modules/pi-lens/dist/mcp/analyze-cli.js +6 -6
  118. package/node_modules/pi-lens/dist/mcp/cli.js +30 -30
  119. package/node_modules/pi-lens/dist/mcp/server.js +707 -455
  120. package/node_modules/pi-lens/dist/mcp/worker.js +48 -48
  121. package/node_modules/pi-lens/dist/probes/installer.js +13 -13
  122. package/node_modules/pi-lens/docs/agent-tools.md +11 -3
  123. package/node_modules/pi-lens/docs/defect-shapes.md +15 -1
  124. package/node_modules/pi-lens/docs/dependencies.md +1 -0
  125. package/node_modules/pi-lens/docs/environment-variables.md +14 -0
  126. package/node_modules/pi-lens/docs/features.md +11 -1
  127. package/node_modules/pi-lens/docs/globalconfig.md +12 -1
  128. package/node_modules/pi-lens/docs/invariants/git-guard-host.md +34 -0
  129. package/node_modules/pi-lens/docs/invariants/lsp-trust-exec.md +6 -0
  130. package/node_modules/pi-lens/docs/invariants/session-telemetry.md +42 -2
  131. package/node_modules/pi-lens/docs/lsp-capability-matrix.md +89 -45
  132. package/node_modules/pi-lens/docs/lsp-idle-eviction.md +3 -5
  133. package/node_modules/pi-lens/docs/pi-lens-fixer.md +8 -1
  134. package/node_modules/pi-lens/docs/pi-lens-merge-policy.md +7 -4
  135. package/node_modules/pi-lens/docs/pi-lens-subagent.md +7 -4
  136. package/node_modules/pi-lens/docs/schema/pi-lens-config-v1.json +23 -0
  137. package/node_modules/pi-lens/docs/servercapabilities.md +1 -1
  138. package/node_modules/pi-lens/docs/settings.md +5 -0
  139. package/node_modules/pi-lens/docs/usage.md +5 -0
  140. package/node_modules/pi-lens/package.json +1 -1
  141. package/node_modules/pi-web-access/CHANGELOG.md +32 -1
  142. package/node_modules/pi-web-access/README.md +53 -15
  143. package/node_modules/pi-web-access/cloudflare-search.ts +237 -0
  144. package/node_modules/pi-web-access/curator-page.ts +12 -1
  145. package/node_modules/pi-web-access/curator-server.ts +3 -0
  146. package/node_modules/pi-web-access/dist/index.js +9450 -8642
  147. package/node_modules/pi-web-access/dist/mcp-cli.js +16742 -15954
  148. package/node_modules/pi-web-access/exa.ts +94 -20
  149. package/node_modules/pi-web-access/extract.ts +61 -9
  150. package/node_modules/pi-web-access/gemini-search.ts +17 -7
  151. package/node_modules/pi-web-access/index.ts +6 -0
  152. package/node_modules/pi-web-access/mcp-tool-definitions.ts +50 -34
  153. package/node_modules/pi-web-access/openai-search.ts +3 -1
  154. package/node_modules/pi-web-access/package.json +3 -2
  155. package/node_modules/pi-web-access/page-query.ts +13 -3
  156. package/node_modules/pi-web-access/pdf-extract.ts +1 -5
  157. package/node_modules/pi-web-access/perplexity.ts +2 -0
  158. package/node_modules/pi-web-access/searchapi.ts +202 -0
  159. package/node_modules/pi-web-access/source-check.ts +7 -0
  160. package/node_modules/pi-web-access/ssrf-protection.ts +25 -1
  161. package/node_modules/pi-web-access/summary-review.ts +21 -10
  162. package/node_modules/pi-web-access/tabstack.ts +289 -0
  163. package/node_modules/pi-web-access/utils.ts +79 -16
  164. package/node_modules/pi-web-access/web-tool-core.ts +10 -1
  165. package/node_modules/pi-web-access/xai-search.ts +3 -1
  166. package/package.json +5 -8
  167. package/node_modules/@tifan/pi-inline-skills/README.md +0 -41
  168. package/node_modules/@tifan/pi-inline-skills/package.json +0 -44
  169. package/node_modules/@tifan/pi-inline-skills/src/index.ts +0 -646
  170. package/node_modules/pi-lens/dist/chunk-G2B7F6ZU.js +0 -88
@@ -1,8 +1,9 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
2
  import { activityMonitor } from "./activity.ts";
3
- import type { ExtractedContent } from "./extract.ts";
3
+ import type { ExtractedContent, ExtractOptions } from "./extract.ts";
4
4
  import type { SearchOptions, SearchResponse } from "./perplexity.ts";
5
5
  import { hasCredentialSource, redactCredential, resolveCredential } from "./credential-source.ts";
6
+ import { loadFetchContentDomainPolicy, loadSsrfConfig, validateRemoteUrl } from "./ssrf-protection.ts";
6
7
  import { fetchWithCredentialRedirects, getWebSearchConfigPath, isRecord, resolveApiBaseUrl } from "./utils.ts";
7
8
 
8
9
  const EXA_API_BASE_URL = "https://api.exa.ai";
@@ -10,6 +11,7 @@ const EXA_MCP_URL = "https://mcp.exa.ai/mcp";
10
11
  const CONFIG_PATH = getWebSearchConfigPath();
11
12
  const EXA_MCP_ADVANCED_TOOL = "web_search_advanced_exa";
12
13
  const EXA_MCP_BASIC_TOOL = "web_search_exa";
14
+ const CONTENTS_TIMEOUT_MS = 60_000;
13
15
 
14
16
  interface WebSearchConfig {
15
17
  exaApiKey?: unknown;
@@ -31,6 +33,7 @@ interface ExaSearchResponse {
31
33
 
32
34
  interface ExaMcpRpcResponse {
33
35
  result?: {
36
+ _meta?: Record<string, unknown>;
34
37
  content?: Array<{ type?: string; text?: string }>;
35
38
  isError?: boolean;
36
39
  };
@@ -40,8 +43,6 @@ interface ExaMcpRpcResponse {
40
43
  };
41
44
  }
42
45
 
43
- export type ExaSearchResult = SearchResponse | null;
44
-
45
46
  export interface ExaSearchOptions extends SearchOptions {
46
47
  includeContent?: boolean;
47
48
  /** Restrict results to an Exa content category (e.g. "publication", "news", "company"). */
@@ -309,6 +310,13 @@ export async function callExaMcp(
309
310
  throw new Error(`Exa MCP error${code}: ${message}`);
310
311
  }
311
312
 
313
+ // The free endpoint answers a rate limit with HTTP 200 and this flag, not a 429.
314
+ if (parsed.result?._meta?.["ai.exa/rateLimited"] === true) {
315
+ throw new Error(
316
+ `Exa's free MCP search hit its rate limit. Add "exaApiKey" to ${CONFIG_PATH} or set EXA_API_KEY for unthrottled Exa search.`,
317
+ );
318
+ }
319
+
312
320
  if (parsed.result?.isError) {
313
321
  const message = parsed.result.content
314
322
  ?.find(item => item.type === "text" && typeof item.text === "string")
@@ -401,23 +409,17 @@ function isAbortMessage(message: string): boolean {
401
409
  function parseJsonMcpResults(text: string): ExaSearchResponse["results"] | null {
402
410
  try {
403
411
  const results = (JSON.parse(text) as ExaSearchResponse).results;
404
- return Array.isArray(results) && results.length > 0 ? results : null;
412
+ return Array.isArray(results) ? results : null;
405
413
  } catch {
406
414
  return null;
407
415
  }
408
416
  }
409
417
 
410
418
  /**
411
- * Calls one Exa MCP search tool and normalizes its payload. `web_search_advanced_exa`
419
+ * Normalizes one Exa MCP search tool's payload. `web_search_advanced_exa`
412
420
  * returns the raw Exa search JSON; `web_search_exa` returns a formatted text block.
413
421
  */
414
- async function searchWithExaMcpTool(
415
- tool: string,
416
- args: Record<string, unknown>,
417
- options: ExaSearchOptions,
418
- ): Promise<SearchResponse | null> {
419
- const text = await callExaMcp(tool, args, options.signal);
420
-
422
+ function toMcpSearchResponse(text: string, options: ExaSearchOptions): SearchResponse {
421
423
  const jsonResults = parseJsonMcpResults(text);
422
424
  if (jsonResults) {
423
425
  return toSearchResponse(
@@ -428,7 +430,9 @@ async function searchWithExaMcpTool(
428
430
  }
429
431
 
430
432
  const textResults = parseMcpResults(text);
431
- if (!textResults) return null;
433
+ if (!textResults) {
434
+ throw new Error(`Exa MCP returned no parseable results: ${text.trim().slice(0, 200)}`);
435
+ }
432
436
 
433
437
  return toSearchResponse(
434
438
  buildAnswerFromMcpResults(textResults),
@@ -442,22 +446,25 @@ async function searchWithFilteredExaMcp(
442
446
  query: string,
443
447
  options: ExaSearchOptions,
444
448
  basicArgs: Record<string, unknown>,
445
- ): Promise<SearchResponse | null> {
449
+ ): Promise<SearchResponse> {
450
+ let text: string;
446
451
  try {
447
- return await searchWithExaMcpTool(EXA_MCP_ADVANCED_TOOL, {
452
+ text = await callExaMcp(EXA_MCP_ADVANCED_TOOL, {
448
453
  ...exaSearchArgs(query, options),
449
454
  enableHighlights: true,
450
455
  textMaxCharacters: options.includeContent ? 50000 : 3000,
451
- }, options);
456
+ }, options.signal);
452
457
  } catch (err) {
453
458
  if (isAbortMessage(err instanceof Error ? err.message : String(err))) throw err;
454
459
  // The basic tool ignores every argument except query/numResults, so the
455
460
  // filters degrade into the query text.
456
- return searchWithExaMcpTool(EXA_MCP_BASIC_TOOL, basicArgs, options);
461
+ return toMcpSearchResponse(await callExaMcp(EXA_MCP_BASIC_TOOL, basicArgs, options.signal), options);
457
462
  }
463
+ // An unreadable advanced reply is not retried on the basic tool, which would drop the filters.
464
+ return toMcpSearchResponse(text, options);
458
465
  }
459
466
 
460
- async function searchWithExaMcp(query: string, options: ExaSearchOptions = {}): Promise<SearchResponse | null> {
467
+ async function searchWithExaMcp(query: string, options: ExaSearchOptions = {}): Promise<SearchResponse> {
461
468
  const activityId = activityMonitor.logStart({ type: "api", query });
462
469
  const basicArgs = { query: buildMcpQuery(query, options), numResults: options.numResults ?? 5 };
463
470
  const filtered = !!options.includeContent || !!options.recencyFilter || !!options.domainFilter?.length || !!options.category;
@@ -465,7 +472,7 @@ async function searchWithExaMcp(query: string, options: ExaSearchOptions = {}):
465
472
  try {
466
473
  const response = filtered
467
474
  ? await searchWithFilteredExaMcp(query, options, basicArgs)
468
- : await searchWithExaMcpTool(EXA_MCP_BASIC_TOOL, basicArgs, options);
475
+ : toMcpSearchResponse(await callExaMcp(EXA_MCP_BASIC_TOOL, basicArgs, options.signal), options);
469
476
  activityMonitor.logComplete(activityId, 200);
470
477
  return response;
471
478
  } catch (err) {
@@ -491,7 +498,7 @@ export function hasExaApiKey(): boolean {
491
498
  });
492
499
  }
493
500
 
494
- export async function searchWithExa(query: string, options: ExaSearchOptions = {}): Promise<ExaSearchResult> {
501
+ export async function searchWithExa(query: string, options: ExaSearchOptions = {}): Promise<SearchResponse> {
495
502
  const apiKey = await getApiKey(options.signal);
496
503
  if (!apiKey) {
497
504
  return searchWithExaMcp(query, options);
@@ -538,3 +545,70 @@ export async function searchWithExa(query: string, options: ExaSearchOptions = {
538
545
  throw new Error(redactedMessage);
539
546
  }
540
547
  }
548
+
549
+ /**
550
+ * Read one page through Exa's /contents endpoint with the configured Exa key.
551
+ * Opt-in via `fetchRouting.providers`; returns null when Exa has no text for the page.
552
+ */
553
+ export async function extractWithExa(
554
+ url: string,
555
+ signal?: AbortSignal,
556
+ options: Pick<ExtractOptions, "timeoutMs" | "lookup"> = {},
557
+ ): Promise<ExtractedContent | null> {
558
+ const apiKey = await getApiKey(signal);
559
+ if (!apiKey) throw new Error("Exa fetch requires exaApiKey or EXA_API_KEY");
560
+ const activityId = activityMonitor.logStart({ type: "fetch", url });
561
+ const timeoutMs = options.timeoutMs ?? CONTENTS_TIMEOUT_MS;
562
+ const timeoutSignal = AbortSignal.timeout(timeoutMs);
563
+ try {
564
+ const ssrf = loadSsrfConfig();
565
+ await validateRemoteUrl(url, {
566
+ allowRanges: ssrf.allowRanges,
567
+ trustEnvProxy: ssrf.trustEnvProxy,
568
+ domainPolicy: loadFetchContentDomainPolicy(),
569
+ ...(options.lookup ? { lookup: options.lookup } : {}),
570
+ });
571
+ const response = await fetchWithCredentialRedirects(`${getApiBaseUrl()}/contents`, {
572
+ method: "POST",
573
+ headers: exaApiHeaders(apiKey),
574
+ body: JSON.stringify({ urls: [url], text: true }),
575
+ signal: signal ? AbortSignal.any([timeoutSignal, signal]) : timeoutSignal,
576
+ }, ["x-api-key"]);
577
+ if (!response.ok) {
578
+ throw new Error(`Exa contents error ${response.status}: ${redactCredential(await response.text(), apiKey).slice(0, 300)}`);
579
+ }
580
+ const data: unknown = await response.json();
581
+ if (!isRecord(data) || !Array.isArray(data.results)) {
582
+ throw new Error("Exa contents returned an unexpected response shape");
583
+ }
584
+ const failed = Array.isArray(data.statuses)
585
+ ? data.statuses.find((status): status is Record<string, unknown> => isRecord(status) && status.status === "error")
586
+ : undefined;
587
+ if (failed) {
588
+ const detail = isRecord(failed.error) ? failed.error : {};
589
+ const tag = typeof detail.tag === "string" ? detail.tag : "unknown error";
590
+ const httpStatus = typeof detail.httpStatusCode === "number" ? ` (HTTP ${detail.httpStatusCode})` : "";
591
+ throw new Error(`Exa could not read ${url}: ${tag}${httpStatus}`);
592
+ }
593
+ const page: unknown = data.results[0];
594
+ const content = isRecord(page) && typeof page.text === "string" ? page.text.trim() : "";
595
+ activityMonitor.logComplete(activityId, response.status);
596
+ if (!content) return null;
597
+ return {
598
+ url,
599
+ title: isRecord(page) && typeof page.title === "string" ? page.title.trim() : "",
600
+ content,
601
+ error: null,
602
+ };
603
+ } catch (err) {
604
+ if (signal?.aborted) {
605
+ activityMonitor.logComplete(activityId, 0);
606
+ throw new Error("Aborted");
607
+ }
608
+ const message = timeoutSignal.aborted || (err instanceof Error && err.name === "TimeoutError")
609
+ ? `Exa contents request timed out after ${Math.round(timeoutMs / 1000)}s`
610
+ : redactCredential(err instanceof Error ? err.message : String(err), apiKey);
611
+ activityMonitor.logError(activityId, message);
612
+ throw new Error(message);
613
+ }
614
+ }
@@ -13,8 +13,10 @@ import { extractWithParallel, isParallelAvailable } from "./parallel.ts";
13
13
  import { extractWithParallelMcp } from "./parallel-mcp.ts";
14
14
  import { extractWithTinyFish, isTinyFishAvailable } from "./tinyfish.ts";
15
15
  import { extractWithDeepSeek, isDeepSeekAvailable } from "./deepseek.ts";
16
+ import { extractWithExa, hasExaApiKey } from "./exa.ts";
16
17
  import { extractWithSearch1API, isSearch1APIAvailable } from "./search1api.ts";
17
18
  import { extractWithQuerit, isQueritAvailable } from "./querit.ts";
19
+ import { extractWithTabstack, isTabstackAvailable } from "./tabstack.ts";
18
20
  import { extractWithKagi, isKagiExtractAvailable } from "./kagi.ts";
19
21
  import { extractWithOllama, isOllamaFetchAvailable } from "./ollama.ts";
20
22
  import { extractWithFirecrawl, isFirecrawlAvailable } from "./firecrawl.ts";
@@ -22,8 +24,8 @@ import { extractWithCrawl4ai, isCrawl4aiAvailable } from "./crawl4ai.ts";
22
24
  import { extractWithBrightDataUnlocker, isBrightDataUnlockerAvailable } from "./brightdata-unlocker.ts";
23
25
  import { isVideoFile, extractVideo, extractVideoFrame, getLocalVideoDuration } from "./video-extract.ts";
24
26
  import { appendDeclaredWebLinks, discoverDeclaredWebLinks, type DeclaredWebLink } from "./declared-web-links.ts";
25
- import { fetchRemoteUrl, loadFetchContentDomainPolicy, loadFetchContentRedirectPolicy, loadFetchContentUserAgent, loadSsrfConfig, validateRemoteUrl, type DomainPolicy, type Lookup, type RedirectPolicy, type SsrfConfig } from "./ssrf-protection.ts";
26
- import { formatSeconds, getWebSearchConfigPath, type ProxiedRequestInit } from "./utils.ts";
27
+ import { fetchRemoteUrl, loadConfiguredFetchContentUserAgent, loadFetchContentCurl, loadFetchContentDomainPolicy, loadFetchContentRedirectPolicy, loadFetchContentUserAgent, loadSsrfConfig, trustedEnvProxyFor, validateRemoteUrl, type DomainPolicy, type Lookup, type RedirectPolicy, type SsrfConfig } from "./ssrf-protection.ts";
28
+ import { createCurlFetch, formatSeconds, getWebSearchConfigPath, type ProxiedRequestInit } from "./utils.ts";
27
29
  import { isImageEnabled } from "./feature-config.ts";
28
30
  import { assertAuthFetchUrl, authFetchRedirectGuard, type AuthFetchProfile } from "./auth-fetch.ts";
29
31
  import { getBrowserCookiesForHosts, getLastBrowserCookieDiagnostic } from "./chrome-cookies.ts";
@@ -66,14 +68,14 @@ function loadFetchTimeoutMs(): number {
66
68
  return Math.max(1, timeoutMs);
67
69
  }
68
70
 
69
- const NON_RECOVERABLE_ERRORS = ["Unsupported content type", "Response too large", "PDF extraction is disabled", "Image fetching is disabled"];
71
+ const NON_RECOVERABLE_ERRORS = ["Unsupported content type", "Response too large", "PDF extraction is disabled", "Image fetching is disabled", "fetchContent.curl command not found"];
70
72
  const MIN_USEFUL_CONTENT = 500;
71
73
  const SUPPORTED_IMAGE_TYPES = new Set(["image/png", "image/jpeg", "image/webp", "image/gif"]);
72
- const FETCH_PROVIDERS = ["http", "firecrawl", "crawl4ai", "jina", "tinyfish", "search1api", "querit", "kagi", "ollama", "parallel", "parallel-mcp", "brightdata", "gemini", "deepseek"] as const;
74
+ const FETCH_PROVIDERS = ["http", "firecrawl", "crawl4ai", "jina", "tinyfish", "search1api", "querit", "kagi", "ollama", "parallel", "parallel-mcp", "brightdata", "gemini", "deepseek", "exa", "tabstack"] as const;
73
75
  type FetchProvider = typeof FETCH_PROVIDERS[number];
74
76
  type FetchRouting = { providers: FetchProvider[]; allowRemoteHostedProviders: boolean };
75
77
  const DEFAULT_FETCH_PROVIDER_ORDER: FetchProvider[] = ["http", "firecrawl", "crawl4ai", "jina", "tinyfish", "search1api", "querit", "kagi", "ollama", "parallel", "brightdata", "gemini"];
76
- const REMOTE_HOSTED_FETCH_PROVIDERS = new Set<FetchProvider>(["jina", "tinyfish", "search1api", "querit", "kagi", "ollama", "parallel", "parallel-mcp", "brightdata", "gemini", "deepseek"]);
78
+ const REMOTE_HOSTED_FETCH_PROVIDERS = new Set<FetchProvider>(["jina", "tinyfish", "search1api", "querit", "kagi", "ollama", "parallel", "parallel-mcp", "brightdata", "gemini", "deepseek", "exa", "tabstack"]);
77
79
 
78
80
  function isDefuddleConsoleError(args: Parameters<typeof console.error>): boolean {
79
81
  const prefix = args[0];
@@ -570,8 +572,9 @@ export async function extractContent(
570
572
  try {
571
573
  const ssrf = loadSsrfConfig();
572
574
  const domainPolicy = loadFetchContentDomainPolicy();
573
- // An invalid configured User-Agent fails here, before any provider fallback runs.
575
+ // An invalid configured User-Agent or curl command fails here, before any provider fallback runs.
574
576
  loadFetchContentUserAgent();
577
+ loadFetchContentCurl();
575
578
  await validateRemoteUrl(remoteUrl, {
576
579
  allowRanges: ssrf.allowRanges,
577
580
  trustEnvProxy: ssrf.trustEnvProxy,
@@ -867,12 +870,14 @@ export async function extractContent(
867
870
  let tinyfishError: string | null = null;
868
871
  let search1apiError: string | null = null;
869
872
  let queritError: string | null = null;
873
+ let tabstackError: string | null = null;
870
874
  let kagiError: string | null = null;
871
875
  let ollamaError: string | null = null;
872
876
  let parallelError: string | null = null;
873
877
  let parallelMcpError: string | null = null;
874
878
  let brightdataError: string | null = null;
875
879
  let deepseekError: string | null = null;
880
+ let exaError: string | null = null;
876
881
 
877
882
  if (remoteUrl && providerOrder[0] !== "http") {
878
883
  const httpGateResult = await runHttpProvider();
@@ -974,6 +979,20 @@ export async function extractContent(
974
979
  continue;
975
980
  }
976
981
 
982
+ if (provider === "tabstack") {
983
+ try {
984
+ if (isTabstackAvailable()) {
985
+ const tabstackResult = await extractWithTabstack(url, signal, options);
986
+ if (tabstackResult) return withDeclaredLinks(tabstackResult);
987
+ }
988
+ } catch (err) {
989
+ if (isAbortError(err)) return abortedResult(url);
990
+ tabstackError = errorMessage(err);
991
+ if (isConfigParseError(err)) return parseErrorResult(tabstackError);
992
+ }
993
+ continue;
994
+ }
995
+
977
996
  if (provider === "kagi") {
978
997
  try {
979
998
  if (isKagiExtractAvailable()) {
@@ -1087,6 +1106,23 @@ export async function extractContent(
1087
1106
  }
1088
1107
  continue;
1089
1108
  }
1109
+
1110
+ if (provider === "exa") {
1111
+ try {
1112
+ if (hasExaApiKey()) {
1113
+ const exaResult = await extractWithExa(url, signal, {
1114
+ timeoutMs: options?.timeoutMs,
1115
+ ...(options?.lookup ? { lookup: options.lookup } : {}),
1116
+ });
1117
+ if (exaResult) return withDeclaredLinks(exaResult);
1118
+ }
1119
+ } catch (err) {
1120
+ if (isAbortError(err)) return abortedResult(url);
1121
+ exaError = errorMessage(err);
1122
+ if (isConfigParseError(err)) return parseErrorResult(exaError);
1123
+ }
1124
+ continue;
1125
+ }
1090
1126
  }
1091
1127
 
1092
1128
  if (signal?.aborted) return abortedResult(url);
@@ -1117,6 +1153,8 @@ export async function extractContent(
1117
1153
  ...(parallelMcpError ? [`Parallel MCP fallback failed: ${parallelMcpError}`] : []),
1118
1154
  ...(brightdataError ? [`Bright Data fallback failed: ${brightdataError}`] : []),
1119
1155
  ...(deepseekError ? [`DeepSeek fallback failed: ${deepseekError}`] : []),
1156
+ ...(exaError ? [`Exa fallback failed: ${exaError}`] : []),
1157
+ ...(tabstackError ? [`Tabstack fallback failed: ${tabstackError}`] : []),
1120
1158
  "",
1121
1159
  "Fallback options:",
1122
1160
  ...(jinaHint ? [jinaHint] : []),
@@ -1130,6 +1168,8 @@ export async function extractContent(
1130
1168
  ` • Set parallelApiKey in ${WEB_SEARCH_CONFIG_PATH} or PARALLEL_API_KEY`,
1131
1169
  ` • Set brightdataApiKey and brightdataUnlockerZone in ${WEB_SEARCH_CONFIG_PATH} or BRIGHTDATA_API_KEY and BRIGHTDATA_UNLOCKER_ZONE`,
1132
1170
  ` • Set deepseekApiKey in ${WEB_SEARCH_CONFIG_PATH} or DEEPSEEK_API_KEY and add "deepseek" to fetchRouting.providers`,
1171
+ ` • Set exaApiKey in ${WEB_SEARCH_CONFIG_PATH} or EXA_API_KEY and add "exa" to fetchRouting.providers`,
1172
+ ` • Set tabstackApiKey in ${WEB_SEARCH_CONFIG_PATH} or TABSTACK_API_KEY and add "tabstack" to fetchRouting.providers`,
1133
1173
  ` • Set GEMINI_API_KEY in ${WEB_SEARCH_CONFIG_PATH}`,
1134
1174
  " • Sign into gemini.google.com in Chrome",
1135
1175
  ...(searchToolName ? [` • Use ${searchToolName} to find content about this topic`] : []),
@@ -1286,11 +1326,15 @@ async function extractViaHttp(
1286
1326
  const domainPolicy = loadFetchContentDomainPolicy();
1287
1327
  const redirects = options?.redirects ?? loadFetchContentRedirectPolicy();
1288
1328
  const authProfile = options?.authFetchProfile;
1329
+ // Auth fetches keep Node's fetch, so browser cookies never appear in a command line.
1330
+ const curl = authProfile ? null : loadFetchContentCurl();
1331
+ // Through curl only a configured User-Agent is sent, so curl-impersonate keeps its browser User-Agent.
1332
+ const userAgent = curl ? loadConfiguredFetchContentUserAgent() : loadFetchContentUserAgent();
1289
1333
  const requestInit: ProxiedRequestInit = {
1290
1334
  signal: controller.signal,
1291
1335
  __proxy: options?.proxy,
1292
1336
  headers: {
1293
- "User-Agent": loadFetchContentUserAgent(),
1337
+ ...(userAgent ? { "User-Agent": userAgent } : {}),
1294
1338
  "Accept": preferMarkdown ? MARKDOWN_FIRST_ACCEPT : BROWSER_ACCEPT,
1295
1339
  "Accept-Language": "en-US,en;q=0.9",
1296
1340
  "Cache-Control": "no-cache",
@@ -1313,6 +1357,14 @@ async function extractViaHttp(
1313
1357
  redirects,
1314
1358
  proxy: options?.proxy,
1315
1359
  ...(options?.lookup ? { lookup: options.lookup } : {}),
1360
+ ...(curl ? {
1361
+ fetch: createCurlFetch(curl, {
1362
+ // The type, and so the exact limit, is known only after the response; the size checks below still apply.
1363
+ // curl rejects a fractional --max-filesize, and pdf.maxSizeMB may be fractional.
1364
+ maxBytes: Math.floor(Math.max(5, loadPDFConfig().maxSizeMB) * 1024 * 1024),
1365
+ envProxy: (target) => trustedEnvProxyFor(target, ssrf.trustEnvProxy),
1366
+ }),
1367
+ } : {}),
1316
1368
  },
1317
1369
  );
1318
1370
 
@@ -1328,7 +1380,7 @@ async function extractViaHttp(
1328
1380
  }
1329
1381
 
1330
1382
  const contentLengthHeader = response.headers.get("content-length");
1331
- const contentType = response.headers.get("content-type") || "";
1383
+ const contentType = (response.headers.get("content-type") || "").toLowerCase();
1332
1384
  const mimeType = contentType.split(";", 1)[0]?.trim().toLowerCase() ?? "";
1333
1385
  const isPDFContent = isPDF(url, contentType);
1334
1386
  const pdfConfig = isPDFContent ? loadPDFConfig() : null;
@@ -1407,7 +1459,7 @@ async function extractViaHttp(
1407
1459
  title: result.title,
1408
1460
  content: options?.mode === "answer" || options?.mode === "extract"
1409
1461
  ? result.content
1410
- : `PDF extracted and saved to: ${result.outputPath}\n\n${result.pages > 0 ? `Pages: ${result.pages}\n` : ""}Characters: ${result.chars}`,
1462
+ : `PDF extracted and saved to: ${result.outputPath}\n\n${result.content}`,
1411
1463
  error: null,
1412
1464
  };
1413
1465
  } catch (err) {
@@ -26,6 +26,7 @@ import { isSearch1APIAvailable, searchWithSearch1API } from "./search1api.ts";
26
26
  import { isSearchinfinityAvailable, searchWithSearchinfinity } from "./searchinfinity.ts";
27
27
  import { isQueritAvailable, searchWithQuerit } from "./querit.ts";
28
28
  import { isTavilyAvailable, searchWithTavily } from "./tavily.ts";
29
+ import { isTabstackAvailable, searchWithTabstack } from "./tabstack.ts";
29
30
  import { isYouAvailable, searchWithYou } from "./you.ts";
30
31
  import { isFirecrawlAvailable, searchWithFirecrawl } from "./firecrawl.ts";
31
32
  import { isJinaSearchAvailable, searchWithJina } from "./jina-search.ts";
@@ -51,12 +52,14 @@ import { isKeenableAvailable, searchWithKeenable } from "./keenable.ts";
51
52
  import { isCeramicAvailable, searchWithCeramic } from "./ceramic.ts";
52
53
  import { isLinkupAvailable, searchWithLinkup } from "./linkup.ts";
53
54
  import { isNineRouterAvailable, searchWithNineRouter } from "./ninerouter.ts";
55
+ import { isCloudflareSearchAvailable, searchWithCloudflare } from "./cloudflare-search.ts";
56
+ import { isSearchApiAvailable, searchWithSearchApi } from "./searchapi.ts";
54
57
  import { isDeepSeekAvailable, searchWithDeepSeek } from "./deepseek.ts";
55
58
  import { isKimiSearchAvailable, searchWithKimi } from "./kimi-search.ts";
56
59
  import { isMistralAvailable, searchWithMistral } from "./mistral-search.ts";
57
60
  import { getWebSearchConfigPath } from "./utils.ts";
58
61
 
59
- export const RESOLVED_SEARCH_PROVIDERS = ["openai", "brave", "parallel", "parallel-mcp", "tinyfish", "search1api", "searchinfinity", "querit", "tavily", "you", "firecrawl", "jina", "searxng", "degoog", "duckduckgo", "perplexity", "gemini", "kimi", "exa", "serpdive", "kagi", "ollama", "anysearch", "xai", "mistral", "brightdata", "serpbase", "serpapi", "serper", "serply", "valyu", "bocha", "xcrawl", "baizhi", "zai", "keenable", "ceramic", "deepseek", "linkup", "ninerouter"] as const;
62
+ export const RESOLVED_SEARCH_PROVIDERS = ["openai", "brave", "parallel", "parallel-mcp", "tinyfish", "search1api", "searchinfinity", "querit", "tavily", "you", "firecrawl", "jina", "searxng", "degoog", "duckduckgo", "perplexity", "gemini", "kimi", "exa", "serpdive", "kagi", "ollama", "anysearch", "xai", "mistral", "brightdata", "serpbase", "serpapi", "serper", "serply", "valyu", "bocha", "xcrawl", "baizhi", "zai", "keenable", "ceramic", "deepseek", "linkup", "ninerouter", "cloudflare", "searchapi", "tabstack"] as const;
60
63
  export const SEARCH_PROVIDERS = ["auto", "all", ...RESOLVED_SEARCH_PROVIDERS] as const;
61
64
 
62
65
  export type ResolvedSearchProvider = typeof RESOLVED_SEARCH_PROVIDERS[number];
@@ -125,7 +128,7 @@ export interface AttributedSearchResponse extends SearchResponse {
125
128
 
126
129
  const CONFIG_PATH = getWebSearchConfigPath();
127
130
  const DEFAULT_SEARCH_MODEL = "gemini-3.6-flash";
128
- // Explicit-only providers (Parallel MCP, degoog, DuckDuckGo, Kimi, AnySearch, XCrawl, xAI, Mistral, Bright Data, SerpBase, SerpApi, Serper, Serply, You.com, Valyu, Baizhi, Z.ai, Keenable, Ceramic, DeepSeek, Linkup, 9router) are deliberately absent:
131
+ // Explicit-only providers (Parallel MCP, degoog, DuckDuckGo, Kimi, AnySearch, XCrawl, xAI, Mistral, Bright Data, SerpBase, SerpApi, Serper, Serply, You.com, Valyu, Baizhi, Z.ai, Keenable, Ceramic, DeepSeek, Linkup, 9router, Cloudflare, SearchApi, Tabstack) are deliberately absent:
129
132
  // `all` must never fan out to an opt-in or paid provider without the user asking for it.
130
133
  export const ALL_SEARCH_PROVIDERS: ResolvedSearchProvider[] = ["searxng", "openai", "exa", "brave", "parallel", "tinyfish", "search1api", "searchinfinity", "querit", "tavily", "firecrawl", "jina", "serpdive", "kagi", "ollama", "perplexity", "gemini", "bocha"];
131
134
  const VALID_ROUTING_KINDS = ["transient", "quota", "network", "invalid-response", "unsupported", "empty", "domain-miss", "off-topic"] as const;
@@ -489,6 +492,7 @@ async function searchWithResolvedProvider(
489
492
  if (provider === "searchinfinity") return { ...(await searchWithSearchinfinity(query, options)), provider };
490
493
  if (provider === "querit") return { ...(await searchWithQuerit(query, options)), provider };
491
494
  if (provider === "tavily") return { ...(await searchWithTavily(query, options)), provider };
495
+ if (provider === "tabstack") return { ...(await searchWithTabstack(query, options)), provider };
492
496
  if (provider === "you") return { ...(await searchWithYou(query, options)), provider };
493
497
  if (provider === "firecrawl") return { ...(await searchWithFirecrawl(query, options)), provider };
494
498
  if (provider === "jina") return { ...(await searchWithJina(query, options)), provider };
@@ -511,6 +515,8 @@ async function searchWithResolvedProvider(
511
515
  if (provider === "ceramic") return { ...(await searchWithCeramic(query, options)), provider };
512
516
  if (provider === "linkup") return { ...(await searchWithLinkup(query, options)), provider };
513
517
  if (provider === "ninerouter") return { ...(await searchWithNineRouter(query, options)), provider };
518
+ if (provider === "cloudflare") return { ...(await searchWithCloudflare(query, options)), provider };
519
+ if (provider === "searchapi") return { ...(await searchWithSearchApi(query, options)), provider };
514
520
  if (provider === "deepseek") return { ...(await searchWithDeepSeek(query, options)), provider };
515
521
  if (provider === "xcrawl") return { ...(await searchWithXCrawl(query, options)), provider };
516
522
  if (provider === "perplexity") return { ...(await searchWithPerplexity(query, options)), provider };
@@ -529,9 +535,7 @@ async function searchWithResolvedProvider(
529
535
  " 4. Sign into gemini.google.com in a supported Chromium-based browser",
530
536
  );
531
537
  }
532
- const result = await searchWithExa(query, options);
533
- if (result) return { ...result, provider };
534
- throw new Error("Exa search returned no results.");
538
+ return { ...(await searchWithExa(query, options)), provider };
535
539
  }
536
540
 
537
541
  async function isResolvedProviderAvailable(provider: ResolvedSearchProvider, options: FullSearchOptions, useCurrentModel = false): Promise<boolean> {
@@ -548,6 +552,7 @@ async function isResolvedProviderAvailable(provider: ResolvedSearchProvider, opt
548
552
  if (provider === "searchinfinity") return isSearchinfinityAvailable();
549
553
  if (provider === "querit") return isQueritAvailable();
550
554
  if (provider === "tavily") return isTavilyAvailable();
555
+ if (provider === "tabstack") return isTabstackAvailable();
551
556
  if (provider === "you") return isYouAvailable();
552
557
  if (provider === "firecrawl") return isFirecrawlAvailable();
553
558
  if (provider === "jina") return isJinaSearchAvailable();
@@ -570,6 +575,8 @@ async function isResolvedProviderAvailable(provider: ResolvedSearchProvider, opt
570
575
  if (provider === "ceramic") return isCeramicAvailable();
571
576
  if (provider === "linkup") return isLinkupAvailable();
572
577
  if (provider === "ninerouter") return isNineRouterAvailable();
578
+ if (provider === "cloudflare") return isCloudflareSearchAvailable();
579
+ if (provider === "searchapi") return isSearchApiAvailable();
573
580
  if (provider === "deepseek") return isDeepSeekAvailable();
574
581
  if (provider === "xcrawl") return isXcrawlAvailable();
575
582
  if (provider === "perplexity") return isPerplexityAvailable();
@@ -596,6 +603,7 @@ export function providerLabel(provider: ResolvedSearchProvider): string {
596
603
  if (provider === "search1api") return "Search1API";
597
604
  if (provider === "searchinfinity") return "Searchinfinity";
598
605
  if (provider === "querit") return "Querit";
606
+ if (provider === "tabstack") return "Tabstack";
599
607
  if (provider === "firecrawl") return "Firecrawl";
600
608
  if (provider === "serpdive") return "SERPdive";
601
609
  if (provider === "searxng") return "SearXNG";
@@ -621,6 +629,8 @@ export function providerLabel(provider: ResolvedSearchProvider): string {
621
629
  if (provider === "ceramic") return "Ceramic";
622
630
  if (provider === "linkup") return "Linkup";
623
631
  if (provider === "ninerouter") return "9router";
632
+ if (provider === "cloudflare") return "Cloudflare";
633
+ if (provider === "searchapi") return "SearchApi";
624
634
  if (provider === "deepseek") return "DeepSeek";
625
635
  return provider.charAt(0).toUpperCase() + provider.slice(1);
626
636
  }
@@ -650,7 +660,7 @@ async function searchWithProviders(
650
660
  : await isResolvedProviderAvailable(provider, options),
651
661
  })))).filter((entry) => entry.available).map((entry) => entry.provider);
652
662
  if (providers.length === 0) {
653
- throw new Error("No configured search provider available for provider \"all\". Parallel MCP, degoog, DuckDuckGo, Kimi, AnySearch, xAI, Mistral, Bright Data, SerpBase, SerpApi, Serper, Serply, You.com, Valyu, Baizhi, Z.ai, XCrawl, Keenable, Ceramic, DeepSeek, Linkup, and 9router are excluded.");
663
+ throw new Error("No configured search provider available for provider \"all\". Parallel MCP, degoog, DuckDuckGo, Kimi, AnySearch, xAI, Mistral, Bright Data, SerpBase, SerpApi, Serper, Serply, You.com, Valyu, Baizhi, Z.ai, XCrawl, Keenable, Ceramic, DeepSeek, Linkup, 9router, Cloudflare, SearchApi, and Tabstack are excluded.");
654
664
  }
655
665
 
656
666
  const settled = await Promise.allSettled(
@@ -894,7 +904,7 @@ export async function search(query: string, options: FullSearchOptions = {}): Pr
894
904
  " 3. Set OPENAI_API_KEY, BRAVE_API_KEY, PARALLEL_API_KEY, TINYFISH_API_KEY, SEARCH1API_KEY, SEARCHINFINITY_API_KEY, QUERIT_API_KEY, TAVILY_API_KEY, FIRECRAWL_BASE_URL, JINA_API_KEY, SERPDIVE_API_KEY, KAGI_API_KEY, BOCHA_API_KEY, OLLAMA_API_KEY, SEARXNG_BASE_URL, EXA_API_KEY, PERPLEXITY_API_KEY, GEMINI_API_KEY, or CLOUDFLARE_API_KEY env vars\n" +
895
905
  " 4. Set GOOGLE_GEMINI_BASE_URL with CLOUDFLARE_API_KEY for Cloudflare AI Gateway routing\n" +
896
906
  " 5. Sign into gemini.google.com in a supported Chromium-based browser\n" +
897
- " 6. Explicitly select provider: \"anysearch\" for anonymous AnySearch, \"xcrawl\" for XCrawl, \"xai\" for Grok, \"mistral\" for Mistral Conversations web search, \"brightdata\" with brightdataSerpZone for paid Bright Data SERP, \"serpbase\", \"serpapi\", \"serper\", or \"serply\" for Google SERP, \"you\" for You.com, \"zai\" for Z.ai GLM Coding Plan search, \"valyu\" for research search, \"keenable\" for keyless Keenable search, \"ceramic\" for Ceramic search, \"deepseek\" for DeepSeek search, \"linkup\" for Linkup search, or \"ninerouter\" for a 9router gateway"
907
+ " 6. Explicitly select provider: \"anysearch\" for anonymous AnySearch, \"xcrawl\" for XCrawl, \"xai\" for Grok, \"mistral\" for Mistral Conversations web search, \"brightdata\" with brightdataSerpZone for paid Bright Data SERP, \"serpbase\", \"serpapi\", \"serper\", or \"serply\" for Google SERP, \"you\" for You.com, \"zai\" for Z.ai GLM Coding Plan search, \"valyu\" for research search, \"keenable\" for keyless Keenable search, \"ceramic\" for Ceramic search, \"deepseek\" for DeepSeek search, \"linkup\" for Linkup search, \"ninerouter\" for a 9router gateway, \"cloudflare\" for the Cloudflare Web Search API, \"searchapi\" for SearchApi Google search, or \"tabstack\" for Tabstack Research"
898
908
  );
899
909
  }
900
910
 
@@ -50,6 +50,7 @@ import { isSearch1APIAvailable } from "./search1api.ts";
50
50
  import { isSearchinfinityAvailable } from "./searchinfinity.ts";
51
51
  import { isQueritAvailable } from "./querit.ts";
52
52
  import { isTavilyAvailable } from "./tavily.ts";
53
+ import { isTabstackAvailable } from "./tabstack.ts";
53
54
  import { isYouAvailable } from "./you.ts";
54
55
  import { isFirecrawlAvailable } from "./firecrawl.ts";
55
56
  import { isJinaSearchAvailable } from "./jina-search.ts";
@@ -73,6 +74,8 @@ import { isKeenableAvailable } from "./keenable.ts";
73
74
  import { isCeramicAvailable } from "./ceramic.ts";
74
75
  import { isLinkupAvailable } from "./linkup.ts";
75
76
  import { isNineRouterAvailable } from "./ninerouter.ts";
77
+ import { isCloudflareSearchAvailable } from "./cloudflare-search.ts";
78
+ import { isSearchApiAvailable } from "./searchapi.ts";
76
79
  import { isDeepSeekAvailable } from "./deepseek.ts";
77
80
  import { isBaizhiAvailable } from "./baizhi.ts";
78
81
  import { isZaiAvailable } from "./zai.ts";
@@ -342,6 +345,7 @@ async function getProviderAvailability(ctx: ExtensionContext): Promise<ProviderA
342
345
  searchinfinity: allowedProviders.has("searchinfinity") && isSearchinfinityAvailable(),
343
346
  querit: allowedProviders.has("querit") && isQueritAvailable(),
344
347
  tavily: allowedProviders.has("tavily") && isTavilyAvailable(),
348
+ tabstack: allowedProviders.has("tabstack") && isTabstackAvailable(),
345
349
  you: allowedProviders.has("you") && isYouAvailable(),
346
350
  firecrawl: allowedProviders.has("firecrawl") && isFirecrawlAvailable(),
347
351
  jina: allowedProviders.has("jina") && isJinaSearchAvailable(),
@@ -372,6 +376,8 @@ async function getProviderAvailability(ctx: ExtensionContext): Promise<ProviderA
372
376
  ceramic: allowedProviders.has("ceramic") && isCeramicAvailable(),
373
377
  linkup: allowedProviders.has("linkup") && isLinkupAvailable(),
374
378
  ninerouter: allowedProviders.has("ninerouter") && isNineRouterAvailable(),
379
+ cloudflare: allowedProviders.has("cloudflare") && isCloudflareSearchAvailable(),
380
+ searchapi: allowedProviders.has("searchapi") && isSearchApiAvailable(),
375
381
  deepseek: allowedProviders.has("deepseek") && isDeepSeekAvailable(),
376
382
  };
377
383
  return {