@axiom-lattice/react-sdk 4.3.0 → 4.4.0
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/dist/{AgentDetailSideApp-TI7723CK.mjs → AgentDetailSideApp-RW6B3BGT.mjs} +7 -7
- package/dist/AgentGovernanceWorkbench-OXGHJNFL.mjs +19 -0
- package/dist/{MessageGraph-ES3P4VLY.mjs → MessageGraph-BVP2M3TM.mjs} +3 -3
- package/dist/{ReactChart-6AYFMCMD.mjs → ReactChart-3XHMWXL6.mjs} +3 -3
- package/dist/{TasksSideApp-7R42CIFG.mjs → TasksSideApp-MLG7XUQA.mjs} +4 -4
- package/dist/{TeamWorkspace-JQ762PEX.mjs → TeamWorkspace-IENL2T4X.mjs} +3 -3
- package/dist/{TopologyRuntimeView-OJ35YYVM.mjs → TopologyRuntimeView-B5TVUTAB.mjs} +4 -4
- package/dist/{WorkflowAutomationView-3AS77NKN.mjs → WorkflowAutomationView-ZKTUYMPU.mjs} +6 -6
- package/dist/{chunk-4FI66ZJ3.mjs → chunk-2NCNDHTI.mjs} +2 -2
- package/dist/{chunk-ENLK3ODS.mjs → chunk-3JNBTKKB.mjs} +2 -2
- package/dist/{chunk-2ZK7AUQW.mjs → chunk-ADZRYRP6.mjs} +9 -5
- package/dist/chunk-ADZRYRP6.mjs.map +1 -0
- package/dist/{chunk-4SVLWYLW.mjs → chunk-AJLGOGUB.mjs} +2 -2
- package/dist/{chunk-NSGSGYM7.mjs → chunk-HLVE2SB7.mjs} +48 -1
- package/dist/chunk-HLVE2SB7.mjs.map +1 -0
- package/dist/{chunk-YUV4WO25.mjs → chunk-N5VEHSQU.mjs} +160 -69
- package/dist/chunk-N5VEHSQU.mjs.map +1 -0
- package/dist/{chunk-3NR7UAPT.mjs → chunk-ORTSDZD4.mjs} +26 -44
- package/dist/chunk-ORTSDZD4.mjs.map +1 -0
- package/dist/{chunk-DBTFQUSQ.mjs → chunk-XE2ZIE2L.mjs} +4 -4
- package/dist/{embed-page-AgentDetailSideApp-PSRQVFNR.js → embed-page-AgentDetailSideApp-2BDEWFQ6.js} +1 -1
- package/dist/embed-page-AgentGovernanceWorkbench-WG7E3G5T.js +5 -0
- package/dist/{embed-page-MessageGraph-PDNQ67T4.js → embed-page-MessageGraph-5SWPEQ4V.js} +1 -1
- package/dist/{embed-page-ReactChart-25KAFLQ3.js → embed-page-ReactChart-ZYWRXIMC.js} +1 -1
- package/dist/{embed-page-TasksSideApp-DLH5LRMS.js → embed-page-TasksSideApp-X6255GEF.js} +1 -1
- package/dist/{embed-page-TeamWorkspace-2WJJWF25.js → embed-page-TeamWorkspace-XNZM7AV7.js} +1 -1
- package/dist/{embed-page-TopologyRuntimeView-WDQRHDMO.js → embed-page-TopologyRuntimeView-DGSHSTIU.js} +1 -1
- package/dist/{embed-page-WorkflowAutomationView-BAMJ2WVB.js → embed-page-WorkflowAutomationView-BHIRIWV3.js} +1 -1
- package/dist/embed-page-chunk-DEDTYRZE.js +245 -0
- package/dist/{embed-page-chunk-XVUA7UHE.js → embed-page-chunk-HEO7X7LH.js} +1 -1
- package/dist/{embed-page-chunk-TL2AYM76.js → embed-page-chunk-JMZ7OODN.js} +1 -1
- package/dist/{embed-page-chunk-OBM5EUWZ.js → embed-page-chunk-SPC4BYNU.js} +192 -192
- package/dist/{embed-page-chunk-LOXLXZNP.js → embed-page-chunk-XUXEGF3S.js} +1 -1
- package/dist/{embed-page-chunk-MQDYZS3S.js → embed-page-chunk-YCX5YZRP.js} +1 -1
- package/dist/embed-page.js +1 -1
- package/dist/index.d.mts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +2029 -1890
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -8
- package/dist/index.mjs.map +1 -1
- package/dist/web-app.js +48 -3
- package/dist/web-app.js.map +1 -1
- package/dist/web-app.mjs +5 -4
- package/dist/web-app.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/AgentGovernanceWorkbench-2MPAB6UF.mjs +0 -19
- package/dist/chunk-2ZK7AUQW.mjs.map +0 -1
- package/dist/chunk-3NR7UAPT.mjs.map +0 -1
- package/dist/chunk-NSGSGYM7.mjs.map +0 -1
- package/dist/chunk-YUV4WO25.mjs.map +0 -1
- package/dist/embed-page-AgentGovernanceWorkbench-UPQHJZD7.js +0 -5
- package/dist/embed-page-chunk-SSC7ANWV.js +0 -245
- /package/dist/{AgentDetailSideApp-TI7723CK.mjs.map → AgentDetailSideApp-RW6B3BGT.mjs.map} +0 -0
- /package/dist/{AgentGovernanceWorkbench-2MPAB6UF.mjs.map → AgentGovernanceWorkbench-OXGHJNFL.mjs.map} +0 -0
- /package/dist/{MessageGraph-ES3P4VLY.mjs.map → MessageGraph-BVP2M3TM.mjs.map} +0 -0
- /package/dist/{ReactChart-6AYFMCMD.mjs.map → ReactChart-3XHMWXL6.mjs.map} +0 -0
- /package/dist/{TasksSideApp-7R42CIFG.mjs.map → TasksSideApp-MLG7XUQA.mjs.map} +0 -0
- /package/dist/{TeamWorkspace-JQ762PEX.mjs.map → TeamWorkspace-IENL2T4X.mjs.map} +0 -0
- /package/dist/{TopologyRuntimeView-OJ35YYVM.mjs.map → TopologyRuntimeView-B5TVUTAB.mjs.map} +0 -0
- /package/dist/{WorkflowAutomationView-3AS77NKN.mjs.map → WorkflowAutomationView-ZKTUYMPU.mjs.map} +0 -0
- /package/dist/{chunk-4FI66ZJ3.mjs.map → chunk-2NCNDHTI.mjs.map} +0 -0
- /package/dist/{chunk-ENLK3ODS.mjs.map → chunk-3JNBTKKB.mjs.map} +0 -0
- /package/dist/{chunk-4SVLWYLW.mjs.map → chunk-AJLGOGUB.mjs.map} +0 -0
- /package/dist/{chunk-DBTFQUSQ.mjs.map → chunk-XE2ZIE2L.mjs.map} +0 -0
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as Re,b as Me,c as Tt,d as It,e as Dt,f as Rt,g as Pt,h as Ft,i as Et,j as Mt,k as Nt,l as Lt}from"./embed-page-chunk-SSC7ANWV.js";import"./embed-page-chunk-XVUA7UHE.js";import{a as Ge}from"./embed-page-chunk-MQDYZS3S.js";import"./embed-page-chunk-LOXLXZNP.js";import"./embed-page-chunk-KEL6XU6R.js";import{b as _e,e as Ve,f as At,g as Ct,h as xt,i as wt,l as vt,m as kt}from"./embed-page-chunk-AC6X2XRH.js";import{a as mt,b as gt,c as ut,d as ft,e as yt}from"./embed-page-chunk-SV2BM3WO.js";import"./embed-page-chunk-S4XZPBRM.js";import"./embed-page-chunk-TL2AYM76.js";import{$ as it,Da as ht,G as ot,J as rt,P as st,Pa as bt,Qa as Ke,da as lt,jb as St,k as De,oa as dt,va as ct,w as at,wa as pt}from"./embed-page-chunk-OBM5EUWZ.js";import{m as Qe,r as fe}from"./embed-page-chunk-HMTKPZ5B.js";import{a as E}from"./embed-page-chunk-MB65DZAX.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-5JDQ456X.js";import"./embed-page-chunk-Z7USDLHI.js";import{Db as et,Fa as Je,Ia as Ie,Ja as Ye,La as Y,Ua as Xe,W as Z,_ as Se,aa as Te,ac as Ee,ea as Fe,ka as Oe,la as We,ma as qe,mc as tt,oa as Ze,ra as P,ta as V,wa as $e,xa as v,ya as ue,yc as nt}from"./embed-page-chunk-O4QK5LWZ.js";import{a as ge}from"./embed-page-chunk-4BKXE5ON.js";import"./embed-page-chunk-IX4WLWCY.js";import"./embed-page-chunk-EUOOO2LS.js";import{e as x}from"./embed-page-chunk-6Y3UYJ6Z.js";var u=x(ge());var X=x(ge());var J=x(ge());var Bt=x(ge());var se=x(E()),Ot=60,$t=72,ze=(0,Bt.memo)(({data:n})=>{let r=Re(n.type),p=Math.min(12+Math.sqrt(n.subAgentCount)*10,48);return(0,se.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,se.jsx)(Ve,{type:"target",position:_e.Top,style:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",background:"transparent",border:"none",width:0,height:0},isConnectable:!1}),(0,se.jsx)("div",{title:n.label,style:{width:p,height:p,borderRadius:"50%",background:Me(r.color),display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:Math.max(10,p*.4),fontWeight:600,cursor:"pointer",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},children:n.label.charAt(0).toUpperCase()}),(0,se.jsx)("div",{style:{fontSize:11,maxWidth:120,textAlign:"center",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:4},children:n.label}),(0,se.jsx)(Ve,{type:"source",position:_e.Top,style:{left:"50%",top:"50%",transform:"translate(-50%, -50%)",background:"transparent",border:"none",width:0,height:0},isConnectable:!1})]})});ze.displayName="AgentGraphNode";var Q=x(E()),sn=({assistants:n,onNodeClick:r})=>{let[p,d,g]=xt([]),[o,f,k]=wt([]),[c,S]=(0,J.useState)(null),H=(0,J.useMemo)(()=>({agent:ze}),[]),m=(0,J.useMemo)(()=>Dt(n),[n]);(0,J.useEffect)(()=>{let w=m.nodes.map(i=>({id:i.id})),F=m.edges.map(i=>({source:i.source,target:i.target})),N=new Map(m.nodes.map(i=>[i.id,i])),_=ft(w).force("link",ut(F).id(i=>i.id).distance(80)).force("charge",yt().strength(-220)).force("center",mt(0,0)).force("collide",gt(45)).stop();for(let i=0;i<300;i++)_.tick();let R=w.map(i=>({id:i.id,type:"agent",data:N.get(i.id),position:{x:i.x-Ot/2,y:i.y-$t/2}})),s=m.edges.map(i=>({id:`e${i.source}-${i.target}`,source:i.source,target:i.target,style:{stroke:"#1677ff",strokeWidth:2},type:"straight"}));d(R),f(s)},[m,d,f]);let I=(0,J.useMemo)(()=>c===null?p:p.map(w=>{let F=w.id===c||o.some(N=>N.source===c&&N.target===w.id||N.target===c&&N.source===w.id);return{...w,style:{opacity:F?1:.2,transition:"opacity 0.2s ease"}}}),[p,o,c]),K=(0,J.useMemo)(()=>c===null?o.map(w=>({...w,style:{stroke:"#1677ff",strokeWidth:1.5,opacity:.25,transition:"opacity 0.2s ease"}})):o.map(w=>{let F=w.source===c||w.target===c;return{...w,style:{stroke:"#1677ff",strokeWidth:F?2.5:1,opacity:F?1:.04,transition:"opacity 0.2s ease"}}}),[o,c]);return(0,Q.jsx)("div",{style:{width:"100%",height:"100%",background:"#fafafa",position:"relative"},children:(0,Q.jsxs)(Ct,{nodes:I,edges:K,onNodesChange:g,onEdgesChange:k,onNodeMouseEnter:(w,F)=>S(F.id),onNodeMouseLeave:()=>S(null),onNodeClick:(w,F)=>r?.(String(F.id)),nodeTypes:H,fitView:!0,fitViewOptions:{padding:.25},children:[(0,Q.jsx)(vt,{color:"#eee",gap:20}),(0,Q.jsx)(kt,{})]})})},Kt=n=>(0,Q.jsx)(At,{children:(0,Q.jsx)(sn,{...n})});var M=x(E()),ln=n=>{if(!n)return"\u2014";let r=Date.now()-new Date(n).getTime(),p=Math.floor(r/6e4);if(p<1)return"just now";if(p<60)return`${p}m ago`;let d=Math.floor(p/60);return d<24?`${d}h ago`:`${Math.floor(d/24)}d ago`},dn=n=>n===null?"#d9d9d9":n>=80?"#22c55e":n>=50?"#f59e0b":"#ef4444",cn=ct(({css:n})=>({row:n`
|
|
2
|
-
display: flex;
|
|
3
|
-
justify-content: space-between;
|
|
4
|
-
align-items: flex-end;
|
|
5
|
-
`})),_t={fontSize:16,fontWeight:700,lineHeight:1.2,cursor:"help"},Ue={fontSize:10,color:"rgba(0, 0, 0, 0.45)",whiteSpace:"nowrap",marginTop:1},je={display:"flex",flexDirection:"column",alignItems:"center"},Vt=({stats:n})=>{let{styles:r}=cn();if(!n)return(0,M.jsxs)("div",{style:{display:"flex",fontSize:11,color:"#d9d9d9"},children:[(0,M.jsx)("span",{style:{flex:1},children:"score \u2014"}),(0,M.jsx)("span",{style:{flex:1},children:"threads \u2014"})]});let p=n.evalScore!==null?Number(n.evalScore).toFixed(1):"\u2014",d=n.threadCount>0?n.threadCount:"\u2014",g=dn(n.evalScore),o=n.evalPassRate!==null?`${n.evalPassRate}%`:"\u2014";return(0,M.jsxs)("div",{className:r.row,children:[(0,M.jsxs)("div",{style:{display:"flex",gap:16,alignItems:"flex-end"},children:[(0,M.jsx)(Te,{title:`Eval score: ${p} \xB7 pass rate ${o} \xB7 ${n.evalRuns} runs`,children:(0,M.jsxs)("div",{style:je,children:[(0,M.jsx)("span",{style:{..._t,color:g},children:p}),(0,M.jsx)("span",{className:"lattice-stat-label",style:Ue,children:"eval score"})]})}),(0,M.jsx)(Te,{title:`Conversations: ${n.threadCount} total \xB7 ${n.last7d} in 7d \xB7 ${n.last30d} in 30d${n.lastActive?` \xB7 last active ${ln(n.lastActive)}`:""}`,children:(0,M.jsxs)("div",{style:je,children:[(0,M.jsx)("span",{style:{..._t,color:d==="\u2014"?"#d9d9d9":"#595959"},children:d}),(0,M.jsx)("span",{className:"lattice-stat-label",style:Ue,children:"threads"})]})})]}),n.daily7d.length>0&&(0,M.jsxs)("div",{style:je,children:[(0,M.jsx)(Rt,{values:n.daily7d,width:40,height:24,color:"#8c8c8c"}),(0,M.jsx)("span",{className:"lattice-stat-label",style:Ue,children:"7d threads"})]})]})};var C=x(E()),pn=[{key:"all",label:"All"},{key:"capability",label:"Capability"},{key:"orchestrator",label:"Orchestrator"},{key:"team",label:"Team"},{key:"workflow",label:"Workflow"}],Gt=({items:n,assistants:r=[],stats:p,loading:d,onItemClick:g,onOpenPlayground:o,onOpenEval:f,onCreate:k,onDelete:c})=>{let[S,H]=(0,X.useState)("all"),[m,I]=(0,X.useState)(null),[K,w]=(0,X.useState)(null),F=(0,X.useMemo)(()=>{let s=new Set;return n.forEach(i=>i.tags.forEach(te=>s.add(te))),Array.from(s).map(i=>({value:i,label:i}))},[n]),N=(0,X.useMemo)(()=>n.filter(s=>!(S!=="all"&&s.type!==S||m&&!s.tags.includes(m)||K&&s.status!==K)),[n,S,m,K]),_=[{key:"edit",icon:lt,label:"Edit",onClick:s=>g(s.id)},{key:"playground",icon:at,label:"Playground",onClick:s=>o(s.id)},{key:"eval",icon:rt,label:"Eval",onClick:s=>f(s.id)}];c&&_.push({key:"delete",icon:dt,label:"Delete",danger:!0,onClick:s=>c(s.id)});let R=(0,X.useMemo)(()=>[{mode:"graph",icon:it,label:"Graph",render:()=>(0,C.jsx)(Kt,{assistants:r,onNodeClick:g})}],[r,g]);return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{"data-testid":"agent-list-state","data-loading":String(d),"data-count":N.length,hidden:!0,"aria-hidden":"true"}),(0,C.jsx)(bt,{title:"Agents",itemName:"agent",items:N,loading:d,keyExtractor:s=>s.id,tabs:pn,activeTab:S,onTabChange:s=>H(s),headerLeft:(0,C.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,C.jsx)(Ke,{value:m,onChange:I,options:F,placeholder:"Domain",allLabel:"All domains"}),(0,C.jsx)(Ke,{value:K,onChange:w,options:[{value:"enabled",label:"Enabled"},{value:"draft",label:"Draft"},{value:"disabled",label:"Disabled"}],placeholder:"Status",allLabel:"All statuses"})]}),renderIcon:s=>{let i=Me(Re(s.type).color);return(0,C.jsx)("div",{title:`${s.type} agent`,style:{width:32,height:32,borderRadius:8,background:`${i}1A`,color:i,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:(0,C.jsx)(De,{size:18})})},renderPrimary:s=>(0,C.jsx)("span",{"data-testid":"agent-name","data-agent-id":s.id,children:s.name}),renderSecondary:s=>s.description||void 0,renderDetails:s=>(0,C.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:8,flexWrap:"wrap"},children:[(0,C.jsxs)("div",{style:{display:"flex",gap:4,flexWrap:"wrap",alignItems:"center"},children:[s.tags.map(i=>(0,C.jsx)(Ie,{color:"magenta",style:{margin:0,borderRadius:10,border:"none"},children:i},i)),(0,C.jsx)(Ie,{color:Re(s.type).color,style:{margin:0,borderRadius:10,border:"none"},children:s.type})]}),(0,C.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[(0,C.jsx)(Te,{title:`Status: ${s.status}`,children:(0,C.jsx)("span",{style:{width:8,height:8,borderRadius:"50%",background:Tt(s.status),display:"inline-block",cursor:"help"}})}),(0,C.jsx)("span",{style:{fontSize:12,color:"#8c8c8c"},children:s.version})]})]}),renderFooter:s=>(0,C.jsx)("div",{style:{borderTop:"1px dashed #f0f0f0",paddingTop:10},children:(0,C.jsx)(Vt,{stats:p?.[s.id]})}),itemActions:_,actionsStyle:"icon",actionsPosition:"hover",onItemClick:s=>g(s.id),createLabel:"New Agent",onCreateClick:k,viewModeExtensions:R,emptyIcon:(0,C.jsx)(De,{size:48,style:{opacity:.5}}),emptyTitle:"No agents yet",emptyDescription:'Click "New Agent" to create one'})]})};var b=x(ge());var ie=x(ge());var ye=x(E()),{Text:mn}=Y,zt=({onSelect:n,value:r,placeholder:p="Select a parent agent to extend..."})=>{let[d,g]=(0,ie.useState)([]),[o,f]=(0,ie.useState)(!1),{get:k}=fe(),c=(0,ie.useCallback)(async()=>{f(!0);try{let m=await k("/api/assistants");m.success&&g(m.data?.records||[])}catch(m){console.error("Failed to fetch assistants:",m)}finally{f(!1)}},[k]);return(0,ie.useEffect)(()=>{c()},[c]),(0,ye.jsx)(Se,{showSearch:!0,allowClear:!0,value:r,placeholder:p,loading:o,onChange:m=>{if(!m){n(null);return}let I=d.find(K=>K.id===m);n(I||null)},onDropdownVisibleChange:m=>{m&&c()},optionFilterProp:"label",style:{width:"100%"},options:d.map(m=>({value:m.id,label:m.name||m.id,description:m.description})),optionRender:m=>(0,ye.jsxs)("div",{children:[(0,ye.jsx)("div",{children:m.label}),m.data.description&&(0,ye.jsx)(mn,{type:"secondary",style:{fontSize:12},children:m.data.description})]})})};var O=x(E()),{Text:Ut}=Y,jt=({subAgentKeys:n,decisions:r,onChange:p})=>{let{token:d}=Ye.useToken(),g=(f,k)=>{let c=r.map(S=>S.originalKey===f?{...S,clone:k,cloneKey:k?`${f}_clone`:void 0}:S);p(c)},o=(f,k)=>{let c=r.map(S=>S.originalKey===f?{...S,cloneKey:k}:S);p(c)};return n.length===0?null:(0,O.jsxs)("div",{children:[(0,O.jsx)(Ut,{type:"secondary",style:{display:"block",marginBottom:8},children:"Choose how to handle each sub-agent from the parent:"}),(0,O.jsx)($e,{size:"small",bordered:!0,dataSource:r,style:{borderRadius:d.borderRadius},renderItem:f=>(0,O.jsxs)($e.Item,{style:{display:"flex",flexDirection:"column",alignItems:"stretch",gap:8,padding:"8px 16px"},children:[(0,O.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,O.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[f.clone?(0,O.jsx)(Ee,{style:{color:d.colorPrimary}}):(0,O.jsx)(tt,{style:{color:d.colorTextSecondary}}),(0,O.jsx)(Ut,{style:{fontFamily:"monospace"},children:f.originalKey})]}),(0,O.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,O.jsx)(Ie,{color:f.clone?"blue":"default",children:f.clone?"Clone as new":"Reuse"}),(0,O.jsx)(Je,{size:"small",checked:f.clone,onChange:k=>g(f.originalKey,k)})]})]}),f.clone&&(0,O.jsx)(V,{size:"small",placeholder:"Enter key for the cloned agent",value:f.cloneKey,onChange:k=>o(f.originalKey,k.target.value),style:{fontFamily:"monospace",fontSize:12},addonBefore:"Key"})]})})]})};function Ht(n){return n.mode!=="local"||n.templateKey||typeof n.executable=="string"&&n.executable.trim().length>0?null:"Choose a template or enter a custom executable"}var t=x(E()),{TextArea:Wt}=V,{Text:ee}=Y,qt="/.well-known/agent-card.json",gn=[{value:"http://",label:"http://"},{value:"https://",label:"https://"}],Zt={react:"Executor: Directly executes tasks using tools. Best for single-step operations like search, code execution, and data retrieval.",deep_agent:"Orchestrator: Manages a sequential todo list to plan and assign todo items to sub-agents. Best for structured multi-step workflows.",team:"Team: Creates tasks with dependencies and dynamically spawns teammates. Like a swarm, teammates communicate via mailbox. Best for tasks requiring exploration and divergent thinking.",processing:"Workflow: Enforces a fixed workflow topology by delegating to sub-agents in a predefined order. Best for deterministic multi-step processes with validated delegation paths.",a2a_remote:"A2A Remote: Delegates to an external A2A-compatible agent server. Use for local CLI tools (Claude Code, Codex, OpenCode) or remote agents."};function Jt(n,r,p="https://"){let d=String(n??"").trim();if(!d)return"";let g=r==="http://"||r==="https://"?r:p,f=(/^https?:\/\//i.test(d)?d:`${g}${d.replace(/^\/+/,"")}`).replace(/\/+$/,"");return f.endsWith(qt)?f:`${f}${qt}`}function un(n){try{return new URL(n).port||void 0}catch{return}}function fn(n){return n.some(r=>r==="--port"||r==="-p"||/^--port=/.test(r)||/^-p=/.test(r))}function Yt(n,r){let p=[...n.args],d=un(r);return d&&!fn(p)&&p.push("--port",d),{...n,args:p,...n.env?{env:{...n.env}}:{}}}var Qt=({open:n,onCancel:r,onSuccess:p,initialMode:d,initialValues:g})=>{let[o]=P.useForm(),[f,k]=(0,b.useState)(!1),[c,S]=(0,b.useState)("learn"),[H,m]=(0,b.useState)(""),[I,K]=(0,b.useState)(null),[w,F]=(0,b.useState)([]),N=P.useWatch("type",o)||"react",_=N==="a2a_remote",[R,s]=(0,b.useState)("remote"),[i,te]=(0,b.useState)(void 0),[le,he]=(0,b.useState)([]),[de,ce]=(0,b.useState)(!1),ne=(0,b.useRef)(0),[Ne,be]=(0,b.useState)(!1),[ae,W]=(0,b.useState)(!1),{get:Ae,post:q,put:z}=fe(),Le=Qe("agent-architect"),{workspaceId:pe,trainingProjects:me,loading:oe}=pt(),[Ce,xe]=(0,b.useState)(null),Be=JSON.stringify(g??null),L=me.find(e=>e.id===Ce)??me[0]??null,[we,ve]=(0,b.useState)([]),Pe=(0,b.useCallback)(()=>{K(null),F([])},[]),re=(0,b.useCallback)(()=>{o.resetFields(),Pe(),S("learn"),m(""),ve([]),xe(null),s("remote"),te(void 0),he([]),W(!1),be(!1)},[o,Pe]);(0,b.useEffect)(()=>{if(n){re(),S(d??"learn");let e=g?.a2aMode;(e==="remote"||e==="local")&&s(e),o.setFieldsValue({type:"react",agentCardProtocol:"https://",a2aMode:"remote",timeout:3e5,...g})}},[n,o,d,Be,re]),(0,b.useEffect)(()=>{let e=++ne.current,a=!0;return n&&_?(o.setFieldValue("prompt",""),R==="local"?(ce(!0),Ae("/api/local-a2a/templates").then(A=>{a&&e===ne.current&&A?.data?.records&&he(A.data.records)}).catch(()=>{a&&e===ne.current&&he([])}).finally(()=>{a&&e===ne.current&&ce(!1)})):ce(!1)):ce(!1),()=>{a=!1,ne.current+=1}},[o,_,R,Ae,n]);let l=le.find(e=>e.key===i),h=(0,b.useCallback)(()=>{let e=Ht({mode:R,templateKey:i,executable:o.getFieldValue("commandExecutable")});return e?(W(!0),o.setFields([{name:"commandExecutable",errors:[e]}]),v.warning(e),!1):!0},[R,i,o]);(0,b.useEffect)(()=>{l&&o.setFieldsValue({agentCardProtocol:"http://"})},[o,l]);let T=(0,b.useCallback)(async()=>{if(!h())return;let e=Jt(o.getFieldValue("agentCardUrl"),o.getFieldValue("agentCardProtocol"),R==="local"?"http://":"https://");if(!e){v.warning("Please enter an A2A server URL first");return}be(!0);try{let a={agentCardUrl:e,apiKey:o.getFieldValue("apiKey")};if(R==="local"){let y=l;if(y)a.localRuntime={label:o.getFieldValue("name")||void 0,agentCardUrl:e,command:Yt(y.command,e)};else{let B=o.getFieldValue("commandArgs")||"",j=B?B.split(/\s+/).filter(Boolean):[],D=String(o.getFieldValue(["command","cwd"])||"").trim();a.localRuntime={label:o.getFieldValue("name")||void 0,agentCardUrl:e,command:{executable:String(o.getFieldValue("commandExecutable")||"").trim(),args:j,...D?{cwd:D}:{}}}}}let A=await q("/api/a2a/test-connection",a);if(A.data?.reachable){let y=A.data.agentCard;v.success(`Connected to "${A.data.agentName||e}"`)}else v.error(A.data?.error||"Connection failed")}catch{v.error("Connection test failed")}finally{be(!1)}},[o,q,R,l,h]),U=(0,b.useCallback)(e=>{if(K(e),!e){o.resetFields(["key","name","description","type","prompt"]),F([]);return}let a=typeof e.graphDefinition=="object"&&e.graphDefinition!==null?e.graphDefinition:{},A=a.key||e.id,y=e.name||a.name||"";o.setFieldsValue({key:`${A}_ext`,name:y?`${y} (Extended)`:"",description:e.description||a.description||"",type:a.type||"react",prompt:a.prompt||""});let B=a.subAgents||[];F(B.map(j=>({originalKey:j,clone:!1})))},[o]),ke=async(e,a)=>{let A=await Ae(`/api/assistants/${e}`);if(!A.success)throw new Error(`Failed to fetch sub-agent "${e}" for cloning`);let y=A.data,B=typeof y.graphDefinition=="object"?y.graphDefinition:{},j={id:a,name:`${y.name} (Clone)`,description:y.description||"",graphDefinition:{...B,key:a,name:`${y.name} (Clone)`}},D=await q("/api/assistants",j);if(!D.success)throw new Error(D.message||`Failed to clone sub-agent "${e}"`);return D.data},tn=e=>{let a={id:e.key,name:e.name,description:e.description||"",graphDefinition:{key:e.key,name:e.name,description:e.description||"",type:e.type,prompt:e.prompt||"",tools:[],skills:[],subAgents:e.type==="deep_agent"||e.type==="processing"?[]:void 0,middleware:[]}};if(e.type==="a2a_remote"&&(a.graphDefinition.agentCardUrl=Jt(e.agentCardUrl,e.agentCardProtocol,(e.a2aMode||R)==="local"?"http://":"https://"),e.apiKey&&(a.graphDefinition.apiKey=e.apiKey),e.timeout&&(a.graphDefinition.timeout=e.timeout),(e.a2aMode||R)==="local")){let A=l;if(A)a.graphDefinition.localRuntime={label:e.name||void 0,agentCardUrl:a.graphDefinition.agentCardUrl,command:Yt(A.command,a.graphDefinition.agentCardUrl)};else{let y=e.commandArgs||"",B=y?y.split(/\s+/).filter(Boolean):[],j=String(e.command?.cwd||"").trim();a.graphDefinition.localRuntime={label:e.name||void 0,agentCardUrl:a.graphDefinition.agentCardUrl,command:{executable:String(e.commandExecutable||"").trim(),args:B,...j?{cwd:j}:{}}}}}return a},nn=async(e,a)=>{if(!I)throw new Error("No parent agent selected");let A=w.filter(D=>D.clone);for(let D of A){if(!D.cloneKey||!D.cloneKey.trim())throw new Error(`Please provide a key for the cloned sub-agent "${D.originalKey}"`);if(!/^[a-zA-Z][a-zA-Z0-9_-]*$/.test(D.cloneKey))throw new Error(`Invalid key "${D.cloneKey}" for cloned sub-agent "${D.originalKey}". Key must start with a letter and contain only letters, numbers, underscores, or hyphens.`)}let y=[];for(let D of w)if(D.clone){let rn=await ke(D.originalKey,D.cloneKey);a.push(rn),y.push(D.cloneKey)}else y.push(D.originalKey);let B=typeof I.graphDefinition=="object"?I.graphDefinition:{},j={key:e.key,name:e.name,description:e.description||"",extendsAgent:I.id,type:e.type||B.type};return e.prompt&&e.prompt!==B.prompt&&(j.prompt=e.prompt),(y.length>0||B.subAgents&&B.subAgents.length>0)&&(j.subAgents=y),{id:e.key,name:e.name,description:e.description||"",graphDefinition:j}},an=async()=>{if(c==="learn"){let e=H.trim();if(!e){v.error("Please describe the training goal");return}if(!L){v.error("No shared training project available");return}k(!0);try{let a=`agent-${Ft(e+Date.now())}`,A=await q("/api/assistants",{id:a,name:a,graphDefinition:{key:a,name:a,description:"",type:"react",prompt:"To be trained",metadata:{trainingProjectId:L.id,learningPlaceholder:"true",architectureStatus:"undecided"}}});if(!A.data)throw new Error("Failed to create agent");let{roundTaskId:y}=await Mt({goal:e,targetAgentId:a,workspaceId:pe??void 0,projectId:L.id,existingThreadId:Et(Le.tenantId,a),files:we,post:q,put:z});v.success("Agent created \u2014 architect started building"),m(""),ve([]),S("learn"),p?.(A.data,{initialMessage:Nt({goal:e,roundTaskId:y,targetAgentId:a,targetMode:"placeholder",files:we,projectId:L.id,workspaceId:L.workspaceId??pe??void 0}),projectId:L.id}),r()}catch(a){v.error(a instanceof Error?a.message:"Failed to create agent")}finally{k(!1)}return}try{if(c==="scratch"&&_&&!h())return;let e=await o.validateFields();k(!0);let a=[],A=c==="scratch"?tn(e):await nn(e,a),y=await q("/api/assistants",A);if(y.success){v.success(c==="extend"?`Assistant created by extending "${I?.name}"`:"Assistant created successfully"),re();for(let B of a)p?.(B);p?.(y.data),r()}else v.error(y.message||"Failed to create assistant")}catch(e){if(e?.errorFields){let a={key:"Key (ID)",name:"Name",description:"Description",prompt:"System Prompt"},A=e.errorFields.map(y=>a[String((y.name??[])[0])]??String((y.name??[])[0])).filter(Boolean);v.warning(A.length>0?`Please complete the required fields: ${[...new Set(A)].join(", ")}`:"Please complete the required fields");return}v.error(e.message||"An error occurred while creating the assistant")}finally{k(!1)}},He=I?.graphDefinition?.subAgents||[],on=c==="extend"&&I&&He.length>0;return(0,t.jsxs)(ue,{title:"Create New Assistant",open:n,onCancel:()=>{re(),r()},footer:[(0,t.jsx)(Z,{onClick:()=>{re(),r()},children:"Cancel"},"cancel"),(0,t.jsx)(Z,{type:"primary",icon:c==="extend"?(0,t.jsx)(Ee,{}):c==="learn"?(0,t.jsx)(et,{}):(0,t.jsx)(nt,{}),loading:f,disabled:c==="learn"&&(oe||!L),onClick:an,children:c==="extend"?"Create (Extend)":c==="learn"?"Start Learning":"Create"},"submit")],width:760,children:[c==="extend"&&(0,t.jsxs)("div",{style:{marginBottom:20},children:[(0,t.jsx)(ee,{type:"secondary",style:{display:"block",marginBottom:8},children:"Parent Agent"}),(0,t.jsx)(zt,{value:I?.id,onSelect:U}),I&&(0,t.jsx)(ee,{type:"secondary",style:{display:"block",marginTop:4,fontSize:12},children:"Fields left unchanged will be inherited from the parent agent."})]}),c==="extend"&&I&&(0,t.jsx)(Oe,{style:{margin:"12px 0"}}),c==="learn"&&(0,t.jsxs)("div",{children:[(0,t.jsx)(ee,{style:{display:"block",marginBottom:8},children:"Describe what the agent should do."}),(0,t.jsx)(V.TextArea,{rows:3,value:H,onChange:e=>m(e.target.value),placeholder:"e.g. Handle price disputes using the price protection policy"}),L&&(0,t.jsxs)("div",{style:{marginTop:12},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginBottom:8},children:[(0,t.jsx)(ee,{type:"secondary",children:"Reference Files"}),(0,t.jsx)(Ge,{project:L,projects:me,value:L?.id??null,onChange:xe,loading:oe})]}),(0,t.jsx)(Pt,{projectId:L.id,value:we,onChange:ve}),(0,t.jsx)(ee,{type:"secondary",style:{display:"block",marginTop:6,fontSize:12},children:"Optional \u2014 uploaded to the shared training workspace and attached to the learning round; the architect reads them as round material."})]}),!L&&!oe&&(0,t.jsx)("div",{style:{marginTop:12},children:(0,t.jsx)(Ge,{project:L,projects:me,value:null,onChange:xe,loading:oe})})]}),c!=="learn"&&(0,t.jsxs)(P,{form:o,layout:"vertical",autoComplete:"off",initialValues:{type:"react",agentCardProtocol:"https://",a2aMode:"remote"},children:[(0,t.jsx)(P.Item,{name:"key",label:"Key (ID)",rules:[{required:!0,message:"Please enter a unique key"},{pattern:/^[a-zA-Z][a-zA-Z0-9_-]*$/,message:"Key must start with a letter and contain only letters, numbers, underscores, or hyphens"}],style:{marginBottom:16},children:(0,t.jsx)(V,{placeholder:"e.g., my_assistant"})}),(0,t.jsx)(P.Item,{name:"name",label:"Name",rules:[{required:!0,message:"Please enter a name"}],style:{marginBottom:16},children:(0,t.jsx)(V,{placeholder:"e.g., My Assistant"})}),(0,t.jsx)(P.Item,{name:"description",label:"Description",rules:[{required:!0,message:"Please enter a description"}],style:{marginBottom:16},children:(0,t.jsx)(Wt,{placeholder:"Enter a description for this assistant...",autoSize:{minRows:2,maxRows:4}})}),(0,t.jsx)(P.Item,{name:"type",label:"Agent Type",rules:[{required:!0}],style:{marginBottom:16},children:(0,t.jsx)(We,{options:[{value:"react",label:"Executor"},{value:"deep_agent",label:"Orchestrator"},{value:"team",label:"Team"},{value:"processing",label:"Workflow"},{value:"a2a_remote",label:"A2A Remote"}],block:!0})}),(0,t.jsx)(ee,{type:"secondary",style:{fontSize:12,display:"block",marginTop:-12,marginBottom:16,lineHeight:1.5},children:Zt[N]||Zt.react}),_&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P.Item,{label:"Connection Mode",style:{marginBottom:16},children:(0,t.jsxs)(Fe.Group,{value:R,onChange:e=>{let a=e.target.value;s(a),o.setFieldValue("a2aMode",a),a==="local"&&o.setFieldValue("agentCardProtocol","http://"),te(void 0)},optionType:"button",buttonStyle:"solid",children:[(0,t.jsx)(Fe.Button,{value:"remote",children:"Remote URL"}),(0,t.jsx)(Fe.Button,{value:"local",children:"Local Managed"})]})}),(0,t.jsx)(P.Item,{name:"a2aMode",noStyle:!0,hidden:!0,children:(0,t.jsx)(V,{})}),R==="local"&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P.Item,{label:"Template",style:{marginBottom:16},children:(0,t.jsx)(Se,{placeholder:"Choose a template...",allowClear:!0,loading:de,value:i,onChange:e=>{te(e),e&&W(!1)},options:le.map(e=>({value:e.key,label:e.name||e.key})),notFoundContent:de?void 0:(0,t.jsx)(ee,{type:"secondary",style:{padding:8,display:"block"},children:'No templates. Use "Custom Command" below.'})})}),!i&&(0,t.jsx)(t.Fragment,{children:ae?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P.Item,{name:"commandExecutable",label:"Executable",rules:[{required:!0,whitespace:!0,message:"Executable is required"}],style:{marginBottom:16},children:(0,t.jsx)(V,{placeholder:"e.g. node, opencode, /usr/local/bin/my-server"})}),(0,t.jsx)(P.Item,{name:"commandArgs",label:"Arguments",style:{marginBottom:16},children:(0,t.jsx)(V,{placeholder:"e.g. --serve --port 4301"})}),(0,t.jsx)(P.Item,{name:["command","cwd"],label:"Working directory",style:{marginBottom:16},children:(0,t.jsx)(V,{placeholder:"e.g. /Users/me/project"})}),(0,t.jsx)(Z,{type:"link",onClick:()=>{W(!1),o.setFieldsValue({commandExecutable:"",commandArgs:"",command:{cwd:void 0}})},style:{padding:0,marginBottom:16,display:"block"},children:"- Hide Custom Command"})]}):(0,t.jsx)(Z,{type:"link",onClick:()=>W(!0),style:{padding:0,marginBottom:16,display:"block"},children:"+ Custom Command"})})]}),(0,t.jsx)(P.Item,{label:"Agent Card URL",required:!0,style:{marginBottom:16},children:(0,t.jsxs)(Ze.Compact,{style:{width:"100%"},children:[(0,t.jsx)(P.Item,{name:"agentCardProtocol",noStyle:!0,children:(0,t.jsx)(Se,{style:{width:100},options:gn})}),(0,t.jsx)(P.Item,{name:"agentCardUrl",noStyle:!0,rules:[{required:!0,message:"Please enter the A2A server URL"}],children:(0,t.jsx)(V,{placeholder:R==="local"?"localhost:4301":"host:port or full URL"})}),(0,t.jsx)(Z,{icon:(0,t.jsx)(Xe,{}),onClick:T,loading:Ne,children:"Test"})]})}),R==="remote"&&(0,t.jsx)(P.Item,{name:"apiKey",label:"API Key (optional)",style:{marginBottom:16},children:(0,t.jsx)(V.Password,{placeholder:"API key for authentication"})}),(0,t.jsx)(P.Item,{name:"timeout",label:"Timeout (ms)",style:{marginBottom:16},initialValue:3e5,children:(0,t.jsx)(qe,{min:1e3,max:36e5,style:{width:"100%"},placeholder:"300000"})})]}),!_&&(0,t.jsx)(P.Item,{name:"prompt",label:c==="extend"&&I?"System Prompt (leave unchanged to inherit from parent)":"System Prompt",rules:c==="scratch"?[{required:!0,message:"Please enter a system prompt"}]:[],children:(0,t.jsx)(Wt,{placeholder:c==="extend"&&I?"Leave empty to inherit parent's prompt, or enter a new prompt to override...":"Enter the system prompt for this agent...",autoSize:{minRows:4,maxRows:8},style:{fontFamily:"monospace",fontSize:13,lineHeight:1.6}})})]}),on&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(Oe,{style:{margin:"12px 0"}}),(0,t.jsx)(ee,{strong:!0,style:{display:"block",marginBottom:8},children:"Sub-Agents"}),(0,t.jsx)(jt,{subAgentKeys:He,decisions:w,onChange:F})]})]})};var $=x(E()),{Paragraph:yn,Text:Xt}=Y,hn=[{key:"manual",icon:De,title:"Manual Configuration",description:"Define the agent's identity, type, tools, and system prompt yourself."},{key:"external",icon:ot,title:"External Agent",description:"Connect an existing A2A-compatible agent by URL or manage a local runtime."},{key:"learn",icon:st,title:"Learn with Agent Architect",description:"Describe the goal and let Agent Architect build and evaluate the agent with training context."}],en=({open:n,onCancel:r,onSelectMethod:p,focusTriggerAfterClose:d=!0})=>(0,$.jsx)(ue,{title:"Choose how to create your agent",open:n,onCancel:r,footer:null,width:560,centered:!0,destroyOnHidden:!0,focusTriggerAfterClose:d,children:(0,$.jsxs)("div",{style:{padding:"8px 4px 4px"},children:[(0,$.jsx)(yn,{style:{color:"#595959",fontSize:15,margin:"8px 0 24px"},children:"Choose the path that best fits the agent you want to build."}),(0,$.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:hn.map(g=>{let o=g.icon;return(0,$.jsxs)(Z,{type:"default",onClick:()=>p(g.key),"aria-label":g.title,style:{display:"flex",flexDirection:"row",alignItems:"center",gap:16,width:"100%",minHeight:88,height:"auto",padding:16,borderRadius:16,textAlign:"left",whiteSpace:"normal"},children:[(0,$.jsx)("div",{style:{width:40,height:40,borderRadius:12,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"#6366f1",background:"#eeeeff"},children:(0,$.jsx)(o,{size:19})}),(0,$.jsxs)("div",{style:{minWidth:0},children:[(0,$.jsx)(Xt,{strong:!0,style:{display:"block",fontSize:15,marginBottom:3},children:g.title}),(0,$.jsx)(Xt,{style:{color:"#737373",lineHeight:1.5},children:g.description})]})]},g.key)})}),(0,$.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8,flexWrap:"wrap",marginTop:24},children:(0,$.jsx)(Z,{onClick:r,children:"Not now"})})]})});var G=x(E()),bn=n=>{let r=n;if(typeof n=="string")try{r=JSON.parse(n)}catch{return{}}return r!==null&&typeof r=="object"&&!Array.isArray(r)?r:{}},Da=()=>{let{get:n,del:r,put:p}=fe(),[d,g]=(0,u.useState)([]),[o,f]=(0,u.useState)({}),[k,c]=(0,u.useState)(null),[S,H]=(0,u.useState)(!1),[m,I]=(0,u.useState)(null),[K,w]=(0,u.useState)("graph"),[F,N]=(0,u.useState)(null),[_,R]=(0,u.useState)(null),[s,i]=(0,u.useState)(!1),[te,le]=(0,u.useState)(!0),[he,de]=(0,u.useState)(!1),[ce,ne]=(0,u.useState)("learn"),[Ne,be]=(0,u.useState)({}),[ae,W]=(0,u.useState)(null),[Ae,q]=(0,u.useState)(!1),z=(0,u.useCallback)(async()=>{H(!0);try{let[l,h]=await Promise.all([n("/api/assistants"),n("/api/assistants/stats").catch(()=>null)]);if(l.success&&l.data?.records&&g(l.data.records),h?.success&&h.data?.records){let T={};for(let U of h.data.records)T[U.id]=U;f(T),c(h.cache?.expiresAt??null)}}catch{v.error("Failed to load agents")}finally{H(!1)}},[n]);(0,u.useEffect)(()=>{z()},[z]);let Le=u.default.useMemo(()=>It(d),[d]),pe=d.find(l=>l.id===m)??null,me=(0,u.useCallback)((l,h="graph")=>{I(l),w(h),N(null),R(null)},[]),oe=ht(),Ce=(0,u.useCallback)((l,h)=>{let T=d.find(U=>U.id===l)?.name??"Agent";oe({component_key:"agent_detail_side_app",data:{assistantId:l,initialTab:h},message:T})},[d,oe]),xe=(0,u.useCallback)(()=>{le(!0),i(!0)},[]),Be=(0,u.useCallback)(l=>{let T={manual:{mode:"scratch",values:{}},external:{mode:"scratch",values:{type:"a2a_remote"}},learn:{mode:"learn",values:{}}}[l];ne(T.mode),be(T.values),le(!1),i(!1),de(!0)},[]),L=(0,u.useCallback)(async(l,h)=>{let T=bn(l.graphDefinition),U;try{U=await p(`/api/assistants/${l.id}`,{name:h.name!==void 0?h.name:l.name,description:h.description!==void 0?h.description:l.description,graphDefinition:{...T,...h}})}catch(ke){throw v.error("Failed to save agent"),ke}if(!U.success)throw v.error("Failed to save agent"),new Error("Failed to save agent");v.success("Saved"),z()},[p,z]),we=(0,u.useCallback)(l=>{g(h=>h.map(T=>T.id===l.id?l:T))},[]),ve=(0,u.useCallback)(l=>{W(l)},[]),Pe=(0,u.useCallback)(async()=>{if(ae){q(!0);try{(await r(`/api/assistants/${ae}`)).success?(v.success("Agent deleted"),g(h=>h.filter(T=>T.id!==ae)),z(),W(null)):v.error("Failed to delete agent")}catch{v.error("Failed to delete agent")}finally{q(!1)}}},[ae,r,z]),re=(0,u.useCallback)(async l=>{if(!(await r(`/api/assistants/${l}`)).success)throw new Error("Failed to delete agent");v.success("Agent deleted"),g(T=>T.filter(U=>U.id!==l)),z()},[r,z]);return(0,G.jsxs)("div",{style:{height:"100%",background:"#fafafa",overflow:"hidden"},children:[pe?(0,G.jsx)(St,{defaultProjectId:_??void 0,children:(0,G.jsx)(Lt,{assistant:pe,allAssistants:d,onBack:()=>I(null),onDeleted:re,onSave:L,onAssistantUpdated:we,onAgentListInvalidated:z,initialTab:K,initialMessage:F,initialProjectId:_})},pe.id):(0,G.jsx)(G.Fragment,{children:(0,G.jsx)(Gt,{items:Le,assistants:d,stats:o,statsExpiresAt:k,loading:S,onItemClick:l=>Ce(l,"graph"),onOpenPlayground:l=>Ce(l,"playground"),onOpenEval:l=>Ce(l,"eval"),onCreate:xe,onDelete:ve})}),(0,G.jsx)(en,{open:s,onCancel:()=>{le(!0),i(!1)},onSelectMethod:Be,focusTriggerAfterClose:te}),(0,G.jsx)(Qt,{open:he,initialMode:ce,initialValues:Ne,onCancel:()=>de(!1),onSuccess:(l,h)=>{de(!1),g(T=>T.some(ke=>ke.id===l.id)?T:[l,...T]),me(l.id,"graph"),N(h?.initialMessage??null),R(h?.projectId??null),z()}}),(0,G.jsx)(ue,{title:"Delete Agent",open:ae!==null,onCancel:()=>W(null),onOk:Pe,okText:"Delete",okButtonProps:{danger:!0,loading:Ae},cancelText:"Cancel",children:(0,G.jsx)("p",{children:"This action cannot be undone."})})]})};export{Da as AgentGovernanceWorkbench};
|