@lacneu/atrium 0.59.0 → 0.60.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/dist/assets/AccessTab-BlTwl2Uk.js +1 -0
  2. package/dist/assets/{AdvancedFilter-Cjx_oQl1.js → AdvancedFilter-C5pnO4fi.js} +1 -1
  3. package/dist/assets/AgentFilesTab-tYeG81Bo.js +3 -0
  4. package/dist/assets/{AnomaliesTab-DoKdyJxG.js → AnomaliesTab-C94n-0pQ.js} +1 -1
  5. package/dist/assets/{AuditTab-DXVoCSeC.js → AuditTab-D_mhJO5w.js} +1 -1
  6. package/dist/assets/BridgeTab-s6Ggg8Zu.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-DYVQXktp.js +1 -0
  8. package/dist/assets/{DataTableShell-CZObMHUc.js → DataTableShell-COEwE2Hv.js} +1 -1
  9. package/dist/assets/{DetailChips-BKsW8g7U.js → DetailChips-8ZpH5ZXE.js} +1 -1
  10. package/dist/assets/FeedbacksTab-CqJ8NDLb.js +1 -0
  11. package/dist/assets/{FieldLabel-DBoEEhN6.js → FieldLabel-hLNtge_D.js} +1 -1
  12. package/dist/assets/FilesTab-lytzpFwp.js +1 -0
  13. package/dist/assets/{FilterBar-DFzFJCUO.js → FilterBar-CY1WfFDB.js} +1 -1
  14. package/dist/assets/{GroupsTab-DMFNcHIS.js → GroupsTab-BjjiPSDY.js} +1 -1
  15. package/dist/assets/InstancesTab-bbthnf8h.js +1 -0
  16. package/dist/assets/IntegrationsTab-DQt4Kllc.js +1 -0
  17. package/dist/assets/{KpiTab-I3P9iGwv.js → KpiTab-qUWozfhc.js} +1 -1
  18. package/dist/assets/PreferencesTab-B1JSLFVE.js +1 -0
  19. package/dist/assets/{PromptInjectionsTab-ZFDnQ1Wi.js → PromptInjectionsTab-Df6PKtxv.js} +2 -2
  20. package/dist/assets/RolesTab-DbSxOWRh.js +1 -0
  21. package/dist/assets/ScheduledTab-km3Zx4dq.js +1 -0
  22. package/dist/assets/ServiceAccountsTab-Bcd88LfG.js +1 -0
  23. package/dist/assets/{SubAgentReportsTab-Bz9GJhSs.js → SubAgentReportsTab-xgRtphLV.js} +1 -1
  24. package/dist/assets/ThemeShowroom-DxcANzhZ.js +1 -0
  25. package/dist/assets/{TimeRangePicker-CoF8Chf_.js → TimeRangePicker-BYCcnF0a.js} +1 -1
  26. package/dist/assets/TracesTab-ColoY1Nx.js +1 -0
  27. package/dist/assets/UsersTab-B0IdN_hl.js +1 -0
  28. package/dist/assets/VoiceTab-qZ5tMxmC.js +1 -0
  29. package/dist/assets/{button-DPiqYkrF.js → button-Bd43O_sm.js} +1 -1
  30. package/dist/assets/{card-B7aSgmYB.js → card-Bkvykfxh.js} +1 -1
  31. package/dist/assets/chevrons-up-down-DIXCqs3W.js +1 -0
  32. package/dist/assets/{compatView-D_fn8HJP.js → compatView-B2BXfBvC.js} +1 -1
  33. package/dist/assets/{dispatchErrorInfo-2bqp8WGB.js → dispatchErrorInfo-DKMvYSfG.js} +1 -1
  34. package/dist/assets/{dist-Dz7d7Ev-.js → dist-CXJY_tYD.js} +1 -1
  35. package/dist/assets/dist-De2K23IB.js +44 -0
  36. package/dist/assets/{dist-DJFlg943.js → dist-DfildYj4.js} +1 -1
  37. package/dist/assets/{dist-Dx0HEr5d.js → dist-Du1hJWyV.js} +1 -1
  38. package/dist/assets/{highlighted-body-OFNGDK62-BA9It0bv.js → highlighted-body-OFNGDK62-xjw7PDBM.js} +1 -1
  39. package/dist/assets/index-CNwjY680.js +238 -0
  40. package/dist/assets/mermaid-GHXKKRXX-DxPFrHWq.js +1 -0
  41. package/dist/assets/{pdf-DyPkCZJt.js → pdf-CLjbM27Z.js} +1 -1
  42. package/dist/assets/roleDescriptions-zLFA4zEm.js +1 -0
  43. package/dist/assets/{table-DcJVBwwq.js → table-BRilRxUj.js} +1 -1
  44. package/dist/assets/{tabs-vmnojSO4.js → tabs-fDXC7itk.js} +1 -1
  45. package/dist/assets/x-DXaZHGzl.js +1 -0
  46. package/dist/index.html +7 -7
  47. package/package.json +1 -1
  48. package/dist/assets/AccessTab-BK94rfnb.js +0 -1
  49. package/dist/assets/AgentFilesTab-B_NorxT-.js +0 -3
  50. package/dist/assets/BridgeTab-DWnqQN9W.js +0 -1
  51. package/dist/assets/ChatDefaultsTab-Cu1_zDK6.js +0 -1
  52. package/dist/assets/FeedbacksTab-BgdgdtWl.js +0 -1
  53. package/dist/assets/FilesTab-C85lKKen.js +0 -1
  54. package/dist/assets/InstancesTab-D44qQOa6.js +0 -1
  55. package/dist/assets/IntegrationsTab-CrjPoUn0.js +0 -1
  56. package/dist/assets/PreferencesTab-DndBdQT0.js +0 -1
  57. package/dist/assets/RolesTab-DXAeCb95.js +0 -1
  58. package/dist/assets/ScheduledTab-BH7Tg-G4.js +0 -1
  59. package/dist/assets/ServiceAccountsTab-WfSZT7L9.js +0 -1
  60. package/dist/assets/ThemeShowroom-BIrMyK6X.js +0 -1
  61. package/dist/assets/TracesTab-DZxEvHsc.js +0 -1
  62. package/dist/assets/UsersTab-De6yjyS4.js +0 -1
  63. package/dist/assets/VoiceTab-Dp59GAxK.js +0 -1
  64. package/dist/assets/chevrons-up-down-CZgUiX5U.js +0 -1
  65. package/dist/assets/dist-DwNg72Ge.js +0 -44
  66. package/dist/assets/index-Dg_oXq0b.js +0 -238
  67. package/dist/assets/mermaid-GHXKKRXX-kd2cN6dg.js +0 -1
  68. package/dist/assets/roleDescriptions-C1GE6TIL.js +0 -1
  69. package/dist/assets/x-BmGrWf4l.js +0 -1
@@ -0,0 +1 @@
1
+ import{Fb as e,Mb as t,Nb as n,Pb as r,jb as i}from"./dist-De2K23IB.js";var a={pending:e,user:r,admin:n,observer:t,agent:i};function o(e){if(e.builtin){let t=a[e.key];if(t)return t()}return e.description}export{o as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{n}from"./dist-DwNg72Ge.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-De2K23IB.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-DwNg72Ge.js";import{t as d}from"./dist-Dz7d7Ev-.js";import{At as f,jt as p,kt as m}from"./index-Dg_oXq0b.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[p]),b=p(),[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)(f,{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-De2K23IB.js";import{t as d}from"./dist-CXJY_tYD.js";import{At as f,jt as p,kt as m}from"./index-CNwjY680.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=a(_,[p]),b=p(),[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)(f,{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-De2K23IB.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
@@ -62,14 +62,14 @@
62
62
  document.documentElement.dataset.motion = "static";
63
63
  })();
64
64
  </script>
65
- <script type="module" crossorigin src="/assets/index-Dg_oXq0b.js"></script>
65
+ <script type="module" crossorigin src="/assets/index-CNwjY680.js"></script>
66
66
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
67
- <link rel="modulepreload" crossorigin href="/assets/dist-DwNg72Ge.js">
68
- <link rel="modulepreload" crossorigin href="/assets/dist-Dz7d7Ev-.js">
69
- <link rel="modulepreload" crossorigin href="/assets/dist-DJFlg943.js">
70
- <link rel="modulepreload" crossorigin href="/assets/dist-Dx0HEr5d.js">
71
- <link rel="modulepreload" crossorigin href="/assets/x-BmGrWf4l.js">
72
- <link rel="modulepreload" crossorigin href="/assets/button-DPiqYkrF.js">
67
+ <link rel="modulepreload" crossorigin href="/assets/dist-De2K23IB.js">
68
+ <link rel="modulepreload" crossorigin href="/assets/dist-CXJY_tYD.js">
69
+ <link rel="modulepreload" crossorigin href="/assets/dist-DfildYj4.js">
70
+ <link rel="modulepreload" crossorigin href="/assets/dist-Du1hJWyV.js">
71
+ <link rel="modulepreload" crossorigin href="/assets/x-DXaZHGzl.js">
72
+ <link rel="modulepreload" crossorigin href="/assets/button-Bd43O_sm.js">
73
73
  <link rel="stylesheet" crossorigin href="/assets/index-BlYUA3DJ.css">
74
74
  </head>
75
75
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lacneu/atrium",
3
- "version": "0.59.0",
3
+ "version": "0.60.1",
4
4
  "description": "Atrium — public, self-hostable, Convex-backed web chat UI for AI agent gateways (OpenClaw today, Hermes next). Ships an origin-agnostic static bundle (Convex URL injected at runtime via /config.json).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$P as r,Bd as i,E as a,Gd as o,Hd as s,Jd as c,Kd as l,Qd as u,Rd as d,Ud as f,Vd as p,WP as m,Wd as h,Xd as g,Yd as _,Zd as v,qd as y,zd as b}from"./dist-DwNg72Ge.js";import{C as x,S,T as C,dt as w,w as T,x as E}from"./index-Dg_oXq0b.js";var D=t(e(),1);function O(e){return e===`user`?s():e===`all`?p():i({group:e.group})}function k(e){return e===`common`?b():e===`owner`?d():i({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=r(a.admin.listUsers,{}),[t,n]=(0,D.useState)(``),i=r(a.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:u()}),(0,A.jsxs)(E,{value:t,onValueChange:n,children:[(0,A.jsx)(T,{size:`sm`,"aria-label":v(),children:(0,A.jsx)(C,{placeholder:v()})}),(0,A.jsx)(S,{children:(e??[]).map(e=>(0,A.jsx)(x,{value:e.userId,children:j(e)},e._id))})]}),t===``?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:g()}):i===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:m()}):(0,A.jsxs)(`div`,{className:`oc-introspect`,children:[(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:_()}),(0,A.jsxs)(`div`,{className:`oc-introspect__id`,children:[(0,A.jsx)(`strong`,{children:i.user.label}),(0,A.jsx)(w,{variant:`secondary`,children:i.role})]})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:c()}),i.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:h()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:i.groups.map(e=>(0,A.jsx)(w,{variant:`secondary`,children:e.name},e.groupId))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:y()}),i.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:h()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:i.agents.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.displayName||e.agentId}),e.isDefault?(0,A.jsx)(w,{variant:`default`,children:f()}):null,(0,A.jsx)(w,{variant:`outline`,children:O(e.via)}),(0,A.jsx)(w,{variant:`secondary`,children:e.state})]},`${e.instanceName} ${e.agentId}`))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:l()}),i.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:h()}):(0,A.jsx)(`ul`,{className:`oc-introspect__list`,children:i.charts.map(e=>(0,A.jsxs)(`li`,{className:`oc-introspect__row`,children:[(0,A.jsx)(`span`,{className:`oc-introspect__name`,children:e.name}),(0,A.jsx)(w,{variant:`outline`,children:k(e.via)})]},e.key))})]}),(0,A.jsxs)(`section`,{className:`oc-introspect__section`,children:[(0,A.jsx)(`h3`,{className:`oc-introspect__title`,children:o()}),i.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:h()}):(0,A.jsx)(`div`,{className:`oc-introspect__chips`,children:i.permissions.map(e=>(0,A.jsx)(w,{variant:`secondary`,children:e},e))})]})]})]})}export{M as AccessTab};
@@ -1,3 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$P as r,Ai as i,Al as a,Ci as o,Cl as s,Di as c,Dl as l,E as u,Ei as d,El as f,GD as p,KP as m,Mi as h,Ml as g,Ni as _,Nl as ee,Oi as v,Ol as y,Pi as b,QP as x,Si as S,Sl as C,Ti as w,Tl as T,WP as E,XP as D,_i as O,_l as k,ai as A,al as te,bi as j,bl as M,cl as N,dl as P,fl as F,gi as I,gl as L,gu as R,hi as z,hl as ne,ii as B,il as V,ji as re,jl as ie,ki as H,kl as ae,ll as U,mi as oe,ml as se,mu as ce,ni as W,oi as G,ol as le,pl as ue,ri as de,si as fe,sl as pe,ti as me,ul as he,vi as ge,vl as _e,wi as ve,wl as ye,xi as be,xl as xe,yi as Se,yl as Ce}from"./dist-DwNg72Ge.js";import{t as K}from"./button-DPiqYkrF.js";import{C as we,G as Te,H as q,J as Ee,K as De,Pt as J,Q as Oe,S as ke,T as Ae,X as je,Y as Me,Z as Ne,_t as Pe,b as Fe,dt as Ie,ht as Le,mt as Re,pt as ze,q as Be,vt as Ve,w as He,wt as Ue,x as We}from"./index-Dg_oXq0b.js";import{n as Ge,t as Ke}from"./curation-CQksaIbm.js";import{i as qe}from"./compatView-D_fn8HJP.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=r(u.me.getMe,{host:Ue}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),o=r(u.admin.listInstances,e!==void 0&&t?{}:`skip`),[c,d]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!t||!o||o.length===0||(!c||!o.some(e=>e.name===c))&&d(o[0].name)},[t,o,c]);let p=r(u.agents.listAgentsForInstance,t&&c?{instanceName:c}:`skip`),h=r(u.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),_=(0,Y.useMemo)(()=>{if(e!==void 0){if(t)return c===null||p===void 0?o!==void 0&&o.length===0?[]:void 0:p.agents.map(e=>({instanceName:c,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(h!==void 0)return h.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,c,p,o,h]),[v,b]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!_||_.length===0||(!v||!_.some(e=>$(e)===v))&&b($(_[0]))},[_,v]);let x=_?.find(e=>$(e)===v)??null,S=D(u.agentFiles.listAgentFiles),[w,O]=(0,Y.useState)({status:`idle`}),k=x?.instanceName??null,A=x?.agentId??null,te=r(u.compat.forInstance,n&&k!==null?{instanceName:k}:`skip`),j=n&&k!==null?Fe(te,`agentFiles`):null,M=j===null?!1:j===`loading`?null:j.blocked,N=(0,Y.useCallback)(async()=>{if(!(k===null||A===null)){O({status:`loading`});try{O({status:`done`,files:(await S({instanceName:k,agentId:A})).files})}catch{O({status:`error`})}}},[S,k,A]);(0,Y.useEffect)(()=>{M===!1&&N()},[N,M]);let[P,F]=(0,Y.useState)(null),I=r(u.agentFileCuration.listCurations,t&&k!==null&&A!==null?{instanceName:k,agentId:A}:`skip`),L=r(u.agentFileCuration.curationSettings,t&&k!==null?{instanceName:k}:`skip`),R=D(u.agentFileCuration.requestCuration),[z,ne]=(0,Y.useState)(null),[B,V]=(0,Y.useState)(null),{toast:U}=q(),oe=(0,Y.useMemo)(()=>{let e=new Map;for(let t of I??[])e.has(t.name)||e.set(t.name,t);return e},[I]),se=(0,Y.useCallback)(async e=>{if(!(k===null||A===null)){ne(e);try{let t=await R({instanceName:k,agentId:A,name:e,trigger:`manual`});t.ok?U({title:re(),variant:`success`}):U({title:i({reason:t.reason??`unknown`}),variant:`error`})}catch{U({title:H(),variant:`error`})}finally{ne(null)}}},[R,k,A,U]),W=m(),G=(0,Y.useMemo)(()=>new Intl.NumberFormat(W,{maximumFractionDigits:0}),[W]);return e===void 0||_===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:E()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ee()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(o?.length??0)>1?(0,Q.jsxs)(We,{value:c??``,onValueChange:e=>d(e),children:[(0,Q.jsx)(He,{size:`sm`,"aria-label":g(),children:(0,Q.jsx)(Ae,{})}),(0,Q.jsx)(ke,{children:(o??[]).map(e=>(0,Q.jsx)(we,{value:e.name,children:e.name},e.name))})]}):null,_.length>0?(0,Q.jsxs)(We,{value:v??``,onValueChange:e=>b(e),children:[(0,Q.jsx)(He,{size:`sm`,"aria-label":ie(),children:(0,Q.jsx)(Ae,{})}),(0,Q.jsx)(ke,{children:_.map(e=>(0,Q.jsx)(we,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:a()})]}),x===null?null:j===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:E()}):j!==null&&j.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(J,{size:14,"aria-hidden":!0}),` `,qe(j.gatewayVersion,j.provider)]}):w.status===`loading`||w.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:E()}):w.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[y(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void N(),children:ce()})]}):w.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ae()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:w.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)(Ie,{variant:`outline`,children:l()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:f({size:Z(e.size,W)})}),(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:G.format(n)})}),r?(0,Q.jsx)(J,{size:14,className:`oc-afiles__warn`,"aria-label":ye()}):(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:()=>F(e),children:t?C():xe()}),t&&!e.missing?(0,Q.jsx)(nt,{curatable:Ke.includes(e.name),size:e.size??0,budget:L?.budgetChars??null,enabled:L?.enabled??!1,curation:oe.get(e.name)??null,inFlight:z===e.name,onCurate:()=>void se(e.name),onReview:e=>V(e)}):null]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:s({used:Z(Ze(w.files),W),total:Z(Je,W),pct:G.format(Xe(Ze(w.files)))})})]}),P&&x?(0,Q.jsx)(rt,{instanceName:x.instanceName,agentId:x.agentId,name:P.name,isAdmin:t,onClose:()=>F(null),onSaved:()=>void N()}):null,B?(0,Q.jsx)(it,{curationId:B,onClose:()=>V(null),onApplied:()=>{V(null),N()}}):null]})}function nt({curatable:e,size:t,budget:n,enabled:r,curation:i,inFlight:a,onCurate:o,onReview:s}){return i?.status===`proposed`?(0,Q.jsx)(K,{variant:`default`,size:`sm`,className:`oc-afiles__curate`,onClick:()=>s(i._id),children:_()}):a||i?.status===`dispatched`||i?.status===`applying`?(0,Q.jsx)(Ie,{variant:`outline`,className:`oc-afiles__curate-status`,children:h()}):e&&r&&n!==null&&Ge(t,n)?(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__curate`,onClick:o,children:b()}):null}function rt({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:i,onSaved:a}){let o=D(u.agentFiles.getAgentFile),s=D(u.agentFiles.setAgentFile),c=q(),[l,d]=(0,Y.useState)(null),[f,h]=(0,Y.useState)(!1),[g,_]=(0,Y.useState)(``),[ee,v]=(0,Y.useState)(!1),[y,b]=(0,Y.useState)(!1),[x,S]=(0,Y.useState)(!1),[C,w]=(0,Y.useState)(!1),T=(0,Y.useCallback)(async r=>{h(!1);try{let i=await o({instanceName:e,agentId:t,name:n});d({content:i.content,updatedAtMs:i.updatedAtMs}),r||_(i.content),S(!1)}catch{h(!0)}},[o,e,t,n]);(0,Y.useEffect)(()=>{T(!1)},[T]);async function O(){if(l!==null){b(!0),w(!1);try{await s({instanceName:e,agentId:t,name:n,content:g,baseUpdatedAtMs:l.updatedAtMs??void 0}),c.success(se({name:n})),a(),await T(!1)}catch(e){et(e)?S(!0):w(!0)}finally{b(!1)}}}let A=l!==null&&g!==l.content,j=(0,Y.useMemo)(()=>l===null?null:$e(l.content,g),[l,g]),I=g.length>X,z=m(),B=(0,Y.useMemo)(()=>new Intl.NumberFormat(z),[z]);return(0,Q.jsx)(ze,{open:!0,onOpenChange:e=>!e&&i(),children:(0,Q.jsxs)(Re,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(Pe,{children:[(0,Q.jsx)(Ve,{children:M({name:n})}),(0,Q.jsxs)(Le,{children:[Ce({agent:t,instance:e}),r?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,_e()]})]})]}),f?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[F(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void T(!1),children:ce()})]}):l===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:E()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:g,readOnly:!r,spellCheck:!1,onChange:e=>_(e.target.value),"aria-label":M({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:k()}),x?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[P(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void T(!0),children:he()})]}):null,C?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:ue()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${I?` is-over`:``}`,children:L({count:B.format(g.length),max:B.format(X)})}),r?(0,Q.jsx)(K,{size:`sm`,disabled:!A||y||x,onClick:()=>v(!0),children:y?R():ne()}):null]})]}),(0,Q.jsx)(Te,{open:ee,onOpenChange:v,children:(0,Q.jsxs)(Ee,{children:[(0,Q.jsxs)(Ne,{children:[(0,Q.jsx)(Oe,{children:U({name:n})}),(0,Q.jsx)(Me,{children:N({agent:t})})]}),j?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:pe({added:j.added,removed:j.removed})}),j.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:le()}),j.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,j.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:te()}),j.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Be,{children:p()}),(0,Q.jsx)(De,{onClick:()=>void O(),children:V()})]})]})})]})})}function it({curationId:e,onClose:t,onApplied:n}){let i=r(u.agentFileCuration.getProposal,{curationId:e}),a=D(u.agentFileCuration.approveCuration),s=x(u.agentFileCuration.rejectCuration),{toast:l}=q(),[f,p]=(0,Y.useState)(null),[h,g]=(0,Y.useState)(!1),[_,ee]=(0,Y.useState)(``),y=m(),b=(0,Y.useMemo)(()=>i?$e(i.beforeContent,i.proposedContent):null,[i]);async function C(){p(`approve`);try{let t=await a({curationId:e});t.ok?(l({title:v(),variant:`success`}),n()):l({title:t.reason===`conflict`?d():w({reason:t.reason??`unknown`}),variant:`error`})}catch{l({title:H(),variant:`error`})}finally{p(null)}}async function T(n){p(`reject`);try{let r=_.trim();(await s({curationId:e,...r?{comment:r}:{},relaunch:n})).ok?l({title:n?W():c(),variant:`success`}):l({title:S(),variant:`error`}),t()}catch{l({title:H(),variant:`error`})}finally{p(null)}}return(0,Q.jsx)(ze,{open:!0,onOpenChange:e=>e?void 0:t(),children:(0,Q.jsxs)(Re,{className:`oc-afiles__review`,children:[(0,Q.jsxs)(Pe,{children:[(0,Q.jsx)(Ve,{children:i?ve({name:i.name}):E()}),(0,Q.jsx)(Le,{children:o()})]}),i===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:E()}):i===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`oc-afiles__review-sizes`,children:[be({before:Z(i.beforeSize,y),after:Z(i.proposedSize,y)}),i.overBudget?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsx)(J,{size:13,"aria-hidden":!0}),` `,j()]}):null]}),b?(0,Q.jsx)(`p`,{className:`oc-afiles__review-diff`,children:Se({added:b.added,removed:b.removed})}):null,i.feedback?(0,Q.jsx)(`p`,{className:`oc-afiles__review-feedback`,children:me({feedback:i.feedback})}):null,b&&b.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__review-removed`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:oe()}),(0,Q.jsx)(`ul`,{children:b.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:z()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:i.beforeContent})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:ge()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:i.proposedContent})]})]})]}),h?(0,Q.jsxs)(`div`,{className:`oc-afiles__reject-form`,children:[(0,Q.jsx)(`label`,{className:`oc-afiles__review-label`,htmlFor:`curation-reject-comment`,children:fe()}),(0,Q.jsx)(`textarea`,{id:`curation-reject-comment`,className:`oc-afiles__reject-textarea`,rows:3,placeholder:G(),value:_,onChange:e=>ee(e.target.value)}),(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`ghost`,onClick:()=>g(!1),disabled:f!==null,children:A()}),(0,Q.jsx)(K,{variant:`outline`,onClick:()=>void T(!1),disabled:f!==null,children:f===`reject`?R():B()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void T(!0),disabled:f!==null,children:f===`reject`?R():de()})]})]}):(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`outline`,onClick:()=>g(!0),disabled:f!==null||i==null,children:O()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void C(),disabled:f!==null||i==null,children:f===`approve`?R():I()})]})]})})}export{tt as AgentFilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$P as r,$h as i,A_ as a,Ag as o,Bc as s,Bg as c,C_ as l,Cg as u,Cn as d,D as f,D_ as p,Dg as m,Dn as h,E as g,E_ as ee,Eg as _,Fc as v,Fg as te,Gc as y,Gg as ne,Hc as b,Hg as re,Ic as x,Ig as ie,Jg as ae,Kc as S,Kg as oe,Lc as se,Lg as ce,Mg as le,Ng as ue,Og as de,Pg as fe,QP as pe,Qh as me,Rc as he,Rg as ge,S_ as _e,Sg as ve,Sn as ye,T_ as be,Tg as xe,Uc as Se,Ug as Ce,Vc as we,Vg as Te,Wc as Ee,Wg as De,XP as Oe,Zh as C,__ as ke,_g as Ae,ag as je,b_ as Me,bg as Ne,bn as Pe,cg as Fe,dg as w,eg as Ie,fg as Le,g_ as Re,gg as ze,hg as Be,ig as Ve,jc as He,jg as Ue,k_ as We,kg as Ge,lg as Ke,mg as qe,ng as Je,og as Ye,pg as Xe,qc as Ze,qg as Qe,rg as $e,sg as et,tg as tt,ug as nt,vg as rt,w_ as it,wg as at,wn as ot,x_ as st,xg as ct,xn as lt,yg as ut,zc as dt,zg as ft}from"./dist-DwNg72Ge.js";import{i as T,r as pt}from"./dist-Dz7d7Ev-.js";import{t as mt}from"./chevrons-up-down-CZgUiX5U.js";import{i as ht,n as E,o as gt,r as _t,s as vt}from"./FieldLabel-DBoEEhN6.js";import{i as yt,n as bt,r as xt,t as St}from"./tabs-vmnojSO4.js";import{t as D}from"./button-DPiqYkrF.js";import{$ as Ct,$t as O,C as k,H as wt,Kt as Tt,Lt as A,Pt as j,S as M,T as N,_t as Et,dt as P,en as F,et as Dt,ft as I,h as Ot,ht as kt,it as L,m as At,mt as jt,nn as R,pt as Mt,rn as Nt,rt as Pt,tt as Ft,vt as It,w as z,wt as Lt,x as B}from"./index-Dg_oXq0b.js";import{r as Rt}from"./locales-CPjguROj.js";import{a as zt,i as V,n as Bt,o as H,r as U,t as Vt}from"./table-DcJVBwwq.js";import{t as Ht}from"./FilterBar-DFzFJCUO.js";import{a as Ut,n as Wt,o as Gt,r as Kt,s as qt,t as Jt}from"./compatView-D_fn8HJP.js";import{t as W}from"./dispatchErrorInfo-2bqp8WGB.js";var Yt=f(`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`}]]),Xt=f(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),G=t(e(),1);function Zt(e){return e.filter(e=>e.state===`error`)}function Qt(e){return e.reachable&&Zt(e.targets).length===0}function $t(e){return Qt(e)?(e.unreachableInstances??[]).length>0?`gateways_unreachable`:`ok`:`error`}function en(e){return e.state===`error`&&e.lastErrorCode!==null}function tn(e){return!!e.lastDownstreamRejectCode}function K(e){return e.kind??`openclaw`}function nn(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function rn(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,K(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(K(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return nn(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>K(e)===r)}))}function q(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var J=`__all__`,an={q:``,state:J,instance:J,version:J},Y={connected:0,error:1,idle:2};function on(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function sn(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 cn(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function ln(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 Gt(e,r)??X(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return X(t.targetLabel,n.targetLabel)}}function un(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=cn(t.key,e),a=cn(t.key,r);return i&&a?0:i?1:a?-1:n*ln(t.key,e,r)})}function dn(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 fn(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 pn(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>Gt(e,t)??X(e,t))}var Z=n();function mn({connections:e,displayByInstance:t}){let[n,r]=(0,G.useState)(an),[i,a]=(0,G.useState)(null),o=(0,G.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount+(e.downstreamRejectCount??0),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,G.useMemo)(()=>dn(o),[o]),c=(0,G.useMemo)(()=>fn(o),[o]),l=(0,G.useMemo)(()=>pn(o),[o]),u=(0,G.useMemo)(()=>un(sn(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:Be()}):(0,Z.jsxs)(`div`,{className:`oc-conn`,children:[(0,Z.jsxs)(Ht,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:Le(),onReset:()=>r(an),canReset:on(n),children:[(0,Z.jsxs)(B,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Z.jsx)(z,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(N,{placeholder:nt()})}),(0,Z.jsxs)(M,{children:[(0,Z.jsx)(k,{value:J,children:w()}),s.map(e=>(0,Z.jsx)(k,{value:e,children:gn(e)},e))]})]}),(0,Z.jsxs)(B,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Z.jsx)(z,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(N,{placeholder:Ke()})}),(0,Z.jsxs)(M,{children:[(0,Z.jsx)(k,{value:J,children:w()}),c.map(e=>(0,Z.jsx)(k,{value:e.name,children:e.label},e.name))]})]}),(0,Z.jsxs)(B,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Z.jsx)(z,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(N,{placeholder:Fe()})}),(0,Z.jsxs)(M,{children:[(0,Z.jsx)(k,{value:J,children:w()}),l.map(e=>(0,Z.jsx)(k,{value:e,children:e},e))]})]})]}),u.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:et()}):(0,Z.jsxs)(Vt,{className:`oc-conn__table`,children:[(0,Z.jsx)(zt,{children:(0,Z.jsxs)(H,{children:[(0,Z.jsx)(Q,{label:Ye(),sortKey:`target`,sort:i,onSort:d}),(0,Z.jsx)(Q,{label:je(),sortKey:`state`,sort:i,onSort:d}),(0,Z.jsx)(Q,{label:Ve(),sortKey:`instance`,sort:i,onSort:d}),(0,Z.jsx)(Q,{label:$e(),sortKey:`host`,sort:i,onSort:d}),(0,Z.jsx)(Q,{label:Je(),sortKey:`version`,sort:i,onSort:d}),(0,Z.jsx)(V,{children:tt()}),(0,Z.jsx)(Q,{label:Ie(),sortKey:`lastOk`,sort:i,onSort:d})]})}),(0,Z.jsx)(Bt,{children:u.map(e=>(0,Z.jsx)(hn,{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)(V,{"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)(pt,{size:13,"aria-hidden":!0}):(0,Z.jsx)(T,{size:13,"aria-hidden":!0}):(0,Z.jsx)(mt,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function hn({r:e}){let t=en(e)?W(e.lastErrorCode):null,n=tn(e)?W(e.lastDownstreamRejectCode):null;return(0,Z.jsxs)(G.Fragment,{children:[(0,Z.jsxs)(H,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Z.jsx)(U,{children:(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Z.jsx)(U,{children:(0,Z.jsx)(_n,{state:e.state})}),(0,Z.jsx)(U,{children:e.instanceLabel?(0,Z.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(U,{children:(0,Z.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Z.jsx)(U,{children:e.gatewayVersion?(0,Z.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(U,{children:(0,Z.jsx)(`span`,{className:`oc-conn__stats`,children:qe({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Z.jsx)(U,{children:e.lastOkAt?(0,Z.jsx)(`span`,{className:`oc-traces__mono`,children:L(e.lastOkAt)}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Z.jsx)(H,{className:`oc-conn__detail-row`,children:(0,Z.jsxs)(U,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Z.jsx)(`strong`,{children:t.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${L(e.lastErrorAt)}`:``,(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[Xe({label:n.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${L(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function gn(e){return e===`connected`?i():e===`error`?me():C()}function _n({state:e}){return e===`connected`?(0,Z.jsx)(P,{variant:`secondary`,children:i()}):e===`error`?(0,Z.jsx)(P,{variant:`destructive`,children:me()}):(0,Z.jsx)(P,{variant:`outline`,children:C()})}function vn(){return r(g.bridgeHealth.getBridgeHealth,{})}function yn(){let e=vn(),t=r(g.compat.getBridgeCompat,{}),n=r(g.me.getMe,{host:Lt})?.role===`admin`,i=r(g.admin.listInstances,n?{}:`skip`),a=r(g.agents.usageForInstances,n?{}:`skip`),o=R(),s=()=>void o({to:`/settings/anomalies`,search:{status:`open`}}),c=rn(e?e.targets:[],t?t.targets:[],i??[]),{section:l}=Nt({from:`/settings/bridge`}),u=R({from:`/settings/bridge`}),f=t?.compat??null,p=t===void 0?`loading`:t===null?`nodata`:`ready`,m=f!==null&&Wt(f,`hermes`)&&!c.some(e=>e.key===`hermes`);return(0,Z.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Z.jsx)(bn,{health:e,compat:t,onSeeAnomalies:s}),(0,Z.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:fe()}),a&&a.length>0?(0,Z.jsxs)(`section`,{className:`oc-bridge__usage`,children:[(0,Z.jsx)(`h3`,{className:`oc-bridge__usage-title`,children:ue()}),(0,Z.jsxs)(Vt,{children:[(0,Z.jsx)(zt,{children:(0,Z.jsxs)(H,{children:[(0,Z.jsx)(V,{children:ot()}),(0,Z.jsx)(V,{children:d()}),(0,Z.jsx)(V,{children:ye()}),(0,Z.jsx)(V,{children:lt()}),(0,Z.jsx)(V,{children:Pe()})]})}),(0,Z.jsx)(Bt,{children:a.flatMap(e=>{let t=Ot(e.usage,Date.now());return t?t.windows.map((t,n)=>(0,Z.jsxs)(H,{children:[(0,Z.jsx)(U,{className:`font-medium`,children:n===0?e.instanceName:``}),(0,Z.jsx)(U,{children:t.provider}),(0,Z.jsx)(U,{children:t.label}),(0,Z.jsx)(U,{children:(0,Z.jsxs)(P,{variant:t.percentLeft<=10?`destructive`:t.percentLeft<=25?`outline`:`secondary`,children:[t.percentLeft,`%`]})}),(0,Z.jsx)(U,{className:`text-muted-foreground`,children:t.resetText??`—`})]},`${e.instanceName}:${t.provider}:${t.label}`)):[]})})]})]}):null,c.length>0?(0,Z.jsxs)(St,{value:c.some(e=>e.key===l)?l:c[0]?.key??`openclaw`,onValueChange:e=>void u({search:{section:e},replace:!0}),children:[(0,Z.jsx)(xt,{className:`w-full`,children:c.map(e=>(0,Z.jsxs)(yt,{value:e.key,className:`flex-1 gap-1.5`,children:[(0,Z.jsx)(A,{size:13,"aria-hidden":!0}),q(e.key)]},e.key))}),c.map(e=>(0,Z.jsx)(bt,{value:e.key,children:(0,Z.jsx)(xn,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:f,compatStatus:p,compatReachable:t?.reachable??!0,protocol:e.key===`openclaw`?t?.protocol??null:null})},e.key))]}):null,m?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:He()}):null]})}function bn({health:e,compat:t,onSeeAnomalies:n}){let r=t!=null&&t.buildVersion!=null&&t.bridgeVersion!=null&&t.buildVersion!==t.bridgeVersion,i=t?.buildRevision&&t.buildRevision!==`unknown`?t.buildRevision.slice(0,7):null,a=t&&t!==null?(0,Z.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:Ut(t.bridgeVersion)}),i?(0,Z.jsxs)(Z.Fragment,{children:[` `,(0,Z.jsxs)(`code`,{className:`oc-traces__mono`,title:y(),children:[`(`,i,`)`]})]}):null,r?(0,Z.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,Ee({build:t.buildVersion??`?`})]}):null,` · `,Se(),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?b():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:_()});if(e===null)return(0,Z.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:xe()});let o=Zt(e.targets),s=!e.reachable,c=$t(e),l=e.unreachableInstances??[],d=c===`ok`?`ok`:c===`gateways_unreachable`?`warn`:`error`,f=Pt(e.checkedAt),p=e.startedAt==null?null:Pt(e.startedAt);return(0,Z.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${d}`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:c===`ok`?(0,Z.jsx)(O,{size:22}):s||c===`gateways_unreachable`?(0,Z.jsx)(Xt,{size:22}):(0,Z.jsx)(j,{size:22})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__title`,children:c===`ok`?at():c===`gateways_unreachable`?Ne({count:l.length}):s?u():ve({count:o.length})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(Yt,{size:12,"aria-hidden":!0}),` `,ct({time:f})]}),p?(0,Z.jsx)(`span`,{children:rt({time:p})}):null,a]}),c===`gateways_unreachable`?(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:ut({names:l.join(`, `)})}):null,s?(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:W(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Z.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:Ae()})]})}function xn({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a,protocol:o}){let s=r?qt(r,e):null,c=new Map;for(let e of n)c.set(e.name,e.displayName??e.name);let l=[],u=new Set;for(let n of t){if(!n.instanceName||u.has(n.instanceName))continue;u.add(n.instanceName);let t=n.gatewayVersion??null;l.push({instanceName:n.instanceName,displayName:c.get(n.instanceName)??n.instanceName,version:t,state:Jt(t,e,r)})}let d=l.map(e=>e.state),f=d.includes(`beyond`)?`beyond`:d.length>0&&d.every(e=>e===`supported`)?`supported`:null,[p,m]=(0,G.useState)(!1);return(0,Z.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Z.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Z.jsx)(A,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Z.jsx)(`span`,{className:`oc-bridge-provider__name`,children:q(e)}),f?(0,Z.jsx)(P,{variant:f===`beyond`?`destructive`:`secondary`,children:Kt(f)}):null]}),(0,Z.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:Ze()}),(0,Z.jsx)(Cn,{providerName:q(e),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)(T,{size:13,"aria-hidden":!0}):(0,Z.jsx)(F,{size:13,"aria-hidden":!0}),ze({count:t.length})]}),p?(0,Z.jsx)(mn,{connections:t,displayByInstance:c}):null]})}function Sn({protocol:e}){let[t,n]=(0,G.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:[le(),i.length>0?(0,Z.jsx)(P,{variant:`destructive`,children:o({count:i.length})}):(0,Z.jsx)(P,{variant:`secondary`,children:Ue()})]}),(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ge({version:e.vendoredVersion}),r?` · `+de({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)(T,{size:13,"aria-hidden":!0}):(0,Z.jsx)(F,{size:13,"aria-hidden":!0}),m({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,providerName:a}){return t===`loading`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:_()}):t===`nodata`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:S()}):(0,Z.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:we()}),r===null?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(0,Z.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__label`,children:h({provider:a})}),e&&e.range!==null?(0,Z.jsx)(`span`,{children:dt({min:e.range.min,max:e.range.maxValidated})}):(0,Z.jsx)(`span`,{children:b()}),e?(0,Z.jsx)(En,{versions:e.validatedVersions}):null]}),i.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):(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:Ut(e.version)}),(0,Z.jsx)(P,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:Kt(e.state)})]},e.instanceName))})]})}function wn({instance:e,onClose:t}){return(0,Z.jsx)(Mt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(jt,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(Et,{children:[(0,Z.jsx)(It,{children:a({instance:e.displayName??e.name})}),(0,Z.jsx)(kt,{children:We()})]}),(0,Z.jsx)(Tn,{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)(O,{"aria-hidden":!0}):(0,Z.jsx)(j,{"aria-hidden":!0}),(0,Z.jsxs)(`span`,{children:[e,` — `,t.ok?ge():t.detail]})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,ce()]}):null}function Tn({instance:e,onClose:t}){let n=pe(g.admin.upsertInstanceConfig),r=Oe(g.bridge.validateMediaPaths),i=wt(),a=Rt(e.config?.contentLocale,void 0),[o,s]=(0,G.useState)(()=>ht(e.config??{},a)),[u,d]=(0,G.useState)(!1),[f,m]=(0,G.useState)(!1),[h,_]=(0,G.useState)(null),v=o.inboundMediaMode===`shared-fs`,y=o.mediaMode===`shared-fs`,b=v||y;async function x(){m(!0),_(null);try{_(await r({instanceName:e.name,inboundMediaMode:o.inboundMediaMode,mediaMode:o.mediaMode}))}catch(e){i.error(re(),e)}finally{m(!1)}}async function S(){d(!0);try{let r=e.config??{};await n({instanceId:e._id,config:_t(o,r,a)}),t()}catch(e){i.error(_e(),e)}finally{d(!1)}}return(0,Z.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Z.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:p(),help:st()}),(0,Z.jsxs)(B,{value:o.mediaMode,onValueChange:e=>s({...o,mediaMode:e}),children:[(0,Z.jsx)(z,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(N,{})}),(0,Z.jsx)(M,{children:vt.map(e=>(0,Z.jsx)(k,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:ee(),help:Me()}),(0,Z.jsxs)(B,{value:o.inboundMediaMode,onValueChange:e=>s({...o,inboundMediaMode:e}),children:[(0,Z.jsx)(z,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(N,{})}),(0,Z.jsx)(M,{children:gt.map(e=>(0,Z.jsx)(k,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:be(),help:ke()}),(0,Z.jsx)(I,{type:`number`,min:1,max:4096,className:`w-full`,value:o.mediaMaxMb,onChange:e=>s({...o,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),b&&(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[v&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:ae(),help:Qe()}),(0,Z.jsx)(I,{className:`w-full`,spellCheck:!1,value:o.inboundAgentMount,onChange:e=>s({...o,inboundAgentMount:e.target.value})})]}),y&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(E,{label:oe(),help:ne()}),(0,Z.jsx)(I,{className:`w-full`,spellCheck:!1,value:o.outboundAgentMount,onChange:e=>s({...o,outboundAgentMount:e.target.value})})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Z.jsx)(At,{checked:o.rehydration,onCheckedChange:e=>s({...o,rehydration:e===!0})}),(0,Z.jsx)(E,{label:it(),help:Re()})]}),b&&h!==null&&(0,Z.jsx)(`div`,{className:`oc-bridge-config__check`,children:h.reachable?!h.inbound&&!h.outbound?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(j,{"aria-hidden":!0}),te({reason:h.reason??`?`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:c(),result:h.inbound}),(0,Z.jsx)($,{label:ft(),result:h.outbound}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Te()})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(j,{"aria-hidden":!0}),ie()]})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[b&&(0,Z.jsxs)(D,{variant:`outline`,size:`sm`,onClick:()=>void x(),disabled:f,children:[f?(0,Z.jsx)(Tt,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,f?Ce():De()]}),(0,Z.jsx)(D,{size:`sm`,onClick:()=>void S(),disabled:u,children:l()})]})]})})}function En({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Z.jsxs)(Ct,{children:[(0,Z.jsx)(Ft,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?he():se({count:e.length}),(0,Z.jsx)(T,{size:13,"aria-hidden":!0})]})}),(0,Z.jsxs)(Dt,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Z.jsx)(`p`,{className:`oc-compat__versions-title`,children:x()}),(0,Z.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Z.jsx)(P,{variant:`secondary`,children:e},e))})]})]})}export{yn as BridgeTab,wn as InstanceConfigDialog};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$P as r,$c as i,Ca as a,Da as o,E as s,Ea as c,En as l,Jc as u,Ml as d,O_ as f,Oa as p,QP as m,Qc as h,Sa as g,Ta as _,WP as v,XP as y,Xc as b,Yc as x,Zc as S,ba as C,el as w,gu as T,lu as E,mu as D,nl as O,tl as k,uu as A,wa as j,xa as M,ya as N}from"./dist-DwNg72Ge.js";import{t as P}from"./button-DPiqYkrF.js";import{C as F,Pt as I,S as L,T as R,b as z,f as B,ft as V,m as H,p as U,w as W,x as G}from"./index-Dg_oXq0b.js";import{i as K}from"./compatView-D_fn8HJP.js";/* empty css */var q=t(e(),1),J=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`];function Y(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 X=n();function Z({instance:e}){let t=m(s.admin.upsertInstanceConfig),n=r(s.agents.listAgentsForInstance,{instanceName:e.name}),i=typeof e.config?.converterAgentId==`string`?e.config.converterAgentId:``,[o,c]=(0,q.useState)(i),[l,d]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{c(i),d(`idle`)},[e._id,i]);let f=`__none__`,p=o!==i;async function h(){d(`saving`);try{let n={...e.config??{}};o===``||o===f?delete n.converterAgentId:n.converterAgentId=o,await t({instanceId:e._id,config:n}),d(`done`)}catch{d(`error`)}}let g=n?.agents??[];return(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:_()}),(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:j()}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsxs)(G,{value:o===``?f:o,onValueChange:e=>c(e===f?``:e),children:[(0,X.jsx)(W,{className:`oc-cdefaults__select`,"aria-label":_(),children:(0,X.jsx)(R,{placeholder:a()})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{value:f,children:a()}),g.map(e=>(0,X.jsx)(F,{value:e.agentId,children:e.displayName?`${e.displayName} (${e.agentId})`:e.agentId},e.agentId))]})]}),(0,X.jsx)(P,{size:`sm`,disabled:!p||l===`saving`,onClick:()=>void h(),children:l===`saving`?T():b()})]}),l===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:x()}):null,l===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:u()}):null]})}function Q({instance:e}){let t=m(s.admin.upsertInstanceConfig),n=e.config?.curationEnabled===!0,r=typeof e.config?.curationBudgetChars==`number`?e.config.curationBudgetChars:null,[i,a]=(0,q.useState)(n),[o,l]=(0,q.useState)(r===null?``:String(r)),[d,f]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{a(n),l(r===null?``:String(r)),f(`idle`)},[e._id,n,r]);let p=o.trim(),h=p===``?null:/^\d+$/.test(p)?Number.parseInt(p,10):NaN,_=!i||h===null||Number.isInteger(h)&&h>=4e3&&h<=6e4,v=i!==n||(h??null)!==r;async function y(){f(`saving`);try{let n={...e.config??{}};n.curationEnabled=i,!i||h===null||Number.isNaN(h)?delete n.curationBudgetChars:n.curationBudgetChars=h,await t({instanceId:e._id,config:n}),f(`done`)}catch{f(`error`)}}return(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,X.jsx)(H,{checked:i,onCheckedChange:e=>a(e===!0),"aria-label":c()}),(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:c()})]}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsx)(V,{type:`number`,min:4e3,max:6e4,step:1e3,placeholder:`20000`,value:o,onChange:e=>l(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!_,"aria-label":g(),disabled:!i}),(0,X.jsx)(P,{size:`sm`,disabled:!v||!_||d===`saving`,onClick:()=>void y(),children:d===`saving`?T():b()})]}),_?null:(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:M()}),d===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:x()}):null,d===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:u()}):null,(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:C()})]})}function $({instance:e}){let t=m(s.admin.upsertInstanceConfig),n=typeof e.config?.summarizeThresholdChars==`number`?e.config.summarizeThresholdChars:null,[r,i]=(0,q.useState)(n===null?``:String(n)),[a,c]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{i(n===null?``:String(n)),c(`idle`)},[e._id,n]);let l=r.trim(),d=l===``?null:/^\d+$/.test(l)?Number.parseInt(l,10):NaN,f=d===null||Number.isInteger(d)&&d>=1e3&&d<=2e5,h=(d??null)!==n;async function g(){c(`saving`);try{let n={...e.config??{}};d===null?delete n.summarizeThresholdChars:n.summarizeThresholdChars=d,await t({instanceId:e._id,config:n}),c(`done`)}catch{c(`error`)}}return(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:p()}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsx)(V,{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,X.jsx)(P,{size:`sm`,disabled:!h||!f||a===`saving`,onClick:()=>void g(),children:a===`saving`?T():b()})]}),f?null:(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:N()}),a===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:x()}):null,a===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:u()}):null,(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:o()})]})}function ee(){let e=y(s.agentFiles.getChatDefaults),[t,n]=(0,q.useState)({status:`loading`}),a=r(s.admin.listInstances,{}),[o,c]=(0,q.useState)(null);(0,q.useEffect)(()=>{!a||a.length===0||(!o||!a.some(e=>e.name===o))&&c(a[0].name)},[a,o]);let u=(a?.length??0)>1,p=a!==void 0&&a.length===0,m=r(s.compat.forInstance,o?{instanceName:o}:`skip`),g=o?z(m,`configDefaults`):`loading`,_=g===`loading`?null:g.blocked,b=(0,q.useMemo)(()=>u&&o?{instanceName:o}:{},[u,o]),x=(0,q.useRef)(0),C=(0,q.useCallback)(async()=>{let t=++x.current;n({status:`loading`});try{let r=Y(await e(b));if(x.current!==t)return;n({status:`done`,current:r})}catch{if(x.current!==t)return;n({status:`error`})}},[e,b]);(0,q.useEffect)(()=>{_===!1&&(u&&!o||C())},[C,_,u,o]);let T=t.status===`done`?t.current:null,j=(0,q.useMemo)(()=>J.map(e=>({id:e,label:U(e)})),[]),M=(0,q.useMemo)(()=>[{id:`fast`,label:A()},{id:`standard`,label:E()}],[]);return(0,X.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:O()}),u&&o?(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:d()}),(0,X.jsxs)(G,{value:o,onValueChange:e=>c(e),children:[(0,X.jsx)(W,{size:`sm`,"aria-label":d(),children:(0,X.jsx)(R,{})}),(0,X.jsx)(L,{children:(a??[]).map(e=>(0,X.jsx)(F,{value:e.name,children:e.name},e.name))})]})]}):null,p?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:f()}):g===`loading`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):g.blocked?(0,X.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,X.jsx)(I,{size:14,"aria-hidden":!0}),` `,K(g.gatewayVersion,g.provider)]}):t.status===`loading`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):t.status===`error`?(0,X.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[S(),` `,(0,X.jsx)(P,{variant:`outline`,size:`sm`,onClick:()=>void C(),children:D()})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:k()}),(0,X.jsx)(B,{options:j,value:T?.thinkingDefault??null,onChange:()=>{},disabled:!0}),(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:w()})]}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:i()}),(0,X.jsx)(B,{options:M,value:T===null||T.fastModeDefault===null?null:T.fastModeDefault?`fast`:`standard`,onChange:()=>{},disabled:!0}),(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:h()})]}),(0,X.jsx)(`p`,{className:`oc-cdefaults__note`,children:l()})]}),(()=>{let e=a?.find(e=>e.name===(o??a[0]?.name));return e?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)($,{instance:e}),(0,X.jsx)(Q,{instance:e}),(0,X.jsx)(Z,{instance:e})]}):null})()]})}export{ee as ChatDefaultsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$C as r,$P as i,Aw as a,Bi as o,Bw as s,Cw as c,Dw as l,E as u,Ew as d,Fw as f,GC as p,Gw as m,Hw as h,Iw as g,JC as _,KC as v,Kw as y,Lw as b,Mw as ee,Nw as te,Ow as ne,Pw as re,QC as ie,QP as x,Ri as S,Rw as C,Sw as w,Tw as T,Uw as E,Vw as D,WC as O,Ww as k,XC as A,YC as j,ZC as M,_w as N,aw as P,bw as F,cw as I,dw as L,ew as R,fw as z,gw as B,hw as V,iw as H,jw as U,kw as W,lw as ae,mw as G,nw as K,ow as q,pw as J,qC as oe,rw as se,sw as ce,tw as le,uw as ue,vw as de,ww as fe,xw as pe,yw as me,zw as he}from"./dist-DwNg72Ge.js";import{t as ge}from"./button-DPiqYkrF.js";import{U as _e,rt as Y}from"./index-Dg_oXq0b.js";import{t as ve}from"./DataTableShell-CZObMHUc.js";var X=t(e(),1),Z=n(),ye={altered_words:()=>y(),incorrect:()=>m(),incoherence:()=>k(),formatting:()=>E(),latency:()=>h(),api_error:()=>D(),other:()=>s()},Q=e=>ye[e]?.()??e;function $({matches:e,sourceWasOpen:t}){return t?e===!0?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:C()}):e===!1?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:b()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:he()})}function be({data:e,reference:t,closeReason:n}){let r=e.snapshot,i=x(u.feedback.respondToFeedback),[s,p]=(0,X.useState)(e.thread),[m,h]=(0,X.useState)(``),[_,v]=(0,X.useState)(!1);async function y(){let t=m.trim();if(!(!t||_)){v(!0);try{await i({feedbackId:e._id,text:t}),p(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),h(``)}finally{v(!1)}}}let b=[];try{b=r.contextJson?JSON.parse(r.contextJson):[]}catch{b=[]}return(0,Z.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Z.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,Z.jsx)($,{matches:r.displayedMatchesStored,sourceWasOpen:r.clientInfo?.sourceWasOpen??!1}),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Q(e.category),` · `,r.messageRole,r.isRegeneration?` · ${g()}`:``,r.openclawModel?` · ${r.openclawModel}`:``,r.openclawRuntime?` (${r.openclawRuntime})`:``]}),t?(0,Z.jsx)(`code`,{className:`oc-fbadmin__ref`,style:{userSelect:`all`,marginLeft:`auto`},title:ue(),children:t}):null]}),e.comment?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:f()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,n?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:A()}),(0,Z.jsx)(`p`,{className:`oc-fbadmin__comment`,children:n})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:re()}),s.length>0?(0,Z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:s.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Z.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?te():e.authorRole===`agent`?e.authorLabel??o():ee()}),(0,Z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:U()}),(0,Z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:a(),value:m,maxLength:2e3,rows:3,onChange:e=>h(e.target.value.slice(0,2e3))}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Z.jsx)(ge,{size:`sm`,onClick:()=>void y(),disabled:!m.trim()||_,children:_?W():ne()})})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:l()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:r.messageText||d()})]}),r.clientInfo?.sourceWasOpen&&r.displayedText!==void 0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:T()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:r.displayedText||d()})]}):null,r.promptText?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:fe()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:r.promptText})]}):null,b.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:c({count:r.contextCount??b.length,truncated:r.contextTruncated?w():``})}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:b.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-role`,children:e.role}),(0,Z.jsx)(`span`,{className:`oc-fbadmin__ctx-text`,children:e.text})]},t))})]}):null,r.outboxAvailable?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:pe()}),(0,Z.jsxs)(`pre`,{className:`oc-msg__source-pre`,children:[r.outboxText??``,r.outboxStatus?`\n[status: ${r.outboxStatus}]`:``]})]}):null,r.clientInfo?.extensionsDetected&&r.clientInfo.extensionsDetected.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:F()}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,children:r.clientInfo.extensionsDetected.map(e=>(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:e},e))})]}):null,(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:me()}),(0,Z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[r.clientInfo?.language,r.clientInfo?.timezone,r.clientInfo?.theme?de({theme:r.clientInfo.theme}):null,r.runId?`run ${r.runId.slice(0,12)}…`:null].filter(Boolean).join(` · `)||`—`,r.clientInfo?.plugins&&r.clientInfo.plugins.length>0?(0,Z.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[N(),` `,r.clientInfo.plugins.join(`, `),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,B()]})]}):null,r.clientInfo?.userAgent?(0,Z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:r.clientInfo.userAgent}):null]})]})]})}function xe(){let e=i(u.feedback.listForAdmin,{}),t=x(u.feedback.readSnapshot),n=x(u.feedback.deleteFeedback),a=_e(),[o,s]=(0,X.useState)(null),[c,l]=(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});l(t=>({...t,[e._id]:n}))}s(e._id)}async function f(e){await a({title:v(),description:p(),confirmLabel:O(),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:[V(),` `,(0,Z.jsx)(`strong`,{children:G()}),` `,J()]}),(0,Z.jsx)(ve,{title:z(),rows:e,emptyHint:L(),isExpanded:e=>o===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Z.jsx)(be,{data:c[e._id],reference:e.reference,closeReason:e.userCloseReason}):null,columns:[{header:ae(),cell:e=>Y(e.at),sort:e=>e.at},{header:I(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:ce(),cell:e=>e.messageRole===`user`?q():P(),sort:e=>e.messageRole},{header:H(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${se({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:K(),cell:e=>(0,Z.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:le(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:R(),cell:e=>e.userClosedAt==null?e.resolvedAt==null?e.answered?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:r()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:ie()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,title:e.resolvedBy??void 0,children:S()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:M()}),sort:e=>e.userClosedAt==null?e.resolvedAt==null?+!!e.answered:2:3}],rowActions:e=>[{label:o===e._id?j():_(),onSelect:()=>void d(e)},{label:oe(),onSelect:()=>void f(e),variant:`destructive`}]})]})}export{xe as FeedbacksTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$N as ee,$P as te,BN as ne,E as r,GD as re,GN as ie,HN as ae,IN as oe,JN as se,KN as i,KP as a,LN as o,QN as s,QP as c,RN as ce,UN as le,Ui as ue,VN as de,WN as l,WP as fe,Wi as u,XN as pe,YN as me,ZN as he,_P as ge,aP as d,cP as _e,dP as ve,eP as f,fP as ye,gP as be,hP as xe,iP as p,lP as Se,mP as m,nP as h,oP as g,pP as _,qN as v,rP as y,sP as b,tP as x,uP as S,zN as C}from"./dist-DwNg72Ge.js";import{t as w}from"./button-DPiqYkrF.js";import{C as T,Ft as E,G as D,H as O,J as k,K as A,Q as j,S as M,T as N,X as Ce,Xt as P,Y as we,Yt as Te,Z as Ee,at as De,dt as F,m as Oe,ot as ke,q as Ae,st as I,ut as je,w as L,x as R,zt as Me}from"./index-Dg_oXq0b.js";import{a as Ne,i as z,n as Pe,o as B,r as V,t as Fe}from"./table-DcJVBwwq.js";var H=t(e(),1),U=n(),W=`all`;function G(e){switch(e){case`image`:return g();case`audio`:return d();case`video`:return p();case`pdf`:return y();case`document`:return h();case`archive`:return x();default:return f()}}function K(){let[e,t]=(0,H.useState)(W),[n,d]=(0,H.useState)(W),[f,p]=(0,H.useState)(W),[h,g]=(0,H.useState)(W),[y,x]=(0,H.useState)(!1),[K,q]=(0,H.useState)(null),J=c(r.files.softDelete),Y=O();function Ie(){t(W),d(W),p(W),g(W)}async function Le(){let e=K;if(q(null),e)try{await J({fileId:e.id}),Y.success(le())}catch(e){Y.error(ae(),e)}}let X=te(r.files.listMine,{direction:e===W?void 0:e,chatId:n===W?void 0:n,instanceName:f===W?void 0:f,category:h===W?void 0:h,includeAutoGenerated:y||void 0}),Re=(0,H.useMemo)(()=>new Intl.DateTimeFormat(a(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:fe()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==W||n!==W||f!==W||h!==W;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:ge()}),(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)(L,{size:`sm`,"aria-label":be(),children:(0,U.jsx)(N,{})}),(0,U.jsxs)(M,{children:[(0,U.jsx)(T,{value:W,children:xe()}),(0,U.jsx)(T,{value:`inbound`,children:m()}),(0,U.jsx)(T,{value:`outbound`,children:_()})]})]}),(0,U.jsxs)(R,{value:n,onValueChange:d,children:[(0,U.jsx)(L,{size:`sm`,"aria-label":ye(),children:(0,U.jsx)(N,{})}),(0,U.jsxs)(M,{children:[(0,U.jsx)(T,{value:W,children:ve()}),Q.chats.map(e=>(0,U.jsx)(T,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,U.jsxs)(R,{value:f,onValueChange:p,children:[(0,U.jsx)(L,{size:`sm`,"aria-label":S(),children:(0,U.jsx)(N,{})}),(0,U.jsxs)(M,{children:[(0,U.jsx)(T,{value:W,children:Se()}),Q.instances.map(e=>(0,U.jsx)(T,{value:e,children:e},e))]})]}):null,(0,U.jsxs)(R,{value:h,onValueChange:g,children:[(0,U.jsx)(L,{size:`sm`,"aria-label":_e(),children:(0,U.jsx)(N,{})}),(0,U.jsxs)(M,{children:[(0,U.jsx)(T,{value:W,children:b()}),Q.categories.map(e=>(0,U.jsx)(T,{value:e,children:G(e)},e))]})]}),(0,U.jsxs)(`label`,{className:`oc-files__autogen`,children:[(0,U.jsx)(Oe,{checked:y,onCheckedChange:e=>x(e===!0),"aria-label":u()}),(0,U.jsx)(`span`,{children:u()})]}),$?(0,U.jsxs)(w,{variant:`ghost`,size:`sm`,onClick:Ie,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,U.jsx)(Me,{size:14,"aria-hidden":!0}),i()]}):null]}),Z.length===0?(0,U.jsx)(`p`,{className:`oc-admin__hint`,children:$?o():ce()}):(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:ee()}),(0,U.jsx)(z,{children:s()}),(0,U.jsx)(z,{children:he()}),(0,U.jsx)(z,{children:pe()}),(0,U.jsx)(z,{children:me()}),(0,U.jsx)(z,{className:`text-right`,children:se()})]})}),(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)(F,{variant:`outline`,style:{marginLeft:6},children:ue()}):null]}),(0,U.jsx)(V,{title:e.mimeType,children:G(e.category)}),(0,U.jsx)(V,{children:(0,U.jsx)(F,{variant:`secondary`,children:e.direction===`inbound`?m():_()})}),(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)(De,{children:[(0,U.jsx)(je,{asChild:!0,children:(0,U.jsx)(w,{variant:`ghost`,size:`icon`,"aria-label":ie(),children:(0,U.jsx)(Te,{size:16})})}),(0,U.jsxs)(ke,{align:`end`,children:[e.url?(0,U.jsx)(I,{asChild:!0,children:(0,U.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,U.jsx)(P,{size:14}),v()]})}):(0,U.jsxs)(I,{disabled:!0,children:[(0,U.jsx)(P,{size:14}),C()]}),(0,U.jsxs)(I,{variant:`destructive`,onSelect:()=>q({id:e._id,filename:e.filename}),children:[(0,U.jsx)(E,{size:14}),l()]})]})]})})]},e._id))})]}),ze?(0,U.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:oe({cap:Be})}):null]}),(0,U.jsx)(D,{open:K!==null,onOpenChange:e=>!e&&q(null),children:(0,U.jsxs)(k,{children:[(0,U.jsxs)(Ee,{children:[(0,U.jsx)(j,{children:de()}),(0,U.jsx)(we,{children:ne()})]}),(0,U.jsxs)(Ce,{children:[(0,U.jsx)(Ae,{children:re()}),(0,U.jsx)(A,{onClick:()=>void Le(),children:l()})]})]})})]})}export{K as FilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$P as r,$S as i,$x as a,AS as o,An as s,Ax as c,BS as l,Bx as u,CS as d,DS as f,Dx as p,E as m,ES as h,FS as g,Fx as _,GS as v,Ga as y,Gx as b,HS as x,Hx as S,IS as C,Ix as w,JS as ee,Jx as T,KS as te,Ka as E,Kx as ne,LO as re,LS as ie,Lx as ae,MS as oe,Mx as se,NS as D,Nx as ce,OS as le,Ox as O,PS as ue,Px as de,QP as k,QS as fe,Qx as pe,RO as A,RS as me,Rx as he,SS as j,TS as ge,US as _e,Ua as ve,Ux as ye,VS as be,Vx as xe,WS as Se,Wa as Ce,Wx as we,XP as M,XS as Te,YS as Ee,Yx as De,ZS as Oe,Zx as N,_S as ke,aC as Ae,aS as je,bS as Me,cC as Ne,cS as Pe,dC as Fe,dS as Ie,eC as Le,eS as Re,fC as ze,fS as Be,gC as Ve,gS as He,hC as Ue,hS as We,iC as Ge,iS as Ke,jS as qe,jn as Je,jx as Ye,kS as Xe,kn as Ze,kx as Qe,lC as $e,lS as et,mC as tt,mS as nt,nC as rt,nS as it,oC as at,oS as ot,pC as st,pS as ct,qS as lt,qx as ut,rC as dt,rS as ft,sC as pt,sS as mt,tC as ht,tS as gt,uC as _t,uS as vt,vS as yt,v_ as bt,wS as xt,xS as St,yS as Ct,y_ as wt,zS as Tt,zx as Et}from"./dist-DwNg72Ge.js";import{a as Dt,c as Ot}from"./FieldLabel-DBoEEhN6.js";import{t as P}from"./button-DPiqYkrF.js";import{$ as kt,C as F,H as I,S as L,T as R,U as At,_t as z,d as jt,dt as B,et as Mt,ft as V,ht as H,m as U,mt as W,pt as G,tt as Nt,vt as K,w as q,x as J}from"./index-Dg_oXq0b.js";import{t as Pt}from"./DataTableShell-CZObMHUc.js";import{InstanceConfigDialog as Ft}from"./BridgeTab-DWnqQN9W.js";var Y=t(e(),1),X=[`conversational`,`documentary`,`summarizer`,`curator`],It=new Set(X),Lt=`conversational`;function Rt(e){let t=new Set((e??[]).filter(e=>It.has(e)));return t.size===0?[Lt]:X.filter(e=>t.has(e))}var Z=n(),Q={name:``,gatewayUrl:``,bridgeUrl:``,displayName:``,kind:`openclaw`,transport:`ws`,gatewayVersion:``,gatewayHttpUrl:``,streamTransport:Dt},zt={openclaw:[`token`,`deviceIdentity`],hermes:[`apiKey`]};function Bt(e){return{name:e.name,gatewayUrl:e.gatewayUrl,bridgeUrl:e.bridgeUrl??``,displayName:e.displayName??``,kind:e.kind??`openclaw`,transport:e.transport??`ws`,gatewayVersion:e.gatewayVersion??``,gatewayHttpUrl:e.gatewayHttpUrl??``,streamTransport:e.streamTransport??`reactive`}}function Vt(){let e=r(m.admin.listInstances,{}),t=r(m.agents.listAllInstanceAgents,{}),n=k(m.admin.upsertInstance),a=k(m.admin.deleteInstance),o=I(),[c,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(Q),[p,h]=(0,Y.useState)(null),[g,_]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(null),[S,C]=(0,Y.useState)(null);async function w(){try{await n({instanceId:S??void 0,name:d.name,gatewayUrl:d.gatewayUrl,bridgeUrl:d.bridgeUrl||void 0,displayName:d.displayName||void 0,kind:d.kind,transport:d.kind===`hermes`?d.transport:void 0,gatewayVersion:d.gatewayVersion||void 0,gatewayHttpUrl:d.gatewayHttpUrl||void 0,streamTransport:d.streamTransport}),f(Q),C(null),u(!1)}catch(e){o.error(tt(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[st(),(0,Z.jsx)(`strong`,{children:ze()}),Fe()]}),(0,Z.jsx)(Pt,{title:_t(),rows:e,addLabel:$e(),onAdd:()=>{C(null),f(Q),u(!0)},emptyHint:Ne(),columns:[{header:pt(),cell:e=>e.name,sort:e=>e.name},{header:at(),cell:e=>(0,Z.jsx)(B,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:Ae(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:Ge(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:Ve(),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)(B,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?O():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:Le(),onSelect:()=>{C(e._id),f(Bt(e)),u(!0)}},{label:Ue(),onSelect:()=>h(e.name)},{label:Tt(),onSelect:()=>b(e)},{label:dt(),onSelect:()=>_(e)},{label:rt(),variant:`destructive`,onSelect:()=>void a({instanceId:e._id})}],bulkActions:[{label:rt(),variant:`destructive`,onSelect:e=>e.forEach(e=>void a({instanceId:e}))}]}),(0,Z.jsx)(jt,{open:c,onOpenChange:u,title:S?i():ht(),description:Oe(),canSubmit:!!(d.name&&d.gatewayUrl),onSubmit:w,submitLabel:Te(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:Ee(),children:[(0,Z.jsx)(V,{value:d.name,disabled:S!==null,onChange:e=>f({...d,name:e.target.value})}),S?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:fe()}):null]}),(0,Z.jsx)($,{label:ee(),children:(0,Z.jsxs)(J,{value:d.kind,onValueChange:e=>f({...d,kind:e}),children:[(0,Z.jsx)(q,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(R,{})}),(0,Z.jsxs)(L,{children:[(0,Z.jsx)(F,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(F,{value:`hermes`,children:`Hermes`})]})]})}),d.kind===`hermes`?(0,Z.jsx)($,{label:Je(),children:(0,Z.jsxs)(J,{value:d.transport,onValueChange:e=>f({...d,transport:e}),children:[(0,Z.jsx)(q,{size:`sm`,className:`w-56`,children:(0,Z.jsx)(R,{})}),(0,Z.jsxs)(L,{children:[(0,Z.jsx)(F,{value:`ws`,children:s()}),(0,Z.jsx)(F,{value:`rest`,children:Ze()})]})]})}):null,(0,Z.jsx)($,{label:lt(),children:(0,Z.jsx)(V,{value:d.gatewayUrl,onChange:e=>f({...d,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:te(),children:(0,Z.jsx)(V,{value:d.bridgeUrl,placeholder:v(),onChange:e=>f({...d,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:Se(),children:(0,Z.jsx)(V,{value:d.displayName,onChange:e=>f({...d,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:wt(),children:[(0,Z.jsxs)(J,{value:d.streamTransport,onValueChange:e=>f({...d,streamTransport:e}),children:[(0,Z.jsx)(q,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(R,{})}),(0,Z.jsx)(L,{children:Ot.map(e=>(0,Z.jsx)(F,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:bt()})]}),(0,Z.jsx)($,{label:_e(),children:(0,Z.jsx)(V,{value:d.gatewayVersion,placeholder:x(),onChange:e=>f({...d,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:be(),children:(0,Z.jsx)(V,{value:d.gatewayHttpUrl,placeholder:l(),onChange:e=>f({...d,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Zt,{instanceName:p,open:p!==null,onOpenChange:e=>{e||h(null)}}),g?(0,Z.jsx)(Ft,{instance:g,onClose:()=>_(null)},g._id):null,y?(0,Z.jsx)(Ht,{instance:y,onClose:()=>b(null)},y._id):null]})}function Ht({instance:e,onClose:t}){let n=r(m.instanceSecrets.listInstanceSecretStatus,{}),i=zt[e.kind??`openclaw`],a=(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)(G,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(W,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(z,{children:[(0,Z.jsx)(K,{children:me({instance:e.displayName??e.name})}),(0,Z.jsx)(H,{children:ie()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:i.map(t=>(0,Z.jsx)(Gt,{instanceId:e._id,field:t,updatedAt:a[t]??null},t))}),(0,Z.jsx)(`div`,{className:`oc-bridgesecret`,children:(0,Z.jsx)(Wt,{instance:e})}),(0,Z.jsx)(Ut,{instance:e})]})})}function Ut({instance:e}){let t=M(m.instanceSync.forceInstanceSync),n=I(),[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(ke());break;case`no_agents`:n.success(We());break;case`no_bridge_url`:n.error(nt());break;case`deploy_misconfigured`:n.error(ct());break;case`unauthorized`:n.error(Ie());break;case`not_served`:n.error(vt());break;default:n.error(Be());break}}catch(e){n.error(He(),e)}finally{i(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:et()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(P,{size:`sm`,variant:`outline`,onClick:()=>void a(),disabled:r,children:r?yt():Ct()})})]})}function Wt({instance:e}){let t=r(m.bridgeAuth.listBridgeAuthStatus,{}),n=M(m.bridgeAuth.mintBridgeSecret),i=k(m.bridgeAuth.revokeBridgeSecret),a=I(),[o,s]=(0,Y.useState)(!1),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(!1),f=(t??[]).find(t=>t.instanceId===e._id),p=f!==void 0;async function h(){if(!o){s(!0);try{l((await n({instanceId:e._id})).plaintext),d(!1)}catch(e){a.error(it(),e)}finally{s(!1)}}}async function g(){if(!o){s(!0);try{await i({instanceId:e._id}),l(null),a.success(ft())}catch(e){a.error(it(),e)}finally{s(!1)}}}async function _(){if(c)try{await navigator.clipboard.writeText(c),d(!0)}catch{}}return(0,Z.jsxs)($,{label:Pe(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:mt()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(B,{variant:p?`outline`:`secondary`,children:p?`${D()} · ${f.prefix}…${f.lastFour}`:oe()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(P,{size:`sm`,onClick:()=>void h(),disabled:o,children:p?je():ot()}),p?(0,Z.jsx)(P,{size:`sm`,variant:`destructive`,onClick:()=>void g(),disabled:o,children:Ke()}):null]})]}),c?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:gt()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:c}),(0,Z.jsx)(P,{variant:`outline`,size:`sm`,onClick:()=>void _(),children:u?A():re()})]}),(0,Z.jsx)(P,{size:`sm`,variant:`ghost`,onClick:()=>{l(null),d(!1)},children:Re()})]}):null]})}function Gt({instanceId:e,field:t,updatedAt:n}){let r=M(m.instanceSecrets.setInstanceSecret),i=k(m.instanceSecrets.clearInstanceSecret),a=M(m.deviceIdentity.generateDeviceIdentity),s=I(),[c,l]=(0,Y.useState)(``),[u,p]=(0,Y.useState)(!1),[_,v]=(0,Y.useState)(null),[y,b]=(0,Y.useState)(!1),x=n!==null,S=t===`deviceIdentity`,w=t===`token`?C():t===`deviceIdentity`?g():ue();async function ee(){if(!(!c.trim()||u)){p(!0);try{await r({instanceId:e,field:t,plaintext:c}),l(``),v(null),b(!1),s.success(f())}catch(e){s.error(h(),e)}finally{p(!1)}}}async function T(){if(!u){p(!0);try{await i({instanceId:e,field:t}),v(null),b(!1),s.success(ge())}catch(e){s.error(h(),e)}finally{p(!1)}}}async function te(){if(!u){p(!0);try{v(await a({instanceId:e})),b(!1),s.success(j())}catch(e){s.error(Me(),e)}finally{p(!1)}}}let E=_?`openclaw devices approve ${_.id}`:``;async function ne(){if(E)try{await navigator.clipboard.writeText(E),b(!0)}catch{}}return(0,Z.jsxs)($,{label:w,children:[S?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(B,{variant:x?`outline`:`secondary`,children:x?D():oe()}),(0,Z.jsx)(V,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:c,placeholder:x?o():qe(),onChange:e=>l(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(P,{size:`sm`,onClick:()=>void ee(),disabled:u||c.trim().length===0,children:Xe()}),S?(0,Z.jsx)(P,{size:`sm`,variant:`outline`,onClick:()=>void te(),disabled:u,children:xt()}):null,x?(0,Z.jsx)(P,{size:`sm`,variant:`destructive`,onClick:()=>void T(),disabled:u,children:le()}):null]})]}),_?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:j()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:St()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:E}),(0,Z.jsx)(P,{variant:`outline`,size:`sm`,onClick:()=>void ne(),children:y?A():re()})]}),(0,Z.jsx)(P,{size:`sm`,variant:`ghost`,onClick:()=>{v(null),b(!1)},children:Re()})]}):null]})}var Kt={conversational:ye,documentary:xe,summarizer:E,curator:Ce},qt={conversational:S,documentary:u,summarizer:y,curator:ve},Jt=e=>(Kt[e]??(()=>e))(),Yt=e=>(qt[e]??(()=>``))();function Xt({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:ut()}),t.map(e=>(0,Z.jsx)(B,{variant:`secondary`,className:`oc-agenttype__chip`,title:Yt(e),children:Jt(e)},e)),(0,Z.jsxs)(kt,{children:[(0,Z.jsx)(Nt,{asChild:!0,children:(0,Z.jsx)(P,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:ne()})}),(0,Z.jsxs)(Mt,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:b()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:we()}),(0,Z.jsx)(`div`,{className:`oc-agenttypes-pop__list`,children:X.map(r=>{let i=`agtype-${e}-${r}`;return(0,Z.jsxs)(`div`,{className:`oc-agenttypes-pop__item`,children:[(0,Z.jsx)(U,{id:i,checked:t.includes(r),onCheckedChange:()=>n(r)}),(0,Z.jsxs)(`label`,{htmlFor:i,className:`oc-agenttypes-pop__text`,children:[(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__name`,children:Jt(r)}),(0,Z.jsx)(`span`,{className:`oc-agenttypes-pop__desc`,children:Yt(r)})]})]},r)})})]})]})]})}function Zt({instanceName:e,open:t,onOpenChange:n}){let i=r(m.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),o=k(m.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(m.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(m.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),s=k(m.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(m.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(m.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),l=k(m.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(m.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=Rt(r);e.setQuery(m.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),u=k(m.agents.setAgentDescription).withOptimisticUpdate((e,{instanceName:t,agentId:n,description:r})=>{let i=e.getQuery(m.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=r.trim();e.setQuery(m.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,description:a.length===0?null:a}:e)})}),d=k(m.agents.removeInstanceAgent),f=At(),h=I();async function g(t,n){if(e)try{await o({instanceName:e,agentId:t,enabled:n})}catch(e){h.error(N(),e)}}async function v(t){if(e)try{await s({instanceName:e,agentId:t})}catch(e){h.error(N(),e)}}async function y(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await l({instanceName:e,agentId:t,types:i})}catch(e){h.error(N(),e)}}async function b(t,n){if(e&&await f({title:ae({name:n}),description:w(),confirmLabel:_(),destructive:!0}))try{await d({instanceName:e,agentId:t}),h.success(de())}catch(e){h.error(N(),e)}}return(0,Z.jsx)(G,{open:t,onOpenChange:n,children:(0,Z.jsxs)(W,{className:`oc-access`,children:[(0,Z.jsxs)(z,{children:[(0,Z.jsx)(K,{children:a({name:e??``})}),(0,Z.jsx)(H,{children:pe()})]}),i===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:ce()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:i.discovery===null?se():i.discovery.lastPollOk?Ye():c({error:i.discovery.error??`?`})}),i.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:Qe()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:i.agents.map(t=>{let n=t.presentInLastOk===!1,r=i.defaultAgentId===t.agentId,a=t.displayName??t.agentId,o=t.types??[];return(0,Z.jsxs)(`div`,{className:`oc-agentcard`+(t.enabled?``:` oc-agentcard--off`),children:[(0,Z.jsxs)(`div`,{className:`oc-agentcard__head`,children:[(0,Z.jsx)(U,{checked:t.enabled,disabled:n,"aria-label":a,onCheckedChange:e=>void g(t.agentId,e===!0)}),(0,Z.jsxs)(`span`,{className:`oc-agentcard__name`,title:a,children:[t.emoji?`${t.emoji} `:``,a]}),t.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:t.model}):null,n?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(B,{variant:`outline`,className:`oc-access__gone`,children:p()}),(0,Z.jsx)(P,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void b(t.agentId,a),children:he()})]}):r?(0,Z.jsx)(B,{variant:`default`,children:O()}):(0,Z.jsx)(P,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!t.enabled,onClick:()=>void v(t.agentId),children:Et()})]}),t.enabled?(0,Z.jsx)(Xt,{agentId:t.agentId,types:o,onToggle:e=>void y(t.agentId,e,o)}):null,t.enabled?(0,Z.jsx)(Qt,{value:t.description??``,onSave:async n=>{if(e)try{await u({instanceName:e,agentId:t.agentId,description:n})}catch(e){h.error(N(),e)}}}):null]},t.agentId)})})]})]})})}function Qt({value:e,onSave:t}){let[n,r]=(0,Y.useState)(e);(0,Y.useEffect)(()=>{r(e)},[e]);let i=()=>{n.trim()!==e.trim()&&t(n)};return(0,Z.jsx)(V,{className:`oc-agentcard__desc`,value:n,maxLength:280,placeholder:De(),"aria-label":T(),onChange:e=>r(e.target.value),onBlur:i,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),i())}})}function $({label:e,children:t}){return(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(`span`,{className:`oc-field__label`,children:e}),t]})}export{Vt as InstancesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$P as r,$w as i,E as a,Jw as o,QP as s,Qw as c,XP as l,Xw as u,Yw as d,Zw as f,aT as p,as as m,cs as h,ds as g,eT as _,fs as v,iT as y,ls as b,nT as x,oT as S,os as C,ps as w,qw as T,rT as E,ss as D,tT as O,us as k}from"./dist-DwNg72Ge.js";import{t as A}from"./button-DPiqYkrF.js";import{dt as j,ft as M,m as N}from"./index-Dg_oXq0b.js";var P=t(e(),1),F=n();function I(){let e=r(a.integrations.status.status,{}),t=s(a.admin.setIntegrationConfig),[n,l]=(0,P.useState)(null);if((0,P.useEffect)(()=>{e&&n===null&&l(e.config)},[e,n]),!e||!n)return(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:S()});let m=n,h=(e,t,n)=>l({...m,[e]:{...m[e],[t]:n}}),b=(e,n)=>void t({[e]:n});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[p(),` `,(0,F.jsx)(`strong`,{children:y()}),` `,E()]}),(0,F.jsxs)(L,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,F.jsx)(j,{variant:`secondary`,children:x()}):(0,F.jsx)(j,{variant:`outline`,children:O()}):(0,F.jsx)(j,{variant:`outline`,children:_()}),note:i(),children:[(0,F.jsx)(R,{label:f(),children:(0,F.jsx)(M,{value:m.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>h(`langfuse`,`host`,e.target.value),onBlur:()=>b(`langfuse`,{host:m.langfuse.host??``})})}),(0,F.jsx)(z,{label:T(),checked:m.langfuse.enabled??!0,onChange:e=>{h(`langfuse`,`enabled`,e),b(`langfuse`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,F.jsx)(j,{variant:`secondary`,children:x()}):(0,F.jsx)(j,{variant:`outline`,children:O()}):(0,F.jsx)(j,{variant:`outline`,children:_()}),note:c(),children:[(0,F.jsx)(R,{label:u(),children:(0,F.jsx)(M,{value:m.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>h(`opik`,`baseUrl`,e.target.value),onBlur:()=>b(`opik`,{baseUrl:m.opik.baseUrl??``})})}),(0,F.jsx)(R,{label:d(),children:(0,F.jsx)(M,{value:m.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||o(),onChange:e=>h(`opik`,`workspace`,e.target.value),onBlur:()=>b(`opik`,{workspace:m.opik.workspace??``})})}),(0,F.jsx)(z,{label:T(),checked:m.opik.enabled??!0,onChange:e=>{h(`opik`,`enabled`,e),b(`opik`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,F.jsx)(j,{variant:`secondary`,children:x()}):(0,F.jsx)(j,{variant:`outline`,children:O()}):(0,F.jsx)(j,{variant:`outline`,children:w()}),note:v(),children:[(0,F.jsx)(R,{label:g(),children:(0,F.jsx)(M,{value:m.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>h(`otlp`,`endpoint`,e.target.value),onBlur:()=>b(`otlp`,{endpoint:m.otlp.endpoint??``})})}),(0,F.jsx)(B,{headersSet:e.otlp.headersSet}),(0,F.jsx)(z,{label:T(),checked:m.otlp.enabled??!0,onChange:e=>{h(`otlp`,`enabled`,e),b(`otlp`,{enabled:e})}})]})]})}function L({title:e,status:t,note:n,children:r}){return(0,F.jsxs)(`section`,{className:`oc-int__section`,children:[(0,F.jsxs)(`div`,{className:`oc-int__section-head`,children:[(0,F.jsx)(`h3`,{className:`oc-uipa__h`,children:e}),t]}),n?(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:n}):null,(0,F.jsx)(`div`,{className:`oc-int__fields`,children:r})]})}function R({label:e,children:t}){return(0,F.jsxs)(`label`,{className:`oc-int__field`,children:[(0,F.jsx)(`span`,{className:`oc-int__field-label`,children:e}),t]})}function z({label:e,checked:t,onChange:n}){return(0,F.jsxs)(`label`,{className:`oc-int__toggle`,children:[(0,F.jsx)(N,{checked:t,onCheckedChange:e=>n(e===!0)}),(0,F.jsx)(`span`,{children:e})]})}function B({headersSet:e}){let t=l(a.integrations.otlpSecret.setOtlpHeaders),n=s(a.integrations.otlpSecret.clearOtlpHeaders),[r,i]=(0,P.useState)(``),[o,c]=(0,P.useState)(null),[u,d]=(0,P.useState)(!1),f=async()=>{d(!0),c(null);try{await t({headersJson:r}),i(``)}catch(e){c(e instanceof Error?e.message:String(e))}finally{d(!1)}};return(0,F.jsxs)(R,{label:k(),children:[(0,F.jsx)(M,{value:r,placeholder:e?b():h(),onChange:e=>i(e.target.value)}),(0,F.jsxs)(`div`,{className:`oc-int__otlp-headers-actions`,children:[(0,F.jsx)(A,{size:`sm`,disabled:u||r.trim().length===0,onClick:()=>void f(),children:D()}),e?(0,F.jsx)(A,{variant:`ghost`,size:`sm`,disabled:u,onClick:()=>void n({}),children:C()}):null]}),o?(0,F.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:o}):null,(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:m()})]})}export{I as IntegrationsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$P as r,$k as i,AA as a,AP as o,CA as s,CP as c,DA as l,DP as u,E as d,EA as f,EP as ee,Et as p,FA as m,FP as te,IP as h,MA as g,MP as ne,Mt as re,NA as ie,NP as ae,OA as oe,OP as se,PA as ce,PP as le,QP as _,Qk as ue,SA as de,SP as fe,TA as pe,TP as me,WP as he,XS as ge,Xk as v,Zk as y,_A as b,_t as x,aA as S,bA as C,bP as w,cA as T,dA as E,dt as D,eA as O,fA as k,ft as A,gA as j,gt as M,hA as N,ht as P,iA as F,jA as I,jP as L,jt as _e,kA as ve,kP as ye,lA as R,mA as be,mt as xe,n as z,nA as Se,oA as Ce,pA as we,pt as Te,rA as B,sA as Ee,tA as De,uA as Oe,vA as ke,vt as Ae,wA as je,wP as Me,xA as Ne,xP as Pe,yA as Fe,yP as Ie,zP as Le}from"./dist-DwNg72Ge.js";import{t as V}from"./button-DPiqYkrF.js";import{C as H,Ct as Re,H as ze,S as Be,St as Ve,T as He,dt as U,ft as W,j as Ue,m as G,t as We,w as Ge,wt as K,x as Ke,xt as qe}from"./index-Dg_oXq0b.js";import{t as Je}from"./localePickerView-C2RmOS86.js";var q=t(e(),1),J=n();function Ye({className:e,checked:t,onCheckedChange:n,disabled:r,...i}){return(0,J.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"data-state":t?`checked`:`unchecked`,disabled:r,onClick:()=>n(!t),className:z(`peer inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent transition-colors outline-none`,`focus-visible:ring-2 focus-visible:ring-ring/50`,`disabled:cursor-not-allowed disabled:opacity-50`,t?`bg-primary`:`bg-input`,e),...i,children:(0,J.jsx)(`span`,{className:z(`pointer-events-none block size-4 rounded-full bg-background shadow transition-transform`,t?`translate-x-[18px]`:`translate-x-[2px]`)})})}var Y=[{id:`messages`,label:()=>m()},{id:`composer`,label:()=>ce()},{id:`sidebar`,label:()=>ie()},{id:`notifications`,label:()=>j()},{id:`other`,label:()=>g()}],X={showSource:{category:`messages`,label:()=>I(),help:()=>a()},showReport:{category:`messages`,label:()=>ve(),help:()=>oe()},copyAssistant:{category:`messages`,label:()=>l()},copyUser:{category:`messages`,label:()=>f()},showDelete:{category:`messages`,label:()=>pe()},showTools:{category:`messages`,label:()=>je(),help:()=>s()},voiceInput:{category:`composer`,label:()=>de(),help:()=>Ne()},showUsage:{category:`composer`,label:()=>C(),help:()=>Fe()},autoReadAloud:{category:`composer`,label:()=>re(),help:()=>_e()},showChatAge:{category:`sidebar`,label:()=>ke(),help:()=>b()},notifSound:{category:`notifications`,label:()=>N(),help:()=>be()},notifSystem:{category:`notifications`,label:()=>we(),help:()=>k()},replySound:{category:`notifications`,label:()=>E(),help:()=>Oe()}};function Z(e){return e.toLowerCase().normalize(`NFD`).replace(/\p{Diacritic}/gu,``)}function Q(e,t){let n=Z(t.trim()),r=new Map(Y.map(e=>[e.id,e.label()])),i=new Map(Y.map(e=>[e.id,[]]));for(let t of e){let e=X[t],a=e?.category??`other`;n&&!Z(`${e?e.label():t} ${e?.help?e.help():``} ${t} ${r.get(a)??``}`).includes(n)||i.get(a).push(t)}return Y.map(e=>({id:e.id,label:r.get(e.id),keys:i.get(e.id)})).filter(e=>e.keys.length>0)}var Xe=[`showSource`,`showReport`,`copyAssistant`,`copyUser`,`showDelete`,`showTools`,`voiceInput`,`showChatAge`,`showUsage`,`autoReadAloud`,`notifSound`,`notifSystem`,`replySound`],Ze={voiceInput:`voiceInput`};function Qe(e){return Xe.includes(e)}function $(e){return e===`admin`}function $e(e){return e===!0?`on`:e===!1?`off`:`inherit`}function et(e){return e===`on`?!0:e===`off`?!1:null}function tt(e){return Qe(e)?Ze[e]:void 0}var nt={voiceInput:()=>O()};function rt({prefKey:e,ui:t}){let n=_(d.admin.setUiPrefDefault),r=_(d.admin.setFeatureEnabled),i=tt(e),a=i?nt[e]?.():void 0;return(0,J.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,J.jsx)(`span`,{className:`oc-prefs__gov-label`,children:F()}),(0,J.jsxs)(Ke,{value:$e(t.defaults[e]),onValueChange:t=>void n({key:e,value:et(t)}),children:[(0,J.jsx)(Ge,{size:`sm`,className:`w-36`,children:(0,J.jsx)(He,{})}),(0,J.jsxs)(Be,{children:[(0,J.jsx)(H,{value:`on`,children:ue()}),(0,J.jsx)(H,{value:`off`,children:y()}),(0,J.jsx)(H,{value:`inherit`,children:v()})]})]}),i?(0,J.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,J.jsx)(G,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":B()}),B()]}):null]}),a?(0,J.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function it({current:e,enabled:t}){let n=_(d.me.setDictationShortcut),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(!1);return(0,q.useEffect)(()=>{if(!r)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){i(!1);return}let t=Ve(e);if(t===null){[`Shift`,`Control`,`Meta`,`Alt`].includes(e.key)||(o(!0),window.setTimeout(()=>o(!1),1800));return}i(!1),n({shortcut:t})};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[r,n]),(0,J.jsxs)(`div`,{className:`oc-prefs__row${t?``:` is-locked`}`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,J.jsxs)(`span`,{className:`oc-prefs__label`,children:[Ae(),e?(0,J.jsx)(U,{variant:`secondary`,children:Re(e,qe())}):null]}),(0,J.jsx)(`span`,{className:`oc-prefs__help`,children:a?P():r?M():x()})]}),(0,J.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[e&&!r?(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void n({shortcut:null}),children:D()}):null,(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,disabled:!t,"aria-pressed":r,onClick:()=>i(e=>!e),children:r?A():e?Te():xe()})]})]})}function at(){let[e,t]=(0,q.useState)(``),[n,a]=(0,q.useState)(!1),o=r(d.me.getMe,{host:K}),s=o?.ui,c=$(o?.role)&&n,l=_(d.me.setUiPref).withOptimisticUpdate(Ue),u=(0,q.useMemo)(()=>s?Q(Object.keys(s.effective),e):[],[s,e]);return s?(0,J.jsxs)(`div`,{className:`oc-prefs-panel`,children:[$(o?.role)?(0,J.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,J.jsx)(G,{checked:n,onCheckedChange:e=>a(e===!0),"aria-label":S()}),S()]}):null,c?(0,J.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,J.jsx)(`p`,{children:Se()}),(0,J.jsx)(`p`,{children:De()}),(0,J.jsx)(`p`,{children:i()})]}):null,(0,J.jsx)(W,{value:e,onChange:e=>t(e.target.value),placeholder:R(),"aria-label":R(),className:`mb-2`}),u.length===0?(0,J.jsx)(`div`,{className:`oc-prefs__empty`,children:T()}):(0,J.jsx)(`div`,{className:`oc-prefs`,children:u.map(e=>(0,J.jsxs)(`section`,{className:`oc-prefs__card`,children:[(0,J.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=X[e],n=t?t.label():e,r=t?.help?.(),i=s.locked[e],a=s.effective[e],o=s.userOverrides[e]!==void 0;return(0,J.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,J.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,J.jsx)(U,{variant:`outline`,children:Ee()}):o?(0,J.jsx)(U,{variant:`secondary`,children:p()}):null]}),r?(0,J.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,J.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&o?(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void l({key:e,value:null}),children:Ce()}):null,(0,J.jsx)(Ye,{checked:a,disabled:i,onCheckedChange:t=>{e===`notifSystem`&&t&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission(),l({key:e,value:t})},"aria-label":n})]}),c?(0,J.jsx)(rt,{prefKey:e,ui:s}):null]},e)})]},e.id))}),(0,J.jsx)(it,{current:o?.dictationShortcut??null,enabled:s.effective.voiceInput===!0})]}):(0,J.jsx)(`div`,{className:`oc-prefs__empty`,children:he()})}var ot={sm:()=>Me(),md:()=>c(),lg:()=>fe(),xl:()=>Pe()};function st(){let e=r(d.me.getMe,{host:K}),t=_(d.me.setLocale),n=_(d.me.setFontScale).withOptimisticUpdate((e,{scale:t})=>{let n=e.getQuery(d.me.getMe,{host:K});n&&e.setQuery(d.me.getMe,{host:K},{...n,fontScale:t,resolvedFontScale:t??`md`})}),i=_(d.me.setMyName),a=ze(),s=e?.locale??`default`,c=e?.name??``,[l,f]=(0,q.useState)(null),p=l??c,m=p.trim()!==c.trim();async function g(){try{await i({name:p}),f(null),a.success(ne())}catch(e){a.error(L(),e)}}return(0,J.jsxs)(`div`,{className:`oc-appearance`,children:[(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:h()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:te()})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(W,{className:`max-w-xs`,value:p,maxLength:120,placeholder:le(),onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&m&&(e.preventDefault(),g())}}),(0,J.jsx)(V,{size:`sm`,disabled:!m,onClick:()=>void g(),children:ge()})]}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:ae()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:o()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:ye()})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[Je().map(e=>(0,J.jsx)(V,{variant:s===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,J.jsx)(V,{variant:s==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:Le()})]}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:se()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:u()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:ee()})]}),(0,J.jsx)(`div`,{className:`oc-show__row`,children:We.map(t=>(0,J.jsx)(V,{variant:(e?.fontScale??`md`)===t?`default`:`outline`,size:`sm`,onClick:()=>void n({scale:t}),children:ot[t]()},t))}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:me()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:w()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Ie()})]}),(0,J.jsx)(at,{})]})]})}export{st as PreferencesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$P as r,$b as i,Ab as a,Bb as o,Cb as s,Db as c,E as l,Eb as u,Gb as d,Hb as f,Ib as p,Jb as m,Kb as h,Lb as g,Li as _,Ob as v,QP as y,Qb as b,Rb as x,Sb as S,Tb as C,Ub as ee,Vb as te,Wb as ne,Xb as re,Yb as ie,Zb as w,ax as T,cx as E,dx as D,ex as O,ix as k,kb as A,lx as j,nx as M,ox as N,qb as P,rx as F,sx as I,tx as L,ux as R,wb as z,zb as ae}from"./dist-DwNg72Ge.js";import{t as B}from"./button-DPiqYkrF.js";import{Gt as V,H,U,d as W,dt as G,ft as K,m as q}from"./index-Dg_oXq0b.js";import{t as J}from"./roleDescriptions-C1GE6TIL.js";var Y=t(e(),1),X=n(),Z=[{group:()=>D(),keys:[{key:`traces.read`,label:()=>N()},{key:`traces.read.content`,label:()=>T(),phi:!0},{key:`traces.write`,label:()=>k()}]},{group:()=>R(),keys:[{key:`kpi.read`,label:()=>N()},{key:`kpi.write`,label:()=>k()}]},{group:()=>j(),keys:[{key:`openclaw.query`,label:()=>F()},{key:`anomalies.read`,label:()=>M()},{key:`anomalies.report`,label:()=>L()}]},{group:()=>E(),keys:[{key:`chats.read`,label:()=>N()},{key:`selfheal`,label:()=>i()},{key:`feedback.respond`,label:()=>_()}]},{group:()=>I(),keys:[{key:`admin.manage`,label:()=>O()}]}],oe=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function se(){let e=r(l.apiKeys.listRoles,{}),t=y(l.apiKeys.createRole),n=y(l.apiKeys.ensureRolesSeeded),i=y(l.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(l.apiKeys.listRoles,{});r&&e.setQuery(l.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),_=U(),T=H(),[E,D]=(0,Y.useState)(!1),[O,k]=(0,Y.useState)($),[j,M]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{T.error(w(),e)})},[n,T]);let N=e??[];async function F(e,t){if(Q(e.permissions))return;if(e.builtin){await _({title:re({name:e.name}),description:ie(),confirmLabel:m()});return}if(j.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];M(t=>new Set(t).add(e._id));try{await i({roleId:e._id,permissions:n})}catch(e){T.error(P(),e)}finally{M(t=>{let n=new Set(t);return n.delete(e._id),n})}}async function I(){try{await t({key:O.key,name:O.name,description:O.description||void 0,permissions:[]}),k($),D(!1)}catch(e){T.error(h(),e)}}let L=e===void 0,R=!L&&N.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[d(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,ne(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,ee()]}),(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:f()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(B,{size:`sm`,onClick:()=>{k($),D(!0)},children:te()})})]}),L?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:o()}):R?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:ae()}):(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:x()}),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?b({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:N.map(e=>{let t=Q(e.permissions),n=j.has(e._id);return(0,X.jsxs)(`tr`,{children:[(0,X.jsxs)(`th`,{className:`oc-matrix__rolecell`,children:[(0,X.jsxs)(`div`,{className:`oc-matrix__rolename`,children:[(0,X.jsx)(`span`,{children:e.name}),(0,X.jsx)(`code`,{className:`oc-matrix__rolekey`,children:e.key}),e.builtin?(0,X.jsxs)(G,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(V,{}),` `,g()]}):(0,X.jsx)(G,{variant:`secondary`,children:p()})]}),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)(q,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?a():n?A():r,onCheckedChange:()=>void F(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(W,{open:E,onOpenChange:D,title:v(),description:c(),canSubmit:!!(O.key&&O.name),onSubmit:I,submitLabel:u(),children:(0,X.jsxs)(`div`,{className:`oc-form`,children:[(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:C()}),(0,X.jsx)(K,{value:O.key,placeholder:z(),onChange:e=>k({...O,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:s()}),(0,X.jsx)(K,{value:O.name,onChange:e=>k({...O,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:S()}),(0,X.jsx)(K,{value:O.description,onChange:e=>k({...O,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{$M as r,AM as i,AN as a,BM as o,CM as s,CN as c,D as l,DM as ee,DN as te,E as u,EM as ne,EN as re,GM as ie,JM as ae,KM as oe,KP as se,MN as d,NN as ce,OM as le,ON as ue,PN as de,SM as fe,SN as pe,TM as me,TN as he,UM as ge,VM as _e,WM as f,WP as p,XM as ve,XP as m,YM as ye,ZM as h,_M as be,bM as xe,bN as Se,cM as Ce,eN as we,gM as Te,hM as Ee,jN as De,kM as g,kN as Oe,mM as ke,nN as _,pM as Ae,qM as je,rN as Me,tN as Ne,vM as Pe,wM as Fe,wN as Ie,xM as Le,xN as Re,yM as ze}from"./dist-DwNg72Ge.js";import{t as v}from"./button-DPiqYkrF.js";import{B as Be,C as y,Ft as Ve,G as He,H as Ue,Ht as We,J as Ge,K as Ke,Kt as qe,Mt as Je,Q as Ye,S as Xe,T as Ze,Ut as Qe,V as $e,Vt as et,X as tt,Y as nt,Z as rt,_t as it,dt as b,ft as x,gt as at,ht as ot,mt as S,pt as C,q as st,vt as w,w as T,x as E,zt as ct}from"./index-Dg_oXq0b.js";import{a as lt,i as D,n as ut,o as O,r as k,t as dt}from"./table-DcJVBwwq.js";var ft=l(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),A=t(e(),1),j=n(),M={minutes:6e4,hours:36e5,days:864e5};function N(e){return e?.data?.code??`unknown`}function P(){let e=m(u.scheduled.listMyCrons),t=m(u.scheduled.getCronDetail),n=m(u.scheduled.listCronRuns),l=m(u.scheduled.updateCron),P=m(u.scheduled.removeCron),pt=m(u.scheduled.runCronNow),F=Ue(),[I,mt]=(0,A.useState)(null),[L,R]=(0,A.useState)(!1),[z,B]=(0,A.useState)(!1),[V,ht]=(0,A.useState)(null),[H,U]=(0,A.useState)(null),[W,G]=(0,A.useState)(null),[K,q]=(0,A.useState)(null),[gt,J]=(0,A.useState)(!1),Y=(0,A.useCallback)(async()=>{R(!0),B(!1);try{mt(await e({}))}catch{B(!0)}finally{R(!1)}},[e]);(0,A.useEffect)(()=>{Y()},[Y]);let _t=(0,A.useMemo)(()=>new URLSearchParams(window.location.search).get(`job`),[]),X=(0,A.useRef)(null);(0,A.useEffect)(()=>{I!==null&&X.current!==null&&X.current.scrollIntoView({block:`center`})},[I]);let vt=(0,A.useMemo)(()=>new Intl.DateTimeFormat(se(),{dateStyle:`medium`,timeStyle:`short`}),[]),Z=async(e,t,n)=>{ht(e);try{await t(),F.success(n),await Y()}catch(e){F.toast({variant:`error`,title:h({code:N(e)})})}finally{ht(null)}},Q=(0,A.useRef)(0),$=(0,A.useRef)(0),yt=async(e,t)=>{if(t.id===null)return;let r=++Q.current;G({name:t.name??t.id,entries:null});try{let i=await n({instanceName:e,jobId:t.id,limit:20});if(r!==Q.current)return;G({name:t.name??t.id,entries:i})}catch(e){if(r!==Q.current)return;G(null),F.toast({variant:`error`,title:h({code:N(e)})})}},bt=async(e,n)=>{if(n.id===null)return;let r=++$.current;q({instanceName:e,jobId:n.id,loading:!0,name:n.name??``,scheduleKind:`cron`,cronExpr:``,tz:``,everyValue:`1`,everyUnit:`hours`,at:``,message:``,hasMessage:!1,scheduleDirty:!1,messageDirty:!1,nameDirty:!1});try{let i=(await t({instanceName:e,jobId:n.id})).job,a=i.scheduleKind===`every`||i.scheduleKind===`at`?i.scheduleKind:`cron`,o=``;if(a===`at`&&i.scheduleExpr!==null){let e=Date.parse(i.scheduleExpr);Number.isFinite(e)&&(o=new Date(e-new Date(e).getTimezoneOffset()*6e4).toISOString().slice(0,16))}let s=`1`,c=`hours`;if(a===`every`&&i.scheduleExpr!==null){let e=Number(i.scheduleExpr);Number.isFinite(e)&&e>0&&(e%M.days===0?(s=String(e/M.days),c=`days`):e%M.hours===0?(s=String(e/M.hours),c=`hours`):(s=String(Math.max(1,Math.round(e/M.minutes))),c=`minutes`))}if(r!==$.current)return;q(e=>e===null||e.jobId!==n.id?e:{...e,loading:!1,name:i.name??e.name,scheduleKind:a,cronExpr:a===`cron`?i.scheduleExpr??``:``,tz:i.tz??``,everyValue:s,everyUnit:c,at:o,message:i.message??``,hasMessage:i.message!==null&&!i.messageTruncated})}catch(e){if(r!==$.current)return;q(null),F.toast({variant:`error`,title:h({code:N(e)})})}},xt=async()=>{if(K===null)return;let e={};if(K.nameDirty&&K.name.trim()===``||K.messageDirty&&K.hasMessage&&K.message.trim()===``){F.toast({variant:`error`,title:Ae()});return}if(K.nameDirty&&K.name.trim()!==``&&(e.name=K.name.trim()),K.scheduleDirty){if(K.scheduleKind===`cron`&&K.cronExpr.trim()!==``)e.schedule={kind:`cron`,expr:K.cronExpr.trim(),...K.tz.trim()===``?{}:{tz:K.tz.trim()}};else if(K.scheduleKind===`every`){let t=Number(K.everyValue);Number.isFinite(t)&&t>=1&&(e.schedule={kind:`every`,everyMs:Math.round(t*M[K.everyUnit])})}else if(K.scheduleKind===`at`&&K.at!==``){let t=Date.parse(K.at);Number.isFinite(t)&&(e.schedule={kind:`at`,at:new Date(t).toISOString()})}}if(K.scheduleDirty&&e.schedule===void 0){F.toast({variant:`error`,title:ke()});return}if(K.messageDirty&&K.hasMessage&&K.message.trim()!==``&&(e.message=K.message.trim()),Object.keys(e).length===0){q(null);return}let t=$.current;J(!0);try{await l({instanceName:K.instanceName,jobId:K.jobId,patch:e}),F.success(ee()),t===$.current&&q(null),await Y()}catch(e){F.toast({variant:`error`,title:h({code:N(e)})})}finally{J(!1)}},St=I?.reduce((e,t)=>e+t.jobs.length,0)??0;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,marginBottom:12},children:[(0,j.jsx)(`p`,{className:`oc-admin__hint`,style:{flex:1,margin:0},children:de()}),(0,j.jsxs)(v,{variant:`ghost`,size:`sm`,onClick:()=>void Y(),disabled:L,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,j.jsx)(ct,{size:14,"aria-hidden":!0}),ce()]})]}),I===null?(0,j.jsx)(`p`,{className:`oc-admin__hint`,"aria-busy":L,children:z?d():p()}):(0,j.jsxs)(j.Fragment,{children:[z?(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):null,I.length===0?(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:De()}):null,I.map(e=>(0,j.jsxs)(`section`,{style:{marginBottom:20},children:[I.length>1||e.error||!e.supported?(0,j.jsxs)(`h3`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:`0.85rem`,fontWeight:600,margin:`0 0 6px`},children:[e.instanceName,(0,j.jsx)(b,{variant:`outline`,children:e.kind})]}):null,e.supported?e.error?(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:Oe({code:e.error})}):e.jobs.length===0?(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:ue()}):(0,j.jsxs)(dt,{children:[(0,j.jsx)(lt,{children:(0,j.jsxs)(O,{children:[(0,j.jsx)(D,{children:te()}),(0,j.jsx)(D,{children:re()}),(0,j.jsx)(D,{children:he()}),(0,j.jsx)(D,{children:Ie()}),(0,j.jsx)(D,{children:c()}),(0,j.jsx)(D,{children:i()})]})}),(0,j.jsx)(ut,{children:e.jobs.map((t,n)=>{let i=`${e.instanceName}:${t.id??n}`,a=V===i,o=e.manageSupported,s=e.kind===`openclaw`&&o;return(0,j.jsxs)(O,{ref:t.id!==null&&t.id===_t?X:void 0,"data-state":t.id!==null&&t.id===_t?`selected`:void 0,children:[(0,j.jsx)(k,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:t.name??void 0,children:t.name??pe()}),(0,j.jsx)(k,{children:(0,j.jsx)(b,{variant:`secondary`,children:t.agentId})}),(0,j.jsxs)(k,{className:`whitespace-nowrap`,children:[(0,j.jsx)(`span`,{style:{fontFamily:`var(--font-mono, monospace)`},children:t.schedule??`—`}),(()=>{let e=Be(t.schedule),n=e===null?null:$e(e);return n===null?null:(0,j.jsx)(`span`,{className:`text-muted-foreground`,style:{display:`block`,fontSize:`0.78rem`},children:n})})()]}),(0,j.jsx)(k,{className:`whitespace-nowrap text-muted-foreground`,children:t.nextRunAtMs===null?`—`:vt.format(t.nextRunAtMs)}),(0,j.jsxs)(k,{children:[t.enabled===!0?(0,j.jsx)(b,{variant:`secondary`,children:Se()}):t.enabled===!1?(0,j.jsx)(b,{variant:`outline`,children:Re()}):(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}),t.lastRunStatus?(0,j.jsx)(`span`,{className:`text-muted-foreground`,style:{marginLeft:8,fontSize:`0.8rem`},children:t.lastRunStatus}):null]}),(0,j.jsx)(k,{className:`whitespace-nowrap`,children:t.id===null?(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):a?(0,j.jsx)(qe,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):(0,j.jsxs)(`span`,{style:{display:`inline-flex`,gap:2},children:[s?(0,j.jsx)(v,{variant:`ghost`,size:`icon-sm`,title:_(),"aria-label":_(),disabled:V!==null,onClick:()=>void Z(i,async()=>{let n=await pt({instanceName:e.instanceName,jobId:t.id});if(n.ran!==!0&&n.runId===null)throw{data:{code:n.reason??`run_not_started`}}},ve()),children:(0,j.jsx)(Je,{size:14,"aria-hidden":!0})}):null,s&&t.enabled!==null?(0,j.jsx)(v,{variant:`ghost`,size:`icon-sm`,title:t.enabled?Ne():we(),"aria-label":t.enabled?Ne():we(),disabled:V!==null,onClick:()=>void Z(i,()=>l({instanceName:e.instanceName,jobId:t.id,patch:{enabled:!t.enabled}}),t.enabled?ye():ae()),children:t.enabled?(0,j.jsx)(Qe,{size:14,"aria-hidden":!0}):(0,j.jsx)(et,{size:14,"aria-hidden":!0})}):null,s?(0,j.jsx)(v,{variant:`ghost`,size:`icon-sm`,title:g(),"aria-label":g(),disabled:V!==null,onClick:()=>void bt(e.instanceName,t),children:(0,j.jsx)(We,{size:14,"aria-hidden":!0})}):null,s?(0,j.jsx)(v,{variant:`ghost`,size:`icon-sm`,title:le(),"aria-label":le(),disabled:V!==null,onClick:()=>void yt(e.instanceName,t),children:(0,j.jsx)(ft,{size:14,"aria-hidden":!0})}):null,o?(0,j.jsx)(v,{variant:`ghost`,size:`icon-sm`,title:r(),"aria-label":r(),disabled:V!==null,onClick:()=>U({instanceName:e.instanceName,jobId:t.id,name:t.name??t.id}),children:(0,j.jsx)(Ve,{size:14,"aria-hidden":!0})}):null]})})]},t.id??`${e.instanceName}-${n}`)})})]}):(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:a()})]},e.instanceName)),St>0?(0,j.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:4},children:Ce()}):null]}),(0,j.jsx)(He,{open:H!==null,onOpenChange:e=>{e||U(null)},children:(0,j.jsxs)(Ge,{children:[(0,j.jsxs)(rt,{children:[(0,j.jsx)(Ye,{children:oe()}),(0,j.jsx)(nt,{children:ie({name:H?.name??``})})]}),(0,j.jsxs)(tt,{children:[(0,j.jsx)(st,{children:f()}),(0,j.jsx)(Ke,{onClick:()=>{let e=H;U(null),e!==null&&Z(`${e.instanceName}:${e.jobId}`,()=>P({instanceName:e.instanceName,jobId:e.jobId}),je())},children:ge()})]})]})}),(0,j.jsx)(C,{open:W!==null,onOpenChange:e=>{e||(Q.current++,G(null))},children:(0,j.jsxs)(S,{style:{maxWidth:640},children:[(0,j.jsx)(it,{children:(0,j.jsx)(w,{children:ne({name:W?.name??``})})}),W?.entries===null?(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):W!==null&&W.entries.length===0?(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:me()}):W===null?null:(0,j.jsx)(`div`,{className:`oc-cronpanel__runs`,style:{maxHeight:420,overflowY:`auto`},children:W.entries.map((e,t)=>(0,j.jsxs)(`div`,{className:`oc-cronpanel__run`,children:[(0,j.jsxs)(`div`,{className:`oc-cronpanel__run-head`,children:[e.status===`ok`?(0,j.jsx)(b,{variant:`secondary`,children:_e()}):e.status===`error`?(0,j.jsx)(b,{variant:`destructive`,children:o()}):(0,j.jsx)(b,{variant:`outline`,children:e.status??`—`}),(0,j.jsx)(`span`,{children:typeof(e.runAtMs??e.ts)==`number`?vt.format(e.runAtMs??e.ts):`—`}),typeof e.durationMs==`number`?(0,j.jsxs)(`span`,{className:`oc-cronpanel__run-dur`,children:[Math.round(e.durationMs/1e3),`s`]}):null]}),e.summary===null?null:(0,j.jsx)(`div`,{className:`oc-cronpanel__run-summary`,children:e.summary}),e.error===null?null:(0,j.jsx)(`div`,{className:`oc-cronpanel__run-error`,children:e.error})]},t))})]})}),(0,j.jsx)(C,{open:K!==null,onOpenChange:e=>{e||($.current++,q(null))},children:(0,j.jsxs)(S,{children:[(0,j.jsxs)(it,{children:[(0,j.jsx)(w,{children:Fe()}),(0,j.jsx)(ot,{children:s()})]}),K===null?null:K.loading?(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:p()}):(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,j.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:te()}),(0,j.jsx)(x,{value:K.name,maxLength:200,onChange:e=>q({...K,name:e.target.value,nameDirty:!0})})]}),(0,j.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:fe()}),(0,j.jsxs)(E,{value:K.scheduleKind,onValueChange:e=>q({...K,scheduleKind:e,scheduleDirty:!0}),children:[(0,j.jsx)(T,{children:(0,j.jsx)(Ze,{})}),(0,j.jsxs)(Xe,{children:[(0,j.jsx)(y,{value:`cron`,children:Le()}),(0,j.jsx)(y,{value:`every`,children:xe()}),(0,j.jsx)(y,{value:`at`,children:ze()})]})]}),K.scheduleKind===`cron`?(0,j.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,j.jsx)(x,{value:K.cronExpr,onChange:e=>q({...K,cronExpr:e.target.value,scheduleDirty:!0}),placeholder:`30 9 * * *`,style:{fontFamily:`var(--font-mono, monospace)`}}),(0,j.jsx)(x,{value:K.tz,onChange:e=>q({...K,tz:e.target.value,scheduleDirty:!0}),placeholder:`America/Toronto`,style:{maxWidth:180}})]}):K.scheduleKind===`every`?(0,j.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,j.jsx)(x,{type:`number`,min:1,value:K.everyValue,onChange:e=>q({...K,everyValue:e.target.value,scheduleDirty:!0}),style:{maxWidth:120}}),(0,j.jsxs)(E,{value:K.everyUnit,onValueChange:e=>q({...K,everyUnit:e,scheduleDirty:!0}),children:[(0,j.jsx)(T,{style:{maxWidth:160},children:(0,j.jsx)(Ze,{})}),(0,j.jsxs)(Xe,{children:[(0,j.jsx)(y,{value:`minutes`,children:Pe()}),(0,j.jsx)(y,{value:`hours`,children:be()}),(0,j.jsx)(y,{value:`days`,children:Te()})]})]})]}):(0,j.jsx)(x,{type:`datetime-local`,value:K.at,onChange:e=>q({...K,at:e.target.value,scheduleDirty:!0})})]}),K.hasMessage?(0,j.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,j.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:Me()}),(0,j.jsx)(`textarea`,{className:`oc-cronedit__textarea`,rows:4,value:K.message,onChange:e=>q({...K,message:e.target.value,messageDirty:!0})})]}):null]}),(0,j.jsxs)(at,{children:[(0,j.jsx)(v,{variant:`ghost`,onClick:()=>q(null),children:f()}),(0,j.jsxs)(v,{onClick:()=>void xt(),disabled:K===null||K.loading||gt,children:[gt?(0,j.jsx)(qe,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):null,Ee()]})]})]})})]})}export{P as ScheduledTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$O as r,$P as i,AO as a,Ak as ee,BO as o,Bk as te,Ck as ne,Dk as re,E as s,Ek as ie,FO as c,Fk as ae,GO as l,Gk as oe,HO as u,Hk as se,IO as d,Ik as ce,JO as f,Jk as le,KO as p,Kk as ue,LO as m,Lk as de,MO as h,Mk as fe,NO as g,Nk as pe,Ok as me,PO as he,Pk as ge,QO as _e,QP as _,RO as v,Rk as ve,Sk as ye,Tk as be,UO as y,Uk as xe,VO as b,Vk as Se,WO as x,Wk as S,XO as C,XP as Ce,YO as w,Yk as we,ZO as T,_k as Te,ak as Ee,bk as De,ck as Oe,dk as ke,ek as Ae,fk as je,gk as Me,hk as Ne,ik as Pe,jO as E,jk as Fe,kO as D,kk as Ie,lk as Le,mk as Re,nk as ze,ok as Be,pk as Ve,qO as O,qk as He,rk as Ue,sk as We,tk as Ge,uk as Ke,vk as qe,wk as Je,xk as Ye,yk as Xe,zO as k,zk as Ze}from"./dist-DwNg72Ge.js";import{n as A}from"./dist-Dx0HEr5d.js";import{i as Qe}from"./dist-Dz7d7Ev-.js";import{t as j}from"./button-DPiqYkrF.js";import{C as M,H as $e,S as N,T as P,U as et,Zt as F,_t as I,d as tt,dt as L,en as nt,ft as R,gt as z,ht as B,mt as V,nn as rt,nt as H,pt as it,rn as at,rt as U,vt as W,w as G,x as K}from"./index-Dg_oXq0b.js";import{t as ot}from"./FilterBar-DFzFJCUO.js";import{t as st}from"./DataTableShell-CZObMHUc.js";import{t as ct}from"./roleDescriptions-C1GE6TIL.js";var q=t(e(),1),J=n(),Y=[{value:`never`,label:()=>c(),days:null},{value:`30`,label:()=>he(),days:30},{value:`90`,label:()=>g(),days:90}],X=720*60*60*1e3,Z=`__all__`,Q={name:``,roleKey:``,description:``};function $(){let e=at({from:`/settings/serviceAccounts`}),t=rt({from:`/settings/serviceAccounts`}),n=e.q??``,a=e.status??Z,[o,c]=(0,q.useState)(Z),l=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),u=e=>void t({search:t=>({...t,status:e===Z?void 0:e})}),d=i(s.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===Z?void 0:o,disabled:a===Z?void 0:a===`disabled`}}),f=i(s.apiKeys.listKeys,{}),p=i(s.apiKeys.listRoles,{}),m=_(s.apiKeys.createServiceAccount),h=_(s.apiKeys.updateServiceAccount),g=_(s.apiKeys.deleteServiceAccount),he=Ce(s.apiKeys.mintApiKey),_e=_(s.apiKeys.revokeApiKey),v=et(),y=$e(),b=n!==``||o!==Z||a!==Z;function x(){c(Z),t({search:{},replace:!0})}let[C,w]=(0,q.useState)(!1),[T,E]=(0,q.useState)(Q),[D,O]=(0,q.useState)(null),[k,A]=(0,q.useState)(new Set),[F,I]=(0,q.useState)(null),z=(0,q.useRef)(!1),[B,V]=(0,q.useState)(new Set),[H,it]=(0,q.useState)({}),[U,W]=(0,q.useState)(null),X=(0,q.useMemo)(()=>{let e=new Map;for(let t of f??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[f]);function $(e){A(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function dt(){try{D?(await h({serviceAccountId:D,name:T.name,roleKey:T.roleKey,description:T.description}),y.success(Ve())):await m({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Q),O(null),w(!1)}catch(e){y.error(D?Re():Ne(),e)}}function ft(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),w(!0)}async function pt(e){if(z.current)return;z.current=!0;let t=H[e._id]??`never`,n=Y.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;I(e._id);try{let t=await he({serviceAccountId:e._id,expiresAt:r});W({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){y.error(je(),e)}finally{z.current=!1,I(null)}}async function mt(e){if(await v({title:ke(),description:(0,J.jsxs)(J.Fragment,{children:[Ke(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Le(),` `,(0,J.jsx)(`strong`,{children:Oe()}),` `,We()]}),confirmWord:e.name,confirmLabel:Be(),destructive:!0}))try{await g({serviceAccountId:e._id}),y.success(Ee(),e.name)}catch(e){y.error(Pe(),e)}}async function ht(e){if(await v({title:Ue(),description:(0,J.jsxs)(J.Fragment,{children:[ze(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,Ge()]}),confirmLabel:Ae(),destructive:!0})&&!B.has(e._id)){V(t=>new Set(t).add(e._id));try{await _e({keyId:e._id})}catch(e){y.error(r(),e)}finally{V(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:l,searchPlaceholder:le(),onReset:x,canReset:b,children:[(0,J.jsxs)(K,{value:o,onValueChange:c,children:[(0,J.jsx)(G,{size:`sm`,className:`w-40`,children:(0,J.jsx)(P,{placeholder:He()})}),(0,J.jsxs)(N,{children:[(0,J.jsx)(M,{value:Z,children:ue()}),(p??[]).map(e=>(0,J.jsx)(M,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(K,{value:a,onValueChange:u,children:[(0,J.jsx)(G,{size:`sm`,className:`w-36`,children:(0,J.jsx)(P,{})}),(0,J.jsxs)(N,{children:[(0,J.jsx)(M,{value:Z,children:oe()}),(0,J.jsx)(M,{value:`active`,children:S()}),(0,J.jsx)(M,{value:`disabled`,children:xe()})]})]})]}),(0,J.jsx)(st,{title:se(),rows:d,addLabel:Se(),onAdd:()=>{E(Q),O(null),w(!0)},emptyHint:te(),isExpanded:e=>k.has(e._id),renderExpanded:e=>(0,J.jsx)(lt,{account:e,keys:X.get(e._id)??[],onRevoke:ht,revoking:B}),rowActions:e=>[{label:ce(),onSelect:()=>ft(e)},{label:Ze(),onSelect:()=>void pt(e)},{label:k.has(e._id)?ve():de(),onSelect:()=>$(e._id)},{label:ae(),variant:`destructive`,onSelect:()=>void mt(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(j,{variant:`ghost`,size:`icon-sm`,"aria-label":k.has(e._id)?ge():pe(),onClick:()=>$(e._id),children:k.has(e._id)?(0,J.jsx)(Qe,{}):(0,J.jsx)(nt,{})})},{header:fe(),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:Fe(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(L,{variant:`secondary`,children:e.roleKey})},{header:ee(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(L,{variant:`destructive`,children:xe()}):(0,J.jsx)(L,{variant:`outline`,children:S()})},{header:Ie(),cell:e=>(0,J.jsxs)(K,{value:H[e._id]??`never`,onValueChange:t=>it(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(G,{size:`sm`,className:`w-32`,children:(0,J.jsx)(P,{})}),(0,J.jsx)(N,{children:Y.map(e=>(0,J.jsx)(M,{value:e.value,children:e.label()},e.value))})]})},{header:me(),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?re():ie({count:t})})}}]}),(0,J.jsx)(tt,{open:C,onOpenChange:e=>{w(e),e||O(null)},title:D?be():ye(),description:D?Je():Ye(),canSubmit:!!(T.name&&T.roleKey),onSubmit:dt,submitLabel:D?ne():De(),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:Xe()}),(0,J.jsx)(R,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:qe()}),(0,J.jsxs)(K,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,J.jsx)(G,{className:`w-full`,children:(0,J.jsx)(P,{placeholder:Te()})}),(0,J.jsx)(N,{children:(p??[]).map(e=>(0,J.jsxs)(M,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(p??[]).find(e=>e.key===T.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:Me()}),(0,J.jsx)(R,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,J.jsx)(ut,{minted:U,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:[_e(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:T()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:C()}),(0,J.jsx)(`th`,{children:w()}),(0,J.jsx)(`th`,{children:f()}),(0,J.jsx)(`th`,{children:O()}),(0,J.jsx)(`th`,{children:p()}),(0,J.jsx)(`th`,{children:l()}),(0,J.jsx)(`th`,{})]})}),(0,J.jsx)(`tbody`,{children:t.map(t=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,J.jsx)(`td`,{children:(0,J.jsx)(L,{variant:`secondary`,children:e.roleKey})}),(0,J.jsx)(`td`,{children:U(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)(j,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?x():y()})})]},t._id))})]})]})}function ut({minted:e,onClose:t}){let[n,r]=(0,q.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,J.jsx)(it,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(V,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(I,{children:[(0,J.jsx)(W,{children:u()}),(0,J.jsx)(B,{children:b({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:o()}),(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)(j,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":k(),children:[n?(0,J.jsx)(A,{}):(0,J.jsx)(F,{}),n?v():m()]})]}),(0,J.jsx)(z,{children:(0,J.jsx)(j,{onClick:()=>{r(!1),t()},children:d()})})]}):null})}function dt(e){return e===null?!1:Date.now()-e>X}function ft(e){return e===null?h():U(e)}function pt(e){return e===null?`—`:H(e)}function mt(e){return e.disabled?(0,J.jsx)(L,{variant:`destructive`,children:E()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(L,{variant:`outline`,children:a()}):(0,J.jsx)(L,{variant:`outline`,children:D()})}export{$ as ServiceAccountsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$A as r,$P as i,$a as a,$j as o,Aj as s,BA as c,BP as l,Bj as u,Cj as d,D as f,Dj as p,E as m,Ej as h,Fj as g,GA as ee,Gj as _,HA as v,HP as y,Hj as te,IA as ne,Ij as re,JA as ie,Jj as b,KA as ae,Kj as oe,LA as se,Lj as ce,Mj as le,Nj as ue,Oj as de,Pj as fe,QA as pe,QP as x,Qa as me,Qj as he,RA as ge,Rj as _e,Sj as ve,Tj as ye,UA as be,Uj as xe,VA as Se,VP as Ce,Vj as we,WA as Te,Wj as Ee,XA as De,XP as Oe,Xj as ke,YA as Ae,Yj as je,ZA as Me,Zj as Ne,_j as Pe,aj as Fe,bj as Ie,cj as Le,dj as Re,eM as ze,ej as Be,eo as S,fj as Ve,gj as He,hj as Ue,iM as We,ij as Ge,jj as Ke,kj as qe,lj as Je,mj as Ye,n as Xe,nM as Ze,nj as C,oj as Qe,pj as $e,qA as et,qj as tt,rM as nt,rj as rt,sj as it,tM as at,tj as ot,to as w,uj as st,vj as ct,wj as lt,xj as T,yj as ut,zA as dt,zj as ft}from"./dist-DwNg72Ge.js";import{n as E}from"./dist-Dx0HEr5d.js";import{t as D}from"./x-BmGrWf4l.js";import{t as O}from"./button-DPiqYkrF.js";import{C as k,S as A,T as j,Xt as pt,Yt as M,at as mt,bt as ht,ct as gt,dt as N,ft as P,lt as F,m as I,ot as _t,st as L,ut as vt,w as R,wt as z,x as B,yt}from"./index-Dg_oXq0b.js";import{t as bt}from"./localePickerView-C2RmOS86.js";import{a as xt,i as St,n as Ct,o as wt,r as Tt,t as Et}from"./card-B7aSgmYB.js";import{a as Dt,i as V,n as Ot,o as H,r as U,t as kt}from"./table-DcJVBwwq.js";import{t as At}from"./TimeRangePicker-CoF8Chf_.js";import{t as jt}from"./FilterBar-DFzFJCUO.js";import{t as Mt}from"./AdvancedFilter-Cjx_oQl1.js";var W=f(`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`}]]),G=t(e(),1),Nt=.1,Pt=[248,248,248],Ft=[24,24,24];function It(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function Lt(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function K(e,t,n){return Lt(e,t,n)>=Nt}function Rt(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function zt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var Bt=12*1024*1024,Vt=480,Ht=160,Ut=.92;async function Wt(e,t={}){if(!e.type.startsWith(`image/`))throw Error(Fe());if(e.size>Bt)throw Error(Ge());let{source:n,width:r,height:i,cleanup:a}=await Gt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Vt/r,Ht/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(C());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=It(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(C());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);K(e.data,d.width,d.height)?Rt(e.data,t.variantFor===`dark`?Pt:Ft):zt(e.data),p.putImageData(e,0,0)}let m=K(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await J(f,`image/webp`,Ut)??await J(f,`image/png`);if(!h)throw Error(ot());return{blob:h,hasAlpha:m}}finally{a()}}async function Gt(e){if(e.type===`image/svg+xml`)return q(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 q(e)}async function q(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(rt())),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 J(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var Y=n();function Kt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var X=`__all__`,Z={kind:`relative`,from:`now-24h`,to:`now`},qt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function Q({title:e,description:t,children:n}){return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,Y.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function Jt(e){return e===`light`?y():e===`dark`?Ce():l()}var Yt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Xt({tokens:e,mode:t}){let n=e.colors[t];return(0,Y.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Yt.map(e=>{let t=n[e];return(0,Y.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function $({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,Y.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,Y.jsxs)(`button`,{type:`button`,className:Xe(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,Y.jsx)(E,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,Y.jsx)(Xt,{tokens:r,mode:i}):(0,Y.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,Y.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,Y.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,Y.jsx)(O,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":w(),title:w(),children:(0,Y.jsx)(pt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=i(m.charts.listMyCharts),r=x(m.charts.setMyChart);async function a(e){try{await r({name:e})}catch{}}return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:ke()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:je()})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,Y.jsx)($,{selected:e===null,title:b(),subtitle:tt(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?oe():n.via===`owner`?_():Ee({group:n.via.group});return(0,Y.jsx)($,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void a(n.key),onExport:()=>Kt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:xe()}):null]})}function Qt(){let e=x(m.charts.importChart),[t,n]=(0,G.useState)(``),[r,i]=(0,G.useState)(``),[a,o]=(0,G.useState)(null),[s,c]=(0,G.useState)(!1),[l,u]=(0,G.useState)(!1);async function f(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{i(await t.text())}catch{o(T())}}}async function g(){if(o(null),c(!1),t.trim()===``){o(ut());return}let a;try{a=JSON.parse(r)}catch{o(T());return}u(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{u(!1)}}return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:qe()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:de()})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:p()}),(0,Y.jsx)(P,{value:t,onChange:e=>n(e.target.value),placeholder:h(),maxLength:60})]}),(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:ye()}),(0,Y.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:lt(),rows:8,spellCheck:!1})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Y.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,Y.jsx)(W,{className:`size-4`}),d(),(0,Y.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void f(e)})]})}),(0,Y.jsx)(O,{size:`sm`,disabled:l,onClick:()=>void g(),children:ve()})]}),a?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,Y.jsx)(`p`,{className:`oc-chart-import__ok`,children:Ie()}):null]})]})}function $t({chart:e}){let t=Oe(m.charts.setChartLogo),n=x(m.charts.removeChartLogo),[r,i]=(0,G.useState)(!1),[a,o]=(0,G.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Wt(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?Ve():Re()}),(0,Y.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,Y.jsx)(`img`,{src:t,alt:``}):null}),(0,Y.jsx)(O,{variant:`outline`,size:`sm`,asChild:!0,children:(0,Y.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,Y.jsx)(W,{className:`size-4`}),t?Je():st(),(0,Y.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:it()}):null,t?(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Le()}):null]})}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:$e()}),(0,Y.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,Y.jsx)(f,{mode:`light`}),(0,Y.jsx)(f,{mode:`dark`})]}),r?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:Qe()}):null,a?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=i(m.me.getMe,{host:z}),n=x(m.charts.addChartDomain),a=x(m.charts.removeChartDomain),[o,s]=(0,G.useState)(``),[c,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(!1);if(t?.role!==`admin`)return null;let f=e.domains??[];async function p(){let t=o.trim();if(t!==``){l(null),d(!0);try{await n({chartKey:e.key,domain:t}),s(``)}catch(e){l(e instanceof Error?e.message:String(e))}finally{d(!1)}}}async function h(t){l(null);try{await a({chartKey:e.key,domain:t})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Be()}),(0,Y.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,Y.jsx)(`div`,{className:`oc-chart-avail__groups`,children:f.length===0?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:De()}):f.map(e=>(0,Y.jsxs)(N,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,Y.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ae({domain:e}),onClick:()=>void h(e),children:(0,Y.jsx)(D,{className:`size-3`})})]},e))}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(P,{value:o,onChange:e=>s(e.target.value),placeholder:pe(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&p()}}),(0,Y.jsx)(O,{variant:`outline`,size:`sm`,disabled:u,onClick:()=>void p(),children:Me()})]}),(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:r()}),c?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:c}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=x(m.charts.updateChart),n=x(m.charts.deleteChart),[r,i]=(0,G.useState)(!1),[o,s]=(0,G.useState)(e.name),[c,l]=(0,G.useState)(()=>tn(e.tokens)),[u,d]=(0,G.useState)(e.tokens.bpm??0),[f,p]=(0,G.useState)(null),[h,g]=(0,G.useState)(!1);function _(){s(e.name),l(tn(e.tokens)),d(e.tokens.bpm??0),p(null),i(!0)}async function v(){if(e.chartId===void 0)return;p(null);let n;try{n=JSON.parse(c)}catch{p(T());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:o.trim(),tokens:n}),i(!1)}catch(e){p(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function y(){if(e.chartId!==void 0&&window.confirm(Te()))try{await n({chartId:e.chartId})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(O,{variant:`outline`,size:`sm`,onClick:_,children:Ue()}),(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void y(),children:Ye()})]})})]}),r?(0,Y.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:ae()}),(0,Y.jsx)(P,{value:o,onChange:e=>s(e.target.value),maxLength:60})]}),(0,Y.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:S()}),(0,Y.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,Y.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:u,onChange:e=>d(Number(e.target.value)),"aria-label":S()}),(0,Y.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?a():`${u} BPM`})]}),(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:me()})]}),(0,Y.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-import__label`,children:ee()}),(0,Y.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),f?(0,Y.jsx)(`p`,{className:`oc-chart-import__error`,children:f}):null,(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{size:`sm`,disabled:h,onClick:()=>void v(),children:ie()}),(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),children:et()})]})]}):null,(0,Y.jsx)($t,{chart:e}),(0,Y.jsx)(en,{chart:e})]})}function rn(){let e=i(m.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:ct()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Pe()})]}),e!==void 0&&t.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:He()}):(0,Y.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,Y.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=x(m.charts.addChartToGroupPool),r=x(m.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),l=t.filter(e=>!o.has(e._id));async function u(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,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,Y.jsx)(N,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?g():e.kind===`custom`&&e.scope===`personal`?c():re()}),e.isGlobalDefault?(0,Y.jsx)(N,{variant:`default`,children:fe()}):null]}),(0,Y.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:le()}),(a??[]).map(e=>(0,Y.jsxs)(N,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,Y.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":s({group:e.name}),onClick:()=>void d(e.groupId),children:(0,Y.jsx)(D,{className:`size-3`})})]},e.groupId)),l.length>0?(0,Y.jsxs)(B,{value:``,onValueChange:e=>void u(e),children:[(0,Y.jsx)(R,{size:`sm`,className:`w-56`,children:(0,Y.jsx)(j,{placeholder:Ke()})}),(0,Y.jsx)(A,{children:l.map(e=>(0,Y.jsx)(k,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:ue()}):null]})]})}function on({chart:e}){let t=x(m.charts.promoteChartToCommon),n=x(m.charts.deleteChart);async function r(){if(e.chartId!==void 0)try{await t({chartId:e.chartId})}catch{}}async function i(){if(e.chartId!==void 0&&window.confirm(Te()))try{await n({chartId:e.chartId})}catch{}}return(0,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,Y.jsx)(N,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?dt():c()}),e.ownerLabel?(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:Se({owner:e.ownerLabel})}):null]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,Y.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:ge()}):null,(0,Y.jsx)(O,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:se()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=x(m.admin.setDefaultThemeMode),a=x(m.admin.setDefaultLocale),o=x(m.charts.setDefaultChart),s=i(m.charts.listChartsAdmin),c=i(m.groups.listGroups,{}),l=e??`system`,d=t??`fr`;return(0,Y.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h2`,{className:`oc-show__title`,children:he()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:Ne()})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:te()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:we()})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:b()}),ht.map(e=>(0,Y.jsx)(O,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,Y.jsx)(O,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key))]})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:u()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ft()})]}),(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,Y.jsx)(an,{chart:e,groups:c??[]},e.key))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:_e()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ce()})]}),(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,Y.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,Y.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,Y.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,Y.jsx)(en,{chart:e})]},e.key))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:be()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:v()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ne()}):(0,Y.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,Y.jsx)(on,{chart:e},e.key))})})()]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:We()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:nt()})]}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,Y.jsx)(O,{variant:l===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:Jt(e)},e))})]}),(0,Y.jsxs)(`section`,{className:`oc-show__section`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,Y.jsx)(`h3`,{className:`oc-show__title`,children:Ze()}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:at()})]}),(0,Y.jsx)(`div`,{className:`oc-show__row`,children:bt().map(e=>(0,Y.jsx)(O,{variant:d===e.value?`default`:`outline`,size:`sm`,onClick:()=>void a({locale:e.value}),children:e.label},e.value))}),(0,Y.jsx)(`p`,{className:`oc-show__desc`,children:ze()})]})]})}function cn(){let e=i(m.me.getMe,{host:z}),t=yt(e?.resolvedThemeMode);return(0,Y.jsxs)(`div`,{className:`oc-appearance`,children:[(0,Y.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,Y.jsx)(Qt,{}),(0,Y.jsx)(rn,{}),e?.role===`admin`?(0,Y.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,G.useState)(!0),[n,r]=(0,G.useState)(`per-user`),[i,a]=(0,G.useState)(``),[s,c]=(0,G.useState)(X),[l,u]=(0,G.useState)(X),[d,f]=(0,G.useState)(Z),p=i!==``||s!==X||l!==X;function m(){a(``),c(X),u(X),f(Z)}return(0,Y.jsxs)(`div`,{className:`oc-show`,children:[(0,Y.jsx)(cn,{}),(0,Y.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,Y.jsx)(`summary`,{className:`oc-show__title`,children:o()}),(0,Y.jsxs)(Q,{title:`Buttons`,description:`Variants`,children:[(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{children:`Default`}),(0,Y.jsx)(O,{variant:`secondary`,children:`Secondary`}),(0,Y.jsx)(O,{variant:`outline`,children:`Outline`}),(0,Y.jsx)(O,{variant:`ghost`,children:`Ghost`}),(0,Y.jsx)(O,{variant:`destructive`,children:`Destructive`}),(0,Y.jsx)(O,{variant:`link`,children:`Link`})]}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(O,{size:`sm`,children:`Small`}),(0,Y.jsx)(O,{children:`Default`}),(0,Y.jsx)(O,{size:`lg`,children:`Large`}),(0,Y.jsx)(O,{size:`icon`,"aria-label":`more`,children:(0,Y.jsx)(M,{})}),(0,Y.jsx)(O,{disabled:!0,children:`Disabled`})]})]}),(0,Y.jsx)(Q,{title:`Badges`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(N,{children:`Default`}),(0,Y.jsx)(N,{variant:`secondary`,children:`Secondary`}),(0,Y.jsx)(N,{variant:`outline`,children:`Outline`}),(0,Y.jsx)(N,{variant:`destructive`,children:`Destructive`})]})}),(0,Y.jsx)(Q,{title:`Inputs & selection`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsx)(P,{placeholder:`Text input…`}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsxs)(B,{value:n,onValueChange:r,children:[(0,Y.jsx)(R,{className:`w-56`,children:(0,Y.jsx)(j,{placeholder:`Select…`})}),(0,Y.jsxs)(A,{children:[(0,Y.jsx)(k,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,Y.jsx)(k,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,Y.jsxs)(`label`,{className:`oc-show__check`,children:[(0,Y.jsx)(I,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,Y.jsx)(Q,{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,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsxs)(jt,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:d,onTimeRangeChange:f,onReset:m,canReset:p,children:[(0,Y.jsxs)(B,{value:s,onValueChange:c,children:[(0,Y.jsx)(R,{size:`sm`,children:(0,Y.jsx)(j,{})}),(0,Y.jsxs)(A,{children:[(0,Y.jsx)(k,{value:X,children:`Toutes directions`}),(0,Y.jsx)(k,{value:`inbound`,children:`inbound`}),(0,Y.jsx)(k,{value:`outbound`,children:`outbound`}),(0,Y.jsx)(k,{value:`internal`,children:`internal`})]})]}),(0,Y.jsxs)(B,{value:l,onValueChange:u,children:[(0,Y.jsx)(R,{size:`sm`,children:(0,Y.jsx)(j,{})}),(0,Y.jsxs)(A,{children:[(0,Y.jsx)(k,{value:X,children:`Toutes sévérités`}),(0,Y.jsx)(k,{value:`info`,children:`info`}),(0,Y.jsx)(k,{value:`warn`,children:`warn`}),(0,Y.jsx)(k,{value:`critical`,children:`critical`})]})]})]}),(0,Y.jsx)(Mt,{fields:qt,onChange:()=>{}}),(0,Y.jsxs)(`div`,{className:`oc-show__row`,children:[(0,Y.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,Y.jsx)(At,{value:d,onChange:f})]})]})}),(0,Y.jsx)(Q,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,Y.jsxs)(mt,{children:[(0,Y.jsx)(vt,{asChild:!0,children:(0,Y.jsx)(O,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,Y.jsx)(M,{})})}),(0,Y.jsxs)(_t,{align:`start`,children:[(0,Y.jsx)(gt,{children:`Actions`}),(0,Y.jsx)(F,{}),(0,Y.jsx)(L,{children:`Edit`}),(0,Y.jsx)(L,{children:`Duplicate`}),(0,Y.jsx)(F,{}),(0,Y.jsx)(L,{variant:`destructive`,children:`Delete`})]})]})}),(0,Y.jsx)(Q,{title:`Card`,children:(0,Y.jsxs)(Et,{className:`w-80`,children:[(0,Y.jsxs)(xt,{children:[(0,Y.jsx)(wt,{children:`Instance`}),(0,Y.jsx)(Tt,{children:`Non-secret metadata only.`})]}),(0,Y.jsx)(Ct,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,Y.jsxs)(St,{className:`gap-2`,children:[(0,Y.jsx)(O,{size:`sm`,children:`Save`}),(0,Y.jsx)(O,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,Y.jsx)(Q,{title:`Table`,children:(0,Y.jsxs)(kt,{children:[(0,Y.jsx)(Dt,{children:(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{className:`w-8`,children:(0,Y.jsx)(I,{"aria-label":`select all`})}),(0,Y.jsx)(V,{children:`Name`}),(0,Y.jsx)(V,{children:`Mode`}),(0,Y.jsx)(V,{className:`text-right`,children:`Status`}),(0,Y.jsx)(V,{className:`w-8`})]})}),(0,Y.jsx)(Ot,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,Y.jsxs)(H,{children:[(0,Y.jsx)(U,{children:(0,Y.jsx)(I,{"aria-label":`select ${e.n}`})}),(0,Y.jsx)(U,{className:`font-medium`,children:e.n}),(0,Y.jsx)(U,{children:(0,Y.jsx)(N,{variant:`secondary`,children:e.m})}),(0,Y.jsx)(U,{className:`text-right`,children:(0,Y.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,Y.jsx)(E,{className:`size-3.5`}),` `,e.s]})}),(0,Y.jsx)(U,{children:(0,Y.jsx)(O,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,Y.jsx)(M,{})})})]},e.n))})]})}),(0,Y.jsx)(Q,{title:`App fragments`,description:`Chat-specific components`,children:(0,Y.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,Y.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,Y.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,Y.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,Y.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,Y.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,Y.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,Y.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,Y.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,Y.jsx)(`span`,{className:`oc-run-status__dot`}),(0,Y.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{ln as ThemeShowroom};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$P as r,$T as i,$v as a,AT as o,Av as s,Bv as c,Cv as l,D as u,DT as d,Dv as f,E as p,ET as m,Ev as h,FT as g,Fv as _,GT as v,Gv as ee,Hv as y,IT as b,Iv as x,JT as S,Jv as te,KT as ne,Kv as re,LT as C,Lv as ie,MT as w,Mv as ae,NT as oe,Nv as se,OT as T,Ov as ce,PT as le,Pv as ue,QP as E,QT as de,Qv as fe,RT as pe,Rv as me,Sv as he,TT as ge,Tv as _e,Uv as ve,Vv as ye,WT as D,Wv as be,XT as O,Xn as k,Xv as xe,YT as A,Yn as Se,Yv as Ce,ZT as j,Zn as we,Zv as Te,_v as Ee,aE as De,bv as Oe,cE as ke,dE as M,eE as N,ey as Ae,fE as P,iE as F,jT as je,jv as Me,kT as Ne,kv as Pe,lE as Fe,mE as Ie,nE as I,oE as Le,pE as Re,qT as ze,qv as Be,rE as Ve,sE as He,tE as L,ty as Ue,uE as We,vv as Ge,wv as Ke,xv as qe,yv as Je,zT as Ye,zv as Xe}from"./dist-DwNg72Ge.js";import{n as Ze}from"./dist-Dx0HEr5d.js";import{t as Qe}from"./x-BmGrWf4l.js";import{i as R,n as z,r as $e,t as et}from"./tabs-vmnojSO4.js";import{t as B}from"./button-DPiqYkrF.js";import{C as V,Jt as tt,M as nt,S as H,T as U,Zt as rt,_t as it,a as at,dt as W,ht as ot,i as st,it as ct,mt as lt,nn as ut,o as dt,pt as ft,qt as pt,rn as mt,rt as G,s as ht,vt as gt,w as K,wt as _t,x as q}from"./index-Dg_oXq0b.js";import{n as vt}from"./TimeRangePicker-CoF8Chf_.js";import{t as yt}from"./FilterBar-DFzFJCUO.js";import{t as bt}from"./AdvancedFilter-Cjx_oQl1.js";import{t as xt}from"./DataTableShell-CZObMHUc.js";var St=u(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=u(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?A():n===`agent`?`${S()} - ${r}`:e}function Tt(){let e=r(p.me.getMe,{host:_t})?.role===`admin`,t=r(p.deliveryTiming.getDeliveryStatus,{}),n=E(p.deliveryTiming.startDeliveryRecord),i=E(p.deliveryTiming.stopDeliveryRecord),[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(!1),l=t?.recording??!1,u=async()=>{c(!0);try{l?await i({}):await n({})}finally{c(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:Ie()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Re()})]}),e?(0,Y.jsx)(B,{variant:l?`destructive`:`default`,size:`sm`,disabled:s||t===void 0,onClick:()=>void u(),children:l?M():P()}):null]}),l?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(W,{variant:`secondary`,children:We()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:Fe({time:ct(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>o(e=>!e),children:a?Le():He()})}),a?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=r(p.deliveryTiming.listDeliverySessions,{}),n=E(p.deliveryTiming.deleteDeliverySessions),[a,o]=(0,J.useState)(``),[s,c]=(0,J.useState)(`all`),[l,u]=(0,J.useState)(X),[d,f]=(0,J.useState)(null),{from:h,to:g}=vt(l),_=l.to===`now`?1/0:g,ee=a.trim()!==``||s!==`all`||l!==X,y=()=>{o(``),c(`all`),u(X)},b=(0,J.useMemo)(()=>{if(t===void 0)return;let e=a.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(s===`all`||(s===`active`?t.active:!t.active))&&t.startedAt>=h&&t.startedAt<=_).map(e=>({...e,_id:e.sessionId}))},[t,a,s,h,_]),x=e=>{let t=new Set((b??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),d!==null&&r.includes(d)&&f(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(yt,{q:a,onQChange:o,searchPlaceholder:F(),timeRange:l,onTimeRangeChange:u,onReset:y,canReset:ee,children:(0,Y.jsxs)(q,{value:s,onValueChange:e=>c(e),children:[(0,Y.jsx)(K,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(U,{})}),(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{value:`all`,children:Ve()}),(0,Y.jsx)(V,{value:`active`,children:I()}),(0,Y.jsx)(V,{value:`stopped`,children:L()})]})]})}),(0,Y.jsx)(xt,{title:De(),rows:b,emptyHint:m(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":d===e.sessionId?ne():ze(),onClick:()=>f(t=>t===e.sessionId?null:e.sessionId),children:d===e.sessionId?(0,Y.jsx)(St,{size:15,"aria-hidden":!0}):(0,Y.jsx)(tt,{size:15,"aria-hidden":!0})})},{header:N(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:G(e.startedAt)})},{header:i(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,Y.jsx)(`span`,{className:`tabular-nums`,children:G(e.stoppedAt)})},{header:de(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:j(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:O(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(W,{variant:`secondary`,children:I()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:L()})}],rowActions:e?e=>[{label:v(),variant:`destructive`,onSelect:()=>x([e.sessionId])}]:void 0,bulkActions:e?[{label:v(),variant:`destructive`,onSelect:e=>x(e)}]:void 0,isExpanded:e=>e.sessionId===d,renderExpanded:e=>(0,Y.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=r(p.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,i]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(nt(t)).then(()=>{i(!0),window.setTimeout(()=>i(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:D()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:ke()});let r=e.segments,i=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Z(t.p50),` / `,Z(t.p95),` / `,Z(t.max)]})]});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,ge()]}),(0,Y.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Ze,{size:13,"aria-hidden":!0}):(0,Y.jsx)(rt,{size:13,"aria-hidden":!0}),t?d():T()]})]}),(0,Y.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,Y.jsx)(`th`,{className:`py-1 font-medium`,children:C()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:b()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:g()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(le(),r.bridge),i(oe(),r.A),i(w(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:je()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Ne()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:o()})]})}var kt=[50,100,200,500],At=`all`,Q=`__all__`,jt=[`2xx`,`4xx`,`5xx`],Mt=[`user`,`service`,`system`],Nt=[`inbound`,`outbound`,`internal`],Pt={kind:`relative`,from:`now-30d`,to:`now`},Ft=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:we()},{value:`principalType`,label:k()},{value:`direction`,label:`direction`},{value:`roleKey`,label:Se()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=mt({from:`/settings/traces`}),t=ut({from:`/settings/traces`}),n=e.limit,i=e.kind,o=e.statusClass??Q,u=e.principalType??Q,d=e.direction??Q,m=e.roleKey??Q,g=e.q??``,v=st(e.from,e.to),b=(0,J.useMemo)(()=>ht(e.adv),[e.adv]),{from:S,to:ne}=vt(v),[C,w]=(0,J.useState)(null),[oe,T]=(0,J.useState)(null),le=e=>void t({search:t=>({...t,limit:e})}),E=e=>void t({search:t=>({...t,kind:e})}),de=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ge=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),D=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),O=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),k=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),A=e=>void t({search:t=>({...t,...dt(e)})}),Se=e=>void t({search:t=>({...t,adv:at(e)}),replace:!0}),j=r(p.observability.listEvents,{limit:n}),we=r(p.observability.listEvents,{limit:n,kind:i===At?void 0:i,filter:{q:g||void 0,from:S,to:ne,statusClass:o===Q?void 0:o,principalType:u===Q?void 0:u,direction:d===Q?void 0:d,roleKey:m===Q?void 0:m,advanced:b.length>0?b:void 0}}),Ee=(0,J.useMemo)(()=>{let e=new Set;for(let t of j??[])e.add(t.kind);return[...e].sort()},[j]),De=(0,J.useMemo)(()=>{let e=new Set;for(let t of j??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[j]),ke=g!==``||o!==Q||u!==Q||d!==Q||m!==Q||b.length>0||v.kind!==`relative`||v.from!==Pt.from;function M(){t({search:{limit:100,kind:`all`},replace:!0})}let N=C?j?.filter(e=>e.correlationId===C):we,P=e.section,F=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(et,{value:P,onValueChange:e=>F(e),children:[(0,Y.jsxs)($e,{className:`w-full`,children:[(0,Y.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(pt,{size:13,"aria-hidden":!0}),Ye()]}),(0,Y.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),pe()]})]}),(0,Y.jsx)(z,{value:`latency`,children:(0,Y.jsx)(Tt,{})}),(0,Y.jsxs)(z,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ue(),(0,Y.jsx)(`strong`,{children:Ae()}),a(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:fe()})]}),(0,Y.jsxs)(yt,{q:g,onQChange:de,searchPlaceholder:Te(),timeRange:v,onTimeRangeChange:A,onReset:M,canReset:ke,children:[(0,Y.jsxs)(q,{value:o,onValueChange:ge,children:[(0,Y.jsx)(K,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(U,{placeholder:xe()})}),(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{value:Q,children:Ce()}),jt.map(e=>(0,Y.jsx)(V,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:u,onValueChange:D,children:[(0,Y.jsx)(K,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(U,{placeholder:te()})}),(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{value:Q,children:Be()}),Mt.map(e=>(0,Y.jsx)(V,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:d,onValueChange:O,children:[(0,Y.jsx)(K,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(U,{placeholder:re()})}),(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{value:Q,children:ee()}),Nt.map(e=>(0,Y.jsx)(V,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:m,onValueChange:k,children:[(0,Y.jsx)(K,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(U,{placeholder:be()})}),(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{value:Q,children:ve()}),De.map(e=>(0,Y.jsx)(V,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:i,onValueChange:E,children:[(0,Y.jsx)(K,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(U,{placeholder:y()})}),(0,Y.jsxs)(H,{children:[(0,Y.jsx)(V,{value:At,children:ye()}),Ee.map(e=>(0,Y.jsx)(V,{value:e,children:e},e))]})]}),(0,Y.jsxs)(q,{value:String(n),onValueChange:e=>le(Number(e)),children:[(0,Y.jsx)(K,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(U,{})}),(0,Y.jsx)(H,{children:kt.map(e=>(0,Y.jsx)(V,{value:String(e),children:c({count:e})},e))})]})]}),(0,Y.jsx)(bt,{fields:Ft,seed:b,onChange:Se}),C?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>w(null),title:Xe(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[me(),(0,Y.jsx)(`code`,{children:$(C)})]}),(0,Y.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:ie()})]})}):null,(0,Y.jsx)(xt,{title:x(),rows:N,emptyHint:C?_():ue(),columns:[{header:se(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:G(e.at)})},{header:ae(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(W,{variant:`secondary`,children:e.kind})},{header:Me(),sort:e=>Rt(e)??null,cell:e=>{let t=Rt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":s(),children:`✓`})}},{header:Pe(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(W,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ce(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(W,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:f(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(W,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:h(),sort:e=>e.route,cell:e=>e.route?(0,Y.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,Y.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:_e(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Lt(e.status)}`,children:e.status})},{header:Ke(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:l(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:he(),onClick:()=>w(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:qe(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>T(e),children:Oe()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:oe,onClose:()=>T(null)})]})]})}function Lt(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Rt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function zt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(ft,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(lt,{className:`max-w-lg`,children:[(0,Y.jsxs)(it,{children:[(0,Y.jsxs)(gt,{className:`oc-traces__meta-title`,children:[Je(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(W,{variant:`outline`,children:Ge()})]}),(0,Y.jsx)(ot,{children:Ee()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$P as r,AC as i,BC as a,B_ as o,CC as s,DC as c,E as l,EC as u,FC as d,F_ as f,HC as p,H_ as m,IC as h,I_ as g,LC as ee,L_ as _,MC as te,M_ as v,NC as ne,N_ as y,OC as b,PC as x,P_ as S,QP as C,RC as re,R_ as w,SC as ie,TC as ae,UC as T,U_ as E,VC as D,V_ as O,XS as oe,_C as se,bC as ce,gC as k,hC as le,id as A,jC as ue,j_ as j,kC as de,nd as M,rd as N,vC as fe,wC as pe,xC as me,yC as he,zC as ge,z_ as P}from"./dist-DwNg72Ge.js";import{t as F}from"./button-DPiqYkrF.js";import{C as I,H as L,It as R,Lt as z,S as B,T as V,U as _e,W as ve,_t as H,at as ye,c as U,ct as be,dt as W,ht as xe,l as Se,m as G,mt as Ce,nn as we,ot as Te,pt as Ee,rn as De,st as Oe,u as K,ut as ke,vt as Ae,w as q,wt as J,x as Y}from"./index-Dg_oXq0b.js";import{t as je}from"./FilterBar-DFzFJCUO.js";import{t as Me}from"./DataTableShell-CZObMHUc.js";import{t as Ne}from"./DetailChips-BKsW8g7U.js";var X=t(e(),1),Z=n();function Pe({profileId:e,userLabel:t,open:n,onOpenChange:i}){let a=r(l.agents.listAgentPoolForUser,n&&e?{profileId:e}:`skip`),s=r(l.agents.listUserAgents,n&&e?{profileId:e}:`skip`),c=new Set((s??[]).map(e=>`${e.instanceName}/${e.agentId}`)),u=(s??[]).find(e=>e.isDefault)??null,d=u?`${u.instanceName}/${u.agentId}`:null,f=new Set((a?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),p=[...(a?.agents??[]).map(e=>({...e,outOfPool:!1})),...(s??[]).filter(e=>!f.has(`${e.instanceName}/${e.agentId}`)).map(e=>({instanceName:e.instanceName,agentId:e.agentId,displayName:e.displayName,emoji:e.emoji,model:e.model,kind:e.kind,enabled:e.enabled,state:e.state,outOfPool:!0}))],h=new Map;for(let e of p){let t=h.get(e.instanceName)??[];t.push(e),h.set(e.instanceName,t)}return(0,Z.jsx)(Ee,{open:n,onOpenChange:i,children:(0,Z.jsxs)(Ce,{className:`oc-access`,children:[(0,Z.jsxs)(H,{children:[(0,Z.jsx)(Ae,{children:E({user:t})}),(0,Z.jsx)(xe,{children:m()})]}),a?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:a.inGroup?O():o()}):null,(0,Z.jsx)(`div`,{className:`oc-access__list`,children:a===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:P()}):p.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:g()}):[...h.entries()].map(([t,n])=>(0,Z.jsx)(Fe,{profileId:e,instanceName:t,kind:n[0].kind,agents:n,assigned:c,defaultKey:d},t))})]})})}function Fe({profileId:e,instanceName:t,kind:n,agents:r,assigned:i,defaultKey:a}){let o=C(l.agents.assignAgent),s=C(l.agents.removeAgent),c=C(l.agents.setDefaultAgent),u=L();if(!e)return null;async function d(n,r){try{r?await s({profileId:e,instanceName:t,agentId:n}):await o({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(w(),e)}}async function p(n){try{await c({profileId:e,instanceName:t,agentId:n})}catch(e){u.error(_(),e)}}return(0,Z.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Z.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Z.jsx)(z,{size:13,"aria-hidden":!0}),(0,Z.jsx)(`span`,{children:t}),(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__kind`,children:n})]}),r.map(e=>{let n=`${t}/${e.agentId}`,r=i.has(n),o=a===n,s=e.state===`deleted`,c=!e.enabled;return(0,Z.jsxs)(`div`,{className:`oc-access__row${c?` is-disabled`:``}`,children:[(0,Z.jsx)(G,{checked:r,disabled:(s||c)&&!r,onCheckedChange:()=>void d(e.agentId,r),"aria-label":f({name:e.displayName??e.agentId})}),(0,Z.jsxs)(`span`,{className:`oc-access__label`,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Z.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,s?(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__gone`,children:S()}):null,e.outOfPool?(0,Z.jsx)(W,{variant:`outline`,className:`oc-access__gone`,children:y()}):null,r?o?(0,Z.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":v(),title:v(),children:(0,Z.jsx)(R,{size:14,fill:`currentColor`})}):(0,Z.jsx)(F,{type:`button`,size:`icon-sm`,variant:`ghost`,className:`oc-access__setdefault`,"aria-label":j(),title:j(),disabled:c,onClick:()=>void p(e.agentId),children:(0,Z.jsx)(R,{size:14})}):null]},e.agentId)})]})}var Q=`__all__`;function $(e){switch(e){case`pending`:return M();case`user`:return N();case`admin`:return A();default:return e}}function Ie({granted:e,onToggle:t}){let n=new Set(e),r=U.filter(e=>n.has(K[e])).length;return(0,Z.jsxs)(ye,{children:[(0,Z.jsx)(ke,{asChild:!0,children:(0,Z.jsx)(F,{variant:`outline`,size:`sm`,className:`h-8 w-36 justify-start font-normal`,children:r===0?T():p({count:r})})}),(0,Z.jsxs)(Te,{align:`start`,className:`w-52`,children:[(0,Z.jsx)(be,{children:D()}),U.map(e=>{let r=K[e];return(0,Z.jsxs)(Oe,{className:`gap-2`,onSelect:e=>{e.preventDefault(),t(r)},children:[(0,Z.jsx)(G,{checked:n.has(r),"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none`}),(0,Z.jsx)(`span`,{children:Se[e]()})]},e)})]})]})}function Le(){let e=De({from:`/settings/users`}),t=we({from:`/settings/users`}),n=e.q??``,o=e.role??Q,f=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),p=e=>void t({search:t=>({...t,role:e===Q?void 0:e})}),m=r(l.admin.listUsers,{filter:{q:n||void 0,role:o===Q?void 0:o},withAgents:!0}),g=r(l.me.getMe,{host:J}),_=C(l.admin.setRole),v=C(l.admin.setUserPermissions),y=C(l.admin.startImpersonation),S=C(l.admin.deleteUser),w=C(l.admin.setUserName),T=_e(),E=ve(),D=L(),[O,A]=(0,X.useState)(null),j=(0,X.useMemo)(()=>{let e=new Set([`pending`,`user`,`admin`]);for(let t of m??[])e.add(t.role);return[...e]},[m]),M=n!==``||o!==Q;function N(){t({search:{},replace:!0})}async function P(e){try{await _(e)}catch(e){D.error(a(),e)}}async function F(e){try{await v(e)}catch(e){D.error(ge(),e)}}async function R(e){let t=e.email||e.name||e.canonical||e.userId.slice(0,8);if(await T({title:te(),description:ue({user:t}),confirmWord:i(),confirmLabel:de(),destructive:!0}))try{await S({profileId:e._id}),D.success(c({user:t}))}catch(e){D.error(b(),e)}}async function H(e){let t=e.email||e.name||e.userId.slice(0,8),n=await E({title:ae(),label:pe({user:t}),placeholder:s(),defaultValue:e.name??``,confirmLabel:oe()});if(n!==null)try{await w({profileId:e._id,name:n}),D.success(ie())}catch(e){D.error(me(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(je,{q:n,onQChange:f,searchPlaceholder:re(),onReset:N,canReset:M,children:(0,Z.jsxs)(Y,{value:o,onValueChange:p,children:[(0,Z.jsx)(q,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(V,{})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(I,{value:Q,children:ee()}),j.map(e=>(0,Z.jsx)(I,{value:e,children:$(e)},e))]})]})}),(0,Z.jsx)(Me,{title:h(),rows:m,emptyHint:d(),rowActions:e=>{let t=[{label:le(),onSelect:()=>A({profileId:e._id,label:e.email||e.name||e.canonical||e.userId.slice(0,8)})},{label:u(),onSelect:()=>void H(e)}];return e.userId!==g?.userId&&t.push({label:x(),onSelect:()=>void y({profileId:e._id})},{label:ne(),variant:`destructive`,onSelect:()=>void R(e)}),t},columns:[{header:ce(),cell:e=>{let t=e.email||e.name||e.canonical||e.userId.slice(0,8),n=e.email&&e.name&&e.name!==e.email?e.name:null;return(0,Z.jsxs)(`div`,{className:`flex flex-col`,children:[(0,Z.jsx)(`span`,{children:t}),n?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:n}):null]})},sort:e=>e.email||e.name||e.canonical||e.userId},{header:he(),sort:e=>e.role===`admin`?2:+(e.role===`user`),cell:e=>(0,Z.jsxs)(Y,{value:e.role,onValueChange:t=>void P({profileId:e._id,role:t}),children:[(0,Z.jsx)(q,{size:`sm`,className:`w-28`,children:(0,Z.jsx)(V,{})}),(0,Z.jsxs)(B,{children:[(0,Z.jsx)(I,{value:`pending`,children:$(`pending`)}),(0,Z.jsx)(I,{value:`user`,children:$(`user`)}),(0,Z.jsx)(I,{value:`admin`,children:$(`admin`)})]})]})},{header:fe(),sort:e=>e.role===`admin`?9999:e.extraPermissions?.length??0,cell:e=>e.role===`admin`?(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:se()}):(0,Z.jsx)(Ie,{granted:e.extraPermissions??[],onToggle:t=>{let n=new Set(e.extraPermissions??[]);n.has(t)?n.delete(t):n.add(t),F({profileId:e._id,permissions:[...n]})}})},{header:k(),cell:e=>(0,Z.jsx)(Ne,{icon:(0,Z.jsx)(z,{size:12,"aria-hidden":!0}),total:e.agentCount??0,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount??0}]}),(0,Z.jsx)(Pe,{profileId:O?.profileId??null,userLabel:O?.label??``,open:O!==null,onOpenChange:e=>{e||A(null)}})]})}export{Le as UsersTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$P as r,$t as i,At as a,Ct as o,D as s,Dt as c,E as l,Ft as u,Gt as d,It as f,Jc as ee,Jt as p,KP as te,Kt as m,Lt as h,Nt as g,Ot as _,Pt as ne,QP as v,Qt as re,St as ie,Tt as y,WP as b,XP as x,Xc as S,Xt as C,Yt as w,Zt as T,an as ae,cn as E,dn as D,en as oe,fn as se,gn as ce,gu as O,hn as le,in as ue,kt as de,ln as fe,mn as pe,nn as me,on as k,pn as A,qt as j,rn as M,sn as N,tn as P,un as F,ut as I,wt as L}from"./dist-DwNg72Ge.js";import{i as R,n as z,r as he,t as ge}from"./tabs-vmnojSO4.js";import{t as B}from"./button-DPiqYkrF.js";import{C as V,F as _e,I as ve,L as H,N as ye,Nt as be,P as xe,R as U,S as W,T as G,Wt as Se,dt as K,m as q,nn as Ce,rn as we,w as J,wt as Te,x as Y,z as Ee}from"./index-Dg_oXq0b.js";/* empty css */var X=s(`audio-lines`,[[`path`,{d:`M2 10v3`,key:`1fnikh`}],[`path`,{d:`M6 6v11`,key:`11sgs0`}],[`path`,{d:`M10 3v18`,key:`yhl04a`}],[`path`,{d:`M14 8v7`,key:`3a1oy3`}],[`path`,{d:`M18 5v13`,key:`123xd1`}],[`path`,{d:`M22 10v3`,key:`154ddg`}]]),Z=t(e(),1),Q=n(),De=[[`auto`,()=>fe()],[`fr-FR`,()=>h()],[`en-US`,()=>f()],[`en-GB`,()=>u()],[`de-DE`,()=>ne()],[`es-ES`,()=>g()]],Oe=[[`0.75`,()=>N()],[`1`,()=>k()],[`1.25`,()=>ae()],[`1.5`,()=>ue()]],$=0;function ke({instance:e}){let t=v(l.admin.upsertInstanceConfig),n=e.config??{},r={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[a,s]=(0,Z.useState)(r),[c,u]=(0,Z.useState)(`idle`),[d,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(!1),h=x(l.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{s({enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0}),u(`idle`)},[e._id]);let g=a.enabled!==r.enabled||a.engine!==r.engine||a.lang!==r.lang||a.rate!==r.rate||a.autoRead!==r.autoRead;async function _(){u(`saving`);try{let n={...e.config??{}};n.voiceEnabled=a.enabled,a.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,a.lang===`auto`?delete n.voiceLang:n.voiceLang=a.lang;let r=Number.parseFloat(a.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,a.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),u(`idle`)}catch{u(`error`)}}return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(K,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.enabled,onCheckedChange:e=>s({...a,enabled:e===!0}),"aria-label":D()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:D()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:y()}),(0,Q.jsxs)(Y,{value:a.engine,onValueChange:e=>s({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(J,{size:`sm`,"aria-label":y(),children:(0,Q.jsx)(G,{})}),(0,Q.jsxs)(W,{children:[(0,Q.jsx)(V,{value:`browser`,children:L()}),e.kind===`hermes`?null:(0,Q.jsx)(V,{value:`gateway`,children:o()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ie()}):null,a.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:F()}),(0,Q.jsxs)(Y,{value:a.lang,onValueChange:e=>s({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(J,{size:`sm`,"aria-label":F(),children:(0,Q.jsx)(G,{})}),(0,Q.jsx)(W,{children:De.map(([e,t])=>(0,Q.jsx)(V,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:E()}),(0,Q.jsxs)(Y,{value:a.rate,onValueChange:e=>s({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(J,{size:`sm`,"aria-label":E(),children:(0,Q.jsx)(G,{})}),(0,Q.jsx)(W,{children:Oe.map(([e,t])=>(0,Q.jsx)(V,{value:e,children:t()},e))})]})]}),a.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.autoRead,onCheckedChange:e=>s({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":M()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:M()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:me()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(B,{size:`sm`,disabled:!g||c===`saving`,onClick:()=>void _(),children:c===`saving`?O():S()}),(0,Q.jsx)(B,{variant:`outline`,size:`sm`,disabled:!a.enabled||d,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(m(!1),U(),H(),a.engine!==`gateway`){ve(i(),{lang:_e(a.lang,te()),rate:t});return}f(!0),h({instanceName:e.name,text:i()}).then(({mime:e,audioBase64:r})=>{n===$&&xe(r,e,{rate:t})}).catch(()=>{n===$&&m(!0)}).finally(()=>f(!1))},children:d?O():P()}),(0,Q.jsx)(B,{variant:`ghost`,size:`sm`,onClick:()=>{$++,f(!1),U(),H()},children:oe()})]}),c===`error`||p?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:p?I():ee()}):null]})}function Ae({stt:e}){let t=r(l.me.getMe,{host:Te}),n=v(l.admin.setFeatureEnabled),i=t?.ui?.featuresEnabled?.voiceInput===!0,o=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:T()}),(0,Q.jsx)(K,{variant:e?`secondary`:`outline`,children:e?m():d()}),(0,Q.jsx)(K,{variant:i?`secondary`:`destructive`,children:i?de():_()})]}),o?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:i,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":a()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:a()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:C()})]})}function je(){let e=r(l.admin.listInstances,{}),t=(0,Z.useMemo)(()=>Ee(),[]),n=(0,Z.useMemo)(()=>ye(),[]),{section:i}=we({from:`/settings/voice`}),a=Ce({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ce()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(K,{variant:t?`secondary`:`destructive`,children:t?le():pe()}),(0,Q.jsx)(K,{variant:n?`secondary`:`destructive`,children:n?A():se()})]}),(0,Q.jsxs)(ge,{value:i,onValueChange:e=>void a({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(he,{className:`w-full`,children:[(0,Q.jsxs)(R,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(be,{size:13,"aria-hidden":!0}),c()]}),(0,Q.jsxs)(R,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Se,{size:13,"aria-hidden":!0}),T()]}),(0,Q.jsxs)(R,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(X,{size:13,"aria-hidden":!0}),w()]})]}),(0,Q.jsx)(z,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:b()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:re()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(z,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsx)(z,{value:`talk`,children:(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:w()}),(0,Q.jsx)(K,{variant:`outline`,children:p()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:j()})]})})]})]})}export{je as VoiceTab};
@@ -1 +0,0 @@
1
- import{D as e}from"./dist-DwNg72Ge.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};