@lacneu/atrium 0.58.0 → 0.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/dist/assets/AccessTab-BBYqbyQz.js +1 -0
  2. package/dist/assets/{AdvancedFilter-CcMolhzz.js → AdvancedFilter-BTcB0NuZ.js} +1 -1
  3. package/dist/assets/AgentFilesTab-BjPywJ7Q.js +3 -0
  4. package/dist/assets/AnomaliesTab-CYpcTOYy.js +1 -0
  5. package/dist/assets/AuditTab-NnWwJHq_.js +1 -0
  6. package/dist/assets/BridgeTab-C_I81PZ8.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-STVjXTAX.js +1 -0
  8. package/dist/assets/{DataTableShell-DKcU9E8v.js → DataTableShell-DAEVsm3y.js} +1 -1
  9. package/dist/assets/{DetailChips-BHFRTi5X.js → DetailChips-DerZpgh4.js} +1 -1
  10. package/dist/assets/FeedbacksTab-BdYRB-_C.js +1 -0
  11. package/dist/assets/{FieldLabel-BhXlfWG6.js → FieldLabel-BJRoUSf1.js} +1 -1
  12. package/dist/assets/FilesTab-h10yjTHp.js +1 -0
  13. package/dist/assets/{FilterBar-BVzupjQK.js → FilterBar-Byr6OGo7.js} +1 -1
  14. package/dist/assets/GroupsTab-BJWQQexi.js +1 -0
  15. package/dist/assets/InstancesTab-ZJeQ4rRg.js +1 -0
  16. package/dist/assets/IntegrationsTab-CSOlJvFa.js +1 -0
  17. package/dist/assets/{KpiTab-CSduQ5s8.js → KpiTab-Dz5IcL9k.js} +1 -1
  18. package/dist/assets/PreferencesTab-Bd-GUi0T.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-H8zrJADs.js +4 -0
  20. package/dist/assets/RolesTab-rgpFvkKx.js +1 -0
  21. package/dist/assets/ScheduledTab-DbMIc4wG.js +1 -0
  22. package/dist/assets/ServiceAccountsTab-BeEdMciQ.js +1 -0
  23. package/dist/assets/SubAgentReportsTab-BgM9O4QZ.js +1 -0
  24. package/dist/assets/ThemeShowroom-BjDGGE3i.js +1 -0
  25. package/dist/assets/{TimeRangePicker-0VkTfHt_.js → TimeRangePicker-RVc6k7g6.js} +1 -1
  26. package/dist/assets/TracesTab-Cb65hpku.js +1 -0
  27. package/dist/assets/UsersTab-BPRPmEOS.js +1 -0
  28. package/dist/assets/VoiceTab-tgovFfm-.js +1 -0
  29. package/dist/assets/{button-B49JSqzm.js → button-Bd43O_sm.js} +1 -1
  30. package/dist/assets/{card-eKiPt2Wc.js → card-Bkvykfxh.js} +1 -1
  31. package/dist/assets/chevrons-up-down-DIXCqs3W.js +1 -0
  32. package/dist/assets/{compatView-C1X2zgFr.js → compatView-B2BXfBvC.js} +1 -1
  33. package/dist/assets/dispatchErrorInfo-DKMvYSfG.js +1 -0
  34. package/dist/assets/{dist-DCbB4klt.js → dist-CXJY_tYD.js} +1 -1
  35. package/dist/assets/dist-De2K23IB.js +44 -0
  36. package/dist/assets/{dist-BINM1nJo.js → dist-DfildYj4.js} +1 -1
  37. package/dist/assets/{dist-C0sZxuDo.js → dist-Du1hJWyV.js} +1 -1
  38. package/dist/assets/{highlighted-body-OFNGDK62-CwsFUg2x.js → highlighted-body-OFNGDK62-Dj4OC_Nj.js} +1 -1
  39. package/dist/assets/index-BlYUA3DJ.css +2 -0
  40. package/dist/assets/index-CW5WE31O.js +238 -0
  41. package/dist/assets/mermaid-GHXKKRXX-DURCfVhS.js +1 -0
  42. package/dist/assets/{pdf-BZLyWd4d.js → pdf-Bx7jp7ID.js} +1 -1
  43. package/dist/assets/roleDescriptions-zLFA4zEm.js +1 -0
  44. package/dist/assets/{table-COx9FvKU.js → table-BRilRxUj.js} +1 -1
  45. package/dist/assets/{tabs-BFg7qw3e.js → tabs-Kb2_G-yp.js} +1 -1
  46. package/dist/assets/x-DXaZHGzl.js +1 -0
  47. package/dist/index.html +8 -8
  48. package/package.json +1 -1
  49. package/dist/assets/AccessTab-CSh3tcHp.js +0 -1
  50. package/dist/assets/AgentFilesTab-DD7nQPIs.js +0 -3
  51. package/dist/assets/AnomaliesTab-CGUn5M38.js +0 -1
  52. package/dist/assets/AuditTab-BAmXWdpn.js +0 -1
  53. package/dist/assets/BridgeTab-B6u6wsyS.js +0 -1
  54. package/dist/assets/ChatDefaultsTab-T-SjwUiO.js +0 -1
  55. package/dist/assets/FeedbacksTab-BTNSHMXX.js +0 -1
  56. package/dist/assets/FilesTab-CQ9OQmvl.js +0 -1
  57. package/dist/assets/GroupsTab-DQ1ql751.js +0 -1
  58. package/dist/assets/InstancesTab-DnDS69jL.js +0 -1
  59. package/dist/assets/IntegrationsTab-x8aaAzQY.js +0 -1
  60. package/dist/assets/PreferencesTab-DylL7Q2H.js +0 -1
  61. package/dist/assets/PromptInjectionsTab-DbjWSlzY.js +0 -4
  62. package/dist/assets/RolesTab-Bx3akDip.js +0 -1
  63. package/dist/assets/ScheduledTab-nsdy0Bh_.js +0 -1
  64. package/dist/assets/ServiceAccountsTab-D8rsyxJF.js +0 -1
  65. package/dist/assets/SubAgentReportsTab-CSj0Hba1.js +0 -1
  66. package/dist/assets/ThemeShowroom-BwmvZBXd.js +0 -1
  67. package/dist/assets/TracesTab-QD7eyy39.js +0 -1
  68. package/dist/assets/UsersTab-C0eniehN.js +0 -1
  69. package/dist/assets/VoiceTab-BRfeYXDu.js +0 -1
  70. package/dist/assets/chevrons-up-down-CWDbG1Cy.js +0 -1
  71. package/dist/assets/dispatchErrorInfo-DdP7JU_7.js +0 -1
  72. package/dist/assets/dist-CjH9Ohdx.js +0 -44
  73. package/dist/assets/index-CAAremuB.css +0 -2
  74. package/dist/assets/index-DnuEILeM.js +0 -238
  75. package/dist/assets/mermaid-GHXKKRXX-d9fLQ_Fe.js +0 -1
  76. package/dist/assets/roleDescriptions-C6Gqx97s.js +0 -1
  77. package/dist/assets/x-DYJkW-kP.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-CjH9Ohdx.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-CjH9Ohdx.js";import{t as d}from"./dist-DCbB4klt.js";import{At as f,jt as p,kt as m}from"./index-DnuEILeM.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-CW5WE31O.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,15 +62,15 @@
62
62
  document.documentElement.dataset.motion = "static";
63
63
  })();
64
64
  </script>
65
- <script type="module" crossorigin src="/assets/index-DnuEILeM.js"></script>
65
+ <script type="module" crossorigin src="/assets/index-CW5WE31O.js"></script>
66
66
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
67
- <link rel="modulepreload" crossorigin href="/assets/dist-CjH9Ohdx.js">
68
- <link rel="modulepreload" crossorigin href="/assets/dist-DCbB4klt.js">
69
- <link rel="modulepreload" crossorigin href="/assets/dist-BINM1nJo.js">
70
- <link rel="modulepreload" crossorigin href="/assets/dist-C0sZxuDo.js">
71
- <link rel="modulepreload" crossorigin href="/assets/x-DYJkW-kP.js">
72
- <link rel="modulepreload" crossorigin href="/assets/button-B49JSqzm.js">
73
- <link rel="stylesheet" crossorigin href="/assets/index-CAAremuB.css">
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
+ <link rel="stylesheet" crossorigin href="/assets/index-BlYUA3DJ.css">
74
74
  </head>
75
75
  <body>
76
76
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lacneu/atrium",
3
- "version": "0.58.0",
3
+ "version": "0.60.0",
4
4
  "description": "Atrium — public, self-hostable, Convex-backed web chat UI for AI agent gateways (OpenClaw today, Hermes next). Ships an origin-agnostic static bundle (Convex URL injected at runtime via /config.json).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ad as r,Cd as i,Dd as a,E as o,EP as s,Ed as c,FP as l,Md as u,Nd as d,Od as f,Pd as p,Sd as m,Td as h,bd as g,jd as _,kd as v,wd as y,xd as b}from"./dist-CjH9Ohdx.js";import{C as x,S,T as C,dt as w,w as T,x as E}from"./index-DnuEILeM.js";var D=t(e(),1);function O(e){return e===`user`?y():e===`all`?i():m({group:e.group})}function k(e){return e===`common`?b():e===`owner`?g():m({group:e.group})}var A=n();function j(e){return e.name||e.email||e.userId.slice(0,8)}function M(){let e=l(o.admin.listUsers,{}),[t,n]=(0,D.useState)(``),i=l(o.introspect.introspectUser,t?{userId:t}:`skip`);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:p()}),(0,A.jsxs)(E,{value:t,onValueChange:n,children:[(0,A.jsx)(T,{size:`sm`,"aria-label":d(),children:(0,A.jsx)(C,{placeholder:d()})}),(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:u()}):i===void 0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:s()}):(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:r()}),i.groups.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):(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:v()}),i.agents.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):(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:h()}):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:f()}),i.charts.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):(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:a()}),i.permissions.length===0?(0,A.jsx)(`p`,{className:`oc-admin__hint`,children:c()}):(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{$c as r,$r as i,Bc as a,Br as o,DD as s,E as c,EP as l,FP as u,Gc as d,Hc as f,Hr as p,Jc as m,Kc as h,Lr as g,MP as _,OP as v,PP as y,Qc as b,Ql as x,Qr as S,Rr as C,Uc as w,Ur as T,Vc as E,Vr as D,Wc as O,Xc as k,Xl as ee,Xr as A,Yc as j,Zc as M,Zr as N,ai as P,al as te,ci as F,cl as I,di as L,dl as R,ei as ne,el as re,fi as ie,fl as z,gi as B,hi as V,hl as H,ii as U,il as W,li as G,ll as ae,mi as oe,ml as se,ni as ce,nl as le,oi as ue,ol as de,pi as fe,pl as pe,qc as me,ri as he,rl as ge,si as _e,sl as ve,ti as ye,tl as be,ui as xe,ul as Se,zr as Ce}from"./dist-CjH9Ohdx.js";import{t as K}from"./button-B49JSqzm.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-DnuEILeM.js";import{n as Ge,t as Ke}from"./curation-CQksaIbm.js";import{i as qe}from"./compatView-C1X2zgFr.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=u(c.me.getMe,{host:Ue}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),r=u(c.admin.listInstances,e!==void 0&&t?{}:`skip`),[i,a]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!t||!r||r.length===0||(!i||!r.some(e=>e.name===i))&&a(r[0].name)},[t,r,i]);let o=u(c.agents.listAgentsForInstance,t&&i?{instanceName:i}:`skip`),s=u(c.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),d=(0,Y.useMemo)(()=>{if(e!==void 0){if(t)return i===null||o===void 0?r!==void 0&&r.length===0?[]:void 0:o.agents.map(e=>({instanceName:i,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}));if(s!==void 0)return s.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,i,o,r,s]),[f,p]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!d||d.length===0||(!f||!d.some(e=>$(e)===f))&&p($(d[0]))},[d,f]);let m=d?.find(e=>$(e)===f)??null,h=_(c.agentFiles.listAgentFiles),[g,y]=(0,Y.useState)({status:`idle`}),b=m?.instanceName??null,x=m?.agentId??null,S=u(c.compat.forInstance,n&&b!==null?{instanceName:b}:`skip`),C=n&&b!==null?Fe(S,`agentFiles`):null,w=C===null?!1:C===`loading`?null:C.blocked,T=(0,Y.useCallback)(async()=>{if(!(b===null||x===null)){y({status:`loading`});try{y({status:`done`,files:(await h({instanceName:b,agentId:x})).files})}catch{y({status:`error`})}}},[h,b,x]);(0,Y.useEffect)(()=>{w===!1&&T()},[T,w]);let[E,D]=(0,Y.useState)(null),O=u(c.agentFileCuration.listCurations,t&&b!==null&&x!==null?{instanceName:b,agentId:x}:`skip`),k=u(c.agentFileCuration.curationSettings,t&&b!==null?{instanceName:b}:`skip`),A=_(c.agentFileCuration.requestCuration),[j,M]=(0,Y.useState)(null),[N,P]=(0,Y.useState)(null),{toast:F}=q(),ne=(0,Y.useMemo)(()=>{let e=new Map;for(let t of O??[])e.has(t.name)||e.set(t.name,t);return e},[O]),re=(0,Y.useCallback)(async e=>{if(!(b===null||x===null)){M(e);try{let t=await A({instanceName:b,agentId:x,name:e,trigger:`manual`});t.ok?F({title:fe(),variant:`success`}):F({title:ie({reason:t.reason??`unknown`}),variant:`error`})}catch{F({title:L(),variant:`error`})}finally{M(null)}}},[A,b,x,F]),B=v(),V=(0,Y.useMemo)(()=>new Intl.NumberFormat(B,{maximumFractionDigits:0}),[B]);return e===void 0||d===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:H()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(r?.length??0)>1?(0,Q.jsxs)(We,{value:i??``,onValueChange:e=>a(e),children:[(0,Q.jsx)(He,{size:`sm`,"aria-label":se(),children:(0,Q.jsx)(Ae,{})}),(0,Q.jsx)(ke,{children:(r??[]).map(e=>(0,Q.jsx)(we,{value:e.name,children:e.name},e.name))})]}):null,d.length>0?(0,Q.jsxs)(We,{value:f??``,onValueChange:e=>p(e),children:[(0,Q.jsx)(He,{size:`sm`,"aria-label":pe(),children:(0,Q.jsx)(Ae,{})}),(0,Q.jsx)(ke,{children:d.map(e=>(0,Q.jsx)(we,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:z()})]}),m===null?null:C===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):C!==null&&C.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(J,{size:14,"aria-hidden":!0}),` `,qe(C.gatewayVersion,C.provider)]}):g.status===`loading`||g.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):g.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[Se(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void T(),children:ee()})]}):g.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:R()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:g.files.map(e=>{let n=Ye(e.size),r=n>=80;return(0,Q.jsxs)(`div`,{className:`oc-afiles__row`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__name`,title:e.name,children:e.name}),e.missing?(0,Q.jsx)(Ie,{variant:`outline`,children:ae()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:I({size:Z(e.size,B)})}),(0,Q.jsx)(`span`,{className:`oc-afiles__gauge${r?` is-warn`:``}`,"aria-hidden":!0,children:(0,Q.jsx)(`span`,{className:`oc-afiles__gauge-fill`,style:{width:`${Math.min(n,100)}%`}})}),(0,Q.jsx)(`span`,{className:`oc-afiles__pct`,children:ve({pct:V.format(n)})}),r?(0,Q.jsx)(J,{size:14,className:`oc-afiles__warn`,"aria-label":de()}):(0,Q.jsx)(`span`,{className:`oc-afiles__warn-slot`,"aria-hidden":!0})]}),(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__open`,onClick:()=>D(e),children:t?W():ge()}),t&&!e.missing?(0,Q.jsx)(nt,{curatable:Ke.includes(e.name),size:e.size??0,budget:k?.budgetChars??null,enabled:k?.enabled??!1,curation:ne.get(e.name)??null,inFlight:j===e.name,onCurate:()=>void re(e.name),onReview:e=>P(e)}):null]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:te({used:Z(Ze(g.files),B),total:Z(Je,B),pct:V.format(Xe(Ze(g.files)))})})]}),E&&m?(0,Q.jsx)(rt,{instanceName:m.instanceName,agentId:m.agentId,name:E.name,isAdmin:t,onClose:()=>D(null),onSaved:()=>void T()}):null,N?(0,Q.jsx)(it,{curationId:N,onClose:()=>P(null),onApplied:()=>{P(null),T()}}):null]})}function nt({curatable:e,size:t,budget:n,enabled:r,curation:i,inFlight:a,onCurate:o,onReview:s}){return i?.status===`proposed`?(0,Q.jsx)(K,{variant:`default`,size:`sm`,className:`oc-afiles__curate`,onClick:()=>s(i._id),children:V()}):a||i?.status===`dispatched`||i?.status===`applying`?(0,Q.jsx)(Ie,{variant:`outline`,className:`oc-afiles__curate-status`,children:oe()}):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:i,onClose:o,onSaved:u}){let p=_(c.agentFiles.getAgentFile),g=_(c.agentFiles.setAgentFile),y=q(),[S,C]=(0,Y.useState)(null),[T,D]=(0,Y.useState)(!1),[A,N]=(0,Y.useState)(``),[P,te]=(0,Y.useState)(!1),[F,I]=(0,Y.useState)(!1),[L,R]=(0,Y.useState)(!1),[ne,ie]=(0,Y.useState)(!1),z=(0,Y.useCallback)(async r=>{D(!1);try{let i=await p({instanceName:e,agentId:t,name:n});C({content:i.content,updatedAtMs:i.updatedAtMs}),r||N(i.content),R(!1)}catch{D(!0)}},[p,e,t,n]);(0,Y.useEffect)(()=>{z(!1)},[z]);async function B(){if(S!==null){I(!0),ie(!1);try{await g({instanceName:e,agentId:t,name:n,content:A,baseUpdatedAtMs:S.updatedAtMs??void 0}),y.success(k({name:n})),u(),await z(!1)}catch(e){et(e)?R(!0):ie(!0)}finally{I(!1)}}}let V=S!==null&&A!==S.content,H=(0,Y.useMemo)(()=>S===null?null:$e(S.content,A),[S,A]),U=A.length>X,W=v(),G=(0,Y.useMemo)(()=>new Intl.NumberFormat(W),[W]);return(0,Q.jsx)(ze,{open:!0,onOpenChange:e=>!e&&o(),children:(0,Q.jsxs)(Re,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(Pe,{children:[(0,Q.jsx)(Ve,{children:le({name:n})}),(0,Q.jsxs)(Le,{children:[be({agent:t,instance:e}),i?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,re()]})]})]}),T?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[m(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void z(!1),children:ee()})]}):S===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:A,readOnly:!i,spellCheck:!1,onChange:e=>N(e.target.value),"aria-label":le({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:r()}),L?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[me(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void z(!0),children:h()})]}):null,ne?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:j()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${U?` is-over`:``}`,children:b({count:G.format(A.length),max:G.format(X)})}),i?(0,Q.jsx)(K,{size:`sm`,disabled:!V||F||L,onClick:()=>te(!0),children:F?x():M()}):null]})]}),(0,Q.jsx)(Te,{open:P,onOpenChange:te,children:(0,Q.jsxs)(Ee,{children:[(0,Q.jsxs)(Ne,{children:[(0,Q.jsx)(Oe,{children:d({name:n})}),(0,Q.jsx)(Me,{children:O({agent:t})})]}),H?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:w({added:H.added,removed:H.removed})}),H.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:f()}),H.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,H.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:E()}),H.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(je,{children:[(0,Q.jsx)(Be,{children:s()}),(0,Q.jsx)(De,{onClick:()=>void B(),children:a()})]})]})})]})})}function it({curationId:e,onClose:t,onApplied:n}){let r=u(c.agentFileCuration.getProposal,{curationId:e}),a=_(c.agentFileCuration.approveCuration),s=y(c.agentFileCuration.rejectCuration),{toast:d}=q(),[f,m]=(0,Y.useState)(null),[h,b]=(0,Y.useState)(!1),[w,E]=(0,Y.useState)(``),O=v(),k=(0,Y.useMemo)(()=>r?$e(r.beforeContent,r.proposedContent):null,[r]);async function ee(){m(`approve`);try{let t=await a({curationId:e});t.ok?(d({title:xe(),variant:`success`}),n()):d({title:t.reason===`conflict`?F():_e({reason:t.reason??`unknown`}),variant:`error`})}catch{d({title:L(),variant:`error`})}finally{m(null)}}async function j(n){m(`reject`);try{let r=w.trim();(await s({curationId:e,...r?{comment:r}:{},relaunch:n})).ok?d({title:n?C():G(),variant:`success`}):d({title:U(),variant:`error`}),t()}catch{d({title:L(),variant:`error`})}finally{m(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:r?ue({name:r.name}):l()}),(0,Q.jsx)(Le,{children:P()})]}),r===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:U()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`oc-afiles__review-sizes`,children:[he({before:Z(r.beforeSize,O),after:Z(r.proposedSize,O)}),r.overBudget?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsx)(J,{size:13,"aria-hidden":!0}),` `,ce()]}):null]}),k?(0,Q.jsx)(`p`,{className:`oc-afiles__review-diff`,children:ye({added:k.added,removed:k.removed})}):null,r.feedback?(0,Q.jsx)(`p`,{className:`oc-afiles__review-feedback`,children:g({feedback:r.feedback})}):null,k&&k.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__review-removed`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:A()}),(0,Q.jsx)(`ul`,{children:k.sampleRemoved.map((e,t)=>(0,Q.jsx)(`li`,{children:e||`\xA0`},t))})]}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__review-panes oc-afiles__review-panes--2`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:N()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.beforeContent})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:ne()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:r.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:T()}),(0,Q.jsx)(`textarea`,{id:`curation-reject-comment`,className:`oc-afiles__reject-textarea`,rows:3,placeholder:p(),value:w,onChange:e=>E(e.target.value)}),(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`ghost`,onClick:()=>b(!1),disabled:f!==null,children:D()}),(0,Q.jsx)(K,{variant:`outline`,onClick:()=>void j(!1),disabled:f!==null,children:f===`reject`?x():o()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void j(!0),disabled:f!==null,children:f===`reject`?x():Ce()})]})]}):(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`outline`,onClick:()=>b(!0),disabled:f!==null||r==null,children:i()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void ee(),disabled:f!==null||r==null,children:f===`approve`?x():S()})]})]})})}export{tt as AgentFilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$y as r,Ay as i,By as ee,Cy as te,Dy as ne,E as a,Ey as re,FP as o,Fy as s,Gy as c,Hy as ie,Iy as ae,Jy as oe,Ky as se,Ly as ce,My as l,Ny as le,Oy as ue,PP as de,Py as u,Qy as fe,Ry as pe,Sy as d,Ty as f,Uy as p,Vy as m,Wy as h,Xy as me,Yy as he,Zy as ge,_y as g,by as _e,dy as _,eb as ve,fy as v,gy as y,hy as b,jy as ye,ky as x,my as S,nb as C,py as w,qy as T,rb as E,tb as D,vy as O,wy as k,xy as A,yy as j,zy as M}from"./dist-CjH9Ohdx.js";import{C as N,H as P,S as F,T as I,U as be,_t as L,dt as R,i as xe,mt as z,nn as B,o as Se,pt as V,rn as Ce,rt as we,vt as H,w as U,wt as Te,x as W}from"./index-DnuEILeM.js";import{n as Ee}from"./TimeRangePicker-0VkTfHt_.js";import{t as De}from"./FilterBar-BVzupjQK.js";import{t as Oe}from"./DataTableShell-DKcU9E8v.js";import{t as G}from"./dispatchErrorInfo-DdP7JU_7.js";var K=t(e(),1),q=n(),J=`__all__`,ke=[{value:`open`},{value:`acknowledged`},{value:`resolved`}];function Ae(e){return e===`open`?E():e===`acknowledged`?C():D()}var je=[`info`,`warn`,`critical`],Me=[`detector`,`agent`,`user`],Ne={kind:`relative`,from:`now-30d`,to:`now`},Pe=200,Y=`all`;function X(){let e=Ce({from:`/settings/anomalies`}),t=B({from:`/settings/anomalies`}),n=e.q??``,g=e.status===Y?J:e.status,_=e.severity??J,v=e.kind??J,[y,b]=(0,K.useState)(J),S=xe(e.from,e.to),{from:C,to:w}=Ee(S),E=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),D=e=>void t({search:t=>({...t,status:e===J?Y:e})}),O=e=>void t({search:t=>({...t,severity:e===J?void 0:e})}),L=e=>void t({search:t=>({...t,kind:e===J?void 0:e})}),z=e=>void t({search:t=>({...t,...Se(e)})}),V=be(),H=P(),G=de(a.anomalies.resolveAnomaly),X=(o(a.me.getMe,{host:Te})?.permissions??[]).includes(`admin.manage`),Z=o(a.anomalies.listAnomalies,{limit:Pe,filter:{q:n||void 0,from:C,to:w,anomalyStatus:g===J?void 0:g,severity:_===J?void 0:_,source:y===J?void 0:y,kind:v===J?void 0:v}}),Q=(0,K.useMemo)(()=>{let e=new Set;for(let t of Z??[])e.add(t.kind);return[...e].sort()},[Z]),ze=n!==``||g!==`open`||_!==J||y!==J||v!==J||S.kind!==`relative`||S.from!==Ne.from;function Be(){b(J),t({search:{status:`open`},replace:!0})}async function Ve(e){if(await V({title:ve(),description:(0,q.jsxs)(q.Fragment,{children:[r(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.kind}),` `,fe(),` `,(0,q.jsx)(`strong`,{children:ge()}),`.`,` `,me()]}),confirmLabel:he()}))try{await G({anomalyId:e._id,status:`resolved`}),H.success(oe(),e.kind)}catch(e){H.error(T(),e)}}async function He(e){try{await G({anomalyId:e._id,status:`acknowledged`}),H.success(se(),e.kind)}catch(e){H.error(c(),e)}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`p`,{className:`oc-admin__hint`,children:[h(),` `,(0,q.jsx)(`strong`,{children:p()}),` `,ie(),` `,(0,q.jsx)(`strong`,{children:m()}),` `,ee(),` `,(0,q.jsx)(`strong`,{children:M()}),` `,pe(),` `,(0,q.jsx)(`span`,{className:`oc-filter__window`,children:ce()})]}),(0,q.jsxs)(De,{q:n,onQChange:E,searchPlaceholder:ae(),timeRange:S,onTimeRangeChange:z,onReset:Be,canReset:ze,children:[(0,q.jsxs)(W,{value:g,onValueChange:D,children:[(0,q.jsx)(U,{size:`sm`,className:`w-36`,children:(0,q.jsx)(I,{})}),(0,q.jsxs)(F,{children:[(0,q.jsx)(N,{value:J,children:s()}),ke.map(e=>(0,q.jsx)(N,{value:e.value,children:Ae(e.value)},e.value))]})]}),(0,q.jsxs)(W,{value:_,onValueChange:O,children:[(0,q.jsx)(U,{size:`sm`,className:`w-36`,children:(0,q.jsx)(I,{placeholder:u()})}),(0,q.jsxs)(F,{children:[(0,q.jsx)(N,{value:J,children:le()}),je.map(e=>(0,q.jsx)(N,{value:e,children:e},e))]})]}),(0,q.jsxs)(W,{value:y,onValueChange:b,children:[(0,q.jsx)(U,{size:`sm`,className:`w-32`,children:(0,q.jsx)(I,{placeholder:l()})}),(0,q.jsxs)(F,{children:[(0,q.jsx)(N,{value:J,children:ye()}),Me.map(e=>(0,q.jsx)(N,{value:e,children:e},e))]})]}),(0,q.jsxs)(W,{value:v,onValueChange:L,children:[(0,q.jsx)(U,{size:`sm`,className:`w-36`,children:(0,q.jsx)(I,{placeholder:i()})}),(0,q.jsxs)(F,{children:[(0,q.jsx)(N,{value:J,children:x()}),Q.map(e=>(0,q.jsx)(N,{value:e,children:e},e))]})]})]}),(0,q.jsx)(Oe,{title:ue(),rows:Z,emptyHint:g===`open`?ne():re(),rowActions:e=>X&&e.status===`open`?[{label:f(),onSelect:()=>void Ve(e)},{label:k(),onSelect:()=>void He(e)}]:[],columns:[{header:te(),cell:e=>(0,q.jsx)(`span`,{className:`oc-traces__time`,children:we(e.at)}),sort:e=>e.at},{header:i(),cell:e=>(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:e.kind}),sort:e=>e.kind},{header:u(),cell:e=>(0,q.jsx)(Le,{severity:e.severity}),sort:e=>e.severity===`critical`?2:+(e.severity===`warn`)},{header:d(),cell:e=>(0,q.jsx)(Re,{status:e.status}),sort:e=>e.status===`resolved`?2:+(e.status===`acknowledged`)},{header:l(),cell:e=>(0,q.jsx)(R,{variant:`outline`,children:e.source}),sort:e=>e.source},{header:A(),cell:e=>(0,q.jsxs)(`div`,{className:`oc-anomaly__msgcell`,children:[(0,q.jsx)(`span`,{className:`oc-anomaly__msg`,children:e.message}),(0,q.jsx)(Ie,{row:e})]}),sort:e=>e.message},{header:_e(),cell:e=>(0,q.jsx)(Fe,{row:e}),sort:e=>e.evidence??null},{header:j(),cell:e=>e.correlationId?(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.correlationId)}):(0,q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}),sort:e=>e.correlationId}]})]})}function Z(e){if(e.kind!==`openclaw.dispatch_failures`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{dominantCode:t.dominantCode,sampleCorrelationId:t.sampleCorrelationId}}catch{return{}}}function Q(e){if(e.kind!==`subagent.failure`||!e.evidence)return{};try{let t=JSON.parse(e.evidence);return{failedCount:t.failedCount,totalCount:t.totalCount,errorCategories:t.errorCategories}}catch{return{}}}function Fe({row:e}){let t=B();if(e.kind===`subagent.failure`){let n=Q(e);return(0,q.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,q.jsx)(`div`,{className:`oc-anomaly__cause-head`,children:[...new Set(n.errorCategories??[])].map(e=>(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:e},e))}),e.correlationId?(0,q.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:e.correlationId,limit:100}}),children:[`↗ `,O()]}):null]})}let n=Z(e);if(!n.dominantCode)return(0,q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`});let r=G(n.dominantCode),i=n.sampleCorrelationId;return(0,q.jsxs)(`div`,{className:`oc-anomaly__cause`,children:[(0,q.jsxs)(`div`,{className:`oc-anomaly__cause-head`,children:[(0,q.jsx)(`span`,{className:`oc-anomaly__cause-label`,children:r.label}),(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:n.dominantCode})]}),(0,q.jsx)(`p`,{className:`oc-anomaly__cause-hint`,children:r.hint}),i?(0,q.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>void t({to:`/settings/traces`,search:{q:i,limit:100}}),children:[`↗ `,O()]}):null]})}function Ie({row:e}){let[t,n]=(0,K.useState)(!1),r=o(a.anomalies.getAnomalyAttachments,t?{anomalyId:e._id}:`skip`);return!e.attachments||e.attachments.length===0?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`button`,{type:`button`,className:`oc-anomaly__drill`,onClick:()=>n(!0),children:[g(),e.attachments.length>1?` (${e.attachments.length})`:``]}),(0,q.jsx)(V,{open:t,onOpenChange:n,children:(0,q.jsxs)(z,{className:`oc-anomaly__attachments-dialog`,children:[(0,q.jsx)(L,{children:(0,q.jsx)(H,{children:y()})}),r===void 0?(0,q.jsx)(`p`,{className:`oc-traces__muted`,children:b()}):r.length===0?(0,q.jsx)(`p`,{className:`oc-traces__muted`,children:S()}):(0,q.jsx)(`div`,{className:`oc-anomaly__attachments`,children:r.map(e=>(0,q.jsxs)(`section`,{className:`oc-anomaly__attachment`,children:[(0,q.jsx)(`h4`,{className:`oc-anomaly__attachment-name`,children:(0,q.jsx)(`code`,{className:`oc-traces__mono`,children:e.name})}),(0,q.jsx)(`pre`,{className:`oc-anomaly__attachment-content`,children:e.content})]},e.name))})]})})]})}function Le({severity:e}){return(0,q.jsx)(`span`,{className:`oc-anomaly__sev oc-anomaly__sev--${e}`,children:e})}function Re({status:e}){return e===`open`?(0,q.jsx)(R,{variant:`destructive`,children:w()}):e===`acknowledged`?(0,q.jsx)(R,{variant:`secondary`,children:v()}):(0,q.jsx)(R,{variant:`outline`,children:_()})}function $(e){return e.length>8?e.slice(0,8):e}export{X as AnomaliesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$b as r,E as i,FP as a,Fn as o,In as s,Jb as c,Ln as l,Pn as u,Qb as d,Rn as f,Xb as p,Yb as m,Zb as h,ax as g,cx as _,ex as v,ix as y,nx as b,ox as x,rx as S,sx as C,tx as w,zn as T}from"./dist-CjH9Ohdx.js";import{C as E,S as D,T as O,a as k,i as A,n as j,nn as M,o as N,rn as P,rt as F,s as I,w as L,x as R}from"./index-DnuEILeM.js";import{n as ee}from"./TimeRangePicker-0VkTfHt_.js";import{t as z}from"./FilterBar-BVzupjQK.js";import{t as B}from"./AdvancedFilter-CcMolhzz.js";import{t as V}from"./DataTableShell-DKcU9E8v.js";var H=t(e(),1),U=n(),W={kind:`relative`,from:j,to:`now`},G=`__all__`,K=[{value:`action`,label:T()},{value:`realLabel`,label:f()},{value:`targetLabel`,label:l()},{value:`impersonated`,label:s()},{value:`resource`,label:o()},{value:`resourceId`,label:u()}];function q(){let e=P({from:`/settings/audit`}),t=M({from:`/settings/audit`}),n=e.q??``,o=e.action??G,s=e.impersonated??G,l=e.resource??G,u=A(e.from,e.to),f=(0,H.useMemo)(()=>I(e.adv),[e.adv]),{from:T,to:j}=ee(u),q=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),J=e=>void t({search:t=>({...t,action:e===G?void 0:e})}),Y=e=>void t({search:t=>({...t,impersonated:e===G?void 0:e})}),X=e=>void t({search:t=>({...t,resource:e===G?void 0:e})}),Z=e=>void t({search:t=>({...t,...N(e)})}),Q=e=>void t({search:t=>({...t,adv:k(e)}),replace:!0}),$=a(i.admin.listAudit,{filter:{q:n||void 0,from:T,to:j,action:o===G?void 0:o,resource:l===G?void 0:l,impersonated:s===G?void 0:s===`yes`,advanced:f.length>0?f:void 0}}),te=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])e.add(t.action);return[...e].sort()},[$]),ne=(0,H.useMemo)(()=>{let e=new Set;for(let t of $??[])t.resource&&e.add(t.resource);return[...e].sort()},[$]),re=n!==``||o!==G||s!==G||l!==G||f.length>0||u.kind!==`relative`||u.from!==W.from;function ie(){t({search:{},replace:!0})}return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{className:`oc-admin__hint`,children:[_(),` `,(0,U.jsx)(`span`,{className:`oc-filter__window`,children:C()})]}),(0,U.jsxs)(z,{q:n,onQChange:q,searchPlaceholder:x(),timeRange:u,onTimeRangeChange:Z,onReset:ie,canReset:re,children:[(0,U.jsxs)(R,{value:o,onValueChange:J,children:[(0,U.jsx)(L,{size:`sm`,className:`w-40`,children:(0,U.jsx)(O,{placeholder:g()})}),(0,U.jsxs)(D,{children:[(0,U.jsx)(E,{value:G,children:y()}),te.map(e=>(0,U.jsx)(E,{value:e,children:e},e))]})]}),(0,U.jsxs)(R,{value:s,onValueChange:Y,children:[(0,U.jsx)(L,{size:`sm`,className:`w-40`,children:(0,U.jsx)(O,{})}),(0,U.jsxs)(D,{children:[(0,U.jsx)(E,{value:G,children:S()}),(0,U.jsx)(E,{value:`yes`,children:b()}),(0,U.jsx)(E,{value:`no`,children:w()})]})]}),(0,U.jsxs)(R,{value:l,onValueChange:X,children:[(0,U.jsx)(L,{size:`sm`,className:`w-40`,children:(0,U.jsx)(O,{placeholder:v()})}),(0,U.jsxs)(D,{children:[(0,U.jsx)(E,{value:G,children:r()}),ne.map(e=>(0,U.jsx)(E,{value:e,children:e},e))]})]})]}),(0,U.jsx)(B,{fields:K,seed:f,onChange:Q}),(0,U.jsx)(V,{title:d(),rows:$,emptyHint:h(),columns:[{header:p(),cell:e=>F(e.at),sort:e=>e.at},{header:g(),cell:e=>e.action,sort:e=>e.action},{header:m(),cell:e=>e.realLabel,sort:e=>e.realLabel},{header:c(),cell:e=>e.targetLabel??`—`,sort:e=>e.targetLabel??null},{header:v(),cell:e=>e.resource?e.resource+(e.resourceId?` · ${e.resourceId.slice(0,8)}`:``):`—`,sort:e=>e.resource??null}]})]})}export{q as AuditTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$g as r,$h as i,Ag as a,Bh as o,Cc as s,Cg as c,D as l,Dc as u,Dg as d,E as f,Ec as p,Eg as m,FP as h,Fh as g,Gh as _,Hh as v,Ih as y,Jh as b,Kh as x,Lh as S,MP as ee,Nh as C,Oc as w,Og as te,PP as ne,Ph as T,Qg as re,Qh as ie,Rh as ae,Sc as oe,Sg as se,Tc as ce,Tg as le,Uh as ue,Vh as de,Wh as fe,Xh as pe,Yh as me,Zh as he,_c as ge,_g as _e,a_ as ve,ag as ye,an as be,bc as xe,bg as Se,c_ as Ce,cg as E,d_ as we,dg as Te,eg as Ee,f_ as De,fg as Oe,gg as ke,hg as Ae,i_ as je,ig as Me,in as Ne,kc as Pe,kg as Fe,l_ as Ie,lg as Le,ln as Re,mg as ze,n_ as Be,ng as Ve,nn as He,o_ as Ue,og as We,on as Ge,pc as Ke,pg as qe,qh as D,r_ as Je,rg as Ye,rn as Xe,s_ as Ze,sg as Qe,tg as $e,ug as et,vc as tt,vg as nt,wc as O,wg as rt,xc as it,xg as at,yc as ot,yg as st,zh as ct}from"./dist-CjH9Ohdx.js";import{i as k,r as lt}from"./dist-DCbB4klt.js";import{t as ut}from"./chevrons-up-down-CWDbG1Cy.js";import{i as dt,n as A,o as ft,r as pt,s as mt}from"./FieldLabel-BhXlfWG6.js";import{i as ht,n as gt,r as _t,t as vt}from"./tabs-BFg7qw3e.js";import{t as j}from"./button-B49JSqzm.js";import{$ as yt,$t as M,C as N,H as bt,Kt as xt,Lt as St,Pt as P,S as F,T as I,_t as Ct,dt as L,en as wt,et as Tt,ft as R,h as Et,ht as Dt,it as z,m as Ot,mt as kt,nn as At,pt as jt,rn as Mt,rt as Nt,tt as Pt,vt as Ft,w as B,wt as It,x as V}from"./index-DnuEILeM.js";import{r as Lt}from"./locales-CPjguROj.js";import{a as Rt,i as H,n as zt,o as U,r as W,t as Bt}from"./table-COx9FvKU.js";import{t as Vt}from"./FilterBar-BVzupjQK.js";import{a as Ht,n as Ut,o as Wt,r as Gt,s as Kt,t as qt}from"./compatView-C1X2zgFr.js";import{t as G}from"./dispatchErrorInfo-DdP7JU_7.js";var Jt=l(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Yt=l(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),K=t(e(),1);function Xt(e){return e.filter(e=>e.state===`error`)}function Zt(e){return e.reachable&&Xt(e.targets).length===0}function Qt(e){return Zt(e)?(e.unreachableInstances??[]).length>0?`gateways_unreachable`:`ok`:`error`}function $t(e){return e.state===`error`&&e.lastErrorCode!==null}function en(e){return!!e.lastDownstreamRejectCode}function q(e){return e.kind??`openclaw`}function tn(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function nn(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,q(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(q(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return tn(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>q(e)===r)}))}function J(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var Y=`__all__`,rn={q:``,state:Y,instance:Y,version:Y},X={connected:0,error:1,idle:2};function an(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function on(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function Z(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function sn(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function cn(e,t,n){switch(e){case`state`:return(X[t.state]??99)-(X[n.state]??99);case`instance`:return Z(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return Z(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return Wt(e,r)??Z(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return Z(t.targetLabel,n.targetLabel)}}function ln(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=sn(t.key,e),a=sn(t.key,r);return i&&a?0:i?1:a?-1:n*cn(t.key,e,r)})}function un(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(X[e]??99)-(X[t]??99))}function dn(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>Z(e.label,t.label))}function fn(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>Wt(e,t)??Z(e,t))}var Q=n();function pn({connections:e,displayByInstance:t}){let[n,r]=(0,K.useState)(rn),[i,a]=(0,K.useState)(null),s=(0,K.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount+(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]),c=(0,K.useMemo)(()=>un(s),[s]),l=(0,K.useMemo)(()=>dn(s),[s]),u=(0,K.useMemo)(()=>fn(s),[s]),d=(0,K.useMemo)(()=>ln(on(s,n),i),[s,n,i]);function f(e){a(t=>t?.key===e?t.dir===`asc`?{key:e,dir:`desc`}:null:{key:e,dir:`asc`})}return e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:he()}):(0,Q.jsxs)(`div`,{className:`oc-conn`,children:[(0,Q.jsxs)(Vt,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:b(),onReset:()=>r(rn),canReset:an(n),children:[(0,Q.jsxs)(V,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Q.jsx)(B,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(I,{placeholder:x()})}),(0,Q.jsxs)(F,{children:[(0,Q.jsx)(N,{value:Y,children:D()}),c.map(e=>(0,Q.jsx)(N,{value:e,children:hn(e)},e))]})]}),(0,Q.jsxs)(V,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Q.jsx)(B,{size:`sm`,className:`w-40`,children:(0,Q.jsx)(I,{placeholder:_()})}),(0,Q.jsxs)(F,{children:[(0,Q.jsx)(N,{value:Y,children:D()}),l.map(e=>(0,Q.jsx)(N,{value:e.name,children:e.label},e.name))]})]}),(0,Q.jsxs)(V,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Q.jsx)(B,{size:`sm`,className:`w-36`,children:(0,Q.jsx)(I,{placeholder:fe()})}),(0,Q.jsxs)(F,{children:[(0,Q.jsx)(N,{value:Y,children:D()}),u.map(e=>(0,Q.jsx)(N,{value:e,children:e},e))]})]})]}),d.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ue()}):(0,Q.jsxs)(Bt,{className:`oc-conn__table`,children:[(0,Q.jsx)(Rt,{children:(0,Q.jsxs)(U,{children:[(0,Q.jsx)($,{label:v(),sortKey:`target`,sort:i,onSort:f}),(0,Q.jsx)($,{label:de(),sortKey:`state`,sort:i,onSort:f}),(0,Q.jsx)($,{label:o(),sortKey:`instance`,sort:i,onSort:f}),(0,Q.jsx)($,{label:ct(),sortKey:`host`,sort:i,onSort:f}),(0,Q.jsx)($,{label:ae(),sortKey:`version`,sort:i,onSort:f}),(0,Q.jsx)(H,{children:S()}),(0,Q.jsx)($,{label:y(),sortKey:`lastOk`,sort:i,onSort:f})]})}),(0,Q.jsx)(zt,{children:d.map(e=>(0,Q.jsx)(mn,{r:e},e._id))})]})]})}function $({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Q.jsx)(H,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Q.jsx)(lt,{size:13,"aria-hidden":!0}):(0,Q.jsx)(k,{size:13,"aria-hidden":!0}):(0,Q.jsx)(ut,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function mn({r:e}){let t=$t(e)?G(e.lastErrorCode):null,n=en(e)?G(e.lastDownstreamRejectCode):null;return(0,Q.jsxs)(K.Fragment,{children:[(0,Q.jsxs)(U,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Q.jsx)(W,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Q.jsx)(W,{children:(0,Q.jsx)(gn,{state:e.state})}),(0,Q.jsx)(W,{children:e.instanceLabel?(0,Q.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(W,{children:(0,Q.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Q.jsx)(W,{children:e.gatewayVersion?(0,Q.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Q.jsx)(W,{children:(0,Q.jsx)(`span`,{className:`oc-conn__stats`,children:pe({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Q.jsx)(W,{children:e.lastOkAt?(0,Q.jsx)(`span`,{className:`oc-traces__mono`,children:z(e.lastOkAt)}):(0,Q.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Q.jsx)(U,{className:`oc-conn__detail-row`,children:(0,Q.jsxs)(W,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Q.jsx)(`strong`,{children:t.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${z(e.lastErrorAt)}`:``,(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Q.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[me({label:n.label}),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${z(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function hn(e){return e===`connected`?g():e===`error`?T():C()}function gn({state:e}){return e===`connected`?(0,Q.jsx)(L,{variant:`secondary`,children:g()}):e===`error`?(0,Q.jsx)(L,{variant:`destructive`,children:T()}):(0,Q.jsx)(L,{variant:`outline`,children:C()})}function _n(){return h(f.bridgeHealth.getBridgeHealth,{})}function vn(){let e=_n(),t=h(f.compat.getBridgeCompat,{}),n=h(f.me.getMe,{host:It})?.role===`admin`,r=h(f.admin.listInstances,n?{}:`skip`),i=h(f.agents.usageForInstances,n?{}:`skip`),a=At(),o=()=>void a({to:`/settings/anomalies`,search:{status:`open`}}),s=nn(e?e.targets:[],t?t.targets:[],r??[]),{section:c}=Mt({from:`/settings/bridge`}),l=At({from:`/settings/bridge`}),u=t?.compat??null,d=t===void 0?`loading`:t===null?`nodata`:`ready`,p=u!==null&&Ut(u,`hermes`)&&!s.some(e=>e.key===`hermes`);return(0,Q.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Q.jsx)(yn,{health:e,compat:t,onSeeAnomalies:o}),(0,Q.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:ke()}),i&&i.length>0?(0,Q.jsxs)(`section`,{className:`oc-bridge__usage`,children:[(0,Q.jsx)(`h3`,{className:`oc-bridge__usage-title`,children:Ae()}),(0,Q.jsxs)(Bt,{children:[(0,Q.jsx)(Rt,{children:(0,Q.jsxs)(U,{children:[(0,Q.jsx)(H,{children:Ge()}),(0,Q.jsx)(H,{children:be()}),(0,Q.jsx)(H,{children:Ne()}),(0,Q.jsx)(H,{children:Xe()}),(0,Q.jsx)(H,{children:He()})]})}),(0,Q.jsx)(zt,{children:i.flatMap(e=>{let t=Et(e.usage,Date.now());return t?t.windows.map((t,n)=>(0,Q.jsxs)(U,{children:[(0,Q.jsx)(W,{className:`font-medium`,children:n===0?e.instanceName:``}),(0,Q.jsx)(W,{children:t.provider}),(0,Q.jsx)(W,{children:t.label}),(0,Q.jsx)(W,{children:(0,Q.jsxs)(L,{variant:t.percentLeft<=10?`destructive`:t.percentLeft<=25?`outline`:`secondary`,children:[t.percentLeft,`%`]})}),(0,Q.jsx)(W,{className:`text-muted-foreground`,children:t.resetText??`—`})]},`${e.instanceName}:${t.provider}:${t.label}`)):[]})})]})]}):null,s.length>0?(0,Q.jsxs)(vt,{value:s.some(e=>e.key===c)?c:s[0]?.key??`openclaw`,onValueChange:e=>void l({search:{section:e},replace:!0}),children:[(0,Q.jsx)(_t,{className:`w-full`,children:s.map(e=>(0,Q.jsxs)(ht,{value:e.key,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(St,{size:13,"aria-hidden":!0}),J(e.key)]},e.key))}),s.map(e=>(0,Q.jsx)(gt,{value:e.key,children:(0,Q.jsx)(bn,{providerKey:e.key,connections:e.connections,instances:e.instances,manifest:u,compatStatus:d,compatReachable:t?.reachable??!0,protocol:e.key===`openclaw`?t?.protocol??null:null})},e.key))]}):null,p?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Ke()}):null]})}function yn({health:e,compat:t,onSeeAnomalies:n}){let r=t!=null&&t.buildVersion!=null&&t.bridgeVersion!=null&&t.buildVersion!==t.bridgeVersion,a=t?.buildRevision&&t.buildRevision!==`unknown`?t.buildRevision.slice(0,7):null,o=t&&t!==null?(0,Q.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:Ht(t.bridgeVersion)}),a?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsxs)(`code`,{className:`oc-traces__mono`,title:u(),children:[`(`,a,`)`]})]}):null,r?(0,Q.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,p({build:t.buildVersion??`?`})]}):null,` · `,ce(),` `,(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?O():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:E()});if(e===null)return(0,Q.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:Qe()});let s=Xt(e.targets),c=!e.reachable,l=Qt(e),d=e.unreachableInstances??[],f=l===`ok`?`ok`:l===`gateways_unreachable`?`warn`:`error`,m=Nt(e.checkedAt),h=e.startedAt==null?null:Nt(e.startedAt);return(0,Q.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${f}`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:l===`ok`?(0,Q.jsx)(M,{size:22}):c||l===`gateways_unreachable`?(0,Q.jsx)(Yt,{size:22}):(0,Q.jsx)(P,{size:22})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Q.jsx)(`div`,{className:`oc-bridge-card__title`,children:l===`ok`?We():l===`gateways_unreachable`?Ve({count:d.length}):c?ye():Me({count:s.length})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(Jt,{size:12,"aria-hidden":!0}),` `,Ye({time:m})]}),h?(0,Q.jsx)(`span`,{children:Ee({time:h})}):null,o]}),l===`gateways_unreachable`?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:$e({names:d.join(`, `)})}):null,c?(0,Q.jsx)(`p`,{className:`oc-bridge-card__hint`,children:G(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Q.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:i()})]})}function bn({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:i,compatReachable:a,protocol:o}){let s=r?Kt(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:qt(t,e,r)})}let d=l.map(e=>e.state),f=d.includes(`beyond`)?`beyond`:d.length>0&&d.every(e=>e===`supported`)?`supported`:null,[p,m]=(0,K.useState)(!1);return(0,Q.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Q.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Q.jsx)(St,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Q.jsx)(`span`,{className:`oc-bridge-provider__name`,children:J(e)}),f?(0,Q.jsx)(L,{variant:f===`beyond`?`destructive`:`secondary`,children:Gt(f)}):null]}),(0,Q.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:Pe()}),(0,Q.jsx)(Sn,{providerName:J(e),support:s,compatStatus:i,compatReachable:a,manifest:r,instanceRows:l}),o?(0,Q.jsx)(xn,{protocol:o}):null,(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":p,onClick:()=>m(e=>!e),children:[p?(0,Q.jsx)(k,{size:13,"aria-hidden":!0}):(0,Q.jsx)(wt,{size:13,"aria-hidden":!0}),ie({count:t.length})]}),p?(0,Q.jsx)(pn,{connections:t,displayByInstance:c}):null]})}function xn({protocol:e}){let[t,n]=(0,K.useState)(!1),r=e.coverage,i=e.drift??[];return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`h4`,{className:`oc-bridge-provider__sub`,children:[ze(),i.length>0?(0,Q.jsx)(L,{variant:`destructive`,children:Oe({count:i.length})}):(0,Q.jsx)(L,{variant:`secondary`,children:qe()})]}),(0,Q.jsxs)(`p`,{className:`oc-admin__hint`,children:[Te({version:e.vendoredVersion}),r?` · `+et({handled:r.handled,ignored:r.ignored,gaps:r.gaps}):null]}),i.length>0?(0,Q.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:i.map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e.shape}),` × `,e.count]},e.shape))}):null,r&&r.gapList.length>0?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[t?(0,Q.jsx)(k,{size:13,"aria-hidden":!0}):(0,Q.jsx)(wt,{size:13,"aria-hidden":!0}),Le({count:r.gapList.length})]}),t?(0,Q.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:r.gapList.map(e=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:e})},e))}):null]}):null]})}function Sn({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i,providerName:a}){return t===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:E()}):t===`nodata`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:w()}):(0,Q.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:s()}),r===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:oe()}):(0,Q.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__label`,children:Re({provider:a})}),e&&e.range!==null?(0,Q.jsx)(`span`,{children:it({min:e.range.min,max:e.range.maxValidated})}):(0,Q.jsx)(`span`,{children:O()}),e?(0,Q.jsx)(En,{versions:e.validatedVersions}):null]}),i.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:ge()}):(0,Q.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,Q.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Q.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Q.jsx)(`code`,{className:`oc-traces__mono`,children:Ht(e.version)}),(0,Q.jsx)(L,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:Gt(e.state)})]},e.instanceName))})]})}function Cn({instance:e,onClose:t}){return(0,Q.jsx)(jt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Q.jsxs)(kt,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Q.jsxs)(Ct,{children:[(0,Q.jsx)(Ft,{children:De({instance:e.displayName??e.name})}),(0,Q.jsx)(Dt,{children:we()})]}),(0,Q.jsx)(Tn,{instance:e,onClose:t})]})})}function wn({label:e,result:t}){return t?t.checked?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,Q.jsx)(M,{"aria-hidden":!0}):(0,Q.jsx)(P,{"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[e,` — `,t.ok?Se():t.detail]})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,st()]}):null}function Tn({instance:e,onClose:t}){let n=ne(f.admin.upsertInstanceConfig),i=ee(f.bridge.validateMediaPaths),o=bt(),s=Lt(e.config?.contentLocale,void 0),[l,u]=(0,K.useState)(()=>dt(e.config??{},s)),[p,h]=(0,K.useState)(!1),[g,_]=(0,K.useState)(!1),[v,y]=(0,K.useState)(null),b=l.inboundMediaMode===`shared-fs`,x=l.mediaMode===`shared-fs`,S=b||x;async function C(){_(!0),y(null);try{y(await i({instanceName:e.name,inboundMediaMode:l.inboundMediaMode,mediaMode:l.mediaMode}))}catch(e){o.error(rt(),e)}finally{_(!1)}}async function w(){h(!0);try{let r=e.config??{};await n({instanceId:e._id,config:pt(l,r,s)}),t()}catch(e){o.error(je(),e)}finally{h(!1)}}return(0,Q.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Q.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(A,{label:Ie(),help:Je()}),(0,Q.jsxs)(V,{value:l.mediaMode,onValueChange:e=>u({...l,mediaMode:e}),children:[(0,Q.jsx)(B,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(I,{})}),(0,Q.jsx)(F,{children:mt.map(e=>(0,Q.jsx)(N,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(A,{label:Ce(),help:Be()}),(0,Q.jsxs)(V,{value:l.inboundMediaMode,onValueChange:e=>u({...l,inboundMediaMode:e}),children:[(0,Q.jsx)(B,{size:`sm`,className:`w-full`,children:(0,Q.jsx)(I,{})}),(0,Q.jsx)(F,{children:ft.map(e=>(0,Q.jsx)(N,{value:e,children:e},e))})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(A,{label:Ze(),help:r()}),(0,Q.jsx)(R,{type:`number`,min:1,max:4096,className:`w-full`,value:l.mediaMaxMb,onChange:e=>u({...l,mediaMaxMb:Math.trunc(Number(e.target.value)||0)})})]})]}),S&&(0,Q.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[b&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(A,{label:a(),help:Fe()}),(0,Q.jsx)(R,{className:`w-full`,spellCheck:!1,value:l.inboundAgentMount,onChange:e=>u({...l,inboundAgentMount:e.target.value})})]}),x&&(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(A,{label:te(),help:d()}),(0,Q.jsx)(R,{className:`w-full`,spellCheck:!1,value:l.outboundAgentMount,onChange:e=>u({...l,outboundAgentMount:e.target.value})})]})]}),(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(Ot,{checked:l.rehydration,onCheckedChange:e=>u({...l,rehydration:e===!0})}),(0,Q.jsx)(A,{label:Ue(),help:re()})]}),S&&v!==null&&(0,Q.jsx)(`div`,{className:`oc-bridge-config__check`,children:v.reachable?!v.inbound&&!v.outbound?(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(P,{"aria-hidden":!0}),_e({reason:v.reason??`?`})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(wn,{label:se(),result:v.inbound}),(0,Q.jsx)(wn,{label:at(),result:v.outbound}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:c()})]}):(0,Q.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Q.jsx)(P,{"aria-hidden":!0}),nt()]})}),(0,Q.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[S&&(0,Q.jsxs)(j,{variant:`outline`,size:`sm`,onClick:()=>void C(),disabled:g,children:[g?(0,Q.jsx)(xt,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,g?le():m()]}),(0,Q.jsx)(j,{size:`sm`,onClick:()=>void w(),disabled:p,children:ve()})]})]})})}function En({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Q.jsxs)(yt,{children:[(0,Q.jsx)(Pt,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?xe():ot({count:e.length}),(0,Q.jsx)(k,{size:13,"aria-hidden":!0})]})}),(0,Q.jsxs)(Tt,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Q.jsx)(`p`,{className:`oc-compat__versions-title`,children:tt()}),(0,Q.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Q.jsx)(L,{variant:`secondary`,children:e},e))})]})]})}export{vn as BridgeTab,Cn as InstanceConfigDialog};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ac as r,E as i,EP as a,FP as o,Fc as s,Gl as c,Ic as l,Kl as u,Lc as d,MP as f,Mc as p,Nc as m,PP as h,Pc as g,Ql as _,Rc as v,Xl as y,aa as b,ca as x,cn as S,ia as C,jc as w,la as T,ml as E,na as D,oa as O,ra as k,sa as A,ta as j,u_ as M,ua as N}from"./dist-CjH9Ohdx.js";import{t as P}from"./button-B49JSqzm.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-DnuEILeM.js";import{i as K}from"./compatView-C1X2zgFr.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=h(i.admin.upsertInstanceConfig),n=o(i.agents.listAgentsForInstance,{instanceName:e.name}),a=typeof e.config?.converterAgentId==`string`?e.config.converterAgentId:``,[s,c]=(0,q.useState)(a),[l,u]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{c(a),u(`idle`)},[e._id,a]);let d=`__none__`,f=s!==a;async function m(){u(`saving`);try{let n={...e.config??{}};s===``||s===d?delete n.converterAgentId:n.converterAgentId=s,await t({instanceId:e._id,config:n}),u(`done`)}catch{u(`error`)}}let g=n?.agents??[];return(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:A()}),(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:O()}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsxs)(G,{value:s===``?d:s,onValueChange:e=>c(e===d?``:e),children:[(0,X.jsx)(W,{className:`oc-cdefaults__select`,"aria-label":A(),children:(0,X.jsx)(R,{placeholder:b()})}),(0,X.jsxs)(L,{children:[(0,X.jsx)(F,{value:d,children:b()}),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:!f||l===`saving`,onClick:()=>void m(),children:l===`saving`?_():p()})]}),l===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:w()}):null,l===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:r()}):null]})}function Q({instance:e}){let t=h(i.admin.upsertInstanceConfig),n=e.config?.curationEnabled===!0,a=typeof e.config?.curationBudgetChars==`number`?e.config.curationBudgetChars:null,[o,s]=(0,q.useState)(n),[c,l]=(0,q.useState)(a===null?``:String(a)),[u,d]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{s(n),l(a===null?``:String(a)),d(`idle`)},[e._id,n,a]);let f=c.trim(),m=f===``?null:/^\d+$/.test(f)?Number.parseInt(f,10):NaN,g=!o||m===null||Number.isInteger(m)&&m>=4e3&&m<=6e4,v=o!==n||(m??null)!==a;async function y(){d(`saving`);try{let n={...e.config??{}};n.curationEnabled=o,!o||m===null||Number.isNaN(m)?delete n.curationBudgetChars:n.curationBudgetChars=m,await t({instanceId:e._id,config:n}),d(`done`)}catch{d(`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:o,onCheckedChange:e=>s(e===!0),"aria-label":x()}),(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:x()})]}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsx)(V,{type:`number`,min:4e3,max:6e4,step:1e3,placeholder:`20000`,value:c,onChange:e=>l(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!g,"aria-label":C(),disabled:!o}),(0,X.jsx)(P,{size:`sm`,disabled:!v||!g||u===`saving`,onClick:()=>void y(),children:u===`saving`?_():p()})]}),g?null:(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:k()}),u===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:w()}):null,u===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:r()}):null,(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:D()})]})}function $({instance:e}){let t=h(i.admin.upsertInstanceConfig),n=typeof e.config?.summarizeThresholdChars==`number`?e.config.summarizeThresholdChars:null,[a,o]=(0,q.useState)(n===null?``:String(n)),[s,c]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{o(n===null?``:String(n)),c(`idle`)},[e._id,n]);let l=a.trim(),u=l===``?null:/^\d+$/.test(l)?Number.parseInt(l,10):NaN,d=u===null||Number.isInteger(u)&&u>=1e3&&u<=2e5,f=(u??null)!==n;async function m(){c(`saving`);try{let n={...e.config??{}};u===null?delete n.summarizeThresholdChars:n.summarizeThresholdChars=u,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:N()}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsx)(V,{type:`number`,min:1e3,max:2e5,step:1e3,placeholder:`8000`,value:a,onChange:e=>o(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!d}),(0,X.jsx)(P,{size:`sm`,disabled:!f||!d||s===`saving`,onClick:()=>void m(),children:s===`saving`?_():p()})]}),d?null:(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:j()}),s===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:w()}):null,s===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:r()}):null,(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:T()})]})}function ee(){let e=f(i.agentFiles.getChatDefaults),[t,n]=(0,q.useState)({status:`loading`}),r=o(i.admin.listInstances,{}),[p,h]=(0,q.useState)(null);(0,q.useEffect)(()=>{!r||r.length===0||(!p||!r.some(e=>e.name===p))&&h(r[0].name)},[r,p]);let _=(r?.length??0)>1,b=r!==void 0&&r.length===0,x=o(i.compat.forInstance,p?{instanceName:p}:`skip`),C=p?z(x,`configDefaults`):`loading`,w=C===`loading`?null:C.blocked,T=(0,q.useMemo)(()=>_&&p?{instanceName:p}:{},[_,p]),D=(0,q.useRef)(0),O=(0,q.useCallback)(async()=>{let t=++D.current;n({status:`loading`});try{let r=Y(await e(T));if(D.current!==t)return;n({status:`done`,current:r})}catch{if(D.current!==t)return;n({status:`error`})}},[e,T]);(0,q.useEffect)(()=>{w===!1&&(_&&!p||O())},[O,w,_,p]);let k=t.status===`done`?t.current:null,A=(0,q.useMemo)(()=>J.map(e=>({id:e,label:U(e)})),[]),j=(0,q.useMemo)(()=>[{id:`fast`,label:u()},{id:`standard`,label:c()}],[]);return(0,X.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:v()}),_&&p?(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:E()}),(0,X.jsxs)(G,{value:p,onValueChange:e=>h(e),children:[(0,X.jsx)(W,{size:`sm`,"aria-label":E(),children:(0,X.jsx)(R,{})}),(0,X.jsx)(L,{children:(r??[]).map(e=>(0,X.jsx)(F,{value:e.name,children:e.name},e.name))})]})]}):null,b?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:M()}):C===`loading`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):C.blocked?(0,X.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,X.jsx)(I,{size:14,"aria-hidden":!0}),` `,K(C.gatewayVersion,C.provider)]}):t.status===`loading`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:a()}):t.status===`error`?(0,X.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[m(),` `,(0,X.jsx)(P,{variant:`outline`,size:`sm`,onClick:()=>void O(),children:y()})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:d()}),(0,X.jsx)(B,{options:A,value:k?.thinkingDefault??null,onChange:()=>{},disabled:!0}),(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:l()})]}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:s()}),(0,X.jsx)(B,{options:j,value:k===null||k.fastModeDefault===null?null:k.fastModeDefault?`fast`:`standard`,onChange:()=>{},disabled:!0}),(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:g()})]}),(0,X.jsx)(`p`,{className:`oc-cdefaults__note`,children:S()})]}),(()=>{let e=r?.find(e=>e.name===(p??r[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,AC as i,BC as a,Cw as o,DC as s,Dw as c,E as l,EC as u,Ew as d,FC as f,FP as p,GC as m,HC as h,IC as ee,JC as te,KC as g,LC as _,MC as v,NC as ne,OC as re,Ow as y,PC as ie,PP as b,QC as x,RC as S,Si as C,Sw as w,Tw as T,UC as E,VC as D,WC as O,XC as k,YC as A,ZC as j,_w as M,aw as N,bi 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,jC as U,kC as ae,lw as W,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,zC as he}from"./dist-CjH9Ohdx.js";import{t as ge}from"./button-B49JSqzm.js";import{U as _e,rt as Y}from"./index-DnuEILeM.js";import{t as ve}from"./DataTableShell-DKcU9E8v.js";var X=t(e(),1),Z=n(),ye={altered_words:()=>y(),incorrect:()=>c(),incoherence:()=>d(),formatting:()=>T(),latency:()=>fe(),api_error:()=>o(),other:()=>w()},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:F()}):e===!1?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-warn`,children:me()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:`—`}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill`,children:pe()})}function be({data:e,reference:t,closeReason:n}){let i=e.snapshot,a=b(l.feedback.respondToFeedback),[o,s]=(0,X.useState)(e.thread),[c,u]=(0,X.useState)(``),[d,f]=(0,X.useState)(!1);async function p(){let t=c.trim();if(!(!t||d)){f(!0);try{await a({feedbackId:e._id,text:t}),s(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),u(``)}finally{f(!1)}}}let m=[];try{m=i.contextJson?JSON.parse(i.contextJson):[]}catch{m=[]}return(0,Z.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Z.jsxs)(`div`,{className:`oc-fbadmin__row`,children:[(0,Z.jsx)($,{matches:i.displayedMatchesStored,sourceWasOpen:i.clientInfo?.sourceWasOpen??!1}),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Q(e.category),` · `,i.messageRole,i.isRegeneration?` · ${de()}`:``,i.openclawModel?` · ${i.openclawModel}`:``,i.openclawRuntime?` (${i.openclawRuntime})`:``]}),t?(0,Z.jsx)(`code`,{className:`oc-fbadmin__ref`,style:{userSelect:`all`,marginLeft:`auto`},title:g(),children:t}):null]}),e.comment?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:M()}),(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:v()}),(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:B()}),o.length>0?(0,Z.jsx)(`div`,{className:`oc-fbadmin__thread`,children:o.map((e,t)=>(0,Z.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Z.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?V():e.authorRole===`agent`?e.authorLabel??C():G()}),(0,Z.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Z.jsx)(`p`,{className:`oc-fbadmin__meta`,children:J()}),(0,Z.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:z(),value:c,maxLength:2e3,rows:3,onChange:e=>u(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 p(),disabled:!c.trim()||d,children:d?L():ue()})})]}),(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:W()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:i.messageText||I()})]}),i.clientInfo?.sourceWasOpen&&i.displayedText!==void 0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:ce()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:i.displayedText||I()})]}):null,i.promptText?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:q()}),(0,Z.jsx)(`pre`,{className:`oc-msg__source-pre`,children:i.promptText})]}):null,m.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:N({count:i.contextCount??m.length,truncated:i.contextTruncated?H():``})}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:m.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,i.outboxAvailable?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:se()}),(0,Z.jsxs)(`pre`,{className:`oc-msg__source-pre`,children:[i.outboxText??``,i.outboxStatus?`\n[status: ${i.outboxStatus}]`:``]})]}):null,i.clientInfo?.extensionsDetected&&i.clientInfo.extensionsDetected.length>0?(0,Z.jsxs)(`section`,{children:[(0,Z.jsx)(`h4`,{className:`oc-fbadmin__h`,children:K()}),(0,Z.jsx)(`div`,{className:`oc-fbadmin__row`,children:i.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:le()}),(0,Z.jsxs)(`p`,{className:`oc-fbadmin__env`,children:[[i.clientInfo?.language,i.clientInfo?.timezone,i.clientInfo?.theme?R({theme:i.clientInfo.theme}):null,i.runId?`run ${i.runId.slice(0,12)}…`:null].filter(Boolean).join(` · `)||`—`,i.clientInfo?.plugins&&i.clientInfo.plugins.length>0?(0,Z.jsxs)(`span`,{className:`oc-fbadmin__plugins`,children:[r(),` `,i.clientInfo.plugins.join(`, `),(0,Z.jsxs)(`span`,{className:`oc-fbadmin__note`,children:[` `,x()]})]}):null,i.clientInfo?.userAgent?(0,Z.jsx)(`span`,{className:`oc-fbadmin__ua`,children:i.clientInfo.userAgent}):null]})]})]})}function xe(){let e=p(l.feedback.listForAdmin,{}),t=b(l.feedback.readSnapshot),n=b(l.feedback.deleteFeedback),r=_e(),[o,c]=(0,X.useState)(null),[d,g]=(0,X.useState)({});async function v(e){if(o===e._id){c(null);return}if(!d[e._id]){let n=await t({feedbackId:e._id});g(t=>({...t,[e._id]:n}))}c(e._id)}async function y(e){await r({title:re(),description:s(),confirmLabel:u(),destructive:!0})&&(await n({feedbackId:e._id}),o===e._id&&c(null))}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[j(),` `,(0,Z.jsx)(`strong`,{children:k()}),` `,A()]}),(0,Z.jsx)(ve,{title:te(),rows:e,emptyHint:oe(),isExpanded:e=>o===e._id&&!!d[e._id],renderExpanded:e=>d[e._id]?(0,Z.jsx)(be,{data:d[e._id],reference:e.reference,closeReason:e.userCloseReason}):null,columns:[{header:m(),cell:e=>Y(e.at),sort:e=>e.at},{header:O(),cell:e=>Q(e.category),sort:e=>Q(e.category)},{header:E(),cell:e=>e.messageRole===`user`?h():D(),sort:e=>e.messageRole},{header:a(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${he({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:S(),cell:e=>(0,Z.jsx)($,{matches:e.displayedMatchesStored,sourceWasOpen:e.sourceWasOpen}),sort:e=>e.displayedMatchesStored===!1?0:e.displayedMatchesStored===!0?1:2},{header:_(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:ee(),cell:e=>e.userClosedAt==null?e.resolvedAt==null?e.answered?(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:f()}):(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:P()}):(0,Z.jsx)(`span`,{className:`oc-fbadmin__pill is-closed`,children:ne()}),sort:e=>e.userClosedAt==null?e.resolvedAt==null?+!!e.answered:2:3}],rowActions:e=>[{label:o===e._id?U():i(),onSelect:()=>void v(e)},{label:ae(),onSelect:()=>void y(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,AN as te,BN as r,CN as ne,DD as i,DN as a,E as o,EN as s,EP as re,Ei as c,FN as ie,FP as l,GN as u,HN as d,IN as f,JN as ae,KN as oe,LN as p,MN as se,NN as ce,ON as le,OP as ue,PN as de,PP as fe,QN as pe,RN as m,SN as me,TN as he,Ti as ge,UN as _e,VN as h,WN as ve,XN as g,YN as _,ZN as ye,bN as be,jN as xe,kN as v,qN as y,vN as b,wN as x,xN as S,yN as C,zN as w}from"./dist-CjH9Ohdx.js";import{t as T}from"./button-B49JSqzm.js";import{C as E,Ft as D,G as O,H as k,J as A,K as j,Q as M,S as N,T as P,X as Se,Xt as F,Y as Ce,Yt as we,Z as Te,at as Ee,dt as I,m as De,ot as Oe,q as ke,st as L,ut as Ae,w as R,x as z,zt as je}from"./index-DnuEILeM.js";import{a as Me,i as B,n as Ne,o as V,r as H,t as Pe}from"./table-COx9FvKU.js";var U=t(e(),1),W=n(),G=`all`;function K(e){switch(e){case`image`:return d();case`audio`:return h();case`video`:return r();case`pdf`:return w();case`document`:return m();case`archive`:return p();default:return f()}}function q(){let[e,t]=(0,U.useState)(G),[n,r]=(0,U.useState)(G),[d,f]=(0,U.useState)(G),[p,m]=(0,U.useState)(G),[h,w]=(0,U.useState)(!1),[q,J]=(0,U.useState)(null),Fe=fe(o.files.softDelete),Y=k();function Ie(){t(G),r(G),f(G),m(G)}async function Le(){let e=q;if(J(null),e)try{await Fe({fileId:e.id}),Y.success(he())}catch(e){Y.error(x(),e)}}let X=l(o.files.listMine,{direction:e===G?void 0:e,chatId:n===G?void 0:n,instanceName:d===G?void 0:d,category:p===G?void 0:p,includeAutoGenerated:h||void 0}),Re=(0,U.useMemo)(()=>new Intl.DateTimeFormat(ue(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:re()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==G||n!==G||d!==G||p!==G;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:ee()}),(0,W.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,W.jsxs)(z,{value:e,onValueChange:t,children:[(0,W.jsx)(R,{size:`sm`,"aria-label":pe(),children:(0,W.jsx)(P,{})}),(0,W.jsxs)(N,{children:[(0,W.jsx)(E,{value:G,children:ye()}),(0,W.jsx)(E,{value:`inbound`,children:g()}),(0,W.jsx)(E,{value:`outbound`,children:_()})]})]}),(0,W.jsxs)(z,{value:n,onValueChange:r,children:[(0,W.jsx)(R,{size:`sm`,"aria-label":ae(),children:(0,W.jsx)(P,{})}),(0,W.jsxs)(N,{children:[(0,W.jsx)(E,{value:G,children:y()}),Q.chats.map(e=>(0,W.jsx)(E,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,W.jsxs)(z,{value:d,onValueChange:f,children:[(0,W.jsx)(R,{size:`sm`,"aria-label":oe(),children:(0,W.jsx)(P,{})}),(0,W.jsxs)(N,{children:[(0,W.jsx)(E,{value:G,children:u()}),Q.instances.map(e=>(0,W.jsx)(E,{value:e,children:e},e))]})]}):null,(0,W.jsxs)(z,{value:p,onValueChange:m,children:[(0,W.jsx)(R,{size:`sm`,"aria-label":ve(),children:(0,W.jsx)(P,{})}),(0,W.jsxs)(N,{children:[(0,W.jsx)(E,{value:G,children:_e()}),Q.categories.map(e=>(0,W.jsx)(E,{value:e,children:K(e)},e))]})]}),(0,W.jsxs)(`label`,{className:`oc-files__autogen`,children:[(0,W.jsx)(De,{checked:h,onCheckedChange:e=>w(e===!0),"aria-label":c()}),(0,W.jsx)(`span`,{children:c()})]}),$?(0,W.jsxs)(T,{variant:`ghost`,size:`sm`,onClick:Ie,style:{display:`inline-flex`,alignItems:`center`,gap:4,marginLeft:`auto`},children:[(0,W.jsx)(je,{size:14,"aria-hidden":!0}),le()]}):null]}),Z.length===0?(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:$?C():be()}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Pe,{children:[(0,W.jsx)(Me,{children:(0,W.jsxs)(V,{children:[(0,W.jsx)(B,{children:ie()}),(0,W.jsx)(B,{children:de()}),(0,W.jsx)(B,{children:ce()}),(0,W.jsx)(B,{children:se()}),(0,W.jsx)(B,{children:xe()}),(0,W.jsx)(B,{className:`text-right`,children:te()})]})}),(0,W.jsx)(Ne,{children:Z.map(e=>(0,W.jsxs)(V,{children:[(0,W.jsxs)(H,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:e.filename,children:[e.filename,e.origin===`pasted`?(0,W.jsx)(I,{variant:`outline`,style:{marginLeft:6},children:ge()}):null]}),(0,W.jsx)(H,{title:e.mimeType,children:K(e.category)}),(0,W.jsx)(H,{children:(0,W.jsx)(I,{variant:`secondary`,children:e.direction===`inbound`?g():_()})}),(0,W.jsx)(H,{style:{maxWidth:220,overflow:`hidden`,textOverflow:`ellipsis`},title:e.chatTitle,children:e.chatTitle}),(0,W.jsx)(H,{className:`whitespace-nowrap text-muted-foreground`,children:Re.format(e.createdAt)}),(0,W.jsx)(H,{className:`text-right`,children:(0,W.jsxs)(Ee,{children:[(0,W.jsx)(Ae,{asChild:!0,children:(0,W.jsx)(T,{variant:`ghost`,size:`icon`,"aria-label":a(),children:(0,W.jsx)(we,{size:16})})}),(0,W.jsxs)(Oe,{align:`end`,children:[e.url?(0,W.jsx)(L,{asChild:!0,children:(0,W.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,W.jsx)(F,{size:14}),v()]})}):(0,W.jsxs)(L,{disabled:!0,children:[(0,W.jsx)(F,{size:14}),S()]}),(0,W.jsxs)(L,{variant:`destructive`,onSelect:()=>J({id:e._id,filename:e.filename}),children:[(0,W.jsx)(D,{size:14}),s()]})]})]})})]},e._id))})]}),ze?(0,W.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:b({cap:Be})}):null]}),(0,W.jsx)(O,{open:q!==null,onOpenChange:e=>!e&&J(null),children:(0,W.jsxs)(A,{children:[(0,W.jsxs)(Te,{children:[(0,W.jsx)(M,{children:ne()}),(0,W.jsx)(Ce,{children:me()})]}),(0,W.jsxs)(Se,{children:[(0,W.jsx)(ke,{children:i()}),(0,W.jsx)(j,{onClick:()=>void Le(),children:s()})]})]})})]})}export{q as FilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$u as r,Au as i,Bu as a,Cu as o,D as s,Du as c,E as l,Eu as u,FP as d,Fu as f,Gu as p,Hu as m,Iu as h,Ju as g,Ku as _,Lu as v,Mu as y,Nu as b,Ou as x,PP as S,Pu as C,Qu as w,Ru as T,Su as E,Tu as ee,Uu as D,Vu as te,Wu as O,Xu as ne,Yu as re,Zu as ie,_d as k,_u as ae,ad as A,bu as j,cd as M,dd as N,du as oe,ed as se,fd as ce,fu as P,gd as F,gu as le,hd as ue,hu as de,id as fe,ju as I,ku as pe,ld as L,md as me,mu as R,nd as he,od as ge,pd as _e,pu as ve,qu as ye,rd as be,sd as xe,td as Se,ud as Ce,uu as we,vd as Te,vu as Ee,wu as De,xu as Oe,yd as ke,yu as Ae,zu as je}from"./dist-CjH9Ohdx.js";import{t as Me}from"./x-DYJkW-kP.js";import{i as z,n as B,r as Ne,t as Pe}from"./tabs-BFg7qw3e.js";import{t as V}from"./button-B49JSqzm.js";import{C as Fe,H,It as U,Lt as W,S as Ie,T as Le,U as Re,_t as ze,d as Be,dt as G,en as Ve,ft as K,ht as He,m as q,mt as Ue,pt as We,tn as Ge,vt as Ke,w as qe,wt as Je,x as Ye}from"./index-DnuEILeM.js";import{t as Xe}from"./FilterBar-BVzupjQK.js";import{t as Ze}from"./DataTableShell-DKcU9E8v.js";import{t as J}from"./DetailChips-BHFRTi5X.js";var Qe=s(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),Y=s(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),$e=s(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),X=t(e(),1);function et(e,t,n){let r=t.trim().toLowerCase();return[...r?e.filter(e=>[e.email,e.name,e.canonical].some(e=>e!=null&&e.toLowerCase().includes(r))):e.slice()].sort((e,t)=>!n.has(e.userId)-+!n.has(t.userId))}function tt(e,t){let n=e.filter(e=>e.source===`discovered`),r=t.trim().toLowerCase();return r?n.filter(e=>(e.displayName??e.agentId).toLowerCase().includes(r)||e.agentId.toLowerCase().includes(r)):n}function nt(e){let t=e.name?.trim()??``,n=e.email?.trim()??``,r=e.canonical?.trim()||`u-${e.userId.slice(0,8)}`;return t?{primary:t,secondary:n||`@${r}`}:n?{primary:n,secondary:null}:{primary:`@${r}`,secondary:null}}function rt(e){switch(e){case`admin`:return a();case`user`:return je();case`pending`:return T();default:return e}}function it(e,t){if(e.length===0)return`none`;let n=0;for(let r of e)t(r)&&n++;return n===0?`none`:n===e.length?`all`:`some`}function Z(e,t,n){let r=Math.max(1,Math.ceil(e.length/n)),i=Math.min(Math.max(1,Math.floor(t)),r),a=(i-1)*n;return{pageItems:e.slice(a,a+n),page:i,pageCount:r}}var Q=n(),$={name:``,description:``};function at(){let e=d(l.groups.listGroups,{}),t=d(l.me.getMe,{host:Je})?.role===`admin`,n=S(l.groups.createGroup),i=S(l.groups.updateGroup),a=S(l.groups.deleteGroup),o=Re(),s=H(),[c,u]=(0,X.useState)(!1),[f,p]=(0,X.useState)(null),[m,h]=(0,X.useState)($),[g,_]=(0,X.useState)(null),[v,y]=(0,X.useState)(``),b=(0,X.useMemo)(()=>{if(!e)return e;let t=v.trim().toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||e.members.some(e=>e.label.toLowerCase().includes(t))||e.agents.some(e=>e.toLowerCase().includes(t))||e.charts.some(e=>e.name.toLowerCase().includes(t))):e},[e,v]);function x(){p(null),h($),u(!0)}function C(e){p(e),h({name:e.name,description:e.description??``}),u(!0)}async function T(){try{f?await i({groupId:f._id,name:m.name,description:m.description}):await n({name:m.name,description:m.description||void 0}),h($),p(null),u(!1)}catch(e){s.error(ve(),e)}}async function E(e){if(await o({title:se({name:e.name}),description:r(),confirmWord:e.name,confirmLabel:w(),cancelLabel:ge(),destructive:!0}))try{await a({groupId:e._id})}catch(e){s.error(P(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:Te()}),(0,Q.jsx)(Xe,{q:v,onQChange:y,onReset:()=>y(``),canReset:v!==``,searchPlaceholder:N()}),(0,Q.jsx)(Ze,{title:ke(),rows:b,addLabel:k(),onAdd:t?x:void 0,emptyHint:F(),columns:[{header:ue(),cell:e=>e.name,sort:e=>e.name},{header:me(),cell:e=>(0,Q.jsx)(J,{icon:(0,Q.jsx)($e,{size:12,"aria-hidden":!0}),total:e.memberCount,items:e.members.map(e=>({label:e.label,marker:e.manager?(0,Q.jsx)(Y,{size:11,"aria-hidden":!0}):null,highlight:e.manager}))}),sort:e=>e.memberCount},{header:_e(),cell:e=>(0,Q.jsx)(J,{icon:(0,Q.jsx)(W,{size:12,"aria-hidden":!0}),total:e.agentCount,items:e.agents.map(e=>({label:e}))}),sort:e=>e.agentCount},{header:ce(),cell:e=>(0,Q.jsx)(J,{icon:(0,Q.jsx)(Qe,{size:12,"aria-hidden":!0}),total:e.chartCount,items:e.charts.map(e=>({label:e.name,marker:e.isDefault?(0,Q.jsx)(U,{size:11,fill:`currentColor`,"aria-hidden":!0}):null,highlight:e.isDefault}))}),sort:e=>e.chartCount}],rowActions:e=>[{label:Ce(),onSelect:()=>_({groupId:e._id,name:e.name})},...t?[{label:L(),onSelect:()=>C(e)},{label:M(),variant:`destructive`,onSelect:()=>void E(e)}]:[]]}),(0,Q.jsx)(Be,{open:c,onOpenChange:u,title:f?fe():A(),description:be(),canSubmit:!!m.name.trim(),onSubmit:T,submitLabel:xe(),children:(0,Q.jsxs)(`div`,{className:`oc-form`,children:[(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(`span`,{className:`oc-field__label`,children:he()}),(0,Q.jsx)(K,{value:m.name,onChange:e=>h({...m,name:e.target.value})})]}),(0,Q.jsxs)(`label`,{className:`oc-field`,children:[(0,Q.jsx)(`span`,{className:`oc-field__label`,children:Se()}),(0,Q.jsx)(K,{value:m.description,onChange:e=>h({...m,description:e.target.value})})]})]})}),(0,Q.jsx)(ct,{groupId:g?.groupId??null,groupName:g?.name??``,open:g!==null,onOpenChange:e=>{e||_(null)}})]})}var ot=8;function st({page:e,pageCount:t,onPage:n}){return t<=1?null:(0,Q.jsxs)(`div`,{className:`oc-access__pager`,children:[(0,Q.jsxs)(V,{type:`button`,variant:`ghost`,size:`sm`,disabled:e<=1,onClick:()=>n(e-1),children:[(0,Q.jsx)(Ge,{size:14,"aria-hidden":!0}),D()]}),(0,Q.jsxs)(`span`,{className:`oc-access__pageinfo`,"aria-label":te({page:e,pages:t}),children:[e,` / `,t]}),(0,Q.jsxs)(V,{type:`button`,variant:`ghost`,size:`sm`,disabled:e>=t,onClick:()=>n(e+1),children:[m(),(0,Q.jsx)(Ve,{size:14,"aria-hidden":!0})]})]})}function ct({groupId:e,groupName:t,open:n,onOpenChange:r}){let i=d(l.groups.getGroup,n&&e?{groupId:e}:`skip`),a=d(l.groups.listAssignableInstances,n?{}:`skip`),o=d(l.groups.listAssignableUsers,n?{}:`skip`),s=S(l.groups.addMember),c=S(l.groups.removeMember),m=S(l.groups.bulkSetMembers),h=S(l.groups.setGroupManager),x=H(),[C,w]=(0,X.useState)(``),[T,E]=(0,X.useState)(``),[ee,D]=(0,X.useState)(`members`),[te,k]=(0,X.useState)(1),[A,j]=(0,X.useState)(new Set),M=(0,X.useRef)(null),N=(0,X.useMemo)(()=>new Set((i?.members??[]).map(e=>e.userId)),[i]),se=(0,X.useMemo)(()=>new Set((i?.members??[]).filter(e=>e.manager).map(e=>e.userId)),[i]),ce=i?.viewerIsAdmin===!0,P=(0,X.useMemo)(()=>new Set((i?.agents??[]).map(e=>`${e.instanceName}/${e.agentId}`)),[i]);(0,X.useEffect)(()=>{w(``),E(``),D(`members`),k(1),M.current=null},[n,e]),(0,X.useEffect)(()=>{k(1)},[C]),(0,X.useEffect)(()=>{n&&i&&e&&M.current!==e&&(M.current=e,j(new Set((i.members??[]).map(e=>e.userId))))},[n,i,e]);let F=(0,X.useMemo)(()=>o?et(o,C,A):[],[o,C,A]);async function ue(t,n){if(e)try{n?await c({groupId:e,userId:t}):await s({groupId:e,userId:t})}catch(e){x.error(oe(),e)}}async function fe(t,n){if(e)try{await h({groupId:e,userId:t,manager:!n})}catch(e){x.error(de(),e)}}let I=it(F,e=>N.has(e.userId)),pe=F.filter(e=>N.has(e.userId)).length,L=Z(F,te,ot);async function me(){if(!e||F.length===0)return;let t=F.map(e=>e.userId);try{await m({groupId:e,userIds:t,member:I!==`all`})}catch(e){x.error(oe(),e)}}return(0,Q.jsx)(We,{open:n,onOpenChange:r,children:(0,Q.jsxs)(Ue,{className:`oc-access`,children:[(0,Q.jsxs)(ze,{children:[(0,Q.jsx)(Ke,{children:ie({name:t})}),(0,Q.jsx)(He,{children:ne()})]}),(0,Q.jsxs)(Pe,{value:ee,onValueChange:D,className:`oc-access__tabs`,children:[(0,Q.jsxs)(Ne,{className:`w-full`,children:[(0,Q.jsxs)(z,{value:`members`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)($e,{size:13,"aria-hidden":!0}),re(),i?(0,Q.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:N.size}):null]}),(0,Q.jsxs)(z,{value:`agents`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(W,{size:13,"aria-hidden":!0}),ye(),i?(0,Q.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:P.size}):null]}),(0,Q.jsxs)(z,{value:`charts`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Qe,{size:13,"aria-hidden":!0}),u(),i?(0,Q.jsx)(G,{variant:`secondary`,className:`oc-access__tabcount`,children:i.chartCount}):null]})]}),(0,Q.jsx)(B,{value:`members`,children:o===void 0||i===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:f()}):o.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:b()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(K,{value:C,onChange:e=>w(e.target.value),placeholder:g(),className:`oc-access__search`}),F.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:p()}):(0,Q.jsxs)(Q.Fragment,{children:[F.length>1?(0,Q.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Q.jsx)(q,{checked:I===`all`?!0:I===`some`?`indeterminate`:!1,onCheckedChange:()=>void me(),"aria-label":O()}),(0,Q.jsx)(`span`,{className:`oc-access__label`,children:O()}),(0,Q.jsxs)(G,{variant:`outline`,className:`oc-access__count`,children:[pe,` / `,F.length]})]}):null,(0,Q.jsx)(`div`,{className:`oc-access__list`,children:L.pageItems.map(e=>{let t=N.has(e.userId),n=nt(e),r=se.has(e.userId);return(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(q,{checked:t,onCheckedChange:()=>void ue(e.userId,t),"aria-label":v({user:n.primary})}),(0,Q.jsxs)(`span`,{className:`oc-access__who`,children:[(0,Q.jsx)(`span`,{className:`oc-access__label`,title:n.primary,children:n.primary}),n.secondary?(0,Q.jsx)(`span`,{className:`oc-access__sub`,title:n.secondary,children:n.secondary}):null]}),(0,Q.jsx)(G,{variant:`outline`,className:`oc-access__role`,children:rt(e.role)}),(0,Q.jsx)(`span`,{className:`oc-access__mgrslot`,children:t&&ce?(0,Q.jsx)(V,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 oc-access__mgr${r?` oc-access__mgr--on`:``}`,"aria-pressed":r,"aria-label":r?le():ae(),title:r?le():ae(),onClick:()=>void fe(e.userId,r),children:(0,Q.jsx)(Y,{size:15,"aria-hidden":!0})}):t&&r?(0,Q.jsx)(`span`,{className:`oc-access__mgr oc-access__mgr--on`,role:`img`,"aria-label":Ee(),title:Ee(),children:(0,Q.jsx)(Y,{size:15,"aria-hidden":!0})}):null})]},e._id)})}),(0,Q.jsx)(st,{page:L.page,pageCount:L.pageCount,onPage:k})]})]})}),(0,Q.jsx)(B,{value:`agents`,children:a===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:f()}):a.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:y()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(K,{value:T,onChange:e=>E(e.target.value),placeholder:_(),className:`oc-access__search`}),(0,Q.jsx)(`div`,{className:`oc-access__list`,children:a.map(t=>(0,Q.jsx)(lt,{groupId:e,instanceName:t.name,kind:t.kind??`openclaw`,assigned:P,query:T},`${e}-${t._id}`))})]})}),(0,Q.jsx)(B,{value:`charts`,children:(0,Q.jsx)(ut,{groupId:e})})]})]})})}function lt({groupId:e,instanceName:t,kind:n,assigned:r,query:a}){let o=d(l.groups.listAssignableAgents,{instanceName:t}),s=S(l.groups.assignAgentToGroup),u=S(l.groups.removeAgentFromGroup),f=S(l.groups.bulkSetGroupAgents),p=H(),[m,g]=(0,X.useState)(1);if((0,X.useEffect)(()=>{g(1)},[a]),!e)return null;let _=tt(o?.agents??[],a),v=o?.discovery&&!o.discovery.lastPollOk;if(a.trim()&&_.length===0)return null;let y=_.filter(e=>e.presentInLastOk!==!1&&e.enabled!==!1),b=it(y,e=>r.has(`${t}/${e.agentId}`)),w=Z(_,m,ot);async function T(n,r){try{r?await u({groupId:e,instanceName:t,agentId:n}):await s({groupId:e,instanceName:t,agentId:n})}catch(e){p.error(we(),e)}}async function E(){if(y.length===0)return;let n=y.map(e=>e.agentId);try{await f({groupId:e,instanceName:t,agentIds:n,assigned:b!==`all`})}catch(e){p.error(we(),e)}}return(0,Q.jsxs)(`div`,{className:`oc-access__group`,children:[(0,Q.jsxs)(`div`,{className:`oc-access__instance`,children:[(0,Q.jsx)(W,{size:13,"aria-hidden":!0}),(0,Q.jsx)(`span`,{children:t}),(0,Q.jsx)(G,{variant:`outline`,className:`oc-access__kind`,children:n}),v?(0,Q.jsx)(G,{variant:`outline`,className:`oc-access__stale`,children:pe()}):null]}),o===void 0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:C()}):_.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:v?i():I()}):(0,Q.jsxs)(Q.Fragment,{children:[y.length>1?(0,Q.jsxs)(`div`,{className:`oc-access__row oc-access__selectall`,children:[(0,Q.jsx)(q,{checked:b===`all`?!0:b===`some`?`indeterminate`:!1,onCheckedChange:()=>void E(),"aria-label":O()}),(0,Q.jsx)(`span`,{className:`oc-access__label`,children:O()})]}):null,w.pageItems.map(e=>{let n=`${t}/${e.agentId}`,i=r.has(n),a=e.presentInLastOk===!1,o=!e.enabled;return(0,Q.jsxs)(`div`,{className:`oc-access__row${o?` is-disabled`:``}`,children:[(0,Q.jsx)(q,{checked:i,disabled:(a||o)&&!i,onCheckedChange:()=>void T(e.agentId,i),"aria-label":h({name:e.displayName??e.agentId})}),(0,Q.jsxs)(`span`,{className:`oc-access__label`,title:e.displayName??e.agentId,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]}),e.model?(0,Q.jsx)(`span`,{className:`oc-access__model`,children:e.model}):null,e.isDefaultOnInstance?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":c(),title:c(),children:(0,Q.jsx)(U,{size:14,fill:`currentColor`})}):null,a?(0,Q.jsx)(G,{variant:`outline`,className:`oc-access__gone`,children:x()}):null]},e.agentId)}),(0,Q.jsx)(st,{page:w.page,pageCount:w.pageCount,onPage:g})]})]})}function ut({groupId:e}){let t=d(l.charts.listGroupChartSelection,e?{groupId:e}:`skip`),n=S(l.charts.assignChartToGroup),r=S(l.charts.removeChartFromGroup),i=S(l.charts.setGroupDefaultChart),a=S(l.charts.addChartToGroupPool),s=S(l.charts.removeChartFromGroupPool),c=H();if(!e)return null;if(t===void 0)return(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:f()});let{pool:u,addable:p,canManagePool:m}=t;if(u.length===0&&!m)return(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:ee()});async function h(t,i){try{i?await r({groupId:e,chartKey:t}):await n({groupId:e,chartKey:t})}catch(e){c.error(R(),e)}}async function g(t){try{await i({groupId:e,chartKey:t})}catch(e){c.error(R(),e)}}async function _(t){try{await a({groupId:e,chartKey:t})}catch(e){c.error(R(),e)}}async function v(t){try{await s({groupId:e,chartKey:t})}catch(e){c.error(R(),e)}}return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-access__list`,children:u.map(e=>(0,Q.jsxs)(`div`,{className:`oc-access__row`,children:[(0,Q.jsx)(q,{checked:e.selected,onCheckedChange:()=>void h(e.chartKey,e.selected),"aria-label":Oe({name:e.name})}),(0,Q.jsx)(`span`,{className:`oc-access__label`,title:e.name,children:e.name}),e.selected?e.isDefault?(0,Q.jsx)(`span`,{className:`oc-access__fav`,role:`img`,"aria-label":j(),title:j(),children:(0,Q.jsx)(U,{size:14,fill:`currentColor`})}):(0,Q.jsx)(V,{type:`button`,variant:`ghost`,size:`sm`,onClick:()=>void g(e.chartKey),children:Ae()}):null,m?(0,Q.jsx)(V,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":E({name:e.name}),title:E({name:e.name}),onClick:()=>void v(e.chartKey),children:(0,Q.jsx)(Me,{size:14,"aria-hidden":!0})}):null]},e.chartKey))}),m?p.length>0?(0,Q.jsxs)(Ye,{value:``,onValueChange:e=>void _(e),children:[(0,Q.jsx)(qe,{size:`sm`,className:`oc-access__search`,children:(0,Q.jsx)(Le,{placeholder:o()})}),(0,Q.jsx)(Ie,{children:p.map(e=>(0,Q.jsx)(Fe,{value:e.chartKey,children:e.name},e.chartKey))})]}):u.length===0?(0,Q.jsx)(`p`,{className:`oc-access__hint`,children:De()}):null:null]})}export{at as GroupsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$x as r,AS as i,Ax as a,BS as o,Bx as s,CS as c,Cx as l,DS as u,Da as d,Dx as f,E as p,ES as m,Ea as h,Ex as g,FP as _,FS as v,Fx as y,GS as b,Gx as x,HS as S,Hx as C,IS as ee,Ix as w,JS as te,Jx as T,KS as ne,Kx as E,LS as re,Lx as D,MP as O,MS as ie,NS as ae,Nx as k,OS as oe,Oa as se,Ox as ce,PP as A,PS as le,Px as ue,QS as de,Qx as fe,RS as j,Rx as M,SS as pe,Sx as me,TS as he,Ta as ge,Tx as _e,US as ve,Ux as ye,VS as be,Vx as xe,WS as Se,Wx as Ce,XS as we,Xx as Te,YS as Ee,Yx as De,ZS as Oe,Zx as ke,_S as Ae,_x as je,aS as Me,bO as N,bS as Ne,bx as Pe,cS as Fe,dS as Ie,dn as Le,dx as Re,eS as ze,e_ as Be,fS as Ve,fn as He,fx as Ue,gS as We,gx as Ge,hS as Ke,hx as qe,iS as Je,jS as Ye,jx as Xe,kS as Ze,kx as Qe,lS as $e,lx as et,mS as tt,mx as nt,nS as rt,oS as it,pS as at,pn as ot,px as st,qS as ct,qx as lt,rS as ut,sS as dt,tS as ft,t_ as pt,uS as mt,ux as P,vS as ht,vx as gt,wS as _t,wx as vt,xS as yt,xx as bt,yO as F,yS as xt,yx as St,zS as Ct,zx as wt}from"./dist-CjH9Ohdx.js";import{a as Tt,c as Et}from"./FieldLabel-BhXlfWG6.js";import{t as I}from"./button-B49JSqzm.js";import{$ as Dt,C as L,H as R,S as z,T as B,U as Ot,_t as V,d as kt,dt as H,et as At,ft as U,ht as W,m as G,mt as K,pt as jt,tt as Mt,vt as Nt,w as q,x as J}from"./index-DnuEILeM.js";import{t as Pt}from"./DataTableShell-DKcU9E8v.js";import{InstanceConfigDialog as Ft}from"./BridgeTab-B6u6wsyS.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:Tt},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=_(p.admin.listInstances,{}),t=_(p.agents.listAllInstanceAgents,{}),n=A(p.admin.upsertInstance),r=A(p.admin.deleteInstance),a=R(),[s,l]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(Q),[h,g]=(0,Y.useState)(null),[y,x]=(0,Y.useState)(null),[C,w]=(0,Y.useState)(null),[T,E]=(0,Y.useState)(null);async function D(){try{await n({instanceId:T??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),E(null),l(!1)}catch(e){a.error(we(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ee(),(0,Z.jsx)(`strong`,{children:te()}),ct()]}),(0,Z.jsx)(Pt,{title:ne(),rows:e,addLabel:b(),onAdd:()=>{E(null),f(Q),l(!0)},emptyHint:Se(),columns:[{header:ve(),cell:e=>e.name,sort:e=>e.name},{header:S(),cell:e=>(0,Z.jsx)(H,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:be(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:o(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:de(),cell:e=>{let n=(t?.[e.name]??[]).filter(e=>e.presentInLastOk!==!1&&e.enabled);if(n.length===0)return(0,Z.jsx)(`span`,{className:`text-muted-foreground`,children:`—`});let r=t=>e.defaultAgentId===t;return(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:[...n].sort((e,t)=>Number(r(t.agentId))-Number(r(e.agentId))).map(e=>(0,Z.jsxs)(H,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?P():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:ee(),onSelect:()=>{E(e._id),f(Bt(e)),l(!0)}},{label:Oe(),onSelect:()=>g(e.name)},{label:yt(),onSelect:()=>w(e)},{label:Ct(),onSelect:()=>x(e)},{label:j(),variant:`destructive`,onSelect:()=>void r({instanceId:e._id})}],bulkActions:[{label:j(),variant:`destructive`,onSelect:e=>e.forEach(e=>void r({instanceId:e}))}]}),(0,Z.jsx)(kt,{open:s,onOpenChange:l,title:T?v():re(),description:ae(),canSubmit:!!(d.name&&d.gatewayUrl),onSubmit:D,submitLabel:ie(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:Ye(),children:[(0,Z.jsx)(U,{value:d.name,disabled:T!==null,onChange:e=>f({...d,name:e.target.value})}),T?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:le()}):null]}),(0,Z.jsx)($,{label:i(),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)(B,{})}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(L,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(L,{value:`hermes`,children:`Hermes`})]})]})}),d.kind===`hermes`?(0,Z.jsx)($,{label:ot(),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)(B,{})}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(L,{value:`ws`,children:He()}),(0,Z.jsx)(L,{value:`rest`,children:Le()})]})]})}):null,(0,Z.jsx)($,{label:Ze(),children:(0,Z.jsx)(U,{value:d.gatewayUrl,onChange:e=>f({...d,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:oe(),children:(0,Z.jsx)(U,{value:d.bridgeUrl,placeholder:u(),onChange:e=>f({...d,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:m(),children:(0,Z.jsx)(U,{value:d.displayName,onChange:e=>f({...d,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:pt(),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)(B,{})}),(0,Z.jsx)(z,{children:Et.map(e=>(0,Z.jsx)(L,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Be()})]}),(0,Z.jsx)($,{label:he(),children:(0,Z.jsx)(U,{value:d.gatewayVersion,placeholder:_t(),onChange:e=>f({...d,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:c(),children:(0,Z.jsx)(U,{value:d.gatewayHttpUrl,placeholder:pe(),onChange:e=>f({...d,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Zt,{instanceName:h,open:h!==null,onOpenChange:e=>{e||g(null)}}),y?(0,Z.jsx)(Ft,{instance:y,onClose:()=>x(null)},y._id):null,C?(0,Z.jsx)(Ht,{instance:C,onClose:()=>w(null)},C._id):null]})}function Ht({instance:e,onClose:t}){let n=_(p.instanceSecrets.listInstanceSecretStatus,{}),r=zt[e.kind??`openclaw`],i=(0,Y.useMemo)(()=>{let t={};for(let r of n??[])r.instanceId===e._id&&(t[r.field]=r.updatedAt);return t},[n,e._id]);return(0,Z.jsx)(jt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(K,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(Nt,{children:Ne({instance:e.displayName??e.name})}),(0,Z.jsx)(W,{children:xt()})]}),(0,Z.jsx)(`div`,{className:`oc-form`,children:r.map(t=>(0,Z.jsx)(Gt,{instanceId:e._id,field:t,updatedAt:i[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=O(p.instanceSync.forceInstanceSync),n=R(),[i,a]=(0,Y.useState)(!1);async function o(){if(!i){a(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(r());break;case`no_agents`:n.success(ke());break;case`no_bridge_url`:n.error(Te());break;case`deploy_misconfigured`:n.error(De());break;case`unauthorized`:n.error(lt());break;case`not_served`:n.error(E());break;default:n.error(T());break}}catch(e){n.error(fe(),e)}finally{a(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:x()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(I,{size:`sm`,variant:`outline`,onClick:()=>void o(),disabled:i,children:i?ze():ft()})})]})}function Wt({instance:e}){let t=_(p.bridgeAuth.listBridgeAuthStatus,{}),n=O(p.bridgeAuth.mintBridgeSecret),r=A(p.bridgeAuth.revokeBridgeSecret),i=R(),[a,o]=(0,Y.useState)(!1),[c,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(!1),f=(t??[]).find(t=>t.instanceId===e._id),m=f!==void 0;async function h(){if(!a){o(!0);try{l((await n({instanceId:e._id})).plaintext),d(!1)}catch(e){i.error(M(),e)}finally{o(!1)}}}async function g(){if(!a){o(!0);try{await r({instanceId:e._id}),l(null),i.success(wt())}catch(e){i.error(M(),e)}finally{o(!1)}}}async function v(){if(c)try{await navigator.clipboard.writeText(c),d(!0)}catch{}}return(0,Z.jsxs)($,{label:Ce(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ye()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(H,{variant:m?`outline`:`secondary`,children:m?`${Ke()} · ${f.prefix}…${f.lastFour}`:tt()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(I,{size:`sm`,onClick:()=>void h(),disabled:a,children:m?xe():C()}),m?(0,Z.jsx)(I,{size:`sm`,variant:`destructive`,onClick:()=>void g(),disabled:a,children:s()}):null]})]}),c?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:D()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:c}),(0,Z.jsx)(I,{variant:`outline`,size:`sm`,onClick:()=>void v(),children:u?N():F()})]}),(0,Z.jsx)(I,{size:`sm`,variant:`ghost`,onClick:()=>{l(null),d(!1)},children:w()})]}):null]})}function Gt({instanceId:e,field:t,updatedAt:n}){let r=O(p.instanceSecrets.setInstanceSecret),i=A(p.instanceSecrets.clearInstanceSecret),a=O(p.deviceIdentity.generateDeviceIdentity),o=R(),[s,c]=(0,Y.useState)(``),[l,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(!1),g=n!==null,_=t===`deviceIdentity`,v=t===`token`?ht():t===`deviceIdentity`?Ae():We();async function y(){if(!(!s.trim()||l)){u(!0);try{await r({instanceId:e,field:t,plaintext:s}),c(``),f(null),h(!1),o.success($e())}catch(e){o.error(Fe(),e)}finally{u(!1)}}}async function b(){if(!l){u(!0);try{await i({instanceId:e,field:t}),f(null),h(!1),o.success(dt())}catch(e){o.error(Fe(),e)}finally{u(!1)}}}async function x(){if(!l){u(!0);try{f(await a({instanceId:e})),h(!1),o.success(Je())}catch(e){o.error(rt(),e)}finally{u(!1)}}}let S=d?`openclaw devices approve ${d.id}`:``;async function C(){if(S)try{await navigator.clipboard.writeText(S),h(!0)}catch{}}return(0,Z.jsxs)($,{label:v,children:[_?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Me()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(H,{variant:g?`outline`:`secondary`,children:g?Ke():tt()}),(0,Z.jsx)(U,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:s,placeholder:g?Ve():at(),onChange:e=>c(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(I,{size:`sm`,onClick:()=>void y(),disabled:l||s.trim().length===0,children:Ie()}),_?(0,Z.jsx)(I,{size:`sm`,variant:`outline`,onClick:()=>void x(),disabled:l,children:it()}):null,g?(0,Z.jsx)(I,{size:`sm`,variant:`destructive`,onClick:()=>void b(),disabled:l,children:mt()}):null]})]}),d?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:Je()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ut()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:S}),(0,Z.jsx)(I,{variant:`outline`,size:`sm`,onClick:()=>void C(),children:m?N():F()})]}),(0,Z.jsx)(I,{size:`sm`,variant:`ghost`,onClick:()=>{f(null),h(!1)},children:w()})]}):null]})}var Kt={conversational:_e,documentary:l,summarizer:se,curator:h},qt={conversational:vt,documentary:me,summarizer:d,curator:ge},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:Qe()}),t.map(e=>(0,Z.jsx)(H,{variant:`secondary`,className:`oc-agenttype__chip`,title:Yt(e),children:Jt(e)},e)),(0,Z.jsxs)(Dt,{children:[(0,Z.jsx)(Mt,{asChild:!0,children:(0,Z.jsx)(I,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:ce()})}),(0,Z.jsxs)(At,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:f()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:g()}),(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)(G,{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 r=_(p.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=A(p.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(p.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(p.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),a=A(p.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(p.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(p.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),o=A(p.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(p.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=Rt(r);e.setQuery(p.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),s=A(p.agents.setAgentDescription).withOptimisticUpdate((e,{instanceName:t,agentId:n,description:r})=>{let i=e.getQuery(p.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=r.trim();e.setQuery(p.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,description:a.length===0?null:a}:e)})}),c=A(p.agents.removeInstanceAgent),l=Ot(),u=R();async function d(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){u.error(k(),e)}}async function f(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){u.error(k(),e)}}async function m(t,n,r){if(!e)return;let i=r.includes(n)?r.filter(e=>e!==n):[...r,n];try{await o({instanceName:e,agentId:t,types:i})}catch(e){u.error(k(),e)}}async function h(t,n){if(e&&await l({title:St({name:n}),description:gt(),confirmLabel:je(),destructive:!0}))try{await c({instanceName:e,agentId:t}),u.success(Ge())}catch(e){u.error(k(),e)}}return(0,Z.jsx)(jt,{open:t,onOpenChange:n,children:(0,Z.jsxs)(K,{className:`oc-access`,children:[(0,Z.jsxs)(V,{children:[(0,Z.jsx)(Nt,{children:y({name:e??``})}),(0,Z.jsx)(W,{children:ue()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:qe()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?nt():r.discovery.lastPollOk?st():Ue({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:Re()}):(0,Z.jsx)(`div`,{className:`oc-access__list`,children:r.agents.map(t=>{let n=t.presentInLastOk===!1,i=r.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)(G,{checked:t.enabled,disabled:n,"aria-label":a,onCheckedChange:e=>void d(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)(H,{variant:`outline`,className:`oc-access__gone`,children:et()}),(0,Z.jsx)(I,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void h(t.agentId,a),children:Pe()})]}):i?(0,Z.jsx)(H,{variant:`default`,children:P()}):(0,Z.jsx)(I,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!t.enabled,onClick:()=>void f(t.agentId),children:bt()})]}),t.enabled?(0,Z.jsx)(Xt,{agentId:t.agentId,types:o,onToggle:e=>void m(t.agentId,e,o)}):null,t.enabled?(0,Z.jsx)(Qt,{value:t.description??``,onSave:async n=>{if(e)try{await s({instanceName:e,agentId:t.agentId,description:n})}catch(e){u.error(k(),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)(U,{className:`oc-agentcard__desc`,value:n,maxLength:280,placeholder:Xe(),"aria-label":a(),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{Aw as r,Bw as i,E as a,FP as o,Fw as s,Go as c,Ho as l,Hw as u,Iw as d,Jo as f,Ko as p,Lw as m,MP as h,Mw as g,Nw as _,PP as v,Pw as y,Rw as b,Uo as x,Vo as S,Vw as C,Wo as w,Yo as T,jw as E,kw as D,qo as O,zw as k}from"./dist-CjH9Ohdx.js";import{t as A}from"./button-B49JSqzm.js";import{dt as j,ft as M,m as N}from"./index-DnuEILeM.js";var P=t(e(),1),F=n();function I(){let e=o(a.integrations.status.status,{}),t=v(a.admin.setIntegrationConfig),[n,c]=(0,P.useState)(null);if((0,P.useEffect)(()=>{e&&n===null&&c(e.config)},[e,n]),!e||!n)return(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:u()});let l=n,p=(e,t,n)=>c({...l,[e]:{...l[e],[t]:n}}),h=(e,n)=>void t({[e]:n});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[C(),` `,(0,F.jsx)(`strong`,{children:i()}),` `,k()]}),(0,F.jsxs)(L,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,F.jsx)(j,{variant:`secondary`,children:b()}):(0,F.jsx)(j,{variant:`outline`,children:m()}):(0,F.jsx)(j,{variant:`outline`,children:d()}),note:s(),children:[(0,F.jsx)(R,{label:_(),children:(0,F.jsx)(M,{value:l.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>p(`langfuse`,`host`,e.target.value),onBlur:()=>h(`langfuse`,{host:l.langfuse.host??``})})}),(0,F.jsx)(z,{label:D(),checked:l.langfuse.enabled??!0,onChange:e=>{p(`langfuse`,`enabled`,e),h(`langfuse`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,F.jsx)(j,{variant:`secondary`,children:b()}):(0,F.jsx)(j,{variant:`outline`,children:m()}):(0,F.jsx)(j,{variant:`outline`,children:d()}),note:y(),children:[(0,F.jsx)(R,{label:g(),children:(0,F.jsx)(M,{value:l.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>p(`opik`,`baseUrl`,e.target.value),onBlur:()=>h(`opik`,{baseUrl:l.opik.baseUrl??``})})}),(0,F.jsx)(R,{label:E(),children:(0,F.jsx)(M,{value:l.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||r(),onChange:e=>p(`opik`,`workspace`,e.target.value),onBlur:()=>h(`opik`,{workspace:l.opik.workspace??``})})}),(0,F.jsx)(z,{label:D(),checked:l.opik.enabled??!0,onChange:e=>{p(`opik`,`enabled`,e),h(`opik`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,F.jsx)(j,{variant:`secondary`,children:b()}):(0,F.jsx)(j,{variant:`outline`,children:m()}):(0,F.jsx)(j,{variant:`outline`,children:T()}),note:f(),children:[(0,F.jsx)(R,{label:O(),children:(0,F.jsx)(M,{value:l.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>p(`otlp`,`endpoint`,e.target.value),onBlur:()=>h(`otlp`,{endpoint:l.otlp.endpoint??``})})}),(0,F.jsx)(B,{headersSet:e.otlp.headersSet}),(0,F.jsx)(z,{label:D(),checked:l.otlp.enabled??!0,onChange:e=>{p(`otlp`,`enabled`,e),h(`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=h(a.integrations.otlpSecret.setOtlpHeaders),n=v(a.integrations.otlpSecret.clearOtlpHeaders),[r,i]=(0,P.useState)(``),[o,s]=(0,P.useState)(null),[u,d]=(0,P.useState)(!1),f=async()=>{d(!0),s(null);try{await t({headersJson:r}),i(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{d(!1)}};return(0,F.jsxs)(R,{label:p(),children:[(0,F.jsx)(M,{value:r,placeholder:e?c():w(),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:x()}),e?(0,F.jsx)(A,{variant:`ghost`,size:`sm`,disabled:u,onClick:()=>void n({}),children:l()}):null]}),o?(0,F.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:o}):null,(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:S()})]})}export{I as IntegrationsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$ as r,$k as i,Bk as a,E as o,EP as s,FP as c,Fk as l,Gk as u,Hk as d,Ik as f,J as p,Jk as m,Kk as ee,Lk as te,MS as ne,Mk as re,Nk as ie,PP as h,Pk as ae,Q as oe,Qk as se,Rk as ce,Uk as le,Vk as g,Wk as ue,X as de,Xk as fe,Y as pe,Yk as me,Z as he,Zk as _,_A as v,_P as y,aA as b,aP as x,cA as S,cP as C,ct as w,dA as T,dP as E,eA as D,et as O,fA as k,fP as A,gA as j,gP as M,hA as N,hP as P,iA as F,iP as I,lA as L,lP as R,mA as ge,mP as _e,mt as ve,n as z,nA as ye,nP as be,oA as xe,oP as Se,pA as Ce,pP as we,pt as Te,q as Ee,qk as De,rA as Oe,rP as ke,sA as Ae,sP as je,tA as Me,tP as Ne,uA as Pe,uP as Fe,vP as Ie,xP as Le,zk as B}from"./dist-CjH9Ohdx.js";import{t as V}from"./button-B49JSqzm.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-DnuEILeM.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:()=>v()},{id:`composer`,label:()=>j()},{id:`sidebar`,label:()=>N()},{id:`notifications`,label:()=>se()},{id:`other`,label:()=>ge()}],X={showSource:{category:`messages`,label:()=>Ce(),help:()=>k()},showReport:{category:`messages`,label:()=>T(),help:()=>Pe()},copyAssistant:{category:`messages`,label:()=>L()},copyUser:{category:`messages`,label:()=>S()},showDelete:{category:`messages`,label:()=>Ae()},showTools:{category:`messages`,label:()=>xe(),help:()=>b()},voiceInput:{category:`composer`,label:()=>F(),help:()=>Oe()},showUsage:{category:`composer`,label:()=>ye(),help:()=>Me()},autoReadAloud:{category:`composer`,label:()=>ve(),help:()=>Te()},showChatAge:{category:`sidebar`,label:()=>D(),help:()=>i()},notifSound:{category:`notifications`,label:()=>_(),help:()=>fe()},notifSystem:{category:`notifications`,label:()=>me(),help:()=>m()},replySound:{category:`notifications`,label:()=>De(),help:()=>ee()}};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:()=>f()};function rt({prefKey:e,ui:t}){let n=h(o.admin.setUiPrefDefault),r=h(o.admin.setFeatureEnabled),i=tt(e),s=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:a()}),(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:ae()}),(0,J.jsx)(H,{value:`off`,children:ie()}),(0,J.jsx)(H,{value:`inherit`,children:re()})]})]}),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]}),s?(0,J.jsx)(`span`,{className:`oc-prefs__gov-help`,children:s}):null]})}function it({current:e,enabled:t}){let n=h(o.me.setDictationShortcut),[i,a]=(0,q.useState)(!1),[s,c]=(0,q.useState)(!1);return(0,q.useEffect)(()=>{if(!i)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){a(!1);return}let t=Ve(e);if(t===null){[`Shift`,`Control`,`Meta`,`Alt`].includes(e.key)||(c(!0),window.setTimeout(()=>c(!1),1800));return}a(!1),n({shortcut:t})};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[i,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:[O(),e?(0,J.jsx)(U,{variant:`secondary`,children:Re(e,qe())}):null]}),(0,J.jsx)(`span`,{className:`oc-prefs__help`,children:s?he():i?oe():r()})]}),(0,J.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[e&&!i?(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void n({shortcut:null}),children:Ee()}):null,(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,disabled:!t,"aria-pressed":i,onClick:()=>a(e=>!e),children:i?p():e?pe():de()})]})]})}function at(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),i=c(o.me.getMe,{host:K}),a=i?.ui,f=$(i?.role)&&n,p=h(o.me.setUiPref).withOptimisticUpdate(Ue),m=(0,q.useMemo)(()=>a?Q(Object.keys(a.effective),e):[],[a,e]);return a?(0,J.jsxs)(`div`,{className:`oc-prefs-panel`,children:[$(i?.role)?(0,J.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,J.jsx)(G,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":g()}),g()]}):null,f?(0,J.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,J.jsx)(`p`,{children:ce()}),(0,J.jsx)(`p`,{children:te()}),(0,J.jsx)(`p`,{children:l()})]}):null,(0,J.jsx)(W,{value:e,onChange:e=>t(e.target.value),placeholder:u(),"aria-label":u(),className:`mb-2`}),m.length===0?(0,J.jsx)(`div`,{className:`oc-prefs__empty`,children:ue()}):(0,J.jsx)(`div`,{className:`oc-prefs`,children:m.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=a.locked[e],o=a.effective[e],s=a.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:le()}):s?(0,J.jsx)(U,{variant:`secondary`,children:w()}):null]}),r?(0,J.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,J.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&s?(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void p({key:e,value:null}),children:d()}):null,(0,J.jsx)(Ye,{checked:o,disabled:i,onCheckedChange:t=>{e===`notifSystem`&&t&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission(),p({key:e,value:t})},"aria-label":n})]}),f?(0,J.jsx)(rt,{prefKey:e,ui:a}):null]},e)})]},e.id))}),(0,J.jsx)(it,{current:i?.dictationShortcut??null,enabled:a.effective.voiceInput===!0})]}):(0,J.jsx)(`div`,{className:`oc-prefs__empty`,children:s()})}var ot={sm:()=>Se(),md:()=>x(),lg:()=>I(),xl:()=>ke()};function st(){let e=c(o.me.getMe,{host:K}),t=h(o.me.setLocale),n=h(o.me.setFontScale).withOptimisticUpdate((e,{scale:t})=>{let n=e.getQuery(o.me.getMe,{host:K});n&&e.setQuery(o.me.getMe,{host:K},{...n,fontScale:t,resolvedFontScale:t??`md`})}),r=h(o.me.setMyName),i=ze(),a=e?.locale??`default`,s=e?.name??``,[l,u]=(0,q.useState)(null),d=l??s,f=d.trim()!==s.trim();async function p(){try{await r({name:d}),u(null),i.success(_e())}catch(e){i.error(we(),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:Ie()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:y()})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(W,{className:`max-w-xs`,value:d,maxLength:120,placeholder:M(),onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&f&&(e.preventDefault(),p())}}),(0,J.jsx)(V,{size:`sm`,disabled:!f,onClick:()=>void p(),children:ne()})]}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:P()})]}),(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:A()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:E()})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[Je().map(e=>(0,J.jsx)(V,{variant:a===e.value?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:e.value}),children:e.label},e.value)),(0,J.jsx)(V,{variant:a==="default"?`default`:`outline`,size:`sm`,onClick:()=>void t({locale:null}),children:Le()})]}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Fe()})]}),(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:R()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:C()})]}),(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:je()})]}),(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:be()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Ne()})]}),(0,J.jsx)(at,{})]})]})}export{st as PreferencesTab};
@@ -1,4 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Aa as r,Bg as i,E as a,FP as o,Fg as s,Gg as c,Gr as l,Hg as u,Ig as d,Jg as f,Jr as p,Kg as m,Kr as h,Lg as g,Ma as _,Mg as v,Na as ee,Ng as te,PP as ne,Pg as re,Rg as y,Ug as b,Vg as x,Wg as S,Wr as C,Xg as w,Yg as T,Yr as E,Zg as ie,a_ as ae,gn as D,hn as O,i_ as k,ja as A,ka as j,mn as M,qg as N,qr as P,zg as F}from"./dist-CjH9Ohdx.js";import{d as I,f as L,i as R,l as z,n as B,r as V,t as oe,u as H}from"./FieldLabel-BhXlfWG6.js";import{t as U}from"./button-B49JSqzm.js";import{C as W,H as G,S as K,T as q,m as se,w as J,wt as ce,x as Y}from"./index-DnuEILeM.js";import{r as X,t as le}from"./locales-CPjguROj.js";import{t as ue}from"./localePickerView-C2RmOS86.js";/* empty css */var Z=t(e(),1),Q=n(),$={media_delivery:{label:m,help:c},documentary_fetch:{label:S,help:b},inbound_files:{label:u,help:x},history_summary:{label:ee,help:_},file_curation:{label:E,help:p}},de={outboundDir:`/home/node/.openclaw/media/outbound`,references:`- gdrive/1a2b3c4d5e6f7890abcd
2
- - gdrive/0f9e8d7c6b5a4321dcba`,files:`- /home/node/.openclaw/media/inbound/rapport.pdf (124800 o, application/pdf)`,previous_summary:`Projet Alpha : budget 40 000 EUR ; choix du serveur en cours.`,new_messages:`Utilisateur : Compare OVH et Scaleway.
3
- Assistant : Comparaison en cours.`,max_chars:`6000`,file_name:`MEMORY.md`,budget_chars:`20000`,feedback:`Trop de suppressions dans la section des liens, garde-les.`,content:`# Memory index
4
- - [Fait 1](fait-1.md) - note du projet`},fe={outboundDir:re,references:te,files:v,previous_summary:A,new_messages:r,max_chars:j,file_name:P,budget_chars:h,feedback:l,content:C};function pe(){let e=o(a.admin.listInstances,{}),[t,n]=(0,Z.useState)(null);if(e===void 0)return(0,Q.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,Q.jsx)(`div`,{className:`oc-injtab`,children:(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:F()})});let r=e.find(e=>e._id===t)??e[0];return(0,Q.jsxs)(`div`,{className:`oc-injtab`,children:[(0,Q.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,Q.jsx)(B,{label:ie(),help:w()}),(0,Q.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,Q.jsx)(`span`,{children:i()}),(0,Q.jsxs)(Y,{value:r._id,onValueChange:e=>n(e),children:[(0,Q.jsx)(J,{size:`sm`,className:`min-w-44`,children:(0,Q.jsx)(q,{})}),(0,Q.jsx)(K,{children:e.map(e=>(0,Q.jsx)(W,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,Q.jsx)(me,{instance:r},r._id)]})}function me({instance:e}){let t=ne(a.admin.upsertInstanceConfig),n=G(),r=o(a.me.getMe,{host:ce}),i=e.config??{},s=X(e.config?.contentLocale,r?.defaultLocale??void 0),[c,l]=(0,Z.useState)(()=>R(i,s));(0,Z.useEffect)(()=>{l(R(i,s))},[s,e._id]);let[u,d]=(0,Z.useState)(!1),f=c.promptInjections,p=(e,t)=>l({...c,promptInjections:{...f,[e]:{...f[e],...t}}});async function m(){d(!0);try{await t({instanceId:e._id,config:V(c,i,s)})}catch(e){n.error(k(),e)}finally{d(!1)}}async function h(r){let i={...e.config??{}};r==="default"?delete i.contentLocale:i.contentLocale=r;try{await t({instanceId:e._id,config:i})}catch(e){n.error(k(),e)}}let g=e.config?.contentLocale??`default`,_=le[X(void 0,r?.defaultLocale??void 0)];return(0,Q.jsxs)(`div`,{className:`oc-injtab__body`,children:[(0,Q.jsxs)(`div`,{className:`oc-injtab__content-locale`,children:[(0,Q.jsx)(`span`,{children:D()}),(0,Q.jsxs)(Y,{value:g,onValueChange:e=>void h(e),children:[(0,Q.jsx)(J,{size:`sm`,className:`min-w-44`,children:(0,Q.jsx)(q,{})}),(0,Q.jsxs)(K,{children:[(0,Q.jsx)(W,{value:`default`,children:M({locale:_})}),ue().map(e=>(0,Q.jsx)(W,{value:e.value,children:e.label},e.value))]})]}),(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:O()})]}),H.map(e=>(0,Q.jsx)(he,{injKey:e,def:z[e],i18n:$[e],row:f[e]??{enabled:!0,template:z[e].defaultTemplate[s]},contentLocale:s,onChange:t=>p(e,t)},e)),(0,Q.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,Q.jsx)(U,{size:`sm`,onClick:()=>void m(),disabled:u,children:ae()})})]})}function he({injKey:e,def:t,i18n:n,row:r,contentLocale:i,onChange:a}){let[o,c]=(0,Z.useState)(!1),l=r.template.trim()!==t.defaultTemplate[i],u=t.togglable&&!r.enabled,p=Object.fromEntries(t.placeholders.map(e=>[e,de[e]??`{${e}}`])),m=I(e,r,i),h=m?L(m,p):``;return(0,Q.jsxs)(`section`,{className:`oc-injcard`,children:[(0,Q.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,Q.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Q.jsx)(se,{checked:r.enabled,onCheckedChange:e=>a({enabled:e===!0})}),(0,Q.jsx)(B,{label:n.label(),help:n.help()})]}):(0,Q.jsx)(B,{label:n.label(),help:n.help()}),l&&(0,Q.jsx)(`span`,{className:`oc-injection__badge`,children:f()})]}),(0,Q.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.template,disabled:u,rows:8,spellCheck:!1,onChange:e=>a({template:e.target.value})}),(0,Q.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,Q.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,Q.jsx)(`span`,{className:`oc-injection__ph`,children:N()}),t.placeholders.map(e=>(0,Q.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,Q.jsx)(`code`,{children:`{${e}}`}),(0,Q.jsx)(oe,{text:(fe[e]??(()=>e))()})]},e))]}),(0,Q.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,Q.jsx)(U,{variant:`ghost`,size:`sm`,onClick:()=>c(e=>!e),children:o?g():y()}),l&&(0,Q.jsx)(U,{variant:`ghost`,size:`sm`,onClick:()=>a({template:t.defaultTemplate[i]}),children:T()})]})]}),o&&(0,Q.jsx)(`div`,{className:`oc-injcard__preview`,children:h?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:h}),(0,Q.jsx)(`span`,{className:`oc-injection__ph`,children:d()})]}):(0,Q.jsx)(`span`,{className:`oc-injection__ph`,children:s()})})]})}export{pe as PromptInjectionsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ab as r,Bb as i,Cb as ee,Db as te,E as a,Eb as ne,FP as o,Fb as s,Gb as c,Hb as l,Ib as u,Kb as d,Lb as f,Mb as re,Nb as p,Ob as m,PP as h,Pb as g,Rb as _,Sb as v,Tb as y,Ub as b,Vb as x,Wb as S,ab as ie,bb as ae,cb as C,db as w,fb as T,ib as E,jb as D,kb as O,lb as k,ob as A,qb as j,sb as M,ub as N,vb as P,wb as F,xb as I,yb as L,yi as R,zb as z}from"./dist-CjH9Ohdx.js";import{t as B}from"./button-B49JSqzm.js";import{Gt as V,H,U,d as W,dt as G,ft as K,m as q}from"./index-DnuEILeM.js";import{t as J}from"./roleDescriptions-C6Gqx97s.js";var Y=t(e(),1),X=n(),Z=[{group:()=>j(),keys:[{key:`traces.read`,label:()=>l()},{key:`traces.read.content`,label:()=>x(),phi:!0},{key:`traces.write`,label:()=>i()}]},{group:()=>d(),keys:[{key:`kpi.read`,label:()=>l()},{key:`kpi.write`,label:()=>i()}]},{group:()=>c(),keys:[{key:`openclaw.query`,label:()=>z()},{key:`anomalies.read`,label:()=>_()},{key:`anomalies.report`,label:()=>f()}]},{group:()=>S(),keys:[{key:`chats.read`,label:()=>l()},{key:`selfheal`,label:()=>s()},{key:`feedback.respond`,label:()=>R()}]},{group:()=>b(),keys:[{key:`admin.manage`,label:()=>u()}]}],oe=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function se(){let e=o(a.apiKeys.listRoles,{}),t=h(a.apiKeys.createRole),n=h(a.apiKeys.ensureRolesSeeded),i=h(a.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(a.apiKeys.listRoles,{});r&&e.setQuery(a.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),s=U(),c=H(),[l,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)($),[_,b]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{c.error(p(),e)})},[n,c]);let x=e??[];async function S(e,t){if(Q(e.permissions))return;if(e.builtin){await s({title:re({name:e.name}),description:D(),confirmLabel:r()});return}if(_.has(e._id))return;let n=e.permissions.includes(t)?e.permissions.filter(e=>e!==t):[...e.permissions,t];b(t=>new Set(t).add(e._id));try{await i({roleId:e._id,permissions:n})}catch(e){c.error(O(),e)}finally{b(t=>{let n=new Set(t);return n.delete(e._id),n})}}async function j(){try{await t({key:d.key,name:d.name,description:d.description||void 0,permissions:[]}),f($),u(!1)}catch(e){c.error(m(),e)}}let R=e===void 0,z=!R&&x.length===0;return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`p`,{className:`oc-admin__hint`,children:[te(),` `,(0,X.jsx)(`code`,{children:`admin`}),` `,ne(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,y()]}),(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:()=>{f($),u(!0)},children:ee()})})]}),R?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:v()}):z?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:I()}):(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:ae()}),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?g({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:x.map(e=>{let t=Q(e.permissions),n=_.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,{}),` `,L()]}):(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?T():n?w():r,onCheckedChange:()=>void S(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(W,{open:l,onOpenChange:u,title:N(),description:k(),canSubmit:!!(d.key&&d.name),onSubmit:j,submitLabel:C(),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:M()}),(0,X.jsx)(K,{value:d.key,placeholder:A(),onChange:e=>f({...d,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:ie()}),(0,X.jsx)(K,{value:d.name,onChange:e=>f({...d,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:E()}),(0,X.jsx)(K,{value:d.description,onChange:e=>f({...d,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{$j as r,AM as i,CM as a,D as o,DM as s,E as c,EM as l,EP as u,FM as ee,IM as d,LM as f,MM as te,MP as p,NM as m,OM as ne,OP as re,Qj as ie,RM as ae,SM as oe,TM as se,Wj as ce,Xj as le,Yj as ue,Zj as de,aM as fe,aN as pe,cM as me,cN as he,dM as h,dN as ge,eM as _e,fM as ve,fN as ye,gN as be,hN as xe,iM as Se,iN as Ce,jM as we,kM as Te,lM as Ee,lN as g,mN as De,nM as Oe,nN as ke,oM as Ae,oN as je,pN as Me,rM as Ne,rN as Pe,sM as Fe,sN as Ie,tM as Le,uM as _,uN as Re,zM as ze}from"./dist-CjH9Ohdx.js";import{t as v}from"./button-B49JSqzm.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-DnuEILeM.js";import{a as lt,i as D,n as ut,o as O,r as k,t as dt}from"./table-COx9FvKU.js";var ft=o(`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=p(c.scheduled.listMyCrons),t=p(c.scheduled.getCronDetail),n=p(c.scheduled.listCronRuns),o=p(c.scheduled.updateCron),P=p(c.scheduled.removeCron),pt=p(c.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(re(),{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:m({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:m({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:m({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:ue()});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:le()});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 o({instanceName:K.instanceName,jobId:K.jobId,patch:e}),F.success(Ee()),t===$.current&&q(null),await Y()}catch(e){F.toast({variant:`error`,title:m({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:be()}),(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}),xe()]})]}),I===null?(0,j.jsx)(`p`,{className:`oc-admin__hint`,"aria-busy":L,children:z?De():u()}):(0,j.jsxs)(j.Fragment,{children:[z?(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:De()}):null,I.length===0?(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:Me()}):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:ge({code:e.error})}):e.jobs.length===0?(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:Re()}):(0,j.jsxs)(dt,{children:[(0,j.jsx)(lt,{children:(0,j.jsxs)(O,{children:[(0,j.jsx)(D,{children:g()}),(0,j.jsx)(D,{children:he()}),(0,j.jsx)(D,{children:Ie()}),(0,j.jsx)(D,{children:je()}),(0,j.jsx)(D,{children:pe()}),(0,j.jsx)(D,{children:ve()})]})}),(0,j.jsx)(ut,{children:e.jobs.map((t,n)=>{let r=`${e.instanceName}:${t.id??n}`,a=V===r,s=e.manageSupported,c=e.kind===`openclaw`&&s;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??Ce()}),(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:ke()}):t.enabled===!1?(0,j.jsx)(b,{variant:`outline`,children:Pe()}):(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:[c?(0,j.jsx)(v,{variant:`ghost`,size:`icon-sm`,title:ae(),"aria-label":ae(),disabled:V!==null,onClick:()=>void Z(r,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`}}},te()),children:(0,j.jsx)(Je,{size:14,"aria-hidden":!0})}):null,c&&t.enabled!==null?(0,j.jsx)(v,{variant:`ghost`,size:`icon-sm`,title:t.enabled?f():d(),"aria-label":t.enabled?f():d(),disabled:V!==null,onClick:()=>void Z(r,()=>o({instanceName:e.instanceName,jobId:t.id,patch:{enabled:!t.enabled}}),t.enabled?we():i()),children:t.enabled?(0,j.jsx)(Qe,{size:14,"aria-hidden":!0}):(0,j.jsx)(et,{size:14,"aria-hidden":!0})}):null,c?(0,j.jsx)(v,{variant:`ghost`,size:`icon-sm`,title:h(),"aria-label":h(),disabled:V!==null,onClick:()=>void bt(e.instanceName,t),children:(0,j.jsx)(We,{size:14,"aria-hidden":!0})}):null,c?(0,j.jsx)(v,{variant:`ghost`,size:`icon-sm`,title:_(),"aria-label":_(),disabled:V!==null,onClick:()=>void yt(e.instanceName,t),children:(0,j.jsx)(ft,{size:14,"aria-hidden":!0})}):null,s?(0,j.jsx)(v,{variant:`ghost`,size:`icon-sm`,title:ee(),"aria-label":ee(),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:ye()})]},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:ne()}),(0,j.jsx)(nt,{children:s({name:H?.name??``})})]}),(0,j.jsxs)(tt,{children:[(0,j.jsx)(st,{children:l()}),(0,j.jsx)(Ke,{onClick:()=>{let e=H;U(null),e!==null&&Z(`${e.instanceName}:${e.jobId}`,()=>P({instanceName:e.instanceName,jobId:e.jobId}),Te())},children:se()})]})]})}),(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:me({name:W?.name??``})})}),W?.entries===null?(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):W!==null&&W.entries.length===0?(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:Fe()}):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:a()}):e.status===`error`?(0,j.jsx)(b,{variant:`destructive`,children:oe()}):(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:Ae()}),(0,j.jsx)(ot,{children:fe()})]}),K===null?null:K.loading?(0,j.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(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:g()}),(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:Se()}),(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:Ne()}),(0,j.jsx)(y,{value:`every`,children:Oe()}),(0,j.jsx)(y,{value:`at`,children:Le()})]})]}),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:_e()}),(0,j.jsx)(y,{value:`hours`,children:r()}),(0,j.jsx)(y,{value:`days`,children:ie()})]})]})]}):(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:ze()}),(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:l()}),(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,de()]})]})]})})]})}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,AO as i,Ak as ee,BO as te,CO as a,Ck as ne,DO as o,Dk as re,E as s,EO as c,Ek as l,FO as ie,FP as u,GO as ae,HO as oe,IO as se,JO as ce,KO as le,LO as ue,MO as d,MP as de,NO as f,OO as p,Ok as fe,PO as m,PP as h,QO as pe,RO as me,SO as he,Sk as ge,TO as _e,Tk as ve,UO as ye,VO as be,WO as xe,XO as Se,YO as Ce,ZO as we,_O as g,_k as Te,ak as Ee,bO as _,bk as De,ck as Oe,dO as v,dk as ke,ek as Ae,fO as y,fk as je,gO as b,gk as Me,hO as x,hk as Ne,ik as Pe,jO as S,jk as Fe,kO as C,kk as Ie,lk as Le,mO as w,mk as Re,nk as ze,ok as Be,pO as T,pk as Ve,qO as He,rk as Ue,sk as We,tk as Ge,uk as Ke,vO as E,vk as qe,wO as D,wk as Je,xO as O,xk as Ye,yO as k,yk as Xe,zO as Ze}from"./dist-CjH9Ohdx.js";import{n as A}from"./dist-C0sZxuDo.js";import{i as Qe}from"./dist-DCbB4klt.js";import{t as j}from"./button-B49JSqzm.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 rt,gt as R,ht as z,mt as B,nn as it,nt as V,pt as at,rn as ot,rt as H,vt as U,w as W,x as G}from"./index-DnuEILeM.js";import{t as st}from"./FilterBar-BVzupjQK.js";import{t as ct}from"./DataTableShell-DKcU9E8v.js";import{t as lt}from"./roleDescriptions-C6Gqx97s.js";var K=t(e(),1),q=n(),J=[{value:`never`,label:()=>g(),days:null},{value:`30`,label:()=>b(),days:30},{value:`90`,label:()=>x(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=ot({from:`/settings/serviceAccounts`}),t=it({from:`/settings/serviceAccounts`}),n=e.q??``,i=e.status??X,[a,o]=(0,K.useState)(X),c=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),d=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),f=u(s.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:a===X?void 0:a,disabled:i===X?void 0:i===`disabled`}}),p=u(s.apiKeys.listKeys,{}),m=u(s.apiKeys.listRoles,{}),he=h(s.apiKeys.createServiceAccount),_e=h(s.apiKeys.updateServiceAccount),g=h(s.apiKeys.deleteServiceAccount),_=de(s.apiKeys.mintApiKey),v=h(s.apiKeys.revokeApiKey),y=et(),b=$e(),x=n!==``||a!==X||i!==X;function S(){o(X),t({search:{},replace:!0})}let[C,w]=(0,K.useState)(!1),[T,E]=(0,K.useState)(Z),[D,O]=(0,K.useState)(null),[k,A]=(0,K.useState)(new Set),[F,I]=(0,K.useState)(null),R=(0,K.useRef)(!1),[z,B]=(0,K.useState)(new Set),[V,at]=(0,K.useState)({}),[H,U]=(0,K.useState)(null),Y=(0,K.useMemo)(()=>{let e=new Map;for(let t of p??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[p]);function Q(e){A(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{D?(await _e({serviceAccountId:D,name:T.name,roleKey:T.roleKey,description:T.description}),b.success(Ce())):await he({name:T.name,roleKey:T.roleKey,description:T.description||void 0}),E(Z),O(null),w(!1)}catch(e){b.error(D?Se():we(),e)}}function pt(e){E({name:e.name,roleKey:e.roleKey,description:e.description??``}),O(e._id),w(!0)}async function mt(e){if(R.current)return;R.current=!0;let t=V[e._id]??`never`,n=J.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;I(e._id);try{let t=await _({serviceAccountId:e._id,expiresAt:r});U({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){b.error(ce(),e)}finally{R.current=!1,I(null)}}async function $(e){if(await y({title:He(),description:(0,q.jsxs)(q.Fragment,{children:[le(),` `,(0,q.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,ae(),` `,(0,q.jsx)(`strong`,{children:xe()}),` `,ye()]}),confirmWord:e.name,confirmLabel:oe(),destructive:!0}))try{await g({serviceAccountId:e._id}),b.success(be(),e.name)}catch(e){b.error(te(),e)}}async function ht(e){if(await y({title:Ze(),description:(0,q.jsxs)(q.Fragment,{children:[me(),` `,(0,q.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,ue()]}),confirmLabel:se(),destructive:!0})&&!z.has(e._id)){B(t=>new Set(t).add(e._id));try{await v({keyId:e._id})}catch(e){b.error(ie(),e)}finally{B(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:Fe()}),(0,q.jsxs)(st,{q:n,onQChange:c,searchPlaceholder:ee(),onReset:S,canReset:x,children:[(0,q.jsxs)(G,{value:a,onValueChange:o,children:[(0,q.jsx)(W,{size:`sm`,className:`w-40`,children:(0,q.jsx)(P,{placeholder:Ie()})}),(0,q.jsxs)(N,{children:[(0,q.jsx)(M,{value:X,children:fe()}),(m??[]).map(e=>(0,q.jsx)(M,{value:e.key,children:e.key},e._id))]})]}),(0,q.jsxs)(G,{value:i,onValueChange:d,children:[(0,q.jsx)(W,{size:`sm`,className:`w-36`,children:(0,q.jsx)(P,{})}),(0,q.jsxs)(N,{children:[(0,q.jsx)(M,{value:X,children:re()}),(0,q.jsx)(M,{value:`active`,children:l()}),(0,q.jsx)(M,{value:`disabled`,children:ve()})]})]})]}),(0,q.jsx)(ct,{title:Je(),rows:f,addLabel:ne(),onAdd:()=>{E(Z),O(null),w(!0)},emptyHint:ge(),isExpanded:e=>k.has(e._id),renderExpanded:e=>(0,q.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:z}),rowActions:e=>[{label:qe(),onSelect:()=>pt(e)},{label:Ye(),onSelect:()=>void mt(e)},{label:k.has(e._id)?De():Xe(),onSelect:()=>Q(e._id)},{label:Te(),variant:`destructive`,onSelect:()=>void $(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,q.jsx)(j,{variant:`ghost`,size:`icon-sm`,"aria-label":k.has(e._id)?Me():Ne(),onClick:()=>Q(e._id),children:k.has(e._id)?(0,q.jsx)(Qe,{}):(0,q.jsx)(nt,{})})},{header:Re(),sort:e=>e.name,cell:e=>(0,q.jsxs)(`div`,{className:`flex flex-col`,children:[(0,q.jsx)(`span`,{children:e.name}),e.description?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Ve(),sort:e=>e.roleKey,cell:e=>(0,q.jsx)(L,{variant:`secondary`,children:e.roleKey})},{header:je(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,q.jsx)(L,{variant:`destructive`,children:ve()}):(0,q.jsx)(L,{variant:`outline`,children:l()})},{header:ke(),cell:e=>(0,q.jsxs)(G,{value:V[e._id]??`never`,onValueChange:t=>at(n=>({...n,[e._id]:t})),children:[(0,q.jsx)(W,{size:`sm`,className:`w-32`,children:(0,q.jsx)(P,{})}),(0,q.jsx)(N,{children:J.map(e=>(0,q.jsx)(M,{value:e.value,children:e.label()},e.value))})]})},{header:Ke(),sort:e=>(Y.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Y.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,q.jsx)(`span`,{className:`oc-sa__keycount`,children:F===e._id?Le():Oe({count:t})})}}]}),(0,q.jsx)(tt,{open:C,onOpenChange:e=>{w(e),e||O(null)},title:D?We():Pe(),description:D?Be():Ue(),canSubmit:!!(T.name&&T.roleKey),onSubmit:ft,submitLabel:D?Ee():ze(),children:(0,q.jsxs)(`div`,{className:`oc-form`,children:[(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Ge()}),(0,q.jsx)(rt,{value:T.name,onChange:e=>E({...T,name:e.target.value})})]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:Ae()}),(0,q.jsxs)(G,{value:T.roleKey||void 0,onValueChange:e=>E({...T,roleKey:e}),children:[(0,q.jsx)(W,{className:`w-full`,children:(0,q.jsx)(P,{placeholder:r()})}),(0,q.jsx)(N,{children:(m??[]).map(e=>(0,q.jsxs)(M,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(m??[]).find(e=>e.key===T.roleKey),t=e?lt(e):null;return t?(0,q.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,q.jsxs)(`label`,{className:`oc-field`,children:[(0,q.jsx)(`span`,{className:`oc-field__label`,children:pe()}),(0,q.jsx)(rt,{value:T.description,onChange:e=>E({...T,description:e.target.value})})]})]})}),(0,q.jsx)(dt,{minted:H,onClose:()=>U(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,q.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,q.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[m(),` `,(0,q.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,q.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):(0,q.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,q.jsx)(`thead`,{children:(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`th`,{children:d()}),(0,q.jsx)(`th`,{children:S()}),(0,q.jsx)(`th`,{children:i()}),(0,q.jsx)(`th`,{children:C()}),(0,q.jsx)(`th`,{children:p()}),(0,q.jsx)(`th`,{children:o()}),(0,q.jsx)(`th`,{})]})}),(0,q.jsx)(`tbody`,{children:t.map(t=>(0,q.jsxs)(`tr`,{children:[(0,q.jsx)(`td`,{children:(0,q.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,q.jsx)(`td`,{children:(0,q.jsx)(L,{variant:`secondary`,children:e.roleKey})}),(0,q.jsx)(`td`,{children:H(t.createdAt)}),(0,q.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,q.jsx)(`td`,{children:mt(t.expiresAt)}),(0,q.jsx)(`td`,{children:$(t)}),(0,q.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,q.jsx)(j,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?c():_e()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,K.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,q.jsx)(at,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,q.jsxs)(B,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,q.jsxs)(I,{children:[(0,q.jsx)(U,{children:D()}),(0,q.jsx)(z,{children:a({name:e.accountName})})]}),(0,q.jsx)(`div`,{className:`oc-sa__minted-warning`,children:he()}),(0,q.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,q.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,q.jsxs)(j,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":O(),children:[n?(0,q.jsx)(A,{}):(0,q.jsx)(F,{}),n?_():k()]})]}),(0,q.jsx)(R,{children:(0,q.jsx)(j,{onClick:()=>{r(!1),t()},children:E()})})]}):null})}function ft(e){return e===null?!1:Date.now()-e>Y}function pt(e){return e===null?w():H(e)}function mt(e){return e===null?`—`:V(e)}function $(e){return e.disabled?(0,q.jsx)(L,{variant:`destructive`,children:T()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,q.jsx)(L,{variant:`outline`,children:y()}):(0,q.jsx)(L,{variant:`outline`,children:v()})}export{Q 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,Ba as i,E as a,FP as o,Ga as s,Ha as c,Ja as l,Ka as u,PP as d,Qa as f,Ra as p,So as m,Ua as h,Va as g,Wa as _,Xa as v,Ya as y,Za as b,_o as x,ao as S,bo as C,co as w,do as T,eo as E,fo as D,go as O,ho as k,io as A,lo as j,mo as M,no as N,oo as P,po as F,qa as I,ro as L,so as R,to as ee,uo as z,vo as B,xo as V,yo as H,za as U}from"./dist-CjH9Ohdx.js";import{t as W}from"./button-B49JSqzm.js";import{U as G,rt as K}from"./index-DnuEILeM.js";import{t as q}from"./DataTableShell-DKcU9E8v.js";var J=t(e(),1),Y=n(),X={hung:()=>S(),wrong_result:()=>A(),error:()=>L(),other:()=>N()},Z=e=>(e&&X[e]?.())??e??`—`;function Q(e){let t=e.slice(e.lastIndexOf(`:`)+1)||e;return t.length>12?`${t.slice(0,12)}…`:t}function $({data:e}){let t=e.snapshot,n=d(a.subAgentReports.respondToReport),[i,o]=(0,J.useState)(e.thread),[p,m]=(0,J.useState)(``),[x,S]=(0,J.useState)(!1);async function C(){let t=p.trim();if(!(!t||x)){S(!0);try{await n({reportId:e._id,text:t}),o(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),m(``)}finally{S(!1)}}}return(0,Y.jsxs)(`div`,{className:`oc-fbadmin__detail`,children:[(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,children:(0,Y.jsxs)(`span`,{className:`oc-fbadmin__meta`,children:[Z(e.category),` · `,ee({failed:t.failedCount,total:t.totalCount}),t.openclawModel?` · ${t.openclawModel}`:``,t.openclawRuntime?` (${t.openclawRuntime})`:``]})}),e.comment?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:E()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__comment`,children:e.comment})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:r()}),i.length>0?(0,Y.jsx)(`div`,{className:`oc-fbadmin__thread`,children:i.map((e,t)=>(0,Y.jsxs)(`div`,{className:`oc-notif__msg oc-notif__msg--${e.authorRole}`,children:[(0,Y.jsx)(`span`,{className:`oc-notif__msg-who`,children:e.authorRole===`admin`?f():b()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:v()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:y(),value:p,maxLength:2e3,rows:3,onChange:e=>m(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(W,{size:`sm`,onClick:()=>void C(),disabled:!p.trim()||x,children:x?I():l()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[u({count:t.children.length}),t.childrenTruncated?` ${s()}`:``,t.textTruncated?` ${_()}`:``]}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__ctx`,children:t.children.map((e,n)=>(0,Y.jsxs)(`div`,{className:`oc-fbadmin__ctx-turn`,children:[(0,Y.jsxs)(`span`,{className:`oc-fbadmin__ctx-role`,children:[(e.taskName?.trim()||Q(e.childSessionKey))+` · ${e.status}`,e.phase?` · ${e.phase}`:``,e.childSessionKey===t.flaggedChildSessionKey?` · ${h()}`:``]}),e.errorMessage?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.errorMessage}):null,e.resultText?(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:e.resultText}):null]},n))})]}),t.parentText?(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:c()}),(0,Y.jsx)(`pre`,{className:`oc-msg__source-pre`,children:t.parentText})]}):null,(0,Y.jsxs)(`section`,{children:[(0,Y.jsx)(`h4`,{className:`oc-fbadmin__h`,children:g()}),(0,Y.jsx)(`p`,{className:`oc-fbadmin__env`,children:[t.parentStatus?`status: ${t.parentStatus}`:null,t.parentErrorCode?`code: ${t.parentErrorCode}`:null,t.parentRunId?`run ${t.parentRunId.slice(0,12)}…`:null,e.correlationId?`corr ${e.correlationId.slice(0,16)}…`:null,t.openclawProvider].filter(Boolean).join(` · `)||`—`})]})]})}function te(){let e=o(a.subAgentReports.listForAdmin,{}),t=d(a.subAgentReports.readReport),n=d(a.subAgentReports.deleteReport),r=G(),[s,c]=(0,J.useState)(null),[l,u]=(0,J.useState)({});async function f(e){if(s===e._id){c(null);return}if(!l[e._id]){let n=await t({reportId:e._id});u(t=>({...t,[e._id]:n}))}c(e._id)}async function h(e){await r({title:i(),description:U(),confirmLabel:p(),destructive:!0})&&(await n({reportId:e._id}),s===e._id&&c(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[C(),` `,(0,Y.jsx)(`strong`,{children:H()}),` `,B()]}),(0,Y.jsx)(q,{title:m(),rows:e,emptyHint:V(),isExpanded:e=>s===e._id&&!!l[e._id],renderExpanded:e=>l[e._id]?(0,Y.jsx)($,{data:l[e._id]}):null,columns:[{header:x(),cell:e=>K(e.at),sort:e=>e.at},{header:O(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:k(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:M(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${T({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:F(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:D(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:z()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:j()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:s===e._id?R():w(),onSelect:()=>void f(e)},{label:P(),onSelect:()=>void h(e),variant:`destructive`}]})]})}export{te as SubAgentReportsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$A as r,AA as i,Aj as a,BA as o,Bj as s,CA as c,CP as l,Cj as u,D as d,DA as f,Dj as p,E as m,EA as h,Ej as g,FA as _,FP as v,Fa as ee,Fj as te,GA as y,HA as b,IA as ne,Ia as x,Ij as re,JA as ie,KA as ae,LA as oe,La as S,Lj as se,MA as ce,MP as le,Mj as ue,NA as de,Nj as fe,OA as pe,Oj as me,PA as he,PP as C,Pa as ge,Pj as _e,QA as ve,RA as w,Rj as ye,SA as T,SP as be,Sj as xe,TA as Se,Tj as Ce,UA as we,VA as Te,WA as Ee,XA as De,YA as Oe,ZA as ke,_j as Ae,aj as je,bA as Me,bj as Ne,cj as Pe,dj as Fe,ej as Ie,fj as Le,gj as Re,hj as ze,ij as Be,jA as Ve,jj as He,kA as Ue,kj as We,lj as Ge,mj as Ke,n as qe,nj as Je,oj as Ye,pj as Xe,qA as Ze,rj as E,sj as Qe,tj as $e,uj as et,vA as tt,vj as nt,wA as rt,wP as it,wj as at,xA as ot,xj as st,yA as ct,yj as lt,zA as ut,zj as dt}from"./dist-CjH9Ohdx.js";import{n as D}from"./dist-C0sZxuDo.js";import{t as O}from"./x-DYJkW-kP.js";import{t as k}from"./button-B49JSqzm.js";import{C as A,S as j,T as M,Xt as ft,Yt as N,at as pt,bt as mt,ct as ht,dt as P,ft as F,lt as I,m as L,ot as gt,st as R,ut as _t,w as z,wt as B,x as V,yt as vt}from"./index-DnuEILeM.js";import{t as yt}from"./localePickerView-C2RmOS86.js";import{a as bt,i as xt,n as St,o as Ct,r as wt,t as Tt}from"./card-eKiPt2Wc.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-COx9FvKU.js";import{t as kt}from"./TimeRangePicker-0VkTfHt_.js";import{t as At}from"./FilterBar-BVzupjQK.js";import{t as jt}from"./AdvancedFilter-CcMolhzz.js";var G=d(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),K=t(e(),1),Mt=.1,Nt=[248,248,248],Pt=[24,24,24];function Ft(e,t,n){let r=t,i=n,a=-1,o=-1;for(let s=0;s<n;s++)for(let n=0;n<t;n++)e[(s*t+n)*4+3]>8&&(n<r&&(r=n),n>a&&(a=n),s<i&&(i=s),s>o&&(o=s));return a<0?null:{x:r,y:i,width:a-r+1,height:o-i+1}}function It(e,t,n){let r=t*n;if(r===0)return 0;let i=0;for(let t=3;t<e.length;t+=4)e[t]<=8&&i++;return i/r}function q(e,t,n){return It(e,t,n)>=Mt}function Lt(e,t){for(let n=0;n<e.length;n+=4)e[n]=t[0],e[n+1]=t[1],e[n+2]=t[2]}function Rt(e){for(let t=0;t<e.length;t+=4)e[t]=255-e[t],e[t+1]=255-e[t+1],e[t+2]=255-e[t+2]}var zt=12*1024*1024,Bt=480,Vt=160,Ht=.92;async function Ut(e,t={}){if(!e.type.startsWith(`image/`))throw Error(Te());if(e.size>zt)throw Error(o());let{source:n,width:r,height:i,cleanup:a}=await Wt(e);try{let a=e.type===`image/svg+xml`,o=Math.min(Bt/r,Vt/i,a?1/0:1),s=Math.max(1,Math.round(r*o)),c=Math.max(1,Math.round(i*o)),l=document.createElement(`canvas`);l.width=s,l.height=c;let u=l.getContext(`2d`);if(!u)throw Error(w());u.imageSmoothingEnabled=!0,u.imageSmoothingQuality=`high`,u.drawImage(n,0,0,s,c);let d=Ft(u.getImageData(0,0,s,c).data,s,c)??{x:0,y:0,width:s,height:c},f=document.createElement(`canvas`);f.width=d.width,f.height=d.height;let p=f.getContext(`2d`);if(!p)throw Error(w());if(p.drawImage(l,d.x,d.y,d.width,d.height,0,0,d.width,d.height),t.variantFor){let e=p.getImageData(0,0,d.width,d.height);q(e.data,d.width,d.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),p.putImageData(e,0,0)}let m=q(p.getImageData(0,0,d.width,d.height).data,d.width,d.height),h=await Y(f,`image/webp`,Ht)??await Y(f,`image/png`);if(!h)throw Error(oe());return{blob:h,hasAlpha:m}}finally{a()}}async function Wt(e){if(e.type===`image/svg+xml`)return J(e);if(typeof createImageBitmap==`function`)try{let t=await createImageBitmap(e);return{source:t,width:t.width,height:t.height,cleanup:()=>t.close()}}catch{}return J(e)}async function J(e){let t=URL.createObjectURL(e);try{let e=new Image;return e.decoding=`async`,await new Promise((n,r)=>{e.onload=()=>n(),e.onerror=()=>r(Error(ut())),e.src=t}),{source:e,width:e.naturalWidth||300,height:e.naturalHeight||150,cleanup:()=>URL.revokeObjectURL(t)}}catch(e){throw URL.revokeObjectURL(t),e}}function Y(e,t,n){return new Promise(r=>e.toBlob(e=>r(e),t,n))}var X=n();function Gt(e,t){let n=e.trim().replace(/[^A-Za-z0-9_.-]+/g,`-`).replace(/^-+|-+$/g,``)||`chart`,r=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=`${n}.chart.json`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(i)}var Z=`__all__`,Q={kind:`relative`,from:`now-24h`,to:`now`},Kt=[{value:`status`,label:`Statut`},{value:`latencyMs`,label:`Latence (ms)`},{value:`route`,label:`Route`},{value:`roleKey`,label:`Rôle`},{value:`correlationId`,label:`Corrélation`}];function $({title:e,description:t,children:n}){return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:e}),t?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:t}):null]}),(0,X.jsx)(`div`,{className:`oc-show__demo`,children:n})]})}function qt(e){return e===`light`?it():e===`dark`?l():be()}var Jt=[`primary`,`secondary`,`accent`,`muted`,`chart-1`,`chart-2`];function Yt({tokens:e,mode:t}){let n=e.colors[t];return(0,X.jsx)(`div`,{className:`oc-chart-swatches`,"aria-hidden":!0,children:Jt.map(e=>{let t=n[e];return(0,X.jsx)(`span`,{className:`oc-chart-swatch`,style:t?{background:t}:void 0},e)})})}function Xt({selected:e,title:t,subtitle:n,tokens:r,mode:i,onSelect:a,onExport:o}){return(0,X.jsxs)(`div`,{className:`oc-chart-card-wrap`,children:[(0,X.jsxs)(`button`,{type:`button`,className:qe(`oc-chart-card`,e&&`oc-chart-card--selected`),"aria-pressed":e,onClick:a,children:[(0,X.jsxs)(`div`,{className:`oc-chart-card__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-card__title`,children:t}),e?(0,X.jsx)(D,{className:`size-4 text-primary`,"aria-hidden":!0}):null]}),r?(0,X.jsx)(Yt,{tokens:r,mode:i}):(0,X.jsx)(`div`,{className:`oc-chart-swatches oc-chart-swatches--native`,"aria-hidden":!0}),(0,X.jsx)(`div`,{className:`oc-chart-card__meta`,children:(0,X.jsx)(`span`,{className:`oc-chart-card__subtitle`,children:n})})]}),o?(0,X.jsx)(k,{type:`button`,variant:`ghost`,size:`icon`,className:`oc-chart-card__export`,onClick:o,"aria-label":S(),title:S(),children:(0,X.jsx)(ft,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=v(m.charts.listMyCharts),r=C(m.charts.setMyChart);async function i(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:ue()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:He()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:a(),subtitle:We(),tokens:null,mode:t,onSelect:()=>void i(null)}),(n??[]).map(n=>{let r=n.via===`common`?me():n.via===`owner`?p():g({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void i(n.key),onExport:()=>Gt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ce()}):null]})}function Qt(){let e=C(m.charts.importChart),[t,n]=(0,K.useState)(``),[r,i]=(0,K.useState)(``),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(!1),[l,u]=(0,K.useState)(!1);async function d(e){let t=e.target.files?.[0];if(e.target.value=``,t){o(null),c(!1);try{i(await t.text())}catch{o(E())}}}async function f(){if(o(null),c(!1),t.trim()===``){o($e());return}let a;try{a=JSON.parse(r)}catch{o(E());return}u(!0);try{await e({name:t.trim(),tokens:a}),c(!0),n(``),i(``)}catch(e){o(e instanceof Error?e.message:String(e))}finally{u(!1)}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Fe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:et()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Ge()}),(0,X.jsx)(F,{value:t,onChange:e=>n(e.target.value),placeholder:Pe(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Qe()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:Ye(),rows:8,spellCheck:!1})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),je(),(0,X.jsx)(`input`,{type:`file`,accept:`application/json,.json`,className:`oc-chart-import__file-input`,onChange:e=>void d(e)})]})}),(0,X.jsx)(k,{size:`sm`,disabled:l,onClick:()=>void f(),children:Be()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:Je()}):null]})]})}function $t({chart:e}){let t=le(m.charts.setChartLogo),n=C(m.charts.removeChartLogo),[r,i]=(0,K.useState)(!1),[a,o]=(0,K.useState)(null),s=t=>t===`light`?e.logoLightUrl:e.logoDarkUrl;async function c(n,r,a){if(e.chartId!==void 0){o(null),i(!0);try{let{blob:i,hasAlpha:o}=await Ut(r,a?{variantFor:a}:{}),s=await i.arrayBuffer();await t({chartId:e.chartId,bytes:s,mode:n,hasAlpha:o})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function l(e,t){let n=t.target.files?.[0];t.target.value=``,n&&await c(e,n)}async function u(t){if(e.chartId!==void 0){o(null),i(!0);try{await n({chartId:e.chartId,mode:t})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}async function d(e){let t=s(e===`light`?`dark`:`light`);if(t){o(null),i(!0);try{await c(e,await(await fetch(t)).blob(),e)}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}}}function f({mode:e}){let t=s(e),n=s(e===`light`?`dark`:`light`);return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slot`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-mode`,children:e===`light`?ie():Ze()}),(0,X.jsx)(`span`,{className:`oc-chart-mine__logo-preview`,"data-mode":e,"data-empty":t?void 0:`1`,children:t?(0,X.jsx)(`img`,{src:t,alt:``}):null}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(`label`,{className:`oc-chart-import__file`,children:[(0,X.jsx)(G,{className:`size-4`}),t?y():ae(),(0,X.jsx)(`input`,{type:`file`,accept:`image/*`,className:`oc-chart-import__file-input`,onChange:t=>void l(e,t)})]})}),!t&&n?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void d(e),children:we()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:Ee()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Oe()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo-slots`,children:[(0,X.jsx)(f,{mode:`light`}),(0,X.jsx)(f,{mode:`dark`})]}),r?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:b()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=v(m.me.getMe,{host:B}),n=C(m.charts.addChartDomain),r=C(m.charts.removeChartDomain),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(null),[c,l]=(0,K.useState)(!1);if(t?.role!==`admin`)return null;let u=e.domains??[];async function d(){let t=i.trim();if(t!==``){s(null),l(!0);try{await n({chartKey:e.key,domain:t}),a(``)}catch(e){s(e instanceof Error?e.message:String(e))}finally{l(!1)}}}async function f(t){s(null);try{await r({chartKey:e.key,domain:t})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:ne()}),(0,X.jsxs)(`div`,{className:`oc-chart-mine__domains-body`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__groups`,children:u.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ce()}):u.map(e=>(0,X.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ve({domain:e}),onClick:()=>void f(e),children:(0,X.jsx)(O,{className:`size-3`})})]},e))}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(F,{value:i,onChange:e=>a(e.target.value),placeholder:he(),className:`oc-chart-mine__domains-input`,onKeyDown:e=>{e.key===`Enter`&&d()}}),(0,X.jsx)(k,{variant:`outline`,size:`sm`,disabled:c,onClick:()=>void d(),children:de()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:_()}),o?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:o}):null]})]})}function tn(e){let t={...e};return delete t.bpm,JSON.stringify(t,null,2)}function nn({chart:e}){let t=C(m.charts.updateChart),n=C(m.charts.deleteChart),[r,a]=(0,K.useState)(!1),[o,s]=(0,K.useState)(e.name),[c,l]=(0,K.useState)(()=>tn(e.tokens)),[u,d]=(0,K.useState)(e.tokens.bpm??0),[p,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(!1);function te(){s(e.name),l(tn(e.tokens)),d(e.tokens.bpm??0),g(null),a(!0)}async function y(){if(e.chartId===void 0)return;g(null);let n;try{n=JSON.parse(c)}catch{g(E());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;u>0?e.bpm=u:delete e.bpm}v(!0);try{await t({chartId:e.chartId,name:o.trim(),tokens:n}),a(!1)}catch(e){g(e instanceof Error?e.message:String(e))}finally{v(!1)}}async function b(){if(e.chartId!==void 0&&window.confirm(h()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:r?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:te,children:ke()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void b(),children:De()})]})})]}),r?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:pe()}),(0,X.jsx)(F,{value:o,onChange:e=>s(e.target.value),maxLength:60})]}),(0,X.jsxs)(`div`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:x()}),(0,X.jsxs)(`div`,{className:`oc-chart-bpm`,children:[(0,X.jsx)(`input`,{type:`range`,className:`oc-chart-bpm__slider`,min:0,max:90,step:5,value:u,onChange:e=>d(Number(e.target.value)),"aria-label":x()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:u===0?ee():`${u} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ge()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:f()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:c,onChange:e=>l(e.target.value),rows:10,spellCheck:!1})]}),p?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:p}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:_,onClick:()=>void y(),children:i()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>a(!1),children:Ue()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=v(m.charts.listMyCharts),t=(e??[]).filter(e=>e.via===`owner`);return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:Ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:r()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ve()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=C(m.charts.addChartToGroupPool),r=C(m.charts.removeChartFromGroupPool),i=e.restrictedToGroups,a=e.poolGroups,o=new Set((a??[]).map(e=>e.groupId)),s=t.filter(e=>!o.has(e._id));async function c(t){try{await n({groupId:t,chartKey:e.key})}catch{}}async function l(t){try{await r({groupId:t,chartKey:e.key})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(P,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?Ae():e.kind===`custom`&&e.scope===`personal`?T():nt()}),e.isGlobalDefault?(0,X.jsx)(P,{variant:`default`,children:Re()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Ke()}),(a??[]).map(e=>(0,X.jsxs)(P,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Le({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(O,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(V,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(z,{size:`sm`,className:`w-56`,children:(0,X.jsx)(M,{placeholder:Xe()})}),(0,X.jsx)(j,{children:s.map(e=>(0,X.jsx)(A,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ze()}):null]})]})}function on({chart:e}){let t=C(m.charts.promoteChartToCommon),n=C(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(h()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-avail__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name}),(0,X.jsx)(P,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?ot():T()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:c({owner:e.ownerLabel})}):null]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[e.scope===`personal`?(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:()=>void r(),children:Me()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:ct()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=C(m.admin.setDefaultThemeMode),i=C(m.admin.setDefaultLocale),o=C(m.charts.setDefaultChart),c=v(m.charts.listChartsAdmin),l=v(m.groups.listGroups,{}),d=e??`system`,f=t??`fr`;return(0,X.jsxs)(`div`,{className:`oc-appearance-admin`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:_e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:fe()})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:at()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:u()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void o({name:null}),children:a()}),mt.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key)),(c??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void o({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:xe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:st()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups:l??[]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Ne()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:lt()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(c??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:Se()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:rt()})]}),(()=>{let e=(c??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:tt()}):(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:e.map(e=>(0,X.jsx)(on,{chart:e},e.key))})})()]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:s()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:dt()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:d===e?`default`:`outline`,size:`sm`,onClick:()=>void r({mode:e}),children:qt(e)},e))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:ye()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:se()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(k,{variant:f===e.value?`default`:`outline`,size:`sm`,onClick:()=>void i({locale:e.value}),children:e.label},e.value))}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:re()})]})]})}function cn(){let e=v(m.me.getMe,{host:B}),t=vt(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Q),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:te()}),(0,X.jsxs)($,{title:`Buttons`,description:`Variants`,children:[(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(k,{variant:`outline`,children:`Outline`}),(0,X.jsx)(k,{variant:`ghost`,children:`Ghost`}),(0,X.jsx)(k,{variant:`destructive`,children:`Destructive`}),(0,X.jsx)(k,{variant:`link`,children:`Link`})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,children:`Small`}),(0,X.jsx)(k,{children:`Default`}),(0,X.jsx)(k,{size:`lg`,children:`Large`}),(0,X.jsx)(k,{size:`icon`,"aria-label":`more`,children:(0,X.jsx)(N,{})}),(0,X.jsx)(k,{disabled:!0,children:`Disabled`})]})]}),(0,X.jsx)($,{title:`Badges`,children:(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(P,{children:`Default`}),(0,X.jsx)(P,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(P,{variant:`outline`,children:`Outline`}),(0,X.jsx)(P,{variant:`destructive`,children:`Destructive`})]})}),(0,X.jsx)($,{title:`Inputs & selection`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(F,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(V,{value:n,onValueChange:r,children:[(0,X.jsx)(z,{className:`w-56`,children:(0,X.jsx)(M,{placeholder:`Select…`})}),(0,X.jsxs)(j,{children:[(0,X.jsx)(A,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(A,{value:`shared`,children:`shared (agent commun)`})]})]}),(0,X.jsxs)(`label`,{className:`oc-show__check`,children:[(0,X.jsx)(L,{checked:e,onCheckedChange:e=>t(!!e)}),`Checkbox`]})]})]})}),(0,X.jsx)($,{title:`Filtres & plage temporelle`,description:`Barre réutilisable (recherche debouncée + selects rapides à largeur auto + plage façon Grafana) et constructeur de filtre avancé. Câblée dans Users, Groups, Comptes de service, Traces, Anomalies, Audit et KPI.`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsxs)(At,{q:i,onQChange:a,searchPlaceholder:`Rechercher (kind, principal, rôle, route…)`,timeRange:u,onTimeRangeChange:d,onReset:p,canReset:f,children:[(0,X.jsxs)(V,{value:o,onValueChange:s,children:[(0,X.jsx)(z,{size:`sm`,children:(0,X.jsx)(M,{})}),(0,X.jsxs)(j,{children:[(0,X.jsx)(A,{value:Z,children:`Toutes directions`}),(0,X.jsx)(A,{value:`inbound`,children:`inbound`}),(0,X.jsx)(A,{value:`outbound`,children:`outbound`}),(0,X.jsx)(A,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(V,{value:c,onValueChange:l,children:[(0,X.jsx)(z,{size:`sm`,children:(0,X.jsx)(M,{})}),(0,X.jsxs)(j,{children:[(0,X.jsx)(A,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(A,{value:`info`,children:`info`}),(0,X.jsx)(A,{value:`warn`,children:`warn`}),(0,X.jsx)(A,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(jt,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(kt,{value:u,onChange:d})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(pt,{children:[(0,X.jsx)(_t,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(gt,{align:`start`,children:[(0,X.jsx)(ht,{children:`Actions`}),(0,X.jsx)(I,{}),(0,X.jsx)(R,{children:`Edit`}),(0,X.jsx)(R,{children:`Duplicate`}),(0,X.jsx)(I,{}),(0,X.jsx)(R,{variant:`destructive`,children:`Delete`})]})]})}),(0,X.jsx)($,{title:`Card`,children:(0,X.jsxs)(Tt,{className:`w-80`,children:[(0,X.jsxs)(bt,{children:[(0,X.jsx)(Ct,{children:`Instance`}),(0,X.jsx)(wt,{children:`Non-secret metadata only.`})]}),(0,X.jsx)(St,{className:`text-sm text-muted-foreground`,children:`ws://gateway.example.org:18789`}),(0,X.jsxs)(xt,{className:`gap-2`,children:[(0,X.jsx)(k,{size:`sm`,children:`Save`}),(0,X.jsx)(k,{size:`sm`,variant:`ghost`,children:`Cancel`})]})]})}),(0,X.jsx)($,{title:`Table`,children:(0,X.jsxs)(Ot,{children:[(0,X.jsx)(Et,{children:(0,X.jsxs)(U,{children:[(0,X.jsx)(H,{className:`w-8`,children:(0,X.jsx)(L,{"aria-label":`select all`})}),(0,X.jsx)(H,{children:`Name`}),(0,X.jsx)(H,{children:`Mode`}),(0,X.jsx)(H,{className:`text-right`,children:`Status`}),(0,X.jsx)(H,{className:`w-8`})]})}),(0,X.jsx)(Dt,{children:[{n:`admins`,m:`per-user`,s:`active`},{n:`family`,m:`shared`,s:`active`}].map(e=>(0,X.jsxs)(U,{children:[(0,X.jsx)(W,{children:(0,X.jsx)(L,{"aria-label":`select ${e.n}`})}),(0,X.jsx)(W,{className:`font-medium`,children:e.n}),(0,X.jsx)(W,{children:(0,X.jsx)(P,{variant:`secondary`,children:e.m})}),(0,X.jsx)(W,{className:`text-right`,children:(0,X.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-muted-foreground`,children:[(0,X.jsx)(D,{className:`size-3.5`}),` `,e.s]})}),(0,X.jsx)(W,{children:(0,X.jsx)(k,{variant:`ghost`,size:`icon`,"aria-label":`row actions`,children:(0,X.jsx)(N,{})})})]},e.n))})]})}),(0,X.jsx)($,{title:`App fragments`,description:`Chat-specific components`,children:(0,X.jsxs)(`div`,{className:`oc-show__row oc-show__row--col`,children:[(0,X.jsx)(`div`,{className:`oc-msg oc-msg--assistant`,children:(0,X.jsx)(`div`,{className:`oc-msg__body`,children:`Assistant message bubble.`})}),(0,X.jsx)(`div`,{className:`oc-tool oc-tool--completed`,children:(0,X.jsxs)(`div`,{className:`oc-tool__header`,children:[(0,X.jsx)(`span`,{className:`oc-tool__icon`,children:`✓`}),(0,X.jsx)(`span`,{className:`oc-tool__name`,children:`write-file`}),(0,X.jsx)(`span`,{className:`oc-tool__phase`,children:`completed`})]})}),(0,X.jsxs)(`div`,{className:`oc-run-status oc-run-status--streaming`,children:[(0,X.jsx)(`span`,{className:`oc-run-status__dot`}),(0,X.jsx)(`span`,{className:`oc-run-status__label`,children:`Running`})]})]})})]})]})}export{ln as ThemeShowroom};