| index 6564fa0..4e211d6 100644 | ||
| --- a/README.md | ||
| +++ b/README.md | ||
| @@ -14,6 +14,7 @@ make e2e # Playwright at 1440/1024/390, dark + light | ||
| 14 | 14 | |---|---| |
| 15 | 15 | | Slug / binary | `websearch` / `plugin_websearch` (`--meta` name `websearch`, desc `Web search MCP`) | |
| 16 | 16 | | Kind | `mcp: true`, `daemon: false`, `menus: false`, category `network` | |
| 17 | +| `verified` | `mock` — see [Verification tier](#verification-tier) | | |
| 17 | 18 | | Dist targets | `linux-x86_64`, `linux-x86_64-musl`, `linux-arm64-musl`, `macos-arm64`, `macos-x86_64`, `windows-x86_64` | |
| 18 | 19 | | Runtime deps | none — no libcurl, no OpenSSL, no system CA file, no `curl` binary | |
| 19 | 20 | | Source | `https://plugingit.scorpiox.net/scorpiox-bot-plugin-websearch.git` | |
| @@ -23,7 +24,7 @@ make e2e # Playwright at 1440/1024/390, dark + light | ||
| 23 | 24 | |
| 24 | 25 | | id | Auth | Endpoint | Notes | |
| 25 | 26 | |---|---|---|---| |
| 26 | -| `duckduckgo` | **none** | `POST {base}/html/` | the HTML result page is parsed; a GET gets DuckDuckGo's bot challenge, so the request is a form POST | | |
| 27 | +| `duckduckgo` | **none** | `POST {base}/html/` | the HTML result page is parsed; a GET gets DuckDuckGo's bot challenge, so the request is a form POST. **Measured: DuckDuckGo rate-limits an IP after a handful of queries** (HTTP `202` + `anomaly-modal`) and then keeps answering `202` for a while — the plugin reports that as a challenge with the alternatives named, never as "no results" | | |
| 27 | 28 | | `searxng` | none | `GET {base}/search?format=json` | your own instance; needs `search.formats: [json]` in its `settings.yml` | |
| 28 | 29 | | `brave` | `X-Subscription-Token` | `GET {base}/res/v1/web/search` | supports `country`, `language`, `freshness` | |
| 29 | 30 | | `tavily` | `Authorization: Bearer` | `POST {base}/search` | optional `include_answer` / `search_depth: advanced` | |
| @@ -40,6 +41,13 @@ vendor's field names: | ||
| 40 | 41 | `provider` is an argument on the tool *and* a saved default. With no key configured |
| 41 | 42 | the tool says exactly which variable to set, instead of returning "no results". |
| 42 | 43 | |
| 44 | +**On the keyless default:** DuckDuckGo is the only backend that needs nothing, and it | |
| 45 | +is also the only one that will rate-limit you — after a few queries from one IP it | |
| 46 | +serves its bot-detection page (`202`) and keeps doing so for a while. That is measured | |
| 47 | +behaviour on this fleet, not a maybe: `tests/run.sh` covers it by asserting the | |
| 48 | +challenge page becomes an error naming the alternatives, and the fix for a node that | |
| 49 | +searches a lot is a keyed provider or your own SearXNG instance. | |
| 50 | + | |
| 43 | 51 | ## MCP tools |
| 44 | 52 | |
| 45 | 53 | Served over stdio JSON-RPC 2.0 from `plugin_websearch --mcp`, which is what the single |
| @@ -140,6 +148,26 @@ tests/run.sh the offline suite | ||
| 140 | 148 | tests/e2e.py Playwright viewport + behaviour suite |
| 141 | 149 | ``` |
| 142 | 150 | |
| 151 | +## Verification tier | |
| 152 | + | |
| 153 | +`plugin.json` says `"verified": "mock"` and the discovery line repeats it. That is | |
| 154 | +deliberate, and it is the honest answer for this connector: | |
| 155 | + | |
| 156 | +* **Verified against a recording mock, end to end.** `tests/mockapi.py` serves all six | |
| 157 | + providers, records the method, path, query, credential header and JSON body of every | |
| 158 | + request it receives, and the suite diffs that against what each provider's API | |
| 159 | + documents. That is 84 assertions covering request shape, normalisation, error text, | |
| 160 | + auth gating and secret hygiene — the part a plugin can be *wrong* about. | |
| 161 | +* **Not verified with a paid key.** Searching Brave/Tavily/Exa/Perplexity for real | |
| 162 | + needs a paid account, and a plugin that claims `"live"` on the strength of a mock has | |
| 163 | + told you nothing. The unauthenticated paths were exercised against the real hosts: | |
| 164 | + Brave answers a well-formed request with its own `422 SUBSCRIPTION_TOKEN_INVALID` (so | |
| 165 | + TLS, the endpoint, the header name and the error path are all proven end to end), and | |
| 166 | + DuckDuckGo answers the real `html.duckduckgo.com` — including its rate limit, which is | |
| 167 | + why this document names it. | |
| 168 | + | |
| 169 | +Flip it to `"live"` when someone runs it with a real key and says so. | |
| 170 | + | |
| 143 | 171 | ## Security |
| 144 | 172 | |
| 145 | 173 | See [docs/SECURITY.md](docs/SECURITY.md). The short version: TLS is verified against a |
| index 9bf51ed..e169b42 100644 | ||
| --- a/plugin.json | ||
| +++ b/plugin.json | ||
| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | "mcp": true, |
| 10 | 10 | "daemon": false, |
| 11 | 11 | "menus": false, |
| 12 | - "verified": "live", | |
| 12 | + "verified": "mock", | |
| 13 | 13 | "category": "network", |
| 14 | - "version": "1.0.1", | |
| 14 | + "version": "1.0.2", | |
| 15 | 15 | "license": "MIT", |
| 16 | 16 | "capabilities": [ |
| 17 | 17 | "outbound_https_search_api", |
| index fc80578..980ff65 100644 | ||
| --- a/src/plugin_websearch.c | ||
| +++ b/src/plugin_websearch.c | ||
| @@ -78,7 +78,7 @@ static void sx_plugin_binary_stdio(void) | ||
| 78 | 78 | static int mode_meta(void) |
| 79 | 79 | { |
| 80 | 80 | printf("{\"name\":\"%s\",\"desc\":\"%s\",\"kind\":\"mcp\",\"mcp\":true," |
| 81 | - "\"daemon\":false,\"menus\":false,\"verified\":\"live\"," | |
| 81 | + "\"daemon\":false,\"menus\":false,\"verified\":\"mock\"," | |
| 82 | 82 | "\"category\":\"network\",\"version\":\"%s\"}\n", |
| 83 | 83 | WS_NAME, WS_DESC, WS_VER); |
| 84 | 84 | fflush(stdout); |
| index 01e9a9a..8301ad0 100644 | ||
| --- a/src/ws.h | ||
| +++ b/src/ws.h | ||
| @@ -32,7 +32,7 @@ | ||
| 32 | 32 | |
| 33 | 33 | #define WS_SLUG "websearch" |
| 34 | 34 | #define WS_ID "plugin_websearch" |
| 35 | -#define WS_VER "1.0.1" | |
| 35 | +#define WS_VER "1.0.2" | |
| 36 | 36 | #define WS_NAME "websearch" |
| 37 | 37 | #define WS_DESC "Web search MCP" |
| 38 | 38 |
| index dad6c45..f114706 100755 | ||
| --- a/tests/run.sh | ||
| +++ b/tests/run.sh | ||
| @@ -148,7 +148,11 @@ json_ok "kind is mcp, mcp true, menus false" \ | ||
| 148 | 148 | "$META" 'd["kind"]=="mcp" and d["mcp"] is True and d["menus"] is False' |
| 149 | 149 | json_ok "daemon is false" "$META" 'd["daemon"] is False' |
| 150 | 150 | json_ok "category is network" "$META" 'd["category"]=="network"' |
| 151 | +json_ok "verified is mock (an honest tier: the suite drives a mock, not a paid key)" \ | |
| 152 | + "$META" 'd["verified"]=="mock"' | |
| 151 | 153 | check "SX_PLUGIN_META=1 agrees" '"name":"websearch"' "$(SX_PLUGIN_META=1 "$BIN")" |
| 154 | +json_ok "--meta version agrees with plugin.json" "$META" \ | |
| 155 | + 'd["version"]==__import__("json").load(open("plugin.json"))["version"]' | |
| 152 | 156 | VER=$(python3 -c 'import json;print(json.load(open("plugin.json"))["version"])') |
| 153 | 157 | check "--version agrees with plugin.json" "$VER" "$("$BIN" --version)" |
| 154 | 158 | check "--help mentions the tool names" 'web_search' "$("$BIN" --help)" |
| 155 | 159 |
| index 6564fa0..4e211d6 100644 | index 6564fa0..4e211d6 100644 | ||
| --- a/README.md | --- a/README.md | ||
| +++ b/README.md | +++ b/README.md | ||
| @@ -14,6 +14,7 @@ make e2e # Playwright at 1440/1024/390, dark + light | @@ -14,6 +14,7 @@ make e2e # Playwright at 1440/1024/390, dark + light | ||
| 14 | |---|---| | 14 | |---|---| |
| 15 | | Slug / binary | `websearch` / `plugin_websearch` (`--meta` name `websearch`, desc `Web search MCP`) | | 15 | | Slug / binary | `websearch` / `plugin_websearch` (`--meta` name `websearch`, desc `Web search MCP`) | |
| 16 | | Kind | `mcp: true`, `daemon: false`, `menus: false`, category `network` | | 16 | | Kind | `mcp: true`, `daemon: false`, `menus: false`, category `network` | |
| 17 | +| `verified` | `mock` — see [Verification tier](#verification-tier) | | ||
| 17 | | Dist targets | `linux-x86_64`, `linux-x86_64-musl`, `linux-arm64-musl`, `macos-arm64`, `macos-x86_64`, `windows-x86_64` | | 18 | | Dist targets | `linux-x86_64`, `linux-x86_64-musl`, `linux-arm64-musl`, `macos-arm64`, `macos-x86_64`, `windows-x86_64` | |
| 18 | | Runtime deps | none — no libcurl, no OpenSSL, no system CA file, no `curl` binary | | 19 | | Runtime deps | none — no libcurl, no OpenSSL, no system CA file, no `curl` binary | |
| 19 | | Source | `https://plugingit.scorpiox.net/scorpiox-bot-plugin-websearch.git` | | 20 | | Source | `https://plugingit.scorpiox.net/scorpiox-bot-plugin-websearch.git` | |
| @@ -23,7 +24,7 @@ make e2e # Playwright at 1440/1024/390, dark + light | @@ -23,7 +24,7 @@ make e2e # Playwright at 1440/1024/390, dark + light | ||
| 23 | 24 | ||
| 24 | | id | Auth | Endpoint | Notes | | 25 | | id | Auth | Endpoint | Notes | |
| 25 | |---|---|---|---| | 26 | |---|---|---|---| |
| 26 | -| `duckduckgo` | **none** | `POST {base}/html/` | the HTML result page is parsed; a GET gets DuckDuckGo's bot challenge, so the request is a form POST | | 27 | +| `duckduckgo` | **none** | `POST {base}/html/` | the HTML result page is parsed; a GET gets DuckDuckGo's bot challenge, so the request is a form POST. **Measured: DuckDuckGo rate-limits an IP after a handful of queries** (HTTP `202` + `anomaly-modal`) and then keeps answering `202` for a while — the plugin reports that as a challenge with the alternatives named, never as "no results" | |
| 27 | | `searxng` | none | `GET {base}/search?format=json` | your own instance; needs `search.formats: [json]` in its `settings.yml` | | 28 | | `searxng` | none | `GET {base}/search?format=json` | your own instance; needs `search.formats: [json]` in its `settings.yml` | |
| 28 | | `brave` | `X-Subscription-Token` | `GET {base}/res/v1/web/search` | supports `country`, `language`, `freshness` | | 29 | | `brave` | `X-Subscription-Token` | `GET {base}/res/v1/web/search` | supports `country`, `language`, `freshness` | |
| 29 | | `tavily` | `Authorization: Bearer` | `POST {base}/search` | optional `include_answer` / `search_depth: advanced` | | 30 | | `tavily` | `Authorization: Bearer` | `POST {base}/search` | optional `include_answer` / `search_depth: advanced` | |
| @@ -40,6 +41,13 @@ vendor's field names: | @@ -40,6 +41,13 @@ vendor's field names: | ||
| 40 | `provider` is an argument on the tool *and* a saved default. With no key configured | 41 | `provider` is an argument on the tool *and* a saved default. With no key configured |
| 41 | the tool says exactly which variable to set, instead of returning "no results". | 42 | the tool says exactly which variable to set, instead of returning "no results". |
| 42 | 43 | ||
| 44 | +**On the keyless default:** DuckDuckGo is the only backend that needs nothing, and it | ||
| 45 | +is also the only one that will rate-limit you — after a few queries from one IP it | ||
| 46 | +serves its bot-detection page (`202`) and keeps doing so for a while. That is measured | ||
| 47 | +behaviour on this fleet, not a maybe: `tests/run.sh` covers it by asserting the | ||
| 48 | +challenge page becomes an error naming the alternatives, and the fix for a node that | ||
| 49 | +searches a lot is a keyed provider or your own SearXNG instance. | ||
| 50 | + | ||
| 43 | ## MCP tools | 51 | ## MCP tools |
| 44 | 52 | ||
| 45 | Served over stdio JSON-RPC 2.0 from `plugin_websearch --mcp`, which is what the single | 53 | Served over stdio JSON-RPC 2.0 from `plugin_websearch --mcp`, which is what the single |
| @@ -140,6 +148,26 @@ tests/run.sh the offline suite | @@ -140,6 +148,26 @@ tests/run.sh the offline suite | ||
| 140 | tests/e2e.py Playwright viewport + behaviour suite | 148 | tests/e2e.py Playwright viewport + behaviour suite |
| 141 | ``` | 149 | ``` |
| 142 | 150 | ||
| 151 | +## Verification tier | ||
| 152 | + | ||
| 153 | +`plugin.json` says `"verified": "mock"` and the discovery line repeats it. That is | ||
| 154 | +deliberate, and it is the honest answer for this connector: | ||
| 155 | + | ||
| 156 | +* **Verified against a recording mock, end to end.** `tests/mockapi.py` serves all six | ||
| 157 | + providers, records the method, path, query, credential header and JSON body of every | ||
| 158 | + request it receives, and the suite diffs that against what each provider's API | ||
| 159 | + documents. That is 84 assertions covering request shape, normalisation, error text, | ||
| 160 | + auth gating and secret hygiene — the part a plugin can be *wrong* about. | ||
| 161 | +* **Not verified with a paid key.** Searching Brave/Tavily/Exa/Perplexity for real | ||
| 162 | + needs a paid account, and a plugin that claims `"live"` on the strength of a mock has | ||
| 163 | + told you nothing. The unauthenticated paths were exercised against the real hosts: | ||
| 164 | + Brave answers a well-formed request with its own `422 SUBSCRIPTION_TOKEN_INVALID` (so | ||
| 165 | + TLS, the endpoint, the header name and the error path are all proven end to end), and | ||
| 166 | + DuckDuckGo answers the real `html.duckduckgo.com` — including its rate limit, which is | ||
| 167 | + why this document names it. | ||
| 168 | + | ||
| 169 | +Flip it to `"live"` when someone runs it with a real key and says so. | ||
| 170 | + | ||
| 143 | ## Security | 171 | ## Security |
| 144 | 172 | ||
| 145 | See [docs/SECURITY.md](docs/SECURITY.md). The short version: TLS is verified against a | 173 | See [docs/SECURITY.md](docs/SECURITY.md). The short version: TLS is verified against a |
| index 9bf51ed..e169b42 100644 | index 9bf51ed..e169b42 100644 | ||
| --- a/plugin.json | --- a/plugin.json | ||
| +++ b/plugin.json | +++ b/plugin.json | ||
| @@ -9,9 +9,9 @@ | @@ -9,9 +9,9 @@ | ||
| 9 | "mcp": true, | 9 | "mcp": true, |
| 10 | "daemon": false, | 10 | "daemon": false, |
| 11 | "menus": false, | 11 | "menus": false, |
| 12 | - "verified": "live", | 12 | + "verified": "mock", |
| 13 | "category": "network", | 13 | "category": "network", |
| 14 | - "version": "1.0.1", | 14 | + "version": "1.0.2", |
| 15 | "license": "MIT", | 15 | "license": "MIT", |
| 16 | "capabilities": [ | 16 | "capabilities": [ |
| 17 | "outbound_https_search_api", | 17 | "outbound_https_search_api", |
| index fc80578..980ff65 100644 | index fc80578..980ff65 100644 | ||
| --- a/src/plugin_websearch.c | --- a/src/plugin_websearch.c | ||
| +++ b/src/plugin_websearch.c | +++ b/src/plugin_websearch.c | ||
| @@ -78,7 +78,7 @@ static void sx_plugin_binary_stdio(void) | @@ -78,7 +78,7 @@ static void sx_plugin_binary_stdio(void) | ||
| 78 | static int mode_meta(void) | 78 | static int mode_meta(void) |
| 79 | { | 79 | { |
| 80 | printf("{\"name\":\"%s\",\"desc\":\"%s\",\"kind\":\"mcp\",\"mcp\":true," | 80 | printf("{\"name\":\"%s\",\"desc\":\"%s\",\"kind\":\"mcp\",\"mcp\":true," |
| 81 | - "\"daemon\":false,\"menus\":false,\"verified\":\"live\"," | 81 | + "\"daemon\":false,\"menus\":false,\"verified\":\"mock\"," |
| 82 | "\"category\":\"network\",\"version\":\"%s\"}\n", | 82 | "\"category\":\"network\",\"version\":\"%s\"}\n", |
| 83 | WS_NAME, WS_DESC, WS_VER); | 83 | WS_NAME, WS_DESC, WS_VER); |
| 84 | fflush(stdout); | 84 | fflush(stdout); |
| index 01e9a9a..8301ad0 100644 | index 01e9a9a..8301ad0 100644 | ||
| --- a/src/ws.h | --- a/src/ws.h | ||
| +++ b/src/ws.h | +++ b/src/ws.h | ||
| @@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
| 32 | 32 | ||
| 33 | #define WS_SLUG "websearch" | 33 | #define WS_SLUG "websearch" |
| 34 | #define WS_ID "plugin_websearch" | 34 | #define WS_ID "plugin_websearch" |
| 35 | -#define WS_VER "1.0.1" | 35 | +#define WS_VER "1.0.2" |
| 36 | #define WS_NAME "websearch" | 36 | #define WS_NAME "websearch" |
| 37 | #define WS_DESC "Web search MCP" | 37 | #define WS_DESC "Web search MCP" |
| 38 | 38 |
| index dad6c45..f114706 100755 | index dad6c45..f114706 100755 | ||
| --- a/tests/run.sh | --- a/tests/run.sh | ||
| +++ b/tests/run.sh | +++ b/tests/run.sh | ||
| @@ -148,7 +148,11 @@ json_ok "kind is mcp, mcp true, menus false" \ | @@ -148,7 +148,11 @@ json_ok "kind is mcp, mcp true, menus false" \ | ||
| 148 | "$META" 'd["kind"]=="mcp" and d["mcp"] is True and d["menus"] is False' | 148 | "$META" 'd["kind"]=="mcp" and d["mcp"] is True and d["menus"] is False' |
| 149 | json_ok "daemon is false" "$META" 'd["daemon"] is False' | 149 | json_ok "daemon is false" "$META" 'd["daemon"] is False' |
| 150 | json_ok "category is network" "$META" 'd["category"]=="network"' | 150 | json_ok "category is network" "$META" 'd["category"]=="network"' |
| 151 | +json_ok "verified is mock (an honest tier: the suite drives a mock, not a paid key)" \ | ||
| 152 | + "$META" 'd["verified"]=="mock"' | ||
| 151 | check "SX_PLUGIN_META=1 agrees" '"name":"websearch"' "$(SX_PLUGIN_META=1 "$BIN")" | 153 | check "SX_PLUGIN_META=1 agrees" '"name":"websearch"' "$(SX_PLUGIN_META=1 "$BIN")" |
| 154 | +json_ok "--meta version agrees with plugin.json" "$META" \ | ||
| 155 | + 'd["version"]==__import__("json").load(open("plugin.json"))["version"]' | ||
| 152 | VER=$(python3 -c 'import json;print(json.load(open("plugin.json"))["version"])') | 156 | VER=$(python3 -c 'import json;print(json.load(open("plugin.json"))["version"])') |
| 153 | check "--version agrees with plugin.json" "$VER" "$("$BIN" --version)" | 157 | check "--version agrees with plugin.json" "$VER" "$("$BIN" --version)" |
| 154 | check "--help mentions the tool names" 'web_search' "$("$BIN" --help)" | 158 | check "--help mentions the tool names" 'web_search' "$("$BIN" --help)" |
| 155 | 159 |