1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/tapTier-DkLoiIx7.js","assets/SchemeBadge-VWoTcDYg.js","assets/app-BsfAxaQK.js","assets/app-BRC48kc6.css","assets/SchemeBadge-CB06x3X_.css"])))=>i.map(i=>d[i]); 2import{d as _e,c as a,o,b as t,_ as De,m as tt,p as st,k as _,q as Wt,r as p,s as je,i as R,x as K,a as S,f as r,F as E,t as l,y as Gt,g as X,n as j,z as nt,u as d,e as Me,A as St,B as yt,C as kt,D as Jt,E as Qt,w as Ge,h as Xt,G as Je,j as Ue,v as Qe,H as Yt,I as bt,l as Zt}from"./app-BsfAxaQK.js";import{K as Se,R as Xe,u as _t,a as Kt,b as es,D as ts,N as ss,B as Ye,I as ns,g as os}from"./identityLinking-cXzldMHn.js";import{V as he}from"./Verdict-CFKt_12S.js";import{u as as,H as ls,N as is}from"./HeldStatePanel-CI3SE1lX.js";import{F as rs,s as us,r as ds,e as cs}from"./timeline-CnljBghH.js";import{E as ps}from"./EmbeddedCheckoutCard-ybW2cMuO.js";import{M as vs,_ as hs}from"./MarketingUserDropdown-B4ToGAan.js";import{N as ms}from"./NavLinks-DB-SdPTR.js";import{o as Ze,a as Ke,v as gs,f as fs}from"./outcomes-CSCzyRsw.js";import{g as et,a as ys}from"./schemaQuality-BG4DwHdY.js";import"./buyerContextOptions-DEJxrUUm.js";import"./createLucideIcon-CRhJyKcU.js";import"./users-B2KC97cy.js";import"./clock-zLXXFC1O.js";const ks=["href","title","aria-label"],bs=_e({__name:"DocsHint",props:{href:{},label:{}},setup(f){return(y,b)=>(o(),a("a",{href:f.href,class:"docs-hint",target:"_blank",rel:"noopener",title:f.label,"aria-label":f.label},[...b[0]||(b[0]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"M12 16v-4"}),t("path",{d:"M12 8h.01"})],-1)])],8,ks))}}),me=De(bs,[["__scopeId","data-v-43c7b09d"]]),_s={class:"sidebar-section menu-host"},ws={class:"section-header",style:{cursor:"default"}},Cs={class:"header-actions"},Ms={class:"section-body"},Ss={class:"select-group"},$s={key:0,class:"identity-hint"},xs={key:1,class:"identity-hint"},Ts={class:"identity-hint"},Ps={key:0,class:"identity-caveat"},Is={key:1,class:"identity-hint"},As={key:1,class:"identity-skeleton"},Rs={key:2,class:"identity-error"},Es={class:"probe-rows"},Bs={class:"probe-row",title:"A fact about our request, not the store"},Us={class:"probe-label"},js=["title"],Ds={key:0,class:"probe-mark is-muted"},Ls={class:"probe-row"},zs={key:0,class:"probe-source"},qs=["disabled"],Vs={class:"probe-rows"},Ns=["title"],Os={class:"probe-label"},Hs={class:"identity-verdict-desc"},Fs={key:0,class:"probe-summary"},Ws={class:"identity-verdict-row"},Gs={class:"identity-verdict-chips"},Js={key:0,class:"identity-posture-pill"},Qs=_e({__name:"AgentIdentityPanel",props:tt({endpoint:{}},{identity:{default:"unsigned"},identityModifiers:{}}),emits:tt(["probe-result"],["update:identity"]),setup(f,{emit:y}){const b=f,v=st(f,"identity"),c=y,C=_(()=>!!nt().props.features?.tapSurfaces),B=p(null);C.value&&Wt(()=>import("./tapTier-DkLoiIx7.js"),__vite__mapDeps([0,1,2,3,4])).then(q=>{B.value=q});const i=_(()=>[{items:[{value:"none",label:"Unsigned",description:"No request signatures â what anonymous traffic sees."},{value:"unsigned",label:"UCP Platform Identity",fact:"default",description:"Signs state-changing requests with the platform's UCP identity (sig1)."}]},...B.value?[{items:B.value.menuItems}]:[]]),z=["enforced","partial","not_enforced"],Y={presence:"unsigned request rejected",integrity:"tampered signature rejected",binding:"tampered context rejected",freshness:"expired signature rejected",replay:"replayed nonce rejected",key_resolution:"unknown key rejected"},w=p(null),W=p(!1),G=p(null),oe=p(!1),ae=_(()=>v.value.startsWith("tap-")),de=_(()=>ae.value&&!!b.endpoint),ce=_(()=>w.value?w.value.scheme.replace(/^tap-/,""):""),le=_(()=>{switch(w.value?.verdict){case"enforced":return"pass";case"partial":return"partial";case"inconclusive":return"unknown";default:return"neutral"}});function h(q){return Y[q]??q}function u(q){switch(q){case"directory":return"Agentic Directory (live)";case"cache":return"Agentic Directory (cached)";case"seed":return"pre-configured key";case"seed_fallback":return"directory unreachable â pre-configured key, not confirmed";default:return q}}async function M(q){if(!de.value)return;const m={scheme:v.value??"unsigned",depth:q,url:b.endpoint};W.value=!0,G.value=null;try{const x=await fetch("/api/partner/probe",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},credentials:"same-origin",body:JSON.stringify(m)});if(x.status===401){G.value="Sign in to test a connected store.";return}if(x.status===409){const ye=await x.json().catch(()=>null);G.value=ye?.message??"Trusted-agent signing is not configured in this environment.";return}if(x.status===422){G.value="This endpoint cannot be tested.";return}if(!x.ok){G.value="Check failed â please try again.";return}w.value=await x.json(),q==="full"&&(oe.value=!0)}catch(x){console.error("[AgentIdentity] enforcement check failed",x),G.value="Check failed â please try again.";return}finally{W.value=!1}w.value&&c("probe-result",{scheme:v.value??"unsigned",target:b.endpoint??"connected store",depth:q,report:w.value})}return je(v,()=>{w.value=null,oe.value=!1,G.value=null}),(q,m)=>(o(),a("div",_s,[t("div",ws,[m[3]||(m[3]=t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})],-1)),m[4]||(m[4]=R(" Agent Identity ",-1)),t("span",Cs,[C.value?(o(),K(me,{key:0,href:"/docs/test-your-agent/identity",label:"Identity in the harness â signing tiers, enforcement, sign-off"})):(o(),K(me,{key:1,href:"/docs/be-tested/agent-identity",label:"Agent Identity â how stores verify the platform's signature"}))])]),t("div",Ms,[t("div",Ss,[S(Se,{modelValue:v.value,"onUpdate:modelValue":m[0]||(m[0]=x=>v.value=x),groups:i.value,trigger:"field"},null,8,["modelValue","groups"])]),v.value==="none"?(o(),a("p",$s,[...m[5]||
2(m[5]=[R(" This session sends ",-1),t("b",null,"no request signatures",-1),R(" â what a target sees from anonymous traffic. Pick an identity to sign. ",-1)])])):ae.value?(o(),a(E,{key:2},[t("p",Ts,[B.value?(o(),K(Gt(B.value.badge),{key:0})):r("",!0),m[9]||(m[9]=R(" Signing this session's requests as ",-1)),t("b",null,l(ce.value||v.value),1),m[10]||(m[10]=R(". ",-1))]),v.value==="tap-payer-auth"&&B.value?(o(),a("p",Ps,l(B.value.payerCaveat),1)):r("",!0),b.endpoint?(o(),a(E,{key:2},[!w.value&&!W.value?(o(),a("button",{key:0,class:"probe-run-btn",onClick:m[1]||(m[1]=x=>M("handshake"))}," Test store enforcement ⸠")):r("",!0),W.value?(o(),a("div",As,[(o(),a(E,null,X(3,x=>t("div",{class:"skeleton-row",key:x})),64))])):G.value?(o(),a("p",Rs,l(G.value),1)):w.value?(o(),a(E,{key:3},[t("ul",Es,[t("li",Bs,[t("span",Us,"signature attached ("+l(ce.value)+")",1),m[11]||(m[11]=t("span",{class:"probe-mark is-neutral"},"·",-1))]),t("li",{class:"probe-row",title:w.value.handshake.key_recognised===null?"Run negative probes to determine":""},[m[12]||(m[12]=t("span",{class:"probe-label"},"key ID recognised",-1)),w.value.handshake.key_recognised===null?(o(),a("span",Ds,"â")):(o(),a("span",{key:1,class:j(["probe-mark",w.value.handshake.key_recognised?"is-ok":"is-bad"])},l(w.value.handshake.key_recognised?"â":"â"),3))],8,js),t("li",Ls,[m[13]||(m[13]=t("span",{class:"probe-label"},"signed request accepted",-1)),t("span",{class:j(["probe-mark",w.value.handshake.accepted?"is-ok":"is-bad"])},l(w.value.handshake.accepted?"â":"â"),3)]),w.value.handshake.key_source?(o(),a("li",zs," key resolved via "+l(u(w.value.handshake.key_source)),1)):r("",!0)]),oe.value?(o(),a(E,{key:1},[m[15]||(m[15]=t("div",{class:"probe-divider"},"negative probes",-1)),t("ul",Vs,[(o(!0),a(E,null,X(w.value.probes,x=>(o(),a("li",{key:x.dimension,class:"probe-row",title:x.note},[t("span",Os,l(h(x.dimension)),1),t("span",{class:j(["probe-mark",x.enforced===null?"is-unknown":x.enforced?"is-ok":"is-bad"])},l(x.enforced===null?"â":x.enforced?"â":"â"),3)],8,Ns))),128))]),t("p",Hs,l(w.value.verdict_description),1),w.value.summary?(o(),a("p",Fs,l(w.value.summary),1)):r("",!0),t("div",Ws,[m[14]||(m[14]=t("span",{class:"ucp-label"},"Verdict",-1)),t("span",Gs,[w.value.missing_signature_policy&&z.includes(w.value.verdict)?(o(),a("span",Js,l(w.value.missing_signature_policy),1)):r("",!0),S(he,{state:le.value,value:w.value.verdict_label,dot:!1},null,8,["state","value"])])])],64)):(o(),a("button",{key:0,class:"probe-run-btn",disabled:W.value,onClick:m[2]||(m[2]=x=>M("full"))}," Run negative probes ⸠",8,qs))],64)):r("",!0)],64)):(o(),a("p",Is," Connect a store to test whether it enforces this identity. "))],64)):(o(),a("p",xs,[m[6]||(m[6]=R(" Signing with the platform's ",-1)),m[7]||(m[7]=t("b",null,"UCP identity",-1)),m[8]||(m[8]=R(" (state-changing requests, RFC 9421). ",-1)),B.value?(o(),a(E,{key:0},[R(l(B.value.menuHint),1)],64)):r("",!0)]))])]))}}),Xs=De(Qs,[["__scopeId","data-v-4fb2a6d0"]]),Ys={class:"agent-timeline"},Zs={key:0,class:"empty-chat"},Ks={key:0,class:"empty-chat-hint"},en={key:0,class:"message-row message-user"},tn={class:"message-bubble bubble-user"},sn={class:"message-text"},nn={key:1,class:"tool-group"},on={class:"tool-group-items"},an={class:"tool-call-summary"},ln={class:"tool-call-icon"},rn={key:0,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},un={key:1,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},dn={key:2,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},cn={key:3,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},pn={class:"tool-call-name"},vn={key:0,class:"tool-call-time"},hn=["title"],mn={class:"tool-call-detail"},gn={class:"tool-call-detail-label"},fn={class:"tool-call-kind"},yn={class:"tool-call-method"},kn={class:"tool-call-url"},bn={class:"tool-call-code"},_n={class:"tool-call-code"},wn={class:"tool-call-code is-error"},Cn={class:"tool-call-code"},Mn={key:1,class:"tool-call-detail-heading"},Sn={key:2,class:"tool-call-code"},$n={key:3,class:"tool-call-code is-error"},xn={key:2,class:"product-cards-row"},Tn={class:"product-cards-scroll"},Pn=["href"],In={class:"product-card-image"},An=["src","alt"],Rn={key:1,class:"product-card-placeholder"},En={class:"product-card-info"},Bn={class:"product-card-title"},Un={key:0,class:"product-card-subtitle"},jn={key:1,class:"product-card-price"},Dn={key:0,class:"product-card-link-icon"},Ln={key:3,class:"reasoning-row"},zn={class:"reasoning-block"},qn={class:"reasoning-content"},Vn={key:4,class:"message-row message-assistant"},Nn={class:"message-bubble bubble-assistant"}
2,On=["innerHTML"],Hn={key:5,class:"timeline-error"},Fn={class:"timeline-error-content"},Wn={class:"timeline-error-text"},Gn={key:6,class:"embedded-checkout-row"},Jn={key:1,class:"message-row message-assistant"},Qn=_e({__name:"AgentTimeline",props:{timeline:{},loading:{type:Boolean},emptyMessage:{},emptyHint:{},isMultiModel:{type:Boolean},domain:{}},setup(f){function y(v){return v.includes("search")?"search":v.includes("detail")||v.includes("product")?"detail":v.includes("cart")||v.includes("update_cart")?"cart":"tool"}function b(v){if(v==null)return"";if(typeof v=="string")try{return JSON.stringify(JSON.parse(v),null,2)}catch{return v}return JSON.stringify(v,null,2)}return(v,c)=>(o(),a("div",Ys,[f.timeline.length===0&&!f.loading?(o(),a("div",Zs,[c[0]||(c[0]=t("div",{class:"empty-chat-icon"},[t("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})])],-1)),t("p",null,l(f.emptyMessage||"Send a message to start shopping..."),1),f.emptyHint?(o(),a("span",Ks,l(f.emptyHint),1)):r("",!0)])):r("",!0),(o(!0),a(E,null,X(f.timeline,(C,B)=>(o(),a(E,{key:B},[C.type==="user"?(o(),a("div",en,[t("div",tn,[t("div",sn,l(C.content),1)])])):C.type==="tool-group"?(o(),a("div",nn,[c[10]||(c[10]=t("div",{class:"tool-group-line"},null,-1)),t("div",on,[(o(!0),a(E,null,X(C.toolCalls,(i,z)=>(o(),a("details",{key:z,class:j(["tool-call-card","tool-type-"+y(i.name)])},[t("summary",an,[t("div",ln,[y(i.name)==="search"?(o(),a("svg",rn,[...c[1]||(c[1]=[t("circle",{cx:"11",cy:"11",r:"8"},null,-1),t("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},null,-1)])])):y(i.name)==="detail"?(o(),a("svg",un,[...c[2]||(c[2]=[t("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"},null,-1),t("polyline",{points:"14 2 14 8 20 8"},null,-1)])])):y(i.name)==="cart"?(o(),a("svg",dn,[...c[3]||(c[3]=[t("circle",{cx:"9",cy:"21",r:"1"},null,-1),t("circle",{cx:"20",cy:"21",r:"1"},null,-1),t("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"},null,-1)])])):(o(),a("svg",cn,[...c[4]||(c[4]=[t("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"},null,-1)])]))]),t("span",pn,l(i.name),1),i.duration_ms?(o(),a("span",vn,l(i.duration_ms)+"ms",1)):r("",!0),i.error?(o(),a("span",{key:1,class:"tool-call-error-badge",title:i.error},"failed",8,hn)):r("",!0),c[5]||(c[5]=t("svg",{class:"tool-call-chevron",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[t("polyline",{points:"6 9 12 15 18 9"})],-1))]),t("div",mn,[i.transport?(o(),a(E,{key:0},[t("div",gn,[t("span",fn,l(i.transport.kind),1),t("span",yn,l(i.transport.method),1),t("span",kn,l(i.transport.url),1),i.transport.status?(o(),a("span",{key:0,class:j(["tool-call-status",{"is-error":i.transport.status>=400}])},l(i.transport.status),3)):r("",!0)]),i.transport.requestBody!=null?(o(),a(E,{key:0},[c[6]||(c[6]=t("div",{class:"tool-call-detail-heading"},"Request body",-1)),t("pre",bn,l(b(i.transport.requestBody)),1)],64)):r("",!0),i.transport.responseBody!=null?(o(),a(E,{key:1},[c[7]||(c[7]=t("div",{class:"tool-call-detail-heading"},"Response",-1)),t("pre",_n,l(b(i.transport.responseBody)),1)],64)):r("",!0),i.transport.error?(o(),a(E,{key:2},[c[8]||(c[8]=t("div",{class:"tool-call-detail-heading"},"Error",-1)),t("pre",wn,l(i.transport.error),1)],64)):r("",!0),i.error||i.transport.error?(o(),K(Xe,{key:3,context:{surface:"agent",domain:f.domain||null,tool:i.name,transport:["mcp","rest"].includes(i.transport.kind)?i.transport.kind:null,error_excerpt:i.transport.error||i.error}},null,8,["context"])):r("",!0)],64)):(o(),a(E,{key:1},[i.arguments?(o(),a(E,{key:0},[c[9]||(c[9]=t("div",{class:"tool-call-detail-heading"},"Arguments",-1)),t("pre",Cn,l(b(i.arguments)),1)],64)):r("",!0),i.result?(o(),a("div",Mn,"Result")):r("",!0),i.result?(o(),a("pre",Sn,l(b(i.result)),1)):r("",!0),i.error&&!i.result?(o(),a("pre",$n,l(i.error),1)):r("",!0),i.error?(o(),K(Xe,{key:4,context:{surface:"agent",domain:f.domain||null,tool:i.name,error_excerpt:i.error}},null,8,["context"])):r("",!0)],64))])],2))),128))])])):C.type==="products"?(o(),a("div",xn,[t("div",Tn,[(o(!0),a(E,null,X(C.products,i=>(o(),a(E,{key:i.id},[i.flight?(o(),K(rs,{key:0,flight:i.flight,price:i.price},null,8,["flight","price"])):(o(),a("a",{key:1,href:i.url?d(us)(i.url):void 0,target:"_blank",rel:"noopener",class:j(["product-card",{"product-card-linked":i.url}])},[t("div",In,[i.imageUrl?(o(),a("img",{key:0,src:i.imageUrl,alt:i.title,loading:"lazy"},null,8,An)):(o(),a("div",Rn,[...c[11]||(c[11]=[t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[t("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),t("circle",{cx:"8.5",cy:"8.5",r:"1.5"}
2),t("path",{d:"m21 15-5-5L5 21"})],-1)])]))]),t("div",En,[t("span",Bn,l(i.title),1),i.subtitle?(o(),a("span",Un,l(i.subtitle),1)):r("",!0),i.price?(o(),a("span",jn,l(i.price),1)):r("",!0)]),i.url?(o(),a("div",Dn,[...c[12]||(c[12]=[t("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),t("polyline",{points:"15 3 21 3 21 9"}),t("line",{x1:"10",y1:"14",x2:"21",y2:"3"})],-1)])])):r("",!0)],10,Pn))],64))),128))])])):C.type==="reasoning"?(o(),a("div",Ln,[t("details",zn,[c[13]||(c[13]=Me('<summary class="reasoning-summary" data-v-92d7f79b><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-92d7f79b><path d="M12 2a7 7 0 0 1 7 7c0 2.38-1.19 4.47-3 5.74V17a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1v-2.26C6.19 13.47 5 11.38 5 9a7 7 0 0 1 7-7z" data-v-92d7f79b></path><path d="M9 21h6" data-v-92d7f79b></path><path d="M10 21v1h4v-1" data-v-92d7f79b></path></svg><span data-v-92d7f79b>Reasoning</span></summary>',1)),t("div",qn,l(C.content),1)])])):C.type==="assistant"?(o(),a("div",Vn,[t("div",Nn,[t("div",{class:"message-text",innerHTML:d(ds)(C.content||"")},null,8,On)])])):C.type==="error"?(o(),a("div",Hn,[c[14]||(c[14]=Me('<div class="timeline-error-icon" data-v-92d7f79b><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-92d7f79b><circle cx="12" cy="12" r="10" data-v-92d7f79b></circle><path d="M12 8v4" data-v-92d7f79b></path><path d="M12 16h.01" data-v-92d7f79b></path></svg></div>',1)),t("div",Fn,[t("span",Wn,l(C.content),1),S(Xe,{context:{surface:"agent",domain:f.domain||null,error_excerpt:C.content||null}},null,8,["context"])])])):C.type==="embedded-checkout"&&C.escalation?(o(),a("div",Gn,[S(ps,{escalation:C.escalation,"is-multi-model":f.isMultiModel},null,8,["escalation","is-multi-model"])])):r("",!0)],64))),128)),f.loading?(o(),a("div",Jn,[...c[15]||(c[15]=[Me('<div class="loading-bubble" data-v-92d7f79b><div class="loading-dots" data-v-92d7f79b><span class="dot" data-v-92d7f79b></span><span class="dot" data-v-92d7f79b></span><span class="dot" data-v-92d7f79b></span></div><span class="loading-text" data-v-92d7f79b>Thinking...</span></div>',1)])])):r("",!0)]))}}),wt=De(Qn,[["__scopeId","data-v-92d7f79b"]]),Xn=_e({__name:"ConnectionPicker",props:tt({mcp:{type:Boolean},rest:{type:Boolean},webmcp:{type:Boolean}},{connection:{default:"mcp"},connectionModifiers:{}}),emits:["update:connection"],setup(f){const y=st(f,"connection"),b=f,v=_(()=>[{label:"UCP",items:[{value:"mcp",label:"UCP · MCP",description:b.mcp?"The store's UCP endpoint over MCP. A conversation: ask follow-ups.":"This store has no UCP MCP endpoint.",disabled:!b.mcp},{value:"rest",label:"UCP · REST",description:b.rest?"The store's UCP endpoint over REST. A conversation: ask follow-ups.":"This store declares no UCP REST endpoint.",disabled:!b.rest}]},...b.webmcp?[{label:"Store page",items:[{value:"webmcp",label:"WebMCP",description:"The tools the store's own page registers, run in a browser on our side. One task per run; it stops at the store's checkout and never pays."}]}]:[]]);return(c,C)=>(o(),K(Se,{modelValue:y.value,"onUpdate:modelValue":C[0]||(C[0]=B=>y.value=B),groups:v.value,trigger:"pill",align:"right"},null,8,["modelValue","groups"]))}}),Yn=_e({__name:"RuntimePicker",props:{runtime:{default:"cloud"},runtimeModifiers:{}},emits:["update:runtime"],setup(f){const y=st(f,"runtime"),b=!!nt().props.desktop,v=p(null),c=p([]);async function C(){try{const i=await fetch("/runtime/runners",{headers:{Accept:"application/json"}});if(i.ok){const z=await i.json();v.value=z.online,c.value=z.runners,z.online===0&&y.value==="local"&&(y.value="cloud")}}catch{v.value=null}}const B=_(()=>[{items:[{value:"cloud",label:"Cloud",description:"Our infrastructure â the default."},{value:"local",label:"Local",fact:v.value?`${c.value[0]?.name??"runner"} online`:"no runner online",description:v.value?"Merchant requests execute on your machine â localhost works, no tunnel.":"Runs merchant requests on your own machine. No runner is connected to this workspace.",disabled:!v.value}]}]);return St(async()=>{await C(),b&&v.value&&y.value==="cloud"&&(y.value="local")}),(i,z)=>(o(),K(Se,{modelValue:y.value,"onUpdate:modelValue":z[0]||(z[0]=Y=>y.value=Y),groups:B.value,trigger:"pill",align:"right",onOpen:C},null,8,["modelValue","groups"]))}});function Ct(f,y){const b=f.toLowerCase();return y==="openrouter_error"?b.includes("user not found")||b.includes("unauthorized")||b.includes("authentication")?"The AI provider encountered a temporary authentication issue. This is not a problem with the playground â please try again in a moment.":"The AI provider encountered a temporary issue. This is not a problem with the playground â please try again in a moment.":b.includes("connection timeout")||b.includes("timed out")?"The AI service is taking too long to respond. Please try again.":b.includes("rate limit")?"Too many requests. Please wait a moment and try again.":b.includes("unknown model")?"The selected model is not available. Please choose a different model.":b.includes("no response from model")?"The AI model could not generate a response. Please try again.":f}function Mt(){const f=p([]),y=p([]),b=p([]),v=p(!1),c=p(null),C=p(null),B=p([]),i=p({total:0,prompt:0,completion:0}),z=p(null),Y=p(0),w=p(0),W=p(null),G=p("ucp"),oe=p(null);let ae=[],de=[],ce="",le="",h=null,u=!1,M=null,q=null;function m(T){q=T}function x(T){ae=T}function ye(T,pe,J,ie){ce=T,le=pe,h=J??null,M=ie??null}async function se(T,pe,J,ie,Q="ucp"){if(!ce||!le){c.value="Not connected to a store";return}v.value=!0,c.value=null,y.value.push({role:"user",content:pe}),f.value.push({type:"user",content:pe});try{const U=await fetch("/api/agent/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:T,endpoint:ce,domain:le,message:pe,sessionId:C.value,history:de,mcpTools:ae,restEndpoint:h,useRestTrans
2port:u,paymentHandlers:M,negotiation:q,identity:J,runtime:ie,door:Q})});if(!U.ok){const $=await U.json().catch(()=>({}));c.value=$.message||`Request failed with status ${U.status}`;return}const k=await U.json();!C.value&&k.sessionId&&kt("agent-session-start",{domain:le,model:T,runtime:ie??"cloud"}),kt("agent-turn",{domain:le,model:T,outcome:k.outcome??"unknown",end_reason:k.endReason??"unknown"}),G.value=k.door==="webmcp"?"webmcp":"ucp",oe.value=k.shots??null,C.value=k.sessionId,yt.value=k.sessionId??null,B.value=k.stepsCompleted||[],i.value=k.tokens||{total:0,prompt:0,completion:0},z.value=k.outcome,Y.value=(Y.value||0)+(k.turnCount||0),w.value=k.completionRate||0,k.useRestTransport&&(u=!0),k.toolCalls&&b.value.push(...k.toolCalls);const Z=k.toolCalls||[],$e=k.messages||[];if(Z.length>0){f.value.push({type:"tool-group",toolCalls:Z});const $=cs(Z);$.length>0&&f.value.push({type:"products",products:$})}k.escalation&&k.door!=="webmcp"&&(W.value=k.escalation,f.value.push({id:`ecp-${Date.now()}`,type:"embedded-checkout",escalation:k.escalation}));const N=$e.filter($=>$.role==="assistant"&&$.content);if(N.length>0){const $=N[N.length-1];y.value.push({role:"assistant",content:$.content});const F=$.reasoning_content??$.reasoning;F&&f.value.push({type:"reasoning",content:F}),f.value.push({type:"assistant",content:$.content??void 0})}de=$e.filter($=>$.role!=="system"),k.error&&(c.value=Ct(k.error,k.errorType),N.length===0&&f.value.push({type:"error",content:c.value}))}catch(U){c.value=Ct(U instanceof Error?U.message:"Unknown error")}finally{v.value=!1}}function H(){f.value=[],y.value=[],b.value=[],v.value=!1,c.value=null,C.value=null,yt.value=null,B.value=[],i.value={total:0,prompt:0,completion:0},z.value=null,Y.value=0,w.value=0,W.value=null,G.value="ucp",oe.value=null,de=[]}return{timeline:f,messages:y,toolCalls:b,loading:v,error:c,sessionId:C,stepsCompleted:B,tokens:i,outcome:z,turnCount:Y,completionRate:w,escalation:W,door:G,doorShots:oe,setMcpTools:x,setNegotiation:m,setConnectionInfo:ye,setUseRestTransport:T=>{u=T},sendMessage:se,reset:H}}const Zn={class:"app-header"},Kn={class:"header-right"},eo={class:"app-layout"},to={class:"app-main"},so={key:0,class:"connect-section"},no={class:"connect-wrap"},oo={class:"connect-card"},ao={class:"connect-fields"},lo={class:"connect-field"},io={class:"connect-field connect-field-start"},ro={class:"scope-seg"},uo=["disabled"],co={key:1,class:"router-block"},po=["disabled"],vo={key:3,class:"error-banner"},ho={key:0,class:"try-block"},mo={class:"try-pills"},go=["onClick"],fo={key:0,class:"try-dot"},yo={key:1,class:"try-tag"},ko={key:1,class:"router-note"},bo={key:1,class:"chat-layout"},_o={key:0,class:"chat-panel"},wo={class:"chat-header"},Co={class:"chat-header-left"},Mo={class:"chat-domain"},So={class:"chat-model-tag"},$o={key:0,class:"chat-door-tag",title:"The agent uses the tools the store's page registers (WebMCP), in a browser on our side"},xo={class:"chat-header-right"},To={key:0,class:"identity-chip"},Po={key:1,class:"tools-count"},Io={key:0,class:"door-shots"},Ao={key:0,class:"door-shot"},Ro=["href"],Eo=["src"],Bo={key:1,class:"door-shot"},Uo=["href"],jo=["src"],Do={class:"chat-input-section"},Lo={key:0,class:"door-waiting"},zo={key:1,class:"door-run-done"},qo={class:"search-context-row"},Vo={class:"input-group"},No=["placeholder","disabled"],Oo=["disabled"],Ho={key:3,class:"chat-error"},Fo={key:4,class:"sign-in-nudge"},Wo={key:1,class:"multi-model-panel"},Go={class:"multi-model-header"},Jo={class:"multi-model-header-left"},Qo={class:"chat-domain"},Xo={class:"tools-count"},Yo={class:"multi-model-header-right"},Zo=["value"],Ko=["disabled"],ea={class:"multi-model-columns"},ta={class:"model-column-header"},sa={class:"model-column-info"},na={class:"model-column-name"},oa={class:"model-column-provider"},aa=["disabled","onClick"],la={class:"model-column-timeline"},ia={key:0,class:"model-column-footer"},ra={key:1,class:"model-column-duration"},ua={key:0,class:"multi-model-summary"},da={class:"summary-items"},ca={class:"summary-model"},pa={key:1,class:"summary-duration"},va={class:"chat-input-section"},ha={class:"search-context-row"},ma={class:"input-group"},ga=["disabled"],fa=["disabled"],ya={class:"sidebar-section endpoint-status-card menu-host"},ka={class:"endpoint-status-header"},ba={class:"endpoint-status-left"},_a={class:"endpoint-status-title"},wa={key:0,class:"endpoint-status-url"},Ca={class:"endpoint-status-detail"},Ma={key:0,class:"endpoint-status-meta"},Sa={key:1,class:"endpoint-connection-row"},$a={key:1,class:"door-fixed"},xa={key:0,class:"sidebar-section save-target-card"},Ta=["disabled"],Pa={key:1,class:"sidebar-section runtime-section"},Ia={class:"section-header",style:{cursor:"default"}},Aa={class:"header-actions"},Ra={key:2,class:"sidebar-section identity-section"},Ea={class:"identity-connected"},Ba={class:"identity-details"},Ua={key:0,class:"identity-name"},ja={key:1,class:"identity-name"},Da={key:2,class:"identity-email"},La={key:3,class:"sidebar-section identity-section"},za=["disabled"],qa={key:0,width:"14",height:"14",class:"spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Va={key:1,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Na={key:0,class:"identity-error"},Oa={key:4,class:"sidebar-section identity-section"},Ha={class:"identity-error"},Fa={key:5,class:"sidebar-section buyer-context-section"},Wa={class:"section-header",style:{cursor:"default"}},Ga={class:"header-actions"},Ja=["open"],Qa={class:"section-header"},Xa={class:"header-actions"},Ya=["disabled"],Za={class:"section-body"},Ka={key:7,class:"sidebar-section"},el={class:"section-header"},tl={class:"header-actions"},sl={class:"section-body"},nl=["open"],ol={class:"section-header"},al={class:"header-actions"},ll={class:"section-body"},il={class:"schema-tools-list"},rl=["open"],ul={class:"schema-tool-summary"},dl={class:"schema-tool-name"},cl={class:"schema-bar-track"},pl={key:0,class:"schema-issues"},vl={key:0,class:"schema-all-clear"},hl={class:"sidebar-section"},ml={class:"section-header"},gl={class:"header-actions"},fl={class:"section-body"},yl={class:"steps-list"},kl={class:"sidebar-section"},bl={class:"section-header"},_l={class:"header-actions"},wl={class:"section-body"},Cl={class:"stats-list"},Ml={class:"stat-row stat-row-meter"},Sl={class:"stat-meter-head"},$l={class:"stat-value"},xl=["title"],Tl={key:1,class:"stat-caption"},Pl={class:"stat-row"},Il={class:"stat-value"},Al={key:0,class:"stat-row"},Rl={key:9,class:"sidebar-section menu-host"},El={class:"section-header",style:{cursor:"default"}},Bl={class:"header-actions"},Ul={class:"section-body"},jl={key:0,class:"debug-console"},Dl={class:"debug-header"},Ll={class:"debug-tabs"},zl={key:0,class:"tab-count"},ql={key:0,class:"tab-count"},Vl={class:"debug-body"},Nl={key:0,class:"debug-state"},Ol={key:1,class:"debug-requests"},Hl={key:0,class:"debug-empty"},Fl={class:"log-header"},Wl={class:"log-label"},Gl={key:0,class:"log-duration"},Jl={class:"log-time"},Ql={key:0,class:"log-data"},Xl=_e({__name:"Agent",props:{models:{},domain:{},routerEndpoint:{},maxRunTokens:{},webmcpAgentDoor:{type:Boolean}},setup(f){const y=f,b=nt(),v=_(()=>b.props.auth?.user);_t();const c=as();function C(s){window.open(s,"_blank","noopener")}const B=p("cloud"),i=p("mcp"),z=_(()=>i.value==="webmcp"?"webmcp":"ucp"),Y=p(!1),w=_(()=>!!y.webmcpAgentDoor&&!!v.value&&!F.value),W=p(null);async function G(){W.value=null;try{const s=await fetch("/api/agent/browsers",{headers:{Accept:"application/json"}});if(s.ok){const{max:e,in_use:n}=await s.json();n>=e&&(W.value={max:e})}}catch{}}const oe=_(()=>u.door.value==="webmcp"&&!!u.sessionId.value&&!u.loading.value),ae=p(!1),de=_(()=>T.value.trim().length>
22),ce=[{domain:"flower-shop.local",local:!0,tag:"test store"},{domain:"hotel.local",local:!0,tag:"test store"},{domain:"everlane.com"},{domain:"pier1.com"},{domain:"monos.com"},{domain:"allbirds.com"},{domain:"forever21.com"}],le=_(()=>!!b.props.features?.tapSurfaces),h=es(),u=Mt(),M=Kt(),q=p(!1),m=_(()=>y.maxRunTokens??0),x=_(()=>{const s=m.value;return s?Math.min(100,Math.round(u.tokens.value.total/s*100)):0}),ye=_(()=>{const s=m.value;return s?s>=1e6?`${(s/1e6).toLocaleString(void 0,{maximumFractionDigits:1})}M`:`${Math.round(s/1e3)}K`:""}),se=p(null),H=p(null),T=p(y.domain||""),pe=Object.keys(y.models),J=p(pe[Math.floor(Math.random()*pe.length)]||""),ie=p("unsigned"),Q=p(""),U=p(!1),k=p(null),Z=p(null),$e=["not_detected","invalid_manifest","invalid","blocked"],N=p(!1),$=p(null),F=p(!1),re=p(!0),xe=p(!1),Te=p(null),ge=p(!1),O=p([]),V={},ue=p({}),we=p(""),Pe=_(()=>O.value.some(s=>V[s]?.loading.value)),$t=_(()=>O.value.length>0&&O.value.every(s=>{const e=V[s];return e&&!e.loading.value&&(e.outcome.value||e.error.value)})),ot=_(()=>ct.value.filter(s=>!O.value.includes(s.key))),xt=_(()=>se.value?.ucp?.auth??null);function Tt(){const s=se.value?.ucp?.capabilities;if(!s)return null;if(Array.isArray(s))return s.find(e=>e.name==="dev.ucp.common.identity_linking")??null;if(typeof s=="object"){const e=s["dev.ucp.common.identity_linking"];if(e)return Array.isArray(e)?e[0]:e}return null}const Ce=p(null),Le=p(!1),Ie=p(null),Pt=_(()=>{const s=h.session.value?.endpoint;if(s)try{return new URL(s).origin}catch{}const e=T.value.trim().replace(/^https?:\/\//,"").replace(/\/$/,"");return e?`https://${e}`:null}),at=_(()=>{const s=Tt();return s?os(s,Pt.value).find(e=>e.registration_endpoint||e.authorization_endpoint||e.issuer)??null:null}),ze=_(()=>{const s=at.value;if(!s)return null;const e=Ce.value;return e?{...s,authorization_endpoint:s.authorization_endpoint??e.authorization_endpoint,token_endpoint:s.token_endpoint??e.token_endpoint,registration_endpoint:s.registration_endpoint??e.registration_endpoint,revocation_endpoint:s.revocation_endpoint??e.revocation_endpoint,code_challenge_methods:s.code_challenge_methods??(e.code_challenge_methods_supported?e.code_challenge_methods_supported:void 0),scopes:s.scopes??e.scopes_supported,profile_endpoint:s.profile_endpoint??e.userinfo_endpoint}:s});je(at,async s=>{if(Ce.value=null,Ie.value=null,!(!s?.issuer||s.authorization_endpoint)){Le.value=!0;try{const e=document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")??"";for(let n=0;n<2;n++){try{const g=await fetch("/api/ucp/oidc-discovery",{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":e},body:JSON.stringify({issuer:s.issuer,resource:s.discover==="resource"})});if(g.ok){Ce.value=await g.json();break}if(g.status===422){const I=await g.json().catch(()=>({}));Ie.value=I.error??"Identity discovery failed.";break}}catch{}n===0&&await new Promise(g=>setTimeout(g,1500))}}finally{Le.value=!1}}},{immediate:!0});const lt=_(()=>{const s=ze.value;if(!s?.registration_endpoint)return null;const e=s.registration_endpoint;return e.startsWith("http://")||e.startsWith("https://")?e:typeof window>"u"?null:["localhost","127.0.0.1"].includes(window.location.hostname)?new URL(e,window.location.origin).href:null});function it(s){return s?s.startsWith("http://")||s.startsWith("https://")?s:typeof window>"u"?null:new URL(s,window.location.origin).href:null}async function It(){const s=h.session.value?.endpoint??ne.value.url??null;if(!s){M.oauthError.value="No connected endpoint yet â connect a store first.";return}const e=ze.value,n=xt.value?.oauth2,g=it(e?.authorization_endpoint??n?.authorization_url),I=it(e?.token_endpoint??n?.token_url);if(!g||!I){M.oauthError.value=Le.value?"Still discovering the identity provider â try again in a moment.":"The identity provider did not advertise authorization endpoints.";return}const A=e?.scopes?.join(" ")??n?.scopes?.map(ve=>ve.name).join(" ")??"",Be=e?.code_challenge_methods?.includes("S256")??n?.pkce!==!1,be=lt.value;be?await M.registerAndAuthorize({authorization_url:g,token_url:I,endpoint:s,scopes:A,pkce:Be,registration_url:be,token_endpoint_auth_methods:Ce.value?.token_endpoint_auth_methods_supported}):await M.startAuthorization({authorization_url:g,token_url:I,client_id:"",endpoint:s,scopes:A,pkce:Be,issuer:Ce.value?.issuer})}je(()=>M.tokenStatus.value.authenticated,async(s,e)=>{if(!(!s||e||!h.session.value?.endpoint)){if(!M.linkedIdentity.value){const n=se.value;M.resolveIdentity(h.session.value.endpoint,n||void 0).catch(()=>{})}try{const n=await h.discoverTools();n.length>
20&&(u.setMcpTools(n),Object.values(V).forEach(g=>g.setMcpTools(n)))}catch{}}});function At(){ge.value=!0,re.value=!1,rt(J.value)}function rt(s){if(O.value.length>=5||O.value.includes(s))return;const e=Mt();e.setMcpTools(h.tools.value),e.setConnectionInfo(h.session.value.endpoint,T.value,$.value,se.value?.ucp?.payment_handlers),V[s]=e,O.value.push(s),we.value=""}function Rt(s){if(V[s]?.loading.value)return;const e=O.value.indexOf(s);e!==-1&&O.value.splice(e,1),delete V[s],delete ue.value[s],O.value.length===0&&ut()}function ut(){ge.value=!1,O.value=[],Object.keys(V).forEach(s=>delete V[s]),ue.value={},we.value=""}async function Et(){const s=Q.value.trim();if(!s||Pe.value)return;Q.value="",P({type:"request",label:"Multi-Model Chat",data:{models:O.value,message:s}});const e=O.value.map(async n=>{const g=V[n],I=performance.now();await g.sendMessage(n,s,ie.value,B.value),c.refresh();const A=Math.round(performance.now()-I);ue.value[n]=(ue.value[n]||0)+A,P({type:g.error.value?"error":"response",label:y.models[n]?.display_name??n,data:{outcome:g.outcome.value,turns:g.turnCount.value,tokens:g.tokens.value,error:g.error.value},durationMs:A})});await Promise.allSettled(e)}const Ae=p(!1),ee=p("requests"),ke=p([]),qe=_(()=>ke.value.filter(s=>s.channel==="identity")),Ve=_(()=>ke.value.filter(s=>s.channel!=="identity")),dt=_(()=>ee.value==="identity"?qe.value:Ve.value);let Bt=0;function P(s){ke.value.unshift({...s,id:++Bt,timestamp:new Date().toISOString()}),ke.value.length>100&&ke.value.pop()}c.setDebugLogger(s=>P({type:s.type,label:`${s.method} ${s.url}`,data:{...typeof s.data=="object"&&s.data?s.data:{},status:s.status},durationMs:s.durationMs})),_t().setDebugLogger(s=>P({type:s.type,label:`${s.method} ${s.url}`,data:{...typeof s.data=="object"&&s.data?s.data:{},status:s.status},durationMs:s.durationMs}));function Ut(s){const e=s.report;if(s.depth==="handshake"){P({channel:"identity",type:e.handshake.accepted?"response":"error",label:`TAP handshake â ${s.scheme} â ${s.target}`,data:{"signature attached":e.handshake.signature_attached,"key ID recognised":e.handshake.key_recognised,"signed request accepted":e.handshake.accepted,"key source":e.handshake.key_source??null,"Signature-Input":e.handshake.signature_input}});return}P({channel:"identity",type:e.verdict==="enforced"?"response":e.verdict==="inconclusive"?"info":"error",label:`TAP conformance â ${s.scheme} â ${s.target}: ${e.verdict_label}`,data:{verdict:e.verdict_label,"Signature-Input":e.handshake.signature_input,negativeProbes:Object.fromEntries(e.probes.map(n=>[n.label,n.enforced===null?"not assessed":n.enforced?"rejected":"accepted"])),summary:e.summary}})}function jt(s){for(const e of s){const n=e.transport?.signature;n&&P({channel:"identity",type:e.error?"error":"response",label:`TAP signed â ${n.tag} â ${e.name}`,data:{profile:n.profile,tag:n.tag,"key ID":n.keyid,algorithm:n.alg,covered:n.covered.join(" "),"Signature-Input":n.signatureInput,target:e.transport?.url,...e.error?{error:e.error}:{}}})}}function Dt(){ke.value=[]}const Lt=_(()=>({negotiation:H.value?{variant:H.value.variant,versionState:H.value.version_state,summary:H.value.summary,excluded:H.value.excluded}:null,heldStates:c.rows.value.map(s=>({merchant:s.merchant_domain,kind:s.kind,stage:s.stage,remote_id:s.remote_id,expires_at:s.expires_at})),connected:N.value,domain:T.value,model:J.value,sessionId:u.sessionId.value,endpoint:h.session.value?.endpoint??null,toolCount:h.tools.value.length,tools:h.tools.value.map(s=>s.name),stepsCompleted:u.stepsCompleted.value,outcome:u.outcome.value,tokens:u.tokens.value,turnCount:u.turnCount.value,timelineEntries:u.timeline.value.length})),ct=_(()=>Object.entries(y.models).map(([s,e])=>({key:s,...e}))),pt=_(()=>{const s=new Map;for(const e of ct.value)s.has(e.provider)||s.set(e.provider,[]),s.get(e.provider).push({value:e.key,label:e.display_name});return[...s.entries()].map(([e,n])=>({label:e,items:n}))}),te=p("idle");async function zt(){if(!(te.value==="saving"||!N.value)){te.value="saving";try{const s=await fetch("/targets/save",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.content??""},body:JSON.stringify({domain:T.value.trim(),mcp_endpoint:h.session.value?.endpoint??null,rest_endpoint:$.value??null})});s.status===201?te.value="saved":s.status===409?te.value="exists":te.value="idle"}catch{te.value="idle"}}}const ne=_(()=>{if(i.value==="webmcp"&&N.value)return{title:"Store page · WebMCP",url:`https://${T.value.trim().replace(/^https?:\/\//,"").replace(/\/$/,"")}
2`,label:"Ready",detail:"The agent opens this page in a browser on our side and uses the tools it registers.",badge:"endpoint-badge-active",lastPing:null};const s=h.session.value?.endpoint;if(s){const e=h.session.value?.serverInfo;return{title:"MCP Endpoint",url:s,label:"Active",detail:e?`Responding as ${e.name} ${e.version}`:"Endpoint responded successfully.",badge:"endpoint-badge-active",lastPing:h.session.value?.connectedAt||null}}return N.value&&$.value?{title:"REST Endpoint",url:$.value,label:"Active",detail:"REST endpoint responded successfully.",badge:"endpoint-badge-active",lastPing:null}:{title:"Endpoint",url:null,label:"Not connected",detail:"No endpoint connected yet.",badge:"endpoint-badge-idle",lastPing:null}}),vt=p(0),ht=_(()=>h.tools.value.length||vt.value),fe=_(()=>h.tools.value.length===0?null:ys(h.tools.value)),Re=_(()=>gs(H.value)),qt=_(()=>fs(Re.value,{routed:F.value,info:u.stepsCompleted.value.includes("info")}));function Ne(s){return u.stepsCompleted.value.includes(s)}function Vt(s){const e=s?.ucp?.services;if(!e)return null;for(const n in e){const g=e[n];if(g?.mcp?.endpoint)return Oe(g.mcp.endpoint);if(Array.isArray(g)){const I=g.find(A=>A.transport==="mcp"&&A.endpoint);if(I)return Oe(I.endpoint)}}return null}function Nt(s){const e=s?.ucp?.services;if(!e)return null;for(const n in e){const g=e[n];if(Array.isArray(g)){const I=g.find(A=>A.transport==="rest"&&A.endpoint);if(I)return Oe(I.endpoint)}}return null}function Oe(s){try{const e=new URL(s);if(e.protocol==="http:"&&!["localhost","127.0.0.1"].includes(e.hostname))return s.replace(/^http:/,"https:")}catch{}return s}function Ot(s){T.value=s,Ee()}async function Ee(){if(!T.value.trim())return;U.value=!0,k.value=null,Z.value=null;const s=T.value.trim().replace(/^https?:\/\//,"").replace(/\/$/,"");let e=null,n=null,g=null,I=null;try{P({type:"request",label:"GET /api/ucp/status",data:{domain:s}});const A=performance.now();h.runtime.value=B.value;const Be=B.value==="local",be=await fetch(`/api/ucp/status?domain=${encodeURIComponent(s)}&runtime=${encodeURIComponent(B.value)}`);if(be.ok){const D=await be.json();se.value=D.manifest,g=D.status??null,I=D.httpStatus??null,n=D.manifest?null:D.error??null,H.value=D.negotiation??null,u.setNegotiation(D.negotiation??null),e=Vt(D.manifest),$.value=Nt(D.manifest),P({type:"response",label:"UCP Manifest",data:{endpoint:e,hasManifest:!!D.manifest,services:Object.keys(D.manifest?.ucp?.services||{})},durationMs:Math.round(performance.now()-A)})}else P({type:"error",label:"UCP Manifest",data:{status:be.status},durationMs:Math.round(performance.now()-A)});let ve=!1;Y.value=!!e;const ft=i.value==="rest"&&!!$.value;if(ft&&h.disconnect(),e&&!ft){P({type:"request",label:"MCP Initialize",data:{endpoint:e}});const D=performance.now();ve=await h.initialize(e),P({type:ve?"response":"error",label:"MCP Initialize",data:ve?{server:h.session.value?.serverInfo}:{error:h.error.value},durationMs:Math.round(performance.now()-D)})}if(!ve&&!$.value&&!Be)for(const D of["/api/ucp/mcp","/api/mcp"]){const L=`https://${s}${D}`;if(L===e)continue;P({type:"request",label:"Storefront MCP Probe",data:{endpoint:L}});const Fe=performance.now(),We=await h.initialize(L);if(P({type:We?"response":"error",label:"Storefront MCP Probe",data:We?{server:h.session.value?.serverInfo}:{error:h.error.value},durationMs:Math.round(performance.now()-Fe)}),We){e=L,ve=!0,Y.value=!0;break}}if(!ve||!e)if($.value){P({type:"info",label:"REST-only store",data:{restEndpoint:$.value}});const D=se.value?.ucp?.capabilities||{},L=[];if(D["dev.ucp.shopping.catalog.search"]&&L.push({name:"search_catalog",description:"Search for products in the catalog.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query"}},required:["query"]}}),D["dev.ucp.shopping.catalog.lookup"]&&L.push({name:"get_product_details",description:"Look up a product by ID.",inputSchema:{type:"object",properties:{product_id:{type:"string",description:"Product ID"}},required:["product_id"]}}),D["dev.ucp.shopping.checkout"]&&(L.push({name:"create_checkout",description:"Create a checkout session, optionally with initial line items.",inputSchema:{type:"object",properties:{line_items:{type:"array",description:'Items to add. Each item: {item: {id: "product_id"}, quantity: 1}'}},required:["line_items"]}}),L.push({name:"update_checkout",description:"Update an open checkout: add line items, apply a discount code, or set a shipping method.",inputSchema:{type:"object",properties:{checkout_id:{type:"string",description:"The checkout session id."},line_items:{type:"array",description:'Items to add. Each item: {item: {id: "product_id"}, quantity: 1}'},discount_code:{type:"string",description:"A discount code to apply, e.g. 10OFF, WELCOME20, FIXED500."},shipping_method:{type:"string",description:"A shipping rate id, e.g. std-ship, exp-ship-us, exp-ship-intl."}},required:["checkout_id"]}}),L.push({name:"complete_checkout",description:"Complete an open checkout with a payment instrument and captured buyer consent, producing an order.",inputSchema:{type:"object",properties:{checkout_id:{type:"string",description:"The checkout session id."},payment_instrument_id:{type:"string",description:"A payment instrument id, e.g. instr_1 (Visa), instr_2 (Mastercard)."},buyer_consent:{type:"boolean",description:"Must be true â the buyer has consented to the purchase and total."}},required:["checkout_id","payment_instrument_id","buyer_consent"]}})),L.length===0){k.value="No capabilities found in manifest",U.value=!1;return}e=$.value,P({type:"info",label:"Connected (REST)",data:{domain:s,endpoint:e,tools:L.length}}),vt.value=L.length,u.setMcpTools(L),u.setConnectionInfo(e,s,$.value,se.value?.ucp?.payment_handlers),u.setUseRestTrans
2port(!0),i.value==="mcp"&&(i.value="rest"),N.value=!0}else{P({type:"error",label:"Connection Failed",data:{error:h.error.value}}),g&&$e.includes(g)?Z.value={domain:s,status:g,httpStatus:I}:k.value=n||h.error.value||"No MCP endpoint found. This domain may not support MCP or REST.",U.value=!1;return}else{P({type:"request",label:"List Tools",data:{endpoint:e}});const D=performance.now(),L=await h.discoverTools();if(P({type:L.length>0?"response":"error",label:"List Tools",data:{count:L.length,tools:L.map(Fe=>Fe.name)},durationMs:Math.round(performance.now()-D)}),L.length===0){k.value="No tools found on this MCP server",U.value=!1;return}P({type:"info",label:"Connected",data:{domain:s,endpoint:e,restEndpoint:$.value,model:J.value,tools:L.length}}),u.setMcpTools(L),u.setConnectionInfo(e,s,$.value,se.value?.ucp?.payment_handlers),N.value=!0}e&&M.checkAuthStatus(e).catch(()=>{})}catch(A){k.value=A instanceof Error?A.message:"Connection failed"}finally{U.value=!1}}je(i,s=>{if(s==="webmcp"||U.value||!N.value||u.sessionId.value)return;(h.session.value?.endpoint?"mcp":$.value?"rest":null)!==s&&Ee()});function Ht(){u.reset(),Q.value=""}async function Ft(){U.value=!0,k.value=null,Z.value=null,u.reset(),F.value=!0;const s=y.routerEndpoint;try{P({type:"request",label:"Resolver Initialize",data:{endpoint:s}});const e=performance.now(),n=await h.initialize(s);if(P({type:n?"response":"error",label:"Resolver Initialize",data:n?{server:h.session.value?.serverInfo}:{error:h.error.value},durationMs:Math.round(performance.now()-e)}),!n){k.value=h.error.value||"Could not connect to the UCP Checker resolver",U.value=!1;return}P({type:"request",label:"Resolver List Tools",data:{endpoint:s}});const g=performance.now(),I=await h.discoverTools();if(P({type:I.length>0?"response":"error",label:"Resolver List Tools",data:{count:I.length,tools:I.map(A=>A.name)},durationMs:Math.round(performance.now()-g)}),I.length===0){k.value="No tools available on the resolver",U.value=!1;return}P({type:"info",label:"Resolver Connected",data:{endpoint:s,model:J.value,tools:I.length}}),u.setMcpTools(I),u.setConnectionInfo(s,"router",null,null),N.value=!0}catch(e){k.value=e instanceof Error?e.message:"Connection failed"}finally{U.value=!1}}async function He(){if(ge.value)return Et();const s=Q.value.trim();if(!s||u.loading.value)return;Q.value="",P({type:"request",label:"Agent Chat",data:{model:J.value,message:s,sessionId:u.sessionId.value}});const e=performance.now(),n=u.toolCalls.value.length,g=w.value&&z.value==="webmcp";g&&await G();try{await u.sendMessage(J.value,s,ie.value,B.value,g?"webmcp":"ucp")}finally{W.value=null}c.refresh(),jt(u.toolCalls.value.slice(n));const I=Math.round(performance.now()-e);u.error.value?P({type:"error",label:"Agent Chat",data:{error:u.error.value},durationMs:I}):P({type:"response",label:"Agent Chat",data:{turns:u.turnCount.value,tokens:u.tokens.value,toolCalls:u.toolCalls.value.slice(-5).map(A=>({name:A.name,ms:A.duration_ms,...A.error?{error:A.error}:{},...A.arguments?{args:A.arguments}:{},...A.transport?{transport:A.transport}:{}})),steps:u.stepsCompleted.value,outcome:u.outcome.value},durationMs:I}),await Zt(),Te.value&&(Te.value.scrollTop=Te.value.scrollHeight)}function mt(s){s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),He())}function gt(){const s=window.innerWidth<1024;s&&!xe.value&&(re.value=!1),xe.value=s}return St(()=>{xe.value=window.innerWidth<1024,re.value=!xe.value,window.addEventListener("resize",gt),y.domain&&!Jt()&&Ee()}),Qt(()=>window.removeEventListener("resize",gt)),(s,e)=>(o(),a(E,null,[S(d(Xt),{title:"AI Agent Benchmark"},{default:Ge(()=>[...e[29]||(e[29]=[t("meta",{name:"description",content:"Watch 20 AI models autonomously shop real stores. Compare Claude, GPT, Gemini, Grok, DeepSeek, and Llama from search to checkout via MCP and REST."},null,-1),t("meta",{property:"og:title",content:"AI Agent Benchmark - UCP Playground"},null,-1),t("meta",{property:"og:description",content:"Watch 20 AI models autonomously shop real stores. Compare Claude, GPT, Gemini, Grok, DeepSeek, and Llama from search to checkout via MCP and REST."},null,-1),t("meta",{property:"og:url",content:"https://ucpplayground.com/agent"},null,-1),t("meta",{property:"og:image",content:"https://ucpchecker.s3.eu-west-1.amazonaws.com/blog/why-we-built-ucp-playground/ucp_playground_intro.webp"},null,-1),t("meta",{property:"og:type",content:"website"},null,-1),t("meta",{property:"og:site_name",content:"UCP Playground"},null,-1),t("meta",{name:"twitter:card",content:"summary_large_image"},null,-1),t("meta",{name:"twitter:title",content:"AI Agent Benchmark - UCP Playground"},null,-1),t("meta",{name:"twitter:description",content:"Watch 20 AI models autonomously shop real stores. Compare Claude, GPT, Gemini, Grok, DeepSeek, and Llama from search to checkout via MCP and REST."},null,-1),t("meta",{name:"twitter:image",content:"https://ucpchecker.s3.eu-west-1.amazonaws.com/blog/why-we-built-ucp-playground/ucp_playground_intro.webp"},null,-1),t("link",{rel:"canonical",href:"https://ucpplayground.com/agent"},null,-1)])]),_:1}),t("div",{class:j(["app ucp",{"debug-open":Ae.value}])},[t("header",Zn,[e[31]||(e[31]=Me('<div class="header-left" data-v-7af72a05><h1 class="app-title" data-v-7af72a05><a href="/" class="app-logo" data-v-7af72a05><span class="logo-icon" data-v-7af72a05><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" data-v-7af72a05><rect x="3" y="3" width="18" height="18" rx="4" data-v-7af72a05></rect><path d="M7 9h10M7 15h10" data-v-7af72a05></path></svg></span><span class="logo-text" data-v-7af72a05>UCP Playground</span></a></h1><span class="header-domain" data-v-7af72a05> / Agent </span></div>',1)),t("div",Kn,[S(ts,{modelValue:Ae.value,"onUpdate:modelValue":e[0]||(e[0]=n=>Ae.value=n)},null,8,["modelValue"]),ge.value?r("",!0):(o(),a("button",{key:0,class:j(["info-pill",{"info-pill-active":re.value}]),onClick:e[1]||(e[1]=n=>re.value=!re.value)},[...e[30]||(e[30]=[t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"M12 16v-4"}),t("path",{d:"M12 8h.01"})],-1),t("span",null,"Info",-1)])],2)),S(ms),S(vs)])]),t("div",eo,[t("main",to,[N.value?(o(),a("div",bo,[ge.value?(o(),a("div",Wo,[t("div",Go,[t("div",Jo,[e[47]||(e[47]=t("span",{class:"status-indicator"},null,-1)),t("span",Qo,l(T.value),1),t("span",Xo,l(ht.value)+" tools",1)]),t("div",Yo,[ot.value.length>0&&O.value.length<5?Ue((o(),a("select",{key:0,"onUpdate:modelValue":e[12]||(e[12]=n=>we.value=n),class:"add-model-select",onChange:e[13]||(e[13]=n=>rt(we.value))},[e[48]||(e[48]=t("option",{value:"",disabled:"",selected:""}," + Add Model ",-1)),(o(!0),a(E,null,X(ot.value,n=>(o(),a("option",{key:n.key,value:n.key},l(n.display_name)+" ("+l(n.provider)+") ",9,Zo))),128))],544)),[[Yt,we.value]]):r("",!0),t("button",{class:"btn btn-outline btn-sm",disabled:Pe.value,onClick:ut}," Exit Compare ",8,Ko)])]),t("div",ea,[(o(!0),a(E,null,X(O.value,n=>(o(),a("div",{key:n,class:"model-column"},[t("div",ta,[t("div",sa,[t("span",na,l(y.models[n]?.display_name),1),t("span",oa,l(y.models[n]?.provider),1)]),O.value.length>1?(o(),a("button",{key:0,class:"model-column-remove",disabled:V[n]?.loading.value,title:"Remove model",onClick:g=>Rt(n)}," Ã ",8,aa)):r("",!0)]),t("div",la,[S(wt,{domain:T.value,timeline:V[n]?.timeline.value??[],loading:V[n]?.loading.value??!1,"empty-message":"Waiting for prompt...","is-multi-model":!0},null,8,["domain","timeline","loading"])]),V[n]?.outcome.value||ue.value[n]?(o(),a("div",ia,[V[n]?.outcome.value?(o(),K(he,{key:0,state:d(Ke)(V[n].outcome.value),value:d(Ze)(V[n].outcome.value,Re.value),dot:!1},null,8,["state","value"])):r("",!0),ue.value[n]?(o(),a("span",ra,l((ue.value[n]/1e3).toFixed(1))+"s ",1)):r("",!0)])):r("",!0)]))),128))]),$t.value?(o(),a("div",ua,[e[49]||(e[49]=t("span",{class:"summary-label"},"Results:",-1)),t("div",da,[(o(!0),a(E,null,X(O.value,n=>(o(),a("div",{key:n,class:"summary-item"},[t("span",ca,l(y.models[n]?.display_name),1),V[n]?.outcome.value?(o(),K(he,{key:0,state:d(Ke)(V[n].outcome.value),value:d(Ze)(V[n].outcome.value,Re.value),size:"inline",dot:!1},null,8,["state","value"])):r("",!0),ue.value[n]?(o(),a("span",pa,l((ue.value[n]/1e3).toFixed(1))+"s ",1)):r("",!0)]))),128))])])):r("",!0),t("div",va,[t("div",ha,[S(Ye,{compact:""})]),t("div",ma,[Ue(t("input",{"onUpdate:modelValue":e[14]||(e[14]=n=>Q.value=n),type:"text",placeholder:"e.g. find me some running shoes...",class:"domain-in
2put",disabled:Pe.value,onKeydown:mt},null,40,ga),[[Qe,Q.value]]),t("button",{class:"btn btn-primary",disabled:!Q.value.trim()||Pe.value,onClick:He}," Send ",8,fa)])])])):(o(),a("div",_o,[t("div",wo,[t("div",Co,[e[41]||(e[41]=t("span",{class:"status-indicator"},null,-1)),t("span",Mo,l(F.value?"All Stores":T.value),1),t("span",So,l(y.models[J.value]?.display_name),1),w.value&&z.value==="webmcp"?(o(),a("span",$o,"Store page · WebMCP")):r("",!0)]),t("div",xo,[d(M).linkedIdentity.value?(o(),a("span",To,[e[42]||(e[42]=t("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),t("circle",{cx:"12",cy:"7",r:"4"})],-1)),R(" "+l(d(M).linkedIdentity.value.name||d(M).linkedIdentity.value.email),1)])):r("",!0),w.value&&z.value==="webmcp"?r("",!0):(o(),a("span",Po,l(ht.value)+" tools",1))])]),t("div",{ref_key:"messagesContainer",ref:Te,class:"messages-area"},[S(wt,{domain:T.value,timeline:d(u).timeline.value,loading:d(u).loading.value,"empty-hint":F.value?'Try: "I want to buy running shoes"':'Try: "find me running shoes in black, size 9"'},null,8,["domain","timeline","loading","empty-hint"])],512),d(u).door.value==="webmcp"&&d(u).doorShots.value&&(d(u).doorShots.value.open||d(u).doorShots.value.handoff)?(o(),a("div",Io,[d(u).doorShots.value.open?(o(),a("figure",Ao,[t("a",{href:d(u).doorShots.value.open,target:"_blank",rel:"noopener"},[t("img",{src:d(u).doorShots.value.open,alt:"The store page the agent opened",loading:"lazy"},null,8,Eo)],8,Ro),e[43]||(e[43]=t("figcaption",null,"The page the agent opened",-1))])):r("",!0),d(u).doorShots.value.handoff?(o(),a("figure",Bo,[t("a",{href:d(u).doorShots.value.handoff,target:"_blank",rel:"noopener"},[t("img",{src:d(u).doorShots.value.handoff,alt:"The store checkout the run reached",loading:"lazy"},null,8,jo)],8,Uo),e[44]||(e[44]=t("figcaption",null,"Where it stopped: the store's checkout",-1))])):r("",!0)])):r("",!0),t("div",Do,[W.value&&d(u).loading.value?(o(),a("div",Lo," All "+l(W.value.max)+" store-page browsers are in use right now. Your run is waiting for one to free up (up to 45 seconds), then it starts. ",1)):r("",!0),oe.value?(o(),a("div",zo,[e[45]||(e[45]=t("span",null,"A store-page run is one task, so this run is finished.",-1)),t("button",{class:"btn btn-secondary btn-sm",onClick:Ht},"New run")])):(o(),a(E,{key:2},[t("div",qo,[S(Ye,{compact:""})]),t("div",Vo,[Ue(t("input",{"onUpdate:modelValue":e[10]||(e[10]=n=>Q.value=n),type:"text",placeholder:w.value&&z.value==="webmcp"?"One task, e.g. add a black tee in M to the cart and go to checkout":"e.g. find me some running shoes...",class:"domain-input",disabled:d(u).loading.value,onKeydown:mt},null,40,No),[[Qe,Q.value]]),t("button",{onClick:He,disabled:!Q.value.trim()||d(u).loading.value,class:"btn btn-primary"}," Send ",8,Oo)])],64)),d(u).error.value?(o(),a("div",Ho,l(d(u).error.value),1)):r("",!0),v.value?r("",!0):(o(),a("div",Fo,[t("a",{href:"#",onClick:e[11]||(e[11]=Je
2(n=>q.value=!0,["prevent"]))},"Sign in"),e[46]||(e[46]=R(" for higher daily caps, plus saved sessions, model comparison, and API access. ",-1))]))])]))])):(o(),a("div",so,[t("div",no,[e[40]||(e[40]=Me('<div class="connect-head" data-v-7af72a05><span class="mono-pill" data-v-7af72a05><span class="pill-dot" data-v-7af72a05></span>no store connected</span><h2 class="connect-title" data-v-7af72a05> Connect a store to start shopping </h2><p class="connect-sub" data-v-7af72a05> Pick a model, enter a domain, and chat with an AI shopping agent. </p></div>',1)),t("div",oo,[t("div",ao,[t("span",lo,[e[32]||(e[32]=t("span",{class:"ucp-label"},"Model",-1)),S(Se,{modelValue:J.value,"onUpdate:modelValue":e[2]||(e[2]=n=>J.value=n),groups:pt.value,trigger:"field"},null,8,["modelValue","groups"])]),t("span",io,[e[34]||(e[34]=t("span",{class:"ucp-label"},"Scope",-1)),t("div",ro,[t("button",{type:"button",class:j(["scope-btn",{"scope-btn-active":!F.value}]),onClick:e[3]||(e[3]=n=>F.value=!1)}," Specific Store ",2),t("button",{type:"button",class:j(["scope-btn",{"scope-btn-active":F.value}]),onClick:e[4]||(e[4]=n=>F.value=!0)},[...e[33]||(e[33]=[R(" Shop All Stores ",-1),t("span",{class:"scope-tag"},"beta",-1)])],2)])])]),F.value?(o(),a("div",co,[e[36]||(e[36]=t("span",{class:"router-copy"}," The agent searches every store in the catalogue, picks where to buy, then connects to that store and shops there. No domain needed â results vary while this is in beta. ",-1)),t("button",{class:"router-start-btn",disabled:U.value,onClick:Ft},l(U.value?"Connectingâ¦":"Start shopping"),9,po)])):(o(),a("form",{key:0,class:"connect-field",onSubmit:Je(Ee,["prevent"])},[e[35]||(e[35]=t("span",{class:"ucp-label"},"Store domain",-1)),t("div",{class:j(["domain-combo",{"domain-combo-focus":ae.value}])},[Ue(t("input",{"onUpdate:modelValue":e[5]||(e[5]=n=>T.value=n),type:"text",placeholder:"everlane.com",autocomplete:"off",autocapitalize:"none",spellcheck:"false",class:"domain-combo-input",onFocus:e[6]||(e[6]=n=>ae.value=!0),onBlur:e[7]||(e[7]=n=>ae.value=!1)},null,544),[[Qe,T.value]]),t("button",{type:"submit",class:j(["domain-combo-btn",{"domain-combo-btn-ready":de.value&&!U.value}]),disabled:U.value||!de.value},l(U.value?"Connectingâ¦":"Connect"),11,uo)],2)],32)),Z.value?(o(),K(ss,{key:2,class:"no-ucp-slot",domain:Z.value.domain,status:Z.value.status,"http-status":Z.value.httpStatus,onDismiss:e[8]||(e[8]=n=>Z.value=null)},{default:Ge(()=>[...e[37]||(e[37]=[R(" Try one of the stores below. ",-1)])]),_:1},8,["domain","status","http-status"])):r("",!0),k.value?(o(),a("div",vo,[R(l(k.value)+" ",1),t("button",{class:"error-close",onClick:e[9]||(e[9]=n=>k.value=null)}," à ")])):r("",!0)]),F.value?(o(),a("p",ko,[...e[39]||(e[39]=[R(" Got a store? Add it to ",-1),t("a",{href:"https://ucpchecker.com?utm_source=ucpplayground&utm_medium=agent&utm_campaign=router_mode",target:"_blank",rel:"noopener"},"ucpchecker.com",-1),R(" to make sure you're included in the benchmarks. ",-1)])])):(o(),a("div",ho,[e[38]||(e[38]=t("span",{class:"ucp-label"},"Or try one of these",-1)),t("div",mo,[(o(),a(E,null,X(ce,n=>t("button",{key:n.domain,type:"button",class:"try-pill",onClick:g=>Ot(n.domain)},[n.local?(o(),a("span",fo)):r("",!0),R(" "+l(n.domain)+" ",1),n.tag?(o(),a("span",yo,l(n.tag),1)):r("",!0)],8,go)),64))])]))])]))]),S(ns,{open:re.value&&!ge.value,available:N.value&&!ge.value,onClose:e[23]||(e[23]=n=>re.value=!1),onOpen:e[24]||(e[24]=n=>re.value=!0)},{default:Ge(()=>[t("div",ya,[t("div",ka,[t("div",ba,[e[50]||(e[50]=t("span",{class:"endpoint-icon","aria-hidden":"true"},"ð",-1)),t("div",null,[t("div",_a,l(ne.value.title),1),ne.value.url?(o(),a("div",wa,[t("code",null,l(ne.value.url),1)])):r("",!0)])]),S(me,{class:"endpoint-docs-hint",href:"/docs/test-a-store/endpoint-discovery",label:"Endpoint Discovery â how manifests and endpoints resolve"}),t("span",{class:j(["endpoint-status-badge",ne.value.badge])},l(ne.value.label),3)]),t("p",Ca,l(ne.value.detail),1),ne.value.lastPing?(o(),a("p",Ma," Last ping "+l(new Date(ne.value.lastPing).toLocaleTimeString()),1)):r("",!0),N.value&&!F.value?(o(),a("div",Sa,[e[51]||(e[51]=t("span",{class:"endpoint-connection-label"},"Connection",-1)),!d(u).sessionId.value&&!d(u).loading.value&&!U.value?(o(),K(Xn,{key:0,connection:i.value,"onUpdate:connection":e[15]||(e[15]=n=>i.value=n),mcp:Y.value,rest:!!$.value,webmcp:w.value},null,8,["connection","mcp","rest","webmcp"])):(o(),a("span",$a,l({mcp:"UCP · MCP",rest:"UCP · REST",webm
2cp:"WebMCP"}[i.value]),1))])):r("",!0)]),v.value&&N.value?(o(),a("div",xa,[t("button",{class:"save-target-btn",disabled:te.value==="saving"||te.value==="saved",onClick:zt},l(te.value==="saved"?"Saved to your targets â":te.value==="exists"?"Already in your targets":te.value==="saving"?"Savingâ¦":"Save as target"),9,Ta)])):r("",!0),v.value?(o(),a("div",Pa,[t("div",Ia,[e[52]||(e[52]=t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2"}),t("path",{d:"M8 21h8M12 17v4"})],-1)),e[53]||(e[53]=R(" Runtime ",-1)),t("span",Aa,[S(Yn,{runtime:B.value,"onUpdate:runtime":e[16]||(e[16]=n=>B.value=n)},null,8,["runtime"]),S(me,{href:"/docs/test-locally/local-testing",label:"Runtimes â where a session executes"})])])])):r("",!0),S(Xs,{identity:ie.value,"onUpdate:identity":e[17]||(e[17]=n=>ie.value=n),endpoint:ne.value.url,onProbeResult:Ut},null,8,["identity","endpoint"]),d(M).tokenStatus.value.authenticated?(o(),a("div",Ra,[t("div",Ea,[e[54]||(e[54]=t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),t("circle",{cx:"12",cy:"7",r:"4"})],-1)),t("div",Ba,[d(M).linkedIdentity.value?(o(),a("span",Ua,l(d(M).linkedIdentity.value.name||d(M).linkedIdentity.value.email),1)):(o(),a("span",ja,"OAuth2 Connected")),d(M).linkedIdentity.value?.name&&d(M).linkedIdentity.value?.email?(o(),a("span",Da,l(d(M).linkedIdentity.value.email),1)):r("",!0)]),t("button",{class:"identity-disconnect-btn",onClick:e[18]||(e[18]=n=>d(h).session.value?.endpoint&&d(M).revokeAccess(d(h).session.value.endpoint))}," Disconnect "),t("button",{class:"identity-reset-btn",onClick:e[19]||(e[19]=n=>d(h).session.value?.endpoint&&d(M).forceReset(d(h).session.value.endpoint)),title:"Clear all cached OAuth state including client registrations"}," Reset ")])])):(lt.value||ze.value?.authorization_endpoint)&&!d(M).tokenStatus.value.authenticated?(o(),a("div",La,[t("button",{class:"identity-connect-btn",disabled:d(M).isAuthorizing.value,onClick:It},[d(M).isAuthorizing.value?(o(),a("svg",qa,[...e[55]||(e[55]=[t("path",{d:"M21 12a9 9 0 11-6.219-8.56"},null,-1)])])):(o(),a("svg",Va,[...e[56]||(e[56]=[t("rect",{x:"5",y:"11",width:"14",height:"10",rx:"2"},null,-1),t("path",{d:"M8 11V7a4 4 0 018 0v4"},null,-1)])])),R(" "+l(d(M).isAuthorizing.value?"Connecting...":"Link Identity"),1)],8,za),d(M).oauthError.value?(o(),a("div",Na,l(d(M).oauthError.value),1)):r("",!0)])):Ie.value?(o(),a("div",Oa,[t("div",Ha," Identity linking declared, but it can't be linked: "+l(Ie.value),1)])):r("",!0),v.value?(o(),a("div",Fa,[t("div",Wa,[e[57]||(e[57]=t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"M2 12h20M12 2a15 15 0 0 1 0 20M12 2a15 15 0 0 0 0 20"})],-1)),e[58]||(e[58]=R(" Buyer context ",-1)),t("span",Ga,[S(Ye,{compact:""})])])])):r("",!0),v.value?(o(),a("details",{key:6,class:"sidebar-section",open:d(c).count.value>0},[t("summary",Qa,[e[59]||(e[59]=t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M6 6h15l-1.5 9h-12z"}),t("circle",{cx:"9",cy:"20",r:"1"}),t("circle",{cx:"18",cy:"20",r:"1"})],-1)),e[60]||(e[60]=R(" Held state ",-1)),t("span",Xa,[S(he,{state:d(c).count.value?"info":"neutral",value:String(d(c).count.value),mono:"",dot:!1},null,8,["state","value"]),t("button",{type:"button",class:"held-refresh",disabled:d(c).loading.value,onClick:e[20]||(e[20]=Je(n=>
2d(c).refresh(),["prevent","stop"]))},l(d(c).loading.value?"Refreshingâ¦":"Refresh"),9,Ya)])]),t("div",Za,[S(ls,{"current-domain":T.value,compact:"",onContinue:e[21]||(e[21]=({url:n})=>C(n))},null,8,["current-domain"])])],8,Ja)):r("",!0),H.value?(o(),a("details",Ka,[t("summary",el,[e[61]||(e[61]=t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M4 7h16M4 12h10M4 17h16"})],-1)),e[62]||(e[62]=R(" Negotiation ",-1)),t("span",tl,[S(he,{state:H.value.summary.excluded>0||H.value.version_state!=="match"?"partial":"pass",value:`${H.value.summary.active}/${H.value.summary.declared} · ${H.value.variant}`,mono:"",dot:!1},null,8,["state","value"])])]),t("div",sl,[S(is,{readout:H.value,compact:""},null,8,["readout"])])])):r("",!0),fe.value?(o(),a("details",{key:8,class:"sidebar-section",open:fe.value.totalIssues>0},[t("summary",ol,[e[63]||(e[63]=t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})],-1)),e[64]||(e[64]=R(" Schema Quality ",-1)),t("span",al,[S(he,{state:d(et)(fe.value.overall.grade),value:`${fe.value.overall.grade} · ${fe.value.overall.score}`,mono:"",dot:!1},null,8,["state","value"]),S(me,{href:"/docs/conformance/schema-quality",label:"Schema Quality â the seven checks and grades"})])]),t("div",ll,[t("div",il,[(o(!0),a(E,null,X(fe.value.tools,n=>(o(),a("details",{key:n.name,class:"schema-tool-row",open:n.issues.length>0},[t("summary",ul,[t("span",dl,l(n.name),1),t("div",cl,[t("div",{class:j(["schema-bar-fill",`schema-bar-fill--${d(et)(n.grade)}`]),style:bt({width:n.score+"%"})},null,6)]),S(he,{state:d(et)(n.grade),value:n.grade,size:"inline",mono:"",dot:!1},null,8,["state","value"])]),n.issues.length>0?(o(),a("ul",pl,[(o(!0),a(E,null,X(n.issues,(g,I)=>(o(),a("li",{key:I},l(g),1))),128))])):r("",!0)],8,rl))),128))]),fe.value.totalIssues===0?(o(),a("div",vl," All tool schemas are well-defined. ")):r("",!0)])],8,nl)):r("",!0),t("details",hl,[t("summary",ml,[e[65]||(e[65]=t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M9 12l2 2 4-4"}),t("circle",{cx:"12",cy:"12",r:"10"})],-1)),e[66]||(e[66]=R(" Funnel Progress ",-1)),t("span",gl,[S(me,{href:"/docs/conformance/outcomes",label:"Funnel & Outcomes â the stages and how outcomes classify"})])]),t("div",fl,[t("div",yl,[(o(!0),a(E,null,X(qt.value,n=>(o(),a("div",{key:n.key,class:"step-row"},[t("span",{class:j(["step-icon",{completed:Ne(n.key)}])},l(Ne(n.key)?"â":"·"),3),t("span",{class:j(["step-label",{completed:Ne(n.key)}])},l(n.label),3)]))),128))])])]),t("details",kl,[t("summary",bl,[e[67]||(e[67]=t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t("path",{d:"M12 20V10"}),t("path",{d:"M18 20V4"}),t("path",{d:"M6 20v-4"})],-1)),e[68]||(e[68]=R(" Session Stats ",-1)),t("span",_l,[S(me,{href:"/docs/start-here/understanding-results",label:"Understanding Results â reading session stats"})])]),t("div",wl,[t("div",Cl,[t("div",Ml,[t("div",Sl,[e[69]||(e[69]=t("span",{class:"stat-label"},"Tokens",-1)),t("span",$l,l(d(u).tokens.value.total.toLocaleString()),1)]),m.value?(o(),a("div",{key:0,class:"token-meter-track",title:`${x.value}% of ${ye.value} run cap`},[t("div",{class:j(["token-meter-fill",{"is-high":x.value>=80}]),style:bt({width:x.value+"%"})},null,6)],8,xl)):r("",!0),m.value?(o(),a("span",Tl,l(x.value)+"% of "+l(ye.value)+" run cap",1)):r("",!0)]),t("div",Pl,[e[70]||(e[70]=t("span",{class:"stat-label"},"Turns",-1)),t("span",Il,l(d(u).turnCount.value),1)]),d(u).outcome.value?(o(),a("div",Al,[e[71]||(e[71]=t("span",{class:"stat-label"},"Outcome",-1)),S(he,{state:d(Ke)(d(u).outcome.value),value:d(Ze)(d(u).outcome.value,Re.value),dot:!1},null,8,["state","value"])])):r("",!0)])])]),d(u).sessionId.value?r("",!0):(o(),a("div",Rl,[t("div",El,[e[72]||(e[72]=t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2"}),t("path",{d:"M8.5 2h7"})],-1)),e[73]||(e[73]=R(" Model ",-1)),t("span",Bl,[S(me,{href:"/docs/test-a-store/choosing-models",label:"Cho
2osing Models â trade-offs across the lineup"})])]),t("div",Ul,[t("div",{class:j(["select-group",{"select-group-disabled":d(u).loading.value}])},[S(Se,{modelValue:J.value,"onUpdate:modelValue":e[22]||(e[22]=n=>J.value=n),groups:pt.value,trigger:"field"},null,8,["modelValue","groups"])],2),v.value&&!F.value?(o(),a("button",{key:0,class:"compare-btn",onClick:At},[...e[74]||(e[74]=[t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("rect",{x:"2",y:"3",width:"8",height:"18",rx:"1"}),t("rect",{x:"14",y:"3",width:"8",height:"18",rx:"1"})],-1),R(" Compare Models ",-1)])])):r("",!0)])]))]),_:1},8,["open","available"])]),Ae.value?(o(),a("div",jl,[t("div",Dl,[e[77]||(e[77]=t("span",{class:"debug-title"},"DEBUG CONSOLE",-1)),t("div",Ll,[t("button",{class:j(["debug-tab",{active:ee.value==="state"}]),onClick:e[25]||(e[25]=n=>ee.value="state")}," State ",2),t("button",{class:j(["debug-tab",{active:ee.value==="requests"}]),onClick:e[26]||(e[26]=n=>ee.value="requests")},[e[75]||(e[75]=R(" Requests ",-1)),Ve.value.length?(o(),a("span",zl,l(Ve.value.length),1)):r("",!0)],2),le.value?(o(),a("button",{key:0,class:j(["debug-tab",{active:ee.value==="identity"}]),onClick:e[27]||(e[27]=n=>ee.value="identity")},[e[76]||(e[76]=R(" Identity ",-1)),qe.value.length?(o(),a("span",ql,l(qe.value.length),1)):r("",!0)],2)):r("",!0)]),t("button",{onClick:Dt,class:"debug-clear"}," Clear ")]),t("div",Vl,[ee.value==="state"?(o(),a("div",Nl,[t("pre",null,l(JSON.stringify(Lt.value,null,2)),1)])):ee.value==="requests"||ee.value==="identity"?(o(),a("div",Ol,[dt.value.length===0?(o(),a("div",Hl,l(ee.value==="identity"?"No identity activity yet. Select a TAP identity to run a probe.":"No requests yet. Connect to a store to see activity."),1)):r("",!0),(o(!0),a(E,null,X(dt.value,n=>(o(),a("div",{key:n.id,class:j(["debug-log",`log-${n.type}`])},[t("div",Fl,[t("span",{class:j(["log-type-badge",`badge-${n.type}`])},l(n.type.toUpperCase()),3),t("span",Wl,l(n.label),1),n.durationMs?(o(),a("span",Gl,l(n.durationMs)+"ms",1)):r("",!0),t("span",Jl,l(new Date(n.timestamp).toLocaleTimeString()),1)]),n.data?(o(),a("pre",Ql,l(JSON.stringify(n.data,null,2)),1)):r("",!0)],2))),128))])):r("",!0)])])):r("",!0),S(hs,{open:q.value,"onUpdate:open":e[28]||(e[28]=n=>q.value=n)},null,8,["open"])],2)],64))}}),ci=De(Xl,[["__scopeId","data-v-7af72a05"]]);export{ci as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.