@yawlabs/mcp-compliance 0.12.0 → 0.12.1

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.
@@ -15,7 +15,11 @@ function generateBadge(url) {
15
15
  imageUrl,
16
16
  reportUrl,
17
17
  markdown: `[![MCP Compliant](${imageUrl})](${reportUrl})`,
18
- html: `<a href="${reportUrl}"><img src="${imageUrl}" alt="MCP Compliant"></a>`
18
+ // loading="lazy" so READMEs that embed many badges don't block first
19
+ // paint on this image. Markdown renderers (GitHub, npmjs.com) emit
20
+ // their own <img> from the markdown form so the attribute only
21
+ // matters for the HTML form people paste into custom pages.
22
+ html: `<a href="${reportUrl}"><img src="${imageUrl}" alt="MCP Compliant" loading="lazy"></a>`
19
23
  };
20
24
  }
21
25
 
@@ -1476,6 +1480,11 @@ async function runComplianceSuite(target, options = {}) {
1476
1480
  options.onTestComplete?.(result);
1477
1481
  }
1478
1482
  async function test(id, name, category, required, specRef, fn) {
1483
+ if (options.signal?.aborted) {
1484
+ if (inFlight.size > 0) await drainPool().catch(() => {
1485
+ });
1486
+ throw options.signal.reason ?? new Error("Aborted");
1487
+ }
1479
1488
  if (!shouldRun2(id, category)) return;
1480
1489
  const def = TEST_DEFINITIONS_MAP.get(id);
1481
1490
  const eligible = concurrency > 1 && def?.parallelSafe === true;
package/dist/index.js CHANGED
@@ -702,7 +702,11 @@ function generateBadge(url) {
702
702
  imageUrl,
703
703
  reportUrl,
704
704
  markdown: `[![MCP Compliant](${imageUrl})](${reportUrl})`,
705
- html: `<a href="${reportUrl}"><img src="${imageUrl}" alt="MCP Compliant"></a>`
705
+ // loading="lazy" so READMEs that embed many badges don't block first
706
+ // paint on this image. Markdown renderers (GitHub, npmjs.com) emit
707
+ // their own <img> from the markdown form so the attribute only
708
+ // matters for the HTML form people paste into custom pages.
709
+ html: `<a href="${reportUrl}"><img src="${imageUrl}" alt="MCP Compliant" loading="lazy"></a>`
706
710
  };
707
711
  }
708
712
 
@@ -1822,6 +1826,11 @@ async function runComplianceSuite(target, options = {}) {
1822
1826
  options.onTestComplete?.(result);
1823
1827
  }
1824
1828
  async function test(id, name, category, required, specRef, fn) {
1829
+ if (options.signal?.aborted) {
1830
+ if (inFlight.size > 0) await drainPool().catch(() => {
1831
+ });
1832
+ throw options.signal.reason ?? new Error("Aborted");
1833
+ }
1825
1834
  if (!shouldRun2(id, category)) return;
1826
1835
  const def = TEST_DEFINITIONS_MAP.get(id);
1827
1836
  const eligible = concurrency > 1 && def?.parallelSafe === true;
@@ -2,7 +2,7 @@ import {
2
2
  SPEC_BASE,
3
3
  TEST_DEFINITIONS,
4
4
  runComplianceSuite
5
- } from "../chunk-M67VVIRO.js";
5
+ } from "../chunk-G5K7CRWU.js";
6
6
 
7
7
  // src/mcp/server.ts
8
8
  import { existsSync, readFileSync } from "fs";
package/dist/runner.d.ts CHANGED
@@ -188,6 +188,17 @@ interface RunOptions {
188
188
  * docs/PERFORMANCE.md for the design.
189
189
  */
190
190
  concurrency?: number;
191
+ /**
192
+ * AbortSignal that cancels the suite mid-flight. When the signal fires,
193
+ * no further tests start; the in-flight test is cancelled if its
194
+ * underlying request supports the signal. The promise rejects with the
195
+ * signal's reason (an `AbortError` by default).
196
+ *
197
+ * Useful for live UIs (SSE, WebSocket) where the client may disconnect
198
+ * before the suite finishes — wiring the disconnect to abort here
199
+ * stops the server from burning compute on a dropped client.
200
+ */
201
+ signal?: AbortSignal;
191
202
  }
192
203
  /**
193
204
  * Run the full MCP compliance test suite. Accepts either a URL string
package/dist/runner.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  previewTests,
10
10
  runComplianceSuite,
11
11
  urlHash
12
- } from "./chunk-M67VVIRO.js";
12
+ } from "./chunk-G5K7CRWU.js";
13
13
  export {
14
14
  SPEC_BASE,
15
15
  SPEC_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/mcp-compliance",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "CLI tool and MCP server that tests MCP servers for spec compliance",
5
5
  "license": "MIT",
6
6
  "author": "Yaw Labs <contact@yaw.sh> (https://yaw.sh)",