Skip to content

refactor: delete WebMCP bridge (v0.11 PR 3b/4) - #194

Merged
pluginslab merged 1 commit into
devfrom
feature/delete-webmcp-bridge
May 12, 2026
Merged

pluginslab merged 1 commit into
devfrom
feature/delete-webmcp-bridge

Conversation

@pluginslab

Copy link
Copy Markdown
Owner

Summary

Deletes the WebMCP integration that exposed agentic abilities to external AI agents via the WebMCP protocol. Per the v1 Roadmap doc, WebMCP is parked because "no browser support yet, speculative."

Net: -784 lines / +1 line, 6 files touched.

What's deleted

  • `src/extensions/services/webmcp-bridge.js` (288 lines) — the bridge service
  • `src/extensions/services/tests/webmcp-bridge.test.js` (470 lines) — 28-test suite

What's updated

  • `src/extensions/abilities/index.js` — dropped `webmcpBridge` import + the `isSupported() / initialize()` call after registration
  • `src/extensions/App.jsx` — dropped the cleanup `useEffect` that called `webmcpBridge.cleanup()`
  • `src/extensions/services/agentic-abilities-api.js` — dropped the `window.wp.agenticAdmin.webmcp` public API
  • `includes/functions-abilities.php` — reworded a comment that called `inputSchema` "for WebMCP tool registration" (field is now just for JS-side input validation)

Recovery path

Future revival when WebMCP ships in mainstream browsers:

```bash
git show v0.10.0:src/extensions/services/webmcp-bridge.js > src/extensions/services/webmcp-bridge.js
```

Then restore the import + initialize call in `abilities/index.js` and the cleanup in `App.jsx`.

Verification

  • `npm test` — 89 passing (was 117; the webmcp-bridge suite of 28 tests is now gone)
  • `npm run build` — succeeds, no orphan import errors
  • `composer lint` — clean
  • `npx wp-scripts lint-js` — clean on all 3 changed JS files
  • Reference scan: `grep -ri "webmcp"` returns zero hits in src/, includes/, tests/

Roadmap context

PR Status
#191 Manifest pattern ✅ merged
#192 Voice out of default build ✅ merged
#193 Delete 4 simple abilities (open, CI green)
This PR Delete webmcp-bridge
TBD PR 3c: delete feedback system (~1500 LoC, 9 files)
TBD PR 4: flip manifest default to core+local-only

Test plan

  • Build check passes
  • PHP lint passes
  • JS lint passes
  • Unit tests pass (89)
  • Manual: load plugin in playground; no console errors about missing webmcp module

🤖 Generated with Claude Code

Removes the WebMCP integration that exposed agentic abilities to
external AI agents via the WebMCP protocol.

Per the v1 Roadmap doc, WebMCP is parked as "speculative — no browser
support yet." Future revival can lift the deleted module from the
v0.10-era git history (commit before 09bdf3c) when the spec ships
in mainstream browsers.

Deleted:
  - src/extensions/services/webmcp-bridge.js (288 lines)
  - src/extensions/services/__tests__/webmcp-bridge.test.js (470 lines)

Updated:
  - src/extensions/abilities/index.js — dropped webmcpBridge import + the
    isSupported / initialize call on registration
  - src/extensions/App.jsx — dropped the cleanup useEffect
  - src/extensions/services/agentic-abilities-api.js — dropped the
    window.wp.agenticAdmin.webmcp public API
  - includes/functions-abilities.php — reworded a comment that called
    inputSchema "for WebMCP tool registration"; the field is now just
    for JS-side input validation

Tests: 89 passing (was 117; the 28-test webmcp-bridge suite is gone).
Build: clean.
Lint: clean (PHP + JS).
Reference scan: zero remaining webmcp/WebMCP hits in src/ includes/ tests/.

Roadmap context:
  - PR #191: manifest pattern ✅
  - PR #192: voice out of default build ✅
  - PR #193: delete 4 simple abilities (queued)
  - PR 3b (this): delete webmcp-bridge
  - PR 3c (next): delete feedback system
  - PR 4 (last): flip manifest default to core+local-only

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@pluginslab
pluginslab merged commit 0a272c7 into dev May 12, 2026
4 checks passed
@pluginslab
pluginslab deleted the feature/delete-webmcp-bridge branch May 12, 2026 08:06
pluginslab added a commit that referenced this pull request May 12, 2026
Last piece of the v0.11 strip-down. Labs (parked) abilities now require
opt-in to be registered, completing the WordPress.org submission path.

PHP — includes/abilities-manifest.php:
  resolve_enabled_abilities() now gates the labs array on the
  WP_AGENTIC_ADMIN_ENABLE_LABS constant. The wp_agentic_admin_enabled_abilities
  filter remains the per-ability override path:

    define( 'WP_AGENTIC_ADMIN_ENABLE_LABS', true );        // all labs
    add_filter( 'wp_agentic_admin_enabled_abilities', ... ); // selective

  New helper: wp_agentic_admin_labs_enabled() — single source of truth
  for the boolean.

PHP — includes/class-admin-page.php:
  Localizes two new fields on window.wpAgenticAdmin:
    - enabledAbilities: PHP-resolved slug list (the result of the
      filter above)
    - enableLabs: bool, mirrors wp_agentic_admin_labs_enabled()

  PHP becomes authoritative for which PHP-backed abilities the JS
  manifest registers.

JS — src/extensions/abilities/manifest.js:
  New JS_ONLY_ABILITIES set captures the slugs that have no PHP
  register function (current-user-role, core-site-info, core-environment-info,
  codebase-index, code-search, wp-config-list, content-generate).
  PHP's enabledAbilities list can't include these, so JS adds them
  back. Members that are also LABS are gated by enableLabs.

JS — src/extensions/abilities/index.js:
  registerAllAbilities() now delegates slug resolution to a new
  exported resolveEnabledSlugs() function:
    - With PHP-localized enabledAbilities: register that list ∪
      (JS_ONLY_ABILITIES minus labs-when-off)
    - Without (tests / dev): register all REGISTRARS minus LABS
      unless enableLabs is set

  Falls back gracefully when window.wpAgenticAdmin is unset, so
  Jest tests don't have to mock the global.

Tests:
  - manifest.test.js: 2 new cases covering JS_ONLY_ABILITIES contract
  - index.test.js (new file, 6 cases): PHP-authoritative path with
    labs on/off, empty PHP list edge case, fallback path with and
    without enableLabs

PHP smoke verification (manual):
  Without constant: 33 abilities resolved (CORE + LOCAL_ONLY)
  With constant:    39 abilities resolved (+6 labs)

Tests: 124 passing (was 117, +7 new).
Build: clean.
Lint: clean (PHP + JS + Prettier).

Roadmap context — END OF v0.11 STRIP-DOWN:
  - PR #191: manifest pattern ✅ merged
  - PR #192: voice out of default build ✅ merged
  - PR #193: delete 4 simple abilities (open)
  - PR #194: delete webmcp-bridge (open)
  - PR #195: delete feedback system (open)
  - PR 4 (this): flip default to core+local-only

After all six merge: ~3,800 LoC removed, 819 KB shipped bundle
dropped, 35 PHP abilities registered by default (down from 39),
plugin ready for WP.org submission (modulo the remaining 6 security
+ 6 compliance issues from the roadmap).

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant