@lacneu/atrium 0.102.0 → 0.103.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AccessTab-gaTBs3lV.js +1 -0
- package/dist/assets/{AdminSettings-B8n1yLsD.js → AdminSettings-CMjix9zl.js} +1 -1
- package/dist/assets/{AdvancedFilter-Bb66m5kb.js → AdvancedFilter-5BMuHHt6.js} +1 -1
- package/dist/assets/AgentFilesTab-D3tMMo2R.js +3 -0
- package/dist/assets/AnomaliesTab-CdFgsRwT.js +1 -0
- package/dist/assets/AuditTab-Yw1LvjgD.js +1 -0
- package/dist/assets/BridgeTab-CBE4zTQ1.js +1 -0
- package/dist/assets/ChatDefaultsTab-CIX9WUCl.js +1 -0
- package/dist/assets/{ConfirmDialog-BXcki0Ee.js → ConfirmDialog-Dy8WCeAF.js} +1 -1
- package/dist/assets/{DataTableShell-DRFFBx_j.js → DataTableShell-2_QPZexc.js} +1 -1
- package/dist/assets/DeletedChatsTab-Fzk38aqT.js +1 -0
- package/dist/assets/{DetailChips-Cv1sxdhU.js → DetailChips-DaliQU_Q.js} +1 -1
- package/dist/assets/{EntitySheet-B2B48bss.js → EntitySheet-D-JZB54h.js} +1 -1
- package/dist/assets/FeedbacksTab-DWmslsAt.js +1 -0
- package/dist/assets/{FieldLabel-Tea3wyVe.js → FieldLabel-D63ry-fi.js} +1 -1
- package/dist/assets/FilesTab-DzHfzOnQ.js +1 -0
- package/dist/assets/{FilterBar-DTVwlDpF.js → FilterBar-Bynn2H7k.js} +1 -1
- package/dist/assets/GroupsTab-hxsjfQDc.js +1 -0
- package/dist/assets/InstancesTab-DsJ_BBfc.js +1 -0
- package/dist/assets/IntegrationsTab-Cf3lTCzz.js +1 -0
- package/dist/assets/KnobRow-3my9jz_H.js +1 -0
- package/dist/assets/KpiTab-C6dn6jVl.js +1 -0
- package/dist/assets/PreferencesTab-DiDi7mpY.js +1 -0
- package/dist/assets/ProjectPage-DDto6xkD.js +1 -0
- package/dist/assets/PromptInjectionsTab-D3drsS9C.js +4 -0
- package/dist/assets/RolesTab-DDYieLTF.js +1 -0
- package/dist/assets/ScheduledTab-D-yTTYHC.js +1 -0
- package/dist/assets/ServiceAccountsTab-fJYmH0eU.js +1 -0
- package/dist/assets/SubAgentReportsTab-GXHpWbrW.js +1 -0
- package/dist/assets/ThemeShowroom-uU3PL_6V.js +1 -0
- package/dist/assets/{TimeRangePicker-D3PJq1H8.js → TimeRangePicker-DzJYDik_.js} +1 -1
- package/dist/assets/{TimezoneCombobox-CPTpWNQm.js → TimezoneCombobox-BY91kPSf.js} +1 -1
- package/dist/assets/TracesTab-C7zX1NUU.js +1 -0
- package/dist/assets/TrashTab-BVZJggvr.js +1 -0
- package/dist/assets/UsersTab-HdsTBYR0.js +1 -0
- package/dist/assets/VoiceTab-CnZ-twTR.js +1 -0
- package/dist/assets/{alert-dialog-BoEv1f8g.js → alert-dialog-DRrmbZYC.js} +1 -1
- package/dist/assets/{api-DSJJn0d7.js → api-CUskDNHD.js} +5 -5
- package/dist/assets/{badge-C4po8DQ1.js → badge-TiMZiv59.js} +1 -1
- package/dist/assets/{button-Dio0PVrp.js → button-CbHyzXCb.js} +1 -1
- package/dist/assets/capabilities-CASxhKEd.js +1 -0
- package/dist/assets/{card-CerX9wDn.js → card-vUc-7TYj.js} +1 -1
- package/dist/assets/check-Da8rPJKX.js +1 -0
- package/dist/assets/{checkbox-CsI4ggnp.js → checkbox-Czxm5pNj.js} +1 -1
- package/dist/assets/chevron-left-DxPC6E1S.js +1 -0
- package/dist/assets/chevron-right-BjOti-z8.js +1 -0
- package/dist/assets/chevron-up-DfOJb3vW.js +1 -0
- package/dist/assets/chevrons-up-down-Bp7zuoEk.js +1 -0
- package/dist/assets/{compatView--1YlftIc.js → compatView-Dj1HQXxr.js} +1 -1
- package/dist/assets/confTabs-BzReq467.css +1 -0
- package/dist/assets/convexApi-BPSJUy2j.js +1 -0
- package/dist/assets/{copy-BaUCUMp2.js → copy-C1_4Ewod.js} +1 -1
- package/dist/assets/{cronDescribe-CAuRX7uW.js → cronDescribe-BC0AcJer.js} +1 -1
- package/dist/assets/{deliveryRecorder-C7NQZrrH.js → deliveryRecorder-CGhwQ1sg.js} +1 -1
- package/dist/assets/{dialog-BfrsWZiD.js → dialog-DpoEg_Ex.js} +1 -1
- package/dist/assets/dispatchErrorInfo-BOJ5cTZo.js +1 -0
- package/dist/assets/{dist-ClkJChBn.js → dist-BmXC8pZv.js} +1 -1
- package/dist/assets/{dist-D7doQlva.js → dist-BqsRl4o3.js} +1 -1
- package/dist/assets/{dist-D-RIDSJc.js → dist-CHsekWGV.js} +1 -1
- package/dist/assets/{dist-Cw3aN_jM.js → dist-Cv-LvOB4.js} +1 -1
- package/dist/assets/{dist-CkbybbG7.js → dist-DQawXTf-.js} +1 -1
- package/dist/assets/{dist-ChrIV8UV.js → dist-HZSdA3kh.js} +1 -1
- package/dist/assets/{download-DWgC7zCa.js → download-Do4pcXOL.js} +1 -1
- package/dist/assets/{dropdown-menu-DHMOOlaP.js → dropdown-menu-BWxfj48Z.js} +1 -1
- package/dist/assets/{eye-B-ipuYEd.js → eye-yUMVb9gl.js} +1 -1
- package/dist/assets/{format-DGKgJf2p.js → format-zM-c-1S6.js} +1 -1
- package/dist/assets/{groupManageView-BMBqgRhV.js → groupManageView-DY6vPM1h.js} +1 -1
- package/dist/assets/index-B7hQ_j0i.js +158 -0
- package/dist/assets/index-D8Eob_Mc.css +1 -0
- package/dist/assets/{input-BSpTsBA6.js → input-DCbMcJYs.js} +1 -1
- package/dist/assets/{list-eSch39T9.js → list-DIWFv1eJ.js} +1 -1
- package/dist/assets/loader-circle-BO0Lx5va.js +1 -0
- package/dist/assets/{lock-0lxfSnTE.js → lock-X9ZGk2P9.js} +1 -1
- package/dist/assets/{pencil-aUWxuLhy.js → pencil-1kZxxbnV.js} +1 -1
- package/dist/assets/plus-CSOLqt7C.js +1 -0
- package/dist/assets/{popover-DBaIbsBr.js → popover-DiT_Oo6e.js} +1 -1
- package/dist/assets/roleDescriptions-CmJBKAaf.js +1 -0
- package/dist/assets/rotate-ccw-C-v_7YX7.js +1 -0
- package/dist/assets/{search-BK6bzZNi.js → search-D9Un2NMX.js} +1 -1
- package/dist/assets/searchSchemas-Dm-Qg010.js +55 -0
- package/dist/assets/{select-qM3ZfTHx.js → select-DCBGpD8v.js} +1 -1
- package/dist/assets/{server-DLnWqkX-.js → server-BSDuYUUF.js} +1 -1
- package/dist/assets/{speech-CrNma2Ue.js → speech-CfxX6OY3.js} +1 -1
- package/dist/assets/{star-CM6J2w_J.js → star-DjK6DoNA.js} +1 -1
- package/dist/assets/switch-Dt_I92ZY.js +1 -0
- package/dist/assets/{table-D2SJC960.js → table-GXZ7yFCE.js} +1 -1
- package/dist/assets/{tabs-mZfLmn2f.js → tabs-dQ50HGoj.js} +1 -1
- package/dist/assets/{toast-xNFwDnUy.js → toast-C8rSAMgh.js} +1 -1
- package/dist/assets/{tooltip-v_AyOWn6.js → tooltip-D3qNpGhD.js} +1 -1
- package/dist/assets/{trash-2-B4WSfc7G.js → trash-2-8oRd823U.js} +1 -1
- package/dist/assets/trashPage-CoBMe_r-.js +1 -0
- package/dist/assets/{trashView-Ct0Xw-a9.js → trashView-CIgTWQjI.js} +1 -1
- package/dist/assets/{triangle-alert-BkDa-x8g.js → triangle-alert-DQoWKyu_.js} +1 -1
- package/dist/assets/{usageView-C9Y6E0Zu.js → usageView-B0Wg081i.js} +1 -1
- package/dist/assets/{useChart-CKFEN42T.js → useChart-xKc_wRHf.js} +1 -1
- package/dist/assets/{useFontScale-ByBFat3y.js → useFontScale-C03nea0B.js} +1 -1
- package/dist/assets/{useStartNewChat-BszDHUjD.js → useStartNewChat-B66bn5hT.js} +2 -2
- package/dist/assets/{use_paginated_query-CQj09xXv.js → use_paginated_query-BatXdmTn.js} +1 -1
- package/dist/assets/{users-BJqaWlH1.js → users-DHMAZ7v8.js} +1 -1
- package/dist/assets/x-6-84PEVq.js +1 -0
- package/dist/index.html +57 -57
- package/package.json +2 -2
- package/dist/assets/AccessTab-JmFp20Kp.js +0 -1
- package/dist/assets/AgentFilesTab-C3CUT4Ep.js +0 -3
- package/dist/assets/AnomaliesTab-BQ2Bu98W.js +0 -1
- package/dist/assets/AuditTab-BV-XydO_.js +0 -1
- package/dist/assets/BridgeTab-D4RFq-Rb.js +0 -1
- package/dist/assets/ChatDefaultsTab-D0d9yEow.js +0 -1
- package/dist/assets/DeletedChatsTab-COYSFkNf.js +0 -1
- package/dist/assets/FeedbacksTab-6URuFdfg.js +0 -1
- package/dist/assets/FilesTab-esMtHJXt.js +0 -1
- package/dist/assets/GroupsTab-Io16XZHz.js +0 -1
- package/dist/assets/InstancesTab-BevtM68H.js +0 -1
- package/dist/assets/IntegrationsTab-DMY6VTUC.js +0 -1
- package/dist/assets/KnobRow-BsOT2O6U.js +0 -1
- package/dist/assets/KpiTab-KPPcgUxA.js +0 -1
- package/dist/assets/PreferencesTab-DJ9p401L.js +0 -1
- package/dist/assets/ProjectPage-BxEF71jN.js +0 -1
- package/dist/assets/PromptInjectionsTab-Vdb1lF36.js +0 -4
- package/dist/assets/RolesTab-DU0g4d-R.js +0 -1
- package/dist/assets/ScheduledTab-B6gWc0HN.js +0 -1
- package/dist/assets/ServiceAccountsTab-Dmb_LH0V.js +0 -1
- package/dist/assets/SubAgentReportsTab-D9rclslo.js +0 -1
- package/dist/assets/ThemeShowroom-N4qzUtlq.js +0 -1
- package/dist/assets/TracesTab-DiAkOmei.js +0 -1
- package/dist/assets/TrashTab-BMSJ7ANC.js +0 -1
- package/dist/assets/UsersTab-BQaLsUCK.js +0 -1
- package/dist/assets/VoiceTab-BSh-05Ze.js +0 -1
- package/dist/assets/capabilities-BTqhMVxR.js +0 -1
- package/dist/assets/check-DmQzfrws.js +0 -1
- package/dist/assets/chevron-left-DQ9FCoo_.js +0 -1
- package/dist/assets/chevron-right-C_b_y922.js +0 -1
- package/dist/assets/chevron-up-Dsqj2Oaj.js +0 -1
- package/dist/assets/chevrons-up-down-Pva00Np5.js +0 -1
- package/dist/assets/confTabs-CCBW5ofF.css +0 -1
- package/dist/assets/convexApi-CyScjgcq.js +0 -1
- package/dist/assets/dispatchErrorInfo-Bb7JyJFO.js +0 -1
- package/dist/assets/index-D6RuTaB7.css +0 -1
- package/dist/assets/index-DQC7YnEQ.js +0 -158
- package/dist/assets/loader-circle-BNhIFGdg.js +0 -1
- package/dist/assets/plus-Djbdyc2E.js +0 -1
- package/dist/assets/roleDescriptions-x3mUxTcX.js +0 -1
- package/dist/assets/rotate-ccw-BD-9XzMC.js +0 -1
- package/dist/assets/searchSchemas-CS2ZgsHC.js +0 -64
- package/dist/assets/trashPage-WtAhGCt7.js +0 -1
- package/dist/assets/x-CK8d5DC1.js +0 -1
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,Af as i,BX as a,Bf as o,Df as s,Ef as c,Ff as l,G_ as u,Gf as d,HX as f,H_ as p,Hf as m,If as h,J_ as g,K_ as _,Lf as v,Mf as y,Nf as b,Of as x,Pf as S,Q_ as C,Rf as w,Tf as T,U_ as E,Uf as D,Vf as O,W_ as k,Wf as A,XX as j,X_ as M,YX as N,Y_ as P,ZV as F,Z_ as I,_v as L,af as R,av as ee,cf as z,cv as te,dv as B,ev as V,fv as H,gv as ne,hv as re,if as U,iv as ie,jf as ae,kf as oe,ks as se,lf as ce,lv as le,mv as ue,nv as de,of as fe,ov as pe,pv as me,qX as W,q_ as he,rf as ge,rv as _e,ry as G,sf as ve,sv as ye,t as K,tv as be,ty as xe,uv as Se,zf as Ce}from"./api-DSJJn0d7.js";import{t as q}from"./triangle-alert-BkDa-x8g.js";import{a as we,i as Te,n as Ee,r as De,t as Oe}from"./select-qM3ZfTHx.js";import{a as ke,c as Ae,i as je,n as Me,o as Ne,r as Pe,s as Fe,t as Ie}from"./alert-dialog-BoEv1f8g.js";import{t as J}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{r as Y}from"./toast-xNFwDnUy.js";import{t as Le}from"./badge-C4po8DQ1.js";import{a as Re,n as ze,o as Be,r as Ve,t as He}from"./dialog-BfrsWZiD.js";import{t as Ue}from"./appHost-CH3EGcJw.js";import{n as We}from"./capabilities-BTqhMVxR.js";import{n as Ge,t as Ke}from"./curation-CQksaIbm.js";import{a as qe}from"./compatView--1YlftIc.js";/* empty css */var X=t(e(),1),Je=2e4,Ye=6e4;function Xe(e){return typeof e!=`number`||e<=0?0:Math.round(e/Je*100)}function Ze(e){return e<=0?0:Math.round(e/Ye*100)}function Z(e,t){let n=(typeof e==`number`&&e>0?e:0)/1e3;return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(n)}function Qe(e){return e.reduce((e,t)=>e+(typeof t.size==`number`&&t.size>0?t.size:0),0)}var $e=3;function et(e,t){let n=new Map;for(let t of e.split(`
|
|
2
|
-
`))n.set(t,(n.get(t)??0)+1);for(let e of t.split(`
|
|
3
|
-
`))n.set(e,(n.get(e)??0)-1);let r=0,i=0,a=[],o=[];for(let[e,t]of n)t<0?(r+=-t,a.length<$e&&a.push(e)):t>0&&(i+=t,o.length<$e&&o.push(e));return{added:r,removed:i,sampleAdded:a,sampleRemoved:o}}function tt(e){return(e instanceof Error?e.message:String(e)).includes(`DASHBOARD_NOT_DEPLOYED`)}function nt(e){return e instanceof Error?e.message.includes(`conflict:`):String(e).includes(`conflict:`)}var Q=n(),$=e=>`${e.instanceName}::${e.agentId}`;function rt(){let e=j(K.me.getMe,{host:Ue}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),r=j(K.admin.listInstances,e!==void 0&&t?{}:`skip`),[i,s]=(0,X.useState)(null);(0,X.useEffect)(()=>{!t||!r||r.length===0||(!i||!r.some(e=>e.name===i))&&s(r[0].name)},[t,r,i]);let c=j(K.agents.listAgentsForInstance,t&&i?{instanceName:i}:`skip`),l=j(K.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),u=(0,X.useMemo)(()=>{if(e!==void 0){if(t)return i===null||c===void 0?r!==void 0&&r.length===0?[]:void 0:c.agents.map(e=>({instanceName:i,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(l!==void 0)return l.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,i,c,r,l]),[d,p]=(0,X.useState)(null);(0,X.useEffect)(()=>{!u||u.length===0||(!d||!u.some(e=>$(e)===d))&&p($(u[0]))},[u,d]);let h=u?.find(e=>$(e)===d)??null,g=W(K.agentFiles.listAgentFiles),[_,v]=(0,X.useState)({status:`idle`}),y=h?.instanceName??null,b=h?.agentId??null,x=j(K.compat.forInstance,n&&y!==null?{instanceName:y}:`skip`),S=n&&y!==null?We(x,`agentFiles`):null,C=S===null?!1:S===`loading`?null:S.blocked,w=(0,X.useCallback)(async()=>{if(!(y===null||b===null)){v({status:`loading`});try{let e=await g({instanceName:y,agentId:b});v({status:`done`,files:e.files})}catch(e){v({status:`error`,dashboardAbsent:tt(e)})}}},[g,y,b]);(0,X.useEffect)(()=>{C===!1&&w()},[w,C]);let[T,E]=(0,X.useState)(null),D=j(K.agentFileCuration.listCurations,t&&y!==null&&b!==null?{instanceName:y,agentId:b}:`skip`),k=j(K.agentFileCuration.curationSettings,t&&y!==null?{instanceName:y}:`skip`),A=W(K.agentFileCuration.requestCuration),[M,N]=(0,X.useState)(null),[P,F]=(0,X.useState)(null),{toast:I}=Y(),R=(0,X.useMemo)(()=>{let e=new Map;for(let t of D??[])e.has(t.name)||e.set(t.name,t);return e},[D]),z=(0,X.useCallback)(async e=>{if(!(y===null||b===null)){N(e);try{let t=await A({instanceName:y,agentId:b,name:e,trigger:`manual`});t.ok?I({title:m(),variant:`success`}):I({title:O({reason:t.reason??`unknown`}),variant:`error`})}catch{I({title:o(),variant:`error`})}finally{N(null)}}},[A,y,b,I]),V=f(),U=(0,X.useMemo)(()=>new Intl.NumberFormat(V,{maximumFractionDigits:0}),[V]);return e===void 0||u===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:L()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(r?.length??0)>1?(0,Q.jsxs)(Oe,{value:i??``,onValueChange:e=>s(e),children:[(0,Q.jsx)(Te,{size:`sm`,"aria-label":ne(),children:(0,Q.jsx)(we,{})}),(0,Q.jsx)(Ee,{children:(r??[]).map(e=>(0,Q.jsx)(De,{value:e.name,children:e.name},e.name))})]}):null,u.length>0?(0,Q.jsxs)(Oe,{value:d??``,onValueChange:e=>p(e),children:[(0,Q.jsx)(Te,{size:`sm`,"aria-label":re(),children:(0,Q.jsx)(we,{})}),(0,Q.jsx)(Ee,{children:u.map(e=>(0,Q.jsx)(De,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ue()})]}),h===null?null:S===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):S!==null&&S.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(q,{size:14,"aria-hidden":!0}),` `,qe(S.gatewayVersion,S.provider)]}):_.status===`loading`||_.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):_.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[_.dashboardAbsent?se():H(),` `,!_.dashboardAbsent&&(0,Q.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>void w(),children:xe()})]}):_.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:me()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:_.files.map(e=>{let n=Xe(e.size),r=n>=80;return(0,Q.jsxs)(`div`,{className:`oc-afiles__row`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__name`,title:e.name,children:e.name}),e.missing?(0,Q.jsx)(Le,{variant:`outline`,children:B()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:Se({size:Z(e.size,V)})}),(0,Q.jsx)(`span`,{className:`oc-afiles__gauge${r?` is-warn`:``}`,"aria-hidden":!0,children:(0,Q.jsx)(`span`,{className:`oc-afiles__gauge-fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,Q.jsx)(`span`,{className:`oc-afiles__pct`,children:le({pct:U.format(n)})}),r?(0,Q.jsx)(q,{size:14,className:`oc-afiles__warn`,"aria-label":te()}):(0,Q.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,Q.jsx)(J,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>E(e),children:t?pe():ee()}),t&&!e.missing?(0,Q.jsx)(it,{curatable:Ke.includes(e.name),size:e.size??0,budget:k?.budgetChars??null,enabled:k?.enabled??!1,curation:R.get(e.name)??null,inFlight:M===e.name,onCurate:()=>void z(e.name),onReview:e=>F(e)}):null]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:ye({used:Z(Qe(_.files),V),total:Z(Ye,V),pct:U.format(Ze(Qe(_.files)))})})]}),T&&h?(0,Q.jsx)(at,{instanceName:h.instanceName,agentId:h.agentId,name:T.name,isAdmin:t,onClose:()=>E(null),onSaved:()=>void w()}):null,P?(0,Q.jsx)(ot,{curationId:P,onClose:()=>F(null),onApplied:()=>{F(null),w()}}):null]})}function it({curatable:e,size:t,budget:n,enabled:r,curation:i,inFlight:a,onCurate:o,onReview:s}){return i?.status===`proposed`?(0,Q.jsx)(J,{variant:`default`,size:`sm`,className:`oc-afiles__curate`,onClick:()=>s(i._id),children:A()}):a||i?.status===`dispatched`||i?.status===`applying`?(0,Q.jsx)(Le,{variant:`outline`,className:`oc-afiles__curate-status`,children:D()}):e&&r&&n!==null&&Ge(t,n)?(0,Q.jsx)(J,{variant:`outline`,size:`sm`,className:`oc-afiles__curate`,onClick:o,children:d()}):null}function at({instanceName:e,agentId:t,name:n,isAdmin:i,onClose:o,onSaved:s}){let c=W(K.agentFiles.getAgentFile),l=W(K.agentFiles.setAgentFile),d=Y(),[m,h]=(0,X.useState)(null),[v,y]=(0,X.useState)(!1),[b,x]=(0,X.useState)(``),[S,w]=(0,X.useState)(!1),[T,D]=(0,X.useState)(!1),[O,A]=(0,X.useState)(!1),[j,N]=(0,X.useState)(!1),L=(0,X.useCallback)(async r=>{y(!1);try{let i=await c({instanceName:e,agentId:t,name:n});h({content:i.content,updatedAtMs:i.updatedAtMs}),r||x(i.content),A(!1)}catch{y(!0)}},[c,e,t,n]);(0,X.useEffect)(()=>{L(!1)},[L]);async function R(){if(m!==null){D(!0),N(!1);try{await l({instanceName:e,agentId:t,name:n,content:b,baseUpdatedAtMs:m.updatedAtMs??void 0}),d.success(C({name:n})),s(),await L(!1)}catch(e){nt(e)?A(!0):N(!0)}finally{D(!1)}}}let ee=m!==null&&b!==m.content,z=(0,X.useMemo)(()=>m===null?null:et(m.content,b),[m,b]),te=b.length>Je,B=f(),H=(0,X.useMemo)(()=>new Intl.NumberFormat(B),[B]);return(0,Q.jsx)(He,{open:!0,onOpenChange:e=>!e&&o(),children:(0,Q.jsxs)(ze,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(Be,{children:ie({name:n})}),(0,Q.jsxs)(Ve,{children:[_e({agent:t,instance:e}),i?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,de()]})]})]}),v?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[M(),` `,(0,Q.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>void L(!1),children:xe()})]}):m===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:b,readOnly:!i,spellCheck:!1,onChange:e=>x(e.target.value),"aria-label":ie({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:be()}),O?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[P(),` `,(0,Q.jsx)(J,{variant:`outline`,size:`sm`,onClick:()=>void L(!0),children:g()})]}):null,j?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:I()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${te?` is-over`:``}`,children:V({count:H.format(b.length),max:H.format(Je)})}),i?(0,Q.jsx)(J,{size:`sm`,disabled:!ee||T||O,onClick:()=>w(!0),children:T?G():r()}):null]})]}),(0,Q.jsx)(Ie,{open:S,onOpenChange:w,children:(0,Q.jsxs)(je,{children:[(0,Q.jsxs)(Fe,{children:[(0,Q.jsx)(Ae,{children:he({name:n})}),(0,Q.jsx)(ke,{children:_({agent:t})})]}),z?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:u({added:z.added,removed:z.removed})}),z.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:k()}),z.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,z.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:E()}),z.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(Ne,{children:[(0,Q.jsx)(Pe,{children:F()}),(0,Q.jsx)(Me,{onClick:()=>void R(),children:p()})]})]})})]})})}function ot({curationId:e,onClose:t,onApplied:n}){let r=j(K.agentFileCuration.getProposal,{curationId:e}),u=W(K.agentFileCuration.approveCuration),d=N(K.agentFileCuration.rejectCuration),{toast:p}=Y(),[m,g]=(0,X.useState)(null),[_,C]=(0,X.useState)(!1),[E,D]=(0,X.useState)(``),O=f(),k=(0,X.useMemo)(()=>r?et(r.beforeContent,r.proposedContent):null,[r]);async function A(){g(`approve`);try{let t=await u({curationId:e});t.ok?(p({title:Ce(),variant:`success`}),n()):p({title:t.reason===`conflict`?v():h({reason:t.reason??`unknown`}),variant:`error`})}catch{p({title:o(),variant:`error`})}finally{g(null)}}async function M(n){g(`reject`);try{let r=E.trim();(await d({curationId:e,...r?{comment:r}:{},relaunch:n})).ok?p({title:n?U():w(),variant:`success`}):p({title:b(),variant:`error`}),t()}catch{p({title:o(),variant:`error`})}finally{g(null)}}return(0,Q.jsx)(He,{open:!0,onOpenChange:e=>e?void 0:t(),children:(0,Q.jsxs)(ze,{className:`oc-afiles__review`,children:[(0,Q.jsxs)(Re,{children:[(0,Q.jsx)(Be,{children:r?l({name:r.name}):a()}),(0,Q.jsx)(Ve,{children:S()})]}),r===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`oc-afiles__review-sizes`,children:[y({before:Z(r.beforeSize,O),after:Z(r.proposedSize,O)}),r.overBudget?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsx)(q,{size:13,"aria-hidden":!0}),` `,ae()]}):null]}),k?(0,Q.jsx)(`p`,{className:`oc-afiles__review-diff`,children:i({added:k.added,removed:k.removed})}):null,r.feedback?(0,Q.jsx)(`p`,{className:`oc-afiles__review-feedback`,children:ge({feedback:r.feedback})}):null,k&&k.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__review-removed`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:T()}),(0,Q.jsx)(`ul`,{children:k.sampleRemoved.map((e,t)=>(0,Q.jsx)(`li`,{children:e||`\xA0`},t))})]}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__review-panes oc-afiles__review-panes--2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:c()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.beforeContent})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:oe()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.proposedContent})]})]})]}),_?(0,Q.jsxs)(`div`,{className:`oc-afiles__reject-form`,children:[(0,Q.jsx)(`label`,{className:`oc-afiles__review-label`,htmlFor:`curation-reject-comment`,children:ce()}),(0,Q.jsx)(`textarea`,{id:`curation-reject-comment`,className:`oc-afiles__reject-textarea`,rows:3,placeholder:z(),value:E,onChange:e=>D(e.target.value)}),(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(J,{variant:`ghost`,onClick:()=>C(!1),disabled:m!==null,children:ve()}),(0,Q.jsx)(J,{variant:`outline`,onClick:()=>void M(!1),disabled:m!==null,children:m===`reject`?G():fe()}),(0,Q.jsx)(J,{variant:`default`,onClick:()=>void M(!0),disabled:m!==null,children:m===`reject`?G():R()})]})]}):(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(J,{variant:`outline`,onClick:()=>C(!0),disabled:m!==null||r==null,children:x()}),(0,Q.jsx)(J,{variant:`default`,onClick:()=>void A(),disabled:m!==null||r==null,children:m===`approve`?G():s()})]})]})})}export{rt as AgentFilesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$M as r,BM as i,CN as a,DN as o,EN as s,FM as c,GM as ee,HM as te,IM as l,JM as u,KM as ne,LM as d,NM as f,ON as p,PM as m,QM as h,RM as g,SN as re,TN as ie,UM as ae,VM as oe,WM as se,XM as ce,XX as _,YM as le,YX as ue,ZM as de,_N as fe,aN as v,bN as pe,cN as me,dN as he,eN as y,fN as ge,gN as _e,hN as ve,iN as ye,lN as be,mN as xe,nN as Se,oN as Ce,pN as we,qM as b,rN as x,sN as S,t as C,tN as w,uN as T,vN as E,wN as D,xN as O,yN as k,zM as A}from"./api-DSJJn0d7.js";import{n as Te,t as j}from"./useNavigate-D3GIoxyW.js";import{a as M,i as N,n as P,r as F,t as I}from"./select-qM3ZfTHx.js";import"./convexApi-CyScjgcq.js";import{r as Ee}from"./toast-xNFwDnUy.js";import{t as L}from"./badge-C4po8DQ1.js";import{n as R}from"./format-DGKgJf2p.js";import{a as z,n as B,o as V,t as H}from"./dialog-BfrsWZiD.js";import{c as De,o as Oe}from"./searchSchemas-CS2ZgsHC.js";import{t as ke}from"./appHost-CH3EGcJw.js";import{n as Ae}from"./ConfirmDialog-BXcki0Ee.js";import{n as je}from"./TimeRangePicker-D3PJq1H8.js";import{t as Me}from"./FilterBar-DTVwlDpF.js";import{t as Ne}from"./DataTableShell-DRFFBx_j.js";import{t as U}from"./dispatchErrorInfo-Bb7JyJFO.js";var W=t(e(),1),G=new Set([`openclaw.dispatch_failures`,`assistant.announce_errors`]),K=new Set([`assistant.cause.provider_auth_revoked`,`assistant.cause.provider_permission_denied`,`assistant.cause.provider_auth_failed`]);function q(e){let t=K.has(e.kind);if(!G.has(e.kind)&&!t||!e.evidence)return{};try{let n=JSON.parse(e.evidence);if(t){let e=Array.isArray(n.agents)?n.agents.filter(e=>typeof e==`string`):[],t=Array.isArray(n.providers)?n.providers.filter(e=>typeof e==`string`):[],r=e.length===1?e[0]:void 0;return{dominantCode:n.cause,sampleCorrelationId:n.sampleCorrelationId,context:{...r===void 0?{}:{agentId:r.slice(r.lastIndexOf(`/`)+1)},...t.length===1?{provider:t[0]}:{}}}}return{dominantCode:n.dominantCode,sampleCorrelationId:n.sampleCorrelationId}}catch{return{}}}var J=n(),Y=`__all__`,Pe=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function Fe(e){return e===`open`?p():e===`acknowledged`?o():s()}var Ie=[`info`,`warn`,`critical`],Le=[`detector`,`agent`,`user`],Re={kind:`relative`,from:`now-30d`,to:`now`},ze=200,X=`all`;function Z(){let e=Te({from:`/settings/anomalies`}),t=j({from:`/settings/anomalies`}),n=e.q??``,i=e.status===X?Y:e.status,o=e.severity??Y,s=e.kind??Y,[c,l]=(0,W.useState)(Y),d=Oe(e.from,e.to),{from:f,to:p}=je(d),m=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),g=e=>void t({search:t=>({...t,status:e===Y?X:e})}),A=e=>void t({search:t=>({...t,severity:e===Y?void 0:e})}),z=e=>void t({search:t=>({...t,kind:e===Y?void 0:e})}),B=e=>void t({search:t=>({...t,...De(e)})}),V=Ae(),H=Ee(),U=ue(C.anomalies.resolveAnomaly),G=(_(C.me.getMe,{host:ke})?.permissions??[]).includes(`admin.manage`),K=_(C.anomalies.listAnomalies,{limit:ze,filter:{q:n||void 0,from:f,to:p,anomalyStatus:i===Y?void 0:i,severity:o===Y?void 0:o,source:c===Y?void 0:c,kind:s===Y?void 0:s}}),q=(0,W.useMemo)(()=>{let e=new Set;for(let t of K??[])e.add(t.kind);return[...e].sort()},[K]),Z=n!==``||i!==`open`||o!==Y||c!==Y||s!==Y||d.kind!==`relative`||d.from!==Re.from;function Q(){l(Y),t({search:{status:`open`},replace:!0})}async function We(e){if(await V({title:ie(),description:(0,J.jsxs)(J.Fragment,{children:[D(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,a(),` `,(0,J.jsx)(`strong`,{children:re()}),`.`,` `,O()]}),confirmLabel:pe()}))try{await U({anomalyId:e._id,status:`resolved`}),H.success(k(),e.kind)}catch(e){H.error(E(),e)}}async function Ge(e){try{await U({anomalyId:e._id,status:`acknowledged`}),H.success(fe(),e.kind)}catch(e){H.error(_e(),e)}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[ve(),` `,(0,J.jsx)(`strong`,{children:xe()}),` `,we(),` `,(0,J.jsx)(`strong`,{children:ge()}),` `,he(),` `,(0,J.jsx)(`strong`,{children:T()}),` `,be(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:me()})]}),(0,J.jsxs)(Me,{q:n,onQChange:m,searchPlaceholder:S(),timeRange:d,onTimeRangeChange:B,onReset:Q,canReset:Z,children:[(0,J.jsxs)(I,{value:i,onValueChange:g,children:[(0,J.jsx)(N,{size:`sm`,className:`w-36`,children:(0,J.jsx)(M,{})}),(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{value:Y,children:Ce()}),Pe.map(e=>(0,J.jsx)(F,{value:e.value,children:Fe(e.value)},e.value))]})]}),(0,J.jsxs)(I,{value:o,onValueChange:A,children:[(0,J.jsx)(N,{size:`sm`,className:`w-36`,children:(0,J.jsx)(M,{placeholder:v()})}),(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{value:Y,children:w()}),Ie.map(e=>(0,J.jsx)(F,{value:e,children:e},e))]})]}),(0,J.jsxs)(I,{value:c,onValueChange:l,children:[(0,J.jsx)(N,{size:`sm`,className:`w-32`,children:(0,J.jsx)(M,{placeholder:y()})}),(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{value:Y,children:r()}),Le.map(e=>(0,J.jsx)(F,{value:e,children:e},e))]})]}),(0,J.jsxs)(I,{value:s,onValueChange:z,children:[(0,J.jsx)(N,{size:`sm`,className:`w-36`,children:(0,J.jsx)(M,{placeholder:h()})}),(0,J.jsxs)(P,{children:[(0,J.jsx)(F,{value:Y,children:de()}),q.map(e=>(0,J.jsx)(F,{value:e,children:e},e))]})]})]}),(0,J.jsx)(Ne,{title:ce(),rows:K,emptyHint:i===`open`?le():u(),rowActions:e=>G&&e.status===`open`?[{label:b(),onSelect:()=>void We(e)},{label:ne(),onSelect:()=>void Ge(e)}]:[],columns:[{header:ee(),cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:R(e.at)}),sort:e=>e.at},{header:h(),cell:e=>(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:ye(),cell:e=>e.occurrenceCount!==null&&e.occurrenceCount>1?(0,J.jsx)(`span`,{className:`oc-traces__time`,title:e.firstAt===null?void 0:Se({when:R(e.firstAt)}),children:x({count:String(e.occurrenceCount)})}):(0,J.jsx)(`span`,{className:`oc-traces__time`,children:`—`}),sort:e=>e.occurrenceCount??0},{header:v(),cell:e=>(0,J.jsx)(Ve,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:se(),cell:e=>(0,J.jsx)(He,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:y(),cell:e=>(0,J.jsx)(L,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:ae(),cell:e=>(0,J.jsxs)(`div`,{className:`oc-anomaly__msgcell`,children:[(0,J.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),(0,J.jsx)(Be,{row:e})]}),sort:e=>e.message},{header:te(),cell:e=>(0,J.jsx)($,{row:e}),sort:e=>e.evidence??null},{header:oe(),cell:e=>e.correlationId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:Ue(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function Q(e){if(e.kind!==`subagent.failure`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{failedCount:t.failedCount,totalCount:t.totalCount,errorCategories:t.errorCategories}}catch{return{}}}function $({row:e}){let t=j();if(e.kind===`subagent.failure`){let n=Q(e);return(0,J.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,J.jsx)(`div`,{className:`oc-anomaly__cause-head`,children:[...new Set(n.errorCategories??[])].map(e=>(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e},e))}),e.correlationId?(0,J.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:e.correlationId,limit:100}}),children:[`↗ `,i()]}):null]})}let n=q(e);if(!n.dominantCode){let e=n.sampleCorrelationId;return e?(0,J.jsx)(`div`,{className:`oc-anomaly__cause`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{correlationId:e,limit:100}}),children:[`↗ `,i()]})}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}let r=U(n.dominantCode,n.context),a=n.sampleCorrelationId;return(0,J.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,J.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,J.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,J.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),a?(0,J.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{correlationId:a,limit:100}}),children:[`↗ `,i()]}):null]})}function Be({row:e}){let[t,n]=(0,W.useState)(!1),r=_(C.anomalies.getAnomalyAttachments,t?{anomalyId:e._id}:`skip`);return!e.attachments||e.attachments.length===0?null:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>n(!0),children:[A(),e.attachments.length>1?` (${e.attachments.length})`:``]}),(0,J.jsx)(H,{open:t,onOpenChange:n,children:(0,J.jsxs)(B,{className:`oc-anomaly__attachments-dialog`,children:[(0,J.jsx)(z,{children:(0,J.jsx)(V,{children:g()})}),r===void 0?(0,J.jsx)(`p`,{className:`oc-traces__muted`,children:d()}):r.length===0?(0,J.jsx)(`p`,{className:`oc-traces__muted`,children:l()}):(0,J.jsx)(`div`,{className:`oc-anomaly__attachments`,children:r.map(e=>(0,J.jsxs)(`section`,{className:`oc-anomaly__attachment`,children:[(0,J.jsx)(`h4`,{className:`oc-anomaly__attachment-name`,children:(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.name})}),(0,J.jsx)(`pre`,{className:`oc-anomaly__attachment-content`,children:e.content})]},e.name))})]})})]})}function Ve({severity:e}){return(0,J.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function He({status:e}){return e===`open`?(0,J.jsx)(L,{variant:`destructive`,children:c()}):e===`acknowledged`?(0,J.jsx)(L,{variant:`secondary`,children:m()}):(0,J.jsx)(L,{variant:`outline`,children:f()})}function Ue(e){return e.length>8?e.slice(0,8):e}export{Z as AnomaliesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$u as r,AP as i,CP as a,DP as o,EP as s,Ju as c,MP as l,NP as u,OP as d,PP as f,Qu as p,SP as m,TP as h,XX as g,Xu as _,Yu as v,Zu as y,bP as b,jP as x,kP as S,t as C,wP as w,xP as T}from"./api-DSJJn0d7.js";import{n as E,t as D}from"./useNavigate-D3GIoxyW.js";import{a as O,i as k,n as A,r as j,t as M}from"./select-qM3ZfTHx.js";import"./convexApi-CyScjgcq.js";import{n as N}from"./format-DGKgJf2p.js";import{c as P,o as F,s as I,t as L,u as R}from"./searchSchemas-CS2ZgsHC.js";import{n as ee}from"./TimeRangePicker-D3PJq1H8.js";import{t as z}from"./FilterBar-DTVwlDpF.js";import{t as B}from"./AdvancedFilter-Bb66m5kb.js";import{t as V}from"./DataTableShell-DRFFBx_j.js";var H=t(e(),1),U=n(),W={kind:`relative`,from:L,to:`now`},G=`__all__`,K=[{value:`action`,label:r()},{value:`realLabel`,label:p()},{value:`targetLabel`,label:y()},{value:`impersonated`,label:_()},{value:`resource`,label:v()},{value:`resourceId`,label:c()}];function q(){let e=E({from:`/settings/audit`}),t=D({from:`/settings/audit`}),n=e.q??``,r=e.action??G,c=e.impersonated??G,p=e.resource??G,_=F(e.from,e.to),v=(0,H.useMemo)(()=>R(e.adv),[e.adv]),{from:y,to:L}=ee(_),q=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),J=e=>void t({search:t=>({...t,action:e===G?void 0:e})}),Y=e=>void t({search:t=>({...t,impersonated:e===G?void 0:e})}),X=e=>void t({search:t=>({...t,resource:e===G?void 0:e})}),Z=e=>void t({search:t=>({...t,...P(e)})}),Q=e=>void t({search:t=>({...t,adv:I(e)}),replace:!0}),$=g(C.admin.listAudit,{filter:{q:n||void 0,from:y,to:L,action:r===G?void 0:r,resource:p===G?void 0:p,impersonated:c===G?void 0:c===`yes`,advanced:v.length>0?v:void 0}}),te=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.action);return[...e].sort()},[$]),ne=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])t.resource&&e.add(t.resource);return[...e].sort()},[$]),re=n!==``||r!==G||c!==G||p!==G||v.length>0||_.kind!==`relative`||_.from!==W.from;function ie(){t({search:{},replace:!0})}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`oc-admin__hint`,children:[f(),` `,(0,U.jsx)(`span`,{className:`oc-filter__window`,children:u()})]}),(0,U.jsxs)(z,{q:n,onQChange:q,searchPlaceholder:l(),timeRange:_,onTimeRangeChange:Z,onReset:ie,canReset:re,children:[(0,U.jsxs)(M,{value:r,onValueChange:J,children:[(0,U.jsx)(k,{size:`sm`,className:`w-40`,children:(0,U.jsx)(O,{placeholder:x()})}),(0,U.jsxs)(A,{children:[(0,U.jsx)(j,{value:G,children:i()}),te.map(e=>(0,U.jsx)(j,{value:e,children:e},e))]})]}),(0,U.jsxs)(M,{value:c,onValueChange:Y,children:[(0,U.jsx)(k,{size:`sm`,className:`w-40`,children:(0,U.jsx)(O,{})}),(0,U.jsxs)(A,{children:[(0,U.jsx)(j,{value:G,children:S()}),(0,U.jsx)(j,{value:`yes`,children:d()}),(0,U.jsx)(j,{value:`no`,children:o()})]})]}),(0,U.jsxs)(M,{value:p,onValueChange:X,children:[(0,U.jsx)(k,{size:`sm`,className:`w-40`,children:(0,U.jsx)(O,{placeholder:s()})}),(0,U.jsxs)(A,{children:[(0,U.jsx)(j,{value:G,children:h()}),ne.map(e=>(0,U.jsx)(j,{value:e,children:e},e))]})]})]}),(0,U.jsx)(B,{fields:K,seed:v,onChange:Q}),(0,U.jsx)(V,{title:w(),rows:$,emptyHint:a(),columns:[{header:m(),cell:e=>N(e.at),sort:e=>e.at},{header:x(),cell:e=>e.action,sort:e=>e.action},{header:T(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:b(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:s(),cell:e=>e.resource?e.resource+(e.resourceId?` · ${e.resourceId.slice(0,8)}`:``):`—`,sort:e=>e.resource??null}]})]})}export{q as AuditTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$O as r,AA as i,A_ as a,Ak as o,As as s,Bk as c,CA as l,C_ as u,Ck as d,DA as f,D_ as p,Dk as m,E as h,EA as ee,E_ as g,Ek as _,Fk as te,Gk as ne,Hk as re,Ik as ie,Jk as ae,Kk as oe,Lk as v,Mk as y,Nk as se,O_ as ce,Ok as le,Pk as ue,QO as de,Rk as fe,SA as pe,S_ as me,Sk as he,Su as ge,TA as _e,T_ as ve,Tk as b,Uk as ye,Vk as be,Wk as xe,XO as Se,XX as x,YX as Ce,ZO as S,_A as we,_k as Te,_u as Ee,ak as De,bA as Oe,b_ as ke,bk as Ae,ck as je,dk as Me,ek as Ne,fk as Pe,gA as Fe,gk as Ie,gu as Le,hk as Re,hu as ze,ik as Be,j_ as Ve,jk as He,kA as Ue,k_ as We,kk as Ge,lk as Ke,mk as qe,nk as Je,ok as Ye,oo as Xe,p_ as Ze,pk as Qe,qX as $e,qk as et,rk as tt,sk as nt,t as C,tk as rt,uk as w,vk as it,vu as at,wA as ot,w_ as st,wk as ct,xA as lt,x_ as ut,xk as dt,y_ as ft,yk as pt,yu as mt,zk as ht}from"./api-DSJJn0d7.js";import{i as gt,n as T,o as _t,r as vt,s as yt}from"./FieldLabel-Tea3wyVe.js";import{n as bt,t as E}from"./useNavigate-D3GIoxyW.js";import{r as D}from"./dist-ClkJChBn.js";import{t as O}from"./chevron-right-C_b_y922.js";import{t as xt}from"./chevron-up-Dsqj2Oaj.js";import{t as St}from"./chevrons-up-down-Pva00Np5.js";import{n as Ct,t as wt}from"./usageView-C9Y6E0Zu.js";import{t as Tt}from"./loader-circle-BNhIFGdg.js";import{t as Et}from"./checkbox-CsI4ggnp.js";import{t as Dt}from"./server-DLnWqkX-.js";import{t as k}from"./triangle-alert-BkDa-x8g.js";import{a as A,i as j,n as M,r as N,t as P}from"./select-qM3ZfTHx.js";import{i as Ot,n as kt,r as At,t as jt}from"./tabs-mZfLmn2f.js";import{n as Mt,r as Nt,t as Pt}from"./popover-DBaIbsBr.js";import{t as Ft}from"./button-Dio0PVrp.js";import{t as F}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{r as It}from"./toast-xNFwDnUy.js";import{t as I}from"./badge-C4po8DQ1.js";import{a as L,n as R}from"./format-DGKgJf2p.js";import{a as Lt,n as Rt,o as zt,r as Bt,t as Vt}from"./dialog-BfrsWZiD.js";import{t as Ht}from"./appHost-CH3EGcJw.js";import{r as Ut}from"./locales-CPjguROj.js";import{a as z,i as B,n as V,o as H,r as U,t as Wt}from"./table-D2SJC960.js";import{t as Gt}from"./FilterBar-DTVwlDpF.js";import{c as Kt,i as qt,n as Jt,o as Yt,r as Xt,s as Zt,t as Qt}from"./compatView--1YlftIc.js";import{t as W}from"./dispatchErrorInfo-Bb7JyJFO.js";var $t=h(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),en=h(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),G=t(e(),1);function tn(e){return e.filter(e=>e.state===`error`)}function nn(e){return e.reachable&&tn(e.targets).length===0}function rn(e){return nn(e)?(e.unreachableInstances??[]).length>0?`gateways_unreachable`:`ok`:`error`}function an(e){return e.state===`error`&&e.lastErrorCode!==null}function on(e){return!!e.lastDownstreamRejectCode}function sn(e){return!!e.lastLocalRefusalCode}function cn(e){return an(e)||on(e)||sn(e)}function K(e){return e.kind??`openclaw`}function ln(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function un(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,K(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(K(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return ln(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>K(e)===r)}))}function q(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var J=`__all__`,dn={q:``,state:J,instance:J,version:J},Y={connected:0,error:1,idle:2};function fn(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function pn(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function X(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function mn(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`&&t.lastOkAt===null}function hn(e,t,n){switch(e){case`state`:return(Y[t.state]??99)-(Y[n.state]??99);case`instance`:return X(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return X(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return Zt(e,r)??X(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return X(t.targetLabel,n.targetLabel)}}function gn(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=mn(t.key,e),a=mn(t.key,r);return i&&a?0:i?1:a?-1:n*hn(t.key,e,r)})}function _n(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(Y[e]??99)-(Y[t]??99))}function vn(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>X(e.label,t.label))}function yn(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>Zt(e,t)??X(e,t))}var Z=n();function bn({connections:e,displayByInstance:t}){let[n,i]=(0,G.useState)(dn),[a,o]=(0,G.useState)(null),s=(0,G.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount+(e.downstreamRejectCount??0)+(e.localRefusalCount??0),attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null,lastLocalRefusalCode:e.lastLocalRefusalCode??null,lastLocalRefusalAt:e.lastLocalRefusalAt??null})),[e,t]),c=(0,G.useMemo)(()=>_n(s),[s]),l=(0,G.useMemo)(()=>vn(s),[s]),u=(0,G.useMemo)(()=>yn(s),[s]),d=(0,G.useMemo)(()=>gn(pn(s,n),a),[s,n,a]);function f(e){o(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:qe()}):(0,Z.jsxs)(`div`,{className:`oc-conn`,children:[(0,Z.jsxs)(Gt,{q:n.q,onQChange:e=>i(t=>({...t,q:e})),searchPlaceholder:Me(),onReset:()=>i(dn),canReset:fn(n),children:[(0,Z.jsxs)(P,{value:n.state,onValueChange:e=>i(t=>({...t,state:e})),children:[(0,Z.jsx)(j,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(A,{placeholder:Ke()})}),(0,Z.jsxs)(M,{children:[(0,Z.jsx)(N,{value:J,children:w()}),c.map(e=>(0,Z.jsx)(N,{value:e,children:Sn(e)},e))]})]}),(0,Z.jsxs)(P,{value:n.instance,onValueChange:e=>i(t=>({...t,instance:e})),children:[(0,Z.jsx)(j,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(A,{placeholder:je()})}),(0,Z.jsxs)(M,{children:[(0,Z.jsx)(N,{value:J,children:w()}),l.map(e=>(0,Z.jsx)(N,{value:e.name,children:e.label},e.name))]})]}),(0,Z.jsxs)(P,{value:n.version,onValueChange:e=>i(t=>({...t,version:e})),children:[(0,Z.jsx)(j,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(A,{placeholder:nt()})}),(0,Z.jsxs)(M,{children:[(0,Z.jsx)(N,{value:J,children:w()}),u.map(e=>(0,Z.jsx)(N,{value:e,children:e},e))]})]})]}),d.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Ye()}):(0,Z.jsxs)(Wt,{className:`oc-conn__table`,children:[(0,Z.jsx)(z,{children:(0,Z.jsxs)(H,{children:[(0,Z.jsx)(Q,{label:De(),sortKey:`target`,sort:a,onSort:f}),(0,Z.jsx)(Q,{label:Be(),sortKey:`state`,sort:a,onSort:f}),(0,Z.jsx)(Q,{label:tt(),sortKey:`instance`,sort:a,onSort:f}),(0,Z.jsx)(Q,{label:Je(),sortKey:`host`,sort:a,onSort:f}),(0,Z.jsx)(Q,{label:rt(),sortKey:`version`,sort:a,onSort:f}),(0,Z.jsx)(B,{children:Ne()}),(0,Z.jsx)(Q,{label:r(),sortKey:`lastOk`,sort:a,onSort:f})]})}),(0,Z.jsx)(V,{children:d.map(e=>(0,Z.jsx)(xn,{r:e},e._id))})]})]})}function Q({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Z.jsx)(B,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Z.jsx)(xt,{size:13,"aria-hidden":!0}):(0,Z.jsx)(D,{size:13,"aria-hidden":!0}):(0,Z.jsx)(St,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function xn({r:e}){let t=an(e)?W(e.lastErrorCode):null,n=on(e)?W(e.lastDownstreamRejectCode):null,r=sn(e)?W(e.lastLocalRefusalCode):null;return(0,Z.jsxs)(G.Fragment,{children:[(0,Z.jsxs)(H,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Z.jsx)(U,{children:(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Z.jsx)(U,{children:(0,Z.jsx)(Cn,{state:e.state})}),(0,Z.jsx)(U,{children:e.instanceLabel?(0,Z.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(U,{children:(0,Z.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Z.jsx)(U,{children:e.gatewayVersion?(0,Z.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(U,{children:(0,Z.jsx)(`span`,{className:`oc-conn__stats`,children:Qe({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Z.jsx)(U,{children:e.lastOkAt?(0,Z.jsx)(`span`,{className:`oc-traces__mono`,children:L(e.lastOkAt)}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),cn(e)?(0,Z.jsx)(H,{className:`oc-conn__detail-row`,children:(0,Z.jsxs)(U,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Z.jsx)(`strong`,{children:t.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${L(e.lastErrorAt)}`:``,(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,r?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[Xe({label:r.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastLocalRefusalCode}),e.lastLocalRefusalAt?` · ${L(e.lastLocalRefusalAt)}`:``,(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:r.hint})]}):null,n?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[Pe({label:n.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${L(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function Sn(e){return e===`connected`?de():e===`error`?S():Se()}function Cn({state:e}){return e===`connected`?(0,Z.jsx)(I,{variant:`secondary`,children:de()}):e===`error`?(0,Z.jsx)(I,{variant:`destructive`,children:S()}):(0,Z.jsx)(I,{variant:`outline`,children:Se()})}function wn(){return x(C.bridgeHealth.getBridgeHealth,{})}function Tn(){let e=wn(),t=x(C.compat.getBridgeCompat,{}),n=x(C.me.getMe,{host:Ht})?.role===`admin`,r=x(C.admin.listInstances,n?{}:`skip`),i=x(C.agents.usageForInstances,n?{}:`skip`),a=E(),o=()=>void a({to:`/settings/anomalies`,search:{status:`open`}}),s=un(e?e.targets:[],t?t.targets:[],r??[]),{section:c}=bt({from:`/settings/bridge`}),l=E({from:`/settings/bridge`}),u=t?.compat??null,d=t===void 0?`loading`:t===null?`nodata`:`ready`,f=u!==null&&Xt(u,`hermes`)&&!s.some(e=>e.key===`hermes`);return(0,Z.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Z.jsx)(En,{health:e,compat:t,onSeeAnomalies:o}),(0,Z.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:ue()}),i&&i.length>0?(0,Z.jsxs)(`section`,{className:`oc-bridge__usage`,children:[(0,Z.jsx)(`h3`,{className:`oc-bridge__usage-title`,children:se()}),(0,Z.jsxs)(Wt,{children:[(0,Z.jsx)(z,{children:(0,Z.jsxs)(H,{children:[(0,Z.jsx)(B,{children:mt()}),(0,Z.jsx)(B,{children:at()}),(0,Z.jsx)(B,{children:Ee()}),(0,Z.jsx)(B,{children:Le()}),(0,Z.jsx)(B,{children:ze()})]})}),(0,Z.jsx)(V,{children:i.flatMap(e=>{let t=wt(e.usage,Date.now());return t?t.windows.map((t,n)=>(0,Z.jsxs)(H,{children:[(0,Z.jsx)(U,{className:`font-medium`,children:n===0?e.instanceName:``}),(0,Z.jsx)(U,{children:t.provider}),(0,Z.jsx)(U,{children:t.label}),(0,Z.jsx)(U,{children:(0,Z.jsxs)(I,{variant:t.percentLeft<=10?`destructive`:t.percentLeft<=25?`outline`:`secondary`,children:[t.percentLeft,`%`]})}),(0,Z.jsx)(U,{className:`text-muted-foreground`,children:t.resetText??`—`})]},`${e.instanceName}:${t.provider}:${t.label}`)):[]})})]})]}):null,s.length>0?(0,Z.jsxs)(jt,{value:s.some(e=>e.key===c)?c:s[0]?.key??`openclaw`,onValueChange:e=>void l({search:{section:e},replace:!0}),children:[(0,Z.jsx)(At,{className:`w-full`,children:s.map(e=>(0,Z.jsxs)(Ot,{value:e.key,className:`flex-1 gap-1.5`,children:[(0,Z.jsx)(Dt,{size:13,"aria-hidden":!0}),q(e.key)]},e.key))}),s.map(e=>(0,Z.jsx)(kt,{value:e.key,children:(0,Z.jsx)(Dn,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:u,compatStatus:d,compatReachable:t?.reachable??!0,protocol:e.key===`openclaw`?t?.protocol??null:null})},e.key))]}):null,f?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Ze()}):null]})}function En({health:e,compat:t,onSeeAnomalies:n}){let r=t!=null&&t.buildVersion!=null&&t.bridgeVersion!=null&&t.buildVersion!==t.bridgeVersion,i=t?.buildRevision&&t.buildRevision!==`unknown`?t.buildRevision.slice(0,7):null,a=t&&t!==null?(0,Z.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:Yt(t.bridgeVersion)}),i?(0,Z.jsxs)(Z.Fragment,{children:[` `,(0,Z.jsxs)(`code`,{className:`oc-traces__mono`,title:We(),children:[`(`,i,`)`]})]}):null,r?(0,Z.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,ce({build:t.buildVersion??`?`})]}):null,` · `,p(),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?g():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:b()});if(e===null)return(0,Z.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:ct()});let o=tn(e.targets),s=!e.reachable,c=rn(e),l=e.unreachableInstances??[],u=c===`ok`?`ok`:c===`gateways_unreachable`?`warn`:`error`,f=R(e.checkedAt),m=e.startedAt==null?null:R(e.startedAt);return(0,Z.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${u}`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:c===`ok`?(0,Z.jsx)(Ct,{size:22}):s||c===`gateways_unreachable`?(0,Z.jsx)(en,{size:22}):(0,Z.jsx)(k,{size:22})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__title`,children:c===`ok`?d():c===`gateways_unreachable`?pt({count:l.length}):s?he():dt({count:o.length})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)($t,{size:12,"aria-hidden":!0}),` `,Ae({time:f})]}),m?(0,Z.jsx)(`span`,{children:Te({time:m})}):null,a]}),c===`gateways_unreachable`?(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:it({names:l.join(`, `)})}):null,s?(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:W(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Z.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:Ie()})]})}function Dn({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a,protocol:o}){let s=r?Kt(r,e):null,c=new Map;for(let e of n)c.set(e.name,e.displayName??e.name);let l=[],u=new Set;for(let n of t){if(!n.instanceName||u.has(n.instanceName))continue;u.add(n.instanceName);let t=n.gatewayVersion??null;l.push({instanceName:n.instanceName,displayName:c.get(n.instanceName)??n.instanceName,version:t,state:Jt(t,e,r)})}let d=Qt(l.map(e=>e.state)),[f,p]=(0,G.useState)(!1);return(0,Z.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Z.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Z.jsx)(Dt,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Z.jsx)(`span`,{className:`oc-bridge-provider__name`,children:q(e)}),d?(0,Z.jsx)(I,{variant:d===`beyond`||d===`defective`||d===`unsupported`?`destructive`:`secondary`,children:qt(d)}):null]}),(0,Z.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:Ve()}),(0,Z.jsx)(kn,{providerName:q(e),support:s,compatStatus:i,compatReachable:a,manifest:r,instanceRows:l}),o?(0,Z.jsx)(On,{protocol:o}):null,(0,Z.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":f,onClick:()=>p(e=>!e),children:[f?(0,Z.jsx)(D,{size:13,"aria-hidden":!0}):(0,Z.jsx)(O,{size:13,"aria-hidden":!0}),Re({count:t.length})]}),f?(0,Z.jsx)(bn,{connections:t,displayByInstance:c}):null]})}function On({protocol:e}){let[t,n]=(0,G.useState)(!1),r=e.coverage,i=e.drift??[],a=(e.driftOverflow??0)+(e.driftTruncated??0);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`h4`,{className:`oc-bridge-provider__sub`,children:[y(),i.length>0?(0,Z.jsx)(I,{variant:`destructive`,children:o({count:i.length})}):a>0?(0,Z.jsx)(I,{variant:`destructive`,children:Ge()}):(0,Z.jsx)(I,{variant:`secondary`,children:He()})]}),(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[le({version:e.vendoredVersion}),r?` · `+m({handled:r.handled,ignored:r.ignored,gaps:r.gaps}):null]}),a>0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:s({overflow:e.driftOverflow??0,truncated:e.driftTruncated??0})}):null,i.length>0?(0,Z.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:i.map(e=>(0,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.shape}),` × `,e.count]},e.shape))}):null,r&&r.gapList.length>0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[t?(0,Z.jsx)(D,{size:13,"aria-hidden":!0}):(0,Z.jsx)(O,{size:13,"aria-hidden":!0}),_({count:r.gapList.length})]}),t?(0,Z.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:r.gapList.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e})},e))}):null]}):null]})}function kn({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i,providerName:o}){return t===`loading`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):t===`nodata`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):(0,Z.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ve()}),r===null?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:st()}):(0,Z.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__label`,children:ge({provider:o})}),e&&e.range!==null?(0,Z.jsx)(`span`,{children:u({min:e.range.min,max:e.range.maxValidated})}):(0,Z.jsx)(`span`,{children:g()}),e?(0,Z.jsx)(Mn,{versions:e.validatedVersions}):null]}),i.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ft()}):(0,Z.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,Z.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:Yt(e.version)}),(0,Z.jsx)(I,{variant:e.state===`supported`?`secondary`:e.state===`beyond`||e.state===`defective`||e.state===`unsupported`?`destructive`:`outline`,children:qt(e.state)})]},e.instanceName))})]})}function An({instance:e,onClose:t}){return(0,Z.jsx)(Vt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(Rt,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(Lt,{children:[(0,Z.jsx)(zt,{children:i({instance:e.displayName??e.name})}),(0,Z.jsx)(Bt,{children:Ue()})]}),(0,Z.jsx)(jn,{instance:e,onClose:t})]})})}function $({label:e,result:t}){return t?t.checked?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,Z.jsx)(Ct,{"aria-hidden":!0}):(0,Z.jsx)(k,{"aria-hidden":!0}),(0,Z.jsxs)(`span`,{children:[e,` — `,t.ok?fe():t.detail]})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,v()]}):null}function jn({instance:e,onClose:t}){let n=Ce(C.admin.upsertInstanceConfig),r=$e(C.bridge.validateMediaPaths),i=It(),a=Ut(e.config?.contentLocale,void 0),[o,s]=(0,G.useState)(()=>gt(e.config??{},a)),[u,d]=(0,G.useState)(!1),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(null),_=o.inboundMediaMode===`shared-fs`,v=o.mediaMode===`shared-fs`,y=_||v;async function se(){m(!0),g(null);try{g(await r({instanceName:e.name,inboundMediaMode:o.inboundMediaMode,mediaMode:o.mediaMode}))}catch(e){i.error(re(),e)}finally{m(!1)}}async function ce(){d(!0);try{let r=e.config??{};await n({instanceId:e._id,config:vt(o,r,a)}),t()}catch(e){i.error(pe(),e)}finally{d(!1)}}return(0,Z.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Z.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(T,{label:f(),help:lt()}),(0,Z.jsxs)(P,{value:o.mediaMode,onValueChange:e=>s({...o,mediaMode:e}),children:[(0,Z.jsx)(j,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(A,{})}),(0,Z.jsx)(M,{children:yt.map(e=>(0,Z.jsx)(N,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(T,{label:ee(),help:Oe()}),(0,Z.jsxs)(P,{value:o.inboundMediaMode,onValueChange:e=>s({...o,inboundMediaMode:e}),children:[(0,Z.jsx)(j,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(A,{})}),(0,Z.jsx)(M,{children:_t.map(e=>(0,Z.jsx)(N,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(T,{label:_e(),help:we()}),(0,Z.jsx)(F,{type:`number`,min:1,max:4096,className:`w-full`,value:o.mediaMaxMb,onChange:e=>s({...o,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),y&&(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[_&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(T,{label:ae(),help:et()}),(0,Z.jsx)(F,{className:`w-full`,spellCheck:!1,value:o.inboundAgentMount,onChange:e=>s({...o,inboundAgentMount:e.target.value})})]}),v&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(T,{label:oe(),help:ne()}),(0,Z.jsx)(F,{className:`w-full`,spellCheck:!1,value:o.outboundAgentMount,onChange:e=>s({...o,outboundAgentMount:e.target.value})})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Z.jsx)(Et,{checked:o.rehydration,onCheckedChange:e=>s({...o,rehydration:e===!0})}),(0,Z.jsx)(T,{label:ot(),help:Fe()})]}),y&&h!==null&&(0,Z.jsx)(`div`,{className:`oc-bridge-config__check`,children:h.reachable?!h.inbound&&!h.outbound?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(k,{"aria-hidden":!0}),te({reason:h.reason??`?`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:c(),result:h.inbound}),(0,Z.jsx)($,{label:ht(),result:h.outbound}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:be()})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(k,{"aria-hidden":!0}),ie()]})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[y&&(0,Z.jsxs)(Ft,{variant:`outline`,size:`sm`,onClick:()=>void se(),disabled:p,children:[p?(0,Z.jsx)(Tt,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,p?ye():xe()]}),(0,Z.jsx)(Ft,{size:`sm`,onClick:()=>void ce(),disabled:u,children:l()})]})]})})}function Mn({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Z.jsxs)(Pt,{children:[(0,Z.jsx)(Nt,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?me():ut({count:e.length}),(0,Z.jsx)(D,{size:13,"aria-hidden":!0})]})}),(0,Z.jsxs)(Mt,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Z.jsx)(`p`,{className:`oc-compat__versions-title`,children:ke()}),(0,Z.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Z.jsx)(I,{variant:`secondary`,children:e},e))})]})]})}export{Tn as BridgeTab,An as InstanceConfigDialog};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{At as r,BX as i,B_ as a,Bp as o,Bt as s,Ct as c,Dt as l,Et as u,F_ as d,Ft as f,Gp as p,Hp as m,Ht as h,I_ as g,It as _,Kp as v,L_ as y,Lt as b,M_ as x,Mt as ee,N_ as S,Nt as C,OA as te,Ot as ne,P_ as w,Pt as T,R_ as re,Rp as ie,Rt as ae,St as oe,Tt as se,Up as ce,Ut as le,Vp as ue,Vt as de,Wp as E,Wt as D,XX as O,Xv as fe,YX as k,Zv as pe,bt as me,gv as A,jt as he,kt as ge,qX as j,qp as _e,ry as M,t as N,ty as ve,wt as ye,xt as P,xu as be,yt as xe,z_ as F,zp as Se,zt as Ce}from"./api-DSJJn0d7.js";import{t as we}from"./use_paginated_query-CQj09xXv.js";import{t as I}from"./checkbox-CsI4ggnp.js";import{t as Te}from"./triangle-alert-BkDa-x8g.js";import{a as L,i as R,n as z,r as B,t as V}from"./select-qM3ZfTHx.js";import{t as H}from"./button-Dio0PVrp.js";import{t as U}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{a as Ee,t as W}from"./KnobRow-BsOT2O6U.js";import{n as De}from"./capabilities-BTqhMVxR.js";import{a as Oe}from"./compatView--1YlftIc.js";/* empty css */var G=t(e(),1),ke=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function Ae(e){let t=typeof e==`object`&&e?e:{},n=t.defaults!==null&&typeof t.defaults==`object`?t.defaults:{},r=n.thinkingDefault??t.thinkingDefault,i=n.fastModeDefault??t.fastModeDefault;return{thinkingDefault:typeof r==`string`?r:null,fastModeDefault:typeof i==`boolean`?i:null}}var K=[`auto`,`hybrid`,`tool`,`off`];function je(e){switch(e){case`auto`:return de();case`hybrid`:return s();case`tool`:return Ce();default:return ae()}}function q(e){return{injection:e.injection??`auto`,defaultSources:e.defaultSources,...e.config?{config:e.config}:{}}}function J(e){return typeof e==`string`&&K.includes(e)}function Y(e){return{injection:J(e.injection)?e.injection:`auto`,sources:e.defaultSources.filter(t=>e.sources.some(e=>e.id===t))}}function X(e,t){let n=new Set(e);return n.size===new Set(t).size&&t.every(e=>n.has(e))}function Me(e,t,n){let r=n?e.defaultWriteRefused===`scope_refused`?C():Ne(e)?c():null:T(),i=Y(e),a=t.injection!==i.injection||!X(t.sources,i.sources),o=new Set(e.sources.map(e=>e.id)),s=t.sources.length>0&&t.sources.length<=16&&t.sources.every(e=>o.has(e));return{readOnlyReason:r,dirty:a,valid:s,invalidReason:s?null:_()}}function Ne(e){return(e.contract??1)<2&&e.ownAllowlist===!1}function Pe(e,t,n){let r=t.sources.includes(n)?t.sources.filter(e=>e!==n):[...t.sources,n];return{...t,sources:e.sources.map(e=>e.id).filter(e=>r.includes(e))}}function Z(e){return e.ok?null:e.code===`scope_refused`?C():e.code===`stale_default`?ee():e.code===`write_unknown`||e.code===`not_confirmed`?ge():e.code===`not_applied`?ne():e.code===`default_too_large`?P():e.code===`allowlist_too_large`?oe():e.code===`plugin_too_old`?c():e.code===`source_not_allowed`?ye():e.code===`plugin_config_lag`?se():e.code===`knowledge_unavailable`&&e.reason===`plugin_absent`?f():he({code:e.code})}function Q(e,t){let n=q(e),r=q(t);if(n.injection!==r.injection||!X(n.defaultSources,r.defaultSources))return!0;let i=n.config,a=r.config;return i===void 0||a===void 0?i!==a:i.injection!==a.injection||!((e,t)=>e===null||t===null?e===t:e.length===t.length&&e.every((e,n)=>e===t[n]))(i.sources,a.sources)}var $=n();function Fe({instanceName:e,row:t,supported:n}){let i=j(N.knowledge.setAgentKnowledgeDefault),[a,o]=(0,G.useState)(t),[s,c]=(0,G.useState)(()=>Y(t)),[l,u]=(0,G.useState)(`idle`),[d,f]=(0,G.useState)(null),[p,m]=(0,G.useState)(!1),g=e=>{o(e),c(Y(e)),f(null)},_=Q(a,t);(0,G.useEffect)(()=>{p&&_&&(m(!1),g(t))},[p,_]);let v=Me(a,s,n),y=v.readOnlyReason===null;async function x(){u(`saving`),f(null);try{let n=Z(await i({instanceName:e,agentId:t.agentId,injection:s.injection,sources:s.sources,expected:q(a)}));f(n),u(n===null?`done`:`idle`),n===null&&m(!0)}catch(e){f(Z({ok:!1,code:String(e?.message??`error`).slice(0,60)})),u(`idle`)}}return(0,$.jsxs)(`div`,{className:`oc-cdefaults__row`,"data-knowledge-agent":t.agentId,children:[(0,$.jsx)(`span`,{className:`oc-cdefaults__label`,children:t.agentId}),(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`oc-cdefaults__inline`,children:(0,$.jsxs)(V,{value:s.injection,onValueChange:e=>{J(e)&&c({...s,injection:e})},disabled:!y,children:[(0,$.jsx)(R,{className:`oc-cdefaults__select`,"aria-label":h(),children:(0,$.jsx)(L,{})}),(0,$.jsx)(z,{children:K.map(e=>(0,$.jsx)(B,{value:e,children:je(e)},e))})]})}),(0,$.jsx)(`span`,{className:`oc-cdefaults__label`,children:b()}),t.sources.map(e=>(0,$.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:y?`pointer`:`default`},title:e.description||void 0,children:[(0,$.jsx)(I,{checked:s.sources.includes(e.id),onCheckedChange:()=>c(Pe(t,s,e.id)),disabled:!y,"aria-label":e.label,"data-knowledge-default-source":e.id}),(0,$.jsx)(`span`,{children:e.label})]},e.id)),_&&!p?(0,$.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[me(),` `,(0,$.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>g(t),children:xe()})]}):null,t.overridesAllowed?null:(0,$.jsx)(`p`,{className:`oc-cdefaults__help`,children:r()}),y?(0,$.jsx)(`div`,{className:`oc-cdefaults__inline`,children:(0,$.jsx)(H,{size:`sm`,disabled:!v.dirty||!v.valid||l===`saving`,onClick:()=>void x(),children:l===`saving`?M():w()})}):(0,$.jsx)(`p`,{className:`oc-cdefaults__note`,children:v.readOnlyReason}),y&&v.dirty&&v.invalidReason!==null?(0,$.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:v.invalidReason}):null,l===`done`&&d===null?(0,$.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:S()}):null,d===null?null:(0,$.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:d})]})]})}function Ie({instanceName:e}){let t=O(N.knowledge.knowledgeAdminInstance,{instanceName:e}),{results:n,status:r,loadMore:i}=we(N.knowledge.agentKnowledgePage,{instanceName:e},{initialNumItems:50});return t===void 0||t.provider!==`openclaw`||n.length===0&&r!==`CanLoadMore`?null:(0,$.jsxs)(`section`,{className:`oc-cdefaults__row`,"aria-label":D(),children:[(0,$.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:le()}),t.supported?null:(0,$.jsx)(`p`,{className:`oc-cdefaults__note`,children:T()}),n.map(n=>(0,$.jsx)(Fe,{instanceName:e,row:n,supported:t.supported},n.agentId)),r===`CanLoadMore`||r===`LoadingMore`?(0,$.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:l({shown:n.length})}),(0,$.jsx)(H,{variant:`outline`,size:`sm`,disabled:r===`LoadingMore`,onClick:()=>i(50),"data-knowledge-load-more":!0,children:u()})]}):null]})}function Le({instance:e}){let t=k(N.admin.upsertInstanceConfig),n=O(N.agents.listAgentsForInstance,{instanceName:e.name}),r=typeof e.config?.converterAgentId==`string`?e.config.converterAgentId:``,[i,a]=(0,G.useState)(r),[o,s]=(0,G.useState)(`idle`);(0,G.useEffect)(()=>{a(r),s(`idle`)},[e._id,r]);let c=`__none__`,l=i!==r;async function u(){s(`saving`);try{let n={...e.config??{}};i===``||i===c?delete n.converterAgentId:n.converterAgentId=i,await t({instanceId:e._id,config:n}),s(`done`)}catch{s(`error`)}}let d=n?.agents??[];return(0,$.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,$.jsx)(`span`,{className:`oc-cdefaults__label`,children:E()}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:ce()}),(0,$.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,$.jsxs)(V,{value:i===``?c:i,onValueChange:e=>a(e===c?``:e),children:[(0,$.jsx)(R,{className:`oc-cdefaults__select`,"aria-label":E(),children:(0,$.jsx)(L,{placeholder:m()})}),(0,$.jsxs)(z,{children:[(0,$.jsx)(B,{value:c,children:m()}),d.map(e=>(0,$.jsx)(B,{value:e.agentId,children:e.displayName?`${e.displayName} (${e.agentId})`:e.agentId},e.agentId))]})]}),(0,$.jsx)(H,{size:`sm`,disabled:!l||o===`saving`,onClick:()=>void u(),children:o===`saving`?M():w()})]}),o===`done`?(0,$.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:S()}):null,o===`error`?(0,$.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:x()}):null]})}function Re({instance:e}){let t=k(N.admin.upsertInstanceConfig),n=e.config?.curationEnabled===!0,r=typeof e.config?.curationBudgetChars==`number`?e.config.curationBudgetChars:null,[i,a]=(0,G.useState)(n),[s,c]=(0,G.useState)(r===null?``:String(r)),[l,u]=(0,G.useState)(`idle`);(0,G.useEffect)(()=>{a(n),c(r===null?``:String(r)),u(`idle`)},[e._id,n,r]);let d=s.trim(),f=d===``?null:/^\d+$/.test(d)?Number.parseInt(d,10):NaN,m=!i||f===null||Number.isInteger(f)&&f>=4e3&&f<=6e4,h=i!==n||(f??null)!==r;async function g(){u(`saving`);try{let n={...e.config??{}};n.curationEnabled=i,!i||f===null||Number.isNaN(f)?delete n.curationBudgetChars:n.curationBudgetChars=f,await t({instanceId:e._id,config:n}),u(`done`)}catch{u(`error`)}}return(0,$.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,$.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,$.jsx)(I,{checked:i,onCheckedChange:e=>a(e===!0),"aria-label":p()}),(0,$.jsx)(`span`,{className:`oc-cdefaults__label`,children:p()})]}),(0,$.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,$.jsx)(U,{type:`number`,min:4e3,max:6e4,step:1e3,placeholder:`20000`,value:s,onChange:e=>c(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!m,"aria-label":ue(),disabled:!i}),(0,$.jsx)(H,{size:`sm`,disabled:!h||!m||l===`saving`,onClick:()=>void g(),children:l===`saving`?M():w()})]}),m?null:(0,$.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:o()}),l===`done`?(0,$.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:S()}):null,l===`error`?(0,$.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:x()}):null,(0,$.jsx)(`p`,{className:`oc-cdefaults__help`,children:Se()})]})}function ze({instance:e}){let t=k(N.admin.upsertInstanceConfig),n=typeof e.config?.summarizeThresholdChars==`number`?e.config.summarizeThresholdChars:null,[r,i]=(0,G.useState)(n===null?``:String(n)),[a,o]=(0,G.useState)(`idle`);(0,G.useEffect)(()=>{i(n===null?``:String(n)),o(`idle`)},[e._id,n]);let s=r.trim(),c=s===``?null:/^\d+$/.test(s)?Number.parseInt(s,10):NaN,l=c===null||Number.isInteger(c)&&c>=1e3&&c<=2e5,u=(c??null)!==n;async function d(){o(`saving`);try{let n={...e.config??{}};c===null?delete n.summarizeThresholdChars:n.summarizeThresholdChars=c,await t({instanceId:e._id,config:n}),o(`done`)}catch{o(`error`)}}return(0,$.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,$.jsx)(`span`,{className:`oc-cdefaults__label`,children:_e()}),(0,$.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,$.jsx)(U,{type:`number`,min:1e3,max:2e5,step:1e3,placeholder:`8000`,value:r,onChange:e=>i(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!l}),(0,$.jsx)(H,{size:`sm`,disabled:!u||!l||a===`saving`,onClick:()=>void d(),children:a===`saving`?M():w()})]}),l?null:(0,$.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:ie()}),a===`done`?(0,$.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:S()}):null,a===`error`?(0,$.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:x()}):null,(0,$.jsx)(`p`,{className:`oc-cdefaults__help`,children:v()})]})}function Be(){let e=j(N.agentFiles.getChatDefaults),[t,n]=(0,G.useState)({status:`loading`}),r=O(N.admin.listInstances,{}),[o,s]=(0,G.useState)(null);(0,G.useEffect)(()=>{!r||r.length===0||(!o||!r.some(e=>e.name===o))&&s(r[0].name)},[r,o]);let c=(r?.length??0)>1,l=r!==void 0&&r.length===0,u=O(N.compat.forInstance,o?{instanceName:o}:`skip`),f=o?De(u,`configDefaults`):`loading`,p=f===`loading`?null:f.blocked,m=(0,G.useMemo)(()=>c&&o?{instanceName:o}:{},[c,o]),h=(0,G.useRef)(0),_=(0,G.useCallback)(async()=>{let t=++h.current;n({status:`loading`});try{let r=Ae(await e(m));if(h.current!==t)return;n({status:`done`,current:r})}catch{if(h.current!==t)return;n({status:`error`})}},[e,m]);(0,G.useEffect)(()=>{p===!1&&(c&&!o||_())},[_,p,c,o]);let v=t.status===`done`?t.current:null,b=(0,G.useMemo)(()=>ke.map(e=>({id:e,label:Ee(e)})),[]),x=(0,G.useMemo)(()=>[{id:`fast`,label:pe()},{id:`standard`,label:fe()}],[]);return(0,$.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:a()}),c&&o?(0,$.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,$.jsx)(`span`,{className:`oc-cdefaults__label`,children:A()}),(0,$.jsxs)(V,{value:o,onValueChange:e=>s(e),children:[(0,$.jsx)(R,{size:`sm`,"aria-label":A(),children:(0,$.jsx)(L,{})}),(0,$.jsx)(z,{children:(r??[]).map(e=>(0,$.jsx)(B,{value:e.name,children:e.name},e.name))})]})]}):null,l?(0,$.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:te()}):f===`loading`?(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):f.blocked?(0,$.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,$.jsx)(Te,{size:14,"aria-hidden":!0}),` `,Oe(f.gatewayVersion,f.provider)]}):t.status===`loading`?(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):t.status===`error`?(0,$.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[d(),` `,(0,$.jsx)(H,{variant:`outline`,size:`sm`,onClick:()=>void _(),children:ve()})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,$.jsx)(`span`,{className:`oc-cdefaults__label`,children:F()}),(0,$.jsx)(W,{field:`thinkingLevel`,options:b,value:v?.thinkingDefault??null,onChange:()=>{},disabled:!0,ariaLabel:F()}),(0,$.jsx)(`p`,{className:`oc-cdefaults__help`,children:re()})]}),(0,$.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,$.jsx)(`span`,{className:`oc-cdefaults__label`,children:y()}),(0,$.jsx)(W,{field:`fastMode`,options:x,value:v===null||v.fastModeDefault===null?null:v.fastModeDefault?`fast`:`standard`,onChange:()=>{},disabled:!0,ariaLabel:y()}),(0,$.jsx)(`p`,{className:`oc-cdefaults__help`,children:g()})]}),(0,$.jsx)(`p`,{className:`oc-cdefaults__note`,children:be()})]}),(()=>{let e=r?.find(e=>e.name===(o??r[0]?.name));return e?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ze,{instance:e}),(0,$.jsx)(Re,{instance:e}),(0,$.jsx)(Le,{instance:e}),(0,$.jsx)(Ie,{instanceName:e.name})]}):null})()]})}export{Be as ChatDefaultsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./bundle-mjs-C73ZY4La.js";import{BE as t,JE as n,VE as r,YE as i,YX as a,t as o,xj as s,zE as c}from"./api-DSJJn0d7.js";import{t as l}from"./use_paginated_query-CQj09xXv.js";import{t as u}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{n as d}from"./ConfirmDialog-BXcki0Ee.js";import{r as f}from"./trashView-Ct0Xw-a9.js";import{n as p,t as m}from"./trashPage-WtAhGCt7.js";var h=e();function g(){let{results:e,status:g,loadMore:_}=l(o.trash.listMyTrash,{},{initialNumItems:50}),v=f(),y=a(o.trash.restoreChat),b=a(o.trash.purgeChat),x=a(o.trash.emptyTrash),S=d();return(0,h.jsxs)(`div`,{className:`oc-trash__body`,children:[(0,h.jsxs)(`div`,{className:`oc-trash__head`,children:[(0,h.jsx)(`p`,{className:`oc-trash__hint`,children:i({days:v})}),e.length>0?(0,h.jsx)(u,{variant:`destructive`,size:`sm`,onClick:async()=>{await S({title:t(),description:c(),confirmLabel:r(),destructive:!0})&&await x({})},children:r()}):null]}),g===`LoadingFirstPage`?(0,h.jsx)(`p`,{className:`oc-trash__hint`,children:s()}):e.length===0?(0,h.jsx)(`p`,{className:`oc-trash__empty`,children:n()}):(0,h.jsx)(m,{items:e,onRestore:e=>y({chatId:e}),onPurge:e=>b({chatId:e})}),(0,h.jsx)(p,{status:g,loadMore:_})]})}export{g as DeletedChatsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$L as r,AL as i,BL as a,CL as o,DL as s,EL as c,FL as l,GL as u,HL as d,IL as f,JL as p,KL as ee,LL as te,ML as ne,NL as m,OL as h,PL as g,QL as _,RL as re,SL as v,TL as y,UL as ie,VL as ae,WL as b,XL as x,XX as S,YL as C,YX as w,Yf as T,ZL as E,Zf as D,_L as O,aL as k,aR as A,bL as j,cL as M,dL as N,eR as P,fL as F,gL as I,hL as L,iL as R,iR as z,jL as B,kL as V,lL as H,mL as U,nR as oe,oL as W,oR as G,pL as K,qL as q,rR as se,sL as ce,t as J,tR as le,uL as ue,vL as de,wL as fe,xL as pe,yL as me,zL as he}from"./api-DSJJn0d7.js";import{t as ge}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{n as _e}from"./format-DGKgJf2p.js";import{n as Y}from"./ConfirmDialog-BXcki0Ee.js";import{t as ve}from"./DataTableShell-DRFFBx_j.js";var X=t(e(),1),Z=n(),ye={altered_words:()=>G(),incorrect:()=>A(),incoherence:()=>z(),formatting:()=>se(),latency:()=>oe(),api_error:()=>le(),other:()=>P()},Q=e=>ye[e]?.()??e;function $({matches:e,sourceWasOpen:t}){return t?e===!0?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:_()}):e===!1?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:E()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:r()})}function be({data:e,reference:t,closeReason:n}){let r=e.snapshot,o=w(J.feedback.respondToFeedback),[s,c]=(0,X.useState)(e.thread),[h,_]=(0,X.useState)(``),[v,y]=(0,X.useState)(!1);async function S(){let t=h.trim();if(!(!t||v)){y(!0);try{await o({feedbackId:e._id,text:t}),c(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),_(``)}finally{y(!1)}}}let T=[];try{T=r.contextJson?JSON.parse(r.contextJson):[]}catch{T=[]}return(0,Z.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Z.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,Z.jsx)($,{matches:r.displayedMatchesStored,sourceWasOpen:r.clientInfo?.sourceWasOpen??!1}),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Q(e.category),` · `,r.messageRole,r.isRegeneration?` · ${x()}`:``,r.openclawModel?` · ${r.openclawModel}`:``,r.openclawRuntime?` (${r.openclawRuntime})`:``]}),t?(0,Z.jsx)(`code`,{className:`oc-fbadmin__ref`,style:{userSelect:`all`,marginLeft:`auto`},title:fe(),children:t}):null]}),e.comment?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:C()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,n?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ue()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:n})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:p()}),s.length>0?(0,Z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:s.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Z.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?q():e.authorRole===`agent`?e.authorLabel??D():ee()}),(0,Z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:u()}),(0,Z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:b(),value:h,maxLength:2e3,rows:3,onChange:e=>_(e.target.value.slice(0,2e3))}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Z.jsx)(ge,{size:`sm`,onClick:()=>void S(),disabled:!h.trim()||v,children:v?ie():d()})})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ae()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:r.messageText||a()})]}),r.clientInfo?.sourceWasOpen&&r.displayedText!==void 0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:he()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:r.displayedText||a()})]}):null,r.promptText?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:re()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:r.promptText})]}):null,T.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:te({count:r.contextCount??T.length,truncated:r.contextTruncated?f():``})}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:T.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,r.outboxAvailable?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:l()}),(0,Z.jsxs)(`pre`,{className:`oc-msg__source-pre`,children:[r.outboxText??``,r.outboxStatus?`\n[status: ${r.outboxStatus}]`:``]})]}):null,r.clientInfo?.extensionsDetected&&r.clientInfo.extensionsDetected.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:g()}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,children:r.clientInfo.extensionsDetected.map(e=>(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:m()}),(0,Z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[r.clientInfo?.language,r.clientInfo?.timezone,r.clientInfo?.theme?ne({theme:r.clientInfo.theme}):null,r.runId?`run ${r.runId.slice(0,12)}…`:null].filter(Boolean).join(` · `)||`—`,r.clientInfo?.plugins&&r.clientInfo.plugins.length>0?(0,Z.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[B(),` `,r.clientInfo.plugins.join(`, `),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,i()]})]}):null,r.clientInfo?.userAgent?(0,Z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:r.clientInfo.userAgent}):null]})]})]})}function xe(){let e=S(J.feedback.listForAdmin,{}),t=w(J.feedback.readSnapshot),n=w(J.feedback.deleteFeedback),r=Y(),[i,a]=(0,X.useState)(null),[l,u]=(0,X.useState)({});async function d(e){if(i===e._id){a(null);return}if(!l[e._id]){let n=await t({feedbackId:e._id});u(t=>({...t,[e._id]:n}))}a(e._id)}async function f(e){await r({title:W(),description:k(),confirmLabel:R(),destructive:!0})&&(await n({feedbackId:e._id}),i===e._id&&a(null))}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[V(),` `,(0,Z.jsx)(`strong`,{children:h()}),` `,s()]}),(0,Z.jsx)(ve,{title:c(),rows:e,emptyHint:y(),isExpanded:e=>i===e._id&&!!l[e._id],renderExpanded:e=>l[e._id]?(0,Z.jsx)(be,{data:l[e._id],reference:e.reference,closeReason:e.userCloseReason}):null,columns:[{header:o(),cell:e=>_e(e.at),sort:e=>e.at},{header:v(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:pe(),cell:e=>e.messageRole===`user`?j():me(),sort:e=>e.messageRole},{header:de(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${O({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:I(),cell:e=>(0,Z.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:L(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:U(),cell:e=>e.userClosedAt==null?e.resolvedAt==null?e.answered?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:K()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:F()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,title:e.resolvedBy??void 0,children:T()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:N()}),sort:e=>e.userClosedAt==null?e.resolvedAt==null?+!!e.answered:2:3}],rowActions:e=>[{label:i===e._id?H():M(),onSelect:()=>void d(e)},{label:ce(),onSelect:()=>void f(e),variant:`destructive`}]})]})}export{xe as FeedbacksTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$Y as ee,AY as r,BX as i,BY as te,DY as ne,EY as re,FY as ie,GY as a,HX as o,HY as s,IY as c,JY as l,KY as u,LY as d,MY as f,NY as ae,OY as oe,PY as p,QY as se,RY as ce,UY as le,VY as ue,WY as m,XX as de,XY as h,YX as fe,YY as g,ZV as pe,ZY as me,aX as he,eX as ge,ep as _e,iX as _,jY as ve,kY as ye,nX as be,oX as xe,qY as v,rX as y,sX as b,t as x,tX as S,tp as C,zY as w}from"./api-DSJJn0d7.js";import{c as T,g as E,n as D,r as O,t as k}from"./dropdown-menu-DHMOOlaP.js";import{t as A}from"./download-DWgC7zCa.js";import{t as j}from"./checkbox-CsI4ggnp.js";import{t as M}from"./rotate-ccw-BD-9XzMC.js";import{t as Se}from"./trash-2-B4WSfc7G.js";import{a as N,i as P,n as F,r as I,t as L}from"./select-qM3ZfTHx.js";import{a as Ce,c as we,i as Te,n as Ee,o as De,r as Oe,s as ke,t as Ae}from"./alert-dialog-BoEv1f8g.js";import{t as R}from"./button-Dio0PVrp.js";import"./convexApi-CyScjgcq.js";import{r as je}from"./toast-xNFwDnUy.js";import{t as z}from"./badge-C4po8DQ1.js";import{a as Me,i as B,n as Ne,o as V,r as H,t as Pe}from"./table-D2SJC960.js";var U=t(e(),1),W=n(),G=`all`;function K(e){switch(e){case`image`:return h();case`audio`:return g();case`video`:return l();case`pdf`:return v();case`document`:return u();case`archive`:return a();default:return m()}}function q(){let[e,t]=(0,U.useState)(G),[n,a]=(0,U.useState)(G),[l,u]=(0,U.useState)(G),[m,h]=(0,U.useState)(G),[g,v]=(0,U.useState)(!1),[q,J]=(0,U.useState)(null),Fe=fe(x.files.softDelete),Y=je();function Ie(){t(G),a(G),u(G),h(G)}async function Le(){let e=q;if(J(null),e)try{await Fe({fileId:e.id}),Y.success(ae())}catch(e){Y.error(f(),e)}}let X=de(x.files.listMine,{direction:e===G?void 0:e,chatId:n===G?void 0:n,instanceName:l===G?void 0:l,category:m===G?void 0:m,includeAutoGenerated:g||void 0}),Re=(0,U.useMemo)(()=>new Intl.DateTimeFormat(o(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:i()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==G||n!==G||l!==G||m!==G;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:b()}),(0,W.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,W.jsxs)(L,{value:e,onValueChange:t,children:[(0,W.jsx)(P,{size:`sm`,"aria-label":xe(),children:(0,W.jsx)(N,{})}),(0,W.jsxs)(F,{children:[(0,W.jsx)(I,{value:G,children:he()}),(0,W.jsx)(I,{value:`inbound`,children:_()}),(0,W.jsx)(I,{value:`outbound`,children:y()})]})]}),(0,W.jsxs)(L,{value:n,onValueChange:a,children:[(0,W.jsx)(P,{size:`sm`,"aria-label":be(),children:(0,W.jsx)(N,{})}),(0,W.jsxs)(F,{children:[(0,W.jsx)(I,{value:G,children:S()}),Q.chats.map(e=>(0,W.jsx)(I,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,W.jsxs)(L,{value:l,onValueChange:u,children:[(0,W.jsx)(P,{size:`sm`,"aria-label":ge(),children:(0,W.jsx)(N,{})}),(0,W.jsxs)(F,{children:[(0,W.jsx)(I,{value:G,children:ee()}),Q.instances.map(e=>(0,W.jsx)(I,{value:e,children:e},e))]})]}):null,(0,W.jsxs)(L,{value:m,onValueChange:h,children:[(0,W.jsx)(P,{size:`sm`,"aria-label":se(),children:(0,W.jsx)(N,{})}),(0,W.jsxs)(F,{children:[(0,W.jsx)(I,{value:G,children:me()}),Q.categories.map(e=>(0,W.jsx)(I,{value:e,children:K(e)},e))]})]}),(0,W.jsxs)(`label`,{className:`oc-files__autogen`,children:[(0,W.jsx)(j,{checked:g,onCheckedChange:e=>v(e===!0),"aria-label":C()}),(0,W.jsx)(`span`,{children:C()})]}),$?(0,W.jsxs)(R,{variant:`ghost`,size:`sm`,onClick:Ie,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,W.jsx)(M,{size:14,"aria-hidden":!0}),c()]}):null]}),Z.length===0?(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:$?ne():oe()}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Pe,{children:[(0,W.jsx)(Me,{children:(0,W.jsxs)(V,{children:[(0,W.jsx)(B,{children:le()}),(0,W.jsx)(B,{children:s()}),(0,W.jsx)(B,{children:ue()}),(0,W.jsx)(B,{children:te()}),(0,W.jsx)(B,{children:w()}),(0,W.jsx)(B,{className:`text-right`,children:ce()})]})}),(0,W.jsx)(Ne,{children:Z.map(e=>(0,W.jsxs)(V,{children:[(0,W.jsxs)(H,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:[e.filename,e.origin===`pasted`?(0,W.jsx)(z,{variant:`outline`,style:{marginLeft:6},children:_e()}):null]}),(0,W.jsx)(H,{title:e.mimeType,children:K(e.category)}),(0,W.jsx)(H,{children:(0,W.jsx)(z,{variant:`secondary`,children:e.direction===`inbound`?_():y()})}),(0,W.jsx)(H,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,W.jsx)(H,{className:`whitespace-nowrap text-muted-foreground`,children:Re.format(e.createdAt)}),(0,W.jsx)(H,{className:`text-right`,children:(0,W.jsxs)(k,{children:[(0,W.jsx)(T,{asChild:!0,children:(0,W.jsx)(R,{variant:`ghost`,size:`icon`,"aria-label":ie(),children:(0,W.jsx)(E,{size:16})})}),(0,W.jsxs)(D,{align:`end`,children:[e.url?(0,W.jsx)(O,{asChild:!0,children:(0,W.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,W.jsx)(A,{size:14}),d()]})}):(0,W.jsxs)(O,{disabled:!0,children:[(0,W.jsx)(A,{size:14}),ye()]}),(0,W.jsxs)(O,{variant:`destructive`,onSelect:()=>J({id:e._id,filename:e.filename}),children:[(0,W.jsx)(Se,{size:14}),p()]})]})]})})]},e._id))})]}),ze?(0,W.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:re({cap:Be})}):null]}),(0,W.jsx)(Ae,{open:q!==null,onOpenChange:e=>!e&&J(null),children:(0,W.jsxs)(Te,{children:[(0,W.jsxs)(ke,{children:[(0,W.jsx)(we,{children:ve()}),(0,W.jsx)(Ce,{children:r()})]}),(0,W.jsxs)(De,{children:[(0,W.jsx)(Oe,{children:pe()}),(0,W.jsx)(Ee,{onClick:()=>void Le(),children:p()})]})]})})]})}export{q as FilesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$b as r,$y as i,Ab as a,Ax as o,Ay as s,Bb as c,By as l,Cb as u,Cx as d,Db as f,Dx as p,Dy as m,E as h,Eb as g,Ex as _,Fb as v,Fy as y,Gb as b,Gy as x,Hb as S,Hy as ee,Ib as C,Iy as w,Jb as T,Jy as E,Kb as D,Ky as te,Lb as O,Ly as k,Mb as A,My as j,Nb as M,Ny as N,Ob as ne,Ox as P,Oy as F,Pb as I,Py as re,Qy as ie,Rb as ae,Ry as oe,Sb as se,Sx as ce,Tb as le,Tx as ue,Ub as de,Uy as fe,Vb as pe,Vy as me,Wb as he,Wy as ge,XX as L,Xy as _e,YX as R,Yb as ve,Yy as ye,Zy as be,_b as xe,_x as Se,ab as Ce,ax as we,bb as Te,bx as Ee,by as De,cb as Oe,cx as ke,dx as Ae,eb as je,ex as Me,fx as Ne,gb as Pe,gx as Fe,hb as Ie,hx as Le,ib as Re,ix as ze,jb as Be,jx as Ve,jy as He,kb as Ue,kx as We,ky as Ge,lb as Ke,lx as qe,mb as Je,mx as Ye,nb as Xe,nx as z,ob as Ze,ox as Qe,px as $e,qb as B,qy as et,rb as tt,rx as nt,sb as rt,sx as it,t as V,tb as at,tx as ot,ub as H,ux as st,vb as ct,vx as lt,vy as ut,wb as dt,wx as ft,xb as pt,xx as mt,xy as ht,yb as gt,yx as _t,yy as vt,zb as yt,zy as bt}from"./api-DSJJn0d7.js";import{t as xt}from"./chevron-left-DQ9FCoo_.js";import{t as St}from"./chevron-right-C_b_y922.js";import{t as U}from"./checkbox-CsI4ggnp.js";import{t as Ct}from"./server-DLnWqkX-.js";import{i as wt,n as Tt,r as Et,t as Dt}from"./users-BJqaWlH1.js";import{t as W}from"./star-CM6J2w_J.js";import{t as Ot}from"./x-CK8d5DC1.js";import{a as kt,i as At,n as jt,r as Mt,t as Nt}from"./select-qM3ZfTHx.js";import{i as Pt,n as Ft,r as It,t as Lt}from"./tabs-mZfLmn2f.js";import{t as G}from"./button-Dio0PVrp.js";import{t as K}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{r as q}from"./toast-xNFwDnUy.js";import{t as J}from"./badge-C4po8DQ1.js";import{a as Rt,n as zt,o as Bt,r as Vt,t as Ht}from"./dialog-BfrsWZiD.js";import{t as Ut}from"./appHost-CH3EGcJw.js";import{n as Wt}from"./ConfirmDialog-BXcki0Ee.js";import{t as Gt}from"./EntitySheet-B2B48bss.js";import{a as Y,c as Kt,d as qt,f as Jt,i as Yt,l as Xt,n as Zt,o as Qt,r as $t,t as X,u as en}from"./groupManageView-BMBqgRhV.js";import{t as tn}from"./FilterBar-DTVwlDpF.js";import{t as nn}from"./DataTableShell-DRFFBx_j.js";import{t as Z}from"./DetailChips-Cv1sxdhU.js";var rn=h(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Q=t(e(),1),$=n(),an={name:``,description:``};function on(){let e=L(V.groups.listGroups,{}),t=L(V.me.getMe,{host:Ut})?.role===`admin`,n=R(V.groups.createGroup),r=R(V.groups.updateGroup),i=R(V.groups.deleteGroup),a=Wt(),s=q(),[c,l]=(0,Q.useState)(!1),[u,f]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(an),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(``),S=(0,Q.useMemo)(()=>{if(!e)return e;let t=b.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||e.members.some(e=>e.label.toLowerCase().includes(t))||e.agents.some(e=>e.toLowerCase().includes(t))||e.charts.some(e=>e.name.toLowerCase().includes(t))):e},[e,b]);function ee(){f(null),h(an),l(!0)}function C(e){f(e),h({name:e.name,description:e.description??``}),l(!0)}async function w(){try{u?await r({groupId:u._id,name:m.name,description:m.description}):await n({name:m.name,description:m.description||void 0}),h(an),f(null),l(!1)}catch(e){s.error(g(),e)}}async function T(e){if(await a({title:Ne({name:e.name}),description:Ae(),confirmWord:e.name,confirmLabel:st(),cancelLabel:lt(),destructive:!0}))try{await i({groupId:e._id})}catch(e){s.error(le(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:o()}),t?(0,$.jsx)(pn,{}):null,(0,$.jsx)(tn,{q:b,onQChange:x,onReset:()=>x(``),canReset:b!==``,searchPlaceholder:d()}),(0,$.jsx)(nn,{title:Ve(),rows:S,addLabel:We(),onAdd:t?ee:void 0,emptyHint:P(),columns:[{header:p(),cell:e=>e.name,sort:e=>e.name},{header:_(),cell:e=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Z,{icon:(0,$.jsx)(Dt,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,$.jsx)(wt,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),e.pendingInviteCount>0?(0,$.jsx)(J,{variant:`secondary`,children:Je({count:String(e.pendingInviteCount)})}):null]}),sort:e=>e.memberCount},{header:ue(),cell:e=>(0,$.jsx)(Z,{icon:(0,$.jsx)(Ct,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:ft(),cell:e=>(0,$.jsx)(Z,{icon:(0,$.jsx)(rn,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,$.jsx)(W,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:ce(),onSelect:()=>y({groupId:e._id,name:e.name})},...t?[{label:mt(),onSelect:()=>C(e)},{label:Ee(),variant:`destructive`,onSelect:()=>void T(e)}]:[]]}),(0,$.jsx)(Gt,{open:c,onOpenChange:l,title:u?Fe():Se(),description:Le(),canSubmit:!!m.name.trim(),onSubmit:w,submitLabel:_t(),children:(0,$.jsxs)(`div`,{className:`oc-form`,children:[(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:Ye()}),(0,$.jsx)(K,{value:m.name,onChange:e=>h({...m,name:e.target.value})})]}),(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:$e()}),(0,$.jsx)(K,{value:m.description,onChange:e=>h({...m,description:e.target.value})})]})]})}),(0,$.jsx)(ln,{groupId:v?.groupId??null,groupName:v?.name??``,open:v!==null,onOpenChange:e=>{e||y(null)}})]})}var sn=8;function cn({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,$.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,$.jsxs)(G,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,$.jsx)(xt,{size:14,"aria-hidden":!0}),ot()]}),(0,$.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":r({page:e,pages:t}),children:[e,` / `,t]}),(0,$.jsxs)(G,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[Me(),(0,$.jsx)(St,{size:14,"aria-hidden":!0})]})]})}function ln({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=L(V.groups.getGroup,n&&e?{groupId:e}:`skip`),o=i?.viewerIsAdmin===!0,s=L(V.groups.listAssignableInstances,n&&e?{groupId:e}:`skip`),c=L(V.groups.listAssignableUsers,n&&o?{}:`skip`),l=R(V.groups.addMember),u=R(V.groups.removeMember),d=R(V.groups.bulkSetMembers),f=R(V.groups.setGroupManager),p=q(),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(`members`),[x,S]=(0,Q.useState)(1),[ee,C]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(new Set),E=(0,Q.useRef)(null),D=(0,Q.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),te=(0,Q.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),O=(0,Q.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.restricted).map(e=>e.userId)),[i]),k=(0,Q.useMemo)(()=>new Set((i?.agents??[]).map(e=>X(e.instanceName,e.agentId))),[i]),A=(0,Q.useMemo)(()=>{let e=(i?.agents??[]).find(e=>e.isDefault);return e?X(e.instanceName,e.agentId):null},[i]);(0,Q.useEffect)(()=>{h(``),_(``),y(`members`),S(1),C(null),E.current=null},[n,e]),(0,Q.useEffect)(()=>{S(1)},[m]),(0,Q.useEffect)(()=>{n&&i&&e&&E.current!==e&&(E.current=e,T(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let j=(0,Q.useMemo)(()=>c?Yt(c,m,w):[],[c,m,w]);async function M(t,n){if(e)try{n?await u({groupId:e,userId:t}):await l({groupId:e,userId:t})}catch(e){p.error(dt(),Y(e))}}async function N(t,n){if(e)try{await f({groupId:e,userId:t,manager:!n})}catch(e){p.error(ne(),e)}}let P=qt(j,e=>D.has(e.userId)),F=j.filter(e=>D.has(e.userId)).length,I=Xt(j,x,sn);async function re(){if(!e||j.length===0)return;let t=j.map(e=>e.userId);try{await d({groupId:e,userIds:t,member:P!==`all`})}catch(e){p.error(dt(),Y(e))}}let ie=(e,t)=>(0,$.jsxs)(G,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7`,"aria-label":Ce({user:t}),title:Ce({user:t}),onClick:()=>C({userId:e,label:t}),children:[(0,$.jsx)(Et,{size:13,"aria-hidden":!0}),Ze()]});return(0,$.jsx)(Ht,{open:n,onOpenChange:r,children:(0,$.jsxs)(zt,{className:`oc-access`,children:[(0,$.jsxs)(Rt,{children:[(0,$.jsx)(Bt,{children:qe({name:t})}),(0,$.jsx)(Vt,{children:i&&!o?se():ke()})]}),(0,$.jsxs)(Lt,{value:v,onValueChange:y,className:`oc-access__tabs`,children:[(0,$.jsxs)(It,{className:`w-full`,children:[(0,$.jsxs)(Pt,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Dt,{size:13,"aria-hidden":!0}),it(),i?(0,$.jsx)(J,{variant:`secondary`,className:`oc-access__tabcount`,children:D.size}):null]}),(0,$.jsxs)(Pt,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Ct,{size:13,"aria-hidden":!0}),we(),i?(0,$.jsx)(J,{variant:`secondary`,className:`oc-access__tabcount`,children:k.size}):null]}),(0,$.jsxs)(Pt,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(rn,{size:13,"aria-hidden":!0}),yt(),i?(0,$.jsx)(J,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,$.jsx)(Ft,{value:`members`,children:i===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()}):o?c===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()}):c.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:b()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(K,{value:m,onChange:e=>h(e.target.value),placeholder:Qe(),className:`oc-access__search`}),j.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:nt()}):(0,$.jsxs)($.Fragment,{children:[j.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(U,{checked:P===`all`||P===`some`&&`indeterminate`,onCheckedChange:()=>void re(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()}),(0,$.jsxs)(J,{variant:`outline`,className:`oc-access__count`,children:[F,` / `,j.length]})]}):null,(0,$.jsx)(`div`,{className:`oc-access__list`,children:I.pageItems.map(e=>{let t=D.has(e.userId),n=Jt(e),r=te.has(e.userId);return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(U,{checked:t,onCheckedChange:()=>void M(e.userId,t),"aria-label":ve({user:n.primary})}),(0,$.jsxs)(`span`,{className:`oc-access__who`,children:[(0,$.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,$.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),t&&O.has(e.userId)?(0,$.jsx)(J,{variant:`outline`,className:`oc-access__role`,children:Re()}):null,(0,$.jsx)(J,{variant:`outline`,className:`oc-access__role`,children:en(e.role)}),t?ie(e.userId,n.primary):null,(0,$.jsx)(`span`,{className:`oc-access__mgrslot`,children:t?(0,$.jsx)(G,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?Ue():a(),title:r?Ue():a(),onClick:()=>void N(e.userId,r),children:(0,$.jsx)(wt,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,$.jsx)(cn,{page:I.page,pageCount:I.pageCount,onPage:S})]})]}):e?(0,$.jsx)(un,{groupId:e,members:i.members,agentsButton:ie}):null}),(0,$.jsxs)(Ft,{value:`agents`,children:[i&&!o?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ye()}):null,s===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()}):s.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:he()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(K,{value:g,onChange:e=>_(e.target.value),placeholder:ze(),className:`oc-access__search`}),(0,$.jsx)(`div`,{className:`oc-access__list`,children:s.map(t=>(0,$.jsx)(fn,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:k,defaultKey:A,viewerIsAdmin:o,query:g},`${e}-${t._id}`))})]})]}),(0,$.jsx)(Ft,{value:`charts`,children:(0,$.jsx)(mn,{groupId:e})})]}),(0,$.jsx)(dn,{groupId:e,member:ee,onOpenChange:e=>{e||C(null)}})]})})}function un({groupId:e,members:t,agentsButton:n}){let r=L(V.groupInvites.listGroupInviteRequests,{groupId:e}),i=R(V.groupInvites.requestGroupInvite),a=R(V.groups.removeMember),o=Wt(),s=q(),[c,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(1),f=Xt(t,u,sn);async function p(t){t.preventDefault();let n=c.trim();if(n)try{await i({groupId:e,email:n}),l(``),s.success(xe())}catch(e){s.error(Pe(),e)}}async function h(t,n){if(await o({title:H({user:n}),description:Oe({user:n}),confirmLabel:rt(),cancelLabel:lt(),destructive:!0}))try{await a({groupId:e,userId:t})}catch(e){s.error(dt(),Y(e))}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`form`,{className:`oc-access__invite`,onSubmit:e=>void p(e),children:[(0,$.jsx)(K,{type:`email`,value:c,onChange:e=>l(e.target.value),placeholder:gt(),"aria-label":pt()}),(0,$.jsxs)(G,{type:`submit`,size:`sm`,disabled:!c.trim(),children:[(0,$.jsx)(Tt,{size:14,"aria-hidden":!0}),ct()]})]}),(0,$.jsx)(`p`,{className:`oc-access__hint`,children:Te()}),t.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:tt()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`oc-access__list`,children:f.pageItems.map(e=>(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(`span`,{className:`oc-access__label`,title:e.label,children:e.label}),e.restricted?(0,$.jsx)(J,{variant:`outline`,className:`oc-access__role`,children:Re()}):null,n(e.userId,e.label),(0,$.jsx)(`span`,{className:`oc-access__mgrslot`,children:e.manager?(0,$.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":Be(),title:Be(),children:(0,$.jsx)(wt,{size:15,"aria-hidden":!0})}):null}),(0,$.jsx)(G,{type:`button`,variant:`ghost`,size:`icon-sm`,disabled:e.manager||e.lastGroup,"aria-label":H({user:e.label}),title:e.manager?Ke():e.lastGroup?m():H({user:e.label}),onClick:()=>void h(e.userId,e.label),children:(0,$.jsx)(Ot,{size:14,"aria-hidden":!0})})]},e.userId))}),(0,$.jsx)(cn,{page:f.page,pageCount:f.pageCount,onPage:d})]}),r!==void 0&&r.length>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`oc-access__subhead`,children:Ie()}),(0,$.jsx)(`div`,{className:`oc-access__list`,children:r.map(e=>(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(`span`,{className:`oc-access__label`,title:e.email,children:e.email}),(0,$.jsx)(J,{variant:e.status===`pending`?`secondary`:`outline`,className:`oc-access__role`,children:Qt(e.status)})]},e._id))})]}):null]})}function dn({groupId:e,member:t,onOpenChange:n}){let r=L(V.groups.getMemberAgentSettings,e&&t?{groupId:e,userId:t.userId}:`skip`),i=R(V.groups.setMemberAgents),a=R(V.groups.setMemberDefaultAgent),o=q();async function l(e){try{await e()}catch(e){o.error(F(),e)}}let u=r?.agents??[],d=new Map(u.map(e=>[X(e.instanceName,e.agentId),e])),f=[...d.keys()],p=new Set(u.filter(e=>e.allowed).map(e=>X(e.instanceName,e.agentId)));function m(n){if(!e||!t||!r)return;let a=Kt(f,p,r.restricted,n).map(e=>{let t=d.get(e);return{instanceName:t.instanceName,agentId:t.agentId}});l(()=>i({groupId:e,userId:t.userId,agents:a}))}return(0,$.jsx)(Ht,{open:t!==null,onOpenChange:n,children:(0,$.jsxs)(zt,{className:`oc-access`,children:[(0,$.jsxs)(Rt,{children:[(0,$.jsx)(Bt,{children:k({user:t?.label??``})}),(0,$.jsx)(Vt,{children:w()})]}),r===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()}):r===null||u.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:Ge()}):(0,$.jsxs)($.Fragment,{children:[r.settable?null:(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ut()}),r.adminNarrowed?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ht()}):null,r.restrictedByAdmin&&!r.viewerIsAdmin?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:vt()}):null,(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(`span`,{className:`oc-access__label`,children:r.restricted?re():y()}),r.restricted?(0,$.jsx)(G,{type:`button`,size:`sm`,variant:`outline`,disabled:!r.settable||r.restrictedByAdmin&&!r.viewerIsAdmin,onClick:()=>e&&t?void l(()=>i({groupId:e,userId:t.userId,agents:null})):void 0,children:N()}):null]}),(0,$.jsx)(`div`,{className:`oc-access__list`,children:u.map(n=>{let i=X(n.instanceName,n.agentId),o=n.displayName??n.agentId;return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(U,{checked:n.allowed,disabled:!r.settable||r.restrictedByAdmin&&!r.viewerIsAdmin&&!n.allowed,onCheckedChange:()=>m(i),"aria-label":j({name:o})}),(0,$.jsx)(`span`,{className:`oc-access__label`,title:o,children:o}),n.limitedByAdmin?(0,$.jsx)(J,{variant:`outline`,className:`oc-access__role`,children:De()}):null,n.state===`deleted`?(0,$.jsx)(J,{variant:`outline`,className:`oc-access__gone`,children:c()}):null,n.allowed?n.isMemberDefault?(0,$.jsx)(G,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__fav`,disabled:!r.settable,"aria-label":He(),title:He(),onClick:()=>e&&t?void l(()=>a({groupId:e,userId:t.userId,agent:null})):void 0,children:(0,$.jsx)(W,{size:14,fill:`currentColor`})}):(0,$.jsx)(G,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,disabled:!r.settable,"aria-label":s(),title:s(),onClick:()=>e&&t?void l(()=>a({groupId:e,userId:t.userId,agent:{instanceName:n.instanceName,agentId:n.agentId}})):void 0,children:(0,$.jsx)(W,{size:14})}):null]},i)})})]})]})})}function fn({groupId:e,instanceName:t,kind:n,assigned:r,defaultKey:i,viewerIsAdmin:a,query:o}){let s=L(V.groups.listAssignableAgents,e?{instanceName:t,groupId:e}:`skip`),d=R(V.groups.assignAgentToGroup),f=R(V.groups.removeAgentFromGroup),p=R(V.groups.bulkSetGroupAgents),m=R(V.groups.claimAgentForGroup),h=R(V.groups.setGroupDefaultAgent),g=q(),[_,v]=(0,Q.useState)(1);if((0,Q.useEffect)(()=>{v(1)},[o]),!e)return null;let y=$t(s?.agents??[],o),b=s?.discovery&&!s.discovery.lastPollOk,C=e=>Zt({assigned:r.has(X(t,e.agentId)),claimable:e.claimable,reservedForGroup:e.reservedForGroup,enabled:e.enabled,present:e.presentInLastOk!==!1},a),w=y.filter(e=>C(e)!==`claim`),O=y.filter(e=>C(e)===`claim`);if(o.trim()&&y.length===0)return null;let k=w.filter(e=>C(e)===`toggle`&&e.presentInLastOk!==!1&&e.enabled!==!1),A=qt(k,e=>r.has(X(t,e.agentId))),j=Xt(w,_,sn);async function M(n,r){try{r?await f({groupId:e,instanceName:t,agentId:n}):await d({groupId:e,instanceName:t,agentId:n})}catch(e){g.error(u(),Y(e))}}async function N(){if(k.length===0)return;let n=k.map(e=>e.agentId);try{await p({groupId:e,instanceName:t,agentIds:n,assigned:A!==`all`})}catch(e){g.error(u(),Y(e))}}async function ne(n){try{await m({groupId:e,instanceName:t,agentId:n})}catch(e){g.error(ge(),e)}}async function P(n){try{await h({groupId:e,agent:n===null?null:{instanceName:t,agentId:n}})}catch(e){g.error(oe(),e)}}let F=e=>e.reservedForGroup?(0,$.jsx)(J,{variant:`outline`,className:`oc-access__role`,children:fe()}):e.reserved?(0,$.jsx)(J,{variant:`outline`,className:`oc-access__role`,children:e.reservedGroupName===null?me():ee({group:e.reservedGroupName})}):null;return(0,$.jsxs)(`div`,{className:`oc-access__group`,children:[(0,$.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,$.jsx)(Ct,{size:13,"aria-hidden":!0}),(0,$.jsx)(`span`,{children:t}),(0,$.jsx)(J,{variant:`outline`,className:`oc-access__kind`,children:n}),b?(0,$.jsx)(J,{variant:`outline`,className:`oc-access__stale`,children:pe()}):null]}),s===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:D()}):y.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:b?S():de()}):(0,$.jsxs)($.Fragment,{children:[k.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(U,{checked:A===`all`||A===`some`&&`indeterminate`,onCheckedChange:()=>void N(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()})]}):null,j.pageItems.map(e=>{let n=X(t,e.agentId),a=r.has(n),o=e.presentInLastOk===!1,s=C(e)===`locked`;return(0,$.jsxs)(`div`,{className:`oc-access__row${s?` is-disabled`:``}`,children:[(0,$.jsx)(U,{checked:a,disabled:s&&!a,onCheckedChange:()=>void M(e.agentId,a),"aria-label":T({name:e.displayName??e.agentId})}),(0,$.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,$.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,F(e),o?(0,$.jsx)(J,{variant:`outline`,className:`oc-access__gone`,children:c()}):null,a?i===n?(0,$.jsx)(G,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__fav`,"aria-label":l(),title:l(),onClick:()=>void P(null),children:(0,$.jsx)(W,{size:14,fill:`currentColor`})}):(0,$.jsx)(G,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":bt(),title:bt(),onClick:()=>void P(e.agentId),children:(0,$.jsx)(W,{size:14})}):null]},e.agentId)}),(0,$.jsx)(cn,{page:j.page,pageCount:j.pageCount,onPage:v}),O.length>0?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`oc-access__subhead`,children:E()}),(0,$.jsx)(`p`,{className:`oc-access__hint`,children:et()}),O.map(e=>{let t=e.displayName??e.agentId;return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsxs)(`span`,{className:`oc-access__label`,title:t,children:[e.emoji?`${e.emoji} `:``,t]}),e.model?(0,$.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,(0,$.jsx)(G,{type:`button`,size:`sm`,variant:`outline`,className:`h-7`,"aria-label":x({name:t}),onClick:()=>void ne(e.agentId),children:te()})]},e.agentId)})]}):null]})]})}function pn(){let e=L(V.groupInvites.listPendingInviteRequests,{}),t=R(V.groupInvites.decideGroupInvite),n=q();if(e===void 0||e.length===0)return null;async function r(e,r){try{await t({requestId:e,approve:r})}catch(e){n.error(_e(),e)}}return(0,$.jsxs)(`section`,{className:`oc-invites`,"aria-label":Xe(),children:[(0,$.jsxs)(`h3`,{className:`oc-invites__title`,children:[(0,$.jsx)(Tt,{size:14,"aria-hidden":!0}),Xe(),(0,$.jsx)(J,{variant:`secondary`,children:e.length})]}),(0,$.jsx)(`div`,{className:`oc-access__list`,children:e.map(e=>(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsxs)(`span`,{className:`oc-access__who`,children:[(0,$.jsx)(`span`,{className:`oc-access__label`,title:e.email,children:e.email}),(0,$.jsxs)(`span`,{className:`oc-access__sub`,children:[e.groupName??`?`,` ·`,` `,at({by:e.requestedBy})]})]}),e.account===`ready`?null:(0,$.jsx)(J,{variant:`outline`,className:`oc-access__role`,children:e.account===`none`?ie():be()}),(0,$.jsx)(G,{type:`button`,size:`sm`,variant:`outline`,className:`h-7`,disabled:e.account!==`ready`,onClick:()=>void r(e._id,!0),children:je()}),(0,$.jsx)(G,{type:`button`,size:`sm`,variant:`ghost`,className:`h-7`,onClick:()=>void r(e._id,!1),children:i()})]},e._id))})]})}function mn({groupId:e}){let t=L(V.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=R(V.charts.assignChartToGroup),r=R(V.charts.removeChartFromGroup),i=R(V.charts.setGroupDefaultChart),a=R(V.charts.addChartToGroupPool),o=R(V.charts.removeChartFromGroupPool),s=q();if(!e)return null;if(t===void 0)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:B()});let{pool:c,addable:l,canManagePool:u}=t;if(c.length===0&&!u)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ae()});async function d(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){s.error(f(),e)}}async function p(t){try{await i({groupId:e,chartKey:t})}catch(e){s.error(f(),e)}}async function m(t){try{await a({groupId:e,chartKey:t})}catch(e){s.error(f(),e)}}async function h(t){try{await o({groupId:e,chartKey:t})}catch(e){s.error(f(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`oc-access__list`,children:c.map(e=>(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(U,{checked:e.selected,onCheckedChange:()=>void d(e.chartKey,e.selected),"aria-label":I({name:e.name})}),(0,$.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,$.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":M(),title:M(),children:(0,$.jsx)(W,{size:14,fill:`currentColor`})}):(0,$.jsx)(G,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void p(e.chartKey),children:A()}):null,u?(0,$.jsx)(G,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":v({name:e.name}),title:v({name:e.name}),onClick:()=>void h(e.chartKey),children:(0,$.jsx)(Ot,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),u?l.length>0?(0,$.jsxs)(Nt,{value:``,onValueChange:e=>void m(e),children:[(0,$.jsx)(At,{size:`sm`,className:`oc-access__search`,children:(0,$.jsx)(kt,{placeholder:C()})}),(0,$.jsx)(jt,{children:l.map(e=>(0,$.jsx)(Mt,{value:e.chartKey,children:e.name},e.chartKey))})]}):c.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:O()}):null:null]})}export{on as GroupsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$ as r,$F as i,$P as a,AF as o,AI as s,An as c,Ao as l,BF as u,BP as d,CF as f,CI as p,Co as m,DF as h,DI as g,Dn as _,Do as v,EF as y,EI as b,En as ee,Eo as x,Eu as te,FF as S,FP as C,Fn as ne,Fo as re,GF as w,GP as T,GU as E,HF as D,HP as ie,IF as O,IP as k,J as ae,JF as oe,JP as se,K as ce,KF as le,KP as ue,KU as de,LF as fe,LP as pe,MF as me,Mn as he,Mo as ge,NF as _e,Nn as ve,No as ye,OF as be,OI as xe,On as Se,Oo as Ce,PF as we,Pn as Te,Po as Ee,Q as De,QF as Oe,QP as ke,RF as Ae,RP as je,SF as Me,SI as Ne,So as Pe,TF as Fe,TI as Ie,To as Le,Tu as Re,UF as ze,UP as Be,VF as Ve,VP as He,WF as Ue,WP as We,X as Ge,XF as Ke,XP as qe,XX as A,Y as Je,YF as Ye,YP as Xe,YX as j,Z as Ze,ZF as Qe,ZP as $e,_F as et,_I as tt,_y as nt,aF as rt,aI as it,bF as at,bI as ot,bo as st,cF as ct,cI as lt,cm as ut,dF as M,dI as dt,dm as ft,eF as pt,eI as mt,et as ht,fF as gt,fI as _t,gF as N,gI as P,gy as vt,hF as yt,hI as bt,hy as xt,iF as St,iI as Ct,jF as wt,jn as Tt,jo as Et,kF as Dt,kI as Ot,kn as kt,ko as At,lF as jt,lI as Mt,lm as Nt,mF as F,mI as Pt,nF as Ft,nI as It,oF as Lt,oI as Rt,pF as zt,pI as Bt,q as Vt,qF as I,qP as Ht,qX as L,rF as Ut,rI as Wt,sF as Gt,sI as Kt,t as R,tF as qt,tI as Jt,uI as Yt,um as Xt,vA as Zt,vF as Qt,vI as $t,wF as en,wI as tn,wo as nn,wu as rn,xF as an,xI as on,xo as sn,yA as cn,yF as ln,yI as un,yo as dn,zF as fn,zP as pn}from"./api-DSJJn0d7.js";import{a as mn,c as hn}from"./FieldLabel-Tea3wyVe.js";import{t as gn}from"./checkbox-CsI4ggnp.js";import{a as z,i as B,n as V,r as H,t as U}from"./select-qM3ZfTHx.js";import{n as _n,r as vn,t as yn}from"./popover-DBaIbsBr.js";import{t as W}from"./button-Dio0PVrp.js";import{t as G}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{r as K}from"./toast-xNFwDnUy.js";import{t as q}from"./badge-C4po8DQ1.js";import{a as bn,n as xn,o as Sn,r as Cn,t as wn}from"./dialog-BfrsWZiD.js";import{n as Tn}from"./ConfirmDialog-BXcki0Ee.js";import{t as En}from"./EntitySheet-B2B48bss.js";import{a as J}from"./groupManageView-BMBqgRhV.js";import{t as Dn}from"./DataTableShell-DRFFBx_j.js";import{InstanceConfigDialog as On}from"./BridgeTab-D4RFq-Rb.js";var Y=t(e(),1),X=[`conversational`,`documentary`,`summarizer`,`curator`],kn=new Set(X),An=`conversational`;function jn(e){let t=new Set((e??[]).filter(e=>kn.has(e)));return t.size===0?[An]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,transport:`ws`,gatewayVersion:``,gatewayHttpUrl:``,authMode:`token`,personScopes:`capped`,identitySource:`canonical`,participantIdentity:`owner`,managePermissionModes:!1,systemIdentity:``,streamTransport:mn,widgetsEnabled:!0,widgetPromptConfirm:!1},Mn={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Nn(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,transport:e.transport??`ws`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``,authMode:e.authMode??`token`,personScopes:e.personScopes??`capped`,identitySource:e.identitySource??`canonical`,participantIdentity:e.participantIdentity??`owner`,managePermissionModes:e.managePermissionModes===!0,systemIdentity:e.systemIdentity??``,streamTransport:e.streamTransport??`reactive`,widgetsEnabled:e.config?.widgetsEnabled!==!1,widgetPromptConfirm:e.config?.widgetPromptConfirm===!0}}function Pn(){let e=A(R.admin.listInstances,{}),t=A(R.agents.listAllInstanceAgents,{}),n=j(R.admin.upsertInstance),a=j(R.widgets.setInstanceWidgets),o=j(R.admin.deleteInstance),u=K(),[d,f]=(0,Y.useState)(!1),[h,y]=(0,Y.useState)(Q),[S,C]=(0,Y.useState)(null),[w,T]=(0,Y.useState)(null),[E,D]=(0,Y.useState)(null),[O,k]=(0,Y.useState)(null);async function oe(){try{let t=await n({instanceId:O??void 0,name:h.name,gatewayUrl:h.gatewayUrl,bridgeUrl:h.bridgeUrl||void 0,displayName:h.displayName||void 0,kind:h.kind,transport:h.kind===`hermes`?h.transport:void 0,gatewayVersion:h.gatewayVersion||void 0,gatewayHttpUrl:h.gatewayHttpUrl||void 0,...h.kind===`openclaw`?{authMode:h.authMode,personScopes:h.personScopes,identitySource:h.identitySource,participantIdentity:h.participantIdentity,managePermissionModes:h.managePermissionModes,systemIdentity:h.systemIdentity||void 0}:{},streamTransport:h.streamTransport}),r=O===null?null:e?.find(e=>e._id===O),i=r?.config?.widgetsEnabled!==!1,o=r?.config?.widgetPromptConfirm===!0;h.kind===`openclaw`&&(h.widgetsEnabled!==i||h.widgetPromptConfirm!==o)&&await a({instanceId:t,enabled:h.widgetsEnabled,promptConfirm:h.widgetPromptConfirm}),y(Q),k(null),f(!1)}catch(e){u.error(xe(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[g(),(0,Z.jsx)(`strong`,{children:b()}),Ie()]}),(0,Z.jsx)(Dn,{title:tn(),rows:e,addLabel:p(),onAdd:()=>{k(null),y(Q),f(!0)},emptyHint:Ne(),columns:[{header:on(),cell:e=>e.name,sort:e=>e.name},{header:ot(),cell:e=>(0,Z.jsx)(q,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:un(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:$t(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:s(),cell:e=>{let n=(t?.[e.name]??[]).filter(e=>e.presentInLastOk!==!1&&e.enabled);if(n.length===0)return(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let r=t=>e.defaultAgentId===t;return(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[...n].sort((e,t)=>Number(r(t.agentId))-Number(r(e.agentId))).map(e=>(0,Z.jsxs)(q,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?ie():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:Pt(),onSelect:()=>{k(e._id),y(Nn(e)),f(!0)}},{label:Ot(),onSelect:()=>C(e.name)},{label:i(),onSelect:()=>D(e)},{label:tt(),onSelect:()=>T(e)},{label:P(),variant:`destructive`,onSelect:()=>void o({instanceId:e._id})}],bulkActions:[{label:P(),variant:`destructive`,onSelect:e=>e.forEach(e=>void o({instanceId:e}))}]}),(0,Z.jsx)(En,{open:d,onOpenChange:f,title:O?Bt():bt(),description:dt(),canSubmit:!!(h.name&&h.gatewayUrl),onSubmit:oe,submitLabel:Yt(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:Mt(),children:[(0,Z.jsx)(G,{value:h.name,disabled:O!==null,onChange:e=>y({...h,name:e.target.value})}),O?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_t()}):null]}),(0,Z.jsx)($,{label:lt(),children:(0,Z.jsxs)(U,{value:h.kind,onValueChange:e=>y({...h,kind:e}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(H,{value:`hermes`,children:`Hermes`})]})]})}),h.kind===`hermes`?(0,Z.jsx)($,{label:te(),children:(0,Z.jsxs)(U,{value:h.transport,onValueChange:e=>y({...h,transport:e}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:`ws`,children:Re()}),(0,Z.jsx)(H,{value:`rest`,children:rn()})]})]})}):null,(0,Z.jsx)($,{label:Kt(),children:(0,Z.jsx)(G,{value:h.gatewayUrl,onChange:e=>y({...h,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:Rt(),children:(0,Z.jsx)(G,{value:h.bridgeUrl,placeholder:it(),onChange:e=>y({...h,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:Ct(),children:(0,Z.jsx)(G,{value:h.displayName,onChange:e=>y({...h,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:cn(),children:[(0,Z.jsxs)(U,{value:h.streamTransport,onValueChange:e=>y({...h,streamTransport:e}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(z,{})}),(0,Z.jsx)(V,{children:hn.map(e=>(0,Z.jsx)(H,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Zt()})]}),(0,Z.jsx)($,{label:Wt(),children:(0,Z.jsx)(G,{value:h.gatewayVersion,placeholder:It(),onChange:e=>y({...h,gatewayVersion:e.target.value})})}),h.kind===`openclaw`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)($,{label:Le(),children:[(0,Z.jsxs)(U,{value:h.authMode,onValueChange:e=>y({...h,authMode:e}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:`token`,children:nn()}),(0,Z.jsx)(H,{value:`trusted-proxy`,children:m()})]})]}),(0,Z.jsx)(`p`,{className:`oc-field__hint`,children:h.authMode===`trusted-proxy`?sn():Pe()})]}),h.authMode===`trusted-proxy`?(0,Z.jsxs)($,{label:re(),children:[(0,Z.jsxs)(U,{value:h.personScopes,onValueChange:e=>y({...h,personScopes:e}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:`capped`,children:Ee()}),(0,Z.jsx)(H,{value:`full`,children:ye()})]})]}),(0,Z.jsx)(`p`,{className:`oc-field__hint`,children:h.personScopes===`full`?Et():ge()})]}):null,h.authMode===`trusted-proxy`?(0,Z.jsxs)($,{label:l(),children:[(0,Z.jsxs)(U,{value:h.identitySource,onValueChange:e=>y({...h,identitySource:e}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:`canonical`,children:At()}),(0,Z.jsx)(H,{value:`email`,children:Ce()})]})]}),(0,Z.jsx)(`p`,{className:`oc-field__hint`,children:h.identitySource===`email`?x():v()})]}):null,h.authMode===`trusted-proxy`?(0,Z.jsxs)($,{label:ne(),children:[(0,Z.jsxs)(U,{value:h.participantIdentity,onValueChange:e=>y({...h,participantIdentity:e}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:`owner`,children:Te()}),(0,Z.jsx)(H,{value:`self`,children:ve()})]})]}),(0,Z.jsx)(`p`,{className:`oc-field__hint`,children:h.participantIdentity===`self`?ee():he()})]}):null,h.kind===`openclaw`?(0,Z.jsxs)($,{label:Tt(),children:[(0,Z.jsxs)(U,{value:h.managePermissionModes?`on`:`off`,onValueChange:e=>y({...h,managePermissionModes:e===`on`}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:`off`,children:c()}),(0,Z.jsx)(H,{value:`on`,children:kt()})]})]}),(0,Z.jsx)(`p`,{className:`oc-field__hint`,children:h.managePermissionModes?_():Se()})]}):null,h.kind===`openclaw`?(0,Z.jsxs)($,{label:ht(),children:[(0,Z.jsxs)(U,{value:h.widgetsEnabled?`on`:`off`,onValueChange:e=>y({...h,widgetsEnabled:e===`on`}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:`on`,children:r()}),(0,Z.jsx)(H,{value:`off`,children:De()})]})]}),(0,Z.jsx)(`p`,{className:`oc-field__hint`,children:h.widgetsEnabled?Ze():Ge()})]}):null,h.kind===`openclaw`&&h.widgetsEnabled?(0,Z.jsxs)($,{label:Je(),children:[(0,Z.jsxs)(U,{value:h.widgetPromptConfirm?`on`:`off`,onValueChange:e=>y({...h,widgetPromptConfirm:e===`on`}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(z,{})}),(0,Z.jsxs)(V,{children:[(0,Z.jsx)(H,{value:`off`,children:ae()}),(0,Z.jsx)(H,{value:`on`,children:Vt()})]})]}),(0,Z.jsx)(`p`,{className:`oc-field__hint`,children:ce()})]}):null,h.authMode===`trusted-proxy`?(0,Z.jsx)($,{label:st(),children:(0,Z.jsx)(G,{value:h.systemIdentity,placeholder:dn(),onChange:e=>y({...h,systemIdentity:e.target.value})})}):null]}):null,(0,Z.jsx)($,{label:Jt(),children:(0,Z.jsx)(G,{value:h.gatewayHttpUrl,placeholder:mt(),onChange:e=>y({...h,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Wn,{instanceName:S,open:S!==null,onOpenChange:e=>{e||C(null)}}),w?(0,Z.jsx)(On,{instance:w,onClose:()=>T(null)},w._id):null,E?(0,Z.jsx)(Fn,{instance:E,onClose:()=>D(null)},E._id):null]})}function Fn({instance:e,onClose:t}){let n=A(R.instanceSecrets.listInstanceSecretStatus,{}),r=Mn[e.kind??`openclaw`],i=(0,Y.useMemo)(()=>{let t={};for(let r of n??[])r.instanceId===e._id&&(t[r.field]=r.updatedAt);return t},[n,e._id]);return(0,Z.jsx)(wn,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(xn,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(bn,{children:[(0,Z.jsx)(Sn,{children:Oe({instance:e.displayName??e.name})}),(0,Z.jsx)(Cn,{children:Qe()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(Rn,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Ln,{instance:e})}),(0,Z.jsx)(In,{instance:e})]})})}function In({instance:e}){let t=L(R.instanceSync.forceInstanceSync),n=K(),[r,i]=(0,Y.useState)(!1);async function a(){if(!r){i(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(wt());break;case`no_agents`:n.success(Dt());break;case`no_bridge_url`:n.error(be());break;case`deploy_misconfigured`:n.error(h());break;case`unauthorized`:n.error(Fe());break;case`not_served`:n.error(en());break;default:n.error(y());break}}catch(e){n.error(o(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:f()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(W,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?me():_e()})})]})}function Ln({instance:e}){let t=A(R.bridgeAuth.listBridgeAuthStatus,{}),n=L(R.bridgeAuth.mintBridgeSecret),r=j(R.bridgeAuth.revokeBridgeSecret),i=K(),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(null),[l,u]=(0,Y.useState)(!1),d=(t??[]).find(t=>t.instanceId===e._id),f=d!==void 0;async function p(){if(!a){o(!0);try{let t=await n({instanceId:e._id});c(t.plaintext),u(!1)}catch(e){i.error(N(),e)}finally{o(!1)}}}async function m(){if(!a){o(!0);try{await r({instanceId:e._id}),c(null),i.success(et())}catch(e){i.error(N(),e)}finally{o(!1)}}}async function h(){if(s)try{await navigator.clipboard.writeText(s),u(!0)}catch{}}return(0,Z.jsxs)($,{label:Me(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:an()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(q,{variant:f?`outline`:`secondary`,children:f?`${I()} · ${d.prefix}…${d.lastFour}`:le()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(W,{size:`sm`,onClick:()=>void p(),disabled:a,children:f?ln():at()}),f?(0,Z.jsx)(W,{size:`sm`,variant:`destructive`,onClick:()=>void m(),disabled:a,children:Qt()}):null]})]}),s?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:yt()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,Z.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>void h(),children:l?de():E()})]}),(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,onClick:()=>{c(null),u(!1)},children:F()})]}):null]})}function Rn({instanceId:e,field:t,updatedAt:n}){let r=L(R.instanceSecrets.setInstanceSecret),i=j(R.instanceSecrets.clearInstanceSecret),a=L(R.deviceIdentity.generateDeviceIdentity),o=K(),[s,c]=(0,Y.useState)(``),[l,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(!1),g=n!==null,_=t===`deviceIdentity`,v=t===`token`?Ke():t===`deviceIdentity`?Ye():oe();async function y(){if(!(!s.trim()||l)){d(!0);try{await r({instanceId:e,field:t,plaintext:s}),c(``),p(null),h(!1),o.success(Ve())}catch(e){o.error(u(),e)}finally{d(!1)}}}async function b(){if(!l){d(!0);try{await i({instanceId:e,field:t}),p(null),h(!1),o.success(fn())}catch(e){o.error(u(),e)}finally{d(!1)}}}async function ee(){if(!l){d(!0);try{let t=await a({instanceId:e});p(t),h(!1),o.success(O())}catch(e){o.error(we(),e)}finally{d(!1)}}}let x=f?`openclaw devices approve ${f.id}`:``;async function te(){if(x)try{await navigator.clipboard.writeText(x),h(!0)}catch{}}return(0,Z.jsxs)($,{label:v,children:[_?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(q,{variant:g?`outline`:`secondary`,children:g?I():le()}),(0,Z.jsx)(G,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:s,placeholder:g?Ue():w(),onChange:e=>c(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(W,{size:`sm`,onClick:()=>void y(),disabled:l||s.trim().length===0,children:ze()}),_?(0,Z.jsx)(W,{size:`sm`,variant:`outline`,onClick:()=>void ee(),disabled:l,children:Ae()}):null,g?(0,Z.jsx)(W,{size:`sm`,variant:`destructive`,onClick:()=>void b(),disabled:l,children:D()}):null]})]}),f?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:O()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:S()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:x}),(0,Z.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>void te(),children:m?de():E()})]}),(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,onClick:()=>{p(null),h(!1)},children:F()})]}):null]})}var zn={conversational:Ut,documentary:qt,summarizer:ft,curator:Nt},Bn={conversational:Ft,documentary:pt,summarizer:Xt,curator:ut},Vn=e=>(zn[e]??(()=>e))(),Hn=e=>(Bn[e]??(()=>``))();function Un({agentId:e,types:t,onToggle:n}){return(0,Z.jsxs)(`div`,{className:`oc-agentcard__types`,children:[(0,Z.jsx)(`span`,{className:`oc-agentcard__types-label`,children:Gt()}),t.map(e=>(0,Z.jsx)(q,{variant:`secondary`,className:`oc-agenttype__chip`,title:Hn(e),children:Vn(e)},e)),(0,Z.jsxs)(yn,{children:[(0,Z.jsx)(vn,{asChild:!0,children:(0,Z.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:Lt()})}),(0,Z.jsxs)(_n,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:rt()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:St()}),(0,Z.jsx)(`div`,{className:`oc-agenttypes-pop__list`,children:X.map(r=>{let i=`agtype-${e}-${r}`;return(0,Z.jsxs)(`div`,{className:`oc-agenttypes-pop__item`,children:[(0,Z.jsx)(gn,{id:i,checked:t.includes(r),onCheckedChange:()=>n(r)}),(0,Z.jsxs)(`label`,{htmlFor:i,className:`oc-agenttypes-pop__text`,children:[(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__name`,children:Vn(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:Hn(r)})]})]},r)})})]})]})]})}function Wn({instanceName:e,open:t,onOpenChange:n}){let r=A(R.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=j(R.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(R.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(R.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),o=j(R.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(R.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(R.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),s=j(R.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(R.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=jn(r);e.setQuery(R.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),c=j(R.agents.setAgentDescription).withOptimisticUpdate((e,{instanceName:t,agentId:n,description:r})=>{let i=e.getQuery(R.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=r.trim();e.setQuery(R.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,description:a.length===0?null:a}:e)})}),l=j(R.agents.removeInstanceAgent),u=j(R.agents.setAgentReservation),f=A(R.groups.listGroupLabels,t?{}:`skip`),p=Tn(),m=K();async function h(t,n){if(e&&await p({title:je({name:n}),description:pe(),confirmLabel:pn()}))try{await u({instanceName:e,agentId:t,groupId:null})}catch(e){m.error(M(),J(e))}}async function g(t,n,r){if(!e)return;let i=(f??[]).find(e=>e._id===r)?.name??`?`;if(await p({title:nt({name:n,group:i}),description:vt({group:i}),confirmLabel:xt()}))try{await u({instanceName:e,agentId:t,groupId:r})}catch(e){m.error(M(),J(e))}}async function _(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){m.error(M(),e)}}async function v(t){if(e)try{await o({instanceName:e,agentId:t})}catch(e){m.error(M(),e)}}async function y(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await s({instanceName:e,agentId:t,types:i})}catch(e){m.error(M(),e)}}async function b(t,n){if(e&&await p({title:$e({name:n}),description:qe(),confirmLabel:Xe(),destructive:!0}))try{await l({instanceName:e,agentId:t}),m.success(se())}catch(e){m.error(M(),e)}}return(0,Z.jsx)(wn,{open:t,onOpenChange:n,children:(0,Z.jsxs)(xn,{className:`oc-access`,children:[(0,Z.jsxs)(bn,{children:[(0,Z.jsx)(Sn,{children:zt({name:e??``})}),(0,Z.jsx)(Cn,{children:gt()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:Ht()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?ue():r.discovery.lastPollOk?T():We({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:Be()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(t=>{let n=t.presentInLastOk===!1,i=r.defaultAgentId===t.agentId,o=t.displayName??t.agentId,s=t.types??[];return(0,Z.jsxs)(`div`,{className:`oc-agentcard`+(t.enabled?``:` oc-agentcard--off`),children:[(0,Z.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,Z.jsx)(gn,{checked:t.enabled,disabled:n,"aria-label":o,onCheckedChange:e=>void _(t.agentId,e===!0)}),(0,Z.jsxs)(`span`,{className:`oc-agentcard__name`,title:o,children:[t.emoji?`${t.emoji} `:``,o]}),t.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:t.model}):null,t.reserved?(0,Z.jsx)(q,{variant:`outline`,children:t.reserved.groupName===null?d():He({group:t.reserved.groupName})}):null,n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(q,{variant:`outline`,className:`oc-access__gone`,children:C()}),(0,Z.jsx)(W,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void b(t.agentId,o),children:ke()})]}):i?(0,Z.jsx)(q,{variant:`default`,children:ie()}):(0,Z.jsx)(W,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!t.enabled||t.reserved!==null,onClick:()=>void v(t.agentId),children:a()})]}),t.reserved?(0,Z.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,Z.jsx)(W,{size:`sm`,variant:`outline`,className:`h-7`,onClick:()=>void h(t.agentId,o),children:pn()}),(0,Z.jsxs)(U,{value:``,onValueChange:e=>void g(t.agentId,o,e),children:[(0,Z.jsx)(B,{size:`sm`,className:`h-7`,children:(0,Z.jsx)(z,{placeholder:k()})}),(0,Z.jsx)(V,{children:(f??[]).filter(e=>e._id!==t.reserved?.groupId).map(e=>(0,Z.jsx)(H,{value:e._id,children:e.name},e._id))})]})]}):null,t.enabled?(0,Z.jsx)(Un,{agentId:t.agentId,types:s,onToggle:e=>void y(t.agentId,e,s)}):null,t.enabled?(0,Z.jsx)(Gn,{value:t.description??``,onSave:async n=>{if(e)try{await c({instanceName:e,agentId:t.agentId,description:n})}catch(e){m.error(M(),e)}}}):null]},t.agentId)})})]})]})})}function Gn({value:e,onSave:t}){let[n,r]=(0,Y.useState)(e);(0,Y.useEffect)(()=>{r(e)},[e]);let i=()=>{n.trim()!==e.trim()&&t(n)};return(0,Z.jsx)(G,{className:`oc-agentcard__desc`,value:n,maxLength:280,placeholder:jt(),"aria-label":ct(),onChange:e=>r(e.target.value),onBlur:i,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),i())}})}function $({label:e,children:t}){return(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(`span`,{className:`oc-field__label`,children:e}),t]})}export{Pn as InstancesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ah as r,Dh as i,Eh as a,Mh as o,Oh as s,Th as c,XX as l,YX as u,_R as d,bR as f,cR as p,dR as m,fR as h,gR as g,hR as _,jh as v,kh as y,lR as b,mR as x,pR as S,qX as C,t as w,uR as T,vR as E,wh as D,xR as O,yR as k}from"./api-DSJJn0d7.js";import{t as A}from"./checkbox-CsI4ggnp.js";import"./select-qM3ZfTHx.js";import{t as j}from"./button-Dio0PVrp.js";import{t as M}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{t as N}from"./badge-C4po8DQ1.js";var P=t(e(),1),F=n();function I(){let e=l(w.integrations.status.status,{}),t=u(w.admin.setIntegrationConfig),[n,i]=(0,P.useState)(null);if((0,P.useEffect)(()=>{e&&n===null&&i(e.config)},[e,n]),!e||!n)return(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:O()});let a=n,s=(e,t,n)=>i({...a,[e]:{...a[e],[t]:n}}),c=(e,n)=>void t({[e]:n});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[f(),` `,(0,F.jsx)(`strong`,{children:k()}),` `,E()]}),(0,F.jsxs)(L,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,F.jsx)(N,{variant:`secondary`,children:d()}):(0,F.jsx)(N,{variant:`outline`,children:g()}):(0,F.jsx)(N,{variant:`outline`,children:_()}),note:x(),children:[(0,F.jsx)(R,{label:h(),children:(0,F.jsx)(M,{value:a.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>s(`langfuse`,`host`,e.target.value),onBlur:()=>c(`langfuse`,{host:a.langfuse.host??``})})}),(0,F.jsx)(z,{label:p(),checked:a.langfuse.enabled??!0,onChange:e=>{s(`langfuse`,`enabled`,e),c(`langfuse`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,F.jsx)(N,{variant:`secondary`,children:d()}):(0,F.jsx)(N,{variant:`outline`,children:g()}):(0,F.jsx)(N,{variant:`outline`,children:_()}),note:S(),children:[(0,F.jsx)(R,{label:m(),children:(0,F.jsx)(M,{value:a.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>s(`opik`,`baseUrl`,e.target.value),onBlur:()=>c(`opik`,{baseUrl:a.opik.baseUrl??``})})}),(0,F.jsx)(R,{label:T(),children:(0,F.jsx)(M,{value:a.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||b(),onChange:e=>s(`opik`,`workspace`,e.target.value),onBlur:()=>c(`opik`,{workspace:a.opik.workspace??``})})}),(0,F.jsx)(z,{label:p(),checked:a.opik.enabled??!0,onChange:e=>{s(`opik`,`enabled`,e),c(`opik`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,F.jsx)(N,{variant:`secondary`,children:d()}):(0,F.jsx)(N,{variant:`outline`,children:g()}):(0,F.jsx)(N,{variant:`outline`,children:o()}),note:v(),children:[(0,F.jsx)(R,{label:r(),children:(0,F.jsx)(M,{value:a.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>s(`otlp`,`endpoint`,e.target.value),onBlur:()=>c(`otlp`,{endpoint:a.otlp.endpoint??``})})}),(0,F.jsx)(B,{headersSet:e.otlp.headersSet}),(0,F.jsx)(z,{label:p(),checked:a.otlp.enabled??!0,onChange:e=>{s(`otlp`,`enabled`,e),c(`otlp`,{enabled:e})}})]})]})}function L({title:e,status:t,note:n,children:r}){return(0,F.jsxs)(`section`,{className:`oc-int__section`,children:[(0,F.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,F.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,F.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function R({label:e,children:t}){return(0,F.jsxs)(`label`,{className:`oc-int__field`,children:[(0,F.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function z({label:e,checked:t,onChange:n}){return(0,F.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,F.jsx)(A,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,F.jsx)(`span`,{children:e})]})}function B({headersSet:e}){let t=C(w.integrations.otlpSecret.setOtlpHeaders),n=u(w.integrations.otlpSecret.clearOtlpHeaders),[r,o]=(0,P.useState)(``),[l,d]=(0,P.useState)(null),[f,p]=(0,P.useState)(!1),m=async()=>{p(!0),d(null);try{await t({headersJson:r}),o(``)}catch(e){d(e instanceof Error?e.message:String(e))}finally{p(!1)}};return(0,F.jsxs)(R,{label:y(),children:[(0,F.jsx)(M,{value:r,placeholder:e?s():i(),onChange:e=>o(e.target.value)}),(0,F.jsxs)(`div`,{className:`oc-int__otlp-headers-actions`,children:[(0,F.jsx)(j,{size:`sm`,disabled:f||r.trim().length===0,onClick:()=>void m(),children:a()}),e?(0,F.jsx)(j,{variant:`ghost`,size:`sm`,disabled:f,onClick:()=>void n({}),children:c()}):null]}),l?(0,F.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:l}):null,(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:D()})]})}export{I as IntegrationsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$v as r,Av as i,Fv as a,Lv as o,Mv as s,Qv as c,XX as l,Xv as u,YX as d,Zv as f,ay as p,ey as m,iy as h,jv as g,ny as _,ry as v,t as y,ty as b,yU as x}from"./api-DSJJn0d7.js";import{t as S}from"./loader-circle-BNhIFGdg.js";import{t as ee}from"./rotate-ccw-BD-9XzMC.js";import"./convexApi-CyScjgcq.js";import{r as C,t as w}from"./capabilities-BTqhMVxR.js";var T=t(e(),1),E={thinkingLevel:`segmented`,model:`list`,fastMode:`segmented`};function D(e,t){return E[e]===`segmented`&&t<=5?`segmented`:`list`}function O(e,t){return e!=null&&e[t]!==void 0}var k=[`inherit`,`fast`,`standard`];function A(e){return e==null||e.fastMode===void 0?`inherit`:e.fastMode?`fast`:`standard`}function j(e){return e===`inherit`?c():e===`fast`?f():u()}function M(e){return e===`inherit`?null:e===`fast`}function N(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function P(e){return e.length?e[0].toUpperCase()+e.slice(1):e}var F={off:`Off`,minimal:`Min`,low:`Low`,medium:`Med`,high:`High`,xhigh:`XHigh`};function I(e,t){return F[e]??t}function L(e){return R(e).used}function R(e){if(!e)return{used:null,source:`unknown`};let t=e.contextTokens,n=e=>e==null||t&&e>t?null:e;if(e.estimatedPromptTokens!=null)return{used:e.estimatedPromptTokens,source:`budget_estimate`};let r=n(e.activeTokens);if(r!=null)return{used:r,source:`last_call_usage`};if(e.totalTokensFresh===!1)return{used:null,source:`unknown`};let i=n(e.totalTokens);return i==null?{used:null,source:`unknown`}:{used:i,source:`last_call_usage`}}function z(e){return e?e.promptBudgetBeforeReserve!=null&&e.promptBudgetBeforeReserve>0?e.promptBudgetBeforeReserve:e.contextTokens!=null&&e.contextTokens>0?e.contextTokens:null:null}function B(e){if(!e)return null;if(e.sessionOverfull===!0)return`compaction_failed`;let t=L(e),n=z(e);return t!=null&&n!=null&&t>n?`estimate_exceeds_budget`:null}function V(e){return R(e).source}function H(e,t){return e==null||!t||t<=0?null:Math.round(e/t*100)}function U(e,t){let n=H(e,t);return n===null?null:o({pct:n,used:N(e),total:N(t)})}function W(e){return a({level:e??`full`})}function G(e,t){let n=typeof e==`number`,r=typeof t==`number`;return n&&r?s({cost:e.toFixed(2),tokens:N(t)}):n?g({cost:e.toFixed(2)}):r?i({tokens:N(t)}):null}function K(e){let t=e.filter(e=>typeof e==`string`&&e.length>0);return t.length>0?t.join(` · `):null}function q(e,t=5){let n=e?.contextPercent;if(typeof n!=`number`||!Number.isFinite(n))return null;let r=L(e),i=z(e);if(r===null||i===null)return null;let a=H(r,i);if(a===null)return null;let o=Math.abs(n-a);return o<=t?null:{gateway:n,derived:a,delta:o}}function J(e,t){let n=l(y.compat.forChat,e===null?`skip`:{chatId:e,...t?{routedAgent:t}:{}}),r=n==null?null:n.capabilities;return{can:(0,T.useCallback)(e=>w(r,e),[r]),resolved:r!==null,loading:n===void 0,gatewayVersion:n?.gatewayVersion??null,provider:n?.provider??null,beyondValidated:n?.versionBeyondValidated===!0}}var Y=n();function X(e){let t=d(y.chats.setSessionKnob),[n,r]=(0,T.useState)(null),[i,a]=(0,T.useState)(null);return{apply:(0,T.useCallback)(async(n,i)=>{r(n),a(null);let o={chatId:e};n===`fastMode`?o.fastMode=i:o[n]=i;try{await t(o)}catch{a({field:n,value:i})}finally{r(null)}},[e,t]),pending:n,error:i}}function Z({label:e,overridden:t,onReset:n,pending:r,error:i,onRetry:a,help:o,children:s,resettable:c=!0}){return(0,Y.jsxs)(`div`,{className:`oc-spanel__row${t?` is-overridden`:``}`,children:[(0,Y.jsxs)(`div`,{className:`oc-spanel__rowhead`,children:[(0,Y.jsx)(`span`,{className:`oc-spanel__label`,children:e}),r?(0,Y.jsx)(S,{size:13,className:`oc-spanel__spin`,"aria-label":v()}):t?c?(0,Y.jsx)(`button`,{type:`button`,className:`oc-spanel__reset`,title:h(),"aria-label":h(),onClick:n,children:(0,Y.jsx)(ee,{size:12,"aria-hidden":!0})}):null:(0,Y.jsx)(`span`,{className:`oc-spanel__badge`,children:p()})]}),(0,Y.jsx)(`div`,{className:`oc-spanel__ctl`,children:s}),o?(0,Y.jsx)(`p`,{className:`oc-spanel__help`,children:o}):null,i?(0,Y.jsxs)(`p`,{className:`oc-spanel__error`,role:`alert`,children:[_(),(0,Y.jsx)(`button`,{type:`button`,className:`oc-spanel__retry`,onClick:a,children:b()})]}):null]})}function Q({options:e,value:t,onChange:n,ariaLabel:r,disabled:i}){return(0,Y.jsx)(`div`,{className:`oc-spanel__seg`,role:`group`,"aria-label":r,children:e.map(e=>(0,Y.jsx)(`button`,{type:`button`,className:`oc-spanel__seg-btn${t===e.id?` is-active`:``}`,"aria-pressed":t===e.id,title:e.title??e.label,"aria-label":e.title??e.label,disabled:i,onClick:()=>{e.id!==t&&n(e.id)},children:e.label},e.id))})}function te({options:e,value:t,onChange:n,disabled:r,ariaLabel:i}){let a=t===null||e.some(e=>e.id===t);return(0,Y.jsxs)(`select`,{className:`oc-spanel__select`,value:t??``,disabled:r,"aria-label":i,onChange:e=>{e.target.value&&e.target.value!==t&&n(e.target.value)},children:[t===null?(0,Y.jsx)(`option`,{value:``,disabled:!0,children:`—`}):null,a?null:(0,Y.jsx)(`option`,{value:t,children:t}),e.map(e=>(0,Y.jsx)(`option`,{value:e.id,children:e.label},e.id))]})}function $({field:e,options:t,value:n,onChange:r,disabled:i,ariaLabel:a}){return D(e,t.length)===`list`?(0,Y.jsx)(te,{options:t,value:n,onChange:r,disabled:i,ariaLabel:a}):(0,Y.jsx)(Q,{options:t,value:n,onChange:r,disabled:i,ariaLabel:a})}function ne({chatId:e,sm:t,settings:n}){let{apply:i,pending:a,error:o}=X(e),{can:s}=J(e),c=a!==null,l=(0,T.useCallback)(()=>{o&&i(o.field,o.value)},[i,o]),u=t.thinkingLevels??[],d=t.availableModels??[],f=A(n),p=C(s,{hasModels:d.length>0,hasLevels:u.length>0});return(0,Y.jsxs)(Y.Fragment,{children:[p.model?(0,Y.jsx)(Z,{label:x(),overridden:O(n,`model`),onReset:()=>void i(`model`,null),pending:a===`model`,error:o?.field===`model`,onRetry:l,resettable:p.reset,children:(0,Y.jsx)($,{field:`model`,options:d,value:t.model??null,onChange:e=>void i(`model`,e),disabled:c,ariaLabel:x()})}):null,p.thinking?(0,Y.jsx)(Z,{label:m(),overridden:O(n,`thinkingLevel`),onReset:()=>void i(`thinkingLevel`,null),pending:a===`thinkingLevel`,error:o?.field===`thinkingLevel`,onRetry:l,resettable:p.reset,children:(0,Y.jsx)($,{field:`thinkingLevel`,ariaLabel:m(),options:u.map(e=>({id:e.id,label:I(e.id,P(e.label)),title:P(e.label)})),value:t.thinkingLevel??null,onChange:e=>void i(`thinkingLevel`,e),disabled:c})}):null,p.speed?(0,Y.jsx)(Z,{label:r(),overridden:O(n,`fastMode`),onReset:()=>void i(`fastMode`,null),pending:a===`fastMode`,error:o?.field===`fastMode`,onRetry:l,resettable:p.reset,children:(0,Y.jsx)($,{field:`fastMode`,ariaLabel:r(),options:k.map(e=>({id:e,label:j(e)})),value:f,onChange:e=>void i(`fastMode`,M(e)),disabled:c})}):null]})}export{P as a,H as c,G as d,L as f,W as g,O as h,K as i,q as l,N as m,ne as n,U as o,z as p,J as r,B as s,$ as t,V as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AO as r,CO as i,Cz as a,DO as o,EO as s,FO as c,IO as l,MO as u,NO as d,OO as f,PO as p,SO as m,Sz as h,TO as g,XX as _,Yz as v,jO as ee,kO as te,mz as y,pz as b,t as x,wO as S,wz as C,xz as w}from"./api-DSJJn0d7.js";import{n as T,t as E}from"./useNavigate-D3GIoxyW.js";import"./convexApi-CyScjgcq.js";import{c as D,n as O,o as ne}from"./searchSchemas-CS2ZgsHC.js";import{t as re}from"./appHost-CH3EGcJw.js";import{a as k,n as A,o as j,r as M,t as N}from"./card-CerX9wDn.js";import{n as P,t as F}from"./TimeRangePicker-D3PJq1H8.js";var I=t(e(),1),L={API_CALLS:`api.calls`,API_ERRORS:`api.errors`,API_LATENCY_AVG_MS:`api.latency.avg_ms`,OPENCLAW_INGEST:`openclaw.ingest`,CHAT_SEND:`chat.send`,ASSISTANT_STREAM_ERRORS:`assistant.stream.errors`,ASSISTANT_ANNOUNCE_ERRORS:`assistant.announce.errors`,CONVEX_PROBE_LATENCY_AVG_MS:`convex.probe.latency.avg_ms`},R=Object.keys(L).length,z=n(),B=15,V=e=>String(Math.round(e));function H(){let e=_(x.me.getMe,{host:re})?.permissions?.includes(`traces.read`)??!1,t=_(x.deliveryTiming.listDeliverySessions,e?{}:`skip`),n=(0,I.useMemo)(()=>t?t.filter(e=>!e.active&&e.rollup!==null&&e.rollup.cP50!==null&&e.rollup.aP50!==null).slice(0,B).reverse().map(e=>({startedAt:e.startedAt,cP50:e.rollup?.cP50,aP50:e.rollup?.aP50})):[],[t]);return t===void 0?null:(0,z.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,z.jsx)(`h2`,{className:`oc-kpi__group-title`,children:v()}),(0,z.jsxs)(N,{children:[(0,z.jsxs)(k,{children:[(0,z.jsx)(j,{children:C()}),(0,z.jsx)(M,{children:h()})]}),(0,z.jsx)(A,{children:n.length<2?(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:w()}):(0,z.jsx)(U,{series:n})})]})]})}function U({series:e}){let t=e.map(e=>e.cP50),n=e.map(e=>e.aP50),r=Math.max(1,...t,...n),i=t=>6+t*468/(e.length-1),o=e=>74-e*68/r,s=e=>e.map((e,t)=>`${t===0?`M`:`L`}${i(t).toFixed(1)},${o(e).toFixed(1)}`).join(` `),c=e[e.length-1];return(0,z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,z.jsxs)(`div`,{className:`flex gap-3 text-xs text-muted-foreground`,children:[(0,z.jsxs)(`span`,{style:{color:`var(--primary)`},children:[b(),` p50 `,V(c.cP50),` `,a()]}),(0,z.jsxs)(`span`,{children:[y(),` p50 `,V(c.aP50),` `,a()]})]}),(0,z.jsxs)(`svg`,{viewBox:`0 0 480 80`,className:`h-20 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":C(),children:[(0,z.jsx)(`path`,{d:s(n),fill:`none`,style:{stroke:`var(--muted-foreground)`},strokeWidth:1.5}),(0,z.jsx)(`path`,{d:s(t),fill:`none`,style:{stroke:`var(--primary)`},strokeWidth:1.5})]})]})}var W=[{metric:`api.calls`,label:l(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:c(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:p(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:d(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:u(),unit:`/h`,group:`Chat`,isError:!1},{metric:L.ASSISTANT_STREAM_ERRORS,label:ee(),unit:`/h`,group:`Assistant`,isError:!0},{metric:L.ASSISTANT_ANNOUNCE_ERRORS,label:r(),unit:`/h`,group:`Assistant`,isError:!0}],G=R,K=[`API`,`OpenClaw`,`Chat`,`Assistant`],q=1e3,J=36e5;function Y(e,t){let n=Math.max(1,Math.ceil((t-e)/J)),r=Math.min(n*G,q);return{rowLimit:r,buckets:Math.max(1,Math.floor(r/G))}}function ie(){let e=T({from:`/settings/kpi`}),t=E({from:`/settings/kpi`}),n=ne(e.from,e.to,O,`now`),r=e=>void t({search:t=>({...t,...D(e)})}),{from:i,to:a}=P(n),{rowLimit:c,buckets:l}=Y(i,a),u=_(x.kpi.listKpis,{limit:c,filter:{from:i,to:a}}),d=(0,I.useMemo)(()=>{let e=new Map;for(let t of u??[]){let n=e.get(t.metric)??[];n.push({bucket:t.bucket,value:t.value}),e.set(t.metric,n)}for(let[t,n]of e)n.sort((e,t)=>e.bucket<t.bucket?-1:+(e.bucket>t.bucket)),n.length>l&&e.set(t,n.slice(n.length-l));return e},[u,l]),p=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`p`,{className:`oc-admin__hint`,children:[te(),` `,(0,z.jsx)(`span`,{className:`oc-filter__window`,children:f()})]}),(0,z.jsx)(ae,{value:n,onChange:r})]});return u===void 0?(0,z.jsxs)(z.Fragment,{children:[p,(0,z.jsx)(H,{}),(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:o()})]}):u.length===0?(0,z.jsxs)(z.Fragment,{children:[p,(0,z.jsx)(H,{}),(0,z.jsx)(`p`,{className:`oc-admin__hint`,children:s()})]}):(0,z.jsxs)(z.Fragment,{children:[p,(0,z.jsx)(H,{}),K.map(e=>{let t=W.filter(t=>t.group===e);return t.some(e=>(d.get(e.metric)??[]).length>0)?(0,z.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,z.jsx)(`h2`,{className:`oc-kpi__group-title`,children:e}),(0,z.jsx)(`div`,{className:`oc-kpi__grid`,children:t.map(e=>(0,z.jsx)(oe,{config:e,series:d.get(e.metric)??[]},e.metric))})]},e):null})]})}function ae({value:e,onChange:t}){return(0,z.jsx)(`div`,{className:`oc-kpi__toolbar`,children:(0,z.jsx)(F,{value:e,onChange:t})})}function oe({config:e,series:t}){let n=t.length>0?t[t.length-1]:null,r=n?n.value:0;return(0,z.jsxs)(N,{size:`sm`,className:`oc-kpi__card`,children:[(0,z.jsxs)(k,{children:[(0,z.jsx)(j,{className:`oc-kpi__card-title`,children:e.label}),(0,z.jsx)(M,{className:`oc-kpi__card-metric`,children:(0,z.jsx)(`code`,{children:e.metric})})]}),(0,z.jsxs)(A,{className:`oc-kpi__card-body`,children:[(0,z.jsxs)(`div`,{className:`oc-kpi__value-row`,children:[(0,z.jsx)(`span`,{className:`oc-kpi__value`+(e.isError&&r>0?` oc-kpi__value--error`:``),children:Q(r)}),(0,z.jsx)(`span`,{className:`oc-kpi__unit`,children:e.unit})]}),(0,z.jsx)(ce,{series:t,isError:e.isError,unit:e.unit}),(0,z.jsxs)(`div`,{className:`oc-kpi__axis`,children:[n?(0,z.jsx)(`span`,{className:`oc-kpi__axis-latest`,children:g({value:$(n.bucket)})}):(0,z.jsx)(`span`,{className:`oc-kpi__muted`,children:S()}),(0,z.jsx)(`span`,{className:`oc-kpi__muted`,children:i({count:t.length})})]})]})]})}var X=240,Z=48,se=1;function ce({series:e,isError:t,unit:n}){if(e.length===0)return(0,z.jsx)(`div`,{className:`oc-kpi__chart oc-kpi__chart--empty`,"aria-hidden":!0});let r=e.reduce((e,t)=>t.value>e?t.value:e,0),i=X/e.length,a=Math.max(i-se,1);return(0,z.jsx)(`svg`,{className:`oc-kpi__chart`,viewBox:`0 0 ${X} ${Z}`,preserveAspectRatio:`none`,role:`img`,"aria-label":m({max:Q(r),unit:n}),children:e.map((e,o)=>{let s=r>0?e.value/r*(Z-1):0,c=o*i,l=Z-s;return(0,z.jsx)(`rect`,{className:`oc-kpi__bar`+(t&&e.value>0?` oc-kpi__bar--error`:``),x:c,y:l,width:a,height:s,children:(0,z.jsxs)(`title`,{children:[$(e.bucket),` · `,Q(e.value),` `,n]})},e.bucket)})})}function Q(e){return Number.isFinite(e)?Math.abs(e)>=1e3?(e/1e3).toFixed(e%1e3==0?0:1)+`k`:String(e):`0`}function $(e){let t=new Date(`${e}:00:00Z`);return Number.isNaN(t.getTime())?e:`${String(t.getUTCDate()).padStart(2,`0`)}/${String(t.getUTCMonth()+1).padStart(2,`0`)} ${String(t.getUTCHours()).padStart(2,`0`)}h`}export{ie as KpiTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AG as r,AX as i,BG as a,BX as o,Bc as s,CG as c,CX as l,Cc as u,DG as d,DX as f,EG as p,EX as m,Ec as h,FG as g,FX as _,HG as v,IG as ee,LG as te,MG as ne,MX as re,NG as ie,OG as ae,OX as oe,PG as se,Pc as ce,RG as le,SG as ue,SX as de,Sc as fe,TG as pe,TX as me,Tc as he,UG as ge,VG as y,XX as b,YX as x,_G as S,_X as C,aG as w,bG as T,bX as E,bc as D,cG as O,dG as k,dX as A,fG as j,fX as M,gG as N,gX as P,hG as F,hX as I,iG as L,jG as _e,jX as ve,kG as ye,kX as be,lG as xe,lX as Se,mG as Ce,mX as we,oG as Te,pG as R,pX as Ee,r as z,sG as De,t as B,uG as Oe,uI as ke,uX as Ae,vG as je,vX as Me,wG as Ne,wX as Pe,wc as Fe,xG as Ie,xX as Le,xc as Re,yG as ze,yX as Be,yc as Ve,zG as He,zc as Ue}from"./api-DSJJn0d7.js";import{t as V}from"./checkbox-CsI4ggnp.js";import{a as We,i as Ge,n as Ke,r as H,t as qe}from"./select-qM3ZfTHx.js";import{t as U}from"./button-Dio0PVrp.js";import{t as W}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{c as Je,d as Ye,r as Xe,t as Ze,u as Qe}from"./useFontScale-ByBFat3y.js";import{r as $e}from"./toast-xNFwDnUy.js";import{t as G}from"./badge-C4po8DQ1.js";import{t as K}from"./appHost-CH3EGcJw.js";import{t as et}from"./localePickerView-C2RmOS86.js";import{t as tt}from"./TimezoneCombobox-CPTpWNQm.js";var q=t(e(),1),J=n();function nt({className:e,checked:t,onCheckedChange:n,disabled:r,...i}){return(0,J.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"data-state":t?`checked`:`unchecked`,disabled:r,onClick:()=>n(!t),className:z(`peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent transition-colors outline-none`,`focus-visible:ring-2 focus-visible:ring-ring/50`,`disabled:cursor-not-allowed disabled:opacity-50`,t?`bg-primary`:`bg-input`,e),...i,children:(0,J.jsx)(`span`,{className:z(`pointer-events-none block size-4 rounded-full bg-background shadow transition-transform`,t?`translate-x-[18px]`:`translate-x-[2px]`)})})}var Y=[{id:`messages`,label:()=>ge()},{id:`composer`,label:()=>v()},{id:`sidebar`,label:()=>y()},{id:`notifications`,label:()=>Ne()},{id:`other`,label:()=>a()}],X={showSource:{category:`messages`,label:()=>He(),help:()=>le()},showReport:{category:`messages`,label:()=>te(),help:()=>ee()},copyAssistant:{category:`messages`,label:()=>g()},copyUser:{category:`messages`,label:()=>se()},showDelete:{category:`messages`,label:()=>ie()},showTools:{category:`messages`,label:()=>ne(),help:()=>_e()},voiceInput:{category:`composer`,label:()=>r(),help:()=>ye()},showUsage:{category:`composer`,label:()=>ae(),help:()=>d()},autoReadAloud:{category:`composer`,label:()=>s(),help:()=>Ue()},showChatAge:{category:`sidebar`,label:()=>p(),help:()=>pe()},notifSound:{category:`notifications`,label:()=>c(),help:()=>ue()},notifSystem:{category:`notifications`,label:()=>Ie(),help:()=>T()},replySound:{category:`notifications`,label:()=>ze(),help:()=>je()}};function Z(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function Q(e,t){let n=Z(t.trim()),r=new Map(Y.map(e=>[e.id,e.label()])),i=new Map(Y.map(e=>[e.id,[]]));for(let t of e){let e=X[t],a=e?.category??`other`;n&&!Z(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return Y.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var rt=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showUsage`,`autoReadAloud`,`notifSound`,`notifSystem`,`replySound`],it={voiceInput:`voiceInput`};function at(e){return rt.includes(e)}function $(e){return e===`admin`}function ot(e){return e===!0?`on`:e===!1?`off`:`inherit`}function st(e){return e===`on`||e!==`off`&&null}function ct(e){return at(e)?it[e]:void 0}var lt={voiceInput:()=>O()};function ut({prefKey:e,ui:t}){let n=x(B.admin.setUiPrefDefault),r=x(B.admin.setFeatureEnabled),i=ct(e),a=i?lt[e]?.():void 0;return(0,J.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,J.jsx)(`span`,{className:`oc-prefs__gov-label`,children:j()}),(0,J.jsxs)(qe,{value:ot(t.defaults[e]),onValueChange:t=>void n({key:e,value:st(t)}),children:[(0,J.jsx)(Ge,{size:`sm`,className:`w-36`,children:(0,J.jsx)(We,{})}),(0,J.jsxs)(Ke,{children:[(0,J.jsx)(H,{value:`on`,children:Te()}),(0,J.jsx)(H,{value:`off`,children:w()}),(0,J.jsx)(H,{value:`inherit`,children:L()})]})]}),i?(0,J.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,J.jsx)(V,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":k()}),k()]}):null]}),a?(0,J.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function dt({current:e,enabled:t}){let n=x(B.me.setDictationShortcut),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(!1);return(0,q.useEffect)(()=>{if(!r)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){i(!1);return}let t=Qe(e);if(t===null){[`Shift`,`Control`,`Meta`,`Alt`].includes(e.key)||(o(!0),window.setTimeout(()=>o(!1),1800));return}i(!1),n({shortcut:t})};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[r,n]),(0,J.jsxs)(`div`,{className:`oc-prefs__row${t?``:` is-locked`}`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,J.jsxs)(`span`,{className:`oc-prefs__label`,children:[h(),e?(0,J.jsx)(G,{variant:`secondary`,children:Ye(e,Je())}):null]}),(0,J.jsx)(`span`,{className:`oc-prefs__help`,children:a?u():r?Fe():he()})]}),(0,J.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[e&&!r?(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void n({shortcut:null}),children:Ve()}):null,(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,disabled:!t,"aria-pressed":r,onClick:()=>i(e=>!e),children:r?D():e?Re():fe()})]})]})}function ft(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),i=b(B.me.getMe,{host:K}),a=i?.ui,s=$(i?.role)&&n,c=x(B.me.setUiPref).withOptimisticUpdate(Xe),l=(0,q.useMemo)(()=>a?Q(Object.keys(a.effective),e):[],[a,e]);return a?(0,J.jsxs)(`div`,{className:`oc-prefs-panel`,children:[$(i?.role)?(0,J.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,J.jsx)(V,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":R()}),R()]}):null,s?(0,J.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,J.jsx)(`p`,{children:Oe()}),(0,J.jsx)(`p`,{children:xe()}),(0,J.jsx)(`p`,{children:De()})]}):null,(0,J.jsx)(W,{value:e,onChange:e=>t(e.target.value),placeholder:S(),"aria-label":S(),className:`mb-2`}),l.length===0?(0,J.jsx)(`div`,{className:`oc-prefs__empty`,children:N()}):(0,J.jsx)(`div`,{className:`oc-prefs`,children:l.map(e=>(0,J.jsxs)(`section`,{className:`oc-prefs__card`,children:[(0,J.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=X[e],n=t?t.label():e,r=t?.help?.(),i=a.locked[e],o=a.effective[e],l=a.userOverrides[e]!==void 0;return(0,J.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,J.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,J.jsx)(G,{variant:`outline`,children:F()}):l?(0,J.jsx)(G,{variant:`secondary`,children:ce()}):null]}),r?(0,J.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,J.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&l?(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void c({key:e,value:null}),children:Ce()}):null,(0,J.jsx)(nt,{checked:o,disabled:i,onCheckedChange:t=>{e===`notifSystem`&&t&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission(),c({key:e,value:t})},"aria-label":n})]}),s?(0,J.jsx)(ut,{prefKey:e,ui:a}):null]},e)})]},e.id))}),(0,J.jsx)(dt,{current:i?.dictationShortcut??null,enabled:a.effective.voiceInput===!0})]}):(0,J.jsx)(`div`,{className:`oc-prefs__empty`,children:o()})}var pt={sm:()=>E(),md:()=>Be(),lg:()=>Me(),xl:()=>C(),"2xl":()=>P(),"3xl":()=>I()};function mt(){let e=b(B.me.getMe,{host:K}),t=x(B.me.setLocale),n=x(B.me.setTimezone),r=x(B.me.setFontScale).withOptimisticUpdate((e,{scale:t})=>{let n=e.getQuery(B.me.getMe,{host:K});n&&e.setQuery(B.me.getMe,{host:K},{...n,fontScale:t,resolvedFontScale:t??`md`})}),a=x(B.me.setMyName),o=$e(),s=e?.locale??`default`,c=e?.name??``,[u,d]=(0,q.useState)(null),p=u??c,h=p.trim()!==c.trim();async function g(){try{await a({name:p}),d(null),o.success(oe())}catch(e){o.error(f(),e)}}return(0,J.jsxs)(`div`,{className:`oc-appearance`,children:[(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:re()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:ve()})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(W,{className:`max-w-xs`,value:p,maxLength:120,placeholder:i(),onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&h&&(e.preventDefault(),g())}}),(0,J.jsx)(U,{size:`sm`,disabled:!h,onClick:()=>void g(),children:ke()})]}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:be()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:m()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:me()})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[et().map(e=>(0,J.jsx)(U,{variant:s===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,J.jsx)(U,{variant:s==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:_()})]}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Pe()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:we()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Ee()})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(tt,{value:e?.timezone??``,onChange:e=>void n({timezone:e})}),(0,J.jsx)(U,{variant:e?.timezone===null||e?.timezone===void 0?`default`:`outline`,size:`sm`,onClick:()=>void n({timezone:null}),children:M()})]}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:A()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:l()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:de()})]}),(0,J.jsx)(`div`,{className:`oc-show__row`,children:Ze.map(t=>(0,J.jsx)(U,{variant:(e?.fontScale??`md`)===t?`default`:`outline`,size:`sm`,onClick:()=>void r({scale:t}),children:pt[t]()},t))}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Le()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:Ae()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Se()})]}),(0,J.jsx)(ft,{})]})]})}export{mt as PreferencesTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$D as r,$E as i,AD as a,BD as o,BX as s,CD as c,DD as l,E as u,ED as d,FD as f,ID as p,KC as m,KD as h,Ko as ee,LD as g,MD as _,OD as te,PD as v,QD as y,QE as ne,RD as b,SD as re,TD as x,UD as ie,WD as ae,XD as oe,XE as se,XX as S,YD as ce,YX as C,ZE as le,_D as ue,aD as w,aO as de,bD as fe,dD as pe,eD as me,fD as T,gD as he,gE as ge,iO as _e,jD as ve,kD as E,mD as D,nD as O,pD as ye,qo as be,rD as k,rO as xe,sD as Se,t as A,tD as j,vD as M,wD as Ce,xD as we,yD as Te}from"./api-DSJJn0d7.js";import{n as Ee,t as N}from"./useNavigate-D3GIoxyW.js";import{A as De,B as Oe,C as P,D as ke,E as F,F as Ae,G as je,H as Me,I,J as Ne,K as L,R as Pe,S as R,T as Fe,U as Ie,V as Le,W as z,_ as Re,a as B,f as V,h as ze,i as Be,j as Ve,m as He,n as H,o as U,p as W,r as Ue,s as G,t as We,u as Ge,w as Ke,x as qe,y as Je,z as Ye}from"./useStartNewChat-BszDHUjD.js";import{r as Xe}from"./dist-ClkJChBn.js";import{t as Ze}from"./chevron-right-C_b_y922.js";import{c as Qe,g as $e,i as et,n as tt,r as K,s as nt,t as rt}from"./dropdown-menu-DHMOOlaP.js";import{n as it,t as at}from"./eye-B-ipuYEd.js";import{t as ot}from"./list-eSch39T9.js";import{t as st}from"./pencil-aUWxuLhy.js";import{t as ct}from"./trash-2-B4WSfc7G.js";import{t as q}from"./button-Dio0PVrp.js";import{t as lt}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{r as ut}from"./toast-xNFwDnUy.js";import{n as dt,r as ft}from"./ConfirmDialog-BXcki0Ee.js";import{t as pt}from"./EntitySheet-B2B48bss.js";import{r as mt,t as ht}from"./trashView-Ct0Xw-a9.js";var gt=u(`columns-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),_t=u(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),vt=u(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),J=u(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Y=t(e(),1),X=n();function yt({className:e}){return(0,X.jsx)(Qe,{asChild:!0,children:(0,X.jsx)(q,{variant:`ghost`,size:`icon-xs`,"aria-label":k(),className:e,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),children:(0,X.jsx)($e,{})})})}function Z({folderId:e,name:t,color:n,currentParentId:r,className:a,onOpen:s}){let c=C(A.projects.renameProject),l=C(A.projects.setProjectColor),u=C(A.projects.moveProject),d=C(A.projects.deleteProject),f=C(A.projects.createProject),p=dt(),m=mt(),h=ft(),[ee,g]=(0,Y.useState)(!1),[_,te]=(0,Y.useState)(t),[v,y]=(0,Y.useState)(!1),[b,re]=(0,Y.useState)(!1),x=S(A.projects.projectTreeCount,b?{projectId:e}:`skip`);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(rt,{onOpenChange:e=>e&&re(!0),children:[(0,X.jsx)(yt,{className:a}),(0,X.jsxs)(tt,{align:`end`,className:`w-48`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(K,{onSelect:()=>s(),children:[(0,X.jsx)(L,{}),` `,o()]}),(0,X.jsxs)(K,{onSelect:()=>{te(t),g(!0)},children:[(0,X.jsx)(st,{}),` `,O()]}),(0,X.jsxs)(K,{onSelect:()=>{requestAnimationFrame(async()=>{let t=await h({title:ve(),label:de(),placeholder:_e(),confirmLabel:xe()});t&&await f({name:t,parentId:e})})},children:[(0,X.jsx)(je,{}),` `,ve()]}),(0,X.jsxs)(K,{onSelect:()=>y(!0),children:[(0,X.jsx)(_t,{}),` `,ye()]}),(0,X.jsx)(et,{children:i()}),(0,X.jsxs)(`div`,{className:`oc-colorgrid`,onClick:e=>e.stopPropagation(),children:[(0,X.jsx)(`button`,{className:`oc-colorgrid__none`,onClick:()=>void l({projectId:e,color:null}),"aria-label":ne(),children:`✕`}),Be.map(t=>(0,X.jsx)(`button`,{className:`oc-colorgrid__dot`+(n===t.value?` is-selected`:``),style:{background:t.hue},"aria-label":t.value,onClick:()=>void l({projectId:e,color:t.value})},t.value))]}),(0,X.jsx)(nt,{}),(0,X.jsxs)(K,{variant:`destructive`,onSelect:()=>{requestAnimationFrame(async()=>{let n=x?.folders??0,r=x?.chats??0;await p({title:ie({name:t}),description:ht({folders:n,chats:r,days:m}),confirmWord:w(),confirmLabel:ae(),destructive:!0})&&await d({projectId:e})})},children:[(0,X.jsx)(ct,{}),` `,w()]})]})]}),(0,X.jsx)(pt,{open:ee,onOpenChange:g,title:ce(),canSubmit:_.trim().length>0,onSubmit:async()=>{await c({projectId:e,name:_.trim()}),g(!1)},submitLabel:O(),children:(0,X.jsx)(lt,{value:_,onChange:e=>te(e.target.value),autoFocus:!0})}),v?(0,X.jsx)(Ue,{open:v,onOpenChange:y,title:pe(),movingFolderId:e,currentId:r,onPick:t=>void u({projectId:e,parentId:t})}):null]})}function Q({chat:e,currentFolderId:t,className:n}){let r=C(A.chats.pinChat),i=C(A.chats.deleteChat),a=C(A.chats.renameChat),o=C(A.chats.setChatSidebar),s=C(A.chats.moveChatToProject),c=dt(),l=mt(),[u,d]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(e.title??``),[m,h]=(0,Y.useState)(!1);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(rt,{children:[(0,X.jsx)(yt,{className:n}),(0,X.jsxs)(tt,{align:`end`,className:`w-52`,onClick:e=>e.stopPropagation(),children:[(0,X.jsxs)(K,{onSelect:()=>{p(e.title??``),d(!0)},children:[(0,X.jsx)(st,{}),` `,O()]}),(0,X.jsxs)(K,{onSelect:()=>void r({chatId:e._id,pinned:!e.pinned}),children:[e.pinned?(0,X.jsx)(Ye,{}):(0,X.jsx)(Oe,{}),e.pinned?j():me()]}),(0,X.jsxs)(K,{onSelect:()=>h(!0),children:[(0,X.jsx)(_t,{}),` `,D()]}),e.pinned&&e.inSidebar?null:(0,X.jsxs)(K,{onSelect:()=>void o({chatId:e._id,hidden:e.inSidebar}),children:[e.inSidebar?(0,X.jsx)(Le,{}):(0,X.jsx)(J,{}),e.inSidebar?g():b()]}),(0,X.jsx)(nt,{}),(0,X.jsxs)(K,{variant:`destructive`,onSelect:()=>{requestAnimationFrame(async()=>{await c({title:le(),description:se({days:l}),confirmLabel:w(),destructive:!0})&&await i({chatId:e._id})})},children:[(0,X.jsx)(ct,{}),` `,w()]})]})]}),(0,X.jsx)(pt,{open:u,onOpenChange:d,title:ge(),canSubmit:f.trim().length>0,onSubmit:async()=>{await a({chatId:e._id,title:f.trim()}),d(!1)},submitLabel:O(),children:(0,X.jsx)(lt,{value:f,onChange:e=>p(e.target.value),autoFocus:!0})}),m?(0,X.jsx)(Ue,{open:m,onOpenChange:h,title:T(),currentId:t,onPick:t=>void s({chatId:e._id,projectId:t})}):null]})}function bt(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>(e.title??``).toLowerCase().includes(n))}function xt(e,t,n,r,i){let a=e.map(t),o=a.indexOf(i);if(o<0)return null;let s=a.indexOf(r);if(s>=0){let t=[...e],[r]=t.splice(s,1);t.splice(o,0,r);let i=t[o-1],a=t[o+1];return{prevKey:i===void 0?null:n(i),nextKey:a===void 0?null:n(a)}}let c=e[o-1];return{prevKey:c===void 0?null:n(c),nextKey:n(e[o])}}function St(e,t){let n=new Map(t.map(e=>[e.chatId,e.lastSeenAt])),r=new Set;for(let t of e){let e=n.get(t._id);e!==void 0&&t.lastAssistantAt!==null&&t.lastAssistantAt>e&&r.add(t._id)}return r}var Ct=`oc.projpage.view`;function wt(){let e=localStorage.getItem(Ct);return e===`cards`||e===`list`?e:`columns`}var $=e=>`into:${e}`,Tt=e=>`col:${e??`null`}`,Et=e=>`crumb:${e}`;function Dt(e){if(e.startsWith(`into:`))return e.slice(5);if(e.startsWith(`crumb:`))return e.slice(6);if(e.startsWith(`col:`)){let t=e.slice(4);return t===`null`?null:t}}function Ot(){let{projectId:e}=Ne({from:`/project/$projectId`}),t=N(),n=S(A.projects.projectPage,{projectId:e});return(0,X.jsx)(`div`,{className:`oc-projpage`,children:n===void 0?(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:s()}):n===null?(0,X.jsxs)(`div`,{className:`oc-projpage__notfound`,children:[(0,X.jsx)(`h2`,{children:Te()}),(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:M()}),(0,X.jsx)(q,{variant:`outline`,onClick:()=>void t({to:`/`}),children:ue()})]}):(0,X.jsx)(kt,{page:n})})}function kt({page:e}){let t=N(),n=dt(),a=mt(),o=ft(),s=ut(),u=C(A.projects.renameProject),h=C(A.projects.setProjectColor),g=C(A.projects.deleteProject),y=C(A.projects.createProject),b=C(A.projects.moveProject),x=C(A.projects.setProjectSidebar),se=C(A.chats.moveChatToProject),le=C(A.chats.reorderChat),ue=C(A.projects.reorderProject),me=S(A.projects.projectTreeCount,{projectId:e.project._id}),[T,ge]=(0,Y.useState)(wt),E=e=>{localStorage.setItem(Ct,e),ge(e)},D=S(A.projects.folderColumns,T===`columns`?{projectId:e.project._id}:`skip`),k=S(A.projects.projectTreeList,T===`list`?{projectId:e.project._id}:`skip`),{c:j}=Ee({from:`/project/$projectId`}),M=S(A.projects.listProjects,{}),Ce=S(A.chatReads.myBusyChats,{}),Te=(0,Y.useMemo)(()=>new Set(Ce??[]),[Ce]),{byChat:Oe}=Pe(Ce??null),P=S(A.chatReads.myChatReads,{}),F=(0,Y.useMemo)(()=>St(e.chats,P??[]),[e.chats,P]),{startNewChat:I,picker:Ne}=We(e=>void t({to:`/chat/$chatId`,params:{chatId:e}})),[L,Le]=(0,Y.useState)(``),[B,V]=(0,Y.useState)(!1),[H,Ye]=(0,Y.useState)(e.project.name),[Xe,Ze]=(0,Y.useState)(!1),[J,yt]=(0,Y.useState)(``);(0,Y.useEffect)(()=>{let e=setTimeout(()=>yt(L.trim()),180);return()=>clearTimeout(e)},[L]);let Z=S(A.search.searchConversations,J.length>=2?{query:J,projectId:e.project._id}:`skip`),Q=Fe(Ke(Re,{activationConstraint:{distance:4}}),Ke(Je,{activationConstraint:{delay:250,tolerance:8}})),$=(0,Y.useRef)(!1),Tt=()=>{$.current=!0,setTimeout(()=>{$.current=!1},0)},[Et,Ot]=(0,Y.useState)(null),kt=t=>{if(t.startsWith(`chat:`)){let n=t.slice(5),i=e.chats.find(e=>e._id===n),a=D?.columns.flatMap(e=>e.chats).find(e=>e._id===n);return{kind:`chat`,label:(i??a)?.title||r()}}if(t.startsWith(`folder:`)){let e=t.slice(7);return{kind:`folder`,label:(M??[]).find(t=>t._id===e)?.name??``}}return null},Mt=e=>Ot(kt(String(e.active.id))),Pt=(0,Y.useCallback)(e=>{let t=String(e.active.id).startsWith(`folder:`),n=t=>({...e,droppableContainers:e.droppableContainers.filter(e=>String(e.id).startsWith(t))}),r=R(n(`into:`));if(r.length>0){if(!t)return r;let n=r[0],i=e.droppableRects.get(n.id),a=e.pointerCoordinates?.y;if(i&&a!=null){let e=i.height*.3;if(a>i.top+e&&a<i.top+i.height-e)return r}}let i=R(n(t?`folder:`:`chat:`));if(i.length>0)return i;let a=R(n(`crumb:`));if(a.length>0)return a;let o=R(n(`col:`));return o.length>0?o:qe(n(t?`folder:`:`chat:`))},[]),It=t=>{if(T===`columns`){for(let e of D?.columns??[])if(e.chats.some(e=>e._id===t))return{list:e.chats,folderId:e.folderId};return null}if(T===`list`){let e=k?.chats.find(e=>e._id===t);return e?{list:k.chats.filter(t=>t.folderId===e.folderId),folderId:e.folderId}:null}return e.chats.some(e=>e._id===t)?{list:e.chats,folderId:e.project._id}:null},Lt=t=>{if(T===`columns`){for(let e of D?.columns??[])if(e.folders.some(e=>e._id===t))return{list:e.folders,parentId:e.folderId};return null}if(T===`list`){let e=k?.folders.find(e=>e._id===t);if(!e||!k)return null;let n=e.parentId??k.rootId;return{list:Ve(k.folders,e.parentId),parentId:n}}return e.children.some(e=>e._id===t)?{list:e.children,parentId:e.project._id}:null},zt=async e=>{Ot(null),Tt();let{active:t,over:n}=e;if(!n)return;let r=String(n.id),i=String(t.id),a=i.startsWith(`chat:`);try{let e=Dt(r);if(e!==void 0){if(a){let t=i.slice(5);await se({chatId:t,projectId:e})}else{let t=i.slice(7);if(t===e)return;if(!De(M??[],t,e)){s.error(_());return}await b({projectId:t,parentId:e})}return}if(a&&r.startsWith(`chat:`)){let e=i.slice(5),t=r.slice(5);if(e===t)return;let n=It(t);if(!n)return;n.list.some(t=>t._id===e)||await se({chatId:e,projectId:n.folderId});let a=xt(n.list,e=>e._id,e=>e.sortKey,e,t);a&&await le({chatId:e,...a});return}if(!a&&r.startsWith(`folder:`)){let e=i.slice(7),t=r.slice(7);if(e===t)return;let n=Lt(t);if(!n)return;if(!n.list.some(t=>t._id===e)){if(!De(M??[],e,n.parentId)){s.error(_());return}await b({projectId:e,parentId:n.parentId})}let a=xt(n.list,e=>e._id,e=>e.sortKey,e,t);a&&await ue({projectId:e,...a});return}}catch{s.error(_())}},[,Bt]=(0,Y.useState)(0);(0,Y.useEffect)(()=>{let e=window.setInterval(()=>Bt(e=>e+1),6e4);return()=>window.clearInterval(e)},[]);let Vt=Date.now(),Ht=U(e.project),Ut=bt(e.chats,L),Wt=e.breadcrumb.slice(0,-1),Gt=e=>()=>{$.current||e()};return(0,X.jsx)(Ae.Provider,{value:Oe,children:(0,X.jsxs)(He,{sensors:Q,collisionDetection:Pt,onDragStart:Mt,onDragEnd:zt,children:[(0,X.jsxs)(`div`,{className:`oc-projpage__body`,style:{"--proj-hue":Ht},children:[(0,X.jsxs)(`nav`,{className:`oc-projpage__crumbs`,"aria-label":he(),children:[Wt.map(e=>(0,X.jsxs)(`span`,{className:`oc-projpage__crumb`,children:[(0,X.jsx)(At,{folderId:e._id,children:(0,X.jsx)(`button`,{type:`button`,className:`oc-projpage__crumblink`,onClick:Gt(()=>void t({to:`/project/$projectId`,params:{projectId:e._id}})),children:e.name})}),(0,X.jsx)(`span`,{className:`oc-projpage__crumbsep`,"aria-hidden":!0,children:`›`})]},e._id)),(0,X.jsx)(`span`,{className:`oc-projpage__crumbcur`,children:e.project.name})]}),(0,X.jsxs)(`header`,{className:`oc-projpage__head`,children:[(0,X.jsx)(`span`,{className:`oc-projpage__dot`,"aria-hidden":!0}),(0,X.jsx)(`h1`,{className:`oc-projpage__title`,children:e.project.name}),e.project.sidebarHidden?(0,X.jsxs)(q,{variant:`ghost`,size:`sm`,className:`oc-projpage__hiddenbadge`,title:be(),onClick:()=>{x({projectId:e.project._id,hidden:!1})},children:[(0,X.jsx)(it,{"aria-hidden":!0}),(0,X.jsx)(`span`,{children:ee()}),(0,X.jsx)(at,{"aria-hidden":!0})]}):null,(0,X.jsxs)(`div`,{className:`oc-projpage__actions`,children:[(0,X.jsxs)(`div`,{className:`oc-projpage__viewtoggle`,role:`group`,"aria-label":p(),children:[(0,X.jsx)(q,{variant:T===`cards`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":p(),title:p(),"aria-pressed":T===`cards`,onClick:()=>E(`cards`),children:(0,X.jsx)(vt,{})}),(0,X.jsx)(q,{variant:T===`columns`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":f(),title:f(),"aria-pressed":T===`columns`,onClick:()=>E(`columns`),children:(0,X.jsx)(gt,{})}),(0,X.jsx)(q,{variant:T===`list`?`secondary`:`ghost`,size:`icon-sm`,"aria-label":v(),title:v(),"aria-pressed":T===`list`,onClick:()=>E(`list`),children:(0,X.jsx)(ot,{})})]}),(0,X.jsxs)(q,{variant:`outline`,size:`sm`,onClick:()=>void I({projectId:e.project._id}),children:[(0,X.jsx)(Ie,{}),d()]}),(0,X.jsxs)(q,{variant:`outline`,size:`sm`,onClick:async()=>{let t=await o({title:ve(),label:de(),placeholder:_e(),confirmLabel:xe()});t&&await y({name:t,parentId:e.project._id})},children:[(0,X.jsx)(je,{}),ve()]}),(0,X.jsxs)(rt,{children:[(0,X.jsx)(Qe,{asChild:!0,children:(0,X.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":oe(),children:(0,X.jsx)($e,{})})}),(0,X.jsxs)(tt,{align:`end`,className:`w-48`,children:[(0,X.jsxs)(K,{onSelect:()=>{Ye(e.project.name),V(!0)},children:[(0,X.jsx)(st,{}),` `,O()]}),(0,X.jsxs)(K,{onSelect:()=>Ze(!0),children:[(0,X.jsx)(_t,{}),` `,ye()]}),(0,X.jsx)(et,{children:i()}),(0,X.jsxs)(`div`,{className:`oc-colorgrid`,children:[(0,X.jsx)(`button`,{className:`oc-colorgrid__none`,onClick:()=>void h({projectId:e.project._id,color:null}),"aria-label":ne(),children:`✕`}),Be.map(t=>(0,X.jsx)(`button`,{className:`oc-colorgrid__dot`+(e.project.color===t.value?` is-selected`:``),style:{background:t.hue},"aria-label":t.value,onClick:()=>void h({projectId:e.project._id,color:t.value})},t.value))]}),(0,X.jsx)(nt,{}),(0,X.jsxs)(K,{variant:`destructive`,onSelect:()=>{let r=e.project.parentId;requestAnimationFrame(async()=>{let i=me?.folders??0,o=me?.chats??0;await n({title:ie({name:e.project.name}),description:ht({folders:i,chats:o,days:a}),confirmWord:w(),confirmLabel:ae(),destructive:!0})&&(await g({projectId:e.project._id}),t(r===null?{to:`/`}:{to:`/project/$projectId`,params:{projectId:r}}))})},children:[(0,X.jsx)(ct,{}),` `,w()]})]})]})]})]}),T===`columns`?(0,X.jsx)(Rt,{data:D,currentId:e.project._id,busyIds:Te,suppressClick:$,locateChatId:j??null}):T===`list`?(0,X.jsx)(Ft,{data:k,busyIds:Te,suppressClick:$,locateChatId:j??null}):(0,X.jsxs)(X.Fragment,{children:[e.children.length>0?(0,X.jsxs)(`section`,{className:`oc-projpage__section`,children:[(0,X.jsx)(`h2`,{className:`oc-projpage__subtitle`,children:te()}),(0,X.jsx)(`div`,{className:`oc-projpage__cards`,children:(0,X.jsx)(G,{items:e.children.map(e=>`folder:${e._id}`),strategy:Ge,children:e.children.map(t=>(0,X.jsx)(jt,{child:t,parentId:e.project._id,now:Vt,suppressClick:$},t._id))})})]}):null,(0,X.jsxs)(`section`,{className:`oc-projpage__section`,children:[(0,X.jsxs)(`div`,{className:`oc-projpage__convhead`,children:[(0,X.jsx)(`h2`,{className:`oc-projpage__subtitle`,children:l()}),e.chats.length>0?(0,X.jsx)(lt,{value:L,onChange:e=>Le(e.target.value),placeholder:c(),className:`oc-projpage__filter`}):null]}),e.chats.length===0?(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:e.children.length===0?we():fe()}):Ut.length===0&&(Z??[]).length===0?(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:re({term:L.trim()})}):(0,X.jsx)(`ul`,{className:`oc-projpage__chats`,children:(0,X.jsx)(G,{items:Ut.map(e=>`chat:${e._id}`),strategy:W,children:Ut.map(t=>(0,X.jsx)(Nt,{chat:t,currentFolderId:e.project._id,now:Vt,busy:Te.has(t._id),unread:F.has(t._id),locate:t._id===j,suppressClick:$},t._id))})})]}),J.length>=2&&Z!==void 0?(0,X.jsxs)(`section`,{className:`oc-projpage__section`,children:[(0,X.jsx)(`h2`,{className:`oc-projpage__subtitle`,children:Se()}),Z.length===0?(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:re({term:J})}):(0,X.jsx)(`ul`,{className:`oc-projpage__chats`,children:Z.map(e=>(0,X.jsx)(`li`,{className:`oc-projpage__chatrow`,children:(0,X.jsxs)(`button`,{type:`button`,className:`oc-projpage__chatbtn`,onClick:()=>{e.messageId&&J&&ke(e.messageId,J),t({to:`/chat/$chatId`,params:{chatId:e.chatId},...e.messageId?{search:{m:e.messageId}}:{}})},children:[(0,X.jsx)(Me,{size:13,"aria-hidden":!0,className:`oc-projpage__hitico`}),(0,X.jsxs)(`span`,{className:`oc-projpage__hitbody`,children:[(0,X.jsx)(`span`,{className:`oc-projpage__chattitle`,children:e.title||m()}),e.projectPath&&e.projectPath.length>1?(0,X.jsx)(`span`,{className:`oc-projpage__hitpath`,children:e.projectPath.join(` › `)}):null,e.snippet?(0,X.jsx)(`span`,{className:`oc-projpage__hitsnippet`,children:e.snippet}):null]})]})},`${e.chatId}:${e.messageId??`t`}`))})]}):null]}),(0,X.jsx)(pt,{open:B,onOpenChange:V,title:ce(),canSubmit:H.trim().length>0,onSubmit:async()=>{await u({projectId:e.project._id,name:H.trim()}),V(!1)},submitLabel:O(),children:(0,X.jsx)(lt,{value:H,onChange:e=>Ye(e.target.value),autoFocus:!0})}),Xe?(0,X.jsx)(Ue,{open:Xe,onOpenChange:Ze,title:pe(),movingFolderId:e.project._id,currentId:e.project.parentId,onPick:t=>void b({projectId:e.project._id,parentId:t})}):null,Ne]}),(0,X.jsx)(ze,{children:Et?(0,X.jsxs)(`div`,{className:`oc-projpage__dragghost`,children:[Et.kind===`folder`?(0,X.jsx)(z,{size:13,"aria-hidden":!0}):(0,X.jsx)(Me,{size:13,"aria-hidden":!0}),(0,X.jsx)(`span`,{children:Et.label})]}):null})]})})}function At({folderId:e,children:t}){let{setNodeRef:n,isOver:r}=P({id:Et(e)});return(0,X.jsx)(`span`,{ref:n,className:r?`oc-projpage__cdrop is-over`:`oc-projpage__cdrop`,children:t})}function jt({child:e,parentId:t,now:n,suppressClick:r}){let i=N(),a=V({id:`folder:${e._id}`}),o=P({id:$(e._id)});return(0,X.jsxs)(`div`,{ref:e=>{a.setNodeRef(e),o.setNodeRef(e)},className:`oc-projpage__card`+(o.isOver?` is-over`:``)+(a.isDragging?` is-dragging`:``),style:{"--proj-hue":U(e),transform:F.Transform.toString(a.transform),transition:a.transition},onClick:()=>{r.current||i({to:`/project/$projectId`,params:{projectId:e._id}})},onKeyDown:t=>{t.key===`Enter`&&i({to:`/project/$projectId`,params:{projectId:e._id}})},...a.listeners,...a.attributes,role:`link`,tabIndex:0,children:[(0,X.jsxs)(`span`,{className:`oc-projpage__cardhead`,children:[(0,X.jsx)(z,{size:15,"aria-hidden":!0,className:`oc-projpage__cardico`}),(0,X.jsx)(`span`,{className:`oc-projpage__cardname`,children:e.name}),(0,X.jsx)(Z,{folderId:e._id,name:e.name,color:e.color,currentParentId:t,className:`oc-projpage__cardmenu`,onOpen:()=>void i({to:`/project/$projectId`,params:{projectId:e._id}})})]}),(0,X.jsxs)(`span`,{className:`oc-projpage__cardmeta`,children:[e.folderCount>0?x({count:e.folderCount})+` · `:``,Ce({count:e.recursiveChatCount})]}),e.lastActivityAt===null?null:(0,X.jsx)(`span`,{className:`oc-projpage__cardage`,children:H(e.lastActivityAt,n)})]})}function Mt({chat:e}){let t=C(A.chats.setChatSidebar),n=e.inSidebar?g():b();return(0,X.jsx)(q,{variant:`ghost`,size:`icon-xs`,"aria-label":n,title:n,className:`oc-projpage__barbtn`+(e.inSidebar?` is-on`:``),disabled:e.pinned&&e.inSidebar,onClick:n=>{n.stopPropagation(),t({chatId:e._id,hidden:e.inSidebar})},children:e.inSidebar?(0,X.jsx)(Le,{}):(0,X.jsx)(J,{})})}function Nt({chat:e,currentFolderId:t,now:n,busy:i,unread:a,locate:o,suppressClick:s}){let c=(0,Y.useContext)(Ae).get(e._id),l=N(),u=B(e.color),d=V({id:`chat:${e._id}`}),f=Pt(o);return(0,X.jsxs)(`li`,{ref:e=>{d.setNodeRef(e),f.current=e},className:`oc-projpage__chatrow`+(d.isDragging?` is-dragging`:``)+(o?` is-locate`:``),style:{transform:F.Transform.toString(d.transform),transition:d.transition},children:[(0,X.jsxs)(`button`,{type:`button`,className:`oc-projpage__chatbtn`,onClick:()=>{s.current||l({to:`/chat/$chatId`,params:{chatId:e._id}})},...d.listeners,...d.attributes,children:[u?(0,X.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:u}}):(0,X.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,X.jsx)(`span`,{className:`oc-projpage__chattitle`,children:e.title||r()}),e.pinned?(0,X.jsx)(Oe,{size:12,"aria-hidden":!0,className:`oc-projpage__chatpin`}):null,(0,X.jsx)(`span`,{className:`oc-projpage__chatage`,children:H(e.updatedAt,n)}),i?(0,X.jsx)(`span`,{className:I(c,y()).className,title:I(c,y()).label,"aria-label":I(c,y()).label}):null,a&&!i?(0,X.jsx)(`span`,{className:`oc-chatitem__unread`,title:h(),"aria-label":h()}):null]}),(0,X.jsx)(Mt,{chat:e}),(0,X.jsx)(Q,{chat:e,currentFolderId:t,className:`oc-projpage__chatmenu`})]})}function Pt(e){let t=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{e&&t.current&&t.current.scrollIntoView({block:`center`})},[e]),t}function Ft({data:e,busyIds:t,suppressClick:n,locateChatId:r}){let[i,a]=(0,Y.useState)(new Set),o=(0,Y.useMemo)(()=>{let t=new Map;for(let n of e?.chats??[]){let e=t.get(n.folderId);e===void 0?t.set(n.folderId,[n]):e.push(n)}return t},[e]);if(e===void 0)return(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:s()});if(e===null)return null;let c=e=>a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),l=(a,s)=>{let u=o.get(a??e.rootId)??[],d=Ve(e.folders,a);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(G,{items:u.map(e=>`chat:${e._id}`),strategy:W,children:u.map(e=>(0,X.jsx)(Lt,{chat:e,depth:s,busy:t.has(e._id),locate:e._id===r,suppressClick:n},e._id))}),(0,X.jsx)(G,{items:d.map(e=>`folder:${e._id}`),strategy:W,children:d.map(t=>(0,X.jsx)(It,{folder:t,parentId:a??e.rootId,depth:s,folded:i.has(t._id),onToggle:()=>c(t._id),suppressClick:n,children:i.has(t._id)?null:l(t._id,s+1)},t._id))})]})};return(0,X.jsx)(`div`,{className:`oc-projpage__tree`,children:(o.get(e.rootId)??[]).length===0&&Ve(e.folders,null).length===0?(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:we()}):l(null,0)})}function It({folder:e,parentId:t,depth:n,folded:r,onToggle:i,suppressClick:o,children:s}){let c=N(),l=V({id:`folder:${e._id}`}),u=P({id:$(e._id)});return(0,X.jsxs)(`div`,{className:`oc-projpage__treegroup`,children:[(0,X.jsxs)(`div`,{ref:e=>{l.setNodeRef(e),u.setNodeRef(e)},className:`oc-projpage__treerow oc-projpage__treerow--folder`+(u.isOver?` is-over`:``)+(l.isDragging?` is-dragging`:``),style:{"--tree-depth":n,"--proj-hue":U(e),transform:F.Transform.toString(l.transform),transition:l.transition},...l.listeners,...l.attributes,role:`button`,tabIndex:0,onClick:()=>{o.current||c({to:`/project/$projectId`,params:{projectId:e._id}})},onKeyDown:t=>{t.key===`Enter`&&c({to:`/project/$projectId`,params:{projectId:e._id}})},children:[(0,X.jsx)(`button`,{type:`button`,className:`oc-projpage__treechev`,"aria-label":r?a():E(),"aria-expanded":!r,onClick:e=>{e.stopPropagation(),!o.current&&i()},onMouseDown:e=>e.stopPropagation(),onTouchStart:e=>e.stopPropagation(),children:r?(0,X.jsx)(Ze,{size:13}):(0,X.jsx)(Xe,{size:13})}),(0,X.jsx)(z,{size:13,"aria-hidden":!0,className:`oc-projpage__colico`}),(0,X.jsx)(`span`,{className:`oc-projpage__colname`,children:e.name}),(0,X.jsx)(Z,{folderId:e._id,name:e.name,color:e.color,currentParentId:t,className:`oc-projpage__treemenu`,onOpen:()=>void c({to:`/project/$projectId`,params:{projectId:e._id}})})]}),s]})}function Lt({chat:e,depth:t,busy:n,locate:i,suppressClick:a}){let o=(0,Y.useContext)(Ae).get(e._id),s=N(),c=V({id:`chat:${e._id}`}),l=Pt(i),u=B(e.color);return(0,X.jsxs)(`div`,{ref:e=>{c.setNodeRef(e),l.current=e},className:`oc-projpage__treerow oc-projpage__treerow--chat`+(c.isDragging?` is-dragging`:``)+(i?` is-locate`:``),style:{"--tree-depth":t,transform:F.Transform.toString(c.transform),transition:c.transition},children:[(0,X.jsxs)(`button`,{type:`button`,className:`oc-projpage__colchatbtn`,onClick:()=>{a.current||s({to:`/chat/$chatId`,params:{chatId:e._id}})},...c.listeners,...c.attributes,children:[u?(0,X.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:u}}):(0,X.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,X.jsx)(`span`,{className:`oc-projpage__colname`,children:e.title||r()}),n?(0,X.jsx)(`span`,{className:I(o,``).className,"aria-hidden":!0}):null]}),(0,X.jsx)(Q,{chat:e,currentFolderId:e.folderId,className:`oc-projpage__treemenu`}),(0,X.jsx)(Mt,{chat:e})]})}function Rt({data:e,currentId:t,busyIds:n,suppressClick:r,locateChatId:i}){let a=(0,Y.useRef)(null);return(0,Y.useEffect)(()=>{let e=a.current;e&&(e.scrollLeft=e.scrollWidth)},[e?.columns.length??0,t]),e===void 0?(0,X.jsx)(`p`,{className:`oc-projpage__hint`,children:s()}):(0,X.jsx)(`div`,{className:`oc-projpage__cols`,ref:a,children:e.columns.map((a,o)=>(0,X.jsx)(zt,{col:a,isLast:o===e.columns.length-1,currentId:t,busyIds:n,suppressClick:r,locateChatId:i},a.folderId??`root`))})}function zt({col:e,isLast:t,currentId:n,busyIds:r,suppressClick:i,locateChatId:a}){let o=N(),s=P({id:Tt(e.folderId)});return(0,X.jsxs)(`div`,{ref:s.setNodeRef,className:`oc-projpage__col`+(s.isOver?` is-over`:``)+(t?` is-last`:``),children:[(0,X.jsx)(G,{items:e.folders.map(e=>`folder:${e._id}`),strategy:W,children:e.folders.map(t=>(0,X.jsx)(Bt,{folder:t,parentId:e.folderId,isCurrent:t._id===n,suppressClick:i,onOpen:()=>void o({to:`/project/$projectId`,params:{projectId:t._id}})},t._id))}),(0,X.jsx)(G,{items:e.chats.map(e=>`chat:${e._id}`),strategy:W,children:e.chats.map(t=>(0,X.jsx)(Vt,{chat:t,folderId:e.folderId,busy:r.has(t._id),locate:t._id===a,suppressClick:i,onOpen:()=>void o({to:`/chat/$chatId`,params:{chatId:t._id}})},t._id))}),e.folders.length===0&&e.chats.length===0?(0,X.jsx)(`p`,{className:`oc-projpage__colempty`,children:fe()}):null]})}function Bt({folder:e,parentId:t,isCurrent:n,suppressClick:r,onOpen:i}){let a=V({id:`folder:${e._id}`}),o=P({id:$(e._id)});return(0,X.jsxs)(`div`,{ref:e=>{a.setNodeRef(e),o.setNodeRef(e)},className:`oc-projpage__colentry oc-projpage__colentry--folder`+(e.selected||n?` is-selected`:``)+(o.isOver?` is-over`:``)+(a.isDragging?` is-dragging`:``),style:{"--proj-hue":U(e),transform:F.Transform.toString(a.transform),transition:a.transition},onClick:()=>{r.current||i()},onKeyDown:e=>{e.key===`Enter`&&e.target===e.currentTarget&&i()},...a.listeners,...a.attributes,role:`button`,tabIndex:0,children:[(0,X.jsx)(z,{size:13,"aria-hidden":!0,className:`oc-projpage__colico`}),(0,X.jsx)(`span`,{className:`oc-projpage__colname`,children:e.name}),(0,X.jsx)(`span`,{className:`oc-projpage__colchev`,"aria-hidden":!0,children:`›`}),(0,X.jsx)(Z,{folderId:e._id,name:e.name,color:e.color,currentParentId:t,className:`oc-projpage__colmenu`,onOpen:i})]})}function Vt({chat:e,folderId:t,busy:n,locate:i,suppressClick:a,onOpen:o}){let s=(0,Y.useContext)(Ae).get(e._id),c=V({id:`chat:${e._id}`}),l=Pt(i),u=B(e.color);return(0,X.jsxs)(`div`,{ref:e=>{c.setNodeRef(e),l.current=e},className:`oc-projpage__colentry oc-projpage__colentry--chat`+(c.isDragging?` is-dragging`:``)+(i?` is-locate`:``),style:{transform:F.Transform.toString(c.transform),transition:c.transition},children:[(0,X.jsxs)(`button`,{type:`button`,className:`oc-projpage__colchatbtn`,onClick:()=>{a.current||o()},...c.listeners,...c.attributes,children:[u?(0,X.jsx)(`span`,{className:`oc-chatitem__dot`,style:{background:u}}):(0,X.jsx)(`span`,{className:`oc-chatitem__dot oc-chatitem__dot--empty`}),(0,X.jsx)(`span`,{className:`oc-projpage__colname`,children:e.title||r()}),n?(0,X.jsx)(`span`,{className:I(s,``).className,"aria-hidden":!0}):null]}),(0,X.jsx)(Q,{chat:e,currentFolderId:t,className:`oc-projpage__colmenu oc-projpage__colmenu--chat`}),(0,X.jsx)(Mt,{chat:e})]})}export{Ot as ProjectPage};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$k as r,CA as i,Cf as a,Du as o,Ou as s,Qk as c,SA as l,Sf as u,Uo as d,XX as f,Xk as p,YX as m,Zk as h,aA as g,cA as _,dA as v,df as y,eA as b,fA as x,ff as ee,fm as te,gm as S,hA as C,hm as w,iA as T,ku as E,lA as D,mA as ne,mf as re,mm as ie,nA as ae,oA as oe,pA as se,pf as ce,pm as O,rA as k,sA as A,t as j,tA as M,uA as N,uf as P,wf as F,xf as I}from"./api-DSJJn0d7.js";import{i as L,n as R,r as z,t as B}from"./FieldLabel-Tea3wyVe.js";import{t as V}from"./checkbox-CsI4ggnp.js";import{a as H,c as le,o as U,s as W}from"./tooltip-v_AyOWn6.js";import{a as G,i as K,n as q,r as J,t as Y}from"./select-qM3ZfTHx.js";import{t as X}from"./button-Dio0PVrp.js";import{r as ue}from"./toast-xNFwDnUy.js";import{t as de}from"./appHost-CH3EGcJw.js";import{r as Z,t as fe}from"./locales-CPjguROj.js";import{t as pe}from"./localePickerView-C2RmOS86.js";/* empty css */var Q=t(e(),1),$=n(),me={media_delivery:{label:N,help:D},documentary_fetch:{label:_,help:A},inbound_files:{label:oe,help:g},history_summary:{label:S,help:w},file_curation:{label:F,help:re},quote_reply:{label:a,help:u}},he={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
|
|
2
|
-
- gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`,previous_summary:`Projet Alpha : budget 40 000 EUR ; choix du serveur en cours.`,new_messages:`Utilisateur : Compare OVH et Scaleway.
|
|
3
|
-
Assistant : Comparaison en cours.`,max_chars:`6000`,file_name:`MEMORY.md`,budget_chars:`20000`,feedback:`Trop de suppressions dans la section des liens, garde-les.`,content:`# Memory index
|
|
4
|
-
- [Fait 1](fait-1.md) - note du projet`,excerpt:`Le classement propose trois dossiers : Clients, Fournisseurs, Interne.`},ge={outboundDir:c,references:h,files:p,previous_summary:ie,new_messages:O,max_chars:te,file_name:ce,budget_chars:ee,feedback:y,content:P,excerpt:I};function _e(){let e=f(j.admin.listInstances,{}),[t,n]=(0,Q.useState)(null);if(e===void 0)return(0,$.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,$.jsx)(`div`,{className:`oc-injtab`,children:(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:k()})});let r=e.find(e=>e._id===t)??e[0];return(0,$.jsxs)(`div`,{className:`oc-injtab`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,$.jsx)(R,{label:C(),help:ne()}),(0,$.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,$.jsx)(`span`,{children:T()}),(0,$.jsxs)(Y,{value:r._id,onValueChange:e=>n(e),children:[(0,$.jsx)(K,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(G,{})}),(0,$.jsx)(q,{children:e.map(e=>(0,$.jsx)(J,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,$.jsx)(ve,{instance:r},r._id)]})}function ve({instance:e}){let t=m(j.admin.upsertInstanceConfig),n=ue(),r=f(j.me.getMe,{host:de}),a=e.config??{},c=Z(e.config?.contentLocale,r?.defaultLocale??void 0),[u,d]=(0,Q.useState)(()=>L(a,c));(0,Q.useEffect)(()=>{d(L(a,c))},[c,e._id]);let[p,h]=(0,Q.useState)(!1),g=u.promptInjections,_=(e,t)=>d({...u,promptInjections:{...g,[e]:{...g[e],...t}}});async function v(){h(!0);try{await t({instanceId:e._id,config:z(u,a,c)})}catch(e){n.error(l(),e)}finally{h(!1)}}async function y(r){let i={...e.config??{}};r==="default"?delete i.contentLocale:i.contentLocale=r;try{await t({instanceId:e._id,config:i})}catch(e){n.error(l(),e)}}let b=e.config?.contentLocale??`default`,x=fe[Z(void 0,r?.defaultLocale??void 0)];return(0,$.jsxs)(`div`,{className:`oc-injtab__body`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__content-locale`,children:[(0,$.jsx)(`span`,{children:E()}),(0,$.jsxs)(Y,{value:b,onValueChange:e=>void y(e),children:[(0,$.jsx)(K,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(G,{})}),(0,$.jsxs)(q,{children:[(0,$.jsx)(J,{value:`default`,children:o({locale:x})}),pe().map(e=>(0,$.jsx)(J,{value:e.value,children:e.label},e.value))]})]}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:s()})]}),U.map(e=>(0,$.jsx)(ye,{injKey:e,def:H[e],i18n:me[e],row:g[e]??{enabled:!0,template:H[e].defaultTemplate[c]},contentLocale:c,onChange:t=>_(e,t)},e)),(0,$.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,$.jsx)(X,{size:`sm`,onClick:()=>void v(),disabled:p,children:i()})})]})}function ye({injKey:e,def:t,i18n:n,row:i,contentLocale:a,onChange:o}){let[s,c]=(0,Q.useState)(!1),l=i.template.trim()!==t.defaultTemplate[a],u=t.togglable&&!i.enabled,f=Object.fromEntries(t.placeholders.map(e=>[e,he[e]??`{${e}}`])),p=W(e,i,a),m=p?le(p,f):``;return(0,$.jsxs)(`section`,{className:`oc-injcard`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,$.jsxs)(`label`,{className:`oc-field--row`,children:[(0,$.jsx)(V,{checked:i.enabled,onCheckedChange:e=>o({enabled:e===!0})}),(0,$.jsx)(R,{label:n.label(),help:n.help()})]}):(0,$.jsx)(R,{label:n.label(),help:n.help()}),l&&(0,$.jsx)(`span`,{className:`oc-injection__badge`,children:x()})]}),(0,$.jsx)(`textarea`,{className:`oc-injcard__text`,value:i.template,disabled:u,rows:8,spellCheck:!1,onChange:e=>o({template:e.target.value})}),(0,$.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:v()}),t.placeholders.map(e=>(0,$.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,$.jsx)(`code`,{children:`{${e}}`}),(0,$.jsx)(B,{text:(ge[e]??(()=>e))()})]},e))]}),(0,$.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,$.jsx)(X,{variant:`ghost`,size:`sm`,onClick:()=>c(e=>!e),children:s?M():ae()}),l&&(0,$.jsx)(X,{variant:`ghost`,size:`sm`,onClick:()=>o({template:t.defaultTemplate[a]}),children:se()})]})]}),s&&(0,$.jsx)(`div`,{className:`oc-injcard__preview`,children:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:m}),(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:b()}),t.pluralDefaultTemplate!==void 0&&!u?(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:d()}):null]}):(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:r()})})]})}export{_e as PromptInjectionsTab};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$N as r,AN as ee,FN as te,GN as i,IN as a,JN as ne,Jf as o,KN as s,LN as re,MN as c,NN as ie,PN as ae,QN as l,UN as u,WN as d,XN as f,XX as p,YN as m,YX as h,ZN as g,_P as _,aP as v,cP as y,dP as b,eP as oe,fP as x,gP as S,hP as C,iP as w,jN as T,kN as E,lP as D,mP as O,nP as k,oP as A,pP as j,qN as M,rP as N,sP as P,t as F,tP as I,uP as L,vP as R,yP as z}from"./api-DSJJn0d7.js";import{t as B}from"./lock-0lxfSnTE.js";import{t as V}from"./checkbox-CsI4ggnp.js";import{t as H}from"./button-Dio0PVrp.js";import{t as U}from"./input-BSpTsBA6.js";import"./convexApi-CyScjgcq.js";import{r as W}from"./toast-xNFwDnUy.js";import{t as G}from"./badge-C4po8DQ1.js";import{n as K}from"./ConfirmDialog-BXcki0Ee.js";import{t as q}from"./EntitySheet-B2B48bss.js";import{t as J}from"./roleDescriptions-x3mUxTcX.js";var Y=t(e(),1),X=n(),Z=[{group:()=>z(),keys:[{key:`traces.read`,label:()=>O()},{key:`traces.read.content`,label:()=>j(),phi:!0},{key:`traces.write`,label:()=>x()}]},{group:()=>R(),keys:[{key:`kpi.read`,label:()=>O()},{key:`kpi.write`,label:()=>x()}]},{group:()=>_(),keys:[{key:`openclaw.query`,label:()=>b()},{key:`anomalies.read`,label:()=>L()},{key:`anomalies.report`,label:()=>D()}]},{group:()=>S(),keys:[{key:`chats.read`,label:()=>O()},{key:`selfheal`,label:()=>P()},{key:`media.repair`,label:()=>A()},{key:`feedback.respond`,label:()=>o()}]},{group:()=>C(),keys:[{key:`admin.manage`,label:()=>y()}]}],se=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function ce(){let e=p(F.apiKeys.listRoles,{}),t=h(F.apiKeys.createRole),n=h(F.apiKeys.ensureRolesSeeded),o=h(F.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(F.apiKeys.listRoles,{});r&&e.setQuery(F.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),_=K(),y=W(),[b,x]=(0,Y.useState)(!1),[S,C]=(0,Y.useState)($),[D,O]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{y.error(w(),e)})},[n,y]);let A=e??[];async function j(e,t){if(Q(e.permissions))return;if(e.builtin){await _({title:N({name:e.name}),description:k(),confirmLabel:I()});return}if(D.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];O(t=>new Set(t).add(e._id));try{await o({roleId:e._id,permissions:n})}catch(e){y.error(oe(),e)}finally{O(t=>{let n=new Set(t);return n.delete(e._id),n})}}async function P(){try{await t({key:S.key,name:S.name,description:S.description||void 0,permissions:[]}),C($),x(!1)}catch(e){y.error(r(),e)}}let L=e===void 0,R=!L&&A.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[l(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,g(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,f()]}),(0,X.jsxs)(`div`,{className:`oc-dt`,children:[(0,X.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,X.jsx)(`h2`,{className:`oc-dt__title`,children:m()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(H,{size:`sm`,onClick:()=>{C($),x(!0)},children:ne()})})]}),L?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:M()}):R?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,X.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,X.jsxs)(`table`,{className:`oc-matrix`,children:[(0,X.jsxs)(`thead`,{children:[(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:i()}),Z.map(e=>(0,X.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,X.jsx)(`tr`,{children:Z.flatMap(e=>e.keys.map(e=>(0,X.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?v({key:e.key}):e.key,children:[e.label(),e.phi?(0,X.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,X.jsx)(`tbody`,{children:A.map(e=>{let t=Q(e.permissions),n=D.has(e._id);return(0,X.jsxs)(`tr`,{children:[(0,X.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,X.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,X.jsx)(`span`,{children:e.name}),(0,X.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,X.jsxs)(G,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(B,{}),` `,d()]}):(0,X.jsx)(G,{variant:`secondary`,children:u()})]}),J(e)?(0,X.jsx)(`p`,{className:`oc-matrix__roledesc`,children:J(e)}):null]}),se.map(r=>(0,X.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,X.jsx)(V,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?re():n?a():r,onCheckedChange:()=>void j(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(q,{open:b,onOpenChange:x,title:te(),description:ae(),canSubmit:!!(S.key&&S.name),onSubmit:P,submitLabel:ie(),children:(0,X.jsxs)(`div`,{className:`oc-form`,children:[(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:c()}),(0,X.jsx)(U,{value:S.key,placeholder:T(),onChange:e=>C({...S,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:ee()}),(0,X.jsx)(U,{value:S.name,onChange:e=>C({...S,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:E()}),(0,X.jsx)(U,{value:S.description,onChange:e=>C({...S,description:e.target.value})})]})]})})]})}export{ce as RolesTab};
|