@lacneu/atrium 0.40.0 → 0.41.1

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 (77) hide show
  1. package/dist/assets/AccessTab-BPU3wIZm.js +1 -0
  2. package/dist/assets/{AdvancedFilter-C0THAQ2E.js → AdvancedFilter-CC8yyyri.js} +1 -1
  3. package/dist/assets/AgentFilesTab-CtNCoKlS.js +3 -0
  4. package/dist/assets/AnomaliesTab-NdCQKann.js +1 -0
  5. package/dist/assets/AuditTab-CWQxAbhT.js +1 -0
  6. package/dist/assets/BridgeTab-BCL_OOvu.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-NscB-_rp.js +1 -0
  8. package/dist/assets/DataTableShell-D9QsTmar.js +1 -0
  9. package/dist/assets/{DetailChips-jl8VAars.js → DetailChips-MsrqrfaC.js} +1 -1
  10. package/dist/assets/FeedbacksTab-B3tJTaSf.js +1 -0
  11. package/dist/assets/{FieldLabel-B8G-MYNo.js → FieldLabel-D8fOMGe_.js} +2 -2
  12. package/dist/assets/FilesTab-DQ__4A1q.js +1 -0
  13. package/dist/assets/{FilterBar-DRUEEKsU.js → FilterBar-C7Mvs1eU.js} +1 -1
  14. package/dist/assets/GroupsTab-D2qzXfMe.js +1 -0
  15. package/dist/assets/InstancesTab-dq37Dr7Z.js +1 -0
  16. package/dist/assets/IntegrationsTab-DV6Z0hSu.js +1 -0
  17. package/dist/assets/KpiTab-D7m6UNj8.js +1 -0
  18. package/dist/assets/PreferencesTab-8Mbh6ZH6.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-Blwoo--d.js +4 -0
  20. package/dist/assets/RolesTab-BBu-TSCV.js +1 -0
  21. package/dist/assets/ServiceAccountsTab-1rX21yES.js +1 -0
  22. package/dist/assets/SubAgentReportsTab-DucQqOdO.js +1 -0
  23. package/dist/assets/ThemeShowroom-BaezCGnL.js +1 -0
  24. package/dist/assets/{TimeRangePicker-D48D83Oh.js → TimeRangePicker-DPS3DfDG.js} +1 -1
  25. package/dist/assets/TracesTab-CnxpRZQV.js +1 -0
  26. package/dist/assets/UsersTab-CHO7pRMC.js +1 -0
  27. package/dist/assets/VoiceTab-Caths54h.js +1 -0
  28. package/dist/assets/{button-CckfHMbj.js → button-DOcSAX3s.js} +1 -1
  29. package/dist/assets/{card-DypYZQqW.js → card-JEjhD_mU.js} +1 -1
  30. package/dist/assets/chevrons-up-down-BFv7418u.js +1 -0
  31. package/dist/assets/compatView-D6-sh7MA.js +1 -0
  32. package/dist/assets/{confTabs-O2Cp4dmA.css → confTabs-C35Io1ep.css} +1 -1
  33. package/dist/assets/dispatchErrorInfo-N4shKvw0.js +1 -0
  34. package/dist/assets/{dist-4hLW9pCQ.js → dist-BJS2mn_o.js} +1 -1
  35. package/dist/assets/dist-Byo4-C3q.js +44 -0
  36. package/dist/assets/{dist-B9DB48K7.js → dist-DeWVxElE.js} +1 -1
  37. package/dist/assets/{dist-CM845ILS.js → dist-GCf84zyw.js} +1 -1
  38. package/dist/assets/{highlighted-body-OFNGDK62-DNPEG4ak.js → highlighted-body-OFNGDK62-uB3hQoQJ.js} +1 -1
  39. package/dist/assets/index-BsEfIgPs.css +2 -0
  40. package/dist/assets/index-CwfPxODu.js +233 -0
  41. package/dist/assets/mermaid-GHXKKRXX-B3PQETQF.js +1 -0
  42. package/dist/assets/roleDescriptions-CLRkzP_G.js +1 -0
  43. package/dist/assets/{table-CnKDuavw.js → table-Be-_wtAR.js} +1 -1
  44. package/dist/assets/{tabs-DqVkAM7O.js → tabs-DST_6O2g.js} +1 -1
  45. package/dist/assets/x-CjDVnBGs.js +1 -0
  46. package/dist/index.html +8 -8
  47. package/package.json +1 -1
  48. package/dist/assets/AccessTab-BUu-z3sx.js +0 -1
  49. package/dist/assets/AgentFilesTab-CofVyQgk.js +0 -3
  50. package/dist/assets/AnomaliesTab-Bq3RmQHz.js +0 -1
  51. package/dist/assets/AuditTab-BS5US2vo.js +0 -1
  52. package/dist/assets/BridgeTab-BRhL8-C3.js +0 -1
  53. package/dist/assets/ChatDefaultsTab-DaSmKDML.js +0 -1
  54. package/dist/assets/DataTableShell-u1nLRhQM.js +0 -1
  55. package/dist/assets/FeedbacksTab-B7hyTj7i.js +0 -1
  56. package/dist/assets/FilesTab-CsZJjp3v.js +0 -1
  57. package/dist/assets/GroupsTab-Dash5os_.js +0 -1
  58. package/dist/assets/InstancesTab-M-1_F4WA.js +0 -1
  59. package/dist/assets/IntegrationsTab-DPL5iBqB.js +0 -1
  60. package/dist/assets/KpiTab-BXsIWGMh.js +0 -1
  61. package/dist/assets/PreferencesTab-BX3y939D.js +0 -1
  62. package/dist/assets/PromptInjectionsTab-Cnu3mata.js +0 -4
  63. package/dist/assets/RolesTab-BR7F3TsM.js +0 -1
  64. package/dist/assets/ServiceAccountsTab-Do8ADcys.js +0 -1
  65. package/dist/assets/SubAgentReportsTab-638o4lZF.js +0 -1
  66. package/dist/assets/ThemeShowroom-BZIH2Ja8.js +0 -1
  67. package/dist/assets/TracesTab-DrJDpSUE.js +0 -1
  68. package/dist/assets/UsersTab-BhMKwkaB.js +0 -1
  69. package/dist/assets/chevrons-up-down-DGKOAhJM.js +0 -1
  70. package/dist/assets/compatView-ZCfRu3f5.js +0 -1
  71. package/dist/assets/dispatchErrorInfo-DioyF49L.js +0 -1
  72. package/dist/assets/dist-0orl0RkM.js +0 -44
  73. package/dist/assets/index-BXEqld-9.css +0 -2
  74. package/dist/assets/index-CFTFwlx0.js +0 -231
  75. package/dist/assets/mermaid-GHXKKRXX-DmskwXIX.js +0 -1
  76. package/dist/assets/roleDescriptions-DHFs-TkY.js +0 -1
  77. package/dist/assets/x-DBdlW6Pd.js +0 -1
@@ -0,0 +1 @@
1
+ import{O as e}from"./index-CwfPxODu.js";export{e as Mermaid};
@@ -0,0 +1 @@
1
+ import{Bv as e,Hv as t,Rv as n,Vv as r,zv as i}from"./dist-Byo4-C3q.js";var a={pending:t,user:r,admin:e,observer:i,agent:n};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-0orl0RkM.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-Byo4-C3q.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{d as r,f as i,h as a,n as o,t as s,u as c,v as l,y as u}from"./dist-0orl0RkM.js";import{t as d}from"./dist-CM845ILS.js";import{_t as f,gt as p,ht as m}from"./index-CFTFwlx0.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[f]),b=f(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:l,activationMode:f=`automatic`,...p}=e,m=d(l),[h,v]=i({prop:r,onChange:a,defaultProp:o??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:c(),value:h,onValueChange:v,orientation:s,dir:m,activationMode:f,children:(0,g.jsx)(u.div,{dir:m,"data-orientation":s,...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)(u.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,o=S(E,n),s=b(n),c=A(o.baseId,r),d=j(o.baseId,r),f=r===o.value;return(0,g.jsx)(m,{asChild:!0,...s,focusable:!i,active:f,children:(0,g.jsx)(u.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":d,"data-state":f?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:l(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:l(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:l(e.onFocus,()=>{let e=o.activationMode!==`manual`;!f&&!i&&e&&o.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,forceMount:a,children:o,...s}=e,c=S(O,n),l=A(c.baseId,i),d=j(c.baseId,i),f=i===c.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(r,{present:a||f,children:({present:n})=>(0,g.jsx)(u.div,{"data-state":f?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:d,tabIndex:0,...s,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:o(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=s(`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:o(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:o(`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:o(`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{d as r,f as i,h as a,n as o,t as s,u as c,v as l,y as u}from"./dist-Byo4-C3q.js";import{t as d}from"./dist-GCf84zyw.js";import{St as f,bt as p,xt as m}from"./index-CwfPxODu.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[f]),b=f(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:l,activationMode:f=`automatic`,...p}=e,m=d(l),[h,v]=i({prop:r,onChange:a,defaultProp:o??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:c(),value:h,onValueChange:v,orientation:s,dir:m,activationMode:f,children:(0,g.jsx)(u.div,{dir:m,"data-orientation":s,...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)(m,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(u.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,o=S(E,n),s=b(n),c=A(o.baseId,r),d=j(o.baseId,r),f=r===o.value;return(0,g.jsx)(p,{asChild:!0,...s,focusable:!i,active:f,children:(0,g.jsx)(u.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":d,"data-state":f?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:l(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:l(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:l(e.onFocus,()=>{let e=o.activationMode!==`manual`;!f&&!i&&e&&o.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:i,forceMount:a,children:o,...s}=e,c=S(O,n),l=A(c.baseId,i),d=j(c.baseId,i),f=i===c.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(r,{present:a||f,children:({present:n})=>(0,g.jsx)(u.div,{"data-state":f?`active`:`inactive`,"data-orientation":c.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:d,tabIndex:0,...s,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:o(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=s(`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:o(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:o(`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:o(`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{D as e}from"./dist-Byo4-C3q.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
@@ -42,15 +42,15 @@
42
42
  document.documentElement.dataset.ambiance = a === "off" ? "off" : "on";
43
43
  })();
44
44
  </script>
45
- <script type="module" crossorigin src="/assets/index-CFTFwlx0.js"></script>
45
+ <script type="module" crossorigin src="/assets/index-CwfPxODu.js"></script>
46
46
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
47
- <link rel="modulepreload" crossorigin href="/assets/dist-0orl0RkM.js">
48
- <link rel="modulepreload" crossorigin href="/assets/dist-CM845ILS.js">
49
- <link rel="modulepreload" crossorigin href="/assets/dist-B9DB48K7.js">
50
- <link rel="modulepreload" crossorigin href="/assets/dist-4hLW9pCQ.js">
51
- <link rel="modulepreload" crossorigin href="/assets/x-DBdlW6Pd.js">
52
- <link rel="modulepreload" crossorigin href="/assets/button-CckfHMbj.js">
53
- <link rel="stylesheet" crossorigin href="/assets/index-BXEqld-9.css">
47
+ <link rel="modulepreload" crossorigin href="/assets/dist-Byo4-C3q.js">
48
+ <link rel="modulepreload" crossorigin href="/assets/dist-GCf84zyw.js">
49
+ <link rel="modulepreload" crossorigin href="/assets/dist-DeWVxElE.js">
50
+ <link rel="modulepreload" crossorigin href="/assets/dist-BJS2mn_o.js">
51
+ <link rel="modulepreload" crossorigin href="/assets/x-CjDVnBGs.js">
52
+ <link rel="modulepreload" crossorigin href="/assets/button-DOcSAX3s.js">
53
+ <link rel="stylesheet" crossorigin href="/assets/index-BsEfIgPs.css">
54
54
  </head>
55
55
  <body>
56
56
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lacneu/atrium",
3
- "version": "0.40.0",
3
+ "version": "0.41.1",
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{Cl as r,E as i,El as a,RA as o,Sl as s,Tl as c,_l as l,bl as u,fl as d,gl as f,hl as p,ml as m,pl as h,qA as g,vl as _,wl as v,xl as y,yl as b}from"./dist-0orl0RkM.js";import{C as x,S,b as C,et as w,w as T,x as E}from"./index-CFTFwlx0.js";var D=t(e(),1);function O(e){return e===`user`?f():e===`all`?p():m({group:e.group})}function k(e){return e===`common`?h():e===`owner`?d():m({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=g(i.admin.listUsers,{}),[t,n]=(0,D.useState)(``),d=g(i.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:a()}),(0,A.jsxs)(C,{value:t,onValueChange:n,children:[(0,A.jsx)(x,{size:`sm`,"aria-label":c(),children:(0,A.jsx)(T,{placeholder:c()})}),(0,A.jsx)(E,{children:(e??[]).map(e=>(0,A.jsx)(S,{value:e.userId,children:j(e)},e._id))})]}),t===``?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):d===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:o()}):(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:r()}),(0,A.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,A.jsx)(`strong`,{children:d.user.label}),(0,A.jsx)(w,{variant:`secondary`,children:d.role})]})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:s()}),d.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:d.groups.map(e=>(0,A.jsx)(w,{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:y()}),d.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:d.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)(w,{variant:`default`,children:l()}):null,(0,A.jsx)(w,{variant:`outline`,children:O(e.via)}),(0,A.jsx)(w,{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:u()}),d.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:d.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)(w,{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:b()}),d.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:d.permissions.map(e=>(0,A.jsx)(w,{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{$o as r,$t as i,At as a,BA as o,Bo as s,Bt as c,Dt as l,E as u,ET as d,Et as f,Fo as p,Go as m,Gt as h,Ho as g,Hs as _,Ht as v,Io as y,Jo as b,Jt as x,KA as S,Ko as C,Kt as w,Lo as T,Mo as E,No as D,Ot as O,Po as k,Qo as ee,Qt as A,RA as j,Ro as te,Rt as M,Tt as N,Uo as P,Ut as F,Vo as ne,Vt as I,WA as L,Wo as R,Ws as z,Wt as re,Xo as B,Xt as V,Yo as ie,Yt as ae,Zo as H,Zt as oe,as as U,en as W,es as se,in as ce,is as le,jt as ue,kt as de,nn as fe,ns as pe,os as me,qA as G,qo as he,qt as ge,rn as _e,rs as ve,ss as ye,tn as be,ts as xe,zo as Se,zt as Ce}from"./dist-0orl0RkM.js";import{t as K}from"./button-CckfHMbj.js";import{B as we,C as Te,H as Ee,L as De,P as q,R as Oe,S as ke,U as Ae,V as je,W as Me,b as Ne,et as Pe,it as Fe,nt as Ie,ot as Le,rt as Re,st as ze,ut as Be,vt as J,w as Ve,x as He,y as Ue,z as We}from"./index-CFTFwlx0.js";import{n as Ge,t as Ke}from"./curation-CQksaIbm.js";import{i as qe}from"./compatView-ZCfRu3f5.js";/* empty css */var Y=t(e(),1),X=2e4,Je=6e4;function Ye(e){return typeof e!=`number`||e<=0?0:Math.round(e/X*100)}function Xe(e){return e<=0?0:Math.round(e/Je*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 Ze(e){return e.reduce((e,t)=>e+(typeof t.size==`number`&&t.size>0?t.size:0),0)}var Qe=3;function $e(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<Qe&&a.push(e)):t>0&&(i+=t,o.length<Qe&&o.push(e));return{added:r,removed:i,sampleAdded:a,sampleRemoved:o}}function et(e){return e instanceof Error?e.message.includes(`conflict:`):String(e).includes(`conflict:`)}var Q=n(),$=e=>`${e.instanceName}::${e.agentId}`;function tt(){let e=G(u.me.getMe,{host:Be}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),a=G(u.admin.listInstances,e!==void 0&&t?{}:`skip`),[s,c]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!t||!a||a.length===0||(!s||!a.some(e=>e.name===s))&&c(a[0].name)},[t,a,s]);let l=G(u.agents.listAgentsForInstance,t&&s?{instanceName:s}:`skip`),d=G(u.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),f=(0,Y.useMemo)(()=>{if(e!==void 0){if(t)return s===null||l===void 0?a!==void 0&&a.length===0?[]:void 0:l.agents.map(e=>({instanceName:s,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(d!==void 0)return d.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,s,l,a,d]),[p,m]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!f||f.length===0||(!p||!f.some(e=>$(e)===p))&&m($(f[0]))},[f,p]);let h=f?.find(e=>$(e)===p)??null,g=L(u.agentFiles.listAgentFiles),[v,y]=(0,Y.useState)({status:`idle`}),b=h?.instanceName??null,x=h?.agentId??null,S=G(u.compat.forInstance,n&&b!==null?{instanceName:b}:`skip`),C=n&&b!==null?Ue(S,`agentFiles`):null,w=C===null?!1:C===`loading`?null:C.blocked,T=(0,Y.useCallback)(async()=>{if(!(b===null||x===null)){y({status:`loading`});try{y({status:`done`,files:(await g({instanceName:b,agentId:x})).files})}catch{y({status:`error`})}}},[g,b,x]);(0,Y.useEffect)(()=>{w===!1&&T()},[T,w]);let[E,D]=(0,Y.useState)(null),O=G(u.agentFileCuration.listCurations,t&&b!==null&&x!==null?{instanceName:b,agentId:x}:`skip`),k=G(u.agentFileCuration.curationSettings,t&&b!==null?{instanceName:b}:`skip`),A=L(u.agentFileCuration.requestCuration),[te,M]=(0,Y.useState)(null),[N,P]=(0,Y.useState)(null),{toast:F}=q(),ne=(0,Y.useMemo)(()=>{let e=new Map;for(let t of O??[])e.has(t.name)||e.set(t.name,t);return e},[O]),I=(0,Y.useCallback)(async e=>{if(!(b===null||x===null)){M(e);try{let t=await A({instanceName:b,agentId:x,name:e,trigger:`manual`});t.ok?F({title:be(),variant:`success`}):F({title:W({reason:t.reason??`unknown`}),variant:`error`})}catch{F({title:i(),variant:`error`})}finally{M(null)}}},[A,b,x,F]),R=o(),z=(0,Y.useMemo)(()=>new Intl.NumberFormat(R,{maximumFractionDigits:0}),[R]);return e===void 0||f===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:j()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ye()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(a?.length??0)>1?(0,Q.jsxs)(Ne,{value:s??``,onValueChange:e=>c(e),children:[(0,Q.jsx)(Te,{size:`sm`,"aria-label":me(),children:(0,Q.jsx)(Ve,{})}),(0,Q.jsx)(He,{children:(a??[]).map(e=>(0,Q.jsx)(ke,{value:e.name,children:e.name},e.name))})]}):null,f.length>0?(0,Q.jsxs)(Ne,{value:p??``,onValueChange:e=>m(e),children:[(0,Q.jsx)(Te,{size:`sm`,"aria-label":U(),children:(0,Q.jsx)(Ve,{})}),(0,Q.jsx)(He,{children:f.map(e=>(0,Q.jsx)(ke,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:le()})]}),h===null?null:C===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:j()}):C!==null&&C.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(J,{size:14,"aria-hidden":!0}),` `,qe(C.gatewayVersion,C.provider)]}):v.status===`loading`||v.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:j()}):v.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[pe(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void T(),children:_()})]}):v.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ve()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:v.files.map(e=>{let n=Ye(e.size),i=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)(Pe,{variant:`outline`,children:xe()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:se({size:Z(e.size,R)})}),(0,Q.jsx)(`span`,{className:`oc-afiles__gauge${i?` 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:r({pct:z.format(n)})}),i?(0,Q.jsx)(J,{size:14,className:`oc-afiles__warn`,"aria-label":ee()}):(0,Q.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>D(e),children:t?B():ie()}),t&&!e.missing?(0,Q.jsx)(nt,{curatable:Ke.includes(e.name),size:e.size??0,budget:k?.budgetChars??null,enabled:k?.enabled??!1,curation:ne.get(e.name)??null,inFlight:te===e.name,onCurate:()=>void I(e.name),onReview:e=>P(e)}):null]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:H({used:Z(Ze(v.files),R),total:Z(Je,R),pct:z.format(Xe(Ze(v.files)))})})]}),E&&h?(0,Q.jsx)(rt,{instanceName:h.instanceName,agentId:h.agentId,name:E.name,isAdmin:t,onClose:()=>D(null),onSaved:()=>void T()}):null,N?(0,Q.jsx)(it,{curationId:N,onClose:()=>P(null),onApplied:()=>{P(null),T()}}):null]})}function nt({curatable:e,size:t,budget:n,enabled:r,curation:i,inFlight:a,onCurate:o,onReview:s}){return i?.status===`proposed`?(0,Q.jsx)(K,{variant:`default`,size:`sm`,className:`oc-afiles__curate`,onClick:()=>s(i._id),children:_e()}):a||i?.status===`dispatched`||i?.status===`applying`?(0,Q.jsx)(Pe,{variant:`outline`,className:`oc-afiles__curate-status`,children:fe()}):e&&r&&n!==null&&Ge(t,n)?(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__curate`,onClick:o,children:ce()}):null}function rt({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:i,onSaved:a}){let c=L(u.agentFiles.getAgentFile),l=L(u.agentFiles.setAgentFile),f=q(),[h,v]=(0,Y.useState)(null),[x,S]=(0,Y.useState)(!1),[w,O]=(0,Y.useState)(``),[ee,A]=(0,Y.useState)(!1),[M,N]=(0,Y.useState)(!1),[F,I]=(0,Y.useState)(!1),[re,B]=(0,Y.useState)(!1),V=(0,Y.useCallback)(async r=>{S(!1);try{let i=await c({instanceName:e,agentId:t,name:n});v({content:i.content,updatedAtMs:i.updatedAtMs}),r||O(i.content),I(!1)}catch{S(!0)}},[c,e,t,n]);(0,Y.useEffect)(()=>{V(!1)},[V]);async function ie(){if(h!==null){N(!0),B(!1);try{await l({instanceName:e,agentId:t,name:n,content:w,baseUpdatedAtMs:h.updatedAtMs??void 0}),f.success(g({name:n})),a(),await V(!1)}catch(e){et(e)?I(!0):B(!0)}finally{N(!1)}}}let ae=h!==null&&w!==h.content,H=(0,Y.useMemo)(()=>h===null?null:$e(h.content,w),[h,w]),oe=w.length>X,U=o(),W=(0,Y.useMemo)(()=>new Intl.NumberFormat(U),[U]);return(0,Q.jsx)(Ie,{open:!0,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(Re,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(Le,{children:[(0,Q.jsx)(ze,{children:b({name:n})}),(0,Q.jsxs)(Fe,{children:[he({agent:t,instance:e}),r?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,C()]})]})]}),x?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[s(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void V(!1),children:_()})]}):h===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:j()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:w,readOnly:!r,spellCheck:!1,onChange:e=>O(e.target.value),"aria-label":b({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:m()}),F?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[Se(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void V(!0),children:te()})]}):null,re?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:ne()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${oe?` is-over`:``}`,children:R({count:W.format(w.length),max:W.format(X)})}),r?(0,Q.jsx)(K,{size:`sm`,disabled:!ae||M||F,onClick:()=>A(!0),children:M?z():P()}):null]})]}),(0,Q.jsx)(De,{open:ee,onOpenChange:A,children:(0,Q.jsxs)(we,{children:[(0,Q.jsxs)(Ae,{children:[(0,Q.jsx)(Me,{children:T({name:n})}),(0,Q.jsx)(je,{children:y({agent:t})})]}),H?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:p({added:H.added,removed:H.removed})}),H.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:k()}),H.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,H.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:D()}),H.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(Ee,{children:[(0,Q.jsx)(We,{children:d()}),(0,Q.jsx)(Oe,{onClick:()=>void ie(),children:E()})]})]})})]})})}function it({curationId:e,onClose:t,onApplied:n}){let r=G(u.agentFileCuration.getProposal,{curationId:e}),s=L(u.agentFileCuration.approveCuration),d=S(u.agentFileCuration.rejectCuration),{toast:p}=q(),[m,g]=(0,Y.useState)(null),[_,y]=(0,Y.useState)(!1),[b,C]=(0,Y.useState)(``),T=o(),E=(0,Y.useMemo)(()=>r?$e(r.beforeContent,r.proposedContent):null,[r]);async function D(){g(`approve`);try{let t=await s({curationId:e});t.ok?(p({title:A(),variant:`success`}),n()):p({title:t.reason===`conflict`?V():ae({reason:t.reason??`unknown`}),variant:`error`})}catch{p({title:i(),variant:`error`})}finally{g(null)}}async function k(n){g(`reject`);try{let r=b.trim();(await d({curationId:e,...r?{comment:r}:{},relaunch:n})).ok?p({title:n?f():oe(),variant:`success`}):p({title:w(),variant:`error`}),t()}catch{p({title:i(),variant:`error`})}finally{g(null)}}return(0,Q.jsx)(Ie,{open:!0,onOpenChange:e=>e?void 0:t(),children:(0,Q.jsxs)(Re,{className:`oc-afiles__review`,children:[(0,Q.jsxs)(Le,{children:[(0,Q.jsx)(ze,{children:r?x({name:r.name}):j()}),(0,Q.jsx)(Fe,{children:ge()})]}),r===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:j()}):r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:w()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`oc-afiles__review-sizes`,children:[h({before:Z(r.beforeSize,T),after:Z(r.proposedSize,T)}),r.overBudget?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsx)(J,{size:13,"aria-hidden":!0}),` `,re()]}):null]}),E?(0,Q.jsx)(`p`,{className:`oc-afiles__review-diff`,children:F({added:E.added,removed:E.removed})}):null,r.feedback?(0,Q.jsx)(`p`,{className:`oc-afiles__review-feedback`,children:N({feedback:r.feedback})}):null,E&&E.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__review-removed`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:M()}),(0,Q.jsx)(`ul`,{children:E.sampleRemoved.map((e,t)=>(0,Q.jsx)(`li`,{children:e||`\xA0`},t))})]}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__review-panes oc-afiles__review-panes--2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:Ce()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.beforeContent})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:v()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.proposedContent})]})]})]}),_?(0,Q.jsxs)(`div`,{className:`oc-afiles__reject-form`,children:[(0,Q.jsx)(`label`,{className:`oc-afiles__review-label`,htmlFor:`curation-reject-comment`,children:ue()}),(0,Q.jsx)(`textarea`,{id:`curation-reject-comment`,className:`oc-afiles__reject-textarea`,rows:3,placeholder:a(),value:b,onChange:e=>C(e.target.value)}),(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`ghost`,onClick:()=>y(!1),disabled:m!==null,children:de()}),(0,Q.jsx)(K,{variant:`outline`,onClick:()=>void k(!1),disabled:m!==null,children:m===`reject`?z():O()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void k(!0),disabled:m!==null,children:m===`reject`?z():l()})]})]}):(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`outline`,onClick:()=>y(!0),disabled:m!==null||r==null,children:I()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void D(),disabled:m!==null||r==null,children:m===`approve`?z():c()})]})]})})}export{tt as AgentFilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$g as r,A_ as i,C_ as ee,D_ as a,E as o,E_ as s,Jg as c,KA as te,Kg as l,M_ as u,N_ as d,O_ as ne,P_ as f,Qg as re,S_ as ie,T_ as ae,Xg as oe,Yg as p,Zg as se,__ as ce,a_ as le,b_ as ue,c_ as de,d_ as m,e_ as h,f_ as g,g_ as _,h_ as fe,i_ as pe,j_ as me,k_ as he,l_ as v,m_ as ge,n_ as _e,o_ as y,p_ as b,qA as x,qg as S,r_ as C,s_ as w,t_ as T,u_ as E,v_ as D,w_ as O,x_ as k,y_ as A}from"./dist-0orl0RkM.js";import{A as j,C as M,F as N,Ft as P,It as F,P as I,S as L,a as ve,b as R,et as z,r as ye,ut as be,w as B,x as V}from"./index-CFTFwlx0.js";import{n as H}from"./TimeRangePicker-D48D83Oh.js";import{t as xe}from"./FilterBar-DRUEEKsU.js";import{t as Se}from"./DataTableShell-u1nLRhQM.js";import{t as U}from"./dispatchErrorInfo-DioyF49L.js";var W=t(e(),1),G=n(),K=`__all__`,Ce=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function we(e){return e===`open`?f():e===`acknowledged`?d():u()}var Te=[`info`,`warn`,`critical`],Ee=[`detector`,`agent`,`user`],De={kind:`relative`,from:`now-30d`,to:`now`},Oe=200,q=`all`;function J(){let e=F({from:`/settings/anomalies`}),t=P({from:`/settings/anomalies`}),n=e.q??``,c=e.status===q?K:e.status,l=e.severity??K,u=e.kind??K,[d,f]=(0,W.useState)(K),p=ye(e.from,e.to),{from:S,to:U}=H(p),J=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),Y=e=>void t({search:t=>({...t,status:e===K?q:e})}),X=e=>void t({search:t=>({...t,severity:e===K?void 0:e})}),Ne=e=>void t({search:t=>({...t,kind:e===K?void 0:e})}),Pe=e=>void t({search:t=>({...t,...ve(e)})}),Fe=N(),Z=I(),Q=te(o.anomalies.resolveAnomaly),Ie=(x(o.me.getMe,{host:be})?.permissions??[]).includes(`admin.manage`),$=x(o.anomalies.listAnomalies,{limit:Oe,filter:{q:n||void 0,from:S,to:U,anomalyStatus:c===K?void 0:c,severity:l===K?void 0:l,source:d===K?void 0:d,kind:u===K?void 0:u}}),Le=(0,W.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.kind);return[...e].sort()},[$]),Re=n!==``||c!==`open`||l!==K||d!==K||u!==K||p.kind!==`relative`||p.from!==De.from;function ze(){f(K),t({search:{status:`open`},replace:!0})}async function Be(e){if(await Fe({title:me(),description:(0,G.jsxs)(G.Fragment,{children:[i(),` `,(0,G.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,he(),` `,(0,G.jsx)(`strong`,{children:ne()}),`.`,` `,a()]}),confirmLabel:s()}))try{await Q({anomalyId:e._id,status:`resolved`}),Z.success(ae(),e.kind)}catch(e){Z.error(O(),e)}}async function Ve(e){try{await Q({anomalyId:e._id,status:`acknowledged`}),Z.success(ee(),e.kind)}catch(e){Z.error(ie(),e)}}return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`p`,{className:`oc-admin__hint`,children:[k(),` `,(0,G.jsx)(`strong`,{children:ue()}),` `,A(),` `,(0,G.jsx)(`strong`,{children:D()}),` `,ce(),` `,(0,G.jsx)(`strong`,{children:_()}),` `,fe(),` `,(0,G.jsx)(`span`,{className:`oc-filter__window`,children:ge()})]}),(0,G.jsxs)(xe,{q:n,onQChange:J,searchPlaceholder:b(),timeRange:p,onTimeRangeChange:Pe,onReset:ze,canReset:Re,children:[(0,G.jsxs)(R,{value:c,onValueChange:Y,children:[(0,G.jsx)(M,{size:`sm`,className:`w-36`,children:(0,G.jsx)(B,{})}),(0,G.jsxs)(V,{children:[(0,G.jsx)(L,{value:K,children:g()}),Ce.map(e=>(0,G.jsx)(L,{value:e.value,children:we(e.value)},e.value))]})]}),(0,G.jsxs)(R,{value:l,onValueChange:X,children:[(0,G.jsx)(M,{size:`sm`,className:`w-36`,children:(0,G.jsx)(B,{placeholder:m()})}),(0,G.jsxs)(V,{children:[(0,G.jsx)(L,{value:K,children:E()}),Te.map(e=>(0,G.jsx)(L,{value:e,children:e},e))]})]}),(0,G.jsxs)(R,{value:d,onValueChange:f,children:[(0,G.jsx)(M,{size:`sm`,className:`w-32`,children:(0,G.jsx)(B,{placeholder:v()})}),(0,G.jsxs)(V,{children:[(0,G.jsx)(L,{value:K,children:de()}),Ee.map(e=>(0,G.jsx)(L,{value:e,children:e},e))]})]}),(0,G.jsxs)(R,{value:u,onValueChange:Ne,children:[(0,G.jsx)(M,{size:`sm`,className:`w-36`,children:(0,G.jsx)(B,{placeholder:w()})}),(0,G.jsxs)(V,{children:[(0,G.jsx)(L,{value:K,children:y()}),Le.map(e=>(0,G.jsx)(L,{value:e,children:e},e))]})]})]}),(0,G.jsx)(Se,{title:le(),rows:$,emptyHint:c===`open`?pe():C(),rowActions:e=>Ie&&e.status===`open`?[{label:_e(),onSelect:()=>void Be(e)},{label:T(),onSelect:()=>void Ve(e)}]:[],columns:[{header:h(),cell:e=>(0,G.jsx)(`span`,{className:`oc-traces__time`,children:j(e.at)}),sort:e=>e.at},{header:w(),cell:e=>(0,G.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:m(),cell:e=>(0,G.jsx)(Ae,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:r(),cell:e=>(0,G.jsx)(je,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:v(),cell:e=>(0,G.jsx)(z,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:re(),cell:e=>(0,G.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),sort:e=>e.message},{header:se(),cell:e=>(0,G.jsx)(ke,{row:e}),sort:e=>e.evidence??null},{header:oe(),cell:e=>e.correlationId?(0,G.jsx)(`code`,{className:`oc-traces__mono`,children:Me(e.correlationId)}):(0,G.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function Y(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 X(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=P();if(e.kind===`subagent.failure`){let n=X(e);return(0,G.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,G.jsx)(`div`,{className:`oc-anomaly__cause-head`,children:[...new Set(n.errorCategories??[])].map(e=>(0,G.jsx)(`code`,{className:`oc-traces__mono`,children:e},e))}),e.correlationId?(0,G.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:e.correlationId,limit:100}}),children:[`↗ `,p()]}):null]})}let n=Y(e);if(!n.dominantCode)return(0,G.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=U(n.dominantCode),i=n.sampleCorrelationId;return(0,G.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,G.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,G.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,G.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,G.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,G.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,p()]}):null]})}function Ae({severity:e}){return(0,G.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function je({status:e}){return e===`open`?(0,G.jsx)(z,{variant:`destructive`,children:c()}):e===`acknowledged`?(0,G.jsx)(z,{variant:`secondary`,children:S()}):(0,G.jsx)(z,{variant:`outline`,children:l()})}function Me(e){return e.length>8?e.slice(0,8):e}export{J as AnomaliesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$ as r,Av as i,Dv as a,E as o,Ev as s,Fv as c,Iv as l,Lv as u,Mv as d,Nv as f,Ov as p,Pv as m,Q as h,Rv as g,Tv as _,et as v,jv as y,kv as b,nt as x,qA as S,rt as C,tt as w,zv as T}from"./dist-0orl0RkM.js";import{A as E,C as D,Ft as O,It as k,S as A,a as j,b as M,i as N,o as P,r as F,t as I,w as L,x as R}from"./index-CFTFwlx0.js";import{n as ee}from"./TimeRangePicker-D48D83Oh.js";import{t as z}from"./FilterBar-DRUEEKsU.js";import{t as B}from"./AdvancedFilter-C0THAQ2E.js";import{t as V}from"./DataTableShell-u1nLRhQM.js";var H=t(e(),1),U=n(),W={kind:`relative`,from:I,to:`now`},G=`__all__`,K=[{value:`action`,label:C()},{value:`realLabel`,label:x()},{value:`targetLabel`,label:w()},{value:`impersonated`,label:v()},{value:`resource`,label:r()},{value:`resourceId`,label:h()}];function q(){let e=k({from:`/settings/audit`}),t=O({from:`/settings/audit`}),n=e.q??``,r=e.action??G,h=e.impersonated??G,v=e.resource??G,x=F(e.from,e.to),C=(0,H.useMemo)(()=>P(e.adv),[e.adv]),{from:w,to:I}=ee(x),q=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),J=e=>void t({search:t=>({...t,action:e===G?void 0:e})}),Y=e=>void t({search:t=>({...t,impersonated:e===G?void 0:e})}),X=e=>void t({search:t=>({...t,resource:e===G?void 0:e})}),Z=e=>void t({search:t=>({...t,...j(e)})}),Q=e=>void t({search:t=>({...t,adv:N(e)}),replace:!0}),$=S(o.admin.listAudit,{filter:{q:n||void 0,from:w,to:I,action:r===G?void 0:r,resource:v===G?void 0:v,impersonated:h===G?void 0:h===`yes`,advanced:C.length>0?C:void 0}}),te=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.action);return[...e].sort()},[$]),ne=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])t.resource&&e.add(t.resource);return[...e].sort()},[$]),re=n!==``||r!==G||h!==G||v!==G||C.length>0||x.kind!==`relative`||x.from!==W.from;function ie(){t({search:{},replace:!0})}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`oc-admin__hint`,children:[T(),` `,(0,U.jsx)(`span`,{className:`oc-filter__window`,children:g()})]}),(0,U.jsxs)(z,{q:n,onQChange:q,searchPlaceholder:u(),timeRange:x,onTimeRangeChange:Z,onReset:ie,canReset:re,children:[(0,U.jsxs)(M,{value:r,onValueChange:J,children:[(0,U.jsx)(D,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{placeholder:l()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(A,{value:G,children:c()}),te.map(e=>(0,U.jsx)(A,{value:e,children:e},e))]})]}),(0,U.jsxs)(M,{value:h,onValueChange:Y,children:[(0,U.jsx)(D,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(A,{value:G,children:m()}),(0,U.jsx)(A,{value:`yes`,children:f()}),(0,U.jsx)(A,{value:`no`,children:d()})]})]}),(0,U.jsxs)(M,{value:v,onValueChange:X,children:[(0,U.jsx)(D,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{placeholder:y()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(A,{value:G,children:i()}),ne.map(e=>(0,U.jsx)(A,{value:e,children:e},e))]})]})]}),(0,U.jsx)(B,{fields:K,seed:C,onChange:Q}),(0,U.jsx)(V,{title:b(),rows:$,emptyHint:p(),columns:[{header:a(),cell:e=>E(e.at),sort:e=>e.at},{header:l(),cell:e=>e.action,sort:e=>e.action},{header:s(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:_(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:y(),cell:e=>e.resource?e.resource+(e.resourceId?` · ${e.resourceId.slice(0,8)}`:``):`—`,sort:e=>e.resource??null}]})]})}export{q as AuditTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$p as r,Ap as i,Bm as a,Bp as o,Cp as s,D as c,Dp as l,E as u,Ep as d,Fp as f,Gp as p,Hm as m,Hp as h,Ip as g,Jp as _,KA as ee,Km as v,Kp as y,Lm as te,Lp as b,Mp as x,Nm as ne,Np as S,Op as re,Pm as ie,Pp as ae,Qp as oe,Rm as se,Rp as ce,Sp as le,Tp as ue,Um as de,Up as fe,Vm as pe,Vp as me,WA as he,Wm as ge,Wp as _e,Xp as ve,Yp as ye,Za as be,Zp as xe,_p as C,am as Se,ao as Ce,bp as we,cm as Te,co as Ee,dm as De,do as Oe,em as ke,fo as Ae,gp as w,im as je,io as Me,jp as Ne,kp as Pe,lm as Fe,lo as T,mo as Ie,nm as Le,no as Re,om as ze,oo as Be,po as Ve,qA as E,qm as He,qp as Ue,rm as We,ro as Ge,sm as Ke,so as qe,tm as Je,to as Ye,um as Xe,uo as Ze,vp as D,wp as Qe,xp as $e,yp as et,zm as tt,zp as nt}from"./dist-0orl0RkM.js";import{i as O,r as rt}from"./dist-CM845ILS.js";import{t as it}from"./chevrons-up-down-DGKOAhJM.js";import{i as at,n as k,o as ot,r as st,s as ct}from"./FieldLabel-B8G-MYNo.js";import{t as lt}from"./button-CckfHMbj.js";import{A,C as j,Et as ut,Ft as dt,G as ft,K as pt,Nt as M,P as mt,Pt as N,S as P,b as F,et as I,it as ht,j as L,m as gt,nt as _t,ot as vt,p as yt,q as bt,rt as xt,st as St,tt as R,ut as Ct,vt as z,w as B,x as V,xt as wt}from"./index-CFTFwlx0.js";import{r as Tt}from"./locales-CPjguROj.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-CnKDuavw.js";import{t as kt}from"./FilterBar-DRUEEKsU.js";import{a as G,n as At,o as jt,r as Mt,s as Nt,t as Pt}from"./compatView-ZCfRu3f5.js";import{t as K}from"./dispatchErrorInfo-DioyF49L.js";var Ft=c(`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`}]]),It=c(`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`}]]),q=t(e(),1);function Lt(e){return e.filter(e=>e.state===`error`)}function Rt(e){return e.reachable&&Lt(e.targets).length===0}function zt(e){return e.state===`error`&&e.lastErrorCode!==null}function Bt(e){return!!e.lastDownstreamRejectCode}function J(e){return e.kind??`openclaw`}function Vt(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function Ht(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,J(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(J(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return Vt(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>J(e)===r)}))}function Ut(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var Y=`__all__`,Wt={q:``,state:Y,instance:Y,version:Y},X={connected:0,error:1,idle:2};function Gt(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function Kt(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 Z(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function qt(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function Jt(e,t,n){switch(e){case`state`:return(X[t.state]??99)-(X[n.state]??99);case`instance`:return Z(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return Z(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return jt(e,r)??Z(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return Z(t.targetLabel,n.targetLabel)}}function Yt(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=qt(t.key,e),a=qt(t.key,r);return i&&a?0:i?1:a?-1:n*Jt(t.key,e,r)})}function Xt(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(X[e]??99)-(X[t]??99))}function Zt(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)=>Z(e.label,t.label))}function Qt(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>jt(e,t)??Z(e,t))}var Q=n();function $t({connections:e,displayByInstance:t}){let[n,r]=(0,q.useState)(Wt),[a,o]=(0,q.useState)(null),c=(0,q.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]),u=(0,q.useMemo)(()=>Xt(c),[c]),f=(0,q.useMemo)(()=>Zt(c),[c]),p=(0,q.useMemo)(()=>Qt(c),[c]),m=(0,q.useMemo)(()=>Yt(Kt(c,n),a),[c,n,a]);function h(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:ae()}):(0,Q.jsxs)(`div`,{className:`oc-conn`,children:[(0,Q.jsxs)(kt,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:Ne(),onReset:()=>r(Wt),canReset:Gt(n),children:[(0,Q.jsxs)(F,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(B,{placeholder:Pe()})}),(0,Q.jsxs)(V,{children:[(0,Q.jsx)(P,{value:Y,children:i()}),u.map(e=>(0,Q.jsx)(P,{value:e,children:tn(e)},e))]})]}),(0,Q.jsxs)(F,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-40`,children:(0,Q.jsx)(B,{placeholder:re()})}),(0,Q.jsxs)(V,{children:[(0,Q.jsx)(P,{value:Y,children:i()}),f.map(e=>(0,Q.jsx)(P,{value:e.name,children:e.label},e.name))]})]}),(0,Q.jsxs)(F,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(B,{placeholder:l()})}),(0,Q.jsxs)(V,{children:[(0,Q.jsx)(P,{value:Y,children:i()}),p.map(e=>(0,Q.jsx)(P,{value:e,children:e},e))]})]})]}),m.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):(0,Q.jsxs)(Ot,{className:`oc-conn__table`,children:[(0,Q.jsx)(Et,{children:(0,Q.jsxs)(U,{children:[(0,Q.jsx)($,{label:ue(),sortKey:`target`,sort:a,onSort:h}),(0,Q.jsx)($,{label:Qe(),sortKey:`state`,sort:a,onSort:h}),(0,Q.jsx)($,{label:s(),sortKey:`instance`,sort:a,onSort:h}),(0,Q.jsx)($,{label:le(),sortKey:`host`,sort:a,onSort:h}),(0,Q.jsx)($,{label:$e(),sortKey:`version`,sort:a,onSort:h}),(0,Q.jsx)(H,{children:we()}),(0,Q.jsx)($,{label:et(),sortKey:`lastOk`,sort:a,onSort:h})]})}),(0,Q.jsx)(Dt,{children:m.map(e=>(0,Q.jsx)(en,{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)(H,{"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)(rt,{size:13,"aria-hidden":!0}):(0,Q.jsx)(O,{size:13,"aria-hidden":!0}):(0,Q.jsx)(it,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function en({r:e}){let t=zt(e)?K(e.lastErrorCode):null,n=Bt(e)?K(e.lastDownstreamRejectCode):null;return(0,Q.jsxs)(q.Fragment,{children:[(0,Q.jsxs)(U,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Q.jsx)(W,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Q.jsx)(W,{children:(0,Q.jsx)(nn,{state:e.state})}),(0,Q.jsx)(W,{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)(W,{children:(0,Q.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Q.jsx)(W,{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)(W,{children:(0,Q.jsx)(`span`,{className:`oc-conn__stats`,children:S({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Q.jsx)(W,{children:e.lastOkAt?(0,Q.jsx)(`span`,{className:`oc-traces__mono`,children:L(e.lastOkAt)}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Q.jsx)(U,{className:`oc-conn__detail-row`,children:(0,Q.jsxs)(W,{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?` · ${L(e.lastErrorAt)}`:``,(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[x({label:n.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${L(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function tn(e){return e===`connected`?D():e===`error`?C():w()}function nn({state:e}){return e===`connected`?(0,Q.jsx)(I,{variant:`secondary`,children:D()}):e===`error`?(0,Q.jsx)(I,{variant:`destructive`,children:C()}):(0,Q.jsx)(I,{variant:`outline`,children:w()})}function rn(){return E(u.bridgeHealth.getBridgeHealth,{})}function an(){let e=rn(),t=E(u.compat.getBridgeCompat,{}),n=E(u.me.getMe,{host:Ct})?.role===`admin`,r=E(u.admin.listInstances,n?{}:`skip`),i=E(u.agents.usageForInstances,n?{}:`skip`),a=dt(),o=()=>void a({to:`/settings/anomalies`,search:{status:`open`}}),s=Ht(e?e.targets:[],t?t.targets:[],r??[]),c=t?.compat??null,l=t===void 0?`loading`:t===null?`nodata`:`ready`,d=c!==null&&At(c,`hermes`)&&!s.some(e=>e.key===`hermes`);return(0,Q.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Q.jsx)(on,{health:e,compat:t,onSeeAnomalies:o}),(0,Q.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:xe()}),i&&i.length>0?(0,Q.jsxs)(`section`,{className:`oc-bridge__usage`,children:[(0,Q.jsx)(`h3`,{className:`oc-bridge__usage-title`,children:ve()}),i.map(e=>{let t=gt(e.usage,Date.now());return t?(0,Q.jsxs)(`div`,{className:`oc-bridge__usage-row`,children:[(0,Q.jsx)(`span`,{className:`oc-bridge__usage-instance`,children:e.instanceName}),(0,Q.jsx)(`span`,{className:`oc-bridge__usage-windows`,children:t.windows.map(e=>(0,Q.jsx)(`span`,{className:`oc-meter ${e.percentLeft<=10?`is-critical`:e.percentLeft<=25?`is-warn`:`is-ok`}`,children:(0,Q.jsxs)(`span`,{className:`oc-meter__label`,children:[e.provider,` `,e.label,`: `,e.percentLeft,`%`,e.resetText?` ⏱${e.resetText}`:``]})},`${e.provider}:${e.label}`))})]},e.instanceName):null})]}):null,s.map(e=>(0,Q.jsx)(sn,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:c,compatStatus:l,compatReachable:t?.reachable??!0,protocol:e.key===`openclaw`?t?.protocol??null:null},e.key)),d?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:be()}):null]})}function on({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:G(t.bridgeVersion)}),i?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsxs)(`code`,{className:`oc-traces__mono`,title:Ae(),children:[`(`,i,`)`]})]}):null,r?(0,Q.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,Oe({build:t.buildVersion??`?`})]}):null,` · `,Ze(),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?T():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:fe()});if(e===null)return(0,Q.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:h()});let s=Lt(e.targets),c=!e.reachable,l=Rt(e),u=l?`ok`:`error`,d=A(e.checkedAt),f=e.startedAt==null?null:A(e.startedAt);return(0,Q.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${u}`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:l?(0,Q.jsx)(M,{size:22}):c?(0,Q.jsx)(It,{size:22}):(0,Q.jsx)(z,{size:22})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__title`,children:l?me():c?o():nt({count:s.length})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(Ft,{size:12,"aria-hidden":!0}),` `,ce({time:d})]}),f?(0,Q.jsx)(`span`,{children:b({time:f})}):null,a]}),c?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:K(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:g()})]})}function sn({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a,protocol:o}){let s=r?Nt(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:Pt(t,e,r)})}let d=l.map(e=>e.state),p=d.includes(`beyond`)?`beyond`:d.length>0&&d.every(e=>e===`supported`)?`supported`:null,[m,h]=(0,q.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)(wt,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Q.jsx)(`span`,{className:`oc-bridge-provider__name`,children:Ut(e)}),p?(0,Q.jsx)(I,{variant:p===`beyond`?`destructive`:`secondary`,children:Mt(p)}):null]}),(0,Q.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:Ie()}),(0,Q.jsx)(ln,{support:s,compatStatus:i,compatReachable:a,manifest:r,instanceRows:l}),o?(0,Q.jsx)(cn,{protocol:o}):null,(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":m,onClick:()=>h(e=>!e),children:[m?(0,Q.jsx)(O,{size:13,"aria-hidden":!0}):(0,Q.jsx)(N,{size:13,"aria-hidden":!0}),f({count:t.length})]}),m?(0,Q.jsx)($t,{connections:t,displayByInstance:c}):null]})}function cn({protocol:e}){let[t,n]=(0,q.useState)(!1),r=e.coverage,i=e.drift??[];return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`h4`,{className:`oc-bridge-provider__sub`,children:[ye(),i.length>0?(0,Q.jsx)(I,{variant:`destructive`,children:Ue({count:i.length})}):(0,Q.jsx)(I,{variant:`secondary`,children:_()})]}),(0,Q.jsxs)(`p`,{className:`oc-admin__hint`,children:[y({version:e.vendoredVersion}),r?` · `+p({handled:r.handled,ignored:r.ignored,gaps:r.gaps}):null]}),i.length>0?(0,Q.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:i.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.shape}),` × `,e.count]},e.shape))}):null,r&&r.gapList.length>0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[t?(0,Q.jsx)(O,{size:13,"aria-hidden":!0}):(0,Q.jsx)(N,{size:13,"aria-hidden":!0}),_e({count:r.gapList.length})]}),t?(0,Q.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:r.gapList.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e})},e))}):null]}):null]})}function ln({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i}){return t===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}):t===`nodata`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ve()}):(0,Q.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ee()}),r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:qe()}):(0,Q.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__label`,children:Be()}),e&&e.range!==null?(0,Q.jsx)(`span`,{children:Ce({min:e.range.min,max:e.range.maxValidated})}):(0,Q.jsx)(`span`,{children:T()}),e?(0,Q.jsx)(pn,{versions:e.validatedVersions}):null]}),i.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ye()}):(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:G(e.version)}),(0,Q.jsx)(I,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:Mt(e.state)})]},e.instanceName))})]})}function un({instance:e,onClose:t}){return(0,Q.jsx)(_t,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Q.jsxs)(xt,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Q.jsxs)(vt,{children:[(0,Q.jsx)(St,{children:He({instance:e.displayName??e.name})}),(0,Q.jsx)(ht,{children:v()})]}),(0,Q.jsx)(fn,{instance:e,onClose:t})]})})}function dn({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)(M,{"aria-hidden":!0}):(0,Q.jsx)(z,{"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[e,` — `,t.ok?Je():t.detail]})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,ke()]}):null}function fn({instance:e,onClose:t}){let n=ee(u.admin.upsertInstanceConfig),i=he(u.bridge.validateMediaPaths),o=mt(),s=Tt(e.config?.contentLocale,void 0),[c,l]=(0,q.useState)(()=>at(e.config??{},s)),[d,f]=(0,q.useState)(!1),[p,h]=(0,q.useState)(!1),[g,_]=(0,q.useState)(null),v=c.inboundMediaMode===`shared-fs`,y=c.mediaMode===`shared-fs`,b=v||y;async function x(){h(!0),_(null);try{_(await i({instanceName:e.name,inboundMediaMode:c.inboundMediaMode,mediaMode:c.mediaMode}))}catch(e){o.error(Se(),e)}finally{h(!1)}}async function S(){f(!0);try{let r=e.config??{};await n({instanceId:e._id,config:st(c,r,s)}),t()}catch(e){o.error(tt(),e)}finally{f(!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)(k,{label:ge(),help:se()}),(0,Q.jsxs)(F,{value:c.mediaMode,onValueChange:e=>l({...c,mediaMode:e}),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(B,{})}),(0,Q.jsx)(V,{children:ct.map(e=>(0,Q.jsx)(P,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:de(),help:te()}),(0,Q.jsxs)(F,{value:c.inboundMediaMode,onValueChange:e=>l({...c,inboundMediaMode:e}),children:[(0,Q.jsx)(j,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(B,{})}),(0,Q.jsx)(V,{children:ot.map(e=>(0,Q.jsx)(P,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:m(),help:ie()}),(0,Q.jsx)(R,{type:`number`,min:1,max:4096,className:`w-full`,value:c.mediaMaxMb,onChange:e=>l({...c,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),b&&(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[v&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:De(),help:Xe()}),(0,Q.jsx)(R,{className:`w-full`,spellCheck:!1,value:c.inboundAgentMount,onChange:e=>l({...c,inboundAgentMount:e.target.value})})]}),y&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(k,{label:Fe(),help:Te()}),(0,Q.jsx)(R,{className:`w-full`,spellCheck:!1,value:c.outboundAgentMount,onChange:e=>l({...c,outboundAgentMount:e.target.value})})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(yt,{checked:c.rehydration,onCheckedChange:e=>l({...c,rehydration:e===!0})}),(0,Q.jsx)(k,{label:pe(),help:ne()})]}),b&&g!==null&&(0,Q.jsx)(`div`,{className:`oc-bridge-config__check`,children:g.reachable?!g.inbound&&!g.outbound?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(z,{"aria-hidden":!0}),oe({reason:g.reason??`?`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(dn,{label:We(),result:g.inbound}),(0,Q.jsx)(dn,{label:Le(),result:g.outbound}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:je()})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(z,{"aria-hidden":!0}),r()]})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[b&&(0,Q.jsxs)(lt,{variant:`outline`,size:`sm`,onClick:()=>void x(),disabled:p,children:[p?(0,Q.jsx)(ut,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,p?ze():Ke()]}),(0,Q.jsx)(lt,{size:`sm`,onClick:()=>void S(),disabled:d,children:a()})]})]})})}function pn({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Q.jsxs)(ft,{children:[(0,Q.jsx)(bt,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?Me():Ge({count:e.length}),(0,Q.jsx)(O,{size:13,"aria-hidden":!0})]})}),(0,Q.jsxs)(pt,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Q.jsx)(`p`,{className:`oc-compat__versions-title`,children:Re()}),(0,Q.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Q.jsx)(I,{variant:`secondary`,children:e},e))})]})]})}export{an as BridgeTab,un as InstanceConfigDialog};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ao as r,Co as i,Do as a,E as o,ET as s,Eo as c,Gm as l,Gn as u,Hs as d,Jn as f,KA as p,Kn as m,Ls as h,Oo as g,RA as _,Rs as v,So as y,To as ee,Un as b,WA as x,Wn as S,Ws as C,Yn as w,_o as te,bo as T,go as E,ho as ne,ko as re,os as D,qA as O,qn as k,vo as ie,wo as A,xo as ae,yo as j}from"./dist-0orl0RkM.js";import{t as M}from"./button-CckfHMbj.js";import{B as oe,C as se,H as N,L as ce,P as le,R as ue,S as de,U as fe,V as pe,W as me,b as P,d as F,f as I,p as L,tt as R,vt as z,w as he,x as ge,y as _e,z as ve}from"./index-CFTFwlx0.js";import{i as B}from"./compatView-ZCfRu3f5.js";/* empty css */var V=t(e(),1),ye=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function be(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 H=n();function xe({instance:e}){let t=p(o.admin.upsertInstanceConfig),n=e.config?.curationEnabled===!0,r=typeof e.config?.curationBudgetChars==`number`?e.config.curationBudgetChars:null,[i,a]=(0,V.useState)(n),[s,c]=(0,V.useState)(r===null?``:String(r)),[l,d]=(0,V.useState)(`idle`);(0,V.useEffect)(()=>{a(n),c(r===null?``:String(r)),d(`idle`)},[e._id,n,r]);let f=s.trim(),h=f===``?null:/^\d+$/.test(f)?Number.parseInt(f,10):NaN,g=!i||h===null||Number.isInteger(h)&&h>=4e3&&h<=6e4,_=i!==n||(h??null)!==r;async function v(){d(`saving`);try{let n={...e.config??{}};n.curationEnabled=i,!i||h===null||Number.isNaN(h)?delete n.curationBudgetChars:n.curationBudgetChars=h,await t({instanceId:e._id,config:n}),d(`done`)}catch{d(`error`)}}return(0,H.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,H.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,H.jsx)(L,{checked:i,onCheckedChange:e=>a(e===!0),"aria-label":k()}),(0,H.jsx)(`span`,{className:`oc-cdefaults__label`,children:k()})]}),(0,H.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,H.jsx)(R,{type:`number`,min:4e3,max:6e4,step:1e3,placeholder:`20000`,value:s,onChange:e=>c(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!g,"aria-label":m(),disabled:!i}),(0,H.jsx)(M,{size:`sm`,disabled:!_||!g||l===`saving`,onClick:()=>void v(),children:l===`saving`?C():A()})]}),g?null:(0,H.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:u()}),l===`done`?(0,H.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:T()}):null,l===`error`?(0,H.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:j()}):null,(0,H.jsx)(`p`,{className:`oc-cdefaults__help`,children:S()})]})}function Se({instance:e}){let t=p(o.admin.upsertInstanceConfig),n=typeof e.config?.summarizeThresholdChars==`number`?e.config.summarizeThresholdChars:null,[r,i]=(0,V.useState)(n===null?``:String(n)),[a,s]=(0,V.useState)(`idle`);(0,V.useEffect)(()=>{i(n===null?``:String(n)),s(`idle`)},[e._id,n]);let c=r.trim(),l=c===``?null:/^\d+$/.test(c)?Number.parseInt(c,10):NaN,u=l===null||Number.isInteger(l)&&l>=1e3&&l<=2e5,d=(l??null)!==n;async function m(){s(`saving`);try{let n={...e.config??{}};l===null?delete n.summarizeThresholdChars:n.summarizeThresholdChars=l,await t({instanceId:e._id,config:n}),s(`done`)}catch{s(`error`)}}return(0,H.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,H.jsx)(`span`,{className:`oc-cdefaults__label`,children:w()}),(0,H.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,H.jsx)(R,{type:`number`,min:1e3,max:2e5,step:1e3,placeholder:`8000`,value:r,onChange:e=>i(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!u}),(0,H.jsx)(M,{size:`sm`,disabled:!d||!u||a===`saving`,onClick:()=>void m(),children:a===`saving`?C():A()})]}),u?null:(0,H.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:b()}),a===`done`?(0,H.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:T()}):null,a===`error`?(0,H.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:j()}):null,(0,H.jsx)(`p`,{className:`oc-cdefaults__help`,children:f()})]})}function U(){let e=x(o.agentFiles.getChatDefaults),t=x(o.agentFiles.setChatDefaults),n=x(o.agentFiles.clearChatDefaults),u=le(),[f,p]=(0,V.useState)({status:`loading`}),[m,b]=(0,V.useState)({thinkingDefault:null,fastModeDefault:null}),[S,w]=(0,V.useState)(!1),[k,L]=(0,V.useState)(!1),R=O(o.admin.listInstances,{}),[U,W]=(0,V.useState)(null);(0,V.useEffect)(()=>{!R||R.length===0||(!U||!R.some(e=>e.name===U))&&W(R[0].name)},[R,U]);let G=(R?.length??0)>1,Ce=R!==void 0&&R.length===0,we=O(o.compat.forInstance,U?{instanceName:U}:`skip`),K=U?_e(we,`configDefaults`):`loading`,q=K===`loading`?null:K.blocked,J=(0,V.useMemo)(()=>G&&U?{instanceName:U}:{},[G,U]),Y=(0,V.useRef)(0),X=(0,V.useCallback)(async()=>{let t=++Y.current;p({status:`loading`});try{let n=be(await e(J));if(Y.current!==t)return;p({status:`done`,current:n}),b(n)}catch{if(Y.current!==t)return;p({status:`error`})}},[e,J]);(0,V.useEffect)(()=>{q===!1&&(G&&!U||X())},[X,q,G,U]);let Z=f.status===`done`?f.current:null,Q=Z!==null&&m.thinkingDefault!==null&&m.thinkingDefault!==Z.thinkingDefault,$=Z!==null&&m.fastModeDefault!==null&&m.fastModeDefault!==Z.fastModeDefault,Te=Q||$;async function Ee(){L(!0);try{await t({...J,...Q?{thinkingDefault:m.thinkingDefault}:{},...$?{fastModeDefault:m.fastModeDefault}:{}}),u.success(T()),await X()}catch(e){u.error(j(),e)}finally{L(!1)}}async function De(){L(!0);try{await n({...J}),u.success(ae()),await X()}catch(e){u.error(j(),e)}finally{L(!1)}}let Oe=(0,V.useMemo)(()=>ye.map(e=>({id:e,label:I(e)})),[]),ke=(0,V.useMemo)(()=>[{id:`fast`,label:v()},{id:`standard`,label:h()}],[]);return(0,H.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:r()}),G&&U?(0,H.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,H.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()}),(0,H.jsxs)(P,{value:U,onValueChange:e=>W(e),disabled:k,children:[(0,H.jsx)(se,{size:`sm`,"aria-label":D(),children:(0,H.jsx)(he,{})}),(0,H.jsx)(ge,{children:(R??[]).map(e=>(0,H.jsx)(de,{value:e.name,children:e.name},e.name))})]})]}):null,Ce?(0,H.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:l()}):K===`loading`?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):K.blocked?(0,H.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,H.jsx)(z,{size:14,"aria-hidden":!0}),` `,B(K.gatewayVersion,K.provider)]}):f.status===`loading`?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):f.status===`error`?(0,H.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[ee(),` `,(0,H.jsx)(M,{variant:`outline`,size:`sm`,onClick:()=>void X(),children:d()})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,H.jsx)(`span`,{className:`oc-cdefaults__label`,children:re()}),(0,H.jsx)(F,{options:Oe,value:m.thinkingDefault,onChange:e=>b({...m,thinkingDefault:e}),disabled:k}),(0,H.jsx)(`p`,{className:`oc-cdefaults__help`,children:g()})]}),(0,H.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,H.jsx)(`span`,{className:`oc-cdefaults__label`,children:a()}),(0,H.jsx)(F,{options:ke,value:m.fastModeDefault===null?null:m.fastModeDefault?`fast`:`standard`,onChange:e=>b({...m,fastModeDefault:e===`fast`}),disabled:k}),(0,H.jsx)(`p`,{className:`oc-cdefaults__help`,children:c()})]}),(0,H.jsxs)(`div`,{className:`oc-cdefaults__actions`,children:[(0,H.jsx)(M,{variant:`outline`,size:`sm`,disabled:k,onClick:()=>void De(),title:y(),children:i()}),(0,H.jsx)(M,{size:`sm`,disabled:!Te||k,onClick:()=>w(!0),children:k?C():A()})]}),(0,H.jsx)(`p`,{className:`oc-cdefaults__note`,children:ie()})]}),(()=>{let e=R?.find(e=>e.name===(U??R[0]?.name));return e?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Se,{instance:e}),(0,H.jsx)(xe,{instance:e})]}):null})(),(0,H.jsx)(ce,{open:S,onOpenChange:w,children:(0,H.jsxs)(oe,{children:[(0,H.jsxs)(fe,{children:[(0,H.jsx)(me,{children:te()}),(0,H.jsx)(pe,{children:E()})]}),(0,H.jsxs)(N,{children:[(0,H.jsx)(ve,{children:s()}),(0,H.jsx)(ue,{onClick:()=>void Ee(),children:ne()})]})]})})]})}export{U as ChatDefaultsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Gu as r,Ju as i,Ku as a,Uu as o,Wu as s,Yu as c,qu as l}from"./dist-0orl0RkM.js";import{i as u,r as d}from"./dist-CM845ILS.js";import{t as f}from"./chevrons-up-down-DGKOAhJM.js";import{t as p}from"./button-CckfHMbj.js";import{$ as m,J as h,Q as g,X as _,Y as v,kt as y,p as b,wt as x,yt as S}from"./index-CFTFwlx0.js";import{a as C,i as w,n as T,o as E,r as D,t as O}from"./table-CnKDuavw.js";var k=t(e(),1);function A(e,t){return typeof e==`number`&&typeof t==`number`?e-t:typeof e==`boolean`&&typeof t==`boolean`?!!e-+!!t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:`base`})}function j(e,t,n){return[...e].sort((e,r)=>{let i=t(e),a=t(r),o=i==null,s=a==null;if(o||s)return o&&s?0:o?1:-1;let c=A(i,a);return n===`asc`?c:-c})}var M=n();function N({title:e,rows:t,columns:n,rowActions:A,onAdd:N,addLabel:P=c(),bulkActions:F,emptyHint:I=i(),isExpanded:L,renderExpanded:R}){let[z,B]=(0,k.useState)(new Set),[V,H]=(0,k.useState)(null),U=t??[],W=V?n[V.index]:void 0,G=V&&W?.sort?j(U,W.sort,V.dir):U;function K(e){H(t=>!t||t.index!==e?{index:e,dir:`asc`}:t.dir===`asc`?{index:e,dir:`desc`}:null)}let q=+!!F+n.length+ +!!A,J=U.length>0&&z.size===U.length,Y=z.size>0&&!J;function X(){B(J?new Set:new Set(U.map(e=>e._id)))}function Z(e){B(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return(0,M.jsxs)(`div`,{className:`oc-dt`,children:[(0,M.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,M.jsx)(`h2`,{className:`oc-dt__title`,children:e}),(0,M.jsxs)(`div`,{className:`oc-dt__bar-actions`,children:[z.size>0&&F?F.map(e=>(0,M.jsxs)(p,{size:`sm`,variant:e.variant===`destructive`?`destructive`:`outline`,onClick:()=>{e.onSelect([...z]),B(new Set)},children:[e.variant===`destructive`?(0,M.jsx)(S,{}):null,e.label,` (`,z.size,`)`]},e.label)):null,N?(0,M.jsxs)(p,{size:`sm`,onClick:N,children:[(0,M.jsx)(x,{}),` `,P]}):null]})]}),t===void 0?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):U.length===0?(0,M.jsx)(`p`,{className:`oc-admin__hint`,children:I}):(0,M.jsxs)(O,{children:[(0,M.jsx)(C,{children:(0,M.jsxs)(E,{children:[F?(0,M.jsx)(w,{className:`w-8`,children:(0,M.jsx)(b,{"aria-label":a(),checked:J?!0:Y?`indeterminate`:!1,onCheckedChange:X})}):null,n.map((e,t)=>{let n=V?.index===t;return e.sort?(0,M.jsx)(w,{className:e.className,"aria-sort":n?V.dir===`asc`?`ascending`:`descending`:`none`,children:(0,M.jsxs)(`button`,{type:`button`,className:`oc-dt__sort`,onClick:()=>K(t),"aria-label":o({column:e.header}),children:[e.header,n?V.dir===`asc`?(0,M.jsx)(d,{className:`oc-dt__sort-icon`,"aria-hidden":!0}):(0,M.jsx)(u,{className:`oc-dt__sort-icon`,"aria-hidden":!0}):(0,M.jsx)(f,{className:`oc-dt__sort-icon oc-dt__sort-icon--idle`,"aria-hidden":!0})]})},e.header):(0,M.jsx)(w,{className:e.className,children:e.header},e.header)}),A?(0,M.jsx)(w,{className:`w-8`}):null]})}),(0,M.jsx)(T,{children:G.map(e=>{let t=A?.(e)??[],i=L?.(e)??!1;return(0,M.jsxs)(k.Fragment,{children:[(0,M.jsxs)(E,{className:`group/row`,children:[F?(0,M.jsx)(D,{children:(0,M.jsx)(b,{"aria-label":r(),checked:z.has(e._id),onCheckedChange:()=>Z(e._id)})}):null,n.map(t=>(0,M.jsx)(D,{className:t.className,children:t.cell(e)},t.header)),A?(0,M.jsx)(D,{children:t.length>0?(0,M.jsxs)(h,{children:[(0,M.jsx)(m,{asChild:!0,children:(0,M.jsx)(p,{variant:`ghost`,size:`icon-sm`,"aria-label":s(),className:`opacity-0 transition-opacity group-hover/row:opacity-100 group-focus-within/row:opacity-100 aria-expanded:opacity-100`,children:(0,M.jsx)(y,{})})}),(0,M.jsx)(v,{align:`end`,children:t.map((t,n)=>(0,M.jsxs)(`div`,{children:[t.variant===`destructive`&&n>0?(0,M.jsx)(g,{}):null,(0,M.jsx)(_,{variant:t.variant,onSelect:()=>t.onSelect(e),children:t.label})]},t.label))})]}):null}):null]}),i&&R?(0,M.jsx)(E,{className:`oc-dt__expansion`,children:(0,M.jsx)(D,{colSpan:q,className:`oc-dt__expansion-cell`,children:R(e)})}):null]},e._id)})})]})]})}export{N as t};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$x as r,Ax as i,Bx as a,Cx as o,Dx as s,E as c,Ex as l,Fx as u,Gx as d,Hx as ee,Ix as te,Jx as f,KA as p,Kx as m,Lx as h,Mx as g,Nx as _,Ox as ne,Px as re,Qx as v,Rx as ie,Sx as y,Tx as b,Ux as x,Vx as S,Wx as C,Xx as w,Yx as T,Zx as E,_x as D,ax as O,bx as k,cn as A,cx as j,dx as M,eS as N,ex as P,fx as F,gx as I,hx as L,ix as R,jx as z,kx as B,lx as V,mx as H,nx as U,ox as ae,px as W,qA as G,qx as K,rx as q,sx as J,tS as oe,tx as se,un as ce,ux as le,vx as ue,wx as de,xx as fe,yx as pe,zx as me}from"./dist-0orl0RkM.js";import{t as he}from"./button-CckfHMbj.js";import{A as ge,F as _e}from"./index-CFTFwlx0.js";import{t as Y}from"./DataTableShell-u1nLRhQM.js";var X=t(e(),1),Z=n(),ve={altered_words:()=>oe(),incorrect:()=>N(),incoherence:()=>r(),formatting:()=>v(),latency:()=>E(),api_error:()=>w(),other:()=>T()},Q=e=>ve[e]?.()??e;function $({matches:e,sourceWasOpen:t}){return t?e===!0?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:K()}):e===!1?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:m()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:f()})}function ye({data:e,closeReason:t}){let n=e.snapshot,r=p(c.feedback.respondToFeedback),[o,f]=(0,X.useState)(e.thread),[m,v]=(0,X.useState)(``),[y,w]=(0,X.useState)(!1);async function T(){let t=m.trim();if(!(!t||y)){w(!0);try{await r({feedbackId:e._id,text:t}),f(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),v(``)}finally{w(!1)}}}let E=[];try{E=n.contextJson?JSON.parse(n.contextJson):[]}catch{E=[]}return(0,Z.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Z.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,Z.jsx)($,{matches:n.displayedMatchesStored,sourceWasOpen:n.clientInfo?.sourceWasOpen??!1}),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Q(e.category),` · `,n.messageRole,n.isRegeneration?` · ${d()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:C()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,t?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ae()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:t})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:x()}),o.length>0?(0,Z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:o.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Z.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?ee():e.authorRole===`agent`?e.authorLabel??ce():S()}),(0,Z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:a()}),(0,Z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:me(),value:m,maxLength:2e3,rows:3,onChange:e=>v(e.target.value.slice(0,2e3))}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Z.jsx)(he,{size:`sm`,onClick:()=>void T(),disabled:!m.trim()||y,children:y?ie():h()})})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:te()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||u()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:re()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||u()})]}):null,n.promptText?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:_()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,E.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:g({count:n.contextCount??E.length,truncated:n.contextTruncated?z():``})}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:E.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,n.outboxAvailable?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:i()}),(0,Z.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,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:B()}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,children:n.clientInfo.extensionsDetected.map(e=>(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ne()}),(0,Z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?s({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,Z.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[l(),` `,n.clientInfo.plugins.join(`, `),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,b()]})]}):null,n.clientInfo?.userAgent?(0,Z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function be(){let e=G(c.feedback.listForAdmin,{}),t=p(c.feedback.readSnapshot),n=p(c.feedback.deleteFeedback),r=_e(),[i,a]=(0,X.useState)(null),[s,l]=(0,X.useState)({});async function u(e){if(i===e._id){a(null);return}if(!s[e._id]){let n=await t({feedbackId:e._id});l(t=>({...t,[e._id]:n}))}a(e._id)}async function d(e){await r({title:U(),description:se(),confirmLabel:P(),destructive:!0})&&(await n({feedbackId:e._id}),i===e._id&&a(null))}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[de(),` `,(0,Z.jsx)(`strong`,{children:o()}),` `,y()]}),(0,Z.jsx)(Y,{title:fe(),rows:e,emptyHint:k(),isExpanded:e=>i===e._id&&!!s[e._id],renderExpanded:e=>s[e._id]?(0,Z.jsx)(ye,{data:s[e._id],closeReason:e.userCloseReason}):null,columns:[{header:pe(),cell:e=>ge(e.at),sort:e=>e.at},{header:ue(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:D(),cell:e=>e.messageRole===`user`?I():L(),sort:e=>e.messageRole},{header:H(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${W({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:F(),cell:e=>(0,Z.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:M(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:le(),cell:e=>e.userClosedAt==null?e.resolvedAt==null?e.answered?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:V()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:j()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,title:e.resolvedBy??void 0,children:A()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:J()}),sort:e=>e.userClosedAt==null?e.resolvedAt==null?+!!e.answered:2:3}],rowActions:e=>[{label:i===e._id?O():R(),onSelect:()=>void u(e)},{label:q(),onSelect:()=>void d(e),variant:`destructive`}]})]})}export{be as FeedbacksTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$k as ee,BA as te,Bk as ne,E as r,ET as re,Gk as i,Hk as ie,Jk as ae,KA as oe,Kk as a,Lk as o,Qk as s,RA as c,Rk as l,Uk as u,Vk as d,Wk as se,Xk as ce,Yk as le,Zk as ue,_A as de,aA as f,cA as fe,dA as pe,eA as me,fA as he,gA as ge,hA as p,iA as m,lA as _e,mA as h,mn as g,nA as _,oA as v,pA as ve,pn as ye,qA as be,qk as y,rA as b,sA as x,tA as S,uA as C,vA as w,zk as T}from"./dist-0orl0RkM.js";import{t as E}from"./button-CckfHMbj.js";import{$ as D,At as O,B as k,C as A,Ct as j,H as M,J as N,L as xe,P as Se,R as Ce,S as P,U as we,V as Te,W as Ee,X as F,Y as De,b as I,et as L,kt as Oe,p as ke,w as R,x as z,yt as Ae,z as je}from"./index-CFTFwlx0.js";import{a as Me,i as B,n as Ne,o as V,r as H,t as Pe}from"./table-CnKDuavw.js";var U=t(e(),1),W=n(),G=`all`;function K(e){switch(e){case`image`:return x();case`audio`:return v();case`video`:return f();case`pdf`:return m();case`document`:return b();case`archive`:return _();default:return S()}}function q(){let[e,t]=(0,U.useState)(G),[n,f]=(0,U.useState)(G),[m,_]=(0,U.useState)(G),[v,b]=(0,U.useState)(G),[x,S]=(0,U.useState)(!1),[q,J]=(0,U.useState)(null),Fe=oe(r.files.softDelete),Y=Se();function Ie(){t(G),f(G),_(G),b(G)}async function Le(){let e=q;if(J(null),e)try{await Fe({fileId:e.id}),Y.success(se())}catch(e){Y.error(u(),e)}}let X=be(r.files.listMine,{direction:e===G?void 0:e,chatId:n===G?void 0:n,instanceName:m===G?void 0:m,category:v===G?void 0:v,includeAutoGenerated:x||void 0}),Re=(0,U.useMemo)(()=>new Intl.DateTimeFormat(te(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:c()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==G||n!==G||m!==G||v!==G;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:w()}),(0,W.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,W.jsxs)(I,{value:e,onValueChange:t,children:[(0,W.jsx)(A,{size:`sm`,"aria-label":de(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:ge()}),(0,W.jsx)(P,{value:`inbound`,children:p()}),(0,W.jsx)(P,{value:`outbound`,children:h()})]})]}),(0,W.jsxs)(I,{value:n,onValueChange:f,children:[(0,W.jsx)(A,{size:`sm`,"aria-label":ve(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:he()}),Q.chats.map(e=>(0,W.jsx)(P,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,W.jsxs)(I,{value:m,onValueChange:_,children:[(0,W.jsx)(A,{size:`sm`,"aria-label":pe(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:C()}),Q.instances.map(e=>(0,W.jsx)(P,{value:e,children:e},e))]})]}):null,(0,W.jsxs)(I,{value:v,onValueChange:b,children:[(0,W.jsx)(A,{size:`sm`,"aria-label":_e(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:fe()}),Q.categories.map(e=>(0,W.jsx)(P,{value:e,children:K(e)},e))]})]}),(0,W.jsxs)(`label`,{className:`oc-files__autogen`,children:[(0,W.jsx)(ke,{checked:x,onCheckedChange:e=>S(e===!0),"aria-label":g()}),(0,W.jsx)(`span`,{children:g()})]}),$?(0,W.jsxs)(E,{variant:`ghost`,size:`sm`,onClick:Ie,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,W.jsx)(j,{size:14,"aria-hidden":!0}),y()]}):null]}),Z.length===0?(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:$?l():T()}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Pe,{children:[(0,W.jsx)(Me,{children:(0,W.jsxs)(V,{children:[(0,W.jsx)(B,{children:me()}),(0,W.jsx)(B,{children:ee()}),(0,W.jsx)(B,{children:s()}),(0,W.jsx)(B,{children:ue()}),(0,W.jsx)(B,{children:ce()}),(0,W.jsx)(B,{className:`text-right`,children:le()})]})}),(0,W.jsx)(Ne,{children:Z.map(e=>(0,W.jsxs)(V,{children:[(0,W.jsxs)(H,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:[e.filename,e.origin===`pasted`?(0,W.jsx)(L,{variant:`outline`,style:{marginLeft:6},children:ye()}):null]}),(0,W.jsx)(H,{title:e.mimeType,children:K(e.category)}),(0,W.jsx)(H,{children:(0,W.jsx)(L,{variant:`secondary`,children:e.direction===`inbound`?p():h()})}),(0,W.jsx)(H,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,W.jsx)(H,{className:`whitespace-nowrap text-muted-foreground`,children:Re.format(e.createdAt)}),(0,W.jsx)(H,{className:`text-right`,children:(0,W.jsxs)(N,{children:[(0,W.jsx)(D,{asChild:!0,children:(0,W.jsx)(E,{variant:`ghost`,size:`icon`,"aria-label":a(),children:(0,W.jsx)(Oe,{size:16})})}),(0,W.jsxs)(De,{align:`end`,children:[e.url?(0,W.jsx)(F,{asChild:!0,children:(0,W.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,W.jsx)(O,{size:14}),ae()]})}):(0,W.jsxs)(F,{disabled:!0,children:[(0,W.jsx)(O,{size:14}),ne()]}),(0,W.jsxs)(F,{variant:`destructive`,onSelect:()=>J({id:e._id,filename:e.filename}),children:[(0,W.jsx)(Ae,{size:14}),i()]})]})]})})]},e._id))})]}),ze?(0,W.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:o({cap:Be})}):null]}),(0,W.jsx)(xe,{open:q!==null,onOpenChange:e=>!e&&J(null),children:(0,W.jsxs)(k,{children:[(0,W.jsxs)(we,{children:[(0,W.jsx)(Ee,{children:ie()}),(0,W.jsx)(Te,{children:d()})]}),(0,W.jsxs)(M,{children:[(0,W.jsx)(je,{children:re()}),(0,W.jsx)(Ce,{onClick:()=>void Le(),children:i()})]})]})})]})}export{q as FilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$c as r,Ac as i,Bc as a,Cc as o,D as s,Dc as c,E as l,Ec as u,Fc as d,Gc as f,Hc as p,Ic as m,Jc as h,KA as g,Kc as _,Lc as v,Mc as y,Nc as b,Oc as x,Pc as S,Qc as C,Rc as w,Sc as T,Tc as ee,Uc as te,Vc as ne,Wc as re,Xc as E,Yc as D,Zc as O,_c as k,ac as A,al as ie,bc as ae,cc as j,cl as M,dc as N,dl as oe,el as se,fc as P,gc as ce,hc as F,ic as le,il as ue,jc as de,kc as fe,lc as pe,ll as me,mc as he,nc as ge,nl as _e,oc as I,ol as ve,pc as ye,qA as L,qc as be,rc as xe,rl as Se,sc as Ce,sl as we,tl as Te,uc as R,ul as Ee,vc as De,wc as Oe,xc as ke,yc as z,zc as Ae}from"./dist-0orl0RkM.js";import{t as je}from"./x-DBdlW6Pd.js";import{i as B,n as V,r as Me,t as Ne}from"./tabs-DqVkAM7O.js";import{t as H}from"./button-CckfHMbj.js";import{C as Pe,F as Fe,P as U,Pt as Ie,S as Le,b as Re,bt as W,et as G,it as ze,nt as Be,ot as Ve,p as K,rt as He,st as Ue,tt as q,u as We,ut as Ge,w as Ke,x as qe,xt as J}from"./index-CFTFwlx0.js";import{t as Je}from"./FilterBar-DRUEEKsU.js";import{t as Ye}from"./DataTableShell-u1nLRhQM.js";import{t as Y}from"./DetailChips-jl8VAars.js";var Xe=s(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ze=s(`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`}]]),X=s(`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`}]]),Qe=s(`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`}]]),Z=t(e(),1);function $e(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 et(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 tt(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 nt(e){switch(e){case`admin`:return y();case`user`:return de();case`pending`:return i();default:return e}}function rt(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 it(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 Q=n(),$={name:``,description:``};function at(){let e=L(l.groups.listGroups,{}),t=L(l.me.getMe,{host:Ge})?.role===`admin`,n=g(l.groups.createGroup),i=g(l.groups.updateGroup),a=g(l.groups.deleteGroup),o=Fe(),s=U(),[c,u]=(0,Z.useState)(!1),[d,p]=(0,Z.useState)(null),[m,v]=(0,Z.useState)($),[y,b]=(0,Z.useState)(null),[x,S]=(0,Z.useState)(``),w=(0,Z.useMemo)(()=>{if(!e)return e;let t=x.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,x]);function T(){p(null),v($),u(!0)}function ee(e){p(e),v({name:e.name,description:e.description??``}),u(!0)}async function te(){try{d?await i({groupId:d._id,name:m.name,description:m.description}):await n({name:m.name,description:m.description||void 0}),v($),p(null),u(!1)}catch(e){s.error(A(),e)}}async function ne(e){if(await o({title:_({name:e.name}),description:f(),confirmWord:e.name,confirmLabel:re(),cancelLabel:C(),destructive:!0}))try{await a({groupId:e._id})}catch(e){s.error(le(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ee()}),(0,Q.jsx)(Je,{q:x,onQChange:S,onReset:()=>S(``),canReset:x!==``,searchPlaceholder:Se()}),(0,Q.jsx)(Ye,{title:oe(),rows:w,addLabel:me(),onAdd:t?T:void 0,emptyHint:M(),columns:[{header:we(),cell:e=>e.name,sort:e=>e.name},{header:ve(),cell:e=>(0,Q.jsx)(Y,{icon:(0,Q.jsx)(Qe,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,Q.jsx)(X,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:ie(),cell:e=>(0,Q.jsx)(Y,{icon:(0,Q.jsx)(J,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:ue(),cell:e=>(0,Q.jsx)(Y,{icon:(0,Q.jsx)(Ze,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,Q.jsx)(W,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:_e(),onSelect:()=>b({groupId:e._id,name:e.name})},...t?[{label:Te(),onSelect:()=>ee(e)},{label:se(),variant:`destructive`,onSelect:()=>void ne(e)}]:[]]}),(0,Q.jsx)(We,{open:c,onOpenChange:u,title:d?E():O(),description:D(),canSubmit:!!m.name.trim(),onSubmit:te,submitLabel:r(),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:h()}),(0,Q.jsx)(q,{value:m.name,onChange:e=>v({...m,name:e.target.value})})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(`span`,{className:`oc-field__label`,children:be()}),(0,Q.jsx)(q,{value:m.description,onChange:e=>v({...m,description:e.target.value})})]})]})}),(0,Q.jsx)(ct,{groupId:y?.groupId??null,groupName:y?.name??``,open:y!==null,onOpenChange:e=>{e||b(null)}})]})}var ot=8;function st({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,Q.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,Q.jsxs)(H,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,Q.jsx)(Xe,{size:14,"aria-hidden":!0}),d()]}),(0,Q.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":b({page:e,pages:t}),children:[e,` / `,t]}),(0,Q.jsxs)(H,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[S(),(0,Q.jsx)(Ie,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=L(l.groups.getGroup,n&&e?{groupId:e}:`skip`),o=L(l.groups.listAssignableInstances,n?{}:`skip`),s=L(l.groups.listAssignableUsers,n?{}:`skip`),u=g(l.groups.addMember),d=g(l.groups.removeMember),f=g(l.groups.bulkSetMembers),h=g(l.groups.setGroupManager),_=U(),[y,b]=(0,Z.useState)(``),[x,S]=(0,Z.useState)(``),[C,T]=(0,Z.useState)(`members`),[re,E]=(0,Z.useState)(1),[D,O]=(0,Z.useState)(new Set),k=(0,Z.useRef)(null),A=(0,Z.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),ie=(0,Z.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),ae=i?.viewerIsAdmin===!0,M=(0,Z.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,Z.useEffect)(()=>{b(``),S(``),T(`members`),E(1),k.current=null},[n,e]),(0,Z.useEffect)(()=>{E(1)},[y]),(0,Z.useEffect)(()=>{n&&i&&e&&k.current!==e&&(k.current=e,O(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let N=(0,Z.useMemo)(()=>s?$e(s,y,D):[],[s,y,D]);async function oe(t,n){if(e)try{n?await d({groupId:e,userId:t}):await u({groupId:e,userId:t})}catch(e){_.error(xe(),e)}}async function se(t,n){if(e)try{await h({groupId:e,userId:t,manager:!n})}catch(e){_.error(Ce(),e)}}let P=rt(N,e=>A.has(e.userId)),ce=N.filter(e=>A.has(e.userId)).length,F=it(N,re,ot);async function le(){if(!e||N.length===0)return;let t=N.map(e=>e.userId);try{await f({groupId:e,userIds:t,member:P!==`all`})}catch(e){_.error(xe(),e)}}return(0,Q.jsx)(Be,{open:n,onOpenChange:r,children:(0,Q.jsxs)(He,{className:`oc-access`,children:[(0,Q.jsxs)(Ve,{children:[(0,Q.jsx)(Ue,{children:te({name:t})}),(0,Q.jsx)(ze,{children:p()})]}),(0,Q.jsxs)(Ne,{value:C,onValueChange:T,className:`oc-access__tabs`,children:[(0,Q.jsxs)(Me,{className:`w-full`,children:[(0,Q.jsxs)(B,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Qe,{size:13,"aria-hidden":!0}),ne(),i?(0,Q.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:A.size}):null]}),(0,Q.jsxs)(B,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(J,{size:13,"aria-hidden":!0}),Ae(),i?(0,Q.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:M.size}):null]}),(0,Q.jsxs)(B,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Ze,{size:13,"aria-hidden":!0}),De(),i?(0,Q.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,Q.jsx)(V,{value:`members`,children:s===void 0||i===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:c()}):s.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:ee()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(q,{value:y,onChange:e=>b(e.target.value),placeholder:a(),className:`oc-access__search`}),N.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:v()}):(0,Q.jsxs)(Q.Fragment,{children:[N.length>1?(0,Q.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Q.jsx)(K,{checked:P===`all`?!0:P===`some`?`indeterminate`:!1,onCheckedChange:()=>void le(),"aria-label":m()}),(0,Q.jsx)(`span`,{className:`oc-access__label`,children:m()}),(0,Q.jsxs)(G,{variant:`outline`,className:`oc-access__count`,children:[ce,` / `,N.length]})]}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:F.pageItems.map(e=>{let t=A.has(e.userId),n=tt(e),r=ie.has(e.userId);return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(K,{checked:t,onCheckedChange:()=>void oe(e.userId,t),"aria-label":fe({user:n.primary})}),(0,Q.jsxs)(`span`,{className:`oc-access__who`,children:[(0,Q.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,Q.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,Q.jsx)(G,{variant:`outline`,className:`oc-access__role`,children:nt(e.role)}),(0,Q.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&ae?(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?j():pe(),title:r?j():pe(),onClick:()=>void se(e.userId,r),children:(0,Q.jsx)(X,{size:15,"aria-hidden":!0})}):t&&r?(0,Q.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":R(),title:R(),children:(0,Q.jsx)(X,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,Q.jsx)(st,{page:F.page,pageCount:F.pageCount,onPage:E})]})]})}),(0,Q.jsx)(V,{value:`agents`,children:o===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:c()}):o.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:Oe()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(q,{value:x,onChange:e=>S(e.target.value),placeholder:w(),className:`oc-access__search`}),(0,Q.jsx)(`div`,{className:`oc-access__list`,children:o.map(t=>(0,Q.jsx)(lt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:M,query:x},`${e}-${t._id}`))})]})}),(0,Q.jsx)(V,{value:`charts`,children:(0,Q.jsx)(ut,{groupId:e})})]})]})})}function lt({groupId:e,instanceName:t,kind:n,assigned:r,query:i}){let a=L(l.groups.listAssignableAgents,{instanceName:t}),s=g(l.groups.assignAgentToGroup),c=g(l.groups.removeAgentFromGroup),d=g(l.groups.bulkSetGroupAgents),f=U(),[p,h]=(0,Z.useState)(1);if((0,Z.useEffect)(()=>{h(1)},[i]),!e)return null;let _=et(a?.agents??[],i),v=a?.discovery&&!a.discovery.lastPollOk;if(i.trim()&&_.length===0)return null;let y=_.filter(e=>e.presentInLastOk!==!1),b=rt(y,e=>r.has(`${t}/${e.agentId}`)),S=it(_,p,ot);async function C(n,r){try{r?await c({groupId:e,instanceName:t,agentId:n}):await s({groupId:e,instanceName:t,agentId:n})}catch(e){f.error(ge(),e)}}async function w(){if(y.length===0)return;let n=y.map(e=>e.agentId);try{await d({groupId:e,instanceName:t,agentIds:n,assigned:b!==`all`})}catch(e){f.error(ge(),e)}}return(0,Q.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Q.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Q.jsx)(J,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(G,{variant:`outline`,className:`oc-access__kind`,children:n}),v?(0,Q.jsx)(G,{variant:`outline`,className:`oc-access__stale`,children:ke()}):null]}),a===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:u()}):_.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:v?T():o()}):(0,Q.jsxs)(Q.Fragment,{children:[y.length>1?(0,Q.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Q.jsx)(K,{checked:b===`all`?!0:b===`some`?`indeterminate`:!1,onCheckedChange:()=>void w(),"aria-label":m()}),(0,Q.jsx)(`span`,{className:`oc-access__label`,children:m()})]}):null,S.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1;return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(K,{checked:i,disabled:a&&!i,onCheckedChange:()=>void C(e.agentId,i),"aria-label":x({name:e.displayName??e.agentId})}),(0,Q.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Q.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":z(),title:z(),children:(0,Q.jsx)(W,{size:14,fill:`currentColor`})}):null,a?(0,Q.jsx)(G,{variant:`outline`,className:`oc-access__gone`,children:ae()}):null]},e.agentId)}),(0,Q.jsx)(st,{page:S.page,pageCount:S.pageCount,onPage:h})]})]})}function ut({groupId:e}){let t=L(l.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=g(l.charts.assignChartToGroup),r=g(l.charts.removeChartFromGroup),i=g(l.charts.setGroupDefaultChart),a=g(l.charts.addChartToGroupPool),o=g(l.charts.removeChartFromGroupPool),s=U();if(!e)return null;if(t===void 0)return(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:c()});let{pool:u,addable:d,canManagePool:f}=t;if(u.length===0&&!f)return(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:k()});async function p(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){s.error(I(),e)}}async function m(t){try{await i({groupId:e,chartKey:t})}catch(e){s.error(I(),e)}}async function h(t){try{await a({groupId:e,chartKey:t})}catch(e){s.error(I(),e)}}async function _(t){try{await o({groupId:e,chartKey:t})}catch(e){s.error(I(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-access__list`,children:u.map(e=>(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(K,{checked:e.selected,onCheckedChange:()=>void p(e.chartKey,e.selected),"aria-label":ye({name:e.name})}),(0,Q.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":P(),title:P(),children:(0,Q.jsx)(W,{size:14,fill:`currentColor`})}):(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void m(e.chartKey),children:N()}):null,f?(0,Q.jsx)(H,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":he({name:e.name}),title:he({name:e.name}),onClick:()=>void _(e.chartKey),children:(0,Q.jsx)(je,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),f?d.length>0?(0,Q.jsxs)(Re,{value:``,onValueChange:e=>void h(e),children:[(0,Q.jsx)(Pe,{size:`sm`,className:`oc-access__search`,children:(0,Q.jsx)(Ke,{placeholder:F()})}),(0,Q.jsx)(qe,{children:d.map(e=>(0,Q.jsx)(Le,{value:e.chartKey,children:e.name},e.chartKey))})]}):u.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:ce()}):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{$v as r,$y as i,A as a,Ay as o,Bv as s,By as c,Cb as l,Cy as u,Dy as d,E as f,Eb as p,Ey as m,Fm as h,Fy as g,Gv as _,Gy as v,Hv as y,Hy as b,Im as x,Iy as S,Jv as C,Jy as w,KA as T,Kv as ee,Ky as te,Ly as ne,My as E,Ny as re,Oy as D,Py as ie,Qv as O,Qy as k,Ry as ae,Sb as A,Sy as oe,Tb as se,Ty as ce,Uv as le,Uy as ue,Vv as de,Vy as fe,WA as j,Wv as pe,Wy as me,Xv as he,Xy as ge,Yv as _e,Yy as ve,Zv as ye,Zy as be,_b as xe,_y as Se,ab as Ce,ay as we,bb as Te,by as Ee,cb as De,cy as Oe,db as ke,dr as Ae,dy as je,eb as Me,ey as Ne,fb as Pe,fr as Fe,fy as Ie,gb as Le,gy as Re,hb as ze,hy as Be,ib as Ve,iy as He,j as Ue,jy as We,k as Ge,ky as Ke,lb as qe,ly as Je,mb as Ye,my as Xe,nb as Ze,ny as Qe,ob as $e,oy as et,pb as tt,pr as nt,py as rt,qA as M,qv as it,qy as at,rb as ot,ry as st,sb as ct,sy as N,tb as lt,ty as ut,ub as dt,ur as ft,uy as P,vE as F,vb as pt,vy as mt,wb as ht,wy as gt,xb as _t,xy as vt,yE as I,yb as yt,yy as bt,zy as xt}from"./dist-0orl0RkM.js";import{a as St,c as Ct}from"./FieldLabel-B8G-MYNo.js";import{t as L}from"./button-CckfHMbj.js";import{C as R,F as wt,G as Tt,K as Et,P as z,S as B,b as V,et as H,it as U,nt as W,ot as G,p as Dt,q as Ot,rt as kt,st as At,tt as K,u as jt,w as q,x as J}from"./index-CFTFwlx0.js";import{t as Mt}from"./DataTableShell-u1nLRhQM.js";import{InstanceConfigDialog as Nt}from"./BridgeTab-BRhL8-C3.js";var Y=t(e(),1),X=[`conversational`,`documentary`,`summarizer`,`curator`],Pt=new Set(X),Ft=`conversational`;function It(e){let t=new Set((e??[]).filter(e=>Pt.has(e)));return t.size===0?[Ft]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,transport:`ws`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:St},Lt={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Rt(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,transport:e.transport??`ws`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``,streamTransport:e.streamTransport??`reactive`}}function zt(){let e=M(f.admin.listInstances,{}),t=M(f.agents.listAllInstanceAgents,{}),n=T(f.admin.upsertInstance),r=T(f.admin.deleteInstance),o=z(),[s,c]=(0,Y.useState)(!1),[u,d]=(0,Y.useState)(Q),[m,g]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(null),[S,C]=(0,Y.useState)(null);async function w(){try{await n({instanceId:S??void 0,name:u.name,gatewayUrl:u.gatewayUrl,bridgeUrl:u.bridgeUrl||void 0,displayName:u.displayName||void 0,kind:u.kind,transport:u.kind===`hermes`?u.transport:void 0,gatewayVersion:u.gatewayVersion||void 0,gatewayHttpUrl:u.gatewayHttpUrl||void 0,streamTransport:u.streamTransport}),d(Q),C(null),c(!1)}catch(e){o.error(ht(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[l(),(0,Z.jsx)(`strong`,{children:A()}),_t()]}),(0,Z.jsx)(Mt,{title:Te(),rows:e,addLabel:yt(),onAdd:()=>{C(null),d(Q),c(!0)},emptyHint:pt(),columns:[{header:xe(),cell:e=>e.name,sort:e=>e.name},{header:Le(),cell:e=>(0,Z.jsx)(H,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:ze(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:Ye(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:p(),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)(H,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?de():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:dt(),onSelect:()=>{C(e._id),d(Rt(e)),c(!0)}},{label:se(),onSelect:()=>g(e.name)},{label:ve(),onSelect:()=>b(e)},{label:tt(),onSelect:()=>v(e)},{label:Pe(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:Pe(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(jt,{open:s,onOpenChange:c,title:S?qe():ke(),description:ct(),canSubmit:!!(u.name&&u.gatewayUrl),onSubmit:w,submitLabel:$e(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:Ce(),children:[(0,Z.jsx)(K,{value:u.name,disabled:S!==null,onChange:e=>d({...u,name:e.target.value})}),S?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:De()}):null]}),(0,Z.jsx)($,{label:Ve(),children:(0,Z.jsxs)(V,{value:u.kind,onValueChange:e=>d({...u,kind:e}),children:[(0,Z.jsx)(R,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(q,{})}),(0,Z.jsxs)(J,{children:[(0,Z.jsx)(B,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(B,{value:`hermes`,children:`Hermes`})]})]})}),u.kind===`hermes`?(0,Z.jsx)($,{label:Ue(),children:(0,Z.jsxs)(V,{value:u.transport,onValueChange:e=>d({...u,transport:e}),children:[(0,Z.jsx)(R,{size:`sm`,className:`w-56`,children:(0,Z.jsx)(q,{})}),(0,Z.jsxs)(J,{children:[(0,Z.jsx)(B,{value:`ws`,children:a()}),(0,Z.jsx)(B,{value:`rest`,children:Ge()})]})]})}):null,(0,Z.jsx)($,{label:ot(),children:(0,Z.jsx)(K,{value:u.gatewayUrl,onChange:e=>d({...u,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:Ze(),children:(0,Z.jsx)(K,{value:u.bridgeUrl,placeholder:lt(),onChange:e=>d({...u,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:Me(),children:(0,Z.jsx)(K,{value:u.displayName,onChange:e=>d({...u,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:x(),children:[(0,Z.jsxs)(V,{value:u.streamTransport,onValueChange:e=>d({...u,streamTransport:e}),children:[(0,Z.jsx)(R,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(q,{})}),(0,Z.jsx)(J,{children:Ct.map(e=>(0,Z.jsx)(B,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:h()})]}),(0,Z.jsx)($,{label:i(),children:(0,Z.jsx)(K,{value:u.gatewayVersion,placeholder:k(),onChange:e=>d({...u,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:be(),children:(0,Z.jsx)(K,{value:u.gatewayHttpUrl,placeholder:ge(),onChange:e=>d({...u,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Yt,{instanceName:m,open:m!==null,onOpenChange:e=>{e||g(null)}}),_?(0,Z.jsx)(Nt,{instance:_,onClose:()=>v(null)},_._id):null,y?(0,Z.jsx)(Bt,{instance:y,onClose:()=>b(null)},y._id):null]})}function Bt({instance:e,onClose:t}){let n=M(f.instanceSecrets.listInstanceSecretStatus,{}),r=Lt[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)(W,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(kt,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(G,{children:[(0,Z.jsx)(At,{children:w({instance:e.displayName??e.name})}),(0,Z.jsx)(U,{children:at()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(Ut,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Ht,{instance:e})}),(0,Z.jsx)(Vt,{instance:e})]})})}function Vt({instance:e}){let t=j(f.instanceSync.forceInstanceSync),n=z(),[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(d());break;case`no_agents`:n.success(ce());break;case`no_bridge_url`:n.error(gt());break;case`deploy_misconfigured`:n.error(u());break;case`unauthorized`:n.error(vt());break;case`not_served`:n.error(Ee());break;default:n.error(oe());break}}catch(e){n.error(m(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:bt()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(L,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?D():Ke()})})]})}function Ht({instance:e}){let t=M(f.bridgeAuth.listBridgeAuthStatus,{}),n=j(f.bridgeAuth.mintBridgeSecret),r=T(f.bridgeAuth.revokeBridgeSecret),i=z(),[a,o]=(0,Y.useState)(!1),[s,c]=(0,Y.useState)(null),[l,u]=(0,Y.useState)(!1),d=(t??[]).find(t=>t.instanceId===e._id),p=d!==void 0;async function m(){if(!a){o(!0);try{c((await n({instanceId:e._id})).plaintext),u(!1)}catch(e){i.error(Ie(),e)}finally{o(!1)}}}async function h(){if(!a){o(!0);try{await r({instanceId:e._id}),c(null),i.success(rt())}catch(e){i.error(Ie(),e)}finally{o(!1)}}}async function g(){if(s)try{await navigator.clipboard.writeText(s),u(!0)}catch{}}return(0,Z.jsxs)($,{label:mt(),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)(H,{variant:p?`outline`:`secondary`,children:p?`${ue()} · ${d.prefix}…${d.lastFour}`:b()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(L,{size:`sm`,onClick:()=>void m(),disabled:a,children:p?Be():Re()}),p?(0,Z.jsx)(L,{size:`sm`,variant:`destructive`,onClick:()=>void h(),disabled:a,children:Xe()}):null]})]}),s?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:je()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,Z.jsx)(L,{variant:`outline`,size:`sm`,onClick:()=>void g(),children:l?I():F()})]}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,onClick:()=>{c(null),u(!1)},children:P()})]}):null]})}function Ut({instanceId:e,field:t,updatedAt:n}){let r=j(f.instanceSecrets.setInstanceSecret),i=T(f.instanceSecrets.clearInstanceSecret),a=j(f.deviceIdentity.generateDeviceIdentity),s=z(),[l,u]=(0,Y.useState)(``),[d,p]=(0,Y.useState)(!1),[m,h]=(0,Y.useState)(null),[_,y]=(0,Y.useState)(!1),x=n!==null,C=t===`deviceIdentity`,w=t===`token`?te():t===`deviceIdentity`?v():me();async function ee(){if(!(!l.trim()||d)){p(!0);try{await r({instanceId:e,field:t,plaintext:l}),u(``),h(null),y(!1),s.success(ne())}catch(e){s.error(S(),e)}finally{p(!1)}}}async function D(){if(!d){p(!0);try{await i({instanceId:e,field:t}),h(null),y(!1),s.success(g())}catch(e){s.error(S(),e)}finally{p(!1)}}}async function O(){if(!d){p(!0);try{h(await a({instanceId:e})),y(!1),s.success(E())}catch(e){s.error(o(),e)}finally{p(!1)}}}let k=m?`openclaw devices approve ${m.id}`:``;async function A(){if(k)try{await navigator.clipboard.writeText(k),y(!0)}catch{}}return(0,Z.jsxs)($,{label:w,children:[C?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:re()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(H,{variant:x?`outline`:`secondary`,children:x?ue():b()}),(0,Z.jsx)(K,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:l,placeholder:x?c():fe(),onChange:e=>u(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(L,{size:`sm`,onClick:()=>void ee(),disabled:d||l.trim().length===0,children:xt()}),C?(0,Z.jsx)(L,{size:`sm`,variant:`outline`,onClick:()=>void O(),disabled:d,children:ie()}):null,x?(0,Z.jsx)(L,{size:`sm`,variant:`destructive`,onClick:()=>void D(),disabled:d,children:ae()}):null]})]}),m?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:E()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:We()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:k}),(0,Z.jsx)(L,{variant:`outline`,size:`sm`,onClick:()=>void A(),children:_?I():F()})]}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,onClick:()=>{h(null),y(!1)},children:P()})]}):null]})}var Wt={conversational:Qe,documentary:Ne,summarizer:nt,curator:Ae},Gt={conversational:ut,documentary:r,summarizer:Fe,curator:ft},Kt=e=>(Wt[e]??(()=>e))(),qt=e=>(Gt[e]??(()=>``))();function Jt({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:et()}),t.map(e=>(0,Z.jsx)(H,{variant:`secondary`,className:`oc-agenttype__chip`,title:qt(e),children:Kt(e)},e)),(0,Z.jsxs)(Tt,{children:[(0,Z.jsx)(Ot,{asChild:!0,children:(0,Z.jsx)(L,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:we()})}),(0,Z.jsxs)(Et,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:He()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:st()}),(0,Z.jsx)(`div`,{className:`oc-agenttypes-pop__list`,children:X.map(r=>{let i=`agtype-${e}-${r}`;return(0,Z.jsxs)(`div`,{className:`oc-agenttypes-pop__item`,children:[(0,Z.jsx)(Dt,{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:Kt(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:qt(r)})]})]},r)})})]})]})]})}function Yt({instanceName:e,open:t,onOpenChange:n}){let r=M(f.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=T(f.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(f.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(f.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),a=T(f.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(f.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(f.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),o=T(f.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(f.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=It(r);e.setQuery(f.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),c=T(f.agents.removeInstanceAgent),l=wt(),u=z();async function d(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){u.error(N(),e)}}async function p(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){u.error(N(),e)}}async function m(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){u.error(N(),e)}}async function h(t,n){if(e&&await l({title:he({name:n}),description:_e(),confirmLabel:C(),destructive:!0}))try{await c({instanceName:e,agentId:t}),u.success(it())}catch(e){u.error(N(),e)}}return(0,Z.jsx)(W,{open:t,onOpenChange:n,children:(0,Z.jsxs)(kt,{className:`oc-access`,children:[(0,Z.jsxs)(G,{children:[(0,Z.jsx)(At,{children:Je({name:e??``})}),(0,Z.jsx)(U,{children:Oe()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:ee()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?_():r.discovery.lastPollOk?pe():le({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:y()}):(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)(Dt,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void d(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)(H,{variant:`outline`,className:`oc-access__gone`,children:s()}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void h(e.agentId,i),children:ye()})]}):n?(0,Z.jsx)(H,{variant:`default`,children:de()}):(0,Z.jsx)(L,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void p(e.agentId),children:O()})]}),e.enabled?(0,Z.jsx)(Jt,{agentId:e.agentId,types:a,onToggle:t=>void m(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{zt as InstancesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AS as r,Ai as i,BS as a,CS as o,DS as s,Di as c,E as l,ES as u,Ei as d,FS as f,GS as p,HS as m,IS as ee,JS as te,KA as h,KS as g,LS as ne,MS as re,Mi as ie,NS as ae,Ni as _,OS as v,Oi as y,PS as b,Pi as oe,RS as se,SS as ce,TS as le,US as x,VS as S,WA as C,WS as w,_S as T,aS as E,bS as D,cS as O,dS as k,fS as A,gS as j,hS as M,iS as N,jS as P,ji as F,kS as I,ki as L,lS as R,mS as z,nS as B,oS as V,pS as H,qA as U,qS as W,rS as ue,sS as de,uS as fe,vS as pe,wS as me,xS as he,yS as ge,zS as _e}from"./dist-0orl0RkM.js";import{t as G}from"./button-CckfHMbj.js";import{A as ve,C as ye,S as be,b as xe,et as K,p as Se,tt as q,w as Ce,x as we}from"./index-CFTFwlx0.js";import{t as Te}from"./DataTableShell-u1nLRhQM.js";var J=t(e(),1),Y=n();function Ee(){let e=U(l.integrations.status.status,{}),t=h(l.admin.setIntegrationConfig),[n,i]=(0,J.useState)(null);if((0,J.useEffect)(()=>{e&&n===null&&i(e.config)},[e,n]),!e||!n)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:te()});let c=n,d=(e,t,n)=>i({...c,[e]:{...c[e],[t]:n}}),y=(e,n)=>void t({[e]:n});return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[W(),` `,(0,Y.jsx)(`strong`,{children:g()}),` `,p()]}),(0,Y.jsxs)(X,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:w()}):(0,Y.jsx)(K,{variant:`outline`,children:x()}):(0,Y.jsx)(K,{variant:`outline`,children:m()}),note:a(),children:[(0,Y.jsx)(Z,{label:se(),children:(0,Y.jsx)(q,{value:c.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>d(`langfuse`,`host`,e.target.value),onBlur:()=>y(`langfuse`,{host:c.langfuse.host??``})})}),(0,Y.jsx)(Q,{label:b(),checked:c.langfuse.enabled??!0,onChange:e=>{d(`langfuse`,`enabled`,e),y(`langfuse`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:w()}):(0,Y.jsx)(K,{variant:`outline`,children:x()}):(0,Y.jsx)(K,{variant:`outline`,children:m()}),note:_e(),children:[(0,Y.jsx)(Z,{label:ne(),children:(0,Y.jsx)(q,{value:c.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>d(`opik`,`baseUrl`,e.target.value),onBlur:()=>y(`opik`,{baseUrl:c.opik.baseUrl??``})})}),(0,Y.jsx)(Z,{label:ee(),children:(0,Y.jsx)(q,{value:c.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||f(),onChange:e=>d(`opik`,`workspace`,e.target.value),onBlur:()=>y(`opik`,{workspace:c.opik.workspace??``})})}),(0,Y.jsx)(Q,{label:b(),checked:c.opik.enabled??!0,onChange:e=>{d(`opik`,`enabled`,e),y(`opik`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:w()}):(0,Y.jsx)(K,{variant:`outline`,children:x()}):(0,Y.jsx)(K,{variant:`outline`,children:oe()}),note:_(),children:[(0,Y.jsx)(Z,{label:ie(),children:(0,Y.jsx)(q,{value:c.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>d(`otlp`,`endpoint`,e.target.value),onBlur:()=>y(`otlp`,{endpoint:c.otlp.endpoint??``})})}),(0,Y.jsx)(De,{headersSet:e.otlp.headersSet}),(0,Y.jsx)(Q,{label:b(),checked:c.otlp.enabled??!0,onChange:e=>{d(`otlp`,`enabled`,e),y(`otlp`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:ae(),status:(0,Y.jsx)(K,{variant:`outline`,children:S()}),note:re(),children:[(0,Y.jsx)(Z,{label:P(),children:(0,Y.jsx)($,{value:c.tts.auto??`off`,options:[[`off`,r()],[`always`,I()],[`inbound`,v()],[`tagged`,s()]],onChange:e=>{d(`tts`,`auto`,e),y(`tts`,{auto:e})}})}),(0,Y.jsx)(Z,{label:u(),children:(0,Y.jsx)($,{value:c.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,le()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{d(`tts`,`provider`,e),y(`tts`,{provider:e})}})}),(0,Y.jsx)(Z,{label:me(),children:(0,Y.jsx)(q,{value:c.tts.model??``,placeholder:`eleven_multilingual_v2`,onChange:e=>d(`tts`,`model`,e.target.value),onBlur:()=>y(`tts`,{model:c.tts.model??``})})}),(0,Y.jsx)(Z,{label:o(),children:(0,Y.jsx)(q,{value:c.tts.voice??``,placeholder:ce(),onChange:e=>d(`tts`,`voice`,e.target.value),onBlur:()=>y(`tts`,{voice:c.tts.voice??``})})})]}),(0,Y.jsxs)(X,{title:he(),status:(0,Y.jsx)(K,{variant:`outline`,children:S()}),note:e.secrets.openai?D():ge(),children:[(0,Y.jsx)(Q,{label:pe(),checked:c.talk.enabled??!1,onChange:e=>{d(`talk`,`enabled`,e),y(`talk`,{enabled:e})}}),(0,Y.jsx)(Z,{label:T(),children:(0,Y.jsx)($,{value:c.talk.realtimeProvider??`openai`,options:[[`openai`,`OpenAI (gpt-realtime)`],[`google`,`Google`]],onChange:e=>{d(`talk`,`realtimeProvider`,e),y(`talk`,{realtimeProvider:e})}})}),(0,Y.jsx)(Z,{label:j(),children:(0,Y.jsx)(q,{value:c.talk.realtimeModel??``,placeholder:`gpt-realtime-2`,onChange:e=>d(`talk`,`realtimeModel`,e.target.value),onBlur:()=>y(`talk`,{realtimeModel:c.talk.realtimeModel??``})})}),(0,Y.jsx)(Z,{label:o(),children:(0,Y.jsx)(q,{value:c.talk.voice??``,placeholder:`cedar / marin`,onChange:e=>d(`talk`,`voice`,e.target.value),onBlur:()=>y(`talk`,{voice:c.talk.voice??``})})}),(0,Y.jsx)(Z,{label:M(),children:(0,Y.jsx)($,{value:c.talk.transport??`webrtc`,options:[[`webrtc`,z()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{d(`talk`,`transport`,e),y(`talk`,{transport:e})}})}),(0,Y.jsx)(Z,{label:H(),children:(0,Y.jsx)(q,{value:c.talk.speechLocale??``,placeholder:`fr-CA`,onChange:e=>d(`talk`,`speechLocale`,e.target.value),onBlur:()=>y(`talk`,{speechLocale:c.talk.speechLocale??``})})}),(0,Y.jsx)(Q,{label:A(),checked:c.talk.interruptOnSpeech??!0,onChange:e=>{d(`talk`,`interruptOnSpeech`,e),y(`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:k()}),(0,Y.jsx)(K,{variant:`outline`,children:fe()})]}),(0,Y.jsxs)(`p`,{className:`oc-uipa__note`,children:[R(),(0,Y.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,Y.jsx)(Te,{title:O(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:de(),columns:[{header:V(),cell:e=>(0,Y.jsx)(K,{variant:`secondary`,children:e.vendor}),sort:e=>e.vendor},{header:E(),cell:e=>e.lastAt>0?ve(e.lastAt):`—`,sort:e=>e.lastAt>0?e.lastAt:null},{header:N(),cell:e=>String(e.failureCount),sort:e=>e.failureCount},{header:ue(),cell:e=>e.lastErrorStatus??`—`,sort:e=>e.lastErrorStatus??null},{header:B(),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)(Se,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,Y.jsx)(`span`,{children:e})]})}function $({value:e,options:t,onChange:n}){return(0,Y.jsxs)(xe,{value:e,onValueChange:n,children:[(0,Y.jsx)(ye,{size:`sm`,className:`w-full`,children:(0,Y.jsx)(Ce,{})}),(0,Y.jsx)(we,{children:t.map(([e,t])=>(0,Y.jsx)(be,{value:e,children:t},e))})]})}function De({headersSet:e}){let t=C(l.integrations.otlpSecret.setOtlpHeaders),n=h(l.integrations.otlpSecret.clearOtlpHeaders),[r,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(null),[u,f]=(0,J.useState)(!1),p=async()=>{f(!0),s(null);try{await t({headersJson:r}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{f(!1)}};return(0,Y.jsxs)(Z,{label:F(),children:[(0,Y.jsx)(q,{value:r,placeholder:e?i():L(),onChange:e=>a(e.target.value)}),(0,Y.jsxs)(`div`,{className:`oc-int__otlp-headers-actions`,children:[(0,Y.jsx)(G,{size:`sm`,disabled:u||r.trim().length===0,onClick:()=>void p(),children:y()}),e?(0,Y.jsx)(G,{variant:`ghost`,size:`sm`,disabled:u,onClick:()=>void n({}),children:c()}):null]}),o?(0,Y.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:o}):null,(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:d()})]})}export{Ee as IntegrationsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$f as r,AC as i,CC as a,E as o,Gf as s,Jf as c,Kf as l,MC as u,NC as d,Qf as f,SC as p,Uf as m,Wf as h,Xf as g,Yf as _,Zf as v,ep as y,iw as b,jC as x,np as S,qA as C,qf as w,tp as T}from"./dist-0orl0RkM.js";import{Ft as ee,It as te,a as ne,n as re,r as E,ut as D}from"./index-CFTFwlx0.js";import{a as O,n as k,o as A,r as j,t as M}from"./card-DypYZQqW.js";import{n as N,t as P}from"./TimeRangePicker-D48D83Oh.js";var F=t(e(),1),I=n(),L=15,R=e=>String(Math.round(e));function z(){let e=C(o.me.getMe,{host:D})?.permissions?.includes(`traces.read`)??!1,t=C(o.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:b()}),(0,I.jsxs)(M,{children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{children:d()}),(0,I.jsx)(j,{children:x()})]}),(0,I.jsx)(k,{children:n.length<2?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:i()}):(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),o=e=>74-e*68/r,s=e=>e.map((e,t)=>`${t===0?`M`:`L`}${i(t).toFixed(1)},${o(e).toFixed(1)}`).join(` `),c=e[e.length-1];return(0,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:[p(),` p50 `,R(c.cP50),` `,u()]}),(0,I.jsxs)(`span`,{children:[a(),` p50 `,R(c.aP50),` `,u()]})]}),(0,I.jsxs)(`svg`,{viewBox:`0 0 480 80`,className:`h-20 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":d(),children:[(0,I.jsx)(`path`,{d:s(n),fill:`none`,style:{stroke:`var(--muted-foreground)`},strokeWidth:1.5}),(0,I.jsx)(`path`,{d:s(t),fill:`none`,style:{stroke:`var(--primary)`},strokeWidth:1.5})]})]})}var V=[{metric:`api.calls`,label:S(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:T(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:y(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:r(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:f(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:v(),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=ee({from:`/settings/kpi`}),n=E(e.from,e.to,re,`now`),r=e=>void t({search:t=>({...t,...ne(e)})}),{from:i,to:a}=N(n),{rowLimit:s,buckets:l}=K(i,a),u=C(o.kpi.listKpis,{limit:s,filter:{from:i,to:a}}),d=(0,F.useMemo)(()=>{let e=new Map;for(let t of u??[]){let n=e.get(t.metric)??[];n.push({bucket:t.bucket,value:t.value}),e.set(t.metric,n)}for(let[t,n]of e)n.sort((e,t)=>e.bucket<t.bucket?-1:+(e.bucket>t.bucket)),n.length>l&&e.set(t,n.slice(n.length-l));return e},[u,l]),f=(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:_()})]}),(0,I.jsx)(J,{value:n,onChange:r})]});return u===void 0?(0,I.jsxs)(I.Fragment,{children:[f,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:c()})]}):u.length===0?(0,I.jsxs)(I.Fragment,{children:[f,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:w()})]}):(0,I.jsxs)(I.Fragment,{children:[f,(0,I.jsx)(z,{}),U.map(e=>{let t=V.filter(t=>t.group===e);return t.some(e=>(d.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:d.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:l({value:$(n.bucket)})}):(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:s()}),(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:h({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":m({max:Q(r),unit:n}),children:e.map((e,o)=>{let s=r>0?e.value/r*(Z-1):0,c=o*i,l=Z-s;return(0,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{$D as r,AA as i,BD as a,CA as o,DA as s,E as c,EA as l,FD as u,GD as d,HD as f,ID as p,JD as m,KA as h,KD as g,LD as ee,MD as _,NA as te,ND as ne,OA as re,PD as ie,QD as ae,RA as oe,RD as v,SA as se,TA as ce,UD as le,VD as ue,WD as de,XD as fe,YD as y,ZD as b,aO as x,bA as S,cO as C,dO as w,eO as T,fO as E,iO as D,jD as O,kA as k,lO as A,nO as j,oO as M,ob as N,qA as P,qD as F,rO as I,sO as L,tO as R,uO as z,wA as B,xA as V,zD as pe}from"./dist-0orl0RkM.js";import{t as H}from"./button-CckfHMbj.js";import{C as me,M as he,P as ge,S as U,b as _e,p as W,tt as G,ut as K,w as ve,x as ye}from"./index-CFTFwlx0.js";import{t as be}from"./localePickerView-C2RmOS86.js";var q=t(e(),1),J=[{id:`messages`,label:()=>E()},{id:`composer`,label:()=>w()},{id:`sidebar`,label:()=>z()},{id:`other`,label:()=>A()}],Y={showSource:{category:`messages`,label:()=>C(),help:()=>L()},showReport:{category:`messages`,label:()=>M(),help:()=>x()},copyAssistant:{category:`messages`,label:()=>D()},copyUser:{category:`messages`,label:()=>I()},showDelete:{category:`messages`,label:()=>j()},showTools:{category:`messages`,label:()=>R(),help:()=>T()},voiceInput:{category:`composer`,label:()=>r(),help:()=>ae()},showUsage:{category:`composer`,label:()=>b(),help:()=>fe()},showChatAge:{category:`sidebar`,label:()=>y(),help:()=>m()},showChatProvider:{category:`sidebar`,label:()=>F(),help:()=>g()}};function X(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function xe(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 Se=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`,`showUsage`],Ce={voiceInput:`voiceInput`};function we(e){return Se.includes(e)}function Z(e){return e===`admin`}function Q(e){return e===!0?`on`:e===!1?`off`:`inherit`}function Te(e){return e===`on`?!0:e===`off`?!1:null}function Ee(e){return we(e)?Ce[e]:void 0}var $=n(),De={voiceInput:()=>u()};function Oe({prefKey:e,ui:t}){let n=h(c.admin.setUiPrefDefault),r=h(c.admin.setFeatureEnabled),i=Ee(e),a=i?De[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:pe()}),(0,$.jsxs)(_e,{value:Q(t.defaults[e]),onValueChange:t=>void n({key:e,value:Te(t)}),children:[(0,$.jsx)(me,{size:`sm`,className:`w-36`,children:(0,$.jsx)(ve,{})}),(0,$.jsxs)(ye,{children:[(0,$.jsx)(U,{value:`on`,children:ne()}),(0,$.jsx)(U,{value:`off`,children:_()}),(0,$.jsx)(U,{value:`inherit`,children:O()})]})]}),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":v()}),v()]}):null]}),a?(0,$.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function ke(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),i=P(c.me.getMe,{host:K}),o=i?.ui,s=Z(i?.role)&&n,l=h(c.me.setUiPref).withOptimisticUpdate(he),u=(0,q.useMemo)(()=>o?xe(Object.keys(o.effective),e):[],[o,e]);return o?(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":a()}),a()]}):null,s?(0,$.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,$.jsx)(`p`,{children:ee()}),(0,$.jsx)(`p`,{children:p()}),(0,$.jsx)(`p`,{children:ie()})]}):null,(0,$.jsx)(G,{value:e,onChange:e=>t(e.target.value),placeholder:d(),"aria-label":d(),className:`mb-2`}),u.length===0?(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:de()}):(0,$.jsx)(`div`,{className:`oc-prefs`,children:u.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=o.locked[e],a=o.effective[e],c=o.userOverrides[e]!==void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}${c&&!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()}):c?null:(0,$.jsx)(`span`,{className:`oc-prefs__def`,children:f()})]}),r?(0,$.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,$.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&c?(0,$.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void l({key:e,value:null}),children:ue()}):null,(0,$.jsx)(W,{checked:a,disabled:i,onCheckedChange:t=>void l({key:e,value:t===!0}),"aria-label":n})]}),s?(0,$.jsx)(Oe,{prefKey:e,ui:o}):null]},e)})]},e.id))})]}):(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:oe()})}function Ae(){let e=P(c.me.getMe,{host:K}),t=h(c.me.setLocale),n=h(c.me.setMyName),r=ge(),a=e?.locale??`default`,u=e?.name??``,[d,f]=(0,q.useState)(null),p=d??u,m=p.trim()!==u.trim();async function g(){try{await n({name:p}),f(null),r.success(l())}catch(e){r.error(ce(),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:i()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:k()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[(0,$.jsx)(G,{className:`max-w-xs`,value:p,maxLength:120,placeholder:re(),onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&m&&(e.preventDefault(),g())}}),(0,$.jsx)(H,{size:`sm`,disabled:!m,onClick:()=>void g(),children:N()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:s()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:B()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:o()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[be().map(e=>(0,$.jsx)(H,{variant:a===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,$.jsx)(H,{variant:a==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:te()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:se()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:V()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:S()})]}),(0,$.jsx)(ke,{})]})]})}export{Ae as PreferencesTab};
@@ -1,4 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Am as r,Bm as i,Cm as a,Dm as o,E as s,Em as c,Ft as l,It as u,KA as d,Lt as f,M as p,Mm as m,Mt as h,N as g,Nt as _,Om as v,P as y,Pt as b,Sm as x,Tm as S,_m as C,_r as w,bm as T,gm as ee,gr as E,hm as D,hr as te,jm as ne,km as re,mm as ie,mr as ae,pm as oe,qA as O,vm as k,vr as A,wm as j,xm as M,ym as N,zm as P}from"./dist-0orl0RkM.js";import{d as F,f as I,i as L,l as R,n as z,r as B,t as V,u as H}from"./FieldLabel-B8G-MYNo.js";import{t as U}from"./button-CckfHMbj.js";import{C as W,P as G,S as K,b as q,p as se,ut as ce,w as J,x as Y}from"./index-CFTFwlx0.js";import{r as X,t as Z}from"./locales-CPjguROj.js";import{t as le}from"./localePickerView-C2RmOS86.js";/* empty css */var Q=t(e(),1),$=n(),ue={media_delivery:{label:o,help:c},documentary_fetch:{label:S,help:j},inbound_files:{label:a,help:x},history_summary:{label:A,help:w},file_curation:{label:f,help:u}},de={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
2
- - gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`,previous_summary:`Projet Alpha : budget 40 000 EUR ; choix du serveur en cours.`,new_messages:`Utilisateur : Compare OVH et Scaleway.
3
- Assistant : Comparaison en cours.`,max_chars:`6000`,file_name:`MEMORY.md`,budget_chars:`20000`,feedback:`Trop de suppressions dans la section des liens, garde-les.`,content:`# Memory index
4
- - [Fait 1](fait-1.md) - note du projet`},fe={outboundDir:D,references:ie,files:oe,previous_summary:E,new_messages:te,max_chars:ae,file_name:l,budget_chars:b,feedback:_,content:h};function pe(){let e=O(s.admin.listInstances,{}),[t,n]=(0,Q.useState)(null);if(e===void 0)return(0,$.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,$.jsx)(`div`,{className:`oc-injtab`,children:(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:T()})});let r=e.find(e=>e._id===t)??e[0];return(0,$.jsxs)(`div`,{className:`oc-injtab`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,$.jsx)(z,{label:m(),help:ne()}),(0,$.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,$.jsx)(`span`,{children:M()}),(0,$.jsxs)(q,{value:r._id,onValueChange:e=>n(e),children:[(0,$.jsx)(W,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(J,{})}),(0,$.jsx)(Y,{children:e.map(e=>(0,$.jsx)(K,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,$.jsx)(me,{instance:r},r._id)]})}function me({instance:e}){let t=d(s.admin.upsertInstanceConfig),n=G(),r=O(s.me.getMe,{host:ce}),a=e.config??{},o=X(e.config?.contentLocale,r?.defaultLocale??void 0),[c,l]=(0,Q.useState)(()=>L(a,o));(0,Q.useEffect)(()=>{l(L(a,o))},[o,e._id]);let[u,f]=(0,Q.useState)(!1),m=c.promptInjections,h=(e,t)=>l({...c,promptInjections:{...m,[e]:{...m[e],...t}}});async function _(){f(!0);try{await t({instanceId:e._id,config:B(c,a,o)})}catch(e){n.error(P(),e)}finally{f(!1)}}async function v(r){let i={...e.config??{}};r==="default"?delete i.contentLocale:i.contentLocale=r;try{await t({instanceId:e._id,config:i})}catch(e){n.error(P(),e)}}let b=e.config?.contentLocale??`default`,x=Z[X(void 0,r?.defaultLocale??void 0)];return(0,$.jsxs)(`div`,{className:`oc-injtab__body`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__content-locale`,children:[(0,$.jsx)(`span`,{children:y()}),(0,$.jsxs)(q,{value:b,onValueChange:e=>void v(e),children:[(0,$.jsx)(W,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(J,{})}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(K,{value:`default`,children:p({locale:x})}),le().map(e=>(0,$.jsx)(K,{value:e.value,children:e.label},e.value))]})]}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:g()})]}),H.map(e=>(0,$.jsx)(he,{injKey:e,def:R[e],i18n:ue[e],row:m[e]??{enabled:!0,template:R[e].defaultTemplate[o]},contentLocale:o,onChange:t=>h(e,t)},e)),(0,$.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,$.jsx)(U,{size:`sm`,onClick:()=>void _(),disabled:u,children:i()})})]})}function he({injKey:e,def:t,i18n:n,row:i,contentLocale:a,onChange:o}){let[s,c]=(0,Q.useState)(!1),l=i.template.trim()!==t.defaultTemplate[a],u=t.togglable&&!i.enabled,d=Object.fromEntries(t.placeholders.map(e=>[e,de[e]??`{${e}}`])),f=F(e,i,a),p=f?I(f,d):``;return(0,$.jsxs)(`section`,{className:`oc-injcard`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,$.jsxs)(`label`,{className:`oc-field--row`,children:[(0,$.jsx)(se,{checked:i.enabled,onCheckedChange:e=>o({enabled:e===!0})}),(0,$.jsx)(z,{label:n.label(),help:n.help()})]}):(0,$.jsx)(z,{label:n.label(),help:n.help()}),l&&(0,$.jsx)(`span`,{className:`oc-injection__badge`,children:re()})]}),(0,$.jsx)(`textarea`,{className:`oc-injcard__text`,value:i.template,disabled:u,rows:8,spellCheck:!1,onChange:e=>o({template:e.target.value})}),(0,$.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:v()}),t.placeholders.map(e=>(0,$.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,$.jsx)(`code`,{children:`{${e}}`}),(0,$.jsx)(V,{text:(fe[e]??(()=>e))()})]},e))]}),(0,$.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,$.jsx)(U,{variant:`ghost`,size:`sm`,onClick:()=>c(e=>!e),children:s?k():N()}),l&&(0,$.jsx)(U,{variant:`ghost`,size:`sm`,onClick:()=>o({template:t.defaultTemplate[a]}),children:r()})]})]}),s&&(0,$.jsx)(`div`,{className:`oc-injcard__preview`,children:p?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:p}),(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:C()})]}):(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:ee()})})]})}export{pe as PromptInjectionsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,B_ as ee,Cv as i,E as a,F_ as o,H_ as s,I_ as te,KA as c,L_ as l,Q_ as u,R_ as ne,Sv as d,U_ as f,V_ as p,X_ as m,Y_ as h,Z_ as g,_v as _,av as v,bv as y,cv as b,dv as x,ev as re,fv as S,gv as C,hv as w,iv as ie,lv as T,mv as E,nv as D,ov as O,pv as k,qA as A,rv as j,sn as M,sv as N,tv as P,uv as F,vv as I,wv as L,xv as R,yv as z,z_ as ae}from"./dist-0orl0RkM.js";import{t as B}from"./button-CckfHMbj.js";import{F as V,P as H,Tt as U,et as W,p as G,tt as K,u as q}from"./index-CFTFwlx0.js";import{t as J}from"./roleDescriptions-DHFs-TkY.js";var Y=t(e(),1),X=n(),Z=[{group:()=>L(),keys:[{key:`traces.read`,label:()=>z()},{key:`traces.read.content`,label:()=>I(),phi:!0},{key:`traces.write`,label:()=>_()}]},{group:()=>i(),keys:[{key:`kpi.read`,label:()=>z()},{key:`kpi.write`,label:()=>_()}]},{group:()=>d(),keys:[{key:`openclaw.query`,label:()=>C()},{key:`anomalies.read`,label:()=>w()},{key:`anomalies.report`,label:()=>E()}]},{group:()=>R(),keys:[{key:`chats.read`,label:()=>z()},{key:`selfheal`,label:()=>S()},{key:`feedback.respond`,label:()=>M()}]},{group:()=>y(),keys:[{key:`admin.manage`,label:()=>k()}]}],oe=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function se(){let e=A(a.apiKeys.listRoles,{}),t=c(a.apiKeys.createRole),n=c(a.apiKeys.ensureRolesSeeded),i=c(a.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(a.apiKeys.listRoles,{});r&&e.setQuery(a.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),d=V(),_=H(),[y,S]=(0,Y.useState)(!1),[C,w]=(0,Y.useState)($),[E,k]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{_.error(F(),e)})},[n,_]);let M=e??[];async function I(e,t){if(Q(e.permissions)||E.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await d({title:T({name:e.name}),description:b(),confirmLabel:N()}))){k(t=>new Set(t).add(e._id));try{await i({roleId:e._id,permissions:n})}catch(e){_.error(O(),e)}finally{k(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function L(){try{await t({key:C.key,name:C.name,description:C.description||void 0,permissions:[]}),w($),S(!1)}catch(e){_.error(v(),e)}}let R=e===void 0,z=!R&&M.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[ie(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,j(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,D()]}),(0,X.jsxs)(`div`,{className:`oc-dt`,children:[(0,X.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,X.jsx)(`h2`,{className:`oc-dt__title`,children:P()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(B,{size:`sm`,onClick:()=>{w($),S(!0)},children:re()})})]}),R?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:r()}):z?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,X.jsx)(`div`,{className:`oc-matrix__scroll`,children:(0,X.jsxs)(`table`,{className:`oc-matrix`,children:[(0,X.jsxs)(`thead`,{children:[(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{className:`oc-matrix__corner`,rowSpan:2,children:g()}),Z.map(e=>(0,X.jsx)(`th`,{className:`oc-matrix__group`,colSpan:e.keys.length,children:e.group()},e.group()))]}),(0,X.jsx)(`tr`,{children:Z.flatMap(e=>e.keys.map(e=>(0,X.jsxs)(`th`,{className:`oc-matrix__perm`,title:e.phi?x({key:e.key}):e.key,children:[e.label(),e.phi?(0,X.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,X.jsx)(`tbody`,{children:M.map(e=>{let t=Q(e.permissions),n=E.has(e._id);return(0,X.jsxs)(`tr`,{children:[(0,X.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,X.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,X.jsx)(`span`,{children:e.name}),(0,X.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,X.jsxs)(W,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(U,{}),` `,m()]}):(0,X.jsx)(W,{variant:`secondary`,children:h()})]}),J(e)?(0,X.jsx)(`p`,{className:`oc-matrix__roledesc`,children:J(e)}):null]}),oe.map(r=>(0,X.jsx)(`td`,{className:`oc-matrix__cell`,children:(0,X.jsx)(G,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?f():n?s():r,onCheckedChange:()=>void I(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(q,{open:y,onOpenChange:S,title:p(),description:ee(),canSubmit:!!(C.key&&C.name),onSubmit:L,submitLabel:ae(),children:(0,X.jsxs)(`div`,{className:`oc-form`,children:[(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:ne()}),(0,X.jsx)(K,{value:C.key,placeholder:l(),onChange:e=>w({...C,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:te()}),(0,X.jsx)(K,{value:C.name,onChange:e=>w({...C,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:o()}),(0,X.jsx)(K,{value:C.description,onChange:e=>w({...C,description:e.target.value})})]})]})})]})}export{se as RolesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$E as r,AD as i,AE as a,BE as ee,CD as te,CE as o,DD as ne,DE as s,E as c,ED as re,EE as l,FE as ie,GE as ae,HE as oe,IE as se,JE as ce,KA as u,KE as le,LE as ue,ME as d,NE as f,OD as de,OE as p,PE as fe,QE as pe,RE as me,SD as he,SE as m,TD as ge,TE as _e,UE as ve,VE as ye,WA as be,WE as xe,XE as Se,YE as Ce,ZE as we,_D as Te,_E as h,aD as Ee,bD as De,bE as g,cD as Oe,dD as ke,dE as _,eD as Ae,fD as je,fE as v,gD as Me,gE as y,hD as Ne,hE as b,iD as Pe,jE as x,kD as Fe,kE as S,lD as Ie,mD as Le,mE as C,nD as Re,oD as ze,pD as Be,pE as w,qA as T,qE as Ve,rD as He,sD as Ue,tD as We,uD as Ge,uE as E,vD as Ke,vE as D,wD as O,wE as k,xD as qe,xE as A,yD as Je,yE as j,zE as Ye}from"./dist-0orl0RkM.js";import{n as M}from"./dist-4hLW9pCQ.js";import{i as Xe}from"./dist-CM845ILS.js";import{t as N}from"./button-CckfHMbj.js";import{A as P,C as F,F as Ze,Ft as Qe,It as $e,P as et,Pt as tt,S as I,at as L,b as R,et as z,it as B,jt as V,k as H,nt as U,ot as nt,rt,st as W,tt as it,u as at,w as G,x as K}from"./index-CFTFwlx0.js";import{t as ot}from"./FilterBar-DRUEEKsU.js";import{t as st}from"./DataTableShell-u1nLRhQM.js";import{t as ct}from"./roleDescriptions-DHFs-TkY.js";var q=t(e(),1),J=n(),lt=[{value:`never`,label:()=>y(),days:null},{value:`30`,label:()=>b(),days:30},{value:`90`,label:()=>C(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=$e({from:`/settings/serviceAccounts`}),t=Qe({from:`/settings/serviceAccounts`}),n=e.q??``,a=e.status??X,[o,s]=(0,q.useState)(X),l=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),d=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),f=T(c.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===X?void 0:o,disabled:a===X?void 0:a===`disabled`}}),p=T(c.apiKeys.listKeys,{}),m=T(c.apiKeys.listRoles,{}),_e=u(c.apiKeys.createServiceAccount),h=u(c.apiKeys.updateServiceAccount),g=u(c.apiKeys.deleteServiceAccount),_=be(c.apiKeys.mintApiKey),v=u(c.apiKeys.revokeApiKey),y=Ze(),b=et(),x=n!==``||o!==X||a!==X;function S(){s(X),t({search:{},replace:!0})}let[C,w]=(0,q.useState)(!1),[E,D]=(0,q.useState)(Z),[k,A]=(0,q.useState)(null),[j,M]=(0,q.useState)(new Set),[P,L]=(0,q.useState)(null),B=(0,q.useRef)(!1),[V,H]=(0,q.useState)(new Set),[U,nt]=(0,q.useState)({}),[rt,W]=(0,q.useState)(null),Y=(0,q.useMemo)(()=>{let e=new Map;for(let t of p??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[p]);function Q(e){M(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{k?(await h({serviceAccountId:k,name:E.name,roleKey:E.roleKey,description:E.description}),b.success(ce())):await _e({name:E.name,roleKey:E.roleKey,description:E.description||void 0}),D(Z),A(null),w(!1)}catch(e){b.error(k?Ce():Se(),e)}}function pt(e){D({name:e.name,roleKey:e.roleKey,description:e.description??``}),A(e._id),w(!0)}async function mt(e){if(B.current)return;B.current=!0;let t=U[e._id]??`never`,n=lt.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;L(e._id);try{let t=await _({serviceAccountId:e._id,expiresAt:r});W({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){b.error(Ve(),e)}finally{B.current=!1,L(null)}}async function $(e){if(await y({title:le(),description:(0,J.jsxs)(J.Fragment,{children:[ae(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,xe(),` `,(0,J.jsx)(`strong`,{children:ve()}),` `,oe()]}),confirmWord:e.name,confirmLabel:ye(),destructive:!0}))try{await g({serviceAccountId:e._id}),b.success(ee(),e.name)}catch(e){b.error(Ye(),e)}}async function ht(e){if(await y({title:me(),description:(0,J.jsxs)(J.Fragment,{children:[ue(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,se()]}),confirmLabel:ie(),destructive:!0})&&!V.has(e._id)){H(t=>new Set(t).add(e._id));try{await v({keyId:e._id})}catch(e){b.error(fe(),e)}finally{H(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:i()}),(0,J.jsxs)(ot,{q:n,onQChange:l,searchPlaceholder:Fe(),onReset:S,canReset:x,children:[(0,J.jsxs)(R,{value:o,onValueChange:s,children:[(0,J.jsx)(F,{size:`sm`,className:`w-40`,children:(0,J.jsx)(G,{placeholder:de()})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(I,{value:X,children:ne()}),(m??[]).map(e=>(0,J.jsx)(I,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(R,{value:a,onValueChange:d,children:[(0,J.jsx)(F,{size:`sm`,className:`w-36`,children:(0,J.jsx)(G,{})}),(0,J.jsxs)(K,{children:[(0,J.jsx)(I,{value:X,children:re()}),(0,J.jsx)(I,{value:`active`,children:ge()}),(0,J.jsx)(I,{value:`disabled`,children:O()})]})]})]}),(0,J.jsx)(st,{title:te(),rows:f,addLabel:he(),onAdd:()=>{D(Z),A(null),w(!0)},emptyHint:qe(),isExpanded:e=>j.has(e._id),renderExpanded:e=>(0,J.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:V}),rowActions:e=>[{label:Te(),onSelect:()=>pt(e)},{label:De(),onSelect:()=>void mt(e)},{label:j.has(e._id)?Je():Ke(),onSelect:()=>Q(e._id)},{label:Me(),variant:`destructive`,onSelect:()=>void $(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(N,{variant:`ghost`,size:`icon-sm`,"aria-label":j.has(e._id)?Ne():Le(),onClick:()=>Q(e._id),children:j.has(e._id)?(0,J.jsx)(Xe,{}):(0,J.jsx)(tt,{})})},{header:Be(),sort:e=>e.name,cell:e=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{children:e.name}),e.description?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:je(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(z,{variant:`secondary`,children:e.roleKey})},{header:ke(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(z,{variant:`destructive`,children:O()}):(0,J.jsx)(z,{variant:`outline`,children:ge()})},{header:Ge(),cell:e=>(0,J.jsxs)(R,{value:U[e._id]??`never`,onValueChange:t=>nt(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(F,{size:`sm`,className:`w-32`,children:(0,J.jsx)(G,{})}),(0,J.jsx)(K,{children:lt.map(e=>(0,J.jsx)(I,{value:e.value,children:e.label()},e.value))})]})},{header:Ie(),sort:e=>(Y.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Y.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,J.jsx)(`span`,{className:`oc-sa__keycount`,children:P===e._id?Oe():Ue({count:t})})}}]}),(0,J.jsx)(at,{open:C,onOpenChange:e=>{w(e),e||A(null)},title:k?ze():He(),description:k?Ee():Re(),canSubmit:!!(E.name&&E.roleKey),onSubmit:ft,submitLabel:k?Pe():We(),children:(0,J.jsxs)(`div`,{className:`oc-form`,children:[(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:Ae()}),(0,J.jsx)(it,{value:E.name,onChange:e=>D({...E,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:r()}),(0,J.jsxs)(R,{value:E.roleKey||void 0,onValueChange:e=>D({...E,roleKey:e}),children:[(0,J.jsx)(F,{className:`w-full`,children:(0,J.jsx)(G,{placeholder:pe()})}),(0,J.jsx)(K,{children:(m??[]).map(e=>(0,J.jsxs)(I,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(m??[]).find(e=>e.key===E.roleKey),t=e?ct(e):null;return t?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:we()}),(0,J.jsx)(it,{value:E.description,onChange:e=>D({...E,description:e.target.value})})]})]})}),(0,J.jsx)(dt,{minted:rt,onClose:()=>W(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,J.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,J.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[f(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:x()}),(0,J.jsx)(`th`,{children:a()}),(0,J.jsx)(`th`,{children:S()}),(0,J.jsx)(`th`,{children:p()}),(0,J.jsx)(`th`,{children:s()}),(0,J.jsx)(`th`,{children:l()}),(0,J.jsx)(`th`,{})]})}),(0,J.jsx)(`tbody`,{children:t.map(t=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,J.jsx)(`td`,{children:(0,J.jsx)(z,{variant:`secondary`,children:e.roleKey})}),(0,J.jsx)(`td`,{children:P(t.createdAt)}),(0,J.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,J.jsx)(`td`,{children:mt(t.expiresAt)}),(0,J.jsx)(`td`,{children:$(t)}),(0,J.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,J.jsx)(N,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?_e():k()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,q.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,J.jsx)(U,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(rt,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(nt,{children:[(0,J.jsx)(W,{children:o()}),(0,J.jsx)(B,{children:m({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:A()}),(0,J.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,J.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,J.jsxs)(N,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":g(),children:[n?(0,J.jsx)(M,{}):(0,J.jsx)(V,{}),n?j():D()]})]}),(0,J.jsx)(L,{children:(0,J.jsx)(N,{onClick:()=>{r(!1),t()},children:h()})})]}):null})}function ft(e){return e===null?!1:Date.now()-e>Y}function pt(e){return e===null?w():P(e)}function mt(e){return e===null?`—`:H(e)}function $(e){return e.disabled?(0,J.jsx)(z,{variant:`destructive`,children:v()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(z,{variant:`outline`,children:_()}):(0,J.jsx)(z,{variant:`outline`,children:E()})}export{Q as ServiceAccountsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$r as r,Ar as i,Br as a,Cr as o,Dr as s,E as c,Er as l,Fr as u,Gr as d,Hr as f,Ir as p,Jr as m,KA as h,Kr as g,Lr as _,Mr as v,Nr as y,Or as b,Pr as x,Qr as S,Rr as C,Tr as w,Ur as T,Vr as E,Wr as D,Xr as O,Yr as k,Zr as A,ai as j,ei as M,ii as N,jr as P,kr as F,ni as I,oi as L,qA as ee,qr as R,ri as z,si as B,ti as V,wr as H,zr as U}from"./dist-0orl0RkM.js";import{t as W}from"./button-CckfHMbj.js";import{A as G,F as K}from"./index-CFTFwlx0.js";import{t as q}from"./DataTableShell-u1nLRhQM.js";var J=t(e(),1),Y=n(),X={hung:()=>D(),wrong_result:()=>T(),error:()=>f(),other:()=>E()},Z=e=>(e&&X[e]?.())??e??`—`;function Q(e){let t=e.slice(e.lastIndexOf(`:`)+1)||e;return t.length>12?`${t.slice(0,12)}…`:t}function $({data:e}){let t=e.snapshot,n=h(c.subAgentReports.respondToReport),[r,o]=(0,J.useState)(e.thread),[d,f]=(0,J.useState)(``),[m,g]=(0,J.useState)(!1);async function S(){let t=d.trim();if(!(!t||m)){g(!0);try{await n({reportId:e._id,text:t}),o(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),f(``)}finally{g(!1)}}}return(0,Y.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,children:(0,Y.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Z(e.category),` · `,a({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:U()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:C()}),r.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:r.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?_():p()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:u()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:x(),value:d,maxLength:2e3,rows:3,onChange:e=>f(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(W,{size:`sm`,onClick:()=>void S(),disabled:!d.trim()||m,children:m?v():y()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[P({count:t.children.length}),t.childrenTruncated?` ${i()}`:``,t.textTruncated?` ${F()}`:``]}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,Y.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Y.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Q(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${b()}`:``]}),e.errorMessage?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:s()}),(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.parentText})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:l()}),(0,Y.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 te(){let e=ee(c.subAgentReports.listForAdmin,{}),t=h(c.subAgentReports.readReport),n=h(c.subAgentReports.deleteReport),i=K(),[a,s]=(0,J.useState)(null),[l,u]=(0,J.useState)({});async function f(e){if(a===e._id){s(null);return}if(!l[e._id]){let n=await t({reportId:e._id});u(t=>({...t,[e._id]:n}))}s(e._id)}async function p(e){await i({title:w(),description:H(),confirmLabel:o(),destructive:!0})&&(await n({reportId:e._id}),a===e._id&&s(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[j(),` `,(0,Y.jsx)(`strong`,{children:N()}),` `,z()]}),(0,Y.jsx)(q,{title:B(),rows:e,emptyHint:L(),isExpanded:e=>a===e._id&&!!l[e._id],renderExpanded:e=>l[e._id]?(0,Y.jsx)($,{data:l[e._id]}):null,columns:[{header:I(),cell:e=>G(e.at),sort:e=>e.at},{header:V(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:M(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:r(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${O({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:S(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:A(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:k()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:m()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:a===e._id?g():R(),onSelect:()=>void f(e)},{label:d(),onSelect:()=>void p(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$O as r,AO as i,Ak as a,BO as o,CO as s,Ck as c,D as l,DO as u,Dk as d,E as f,EO as p,Ek as m,FA as h,FO as g,Fk as _,GO as ee,HO as v,IA as te,IO as ne,JO as re,KA as y,KO as ie,LO as ae,MO as oe,Mk as se,NO as b,Nk as ce,OO as le,Ok as ue,PA as de,PO as fe,Pk as pe,QO as x,RO as me,SO as he,Sk as ge,Sr as S,TO as _e,Tk as C,UO as ve,VO as ye,WA as be,WO as xe,XO as Se,YO as Ce,ZO as we,_O as Te,_k as Ee,ak as De,bO as Oe,bk as ke,br as Ae,ck as je,dk as Me,ek as Ne,fk as Pe,gO as Fe,gk as Ie,hO as Le,hk as Re,ik as ze,jO as Be,jk as Ve,kO as He,kk as Ue,lk as We,mO as Ge,mk as Ke,n as qe,nk as Je,ok as Ye,pO as Xe,pk as Ze,qA as w,qO as Qe,rk as $e,sk as et,tk as tt,uk as nt,vO as rt,vk as it,wO as at,wk as ot,xO as T,xk as st,xr as E,yO as ct,yk as lt,yr as ut,zO as dt}from"./dist-0orl0RkM.js";import{n as D}from"./dist-4hLW9pCQ.js";import{t as O}from"./x-DBdlW6Pd.js";import{t as k}from"./button-CckfHMbj.js";import{$ as ft,At as pt,C as A,J as mt,Q as j,S as M,X as N,Y as ht,Z as gt,b as P,ct as _t,et as F,kt as I,lt as vt,p as L,tt as R,ut as z,w as B,x as V}from"./index-CFTFwlx0.js";import{t as yt}from"./localePickerView-C2RmOS86.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-DypYZQqW.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-CnKDuavw.js";import{t as kt}from"./TimeRangePicker-D48D83Oh.js";import{t as At}from"./FilterBar-DRUEEKsU.js";import{t as jt}from"./AdvancedFilter-C0THAQ2E.js";var G=l(`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),Mt=.1,Nt=[248,248,248],Pt=[24,24,24];function Ft(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 It(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 It(e,t,n)>=Mt}function Lt(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 Rt(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 zt=12*1024*1024,Bt=480,Vt=160,Ht=.92;async function Ut(e,t={}){if(!e.type.startsWith(`image/`))throw Error(ne());if(e.size>zt)throw Error(g());let{source:n,width:r,height:i,cleanup:a}=await Wt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Bt/r,Vt/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(b());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Ft(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(b());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)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(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`,Ht)??await Y(f,`image/png`);if(!h)throw Error(oe());return{blob:h,hasAlpha:m}}finally{a()}}async function Wt(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(fe())),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 Gt(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`},Kt=[{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 qt(e){return e===`light`?te():e===`dark`?h():de()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({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:qe(`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)(Yt,{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":S(),title:S(),children:(0,X.jsx)(pt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=w(f.charts.listMyCharts),r=y(f.charts.setMyChart);async function i(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:d()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:m()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:C(),subtitle:ot(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?c():n.via===`owner`?ge():st({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Gt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ke()}):null]})}function Qt(){let e=y(f.charts.importChart),[t,n]=(0,K.useState)(``),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1),[u,d]=(0,K.useState)(!1);async function p(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),l(!1);try{a(await t.text())}catch{s(x())}}}async function m(){if(s(null),l(!1),t.trim()===``){s(Se());return}let r;try{r=JSON.parse(i)}catch{s(x());return}d(!0);try{await e({name:t.trim(),tokens:r}),l(!0),n(``),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{d(!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:Ye()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:De()})]}),(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:ze()}),(0,X.jsx)(R,{value:t,onChange:e=>n(e.target.value),placeholder:$e(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Je()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:i,onChange:e=>a(e.target.value),placeholder:tt(),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`}),Ne(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void p(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:u,onClick:()=>void m(),children:r()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:we()}):null]})]})}function $t({chart:e}){let t=be(f.charts.setChartLogo),n=y(f.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,s]=(0,K.useState)(null),c=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function l(n,r,a){if(e.chartId!==void 0){s(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ut(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function u(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await l(e,n)}async function d(t){if(e.chartId!==void 0){s(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function p(e){let t=c(e===`light`?`dark`:`light`);if(t){s(null),i(!0);try{await l(e,await(await fetch(t)).blob(),e)}catch(e){s(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function m({mode:e}){let t=c(e),n=c(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`?ve():v()}),(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?o():ye(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void u(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void p(e),children:me()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:dt()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:xe()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(m,{mode:`light`}),(0,X.jsx)(m,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ae()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=w(f.me.getMe,{host:z}),n=y(f.charts.addChartDomain),r=y(f.charts.removeChartDomain),[a,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(null),[l,d]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let m=e.domains??[];async function h(){let t=a.trim();if(t!==``){c(null),d(!0);try{await n({chartKey:e.key,domain:t}),o(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{d(!1)}}}async function g(t){c(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:Be()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:m.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:u()}):m.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":p({domain:e}),onClick:()=>void g(e),children:(0,X.jsx)(O,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(R,{value:a,onChange:e=>o(e.target.value),placeholder:He(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&h()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:l,onClick:()=>void h(),children:le()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:i()}),s?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:s}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=y(f.charts.updateChart),n=y(f.charts.deleteChart),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(e.name),[c,l]=(0,K.useState)(()=>tn(e.tokens)),[u,d]=(0,K.useState)(e.tokens.bpm??0),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(!1);function _(){o(e.name),l(tn(e.tokens)),d(e.tokens.bpm??0),m(null),i(!0)}async function v(){if(e.chartId===void 0)return;m(null);let n;try{n=JSON.parse(c)}catch{m(x());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:a.trim(),tokens:n}),i(!1)}catch(e){m(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function te(){if(e.chartId!==void 0&&window.confirm(T()))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:_,children:ie()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void te(),children:ee()})]})})]}),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:s()}),(0,X.jsx)(R,{value:a,onChange:e=>o(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:E()}),(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=>d(Number(e.target.value)),"aria-label":E()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?Ae():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ut()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:he()}),(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:h,onClick:()=>void v(),children:_e()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:at()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=w(f.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:Ce()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:re()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Qe()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=y(f.charts.addChartToGroupPool),r=y(f.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?Pe():e.kind===`custom`&&e.scope===`personal`?Te():Ze()}),e.isGlobalDefault?(0,X.jsx)(F,{variant:`default`,children:Me()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:We()}),(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":et({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(O,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(P,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(A,{size:`sm`,className:`w-56`,children:(0,X.jsx)(B,{placeholder:je()})}),(0,X.jsx)(V,{children:s.map(e=>(0,X.jsx)(M,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:nt()}):null]})]})}function on({chart:e}){let t=y(f.charts.promoteChartToCommon),n=y(f.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(T()))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`?Fe():Te()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:rt({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:Le()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:Ge()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=y(f.admin.setDefaultThemeMode),i=y(f.admin.setDefaultLocale),a=y(f.charts.setDefaultChart),o=w(f.charts.listChartsAdmin),s=w(f.groups.listGroups,{}),c=e??`system`,l=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:Ue()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ue()})]}),(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:lt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:it()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:C()}),vt.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(o??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({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:Ee()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ie()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:s??[]},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:Re()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ke()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).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)(en,{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:Oe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ct()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Xe()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(on,{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:_()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:pe()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:c===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(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:ce()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:se()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(k,{variant:l===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ve()})]})]})}function cn(){let e=w(f.me.getMe,{host:z}),t=_t(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,o]=(0,K.useState)(``),[s,c]=(0,K.useState)(Z),[l,u]=(0,K.useState)(Z),[d,f]=(0,K.useState)(Q),p=i!==``||s!==Z||l!==Z;function m(){o(``),c(Z),u(Z),f(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:a()}),(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)(I,{})}),(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)(R,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(P,{value:n,onValueChange:r,children:[(0,X.jsx)(A,{className:`w-56`,children:(0,X.jsx)(B,{placeholder:`Select…`})}),(0,X.jsxs)(V,{children:[(0,X.jsx)(M,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(M,{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)(At,{q:i,onQChange:o,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:d,onTimeRangeChange:f,onReset:m,canReset:p,children:[(0,X.jsxs)(P,{value:s,onValueChange:c,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(V,{children:[(0,X.jsx)(M,{value:Z,children:`Toutes directions`}),(0,X.jsx)(M,{value:`inbound`,children:`inbound`}),(0,X.jsx)(M,{value:`outbound`,children:`outbound`}),(0,X.jsx)(M,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(P,{value:l,onValueChange:u,children:[(0,X.jsx)(A,{size:`sm`,children:(0,X.jsx)(B,{})}),(0,X.jsxs)(V,{children:[(0,X.jsx)(M,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(M,{value:`info`,children:`info`}),(0,X.jsx)(M,{value:`warn`,children:`warn`}),(0,X.jsx)(M,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(jt,{fields:Kt,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)(kt,{value:d,onChange:f})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(mt,{children:[(0,X.jsx)(ft,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(I,{})})}),(0,X.jsxs)(ht,{align:`start`,children:[(0,X.jsx)(gt,{children:`Actions`}),(0,X.jsx)(j,{}),(0,X.jsx)(N,{children:`Edit`}),(0,X.jsx)(N,{children:`Duplicate`}),(0,X.jsx)(j,{}),(0,X.jsx)(N,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)($,{title:`Card`,children:(0,X.jsxs)(Tt,{className:`w-80`,children:[(0,X.jsxs)(bt,{children:[(0,X.jsx)(Ct,{children:`Instance`}),(0,X.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(xt,{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)(Ot,{children:[(0,X.jsx)(Et,{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)(Dt,{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)(I,{})})})]},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{ln as ThemeShowroom};