shadow-claw 1.32.0 → 1.33.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/.well-known/mcp/server-card.json +1 -1
- package/.well-known/mcp.json +1 -1
- package/dist/electron/main.cjs +1 -1
- package/dist/lib/components/index.js +26 -26
- package/dist/lib/components/settings/shadow-claw-accounts.js +1 -1
- package/dist/lib/components/settings/shadow-claw-channel-config.js +1 -1
- package/dist/lib/components/settings/shadow-claw-control-plane.js +1 -1
- package/dist/lib/components/settings/shadow-claw-git.js +1 -1
- package/dist/lib/components/settings/shadow-claw-integrations.js +1 -1
- package/dist/lib/components/settings/shadow-claw-llm.js +1 -1
- package/dist/lib/components/settings/shadow-claw-mcp-remote.js +1 -1
- package/dist/lib/components/settings/shadow-claw-networking.js +1 -1
- package/dist/lib/components/settings/shadow-claw-notifications.js +1 -1
- package/dist/lib/components/settings/shadow-claw-peerjs.js +1 -1
- package/dist/lib/components/settings/shadow-claw-storage.js +1 -1
- package/dist/lib/components/settings/shadow-claw-task-server.js +1 -1
- package/dist/lib/components/settings/shadow-claw-webvm.js +1 -1
- package/dist/lib/components/shadow-claw-a2ui.js +1 -1
- package/dist/lib/components/shadow-claw-accounts.js +1 -1
- package/dist/lib/components/shadow-claw-channel-config.js +1 -1
- package/dist/lib/components/shadow-claw-channels.js +1 -1
- package/dist/lib/components/shadow-claw-chat.js +1 -1
- package/dist/lib/components/shadow-claw-control-plane.js +1 -1
- package/dist/lib/components/shadow-claw-conversations.js +1 -1
- package/dist/lib/components/shadow-claw-file-viewer.js +1 -1
- package/dist/lib/components/shadow-claw-files.js +1 -1
- package/dist/lib/components/shadow-claw-git.js +1 -1
- package/dist/lib/components/shadow-claw-integrations.js +1 -1
- package/dist/lib/components/shadow-claw-llm.js +1 -1
- package/dist/lib/components/shadow-claw-mcp-remote.js +1 -1
- package/dist/lib/components/shadow-claw-networking.js +1 -1
- package/dist/lib/components/shadow-claw-notifications.js +1 -1
- package/dist/lib/components/shadow-claw-page-header.js +1 -1
- package/dist/lib/components/shadow-claw-pages.js +1 -1
- package/dist/lib/components/shadow-claw-peerjs.js +1 -1
- package/dist/lib/components/shadow-claw-settings.js +1 -1
- package/dist/lib/components/shadow-claw-storage.js +1 -1
- package/dist/lib/components/shadow-claw-task-server.js +1 -1
- package/dist/lib/components/shadow-claw-tasks.js +1 -1
- package/dist/lib/components/shadow-claw-terminal.js +1 -1
- package/dist/lib/components/shadow-claw-tools.js +1 -1
- package/dist/lib/components/shadow-claw-webvm.js +1 -1
- package/dist/lib/components/shadow-claw.js +1 -1
- package/dist/lib/{config-DjZ9QWc4.js → config-BcFbkaQv.js} +21 -4
- package/dist/lib/config-BcFbkaQv.js.map +1 -0
- package/dist/lib/{configurePeerJs-DD3G3Pms.js → configurePeerJs-CBMPHbwa.js} +3 -3
- package/dist/lib/{configurePeerJs-DD3G3Pms.js.map → configurePeerJs-CBMPHbwa.js.map} +1 -1
- package/dist/lib/{connections-BURqMIUv.js → connections-PZrUDf49.js} +2 -2
- package/dist/lib/{connections-BURqMIUv.js.map → connections-PZrUDf49.js.map} +1 -1
- package/dist/lib/{downloadGroupFile-B8J4up2a.js → downloadGroupFile-DSRUa9Au.js} +2 -2
- package/dist/lib/{downloadGroupFile-B8J4up2a.js.map → downloadGroupFile-DSRUa9Au.js.map} +1 -1
- package/dist/lib/{file-viewer-DoHM75Jz.js → file-viewer-11VVOpJv.js} +5 -5
- package/dist/lib/{file-viewer-DoHM75Jz.js.map → file-viewer-11VVOpJv.js.map} +1 -1
- package/dist/lib/{getGroupDir-QrN2aTo8.js → getGroupDir-BxKMYPPm.js} +3 -3
- package/dist/lib/{getGroupDir-QrN2aTo8.js.map → getGroupDir-BxKMYPPm.js.map} +1 -1
- package/dist/lib/{git-Brr7JIbs.js → git-BppibnJW.js} +3 -3
- package/dist/lib/{git-Brr7JIbs.js.map → git-BppibnJW.js.map} +1 -1
- package/dist/lib/{iframe-sanitizer-Bujgq14T.js → iframe-sanitizer-Dp8EYffI.js} +2 -2
- package/dist/lib/{iframe-sanitizer-Bujgq14T.js.map → iframe-sanitizer-Dp8EYffI.js.map} +1 -1
- package/dist/lib/index.js +27 -27
- package/dist/lib/{initChatSplitResize-BjiWoqC_.js → initChatSplitResize-CE_kWaLf.js} +2 -2
- package/dist/lib/{initChatSplitResize-BjiWoqC_.js.map → initChatSplitResize-CE_kWaLf.js.map} +1 -1
- package/dist/lib/{initControlPlane-3TUdhRBM.js → initControlPlane-BRIIOzoH.js} +18 -17
- package/dist/lib/{initControlPlane-3TUdhRBM.js.map → initControlPlane-BRIIOzoH.js.map} +1 -1
- package/dist/lib/{markdown-BFUTPQoO.js → markdown-Cq4sVwUT.js} +4 -4
- package/dist/lib/{markdown-BFUTPQoO.js.map → markdown-Cq4sVwUT.js.map} +1 -1
- package/dist/lib/{mcp-reconnect-BxJ77WSb.js → mcp-reconnect-CoHDMjmY.js} +2 -2
- package/dist/lib/{mcp-reconnect-BxJ77WSb.js.map → mcp-reconnect-CoHDMjmY.js.map} +1 -1
- package/dist/lib/{memoryStorage-D3FBwO9T.js → memoryStorage-DcFWrn_y.js} +2 -2
- package/dist/lib/{memoryStorage-D3FBwO9T.js.map → memoryStorage-DcFWrn_y.js.map} +1 -1
- package/dist/lib/{orchestrator-DW5l2bbW.js → orchestrator-C3TgDZvq.js} +81 -18
- package/dist/lib/{orchestrator-DW5l2bbW.js.map → orchestrator-C3TgDZvq.js.map} +1 -1
- package/dist/lib/{orchestrator-DLnCmeTZ.js → orchestrator-Ce9_lmL2.js} +12 -12
- package/dist/lib/{orchestrator-DLnCmeTZ.js.map → orchestrator-Ce9_lmL2.js.map} +1 -1
- package/dist/lib/{peerjs-BXlMuIQn.js → peerjs-PTYQ7yEG.js} +6 -6
- package/dist/lib/{peerjs-BXlMuIQn.js.map → peerjs-PTYQ7yEG.js.map} +1 -1
- package/dist/lib/{push-client-B419nn-i.js → push-client-DDV5Rcg6.js} +3 -3
- package/dist/lib/{push-client-B419nn-i.js.map → push-client-DDV5Rcg6.js.map} +1 -1
- package/dist/lib/{readGroupFileBytes-CSA7u-nJ.js → readGroupFileBytes-7C8G-yps.js} +2 -2
- package/dist/lib/{readGroupFileBytes-CSA7u-nJ.js.map → readGroupFileBytes-7C8G-yps.js.map} +1 -1
- package/dist/lib/{shadow-claw-DmMO4vVG.js → shadow-claw-WrWoPqFx.js} +10 -10
- package/dist/lib/{shadow-claw-DmMO4vVG.js.map → shadow-claw-WrWoPqFx.js.map} +1 -1
- package/dist/lib/{shadow-claw-a2ui-2I5nffIn.js → shadow-claw-a2ui-CcmJNXQP.js} +2 -2
- package/dist/lib/{shadow-claw-a2ui-2I5nffIn.js.map → shadow-claw-a2ui-CcmJNXQP.js.map} +1 -1
- package/dist/lib/{shadow-claw-accounts-DMb0y4ca.js → shadow-claw-accounts-CcB2429E.js} +3 -3
- package/dist/lib/{shadow-claw-accounts-DMb0y4ca.js.map → shadow-claw-accounts-CcB2429E.js.map} +1 -1
- package/dist/lib/{shadow-claw-channel-config-BhxHf6wZ.js → shadow-claw-channel-config-C4v0h8oa.js} +3 -3
- package/dist/lib/{shadow-claw-channel-config-BhxHf6wZ.js.map → shadow-claw-channel-config-C4v0h8oa.js.map} +1 -1
- package/dist/lib/{shadow-claw-channels-B5vzE9Z2.js → shadow-claw-channels-CyV88k9T.js} +3 -3
- package/dist/lib/{shadow-claw-channels-B5vzE9Z2.js.map → shadow-claw-channels-CyV88k9T.js.map} +1 -1
- package/dist/lib/{shadow-claw-chat-BsYnJ4-G.js → shadow-claw-chat-DSYtuZod.js} +11 -11
- package/dist/lib/{shadow-claw-chat-BsYnJ4-G.js.map → shadow-claw-chat-DSYtuZod.js.map} +1 -1
- package/dist/lib/{shadow-claw-control-plane-DqcgQsun.js → shadow-claw-control-plane-DBSGuDT1.js} +7 -7
- package/dist/lib/{shadow-claw-control-plane-DqcgQsun.js.map → shadow-claw-control-plane-DBSGuDT1.js.map} +1 -1
- package/dist/lib/{shadow-claw-conversations-B9Pn58g3.js → shadow-claw-conversations-Cp8pK4PM.js} +5 -5
- package/dist/lib/{shadow-claw-conversations-B9Pn58g3.js.map → shadow-claw-conversations-Cp8pK4PM.js.map} +1 -1
- package/dist/lib/{shadow-claw-file-viewer-DL6c4oPK.js → shadow-claw-file-viewer-B8G8yo48.js} +8 -8
- package/dist/lib/{shadow-claw-file-viewer-DL6c4oPK.js.map → shadow-claw-file-viewer-B8G8yo48.js.map} +1 -1
- package/dist/lib/{shadow-claw-files-C_ksPb8W.js → shadow-claw-files-D1COKzuC.js} +9 -9
- package/dist/lib/{shadow-claw-files-C_ksPb8W.js.map → shadow-claw-files-D1COKzuC.js.map} +1 -1
- package/dist/lib/{shadow-claw-git-jwsY7L1N.js → shadow-claw-git-60tWU4Ee.js} +6 -6
- package/dist/lib/{shadow-claw-git-jwsY7L1N.js.map → shadow-claw-git-60tWU4Ee.js.map} +1 -1
- package/dist/lib/{shadow-claw-integrations-yT7j07TM.js → shadow-claw-integrations-Bw1cG1ze.js} +4 -4
- package/dist/lib/{shadow-claw-integrations-yT7j07TM.js.map → shadow-claw-integrations-Bw1cG1ze.js.map} +1 -1
- package/dist/lib/{shadow-claw-llm-CEPJh1Jh.js → shadow-claw-llm-By5CvsFJ.js} +6 -6
- package/dist/lib/{shadow-claw-llm-CEPJh1Jh.js.map → shadow-claw-llm-By5CvsFJ.js.map} +1 -1
- package/dist/lib/{shadow-claw-mcp-remote-DGDWjByQ.js → shadow-claw-mcp-remote-BaNODd1v.js} +4 -4
- package/dist/lib/{shadow-claw-mcp-remote-DGDWjByQ.js.map → shadow-claw-mcp-remote-BaNODd1v.js.map} +1 -1
- package/dist/lib/{shadow-claw-networking-Bi4yvc73.js → shadow-claw-networking-DtZ5bsTz.js} +2 -2
- package/dist/lib/{shadow-claw-networking-Bi4yvc73.js.map → shadow-claw-networking-DtZ5bsTz.js.map} +1 -1
- package/dist/lib/{shadow-claw-notifications-C-JgGqQx.js → shadow-claw-notifications-C3VEba_A.js} +3 -3
- package/dist/lib/{shadow-claw-notifications-C-JgGqQx.js.map → shadow-claw-notifications-C3VEba_A.js.map} +1 -1
- package/dist/lib/{shadow-claw-page-header-DrAcWCZ9.js → shadow-claw-page-header-BLowJopA.js} +2 -2
- package/dist/lib/{shadow-claw-page-header-DrAcWCZ9.js.map → shadow-claw-page-header-BLowJopA.js.map} +1 -1
- package/dist/lib/{shadow-claw-pages-OEOClgA8.js → shadow-claw-pages-CpeUV-hw.js} +9 -9
- package/dist/lib/{shadow-claw-pages-OEOClgA8.js.map → shadow-claw-pages-CpeUV-hw.js.map} +1 -1
- package/dist/lib/{shadow-claw-peerjs-DmC2CV-9.js → shadow-claw-peerjs-DYAzJbTy.js} +3 -3
- package/dist/lib/{shadow-claw-peerjs-DmC2CV-9.js.map → shadow-claw-peerjs-DYAzJbTy.js.map} +1 -1
- package/dist/lib/{shadow-claw-settings-xAtFog0T.js → shadow-claw-settings-ByxwW3WK.js} +9 -9
- package/dist/lib/{shadow-claw-settings-xAtFog0T.js.map → shadow-claw-settings-ByxwW3WK.js.map} +1 -1
- package/dist/lib/{shadow-claw-storage-B4UHl-po.js → shadow-claw-storage-CsSPYVDJ.js} +5 -5
- package/dist/lib/{shadow-claw-storage-B4UHl-po.js.map → shadow-claw-storage-CsSPYVDJ.js.map} +1 -1
- package/dist/lib/{shadow-claw-task-server-B0eWzg57.js → shadow-claw-task-server-De2WCEw4.js} +2 -2
- package/dist/lib/{shadow-claw-task-server-B0eWzg57.js.map → shadow-claw-task-server-De2WCEw4.js.map} +1 -1
- package/dist/lib/{shadow-claw-tasks-HHU_8Gyg.js → shadow-claw-tasks-zHWT4GaE.js} +7 -7
- package/dist/lib/{shadow-claw-tasks-HHU_8Gyg.js.map → shadow-claw-tasks-zHWT4GaE.js.map} +1 -1
- package/dist/lib/{shadow-claw-terminal-CdC2G6Zz.js → shadow-claw-terminal-Bpawfv4N.js} +2 -2
- package/dist/lib/{shadow-claw-terminal-CdC2G6Zz.js.map → shadow-claw-terminal-Bpawfv4N.js.map} +1 -1
- package/dist/lib/{shadow-claw-tools-2AICxVXA.js → shadow-claw-tools-BbKdWcps.js} +7 -7
- package/dist/lib/{shadow-claw-tools-2AICxVXA.js.map → shadow-claw-tools-BbKdWcps.js.map} +1 -1
- package/dist/lib/{shadow-claw-webvm-Cy-Ia2vs.js → shadow-claw-webvm-DLqK0AxW.js} +3 -3
- package/dist/lib/{shadow-claw-webvm-Cy-Ia2vs.js.map → shadow-claw-webvm-DLqK0AxW.js.map} +1 -1
- package/dist/lib/subsystems/mcp/webmcp.d.ts +37 -0
- package/dist/lib/subsystems/providers/model-registry.d.ts +4 -1
- package/dist/lib/subsystems/providers/providers.d.ts +10 -0
- package/dist/lib/{syncWebMcpRegistration-CaAPPg2V.js → syncWebMcpRegistration-mlbbvcdm.js} +5 -5
- package/dist/lib/{syncWebMcpRegistration-CaAPPg2V.js.map → syncWebMcpRegistration-mlbbvcdm.js.map} +1 -1
- package/dist/lib/{tools-f1WPNDSS.js → tools-Bb2ujM2E.js} +4 -4
- package/dist/lib/{tools-f1WPNDSS.js.map → tools-Bb2ujM2E.js.map} +1 -1
- package/dist/lib/utils/index.js +1 -1
- package/dist/lib/utils/utils.js +1 -1
- package/dist/lib/{utils-B99XP70b.js → utils-mpsYPfS7.js} +3 -3
- package/dist/lib/{utils-B99XP70b.js.map → utils-mpsYPfS7.js.map} +1 -1
- package/dist/lib/webmcp-BVR2lBVo.js +1544 -0
- package/dist/lib/webmcp-BVR2lBVo.js.map +1 -0
- package/dist/public/.well-known/mcp/server-card.json +1 -1
- package/dist/public/.well-known/mcp.json +1 -1
- package/dist/public/agent.worker.js +44 -44
- package/dist/public/config-BqecTktB.js +1 -0
- package/dist/public/{configurePeerJs--JGpJVti.js → configurePeerJs-BPKfWuEt.js} +1 -1
- package/dist/public/{connections-6575KDGE.js → connections-C_3tYsmX.js} +1 -1
- package/dist/public/{custom-element-security-Da_6HQ6X.js → custom-element-security-DXwU3Lae.js} +1 -1
- package/dist/public/docs/example/article/index.html +2 -2
- package/dist/public/docs/publishing/index.html +2 -2
- package/dist/public/docs/skill-creator/index.html +2 -2
- package/dist/public/docs/subsystems/tools.md +4 -3
- package/dist/public/docs/subsystems/webmcp.md +58 -13
- package/dist/public/{downloadGroupFile-Dj-AMNsd.js → downloadGroupFile-DTyf5DIC.js} +1 -1
- package/dist/public/{e2e-bridge-CbYqdMp-.js → e2e-bridge-DXwWCQKw.js} +1 -1
- package/dist/public/{file-viewer-vHJ5Zsgk.js → file-viewer-ConEyDDG.js} +1 -1
- package/dist/public/{getGroupDir-BwprrdrQ.js → getGroupDir-ZfZsiq6d.js} +1 -1
- package/dist/public/{git-8F7wvoUB.js → git-BtBaLC1-.js} +2 -2
- package/dist/public/{iframe-sanitizer-viROQkRn.js → iframe-sanitizer-Corkvo_d.js} +1 -1
- package/dist/public/index.html +2 -2
- package/dist/public/index.js +1 -1
- package/dist/public/{initChatSplitResize-BA18wLQQ.js → initChatSplitResize-CUc-TEmT.js} +1 -1
- package/dist/public/{initControlPlane-C5v0FtJE.js → initControlPlane-B_uYS8a4.js} +1 -1
- package/dist/public/main/index.html +2 -2
- package/dist/public/main/memory/index.html +2 -2
- package/dist/public/{markdown-eFKxxpVP.js → markdown-Cfa6GuJs.js} +1 -1
- package/dist/public/{mcp-reconnect-CBHuaYdF.js → mcp-reconnect-CUOkdPEz.js} +1 -1
- package/dist/public/{memoryStorage-C1llaYus.js → memoryStorage-Bh8fjmip.js} +1 -1
- package/dist/public/{orchestrator-DNr2HDI2.js → orchestrator-BcSzrg6E.js} +2 -2
- package/dist/public/{orchestrator-BeJfwtvz.js → orchestrator-Bi5OdVZD.js} +11 -11
- package/dist/public/{peerjs-mG30TAJ_.js → peerjs-CzCXG-NW.js} +1 -1
- package/dist/public/{push-client-C2zMT3Sf.js → push-client-Cr3Ruahp.js} +1 -1
- package/dist/public/service-worker.js +1 -1
- package/dist/public/{shadow-claw-Ble6l0Iw.js → shadow-claw-CzUYuuOa.js} +2 -2
- package/dist/public/{shadow-claw-accounts-D1y-zbMs.js → shadow-claw-accounts-BgIHB_aP.js} +1 -1
- package/dist/public/{shadow-claw-channels-D_xfBoWp.js → shadow-claw-channels-Ce_trJ5D.js} +1 -1
- package/dist/public/{shadow-claw-chat-D_Lbi5oH.js → shadow-claw-chat-CdECLLwL.js} +1 -1
- package/dist/public/{shadow-claw-control-plane-CrnA5lM0.js → shadow-claw-control-plane-DM62UmOz.js} +2 -2
- package/dist/public/{shadow-claw-conversations-BN-hFmN1.js → shadow-claw-conversations-AM5g3C00.js} +1 -1
- package/dist/public/{shadow-claw-file-viewer-BKEpzpbx.js → shadow-claw-file-viewer-BP7gWS5g.js} +1 -1
- package/dist/public/{shadow-claw-files-DDZMk5AA.js → shadow-claw-files-RPPGszcK.js} +1 -1
- package/dist/public/{shadow-claw-git-CqOO97Re.js → shadow-claw-git-BsHEvLrb.js} +2 -2
- package/dist/public/{shadow-claw-integrations-CRGL78Fy.js → shadow-claw-integrations-B0vbcOqg.js} +1 -1
- package/dist/public/{shadow-claw-llm-DoGxEHQL.js → shadow-claw-llm-FNNamrc_.js} +2 -2
- package/dist/public/{shadow-claw-mcp-remote-DyGnK4S_.js → shadow-claw-mcp-remote-7mDgniQu.js} +1 -1
- package/dist/public/{shadow-claw-networking-DJeCdb7e.js → shadow-claw-networking-CGsetaLp.js} +1 -1
- package/dist/public/{shadow-claw-notifications-hSKJeMXb.js → shadow-claw-notifications-pnwRcR-4.js} +1 -1
- package/dist/public/{shadow-claw-page-header-DA-FG08G.js → shadow-claw-page-header-BUy15Poz.js} +1 -1
- package/dist/public/{shadow-claw-pages-DTS98Zbi.js → shadow-claw-pages-ILAjGWNk.js} +1 -1
- package/dist/public/{shadow-claw-settings-5w0ce8SP.js → shadow-claw-settings-Bx5IgVqN.js} +3 -3
- package/dist/public/{shadow-claw-storage-DqlVt27X.js → shadow-claw-storage-PAtNykaF.js} +1 -1
- package/dist/public/{shadow-claw-task-server-ByZwKI6S.js → shadow-claw-task-server-Cbbi_2OO.js} +1 -1
- package/dist/public/{shadow-claw-tasks-Dc4G4zBu.js → shadow-claw-tasks-B-jKYWZJ.js} +1 -1
- package/dist/public/{shadow-claw-terminal-DvusP7wg.js → shadow-claw-terminal-BRejND-Z.js} +1 -1
- package/dist/public/{shadow-claw-tools-BEsid8q-.js → shadow-claw-tools-DNQe3oa-.js} +1 -1
- package/dist/public/{shadow-claw-webvm-BWlIeK78.js → shadow-claw-webvm-BFuwRifU.js} +1 -1
- package/dist/public/{syncWebMcpRegistration-CqVCB6m8.js → syncWebMcpRegistration-FxKAPwaz.js} +1 -1
- package/dist/public/theme-init.js +1 -1
- package/dist/public/{tools-Cp1gequ8.js → tools-BwQKGsro.js} +1 -1
- package/dist/public/transformers-js.worker.js +1 -1
- package/dist/public/webmcp-C28PAlfy.js +1 -0
- package/dist/server.js +1 -1
- package/package.json +3 -3
- package/src/core/utils/initControlPlane.test.ts +122 -1
- package/src/core/utils/initControlPlane.ts +12 -8
- package/src/subsystems/mcp/webmcp.test.ts +253 -1
- package/src/subsystems/mcp/webmcp.ts +147 -4
- package/src/subsystems/providers/model-registry.test.ts +139 -0
- package/src/subsystems/providers/model-registry.ts +54 -2
- package/src/subsystems/providers/providers.test.ts +329 -0
- package/src/subsystems/providers/providers.ts +135 -11
- package/dist/lib/config-DjZ9QWc4.js.map +0 -1
- package/dist/lib/webmcp-BC8_WafM.js +0 -1710
- package/dist/lib/webmcp-BC8_WafM.js.map +0 -1
- package/dist/public/config-Bnwx4EfS.js +0 -1
- package/dist/public/webmcp-DBONjQWd.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webmcp-BVR2lBVo.js","names":["#ontoolchangeHandler","#ownerDocument","#domException","#ontoolchangeListener","#tools","#removeTool","#notifyToolsChanged","#invokeToolByName","#testingShim","#context"],"sources":["../../node_modules/@mcp-b/webmcp-polyfill/dist/schema.js","../../node_modules/@mcp-b/webmcp-polyfill/dist/index.js","../../src/subsystems/mcp/webmcp.ts"],"sourcesContent":["//#region src/schema.ts\nconst DEFAULT_INPUT_SCHEMA = {\n\ttype: \"object\",\n\tproperties: {}\n};\nconst FAILED_TO_PARSE_INPUT_ARGUMENTS_MESSAGE = \"Failed to parse input arguments\";\nconst TOOL_INVOCATION_FAILED_MESSAGE = \"Tool was executed but the invocation failed. For example, the script function threw an error\";\nconst STANDARD_JSON_SCHEMA_TARGETS = [\"draft-2020-12\", \"draft-07\"];\nconst VALID_TOOL_NAME_RE = /^[A-Za-z0-9_.-]{1,128}$/u;\nfunction isPlainObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction toDomString(value) {\n\tif (typeof value === \"symbol\") throw new TypeError(\"Symbol values cannot be converted to a DOMString\");\n\treturn String(value);\n}\nfunction coerceWebMcpToolDescriptor(tool) {\n\tconst name = Reflect.get(tool, \"name\");\n\tconst description = Reflect.get(tool, \"description\");\n\tconst title = Reflect.get(tool, \"title\");\n\tif (name === void 0) throw new TypeError(\"Tool \\\"name\\\" is required\");\n\tif (description === void 0) throw new TypeError(\"Tool \\\"description\\\" is required\");\n\tconst annotations = Reflect.get(tool, \"annotations\");\n\tconst annotationMembers = isPlainObject(annotations) ? annotations : {};\n\tconst inputSchema = Reflect.get(tool, \"inputSchema\");\n\tconst outputSchema = Reflect.get(tool, \"outputSchema\");\n\tconst execute = Reflect.get(tool, \"execute\");\n\treturn {\n\t\tname: toDomString(name),\n\t\t...title === void 0 ? {} : { title: toDomString(title).toWellFormed() },\n\t\tdescription: toDomString(description),\n\t\t...inputSchema === void 0 ? {} : { inputSchema },\n\t\t...outputSchema === void 0 ? {} : { outputSchema },\n\t\texecute,\n\t\t...annotations === void 0 ? {} : { annotations: {\n\t\t\t...annotationMembers.title === void 0 ? {} : { title: toDomString(annotationMembers.title).toWellFormed() },\n\t\t\treadOnlyHint: Boolean(annotationMembers.readOnlyHint),\n\t\t\t...annotationMembers.destructiveHint === void 0 ? {} : { destructiveHint: Boolean(annotationMembers.destructiveHint) },\n\t\t\t...annotationMembers.idempotentHint === void 0 ? {} : { idempotentHint: Boolean(annotationMembers.idempotentHint) },\n\t\t\t...annotationMembers.openWorldHint === void 0 ? {} : { openWorldHint: Boolean(annotationMembers.openWorldHint) },\n\t\t\tuntrustedContentHint: Boolean(annotationMembers.untrustedContentHint)\n\t\t} }\n\t};\n}\nfunction isJsonObjectRecord(value) {\n\tif (!isPlainObject(value)) return false;\n\tconst prototype = Object.getPrototypeOf(value);\n\treturn prototype === Object.prototype || prototype === null;\n}\nfunction isJsonValue(value, seen = /* @__PURE__ */ new WeakSet()) {\n\tif (value === null || typeof value === \"string\" || typeof value === \"boolean\") return true;\n\tif (typeof value === \"number\") return Number.isFinite(value);\n\tif (typeof value !== \"object\") return false;\n\tif (seen.has(value)) return false;\n\tseen.add(value);\n\ttry {\n\t\treturn (Array.isArray(value) ? value : isJsonObjectRecord(value) ? Object.values(value) : null)?.every((entry) => isJsonValue(entry, seen)) ?? false;\n\t} catch {\n\t\treturn false;\n\t} finally {\n\t\tseen.delete(value);\n\t}\n}\nfunction toJsonValue(value) {\n\treturn isJsonValue(value) ? value : void 0;\n}\nfunction hasCallToolResultShape(value) {\n\treturn isPlainObject(value) && Array.isArray(value.content);\n}\nfunction serializeTextContent(value) {\n\tif (typeof value === \"string\") return value;\n\ttry {\n\t\treturn JSON.stringify(value) ?? String(value);\n\t} catch {\n\t\treturn String(value);\n\t}\n}\nfunction normalizeToolResponse(value) {\n\tif (hasCallToolResultShape(value)) return value;\n\tconst structuredContent = toJsonValue(value);\n\treturn {\n\t\tcontent: [{\n\t\t\ttype: \"text\",\n\t\t\ttext: serializeTextContent(value)\n\t\t}],\n\t\t...structuredContent === void 0 ? {} : { structuredContent },\n\t\tisError: false\n\t};\n}\nfunction createUnknownError(message) {\n\treturn new DOMException(message, \"UnknownError\");\n}\nfunction createToolInvocationFailedError(error) {\n\treturn createUnknownError(error instanceof Error ? `${TOOL_INVOCATION_FAILED_MESSAGE}: ${error.message}` : TOOL_INVOCATION_FAILED_MESSAGE);\n}\nfunction createInvalidStateError(message) {\n\treturn new DOMException(message, \"InvalidStateError\");\n}\nfunction validateWebMcpToolDescriptor(tool) {\n\tif (tool.name === \"\") throw createInvalidStateError(\"Tool \\\"name\\\" must be a non-empty string\");\n\tif (typeof tool.name !== \"string\" || !VALID_TOOL_NAME_RE.test(tool.name)) throw createInvalidStateError(\"Tool \\\"name\\\" must be 1–128 characters and contain only ASCII alphanumeric, underscore, hyphen, or period\");\n\tif (typeof tool.description !== \"string\" || tool.description.length === 0) throw createInvalidStateError(\"Tool \\\"description\\\" must be a non-empty string\");\n\tif (typeof tool.execute !== \"function\") throw new TypeError(\"Tool \\\"execute\\\" must be a function\");\n}\nfunction toWebMcpAnnotations(annotations) {\n\treturn {\n\t\treadOnlyHint: annotations.readOnlyHint ?? false,\n\t\tuntrustedContentHint: annotations.untrustedContentHint ?? false\n\t};\n}\nfunction parseChromeToolInput(input) {\n\ttry {\n\t\tconst value = JSON.parse(input);\n\t\tif (Array.isArray(value) || isPlainObject(value)) return value;\n\t} catch {}\n\tthrow createUnknownError(FAILED_TO_PARSE_INPUT_ARGUMENTS_MESSAGE);\n}\nfunction serializeChromeToolResult(value) {\n\tif (typeof value === \"object\" && value !== null || typeof value === \"function\") try {\n\t\tconst serialized = JSON.stringify(value);\n\t\tif (serialized) return serialized;\n\t} catch {}\n\treturn String(value) || \"Operation succeeded\";\n}\nfunction withAbortSignal(operation, signal, getAbortReason = () => signal?.reason) {\n\tif (!signal) return operation;\n\tif (signal.aborted) return Promise.reject(getAbortReason());\n\treturn new Promise((resolve, reject) => {\n\t\tconst onAbort = () => {\n\t\t\tcleanup();\n\t\t\treject(getAbortReason());\n\t\t};\n\t\tconst cleanup = () => signal.removeEventListener(\"abort\", onAbort);\n\t\tsignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\toperation.then((value) => {\n\t\t\tcleanup();\n\t\t\tresolve(value);\n\t\t}, (error) => {\n\t\t\tcleanup();\n\t\t\treject(error);\n\t\t});\n\t});\n}\nfunction isPotentiallyTrustworthyOrigin(url) {\n\tconst originUrl = url.origin === \"null\" ? url : new URL(url.origin);\n\tconst protocol = originUrl.protocol;\n\tif ([\n\t\t\"https:\",\n\t\t\"wss:\",\n\t\t\"file:\",\n\t\t\"chrome-extension:\",\n\t\t\"moz-extension:\"\n\t].includes(protocol)) return true;\n\tconst hostname = originUrl.hostname.toLowerCase();\n\tconst ipv4 = hostname.split(\".\");\n\tconst isLoopbackIpv4 = ipv4.length === 4 && ipv4.every((part) => /^\\d{1,3}$/u.test(part) && Number(part) <= 255) && Number(ipv4[0]) === 127;\n\treturn hostname === \"::1\" || hostname === \"[::1]\" || hostname === \"localhost\" || hostname === \"localhost.\" || hostname.endsWith(\".localhost\") || hostname.endsWith(\".localhost.\") || isLoopbackIpv4;\n}\nfunction validatePotentiallyTrustworthyOrigins(origins) {\n\tfor (const origin of origins ?? []) {\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = new URL(origin);\n\t\t} catch {\n\t\t\tthrow new DOMException(`Invalid or untrustworthy origin: ${String(origin)}`, \"SecurityError\");\n\t\t}\n\t\tif (!isPotentiallyTrustworthyOrigin(parsed)) throw new DOMException(`Invalid or untrustworthy origin: ${origin}`, \"SecurityError\");\n\t}\n}\nfunction validateWebMcpAccess(ownerDocument) {\n\tvalidateOriginAgentCluster();\n\tif (!ownerDocument) return;\n\tconst DOMExceptionConstructor = ownerDocument.defaultView?.DOMException ?? DOMException;\n\tlet fullyActive = false;\n\ttry {\n\t\tconst ownerWindow = ownerDocument.defaultView;\n\t\tfullyActive = Boolean(ownerWindow && ownerWindow.document === ownerDocument);\n\t} catch {}\n\tif (!fullyActive) throw new DOMExceptionConstructor(\"The associated document is not fully active\", \"InvalidStateError\");\n\tconst policy = Reflect.get(ownerDocument, \"permissionsPolicy\") ?? Reflect.get(ownerDocument, \"featurePolicy\");\n\tif (policy && typeof policy === \"object\") {\n\t\tconst features = Reflect.get(policy, \"features\");\n\t\tconst allowsFeature = Reflect.get(policy, \"allowsFeature\");\n\t\tif (typeof features === \"function\" && typeof allowsFeature === \"function\") {\n\t\t\tconst supported = Reflect.apply(features, policy, []);\n\t\t\tif (Array.isArray(supported) && supported.includes(\"tools\")) {\n\t\t\t\tif (Reflect.apply(allowsFeature, policy, [\"tools\"]) === true) return;\n\t\t\t\tthrow new DOMExceptionConstructor(\"WebMCP is disabled by Permissions Policy\", \"NotAllowedError\");\n\t\t\t}\n\t\t}\n\t}\n\tconst ownerWindow = ownerDocument.defaultView;\n\tif (!ownerWindow || ownerWindow.parent === ownerWindow) return;\n\ttry {\n\t\townerWindow.parent.document;\n\t\treturn;\n\t} catch {}\n\tthrow new DOMExceptionConstructor(\"WebMCP in cross-origin frames requires native Permissions Policy support\", \"NotAllowedError\");\n}\nfunction validateOriginAgentCluster() {\n\tif (globalThis.originAgentCluster === false && globalThis.location?.protocol !== \"file:\") throw new DOMException(\"\", \"SecurityError\");\n}\nfunction validateExecutableOrigin(origin) {\n\ttry {\n\t\tif (new URL(String(origin)).origin !== \"null\") return;\n\t} catch {}\n\tthrow new DOMException(`Unsupported tool origin: ${String(origin)}`, \"NotSupportedError\");\n}\nfunction getStandardProps(value) {\n\tif (!isPlainObject(value)) return null;\n\tconst standard = value[\"~standard\"];\n\tif (!isPlainObject(standard)) return null;\n\treturn standard;\n}\nfunction isStandardInputValidatorSchema(value) {\n\tconst standard = getStandardProps(value);\n\treturn Boolean(standard && standard.version === 1 && typeof standard.validate === \"function\");\n}\nfunction isStandardInputJsonSchema(value) {\n\tconst standard = getStandardProps(value);\n\tif (!standard || standard.version !== 1 || !isPlainObject(standard.jsonSchema)) return false;\n\treturn typeof standard.jsonSchema.input === \"function\";\n}\nfunction preserveStandardSchema(inputSchema, standardSchema) {\n\tconst normalized = { ...inputSchema };\n\tObject.defineProperty(normalized, \"~standard\", { value: standardSchema[\"~standard\"] });\n\treturn normalized;\n}\nfunction convertStandardInputSchema(schema) {\n\tfor (const target of STANDARD_JSON_SCHEMA_TARGETS) try {\n\t\tconst serialized = serializeInputSchema(schema[\"~standard\"].jsonSchema.input({ target }));\n\t\tconst parsed = JSON.parse(serialized);\n\t\tif (!isPlainObject(parsed)) throw new TypeError(\"inputSchema must serialize to an object\");\n\t\treturn parsed;\n\t} catch {}\n\tthrow new Error(\"Failed to convert Standard JSON Schema inputSchema to a JSON Schema object\");\n}\nfunction normalizeInputSchema(inputSchema) {\n\tif (inputSchema === void 0) return { inputSchema: DEFAULT_INPUT_SCHEMA };\n\tif (isStandardInputJsonSchema(inputSchema)) {\n\t\tconst converted = convertStandardInputSchema(inputSchema);\n\t\tconst registeredInputSchema = serializeInputSchema(converted);\n\t\treturn {\n\t\t\tinputSchema: isStandardInputValidatorSchema(inputSchema) ? preserveStandardSchema(converted, inputSchema) : converted,\n\t\t\tregisteredInputSchema\n\t\t};\n\t}\n\tif (isStandardInputValidatorSchema(inputSchema)) throw new Error(\"Standard Schema inputSchema must provide ~standard.jsonSchema.input() for tool metadata\");\n\tif (inputSchema === null || typeof inputSchema !== \"object\" && typeof inputSchema !== \"function\") throw new TypeError(\"inputSchema must be an object\");\n\tconst registeredInputSchema = serializeInputSchema(inputSchema);\n\tconst serializedValue = JSON.parse(registeredInputSchema);\n\tconst jsonSchema = isPlainObject(serializedValue) ? serializedValue : void 0;\n\tif (!jsonSchema || Object.keys(jsonSchema).length === 0) return {\n\t\tinputSchema: DEFAULT_INPUT_SCHEMA,\n\t\tregisteredInputSchema\n\t};\n\treturn {\n\t\tinputSchema: jsonSchema.type === void 0 ? {\n\t\t\ttype: \"object\",\n\t\t\t...jsonSchema\n\t\t} : jsonSchema,\n\t\tregisteredInputSchema\n\t};\n}\nfunction serializeInputSchema(schema) {\n\tif (schema === null || typeof schema !== \"object\" && typeof schema !== \"function\") throw new TypeError(\"inputSchema must be an object\");\n\tconst serialized = JSON.stringify(schema);\n\tif (serialized === void 0) throw new TypeError(\"inputSchema must be JSON-serializable\");\n\treturn serialized;\n}\n\n//#endregion\nexport { coerceWebMcpToolDescriptor, createInvalidStateError, createToolInvocationFailedError, createUnknownError, isPlainObject, normalizeInputSchema, normalizeToolResponse, parseChromeToolInput, serializeChromeToolResult, serializeInputSchema, toWebMcpAnnotations, validateExecutableOrigin, validateOriginAgentCluster, validatePotentiallyTrustworthyOrigins, validateWebMcpAccess, validateWebMcpToolDescriptor, withAbortSignal };\n//# sourceMappingURL=schema.js.map","import { coerceWebMcpToolDescriptor, createInvalidStateError, createToolInvocationFailedError, createUnknownError, isPlainObject, parseChromeToolInput, serializeChromeToolResult, serializeInputSchema, toWebMcpAnnotations, validateExecutableOrigin, validatePotentiallyTrustworthyOrigins, validateWebMcpAccess, validateWebMcpToolDescriptor, withAbortSignal } from \"./schema.js\";\n\n//#region src/declarative-forms.ts\nconst agentInvokedEvents = /* @__PURE__ */ new WeakSet();\nconst agentResponses = /* @__PURE__ */ new WeakMap();\nconst activeSubmissions = /* @__PURE__ */ new WeakMap();\nfunction isAgentInvokedSubmitEvent(event) {\n\treturn event.isTrusted && (agentInvokedEvents.has(event) || event.eventPhase !== Event.NONE && event.target instanceof HTMLFormElement && activeSubmissions.has(event.target));\n}\nfunction respondWithAgentSubmitEvent(event, agentResponse) {\n\tif (!isAgentInvokedSubmitEvent(event)) throw new DOMException(\"respondWith() is only available during an agent-invoked submit event\", \"InvalidStateError\");\n\tif (!event.defaultPrevented) throw new DOMException(\"respondWith() requires preventDefault() during an agent-invoked submit event\", \"InvalidStateError\");\n\tif (event.eventPhase === Event.NONE) throw new DOMException(\"respondWith() is only available while the submit event is being dispatched\", \"InvalidStateError\");\n\tagentInvokedEvents.add(event);\n\tconst response = Promise.resolve(agentResponse);\n\tagentResponses.set(event, response);\n\tif (event.target instanceof HTMLFormElement) activeSubmissions.get(event.target)?.respond(event);\n}\nconst TEXT_INPUT_TYPES = new Set([\n\t\"email\",\n\t\"password\",\n\t\"search\",\n\t\"tel\",\n\t\"text\",\n\t\"url\"\n]);\nconst READONLY_INPUT_TYPES = new Set([\n\t...TEXT_INPUT_TYPES,\n\t\"date\",\n\t\"datetime-local\",\n\t\"month\",\n\t\"number\",\n\t\"time\",\n\t\"week\"\n]);\nfunction isControl(element) {\n\treturn element instanceof HTMLInputElement || element instanceof HTMLSelectElement || element instanceof HTMLTextAreaElement;\n}\nfunction getFormControls(form) {\n\treturn Reflect.get(HTMLFormElement.prototype, \"elements\", form);\n}\nfunction getFormAttribute(form, name) {\n\treturn Reflect.apply(Element.prototype.getAttribute, form, [name]);\n}\nfunction formHasAttribute(form, name) {\n\treturn Reflect.apply(Element.prototype.hasAttribute, form, [name]);\n}\nfunction isFormConnected(form) {\n\treturn Reflect.get(Node.prototype, \"isConnected\", form);\n}\nfunction getOpenShadowRoot(element) {\n\treturn Reflect.get(Element.prototype, \"shadowRoot\", element);\n}\nfunction checkFormValidity(form) {\n\treturn Reflect.apply(HTMLFormElement.prototype.checkValidity, form, []);\n}\nfunction requestFormSubmit(form, submitter) {\n\tReflect.apply(HTMLFormElement.prototype.requestSubmit, form, submitter ? [submitter] : []);\n}\nfunction getControls(form) {\n\treturn [...getFormControls(form)].filter((element) => isControl(element) && !element.matches(\":disabled\") && !(\"readOnly\" in element && element.readOnly && (element instanceof HTMLTextAreaElement || READONLY_INPUT_TYPES.has(element.type))));\n}\nfunction controlGroups(form) {\n\tconst groups = /* @__PURE__ */ new Map();\n\tfor (const control of getControls(form)) {\n\t\tconst name = control.name.trim();\n\t\tconst controls = groups.get(name);\n\t\tif (controls) controls.push(control);\n\t\telse groups.set(name, [control]);\n\t}\n\treturn groups;\n}\nfunction labelText(control) {\n\treturn [...control.labels ?? []].map((label) => {\n\t\tconst copy = label.cloneNode(true);\n\t\tif (!(copy instanceof HTMLElement)) return \"\";\n\t\tcopy.querySelectorAll(\"button, input, meter, output, progress, select, textarea\").forEach((element) => element.remove());\n\t\treturn copy.textContent?.trim() ?? \"\";\n\t}).filter(Boolean).join(\"; \");\n}\nfunction commonFieldset(form, controls) {\n\tfor (let element = controls[0]?.parentElement; element && element !== form; element = element.parentElement) if (element instanceof HTMLFieldSetElement && controls.every((control) => element.contains(control))) return element;\n}\nfunction parameterDescription(form, controls) {\n\tif (controls.length === 1) {\n\t\tconst control = controls[0];\n\t\tif (!control) return void 0;\n\t\treturn control.getAttribute(\"toolparamdescription\") || labelText(control) || control.getAttribute(\"aria-description\") || void 0;\n\t}\n\treturn commonFieldset(form, controls)?.getAttribute(\"toolparamdescription\") || void 0;\n}\nfunction withDescription(schema, form, controls, extra) {\n\tconst description = parameterDescription(form, controls);\n\tconst combined = description && extra ? `${description} (${extra})` : description || extra;\n\treturn combined ? {\n\t\t...schema,\n\t\tdescription: combined\n\t} : schema;\n}\nfunction validNumberAttribute(input, name) {\n\tconst raw = input.getAttribute(name);\n\tif (raw === null || raw.trim() === \"\") return void 0;\n\tconst value = Number(raw);\n\treturn Number.isFinite(value) ? value : void 0;\n}\nfunction isStepBaseMultiple(stepBase, step) {\n\tconst quotient = stepBase / step;\n\treturn Math.abs(quotient - Math.round(quotient)) < Number.EPSILON * 16;\n}\nfunction validPattern(input) {\n\tconst pattern = input.getAttribute(\"pattern\");\n\tif (pattern === null) return void 0;\n\ttry {\n\t\tnew RegExp(pattern, \"v\");\n\t\treturn pattern;\n\t} catch {\n\t\treturn;\n\t}\n}\nfunction numberSchema(input, includePattern = true) {\n\tconst schema = { type: \"number\" };\n\tconst minimum = validNumberAttribute(input, \"min\");\n\tconst maximum = validNumberAttribute(input, \"max\");\n\tif (minimum !== void 0) schema.minimum = minimum;\n\tif (maximum !== void 0) schema.maximum = maximum;\n\tconst rawStep = input.getAttribute(\"step\");\n\tif (rawStep !== \"any\") {\n\t\tconst parsedStep = rawStep === null || rawStep === \"\" ? 1 : Number(rawStep);\n\t\tconst step = Number.isFinite(parsedStep) && parsedStep > 0 ? parsedStep : 1;\n\t\tconst rawValue = Number(input.getAttribute(\"value\"));\n\t\tif (isStepBaseMultiple(minimum ?? (Number.isFinite(rawValue) ? rawValue : 0), step)) schema.multipleOf = step;\n\t}\n\tconst pattern = includePattern ? validPattern(input) : void 0;\n\tif (pattern !== void 0) schema.pattern = pattern;\n\treturn schema;\n}\nfunction temporalFormat(input, datePrefix) {\n\tconst rawStep = input.getAttribute(\"step\");\n\tconst parsedStep = rawStep === null || rawStep === \"\" ? 60 : Number(rawStep);\n\tconst step = Number.isFinite(parsedStep) && parsedStep > 0 ? parsedStep : 60;\n\tif (step < 1) return `${datePrefix}(:[0-5][0-9](\\\\.[0-9]{1,3})?)?$`;\n\tif (step < 60) return `${datePrefix}(:[0-5][0-9])?$`;\n\treturn `${datePrefix}$`;\n}\nfunction optionSchemas(options) {\n\treturn {\n\t\tanyOf: options.map((option) => ({\n\t\t\ttype: \"string\",\n\t\t\tconst: option.value,\n\t\t\ttitle: option.textContent ?? \"\"\n\t\t})),\n\t\tenum: options.map((option) => option.value)\n\t};\n}\nfunction groupChoiceSchemas(controls) {\n\treturn {\n\t\tanyOf: controls.map((control) => {\n\t\t\tconst title = labelText(control);\n\t\t\treturn {\n\t\t\t\ttype: \"string\",\n\t\t\t\tconst: control.value,\n\t\t\t\t...title ? { title } : {}\n\t\t\t};\n\t\t}),\n\t\tenum: controls.map((control) => control.value)\n\t};\n}\nfunction parameterSchema(form, controls) {\n\tconst first = controls[0];\n\tif (!first) return void 0;\n\tif (controls.length > 1) {\n\t\tif (!controls.every((control) => control instanceof HTMLInputElement)) return void 0;\n\t\tif (controls.every((control) => control.type === \"checkbox\")) return withDescription({\n\t\t\ttype: \"array\",\n\t\t\titems: {\n\t\t\t\ttype: \"string\",\n\t\t\t\t...groupChoiceSchemas(controls)\n\t\t\t},\n\t\t\tuniqueItems: true\n\t\t}, form, controls);\n\t\tif (controls.every((control) => control.type === \"radio\")) return withDescription({\n\t\t\ttype: \"string\",\n\t\t\t...groupChoiceSchemas(controls)\n\t\t}, form, controls);\n\t\treturn;\n\t}\n\tif (first instanceof HTMLTextAreaElement) return withDescription({ type: \"string\" }, form, controls);\n\tif (first instanceof HTMLSelectElement) {\n\t\tconst choices = optionSchemas([...first.options]);\n\t\treturn withDescription(first.multiple ? {\n\t\t\ttype: \"array\",\n\t\t\titems: {\n\t\t\t\ttype: \"string\",\n\t\t\t\t...choices\n\t\t\t},\n\t\t\tuniqueItems: true\n\t\t} : {\n\t\t\ttype: \"string\",\n\t\t\t...choices\n\t\t}, form, controls);\n\t}\n\tif (TEXT_INPUT_TYPES.has(first.type)) {\n\t\tconst schema = { type: \"string\" };\n\t\tconst pattern = validPattern(first);\n\t\tif (pattern !== void 0) schema.pattern = pattern;\n\t\treturn withDescription(schema, form, controls);\n\t}\n\tif (first.type === \"hidden\") return first.getAttribute(\"toolparamdescription\") ? withDescription({ type: \"string\" }, form, controls) : void 0;\n\tif (first.type === \"number\") return withDescription(numberSchema(first), form, controls);\n\tif (first.type === \"range\") {\n\t\tconst schema = numberSchema(first, false);\n\t\tschema.minimum ??= 0;\n\t\tschema.maximum ??= 100;\n\t\treturn withDescription(schema, form, controls);\n\t}\n\tif (first.type === \"checkbox\") return withDescription({ type: \"boolean\" }, form, controls);\n\tif (first.type === \"radio\") return withDescription({\n\t\ttype: \"string\",\n\t\t...groupChoiceSchemas([first])\n\t}, form, controls);\n\tif (first.type === \"date\") return withDescription({\n\t\ttype: \"string\",\n\t\tformat: \"date\"\n\t}, form, controls, \"Dates MUST be provided in 'YYYY-MM-DD' format.\");\n\tif (first.type === \"month\") return withDescription({\n\t\ttype: \"string\",\n\t\tformat: \"^[0-9]{4}-(0[1-9]|1[0-2])$\"\n\t}, form, controls);\n\tif (first.type === \"week\") return withDescription({\n\t\ttype: \"string\",\n\t\tformat: \"^[0-9]{4}-W(0[1-9]|[1-4][0-9]|5[0-3])$\"\n\t}, form, controls);\n\tif (first.type === \"time\") return withDescription({\n\t\ttype: \"string\",\n\t\tformat: temporalFormat(first, \"^([01][0-9]|2[0-3]):[0-5][0-9]\")\n\t}, form, controls);\n\tif (first.type === \"datetime-local\") return withDescription({\n\t\ttype: \"string\",\n\t\tformat: temporalFormat(first, \"^[0-9]{4}-(0[1-9]|1[0-2])-[0-9]{2}T([01][0-9]|2[0-3]):[0-5][0-9]\")\n\t}, form, controls);\n\tif (first.type === \"color\") return withDescription({\n\t\ttype: \"string\",\n\t\tformat: \"^#[0-9a-zA-Z]{6}$\"\n\t}, form, controls);\n}\nfunction synthesizeSchema(form) {\n\tconst properties = {};\n\tconst required = [];\n\tfor (const [name, controls] of controlGroups(form)) {\n\t\tif (!name) continue;\n\t\tconst schema = parameterSchema(form, controls);\n\t\tif (!schema) continue;\n\t\tObject.defineProperty(properties, name, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: true,\n\t\t\tvalue: schema,\n\t\t\twritable: true\n\t\t});\n\t\tif (controls.some((control) => control.required)) required.push(name);\n\t}\n\treturn {\n\t\ttype: \"object\",\n\t\tproperties,\n\t\trequired\n\t};\n}\nfunction toolDefinition(form) {\n\treturn {\n\t\tname: getFormAttribute(form, \"toolname\") ?? \"\",\n\t\ttitle: getFormAttribute(form, \"tooltitle\") ?? \"\",\n\t\tdescription: getFormAttribute(form, \"tooldescription\") ?? \"\",\n\t\tinputSchema: synthesizeSchema(form),\n\t\tautosubmit: formHasAttribute(form, \"toolautosubmit\")\n\t};\n}\nfunction toFormString(value) {\n\tif (typeof value === \"string\" || typeof value === \"boolean\") return String(value);\n\tif (typeof value === \"number\" && Number.isFinite(value)) return String(value);\n}\nfunction toFormBoolean(value) {\n\tif (typeof value === \"boolean\") return value;\n\tif (typeof value === \"number\" && Number.isInteger(value)) return value !== 0;\n\tif (typeof value !== \"string\") return void 0;\n\tif (value === \"1\" || value.toLowerCase() === \"true\") return true;\n\tif (value === \"0\" || value.toLowerCase() === \"false\") return false;\n}\nfunction hasUniqueAllowedValues(value, allowed) {\n\tif (!Array.isArray(value)) return false;\n\tconst remaining = new Set(allowed);\n\tfor (const item of value) {\n\t\tconst string = toFormString(item);\n\t\tif (string === void 0 || !remaining.delete(string)) return false;\n\t}\n\treturn true;\n}\nfunction inputAcceptsValue(input, value) {\n\tif (value === \"\") return input.type !== \"number\" && input.type !== \"range\";\n\tconst probe = input.ownerDocument.createElement(\"input\");\n\tprobe.type = input.type;\n\tprobe.value = value;\n\treturn probe.value !== \"\";\n}\nfunction validatesParameter(form, controls, value) {\n\tconst first = controls[0];\n\tif (!first || !parameterSchema(form, controls)) return false;\n\tif (controls.length > 1) {\n\t\tif (!controls.every((control) => control instanceof HTMLInputElement)) return false;\n\t\tif (controls.every((control) => control.type === \"checkbox\")) return hasUniqueAllowedValues(value, new Set(controls.map((control) => control.value)));\n\t\tif (controls.every((control) => control.type === \"radio\")) {\n\t\t\tconst string = toFormString(value);\n\t\t\treturn string !== void 0 && controls.some((control) => control.value === string);\n\t\t}\n\t\treturn false;\n\t}\n\tif (first instanceof HTMLSelectElement) {\n\t\tconst allowed = new Set([...first.options].map((option) => option.value));\n\t\tif (first.multiple) return hasUniqueAllowedValues(value, allowed);\n\t\tconst string = toFormString(value);\n\t\treturn string !== void 0 && allowed.has(string);\n\t}\n\tif (first instanceof HTMLTextAreaElement) return toFormString(value) !== void 0;\n\tif (first.type === \"checkbox\") return toFormBoolean(value) !== void 0;\n\tif (first.type === \"radio\") {\n\t\tconst string = toFormString(value);\n\t\treturn string !== void 0 && first.value === string;\n\t}\n\tconst string = toFormString(value);\n\treturn string !== void 0 && inputAcceptsValue(first, string);\n}\nfunction dispatchInputAndChange(control) {\n\tcontrol.dispatchEvent(new Event(\"input\", {\n\t\tbubbles: true,\n\t\tcomposed: true\n\t}));\n\tcontrol.dispatchEvent(new Event(\"change\", { bubbles: true }));\n}\nfunction setNativeValue(control, value) {\n\tconst prototype = control instanceof HTMLInputElement ? HTMLInputElement.prototype : HTMLTextAreaElement.prototype;\n\tObject.getOwnPropertyDescriptor(prototype, \"value\")?.set?.call(control, value);\n}\nfunction setNativeChecked(control, checked) {\n\tObject.getOwnPropertyDescriptor(HTMLInputElement.prototype, \"checked\")?.set?.call(control, checked);\n}\nfunction fillParameter(controls, value) {\n\tconst first = controls[0];\n\tif (!first) return;\n\tif (controls.length > 1 && controls.every((control) => control instanceof HTMLInputElement)) {\n\t\tif (controls.every((control) => control.type === \"checkbox\") && Array.isArray(value)) {\n\t\t\tconst checked = new Set(value.map(toFormString));\n\t\t\tfor (const control of controls) {\n\t\t\t\tconst next = checked.has(control.value);\n\t\t\t\tif (control.checked === next) continue;\n\t\t\t\tsetNativeChecked(control, next);\n\t\t\t\tdispatchInputAndChange(control);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst selected = toFormString(value);\n\t\tconst control = controls.find((candidate) => candidate.value === selected);\n\t\tif (control && !control.checked) {\n\t\t\tsetNativeChecked(control, true);\n\t\t\tdispatchInputAndChange(control);\n\t\t}\n\t\treturn;\n\t}\n\tif (first instanceof HTMLSelectElement) {\n\t\tif (first.multiple && Array.isArray(value)) {\n\t\t\tconst selected = new Set(value.map(toFormString));\n\t\t\tlet changed = false;\n\t\t\tfor (const option of first.options) {\n\t\t\t\tconst next = selected.has(option.value);\n\t\t\t\tif (option.selected === next) continue;\n\t\t\t\toption.selected = next;\n\t\t\t\tchanged = true;\n\t\t\t}\n\t\t\tif (changed) dispatchInputAndChange(first);\n\t\t\treturn;\n\t\t}\n\t\tconst next = toFormString(value);\n\t\tif (next !== void 0 && first.value !== next) {\n\t\t\tfirst.value = next;\n\t\t\tdispatchInputAndChange(first);\n\t\t}\n\t\treturn;\n\t}\n\tif (first instanceof HTMLInputElement && first.type === \"checkbox\") {\n\t\tconst next = toFormBoolean(value);\n\t\tif (next !== void 0 && first.checked !== next) {\n\t\t\tsetNativeChecked(first, next);\n\t\t\tdispatchInputAndChange(first);\n\t\t}\n\t\treturn;\n\t}\n\tif (first instanceof HTMLInputElement && first.type === \"radio\") {\n\t\tif (toFormString(value) === first.value && !first.checked) {\n\t\t\tsetNativeChecked(first, true);\n\t\t\tdispatchInputAndChange(first);\n\t\t}\n\t\treturn;\n\t}\n\tconst next = toFormString(value);\n\tif (next !== void 0 && first.value !== next) {\n\t\tsetNativeValue(first, next);\n\t\tdispatchInputAndChange(first);\n\t}\n}\nfunction fillForm(form, input) {\n\tif (Array.isArray(input)) throw new TypeError(\"Declarative tool input must be an object\");\n\tconst groups = controlGroups(form);\n\tfor (const [name, value] of Object.entries(input)) {\n\t\tconst controls = groups.get(name);\n\t\tif (!controls || !validatesParameter(form, controls, value)) throw new TypeError(`Invalid value for declarative form parameter \"${name}\"`);\n\t}\n\tfor (const [name, value] of Object.entries(input)) fillParameter(groups.get(name) ?? [], value);\n}\nfunction findSubmitter(form) {\n\treturn [...getFormControls(form)].find((element) => !element.matches(\":disabled\") && (element instanceof HTMLButtonElement && element.type === \"submit\" || element instanceof HTMLInputElement && [\"image\", \"submit\"].includes(element.type)));\n}\nfunction validationError(form) {\n\tconst failures = [...getFormControls(form)].filter((element) => isControl(element) && element.willValidate && !element.validity.valid).map((control) => `${control.name.trim() || \"{unknown}\"}: ${control.validationMessage}`).join(\". \");\n\treturn new DOMException(`Form validation failed: ${failures}`, \"UnknownError\");\n}\nfunction toolActivatedEvent(toolName) {\n\tconst event = new Event(\"toolactivated\");\n\tObject.defineProperty(event, \"toolName\", {\n\t\tenumerable: true,\n\t\tvalue: toolName\n\t});\n\treturn event;\n}\nfunction waitForSubmission(registration, toolName, autosubmit, submitter) {\n\tconst { form } = registration;\n\tregistration.cancelPending?.(new DOMException(\"Tool execution cancelled\", \"UnknownError\"));\n\treturn new Promise((resolve, reject) => {\n\t\tlet settled = false;\n\t\tconst cleanup = () => {\n\t\t\tReflect.apply(EventTarget.prototype.removeEventListener, form, [\n\t\t\t\t\"invalid\",\n\t\t\t\tonInvalid,\n\t\t\t\ttrue\n\t\t\t]);\n\t\t\tactiveSubmissions.delete(form);\n\t\t\tif (registration.cancelPending === cancel) delete registration.cancelPending;\n\t\t};\n\t\tconst finish = (callback) => {\n\t\t\tif (settled) return;\n\t\t\tsettled = true;\n\t\t\tcleanup();\n\t\t\tcallback();\n\t\t};\n\t\tconst cancel = (reason) => finish(() => reject(reason));\n\t\tconst settleResponse = (response) => {\n\t\t\tresponse.then((value) => finish(() => resolve(value)), (error) => finish(() => reject(error)));\n\t\t};\n\t\tconst onInvalid = (event) => {\n\t\t\tif (!event.isTrusted) return;\n\t\t\tqueueMicrotask(() => {\n\t\t\t\tif (!checkFormValidity(form)) cancel(validationError(form));\n\t\t\t});\n\t\t};\n\t\tactiveSubmissions.set(form, {\n\t\t\tcomplete(event) {\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tconst response = agentResponses.get(event);\n\t\t\t\t\tif (response) settleResponse(response);\n\t\t\t\t\telse if (event.defaultPrevented) cancel(new DOMException(\"preventDefault() requires respondWith()\", \"UnknownError\"));\n\t\t\t\t\telse finish(() => resolve(void 0));\n\t\t\t\t});\n\t\t\t},\n\t\t\tdirect() {\n\t\t\t\tfinish(() => resolve(void 0));\n\t\t\t},\n\t\t\trespond(event) {\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\tconst response = agentResponses.get(event);\n\t\t\t\t\tif (response) settleResponse(response);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\tregistration.cancelPending = cancel;\n\t\tReflect.apply(EventTarget.prototype.addEventListener, form, [\n\t\t\t\"invalid\",\n\t\t\tonInvalid,\n\t\t\ttrue\n\t\t]);\n\t\tif (!autosubmit) {\n\t\t\tsubmitter?.focus();\n\t\t\twindow.dispatchEvent(toolActivatedEvent(toolName));\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\trequestFormSubmit(form, submitter);\n\t\t\twindow.dispatchEvent(toolActivatedEvent(toolName));\n\t\t} catch (error) {\n\t\t\tcancel(error);\n\t\t}\n\t});\n}\n/** Installs the DOM-backed half of the draft Declarative WebMCP API. */\nfunction installDeclarativeForms(document, context) {\n\tlet active = true;\n\tconst registrations = /* @__PURE__ */ new Map();\n\tconst blockedDefinitions = /* @__PURE__ */ new Map();\n\tconst observers = /* @__PURE__ */ new Map();\n\tconst onSubmit = (event) => {\n\t\tif (!(event instanceof SubmitEvent) || !event.isTrusted || !(event.target instanceof HTMLFormElement)) return;\n\t\tconst submission = activeSubmissions.get(event.target);\n\t\tif (!submission) return;\n\t\tagentInvokedEvents.add(event);\n\t\tsubmission.complete(event);\n\t};\n\tconst onReset = (event) => {\n\t\tif (!event.isTrusted || !(event.target instanceof HTMLFormElement)) return;\n\t\tconst form = event.target;\n\t\tqueueMicrotask(() => {\n\t\t\tif (event.defaultPrevented) return;\n\t\t\tregistrations.get(form)?.cancelPending?.(new DOMException(\"Tool execution cancelled by form reset\", \"UnknownError\"));\n\t\t});\n\t};\n\tfunction stopObservingRoot(root) {\n\t\tobservers.get(root)?.disconnect();\n\t\tobservers.delete(root);\n\t\troot.removeEventListener(\"reset\", onReset, true);\n\t\troot.removeEventListener(\"submit\", onSubmit, true);\n\t}\n\tfunction observeRoot(root) {\n\t\tif (observers.has(root)) return;\n\t\tconst observer = new MutationObserver(sync);\n\t\tobservers.set(root, observer);\n\t\tobserver.observe(root, {\n\t\t\tattributes: true,\n\t\t\tcharacterData: true,\n\t\t\tchildList: true,\n\t\t\tsubtree: true\n\t\t});\n\t\troot.addEventListener(\"reset\", onReset, true);\n\t\troot.addEventListener(\"submit\", onSubmit, true);\n\t}\n\tfunction sync() {\n\t\tobserveRoot(document);\n\t\tfor (const root of observers.keys()) if (root instanceof ShadowRoot && !Reflect.get(Node.prototype, \"isConnected\", root.host)) stopObservingRoot(root);\n\t\tconst candidates = /* @__PURE__ */ new Set();\n\t\tconst selected = /* @__PURE__ */ new Map();\n\t\tconst selectedByName = /* @__PURE__ */ new Map();\n\t\tfor (const root of observers.keys()) for (const element of root.querySelectorAll(\"*\")) {\n\t\t\tconst shadowRoot = getOpenShadowRoot(element);\n\t\t\tif (shadowRoot) observeRoot(shadowRoot);\n\t\t\tif (!(element instanceof HTMLFormElement) || !formHasAttribute(element, \"toolname\") || !formHasAttribute(element, \"tooldescription\") || !isFormConnected(element)) continue;\n\t\t\tconst form = element;\n\t\t\tcandidates.add(form);\n\t\t\tconst definition = toolDefinition(form);\n\t\t\tconst fingerprint = JSON.stringify(definition);\n\t\t\tconst blockedFingerprint = blockedDefinitions.get(form);\n\t\t\tif (blockedFingerprint === fingerprint) continue;\n\t\t\tconst retryingChangedDefinition = blockedFingerprint !== void 0;\n\t\t\tblockedDefinitions.delete(form);\n\t\t\tconst existingForm = selectedByName.get(definition.name);\n\t\t\tif (existingForm && !retryingChangedDefinition) {\n\t\t\t\tblockedDefinitions.set(form, fingerprint);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (existingForm) {\n\t\t\t\tconst existingSelection = selected.get(existingForm);\n\t\t\t\tif (existingSelection) {\n\t\t\t\t\tblockedDefinitions.set(existingForm, existingSelection.fingerprint);\n\t\t\t\t\tselected.delete(existingForm);\n\t\t\t\t}\n\t\t\t}\n\t\t\tselectedByName.set(definition.name, form);\n\t\t\tselected.set(form, {\n\t\t\t\tdefinition,\n\t\t\t\tfingerprint\n\t\t\t});\n\t\t}\n\t\tfor (const form of blockedDefinitions.keys()) if (!candidates.has(form)) blockedDefinitions.delete(form);\n\t\tfor (const [form, registration] of registrations) if (selected.get(form)?.fingerprint !== registration.fingerprint) {\n\t\t\tregistration.cancelPending?.(new DOMException(\"Tool execution cancelled because its form changed\", \"UnknownError\"));\n\t\t\tregistration.controller.abort();\n\t\t\tregistrations.delete(form);\n\t\t}\n\t\tfor (const [form, { definition, fingerprint }] of selected) {\n\t\t\tif (registrations.has(form)) continue;\n\t\t\tconst controller = new AbortController();\n\t\t\tconst registration = {\n\t\t\t\tcontroller,\n\t\t\t\tfingerprint,\n\t\t\t\tform\n\t\t\t};\n\t\t\tregistrations.set(form, registration);\n\t\t\tcontext.registerTool({\n\t\t\t\tname: definition.name,\n\t\t\t\ttitle: definition.title,\n\t\t\t\tdescription: definition.description,\n\t\t\t\tinputSchema: definition.inputSchema,\n\t\t\t\texecute(input) {\n\t\t\t\t\tconst submitter = findSubmitter(form);\n\t\t\t\t\tif (!definition.autosubmit && !submitter) throw new DOMException(\"A declarative form without toolautosubmit requires a submit button\", \"UnknownError\");\n\t\t\t\t\tfillForm(form, input);\n\t\t\t\t\treturn waitForSubmission(registration, definition.name, definition.autosubmit, submitter);\n\t\t\t\t}\n\t\t\t}, { signal: controller.signal }).catch((error) => {\n\t\t\t\tcontroller.abort();\n\t\t\t\tif (error?.name === \"AbortError\") return;\n\t\t\t\tconsole.error(`[webmcp] declarative form tool \"${definition.name}\" was not registered:`, error);\n\t\t\t});\n\t\t}\n\t}\n\tlet restoreAttachShadow = () => {};\n\tconst elementPrototype = document.defaultView?.Element.prototype;\n\tconst attachShadowDescriptor = elementPrototype ? Object.getOwnPropertyDescriptor(elementPrototype, \"attachShadow\") : void 0;\n\tif (elementPrototype && attachShadowDescriptor?.configurable) {\n\t\tconst nativeAttachShadow = elementPrototype.attachShadow;\n\t\tconst attachShadow = function(init) {\n\t\t\tconst root = nativeAttachShadow.call(this, init);\n\t\t\tif (active && root.mode === \"open\" && Reflect.get(Node.prototype, \"ownerDocument\", this) === document && Reflect.get(Node.prototype, \"isConnected\", this)) observeRoot(root);\n\t\t\treturn root;\n\t\t};\n\t\tObject.defineProperty(elementPrototype, \"attachShadow\", {\n\t\t\t...attachShadowDescriptor,\n\t\t\tvalue: attachShadow\n\t\t});\n\t\trestoreAttachShadow = () => {\n\t\t\tif (elementPrototype.attachShadow === attachShadow) Object.defineProperty(elementPrototype, \"attachShadow\", attachShadowDescriptor);\n\t\t};\n\t}\n\tlet restoreFormSubmit = () => {};\n\tconst formPrototype = document.defaultView?.HTMLFormElement.prototype;\n\tconst submitDescriptor = formPrototype ? Object.getOwnPropertyDescriptor(formPrototype, \"submit\") : void 0;\n\tif (formPrototype && submitDescriptor?.configurable) {\n\t\tconst nativeSubmit = formPrototype.submit;\n\t\tconst submit = function() {\n\t\t\tnativeSubmit.call(this);\n\t\t\tif (active) activeSubmissions.get(this)?.direct();\n\t\t};\n\t\tObject.defineProperty(formPrototype, \"submit\", {\n\t\t\t...submitDescriptor,\n\t\t\tvalue: submit\n\t\t});\n\t\trestoreFormSubmit = () => {\n\t\t\tif (formPrototype.submit === submit) Object.defineProperty(formPrototype, \"submit\", submitDescriptor);\n\t\t};\n\t}\n\tsync();\n\treturn () => {\n\t\tactive = false;\n\t\trestoreFormSubmit();\n\t\trestoreAttachShadow();\n\t\tfor (const root of observers.keys()) stopObservingRoot(root);\n\t\tblockedDefinitions.clear();\n\t\tfor (const registration of registrations.values()) {\n\t\t\tregistration.cancelPending?.(new DOMException(\"Tool execution cancelled\", \"UnknownError\"));\n\t\t\tregistration.controller.abort();\n\t\t}\n\t\tregistrations.clear();\n\t};\n}\n\n//#endregion\n//#region src/index.ts\nconst POLYFILL_MARKER_PROPERTY = \"__isWebMCPPolyfill\";\nconst REGISTERED_INPUT_SCHEMA_SYMBOL = Symbol(\"registeredInputSchema\");\nconst REGISTRATION_SIGNAL_SYMBOL = Symbol(\"registrationSignal\");\nconst REGISTRATION_ABORT_SYMBOL = Symbol(\"registrationAbort\");\nconst installedProperties = [];\nlet installedContext = null;\nlet cleanupDeclarativeForms = null;\nfunction currentOrigin() {\n\treturn typeof globalThis.origin === \"string\" ? globalThis.origin : globalThis.location?.origin ?? \"\";\n}\nfunction installProperty(target, key, descriptor) {\n\tconst previous = Object.getOwnPropertyDescriptor(target, key);\n\ttry {\n\t\tObject.defineProperty(target, key, descriptor);\n\t} catch (error) {\n\t\tcleanupWebMCPPolyfill();\n\t\tthrow error;\n\t}\n\tinstalledProperties.push({\n\t\ttarget,\n\t\tkey,\n\t\tprevious\n\t});\n}\nvar StrictWebMCPContext = class extends EventTarget {\n\t#tools = /* @__PURE__ */ new Map();\n\t#testingShim = null;\n\t#ontoolchangeHandler = null;\n\t#ontoolchangeListener = (event) => {\n\t\tthis.#ontoolchangeHandler?.call(this, event);\n\t};\n\t#domException;\n\t#ownerDocument;\n\tconstructor(ownerDocument) {\n\t\tsuper();\n\t\tthis.#ownerDocument = ownerDocument;\n\t\tthis.#domException = ownerDocument?.defaultView?.DOMException ?? DOMException;\n\t\tObject.defineProperty(this, POLYFILL_MARKER_PROPERTY, {\n\t\t\tvalue: true,\n\t\t\tenumerable: false,\n\t\t\twritable: false,\n\t\t\tconfigurable: false\n\t\t});\n\t}\n\tget ontoolchange() {\n\t\treturn this.#ontoolchangeHandler;\n\t}\n\tset ontoolchange(handler) {\n\t\tconst listener = typeof handler === \"function\" ? handler : null;\n\t\tif (listener === null) {\n\t\t\tthis.#ontoolchangeHandler = null;\n\t\t\tsuper.removeEventListener(\"toolchange\", this.#ontoolchangeListener);\n\t\t\treturn;\n\t\t}\n\t\tif (this.#ontoolchangeHandler === null) super.addEventListener(\"toolchange\", this.#ontoolchangeListener);\n\t\tthis.#ontoolchangeHandler = listener;\n\t}\n\tasync registerTool(tool, options = {}) {\n\t\tvalidateWebMcpAccess(this.#ownerDocument);\n\t\tconst signal = options?.signal;\n\t\tconst normalized = normalizeToolDescriptor(tool, this.#tools);\n\t\tsignal?.throwIfAborted();\n\t\tvalidatePotentiallyTrustworthyOrigins(options?.exposedTo);\n\t\tsignal?.throwIfAborted();\n\t\tif (options?.exposedTo?.length) throw new this.#domException(\"Cross-document tool exposure requires native WebMCP\", \"NotSupportedError\");\n\t\tthis.#tools.set(normalized.name, normalized);\n\t\tif (signal) {\n\t\t\tconst abort = () => {\n\t\t\t\tif (this.#removeTool(normalized.name, normalized)) this.#notifyToolsChanged();\n\t\t\t};\n\t\t\tnormalized[REGISTRATION_SIGNAL_SYMBOL] = signal;\n\t\t\tnormalized[REGISTRATION_ABORT_SYMBOL] = abort;\n\t\t\tsignal.addEventListener(\"abort\", abort, { once: true });\n\t\t}\n\t\tawait this.#notifyToolsChanged();\n\t\tif (signal?.aborted) throw signal.reason;\n\t}\n\tasync getTools(options = {}) {\n\t\tvalidateWebMcpAccess(this.#ownerDocument);\n\t\tvalidatePotentiallyTrustworthyOrigins(options?.fromOrigins);\n\t\tif (options?.fromOrigins?.length) throw new this.#domException(\"Cross-document tool discovery requires native WebMCP\", \"NotSupportedError\");\n\t\tconst tools = [...this.#tools.values()].map((tool) => {\n\t\t\tconst serialized = tool[REGISTERED_INPUT_SCHEMA_SYMBOL];\n\t\t\tconst parsed = serialized === void 0 ? void 0 : JSON.parse(serialized);\n\t\t\treturn {\n\t\t\t\tname: tool.name,\n\t\t\t\ttitle: tool.title ?? \"\",\n\t\t\t\tdescription: tool.description,\n\t\t\t\t...isPlainObject(parsed) ? { inputSchema: parsed } : {},\n\t\t\t\torigin: currentOrigin(),\n\t\t\t\twindow: globalThis.window,\n\t\t\t\t...tool.annotations ? { annotations: toWebMcpAnnotations(tool.annotations) } : {}\n\t\t\t};\n\t\t}).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);\n\t\tawait new Promise((resolve) => setTimeout(resolve, 0));\n\t\treturn tools;\n\t}\n\tasync executeTool(tool, inputArgsJson, options = {}) {\n\t\tvalidateWebMcpAccess(this.#ownerDocument);\n\t\tif (tool === null || typeof tool !== \"object\") throw new TypeError(\"RegisteredTool must be an object\");\n\t\tfor (const required of [\n\t\t\t\"name\",\n\t\t\t\"description\",\n\t\t\t\"window\",\n\t\t\t\"origin\"\n\t\t]) if (!(required in tool)) throw new TypeError(`RegisteredTool.${required} is required`);\n\t\tvalidateExecutableOrigin(tool.origin);\n\t\tif (tool.window !== globalThis.window || tool.origin !== currentOrigin()) throw createUnknownError(`Tool not found: ${tool.name}`);\n\t\treturn this.#invokeToolByName(tool.name, inputArgsJson, options);\n\t}\n\t/** @internal Used by initializeWebMCPPolyfill */\n\tstatic getTestingShim(context) {\n\t\tcontext.#testingShim ??= new PolyfillTestingShim(context);\n\t\treturn context.#testingShim;\n\t}\n\t/** @internal Used by PolyfillTestingShim */\n\tstatic getToolInfos(context) {\n\t\treturn [...context.#tools.values()].map((tool) => ({\n\t\t\tname: tool.name,\n\t\t\tdescription: tool.description,\n\t\t\t...tool[REGISTERED_INPUT_SCHEMA_SYMBOL] === void 0 ? {} : { inputSchema: tool[REGISTERED_INPUT_SCHEMA_SYMBOL] }\n\t\t}));\n\t}\n\t/** @internal Used by PolyfillTestingShim */\n\tstatic executeToolForTesting(context, toolName, inputArgsJson, options) {\n\t\tvalidateWebMcpAccess(context.#ownerDocument);\n\t\treturn context.#invokeToolByName(toolName, inputArgsJson, options);\n\t}\n\t/** @internal Used by cleanupWebMCPPolyfill */\n\tstatic dispose(context) {\n\t\tfor (const name of context.#tools.keys()) context.#removeTool(name);\n\t\tcontext.ontoolchange = null;\n\t\tcontext.#testingShim?.dispose();\n\t}\n\t#removeTool(name, expected) {\n\t\tconst registered = this.#tools.get(name);\n\t\tif (!registered || expected && registered !== expected) return false;\n\t\tconst signal = registered[REGISTRATION_SIGNAL_SYMBOL];\n\t\tconst abort = registered[REGISTRATION_ABORT_SYMBOL];\n\t\tif (signal && abort) signal.removeEventListener(\"abort\", abort);\n\t\treturn this.#tools.delete(name);\n\t}\n\tasync #invokeToolByName(toolName, inputArgsJson, options) {\n\t\toptions?.signal?.throwIfAborted();\n\t\tconst tool = this.#tools.get(toolName);\n\t\tif (!tool) throw createUnknownError(`Tool not found: ${toolName}`);\n\t\tconst args = parseChromeToolInput(inputArgsJson);\n\t\toptions?.signal?.throwIfAborted();\n\t\tif (tool[REGISTRATION_SIGNAL_SYMBOL]?.aborted) throw createUnknownError(\"Tool unregistered\");\n\t\tlet rawResult;\n\t\ttry {\n\t\t\tconst registrationSignal = tool[REGISTRATION_SIGNAL_SYMBOL];\n\t\t\trawResult = await withAbortSignal(withAbortSignal(Promise.resolve(tool.execute(args)), registrationSignal, () => createUnknownError(\"Tool unregistered\")), options?.signal);\n\t\t} catch (error) {\n\t\t\tif (options?.signal?.aborted && error === options.signal.reason) throw error;\n\t\t\tif (tool[REGISTRATION_SIGNAL_SYMBOL]?.aborted) throw error;\n\t\t\tthrow createToolInvocationFailedError(error);\n\t\t}\n\t\treturn serializeChromeToolResult(rawResult);\n\t}\n\tasync #notifyToolsChanged() {\n\t\tawait new Promise((resolve) => setTimeout(resolve, 0));\n\t\tthis.dispatchEvent(new Event(\"toolchange\"));\n\t\tthis.#testingShim?.dispatchToolChange();\n\t}\n};\nconst modelContextConstructor = function ModelContext() {\n\tthrow new TypeError(\"Illegal constructor\");\n};\nObject.defineProperty(modelContextConstructor, \"name\", { value: \"ModelContext\" });\nObject.defineProperty(modelContextConstructor, \"prototype\", {\n\tvalue: StrictWebMCPContext.prototype,\n\twritable: false\n});\nObject.setPrototypeOf(modelContextConstructor, EventTarget);\nObject.defineProperty(StrictWebMCPContext.prototype, \"constructor\", {\n\tconfigurable: true,\n\twritable: true,\n\tvalue: modelContextConstructor\n});\nObject.defineProperty(StrictWebMCPContext.prototype, Symbol.toStringTag, {\n\tconfigurable: true,\n\tvalue: \"ModelContext\"\n});\nfor (const member of [\n\t\"registerTool\",\n\t\"getTools\",\n\t\"executeTool\",\n\t\"ontoolchange\"\n]) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(StrictWebMCPContext.prototype, member);\n\tif (descriptor) Object.defineProperty(StrictWebMCPContext.prototype, member, {\n\t\t...descriptor,\n\t\tenumerable: true\n\t});\n}\n/**\n* EventTarget-based testing shim matching the native Chromium ModelContextTesting surface.\n*\n* Fires `toolchange` events and supports the `ontoolchange` handler property.\n*/\nvar PolyfillTestingShim = class extends EventTarget {\n\t_ontoolchange = null;\n\tontoolchangeListener = (event) => {\n\t\tthis._ontoolchange?.call(this, event);\n\t};\n\t#context;\n\tconstructor(context) {\n\t\tsuper();\n\t\tthis.#context = context;\n\t}\n\tlistTools() {\n\t\treturn StrictWebMCPContext.getToolInfos(this.#context);\n\t}\n\texecuteTool(toolName, inputArgsJson, options) {\n\t\treturn StrictWebMCPContext.executeToolForTesting(this.#context, toolName, inputArgsJson, options);\n\t}\n\tget ontoolchange() {\n\t\treturn this._ontoolchange;\n\t}\n\tset ontoolchange(handler) {\n\t\tconst listener = typeof handler === \"function\" ? handler : null;\n\t\tif (listener === null) {\n\t\t\tthis._ontoolchange = null;\n\t\t\tsuper.removeEventListener(\"toolchange\", this.ontoolchangeListener);\n\t\t\treturn;\n\t\t}\n\t\tif (this._ontoolchange === null) super.addEventListener(\"toolchange\", this.ontoolchangeListener);\n\t\tthis._ontoolchange = listener;\n\t}\n\t/** @internal Called by StrictWebMCPContext when tools change. */\n\tdispatchToolChange() {\n\t\tthis.dispatchEvent(new Event(\"toolchange\"));\n\t}\n\tdispose() {\n\t\tthis.ontoolchange = null;\n\t}\n};\nfunction normalizeToolDescriptor(tool, existing) {\n\tif (!tool || typeof tool !== \"object\") throw new TypeError(\"registerTool(tool) requires a tool object\");\n\tconst coerced = coerceWebMcpToolDescriptor(tool);\n\tvalidateWebMcpToolDescriptor(coerced);\n\tif (existing.has(coerced.name)) throw createInvalidStateError(`Tool already registered: ${coerced.name}`);\n\tconst registeredInputSchema = coerced.inputSchema === void 0 ? void 0 : serializeInputSchema(coerced.inputSchema);\n\treturn {\n\t\tname: coerced.name,\n\t\t...coerced.title === void 0 ? {} : { title: coerced.title },\n\t\tdescription: coerced.description,\n\t\t...coerced.inputSchema === void 0 ? {} : { inputSchema: coerced.inputSchema },\n\t\t...coerced.annotations === void 0 ? {} : { annotations: coerced.annotations },\n\t\texecute: (input) => Reflect.apply(coerced.execute, void 0, [input]),\n\t\t...registeredInputSchema !== void 0 ? { [REGISTERED_INPUT_SCHEMA_SYMBOL]: registeredInputSchema } : {}\n\t};\n}\nlet navigatorModelContextDeprecationWarned = false;\n/**\n* Backing store for the `Document.prototype.modelContext` getter.\n*\n* WebIDL puts `[SameObject] readonly attribute ModelContext modelContext` on\n* the Document *interface prototype object*, not on the document instance, and\n* Chrome matches that. One shared accessor therefore needs somewhere to keep\n* the per-document value, and keying it by document is what makes repeated\n* reads return the identical object, as `[SameObject]` requires.\n*/\nconst documentModelContexts = /* @__PURE__ */ new WeakMap();\nconst { modelContext: documentModelContextGetter } = { modelContext() {\n\tif (!(this instanceof Document)) throw new TypeError(\"Illegal invocation\");\n\treturn documentModelContexts.get(this);\n} };\nObject.defineProperty(documentModelContextGetter, \"name\", { value: \"get modelContext\" });\nfunction defineDocumentModelContext(target, value) {\n\tdocumentModelContexts.set(target, value);\n\tif (Object.hasOwn(Document.prototype, \"modelContext\")) return;\n\tinstallProperty(Document.prototype, \"modelContext\", {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\tget: documentModelContextGetter\n\t});\n}\nfunction defineDeprecatedNavigatorModelContext(target, value) {\n\tinstallProperty(target, \"modelContext\", {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\tget() {\n\t\t\tif (!navigatorModelContextDeprecationWarned) {\n\t\t\t\tnavigatorModelContextDeprecationWarned = true;\n\t\t\t\tconsole.warn(\"[WebMCPPolyfill] navigator.modelContext is deprecated. The May 27, 2026 WebMCP draft moved the modelContext getter from Navigator to Document — use document.modelContext instead. See https://github.com/webmachinelearning/webmcp/pull/184.\");\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\t});\n}\nfunction installSubmitEventPolyfill() {\n\tconst prototype = SubmitEvent.prototype;\n\tif (!(\"agentInvoked\" in prototype)) installProperty(prototype, \"agentInvoked\", {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn isAgentInvokedSubmitEvent(this);\n\t\t}\n\t});\n\tif (!(\"respondWith\" in prototype)) installProperty(prototype, \"respondWith\", {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\twritable: true,\n\t\tvalue(agentResponse) {\n\t\t\trespondWithAgentSubmitEvent(this, agentResponse);\n\t\t}\n\t});\n}\nfunction initializeWebMCPPolyfill(options) {\n\tif (globalThis.isSecureContext === false) return;\n\tconst nav = typeof navigator === \"undefined\" ? null : navigator;\n\tconst doc = typeof document === \"undefined\" ? null : document;\n\tif (!nav || !doc || typeof window === \"undefined\") return;\n\tif (doc.modelContext) return;\n\tconst navigatorModelContext = nav.modelContext;\n\tif (installedProperties.length > 0) cleanupWebMCPPolyfill();\n\tif (navigatorModelContext) {\n\t\tdefineDocumentModelContext(doc, navigatorModelContext);\n\t\treturn;\n\t}\n\tconst previousDescriptor = Object.getOwnPropertyDescriptor(window, \"ModelContext\");\n\tif (previousDescriptor && !previousDescriptor.configurable) {\n\t\tif (!Object.is(Reflect.get(window, \"ModelContext\"), modelContextConstructor)) throw new TypeError(\"Cannot install ModelContext over a non-configurable global\");\n\t} else installProperty(window, \"ModelContext\", {\n\t\tconfigurable: true,\n\t\tenumerable: false,\n\t\twritable: true,\n\t\tvalue: modelContextConstructor\n\t});\n\tconst context = new StrictWebMCPContext(doc);\n\tinstalledContext = context;\n\tdefineDocumentModelContext(doc, context);\n\tnavigatorModelContextDeprecationWarned = false;\n\tdefineDeprecatedNavigatorModelContext(nav, context);\n\tinstallSubmitEventPolyfill();\n\tif (options?.installTestingShim && !nav.modelContextTesting) installProperty(nav, \"modelContextTesting\", {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\twritable: false,\n\t\tvalue: StrictWebMCPContext.getTestingShim(context)\n\t});\n\tcleanupDeclarativeForms = installDeclarativeForms(doc, context);\n}\nfunction cleanupWebMCPPolyfill() {\n\tcleanupDeclarativeForms?.();\n\tcleanupDeclarativeForms = null;\n\tif (installedContext) StrictWebMCPContext.dispose(installedContext);\n\tinstalledContext = null;\n\tfor (const { target, key, previous } of [...installedProperties].reverse()) if (previous) Object.defineProperty(target, key, previous);\n\telse Reflect.deleteProperty(target, key);\n\tinstalledProperties.length = 0;\n\tnavigatorModelContextDeprecationWarned = false;\n}\n\n//#endregion\nexport { cleanupWebMCPPolyfill, initializeWebMCPPolyfill };\n//# sourceMappingURL=index.js.map","import { initializeWebMCPPolyfill } from \"@mcp-b/webmcp-polyfill\";\n\nimport { DEFAULT_GROUP_ID } from \"../../config/config.js\";\nimport { TOOL_DEFINITIONS, type ToolDefinition } from \"../tools/tools.js\";\n\nexport type WebMcpMode = \"polyfill\" | \"native\";\n\nconst registeredToolControllers: Map<string, AbortController> = new Map();\nconst registeredToolNames: Set<string> = new Set();\n\nlet currentMode: WebMcpMode = \"polyfill\";\n\n/**\n * Set the WebMCP mode (polyfill vs native).\n *\n * - `\"polyfill\"` (default): Uses `@mcp-b/webmcp-polyfill` for a pure-JS\n * `document.modelContext` that works in all browsers.\n * - `\"native\"`: Uses Chrome's native `document.modelContext` from\n * `chrome://flags/#enable-webmcp-testing`. Requires the flag to be\n * enabled. May crash in early Canary builds.\n *\n * Detection follows Chrome's recommended compat pattern:\n * `document.modelContext || navigator.modelContext`\n * `navigator.modelContext` was deprecated in Chrome 150 and removed in\n * Chrome 152.0.7943.0, but the fallback keeps older clients working.\n */\nexport function setWebMcpMode(mode: WebMcpMode): void {\n currentMode = mode;\n}\n\nexport function getWebMcpMode(): WebMcpMode {\n return currentMode;\n}\n\n/**\n * Install the `@mcp-b/webmcp-polyfill` onto `document.modelContext`.\n *\n * The polyfill itself bails out when Chrome's native `document.modelContext`\n * is already present — it does NOT override the native API. We call it\n * unconditionally; if the polyfill is already installed it will detect the\n * existing install via its own `installState` guard and return quickly.\n */\nfunction ensurePolyfill(): void {\n try {\n initializeWebMCPPolyfill();\n } catch (err) {\n console.warn(\"WebMCP polyfill initialization failed:\", err);\n }\n}\n\n/**\n * Access the WebMCP ModelContext API.\n *\n * In polyfill mode: installs the `@mcp-b/webmcp-polyfill` which surfaces\n * `document.modelContext`.\n * In native mode: follows Chrome's recommended feature-detection pattern:\n * `document.modelContext || navigator.modelContext`\n * `navigator.modelContext` was deprecated in Chrome 150 and removed in\n * Chrome 152.0.7943.0, but the fallback preserves compatibility with\n * earlier builds that may still be in the wild.\n */\nfunction getModelContextApi(): any {\n if (typeof document === \"undefined\" && typeof navigator === \"undefined\") {\n return null;\n }\n\n if (currentMode === \"polyfill\") {\n ensurePolyfill();\n }\n\n try {\n const modelContext: unknown =\n typeof document !== \"undefined\" &&\n typeof (document as any).modelContext !== \"undefined\"\n ? Reflect.get(document, \"modelContext\")\n : typeof navigator !== \"undefined\" &&\n typeof (navigator as any).modelContext !== \"undefined\"\n ? Reflect.get(navigator, \"modelContext\")\n : undefined;\n\n if (!modelContext || typeof modelContext !== \"object\") {\n return null;\n }\n\n const api = modelContext as {\n registerTool?: unknown;\n unregisterTool?: unknown;\n getTools?: unknown;\n executeTool?: unknown;\n };\n\n if (typeof api.registerTool !== \"function\") {\n return null;\n }\n\n return api;\n } catch (err) {\n console.warn(\"WebMCP modelContext access failed:\", err);\n\n return null;\n }\n}\n\n/**\n * Safely parse or normalize WebMCP input schema.\n *\n * Starting in Chrome 154.0.8014.0 (PR #241), `RegisteredTool#inputSchema` returns\n * a JavaScript object (a deep copy of the schema provided at registration).\n * In Chrome < 154.0.8014.0, `RegisteredTool#inputSchema` returned a stringified JSON schema (DOMString).\n *\n * This function provides backwards-compatible schema parsing:\n * - If inputSchema is a string: attempts JSON.parse.\n * - If inputSchema is an object: returns the object.\n * - Fallbacks gracefully to an empty object schema if null, undefined, or invalid JSON.\n */\nexport function parseWebMcpInputSchema(\n inputSchema: unknown,\n): Record<string, unknown> {\n if (typeof inputSchema === \"string\") {\n try {\n const parsed = JSON.parse(inputSchema);\n if (parsed && typeof parsed === \"object\" && !Array.isArray(parsed)) {\n return parsed as Record<string, unknown>;\n }\n } catch {\n // Fallback on JSON parse error\n }\n\n return { type: \"object\", properties: {} };\n }\n\n if (\n inputSchema &&\n typeof inputSchema === \"object\" &&\n !Array.isArray(inputSchema)\n ) {\n return inputSchema as Record<string, unknown>;\n }\n\n return { type: \"object\", properties: {} };\n}\n\nexport interface WebMcpExecuteContext {\n signal?: AbortSignal;\n}\n\nexport interface WebMcpRegisteredTool {\n name: string;\n description?: string;\n inputSchema?: unknown;\n annotations?: Record<string, unknown>;\n execute?: (\n input: Record<string, unknown>,\n context?: WebMcpExecuteContext | AbortSignal,\n ) => Promise<unknown>;\n}\n\nexport interface NormalizedWebMcpRegisteredTool {\n name: string;\n description?: string;\n inputSchema: Record<string, unknown>;\n annotations?: Record<string, unknown>;\n execute?: (\n input: Record<string, unknown>,\n context?: WebMcpExecuteContext | AbortSignal,\n ) => Promise<unknown>;\n}\n\n/**\n * Safely extract AbortSignal from execute options/context.\n * Supports Chrome 153+ options object `{ signal }` (PR #247), direct AbortSignal instances,\n * or undefined for backward compatibility with Chrome < 153 and legacy callers.\n */\nexport function extractAbortSignal(\n context?: WebMcpExecuteContext | AbortSignal,\n): AbortSignal | undefined {\n if (!context) {\n return undefined;\n }\n\n if (typeof AbortSignal !== \"undefined\" && context instanceof AbortSignal) {\n return context;\n }\n\n if (\n typeof context === \"object\" &&\n \"signal\" in context &&\n typeof AbortSignal !== \"undefined\" &&\n context.signal instanceof AbortSignal\n ) {\n return context.signal;\n }\n\n return undefined;\n}\n\n/**\n * Retrieve tools registered on the WebMCP ModelContext API.\n *\n * Practicing graceful degradation:\n * - Feature-detects `getTools()` on `document.modelContext` / `navigator.modelContext`.\n * - If `getTools()` is absent (older browser builds or polyfills without getTools),\n * returns an empty array `[]` without throwing.\n * - Normalizes `RegisteredTool#inputSchema` so caller receives a JavaScript object\n * whether running on Chrome 154+ (native object) or Chrome < 154 (DOMString JSON).\n */\nexport async function getWebMcpTools(): Promise<\n NormalizedWebMcpRegisteredTool[]\n> {\n const modelContext = getModelContextApi() as {\n getTools?: () => Promise<WebMcpRegisteredTool[]>;\n } | null;\n\n if (!modelContext || typeof modelContext.getTools !== \"function\") {\n return [];\n }\n\n try {\n const rawTools = await modelContext.getTools();\n if (!Array.isArray(rawTools)) {\n return [];\n }\n\n return rawTools.map((tool) => ({\n name: tool.name,\n ...(tool.description ? { description: tool.description } : {}),\n inputSchema: parseWebMcpInputSchema(tool.inputSchema),\n ...(tool.annotations ? { annotations: tool.annotations } : {}),\n ...(tool.execute ? { execute: tool.execute } : {}),\n }));\n } catch (err) {\n console.warn(\"Failed to retrieve WebMCP tools via getTools():\", err);\n\n return [];\n }\n}\n\n/**\n * Gracefully execute a WebMCP tool on a ModelContext instance with backwards compatibility.\n *\n * Starting in Chrome 155.0.8052.0 (PR #246, PR #251), `document.modelContext.executeTool()`\n * accepts an optional JavaScript object directly instead of a JSON DOMString.\n * In Chrome < 155 and earlier polyfills, `executeTool()` required a stringified JSON arguments string.\n *\n * This function practices graceful degradation:\n * 1. Prepares both an `inputObject` (for Chrome 155+) and an `inputStr` (for Chrome < 155 & polyfills).\n * 2. Attempts to execute `executeTool(tool, inputObject, options)` first.\n * 3. Catches errors starting with \"Failed to parse input\" (or TypeErrors from WebIDL DOMString checks)\n * and retries transparently with `JSON.stringify(inputObject)`.\n * 4. Re-throws any unrelated execution errors.\n */\nexport async function executeWebMcpTool(\n modelContext: any,\n tool: any,\n input?: unknown,\n options?: WebMcpExecuteContext | AbortSignal,\n): Promise<unknown> {\n if (!modelContext || typeof modelContext.executeTool !== \"function\") {\n throw new Error(\"ModelContext executeTool is not available\");\n }\n\n let inputObject: Record<string, unknown>;\n let inputStr: string;\n\n if (typeof input === \"string\") {\n inputStr = input;\n try {\n const parsed = JSON.parse(input);\n inputObject =\n parsed && typeof parsed === \"object\" && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : {};\n } catch {\n inputObject = {};\n }\n } else if (input && typeof input === \"object\" && !Array.isArray(input)) {\n inputObject = input as Record<string, unknown>;\n try {\n inputStr = JSON.stringify(input);\n } catch {\n inputStr = \"{}\";\n }\n } else {\n inputObject = {};\n inputStr = \"{}\";\n }\n\n try {\n return await modelContext.executeTool(tool, inputObject, options);\n } catch (err: any) {\n const isParseError =\n typeof err?.message === \"string\" &&\n err.message.startsWith(\"Failed to parse input\");\n const isTypeError = err instanceof TypeError;\n\n if (isParseError || isTypeError) {\n return await modelContext.executeTool(tool, inputStr, options);\n }\n\n throw err;\n }\n}\n\n/**\n * Feature detection for the WebMCP imperative API.\n *\n * To test this integration in Google Chrome, use the Model Context Tool\n * Inspector extension:\n * https://chromewebstore.google.com/detail/model-context-tool-inspec/gbpdfapgefenggkahomfgkhfehlcenpd\n */\nexport function isWebMcpSupported(): boolean {\n return !!getModelContextApi();\n}\n\n/**\n * Consequential tools that perform high-stakes, irreversible, or external real-world actions\n * (such as deleting data, executing arbitrary system commands, or transmitting live communications).\n * Signals consuming agents to require explicit user confirmation prior to execution (Chrome 154.0.8017.0+).\n */\nexport const CONSEQUENTIAL_TOOL_NAMES: ReadonlySet<string> = new Set([\n \"bash\",\n \"clear_chat\",\n \"delete_file\",\n \"delete_task\",\n \"email_send_message\",\n \"git_delete_branch\",\n \"git_delete_repo\",\n \"git_push\",\n \"git_reset\",\n]);\n\n/**\n * Read-only tools that query information without mutating state.\n */\nexport const READ_ONLY_TOOL_NAMES: ReadonlySet<string> = new Set([\n \"ask_user\",\n \"detect_language\",\n \"diff_files\",\n \"email_read_messages\",\n \"fetch_url\",\n \"get_current_time\",\n \"git_branches\",\n \"git_diff\",\n \"git_list_repos\",\n \"git_log\",\n \"git_read_file_at_ref\",\n \"git_show\",\n \"git_status\",\n \"list_components\",\n \"list_files\",\n \"list_room_members\",\n \"list_tasks\",\n \"list_tool_profiles\",\n \"proofread_text\",\n \"read_file\",\n \"remote_mcp_list_tools\",\n \"rewrite_text\",\n \"search_files\",\n \"summarize_text\",\n \"translate_text\",\n \"web_search\",\n \"write_text\",\n]);\n\nexport interface WebMcpToolAnnotations {\n readOnlyHint?: boolean;\n consequentialHint?: boolean;\n untrustedContentHint?: boolean;\n [key: string]: unknown;\n}\n\n/**\n * Resolve annotations for a WebMCP tool registration.\n * Allows custom annotations (from declarative or customized tool definitions)\n * to override defaults.\n */\nexport function resolveWebMcpToolAnnotations(\n toolName: string,\n customAnnotations?: Record<string, unknown>,\n): WebMcpToolAnnotations {\n const isConsequential = CONSEQUENTIAL_TOOL_NAMES.has(toolName);\n const isReadOnly = !isConsequential && READ_ONLY_TOOL_NAMES.has(toolName);\n\n return {\n readOnlyHint: isReadOnly,\n consequentialHint: isConsequential,\n untrustedContentHint: true,\n ...(customAnnotations || {}),\n };\n}\n\n/**\n * Register ShadowClaw tools with the WebMCP ModelContext API.\n *\n * Both the `@mcp-b/webmcp-polyfill` and Chrome's native API support\n * `registerTool(tool, { signal })`. We always use AbortController signals so\n * that unregistration works identically regardless of which implementation is\n * actually active.\n *\n * Key correctness detail: `initializeWebMCPPolyfill()` is a no-op when\n * Chrome's native `document.modelContext` already exists — it does NOT\n * override the native API. In that situation we are talking to the native\n * Chrome API even in \"polyfill\" mode. The native Chrome API only supports\n * signal-based unregistration, so using AbortController signals everywhere\n * prevents \"Duplicate tool name\" errors when tools are re-configured.\n */\nexport async function registerWebMcpTools(\n agentWorker: Worker | null,\n _emit: (message: any) => Promise<void> | void,\n groupId: string = DEFAULT_GROUP_ID,\n tools?: ToolDefinition[],\n): Promise<boolean> {\n const activeTools = Array.isArray(tools) ? tools : TOOL_DEFINITIONS;\n\n if (activeTools.length === 0) {\n return true;\n }\n\n const modelContext = getModelContextApi();\n if (!modelContext) {\n return false;\n }\n\n for (const def of activeTools) {\n if (registeredToolNames.has(def.name)) {\n continue;\n }\n\n const controller = new AbortController();\n registeredToolControllers.set(def.name, controller);\n registeredToolNames.add(def.name);\n\n try {\n const toolDef: any = {\n name: def.name,\n description: def.description,\n inputSchema: parseWebMcpInputSchema(def.input_schema),\n annotations: resolveWebMcpToolAnnotations(\n def.name,\n (def as any).annotations,\n ),\n execute: (\n input: Record<string, unknown>,\n context?: WebMcpExecuteContext | AbortSignal,\n ) => {\n if (!agentWorker) {\n throw new Error(\"Cannot execute tool: agent worker is not ready\");\n }\n\n const signal = extractAbortSignal(context);\n\n if (signal?.aborted) {\n return Promise.reject(new Error(\"Tool execution aborted\"));\n }\n\n return new Promise((resolve, reject) => {\n const callId =\n Date.now().toString(36) + Math.random().toString(36).slice(2);\n\n let timeout: ReturnType<typeof setTimeout> | null = null;\n\n const cleanup = () => {\n if (timeout !== null) {\n clearTimeout(timeout);\n timeout = null;\n }\n agentWorker?.removeEventListener(\"message\", handler);\n if (signal && onAbort) {\n signal.removeEventListener(\"abort\", onAbort);\n }\n };\n\n const onAbort = () => {\n cleanup();\n reject(new Error(\"Tool execution aborted\"));\n };\n\n if (signal) {\n signal.addEventListener(\"abort\", onAbort, { once: true });\n }\n\n timeout = setTimeout(() => {\n cleanup();\n reject(new Error(\"Timeout waiting for tool execution\"));\n }, 600000);\n\n const handler = (event: MessageEvent) => {\n const data = event.data;\n if (\n data &&\n data.type === \"execute-tool-result\" &&\n data.callId === callId\n ) {\n cleanup();\n\n if (data.error) {\n reject(new Error(data.error));\n } else {\n resolve(data.result);\n }\n }\n };\n\n agentWorker.addEventListener(\"message\", handler);\n\n agentWorker.postMessage({\n type: \"execute-tool\",\n callId,\n payload: { name: def.name, input: input || {}, groupId },\n });\n });\n },\n };\n\n // Always use AbortController signals — both the polyfill and the native\n // Chrome API honour { signal } for lifecycle management.\n await modelContext.registerTool(toolDef, { signal: controller.signal });\n\n // Yield to the event loop between registrations.\n await new Promise((resolve) => setTimeout(resolve, 0));\n } catch (err) {\n registeredToolControllers.delete(def.name);\n registeredToolNames.delete(def.name);\n\n // Treat duplicate-registration errors as a no-op. The polyfill throws\n // \"Tool already registered: <name>\" and the native Chrome API throws\n // \"Duplicate tool name\" — both mean the tool is already present.\n const isDuplicate =\n err instanceof Error &&\n (err.message.includes(\"already registered\") ||\n err.message.includes(\"Duplicate tool name\"));\n\n if (!isDuplicate) {\n console.error(`Failed to register tool ${def.name}:`, err);\n\n throw err;\n }\n }\n }\n\n return true;\n}\n\n/**\n * Unregister previously registered ShadowClaw WebMCP tools.\n *\n * Aborts every AbortController associated with a registered tool. This works\n * for both the polyfill (which listens for the `abort` event on the signal it\n * was given) and Chrome's native API (which also uses signal-based lifecycle).\n * The deprecated `unregisterTool(name)` is intentionally NOT called here\n * because it is absent from the native Chrome API and causes silent failures\n * that prevent proper cleanup.\n */\nexport function unregisterWebMcpTools() {\n for (const controller of registeredToolControllers.values()) {\n try {\n controller.abort();\n } catch {\n // Ignore unregister errors in experimental API contexts.\n }\n }\n\n registeredToolControllers.clear();\n registeredToolNames.clear();\n}\n"],"x_google_ignoreList":[0,1],"mappings":";;;;;;AAKA,MAAM,0CAA0C;AAChD,MAAM,i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1.json",
|
|
3
3
|
"name": "shadow-claw",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.33.0",
|
|
5
5
|
"description": "Browser-native personal AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution.",
|
|
6
6
|
"title": "ShadowClaw MCP Server",
|
|
7
7
|
"websiteUrl": "https://xt-ml.github.io/shadow-claw/",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://modelcontextprotocol.io/schemas/server-card/v1.json",
|
|
3
3
|
"name": "shadow-claw",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.33.0",
|
|
5
5
|
"description": "Browser-native personal AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution.",
|
|
6
6
|
"title": "ShadowClaw MCP Server",
|
|
7
7
|
"websiteUrl": "https://xt-ml.github.io/shadow-claw/",
|