local-operator-ui 0.52.11 → 0.52.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/renderer/assets/{agent-details-page-C4oCk21c.js → agent-details-page-CU0scOGo.js} +1 -1
- package/out/renderer/assets/agent-hub-page-CXqP5D9l.js +7 -0
- package/out/renderer/assets/{agents-page-toXl8pfs.js → agents-page-CITewnbE.js} +3 -3
- package/out/renderer/assets/{avatar-cropper-wEzypmaV.js → avatar-cropper-BTe4ms8a.js} +1 -1
- package/out/renderer/assets/{browser-page-BJll-v6M.js → browser-page-B2NihKE2.js} +1 -1
- package/out/renderer/assets/{browser-webauthn-prompt-DX-krr6M.js → browser-webauthn-prompt-DPvR_HeR.js} +1 -1
- package/out/renderer/assets/{index-pMTS3oie.js → index-YSSL7S4C.js} +169 -169
- package/out/renderer/assets/legacy-agents-page-B3jSUdUx.js +33 -0
- package/out/renderer/assets/{library-page-D2MSJ5A6.js → library-page-DC8NBFTZ.js} +3 -3
- package/out/renderer/assets/{mesh-page-CPO1LXi3.js → mesh-page-CCY0Naxa.js} +1 -1
- package/out/renderer/assets/{notifications-page-CqHFCzoU.js → notifications-page-BSqhGl7W.js} +1 -1
- package/out/renderer/assets/{org-access-DyOMNAaw.js → org-access--CXw9Sdw.js} +1 -1
- package/out/renderer/assets/{projects-page-DRXPAga4.js → projects-page-BpGLh1A1.js} +1 -1
- package/out/renderer/assets/{publication-validation-BEX2np1n.js → publication-validation-BAG4HOS-.js} +1 -1
- package/out/renderer/assets/{radient-auth-buttons-C40vAVKg.js → radient-auth-buttons-3mMNLcWm.js} +1 -1
- package/out/renderer/assets/{schedules-page-DF8PppU-.js → schedules-page-87bqQvXm.js} +1 -1
- package/out/renderer/assets/{settings-page-_YzmWLbj.js → settings-page-PYRjAvWm.js} +1 -1
- package/out/renderer/assets/{smartart-z5X1u-Zt.js → smartart-DSxL1H0h.js} +1 -1
- package/out/renderer/assets/{team-bridge-page-CAAyokMk.js → team-bridge-page-DKg851BV.js} +1 -1
- package/out/renderer/assets/{team-bridge-scope-preference-FHT2Cz3y.js → team-bridge-scope-preference-C-xErBix.js} +1 -1
- package/out/renderer/assets/{use-download-agent-mutation-CZvId8pP.js → use-download-agent-mutation-DsOHpNRz.js} +1 -1
- package/out/renderer/index.html +1 -1
- package/package.json +1 -1
- package/out/renderer/assets/agent-hub-page-V5bqcQP3.js +0 -7
- package/out/renderer/assets/legacy-agents-page-BM865DWw.js +0 -33
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import{r,j as e,c as z}from"./index-DbYAjJtZ.js";import{P as Ct}from"./page-header-pza-RCSF.js";import{c as oe,u as L,D as et,b as tt,B as P,d as at,e as F,J as st,S as nt,w as B,K as it,k as St,a6 as je,L as de,i as lt,X as ot,a7 as It,a8 as Dt,a9 as Lt,A as _e,q as Se,x as ue,R as Pt,U as Et,V as Tt,W as Ot,Y as Ie,h as qt,aa as Ut,Z as Rt,ab as zt,v as Mt}from"./error-boundary-CpC5mJlj.js";import{bs as $t,bt as Ee,bu as Te,bv as Bt,bw as Fe,bx as Ht,by as Vt,a as rt,bz as ne,bA as le,bB as Wt,bC as Kt,bD as Qt,bE as Gt,bF as De,bG as Ft,bl as Yt,bH as Jt,v as qe,bI as ct,Q as Zt,b1 as Xt,t as At,a$ as ea,b2 as ta,bJ as ut,bK as aa,bL as dt,aZ as sa,bM as na,bN as Ye}from"./index-YSSL7S4C.js";import{cA as mt,cB as pt,bw as ia,c4 as la,cC as oa,b4 as Ue,b5 as Z,bv as gt,ay as ra,cD as ca,aF as me,ad as ua,bz as ie,bA as ye,aU as ht,c5 as da,cE as ma,by as pa,c7 as Oe,c9 as ga,cr as ha,T as xa,bu as xt,cF as ba,a1 as fa}from"./conversation-input-sync-BxH_-j4i.js";import{h as bt,u as ft,ab as _a,al as ya,ar as ja,as as ka,s as Re,a as va,c as wa,t as Na,g as Ca,G as Sa,y as _t}from"./appearance-D9ltCB_v.js";import{t as a}from"./messages-BOFOVo9w.js";import{A as Ia}from"./agents-page-CITewnbE.js";import{N as Da}from"./notebook-pen-D18NYo9D.js";import{n as Le,z as La,A as Pa,H as Ea,p as Ta}from"./org-access--CXw9Sdw.js";import{o as Oa,a as qa}from"./org-surface-gate-CaRcKcSt.js";import{R as Je}from"./radient-auth-buttons-3mMNLcWm.js";import{c as Ua,i as Ra,d as za,e as Ma,t as $a,p as Ze,P as Xe}from"./publication-validation-BAG4HOS-.js";import"./console-mirror--tzRIcEs.js";import"./roles-D1pcbxAx.js";import"./avatar-cropper-BTe4ms8a.js";import"./log-in-B0SnHGej.js";import"./project-markdown-Fk51EUtB.js";/**
|
|
2
|
+
* @license lucide-react v0.507.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Ba=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],Ha=oe("ellipsis-vertical",Ba);/**
|
|
7
|
+
* @license lucide-react v0.507.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Va=[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]],Ae=oe("file-input",Va);/**
|
|
12
|
+
* @license lucide-react v0.507.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const Wa=[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]],Ka=oe("file-output",Wa);/**
|
|
17
|
+
* @license lucide-react v0.507.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const Qa=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],Ga=oe("git-branch",Qa);/**
|
|
22
|
+
* @license lucide-react v0.507.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const Fa=[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]],Ya=oe("id-card",Fa);/**
|
|
27
|
+
* @license lucide-react v0.507.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const Ja=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]],Za=oe("import",Ja),Xa=({agentId:t,agentName:n,onAgentDeleted:s,buttonSx:l={},isAgentsPage:i=!1,onViewAgentSettings:c,onChatWithAgent:u,onExportAgent:x,onClearConversation:h,onUploadAgentToHub:y})=>{L();const[b,k]=r.useState(!1),[o,d]=r.useState(!1),[m,_]=r.useState(!1),v=r.useRef(!1),D=$t(),{clearAgentFromAllPages:S}=mt(),q=async()=>{try{await D.mutateAsync(t),S(t),s?.(t)}catch(C){console.error("Failed to delete agent:",C)}finally{d(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(et,{open:b,onOpenChange:k,modal:!1,children:[e.jsx(tt,{asChild:!0,children:e.jsx(P,{variant:"ghost",size:"icon-sm","aria-label":a("ui.agents.dialogs.menu.accessible"),"data-tour-tag":"agent-options-button",onClick:C=>{C.stopPropagation(),C.detail===0&&k(E=>!E)},style:l,children:e.jsx(Ha,{"aria-hidden":"true"})})}),e.jsxs(at,{align:"end",className:"min-w-45",onClick:C=>C.stopPropagation(),onInteractOutside:C=>{const E=C.detail.originalEvent.target;E instanceof Element&&E.closest(".shepherd-element")&&C.preventDefault()},onCloseAutoFocus:C=>{v.current&&(v.current=!1,C.preventDefault())},children:[i&&u&&e.jsxs(F,{onSelect:u,children:[e.jsx(pt,{"aria-hidden":"true"}),e.jsx("span",{children:a("ui.agents.dialogs.menu.chat")})]}),!i&&c&&e.jsxs(F,{"data-tour-tag":"view-agent-settings-menu-item",onSelect:c,children:[e.jsx(Ee,{"aria-hidden":"true"}),e.jsx("span",{children:a("ui.agents.dialogs.menu.settings")})]}),x&&e.jsxs(F,{onSelect:x,children:[e.jsx(Ka,{"aria-hidden":"true"}),e.jsx("span",{children:a("ui.agents.dialogs.menu.export")})]}),y&&e.jsxs(F,{"data-tour-tag":"upload-to-hub-menu-item",onSelect:y,children:[e.jsx(Te,{"aria-hidden":"true"}),e.jsx("span",{children:a("ui.agents.dialogs.menu.upload")})]}),h&&e.jsxs(F,{className:"text-warning data-[highlighted]:bg-warning-wash",onSelect:()=>{v.current=!0,_(!0)},children:[e.jsx(Bt,{"aria-hidden":"true"}),e.jsx("span",{children:a("ui.agents.dialogs.menu.clear")})]}),e.jsxs(F,{destructive:!0,onSelect:()=>{v.current=!0,d(!0)},children:[e.jsx(ia,{"aria-hidden":"true"}),e.jsx("span",{children:a("ui.agents.dialogs.menu.delete")})]})]})]}),e.jsx(Fe,{open:o,title:a("ui.agents.dialogs.delete.title"),message:e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-body text-ink",children:a("ui.agents.dialogs.delete.question",{name:n})}),e.jsx("p",{className:"mt-2 text-body-sm text-ink-muted",children:a("ui.agents.dialogs.delete.warning")})]}),confirmText:a("ui.agents.dialogs.delete.confirm"),cancelText:a("ui.agents.dialogs.delete.cancel"),isDangerous:!0,onConfirm:q,onCancel:()=>d(!1)}),e.jsx(Fe,{open:m,title:a("ui.agents.dialogs.clear.title"),message:a("ui.agents.dialogs.clear.warning"),confirmText:a("ui.agents.dialogs.clear.confirm"),cancelText:a("ui.agents.dialogs.clear.cancel"),isDangerous:!0,onConfirm:()=>{h?.(),_(!1)},onCancel:()=>_(!1)})]})},Aa=({page:t,count:n,onChange:s})=>{L();const l=()=>{t>1&&s(t-1)},i=()=>{t<n&&s(t+1)};return n<=1?null:e.jsxs("div",{className:"sticky bottom-0 left-0 right-0 z-10 flex min-h-13 items-center justify-between border-t border-hairline bg-surface px-4 py-2",children:[e.jsx(P,{variant:"ghost",size:"icon-sm",onClick:l,disabled:t<=1,"aria-label":a("ui.common.forms.compact_pagination.previous_page"),children:e.jsx(la,{})}),e.jsx("span",{className:"select-none text-meta text-ink-dim",children:a("ui.common.forms.pagination.position",{page:String(t),count:String(n)})}),e.jsx(P,{variant:"ghost",size:"icon-sm",onClick:i,disabled:t>=n,"aria-label":a("ui.common.forms.compact_pagination.next_page"),children:e.jsx(st,{})})]})},yt=t=>["agent-system-prompt",t],jt=t=>{const{shouldEnableQuery:n}=oa();return bt({enabled:n({bypassInternetCheck:!0})&&!!t,queryKey:yt(t),queryFn:async()=>{try{const l=await Ue(Z.baseUrl).agents.getAgentSystemPrompt(t);if(l.status>=400)throw new Error(l.message||a("ui.common.errors.agent_prompt_fetch"));return l.result?.system_prompt||""}catch(s){const l=s instanceof Error?s.message:a("ui.common.errors.agent_prompt_fetch_unknown");throw me(l),s}},refetchOnWindowFocus:!1,staleTime:5e3})},es=t=>{const n=ft(),s=Ue(Z.baseUrl);return gt({mutationFn:async l=>{const i=ca(l);if(i)throw me(i),new Error(i);try{const c=await s.agents.updateAgentSystemPrompt(t,l);if(c.status>=400)throw new Error(c.message||a("ui.common.errors.agent_prompt_update_simple"));return c}catch(c){const u=c instanceof Error?c.message:a("ui.common.errors.agent_prompt_update_unknown");throw me(u),c}},onSuccess:async()=>{await n.invalidateQueries({queryKey:yt(t)}),ra(a("ui.notices.agents.system_prompt_updated"))},onError:l=>{console.error("Error updating agent system prompt:",l)}})},ts=()=>{const[t,n]=ua(),s=_a(),l=()=>{const c=t.get("page");return c?Number.parseInt(c,10):1},i=c=>{const u=new URLSearchParams(t);c===1?u.delete("page"):u.set("page",c.toString()),n(u)};return{page:l(),setPage:i,isView:c=>s.pathname.startsWith(`/${c}`)}},as=({open:t,onClose:n,onAgentImported:s})=>{L();const[l,i]=r.useState(null),[c,u]=r.useState(!1),[x,h]=r.useState(null),y=r.useRef(null),b=Ht(),k=r.useCallback(g=>{g.preventDefault(),g.stopPropagation(),u(!0)},[]),o=r.useCallback(g=>{g.preventDefault(),g.stopPropagation(),u(!1)},[]),d=r.useCallback(g=>{g.preventDefault(),g.stopPropagation()},[]),m=r.useCallback(g=>g.name.toLowerCase().endsWith(".zip")?(h(null),!0):(h("ui.agents.dialogs.import.invalid_zip"),!1),[]),_=r.useCallback(g=>{if(g.preventDefault(),g.stopPropagation(),u(!1),g.dataTransfer.files&&g.dataTransfer.files.length>0){const I=g.dataTransfer.files[0];m(I)&&i(I)}},[m]),v=r.useCallback(g=>{if(g.target.files&&g.target.files.length>0){const I=g.target.files[0];m(I)&&i(I)}},[m]),D=r.useCallback(()=>{y.current?.click()},[]),S=async()=>{if(l)try{const g=await b.mutateAsync(l);i(null),h(null),s&&g&&s(g.id),n()}catch(g){console.error("Failed to import agent:",g)}},q=()=>{i(null),h(null),n()},C=b.isPending,E=C||!l,O=e.jsxs(e.Fragment,{children:[e.jsx(Ae,{size:19,className:"text-accent","aria-hidden":"true"}),a("ui.agents.dialogs.import.title")]}),f=e.jsxs(e.Fragment,{children:[e.jsx(ie,{onClick:q,disabled:C,children:a("ui.agents.dialogs.import.cancel")}),e.jsx(ye,{onClick:S,disabled:E,startIcon:C?e.jsx(nt,{}):null,children:a("ui.agents.dialogs.import.submit")})]});return e.jsxs(ht,{open:t,onClose:q,title:O,actions:f,maxWidth:"sm",children:[e.jsx("p",{className:"mb-4 text-body-sm text-ink-muted",children:a("ui.agents.dialogs.import.intro")}),e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsx("input",{ref:y,type:"file",accept:".zip",onChange:v,disabled:C,className:"hidden"}),e.jsx("button",{type:"button",onClick:D,onDragEnter:k,onDragLeave:o,onDragOver:d,onDrop:_,disabled:C,className:z("cursor-pointer rounded-lg border-2 border-control border-dashed bg-surface p-4 text-center","transition-colors duration-base ease-out-quart","hover:bg-accent-wash","disabled:border-hairline disabled:bg-sunken disabled:text-ink-disabled",c&&"border-accent bg-accent-wash"),children:l?e.jsxs(e.Fragment,{children:[e.jsx(Ae,{size:32,className:"mx-auto mb-2 text-ink-muted","aria-hidden":"true"}),e.jsx("p",{className:"text-body text-ink",children:l.name}),e.jsx("p",{className:"text-body-sm text-ink-muted",children:a("ui.agents.dialogs.import.replace_file")})]}):e.jsxs(e.Fragment,{children:[e.jsx(Vt,{size:32,className:"mx-auto mb-2 text-ink-muted","aria-hidden":"true"}),e.jsx("p",{className:"text-body text-ink",children:a("ui.agents.dialogs.import.drop_file")}),e.jsx("p",{className:"text-body-sm text-ink-muted",children:a("ui.agents.dialogs.import.choose_file")})]})}),x&&e.jsx("p",{role:"alert",className:"text-body-sm text-danger",children:a(x)})]})]})},ss=({title:t,searchQuery:n,onSearchChange:s,onNewAgentClick:l,searchPlaceholder:i=a("ui.common.layout.sidebar_header.search_agents"),newAgentTooltip:c=a("ui.common.layout.sidebar_header.create_a_new_agent"),onImportAgentClick:u,importAgentTooltip:x=a("ui.common.layout.sidebar_header.import_an_agent_from_a_zip_file")})=>(L(),e.jsxs("div",{className:"p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[e.jsx("h2",{className:"truncate text-heading text-ink",children:t}),e.jsxs("div",{className:"flex shrink-0 gap-1",children:[u&&e.jsx(B,{content:x,children:e.jsx(P,{variant:"ghost",size:"icon",onClick:u,"aria-label":a("ui.common.layout.sidebar_header.import_agent"),children:e.jsx(Za,{"aria-hidden":"true"})})}),e.jsx(B,{content:c,children:e.jsx(P,{variant:"primary",size:"icon",onClick:l,"aria-label":a("ui.common.layout.sidebar_header.new_agent"),"data-tour-tag":"create-new-agent-button",children:e.jsx(rt,{"aria-hidden":"true"})})})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(da,{size:16,"aria-hidden":"true",className:"pointer-events-none absolute top-1/2 start-3 -translate-y-1/2 text-ink-dim"}),e.jsx(it,{type:"search",inputSize:"lg",placeholder:i,value:n,onChange:h=>s(h.target.value),"aria-label":i,className:"ps-9"})]})]})),w={temperature:.2,top_p:.9,top_k:40,max_tokens:4096,frequency_penalty:0,presence_penalty:0,seed:42},G=({label:t,description:n,defaultLabel:s,onSet:l})=>(L(),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-body-sm text-ink",children:t}),e.jsx("span",{className:"text-meta text-ink-dim",children:a("ui.agents.settings.chat.not_set_yet")})]}),e.jsx("p",{className:"mt-1 text-meta text-ink-dim",children:n})]}),e.jsx(P,{variant:"secondary",size:"sm",className:"shrink-0",onClick:l,children:a("ui.agents.settings.chat.set_to_default",{value:String(s)})})]})),Pe=({title:t,children:n})=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("h3",{className:"text-body-sm font-semibold text-ink-muted",children:t}),n]}),ns=({selectedAgent:t,savingField:n,setSavingField:s,updateAgentMutation:l,refetchAgent:i,initialSelectedAgentId:c})=>{L();const[u,x]=r.useState(t);r.useEffect(()=>{x(t)},[t]);const[h,y]=r.useState(!1),b=r.useId(),k=h?St:st;return e.jsxs("div",{children:[e.jsxs("h2",{className:"flex items-center gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>y(!h),"aria-expanded":h,"aria-controls":b,className:"group flex items-center gap-2 py-1 text-start text-heading text-ink",children:[e.jsx(k,{size:14,"aria-hidden":"true",className:"shrink-0 text-ink-dim transition-colors duration-fast ease-out-quart group-hover:text-ink rtl:-scale-x-100"}),a("ui.agents.settings.chat.advanced_chat_settings")]}),e.jsx(B,{content:a("ui.agents.settings.chat.advanced_settings_to_change_how_the_agent"),children:e.jsx(P,{variant:"ghost",size:"icon-sm","aria-label":a("ui.agents.settings.chat.about_advanced_chat_settings"),children:e.jsx(je,{})})})]}),h&&e.jsxs("div",{id:b,className:"mt-3",children:[e.jsx("p",{className:"max-w-2xl text-body-sm text-ink-muted",children:a("ui.agents.settings.chat.set_custom_values_for_any_of_these")}),e.jsxs("div",{className:"mt-6 flex flex-col gap-8",children:[e.jsxs(Pe,{title:a("ui.agents.settings.chat.sampling"),children:[u.temperature===null?e.jsx(G,{label:a("ui.agents.settings.chat.temperature"),description:a("ui.agents.settings.chat.controls_randomness_in_responses_0_0_1"),defaultLabel:w.temperature,onSet:async()=>{s("temperature");try{const o={temperature:w.temperature};await l.mutateAsync({agentId:t.id,update:o}),x(d=>({...d,temperature:w.temperature})),t.id===c&&i&&await i()}catch{}finally{s(null)}}}):e.jsx(ne,{value:u.temperature??w.temperature,label:a("ui.agents.settings.chat.temperature"),description:a("ui.agents.settings.chat.controls_randomness_in_responses_0_0_1"),min:0,max:1,step:.01,isSaving:n==="temperature",onChange:async o=>{s("temperature");try{const d={temperature:o};await l.mutateAsync({agentId:t.id,update:d}),t.id===c&&i&&await i()}catch{}finally{s(null)}}}),u.top_p===null?e.jsx(G,{label:a("ui.agents.settings.chat.top_p"),description:a("ui.agents.settings.chat.controls_cumulative_probability_of_tokens_to_sample"),defaultLabel:w.top_p,onSet:async()=>{s("top_p");try{const o={top_p:w.top_p};await l.mutateAsync({agentId:t.id,update:o}),x(d=>({...d,top_p:w.top_p})),t.id===c&&i&&await i()}catch{}finally{s(null)}}}):e.jsx(ne,{value:u.top_p??w.top_p,label:a("ui.agents.settings.chat.top_p"),description:a("ui.agents.settings.chat.controls_cumulative_probability_of_tokens_to_sample"),min:0,max:1,step:.01,isSaving:n==="top_p",onChange:async o=>{s("top_p");try{const d={top_p:o};await l.mutateAsync({agentId:t.id,update:d}),t.id===c&&i&&await i()}catch{}finally{s(null)}}}),u.top_k===null?e.jsx(G,{label:a("ui.agents.settings.chat.top_k"),description:a("ui.agents.settings.chat.limits_tokens_to_sample_from_at_each"),defaultLabel:w.top_k,onSet:async()=>{s("top_k");try{const o={top_k:w.top_k};await l.mutateAsync({agentId:t.id,update:o}),x(d=>({...d,top_k:w.top_k})),t.id===c&&i&&await i()}catch{}finally{s(null)}}}):e.jsx(ne,{value:u.top_k??w.top_k,label:a("ui.agents.settings.chat.top_k"),description:a("ui.agents.settings.chat.limits_tokens_to_sample_from_at_each"),min:1,max:100,step:1,isSaving:n==="top_k",onChange:async o=>{s("top_k");try{const d={top_k:o};await l.mutateAsync({agentId:t.id,update:d}),t.id===c&&i&&await i()}catch{}finally{s(null)}}}),u.seed===null?e.jsx(G,{label:a("ui.agents.settings.chat.seed"),description:a("ui.agents.settings.chat.random_number_seed_for_deterministic_generation"),defaultLabel:w.seed,onSet:async()=>{s("seed");try{const o={seed:w.seed};await l.mutateAsync({agentId:t.id,update:o}),x(d=>({...d,seed:w.seed})),t.id===c&&i&&await i()}catch{}finally{s(null)}}}):e.jsx(le,{value:u.seed?.toString()||"",label:a("ui.agents.settings.chat.seed"),placeholder:a("ui.agents.settings.chat.random_number_seed_for_deterministic_generation_detail"),icon:e.jsx(Ee,{size:16}),isSaving:n==="seed",onSave:async o=>{s("seed");try{const d=o.trim()?Number.parseInt(o,10):void 0;if(o.trim()&&Number.isNaN(d)){me(a("ui.agents.settings.chat.error.invalid_seed"));return}const m={seed:d};await l.mutateAsync({agentId:t.id,update:m}),t.id===c&&i&&await i()}catch{}finally{s(null)}}})]}),e.jsxs(Pe,{title:a("ui.agents.settings.chat.repetition"),children:[u.frequency_penalty===null?e.jsx(G,{label:a("ui.agents.settings.chat.frequency_penalty"),description:a("ui.agents.settings.chat.reduces_repetition_by_lowering_likelihood_of_repeated"),defaultLabel:w.frequency_penalty,onSet:async()=>{s("frequency_penalty");try{const o={frequency_penalty:w.frequency_penalty};await l.mutateAsync({agentId:t.id,update:o}),x(d=>({...d,frequency_penalty:w.frequency_penalty})),t.id===c&&i&&await i()}catch{}finally{s(null)}}}):e.jsx(ne,{value:u.frequency_penalty??w.frequency_penalty,label:a("ui.agents.settings.chat.frequency_penalty"),description:a("ui.agents.settings.chat.reduces_repetition_by_lowering_likelihood_of_repeated"),min:-2,max:2,step:.01,isSaving:n==="frequency_penalty",onChange:async o=>{s("frequency_penalty");try{const d={frequency_penalty:o};await l.mutateAsync({agentId:t.id,update:d}),t.id===c&&i&&await i()}catch{}finally{s(null)}}}),u.presence_penalty===null?e.jsx(G,{label:a("ui.agents.settings.chat.presence_penalty"),description:a("ui.agents.settings.chat.increases_diversity_by_lowering_likelihood_of_prompt"),defaultLabel:w.presence_penalty,onSet:async()=>{s("presence_penalty");try{const o={presence_penalty:w.presence_penalty};await l.mutateAsync({agentId:t.id,update:o}),x(d=>({...d,presence_penalty:w.presence_penalty})),t.id===c&&i&&await i()}catch{}finally{s(null)}}}):e.jsx(ne,{value:u.presence_penalty??w.presence_penalty,label:a("ui.agents.settings.chat.presence_penalty"),description:a("ui.agents.settings.chat.increases_diversity_by_lowering_likelihood_of_prompt"),min:-2,max:2,step:.01,isSaving:n==="presence_penalty",onChange:async o=>{s("presence_penalty");try{const d={presence_penalty:o};await l.mutateAsync({agentId:t.id,update:d}),t.id===c&&i&&await i()}catch{}finally{s(null)}}})]}),e.jsxs(Pe,{title:a("ui.agents.settings.chat.length_and_stopping"),children:[u.max_tokens===null?e.jsx(G,{label:a("ui.agents.settings.chat.max_tokens"),description:a("ui.agents.settings.chat.maximum_tokens_to_generate_in_response"),defaultLabel:w.max_tokens,onSet:async()=>{s("max_tokens");try{const o={max_tokens:w.max_tokens};await l.mutateAsync({agentId:t.id,update:o}),x(d=>({...d,max_tokens:w.max_tokens})),t.id===c&&i&&await i()}catch{}finally{s(null)}}}):e.jsx(ne,{value:u.max_tokens??w.max_tokens,label:a("ui.agents.settings.chat.max_tokens"),description:a("ui.agents.settings.chat.maximum_tokens_to_generate_in_response"),min:1,max:8192,step:1,isSaving:n==="max_tokens",onChange:async o=>{s("max_tokens");try{const d={max_tokens:o};await l.mutateAsync({agentId:t.id,update:d}),t.id===c&&i&&await i()}catch{}finally{s(null)}}}),u.stop===null?e.jsx(G,{label:a("ui.agents.settings.chat.stop_sequences"),description:a("ui.agents.settings.chat.sequences_that_will_cause_the_model_to"),defaultLabel:a("ui.agents.settings.chat.empty"),onSet:async()=>{s("stop");try{const o={stop:[]};await l.mutateAsync({agentId:t.id,update:o}),x(d=>({...d,stop:[]})),t.id===c&&i&&await i()}catch{}finally{s(null)}}}):e.jsx(le,{value:u.stop?.join(`
|
|
32
|
+
`)||"",label:a("ui.agents.settings.chat.stop_sequences"),placeholder:a("ui.agents.settings.chat.enter_stop_sequences_one_per_line"),icon:e.jsx(Ee,{size:16}),multiline:!0,rows:3,isSaving:n==="stop",onSave:async o=>{s("stop");try{const d=o.split(`
|
|
33
|
+
`).map(_=>_.trim()).filter(_=>_.length>0),m={stop:d.length>0?d:void 0};await l.mutateAsync({agentId:t.id,update:m}),t.id===c&&i&&await i()}catch{}finally{s(null)}}})]})]})]})]})},is=["investment","accounting","healthcare","legal","software","security","role_play","personal_assistance","education","marketing","sales","research","analysis","management","social_media","other"],be=t=>a("ui.common.forms.categories_input_chips.category",{category:t==="other"?"other_category":t}),ls=({value:t,label:n,onChange:s,placeholder:l=a("ui.common.forms.categories_input_chips.add_category"),disabled:i=!1,icon:c})=>{const u=L(),[x,h]=r.useState(""),[y,b]=r.useState(!1),[k,o]=r.useState(0),d=r.useRef(null),m=r.useRef([]),_=r.useId(),v=r.useId(),D=r.useMemo(()=>{const f=x.trim().toLowerCase();return is.filter(g=>!t.includes(g)&&(!f||be(g).toLowerCase().includes(f)))},[t,x,u]);r.useEffect(()=>{y&&m.current[k]?.scrollIntoView({block:"nearest"})},[k,y]);const S=f=>{t.includes(f)||s([...t,f]),h(""),b(!1),o(0),d.current?.focus()},q=f=>{h(f.target.value),o(0),b(!0)},C=f=>{const g=D.length;switch(f.key){case"ArrowDown":if(f.preventDefault(),g===0)break;y?o((k+1)%g):(o(0),b(!0));break;case"ArrowUp":if(f.preventDefault(),g===0)break;y?o((k-1+g)%g):(o(g-1),b(!0));break;case"Enter":y&&D[k]&&(f.preventDefault(),S(D[k]));break;case"Escape":y&&(f.preventDefault(),b(!1));break;case"Home":y&&(f.preventDefault(),o(0));break;case"End":y&&(f.preventDefault(),o(D.length-1));break}},E=f=>{s(t.filter(g=>g!==f)),o(0)},O=y&&D[k]?`${v}-option-${k}`:void 0;return e.jsxs("div",{children:[e.jsxs(de,{htmlFor:_,className:"mb-1.5 flex items-center gap-2 text-ink-muted",children:[c,n]}),e.jsxs("div",{className:z("flex min-h-11 flex-wrap items-center gap-2 rounded-sm border border-control bg-surface p-2","has-[input:focus-visible]:outline-solid has-[input:focus-visible]:outline-2","has-[input:focus-visible]:outline-accent has-[input:focus-visible]:outline-offset-2",i&&"border-hairline bg-sunken"),children:[t.map(f=>e.jsxs(lt,{className:"gap-1 pe-1 text-ink",children:[be(f),e.jsx("button",{type:"button","aria-label":a("ui.common.forms.categories_input_chips.remove_category",{value:be(f)}),disabled:i,onClick:()=>E(f),className:z("rounded-xs text-ink-dim","transition-colors duration-fast ease-out-quart","hover:text-danger disabled:text-ink-disabled"),children:e.jsx(ot,{})})]},f)),e.jsxs(It,{open:y,onOpenChange:b,children:[e.jsx(Dt,{asChild:!0,children:e.jsx("input",{id:_,ref:d,type:"text",role:"combobox","aria-expanded":y,"aria-controls":v,"aria-autocomplete":"list","aria-activedescendant":O,autoComplete:"off",value:x,placeholder:l,disabled:i,"aria-label":n,onChange:q,onKeyDown:C,onClick:()=>{D.length>0&&b(!0)},className:z("min-w-20 flex-1 bg-transparent px-1 py-0.5 outline-none","text-body-sm text-ink placeholder:text-ink-dim","disabled:text-ink-disabled disabled:placeholder:text-ink-disabled")})}),e.jsx(Lt,{align:"start",sideOffset:4,onOpenAutoFocus:f=>f.preventDefault(),className:"max-h-60 w-(--radix-popover-trigger-width) overflow-y-auto p-1",children:e.jsx("div",{id:v,role:"listbox","aria-label":n,children:D.map((f,g)=>e.jsx("div",{id:`${v}-option-${g}`,ref:I=>{m.current[g]=I},role:"option","aria-selected":g===k,onMouseDown:I=>{I.preventDefault()},onMouseEnter:()=>o(g),onClick:()=>S(f),className:z("cursor-pointer rounded-sm px-3 py-1.5 font-medium text-body-sm",g===k?"bg-accent-wash":void 0,"text-ink"),children:be(f)},f))})})]})]}),t.length===0&&e.jsx("span",{className:"mt-1 ms-1 block text-ink-dim text-meta",children:a("ui.common.forms.categories_input_chips.no_categories_selected")})]})},os=({value:t,label:n,onChange:s,placeholder:l=a("ui.common.forms.tags_input_chips.add_tag"),disabled:i=!1,icon:c})=>{L();const[u,x]=r.useState(""),h=r.useRef(null),y=r.useId(),b=m=>{x(m.target.value)},k=()=>{const m=u.trim().toLowerCase();m&&!t.includes(m)&&s([...t,m]),x("")},o=m=>{m.key==="Enter"&&u.trim()?(m.preventDefault(),k()):m.key==="Backspace"&&!u&&t.length>0&&s(t.slice(0,-1))},d=m=>{s(t.filter(_=>_!==m))};return e.jsxs("div",{children:[e.jsxs(de,{htmlFor:y,className:"mb-1.5 flex items-center gap-2 text-ink-muted",children:[c,n]}),e.jsxs("div",{className:z("flex min-h-11 flex-wrap items-center gap-2 rounded-sm border border-control bg-surface p-2","has-[input:focus-visible]:outline-solid has-[input:focus-visible]:outline-2","has-[input:focus-visible]:outline-accent has-[input:focus-visible]:outline-offset-2",i&&"border-hairline bg-sunken"),children:[t.map(m=>e.jsxs(lt,{className:"gap-1 pe-1 text-ink",children:[m,e.jsx("button",{type:"button","aria-label":a("ui.common.forms.tags_input_chips.remove_tag",{tag:m}),disabled:i,onClick:()=>d(m),className:z("rounded-xs text-ink-dim","transition-colors duration-fast ease-out-quart","hover:text-danger disabled:text-ink-disabled"),children:e.jsx(ot,{})})]},m)),e.jsx("input",{id:y,ref:h,type:"text",value:u,onChange:b,onKeyDown:o,placeholder:l,disabled:i,"aria-label":n,className:z("min-w-20 flex-1 bg-transparent px-1 py-0.5 outline-none","text-body-sm text-ink placeholder:text-ink-dim","disabled:text-ink-disabled disabled:placeholder:text-ink-disabled")}),u.trim()&&e.jsx(P,{variant:"ghost",size:"icon-sm","aria-label":a("ui.common.forms.tags_input_chips.add_tage0db29"),disabled:i,onClick:()=>{k(),h.current?.focus()},className:"text-accent hover:text-accent",children:e.jsx(rt,{})})]}),t.length===0&&!u&&e.jsx("span",{className:"mt-1 ms-1 block text-ink-dim text-meta",children:a("ui.common.forms.tags_input_chips.no_tags_added")})]})},rs=({selectedAgent:t,savingField:n,setSavingField:s,updateAgentMutation:l,refetchAgent:i,initialSelectedAgentId:c})=>{L();const{data:u,isLoading:x}=ma(),[h,y]=r.useState("");r.useEffect(()=>{!x&&u?.values?y(t.hosting||u.values.hosting||""):x||y(t.hosting||"")},[t,u,x]);const[b,k]=r.useState(!1),[o,d]=r.useState(!1);return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Ia,{agentId:t.id},t.id),e.jsx(le,{value:t.name,label:a("ui.agents.settings.general.agent_name"),placeholder:a("ui.agents.settings.general.enter_agent_name"),isSaving:n==="name",onSave:async m=>{if(!m.trim()){me(a("ui.agents.settings.general.error.empty_name"));return}s("name");try{const _={name:m};await l.mutateAsync({agentId:t.id,update:_}),t.id===c&&i&&await i()}catch{}finally{s(null)}}}),e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsx("div",{"data-tour-tag":"agent-settings-hosting-select",children:e.jsx(Wt,{value:t.hosting||(u?.values.hosting??""),isSaving:n==="hosting",onSave:async m=>{s("hosting"),y(m);try{const _={hosting:m,model:""};await l.mutateAsync({agentId:t.id,update:_}),t.id===c&&i&&await i()}catch{y(t.hosting||"")}finally{s(null)}},filterByCredentials:!0,allowDefault:!0},`hosting-select-${t.id}-${t.hosting||(u?.values.hosting??"default")}`)}),e.jsx("div",{"data-tour-tag":"agent-settings-model-select",children:h?e.jsx(Kt,{value:t.hosting?t.model||"":t.model||(u?.values.model_name??""),hostingId:h,isSaving:n==="model",allowDefault:!0,onSave:async m=>{s("model");try{const _={model:m};await l.mutateAsync({agentId:t.id,update:_}),t.id===c&&i&&await i()}catch{}finally{s(null)}}},`model-select-${t.id}-${h}-${t.model||(!t.hosting&&u?.values.model_name?u.values.model_name:"default")}`):e.jsxs("div",{className:"relative",children:[e.jsx(B,{content:a("ui.agents.settings.general.select_a_hosting_provider_first_and_then"),children:e.jsxs("div",{className:"mb-1.5 flex w-fit items-center gap-2 text-body-sm text-ink-muted",children:[e.jsx(Qt,{size:16,"aria-hidden":"true"}),a("ui.agents.settings.general.model")]})}),e.jsx("div",{className:"flex h-8 w-full items-center rounded-sm border border-control bg-surface px-3",children:e.jsx("span",{className:"truncate text-body-sm text-ink-disabled",children:a("ui.agents.settings.general.select_a_hosting_provider_first")})})]})})]}),e.jsxs("h2",{className:"mt-4 flex items-center gap-2 text-heading text-ink",children:[e.jsx(je,{size:16,className:"shrink-0 text-ink-dim"}),a("ui.agents.settings.general.agent_information")]}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(le,{value:t.description||"",label:a("ui.agents.settings.general.description"),placeholder:a("ui.agents.settings.general.enter_agent_description"),multiline:!0,rows:3,isSaving:n==="description",onSave:async m=>{s("description");try{const _={description:m};await l.mutateAsync({agentId:t.id,update:_}),t.id===c&&i&&await i()}catch{}finally{s(null)}}}),e.jsx(os,{value:t.tags||[],label:a("ui.agents.settings.general.tags"),placeholder:a("ui.agents.settings.general.add_tag"),disabled:b,onChange:async m=>{if(!(Array.isArray(t.tags)&&m.length===t.tags.length&&m.every((_,v)=>_===t.tags?.[v]))){k(!0);try{const _={tags:m};await l.mutateAsync({agentId:t.id,update:_}),t.id===c&&i&&await i()}catch{}finally{k(!1)}}}}),e.jsx(ls,{value:t.categories||[],label:a("ui.agents.settings.general.categories"),placeholder:a("ui.agents.settings.general.add_category"),disabled:o,onChange:async m=>{if(!(Array.isArray(t.categories)&&m.length===t.categories.length&&m.every((_,v)=>_===t.categories?.[v]))){d(!0);try{const _={categories:m};await l.mutateAsync({agentId:t.id,update:_}),t.id===c&&i&&await i()}catch{}finally{d(!1)}}}}),e.jsxs(Gt,{children:[e.jsx(De,{label:e.jsxs(e.Fragment,{children:[e.jsx(Ya,{size:12,"aria-hidden":"true"}),a("ui.agents.settings.general.id")]}),value:e.jsx("span",{className:"font-mono text-mono-sm",children:t.id})}),e.jsx(De,{label:e.jsxs(e.Fragment,{children:[e.jsx(Ft,{size:12,"aria-hidden":"true"}),a("ui.agents.settings.general.created")]}),value:pa(t.created_date)}),e.jsx(De,{label:e.jsxs(e.Fragment,{children:[e.jsx(Ga,{size:12,"aria-hidden":"true"}),a("ui.agents.settings.general.version")]}),value:t.version})]})]})]})},cs=({selectedAgent:t,savingField:n,setSavingField:s,updateAgentMutation:l,refetchAgent:i,initialSelectedAgentId:c})=>(L(),e.jsxs("div",{"data-tour-tag":"agent-settings-security",children:[e.jsxs("h2",{className:"flex items-center gap-2 text-heading text-ink",children:[e.jsx(Yt,{size:16,className:"shrink-0 text-ink-dim"}),a("ui.agents.settings.security.security_instructions"),e.jsx(B,{content:a("ui.agents.settings.security.security_instructions_that_guide_the_agent_s"),children:e.jsx(P,{variant:"ghost",size:"icon-sm","aria-label":a("ui.agents.settings.security.about_security_instructions"),children:e.jsx(je,{})})})]}),e.jsx("p",{className:"mt-1 max-w-2xl text-body-sm text-ink-muted",children:a("ui.agents.settings.security.this_prompt_is_directed_to_the_ai")}),e.jsx("div",{className:"mt-4",children:e.jsx(le,{value:t.security_prompt||"",label:"",placeholder:a("ui.agents.settings.security.enter_instructions_for_the_security_agent"),multiline:!0,rows:6,isSaving:n==="security_prompt",onSave:async u=>{s("security_prompt");try{const x={security_prompt:u};await l.mutateAsync({agentId:t.id,update:x}),t.id===c&&i&&await i()}catch{}finally{s(null)}}})})]})),us=({selectedAgent:t,savingField:n,setSavingField:s,refetchAgent:l,initialSelectedAgentId:i})=>{L();const{data:c,isLoading:u}=jt(t.id),x=es(t.id),[h,y]=r.useState("");return r.useEffect(()=>{c!==void 0&&y(c)},[c]),e.jsxs("div",{"data-tour-tag":"agent-settings-system-prompt",children:[e.jsxs("h2",{className:"flex items-center gap-2 text-heading text-ink",children:[e.jsx(Da,{size:16,className:"shrink-0 text-ink-dim"}),a("ui.agents.settings.system_prompt.agent_instructions"),e.jsx(B,{content:a("ui.agents.settings.system_prompt.system_instructions_that_define_the_agent_s"),children:e.jsx(P,{variant:"ghost",size:"icon-sm","aria-label":a("ui.agents.settings.system_prompt.about_agent_instructions"),children:e.jsx(je,{})})})]}),e.jsx("p",{className:"mt-1 max-w-2xl text-body-sm text-ink-muted",children:a("ui.agents.settings.system_prompt.define_the_agent_s_role_personality_or")}),e.jsx("div",{className:"mt-4",children:e.jsx(le,{value:h,label:"",placeholder:u?a("ui.agents.settings.system_prompt.loading_system_prompt"):a("ui.agents.settings.system_prompt.enter_instructions_for_the_agent"),multiline:!0,rows:6,isSaving:n==="system_prompt",onSave:async b=>{s("system_prompt");try{await x.mutateAsync(b),t.id===i&&l&&await l()}finally{s(null)}}})})]})},ds=({selectedAgent:t,refetchAgent:n,initialSelectedAgentId:s})=>{L();const[l,i]=r.useState(null),c=Jt();return e.jsx("div",{"data-tour-tag":"agent-settings-details-paper",className:"h-full overflow-hidden",children:t?e.jsx("div",{className:"h-full overflow-y-auto",children:e.jsxs("div",{className:"mx-auto flex w-full max-w-4xl flex-col gap-8 pb-8",children:[e.jsx(rs,{selectedAgent:t,savingField:l,setSavingField:i,updateAgentMutation:c,refetchAgent:n,initialSelectedAgentId:s}),e.jsx(us,{selectedAgent:t,savingField:l,setSavingField:i,refetchAgent:n,initialSelectedAgentId:s}),e.jsx(cs,{selectedAgent:t,savingField:l,setSavingField:i,updateAgentMutation:c,refetchAgent:n,initialSelectedAgentId:s}),e.jsx(ns,{selectedAgent:t,savingField:l,setSavingField:i,updateAgentMutation:c,refetchAgent:n,initialSelectedAgentId:s})]})}):e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-8 text-center",children:[e.jsx(qe,{size:48,className:"text-ink-dim","aria-hidden":"true"}),e.jsx("h2",{className:"text-heading text-ink",children:a("ui.agents.settings.agent.no_agent_selected")}),e.jsx("p",{className:"max-w-md text-body-sm text-ink-muted",children:a("ui.agents.settings.agent.select_an_agent_from_the_list_on")})]})})},ze=ya()(ja(t=>({listings:{},remember:(n,s)=>{t(l=>({listings:{...l.listings,[n]:s}}))},forget:n=>{t(s=>{if(!(n in s.listings))return s;const l={...s.listings};return delete l[n],{listings:l}})}}),{name:"published-listings-storage"})),ms=t=>ze(n=>t?n.listings[t]??null:null),ps=400,gs=2,hs=t=>[...t].length>=gs;function xs(t){if(!t)return{state:"unknown",builtinName:null};if(t.available)return{state:"available",builtinName:null};const n=t.details?.builtin_name??null;return t.code==="name_taken"?{state:"taken",builtinName:null}:t.code==="name_reserved_builtin"?{state:"reserved",builtinName:n}:{state:"unknown",builtinName:null}}const bs=(t,n)=>{const s=t.trim(),l=ct(s,ps),i=n&&l===s&&hs(l)&&ka(l),c=bt({queryKey:["agent-name-availability",l],enabled:i,queryFn:async()=>(await Oe.getAgentNameAvailability(Z.baseUrl,l)).result,retry:!1,staleTime:15e3,refetchOnWindowFocus:!1});return!i||c.isPending?{state:i?"checking":"idle",builtinName:null}:c.isError?{state:"unknown",builtinName:null}:xs(c.data)},fs=()=>{const t=ft();return gt({mutationFn:async({agentId:n,document:s,hubAgentId:l,target:i,policy:c})=>{if(!Z.baseUrl)throw new Error("Local Operator API URL is not configured.");return l?Oe.republishAgentInstructionSet(Z.baseUrl,n,l,s,i,c):Oe.publishAgentInstructionSet(Z.baseUrl,n,s,i,c)},onSuccess:(n,s)=>{const l=n.result;l?.agent_id&&!s.target&&ze.getState().remember(s.agentId,{hubAgentId:l.agent_id,name:l.name,publishedAt:new Date().toISOString()}),l?.local_link_receipt&&t.invalidateQueries({queryKey:Zt}),s.target?Ua(t,s.target.tenantId):Ra(t)},onError:n=>{console.error("Publishing an agent to the hub failed:",n)}})};function _s({agentName:t,published:n,targetIsOrg:s,targetDisplayName:l,hasListing:i}){return n?n.orgName?a("ui.agents.upload.title.published_org",{name:t,destination:n.orgName}):n.republished?a("ui.agents.upload.title.republished",{name:t}):a("ui.agents.upload.title.published_public",{name:t}):s?a("ui.agents.upload.title.publish_org",{name:t,destination:l}):i?a("ui.agents.upload.title.update_listing",{name:t}):a("ui.agents.upload.title.publish_public",{name:t})}const fe="public",kt=({open:t,onClose:n,agent:s,isAuthenticated:l,onSignInSuccess:i,onPublished:c})=>{const[u,x]=r.useState(!1),[h,y]=r.useState(""),[b,k]=r.useState(null),[o,d]=r.useState(null),[m,_]=r.useState(!1),v=r.useRef(null),D=r.useRef(null),S=Re(),q=fs(),C=L(),[E,O]=r.useState(Le),f=r.useRef(null),g=r.useRef({open:!1,id:null}),I=ms(s?.id??null),Y=va(),K=wa(Y.data,"hub_links"),H=Xt(t&&K),ke=ga(),pe=Na(Y.data,"radient_org"),ve=qa(pe),re=l?Oa(pe,ke??null):null,{memberships:X,isError:we}=At({enabled:t&&l&&ve}),A=r.useMemo(()=>La(X),[X]),J=r.useMemo(()=>Pa(X),[X]),[M,j]=r.useState(fe),N=M!==fe,$=(H.data?.links??[]).filter(p=>p.kind==="agent"&&p.local_id===s?.id),T=$.find(p=>p.visibility===(N?"org":"public")&&p.tenant_id===(N?M:null)),V=$.find(p=>p.link_id!==T?.link_id),W=H.data?.unresolved.some(p=>p.kind==="agent"&&p.local_id===s?.id),ee=A.find(p=>p.tenant_id===M),Me=N?ee?.tenant_name?a("ui.hub.links.source_private",{organization:ee.tenant_name}):a("ui.hub.links.source_unavailable"):a("ui.hub.links.source_public"),ce=A.find(p=>p.tenant_id===M)?.tenant_name||a("ui.agents.upload.target.org_unnamed"),ge=r.useId(),he=r.useId(),{data:$e}=jt(t&&s?s.id:""),{data:Be}=ha(t);r.useEffect(()=>{t&&(!g.current.open||g.current.id!==(s?.id??null))&&y(s?.name??""),g.current={open:t,id:s?.id??null}},[t,s?.id,s?.name]),r.useEffect(()=>{t||(x(!1),k(null),d(null),_(!1),j(fe),O(Le()),f.current=null)},[t]);const vt=r.useMemo(()=>(Be??[]).filter(p=>p.source==="builtin").map(p=>p.name),[Be]),He=za(h,vt),Ve=bs(h,t&&l),te=r.useMemo(()=>{const p=Ma({name:h,description:s?.description??"",instructions:$e??null,tools:$a(s?.tags)});return He&&p.unshift({field:"name",message:Ze({code:"name_reserved_builtin",message:""},{name:h,hubAgentId:null}).body}),p},[h,s?.description,s?.tags,$e,He,C]),U=b?Ze(b,{name:h,hubAgentId:I?.hubAgentId??null}):null,ae=q.isPending,Ne=async p=>{if(!s||ae||te.length>0||N&&!ee)return;k(null);const R=p?.asNewListing?null:T?.hub_id??(N?null:I?.hubAgentId??null),Ke=!!R;if(!(K&&(!H.isSuccess||V||W)))try{const Q={name:h.trim()},Qe=JSON.stringify({agent:s.id,document:Q,hubAgentId:R,target:M,policy:T?null:E}),Ce=f.current?.tuple===Qe?f.current:{tuple:Qe,id:crypto.randomUUID()};f.current=Ce;const se=(await q.mutateAsync({agentId:s.id,document:Q,hubAgentId:R,...K?{policy:T?{requestId:Ce.id,...T.remote_revision&&Ke?{expectedRemoteRevision:T.remote_revision}:{}}:{requestId:Ce.id,...E}}:{},target:N?{visibility:"org",tenantId:M}:void 0})).result,Ge={name:se?.name??h.trim(),hubAgentId:se?.agent_id??null,republished:Ke,orgName:N?ce:null,localPolicies:se?.local_link_receipt?Ta(se)?"complete":"pending":K?"pending":null};d(Ge),se&&c?.(se,Ge.republished)}catch(Q){k(xa(Q)?{code:Q.code,message:Q.message,details:Q.details}:{message:Ca(Q,a("ui.agents.upload.failure.publish_fallback"))})}},We=p=>{switch(p){case"focus-name":k(null),requestAnimationFrame(()=>{v.current?.focus(),v.current?.select()});break;case"update-listing":{const R=b?.details?.existing_agent_id??I?.hubAgentId;R&&(n(),S(`/agent-hub/${R}`));break}case"install-builtin":{const R=b?.details?.builtin_name??Ve.builtinName;R&&(n(),S(`/agents?kind=agent&name=${encodeURIComponent(R)}`));break}case"edit-instructions":case"edit-agent":s&&(n(),S(`/agents/${s.id}`));break;case"publish-as-new":s&&ze.getState().forget(s.id),Ne({asNewListing:!0});break;case"sign-in":_(!0);break;case"refresh-hub":n(),S("/agent-hub");break;case"retry":Ne();break}},xe=s?.name??"",wt=_s({agentName:xe,published:o,targetIsOrg:N,targetDisplayName:ce,hasListing:!!I});r.useLayoutEffect(()=>{!b&&!o||D.current?.focus()},[b,o]);const Nt=o?e.jsxs(e.Fragment,{children:[e.jsx(ie,{onClick:n,"data-tour-tag":"upload-agent-dialog-cancel-button",children:a("ui.common.actions.close")}),o.hubAgentId&&e.jsx(ye,{onClick:()=>{n(),S(`/agent-hub/${o.hubAgentId}`)},children:a("ui.agents.upload.action.open_listing")})]}):U?e.jsxs(e.Fragment,{children:[e.jsx(ie,{onClick:n,"data-tour-tag":"upload-agent-dialog-cancel-button",children:a("ui.common.actions.close")}),U.actions.map((p,R)=>R===0?e.jsx(ye,{onClick:()=>We(p),disabled:ae,children:Xe[p]},p):e.jsx(ie,{onClick:()=>We(p),disabled:ae,children:Xe[p]},p))]}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{onClick:n,"data-tour-tag":"upload-agent-dialog-cancel-button",children:a("ui.common.actions.cancel")}),te.some(p=>p.field!=="name")&&e.jsx(ie,{onClick:()=>{s&&(n(),S(`/agents/${s.id}`))},children:a("ui.agents.upload.action.edit_agent")}),l&&e.jsx(ye,{"data-testid":"publish-submit",onClick:()=>void Ne(),disabled:N&&!ee||!u||te.length>0||!h.trim()||ae||K&&(!H.isSuccess||!!V||!!W),children:ae?a("ui.agents.upload.action.publishing"):I&&!N?a("ui.agents.upload.action.update_listing"):a("ui.agents.upload.action.publish")})]});return e.jsx(ht,{open:t,onClose:n,title:wt,maxWidth:"sm",fullWidth:!0,actions:Nt,dataTourTag:"upload-agent-dialog",dialogProps:{className:"outline-none"},children:e.jsxs("div",{ref:D,tabIndex:b||o?-1:void 0,className:z("flex flex-col gap-4",(b||o)&&"outline-none"),children:[l?o?e.jsxs(_e,{variant:"success","aria-live":"polite",children:[e.jsx(Se,{children:o.orgName?a("ui.agents.upload.receipt.title_org",{destination:o.orgName}):o.republished?a("ui.agents.upload.receipt.title_updated"):a("ui.agents.upload.receipt.title_hub")}),e.jsx(ue,{children:o.orgName?a("ui.agents.upload.published.org_listed",{name:o.name,destination:o.orgName}):o.republished?a("ui.agents.upload.published.republished",{name:o.name}):a("ui.agents.upload.published.listed",{name:o.name})}),e.jsx(ue,{className:"text-ink-muted",children:a("ui.agents.upload.sign_in.nothing_left")})]}):U&&b?e.jsxs(_e,{variant:U.variant,role:"alert",children:[e.jsx(Se,{children:U.headline}),e.jsx(ue,{children:U.body}),U.note&&e.jsx(ue,{className:"text-ink-muted",children:U.note})]}):null:e.jsxs("div",{className:"flex flex-col items-center gap-6 text-center",children:[e.jsx("p",{className:"text-body text-ink",children:a("ui.agents.upload.sign_in.needed")}),e.jsx(Je,{titleText:a("ui.agents.upload.sign_in.title_continue"),descriptionText:"",onSignInSuccess:i})]}),U&&m&&e.jsxs("div",{className:"flex flex-col items-center gap-6 text-center",children:[e.jsx("p",{className:"text-body text-ink",children:a("ui.agents.upload.sign_in.reauthenticate")}),e.jsx(Je,{titleText:a("ui.agents.upload.sign_in.title_again"),descriptionText:"",onSignInSuccess:()=>{_(!1),k(null),i?.()}})]}),o?.localPolicies==="pending"&&e.jsx("p",{role:"alert",className:"text-body-sm text-warning",children:a("ui.hub.skills.policy_pending")}),!o&&K&&e.jsx("div",{className:"flex flex-col gap-3",children:H.isLoading?e.jsx("p",{className:"text-meta text-ink-muted",children:a("ui.hub.links.loading")}):H.error?e.jsx("p",{role:"alert",className:"text-body-sm text-warning",children:a("ui.hub.links.load_failed")}):V?e.jsx("p",{className:"text-body-sm text-warning",children:a("ui.hub.subscriptions.source_separation",{currentSource:ea(V),newSource:Me})}):W?e.jsx("p",{className:"text-body-sm text-warning",children:a("ui.hub.links.source_unavailable")}):T?e.jsx(ta,{link:T}):e.jsx(Ea,{value:E,onChange:O,source:Me,item:h||xe,visibility:N?"org":"public",organization:N?ce:null,destinationKey:`${M}:${s?.id??""}`,canEnableAutoPush:!1,disabled:ae||!H.isSuccess})}),!o&&!U&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-body text-ink",children:N?a("ui.agents.upload.intro.org",{destination:ce}):a("ui.agents.upload.intro.public")}),e.jsxs("ul",{className:"list-disc space-y-1 ps-5 text-body text-ink-muted",children:[e.jsx("li",{children:a("ui.agents.upload.list.name")}),e.jsx("li",{children:a("ui.agents.upload.list.instructions")}),e.jsx("li",{children:a("ui.agents.upload.list.surface")})]}),e.jsx("p",{className:"text-body text-ink",children:N?a("ui.agents.upload.not_leaving.org",{destination:ce}):a("ui.agents.upload.not_leaving.public")}),A.length>0||J.length>0?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(de,{htmlFor:`${ge}-target`,children:a("ui.agents.upload.target.label")}),e.jsxs(Pt,{value:M,onValueChange:p=>{j(p),O(Le()),f.current=null},children:[e.jsx(Et,{id:`${ge}-target`,className:"w-full","data-testid":"publish-target",children:e.jsx(Tt,{})}),e.jsxs(Ot,{children:[e.jsx(Ie,{value:fe,children:a("ui.hub.pages.scope.public")}),A.map(p=>e.jsx(Ie,{value:p.tenant_id,children:p.tenant_name||a("ui.hub.pages.scope.org_label")},p.tenant_id)),J.map(p=>e.jsxs(Ie,{value:p.tenant_id,disabled:!0,children:[p.tenant_name||a("ui.hub.pages.scope.org_label")," ",a("ui.agents.upload.target.upgrade")]},p.tenant_id))]})]}),e.jsx("p",{className:"text-meta text-ink-muted","data-testid":"publish-target-hint",children:J.length>0?a("ui.agents.upload.target.blocked_hint",{count:J.length,org:J[0].tenant_name||a("ui.hub.pages.scope.org_unnamed")}):a("ui.agents.upload.target.visibility_hint_public")})]}):re?e.jsx("p",{className:"text-meta text-ink-muted","data-testid":"publish-target-unavailable",children:re}):we?e.jsx("p",{className:"text-meta text-ink-muted","data-testid":"publish-target-failed",children:a("ui.agents.upload.target.orgs_unread")}):null,te.length>0&&e.jsxs(_e,{variant:"danger",children:[e.jsx(Se,{children:a("ui.agents.upload.error.cannot_publish")}),e.jsx("ul",{className:"list-disc space-y-1 ps-5",children:te.map(p=>e.jsx("li",{children:p.message},`${p.field}:${p.message}`))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(de,{htmlFor:he,children:a("ui.agents.upload.field.name_label")}),e.jsx(it,{id:he,ref:v,value:h,onChange:p=>y(p.target.value),autoComplete:"off",spellCheck:!1,"aria-invalid":te.some(p=>p.field==="name"),"aria-describedby":`${he}-hint`}),e.jsx("p",{id:`${he}-hint`,className:"text-meta text-ink-muted",children:a("ui.agents.upload.field.name_hint")}),!N&&ys(Ve)]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("span",{className:"flex h-5 shrink-0 items-center",children:e.jsx(qt,{id:ge,name:"termsAgreement","data-testid":"publish-consent",checked:u,onCheckedChange:p=>x(p===!0)})}),e.jsxs(de,{htmlFor:ge,className:"block font-normal text-body text-ink",children:[a("ui.agents.upload.terms.lead")," ",e.jsx("a",{href:"https://radienthq.com/terms",target:"_blank",rel:"noopener noreferrer",className:"text-accent underline-offset-4 hover:text-accent-hover hover:underline",children:a("ui.agents.upload.terms.link")})," ",a("ui.agents.upload.terms.tail")]})]})]}),(o||U)&&xe&&e.jsxs("p",{className:"text-meta text-ink-muted",children:[a("ui.agents.upload.availability.agent_label")," ",xe]})]})})},ys=t=>{switch(t.state){case"checking":return e.jsx("p",{className:"text-meta text-ink-muted",children:a("ui.agents.upload.availability.checking")});case"available":return e.jsx("p",{className:"text-meta text-ink-muted",children:a("ui.agents.upload.availability.free")});case"taken":return e.jsx("p",{className:"text-meta text-ink",children:a("ui.agents.upload.availability.taken")});case"reserved":return e.jsx("p",{className:"text-meta text-ink-muted",children:t.builtinName?a("ui.agents.upload.availability.reserved_named",{name:t.builtinName}):a("ui.agents.upload.availability.reserved_unnamed")});default:return null}},js=1200,ks=({agent:t,isSelected:n,onSelectAgent:s,onChatWithAgent:l,onExportAgent:i,onAgentDeleted:c,onUploadAgentToHub:u})=>{L();const x=ba(t.id,void 0,32),h=t.description||a("ui.agents.navigation.sidebar.no_description");return e.jsxs("li",{className:"group relative",children:[e.jsxs("button",{type:"button",onClick:()=>s(t),"aria-current":n?"true":void 0,"data-tour-tag":"agent-list-item-button",className:z("flex w-full items-center gap-2 rounded-sm py-1.5 pe-9 ps-2 text-start","transition-colors duration-fast ease-out-quart",n?sa:"hover:bg-row-hover"),children:[e.jsxs(Rt,{className:"size-8 shrink-0",children:[x?e.jsx(zt,{src:x,alt:"",className:"lo-avatar-arrival"}):null,e.jsx(Mt,{children:e.jsx(qe,{size:16,"aria-hidden":!0})})]}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx(B,{content:t.name,side:"top",align:"start",children:e.jsx("span",{className:"block truncate font-medium text-body-sm text-ink",children:t.name})}),e.jsx(B,{content:h,side:"bottom",align:"start",children:e.jsx("span",{className:"block truncate text-meta text-ink-dim",children:h})})]})]}),e.jsx("div",{className:z("pointer-events-none absolute top-0 end-1 flex h-full items-center","opacity-0 transition-opacity duration-fast ease-out-quart","group-hover:pointer-events-auto group-hover:opacity-100","group-focus-within:pointer-events-auto group-focus-within:opacity-100"),children:e.jsx(B,{content:a("ui.agents.navigation.sidebar.options"),children:e.jsx("span",{children:e.jsx(Xa,{agentId:t.id,agentName:t.name,isAgentsPage:!0,onAgentDeleted:()=>c(t.id),onChatWithAgent:()=>l(t),onExportAgent:()=>i(t.id),onUploadAgentToHub:()=>u(t),buttonSx:{width:24,height:24,borderRadius:"6px",display:"flex",justifyContent:"center",alignItems:"center"}})})})})]})},vs=(t,n)=>t.isSelected===n.isSelected&&t.agent.id===n.agent.id&&t.agent.name===n.agent.name&&t.agent.description===n.agent.description&&t.onSelectAgent===n.onSelectAgent&&t.onChatWithAgent===n.onChatWithAgent&&t.onExportAgent===n.onExportAgent&&t.onAgentDeleted===n.onAgentDeleted&&t.onUploadAgentToHub===n.onUploadAgentToHub,ws=r.memo(ks,vs),Ns=({selectedAgentId:t,onSelectAgent:n})=>{const s=Re();L();const[l,i]=r.useState(""),c=Sa(j=>j.openCreateAgentDialog),u=ct(l.trim(),250),[x,h]=r.useState(!1),y=50,[b,k]=r.useState(!1),[o,d]=r.useState(null),{isAuthenticated:m}=xt(),_=r.useMemo(()=>Ue(Z.baseUrl),[]),v=ut(),{page:D,setPage:S}=ts(),{data:q,isLoading:C,isError:E,refetch:O}=aa(D,y,0,u||void 0,"created_date","desc"),f=q?.agents||[],g=q?.total||0,{data:I}=dt(t&&!f.find(j=>j.id===t)?t:void 0),Y=r.useMemo(()=>{const j=[...f];return I&&!j.find(N=>N.id===I.id)&&j.push(I),j.sort((N,$)=>new Date($.created_date).getTime()-new Date(N.created_date).getTime()),j},[f,I]),K=r.useCallback(j=>{S(j)},[S]),H=r.useCallback(j=>{n(j)},[n]),ke=r.useCallback(()=>{h(!0)},[]),pe=r.useCallback(()=>{h(!1)},[]),ve=r.useCallback(async j=>{try{const N=await v.mutateAsync(j),$=Y.find(ee=>ee.id===j),T=$?$.name.replace(/\s+/g,"-").toLowerCase():j,V=URL.createObjectURL(N),W=document.createElement("a");W.href=V,W.download=`${T}-export.zip`,document.body.appendChild(W),W.click(),URL.revokeObjectURL(V),document.body.removeChild(W)}catch(N){console.error("Failed to export agent:",N)}},[Y,v]),re=r.useCallback(j=>{d(j),k(!0)},[]),X=r.useCallback(()=>{k(!1),d(null)},[]),we=r.useCallback(async j=>{try{const $=((await O()).data?.agents||[]).find(V=>V.id===j);if($){n($);return}const T=await _.agents.getAgent(j);T.status<400&&T.result&&n(T.result)}catch(N){console.error("Error selecting newly created agent:",N)}},[n,O,_]),A=r.useCallback(j=>{_t.getState().stageDraft({kind:"agent",name:j.name}),s("/chat")},[s]),J=r.useCallback(j=>{O(),s("/agents")},[t,O,s]),M=r.useCallback(j=>{re(j)},[re]);return e.jsxs("div",{"data-glass-region":"page-sidebar",className:"panel-top-pad flex h-full w-full flex-col overflow-hidden bg-surface",children:[e.jsx(ss,{title:a("ui.agents.navigation.sidebar.title"),searchQuery:l,onSearchChange:j=>i(j),onNewAgentClick:c,onImportAgentClick:ke,importAgentTooltip:a("ui.agents.navigation.sidebar.import_hint")}),C?e.jsx("div",{className:"flex flex-1 items-center justify-center",children:e.jsx(nt,{size:"lg",label:a("ui.agents.navigation.sidebar.loading")})}):E?e.jsxs(_e,{variant:"danger",role:"alert",className:"m-4 w-auto",children:[e.jsx(ue,{children:a("ui.agents.navigation.sidebar.error")}),e.jsx(P,{variant:"ghost",size:"sm",className:"self-start",onClick:()=>O(),children:a("ui.agents.navigation.sidebar.retry")})]}):Y.length===0&&!C?e.jsx("p",{className:"p-6 text-center text-body-sm text-ink-muted",children:l?a("ui.agents.navigation.sidebar.search_empty"):a("ui.agents.navigation.sidebar.empty")}):e.jsx(Ut,{delayDuration:js,skipDelayDuration:0,children:e.jsx("ul",{className:"flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto p-2",children:Y.map(j=>e.jsx(ws,{agent:j,isSelected:t===j.id||I?.id===j.id,onSelectAgent:H,onChatWithAgent:A,onExportAgent:ve,onAgentDeleted:J,onUploadAgentToHub:M},j.id))})}),e.jsx(as,{open:x,onClose:pe,onAgentImported:we}),g>0&&e.jsx(Aa,{page:D,count:Math.max(1,Math.ceil(g/y)),onChange:K}),e.jsx(kt,{open:b,onClose:X,agent:o,isAuthenticated:m})]})},Cs=r.memo(Ns),Qs=()=>{L();const{agentId:t,navigateToAgent:n}=na(),s=Re(),{isAuthenticated:l}=xt(),[i,c]=r.useState(!1),u=ut(),{setLastAgentsPageAgentId:x,getLastAgentId:h}=mt(),y=t||h("agents"),{data:b,refetch:k}=dt(y||void 0);r.useEffect(()=>{t&&x(t)},[t,x]);const o=async()=>{if(b)try{const v=await u.mutateAsync(b.id),D=URL.createObjectURL(v),S=document.createElement("a");S.href=D,S.download=`${b.name.replace(/\s+/g,"-").toLowerCase()}-lo-agent.zip`,document.body.appendChild(S),S.click(),URL.revokeObjectURL(D),document.body.removeChild(S)}catch(v){console.error("Failed to export agent:",v)}},d=()=>{c(!0)},m=()=>{c(!1)},_=v=>{x(v.id),n(v.id,"agents")};return e.jsxs("div",{"data-glass-split":"",className:"panel-flush flex min-h-0 flex-1 overflow-hidden",children:[e.jsx("div",{className:"h-full w-70 shrink-0",children:e.jsx(Cs,{selectedAgentId:b?.id,onSelectAgent:_})}),e.jsx("div",{"data-glass-region":"canvas-content",className:"panel-top-pad h-full grow overflow-hidden",children:e.jsxs("div",{className:"flex h-full flex-col gap-8 p-4 sm:p-6 lg:p-8",children:[e.jsx("div",{className:"mx-auto w-full max-w-4xl",children:e.jsx(Ct,{title:a("ui.agents.navigation.legacy.title"),icon:qe,subtitle:a("ui.agents.navigation.legacy.subtitle"),children:b&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(et,{children:[e.jsx(tt,{asChild:!0,children:e.jsx(P,{"data-tour-tag":"upload-to-hub-header-button",variant:"secondary",size:"icon","aria-label":a("ui.agents.navigation.legacy.more_actions"),className:"@min-[400px]:hidden",children:e.jsx(fa,{"aria-hidden":"true"})})}),e.jsxs(at,{align:"end",className:"min-w-45",children:[e.jsxs(F,{disabled:u.isPending,onSelect:o,children:[e.jsx(Ye,{"aria-hidden":"true"}),e.jsx("span",{children:a("ui.agents.navigation.legacy.export")})]}),e.jsxs(F,{onSelect:d,children:[e.jsx(Te,{"aria-hidden":"true"}),e.jsx("span",{children:a("ui.agents.navigation.legacy.upload")})]})]})]}),e.jsxs(P,{variant:"secondary",onClick:o,disabled:u.isPending,className:"hidden @min-[400px]:inline-flex",children:[e.jsx(Ye,{"aria-hidden":"true"}),a("ui.agents.navigation.legacy.export")]}),e.jsxs(P,{"data-tour-tag":"upload-to-hub-header-button","data-tour-action":"open-upload-dialog",variant:"secondary",onClick:d,className:"hidden @min-[400px]:inline-flex",children:[e.jsx(Te,{"aria-hidden":"true"}),a("ui.agents.navigation.legacy.upload")]}),e.jsx(B,{content:a("ui.agents.navigation.legacy.chat_named",{name:b.name||a("ui.agents.navigation.legacy.unnamed_agent")}),children:e.jsxs(P,{variant:"primary",onClick:()=>{_t.getState().stageDraft({kind:"agent",name:b.name}),s("/chat")},children:[e.jsx(pt,{"aria-hidden":"true"}),a("ui.agents.navigation.legacy.chat")]})})]})})}),e.jsx("div",{className:"min-h-0 grow overflow-hidden",children:e.jsx(ds,{selectedAgent:b??null,refetchAgent:k,initialSelectedAgentId:t})})]})}),b&&e.jsx(kt,{open:i,onClose:m,agent:b,isAuthenticated:l})]})};export{Qs as LegacyAgentsPage};
|