@astratra/web-search 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/mcp.js +2 -2
- package/src/providers/http.js +1 -1
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astratra/web-search",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Web search for AI agents: several engines (Serper, Brave, Tavily, Exa, or the Centrale gateway) with automatic fallback, rank fusion without content mixing (one entry = one page = one site), verbatim passages with their position, SSRF-safe page reading, content framed as data, cache, quotas, cost report, tool definitions and an MCP server.",
|
|
5
5
|
"engines": {
|
|
6
|
-
"node": ">=
|
|
6
|
+
"node": ">=22"
|
|
7
7
|
},
|
|
8
8
|
"main": "src/index.js",
|
|
9
9
|
"types": "src/index.d.ts",
|
package/src/mcp.js
CHANGED
|
@@ -21,8 +21,8 @@ function loadSdk() {
|
|
|
21
21
|
const { Server } = require('@modelcontextprotocol/sdk/server/index.js');
|
|
22
22
|
const { ListToolsRequestSchema, CallToolRequestSchema } = require('@modelcontextprotocol/sdk/types.js');
|
|
23
23
|
return { Server, ListToolsRequestSchema, CallToolRequestSchema };
|
|
24
|
-
} catch (
|
|
25
|
-
throw new Error('createMcpServer needs @modelcontextprotocol/sdk: npm install @modelcontextprotocol/sdk');
|
|
24
|
+
} catch (error) {
|
|
25
|
+
throw new Error('createMcpServer needs @modelcontextprotocol/sdk: npm install @modelcontextprotocol/sdk', { cause: error });
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
package/src/providers/http.js
CHANGED
|
@@ -24,7 +24,7 @@ function callSignal(signal, timeoutMs) {
|
|
|
24
24
|
* @param {number} [io.timeoutMs]
|
|
25
25
|
*/
|
|
26
26
|
async function requestJson(provider, { fetch, url, init, secrets, signal, timeoutMs }) {
|
|
27
|
-
if (typeof fetch !== 'function') throw new Error(`${provider}: no fetch available (Node
|
|
27
|
+
if (typeof fetch !== 'function') throw new Error(`${provider}: no fetch available (Node 22 or io.fetch).`);
|
|
28
28
|
let response;
|
|
29
29
|
try {
|
|
30
30
|
response = await fetch(url, { ...init, signal: callSignal(signal, timeoutMs) });
|