@lacneu/atrium 0.33.0 → 0.34.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 (68) hide show
  1. package/dist/assets/{AccessTab-7ikPRDrZ.js → AccessTab-CnkNBHPE.js} +1 -1
  2. package/dist/assets/{AdvancedFilter-gsdcm_1A.js → AdvancedFilter-DJqYfM0R.js} +1 -1
  3. package/dist/assets/AgentFilesTab-CjDkTO5u.js +3 -0
  4. package/dist/assets/AnomaliesTab-Btl5l0cp.js +1 -0
  5. package/dist/assets/AuditTab-dPXojOCy.js +1 -0
  6. package/dist/assets/BridgeTab-D_OFclma.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-mu8WEgdH.js +1 -0
  8. package/dist/assets/{DataTableShell-DzK-qEdq.js → DataTableShell-DtT6IWK0.js} +1 -1
  9. package/dist/assets/{DetailChips-BIvUUZKQ.js → DetailChips-CN6cfq9J.js} +1 -1
  10. package/dist/assets/FeedbacksTab-TimbsRl3.js +1 -0
  11. package/dist/assets/{FieldLabel-Cz-9BS36.js → FieldLabel-DHRmFB5F.js} +1 -1
  12. package/dist/assets/FilesTab-n8OF2Enb.js +1 -0
  13. package/dist/assets/{FilterBar-CZN4zOuy.js → FilterBar-B58FmRXC.js} +1 -1
  14. package/dist/assets/GroupsTab-Cwo-lxzA.js +1 -0
  15. package/dist/assets/InstancesTab-BrrGQYPt.js +1 -0
  16. package/dist/assets/IntegrationsTab-CnNDTpE1.js +1 -0
  17. package/dist/assets/KpiTab-DjCx7clJ.js +1 -0
  18. package/dist/assets/PreferencesTab-nTPJ_YRA.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-VOGZ2T-K.js +4 -0
  20. package/dist/assets/RolesTab-BR5Wqpbu.js +1 -0
  21. package/dist/assets/ServiceAccountsTab-DjfJ3oP0.js +1 -0
  22. package/dist/assets/SubAgentReportsTab-BQfnnV0J.js +1 -0
  23. package/dist/assets/ThemeShowroom-D-NkvAhX.js +1 -0
  24. package/dist/assets/{TimeRangePicker-DVDywKqe.js → TimeRangePicker-fEd70Mzj.js} +1 -1
  25. package/dist/assets/TracesTab-Dyb2I2EJ.js +1 -0
  26. package/dist/assets/UsersTab-lOVKdpIc.js +1 -0
  27. package/dist/assets/{button-C3T_nXdg.js → button-BIQxgso_.js} +1 -1
  28. package/dist/assets/{card-DESvIpRK.js → card-CLaLoMG5.js} +1 -1
  29. package/dist/assets/chevrons-up-down-CJIw8ui2.js +1 -0
  30. package/dist/assets/{compatView-A0wf8Ngm.js → compatView-DZS9WLeu.js} +1 -1
  31. package/dist/assets/{dispatchErrorInfo-CG5-z2lD.js → dispatchErrorInfo-Crx9497I.js} +1 -1
  32. package/dist/assets/{dist-CpS8aq8T.js → dist-BvWD6-xy.js} +1 -1
  33. package/dist/assets/{dist-C5xpMIpa.js → dist-BwdC4Hrz.js} +1 -1
  34. package/dist/assets/{dist-BJuS9RKK.js → dist-DBtFWMbn.js} +5 -5
  35. package/dist/assets/{dist-B1tb-c2t.js → dist-DQNUMYl3.js} +1 -1
  36. package/dist/assets/{highlighted-body-OFNGDK62-CLCx-LYW.js → highlighted-body-OFNGDK62-B4qPEZuN.js} +1 -1
  37. package/dist/assets/index-DIWGZqm3.js +229 -0
  38. package/dist/assets/mermaid-GHXKKRXX-QiEqdfOE.js +1 -0
  39. package/dist/assets/roleDescriptions-CrpgjGTq.js +1 -0
  40. package/dist/assets/{table-Dgu2YiDE.js → table-UO-VP67W.js} +1 -1
  41. package/dist/assets/{tabs-bHkQWa8h.js → tabs-C35PjHwb.js} +1 -1
  42. package/dist/assets/x-CvI3xVho.js +1 -0
  43. package/dist/index.html +7 -7
  44. package/package.json +1 -1
  45. package/dist/assets/AgentFilesTab-DLXgboNK.js +0 -3
  46. package/dist/assets/AnomaliesTab-CcTaJJF7.js +0 -1
  47. package/dist/assets/AuditTab-B51XdrS-.js +0 -1
  48. package/dist/assets/BridgeTab-B0fJjtmW.js +0 -1
  49. package/dist/assets/ChatDefaultsTab-IJWE_sxZ.js +0 -1
  50. package/dist/assets/FeedbacksTab-CRF5np-W.js +0 -1
  51. package/dist/assets/FilesTab-CUEzcwu7.js +0 -1
  52. package/dist/assets/GroupsTab-q8FOBA9S.js +0 -1
  53. package/dist/assets/InstancesTab-Dl2EJUgc.js +0 -1
  54. package/dist/assets/IntegrationsTab-hTzia7mx.js +0 -1
  55. package/dist/assets/KpiTab-DI8vQ1LD.js +0 -1
  56. package/dist/assets/PreferencesTab-7nFPybn0.js +0 -1
  57. package/dist/assets/PromptInjectionsTab-R-YFEPfz.js +0 -4
  58. package/dist/assets/RolesTab-DTUfolk3.js +0 -1
  59. package/dist/assets/ServiceAccountsTab-WYurhM36.js +0 -1
  60. package/dist/assets/SubAgentReportsTab-DAd0x6y2.js +0 -1
  61. package/dist/assets/ThemeShowroom-BclE06WS.js +0 -1
  62. package/dist/assets/TracesTab-sUddGVLv.js +0 -1
  63. package/dist/assets/UsersTab-DY-84glO.js +0 -1
  64. package/dist/assets/chevrons-up-down-RW5J1Q7S.js +0 -1
  65. package/dist/assets/index-DgeJfwWI.js +0 -229
  66. package/dist/assets/mermaid-GHXKKRXX-BKfbghLf.js +0 -1
  67. package/dist/assets/roleDescriptions-D-TCtebQ.js +0 -1
  68. package/dist/assets/x-DzHSe3Kh.js +0 -1
@@ -0,0 +1 @@
1
+ import{D as e}from"./index-DIWGZqm3.js";export{e as Mermaid};
@@ -0,0 +1 @@
1
+ import{F_ as e,I_ as t,M_ as n,N_ as r,P_ as i}from"./dist-DBtFWMbn.js";var a={pending:t,user:e,admin:i,observer:r,agent:n};function o(e){if(e.builtin){let t=a[e.key];if(t)return t()}return e.description}export{o as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-BJuS9RKK.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-DBtFWMbn.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-BJuS9RKK.js";import{t as d}from"./dist-CpS8aq8T.js";import{gt as f,ht as p,mt as m}from"./index-DgeJfwWI.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-DBtFWMbn.js";import{t as d}from"./dist-BvWD6-xy.js";import{gt as f,ht as p,mt as m}from"./index-DIWGZqm3.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};
@@ -0,0 +1 @@
1
+ import{D as e}from"./dist-DBtFWMbn.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,14 +42,14 @@
42
42
  document.documentElement.dataset.ambiance = a === "off" ? "off" : "on";
43
43
  })();
44
44
  </script>
45
- <script type="module" crossorigin src="/assets/index-DgeJfwWI.js"></script>
45
+ <script type="module" crossorigin src="/assets/index-DIWGZqm3.js"></script>
46
46
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
47
- <link rel="modulepreload" crossorigin href="/assets/dist-BJuS9RKK.js">
48
- <link rel="modulepreload" crossorigin href="/assets/dist-CpS8aq8T.js">
49
- <link rel="modulepreload" crossorigin href="/assets/dist-C5xpMIpa.js">
50
- <link rel="modulepreload" crossorigin href="/assets/dist-B1tb-c2t.js">
51
- <link rel="modulepreload" crossorigin href="/assets/x-DzHSe3Kh.js">
52
- <link rel="modulepreload" crossorigin href="/assets/button-C3T_nXdg.js">
47
+ <link rel="modulepreload" crossorigin href="/assets/dist-DBtFWMbn.js">
48
+ <link rel="modulepreload" crossorigin href="/assets/dist-BvWD6-xy.js">
49
+ <link rel="modulepreload" crossorigin href="/assets/dist-BwdC4Hrz.js">
50
+ <link rel="modulepreload" crossorigin href="/assets/dist-DQNUMYl3.js">
51
+ <link rel="modulepreload" crossorigin href="/assets/x-CvI3xVho.js">
52
+ <link rel="modulepreload" crossorigin href="/assets/button-BIQxgso_.js">
53
53
  <link rel="stylesheet" crossorigin href="/assets/index-BJ8KUScf.css">
54
54
  </head>
55
55
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lacneu/atrium",
3
- "version": "0.33.0",
3
+ "version": "0.34.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,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,Ao as a,Bo as o,Bt as s,Ct as c,Do as l,Dt as u,E as d,Eo as f,Et as p,Fo as m,Fs as h,Ft as g,Go as _,Gt as v,Ho as y,Ht as b,Io as x,It as S,Jo as C,Jt as w,Ko as T,Kt as E,Lo as D,Ls as O,Lt as k,Mo as A,No as j,Oo as M,Po as ee,Pt as N,Qo as te,Qt as P,Ro as F,Rt as I,SA as L,St as R,TA as z,To as ne,Tt as B,Uo as re,Ut as V,Vo as ie,Vt as H,Wo as ae,Wt as oe,Xo as se,Xt as ce,Yo as le,Yt as U,Zo as ue,Zt as de,en as fe,es as pe,gA as W,jo as me,ko as he,lT as ge,qo as _e,qt as ve,vA as G,wA as ye,wt as be,xt as xe,zo as Se,zt as Ce}from"./dist-BJuS9RKK.js";import{t as K}from"./button-C3T_nXdg.js";import{$ as we,B as Te,C as Ee,H as De,I as Oe,L as ke,N as q,R as Ae,S as je,U as Me,V as Ne,_t as J,at as Pe,b as Fe,lt as Ie,nt as Le,ot as Re,rt as ze,tt as Be,v as Ve,x as He,y as Ue,z as We}from"./index-DgeJfwWI.js";import{n as Ge,t as Ke}from"./curation-CQksaIbm.js";import{i as qe}from"./compatView-A0wf8Ngm.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=z(d.me.getMe,{host:Ie}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),i=z(d.admin.listInstances,e!==void 0&&t?{}:`skip`),[a,o]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!t||!i||i.length===0||(!a||!i.some(e=>e.name===a))&&o(i[0].name)},[t,i,a]);let s=z(d.agents.listAgentsForInstance,t&&a?{instanceName:a}:`skip`),c=z(d.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),l=(0,Y.useMemo)(()=>{if(e!==void 0){if(t)return a===null||s===void 0?i!==void 0&&i.length===0?[]:void 0:s.agents.map(e=>({instanceName:a,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(c!==void 0)return c.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,a,s,i,c]),[u,f]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!l||l.length===0||(!u||!l.some(e=>$(e)===u))&&f($(l[0]))},[l,u]);let p=l?.find(e=>$(e)===u)??null,m=L(d.agentFiles.listAgentFiles),[g,v]=(0,Y.useState)({status:`idle`}),b=p?.instanceName??null,x=p?.agentId??null,S=z(d.compat.forInstance,n&&b!==null?{instanceName:b}:`skip`),w=n&&b!==null?Ve(S,`agentFiles`):null,E=w===null?!1:w===`loading`?null:w.blocked,D=(0,Y.useCallback)(async()=>{if(!(b===null||x===null)){v({status:`loading`});try{v({status:`done`,files:(await m({instanceName:b,agentId:x})).files})}catch{v({status:`error`})}}},[m,b,x]);(0,Y.useEffect)(()=>{E===!1&&D()},[D,E]);let[O,k]=(0,Y.useState)(null),A=z(d.agentFileCuration.listCurations,t&&b!==null&&x!==null?{instanceName:b,agentId:x}:`skip`),j=z(d.agentFileCuration.curationSettings,t&&b!==null?{instanceName:b}:`skip`),M=L(d.agentFileCuration.requestCuration),[ee,N]=(0,Y.useState)(null),[P,F]=(0,Y.useState)(null),{toast:I}=q(),R=(0,Y.useMemo)(()=>{let e=new Map;for(let t of A??[])e.has(t.name)||e.set(t.name,t);return e},[A]),ne=(0,Y.useCallback)(async e=>{if(!(b===null||x===null)){N(e);try{let t=await M({instanceName:b,agentId:x,name:e,trigger:`manual`});t.ok?I({title:de(),variant:`success`}):I({title:ce({reason:t.reason??`unknown`}),variant:`error`})}catch{I({title:U(),variant:`error`})}finally{N(null)}}},[M,b,x,I]),B=G(),V=(0,Y.useMemo)(()=>new Intl.NumberFormat(B,{maximumFractionDigits:0}),[B]);return e===void 0||l===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:W()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:pe()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(i?.length??0)>1?(0,Q.jsxs)(Ue,{value:a??``,onValueChange:e=>o(e),children:[(0,Q.jsx)(je,{size:`sm`,"aria-label":r(),children:(0,Q.jsx)(Ee,{})}),(0,Q.jsx)(Fe,{children:(i??[]).map(e=>(0,Q.jsx)(He,{value:e.name,children:e.name},e.name))})]}):null,l.length>0?(0,Q.jsxs)(Ue,{value:u??``,onValueChange:e=>f(e),children:[(0,Q.jsx)(je,{size:`sm`,"aria-label":te(),children:(0,Q.jsx)(Ee,{})}),(0,Q.jsx)(Fe,{children:l.map(e=>(0,Q.jsx)(He,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ue()})]}),p===null?null:w===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:W()}):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:W()}):g.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[le(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void D(),children:h()})]}):g.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:se()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:g.files.map(e=>{let n=Ye(e.size),r=n>=80;return(0,Q.jsxs)(`div`,{className:`oc-afiles__row`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__name`,title:e.name,children:e.name}),e.missing?(0,Q.jsx)(we,{variant:`outline`,children:C()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:_e({size:Z(e.size,B)})}),(0,Q.jsx)(`span`,{className:`oc-afiles__gauge${r?` is-warn`:``}`,"aria-hidden":!0,children:(0,Q.jsx)(`span`,{className:`oc-afiles__gauge-fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,Q.jsx)(`span`,{className:`oc-afiles__pct`,children:T({pct:V.format(n)})}),r?(0,Q.jsx)(J,{size:14,className:`oc-afiles__warn`,"aria-label":_()}):(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:()=>k(e),children:t?re():y()}),t&&!e.missing?(0,Q.jsx)(nt,{curatable:Ke.includes(e.name),size:e.size??0,budget:j?.budgetChars??null,enabled:j?.enabled??!1,curation:R.get(e.name)??null,inFlight:ee===e.name,onCurate:()=>void ne(e.name),onReview:e=>F(e)}):null]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:ae({used:Z(Ze(g.files),B),total:Z(Je,B),pct:V.format(Xe(Ze(g.files)))})})]}),O&&p?(0,Q.jsx)(rt,{instanceName:p.instanceName,agentId:p.agentId,name:O.name,isAdmin:t,onClose:()=>k(null),onSaved:()=>void D()}):null,P?(0,Q.jsx)(it,{curationId:P,onClose:()=>F(null),onApplied:()=>{F(null),D()}}):null]})}function nt({curatable:e,size:t,budget:n,enabled:r,curation:a,inFlight:o,onCurate:s,onReview:c}){return a?.status===`proposed`?(0,Q.jsx)(K,{variant:`default`,size:`sm`,className:`oc-afiles__curate`,onClick:()=>c(a._id),children:i()}):o||a?.status===`dispatched`||a?.status===`applying`?(0,Q.jsx)(we,{variant:`outline`,className:`oc-afiles__curate-status`,children:P()}):e&&r&&n!==null&&Ge(t,n)?(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__curate`,onClick:s,children:fe()}):null}function rt({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:i,onSaved:s}){let c=L(d.agentFiles.getAgentFile),u=L(d.agentFiles.setAgentFile),p=q(),[g,_]=(0,Y.useState)(null),[v,y]=(0,Y.useState)(!1),[b,S]=(0,Y.useState)(``),[C,w]=(0,Y.useState)(!1),[T,E]=(0,Y.useState)(!1),[k,N]=(0,Y.useState)(!1),[te,P]=(0,Y.useState)(!1),I=(0,Y.useCallback)(async r=>{y(!1);try{let i=await c({instanceName:e,agentId:t,name:n});_({content:i.content,updatedAtMs:i.updatedAtMs}),r||S(i.content),N(!1)}catch{y(!0)}},[c,e,t,n]);(0,Y.useEffect)(()=>{I(!1)},[I]);async function R(){if(g!==null){E(!0),P(!1);try{await u({instanceName:e,agentId:t,name:n,content:b,baseUpdatedAtMs:g.updatedAtMs??void 0}),p.success(m({name:n})),s(),await I(!1)}catch(e){et(e)?N(!0):P(!0)}finally{E(!1)}}}let z=g!==null&&b!==g.content,B=(0,Y.useMemo)(()=>g===null?null:$e(g.content,b),[g,b]),re=b.length>X,V=G(),H=(0,Y.useMemo)(()=>new Intl.NumberFormat(V),[V]);return(0,Q.jsx)(Be,{open:!0,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(Le,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(Pe,{children:[(0,Q.jsx)(Re,{children:ie({name:n})}),(0,Q.jsxs)(ze,{children:[o({agent:t,instance:e}),r?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,Se()]})]})]}),v?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[j(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void I(!1),children:h()})]}):g===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:W()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:b,readOnly:!r,spellCheck:!1,onChange:e=>S(e.target.value),"aria-label":ie({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:F()}),k?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[A(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void I(!0),children:me()})]}):null,te?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:ee()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${re?` is-over`:``}`,children:D({count:H.format(b.length),max:H.format(X)})}),r?(0,Q.jsx)(K,{size:`sm`,disabled:!z||T||k,onClick:()=>w(!0),children:T?O():x()}):null]})]}),(0,Q.jsx)(Oe,{open:C,onOpenChange:w,children:(0,Q.jsxs)(We,{children:[(0,Q.jsxs)(De,{children:[(0,Q.jsx)(Me,{children:a({name:n})}),(0,Q.jsx)(Te,{children:he({agent:t})})]}),B?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:M({added:B.added,removed:B.removed})}),B.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:l()}),B.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,B.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:f()}),B.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(Ne,{children:[(0,Q.jsx)(Ae,{children:ge()}),(0,Q.jsx)(ke,{onClick:()=>void R(),children:ne()})]})]})})]})})}function it({curationId:e,onClose:t,onApplied:n}){let r=z(d.agentFileCuration.getProposal,{curationId:e}),i=L(d.agentFileCuration.approveCuration),a=ye(d.agentFileCuration.rejectCuration),{toast:o}=q(),[l,f]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(!1),[_,y]=(0,Y.useState)(``),x=G(),C=(0,Y.useMemo)(()=>r?$e(r.beforeContent,r.proposedContent):null,[r]);async function T(){f(`approve`);try{let t=await i({curationId:e});t.ok?(o({title:w(),variant:`success`}),n()):o({title:t.reason===`conflict`?E():v({reason:t.reason??`unknown`}),variant:`error`})}catch{o({title:U(),variant:`error`})}finally{f(null)}}async function D(n){f(`reject`);try{let r=_.trim();(await a({curationId:e,...r?{comment:r}:{},relaunch:n})).ok?o({title:n?R():ve(),variant:`success`}):o({title:b(),variant:`error`}),t()}catch{o({title:U(),variant:`error`})}finally{f(null)}}return(0,Q.jsx)(Be,{open:!0,onOpenChange:e=>e?void 0:t(),children:(0,Q.jsxs)(Le,{className:`oc-afiles__review`,children:[(0,Q.jsxs)(Pe,{children:[(0,Q.jsx)(Re,{children:r?oe({name:r.name}):W()}),(0,Q.jsx)(ze,{children:V()})]}),r===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:W()}):r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`oc-afiles__review-sizes`,children:[H({before:Z(r.beforeSize,x),after:Z(r.proposedSize,x)}),r.overBudget?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsx)(J,{size:13,"aria-hidden":!0}),` `,s()]}):null]}),C?(0,Q.jsx)(`p`,{className:`oc-afiles__review-diff`,children:Ce({added:C.added,removed:C.removed})}):null,r.feedback?(0,Q.jsx)(`p`,{className:`oc-afiles__review-feedback`,children:xe({feedback:r.feedback})}):null,C&&C.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__review-removed`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:N()}),(0,Q.jsx)(`ul`,{children:C.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:g()}),(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:I()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.proposedContent})]})]})]}),m?(0,Q.jsxs)(`div`,{className:`oc-afiles__reject-form`,children:[(0,Q.jsx)(`label`,{className:`oc-afiles__review-label`,htmlFor:`curation-reject-comment`,children:u()}),(0,Q.jsx)(`textarea`,{id:`curation-reject-comment`,className:`oc-afiles__reject-textarea`,rows:3,placeholder:p(),value:_,onChange:e=>y(e.target.value)}),(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`ghost`,onClick:()=>h(!1),disabled:l!==null,children:B()}),(0,Q.jsx)(K,{variant:`outline`,onClick:()=>void D(!1),disabled:l!==null,children:l===`reject`?O():be()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void D(!0),disabled:l!==null,children:l===`reject`?O():c()})]})]}):(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`outline`,onClick:()=>h(!0),disabled:l!==null||r==null,children:k()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void T(),disabled:l!==null||r==null,children:l===`approve`?O():S()})]})]})})}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,Bg as i,E as a,Fg as o,Gg as ee,Hg as s,Ig as c,Jg as l,Kg as te,Lg as ne,Mg as u,Ng as d,Pg as f,Qg as p,Rg as m,TA as h,Ug as g,Vg as re,Wg as ie,Xg as ae,Yg as _,Zg as v,__ as oe,a_ as se,b_ as y,c_ as ce,d_ as le,e_ as ue,f_ as de,g_ as fe,h_ as pe,i_ as me,l_ as he,m_ as ge,n_ as b,o_ as x,p_ as S,qg as C,r_ as w,s_ as T,t_ as E,u_ as D,v_ as O,wA as k,y_ as A,zg as j}from"./dist-BJuS9RKK.js";import{$ as M,C as N,Ft as P,N as F,P as I,Pt as L,S as R,a as _e,b as z,k as ve,lt as ye,r as be,x as B,y as V}from"./index-DgeJfwWI.js";import{n as xe}from"./TimeRangePicker-DVDywKqe.js";import{t as Se}from"./FilterBar-CZN4zOuy.js";import{t as Ce}from"./DataTableShell-DzK-qEdq.js";import{t as H}from"./dispatchErrorInfo-CG5-z2lD.js";var U=t(e(),1),W=n(),G=`__all__`,we=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function Te(e){return e===`open`?y():e===`acknowledged`?A():O()}var Ee=[`info`,`warn`,`critical`],De=[`detector`,`agent`,`user`],Oe={kind:`relative`,from:`now-30d`,to:`now`},ke=200,K=`all`;function q(){let e=P({from:`/settings/anomalies`}),t=L({from:`/settings/anomalies`}),n=e.q??``,o=e.status===K?G:e.status,u=e.severity??G,d=e.kind??G,[f,y]=(0,U.useState)(G),O=be(e.from,e.to),{from:A,to:H}=xe(O),q=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),J=e=>void t({search:t=>({...t,status:e===G?K:e})}),Y=e=>void t({search:t=>({...t,severity:e===G?void 0:e})}),Pe=e=>void t({search:t=>({...t,kind:e===G?void 0:e})}),Fe=e=>void t({search:t=>({...t,..._e(e)})}),Ie=I(),X=F(),Z=k(a.anomalies.resolveAnomaly),Le=(h(a.me.getMe,{host:ye})?.permissions??[]).includes(`admin.manage`),Q=h(a.anomalies.listAnomalies,{limit:ke,filter:{q:n||void 0,from:A,to:H,anomalyStatus:o===G?void 0:o,severity:u===G?void 0:u,source:f===G?void 0:f,kind:d===G?void 0:d}}),$=(0,U.useMemo)(()=>{let e=new Set;for(let t of Q??[])e.add(t.kind);return[...e].sort()},[Q]),Re=n!==``||o!==`open`||u!==G||f!==G||d!==G||O.kind!==`relative`||O.from!==Oe.from;function ze(){y(G),t({search:{status:`open`},replace:!0})}async function Be(e){if(await Ie({title:oe(),description:(0,W.jsxs)(W.Fragment,{children:[fe(),` `,(0,W.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,pe(),` `,(0,W.jsx)(`strong`,{children:ge()}),`.`,` `,S()]}),confirmLabel:de()}))try{await Z({anomalyId:e._id,status:`resolved`}),X.success(le(),e.kind)}catch(e){X.error(D(),e)}}async function Ve(e){try{await Z({anomalyId:e._id,status:`acknowledged`}),X.success(he(),e.kind)}catch(e){X.error(ce(),e)}}return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`p`,{className:`oc-admin__hint`,children:[T(),` `,(0,W.jsx)(`strong`,{children:x()}),` `,se(),` `,(0,W.jsx)(`strong`,{children:me()}),` `,w(),` `,(0,W.jsx)(`strong`,{children:b()}),` `,E(),` `,(0,W.jsx)(`span`,{className:`oc-filter__window`,children:ue()})]}),(0,W.jsxs)(Se,{q:n,onQChange:q,searchPlaceholder:r(),timeRange:O,onTimeRangeChange:Fe,onReset:ze,canReset:Re,children:[(0,W.jsxs)(V,{value:o,onValueChange:J,children:[(0,W.jsx)(R,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(B,{value:G,children:p()}),we.map(e=>(0,W.jsx)(B,{value:e.value,children:Te(e.value)},e.value))]})]}),(0,W.jsxs)(V,{value:u,onValueChange:Y,children:[(0,W.jsx)(R,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{placeholder:v()})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(B,{value:G,children:ae()}),Ee.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]}),(0,W.jsxs)(V,{value:f,onValueChange:y,children:[(0,W.jsx)(R,{size:`sm`,className:`w-32`,children:(0,W.jsx)(N,{placeholder:_()})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(B,{value:G,children:l()}),De.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]}),(0,W.jsxs)(V,{value:d,onValueChange:Pe,children:[(0,W.jsx)(R,{size:`sm`,className:`w-36`,children:(0,W.jsx)(N,{placeholder:C()})}),(0,W.jsxs)(z,{children:[(0,W.jsx)(B,{value:G,children:te()}),$.map(e=>(0,W.jsx)(B,{value:e,children:e},e))]})]})]}),(0,W.jsx)(Ce,{title:ee(),rows:Q,emptyHint:o===`open`?ie():g(),rowActions:e=>Le&&e.status===`open`?[{label:s(),onSelect:()=>void Be(e)},{label:re(),onSelect:()=>void Ve(e)}]:[],columns:[{header:i(),cell:e=>(0,W.jsx)(`span`,{className:`oc-traces__time`,children:ve(e.at)}),sort:e=>e.at},{header:C(),cell:e=>(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:v(),cell:e=>(0,W.jsx)(je,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:j(),cell:e=>(0,W.jsx)(Me,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:_(),cell:e=>(0,W.jsx)(M,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:m(),cell:e=>(0,W.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),sort:e=>e.message},{header:ne(),cell:e=>(0,W.jsx)(Ae,{row:e}),sort:e=>e.evidence??null},{header:c(),cell:e=>e.correlationId?(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:Ne(e.correlationId)}):(0,W.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function J(e){if(e.kind!==`openclaw.dispatch_failures`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{dominantCode:t.dominantCode,sampleCorrelationId:t.sampleCorrelationId}}catch{return{}}}function Y(e){if(e.kind!==`subagent.failure`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{failedCount:t.failedCount,totalCount:t.totalCount,errorCategories:t.errorCategories}}catch{return{}}}function Ae({row:e}){let t=L();if(e.kind===`subagent.failure`){let n=Y(e);return(0,W.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,W.jsx)(`div`,{className:`oc-anomaly__cause-head`,children:[...new Set(n.errorCategories??[])].map(e=>(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:e},e))}),e.correlationId?(0,W.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:e.correlationId,limit:100}}),children:[`↗ `,o()]}):null]})}let n=J(e);if(!n.dominantCode)return(0,W.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=H(n.dominantCode),i=n.sampleCorrelationId;return(0,W.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,W.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,W.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,W.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,W.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,W.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,o()]}):null]})}function je({severity:e}){return(0,W.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function Me({status:e}){return e===`open`?(0,W.jsx)(M,{variant:`destructive`,children:f()}):e===`acknowledged`?(0,W.jsx)(M,{variant:`secondary`,children:d()}):(0,W.jsx)(M,{variant:`outline`,children:u()})}function Ne(e){return e.length>8?e.slice(0,8):e}export{q as AnomaliesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$ as r,Cv as i,E as a,J as o,Q as s,Sv as c,TA as l,Tv as u,X as d,Y as f,Z as p,_v as m,bv as h,dv as g,fv as _,gv as v,hv as y,mv as b,pv as x,vv as S,wv as C,xv as w,yv as T}from"./dist-BJuS9RKK.js";import{C as E,Ft as D,Pt as O,S as k,a as A,b as j,i as M,k as N,o as P,r as F,t as I,x as L,y as R}from"./index-DgeJfwWI.js";import{n as ee}from"./TimeRangePicker-DVDywKqe.js";import{t as z}from"./FilterBar-CZN4zOuy.js";import{t as B}from"./AdvancedFilter-gsdcm_1A.js";import{t as V}from"./DataTableShell-DzK-qEdq.js";var H=t(e(),1),U=n(),W={kind:`relative`,from:I,to:`now`},G=`__all__`,K=[{value:`action`,label:r()},{value:`realLabel`,label:s()},{value:`targetLabel`,label:p()},{value:`impersonated`,label:d()},{value:`resource`,label:f()},{value:`resourceId`,label:o()}];function q(){let e=D({from:`/settings/audit`}),t=O({from:`/settings/audit`}),n=e.q??``,r=e.action??G,o=e.impersonated??G,s=e.resource??G,d=F(e.from,e.to),f=(0,H.useMemo)(()=>P(e.adv),[e.adv]),{from:p,to:I}=ee(d),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,...A(e)})}),Q=e=>void t({search:t=>({...t,adv:M(e)}),replace:!0}),$=l(a.admin.listAudit,{filter:{q:n||void 0,from:p,to:I,action:r===G?void 0:r,resource:s===G?void 0:s,impersonated:o===G?void 0:o===`yes`,advanced:f.length>0?f: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||o!==G||s!==G||f.length>0||d.kind!==`relative`||d.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:[u(),` `,(0,U.jsx)(`span`,{className:`oc-filter__window`,children:C()})]}),(0,U.jsxs)(z,{q:n,onQChange:q,searchPlaceholder:i(),timeRange:d,onTimeRangeChange:Z,onReset:ie,canReset:re,children:[(0,U.jsxs)(R,{value:r,onValueChange:J,children:[(0,U.jsx)(k,{size:`sm`,className:`w-40`,children:(0,U.jsx)(E,{placeholder:c()})}),(0,U.jsxs)(j,{children:[(0,U.jsx)(L,{value:G,children:w()}),te.map(e=>(0,U.jsx)(L,{value:e,children:e},e))]})]}),(0,U.jsxs)(R,{value:o,onValueChange:Y,children:[(0,U.jsx)(k,{size:`sm`,className:`w-40`,children:(0,U.jsx)(E,{})}),(0,U.jsxs)(j,{children:[(0,U.jsx)(L,{value:G,children:h()}),(0,U.jsx)(L,{value:`yes`,children:T()}),(0,U.jsx)(L,{value:`no`,children:S()})]})]}),(0,U.jsxs)(R,{value:s,onValueChange:X,children:[(0,U.jsx)(k,{size:`sm`,className:`w-40`,children:(0,U.jsx)(E,{placeholder:m()})}),(0,U.jsxs)(j,{children:[(0,U.jsx)(L,{value:G,children:v()}),ne.map(e=>(0,U.jsx)(L,{value:e,children:e},e))]})]})]}),(0,U.jsx)(B,{fields:K,seed:f,onChange:Q}),(0,U.jsx)(V,{title:y(),rows:$,emptyHint:b(),columns:[{header:x(),cell:e=>N(e.at),sort:e=>e.at},{header:c(),cell:e=>e.action,sort:e=>e.action},{header:_(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:g(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:m(),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{$a as r,Am as i,Ap as a,Bp as o,Cm as s,Cp as c,D as l,Dm as u,Dp as d,E as f,Em as p,Ep as m,Fp as h,Gp as ee,Hp as te,Ip as g,Jp as ne,Kp as re,Lp as _,Mm as v,Mp as y,Nm as b,Np as x,Om as ie,Op as S,Pp as C,Qa as ae,Rp as oe,SA as se,Sp as ce,TA as w,Tm as le,Tp as ue,Up as de,Vp as fe,Wp as pe,Xp as me,Yp as he,Za as ge,Zp as _e,_p as T,ao as ve,ap as ye,bm as be,bp as xe,co as Se,cp as Ce,dp as we,eo as Te,fp as Ee,gp as De,hp as Oe,io as ke,ip as E,jp as Ae,km as je,kp as Me,lo as Ne,lp as Pe,mp as Fe,no as Ie,oo as Le,op as Re,pp as ze,qa as Be,qp as Ve,ro as He,rp as D,so as Ue,sp as We,to as Ge,uo as Ke,up as qe,vp as Je,wA as Ye,wm as Xe,wp as Ze,xp as Qe,ym as $e,yp as et,zp as tt}from"./dist-BJuS9RKK.js";import{i as O,r as nt}from"./dist-CpS8aq8T.js";import{t as rt}from"./chevrons-up-down-RW5J1Q7S.js";import{i as it,n as k,o as at,r as ot,s as st}from"./FieldLabel-Cz-9BS36.js";import{t as A}from"./button-C3T_nXdg.js";import{$ as j,A as M,C as N,G as ct,K as lt,Mt as P,N as ut,Nt as F,Pt as dt,S as I,Tt as ft,W as pt,_ as mt,_t as L,at as ht,b as R,bt as gt,et as z,k as B,lt as _t,nt as vt,ot as yt,rt as bt,tt as xt,x as V,y as H}from"./index-DgeJfwWI.js";import{r as St}from"./locales-CPjguROj.js";import{a as Ct,i as wt,n as Tt,o as U,r as W,t as Et}from"./table-Dgu2YiDE.js";import{t as Dt}from"./FilterBar-CZN4zOuy.js";import{a as Ot,n as kt,o as At,r as jt,s as Mt,t as Nt}from"./compatView-A0wf8Ngm.js";import{t as G}from"./dispatchErrorInfo-CG5-z2lD.js";var Pt=l(`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`}]]),Ft=l(`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`}]]),K=t(e(),1);function It(e){return e.filter(e=>e.state===`error`)}function Lt(e){return e.reachable&&It(e.targets).length===0}function Rt(e){return e.state===`error`&&e.lastErrorCode!==null}function zt(e){return!!e.lastDownstreamRejectCode}function q(e){return e.kind??`openclaw`}function Bt(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function Vt(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 Bt(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 Ht(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var J=`__all__`,Ut={q:``,state:J,instance:J,version:J},Y={connected:0,error:1,idle:2};function Wt(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function Gt(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function X(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function Kt(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function qt(e,t,n){switch(e){case`state`:return(Y[t.state]??99)-(Y[n.state]??99);case`instance`:return X(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return X(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return At(e,r)??X(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return X(t.targetLabel,n.targetLabel)}}function Jt(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=Kt(t.key,e),a=Kt(t.key,r);return i&&a?0:i?1:a?-1:n*qt(t.key,e,r)})}function Yt(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(Y[e]??99)-(Y[t]??99))}function Xt(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>X(e.label,t.label))}function Zt(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>At(e,t)??X(e,t))}var Z=n();function Qt({connections:e,displayByInstance:t}){let[n,r]=(0,K.useState)(Ut),[i,a]=(0,K.useState)(null),o=(0,K.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]),s=(0,K.useMemo)(()=>Yt(o),[o]),c=(0,K.useMemo)(()=>Xt(o),[o]),l=(0,K.useMemo)(()=>Zt(o),[o]),u=(0,K.useMemo)(()=>Jt(Gt(o,n),i),[o,n,i]);function d(e){a(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Qe()}):(0,Z.jsxs)(`div`,{className:`oc-conn`,children:[(0,Z.jsxs)(Dt,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:Je(),onReset:()=>r(Ut),canReset:Wt(n),children:[(0,Z.jsxs)(H,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Z.jsx)(I,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(N,{placeholder:De()})}),(0,Z.jsxs)(R,{children:[(0,Z.jsx)(V,{value:J,children:T()}),s.map(e=>(0,Z.jsx)(V,{value:e,children:en(e)},e))]})]}),(0,Z.jsxs)(H,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Z.jsx)(I,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(N,{placeholder:Oe()})}),(0,Z.jsxs)(R,{children:[(0,Z.jsx)(V,{value:J,children:T()}),c.map(e=>(0,Z.jsx)(V,{value:e.name,children:e.label},e.name))]})]}),(0,Z.jsxs)(H,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Z.jsx)(I,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(N,{placeholder:Fe()})}),(0,Z.jsxs)(R,{children:[(0,Z.jsx)(V,{value:J,children:T()}),l.map(e=>(0,Z.jsx)(V,{value:e,children:e},e))]})]})]}),u.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ze()}):(0,Z.jsxs)(Et,{className:`oc-conn__table`,children:[(0,Z.jsx)(Ct,{children:(0,Z.jsxs)(U,{children:[(0,Z.jsx)(Q,{label:Ee(),sortKey:`target`,sort:i,onSort:d}),(0,Z.jsx)(Q,{label:we(),sortKey:`state`,sort:i,onSort:d}),(0,Z.jsx)(Q,{label:qe(),sortKey:`instance`,sort:i,onSort:d}),(0,Z.jsx)(Q,{label:Pe(),sortKey:`host`,sort:i,onSort:d}),(0,Z.jsx)(Q,{label:Ce(),sortKey:`version`,sort:i,onSort:d}),(0,Z.jsx)(wt,{children:We()}),(0,Z.jsx)(Q,{label:Re(),sortKey:`lastOk`,sort:i,onSort:d})]})}),(0,Z.jsx)(Tt,{children:u.map(e=>(0,Z.jsx)($t,{r:e},e._id))})]})]})}function Q({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Z.jsx)(wt,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Z.jsx)(nt,{size:13,"aria-hidden":!0}):(0,Z.jsx)(O,{size:13,"aria-hidden":!0}):(0,Z.jsx)(rt,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function $t({r:e}){let t=Rt(e)?G(e.lastErrorCode):null,n=zt(e)?G(e.lastDownstreamRejectCode):null;return(0,Z.jsxs)(K.Fragment,{children:[(0,Z.jsxs)(U,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Z.jsx)(W,{children:(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Z.jsx)(W,{children:(0,Z.jsx)(tn,{state:e.state})}),(0,Z.jsx)(W,{children:e.instanceLabel?(0,Z.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(W,{children:(0,Z.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Z.jsx)(W,{children:e.gatewayVersion?(0,Z.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(W,{children:(0,Z.jsx)(`span`,{className:`oc-conn__stats`,children:xe({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Z.jsx)(W,{children:e.lastOkAt?(0,Z.jsx)(`span`,{className:`oc-traces__mono`,children:M(e.lastOkAt)}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Z.jsx)(U,{className:`oc-conn__detail-row`,children:(0,Z.jsxs)(W,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Z.jsx)(`strong`,{children:t.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${M(e.lastErrorAt)}`:``,(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[et({label:n.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${M(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function en(e){return e===`connected`?ye():e===`error`?E():D()}function tn({state:e}){return e===`connected`?(0,Z.jsx)(j,{variant:`secondary`,children:ye()}):e===`error`?(0,Z.jsx)(j,{variant:`destructive`,children:E()}):(0,Z.jsx)(j,{variant:`outline`,children:D()})}function nn(){return w(f.bridgeHealth.getBridgeHealth,{})}function rn(){let e=nn(),t=w(f.compat.getBridgeCompat,{}),n=w(f.me.getMe,{host:_t})?.role===`admin`,r=w(f.admin.listInstances,n?{}:`skip`),i=dt(),a=()=>void i({to:`/settings/anomalies`,search:{status:`open`}}),o=Vt(e?e.targets:[],t?t.targets:[],r??[]),s=t?.compat??null,c=t===void 0?`loading`:t===null?`nodata`:`ready`,l=s!==null&&kt(s,`hermes`)&&!o.some(e=>e.key===`hermes`);return(0,Z.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Z.jsx)(an,{health:e,compat:t,onSeeAnomalies:a}),(0,Z.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:_()}),o.map(e=>(0,Z.jsx)(on,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:s,compatStatus:c,compatReachable:t?.reachable??!0,protocol:e.key===`openclaw`?t?.protocol??null:null},e.key)),l?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Be()}):null]})}function an({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,o=t&&t!==null?(0,Z.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:Ot(t.bridgeVersion)}),i?(0,Z.jsxs)(Z.Fragment,{children:[` `,(0,Z.jsxs)(`code`,{className:`oc-traces__mono`,title:Se(),children:[`(`,i,`)`]})]}):null,r?(0,Z.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,Ue({build:t.buildVersion??`?`})]}):null,` · `,Le(),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?ve():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:a()});if(e===null)return(0,Z.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:Me()});let s=It(e.targets),l=!e.reachable,u=Lt(e),f=u?`ok`:`error`,p=B(e.checkedAt),h=e.startedAt==null?null:B(e.startedAt);return(0,Z.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${f}`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:u?(0,Z.jsx)(P,{size:22}):l?(0,Z.jsx)(Ft,{size:22}):(0,Z.jsx)(L,{size:22})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__title`,children:u?S():l?d():m({count:s.length})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(Pt,{size:12,"aria-hidden":!0}),` `,ue({time:p})]}),h?(0,Z.jsx)(`span`,{children:Ze({time:h})}):null,o]}),l?(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:G(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Z.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:c()})]})}function on({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a,protocol:o}){let s=r?Mt(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:Nt(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,K.useState)(!1);return(0,Z.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Z.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Z.jsx)(gt,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Z.jsx)(`span`,{className:`oc-bridge-provider__name`,children:Ht(e)}),f?(0,Z.jsx)(j,{variant:f===`beyond`?`destructive`:`secondary`,children:jt(f)}):null]}),(0,Z.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:Ke()}),(0,Z.jsx)(cn,{support:s,compatStatus:i,compatReachable:a,manifest:r,instanceRows:l}),o?(0,Z.jsx)(sn,{protocol:o}):null,(0,Z.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":p,onClick:()=>m(e=>!e),children:[p?(0,Z.jsx)(O,{size:13,"aria-hidden":!0}):(0,Z.jsx)(F,{size:13,"aria-hidden":!0}),ce({count:t.length})]}),p?(0,Z.jsx)(Qt,{connections:t,displayByInstance:c}):null]})}function sn({protocol:e}){let[t,n]=(0,K.useState)(!1),r=e.coverage,i=e.drift??[];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`h4`,{className:`oc-bridge-provider__sub`,children:[g(),i.length>0?(0,Z.jsx)(j,{variant:`destructive`,children:C({count:i.length})}):(0,Z.jsx)(j,{variant:`secondary`,children:h()})]}),(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[x({version:e.vendoredVersion}),r?` · `+y({handled:r.handled,ignored:r.ignored,gaps:r.gaps}):null]}),i.length>0?(0,Z.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:i.map(e=>(0,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.shape}),` × `,e.count]},e.shape))}):null,r&&r.gapList.length>0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[t?(0,Z.jsx)(O,{size:13,"aria-hidden":!0}):(0,Z.jsx)(F,{size:13,"aria-hidden":!0}),Ae({count:r.gapList.length})]}),t?(0,Z.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:r.gapList.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e})},e))}):null]}):null]})}function cn({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i}){return t===`loading`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):t===`nodata`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Ne()}):(0,Z.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ke()}),r===null?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:He()}):(0,Z.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__label`,children:Ie()}),e&&e.range!==null?(0,Z.jsx)(`span`,{children:Ge({min:e.range.min,max:e.range.maxValidated})}):(0,Z.jsx)(`span`,{children:ve()}),e?(0,Z.jsx)(dn,{versions:e.validatedVersions}):null]}),i.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ge()}):(0,Z.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,Z.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:Ot(e.version)}),(0,Z.jsx)(j,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:jt(e.state)})]},e.instanceName))})]})}function ln({instance:e,onClose:t}){return(0,Z.jsx)(xt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(vt,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(ht,{children:[(0,Z.jsx)(yt,{children:b({instance:e.displayName??e.name})}),(0,Z.jsx)(bt,{children:v()})]}),(0,Z.jsx)(un,{instance:e,onClose:t})]})})}function $({label:e,result:t}){return t?t.checked?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,Z.jsx)(P,{"aria-hidden":!0}):(0,Z.jsx)(L,{"aria-hidden":!0}),(0,Z.jsxs)(`span`,{children:[e,` — `,t.ok?fe():t.detail]})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,o()]}):null}function un({instance:e,onClose:t}){let n=Ye(f.admin.upsertInstanceConfig),r=se(f.bridge.validateMediaPaths),a=ut(),o=St(e.config?.contentLocale,void 0),[c,l]=(0,K.useState)(()=>it(e.config??{},o)),[d,m]=(0,K.useState)(!1),[h,g]=(0,K.useState)(!1),[_,v]=(0,K.useState)(null),y=c.inboundMediaMode===`shared-fs`,b=c.mediaMode===`shared-fs`,x=y||b;async function S(){g(!0),v(null);try{v(await r({instanceName:e.name,inboundMediaMode:c.inboundMediaMode,mediaMode:c.mediaMode}))}catch(e){a.error(ee(),e)}finally{g(!1)}}async function C(){m(!0);try{let r=e.config??{};await n({instanceId:e._id,config:ot(c,r,o)}),t()}catch(e){a.error(le(),e)}finally{m(!1)}}return(0,Z.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Z.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(k,{label:i(),help:Xe()}),(0,Z.jsxs)(H,{value:c.mediaMode,onValueChange:e=>l({...c,mediaMode:e}),children:[(0,Z.jsx)(I,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(N,{})}),(0,Z.jsx)(R,{children:st.map(e=>(0,Z.jsx)(V,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(k,{label:je(),help:s()}),(0,Z.jsxs)(H,{value:c.inboundMediaMode,onValueChange:e=>l({...c,inboundMediaMode:e}),children:[(0,Z.jsx)(I,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(N,{})}),(0,Z.jsx)(R,{children:at.map(e=>(0,Z.jsx)(V,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(k,{label:ie(),help:be()}),(0,Z.jsx)(z,{type:`number`,min:1,max:4096,className:`w-full`,value:c.mediaMaxMb,onChange:e=>l({...c,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),x&&(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[y&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(k,{label:_e(),help:me()}),(0,Z.jsx)(z,{className:`w-full`,spellCheck:!1,value:c.inboundAgentMount,onChange:e=>l({...c,inboundAgentMount:e.target.value})})]}),b&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(k,{label:he(),help:ne()}),(0,Z.jsx)(z,{className:`w-full`,spellCheck:!1,value:c.outboundAgentMount,onChange:e=>l({...c,outboundAgentMount:e.target.value})})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Z.jsx)(mt,{checked:c.rehydration,onCheckedChange:e=>l({...c,rehydration:e===!0})}),(0,Z.jsx)(k,{label:u(),help:$e()})]}),x&&_!==null&&(0,Z.jsx)(`div`,{className:`oc-bridge-config__check`,children:_.reachable?!_.inbound&&!_.outbound?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(L,{"aria-hidden":!0}),oe({reason:_.reason??`?`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:de(),result:_.inbound}),(0,Z.jsx)($,{label:te(),result:_.outbound}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:pe()})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(L,{"aria-hidden":!0}),tt()]})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[x&&(0,Z.jsxs)(A,{variant:`outline`,size:`sm`,onClick:()=>void S(),disabled:h,children:[h?(0,Z.jsx)(ft,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,h?re():Ve()]}),(0,Z.jsx)(A,{size:`sm`,onClick:()=>void C(),disabled:d,children:p()})]})]})})}function dn({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Z.jsxs)(pt,{children:[(0,Z.jsx)(lt,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?Te():r({count:e.length}),(0,Z.jsx)(O,{size:13,"aria-hidden":!0})]})}),(0,Z.jsxs)(ct,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Z.jsx)(`p`,{className:`oc-compat__versions-title`,children:ae()}),(0,Z.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Z.jsx)(j,{variant:`secondary`,children:e},e))})]})]})}export{rn as BridgeTab,ln as InstanceConfigDialog};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$o as r,As as i,Bn as a,Co as o,E as s,Fs as c,Gn as l,Hn as u,Ls as d,SA as f,So as p,TA as m,Un as h,Vn as g,Wn as _,_o as v,bo as y,do as b,fo as x,gA as S,go as C,ho as w,jm as ee,js as te,lT as ne,mo as T,po as re,vo as E,wA as D,xo as O,yo as k,zn as A}from"./dist-BJuS9RKK.js";import{t as j}from"./button-C3T_nXdg.js";import{B as ie,C as ae,H as oe,I as se,L as ce,N as le,R as ue,S as de,U as fe,V as M,_ as N,_t as P,b as F,et as I,g as L,h as R,v as z,x as B,y as V,z as pe}from"./index-DgeJfwWI.js";import{i as me}from"./compatView-A0wf8Ngm.js";/* empty css */var H=t(e(),1),he=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function ge(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 U=n();function _e({instance:e}){let t=D(s.admin.upsertInstanceConfig),n=e.config?.curationEnabled===!0,r=typeof e.config?.curationBudgetChars==`number`?e.config.curationBudgetChars:null,[i,o]=(0,H.useState)(n),[c,l]=(0,H.useState)(r===null?``:String(r)),[f,p]=(0,H.useState)(`idle`);(0,H.useEffect)(()=>{o(n),l(r===null?``:String(r)),p(`idle`)},[e._id,n,r]);let m=c.trim(),_=m===``?null:/^\d+$/.test(m)?Number.parseInt(m,10):NaN,y=!i||_===null||Number.isInteger(_)&&_>=4e3&&_<=6e4,b=i!==n||(_??null)!==r;async function x(){p(`saving`);try{let n={...e.config??{}};n.curationEnabled=i,!i||_===null||Number.isNaN(_)?delete n.curationBudgetChars:n.curationBudgetChars=_,await t({instanceId:e._id,config:n}),p(`done`)}catch{p(`error`)}}return(0,U.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,U.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,U.jsx)(N,{checked:i,onCheckedChange:e=>o(e===!0),"aria-label":h()}),(0,U.jsx)(`span`,{className:`oc-cdefaults__label`,children:h()})]}),(0,U.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,U.jsx)(I,{type:`number`,min:4e3,max:6e4,step:1e3,placeholder:`20000`,value:c,onChange:e=>l(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!y,"aria-label":u(),disabled:!i}),(0,U.jsx)(j,{size:`sm`,disabled:!b||!y||f===`saving`,onClick:()=>void x(),children:f===`saving`?d():v()})]}),y?null:(0,U.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:g()}),f===`done`?(0,U.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:C()}):null,f===`error`?(0,U.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:w()}):null,(0,U.jsx)(`p`,{className:`oc-cdefaults__help`,children:a()})]})}function ve({instance:e}){let t=D(s.admin.upsertInstanceConfig),n=typeof e.config?.summarizeThresholdChars==`number`?e.config.summarizeThresholdChars:null,[r,i]=(0,H.useState)(n===null?``:String(n)),[a,o]=(0,H.useState)(`idle`);(0,H.useEffect)(()=>{i(n===null?``:String(n)),o(`idle`)},[e._id,n]);let c=r.trim(),u=c===``?null:/^\d+$/.test(c)?Number.parseInt(c,10):NaN,f=u===null||Number.isInteger(u)&&u>=1e3&&u<=2e5,p=(u??null)!==n;async function m(){o(`saving`);try{let n={...e.config??{}};u===null?delete n.summarizeThresholdChars:n.summarizeThresholdChars=u,await t({instanceId:e._id,config:n}),o(`done`)}catch{o(`error`)}}return(0,U.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,U.jsx)(`span`,{className:`oc-cdefaults__label`,children:l()}),(0,U.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,U.jsx)(I,{type:`number`,min:1e3,max:2e5,step:1e3,placeholder:`8000`,value:r,onChange:e=>i(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!f}),(0,U.jsx)(j,{size:`sm`,disabled:!p||!f||a===`saving`,onClick:()=>void m(),children:a===`saving`?d():v()})]}),f?null:(0,U.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:A()}),a===`done`?(0,U.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:C()}):null,a===`error`?(0,U.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:w()}):null,(0,U.jsx)(`p`,{className:`oc-cdefaults__help`,children:_()})]})}function W(){let e=f(s.agentFiles.getChatDefaults),t=f(s.agentFiles.setChatDefaults),n=le(),[a,l]=(0,H.useState)({status:`loading`}),[u,h]=(0,H.useState)({thinkingDefault:null,fastModeDefault:null}),[g,_]=(0,H.useState)(!1),[D,A]=(0,H.useState)(!1),N=m(s.admin.listInstances,{}),[I,W]=(0,H.useState)(null);(0,H.useEffect)(()=>{!N||N.length===0||(!I||!N.some(e=>e.name===I))&&W(N[0].name)},[N,I]);let G=(N?.length??0)>1,ye=N!==void 0&&N.length===0,be=m(s.compat.forInstance,I?{instanceName:I}:`skip`),K=I?z(be,`configDefaults`):`loading`,q=K===`loading`?null:K.blocked,J=(0,H.useMemo)(()=>G&&I?{instanceName:I}:{},[G,I]),Y=(0,H.useRef)(0),X=(0,H.useCallback)(async()=>{let t=++Y.current;l({status:`loading`});try{let n=ge(await e(J));if(Y.current!==t)return;l({status:`done`,current:n}),h(n)}catch{if(Y.current!==t)return;l({status:`error`})}},[e,J]);(0,H.useEffect)(()=>{q===!1&&(G&&!I||X())},[X,q,G,I]);let Z=a.status===`done`?a.current:null,Q=Z!==null&&u.thinkingDefault!==null&&u.thinkingDefault!==Z.thinkingDefault,$=Z!==null&&u.fastModeDefault!==null&&u.fastModeDefault!==Z.fastModeDefault,xe=Q||$;async function Se(){A(!0);try{await t({...J,...Q?{thinkingDefault:u.thinkingDefault}:{},...$?{fastModeDefault:u.fastModeDefault}:{}}),n.success(C()),await X()}catch(e){n.error(w(),e)}finally{A(!1)}}let Ce=(0,H.useMemo)(()=>he.map(e=>({id:e,label:L(e)})),[]),we=(0,H.useMemo)(()=>[{id:`fast`,label:te()},{id:`standard`,label:i()}],[]);return(0,U.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:o()}),G&&I?(0,U.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,U.jsx)(`span`,{className:`oc-cdefaults__label`,children:r()}),(0,U.jsxs)(V,{value:I,onValueChange:e=>W(e),disabled:D,children:[(0,U.jsx)(de,{size:`sm`,"aria-label":r(),children:(0,U.jsx)(ae,{})}),(0,U.jsx)(F,{children:(N??[]).map(e=>(0,U.jsx)(B,{value:e.name,children:e.name},e.name))})]})]}):null,ye?(0,U.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:ee()}):K===`loading`?(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):K.blocked?(0,U.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,U.jsx)(P,{size:14,"aria-hidden":!0}),` `,me(K.gatewayVersion)]}):a.status===`loading`?(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):a.status===`error`?(0,U.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[E(),` `,(0,U.jsx)(j,{variant:`outline`,size:`sm`,onClick:()=>void X(),children:c()})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,U.jsx)(`span`,{className:`oc-cdefaults__label`,children:p()}),(0,U.jsx)(R,{options:Ce,value:u.thinkingDefault,onChange:e=>h({...u,thinkingDefault:e}),disabled:D}),(0,U.jsx)(`p`,{className:`oc-cdefaults__help`,children:O()})]}),(0,U.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,U.jsx)(`span`,{className:`oc-cdefaults__label`,children:y()}),(0,U.jsx)(R,{options:we,value:u.fastModeDefault===null?null:u.fastModeDefault?`fast`:`standard`,onChange:e=>h({...u,fastModeDefault:e===`fast`}),disabled:D}),(0,U.jsx)(`p`,{className:`oc-cdefaults__help`,children:k()})]}),(0,U.jsx)(`div`,{className:`oc-cdefaults__actions`,children:(0,U.jsx)(j,{size:`sm`,disabled:!xe||D,onClick:()=>_(!0),children:D?d():v()})}),(0,U.jsx)(`p`,{className:`oc-cdefaults__note`,children:T()})]}),(()=>{let e=N?.find(e=>e.name===(I??N[0]?.name));return e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ve,{instance:e}),(0,U.jsx)(_e,{instance:e})]}):null})(),(0,U.jsx)(se,{open:g,onOpenChange:_,children:(0,U.jsxs)(pe,{children:[(0,U.jsxs)(oe,{children:[(0,U.jsx)(fe,{children:re()}),(0,U.jsx)(ie,{children:x()})]}),(0,U.jsxs)(M,{children:[(0,U.jsx)(ue,{children:ne()}),(0,U.jsx)(ce,{onClick:()=>void Se(),children:b()})]})]})})]})}export{W as ChatDefaultsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$b as r,Ax as i,Bb as a,Bx as o,Cx as s,Dx as c,E as l,Ex as u,Fx as d,Gb as f,Hb as p,Ix as m,Jb as h,Kb as ee,Lx as g,Mx as te,Nx as ne,Ox as re,Px as ie,Qb as ae,Rx as oe,Sx as _,TA as v,Tx as y,Ub as b,Vb as x,Vx as S,Wb as C,Xb as w,Yb as T,Zb as E,_x as D,ax as O,bx as k,cx as A,dx as j,ex as M,fx as N,gx as P,hx as F,in as I,ix as L,jx as R,kx as z,lx as B,mx as se,nx as V,on as H,ox as U,px as W,qb as G,rx as K,sx as ce,tx as le,ux as ue,vx as de,wA as q,wx as fe,xx as J,yx as pe,zx as me}from"./dist-BJuS9RKK.js";import{t as he}from"./button-C3T_nXdg.js";import{P as ge,k as _e}from"./index-DgeJfwWI.js";import{t as Y}from"./DataTableShell-DzK-qEdq.js";var X=t(e(),1),Z=n(),ve={altered_words:()=>S(),incorrect:()=>o(),incoherence:()=>me(),formatting:()=>oe(),latency:()=>g(),api_error:()=>m(),other:()=>d()},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:ne()}):e===!1?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:te()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:ie()})}function ye({data:e,closeReason:t}){let n=e.snapshot,r=q(l.feedback.respondToFeedback),[a,o]=(0,X.useState)(e.thread),[d,f]=(0,X.useState)(``),[p,m]=(0,X.useState)(!1);async function h(){let t=d.trim();if(!(!t||p)){m(!0);try{await r({feedbackId:e._id,text:t}),o(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),f(``)}finally{m(!1)}}}let g=[];try{g=n.contextJson?JSON.parse(n.contextJson):[]}catch{g=[]}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?` · ${R()}`:``,n.openclawModel?` · ${n.openclawModel}`:``,n.openclawRuntime?` (${n.openclawRuntime})`:``]})]}),e.comment?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:i()}),(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:ee()}),(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:z()}),a.length>0?(0,Z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:a.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`?re():e.authorRole===`agent`?e.authorLabel??H():c()}),(0,Z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:u()}),(0,Z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:y(),value:d,maxLength:2e3,rows:3,onChange:e=>f(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 h(),disabled:!d.trim()||p,children:p?fe():s()})})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:_()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.messageText||J()})]}),n.clientInfo?.sourceWasOpen&&n.displayedText!==void 0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:k()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.displayedText||J()})]}):null,n.promptText?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:pe()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:n.promptText})]}):null,g.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:de({count:n.contextCount??g.length,truncated:n.contextTruncated?D():``})}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:g.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:P()}),(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:F()}),(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:se()}),(0,Z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[n.clientInfo?.language,n.clientInfo?.timezone,n.clientInfo?.theme?W({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:[N(),` `,n.clientInfo.plugins.join(`, `),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,j()]})]}):null,n.clientInfo?.userAgent?(0,Z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:n.clientInfo.userAgent}):null]})]})]})}function be(){let e=v(l.feedback.listForAdmin,{}),t=q(l.feedback.readSnapshot),n=q(l.feedback.deleteFeedback),i=ge(),[o,s]=(0,X.useState)(null),[c,u]=(0,X.useState)({});async function d(e){if(o===e._id){s(null);return}if(!c[e._id]){let n=await t({feedbackId:e._id});u(t=>({...t,[e._id]:n}))}s(e._id)}async function m(e){await i({title:p(),description:x(),confirmLabel:a(),destructive:!0})&&(await n({feedbackId:e._id}),o===e._id&&s(null))}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[ue(),` `,(0,Z.jsx)(`strong`,{children:B()}),` `,A()]}),(0,Z.jsx)(Y,{title:ce(),rows:e,emptyHint:U(),isExpanded:e=>o===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Z.jsx)(ye,{data:c[e._id],closeReason:e.userCloseReason}):null,columns:[{header:O(),cell:e=>_e(e.at),sort:e=>e.at},{header:L(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:K(),cell:e=>e.messageRole===`user`?V():le(),sort:e=>e.messageRole},{header:M(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${r({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:ae(),cell:e=>(0,Z.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:E(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:w(),cell:e=>e.userClosedAt==null?e.resolvedAt==null?e.answered?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:T()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:h()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,title:e.resolvedBy??void 0,children:I()}):(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:o===e._id?f():C(),onSelect:()=>void d(e)},{label:b(),onSelect:()=>void m(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{Ak as r,Bk as i,Ck as a,Dk as ee,E as o,Ek as s,Fk as c,Gk as te,Hk as ne,Ik as l,Jk as re,Kk as u,Lk as d,Mk as f,Nk as p,Ok as ie,Pk as m,Rk as h,Sk as ae,TA as oe,Tk as se,Uk as ce,Vk as le,Wk as ue,Xk as de,Yk as fe,_k as pe,bk as me,gA as he,gk as ge,hk as _e,jk as ve,kk as ye,lT as be,ln as xe,qk as g,un as _,vA as v,vk as y,wA as b,wk as x,xk as S,yk as C,zk as w}from"./dist-BJuS9RKK.js";import{t as T}from"./button-C3T_nXdg.js";import{$ as E,B as D,C as O,H as k,I as A,J as j,L as M,N as Se,Ot as Ce,Q as we,R as Te,S as N,St as Ee,U as De,V as Oe,Y as P,_ as ke,b as F,kt as I,q as Ae,vt as je,x as L,y as R,z as Me}from"./index-DgeJfwWI.js";import{a as Ne,i as z,n as Pe,o as B,r as V,t as Fe}from"./table-Dgu2YiDE.js";var H=t(e(),1),U=n(),W=`all`;function G(e){switch(e){case`image`:return w();case`audio`:return h();case`video`:return d();case`pdf`:return l();case`document`:return c();case`archive`:return m();default:return p()}}function K(){let[e,t]=(0,H.useState)(W),[n,c]=(0,H.useState)(W),[l,d]=(0,H.useState)(W),[p,m]=(0,H.useState)(W),[h,w]=(0,H.useState)(!1),[K,q]=(0,H.useState)(null),J=b(o.files.softDelete),Y=Se();function Ie(){t(W),c(W),d(W),m(W)}async function Le(){let e=K;if(q(null),e)try{await J({fileId:e.id}),Y.success(ae())}catch(e){Y.error(S(),e)}}let X=oe(o.files.listMine,{direction:e===W?void 0:e,chatId:n===W?void 0:n,instanceName:l===W?void 0:l,category:p===W?void 0:p,includeAutoGenerated:h||void 0}),Re=(0,H.useMemo)(()=>new Intl.DateTimeFormat(v(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:he()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==W||n!==W||l!==W||p!==W;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:de()}),(0,U.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,U.jsxs)(R,{value:e,onValueChange:t,children:[(0,U.jsx)(N,{size:`sm`,"aria-label":fe(),children:(0,U.jsx)(O,{})}),(0,U.jsxs)(F,{children:[(0,U.jsx)(L,{value:W,children:re()}),(0,U.jsx)(L,{value:`inbound`,children:g()}),(0,U.jsx)(L,{value:`outbound`,children:u()})]})]}),(0,U.jsxs)(R,{value:n,onValueChange:c,children:[(0,U.jsx)(N,{size:`sm`,"aria-label":te(),children:(0,U.jsx)(O,{})}),(0,U.jsxs)(F,{children:[(0,U.jsx)(L,{value:W,children:ue()}),Q.chats.map(e=>(0,U.jsx)(L,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,U.jsxs)(R,{value:l,onValueChange:d,children:[(0,U.jsx)(N,{size:`sm`,"aria-label":ce(),children:(0,U.jsx)(O,{})}),(0,U.jsxs)(F,{children:[(0,U.jsx)(L,{value:W,children:ne()}),Q.instances.map(e=>(0,U.jsx)(L,{value:e,children:e},e))]})]}):null,(0,U.jsxs)(R,{value:p,onValueChange:m,children:[(0,U.jsx)(N,{size:`sm`,"aria-label":le(),children:(0,U.jsx)(O,{})}),(0,U.jsxs)(F,{children:[(0,U.jsx)(L,{value:W,children:i()}),Q.categories.map(e=>(0,U.jsx)(L,{value:e,children:G(e)},e))]})]}),(0,U.jsxs)(`label`,{className:`oc-files__autogen`,children:[(0,U.jsx)(ke,{checked:h,onCheckedChange:e=>w(e===!0),"aria-label":_()}),(0,U.jsx)(`span`,{children:_()})]}),$?(0,U.jsxs)(T,{variant:`ghost`,size:`sm`,onClick:Ie,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,U.jsx)(Ee,{size:14,"aria-hidden":!0}),se()]}):null]}),Z.length===0?(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:$?ge():pe()}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(Fe,{children:[(0,U.jsx)(Ne,{children:(0,U.jsxs)(B,{children:[(0,U.jsx)(z,{children:f()}),(0,U.jsx)(z,{children:ve()}),(0,U.jsx)(z,{children:r()}),(0,U.jsx)(z,{children:ye()}),(0,U.jsx)(z,{children:ie()}),(0,U.jsx)(z,{className:`text-right`,children:ee()})]})}),(0,U.jsx)(Pe,{children:Z.map(e=>(0,U.jsxs)(B,{children:[(0,U.jsxs)(V,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:[e.filename,e.origin===`pasted`?(0,U.jsx)(E,{variant:`outline`,style:{marginLeft:6},children:xe()}):null]}),(0,U.jsx)(V,{title:e.mimeType,children:G(e.category)}),(0,U.jsx)(V,{children:(0,U.jsx)(E,{variant:`secondary`,children:e.direction===`inbound`?g():u()})}),(0,U.jsx)(V,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,U.jsx)(V,{className:`whitespace-nowrap text-muted-foreground`,children:Re.format(e.createdAt)}),(0,U.jsx)(V,{className:`text-right`,children:(0,U.jsxs)(Ae,{children:[(0,U.jsx)(we,{asChild:!0,children:(0,U.jsx)(T,{variant:`ghost`,size:`icon`,"aria-label":x(),children:(0,U.jsx)(Ce,{size:16})})}),(0,U.jsxs)(j,{align:`end`,children:[e.url?(0,U.jsx)(P,{asChild:!0,children:(0,U.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,U.jsx)(I,{size:14}),s()]})}):(0,U.jsxs)(P,{disabled:!0,children:[(0,U.jsx)(I,{size:14}),y()]}),(0,U.jsxs)(P,{variant:`destructive`,onSelect:()=>q({id:e._id,filename:e.filename}),children:[(0,U.jsx)(je,{size:14}),a()]})]})]})})]},e._id))})]}),ze?(0,U.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:_e({cap:Be})}):null]}),(0,U.jsx)(A,{open:K!==null,onOpenChange:e=>!e&&q(null),children:(0,U.jsxs)(Me,{children:[(0,U.jsxs)(k,{children:[(0,U.jsx)(De,{children:me()}),(0,U.jsx)(D,{children:C()})]}),(0,U.jsxs)(Oe,{children:[(0,U.jsx)(Te,{children:be()}),(0,U.jsx)(M,{onClick:()=>void Le(),children:a()})]})]})})]})}export{K 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,$s as i,Ac as a,Bc as o,Cc as s,D as c,Dc as l,E as u,Ec as d,Fc as f,Gc as p,Hc as m,Ic as h,Jc as g,Kc as _,Lc as v,Mc as y,Nc as b,Oc as x,Pc as S,Qc as ee,Qs as C,Rc as te,Sc as w,TA as T,Tc as E,Uc as D,Vc as ne,Wc as O,Xc as k,Xs as A,Yc as re,Ys as j,Zc as M,Zs as N,_c as ie,ac as P,bc as F,cc as ae,dc as oe,ec as se,el as I,fc as L,gc as R,hc as ce,ic as le,il as ue,jc as de,kc as z,lc as fe,mc as pe,nc as me,nl as he,oc as ge,pc as _e,qc as ve,rc as ye,rl as be,sc as xe,tc as Se,tl as Ce,uc as we,vc as Te,wA as B,wc as Ee,xc as De,yc as Oe,zc as ke}from"./dist-BJuS9RKK.js";import{t as Ae}from"./x-DzHSe3Kh.js";import{i as V,n as H,r as je,t as Me}from"./tabs-bHkQWa8h.js";import{t as U}from"./button-C3T_nXdg.js";import{$ as W,C as Ne,N as G,Nt as Pe,P as Fe,S as Ie,_ as K,at as Le,b as Re,bt as q,et as J,lt as ze,m as Be,nt as Ve,ot as He,rt as Ue,tt as We,x as Ge,y as Ke,yt as Y}from"./index-DgeJfwWI.js";import{t as qe}from"./FilterBar-CZN4zOuy.js";import{t as Je}from"./DataTableShell-DzK-qEdq.js";import{t as X}from"./DetailChips-BIvUUZKQ.js";var Ye=c(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Xe=c(`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`}]]),Z=c(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ze=c(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Q=t(e(),1);function Qe(e,t,n){let r=t.trim().toLowerCase();return[...r?e.filter(e=>[e.email,e.name,e.canonical].some(e=>e!=null&&e.toLowerCase().includes(r))):e.slice()].sort((e,t)=>!n.has(e.userId)-+!n.has(t.userId))}function $e(e,t){let n=e.filter(e=>e.source===`discovered`),r=t.trim().toLowerCase();return r?n.filter(e=>(e.displayName??e.agentId).toLowerCase().includes(r)||e.agentId.toLowerCase().includes(r)):n}function et(e){let t=e.name?.trim()??``,n=e.email?.trim()??``,r=e.canonical?.trim()||`u-${e.userId.slice(0,8)}`;return t?{primary:t,secondary:n||`@${r}`}:n?{primary:n,secondary:null}:{primary:`@${r}`,secondary:null}}function tt(e){switch(e){case`admin`:return E();case`user`:return Ee();case`pending`:return s();default:return e}}function nt(e,t){if(e.length===0)return`none`;let n=0;for(let r of e)t(r)&&n++;return n===0?`none`:n===e.length?`all`:`some`}function rt(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=Math.min(Math.max(1,Math.floor(t)),r),a=(i-1)*n;return{pageItems:e.slice(a,a+n),page:i,pageCount:r}}var $=n(),it={name:``,description:``};function at(){let e=T(u.groups.listGroups,{}),t=T(u.me.getMe,{host:ze})?.role===`admin`,n=B(u.groups.createGroup),i=B(u.groups.updateGroup),a=B(u.groups.deleteGroup),s=Fe(),c=G(),[l,d]=(0,Q.useState)(!1),[f,h]=(0,Q.useState)(null),[y,b]=(0,Q.useState)(it),[x,S]=(0,Q.useState)(null),[w,E]=(0,Q.useState)(``),A=(0,Q.useMemo)(()=>{if(!e)return e;let t=w.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,w]);function j(){h(null),b(it),d(!0)}function ie(e){h(e),b({name:e.name,description:e.description??``}),d(!0)}async function P(){try{f?await i({groupId:f._id,name:y.name,description:y.description}):await n({name:y.name,description:y.description||void 0}),b(it),h(null),d(!1)}catch(e){c.error(C(),e)}}async function F(e){if(await s({title:ke({name:e.name}),description:te(),confirmWord:e.name,confirmLabel:v(),cancelLabel:p(),destructive:!0}))try{await a({groupId:e._id})}catch(e){c.error(N(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:be()}),(0,$.jsx)(qe,{q:w,onQChange:E,onReset:()=>E(``),canReset:w!==``,searchPlaceholder:k()}),(0,$.jsx)(Je,{title:ue(),rows:A,addLabel:he(),onAdd:t?j:void 0,emptyHint:Ce(),columns:[{header:I(),cell:e=>e.name,sort:e=>e.name},{header:r(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(Ze,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,$.jsx)(Z,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:ee(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(q,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:M(),cell:e=>(0,$.jsx)(X,{icon:(0,$.jsx)(Xe,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,$.jsx)(Y,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:re(),onSelect:()=>S({groupId:e._id,name:e.name})},...t?[{label:g(),onSelect:()=>ie(e)},{label:ve(),variant:`destructive`,onSelect:()=>void F(e)}]:[]]}),(0,$.jsx)(Be,{open:l,onOpenChange:d,title:f?D():O(),description:m(),canSubmit:!!y.name.trim(),onSubmit:P,submitLabel:_(),children:(0,$.jsxs)(`div`,{className:`oc-form`,children:[(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:ne()}),(0,$.jsx)(J,{value:y.name,onChange:e=>b({...y,name:e.target.value})})]}),(0,$.jsxs)(`label`,{className:`oc-field`,children:[(0,$.jsx)(`span`,{className:`oc-field__label`,children:o()}),(0,$.jsx)(J,{value:y.description,onChange:e=>b({...y,description:e.target.value})})]})]})}),(0,$.jsx)(ct,{groupId:x?.groupId??null,groupName:x?.name??``,open:x!==null,onOpenChange:e=>{e||S(null)}})]})}var ot=8;function st({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,$.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,$.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,$.jsx)(Ye,{size:14,"aria-hidden":!0}),x()]}),(0,$.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":d({page:e,pages:t}),children:[e,` / `,t]}),(0,$.jsxs)(U,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[l(),(0,$.jsx)(Pe,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=T(u.groups.getGroup,n&&e?{groupId:e}:`skip`),o=T(u.groups.listAssignableInstances,n?{}:`skip`),s=T(u.groups.listAssignableUsers,n?{}:`skip`),c=B(u.groups.addMember),l=B(u.groups.removeMember),d=B(u.groups.bulkSetMembers),p=B(u.groups.setGroupManager),m=G(),[g,_]=(0,Q.useState)(``),[v,x]=(0,Q.useState)(``),[ee,C]=(0,Q.useState)(`members`),[te,E]=(0,Q.useState)(1),[D,ne]=(0,Q.useState)(new Set),O=(0,Q.useRef)(null),k=(0,Q.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),re=(0,Q.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),j=i?.viewerIsAdmin===!0,M=(0,Q.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,Q.useEffect)(()=>{_(``),x(``),C(`members`),E(1),O.current=null},[n,e]),(0,Q.useEffect)(()=>{E(1)},[g]),(0,Q.useEffect)(()=>{n&&i&&e&&O.current!==e&&(O.current=e,ne(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let N=(0,Q.useMemo)(()=>s?Qe(s,g,D):[],[s,g,D]);async function P(t,n){if(e)try{n?await l({groupId:e,userId:t}):await c({groupId:e,userId:t})}catch(e){m.error(A(),e)}}async function ae(t,n){if(e)try{await p({groupId:e,userId:t,manager:!n})}catch(e){m.error(se(),e)}}let I=nt(N,e=>k.has(e.userId)),L=N.filter(e=>k.has(e.userId)).length,R=rt(N,te,ot);async function ce(){if(!e||N.length===0)return;let t=N.map(e=>e.userId);try{await d({groupId:e,userIds:t,member:I!==`all`})}catch(e){m.error(A(),e)}}return(0,$.jsx)(We,{open:n,onOpenChange:r,children:(0,$.jsxs)(Ve,{className:`oc-access`,children:[(0,$.jsxs)(Le,{children:[(0,$.jsx)(He,{children:h({name:t})}),(0,$.jsx)(Ue,{children:f()})]}),(0,$.jsxs)(Me,{value:ee,onValueChange:C,className:`oc-access__tabs`,children:[(0,$.jsxs)(je,{className:`w-full`,children:[(0,$.jsxs)(V,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Ze,{size:13,"aria-hidden":!0}),S(),i?(0,$.jsx)(W,{variant:`secondary`,className:`oc-access__tabcount`,children:k.size}):null]}),(0,$.jsxs)(V,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(q,{size:13,"aria-hidden":!0}),y(),i?(0,$.jsx)(W,{variant:`secondary`,className:`oc-access__tabcount`,children:M.size}):null]}),(0,$.jsxs)(V,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,$.jsx)(Xe,{size:13,"aria-hidden":!0}),oe(),i?(0,$.jsx)(W,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,$.jsx)(H,{value:`members`,children:s===void 0||i===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:F()}):s.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:Te()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(J,{value:g,onChange:e=>_(e.target.value),placeholder:b(),className:`oc-access__search`}),N.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:a()}):(0,$.jsxs)($.Fragment,{children:[N.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(K,{checked:I===`all`?!0:I===`some`?`indeterminate`:!1,onCheckedChange:()=>void ce(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()}),(0,$.jsxs)(W,{variant:`outline`,className:`oc-access__count`,children:[L,` / `,N.length]})]}):null,(0,$.jsx)(`div`,{className:`oc-access__list`,children:R.pageItems.map(e=>{let t=k.has(e.userId),n=et(e),r=re.has(e.userId);return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(K,{checked:t,onCheckedChange:()=>void P(e.userId,t),"aria-label":w({user:n.primary})}),(0,$.jsxs)(`span`,{className:`oc-access__who`,children:[(0,$.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,$.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,$.jsx)(W,{variant:`outline`,className:`oc-access__role`,children:tt(e.role)}),(0,$.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&j?(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?Se():me(),title:r?Se():me(),onClick:()=>void ae(e.userId,r),children:(0,$.jsx)(Z,{size:15,"aria-hidden":!0})}):t&&r?(0,$.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":ye(),title:ye(),children:(0,$.jsx)(Z,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,$.jsx)(st,{page:R.page,pageCount:R.pageCount,onPage:E})]})]})}),(0,$.jsx)(H,{value:`agents`,children:o===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:F()}):o.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:ie()}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(J,{value:v,onChange:e=>x(e.target.value),placeholder:de(),className:`oc-access__search`}),(0,$.jsx)(`div`,{className:`oc-access__list`,children:o.map(t=>(0,$.jsx)(lt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:M,query:v},`${e}-${t._id}`))})]})}),(0,$.jsx)(H,{value:`charts`,children:(0,$.jsx)(ut,{groupId:e})})]})]})})}function lt({groupId:e,instanceName:t,kind:n,assigned:r,query:i}){let a=T(u.groups.listAssignableAgents,{instanceName:t}),o=B(u.groups.assignAgentToGroup),s=B(u.groups.removeAgentFromGroup),c=B(u.groups.bulkSetGroupAgents),l=G(),[d,f]=(0,Q.useState)(1);if((0,Q.useEffect)(()=>{f(1)},[i]),!e)return null;let p=$e(a?.agents??[],i),m=a?.discovery&&!a.discovery.lastPollOk;if(i.trim()&&p.length===0)return null;let h=p.filter(e=>e.presentInLastOk!==!1),g=nt(h,e=>r.has(`${t}/${e.agentId}`)),_=rt(p,d,ot);async function v(n,r){try{r?await s({groupId:e,instanceName:t,agentId:n}):await o({groupId:e,instanceName:t,agentId:n})}catch(e){l.error(j(),e)}}async function y(){if(h.length===0)return;let n=h.map(e=>e.agentId);try{await c({groupId:e,instanceName:t,agentIds:n,assigned:g!==`all`})}catch(e){l.error(j(),e)}}return(0,$.jsxs)(`div`,{className:`oc-access__group`,children:[(0,$.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,$.jsx)(q,{size:13,"aria-hidden":!0}),(0,$.jsx)(`span`,{children:t}),(0,$.jsx)(W,{variant:`outline`,className:`oc-access__kind`,children:n}),m?(0,$.jsx)(W,{variant:`outline`,className:`oc-access__stale`,children:pe()}):null]}),a===void 0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:Oe()}):p.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:m?ce():R()}):(0,$.jsxs)($.Fragment,{children:[h.length>1?(0,$.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,$.jsx)(K,{checked:g===`all`?!0:g===`some`?`indeterminate`:!1,onCheckedChange:()=>void y(),"aria-label":z()}),(0,$.jsx)(`span`,{className:`oc-access__label`,children:z()})]}):null,_.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1;return(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(K,{checked:i,disabled:a&&!i,onCheckedChange:()=>void v(e.agentId,i),"aria-label":De({name:e.displayName??e.agentId})}),(0,$.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,$.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,$.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":L(),title:L(),children:(0,$.jsx)(Y,{size:14,fill:`currentColor`})}):null,a?(0,$.jsx)(W,{variant:`outline`,className:`oc-access__gone`,children:_e()}):null]},e.agentId)}),(0,$.jsx)(st,{page:_.page,pageCount:_.pageCount,onPage:f})]})]})}function ut({groupId:e}){let t=T(u.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=B(u.charts.assignChartToGroup),r=B(u.charts.removeChartFromGroup),a=B(u.charts.setGroupDefaultChart),o=B(u.charts.addChartToGroupPool),s=B(u.charts.removeChartFromGroupPool),c=G();if(!e)return null;if(t===void 0)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:F()});let{pool:l,addable:d,canManagePool:f}=t;if(l.length===0&&!f)return(0,$.jsx)(`p`,{className:`oc-access__hint`,children:we()});async function p(t,a){try{a?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){c.error(i(),e)}}async function m(t){try{await a({groupId:e,chartKey:t})}catch(e){c.error(i(),e)}}async function h(t){try{await o({groupId:e,chartKey:t})}catch(e){c.error(i(),e)}}async function g(t){try{await s({groupId:e,chartKey:t})}catch(e){c.error(i(),e)}}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`oc-access__list`,children:l.map(e=>(0,$.jsxs)(`div`,{className:`oc-access__row`,children:[(0,$.jsx)(K,{checked:e.selected,onCheckedChange:()=>void p(e.chartKey,e.selected),"aria-label":ge({name:e.name})}),(0,$.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,$.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":P(),title:P(),children:(0,$.jsx)(Y,{size:14,fill:`currentColor`})}):(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void m(e.chartKey),children:le()}):null,f?(0,$.jsx)(U,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":xe({name:e.name}),title:xe({name:e.name}),onClick:()=>void g(e.chartKey),children:(0,$.jsx)(Ae,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),f?d.length>0?(0,$.jsxs)(Ke,{value:``,onValueChange:e=>void h(e),children:[(0,$.jsx)(Ie,{size:`sm`,className:`oc-access__search`,children:(0,$.jsx)(Ne,{placeholder:ae()})}),(0,$.jsx)(Re,{children:d.map(e=>(0,$.jsx)(Ge,{value:e.chartKey,children:e.name},e.chartKey))})]}):l.length===0?(0,$.jsx)(`p`,{className:`oc-access__hint`,children:fe()}):null:null]})}export{at as GroupsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$T as r,$v as i,$y as a,Av as o,Ay as s,Bv as c,By as l,Cy as u,Dv as d,Dy as f,E as p,Ev as m,Ey as h,Fv as g,Fy as _,Gv as v,Gy as ee,Hv as y,Hy as b,Iv as x,Iy as te,Jv as S,Jy as C,Kv as w,Ky as T,Lv as ne,Ly as re,Mv as ie,My as ae,Nv as oe,Ny as se,Ov as ce,Oy as E,Pv as le,Py as ue,QT as D,Qv as O,Qy as k,Rv as de,Ry as fe,SA as A,Sm as pe,Sy as j,TA as M,Ty as me,Uv as he,Uy as ge,Vv as _e,Vy as ve,Wv as ye,Wy as be,Xv as xe,Xy as Se,Yv as Ce,Yy as we,Zv as Te,Zy as Ee,_y as De,ab as Oe,ay as ke,by as Ae,cb as je,cr as Me,cy as Ne,db as Pe,dy as Fe,eb as Ie,ey as Le,fb as Re,fy as ze,gy as Be,hy as Ve,ib as He,iy as Ue,jv as We,jy as Ge,kv as Ke,ky as qe,lb as Je,lr as Ye,ly as Xe,my as Ze,nb as Qe,ny as $e,ob as et,or as tt,oy as nt,py as rt,qv as N,qy as it,rb as at,ry as ot,sb as st,sr as ct,sy as lt,tb as ut,ty as dt,ub as ft,uy as pt,vy as mt,wA as P,wy as ht,xm as gt,xy as _t,yy as vt,zv as yt,zy as bt}from"./dist-BJuS9RKK.js";import{a as xt,c as St}from"./FieldLabel-Cz-9BS36.js";import{t as F}from"./button-C3T_nXdg.js";import{$ as I,C as L,G as Ct,K as wt,N as R,P as Tt,S as z,W as Et,_ as B,at as V,b as H,et as U,m as Dt,nt as W,ot as G,rt as K,tt as q,x as J,y as Ot}from"./index-DgeJfwWI.js";import{t as kt}from"./DataTableShell-DzK-qEdq.js";import{InstanceConfigDialog as At}from"./BridgeTab-B0fJjtmW.js";var Y=t(e(),1),X=[`conversational`,`documentary`,`summarizer`,`curator`],jt=new Set(X),Mt=`conversational`;function Nt(e){let t=new Set((e??[]).filter(e=>jt.has(e)));return t.size===0?[Mt]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:xt},Pt={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Ft(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``,streamTransport:e.streamTransport??`reactive`}}function It(){let e=M(p.admin.listInstances,{}),t=M(p.agents.listAllInstanceAgents,{}),n=P(p.admin.upsertInstance),r=P(p.admin.deleteInstance),i=R(),[o,s]=(0,Y.useState)(!1),[c,u]=(0,Y.useState)(Q),[f,m]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(null),[v,y]=(0,Y.useState)(null),[x,S]=(0,Y.useState)(null);async function w(){try{await n({instanceId:x??void 0,name:c.name,gatewayUrl:c.gatewayUrl,bridgeUrl:c.bridgeUrl||void 0,displayName:c.displayName||void 0,kind:c.kind,gatewayVersion:c.gatewayVersion||void 0,gatewayHttpUrl:c.gatewayHttpUrl||void 0,streamTransport:c.streamTransport}),u(Q),S(null),s(!1)}catch(e){i.error(ft(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[Je(),(0,Z.jsx)(`strong`,{children:je()}),st()]}),(0,Z.jsx)(kt,{title:et(),rows:e,addLabel:Oe(),onAdd:()=>{S(null),u(Q),s(!0)},emptyHint:He(),columns:[{header:at(),cell:e=>e.name,sort:e=>e.name},{header:Qe(),cell:e=>(0,Z.jsx)(I,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:ut(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:Ie(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:Re(),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)(I,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?d():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:Se(),onSelect:()=>{S(e._id),u(Ft(e)),s(!0)}},{label:Pe(),onSelect:()=>m(e.name)},{label:_(),onSelect:()=>y(e)},{label:a(),onSelect:()=>g(e)},{label:k(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:k(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(Dt,{open:o,onOpenChange:s,title:x?we():Ee(),description:it(),canSubmit:!!(c.name&&c.gatewayUrl),onSubmit:w,submitLabel:T(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:ee(),children:[(0,Z.jsx)(U,{value:c.name,disabled:x!==null,onChange:e=>u({...c,name:e.target.value})}),x?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:C()}):null]}),(0,Z.jsx)($,{label:be(),children:(0,Z.jsxs)(Ot,{value:c.kind,onValueChange:e=>u({...c,kind:e}),children:[(0,Z.jsx)(z,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(L,{})}),(0,Z.jsxs)(H,{children:[(0,Z.jsx)(J,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(J,{value:`hermes`,children:`Hermes`})]})]})}),(0,Z.jsx)($,{label:ge(),children:(0,Z.jsx)(U,{value:c.gatewayUrl,onChange:e=>u({...c,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:b(),children:(0,Z.jsx)(U,{value:c.bridgeUrl,placeholder:ve(),onChange:e=>u({...c,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:l(),children:(0,Z.jsx)(U,{value:c.displayName,onChange:e=>u({...c,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:pe(),children:[(0,Z.jsxs)(Ot,{value:c.streamTransport,onValueChange:e=>u({...c,streamTransport:e}),children:[(0,Z.jsx)(z,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(L,{})}),(0,Z.jsx)(H,{children:St.map(e=>(0,Z.jsx)(J,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:gt()})]}),(0,Z.jsx)($,{label:bt(),children:(0,Z.jsx)(U,{value:c.gatewayVersion,placeholder:fe(),onChange:e=>u({...c,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:re(),children:(0,Z.jsx)(U,{value:c.gatewayHttpUrl,placeholder:te(),onChange:e=>u({...c,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Kt,{instanceName:f,open:f!==null,onOpenChange:e=>{e||m(null)}}),h?(0,Z.jsx)(At,{instance:h,onClose:()=>g(null)},h._id):null,v?(0,Z.jsx)(Lt,{instance:v,onClose:()=>y(null)},v._id):null]})}function Lt({instance:e,onClose:t}){let n=M(p.instanceSecrets.listInstanceSecretStatus,{}),r=Pt[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)(q,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(W,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(G,{children:ue({instance:e.displayName??e.name})}),(0,Z.jsx)(K,{children:se()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(Bt,{instanceId:e._id,field:t,updatedAt:i[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(zt,{instance:e})}),(0,Z.jsx)(Rt,{instance:e})]})})}function Rt({instance:e}){let t=A(p.instanceSync.forceInstanceSync),n=R(),[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(rt());break;case`no_agents`:n.success(Fe());break;case`no_bridge_url`:n.error(pt());break;case`deploy_misconfigured`:n.error(Xe());break;case`unauthorized`:n.error(lt());break;case`not_served`:n.error(nt());break;default:n.error(Ne());break}}catch(e){n.error(ze(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ke()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(F,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?Ze():Ve()})})]})}function zt({instance:e}){let t=M(p.bridgeAuth.listBridgeAuthStatus,{}),n=A(p.bridgeAuth.mintBridgeSecret),a=P(p.bridgeAuth.revokeBridgeSecret),o=R(),[s,c]=(0,Y.useState)(!1),[l,u]=(0,Y.useState)(null),[d,f]=(0,Y.useState)(!1),m=(t??[]).find(t=>t.instanceId===e._id),h=m!==void 0;async function g(){if(!s){c(!0);try{u((await n({instanceId:e._id})).plaintext),f(!1)}catch(e){o.error(O(),e)}finally{c(!1)}}}async function _(){if(!s){c(!0);try{await a({instanceId:e._id}),u(null),o.success(i())}catch(e){o.error(O(),e)}finally{c(!1)}}}async function v(){if(l)try{await navigator.clipboard.writeText(l),f(!0)}catch{}}return(0,Z.jsxs)($,{label:Ue(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ot()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(I,{variant:h?`outline`:`secondary`,children:h?`${qe()} · ${m.prefix}…${m.lastFour}`:E()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(F,{size:`sm`,onClick:()=>void g(),disabled:s,children:h?dt():$e()}),h?(0,Z.jsx)(F,{size:`sm`,variant:`destructive`,onClick:()=>void _(),disabled:s,children:Le()}):null]})]}),l?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:Te()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:l}),(0,Z.jsx)(F,{variant:`outline`,size:`sm`,onClick:()=>void v(),children:d?r():D()})]}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,onClick:()=>{u(null),f(!1)},children:xe()})]}):null]})}function Bt({instanceId:e,field:t,updatedAt:n}){let i=A(p.instanceSecrets.setInstanceSecret),a=P(p.instanceSecrets.clearInstanceSecret),o=A(p.deviceIdentity.generateDeviceIdentity),c=R(),[l,d]=(0,Y.useState)(``),[m,g]=(0,Y.useState)(!1),[_,v]=(0,Y.useState)(null),[ee,y]=(0,Y.useState)(!1),b=n!==null,x=t===`deviceIdentity`,te=t===`token`?ae():t===`deviceIdentity`?Ge():s();async function S(){if(!(!l.trim()||m)){g(!0);try{await i({instanceId:e,field:t,plaintext:l}),d(``),v(null),y(!1),c.success(u())}catch(e){c.error(j(),e)}finally{g(!1)}}}async function C(){if(!m){g(!0);try{await a({instanceId:e,field:t}),v(null),y(!1),c.success(_t())}catch(e){c.error(j(),e)}finally{g(!1)}}}async function w(){if(!m){g(!0);try{v(await o({instanceId:e})),y(!1),c.success(mt())}catch(e){c.error(Be(),e)}finally{g(!1)}}}let T=_?`openclaw devices approve ${_.id}`:``;async function ne(){if(T)try{await navigator.clipboard.writeText(T),y(!0)}catch{}}return(0,Z.jsxs)($,{label:te,children:[x?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:vt()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(I,{variant:b?`outline`:`secondary`,children:b?qe():E()}),(0,Z.jsx)(U,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:l,placeholder:b?h():f(),onChange:e=>d(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(F,{size:`sm`,onClick:()=>void S(),disabled:m||l.trim().length===0,children:me()}),x?(0,Z.jsx)(F,{size:`sm`,variant:`outline`,onClick:()=>void w(),disabled:m,children:Ae()}):null,b?(0,Z.jsx)(F,{size:`sm`,variant:`destructive`,onClick:()=>void C(),disabled:m,children:ht()}):null]})]}),_?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:mt()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:De()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:T}),(0,Z.jsx)(F,{variant:`outline`,size:`sm`,onClick:()=>void ne(),children:ee?r():D()})]}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,onClick:()=>{v(null),y(!1)},children:xe()})]}):null]})}var Vt={conversational:y,documentary:c,summarizer:Ye,curator:ct},Ht={conversational:_e,documentary:yt,summarizer:Me,curator:tt},Ut=e=>(Vt[e]??(()=>e))(),Wt=e=>(Ht[e]??(()=>``))();function Gt({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:w()}),t.map(e=>(0,Z.jsx)(I,{variant:`secondary`,className:`oc-agenttype__chip`,title:Wt(e),children:Ut(e)},e)),(0,Z.jsxs)(Et,{children:[(0,Z.jsx)(wt,{asChild:!0,children:(0,Z.jsx)(F,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:v()})}),(0,Z.jsxs)(Ct,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:ye()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:he()}),(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)(B,{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:Ut(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:Wt(r)})]})]},r)})})]})]})]})}function Kt({instanceName:e,open:t,onOpenChange:n}){let r=M(p.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=P(p.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(p.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(p.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),a=P(p.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(p.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(p.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),s=P(p.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(p.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=Nt(r);e.setQuery(p.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),c=P(p.agents.removeInstanceAgent),l=Tt(),u=R();async function f(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){u.error(N(),e)}}async function h(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){u.error(N(),e)}}async function _(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await s({instanceName:e,agentId:t,types:i})}catch(e){u.error(N(),e)}}async function v(t,n){if(e&&await l({title:x({name:n}),description:g(),confirmLabel:le(),destructive:!0}))try{await c({instanceName:e,agentId:t}),u.success(oe())}catch(e){u.error(N(),e)}}return(0,Z.jsx)(q,{open:t,onOpenChange:n,children:(0,Z.jsxs)(W,{className:`oc-access`,children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(G,{children:Ce({name:e??``})}),(0,Z.jsx)(K,{children:S()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:ie()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?We():r.discovery.lastPollOk?o():Ke({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:ce()}):(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)(B,{checked:e.enabled,disabled:t,"aria-label":i,onCheckedChange:t=>void f(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)(I,{variant:`outline`,className:`oc-access__gone`,children:m()}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void v(e.agentId,i),children:ne()})]}):n?(0,Z.jsx)(I,{variant:`default`,children:d()}):(0,Z.jsx)(F,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!e.enabled,onClick:()=>void h(e.agentId),children:de()})]}),e.enabled?(0,Z.jsx)(Gt,{agentId:e.agentId,types:a,onToggle:t=>void _(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{It as InstancesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$x as r,AS as i,Ai as a,CS as o,Ci as s,DS as c,Di as l,E as u,ES as d,Ei as f,Gx as p,Hx as m,Jx as ee,Kx as h,MS as g,NS as _,OS as v,Oi as te,PS as ne,Qx as re,SA as y,SS as ie,Si as ae,TA as oe,TS as se,Ti as ce,Ux as le,Wx as b,Xx as x,Yx as S,Zx as C,_S as w,aS as T,bS as E,cS as D,dS as O,eS as k,fS as A,gS as j,hS as M,iS as N,jS as P,kS as F,ki as I,lS as L,mS as R,nS as z,oS as B,pS as V,qx as H,rS as U,sS as ue,tS as de,uS as fe,vS as pe,wA as W,wS as me,wi as he,xS as ge,yS as _e}from"./dist-BJuS9RKK.js";import{t as G}from"./button-C3T_nXdg.js";import{$ as K,C as ve,S as ye,_ as be,b as xe,et as q,k as Se,x as Ce,y as we}from"./index-DgeJfwWI.js";import{t as Te}from"./DataTableShell-DzK-qEdq.js";var J=t(e(),1),Y=n();function Ee(){let e=oe(u.integrations.status.status,{}),t=W(u.admin.setIntegrationConfig),[n,s]=(0,J.useState)(null);if((0,J.useEffect)(()=>{e&&n===null&&s(e.config)},[e,n]),!e||!n)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:ne()});let l=n,f=(e,t,n)=>s({...l,[e]:{...l[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:[_(),` `,(0,Y.jsx)(`strong`,{children:g()}),` `,P()]}),(0,Y.jsxs)(X,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,Y.jsx)(K,{variant:`secondary`,children:i()}):(0,Y.jsx)(K,{variant:`outline`,children:F()}):(0,Y.jsx)(K,{variant:`outline`,children:v()}),note:d(),children:[(0,Y.jsx)(Z,{label:me(),children:(0,Y.jsx)(q,{value:l.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>f(`langfuse`,`host`,e.target.value),onBlur:()=>y(`langfuse`,{host:l.langfuse.host??``})})}),(0,Y.jsx)(Q,{label:E(),checked:l.langfuse.enabled??!0,onChange:e=>{f(`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:i()}):(0,Y.jsx)(K,{variant:`outline`,children:F()}):(0,Y.jsx)(K,{variant:`outline`,children:v()}),note:se(),children:[(0,Y.jsx)(Z,{label:o(),children:(0,Y.jsx)(q,{value:l.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>f(`opik`,`baseUrl`,e.target.value),onBlur:()=>y(`opik`,{baseUrl:l.opik.baseUrl??``})})}),(0,Y.jsx)(Z,{label:ie(),children:(0,Y.jsx)(q,{value:l.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||ge(),onChange:e=>f(`opik`,`workspace`,e.target.value),onBlur:()=>y(`opik`,{workspace:l.opik.workspace??``})})}),(0,Y.jsx)(Q,{label:E(),checked:l.opik.enabled??!0,onChange:e=>{f(`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:i()}):(0,Y.jsx)(K,{variant:`outline`,children:F()}):(0,Y.jsx)(K,{variant:`outline`,children:a()}),note:I(),children:[(0,Y.jsx)(Z,{label:te(),children:(0,Y.jsx)(q,{value:l.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>f(`otlp`,`endpoint`,e.target.value),onBlur:()=>y(`otlp`,{endpoint:l.otlp.endpoint??``})})}),(0,Y.jsx)(De,{headersSet:e.otlp.headersSet}),(0,Y.jsx)(Q,{label:E(),checked:l.otlp.enabled??!0,onChange:e=>{f(`otlp`,`enabled`,e),y(`otlp`,{enabled:e})}})]}),(0,Y.jsxs)(X,{title:_e(),status:(0,Y.jsx)(K,{variant:`outline`,children:c()}),note:pe(),children:[(0,Y.jsx)(Z,{label:w(),children:(0,Y.jsx)($,{value:l.tts.auto??`off`,options:[[`off`,j()],[`always`,M()],[`inbound`,R()],[`tagged`,V()]],onChange:e=>{f(`tts`,`auto`,e),y(`tts`,{auto:e})}})}),(0,Y.jsx)(Z,{label:A(),children:(0,Y.jsx)($,{value:l.tts.provider??`openai`,options:[[`openai`,`OpenAI`],[`elevenlabs`,`ElevenLabs`],[`microsoft`,O()],[`azure`,`Azure Speech`],[`google`,`Google Gemini`]],onChange:e=>{f(`tts`,`provider`,e),y(`tts`,{provider:e})}})}),(0,Y.jsx)(Z,{label:fe(),children:(0,Y.jsx)(q,{value:l.tts.model??``,placeholder:`eleven_multilingual_v2`,onChange:e=>f(`tts`,`model`,e.target.value),onBlur:()=>y(`tts`,{model:l.tts.model??``})})}),(0,Y.jsx)(Z,{label:L(),children:(0,Y.jsx)(q,{value:l.tts.voice??``,placeholder:D(),onChange:e=>f(`tts`,`voice`,e.target.value),onBlur:()=>y(`tts`,{voice:l.tts.voice??``})})})]}),(0,Y.jsxs)(X,{title:ue(),status:(0,Y.jsx)(K,{variant:`outline`,children:c()}),note:e.secrets.openai?B():T(),children:[(0,Y.jsx)(Q,{label:N(),checked:l.talk.enabled??!1,onChange:e=>{f(`talk`,`enabled`,e),y(`talk`,{enabled:e})}}),(0,Y.jsx)(Z,{label:U(),children:(0,Y.jsx)($,{value:l.talk.realtimeProvider??`openai`,options:[[`openai`,`OpenAI (gpt-realtime)`],[`google`,`Google`]],onChange:e=>{f(`talk`,`realtimeProvider`,e),y(`talk`,{realtimeProvider:e})}})}),(0,Y.jsx)(Z,{label:z(),children:(0,Y.jsx)(q,{value:l.talk.realtimeModel??``,placeholder:`gpt-realtime-2`,onChange:e=>f(`talk`,`realtimeModel`,e.target.value),onBlur:()=>y(`talk`,{realtimeModel:l.talk.realtimeModel??``})})}),(0,Y.jsx)(Z,{label:L(),children:(0,Y.jsx)(q,{value:l.talk.voice??``,placeholder:`cedar / marin`,onChange:e=>f(`talk`,`voice`,e.target.value),onBlur:()=>y(`talk`,{voice:l.talk.voice??``})})}),(0,Y.jsx)(Z,{label:de(),children:(0,Y.jsx)($,{value:l.talk.transport??`webrtc`,options:[[`webrtc`,k()],[`provider-websocket`,`Provider WebSocket`],[`gateway-relay`,`Gateway relay`]],onChange:e=>{f(`talk`,`transport`,e),y(`talk`,{transport:e})}})}),(0,Y.jsx)(Z,{label:r(),children:(0,Y.jsx)(q,{value:l.talk.speechLocale??``,placeholder:`fr-CA`,onChange:e=>f(`talk`,`speechLocale`,e.target.value),onBlur:()=>y(`talk`,{speechLocale:l.talk.speechLocale??``})})}),(0,Y.jsx)(Q,{label:re(),checked:l.talk.interruptOnSpeech??!0,onChange:e=>{f(`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:C()}),(0,Y.jsx)(K,{variant:`outline`,children:x()})]}),(0,Y.jsxs)(`p`,{className:`oc-uipa__note`,children:[S(),(0,Y.jsx)(`code`,{children:` voicewake.get/set`}),`.`]})]}),(0,Y.jsx)(Te,{title:ee(),rows:e.cursors.map(e=>({...e,_id:e.vendor})),emptyHint:H(),columns:[{header:h(),cell:e=>(0,Y.jsx)(K,{variant:`secondary`,children:e.vendor}),sort:e=>e.vendor},{header:p(),cell:e=>e.lastAt>0?Se(e.lastAt):`—`,sort:e=>e.lastAt>0?e.lastAt:null},{header:b(),cell:e=>String(e.failureCount),sort:e=>e.failureCount},{header:le(),cell:e=>e.lastErrorStatus??`—`,sort:e=>e.lastErrorStatus??null},{header:m(),cell:e=>e.lastError??`—`,sort:e=>e.lastError??null}]})]})}function X({title:e,status:t,note:n,children:r}){return(0,Y.jsxs)(`section`,{className:`oc-int__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,Y.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,Y.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function Z({label:e,children:t}){return(0,Y.jsxs)(`label`,{className:`oc-int__field`,children:[(0,Y.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function Q({label:e,checked:t,onChange:n}){return(0,Y.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,Y.jsx)(be,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,Y.jsx)(`span`,{children:e})]})}function $({value:e,options:t,onChange:n}){return(0,Y.jsxs)(we,{value:e,onValueChange:n,children:[(0,Y.jsx)(ye,{size:`sm`,className:`w-full`,children:(0,Y.jsx)(ve,{})}),(0,Y.jsx)(xe,{children:t.map(([e,t])=>(0,Y.jsx)(Ce,{value:e,children:t},e))})]})}function De({headersSet:e}){let t=y(u.integrations.otlpSecret.setOtlpHeaders),n=W(u.integrations.otlpSecret.clearOtlpHeaders),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(null),[c,d]=(0,J.useState)(!1),p=async()=>{d(!0),o(null);try{await t({headersJson:r}),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{d(!1)}};return(0,Y.jsxs)(Z,{label:l(),children:[(0,Y.jsx)(q,{value:r,placeholder:e?f():ce(),onChange:e=>i(e.target.value)}),(0,Y.jsxs)(`div`,{className:`oc-int__otlp-headers-actions`,children:[(0,Y.jsx)(G,{size:`sm`,disabled:c||r.trim().length===0,onClick:()=>void p(),children:he()}),e?(0,Y.jsx)(G,{variant:`ghost`,size:`sm`,disabled:c,onClick:()=>void n({}),children:s()}):null]}),a?(0,Y.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:a}):null,(0,Y.jsx)(`p`,{className:`oc-uipa__note`,children:ae()})]})}export{Ee as IntegrationsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Af as r,Bf as i,E as a,Ff as o,Hf as s,If as c,Lf as l,Mf as u,Nf as d,Pf as f,Rf as p,TA as m,Uf as h,Vf as g,WC as _,_C as ee,cC as te,gC as v,jf as y,lC as b,vC as x,yC as S,zf as C}from"./dist-BJuS9RKK.js";import{Ft as w,Pt as T,a as E,lt as D,n as ne,r as re}from"./index-DgeJfwWI.js";import{a as O,n as k,o as A,r as j,t as M}from"./card-DESvIpRK.js";import{n as N,t as P}from"./TimeRangePicker-DVDywKqe.js";var F=t(e(),1),I=n(),L=15,R=e=>String(Math.round(e));function z(){let e=m(a.me.getMe,{host:D})?.permissions?.includes(`traces.read`)??!1,t=m(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:_()}),(0,I.jsxs)(M,{children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(A,{children:S()}),(0,I.jsx)(j,{children:ee()})]}),(0,I.jsx)(k,{children:n.length<2?(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):(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:[te(),` p50 `,R(s.cP50),` `,x()]}),(0,I.jsxs)(`span`,{children:[b(),` p50 `,R(s.aP50),` `,x()]})]}),(0,I.jsxs)(`svg`,{viewBox:`0 0 480 80`,className:`h-20 w-full`,preserveAspectRatio:`none`,role:`img`,"aria-label":S(),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:h(),unit:`/h`,group:`API`,isError:!1},{metric:`api.errors`,label:s(),unit:`/h`,group:`API`,isError:!0},{metric:`api.latency.avg_ms`,label:g(),unit:`ms`,group:`API`,isError:!1},{metric:`openclaw.ingest`,label:i(),unit:`/h`,group:`OpenClaw`,isError:!1},{metric:`chat.send`,label:C(),unit:`/h`,group:`Chat`,isError:!1},{metric:`assistant.stream.errors`,label:p(),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=w({from:`/settings/kpi`}),t=T({from:`/settings/kpi`}),n=re(e.from,e.to,ne,`now`),r=e=>void t({search:t=>({...t,...E(e)})}),{from:i,to:s}=N(n),{rowLimit:u,buckets:d}=K(i,s),p=m(a.kpi.listKpis,{limit:u,filter:{from:i,to:s}}),h=(0,F.useMemo)(()=>{let e=new Map;for(let t of p??[]){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},[p,d]),g=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`oc-admin__hint`,children:[l(),` `,(0,I.jsx)(`span`,{className:`oc-filter__window`,children:c()})]}),(0,I.jsx)(J,{value:n,onChange:r})]});return p===void 0?(0,I.jsxs)(I.Fragment,{children:[g,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:o()})]}):p.length===0?(0,I.jsxs)(I.Fragment,{children:[g,(0,I.jsx)(z,{}),(0,I.jsx)(`p`,{className:`oc-admin__hint`,children:f()})]}):(0,I.jsxs)(I.Fragment,{children:[g,(0,I.jsx)(z,{}),U.map(e=>{let t=V.filter(t=>t.group===e);return t.some(e=>(h.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:h.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:d({value:$(n.bucket)})}):(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:u()}),(0,I.jsx)(`span`,{className:`oc-kpi__muted`,children:y({count:t.length})})]})]})]})}var X=240,Z=48,ie=1;function ae({series:e,isError:t,unit:n}){if(e.length===0)return(0,I.jsx)(`div`,{className:`oc-kpi__chart oc-kpi__chart--empty`,"aria-hidden":!0});let i=e.reduce((e,t)=>t.value>e?t.value:e,0),a=X/e.length,o=Math.max(a-ie,1);return(0,I.jsx)(`svg`,{className:`oc-kpi__chart`,viewBox:`0 0 ${X} ${Z}`,preserveAspectRatio:`none`,role:`img`,"aria-label":r({max:Q(i),unit:n}),children:e.map((e,r)=>{let s=i>0?e.value/i*(Z-1):0,c=r*a,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:o,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{$k as r,AD as i,BD as a,CD as o,DD as s,E as c,ED as l,FD as u,HD as d,ID as f,Ky as ee,LD as te,MD as ne,ND as p,OD as m,PD as re,Qk as ie,RD as ae,SD as oe,TA as h,TD as g,UD as se,VD as ce,WD as le,_D as ue,aA as de,bD as _,cA as v,dA as y,dD as b,eA as x,fD as S,gA as C,gD as w,hD as T,iA as E,jD as D,kD as O,mD as k,nA as A,oA as j,pD as M,rA as N,sA as P,tA as F,vD as I,wA as L,wD as R,xD as z,yD as B,zD as V}from"./dist-BJuS9RKK.js";import{t as H}from"./button-C3T_nXdg.js";import{C as fe,N as pe,S as me,_ as U,b as he,et as W,j as ge,lt as G,x as K,y as _e}from"./index-DgeJfwWI.js";import{t as ve}from"./localePickerView-C2RmOS86.js";var q=t(e(),1),J=[{id:`messages`,label:()=>le()},{id:`composer`,label:()=>se()},{id:`sidebar`,label:()=>d()},{id:`other`,label:()=>ce()}],Y={showSource:{category:`messages`,label:()=>a(),help:()=>V()},showReport:{category:`messages`,label:()=>ae(),help:()=>te()},copyAssistant:{category:`messages`,label:()=>f()},copyUser:{category:`messages`,label:()=>u()},showDelete:{category:`messages`,label:()=>re()},showTools:{category:`messages`,label:()=>p(),help:()=>ne()},voiceInput:{category:`composer`,label:()=>D(),help:()=>i()},showChatAge:{category:`sidebar`,label:()=>O(),help:()=>m()},showChatProvider:{category:`sidebar`,label:()=>s(),help:()=>l()}};function X(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function ye(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 be=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showChatProvider`],xe={voiceInput:`voiceInput`};function Se(e){return be.includes(e)}function Z(e){return e===`admin`}function Ce(e){return e===!0?`on`:e===!1?`off`:`inherit`}function we(e){return e===`on`?!0:e===`off`?!1:null}function Q(e){return Se(e)?xe[e]:void 0}var $=n(),Te={voiceInput:()=>T()};function Ee({prefKey:e,ui:t}){let n=L(c.admin.setUiPrefDefault),r=L(c.admin.setFeatureEnabled),i=Q(e),a=i?Te[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:B()}),(0,$.jsxs)(_e,{value:Ce(t.defaults[e]),onValueChange:t=>void n({key:e,value:we(t)}),children:[(0,$.jsx)(me,{size:`sm`,className:`w-36`,children:(0,$.jsx)(fe,{})}),(0,$.jsxs)(he,{children:[(0,$.jsx)(K,{value:`on`,children:M()}),(0,$.jsx)(K,{value:`off`,children:S()}),(0,$.jsx)(K,{value:`inherit`,children:b()})]})]}),i?(0,$.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,$.jsx)(U,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":I()}),I()]}):null]}),a?(0,$.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function De(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),i=h(c.me.getMe,{host:G}),a=i?.ui,s=Z(i?.role)&&n,l=L(c.me.setUiPref).withOptimisticUpdate(ge),u=(0,q.useMemo)(()=>a?ye(Object.keys(a.effective),e):[],[a,e]);return a?(0,$.jsxs)(`div`,{className:`oc-prefs-panel`,children:[Z(i?.role)?(0,$.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,$.jsx)(U,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":_()}),_()]}):null,s?(0,$.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,$.jsx)(`p`,{children:ue()}),(0,$.jsx)(`p`,{children:w()}),(0,$.jsx)(`p`,{children:k()})]}):null,(0,$.jsx)(W,{value:e,onChange:e=>t(e.target.value),placeholder:g(),"aria-label":g(),className:`mb-2`}),u.length===0?(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:R()}):(0,$.jsx)(`div`,{className:`oc-prefs`,children:u.map(e=>(0,$.jsxs)(`div`,{className:`oc-prefs__group`,children:[(0,$.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=Y[e],n=t?t.label():e,r=t?.help?.(),i=a.locked[e],c=a.effective[e],u=a.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:o()}):u?null:(0,$.jsx)(`span`,{className:`oc-prefs__def`,children:oe()})]}),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:z()}):null,(0,$.jsx)(U,{checked:c,disabled:i,onCheckedChange:t=>void l({key:e,value:t===!0}),"aria-label":n})]}),s?(0,$.jsx)(Ee,{prefKey:e,ui:a}):null]},e)})]},e.id))})]}):(0,$.jsx)(`div`,{className:`oc-prefs__empty`,children:C()})}function Oe(){let e=h(c.me.getMe,{host:G}),t=L(c.me.setLocale),n=L(c.me.setMyName),i=pe(),a=e?.locale??`default`,o=e?.name??``,[s,l]=(0,q.useState)(null),u=s??o,d=u.trim()!==o.trim();async function f(){try{await n({name:u}),l(null),i.success(E())}catch(e){i.error(N(),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:v()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:P()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[(0,$.jsx)(W,{className:`max-w-xs`,value:u,maxLength:120,placeholder:j(),onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&d&&(e.preventDefault(),f())}}),(0,$.jsx)(H,{size:`sm`,disabled:!d,onClick:()=>void f(),children:ee()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:de()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:A()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:F()})]}),(0,$.jsxs)(`div`,{className:`oc-show__row`,children:[ve().map(e=>(0,$.jsx)(H,{variant:a===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,$.jsx)(H,{variant:a==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:y()})]}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:x()})]}),(0,$.jsxs)(`section`,{className:`oc-show__section`,children:[(0,$.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,$.jsx)(`h2`,{className:`oc-show__title`,children:r()}),(0,$.jsx)(`p`,{className:`oc-show__desc`,children:ie()})]}),(0,$.jsx)(De,{})]})]})}export{Oe as PreferencesTab};
@@ -1,4 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$p as r,A as i,At as a,E as o,Em as s,Mt as c,Nt as l,O as u,Ot as d,TA as f,Tm as p,_m as m,am as h,cm as g,dm as _,dr as v,em as y,fm as b,fr as x,gm as S,hm as C,im as w,jt as T,k as ee,kt as E,lm as te,mm as ne,mr as re,nm as ie,om as ae,pm as oe,pr as se,rm as D,sm as O,tm as k,um as A,ur as j,vm as M,wA as N}from"./dist-BJuS9RKK.js";import{d as P,f as F,i as I,l as L,n as R,r as z,t as B,u as V}from"./FieldLabel-Cz-9BS36.js";import{t as H}from"./button-C3T_nXdg.js";import{C as U,N as W,S as G,_ as K,b as q,lt as ce,x as J,y as Y}from"./index-DgeJfwWI.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:oe,help:b},documentary_fetch:{label:_,help:A},inbound_files:{label:te,help:g},history_summary:{label:re,help:se},file_curation:{label:l,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:k,references:y,files:r,previous_summary:x,new_messages:v,max_chars:j,file_name:T,budget_chars:a,feedback:E,content:d};function pe(){let e=f(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:ae()})});let r=e.find(e=>e._id===t)??e[0];return(0,$.jsxs)(`div`,{className:`oc-injtab`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,$.jsx)(R,{label:M(),help:m()}),(0,$.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,$.jsx)(`span`,{children:O()}),(0,$.jsxs)(Y,{value:r._id,onValueChange:e=>n(e),children:[(0,$.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(U,{})}),(0,$.jsx)(q,{children:e.map(e=>(0,$.jsx)(J,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,$.jsx)(me,{instance:r},r._id)]})}function me({instance:e}){let t=N(o.admin.upsertInstanceConfig),n=W(),r=f(o.me.getMe,{host:ce}),a=e.config??{},c=X(e.config?.contentLocale,r?.defaultLocale??void 0),[l,d]=(0,Q.useState)(()=>I(a,c));(0,Q.useEffect)(()=>{d(I(a,c))},[c,e._id]);let[m,h]=(0,Q.useState)(!1),g=l.promptInjections,_=(e,t)=>d({...l,promptInjections:{...g,[e]:{...g[e],...t}}});async function v(){h(!0);try{await t({instanceId:e._id,config:z(l,a,c)})}catch(e){n.error(p(),e)}finally{h(!1)}}async function y(r){let i={...e.config??{}};r==="default"?delete i.contentLocale:i.contentLocale=r;try{await t({instanceId:e._id,config:i})}catch(e){n.error(p(),e)}}let b=e.config?.contentLocale??`default`,x=Z[X(void 0,r?.defaultLocale??void 0)];return(0,$.jsxs)(`div`,{className:`oc-injtab__body`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__content-locale`,children:[(0,$.jsx)(`span`,{children:i()}),(0,$.jsxs)(Y,{value:b,onValueChange:e=>void y(e),children:[(0,$.jsx)(G,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(U,{})}),(0,$.jsxs)(q,{children:[(0,$.jsx)(J,{value:`default`,children:u({locale:x})}),le().map(e=>(0,$.jsx)(J,{value:e.value,children:e.label},e.value))]})]}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:ee()})]}),V.map(e=>(0,$.jsx)(he,{injKey:e,def:L[e],i18n:ue[e],row:g[e]??{enabled:!0,template:L[e].defaultTemplate[c]},contentLocale:c,onChange:t=>_(e,t)},e)),(0,$.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,$.jsx)(H,{size:`sm`,onClick:()=>void v(),disabled:m,children:s()})})]})}function he({injKey:e,def:t,i18n:n,row:r,contentLocale:i,onChange:a}){let[o,s]=(0,Q.useState)(!1),c=r.template.trim()!==t.defaultTemplate[i],l=t.togglable&&!r.enabled,u=Object.fromEntries(t.placeholders.map(e=>[e,de[e]??`{${e}}`])),d=P(e,r,i),f=d?F(d,u):``;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)(K,{checked:r.enabled,onCheckedChange:e=>a({enabled:e===!0})}),(0,$.jsx)(R,{label:n.label(),help:n.help()})]}):(0,$.jsx)(R,{label:n.label(),help:n.help()}),c&&(0,$.jsx)(`span`,{className:`oc-injection__badge`,children:C()})]}),(0,$.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.template,disabled:l,rows:8,spellCheck:!1,onChange:e=>a({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:ne()}),t.placeholders.map(e=>(0,$.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,$.jsx)(`code`,{children:`{${e}}`}),(0,$.jsx)(B,{text:(fe[e]??(()=>e))()})]},e))]}),(0,$.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,$.jsx)(H,{variant:`ghost`,size:`sm`,onClick:()=>s(e=>!e),children:o?w():h()}),c&&(0,$.jsx)(H,{variant:`ghost`,size:`sm`,onClick:()=>a({template:t.defaultTemplate[i]}),children:S()})]})]}),o&&(0,$.jsx)(`div`,{className:`oc-injcard__preview`,children:f?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:f}),(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:D()})]}):(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:ie()})})]})}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,C_ as i,D_ as te,E as a,E_ as o,F_ as s,G_ as c,H_ as l,I_ as u,J_ as d,K_ as f,L_ as p,O_ as m,Q_ as h,R_ as g,S_ as _,TA as v,T_ as y,U_ as b,V_ as x,W_ as S,X_ as ne,Y_ as re,Z_ as ie,av as C,cv as w,ev as T,iv as E,k_ as D,lv as O,nv as k,ov as A,q_ as j,rn as M,rv as N,sv as P,tv as F,uv as I,wA as L,w_ as R,x_ as ae,z_ as z}from"./dist-BJuS9RKK.js";import{t as B}from"./button-C3T_nXdg.js";import{$ as V,N as H,P as U,_ as W,et as G,m as K,wt as q}from"./index-DgeJfwWI.js";import{t as J}from"./roleDescriptions-D-TCtebQ.js";var Y=t(e(),1),X=n(),Z=[{group:()=>I(),keys:[{key:`traces.read`,label:()=>C()},{key:`traces.read.content`,label:()=>E(),phi:!0},{key:`traces.write`,label:()=>N()}]},{group:()=>O(),keys:[{key:`kpi.read`,label:()=>C()},{key:`kpi.write`,label:()=>N()}]},{group:()=>w(),keys:[{key:`openclaw.query`,label:()=>k()},{key:`anomalies.read`,label:()=>F()},{key:`anomalies.report`,label:()=>T()}]},{group:()=>P(),keys:[{key:`chats.read`,label:()=>C()},{key:`selfheal`,label:()=>h()},{key:`feedback.respond`,label:()=>M()}]},{group:()=>A(),keys:[{key:`admin.manage`,label:()=>r()}]}],oe=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function se(){let e=v(a.apiKeys.listRoles,{}),t=L(a.apiKeys.createRole),n=L(a.apiKeys.ensureRolesSeeded),r=L(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))}),h=U(),C=H(),[w,T]=(0,Y.useState)(!1),[E,O]=(0,Y.useState)($),[k,A]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{C.error(ne(),e)})},[n,C]);let M=e??[];async function N(e,t){if(Q(e.permissions)||k.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];if(!(e.builtin&&!await h({title:re({name:e.name}),description:d(),confirmLabel:j()}))){A(t=>new Set(t).add(e._id));try{await r({roleId:e._id,permissions:n})}catch(e){C.error(f(),e)}finally{A(t=>{let n=new Set(t);return n.delete(e._id),n})}}}async function P(){try{await t({key:E.key,name:E.name,description:E.description||void 0,permissions:[]}),O($),T(!1)}catch(e){C.error(c(),e)}}let F=e===void 0,I=!F&&M.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[S(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,b(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,l()]}),(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:x()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(B,{size:`sm`,onClick:()=>{O($),T(!0)},children:ee()})})]}),F?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:z()}):I?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:g()}):(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:p()}),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?ie({key:e.key}):e.key,children:[e.label(),e.phi?(0,X.jsx)(`span`,{className:`oc-matrix__phi`,children:` ⚠`}):null]},e.key)))})]}),(0,X.jsx)(`tbody`,{children:M.map(e=>{let t=Q(e.permissions),n=k.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)(V,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(q,{}),` `,u()]}):(0,X.jsx)(V,{variant:`secondary`,children:s()})]}),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)(W,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?D():n?m():r,onCheckedChange:()=>void N(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(K,{open:w,onOpenChange:T,title:te(),description:o(),canSubmit:!!(E.key&&E.name),onSubmit:P,submitLabel:y(),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:R()}),(0,X.jsx)(G,{value:E.key,placeholder:i(),onChange:e=>O({...E,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:_()}),(0,X.jsx)(G,{value:E.name,onChange:e=>O({...E,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:ae()}),(0,X.jsx)(G,{value:E.description,onChange:e=>O({...E,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,$T as i,AE as ee,BE as te,CE as ne,DE as re,E as a,EE as ie,FE as ae,GE as oe,GT as o,HE as se,IE as ce,JE as le,JT as s,KE as ue,KT as c,LE as de,ME as fe,NE as pe,OE as me,PE as he,QE as ge,QT as l,RE as _e,SA as ve,SE as ye,TA as u,TE as be,UE as xe,VE as Se,WE as Ce,WT as we,XE as Te,XT as d,YE as Ee,YT as f,ZE as De,ZT as p,_E as Oe,aD as m,aE as h,bE as ke,cD as Ae,cE as g,dE as _,eD as je,eE as v,fE as y,gE as Me,hE as Ne,iD as b,iE as x,jE as Pe,kE as Fe,lD as Ie,lE as S,mE as Le,nD as Re,nE as C,oD as ze,oE as w,pE as T,qE as Be,qT as E,rD as Ve,rE as D,sD as He,sE as O,tD as Ue,tE as k,uD as We,uE as A,vE as Ge,wA as j,wE as Ke,xE as qe,yE as Je,zE as Ye}from"./dist-BJuS9RKK.js";import{n as M}from"./dist-B1tb-c2t.js";import{i as Xe}from"./dist-CpS8aq8T.js";import{t as N}from"./button-C3T_nXdg.js";import{$ as P,At as F,C as I,Ft as Ze,N as Qe,Nt as $e,O as L,P as et,Pt as tt,S as R,at as z,b as B,et as nt,it as V,k as H,m as rt,nt as U,ot as it,rt as at,tt as W,x as G,y as K}from"./index-DgeJfwWI.js";import{t as ot}from"./FilterBar-CZN4zOuy.js";import{t as st}from"./DataTableShell-DzK-qEdq.js";import{t as ct}from"./roleDescriptions-D-TCtebQ.js";var q=t(e(),1),J=n(),Y=[{value:`never`,label:()=>d(),days:null},{value:`30`,label:()=>f(),days:30},{value:`90`,label:()=>s(),days:90}],X=720*60*60*1e3,Z=`__all__`,Q={name:``,roleKey:``,description:``};function $(){let e=Ze({from:`/settings/serviceAccounts`}),t=tt({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??Z,[o,s]=(0,q.useState)(Z),c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),l=e=>void t({search:t=>({...t,status:e===Z?void 0:e})}),we=u(a.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===Z?void 0:o,disabled:i===Z?void 0:i===`disabled`}}),d=u(a.apiKeys.listKeys,{}),f=u(a.apiKeys.listRoles,{}),p=j(a.apiKeys.createServiceAccount),h=j(a.apiKeys.updateServiceAccount),g=j(a.apiKeys.deleteServiceAccount),_=ve(a.apiKeys.mintApiKey),v=j(a.apiKeys.revokeApiKey),y=et(),x=Qe(),S=n!==``||o!==Z||i!==Z;function C(){s(Z),t({search:{},replace:!0})}let[w,T]=(0,q.useState)(!1),[E,D]=(0,q.useState)(Q),[O,k]=(0,q.useState)(null),[A,M]=(0,q.useState)(new Set),[F,L]=(0,q.useState)(null),z=(0,q.useRef)(!1),[V,H]=(0,q.useState)(new Set),[U,it]=(0,q.useState)({}),[at,W]=(0,q.useState)(null),X=(0,q.useMemo)(()=>{let e=new Map;for(let t of d??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[d]);function $(e){M(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function dt(){try{O?(await h({serviceAccountId:O,name:E.name,roleKey:E.roleKey,description:E.description}),x.success(me())):await p({name:E.name,roleKey:E.roleKey,description:E.description||void 0}),D(Q),k(null),T(!1)}catch(e){x.error(O?Fe():ee(),e)}}function ft(e){D({name:e.name,roleKey:e.roleKey,description:e.description??``}),k(e._id),T(!0)}async function pt(e){if(z.current)return;z.current=!0;let t=U[e._id]??`never`,n=Y.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;L(e._id);try{let t=await _({serviceAccountId:e._id,expiresAt:r});W({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){x.error(re(),e)}finally{z.current=!1,L(null)}}async function mt(e){if(await y({title:ie(),description:(0,J.jsxs)(J.Fragment,{children:[be(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Ke(),` `,(0,J.jsx)(`strong`,{children:ne()}),` `,ye()]}),confirmWord:e.name,confirmLabel:qe(),destructive:!0}))try{await g({serviceAccountId:e._id}),x.success(ke(),e.name)}catch(e){x.error(Je(),e)}}async function ht(e){if(await y({title:Ge(),description:(0,J.jsxs)(J.Fragment,{children:[Oe(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,Me()]}),confirmLabel:Ne(),destructive:!0})&&!V.has(e._id)){H(t=>new Set(t).add(e._id));try{await v({keyId:e._id})}catch(e){x.error(Le(),e)}finally{H(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:We()}),(0,J.jsxs)(ot,{q:n,onQChange:c,searchPlaceholder:Ie(),onReset:C,canReset:S,children:[(0,J.jsxs)(K,{value:o,onValueChange:s,children:[(0,J.jsx)(R,{size:`sm`,className:`w-40`,children:(0,J.jsx)(I,{placeholder:Ae()})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(G,{value:Z,children:He()}),(f??[]).map(e=>(0,J.jsx)(G,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(K,{value:i,onValueChange:l,children:[(0,J.jsx)(R,{size:`sm`,className:`w-36`,children:(0,J.jsx)(I,{})}),(0,J.jsxs)(B,{children:[(0,J.jsx)(G,{value:Z,children:ze()}),(0,J.jsx)(G,{value:`active`,children:m()}),(0,J.jsx)(G,{value:`disabled`,children:b()})]})]})]}),(0,J.jsx)(st,{title:Ve(),rows:we,addLabel:Re(),onAdd:()=>{D(Q),k(null),T(!0)},emptyHint:Ue(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,J.jsx)(lt,{account:e,keys:X.get(e._id)??[],onRevoke:ht,revoking:V}),rowActions:e=>[{label:De(),onSelect:()=>ft(e)},{label:je(),onSelect:()=>void pt(e)},{label:A.has(e._id)?r():ge(),onSelect:()=>$(e._id)},{label:Te(),variant:`destructive`,onSelect:()=>void mt(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(N,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?Ee():le(),onClick:()=>$(e._id),children:A.has(e._id)?(0,J.jsx)(Xe,{}):(0,J.jsx)($e,{})})},{header:Be(),sort:e=>e.name,cell:e=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{children:e.name}),e.description?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:ue(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(P,{variant:`secondary`,children:e.roleKey})},{header:oe(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(P,{variant:`destructive`,children:b()}):(0,J.jsx)(P,{variant:`outline`,children:m()})},{header:Ce(),cell:e=>(0,J.jsxs)(K,{value:U[e._id]??`never`,onValueChange:t=>it(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(R,{size:`sm`,className:`w-32`,children:(0,J.jsx)(I,{})}),(0,J.jsx)(B,{children:Y.map(e=>(0,J.jsx)(G,{value:e.value,children:e.label()},e.value))})]})},{header:xe(),sort:e=>(X.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(X.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,J.jsx)(`span`,{className:`oc-sa__keycount`,children:F===e._id?se():Se({count:t})})}}]}),(0,J.jsx)(rt,{open:w,onOpenChange:e=>{T(e),e||k(null)},title:O?te():de(),description:O?Ye():ce(),canSubmit:!!(E.name&&E.roleKey),onSubmit:dt,submitLabel:O?_e():ae(),children:(0,J.jsxs)(`div`,{className:`oc-form`,children:[(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:he()}),(0,J.jsx)(nt,{value:E.name,onChange:e=>D({...E,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:pe()}),(0,J.jsxs)(K,{value:E.roleKey||void 0,onValueChange:e=>D({...E,roleKey:e}),children:[(0,J.jsx)(R,{className:`w-full`,children:(0,J.jsx)(I,{placeholder:fe()})}),(0,J.jsx)(B,{children:(f??[]).map(e=>(0,J.jsxs)(G,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(f??[]).find(e=>e.key===E.roleKey),t=e?ct(e):null;return t?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:Pe()}),(0,J.jsx)(nt,{value:E.description,onChange:e=>D({...E,description:e.target.value})})]})]})}),(0,J.jsx)(ut,{minted:at,onClose:()=>W(null)})]})}function lt({account:e,keys:t,onRevoke:n,revoking:r}){return(0,J.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,J.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[T(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:y()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:_()}),(0,J.jsx)(`th`,{children:A()}),(0,J.jsx)(`th`,{children:S()}),(0,J.jsx)(`th`,{children:g()}),(0,J.jsx)(`th`,{children:O()}),(0,J.jsx)(`th`,{children:w()}),(0,J.jsx)(`th`,{})]})}),(0,J.jsx)(`tbody`,{children:t.map(t=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,J.jsx)(`td`,{children:(0,J.jsx)(P,{variant:`secondary`,children:e.roleKey})}),(0,J.jsx)(`td`,{children:H(t.createdAt)}),(0,J.jsx)(`td`,{className:dt(t.lastUsedAt)?`oc-sa__stale`:``,children:ft(t.lastUsedAt)}),(0,J.jsx)(`td`,{children:pt(t.expiresAt)}),(0,J.jsx)(`td`,{children:mt(t)}),(0,J.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,J.jsx)(N,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?h():x()})})]},t._id))})]})]})}function ut({minted:e,onClose:t}){let[n,r]=(0,q.useState)(!1);async function ee(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,J.jsx)(W,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(U,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(z,{children:[(0,J.jsx)(it,{children:D()}),(0,J.jsx)(at,{children:C({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:k()}),(0,J.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,J.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,J.jsxs)(N,{variant:`outline`,size:`sm`,onClick:()=>void ee(),"aria-label":v(),children:[n?(0,J.jsx)(M,{}):(0,J.jsx)(F,{}),n?i():l()]})]}),(0,J.jsx)(V,{children:(0,J.jsx)(N,{onClick:()=>{r(!1),t()},children:p()})})]}):null})}function dt(e){return e===null?!1:Date.now()-e>X}function ft(e){return e===null?E():H(e)}function pt(e){return e===null?`—`:L(e)}function mt(e){return e.disabled?(0,J.jsx)(P,{variant:`destructive`,children:c()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(P,{variant:`outline`,children:o()}):(0,J.jsx)(P,{variant:`outline`,children:we()})}export{$ as ServiceAccountsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$r as r,Ar as i,Br as a,Cr as o,Dr as s,E as c,Er as l,Fr as u,Gr as d,Hr as f,Ir as p,Jr as m,Kr as h,Lr as g,Mr as _,Nr as v,Or as y,Pr as b,Qr as x,Rr as S,Sr as C,TA as w,Tr as T,Ur as E,Vr as D,Wr as O,Xr as k,Yr as A,Zr as j,br as M,ei as N,jr as P,kr as F,ni as I,qr as L,ri as ee,ti as R,wA as z,wr as B,xr as V,yr as H,zr as U}from"./dist-BJuS9RKK.js";import{t as W}from"./button-C3T_nXdg.js";import{P as G,k as K}from"./index-DgeJfwWI.js";import{t as q}from"./DataTableShell-DzK-qEdq.js";var J=t(e(),1),Y=n(),X={hung:()=>a(),wrong_result:()=>U(),error:()=>S(),other:()=>g()},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=z(c.subAgentReports.respondToReport),[r,a]=(0,J.useState)(e.thread),[d,f]=(0,J.useState)(``),[m,h]=(0,J.useState)(!1);async function g(){let t=d.trim();if(!(!t||m)){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),` · `,p({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:u()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:b()}),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`?v():_()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:P()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:i(),value:d,maxLength:2e3,rows:3,onChange:e=>f(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(W,{size:`sm`,onClick:()=>void g(),disabled:!d.trim()||m,children:m?y():F()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[s({count:t.children.length}),t.childrenTruncated?` ${l()}`:``,t.textTruncated?` ${T()}`:``]}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,Y.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Y.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Q(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${B()}`:``]}),e.errorMessage?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:o()}),(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:C()}),(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=w(c.subAgentReports.listForAdmin,{}),t=z(c.subAgentReports.readReport),n=z(c.subAgentReports.deleteReport),i=G(),[a,o]=(0,J.useState)(null),[s,l]=(0,J.useState)({});async function u(e){if(a===e._id){o(null);return}if(!s[e._id]){let n=await t({reportId:e._id});l(t=>({...t,[e._id]:n}))}o(e._id)}async function p(e){await i({title:V(),description:M(),confirmLabel:H(),destructive:!0})&&(await n({reportId:e._id}),a===e._id&&o(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[R(),` `,(0,Y.jsx)(`strong`,{children:N()}),` `,r()]}),(0,Y.jsx)(q,{title:ee(),rows:e,emptyHint:I(),isExpanded:e=>a===e._id&&!!s[e._id],renderExpanded:e=>s[e._id]?(0,Y.jsx)($,{data:s[e._id]}):null,columns:[{header:x(),cell:e=>K(e.at),sort:e=>e.at},{header:j(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:k(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:A(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${h({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:m(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:L(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:d()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:O()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:a===e._id?f():E(),onSelect:()=>void u(e)},{label:D(),onSelect:()=>void p(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$D as r,$O as i,AO as a,BO as o,CO as s,D as c,DO as l,E as u,EO as d,FO as f,GD as p,GO as m,HO as h,IO as g,JD as _,JO as v,KD as y,KO as b,LO as x,MO as ee,NO as te,OO as ne,PO as re,QD as ie,QO as ae,RO as oe,SA as se,SO as ce,TA as S,TO as le,UO as ue,VO as de,WO as fe,XD as pe,XO as me,YD as C,YO as he,ZD as ge,ZO as _e,_O as ve,_r as w,aO as ye,ak as be,bO as xe,cO as Se,ck as Ce,dO as T,dk as we,eO as Te,ek as Ee,fA as De,fO as Oe,fk as ke,gO as Ae,gr as je,hO as Me,hr as Ne,iO as Pe,ik as Fe,jO as Ie,kO as Le,lO as Re,lk as ze,mA as Be,mO as Ve,n as He,nO as Ue,nk as We,oO as Ge,ok as Ke,pA as qe,pO as Je,pk as Ye,qD as Xe,qO as Ze,rO as Qe,rk as $e,sO as et,sk as tt,tO as nt,tk as rt,uO as it,uk as at,vO as ot,vr as E,wA as D,wO as st,xO as ct,yO as lt,zO as ut}from"./dist-BJuS9RKK.js";import{n as O}from"./dist-B1tb-c2t.js";import{t as k}from"./x-DzHSe3Kh.js";import{t as A}from"./button-C3T_nXdg.js";import{$ as j,C as M,J as dt,Ot as N,Q as ft,S as P,X as pt,Y as F,Z as mt,_ as I,b as L,ct as ht,et as R,kt as gt,lt as z,q as _t,st as vt,x as B,y as V}from"./index-DgeJfwWI.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-DESvIpRK.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-Dgu2YiDE.js";import{t as kt}from"./TimeRangePicker-DVDywKqe.js";import{t as At}from"./FilterBar-CZN4zOuy.js";import{t as jt}from"./AdvancedFilter-gsdcm_1A.js";var G=c(`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(Ve());if(e.size>zt)throw Error(Je());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(T());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(T());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(it());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(Oe())),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`?Be():e===`dark`?qe():De()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:He(`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)(O,{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)(A,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":E(),title:E(),children:(0,X.jsx)(gt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=S(u.charts.listMyCharts),r=D(u.charts.setMyChart);async function a(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:be()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Fe()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:$e(),subtitle:We(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?rt():n.via===`owner`?Ee():i({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 a(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:ae()}):null]})}function Qt(){let e=D(u.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1),[d,p]=(0,K.useState)(!1);async function m(e){let t=e.target.files?.[0];if(e.target.value=``,t){s(null),l(!1);try{i(await t.text())}catch{s(a())}}}async function h(){if(s(null),l(!1),t.trim()===``){s(ne());return}let o;try{o=JSON.parse(r)}catch{s(a());return}p(!0);try{await e({name:t.trim(),tokens:o}),l(!0),n(``),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{p(!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:oe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:x()})]}),(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:g()}),(0,X.jsx)(R,{value:t,onChange:e=>n(e.target.value),placeholder:f(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:re()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:te(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),ee(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void m(e)})]})}),(0,X.jsx)(A,{size:`sm`,disabled:d,onClick:()=>void h(),children:Ie()})]}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null,c?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:Le()}):null]})]})}function $t({chart:e}){let t=se(u.charts.setChartLogo),n=D(u.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ut(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function d(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function f(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function p({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?ct():xe()}),(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)(A,{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?ot():lt(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void f(e),children:Ae()}):null,t?(0,X.jsx)(A,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:ve()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ce()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(p,{mode:`light`}),(0,X.jsx)(p,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Me()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=S(u.me.getMe,{host:z}),n=D(u.charts.addChartDomain),r=D(u.charts.removeChartDomain),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let d=e.domains??[];async function f(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function p(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Re()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:d.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ye()}):d.map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Pe({domain:e}),onClick:()=>void p(e),children:(0,X.jsx)(k,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(R,{value:i,onChange:e=>a(e.target.value),placeholder:et(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&f()}}),(0,X.jsx)(A,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void f(),children:Ge()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Se()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=D(u.charts.updateChart),n=D(u.charts.deleteChart),[i,o]=(0,K.useState)(!1),[c,l]=(0,K.useState)(e.name),[d,f]=(0,K.useState)(()=>tn(e.tokens)),[p,m]=(0,K.useState)(e.tokens.bpm??0),[h,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(!1);function y(){l(e.name),f(tn(e.tokens)),m(e.tokens.bpm??0),g(null),o(!0)}async function b(){if(e.chartId===void 0)return;g(null);let n;try{n=JSON.parse(d)}catch{g(a());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;p>0?e.bpm=p:delete e.bpm}v(!0);try{await t({chartId:e.chartId,name:c.trim(),tokens:n}),o(!1)}catch(e){g(e instanceof Error?e.message:String(e))}finally{v(!1)}}async function x(){if(e.chartId!==void 0&&window.confirm(r()))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:i?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:y,children:st()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void x(),children:s()})]})})]}),i?(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:nt()}),(0,X.jsx)(R,{value:c,onChange:e=>l(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:w()}),(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:p,onChange:e=>m(Number(e.target.value)),"aria-label":w()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:p===0?je():`${p} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ne()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Te()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:d,onChange:e=>f(e.target.value),rows:10,spellCheck:!1})]}),h?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:h}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,disabled:_,onClick:()=>void b(),children:Qe()}),(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>o(!1),children:Ue()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=S(u.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:l()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:d()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:le()}):(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=D(u.charts.addChartToGroupPool),r=D(u.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,s=new Set((a??[]).map(e=>e.groupId)),c=t.filter(e=>!s.has(e._id));async function l(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function d(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)(j,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?fe():e.kind===`custom`&&e.scope===`personal`?C():m()}),e.isGlobalDefault?(0,X.jsx)(j,{variant:`default`,children:ue()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:de()}),(a??[]).map(e=>(0,X.jsxs)(j,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":ut({group:e.name}),onClick:()=>void d(e.groupId),children:(0,X.jsx)(k,{className:`size-3`})})]},e.groupId)),c.length>0?(0,X.jsxs)(V,{value:``,onValueChange:e=>void l(e),children:[(0,X.jsx)(P,{size:`sm`,className:`w-56`,children:(0,X.jsx)(M,{placeholder:o()})}),(0,X.jsx)(L,{children:c.map(e=>(0,X.jsx)(B,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:h()}):null]})]})}function on({chart:e}){let t=D(u.charts.promoteChartToCommon),n=D(u.charts.deleteChart);async function i(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function a(){if(e.chartId!==void 0&&window.confirm(r()))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)(j,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?_():C()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:pe({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(A,{variant:`outline`,size:`sm`,onClick:()=>void i(),children:Xe()}):null,(0,X.jsx)(A,{variant:`ghost`,size:`sm`,onClick:()=>void a(),children:y()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=D(u.admin.setDefaultThemeMode),i=D(u.admin.setDefaultLocale),a=D(u.charts.setDefaultChart),o=S(u.charts.listChartsAdmin),s=S(u.groups.listGroups,{}),c=e??`system`,l=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:tt()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ke()})]}),(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:_e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:me()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:$e()}),ht.map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(o??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(A,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:he()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:v()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:s??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ze()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:b()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(o??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ge()})]}),(()=>{let e=(o??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:p()}):(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:Ye()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ke()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(A,{variant:c===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:we()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:at()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(A,{variant:l===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ze()})]})]})}function cn(){let e=S(u.me.getMe,{host:z}),t=vt(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:Ce()}),(0,X.jsxs)($,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(A,{variant:`outline`,children:`Outline`}),(0,X.jsx)(A,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(A,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(A,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(A,{size:`sm`,children:`Small`}),(0,X.jsx)(A,{children:`Default`}),(0,X.jsx)(A,{size:`lg`,children:`Large`}),(0,X.jsx)(A,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(N,{})}),(0,X.jsx)(A,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)($,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(j,{children:`Default`}),(0,X.jsx)(j,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(j,{variant:`outline`,children:`Outline`}),(0,X.jsx)(j,{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)(V,{value:n,onValueChange:r,children:[(0,X.jsx)(P,{className:`w-56`,children:(0,X.jsx)(M,{placeholder:`Select…`})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(B,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(B,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(I,{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)(V,{value:o,onValueChange:s,children:[(0,X.jsx)(P,{size:`sm`,children:(0,X.jsx)(M,{})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(B,{value:Z,children:`Toutes directions`}),(0,X.jsx)(B,{value:`inbound`,children:`inbound`}),(0,X.jsx)(B,{value:`outbound`,children:`outbound`}),(0,X.jsx)(B,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(V,{value:c,onValueChange:l,children:[(0,X.jsx)(P,{size:`sm`,children:(0,X.jsx)(M,{})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(B,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(B,{value:`info`,children:`info`}),(0,X.jsx)(B,{value:`warn`,children:`warn`}),(0,X.jsx)(B,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(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)(_t,{children:[(0,X.jsx)(ft,{asChild:!0,children:(0,X.jsx)(A,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(dt,{align:`start`,children:[(0,X.jsx)(pt,{children:`Actions`}),(0,X.jsx)(mt,{}),(0,X.jsx)(F,{children:`Edit`}),(0,X.jsx)(F,{children:`Duplicate`}),(0,X.jsx)(mt,{}),(0,X.jsx)(F,{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)(A,{size:`sm`,children:`Save`}),(0,X.jsx)(A,{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)(I,{"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)(I,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(j,{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)(O,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(W,{children:(0,X.jsx)(A,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(N,{})})})]},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};