@mcp-b/global 1.3.0 → 1.5.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/README.md CHANGED
@@ -552,6 +552,8 @@ initializeWebModelContext({
552
552
 
553
553
  This package **automatically detects and integrates** with Chromium's native Web Model Context API when available. No configuration needed - it just works!
554
554
 
555
+ For standards/source tracking and future conformance planning, see `./WEBMCP-CONFORMANCE-REFERENCES.md`.
556
+
555
557
  ### Automatic Detection & Integration
556
558
 
557
559
  When you call `initializeWebModelContext()` (or when auto-initialization runs):
@@ -1371,6 +1373,37 @@ if (window.__mcpBridge) {
1371
1373
 
1372
1374
  This package provides a **Model Context Testing API** at `window.navigator.modelContextTesting` for debugging and testing your tools during development.
1373
1375
 
1376
+ > [!WARNING]
1377
+ > `navigator.modelContextTesting` is deprecated and kept for compatibility.
1378
+ > For in-page consumers, use `navigator.modelContext.callTool({ name, arguments })` and
1379
+ > `navigator.modelContext.addEventListener("toolschanged", ...)`.
1380
+
1381
+ ### Unified Consumer API (Recommended)
1382
+
1383
+ ```javascript
1384
+ // Execute tools with object args (no JSON stringification)
1385
+ const result = await navigator.modelContext.callTool({
1386
+ name: "greet",
1387
+ arguments: { name: "Alice" }
1388
+ });
1389
+
1390
+ // React to tool list changes
1391
+ navigator.modelContext.addEventListener("toolschanged", () => {
1392
+ console.log("Tools changed:", navigator.modelContext.listTools());
1393
+ });
1394
+ ```
1395
+
1396
+ ### Testing Helpers Module
1397
+
1398
+ Use `@mcp-b/global/testing` to avoid depending on global-only testing extensions directly:
1399
+
1400
+ ```javascript
1401
+ import { createTestHelper } from "@mcp-b/global/testing";
1402
+
1403
+ const testing = createTestHelper();
1404
+ await testing.executeTool("greet", { name: "Alice" });
1405
+ ```
1406
+
1374
1407
  ### Native Support in Chromium
1375
1408
 
1376
1409
  **IMPORTANT**: The `modelContextTesting` API is available natively in Chromium-based browsers when the experimental feature flag is enabled. This polyfill will detect and use the native implementation when available.