[{"data":1,"prerenderedAt":372},["ShallowReactive",2],{"i-simple-icons:github":3,"i-lucide:arrow-right":8,"doc-\u002Fdocs\u002Ftesting":10,"docs-sidebar":305,"i-lucide:file-text":368,"i-lucide:arrow-left":370},{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":7},0,24,false,"\u003Cpath fill=\"currentColor\" d=\"M12 .297c-6.63 0-12 5.373-12 12c0 5.303 3.438 9.8 8.205 11.385c.6.113.82-.258.82-.577c0-.285-.01-1.04-.015-2.04c-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729c1.205.084 1.838 1.236 1.838 1.236c1.07 1.835 2.809 1.305 3.495.998c.108-.776.417-1.305.76-1.605c-2.665-.3-5.466-1.332-5.466-5.93c0-1.31.465-2.38 1.235-3.22c-.135-.303-.54-1.523.105-3.176c0 0 1.005-.322 3.3 1.23c.96-.267 1.98-.399 3-.405c1.02.006 2.04.138 3 .405c2.28-1.552 3.285-1.23 3.285-1.23c.645 1.653.24 2.873.12 3.176c.765.84 1.23 1.91 1.23 3.22c0 4.61-2.805 5.625-5.475 5.92c.42.36.81 1.096.81 2.22c0 1.606-.015 2.896-.015 3.286c0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12\"\u002F>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":9},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M5 12h14m-7-7l7 7l-7 7\"\u002F>",{"id":11,"title":12,"body":13,"description":297,"extension":298,"group":299,"groupOrder":47,"meta":300,"navTitle":12,"navigation":72,"order":104,"path":301,"seo":302,"stem":303,"__hash__":304},"docs\u002Fdocs\u002Ftesting.md","Testing",{"type":14,"value":15,"toc":294},"minimark",[16,21,34,189,208,213,219,281,290],[17,18,20],"h1",{"id":19},"testing-with-the-fake-agent","Testing with the fake agent",[22,23,24,25,29,30,33],"p",{},"No mainstream agent calls WebMCP yet, so ",[26,27,28],"code",{},"@webmcpui\u002Fcore\u002Ftesting"," ships a fake host that lets you exercise exposure end to end. It installs a stub ",[26,31,32],{},"navigator.modelContext",", records the tools your elements register, and lets you invoke them exactly as an agent would.",[35,36,41],"pre",{"className":37,"code":38,"language":39,"meta":40,"style":40},"language-ts shiki shiki-themes github-light-default ayu-dark","import { installFakeAgent } from '@webmcpui\u002Fcore\u002Ftesting';\n\nconst agent = installFakeAgent();\n\n\u002F\u002F ... connect a \u003Cwmcp-input name=\"email\" expose> to the DOM ...\n\nconst result = await agent.call('fill_email', { value: 'ada@webmcpui.com' });\n\u002F\u002F the live element is now filled, validated, and has fired input\u002Fchange\n\nagent.restore(); \u002F\u002F remove the stub\n","ts","",[26,42,43,67,74,97,102,109,114,159,165,170],{"__ignoreMap":40},[44,45,48,52,56,59,63],"span",{"class":46,"line":47},"line",1,[44,49,51],{"class":50},"s7jPt","import",[44,53,55],{"class":54},"sBz_o"," { installFakeAgent } ",[44,57,58],{"class":50},"from",[44,60,62],{"class":61},"sxLuP"," '@webmcpui\u002Fcore\u002Ftesting'",[44,64,66],{"class":65},"siQKT",";\n",[44,68,70],{"class":46,"line":69},2,[44,71,73],{"emptyLinePlaceholder":72},true,"\n",[44,75,77,80,84,88,92,95],{"class":46,"line":76},3,[44,78,79],{"class":50},"const",[44,81,83],{"class":82},"sgp7R"," agent",[44,85,87],{"class":86},"snFdW"," =",[44,89,91],{"class":90},"s2DMw"," installFakeAgent",[44,93,94],{"class":54},"()",[44,96,66],{"class":65},[44,98,100],{"class":46,"line":99},4,[44,101,73],{"emptyLinePlaceholder":72},[44,103,105],{"class":46,"line":104},5,[44,106,108],{"class":107},"s5O_a","\u002F\u002F ... connect a \u003Cwmcp-input name=\"email\" expose> to the DOM ...\n",[44,110,112],{"class":46,"line":111},6,[44,113,73],{"emptyLinePlaceholder":72},[44,115,117,119,122,124,127,129,133,136,139,142,145,148,151,154,157],{"class":46,"line":116},7,[44,118,79],{"class":50},[44,120,121],{"class":82}," result",[44,123,87],{"class":86},[44,125,126],{"class":50}," await",[44,128,83],{"class":54},[44,130,132],{"class":131},"s0eYM",".",[44,134,135],{"class":90},"call",[44,137,138],{"class":54},"(",[44,140,141],{"class":61},"'fill_email'",[44,143,144],{"class":65},",",[44,146,147],{"class":54}," { value",[44,149,150],{"class":65},":",[44,152,153],{"class":61}," 'ada@webmcpui.com'",[44,155,156],{"class":54}," })",[44,158,66],{"class":65},[44,160,162],{"class":46,"line":161},8,[44,163,164],{"class":107},"\u002F\u002F the live element is now filled, validated, and has fired input\u002Fchange\n",[44,166,168],{"class":46,"line":167},9,[44,169,73],{"emptyLinePlaceholder":72},[44,171,173,176,178,181,183,186],{"class":46,"line":172},10,[44,174,175],{"class":54},"agent",[44,177,132],{"class":131},[44,179,180],{"class":90},"restore",[44,182,94],{"class":54},[44,184,185],{"class":65},";",[44,187,188],{"class":107}," \u002F\u002F remove the stub\n",[190,191,192],"blockquote",{},[22,193,194,198,199,203,204,207],{},[195,196,197],"strong",{},"Order matters."," Install the fake agent ",[200,201,202],"em",{},"before"," the element connects — controls register their tool in ",[26,205,206],{},"connectedCallback",", so the host must already be present.",[209,210,212],"h2",{"id":211},"the-handle","The handle",[22,214,215,218],{},[26,216,217],{},"installFakeAgent()"," returns:",[220,221,222,235],"table",{},[223,224,225],"thead",{},[226,227,228,232],"tr",{},[229,230,231],"th",{},"Member",[229,233,234],{},"Description",[236,237,238,249,259,269],"tbody",{},[226,239,240,246],{},[241,242,243],"td",{},[26,244,245],{},"tools",[241,247,248],{},"All currently-registered tools, in registration order.",[226,250,251,256],{},[241,252,253],{},[26,254,255],{},"get(name)",[241,257,258],{},"Look up a registered tool by name.",[226,260,261,266],{},[241,262,263],{},[26,264,265],{},"call(name, args?)",[241,267,268],{},"Invoke a tool as an agent would; throws if unknown.",[226,270,271,276],{},[241,272,273],{},[26,274,275],{},"restore()",[241,277,278,279,132],{},"Restore the previous ",[26,280,32],{},[22,282,283,284,289],{},"This is exactly what powers the live demo on the ",[285,286,288],"a",{"href":287},"\u002F","homepage"," — the same fake host, driving real elements.",[291,292,293],"style",{},"html pre.shiki code .s7jPt, html code.shiki .s7jPt{--shiki-default:#CF222E;--shiki-dark:#FF8F40}html pre.shiki code .sBz_o, html code.shiki .sBz_o{--shiki-default:#1F2328;--shiki-dark:#BFBDB6}html pre.shiki code .sxLuP, html code.shiki .sxLuP{--shiki-default:#0A3069;--shiki-dark:#AAD94C}html pre.shiki code .siQKT, html code.shiki .siQKT{--shiki-default:#1F2328;--shiki-dark:#BFBDB6B3}html pre.shiki code .sgp7R, html code.shiki .sgp7R{--shiki-default:#0550AE;--shiki-dark:#BFBDB6}html pre.shiki code .snFdW, html code.shiki .snFdW{--shiki-default:#CF222E;--shiki-dark:#F29668}html pre.shiki code .s2DMw, html code.shiki .s2DMw{--shiki-default:#8250DF;--shiki-dark:#FFB454}html pre.shiki code .s5O_a, html code.shiki .s5O_a{--shiki-default:#6E7781;--shiki-default-font-style:inherit;--shiki-dark:#5A6673;--shiki-dark-font-style:italic}html pre.shiki code .s0eYM, html code.shiki .s0eYM{--shiki-default:#1F2328;--shiki-dark:#F29668}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":40,"searchDepth":69,"depth":69,"links":295},[296],{"id":211,"depth":69,"text":212},"Exercise WebMCP exposure end-to-end with the bundled fake agent.","md","Getting started",{},"\u002Fdocs\u002Ftesting",{"title":12,"description":297},"docs\u002Ftesting","3M7GcOIQNLSt0T76V1L3ATF4FRlgsH68kDeVC1xmGY8",[306,311,316,320,324,328,332,336,340,344,348,352,355,358,361,362,365],{"path":307,"title":308,"navTitle":309,"group":310,"order":47,"groupOrder":76},"\u002Fdocs\u002Felements\u002Fbutton","\u003Cwmcp-button>","Button","Interaction",{"path":312,"title":313,"navTitle":314,"group":315,"order":99,"groupOrder":69},"\u002Fdocs\u002Felements\u002Fcheckbox","\u003Cwmcp-checkbox>","Checkbox","Elements",{"path":317,"title":318,"navTitle":319,"group":310,"order":69,"groupOrder":76},"\u002Fdocs\u002Felements\u002Fdialog","\u003Cwmcp-dialog>","Dialog",{"path":321,"title":322,"navTitle":323,"group":315,"order":47,"groupOrder":69},"\u002Fdocs\u002Felements\u002Finput","\u003Cwmcp-input>","Input",{"path":325,"title":326,"navTitle":327,"group":310,"order":76,"groupOrder":76},"\u002Fdocs\u002Felements\u002Fmenu","\u003Cwmcp-menu>","Menu",{"path":329,"title":330,"navTitle":331,"group":310,"order":104,"groupOrder":76},"\u002Fdocs\u002Felements\u002Fpopover","\u003Cwmcp-popover>","Popover",{"path":333,"title":334,"navTitle":335,"group":315,"order":104,"groupOrder":69},"\u002Fdocs\u002Felements\u002Fradio","\u003Cwmcp-radio-group>","Radio group",{"path":337,"title":338,"navTitle":339,"group":315,"order":76,"groupOrder":69},"\u002Fdocs\u002Felements\u002Fselect","\u003Cwmcp-select>","Select",{"path":341,"title":342,"navTitle":343,"group":310,"order":99,"groupOrder":76},"\u002Fdocs\u002Felements\u002Ftabs","\u003Cwmcp-tabs>","Tabs",{"path":345,"title":346,"navTitle":347,"group":315,"order":69,"groupOrder":69},"\u002Fdocs\u002Felements\u002Ftextarea","\u003Cwmcp-textarea>","Textarea",{"path":349,"title":350,"navTitle":351,"group":310,"order":111,"groupOrder":76},"\u002Fdocs\u002Felements\u002Ftoast","\u003Cwmcp-toast>","Toast",{"path":353,"title":354,"navTitle":354,"group":299,"order":111,"groupOrder":47},"\u002Fdocs\u002Fframeworks","React & Vue",{"path":356,"title":357,"navTitle":357,"group":299,"order":47,"groupOrder":47},"\u002Fdocs","Introduction",{"path":359,"title":360,"navTitle":360,"group":299,"order":69,"groupOrder":47},"\u002Fdocs\u002Finstallation","Installation",{"path":301,"title":12,"navTitle":12,"group":299,"order":104,"groupOrder":47},{"path":363,"title":364,"navTitle":364,"group":299,"order":76,"groupOrder":47},"\u002Fdocs\u002Fvalidation","Validation",{"path":366,"title":367,"navTitle":367,"group":299,"order":99,"groupOrder":47},"\u002Fdocs\u002Fwebmcp","WebMCP exposure",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":369},"\u003Cg fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\">\u003Cpath d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"\u002F>\u003Cpath d=\"M14 2v5a1 1 0 0 0 1 1h5M10 9H8m8 4H8m8 4H8\"\u002F>\u003C\u002Fg>",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":371},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m12 19l-7-7l7-7m7 7H5\"\u002F>",1782971919735]