PageSourceSearch

https://snwolley.ai/_next/static/chunks/9653-6b5c91585b8f32a1.js

js snwolley.ai collected 2026-10-05 12:39:42 UTC 22,018 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9653],{27048:(e,t,a)=>{a.d(t,{Ej:()=>u,h:()=>h,u:()=>f});var r=a(12115),o=a(14625),n=a(11515);let s="https://snwolley.ai/api",l=new Map,i=null;class c{static getInstance(){return c.instance||(c.instance=new c),c.instance}async isEnabled(e){try{let t=l.get(e);if(t&&Date.now()-t.timestamp<3e5)return t.value;let a=await fetch("".concat(s,"/feature-flags/").concat(e),{method:"GET",headers:{"Content-Type":"application/json"}});if(!a.ok)return console.warn("Failed to fetch feature flag ".concat(e,": ").concat(a.status)),!1;let r=await a.json();return l.set(e,{value:r.enabled,timestamp:Date.now()}),r.enabled}catch(t){return console.error("Error checking feature flag ".concat(e,":"),t),!1}}async getFlagDetails(e){try{let t=await fetch("".concat(s,"/feature-flags/").concat(e),{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok)return console.warn("Failed to fetch feature flag details for ".concat(e,": ").concat(t.status)),null;return await t.json()}catch(t){return console.error("Error fetching feature flag details for ".concat(e,":"),t),null}}async getAllFlags(){try{if(i&&Date.now()-i.timestamp<3e5)return i.flags;let e=await fetch("".concat(s,"/feature-flags"),{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)return console.warn("Failed to fetch all feature flags: ".concat(e.status)),{};let t=await e.json();return i={flags:t.flags,timestamp:Date.now()},Object.entries(t.flags).forEach(e=>{let[t,a]=e;l.set(t,{value:a,timestamp:Date.now()})}),t.flags}catch(e){return console.error("Error fetching all feature flags:",e),{}}}clearCache(){l.clear(),i=null}async preloadFlags(e){try{let t=e.map(e=>this.isEnabled(e));await Promise.all(t)}catch(e){console.error("Error preloading feature flags:",e)}}constructor(){}}let d=c.getInstance(),u=e=>d.isEnabled(e),p={all:["feature-flags"],flag:e=>[...p.all,"flag",e],flagDetails:e=>[...p.all,"details",e],allFlags:()=>[...p.all,"allFlags"]},g=async e=>{let t=await fetch("".concat(s,"/feature-flags/").concat(e),{method:"GET",headers:{"Content-Type":"application/json"}});if(!t.ok)throw Error("Failed to fetch feature flag ".concat(e,": ").concat(t.status));return(await t.json()).enabled},f=(e,t)=>{var a,r,n,s,l;let i=(0,o.I)({queryKey:p.flag(e),queryFn:()=>g(e),staleTime:null!=(a=null==t?void 0:t.staleTime)?a:3e5,gcTime:null!=(r=null==t?void 0:t.gcTime)?r:6e5,refetchOnWindowFocus:null!=(n=null==t?void 0:t.refetchOnWindowFocus)&&n,enabled:null==(s=null==t?void 0:t.enabled)||s,retry:(e,t)=>!(t instanceof Error&&t.message.includes("4"))&&e<3,meta:{errorMessage:"Failed to fetch feature flag: ".concat(e)}});return{enabled:null!=(l=i.data)&&l,loading:i.isLoading,...i}},h=(e,t)=>{var a,o,s;let l=(0,n.E)({queries:e.map(e=>{var a,r,o;return{queryKey:p.flag(e),queryFn:()=>g(e),staleTime:null!=(a=null==t?void 0:t.staleTime)?a:3e5,gcTime:null!=(r=null==t?void 0:t.gcTime)?r:6e5,enabled:null==(o=null==t?void 0:t.enabled)||o,retry:(e,t)=>!t.message.includes("4")&&e<3}})}),i=r.useMemo(()=>{let t={};return e.forEach((e,a)=>{var r;let o=l[a];t[e]=null!=(r=o.data)&&r}),t},[l,e]);return{flags:i,loading:l.some(e=>e.isLoading),error:null!=(s=null==(o=l.find(e=>e.error))||null==(a=o.error)?void 0:a.message)?s:null}}},33130:(e,t,a)=>{a.d(t,{M:()=>r});let r={all:["pipedream"],connections:()=>[...r.all,"connections"],connectionToken:e=>[...r.all,"connection-token",e||"default"],health:()=>[...r.all,"health"],config:()=>[...r.all,"config"],workflows:()=>[...r.all,"workflows"],workflowRuns:e=>[...r.all,"workflow-runs",e],apps:(e,t,a)=>[...r.all,"apps",e,t||"",a||""],appsSearch:(e,t,a)=>[...r.all,"apps","search",e,t,a||""],popularApps:()=>[...r.all,"apps","popular"],availableTools:()=>[...r.all,"available-tools"],mcpDiscovery:e=>[...r.all,"mcp-discovery",null==e?void 0:e.app_slug,null==e?void 0:e.oauth_app_id,null==e?void 0:e.custom],profiles:{all:()=>[...r.all,"profiles"],list:e=>{var t;return[...r.profiles.all(),"list",(null==e?void 0:e.app_slug)||"",null!=(t=null==e?void 0:e.is_active)?t:""]},detail:e=>[...r.profiles.all(),"detail",e],connections:e=>[...r.profiles.all(),"connections",e]}}},35835:(e,t,a)=>{a.d(t,{A:()=>s});var r=a(72509),o=a(80344),n=a(33130);(0,r.GQ)(n.M.connections(),async()=>await s.getConnections(),{staleTime:6e5,gcTime:9e5,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchInterval:!1});let s={async createConnectionToken(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=await o.Hv.post("/pipedream/connection-token",e,{errorContext:{o
1peration:"create connection token",resource:"Pipedream connection"}});if(!t.success){var a;throw Error((null==(a=t.error)?void 0:a.message)||"Failed to create connection token")}return t.data},async getConnections(){let e=await o.Hv.get("/pipedream/connections",{errorContext:{operation:"load connections",resource:"Pipedream connections"}});if(!e.success){var t;throw Error((null==(t=e.error)?void 0:t.message)||"Failed to get connections")}return e.data},async getApps(e,t){let a=new URLSearchParams;e&&a.append("after",e),t&&a.append("q",t);let r=await o.Hv.get("/pipedream/apps".concat(a.toString()?"?".concat(a.toString()):""),{errorContext:{operation:"load apps",resource:"Pipedream apps"}});if(!r.success){var n;throw Error((null==(n=r.error)?void 0:n.message)||"Failed to get apps")}let s=r.data;if(!s.success&&s.error)throw Error(s.error);return s},async getPopularApps(){let e=await o.Hv.get("/pipedream/apps/popular",{errorContext:{operation:"load popular apps",resource:"Pipedream popular apps"}});if(console.log("result",e),!e.success){var t;throw Error((null==(t=e.error)?void 0:t.message)||"Failed to get popular apps")}let a=e.data;if(!a.success&&a.error)throw Error(a.error);return a},async getAvailableTools(){let e=await o.Hv.get("/pipedream/mcp/available-tools",{errorContext:{operation:"load available tools",resource:"Pipedream tools"}});if(!e.success){var t;throw Error((null==(t=e.error)?void 0:t.message)||"Failed to get available tools")}return e.data},async discoverMCPServers(e,t){var a,r;let n=await o.Hv.post("/pipedream/mcp/discover-profile",{external_user_id:e,app_slug:t},{errorContext:{operation:"discover MCP servers",resource:"Pipedream MCP"}});if(!n.success)throw Error((null==(r=n.error)?void 0:r.message)||"Failed to discover MCP servers");return(null==(a=n.data)?void 0:a.mcp_servers)||[]},async createProfile(e){let t=await o.Hv.post("/pipedream/profiles",e,{errorContext:{operation:"create profile",resource:"Pipedream credential profile"}});if(!t.success){var a;throw Error((null==(a=t.error)?void 0:a.message)||"Failed to create profile")}return t.data},async getProfiles(e){let t=new URLSearchParams;(null==e?void 0:e.app_slug)&&t.append("app_slug",e.app_slug),(null==e?void 0:e.is_active)!==void 0&&t.append("is_active",e.is_active.toString());let a=await o.Hv.get("/pipedream/profiles".concat(t.toString()?"?".concat(t.toString()):""),{errorContext:{operation:"get profiles",resource:"Pipedream credential profiles"}});if(!a.success){var r;throw Error((null==(r=a.error)?void 0:r.message)||"Failed to get profiles")}return a.data},async getProfile(e){let t=await o.Hv.get("/pipedream/profiles/".concat(e),{errorContext:{operation:"get profile",resource:"Pipedream credential profile"}});if(!t.success){var a;throw Error((null==(a=t.error)?void 0:a.message)||"Failed to get profile")}return t.data},async updateProfile(e,t){let a=await o.Hv.put("/pipedream/profiles/".concat(e),t,{errorContext:{operation:"update profile",resource:"Pipedream credential profile"}});if(!a.success){var r;throw Error((null==(r=a.error)?void 0:r.message)||"Failed to update profile")}return a.data},async deleteProfile(e){let t=await o.Hv.delete("/pipedream/profiles/".concat(e),{errorContext:{operation:"delete profile",resource:"Pipedream credential profile"}});if(!t.success){var a;throw Error((null==(a=t.error)?void 0:a.message)||"Failed to delete profile")}},async connectProfile(e,t){let a=t?"?app=".concat(encodeURIComponent(t)):"",r=await o.Hv.post("/pipedream/profiles/".concat(e,"/connect").concat(a),{},{errorContext:{operation:"connect profile",resource:"Pipedream credential profile"}});if(!r.success){var n;throw Error((null==(n=r.error)?void 0:n.message)||"Failed to connect profile")}return r.data},async getProfileConnections(e){let t=await o.Hv.get("/pipedream/profiles/".concat(e,"/connections"),{errorContext:{operation:"get profile connections",resource:"Pipedream profile connections"}});if(!t.success){var a;throw Error((null==(a=t.error)?void 0:a.message)||"Failed to get profile connections")}return t.data},async getAppIcon(e){let t=await o.Hv.get("/pipedream/apps/".concat(e,"/icon"),{errorContext:{o
1peration:"load app icon",resource:"Pipedream app icon"}});if(!t.success){var a;throw Error((null==(a=t.error)?void 0:a.message)||"Failed to get app icon")}return t.data},async getAppTools(e){let t=await o.Hv.get("/pipedream/apps/".concat(e,"/tools"),{errorContext:{operation:"load app tools",resource:"Pipedream app tools"}});if(!t.success){var a;throw Error((null==(a=t.error)?void 0:a.message)||"Failed to get app tools")}return t.data}}},51834:(e,t,a)=>{a.d(t,{Cf:()=>u,Es:()=>g,L3:()=>f,LC:()=>d,c7:()=>p,lG:()=>l,rr:()=>h,zM:()=>i});var r=a(95155);a(12115);var o=a(89511),n=a(65229),s=a(64269);function l(e){let{...t}=e;return(0,r.jsx)(o.bL,{"data-slot":"dialog",...t})}function i(e){let{...t}=e;return(0,r.jsx)(o.l9,{"data-slot":"dialog-trigger",...t})}function c(e){let{...t}=e;return(0,r.jsx)(o.ZL,{"data-slot":"dialog-portal",...t})}function d(e){let{className:t,...a}=e;return(0,r.jsx)(o.hJ,{"data-slot":"dialog-overlay",className:(0,s.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50 backdrop-blur-xs",t),...a})}function u(e){let{className:t,children:a,...l}=e;return(0,r.jsxs)(c,{"data-slot":"dialog-portal",children:[(0,r.jsx)(d,{}),(0,r.jsxs)(o.UC,{"data-slot":"dialog-content",className:(0,s.cn)("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-2xl border p-6 shadow-lg duration-200",t),...l,children:[a,(0,r.jsxs)(o.bm,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[(0,r.jsx)(n.A,{}),(0,r.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function p(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"dialog-header",className:(0,s.cn)("flex flex-col gap-2 text-center sm:text-left",t),...a})}function g(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"dialog-footer",className:(0,s.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function f(e){let{className:t,...a}=e;return(0,r.jsx)(o.hE,{"data-slot":"dialog-title",className:(0,s.cn)("text-lg leading-none font-semibold",t),...a})}function h(e){let{className:t,...a}=e;return(0,r.jsx)(o.VY,{"data-slot":"dialog-description",className:(0,s.cn)("text-muted-foreground text-sm",t),...a})}},65142:(e,t,a)=>{a.d(t,{p:()=>n});var r=a(95155);a(12115);var o=a(64269);function n(e){let{className:t,type:a,...n}=e;return(0,r.jsx)("input",{type:a,"data-slot":"input",className:(0,o.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...n})}},72509:(e,t,a)=>{a.d(t,{DY:()=>s,GQ:()=>l,Lx:()=>i});var r=a(14625),o=a(80549),n=a(53783);let s=e=>e;function l(e,t,a){return o=>(0,r.I)({queryKey:e,queryFn:t,...a,...o})}function i(e,t){return a=>{let{errorContext:r,...s}=t||{},{errorContext:l,...i}=a||{};return(0,o.n)({mutationFn:e,onError:(e,t,a)=>{var o,c;(null==i?void 0:i.onError)||(null==s?void 0:s.onError)||(0,n.hS)(e,l||r),null==s||null==(o=s.onError)||o.call(s,e,t,a),null==i||null==(c=i.onError)||c.call(i,e,t,a)},...s,...i})}}},76444:(e,t,a)=>{a.d(t,{Label:()=>s});var r=a(95155);a(12115);var o=a(10489),n=a(64269);function s(e){let{className:t,...a}=e;return(0,r.jsx)(o.b,{"data-slot":"label",className:(0,n.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}},80344:(e,t,a)=>{a.d(t,{Hv:()=>i,mI:()=>l,t_:()=>c});var r=a(96648),o=a(53783);let n="https://snwolley.ai/api",s={async request(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{showErrors:a=!0,errorContext:n,timeout:s=3e4,...l}=t;try{let t=new AbortController,i=setTimeout(()=>t.abort(),s),c=(0,r.U)(),{data:{session:d}}=await c.auth.getSession(),u={"Content-Type":"application/json",...l.headers};(null==d?void 0:d.access_token)&&(u.Authorization="Bearer ".concat(d.access_token)),(null==d?void 0:d.refresh_token)&&(u["X-Refresh-Token"]=d.refresh_token);let p=await fetch(e,{...l,headers:u,signal:t.signal});if(clearTimeout(i),!p.ok){let e=Error("HTTP ".concat(p.status,": ").concat(p.statusText));e.status=p.status,e.response=p;try{let t=await p.json();e.details=t,t.message&&(e.message=t.message)}catch(e){}return a&&(0,o.hS)(e,n),{error:e,success:!1}}let g=p.headers.get("content-type");return{data:(null==g?void 0:g.includes("application/json"))?await p.json():(null==g?void 0:g.includes("text/"))?await p.text():await p.blob(),success:!0}}catch(t){let e=t instanceof Error?t:Error(String(t));return"AbortError"===t.name&&(e.message="Request timeout",e.code="TIMEOUT"),a&&(0,o.nQ)(e,n),{error:e,success:!1}}},get:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s.request(e,{...t,method:"GET"})},post:async function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s.request(e,{...a,method:"POST",body:t?JSON.stringify(t):void 0})},put:async function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s.request(e,{...a,method:"PUT",body:t?JSON.stringify(t):void 0})},patch:async function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s.request(e,{...a,method:"PATCH",body:t?JSON.stringify(t):void 0})},delete:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s.request(e,{...t,method:"DELETE"})},upload:async function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{headers:r,...o}=a,n={...r};return delete n["Content-Type"],s.request(e,{...o,method:"POST",body:t,headers:n})}},l={async execute(e,t){try{let{data:a,error:r}=await e();if(r){let e=Error(r.message||"Database error");return e.code=r.code,e.details=r,(0,o.hS)(e,t),{error:e,success:!1}}return{data:a,success:!0}}catch(a){let e=a instanceof Error?a:Error(String(a));return(0,o.hS)(e,t),{error:e,success:!1}}}},i={get:(e,t)=>s.get("".concat(n).concat(e),t),post:(e,t,a)=>s.post("".concat(n).concat(e),t,a),put:(e,t,a)=>s.put("".concat(n).concat(e),t,a),patch:(e,t,a)=>s.patch("".concat(n).concat(e),t,a),delete:(e,t)=>
1s.delete("".concat(n).concat(e),t),upload:(e,t,a)=>s.upload("".concat(n).concat(e),t,a)},c={create:(e,t)=>i.post("/api-keys",e,t),list:e=>i.get("/api-keys",e),revoke:(e,t)=>i.patch("/api-keys/".concat(e,"/revoke"),{},t),delete:(e,t)=>i.delete("/api-keys/".concat(e),t)}},89182:(e,t,a)=>{a.d(t,{Lm:()=>g,RB:()=>u,Sn:()=>c,WU:()=>i,qU:()=>p,vt:()=>l,x4:()=>d});var r=a(96648),o=a(27048),n=a(41444);let s="https://snwolley.ai/api",l=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,a;if(!await (0,o.Ej)("custom_agents"))throw Error("Custom agents is not enabled");let l=(0,r.U)(),{data:{session:i}}=await l.auth.getSession();if(!i)throw Error("You must be logged in to get agents");let c=new URLSearchParams;e.page&&c.append("page",e.page.toString()),e.limit&&c.append("limit",e.limit.toString()),e.search&&c.append("search",e.search),e.sort_by&&c.append("sort_by",e.sort_by),e.sort_order&&c.append("sort_order",e.sort_order),void 0!==e.has_default&&c.append("has_default",e.has_default.toString()),void 0!==e.has_mcp_tools&&c.append("has_mcp_tools",e.has_mcp_tools.toString()),void 0!==e.has_agentpress_tools&&c.append("has_agentpress_tools",e.has_agentpress_tools.toString()),e.tools&&c.append("tools",e.tools);let d="".concat(s,"/agents").concat(c.toString()?"?".concat(c.toString()):""),u=await fetch(d,{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(i.access_token)}});if(!u.ok){let e=await u.json().catch(()=>({message:"Unknown error"}));throw Error(e.message||"HTTP ".concat(u.status,": ").concat(u.statusText))}let p=await u.json();return n.v.api.debug("[API] Fetched agents:",(null==(t=p.agents)?void 0:t.length)||0,"total:",(null==(a=p.pagination)?void 0:a.total)||0),p}catch(e){throw e instanceof Error&&e.message.includes("Custom agents is not enabled")||n.v.api.error("Error fetching agents:",e),e}},i=async e=>{try{if(!await (0,o.Ej)("custom_agents"))throw Error("Custom agents is not enabled");let t=(0,r.U)(),{data:{session:a}}=await t.auth.getSession();if(!a)throw Error("You must be logged in to get agent details");let n=await fetch("".concat(s,"/agents/").concat(e),{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a.access_token)}});if(!n.ok){let e=await n.json().catch(()=>({message:"Unknown error"}));throw Error(e.message||"HTTP ".concat(n.status,": ").concat(n.statusText))}return await n.json()}catch(e){throw console.error("Error fetching agent:",e),e}},c=async e=>{try{if(!await (0,o.Ej)("custom_agents"))throw Error("Custom agents is not enabled");let t=(0,r.U)(),{data:{session:a}}=await t.auth.getSession();if(!a)throw Error("You must be logged in to create an agent");let n=await fetch("".concat(s,"/agents"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a.access_token)},body:JSON.stringify(e)});if(!n.ok){let e=await n.json().catch(()=>({message:"Unknown error"}));throw Error(e.message||"HTTP ".concat(n.status,": ").concat(n.statusText))}return await n.json()}catch(e){throw console.error("Error creating agent:",e),e}},d=async(e,t)=>{try{if(!await (0,o.Ej)("custom_agents"))throw Error("Custom agents is not enabled");let a=(0,r.U)(),{data:{session:n}}=await a.auth.getSession();if(!n)throw Error("You must be logged in to update an agent");let l=await fetch("".concat(s,"/agents/").concat(e),{method:"PUT",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n.access_token)},body:JSON.stringify(t)});if(!l.ok){let e=await l.json().catch(()=>({message:"Unknown error"}));throw Error(e.message||"HTTP ".concat(l.status,": {response.statusText}"))}return await l.json()}catch(e){throw console.error("Error updating agent:",e),e}},u=async e=>{try{if(!await (0,o.Ej)("custom_agents"))throw Error("Custom agents is not enabled");let t=(0,r.U)(),{data:{session:a}}=await t.auth.getSession();if(!a)throw Error("You must be logged in to delete an agent");let n=await fetch("".concat(s,"/agents/").concat(e),{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a.access_token)}});if(!n.ok){let e=await n.json().catch(()=>({message:"Unknown error"}));throw Error(e.message||"HTTP ".concat(n.status,": ").concat(n.statusText))}}catch(e){throw console.error("Error deleting agent:",e),e}},p=async e=>{try{if(!await (0,o.Ej)("custom_agents"))throw Error("Custom agents is not enabled");let t=(0,r.U)(),{data:{session:a}}=await t.auth.getSession();if(!a)throw Error("You must be logged in to get thread agent");let l=await fetch("".concat(s,"/thread/").concat(e,"/agent"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a.access_token)}});if(!l.ok){let e=await l.json().catch(()=>({message:"Unknown error"}));throw Error(e.message||"HTTP ".concat(l.status,": ").concat(l.statusText))}let i=await l.json();return n.v.api.debug("[API] Fetched thread agent:",e),i}catch(e){throw e instanceof Error&&e.message.includes("Custom agents is not enabled")||n.v.api.error("Error fetching thread agent:",e),e}},g=async e=>{try{if(!await (0,o.Ej)("custom_agents"))throw Error("Custom agents is not enabled");let t=(0,r.U)(),{data:{session:a}}=await t.auth.getSession();if(!a)throw Error("You must be logged in to get agent builder chat history");let n=await fetch("".concat(s,"/agents/").concat(e,"/builder-chat-history"),{method:"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a.access_token)}});if(!n.ok){let e=await n.json().catch(()=>({message:"Unknown error"}));throw Error(e.message||"HTTP ".concat(n.status,": ").concat(n.statusText))}return await n.json()}catch(e){throw console.error("Error fetching agent builder chat history:",e),e}}},92981:(e,t,a)=>{a.d(t,{_:()=>n});var r=a(72509);let o=["agents"],n=(0,r.DY)({all:o,lists:()=>[...o,"list"],list:e=>[...o,"list",e],details:()=>[...o,"detail"],detail:e=>[...o,"detail",e],threadAgents:()=>[...o,"thread-agent"],threadAgent:e=>[...o,"thread-agent",e],builderChatHistory:e=>[...o,"builderChatHistory",e]})}}]);

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.