@axiom-lattice/react-sdk 4.11.1 → 4.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AgentDetailSideApp-OW5LUKMG.mjs → AgentDetailSideApp-GSO53ECQ.mjs} +6 -6
- package/dist/{AgentGovernanceWorkbench-NNCUUU3E.mjs → AgentGovernanceWorkbench-LHXFBEYO.mjs} +7 -7
- package/dist/{MessageGraph-SGLKFEJK.mjs → MessageGraph-RUU5W4OT.mjs} +2 -2
- package/dist/{ReactChart-FHVYPC7S.mjs → ReactChart-KU4TD7TM.mjs} +2 -2
- package/dist/{TasksSideApp-F2ZZTWGN.mjs → TasksSideApp-LWM6XAWN.mjs} +3 -3
- package/dist/{TeamWorkspace-AQOUI5EN.mjs → TeamWorkspace-3NLKUNRK.mjs} +2 -2
- package/dist/{TopologyRuntimeView-6GZUQLB6.mjs → TopologyRuntimeView-NVFFMHTP.mjs} +3 -3
- package/dist/{WorkflowAutomationView-UUAUG3LZ.mjs → WorkflowAutomationView-WBVKM73F.mjs} +5 -5
- package/dist/{chunk-MASPEZN4.mjs → chunk-BXPPM4ZX.mjs} +2 -2
- package/dist/{chunk-TXBE42BY.mjs → chunk-NRT6JXPT.mjs} +4 -4
- package/dist/{chunk-JBDRDPL5.mjs → chunk-PMICYMSW.mjs} +13 -13
- package/dist/chunk-PMICYMSW.mjs.map +1 -0
- package/dist/{chunk-HLOK3K5J.mjs → chunk-QM3NPPQJ.mjs} +5 -5
- package/dist/{chunk-J23W2JYG.mjs → chunk-YDIVRYML.mjs} +2 -2
- package/dist/{chunk-TMGDS7XU.mjs → chunk-ZX53OESZ.mjs} +2 -2
- package/dist/{chunk-TIYJFBLK.mjs → chunk-ZXEY5OGX.mjs} +4 -4
- package/dist/{embed-page-AgentDetailSideApp-2M4MLVQQ.js → embed-page-AgentDetailSideApp-FHC56ARN.js} +1 -1
- package/dist/{embed-page-AgentGovernanceWorkbench-KEVBIQP6.js → embed-page-AgentGovernanceWorkbench-KAPZJBE6.js} +1 -1
- package/dist/{embed-page-MessageGraph-PRBUQINR.js → embed-page-MessageGraph-DMP5EZBM.js} +1 -1
- package/dist/{embed-page-ReactChart-V6JJXCEV.js → embed-page-ReactChart-PYGNSRHG.js} +1 -1
- package/dist/{embed-page-TasksSideApp-OFZI54MF.js → embed-page-TasksSideApp-MPYOPRXW.js} +1 -1
- package/dist/{embed-page-TeamWorkspace-QSSAF3AA.js → embed-page-TeamWorkspace-EXUAXKAH.js} +1 -1
- package/dist/{embed-page-TopologyRuntimeView-PHULW2NG.js → embed-page-TopologyRuntimeView-MH4YMU7D.js} +1 -1
- package/dist/{embed-page-WorkflowAutomationView-LQS6H7X6.js → embed-page-WorkflowAutomationView-KQYFSLLH.js} +1 -1
- package/dist/{embed-page-chunk-SSWDAKQU.js → embed-page-chunk-I7BVN6EY.js} +1 -1
- package/dist/{embed-page-chunk-D5EY6ASK.js → embed-page-chunk-JSAUTBU5.js} +1 -1
- package/dist/{embed-page-chunk-YNHKD2CY.js → embed-page-chunk-NW37OVAX.js} +1 -1
- package/dist/{embed-page-chunk-PFCR6CFL.js → embed-page-chunk-QGXGVLAX.js} +1 -1
- package/dist/{embed-page-chunk-7PNQFZMK.js → embed-page-chunk-QHXKZNDU.js} +6 -6
- package/dist/{embed-page-chunk-IJ2YWGKU.js → embed-page-chunk-YQZI5LNV.js} +1 -1
- package/dist/embed-page.js +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -7
- package/package.json +3 -3
- package/dist/chunk-JBDRDPL5.mjs.map +0 -1
- /package/dist/{AgentDetailSideApp-OW5LUKMG.mjs.map → AgentDetailSideApp-GSO53ECQ.mjs.map} +0 -0
- /package/dist/{AgentGovernanceWorkbench-NNCUUU3E.mjs.map → AgentGovernanceWorkbench-LHXFBEYO.mjs.map} +0 -0
- /package/dist/{MessageGraph-SGLKFEJK.mjs.map → MessageGraph-RUU5W4OT.mjs.map} +0 -0
- /package/dist/{ReactChart-FHVYPC7S.mjs.map → ReactChart-KU4TD7TM.mjs.map} +0 -0
- /package/dist/{TasksSideApp-F2ZZTWGN.mjs.map → TasksSideApp-LWM6XAWN.mjs.map} +0 -0
- /package/dist/{TeamWorkspace-AQOUI5EN.mjs.map → TeamWorkspace-3NLKUNRK.mjs.map} +0 -0
- /package/dist/{TopologyRuntimeView-6GZUQLB6.mjs.map → TopologyRuntimeView-NVFFMHTP.mjs.map} +0 -0
- /package/dist/{WorkflowAutomationView-UUAUG3LZ.mjs.map → WorkflowAutomationView-WBVKM73F.mjs.map} +0 -0
- /package/dist/{chunk-MASPEZN4.mjs.map → chunk-BXPPM4ZX.mjs.map} +0 -0
- /package/dist/{chunk-TXBE42BY.mjs.map → chunk-NRT6JXPT.mjs.map} +0 -0
- /package/dist/{chunk-HLOK3K5J.mjs.map → chunk-QM3NPPQJ.mjs.map} +0 -0
- /package/dist/{chunk-J23W2JYG.mjs.map → chunk-YDIVRYML.mjs.map} +0 -0
- /package/dist/{chunk-TMGDS7XU.mjs.map → chunk-ZX53OESZ.mjs.map} +0 -0
- /package/dist/{chunk-TIYJFBLK.mjs.map → chunk-ZXEY5OGX.mjs.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{M as G,a as pe,b as ce,r as me,sb as he,ta as fe,tb as be,ua as q,wa as Ae,ya as ge}from"./embed-page-chunk-
|
|
1
|
+
import{M as G,a as pe,b as ce,r as me,sb as he,ta as fe,tb as be,ua as q,wa as Ae,ya as ge}from"./embed-page-chunk-QHXKZNDU.js";import{B as ue,a as S,e as v,f as ne,g as oe,n as ae,r as L,s as ie,t as se,u as de,x as le}from"./embed-page-chunk-O44JEYLD.js";import{a as M}from"./embed-page-chunk-QV7QAJ4N.js";import{i as Q,j as Ne,k as Oe,l as je,m as Fe}from"./embed-page-chunk-QULNM5O2.js";import{M as te,va as re}from"./embed-page-chunk-MHGVD4EV.js";import{a as ee}from"./embed-page-chunk-R5QL57JJ.js";import{c as T,f as R}from"./embed-page-chunk-QBTAJ2YI.js";var Ie=T(O=>{"use strict";Object.defineProperty(O,"__esModule",{value:!0});O.default=void 0;var it={items_per_page:"\u6761/\u9875",jump_to:"\u8DF3\u81F3",jump_to_confirm:"\u786E\u5B9A",page:"\u9875",prev_page:"\u4E0A\u4E00\u9875",next_page:"\u4E0B\u4E00\u9875",prev_5:"\u5411\u524D 5 \u9875",next_5:"\u5411\u540E 5 \u9875",prev_3:"\u5411\u524D 3 \u9875",next_3:"\u5411\u540E 3 \u9875",page_size:"\u9875\u7801"},Qt=O.default=it});var _e=T(j=>{"use strict";var st=Ne().default;Object.defineProperty(j,"__esModule",{value:!0});j.default=void 0;var Pe=st(Oe()),dt=je(),lt=(0,Pe.default)((0,Pe.default)({},dt.commonLocale),{},{locale:"zh_CN",today:"\u4ECA\u5929",now:"\u6B64\u523B",backToToday:"\u8FD4\u56DE\u4ECA\u5929",ok:"\u786E\u5B9A",timeSelect:"\u9009\u62E9\u65F6\u95F4",dateSelect:"\u9009\u62E9\u65E5\u671F",weekSelect:"\u9009\u62E9\u5468",clear:"\u6E05\u9664",week:"\u5468",month:"\u6708",year:"\u5E74",previousMonth:"\u4E0A\u4E2A\u6708 (\u7FFB\u9875\u4E0A\u952E)",nextMonth:"\u4E0B\u4E2A\u6708 (\u7FFB\u9875\u4E0B\u952E)",monthSelect:"\u9009\u62E9\u6708\u4EFD",yearSelect:"\u9009\u62E9\u5E74\u4EFD",decadeSelect:"\u9009\u62E9\u5E74\u4EE3",previousYear:"\u4E0A\u4E00\u5E74 (Control\u952E\u52A0\u5DE6\u65B9\u5411\u952E)",nextYear:"\u4E0B\u4E00\u5E74 (Control\u952E\u52A0\u53F3\u65B9\u5411\u952E)",previousDecade:"\u4E0A\u4E00\u5E74\u4EE3",nextDecade:"\u4E0B\u4E00\u5E74\u4EE3",previousCentury:"\u4E0A\u4E00\u4E16\u7EAA",nextCentury:"\u4E0B\u4E00\u4E16\u7EAA",yearFormat:"YYYY\u5E74",cellDateFormat:"D",monthBeforeYear:!1}),Yt=j.default=lt});var V=T(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.default=void 0;var pt={placeholder:"\u8BF7\u9009\u62E9\u65F6\u95F4",rangePlaceholder:["\u5F00\u59CB\u65F6\u95F4","\u7ED3\u675F\u65F6\u95F4"]},Zt=F.default=pt});var Y=T(H=>{"use strict";var We=Q().default;Object.defineProperty(H,"__esModule",{value:!0});H.default=void 0;var ct=We(_e()),ut=We(V()),Le={lang:Object.assign({placeholder:"\u8BF7\u9009\u62E9\u65E5\u671F",yearPlaceholder:"\u8BF7\u9009\u62E9\u5E74\u4EFD",quarterPlaceholder:"\u8BF7\u9009\u62E9\u5B63\u5EA6",monthPlaceholder:"\u8BF7\u9009\u62E9\u6708\u4EFD",weekPlaceholder:"\u8BF7\u9009\u62E9\u5468",rangePlaceholder:["\u5F00\u59CB\u65E5\u671F","\u7ED3\u675F\u65E5\u671F"],rangeYearPlaceholder:["\u5F00\u59CB\u5E74\u4EFD","\u7ED3\u675F\u5E74\u4EFD"],rangeMonthPlaceholder:["\u5F00\u59CB\u6708\u4EFD","\u7ED3\u675F\u6708\u4EFD"],rangeQuarterPlaceholder:["\u5F00\u59CB\u5B63\u5EA6","\u7ED3\u675F\u5B63\u5EA6"],rangeWeekPlaceholder:["\u5F00\u59CB\u5468","\u7ED3\u675F\u5468"]},ct.default),timePickerLocale:Object.assign({},ut.default)};Le.lang.ok="\u786E\u5B9A";var tr=H.default=Le});var xe=T(B=>{"use strict";var mt=Q().default;Object.defineProperty(B,"__esModule",{value:!0});B.default=void 0;var ft=mt(Y()),nr=B.default=ft.default});var ve=T(X=>{"use strict";var z=Q().default;Object.defineProperty(X,"__esModule",{value:!0});X.default=void 0;var At=z(Ie()),gt=z(xe()),ht=z(Y()),bt=z(V()),y="${label}\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684${type}",yt={locale:"zh-cn",Pagination:At.default,DatePicker:ht.default,TimePicker:bt.default,Calendar:gt.default,global:{placeholder:"\u8BF7\u9009\u62E9",close:"\u5173\u95ED"},Table:{filterTitle:"\u7B5B\u9009",filterConfirm:"\u786E\u5B9A",filterReset:"\u91CD\u7F6E",filterEmptyText:"\u65E0\u7B5B\u9009\u9879",filterCheckAll:"\u5168\u9009",filterSearchPlaceholder:"\u5728\u7B5B\u9009\u9879\u4E2D\u641C\u7D22",emptyText:"\u6682\u65E0\u6570\u636E",selectAll:"\u5168\u9009\u5F53\u9875",selectInvert:"\u53CD\u9009\u5F53\u9875",selectNone:"\u6E05\u7A7A\u6240\u6709",selectionAll:"\u5168\u9009\u6240\u6709",sortTitle:"\u6392\u5E8F",expand:"\u5C55\u5F00\u884C",collapse:"\u5173\u95ED\u884C",triggerDesc:"\u70B9\u51FB\u964D\u5E8F",triggerAsc:"\u70B9\u51FB\u5347\u5E8F",cancelSort:"\u53D6\u6D88\u6392\u5E8F"},Modal:{okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",justOkText:"\u77E5\u9053\u4E86"},Tour:{Next:"\u4E0B\u4E00\u6B65",Previous:"\u4E0A\u4E00\u6B65",Finish:"\u7ED3\u675F\u5BFC\u89C8"},Popconfirm:{cancelText:"\u53D6\u6D88",okText:"\u786E\u5B9A"},Transfer:{titles:["",""],searchPlaceholder:"\u8BF7\u8F93\u5165\u641C\u7D22\u5185\u5BB9",itemUnit:"\u9879",itemsUnit:"\u9879",remove:"\u5220\u9664",selectCurrent:"\u5168\u9009\u5F53\u9875",removeCurrent:"\u5220\u9664\u5F53\u9875",selectAll:"\u5168\u9009\u6240\u6709",deselectAll:"\u53D6\u6D88\u5168\u9009",removeAll:"\u5220\u9664\u5168\u90E8",selectInvert:"\u53CD\u9009\u5F53\u9875"},Upload:{uploading:"\u6587\u4EF6\u4E0A\u4F20\u4E2D",removeFile:"\u5220\u9664\u6587\u4EF6",uploadError:"\u4E0A\u4F20\u9519\u8BEF",previewFile:"\u9884\u89C8\u6587\u4EF6",downloadFile:"\u4E0B\u8F7D\u6587\u4EF6"},Empty:{description:"\u6682\u65E0\u6570\u636E"},Icon:{icon:"\u56FE\u6807"},Text:{edit:"\u7F16\u8F91",copy:"\u590D\u5236",copied:"\u590D\u5236\u6210\u529F",expand:"\u5C55\u5F00",collapse:"\u6536\u8D77"},Form:{optional:"\uFF08\u53EF\u9009\uFF09",defaultValidateMessages:{default:"\u5B57\u6BB5\u9A8C\u8BC1\u9519\u8BEF${label}",required:"\u8BF7\u8F93\u5165${label}",enum:"${label}\u5FC5\u987B\u662F\u5176\u4E2D\u4E00\u4E2A[${enum}]",whitespace:"${label}\u4E0D\u80FD\u4E3A\u7A7A\u5B57\u7B26",date:{format:"${label}\u65E5\u671F\u683C\u5F0F\u65E0\u6548",parse:"${label}\u4E0D\u80FD\u8F6C\u6362\u4E3A\u65E5\u671F",invalid:"${label}\u662F\u4E00\u4E2A\u65E0\u6548\u65E5\u671F"},types:{string:y,method:y,array:y,object:y,number:y,date:y,boolean:y,integer:y,float:y,regexp:y,email:y,url:y,hex:y},string:{len:"${label}\u987B\u4E3A${len}\u4E2A\u5B57\u7B26",min:"${label}\u6700\u5C11${min}\u4E2A\u5B57\u7B26",max:"${label}\u6700\u591A${max}\u4E2A\u5B57\u7B26",range:"${label}\u987B\u5728${min}-${max}\u5B57\u7B26\u4E4B\u95F4"},number:{len:"${label}\u5FC5\u987B\u7B49\u4E8E${len}",min:"${label}\u6700\u5C0F\u503C\u4E3A${min}",max:"${label}\u6700\u5927\u503C\u4E3A${max}",range:"${label}\u987B\u5728${min}-${max}\u4E4B\u95F4"},array:{len:"\u987B\u4E3A${len}\u4E2A${label}",min:"\u6700\u5C11${min}\u4E2A${label}",max:"\u6700\u591A${max}\u4E2A${label}",range:"${label}\u6570\u91CF\u987B\u5728${min}-${max}\u4E4B\u95F4"},pattern:{mismatch:"${label}\u4E0E\u6A21\u5F0F\u4E0D\u5339\u914D${pattern}"}}},Image:{preview:"\u9884\u89C8"},QRCode:{expired:"\u4E8C\u7EF4\u7801\u8FC7\u671F",refresh:"\u70B9\u51FB\u5237\u65B0",scanned:"\u5DF2\u626B\u63CF"},ColorPicker:{presetEmpty:"\u6682\u65E0",transparent:"\u65E0\u8272",singleColor:"\u5355\u8272",gradientColor:"\u6E10\u53D8\u8272"}},ar=X.default=yt});var qe=T((sr,Me)=>{"use strict";Me.exports=ve()});var u=R(ee());var g=class extends Error{code;retryable;status;constructor(r,t,n,a){super(t),this.name="AgentWebAppRuntimeClientError",this.code=r,this.retryable=n,this.status=a}};function k(){return new g("STREAM_FAILED","Stream failed",!0)}var He=new Set(["WEB_APP_NOT_FOUND","WEB_APP_DISABLED","USER_ID_REQUIRED","INVALID_USER_ID","PROJECT_NOT_ALLOWED","PROJECT_SELECTOR_DISABLED","MODEL_NOT_ALLOWED","FEATURE_DISABLED","THREAD_NOT_FOUND","STREAM_CONFLICT","STREAM_FAILED","INVALID_REQUEST","INTERNAL_ERROR"]);function I(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function w(e,r){return Object.keys(e).length===r.length&&r.every(n=>n in e)}function Be(e){return I(e)&&w(e,["code","message","retryable"])&&typeof e.code=="string"&&He.has(e.code)&&typeof e.message=="string"&&typeof e.retryable=="boolean"}function ze(e){if(!I(e))return!1;let r=e.data===void 0?["id","type","prompt"]:["id","type","prompt","data"];return w(e,r)&&typeof e.id=="string"&&typeof e.type=="string"&&typeof e.prompt=="string"&&(e.data===void 0||I(e.data))}var Xe=new Set([S.HUMAN,S.AI,S.TOOL,S.INTERRUPT,S.MESSAGE_COMPLETED,S.MESSAGE_FAILED,S.THREAD_IDLE]);function Ke(e,r){let t;try{t=JSON.parse(e)}catch{throw k()}if(!I(t)||typeof t.type!="string")throw k();if(Xe.has(t.type)||t.type==="error"&&I(t.data)&&!I(t.error)){let n=oe(t,r);return n.length===0?[]:n}switch(t.type){case"message.delta":if(w(t,["type","text"])&&typeof t.text=="string")return[t];break;case"message.completed":if(w(t,["type","messageId"])&&typeof t.messageId=="string")return[t];break;case"tool.started":if(w(t,["type","id","name"])&&typeof t.id=="string"&&typeof t.name=="string")return[t];break;case"tool.completed":if(w(t,["type","id"])&&typeof t.id=="string")return[t];break;case"interrupt.created":if(w(t,["type","interrupt"])&&ze(t.interrupt))return[t];break;case"genui.render":if(w(t,["type","block"])&&v(t.block))return[t];break;case"error":if(w(t,["type","error"])&&Be(t.error))return[t];break;case"stream.completed":if(w(t,["type"]))return[t];break}throw k()}function Ge(e){return e instanceof Error&&e.name==="AbortError"}async function ye(e,r){let t=ne({allowGenUI:!0,allowInterrupts:!0}),n=e.getReader(),a=new TextDecoder,o="",i=!1,d=!1;try{for(;!i;){let l;try{l=await n.read()}catch(p){if(Ge(p))return;throw k()}l.done&&(d=!0);try{o+=a.decode(l.value,{stream:!l.done})}catch{throw k()}let C=o.split(/\r?\n\r?\n/);o=l.done?"":C.pop()??"";for(let p of C){let A=p.split(/\r?\n/).filter(m=>m==="data"||m.startsWith("data:")).map(m=>m==="data"?"":m.slice(5).replace(/^ /,""));if(A.length!==0){for(let m of Ke(A.join(`
|
|
2
2
|
`),t))if(await r(m),i=m.type==="stream.completed",i)break;if(i)break}}if(l.done)break}if(!i)throw k()}finally{if(!d)try{await n.cancel()}catch{}n.releaseLock()}}var Qe=new Set(["WEB_APP_NOT_FOUND","WEB_APP_DISABLED","USER_ID_REQUIRED","INVALID_USER_ID","PROJECT_NOT_ALLOWED","PROJECT_SELECTOR_DISABLED","MODEL_NOT_ALLOWED","FEATURE_DISABLED","THREAD_NOT_FOUND","STREAM_CONFLICT","STREAM_FAILED","INVALID_REQUEST","INTERNAL_ERROR"]);function f(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function h(e,r,t=[]){let n=Object.keys(e);return r.every(a=>a in e)&&n.every(a=>r.includes(a)||t.includes(a))}function s(e){return typeof e=="string"}function D(e){if(!f(e)||!h(e,["id","projectId","createdAt","updatedAt"],["label"])||!s(e.id)||!s(e.projectId)||e.label!==void 0&&!s(e.label)||!s(e.createdAt)||!s(e.updatedAt))return;let r=new Date(e.createdAt),t=new Date(e.updatedAt);if(!(Number.isNaN(r.getTime())||Number.isNaN(t.getTime())))return{id:e.id,projectId:e.projectId,...e.label===void 0?{}:{label:e.label},createdAt:r,updatedAt:t}}function Ce(e){if(!f(e)||e.success!==!1||!f(e.error))return!1;let r=e.error;return h(e,["success","error"])&&h(r,["code","message","retryable"])&&typeof r.code=="string"&&Qe.has(r.code)&&typeof r.message=="string"&&typeof r.retryable=="boolean"}function Ve(e){if(!f(e))return!1;let r=["projectSelector","modelSelector","threadManagement","attachments","hitl","genUI"];return h(e,r,["files"])&&r.every(t=>typeof e[t]=="boolean")&&(e.files===void 0||typeof e.files=="boolean")}function Ye(e){return Array.isArray(e)&&e.length<=6&&e.every(r=>f(r)&&h(r,["label","text"])&&s(r.label)&&r.label.length>=1&&r.label.length<=40&&s(r.text)&&r.text.length>=1&&r.text.length<=500)}function Je(e){return f(e)&&h(e,[],["title","welcomeMessage","primaryColor","quickPrompts"])&&(e.title===void 0||s(e.title))&&(e.welcomeMessage===void 0||s(e.welcomeMessage))&&(e.primaryColor===void 0||s(e.primaryColor))&&(e.quickPrompts===void 0||Ye(e.quickPrompts))}function Ze(e){if(!f(e)||!h(e,["webApp","projects","models"],["thread"])||!f(e.webApp))return;let r=e.webApp;if(!h(r,["id","name","assistant","defaultProjectId","features","appearance","identityAssurance"],["description","defaultModelKey"])||!s(r.id)||!s(r.name)||!s(r.defaultProjectId)||r.description!==void 0&&!s(r.description)||r.defaultModelKey!==void 0&&!s(r.defaultModelKey)||r.identityAssurance!=="unverified"||!f(r.assistant)||!h(r.assistant,["id","name"],["description"])||!s(r.assistant.id)||!s(r.assistant.name)||r.assistant.description!==void 0&&!s(r.assistant.description)||!Ve(r.features)||!Je(r.appearance)||!Array.isArray(e.projects)||!e.projects.every(n=>f(n)&&h(n,["id","name"])&&s(n.id)&&s(n.name))||!Array.isArray(e.models)||!e.models.every(n=>f(n)&&h(n,["key","label"])&&s(n.key)&&s(n.label)))return;let t=e.thread===void 0?void 0:D(e.thread);if(!(e.thread!==void 0&&!t))return{...e,...t?{thread:t}:{}}}function et(e){if(!f(e)||!h(e,["records","total"])||!Array.isArray(e.records)||typeof e.total!="number")return;let r=e.records.map(D);return r.every(t=>t!==void 0)?{records:r,total:e.total}:void 0}function tt(e){return f(e)&&s(e.id)&&(e.role==="human"||e.role==="ai")&&(e.content===void 0||s(e.content)||Array.isArray(e.content)&&e.content.every(r=>v(r)!==void 0))}function rt(e){return f(e)&&h(e,["messages"])&&Array.isArray(e.messages)&&e.messages.every(tt)?e:void 0}function nt(e){return f(e)&&h(e,["ref","name","mimeType","size"])&&s(e.ref)&&s(e.name)&&s(e.mimeType)&&typeof e.size=="number"?e:void 0}function we(e,r){return t=>f(t)&&h(t,e)&&r(t)?t:void 0}var U=class{constructor(r){this.options=r;this.baseUrl=`${r.gatewayUrl.replace(/\/+$/,"")}/api/web-apps/${encodeURIComponent(r.webAppId)}/runtime`,this.fetchImplementation=r.fetch??globalThis.fetch.bind(globalThis),this.translate=r.translate}baseUrl;fetchImplementation;translate;async bootstrap(r={},t){return this.request("bootstrap",Ze,{query:r,signal:t})}async listThreads(r={},t){return this.request("threads",et,{query:r,signal:t})}async createThread(r={},t){return this.request("threads",D,{method:"POST",body:r,signal:t})}async updateThread(r,t,n){return this.request(`threads/${encodeURIComponent(r)}`,D,{method:"PATCH",body:t,signal:n})}async deleteThread(r,t={},n){await this.request(`threads/${encodeURIComponent(r)}`,we(["id"],a=>s(a.id)),{method:"DELETE",query:t,signal:n})}async getMessages(r,t={},n){return this.request(`threads/${encodeURIComponent(r)}/messages`,rt,{query:t,signal:n})}async streamMessage(r,t,n,a){return this.streamRequest(`threads/${encodeURIComponent(r)}/messages/stream`,t,n,a)}async resumeInterrupt(r,t,n,a,o){return this.streamRequest(`threads/${encodeURIComponent(r)}/interrupts/${encodeURIComponent(t)}/resume`,n,a,o)}async streamRequest(r,t,n,a){let o;try{o=await this.fetchRequest(r,{method:"POST",body:t,signal:a})}catch(i){throw Ee(i)||i instanceof g?i:new g("STREAM_FAILED",this.translate?.("integration.error.streamFailed")??"Stream failed",!0)}if(o.ok||await this.throwResponseError(o),!o.body||!o.headers.get("content-type")?.toLowerCase().includes("text/event-stream")){if(o.body)try{await o.body.cancel()}catch{}throw new g("STREAM_FAILED",this.translate?.("integration.error.streamFailed")??"Stream failed",!0,o.status)}await ye(o.body,n)}async abort(r,t={},n){await this.request(`threads/${encodeURIComponent(r)}/abort`,we(["aborted"],a=>typeof a.aborted=="boolean"),{method:"POST",query:t,signal:n})}async uploadAttachment(r,t,n={},a){let o=new FormData,i=typeof File<"u"&&t instanceof File?t.name:"attachment";return o.append("file",t,i),this.request(`threads/${encodeURIComponent(r)}/attachments`,nt,{method:"POST",query:n,body:o,signal:a})}async request(r,t,n={}){let a;try{a=await this.fetchRequest(r,n)}catch(d){throw Ee(d)||d instanceof g?d:new g("INTERNAL_ERROR",this.translate?.("integration.error.requestFailed")??"Request failed",!0)}let o;try{o=await a.json()}catch{throw this.internalError(a.status)}if(Ce(o))throw new g(o.error.code,o.error.message,o.error.retryable,a.status);if(!a.ok||!f(o)||!h(o,["success","data"])||o.success!==!0)throw this.internalError(a.status);let i=t(o.data);if(i===void 0)throw this.internalError(a.status);return i}async fetchRequest(r,t){let n=await this.options.identityProvider.getIdentity(t.signal),a=new URL(`${this.baseUrl}/${r}`);for(let[d,l]of Object.entries(t.query??{}))l!==void 0&&a.searchParams.set(d,l);let o=new Headers;n.bearerToken!==void 0?o.set("Authorization",`Bearer ${n.bearerToken}`):o.set("X-Axiom-External-User-Id",n.externalUserId??"");let i;return t.body instanceof FormData?i=t.body:t.body!==void 0&&(o.set("Content-Type","application/json"),i=JSON.stringify(t.body)),this.fetchImplementation(a,{method:t.method??"GET",headers:o,body:i,signal:t.signal,credentials:"omit"})}async throwResponseError(r){let t;try{t=await r.json()}catch{throw this.internalError(r.status)}throw Ce(t)?new g(t.error.code,t.error.message,t.error.retryable,r.status):this.internalError(r.status)}internalError(r){return new g("INTERNAL_ERROR",this.translate?.("integration.error.invalidServerResponse")??"Invalid server response",!1,r)}};function Ee(e){return typeof e=="object"&&e!==null&&"name"in e&&e.name==="AbortError"}var $=R(ee());var P=R(M());function Re(){let e=L(),{createThread:r}=q(),{menuCollapsed:t,setMenuCollapsed:n}=Ae();(0,$.useEffect)(()=>{t===void 0&&n(!0)},[t,n]);let a=(0,$.useCallback)(async()=>{try{await r(e("integration.sidebar.newThread"))}catch(p){console.error("Failed to create new thread:",p)}},[r,e]),o=t??!0,i={id:"new-analysis",builtin:"new-analysis",type:"action",name:e("integration.sidebar.newThread"),icon:(0,P.jsx)(me,{size:20}),order:0},d={id:"thread-history-toggle",type:"action",name:e("integration.sidebar.history"),icon:(0,P.jsx)(G,{size:20}),order:1},l={id:"thread-history",builtin:"thread-history",type:"drawer",name:e("integration.sidebar.history"),icon:(0,P.jsx)(G,{size:20}),order:1,title:e("integration.sidebar.historyTitle"),width:320,inline:!0,inlineDefaultExpanded:!0,content:(0,P.jsx)(he,{})},C=[i,...o?[d]:[l]];return(0,P.jsx)(ge,{items:C,showBranding:!1,showToggle:!0,showNewAnalysis:!1,defaultExpanded:!o,collapsed:o,onCollapsedChange:n,onNewAnalysis:a,onItemClick:p=>{p.type==="action"&&p.builtin==="new-analysis"?a():p.type==="action"&&p.id==="thread-history-toggle"&&n(!1)}},o?"agent-chat-sidebar-collapsed":"agent-chat-sidebar-expanded")}function Se(e){if(typeof window>"u"||typeof XMLHttpRequest>"u")return()=>{};let r=`${e.gatewayUrl.replace(/\/+$/,"")}/api/web-apps/${encodeURIComponent(e.webAppId)}/runtime/`,t=XMLHttpRequest.prototype.open,n=XMLHttpRequest.prototype.send,a=new WeakMap;return XMLHttpRequest.prototype.open=function(i,d){a.set(this,String(d)),t.call(this,i,d,!0)},XMLHttpRequest.prototype.send=function(i){let d=a.get(this)??"";if(!d.startsWith(r)||!/\/sandbox\/uploadfile$/.test(d)){n.call(this,i);return}if(e.identity.mode==="unverified"){this.setRequestHeader("X-Axiom-External-User-Id",e.identity.userId),n.call(this,i);return}e.identity.tokenProvider().then(l=>{this.setRequestHeader("Authorization",`Bearer ${l}`),n.call(this,i)}).catch(()=>{n.call(this,i)})},()=>{XMLHttpRequest.prototype.open=t,XMLHttpRequest.prototype.send=n}}var ot=/^#[0-9A-Fa-f]{6}$/;function at(e){return typeof e=="string"&&ot.test(e)}function Te(e){return at(e)?e:void 0}function N(e,r){let t=parseInt(e.replace("#",""),16),n=Math.round(2.55*r),a=(t>>16)+n,o=(t>>8&255)+n,i=(t&255)+n;return"#"+(16777216+(a<255?a<1?0:a:255)*65536+(o<255?o<1?0:o:255)*256+(i<255?i<1?0:i:255)).toString(16).slice(1)}function ke(e){if(e!==void 0)return{token:{colorPrimary:e,colorPrimaryHover:N(e,20),colorPrimaryActive:N(e,-15),colorPrimaryBg:N(e,45)+"20"}}}var De=R(Fe()),Ue=R(qe()),c=R(M()),Ct={"en-US":De.default,"zh-CN":Ue.default};function wt(e,r){let t=J(e.welcome),n=J(r.title),a=t??J(r.welcomeMessage),o=e.quickPrompts??r.quickPrompts??[],i=Te(r.primaryColor);return{...n!==void 0?{title:n}:{},...a!==void 0?{welcome:a}:{},quickPrompts:o,...i!==void 0?{primaryColor:i}:{}}}function J(e){return typeof e=="string"&&e.length>0?e:void 0}function Et(e){if(!e.gatewayUrl.trim())throw new Error("AgentChatApp requires gatewayUrl");try{new URL(e.gatewayUrl)}catch{throw new Error("AgentChatApp gatewayUrl must be a valid URL")}if(!e.webAppId.trim())throw new Error("AgentChatApp requires webAppId");if(e.identity.mode==="unverified"){if(!e.identity.userId.trim())throw new Error("AgentChatApp requires identity.userId")}else if(typeof e.identity.tokenProvider!="function")throw new Error("AgentChatApp requires identity.tokenProvider");if(!e.fetch&&typeof globalThis.fetch!="function")throw new Error("AgentChatApp requires a fetch implementation")}function Rt(e,r){return e instanceof g?e:new g("INTERNAL_ERROR",r("integration.error.requestFailed"),!0)}function St(e){return e.mode==="unverified"?`unverified:${e.userId}`:"verified:token"}function Tr(e){Et(e);let r=`${e.gatewayUrl}\0${e.webAppId}\0${St(e.identity)}`,t=e.storageKey??ie,n=(0,u.useMemo)(()=>e.locale??se(t)??"en-US",[e.locale,t]);return(0,c.jsx)(de,{locale:n,storageKey:t,onLocaleChange:e.onLocaleChange,children:(0,c.jsx)(Tt,{...e,locale:n},r)})}function Tt({gatewayUrl:e,webAppId:r,identity:t,onError:n,onChatReady:a,onChatMessage:o,fetch:i,className:d,welcome:l,quickPrompts:C,locale:p="en-US"}){let A=L(),[m,E]=(0,u.useState)({status:"loading"}),x=(0,u.useRef)(t);x.current=t;let _=(0,u.useRef)(n);_.current=n;let W=(0,u.useRef)();return W.current||(W.current=new U({gatewayUrl:e,webAppId:r,identityProvider:{getIdentity:async()=>{let b=x.current;if(b.mode!=="verified")return{externalUserId:b.userId};try{return{bearerToken:await b.tokenProvider()}}catch{throw new g("USER_ID_REQUIRED",A("integration.error.identityTokenFailed"),!0)}}},translate:A,...i?{fetch:i}:{}})),(0,u.useEffect)(()=>Se({gatewayUrl:e,webAppId:r,identity:t}),[e,r,t]),(0,u.useEffect)(()=>{let b=!1,$e=W.current;return(async()=>{try{let K=await $e.bootstrap({});if(b)return;E({status:"ready",bootstrap:K})}catch(K){if(b)return;let Z=Rt(K,A);E({status:"error",error:Z}),_.current?.(Z)}})(),()=>{b=!0}},[]),m.status==="loading"?(0,c.jsx)("div",{className:d}):m.status==="error"?(0,c.jsxs)("div",{className:d,role:"alert",children:[(0,c.jsx)("strong",{children:A("integration.chat.loadFailed")}),(0,c.jsx)("div",{children:m.error.code}),(0,c.jsx)("button",{type:"button",onClick:()=>E({status:"loading"}),children:A("common.retry")})]}):(0,c.jsx)(It,{className:d,gatewayUrl:e,webAppId:r,identity:t,bootstrap:m.bootstrap,onChatReady:a,onChatMessage:o,welcome:l,quickPrompts:C,locale:p})}function kt(e){return{id:e.id,name:e.name,...e.description!==void 0?{description:e.description}:{},graphDefinition:void 0,createdAt:new Date(0),updatedAt:new Date(0)}}function It({gatewayUrl:e,webAppId:r,identity:t,bootstrap:n,onChatReady:a,onChatMessage:o,className:i,welcome:d,quickPrompts:l,locale:C="en-US"}){let p=(0,u.useMemo)(()=>kt(n.webApp.assistant),[n.webApp.assistant]),A=(0,u.useMemo)(()=>wt({welcome:d,quickPrompts:l},n.webApp.appearance),[d,l,n.webApp.appearance]),m=(0,u.useMemo)(()=>ke(A.primaryColor),[A.primaryColor]),E=(0,u.useMemo)(()=>t.mode==="unverified"?{mode:"unverified",userId:t.userId}:{mode:"verified",tokenProvider:t.tokenProvider},[t]),x=(0,u.useCallback)(b=>new ae({gatewayUrl:e,webAppId:r,identity:E,assistantId:b.assistantId,transport:b.transport,...b.timeout!==void 0?{timeout:b.timeout}:{},...b.headers!==void 0?{headers:b.headers}:{}}),[e,r,E]),_=(0,u.useMemo)(()=>({baseURL:`${e.replace(/\/$/,"")}/api/web-apps/${r}/runtime`,apiKey:"",transport:"sse",assistantId:p.id,enableSkillSlot:!1,enableDatabaseSlot:!1,enableAgentSlot:!1,enableMetricsDataSourceSlot:!1,enableModelSelector:!1,enableWorkspace:!1,enableCustomMenu:!1,showSideMenu:!1,enableAssistantCreation:!1,enableAssistantEditing:!1,enableThreadCreation:!0,enableThreadList:!0}),[p.id,e,r]),W=(0,u.useMemo)(()=>({assistants:[p],currentAssistant:p,isLoading:!1,error:null,listAssistants:async()=>{},getAssistant:async()=>p,createAssistant:async()=>{throw new Error("Not implemented in a Web App")},updateAssistant:async()=>{throw new Error("Not implemented in a Web App")},deleteAssistant:async()=>{},selectAssistant:async()=>{},clearCurrentAssistant:()=>{},refresh:async()=>{}}),[p]);return(0,c.jsx)(te,{theme:m,locale:Ct[C],children:(0,c.jsx)(le,{config:{baseURL:_.baseURL,apiKey:"",assistantId:"__BASE__",transport:"sse"},createClient:x,children:(0,c.jsx)(ue,{initialConfig:_,persistToLocalStorage:!1,children:(0,c.jsx)(pe.Provider,{value:W,children:(0,c.jsx)(fe,{children:(0,c.jsx)(Pt,{className:i,onChatReady:a,onChatMessage:o,title:A.title,welcome:A.welcome,quickPrompts:A.quickPrompts})})})})})})}function Pt({className:e,onChatReady:r,onChatMessage:t,title:n,welcome:a,quickPrompts:o=[]}){let i=L(),{threadId:d}=q(),{currentAssistant:l}=ce();if(!l)return null;let C=d??"";if(!C)return(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,c.jsx)(re,{tip:i("integration.chat.creatingConversation")})});let p=n??a,A=n!==void 0&&a!==void 0?a:"";return(0,c.jsx)("div",{className:e,children:(0,c.jsx)(be,{thread_id:C,assistant_id:l.id,name:l.name,description:l.description,menu:(0,c.jsx)(Re,{}),showProjectSelector:!1,showSkillSlot:!1,showDatabaseSlot:!1,showAgentSlot:!1,showMetricsDataSourceSlot:!1,headerRight:null,emptyStateGreeting:p?(0,c.jsx)("span",{children:p}):void 0,emptyStateQuestion:A,senderPromptsItems:o.length>0?o.map((m,E)=>({key:`quick-${E}`,label:m.label,description:m.text})):void 0,showSkillPrompts:!1,showQuickAnalysis:!1,onChatReady:r,onChatMessage:t})})}export{ot as a,Tr as b};
|
|
@@ -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=
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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%;
|
package/dist/embed-page.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as h}from"./embed-page-chunk-
|
|
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.js
CHANGED
|
@@ -112775,7 +112775,7 @@ var init_TaskCommentComposer = __esm({
|
|
|
112775
112775
|
init_LatticeChatShellContext();
|
|
112776
112776
|
init_attachmentsMessage();
|
|
112777
112777
|
init_i18n();
|
|
112778
|
-
MAX_UPLOAD_MB =
|
|
112778
|
+
MAX_UPLOAD_MB = 100;
|
|
112779
112779
|
useStyles32 = _antdstyle.createStyles.call(void 0, ({ token, css }) => ({
|
|
112780
112780
|
root: css`
|
|
112781
112781
|
margin-top: 12px;
|
|
@@ -118857,7 +118857,7 @@ var init_ProjectRoomComposer = __esm({
|
|
|
118857
118857
|
init_attachmentsMessage();
|
|
118858
118858
|
init_projectRoomMentions();
|
|
118859
118859
|
init_i18n();
|
|
118860
|
-
MAX_UPLOAD_MB2 =
|
|
118860
|
+
MAX_UPLOAD_MB2 = 100;
|
|
118861
118861
|
useStyles48 = _antdstyle.createStyles.call(void 0, ({ token, css }) => ({
|
|
118862
118862
|
root: css`
|
|
118863
118863
|
flex-shrink: 0;
|