@axiom-lattice/gateway 4.3.1 → 4.3.3

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.
@@ -1 +1 @@
1
- import{l as C}from"./embed-page-chunk-YPV4BAWI.js";import"./embed-page-chunk-LE6OFJ7R.js";import"./embed-page-chunk-Z4S4OYA4.js";import"./embed-page-chunk-ZKJ7Z7P3.js";import"./embed-page-chunk-KEL6XU6R.js";import"./embed-page-chunk-AC6X2XRH.js";import"./embed-page-chunk-S4XZPBRM.js";import"./embed-page-chunk-U6SL5TG6.js";import"./embed-page-chunk-VRV57DFE.js";import"./embed-page-chunk-4ZSGPIBZ.js";import{b as B}from"./embed-page-chunk-ZXFZANZM.js";import{Ya as T}from"./embed-page-chunk-BRETUPSG.js";import{r as P}from"./embed-page-chunk-T25T2YE6.js";import{a as I}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{U as c,W as p,oa as D,va as b,xa as l}from"./embed-page-chunk-O4QK5LWZ.js";import{a as U}from"./embed-page-chunk-4BKXE5ON.js";import"./embed-page-chunk-IX4WLWCY.js";import"./embed-page-chunk-EUOOO2LS.js";import{e as u}from"./embed-page-chunk-6Y3UYJ6Z.js";var e=u(U());var t=u(I()),G={component_key:"workspace_assistants",data:{},message:"Assistants"},N=r=>{let i=r;if(typeof r=="string")try{i=JSON.parse(r)}catch{return{}}return i!==null&&typeof i=="object"&&!Array.isArray(i)?i:{}},H=({data:r})=>{let{assistantId:i,initialTab:F}=r??{},{get:m,put:f,del:A}=P(),y=T(),[g,w]=(0,e.useState)(null),[R,h]=(0,e.useState)([]),[E,v]=(0,e.useState)(!1),[L,S]=(0,e.useState)(null),d=(0,e.useCallback)(()=>{y(G)},[y]),a=(0,e.useCallback)(async()=>{v(!0),S(null);try{let s=(await m("/api/assistants")).data?.records??[];h(s),w(s.find(o=>o.id===i)??null)}catch{S("Failed to load agent")}finally{v(!1)}},[m,i]);(0,e.useEffect)(()=>{i&&a()},[a,i]);let _=(0,e.useCallback)(async(n,s)=>{let o=N(n.graphDefinition),k;try{k=await f(`/api/assistants/${n.id}`,{name:s.name!==void 0?s.name:n.name,description:s.description!==void 0?s.description:n.description,graphDefinition:{...o,...s}})}catch(z){throw l.error("Failed to save agent"),z}if(!k.success)throw l.error("Failed to save agent"),new Error("Failed to save agent");l.success("Saved"),await a()},[f,a]),j=(0,e.useCallback)(n=>{w(s=>s&&s.id===n.id?n:s),h(s=>s.map(o=>o.id===n.id?n:o))},[]),x=(0,e.useCallback)(async n=>{if(!(await A(`/api/assistants/${n}`)).success)throw new Error("Failed to delete agent");l.success("Agent deleted"),d()},[A,d]);return i?g?(0,t.jsx)("div",{style:{height:"100%",overflow:"auto"},children:(0,t.jsx)(B,{children:(0,t.jsx)(C,{assistant:g,allAssistants:R,onBack:d,onDeleted:x,onSave:_,onAssistantUpdated:j,onAgentListInvalidated:()=>void a(),initialTab:F})},g.id)}):E?(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,t.jsx)(b,{})}):L?(0,t.jsx)("div",{style:{padding:24},children:(0,t.jsx)(c,{type:"error",showIcon:!0,message:"Failed to load agent","data-testid":"detail-error",action:(0,t.jsxs)(D,{children:[(0,t.jsx)(p,{size:"small",onClick:()=>void a(),children:"Retry"}),(0,t.jsx)(p,{size:"small",type:"primary",onClick:d,children:"Back to list"})]})})}):(0,t.jsx)("div",{style:{padding:24},children:(0,t.jsx)(c,{type:"warning",showIcon:!0,message:"Agent not found","data-testid":"detail-not-found",action:(0,t.jsx)(p,{size:"small",type:"primary",onClick:d,children:"Back to list"})})}):(0,t.jsx)("div",{style:{padding:24},children:(0,t.jsx)(c,{type:"warning",showIcon:!0,message:"Missing agent id","data-testid":"detail-missing-id"})})};export{H as AgentDetailSideApp};
1
+ import{l as C}from"./embed-page-chunk-RLP3BC7G.js";import"./embed-page-chunk-LE6OFJ7R.js";import"./embed-page-chunk-Z4S4OYA4.js";import"./embed-page-chunk-ZKJ7Z7P3.js";import"./embed-page-chunk-KEL6XU6R.js";import"./embed-page-chunk-AC6X2XRH.js";import"./embed-page-chunk-S4XZPBRM.js";import"./embed-page-chunk-I42T7B7V.js";import"./embed-page-chunk-VRV57DFE.js";import"./embed-page-chunk-4ZSGPIBZ.js";import{b as B}from"./embed-page-chunk-ZXFZANZM.js";import{Ya as T}from"./embed-page-chunk-BRETUPSG.js";import{r as P}from"./embed-page-chunk-T25T2YE6.js";import{a as I}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{U as c,W as p,oa as D,va as b,xa as l}from"./embed-page-chunk-O4QK5LWZ.js";import{a as U}from"./embed-page-chunk-4BKXE5ON.js";import"./embed-page-chunk-IX4WLWCY.js";import"./embed-page-chunk-EUOOO2LS.js";import{e as u}from"./embed-page-chunk-6Y3UYJ6Z.js";var e=u(U());var t=u(I()),G={component_key:"workspace_assistants",data:{},message:"Assistants"},N=r=>{let i=r;if(typeof r=="string")try{i=JSON.parse(r)}catch{return{}}return i!==null&&typeof i=="object"&&!Array.isArray(i)?i:{}},H=({data:r})=>{let{assistantId:i,initialTab:F}=r??{},{get:m,put:f,del:A}=P(),y=T(),[g,w]=(0,e.useState)(null),[R,h]=(0,e.useState)([]),[E,v]=(0,e.useState)(!1),[L,S]=(0,e.useState)(null),d=(0,e.useCallback)(()=>{y(G)},[y]),a=(0,e.useCallback)(async()=>{v(!0),S(null);try{let s=(await m("/api/assistants")).data?.records??[];h(s),w(s.find(o=>o.id===i)??null)}catch{S("Failed to load agent")}finally{v(!1)}},[m,i]);(0,e.useEffect)(()=>{i&&a()},[a,i]);let _=(0,e.useCallback)(async(n,s)=>{let o=N(n.graphDefinition),k;try{k=await f(`/api/assistants/${n.id}`,{name:s.name!==void 0?s.name:n.name,description:s.description!==void 0?s.description:n.description,graphDefinition:{...o,...s}})}catch(z){throw l.error("Failed to save agent"),z}if(!k.success)throw l.error("Failed to save agent"),new Error("Failed to save agent");l.success("Saved"),await a()},[f,a]),j=(0,e.useCallback)(n=>{w(s=>s&&s.id===n.id?n:s),h(s=>s.map(o=>o.id===n.id?n:o))},[]),x=(0,e.useCallback)(async n=>{if(!(await A(`/api/assistants/${n}`)).success)throw new Error("Failed to delete agent");l.success("Agent deleted"),d()},[A,d]);return i?g?(0,t.jsx)("div",{style:{height:"100%",overflow:"auto"},children:(0,t.jsx)(B,{children:(0,t.jsx)(C,{assistant:g,allAssistants:R,onBack:d,onDeleted:x,onSave:_,onAssistantUpdated:j,onAgentListInvalidated:()=>void a(),initialTab:F})},g.id)}):E?(0,t.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,t.jsx)(b,{})}):L?(0,t.jsx)("div",{style:{padding:24},children:(0,t.jsx)(c,{type:"error",showIcon:!0,message:"Failed to load agent","data-testid":"detail-error",action:(0,t.jsxs)(D,{children:[(0,t.jsx)(p,{size:"small",onClick:()=>void a(),children:"Retry"}),(0,t.jsx)(p,{size:"small",type:"primary",onClick:d,children:"Back to list"})]})})}):(0,t.jsx)("div",{style:{padding:24},children:(0,t.jsx)(c,{type:"warning",showIcon:!0,message:"Agent not found","data-testid":"detail-not-found",action:(0,t.jsx)(p,{size:"small",type:"primary",onClick:d,children:"Back to list"})})}):(0,t.jsx)("div",{style:{padding:24},children:(0,t.jsx)(c,{type:"warning",showIcon:!0,message:"Missing agent id","data-testid":"detail-missing-id"})})};export{H as AgentDetailSideApp};
@@ -1,4 +1,4 @@
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-YPV4BAWI.js";import"./embed-page-chunk-LE6OFJ7R.js";import{a as Ge}from"./embed-page-chunk-Z4S4OYA4.js";import"./embed-page-chunk-ZKJ7Z7P3.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-U6SL5TG6.js";import"./embed-page-chunk-VRV57DFE.js";import"./embed-page-chunk-4ZSGPIBZ.js";import{b as St}from"./embed-page-chunk-ZXFZANZM.js";import{C as at,Da as dt,M as ot,Ma as ct,Oa as pt,P as rt,X as st,Ya as ht,gb as bt,hb as Ke,ja as it,o as De,pa as lt}from"./embed-page-chunk-BRETUPSG.js";import{m as Qe,r as fe}from"./embed-page-chunk-T25T2YE6.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`
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-RLP3BC7G.js";import"./embed-page-chunk-LE6OFJ7R.js";import{a as Ge}from"./embed-page-chunk-Z4S4OYA4.js";import"./embed-page-chunk-ZKJ7Z7P3.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-I42T7B7V.js";import"./embed-page-chunk-VRV57DFE.js";import"./embed-page-chunk-4ZSGPIBZ.js";import{b as St}from"./embed-page-chunk-ZXFZANZM.js";import{C as at,Da as dt,M as ot,Ma as ct,Oa as pt,P as rt,X as st,Ya as ht,gb as bt,hb as Ke,ja as it,o as De,pa as lt}from"./embed-page-chunk-BRETUPSG.js";import{m as Qe,r as fe}from"./embed-page-chunk-T25T2YE6.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
2
  display: flex;
3
3
  justify-content: space-between;
4
4
  align-items: flex-end;