@axiom-lattice/gateway 4.10.1 → 4.11.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.
Files changed (31) hide show
  1. package/dist/chunk-GXZFO3VU.mjs +42 -0
  2. package/dist/chunk-GXZFO3VU.mjs.map +1 -0
  3. package/dist/embed/{embed-page-AgentDetailSideApp-2M4MLVQQ.js → embed-page-AgentDetailSideApp-FHC56ARN.js} +1 -1
  4. package/dist/embed/{embed-page-AgentGovernanceWorkbench-KEVBIQP6.js → embed-page-AgentGovernanceWorkbench-KAPZJBE6.js} +1 -1
  5. package/dist/embed/{embed-page-MessageGraph-PRBUQINR.js → embed-page-MessageGraph-DMP5EZBM.js} +1 -1
  6. package/dist/embed/{embed-page-ReactChart-V6JJXCEV.js → embed-page-ReactChart-PYGNSRHG.js} +1 -1
  7. package/dist/embed/{embed-page-TasksSideApp-OFZI54MF.js → embed-page-TasksSideApp-MPYOPRXW.js} +1 -1
  8. package/dist/embed/{embed-page-TeamWorkspace-QSSAF3AA.js → embed-page-TeamWorkspace-EXUAXKAH.js} +1 -1
  9. package/dist/embed/{embed-page-TopologyRuntimeView-PHULW2NG.js → embed-page-TopologyRuntimeView-MH4YMU7D.js} +1 -1
  10. package/dist/embed/{embed-page-WorkflowAutomationView-LQS6H7X6.js → embed-page-WorkflowAutomationView-KQYFSLLH.js} +1 -1
  11. package/dist/embed/{embed-page-chunk-SSWDAKQU.js → embed-page-chunk-I7BVN6EY.js} +1 -1
  12. package/dist/embed/{embed-page-chunk-D5EY6ASK.js → embed-page-chunk-JSAUTBU5.js} +1 -1
  13. package/dist/embed/{embed-page-chunk-YNHKD2CY.js → embed-page-chunk-NW37OVAX.js} +1 -1
  14. package/dist/embed/{embed-page-chunk-PFCR6CFL.js → embed-page-chunk-QGXGVLAX.js} +1 -1
  15. package/dist/embed/{embed-page-chunk-7PNQFZMK.js → embed-page-chunk-QHXKZNDU.js} +6 -6
  16. package/dist/embed/{embed-page-chunk-IJ2YWGKU.js → embed-page-chunk-YQZI5LNV.js} +1 -1
  17. package/dist/embed/embed-page.js +1 -1
  18. package/dist/index.d.mts +27 -1
  19. package/dist/index.d.ts +27 -1
  20. package/dist/index.js +171 -13
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +169 -14
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/{open-FJ3BY3CL.mjs → open-GNBMCHYA.mjs} +4 -39
  25. package/dist/open-GNBMCHYA.mjs.map +1 -0
  26. package/dist/{open-files-V3R2BFTV.mjs → open-files-FS5AN6Q6.mjs} +4 -4
  27. package/dist/openRateLimiter-XEOL3A5G.mjs +8 -0
  28. package/dist/openRateLimiter-XEOL3A5G.mjs.map +1 -0
  29. package/package.json +7 -7
  30. package/dist/open-FJ3BY3CL.mjs.map +0 -1
  31. /package/dist/{open-files-V3R2BFTV.mjs.map → open-files-FS5AN6Q6.mjs.map} +0 -0
@@ -2513,7 +2513,7 @@ assistants:`,a.assistants.map(v=>({id:v.id,name:v.name}))),n(v=>({...v,currentAs
2513
2513
  outline-offset: 2px;
2514
2514
  border-radius: 4px;
2515
2515
  }
2516
- `})),U2=({item:e,viewChat:t})=>{let{styles:r}=jO(),o=re(),a=typeof e.detail?.markdown=="string"&&e.detail.markdown.length>0?e.detail.markdown:void 0,n=typeof e.detail?.result=="string"&&e.detail.result.length>0?e.detail.result:void 0,i=e.detail?.beliefImpact,s=(Array.isArray(i)?i:[]).filter(c=>typeof c=="object"&&c!==null).map(c=>({key:typeof c.key=="string"?c.key:"",after:typeof c.after=="number"?c.after:Number.NaN,basis:typeof c.basis=="string"?c.basis:""})).filter(c=>c.key.length>0),l=!!(e.threadId&&t);return!a&&!n&&s.length===0&&!l?null:(0,Ma.jsxs)("div",{className:r.root,"data-testid":"task-activity-detail",children:[a&&(0,Ma.jsx)("div",{className:r.markdown,children:(0,Ma.jsx)(Qt,{content:a})}),n&&(0,Ma.jsxs)("div",{className:r.markdown,children:[(0,Ma.jsx)("div",{className:r.resultLabel,children:o("tasks.activity.result")}),(0,Ma.jsx)(Qt,{content:n})]}),s.length>0&&(0,Ma.jsxs)(Ma.Fragment,{children:[(0,Ma.jsx)("div",{className:r.resultLabel,children:o("tasks.activity.beliefImpact")}),(0,Ma.jsx)("div",{className:r.impactList,children:s.map((c,u)=>(0,Ma.jsxs)("span",{className:r.impactRow,children:[(0,Ma.jsxs)("span",{className:r.impactKey,children:[c.key,":"]}),(0,Ma.jsx)("span",{children:o("tasks.activity.reported",{value:Number.isFinite(c.after)?`${c.after}%`:o("tasks.activity.notAvailable")})}),c.basis&&(0,Ma.jsxs)("span",{className:r.impactBasis,children:["\u2014 ",c.basis]})]},`${c.key}-${u}`))})]}),l&&(0,Ma.jsxs)("button",{type:"button",className:r.viewChat,onClick:t,children:[(0,Ma.jsx)(As,{size:12}),o("tasks.activity.viewChat")]})]})};var Ws=T(le());var Hs=T(V()),AP=50,UO=Re(({token:e,css:t})=>({root:t`
2516
+ `})),U2=({item:e,viewChat:t})=>{let{styles:r}=jO(),o=re(),a=typeof e.detail?.markdown=="string"&&e.detail.markdown.length>0?e.detail.markdown:void 0,n=typeof e.detail?.result=="string"&&e.detail.result.length>0?e.detail.result:void 0,i=e.detail?.beliefImpact,s=(Array.isArray(i)?i:[]).filter(c=>typeof c=="object"&&c!==null).map(c=>({key:typeof c.key=="string"?c.key:"",after:typeof c.after=="number"?c.after:Number.NaN,basis:typeof c.basis=="string"?c.basis:""})).filter(c=>c.key.length>0),l=!!(e.threadId&&t);return!a&&!n&&s.length===0&&!l?null:(0,Ma.jsxs)("div",{className:r.root,"data-testid":"task-activity-detail",children:[a&&(0,Ma.jsx)("div",{className:r.markdown,children:(0,Ma.jsx)(Qt,{content:a})}),n&&(0,Ma.jsxs)("div",{className:r.markdown,children:[(0,Ma.jsx)("div",{className:r.resultLabel,children:o("tasks.activity.result")}),(0,Ma.jsx)(Qt,{content:n})]}),s.length>0&&(0,Ma.jsxs)(Ma.Fragment,{children:[(0,Ma.jsx)("div",{className:r.resultLabel,children:o("tasks.activity.beliefImpact")}),(0,Ma.jsx)("div",{className:r.impactList,children:s.map((c,u)=>(0,Ma.jsxs)("span",{className:r.impactRow,children:[(0,Ma.jsxs)("span",{className:r.impactKey,children:[c.key,":"]}),(0,Ma.jsx)("span",{children:o("tasks.activity.reported",{value:Number.isFinite(c.after)?`${c.after}%`:o("tasks.activity.notAvailable")})}),c.basis&&(0,Ma.jsxs)("span",{className:r.impactBasis,children:["\u2014 ",c.basis]})]},`${c.key}-${u}`))})]}),l&&(0,Ma.jsxs)("button",{type:"button",className:r.viewChat,onClick:t,children:[(0,Ma.jsx)(As,{size:12}),o("tasks.activity.viewChat")]})]})};var Ws=T(le());var Hs=T(V()),AP=100,UO=Re(({token:e,css:t})=>({root:t`
2517
2517
  margin-top: 12px;
2518
2518
  `,error:t`
2519
2519
  margin-top: 8px;
@@ -4367,7 +4367,7 @@ ${ie}`.trim()),it.success(c("common.copied"))},[c]),ne=(0,ta.useCallback)(async
4367
4367
  display: flex;
4368
4368
  align-items: center;
4369
4369
  gap: 16px;
4370
- `})),az={running:{color:"processing",labelKey:"eval.status.running"},completed:{color:"success",labelKey:"eval.status.completed"},failed:{color:"error",labelKey:"eval.status.failed"},aborted:{color:"warning",labelKey:"eval.status.aborted"}},vw=({initial:e})=>{let t=re(),{styles:r,cx:o}=oz(),{token:a}=Or.useToken(),{projects:n}=WA(),[i,s]=(0,mi.useState)(e?.projectId??""),[l,c]=(0,mi.useState)(e?.page??"dashboard"),[u,p]=(0,mi.useState)(e?.suiteId??""),[m,d]=(0,mi.useState)(e?.runId??"");mi.default.useEffect(()=>{!i&&n.length>0&&s(n[0].id)},[n,i]);let{suites:x}=Il(i),{runs:h,start:g,remove:v}=$u(i),{workspaceId:C,projectId:w}=Yr(),[I,R]=(0,mi.useState)(!1),[z,F]=(0,mi.useState)(null),E=_=>({workspaceId:C||void 0,projectId:_||w||void 0}),U=()=>R(!0),D=(0,mi.useMemo)(()=>{let _=x.reduce(($,Y)=>$+(Y.caseCount??0),0),j=h[0],H=j?.totalCases>0?Math.round(j.passedCases/j.totalCases*100):null;return{totalCases:_,passRate:H,suiteCount:x.length,runCount:h.length}},[x,h]),L=(_,j,H)=>{c(_),j!==void 0&&p(j),H!==void 0&&d(H)};mi.default.useEffect(()=>{e&&(e.projectId!==void 0&&s(e.projectId),e.page!==void 0&&c(e.page),e.suiteId!==void 0&&p(e.suiteId),e.runId!==void 0&&d(e.runId))},[e?.projectId,e?.page,e?.suiteId,e?.runId]);let S=l==="suite"&&!u||l==="run"&&!m?"dashboard":l,P=({icon:_,bg:j,label:H,value:$})=>(0,Ze.jsx)(Er,{className:r.statCard,styles:{body:{padding:0}},size:"small",children:(0,Ze.jsxs)("div",{className:r.statInner,children:[(0,Ze.jsx)("div",{className:r.statIcon,style:{background:j},children:_}),(0,Ze.jsxs)("div",{children:[(0,Ze.jsx)("div",{className:r.statValue,children:$}),(0,Ze.jsx)("div",{className:r.statLabel,children:H})]})]})});if(S==="dashboard")return(0,Ze.jsxs)("div",{className:r.shell,children:[(0,Ze.jsxs)("div",{className:r.topBar,children:[(0,Ze.jsxs)("div",{className:r.topLeft,children:[(0,Ze.jsx)("div",{className:r.pageIcon,children:(0,Ze.jsx)(Li,{size:20,color:a.colorPrimary})}),(0,Ze.jsx)("span",{className:r.pageTitle,children:t("eval.dashboard.title")})]}),(0,Ze.jsxs)("div",{className:r.topRight,children:[(0,Ze.jsx)(ha,{menu:{items:n.map(_=>({key:_.id,label:(0,Ze.jsxs)("div",{children:[(0,Ze.jsx)("div",{children:_.name}),(0,Ze.jsx)(ms,{type:"secondary",style:{fontSize:11},children:_.targetServerConfig?.base_url||"\u2014"})]}),onClick:()=>s(_.id)}))},children:(0,Ze.jsxs)("div",{className:r.projectBtn,children:[(0,Ze.jsx)("div",{className:r.projectDot}),(0,Ze.jsxs)("div",{style:{textAlign:"left"},children:[(0,Ze.jsx)("div",{style:{lineHeight:1.3},children:n.find(_=>_.id===i)?.name||t("eval.dashboard.selectProject")}),(0,Ze.jsx)(ms,{type:"secondary",style:{fontSize:11},children:n.find(_=>_.id===i)?.targetServerConfig?.base_url||""})]}),(0,Ze.jsx)(Ri,{size:14})]})}),(0,Ze.jsx)(he,{type:"primary",icon:(0,Ze.jsx)(Ms,{size:16}),onClick:()=>L("suites"),children:t("eval.dashboard.goToSuites")})]})]}),(0,Ze.jsxs)("div",{className:r.body,children:[(0,Ze.jsxs)(Qd,{gutter:[16,16],className:r.statRow,children:[(0,Ze.jsx)(ll,{span:6,children:(0,Ze.jsx)(P,{icon:(0,Ze.jsx)(Li,{size:22,color:a.colorPrimary}),bg:`${a.colorPrimary}14`,label:t("eval.suites.title"),value:D.suiteCount})}),(0,Ze.jsx)(ll,{span:6,children:(0,Ze.jsx)(P,{icon:(0,Ze.jsx)(Ai,{size:22,color:a.colorSuccess}),bg:`${a.colorSuccess}14`,label:t("eval.cases.title"),value:D.totalCases})}),(0,Ze.jsx)(ll,{span:6,children:(0,Ze.jsx)(P,{icon:(0,Ze.jsx)(cp,{size:22,color:a.colorInfo}),bg:`${a.colorInfo}14`,label:t("eval.dashboard.totalRuns"),value:D.runCount})}),(0,Ze.jsx)(ll,{span:6,children:(0,Ze.jsx)(P,{icon:D.passRate!==null&&D.passRate>=80?(0,Ze.jsx)(ii,{size:22,color:a.colorSuccess}):(0,Ze.jsx)(ss,{size:22,color:a.colorWarning}),bg:D.passRate!==null?`${a.colorSuccess}14`:`${a.colorFill}`,label:t("eval.dashboard.latestPassRate"),value:D.passRate!==null?`${D.passRate}%`:t("eval.dashboard.notAvailable")})})]}),(0,Ze.jsxs)("div",{className:r.section,children:[(0,Ze.jsxs)("div",{className:r.sectionHead,children:[(0,Ze.jsxs)("h3",{className:r.sectionTitle,children:[(0,Ze.jsx)(Li,{size:16}),t("eval.dashboard.suitesSection")]}),(0,Ze.jsxs)(he,{size:"small",type:"text",onClick:()=>L("suites"),children:[t("eval.dashboard.viewAll")," ",(0,Ze.jsx)(Vm,{size:14,style:{marginLeft:4}})]})]}),(0,Ze.jsx)(hw,{projectId:i,onSelectSuite:(_,j)=>L("suite",j)})]}),(0,Ze.jsxs)("div",{className:r.section,children:[(0,Ze.jsx)("div",{className:r.sectionHead,children:(0,Ze.jsxs)("h3",{className:r.sectionTitle,children:[(0,Ze.jsx)(cp,{size:16}),t("eval.recentRuns.title")]})}),(0,Ze.jsx)(Er,{styles:{body:{padding:0}},size:"small",children:h.length===0?(0,Ze.jsx)("div",{style:{padding:40,textAlign:"center"},children:(0,Ze.jsx)(ms,{type:"secondary",children:t("eval.dashboard.noRuns")})}):h.slice(0,5).map(_=>{let j=az[_.status],H=_.createdAt?new Date(_.createdAt):null,$=_.completedAt?new Date(_.completedAt):null,Y=H&&$?$.getTime()-H.getTime():null,G=_.totalCases>0?Math.round(_.passedCases/_.totalCases*100):null,ne=B=>{let Q=J=>String(J).padStart(2,"0");return`${B.getFullYear()}-${Q(B.getMonth()+1)}-${Q(B.getDate())} ${Q(B.getHours())}:${Q(B.getMinutes())}`},N=B=>B<1e3?`${B}ms`:B<6e4?`${(B/1e3).toFixed(1)}s`:`${Math.floor(B/6e4)}m ${Math.round(B%6e4/1e3)}s`,O=_.id?.slice(0,8);return(0,Ze.jsxs)("div",{className:r.runRow,onClick:()=>L("run",void 0,_.id),children:[(0,Ze.jsxs)("div",{className:r.runRowLeft,children:[(0,Ze.jsx)(ms,{code:!0,style:{fontSize:12,marginRight:8},children:O}),H&&(0,Ze.jsxs)(ms,{type:"secondary",style:{fontSize:12,minWidth:120},children:[(0,Ze.jsx)(cu,{size:11,style:{marginRight:3,verticalAlign:"middle"}}),ne(H)]}),(0,Ze.jsxs)(ms,{style:{fontSize:13},children:[(0,Ze.jsx)(ms,{type:"success",children:_.passedCases}),(0,Ze.jsxs)(ms,{type:"secondary",children:[" ",t("eval.run.passed")," "]}),(0,Ze.jsx)(ms,{type:"danger",children:_.failedCases}),(0,Ze.jsxs)(ms,{type:"secondary",children:[" ",t("eval.run.failed")]})]}),G!==null&&(0,Ze.jsxs)(Pt,{color:G>=80?"success":G>=50?"warning":"error",children:[G,"%"]}),_.envProjectId&&(0,Ze.jsx)(Pt,{icon:(0,Ze.jsx)(uu,{size:11}),color:"blue",style:{marginRight:0},children:_.envProjectId})]}),(0,Ze.jsxs)("div",{className:r.runRowRight,style:{gap:16},children:[Y!==null&&(0,Ze.jsx)(ms,{type:"secondary",style:{fontSize:12},children:N(Y)}),(0,Ze.jsx)(Pt,{color:j?.color??"default",style:{margin:0},children:j?t(j.labelKey):_.status}),(0,Ze.jsx)(ms,{strong:!0,style:{fontSize:15,minWidth:40,textAlign:"right"},children:typeof _.avgScore=="number"?_.avgScore.toFixed(1):"\u2014"}),(0,Ze.jsx)(_n,{title:t("eval.run.deleteTitle"),description:t("eval.run.deleteDescription"),onConfirm:async B=>{B?.stopPropagation(),await v(_.id),it.success(t("eval.run.deleted"))},onCancel:B=>B?.stopPropagation(),okText:t("common.delete"),okButtonProps:{danger:!0},children:(0,Ze.jsx)(he,{type:"text",size:"small",danger:!0,icon:(0,Ze.jsx)(On,{size:14}),onClick:B=>B.stopPropagation()})})]})]},_.id)})})]})]})]});let A=()=>{let[_,j]=(0,mi.useState)(!1),[H,$]=(0,mi.useState)(""),{create:Y}=Il(i),G=async()=>{H.trim()&&(await Y(i,{name:H.trim()}),$(""),j(!1))};return(0,Ze.jsxs)("div",{className:r.shell,children:[(0,Ze.jsxs)("div",{className:r.topBar,children:[(0,Ze.jsxs)("div",{className:r.topLeft,children:[(0,Ze.jsx)("button",{className:r.breadcrumb,onClick:()=>L("dashboard"),children:t("eval.dashboard.breadcrumb")}),(0,Ze.jsx)("span",{className:r.breadcrumbSep,children:"/"}),(0,Ze.jsx)("span",{className:r.pageTitle,children:t("eval.suites.title")})]}),(0,Ze.jsxs)("div",{className:r.topRight,children:[(0,Ze.jsx)(he,{icon:(0,Ze.jsx)(Ms,{size:16}),onClick:()=>j(!_),children:t("eval.suite.newSuite")}),(0,Ze.jsx)(he,{type:"primary",icon:(0,Ze.jsx)(Ms,{size:16}),onClick:U,children:t("eval.suite.runAll")})]})]}),_&&(0,Ze.jsxs)("div",{style:{padding:"12px 28px",borderBottom:`1px solid ${a.colorBorderSecondary}`,display:"flex",gap:8},children:[(0,Ze.jsx)("input",{type:"text",placeholder:t("eval.suite.namePlaceholder"),value:H,onChange:ne=>$(ne.target.value),onKeyDown:ne=>ne.key==="Enter"&&G(),autoFocus:!0,style:{width:260,padding:"6px 12px",border:`1px solid ${a.colorBorder}`,borderRadius:a.borderRadius,fontSize:14,outline:"none"}}),(0,Ze.jsx)(he,{type:"primary",size:"small",onClick:G,children:t("common.create")}),(0,Ze.jsx)(he,{size:"small",onClick:()=>j(!1),children:t("common.cancel")})]}),(0,Ze.jsx)("div",{className:r.body,children:(0,Ze.jsx)(hw,{projectId:i,onSelectSuite:(ne,N)=>L("suite",N)})}),(0,Ze.jsx)(u0,{open:I,onClose:()=>R(!1),onRun:async ne=>{let N=await g(i,ne);N?.run_id&&L("run",void 0,N.run_id)}})]})};return S==="suites"?(0,Ze.jsx)(A,{}):S==="suite"&&u?(0,Ze.jsx)(UA,{projectId:i,suiteId:u,onBack:()=>L("suites"),onRun:_=>L("run",void 0,_)}):S==="run"&&m?(0,Ze.jsx)(HA,{runId:m,onBack:()=>L("dashboard")}):null};var h0=T(le());var g0=T(le());var VA=T(le());var GA=T(V()),{Text:ebe}=ke;var KA=T(V()),{Text:dbe}=ke;var bw=T(le());var ww=T(V()),{Text:bbe,Paragraph:wbe}=ke;var Cw=T(V()),{Text:Ebe}=ke;var Sw=T(le());var XA=T(V()),{Text:zbe}=ke;var kw=T(le());var y0=T(le());var YA=T(le());var JA=T(V()),{Text:Xbe}=ke;var Iw=T(V()),{Text:i2e}=ke;var N0=T(le());var x0=T(V()),nz=({defaultWorkspaceId:e,defaultProjectId:t,children:r})=>{let o=Zt("__GLOBAL__");return(0,x0.jsx)(K1,{workspaceId:e,projectId:t,client:o,children:r})},v0=({children:e,defaultProjectId:t,defaultWorkspaceId:r})=>{let{config:{baseURL:o}}=Et();return(0,x0.jsx)(NS,{config:{baseURL:o,apiKey:"",assistantId:"__GLOBAL__",transport:"sse"},children:(0,x0.jsx)(nz,{defaultWorkspaceId:r,defaultProjectId:t,children:e})})},u2e=v0;var Tw=T(V()),Rw=()=>{let{toolsVisible:e,toggleTools:t}=Tr(),r=re();return(0,Tw.jsx)($p,{ariaLabel:r("chat.file.toggleDirectory"),icon:(0,Tw.jsx)(Pi,{size:16}),onClick:t,pressed:e})};var b0=T(le());var Vp=T(V()),iz=(0,b0.lazy)(()=>import("./embed-page-TasksSideApp-OFZI54MF.js").then(e=>({default:e.TasksSideApp}))),Lw=()=>{let{openSideApp:e,sideAppVisible:t,sideAppSelectedCard:r}=Tr(),o=re(),a=t&&r?.component_key==="tasks_side_app_pin",n=()=>{a||e({component_key:"tasks_side_app_pin",message:o("tasks.title"),data:{component:(0,Vp.jsx)(b0.Suspense,{fallback:(0,Vp.jsx)(Ct,{style:{display:"block",margin:"auto"}}),children:(0,Vp.jsx)(iz,{showProjectFilter:!1})})}})};return(0,Vp.jsx)($p,{ariaLabel:o("tasks.button.open"),icon:(0,Vp.jsx)(pl,{size:16}),onClick:n})};var w0=T(le());var Ha=T(le());var vn=T(V()),{ErrorBoundary:sz}=uo,lz=({message:e,renderContent:t,autoLoadRightPanel:r})=>{let o=(0,Ha.useRef)(null),[a,n]=(0,Ha.useState)(!1),[i,s]=(0,Ha.useState)(!1);return(0,Ha.useEffect)(()=>{let c=new IntersectionObserver(([u])=>{let p=u.isIntersecting;n(p),p&&!i&&s(!0)},{threshold:.1});return o.current&&c.observe(o.current),()=>{o.current&&c.unobserve(o.current)}},[i]),(0,Ha.useEffect)(()=>{r?.()},[]),(0,vn.jsx)(sz,{children:(0,vn.jsx)("div",{ref:o,style:{width:"100%"},children:a||i?t(e):(()=>{let c=(e.tool_calls?.length??0)*140,u=e.content?Math.min(100,e.content.length/5)+c:100+c;return(0,vn.jsx)("div",{style:{height:`${u}px`,minHeight:"50px"}})})()})})},ZA=(0,Ha.memo)(({items:e,role:t,className:r})=>(0,vn.jsx)(Kx.List,{autoScroll:!0,items:e,role:t,className:r},"messages"));ZA.displayName="MemoizedBubbleList";var QA=({messages:e,className:t,isLoading:r=!1})=>{let{styles:o}=od(),a=qt(),n=(0,Ha.useDeferredValue)(e),i=r?n:e,s=(0,Ha.useRef)(i?.length??0);(0,Ha.useEffect)(()=>{i?.length&&(s.current=i?.length)},[i?.length]);let l=(0,Ha.useCallback)(p=>{let{content:m}=p;try{let h=JSON.parse(m);if(h.action&&h.message)return(0,vn.jsx)(Qt,{content:h.message})}catch{}let d=p.tool_calls?.map(h=>{try{return`\`\`\`tool_call
4370
+ `})),az={running:{color:"processing",labelKey:"eval.status.running"},completed:{color:"success",labelKey:"eval.status.completed"},failed:{color:"error",labelKey:"eval.status.failed"},aborted:{color:"warning",labelKey:"eval.status.aborted"}},vw=({initial:e})=>{let t=re(),{styles:r,cx:o}=oz(),{token:a}=Or.useToken(),{projects:n}=WA(),[i,s]=(0,mi.useState)(e?.projectId??""),[l,c]=(0,mi.useState)(e?.page??"dashboard"),[u,p]=(0,mi.useState)(e?.suiteId??""),[m,d]=(0,mi.useState)(e?.runId??"");mi.default.useEffect(()=>{!i&&n.length>0&&s(n[0].id)},[n,i]);let{suites:x}=Il(i),{runs:h,start:g,remove:v}=$u(i),{workspaceId:C,projectId:w}=Yr(),[I,R]=(0,mi.useState)(!1),[z,F]=(0,mi.useState)(null),E=_=>({workspaceId:C||void 0,projectId:_||w||void 0}),U=()=>R(!0),D=(0,mi.useMemo)(()=>{let _=x.reduce(($,Y)=>$+(Y.caseCount??0),0),j=h[0],H=j?.totalCases>0?Math.round(j.passedCases/j.totalCases*100):null;return{totalCases:_,passRate:H,suiteCount:x.length,runCount:h.length}},[x,h]),L=(_,j,H)=>{c(_),j!==void 0&&p(j),H!==void 0&&d(H)};mi.default.useEffect(()=>{e&&(e.projectId!==void 0&&s(e.projectId),e.page!==void 0&&c(e.page),e.suiteId!==void 0&&p(e.suiteId),e.runId!==void 0&&d(e.runId))},[e?.projectId,e?.page,e?.suiteId,e?.runId]);let S=l==="suite"&&!u||l==="run"&&!m?"dashboard":l,P=({icon:_,bg:j,label:H,value:$})=>(0,Ze.jsx)(Er,{className:r.statCard,styles:{body:{padding:0}},size:"small",children:(0,Ze.jsxs)("div",{className:r.statInner,children:[(0,Ze.jsx)("div",{className:r.statIcon,style:{background:j},children:_}),(0,Ze.jsxs)("div",{children:[(0,Ze.jsx)("div",{className:r.statValue,children:$}),(0,Ze.jsx)("div",{className:r.statLabel,children:H})]})]})});if(S==="dashboard")return(0,Ze.jsxs)("div",{className:r.shell,children:[(0,Ze.jsxs)("div",{className:r.topBar,children:[(0,Ze.jsxs)("div",{className:r.topLeft,children:[(0,Ze.jsx)("div",{className:r.pageIcon,children:(0,Ze.jsx)(Li,{size:20,color:a.colorPrimary})}),(0,Ze.jsx)("span",{className:r.pageTitle,children:t("eval.dashboard.title")})]}),(0,Ze.jsxs)("div",{className:r.topRight,children:[(0,Ze.jsx)(ha,{menu:{items:n.map(_=>({key:_.id,label:(0,Ze.jsxs)("div",{children:[(0,Ze.jsx)("div",{children:_.name}),(0,Ze.jsx)(ms,{type:"secondary",style:{fontSize:11},children:_.targetServerConfig?.base_url||"\u2014"})]}),onClick:()=>s(_.id)}))},children:(0,Ze.jsxs)("div",{className:r.projectBtn,children:[(0,Ze.jsx)("div",{className:r.projectDot}),(0,Ze.jsxs)("div",{style:{textAlign:"left"},children:[(0,Ze.jsx)("div",{style:{lineHeight:1.3},children:n.find(_=>_.id===i)?.name||t("eval.dashboard.selectProject")}),(0,Ze.jsx)(ms,{type:"secondary",style:{fontSize:11},children:n.find(_=>_.id===i)?.targetServerConfig?.base_url||""})]}),(0,Ze.jsx)(Ri,{size:14})]})}),(0,Ze.jsx)(he,{type:"primary",icon:(0,Ze.jsx)(Ms,{size:16}),onClick:()=>L("suites"),children:t("eval.dashboard.goToSuites")})]})]}),(0,Ze.jsxs)("div",{className:r.body,children:[(0,Ze.jsxs)(Qd,{gutter:[16,16],className:r.statRow,children:[(0,Ze.jsx)(ll,{span:6,children:(0,Ze.jsx)(P,{icon:(0,Ze.jsx)(Li,{size:22,color:a.colorPrimary}),bg:`${a.colorPrimary}14`,label:t("eval.suites.title"),value:D.suiteCount})}),(0,Ze.jsx)(ll,{span:6,children:(0,Ze.jsx)(P,{icon:(0,Ze.jsx)(Ai,{size:22,color:a.colorSuccess}),bg:`${a.colorSuccess}14`,label:t("eval.cases.title"),value:D.totalCases})}),(0,Ze.jsx)(ll,{span:6,children:(0,Ze.jsx)(P,{icon:(0,Ze.jsx)(cp,{size:22,color:a.colorInfo}),bg:`${a.colorInfo}14`,label:t("eval.dashboard.totalRuns"),value:D.runCount})}),(0,Ze.jsx)(ll,{span:6,children:(0,Ze.jsx)(P,{icon:D.passRate!==null&&D.passRate>=80?(0,Ze.jsx)(ii,{size:22,color:a.colorSuccess}):(0,Ze.jsx)(ss,{size:22,color:a.colorWarning}),bg:D.passRate!==null?`${a.colorSuccess}14`:`${a.colorFill}`,label:t("eval.dashboard.latestPassRate"),value:D.passRate!==null?`${D.passRate}%`:t("eval.dashboard.notAvailable")})})]}),(0,Ze.jsxs)("div",{className:r.section,children:[(0,Ze.jsxs)("div",{className:r.sectionHead,children:[(0,Ze.jsxs)("h3",{className:r.sectionTitle,children:[(0,Ze.jsx)(Li,{size:16}),t("eval.dashboard.suitesSection")]}),(0,Ze.jsxs)(he,{size:"small",type:"text",onClick:()=>L("suites"),children:[t("eval.dashboard.viewAll")," ",(0,Ze.jsx)(Vm,{size:14,style:{marginLeft:4}})]})]}),(0,Ze.jsx)(hw,{projectId:i,onSelectSuite:(_,j)=>L("suite",j)})]}),(0,Ze.jsxs)("div",{className:r.section,children:[(0,Ze.jsx)("div",{className:r.sectionHead,children:(0,Ze.jsxs)("h3",{className:r.sectionTitle,children:[(0,Ze.jsx)(cp,{size:16}),t("eval.recentRuns.title")]})}),(0,Ze.jsx)(Er,{styles:{body:{padding:0}},size:"small",children:h.length===0?(0,Ze.jsx)("div",{style:{padding:40,textAlign:"center"},children:(0,Ze.jsx)(ms,{type:"secondary",children:t("eval.dashboard.noRuns")})}):h.slice(0,5).map(_=>{let j=az[_.status],H=_.createdAt?new Date(_.createdAt):null,$=_.completedAt?new Date(_.completedAt):null,Y=H&&$?$.getTime()-H.getTime():null,G=_.totalCases>0?Math.round(_.passedCases/_.totalCases*100):null,ne=B=>{let Q=J=>String(J).padStart(2,"0");return`${B.getFullYear()}-${Q(B.getMonth()+1)}-${Q(B.getDate())} ${Q(B.getHours())}:${Q(B.getMinutes())}`},N=B=>B<1e3?`${B}ms`:B<6e4?`${(B/1e3).toFixed(1)}s`:`${Math.floor(B/6e4)}m ${Math.round(B%6e4/1e3)}s`,O=_.id?.slice(0,8);return(0,Ze.jsxs)("div",{className:r.runRow,onClick:()=>L("run",void 0,_.id),children:[(0,Ze.jsxs)("div",{className:r.runRowLeft,children:[(0,Ze.jsx)(ms,{code:!0,style:{fontSize:12,marginRight:8},children:O}),H&&(0,Ze.jsxs)(ms,{type:"secondary",style:{fontSize:12,minWidth:120},children:[(0,Ze.jsx)(cu,{size:11,style:{marginRight:3,verticalAlign:"middle"}}),ne(H)]}),(0,Ze.jsxs)(ms,{style:{fontSize:13},children:[(0,Ze.jsx)(ms,{type:"success",children:_.passedCases}),(0,Ze.jsxs)(ms,{type:"secondary",children:[" ",t("eval.run.passed")," "]}),(0,Ze.jsx)(ms,{type:"danger",children:_.failedCases}),(0,Ze.jsxs)(ms,{type:"secondary",children:[" ",t("eval.run.failed")]})]}),G!==null&&(0,Ze.jsxs)(Pt,{color:G>=80?"success":G>=50?"warning":"error",children:[G,"%"]}),_.envProjectId&&(0,Ze.jsx)(Pt,{icon:(0,Ze.jsx)(uu,{size:11}),color:"blue",style:{marginRight:0},children:_.envProjectId})]}),(0,Ze.jsxs)("div",{className:r.runRowRight,style:{gap:16},children:[Y!==null&&(0,Ze.jsx)(ms,{type:"secondary",style:{fontSize:12},children:N(Y)}),(0,Ze.jsx)(Pt,{color:j?.color??"default",style:{margin:0},children:j?t(j.labelKey):_.status}),(0,Ze.jsx)(ms,{strong:!0,style:{fontSize:15,minWidth:40,textAlign:"right"},children:typeof _.avgScore=="number"?_.avgScore.toFixed(1):"\u2014"}),(0,Ze.jsx)(_n,{title:t("eval.run.deleteTitle"),description:t("eval.run.deleteDescription"),onConfirm:async B=>{B?.stopPropagation(),await v(_.id),it.success(t("eval.run.deleted"))},onCancel:B=>B?.stopPropagation(),okText:t("common.delete"),okButtonProps:{danger:!0},children:(0,Ze.jsx)(he,{type:"text",size:"small",danger:!0,icon:(0,Ze.jsx)(On,{size:14}),onClick:B=>B.stopPropagation()})})]})]},_.id)})})]})]})]});let A=()=>{let[_,j]=(0,mi.useState)(!1),[H,$]=(0,mi.useState)(""),{create:Y}=Il(i),G=async()=>{H.trim()&&(await Y(i,{name:H.trim()}),$(""),j(!1))};return(0,Ze.jsxs)("div",{className:r.shell,children:[(0,Ze.jsxs)("div",{className:r.topBar,children:[(0,Ze.jsxs)("div",{className:r.topLeft,children:[(0,Ze.jsx)("button",{className:r.breadcrumb,onClick:()=>L("dashboard"),children:t("eval.dashboard.breadcrumb")}),(0,Ze.jsx)("span",{className:r.breadcrumbSep,children:"/"}),(0,Ze.jsx)("span",{className:r.pageTitle,children:t("eval.suites.title")})]}),(0,Ze.jsxs)("div",{className:r.topRight,children:[(0,Ze.jsx)(he,{icon:(0,Ze.jsx)(Ms,{size:16}),onClick:()=>j(!_),children:t("eval.suite.newSuite")}),(0,Ze.jsx)(he,{type:"primary",icon:(0,Ze.jsx)(Ms,{size:16}),onClick:U,children:t("eval.suite.runAll")})]})]}),_&&(0,Ze.jsxs)("div",{style:{padding:"12px 28px",borderBottom:`1px solid ${a.colorBorderSecondary}`,display:"flex",gap:8},children:[(0,Ze.jsx)("input",{type:"text",placeholder:t("eval.suite.namePlaceholder"),value:H,onChange:ne=>$(ne.target.value),onKeyDown:ne=>ne.key==="Enter"&&G(),autoFocus:!0,style:{width:260,padding:"6px 12px",border:`1px solid ${a.colorBorder}`,borderRadius:a.borderRadius,fontSize:14,outline:"none"}}),(0,Ze.jsx)(he,{type:"primary",size:"small",onClick:G,children:t("common.create")}),(0,Ze.jsx)(he,{size:"small",onClick:()=>j(!1),children:t("common.cancel")})]}),(0,Ze.jsx)("div",{className:r.body,children:(0,Ze.jsx)(hw,{projectId:i,onSelectSuite:(ne,N)=>L("suite",N)})}),(0,Ze.jsx)(u0,{open:I,onClose:()=>R(!1),onRun:async ne=>{let N=await g(i,ne);N?.run_id&&L("run",void 0,N.run_id)}})]})};return S==="suites"?(0,Ze.jsx)(A,{}):S==="suite"&&u?(0,Ze.jsx)(UA,{projectId:i,suiteId:u,onBack:()=>L("suites"),onRun:_=>L("run",void 0,_)}):S==="run"&&m?(0,Ze.jsx)(HA,{runId:m,onBack:()=>L("dashboard")}):null};var h0=T(le());var g0=T(le());var VA=T(le());var GA=T(V()),{Text:ebe}=ke;var KA=T(V()),{Text:dbe}=ke;var bw=T(le());var ww=T(V()),{Text:bbe,Paragraph:wbe}=ke;var Cw=T(V()),{Text:Ebe}=ke;var Sw=T(le());var XA=T(V()),{Text:zbe}=ke;var kw=T(le());var y0=T(le());var YA=T(le());var JA=T(V()),{Text:Xbe}=ke;var Iw=T(V()),{Text:i2e}=ke;var N0=T(le());var x0=T(V()),nz=({defaultWorkspaceId:e,defaultProjectId:t,children:r})=>{let o=Zt("__GLOBAL__");return(0,x0.jsx)(K1,{workspaceId:e,projectId:t,client:o,children:r})},v0=({children:e,defaultProjectId:t,defaultWorkspaceId:r})=>{let{config:{baseURL:o}}=Et();return(0,x0.jsx)(NS,{config:{baseURL:o,apiKey:"",assistantId:"__GLOBAL__",transport:"sse"},children:(0,x0.jsx)(nz,{defaultWorkspaceId:r,defaultProjectId:t,children:e})})},u2e=v0;var Tw=T(V()),Rw=()=>{let{toolsVisible:e,toggleTools:t}=Tr(),r=re();return(0,Tw.jsx)($p,{ariaLabel:r("chat.file.toggleDirectory"),icon:(0,Tw.jsx)(Pi,{size:16}),onClick:t,pressed:e})};var b0=T(le());var Vp=T(V()),iz=(0,b0.lazy)(()=>import("./embed-page-TasksSideApp-MPYOPRXW.js").then(e=>({default:e.TasksSideApp}))),Lw=()=>{let{openSideApp:e,sideAppVisible:t,sideAppSelectedCard:r}=Tr(),o=re(),a=t&&r?.component_key==="tasks_side_app_pin",n=()=>{a||e({component_key:"tasks_side_app_pin",message:o("tasks.title"),data:{component:(0,Vp.jsx)(b0.Suspense,{fallback:(0,Vp.jsx)(Ct,{style:{display:"block",margin:"auto"}}),children:(0,Vp.jsx)(iz,{showProjectFilter:!1})})}})};return(0,Vp.jsx)($p,{ariaLabel:o("tasks.button.open"),icon:(0,Vp.jsx)(pl,{size:16}),onClick:n})};var w0=T(le());var Ha=T(le());var vn=T(V()),{ErrorBoundary:sz}=uo,lz=({message:e,renderContent:t,autoLoadRightPanel:r})=>{let o=(0,Ha.useRef)(null),[a,n]=(0,Ha.useState)(!1),[i,s]=(0,Ha.useState)(!1);return(0,Ha.useEffect)(()=>{let c=new IntersectionObserver(([u])=>{let p=u.isIntersecting;n(p),p&&!i&&s(!0)},{threshold:.1});return o.current&&c.observe(o.current),()=>{o.current&&c.unobserve(o.current)}},[i]),(0,Ha.useEffect)(()=>{r?.()},[]),(0,vn.jsx)(sz,{children:(0,vn.jsx)("div",{ref:o,style:{width:"100%"},children:a||i?t(e):(()=>{let c=(e.tool_calls?.length??0)*140,u=e.content?Math.min(100,e.content.length/5)+c:100+c;return(0,vn.jsx)("div",{style:{height:`${u}px`,minHeight:"50px"}})})()})})},ZA=(0,Ha.memo)(({items:e,role:t,className:r})=>(0,vn.jsx)(Kx.List,{autoScroll:!0,items:e,role:t,className:r},"messages"));ZA.displayName="MemoizedBubbleList";var QA=({messages:e,className:t,isLoading:r=!1})=>{let{styles:o}=od(),a=qt(),n=(0,Ha.useDeferredValue)(e),i=r?n:e,s=(0,Ha.useRef)(i?.length??0);(0,Ha.useEffect)(()=>{i?.length&&(s.current=i?.length)},[i?.length]);let l=(0,Ha.useCallback)(p=>{let{content:m}=p;try{let h=JSON.parse(m);if(h.action&&h.message)return(0,vn.jsx)(Qt,{content:h.message})}catch{}let d=p.tool_calls?.map(h=>{try{return`\`\`\`tool_call
4371
4371
  ${JSON.stringify(h,(g,v)=>typeof v=="bigint"?v.toString():v)}
4372
4372
  \`\`\``}catch(g){return console.error("[MessageList] Failed to serialize tool_call:",g,h),"```tool_call\n[Unable to serialize tool call]\n```"}})||[],x=[m,...d].join(`
4373
4373
  `);return(0,vn.jsx)(Ye,{direction:"vertical",style:{width:"100%"},children:(0,vn.jsx)(Qt,{content:x})})},[]),c=(0,Ha.useMemo)(()=>i.map((p,m)=>({key:p.id||`message-${m}`,role:p.role,typing:!1,content:(0,vn.jsx)(lz,{message:p,renderContent:l,autoLoadRightPanel:()=>{let{content:d,role:x}=p,h=s.current>1&&s.current+1===e.length;if(m===e.length-1&&h&&x==="ai")try{let g=d?.match(/```([\w_]*)\n({.*?}|[^`]*)\n```/m),v=g?.[1],C=g?.[2],w=C?JSON.parse(C):{};if(v){let I=Ds(v);I?.side_app_view?a({component_key:v,data:w}):I?.action&&I.action(w)}}catch(g){console.error(g)}}})})),[e,l]),u={ai:{placement:"start",typing:!1,variant:"filled",styles:{content:{background:"transparent",padding:0}}},human:{placement:"end",variant:"filled",styles:{content:{background:"linear-gradient(1777deg, rgba(153, 164, 255, 0.38), rgb(231 243 248 / 38%) 27%)"}}}};return c.length===0?r?(0,vn.jsxs)("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,vn.jsx)("style",{children:`
@@ -4375,7 +4375,7 @@ ${JSON.stringify(h,(g,v)=>typeof v=="bigint"?v.toString():v)}
4375
4375
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
4376
4376
  30% { transform: translateY(-6px); opacity: 1; }
4377
4377
  }
4378
- `}),(0,vn.jsx)("div",{style:{display:"flex",gap:6,padding:"12px 20px"},children:[0,1,2].map(p=>(0,vn.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",background:"linear-gradient(135deg, #6366f1, #a855f7)",animation:"msg-typing 1.2s ease-in-out infinite",animationDelay:`${p*.2}s`}},p))})]}):(0,vn.jsx)("div",{style:{flex:1}}):(0,vn.jsx)(ZA,{items:c,role:u,className:o.messages||t})};var ju=T(V()),cz=w0.default.lazy(()=>import("./embed-page-MessageGraph-PRBUQINR.js").then(e=>({default:e.MessageGraph}))),Pw=({messages:e,isLoading:t,viewMode:r,className:o,onJumpToMessage:a})=>r==="graph"?(0,ju.jsx)(w0.Suspense,{fallback:(0,ju.jsx)("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,ju.jsx)(Ct,{})}),children:(0,ju.jsx)("div",{style:{height:"100%",minHeight:0,width:"100%"},children:(0,ju.jsx)(cz,{messages:e,isLoading:t,onJumpToMessage:a})})}):(0,ju.jsx)(QA,{messages:e,isLoading:t,className:o});var B2e={human:{width:420,height:220},ai:{width:440,height:360},tool:{width:380,height:320},agent:{width:380,height:320},summary:{width:260,height:96}},dz={understand:"chat.trace.phase.understand",act:"chat.trace.phase.act",delegate:"chat.trace.phase.delegate",answer:"chat.trace.phase.answer"},uz={understand:"Understand & plan",act:"Execute",delegate:"Delegate",answer:"Answer"};function t4(e,t){return t?t(dz[e]):uz[e]}function e4(e){return e.role==="ai"}function fz(e,t){let r=[];for(let o of e){let a=r[r.length-1];a&&a.kind===o.data.phase?a.nodeIds.push(o.id):r.push({id:`phase:${r.length}:${o.data.phase}`,kind:o.data.phase,title:t4(o.data.phase,t),nodeIds:[o.id]})}return r}function D2e(e,t={}){let r=t.isLoading===!0,o=t.t,a=[],n=[],i=[...e].reverse().find(e4),s=e[e.length-1],l=[],c=!1,u=(p,m)=>{for(let d of l)n.push({id:`${m}:${d}->${p}`,from:d,to:p,kind:m})};for(let p of e){if(p.role==="human"){let I=`human:${p.id}`;a.push({id:I,data:{kind:"human",status:"success",phase:"understand",messageId:p.id,label:o?o("chat.trace.node.human"):"User",content:p.content}}),u(I,"sequence"),l=[I],c=!1;continue}if(!e4(p))continue;let m=p.tool_calls??[],d=p===i&&m.length===0,x=m.some(I=>I.name==="task")?"delegate":m.length>0?"act":d?"answer":"understand",h=m.some(I=>I.response===void 0),g=r&&p===s,v=g?"running":h&&!g?"error":"success",C=`ai:${p.id}`;a.push({id:C,data:{kind:"ai",status:v,phase:x,messageId:p.id,label:t4(x,o),content:p.content,isAnswer:d}}),u(C,c?"result":"sequence");let w=[];for(let I of m){let R=`tool:${I.id}`,z=I.response!==void 0?"success":g?"running":"error";a.push({id:R,data:{kind:I.name==="task"?"agent":"tool",status:z,phase:x,messageId:p.id,aiId:C,label:I.name,toolCall:I,parallelGroupId:C,parallelCount:m.length}}),n.push({id:`invoke:${C}->${R}`,from:C,to:R,kind:"invoke"}),w.push(R)}w.length>0?(l=w,c=!0):(l=[C],c=!1)}return{nodes:a,edges:n,phases:fz(a,o)}}function O2e(e,t,r){if(t<1||e.phases.length<=t)return e;let o=e.phases.slice(-t),a=e.phases.slice(0,-t),n=new Set(a.flatMap(d=>d.nodeIds)),i=new Set(o.flatMap(d=>d.nodeIds)),s=`summary:${a[0].id}`,c=[{id:s,data:{kind:"summary",status:"success",phase:a[0].kind,messageId:s,label:r?r("chat.trace.summary.steps",{count:n.size}):`${n.size} steps`}},...e.nodes.filter(d=>!n.has(d.id))],u=e.edges.filter(d=>!n.has(d.from)&&!n.has(d.to)).map(d=>({...d})),p=new Set;for(let d of e.edges)n.has(d.from)&&i.has(d.to)&&!p.has(d.to)&&(p.add(d.to),u.push({id:`${d.kind}:${s}->${d.to}`,from:s,to:d.to,kind:d.kind}));let m={id:`phase:summary:${a[0].id}`,kind:a[0].kind,title:r?r("chat.trace.phase.earlier"):"Earlier",nodeIds:[s]};return{nodes:c,edges:u,phases:[m,...o]}}function r4(e,t){return e!==void 0?e:t===!0}var nr=T(le());var Uu=T(V()),{Panel:pz}=Jo,mz=/^```([\w_]+)\n([\s\S]*?)\n```$/;function gz(e){if(typeof e!="string")return;let t=mz.exec(e.trim());if(t)try{let r=JSON.parse(t[2]);return typeof r=="object"&&r!==null&&!Array.isArray(r)?{key:t[1],data:r}:void 0}catch{return}}var hz=Re(({token:e,css:t})=>({card:t`
4378
+ `}),(0,vn.jsx)("div",{style:{display:"flex",gap:6,padding:"12px 20px"},children:[0,1,2].map(p=>(0,vn.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",background:"linear-gradient(135deg, #6366f1, #a855f7)",animation:"msg-typing 1.2s ease-in-out infinite",animationDelay:`${p*.2}s`}},p))})]}):(0,vn.jsx)("div",{style:{flex:1}}):(0,vn.jsx)(ZA,{items:c,role:u,className:o.messages||t})};var ju=T(V()),cz=w0.default.lazy(()=>import("./embed-page-MessageGraph-DMP5EZBM.js").then(e=>({default:e.MessageGraph}))),Pw=({messages:e,isLoading:t,viewMode:r,className:o,onJumpToMessage:a})=>r==="graph"?(0,ju.jsx)(w0.Suspense,{fallback:(0,ju.jsx)("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,ju.jsx)(Ct,{})}),children:(0,ju.jsx)("div",{style:{height:"100%",minHeight:0,width:"100%"},children:(0,ju.jsx)(cz,{messages:e,isLoading:t,onJumpToMessage:a})})}):(0,ju.jsx)(QA,{messages:e,isLoading:t,className:o});var B2e={human:{width:420,height:220},ai:{width:440,height:360},tool:{width:380,height:320},agent:{width:380,height:320},summary:{width:260,height:96}},dz={understand:"chat.trace.phase.understand",act:"chat.trace.phase.act",delegate:"chat.trace.phase.delegate",answer:"chat.trace.phase.answer"},uz={understand:"Understand & plan",act:"Execute",delegate:"Delegate",answer:"Answer"};function t4(e,t){return t?t(dz[e]):uz[e]}function e4(e){return e.role==="ai"}function fz(e,t){let r=[];for(let o of e){let a=r[r.length-1];a&&a.kind===o.data.phase?a.nodeIds.push(o.id):r.push({id:`phase:${r.length}:${o.data.phase}`,kind:o.data.phase,title:t4(o.data.phase,t),nodeIds:[o.id]})}return r}function D2e(e,t={}){let r=t.isLoading===!0,o=t.t,a=[],n=[],i=[...e].reverse().find(e4),s=e[e.length-1],l=[],c=!1,u=(p,m)=>{for(let d of l)n.push({id:`${m}:${d}->${p}`,from:d,to:p,kind:m})};for(let p of e){if(p.role==="human"){let I=`human:${p.id}`;a.push({id:I,data:{kind:"human",status:"success",phase:"understand",messageId:p.id,label:o?o("chat.trace.node.human"):"User",content:p.content}}),u(I,"sequence"),l=[I],c=!1;continue}if(!e4(p))continue;let m=p.tool_calls??[],d=p===i&&m.length===0,x=m.some(I=>I.name==="task")?"delegate":m.length>0?"act":d?"answer":"understand",h=m.some(I=>I.response===void 0),g=r&&p===s,v=g?"running":h&&!g?"error":"success",C=`ai:${p.id}`;a.push({id:C,data:{kind:"ai",status:v,phase:x,messageId:p.id,label:t4(x,o),content:p.content,isAnswer:d}}),u(C,c?"result":"sequence");let w=[];for(let I of m){let R=`tool:${I.id}`,z=I.response!==void 0?"success":g?"running":"error";a.push({id:R,data:{kind:I.name==="task"?"agent":"tool",status:z,phase:x,messageId:p.id,aiId:C,label:I.name,toolCall:I,parallelGroupId:C,parallelCount:m.length}}),n.push({id:`invoke:${C}->${R}`,from:C,to:R,kind:"invoke"}),w.push(R)}w.length>0?(l=w,c=!0):(l=[C],c=!1)}return{nodes:a,edges:n,phases:fz(a,o)}}function O2e(e,t,r){if(t<1||e.phases.length<=t)return e;let o=e.phases.slice(-t),a=e.phases.slice(0,-t),n=new Set(a.flatMap(d=>d.nodeIds)),i=new Set(o.flatMap(d=>d.nodeIds)),s=`summary:${a[0].id}`,c=[{id:s,data:{kind:"summary",status:"success",phase:a[0].kind,messageId:s,label:r?r("chat.trace.summary.steps",{count:n.size}):`${n.size} steps`}},...e.nodes.filter(d=>!n.has(d.id))],u=e.edges.filter(d=>!n.has(d.from)&&!n.has(d.to)).map(d=>({...d})),p=new Set;for(let d of e.edges)n.has(d.from)&&i.has(d.to)&&!p.has(d.to)&&(p.add(d.to),u.push({id:`${d.kind}:${s}->${d.to}`,from:s,to:d.to,kind:d.kind}));let m={id:`phase:summary:${a[0].id}`,kind:a[0].kind,title:r?r("chat.trace.phase.earlier"):"Earlier",nodeIds:[s]};return{nodes:c,edges:u,phases:[m,...o]}}function r4(e,t){return e!==void 0?e:t===!0}var nr=T(le());var Uu=T(V()),{Panel:pz}=Jo,mz=/^```([\w_]+)\n([\s\S]*?)\n```$/;function gz(e){if(typeof e!="string")return;let t=mz.exec(e.trim());if(t)try{let r=JSON.parse(t[2]);return typeof r=="object"&&r!==null&&!Array.isArray(r)?{key:t[1],data:r}:void 0}catch{return}}var hz=Re(({token:e,css:t})=>({card:t`
4379
4379
  max-width: 1200px;
4380
4380
  margin: 8px 20px;
4381
4381
  background: ${e.colorPrimaryBg};
@@ -5252,7 +5252,7 @@ ${e}
5252
5252
  overflow: auto;
5253
5253
  min-height: 0;
5254
5254
  background: ${e.colorBgContainer};
5255
- `}));var fh=({fileUrl:e,fileName:t="",downloadUrl:r,showHeader:o=!0})=>{let{styles:a}=z$(),n=re(),[i,s]=(0,Ed.useState)(""),[l,c]=(0,Ed.useState)(!0),[u,p]=(0,Ed.useState)(null),m=(0,Ed.useMemo)(()=>Md(t),[t]);if((0,Ed.useEffect)(()=>{m==="markdown"||m==="text"?(c(!0),p(null),fetch(e).then(d=>{if(!d.ok)throw new Error(n("genui.file.loadFailedStatus",{status:d.status}));return d.text()}).then(d=>{s(d),c(!1)}).catch(d=>{p(d.message),c(!1)})):c(!1)},[e,m,n]),l)return(0,Zr.jsx)("div",{className:a.loading,children:(0,Zr.jsx)(Ct,{size:"large",tip:n("common.loading")})});if(u)return(0,Zr.jsx)("div",{className:a.error,children:(0,Zr.jsx)(uo,{message:n("genui.file.loadFailed"),description:u,type:"error",showIcon:!0})});switch(m){case"markdown":case"text":return(0,Zr.jsx)("div",{className:a.container,children:(0,Zr.jsx)(K0,{content:i,fileName:t,downloadUrl:r})});case"image":return(0,Zr.jsx)("div",{className:a.container,children:(0,Zr.jsx)("div",{className:a.contentWrapper,children:(0,Zr.jsx)("div",{className:a.imageContainer,children:(0,Zr.jsx)("img",{src:e,alt:t,className:a.image})})})});case"pdf":case"iframe":return(0,Zr.jsx)("div",{className:a.container,children:(0,Zr.jsx)("div",{className:a.pdfContainer,children:(0,Zr.jsx)("iframe",{src:e,title:t,className:a.pdfIframe})})});case"audio":return(0,Zr.jsx)("div",{className:a.container,children:(0,Zr.jsx)("div",{className:a.mediaContainer,children:(0,Zr.jsxs)("audio",{controls:!0,className:a.media,children:[(0,Zr.jsx)("source",{src:e}),n("genui.file.audioUnsupported")]})})});case"video":return(0,Zr.jsx)("div",{className:a.container,children:(0,Zr.jsx)("div",{className:a.mediaContainer,children:(0,Zr.jsxs)("video",{controls:!0,className:a.media,children:[(0,Zr.jsx)("source",{src:e}),n("genui.file.videoUnsupported")]})})});default:return(0,Zr.jsx)("div",{className:a.container,children:(0,Zr.jsxs)("div",{className:a.downloadContainer,children:[(0,Zr.jsx)(Ec,{className:a.fileIcon}),(0,Zr.jsx)("span",{className:a.fileName,children:t||n("genui.file.unknown")}),(0,Zr.jsx)(he,{type:"primary",href:r||e,download:t,children:n("genui.file.downloadFile")})]})})}};var _3=T(V()),uC=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0,ph=({data:e})=>{let t=Of(e);if(!t)return null;let r=uC(e);return(0,_3.jsx)(X0,{uiRef:t,ui:uC(r?.ui),toolInput:uC(r?.toolInput),toolResult:r?.toolResult})};var D3=T(V());var O3=T(le());var z3=T(V()),{Text:dTe}=ke;var q$=T(le());var fC=T(le());var $3=T(V()),{Text:yTe}=ke;var U$=T(le());var j$=T(le());var pC=T(V());var mC=T(V()),{Dragger:RTe}=Nc,{Text:LTe,Title:PTe}=ke;var j3=T(V()),{Title:OTe,Text:zTe}=ke;var Po=T(V()),U3=[{id:"personal_assistant",type:"route",name:"Personal Assistant",nameKey:"chatMenu.workspace.personalAssistant",icon:(0,Po.jsx)(Ti,{size:20}),order:-10},{id:"workspace_projects",type:"route",name:"Projects",nameKey:"chatMenu.workspace.projects",icon:(0,Po.jsx)(Pi,{size:20}),order:0},{id:"metrics",builtin:"metrics",type:"route",name:"Metrics",nameKey:"chatMenu.workspace.metrics",icon:(0,Po.jsx)(su,{size:20}),order:10,group:"DataSource"},{id:"database",builtin:"database",type:"route",name:"Database",nameKey:"chatMenu.workspace.database",icon:(0,Po.jsx)(Ps,{size:20}),order:20,group:"DataSource"},{id:"connections",builtin:"connections",type:"route",name:"Plugins",nameKey:"chatMenu.workspace.plugins",icon:(0,Po.jsx)(ip,{size:20}),order:21},{id:"model-providers",type:"route",name:"Model Providers",nameKey:"chatMenu.workspace.modelProviders",icon:(0,Po.jsx)(Km,{size:20}),order:48,group:"Settings"},{id:"topology-runtimes",type:"route",name:"Runtime",nameKey:"chatMenu.workspace.runtime",icon:(0,Po.jsx)(op,{size:20}),order:26,group:"Process"},{id:"topology-inbox",type:"route",name:"Inbox",nameKey:"chatMenu.workspace.inbox",icon:(0,Po.jsx)(Qm,{size:20}),order:27,group:"Process"},{id:"workflows",type:"route",name:"Automations",nameKey:"chatMenu.workspace.automations",icon:(0,Po.jsx)(sp,{size:20}),order:25,group:"Process"},{id:"shares",type:"route",name:"Shares",nameKey:"chatMenu.workspace.shares",icon:(0,Po.jsx)(sp,{size:20}),order:55,group:"Settings"},{id:"workspace_migration",type:"route",name:"Migration",nameKey:"chatMenu.workspace.migration",icon:(0,Po.jsx)(Wm,{size:20}),order:56,group:"Settings"},{id:"eval",type:"route",name:"Eval",nameKey:"chatMenu.workspace.eval",icon:(0,Po.jsx)(Li,{size:20}),order:28,group:"Process"},{id:"assistants",builtin:"assistants",type:"route",name:"Agents",nameKey:"chatMenu.workspace.assistants",icon:(0,Po.jsx)(Ti,{size:20}),order:30,group:"Settings"},{id:"skills",builtin:"skills",type:"route",name:"Skills",nameKey:"chatMenu.workspace.skills",icon:(0,Po.jsx)(fg,{size:20}),order:35,group:"Settings"},{id:"collections",type:"route",name:"Collections",nameKey:"chatMenu.workspace.collections",icon:(0,Po.jsx)(jc,{size:20}),order:29,group:"Knowledge"},{id:"mcp",builtin:"mcp",type:"route",name:"MCP",nameKey:"chatMenu.workspace.mcp",icon:(0,Po.jsx)(ip,{size:20}),order:40,group:"Settings"},{id:"a2a-keys",type:"route",name:"API Keys",nameKey:"chatMenu.workspace.apiKeys",icon:(0,Po.jsx)(eg,{size:20}),order:45,group:"Settings"},{id:"open-audit",type:"route",name:"Audit Log",nameKey:"chatMenu.workspace.auditLog",icon:(0,Po.jsx)(op,{size:20}),order:47,group:"Settings"},{id:"capability-bundles",type:"route",name:"Runtime Profiles",nameKey:"chatMenu.workspace.runtimeProfiles",icon:(0,Po.jsx)(cg,{size:20}),order:46,group:"Settings"},{id:"tools",builtin:"tools",type:"route",name:"Tools",nameKey:"chatMenu.workspace.tools",icon:(0,Po.jsx)(ug,{size:20}),order:50,group:"Settings"},{id:"tasks",type:"route",name:"Tasks",nameKey:"chatMenu.workspace.tasks",icon:(0,Po.jsx)(pl,{size:20}),order:100}];var aLe=(0,Ui.lazy)(()=>import("./embed-page-AgentGovernanceWorkbench-KEVBIQP6.js").then(e=>({default:e.AgentGovernanceWorkbench}))),nLe=(0,Ui.lazy)(()=>import("./embed-page-TopologyRuntimeView-PHULW2NG.js").then(e=>({default:e.TopologyRuntimeView}))),iLe=(0,Ui.lazy)(()=>import("./embed-page-WorkflowAutomationView-LQS6H7X6.js").then(e=>({default:e.WorkflowAutomationView}))),sLe=(0,Ui.lazy)(()=>import("./embed-page-TasksSideApp-OFZI54MF.js").then(e=>({default:e.TasksSideApp}))),lLe=(0,Ui.lazy)(()=>import("./embed-page-AgentDetailSideApp-2M4MLVQQ.js").then(e=>({default:e.AgentDetailSideApp})));var Tn=T(V());function H$(e){let{contentType:t,assistantId:r,contentConfig:o,workspaceId:a,projectId:n}=e;return t==="agent"?{agentId:r,workspaceId:a||void 0,projectId:n||void 0}:{...o,workspaceId:a||void 0,projectId:n||void 0}}function Y0(e){return typeof e=="string"?e:""}function W$(e,t,r){return Y0(e.workspaceId)===Y0(t)&&Y0(e.projectId)===Y0(r)}async function V$(e,t,r){let{contentType:o,assistantId:a,contentConfig:n,isMatch:i,workspaceId:s,projectId:l}=t;if(!(o==="agent"?!!a:!!n)||!r)return{isPinned:!1,pinnedId:null};let u=await e("/api/menu-items?menuTarget=workspace");if(u.success&&u.data?.records){let p=i??(d=>o==="agent"&&d.agentId===a),m=u.data.records.find(d=>{let x=d.contentConfig??{};return d.contentType===o&&W$(x,s,l)&&p(x)});if(m)return{isPinned:!0,pinnedId:m.id}}return{isPinned:!1,pinnedId:null}}async function G$(e,t,r){let{contentType:o,name:a,group:n}=t,i=H$(t),s={menuTarget:"workspace",contentType:o,contentConfig:i,group:n?.trim()||void 0,name:a.trim(),sortOrder:0},l=await e("/api/menu-items",s);if(!l.success)throw new Error(l.message||(r?r("chat.pin.pinFailed"):"Failed to pin"));return{id:l.data.id}}async function K$(e,t,r){let o=await e(`/api/menu-items/${t}`);if(!o.success)throw new Error(o.message||(r?r("chat.pin.unpinFailed"):"Failed to unpin"))}function a0(){let e=Oo.default.useContext(ci),{config:t}=Et(),{post:r,get:o,del:a}=Bt(),n=re(),i=t.enableCustomMenu??!1,s=e?.workspaceId,l=e?.projectId,c=(0,Oo.useCallback)(async m=>V$(o,{...m,workspaceId:s,projectId:l},i),[o,i,s,l]),u=(0,Oo.useCallback)(async m=>G$(r,{...m,workspaceId:s,projectId:l},n),[r,s,l,n]),p=(0,Oo.useCallback)(async m=>K$(a,m,n),[a,n]);return{check:c,pin:u,unpin:p,enableCustomMenu:i,get:o}}function q3(e){let t=new Set;for(let r of e)r.group?.trim()&&t.add(r.group.trim());return Array.from(t).sort()}function J2(){let{config:e}=Et(),t=Oo.default.useMemo(()=>q3(U3),[]),r=Oo.default.useMemo(()=>q3(e.workspaceMenuItems??[]),[e.workspaceMenuItems]);return Oo.default.useMemo(()=>Array.from(new Set([...t,...r])).sort(),[t,r])}async function Z2(e){let t=await e("/api/menu-items?menuTarget=workspace");if(t.success&&t.data?.records){let r=new Set;for(let o of t.data.records)o.group?.trim()&&r.add(o.group.trim());return Array.from(r).sort()}return[]}var X$={display:"flex",flexDirection:"column",gap:12},ah=({assistantId:e,contentType:t="agent",contentConfig:r,isMatch:o,size:a="small",label:n,block:i,defaultName:s})=>{let l=re(),{check:c,pin:u,unpin:p,enableCustomMenu:m,get:d}=a0(),[x,h]=(0,Oo.useState)(!1),[g,v]=(0,Oo.useState)(""),[C,w]=(0,Oo.useState)(s??""),[I,R]=(0,Oo.useState)(!1),[z,F]=(0,Oo.useState)(!1),[E,U]=(0,Oo.useState)(null),[D,L]=(0,Oo.useState)(!0),S=J2(),[P,A]=(0,Oo.useState)(S);(0,Oo.useEffect)(()=>{A(S)},[S]),(0,Oo.useEffect)(()=>{x&&Z2(d).then(G=>{A(Array.from(new Set([...S,...G])).sort())})},[x]);let _=t==="agent"?!!e:!!r,j=(0,Oo.useCallback)(async()=>{if(!_||!m){L(!1);return}L(!0);try{let G=await c({contentType:t,assistantId:e,contentConfig:r,isMatch:o});F(G.isPinned),U(G.pinnedId)}catch{}finally{L(!1)}},[_,m,c,t,e,r,o]);if((0,Oo.useEffect)(()=>{j()},[j]),!_||!m)return null;let H=async()=>{if(!C.trim()){it.warning(l("chat.pin.enterName"));return}R(!0);try{await u({contentType:t,assistantId:e,contentConfig:r,isMatch:o,name:C.trim(),group:g.trim()||void 0}),it.success(l("chat.pin.pinned")),window.dispatchEvent(new CustomEvent("menu:refresh")),h(!1),v(""),w(s??""),j()}catch(G){it.error(G.message||l("chat.pin.pinFailed"))}finally{R(!1)}},$=async()=>{if(E){R(!0);try{await p(E),it.success(l("chat.pin.unpinned")),window.dispatchEvent(new CustomEvent("menu:refresh")),F(!1),U(null)}catch(G){it.error(G.message||l("chat.pin.unpinFailed"))}finally{R(!1)}}},Y=()=>{z?$():h(!0)};return(0,Tn.jsxs)(Tn.Fragment,{children:[(0,Tn.jsx)(yt,{title:l(z?"chat.pin.unpin":"chat.pin.pin"),children:n?(0,Tn.jsx)(he,{type:"text",size:a,block:i,icon:z?(0,Tn.jsx)(Dn,{size:14,fill:"currentColor"}):(0,Tn.jsx)(Dn,{size:14}),onClick:Y,loading:D||I&&z,children:n}):(0,Tn.jsx)(he,{type:"text",size:a,block:i,icon:z?(0,Tn.jsx)(Dn,{size:14,fill:"currentColor"}):(0,Tn.jsx)(Dn,{size:14}),onClick:Y,loading:D||I&&z})}),(0,Tn.jsx)(Yt,{title:l("chat.pin.pinTitle"),open:x,onOk:H,onCancel:()=>h(!1),confirmLoading:I,okText:l("chat.pin.pin"),children:(0,Tn.jsxs)("div",{style:X$,children:[(0,Tn.jsx)(Nt,{placeholder:l("chat.pin.namePlaceholder"),value:C,onChange:G=>w(G.target.value)}),(0,Tn.jsx)(ty,{placeholder:l("chat.pin.groupPlaceholder"),value:g,options:P.map(G=>({value:G})),onChange:G=>v(G),filterOption:(G,ne)=>ne?.value?.toUpperCase().includes(G.toUpperCase())??!1})]})})]})};var Zu=T(V());function hC(e,t,r,o){return{...e,toolInput:t,toolResult:r,...o?{ui:o}:{}}}var J0=({uiRef:e,toolInput:t,toolResult:r,ui:o})=>{let a=qt(),n=re(),i=typeof e.title=="string"&&e.title.trim()!==""?e.title:void 0,s=()=>{a({component_key:"mcp_app",data:hC(e,t,r,o),message:i})},l=gC.default.useMemo(()=>e.kind==="plugin"?{kind:"plugin",pluginType:e.pluginType,resource:e.resource,displayMode:e.displayMode,...e.title?{title:e.title}:{},...t?{toolInput:t}:{},...r!==void 0?{toolResult:r}:{},...o?{ui:o}:{}}:{kind:"mcp",serverKey:e.serverKey,resourceUri:e.resourceUri,displayMode:e.displayMode,...e.title?{title:e.title}:{},...t?{toolInput:t}:{},...r!==void 0?{toolResult:r}:{},...o?{ui:o}:{}},[e,t,r,o]),c=gC.default.useCallback(u=>e.kind==="plugin"?u.kind==="plugin"&&u.pluginType===e.pluginType&&u.resource===e.resource:u.kind==="mcp"&&u.serverKey===e.serverKey&&u.resourceUri===e.resourceUri,[e]);return(0,Zu.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:i?"space-between":"flex-end",gap:8,padding:"2px 8px 2px 0"},children:[i&&(0,Zu.jsx)(ke.Text,{strong:!0,style:{fontSize:13},children:i}),(0,Zu.jsx)(ah,{contentType:"mcpApp",contentConfig:l,isMatch:c,defaultName:i??n("mcpapp.fallbackTitle"),size:"small"}),(0,Zu.jsx)(he,{type:"text",size:"small",icon:(0,Zu.jsx)(iy,{}),onClick:s,title:n("mcpapp.openInSideApp")})]})};function Qu(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(t=>{if(typeof t=="string")return t;if(t!==null&&typeof t=="object"){let r=t.text;if(typeof r=="string")return r}return""}).filter(t=>t.length>0).join(`
5255
+ `}));var fh=({fileUrl:e,fileName:t="",downloadUrl:r,showHeader:o=!0})=>{let{styles:a}=z$(),n=re(),[i,s]=(0,Ed.useState)(""),[l,c]=(0,Ed.useState)(!0),[u,p]=(0,Ed.useState)(null),m=(0,Ed.useMemo)(()=>Md(t),[t]);if((0,Ed.useEffect)(()=>{m==="markdown"||m==="text"?(c(!0),p(null),fetch(e).then(d=>{if(!d.ok)throw new Error(n("genui.file.loadFailedStatus",{status:d.status}));return d.text()}).then(d=>{s(d),c(!1)}).catch(d=>{p(d.message),c(!1)})):c(!1)},[e,m,n]),l)return(0,Zr.jsx)("div",{className:a.loading,children:(0,Zr.jsx)(Ct,{size:"large",tip:n("common.loading")})});if(u)return(0,Zr.jsx)("div",{className:a.error,children:(0,Zr.jsx)(uo,{message:n("genui.file.loadFailed"),description:u,type:"error",showIcon:!0})});switch(m){case"markdown":case"text":return(0,Zr.jsx)("div",{className:a.container,children:(0,Zr.jsx)(K0,{content:i,fileName:t,downloadUrl:r})});case"image":return(0,Zr.jsx)("div",{className:a.container,children:(0,Zr.jsx)("div",{className:a.contentWrapper,children:(0,Zr.jsx)("div",{className:a.imageContainer,children:(0,Zr.jsx)("img",{src:e,alt:t,className:a.image})})})});case"pdf":case"iframe":return(0,Zr.jsx)("div",{className:a.container,children:(0,Zr.jsx)("div",{className:a.pdfContainer,children:(0,Zr.jsx)("iframe",{src:e,title:t,className:a.pdfIframe})})});case"audio":return(0,Zr.jsx)("div",{className:a.container,children:(0,Zr.jsx)("div",{className:a.mediaContainer,children:(0,Zr.jsxs)("audio",{controls:!0,className:a.media,children:[(0,Zr.jsx)("source",{src:e}),n("genui.file.audioUnsupported")]})})});case"video":return(0,Zr.jsx)("div",{className:a.container,children:(0,Zr.jsx)("div",{className:a.mediaContainer,children:(0,Zr.jsxs)("video",{controls:!0,className:a.media,children:[(0,Zr.jsx)("source",{src:e}),n("genui.file.videoUnsupported")]})})});default:return(0,Zr.jsx)("div",{className:a.container,children:(0,Zr.jsxs)("div",{className:a.downloadContainer,children:[(0,Zr.jsx)(Ec,{className:a.fileIcon}),(0,Zr.jsx)("span",{className:a.fileName,children:t||n("genui.file.unknown")}),(0,Zr.jsx)(he,{type:"primary",href:r||e,download:t,children:n("genui.file.downloadFile")})]})})}};var _3=T(V()),uC=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0,ph=({data:e})=>{let t=Of(e);if(!t)return null;let r=uC(e);return(0,_3.jsx)(X0,{uiRef:t,ui:uC(r?.ui),toolInput:uC(r?.toolInput),toolResult:r?.toolResult})};var D3=T(V());var O3=T(le());var z3=T(V()),{Text:dTe}=ke;var q$=T(le());var fC=T(le());var $3=T(V()),{Text:yTe}=ke;var U$=T(le());var j$=T(le());var pC=T(V());var mC=T(V()),{Dragger:RTe}=Nc,{Text:LTe,Title:PTe}=ke;var j3=T(V()),{Title:OTe,Text:zTe}=ke;var Po=T(V()),U3=[{id:"personal_assistant",type:"route",name:"Personal Assistant",nameKey:"chatMenu.workspace.personalAssistant",icon:(0,Po.jsx)(Ti,{size:20}),order:-10},{id:"workspace_projects",type:"route",name:"Projects",nameKey:"chatMenu.workspace.projects",icon:(0,Po.jsx)(Pi,{size:20}),order:0},{id:"metrics",builtin:"metrics",type:"route",name:"Metrics",nameKey:"chatMenu.workspace.metrics",icon:(0,Po.jsx)(su,{size:20}),order:10,group:"DataSource"},{id:"database",builtin:"database",type:"route",name:"Database",nameKey:"chatMenu.workspace.database",icon:(0,Po.jsx)(Ps,{size:20}),order:20,group:"DataSource"},{id:"connections",builtin:"connections",type:"route",name:"Plugins",nameKey:"chatMenu.workspace.plugins",icon:(0,Po.jsx)(ip,{size:20}),order:21},{id:"model-providers",type:"route",name:"Model Providers",nameKey:"chatMenu.workspace.modelProviders",icon:(0,Po.jsx)(Km,{size:20}),order:48,group:"Settings"},{id:"topology-runtimes",type:"route",name:"Runtime",nameKey:"chatMenu.workspace.runtime",icon:(0,Po.jsx)(op,{size:20}),order:26,group:"Process"},{id:"topology-inbox",type:"route",name:"Inbox",nameKey:"chatMenu.workspace.inbox",icon:(0,Po.jsx)(Qm,{size:20}),order:27,group:"Process"},{id:"workflows",type:"route",name:"Automations",nameKey:"chatMenu.workspace.automations",icon:(0,Po.jsx)(sp,{size:20}),order:25,group:"Process"},{id:"shares",type:"route",name:"Shares",nameKey:"chatMenu.workspace.shares",icon:(0,Po.jsx)(sp,{size:20}),order:55,group:"Settings"},{id:"workspace_migration",type:"route",name:"Migration",nameKey:"chatMenu.workspace.migration",icon:(0,Po.jsx)(Wm,{size:20}),order:56,group:"Settings"},{id:"eval",type:"route",name:"Eval",nameKey:"chatMenu.workspace.eval",icon:(0,Po.jsx)(Li,{size:20}),order:28,group:"Process"},{id:"assistants",builtin:"assistants",type:"route",name:"Agents",nameKey:"chatMenu.workspace.assistants",icon:(0,Po.jsx)(Ti,{size:20}),order:30,group:"Settings"},{id:"skills",builtin:"skills",type:"route",name:"Skills",nameKey:"chatMenu.workspace.skills",icon:(0,Po.jsx)(fg,{size:20}),order:35,group:"Settings"},{id:"collections",type:"route",name:"Collections",nameKey:"chatMenu.workspace.collections",icon:(0,Po.jsx)(jc,{size:20}),order:29,group:"Knowledge"},{id:"mcp",builtin:"mcp",type:"route",name:"MCP",nameKey:"chatMenu.workspace.mcp",icon:(0,Po.jsx)(ip,{size:20}),order:40,group:"Settings"},{id:"a2a-keys",type:"route",name:"API Keys",nameKey:"chatMenu.workspace.apiKeys",icon:(0,Po.jsx)(eg,{size:20}),order:45,group:"Settings"},{id:"open-audit",type:"route",name:"Audit Log",nameKey:"chatMenu.workspace.auditLog",icon:(0,Po.jsx)(op,{size:20}),order:47,group:"Settings"},{id:"capability-bundles",type:"route",name:"Runtime Profiles",nameKey:"chatMenu.workspace.runtimeProfiles",icon:(0,Po.jsx)(cg,{size:20}),order:46,group:"Settings"},{id:"tools",builtin:"tools",type:"route",name:"Tools",nameKey:"chatMenu.workspace.tools",icon:(0,Po.jsx)(ug,{size:20}),order:50,group:"Settings"},{id:"tasks",type:"route",name:"Tasks",nameKey:"chatMenu.workspace.tasks",icon:(0,Po.jsx)(pl,{size:20}),order:100}];var aLe=(0,Ui.lazy)(()=>import("./embed-page-AgentGovernanceWorkbench-KAPZJBE6.js").then(e=>({default:e.AgentGovernanceWorkbench}))),nLe=(0,Ui.lazy)(()=>import("./embed-page-TopologyRuntimeView-MH4YMU7D.js").then(e=>({default:e.TopologyRuntimeView}))),iLe=(0,Ui.lazy)(()=>import("./embed-page-WorkflowAutomationView-KQYFSLLH.js").then(e=>({default:e.WorkflowAutomationView}))),sLe=(0,Ui.lazy)(()=>import("./embed-page-TasksSideApp-MPYOPRXW.js").then(e=>({default:e.TasksSideApp}))),lLe=(0,Ui.lazy)(()=>import("./embed-page-AgentDetailSideApp-FHC56ARN.js").then(e=>({default:e.AgentDetailSideApp})));var Tn=T(V());function H$(e){let{contentType:t,assistantId:r,contentConfig:o,workspaceId:a,projectId:n}=e;return t==="agent"?{agentId:r,workspaceId:a||void 0,projectId:n||void 0}:{...o,workspaceId:a||void 0,projectId:n||void 0}}function Y0(e){return typeof e=="string"?e:""}function W$(e,t,r){return Y0(e.workspaceId)===Y0(t)&&Y0(e.projectId)===Y0(r)}async function V$(e,t,r){let{contentType:o,assistantId:a,contentConfig:n,isMatch:i,workspaceId:s,projectId:l}=t;if(!(o==="agent"?!!a:!!n)||!r)return{isPinned:!1,pinnedId:null};let u=await e("/api/menu-items?menuTarget=workspace");if(u.success&&u.data?.records){let p=i??(d=>o==="agent"&&d.agentId===a),m=u.data.records.find(d=>{let x=d.contentConfig??{};return d.contentType===o&&W$(x,s,l)&&p(x)});if(m)return{isPinned:!0,pinnedId:m.id}}return{isPinned:!1,pinnedId:null}}async function G$(e,t,r){let{contentType:o,name:a,group:n}=t,i=H$(t),s={menuTarget:"workspace",contentType:o,contentConfig:i,group:n?.trim()||void 0,name:a.trim(),sortOrder:0},l=await e("/api/menu-items",s);if(!l.success)throw new Error(l.message||(r?r("chat.pin.pinFailed"):"Failed to pin"));return{id:l.data.id}}async function K$(e,t,r){let o=await e(`/api/menu-items/${t}`);if(!o.success)throw new Error(o.message||(r?r("chat.pin.unpinFailed"):"Failed to unpin"))}function a0(){let e=Oo.default.useContext(ci),{config:t}=Et(),{post:r,get:o,del:a}=Bt(),n=re(),i=t.enableCustomMenu??!1,s=e?.workspaceId,l=e?.projectId,c=(0,Oo.useCallback)(async m=>V$(o,{...m,workspaceId:s,projectId:l},i),[o,i,s,l]),u=(0,Oo.useCallback)(async m=>G$(r,{...m,workspaceId:s,projectId:l},n),[r,s,l,n]),p=(0,Oo.useCallback)(async m=>K$(a,m,n),[a,n]);return{check:c,pin:u,unpin:p,enableCustomMenu:i,get:o}}function q3(e){let t=new Set;for(let r of e)r.group?.trim()&&t.add(r.group.trim());return Array.from(t).sort()}function J2(){let{config:e}=Et(),t=Oo.default.useMemo(()=>q3(U3),[]),r=Oo.default.useMemo(()=>q3(e.workspaceMenuItems??[]),[e.workspaceMenuItems]);return Oo.default.useMemo(()=>Array.from(new Set([...t,...r])).sort(),[t,r])}async function Z2(e){let t=await e("/api/menu-items?menuTarget=workspace");if(t.success&&t.data?.records){let r=new Set;for(let o of t.data.records)o.group?.trim()&&r.add(o.group.trim());return Array.from(r).sort()}return[]}var X$={display:"flex",flexDirection:"column",gap:12},ah=({assistantId:e,contentType:t="agent",contentConfig:r,isMatch:o,size:a="small",label:n,block:i,defaultName:s})=>{let l=re(),{check:c,pin:u,unpin:p,enableCustomMenu:m,get:d}=a0(),[x,h]=(0,Oo.useState)(!1),[g,v]=(0,Oo.useState)(""),[C,w]=(0,Oo.useState)(s??""),[I,R]=(0,Oo.useState)(!1),[z,F]=(0,Oo.useState)(!1),[E,U]=(0,Oo.useState)(null),[D,L]=(0,Oo.useState)(!0),S=J2(),[P,A]=(0,Oo.useState)(S);(0,Oo.useEffect)(()=>{A(S)},[S]),(0,Oo.useEffect)(()=>{x&&Z2(d).then(G=>{A(Array.from(new Set([...S,...G])).sort())})},[x]);let _=t==="agent"?!!e:!!r,j=(0,Oo.useCallback)(async()=>{if(!_||!m){L(!1);return}L(!0);try{let G=await c({contentType:t,assistantId:e,contentConfig:r,isMatch:o});F(G.isPinned),U(G.pinnedId)}catch{}finally{L(!1)}},[_,m,c,t,e,r,o]);if((0,Oo.useEffect)(()=>{j()},[j]),!_||!m)return null;let H=async()=>{if(!C.trim()){it.warning(l("chat.pin.enterName"));return}R(!0);try{await u({contentType:t,assistantId:e,contentConfig:r,isMatch:o,name:C.trim(),group:g.trim()||void 0}),it.success(l("chat.pin.pinned")),window.dispatchEvent(new CustomEvent("menu:refresh")),h(!1),v(""),w(s??""),j()}catch(G){it.error(G.message||l("chat.pin.pinFailed"))}finally{R(!1)}},$=async()=>{if(E){R(!0);try{await p(E),it.success(l("chat.pin.unpinned")),window.dispatchEvent(new CustomEvent("menu:refresh")),F(!1),U(null)}catch(G){it.error(G.message||l("chat.pin.unpinFailed"))}finally{R(!1)}}},Y=()=>{z?$():h(!0)};return(0,Tn.jsxs)(Tn.Fragment,{children:[(0,Tn.jsx)(yt,{title:l(z?"chat.pin.unpin":"chat.pin.pin"),children:n?(0,Tn.jsx)(he,{type:"text",size:a,block:i,icon:z?(0,Tn.jsx)(Dn,{size:14,fill:"currentColor"}):(0,Tn.jsx)(Dn,{size:14}),onClick:Y,loading:D||I&&z,children:n}):(0,Tn.jsx)(he,{type:"text",size:a,block:i,icon:z?(0,Tn.jsx)(Dn,{size:14,fill:"currentColor"}):(0,Tn.jsx)(Dn,{size:14}),onClick:Y,loading:D||I&&z})}),(0,Tn.jsx)(Yt,{title:l("chat.pin.pinTitle"),open:x,onOk:H,onCancel:()=>h(!1),confirmLoading:I,okText:l("chat.pin.pin"),children:(0,Tn.jsxs)("div",{style:X$,children:[(0,Tn.jsx)(Nt,{placeholder:l("chat.pin.namePlaceholder"),value:C,onChange:G=>w(G.target.value)}),(0,Tn.jsx)(ty,{placeholder:l("chat.pin.groupPlaceholder"),value:g,options:P.map(G=>({value:G})),onChange:G=>v(G),filterOption:(G,ne)=>ne?.value?.toUpperCase().includes(G.toUpperCase())??!1})]})})]})};var Zu=T(V());function hC(e,t,r,o){return{...e,toolInput:t,toolResult:r,...o?{ui:o}:{}}}var J0=({uiRef:e,toolInput:t,toolResult:r,ui:o})=>{let a=qt(),n=re(),i=typeof e.title=="string"&&e.title.trim()!==""?e.title:void 0,s=()=>{a({component_key:"mcp_app",data:hC(e,t,r,o),message:i})},l=gC.default.useMemo(()=>e.kind==="plugin"?{kind:"plugin",pluginType:e.pluginType,resource:e.resource,displayMode:e.displayMode,...e.title?{title:e.title}:{},...t?{toolInput:t}:{},...r!==void 0?{toolResult:r}:{},...o?{ui:o}:{}}:{kind:"mcp",serverKey:e.serverKey,resourceUri:e.resourceUri,displayMode:e.displayMode,...e.title?{title:e.title}:{},...t?{toolInput:t}:{},...r!==void 0?{toolResult:r}:{},...o?{ui:o}:{}},[e,t,r,o]),c=gC.default.useCallback(u=>e.kind==="plugin"?u.kind==="plugin"&&u.pluginType===e.pluginType&&u.resource===e.resource:u.kind==="mcp"&&u.serverKey===e.serverKey&&u.resourceUri===e.resourceUri,[e]);return(0,Zu.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:i?"space-between":"flex-end",gap:8,padding:"2px 8px 2px 0"},children:[i&&(0,Zu.jsx)(ke.Text,{strong:!0,style:{fontSize:13},children:i}),(0,Zu.jsx)(ah,{contentType:"mcpApp",contentConfig:l,isMatch:c,defaultName:i??n("mcpapp.fallbackTitle"),size:"small"}),(0,Zu.jsx)(he,{type:"text",size:"small",icon:(0,Zu.jsx)(iy,{}),onClick:s,title:n("mcpapp.openInSideApp")})]})};function Qu(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(t=>{if(typeof t=="string")return t;if(t!==null&&typeof t=="object"){let r=t.text;if(typeof r=="string")return r}return""}).filter(t=>t.length>0).join(`
5256
5256
 
5257
5257
  `);if(e!==null&&typeof e=="object"){let t=e.text;if(typeof t=="string")return t;try{let r=JSON.stringify(e);return typeof r=="string"?r:""}catch{return""}}return""}var H3=/```mcp_app\s*\n([\s\S]*?)```/;function W3(e){let t=Qu(e);if(!t)return null;let r=H3.exec(t);if(!r)return null;try{return Of(JSON.parse(r[1].trim()))}catch{return null}}function V3(e){let t=Qu(e);return t?t.replace(H3,"").trim():""}var mh=T(V()),Y$="/mcp-apps/sandbox.html",J$=120,Z$=1200,Q$=320;function ej(e){let t=e.config?.baseURL;if(!t)return null;try{return new URL(t,window.location.origin).origin}catch{return null}}function tj(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var rj=e=>typeof e=="object"&&e!==null;function oj(e){let t=/^data:([^;,]*);base64,(.*)$/.exec(e);return t?{mimeType:t[1]||void 0,data:t[2]}:null}function aj(e){if(e.type==="image_url"){let t=rj(e.image_url)&&typeof e.image_url.url=="string"?e.image_url.url:"",r=t?oj(t):null;return r?{type:"image",data:r.data,mimeType:r.mimeType??"application/octet-stream"}:null}if(e.type==="image"||e.type==="audio"){let t=typeof e.mime_type=="string"?e.mime_type:typeof e.mimeType=="string"?e.mimeType:"application/octet-stream";return{type:e.type,data:e.data,mimeType:t}}return e.type==="resource"?{type:"resource",resource:e.resource}:e.type==="text"?{type:"text",text:e.text}:e}function nj(e,t,r){let o=r?.structuredContent!==void 0?r.structuredContent:t.kind==="mcp"?t.structuredContent:void 0,a=o!==void 0?{structuredContent:o}:{},n=r?.meta!==void 0?{_meta:r.meta}:{};if(e!==null&&typeof e=="object"&&!Array.isArray(e)&&"content"in e)return{...e,...a,...n};let i=[],s=V3(Qu(e));s&&i.push({type:"text",text:s});for(let l of r?.contentBlocks??[]){let c=aj(l);c&&i.push(c)}return i.length===0&&i.push({type:"text",text:""}),{content:i,...a,...n}}var X0=({uiRef:e,toolName:t,toolInput:r,toolResult:o,ui:a,onError:n})=>{let i=Lp(),s=i?.state.assistantId??"",l=Zt(s),{openSideApp:c}=Tr(),u=re(),p=(0,vi.useRef)(null),m=(0,vi.useRef)(null),[d,x]=(0,vi.useState)(null),[h,g]=(0,vi.useState)(Q$),[v,C]=(0,vi.useState)(null),w=(0,vi.useMemo)(()=>ej(l),[l]),I=(0,vi.useRef)({client:l,uiRef:e,toolName:t,toolInput:r,toolResult:o,ui:a,thread:i,openSideApp:c,onError:n});return(0,vi.useEffect)(()=>{I.current={client:l,uiRef:e,toolName:t,toolInput:r,toolResult:o,ui:a,thread:i,openSideApp:c,onError:n}}),(0,vi.useEffect)(()=>{if(!w)return;let R=p.current;if(!R)return;let z=S=>{R.contentWindow?.postMessage(S,w)},F={rpc:(S,P)=>I.current.client.mcpApps.rpc(I.current.uiRef,S,P),openLink:S=>{window.open(S,"_blank","noopener,noreferrer")},sendMessage:async S=>{let P=I.current.thread?.sendMessage;P&&await P({input:{message:S}})},requestDisplayMode:async S=>{if(S!=="fullscreen"||!I.current.openSideApp)return"inline";try{let P={component_key:"mcp_app",data:hC(I.current.uiRef,I.current.toolInput,I.current.toolResult,I.current.ui),message:I.current.uiRef.title};return I.current.openSideApp(P),"fullscreen"}catch{return"inline"}},downloadFile:()=>{},onInitialized:()=>{z({jsonrpc:"2.0",method:"ui/notifications/tool-input",params:{arguments:I.current.toolInput??{}}}),z({jsonrpc:"2.0",method:"ui/notifications/tool-result",params:nj(I.current.toolResult,I.current.uiRef,I.current.ui)})},toolName:I.current.toolName,theme:tj(),locale:typeof navigator<"u"?navigator.language:void 0},E=new Lx(F),U=!1,D=!1,L=async S=>{if(S.origin!==w||S.source!==R.contentWindow)return;let P=S.data;if(!P||typeof P!="object")return;if(!U){if(P.method!=="ui/notifications/sandbox-proxy-ready")return;U=!0;try{let _=await I.current.client.mcpApps.getResource(I.current.uiRef);if(D)return;z({jsonrpc:"2.0",method:"ui/notifications/sandbox-resource-ready",params:{html:_.html,csp:_.cspPolicy}})}catch(_){let j=_ instanceof Error?_:new Error(u("mcpapp.resourceLoadFailed"));C(j.message),I.current.onError?.(j)}return}if(P.method==="ui/notifications/size-changed"){let _=Number(P.params?.height);Number.isFinite(_)&&g(Math.min(Z$,Math.max(J$,_)));return}let A=await E.handle(P);P.id!==void 0&&z(A)};return window.addEventListener("message",L),()=>{D=!0,window.removeEventListener("message",L)}},[w,u]),(0,vi.useEffect)(()=>{let R=m.current;if(!R||typeof ResizeObserver>"u")return;let z=R.closest(".ant-bubble")??R,F=new ResizeObserver(U=>{for(let D of U){let L=D.contentRect.width;L>0&&x(L)}});F.observe(z);let E=z.getBoundingClientRect().width;return E>0&&x(E),()=>F.disconnect()},[w,v]),w?v?(0,mh.jsx)(ke.Text,{type:"secondary",children:u("mcpapp.failedToLoad",{error:v})}):(0,mh.jsx)("div",{ref:m,children:(0,mh.jsx)("iframe",{ref:p,title:e.title??u("mcpapp.fallbackTitle"),sandbox:"allow-scripts allow-same-origin",src:`${w}${Y$}`,style:{width:d&&d>0?`${d}px`:"100%",height:h,border:0,display:"block"},onError:()=>n?.(new Error("MCP app failed to load"))})}):(0,mh.jsx)(ke.Text,{type:"secondary",children:u("mcpapp.unavailable")})};var Z0=T(V());function ij(e){return e.startsWith("data:")}function sj(e){if(e.type==="image_url"){let a=e.image_url;return typeof a=="object"&&a!==null&&typeof a.url=="string"&&ij(a.url)?a.url:null}let t=typeof e.source_type=="string"?e.source_type:void 0;if(t!==void 0&&t!=="base64")return null;let r=typeof e.data=="string"?e.data:"";return!r||r.startsWith("http")?null:`data:${typeof e.mime_type=="string"?e.mime_type:typeof e.mimeType=="string"?e.mimeType:"application/octet-stream"};base64,${r}`}var G3=({ui:e})=>{let t=re(),r=(e?.contentBlocks??[]).filter(o=>o.type==="image"||o.type==="image_url"||o.type==="audio").map(o=>{let a=sj(o);return a?{block:o,src:a}:null}).filter(o=>o!==null);return r.length===0?null:(0,Z0.jsx)("div",{style:{marginTop:8,display:"flex",flexDirection:"column",gap:8},children:r.map(({block:o,src:a},n)=>o.type==="image"||o.type==="image_url"?(0,Z0.jsx)("img",{src:a,alt:t("mcpapp.toolResultAlt"),style:{maxWidth:"100%"}},n):(0,Z0.jsx)("audio",{controls:!0,src:a},n))})};var ln=T(V()),lj=Jo.Panel,K3=({data:e})=>{let t=e,r=re(),[o,a]=(0,ef.useState)(!1),n=(0,ef.useCallback)(()=>{a(!0)},[]),i=(0,ef.useMemo)(()=>W3(t.response),[t.response]),s=(0,ef.useMemo)(()=>Qu(t.response),[t.response]);if(i&&!o)return(0,ln.jsxs)("div",{children:[(0,ln.jsx)(J0,{uiRef:i,ui:t.ui,toolInput:t.args,toolResult:t.response}),(0,ln.jsx)(X0,{uiRef:i,ui:t.ui,toolName:t.name,toolInput:t.args,toolResult:t.response,onError:n})]});let l=h=>{try{let g=Object.values(h).map(C=>typeof C=="object"?JSON.stringify(C).substring(0,50)+(JSON.stringify(C).length>50?"...":""):String(C).substring(0,50)+(String(C).length>50?"...":"")).join(" ");return(g.length>100?g.substring(0,100)+"...":g).replaceAll(`
5258
5258
  `," ")}catch{return r("genui.toolCall.parseArgsFailed")}},c=(0,ln.jsxs)(To,{align:"center",wrap:"wrap",children:[(0,ln.jsx)(ke.Text,{strong:!0,children:wR(t.name)}),(0,ln.jsx)(ke.Text,{type:"secondary",style:{fontSize:"12px",marginLeft:"8px"},children:l(t.args)})]}),u={name:t.name,parameters:t.args,type:"tool_call"},p=(0,ln.jsxs)("div",{style:{marginTop:"8px"},children:[(0,ln.jsx)(Ix,{data:u,component_key:`${t.id}-params`,interactive:!1}),s&&(0,ln.jsxs)("div",{style:{marginTop:"12px"},children:[(0,ln.jsx)(ke.Text,{strong:!0,style:{fontSize:"12px",marginBottom:"8px",display:"block"},children:r("genui.toolCall.response")}),(0,ln.jsx)(Qt,{content:s})]}),(0,ln.jsx)(G3,{ui:t.ui})]}),m=({isActive:h})=>Rx(t.status),d=t.name.toLowerCase();d.startsWith("browser_")&&(d="browser_viewer");let x=Ds(d);if(x&&!i){let h=x.card_view;return(0,ln.jsx)(h,{data:t,component_key:t.id})}return(0,ln.jsx)(Jo,{size:"small",bordered:!1,defaultActiveKey:[],expandIcon:m,children:(0,ln.jsx)(lj,{header:c,style:{minWidth:400},children:p},t.id)})};var Y3=T(le());var kt=T(V());function tf(e){if(!e)return{success:!0,data:void 0};try{let t=JSON.parse(e);return t&&typeof t=="object"&&"success"in t?t:{success:!0,data:t}}catch{return{success:!0,data:void 0}}}var gh=({message:e})=>(0,kt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px",borderRadius:12,background:"rgba(255, 77, 79, 0.08)",border:"1px solid rgba(255, 77, 79, 0.35)",color:"#ef4444",fontSize:13},children:[(0,kt.jsx)("span",{children:"\u2715"}),(0,kt.jsx)("span",{children:e})]}),{Text:dc}=ke,Q0=Re(({css:e})=>({liveCard:e`
@@ -6495,7 +6495,7 @@ svg { height:100%}
6495
6495
  font-size: 12px;
6496
6496
  `,metadata:t`
6497
6497
  margin-top: ${e.marginXS}px;
6498
- `})),lN=({data:e})=>{let{styles:t}=eU(),r=re(),{query:o,collection:a,results:n}=e??{};return!n||n.length===0?null:(0,_l.jsx)("div",{className:t.container,children:(0,_l.jsxs)(Er,{size:"small",title:r("genui.search.query",{query:o||""}),children:[a&&(0,_l.jsx)(sN,{type:"secondary",style:{fontSize:12},children:r("genui.search.collection",{collection:a})}),n.map((i,s)=>(0,_l.jsxs)(Er,{size:"small",className:t.resultCard,children:[(0,_l.jsx)(Q9,{ellipsis:{rows:3,expandable:!0,symbol:r("genui.search.more")},style:{marginBottom:4},children:i.content}),(0,_l.jsxs)(Ye,{wrap:!0,className:t.metadata,children:[i.score!==void 0&&(0,_l.jsx)(sN,{className:t.score,children:r("genui.search.score",{score:i.score.toFixed(4)})}),i.metadata&&Object.entries(i.metadata).filter(([l])=>!l.startsWith("_")).map(([l,c])=>(0,_l.jsxs)(Pt,{children:[l,": ",String(c)]},l))]})]},s))]})})};var yh=T(V()),OC=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0,cN=({data:e,component_key:t})=>{let r=Of(e);if(!r)return null;let o=OC(e);return(0,yh.jsxs)("div",{children:[(0,yh.jsx)(J0,{uiRef:r,ui:OC(o?.ui),toolInput:OC(o?.toolInput),toolResult:o?.toolResult}),(0,yh.jsx)(ph,{data:e,component_key:t})]})};var sf=T(V()),tU=(0,dm.lazy)(()=>import("./embed-page-TasksSideApp-OFZI54MF.js").then(e=>({default:e.TasksSideApp}))),rU=(0,dm.lazy)(()=>import("./embed-page-TeamWorkspace-QSSAF3AA.js").then(e=>({default:e.TeamWorkspace}))),pv={action_show_attachments_uploader:{card_view:()=>null,action:e=>{console.log(e)}},generic_data_table:{card_view:tc,side_app_view:vR},confirm:{card_view:fR},clarify:{card_view:gR},task_review:{card_view:xR},tool_call:{card_view:K3},manage_eval:{card_view:J3,side_app_view:rv},run_eval:{card_view:aM,side_app_view:rv},read_eval:{card_view:nM,side_app_view:rv},manage_task:{card_view:dM,side_app_view:({data:e})=>(0,sf.jsx)(dm.Suspense,{fallback:(0,sf.jsx)(Ct,{style:{display:"block",margin:"auto"}}),children:(0,sf.jsx)(tU,{initialTask:e?.task})})},tool_card:{card_view:Ix},todo_list:{card_view:qu},write_todos:{card_view:fM},internet_search:{card_view:_M},write_file:{card_view:vM},edit_file:{card_view:AM},file_explorer:{card_view:()=>null,side_app_view:mM},attachments:{card_view:sv,side_app_view:cv},file_content_diff_view:{card_view:LC,side_app_view:LC},task:{card_view:EM,side_app_view:FM},schedule_viewer:{card_view:()=>null,side_app_view:$M},browser_viewer:{card_view:jM,side_app_view:cv},execute_code:{card_view:UM},create_team:{card_view:qM},team_workspace:{card_view:()=>null,side_app_view:e=>(0,sf.jsx)(dm.Suspense,{fallback:(0,sf.jsx)(Ct,{style:{display:"block",margin:"auto"}}),children:(0,sf.jsx)(rU,{...e})})},task_board:{card_view:FC,side_app_view:FC},mailbox:{card_view:JM,side_app_view:tN},show_widget:{card_view:aN,side_app_view:iN},search_collection_result:{card_view:lN},mcp_app:{card_view:cN,side_app_view:ph}};var Ds=e=>e&&pv[e]?pv[e]:null,n0=(e,t)=>(console.log("regsiterElement",e,t),pv[e]=t,t);var lf=T(le());var yo=T(V()),oU=Re(({token:e,css:t})=>({container:t`
6498
+ `})),lN=({data:e})=>{let{styles:t}=eU(),r=re(),{query:o,collection:a,results:n}=e??{};return!n||n.length===0?null:(0,_l.jsx)("div",{className:t.container,children:(0,_l.jsxs)(Er,{size:"small",title:r("genui.search.query",{query:o||""}),children:[a&&(0,_l.jsx)(sN,{type:"secondary",style:{fontSize:12},children:r("genui.search.collection",{collection:a})}),n.map((i,s)=>(0,_l.jsxs)(Er,{size:"small",className:t.resultCard,children:[(0,_l.jsx)(Q9,{ellipsis:{rows:3,expandable:!0,symbol:r("genui.search.more")},style:{marginBottom:4},children:i.content}),(0,_l.jsxs)(Ye,{wrap:!0,className:t.metadata,children:[i.score!==void 0&&(0,_l.jsx)(sN,{className:t.score,children:r("genui.search.score",{score:i.score.toFixed(4)})}),i.metadata&&Object.entries(i.metadata).filter(([l])=>!l.startsWith("_")).map(([l,c])=>(0,_l.jsxs)(Pt,{children:[l,": ",String(c)]},l))]})]},s))]})})};var yh=T(V()),OC=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0,cN=({data:e,component_key:t})=>{let r=Of(e);if(!r)return null;let o=OC(e);return(0,yh.jsxs)("div",{children:[(0,yh.jsx)(J0,{uiRef:r,ui:OC(o?.ui),toolInput:OC(o?.toolInput),toolResult:o?.toolResult}),(0,yh.jsx)(ph,{data:e,component_key:t})]})};var sf=T(V()),tU=(0,dm.lazy)(()=>import("./embed-page-TasksSideApp-MPYOPRXW.js").then(e=>({default:e.TasksSideApp}))),rU=(0,dm.lazy)(()=>import("./embed-page-TeamWorkspace-EXUAXKAH.js").then(e=>({default:e.TeamWorkspace}))),pv={action_show_attachments_uploader:{card_view:()=>null,action:e=>{console.log(e)}},generic_data_table:{card_view:tc,side_app_view:vR},confirm:{card_view:fR},clarify:{card_view:gR},task_review:{card_view:xR},tool_call:{card_view:K3},manage_eval:{card_view:J3,side_app_view:rv},run_eval:{card_view:aM,side_app_view:rv},read_eval:{card_view:nM,side_app_view:rv},manage_task:{card_view:dM,side_app_view:({data:e})=>(0,sf.jsx)(dm.Suspense,{fallback:(0,sf.jsx)(Ct,{style:{display:"block",margin:"auto"}}),children:(0,sf.jsx)(tU,{initialTask:e?.task})})},tool_card:{card_view:Ix},todo_list:{card_view:qu},write_todos:{card_view:fM},internet_search:{card_view:_M},write_file:{card_view:vM},edit_file:{card_view:AM},file_explorer:{card_view:()=>null,side_app_view:mM},attachments:{card_view:sv,side_app_view:cv},file_content_diff_view:{card_view:LC,side_app_view:LC},task:{card_view:EM,side_app_view:FM},schedule_viewer:{card_view:()=>null,side_app_view:$M},browser_viewer:{card_view:jM,side_app_view:cv},execute_code:{card_view:UM},create_team:{card_view:qM},team_workspace:{card_view:()=>null,side_app_view:e=>(0,sf.jsx)(dm.Suspense,{fallback:(0,sf.jsx)(Ct,{style:{display:"block",margin:"auto"}}),children:(0,sf.jsx)(rU,{...e})})},task_board:{card_view:FC,side_app_view:FC},mailbox:{card_view:JM,side_app_view:tN},show_widget:{card_view:aN,side_app_view:iN},search_collection_result:{card_view:lN},mcp_app:{card_view:cN,side_app_view:ph}};var Ds=e=>e&&pv[e]?pv[e]:null,n0=(e,t)=>(console.log("regsiterElement",e,t),pv[e]=t,t);var lf=T(le());var yo=T(V()),oU=Re(({token:e,css:t})=>({container:t`
6499
6499
  margin: 16px 0;
6500
6500
  border: 1px solid ${e.colorBorderSecondary};
6501
6501
  border-radius: ${e.borderRadius}px;
@@ -6524,7 +6524,7 @@ svg { height:100%}
6524
6524
  background: ${e.colorBgContainer};
6525
6525
  `,error:t`
6526
6526
  padding: 24px;
6527
- `}));function aU(e){let t="";if(typeof e=="string"?t=e.trim():Array.isArray(e)&&(t=e.join("").trim()),!t)return{};if(t.startsWith("{"))try{return JSON.parse(t)}catch{return{path:t}}return t.startsWith("http://")||t.startsWith("https://")?{url:t}:{path:t}}function nU(e){switch(Md(e)){case"markdown":case"text":return(0,yo.jsx)(Bn,{});case"image":return(0,yo.jsx)(ou,{});case"pdf":return(0,yo.jsx)(Gl,{});case"audio":return(0,yo.jsx)(Ik,{});case"video":return(0,yo.jsx)(fy,{});default:{let r=e.split(".").pop()?.toLowerCase();return["doc","docx"].includes(r||"")?(0,yo.jsx)(Uf,{}):["xls","xlsx","csv"].includes(r||"")?(0,yo.jsx)(jf,{}):["zip","rar","7z","tar","gz"].includes(r||"")?(0,yo.jsx)(qf,{}):(0,yo.jsx)(Ec,{})}}}var dN=({children:e})=>{let{styles:t}=oU(),{config:r}=Et(),{threadId:o,assistantId:a}=ds()??{},n=re(),[i,s]=(0,lf.useState)(!1),l=(0,lf.useMemo)(()=>aU(e),[e]),c=(0,lf.useMemo)(()=>l.url?l.url:!l.path||!r?.baseURL||!a||!o?null:`${r.baseURL}/api/assistants/${a}/threads/${o}/sandbox/downloadfile?path=${encodeURIComponent(l.path)}`,[l,r?.baseURL,a,o]),u=(0,lf.useMemo)(()=>{if(l.title)return l.title;if(l.path)return l.path.split("/").pop()||l.path;if(l.url)try{return new URL(l.url).pathname.split("/").pop()||l.url}catch{return l.url}return n("genui.embed.defaultTitle")},[l,n]),p=(0,lf.useMemo)(()=>{let d=l.path||l.url||"";return nU(d)},[l]);if(!c)return(0,yo.jsx)("div",{className:t.error,children:(0,yo.jsx)(uo,{message:n("genui.embed.invalidConfig"),description:n("genui.embed.invalidConfigHint"),type:"warning",showIcon:!0})});let m=(0,yo.jsx)("div",{className:t.content,children:(0,yo.jsx)(fh,{fileUrl:c,fileName:u})});return l.collapsed?(0,yo.jsx)(Jo,{size:"small",defaultActiveKey:["1"],items:[{key:"1",label:(0,yo.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,yo.jsx)("span",{children:p}),(0,yo.jsx)("span",{children:u})]}),children:m}]}):(0,yo.jsxs)("div",{className:t.container,children:[(0,yo.jsxs)("div",{className:t.header,children:[(0,yo.jsx)("span",{className:t.headerIcon,children:p}),(0,yo.jsx)("span",{className:t.headerTitle,children:u}),(0,yo.jsx)(he,{type:"text",size:"small",icon:(0,yo.jsx)(Rs,{}),onClick:()=>s(!0),children:n("genui.share.action")})]}),m,i&&(0,yo.jsx)(qp,{open:i,filePath:l.path??"",assistantId:a??void 0,fileName:u,onClose:()=>s(!1)})]})};var Ia=T(V()),iU=(0,Bl.lazy)(()=>import("./embed-page-mermaid-R7ZBUE3D.js")),sU=(0,Bl.lazy)(()=>import("./embed-page-ReactInfographic-5P36JLSX.js").then(e=>({default:e.ReactInfographic}))),lU=(0,Bl.lazy)(()=>import("./embed-page-ReactChart-V6JJXCEV.js").then(e=>({default:e.ReactChart})));function xh(){let e=re();return(0,Ia.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:200,color:"rgba(0, 0, 0, 0.45)",fontSize:13},children:e("common.loading")})}var uN=e=>{let{className:t,children:r}=e,o=t?.match(/language-(\w+)/)?.[1]||"",a;if(typeof r=="string"&&(a=r),Array.isArray(r)&&(a=r.join("")),o){let n=Ds(o)?.card_view;if(n){let i;try{i=JSON.parse(a)}catch{}return o==="task_review"?(0,Ia.jsx)(n,{component_key:o,data:i,interactive:!1}):(0,Ia.jsx)(n,{component_key:o,data:i})}switch(o){case"infographic":return(0,Ia.jsx)(Bl.Suspense,{fallback:(0,Ia.jsx)(xh,{}),children:(0,Ia.jsx)(sU,{children:r})});case"mermaid":return(0,Ia.jsx)(Bl.Suspense,{fallback:(0,Ia.jsx)(xh,{}),children:(0,Ia.jsx)(iU,{children:r})});case"chart":return(0,Ia.jsx)(Bl.Suspense,{fallback:(0,Ia.jsx)(xh,{}),children:(0,Ia.jsx)(lU,{children:r})});case"embed":return(0,Ia.jsx)(dN,{children:r});default:return(0,Ia.jsx)(Bl.Suspense,{fallback:(0,Ia.jsx)(xh,{}),children:(0,Ia.jsx)(E2,{lang:o,children:r})})}}return(0,Ia.jsx)(Bl.Suspense,{fallback:(0,Ia.jsx)(xh,{}),children:(0,Ia.jsx)(E2,{lang:o,children:r})})};var zC=T(V()),mv=e=>t=>{if(!t)return null;let{className:r,children:o}=t,a;if(typeof o=="string"?a=o:Array.isArray(o)&&(a=o.join("")),!a)return(0,zC.jsx)(e,{component_key:r,data:void 0});let n;try{n=JSON.parse(a)}catch{n=a}return(0,zC.jsx)(e,{component_key:r,data:n})};var gv=T(le());var um=T(V()),fN=({data:e})=>{if(!e)return null;if(!F3(e))return(0,um.jsx)(um.Fragment,{children:e});let t=qt(),{threadId:r,assistantId:o}=ds()??{},{config:a}=Et(),n=re(),i=(0,gv.useMemo)(()=>!a?.baseURL||!o||!r?null:`${a.baseURL}/api/assistants/${o}/threads/${r}/sandbox/downloadfile`,[a?.baseURL,o,r]),s=(0,gv.useCallback)(l=>{if(!i)return;let c=new URLSearchParams({path:l}),u=`${i}?${c.toString()}`,p=l.split("/").pop()??l,m=n("genui.attachment.preview",{name:p});t({component_key:"attachments",data:{file_id:l,message:m,full_url:u,download_url:u},message:m})},[i,t,n]);return i?(0,um.jsx)(he,{type:"link",size:"small",onClick:()=>s(e),children:e}):(0,um.jsx)("span",{children:e})};var fm=T(le());var $C=T(V()),cU=/\/api\/web-apps\/[^/]+\/runtime$/,pN=({data:e})=>{if(e==null)return null;let t=typeof e=="string"?e:String(e??"");if(t.length===0)return null;let r=qt(),{threadId:o,assistantId:a}=ds()??{},{config:n}=Et(),i=(0,fm.useContext)(ci),s=re(),l=(0,fm.useMemo)(()=>{if(i?.workspaceId&&i?.projectId){let m=i.getFileViewUrl(t,a||void 0),d=i.getFileDownloadUrl(t,a||void 0);if(m&&d)return{fullUrl:m,downloadUrl:d}}if(!n?.baseURL)return null;let u=new URLSearchParams({path:t});if(cU.test(n.baseURL)){let m=n.baseURL.replace(/\/$/,"");return{fullUrl:`${m}/files/viewfile?${u.toString()}`,downloadUrl:`${m}/files/downloadfile?${u.toString()}`}}if(!a||!o)return null;let p=`${n.baseURL}/api/assistants/${a}/threads/${o}/sandbox/downloadfile?${u.toString()}`;return{fullUrl:p,downloadUrl:p}},[i,n?.baseURL,a,o,t]),c=(0,fm.useCallback)(()=>{if(!l)return;let u=s("genui.attachment.preview",{name:t.split("/").pop()??t});r({component_key:"attachments",data:{file_id:t,message:u,full_url:l.fullUrl,download_url:l.downloadUrl},message:u})},[l,t,r,s]);return l?(0,$C.jsx)(he,{type:"link",size:"small",onClick:c,children:t}):(0,$C.jsx)("span",{children:t})};var mN=T(le());var hN=T(V()),dU=e=>{if(!e||!e.children)return null;let t=[],r=[],o=e.children.find(n=>n.name==="thead"),a=e.children.find(n=>n.name==="tbody");if(o&&o.children){let n=o.children.find(i=>i.name==="tr");n&&n.children&&n.children.forEach(i=>{if(i.name==="th"&&i.children){let s=i.children.map(l=>l.type==="text"?l.data:l.children?l.children.map(c=>c.type==="text"?c.data:"").join(""):"").join("").trim();t.push(s)}})}if(a&&a.children&&a.children.forEach(n=>{if(n.name==="tr"&&n.children){let i={},s=0;n.children.forEach(l=>{if(l.name==="td"&&s<t.length){let c=l.children.map(p=>p.type==="text"?p.data:p.children?p.children.map(m=>m.type==="text"?m.data:"").join(""):"").join("").trim(),u=t[s]||`col_${s}`;i[u]=c,s++}}),Object.keys(i).length>0&&r.push(i)}}),t.length===0&&r.length>0){let n=r[0];return{headers:Object.keys(n),dataSource:r}}return{headers:t,dataSource:r}},gN=e=>{let{domNode:t}=e,r=(0,mN.useMemo)(()=>dU(t),[t]);return!r||r.dataSource.length===0?null:(0,hN.jsx)(tc,{component_key:"markdown_table",data:{dataSource:r.dataSource,message:""},interactive:!0,default_open_in_side_app:!0})};var uU=mv(tc),fU=mv(fN),pU=mv(pN),yN={code:uN,file:fU,filelink:pU,genericdatatable:uU,table:gN};var jC="\uE000",mU=new Set(["code","codespan","html","table","def","hr","link","image","autolink","url","escape"]),bN="[A-Za-z0-9_.\\-~\\u4e00-\\u9fff]",gU=new RegExp(`^${bN}$`),xN=["project","agent","root"];function vN(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hU(e){return Array.isArray(e.items)&&e.items.length>0?e.items:Array.isArray(e.tokens)&&e.tokens.length>0?e.tokens:null}function wN(e,t,r,o){let a=r.start;for(let n of t){let i=n.raw??"";if(i.length===0)continue;let s=e.indexOf(i,a);if(s<r.start||s+i.length>r.end){o.push({start:a,end:r.end});return}if(mU.has(n.type))o.push({start:s,end:s+i.length});else{let l=hU(n);l&&wN(e,l,{start:s,end:s+i.length},o)}a=s+i.length}}function CN(e,t){if(typeof e!="string"||e.length===0||e.includes(jC))return e;let r=(t?.volumes&&t.volumes.length>0?t.volumes:xN).map(h=>h.replace(/^\/+|\/+$/g,"")).filter(h=>h.length>0).map(vN);r.length===0&&(r=xN.map(vN));let o;try{o=nT(e)}catch{return e}let a=[];wN(e,o,{start:0,end:e.length},a);let n=[],i="",s=0;for(let h of a)i+=e.slice(s,h.start)+jC,n.push(e.slice(h.start,h.end)),s=h.end;i+=e.slice(s);let l=new RegExp(`(?<![A-Za-z0-9_:/.])/(?:${r.join("|")})(?:/${bN}+)+`,"g"),c="",u=0,p=!1,m;for(;(m=l.exec(i))!==null;){let h=i[l.lastIndex];if(h!==void 0&&gU.test(h))continue;let g=m[0].replace(/\.+$/,"");g!==m[0]&&!g.includes("/")||(c+=i.slice(u,m.index),c+=`<filelink>${g}</filelink>`,u=l.lastIndex,p=!0)}if(!p)return e;c+=i.slice(u);let d=c.split(jC),x="";for(let h=0;h<d.length;h+=1)x+=d[h],h<n.length&&(x+=n[h]);return x}var cf=T(V()),yU=yN,xU=Re(({token:e,css:t})=>({markdownContainer:t`
6527
+ `}));function aU(e){let t="";if(typeof e=="string"?t=e.trim():Array.isArray(e)&&(t=e.join("").trim()),!t)return{};if(t.startsWith("{"))try{return JSON.parse(t)}catch{return{path:t}}return t.startsWith("http://")||t.startsWith("https://")?{url:t}:{path:t}}function nU(e){switch(Md(e)){case"markdown":case"text":return(0,yo.jsx)(Bn,{});case"image":return(0,yo.jsx)(ou,{});case"pdf":return(0,yo.jsx)(Gl,{});case"audio":return(0,yo.jsx)(Ik,{});case"video":return(0,yo.jsx)(fy,{});default:{let r=e.split(".").pop()?.toLowerCase();return["doc","docx"].includes(r||"")?(0,yo.jsx)(Uf,{}):["xls","xlsx","csv"].includes(r||"")?(0,yo.jsx)(jf,{}):["zip","rar","7z","tar","gz"].includes(r||"")?(0,yo.jsx)(qf,{}):(0,yo.jsx)(Ec,{})}}}var dN=({children:e})=>{let{styles:t}=oU(),{config:r}=Et(),{threadId:o,assistantId:a}=ds()??{},n=re(),[i,s]=(0,lf.useState)(!1),l=(0,lf.useMemo)(()=>aU(e),[e]),c=(0,lf.useMemo)(()=>l.url?l.url:!l.path||!r?.baseURL||!a||!o?null:`${r.baseURL}/api/assistants/${a}/threads/${o}/sandbox/downloadfile?path=${encodeURIComponent(l.path)}`,[l,r?.baseURL,a,o]),u=(0,lf.useMemo)(()=>{if(l.title)return l.title;if(l.path)return l.path.split("/").pop()||l.path;if(l.url)try{return new URL(l.url).pathname.split("/").pop()||l.url}catch{return l.url}return n("genui.embed.defaultTitle")},[l,n]),p=(0,lf.useMemo)(()=>{let d=l.path||l.url||"";return nU(d)},[l]);if(!c)return(0,yo.jsx)("div",{className:t.error,children:(0,yo.jsx)(uo,{message:n("genui.embed.invalidConfig"),description:n("genui.embed.invalidConfigHint"),type:"warning",showIcon:!0})});let m=(0,yo.jsx)("div",{className:t.content,children:(0,yo.jsx)(fh,{fileUrl:c,fileName:u})});return l.collapsed?(0,yo.jsx)(Jo,{size:"small",defaultActiveKey:["1"],items:[{key:"1",label:(0,yo.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,yo.jsx)("span",{children:p}),(0,yo.jsx)("span",{children:u})]}),children:m}]}):(0,yo.jsxs)("div",{className:t.container,children:[(0,yo.jsxs)("div",{className:t.header,children:[(0,yo.jsx)("span",{className:t.headerIcon,children:p}),(0,yo.jsx)("span",{className:t.headerTitle,children:u}),(0,yo.jsx)(he,{type:"text",size:"small",icon:(0,yo.jsx)(Rs,{}),onClick:()=>s(!0),children:n("genui.share.action")})]}),m,i&&(0,yo.jsx)(qp,{open:i,filePath:l.path??"",assistantId:a??void 0,fileName:u,onClose:()=>s(!1)})]})};var Ia=T(V()),iU=(0,Bl.lazy)(()=>import("./embed-page-mermaid-R7ZBUE3D.js")),sU=(0,Bl.lazy)(()=>import("./embed-page-ReactInfographic-5P36JLSX.js").then(e=>({default:e.ReactInfographic}))),lU=(0,Bl.lazy)(()=>import("./embed-page-ReactChart-PYGNSRHG.js").then(e=>({default:e.ReactChart})));function xh(){let e=re();return(0,Ia.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:200,color:"rgba(0, 0, 0, 0.45)",fontSize:13},children:e("common.loading")})}var uN=e=>{let{className:t,children:r}=e,o=t?.match(/language-(\w+)/)?.[1]||"",a;if(typeof r=="string"&&(a=r),Array.isArray(r)&&(a=r.join("")),o){let n=Ds(o)?.card_view;if(n){let i;try{i=JSON.parse(a)}catch{}return o==="task_review"?(0,Ia.jsx)(n,{component_key:o,data:i,interactive:!1}):(0,Ia.jsx)(n,{component_key:o,data:i})}switch(o){case"infographic":return(0,Ia.jsx)(Bl.Suspense,{fallback:(0,Ia.jsx)(xh,{}),children:(0,Ia.jsx)(sU,{children:r})});case"mermaid":return(0,Ia.jsx)(Bl.Suspense,{fallback:(0,Ia.jsx)(xh,{}),children:(0,Ia.jsx)(iU,{children:r})});case"chart":return(0,Ia.jsx)(Bl.Suspense,{fallback:(0,Ia.jsx)(xh,{}),children:(0,Ia.jsx)(lU,{children:r})});case"embed":return(0,Ia.jsx)(dN,{children:r});default:return(0,Ia.jsx)(Bl.Suspense,{fallback:(0,Ia.jsx)(xh,{}),children:(0,Ia.jsx)(E2,{lang:o,children:r})})}}return(0,Ia.jsx)(Bl.Suspense,{fallback:(0,Ia.jsx)(xh,{}),children:(0,Ia.jsx)(E2,{lang:o,children:r})})};var zC=T(V()),mv=e=>t=>{if(!t)return null;let{className:r,children:o}=t,a;if(typeof o=="string"?a=o:Array.isArray(o)&&(a=o.join("")),!a)return(0,zC.jsx)(e,{component_key:r,data:void 0});let n;try{n=JSON.parse(a)}catch{n=a}return(0,zC.jsx)(e,{component_key:r,data:n})};var gv=T(le());var um=T(V()),fN=({data:e})=>{if(!e)return null;if(!F3(e))return(0,um.jsx)(um.Fragment,{children:e});let t=qt(),{threadId:r,assistantId:o}=ds()??{},{config:a}=Et(),n=re(),i=(0,gv.useMemo)(()=>!a?.baseURL||!o||!r?null:`${a.baseURL}/api/assistants/${o}/threads/${r}/sandbox/downloadfile`,[a?.baseURL,o,r]),s=(0,gv.useCallback)(l=>{if(!i)return;let c=new URLSearchParams({path:l}),u=`${i}?${c.toString()}`,p=l.split("/").pop()??l,m=n("genui.attachment.preview",{name:p});t({component_key:"attachments",data:{file_id:l,message:m,full_url:u,download_url:u},message:m})},[i,t,n]);return i?(0,um.jsx)(he,{type:"link",size:"small",onClick:()=>s(e),children:e}):(0,um.jsx)("span",{children:e})};var fm=T(le());var $C=T(V()),cU=/\/api\/web-apps\/[^/]+\/runtime$/,pN=({data:e})=>{if(e==null)return null;let t=typeof e=="string"?e:String(e??"");if(t.length===0)return null;let r=qt(),{threadId:o,assistantId:a}=ds()??{},{config:n}=Et(),i=(0,fm.useContext)(ci),s=re(),l=(0,fm.useMemo)(()=>{if(i?.workspaceId&&i?.projectId){let m=i.getFileViewUrl(t,a||void 0),d=i.getFileDownloadUrl(t,a||void 0);if(m&&d)return{fullUrl:m,downloadUrl:d}}if(!n?.baseURL)return null;let u=new URLSearchParams({path:t});if(cU.test(n.baseURL)){let m=n.baseURL.replace(/\/$/,"");return{fullUrl:`${m}/files/viewfile?${u.toString()}`,downloadUrl:`${m}/files/downloadfile?${u.toString()}`}}if(!a||!o)return null;let p=`${n.baseURL}/api/assistants/${a}/threads/${o}/sandbox/downloadfile?${u.toString()}`;return{fullUrl:p,downloadUrl:p}},[i,n?.baseURL,a,o,t]),c=(0,fm.useCallback)(()=>{if(!l)return;let u=s("genui.attachment.preview",{name:t.split("/").pop()??t});r({component_key:"attachments",data:{file_id:t,message:u,full_url:l.fullUrl,download_url:l.downloadUrl},message:u})},[l,t,r,s]);return l?(0,$C.jsx)(he,{type:"link",size:"small",onClick:c,children:t}):(0,$C.jsx)("span",{children:t})};var mN=T(le());var hN=T(V()),dU=e=>{if(!e||!e.children)return null;let t=[],r=[],o=e.children.find(n=>n.name==="thead"),a=e.children.find(n=>n.name==="tbody");if(o&&o.children){let n=o.children.find(i=>i.name==="tr");n&&n.children&&n.children.forEach(i=>{if(i.name==="th"&&i.children){let s=i.children.map(l=>l.type==="text"?l.data:l.children?l.children.map(c=>c.type==="text"?c.data:"").join(""):"").join("").trim();t.push(s)}})}if(a&&a.children&&a.children.forEach(n=>{if(n.name==="tr"&&n.children){let i={},s=0;n.children.forEach(l=>{if(l.name==="td"&&s<t.length){let c=l.children.map(p=>p.type==="text"?p.data:p.children?p.children.map(m=>m.type==="text"?m.data:"").join(""):"").join("").trim(),u=t[s]||`col_${s}`;i[u]=c,s++}}),Object.keys(i).length>0&&r.push(i)}}),t.length===0&&r.length>0){let n=r[0];return{headers:Object.keys(n),dataSource:r}}return{headers:t,dataSource:r}},gN=e=>{let{domNode:t}=e,r=(0,mN.useMemo)(()=>dU(t),[t]);return!r||r.dataSource.length===0?null:(0,hN.jsx)(tc,{component_key:"markdown_table",data:{dataSource:r.dataSource,message:""},interactive:!0,default_open_in_side_app:!0})};var uU=mv(tc),fU=mv(fN),pU=mv(pN),yN={code:uN,file:fU,filelink:pU,genericdatatable:uU,table:gN};var jC="\uE000",mU=new Set(["code","codespan","html","table","def","hr","link","image","autolink","url","escape"]),bN="[A-Za-z0-9_.\\-~\\u4e00-\\u9fff]",gU=new RegExp(`^${bN}$`),xN=["project","agent","root"];function vN(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function hU(e){return Array.isArray(e.items)&&e.items.length>0?e.items:Array.isArray(e.tokens)&&e.tokens.length>0?e.tokens:null}function wN(e,t,r,o){let a=r.start;for(let n of t){let i=n.raw??"";if(i.length===0)continue;let s=e.indexOf(i,a);if(s<r.start||s+i.length>r.end){o.push({start:a,end:r.end});return}if(mU.has(n.type))o.push({start:s,end:s+i.length});else{let l=hU(n);l&&wN(e,l,{start:s,end:s+i.length},o)}a=s+i.length}}function CN(e,t){if(typeof e!="string"||e.length===0||e.includes(jC))return e;let r=(t?.volumes&&t.volumes.length>0?t.volumes:xN).map(h=>h.replace(/^\/+|\/+$/g,"")).filter(h=>h.length>0).map(vN);r.length===0&&(r=xN.map(vN));let o;try{o=nT(e)}catch{return e}let a=[];wN(e,o,{start:0,end:e.length},a);let n=[],i="",s=0;for(let h of a)i+=e.slice(s,h.start)+jC,n.push(e.slice(h.start,h.end)),s=h.end;i+=e.slice(s);let l=new RegExp(`(?<![A-Za-z0-9_:/.])/(?:${r.join("|")})(?:/${bN}+)+`,"g"),c="",u=0,p=!1,m;for(;(m=l.exec(i))!==null;){let h=i[l.lastIndex];if(h!==void 0&&gU.test(h))continue;let g=m[0].replace(/\.+$/,"");g!==m[0]&&!g.includes("/")||(c+=i.slice(u,m.index),c+=`<filelink>${g}</filelink>`,u=l.lastIndex,p=!0)}if(!p)return e;c+=i.slice(u);let d=c.split(jC),x="";for(let h=0;h<d.length;h+=1)x+=d[h],h<n.length&&(x+=n[h]);return x}var cf=T(V()),yU=yN,xU=Re(({token:e,css:t})=>({markdownContainer:t`
6528
6528
  white-space: normal;
6529
6529
 
6530
6530
  h1,
@@ -1,4 +1,4 @@
1
- import{a as fr,b as An}from"./embed-page-chunk-YNHKD2CY.js";import{b as $i,c as Hi}from"./embed-page-chunk-SSWDAKQU.js";import{a as Co}from"./embed-page-chunk-D5EY6ASK.js";import{c as To,d as Ro}from"./embed-page-chunk-WTOAQDQN.js";import{b as st,c as Ni,d as wo,e as Rt,f as xo,g as Oi,h as In,i as Cn,j as Fi,l as _i,m as zi}from"./embed-page-chunk-V2GBFWLG.js";import{a as qi,b as Ui}from"./embed-page-chunk-PFCR6CFL.js";import{A as fi,Aa as Pi,Ba as vo,C as mi,Ca as ho,D as yi,F as fo,Fa as Tn,L as vi,La as Rn,Ma as bo,Na as Ei,Qa as Di,Ra as Li,Sa as Mi,Ta as ko,Y as hi,Z as bi,_ as ki,aa as wi,ba as xi,d as di,f as ci,fb as Wi,g as Kn,ga as Ti,gb as Io,hb as So,ib as Ao,jb as Bi,ka as Ri,kb as Po,lb as ji,mb as Gi,nb as Eo,oa as mo,ob as Sn,p as ui,pa as Ii,qa as Ci,qb as gr,ra as Si,rb as Ki,sa as Nt,x as pi,xa as Ai,z as gi,za as yo}from"./embed-page-chunk-7PNQFZMK.js";import{C as uo,D as et,j as Jr,q as ei,r as z,v as ti,y as vt}from"./embed-page-chunk-O44JEYLD.js";import{a as W}from"./embed-page-chunk-QV7QAJ4N.js";import{Bb as xn,Cb as ii,Cc as ai,Ec as si,Fc as ur,Gc as pr,Ha as co,Ia as He,Ja as Yr,La as Be,Ma as Xr,Rc as li,Sb as cr,U as Yt,W as U,Wa as ni,Y as wn,Z as Gt,_ as it,aa as Xt,ca as lr,da as dr,eb as oi,ec as go,fa as Zr,ia as cn,la as Vr,lb as Gn,na as Qr,nb as ri,oa as Lt,ra as ge,sb as po,ta as Me,va as Tt,xa as at,xc as Mt,ya as ze}from"./embed-page-chunk-MHGVD4EV.js";import{a as Ie}from"./embed-page-chunk-R5QL57JJ.js";import{f as R}from"./embed-page-chunk-QBTAJ2YI.js";var Zs={react:{label:"capability",color:"blue"},capability:{label:"capability",color:"blue"},deep_agent:{label:"orchestrator",color:"orange"},orchestrator:{label:"orchestrator",color:"orange"},team:{label:"team",color:"green"},processing:{label:"workflow",color:"purple"},workflow:{label:"workflow",color:"purple"},a2a_remote:{label:"remote",color:"cyan"},remote:{label:"remote",color:"cyan"}};function Pn(e){return Zs[e]??{label:"capability",color:"blue"}}var Vs={enabled:"green",draft:"orange",disabled:"default"};function Vi(e){return Vs[e]??"default"}var Zi={blue:"#3b82f6",orange:"#f59e0b",green:"#22c55e",purple:"#a855f7",cyan:"#06b6d4"};function qn(e){return Zi[e]??Zi.cyan}function Jd(e){let t={enabled:"#22c55e",draft:"#f59e0b",disabled:"#d9d9d9"};return t[e]??t.disabled}function En(e){return typeof e.graphDefinition=="object"&&e.graphDefinition!==null?e.graphDefinition:{}}function yr(e){return((En(e).metadata??{}).tags??"").split(",").map(r=>r.trim()).filter(Boolean)}function vr(e){let o=(En(e).metadata??{}).version;return o?o.startsWith("v")?o:`v${o}`:"v1"}function hr(e){let o=(En(e).metadata??{}).status??"enabled";return o==="draft"||o==="disabled"?o:"enabled"}function mr(e){let n=En(e).subAgents??[],o=Array.isArray(n)?n.filter(Boolean):[];return Array.from(new Set(o))}function ec(e){return e.map(t=>{let n=En(t),o=String(n.type??"react");return{id:t.id,name:t.name,description:t.description,type:Pn(o).label,tags:yr(t),version:vr(t),status:hr(t),subAgents:mr(t)}})}function tc(e){let t=new Set(e.map(r=>r.id)),n=e.map(r=>({id:r.id,label:r.name,type:Pn(String(En(r).type??"react")).label,subAgentCount:mr(r).length})),o=[];for(let r of e)for(let i of mr(r))t.has(i)&&o.push({source:r.id,target:i});return{nodes:n,edges:o}}var Se=R(Ie());var te=R(Ie());var b=R(W()),{TextArea:Qs}=Me,{Text:It}=Be,Qi=["data","execution","workflow","assistant"],Yi={data:"chatConfig.agentPanel.category.data",execution:"chatConfig.agentPanel.category.execution",workflow:"chatConfig.agentPanel.category.workflow",assistant:"chatConfig.agentPanel.category.assistant",other:"chatConfig.agentPanel.category.other"},Ys={react:"chatConfig.agentPanel.typeDesc.react",deep_agent:"chatConfig.agentPanel.typeDesc.deepAgent",team:"chatConfig.agentPanel.typeDesc.team",processing:"chatConfig.agentPanel.typeDesc.processing"},$n=(e,t)=>{if(Array.isArray(e)){let n=e.map(o=>$n(o));return(t==="tools"||t==="subAgents")&&n.every(o=>typeof o=="string")?[...n].sort():n}return e!==null&&typeof e=="object"?Object.fromEntries(Object.entries(e).sort(([n],[o])=>n.localeCompare(o)).map(([n,o])=>[n,$n(o,n)])):e},Xi=e=>{if(typeof e!="string")return $n(e??null);try{return $n(JSON.parse(e))}catch{return e}},Ji=e=>JSON.stringify($n({...e,tools:[...e.tools].sort(),subAgents:[...e.subAgents].sort()})),Xs=Si(({token:e,css:t})=>({modalBody:t`
1
+ import{a as fr,b as An}from"./embed-page-chunk-NW37OVAX.js";import{b as $i,c as Hi}from"./embed-page-chunk-I7BVN6EY.js";import{a as Co}from"./embed-page-chunk-JSAUTBU5.js";import{c as To,d as Ro}from"./embed-page-chunk-WTOAQDQN.js";import{b as st,c as Ni,d as wo,e as Rt,f as xo,g as Oi,h as In,i as Cn,j as Fi,l as _i,m as zi}from"./embed-page-chunk-V2GBFWLG.js";import{a as qi,b as Ui}from"./embed-page-chunk-QGXGVLAX.js";import{A as fi,Aa as Pi,Ba as vo,C as mi,Ca as ho,D as yi,F as fo,Fa as Tn,L as vi,La as Rn,Ma as bo,Na as Ei,Qa as Di,Ra as Li,Sa as Mi,Ta as ko,Y as hi,Z as bi,_ as ki,aa as wi,ba as xi,d as di,f as ci,fb as Wi,g as Kn,ga as Ti,gb as Io,hb as So,ib as Ao,jb as Bi,ka as Ri,kb as Po,lb as ji,mb as Gi,nb as Eo,oa as mo,ob as Sn,p as ui,pa as Ii,qa as Ci,qb as gr,ra as Si,rb as Ki,sa as Nt,x as pi,xa as Ai,z as gi,za as yo}from"./embed-page-chunk-QHXKZNDU.js";import{C as uo,D as et,j as Jr,q as ei,r as z,v as ti,y as vt}from"./embed-page-chunk-O44JEYLD.js";import{a as W}from"./embed-page-chunk-QV7QAJ4N.js";import{Bb as xn,Cb as ii,Cc as ai,Ec as si,Fc as ur,Gc as pr,Ha as co,Ia as He,Ja as Yr,La as Be,Ma as Xr,Rc as li,Sb as cr,U as Yt,W as U,Wa as ni,Y as wn,Z as Gt,_ as it,aa as Xt,ca as lr,da as dr,eb as oi,ec as go,fa as Zr,ia as cn,la as Vr,lb as Gn,na as Qr,nb as ri,oa as Lt,ra as ge,sb as po,ta as Me,va as Tt,xa as at,xc as Mt,ya as ze}from"./embed-page-chunk-MHGVD4EV.js";import{a as Ie}from"./embed-page-chunk-R5QL57JJ.js";import{f as R}from"./embed-page-chunk-QBTAJ2YI.js";var Zs={react:{label:"capability",color:"blue"},capability:{label:"capability",color:"blue"},deep_agent:{label:"orchestrator",color:"orange"},orchestrator:{label:"orchestrator",color:"orange"},team:{label:"team",color:"green"},processing:{label:"workflow",color:"purple"},workflow:{label:"workflow",color:"purple"},a2a_remote:{label:"remote",color:"cyan"},remote:{label:"remote",color:"cyan"}};function Pn(e){return Zs[e]??{label:"capability",color:"blue"}}var Vs={enabled:"green",draft:"orange",disabled:"default"};function Vi(e){return Vs[e]??"default"}var Zi={blue:"#3b82f6",orange:"#f59e0b",green:"#22c55e",purple:"#a855f7",cyan:"#06b6d4"};function qn(e){return Zi[e]??Zi.cyan}function Jd(e){let t={enabled:"#22c55e",draft:"#f59e0b",disabled:"#d9d9d9"};return t[e]??t.disabled}function En(e){return typeof e.graphDefinition=="object"&&e.graphDefinition!==null?e.graphDefinition:{}}function yr(e){return((En(e).metadata??{}).tags??"").split(",").map(r=>r.trim()).filter(Boolean)}function vr(e){let o=(En(e).metadata??{}).version;return o?o.startsWith("v")?o:`v${o}`:"v1"}function hr(e){let o=(En(e).metadata??{}).status??"enabled";return o==="draft"||o==="disabled"?o:"enabled"}function mr(e){let n=En(e).subAgents??[],o=Array.isArray(n)?n.filter(Boolean):[];return Array.from(new Set(o))}function ec(e){return e.map(t=>{let n=En(t),o=String(n.type??"react");return{id:t.id,name:t.name,description:t.description,type:Pn(o).label,tags:yr(t),version:vr(t),status:hr(t),subAgents:mr(t)}})}function tc(e){let t=new Set(e.map(r=>r.id)),n=e.map(r=>({id:r.id,label:r.name,type:Pn(String(En(r).type??"react")).label,subAgentCount:mr(r).length})),o=[];for(let r of e)for(let i of mr(r))t.has(i)&&o.push({source:r.id,target:i});return{nodes:n,edges:o}}var Se=R(Ie());var te=R(Ie());var b=R(W()),{TextArea:Qs}=Me,{Text:It}=Be,Qi=["data","execution","workflow","assistant"],Yi={data:"chatConfig.agentPanel.category.data",execution:"chatConfig.agentPanel.category.execution",workflow:"chatConfig.agentPanel.category.workflow",assistant:"chatConfig.agentPanel.category.assistant",other:"chatConfig.agentPanel.category.other"},Ys={react:"chatConfig.agentPanel.typeDesc.react",deep_agent:"chatConfig.agentPanel.typeDesc.deepAgent",team:"chatConfig.agentPanel.typeDesc.team",processing:"chatConfig.agentPanel.typeDesc.processing"},$n=(e,t)=>{if(Array.isArray(e)){let n=e.map(o=>$n(o));return(t==="tools"||t==="subAgents")&&n.every(o=>typeof o=="string")?[...n].sort():n}return e!==null&&typeof e=="object"?Object.fromEntries(Object.entries(e).sort(([n],[o])=>n.localeCompare(o)).map(([n,o])=>[n,$n(o,n)])):e},Xi=e=>{if(typeof e!="string")return $n(e??null);try{return $n(JSON.parse(e))}catch{return e}},Ji=e=>JSON.stringify($n({...e,tools:[...e.tools].sort(),subAgents:[...e.subAgents].sort()})),Xs=Si(({token:e,css:t})=>({modalBody:t`
2
2
  padding: 0;
3
3
  height: 92vh;
4
4
  width: 100%;
@@ -1,4 +1,4 @@
1
- import{b as h}from"./embed-page-chunk-PFCR6CFL.js";import"./embed-page-chunk-7PNQFZMK.js";import"./embed-page-chunk-O44JEYLD.js";import{a as E}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-QULNM5O2.js";import{a as b}from"./embed-page-chunk-MHGVD4EV.js";import"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-QOWM3LMZ.js";import"./embed-page-chunk-EUOOO2LS.js";import"./embed-page-chunk-5JDQ456X.js";import{b as f}from"./embed-page-chunk-HYPA2PHA.js";import{c as z,f as l}from"./embed-page-chunk-QBTAJ2YI.js";var x=z(m=>{"use strict";var y=b();m.createRoot=y.createRoot,m.hydrateRoot=y.hydrateRoot;var te});var T=l(x()),M=l(b());var w="axiom-web-app-embed";var _=["axiom:hello","axiom:identity","axiom:send","axiom:config"];function R(e,t){return{source:w,version:1,type:e,payload:t}}var B=6,H=40,Q=500;function q(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=Object.keys(t);return n.length!==2||!n.includes("label")||!n.includes("text")?!1:typeof t.label=="string"&&t.label.length>=1&&t.label.length<=H&&typeof t.text=="string"&&t.text.length>=1&&t.text.length<=Q}function G(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(t.length>=B)break;q(n)&&t.push({label:n.label,text:n.text})}return t}function C(e){if(typeof e!="object"||e===null)return null;let t=e,n={};if(typeof t.welcome=="string"&&t.welcome.length>0&&(n.welcome=t.welcome),Array.isArray(t.quicks)){let a=G(t.quicks);(a.length>0||t.quicks.length===0)&&(n.quicks=a)}return n.welcome===void 0&&n.quicks===void 0?null:n}function A(e,t){if(typeof e!="object"||e===null)return null;let n=e;return n.source!==w||n.version!==1||typeof n.type!="string"||!t.includes(n.type)?null:{type:n.type,payload:n.payload}}var r=l(E()),S=/^[A-Za-z0-9._:@-]{1,128}$/,v="axiom-embed-root",k="axiom-embed-style",P=32768,j=`
1
+ import{b as h}from"./embed-page-chunk-QGXGVLAX.js";import"./embed-page-chunk-QHXKZNDU.js";import"./embed-page-chunk-O44JEYLD.js";import{a as E}from"./embed-page-chunk-QV7QAJ4N.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-QULNM5O2.js";import{a as b}from"./embed-page-chunk-MHGVD4EV.js";import"./embed-page-chunk-R5QL57JJ.js";import"./embed-page-chunk-QOWM3LMZ.js";import"./embed-page-chunk-EUOOO2LS.js";import"./embed-page-chunk-5JDQ456X.js";import{b as f}from"./embed-page-chunk-HYPA2PHA.js";import{c as z,f as l}from"./embed-page-chunk-QBTAJ2YI.js";var x=z(m=>{"use strict";var y=b();m.createRoot=y.createRoot,m.hydrateRoot=y.hydrateRoot;var te});var T=l(x()),M=l(b());var w="axiom-web-app-embed";var _=["axiom:hello","axiom:identity","axiom:send","axiom:config"];function R(e,t){return{source:w,version:1,type:e,payload:t}}var B=6,H=40,Q=500;function q(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=Object.keys(t);return n.length!==2||!n.includes("label")||!n.includes("text")?!1:typeof t.label=="string"&&t.label.length>=1&&t.label.length<=H&&typeof t.text=="string"&&t.text.length>=1&&t.text.length<=Q}function G(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(t.length>=B)break;q(n)&&t.push({label:n.label,text:n.text})}return t}function C(e){if(typeof e!="object"||e===null)return null;let t=e,n={};if(typeof t.welcome=="string"&&t.welcome.length>0&&(n.welcome=t.welcome),Array.isArray(t.quicks)){let a=G(t.quicks);(a.length>0||t.quicks.length===0)&&(n.quicks=a)}return n.welcome===void 0&&n.quicks===void 0?null:n}function A(e,t){if(typeof e!="object"||e===null)return null;let n=e;return n.source!==w||n.version!==1||typeof n.type!="string"||!t.includes(n.type)?null:{type:n.type,payload:n.payload}}var r=l(E()),S=/^[A-Za-z0-9._:@-]{1,128}$/,v="axiom-embed-root",k="axiom-embed-style",P=32768,j=`
2
2
  html, body, #${v} { height: 100%; margin: 0; }
3
3
  .axiom-embed-fill { height: 100% !important; min-height: 0 !important; }
4
4
  .axiom-embed-card { display: flex; align-items: center; justify-content: center; height: 100%; margin: 0; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px; color: #64748b; padding: 24px; box-sizing: border-box; text-align: center; }
package/dist/index.d.mts CHANGED
@@ -157,6 +157,18 @@ declare class MessageRouter {
157
157
  dispatch(message: InboundMessage, options?: InternalMessageDispatchOptions): Promise<DispatchResult>;
158
158
  private dispatchInternal;
159
159
  private runMiddlewares;
160
+ /** 流式中途刷新的节流间隔与上限(微信单会话 30 条/分钟,留余量)。 */
161
+ private static readonly STREAM_CHUNK_INTERVAL_MS;
162
+ private static readonly MAX_STREAM_CHUNKS;
163
+ /**
164
+ * 消费 agent 的逐块输出,把**中途**内容推给支持流式的渠道适配器。
165
+ *
166
+ * @remarks
167
+ * 纯加法、best-effort:不抛错,也**不发最终内容** —— 最终由
168
+ * `reply:ready` → `sendStreamChunk({ done: true })` 收尾。未实现
169
+ * `sendStreamChunk` 的适配器不会走到这里,行为完全不变。
170
+ */
171
+ private streamAgentOutputToChannel;
160
172
  /**
161
173
  * Projects a pending HITL interrupt into the room as an independent bot message.
162
174
  *
@@ -175,6 +187,20 @@ declare class MessageRouter {
175
187
  * thin HTTP shell.
176
188
  */
177
189
 
190
+ /**
191
+ * A model the deployment registered for execution, as the registry holds it.
192
+ *
193
+ * The config travels with the key because the catalog needs it: a bare key is
194
+ * not something to offer a user. `GET /api/models` used to call
195
+ * `lattice.client.getConfig()` for exactly this — the deployment's display
196
+ * name, and the upstream model it names. Handing back keys alone left catalog
197
+ * entries with nothing to render, so the deployment's `default` alias showed up
198
+ * as a row literally labelled `default`.
199
+ */
200
+ interface RegisteredModel {
201
+ modelKey: string;
202
+ config: LLMConfig;
203
+ }
178
204
  /** Narrow persistence and registry dependencies of the service. */
179
205
  interface ModelProviderServiceDeps {
180
206
  providerStore: ModelProviderStore;
@@ -183,7 +209,7 @@ interface ModelProviderServiceDeps {
183
209
  register(tenantId: string, modelKey: string, config: LLMConfig): void;
184
210
  has(tenantId: string, modelKey: string): boolean;
185
211
  remove(tenantId: string, modelKey: string): boolean;
186
- listRegistered(tenantId: string): string[];
212
+ listRegistered(tenantId: string): RegisteredModel[];
187
213
  /**
188
214
  * Drop the registry's cached "this tenant has no default model" answer.
189
215
  *
package/dist/index.d.ts CHANGED
@@ -157,6 +157,18 @@ declare class MessageRouter {
157
157
  dispatch(message: InboundMessage, options?: InternalMessageDispatchOptions): Promise<DispatchResult>;
158
158
  private dispatchInternal;
159
159
  private runMiddlewares;
160
+ /** 流式中途刷新的节流间隔与上限(微信单会话 30 条/分钟,留余量)。 */
161
+ private static readonly STREAM_CHUNK_INTERVAL_MS;
162
+ private static readonly MAX_STREAM_CHUNKS;
163
+ /**
164
+ * 消费 agent 的逐块输出,把**中途**内容推给支持流式的渠道适配器。
165
+ *
166
+ * @remarks
167
+ * 纯加法、best-effort:不抛错,也**不发最终内容** —— 最终由
168
+ * `reply:ready` → `sendStreamChunk({ done: true })` 收尾。未实现
169
+ * `sendStreamChunk` 的适配器不会走到这里,行为完全不变。
170
+ */
171
+ private streamAgentOutputToChannel;
160
172
  /**
161
173
  * Projects a pending HITL interrupt into the room as an independent bot message.
162
174
  *
@@ -175,6 +187,20 @@ declare class MessageRouter {
175
187
  * thin HTTP shell.
176
188
  */
177
189
 
190
+ /**
191
+ * A model the deployment registered for execution, as the registry holds it.
192
+ *
193
+ * The config travels with the key because the catalog needs it: a bare key is
194
+ * not something to offer a user. `GET /api/models` used to call
195
+ * `lattice.client.getConfig()` for exactly this — the deployment's display
196
+ * name, and the upstream model it names. Handing back keys alone left catalog
197
+ * entries with nothing to render, so the deployment's `default` alias showed up
198
+ * as a row literally labelled `default`.
199
+ */
200
+ interface RegisteredModel {
201
+ modelKey: string;
202
+ config: LLMConfig;
203
+ }
178
204
  /** Narrow persistence and registry dependencies of the service. */
179
205
  interface ModelProviderServiceDeps {
180
206
  providerStore: ModelProviderStore;
@@ -183,7 +209,7 @@ interface ModelProviderServiceDeps {
183
209
  register(tenantId: string, modelKey: string, config: LLMConfig): void;
184
210
  has(tenantId: string, modelKey: string): boolean;
185
211
  remove(tenantId: string, modelKey: string): boolean;
186
- listRegistered(tenantId: string): string[];
212
+ listRegistered(tenantId: string): RegisteredModel[];
187
213
  /**
188
214
  * Drop the registry's cached "this tenant has no default model" answer.
189
215
  *