Repository navigation
feat(webmcp): register the WebMCP tool catalog on form load - #1985
Conversation
|
Added the requested explicitly skipped Cypress authoring-to-preview scenario in ui.tests/test-module/specs/webmcp/webmcp.authoring.cy.js. It reuses the existing accessibility form, opens its container dialog, enables the WebMCP checkbox, saves, and previews the form. A test-only document.modelContext host is installed before runtime initialization; the actual runtime must register all 12 form tools plus list_forms. The test verifies one discoverable form and reads its real multi-field summary. Cleanup restores the original opt-in property so other accessibility tests are unaffected. FT_FORMS-28233 is enabled in the IT DynamicToggleProvider OSGi configuration. Cypress 13.17.0 compiled and collected the final spec with one pending test and zero failures, preserving describe.skip. The full authoring flow was not executed: the local instance returns 404 for both the accessibility collateral and the WebMCP dialog node. It needs matching deployed components, IT content, and IT toggle configuration before temporarily enabling the suite. |
|
Fixed the reported REST/spreadsheet JSON comparison failures without changing their fixtures. The optional Sling Boolean is now nullable and only exported when authored: absent means no fd:webMcpEnabled key; explicit true and explicit false retain their Boolean values. Runtime default opt-out is unchanged. All 72 v2 FormContainerImplTest tests pass, including both reported submission tests and three new map/JSON serialization regressions. Next I am running the temporarily unskipped Cypress authoring scenario against the newly installed collateral; the committed suite remains skipped. |
|
Actual local Cypress execution update: temporarily removed describe.skip and ran the authoring scenario against localhost:4502. The first run exposed a missing forms-components-examples page component. Deployed the examples application package and the accessibility form now renders correctly; the editor initializes on rerun. The second actual run fails only at the explicit FT_FORMS-28233 prerequisite in before(). The installed IT OSGi configuration contains the flag, but this AEM instance has only com.adobe.granite.toggle.impl.static (no development DynamicToggleProviderImpl), so the effective toggle endpoint does not enable it. The checkbox/save/preview/tool-registration flow has not yet executed and is not claimed to pass. Restored describe.skip; no authored opt-in was left on the shared accessibility fixture. Waiting for a toggle-enabled local setup to finish end-to-end verification. |
Expose each rendered form's WebMCP tool catalog to in-browser AI agents by calling registerFormWebMCP(model) from @aemforms/af-webmcp at the form-container bootstrap seam (Utils.setupFormContainer, after fields init). No-ops unless the form opted in via fd:webMcpEnabled and a browser modelContext is available, so default behaviour is unchanged. Adds @aemforms/af-webmcp as a dependency and to the jest ESM allowlist. Requires the @aemforms/af-core / @aemforms/af-webmcp release that ships the WebMCP catalog (buildFormTools + the form.webMcpEnabled getter); until it publishes, CI install of af-webmcp will fail. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Persist fd:webMcpEnabled from the Form Container dialog and explicitly export it in form JSON for the runtime adapter. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Explain the AI-assistant capabilities and user-confirmation boundary in the WebMCP authoring control. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the hook experimental and form-scoped, support pre-init and connected updates, and remove the page-global factory. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the established Granite featuretoggle render condition with FT_FORMS-28233, preserving the Boolean opt-in values and runtime contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the dialog XML test and its unused imports while retaining the authoring feature-toggle render condition. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reuse accessibility collateral, enable FT_FORMS-28233 in IT configuration, verify the dialog opt-in and actual preview catalog with a test host, and restore the shared form property after the test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the optional Sling property nullable and serialize authored Boolean values only. Preserve existing JSON fixtures and cover absent, enabled, and disabled exports. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Rebased the existing PR branch onto adobe/dev at f5c75dd and resolved the dependency-lock and IT-toggle conflicts. Kept upstream custom-functions 1.0.18 and CAPTCHA v3 FT_FORMS-27648, alongside the released core/formatters/WebMCP 1.0.6 packages and the conditional opt-in serialization fix. The updated history is pushed with an exact force-with-lease. Local Cypress validation is continuing before enabling the test in the PR. It exposed an outdated deployed Java bundle that does not export the authored opt-in; I am deploying the matching rebased bundle and finishing browser-context cleanup coverage. |
9c82737 to
738675c
Compare
Cover authoring String opt-in values, wait for the container dialog, install the preview host before runtime bootstrap, and restore the original property through authenticated browser cleanup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Pushed d4391aa. The WebMCP authoring Cypress spec is now enabled for the latest addon and passed two consecutive real local runs (1 passing, 0 pending, 0 skipped). It opens the existing accessibility form editor, enables the actual checkbox, saves, previews, verifies all 13 registered tools and completeness annotations, discovers one form, and reads a real summary with more than 10 fields. The preview-scoped fixture supplies only the browser modelContext transport; the form model, opt-in and registration remain real. Authenticated teardown succeeds and the shared opt-in is confirmed absent again. Added Java coverage for authoring String true/false conversion: all 74 v2 form-container tests pass, including both reported REST/spreadsheet JSON failures; existing expected JSON fixtures remain unchanged. After the adobe/dev rebase, all 45 frontend tests, standard/XFA production builds and the scoped ESLint check pass. Upstream CAPTCHA fixes, custom-functions 1.0.18 and the v3 toggle remain intact. PR description and developer setup guidance are updated. |
Accessibility Violations Found
|
1 similar comment
Accessibility Violations Found
|
Remove the persisted text-input fixture before each attempt and after failures through authenticated Sling requests, verify cleanup, and assert exactly one saved change handler without depending on JCR metadata serialization. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the public runtime release that restores validation of visible disabled fields. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Accessibility Violations Found
|
…sible dialogs Skip the WebMCP authoring suite when FT_FORMS-28233 is disabled. Query only the active insertion dialog and re-query search inputs after clearing to avoid hidden or detached controls. Cover retained dialogs and input replacement with browser regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… spec Keep the WebMCP authoring feature-toggle guard and its documentation unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
feat(webmcp): register the WebMCP tool catalog on form load Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Accessibility Violations Found
|
Accessibility Violations Found
|
Accessibility Violations Found
|
Accessibility Violations Found
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
What
Exposes each rendered form's WebMCP tool catalog to in-browser AI agents (Gemini-in-Chrome, ChatGPT Site tools, etc.) so they can drive the form through a declared tool catalog instead of scraping the DOM.
A single call at the form-container bootstrap seam (
Utils.setupFormContainer, right after fields are initialised) hands the af-core model to the adapter:Opt-in and safe by default
fd:webMcpEnabled(read by af-core'sform.webMcpEnabled). Absent → nothing registers.modelContextis available (SSR/unsupported browser).Changes
ui.frontend/src/utils.js— importregisterFormWebMCPand call it once per form load.ui.frontend/package.jsonand lockfile — align@aemforms/af-core,@aemforms/af-formatters, and@aemforms/af-webmcpto the published 1.0.6 release.ui.frontend/jest.config.js— allow@aemforms/af-webmcpthrough the ESM transform.ui.frontend/__tests__/webmcp.test.js— asserts the catalog is registered once with the form model.ui.frontend/__tests__/webmcp.integration.test.js— exercises the actual published packages, including opt-in, field mutation, focus bridging, RUM no-ops, completeness annotations, and registration cleanup.ui.tests/test-module/specs/webmcp/webmcp.authoring.cy.js— an enabled, latest-addon Cypress authoring-to-preview scenario using the existing accessibility form. It enables the container checkbox, previews the saved form with a preview-scoped test-only browser host installed before runtime scripts, asserts the actual 12-tool catalog pluslist_forms, and reads the form summary. Authenticated browser cleanup restores the original opt-in property and its type.FT_FORMS-28233inenabledToggles.Dependency / release note
The public npm release is available. All three runtime dependencies use
^1.0.6and resolve to 1.0.6 in the regenerated lockfile, with publicregistry.npmjs.orgtarballs. XFA and custom-function package versions remain independently versioned at 0.1.6 and 1.0.18 respectively.Validation
FormContainerImplTesttests pass, including the existing REST/spreadsheet submission JSON comparisons and absent/Boolean-true/Boolean-false/String-true/String-false WebMCP serialization coverage. Existing JSON fixtures are unchanged.adobe/devbase, including upstream CAPTCHA fixes, custom-functions 1.0.18, and both CAPTCHA v3 and WebMCP IT toggles.Design doc
Adaptive Forms Runtime via WebMCP (wiki)
🤖 Generated with Claude Code
Authoring opt-in
The Adaptive Form Container dialog exposes Enable AI assistant access (WebMCP) and persists the Boolean
fd:webMcpEnabledproperty.FormContainerImplexports this reserved property only when authored, preserving both explicittrueandfalse. An absent property is omitted so existing form JSON stays unchanged; af-core defaults to no tool registration.Jira tracking
FT_FORMS-28233; runtime access still requires the per-formfd:webMcpEnabledopt-in.