import{u as r,b as i,c as n}from"./vendor-query-B2UbickB.js";import{b as u}from"./index-BZu5zewH.js";const s=["mcpQueryJobs"];function o(){const e=i();return n({mutationFn:t=>u("/insight/mcp-query",{method:"POST",body:JSON.stringify({...t,wait:!1,direct:!0})}),onSuccess:()=>{e.invalidateQueries({queryKey:s,refetchType:"all"}),e.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}function a(){const e=i();return n({mutationFn:t=>u("/insight/mcp-query",{method:"POST",body:JSON.stringify({...t,wait:!1})}),onSuccess:()=>{e.invalidateQueries({queryKey:s,refetchType:"all"}),e.invalidateQueries({queryKey:["jobs"],refetchType:"all"})}})}function m(e={}){const t=new URLSearchParams;return t.set("entity",e.entity||"mcpQuery,mcpTriage,mcpWorkflowPlanner"),e.limit&&t.set("limit",String(e.limit)),e.offset!==void 0&&t.set("offset",String(e.offset)),e.search&&t.set("search",e.search),e.status&&t.set("status",e.status),t.set("sort_by","created_at"),t.set("order","desc"),r({queryKey:[...s,e],queryFn:()=>u(`/workflow-states/jobs?${t}`)})}function l(e){return r({queryKey:["mcpQueryExecution",e],queryFn:()=>u(`/workflow-states/${e}/execution`),enabled:!!e})}function p(e){return r({queryKey:["mcpQueryResult",e],queryFn:()=>u(`/workflows/${e}/result`),enabled:!!e,retry:2})}function f(e){return r({queryKey:["mcpQueryDescribe",e.prompt],queryFn:()=>u("/insight/mcp-query/describe",{method:"POST",body:JSON.stringify({prompt:e.prompt,result_title:e.resultTitle,result_summary:e.resultSummary})}),enabled:!!e.prompt,staleTime:1/0,gcTime:30*6e4})}function b(e){return r({queryKey:["yamlWorkflowForSource",e],queryFn:()=>u(`/yaml-workflows?source_workflow_id=${e}&limit=5`),enabled:!!e})}export{o as a,a as b,l as c,p as d,b as e,f,m as u};
//# sourceMappingURL=mcp-query-DE-oPOvi.js.map
