Repository navigation
Agents Manager: WebMCP for isDevMode - #113839
Conversation
|
WordPress.com
Automattic for Agencies
|
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Webpack Runtime (~29 bytes added 📈 [gzipped]) Details
Webpack runtime for loading modules. It is included in the HTML page as an inline script. Is downloaded and parsed every time the app is loaded. App Entrypoints (~4 bytes added 📈 [gzipped]) Details
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~2389 bytes added 📈 [gzipped]) Details
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~1316 bytes added 📈 [gzipped]) Details
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. |
f132015 to
b5412af
Compare
|
Native built-in-browser verification completed on the artpitesting test site. Codex discovered both page-defined Site tools through the browser WebMCP proxy (no DevTools execution), called |
|
Native Codex built-in browser verification completed against the wpdev-synced build at
The PR testing instructions now document this Codex-native path and the direct browser API fallback separately. |
782e2db to
f7c4b63
Compare
|
This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/35211514 Some locales (Arabic, Brazilian Portuguese, Chinese (China), Dutch, French, German, Hebrew, Japanese, Korean, Russian, Spanish) have been temporarily machine-translated due to translator availability. All other translations are usually ready within a few days. Untranslated and machine-translated strings will be sent for translation next Monday and are expected to be completed by the following Friday. Thank you @artpi for including a screenshot in the description! This is really helpful for our translators. |
Part of BSKY-2070
This exposes a deliberately small set of abilities through WebMCP on Gutenberg canvases while Agents Manager reports
isDevMode. The browser supplies the model and reasoning; the adapter does not start an Agenttic agent or open Agents Manager chat.Proposed Changes
isDevModecheck.agents_manager__get_block_tree,big_sky__show_template, andbig_sky__apply_block_edits.wpcom__get_block_schemas,wpcom__get_content_guidelines,wpcom__get_posts,wpcom__get_site_stats,wpcom__patterns_list,wpcom__patterns_get, andcore__get_site_info.wpcom__media_createas the sole explicitly allowlisted mutating server ability. Mutating calls use POST with a JSON body, while read-only calls remain GET.wpcom__patterns_get, parse it in the browser, and stage all top-level blocks in order.What's next?
Testing Instructions
Automated
yarn jest -c test/packages/jest.config.js --runInBand --testPathPattern=agents-managerNODE_OPTIONS=--max-old-space-size=8192 yarn typecheck-clientyarn eslint packages/agents-manager/src/webmcp/contracts.ts packages/agents-manager/src/webmcp/adapter.ts packages/agents-manager/src/webmcp/server-ability-provider.ts packages/agents-manager/src/webmcp/__tests__/server-ability-provider.test.ts packages/agents-manager/src/webmcp/__tests__/adapter.test.tsCodex built-in browser
public-api.wordpress.comin the sandbox routing.widgets.wp.comand runNODE_OPTIONS=--max-old-space-size=8192 WPCOM_SANDBOX=wpdev yarn dev --syncfromapps/agents-manager.isDevModeis true.wpcom__media_create,wpcom__patterns_list, andwpcom__patterns_get.wpcom__patterns_list, fetch a suitable pattern withwpcom__patterns_get, and pass its returnedcontenttobig_sky__apply_block_editsasinserts[0].blockMarkup.wpcom__media_createwith a small base64-encoded image. Confirm the response includes a valid attachment ID and URL, then delete the test attachment from the media library.isDevModefalse and confirm the editor exposes no WebMCP tools and the base Agents Manager UI still opens, sends a message, and handles history normally.Verified
NODE_OPTIONS=--max-old-space-size=8192 yarn typecheck-clientpasses.wpcom__patterns_listreturned the live pattern library andwpcom__patterns_getreturned the serialized content fora8c/page-title-1.big_sky__apply_block_editsstaged the complete seven-block pattern (4 → 11blocks), then cleanup returned the tree to four blocks without publishing.wpcom__media_createsuccessfully uploaded a 68-byte PNG as attachment 617 with the expected ID, URL, MIME, dimensions, alt text, and edit link. The test attachment was deleted and wpdev was restored to read-only mode.Pre-merge Checklist