@lacneu/atrium 0.39.1 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/assets/AccessTab-Dxz0E_KE.js +1 -0
  2. package/dist/assets/{AdvancedFilter-DGS0QV-g.js → AdvancedFilter-B31lk9q3.js} +1 -1
  3. package/dist/assets/AgentFilesTab-DeCWC1w-.js +3 -0
  4. package/dist/assets/AnomaliesTab-CrtrCVM2.js +1 -0
  5. package/dist/assets/AuditTab-BBsxqs3y.js +1 -0
  6. package/dist/assets/BridgeTab-BVZtXJSI.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-DLvh7i7g.js +1 -0
  8. package/dist/assets/DataTableShell-2dt7qzK1.js +1 -0
  9. package/dist/assets/{DetailChips-C40vaJ_d.js → DetailChips-PeX_dqPr.js} +1 -1
  10. package/dist/assets/FeedbacksTab-CWlAV3go.js +1 -0
  11. package/dist/assets/{FieldLabel-DMW_YpQf.js → FieldLabel-DLQqitFA.js} +2 -2
  12. package/dist/assets/FilesTab-BKNZcTjL.js +1 -0
  13. package/dist/assets/{FilterBar-DTgQOIHy.js → FilterBar-C4F1dTQ_.js} +1 -1
  14. package/dist/assets/GroupsTab-B8NcjrCa.js +1 -0
  15. package/dist/assets/InstancesTab-0dB_8WYK.js +1 -0
  16. package/dist/assets/IntegrationsTab-DxwU-vz4.js +1 -0
  17. package/dist/assets/KpiTab-I_L7bxeO.js +1 -0
  18. package/dist/assets/PreferencesTab-Civ5ZM-T.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-Se2h3t86.js +4 -0
  20. package/dist/assets/RolesTab-DzHzo0im.js +1 -0
  21. package/dist/assets/ServiceAccountsTab-BI3REx76.js +1 -0
  22. package/dist/assets/SubAgentReportsTab-CdEDescp.js +1 -0
  23. package/dist/assets/ThemeShowroom-_GVi_9TD.js +1 -0
  24. package/dist/assets/{TimeRangePicker-CQKkmGDs.js → TimeRangePicker-BCP5a7nZ.js} +1 -1
  25. package/dist/assets/TracesTab-Vf93xOCT.js +1 -0
  26. package/dist/assets/UsersTab-BTN0I3fC.js +1 -0
  27. package/dist/assets/VoiceTab-CBjiLYeR.js +1 -0
  28. package/dist/assets/{button-BKJGR5Ol.js → button-CW3POj4v.js} +1 -1
  29. package/dist/assets/{card-DqkRcTu-.js → card-DejnuKjD.js} +1 -1
  30. package/dist/assets/chevrons-up-down-CTpaTY5v.js +1 -0
  31. package/dist/assets/compatView-C2GqOCte.js +1 -0
  32. package/dist/assets/{confTabs-O2Cp4dmA.css → confTabs-C35Io1ep.css} +1 -1
  33. package/dist/assets/dispatchErrorInfo-DO-P1x_v.js +1 -0
  34. package/dist/assets/dist-0NlyORTv.js +44 -0
  35. package/dist/assets/{dist-ZqQ69Evn.js → dist-D34PU2vz.js} +1 -1
  36. package/dist/assets/{dist-95OTI9bl.js → dist-PBgCwwDJ.js} +1 -1
  37. package/dist/assets/{dist-DhHl81ET.js → dist-cyUFYUNU.js} +1 -1
  38. package/dist/assets/{highlighted-body-OFNGDK62-BPxnQExW.js → highlighted-body-OFNGDK62-DK7X_glc.js} +1 -1
  39. package/dist/assets/{index-BXEqld-9.css → index-B0GLWnUI.css} +1 -1
  40. package/dist/assets/index-Oefe3uVe.js +233 -0
  41. package/dist/assets/mermaid-GHXKKRXX-Ck3CTZBR.js +1 -0
  42. package/dist/assets/roleDescriptions-C_V0jprM.js +1 -0
  43. package/dist/assets/{table-DLKsfSfk.js → table-BytigxuJ.js} +1 -1
  44. package/dist/assets/{tabs-DKM45Hda.js → tabs-j7vaNyRB.js} +1 -1
  45. package/dist/assets/x-C93RBiVN.js +1 -0
  46. package/dist/index.html +8 -8
  47. package/package.json +1 -1
  48. package/dist/assets/AccessTab-COq7DxyQ.js +0 -1
  49. package/dist/assets/AgentFilesTab-BCBc-AHt.js +0 -3
  50. package/dist/assets/AnomaliesTab-m9IxjmxZ.js +0 -1
  51. package/dist/assets/AuditTab-CZr_Z3up.js +0 -1
  52. package/dist/assets/BridgeTab-QOf_ucR7.js +0 -1
  53. package/dist/assets/ChatDefaultsTab-B7Mqnngr.js +0 -1
  54. package/dist/assets/DataTableShell-BNR4dned.js +0 -1
  55. package/dist/assets/FeedbacksTab-CMeaT0iV.js +0 -1
  56. package/dist/assets/FilesTab-D47jErat.js +0 -1
  57. package/dist/assets/GroupsTab-C6dQ4fcR.js +0 -1
  58. package/dist/assets/InstancesTab-CNbQEEuG.js +0 -1
  59. package/dist/assets/IntegrationsTab-wKZXu73o.js +0 -1
  60. package/dist/assets/KpiTab-1ubQWe6V.js +0 -1
  61. package/dist/assets/PreferencesTab-CA6BBGU1.js +0 -1
  62. package/dist/assets/PromptInjectionsTab-CP_2ciCW.js +0 -4
  63. package/dist/assets/RolesTab-IhPdQQ-S.js +0 -1
  64. package/dist/assets/ServiceAccountsTab-C8DPvLRM.js +0 -1
  65. package/dist/assets/SubAgentReportsTab-DVvQyQ5_.js +0 -1
  66. package/dist/assets/ThemeShowroom-BP2tlIBT.js +0 -1
  67. package/dist/assets/TracesTab-eVkFa3bo.js +0 -1
  68. package/dist/assets/UsersTab-D0ZH0Vhl.js +0 -1
  69. package/dist/assets/chevrons-up-down-Bsd62b-D.js +0 -1
  70. package/dist/assets/compatView-BB-Rf4gT.js +0 -1
  71. package/dist/assets/dispatchErrorInfo-Bc24slw2.js +0 -1
  72. package/dist/assets/dist-Dc3VNRsA.js +0 -44
  73. package/dist/assets/index-FBfe3CjA.js +0 -231
  74. package/dist/assets/mermaid-GHXKKRXX-CX8RTNkr.js +0 -1
  75. package/dist/assets/roleDescriptions-CnhwMy_T.js +0 -1
  76. package/dist/assets/x-BR_3jyrW.js +0 -1
@@ -0,0 +1 @@
1
+ import{O as e}from"./index-Oefe3uVe.js";export{e as Mermaid};
@@ -0,0 +1 @@
1
+ import{Fv as e,Iv as t,Lv as n,Nv as r,Pv as i}from"./dist-0NlyORTv.js";var a={pending:n,user:t,admin:e,observer:i,agent:r};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-Dc3VNRsA.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-0NlyORTv.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-Dc3VNRsA.js";import{t as d}from"./dist-95OTI9bl.js";import{_t as f,gt as p,ht as m}from"./index-FBfe3CjA.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-0NlyORTv.js";import{t as d}from"./dist-PBgCwwDJ.js";import{St as f,bt as p,xt as m}from"./index-Oefe3uVe.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-0NlyORTv.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-FBfe3CjA.js"></script>
45
+ <script type="module" crossorigin src="/assets/index-Oefe3uVe.js"></script>
46
46
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
47
- <link rel="modulepreload" crossorigin href="/assets/dist-Dc3VNRsA.js">
48
- <link rel="modulepreload" crossorigin href="/assets/dist-95OTI9bl.js">
49
- <link rel="modulepreload" crossorigin href="/assets/dist-ZqQ69Evn.js">
50
- <link rel="modulepreload" crossorigin href="/assets/dist-DhHl81ET.js">
51
- <link rel="modulepreload" crossorigin href="/assets/x-BR_3jyrW.js">
52
- <link rel="modulepreload" crossorigin href="/assets/button-BKJGR5Ol.js">
53
- <link rel="stylesheet" crossorigin href="/assets/index-BXEqld-9.css">
47
+ <link rel="modulepreload" crossorigin href="/assets/dist-0NlyORTv.js">
48
+ <link rel="modulepreload" crossorigin href="/assets/dist-PBgCwwDJ.js">
49
+ <link rel="modulepreload" crossorigin href="/assets/dist-D34PU2vz.js">
50
+ <link rel="modulepreload" crossorigin href="/assets/dist-cyUFYUNU.js">
51
+ <link rel="modulepreload" crossorigin href="/assets/x-C93RBiVN.js">
52
+ <link rel="modulepreload" crossorigin href="/assets/button-CW3POj4v.js">
53
+ <link rel="stylesheet" crossorigin href="/assets/index-B0GLWnUI.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.39.1",
3
+ "version": "0.41.0",
4
4
  "description": "Atrium — public, self-hostable, Convex-backed web chat UI for AI agent gateways (OpenClaw today, Hermes next). Ships an origin-agnostic static bundle (Convex URL injected at runtime via /config.json).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Cl as r,E as i,KA as a,LA as o,Sl as s,Tl as c,_l as l,bl as u,dl as d,fl as f,gl as p,hl as m,ml as h,pl as g,vl as _,wl as v,xl as y,yl as b}from"./dist-Dc3VNRsA.js";import{C as x,S,b as C,et as w,w as T,x as E}from"./index-FBfe3CjA.js";var D=t(e(),1);function O(e){return e===`user`?m():e===`all`?h():g({group:e.group})}function k(e){return e===`common`?f():e===`owner`?d():g({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=a(i.admin.listUsers,{}),[t,n]=(0,D.useState)(``),d=a(i.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:c()}),(0,A.jsxs)(C,{value:t,onValueChange:n,children:[(0,A.jsx)(x,{size:`sm`,"aria-label":v(),children:(0,A.jsx)(T,{placeholder:v()})}),(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:r()}):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:s()}),(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:y()}),d.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(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:u()}),d.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(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:p()}):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:b()}),d.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(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:_()}),d.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(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,Bo as o,Bt as s,Dt as c,E as l,Et as u,Fo as d,GA as f,Go as p,Gt as m,Ho as h,Ht as g,Io as _,Jo as v,Jt as y,KA as b,Ko as x,Kt as S,LA as C,Lo as w,Lt as T,Mo as E,No as D,Ot as O,Po as k,Qo as A,Qt as j,Ro as M,Rt as N,TT as ee,Tt as P,UA as F,Uo as I,Us as L,Ut as R,Vo as te,Vs as ne,Vt as z,Wo as B,Wt as V,Xo as re,Xt as H,Yo as ie,Yt as U,Zo as W,Zt as ae,as as oe,en as se,es as ce,is as le,jo as ue,kt as de,nn as fe,ns as pe,os as me,qo as he,qt as ge,rn as _e,rs as ve,tn as ye,ts as be,wt as xe,zA as G,zo as Se,zt as Ce}from"./dist-Dc3VNRsA.js";import{t as K}from"./button-BKJGR5Ol.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-FBfe3CjA.js";import{n as Ge,t as Ke}from"./curation-CQksaIbm.js";import{i as qe}from"./compatView-BB-Rf4gT.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=b(l.me.getMe,{host:Be}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),a=b(l.admin.listInstances,e!==void 0&&t?{}:`skip`),[o,s]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!t||!a||a.length===0||(!o||!a.some(e=>e.name===o))&&s(a[0].name)},[t,a,o]);let c=b(l.agents.listAgentsForInstance,t&&o?{instanceName:o}:`skip`),u=b(l.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),d=(0,Y.useMemo)(()=>{if(e!==void 0){if(t)return o===null||c===void 0?a!==void 0&&a.length===0?[]:void 0:c.agents.map(e=>({instanceName:o,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(u!==void 0)return u.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,o,c,a,u]),[f,p]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!d||d.length===0||(!f||!d.some(e=>$(e)===f))&&p($(d[0]))},[d,f]);let m=d?.find(e=>$(e)===f)??null,h=F(l.agentFiles.listAgentFiles),[g,_]=(0,Y.useState)({status:`idle`}),y=m?.instanceName??null,x=m?.agentId??null,S=b(l.compat.forInstance,n&&y!==null?{instanceName:y}:`skip`),w=n&&y!==null?Ue(S,`agentFiles`):null,T=w===null?!1:w===`loading`?null:w.blocked,E=(0,Y.useCallback)(async()=>{if(!(y===null||x===null)){_({status:`loading`});try{_({status:`done`,files:(await h({instanceName:y,agentId:x})).files})}catch{_({status:`error`})}}},[h,y,x]);(0,Y.useEffect)(()=>{T===!1&&E()},[E,T]);let[D,O]=(0,Y.useState)(null),k=b(l.agentFileCuration.listCurations,t&&y!==null&&x!==null?{instanceName:y,agentId:x}:`skip`),M=b(l.agentFileCuration.curationSettings,t&&y!==null?{instanceName:y}:`skip`),N=F(l.agentFileCuration.requestCuration),[ee,P]=(0,Y.useState)(null),[I,L]=(0,Y.useState)(null),{toast:R}=q(),te=(0,Y.useMemo)(()=>{let e=new Map;for(let t of k??[])e.has(t.name)||e.set(t.name,t);return e},[k]),z=(0,Y.useCallback)(async e=>{if(!(y===null||x===null)){P(e);try{let t=await N({instanceName:y,agentId:x,name:e,trigger:`manual`});t.ok?R({title:se(),variant:`success`}):R({title:i({reason:t.reason??`unknown`}),variant:`error`})}catch{R({title:j(),variant:`error`})}finally{P(null)}}},[N,y,x,R]),B=G(),V=(0,Y.useMemo)(()=>new Intl.NumberFormat(B,{maximumFractionDigits:0}),[B]);return e===void 0||d===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:me()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(a?.length??0)>1?(0,Q.jsxs)(Ne,{value:o??``,onValueChange:e=>s(e),children:[(0,Q.jsx)(Te,{size:`sm`,"aria-label":oe(),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,d.length>0?(0,Q.jsxs)(Ne,{value:f??``,onValueChange:e=>p(e),children:[(0,Q.jsx)(Te,{size:`sm`,"aria-label":le(),children:(0,Q.jsx)(Ve,{})}),(0,Q.jsx)(He,{children:d.map(e=>(0,Q.jsx)(ke,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ve()})]}),m===null?null:w===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):w!==null&&w.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(J,{size:14,"aria-hidden":!0}),` `,qe(w.gatewayVersion)]}):g.status===`loading`||g.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):g.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[be(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void E(),children:ne()})]}):g.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:pe()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:g.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:ce()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:r({size:Z(e.size,B)})}),(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:A({pct:V.format(n)})}),i?(0,Q.jsx)(J,{size:14,className:`oc-afiles__warn`,"aria-label":W()}):(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:()=>O(e),children:t?ie():v()}),t&&!e.missing?(0,Q.jsx)(nt,{curatable:Ke.includes(e.name),size:e.size??0,budget:M?.budgetChars??null,enabled:M?.enabled??!1,curation:te.get(e.name)??null,inFlight:ee===e.name,onCurate:()=>void z(e.name),onReview:e=>L(e)}):null]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:re({used:Z(Ze(g.files),B),total:Z(Je,B),pct:V.format(Xe(Ze(g.files)))})})]}),D&&m?(0,Q.jsx)(rt,{instanceName:m.instanceName,agentId:m.agentId,name:D.name,isAdmin:t,onClose:()=>O(null),onSaved:()=>void E()}):null,I?(0,Q.jsx)(it,{curationId:I,onClose:()=>L(null),onApplied:()=>{L(null),E()}}):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:fe()}):a||i?.status===`dispatched`||i?.status===`applying`?(0,Q.jsx)(Pe,{variant:`outline`,className:`oc-afiles__curate-status`,children:ye()}):e&&r&&n!==null&&Ge(t,n)?(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__curate`,onClick:o,children:_e()}):null}function rt({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:i,onSaved:a}){let s=F(l.agentFiles.getAgentFile),c=F(l.agentFiles.setAgentFile),u=q(),[f,m]=(0,Y.useState)(null),[g,v]=(0,Y.useState)(!1),[y,b]=(0,Y.useState)(``),[S,T]=(0,Y.useState)(!1),[O,A]=(0,Y.useState)(!1),[j,N]=(0,Y.useState)(!1),[P,R]=(0,Y.useState)(!1),z=(0,Y.useCallback)(async r=>{v(!1);try{let i=await s({instanceName:e,agentId:t,name:n});m({content:i.content,updatedAtMs:i.updatedAtMs}),r||b(i.content),N(!1)}catch{v(!0)}},[s,e,t,n]);(0,Y.useEffect)(()=>{z(!1)},[z]);async function V(){if(f!==null){A(!0),R(!1);try{await c({instanceName:e,agentId:t,name:n,content:y,baseUpdatedAtMs:f.updatedAtMs??void 0}),u.success(te({name:n})),a(),await z(!1)}catch(e){et(e)?N(!0):R(!0)}finally{A(!1)}}}let re=f!==null&&y!==f.content,H=(0,Y.useMemo)(()=>f===null?null:$e(f.content,y),[f,y]),ie=y.length>X,U=G(),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:he({name:n})}),(0,Q.jsxs)(Fe,{children:[x({agent:t,instance:e}),r?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,p()]})]})]}),g?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[Se(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void z(!1),children:ne()})]}):f===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:y,readOnly:!r,spellCheck:!1,onChange:e=>b(e.target.value),"aria-label":he({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:B()}),j?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[M(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void z(!0),children:w()})]}):null,P?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:o()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${ie?` is-over`:``}`,children:I({count:W.format(y.length),max:W.format(X)})}),r?(0,Q.jsx)(K,{size:`sm`,disabled:!re||O||j,onClick:()=>T(!0),children:O?L():h()}):null]})]}),(0,Q.jsx)(De,{open:S,onOpenChange:T,children:(0,Q.jsxs)(we,{children:[(0,Q.jsxs)(Ae,{children:[(0,Q.jsx)(Me,{children:_({name:n})}),(0,Q.jsx)(je,{children:d({agent:t})})]}),H?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:k({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:D()}),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:E()}),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:ee()}),(0,Q.jsx)(Oe,{onClick:()=>void V(),children:ue()})]})]})})]})})}function it({curationId:e,onClose:t,onApplied:n}){let r=b(l.agentFileCuration.getProposal,{curationId:e}),i=F(l.agentFileCuration.approveCuration),o=f(l.agentFileCuration.rejectCuration),{toast:d}=q(),[p,h]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(!1),[x,w]=(0,Y.useState)(``),E=G(),D=(0,Y.useMemo)(()=>r?$e(r.beforeContent,r.proposedContent):null,[r]);async function k(){h(`approve`);try{let t=await i({curationId:e});t.ok?(d({title:ae(),variant:`success`}),n()):d({title:t.reason===`conflict`?U():y({reason:t.reason??`unknown`}),variant:`error`})}catch{d({title:j(),variant:`error`})}finally{h(null)}}async function A(n){h(`reject`);try{let r=x.trim();(await o({curationId:e,...r?{comment:r}:{},relaunch:n})).ok?d({title:n?P():H(),variant:`success`}):d({title:m(),variant:`error`}),t()}catch{d({title:j(),variant:`error`})}finally{h(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?ge({name:r.name}):C()}),(0,Q.jsx)(Fe,{children:S()})]}),r===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:C()}):r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`oc-afiles__review-sizes`,children:[V({before:Z(r.beforeSize,E),after:Z(r.proposedSize,E)}),r.overBudget?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsx)(J,{size:13,"aria-hidden":!0}),` `,R()]}):null]}),D?(0,Q.jsx)(`p`,{className:`oc-afiles__review-diff`,children:g({added:D.added,removed:D.removed})}):null,r.feedback?(0,Q.jsx)(`p`,{className:`oc-afiles__review-feedback`,children:xe({feedback:r.feedback})}):null,D&&D.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__review-removed`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:T()}),(0,Q.jsx)(`ul`,{children:D.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:N()}),(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:z()}),(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:a()}),(0,Q.jsx)(`textarea`,{id:`curation-reject-comment`,className:`oc-afiles__reject-textarea`,rows:3,placeholder:de(),value:x,onChange:e=>w(e.target.value)}),(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`ghost`,onClick:()=>v(!1),disabled:p!==null,children:O()}),(0,Q.jsx)(K,{variant:`outline`,onClick:()=>void A(!1),disabled:p!==null,children:p===`reject`?L():c()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void A(!0),disabled:p!==null,children:p===`reject`?L():u()})]})]}):(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`outline`,onClick:()=>v(!0),disabled:p!==null||r==null,children:s()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void k(),disabled:p!==null||r==null,children:p===`approve`?L():Ce()})]})]})})}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 te,E as a,E_ as o,GA as ne,Gg as s,Jg as c,KA as l,Kg as u,M_ as d,N_ as f,O_ as re,Qg as ie,S_ as ae,T_ as oe,Xg as se,Yg as ce,Zg as le,__ as ue,a_ as de,b_ as p,c_ as m,d_ as h,e_ as g,f_ as _,g_ as fe,h_ as pe,i_ as me,j_ as v,k_ as he,l_ as ge,m_ as _e,n_ as y,o_ as b,p_ 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-Dc3VNRsA.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-FBfe3CjA.js";import{n as H}from"./TimeRangePicker-CQKkmGDs.js";import{t as xe}from"./FilterBar-DTgQOIHy.js";import{t as Se}from"./DataTableShell-BNR4dned.js";import{t as U}from"./dispatchErrorInfo-Bc24slw2.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():v()}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??``,s=e.status===q?K:e.status,c=e.severity??K,u=e.kind??K,[d,f]=(0,W.useState)(K),v=ye(e.from,e.to),{from:S,to:U}=H(v),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=ne(a.anomalies.resolveAnomaly),Ie=(l(a.me.getMe,{host:be})?.permissions??[]).includes(`admin.manage`),$=l(a.anomalies.listAnomalies,{limit:Oe,filter:{q:n||void 0,from:S,to:U,anomalyStatus:s===K?void 0:s,severity:c===K?void 0:c,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!==``||s!==`open`||c!==K||d!==K||u!==K||v.kind!==`relative`||v.from!==De.from;function ze(){f(K),t({search:{status:`open`},replace:!0})}async function Be(e){if(await Fe({title:i(),description:(0,G.jsxs)(G.Fragment,{children:[he(),` `,(0,G.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,re(),` `,(0,G.jsx)(`strong`,{children:te()}),`.`,` `,o()]}),confirmLabel:oe()}))try{await Q({anomalyId:e._id,status:`resolved`}),Z.success(O(),e.kind)}catch(e){Z.error(ee(),e)}}async function Ve(e){try{await Q({anomalyId:e._id,status:`acknowledged`}),Z.success(ae(),e.kind)}catch(e){Z.error(k(),e)}}return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`p`,{className:`oc-admin__hint`,children:[p(),` `,(0,G.jsx)(`strong`,{children:A()}),` `,D(),` `,(0,G.jsx)(`strong`,{children:ue()}),` `,fe(),` `,(0,G.jsx)(`strong`,{children:pe()}),` `,_e(),` `,(0,G.jsx)(`span`,{className:`oc-filter__window`,children:x()})]}),(0,G.jsxs)(xe,{q:n,onQChange:J,searchPlaceholder:_(),timeRange:v,onTimeRangeChange:Pe,onReset:ze,canReset:Re,children:[(0,G.jsxs)(R,{value:s,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:h()}),Ce.map(e=>(0,G.jsx)(L,{value:e.value,children:we(e.value)},e.value))]})]}),(0,G.jsxs)(R,{value:c,onValueChange:X,children:[(0,G.jsx)(M,{size:`sm`,className:`w-36`,children:(0,G.jsx)(B,{placeholder:E()})}),(0,G.jsxs)(V,{children:[(0,G.jsx)(L,{value:K,children:ge()}),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:m()})}),(0,G.jsxs)(V,{children:[(0,G.jsx)(L,{value:K,children:w()}),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:b()})}),(0,G.jsxs)(V,{children:[(0,G.jsx)(L,{value:K,children:de()}),Le.map(e=>(0,G.jsx)(L,{value:e,children:e},e))]})]})]}),(0,G.jsx)(Se,{title:me(),rows:$,emptyHint:s===`open`?C():y(),rowActions:e=>Ie&&e.status===`open`?[{label:T(),onSelect:()=>void Be(e)},{label:g(),onSelect:()=>void Ve(e)}]:[],columns:[{header:r(),cell:e=>(0,G.jsx)(`span`,{className:`oc-traces__time`,children:j(e.at)}),sort:e=>e.at},{header:b(),cell:e=>(0,G.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:E(),cell:e=>(0,G.jsx)(Ae,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:ie(),cell:e=>(0,G.jsx)(je,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:m(),cell:e=>(0,G.jsx)(z,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:le(),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:ce(),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:[`↗ `,c()]}):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:[`↗ `,c()]}):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:S()}):e===`acknowledged`?(0,G.jsx)(z,{variant:`secondary`,children:u()}):(0,G.jsx)(z,{variant:`outline`,children:s()})}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,KA as u,Lv as d,Mv as f,Nv as p,Ov as m,Pv as h,Q as g,Rv as _,Tv as v,Z as y,et as b,jv as x,kv as S,nt as C,tt as w,wv as T}from"./dist-Dc3VNRsA.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-FBfe3CjA.js";import{n as ee}from"./TimeRangePicker-CQKkmGDs.js";import{t as z}from"./FilterBar-DTgQOIHy.js";import{t as B}from"./AdvancedFilter-DGS0QV-g.js";import{t as V}from"./DataTableShell-BNR4dned.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:w()},{value:`targetLabel`,label:b()},{value:`impersonated`,label:r()},{value:`resource`,label:g()},{value:`resourceId`,label:y()}];function q(){let e=k({from:`/settings/audit`}),t=O({from:`/settings/audit`}),n=e.q??``,r=e.action??G,g=e.impersonated??G,y=e.resource??G,b=F(e.from,e.to),C=(0,H.useMemo)(()=>P(e.adv),[e.adv]),{from:w,to:I}=ee(b),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}),$=u(o.admin.listAudit,{filter:{q:n||void 0,from:w,to:I,action:r===G?void 0:r,resource:y===G?void 0:y,impersonated:g===G?void 0:g===`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||g!==G||y!==G||C.length>0||b.kind!==`relative`||b.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:[_(),` `,(0,U.jsx)(`span`,{className:`oc-filter__window`,children:d()})]}),(0,U.jsxs)(z,{q:n,onQChange:q,searchPlaceholder:l(),timeRange:b,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:c()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(A,{value:G,children:h()}),te.map(e=>(0,U.jsx)(A,{value:e,children:e},e))]})]}),(0,U.jsxs)(M,{value:g,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:p()}),(0,U.jsx)(A,{value:`yes`,children:f()}),(0,U.jsx)(A,{value:`no`,children:x()})]})]}),(0,U.jsxs)(M,{value:y,onValueChange:X,children:[(0,U.jsx)(D,{size:`sm`,className:`w-40`,children:(0,U.jsx)(L,{placeholder:i()})}),(0,U.jsxs)(R,{children:[(0,U.jsx)(A,{value:G,children:S()}),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:m(),rows:$,emptyHint:a(),columns:[{header:s(),cell:e=>E(e.at),sort:e=>e.at},{header:c(),cell:e=>e.action,sort:e=>e.action},{header:v(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:T(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:i(),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,GA as p,Gm as m,Gp as h,Hm as ee,Hp as g,Im as te,Ip as _,Jp as v,KA as y,Km as b,Kp as x,Lm as ne,Lp as re,Mm as ie,Mp as ae,Nm as oe,Np as se,Op as ce,Pp as le,Qp as ue,Rm as de,Rp as fe,Sp as pe,Tp as me,UA as he,Um as ge,Up as _e,Vm as ve,Vp as ye,Wp as be,Xa as xe,Xp as Se,Yp as Ce,Zp as we,_p as S,am as Te,ao as Ee,bp as De,cm as Oe,co as ke,do as Ae,em as je,eo as Me,fo as Ne,gp as C,hp as w,im as Pe,io as Fe,jp as Ie,kp as T,lm as Le,lo as Re,nm as ze,no as Be,om as Ve,oo as He,po as Ue,qp as We,rm as Ge,ro as Ke,sm as qe,so as Je,tm as Ye,to as Xe,um as Ze,uo as Qe,vp as $e,wp as et,xp as tt,yp as nt,zm as rt,zp as it}from"./dist-Dc3VNRsA.js";import{i as E,r as at}from"./dist-95OTI9bl.js";import{t as ot}from"./chevrons-up-down-Bsd62b-D.js";import{i as st,n as D,o as ct,r as lt,s as ut}from"./FieldLabel-DMW_YpQf.js";import{t as O}from"./button-BKJGR5Ol.js";import{A as k,C as A,Et as dt,Ft as ft,G as pt,K as mt,Nt as ht,P as gt,Pt as _t,S as j,b as M,et as N,it as vt,j as P,m as yt,nt as bt,ot as xt,p as St,q as Ct,rt as wt,st as Tt,tt as F,ut as Et,vt as I,w as L,x as R,xt as Dt}from"./index-FBfe3CjA.js";import{r as Ot}from"./locales-CPjguROj.js";import{a as kt,i as At,n as jt,o as z,r as B,t as Mt}from"./table-DLKsfSfk.js";import{t as Nt}from"./FilterBar-DTgQOIHy.js";import{a as V,n as Pt,o as H,r as U,s as Ft,t as It}from"./compatView-BB-Rf4gT.js";import{t as W}from"./dispatchErrorInfo-Bc24slw2.js";var Lt=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`}]]),Rt=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`}]]),G=t(e(),1);function K(e){return e.filter(e=>e.state===`error`)}function zt(e){return e.reachable&&K(e.targets).length===0}function Bt(e){return e.state===`error`&&e.lastErrorCode!==null}function Vt(e){return!!e.lastDownstreamRejectCode}function q(e){return e.kind??`openclaw`}function Ht(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function Ut(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,q(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(q(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return Ht(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>q(e)===r)}))}function Wt(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var J=`__all__`,Y={q:``,state:J,instance:J,version:J},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 H(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)=>H(e,t)??Z(e,t))}var Q=n();function $t({connections:e,displayByInstance:t}){let[n,r]=(0,G.useState)(Y),[a,o]=(0,G.useState)(null),c=(0,G.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount,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,G.useMemo)(()=>Xt(c),[c]),f=(0,G.useMemo)(()=>Zt(c),[c]),p=(0,G.useMemo)(()=>Qt(c),[c]),m=(0,G.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:se()}):(0,Q.jsxs)(`div`,{className:`oc-conn`,children:[(0,Q.jsxs)(Nt,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:i(),onReset:()=>r(Y),canReset:Gt(n),children:[(0,Q.jsxs)(M,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Q.jsx)(A,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(L,{placeholder:ce()})}),(0,Q.jsxs)(R,{children:[(0,Q.jsx)(j,{value:J,children:T()}),u.map(e=>(0,Q.jsx)(j,{value:e,children:tn(e)},e))]})]}),(0,Q.jsxs)(M,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Q.jsx)(A,{size:`sm`,className:`w-40`,children:(0,Q.jsx)(L,{placeholder:l()})}),(0,Q.jsxs)(R,{children:[(0,Q.jsx)(j,{value:J,children:T()}),f.map(e=>(0,Q.jsx)(j,{value:e.name,children:e.label},e.name))]})]}),(0,Q.jsxs)(M,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Q.jsx)(A,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(L,{placeholder:d()})}),(0,Q.jsxs)(R,{children:[(0,Q.jsx)(j,{value:J,children:T()}),p.map(e=>(0,Q.jsx)(j,{value:e,children:e},e))]})]})]}),m.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:me()}):(0,Q.jsxs)(Mt,{className:`oc-conn__table`,children:[(0,Q.jsx)(kt,{children:(0,Q.jsxs)(z,{children:[(0,Q.jsx)($,{label:et(),sortKey:`target`,sort:a,onSort:h}),(0,Q.jsx)($,{label:s(),sortKey:`state`,sort:a,onSort:h}),(0,Q.jsx)($,{label:pe(),sortKey:`instance`,sort:a,onSort:h}),(0,Q.jsx)($,{label:tt(),sortKey:`host`,sort:a,onSort:h}),(0,Q.jsx)($,{label:De(),sortKey:`version`,sort:a,onSort:h}),(0,Q.jsx)(At,{children:nt()}),(0,Q.jsx)($,{label:$e(),sortKey:`lastOk`,sort:a,onSort:h})]})}),(0,Q.jsx)(jt,{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)(At,{"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)(at,{size:13,"aria-hidden":!0}):(0,Q.jsx)(E,{size:13,"aria-hidden":!0}):(0,Q.jsx)(ot,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function en({r:e}){let t=Bt(e)?W(e.lastErrorCode):null,n=Vt(e)?W(e.lastDownstreamRejectCode):null;return(0,Q.jsxs)(G.Fragment,{children:[(0,Q.jsxs)(z,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Q.jsx)(B,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Q.jsx)(B,{children:(0,Q.jsx)(nn,{state:e.state})}),(0,Q.jsx)(B,{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)(B,{children:(0,Q.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Q.jsx)(B,{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)(B,{children:(0,Q.jsx)(`span`,{className:`oc-conn__stats`,children:ae({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Q.jsx)(B,{children:e.lastOkAt?(0,Q.jsx)(`span`,{className:`oc-traces__mono`,children:P(e.lastOkAt)}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Q.jsx)(z,{className:`oc-conn__detail-row`,children:(0,Q.jsxs)(B,{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?` · ${P(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:[Ie({label:n.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${P(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function tn(e){return e===`connected`?S():e===`error`?C():w()}function nn({state:e}){return e===`connected`?(0,Q.jsx)(N,{variant:`secondary`,children:S()}):e===`error`?(0,Q.jsx)(N,{variant:`destructive`,children:C()}):(0,Q.jsx)(N,{variant:`outline`,children:w()})}function rn(){return y(u.bridgeHealth.getBridgeHealth,{})}function an(){let e=rn(),t=y(u.compat.getBridgeCompat,{}),n=y(u.me.getMe,{host:Et})?.role===`admin`,r=y(u.admin.listInstances,n?{}:`skip`),i=y(u.agents.usageForInstances,n?{}:`skip`),a=ft(),o=()=>void a({to:`/settings/anomalies`,search:{status:`open`}}),s=Ut(e?e.targets:[],t?t.targets:[],r??[]),c=t?.compat??null,l=t===void 0?`loading`:t===null?`nodata`:`ready`,d=c!==null&&Pt(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:Se()}),i&&i.length>0?(0,Q.jsxs)(`section`,{className:`oc-bridge__usage`,children:[(0,Q.jsx)(`h3`,{className:`oc-bridge__usage-title`,children:Ce()}),i.map(e=>{let t=yt(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:xe()}):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:V(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:[` `,Qe({build:t.buildVersion??`?`})]}):null,` · `,Re(),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?ke():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:g()});if(e===null)return(0,Q.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:ye()});let s=K(e.targets),c=!e.reachable,l=zt(e),u=l?`ok`:`error`,d=k(e.checkedAt),p=e.startedAt==null?null:k(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)(ht,{size:22}):c?(0,Q.jsx)(Rt,{size:22}):(0,Q.jsx)(I,{size:22})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__title`,children:l?o():c?it():fe({count:s.length})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(Lt,{size:12,"aria-hidden":!0}),` `,re({time:d})]}),p?(0,Q.jsx)(`span`,{children:_({time:p})}):null,a]}),c?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:W(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:f()})]})}function sn({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a,protocol:o}){let s=r?Ft(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:It(t,e,r)})}let d=l.map(e=>e.state),f=d.includes(`beyond`)?`beyond`:d.length>0&&d.every(e=>e===`supported`)?`supported`:null,[p,m]=(0,G.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)(Dt,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Q.jsx)(`span`,{className:`oc-bridge-provider__name`,children:Wt(e)}),f?(0,Q.jsx)(N,{variant:f===`beyond`?`destructive`:`secondary`,children:U(f)}):null]}),(0,Q.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:Ue()}),(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":p,onClick:()=>m(e=>!e),children:[p?(0,Q.jsx)(E,{size:13,"aria-hidden":!0}):(0,Q.jsx)(_t,{size:13,"aria-hidden":!0}),le({count:t.length})]}),p?(0,Q.jsx)($t,{connections:t,displayByInstance:c}):null]})}function cn({protocol:e}){let[t,n]=(0,G.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:[v(),i.length>0?(0,Q.jsx)(N,{variant:`destructive`,children:x({count:i.length})}):(0,Q.jsx)(N,{variant:`secondary`,children:We()})]}),(0,Q.jsxs)(`p`,{className:`oc-admin__hint`,children:[h({version:e.vendoredVersion}),r?` · `+be({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)(E,{size:13,"aria-hidden":!0}):(0,Q.jsx)(_t,{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:g()}):t===`nodata`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ne()}):(0,Q.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Je()}),r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:He()}):(0,Q.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__label`,children:Ee()}),e&&e.range!==null?(0,Q.jsx)(`span`,{children:Fe({min:e.range.min,max:e.range.maxValidated})}):(0,Q.jsx)(`span`,{children:ke()}),e?(0,Q.jsx)(pn,{versions:e.validatedVersions}):null]}),i.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Me()}):(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:V(e.version)}),(0,Q.jsx)(N,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:U(e.state)})]},e.instanceName))})]})}function un({instance:e,onClose:t}){return(0,Q.jsx)(bt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Q.jsxs)(wt,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Q.jsxs)(xt,{children:[(0,Q.jsx)(Tt,{children:b({instance:e.displayName??e.name})}),(0,Q.jsx)(vt,{children:m()})]}),(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)(ht,{"aria-hidden":!0}):(0,Q.jsx)(I,{"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,` — `,r()]}):null}function fn({instance:e,onClose:t}){let n=p(u.admin.upsertInstanceConfig),r=he(u.bridge.validateMediaPaths),i=gt(),o=Ot(e.config?.contentLocale,void 0),[s,c]=(0,G.useState)(()=>st(e.config??{},o)),[l,d]=(0,G.useState)(!1),[f,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(null),_=s.inboundMediaMode===`shared-fs`,v=s.mediaMode===`shared-fs`,y=_||v;async function b(){m(!0),g(null);try{g(await r({instanceName:e.name,inboundMediaMode:s.inboundMediaMode,mediaMode:s.mediaMode}))}catch(e){i.error(Pe(),e)}finally{m(!1)}}async function x(){d(!0);try{let r=e.config??{};await n({instanceId:e._id,config:lt(s,r,o)}),t()}catch(e){i.error(de(),e)}finally{d(!1)}}return(0,Q.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Q.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:ge(),help:ne()}),(0,Q.jsxs)(M,{value:s.mediaMode,onValueChange:e=>c({...s,mediaMode:e}),children:[(0,Q.jsx)(A,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(L,{})}),(0,Q.jsx)(R,{children:ut.map(e=>(0,Q.jsx)(j,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:ee(),help:te()}),(0,Q.jsxs)(M,{value:s.inboundMediaMode,onValueChange:e=>c({...s,inboundMediaMode:e}),children:[(0,Q.jsx)(A,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(L,{})}),(0,Q.jsx)(R,{children:ct.map(e=>(0,Q.jsx)(j,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:ve(),help:oe()}),(0,Q.jsx)(F,{type:`number`,min:1,max:4096,className:`w-full`,value:s.mediaMaxMb,onChange:e=>c({...s,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),y&&(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[_&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:Ze(),help:Le()}),(0,Q.jsx)(F,{className:`w-full`,spellCheck:!1,value:s.inboundAgentMount,onChange:e=>c({...s,inboundAgentMount:e.target.value})})]}),v&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(D,{label:Oe(),help:qe()}),(0,Q.jsx)(F,{className:`w-full`,spellCheck:!1,value:s.outboundAgentMount,onChange:e=>c({...s,outboundAgentMount:e.target.value})})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(St,{checked:s.rehydration,onCheckedChange:e=>c({...s,rehydration:e===!0})}),(0,Q.jsx)(D,{label:a(),help:ie()})]}),y&&h!==null&&(0,Q.jsx)(`div`,{className:`oc-bridge-config__check`,children:h.reachable?!h.inbound&&!h.outbound?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(I,{"aria-hidden":!0}),we({reason:h.reason??`?`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(dn,{label:ze(),result:h.inbound}),(0,Q.jsx)(dn,{label:Ye(),result:h.outbound}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ge()})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(I,{"aria-hidden":!0}),ue()]})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[y&&(0,Q.jsxs)(O,{variant:`outline`,size:`sm`,onClick:()=>void b(),disabled:f,children:[f?(0,Q.jsx)(dt,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,f?Te():Ve()]}),(0,Q.jsx)(O,{size:`sm`,onClick:()=>void x(),disabled:l,children:rt()})]})]})})}function pn({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Q.jsxs)(pt,{children:[(0,Q.jsx)(Ct,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?Ke():Be({count:e.length}),(0,Q.jsx)(E,{size:13,"aria-hidden":!0})]})}),(0,Q.jsxs)(mt,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Q.jsx)(`p`,{className:`oc-compat__versions-title`,children:Xe()}),(0,Q.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Q.jsx)(N,{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{Co as r,Do as i,E as a,Eo as o,GA as s,Gn as c,Hn as l,Is as u,Jn as d,KA as f,Kn as p,LA as m,Ls as h,Oo as g,So as _,TT as v,To as y,UA as b,Un as x,Us as S,Vs as ee,Wm as te,Wn as C,_o as w,as as T,bo as ne,go as re,ho as ie,ko as ae,mo as oe,qn as E,vo as D,wo as se,xo as ce,yo as O}from"./dist-Dc3VNRsA.js";import{t as k}from"./button-BKJGR5Ol.js";import{B as A,C as j,H as le,L as ue,P as de,R as fe,S as pe,U as me,V as M,W as N,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 B,z as _e}from"./index-FBfe3CjA.js";import{i as ve}from"./compatView-BB-Rf4gT.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=s(a.admin.upsertInstanceConfig),n=e.config?.curationEnabled===!0,i=typeof e.config?.curationBudgetChars==`number`?e.config.curationBudgetChars:null,[o,l]=(0,V.useState)(n),[u,d]=(0,V.useState)(i===null?``:String(i)),[f,m]=(0,V.useState)(`idle`);(0,V.useEffect)(()=>{l(n),d(i===null?``:String(i)),m(`idle`)},[e._id,n,i]);let h=u.trim(),g=h===``?null:/^\d+$/.test(h)?Number.parseInt(h,10):NaN,_=!o||g===null||Number.isInteger(g)&&g>=4e3&&g<=6e4,v=o!==n||(g??null)!==i;async function y(){m(`saving`);try{let n={...e.config??{}};n.curationEnabled=o,!o||g===null||Number.isNaN(g)?delete n.curationBudgetChars:n.curationBudgetChars=g,await t({instanceId:e._id,config:n}),m(`done`)}catch{m(`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:o,onCheckedChange:e=>l(e===!0),"aria-label":p()}),(0,H.jsx)(`span`,{className:`oc-cdefaults__label`,children:p()})]}),(0,H.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,H.jsx)(R,{type:`number`,min:4e3,max:6e4,step:1e3,placeholder:`20000`,value:u,onChange:e=>d(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!_,"aria-label":c(),disabled:!o}),(0,H.jsx)(k,{size:`sm`,disabled:!v||!_||f===`saving`,onClick:()=>void y(),children:f===`saving`?S():r()})]}),_?null:(0,H.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:C()}),f===`done`?(0,H.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:O()}):null,f===`error`?(0,H.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:D()}):null,(0,H.jsx)(`p`,{className:`oc-cdefaults__help`,children:x()})]})}function Se({instance:e}){let t=s(a.admin.upsertInstanceConfig),n=typeof e.config?.summarizeThresholdChars==`number`?e.config.summarizeThresholdChars:null,[i,o]=(0,V.useState)(n===null?``:String(n)),[c,u]=(0,V.useState)(`idle`);(0,V.useEffect)(()=>{o(n===null?``:String(n)),u(`idle`)},[e._id,n]);let f=i.trim(),p=f===``?null:/^\d+$/.test(f)?Number.parseInt(f,10):NaN,m=p===null||Number.isInteger(p)&&p>=1e3&&p<=2e5,h=(p??null)!==n;async function g(){u(`saving`);try{let n={...e.config??{}};p===null?delete n.summarizeThresholdChars:n.summarizeThresholdChars=p,await t({instanceId:e._id,config:n}),u(`done`)}catch{u(`error`)}}return(0,H.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,H.jsx)(`span`,{className:`oc-cdefaults__label`,children:d()}),(0,H.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,H.jsx)(R,{type:`number`,min:1e3,max:2e5,step:1e3,placeholder:`8000`,value:i,onChange:e=>o(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!m}),(0,H.jsx)(k,{size:`sm`,disabled:!h||!m||c===`saving`,onClick:()=>void g(),children:c===`saving`?S():r()})]}),m?null:(0,H.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:l()}),c===`done`?(0,H.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:O()}):null,c===`error`?(0,H.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:D()}):null,(0,H.jsx)(`p`,{className:`oc-cdefaults__help`,children:E()})]})}function U(){let e=b(a.agentFiles.getChatDefaults),t=b(a.agentFiles.setChatDefaults),n=b(a.agentFiles.clearChatDefaults),s=de(),[c,l]=(0,V.useState)({status:`loading`}),[d,p]=(0,V.useState)({thinkingDefault:null,fastModeDefault:null}),[x,C]=(0,V.useState)(!1),[E,L]=(0,V.useState)(!1),R=f(a.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=f(a.compat.forInstance,U?{instanceName:U}:`skip`),K=U?B(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;l({status:`loading`});try{let n=be(await e(J));if(Y.current!==t)return;l({status:`done`,current:n}),p(n)}catch{if(Y.current!==t)return;l({status:`error`})}},[e,J]);(0,V.useEffect)(()=>{q===!1&&(G&&!U||X())},[X,q,G,U]);let Z=c.status===`done`?c.current:null,Q=Z!==null&&d.thinkingDefault!==null&&d.thinkingDefault!==Z.thinkingDefault,$=Z!==null&&d.fastModeDefault!==null&&d.fastModeDefault!==Z.fastModeDefault,Te=Q||$;async function Ee(){L(!0);try{await t({...J,...Q?{thinkingDefault:d.thinkingDefault}:{},...$?{fastModeDefault:d.fastModeDefault}:{}}),s.success(O()),await X()}catch(e){s.error(D(),e)}finally{L(!1)}}async function De(){L(!0);try{await n({...J}),s.success(ne()),await X()}catch(e){s.error(D(),e)}finally{L(!1)}}let Oe=(0,V.useMemo)(()=>ye.map(e=>({id:e,label:I(e)})),[]),ke=(0,V.useMemo)(()=>[{id:`fast`,label:h()},{id:`standard`,label:u()}],[]);return(0,H.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:ae()}),G&&U?(0,H.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,H.jsx)(`span`,{className:`oc-cdefaults__label`,children:T()}),(0,H.jsxs)(P,{value:U,onValueChange:e=>W(e),disabled:E,children:[(0,H.jsx)(j,{size:`sm`,"aria-label":T(),children:(0,H.jsx)(he,{})}),(0,H.jsx)(ge,{children:(R??[]).map(e=>(0,H.jsx)(pe,{value:e.name,children:e.name},e.name))})]})]}):null,Ce?(0,H.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:te()}):K===`loading`?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):K.blocked?(0,H.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,H.jsx)(z,{size:14,"aria-hidden":!0}),` `,ve(K.gatewayVersion)]}):c.status===`loading`?(0,H.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):c.status===`error`?(0,H.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[se(),` `,(0,H.jsx)(k,{variant:`outline`,size:`sm`,onClick:()=>void X(),children:ee()})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,H.jsx)(`span`,{className:`oc-cdefaults__label`,children:g()}),(0,H.jsx)(F,{options:Oe,value:d.thinkingDefault,onChange:e=>p({...d,thinkingDefault:e}),disabled:E}),(0,H.jsx)(`p`,{className:`oc-cdefaults__help`,children:i()})]}),(0,H.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,H.jsx)(`span`,{className:`oc-cdefaults__label`,children:o()}),(0,H.jsx)(F,{options:ke,value:d.fastModeDefault===null?null:d.fastModeDefault?`fast`:`standard`,onChange:e=>p({...d,fastModeDefault:e===`fast`}),disabled:E}),(0,H.jsx)(`p`,{className:`oc-cdefaults__help`,children:y()})]}),(0,H.jsxs)(`div`,{className:`oc-cdefaults__actions`,children:[(0,H.jsx)(k,{variant:`outline`,size:`sm`,disabled:E,onClick:()=>void De(),title:ce(),children:_()}),(0,H.jsx)(k,{size:`sm`,disabled:!Te||E,onClick:()=>C(!0),children:E?S():r()})]}),(0,H.jsx)(`p`,{className:`oc-cdefaults__note`,children:w()})]}),(()=>{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)(ue,{open:x,onOpenChange:C,children:(0,H.jsxs)(A,{children:[(0,H.jsxs)(me,{children:[(0,H.jsx)(N,{children:re()}),(0,H.jsx)(M,{children:ie()})]}),(0,H.jsxs)(le,{children:[(0,H.jsx)(_e,{children:v()}),(0,H.jsx)(fe,{onClick:()=>void Ee(),children:oe()})]})]})})]})}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,Hu as i,Ju as a,Ku as o,Uu as s,Wu as c,qu as l}from"./dist-Dc3VNRsA.js";import{i as u,r as d}from"./dist-95OTI9bl.js";import{t as f}from"./chevrons-up-down-Bsd62b-D.js";import{t as p}from"./button-BKJGR5Ol.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-FBfe3CjA.js";import{a as C,i as w,n as T,o as E,r as D,t as O}from"./table-DLKsfSfk.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=a(),bulkActions:F,emptyHint:I=l(),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:o()}):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":r(),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":i({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)??[],r=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":c(),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]}),r&&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{$b as r,$x as i,Ax as a,Bx as o,Cx as s,Dx as c,E as l,Ex as u,Fx as d,GA as f,Gx as p,Hx as ee,Ix as te,Jx as m,KA as h,Kx as g,Lx as _,Mx as ne,Nx as re,Ox as ie,Px as v,Qx as y,Rx as b,Sx as x,Tx as S,Ux as C,Vx as w,Wx as T,Xx as E,Yx as D,Zx as O,_x as k,ax as A,bx as j,cx as M,dx as N,eS as P,ex as F,fx as I,gx as L,hx as R,ix as z,jx as B,kx as V,ln as H,lx as U,mx as ae,nx as W,ox as G,px as K,qx as q,rx as J,sn as oe,sx as se,tx as ce,ux as le,vx as ue,wx as de,xx as fe,yx as pe,zx as me}from"./dist-Dc3VNRsA.js";import{t as he}from"./button-BKJGR5Ol.js";import{A as ge,F as _e}from"./index-FBfe3CjA.js";import{t as Y}from"./DataTableShell-BNR4dned.js";var X=t(e(),1),Z=n(),ve={altered_words:()=>P(),incorrect:()=>i(),incoherence:()=>y(),formatting:()=>O(),latency:()=>E(),api_error:()=>D(),other:()=>m()},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:g()}):e===!1?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:p()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:q()})}function ye({data:e,closeReason:t}){let n=e.snapshot,r=f(l.feedback.respondToFeedback),[i,s]=(0,X.useState)(e.thread),[p,m]=(0,X.useState)(``),[h,g]=(0,X.useState)(!1);async function y(){let t=p.trim();if(!(!t||h)){g(!0);try{await r({feedbackId:e._id,text:t}),s(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),m(``)}finally{g(!1)}}}let x=[];try{x=n.contextJson?JSON.parse(n.contextJson):[]}catch{x=[]}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?` · ${T()}`:``,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:A()}),(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:ee()}),i.length>0?(0,Z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:i.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`?w():e.authorRole===`agent`?e.authorLabel??H():o()}),(0,Z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:me()}),(0,Z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:b(),value:p,maxLength:2e3,rows:3,onChange:e=>m(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 y(),disabled:!p.trim()||h,children:h?_():te()})})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:d()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||v()})]}),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||v()})]}):null,n.promptText?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ne()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,x.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:B({count:n.contextCount??x.length,truncated:n.contextTruncated?a():``})}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:x.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:V()}),(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:ie()}),(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:c()}),(0,Z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?u({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:[S(),` `,n.clientInfo.plugins.join(`, `),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,de()]})]}):null,n.clientInfo?.userAgent?(0,Z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function be(){let e=h(l.feedback.listForAdmin,{}),t=f(l.feedback.readSnapshot),n=f(l.feedback.deleteFeedback),i=_e(),[a,o]=(0,X.useState)(null),[c,u]=(0,X.useState)({});async function d(e){if(a===e._id){o(null);return}if(!c[e._id]){let n=await t({feedbackId:e._id});u(t=>({...t,[e._id]:n}))}o(e._id)}async function p(e){await i({title:ce(),description:F(),confirmLabel:r(),destructive:!0})&&(await n({feedbackId:e._id}),a===e._id&&o(null))}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[s(),` `,(0,Z.jsx)(`strong`,{children:x()}),` `,fe()]}),(0,Z.jsx)(Y,{title:j(),rows:e,emptyHint:pe(),isExpanded:e=>a===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Z.jsx)(ye,{data:c[e._id],closeReason:e.userCloseReason}):null,columns:[{header:ue(),cell:e=>ge(e.at),sort:e=>e.at},{header:k(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:L(),cell:e=>e.messageRole===`user`?R():ae(),sort:e=>e.messageRole},{header:K(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${I({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:N(),cell:e=>(0,Z.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:le(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:U(),cell:e=>e.userClosedAt==null?e.resolvedAt==null?e.answered?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:M()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:se()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,title:e.resolvedBy??void 0,children:oe()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:G()}),sort:e=>e.userClosedAt==null?e.resolvedAt==null?+!!e.answered:2:3}],rowActions:e=>[{label:a===e._id?z():J(),onSelect:()=>void d(e)},{label:W(),onSelect:()=>void p(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,Bk as te,E as r,GA as ne,Gk as re,Hk as ie,Ik as ae,Jk as oe,KA as se,Kk as ce,LA as i,Lk as a,Qk as o,Rk as s,TT as c,Uk as l,Vk as le,Wk as u,Xk as ue,Yk as de,Zk as fe,_A as pe,aA as d,cA as me,dA as he,eA as f,fA as ge,fn as _e,gA as ve,hA as ye,iA as p,lA as be,mA as m,nA as h,oA as g,pA as _,pn as v,qk as y,rA as b,sA as x,tA as S,uA as C,zA as w,zk as T}from"./dist-Dc3VNRsA.js";import{t as E}from"./button-BKJGR5Ol.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-FBfe3CjA.js";import{a as Me,i as B,n as Ne,o as V,r as H,t as Pe}from"./table-DLKsfSfk.js";var U=t(e(),1),W=n(),G=`all`;function K(e){switch(e){case`image`:return g();case`audio`:return d();case`video`:return p();case`pdf`:return b();case`document`:return h();case`archive`:return S();default:return f()}}function q(){let[e,t]=(0,U.useState)(G),[n,d]=(0,U.useState)(G),[f,p]=(0,U.useState)(G),[h,g]=(0,U.useState)(G),[b,S]=(0,U.useState)(!1),[q,J]=(0,U.useState)(null),Fe=ne(r.files.softDelete),Y=Se();function Ie(){t(G),d(G),p(G),g(G)}async function Le(){let e=q;if(J(null),e)try{await Fe({fileId:e.id}),Y.success(l())}catch(e){Y.error(ie(),e)}}let X=se(r.files.listMine,{direction:e===G?void 0:e,chatId:n===G?void 0:n,instanceName:f===G?void 0:f,category:h===G?void 0:h,includeAutoGenerated:b||void 0}),Re=(0,U.useMemo)(()=>new Intl.DateTimeFormat(w(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:i()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==G||n!==G||f!==G||h!==G;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:pe()}),(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":ve(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:ye()}),(0,W.jsx)(P,{value:`inbound`,children:m()}),(0,W.jsx)(P,{value:`outbound`,children:_()})]})]}),(0,W.jsxs)(I,{value:n,onValueChange:d,children:[(0,W.jsx)(A,{size:`sm`,"aria-label":ge(),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:f,onValueChange:p,children:[(0,W.jsx)(A,{size:`sm`,"aria-label":C(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:be()}),Q.instances.map(e=>(0,W.jsx)(P,{value:e,children:e},e))]})]}):null,(0,W.jsxs)(I,{value:h,onValueChange:g,children:[(0,W.jsx)(A,{size:`sm`,"aria-label":me(),children:(0,W.jsx)(R,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(P,{value:G,children:x()}),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:b,onCheckedChange:e=>S(e===!0),"aria-label":v()}),(0,W.jsx)(`span`,{children:v()})]}),$?(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}),ce()]}):null]}),Z.length===0?(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:$?a():s()}):(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:ee()}),(0,W.jsx)(B,{children:o()}),(0,W.jsx)(B,{children:fe()}),(0,W.jsx)(B,{children:ue()}),(0,W.jsx)(B,{children:de()}),(0,W.jsx)(B,{className:`text-right`,children:oe()})]})}),(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:_e()}):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`?m():_()})}),(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":re(),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}),y()]})}):(0,W.jsxs)(F,{disabled:!0,children:[(0,W.jsx)(O,{size:14}),T()]}),(0,W.jsxs)(F,{variant:`destructive`,onSelect:()=>J({id:e._id,filename:e.filename}),children:[(0,W.jsx)(Ae,{size:14}),u()]})]})]})})]},e._id))})]}),ze?(0,W.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:ae({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:le()}),(0,W.jsx)(Te,{children:te()})]}),(0,W.jsxs)(M,{children:[(0,W.jsx)(je,{children:c()}),(0,W.jsx)(Ce,{onClick:()=>void Le(),children:u()})]})]})})]})}export{q as FilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$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,GA as f,Gc as p,Hc as m,Ic as h,Jc as g,KA as _,Kc as v,Lc as y,Mc as b,Nc as x,Oc as S,Pc as C,Qc as w,Rc as ee,Sc as T,Tc as E,Uc as te,Vc as ne,Wc as D,Xc as re,Yc as O,Zc as k,_c as ie,ac as A,al as j,bc as M,cc as ae,cl as oe,dc as N,el as P,fc as F,gc as se,hc as ce,ic as I,il as le,jc as L,kc as ue,lc as de,ll as fe,mc as pe,nc as me,nl as he,oc as ge,ol as _e,pc as R,qc as ve,rc as ye,rl as be,sc as xe,sl as Se,tc as Ce,tl as we,uc as Te,ul as Ee,vc as De,wc as Oe,xc as ke,yc as Ae,zc as je}from"./dist-Dc3VNRsA.js";import{t as Me}from"./x-BR_3jyrW.js";import{i as z,n as B,r as Ne,t as Pe}from"./tabs-DKM45Hda.js";import{t as V}from"./button-BKJGR5Ol.js";import{C as Fe,F as Ie,P as H,Pt as Le,S as Re,b as ze,bt as U,et as W,it as Be,nt as Ve,ot as He,p as G,rt as Ue,st as We,tt as K,u as Ge,ut as Ke,w as qe,x as Je,xt as q}from"./index-FBfe3CjA.js";import{t as Ye}from"./FilterBar-DTgQOIHy.js";import{t as Xe}from"./DataTableShell-BNR4dned.js";import{t as J}from"./DetailChips-C40vaJ_d.js";var Ze=s(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Qe=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`}]]),Y=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`}]]),$e=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`}]]),X=t(e(),1);function et(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 tt(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 nt(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 rt(e){switch(e){case`admin`:return L();case`user`:return i();case`pending`:return ue();default:return e}}function it(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 at(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 Z=n(),Q={name:``,description:``};function ot(){let e=_(l.groups.listGroups,{}),t=_(l.me.getMe,{host:Ke})?.role===`admin`,n=f(l.groups.createGroup),i=f(l.groups.updateGroup),a=f(l.groups.deleteGroup),o=Ie(),s=H(),[c,u]=(0,X.useState)(!1),[d,m]=(0,X.useState)(null),[h,y]=(0,X.useState)(Q),[b,x]=(0,X.useState)(null),[S,C]=(0,X.useState)(``),ee=(0,X.useMemo)(()=>{if(!e)return e;let t=S.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,S]);function T(){m(null),y(Q),u(!0)}function E(e){m(e),y({name:e.name,description:e.description??``}),u(!0)}async function ne(){try{d?await i({groupId:d._id,name:h.name,description:h.description}):await n({name:h.name,description:h.description||void 0}),y(Q),m(null),u(!1)}catch(e){s.error(I(),e)}}async function ie(e){if(await o({title:p({name:e.name}),description:D(),confirmWord:e.name,confirmLabel:te(),cancelLabel:k(),destructive:!0}))try{await a({groupId:e._id})}catch(e){s.error(ye(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:fe()}),(0,Z.jsx)(Ye,{q:S,onQChange:C,onReset:()=>C(``),canReset:S!==``,searchPlaceholder:he()}),(0,Z.jsx)(Xe,{title:Ee(),rows:ee,addLabel:oe(),onAdd:t?T:void 0,emptyHint:Se(),columns:[{header:_e(),cell:e=>e.name,sort:e=>e.name},{header:j(),cell:e=>(0,Z.jsx)(J,{icon:(0,Z.jsx)($e,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,Z.jsx)(Y,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:le(),cell:e=>(0,Z.jsx)(J,{icon:(0,Z.jsx)(q,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:be(),cell:e=>(0,Z.jsx)(J,{icon:(0,Z.jsx)(Qe,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,Z.jsx)(U,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:we(),onSelect:()=>x({groupId:e._id,name:e.name})},...t?[{label:P(),onSelect:()=>E(e)},{label:r(),variant:`destructive`,onSelect:()=>void ie(e)}]:[]]}),(0,Z.jsx)(Ge,{open:c,onOpenChange:u,title:d?O():re(),description:g(),canSubmit:!!h.name.trim(),onSubmit:ne,submitLabel:w(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(`span`,{className:`oc-field__label`,children:ve()}),(0,Z.jsx)(K,{value:h.name,onChange:e=>y({...h,name:e.target.value})})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(`span`,{className:`oc-field__label`,children:v()}),(0,Z.jsx)(K,{value:h.description,onChange:e=>y({...h,description:e.target.value})})]})]})}),(0,Z.jsx)(ct,{groupId:b?.groupId??null,groupName:b?.name??``,open:b!==null,onOpenChange:e=>{e||x(null)}})]})}var st=8;function $({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,Z.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,Z.jsxs)(V,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,Z.jsx)(Ze,{size:14,"aria-hidden":!0}),C()]}),(0,Z.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":b({page:e,pages:t}),children:[e,` / `,t]}),(0,Z.jsxs)(V,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[x(),(0,Z.jsx)(Le,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=_(l.groups.getGroup,n&&e?{groupId:e}:`skip`),s=_(l.groups.listAssignableInstances,n?{}:`skip`),c=_(l.groups.listAssignableUsers,n?{}:`skip`),p=f(l.groups.addMember),g=f(l.groups.removeMember),v=f(l.groups.bulkSetMembers),b=f(l.groups.setGroupManager),x=H(),[C,w]=(0,X.useState)(``),[T,E]=(0,X.useState)(``),[te,D]=(0,X.useState)(`members`),[re,O]=(0,X.useState)(1),[k,A]=(0,X.useState)(new Set),j=(0,X.useRef)(null),M=(0,X.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),oe=(0,X.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),N=i?.viewerIsAdmin===!0,P=(0,X.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,X.useEffect)(()=>{w(``),E(``),D(`members`),O(1),j.current=null},[n,e]),(0,X.useEffect)(()=>{O(1)},[C]),(0,X.useEffect)(()=>{n&&i&&e&&j.current!==e&&(j.current=e,A(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let F=(0,X.useMemo)(()=>c?et(c,C,k):[],[c,C,k]);async function se(t,n){if(e)try{n?await g({groupId:e,userId:t}):await p({groupId:e,userId:t})}catch(e){x.error(me(),e)}}async function ce(t,n){if(e)try{await b({groupId:e,userId:t,manager:!n})}catch(e){x.error(ge(),e)}}let I=it(F,e=>M.has(e.userId)),le=F.filter(e=>M.has(e.userId)).length,L=at(F,re,st);async function ue(){if(!e||F.length===0)return;let t=F.map(e=>e.userId);try{await v({groupId:e,userIds:t,member:I!==`all`})}catch(e){x.error(me(),e)}}return(0,Z.jsx)(Ve,{open:n,onOpenChange:r,children:(0,Z.jsxs)(Ue,{className:`oc-access`,children:[(0,Z.jsxs)(He,{children:[(0,Z.jsx)(We,{children:m({name:t})}),(0,Z.jsx)(Be,{children:ne()})]}),(0,Z.jsxs)(Pe,{value:te,onValueChange:D,className:`oc-access__tabs`,children:[(0,Z.jsxs)(Ne,{className:`w-full`,children:[(0,Z.jsxs)(z,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,Z.jsx)($e,{size:13,"aria-hidden":!0}),a(),i?(0,Z.jsx)(W,{variant:`secondary`,className:`oc-access__tabcount`,children:M.size}):null]}),(0,Z.jsxs)(z,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,Z.jsx)(q,{size:13,"aria-hidden":!0}),ee(),i?(0,Z.jsx)(W,{variant:`secondary`,className:`oc-access__tabcount`,children:P.size}):null]}),(0,Z.jsxs)(z,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,Z.jsx)(Qe,{size:13,"aria-hidden":!0}),ie(),i?(0,Z.jsx)(W,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,Z.jsx)(B,{value:`members`,children:c===void 0||i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:u()}):c.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:Oe()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(K,{value:C,onChange:e=>w(e.target.value),placeholder:je(),className:`oc-access__search`}),F.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:h()}):(0,Z.jsxs)(Z.Fragment,{children:[F.length>1?(0,Z.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Z.jsx)(G,{checked:I===`all`?!0:I===`some`?`indeterminate`:!1,onCheckedChange:()=>void ue(),"aria-label":d()}),(0,Z.jsx)(`span`,{className:`oc-access__label`,children:d()}),(0,Z.jsxs)(W,{variant:`outline`,className:`oc-access__count`,children:[le,` / `,F.length]})]}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:L.pageItems.map(e=>{let t=M.has(e.userId),n=nt(e),r=oe.has(e.userId);return(0,Z.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Z.jsx)(G,{checked:t,onCheckedChange:()=>void se(e.userId,t),"aria-label":S({user:n.primary})}),(0,Z.jsxs)(`span`,{className:`oc-access__who`,children:[(0,Z.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,Z.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__role`,children:rt(e.role)}),(0,Z.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&N?(0,Z.jsx)(V,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?xe():ae(),title:r?xe():ae(),onClick:()=>void ce(e.userId,r),children:(0,Z.jsx)(Y,{size:15,"aria-hidden":!0})}):t&&r?(0,Z.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":de(),title:de(),children:(0,Z.jsx)(Y,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,Z.jsx)($,{page:L.page,pageCount:L.pageCount,onPage:O})]})]})}),(0,Z.jsx)(B,{value:`agents`,children:s===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:u()}):s.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:o()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(K,{value:T,onChange:e=>E(e.target.value),placeholder:y(),className:`oc-access__search`}),(0,Z.jsx)(`div`,{className:`oc-access__list`,children:s.map(t=>(0,Z.jsx)(lt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:P,query:T},`${e}-${t._id}`))})]})}),(0,Z.jsx)(B,{value:`charts`,children:(0,Z.jsx)(ut,{groupId:e})})]})]})})}function lt({groupId:e,instanceName:t,kind:n,assigned:r,query:i}){let a=_(l.groups.listAssignableAgents,{instanceName:t}),o=f(l.groups.assignAgentToGroup),s=f(l.groups.removeAgentFromGroup),u=f(l.groups.bulkSetGroupAgents),p=H(),[m,h]=(0,X.useState)(1);if((0,X.useEffect)(()=>{h(1)},[i]),!e)return null;let g=tt(a?.agents??[],i),v=a?.discovery&&!a.discovery.lastPollOk;if(i.trim()&&g.length===0)return null;let y=g.filter(e=>e.presentInLastOk!==!1),b=it(y,e=>r.has(`${t}/${e.agentId}`)),x=at(g,m,st);async function S(n,r){try{r?await s({groupId:e,instanceName:t,agentId:n}):await o({groupId:e,instanceName:t,agentId:n})}catch(e){p.error(Ce(),e)}}async function C(){if(y.length===0)return;let n=y.map(e=>e.agentId);try{await u({groupId:e,instanceName:t,agentIds:n,assigned:b!==`all`})}catch(e){p.error(Ce(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(q,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__kind`,children:n}),v?(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__stale`,children:M()}):null]}),a===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:E()}):g.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:v?ke():T()}):(0,Z.jsxs)(Z.Fragment,{children:[y.length>1?(0,Z.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Z.jsx)(G,{checked:b===`all`?!0:b===`some`?`indeterminate`:!1,onCheckedChange:()=>void C(),"aria-label":d()}),(0,Z.jsx)(`span`,{className:`oc-access__label`,children:d()})]}):null,x.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1;return(0,Z.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Z.jsx)(G,{checked:i,disabled:a&&!i,onCheckedChange:()=>void S(e.agentId,i),"aria-label":c({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":De(),title:De(),children:(0,Z.jsx)(U,{size:14,fill:`currentColor`})}):null,a?(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__gone`,children:Ae()}):null]},e.agentId)}),(0,Z.jsx)($,{page:x.page,pageCount:x.pageCount,onPage:h})]})]})}function ut({groupId:e}){let t=_(l.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=f(l.charts.assignChartToGroup),r=f(l.charts.removeChartFromGroup),i=f(l.charts.setGroupDefaultChart),a=f(l.charts.addChartToGroupPool),o=f(l.charts.removeChartFromGroupPool),s=H();if(!e)return null;if(t===void 0)return(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:u()});let{pool:c,addable:d,canManagePool:p}=t;if(c.length===0&&!p)return(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:se()});async function m(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){s.error(A(),e)}}async function h(t){try{await i({groupId:e,chartKey:t})}catch(e){s.error(A(),e)}}async function g(t){try{await a({groupId:e,chartKey:t})}catch(e){s.error(A(),e)}}async function v(t){try{await o({groupId:e,chartKey:t})}catch(e){s.error(A(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__list`,children:c.map(e=>(0,Z.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Z.jsx)(G,{checked:e.selected,onCheckedChange:()=>void m(e.chartKey,e.selected),"aria-label":F({name:e.name})}),(0,Z.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":N(),title:N(),children:(0,Z.jsx)(U,{size:14,fill:`currentColor`})}):(0,Z.jsx)(V,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void h(e.chartKey),children:Te()}):null,p?(0,Z.jsx)(V,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":R({name:e.name}),title:R({name:e.name}),onClick:()=>void v(e.chartKey),children:(0,Z.jsx)(Me,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),p?d.length>0?(0,Z.jsxs)(ze,{value:``,onValueChange:e=>void g(e),children:[(0,Z.jsx)(Fe,{size:`sm`,className:`oc-access__search`,children:(0,Z.jsx)(qe,{placeholder:pe()})}),(0,Z.jsx)(Je,{children:d.map(e=>(0,Z.jsx)(Re,{value:e.chartKey,children:e.name},e.chartKey))})]}):c.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:ce()}):null:null]})}export{ot 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,Ey as p,Fm as m,Fy as h,GA as g,Gv as _,Gy as v,Hv as y,Hy as b,Iy as x,Jv as S,Jy as C,KA as w,Kv as T,Ky as E,Ly as ee,My as te,Ny as ne,O as D,Oy as re,Pm as O,Py as ie,Qv as ae,Qy as oe,Ry as se,Sb as ce,Sy as le,Tb as ue,Ty as de,UA as k,Uv as fe,Uy as pe,Vv as me,Vy as he,Wv as ge,Wy as _e,Xv as ve,Xy as ye,Yv as be,Yy as xe,Zv as Se,Zy as Ce,_E as A,_b as we,_y as Te,ab as Ee,ay as De,bb as Oe,by as ke,cb as Ae,cy as je,db as j,dr as Me,dy as M,eb as Ne,ey as Pe,fb as Fe,fr as Ie,fy as Le,gb as Re,gy as ze,hb as Be,hy as Ve,ib as He,iy as Ue,jy as N,k as We,ky as Ge,lb as Ke,lr as qe,ly as P,mb as Je,my as Ye,nb as Xe,ny as Ze,ob as Qe,oy as F,pb as $e,py as et,qv as tt,qy as nt,rb as rt,ry as it,sb as at,sy as ot,tb as st,ty as ct,ub as lt,ur as ut,uy as dt,vE as I,vb as ft,vy as pt,wb as mt,wy as ht,xb as gt,xy as _t,yb as vt,yy as yt,zv as bt,zy as xt}from"./dist-Dc3VNRsA.js";import{a as St,c as Ct}from"./FieldLabel-DMW_YpQf.js";import{t as L}from"./button-BKJGR5Ol.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-FBfe3CjA.js";import{t as Mt}from"./DataTableShell-BNR4dned.js";import{InstanceConfigDialog as Nt}from"./BridgeTab-QOf_ucR7.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=w(f.admin.listInstances,{}),t=w(f.agents.listAllInstanceAgents,{}),n=g(f.admin.upsertInstance),r=g(f.admin.deleteInstance),o=z(),[c,u]=(0,Y.useState)(!1),[d,p]=(0,Y.useState)(Q),[h,_]=(0,Y.useState)(null),[v,y]=(0,Y.useState)(null),[b,x]=(0,Y.useState)(null),[S,T]=(0,Y.useState)(null);async function E(){try{await n({instanceId:S??void 0,name:d.name,gatewayUrl:d.gatewayUrl,bridgeUrl:d.bridgeUrl||void 0,displayName:d.displayName||void 0,kind:d.kind,transport:d.kind===`hermes`?d.transport:void 0,gatewayVersion:d.gatewayVersion||void 0,gatewayHttpUrl:d.gatewayHttpUrl||void 0,streamTransport:d.streamTransport}),p(Q),T(null),u(!1)}catch(e){o.error(l(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[ce(),(0,Z.jsx)(`strong`,{children:gt()}),Oe()]}),(0,Z.jsx)(Mt,{title:vt(),rows:e,addLabel:ft(),onAdd:()=>{T(null),p(Q),u(!0)},emptyHint:we(),columns:[{header:Re(),cell:e=>e.name,sort:e=>e.name},{header:Be(),cell:e=>(0,Z.jsx)(H,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:Je(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:$e(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:ue(),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)?s():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:Ke(),onSelect:()=>{T(e._id),p(Rt(e)),u(!0)}},{label:mt(),onSelect:()=>_(e.name)},{label:C(),onSelect:()=>x(e)},{label:Fe(),onSelect:()=>y(e)},{label:j(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:j(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(jt,{open:c,onOpenChange:u,title:S?Ae():lt(),description:Qe(),canSubmit:!!(d.name&&d.gatewayUrl),onSubmit:E,submitLabel:Ee(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:He(),children:[(0,Z.jsx)(K,{value:d.name,disabled:S!==null,onChange:e=>p({...d,name:e.target.value})}),S?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:at()}):null]}),(0,Z.jsx)($,{label:rt(),children:(0,Z.jsxs)(V,{value:d.kind,onValueChange:e=>p({...d,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`})]})]})}),d.kind===`hermes`?(0,Z.jsx)($,{label:a(),children:(0,Z.jsxs)(V,{value:d.transport,onValueChange:e=>p({...d,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:We()}),(0,Z.jsx)(B,{value:`rest`,children:D()})]})]})}):null,(0,Z.jsx)($,{label:Xe(),children:(0,Z.jsx)(K,{value:d.gatewayUrl,onChange:e=>p({...d,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:st(),children:(0,Z.jsx)(K,{value:d.bridgeUrl,placeholder:Ne(),onChange:e=>p({...d,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:i(),children:(0,Z.jsx)(K,{value:d.displayName,onChange:e=>p({...d,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:m(),children:[(0,Z.jsxs)(V,{value:d.streamTransport,onValueChange:e=>p({...d,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:O()})]}),(0,Z.jsx)($,{label:oe(),children:(0,Z.jsx)(K,{value:d.gatewayVersion,placeholder:Ce(),onChange:e=>p({...d,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:ye(),children:(0,Z.jsx)(K,{value:d.gatewayHttpUrl,placeholder:xe(),onChange:e=>p({...d,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Yt,{instanceName:h,open:h!==null,onOpenChange:e=>{e||_(null)}}),v?(0,Z.jsx)(Nt,{instance:v,onClose:()=>y(null)},v._id):null,b?(0,Z.jsx)(Bt,{instance:b,onClose:()=>x(null)},b._id):null]})}function Bt({instance:e,onClose:t}){let n=w(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:nt({instance:e.displayName??e.name})}),(0,Z.jsx)(U,{children:E()})]}),(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=k(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(p());break;case`no_agents`:n.success(ht());break;case`no_bridge_url`:n.error(u());break;case`deploy_misconfigured`:n.error(le());break;case`unauthorized`:n.error(ke());break;case`not_served`:n.error(yt());break;default:n.error(_t());break}}catch(e){n.error(de(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:pt()}),(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():re()})})]})}function Ht({instance:e}){let t=w(f.bridgeAuth.listBridgeAuthStatus,{}),n=k(f.bridgeAuth.mintBridgeSecret),r=g(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(M(),e)}finally{o(!1)}}}async function h(){if(!a){o(!0);try{await r({instanceId:e._id}),c(null),i.success(Le())}catch(e){i.error(M(),e)}finally{o(!1)}}}async function _(){if(s)try{await navigator.clipboard.writeText(s),u(!0)}catch{}}return(0,Z.jsxs)($,{label:Te(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ze()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(H,{variant:p?`outline`:`secondary`,children:p?`${b()} · ${d.prefix}…${d.lastFour}`:he()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(L,{size:`sm`,onClick:()=>void m(),disabled:a,children:p?Ye():Ve()}),p?(0,Z.jsx)(L,{size:`sm`,variant:`destructive`,onClick:()=>void h(),disabled:a,children:et()}):null]})]}),s?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:dt()}),(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 _(),children:l?I():A()})]}),(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=k(f.instanceSecrets.setInstanceSecret),i=g(f.instanceSecrets.clearInstanceSecret),a=k(f.deviceIdentity.generateDeviceIdentity),s=z(),[l,u]=(0,Y.useState)(``),[d,p]=(0,Y.useState)(!1),[m,_]=(0,Y.useState)(null),[y,S]=(0,Y.useState)(!1),C=n!==null,w=t===`deviceIdentity`,T=t===`token`?v():t===`deviceIdentity`?_e():pe();async function E(){if(!(!l.trim()||d)){p(!0);try{await r({instanceId:e,field:t,plaintext:l}),u(``),_(null),S(!1),s.success(x())}catch(e){s.error(h(),e)}finally{p(!1)}}}async function D(){if(!d){p(!0);try{await i({instanceId:e,field:t}),_(null),S(!1),s.success(ie())}catch(e){s.error(h(),e)}finally{p(!1)}}}async function re(){if(!d){p(!0);try{_(await a({instanceId:e})),S(!1),s.success(N())}catch(e){s.error(Ge(),e)}finally{p(!1)}}}let O=m?`openclaw devices approve ${m.id}`:``;async function ae(){if(O)try{await navigator.clipboard.writeText(O),S(!0)}catch{}}return(0,Z.jsxs)($,{label:T,children:[w?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:te()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(H,{variant:C?`outline`:`secondary`,children:C?b():he()}),(0,Z.jsx)(K,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:l,placeholder:C?xt():c(),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 E(),disabled:d||l.trim().length===0,children:se()}),w?(0,Z.jsx)(L,{size:`sm`,variant:`outline`,onClick:()=>void re(),disabled:d,children:ne()}):null,C?(0,Z.jsx)(L,{size:`sm`,variant:`destructive`,onClick:()=>void D(),disabled:d,children:ee()}):null]})]}),m?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:N()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:o()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:O}),(0,Z.jsx)(L,{variant:`outline`,size:`sm`,onClick:()=>void ae(),children:y?I():A()})]}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,onClick:()=>{_(null),S(!1)},children:P()})]}):null]})}var Wt={conversational:ct,documentary:r,summarizer:Ie,curator:ut},Gt={conversational:Pe,documentary:ae,summarizer:Me,curator:qe},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:De()}),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:Ue()})}),(0,Z.jsxs)(Et,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:it()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:Ze()}),(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=w(f.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=g(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=g(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=g(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=g(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(F(),e)}}async function p(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){u.error(F(),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(F(),e)}}async function h(t,n){if(e&&await l({title:be({name:n}),description:S(),confirmLabel:tt(),destructive:!0}))try{await c({instanceName:e,agentId:t}),u.success(T())}catch(e){u.error(F(),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:ot()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:_()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?ge():r.discovery.lastPollOk?fe():y({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:me()}):(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:bt()}),(0,Z.jsx)(L,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void h(e.agentId,i),children:ve()})]}):n?(0,Z.jsx)(H,{variant:`default`,children:s()}):(0,Z.jsx)(L,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void p(e.agentId),children:Se()})]}),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,GA as p,GS as m,HS as h,IS as ee,KA as te,KS as ne,LS as g,MS as re,Mi as _,NS as v,Ni as ie,OS as ae,Oi as y,PS as oe,RS as b,SS as x,TS as se,Ti as ce,UA as le,US as S,VS 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,qS as U,rS as W,sS as ue,tS as de,uS as fe,vS as pe,wS as me,xS as he,yS as ge,zS as _e}from"./dist-Dc3VNRsA.js";import{t as G}from"./button-BKJGR5Ol.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-FBfe3CjA.js";import{t as Te}from"./DataTableShell-BNR4dned.js";var J=t(e(),1),Y=n();function Ee(){let e=te(l.integrations.status.status,{}),t=p(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:U()});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:[ne(),` `,(0,Y.jsx)(`strong`,{children:m()}),` `,w()]}),(0,Y.jsxs)(X,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:S()}):(0,Y.jsx)(K,{variant:`outline`,children:h()}):(0,Y.jsx)(K,{variant:`outline`,children:C()}),note:_e(),children:[(0,Y.jsx)(Z,{label:g(),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:v(),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:S()}):(0,Y.jsx)(K,{variant:`outline`,children:h()}):(0,Y.jsx)(K,{variant:`outline`,children:C()}),note:b(),children:[(0,Y.jsx)(Z,{label:ee(),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:f(),children:(0,Y.jsx)(q,{value:c.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||oe(),onChange:e=>d(`opik`,`workspace`,e.target.value),onBlur:()=>y(`opik`,{workspace:c.opik.workspace??``})})}),(0,Y.jsx)(Q,{label:v(),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:S()}):(0,Y.jsx)(K,{variant:`outline`,children:h()}):(0,Y.jsx)(K,{variant:`outline`,children:ie()}),note:_(),children:[(0,Y.jsx)(Z,{label:F(),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:v(),checked:c.otlp.enabled??!0,onChange:e=>{d(`otlp`,`enabled`,e),y(`otlp`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:re(),status:(0,Y.jsx)(K,{variant:`outline`,children:a()}),note:P(),children:[(0,Y.jsx)(Z,{label:r(),children:(0,Y.jsx)($,{value:c.tts.auto??`off`,options:[[`off`,I()],[`always`,ae()],[`inbound`,s()],[`tagged`,u()]],onChange:e=>{d(`tts`,`auto`,e),y(`tts`,{auto:e})}})}),(0,Y.jsx)(Z,{label:se(),children:(0,Y.jsx)($,{value:c.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,me()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{d(`tts`,`provider`,e),y(`tts`,{provider:e})}})}),(0,Y.jsx)(Z,{label:o(),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:x(),children:(0,Y.jsx)(q,{value:c.tts.voice??``,placeholder:he(),onChange:e=>d(`tts`,`voice`,e.target.value),onBlur:()=>y(`tts`,{voice:c.tts.voice??``})})})]}),(0,Y.jsxs)(X,{title:D(),status:(0,Y.jsx)(K,{variant:`outline`,children:a()}),note:e.secrets.openai?ge():pe(),children:[(0,Y.jsx)(Q,{label:T(),checked:c.talk.enabled??!1,onChange:e=>{d(`talk`,`enabled`,e),y(`talk`,{enabled:e})}}),(0,Y.jsx)(Z,{label:j(),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:M(),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:x(),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:z(),children:(0,Y.jsx)($,{value:c.talk.transport??`webrtc`,options:[[`webrtc`,H()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{d(`talk`,`transport`,e),y(`talk`,{transport:e})}})}),(0,Y.jsx)(Z,{label:A(),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:k(),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:fe()}),(0,Y.jsx)(K,{variant:`outline`,children:R()})]}),(0,Y.jsxs)(`p`,{className:`oc-uipa__note`,children:[O(),(0,Y.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,Y.jsx)(Te,{title:ue(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:V(),columns:[{header:E(),cell:e=>(0,Y.jsx)(K,{variant:`secondary`,children:e.vendor}),sort:e=>e.vendor},{header:N(),cell:e=>e.lastAt>0?ve(e.lastAt):`—`,sort:e=>e.lastAt>0?e.lastAt:null},{header:W(),cell:e=>String(e.failureCount),sort:e=>e.failureCount},{header:B(),cell:e=>e.lastErrorStatus??`—`,sort:e=>e.lastErrorStatus??null},{header:de(),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=le(l.integrations.otlpSecret.setOtlpHeaders),n=p(l.integrations.otlpSecret.clearOtlpHeaders),[r,a]=(0,J.useState)(``),[o,s]=(0,J.useState)(null),[u,f]=(0,J.useState)(!1),m=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:i(),children:[(0,Y.jsx)(q,{value:r,placeholder:e?L():y(),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 m(),children:c()}),e?(0,Y.jsx)(G,{variant:`ghost`,size:`sm`,disabled:u,onClick:()=>void n({}),children:d()}):null]}),o?(0,Y.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:o}):null,(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:ce()})]})}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,E as a,Gf as o,Hf as s,Jf as c,KA as l,Kf as u,MC 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,jC as b,kC as x,qf as S,rw as C,tp as w,xC as T}from"./dist-Dc3VNRsA.js";import{Ft as E,It as ee,a as te,n as ne,r as re,ut as D}from"./index-FBfe3CjA.js";import{a as O,n as k,o as A,r as j,t as M}from"./card-DqkRcTu-.js";import{n as N,t as P}from"./TimeRangePicker-CQKkmGDs.js";var F=t(e(),1),I=n(),L=15,R=e=>String(Math.round(e));function z(){let e=l(a.me.getMe,{host:D})?.permissions?.includes(`traces.read`)??!1,t=l(a.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:C()}),(0,I.jsxs)(M,{children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{children:d()}),(0,I.jsx)(j,{children:i()})]}),(0,I.jsx)(k,{children:n.length<2?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:x()}):(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),a=e=>74-e*68/r,o=e=>e.map((e,t)=>`${t===0?`M`:`L`}${i(t).toFixed(1)},${a(e).toFixed(1)}`).join(` `),s=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:[T(),` p50 `,R(s.cP50),` `,b()]}),(0,I.jsxs)(`span`,{children:[p(),` p50 `,R(s.aP50),` `,b()]})]}),(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:o(n),fill:`none`,style:{stroke:`var(--muted-foreground)`},strokeWidth:1.5}),(0,I.jsx)(`path`,{d:o(t),fill:`none`,style:{stroke:`var(--primary)`},strokeWidth:1.5})]})]})}var V=[{metric:`api.calls`,label:w(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:y(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:r(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:f(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:v(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:g(),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=ee({from:`/settings/kpi`}),t=E({from:`/settings/kpi`}),n=re(e.from,e.to,ne,`now`),r=e=>void t({search:t=>({...t,...te(e)})}),{from:i,to:o}=N(n),{rowLimit:s,buckets:d}=K(i,o),f=l(a.kpi.listKpis,{limit:s,filter:{from:i,to:o}}),p=(0,F.useMemo)(()=>{let e=new Map;for(let t of f??[]){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>d&&e.set(t,n.slice(n.length-d));return e},[f,d]),m=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[_(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:c()})]}),(0,I.jsx)(J,{value:n,onChange:r})]});return f===void 0?(0,I.jsxs)(I.Fragment,{children:[m,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:S()})]}):f.length===0?(0,I.jsxs)(I.Fragment,{children:[m,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:u()})]}):(0,I.jsxs)(I.Fragment,{children:[m,(0,I.jsx)(z,{}),U.map(e=>{let t=V.filter(t=>t.group===e);return t.some(e=>(p.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:p.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:o({value:$(n.bucket)})}):(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:h()}),(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:m({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":s({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,AD as i,BD as a,CA as o,DA as s,E as c,EA as l,FD as u,GA as d,GD as f,HD as p,ID as m,JD as h,KA as g,KD as ee,LA as te,LD as _,MA as ne,MD as re,ND as ie,OA as ae,PD as oe,QD as se,RD as ce,SA as le,TA as ue,UD as de,VD as fe,WD as v,XD as pe,YD as y,ZD as b,aO as x,ab as S,bA as C,cO as w,dO as T,eO as E,iO as D,jD as O,kA as k,lO as A,nO as j,oO as M,qD as N,rO as P,sO as F,tO as I,uO as L,wA as R,xA as z,yA as B,zD as V}from"./dist-Dc3VNRsA.js";import{t as H}from"./button-BKJGR5Ol.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-FBfe3CjA.js";import{t as be}from"./localePickerView-C2RmOS86.js";var q=t(e(),1),J=[{id:`messages`,label:()=>T()},{id:`composer`,label:()=>L()},{id:`sidebar`,label:()=>A()},{id:`other`,label:()=>w()}],Y={showSource:{category:`messages`,label:()=>F(),help:()=>M()},showReport:{category:`messages`,label:()=>x(),help:()=>D()},copyAssistant:{category:`messages`,label:()=>P()},copyUser:{category:`messages`,label:()=>j()},showDelete:{category:`messages`,label:()=>I()},showTools:{category:`messages`,label:()=>E(),help:()=>r()},voiceInput:{category:`composer`,label:()=>se(),help:()=>b()},showUsage:{category:`composer`,label:()=>pe(),help:()=>y()},showChatAge:{category:`sidebar`,label:()=>h(),help:()=>N()},showChatProvider:{category:`sidebar`,label:()=>ee(),help:()=>f()}};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:()=>oe()};function Oe({prefKey:e,ui:t}){let n=d(c.admin.setUiPrefDefault),r=d(c.admin.setFeatureEnabled),a=Ee(e),o=a?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:ce()}),(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:re()}),(0,$.jsx)(U,{value:`off`,children:O()}),(0,$.jsx)(U,{value:`inherit`,children:i()})]})]}),a?(0,$.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,$.jsx)(W,{checked:t.featuresEnabled[a]===!0,onCheckedChange:e=>void r({key:a,enabled:e===!0}),"aria-label":_()}),_()]}):null]}),o?(0,$.jsx)(`span`,{className:`oc-prefs__gov-help`,children:o}):null]})}function ke(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),i=g(c.me.getMe,{host:K}),o=i?.ui,s=Z(i?.role)&&n,l=d(c.me.setUiPref).withOptimisticUpdate(he),f=(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":V()}),V()]}):null,s?(0,$.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,$.jsx)(`p`,{children:m()}),(0,$.jsx)(`p`,{children:u()}),(0,$.jsx)(`p`,{children:ie()})]}):null,(0,$.jsx)(G,{value:e,onChange:e=>t(e.target.value),placeholder:v(),"aria-label":v(),className:`mb-2`}),f.length===0?(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:de()}):(0,$.jsx)(`div`,{className:`oc-prefs`,children:f.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],c=o.effective[e],u=o.userOverrides[e]!==void 0;return(0,$.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}${u&&!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:p()}):u?null:(0,$.jsx)(`span`,{className:`oc-prefs__def`,children:fe()})]}),r?(0,$.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,$.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&u?(0,$.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void l({key:e,value:null}),children:a()}):null,(0,$.jsx)(W,{checked:c,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:te()})}function Ae(){let e=g(c.me.getMe,{host:K}),t=d(c.me.setLocale),n=d(c.me.setMyName),r=ge(),i=e?.locale??`default`,a=e?.name??``,[u,f]=(0,q.useState)(null),p=u??a,m=p.trim()!==a.trim();async function h(){try{await n({name:p}),f(null),r.success(ue())}catch(e){r.error(R(),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:k()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:ae()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[(0,$.jsx)(G,{className:`max-w-xs`,value:p,maxLength:120,placeholder:s(),onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&m&&(e.preventDefault(),h())}}),(0,$.jsx)(H,{size:`sm`,disabled:!m,onClick:()=>void h(),children:S()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:l()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:o()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:le()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[be().map(e=>(0,$.jsx)(H,{variant:i===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,$.jsx)(H,{variant:i==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:ne()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:z()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:C()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:B()})]}),(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,Cm as i,Dm as a,E as o,Em as s,Ft as c,GA as l,It as u,KA as d,M as f,Mt as p,N as m,Nt as h,Om as g,Pt as _,Rm as v,Sm as y,Tm as b,_m as x,_r as S,bm as C,fm as ee,gm as w,gr as T,hm as E,hr as te,j as ne,jm as re,jt as ie,km as ae,mm as oe,mr as D,pm as O,pr as k,vm as A,wm as j,xm as M,ym as N,zm as P}from"./dist-Dc3VNRsA.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-DMW_YpQf.js";import{t as U}from"./button-BKJGR5Ol.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-FBfe3CjA.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:s,help:b},documentary_fetch:{label:j,help:i},inbound_files:{label:y,help:M},history_summary:{label:S,help:T},file_curation:{label:u,help:c}},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:oe,references:O,files:ee,previous_summary:te,new_messages:D,max_chars:k,file_name:_,budget_chars:h,feedback:p,content:ie};function pe(){let e=d(o.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:N()})});let i=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:re(),help:r()}),(0,$.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,$.jsx)(`span`,{children:C()}),(0,$.jsxs)(q,{value:i._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:i},i._id)]})}function me({instance:e}){let t=l(o.admin.upsertInstanceConfig),n=G(),r=d(o.me.getMe,{host:ce}),i=e.config??{},a=X(e.config?.contentLocale,r?.defaultLocale??void 0),[s,c]=(0,Q.useState)(()=>L(i,a));(0,Q.useEffect)(()=>{c(L(i,a))},[a,e._id]);let[u,p]=(0,Q.useState)(!1),h=s.promptInjections,g=(e,t)=>c({...s,promptInjections:{...h,[e]:{...h[e],...t}}});async function _(){p(!0);try{await t({instanceId:e._id,config:B(s,i,a)})}catch(e){n.error(v(),e)}finally{p(!1)}}async function y(r){let i={...e.config??{}};r==="default"?delete i.contentLocale:i.contentLocale=r;try{await t({instanceId:e._id,config:i})}catch(e){n.error(v(),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:m()}),(0,$.jsxs)(q,{value:b,onValueChange:e=>void y(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:ne({locale:x})}),le().map(e=>(0,$.jsx)(K,{value:e.value,children:e.label},e.value))]})]}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:f()})]}),H.map(e=>(0,$.jsx)(he,{injKey:e,def:R[e],i18n:ue[e],row:h[e]??{enabled:!0,template:R[e].defaultTemplate[a]},contentLocale:a,onChange:t=>g(e,t)},e)),(0,$.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,$.jsx)(U,{size:`sm`,onClick:()=>void _(),disabled:u,children:P()})})]})}function he({injKey:e,def:t,i18n:n,row:r,contentLocale:i,onChange:o}){let[s,c]=(0,Q.useState)(!1),l=r.template.trim()!==t.defaultTemplate[i],u=t.togglable&&!r.enabled,d=Object.fromEntries(t.placeholders.map(e=>[e,de[e]??`{${e}}`])),f=F(e,r,i),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:r.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:g()})]}),(0,$.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.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:a()}),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?x():A()}),l&&(0,$.jsx)(U,{variant:`ghost`,size:`sm`,onClick:()=>o({template:t.defaultTemplate[i]}),children:ae()})]})]}),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:w()})]}):(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:E()})})]})}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,GA as s,H_ as te,I_ as c,J_ as l,KA as u,L_ as ne,P_ as d,Q_ as f,R_ as p,Sv as m,V_ as re,X_ as h,Y_ as g,Z_ as _,_v as v,av as y,bv as b,cv as x,dv as S,ev as ie,fv as C,gv as w,hv as T,iv as E,lv as D,mv as O,nv as k,on as A,ov as j,pv as M,rv as N,sv as P,tv as F,uv as I,vv as L,xv as R,yv as z,z_ as ae}from"./dist-Dc3VNRsA.js";import{t as B}from"./button-BKJGR5Ol.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-FBfe3CjA.js";import{t as J}from"./roleDescriptions-CnhwMy_T.js";var Y=t(e(),1),X=n(),Z=[{group:()=>i(),keys:[{key:`traces.read`,label:()=>L()},{key:`traces.read.content`,label:()=>v(),phi:!0},{key:`traces.write`,label:()=>w()}]},{group:()=>m(),keys:[{key:`kpi.read`,label:()=>L()},{key:`kpi.write`,label:()=>w()}]},{group:()=>R(),keys:[{key:`openclaw.query`,label:()=>T()},{key:`anomalies.read`,label:()=>O()},{key:`anomalies.report`,label:()=>M()}]},{group:()=>b(),keys:[{key:`chats.read`,label:()=>L()},{key:`selfheal`,label:()=>S()},{key:`feedback.respond`,label:()=>A()}]},{group:()=>z(),keys:[{key:`admin.manage`,label:()=>C()}]}],oe=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function se(){let e=u(a.apiKeys.listRoles,{}),t=s(a.apiKeys.createRole),n=s(a.apiKeys.ensureRolesSeeded),i=s(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))}),m=V(),v=H(),[b,S]=(0,Y.useState)(!1),[C,w]=(0,Y.useState)($),[T,O]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{v.error(D(),e)})},[n,v]);let A=e??[];async function M(e,t){if(Q(e.permissions)||T.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await m({title:x({name:e.name}),description:P(),confirmLabel:j()}))){O(t=>new Set(t).add(e._id));try{await i({roleId:e._id,permissions:n})}catch(e){v.error(y(),e)}finally{O(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){v.error(E(),e)}}let R=e===void 0,z=!R&&A.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[N(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,k(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,F()]}),(0,X.jsxs)(`div`,{className:`oc-dt`,children:[(0,X.jsxs)(`div`,{className:`oc-dt__bar`,children:[(0,X.jsx)(`h2`,{className:`oc-dt__title`,children:ie()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(B,{size:`sm`,onClick:()=>{w($),S(!0)},children:r()})})]}),R?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):z?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):(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:h()}),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?I({key:e.key}):e.key,children:[e.label(),e.phi?(0,X.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,X.jsx)(`tbody`,{children:A.map(e=>{let t=Q(e.permissions),n=T.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,{}),` `,g()]}):(0,X.jsx)(W,{variant:`secondary`,children:l()})]}),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?te():n?re():r,onCheckedChange:()=>void M(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(q,{open:b,onOpenChange:S,title:ee(),description:ae(),canSubmit:!!(C.key&&C.name),onSubmit:L,submitLabel:p(),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:c(),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:o()}),(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:d()}),(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,AE as i,BE as ee,CD as a,CE as o,DD as te,DE as s,E as c,ED as ne,EE as l,FE as re,GA as u,GE as ie,HE as ae,IE as oe,JE as se,KA as d,KE as ce,LE as le,ME as ue,NE as de,OD as fe,OE as pe,PE as me,QE as he,RE as ge,SD as _e,SE as f,TD as ve,TE as p,UA as ye,UE as be,VE as xe,WE as Se,XE as Ce,YE as we,ZE as Te,_D as Ee,_E as m,aD as De,bD as Oe,bE as h,cD as ke,dD as Ae,dE as g,eD as je,fD as Me,fE as _,gD as Ne,gE as v,hD as Pe,hE as y,iD as Fe,jE as b,kD as Ie,kE as x,lD as Le,lE as S,mD as Re,mE as C,nD as ze,oD as Be,pD as Ve,pE as w,qE as He,rD as Ue,sD as We,tD as Ge,uD as Ke,uE as T,vD as qe,vE as E,wD as D,wE as O,xD as Je,xE as k,yD as Ye,yE as A,zE as Xe}from"./dist-Dc3VNRsA.js";import{n as j}from"./dist-DhHl81ET.js";import{i as Ze}from"./dist-95OTI9bl.js";import{t as M}from"./button-BKJGR5Ol.js";import{A as N,C as P,F as Qe,Ft as $e,It as et,P as tt,Pt as nt,S as F,at as I,b as L,et as R,it as z,jt as B,k as V,nt as H,ot as rt,rt as it,st as U,tt as at,u as ot,w as W,x as G}from"./index-FBfe3CjA.js";import{t as st}from"./FilterBar-DTgQOIHy.js";import{t as ct}from"./DataTableShell-BNR4dned.js";import{t as lt}from"./roleDescriptions-CnhwMy_T.js";var K=t(e(),1),q=n(),J=[{value:`never`,label:()=>y(),days:null},{value:`30`,label:()=>C(),days:30},{value:`90`,label:()=>w(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=et({from:`/settings/serviceAccounts`}),t=$e({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??X,[o,s]=(0,K.useState)(X),l=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ue=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),pe=d(c.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===X?void 0:o,disabled:i===X?void 0:i===`disabled`}}),f=d(c.apiKeys.listKeys,{}),p=d(c.apiKeys.listRoles,{}),m=u(c.apiKeys.createServiceAccount),h=u(c.apiKeys.updateServiceAccount),g=u(c.apiKeys.deleteServiceAccount),_=ye(c.apiKeys.mintApiKey),v=u(c.apiKeys.revokeApiKey),y=Qe(),b=tt(),x=n!==``||o!==X||i!==X;function S(){s(X),t({search:{},replace:!0})}let[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(Z),[O,k]=(0,K.useState)(null),[A,j]=(0,K.useState)(new Set),[N,I]=(0,K.useState)(null),z=(0,K.useRef)(!1),[B,V]=(0,K.useState)(new Set),[H,rt]=(0,K.useState)({}),[it,U]=(0,K.useState)(null),Y=(0,K.useMemo)(()=>{let e=new Map;for(let t of f??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[f]);function Q(e){j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{O?(await h({serviceAccountId:O,name:T.name,roleKey:T.roleKey,description:T.description}),b.success(He())):await m({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Z),k(null),w(!1)}catch(e){b.error(O?se():we(),e)}}function pt(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),k(e._id),w(!0)}async function mt(e){if(z.current)return;z.current=!0;let t=H[e._id]??`never`,n=J.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;I(e._id);try{let t=await _({serviceAccountId:e._id,expiresAt:r});U({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){b.error(ce(),e)}finally{z.current=!1,I(null)}}async function $(e){if(await y({title:ie(),description:(0,q.jsxs)(q.Fragment,{children:[Se(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,be(),` `,(0,q.jsx)(`strong`,{children:ae()}),` `,xe()]}),confirmWord:e.name,confirmLabel:ee(),destructive:!0}))try{await g({serviceAccountId:e._id}),b.success(Xe(),e.name)}catch(e){b.error(ge(),e)}}async function ht(e){if(await y({title:le(),description:(0,q.jsxs)(q.Fragment,{children:[oe(),` `,(0,q.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,re()]}),confirmLabel:me(),destructive:!0})&&!B.has(e._id)){V(t=>new Set(t).add(e._id));try{await v({keyId:e._id})}catch(e){b.error(de(),e)}finally{V(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:Ie()}),(0,q.jsxs)(st,{q:n,onQChange:l,searchPlaceholder:fe(),onReset:S,canReset:x,children:[(0,q.jsxs)(L,{value:o,onValueChange:s,children:[(0,q.jsx)(P,{size:`sm`,className:`w-40`,children:(0,q.jsx)(W,{placeholder:te()})}),(0,q.jsxs)(G,{children:[(0,q.jsx)(F,{value:X,children:ne()}),(p??[]).map(e=>(0,q.jsx)(F,{value:e.key,children:e.key},e._id))]})]}),(0,q.jsxs)(L,{value:i,onValueChange:ue,children:[(0,q.jsx)(P,{size:`sm`,className:`w-36`,children:(0,q.jsx)(W,{})}),(0,q.jsxs)(G,{children:[(0,q.jsx)(F,{value:X,children:ve()}),(0,q.jsx)(F,{value:`active`,children:D()}),(0,q.jsx)(F,{value:`disabled`,children:a()})]})]})]}),(0,q.jsx)(ct,{title:_e(),rows:pe,addLabel:Je(),onAdd:()=>{E(Z),k(null),w(!0)},emptyHint:Oe(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,q.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:B}),rowActions:e=>[{label:Ne(),onSelect:()=>pt(e)},{label:Ye(),onSelect:()=>void mt(e)},{label:A.has(e._id)?qe():Ee(),onSelect:()=>Q(e._id)},{label:Pe(),variant:`destructive`,onSelect:()=>void $(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,q.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?Re():Ve(),onClick:()=>Q(e._id),children:A.has(e._id)?(0,q.jsx)(Ze,{}):(0,q.jsx)(nt,{})})},{header:Me(),sort:e=>e.name,cell:e=>(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`span`,{children:e.name}),e.description?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Ae(),sort:e=>e.roleKey,cell:e=>(0,q.jsx)(R,{variant:`secondary`,children:e.roleKey})},{header:Ke(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,q.jsx)(R,{variant:`destructive`,children:a()}):(0,q.jsx)(R,{variant:`outline`,children:D()})},{header:Le(),cell:e=>(0,q.jsxs)(L,{value:H[e._id]??`never`,onValueChange:t=>rt(n=>({...n,[e._id]:t})),children:[(0,q.jsx)(P,{size:`sm`,className:`w-32`,children:(0,q.jsx)(W,{})}),(0,q.jsx)(G,{children:J.map(e=>(0,q.jsx)(F,{value:e.value,children:e.label()},e.value))})]})},{header:ke(),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,q.jsx)(`span`,{className:`oc-sa__keycount`,children:N===e._id?We():Be({count:t})})}}]}),(0,q.jsx)(ot,{open:C,onOpenChange:e=>{w(e),e||k(null)},title:O?De():ze(),description:O?Fe():Ge(),canSubmit:!!(T.name&&T.roleKey),onSubmit:ft,submitLabel:O?Ue():je(),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:r()}),(0,q.jsx)(at,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:he()}),(0,q.jsxs)(L,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,q.jsx)(P,{className:`w-full`,children:(0,q.jsx)(W,{placeholder:Te()})}),(0,q.jsx)(G,{children:(p??[]).map(e=>(0,q.jsxs)(F,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(p??[]).find(e=>e.key===T.roleKey),t=e?lt(e):null;return t?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Ce()}),(0,q.jsx)(at,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,q.jsx)(dt,{minted:it,onClose:()=>U(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,q.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,q.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[ue(),` `,(0,q.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):(0,q.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{children:i()}),(0,q.jsx)(`th`,{children:x()}),(0,q.jsx)(`th`,{children:pe()}),(0,q.jsx)(`th`,{children:s()}),(0,q.jsx)(`th`,{children:l()}),(0,q.jsx)(`th`,{children:p()}),(0,q.jsx)(`th`,{})]})}),(0,q.jsx)(`tbody`,{children:t.map(t=>(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`td`,{children:(0,q.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,q.jsx)(`td`,{children:(0,q.jsx)(R,{variant:`secondary`,children:e.roleKey})}),(0,q.jsx)(`td`,{children:N(t.createdAt)}),(0,q.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,q.jsx)(`td`,{children:mt(t.expiresAt)}),(0,q.jsx)(`td`,{children:$(t)}),(0,q.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,q.jsx)(M,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?O():o()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,K.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,q.jsx)(H,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,q.jsxs)(it,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,q.jsxs)(rt,{children:[(0,q.jsx)(U,{children:f()}),(0,q.jsx)(z,{children:k({name:e.accountName})})]}),(0,q.jsx)(`div`,{className:`oc-sa__minted-warning`,children:h()}),(0,q.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,q.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,q.jsxs)(M,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":A(),children:[n?(0,q.jsx)(j,{}):(0,q.jsx)(B,{}),n?E():m()]})]}),(0,q.jsx)(I,{children:(0,q.jsx)(M,{onClick:()=>{r(!1),t()},children:v()})})]}):null})}function ft(e){return e===null?!1:Date.now()-e>Y}function pt(e){return e===null?_():N(e)}function mt(e){return e===null?`—`:V(e)}function $(e){return e.disabled?(0,q.jsx)(R,{variant:`destructive`,children:g()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,q.jsx)(R,{variant:`outline`,children:T()}):(0,q.jsx)(R,{variant:`outline`,children:S()})}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,GA as d,Gr as f,Hr as p,Ir as m,Jr as h,KA as g,Kr as _,Lr as v,Mr as y,Nr as b,Or as x,Pr as S,Qr as C,Rr as w,Sr as T,Tr as E,Ur as D,Vr as O,Wr as k,Xr as A,Yr as j,Zr as M,ai as N,ei as P,ii as F,jr as I,kr as ee,ni as L,oi as R,qr as z,ri as B,ti as V,wr as H,zr as U}from"./dist-Dc3VNRsA.js";import{t as W}from"./button-BKJGR5Ol.js";import{A as G,F as K}from"./index-FBfe3CjA.js";import{t as q}from"./DataTableShell-BNR4dned.js";var J=t(e(),1),Y=n(),X={hung:()=>D(),wrong_result:()=>p(),error:()=>O(),other:()=>a()},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=d(c.subAgentReports.respondToReport),[r,a]=(0,J.useState)(e.thread),[o,f]=(0,J.useState)(``),[p,h]=(0,J.useState)(!1);async function g(){let t=o.trim();if(!(!t||p)){h(!0);try{await n({reportId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),f(``)}finally{h(!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),` · `,U({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:w()}),(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:v()}),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`?m():u()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:S()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:b(),value:o,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 g(),disabled:!o.trim()||p,children:p?I():y()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[i({count:t.children.length}),t.childrenTruncated?` ${ee()}`:``,t.textTruncated?` ${x()}`:``]}),(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?` · ${s()}`:``]}),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:l()}),(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:E()}),(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=g(c.subAgentReports.listForAdmin,{}),t=d(c.subAgentReports.readReport),n=d(c.subAgentReports.deleteReport),i=K(),[a,s]=(0,J.useState)(null),[l,u]=(0,J.useState)({});async function p(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 m(e){await i({title:H(),description:o(),confirmLabel:T(),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:[F(),` `,(0,Y.jsx)(`strong`,{children:B()}),` `,L()]}),(0,Y.jsx)(q,{title:R(),rows:e,emptyHint:N(),isExpanded:e=>a===e._id&&!!l[e._id],renderExpanded:e=>l[e._id]?(0,Y.jsx)($,{data:l[e._id]}):null,columns:[{header:V(),cell:e=>G(e.at),sort:e=>e.at},{header:P(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:r(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:C(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${j({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:M(),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:h()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:z()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:a===e._id?f():_(),onSelect:()=>void p(e)},{label:k(),onSelect:()=>void m(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,GA as _,GO as ee,HO as v,IO as y,JO as b,KA as x,KO as te,LO as ne,MO as S,Mk as re,NA as ie,NO as ae,Nk as oe,OO as se,Ok as ce,PA as le,PO as ue,Pk as de,QO as fe,RO as pe,SO as me,Sk as he,TO as ge,Tk as _e,UA as ve,UO as ye,VO as be,WO as xe,XO as Se,YO as Ce,ZO as C,_O as we,_k as Te,ak as Ee,bO as w,bk as De,br as Oe,ck as ke,dk as Ae,ek as je,fO as Me,fk as Ne,gO as Pe,gk as Fe,hO as Ie,hk as Le,ik as Re,jO as ze,jk as Be,kO as Ve,kk as He,lk as Ue,mO as We,mk as Ge,n as Ke,nk as qe,ok as Je,pO as Ye,pk as Xe,qO as Ze,rk as Qe,sk as $e,tk as et,uk as tt,vO as nt,vk as rt,vr as it,wO as at,wk as T,xO as ot,xk as st,xr as E,yO as ct,yk as lt,yr as ut,zO as dt}from"./dist-Dc3VNRsA.js";import{n as D}from"./dist-DhHl81ET.js";import{t as O}from"./x-BR_3jyrW.js";import{t as k}from"./button-BKJGR5Ol.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-FBfe3CjA.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-DqkRcTu-.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-DLKsfSfk.js";import{t as kt}from"./TimeRangePicker-CQKkmGDs.js";import{t as At}from"./FilterBar-DTgQOIHy.js";import{t as jt}from"./AdvancedFilter-DGS0QV-g.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(g());if(e.size>zt)throw Error(ue());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(S());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(S());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(ze());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(ae())),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`?h():e===`dark`?le():ie()}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:Ke(`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":E(),title:E(),children:(0,X.jsx)(pt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=x(f.charts.listMyCharts),r=_(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:m()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:_e()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:T(),subtitle:c(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?he():n.via===`owner`?st():De({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:lt()}):null]})}function Qt(){let e=_(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(C())}}}async function m(){if(s(null),l(!1),t.trim()===``){s(Ce());return}let r;try{r=JSON.parse(i)}catch{s(C());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:Ee()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Re()})]}),(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:Qe()}),(0,X.jsx)(R,{value:t,onChange:e=>n(e.target.value),placeholder:qe(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:et()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:i,onChange:e=>a(e.target.value),placeholder:je(),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`}),r(),(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:fe()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:Se()}):null]})]})}function $t({chart:e}){let t=ve(f.charts.setChartLogo),n=_(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`?v():be()}),(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?dt():o(),(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:ne()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:pe()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ye()}),(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:y()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=x(f.me.getMe,{host:z}),n=_(f.charts.addChartDomain),r=_(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:i()}),(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:p()}):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":ge({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:se(),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:u()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ve()}),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=_(f.charts.updateChart),n=_(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 v(){o(e.name),l(tn(e.tokens)),d(e.tokens.bpm??0),m(null),i(!0)}async function y(){if(e.chartId===void 0)return;m(null);let n;try{n=JSON.parse(c)}catch{m(C());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 b(){if(e.chartId!==void 0&&window.confirm(w()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:v,children:ee()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void b(),children:xe()})]})})]}),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:me()}),(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:Oe()}),(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":Oe()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?ut():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:it()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:ot()}),(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 y(),children:at()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:s()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=x(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:b()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ze()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:te()}):(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=_(f.charts.addChartToGroupPool),r=_(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?Ae():e.kind===`custom`&&e.scope===`personal`?Pe():Ne()}),e.isGlobalDefault?(0,X.jsx)(F,{variant:`default`,children:tt()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ke()}),(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":Je({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:$e()})}),(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:Ue()}):null]})]})}function on({chart:e}){let t=_(f.charts.promoteChartToCommon),n=_(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(w()))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`?Ie():Pe()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:we({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:We()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:Ye()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=_(f.admin.setDefaultThemeMode),i=_(f.admin.setDefaultLocale),o=_(f.charts.setDefaultChart),s=x(f.charts.listChartsAdmin),c=x(f.groups.listGroups,{}),l=e??`system`,u=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:ce()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:d()})]}),(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:rt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Te()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:T()}),vt.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({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:Fe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Le()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:c??[]},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:Ge()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Xe()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).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:ct()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:nt()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Me()}):(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:de()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:oe()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:l===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:re()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Be()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(k,{variant:u===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:a()})]})]})}function cn(){let e=x(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,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Q),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:He()}),(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:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(P,{value:o,onValueChange:s,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:c,onValueChange:l,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:u,onChange:d})]})]})}),(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};