@lacneu/atrium 0.19.3 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/assets/AccessTab-BpmHOH2b.js +1 -0
  2. package/dist/assets/{AdvancedFilter-GcKYGafW.js → AdvancedFilter-BOBkqtk6.js} +1 -1
  3. package/dist/assets/AgentFilesTab-A7KIKZuy.js +3 -0
  4. package/dist/assets/AnomaliesTab-D1oMEdo7.js +1 -0
  5. package/dist/assets/{AuditTab-BuIOG3Jy.js → AuditTab-CGfU9rSl.js} +1 -1
  6. package/dist/assets/BridgeTab-wIiXQVx4.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-BiAi9i7q.js +1 -0
  8. package/dist/assets/{DataTableShell-CXnilHFx.js → DataTableShell-DRaoMzdi.js} +1 -1
  9. package/dist/assets/{DetailChips-DwhF4wyT.js → DetailChips-BJRTpKvv.js} +1 -1
  10. package/dist/assets/FeedbacksTab-DXt9vggG.js +1 -0
  11. package/dist/assets/FieldLabel-DG-U2yJD.js +15 -0
  12. package/dist/assets/FilesTab-D6N2e-YF.js +1 -0
  13. package/dist/assets/{FilterBar-DZweUsOp.js → FilterBar-BBJk4kP8.js} +1 -1
  14. package/dist/assets/GroupsTab-Bd8LlkxI.js +1 -0
  15. package/dist/assets/InstancesTab-0V2J2Qtq.js +1 -0
  16. package/dist/assets/IntegrationsTab-pGZl_dNY.js +1 -0
  17. package/dist/assets/KpiTab-B3XVJcNt.js +1 -0
  18. package/dist/assets/PreferencesTab-Cj6tC2ZE.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-_BUqUmC6.js +3 -0
  20. package/dist/assets/RolesTab-PbMAqWrZ.js +1 -0
  21. package/dist/assets/ServiceAccountsTab-Bau7cms3.js +1 -0
  22. package/dist/assets/SubAgentReportsTab-CzaVSPFb.js +1 -0
  23. package/dist/assets/ThemeShowroom-COaylZ2W.js +1 -0
  24. package/dist/assets/{TimeRangePicker-DatsuATN.js → TimeRangePicker-CAhWZBEI.js} +1 -1
  25. package/dist/assets/TracesTab-B0uGrcLJ.js +1 -0
  26. package/dist/assets/UsersTab-C6Ulyvwq.js +1 -0
  27. package/dist/assets/button-CoB18od4.js +1 -0
  28. package/dist/assets/{card-DtbnXpuR.js → card-4N7N5yEr.js} +1 -1
  29. package/dist/assets/chevrons-up-down-CaKfHJNA.js +1 -0
  30. package/dist/assets/{compatView-Be0h8KSS.js → compatView-5hziRv_l.js} +1 -1
  31. package/dist/assets/dispatchErrorInfo-DsgZO0if.js +1 -0
  32. package/dist/assets/{dist-CSHwMvoK.js → dist-B-U7A_Kp.js} +1 -1
  33. package/dist/assets/dist-BNEZtSYw.js +1 -0
  34. package/dist/assets/dist-BN_-yUvA.js +5 -0
  35. package/dist/assets/{dist-C4sB9wBS.js → dist-C_wXViAC.js} +1 -1
  36. package/dist/assets/{highlighted-body-OFNGDK62-CJvkRtvs.js → highlighted-body-OFNGDK62-ClkcrmUm.js} +1 -1
  37. package/dist/assets/index-B6IXWbc8.js +227 -0
  38. package/dist/assets/{index-B9tfYPkk.css → index-Baso9Ryo.css} +1 -1
  39. package/dist/assets/mermaid-GHXKKRXX-BnwtjR3q.js +1 -0
  40. package/dist/assets/roleDescriptions-C3lIPjqc.js +1 -0
  41. package/dist/assets/{table-Cr9ARpxr.js → table-CEVcfIlY.js} +1 -1
  42. package/dist/assets/{tabs-CSXMDWZx.js → tabs-DTsAt8vZ.js} +1 -1
  43. package/dist/assets/x-Dl0sHEar.js +1 -0
  44. package/dist/index.html +8 -8
  45. package/package.json +1 -1
  46. package/dist/assets/AccessTab-DlXLRwUN.js +0 -1
  47. package/dist/assets/AgentFilesTab-ClqrQ6FL.js +0 -3
  48. package/dist/assets/AnomaliesTab-B817-fvy.js +0 -1
  49. package/dist/assets/BridgeTab-BrpHY1vH.js +0 -1
  50. package/dist/assets/ChatDefaultsTab-BiJe_6Kb.js +0 -1
  51. package/dist/assets/FeedbacksTab-Xo97w2yq.js +0 -1
  52. package/dist/assets/FieldLabel-DszF6BCc.js +0 -4
  53. package/dist/assets/FilesTab-fin_A9Kl.js +0 -1
  54. package/dist/assets/GroupsTab-wn-dxXIg.js +0 -1
  55. package/dist/assets/InstancesTab-BfgriPCp.js +0 -1
  56. package/dist/assets/IntegrationsTab-CknAQ8o3.js +0 -1
  57. package/dist/assets/KpiTab-_sVoFsUQ.js +0 -1
  58. package/dist/assets/PreferencesTab-CrFE2Xny.js +0 -1
  59. package/dist/assets/PromptInjectionsTab-BOdO-Zqo.js +0 -2
  60. package/dist/assets/RolesTab-D4pjVazK.js +0 -1
  61. package/dist/assets/ServiceAccountsTab-DAXUZYQJ.js +0 -1
  62. package/dist/assets/SubAgentReportsTab-BwoSqlZ2.js +0 -1
  63. package/dist/assets/ThemeShowroom-BIP8Pxk3.js +0 -1
  64. package/dist/assets/TracesTab-BhjH9l6x.js +0 -1
  65. package/dist/assets/UsersTab-B0_VG_cI.js +0 -1
  66. package/dist/assets/button-Do9b0Kl0.js +0 -1
  67. package/dist/assets/chevrons-up-down-BNHrpyID.js +0 -1
  68. package/dist/assets/dispatchErrorInfo-CNHPv3Dl.js +0 -1
  69. package/dist/assets/dist-DbJm5w2u.js +0 -5
  70. package/dist/assets/dist-DyqGXOsj.js +0 -1
  71. package/dist/assets/index-Djd_7VwF.js +0 -227
  72. package/dist/assets/mermaid-GHXKKRXX-DmtRrsIr.js +0 -1
  73. package/dist/assets/roleDescriptions-Me-Y5Y5f.js +0 -1
  74. package/dist/assets/x-DxTaDbZb.js +0 -1
@@ -0,0 +1 @@
1
+ import{D as e}from"./index-B6IXWbc8.js";export{e as Mermaid};
@@ -0,0 +1 @@
1
+ import{Jm as e,Xm as t,Ym as n,Zm as r,qm as i}from"./dist-B-U7A_Kp.js";var a={pending:r,user:t,admin:n,observer:e,agent:i};function o(e){if(e.builtin){let t=a[e.key];if(t)return t()}return e.description}export{o as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-CSHwMvoK.js";e();var r=t();function i({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:n(`w-full caption-bottom text-sm`,e),...t})})}function a({className:e,...t}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:n(`[&_tr]:border-b`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:n(`[&_tr:last-child]:border-0`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:n(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:n(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:n(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}export{a,c as i,o as n,s as o,l as r,i as t};
1
+ import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-B-U7A_Kp.js";e();var r=t();function i({className:e,...t}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:n(`w-full caption-bottom text-sm`,e),...t})})}function a({className:e,...t}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:n(`[&_tr]:border-b`,e),...t})}function o({className:e,...t}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:n(`[&_tr:last-child]:border-0`,e),...t})}function s({className:e,...t}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:n(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function c({className:e,...t}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:n(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function l({className:e,...t}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:n(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}export{a,c as i,o as n,s as o,l as r,i as t};
@@ -1 +1 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{dD as r,iD as i,n as a,nD as o,rD as s,sD as c,t as l,uD as u}from"./dist-CSHwMvoK.js";import{t as d}from"./dist-DyqGXOsj.js";import{dt as f,ft as p,pt as m}from"./index-Djd_7VwF.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=c(_,[m]),b=m(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:a,onValueChange:s,defaultValue:c,orientation:l=`horizontal`,dir:u,activationMode:f=`automatic`,...p}=e,m=d(u),[h,v]=i({prop:a,onChange:s,defaultProp:c??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:o(),value:h,onValueChange:v,orientation:l,dir:m,activationMode:f,children:(0,g.jsx)(r.div,{dir:m,"data-orientation":l,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:i=!0,...a}=e,o=S(w,n),s=b(n);return(0,g.jsx)(p,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:i,children:(0,g.jsx)(r.div,{role:`tablist`,"aria-orientation":o.orientation,...a,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,disabled:a=!1,...o}=e,s=S(E,n),c=b(n),l=A(s.baseId,i),d=j(s.baseId,i),p=i===s.value;return(0,g.jsx)(f,{asChild:!0,...c,focusable:!a,active:p,children:(0,g.jsx)(r.button,{type:`button`,role:`tab`,"aria-selected":p,"aria-controls":d,"data-state":p?`active`:`inactive`,"data-disabled":a?``:void 0,disabled:a,id:l,...o,ref:t,onMouseDown:u(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?s.onValueChange(i):e.preventDefault()}),onKeyDown:u(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&s.onValueChange(i)}),onFocus:u(e.onFocus,()=>{let e=s.activationMode!==`manual`;!p&&!a&&e&&s.onValueChange(i)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,forceMount:a,children:o,...c}=e,l=S(O,n),u=A(l.baseId,i),d=j(l.baseId,i),f=i===l.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(s,{present:a||f,children:({present:n})=>(0,g.jsx)(r.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!n,id:d,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&o})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,className:a(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=l(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:a(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:a(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:a(`flex-1 text-sm outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
1
+ import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{HD as r,UD as i,WD as a,XD as o,ZD as s,n as c,qD as l,t as u}from"./dist-B-U7A_Kp.js";import{t as d}from"./dist-BNEZtSYw.js";import{dt as f,ft as p,pt as m}from"./index-B6IXWbc8.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=l(_,[m]),b=m(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,onValueChange:o,defaultValue:c,orientation:l=`horizontal`,dir:u,activationMode:f=`automatic`,...p}=e,m=d(u),[h,v]=a({prop:i,onChange:o,defaultProp:c??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:r(),value:h,onValueChange:v,orientation:l,dir:m,activationMode:f,children:(0,g.jsx)(s.div,{dir:m,"data-orientation":l,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=S(w,n),o=b(n);return(0,g.jsx)(p,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(s.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,c=S(E,n),l=b(n),u=A(c.baseId,r),d=j(c.baseId,r),p=r===c.value;return(0,g.jsx)(f,{asChild:!0,...l,focusable:!i,active:p,children:(0,g.jsx)(s.button,{type:`button`,role:`tab`,"aria-selected":p,"aria-controls":d,"data-state":p?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:u,...a,ref:t,onMouseDown:o(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?c.onValueChange(r):e.preventDefault()}),onKeyDown:o(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&c.onValueChange(r)}),onFocus:o(e.onFocus,()=>{let e=c.activationMode!==`manual`;!p&&!i&&e&&c.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:a,children:o,...c}=e,l=S(O,n),u=A(l.baseId,r),d=j(l.baseId,r),f=r===l.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(i,{present:a||f,children:({present:n})=>(0,g.jsx)(s.div,{"data-state":f?`active`:`inactive`,"data-orientation":l.orientation,role:`tabpanel`,"aria-labelledby":u,hidden:!n,id:d,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&o})})});k.displayName=O;function A(e,t){return`${e}-trigger-${t}`}function j(e,t){return`${e}-content-${t}`}var M=C,N=T,P=D,F=k;function I({className:e,orientation:t=`horizontal`,...n}){return(0,g.jsx)(M,{"data-slot":`tabs`,"data-orientation":t,className:c(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=u(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function R({className:e,variant:t=`default`,...n}){return(0,g.jsx)(N,{"data-slot":`tabs-list`,"data-variant":t,className:c(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:c(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,e),...t})}function B({className:e,...t}){return(0,g.jsx)(F,{"data-slot":`tabs-content`,className:c(`flex-1 text-sm outline-none`,e),...t})}export{z as i,B as n,R as r,I as t};
@@ -0,0 +1 @@
1
+ import{aO as e}from"./dist-B-U7A_Kp.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
package/dist/index.html CHANGED
@@ -38,15 +38,15 @@
38
38
  document.documentElement.dataset.ambiance = a === "off" ? "off" : "on";
39
39
  })();
40
40
  </script>
41
- <script type="module" crossorigin src="/assets/index-Djd_7VwF.js"></script>
41
+ <script type="module" crossorigin src="/assets/index-B6IXWbc8.js"></script>
42
42
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
43
- <link rel="modulepreload" crossorigin href="/assets/dist-CSHwMvoK.js">
44
- <link rel="modulepreload" crossorigin href="/assets/dist-DyqGXOsj.js">
45
- <link rel="modulepreload" crossorigin href="/assets/dist-DbJm5w2u.js">
46
- <link rel="modulepreload" crossorigin href="/assets/dist-C4sB9wBS.js">
47
- <link rel="modulepreload" crossorigin href="/assets/x-DxTaDbZb.js">
48
- <link rel="modulepreload" crossorigin href="/assets/button-Do9b0Kl0.js">
49
- <link rel="stylesheet" crossorigin href="/assets/index-B9tfYPkk.css">
43
+ <link rel="modulepreload" crossorigin href="/assets/dist-B-U7A_Kp.js">
44
+ <link rel="modulepreload" crossorigin href="/assets/dist-BNEZtSYw.js">
45
+ <link rel="modulepreload" crossorigin href="/assets/dist-BN_-yUvA.js">
46
+ <link rel="modulepreload" crossorigin href="/assets/dist-C_wXViAC.js">
47
+ <link rel="modulepreload" crossorigin href="/assets/x-Dl0sHEar.js">
48
+ <link rel="modulepreload" crossorigin href="/assets/button-CoB18od4.js">
49
+ <link rel="stylesheet" crossorigin href="/assets/index-Baso9Ryo.css">
50
50
  </head>
51
51
  <body>
52
52
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lacneu/atrium",
3
- "version": "0.19.3",
3
+ "version": "0.21.0",
4
4
  "description": "Atrium — public, self-hostable, Convex-backed web chat UI for AI agent gateways (OpenClaw today, Hermes next). Ships an origin-agnostic static bundle (Convex URL injected at runtime via /config.json).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$a as r,GE as i,Ja as a,Qa as o,TD as s,Xa as c,Ya as l,Za as u,ao as d,co as f,eo as p,io as m,no as h,oo as g,ro as _,so as v,to as y,vD as b}from"./dist-CSHwMvoK.js";import{C as x,S,X as C,b as w,x as T,y as E}from"./index-Djd_7VwF.js";var D=t(e(),1);function O(e){return e===`user`?o():e===`all`?u():c({group:e.group})}function k(e){return e===`common`?l():e===`owner`?a():c({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=s(b.admin.listUsers,{}),[t,n]=(0,D.useState)(``),a=s(b.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:f()}),(0,A.jsxs)(E,{value:t,onValueChange:n,children:[(0,A.jsx)(S,{size:`sm`,"aria-label":v(),children:(0,A.jsx)(x,{placeholder:v()})}),(0,A.jsx)(w,{children:(e??[]).map(e=>(0,A.jsx)(T,{value:e.userId,children:j(e)},e._id))})]}),t===``?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:g()}):a===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):(0,A.jsxs)(`div`,{className:`oc-introspect`,children:[(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:d()}),(0,A.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,A.jsx)(`strong`,{children:a.user.label}),(0,A.jsx)(C,{variant:`secondary`,children:a.role})]})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:m()}),a.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:a.groups.map(e=>(0,A.jsx)(C,{variant:`secondary`,children:e.name},e.groupId))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:_()}),a.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:a.agents.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.displayName||e.agentId}),e.isDefault?(0,A.jsx)(C,{variant:`default`,children:r()}):null,(0,A.jsx)(C,{variant:`outline`,children:O(e.via)}),(0,A.jsx)(C,{variant:`secondary`,children:e.state})]},`${e.instanceName} ${e.agentId}`))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:h()}),a.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:a.charts.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.name}),(0,A.jsx)(C,{variant:`outline`,children:k(e.via)})]},e.key))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:y()}),a.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:a.permissions.map(e=>(0,A.jsx)(C,{variant:`secondary`,children:e},e))})]})]})]})}export{M as AccessTab};
@@ -1,3 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ar as r,Br as i,Cr as a,Dr as o,Ei as s,Er as c,Fr as ee,GE as l,Hr as te,Ir as u,Ix as d,Lr as ne,Mr as re,Nr as f,Or as p,Pr as ie,Rr as ae,SD as m,Sr as h,TD as g,Tr as _,Ur as v,Vr as y,_r as b,br as x,gr as S,hr as C,jr as oe,kr as w,mr as se,qE as ce,vD as T,vr as E,wi as D,wr as O,xr as k,yr as A,zr as j}from"./dist-CSHwMvoK.js";import{t as M}from"./button-Do9b0Kl0.js";import{$ as N,A as P,B as F,C as I,F as le,I as ue,L as de,N as fe,P as pe,Q as me,R as he,S as L,X as R,b as z,et as ge,mt as B,nt as _e,ot as V,rt as ve,v as H,x as U,y as W,z as ye}from"./index-Djd_7VwF.js";import{i as G}from"./compatView-Be0h8KSS.js";/* empty css */var K=t(e(),1),q=2e4,J=6e4;function Y(e){return typeof e!=`number`||e<=0?0:Math.round(e/q*100)}function X(e){return e<=0?0:Math.round(e/J*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 be(e){return e.reduce((e,t)=>e+(typeof t.size==`number`&&t.size>0?t.size:0),0)}var xe=3;function Se(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<xe&&a.push(e)):t>0&&(i+=t,o.length<xe&&o.push(e));return{added:r,removed:i,sampleAdded:a,sampleRemoved:o}}function Ce(e){return e instanceof Error?e.message.includes(`conflict:`):String(e).includes(`conflict:`)}var Q=n(),$=e=>`${e.instanceName}::${e.agentId}`;function we(){let e=g(T.me.getMe,{host:V}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),r=g(T.admin.listInstances,e!==void 0&&t?{}:`skip`),[a,o]=(0,K.useState)(null);(0,K.useEffect)(()=>{!t||!r||r.length===0||(!a||!r.some(e=>e.name===a))&&o(r[0].name)},[t,r,a]);let s=g(T.agents.listAgentsForInstance,t&&a?{instanceName:a}:`skip`),c=g(T.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),d=(0,K.useMemo)(()=>{if(e!==void 0){if(t)return a===null||s===void 0?r!==void 0&&r.length===0?[]:void 0:s.agents.map(e=>({instanceName:a,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(c!==void 0)return c.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,a,s,r,c]),[p,h]=(0,K.useState)(null);(0,K.useEffect)(()=>{!d||d.length===0||(!p||!d.some(e=>$(e)===p))&&h($(d[0]))},[d,p]);let _=d?.find(e=>$(e)===p)??null,b=m(T.agentFiles.listAgentFiles),[x,S]=(0,K.useState)({status:`idle`}),C=_?.instanceName??null,w=_?.agentId??null,se=g(T.compat.forInstance,n&&C!==null?{instanceName:C}:`skip`),E=n&&C!==null?H(se,`agentFiles`):null,O=E===null?!1:E===`loading`?null:E.blocked,k=(0,K.useCallback)(async()=>{if(!(C===null||w===null)){S({status:`loading`});try{S({status:`done`,files:(await b({instanceName:C,agentId:w})).files})}catch{S({status:`error`})}}},[b,C,w]);(0,K.useEffect)(()=>{O===!1&&k()},[k,O]);let[A,N]=(0,K.useState)(null),P=ce(),F=(0,K.useMemo)(()=>new Intl.NumberFormat(P,{maximumFractionDigits:0}),[P]);return e===void 0||d===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:v()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(r?.length??0)>1?(0,Q.jsxs)(W,{value:a??``,onValueChange:e=>o(e),children:[(0,Q.jsx)(L,{size:`sm`,"aria-label":te(),children:(0,Q.jsx)(I,{})}),(0,Q.jsx)(z,{children:(r??[]).map(e=>(0,Q.jsx)(U,{value:e.name,children:e.name},e.name))})]}):null,d.length>0?(0,Q.jsxs)(W,{value:p??``,onValueChange:e=>h(e),children:[(0,Q.jsx)(L,{size:`sm`,"aria-label":y(),children:(0,Q.jsx)(I,{})}),(0,Q.jsx)(z,{children:d.map(e=>(0,Q.jsx)(U,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:i()})]}),_===null?null:E===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):E!==null&&E.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(B,{size:14,"aria-hidden":!0}),` `,G(E.gatewayVersion)]}):x.status===`loading`||x.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):x.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[ae(),` `,(0,Q.jsx)(M,{variant:`outline`,size:`sm`,onClick:()=>void k(),children:D()})]}):x.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:j()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:x.files.map(e=>{let n=Y(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)(R,{variant:`outline`,children:ne()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:u({size:Z(e.size,P)})}),(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:ee({pct:F.format(n)})}),r?(0,Q.jsx)(B,{size:14,className:`oc-afiles__warn`,"aria-label":ie()}):(0,Q.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,Q.jsx)(M,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>N(e),children:t?re():oe()})]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:f({used:Z(be(x.files),P),total:Z(J,P),pct:F.format(X(be(x.files)))})})]}),A&&_?(0,Q.jsx)(Te,{instanceName:_.instanceName,agentId:_.agentId,name:A.name,isAdmin:t,onClose:()=>N(null),onSaved:()=>void k()}):null]})}function Te({instanceName:e,agentId:t,name:n,isAdmin:i,onClose:ee,onSaved:te}){let u=m(T.agentFiles.getAgentFile),ne=m(T.agentFiles.setAgentFile),re=P(),[f,ie]=(0,K.useState)(null),[ae,g]=(0,K.useState)(!1),[v,y]=(0,K.useState)(``),[oe,j]=(0,K.useState)(!1),[I,L]=(0,K.useState)(!1),[R,z]=(0,K.useState)(!1),[B,V]=(0,K.useState)(!1),H=(0,K.useCallback)(async r=>{g(!1);try{let i=await u({instanceName:e,agentId:t,name:n});ie({content:i.content,updatedAtMs:i.updatedAtMs}),r||y(i.content),z(!1)}catch{g(!0)}},[u,e,t,n]);(0,K.useEffect)(()=>{H(!1)},[H]);async function U(){if(f!==null){L(!0),V(!1);try{await ne({instanceName:e,agentId:t,name:n,content:v,baseUpdatedAtMs:f.updatedAtMs??void 0}),re.success(O({name:n})),te(),await H(!1)}catch(e){Ce(e)?z(!0):V(!0)}finally{L(!1)}}}let W=f!==null&&v!==f.content,G=(0,K.useMemo)(()=>f===null?null:Se(f.content,v),[f,v]),J=v.length>q,Y=ce(),X=(0,K.useMemo)(()=>new Intl.NumberFormat(Y),[Y]);return(0,Q.jsx)(me,{open:!0,onOpenChange:e=>!e&&ee(),children:(0,Q.jsxs)(N,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(_e,{children:[(0,Q.jsx)(ve,{children:r({name:n})}),(0,Q.jsxs)(ge,{children:[w({agent:t,instance:e}),i?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,p()]})]})]}),ae?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[h(),` `,(0,Q.jsx)(M,{variant:`outline`,size:`sm`,onClick:()=>void H(!1),children:D()})]}):f===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:v,readOnly:!i,spellCheck:!1,onChange:e=>y(e.target.value),"aria-label":r({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:o()}),R?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[k(),` `,(0,Q.jsx)(M,{variant:`outline`,size:`sm`,onClick:()=>void H(!0),children:x()})]}):null,B?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:a()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${J?` is-over`:``}`,children:c({count:X.format(v.length),max:X.format(q)})}),i?(0,Q.jsx)(M,{size:`sm`,disabled:!W||I||R,onClick:()=>j(!0),children:I?s():_()}):null]})]}),(0,Q.jsx)(fe,{open:oe,onOpenChange:j,children:(0,Q.jsxs)(ue,{children:[(0,Q.jsxs)(ye,{children:[(0,Q.jsx)(F,{children:A({name:n})}),(0,Q.jsx)(de,{children:E({agent:t})})]}),G?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:b({added:G.added,removed:G.removed})}),G.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:S()}),G.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,G.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:C()}),G.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(he,{children:[(0,Q.jsx)(le,{children:d()}),(0,Q.jsx)(pe,{onClick:()=>void U(),children:se()})]})]})})]})})}export{we as AgentFilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ap as r,Bp as i,Cp as ee,Dp as a,Ep as o,Fp as te,Gp as ne,Hp as re,Ip as ie,Jp as ae,Kp as s,Lp as c,Mp as l,Np as u,Op as d,Pp as f,Rp as p,Sp as oe,TD as m,Tp as se,Up as ce,Vp as le,Wp as ue,Xp as h,Yp as g,Zp as _,_p as de,bp as fe,dp as v,fp as y,gp as pe,hp as me,jp as he,kp as ge,lp as b,mp as x,pp as S,qp as C,up as w,vD as T,vp as E,wD as D,wp as O,xp as k,yp as A,zp as j}from"./dist-CSHwMvoK.js";import{A as M,C as N,Mt as P,S as F,X as I,a as L,b as R,j as _e,jt as z,ot as ve,r as ye,x as B,y as V}from"./index-Djd_7VwF.js";import{n as be}from"./TimeRangePicker-DatsuATN.js";import{t as xe}from"./FilterBar-DZweUsOp.js";import{t as Se}from"./DataTableShell-CXnilHFx.js";import{t as H}from"./dispatchErrorInfo-CNHPv3Dl.js";var U=t(e(),1),W=n(),G=`__all__`,Ce=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function we(e){return e===`open`?_():e===`acknowledged`?h():g()}var Te=[`info`,`warn`,`critical`],Ee=[`detector`,`agent`,`user`],De={kind:`relative`,from:`now-30d`,to:`now`},Oe=200,K=`all`;function q(){let e=P({from:`/settings/anomalies`}),t=z({from:`/settings/anomalies`}),n=e.q??``,h=e.status===K?G:e.status,g=e.severity??G,_=e.kind??G,[v,y]=(0,U.useState)(G),b=ye(e.from,e.to),{from:w,to:H}=be(b),q=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),J=e=>void t({search:t=>({...t,status:e===G?K:e})}),Y=e=>void t({search:t=>({...t,severity:e===G?void 0:e})}),Ne=e=>void t({search:t=>({...t,kind:e===G?void 0:e})}),X=e=>void t({search:t=>({...t,...L(e)})}),Pe=_e(),Z=M(),Q=D(T.anomalies.resolveAnomaly),Fe=(m(T.me.getMe,{host:ve})?.permissions??[]).includes(`admin.manage`),$=m(T.anomalies.listAnomalies,{limit:Oe,filter:{q:n||void 0,from:w,to:H,anomalyStatus:h===G?void 0:h,severity:g===G?void 0:g,source:v===G?void 0:v,kind:_===G?void 0:_}}),Ie=(0,U.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.kind);return[...e].sort()},[$]),Le=n!==``||h!==`open`||g!==G||v!==G||_!==G||b.kind!==`relative`||b.from!==De.from;function Re(){y(G),t({search:{status:`open`},replace:!0})}async function ze(e){if(await Pe({title:ae(),description:(0,W.jsxs)(W.Fragment,{children:[C(),` `,(0,W.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,s(),` `,(0,W.jsx)(`strong`,{children:ne()}),`.`,` `,ue()]}),confirmLabel:ce()}))try{await Q({anomalyId:e._id,status:`resolved`}),Z.success(re(),e.kind)}catch(e){Z.error(le(),e)}}async function Be(e){try{await Q({anomalyId:e._id,status:`acknowledged`}),Z.success(i(),e.kind)}catch(e){Z.error(j(),e)}}return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`p`,{className:`oc-admin__hint`,children:[p(),` `,(0,W.jsx)(`strong`,{children:c()}),` `,ie(),` `,(0,W.jsx)(`strong`,{children:te()}),` `,f(),` `,(0,W.jsx)(`strong`,{children:u()}),` `,l(),` `,(0,W.jsx)(`span`,{className:`oc-filter__window`,children:he()})]}),(0,W.jsxs)(xe,{q:n,onQChange:q,searchPlaceholder:r(),timeRange:b,onTimeRangeChange:X,onReset:Re,canReset:Le,children:[(0,W.jsxs)(V,{value:h,onValueChange:J,children:[(0,W.jsx)(F,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:ge()}),Ce.map(e=>(0,W.jsx)(B,{value:e.value,children:we(e.value)},e.value))]})]}),(0,W.jsxs)(V,{value:g,onValueChange:Y,children:[(0,W.jsx)(F,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{placeholder:d()})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:a()}),Te.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]}),(0,W.jsxs)(V,{value:v,onValueChange:y,children:[(0,W.jsx)(F,{size:`sm`,className:`w-32`,children:(0,W.jsx)(N,{placeholder:o()})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:se()}),Ee.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]}),(0,W.jsxs)(V,{value:_,onValueChange:Ne,children:[(0,W.jsx)(F,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{placeholder:O()})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(B,{value:G,children:ee()}),Ie.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]})]}),(0,W.jsx)(Se,{title:oe(),rows:$,emptyHint:h===`open`?k():fe(),rowActions:e=>Fe&&e.status===`open`?[{label:A(),onSelect:()=>void ze(e)},{label:E(),onSelect:()=>void Be(e)}]:[],columns:[{header:de(),cell:e=>(0,W.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)}),sort:e=>e.at},{header:O(),cell:e=>(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:d(),cell:e=>(0,W.jsx)(Ae,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:pe(),cell:e=>(0,W.jsx)(je,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:o(),cell:e=>(0,W.jsx)(I,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:me(),cell:e=>(0,W.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),sort:e=>e.message},{header:x(),cell:e=>(0,W.jsx)(ke,{row:e}),sort:e=>e.evidence??null},{header:S(),cell:e=>e.correlationId?(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:Me(e.correlationId)}):(0,W.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function J(e){if(e.kind!==`openclaw.dispatch_failures`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{dominantCode:t.dominantCode,sampleCorrelationId:t.sampleCorrelationId}}catch{return{}}}function Y(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 ke({row:e}){let t=z();if(e.kind===`subagent.failure`){let n=Y(e);return(0,W.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,W.jsx)(`div`,{className:`oc-anomaly__cause-head`,children:[...new Set(n.errorCategories??[])].map(e=>(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:e},e))}),e.correlationId?(0,W.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:e.correlationId,limit:100}}),children:[`↗ `,y()]}):null]})}let n=J(e);if(!n.dominantCode)return(0,W.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=H(n.dominantCode),i=n.sampleCorrelationId;return(0,W.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,W.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,W.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,W.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,W.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,y()]}):null]})}function Ae({severity:e}){return(0,W.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function je({status:e}){return e===`open`?(0,W.jsx)(I,{variant:`destructive`,children:v()}):e===`acknowledged`?(0,W.jsx)(I,{variant:`secondary`,children:w()}):(0,W.jsx)(I,{variant:`outline`,children:b()})}function Me(e){return e.length>8?e.slice(0,8):e}export{q as AnomaliesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$l as r,$n as i,Bl as a,Bn as o,Cu as s,Du as c,Eu as l,Gl as u,Gn as d,Hl as f,Hn as p,In as m,Jl as h,Jn as g,Kl as _,Kn as v,Ou as ee,Ql as y,Qn as b,SD as te,Su as ne,TD as x,Tu as re,Ul as ie,Un as ae,Vl as S,Vn as oe,Wl as se,Wn as ce,Xl as le,Xn as ue,Xu as de,Yl as fe,Yn as pe,Zl as me,Zn as he,Zu as ge,_u as _e,ad as ve,au as ye,bu as be,cu as xe,du as Se,ed as Ce,eu as C,fu as we,gu as Te,hu as Ee,id as De,iu as Oe,ld as ke,lu as Ae,mu as je,nd as Me,nu as Ne,od as Pe,ou as Fe,pu as w,ql as Ie,qn as Le,rd as Re,ru as ze,sd as Be,su as Ve,td as He,tu as Ue,ud as We,uu as Ge,vD as T,vu as Ke,wD as qe,wu as Je,xu as Ye,yD as E,yu as Xe}from"./dist-CSHwMvoK.js";import{i as D,r as Ze}from"./dist-DyqGXOsj.js";import{t as Qe}from"./chevrons-up-down-BNHrpyID.js";import{i as $e,n as O,o as et,r as tt,s as nt}from"./FieldLabel-DszF6BCc.js";import{t as k}from"./button-Do9b0Kl0.js";import{$ as rt,A as it,At as at,C as A,H as ot,Q as st,S as j,St as ct,U as lt,V as ut,X as M,Z as N,_ as dt,_t as ft,b as P,et as pt,jt as mt,kt as F,mt as I,nt as ht,ot as gt,rt as _t,x as L,y as R}from"./index-Djd_7VwF.js";import{a as vt,i as z,n as yt,o as B,r as V,t as bt}from"./table-Cr9ARpxr.js";import{t as xt}from"./FilterBar-DZweUsOp.js";import{a as St,n as Ct,o as wt,r as H,s as Tt,t as Et}from"./compatView-Be0h8KSS.js";import{t as U}from"./dispatchErrorInfo-CNHPv3Dl.js";var Dt=E(`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`}]]),Ot=E(`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`}]]),W=t(e(),1);function G(e){return e.filter(e=>e.state===`error`)}function kt(e){return e.reachable&&G(e.targets).length===0}function At(e){return e.state===`error`&&e.lastErrorCode!==null}function jt(e){return!!e.lastDownstreamRejectCode}function K(e){return e.kind??`openclaw`}function Mt(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function Nt(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 Mt(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 Pt(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var q=`__all__`,J={q:``,state:q,instance:q,version:q},Y={connected:0,error:1,idle:2};function Ft(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function It(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 Z(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function Lt(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 wt(e,r)??X(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return X(t.targetLabel,n.targetLabel)}}function Rt(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=Z(t.key,e),a=Z(t.key,r);return i&&a?0:i?1:a?-1:n*Lt(t.key,e,r)})}function zt(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 Bt(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 Vt(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>wt(e,t)??X(e,t))}var Q=n();function Ht({connections:e,displayByInstance:t}){let[n,i]=(0,W.useState)(J),[a,o]=(0,W.useState)(null),s=(0,W.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,attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null})),[e,t]),c=(0,W.useMemo)(()=>zt(s),[s]),l=(0,W.useMemo)(()=>Bt(s),[s]),d=(0,W.useMemo)(()=>Vt(s),[s]),f=(0,W.useMemo)(()=>Rt(It(s,n),a),[s,n,a]);function p(e){o(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()}):(0,Q.jsxs)(`div`,{className:`oc-conn`,children:[(0,Q.jsxs)(xt,{q:n.q,onQChange:e=>i(t=>({...t,q:e})),searchPlaceholder:Ue(),onReset:()=>i(J),canReset:Ft(n),children:[(0,Q.jsxs)(R,{value:n.state,onValueChange:e=>i(t=>({...t,state:e})),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(A,{placeholder:r()})}),(0,Q.jsxs)(P,{children:[(0,Q.jsx)(L,{value:q,children:C()}),c.map(e=>(0,Q.jsx)(L,{value:e,children:Wt(e)},e))]})]}),(0,Q.jsxs)(R,{value:n.instance,onValueChange:e=>i(t=>({...t,instance:e})),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-40`,children:(0,Q.jsx)(A,{placeholder:y()})}),(0,Q.jsxs)(P,{children:[(0,Q.jsx)(L,{value:q,children:C()}),l.map(e=>(0,Q.jsx)(L,{value:e.name,children:e.label},e.name))]})]}),(0,Q.jsxs)(R,{value:n.version,onValueChange:e=>i(t=>({...t,version:e})),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(A,{placeholder:me()})}),(0,Q.jsxs)(P,{children:[(0,Q.jsx)(L,{value:q,children:C()}),d.map(e=>(0,Q.jsx)(L,{value:e,children:e},e))]})]})]}),f.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:le()}):(0,Q.jsxs)(bt,{className:`oc-conn__table`,children:[(0,Q.jsx)(vt,{children:(0,Q.jsxs)(B,{children:[(0,Q.jsx)($,{label:fe(),sortKey:`target`,sort:a,onSort:p}),(0,Q.jsx)($,{label:h(),sortKey:`state`,sort:a,onSort:p}),(0,Q.jsx)($,{label:Ie(),sortKey:`instance`,sort:a,onSort:p}),(0,Q.jsx)($,{label:_(),sortKey:`host`,sort:a,onSort:p}),(0,Q.jsx)($,{label:u(),sortKey:`version`,sort:a,onSort:p}),(0,Q.jsx)(z,{children:se()}),(0,Q.jsx)($,{label:ie(),sortKey:`lastOk`,sort:a,onSort:p})]})}),(0,Q.jsx)(yt,{children:f.map(e=>(0,Q.jsx)(Ut,{r:e},e._id))})]})]})}function $({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Q.jsx)(z,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Q.jsx)(Ze,{size:13,"aria-hidden":!0}):(0,Q.jsx)(D,{size:13,"aria-hidden":!0}):(0,Q.jsx)(Qe,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function Ut({r:e}){let t=At(e)?U(e.lastErrorCode):null,n=jt(e)?U(e.lastDownstreamRejectCode):null;return(0,Q.jsxs)(W.Fragment,{children:[(0,Q.jsxs)(B,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Q.jsx)(V,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Q.jsx)(V,{children:(0,Q.jsx)(Gt,{state:e.state})}),(0,Q.jsx)(V,{children:e.instanceLabel?(0,Q.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(V,{children:(0,Q.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Q.jsx)(V,{children:e.gatewayVersion?(0,Q.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(V,{children:(0,Q.jsx)(`span`,{className:`oc-conn__stats`,children:ze({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Q.jsx)(V,{children:e.lastOkAt?(0,Q.jsx)(`span`,{className:`oc-traces__mono`,children:new Date(e.lastOkAt).toLocaleTimeString(`fr-FR`)}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Q.jsx)(B,{className:`oc-conn__detail-row`,children:(0,Q.jsxs)(V,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Q.jsx)(`strong`,{children:t.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${new Date(e.lastErrorAt).toLocaleTimeString(`fr-FR`)}`:``,(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[Ne({label:n.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${new Date(e.lastDownstreamRejectAt).toLocaleTimeString(`fr-FR`)}`:``]}):null]})}):null]})}function Wt(e){return e===`connected`?f():e===`error`?S():a()}function Gt({state:e}){return e===`connected`?(0,Q.jsx)(M,{variant:`secondary`,children:f()}):e===`error`?(0,Q.jsx)(M,{variant:`destructive`,children:S()}):(0,Q.jsx)(M,{variant:`outline`,children:a()})}function Kt(){return x(T.bridgeHealth.getBridgeHealth,{})}function qt(){let e=Kt(),t=x(T.compat.getBridgeCompat,{}),n=x(T.me.getMe,{host:gt})?.role===`admin`,r=x(T.admin.listInstances,n?{}:`skip`),i=mt(),a=()=>void i({to:`/settings/anomalies`,search:{status:`open`}}),o=Nt(e?e.targets:[],t?t.targets:[],r??[]),s=t?.compat??null,c=t===void 0?`loading`:t===null?`nodata`:`ready`,l=s!==null&&Ct(s,`hermes`)&&!o.some(e=>e.key===`hermes`);return(0,Q.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Q.jsx)(Jt,{health:e,compat:t,onSeeAnomalies:a}),(0,Q.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:je()}),o.map(e=>(0,Q.jsx)(Yt,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:s,compatStatus:c,compatReachable:t?.reachable??!0},e.key)),l?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):null]})}function Jt({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,Q.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:St(t.bridgeVersion)}),i?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsxs)(`code`,{className:`oc-traces__mono`,title:he(),children:[`(`,i,`)`]})]}):null,r?(0,Q.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,ue({build:t.buildVersion??`?`})]}):null,` · `,pe(),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?g():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:w()});if(e===null)return(0,Q.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:we()});let o=G(e.targets),s=!e.reachable,c=kt(e),l=c?`ok`:`error`,u=new Date(e.checkedAt).toLocaleString(`fr-FR`),d=e.startedAt==null?null:new Date(e.startedAt).toLocaleString(`fr-FR`);return(0,Q.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${l}`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:c?(0,Q.jsx)(F,{size:22}):s?(0,Q.jsx)(Ot,{size:22}):(0,Q.jsx)(I,{size:22})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__title`,children:c?Se():s?Ge():Ae({count:o.length})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(Dt,{size:12,"aria-hidden":!0}),` `,xe({time:u})]}),d?(0,Q.jsx)(`span`,{children:Ve({time:d})}):null,a]}),s?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:U(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:Fe()})]})}function Yt({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:a,compatReachable:o}){let s=r?Tt(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:Et(t,e,r)})}let d=l.map(e=>e.state),f=d.includes(`beyond`)?`beyond`:d.length>0&&d.every(e=>e===`supported`)?`supported`:null,[p,m]=(0,W.useState)(!1);return(0,Q.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Q.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Q.jsx)(ft,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Q.jsx)(`span`,{className:`oc-bridge-provider__name`,children:Pt(e)}),f?(0,Q.jsx)(M,{variant:f===`beyond`?`destructive`:`secondary`,children:H(f)}):null]}),(0,Q.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:i()}),(0,Q.jsx)(Xt,{support:s,compatStatus:a,compatReachable:o,manifest:r,instanceRows:l}),(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":p,onClick:()=>m(e=>!e),children:[p?(0,Q.jsx)(D,{size:13,"aria-hidden":!0}):(0,Q.jsx)(at,{size:13,"aria-hidden":!0}),ye({count:t.length})]}),p?(0,Q.jsx)(Ht,{connections:t,displayByInstance:c}):null]})}function Xt({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i}){return t===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:w()}):t===`nodata`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):(0,Q.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Le()}),r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):(0,Q.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__label`,children:d()}),e&&e.range!==null?(0,Q.jsx)(`span`,{children:ce({min:e.range.min,max:e.range.maxValidated})}):(0,Q.jsx)(`span`,{children:g()}),e?(0,Q.jsx)(en,{versions:e.validatedVersions}):null]}),i.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:o()}):(0,Q.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,Q.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:St(e.version)}),(0,Q.jsx)(M,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:H(e.state)})]},e.instanceName))})]})}function Zt({instance:e,onClose:t}){return(0,Q.jsx)(st,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Q.jsxs)(rt,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Q.jsxs)(ht,{children:[(0,Q.jsx)(_t,{children:We({instance:e.displayName??e.name})}),(0,Q.jsx)(pt,{children:ke()})]}),(0,Q.jsx)($t,{instance:e,onClose:t})]})})}function Qt({label:e,result:t}){return t?t.checked?(0,Q.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,Q.jsx)(F,{"aria-hidden":!0}):(0,Q.jsx)(I,{"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[e,` — `,t.ok?Ke():t.detail]})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,_e()]}):null}function $t({instance:e,onClose:t}){let n=qe(T.admin.upsertInstanceConfig),r=te(T.bridge.validateMediaPaths),i=it(),[a,o]=(0,W.useState)(()=>$e(e.config??{})),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(null),g=a.inboundMediaMode===`shared-fs`,_=a.mediaMode===`shared-fs`,v=g||_;async function y(){p(!0),h(null);try{h(await r({instanceName:e.name,inboundMediaMode:a.inboundMediaMode,mediaMode:a.mediaMode}))}catch(e){i.error(ne(),e)}finally{p(!1)}}async function b(){d(!0);try{let r=e.config??{};await n({instanceId:e._id,config:tt(a,r)}),t()}catch(e){i.error(Me(),e)}finally{d(!1)}}return(0,Q.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Q.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:Be(),help:He()}),(0,Q.jsxs)(R,{value:a.mediaMode,onValueChange:e=>o({...a,mediaMode:e}),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(A,{})}),(0,Q.jsx)(P,{children:nt.map(e=>(0,Q.jsx)(L,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:Pe(),help:Ce()}),(0,Q.jsxs)(R,{value:a.inboundMediaMode,onValueChange:e=>o({...a,inboundMediaMode:e}),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(A,{})}),(0,Q.jsx)(P,{children:et.map(e=>(0,Q.jsx)(L,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:ve(),help:ge()}),(0,Q.jsx)(N,{type:`number`,min:1,max:4096,className:`w-full`,value:a.mediaMaxMb,onChange:e=>o({...a,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),v&&(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[g&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:ee(),help:c()}),(0,Q.jsx)(N,{className:`w-full`,spellCheck:!1,value:a.inboundAgentMount,onChange:e=>o({...a,inboundAgentMount:e.target.value})})]}),_&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(O,{label:l(),help:re()}),(0,Q.jsx)(N,{className:`w-full`,spellCheck:!1,value:a.outboundAgentMount,onChange:e=>o({...a,outboundAgentMount:e.target.value})})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(dt,{checked:a.rehydration,onCheckedChange:e=>o({...a,rehydration:e===!0})}),(0,Q.jsx)(O,{label:De(),help:de()})]}),v&&m!==null&&(0,Q.jsx)(`div`,{className:`oc-bridge-config__check`,children:m.reachable?!m.inbound&&!m.outbound?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(I,{"aria-hidden":!0}),Ee({reason:m.reason??`?`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Qt,{label:be(),result:m.inbound}),(0,Q.jsx)(Qt,{label:Xe(),result:m.outbound}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ye()})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(I,{"aria-hidden":!0}),Te()]})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[v&&(0,Q.jsxs)(k,{variant:`outline`,size:`sm`,onClick:()=>void y(),disabled:f,children:[f?(0,Q.jsx)(ct,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,f?s():Je()]}),(0,Q.jsx)(k,{size:`sm`,onClick:()=>void b(),disabled:u,children:Re()})]})]})})}function en({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Q.jsxs)(ut,{children:[(0,Q.jsx)(lt,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?ae():p({count:e.length}),(0,Q.jsx)(D,{size:13,"aria-hidden":!0})]})}),(0,Q.jsxs)(ot,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Q.jsx)(`p`,{className:`oc-compat__versions-title`,children:oe()}),(0,Q.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Q.jsx)(M,{variant:`secondary`,children:e},e))})]})]})}export{qt as BridgeTab,Zt as InstanceConfigDialog};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ei as r,GE as i,Hr as a,Ix as o,SD as s,TD as c,ar as ee,bi as te,cd as ne,cr as re,dr as ie,er as ae,fr as oe,ir as se,lr as l,nr as u,or as d,rr as ce,sr as f,tr as p,ur as m,vD as h,wi as le,yi as g}from"./dist-CSHwMvoK.js";import{t as _}from"./button-Do9b0Kl0.js";import{A as ue,B as de,C as fe,F as pe,I as me,L as he,N as v,P as y,R as b,S as x,b as S,g as C,h as w,mt as T,v as E,x as D,y as O,z as k}from"./index-Djd_7VwF.js";import{i as A}from"./compatView-Be0h8KSS.js";/* empty css */var j=t(e(),1),M=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function N(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 P=n();function F(){let e=s(h.agentFiles.getChatDefaults),t=s(h.agentFiles.setChatDefaults),n=ue(),[F,I]=(0,j.useState)({status:`loading`}),[L,R]=(0,j.useState)({thinkingDefault:null,fastModeDefault:null}),[ge,z]=(0,j.useState)(!1),[B,V]=(0,j.useState)(!1),H=c(h.admin.listInstances,{}),[U,W]=(0,j.useState)(null);(0,j.useEffect)(()=>{!H||H.length===0||(!U||!H.some(e=>e.name===U))&&W(H[0].name)},[H,U]);let G=(H?.length??0)>1,_e=H!==void 0&&H.length===0,ve=c(h.compat.forInstance,U?{instanceName:U}:`skip`),K=U?E(ve,`configDefaults`):`loading`,q=K===`loading`?null:K.blocked,J=(0,j.useMemo)(()=>G&&U?{instanceName:U}:{},[G,U]),Y=(0,j.useRef)(0),X=(0,j.useCallback)(async()=>{let t=++Y.current;I({status:`loading`});try{let n=N(await e(J));if(Y.current!==t)return;I({status:`done`,current:n}),R(n)}catch{if(Y.current!==t)return;I({status:`error`})}},[e,J]);(0,j.useEffect)(()=>{q===!1&&(G&&!U||X())},[X,q,G,U]);let Z=F.status===`done`?F.current:null,Q=Z!==null&&L.thinkingDefault!==null&&L.thinkingDefault!==Z.thinkingDefault,$=Z!==null&&L.fastModeDefault!==null&&L.fastModeDefault!==Z.fastModeDefault,ye=Q||$;async function be(){V(!0);try{await t({...J,...Q?{thinkingDefault:L.thinkingDefault}:{},...$?{fastModeDefault:L.fastModeDefault}:{}}),n.success(ee()),await X()}catch(e){n.error(se(),e)}finally{V(!1)}}let xe=(0,j.useMemo)(()=>M.map(e=>({id:e,label:C(e)})),[]),Se=(0,j.useMemo)(()=>[{id:`fast`,label:te()},{id:`standard`,label:g()}],[]);return(0,P.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:oe()}),G&&U?(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:a()}),(0,P.jsxs)(O,{value:U,onValueChange:e=>W(e),disabled:B,children:[(0,P.jsx)(x,{size:`sm`,"aria-label":a(),children:(0,P.jsx)(fe,{})}),(0,P.jsx)(S,{children:(H??[]).map(e=>(0,P.jsx)(D,{value:e.name,children:e.name},e.name))})]})]}):null,_e?(0,P.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:ne()}):K===`loading`?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):K.blocked?(0,P.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,P.jsx)(T,{size:14,"aria-hidden":!0}),` `,A(K.gatewayVersion)]}):F.status===`loading`?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):F.status===`error`?(0,P.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[f(),` `,(0,P.jsx)(_,{variant:`outline`,size:`sm`,onClick:()=>void X(),children:le()})]}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:ie()}),(0,P.jsx)(w,{options:xe,value:L.thinkingDefault,onChange:e=>R({...L,thinkingDefault:e}),disabled:B}),(0,P.jsx)(`p`,{className:`oc-cdefaults__help`,children:m()})]}),(0,P.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,P.jsx)(`span`,{className:`oc-cdefaults__label`,children:l()}),(0,P.jsx)(w,{options:Se,value:L.fastModeDefault===null?null:L.fastModeDefault?`fast`:`standard`,onChange:e=>R({...L,fastModeDefault:e===`fast`}),disabled:B}),(0,P.jsx)(`p`,{className:`oc-cdefaults__help`,children:re()})]}),(0,P.jsx)(`div`,{className:`oc-cdefaults__actions`,children:(0,P.jsx)(_,{size:`sm`,disabled:!ye||B,onClick:()=>z(!0),children:B?r():d()})}),(0,P.jsx)(`p`,{className:`oc-cdefaults__note`,children:ce()})]}),(0,P.jsx)(v,{open:ge,onOpenChange:z,children:(0,P.jsxs)(me,{children:[(0,P.jsxs)(k,{children:[(0,P.jsx)(de,{children:u()}),(0,P.jsx)(he,{children:p()})]}),(0,P.jsxs)(b,{children:[(0,P.jsx)(pe,{children:o()}),(0,P.jsx)(y,{onClick:()=>void be(),children:ae()})]})]})})]})}export{F as ChatDefaultsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,A_ as i,B_ as a,C_ as o,D_ as s,E_ as c,F_ as l,G_ as u,H_ as d,I_ as f,J_ as p,K_ as m,L_ as h,M_ as g,N_ as _,O_ as ee,P_ as v,Q_ as y,R_ as te,S_ as ne,TD as re,T_ as ie,U_ as ae,V_ as b,W_ as x,X_ as S,Y_ as C,Z_ as w,__ as T,_v as E,av as D,b_ as O,cv as k,dv as A,ev as j,fv as M,gv as N,hv as P,iv as F,j_ as I,k_ as L,lv as R,mv as z,nv as oe,ov as B,pv as V,q_ as H,rv as U,sv as W,tv as G,uv as K,vD as q,v_ as se,vv as ce,wD as J,w_ as le,x_ as ue,y_ as de,z_ as fe}from"./dist-CSHwMvoK.js";import{t as pe}from"./button-Do9b0Kl0.js";import{j as me}from"./index-Djd_7VwF.js";import{t as he}from"./DataTableShell-CXnilHFx.js";var Y=t(e(),1),X=n(),Z={altered_words:()=>ce(),incorrect:()=>E(),incoherence:()=>N(),formatting:()=>P(),latency:()=>z(),api_error:()=>V(),other:()=>M()},Q=e=>Z[e]?.()??e;function $({matches:e,sourceWasOpen:t}){return t?e===!0?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:K()}):e===!1?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:R()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:A()})}function ge({data:e,closeReason:t}){let n=e.snapshot,i=J(q.feedback.respondToFeedback),[a,s]=(0,Y.useState)(e.thread),[c,l]=(0,Y.useState)(``),[f,h]=(0,Y.useState)(!1);async function g(){let t=c.trim();if(!(!t||f)){h(!0);try{await i({feedbackId:e._id,text:t}),s(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),l(``)}finally{h(!1)}}}let _=[];try{_=n.contextJson?JSON.parse(n.contextJson):[]}catch{_=[]}return(0,X.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,X.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,X.jsx)($,{matches:n.displayedMatchesStored,sourceWasOpen:n.clientInfo?.sourceWasOpen??!1}),(0,X.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Q(e.category),` · `,n.messageRole,n.isRegeneration?` · ${k()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:W()}),(0,X.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,t?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:o()}),(0,X.jsx)(`p`,{className:`oc-fbadmin__comment`,children:t})]}):null,(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:B()}),a.length>0?(0,X.jsx)(`div`,{className:`oc-fbadmin__thread`,children:a.map((e,t)=>(0,X.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,X.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?D():F()}),(0,X.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,X.jsx)(`p`,{className:`oc-fbadmin__meta`,children:U()}),(0,X.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:oe(),value:c,maxLength:2e3,rows:3,onChange:e=>l(e.target.value.slice(0,2e3))}),(0,X.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,X.jsx)(pe,{size:`sm`,onClick:()=>void g(),disabled:!c.trim()||f,children:f?G():j()})})]}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:r()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||y()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:w()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||y()})]}):null,n.promptText?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:S()}),(0,X.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,_.length>0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:C({count:n.contextCount??_.length,truncated:n.contextTruncated?p():``})}),(0,X.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:_.map((e,t)=>(0,X.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,X.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,X.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,n.outboxAvailable?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:H()}),(0,X.jsxs)(`pre`,{className:`oc-msg__source-pre`,children:[n.outboxText??``,n.outboxStatus?`\n[status: ${n.outboxStatus}]`:``]})]}):null,n.clientInfo?.extensionsDetected&&n.clientInfo.extensionsDetected.length>0?(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:m()}),(0,X.jsx)(`div`,{className:`oc-fbadmin__row`,children:n.clientInfo.extensionsDetected.map(e=>(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h4`,{className:`oc-fbadmin__h`,children:u()}),(0,X.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?x({theme:n.clientInfo.theme}):null,n.runId?`run ${n.runId.slice(0,12)}…`:null].filter(Boolean).join(` · `)||`—`,n.clientInfo?.plugins&&n.clientInfo.plugins.length>0?(0,X.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[ae(),` `,n.clientInfo.plugins.join(`, `),(0,X.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,d()]})]}):null,n.clientInfo?.userAgent?(0,X.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function _e(){let e=re(q.feedback.listForAdmin,{}),t=J(q.feedback.readSnapshot),n=J(q.feedback.deleteFeedback),r=me(),[o,u]=(0,Y.useState)(null),[d,p]=(0,Y.useState)({});async function m(e){if(o===e._id){u(null);return}if(!d[e._id]){let n=await t({feedbackId:e._id});p(t=>({...t,[e._id]:n}))}u(e._id)}async function y(e){await r({title:de(),description:se(),confirmLabel:T(),destructive:!0})&&(await n({feedbackId:e._id}),o===e._id&&u(null))}return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[b(),` `,(0,X.jsx)(`strong`,{children:a()}),` `,fe()]}),(0,X.jsx)(he,{title:te(),rows:e,emptyHint:h(),isExpanded:e=>o===e._id&&!!d[e._id],renderExpanded:e=>d[e._id]?(0,X.jsx)(ge,{data:d[e._id],closeReason:e.userCloseReason}):null,columns:[{header:f(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:l(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:v(),cell:e=>e.messageRole===`user`?_():g(),sort:e=>e.messageRole},{header:I(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${i({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:L(),cell:e=>(0,X.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:ee(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:s(),cell:e=>e.userClosedAt==null?e.answered?(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:c()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill`,children:ie()}):(0,X.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:le()}),sort:e=>e.userClosedAt==null?+!!e.answered:2}],rowActions:e=>[{label:o===e._id?ne():ue(),onSelect:()=>void m(e)},{label:O(),onSelect:()=>void y(e),variant:`destructive`}]})]})}export{_e as FeedbacksTab};
@@ -1,4 +0,0 @@
1
- import{r as e}from"./bundle-mjs-C73ZY4La.js";import{MD as t,yD as n}from"./dist-CSHwMvoK.js";import{c as r,l as i,s as a,u as o}from"./index-Djd_7VwF.js";var s=n(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),c={media_delivery:{key:`media_delivery`,appliedIn:`bridge`,togglable:!0,placeholders:[`outboundDir`],defaultTemplate:`[LIVRAISON]
2
- Pour qu'un fichier que tu génères soit téléchargeable par l'utilisateur dans ce webchat : écris-le sous {outboundDir}/ puis ajoute, dans ta réponse finale, une ligne dédiée EXACTEMENT au format MEDIA:<chemin absolu du fichier>. N'utilise PAS de lien markdown vers un chemin local — il ne serait pas cliquable.`},documentary_fetch:{key:`documentary_fetch`,appliedIn:`convex`,togglable:!0,placeholders:[`references`],defaultTemplate:`Fournis les fichiers source téléchargeables correspondant EXACTEMENT à ces références de documents (un fichier par référence, nommé d'après la référence). Réponds uniquement avec les fichiers, sans commentaire :
3
- {references}`,disabledTemplate:`{references}`},inbound_files:{key:`inbound_files`,appliedIn:`bridge`,togglable:!0,placeholders:[`files`],defaultTemplate:`[FICHIERS REÇUS]
4
- {files}`}},l=Object.keys(c);function u(e,t){return t.enabled?t.template:c[e].disabledTemplate??``}function d(e,t){return e.replace(/\{(\w+)\}/g,(e,n)=>{let r=t[n];return r===void 0?e:r})}var f=[`gateway-http`,`shared-fs`,`off`],p=[`inline`,`shared-fs`],m=[`reactive`,`sse`],h=`reactive`;t.object({mediaMode:t.optional(t.union(t.literal(`gateway-http`),t.literal(`shared-fs`),t.literal(`off`))),inboundMediaMode:t.optional(t.union(t.literal(`inline`),t.literal(`shared-fs`))),rehydration:t.optional(t.boolean()),mediaMaxMb:t.optional(t.number()),inboundAgentMount:t.optional(t.string()),outboundAgentMount:t.optional(t.string()),promptInjections:t.optional(t.record(t.string(),t.object({enabled:t.optional(t.boolean()),template:t.optional(t.string())})))});var g={mediaMode:`gateway-http`,inboundMediaMode:`inline`,rehydration:!0,mediaMaxMb:1024,inboundAgentMount:`/home/node/.openclaw/media/inbound`,outboundAgentMount:`/home/node/.openclaw/media/outbound`};function _(e){let t={};for(let n of l){let r=e?.[n];t[n]={enabled:r?.enabled??!0,template:typeof r?.template==`string`&&r.template.length>0?r.template:c[n].defaultTemplate}}return t}function v(e){let t={};for(let n of l){let r=c[n],i=e[n];if(!i)continue;let a={};r.togglable&&i.enabled===!1&&(a.enabled=!1);let o=i.template.trim();o.length>0&&o!==r.defaultTemplate&&(a.template=o),(a.enabled!==void 0||a.template!==void 0)&&(t[n]=a)}return t}function y(e){return{mediaMode:e.mediaMode??g.mediaMode,inboundMediaMode:e.inboundMediaMode??g.inboundMediaMode,rehydration:e.rehydration??g.rehydration,mediaMaxMb:e.mediaMaxMb??g.mediaMaxMb,inboundAgentMount:e.inboundAgentMount??g.inboundAgentMount,outboundAgentMount:e.outboundAgentMount??g.outboundAgentMount,promptInjections:_(e.promptInjections)}}function b(e,t){let n={},r=r=>{(e[r]!==g[r]||t[r]!==void 0)&&(n[r]=e[r])};r(`mediaMode`),r(`inboundMediaMode`),r(`rehydration`),r(`mediaMaxMb`),r(`inboundAgentMount`),r(`outboundAgentMount`);let i=v(e.promptInjections);return Object.keys(i).length>0&&(n.promptInjections=i),n}var x=e();function S({text:e}){return(0,x.jsx)(i,{delayDuration:150,children:(0,x.jsxs)(a,{children:[(0,x.jsx)(o,{asChild:!0,children:(0,x.jsx)(`button`,{type:`button`,className:`oc-field__help`,"aria-label":e,onClick:e=>e.preventDefault(),children:(0,x.jsx)(s,{"aria-hidden":!0})})}),(0,x.jsx)(r,{className:`max-w-xs text-pretty`,children:e})]})})}function C({label:e,help:t}){return(0,x.jsxs)(`span`,{className:`oc-field__label`,children:[e,(0,x.jsx)(S,{text:t})]})}export{h as a,m as c,u as d,d as f,y as i,c as l,C as n,p as o,b as r,f as s,S as t,l as u};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$T as r,CE as ee,GE as te,GT as ne,HT as re,Ix as ie,JT as ae,KT as i,QT as a,SE as o,TD as s,UT as c,WT as l,XT as u,YT as d,ZT as oe,_E as se,aE as ce,bE as f,cE as p,dE as m,eE as le,fE as h,gE as ue,hE as de,iE as fe,lE as g,mE as pe,nE as me,oE as _,pE as he,qE as ge,qT as _e,rE as ve,sE as v,tE as y,uE as b,vD as x,vE as S,wD as C,xE as w,yE as T}from"./dist-CSHwMvoK.js";import{t as E}from"./button-Do9b0Kl0.js";import{A as D,B as O,C as k,Et as A,F as j,G as M,I as N,K as P,L as F,N as ye,P as be,R as xe,S as I,Tt as Se,W as Ce,X as we,Y as Te,b as L,ht as Ee,x as R,y as z,yt as De,z as Oe}from"./index-Djd_7VwF.js";import{a as ke,i as B,n as Ae,o as V,r as H,t as je}from"./table-Cr9ARpxr.js";var U=t(e(),1),W=n(),G=`all`;function K(e){switch(e){case`image`:return h();case`audio`:return m();case`video`:return b();case`pdf`:return g();case`document`:return p();case`archive`:return v();default:return _()}}function q(){let[e,t]=(0,U.useState)(G),[n,p]=(0,U.useState)(G),[m,h]=(0,U.useState)(G),[g,_]=(0,U.useState)(G),[v,b]=(0,U.useState)(null),q=C(x.files.softDelete),J=D();function Me(){t(G),p(G),h(G),_(G)}async function Ne(){let e=v;if(b(null),e)try{await q({fileId:e.id}),J.success(d())}catch(e){J.error(ae(),e)}}let Y=s(x.files.listMine,{direction:e===G?void 0:e,chatId:n===G?void 0:n,instanceName:m===G?void 0:m,category:g===G?void 0:g}),X=(0,U.useMemo)(()=>new Intl.DateTimeFormat(ge(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(Y===void 0)return(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:te()});let{files:Z,facets:Q,truncated:Pe,cap:Fe}=Y,$=e!==G||n!==G||m!==G||g!==G;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:ee()}),(0,W.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,W.jsxs)(z,{value:e,onValueChange:t,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":o(),children:(0,W.jsx)(k,{})}),(0,W.jsxs)(L,{children:[(0,W.jsx)(R,{value:G,children:w()}),(0,W.jsx)(R,{value:`inbound`,children:f()}),(0,W.jsx)(R,{value:`outbound`,children:T()})]})]}),(0,W.jsxs)(z,{value:n,onValueChange:p,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":S(),children:(0,W.jsx)(k,{})}),(0,W.jsxs)(L,{children:[(0,W.jsx)(R,{value:G,children:se()}),Q.chats.map(e=>(0,W.jsx)(R,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,W.jsxs)(z,{value:m,onValueChange:h,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":ue(),children:(0,W.jsx)(k,{})}),(0,W.jsxs)(L,{children:[(0,W.jsx)(R,{value:G,children:de()}),Q.instances.map(e=>(0,W.jsx)(R,{value:e,children:e},e))]})]}):null,(0,W.jsxs)(z,{value:g,onValueChange:_,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":pe(),children:(0,W.jsx)(k,{})}),(0,W.jsxs)(L,{children:[(0,W.jsx)(R,{value:G,children:he()}),Q.categories.map(e=>(0,W.jsx)(R,{value:e,children:K(e)},e))]})]}),$?(0,W.jsxs)(E,{variant:`ghost`,size:`sm`,onClick:Me,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,W.jsx)(De,{size:14,"aria-hidden":!0}),a()]}):null]}),Z.length===0?(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:$?c():l()}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(je,{children:[(0,W.jsx)(ke,{children:(0,W.jsxs)(V,{children:[(0,W.jsx)(B,{children:ce()}),(0,W.jsx)(B,{children:fe()}),(0,W.jsx)(B,{children:ve()}),(0,W.jsx)(B,{children:me()}),(0,W.jsx)(B,{children:y()}),(0,W.jsx)(B,{className:`text-right`,children:le()})]})}),(0,W.jsx)(Ae,{children:Z.map(e=>(0,W.jsxs)(V,{children:[(0,W.jsx)(H,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:e.filename}),(0,W.jsx)(H,{title:e.mimeType,children:K(e.category)}),(0,W.jsx)(H,{children:(0,W.jsx)(we,{variant:`secondary`,children:e.direction===`inbound`?f():T()})}),(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:X.format(e.createdAt)}),(0,W.jsx)(H,{className:`text-right`,children:(0,W.jsxs)(Ce,{children:[(0,W.jsx)(Te,{asChild:!0,children:(0,W.jsx)(E,{variant:`ghost`,size:`icon`,"aria-label":oe(),children:(0,W.jsx)(Se,{size:16})})}),(0,W.jsxs)(M,{align:`end`,children:[e.url?(0,W.jsx)(P,{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}),r()]})}):(0,W.jsxs)(P,{disabled:!0,children:[(0,W.jsx)(A,{size:14}),ne()]}),(0,W.jsxs)(P,{variant:`destructive`,onSelect:()=>b({id:e._id,filename:e.filename}),children:[(0,W.jsx)(Ee,{size:14}),u()]})]})]})})]},e._id))})]}),Pe?(0,W.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:re({cap:Fe})}):null]}),(0,W.jsx)(ye,{open:v!==null,onOpenChange:e=>!e&&b(null),children:(0,W.jsxs)(N,{children:[(0,W.jsxs)(Oe,{children:[(0,W.jsx)(O,{children:_e()}),(0,W.jsx)(F,{children:i()})]}),(0,W.jsxs)(xe,{children:[(0,W.jsx)(j,{children:ie()}),(0,W.jsx)(be,{onClick:()=>void Ne(),children:u()})]})]})})]})}export{q as FilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$i as r,Aa as i,Ba as a,Bi as o,Ca as s,Da as c,Ea as l,Fa as u,Ga as d,Gi as f,Ha as p,Hi as m,Ia as h,Ji as g,Ka as _,Ki as v,La as ee,Ma as te,Na as ne,Oa as y,Pa as b,Qi as x,Ra as S,Ri as C,Sa as w,TD as T,Ta as E,Ua as re,Ui as D,Va as ie,Vi as O,Wa as k,Wi as A,Xi as j,Yi as M,Zi as N,_a as P,aa as F,ba as ae,ca as I,da as oe,ea as se,fa as ce,ga as le,ha as ue,ia as de,ja as fe,ka as pe,la as L,ma as me,na as he,oa as ge,pa as _e,qa as ve,qi as ye,ra as be,sa as xe,ta as Se,ua as Ce,vD as R,va as z,wD as B,wa as we,xa as Te,yD as V,ya as Ee,za as De,zi as Oe}from"./dist-CSHwMvoK.js";import{t as ke}from"./x-DxTaDbZb.js";import{i as H,n as U,r as Ae,t as je}from"./tabs-CSXMDWZx.js";import{t as W}from"./button-Do9b0Kl0.js";import{$ as Me,A as G,At as Ne,C as Pe,Q as Fe,S as Ie,X as K,Z as q,_ as J,_t as Y,b as Le,et as Re,gt as X,j as ze,m as Be,nt as Ve,ot as He,rt as Ue,x as We,y as Ge}from"./index-Djd_7VwF.js";import{t as Ke}from"./FilterBar-DZweUsOp.js";import{t as qe}from"./DataTableShell-CXnilHFx.js";import{t as Z}from"./DetailChips-DwhF4wyT.js";var Je=V(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ye=V(`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`}]]),Xe=V(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ze=V(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Q=t(e(),1);function Qe(e,t,n){let r=t.trim().toLowerCase();return[...r?e.filter(e=>[e.email,e.name,e.canonical].some(e=>e!=null&&e.toLowerCase().includes(r))):e.slice()].sort((e,t)=>!n.has(e.userId)-+!n.has(t.userId))}function $e(e,t){let n=e.filter(e=>e.source===`discovered`),r=t.trim().toLowerCase();return r?n.filter(e=>(e.displayName??e.agentId).toLowerCase().includes(r)||e.agentId.toLowerCase().includes(r)):n}function et(e){let t=e.name?.trim()??``,n=e.email?.trim()??``,r=e.canonical?.trim()||`u-${e.userId.slice(0,8)}`;return t?{primary:t,secondary:n||`@${r}`}:n?{primary:n,secondary:null}:{primary:`@${r}`,secondary:null}}function tt(e){switch(e){case`admin`:return me();case`user`:return _e();case`pending`:return ce();default:return e}}function nt(e,t){if(e.length===0)return`none`;let n=0;for(let r of e)t(r)&&n++;return n===0?`none`:n===e.length?`all`:`some`}function rt(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=Math.min(Math.max(1,Math.floor(t)),r),a=(i-1)*n;return{pageItems:e.slice(a,a+n),page:i,pageCount:r}}var $=n(),it={name:``,description:``};function at(){let e=T(R.groups.listGroups,{}),t=T(R.me.getMe,{host:He})?.role===`admin`,n=B(R.groups.createGroup),r=B(R.groups.updateGroup),s=B(R.groups.deleteGroup),f=ze(),m=G(),[g,v]=(0,Q.useState)(!1),[x,C]=(0,Q.useState)(null),[w,E]=(0,Q.useState)(it),[D,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(``),N=(0,Q.useMemo)(()=>{if(!e)return e;let t=j.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,j]);function P(){C(null),E(it),v(!0)}function F(e){C(e),E({name:e.name,description:e.description??``}),v(!0)}async function ae(){try{x?await r({groupId:x._id,name:w.name,description:w.description}):await n({name:w.name,description:w.description||void 0}),E(it),C(null),v(!1)}catch(e){m.error(O(),e)}}async function I(e){if(await f({title:y({name:e.name}),description:c(),confirmWord:e.name,confirmLabel:l(),cancelLabel:b(),destructive:!0}))try{await s({groupId:e._id})}catch(e){m.error(o(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:_()}),(0,$.jsx)(Ke,{q:j,onQChange:M,onReset:()=>M(``),canReset:j!==``,searchPlaceholder:De()}),(0,$.jsx)(qe,{title:ve(),rows:N,addLabel:d(),onAdd:t?P:void 0,emptyHint:k(),columns:[{header:re(),cell:e=>e.name,sort:e=>e.name},{header:p(),cell:e=>(0,$.jsx)(Z,{icon:(0,$.jsx)(Ze,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,$.jsx)(Xe,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:ie(),cell:e=>(0,$.jsx)(Z,{icon:(0,$.jsx)(Y,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:a(),cell:e=>(0,$.jsx)(Z,{icon:(0,$.jsx)(Ye,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,$.jsx)(X,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:S(),onSelect:()=>A({groupId:e._id,name:e.name})},...t?[{label:ee(),onSelect:()=>F(e)},{label:h(),variant:`destructive`,onSelect:()=>void I(e)}]:[]]}),(0,$.jsx)(Be,{open:g,onOpenChange:v,title:x?te():ne(),description:fe(),canSubmit:!!w.name.trim(),onSubmit:ae,submitLabel:u(),children:(0,$.jsxs)(`div`,{className:`oc-form`,children:[(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:i()}),(0,$.jsx)(q,{value:w.name,onChange:e=>E({...w,name:e.target.value})})]}),(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:pe()}),(0,$.jsx)(q,{value:w.description,onChange:e=>E({...w,description:e.target.value})})]})]})}),(0,$.jsx)(ct,{groupId:D?.groupId??null,groupName:D?.name??``,open:D!==null,onOpenChange:e=>{e||A(null)}})]})}var ot=8;function st({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,$.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,$.jsxs)(W,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,$.jsx)(Je,{size:14,"aria-hidden":!0}),P()]}),(0,$.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":ue({page:e,pages:t}),children:[e,` / `,t]}),(0,$.jsxs)(W,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[le(),(0,$.jsx)(Ne,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=T(R.groups.getGroup,n&&e?{groupId:e}:`skip`),a=T(R.groups.listAssignableInstances,n?{}:`skip`),o=T(R.groups.listAssignableUsers,n?{}:`skip`),c=B(R.groups.addMember),l=B(R.groups.removeMember),u=B(R.groups.bulkSetMembers),d=B(R.groups.setGroupManager),p=G(),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(``),[ee,te]=(0,Q.useState)(`members`),[ne,y]=(0,Q.useState)(1),[b,x]=(0,Q.useState)(new Set),S=(0,Q.useRef)(null),C=(0,Q.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),re=(0,Q.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),ie=i?.viewerIsAdmin===!0,O=(0,Q.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,Q.useEffect)(()=>{h(``),_(``),te(`members`),y(1),S.current=null},[n,e]),(0,Q.useEffect)(()=>{y(1)},[m]),(0,Q.useEffect)(()=>{n&&i&&e&&S.current!==e&&(S.current=e,x(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let k=(0,Q.useMemo)(()=>o?Qe(o,m,b):[],[o,m,b]);async function j(t,n){if(e)try{n?await l({groupId:e,userId:t}):await c({groupId:e,userId:t})}catch(e){p.error(Oe(),e)}}async function M(t,n){if(e)try{await d({groupId:e,userId:t,manager:!n})}catch(e){p.error(D(),e)}}let N=nt(k,e=>C.has(e.userId)),P=k.filter(e=>C.has(e.userId)).length,F=rt(k,ne,ot);async function I(){if(!e||k.length===0)return;let t=k.map(e=>e.userId);try{await u({groupId:e,userIds:t,member:N!==`all`})}catch(e){p.error(Oe(),e)}}return(0,$.jsx)(Fe,{open:n,onOpenChange:r,children:(0,$.jsxs)(Me,{className:`oc-access`,children:[(0,$.jsxs)(Ve,{children:[(0,$.jsx)(Ue,{children:E({name:t})}),(0,$.jsx)(Re,{children:we()})]}),(0,$.jsxs)(je,{value:ee,onValueChange:te,className:`oc-access__tabs`,children:[(0,$.jsxs)(Ae,{className:`w-full`,children:[(0,$.jsxs)(H,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Ze,{size:13,"aria-hidden":!0}),s(),i?(0,$.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:C.size}):null]}),(0,$.jsxs)(H,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Y,{size:13,"aria-hidden":!0}),Te(),i?(0,$.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:O.size}):null]}),(0,$.jsxs)(H,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Ye,{size:13,"aria-hidden":!0}),se(),i?(0,$.jsx)(K,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,$.jsx)(U,{value:`members`,children:o===void 0||i===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:L()}):o.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:xe()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(q,{value:m,onChange:e=>h(e.target.value),placeholder:w(),className:`oc-access__search`}),k.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:Ee()}):(0,$.jsxs)($.Fragment,{children:[k.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(J,{checked:N===`all`?!0:N===`some`?`indeterminate`:!1,onCheckedChange:()=>void I(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()}),(0,$.jsxs)(K,{variant:`outline`,className:`oc-access__count`,children:[P,` / `,k.length]})]}):null,(0,$.jsx)(`div`,{className:`oc-access__list`,children:F.pageItems.map(e=>{let t=C.has(e.userId),n=et(e),r=re.has(e.userId);return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(J,{checked:t,onCheckedChange:()=>void j(e.userId,t),"aria-label":oe({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]}),(0,$.jsx)(K,{variant:`outline`,className:`oc-access__role`,children:tt(e.role)}),(0,$.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&ie?(0,$.jsx)(W,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?A():f(),title:r?A():f(),onClick:()=>void M(e.userId,r),children:(0,$.jsx)(Xe,{size:15,"aria-hidden":!0})}):t&&r?(0,$.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":v(),title:v(),children:(0,$.jsx)(Xe,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,$.jsx)(st,{page:F.page,pageCount:F.pageCount,onPage:y})]})]})}),(0,$.jsx)(U,{value:`agents`,children:a===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:L()}):a.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ge()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(q,{value:g,onChange:e=>_(e.target.value),placeholder:ae(),className:`oc-access__search`}),(0,$.jsx)(`div`,{className:`oc-access__list`,children:a.map(t=>(0,$.jsx)(lt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:O,query:g},`${e}-${t._id}`))})]})}),(0,$.jsx)(U,{value:`charts`,children:(0,$.jsx)(ut,{groupId:e})})]})]})})}function lt({groupId:e,instanceName:t,kind:n,assigned:r,query:i}){let a=T(R.groups.listAssignableAgents,{instanceName:t}),o=B(R.groups.assignAgentToGroup),s=B(R.groups.removeAgentFromGroup),c=B(R.groups.bulkSetGroupAgents),l=G(),[u,d]=(0,Q.useState)(1);if((0,Q.useEffect)(()=>{d(1)},[i]),!e)return null;let f=$e(a?.agents??[],i),p=a?.discovery&&!a.discovery.lastPollOk;if(i.trim()&&f.length===0)return null;let m=f.filter(e=>e.presentInLastOk!==!1),h=nt(m,e=>r.has(`${t}/${e.agentId}`)),g=rt(f,u,ot);async function _(n,r){try{r?await s({groupId:e,instanceName:t,agentId:n}):await o({groupId:e,instanceName:t,agentId:n})}catch(e){l.error(C(),e)}}async function v(){if(m.length===0)return;let n=m.map(e=>e.agentId);try{await c({groupId:e,instanceName:t,agentIds:n,assigned:h!==`all`})}catch(e){l.error(C(),e)}}return(0,$.jsxs)(`div`,{className:`oc-access__group`,children:[(0,$.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,$.jsx)(Y,{size:13,"aria-hidden":!0}),(0,$.jsx)(`span`,{children:t}),(0,$.jsx)(K,{variant:`outline`,className:`oc-access__kind`,children:n}),p?(0,$.jsx)(K,{variant:`outline`,className:`oc-access__stale`,children:be()}):null]}),a===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:I()}):f.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:p?de():F()}):(0,$.jsxs)($.Fragment,{children:[m.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(J,{checked:h===`all`?!0:h===`some`?`indeterminate`:!1,onCheckedChange:()=>void v(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()})]}):null,g.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1;return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(J,{checked:i,disabled:a&&!i,onCheckedChange:()=>void _(e.agentId,i),"aria-label":Ce({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,e.isDefaultOnInstance?(0,$.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":Se(),title:Se(),children:(0,$.jsx)(X,{size:14,fill:`currentColor`})}):null,a?(0,$.jsx)(K,{variant:`outline`,className:`oc-access__gone`,children:he()}):null]},e.agentId)}),(0,$.jsx)(st,{page:g.page,pageCount:g.pageCount,onPage:d})]})]})}function ut({groupId:e}){let t=T(R.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=B(R.charts.assignChartToGroup),i=B(R.charts.removeChartFromGroup),a=B(R.charts.setGroupDefaultChart),o=B(R.charts.addChartToGroupPool),s=B(R.charts.removeChartFromGroupPool),c=G();if(!e)return null;if(t===void 0)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:L()});let{pool:l,addable:u,canManagePool:d}=t;if(l.length===0&&!d)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:r()});async function f(t,r){try{r?await i({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){c.error(m(),e)}}async function p(t){try{await a({groupId:e,chartKey:t})}catch(e){c.error(m(),e)}}async function h(t){try{await o({groupId:e,chartKey:t})}catch(e){c.error(m(),e)}}async function _(t){try{await s({groupId:e,chartKey:t})}catch(e){c.error(m(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`oc-access__list`,children:l.map(e=>(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(J,{checked:e.selected,onCheckedChange:()=>void f(e.chartKey,e.selected),"aria-label":M({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":g(),title:g(),children:(0,$.jsx)(X,{size:14,fill:`currentColor`})}):(0,$.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void p(e.chartKey),children:ye()}):null,d?(0,$.jsx)(W,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":j({name:e.name}),title:j({name:e.name}),onClick:()=>void _(e.chartKey),children:(0,$.jsx)(ke,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),d?u.length>0?(0,$.jsxs)(Ge,{value:``,onValueChange:e=>void h(e),children:[(0,$.jsx)(Ie,{size:`sm`,className:`oc-access__search`,children:(0,$.jsx)(Pe,{placeholder:N()})}),(0,$.jsx)(Le,{children:u.map(e=>(0,$.jsx)(We,{value:e.chartKey,children:e.name},e.chartKey))})]}):l.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:x()}):null:null]})}export{at as GroupsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$h as r,$u as i,Ag as a,Ah as o,Bg as s,Bh as c,Cg as l,Ch as u,Dg as d,Dh as f,ES as p,Eg as m,Eh as h,Fg as g,Fh as _,Gh as v,Hg as y,Hh as b,Ig as x,Ih as S,Jh as C,Kh as w,Lg as T,Lh as E,Mg as ee,Mh as te,Ng as ne,Nh as re,Og as ie,Oh as ae,Pg as oe,Ph as se,Qh as ce,Qu as le,Rg as ue,Rh as de,SD as D,Sg as fe,Sh as pe,TD as O,TS as me,Tg as he,Th as ge,Ug as _e,Uh as ve,Vg as ye,Vh as be,Wh as xe,Xh as Se,Yh as Ce,Zh as we,_g as Te,_h as Ee,ag as k,ah as De,bg as Oe,bh as ke,cg as Ae,ch as je,dg as Me,dh as Ne,eg as Pe,fg as Fe,fh as Ie,gg as Le,gh as Re,hg as ze,hh as Be,ig as Ve,ih as A,jg as He,jh as Ue,kg as j,kh as We,lg as Ge,lh as Ke,mg as qe,mh as Je,ng as Ye,og as Xe,oh as Ze,pg as Qe,ph as $e,qh as et,rg as tt,rh as nt,sg as rt,sh as it,tg as at,ug as ot,uh as st,vD as M,vg as ct,vh as lt,wD as N,wg as ut,wh as P,xg as dt,xh as ft,yg as pt,yh as mt,zg as ht,zh as gt}from"./dist-CSHwMvoK.js";import{a as _t,c as vt}from"./FieldLabel-DszF6BCc.js";import{t as F}from"./button-Do9b0Kl0.js";import{$ as I,A as L,C as R,H as yt,Q as z,S as B,U as bt,V as xt,X as V,Z as H,_ as U,b as W,et as G,j as St,m as Ct,nt as K,rt as q,x as J,y as wt}from"./index-Djd_7VwF.js";import{t as Tt}from"./DataTableShell-CXnilHFx.js";import{InstanceConfigDialog as Et}from"./BridgeTab-BrpHY1vH.js";var Y=t(e(),1),X=[`conversational`,`documentary`],Dt=new Set(X),Ot=`conversational`;function kt(e){let t=new Set((e??[]).filter(e=>Dt.has(e)));return t.size===0?[Ot]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:_t},At={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function jt(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``,streamTransport:e.streamTransport??`reactive`}}function Mt(){let e=O(M.admin.listInstances,{}),t=O(M.agents.listAllInstanceAgents,{}),n=N(M.admin.upsertInstance),r=N(M.admin.deleteInstance),o=L(),[c,u]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(Q),[h,_]=(0,Y.useState)(null),[v,b]=(0,Y.useState)(null),[S,C]=(0,Y.useState)(null),[w,E]=(0,Y.useState)(null);async function te(){try{await n({instanceId:w??void 0,name:f.name,gatewayUrl:f.gatewayUrl,bridgeUrl:f.bridgeUrl||void 0,displayName:f.displayName||void 0,kind:f.kind,gatewayVersion:f.gatewayVersion||void 0,gatewayHttpUrl:f.gatewayHttpUrl||void 0,streamTransport:f.streamTransport}),p(Q),E(null),u(!1)}catch(e){o.error(ye(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[s(),(0,Z.jsx)(`strong`,{children:ht()}),ue()]}),(0,Z.jsx)(Tt,{title:T(),rows:e,addLabel:x(),onAdd:()=>{E(null),p(Q),u(!0)},emptyHint:g(),columns:[{header:oe(),cell:e=>e.name,sort:e=>e.name},{header:ne(),cell:e=>(0,Z.jsx)(V,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:ee(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:He(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:_e(),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)(V,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?A():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:d(),onSelect:()=>{E(e._id),p(jt(e)),u(!0)}},{label:y(),onSelect:()=>_(e.name)},{label:Fe(),onSelect:()=>C(e)},{label:a(),onSelect:()=>b(e)},{label:j(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:j(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(Ct,{open:c,onOpenChange:u,title:w?m():ie(),description:ut(),canSubmit:!!(f.name&&f.gatewayUrl),onSubmit:te,submitLabel:l(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:fe(),children:[(0,Z.jsx)(H,{value:f.name,disabled:w!==null,onChange:e=>p({...f,name:e.target.value})}),w?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:he()}):null]}),(0,Z.jsx)($,{label:dt(),children:(0,Z.jsxs)(wt,{value:f.kind,onValueChange:e=>p({...f,kind:e}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(R,{})}),(0,Z.jsxs)(W,{children:[(0,Z.jsx)(J,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(J,{value:`hermes`,children:`Hermes`})]})]})}),(0,Z.jsx)($,{label:Oe(),children:(0,Z.jsx)(H,{value:f.gatewayUrl,onChange:e=>p({...f,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:pt(),children:(0,Z.jsx)(H,{value:f.bridgeUrl,placeholder:ct(),onChange:e=>p({...f,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:Te(),children:(0,Z.jsx)(H,{value:f.displayName,onChange:e=>p({...f,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:i(),children:[(0,Z.jsxs)(wt,{value:f.streamTransport,onValueChange:e=>p({...f,streamTransport:e}),children:[(0,Z.jsx)(B,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(R,{})}),(0,Z.jsx)(W,{children:vt.map(e=>(0,Z.jsx)(J,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:le()})]}),(0,Z.jsx)($,{label:Le(),children:(0,Z.jsx)(H,{value:f.gatewayVersion,placeholder:ze(),onChange:e=>p({...f,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:qe(),children:(0,Z.jsx)(H,{value:f.gatewayHttpUrl,placeholder:Qe(),onChange:e=>p({...f,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Ht,{instanceName:h,open:h!==null,onOpenChange:e=>{e||_(null)}}),v?(0,Z.jsx)(Et,{instance:v,onClose:()=>b(null)},v._id):null,S?(0,Z.jsx)(Nt,{instance:S,onClose:()=>C(null)},S._id):null]})}function Nt({instance:e,onClose:t}){let n=O(M.instanceSecrets.listInstanceSecretStatus,{}),r=At[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)(z,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(I,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(K,{children:[(0,Z.jsx)(q,{children:Me({instance:e.displayName??e.name})}),(0,Z.jsx)(G,{children:ot()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(It,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Ft,{instance:e})}),(0,Z.jsx)(Pt,{instance:e})]})})}function Pt({instance:e}){let t=D(M.instanceSync.forceInstanceSync),n=L(),[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(xe());break;case`no_agents`:n.success(b());break;case`no_bridge_url`:n.error(be());break;case`deploy_misconfigured`:n.error(c());break;case`unauthorized`:n.error(de());break;case`not_served`:n.error(E());break;default:n.error(gt());break}}catch(e){n.error(ve(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:S()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(F,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?v():w()})})]})}function Ft({instance:e}){let t=O(M.bridgeAuth.listBridgeAuthStatus,{}),n=D(M.bridgeAuth.mintBridgeSecret),r=N(M.bridgeAuth.revokeBridgeSecret),i=L(),[a,s]=(0,Y.useState)(!1),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(!1),m=(t??[]).find(t=>t.instanceId===e._id),h=m!==void 0;async function g(){if(!a){s(!0);try{l((await n({instanceId:e._id})).plaintext),d(!1)}catch(e){i.error(We(),e)}finally{s(!1)}}}async function v(){if(!a){s(!0);try{await r({instanceId:e._id}),l(null),i.success(o())}catch(e){i.error(We(),e)}finally{s(!1)}}}async function y(){if(c)try{await navigator.clipboard.writeText(c),d(!0)}catch{}}return(0,Z.jsxs)($,{label:_(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:se()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(V,{variant:h?`outline`:`secondary`,children:h?`${Xe()} · ${m.prefix}…${m.lastFour}`:k()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(F,{size:`sm`,onClick:()=>void g(),disabled:a,children:h?te():re()}),h?(0,Z.jsx)(F,{size:`sm`,variant:`destructive`,onClick:()=>void v(),disabled:a,children:Ue()}):null]})]}),c?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:ae()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:c}),(0,Z.jsx)(F,{variant:`outline`,size:`sm`,onClick:()=>void y(),children:u?p():me()})]}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,onClick:()=>{l(null),d(!1)},children:f()})]}):null]})}function It({instanceId:e,field:t,updatedAt:n}){let i=D(M.instanceSecrets.setInstanceSecret),a=N(M.instanceSecrets.clearInstanceSecret),o=D(M.deviceIdentity.generateDeviceIdentity),s=L(),[c,l]=(0,Y.useState)(``),[u,d]=(0,Y.useState)(!1),[m,h]=(0,Y.useState)(null),[g,_]=(0,Y.useState)(!1),v=n!==null,y=t===`deviceIdentity`,b=t===`token`?Ge():t===`deviceIdentity`?Ae():rt();async function x(){if(!(!c.trim()||u)){d(!0);try{await i({instanceId:e,field:t,plaintext:c}),l(``),h(null),_(!1),s.success(Pe())}catch(e){s.error(r(),e)}finally{d(!1)}}}async function S(){if(!u){d(!0);try{await a({instanceId:e,field:t}),h(null),_(!1),s.success(ce())}catch(e){s.error(r(),e)}finally{d(!1)}}}async function w(){if(!u){d(!0);try{h(await o({instanceId:e})),_(!1),s.success(Ce())}catch(e){s.error(et(),e)}finally{d(!1)}}}let T=m?`openclaw devices approve ${m.id}`:``;async function E(){if(T)try{await navigator.clipboard.writeText(T),_(!0)}catch{}}return(0,Z.jsxs)($,{label:b,children:[y?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Se()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(V,{variant:v?`outline`:`secondary`,children:v?Xe():k()}),(0,Z.jsx)(H,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:c,placeholder:v?tt():Ve(),onChange:e=>l(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(F,{size:`sm`,onClick:()=>void x(),disabled:u||c.trim().length===0,children:Ye()}),y?(0,Z.jsx)(F,{size:`sm`,variant:`outline`,onClick:()=>void w(),disabled:u,children:we()}):null,v?(0,Z.jsx)(F,{size:`sm`,variant:`destructive`,onClick:()=>void S(),disabled:u,children:at()}):null]})]}),m?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:Ce()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:C()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:T}),(0,Z.jsx)(F,{variant:`outline`,size:`sm`,onClick:()=>void E(),children:g?p():me()})]}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,onClick:()=>{h(null),_(!1)},children:f()})]}):null]})}var Lt={conversational:mt,documentary:Ee},Rt={conversational:lt,documentary:Re},zt=e=>(Lt[e]??(()=>e))(),Bt=e=>(Rt[e]??(()=>``))();function Vt({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:u()}),t.map(e=>(0,Z.jsx)(V,{variant:`secondary`,className:`oc-agenttype__chip`,title:Bt(e),children:zt(e)},e)),(0,Z.jsxs)(xt,{children:[(0,Z.jsx)(bt,{asChild:!0,children:(0,Z.jsx)(F,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:pe()})}),(0,Z.jsxs)(yt,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:ft()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:ke()}),(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)(U,{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:zt(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:Bt(r)})]})]},r)})})]})]})]})}function Ht({instanceName:e,open:t,onOpenChange:n}){let r=O(M.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=N(M.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(M.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(M.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),a=N(M.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(M.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(M.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),o=N(M.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(M.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=kt(r);e.setQuery(M.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),s=N(M.agents.removeInstanceAgent),c=St(),l=L();async function u(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){l.error(P(),e)}}async function d(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){l.error(P(),e)}}async function f(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await o({instanceName:e,agentId:t,types:i})}catch(e){l.error(P(),e)}}async function p(t,n){if(e&&await c({title:$e({name:n}),description:Ie(),confirmLabel:Ne(),destructive:!0}))try{await s({instanceName:e,agentId:t}),l.success(st())}catch(e){l.error(P(),e)}}return(0,Z.jsx)(z,{open:t,onOpenChange:n,children:(0,Z.jsxs)(I,{className:`oc-access`,children:[(0,Z.jsxs)(K,{children:[(0,Z.jsx)(q,{children:h({name:e??``})}),(0,Z.jsx)(G,{children:ge()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:Ke()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?je():r.discovery.lastPollOk?it():Ze({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:De()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(e=>{let t=e.presentInLastOk===!1,n=r.defaultAgentId===e.agentId,i=e.displayName??e.agentId,a=e.types??[];return(0,Z.jsxs)(`div`,{className:`oc-agentcard`+(e.enabled?``:` oc-agentcard--off`),children:[(0,Z.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,Z.jsx)(U,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void u(e.agentId,t===!0)}),(0,Z.jsxs)(`span`,{className:`oc-agentcard__name`,title:i,children:[e.emoji?`${e.emoji} `:``,i]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,t?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(V,{variant:`outline`,className:`oc-access__gone`,children:nt()}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void p(e.agentId,i),children:Je()})]}):n?(0,Z.jsx)(V,{variant:`default`,children:A()}):(0,Z.jsx)(F,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void d(e.agentId),children:Be()})]}),e.enabled?(0,Z.jsx)(Vt,{agentId:e.agentId,types:a,onToggle:t=>void f(e.agentId,t,a)}):null]},e.agentId)})})]})]})})}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{Mt as InstancesTab};
@@ -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,Bv as a,Cv as o,Dv as s,Ev as c,Fv as l,Gv as ee,Hv as te,Iv as ne,Jv as re,Kv as ie,Lv as ae,Mv as oe,Nv as se,Ov as u,Pv as ce,Qv as d,Rv as le,SD as f,Sv as p,TD as m,Tv as h,Uv as g,Vv as _,Wv as v,Xv as ue,Yv as de,Zv as y,_t as b,ay as x,bv as S,cy as C,dt as w,dy as T,ey as E,ft as D,gt as O,ht as k,iy as A,jv as j,kv as M,ly as N,mt as P,ny as F,oy as I,pt as L,qv as R,ry as z,sy as B,ty as V,ut as H,uy as fe,vD as U,vt as pe,wD as W,wv as me,xv as he,yv as ge,zv as _e}from"./dist-CSHwMvoK.js";import{t as G}from"./button-Do9b0Kl0.js";import{C as ve,S as ye,X as K,Z as q,_ as be,b as xe,x as Se,y as Ce}from"./index-Djd_7VwF.js";import{t as we}from"./DataTableShell-CXnilHFx.js";var J=t(e(),1),Y=n();function Te(){let e=m(U.integrations.status.status,{}),t=W(U.admin.setIntegrationConfig),[n,f]=(0,J.useState)(null);if((0,J.useEffect)(()=>{e&&n===null&&f(e.config)},[e,n]),!e||!n)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:T()});let w=n,D=(e,t,n)=>f({...w,[e]:{...w[e],[t]:n}}),k=(e,n)=>void t({[e]:n});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[fe(),` `,(0,Y.jsx)(`strong`,{children:N()}),` `,C()]}),(0,Y.jsxs)(X,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:B()}):(0,Y.jsx)(K,{variant:`outline`,children:I()}):(0,Y.jsx)(K,{variant:`outline`,children:x()}),note:z(),children:[(0,Y.jsx)(Z,{label:V(),children:(0,Y.jsx)(q,{value:w.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>D(`langfuse`,`host`,e.target.value),onBlur:()=>k(`langfuse`,{host:w.langfuse.host??``})})}),(0,Y.jsx)(Q,{label:y(),checked:w.langfuse.enabled??!0,onChange:e=>{D(`langfuse`,`enabled`,e),k(`langfuse`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:B()}):(0,Y.jsx)(K,{variant:`outline`,children:I()}):(0,Y.jsx)(K,{variant:`outline`,children:x()}),note:F(),children:[(0,Y.jsx)(Z,{label:E(),children:(0,Y.jsx)(q,{value:w.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>D(`opik`,`baseUrl`,e.target.value),onBlur:()=>k(`opik`,{baseUrl:w.opik.baseUrl??``})})}),(0,Y.jsx)(Z,{label:r(),children:(0,Y.jsx)(q,{value:w.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||d(),onChange:e=>D(`opik`,`workspace`,e.target.value),onBlur:()=>k(`opik`,{workspace:w.opik.workspace??``})})}),(0,Y.jsx)(Q,{label:y(),checked:w.opik.enabled??!0,onChange:e=>{D(`opik`,`enabled`,e),k(`opik`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:B()}):(0,Y.jsx)(K,{variant:`outline`,children:I()}):(0,Y.jsx)(K,{variant:`outline`,children:pe()}),note:b(),children:[(0,Y.jsx)(Z,{label:O(),children:(0,Y.jsx)(q,{value:w.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>D(`otlp`,`endpoint`,e.target.value),onBlur:()=>k(`otlp`,{endpoint:w.otlp.endpoint??``})})}),(0,Y.jsx)(Ee,{headersSet:e.otlp.headersSet}),(0,Y.jsx)(Q,{label:y(),checked:w.otlp.enabled??!0,onChange:e=>{D(`otlp`,`enabled`,e),k(`otlp`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:ue(),status:(0,Y.jsx)(K,{variant:`outline`,children:A()}),note:de(),children:[(0,Y.jsx)(Z,{label:re(),children:(0,Y.jsx)($,{value:w.tts.auto??`off`,options:[[`off`,R()],[`always`,ie()],[`inbound`,ee()],[`tagged`,v()]],onChange:e=>{D(`tts`,`auto`,e),k(`tts`,{auto:e})}})}),(0,Y.jsx)(Z,{label:g(),children:(0,Y.jsx)($,{value:w.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,te()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{D(`tts`,`provider`,e),k(`tts`,{provider:e})}})}),(0,Y.jsx)(Z,{label:_(),children:(0,Y.jsx)(q,{value:w.tts.model??``,placeholder:`eleven_multilingual_v2`,onChange:e=>D(`tts`,`model`,e.target.value),onBlur:()=>k(`tts`,{model:w.tts.model??``})})}),(0,Y.jsx)(Z,{label:a(),children:(0,Y.jsx)(q,{value:w.tts.voice??``,placeholder:_e(),onChange:e=>D(`tts`,`voice`,e.target.value),onBlur:()=>k(`tts`,{voice:w.tts.voice??``})})})]}),(0,Y.jsxs)(X,{title:le(),status:(0,Y.jsx)(K,{variant:`outline`,children:A()}),note:e.secrets.openai?ae():ne(),children:[(0,Y.jsx)(Q,{label:l(),checked:w.talk.enabled??!1,onChange:e=>{D(`talk`,`enabled`,e),k(`talk`,{enabled:e})}}),(0,Y.jsx)(Z,{label:ce(),children:(0,Y.jsx)($,{value:w.talk.realtimeProvider??`openai`,options:[[`openai`,`OpenAI (gpt-realtime)`],[`google`,`Google`]],onChange:e=>{D(`talk`,`realtimeProvider`,e),k(`talk`,{realtimeProvider:e})}})}),(0,Y.jsx)(Z,{label:se(),children:(0,Y.jsx)(q,{value:w.talk.realtimeModel??``,placeholder:`gpt-realtime-2`,onChange:e=>D(`talk`,`realtimeModel`,e.target.value),onBlur:()=>k(`talk`,{realtimeModel:w.talk.realtimeModel??``})})}),(0,Y.jsx)(Z,{label:a(),children:(0,Y.jsx)(q,{value:w.talk.voice??``,placeholder:`cedar / marin`,onChange:e=>D(`talk`,`voice`,e.target.value),onBlur:()=>k(`talk`,{voice:w.talk.voice??``})})}),(0,Y.jsx)(Z,{label:oe(),children:(0,Y.jsx)($,{value:w.talk.transport??`webrtc`,options:[[`webrtc`,j()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{D(`talk`,`transport`,e),k(`talk`,{transport:e})}})}),(0,Y.jsx)(Z,{label:i(),children:(0,Y.jsx)(q,{value:w.talk.speechLocale??``,placeholder:`fr-CA`,onChange:e=>D(`talk`,`speechLocale`,e.target.value),onBlur:()=>k(`talk`,{speechLocale:w.talk.speechLocale??``})})}),(0,Y.jsx)(Q,{label:M(),checked:w.talk.interruptOnSpeech??!0,onChange:e=>{D(`talk`,`interruptOnSpeech`,e),k(`talk`,{interruptOnSpeech:e})}})]}),(0,Y.jsxs)(`section`,{className:`oc-int__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,Y.jsx)(`h3`,{className:`oc-uipa__h`,children:u()}),(0,Y.jsx)(K,{variant:`outline`,children:s()})]}),(0,Y.jsxs)(`p`,{className:`oc-uipa__note`,children:[c(),(0,Y.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,Y.jsx)(we,{title:h(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:me(),columns:[{header:o(),cell:e=>(0,Y.jsx)(K,{variant:`secondary`,children:e.vendor}),sort:e=>e.vendor},{header:p(),cell:e=>e.lastAt>0?new Date(e.lastAt).toLocaleString(`fr-FR`):`—`,sort:e=>e.lastAt>0?e.lastAt:null},{header:he(),cell:e=>String(e.failureCount),sort:e=>e.failureCount},{header:S(),cell:e=>e.lastErrorStatus??`—`,sort:e=>e.lastErrorStatus??null},{header:ge(),cell:e=>e.lastError??`—`,sort:e=>e.lastError??null}]})]})}function X({title:e,status:t,note:n,children:r}){return(0,Y.jsxs)(`section`,{className:`oc-int__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,Y.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,Y.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function Z({label:e,children:t}){return(0,Y.jsxs)(`label`,{className:`oc-int__field`,children:[(0,Y.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function Q({label:e,checked:t,onChange:n}){return(0,Y.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,Y.jsx)(be,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,Y.jsx)(`span`,{children:e})]})}function $({value:e,options:t,onChange:n}){return(0,Y.jsxs)(Ce,{value:e,onValueChange:n,children:[(0,Y.jsx)(ye,{size:`sm`,className:`w-full`,children:(0,Y.jsx)(ve,{})}),(0,Y.jsx)(xe,{children:t.map(([e,t])=>(0,Y.jsx)(Se,{value:e,children:t},e))})]})}function Ee({headersSet:e}){let t=f(U.integrations.otlpSecret.setOtlpHeaders),n=W(U.integrations.otlpSecret.clearOtlpHeaders),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(null),[s,c]=(0,J.useState)(!1),l=async()=>{c(!0),o(null);try{await t({headersJson:r}),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{c(!1)}};return(0,Y.jsxs)(Z,{label:k(),children:[(0,Y.jsx)(q,{value:r,placeholder:e?P():L(),onChange:e=>i(e.target.value)}),(0,Y.jsxs)(`div`,{className:`oc-int__otlp-headers-actions`,children:[(0,Y.jsx)(G,{size:`sm`,disabled:s||r.trim().length===0,onClick:()=>void l(),children:D()}),e?(0,Y.jsx)(G,{variant:`ghost`,size:`sm`,disabled:s,onClick:()=>void n({}),children:w()}):null]}),a?(0,Y.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:a}):null,(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:H()})]})}export{Te as IntegrationsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Cl as r,El as i,Fy as a,Gy as o,Iy as s,Ky as c,Sl as l,TD as u,Tl as d,Uy as f,Wy as p,_b as m,_l as h,bl as g,gl as _,hl as v,ml as y,pl as b,vD as x,vl as S,wl as C,xl as w,yl as ee}from"./dist-CSHwMvoK.js";import{Mt as te,a as ne,jt as re,n as T,ot as E,r as D}from"./index-Djd_7VwF.js";import{a as O,n as k,o as A,r as j,t as M}from"./card-DtbnXpuR.js";import{n as N,t as P}from"./TimeRangePicker-DatsuATN.js";var F=t(e(),1),I=n(),L=15,R=e=>String(Math.round(e));function z(){let e=u(x.me.getMe,{host:E})?.permissions?.includes(`traces.read`)??!1,t=u(x.deliveryTiming.listDeliverySessions,e?{}:`skip`),n=(0,F.useMemo)(()=>t?t.filter(e=>!e.active&&e.rollup!==null&&e.rollup.cP50!==null&&e.rollup.aP50!==null).slice(0,L).reverse().map(e=>({startedAt:e.startedAt,cP50:e.rollup?.cP50,aP50:e.rollup?.aP50})):[],[t]);return t===void 0?null:(0,I.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,I.jsx)(`h2`,{className:`oc-kpi__group-title`,children:m()}),(0,I.jsxs)(M,{children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{children:c()}),(0,I.jsx)(j,{children:p()})]}),(0,I.jsx)(k,{children:n.length<2?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):(0,I.jsx)(B,{series:n})})]})]})}function B({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),l=e=>74-e*68/r,u=e=>e.map((e,t)=>`${t===0?`M`:`L`}${i(t).toFixed(1)},${l(e).toFixed(1)}`).join(` `),d=e[e.length-1];return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex gap-3 text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{style:{color:`var(--primary)`},children:[a(),` p50 `,R(d.cP50),` `,o()]}),(0,I.jsxs)(`span`,{children:[s(),` p50 `,R(d.aP50),` `,o()]})]}),(0,I.jsxs)(`svg`,{viewBox:`0 0 480 80`,className:`h-20 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":c(),children:[(0,I.jsx)(`path`,{d:u(n),fill:`none`,style:{stroke:`var(--muted-foreground)`},strokeWidth:1.5}),(0,I.jsx)(`path`,{d:u(t),fill:`none`,style:{stroke:`var(--primary)`},strokeWidth:1.5})]})]})}var V=[{metric:`api.calls`,label:i(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:d(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:C(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:r(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:l(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:w(),unit:`/h`,group:`Assistant`,isError:!0}],H=V.length,U=[`API`,`OpenClaw`,`Chat`,`Assistant`],W=1e3,G=36e5;function K(e,t){let n=Math.max(1,Math.ceil((t-e)/G)),r=Math.min(n*H,W);return{rowLimit:r,buckets:Math.max(1,Math.floor(r/H))}}function q(){let e=te({from:`/settings/kpi`}),t=re({from:`/settings/kpi`}),n=D(e.from,e.to,T,`now`),r=e=>void t({search:t=>({...t,...ne(e)})}),{from:i,to:a}=N(n),{rowLimit:o,buckets:s}=K(i,a),c=u(x.kpi.listKpis,{limit:o,filter:{from:i,to:a}}),l=(0,F.useMemo)(()=>{let e=new Map;for(let t of c??[]){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>s&&e.set(t,n.slice(n.length-s));return e},[c,s]),d=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[g(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:ee()})]}),(0,I.jsx)(J,{value:n,onChange:r})]});return c===void 0?(0,I.jsxs)(I.Fragment,{children:[d,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:S()})]}):c.length===0?(0,I.jsxs)(I.Fragment,{children:[d,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:h()})]}):(0,I.jsxs)(I.Fragment,{children:[d,(0,I.jsx)(z,{}),U.map(e=>{let t=V.filter(t=>t.group===e);return t.some(e=>(l.get(e.metric)??[]).length>0)?(0,I.jsxs)(`section`,{className:`oc-kpi__group`,children:[(0,I.jsx)(`h2`,{className:`oc-kpi__group-title`,children:e}),(0,I.jsx)(`div`,{className:`oc-kpi__grid`,children:t.map(e=>(0,I.jsx)(Y,{config:e,series:l.get(e.metric)??[]},e.metric))})]},e):null})]})}function J({value:e,onChange:t}){return(0,I.jsx)(`div`,{className:`oc-kpi__toolbar`,children:(0,I.jsx)(P,{value:e,onChange:t})})}function Y({config:e,series:t}){let n=t.length>0?t[t.length-1]:null,r=n?n.value:0;return(0,I.jsxs)(M,{size:`sm`,className:`oc-kpi__card`,children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{className:`oc-kpi__card-title`,children:e.label}),(0,I.jsx)(j,{className:`oc-kpi__card-metric`,children:(0,I.jsx)(`code`,{children:e.metric})})]}),(0,I.jsxs)(k,{className:`oc-kpi__card-body`,children:[(0,I.jsxs)(`div`,{className:`oc-kpi__value-row`,children:[(0,I.jsx)(`span`,{className:`oc-kpi__value`+(e.isError&&r>0?` oc-kpi__value--error`:``),children:Q(r)}),(0,I.jsx)(`span`,{className:`oc-kpi__unit`,children:e.unit})]}),(0,I.jsx)(ae,{series:t,isError:e.isError,unit:e.unit}),(0,I.jsxs)(`div`,{className:`oc-kpi__axis`,children:[n?(0,I.jsx)(`span`,{className:`oc-kpi__axis-latest`,children:_({value:$(n.bucket)})}):(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:v()}),(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:y({count:t.length})})]})]})]})}var X=240,Z=48,ie=1;function ae({series:e,isError:t,unit:n}){if(e.length===0)return(0,I.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-ie,1);return(0,I.jsx)(`svg`,{className:`oc-kpi__chart`,viewBox:`0 0 ${X} ${Z}`,preserveAspectRatio:`none`,role:`img`,"aria-label":b({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,I.jsx)(`rect`,{className:`oc-kpi__bar`+(t&&e.value>0?` oc-kpi__bar--error`:``),x:c,y:l,width:a,height:s,children:(0,I.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{q as KpiTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$C as r,AE as i,BC as a,BE as o,Cg as s,DE as c,EE as l,FE as ee,GC as u,GE as d,HC as f,IE as te,JC as p,KC as m,LE as h,ME as g,NE as _,OE as ne,PE as re,QC as v,RC as ie,TD as y,TE as ae,UC as oe,VC as se,WC as ce,XC as le,YC as ue,ZC as de,_w as fe,aw as b,cw as x,dw as S,ew as C,fw as w,gw as T,hw as E,iw as D,jE as O,kE as k,lw as A,mw as j,nw as M,ow as N,pw as P,qC as F,rw as I,sw as L,tw as R,uw as z,vD as B,wD as V,zC as pe}from"./dist-CSHwMvoK.js";import{t as H}from"./button-Do9b0Kl0.js";import{A as me,C as he,O as ge,S as _e,Z as U,_ as W,b as ve,ot as G,x as K,y as ye}from"./index-Djd_7VwF.js";var q=t(e(),1),J=[{id:`messages`,label:()=>fe()},{id:`composer`,label:()=>T()},{id:`sidebar`,label:()=>E()},{id:`other`,label:()=>j()}],Y={showSource:{category:`messages`,label:()=>P(),help:()=>w()},showReport:{category:`messages`,label:()=>S(),help:()=>z()},copyAssistant:{category:`messages`,label:()=>A()},copyUser:{category:`messages`,label:()=>x()},showDelete:{category:`messages`,label:()=>L()},showTools:{category:`messages`,label:()=>N(),help:()=>b()},voiceInput:{category:`composer`,label:()=>D(),help:()=>I()},showChatAge:{category:`sidebar`,label:()=>M(),help:()=>R()},showChatProvider:{category:`sidebar`,label:()=>C(),help:()=>r()}};function X(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function be(e,t){let n=X(t.trim()),r=new Map(J.map(e=>[e.id,e.label()])),i=new Map(J.map(e=>[e.id,[]]));for(let t of e){let e=Y[t],a=e?.category??`other`;n&&!X(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return J.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var xe=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`],Se={voiceInput:`voiceInput`};function Ce(e){return xe.includes(e)}function Z(e){return e===`admin`}function we(e){return e===!0?`on`:e===!1?`off`:`inherit`}function Q(e){return e===`on`?!0:e===`off`?!1:null}function Te(e){return Ce(e)?Se[e]:void 0}var $=n(),Ee={voiceInput:()=>f()};function De({prefKey:e,ui:t}){let n=V(B.admin.setUiPrefDefault),r=V(B.admin.setFeatureEnabled),i=Te(e),o=i?Ee[e]?.():void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,$.jsx)(`span`,{className:`oc-prefs__gov-label`,children:m()}),(0,$.jsxs)(ye,{value:we(t.defaults[e]),onValueChange:t=>void n({key:e,value:Q(t)}),children:[(0,$.jsx)(_e,{size:`sm`,className:`w-36`,children:(0,$.jsx)(he,{})}),(0,$.jsxs)(ve,{children:[(0,$.jsx)(K,{value:`on`,children:a()}),(0,$.jsx)(K,{value:`off`,children:pe()}),(0,$.jsx)(K,{value:`inherit`,children:ie()})]})]}),i?(0,$.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,$.jsx)(W,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":u()}),u()]}):null]}),o?(0,$.jsx)(`span`,{className:`oc-prefs__gov-help`,children:o}):null]})}function Oe(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),i=y(B.me.getMe,{host:G}),a=i?.ui,o=Z(i?.role)&&n,s=V(B.me.setUiPref).withOptimisticUpdate(ge),c=(0,q.useMemo)(()=>a?be(Object.keys(a.effective),e):[],[a,e]);return a?(0,$.jsxs)(`div`,{className:`oc-prefs-panel`,children:[Z(i?.role)?(0,$.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,$.jsx)(W,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":F()}),F()]}):null,o?(0,$.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,$.jsx)(`p`,{children:ce()}),(0,$.jsx)(`p`,{children:oe()}),(0,$.jsx)(`p`,{children:se()})]}):null,(0,$.jsx)(U,{value:e,onChange:e=>t(e.target.value),placeholder:v(),"aria-label":v(),className:`mb-2`}),c.length===0?(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:de()}):(0,$.jsx)(`div`,{className:`oc-prefs`,children:c.map(e=>(0,$.jsxs)(`div`,{className:`oc-prefs__group`,children:[(0,$.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=Y[e],n=t?t.label():e,r=t?.help?.(),i=a.locked[e],c=a.effective[e],l=a.userOverrides[e]!==void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}${l&&!i?` is-overridden`:``}`,children:[(0,$.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,$.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,$.jsx)(`span`,{className:`oc-prefs__lock`,children:le()}):l?null:(0,$.jsx)(`span`,{className:`oc-prefs__def`,children:ue()})]}),r?(0,$.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,$.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&l?(0,$.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void s({key:e,value:null}),children:p()}):null,(0,$.jsx)(W,{checked:c,disabled:i,onCheckedChange:t=>void s({key:e,value:t===!0}),"aria-label":n})]}),o?(0,$.jsx)(De,{prefKey:e,ui:a}):null]},e)})]},e.id))})]}):(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:d()})}function ke(){let e=y(B.me.getMe,{host:G}),t=V(B.me.setLocale),n=V(B.me.setMyName),r=me(),a=e?.locale??`default`,u=e?.name??``,[d,f]=(0,q.useState)(null),p=d??u,m=p.trim()!==u.trim();async function v(){try{await n({name:p}),f(null),r.success(_())}catch(e){r.error(g(),e)}}return(0,$.jsxs)(`div`,{className:`oc-appearance`,children:[(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:h()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:te()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[(0,$.jsx)(U,{className:`max-w-xs`,value:p,maxLength:120,placeholder:ee(),onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&m&&(e.preventDefault(),v())}}),(0,$.jsx)(H,{size:`sm`,disabled:!m,onClick:()=>void v(),children:s()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:re()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:O()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:i()})]}),(0,$.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`,`default`].map(e=>(0,$.jsx)(H,{variant:a===e?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e==="default"?null:e}),children:e===`fr`?l():e===`en`?ae():o()},e))}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:k()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:ne()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:c()})]}),(0,$.jsx)(Oe,{})]})]})}export{ke as PreferencesTab};
@@ -1,2 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Au as r,Bu as i,Fu as a,Gu as o,Hu as s,Iu as c,Ju as l,Ku as u,Lu as d,Mu as f,Nu as p,Pu as m,Ru as h,TD as g,Uu as _,Vu as v,Wu as y,Yu as b,ju as x,nd as S,qu as C,rd as w,vD as T,wD as E,zu as D}from"./dist-CSHwMvoK.js";import{d as O,f as k,i as A,l as j,n as M,r as N,t as P,u as F}from"./FieldLabel-DszF6BCc.js";import{t as I}from"./button-Do9b0Kl0.js";import{A as L,C as R,S as z,_ as B,b as V,x as H,y as U}from"./index-Djd_7VwF.js";/* empty css */var W=t(e(),1),G=n(),K={media_delivery:{label:y,help:_},documentary_fetch:{label:s,help:v},inbound_files:{label:i,help:D}},q={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
2
- - gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`},J={outboundDir:f,references:x,files:r};function Y(){let e=g(T.admin.listInstances,{}),[t,n]=(0,W.useState)(null);if(e===void 0)return(0,G.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,G.jsx)(`div`,{className:`oc-injtab`,children:(0,G.jsx)(`p`,{className:`oc-admin__hint`,children:d()})});let r=e.find(e=>e._id===t)??e[0];return(0,G.jsxs)(`div`,{className:`oc-injtab`,children:[(0,G.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,G.jsx)(M,{label:b(),help:l()}),(0,G.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,G.jsx)(`span`,{children:h()}),(0,G.jsxs)(U,{value:r._id,onValueChange:e=>n(e),children:[(0,G.jsx)(z,{size:`sm`,className:`min-w-44`,children:(0,G.jsx)(R,{})}),(0,G.jsx)(V,{children:e.map(e=>(0,G.jsx)(H,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,G.jsx)(X,{instance:r},r._id)]})}function X({instance:e}){let t=E(T.admin.upsertInstanceConfig),n=L(),r=e.config??{},[i,a]=(0,W.useState)(()=>A(r)),[o,s]=(0,W.useState)(!1),c=i.promptInjections,l=(e,t)=>a({...i,promptInjections:{...c,[e]:{...c[e],...t}}});async function u(){s(!0);try{await t({instanceId:e._id,config:N(i,r)})}catch(e){n.error(S(),e)}finally{s(!1)}}return(0,G.jsxs)(`div`,{className:`oc-injtab__body`,children:[F.map(e=>(0,G.jsx)(Z,{injKey:e,def:j[e],i18n:K[e],row:c[e]??{enabled:!0,template:j[e].defaultTemplate},onChange:t=>l(e,t)},e)),(0,G.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,G.jsx)(I,{size:`sm`,onClick:()=>void u(),disabled:o,children:w()})})]})}function Z({injKey:e,def:t,i18n:n,row:r,onChange:i}){let[s,l]=(0,W.useState)(!1),d=r.template.trim()!==t.defaultTemplate,f=t.togglable&&!r.enabled,h=Object.fromEntries(t.placeholders.map(e=>[e,q[e]??`{${e}}`])),g=O(e,r),_=g?k(g,h):``;return(0,G.jsxs)(`section`,{className:`oc-injcard`,children:[(0,G.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,G.jsxs)(`label`,{className:`oc-field--row`,children:[(0,G.jsx)(B,{checked:r.enabled,onCheckedChange:e=>i({enabled:e===!0})}),(0,G.jsx)(M,{label:n.label(),help:n.help()})]}):(0,G.jsx)(M,{label:n.label(),help:n.help()}),d&&(0,G.jsx)(`span`,{className:`oc-injection__badge`,children:u()})]}),(0,G.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.template,disabled:f,rows:8,spellCheck:!1,onChange:e=>i({template:e.target.value})}),(0,G.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,G.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,G.jsx)(`span`,{className:`oc-injection__ph`,children:o()}),t.placeholders.map(e=>(0,G.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,G.jsx)(`code`,{children:`{${e}}`}),(0,G.jsx)(P,{text:(J[e]??(()=>e))()})]},e))]}),(0,G.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,G.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>l(e=>!e),children:s?a():c()}),d&&(0,G.jsx)(I,{variant:`ghost`,size:`sm`,onClick:()=>i({template:t.defaultTemplate}),children:C()})]})]}),s&&(0,G.jsx)(`div`,{className:`oc-injcard__preview`,children:_?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:_}),(0,G.jsx)(`span`,{className:`oc-injection__ph`,children:m()})]}):(0,G.jsx)(`span`,{className:`oc-injection__ph`,children:p()})})]})}export{Y as PromptInjectionsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$p as r,Am as i,Bm as a,Cm as o,Dm as s,Em as c,Fm as l,Im as u,Lm as d,Mm as f,Nm as p,Om as m,Pm as h,Qp as g,Rm as _,Sm as v,TD as y,Tm as b,Vm as x,_m as S,am as ee,bm as te,em as ne,fm as re,gm as ie,hm as ae,im as C,jm as w,km as T,mm as E,nm as D,om as O,pm as k,rm as A,tm as j,vD as M,vm as N,wD as P,wm as F,xm as I,ym as L,zm as R}from"./dist-CSHwMvoK.js";import{t as z}from"./button-Do9b0Kl0.js";import{A as B,X as V,Z as H,_ as U,j as W,m as G,xt as K}from"./index-Djd_7VwF.js";import{t as q}from"./roleDescriptions-Me-Y5Y5f.js";var J=t(e(),1),Y=n(),X=[{group:()=>x(),keys:[{key:`traces.read`,label:()=>u()},{key:`traces.read.content`,label:()=>l(),phi:!0},{key:`traces.write`,label:()=>h()}]},{group:()=>a(),keys:[{key:`kpi.read`,label:()=>u()},{key:`kpi.write`,label:()=>h()}]},{group:()=>R(),keys:[{key:`openclaw.query`,label:()=>p()},{key:`anomalies.read`,label:()=>f()},{key:`anomalies.report`,label:()=>w()}]},{group:()=>_(),keys:[{key:`chats.read`,label:()=>u()},{key:`selfheal`,label:()=>T()}]},{group:()=>d(),keys:[{key:`admin.manage`,label:()=>i()}]}],oe=X.flatMap(e=>e.keys.map(e=>e.key));function Z(e){return e.includes(`*`)}var Q={key:``,name:``,description:``};function $(){let e=y(M.apiKeys.listRoles,{}),t=P(M.apiKeys.createRole),n=P(M.apiKeys.ensureRolesSeeded),i=P(M.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(M.apiKeys.listRoles,{});r&&e.setQuery(M.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),a=W(),l=B(),[u,d]=(0,J.useState)(!1),[f,p]=(0,J.useState)(Q),[h,_]=(0,J.useState)(new Set);(0,J.useEffect)(()=>{n({}).catch(e=>{l.error(s(),e)})},[n,l]);let x=e??[];async function w(e,t){if(Z(e.permissions)||h.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await a({title:c({name:e.name}),description:b(),confirmLabel:F()}))){_(t=>new Set(t).add(e._id));try{await i({roleId:e._id,permissions:n})}catch(e){l.error(o(),e)}finally{_(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function T(){try{await t({key:f.key,name:f.name,description:f.description||void 0,permissions:[]}),p(Q),d(!1)}catch(e){l.error(v(),e)}}let R=e===void 0,$=!R&&x.length===0;return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[I(),` `,(0,Y.jsx)(`code`,{children:`admin`}),` `,te(),` `,(0,Y.jsx)(`code`,{children:`traces.read.content`}),` `,L()]}),(0,Y.jsxs)(`div`,{className:`oc-dt`,children:[(0,Y.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,Y.jsx)(`h2`,{className:`oc-dt__title`,children:N()}),(0,Y.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,Y.jsx)(z,{size:`sm`,onClick:()=>{p(Q),d(!0)},children:S()})})]}),R?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:ie()}):$?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:ae()}):(0,Y.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,Y.jsxs)(`table`,{className:`oc-matrix`,children:[(0,Y.jsxs)(`thead`,{children:[(0,Y.jsxs)(`tr`,{children:[(0,Y.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:E()}),X.map(e=>(0,Y.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,Y.jsx)(`tr`,{children:X.flatMap(e=>e.keys.map(e=>(0,Y.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?m({key:e.key}):e.key,children:[e.label(),e.phi?(0,Y.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,Y.jsx)(`tbody`,{children:x.map(e=>{let t=Z(e.permissions),n=h.has(e._id);return(0,Y.jsxs)(`tr`,{children:[(0,Y.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,Y.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,Y.jsx)(`span`,{children:e.name}),(0,Y.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,Y.jsxs)(V,{variant:`outline`,className:`gap-1`,children:[(0,Y.jsx)(K,{}),` `,k()]}):(0,Y.jsx)(V,{variant:`secondary`,children:re()})]}),q(e)?(0,Y.jsx)(`p`,{className:`oc-matrix__roledesc`,children:q(e)}):null]}),oe.map(r=>(0,Y.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,Y.jsx)(U,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?O():n?ee():r,onCheckedChange:()=>void w(e,r)})},r))]},e.key)})})]})})]}),(0,Y.jsx)(G,{open:u,onOpenChange:d,title:C(),description:A(),canSubmit:!!(f.key&&f.name),onSubmit:T,submitLabel:D(),children:(0,Y.jsxs)(`div`,{className:`oc-form`,children:[(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:j()}),(0,Y.jsx)(H,{value:f.key,placeholder:ne(),onChange:e=>p({...f,key:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:r()}),(0,Y.jsx)(H,{value:f.name,onChange:e=>p({...f,name:e.target.value})})]}),(0,Y.jsxs)(`label`,{className:`oc-field`,children:[(0,Y.jsx)(`span`,{className:`oc-field__label`,children:g()}),(0,Y.jsx)(H,{value:f.description,onChange:e=>p({...f,description:e.target.value})})]})]})})]})}export{$ as RolesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$S as r,AC as i,AS as a,BS as o,CC as ee,CS as s,DC as te,DS as ne,EC as re,ES as ie,FC as ae,FS as c,GS as oe,HS as se,IC as ce,IS as l,JS as le,KS as ue,LC as de,LS as u,MC as d,MS as f,NC as fe,NS as p,OC as pe,OS as m,PC as me,PS as h,QS as he,RS as ge,SC as _e,SD as ve,SS as g,TC as ye,TD as _,TS as v,US as be,VS as xe,WS as Se,XS as Ce,YS as we,ZS as Te,_C as Ee,_S as y,aC as De,bC as Oe,bS as b,cC as ke,dC as Ae,eC as je,fC as Me,gC as Ne,hC as Pe,iC as Fe,jC as x,jS as S,kC as Ie,kS as C,lC as Le,mC as Re,nC as ze,oC as Be,pC as Ve,qS as He,rC as Ue,sC as We,tC as Ge,uC as Ke,vC as qe,vD as w,vS as T,wC as Je,wD as E,wS as D,xC as Ye,xS as O,yC as Xe,yS as k,zS as A}from"./dist-CSHwMvoK.js";import{n as j}from"./dist-C4sB9wBS.js";import{i as Ze}from"./dist-DyqGXOsj.js";import{t as M}from"./button-Do9b0Kl0.js";import{$ as N,A as Qe,At as $e,C as P,Dt as F,Mt as et,Q as I,S as L,X as R,Z as z,b as B,et as V,j as tt,jt as nt,m as rt,nt as H,rt as U,tt as it,x as W,y as G}from"./index-Djd_7VwF.js";import{t as at}from"./FilterBar-DZweUsOp.js";import{t as ot}from"./DataTableShell-CXnilHFx.js";import{t as st}from"./roleDescriptions-Me-Y5Y5f.js";var K=t(e(),1),q=n(),ct=[{value:`never`,label:()=>s(),days:null},{value:`30`,label:()=>g(),days:30},{value:`90`,label:()=>O(),days:90}],lt=720*60*60*1e3,J=`__all__`,Y={name:``,roleKey:``,description:``};function X(){let e=et({from:`/settings/serviceAccounts`}),t=nt({from:`/settings/serviceAccounts`}),n=e.q??``,a=e.status??J,[o,s]=(0,K.useState)(J),ne=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ie=e=>void t({search:t=>({...t,status:e===J?void 0:e})}),c=_(w.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===J?void 0:o,disabled:a===J?void 0:a===`disabled`}}),l=_(w.apiKeys.listKeys,{}),u=_(w.apiKeys.listRoles,{}),f=E(w.apiKeys.createServiceAccount),p=E(w.apiKeys.updateServiceAccount),m=E(w.apiKeys.deleteServiceAccount),h=ve(w.apiKeys.mintApiKey),ge=E(w.apiKeys.revokeApiKey),g=tt(),v=Qe(),y=n!==``||o!==J||a!==J;function b(){s(J),t({search:{},replace:!0})}let[S,C]=(0,K.useState)(!1),[T,D]=(0,K.useState)(Y),[O,k]=(0,K.useState)(null),[A,j]=(0,K.useState)(new Set),[N,F]=(0,K.useState)(null),I=(0,K.useRef)(!1),[V,H]=(0,K.useState)(new Set),[U,it]=(0,K.useState)({}),[lt,X]=(0,K.useState)(null),Z=(0,K.useMemo)(()=>{let e=new Map;for(let t of l??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[l]);function Q(e){j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{O?(await p({serviceAccountId:O,name:T.name,roleKey:T.roleKey,description:T.description}),v.success(Ge())):await f({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),D(Y),k(null),C(!1)}catch(e){v.error(O?ze():Ue(),e)}}function pt(e){D({name:e.name,roleKey:e.roleKey,description:e.description??``}),k(e._id),C(!0)}async function $(e){if(I.current)return;I.current=!0;let t=U[e._id]??`never`,n=ct.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;F(e._id);try{let t=await h({serviceAccountId:e._id,expiresAt:r});X({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){v.error(je(),e)}finally{I.current=!1,F(null)}}async function mt(e){if(await g({title:r(),description:(0,q.jsxs)(q.Fragment,{children:[he(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Te(),` `,(0,q.jsx)(`strong`,{children:Ce()}),` `,we()]}),confirmWord:e.name,confirmLabel:le(),destructive:!0}))try{await m({serviceAccountId:e._id}),v.success(He(),e.name)}catch(e){v.error(ue(),e)}}async function ht(e){if(await g({title:oe(),description:(0,q.jsxs)(q.Fragment,{children:[Se(),` `,(0,q.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,be()]}),confirmLabel:se(),destructive:!0})&&!V.has(e._id)){H(t=>new Set(t).add(e._id));try{await ge({keyId:e._id})}catch(e){v.error(xe(),e)}finally{H(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:de()}),(0,q.jsxs)(at,{q:n,onQChange:ne,searchPlaceholder:ce(),onReset:b,canReset:y,children:[(0,q.jsxs)(G,{value:o,onValueChange:s,children:[(0,q.jsx)(L,{size:`sm`,className:`w-40`,children:(0,q.jsx)(P,{placeholder:ae()})}),(0,q.jsxs)(B,{children:[(0,q.jsx)(W,{value:J,children:me()}),(u??[]).map(e=>(0,q.jsx)(W,{value:e.key,children:e.key},e._id))]})]}),(0,q.jsxs)(G,{value:a,onValueChange:ie,children:[(0,q.jsx)(L,{size:`sm`,className:`w-36`,children:(0,q.jsx)(P,{})}),(0,q.jsxs)(B,{children:[(0,q.jsx)(W,{value:J,children:fe()}),(0,q.jsx)(W,{value:`active`,children:d()}),(0,q.jsx)(W,{value:`disabled`,children:x()})]})]})]}),(0,q.jsx)(ot,{title:i(),rows:c,addLabel:Ie(),onAdd:()=>{D(Y),k(null),C(!0)},emptyHint:pe(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,q.jsx)(ut,{account:e,keys:Z.get(e._id)??[],onRevoke:ht,revoking:V}),rowActions:e=>[{label:Je(),onSelect:()=>pt(e)},{label:te(),onSelect:()=>void $(e)},{label:A.has(e._id)?re():ye(),onSelect:()=>Q(e._id)},{label:ee(),variant:`destructive`,onSelect:()=>void mt(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,q.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?_e():Ye(),onClick:()=>Q(e._id),children:A.has(e._id)?(0,q.jsx)(Ze,{}):(0,q.jsx)($e,{})})},{header:Oe(),sort:e=>e.name,cell:e=>(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`span`,{children:e.name}),e.description?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Xe(),sort:e=>e.roleKey,cell:e=>(0,q.jsx)(R,{variant:`secondary`,children:e.roleKey})},{header:qe(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,q.jsx)(R,{variant:`destructive`,children:x()}):(0,q.jsx)(R,{variant:`outline`,children:d()})},{header:Ee(),cell:e=>(0,q.jsxs)(G,{value:U[e._id]??`never`,onValueChange:t=>it(n=>({...n,[e._id]:t})),children:[(0,q.jsx)(L,{size:`sm`,className:`w-32`,children:(0,q.jsx)(P,{})}),(0,q.jsx)(B,{children:ct.map(e=>(0,q.jsx)(W,{value:e.value,children:e.label()},e.value))})]})},{header:Ne(),sort:e=>(Z.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Z.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,q.jsx)(`span`,{className:`oc-sa__keycount`,children:N===e._id?Pe():Re({count:t})})}}]}),(0,q.jsx)(rt,{open:S,onOpenChange:e=>{C(e),e||k(null)},title:O?Ve():Ke(),description:O?Me():Le(),canSubmit:!!(T.name&&T.roleKey),onSubmit:ft,submitLabel:O?Ae():ke(),children:(0,q.jsxs)(`div`,{className:`oc-form`,children:[(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:We()}),(0,q.jsx)(z,{value:T.name,onChange:e=>D({...T,name:e.target.value})})]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Be()}),(0,q.jsxs)(G,{value:T.roleKey||void 0,onValueChange:e=>D({...T,roleKey:e}),children:[(0,q.jsx)(L,{className:`w-full`,children:(0,q.jsx)(P,{placeholder:De()})}),(0,q.jsx)(B,{children:(u??[]).map(e=>(0,q.jsxs)(W,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(u??[]).find(e=>e.key===T.roleKey),t=e?st(e):null;return t?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Fe()}),(0,q.jsx)(z,{value:T.description,onChange:e=>D({...T,description:e.target.value})})]})]})}),(0,q.jsx)(dt,{minted:lt,onClose:()=>X(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,q.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,q.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[o(),` `,(0,q.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:A()}):(0,q.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{children:ge()}),(0,q.jsx)(`th`,{children:u()}),(0,q.jsx)(`th`,{children:l()}),(0,q.jsx)(`th`,{children:c()}),(0,q.jsx)(`th`,{children:h()}),(0,q.jsx)(`th`,{children:p()}),(0,q.jsx)(`th`,{})]})}),(0,q.jsx)(`tbody`,{children:t.map(t=>(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`td`,{children:(0,q.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,q.jsx)(`td`,{children:(0,q.jsx)(R,{variant:`secondary`,children:e.roleKey})}),(0,q.jsx)(`td`,{children:Z(t.createdAt)}),(0,q.jsx)(`td`,{className:Q(t.lastUsedAt)?`oc-sa__stale`:``,children:ft(t.lastUsedAt)}),(0,q.jsx)(`td`,{children:pt(t.expiresAt)}),(0,q.jsx)(`td`,{children:$(t)}),(0,q.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,q.jsx)(M,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?f():S()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,K.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,q.jsx)(I,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,q.jsxs)(N,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,q.jsxs)(H,{children:[(0,q.jsx)(U,{children:a()}),(0,q.jsx)(V,{children:C({name:e.accountName})})]}),(0,q.jsx)(`div`,{className:`oc-sa__minted-warning`,children:m()}),(0,q.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,q.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,q.jsxs)(M,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":ne(),children:[n?(0,q.jsx)(j,{}):(0,q.jsx)(F,{}),n?ie():v()]})]}),(0,q.jsx)(it,{children:(0,q.jsx)(M,{onClick:()=>{r(!1),t()},children:D()})})]}):null})}function Z(e){return new Date(e).toLocaleString(`fr-FR`)}function Q(e){return e===null?!1:Date.now()-e>lt}function ft(e){return e===null?b():new Date(e).toLocaleString(`fr-FR`)}function pt(e){return e===null?`—`:new Date(e).toLocaleDateString(`fr-FR`)}function $(e){return e.disabled?(0,q.jsx)(R,{variant:`destructive`,children:k()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,q.jsx)(R,{variant:`outline`,children:T()}):(0,q.jsx)(R,{variant:`outline`,children:y()})}export{X as ServiceAccountsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{A as r,B as i,C as a,D as o,E as s,F as c,G as l,H as u,I as d,L as f,M as p,N as m,O as h,P as g,R as _,S as v,T as y,TD as b,U as x,V as S,W as C,_ as w,b as T,c as E,d as D,f as O,g as k,h as A,j,k as M,l as N,m as P,p as F,s as I,u as ee,v as L,vD as R,w as z,wD as B,x as V,y as H,z as U}from"./dist-CSHwMvoK.js";import{t as W}from"./button-Do9b0Kl0.js";import{j as G}from"./index-Djd_7VwF.js";import{t as K}from"./DataTableShell-CXnilHFx.js";var q=t(e(),1),J=n(),Y={hung:()=>h(),wrong_result:()=>o(),error:()=>s(),other:()=>y()},X=e=>(e&&Y[e]?.())??e??`—`;function Z(e){let t=e.slice(e.lastIndexOf(`:`)+1)||e;return t.length>12?`${t.slice(0,12)}…`:t}function Q({data:e}){let t=e.snapshot,n=B(R.subAgentReports.respondToReport),[r,i]=(0,q.useState)(e.thread),[o,s]=(0,q.useState)(``),[c,l]=(0,q.useState)(!1);async function u(){let t=o.trim();if(!(!t||c)){l(!0);try{await n({reportId:e._id,text:t}),i(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),s(``)}finally{l(!1)}}}return(0,J.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,J.jsx)(`div`,{className:`oc-fbadmin__row`,children:(0,J.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[X(e.category),` · `,z({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h4`,{className:`oc-fbadmin__h`,children:a()}),(0,J.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h4`,{className:`oc-fbadmin__h`,children:v()}),r.length>0?(0,J.jsx)(`div`,{className:`oc-fbadmin__thread`,children:r.map((e,t)=>(0,J.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,J.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?V():T()}),(0,J.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,J.jsx)(`p`,{className:`oc-fbadmin__meta`,children:H()}),(0,J.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:L(),value:o,maxLength:2e3,rows:3,onChange:e=>s(e.target.value.slice(0,2e3))}),(0,J.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,J.jsx)(W,{size:`sm`,onClick:()=>void u(),disabled:!o.trim()||c,children:c?k():w()})})]}),(0,J.jsxs)(`section`,{children:[(0,J.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[A({count:t.children.length}),t.childrenTruncated?` ${P()}`:``,t.textTruncated?` ${F()}`:``]}),(0,J.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,J.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,J.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Z(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${O()}`:``]}),e.errorMessage?(0,J.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,J.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h4`,{className:`oc-fbadmin__h`,children:D()}),(0,J.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.parentText})]}):null,(0,J.jsxs)(`section`,{children:[(0,J.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ee()}),(0,J.jsx)(`p`,{className:`oc-fbadmin__env`,children:[t.parentStatus?`status: ${t.parentStatus}`:null,t.parentErrorCode?`code: ${t.parentErrorCode}`:null,t.parentRunId?`run ${t.parentRunId.slice(0,12)}…`:null,e.correlationId?`corr ${e.correlationId.slice(0,16)}…`:null,t.openclawProvider].filter(Boolean).join(` · `)||`—`})]})]})}function $(){let e=b(R.subAgentReports.listForAdmin,{}),t=B(R.subAgentReports.readReport),n=B(R.subAgentReports.deleteReport),a=G(),[o,s]=(0,q.useState)(null),[h,v]=(0,q.useState)({});async function y(e){if(o===e._id){s(null);return}if(!h[e._id]){let n=await t({reportId:e._id});v(t=>({...t,[e._id]:n}))}s(e._id)}async function w(e){await a({title:N(),description:E(),confirmLabel:I(),destructive:!0})&&(await n({reportId:e._id}),o===e._id&&s(null))}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[x(),` `,(0,J.jsx)(`strong`,{children:u()}),` `,S()]}),(0,J.jsx)(K,{title:l(),rows:e,emptyHint:C(),isExpanded:e=>o===e._id&&!!h[e._id],renderExpanded:e=>h[e._id]?(0,J.jsx)(Q,{data:h[e._id]}):null,columns:[{header:i(),cell:e=>new Date(e.at).toLocaleString(`fr-FR`),sort:e=>e.at},{header:U(),cell:e=>X(e.category),sort:e=>X(e.category)},{header:_(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:f(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${g({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:d(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:c(),cell:e=>e.answered?(0,J.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:m()}):(0,J.jsx)(`span`,{className:`oc-fbadmin__pill`,children:p()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:o===e._id?r():j(),onSelect:()=>void y(e)},{label:M(),onSelect:()=>void w(e),variant:`destructive`}]})]})}export{$ as SubAgentReportsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$w as r,AT as i,Aw as a,BT as o,Bw as s,CT as c,Cw as l,DT as u,Dw as d,EE as f,ET as p,Ew as m,FT as h,Fw as g,Gw as _,HE as v,Hw as ee,IT as te,Iw as ne,Jw as re,Kw as ie,LT as ae,Lw as oe,MT as se,Mw as ce,NT as le,Nw as ue,OT as de,Ow as fe,PT as pe,Pw as me,Qw as he,RT as ge,Rw as y,SD as _e,ST as ve,Sw as b,TD as x,TE as ye,TT as be,Tw as xe,UE as Se,Uw as Ce,VE as we,Vw as Te,Ww as Ee,Xw as De,Yw as Oe,Zw as ke,_T as Ae,a as S,aT as je,bT as Me,bw as Ne,cT as Pe,dT as Fe,eT as Ie,fT as Le,gT as Re,hT as ze,i as Be,iT as Ve,jT as He,jw as Ue,kT as We,kw as Ge,lT as Ke,mT as qe,n as Je,nT as Ye,o as C,oT as Xe,pT as Ze,qw as Qe,r as $e,rT as w,sT as et,tT as tt,uT as nt,vD as T,vT as rt,vw as it,wD as E,wT as at,ww as ot,xT as st,xw as ct,yD as lt,yT as ut,yw as dt,zT as ft,zw as pt}from"./dist-CSHwMvoK.js";import{n as D}from"./dist-C4sB9wBS.js";import{t as O}from"./x-DxTaDbZb.js";import{t as k}from"./button-Do9b0Kl0.js";import{C as A,Et as mt,G as ht,J as j,K as M,S as N,Tt as P,W as gt,X as F,Y as _t,Z as I,_ as L,at as vt,b as R,it as yt,ot as z,q as bt,x as B,y as V}from"./index-Djd_7VwF.js";import{a as xt,i as St,n as Ct,o as wt,r as Tt,t as Et}from"./card-DtbnXpuR.js";import{a as Dt,i as H,n as Ot,o as U,r as W,t as kt}from"./table-Cr9ARpxr.js";import{t as At}from"./TimeRangePicker-DatsuATN.js";import{t as jt}from"./FilterBar-DZweUsOp.js";import{t as Mt}from"./AdvancedFilter-GcKYGafW.js";var G=lt(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),K=t(e(),1),Nt=.1,Pt=[248,248,248],Ft=[24,24,24];function It(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function Lt(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function q(e,t,n){return Lt(e,t,n)>=Nt}function Rt(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function zt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var Bt=12*1024*1024,Vt=480,Ht=160,Ut=.92;async function Wt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(Te());if(e.size>Bt)throw Error(s());let{source:n,width:r,height:i,cleanup:a}=await Gt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Vt/r,Ht/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(y());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=It(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(y());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);q(e.data,d.width,d.height)?Rt(e.data,t.variantFor===`dark`?Pt:Ft):zt(e.data),p.putImageData(e,0,0)}let m=q(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Ut)??await Y(f,`image/png`);if(!h)throw Error(oe());return{blob:h,hasAlpha:m}}finally{a()}}async function Gt(e){if(e.type===`image/svg+xml`)return J(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return J(e)}async function J(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(pt())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Kt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Q={kind:`relative`,from:`now-24h`,to:`now`},qt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function $({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Jt(e){return e===`light`?Se():e===`dark`?v():we()}var Yt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Xt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Yt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Zt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:Je(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(D,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Xt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":C(),title:C(),children:(0,X.jsx)(mt,{className:`size-4`})}):null]})}function Qt({selectedKey:e,resolvedMode:t}){let n=x(T.charts.listMyCharts),r=E(T.charts.setMyChart);async function a(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:se()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:He()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Zt,{selected:e===null,title:i(),subtitle:We(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?de():n.via===`owner`?u():p({group:n.via.group});return(0,X.jsx)(Zt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void a(n.key),onExport:()=>Kt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:be()}):null]})}function $t(){let e=E(T.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1);async function d(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{i(await t.text())}catch{o(w())}}}async function f(){if(o(null),c(!1),t.trim()===``){o(tt());return}let a;try{a=JSON.parse(r)}catch{o(w());return}u(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{u(!1)}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Fe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:nt()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Ke()}),(0,X.jsx)(I,{value:t,onChange:e=>n(e.target.value),placeholder:Pe(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:et()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:Xe(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),je(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void d(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:l,onClick:()=>void f(),children:Ve()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:Ye()}):null]})]})}function en({chart:e}){let t=_e(T.charts.setChartLogo),n=E(T.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Wt(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?re():Qe()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),t?_():ie(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:Ce()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Ee()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Oe()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(f,{mode:`light`}),(0,X.jsx)(f,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ee()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function tn({chart:e}){let t=x(T.me.getMe,{host:z}),n=E(T.charts.addChartDomain),r=E(T.charts.removeChartDomain),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ne()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ce()}):u.map(e=>(0,X.jsxs)(F,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ue({domain:e}),onClick:()=>void f(e),children:(0,X.jsx)(O,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(I,{value:i,onChange:e=>a(e.target.value),placeholder:me(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:ue()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:g()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function nn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function rn({chart:e}){let t=E(T.charts.updateChart),n=E(T.charts.deleteChart),[r,i]=(0,K.useState)(!1),[o,s]=(0,K.useState)(e.name),[c,l]=(0,K.useState)(()=>nn(e.tokens)),[u,f]=(0,K.useState)(e.tokens.bpm??0),[p,h]=(0,K.useState)(null),[g,_]=(0,K.useState)(!1);function v(){s(e.name),l(nn(e.tokens)),f(e.tokens.bpm??0),h(null),i(!0)}async function ee(){if(e.chartId===void 0)return;h(null);let n;try{n=JSON.parse(c)}catch{h(w());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}_(!0);try{await t({chartId:e.chartId,name:o.trim(),tokens:n}),i(!1)}catch(e){h(e instanceof Error?e.message:String(e))}finally{_(!1)}}async function te(){if(e.chartId!==void 0&&window.confirm(m()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:v,children:ke()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void te(),children:De()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:fe()}),(0,X.jsx)(I,{value:o,onChange:e=>s(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:S()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:u,onChange:e=>f(Number(e.target.value)),"aria-label":S()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?Be():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:$e()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:d()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),p?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:p}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:g,onClick:()=>void ee(),children:a()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:Ge()})]})]}):null,(0,X.jsx)(en,{chart:e}),(0,X.jsx)(tn,{chart:e})]})}function an(){let e=x(T.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:r()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:he()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(rn,{chart:e},e.key))})]})}function on({chart:e,groups:t}){let n=E(T.charts.addChartToGroupPool),r=E(T.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function c(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function l(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(F,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?Ae():e.kind===`custom`&&e.scope===`personal`?b():rt()}),e.isGlobalDefault?(0,X.jsx)(F,{variant:`default`,children:Re()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:qe()}),(a??[]).map(e=>(0,X.jsxs)(F,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Le({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(O,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(V,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(N,{size:`sm`,className:`w-56`,children:(0,X.jsx)(A,{placeholder:Ze()})}),(0,X.jsx)(R,{children:s.map(e=>(0,X.jsx)(B,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ze()}):null]})]})}function sn({chart:e}){let t=E(T.charts.promoteChartToCommon),n=E(T.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(m()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(F,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?ct():b()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:l({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:Ne()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:dt()})]})]})}function cn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=E(T.admin.setDefaultThemeMode),a=E(T.admin.setDefaultLocale),s=E(T.charts.setDefaultChart),l=x(T.charts.listChartsAdmin),u=x(T.groups.listGroups,{}),d=e??`system`,p=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:pe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:le()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:at()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:c()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void s({name:null}),children:i()}),vt.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void s({name:e.key}),children:e.name},e.key)),(l??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void s({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ve()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:st()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(l??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(on,{chart:e,groups:u??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Me()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ut()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(l??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(tn,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:xe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ot()})]}),(()=>{let e=(l??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:it()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(sn,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:o()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ft()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:d===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Jt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ge()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ae()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`fr`,`en`].map(e=>(0,X.jsx)(k,{variant:p===e?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e}),children:e===`fr`?f():ye()},e))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:te()})]})]})}function ln(){let e=x(T.me.getMe,{host:z}),t=yt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Qt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)($t,{}),(0,X.jsx)(an,{}),e?.role===`admin`?(0,X.jsx)(cn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function un(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Q),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(ln,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:h()}),(0,X.jsxs)($,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(k,{variant:`outline`,children:`Outline`}),(0,X.jsx)(k,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(k,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(k,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,children:`Small`}),(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{size:`lg`,children:`Large`}),(0,X.jsx)(k,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(P,{})}),(0,X.jsx)(k,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)($,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(F,{children:`Default`}),(0,X.jsx)(F,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(F,{variant:`outline`,children:`Outline`}),(0,X.jsx)(F,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)($,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(I,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(V,{value:n,onValueChange:r,children:[(0,X.jsx)(N,{className:`w-56`,children:(0,X.jsx)(A,{placeholder:`Select…`})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(B,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(B,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(L,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)($,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(jt,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(V,{value:o,onValueChange:s,children:[(0,X.jsx)(N,{size:`sm`,children:(0,X.jsx)(A,{})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(B,{value:Z,children:`Toutes directions`}),(0,X.jsx)(B,{value:`inbound`,children:`inbound`}),(0,X.jsx)(B,{value:`outbound`,children:`outbound`}),(0,X.jsx)(B,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(V,{value:c,onValueChange:l,children:[(0,X.jsx)(N,{size:`sm`,children:(0,X.jsx)(A,{})}),(0,X.jsxs)(R,{children:[(0,X.jsx)(B,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(B,{value:`info`,children:`info`}),(0,X.jsx)(B,{value:`warn`,children:`warn`}),(0,X.jsx)(B,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(Mt,{fields:qt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(At,{value:u,onChange:d})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(gt,{children:[(0,X.jsx)(_t,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(P,{})})}),(0,X.jsxs)(ht,{align:`start`,children:[(0,X.jsx)(bt,{children:`Actions`}),(0,X.jsx)(j,{}),(0,X.jsx)(M,{children:`Edit`}),(0,X.jsx)(M,{children:`Duplicate`}),(0,X.jsx)(j,{}),(0,X.jsx)(M,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)($,{title:`Card`,children:(0,X.jsxs)(Et,{className:`w-80`,children:[(0,X.jsxs)(xt,{children:[(0,X.jsx)(wt,{children:`Instance`}),(0,X.jsx)(Tt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(Ct,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(St,{className:`gap-2`,children:[(0,X.jsx)(k,{size:`sm`,children:`Save`}),(0,X.jsx)(k,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)($,{title:`Table`,children:(0,X.jsxs)(kt,{children:[(0,X.jsx)(Dt,{children:(0,X.jsxs)(U,{children:[(0,X.jsx)(H,{className:`w-8`,children:(0,X.jsx)(L,{"aria-label":`select all`})}),(0,X.jsx)(H,{children:`Name`}),(0,X.jsx)(H,{children:`Mode`}),(0,X.jsx)(H,{className:`text-right`,children:`Status`}),(0,X.jsx)(H,{className:`w-8`})]})}),(0,X.jsx)(Ot,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(U,{children:[(0,X.jsx)(W,{children:(0,X.jsx)(L,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(F,{variant:`secondary`,children:e.m})}),(0,X.jsx)(W,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(D,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(W,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(P,{})})})]},e.n))})]})}),(0,X.jsx)($,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{un as ThemeShowroom};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$d as r,$y as i,Af as a,Ay as o,By as s,Cf as c,Df as l,Ef as u,Ff as d,Fy as f,Hy as p,Iy as m,Jy as h,Ly as g,Mf as _,My as v,Nf as y,Ny as ee,Of as te,Oy as b,Pf as ne,Py as x,Qd as re,Qy as S,Ry as C,Sf as ie,TD as w,Tf as ae,Vy as oe,Xy as T,Yy as E,Zd as D,Zy as O,_b as k,_f as se,ab as A,af as ce,bf as le,cb as ue,cf as de,db as fe,df as pe,eb as j,ef as me,fb as he,ff as ge,gb as _e,gf as ve,hb as ye,hf as be,ib as M,if as xe,jf as Se,jy as Ce,kf as we,ky as Te,lb as N,lf as Ee,mb as P,mf as De,nb as Oe,nf as ke,ob as Ae,of as je,pb as Me,pf as Ne,qy as Pe,rb as Fe,rf as Ie,sb as Le,sf as Re,tb as ze,tf as Be,ub as Ve,uf as He,vD as F,vf as Ue,wD as I,wf as We,xf as Ge,yD as L,yf as Ke,zy as qe}from"./dist-CSHwMvoK.js";import{n as Je}from"./dist-C4sB9wBS.js";import{t as Ye}from"./x-DxTaDbZb.js";import{i as R,n as z,r as Xe,t as Ze}from"./tabs-CSXMDWZx.js";import{t as B}from"./button-Do9b0Kl0.js";import{$ as Qe,C as V,Ct as $e,Dt as et,Mt as tt,Q as nt,S as H,X as U,a as rt,b as W,et as it,i as at,jt as ot,k as st,nt as ct,o as lt,ot as ut,r as dt,rt as ft,wt as pt,x as G,y as K}from"./index-Djd_7VwF.js";import{n as mt}from"./TimeRangePicker-DatsuATN.js";import{t as ht}from"./FilterBar-DZweUsOp.js";import{t as gt}from"./AdvancedFilter-GcKYGafW.js";import{t as _t}from"./DataTableShell-CXnilHFx.js";var vt=L(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),yt=L(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),q=t(e(),1),J=n(),Y={kind:`relative`,from:`now-520w`,to:`now`},X=e=>e===null?`-`:String(Math.round(e));function bt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?S():n===`agent`?`${O()} - ${r}`:e}function xt(){let e=w(F.me.getMe,{host:ut})?.role===`admin`,t=w(F.deliveryTiming.getDeliveryStatus,{}),n=I(F.deliveryTiming.startDeliveryRecord),r=I(F.deliveryTiming.stopDeliveryRecord),[i,a]=(0,q.useState)(!1),[o,s]=(0,q.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,J.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h3`,{className:`text-sm font-semibold`,children:k()}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:_e()})]}),e?(0,J.jsx)(B,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?P():ye()}):null]}),c?(0,J.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,J.jsx)(U,{variant:`secondary`,children:Me()}),t?.startedAt?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:he({time:new Date(t.startedAt).toLocaleTimeString()})}):null]}):null,(0,J.jsx)(`div`,{children:(0,J.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?N():Ve()})}),i?(0,J.jsx)(St,{isAdmin:e}):null]})}function St({isAdmin:e}){let t=w(F.deliveryTiming.listDeliverySessions,{}),n=I(F.deliveryTiming.deleteDeliverySessions),[r,a]=(0,q.useState)(``),[o,s]=(0,q.useState)(`all`),[c,l]=(0,q.useState)(Y),[u,d]=(0,q.useState)(null),{from:f,to:p}=mt(c),m=c.to===`now`?1/0:p,g=r.trim()!==``||o!==`all`||c!==Y,_=()=>{a(``),s(`all`),l(Y)},v=(0,q.useMemo)(()=>{if(t===void 0)return;let e=r.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(o===`all`||(o===`active`?t.active:!t.active))&&t.startedAt>=f&&t.startedAt<=m).map(e=>({...e,_id:e.sessionId}))},[t,r,o,f,m]),y=e=>{let t=new Set((v??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),u!==null&&r.includes(u)&&d(null))};return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsx)(ht,{q:r,onQChange:a,searchPlaceholder:Le(),timeRange:c,onTimeRangeChange:l,onReset:_,canReset:g,children:(0,J.jsxs)(K,{value:o,onValueChange:e=>s(e),children:[(0,J.jsx)(H,{size:`sm`,className:`w-36`,children:(0,J.jsx)(V,{})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(G,{value:`all`,children:Ae()}),(0,J.jsx)(G,{value:`active`,children:A()}),(0,J.jsx)(G,{value:`stopped`,children:M()})]})]})}),(0,J.jsx)(_t,{title:ue(),rows:v,emptyHint:Te(),columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":u===e.sessionId?E():T(),onClick:()=>d(t=>t===e.sessionId?null:e.sessionId),children:u===e.sessionId?(0,J.jsx)(vt,{size:15,"aria-hidden":!0}):(0,J.jsx)(pt,{size:15,"aria-hidden":!0})})},{header:Fe(),sort:e=>e.startedAt,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:new Date(e.startedAt).toLocaleString()})},{header:Oe(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,J.jsx)(`span`,{className:`tabular-nums`,children:new Date(e.stoppedAt).toLocaleString()})},{header:ze(),sort:e=>e.count,cell:e=>(0,J.jsx)(`span`,{className:`tabular-nums`,children:X(e.count)})},{header:j(),sort:e=>e.startedBy,cell:e=>bt(e.startedBy)},{header:i(),sort:e=>e.active,cell:e=>e.active?(0,J.jsx)(U,{variant:`secondary`,children:A()}):(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:M()})}],rowActions:e?e=>[{label:h(),variant:`destructive`,onSelect:()=>y([e.sessionId])}]:void 0,bulkActions:e?[{label:h(),variant:`destructive`,onSelect:e=>y(e)}]:void 0,isExpanded:e=>e.sessionId===u,renderExpanded:e=>(0,J.jsx)(Ct,{sessionId:e.sessionId})})]})}function Ct({sessionId:e}){let t=w(F.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,q.useState)(!1);return(0,J.jsx)(wt,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(st(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function wt({report:e,copied:t,onCopy:n}){if(!e)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:Pe()});if(e.count===0||e.segments===null)return(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:fe()});let r=e.segments,i=(e,t)=>(0,J.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,J.jsx)(`td`,{className:`py-1`,children:e}),(0,J.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,J.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[X(t.p50),` / `,X(t.p95),` / `,X(t.max)]})]});return(0,J.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,b()]}),(0,J.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,J.jsx)(Je,{size:13,"aria-hidden":!0}):(0,J.jsx)(et,{size:13,"aria-hidden":!0}),t?o():Ce()]})]}),(0,J.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,J.jsx)(`th`,{className:`py-1 font-medium`,children:s()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:qe()}),(0,J.jsx)(`th`,{className:`py-1 text-right font-medium`,children:C()})]})}),(0,J.jsxs)(`tbody`,{children:[i(g(),r.bridge),i(m(),r.A),i(f(),r.C)]})]}),(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:x()}),e.truncated?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):null,(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:ee()})]})}var Tt=[50,100,200,500],Z=`all`,Q=`__all__`,Et=[`2xx`,`4xx`,`5xx`],Dt=[`user`,`service`,`system`],Ot=[`inbound`,`outbound`,`internal`],kt={kind:`relative`,from:`now-30d`,to:`now`},At=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:`latence (ms)`},{value:`principalType`,label:`principal`},{value:`direction`,label:`direction`},{value:`roleKey`,label:`rôle`},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function jt(){let e=tt({from:`/settings/traces`}),t=ot({from:`/settings/traces`}),n=e.limit,r=e.kind,i=e.statusClass??Q,o=e.principalType??Q,s=e.direction??Q,f=e.roleKey??Q,m=e.q??``,h=dt(e.from,e.to),g=(0,q.useMemo)(()=>lt(e.adv),[e.adv]),{from:v,to:ee}=mt(h),[b,x]=(0,q.useState)(null),[re,S]=(0,q.useState)(null),C=e=>void t({search:t=>({...t,limit:e})}),T=e=>void t({search:t=>({...t,kind:e})}),E=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),D=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),O=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),k=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),A=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),ue=e=>void t({search:t=>({...t,...rt(e)})}),fe=e=>void t({search:t=>({...t,adv:at(e)}),replace:!0}),j=w(F.observability.listEvents,{limit:n}),he=w(F.observability.listEvents,{limit:n,kind:r===Z?void 0:r,filter:{q:m||void 0,from:v,to:ee,statusClass:i===Q?void 0:i,principalType:o===Q?void 0:o,direction:s===Q?void 0:s,roleKey:f===Q?void 0:f,advanced:g.length>0?g:void 0}}),_e=(0,q.useMemo)(()=>{let e=new Set;for(let t of j??[])e.add(t.kind);return[...e].sort()},[j]),ye=(0,q.useMemo)(()=>{let e=new Set;for(let t of j??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[j]),M=m!==``||i!==Q||o!==Q||s!==Q||f!==Q||g.length>0||h.kind!==`relative`||h.from!==kt.from;function Ce(){t({search:{limit:100,kind:`all`},replace:!0})}let Te=b?j?.filter(e=>e.correlationId===b):he,[N,P]=(0,q.useState)(`events`);return(0,J.jsxs)(Ze,{value:N,onValueChange:e=>P(e),children:[(0,J.jsxs)(Xe,{className:`w-full`,children:[(0,J.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)($e,{size:13,"aria-hidden":!0}),p()]}),(0,J.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,J.jsx)(yt,{size:13,"aria-hidden":!0}),oe()]})]}),(0,J.jsx)(z,{value:`latency`,children:(0,J.jsx)(xt,{})}),(0,J.jsxs)(z,{value:`events`,className:`flex flex-col gap-3`,children:[(0,J.jsxs)(`p`,{className:`oc-admin__hint`,children:[d(),(0,J.jsx)(`strong`,{children:ne()}),y(),` `,(0,J.jsx)(`span`,{className:`oc-filter__window`,children:_()})]}),(0,J.jsxs)(ht,{q:m,onQChange:E,searchPlaceholder:Se(),timeRange:h,onTimeRangeChange:ue,onReset:Ce,canReset:M,children:[(0,J.jsxs)(K,{value:i,onValueChange:D,children:[(0,J.jsx)(H,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:a()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(G,{value:Q,children:we()}),Et.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:o,onValueChange:O,children:[(0,J.jsx)(H,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:te()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(G,{value:Q,children:l()}),Dt.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:s,onValueChange:k,children:[(0,J.jsx)(H,{size:`sm`,className:`w-32`,children:(0,J.jsx)(V,{placeholder:u()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(G,{value:Q,children:ae()}),Ot.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:f,onValueChange:A,children:[(0,J.jsx)(H,{size:`sm`,className:`w-36`,children:(0,J.jsx)(V,{placeholder:We()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(G,{value:Q,children:c()}),ye.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:r,onValueChange:T,children:[(0,J.jsx)(H,{size:`sm`,className:`w-44`,children:(0,J.jsx)(V,{placeholder:ie()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(G,{value:Z,children:Ge()}),_e.map(e=>(0,J.jsx)(G,{value:e,children:e},e))]})]}),(0,J.jsxs)(K,{value:String(n),onValueChange:e=>C(Number(e)),children:[(0,J.jsx)(H,{size:`sm`,className:`w-28`,children:(0,J.jsx)(V,{})}),(0,J.jsx)(W,{children:Tt.map(e=>(0,J.jsx)(G,{value:String(e),children:le({count:e})},e))})]})]}),(0,J.jsx)(gt,{fields:At,seed:g,onChange:fe}),b?(0,J.jsx)(`div`,{className:`oc-traces__followline`,children:(0,J.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>x(null),title:Ke(),children:[(0,J.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[Ue(),(0,J.jsx)(`code`,{children:$(b)})]}),(0,J.jsx)(Ye,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,J.jsx)(`span`,{className:`sr-only`,children:se()})]})}):null,(0,J.jsx)(_t,{title:ve(),rows:Te,emptyHint:b?be():De(),columns:[{header:Ne(),sort:e=>e.at,cell:e=>(0,J.jsx)(`span`,{className:`oc-traces__time`,children:new Date(e.at).toLocaleString(`fr-FR`)})},{header:ge(),sort:e=>e.kind,cell:e=>(0,J.jsx)(U,{variant:`secondary`,children:e.kind})},{header:pe(),sort:e=>Nt(e)??null,cell:e=>{let t=Nt(e);return t?(0,J.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,J.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":He(),children:`✓`})}},{header:Ee(),sort:e=>e.direction,cell:e=>e.direction?(0,J.jsx)(U,{variant:`outline`,children:e.direction}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:de(),sort:e=>e.principalType,cell:e=>(0,J.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,J.jsx)(U,{variant:`outline`,children:e.principalType}),e.principalId?(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:Re(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,J.jsx)(U,{variant:`secondary`,children:e.roleKey}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:je(),sort:e=>e.route,cell:e=>e.route?(0,J.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,J.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,J.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ce(),sort:e=>e.status,cell:e=>e.status===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsx)(`span`,{className:`oc-traces__status ${Mt(e.status)}`,children:e.status})},{header:xe(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,J.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:Ie(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,J.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:ke(),onClick:()=>x(e.correlationId),children:$(e.correlationId)}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Be(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,J.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>S(e),children:me()}):(0,J.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,J.jsx)(Pt,{row:re,onClose:()=>S(null)})]})]})}function Mt(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Nt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function Pt({row:e,onClose:t}){let n=(0,q.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,J.jsx)(nt,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,J.jsxs)(Qe,{className:`max-w-lg`,children:[(0,J.jsxs)(ct,{children:[(0,J.jsxs)(ft,{className:`oc-traces__meta-title`,children:[r(),` `,(0,J.jsx)(`code`,{children:e.kind}),(0,J.jsx)(U,{variant:`outline`,children:re()})]}),(0,J.jsx)(it,{children:D()})]}),(0,J.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{jt as TracesTab};