diff --git a/package-lock.json b/package-lock.json index a4dd53a..51e780d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,13 +13,13 @@ "commander": "14.0.2", "dotenv": "17.2.3", "express": "5.2.1", - "zod": "3.25.76" + "zod": "4.3.4" }, "bin": { "brave-search-mcp-server": "dist/index.js" }, "devDependencies": { - "@smithery/cli": "1.6.4", + "@smithery/cli": "2.0.0", "@types/express": "5.0.5", "@types/node": "24.10.1", "prettier": "3.7.1", @@ -58,6 +58,16 @@ "node": ">=18" } }, + "node_modules/@anthropic-ai/mcpb/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.25.10", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.10.tgz", @@ -500,6 +510,19 @@ "node": ">=18" } }, + "node_modules/@hono/node-server": { + "version": "1.19.7", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.19.7.tgz", + "integrity": "sha512-vUcD0uauS7EU2caukW8z5lJKtoGMokxNbJtBiwHgpqxEXokaHCBkQUmCHhjFB1VUTWdqj25QoMkMKzgjq+uhrw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.14.1" + }, + "peerDependencies": { + "hono": "^4" + } + }, "node_modules/@inquirer/checkbox": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-3.0.1.tgz", @@ -1153,16 +1176,15 @@ } }, "node_modules/@smithery/cli": { - "version": "1.6.4", - "resolved": "https://registry.npmjs.org/@smithery/cli/-/cli-1.6.4.tgz", - "integrity": "sha512-4TXZr6amLQ3nWtE+t34aRXnxGpwkd0wcZfNC28lZWCsvI9Lo2d7fTRvDUhzmmgAqdJjtV01b22ygM7zCtxhA5w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@smithery/cli/-/cli-2.0.0.tgz", + "integrity": "sha512-dT+AfveqVEd2r3StF79psJ2wuVPq/r8uvANp+v5z/WadOiHFKckzwkke49YMviH3LlYOWA1LhCb0671t2HXPww==", "dev": true, "dependencies": { "@anthropic-ai/mcpb": "^1.1.1", - "@modelcontextprotocol/sdk": "^1.20.0", + "@modelcontextprotocol/sdk": "^1.25.1", "@ngrok/ngrok": "^1.5.1", "@smithery/registry": "^0.4.2", - "@smithery/sdk": "^1.7.3", "boxen": "^8.0.1", "chalk": "^4.1.2", "commander": "^14.0.0", @@ -1172,6 +1194,7 @@ "express": "^5.1.0", "inquirer": "^8.2.4", "inquirer-autocomplete-prompt": "^2.0.0", + "keytar": "^7.9.0", "lodash": "^4.17.21", "ora": "^8.2.0", "shx": "^0.4.0", @@ -1187,8 +1210,48 @@ "node": ">=20.0.0" }, "peerDependencies": { - "react": "^18.0.0 || ^19.0.0", - "react-dom": "^18.0.0 || ^19.0.0" + "@smithery/sdk": "^3.0.1", + "zod": "^4" + } + }, + "node_modules/@smithery/cli/node_modules/@modelcontextprotocol/sdk": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.25.1.tgz", + "integrity": "sha512-yO28oVFFC7EBoiKdAn+VqRm+plcfv4v0xp6osG/VsCB0NlPZWi87ajbCZZ8f/RvOFLEu7//rSRmuZZ7lMoe3gQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@hono/node-server": "^1.19.7", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "eventsource-parser": "^3.0.0", + "express": "^5.0.1", + "express-rate-limit": "^7.5.0", + "jose": "^6.1.1", + "json-schema-typed": "^8.0.2", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.25 || ^4.0", + "zod-to-json-schema": "^3.25.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@cfworker/json-schema": "^4.1.1", + "zod": "^3.25 || ^4.0" + }, + "peerDependenciesMeta": { + "@cfworker/json-schema": { + "optional": true + }, + "zod": { + "optional": false + } } }, "node_modules/@smithery/registry": { @@ -1200,23 +1263,72 @@ "zod": "^3.20.0" } }, + "node_modules/@smithery/registry/node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, "node_modules/@smithery/sdk": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/@smithery/sdk/-/sdk-1.7.4.tgz", - "integrity": "sha512-Lgedh794Qj13wNjk2UX360wnYlTpkjnnIPVTwsImcZAIno38L3AF+4dYgeDd435ch5oDfUomuPFthDqvf6DV/A==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@smithery/sdk/-/sdk-3.0.1.tgz", + "integrity": "sha512-ngwD/Tb4sYNxadsYEHe57KtDfJ26av9no9O0KF0lKfJLwiaxcj9XkNWWefXHiJX/48zs1zPW6iO+/ruIJvB7qg==", "dev": true, "license": "MIT", "dependencies": { - "@modelcontextprotocol/sdk": "^1.20.0", + "@modelcontextprotocol/sdk": "^1.25.1", "chalk": "^5.6.2", "express": "^5.1.0", "jose": "^6.1.0", - "json-schema": "^0.4.0", "lodash": "^4.17.21", - "okay-error": "^1.0.3", - "uuid": "^11.0.3", - "zod": "^3.23.8", - "zod-to-json-schema": "^3.24.1" + "okay-error": "^1.0.3" + }, + "peerDependencies": { + "zod": "^4" + } + }, + "node_modules/@smithery/sdk/node_modules/@modelcontextprotocol/sdk": { + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.25.1.tgz", + "integrity": "sha512-yO28oVFFC7EBoiKdAn+VqRm+plcfv4v0xp6osG/VsCB0NlPZWi87ajbCZZ8f/RvOFLEu7//rSRmuZZ7lMoe3gQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@hono/node-server": "^1.19.7", + "ajv": "^8.17.1", + "ajv-formats": "^3.0.1", + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.5", + "eventsource": "^3.0.2", + "eventsource-parser": "^3.0.0", + "express": "^5.0.1", + "express-rate-limit": "^7.5.0", + "jose": "^6.1.1", + "json-schema-typed": "^8.0.2", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.25 || ^4.0", + "zod-to-json-schema": "^3.25.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@cfworker/json-schema": "^4.1.1", + "zod": "^3.25 || ^4.0" + }, + "peerDependenciesMeta": { + "@cfworker/json-schema": { + "optional": true + }, + "zod": { + "optional": false + } } }, "node_modules/@smithery/sdk/node_modules/chalk": { @@ -1667,6 +1779,13 @@ "dev": true, "license": "MIT" }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true, + "license": "ISC" + }, "node_modules/cli-boxes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz", @@ -1836,6 +1955,32 @@ } } }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, "node_modules/defaults": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", @@ -1856,6 +2001,16 @@ "node": ">= 0.8" } }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/dotenv": { "version": "17.2.3", "license": "BSD-2-Clause", @@ -2078,6 +2233,16 @@ "which": "bin/which" } }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "dev": true, + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } + }, "node_modules/express": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", @@ -2290,6 +2455,13 @@ "node": ">= 0.8" } }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true, + "license": "MIT" + }, "node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", @@ -2407,6 +2579,13 @@ "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" } }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "dev": true, + "license": "MIT" + }, "node_modules/glob-parent": { "version": "5.1.2", "dev": true, @@ -2465,6 +2644,17 @@ "node": ">= 0.4" } }, + "node_modules/hono": { + "version": "4.11.3", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.11.3.tgz", + "integrity": "sha512-PmQi306+M/ct/m5s66Hrg+adPnkD5jiO6IjA7WhWw0gSBSo1EcRegwuI1deZ+wd5pzCGynCcn2DprnE4/yEV4w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=16.9.0" + } + }, "node_modules/http-errors": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", @@ -2536,6 +2726,13 @@ "version": "2.0.4", "license": "ISC" }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, + "license": "ISC" + }, "node_modules/inquirer": { "version": "8.2.7", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.2.7.tgz", @@ -2801,19 +2998,19 @@ "url": "https://github.com/sponsors/panva" } }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true, - "license": "(AFL-2.1 OR BSD-3-Clause)" - }, "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "license": "MIT" }, + "node_modules/json-schema-typed": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz", + "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==", + "dev": true, + "license": "BSD-2-Clause" + }, "node_modules/jsonfile": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", @@ -2827,6 +3024,18 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/keytar": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/keytar/-/keytar-7.9.0.tgz", + "integrity": "sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "node-addon-api": "^4.3.0", + "prebuild-install": "^7.0.1" + } + }, "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", @@ -2961,6 +3170,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimist": { "version": "1.2.8", "dev": true, @@ -2969,6 +3191,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "dev": true, + "license": "MIT" + }, "node_modules/ms": { "version": "2.1.3", "license": "MIT" @@ -2980,6 +3209,13 @@ "dev": true, "license": "ISC" }, + "node_modules/napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "dev": true, + "license": "MIT" + }, "node_modules/negotiator": { "version": "1.0.0", "license": "MIT", @@ -2992,6 +3228,39 @@ "dev": true, "license": "MIT" }, + "node_modules/node-abi": { + "version": "3.85.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.85.0.tgz", + "integrity": "sha512-zsFhmbkAzwhTft6nd3VxcG0cvJsT70rL+BIGHWVq5fi6MwGrHwzqKaxXE+Hl2GmnGItnDKPPkO5/LQqjVkIdFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-abi/node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", + "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==", + "dev": true, + "license": "MIT" + }, "node_modules/node-fetch": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", @@ -3286,6 +3555,33 @@ "node": ">=16.20.0" } }, + "node_modules/prebuild-install": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^2.0.0", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/prettier": { "version": "3.7.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.7.1.tgz", @@ -3391,29 +3687,20 @@ "node": ">= 0.10" } }, - "node_modules/react": { - "version": "19.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-19.2.0.tgz", - "integrity": "sha512-tmbWg6W31tQLeB5cdIBOicJDJRR2KzXsV7uSK9iNfLWQ5bIZfxuPEHp7M8wiHyHnn0DD1i7w3Zmin0FtkrwoCQ==", + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/react-dom": { - "version": "19.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.0.tgz", - "integrity": "sha512-UlbRu4cAiGaIewkPyiRGJk0imDN2T3JjieT6spoL2UeSf5od4n5LB/mQ4ejmxhCFT1tYe8IvaFulzynWovsEFQ==", - "dev": true, - "license": "MIT", - "peer": true, + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", "dependencies": { - "scheduler": "^0.27.0" + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" }, - "peerDependencies": { - "react": "^19.2.0" + "bin": { + "rc": "cli.js" } }, "node_modules/readable-stream": { @@ -3578,13 +3865,6 @@ "version": "2.1.2", "license": "MIT" }, - "node_modules/scheduler": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", - "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", - "dev": true, - "license": "MIT" - }, "node_modules/semver": { "version": "5.7.2", "dev": true, @@ -3748,6 +4028,53 @@ "dev": true, "license": "ISC" }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, "node_modules/smol-toml": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.4.2.tgz", @@ -3859,6 +4186,16 @@ "node": ">=0.10.0" } }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -3883,6 +4220,36 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tar-fs": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.4.tgz", + "integrity": "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -3950,6 +4317,19 @@ "fsevents": "~2.3.3" } }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, "node_modules/type-fest": { "version": "4.41.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", @@ -4197,7 +4577,9 @@ } }, "node_modules/zod": { - "version": "3.25.76", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.4.tgz", + "integrity": "sha512-Zw/uYiiyF6pUT1qmKbZziChgNPRu+ZRneAsMUDU6IwmXdWt5JwcUfy2bvLOCUtz5UniaN/Zx5aFttZYbYc7O/A==", "license": "MIT", "peer": true, "funding": { diff --git a/package.json b/package.json index b98ce7f..e0a3ccb 100644 --- a/package.json +++ b/package.json @@ -41,11 +41,11 @@ "commander": "14.0.2", "dotenv": "17.2.3", "express": "5.2.1", - "zod": "3.25.76" + "zod": "4.3.4" }, "devDependencies": { "@types/express": "5.0.5", - "@smithery/cli": "1.6.4", + "@smithery/cli": "2.0.0", "@types/node": "24.10.1", "prettier": "3.7.1", "shx": "0.4.0", diff --git a/src/config.ts b/src/config.ts index e36d9f2..a517f46 100644 --- a/src/config.ts +++ b/src/config.ts @@ -8,7 +8,10 @@ dotenv.config({ debug: false, quiet: true }); // Config schema for Smithery.ai export const configSchema = z.object({ - braveApiKey: z.string().describe('Your API key'), + braveApiKey: z + .string() + .describe('Your API key') + .default(process.env.BRAVE_API_KEY ?? ''), enabledTools: z .array(z.string()) .describe('Enforces a tool whitelist (cannot be used with disabledTools)') diff --git a/src/tools/images/schemas/input.ts b/src/tools/images/schemas/input.ts index ea7d8d9..9ea9260 100644 --- a/src/tools/images/schemas/input.ts +++ b/src/tools/images/schemas/input.ts @@ -24,7 +24,6 @@ export const params = z.object({ ) .optional(), count: z - .number() .int() .min(1) .max(200) diff --git a/src/tools/images/schemas/output.ts b/src/tools/images/schemas/output.ts index 86e9303..d5227b3 100644 --- a/src/tools/images/schemas/output.ts +++ b/src/tools/images/schemas/output.ts @@ -3,20 +3,20 @@ import { ConfidenceSchema, ExtraSchema } from './response.js'; export const SimplifiedImageResultSchema = z.object({ title: z.string(), - url: z.string().url(), - page_fetched: z.string().datetime(), + url: z.url(), + page_fetched: z.iso.datetime(), confidence: ConfidenceSchema, properties: z.object({ - url: z.string().url(), - width: z.number().int().positive(), - height: z.number().int().positive(), + url: z.url(), + width: z.int().positive(), + height: z.int().positive(), }), }); const OutputSchema = z.object({ type: z.literal('object'), items: z.array(SimplifiedImageResultSchema), - count: z.number().int().nonnegative(), + count: z.int().nonnegative(), might_be_offensive: ExtraSchema.shape.might_be_offensive, }); diff --git a/src/tools/images/schemas/response.ts b/src/tools/images/schemas/response.ts index 36eeaa1..846c14e 100644 --- a/src/tools/images/schemas/response.ts +++ b/src/tools/images/schemas/response.ts @@ -15,23 +15,23 @@ const QuerySchema = z.object({ }); const ThumbnailSchema = z.object({ - src: z.string().url().optional().describe('The URL of the thumbnail.'), - width: z.number().int().positive().optional().describe('The width of the thumbnail.'), - height: z.number().int().positive().optional().describe('The height of the thumbnail.'), + src: z.url().optional().describe('The URL of the thumbnail.'), + width: z.int().positive().optional().describe('The width of the thumbnail.'), + height: z.int().positive().optional().describe('The height of the thumbnail.'), }); const PropertiesSchema = z.object({ - url: z.string().url().optional().describe('The URL of the image.'), - placeholder: z.string().url().optional().describe('The lower resolution placeholder image.'), - width: z.number().int().positive().optional().describe('The width of the image.'), - height: z.number().int().positive().optional().describe('The height of the image.'), + url: z.url().optional().describe('The URL of the image.'), + placeholder: z.url().optional().describe('The lower resolution placeholder image.'), + width: z.int().positive().optional().describe('The width of the image.'), + height: z.int().positive().optional().describe('The height of the image.'), }); const MetaUrlSchema = z.object({ scheme: z.enum(['https', 'http']).optional().describe('The scheme of the URL.'), netloc: z.string().optional().describe('The network location of the URL.'), hostname: z.string().optional().describe('The lowercased hostname of the URL.'), - favicon: z.string().url().optional().describe('The URL of the favicon of the URL.'), + favicon: z.url().optional().describe('The URL of the favicon of the URL.'), path: z.string().optional().describe('The path of the URL (useful as a display string).'), }); @@ -42,13 +42,9 @@ export const ConfidenceSchema = z const ImageResultSchema = z.object({ type: z.literal('image_result').describe('The type of result.'), title: z.string().optional().describe('The title of the image.'), - url: z.string().url().optional().describe('The URL of the image.'), - source: z.string().url().optional().describe('The source URL of the image.'), - page_fetched: z - .string() - .datetime() - .optional() - .describe('The date and time the page was fetched.'), + url: z.url().optional().describe('The URL of the image.'), + source: z.url().optional().describe('The source URL of the image.'), + page_fetched: z.iso.datetime().optional().describe('The date and time the page was fetched.'), thumbnail: ThumbnailSchema.optional().describe('The thumbnail of the image.'), properties: PropertiesSchema.optional().describe('The metadata for the image.'), meta_url: MetaUrlSchema.optional().describe( diff --git a/src/tools/news/params.ts b/src/tools/news/params.ts index ed737d2..623846c 100644 --- a/src/tools/news/params.ts +++ b/src/tools/news/params.ts @@ -28,7 +28,6 @@ export const params = z.object({ ) .optional(), count: z - .number() .int() .min(1) .max(50) @@ -36,7 +35,6 @@ export const params = z.object({ .describe('Number of results (1-50, default 20)') .optional(), offset: z - .number() .int() .min(0) .max(9) diff --git a/src/tools/videos/params.ts b/src/tools/videos/params.ts index a755761..c171ef7 100644 --- a/src/tools/videos/params.ts +++ b/src/tools/videos/params.ts @@ -31,7 +31,6 @@ export const params = z.object({ ) .optional(), count: z - .number() .int() .min(1) .max(50) @@ -41,7 +40,6 @@ export const params = z.object({ ) .optional(), offset: z - .number() .int() .min(0) .max(9) diff --git a/src/tools/web/params.ts b/src/tools/web/params.ts index 690f037..9470012 100644 --- a/src/tools/web/params.ts +++ b/src/tools/web/params.ts @@ -156,7 +156,6 @@ export const params = z.object({ ) .optional(), count: z - .number() .int() .min(1) .max(20) @@ -166,7 +165,6 @@ export const params = z.object({ ) .optional(), offset: z - .number() .int() .min(0) .max(9)