| index 4059c9f..48977aa 100644 | ||
| --- a/README.md | ||
| +++ b/README.md | ||
| @@ -177,6 +177,30 @@ deliberate, and it is the honest answer for this connector: | ||
| 177 | 177 | |
| 178 | 178 | Flip it to `"live"` when someone runs it with a real key and says so. |
| 179 | 179 | |
| 180 | +## Building it | |
| 181 | + | |
| 182 | +`plugin.json` declares the two commands the marketplace publishes as | |
| 183 | +`build_cmd_posix` / `build_cmd_win64`: | |
| 184 | + | |
| 185 | +```json | |
| 186 | +"build_cmd_posix": "make", | |
| 187 | +"build_cmd_win64": "make win64" | |
| 188 | +``` | |
| 189 | + | |
| 190 | +That is the author's declaration, and it is the difference between a working | |
| 191 | +"copy the agent build command" button and a broken one. The CLI's pre-1.4.0 | |
| 192 | +default was a single-source line | |
| 193 | + | |
| 194 | +``` | |
| 195 | +cc -O2 -std=c99 -Wall -Wextra -o plugin_websearch src/plugin_websearch.c | |
| 196 | +``` | |
| 197 | + | |
| 198 | +which cannot build this repository: it names one of six sources, omits the 277 | |
| 199 | +vendored BearSSL translation units and `vendor/yyjson.c`, and does not pass | |
| 200 | +`-I vendor` — so it fails on `#include "yyjson.h"` before it ever links. The | |
| 201 | +suite asserts the declaration (and that `win64` is a real Makefile target) | |
| 202 | +instead of trusting it. | |
| 203 | + | |
| 180 | 204 | ## Security |
| 181 | 205 | |
| 182 | 206 | See [docs/SECURITY.md](docs/SECURITY.md). The short version: TLS is verified against a |
| index 786c1d9..dc20f31 100644 | ||
| --- a/plugin.json | ||
| +++ b/plugin.json | ||
| @@ -11,7 +11,7 @@ | ||
| 11 | 11 | "menus": false, |
| 12 | 12 | "verified": "mock", |
| 13 | 13 | "category": "network", |
| 14 | - "version": "1.0.3", | |
| 14 | + "version": "1.0.4", | |
| 15 | 15 | "license": "MIT", |
| 16 | 16 | "capabilities": [ |
| 17 | 17 | "outbound_https_search_api", |
| @@ -27,5 +27,7 @@ | ||
| 27 | 27 | "ldflags_win64": [ |
| 28 | 28 | "-lws2_32", |
| 29 | 29 | "-ladvapi32" |
| 30 | - ] | |
| 30 | + ], | |
| 31 | + "build_cmd_posix": "make", | |
| 32 | + "build_cmd_win64": "make win64" | |
| 31 | 33 | } |
| index 14ac690..ba609bc 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.3" | |
| 35 | +#define WS_VER "1.0.4" | |
| 36 | 36 | #define WS_NAME "websearch" |
| 37 | 37 | #define WS_DESC "Web search MCP" |
| 38 | 38 |
| index 7bda96b..5166897 100755 | ||
| --- a/tests/run.sh | ||
| +++ b/tests/run.sh | ||
| @@ -379,6 +379,33 @@ NOPWD=$(QUERY_STRING="action=providers&format=json" REQUEST_METHOD=GET BOT_PASSW | ||
| 379 | 379 | SWEBSEARCH_CONFIG_DIR="$CFGDIR" "$BIN") |
| 380 | 380 | check "the JSON API is behind the same auth gate" '401 Unauthorized' "$NOPWD" |
| 381 | 381 | |
| 382 | +# ---------------------------------------------------------------- build cmd | |
| 383 | +section "the advertised build command actually builds the plugin" | |
| 384 | +# `build_cmd_posix` is what the marketplace's "copy the agent build command" | |
| 385 | +# button hands to a user's agent, so a wrong string is a broken promise - and | |
| 386 | +# the CLI's pre-1.4.0 default was a single-source `cc` line that cannot build a | |
| 387 | +# repo with six sources and two vendored libraries. The author declares it here | |
| 388 | +# (rule 1 of the CLI's own precedence) and this asserts the declaration is the | |
| 389 | +# one that works, not merely that it exists. | |
| 390 | +json_ok "plugin.json declares build_cmd_posix" "$(cat plugin.json)" \ | |
| 391 | + 'd.get("build_cmd_posix")=="make"' | |
| 392 | +json_ok "plugin.json declares build_cmd_win64" "$(cat plugin.json)" \ | |
| 393 | + 'd.get("build_cmd_win64")=="make win64"' | |
| 394 | +json_ok "the declared win64 build is a real Makefile target" "$(cat plugin.json)" \ | |
| 395 | + 'open("Makefile").read().find("\nwin64:") >= 0' | |
| 396 | +# the legacy single-source line is provably wrong here: it neither passes -I nor | |
| 397 | +# names the vendored translation units. Prove that rather than assert it. | |
| 398 | +if [ "$(ls src/*.c | wc -l)" -gt 1 ]; then | |
| 399 | + pass "repo has more than one translation unit (a one-line cc cannot build it)" | |
| 400 | +else | |
| 401 | + fail "expected more than one source file" | |
| 402 | +fi | |
| 403 | +if grep -q -- '-I vendor' Makefile; then | |
| 404 | + pass "the Makefile passes -I vendor (the one-line cc does not)" | |
| 405 | +else | |
| 406 | + fail "Makefile does not pass -I vendor" | |
| 407 | +fi | |
| 408 | + | |
| 382 | 409 | # ---------------------------------------------------------------- source |
| 383 | 410 | section "source guards" |
| 384 | 411 | if grep -rn --include='*.c' --include='*.h' -E '\b(popen|system|execv|fork)\s*\(' src/ >/dev/null 2>&1; then |
| 385 | 412 |
| index 4059c9f..48977aa 100644 | index 4059c9f..48977aa 100644 | ||
| --- a/README.md | --- a/README.md | ||
| +++ b/README.md | +++ b/README.md | ||
| @@ -177,6 +177,30 @@ deliberate, and it is the honest answer for this connector: | @@ -177,6 +177,30 @@ deliberate, and it is the honest answer for this connector: | ||
| 177 | 177 | ||
| 178 | Flip it to `"live"` when someone runs it with a real key and says so. | 178 | Flip it to `"live"` when someone runs it with a real key and says so. |
| 179 | 179 | ||
| 180 | +## Building it | ||
| 181 | + | ||
| 182 | +`plugin.json` declares the two commands the marketplace publishes as | ||
| 183 | +`build_cmd_posix` / `build_cmd_win64`: | ||
| 184 | + | ||
| 185 | +```json | ||
| 186 | +"build_cmd_posix": "make", | ||
| 187 | +"build_cmd_win64": "make win64" | ||
| 188 | +``` | ||
| 189 | + | ||
| 190 | +That is the author's declaration, and it is the difference between a working | ||
| 191 | +"copy the agent build command" button and a broken one. The CLI's pre-1.4.0 | ||
| 192 | +default was a single-source line | ||
| 193 | + | ||
| 194 | +``` | ||
| 195 | +cc -O2 -std=c99 -Wall -Wextra -o plugin_websearch src/plugin_websearch.c | ||
| 196 | +``` | ||
| 197 | + | ||
| 198 | +which cannot build this repository: it names one of six sources, omits the 277 | ||
| 199 | +vendored BearSSL translation units and `vendor/yyjson.c`, and does not pass | ||
| 200 | +`-I vendor` — so it fails on `#include "yyjson.h"` before it ever links. The | ||
| 201 | +suite asserts the declaration (and that `win64` is a real Makefile target) | ||
| 202 | +instead of trusting it. | ||
| 203 | + | ||
| 180 | ## Security | 204 | ## Security |
| 181 | 205 | ||
| 182 | See [docs/SECURITY.md](docs/SECURITY.md). The short version: TLS is verified against a | 206 | See [docs/SECURITY.md](docs/SECURITY.md). The short version: TLS is verified against a |
| index 786c1d9..dc20f31 100644 | index 786c1d9..dc20f31 100644 | ||
| --- a/plugin.json | --- a/plugin.json | ||
| +++ b/plugin.json | +++ b/plugin.json | ||
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | "menus": false, | 11 | "menus": false, |
| 12 | "verified": "mock", | 12 | "verified": "mock", |
| 13 | "category": "network", | 13 | "category": "network", |
| 14 | - "version": "1.0.3", | 14 | + "version": "1.0.4", |
| 15 | "license": "MIT", | 15 | "license": "MIT", |
| 16 | "capabilities": [ | 16 | "capabilities": [ |
| 17 | "outbound_https_search_api", | 17 | "outbound_https_search_api", |
| @@ -27,5 +27,7 @@ | @@ -27,5 +27,7 @@ | ||
| 27 | "ldflags_win64": [ | 27 | "ldflags_win64": [ |
| 28 | "-lws2_32", | 28 | "-lws2_32", |
| 29 | "-ladvapi32" | 29 | "-ladvapi32" |
| 30 | - ] | 30 | + ], |
| 31 | + "build_cmd_posix": "make", | ||
| 32 | + "build_cmd_win64": "make win64" | ||
| 31 | } | 33 | } |
| index 14ac690..ba609bc 100644 | index 14ac690..ba609bc 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.3" | 35 | +#define WS_VER "1.0.4" |
| 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 7bda96b..5166897 100755 | index 7bda96b..5166897 100755 | ||
| --- a/tests/run.sh | --- a/tests/run.sh | ||
| +++ b/tests/run.sh | +++ b/tests/run.sh | ||
| @@ -379,6 +379,33 @@ NOPWD=$(QUERY_STRING="action=providers&format=json" REQUEST_METHOD=GET BOT_PASSW | @@ -379,6 +379,33 @@ NOPWD=$(QUERY_STRING="action=providers&format=json" REQUEST_METHOD=GET BOT_PASSW | ||
| 379 | SWEBSEARCH_CONFIG_DIR="$CFGDIR" "$BIN") | 379 | SWEBSEARCH_CONFIG_DIR="$CFGDIR" "$BIN") |
| 380 | check "the JSON API is behind the same auth gate" '401 Unauthorized' "$NOPWD" | 380 | check "the JSON API is behind the same auth gate" '401 Unauthorized' "$NOPWD" |
| 381 | 381 | ||
| 382 | +# ---------------------------------------------------------------- build cmd | ||
| 383 | +section "the advertised build command actually builds the plugin" | ||
| 384 | +# `build_cmd_posix` is what the marketplace's "copy the agent build command" | ||
| 385 | +# button hands to a user's agent, so a wrong string is a broken promise - and | ||
| 386 | +# the CLI's pre-1.4.0 default was a single-source `cc` line that cannot build a | ||
| 387 | +# repo with six sources and two vendored libraries. The author declares it here | ||
| 388 | +# (rule 1 of the CLI's own precedence) and this asserts the declaration is the | ||
| 389 | +# one that works, not merely that it exists. | ||
| 390 | +json_ok "plugin.json declares build_cmd_posix" "$(cat plugin.json)" \ | ||
| 391 | + 'd.get("build_cmd_posix")=="make"' | ||
| 392 | +json_ok "plugin.json declares build_cmd_win64" "$(cat plugin.json)" \ | ||
| 393 | + 'd.get("build_cmd_win64")=="make win64"' | ||
| 394 | +json_ok "the declared win64 build is a real Makefile target" "$(cat plugin.json)" \ | ||
| 395 | + 'open("Makefile").read().find("\nwin64:") >= 0' | ||
| 396 | +# the legacy single-source line is provably wrong here: it neither passes -I nor | ||
| 397 | +# names the vendored translation units. Prove that rather than assert it. | ||
| 398 | +if [ "$(ls src/*.c | wc -l)" -gt 1 ]; then | ||
| 399 | + pass "repo has more than one translation unit (a one-line cc cannot build it)" | ||
| 400 | +else | ||
| 401 | + fail "expected more than one source file" | ||
| 402 | +fi | ||
| 403 | +if grep -q -- '-I vendor' Makefile; then | ||
| 404 | + pass "the Makefile passes -I vendor (the one-line cc does not)" | ||
| 405 | +else | ||
| 406 | + fail "Makefile does not pass -I vendor" | ||
| 407 | +fi | ||
| 408 | + | ||
| 382 | # ---------------------------------------------------------------- source | 409 | # ---------------------------------------------------------------- source |
| 383 | section "source guards" | 410 | section "source guards" |
| 384 | if grep -rn --include='*.c' --include='*.h' -E '\b(popen|system|execv|fork)\s*\(' src/ >/dev/null 2>&1; then | 411 | if grep -rn --include='*.c' --include='*.h' -E '\b(popen|system|execv|fork)\s*\(' src/ >/dev/null 2>&1; then |
| 385 | 412 |