[{"data":1,"prerenderedAt":329},["ShallowReactive",2],{"i-simple-icons:github":3,"i-lucide:arrow-right":8,"doc-\u002Fdocs\u002Ftesting":10,"docs-sidebar":287,"doc-surround-\u002Fdocs\u002Ftesting":322,"i-lucide:arrow-left":327},{"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":279,"extension":280,"group":281,"groupOrder":47,"meta":282,"navTitle":12,"navigation":71,"order":100,"path":283,"seo":284,"stem":285,"__hash__":286},"docs\u002Fdocs\u002Ftesting.md","Testing",{"type":14,"value":15,"toc":276},"minimark",[16,21,34,170,189,194,200,263,272],[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 github-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,66,73,93,98,105,110,144,150,155],{"__ignoreMap":40},[44,45,48,52,56,59,63],"span",{"class":46,"line":47},"line",1,[44,49,51],{"class":50},"szBVR","import",[44,53,55],{"class":54},"sVt8B"," { installFakeAgent } ",[44,57,58],{"class":50},"from",[44,60,62],{"class":61},"sZZnC"," '@webmcpui\u002Fcore\u002Ftesting'",[44,64,65],{"class":54},";\n",[44,67,69],{"class":46,"line":68},2,[44,70,72],{"emptyLinePlaceholder":71},true,"\n",[44,74,76,79,83,86,90],{"class":46,"line":75},3,[44,77,78],{"class":50},"const",[44,80,82],{"class":81},"sj4cs"," agent",[44,84,85],{"class":50}," =",[44,87,89],{"class":88},"sScJk"," installFakeAgent",[44,91,92],{"class":54},"();\n",[44,94,96],{"class":46,"line":95},4,[44,97,72],{"emptyLinePlaceholder":71},[44,99,101],{"class":46,"line":100},5,[44,102,104],{"class":103},"sJ8bj","\u002F\u002F ... connect a \u003Cwmcp-input name=\"email\" expose> to the DOM ...\n",[44,106,108],{"class":46,"line":107},6,[44,109,72],{"emptyLinePlaceholder":71},[44,111,113,115,118,120,123,126,129,132,135,138,141],{"class":46,"line":112},7,[44,114,78],{"class":50},[44,116,117],{"class":81}," result",[44,119,85],{"class":50},[44,121,122],{"class":50}," await",[44,124,125],{"class":54}," agent.",[44,127,128],{"class":88},"call",[44,130,131],{"class":54},"(",[44,133,134],{"class":61},"'fill_email'",[44,136,137],{"class":54},", { value: ",[44,139,140],{"class":61},"'ada@webmcpui.com'",[44,142,143],{"class":54}," });\n",[44,145,147],{"class":46,"line":146},8,[44,148,149],{"class":103},"\u002F\u002F the live element is now filled, validated, and has fired input\u002Fchange\n",[44,151,153],{"class":46,"line":152},9,[44,154,72],{"emptyLinePlaceholder":71},[44,156,158,161,164,167],{"class":46,"line":157},10,[44,159,160],{"class":54},"agent.",[44,162,163],{"class":88},"restore",[44,165,166],{"class":54},"(); ",[44,168,169],{"class":103},"\u002F\u002F remove the stub\n",[171,172,173],"blockquote",{},[22,174,175,179,180,184,185,188],{},[176,177,178],"strong",{},"Order matters."," Install the fake agent ",[181,182,183],"em",{},"before"," the element connects — controls register their tool in ",[26,186,187],{},"connectedCallback",", so the host must already be present.",[190,191,193],"h2",{"id":192},"the-handle","The handle",[22,195,196,199],{},[26,197,198],{},"installFakeAgent()"," returns:",[201,202,203,216],"table",{},[204,205,206],"thead",{},[207,208,209,213],"tr",{},[210,211,212],"th",{},"Member",[210,214,215],{},"Description",[217,218,219,230,240,250],"tbody",{},[207,220,221,227],{},[222,223,224],"td",{},[26,225,226],{},"tools",[222,228,229],{},"All currently-registered tools, in registration order.",[207,231,232,237],{},[222,233,234],{},[26,235,236],{},"get(name)",[222,238,239],{},"Look up a registered tool by name.",[207,241,242,247],{},[222,243,244],{},[26,245,246],{},"call(name, args?)",[222,248,249],{},"Invoke a tool as an agent would; throws if unknown.",[207,251,252,257],{},[222,253,254],{},[26,255,256],{},"restore()",[222,258,259,260,262],{},"Restore the previous ",[26,261,32],{},".",[22,264,265,266,271],{},"This is exactly what powers the live demo on the ",[267,268,270],"a",{"href":269},"\u002F","homepage"," — the same fake host, driving real elements.",[273,274,275],"style",{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}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":68,"depth":68,"links":277},[278],{"id":192,"depth":68,"text":193},"Exercise WebMCP exposure end-to-end with the bundled fake agent.","md","Getting started",{},"\u002Fdocs\u002Ftesting",{"title":12,"description":279},"docs\u002Ftesting","ELbT5CE4hCljRsrgjzumk3iz_sBzkCAF2A5IIbAZ_CY",[288,293,297,301,305,309,312,315,316,319],{"path":289,"title":290,"navTitle":291,"group":292,"order":95,"groupOrder":68},"\u002Fdocs\u002Felements\u002Fcheckbox","\u003Cwmcp-checkbox>","Checkbox","Elements",{"path":294,"title":295,"navTitle":296,"group":292,"order":47,"groupOrder":68},"\u002Fdocs\u002Felements\u002Finput","\u003Cwmcp-input>","Input",{"path":298,"title":299,"navTitle":300,"group":292,"order":100,"groupOrder":68},"\u002Fdocs\u002Felements\u002Fradio","\u003Cwmcp-radio-group>","Radio group",{"path":302,"title":303,"navTitle":304,"group":292,"order":75,"groupOrder":68},"\u002Fdocs\u002Felements\u002Fselect","\u003Cwmcp-select>","Select",{"path":306,"title":307,"navTitle":308,"group":292,"order":68,"groupOrder":68},"\u002Fdocs\u002Felements\u002Ftextarea","\u003Cwmcp-textarea>","Textarea",{"path":310,"title":311,"navTitle":311,"group":281,"order":47,"groupOrder":47},"\u002Fdocs","Introduction",{"path":313,"title":314,"navTitle":314,"group":281,"order":68,"groupOrder":47},"\u002Fdocs\u002Finstallation","Installation",{"path":283,"title":12,"navTitle":12,"group":281,"order":100,"groupOrder":47},{"path":317,"title":318,"navTitle":318,"group":281,"order":75,"groupOrder":47},"\u002Fdocs\u002Fvalidation","Validation",{"path":320,"title":321,"navTitle":321,"group":281,"order":95,"groupOrder":47},"\u002Fdocs\u002Fwebmcp","WebMCP exposure",[323,325],{"title":314,"path":313,"stem":324,"navTitle":314,"children":-1},"docs\u002Finstallation",{"title":318,"path":317,"stem":326,"navTitle":318,"children":-1},"docs\u002Fvalidation",{"left":4,"top":4,"width":5,"height":5,"rotate":4,"vFlip":6,"hFlip":6,"body":328},"\u003Cpath fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"m12 19l-7-7l7-7m7 7H5\"\u002F>",1781416228942]