PageSourceSearch

https://studio.findem.ai/assets/AgentsGalleryHome-Dvlz5km-.js

js findem.ai collected 2026-10-02 05:22:07 UTC 25,120 bytes, 1 lines download raw bytes

1import{y as Ae,r as c,dN as Je,dO as en,dp as nn,dL as tn,dM as sn,cH as an,de as be,dA as rn,dB as on,dC as ln,dD as cn,dg as Ve,j as t,N as je,c7 as Ne,dq as dn,cX as un,B as Ce,dj as gn,aP as mn,z as ke,d2 as fn,d3 as pn,a as bn,d5 as yn,d6 as _n,d7 as xn,d8 as hn,ev as me,da as wn,au as j,ew as ne,ex as Cn,du as Ee,dv as An,ey as kn,dn as Sn,ez as De,eA as Pe,d0 as vn,g as $e,W as jn,eB as Ue,eC as Nn,eD as En,A as $n,eE as Te,P as Tn,b as In,dP as Rn,S as Ln,cB as Bn,dr as Fn}from"./index-_Ci2S7BU.js";import{h as de,m as Se,u as On}from"./publicContent-Bm19RnGY.js";import{a as Mn,G as He,S as Wn,b as Vn,c as Dn,P as Pn,d as Un,F as re,e as he,f as Hn,g as Gn,A as zn,h as qn,i as Yn}from"./agentGalleryPrimitives-DsHd4j54.js";import{g as Kn}from"./agentStarterRouting-I6QC6dD4.js";import{h as Ie}from"./featuredWorkflows-D01lsosc.js";import{m as Xn,h as Zn,o as Qn,n as Ge,D as Jn,b as et,q as nt,i as Re,a as ze,t as tt,C as st}from"./featuredDismissed-DDfJKnuI.js";import{p as Le}from"./publicUseCases-D16_vVFh.js";import{c as Be}from"./plgContentLinking-DF3M5Bq9.js";import{h as at,p as qe}from"./publicAgentExperts-C9D9Yqlg.js";import{t as rt,n as Fe,c as it,s as ot,d as lt,C as ct}from"./agentCardActions-BlThBMnD.js";import{c as dt}from"./serverWorkflowRun-CabnJYsl.js";import{b as ut}from"./agentsReturnTo-CNNdLGGY.js";import{a as gt,p as Oe,w as mt,i as X,c as Me,b as we,d as We,A as ft}from"./agentWorkflowCards-BFWhR6gJ.js";import{O as pt}from"./OrgBrandingDrawer-sznIwL2j.js";import{p as bt,e as yt,s as _t}from"./agentSpec-cLqtX-bw.js";import"./executiveConnect-CBL6Rw5D.js";import"./connectorsCatalog-BVQYoe69.js";import"./useConnectors-DXUOyH-C.js";import"./remoteConnector-DYZmzCR3.js";import"./oauthPopup-U7ZIp_nH.js";import"./plug-DvpotEx6.js";import"./globe-COMBE8-a.js";import"./publicImageUrl-DIujsnM9.js";import"./cronNext-CIXNkfgc.js";import"./runSummary-DyEksjly.js";import"./layers-BxgLEag7.js";import"./info-DLoEBYLG.js";function xt(a){const i=String(a?.kind||"").trim(),d=String(a?.id||"").trim();return i&&d?`${i}:${d}`:""}function ht(a){const i=[],d=String(a?.resource_id||a?._id||"").trim(),l=String(a?._featuredId||"").trim();return l&&i.push(`featured:${l}`),d&&i.push(`${a?._kind==="starter"?"starter":"workflow"}:${d}`),i}const wt=new Map([["succession planning","succession-planning"]]);function Ye(a,i){const d=new Set(ht(a)),l=i.findIndex(s=>d.has(xt(s?.agent_ref)));if(l>=0)return l;const g=Be(a?.resource_name);if(!g)return-1;const h=wt.get(g);if(h){const s=i.findIndex(m=>m?.slug===h);if(s>=0)return s}const p=i.map((s,m)=>({entry:s,index:m})).filter(({entry:s})=>s?.agent_ref?.kind!=="use_case"&&Be(s?.title)===g);return p.length===1?p[0].index:-1}function Ke(a){return a.filter(i=>de(i)||i?.audience?.kind==="org")}function Xe(a,i){return i?{...a,...i.availability==="coming_soon"?{_availability:"coming_soon"}:{},_publicEntry:i,_label:i.blurb||a?._label||i.card_badge||"Agent"}:a}function Ct(a,i,d){const l=Ke(i),g=l[Ye(a,l)];return Se(g,d)?Xe(a,g):null}function At(a=[],i=[],d){const l=Ke(Array.isArray(i)?i:[]).sort((s,m)=>(Number(s?.order)||100)-(Number(m?.order)||100)),g=(Array.isArray(a)?a:[]).map((s,m)=>{const y=Ye(s,l),w=y>=0?l[y]:null;return{shape:Xe(s,w),originalIndex:m,rank:y>=0&&de(w)?y:Number.POSITIVE_INFINITY,entryIndex:y}}),h=new Set(g.map(({entryIndex:s})=>s).filter(s=>s>=0)),p=l.flatMap((s,m)=>de(s)&&(s?.availability==="coming_soon"||s?.agent_ref?.kind==="use_case")&&!h.has(m)?[{shape:{resource_id:`${s.availability==="coming_soon"?"public-coming-soon":"public-use-case"}:${s.slug}`,resource_name:s.title,_kind:s.availability==="coming_soon"?"public-coming-soon":"public-use-case",_availability:s.availability==="coming_soon"?"coming_soon":"live",_label:s.blurb||s.card_badge||"Coming soon",_publicEntry:s},originalIndex:Number.MAX_SAFE_INTEGER,rank:m,entryIndex:m}]:[]);return[...g,...p].filter(({shape:s})=>Se(s._publicEntry,d)).sort((s,m)=>s.rank-m.rank||s.originalIndex-m.originalIndex).map(({shape:s})=>s)}function kt({onOpenPage:a,deleteScopedAgent:i=null,refreshManagedAgents:d=null,canConfigureOutputsFor:l=null,onConfigureOutputs:g=null,onEditTags:h=null,canEditTagsFor:p=null}={}){const{user:s,mcpScopeId:m,mcpScopeOrg:y,isOrgMcpScope:w,isFindemAdmin:$}=Ae(),[A,k]=c.useState(""),[S,G]=c.useState(null),[_,Z]=c.useState(null),[L,W]=c.useState(null),[N,z]=c.useState(null),[I,Q]=c.useState(!1),[T,J]=c.useState(""),C=c.useCallback((n,r="info")=>G(n?{text:n,tone:r}:null),[]),B=n=>n?.resource_id||n?._id||"",F=c.useMemo(()=>({studioEnrich:an,automation:sn,setStudioWorkflowLifecycle:tn,updateWorkflow:nn,cancelAgenticWorkflowCron:dt,setFeaturedDismissed:Xn,setDismissedFeatured:en,removeWorkflowWithTwins:Je,user:s,mcpScopeId:m,isOrgMcpScope:w}),[w,m,s]),O=c.useCallback(async n=>{const r=B(n);if(!(!r||A)){k(r);try{await rt(n,F)}catch(o){const x=Fe(n);C(`Couldn't ${x==="active"?"activate":"pause"}: ${o?.message||"error"}`,"warning")}finally{k("")}}}
1,[A,C,F]),V=c.useCallback(n=>{!n||A||Z({kind:"clone",shape:n})},[A]),D=c.useCallback(async n=>{const r=_?.shape,o=String(n||"").trim();if(!r||!o)throw new Error("Agent name is required.");const x=B(r);k(x);try{const K=await it({shape:r,name:o},{cloneUserAgent:Zn,addWorkflowConfirmed:rn,listWorkflows:be,user:s,isOrgMcpScope:w,mcpScopeOrg:y});K.kind==="agent"&&await d?.(),C(K.kind==="agent"?`Cloned “${r.resource_name}” as “${o}”.`:`Cloned “${r.resource_name}” as “${o}” — the copy is on-demand.`),Z(null)}finally{k("")}},[C,w,y,_,d,s]),M=c.useCallback(async(n,r)=>{try{const o=await ot(n,r,{setWorkflowVisibility:on});if(!o)return;const x=ln(cn(B(n)));C(`"${n?.resource_name||"Workflow"}" is now ${o}.${x?` ${x}`:""}`,x?"warning":"info")}catch(o){C(o?.message||"Could not change who can see this workflow.","warning"),Ve().catch(()=>{})}},[C]),P=c.useCallback((n,r)=>{const o=String(n?._visibility||"private");if(r==="featured"||o==="featured"){z({shape:n,visibility:r,from:o});return}M(n,r)},[M]),q=c.useCallback(async n=>{if(n?._featuredId)return;if(n?._kind==="agent"){const o=n?._agent?.record;if(!o?.resource_id||T)return;const x=o.resource_name||"Untitled agent";W({agent:{title:x},cloneAgent:o,displayTitle:x});return}const r=B(n);if(!(!r||A)){k(r);try{const{partial:o}=await lt(n,F);o&&C("Deleted here — the shared copy will finish clearing on the next sync.","warning")}catch(o){C(`Couldn't delete: ${o?.message||"error"}`,"warning")}finally{k("")}}},[A,C,T,F]),E=c.useCallback(async()=>{const n=L?.cloneAgent;if(!(!n?.resource_id||!i)){J(n.resource_id);try{await i(n),W(null),await d?.()}catch(r){C(`Failed to delete: ${r?.message||"unknown error"}`,"warning")}finally{J("")}}},[L,i,C,d]),U=c.useCallback(n=>Qn(n,{onToggle:Fe(n)==="paused"?O:null,onOpenPage:a,onClone:V,onConfigureOutputs:g,canConfigureOutputsFor:l,onSetVisibility:P,onDelete:q,onEditTags:h,canEditTagsFor:p,isAdmin:!!$}),[l,p,V,q,P,O,$,g,h,a]),H=c.useCallback(n=>{const r=B(n);return r?A===r||T===n?._agent?.record?.resource_id:!1},[A,T]),ie=c.useCallback(n=>{const r=U(n);return r.length?t.jsx(Ge,{items:r,busy:H(n)}):null},[H,U]),Y=S?t.jsx(je,{tone:S.tone==="warning"?"warning":"info",icon:S.tone==="warning"?t.jsx(Ne,{size:15}):null,children:S.text}):null,ee=t.jsxs(t.Fragment,{children:[t.jsx(dn,{open:!!_,title:"Clone agent",initialValue:_?`Copy of ${_.shape?.resource_name||"agent"}`:"",placeholder:"Agent name",submitLabel:"Create clone",onCancel:()=>{A||Z(null)},onSubmit:D}),t.jsx(Jn,{request:L,pending:!!T,onConfirm:E,onCancel:()=>{T||W(null)}}),N?t.jsx(un,{open:!0,onClose:I?void 0:()=>z(null),size:"md",title:N.visibility==="featured"?"Feature this agent for everyone?":"Remove this agent from everyone?",description:N.visibility==="featured"?`“${N.shape?.resource_name||"This agent"}” will appear under Findem agents for every user in every organization.`:`“${N.shape?.resource_name||"This agent"}” will stop appearing for everyone and become private to you.`,footer:t.jsxs(t.Fragment,{children:[t.jsx(Ce,{variant:"ghost",disabled:I,onClick:()=>z(null),children:"No, cancel"}),t.jsx(Ce,{variant:N.visibility==="featured"?"primary":"danger",loading:I,iconLeft:N.visibility==="featured"?t.jsx(gn,{size:15}):t.jsx(mn,{size:15}),onClick:async()=>{const n=N;Q(!0);try{await M(n.shape,n.visibility)}finally{Q(!1),z(null)}},children:N.visibility==="featured"?"Yes, feature it":"Yes, make it private"})]}),children:t.jsxs(je,{tone:"warning",icon:t.jsx(Ne,{size:15}),children:[t.jsx("span",{className:"font-semibold",children:"Admin action."})," ",N.visibility==="featured"?"Only Findem admins can feature an agent. Everyone will see the same published fixed price before a launch.":"Only Findem admins can un-feature an agent. Anyone relying on it will lose access to it from their board."]})}):null]});return{menuFor:ie,menuItemsFor:U,isBusy:H,dialogs:ee,toast:Y,flash:C}}const St="Workflow Builder",vt=["hm-intake-agent",_n,"key-exec-finder","findem-exec-list-builder"];function jt(a){const i=Array.isArray(a?.resource_tags)?a.resource_tags:[];return(i.includes("studio:user-built")||i.includes("studio-template:user-built"))&&(a?.resource_name||"")!==St}function fe(a){return a?._availability!=="coming_soon"||at(a?._publicEntry)}function Nt({shape:a,byline:i,onOpen:d,onRun:l,runnable:g,menu:h}){const p=a?._publicEntry,s=qe(p),m=s?.name_enabled&&s.name,y=p?.available_with_platform_license===!0,w=vn(p?.title||a?.resource_name||"Untitled agent"),$=[a?._label,a?._schedule].filter(
1Boolean).join(" · ")||"Agent",A=p?.blurb||$,k=a?._availability==="coming_soon";return t.jsxs("div",{className:`ae-menu-host group relative flex min-h-[162px] ${j.agentGalleryCard} ${a?._isNew?j.agentGalleryCardNew:""} ${j.agentGalleryCardHover}`,children:[d?t.jsx(Ce,{unstyled:!0,onClick:d,className:`absolute inset-0 z-0 rounded-[8px] ${j.focusRing}`,"aria-label":`Open ${w}`}):null,t.jsxs("div",{className:j.agentGalleryCardContent,children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("h3",{className:`line-clamp-2 ${j.cardTitle}`,children:w}),t.jsx("p",{className:`mt-[5px] line-clamp-3 ${j.cardBody}`,children:A})]}),t.jsx(Vn,{attribution:m?t.jsxs("div",{className:"flex min-w-0 items-center gap-[7px]",children:[s.portrait_enabled&&s.portrait?t.jsx("img",{src:s.portrait,alt:"",loading:"lazy",decoding:"async",className:"h-[32px] w-[32px] shrink-0 rounded-full object-cover"}):null,t.jsxs("span",{className:`truncate text-[14px] font-medium leading-[1.3] ${j.body}`,children:["By ",s.name]})]}):!k&&!y?t.jsx("span",{className:`block truncate ${j.meta}`,title:a?._ownerEmail||void 0,children:i||ze(a)||"shared"}):null,badge:k?t.jsx($e,{theme:"studio",tone:"warning",children:a?._publicEntry?.card_badge||"Coming soon"}):y?t.jsx(Pn,{}):a?._badge?t.jsx($e,{theme:"studio",tone:"brand",children:a._badge}):null,actions:t.jsxs(t.Fragment,{children:[g?t.jsx(Dn,{onClick:l,title:a?._runTitle}):null,h]})})]})]})}function Et(a,i,d=ne){const l=String(i||"").trim().toLowerCase();return(Array.isArray(a)?a:[]).filter(g=>De(g,d)&&(!l||[g?.resource_name,Pe(g),g?._label,g?._schedule,g?._ownerEmail,g?._publicEntry?.title,g?._publicEntry?.blurb,qe(g?._publicEntry)?.name].filter(Boolean).join(" ").toLowerCase().includes(l)))}function pe({title:a,note:i,shapes:d,byline:l,bylineFor:g,query:h,category:p=ne,onOpen:s,onRun:m,isRunnable:y,isOpenable:w,menuFor:$,emptyMessage:A}){const k=Et(d,h,p),S=!!String(h||"").trim(),G=!!p&&p!==ne;return t.jsxs(He,{children:[a?t.jsx(Wn,{title:a,note:i}):null,k.length?t.jsx("div",{className:"grid gap-[16px] sm:grid-cols-2",children:k.map(_=>t.jsx(Nt,{shape:_,byline:g?g(_):l,onOpen:w?.(_)===!1?void 0:()=>s(_),onRun:()=>m(_),runnable:y(_),menu:$?$(_):null},_?.resource_id||_?.resource_name))}):t.jsx("p",{className:j.cardBody,children:S?"No agents match that search.":G?`Nothing here under ${kn(p)}.`:A})]})}function $t({query:a,category:i=ne,refreshKey:d=0,view:l="mine",publicEntries:g=[],flat:h=!1,curated:p=!1}){const s=ke(),{user:m,mcpScopeOrg:y,mcpScopeLabel:w,isOrgMcpScope:$,mcpScopeId:A,hasStudioAgentAccess:k,canRunAgentWorkflows:S,canOpenAgentWorkflows:G,hasFraAccess:_,loadingOrgs:Z}=Ae(),{managedAgents:L,starterEntries:W,loadingAgents:N,deleteScopedAgent:z,refreshManagedAgents:I}=fn(),[Q,T]=c.useState([]),[J,C]=c.useState(!0),B=c.useRef(d);c.useEffect(()=>{B.current!==d&&(B.current=d,I())},[d,I]),c.useEffect(()=>{let e=!1;const u=()=>be().filter(b=>String(b?.status||"")!=="draft").map(Sn),f=()=>{e||T(u())};f();const v=pn(f);return Ve().catch(()=>{}).finally(()=>{f(),e||C(!1)}),()=>{e=!0,v()}},[d]);const F=!!S,[O,V]=c.useState([]),[D,M]=c.useState(!1);c.useEffect(()=>{if(!F){V([]),M(!1);return}const e=new AbortController;return M(!0),bn.listDefinitions({signal:e.signal}).then(u=>{e.signal.aborted||V(gt(u?.definitions))}).catch(()=>{}).finally(()=>{e.signal.aborted||M(!1)}),()=>e.abort()},[F,d]);const P=e=>F&&D?"Loading your agents…":e,q=m?.email||m?.local?.email||"",E=c.useMemo(()=>{const e=(Array.isArray(L)?L:[]).filter(jt).map(yn),u=new Set,f=[];for(const v of[...Oe(mt(Q,O),O),...e]){const b=v?._featuredId;if(b){if(u.has(b))continue;u.add(b)}f.push(v)}return{...et(f,{viewerEmail:q}),all:f}},[O,L,q,Q]),U=c.useMemo(()=>l==="shared"?E.all.filter(nt):E.org,[E,l]),H=$&&w?w:"your organization",ie=String(q||"").trim().toLowerCase(),Y=e=>{const u=String(e?._ownerEmail||"").trim().toLowerCase();return!u||u===ie},ee=e=>Y(e)?"By you":`By ${ze(e)||"a teammate"}`,n=e=>tt(e)==="org"?`By you · ${Cn("org").label}`:"By you",r=c.useMemo(()=>vt.map(e=>({def:xn.find(u=>u.id===e),entry:(Array.isArray(W)?W:[]).find(u=>u?.starterId===e)||null})).filter(({def:e})=>!!e).filter(({def:e,entry:u})=>hn(e,m,{mcpScopeOrg:y,agentResource:u?.existingAgent||null})),[y,W,m]),o=l==="home"||l==="findem",x=c.useMemo(()=>{const e=E.findem.filter(b=>!X(b)),u=[...At([...e.filter(b=>!me(b)),...r.map(({def:b,entry:Qe})=>wn(b,Qe))],g,y?.mcp_org_id),...e.filter(b=>me(b)).map(b=>
1Ct(b,g,y?.mcp_org_id)).filter(Boolean)],f=E.all.filter(X),v=new Set([...f.filter(Re),...Me(u,f)]);return Oe(u,f.filter(b=>v.has(b)))},[r,y?.mcp_org_id,E.all,E.findem,g]),K=c.useMemo(()=>new Set(o?x.filter(e=>X(e)&&!Re(e)):[]),[x,o]),te=e=>K.size?e.filter(u=>!K.has(u)):e,se=e=>{const u=new Set(Me(e,e.filter(X))),f=e.filter(v=>v?._isNew&&!u.has(v));return f.length?[...f,...e.filter(v=>!f.includes(v))]:e},R=ut(l==="shared"?"shared":l==="mine"?"apps":l==="findem"?"findem":"home"),ve=e=>{const u=Kn(e?._agent?.template,e?._agent?.entry,{returnTo:R});return s(u||"/agents/board")},ae=e=>{if(!fe(e))return;if(e?._availability==="coming_soon"||e?._kind==="public-use-case"){const f=String(e?._publicEntry?.slug||"").trim();return f?s(`/agents/explore/${encodeURIComponent(f)}`):void 0}if(e?._kind==="starter")return ve(e);if(X(e))return s(G?we(e,{returnTo:R}):We(e,{returnTo:R}));const u=e?.resource_id||e?._id;return s(u?`/agents/${encodeURIComponent(u)}?return_to=${encodeURIComponent(R)}`:"/agents/board")},oe=e=>{if(e?._kind==="public-use-case"){const f=Le(e._publicEntry);return f?s(f):void 0}if(me(e))return s(`/agents/workflow/${encodeURIComponent(e.resource_id)}`);if(e?._kind==="starter")return ve(e);if(X(e))return s(We(e,{returnTo:R}));if(e?._kind==="agent"){const f=e._agent?.record;if(!Ee(f).flow_stamped)return;const v=An({agentName:f.resource_name||"",starterId:"research-agent",agentId:f.resource_id}),b=v.includes("?")?"&":"?";s(`${v}${b}greet=1&return_to=${encodeURIComponent(R)}`);return}const u=e?.resource_id||e?._id;u&&(Ie(be().find(f=>f.id===u)),s(`/agents/discovery/new?flow_id=${encodeURIComponent(u)}&return_to=${encodeURIComponent(R)}`))},le=e=>{if(me(e))return!!(k&&_&&!Z);if(e?._availability==="coming_soon")return!1;if(e?._kind==="public-use-case")return!!Le(e._publicEntry);if(e?._kind==="starter"){const b=e?._agent?.template;return!!(b&&!b.comingSoon&&b.id!=="fia-slack")}if(e?._kind==="agent")return!!Ee(e._agent?.record).flow_stamped;if(X(e))return!0;if(e?._kind!=="agentic"||String(e?._spec?.action?.kind||"").toLowerCase()==="nurture")return!1;const u=e?.resource_id||e?._id,f=u?be().find(b=>b.id===u):null,v=f?Ie(f,{persist:!1}):null;return Array.isArray(v?.spec?.steps)&&v.spec.steps.length>0},ce=kt({onOpenPage:ae,deleteScopedAgent:z,refreshManagedAgents:I,onEditTags:e=>{const u=String(e?.resource_id||e?._id||"");u&&s(`/agents/${encodeURIComponent(u)}/configure`)},canEditTagsFor:e=>Y(e)}),ue=e=>{const f=e?._kind&&!["starter","public-coming-soon","public-use-case","solution-skill",ft].includes(e._kind)?ce.menuItemsFor(e):[...fe(e)?[{key:"open",label:"Open agent",onClick:()=>ae(e)}]:[],...le(e)?[{key:"run",label:"Run agent",onClick:()=>oe(e)}]:[],...X(e)&&e._canEdit?[{key:"configure",label:"Configure",onClick:()=>s(we(e,{tab:"definition",returnTo:R}))},{key:"versions",label:"Versions",onClick:()=>s(we(e,{tab:"versions",returnTo:R}))}]:[]];return t.jsx(Ge,{items:f,busy:ce.isBusy(e),trigger:t.jsx(Mn,{name:e?._publicEntry?.title||e.resource_name,disabled:ce.isBusy(e)})})},Ze=J||N,_e=l==="home"||l==="findem",ge=l==="home"||l==="shared",xe=l==="home"||l==="mine";return t.jsxs("div",{className:"flex flex-col gap-10",children:[ce.toast,Ze?t.jsx("p",{className:j.cardBody,children:"Loading your agents…"}):h?t.jsx(pe,{shapes:[..._e?x.filter(e=>!p||i!==ne||de(e._publicEntry)):[],...ge&&!p?se(te(U)):[],...xe&&!p?se(te(E.mine)):[]],bylineFor:e=>E.mine.includes(e)?n(e):U.includes(e)?ee(e):"By Findem",query:a,category:i,onOpen:ae,onRun:oe,isRunnable:le,isOpenable:fe,menuFor:ue,emptyMessage:P(l==="mine"?"Nothing here yet — New agent builds your first one.":"No agents are available in this view yet.")}):t.jsxs(t.Fragment,{children:[_e?t.jsx(pe,{title:"Findem Agents",shapes:x,bylineFor:e=>K.has(e)?Y(e)?n(e):ee(e):"By Findem",query:a,category:i,onOpen:ae,onRun:oe,isRunnable:le,isOpenable:fe,menuFor:ue,emptyMessage:"No Findem agents are available for this organization yet."}):null,_e&&ge?t.jsx("hr",{className:j.divider}):null,ge?t.jsx(pe,{title:"Org Agents",note:l==="shared"?`Everything shared with ${H}, including agents you shared.`:`Shared by teammates in ${H}.`,shapes:se(te(U)),bylineFor:ee,query:a,category:i,onOpen:ae,onRun:oe,isRunnable:le,menuFor:ue,emptyMessage:P($?`No agents have been shared with ${H}
1 yet.`:"You are in your personal workspace. Switch to an organization to see the agents shared there.")}):null,ge&&xe?t.jsx("hr",{className:j.divider}):null,xe?t.jsx(pe,{title:"My Agents",shapes:se(te(E.mine)),bylineFor:n,query:a,category:i,onOpen:ae,onRun:oe,isRunnable:le,menuFor:ue,emptyMessage:P("Nothing here yet — Create agent builds your first one.")}):null]}),ce.dialogs]})}function Tt({activeId:a,signedIn:i,onSelect:d}){const l=ke(),g=[{id:"home",label:"Explore"},...i?[{id:"apps",label:"My Agents"}]:[]],h=d||(p=>l(p==="apps"?"/agents?tab=apps":"/agents"));return t.jsx(jn,{theme:"studio",variant:"compact",items:g,activeId:a,onChange:h,ariaLabel:"Browse agents"})}function It({title:a,activeId:i,signedIn:d,onSelect:l,actions:g=null}){return t.jsxs("header",{"data-agent-browse-header":!0,className:"flex flex-col gap-[24px]",style:Ue,children:[t.jsx(Un,{title:a}),d?t.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-x-6 gap-y-4",children:[t.jsx(Tt,{activeId:i,signedIn:d,onSelect:l}),g]}):null]})}const Rt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.6562%207.34375H10V5.34375H8.65625V10.6562H10V8.65625H14.6562V14H10V12H7.34375V5.34375H6V7.34375H1.34375V2H6V4H10V2H14.6562V7.34375Z'%20fill='%2319213D'/%3e%3c/svg%3e",Lt="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M4.28125%2014L3.34375%2013.0625L6.5625%209.84375C7.08333%209.32292%207.34375%208.69792%207.34375%207.96875V4.5625L6.28125%205.59375L5.34375%204.65625L8%202L10.6562%204.65625L9.71875%205.59375L8.65625%204.5625V7.96875C8.65625%208.69792%208.91667%209.32292%209.4375%209.84375L12.6562%2013.0625L11.7188%2014L8%2010.2812L4.28125%2014Z'%20fill='%2319213D'/%3e%3c/svg%3e";function ds({entries:a}){const i=ke(),{user:d,isMcpOrgAdmin:l,mcpScopeLabel:g}=Ae(),h=!!d,p=Nn(En(d))||ne,[s,m]=$n(),y=s.get("tab"),w=h&&(y==="findem"||y==="shared"||y==="apps")?y:"home",$=c.useCallback(n=>{m(r=>{const o=new URLSearchParams(r);return n==="findem"||n==="shared"||n==="apps"?o.set("tab",n):o.delete("tab"),o},{replace:!0})},[m]),A=s.get("category"),k=w==="home",S=Te(A)?A:k&&(!A||A===re)?re:ne,G=c.useCallback(n=>{m(r=>{const o=new URLSearchParams(r);return Te(n)?o.set("category",n):o.delete("category"),o},{replace:!0})},[m]),[_,Z]=c.useState(""),L=c.useRef(null),[W,N]=c.useState(!1),[z,I]=c.useState(!1),[Q,T]=c.useState(!1),[J,C]=c.useState(""),[B,F]=c.useState(0),O=On({enabled:!Array.isArray(a)}),V=Array.isArray(a)?a:O.entries,D=O.site;c.useEffect(()=>{const n=document.title,r=document.querySelector('meta[name="description"]'),o=r?.getAttribute("content");return document.title=D.agents_home_seo_title,r?.setAttribute("content",D.agents_home_seo_description),()=>{document.title=n,r&&o!=null&&r.setAttribute("content",o)}},[D.agents_home_seo_description,D.agents_home_seo_title]);const M=c.useMemo(()=>V.filter(n=>de(n)&&Se(n)),[V]),P=c.useMemo(()=>M.filter(n=>{const r={...n,description:n.blurb},o=_.trim().toLowerCase();return(S===re||De(r,S))&&(!o||`${n.title} ${Pe(n)} ${n.blurb} ${n.expert?.name||""}`.toLowerCase().includes(o))}),[M,S,_]);function q(n){G(n),L.current?.scrollIntoView({block:"start"})}c.useEffect(()=>{s.get("branding")==="1"&&(l&&I(!0),m(n=>{const r=new URLSearchParams(n);return r.delete("branding"),r},{replace:!0}))},[l,s,m]);function E(){return N(!0)}function U(){return T(!0)}function H(){return i("/agents/board?action=combine")}async function ie(n,r){const o=bt(n,{...yt(),objective:String(r||"").trim()}),{spec:x,cron:K,schedule:te,tags:se}=_t(o),ye={id:`wf_${Date.now().toString(36)}`,name:x.name,kind:"agentic",spec:x,cron:K,schedule:te,status:"draft",connector_ids:[],owner_email:d?.email||"",runs:[],tags:Bn(se)},R=await Fn(ye);T(!1),i(`/agents/${R?.id||ye.id}/configure`)}function Y(n,r=4e3){C(n),setTimeout(()=>C(""),r)}async function ee(n){const r=`${window.location.origin}/agents/explore/${n.slug}`;try{await navigator.clipboard.writeText(r),Y("Link copied");return}catch{}const o=document.createElement("textarea");o.value=r,o.setAttribute("readonly",""),o.style.position="fixed",o.style.top="-1000px",o.style.opacity="0",document.body.appendChild(o),o.select();let x=!1;try{x=document.execCommand("copy")}catch{x=!1}document.body.removeChild(o),Y(x?"Link copied":r,x?4e3:1e4)}return t.jsxs("div",{className:`flex h-full min-h-0 flex-1 flex-col ${j.galleryCanvas}`,style:Ue,children:[t.jsx("main",{className:"flex-1 overflow-y-auto",children:t.jsx(Tn,{className:"w-full !py-[40px]",children:t.jsx(In,{children:t.jsxs("div",{className:"flex flex-col gap-[40px]",children:[t.jsx(It,{title:D.agents_home_title,activeId:w==="apps"?"apps":"home",signedIn:h,onSelect:$,actions:h?t.jsxs("div",{className:"flex shrink-0 items-center gap-[4px]",children:[l?t.jsx(he,{label:"Org branding",icon:t.jsx(Rn,{size:16,"aria-hidden":"true"}),onClick:()=>I(!0)}):null,t.jsx(he,{label:"Build workflow",asset:Rt,onClick:U}),t.jsx(he,{label:"Combine agents",asset:Lt,onClick:H}),t.jsx(Hn,{variant:"primary",onClick:E,title:"Create a chat agent over Findem MCPs",className:j.galleryPrimaryAction,children:"New agent"})]}):null}),t.jsx("hr",{className:j.divider}),t.jsxs("div",{ref:L,className:"flex flex-col gap-[40px] py-[10px] sm:px-[10px]",children:[t.jsxs("div",{className:"flex flex-col gap-[20px]",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx(Gn,{active:S,onSelect:G,curated:k}
1),t.jsx(zn,{collapsible:!0,value:_,onChange:Z,expandedWidth:"w-full sm:w-[220px]",inputClassName:"!h-[40px]",className:"ml-auto"})]}),O.status==="loading"&&!Array.isArray(a)?t.jsx("div",{className:"flex min-h-36 items-center justify-center",children:t.jsx(Ln,{label:"Loading featured agents…"})}):h?t.jsx($t,{query:_,category:S===re?p:S,curated:S===re,flat:!0,refreshKey:B,view:w==="home"?"home":w==="findem"?"findem":w==="shared"?"shared":"mine",publicEntries:V}):t.jsx(He,{children:P.length?t.jsx("div",{className:"grid gap-[16px] sm:grid-cols-2",children:P.map(n=>t.jsx(qn,{entry:n,onOpen:()=>i(`/agents/explore/${n.slug}`),onShare:()=>ee(n)},n.slug))}):t.jsx("p",{className:j.cardBody,children:"No agents match that search."})})]}),k&&S===re&&!_.trim()?t.jsx(Yn,{onSelect:q}):null]})]})})})}),J?t.jsx("div",{role:"status",className:"pointer-events-none fixed bottom-6 left-1/2 z-50 -translate-x-1/2 rounded-[8px] bg-ink px-4 py-2.5 text-[12px] font-medium leading-[1.3] text-white shadow-[0_2px_4px_0_rgba(25,33,61,0.08)]",children:J}):null,t.jsx(pt,{open:z,onClose:()=>I(!1),orgName:g||"this organization"}),t.jsx(st,{open:W,onClose:()=>N(!1),onCreated:n=>{N(!1),F(r=>r+1),$("apps"),C(n?.mode==="edit"?`"${n?.name||"Agent"}" updated.`:`"${n?.name||"Unnamed"}" ready — open it from My agents to chat.`),setTimeout(()=>C(""),8e3)}}),t.jsx(ct,{open:Q,mode:"create",onClose:()=>T(!1),onAccept:ie})]})}export{ds 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.