import{Qi as e,Wi as t,ca as n,na as r,sa as i}from"./src-BOCweS1p.js";import{fs as a}from"./app-server-manager-signals-Yn0WSnoY.js";import{V as o,h as s}from"./vscode-api-DjORcpSo.js";import{l as c,p as l}from"./mcp-capability-signals-DbHrUOCV.js";var u=r({items:t(n([r({id:i().min(1),title:i().min(1),type:e(`group`)}),r({resourceUri:i().min(1),title:i().min(1),type:e(`resource`)})]))}),d=o(s,e=>({queryFn:async()=>{let{thread:t}=await a(`start-thread-for-host`,{ephemeral:!0,hostId:e});return t.id},queryKey:[`mcp-capability-host-thread`,e],staleTime:1/0}));async function f(e,t,n,r){return l.parse(await a(`read-mcp-resource`,{hostId:t,server:n,threadId:await h(e,t),uri:r}))}async function p(e,t,n,r){return Promise.all(n.map(async({mentionSearchTool:n,server:i})=>{try{return{items:u.parse((await m(e,t,i,n,r)).structuredContent).items,mentionSearchTool:n,server:i}}catch{return{items:[],mentionSearchTool:n,server:i}}}))}async function m(e,t,n,r,i){return c.parse(await a(`call-mcp-tool`,{arguments:i,hostId:t,server:n,threadId:await h(e,t),tool:r}))}async function h(e,t){return e.query.getOrFetch(d,t)}export{f as n,p as r,m as t};
//# sourceMappingURL=mcp-capability-client-n0vyavsI.js.map