@lacneu/atrium 0.62.1 → 0.62.2

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 (70) hide show
  1. package/dist/assets/{AccessTab--VqMu03T.js → AccessTab-C0DMrq_T.js} +1 -1
  2. package/dist/assets/{AdvancedFilter-D6zd0L5Q.js → AdvancedFilter-CjfYhQlT.js} +1 -1
  3. package/dist/assets/AgentFilesTab-Vt7ogGL4.js +3 -0
  4. package/dist/assets/{AnomaliesTab-CEpTxqcV.js → AnomaliesTab-Bl8B8nuQ.js} +1 -1
  5. package/dist/assets/{AuditTab-DgKezBIz.js → AuditTab-Jv3VbFgH.js} +1 -1
  6. package/dist/assets/BridgeTab-BURazhGl.js +1 -0
  7. package/dist/assets/ChatDefaultsTab-A2iJG8ZL.js +1 -0
  8. package/dist/assets/{DataTableShell-DMFVXfOQ.js → DataTableShell-zzaGmfMk.js} +1 -1
  9. package/dist/assets/{DetailChips-Cv722Djz.js → DetailChips-DNNrvZqq.js} +1 -1
  10. package/dist/assets/{FeedbacksTab-CDhunzCw.js → FeedbacksTab-ChZeDaM6.js} +1 -1
  11. package/dist/assets/{FieldLabel-B4QPoUJd.js → FieldLabel-z7bxzKHq.js} +1 -1
  12. package/dist/assets/FilesTab-jc4m4WW7.js +1 -0
  13. package/dist/assets/{FilterBar-BaqVZ-JQ.js → FilterBar-DRRfKRTQ.js} +1 -1
  14. package/dist/assets/{GroupsTab-CCESqSzH.js → GroupsTab-HTPhJMAF.js} +1 -1
  15. package/dist/assets/InstancesTab-DUwMvn_C.js +1 -0
  16. package/dist/assets/IntegrationsTab-2PvwRR8s.js +1 -0
  17. package/dist/assets/{KpiTab-DsgCrpnk.js → KpiTab-D4aTV56S.js} +1 -1
  18. package/dist/assets/PreferencesTab-LYojtSoz.js +1 -0
  19. package/dist/assets/PromptInjectionsTab-DN8RscNv.js +4 -0
  20. package/dist/assets/RolesTab-BexLEI7q.js +1 -0
  21. package/dist/assets/ScheduledTab-Cm1PSyqy.js +1 -0
  22. package/dist/assets/ServiceAccountsTab-Krm3IzaJ.js +1 -0
  23. package/dist/assets/SubAgentReportsTab-DJNmIHbP.js +1 -0
  24. package/dist/assets/ThemeShowroom-CN7-gPFJ.js +1 -0
  25. package/dist/assets/{TimeRangePicker-Bv-U6Bo1.js → TimeRangePicker-BPVkrNZN.js} +1 -1
  26. package/dist/assets/TracesTab-BTN0YBPo.js +1 -0
  27. package/dist/assets/{UsersTab-4qigDhcD.js → UsersTab-CclKbkrB.js} +1 -1
  28. package/dist/assets/VoiceTab-DS6LrGiz.js +1 -0
  29. package/dist/assets/{button-Ew8nYfum.js → button-BtQwDeC7.js} +1 -1
  30. package/dist/assets/{card-DsVS4SLV.js → card-BbBjwTkQ.js} +1 -1
  31. package/dist/assets/chevrons-up-down-ImFHIr_N.js +1 -0
  32. package/dist/assets/{compatView-DIxFDrmB.js → compatView-BvZyYwOM.js} +1 -1
  33. package/dist/assets/confTabs-hdeEtaLm.css +1 -0
  34. package/dist/assets/{dispatchErrorInfo-Bk3nl1aq.js → dispatchErrorInfo-CjAxcZ1X.js} +1 -1
  35. package/dist/assets/{dist-Bk4bPGS8.js → dist-BCNlHm__.js} +1 -1
  36. package/dist/assets/{dist-ByfMfLx3.js → dist-CHUv7VZU.js} +1 -1
  37. package/dist/assets/dist-CNZ9o3sc.js +44 -0
  38. package/dist/assets/{dist-CqLvr3pk.js → dist-VGy3W8j2.js} +1 -1
  39. package/dist/assets/{highlighted-body-OFNGDK62-CmRSAAz2.js → highlighted-body-OFNGDK62-D3YWtB-x.js} +1 -1
  40. package/dist/assets/index-9R1hg_pA.js +238 -0
  41. package/dist/assets/mermaid-GHXKKRXX-DM0jE2ZW.js +1 -0
  42. package/dist/assets/{pdf-D5NQzcmE.js → pdf-BAfFGrd0.js} +1 -1
  43. package/dist/assets/roleDescriptions-DGSYA21e.js +1 -0
  44. package/dist/assets/{table-C4Hh9u_l.js → table-C9PafBK9.js} +1 -1
  45. package/dist/assets/{tabs-0D2gasCk.js → tabs-CQ2rDwF5.js} +1 -1
  46. package/dist/assets/x-BR1chqO3.js +1 -0
  47. package/dist/index.html +7 -7
  48. package/package.json +1 -1
  49. package/dist/assets/AgentFilesTab-C5GaYQ_Y.js +0 -3
  50. package/dist/assets/BridgeTab-Db3Fo_mk.js +0 -1
  51. package/dist/assets/ChatDefaultsTab-Du2XiR61.js +0 -1
  52. package/dist/assets/FilesTab-Bdn4Tvqv.js +0 -1
  53. package/dist/assets/InstancesTab-CWOk0g4N.js +0 -1
  54. package/dist/assets/IntegrationsTab-4LOj-Ni_.js +0 -1
  55. package/dist/assets/PreferencesTab-D8vFStwH.js +0 -1
  56. package/dist/assets/PromptInjectionsTab-BfKhvZll.js +0 -4
  57. package/dist/assets/RolesTab-CiFKtKmf.js +0 -1
  58. package/dist/assets/ScheduledTab-Zw2o6w8y.js +0 -1
  59. package/dist/assets/ServiceAccountsTab-hb25MXEz.js +0 -1
  60. package/dist/assets/SubAgentReportsTab-Cwu-39cc.js +0 -1
  61. package/dist/assets/ThemeShowroom-BWdIRzrU.js +0 -1
  62. package/dist/assets/TracesTab-B00Q2CXy.js +0 -1
  63. package/dist/assets/VoiceTab-CliAEaTM.js +0 -1
  64. package/dist/assets/chevrons-up-down-jkl77XwS.js +0 -1
  65. package/dist/assets/confTabs-C35Io1ep.css +0 -1
  66. package/dist/assets/dist-Bkkp8jtC.js +0 -44
  67. package/dist/assets/index-gP_wjUtq.js +0 -238
  68. package/dist/assets/mermaid-GHXKKRXX-eLH6oHko.js +0 -1
  69. package/dist/assets/roleDescriptions-CSbRqH5d.js +0 -1
  70. package/dist/assets/x-BqwVyymF.js +0 -1
@@ -0,0 +1 @@
1
+ import{_x as e,gx as t,hx as n,mx as r,vx as i}from"./dist-CNZ9o3sc.js";var a={pending:i,user:e,admin:t,observer:n,agent:r};function o(e){if(e.builtin){let t=a[e.key];if(t)return t()}return e.description}export{o as t};
@@ -1 +1 @@
1
- import{a as e,r as t}from"./bundle-mjs-C73ZY4La.js";import{E as n}from"./dist-Bkkp8jtC.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{E as n}from"./dist-CNZ9o3sc.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{E as r,_ as i,d as a,l as o,m as s,t as c,u as l,v as u}from"./dist-Bkkp8jtC.js";import{t as d}from"./dist-CqLvr3pk.js";import{Ct as f,St as p,xt as m}from"./index-gP_wjUtq.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=s(_,[f]),b=f(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:c=`horizontal`,dir:l,activationMode:f=`automatic`,...p}=e,m=d(l),[h,v]=a({prop:r,onChange:i,defaultProp:s??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:o(),value:h,onValueChange:v,orientation:c,dir:m,activationMode:f,children:(0,g.jsx)(u.div,{dir:m,"data-orientation":c,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=S(w,n),o=b(n);return(0,g.jsx)(p,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(u.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,s=S(E,n),c=b(n),l=A(s.baseId,r),d=j(s.baseId,r),f=r===s.value;return(0,g.jsx)(m,{asChild:!0,...c,focusable:!a,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":a?``:void 0,disabled:a,id:l,...o,ref:t,onMouseDown:i(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?s.onValueChange(r):e.preventDefault()}),onKeyDown:i(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&s.onValueChange(r)}),onFocus:i(e.onFocus,()=>{let e=s.activationMode!==`manual`;!f&&!a&&e&&s.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=S(O,n),c=A(s.baseId,r),d=j(s.baseId,r),f=r===s.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(l,{present:i||f,children:({present:n})=>(0,g.jsx)(u.div,{"data-state":f?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&a})})});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:r(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=c(`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:r(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:r(`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:r(`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{E as r,_ as i,d as a,l as o,m as s,t as c,u as l,v as u}from"./dist-CNZ9o3sc.js";import{t as d}from"./dist-VGy3W8j2.js";import{Ct as f,St as p,xt as m}from"./index-9R1hg_pA.js";var h=t(e(),1),g=n(),_=`Tabs`,[v,y]=s(_,[f]),b=f(),[x,S]=v(_),C=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:c=`horizontal`,dir:l,activationMode:f=`automatic`,...p}=e,m=d(l),[h,v]=a({prop:r,onChange:i,defaultProp:s??``,caller:_});return(0,g.jsx)(x,{scope:n,baseId:o(),value:h,onValueChange:v,orientation:c,dir:m,activationMode:f,children:(0,g.jsx)(u.div,{dir:m,"data-orientation":c,...p,ref:t})})});C.displayName=_;var w=`TabsList`,T=h.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=S(w,n),o=b(n);return(0,g.jsx)(p,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,g.jsx)(u.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});T.displayName=w;var E=`TabsTrigger`,D=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,s=S(E,n),c=b(n),l=A(s.baseId,r),d=j(s.baseId,r),f=r===s.value;return(0,g.jsx)(m,{asChild:!0,...c,focusable:!a,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":a?``:void 0,disabled:a,id:l,...o,ref:t,onMouseDown:i(e.onMouseDown,e=>{!a&&e.button===0&&e.ctrlKey===!1?s.onValueChange(r):e.preventDefault()}),onKeyDown:i(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&s.onValueChange(r)}),onFocus:i(e.onFocus,()=>{let e=s.activationMode!==`manual`;!f&&!a&&e&&s.onValueChange(r)})})})});D.displayName=E;var O=`TabsContent`,k=h.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=S(O,n),c=A(s.baseId,r),d=j(s.baseId,r),f=r===s.value,p=h.useRef(f);return h.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,g.jsx)(l,{present:i||f,children:({present:n})=>(0,g.jsx)(u.div,{"data-state":f?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&a})})});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:r(`group/tabs flex gap-2 data-horizontal:flex-col`,e),...n})}var L=c(`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:r(L({variant:t}),e),...n})}function z({className:e,...t}){return(0,g.jsx)(P,{"data-slot":`tabs-trigger`,className:r(`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:r(`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-CNZ9o3sc.js";var t=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
package/dist/index.html CHANGED
@@ -62,14 +62,14 @@
62
62
  document.documentElement.dataset.motion = "static";
63
63
  })();
64
64
  </script>
65
- <script type="module" crossorigin src="/assets/index-gP_wjUtq.js"></script>
65
+ <script type="module" crossorigin src="/assets/index-9R1hg_pA.js"></script>
66
66
  <link rel="modulepreload" crossorigin href="/assets/bundle-mjs-C73ZY4La.js">
67
- <link rel="modulepreload" crossorigin href="/assets/dist-Bkkp8jtC.js">
68
- <link rel="modulepreload" crossorigin href="/assets/dist-CqLvr3pk.js">
69
- <link rel="modulepreload" crossorigin href="/assets/dist-ByfMfLx3.js">
70
- <link rel="modulepreload" crossorigin href="/assets/dist-Bk4bPGS8.js">
71
- <link rel="modulepreload" crossorigin href="/assets/x-BqwVyymF.js">
72
- <link rel="modulepreload" crossorigin href="/assets/button-Ew8nYfum.js">
67
+ <link rel="modulepreload" crossorigin href="/assets/dist-CNZ9o3sc.js">
68
+ <link rel="modulepreload" crossorigin href="/assets/dist-VGy3W8j2.js">
69
+ <link rel="modulepreload" crossorigin href="/assets/dist-CHUv7VZU.js">
70
+ <link rel="modulepreload" crossorigin href="/assets/dist-BCNlHm__.js">
71
+ <link rel="modulepreload" crossorigin href="/assets/x-BR1chqO3.js">
72
+ <link rel="modulepreload" crossorigin href="/assets/button-BtQwDeC7.js">
73
73
  <link rel="stylesheet" crossorigin href="/assets/index-jScX6cAP.css">
74
74
  </head>
75
75
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lacneu/atrium",
3
- "version": "0.62.1",
3
+ "version": "0.62.2",
4
4
  "description": "Atrium — public, self-hostable, Convex-backed web chat UI for AI agent gateways (OpenClaw today, Hermes next). Ships an origin-agnostic static bundle (Convex URL injected at runtime via /config.json).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,3 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$i as r,$l as i,$u as a,Bi as o,FF as s,Gl as c,Hi as l,Hl as u,Jl as d,Kl as f,LF as p,Qi as m,Ql as h,RF as g,Ri as _,T as v,Ui as y,Ul as b,Vi as x,Vl as S,Wi as C,Wl as w,Xl as T,Yl as E,Zi as D,Zl as O,Zu as k,_a as A,aa as j,au as M,ca as N,cu as P,da as F,du as I,ea as L,eu as ee,fa as R,fu as z,ga as B,gu as te,ha as V,hu as ne,ia as H,iu as U,jF as W,kF as G,kO as re,la as ie,lu as ae,ma as oe,mu as se,na as ce,nu as le,oa as ue,ou as de,pa as fe,pu as pe,ql as me,ra as he,ru as ge,sa as _e,su as ve,ta as ye,tu as be,ua as xe,uu as Se,zi as Ce}from"./dist-Bkkp8jtC.js";import{t as K}from"./button-Ew8nYfum.js";import{$ as we,F as Te,I as Ee,L as De,M as Oe,N as ke,P as Ae,Pt as q,Q as je,R as Me,Y as Ne,Z as Pe,b as Fe,ct as Ie,gt as Le,lt as Re,nt as ze,ot as Be,st as Ve,tt as He,ut as Ue,wt as J,z as We}from"./index-gP_wjUtq.js";import{n as Ge,t as Ke}from"./curation-CQksaIbm.js";import{i as qe}from"./compatView-DIxFDrmB.js";/* empty css */var Y=t(e(),1),X=2e4,Je=6e4;function Ye(e){return typeof e!=`number`||e<=0?0:Math.round(e/X*100)}function Xe(e){return e<=0?0:Math.round(e/Je*100)}function Z(e,t){let n=(typeof e==`number`&&e>0?e:0)/1e3;return new Intl.NumberFormat(t,{minimumFractionDigits:1,maximumFractionDigits:1}).format(n)}function Ze(e){return e.reduce((e,t)=>e+(typeof t.size==`number`&&t.size>0?t.size:0),0)}var Qe=3;function $e(e,t){let n=new Map;for(let t of e.split(`
2
- `))n.set(t,(n.get(t)??0)+1);for(let e of t.split(`
3
- `))n.set(e,(n.get(e)??0)-1);let r=0,i=0,a=[],o=[];for(let[e,t]of n)t<0?(r+=-t,a.length<Qe&&a.push(e)):t>0&&(i+=t,o.length<Qe&&o.push(e));return{added:r,removed:i,sampleAdded:a,sampleRemoved:o}}function et(e){return e instanceof Error?e.message.includes(`conflict:`):String(e).includes(`conflict:`)}var Q=n(),$=e=>`${e.instanceName}::${e.agentId}`;function tt(){let e=g(v.me.getMe,{host:Le}),t=e?.role===`admin`,n=(e?.permissions??[]).includes(`bridge.read`),r=g(v.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=g(v.agents.listAgentsForInstance,t&&i?{instanceName:i}:`skip`),c=g(v.agents.listMyAgents,e!==void 0&&!t?{}:`skip`),l=(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(c!==void 0)return c.map(e=>({instanceName:e.instanceName,agentId:e.agentId,label:`${e.emoji?`${e.emoji} `:``}${e.displayName??e.agentId}`}))}},[e,t,i,o,r,c]),[u,d]=(0,Y.useState)(null);(0,Y.useEffect)(()=>{!l||l.length===0||(!u||!l.some(e=>$(e)===u))&&d($(l[0]))},[l,u]);let f=l?.find(e=>$(e)===u)??null,p=s(v.agentFiles.listAgentFiles),[m,h]=(0,Y.useState)({status:`idle`}),_=f?.instanceName??null,y=f?.agentId??null,b=g(v.compat.forInstance,n&&_!==null?{instanceName:_}:`skip`),x=n&&_!==null?Fe(b,`agentFiles`):null,S=x===null?!1:x===`loading`?null:x.blocked,C=(0,Y.useCallback)(async()=>{if(!(_===null||y===null)){h({status:`loading`});try{h({status:`done`,files:(await p({instanceName:_,agentId:y})).files})}catch{h({status:`error`})}}},[p,_,y]);(0,Y.useEffect)(()=>{S===!1&&C()},[C,S]);let[w,T]=(0,Y.useState)(null),E=g(v.agentFileCuration.listCurations,t&&_!==null&&y!==null?{instanceName:_,agentId:y}:`skip`),D=g(v.agentFileCuration.curationSettings,t&&_!==null?{instanceName:_}:`skip`),O=s(v.agentFileCuration.requestCuration),[A,j]=(0,Y.useState)(null),[N,F]=(0,Y.useState)(null),{toast:L}=J(),ee=(0,Y.useMemo)(()=>{let e=new Map;for(let t of E??[])e.has(t.name)||e.set(t.name,t);return e},[E]),B=(0,Y.useCallback)(async e=>{if(!(_===null||y===null)){j(e);try{let t=await O({instanceName:_,agentId:y,name:e,trigger:`manual`});t.ok?L({title:oe(),variant:`success`}):L({title:fe({reason:t.reason??`unknown`}),variant:`error`})}catch{L({title:R(),variant:`error`})}finally{j(null)}}},[O,_,y,L]),V=W(),H=(0,Y.useMemo)(()=>new Intl.NumberFormat(V,{maximumFractionDigits:0}),[V]);return e===void 0||l===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:G()}):(0,Q.jsxs)(`div`,{className:`oc-afiles`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:te()}),(0,Q.jsxs)(`div`,{className:`oc-afiles__picker`,children:[t&&(r?.length??0)>1?(0,Q.jsxs)(Be,{value:i??``,onValueChange:e=>a(e),children:[(0,Q.jsx)(Re,{size:`sm`,"aria-label":ne(),children:(0,Q.jsx)(Ue,{})}),(0,Q.jsx)(Ve,{children:(r??[]).map(e=>(0,Q.jsx)(Ie,{value:e.name,children:e.name},e.name))})]}):null,l.length>0?(0,Q.jsxs)(Be,{value:u??``,onValueChange:e=>d(e),children:[(0,Q.jsx)(Re,{size:`sm`,"aria-label":se(),children:(0,Q.jsx)(Ue,{})}),(0,Q.jsx)(Ve,{children:l.map(e=>(0,Q.jsx)(Ie,{value:$(e),children:e.label},$(e)))})]}):(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:pe()})]}),f===null?null:x===`loading`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:G()}):x!==null&&x.blocked?(0,Q.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,Q.jsx)(q,{size:14,"aria-hidden":!0}),` `,qe(x.gatewayVersion,x.provider)]}):m.status===`loading`||m.status===`idle`?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:G()}):m.status===`error`?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[I(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void C(),children:k()})]}):m.files.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:z()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`oc-afiles__list`,children:m.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)(Ne,{variant:`outline`,children:Se()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{className:`oc-afiles__size`,children:ae({size:Z(e.size,V)})}),(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:P({pct:H.format(n)})}),r?(0,Q.jsx)(q,{size:14,className:`oc-afiles__warn`,"aria-label":ve()}):(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:()=>T(e),children:t?M():U()}),t&&!e.missing?(0,Q.jsx)(nt,{curatable:Ke.includes(e.name),size:e.size??0,budget:D?.budgetChars??null,enabled:D?.enabled??!1,curation:ee.get(e.name)??null,inFlight:A===e.name,onCurate:()=>void B(e.name),onReview:e=>F(e)}):null]},e.name)})}),(0,Q.jsx)(`p`,{className:`oc-afiles__budget`,children:de({used:Z(Ze(m.files),V),total:Z(Je,V),pct:H.format(Xe(Ze(m.files)))})})]}),w&&f?(0,Q.jsx)(rt,{instanceName:f.instanceName,agentId:f.agentId,name:w.name,isAdmin:t,onClose:()=>T(null),onSaved:()=>void C()}):null,N?(0,Q.jsx)(it,{curationId:N,onClose:()=>F(null),onApplied:()=>{F(null),C()}}):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:B()}):a||i?.status===`dispatched`||i?.status===`applying`?(0,Q.jsx)(Ne,{variant:`outline`,className:`oc-afiles__curate-status`,children:V()}):e&&r&&n!==null&&Ge(t,n)?(0,Q.jsx)(K,{variant:`outline`,size:`sm`,className:`oc-afiles__curate`,onClick:o,children:A()}):null}function rt({instanceName:e,agentId:t,name:n,isAdmin:r,onClose:o,onSaved:l}){let p=s(v.agentFiles.getAgentFile),m=s(v.agentFiles.setAgentFile),g=J(),[_,y]=(0,Y.useState)(null),[x,C]=(0,Y.useState)(!1),[D,A]=(0,Y.useState)(``),[j,M]=(0,Y.useState)(!1),[N,P]=(0,Y.useState)(!1),[F,I]=(0,Y.useState)(!1),[L,R]=(0,Y.useState)(!1),z=(0,Y.useCallback)(async r=>{C(!1);try{let i=await p({instanceName:e,agentId:t,name:n});y({content:i.content,updatedAtMs:i.updatedAtMs}),r||A(i.content),I(!1)}catch{C(!0)}},[p,e,t,n]);(0,Y.useEffect)(()=>{z(!1)},[z]);async function B(){if(_!==null){P(!0),R(!1);try{await m({instanceName:e,agentId:t,name:n,content:D,baseUpdatedAtMs:_.updatedAtMs??void 0}),g.success(O({name:n})),l(),await z(!1)}catch(e){et(e)?I(!0):R(!0)}finally{P(!1)}}}let te=_!==null&&D!==_.content,V=(0,Y.useMemo)(()=>_===null?null:$e(_.content,D),[_,D]),ne=D.length>X,H=W(),U=(0,Y.useMemo)(()=>new Intl.NumberFormat(H),[H]);return(0,Q.jsx)(Pe,{open:!0,onOpenChange:e=>!e&&o(),children:(0,Q.jsxs)(je,{className:`oc-afiles__editor`,children:[(0,Q.jsxs)(He,{children:[(0,Q.jsx)(ze,{children:ge({name:n})}),(0,Q.jsxs)(we,{children:[le({agent:t,instance:e}),r?null:(0,Q.jsxs)(Q.Fragment,{children:[` · `,be()]})]})]}),x?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[E(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void z(!1),children:k()})]}):_===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:G()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`textarea`,{className:`oc-afiles__source`,value:D,readOnly:!r,spellCheck:!1,onChange:e=>A(e.target.value),"aria-label":ge({name:n})}),(0,Q.jsx)(`p`,{className:`oc-afiles__hint`,children:ee()}),F?(0,Q.jsxs)(`p`,{className:`oc-afiles__error`,role:`alert`,children:[d(),` `,(0,Q.jsx)(K,{variant:`outline`,size:`sm`,onClick:()=>void z(!0),children:me()})]}):null,L?(0,Q.jsx)(`p`,{className:`oc-afiles__error`,role:`alert`,children:T()}):null,(0,Q.jsxs)(`div`,{className:`oc-afiles__editor-foot`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__count${ne?` is-over`:``}`,children:i({count:U.format(D.length),max:U.format(X)})}),r?(0,Q.jsx)(K,{size:`sm`,disabled:!te||N||F,onClick:()=>M(!0),children:N?a():h()}):null]})]}),(0,Q.jsx)(Oe,{open:j,onOpenChange:M,children:(0,Q.jsxs)(Te,{children:[(0,Q.jsxs)(Me,{children:[(0,Q.jsx)(We,{children:f({name:n})}),(0,Q.jsx)(Ee,{children:c({agent:t})})]}),V?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__diff-counts`,children:w({added:V.added,removed:V.removed})}),V.sampleAdded.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:b()}),V.sampleAdded.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-add`,children:e||` `},t))]}):null,V.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__diff-block`,children:[(0,Q.jsx)(`span`,{className:`oc-afiles__diff-label`,children:u()}),V.sampleRemoved.map((e,t)=>(0,Q.jsx)(`code`,{className:`oc-afiles__diff-line is-del`,children:e||` `},t))]}):null]}):null,(0,Q.jsxs)(De,{children:[(0,Q.jsx)(Ae,{children:re()}),(0,Q.jsx)(ke,{onClick:()=>void B(),children:S()})]})]})})]})})}function it({curationId:e,onClose:t,onApplied:n}){let i=g(v.agentFileCuration.getProposal,{curationId:e}),c=s(v.agentFileCuration.approveCuration),u=p(v.agentFileCuration.rejectCuration),{toast:d}=J(),[f,h]=(0,Y.useState)(null),[b,S]=(0,Y.useState)(!1),[w,T]=(0,Y.useState)(``),E=W(),O=(0,Y.useMemo)(()=>i?$e(i.beforeContent,i.proposedContent):null,[i]);async function k(){h(`approve`);try{let t=await c({curationId:e});t.ok?(d({title:F(),variant:`success`}),n()):d({title:t.reason===`conflict`?ie():N({reason:t.reason??`unknown`}),variant:`error`})}catch{d({title:R(),variant:`error`})}finally{h(null)}}async function A(n){h(`reject`);try{let r=w.trim();(await u({curationId:e,...r?{comment:r}:{},relaunch:n})).ok?d({title:n?Ce():xe(),variant:`success`}):d({title:j(),variant:`error`}),t()}catch{d({title:R(),variant:`error`})}finally{h(null)}}return(0,Q.jsx)(Pe,{open:!0,onOpenChange:e=>e?void 0:t(),children:(0,Q.jsxs)(je,{className:`oc-afiles__review`,children:[(0,Q.jsxs)(He,{children:[(0,Q.jsx)(ze,{children:i?_e({name:i.name}):G()}),(0,Q.jsx)(we,{children:ue()})]}),i===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:G()}):i===null?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:j()}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`p`,{className:`oc-afiles__review-sizes`,children:[H({before:Z(i.beforeSize,E),after:Z(i.proposedSize,E)}),i.overBudget?(0,Q.jsxs)(Q.Fragment,{children:[` `,(0,Q.jsx)(q,{size:13,"aria-hidden":!0}),` `,he()]}):null]}),O?(0,Q.jsx)(`p`,{className:`oc-afiles__review-diff`,children:ce({added:O.added,removed:O.removed})}):null,i.feedback?(0,Q.jsx)(`p`,{className:`oc-afiles__review-feedback`,children:_({feedback:i.feedback})}):null,O&&O.sampleRemoved.length>0?(0,Q.jsxs)(`div`,{className:`oc-afiles__review-removed`,children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:D()}),(0,Q.jsx)(`ul`,{children:O.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:m()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:i.beforeContent})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`oc-afiles__review-label`,children:ye()}),(0,Q.jsx)(`pre`,{className:`oc-afiles__review-pre`,children:i.proposedContent})]})]})]}),b?(0,Q.jsxs)(`div`,{className:`oc-afiles__reject-form`,children:[(0,Q.jsx)(`label`,{className:`oc-afiles__review-label`,htmlFor:`curation-reject-comment`,children:C()}),(0,Q.jsx)(`textarea`,{id:`curation-reject-comment`,className:`oc-afiles__reject-textarea`,rows:3,placeholder:y(),value:w,onChange:e=>T(e.target.value)}),(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`ghost`,onClick:()=>S(!1),disabled:f!==null,children:l()}),(0,Q.jsx)(K,{variant:`outline`,onClick:()=>void A(!1),disabled:f!==null,children:f===`reject`?a():x()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void A(!0),disabled:f!==null,children:f===`reject`?a():o()})]})]}):(0,Q.jsxs)(`div`,{className:`oc-afiles__review-actions`,children:[(0,Q.jsx)(K,{variant:`outline`,onClick:()=>S(!0),disabled:f!==null||i==null,children:L()}),(0,Q.jsx)(K,{variant:`default`,onClick:()=>void k(),disabled:f!==null||i==null,children:f===`approve`?a():r()})]})]})})}export{tt as AgentFilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$_ as r,$g as i,A_ as a,Al as o,Bg as s,C_ as c,Cl as l,D as u,D_ as d,Dl as f,E_ as p,El as m,FF as h,Fg as g,Gg as _,Hg as v,Ig as y,Jg as b,Kg as x,LF as ee,Lg as S,O_ as te,Ol as ne,Pg as C,Qg as re,RF as w,Rg as ie,S_ as ae,Sl as oe,T,T_ as se,Tl as ce,Ug as le,Vg as ue,Wg as de,Xg as fe,Yg as pe,Zg as me,__ as he,a_ as ge,ar as _e,av as ve,b_ as ye,bl as be,c_ as xe,cv as Se,d_ as Ce,e_ as we,ev as Te,f_ as Ee,fv as De,g_ as Oe,h_ as ke,i_ as Ae,ir as je,iv as Me,j_ as Ne,k_ as Pe,kl as Fe,l_ as E,lv as Ie,m_ as Le,ml as Re,n_ as ze,o_ as Be,or as Ve,ov as He,p_ as Ue,pv as We,qg as Ge,r_ as Ke,rr as qe,rv as Je,s_ as Ye,sr as Xe,sv as Ze,t_ as Qe,u_ as $e,ur as et,uv as tt,v_ as nt,vl as rt,w_ as it,wl as at,x_ as ot,xl as st,y_ as ct,yl as lt,zg as ut}from"./dist-Bkkp8jtC.js";import{i as D,r as dt}from"./dist-CqLvr3pk.js";import{t as ft}from"./chevrons-up-down-jkl77XwS.js";import{i as pt,n as O,o as mt,r as ht,s as gt}from"./FieldLabel-B4QPoUJd.js";import{i as _t,n as vt,r as yt,t as bt}from"./tabs-0D2gasCk.js";import{t as k}from"./button-Ew8nYfum.js";import{$ as xt,$t as A,H as j,Kt as St,Lt as M,Pt as N,Q as Ct,V as wt,X as P,Y as F,Z as Tt,at as Et,ct as I,en as Dt,gt as Ot,h as kt,in as At,it as jt,lt as L,m as Mt,nt as Nt,ot as R,rn as Pt,rt as Ft,st as z,tt as It,ut as B,wt as Lt}from"./index-gP_wjUtq.js";import{r as Rt}from"./locales-CPjguROj.js";import{a as zt,i as V,n as Bt,o as H,r as U,t as Vt}from"./table-C4Hh9u_l.js";import{t as Ht}from"./FilterBar-BaqVZ-JQ.js";import{a as Ut,n as Wt,o as Gt,r as Kt,s as qt,t as Jt}from"./compatView-DIxFDrmB.js";import{t as W}from"./dispatchErrorInfo-Bk3nl1aq.js";var Yt=u(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Xt=u(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),G=t(e(),1);function Zt(e){return e.filter(e=>e.state===`error`)}function Qt(e){return e.reachable&&Zt(e.targets).length===0}function $t(e){return Qt(e)?(e.unreachableInstances??[]).length>0?`gateways_unreachable`:`ok`:`error`}function en(e){return e.state===`error`&&e.lastErrorCode!==null}function tn(e){return!!e.lastDownstreamRejectCode}function K(e){return e.kind??`openclaw`}function nn(e){return[...e].sort((e,t)=>e===`openclaw`?-1:t===`openclaw`?1:e.localeCompare(t))}function rn(e,t,n){let r=new Map;for(let e of t)e.instanceName&&r.set(e.instanceName,e.provider);for(let e of n)r.set(e.name,K(e));let i=e=>(e.instanceName?r.get(e.instanceName):void 0)??`openclaw`,a=new Set;for(let e of n)a.add(K(e));for(let e of t)a.add(e.provider);for(let t of e)a.add(i(t));return nn(a).map(r=>({key:r,connections:e.filter(e=>i(e)===r),compatTargets:t.filter(e=>e.provider===r),instances:n.filter(e=>K(e)===r)}))}function q(e){return e===`openclaw`?`OpenClaw`:e===`hermes`?`Hermes`:e.charAt(0).toUpperCase()+e.slice(1)}var J=`__all__`,an={q:``,state:J,instance:J,version:J},Y={connected:0,error:1,idle:2};function on(e){return e.q.trim()!==``||e.state!==`__all__`||e.instance!==`__all__`||e.version!==`__all__`}function sn(e,t){let n=t.q.trim().toLowerCase();return e.filter(e=>!(n&&!`${e.targetLabel} ${e.gatewayHost}`.toLowerCase().includes(n)||t.state!==`__all__`&&e.state!==t.state||t.instance!==`__all__`&&(e.instanceName??``)!==t.instance||t.version!==`__all__`&&(e.gatewayVersion??``)!==t.version))}function X(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:`base`})}function cn(e,t){return e===`version`?t.gatewayVersion===null:e===`lastOk`?t.lastOkAt===null:!1}function ln(e,t,n){switch(e){case`state`:return(Y[t.state]??99)-(Y[n.state]??99);case`instance`:return X(t.instanceLabel??t.instanceName??``,n.instanceLabel??n.instanceName??``);case`host`:return X(t.gatewayHost,n.gatewayHost);case`version`:{let e=t.gatewayVersion,r=n.gatewayVersion;return Gt(e,r)??X(e,r)}case`lastOk`:return t.lastOkAt-n.lastOkAt;default:return X(t.targetLabel,n.targetLabel)}}function un(e,t){if(!t)return e;let n=t.dir===`asc`?1:-1;return[...e].sort((e,r)=>{let i=cn(t.key,e),a=cn(t.key,r);return i&&a?0:i?1:a?-1:n*ln(t.key,e,r)})}function dn(e){let t=new Set;for(let n of e)t.add(n.state);return[...t].sort((e,t)=>(Y[e]??99)-(Y[t]??99))}function fn(e){let t=new Map;for(let n of e)n.instanceName!==null&&(t.has(n.instanceName)||t.set(n.instanceName,n.instanceLabel??n.instanceName));return[...t.entries()].map(([e,t])=>({name:e,label:t})).sort((e,t)=>X(e.label,t.label))}function pn(e){let t=new Set;for(let n of e)n.gatewayVersion!==null&&t.add(n.gatewayVersion);return[...t].sort((e,t)=>Gt(e,t)??X(e,t))}var Z=n();function mn({connections:e,displayByInstance:t}){let[n,r]=(0,G.useState)(an),[i,a]=(0,G.useState)(null),o=(0,G.useMemo)(()=>e.map((e,n)=>({_id:`${e.key}:${e.canonical}/${e.agentId}:${n}`,targetLabel:`${e.canonical}/${e.agentId}`,state:e.state,instanceName:e.instanceName??null,instanceLabel:e.instanceName?t.get(e.instanceName)??e.instanceName:null,gatewayHost:e.gatewayHost,gatewayVersion:e.gatewayVersion??null,okCount:e.okCount,errorCount:e.errorCount+(e.downstreamRejectCount??0),attempts:e.attempts,lastOkAt:e.lastOkAt??null,lastErrorCode:e.lastErrorCode??null,lastErrorAt:e.lastErrorAt??null,lastDownstreamRejectCode:e.lastDownstreamRejectCode??null,lastDownstreamRejectAt:e.lastDownstreamRejectAt??null})),[e,t]),c=(0,G.useMemo)(()=>dn(o),[o]),l=(0,G.useMemo)(()=>fn(o),[o]),u=(0,G.useMemo)(()=>pn(o),[o]),d=(0,G.useMemo)(()=>un(sn(o,n),i),[o,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,Z.jsx)(`p`,{className:`oc-admin__hint`,children:re()}):(0,Z.jsxs)(`div`,{className:`oc-conn`,children:[(0,Z.jsxs)(Ht,{q:n.q,onQChange:e=>r(t=>({...t,q:e})),searchPlaceholder:pe(),onReset:()=>r(an),canReset:on(n),children:[(0,Z.jsxs)(R,{value:n.state,onValueChange:e=>r(t=>({...t,state:e})),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(B,{placeholder:Ge()})}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(I,{value:J,children:b()}),c.map(e=>(0,Z.jsx)(I,{value:e,children:gn(e)},e))]})]}),(0,Z.jsxs)(R,{value:n.instance,onValueChange:e=>r(t=>({...t,instance:e})),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(B,{placeholder:x()})}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(I,{value:J,children:b()}),l.map(e=>(0,Z.jsx)(I,{value:e.name,children:e.label},e.name))]})]}),(0,Z.jsxs)(R,{value:n.version,onValueChange:e=>r(t=>({...t,version:e})),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-36`,children:(0,Z.jsx)(B,{placeholder:_()})}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(I,{value:J,children:b()}),u.map(e=>(0,Z.jsx)(I,{value:e,children:e},e))]})]})]}),d.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:de()}):(0,Z.jsxs)(Vt,{className:`oc-conn__table`,children:[(0,Z.jsx)(zt,{children:(0,Z.jsxs)(H,{children:[(0,Z.jsx)(Q,{label:le(),sortKey:`target`,sort:i,onSort:f}),(0,Z.jsx)(Q,{label:v(),sortKey:`state`,sort:i,onSort:f}),(0,Z.jsx)(Q,{label:ue(),sortKey:`instance`,sort:i,onSort:f}),(0,Z.jsx)(Q,{label:s(),sortKey:`host`,sort:i,onSort:f}),(0,Z.jsx)(Q,{label:ut(),sortKey:`version`,sort:i,onSort:f}),(0,Z.jsx)(V,{children:ie()}),(0,Z.jsx)(Q,{label:S(),sortKey:`lastOk`,sort:i,onSort:f})]})}),(0,Z.jsx)(Bt,{children:d.map(e=>(0,Z.jsx)(hn,{r:e},e._id))})]})]})}function Q({label:e,sortKey:t,sort:n,onSort:r}){let i=n?.key===t,a=i?n.dir:null;return(0,Z.jsx)(V,{"aria-sort":i?a===`asc`?`ascending`:`descending`:`none`,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-conn__sort`,onClick:()=>r(t),children:[e,i?a===`asc`?(0,Z.jsx)(dt,{size:13,"aria-hidden":!0}):(0,Z.jsx)(D,{size:13,"aria-hidden":!0}):(0,Z.jsx)(ft,{size:13,"aria-hidden":!0,className:`oc-conn__sort-idle`})]})})}function hn({r:e}){let t=en(e)?W(e.lastErrorCode):null,n=tn(e)?W(e.lastDownstreamRejectCode):null;return(0,Z.jsxs)(G.Fragment,{children:[(0,Z.jsxs)(H,{className:`oc-conn__row oc-conn__row--${e.state}`,children:[(0,Z.jsx)(U,{children:(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.targetLabel})}),(0,Z.jsx)(U,{children:(0,Z.jsx)(_n,{state:e.state})}),(0,Z.jsx)(U,{children:e.instanceLabel?(0,Z.jsx)(`span`,{className:`oc-bridge-target__instance`,children:e.instanceLabel}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(U,{children:(0,Z.jsx)(`span`,{className:`oc-bridge-target__host`,children:e.gatewayHost})}),(0,Z.jsx)(U,{children:e.gatewayVersion?(0,Z.jsx)(`span`,{className:`oc-bridge-target__version`,children:e.gatewayVersion}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}),(0,Z.jsx)(U,{children:(0,Z.jsx)(`span`,{className:`oc-conn__stats`,children:me({ok:e.okCount,errors:e.errorCount,attempts:e.attempts})})}),(0,Z.jsx)(U,{children:e.lastOkAt?(0,Z.jsx)(`span`,{className:`oc-traces__mono`,children:j(e.lastOkAt)}):(0,Z.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})})]}),t||n?(0,Z.jsx)(H,{className:`oc-conn__detail-row`,children:(0,Z.jsxs)(U,{colSpan:7,className:`oc-conn__detail-cell`,children:[t?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__error`,children:[(0,Z.jsx)(`strong`,{children:t.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastErrorCode}),e.lastErrorAt?` · ${j(e.lastErrorAt)}`:``,(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:t.hint})]}):null,n?(0,Z.jsxs)(`div`,{className:`oc-bridge-target__downstream`,children:[fe({label:n.label}),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.lastDownstreamRejectCode}),e.lastDownstreamRejectAt?` · ${j(e.lastDownstreamRejectAt)}`:``]}):null]})}):null]})}function gn(e){return e===`connected`?y():e===`error`?g():C()}function _n({state:e}){return e===`connected`?(0,Z.jsx)(F,{variant:`secondary`,children:y()}):e===`error`?(0,Z.jsx)(F,{variant:`destructive`,children:g()}):(0,Z.jsx)(F,{variant:`outline`,children:C()})}function vn(){return w(T.bridgeHealth.getBridgeHealth,{})}function yn(){let e=vn(),t=w(T.compat.getBridgeCompat,{}),n=w(T.me.getMe,{host:Ot})?.role===`admin`,r=w(T.admin.listInstances,n?{}:`skip`),i=w(T.agents.usageForInstances,n?{}:`skip`),a=Pt(),o=()=>void a({to:`/settings/anomalies`,search:{status:`open`}}),s=rn(e?e.targets:[],t?t.targets:[],r??[]),{section:c}=At({from:`/settings/bridge`}),l=Pt({from:`/settings/bridge`}),u=t?.compat??null,d=t===void 0?`loading`:t===null?`nodata`:`ready`,f=u!==null&&Wt(u,`hermes`)&&!s.some(e=>e.key===`hermes`);return(0,Z.jsxs)(`div`,{className:`oc-bridge`,children:[(0,Z.jsx)(bn,{health:e,compat:t,onSeeAnomalies:o}),(0,Z.jsx)(`p`,{className:`oc-admin__hint oc-bridge__caption`,children:he()}),i&&i.length>0?(0,Z.jsxs)(`section`,{className:`oc-bridge__usage`,children:[(0,Z.jsx)(`h3`,{className:`oc-bridge__usage-title`,children:Oe()}),(0,Z.jsxs)(Vt,{children:[(0,Z.jsx)(zt,{children:(0,Z.jsxs)(H,{children:[(0,Z.jsx)(V,{children:Xe()}),(0,Z.jsx)(V,{children:Ve()}),(0,Z.jsx)(V,{children:_e()}),(0,Z.jsx)(V,{children:je()}),(0,Z.jsx)(V,{children:qe()})]})}),(0,Z.jsx)(Bt,{children:i.flatMap(e=>{let t=kt(e.usage,Date.now());return t?t.windows.map((t,n)=>(0,Z.jsxs)(H,{children:[(0,Z.jsx)(U,{className:`font-medium`,children:n===0?e.instanceName:``}),(0,Z.jsx)(U,{children:t.provider}),(0,Z.jsx)(U,{children:t.label}),(0,Z.jsx)(U,{children:(0,Z.jsxs)(F,{variant:t.percentLeft<=10?`destructive`:t.percentLeft<=25?`outline`:`secondary`,children:[t.percentLeft,`%`]})}),(0,Z.jsx)(U,{className:`text-muted-foreground`,children:t.resetText??`—`})]},`${e.instanceName}:${t.provider}:${t.label}`)):[]})})]})]}):null,s.length>0?(0,Z.jsxs)(bt,{value:s.some(e=>e.key===c)?c:s[0]?.key??`openclaw`,onValueChange:e=>void l({search:{section:e},replace:!0}),children:[(0,Z.jsx)(yt,{className:`w-full`,children:s.map(e=>(0,Z.jsxs)(_t,{value:e.key,className:`flex-1 gap-1.5`,children:[(0,Z.jsx)(M,{size:13,"aria-hidden":!0}),q(e.key)]},e.key))}),s.map(e=>(0,Z.jsx)(vt,{value:e.key,children:(0,Z.jsx)(xn,{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,f?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Re()}):null]})}function bn({health:e,compat:t,onSeeAnomalies:n}){let r=t!=null&&t.buildVersion!=null&&t.bridgeVersion!=null&&t.buildVersion!==t.bridgeVersion,i=t?.buildRevision&&t.buildRevision!==`unknown`?t.buildRevision.slice(0,7):null,a=t&&t!==null?(0,Z.jsxs)(`span`,{className:`oc-bridge-card__ver`,children:[(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:Ut(t.bridgeVersion)}),i?(0,Z.jsxs)(Z.Fragment,{children:[` `,(0,Z.jsxs)(`code`,{className:`oc-traces__mono`,title:ne(),children:[`(`,i,`)`]})]}):null,r?(0,Z.jsxs)(`strong`,{className:`oc-bridge-card__mismatch`,children:[` `,f({build:t.buildVersion??`?`})]}):null,` · `,m(),` `,(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:t.protocolVersion===null?ce():String(t.protocolVersion)})]}):null;if(e===void 0)return(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:E()});if(e===null)return(0,Z.jsx)(`div`,{className:`oc-bridge-card oc-bridge-card--idle`,children:xe()});let o=Zt(e.targets),s=!e.reachable,c=$t(e),l=e.unreachableInstances??[],u=c===`ok`?`ok`:c===`gateways_unreachable`?`warn`:`error`,d=wt(e.checkedAt),p=e.startedAt==null?null:wt(e.startedAt);return(0,Z.jsxs)(`div`,{className:`oc-bridge-card oc-bridge-card--${u}`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__icon`,"aria-hidden":!0,children:c===`ok`?(0,Z.jsx)(A,{size:22}):s||c===`gateways_unreachable`?(0,Z.jsx)(Xt,{size:22}):(0,Z.jsx)(N,{size:22})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__body`,children:[(0,Z.jsx)(`div`,{className:`oc-bridge-card__title`,children:c===`ok`?Ye():c===`gateways_unreachable`?Ke({count:l.length}):s?Be():ge({count:o.length})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-card__meta`,children:[(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(Yt,{size:12,"aria-hidden":!0}),` `,Ae({time:d})]}),p?(0,Z.jsx)(`span`,{children:Qe({time:p})}):null,a]}),c===`gateways_unreachable`?(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:ze({names:l.join(`, `)})}):null,s?(0,Z.jsx)(`p`,{className:`oc-bridge-card__hint`,children:W(e.lastError===`not_configured`?`NOT_CONFIGURED`:`BRIDGE_UNREACHABLE`).hint}):null]}),(0,Z.jsx)(`button`,{type:`button`,className:`oc-bridgebar__drill`,onClick:n,children:we()})]})}function xn({providerKey:e,connections:t,instances:n,manifest:r,compatStatus:a,compatReachable:s,protocol:c}){let l=r?qt(r,e):null,u=new Map;for(let e of n)u.set(e.name,e.displayName??e.name);let d=[],f=new Set;for(let n of t){if(!n.instanceName||f.has(n.instanceName))continue;f.add(n.instanceName);let t=n.gatewayVersion??null;d.push({instanceName:n.instanceName,displayName:u.get(n.instanceName)??n.instanceName,version:t,state:Jt(t,e,r)})}let p=d.map(e=>e.state),m=p.includes(`beyond`)?`beyond`:p.length>0&&p.every(e=>e===`supported`)?`supported`:null,[h,g]=(0,G.useState)(!1);return(0,Z.jsxs)(`section`,{className:`oc-bridge-provider`,children:[(0,Z.jsxs)(`header`,{className:`oc-bridge-provider__head`,children:[(0,Z.jsx)(M,{size:15,"aria-hidden":!0,className:`oc-bridge-provider__icon`}),(0,Z.jsx)(`span`,{className:`oc-bridge-provider__name`,children:q(e)}),m?(0,Z.jsx)(F,{variant:m===`beyond`?`destructive`:`secondary`,children:Kt(m)}):null]}),(0,Z.jsx)(`h4`,{className:`oc-bridge-provider__sub`,children:o()}),(0,Z.jsx)(Cn,{providerName:q(e),support:l,compatStatus:a,compatReachable:s,manifest:r,instanceRows:d}),c?(0,Z.jsx)(Sn,{protocol:c}):null,(0,Z.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":h,onClick:()=>g(e=>!e),children:[h?(0,Z.jsx)(D,{size:13,"aria-hidden":!0}):(0,Z.jsx)(Dt,{size:13,"aria-hidden":!0}),i({count:t.length})]}),h?(0,Z.jsx)(mn,{connections:t,displayByInstance:u}):null]})}function Sn({protocol:e}){let[t,n]=(0,G.useState)(!1),r=e.coverage,i=e.drift??[];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`h4`,{className:`oc-bridge-provider__sub`,children:[ke(),i.length>0?(0,Z.jsx)(F,{variant:`destructive`,children:Ue({count:i.length})}):(0,Z.jsx)(F,{variant:`secondary`,children:Le()})]}),(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[Ee({version:e.vendoredVersion}),r?` · `+Ce({handled:r.handled,ignored:r.ignored,gaps:r.gaps}):null]}),i.length>0?(0,Z.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:i.map(e=>(0,Z.jsxs)(`li`,{children:[(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e.shape}),` × `,e.count]},e.shape))}):null,r&&r.gapList.length>0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`button`,{type:`button`,className:`oc-bridge-provider__sub oc-bridge-provider__sub--toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[t?(0,Z.jsx)(D,{size:13,"aria-hidden":!0}):(0,Z.jsx)(Dt,{size:13,"aria-hidden":!0}),$e({count:r.gapList.length})]}),t?(0,Z.jsx)(`ul`,{className:`oc-bridge-protocol__list`,role:`list`,children:r.gapList.map(e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:e})},e))}):null]}):null]})}function Cn({support:e,compatStatus:t,compatReachable:n,manifest:r,instanceRows:i,providerName:a}){return t===`loading`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:E()}):t===`nodata`?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Fe()}):(0,Z.jsxs)(`div`,{className:`oc-compat`,children:[n?null:(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:at()}),r===null?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:l()}):(0,Z.jsxs)(`div`,{className:`oc-compat__support`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__label`,children:et({provider:a})}),e&&e.range!==null?(0,Z.jsx)(`span`,{children:oe({min:e.range.min,max:e.range.maxValidated})}):(0,Z.jsx)(`span`,{children:ce()}),e?(0,Z.jsx)(En,{versions:e.validatedVersions}):null]}),i.length===0?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:rt()}):(0,Z.jsx)(`div`,{className:`oc-compat__targets`,children:i.map(e=>(0,Z.jsxs)(`div`,{className:`oc-compat__target`,children:[(0,Z.jsx)(`span`,{className:`oc-compat__instance`,children:e.displayName}),(0,Z.jsx)(`code`,{className:`oc-traces__mono`,children:Ut(e.version)}),(0,Z.jsx)(F,{variant:e.state===`supported`?`secondary`:e.state===`beyond`?`destructive`:`outline`,children:Kt(e.state)})]},e.instanceName))})]})}function wn({instance:e,onClose:t}){return(0,Z.jsx)(Tt,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(Ct,{className:`oc-bridge-config-dialog`,onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(It,{children:[(0,Z.jsx)(Nt,{children:We({instance:e.displayName??e.name})}),(0,Z.jsx)(xt,{children:De()})]}),(0,Z.jsx)(Tn,{instance:e,onClose:t})]})})}function $({label:e,result:t}){return t?t.checked?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row `+(t.ok?`oc-bridge-config__check-row--ok`:`oc-bridge-config__check-row--err`),children:[t.ok?(0,Z.jsx)(A,{"aria-hidden":!0}):(0,Z.jsx)(N,{"aria-hidden":!0}),(0,Z.jsxs)(`span`,{children:[e,` — `,t.ok?ot():t.detail]})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--skip`,children:[e,` — `,ye()]}):null}function Tn({instance:e,onClose:t}){let n=ee(T.admin.upsertInstanceConfig),i=h(T.bridge.validateMediaPaths),o=Lt(),s=Rt(e.config?.contentLocale,void 0),[l,u]=(0,G.useState)(()=>pt(e.config??{},s)),[f,m]=(0,G.useState)(!1),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(null),b=l.inboundMediaMode===`shared-fs`,x=l.mediaMode===`shared-fs`,S=b||x;async function ne(){_(!0),y(null);try{y(await i({instanceName:e.name,inboundMediaMode:l.inboundMediaMode,mediaMode:l.mediaMode}))}catch(e){o.error(se(),e)}finally{_(!1)}}async function C(){m(!0);try{let r=e.config??{};await n({instanceId:e._id,config:ht(l,r,s)}),t()}catch(e){o.error(ve(),e)}finally{m(!1)}}return(0,Z.jsx)(`div`,{className:`oc-bridge-config`,children:(0,Z.jsxs)(`div`,{className:`oc-bridge-config__form`,children:[(0,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(O,{label:tt(),help:Me()}),(0,Z.jsxs)(R,{value:l.mediaMode,onValueChange:e=>u({...l,mediaMode:e}),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(B,{})}),(0,Z.jsx)(z,{children:gt.map(e=>(0,Z.jsx)(I,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(O,{label:Ie(),help:Je()}),(0,Z.jsxs)(R,{value:l.inboundMediaMode,onValueChange:e=>u({...l,inboundMediaMode:e}),children:[(0,Z.jsx)(L,{size:`sm`,className:`w-full`,children:(0,Z.jsx)(B,{})}),(0,Z.jsx)(z,{children:mt.map(e=>(0,Z.jsx)(I,{value:e,children:e},e))})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(O,{label:Se(),help:Te()}),(0,Z.jsx)(P,{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,Z.jsxs)(`div`,{className:`oc-bridge-config__grid`,children:[b&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(O,{label:Ne(),help:a()}),(0,Z.jsx)(P,{className:`w-full`,spellCheck:!1,value:l.inboundAgentMount,onChange:e=>u({...l,inboundAgentMount:e.target.value})})]}),x&&(0,Z.jsxs)(`label`,{className:`oc-field`,children:[(0,Z.jsx)(O,{label:Pe(),help:te()}),(0,Z.jsx)(P,{className:`w-full`,spellCheck:!1,value:l.outboundAgentMount,onChange:e=>u({...l,outboundAgentMount:e.target.value})})]})]}),(0,Z.jsxs)(`label`,{className:`oc-field--row`,children:[(0,Z.jsx)(Mt,{checked:l.rehydration,onCheckedChange:e=>u({...l,rehydration:e===!0})}),(0,Z.jsx)(O,{label:Ze(),help:r()})]}),S&&v!==null&&(0,Z.jsx)(`div`,{className:`oc-bridge-config__check`,children:v.reachable?!v.inbound&&!v.outbound?(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(N,{"aria-hidden":!0}),nt({reason:v.reason??`?`})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($,{label:c(),result:v.inbound}),(0,Z.jsx)($,{label:ae(),result:v.outbound}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:it()})]}):(0,Z.jsxs)(`p`,{className:`oc-bridge-config__check-row oc-bridge-config__check-row--err`,children:[(0,Z.jsx)(N,{"aria-hidden":!0}),ct()]})}),(0,Z.jsxs)(`div`,{className:`oc-bridge-config__actions`,children:[S&&(0,Z.jsxs)(k,{variant:`outline`,size:`sm`,onClick:()=>void ne(),disabled:g,children:[g?(0,Z.jsx)(St,{className:`size-4 animate-spin`,"aria-hidden":!0}):null,g?p():d()]}),(0,Z.jsx)(k,{size:`sm`,onClick:()=>void C(),disabled:f,children:He()})]})]})})}function En({versions:e}){if(e.length===0)return null;let t=[...e].reverse();return(0,Z.jsxs)(Ft,{children:[(0,Z.jsx)(Et,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,className:`oc-compat__versions-btn`,children:[e.length===1?st():be({count:e.length}),(0,Z.jsx)(D,{size:13,"aria-hidden":!0})]})}),(0,Z.jsxs)(jt,{className:`oc-compat__versions-pop`,align:`start`,children:[(0,Z.jsx)(`p`,{className:`oc-compat__versions-title`,children:lt()}),(0,Z.jsx)(`div`,{className:`oc-compat__versions-list`,children:t.map(e=>(0,Z.jsx)(F,{variant:`secondary`,children:e},e))})]})]})}export{yn as BridgeTab,wn as InstanceConfigDialog};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$u as r,FF as i,Fl as a,Il as o,Ku as s,LF as c,Ll as l,Ml as u,Nl as d,Pl as f,RF as p,Rl as m,T as h,Zu as g,ao as _,co as v,do as y,dv as b,hu as x,io as S,jl as C,kF as w,lo as T,lr as E,no as D,oo as O,qu as k,ro as A,so as j,uo as M,zl as N}from"./dist-Bkkp8jtC.js";import{t as P}from"./button-Ew8nYfum.js";import{Pt as F,X as I,b as L,ct as R,f as z,lt as B,m as V,ot as H,p as U,st as W,ut as G}from"./index-gP_wjUtq.js";import{i as K}from"./compatView-DIxFDrmB.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=c(h.admin.upsertInstanceConfig),n=p(h.agents.listAgentsForInstance,{instanceName:e.name}),i=typeof e.config?.converterAgentId==`string`?e.config.converterAgentId:``,[a,o]=(0,q.useState)(i),[s,l]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{o(i),l(`idle`)},[e._id,i]);let f=`__none__`,m=a!==i;async function g(){l(`saving`);try{let n={...e.config??{}};a===``||a===f?delete n.converterAgentId:n.converterAgentId=a,await t({instanceId:e._id,config:n}),l(`done`)}catch{l(`error`)}}let _=n?.agents??[];return(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:v()}),(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:j()}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsxs)(H,{value:a===``?f:a,onValueChange:e=>o(e===f?``:e),children:[(0,X.jsx)(B,{className:`oc-cdefaults__select`,"aria-label":v(),children:(0,X.jsx)(G,{placeholder:O()})}),(0,X.jsxs)(W,{children:[(0,X.jsx)(R,{value:f,children:O()}),_.map(e=>(0,X.jsx)(R,{value:e.agentId,children:e.displayName?`${e.displayName} (${e.agentId})`:e.agentId},e.agentId))]})]}),(0,X.jsx)(P,{size:`sm`,disabled:!m||s===`saving`,onClick:()=>void g(),children:s===`saving`?r():d()})]}),s===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:u()}):null,s===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:C()}):null]})}function Q({instance:e}){let t=c(h.admin.upsertInstanceConfig),n=e.config?.curationEnabled===!0,i=typeof e.config?.curationBudgetChars==`number`?e.config.curationBudgetChars:null,[a,o]=(0,q.useState)(n),[s,l]=(0,q.useState)(i===null?``:String(i)),[f,p]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{o(n),l(i===null?``:String(i)),p(`idle`)},[e._id,n,i]);let m=s.trim(),g=m===``?null:/^\d+$/.test(m)?Number.parseInt(m,10):NaN,v=!a||g===null||Number.isInteger(g)&&g>=4e3&&g<=6e4,y=a!==n||(g??null)!==i;async function b(){p(`saving`);try{let n={...e.config??{}};n.curationEnabled=a,!a||g===null||Number.isNaN(g)?delete n.curationBudgetChars:n.curationBudgetChars=g,await t({instanceId:e._id,config:n}),p(`done`)}catch{p(`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)(V,{checked:a,onCheckedChange:e=>o(e===!0),"aria-label":T()}),(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:T()})]}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsx)(I,{type:`number`,min:4e3,max:6e4,step:1e3,placeholder:`20000`,value:s,onChange:e=>l(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!v,"aria-label":_(),disabled:!a}),(0,X.jsx)(P,{size:`sm`,disabled:!y||!v||f===`saving`,onClick:()=>void b(),children:f===`saving`?r():d()})]}),v?null:(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:S()}),f===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:u()}):null,f===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:C()}):null,(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:A()})]})}function $({instance:e}){let t=c(h.admin.upsertInstanceConfig),n=typeof e.config?.summarizeThresholdChars==`number`?e.config.summarizeThresholdChars:null,[i,a]=(0,q.useState)(n===null?``:String(n)),[o,s]=(0,q.useState)(`idle`);(0,q.useEffect)(()=>{a(n===null?``:String(n)),s(`idle`)},[e._id,n]);let l=i.trim(),f=l===``?null:/^\d+$/.test(l)?Number.parseInt(l,10):NaN,p=f===null||Number.isInteger(f)&&f>=1e3&&f<=2e5,m=(f??null)!==n;async function g(){s(`saving`);try{let n={...e.config??{}};f===null?delete n.summarizeThresholdChars:n.summarizeThresholdChars=f,await t({instanceId:e._id,config:n}),s(`done`)}catch{s(`error`)}}return(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:y()}),(0,X.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,X.jsx)(I,{type:`number`,min:1e3,max:2e5,step:1e3,placeholder:`8000`,value:i,onChange:e=>a(e.target.value),className:`oc-cdefaults__number`,"aria-invalid":!p}),(0,X.jsx)(P,{size:`sm`,disabled:!m||!p||o===`saving`,onClick:()=>void g(),children:o===`saving`?r():d()})]}),p?null:(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:D()}),o===`done`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:u()}):null,o===`error`?(0,X.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:C()}):null,(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:M()})]})}function ee(){let e=i(h.agentFiles.getChatDefaults),[t,n]=(0,q.useState)({status:`loading`}),r=p(h.admin.listInstances,{}),[c,u]=(0,q.useState)(null);(0,q.useEffect)(()=>{!r||r.length===0||(!c||!r.some(e=>e.name===c))&&u(r[0].name)},[r,c]);let d=(r?.length??0)>1,_=r!==void 0&&r.length===0,v=p(h.compat.forInstance,c?{instanceName:c}:`skip`),y=c?L(v,`configDefaults`):`loading`,S=y===`loading`?null:y.blocked,C=(0,q.useMemo)(()=>d&&c?{instanceName:c}:{},[d,c]),T=(0,q.useRef)(0),D=(0,q.useCallback)(async()=>{let t=++T.current;n({status:`loading`});try{let r=Y(await e(C));if(T.current!==t)return;n({status:`done`,current:r})}catch{if(T.current!==t)return;n({status:`error`})}},[e,C]);(0,q.useEffect)(()=>{S===!1&&(d&&!c||D())},[D,S,d,c]);let O=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:k()},{id:`standard`,label:s()}],[]);return(0,X.jsxs)(`div`,{className:`oc-cdefaults`,children:[(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:N()}),d&&c?(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:x()}),(0,X.jsxs)(H,{value:c,onValueChange:e=>u(e),children:[(0,X.jsx)(B,{size:`sm`,"aria-label":x(),children:(0,X.jsx)(G,{})}),(0,X.jsx)(W,{children:(r??[]).map(e=>(0,X.jsx)(R,{value:e.name,children:e.name},e.name))})]})]}):null,_?(0,X.jsx)(`p`,{className:`oc-admin__hint`,role:`status`,children:b()}):y===`loading`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:w()}):y.blocked?(0,X.jsxs)(`p`,{className:`oc-compat__blocked`,role:`status`,children:[(0,X.jsx)(F,{size:14,"aria-hidden":!0}),` `,K(y.gatewayVersion,y.provider)]}):t.status===`loading`?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:w()}):t.status===`error`?(0,X.jsxs)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:[f(),` `,(0,X.jsx)(P,{variant:`outline`,size:`sm`,onClick:()=>void D(),children:g()})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`oc-cdefaults__row`,children:[(0,X.jsx)(`span`,{className:`oc-cdefaults__label`,children:m()}),(0,X.jsx)(z,{options:A,value:O?.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:o()}),(0,X.jsx)(z,{options:j,value:O===null||O.fastModeDefault===null?null:O.fastModeDefault?`fast`:`standard`,onChange:()=>{},disabled:!0}),(0,X.jsx)(`p`,{className:`oc-cdefaults__help`,children:a()})]}),(0,X.jsx)(`p`,{className:`oc-cdefaults__note`,children:E()})]}),(()=>{let e=r?.find(e=>e.name===(c??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{$P as r,AP as ee,BP as i,CP as te,DP as a,Da as o,EP as ne,Ea as re,FP as ie,GP as s,HP as c,IP as l,JP as u,KP as d,LF as f,LP as ae,MP as oe,NP as se,OP as ce,PP as le,QP as p,RF as ue,RP as de,SP as fe,T as m,TP as pe,UP as h,VP as g,WP as _,XP as me,YP as he,ZP as ge,eF as _e,jF as ve,jP as ye,kF as be,kO as xe,kP as v,nF as y,qP as b,tF as x,wP as S,xP as C,zP as w}from"./dist-Bkkp8jtC.js";import{t as T}from"./button-Ew8nYfum.js";import{F as E,Ft as D,G as O,I as k,J as A,L as j,M,N as Se,P as Ce,R as we,U as Te,W as Ee,Xt as N,Y as P,Yt as De,ct as F,lt as I,m as Oe,ot as L,st as R,ut as z,wt as ke,z as Ae,zt as je}from"./index-gP_wjUtq.js";import{a as Me,i as B,n as Ne,o as V,r as H,t as Pe}from"./table-C4Hh9u_l.js";var U=t(e(),1),W=n(),G=`all`;function K(e){switch(e){case`image`:return s();case`audio`:return _();case`video`:return h();case`pdf`:return c();case`document`:return g();case`archive`:return i();default:return w()}}function q(){let[e,t]=(0,U.useState)(G),[n,i]=(0,U.useState)(G),[s,c]=(0,U.useState)(G),[h,g]=(0,U.useState)(G),[_,w]=(0,U.useState)(!1),[q,J]=(0,U.useState)(null),Fe=f(m.files.softDelete),Y=ke();function Ie(){t(G),i(G),c(G),g(G)}async function Le(){let e=q;if(J(null),e)try{await Fe({fileId:e.id}),Y.success(ce())}catch(e){Y.error(a(),e)}}let X=ue(m.files.listMine,{direction:e===G?void 0:e,chatId:n===G?void 0:n,instanceName:s===G?void 0:s,category:h===G?void 0:h,includeAutoGenerated:_||void 0}),Re=(0,U.useMemo)(()=>new Intl.DateTimeFormat(ve(),{dateStyle:`medium`,timeStyle:`short`}),[]);if(X===void 0)return(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:be()});let{files:Z,facets:Q,truncated:ze,cap:Be}=X,$=e!==G||n!==G||s!==G||h!==G;return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:y()}),(0,W.jsxs)(`div`,{className:`oc-files__filters`,style:{display:`flex`,flexWrap:`wrap`,gap:8,margin:`12px 0`},children:[(0,W.jsxs)(L,{value:e,onValueChange:t,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":x(),children:(0,W.jsx)(z,{})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(F,{value:G,children:_e()}),(0,W.jsx)(F,{value:`inbound`,children:r()}),(0,W.jsx)(F,{value:`outbound`,children:p()})]})]}),(0,W.jsxs)(L,{value:n,onValueChange:i,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":ge(),children:(0,W.jsx)(z,{})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(F,{value:G,children:me()}),Q.chats.map(e=>(0,W.jsx)(F,{value:e.id,children:e.title},e.id))]})]}),Q.multiProvider?(0,W.jsxs)(L,{value:s,onValueChange:c,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":he(),children:(0,W.jsx)(z,{})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(F,{value:G,children:u()}),Q.instances.map(e=>(0,W.jsx)(F,{value:e,children:e},e))]})]}):null,(0,W.jsxs)(L,{value:h,onValueChange:g,children:[(0,W.jsx)(I,{size:`sm`,"aria-label":b(),children:(0,W.jsx)(z,{})}),(0,W.jsxs)(R,{children:[(0,W.jsx)(F,{value:G,children:d()}),Q.categories.map(e=>(0,W.jsx)(F,{value:e,children:K(e)},e))]})]}),(0,W.jsxs)(`label`,{className:`oc-files__autogen`,children:[(0,W.jsx)(Oe,{checked:_,onCheckedChange:e=>w(e===!0),"aria-label":o()}),(0,W.jsx)(`span`,{children:o()})]}),$?(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}),ye()]}):null]}),Z.length===0?(0,W.jsx)(`p`,{className:`oc-admin__hint`,children:$?fe():te()}):(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:de()}),(0,W.jsx)(B,{children:ae()}),(0,W.jsx)(B,{children:l()}),(0,W.jsx)(B,{children:ie()}),(0,W.jsx)(B,{children:le()}),(0,W.jsx)(B,{className:`text-right`,children:se()})]})}),(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)(P,{variant:`outline`,style:{marginLeft:6},children:re()}):null]}),(0,W.jsx)(H,{title:e.mimeType,children:K(e.category)}),(0,W.jsx)(H,{children:(0,W.jsx)(P,{variant:`secondary`,children:e.direction===`inbound`?r():p()})}),(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)(Te,{children:[(0,W.jsx)(A,{asChild:!0,children:(0,W.jsx)(T,{variant:`ghost`,size:`icon`,"aria-label":ee(),children:(0,W.jsx)(De,{size:16})})}),(0,W.jsxs)(Ee,{align:`end`,children:[e.url?(0,W.jsx)(O,{asChild:!0,children:(0,W.jsxs)(`a`,{href:e.url,download:e.filename,target:`_blank`,rel:`noopener noreferrer`,children:[(0,W.jsx)(N,{size:14}),oe()]})}):(0,W.jsxs)(O,{disabled:!0,children:[(0,W.jsx)(N,{size:14}),S()]}),(0,W.jsxs)(O,{variant:`destructive`,onSelect:()=>J({id:e._id,filename:e.filename}),children:[(0,W.jsx)(D,{size:14}),v()]})]})]})})]},e._id))})]}),ze?(0,W.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:8},children:C({cap:Be})}):null]}),(0,W.jsx)(M,{open:q!==null,onOpenChange:e=>!e&&J(null),children:(0,W.jsxs)(E,{children:[(0,W.jsxs)(we,{children:[(0,W.jsx)(Ae,{children:ne()}),(0,W.jsx)(k,{children:pe()})]}),(0,W.jsxs)(j,{children:[(0,W.jsx)(Ce,{children:xe()}),(0,W.jsx)(Se,{onClick:()=>void Le(),children:v()})]})]})})]})}export{q as FilesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$C as r,$S as i,AC as a,AS as o,BC as s,BS as c,CC as l,CS as u,DC as d,DS as f,Do as p,EC as m,ES as h,Eo as g,FC as ee,FF as _,FS as v,GC as te,GS as y,HC as b,HS as x,IC as ne,IS as S,JC as re,JS as C,KC as ie,KS as ae,LC as oe,LF as w,LS as T,MC as se,MS as ce,NC as le,OC as ue,OS as de,Oo as fe,PC as pe,PS as E,QC as me,QS as he,RC as ge,RF as D,RS as _e,SC as ve,SS as ye,Sk as be,T as O,TC as xe,TS as Se,UC as Ce,US as we,VC as Te,VS as Ee,WC as De,WS as Oe,XC as ke,XS as Ae,YC as je,YS as Me,ZC as Ne,ZS as Pe,_C as Fe,_S as Ie,aC as k,bC as Le,bS as Re,cC as ze,dC as Be,dS as A,eC as Ve,fC as He,fS as Ue,fr as We,gC as j,gS as Ge,hC as M,hS as Ke,iC as qe,jC as Je,jS as Ye,kC as Xe,kS as Ze,ko as Qe,lC as N,mC as $e,mS as et,mr as tt,nC as nt,nv as rt,oC as it,pC as at,pS as ot,pr as st,qC as ct,qS as lt,rC as ut,sC as dt,tC as ft,tv as pt,uC as mt,uS as ht,vC as gt,vS as _t,wC as vt,wS as yt,xC as bt,xS as xt,xk as P,yC as St,yS as Ct,zC as wt,zS as Tt}from"./dist-Bkkp8jtC.js";import{a as Et,c as Dt}from"./FieldLabel-B4QPoUJd.js";import{t as F}from"./button-Ew8nYfum.js";import{$ as Ot,A as kt,Q as I,X as L,Y as R,Z as z,at as At,ct as B,d as jt,it as Mt,lt as V,m as H,nt as U,ot as W,rt as Nt,st as G,tt as K,ut as q,wt as J}from"./index-gP_wjUtq.js";import{t as Pt}from"./DataTableShell-DMFVXfOQ.js";import{InstanceConfigDialog as Ft}from"./BridgeTab-Db3Fo_mk.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:Et},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=D(O.admin.listInstances,{}),t=D(O.agents.listAllInstanceAgents,{}),n=w(O.admin.upsertInstance),i=w(O.admin.deleteInstance),o=J(),[c,u]=(0,Y.useState)(!1),[f,p]=(0,Y.useState)(Q),[h,g]=(0,Y.useState)(null),[_,v]=(0,Y.useState)(null),[y,x]=(0,Y.useState)(null),[S,C]=(0,Y.useState)(null);async function ae(){try{await n({instanceId:S??void 0,name:f.name,gatewayUrl:f.gatewayUrl,bridgeUrl:f.bridgeUrl||void 0,displayName:f.displayName||void 0,kind:f.kind,transport:f.kind===`hermes`?f.transport:void 0,gatewayVersion:f.gatewayVersion||void 0,gatewayHttpUrl:f.gatewayHttpUrl||void 0,streamTransport:f.streamTransport}),p(Q),C(null),u(!1)}catch(e){o.error(Ne(),e)}}return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`oc-admin__hint`,children:[ke(),(0,Z.jsx)(`strong`,{children:je()}),re()]}),(0,Z.jsx)(Pt,{title:ct(),rows:e,addLabel:ie(),onAdd:()=>{C(null),p(Q),u(!0)},emptyHint:te(),columns:[{header:De(),cell:e=>e.name,sort:e=>e.name},{header:Ce(),cell:e=>(0,Z.jsx)(R,{variant:`outline`,children:e.kind??`openclaw`}),sort:e=>e.kind??`openclaw`},{header:b(),cell:e=>e.gatewayUrl,sort:e=>e.gatewayUrl},{header:Te(),cell:e=>e.displayName??`—`,sort:e=>e.displayName??null},{header:r(),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)(R,{variant:r(e.agentId)?`default`:`outline`,title:r(e.agentId)?A():void 0,children:[e.emoji?`${e.emoji} `:``,e.displayName??e.agentId]},e.agentId))})}}],rowActions:e=>[{label:oe(),onSelect:()=>{C(e._id),p(Bt(e)),u(!0)}},{label:me(),onSelect:()=>g(e.name)},{label:ve(),onSelect:()=>x(e)},{label:s(),onSelect:()=>v(e)},{label:wt(),variant:`destructive`,onSelect:()=>void i({instanceId:e._id})}],bulkActions:[{label:wt(),variant:`destructive`,onSelect:e=>e.forEach(e=>void i({instanceId:e}))}]}),(0,Z.jsx)(jt,{open:c,onOpenChange:u,title:S?ne():ge(),description:pe(),canSubmit:!!(f.name&&f.gatewayUrl),onSubmit:ae,submitLabel:le(),children:(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsxs)($,{label:se(),children:[(0,Z.jsx)(L,{value:f.name,disabled:S!==null,onChange:e=>p({...f,name:e.target.value})}),S?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:ee()}):null]}),(0,Z.jsx)($,{label:Je(),children:(0,Z.jsxs)(W,{value:f.kind,onValueChange:e=>p({...f,kind:e}),children:[(0,Z.jsx)(V,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(q,{})}),(0,Z.jsxs)(G,{children:[(0,Z.jsx)(B,{value:`openclaw`,children:`OpenClaw`}),(0,Z.jsx)(B,{value:`hermes`,children:`Hermes`})]})]})}),f.kind===`hermes`?(0,Z.jsx)($,{label:tt(),children:(0,Z.jsxs)(W,{value:f.transport,onValueChange:e=>p({...f,transport:e}),children:[(0,Z.jsx)(V,{size:`sm`,className:`w-56`,children:(0,Z.jsx)(q,{})}),(0,Z.jsxs)(G,{children:[(0,Z.jsx)(B,{value:`ws`,children:st()}),(0,Z.jsx)(B,{value:`rest`,children:We()})]})]})}):null,(0,Z.jsx)($,{label:a(),children:(0,Z.jsx)(L,{value:f.gatewayUrl,onChange:e=>p({...f,gatewayUrl:e.target.value})})}),(0,Z.jsx)($,{label:Xe(),children:(0,Z.jsx)(L,{value:f.bridgeUrl,placeholder:ue(),onChange:e=>p({...f,bridgeUrl:e.target.value})})}),(0,Z.jsx)($,{label:d(),children:(0,Z.jsx)(L,{value:f.displayName,onChange:e=>p({...f,displayName:e.target.value})})}),(0,Z.jsxs)($,{label:rt(),children:[(0,Z.jsxs)(W,{value:f.streamTransport,onValueChange:e=>p({...f,streamTransport:e}),children:[(0,Z.jsx)(V,{size:`sm`,className:`w-40`,children:(0,Z.jsx)(q,{})}),(0,Z.jsx)(G,{children:Dt.map(e=>(0,Z.jsx)(B,{value:e,children:e},e))})]}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:pt()})]}),(0,Z.jsx)($,{label:m(),children:(0,Z.jsx)(L,{value:f.gatewayVersion,placeholder:xe(),onChange:e=>p({...f,gatewayVersion:e.target.value})})}),(0,Z.jsx)($,{label:vt(),children:(0,Z.jsx)(L,{value:f.gatewayHttpUrl,placeholder:l(),onChange:e=>p({...f,gatewayHttpUrl:e.target.value})})})]})}),(0,Z.jsx)(Zt,{instanceName:h,open:h!==null,onOpenChange:e=>{e||g(null)}}),_?(0,Z.jsx)(Ft,{instance:_,onClose:()=>v(null)},_._id):null,y?(0,Z.jsx)(Ht,{instance:y,onClose:()=>x(null)},y._id):null]})}function Ht({instance:e,onClose:t}){let n=D(O.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)(z,{open:!0,onOpenChange:e=>!e&&t(),children:(0,Z.jsxs)(I,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,Z.jsxs)(K,{children:[(0,Z.jsx)(U,{children:bt({instance:e.displayName??e.name})}),(0,Z.jsx)(Ot,{children:Le()})]}),(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.instanceSync.forceInstanceSync),n=J(),[r,a]=(0,Y.useState)(!1);async function o(){if(!r){a(!0);try{switch((await t({instanceId:e._id})).status){case`synced`:n.success(Ve());break;case`no_agents`:n.success(he());break;case`no_bridge_url`:n.error(Pe());break;case`deploy_misconfigured`:n.error(Ae());break;case`unauthorized`:n.error(C());break;case`not_served`:n.error(lt());break;default:n.error(Me());break}}catch(e){n.error(i(),e)}finally{a(!1)}}}return(0,Z.jsxs)(`div`,{className:`oc-form`,children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:ae()}),(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(F,{size:`sm`,variant:`outline`,onClick:()=>void o(),disabled:r,children:r?ft():nt()})})]})}function Wt({instance:e}){let t=D(O.bridgeAuth.listBridgeAuthStatus,{}),n=_(O.bridgeAuth.mintBridgeSecret),r=w(O.bridgeAuth.revokeBridgeSecret),i=J(),[a,o]=(0,Y.useState)(!1),[s,l]=(0,Y.useState)(null),[u,d]=(0,Y.useState)(!1),f=(t??[]).find(t=>t.instanceId===e._id),p=f!==void 0;async function m(){if(!a){o(!0);try{l((await n({instanceId:e._id})).plaintext),d(!1)}catch(e){i.error(Tt(),e)}finally{o(!1)}}}async function h(){if(!a){o(!0);try{await r({instanceId:e._id}),l(null),i.success(c())}catch(e){i.error(Tt(),e)}finally{o(!1)}}}async function g(){if(s)try{await navigator.clipboard.writeText(s),d(!0)}catch{}}return(0,Z.jsxs)($,{label:y(),children:[(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:Oe()}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(R,{variant:p?`outline`:`secondary`,children:p?`${j()} · ${f.prefix}…${f.lastFour}`:M()}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(F,{size:`sm`,onClick:()=>void m(),disabled:a,children:p?x():we()}),p?(0,Z.jsx)(F,{size:`sm`,variant:`destructive`,onClick:()=>void h(),disabled:a,children:Ee()}):null]})]}),s?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`oc-sa__minted-warning`,children:_e()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:s}),(0,Z.jsx)(F,{variant:`outline`,size:`sm`,onClick:()=>void g(),children:u?be():P()})]}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,onClick:()=>{l(null),d(!1)},children:T()})]}):null]})}function Gt({instanceId:e,field:t,updatedAt:n}){let r=_(O.instanceSecrets.setInstanceSecret),i=w(O.instanceSecrets.clearInstanceSecret),a=_(O.deviceIdentity.generateDeviceIdentity),o=J(),[s,c]=(0,Y.useState)(``),[l,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(null),[p,m]=(0,Y.useState)(!1),h=n!==null,g=t===`deviceIdentity`,ee=t===`token`?St():t===`deviceIdentity`?gt():Fe();async function v(){if(!(!s.trim()||l)){u(!0);try{await r({instanceId:e,field:t,plaintext:s}),c(``),f(null),m(!1),o.success(mt())}catch(e){o.error(N(),e)}finally{u(!1)}}}async function te(){if(!l){u(!0);try{await i({instanceId:e,field:t}),f(null),m(!1),o.success(ze())}catch(e){o.error(N(),e)}finally{u(!1)}}}async function y(){if(!l){u(!0);try{f(await a({instanceId:e})),m(!1),o.success(k())}catch(e){o.error(ut(),e)}finally{u(!1)}}}let b=d?`openclaw devices approve ${d.id}`:``;async function x(){if(b)try{await navigator.clipboard.writeText(b),m(!0)}catch{}}return(0,Z.jsxs)($,{label:ee,children:[g?(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:it()}):null,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Z.jsx)(R,{variant:h?`outline`:`secondary`,children:h?j():M()}),(0,Z.jsx)(L,{type:`password`,autoComplete:`off`,className:`flex-1 min-w-32`,value:s,placeholder:h?at():$e(),onChange:e=>c(e.target.value)}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(F,{size:`sm`,onClick:()=>void v(),disabled:l||s.trim().length===0,children:He()}),g?(0,Z.jsx)(F,{size:`sm`,variant:`outline`,onClick:()=>void y(),disabled:l,children:dt()}):null,h?(0,Z.jsx)(F,{size:`sm`,variant:`destructive`,onClick:()=>void te(),disabled:l,children:Be()}):null]})]}),d?(0,Z.jsxs)(`div`,{className:`oc-bridgesecret__reveal`,children:[(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:k()}),(0,Z.jsx)(`p`,{className:`oc-admin__hint`,children:qe()}),(0,Z.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,Z.jsx)(`code`,{className:`oc-sa__minted-plain`,children:b}),(0,Z.jsx)(F,{variant:`outline`,size:`sm`,onClick:()=>void x(),children:p?be():P()})]}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,onClick:()=>{f(null),m(!1)},children:T()})]}):null]})}var Kt={conversational:h,documentary:yt,summarizer:Qe,curator:p},qt={conversational:Se,documentary:u,summarizer:fe,curator:g},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:o()}),t.map(e=>(0,Z.jsx)(R,{variant:`secondary`,className:`oc-agenttype__chip`,title:Yt(e),children:Jt(e)},e)),(0,Z.jsxs)(Nt,{children:[(0,Z.jsx)(At,{asChild:!0,children:(0,Z.jsx)(F,{type:`button`,variant:`outline`,size:`sm`,className:`h-7`,children:Ze()})}),(0,Z.jsxs)(Mt,{align:`start`,className:`oc-agenttypes-pop`,children:[(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__title`,children:de()}),(0,Z.jsx)(`p`,{className:`oc-agenttypes-pop__hint`,children:f()}),(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)(H,{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=D(O.agents.listAgentsForInstance,t&&e?{instanceName:e}:`skip`),i=w(O.agents.setAgentEnabled).withOptimisticUpdate((e,{instanceName:t,agentId:n,enabled:r})=>{let i=e.getQuery(O.agents.listAgentsForInstance,{instanceName:t});i&&e.setQuery(O.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,enabled:r}:e)})}),a=w(O.agents.setInstanceDefaultAgent).withOptimisticUpdate((e,{instanceName:t,agentId:n})=>{let r=e.getQuery(O.agents.listAgentsForInstance,{instanceName:t});r&&e.setQuery(O.agents.listAgentsForInstance,{instanceName:t},{...r,defaultAgentId:n})}),o=w(O.agents.setAgentTypes).withOptimisticUpdate((e,{instanceName:t,agentId:n,types:r})=>{let i=e.getQuery(O.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=Rt(r);e.setQuery(O.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,types:a}:e)})}),s=w(O.agents.setAgentDescription).withOptimisticUpdate((e,{instanceName:t,agentId:n,description:r})=>{let i=e.getQuery(O.agents.listAgentsForInstance,{instanceName:t});if(!i)return;let a=r.trim();e.setQuery(O.agents.listAgentsForInstance,{instanceName:t},{...i,agents:i.agents.map(e=>e.agentId===n?{...e,description:a.length===0?null:a}:e)})}),c=w(O.agents.removeInstanceAgent),l=kt(),u=J();async function d(t,n){if(e)try{await i({instanceName:e,agentId:t,enabled:n})}catch(e){u.error(E(),e)}}async function f(t){if(e)try{await a({instanceName:e,agentId:t})}catch(e){u.error(E(),e)}}async function p(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(E(),e)}}async function m(t,n){if(e&&await l({title:Re({name:n}),description:Ct(),confirmLabel:_t(),destructive:!0}))try{await c({instanceName:e,agentId:t}),u.success(Ie())}catch(e){u.error(E(),e)}}return(0,Z.jsx)(z,{open:t,onOpenChange:n,children:(0,Z.jsxs)(I,{className:`oc-access`,children:[(0,Z.jsxs)(K,{children:[(0,Z.jsx)(U,{children:S({name:e??``})}),(0,Z.jsx)(Ot,{children:v()})]}),r===void 0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:Ge()}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`oc-access__poll`,children:r.discovery===null?Ke():r.discovery.lastPollOk?et():ot({error:r.discovery.error??`?`})}),r.agents.length===0?(0,Z.jsx)(`p`,{className:`oc-access__hint`,children:Ue()}):(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)(H,{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)(R,{variant:`outline`,className:`oc-access__gone`,children:ht()}),(0,Z.jsx)(F,{size:`sm`,variant:`ghost`,className:`h-7 text-destructive`,onClick:()=>void m(t.agentId,a),children:xt()})]}):i?(0,Z.jsx)(R,{variant:`default`,children:A()}):(0,Z.jsx)(F,{size:`sm`,variant:`outline`,className:`h-7`,disabled:!t.enabled,onClick:()=>void f(t.agentId),children:ye()})]}),t.enabled?(0,Z.jsx)(Xt,{agentId:t.agentId,types:o,onToggle:e=>void p(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(E(),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)(L,{className:`oc-agentcard__desc`,value:n,maxLength:280,placeholder:ce(),"aria-label":Ye(),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{BT as r,FF as i,FT as a,Gs as o,HT as s,Hs as c,IT as l,Js as u,Ks as d,LF as f,LT as p,MT as m,NT as h,PT as g,RF as _,RT as v,T as y,UT as b,Us as x,VT as S,WT as C,Ws as w,Xs as T,Ys as E,jT as D,qs as O,zT as k}from"./dist-Bkkp8jtC.js";import{t as A}from"./button-Ew8nYfum.js";import{X as j,Y as M,m as N}from"./index-gP_wjUtq.js";var P=t(e(),1),F=n();function I(){let e=_(y.integrations.status.status,{}),t=f(y.admin.setIntegrationConfig),[n,i]=(0,P.useState)(null);if((0,P.useEffect)(()=>{e&&n===null&&i(e.config)},[e,n]),!e||!n)return(0,F.jsx)(`p`,{className:`oc-admin__hint`,children:C()});let o=n,c=(e,t,n)=>i({...o,[e]:{...o[e],[t]:n}}),d=(e,n)=>void t({[e]:n});return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{className:`oc-admin__hint`,children:[b(),` `,(0,F.jsx)(`strong`,{children:s()}),` `,S()]}),(0,F.jsxs)(L,{title:`Langfuse`,status:e.langfuse.configured?e.langfuse.enabled?(0,F.jsx)(M,{variant:`secondary`,children:r()}):(0,F.jsx)(M,{variant:`outline`,children:k()}):(0,F.jsx)(M,{variant:`outline`,children:v()}),note:p(),children:[(0,F.jsx)(R,{label:a(),children:(0,F.jsx)(j,{value:o.langfuse.host??``,placeholder:e.langfuse.effectiveHost,onChange:e=>c(`langfuse`,`host`,e.target.value),onBlur:()=>d(`langfuse`,{host:o.langfuse.host??``})})}),(0,F.jsx)(z,{label:D(),checked:o.langfuse.enabled??!0,onChange:e=>{c(`langfuse`,`enabled`,e),d(`langfuse`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`Opik`,status:e.opik.configured?e.opik.enabled?(0,F.jsx)(M,{variant:`secondary`,children:r()}):(0,F.jsx)(M,{variant:`outline`,children:k()}):(0,F.jsx)(M,{variant:`outline`,children:v()}),note:l(),children:[(0,F.jsx)(R,{label:g(),children:(0,F.jsx)(j,{value:o.opik.baseUrl??``,placeholder:e.opik.effectiveBaseUrl,onChange:e=>c(`opik`,`baseUrl`,e.target.value),onBlur:()=>d(`opik`,{baseUrl:o.opik.baseUrl??``})})}),(0,F.jsx)(R,{label:h(),children:(0,F.jsx)(j,{value:o.opik.workspace??``,placeholder:e.opik.effectiveWorkspace||m(),onChange:e=>c(`opik`,`workspace`,e.target.value),onBlur:()=>d(`opik`,{workspace:o.opik.workspace??``})})}),(0,F.jsx)(z,{label:D(),checked:o.opik.enabled??!0,onChange:e=>{c(`opik`,`enabled`,e),d(`opik`,{enabled:e})}})]}),(0,F.jsxs)(L,{title:`OpenTelemetry (OTLP)`,status:e.otlp.configured?e.otlp.enabled?(0,F.jsx)(M,{variant:`secondary`,children:r()}):(0,F.jsx)(M,{variant:`outline`,children:k()}):(0,F.jsx)(M,{variant:`outline`,children:T()}),note:E(),children:[(0,F.jsx)(R,{label:u(),children:(0,F.jsx)(j,{value:o.otlp.endpoint??``,placeholder:e.otlp.effectiveEndpoint||`https://otlp.example.com/v1/traces`,onChange:e=>c(`otlp`,`endpoint`,e.target.value),onBlur:()=>d(`otlp`,{endpoint:o.otlp.endpoint??``})})}),(0,F.jsx)(B,{headersSet:e.otlp.headersSet}),(0,F.jsx)(z,{label:D(),checked:o.otlp.enabled??!0,onChange:e=>{c(`otlp`,`enabled`,e),d(`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=i(y.integrations.otlpSecret.setOtlpHeaders),n=f(y.integrations.otlpSecret.clearOtlpHeaders),[r,a]=(0,P.useState)(``),[s,l]=(0,P.useState)(null),[u,p]=(0,P.useState)(!1),m=async()=>{p(!0),l(null);try{await t({headersJson:r}),a(``)}catch(e){l(e instanceof Error?e.message:String(e))}finally{p(!1)}};return(0,F.jsxs)(R,{label:O(),children:[(0,F.jsx)(j,{value:r,placeholder:e?d():o(),onChange:e=>a(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 m(),children:w()}),e?(0,F.jsx)(A,{variant:`ghost`,size:`sm`,disabled:u,onClick:()=>void n({}),children:x()}):null]}),s?(0,F.jsx)(`p`,{className:`oc-int__otlp-headers-error`,children:s}):null,(0,F.jsx)(`p`,{className:`oc-uipa__note`,children:c()})]})}export{I as IntegrationsTab};
@@ -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,Et as o,FA as s,GA as c,HA as l,IA as u,JA as d,KA as ee,LA as te,LF as f,Mt as ne,NC as re,PA as ie,QA as ae,RA as oe,RF as p,T as m,UA as h,VA as g,WA as se,XA as ce,YA as le,ZA as ue,_F as de,_j as fe,_t as pe,aF as me,aj as _,bF as v,cF as y,cj as b,dF as x,dj as S,dt as C,ej as w,fF as T,fj as E,ft as D,gF as O,gj as k,gt as A,hF as j,hj as M,ht as N,iF as P,ij as F,jt as I,kF as L,lF as R,lj as z,mF as he,mj as ge,mt as _e,nj as ve,oF as ye,oj as be,pF as xe,pj as Se,pt as Ce,qA as B,rj as we,sF as Te,sj as Ee,tj as De,uF as Oe,uj as ke,vF as Ae,vj as je,vt as Me,wF as Ne,xF as Pe,yF as Fe,yj as Ie,zA as Le}from"./dist-Bkkp8jtC.js";import{t as V}from"./button-Ew8nYfum.js";import{E as Re,X as H,Y as U,ct as W,gt as G,ht as ze,lt as Be,m as K,mt as Ve,ot as He,pt as Ue,st as We,t as Ge,ut as Ke,wt as qe}from"./index-gP_wjUtq.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:a(`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:a(`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:()=>Ie()},{id:`composer`,label:()=>je()},{id:`sidebar`,label:()=>fe()},{id:`notifications`,label:()=>w()},{id:`other`,label:()=>k()}],X={showSource:{category:`messages`,label:()=>M(),help:()=>ge()},showReport:{category:`messages`,label:()=>Se(),help:()=>E()},copyAssistant:{category:`messages`,label:()=>S()},copyUser:{category:`messages`,label:()=>ke()},showDelete:{category:`messages`,label:()=>z()},showTools:{category:`messages`,label:()=>b(),help:()=>Ee()},voiceInput:{category:`composer`,label:()=>be(),help:()=>_()},showUsage:{category:`composer`,label:()=>F(),help:()=>we()},autoReadAloud:{category:`composer`,label:()=>ne(),help:()=>I()},showChatAge:{category:`sidebar`,label:()=>ve(),help:()=>De()},notifSound:{category:`notifications`,label:()=>r(),help:()=>ae()},notifSystem:{category:`notifications`,label:()=>ue(),help:()=>ce()},replySound:{category:`notifications`,label:()=>le(),help:()=>d()}};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:()=>oe()};function rt({prefKey:e,ui:t}){let n=f(m.admin.setUiPrefDefault),r=f(m.admin.setFeatureEnabled),i=tt(e),a=i?nt[e]?.():void 0;return(0,J.jsxs)(`div`,{className:`oc-prefs__gov`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__gov-row`,children:[(0,J.jsx)(`span`,{className:`oc-prefs__gov-label`,children:l()}),(0,J.jsxs)(He,{value:$e(t.defaults[e]),onValueChange:t=>void n({key:e,value:et(t)}),children:[(0,J.jsx)(Be,{size:`sm`,className:`w-36`,children:(0,J.jsx)(Ke,{})}),(0,J.jsxs)(We,{children:[(0,J.jsx)(W,{value:`on`,children:u()}),(0,J.jsx)(W,{value:`off`,children:s()}),(0,J.jsx)(W,{value:`inherit`,children:ie()})]})]}),i?(0,J.jsxs)(`span`,{className:`oc-prefs__gov-gate`,children:[(0,J.jsx)(K,{checked:t.featuresEnabled[i]===!0,onCheckedChange:e=>void r({key:i,enabled:e===!0}),"aria-label":g()}),g()]}):null]}),a?(0,J.jsx)(`span`,{className:`oc-prefs__gov-help`,children:a}):null]})}function it({current:e,enabled:t}){let n=f(m.me.setDictationShortcut),[r,i]=(0,q.useState)(!1),[a,o]=(0,q.useState)(!1);return(0,q.useEffect)(()=>{if(!r)return;let e=e=>{if(e.preventDefault(),e.stopPropagation(),e.key===`Escape`){i(!1);return}let t=Ve(e);if(t===null){[`Shift`,`Control`,`Meta`,`Alt`].includes(e.key)||(o(!0),window.setTimeout(()=>o(!1),1800));return}i(!1),n({shortcut:t})};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[r,n]),(0,J.jsxs)(`div`,{className:`oc-prefs__row${t?``:` is-locked`}`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,J.jsxs)(`span`,{className:`oc-prefs__label`,children:[Me(),e?(0,J.jsx)(U,{variant:`secondary`,children:ze(e,Ue())}):null]}),(0,J.jsx)(`span`,{className:`oc-prefs__help`,children:a?N():r?A():pe()})]}),(0,J.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[e&&!r?(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void n({shortcut:null}),children:C()}):null,(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,disabled:!t,"aria-pressed":r,onClick:()=>i(e=>!e),children:r?D():e?Ce():_e()})]})]})}function at(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),a=p(m.me.getMe,{host:G}),s=a?.ui,l=$(a?.role)&&n,u=f(m.me.setUiPref).withOptimisticUpdate(Re),d=(0,q.useMemo)(()=>s?Q(Object.keys(s.effective),e):[],[s,e]);return s?(0,J.jsxs)(`div`,{className:`oc-prefs-panel`,children:[$(a?.role)?(0,J.jsxs)(`label`,{className:`oc-prefs__gov-toggle`,children:[(0,J.jsx)(K,{checked:n,onCheckedChange:e=>r(e===!0),"aria-label":h()}),h()]}):null,l?(0,J.jsxs)(`div`,{className:`oc-prefs__gov-head`,children:[(0,J.jsx)(`p`,{children:i()}),(0,J.jsx)(`p`,{children:Le()}),(0,J.jsx)(`p`,{children:te()})]}):null,(0,J.jsx)(H,{value:e,onChange:e=>t(e.target.value),placeholder:B(),"aria-label":B(),className:`mb-2`}),d.length===0?(0,J.jsx)(`div`,{className:`oc-prefs__empty`,children:ee()}):(0,J.jsx)(`div`,{className:`oc-prefs`,children:d.map(e=>(0,J.jsxs)(`section`,{className:`oc-prefs__card`,children:[(0,J.jsx)(`h4`,{className:`oc-prefs__cat`,children:e.label}),e.keys.map(e=>{let t=X[e],n=t?t.label():e,r=t?.help?.(),i=s.locked[e],a=s.effective[e],d=s.userOverrides[e]!==void 0;return(0,J.jsxs)(`div`,{className:`oc-prefs__row${i?` is-locked`:``}`,children:[(0,J.jsxs)(`div`,{className:`oc-prefs__info`,children:[(0,J.jsxs)(`span`,{className:`oc-prefs__label`,children:[n,i?(0,J.jsx)(U,{variant:`outline`,children:c()}):d?(0,J.jsx)(U,{variant:`secondary`,children:o()}):null]}),r?(0,J.jsx)(`span`,{className:`oc-prefs__help`,children:r}):null]}),(0,J.jsxs)(`div`,{className:`oc-prefs__ctl`,children:[!i&&d?(0,J.jsx)(`button`,{type:`button`,className:`oc-prefs__reset`,onClick:()=>void u({key:e,value:null}),children:se()}):null,(0,J.jsx)(Ye,{checked:a,disabled:i,onCheckedChange:t=>{e===`notifSystem`&&t&&typeof Notification<`u`&&Notification.permission==="default"&&Notification.requestPermission(),u({key:e,value:t})},"aria-label":n})]}),l?(0,J.jsx)(rt,{prefKey:e,ui:s}):null]},e)})]},e.id))}),(0,J.jsx)(it,{current:a?.dictationShortcut??null,enabled:s.effective.voiceInput===!0})]}):(0,J.jsx)(`div`,{className:`oc-prefs__empty`,children:L()})}var ot={sm:()=>R(),md:()=>y(),lg:()=>Te(),xl:()=>ye()};function st(){let e=p(m.me.getMe,{host:G}),t=f(m.me.setLocale),n=f(m.me.setFontScale).withOptimisticUpdate((e,{scale:t})=>{let n=e.getQuery(m.me.getMe,{host:G});n&&e.setQuery(m.me.getMe,{host:G},{...n,fontScale:t,resolvedFontScale:t??`md`})}),r=f(m.me.setMyName),i=qe(),a=e?.locale??`default`,o=e?.name??``,[s,c]=(0,q.useState)(null),l=s??o,u=l.trim()!==o.trim();async function d(){try{await r({name:l}),c(null),i.success(de())}catch(e){i.error(O(),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:Pe()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:v()})]}),(0,J.jsxs)(`div`,{className:`oc-show__row`,children:[(0,J.jsx)(H,{className:`max-w-xs`,value:l,maxLength:120,placeholder:Fe(),onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&u&&(e.preventDefault(),d())}}),(0,J.jsx)(V,{size:`sm`,disabled:!u,onClick:()=>void d(),children:re()})]}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:Ae()})]}),(0,J.jsxs)(`section`,{className:`oc-show__section`,children:[(0,J.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,J.jsx)(`h2`,{className:`oc-show__title`,children:j()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:he()})]}),(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:Ne()})]}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:xe()})]}),(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:T()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:x()})]}),(0,J.jsx)(`div`,{className:`oc-show__row`,children:Ge.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:Oe()})]}),(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:me()}),(0,J.jsx)(`p`,{className:`oc-show__desc`,children:P()})]}),(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{Ao as r,B_ as i,F_ as a,G_ as o,Gi as s,H_ as c,I_ as l,J_ as u,Ji as d,K_ as f,Ki as p,LF as m,L_ as h,Mo as g,N_ as _,No as v,P_ as ee,Po as te,Q_ as ne,RF as y,R_ as b,T as x,U_ as S,V_ as C,W_ as w,X_ as T,Xi as E,Y_ as re,Yi as ie,Z_ as ae,_r as D,av as O,gr as k,hr as A,jo as j,ov as M,q_ as N,qi as P,z_ as F}from"./dist-Bkkp8jtC.js";import{d as I,f as L,i as R,l as z,n as B,r as V,t as H,u as oe}from"./FieldLabel-B4QPoUJd.js";import{t as U}from"./button-Ew8nYfum.js";import{ct as W,gt as G,lt as K,m as q,ot as J,st as Y,ut as X,wt as se}from"./index-gP_wjUtq.js";import{r as Z,t as ce}from"./locales-CPjguROj.js";import{t as le}from"./localePickerView-C2RmOS86.js";/* empty css */var Q=t(e(),1),$=n(),ue={media_delivery:{label:N,help:f},documentary_fetch:{label:o,help:w},inbound_files:{label:S,help:c},history_summary:{label:te,help:v},file_curation:{label:E,help:ie}},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:a,references:ee,files:_,previous_summary:g,new_messages:j,max_chars:r,file_name:d,budget_chars:P,feedback:p,content:s};function pe(){let e=y(x.admin.listInstances,{}),[t,n]=(0,Q.useState)(null);if(e===void 0)return(0,$.jsx)(`div`,{className:`oc-settings__tab-loading`,"aria-busy":`true`});if(e.length===0)return(0,$.jsx)(`div`,{className:`oc-injtab`,children:(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:i()})});let r=e.find(e=>e._id===t)??e[0];return(0,$.jsxs)(`div`,{className:`oc-injtab`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__head`,children:[(0,$.jsx)(B,{label:ne(),help:ae()}),(0,$.jsxs)(`label`,{className:`oc-injtab__picker`,children:[(0,$.jsx)(`span`,{children:C()}),(0,$.jsxs)(J,{value:r._id,onValueChange:e=>n(e),children:[(0,$.jsx)(K,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(X,{})}),(0,$.jsx)(Y,{children:e.map(e=>(0,$.jsx)(W,{value:e._id,children:e.displayName??e.name},e._id))})]})]})]}),(0,$.jsx)(me,{instance:r},r._id)]})}function me({instance:e}){let t=m(x.admin.upsertInstanceConfig),n=se(),r=y(x.me.getMe,{host:G}),i=e.config??{},a=Z(e.config?.contentLocale,r?.defaultLocale??void 0),[o,s]=(0,Q.useState)(()=>R(i,a));(0,Q.useEffect)(()=>{s(R(i,a))},[a,e._id]);let[c,l]=(0,Q.useState)(!1),u=o.promptInjections,d=(e,t)=>s({...o,promptInjections:{...u,[e]:{...u[e],...t}}});async function f(){l(!0);try{await t({instanceId:e._id,config:V(o,i,a)})}catch(e){n.error(O(),e)}finally{l(!1)}}async function p(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(O(),e)}}let h=e.config?.contentLocale??`default`,g=ce[Z(void 0,r?.defaultLocale??void 0)];return(0,$.jsxs)(`div`,{className:`oc-injtab__body`,children:[(0,$.jsxs)(`div`,{className:`oc-injtab__content-locale`,children:[(0,$.jsx)(`span`,{children:D()}),(0,$.jsxs)(J,{value:h,onValueChange:e=>void p(e),children:[(0,$.jsx)(K,{size:`sm`,className:`min-w-44`,children:(0,$.jsx)(X,{})}),(0,$.jsxs)(Y,{children:[(0,$.jsx)(W,{value:`default`,children:A({locale:g})}),le().map(e=>(0,$.jsx)(W,{value:e.value,children:e.label},e.value))]})]}),(0,$.jsx)(`p`,{className:`oc-admin__hint`,children:k()})]}),oe.map(e=>(0,$.jsx)(he,{injKey:e,def:z[e],i18n:ue[e],row:u[e]??{enabled:!0,template:z[e].defaultTemplate[a]},contentLocale:a,onChange:t=>d(e,t)},e)),(0,$.jsx)(`div`,{className:`oc-injtab__actions`,children:(0,$.jsx)(U,{size:`sm`,onClick:()=>void f(),disabled:c,children:M()})})]})}function he({injKey:e,def:t,i18n:n,row:r,contentLocale:i,onChange:a}){let[o,s]=(0,Q.useState)(!1),c=r.template.trim()!==t.defaultTemplate[i],d=t.togglable&&!r.enabled,f=Object.fromEntries(t.placeholders.map(e=>[e,de[e]??`{${e}}`])),p=I(e,r,i),m=p?L(p,f):``;return(0,$.jsxs)(`section`,{className:`oc-injcard`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__head`,children:[t.togglable?(0,$.jsxs)(`label`,{className:`oc-field--row`,children:[(0,$.jsx)(q,{checked:r.enabled,onCheckedChange:e=>a({enabled:e===!0})}),(0,$.jsx)(B,{label:n.label(),help:n.help()})]}):(0,$.jsx)(B,{label:n.label(),help:n.help()}),c&&(0,$.jsx)(`span`,{className:`oc-injection__badge`,children:re()})]}),(0,$.jsx)(`textarea`,{className:`oc-injcard__text`,value:r.template,disabled:d,rows:8,spellCheck:!1,onChange:e=>a({template:e.target.value})}),(0,$.jsxs)(`div`,{className:`oc-injection__foot`,children:[(0,$.jsxs)(`div`,{className:`oc-injcard__phs`,children:[(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:u()}),t.placeholders.map(e=>(0,$.jsxs)(`span`,{className:`oc-injcard__ph-chip`,children:[(0,$.jsx)(`code`,{children:`{${e}}`}),(0,$.jsx)(H,{text:(fe[e]??(()=>e))()})]},e))]}),(0,$.jsxs)(`div`,{className:`oc-injcard__btns`,children:[(0,$.jsx)(U,{variant:`ghost`,size:`sm`,onClick:()=>s(e=>!e),children:o?b():F()}),c&&(0,$.jsx)(U,{variant:`ghost`,size:`sm`,onClick:()=>a({template:t.defaultTemplate[i]}),children:T()})]})]}),o&&(0,$.jsx)(`div`,{className:`oc-injcard__preview`,children:m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`pre`,{className:`oc-injcard__previewtext`,children:m}),(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:h()})]}):(0,$.jsx)(`span`,{className:`oc-injection__ph`,children:l()})})]})}export{pe as PromptInjectionsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{Ax as r,Bx as i,Cx as ee,Dx as a,Ex as o,Fx as s,Gx as c,Hx as l,Ix as u,Jx as d,Kx as f,LF as p,Lx as m,Mx as h,Nx as g,Ox as te,Px as ne,RF as re,Rx as _,Sx as ie,T as v,Tx as y,Ux as b,Vx as x,Wx as S,ax as ae,ba as C,bx as w,cx as T,dx as E,fx as D,jx as O,kx as k,lx as A,ox as j,px as M,qx as N,sx as P,ux as F,wx as I,xx as L,yx as R,zx as z}from"./dist-Bkkp8jtC.js";import{t as B}from"./button-Ew8nYfum.js";import{A as V,Gt as H,X as U,Y as W,d as G,m as K,wt as q}from"./index-gP_wjUtq.js";import{t as J}from"./roleDescriptions-CSbRqH5d.js";var Y=t(e(),1),X=n(),Z=[{group:()=>d(),keys:[{key:`traces.read`,label:()=>b()},{key:`traces.read.content`,label:()=>l(),phi:!0},{key:`traces.write`,label:()=>x()}]},{group:()=>N(),keys:[{key:`kpi.read`,label:()=>b()},{key:`kpi.write`,label:()=>x()}]},{group:()=>f(),keys:[{key:`openclaw.query`,label:()=>i()},{key:`anomalies.read`,label:()=>z()},{key:`anomalies.report`,label:()=>_()}]},{group:()=>c(),keys:[{key:`chats.read`,label:()=>b()},{key:`selfheal`,label:()=>u()},{key:`feedback.respond`,label:()=>C()}]},{group:()=>S(),keys:[{key:`admin.manage`,label:()=>m()}]}],oe=Z.flatMap(e=>e.keys.map(e=>e.key));function Q(e){return e.includes(`*`)}var $={key:``,name:``,description:``};function se(){let e=re(v.apiKeys.listRoles,{}),t=p(v.apiKeys.createRole),n=p(v.apiKeys.ensureRolesSeeded),i=p(v.apiKeys.updateRolePermissions).withOptimisticUpdate((e,{roleId:t,permissions:n})=>{let r=e.getQuery(v.apiKeys.listRoles,{});r&&e.setQuery(v.apiKeys.listRoles,{},r.map(e=>e._id===t?{...e,permissions:n}:e))}),c=V(),l=q(),[u,d]=(0,Y.useState)(!1),[f,m]=(0,Y.useState)($),[_,b]=(0,Y.useState)(new Set);(0,Y.useEffect)(()=>{n({}).catch(e=>{l.error(ne(),e)})},[n,l]);let x=e??[];async function S(e,t){if(Q(e.permissions))return;if(e.builtin){await c({title:g({name:e.name}),description:h(),confirmLabel:O()});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){l.error(r(),e)}finally{b(t=>{let n=new Set(t);return n.delete(e._id),n})}}async function C(){try{await t({key:f.key,name:f.name,description:f.description||void 0,permissions:[]}),m($),d(!1)}catch(e){l.error(k(),e)}}let N=e===void 0,z=!N&&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`}),` `,a(),` `,(0,X.jsx)(`code`,{children:`traces.read.content`}),` `,o()]}),(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:y()}),(0,X.jsx)(`div`,{className:`oc-dt__bar-actions`,children:(0,X.jsx)(B,{size:`sm`,onClick:()=>{m($),d(!0)},children:I()})})]}),N?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:ee()}):z?(0,X.jsx)(`p`,{className:`oc-admin__hint`,children:ie()}):(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:L()}),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?s({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)(W,{variant:`outline`,className:`gap-1`,children:[(0,X.jsx)(H,{}),` `,w()]}):(0,X.jsx)(W,{variant:`secondary`,children:R()})]}),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)(K,{checked:t||e.permissions.includes(r),disabled:t||n,"aria-label":`${e.key} · ${r}`,title:t?M():n?D():r,onCheckedChange:()=>void S(e,r)})},r))]},e.key)})})]})})]}),(0,X.jsx)(G,{open:u,onOpenChange:d,title:E(),description:F(),canSubmit:!!(f.key&&f.name),onSubmit:C,submitLabel:A(),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:T()}),(0,X.jsx)(U,{value:f.key,placeholder:P(),onChange:e=>m({...f,key:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:j()}),(0,X.jsx)(U,{value:f.name,onChange:e=>m({...f,name:e.target.value})})]}),(0,X.jsxs)(`label`,{className:`oc-field`,children:[(0,X.jsx)(`span`,{className:`oc-field__label`,children:ae()}),(0,X.jsx)(U,{value:f.description,onChange:e=>m({...f,description:e.target.value})})]})]})})]})}export{se as RolesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$M as r,AN as i,BN as a,D as o,EN as s,FF as c,FN as ee,HN as te,IN as l,KM as ne,MN as re,NN as ie,ON as ae,PN as oe,QM as se,RN as u,T as d,TN as ce,VN as le,_P as ue,aN as de,aP as fe,cN as pe,cP as me,dN as he,dP as ge,eN as _e,fN as ve,fP as ye,gP as be,hN as xe,hP as Se,iN as Ce,jF as we,jN as Te,kF as f,kN as p,lN as Ee,lP as De,mN as m,mP as Oe,nN as ke,oN as Ae,oP as je,pN as h,pP as Me,rN as Ne,sN as Pe,sP as Fe,tN as Ie,uN as Le,uP as Re,vP as ze,yP as Be,zN as g}from"./dist-Bkkp8jtC.js";import{t as _}from"./button-Ew8nYfum.js";import{$ as Ve,F as He,Ft as Ue,Ht as We,I as Ge,Kt as v,L as Ke,M as qe,Mt as Je,N as Ye,O as Xe,P as Ze,Q as y,R as Qe,Ut as $e,Vt as et,X as b,Y as x,Z as S,ct as C,et as tt,k as nt,lt as w,nt as T,ot as E,st as D,tt as O,ut as k,wt as rt,z as it,zt as at}from"./index-gP_wjUtq.js";import{a as ot,i as A,n as st,o as j,r as M,t as ct}from"./table-C4Hh9u_l.js";var lt=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`}]]),N=t(e(),1),P=n(),F={minutes:6e4,hours:36e5,days:864e5};function I(e){return e?.data?.code??`unknown`}function L(){let e=c(d.scheduled.listMyCrons),t=c(d.scheduled.getCronDetail),n=c(d.scheduled.listCronRuns),o=c(d.scheduled.updateCron),L=c(d.scheduled.removeCron),ut=c(d.scheduled.runCronNow),R=rt(),[z,dt]=(0,N.useState)(null),[B,ft]=(0,N.useState)(!1),[pt,mt]=(0,N.useState)(!1),[V,ht]=(0,N.useState)(null),[H,U]=(0,N.useState)(null),[W,G]=(0,N.useState)(null),[K,q]=(0,N.useState)(null),[gt,_t]=(0,N.useState)(!1),J=(0,N.useCallback)(async()=>{ft(!0),mt(!1);try{dt(await e({}))}catch{mt(!0)}finally{ft(!1)}},[e]);(0,N.useEffect)(()=>{J()},[J]);let vt=(0,N.useMemo)(()=>new URLSearchParams(window.location.search).get(`job`),[]),Y=(0,N.useRef)(null);(0,N.useEffect)(()=>{z!==null&&Y.current!==null&&Y.current.scrollIntoView({block:`center`})},[z]);let X=(0,N.useMemo)(()=>new Intl.DateTimeFormat(we(),{dateStyle:`medium`,timeStyle:`short`}),[]),Z=async(e,t,n)=>{ht(e);try{await t(),R.success(n),await J()}catch(e){R.toast({variant:`error`,title:l({code:I(e)})})}finally{ht(null)}},Q=(0,N.useRef)(0),$=(0,N.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),R.toast({variant:`error`,title:l({code:I(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%F.days===0?(s=String(e/F.days),c=`days`):e%F.hours===0?(s=String(e/F.hours),c=`hours`):(s=String(Math.max(1,Math.round(e/F.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),R.toast({variant:`error`,title:l({code:I(e)})})}},xt=async()=>{if(K===null)return;let e={};if(K.nameDirty&&K.name.trim()===``||K.messageDirty&&K.hasMessage&&K.message.trim()===``){R.toast({variant:`error`,title:se()});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*F[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){R.toast({variant:`error`,title:r()});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;_t(!0);try{await o({instanceName:K.instanceName,jobId:K.jobId,patch:e}),R.success(ve()),t===$.current&&q(null),await J()}catch(e){R.toast({variant:`error`,title:l({code:I(e)})})}finally{_t(!1)}},St=z?.reduce((e,t)=>e+t.jobs.length,0)??0;return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{style:{display:`flex`,alignItems:`flex-start`,gap:8,marginBottom:12},children:[(0,P.jsx)(`p`,{className:`oc-admin__hint`,style:{flex:1,margin:0},children:Be()}),(0,P.jsxs)(_,{variant:`ghost`,size:`sm`,onClick:()=>void J(),disabled:B,style:{display:`inline-flex`,alignItems:`center`,gap:4},children:[(0,P.jsx)(at,{size:14,"aria-hidden":!0}),ze()]})]}),z===null?(0,P.jsx)(`p`,{className:`oc-admin__hint`,"aria-busy":B,children:pt?ue():f()}):(0,P.jsxs)(P.Fragment,{children:[pt?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:ue()}):null,z.length===0?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:be()}):null,z.map(e=>(0,P.jsxs)(`section`,{style:{marginBottom:20},children:[z.length>1||e.error||!e.supported?(0,P.jsxs)(`h3`,{style:{display:`flex`,alignItems:`center`,gap:8,fontSize:`0.85rem`,fontWeight:600,margin:`0 0 6px`},children:[e.instanceName,(0,P.jsx)(x,{variant:`outline`,children:e.kind})]}):null,e.supported?e.error?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:Oe({code:e.error})}):e.jobs.length===0?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:Me()}):(0,P.jsxs)(ct,{children:[(0,P.jsx)(ot,{children:(0,P.jsxs)(j,{children:[(0,P.jsx)(A,{children:ye()}),(0,P.jsx)(A,{children:ge()}),(0,P.jsx)(A,{children:Re()}),(0,P.jsx)(A,{children:De()}),(0,P.jsx)(A,{children:me()}),(0,P.jsx)(A,{children:xe()})]})}),(0,P.jsx)(st,{children:e.jobs.map((t,n)=>{let r=`${e.instanceName}:${t.id??n}`,i=V===r,s=e.manageSupported,c=e.kind===`openclaw`&&s;return(0,P.jsxs)(j,{ref:t.id!==null&&t.id===vt?Y:void 0,"data-state":t.id!==null&&t.id===vt?`selected`:void 0,children:[(0,P.jsx)(M,{className:`font-medium`,style:{maxWidth:280,overflow:`hidden`,textOverflow:`ellipsis`},title:t.name??void 0,children:t.name??Fe()}),(0,P.jsx)(M,{children:(0,P.jsx)(x,{variant:`secondary`,children:t.agentId})}),(0,P.jsxs)(M,{className:`whitespace-nowrap`,children:[(0,P.jsx)(`span`,{style:{fontFamily:`var(--font-mono, monospace)`},children:t.schedule??`—`}),(()=>{let e=Xe(t.schedule),n=e===null?null:nt(e);return n===null?null:(0,P.jsx)(`span`,{className:`text-muted-foreground`,style:{display:`block`,fontSize:`0.78rem`},children:n})})()]}),(0,P.jsx)(M,{className:`whitespace-nowrap text-muted-foreground`,children:t.nextRunAtMs===null?`—`:X.format(t.nextRunAtMs)}),(0,P.jsxs)(M,{children:[t.enabled===!0?(0,P.jsx)(x,{variant:`secondary`,children:fe()}):t.enabled===!1?(0,P.jsx)(x,{variant:`outline`,children:je()}):(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}),t.lastRunStatus?(0,P.jsx)(`span`,{className:`text-muted-foreground`,style:{marginLeft:8,fontSize:`0.8rem`},children:t.lastRunStatus}):null]}),(0,P.jsx)(M,{className:`whitespace-nowrap`,children:t.id===null?(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):i?(0,P.jsx)(v,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):(0,P.jsxs)(`span`,{style:{display:`inline-flex`,gap:2},children:[c?(0,P.jsx)(_,{variant:`ghost`,size:`icon-sm`,title:le(),"aria-label":le(),disabled:V!==null,onClick:()=>void Z(r,async()=>{let n=await ut({instanceName:e.instanceName,jobId:t.id});if(n.ran!==!0&&n.runId===null)throw{data:{code:n.reason??`run_not_started`}}},ee()),children:(0,P.jsx)(Je,{size:14,"aria-hidden":!0})}):null,c&&t.enabled!==null?(0,P.jsx)(_,{variant:`ghost`,size:`icon-sm`,title:t.enabled?a():g(),"aria-label":t.enabled?a():g(),disabled:V!==null,onClick:()=>void Z(r,()=>o({instanceName:e.instanceName,jobId:t.id,patch:{enabled:!t.enabled}}),t.enabled?oe():ie()),children:t.enabled?(0,P.jsx)($e,{size:14,"aria-hidden":!0}):(0,P.jsx)(et,{size:14,"aria-hidden":!0})}):null,c?(0,P.jsx)(_,{variant:`ghost`,size:`icon-sm`,title:m(),"aria-label":m(),disabled:V!==null,onClick:()=>void bt(e.instanceName,t),children:(0,P.jsx)(We,{size:14,"aria-hidden":!0})}):null,c?(0,P.jsx)(_,{variant:`ghost`,size:`icon-sm`,title:h(),"aria-label":h(),disabled:V!==null,onClick:()=>void yt(e.instanceName,t),children:(0,P.jsx)(lt,{size:14,"aria-hidden":!0})}):null,s?(0,P.jsx)(_,{variant:`ghost`,size:`icon-sm`,title:u(),"aria-label":u(),disabled:V!==null,onClick:()=>U({instanceName:e.instanceName,jobId:t.id,name:t.name??t.id}),children:(0,P.jsx)(Ue,{size:14,"aria-hidden":!0})}):null]})})]},t.id??`${e.instanceName}-${n}`)})})]}):(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:Se()})]},e.instanceName)),St>0?(0,P.jsx)(`p`,{className:`oc-admin__hint`,style:{marginTop:4},children:ne()}):null]}),(0,P.jsx)(qe,{open:H!==null,onOpenChange:e=>{e||U(null)},children:(0,P.jsxs)(He,{children:[(0,P.jsxs)(Qe,{children:[(0,P.jsx)(it,{children:Te()}),(0,P.jsx)(Ge,{children:i({name:H?.name??``})})]}),(0,P.jsxs)(Ke,{children:[(0,P.jsx)(Ze,{children:p()}),(0,P.jsx)(Ye,{onClick:()=>{let e=H;U(null),e!==null&&Z(`${e.instanceName}:${e.jobId}`,()=>L({instanceName:e.instanceName,jobId:e.jobId}),re())},children:ae()})]})]})}),(0,P.jsx)(S,{open:W!==null,onOpenChange:e=>{e||(Q.current++,G(null))},children:(0,P.jsxs)(y,{style:{maxWidth:640},children:[(0,P.jsx)(O,{children:(0,P.jsx)(T,{children:he({name:W?.name??``})})}),W?.entries===null?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):W!==null&&W.entries.length===0?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:Le()}):W===null?null:(0,P.jsx)(`div`,{className:`oc-cronpanel__runs`,style:{maxHeight:420,overflowY:`auto`},children:W.entries.map((e,t)=>(0,P.jsxs)(`div`,{className:`oc-cronpanel__run`,children:[(0,P.jsxs)(`div`,{className:`oc-cronpanel__run-head`,children:[e.status===`ok`?(0,P.jsx)(x,{variant:`secondary`,children:s()}):e.status===`error`?(0,P.jsx)(x,{variant:`destructive`,children:ce()}):(0,P.jsx)(x,{variant:`outline`,children:e.status??`—`}),(0,P.jsx)(`span`,{children:typeof(e.runAtMs??e.ts)==`number`?X.format(e.runAtMs??e.ts):`—`}),typeof e.durationMs==`number`?(0,P.jsxs)(`span`,{className:`oc-cronpanel__run-dur`,children:[Math.round(e.durationMs/1e3),`s`]}):null]}),e.summary===null?null:(0,P.jsx)(`div`,{className:`oc-cronpanel__run-summary`,children:e.summary}),e.error===null?null:(0,P.jsx)(`div`,{className:`oc-cronpanel__run-error`,children:e.error})]},t))})]})}),(0,P.jsx)(S,{open:K!==null,onOpenChange:e=>{e||($.current++,q(null))},children:(0,P.jsxs)(y,{children:[(0,P.jsxs)(O,{children:[(0,P.jsx)(T,{children:Ee()}),(0,P.jsx)(Ve,{children:pe()})]}),K===null?null:K.loading?(0,P.jsx)(`p`,{className:`oc-admin__hint`,children:f()}):(0,P.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:12},children:[(0,P.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,P.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:ye()}),(0,P.jsx)(b,{value:K.name,maxLength:200,onChange:e=>q({...K,name:e.target.value,nameDirty:!0})})]}),(0,P.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,P.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:Pe()}),(0,P.jsxs)(E,{value:K.scheduleKind,onValueChange:e=>q({...K,scheduleKind:e,scheduleDirty:!0}),children:[(0,P.jsx)(w,{children:(0,P.jsx)(k,{})}),(0,P.jsxs)(D,{children:[(0,P.jsx)(C,{value:`cron`,children:Ae()}),(0,P.jsx)(C,{value:`every`,children:de()}),(0,P.jsx)(C,{value:`at`,children:Ce()})]})]}),K.scheduleKind===`cron`?(0,P.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,P.jsx)(b,{value:K.cronExpr,onChange:e=>q({...K,cronExpr:e.target.value,scheduleDirty:!0}),placeholder:`30 9 * * *`,style:{fontFamily:`var(--font-mono, monospace)`}}),(0,P.jsx)(b,{value:K.tz,onChange:e=>q({...K,tz:e.target.value,scheduleDirty:!0}),placeholder:`America/Toronto`,style:{maxWidth:180}})]}):K.scheduleKind===`every`?(0,P.jsxs)(`div`,{style:{display:`flex`,gap:8},children:[(0,P.jsx)(b,{type:`number`,min:1,value:K.everyValue,onChange:e=>q({...K,everyValue:e.target.value,scheduleDirty:!0}),style:{maxWidth:120}}),(0,P.jsxs)(E,{value:K.everyUnit,onValueChange:e=>q({...K,everyUnit:e,scheduleDirty:!0}),children:[(0,P.jsx)(w,{style:{maxWidth:160},children:(0,P.jsx)(k,{})}),(0,P.jsxs)(D,{children:[(0,P.jsx)(C,{value:`minutes`,children:Ne()}),(0,P.jsx)(C,{value:`hours`,children:ke()}),(0,P.jsx)(C,{value:`days`,children:Ie()})]})]})]}):(0,P.jsx)(b,{type:`datetime-local`,value:K.at,onChange:e=>q({...K,at:e.target.value,scheduleDirty:!0})})]}),K.hasMessage?(0,P.jsxs)(`label`,{style:{display:`flex`,flexDirection:`column`,gap:4},children:[(0,P.jsx)(`span`,{className:`oc-admin__hint`,style:{margin:0},children:te()}),(0,P.jsx)(`textarea`,{className:`oc-cronedit__textarea`,rows:4,value:K.message,onChange:e=>q({...K,message:e.target.value,messageDirty:!0})})]}):null]}),(0,P.jsxs)(tt,{children:[(0,P.jsx)(_,{variant:`ghost`,onClick:()=>q(null),children:p()}),(0,P.jsxs)(_,{onClick:()=>void xt(),disabled:K===null||K.loading||gt,children:[gt?(0,P.jsx)(v,{size:14,className:`oc-actrow__spin`,"aria-hidden":!0}):null,_e()]})]})]})})]})}export{L as ScheduledTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$k as r,AA as i,Ak as a,Bk as ee,CA as te,Ck as o,DA as s,Dk as c,EA as ne,Ek as l,FF as re,Fk as u,Gk as ie,Hk as ae,Ik as d,Jk as oe,Kk as se,LF as f,Lk as ce,MA as le,Mk as p,NA as ue,Nk as m,OA as h,Ok as g,Pk as de,Qk as fe,RF as _,Rk as pe,SA as me,Sk as he,T as v,TA as ge,Tk as _e,Uk as ve,Vk as ye,Wk as be,Xk as xe,Yk as Se,Zk as Ce,_A as we,_k as y,aA as Te,bA as Ee,bk as b,cA as De,dA as Oe,eA as ke,fA as Ae,gA as je,gk as x,hA as Me,hk as S,iA as Ne,jA as Pe,jk as C,kA as Fe,kk as w,lA as Ie,mA as Le,mk as T,nA as Re,oA as ze,pA as Be,pk as E,qk as Ve,rA as He,sA as Ue,tA as We,uA as Ge,vA as Ke,vk as D,wA as qe,wk as O,xA as Je,xk as k,yA as Ye,yk as A,zk as Xe}from"./dist-Bkkp8jtC.js";import{n as j}from"./dist-Bk4bPGS8.js";import{i as Ze}from"./dist-CqLvr3pk.js";import{t as M}from"./button-Ew8nYfum.js";import{$ as N,A as Qe,B as P,Q as F,V as I,X as L,Y as R,Z as z,Zt as B,ct as V,d as $e,en as et,et as tt,in as nt,lt as H,nt as rt,ot as U,rn as it,st as W,tt as G,ut as K,wt as at}from"./index-gP_wjUtq.js";import{t as ot}from"./FilterBar-BaqVZ-JQ.js";import{t as st}from"./DataTableShell-DMFVXfOQ.js";import{t as ct}from"./roleDescriptions-CSbRqH5d.js";var q=t(e(),1),J=n(),lt=[{value:`never`,label:()=>A(),days:null},{value:`30`,label:()=>D(),days:30},{value:`90`,label:()=>y(),days:90}],Y=720*60*60*1e3,X=`__all__`,Z={name:``,roleKey:``,description:``};function Q(){let e=nt({from:`/settings/serviceAccounts`}),t=it({from:`/settings/serviceAccounts`}),n=e.q??``,a=e.status??X,[o,c]=(0,q.useState)(X),l=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),u=e=>void t({search:t=>({...t,status:e===X?void 0:e})}),d=_(v.apiKeys.listServiceAccounts,{filter:{q:n||void 0,role:o===X?void 0:o,disabled:a===X?void 0:a===`disabled`}}),p=_(v.apiKeys.listKeys,{}),m=_(v.apiKeys.listRoles,{}),g=f(v.apiKeys.createServiceAccount),de=f(v.apiKeys.updateServiceAccount),he=f(v.apiKeys.deleteServiceAccount),_e=re(v.apiKeys.mintApiKey),y=f(v.apiKeys.revokeApiKey),b=Qe(),x=at(),S=n!==``||o!==X||a!==X;function C(){c(X),t({search:{},replace:!0})}let[w,T]=(0,q.useState)(!1),[E,D]=(0,q.useState)(Z),[O,k]=(0,q.useState)(null),[A,j]=(0,q.useState)(new Set),[N,P]=(0,q.useState)(null),F=(0,q.useRef)(!1),[I,z]=(0,q.useState)(new Set),[B,tt]=(0,q.useState)({}),[rt,G]=(0,q.useState)(null),Y=(0,q.useMemo)(()=>{let e=new Map;for(let t of p??[]){let n=e.get(t.serviceAccountId)??[];n.push(t),e.set(t.serviceAccountId,n)}return e},[p]);function Q(e){j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}async function ft(){try{O?(await de({serviceAccountId:O,name:E.name,roleKey:E.roleKey,description:E.description}),x.success(Ce())):await g({name:E.name,roleKey:E.roleKey,description:E.description||void 0}),D(Z),k(null),T(!1)}catch(e){x.error(O?fe():r(),e)}}function pt(e){D({name:e.name,roleKey:e.roleKey,description:e.description??``}),k(e._id),T(!0)}async function mt(e){if(F.current)return;F.current=!0;let t=B[e._id]??`never`,n=lt.find(e=>e.value===t)?.days??null,r=n?Date.now()+n*24*60*60*1e3:void 0;P(e._id);try{let t=await _e({serviceAccountId:e._id,expiresAt:r});G({accountName:e.name,plaintext:t.plaintext,prefix:t.prefix,lastFour:t.lastFour})}catch(e){x.error(xe(),e)}finally{F.current=!1,P(null)}}async function $(e){if(await b({title:Se(),description:(0,J.jsxs)(J.Fragment,{children:[oe(),` `,(0,J.jsx)(`span`,{className:`font-mono`,children:e.name}),` `,Ve(),` `,(0,J.jsx)(`strong`,{children:se()}),` `,ie()]}),confirmWord:e.name,confirmLabel:be(),destructive:!0}))try{await he({serviceAccountId:e._id}),x.success(ve(),e.name)}catch(e){x.error(ae(),e)}}async function ht(e){if(await b({title:ye(),description:(0,J.jsxs)(J.Fragment,{children:[ee(),` `,(0,J.jsxs)(`span`,{className:`font-mono`,children:[e.prefix,`…`,e.lastFour]}),` `,Xe()]}),confirmLabel:pe(),destructive:!0})&&!I.has(e._id)){z(t=>new Set(t).add(e._id));try{await y({keyId:e._id})}catch(e){x.error(ce(),e)}finally{z(t=>{let n=new Set(t);return n.delete(e._id),n})}}}return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:ue()}),(0,J.jsxs)(ot,{q:n,onQChange:l,searchPlaceholder:le(),onReset:C,canReset:S,children:[(0,J.jsxs)(U,{value:o,onValueChange:c,children:[(0,J.jsx)(H,{size:`sm`,className:`w-40`,children:(0,J.jsx)(K,{placeholder:Pe()})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(V,{value:X,children:i()}),(m??[]).map(e=>(0,J.jsx)(V,{value:e.key,children:e.key},e._id))]})]}),(0,J.jsxs)(U,{value:a,onValueChange:u,children:[(0,J.jsx)(H,{size:`sm`,className:`w-36`,children:(0,J.jsx)(K,{})}),(0,J.jsxs)(W,{children:[(0,J.jsx)(V,{value:X,children:Fe()}),(0,J.jsx)(V,{value:`active`,children:h()}),(0,J.jsx)(V,{value:`disabled`,children:s()})]})]})]}),(0,J.jsx)(st,{title:ne(),rows:d,addLabel:ge(),onAdd:()=>{D(Z),k(null),T(!0)},emptyHint:qe(),isExpanded:e=>A.has(e._id),renderExpanded:e=>(0,J.jsx)(ut,{account:e,keys:Y.get(e._id)??[],onRevoke:ht,revoking:I}),rowActions:e=>[{label:Ee(),onSelect:()=>pt(e)},{label:te(),onSelect:()=>void mt(e)},{label:A.has(e._id)?me():Je(),onSelect:()=>Q(e._id)},{label:Ye(),variant:`destructive`,onSelect:()=>void $(e)}],columns:[{header:``,className:`w-8`,cell:e=>(0,J.jsx)(M,{variant:`ghost`,size:`icon-sm`,"aria-label":A.has(e._id)?Ke():we(),onClick:()=>Q(e._id),children:A.has(e._id)?(0,J.jsx)(Ze,{}):(0,J.jsx)(et,{})})},{header:je(),sort:e=>e.name,cell:e=>(0,J.jsxs)(`div`,{className:`flex flex-col`,children:[(0,J.jsx)(`span`,{children:e.name}),e.description?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:e.description}):null]})},{header:Me(),sort:e=>e.roleKey,cell:e=>(0,J.jsx)(R,{variant:`secondary`,children:e.roleKey})},{header:Le(),sort:e=>+!!e.disabled,cell:e=>e.disabled?(0,J.jsx)(R,{variant:`destructive`,children:s()}):(0,J.jsx)(R,{variant:`outline`,children:h()})},{header:Be(),cell:e=>(0,J.jsxs)(U,{value:B[e._id]??`never`,onValueChange:t=>tt(n=>({...n,[e._id]:t})),children:[(0,J.jsx)(H,{size:`sm`,className:`w-32`,children:(0,J.jsx)(K,{})}),(0,J.jsx)(W,{children:lt.map(e=>(0,J.jsx)(V,{value:e.value,children:e.label()},e.value))})]})},{header:Ae(),sort:e=>(Y.get(e._id)??[]).filter(e=>!e.disabled).length,cell:e=>{let t=(Y.get(e._id)??[]).filter(e=>!e.disabled).length;return(0,J.jsx)(`span`,{className:`oc-sa__keycount`,children:N===e._id?Oe():Ge({count:t})})}}]}),(0,J.jsx)($e,{open:w,onOpenChange:e=>{T(e),e||k(null)},title:O?Ie():ze(),description:O?De():Te(),canSubmit:!!(E.name&&E.roleKey),onSubmit:ft,submitLabel:O?Ue():Ne(),children:(0,J.jsxs)(`div`,{className:`oc-form`,children:[(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:He()}),(0,J.jsx)(L,{value:E.name,onChange:e=>D({...E,name:e.target.value})})]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:Re()}),(0,J.jsxs)(U,{value:E.roleKey||void 0,onValueChange:e=>D({...E,roleKey:e}),children:[(0,J.jsx)(H,{className:`w-full`,children:(0,J.jsx)(K,{placeholder:We()})}),(0,J.jsx)(W,{children:(m??[]).map(e=>(0,J.jsxs)(V,{value:e.key,children:[e.name,` (`,e.key,`)`]},e._id))})]}),(()=>{let e=(m??[]).find(e=>e.key===E.roleKey),t=e?ct(e):null;return t?(0,J.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:t}):null})()]}),(0,J.jsxs)(`label`,{className:`oc-field`,children:[(0,J.jsx)(`span`,{className:`oc-field__label`,children:ke()}),(0,J.jsx)(L,{value:E.description,onChange:e=>D({...E,description:e.target.value})})]})]})}),(0,J.jsx)(dt,{minted:rt,onClose:()=>G(null)})]})}function ut({account:e,keys:t,onRevoke:n,revoking:r}){return(0,J.jsxs)(`div`,{className:`oc-sa__keys`,children:[(0,J.jsxs)(`div`,{className:`oc-sa__keys-head`,children:[d(),` `,(0,J.jsx)(`span`,{className:`font-medium`,children:e.name})]}),t.length===0?(0,J.jsx)(`p`,{className:`oc-admin__hint`,children:u()}):(0,J.jsxs)(`table`,{className:`oc-sa__keytable`,children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`th`,{children:de()}),(0,J.jsx)(`th`,{children:m()}),(0,J.jsx)(`th`,{children:p()}),(0,J.jsx)(`th`,{children:C()}),(0,J.jsx)(`th`,{children:a()}),(0,J.jsx)(`th`,{children:w()}),(0,J.jsx)(`th`,{})]})}),(0,J.jsx)(`tbody`,{children:t.map(t=>(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(`td`,{children:(0,J.jsxs)(`code`,{className:`oc-sa__keyid`,children:[t.prefix,`…`,t.lastFour]})}),(0,J.jsx)(`td`,{children:(0,J.jsx)(R,{variant:`secondary`,children:e.roleKey})}),(0,J.jsx)(`td`,{children:I(t.createdAt)}),(0,J.jsx)(`td`,{className:ft(t.lastUsedAt)?`oc-sa__stale`:``,children:pt(t.lastUsedAt)}),(0,J.jsx)(`td`,{children:mt(t.expiresAt)}),(0,J.jsx)(`td`,{children:$(t)}),(0,J.jsx)(`td`,{className:`text-right`,children:t.disabled?null:(0,J.jsx)(M,{variant:`destructive`,size:`sm`,disabled:r.has(t._id),onClick:()=>n(t),children:r.has(t._id)?g():c()})})]},t._id))})]})]})}function dt({minted:e,onClose:t}){let[n,r]=(0,q.useState)(!1);async function i(){if(e)try{await navigator.clipboard.writeText(e.plaintext),r(!0),window.setTimeout(()=>r(!1),2e3)}catch{}}return(0,J.jsx)(z,{open:e!==null,onOpenChange:e=>{e||(r(!1),t())},children:e?(0,J.jsxs)(F,{className:`max-w-lg`,showCloseButton:!1,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.preventDefault(),children:[(0,J.jsxs)(G,{children:[(0,J.jsx)(rt,{children:l()}),(0,J.jsx)(N,{children:_e({name:e.accountName})})]}),(0,J.jsx)(`div`,{className:`oc-sa__minted-warning`,children:O()}),(0,J.jsxs)(`div`,{className:`oc-sa__minted-box`,children:[(0,J.jsx)(`code`,{className:`oc-sa__minted-plain`,children:e.plaintext}),(0,J.jsxs)(M,{variant:`outline`,size:`sm`,onClick:()=>void i(),"aria-label":o(),children:[n?(0,J.jsx)(j,{}):(0,J.jsx)(B,{}),n?he():k()]})]}),(0,J.jsx)(tt,{children:(0,J.jsx)(M,{onClick:()=>{r(!1),t()},children:b()})})]}):null})}function ft(e){return e===null?!1:Date.now()-e>Y}function pt(e){return e===null?x():I(e)}function mt(e){return e===null?`—`:P(e)}function $(e){return e.disabled?(0,J.jsx)(R,{variant:`destructive`,children:S()}):e.expiresAt!==null&&e.expiresAt<Date.now()?(0,J.jsx)(R,{variant:`outline`,children:T()}):(0,J.jsx)(R,{variant:`outline`,children:E()})}export{Q as ServiceAccountsTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$o as r,Bo as i,Cs as a,Go as o,Ho as s,Jo as c,Ko as l,LF as u,Qo as d,RF as f,Ss as p,T as m,Uo as h,Vo as g,Wo as _,Xo as v,Yo as y,Zo as b,_s as x,as as S,bs as C,cs as w,ds as T,es as E,fs as D,gs as O,hs as k,is as A,ls as j,ms as M,ns as N,os as P,ps as F,qo as I,rs as L,ss as R,ts as ee,us as z,vs as B,xs as V,ys as H,zo as U}from"./dist-Bkkp8jtC.js";import{t as W}from"./button-Ew8nYfum.js";import{A as G,V as K}from"./index-gP_wjUtq.js";import{t as q}from"./DataTableShell-DMFVXfOQ.js";var J=t(e(),1),Y=n(),X={hung:()=>P(),wrong_result:()=>S(),error:()=>A(),other:()=>L()},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=u(m.subAgentReports.respondToReport),[i,a]=(0,J.useState)(e.thread),[f,p]=(0,J.useState)(``),[g,x]=(0,J.useState)(!1);async function S(){let t=f.trim();if(!(!t||g)){x(!0);try{await n({reportId:e._id,text:t}),a(e=>[...e,{authorRole:`admin`,text:t,at:Date.now()}]),p(``)}finally{x(!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),` · `,N({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:ee()}),(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:E()}),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`?r():d()}),(0,Y.jsx)(`span`,{className:`oc-notif__msg-text`,children:e.text})]},t))}):(0,Y.jsx)(`p`,{className:`oc-fbadmin__meta`,children:b()}),(0,Y.jsx)(`textarea`,{className:`oc-feedback__textarea`,placeholder:v(),value:f,maxLength:2e3,rows:3,onChange:e=>p(e.target.value.slice(0,2e3))}),(0,Y.jsx)(`div`,{className:`oc-fbadmin__row`,style:{justifyContent:`flex-end`},children:(0,Y.jsx)(W,{size:`sm`,onClick:()=>void S(),disabled:!f.trim()||g,children:g?c():y()})})]}),(0,Y.jsxs)(`section`,{children:[(0,Y.jsxs)(`h4`,{className:`oc-fbadmin__h`,children:[I({count:t.children.length}),t.childrenTruncated?` ${l()}`:``,t.textTruncated?` ${o()}`:``]}),(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?` · ${_()}`:``]}),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:h()}),(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:s()}),(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=f(m.subAgentReports.listForAdmin,{}),t=u(m.subAgentReports.readReport),n=u(m.subAgentReports.deleteReport),r=G(),[o,s]=(0,J.useState)(null),[c,l]=(0,J.useState)({});async function d(e){if(o===e._id){s(null);return}if(!c[e._id]){let n=await t({reportId:e._id});l(t=>({...t,[e._id]:n}))}s(e._id)}async function h(e){await r({title:g(),description:i(),confirmLabel:U(),destructive:!0})&&(await n({reportId:e._id}),o===e._id&&s(null))}return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[V(),` `,(0,Y.jsx)(`strong`,{children:C()}),` `,H()]}),(0,Y.jsx)(q,{title:a(),rows:e,emptyHint:p(),isExpanded:e=>o===e._id&&!!c[e._id],renderExpanded:e=>c[e._id]?(0,Y.jsx)($,{data:c[e._id]}):null,columns:[{header:B(),cell:e=>K(e.at),sort:e=>e.at},{header:x(),cell:e=>Z(e.category),sort:e=>Z(e.category)},{header:O(),cell:e=>`${e.failedCount}/${e.totalCount}`,sort:e=>e.failedCount},{header:k(),cell:e=>(e.reporterEmail||e.reporterName||`—`)+(e.impersonated&&e.realOperatorEmail?` ${D({operator:e.realOperatorEmail})}`:``),sort:e=>e.reporterEmail||e.reporterName||null},{header:M(),cell:e=>e.hasComment?`✎`:`—`,sort:e=>+!!e.hasComment},{header:F(),cell:e=>e.answered?(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill is-ok`,children:T()}):(0,Y.jsx)(`span`,{className:`oc-fbadmin__pill`,children:z()}),sort:e=>+!!e.answered}],rowActions:e=>[{label:o===e._id?w():j(),onSelect:()=>void d(e)},{label:R(),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{$j as r,AM as i,Aj as a,BM as o,Bj as s,CM as c,Cj as l,D as u,DF as d,DM as f,Dj as p,E as m,EF as h,EM as g,Ej as ee,FF as _,FM as v,Fj as te,Fo as ne,Gj as re,HM as ie,Hj as ae,IM as oe,Ij as se,Io as ce,Jj as le,Kj as ue,LF as y,LM as de,Lj as fe,Lo as b,MM as x,Mj as pe,NM as me,Nj as he,OM as ge,Oj as S,PM as _e,Pj as ve,Qj as ye,RF as C,RM as be,Rj as xe,Ro as w,SM as Se,Sj as Ce,T,TF as we,TM as Te,Tj as Ee,Uj as De,VM as Oe,Vj as ke,Wj as Ae,Xj as je,Yj as Me,Zj as Ne,_M as Pe,aM as E,bM as Fe,bj as Ie,cM as Le,dM as Re,eM as ze,fM as Be,gM as Ve,hM as He,iM as Ue,jM as We,jj as Ge,kM as Ke,kj as qe,lM as Je,mM as Ye,nM as Xe,oM as Ze,pM as Qe,qj as $e,rM as et,sM as tt,tM as nt,uM as rt,vM as it,wM as at,wj as ot,xM as st,xj as ct,yM as lt,zM as ut,zj as dt}from"./dist-Bkkp8jtC.js";import{n as D}from"./dist-Bk4bPGS8.js";import{t as O}from"./x-BqwVyymF.js";import{t as k}from"./button-Ew8nYfum.js";import{G as A,J as ft,K as pt,U as mt,W as ht,X as j,Xt as gt,Y as M,Yt as N,ct as P,dt as _t,ft as vt,gt as F,lt as I,m as L,ot as R,q as z,st as B,ut as V}from"./index-gP_wjUtq.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-DsVS4SLV.js";import{a as Et,i as H,n as Dt,o as U,r as W,t as Ot}from"./table-C4Hh9u_l.js";import{t as kt}from"./TimeRangePicker-Bv-U6Bo1.js";import{t as At}from"./FilterBar-BaqVZ-JQ.js";import{t as jt}from"./AdvancedFilter-D6zd0L5Q.js";var G=u(`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(De());if(e.size>zt)throw Error(ae());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),c=Math.max(1,Math.round(r*o)),l=Math.max(1,Math.round(i*o)),u=document.createElement(`canvas`);u.width=c,u.height=l;let d=u.getContext(`2d`);if(!d)throw Error(s());d.imageSmoothingEnabled=!0,d.imageSmoothingQuality=`high`,d.drawImage(n,0,0,c,l);let f=Ft(d.getImageData(0,0,c,l).data,c,l)??{x:0,y:0,width:c,height:l},p=document.createElement(`canvas`);p.width=f.width,p.height=f.height;let m=p.getContext(`2d`);if(!m)throw Error(s());if(m.drawImage(u,f.x,f.y,f.width,f.height,0,0,f.width,f.height),t.variantFor){let e=m.getImageData(0,0,f.width,f.height);q(e.data,f.width,f.height)?Lt(e.data,t.variantFor===`dark`?Nt:Pt):Rt(e.data),m.putImageData(e,0,0)}let h=q(m.getImageData(0,0,f.width,f.height).data,f.width,f.height),g=await Y(p,`image/webp`,Ht)??await Y(p,`image/png`);if(!g)throw Error(dt());return{blob:g,hasAlpha:h}}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(ke())),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`?d():e===`dark`?h():we()}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:m(`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":w(),title:w(),children:(0,X.jsx)(gt,{className:`size-4`})}):null]})}function Zt({selectedKey:e,resolvedMode:t}){let n=C(T.charts.listMyCharts),r=y(T.charts.setMyChart);async function a(e){try{await r({name:e})}catch{}}return(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h2`,{className:`oc-show__title`,children:_e()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:me()})]}),(0,X.jsxs)(`div`,{className:`oc-chart-grid`,children:[(0,X.jsx)(Xt,{selected:e===null,title:x(),subtitle:We(),tokens:null,mode:t,onSelect:()=>void a(null)}),(n??[]).map(n=>{let r=n.via===`common`?i():n.via===`owner`?Ke():ge({group:n.via.group});return(0,X.jsx)(Xt,{selected:e===n.key,title:n.name,subtitle:r,tokens:n.tokens,mode:t,onSelect:()=>void a(n.key),onExport:()=>Gt(n.name,n.tokens)},n.key)})]}),n!==void 0&&n.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:f()}):null]})}function Qt(){let e=y(T.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(et());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:Qe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Be()})]}),(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:Re()}),(0,X.jsx)(j,{value:t,onChange:e=>n(e.target.value),placeholder:rt(),maxLength:60})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:Je()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:r,onChange:e=>i(e.target.value),placeholder:Le(),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`}),tt(),(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:Ze()})]}),a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null,s?(0,X.jsx)(`p`,{className:`oc-chart-import__ok`,children:Ue()}):null]})]})}function $t({chart:e}){let t=_(T.charts.setChartLogo),n=y(T.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`?je():Me()}),(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?$e():le(),(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:re()}):null,t?(0,X.jsx)(k,{variant:`ghost`,size:`sm`,disabled:r,onClick:()=>void u(e),children:ue()}):null]})}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__logo`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Ne()}),(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:Ae()}):null,a?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:a}):null]})}function en({chart:e}){let t=C(T.me.getMe,{host:F}),n=y(T.charts.addChartDomain),r=y(T.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:xe()}),(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:ve()}):u.map(e=>(0,X.jsxs)(M,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":he({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)(j,{value:i,onChange:e=>a(e.target.value),placeholder:se(),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:te()})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:fe()}),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=y(T.charts.updateChart),n=y(T.charts.deleteChart),[i,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(e.name),[l,u]=(0,K.useState)(()=>tn(e.tokens)),[d,f]=(0,K.useState)(e.tokens.bpm??0),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(!1);function ee(){c(e.name),u(tn(e.tokens)),f(e.tokens.bpm??0),m(null),o(!0)}async function _(){if(e.chartId===void 0)return;m(null);let n;try{n=JSON.parse(l)}catch{m(E());return}if(n&&typeof n==`object`&&!Array.isArray(n)){let e=n;d>0?e.bpm=d:delete e.bpm}g(!0);try{await t({chartId:e.chartId,name:s.trim(),tokens:n}),o(!1)}catch(e){m(e instanceof Error?e.message:String(e))}finally{g(!1)}}async function v(){if(e.chartId!==void 0&&window.confirm(S()))try{await n({chartId:e.chartId})}catch{}}return(0,X.jsxs)(`div`,{className:`oc-chart-mine__row`,children:[(0,X.jsxs)(`div`,{className:`oc-chart-mine__head`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__name`,children:e.name}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:i?null:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(k,{variant:`outline`,size:`sm`,onClick:ee,children:r()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void v(),children:ye()})]})})]}),i?(0,X.jsxs)(`div`,{className:`oc-chart-mine__editor`,children:[(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:a()}),(0,X.jsx)(j,{value:s,onChange:e=>c(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:b()}),(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:d,onChange:e=>f(Number(e.target.value)),"aria-label":b()}),(0,X.jsx)(`span`,{className:`oc-chart-bpm__value`,children:d===0?ce():`${d} BPM`})]}),(0,X.jsx)(`span`,{className:`oc-show__desc`,children:ne()})]}),(0,X.jsxs)(`label`,{className:`oc-chart-import__field`,children:[(0,X.jsx)(`span`,{className:`oc-chart-import__label`,children:qe()}),(0,X.jsx)(`textarea`,{className:`oc-chart-import__textarea`,value:l,onChange:e=>u(e.target.value),rows:10,spellCheck:!1})]}),p?(0,X.jsx)(`p`,{className:`oc-chart-import__error`,children:p}):null,(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{size:`sm`,disabled:h,onClick:()=>void _(),children:pe()}),(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>o(!1),children:Ge()})]})]}):null,(0,X.jsx)($t,{chart:e}),(0,X.jsx)(en,{chart:e})]})}function rn(){let e=C(T.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:Xe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:nt()})]}),e!==void 0&&t.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ze()}):(0,X.jsx)(`div`,{className:`oc-chart-mine-list`,children:t.map(e=>(0,X.jsx)(nn,{chart:e},e.key))})]})}function an({chart:e,groups:t}){let n=y(T.charts.addChartToGroupPool),r=y(T.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)(M,{variant:i?`secondary`:`outline`,className:`oc-chart-avail__state`,children:i?lt():e.kind===`custom`&&e.scope===`personal`?ot():Fe()}),e.isGlobalDefault?(0,X.jsx)(M,{variant:`default`,children:it()}):null]}),(0,X.jsxs)(`div`,{className:`oc-chart-avail__groups`,children:[(0,X.jsx)(`span`,{className:`oc-chart-mine__groups-label`,children:Ve()}),(a??[]).map(e=>(0,X.jsxs)(M,{variant:`secondary`,className:`oc-chart-avail__chip`,children:[e.name,(0,X.jsx)(`button`,{type:`button`,className:`oc-chart-avail__chip-x`,"aria-label":Ye({group:e.name}),onClick:()=>void l(e.groupId),children:(0,X.jsx)(O,{className:`size-3`})})]},e.groupId)),s.length>0?(0,X.jsxs)(R,{value:``,onValueChange:e=>void c(e),children:[(0,X.jsx)(I,{size:`sm`,className:`w-56`,children:(0,X.jsx)(V,{placeholder:He()})}),(0,X.jsx)(B,{children:s.map(e=>(0,X.jsx)(P,{value:e._id,children:e.name},e._id))})]}):t.length===0?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Pe()}):null]})]})}function on({chart:e}){let t=y(T.charts.promoteChartToCommon),n=y(T.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(S()))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)(M,{variant:e.scope===`common`?`outline`:`secondary`,children:e.scope===`common`?l():ot()}),e.ownerLabel?(0,X.jsx)(`span`,{className:`oc-show__desc`,children:Ee({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:Ce()}):null,(0,X.jsx)(k,{variant:`ghost`,size:`sm`,onClick:()=>void i(),children:ct()})]})]})}function sn({defaultThemeMode:e,defaultLocale:t,defaultChartKey:n}){let r=y(T.admin.setDefaultThemeMode),i=y(T.admin.setDefaultLocale),a=y(T.charts.setDefaultChart),s=C(T.charts.listChartsAdmin),l=C(T.groups.listGroups,{}),u=e??`system`,d=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:oe()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:v()})]}),(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:g()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Te()})]}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(k,{variant:n===null?`default`:`outline`,size:`sm`,onClick:()=>void a({name:null}),children:x()}),vt.map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key)),(s??[]).filter(e=>e.kind===`custom`&&e.scope===`common`).map(e=>(0,X.jsx)(k,{variant:n===e.key?`default`:`outline`,size:`sm`,onClick:()=>void a({name:e.key}),children:e.name},e.key))]})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:at()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:c()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>!(e.kind===`custom`&&e.scope===`common`)).map(e=>(0,X.jsx)(an,{chart:e,groups: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:Se()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:st()})]}),(0,X.jsx)(`div`,{className:`oc-chart-avail-list`,children:(s??[]).filter(e=>e.kind===`builtin`||e.scope===`common`).map(e=>(0,X.jsxs)(`div`,{className:`oc-chart-avail`,children:[(0,X.jsx)(`div`,{className:`oc-chart-avail__head`,children:(0,X.jsx)(`span`,{className:`oc-chart-avail__name`,children:e.name})}),(0,X.jsx)(en,{chart:e})]},e.key))})]}),(0,X.jsxs)(`section`,{className:`oc-show__section`,children:[(0,X.jsxs)(`div`,{className:`oc-show__heading`,children:[(0,X.jsx)(`h3`,{className:`oc-show__title`,children:p()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ee()})]}),(()=>{let e=(s??[]).filter(e=>e.kind===`custom`);return e.length===0?(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Ie()}):(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:ie()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:Oe()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:[`light`,`dark`,`system`].map(e=>(0,X.jsx)(k,{variant:u===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:o()}),(0,X.jsx)(`p`,{className:`oc-show__desc`,children:ut()})]}),(0,X.jsx)(`div`,{className:`oc-show__row`,children:yt().map(e=>(0,X.jsx)(k,{variant:d===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:be()})]})]})}function cn(){let e=C(T.me.getMe,{host:F}),t=_t(e?.resolvedThemeMode);return(0,X.jsxs)(`div`,{className:`oc-appearance`,children:[(0,X.jsx)(Zt,{selectedKey:e?.chartKey??null,resolvedMode:t}),(0,X.jsx)(Qt,{}),(0,X.jsx)(rn,{}),e?.role===`admin`?(0,X.jsx)(sn,{defaultThemeMode:e.defaultThemeMode,defaultLocale:e.defaultLocale,defaultChartKey:e.defaultChartKey}):null]})}function ln(){let[e,t]=(0,K.useState)(!0),[n,r]=(0,K.useState)(`per-user`),[i,a]=(0,K.useState)(``),[o,s]=(0,K.useState)(Z),[c,l]=(0,K.useState)(Z),[u,d]=(0,K.useState)(Q),f=i!==``||o!==Z||c!==Z;function p(){a(``),s(Z),l(Z),d(Q)}return(0,X.jsxs)(`div`,{className:`oc-show`,children:[(0,X.jsx)(cn,{}),(0,X.jsxs)(`details`,{className:`oc-show__ref`,children:[(0,X.jsx)(`summary`,{className:`oc-show__title`,children:de()}),(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)(M,{children:`Default`}),(0,X.jsx)(M,{variant:`secondary`,children:`Secondary`}),(0,X.jsx)(M,{variant:`outline`,children:`Outline`}),(0,X.jsx)(M,{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)(j,{placeholder:`Text input…`}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsxs)(R,{value:n,onValueChange:r,children:[(0,X.jsx)(I,{className:`w-56`,children:(0,X.jsx)(V,{placeholder:`Select…`})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(P,{value:`per-user`,children:`per-user (chacun son agent)`}),(0,X.jsx)(P,{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)(R,{value:o,onValueChange:s,children:[(0,X.jsx)(I,{size:`sm`,children:(0,X.jsx)(V,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(P,{value:Z,children:`Toutes directions`}),(0,X.jsx)(P,{value:`inbound`,children:`inbound`}),(0,X.jsx)(P,{value:`outbound`,children:`outbound`}),(0,X.jsx)(P,{value:`internal`,children:`internal`})]})]}),(0,X.jsxs)(R,{value:c,onValueChange:l,children:[(0,X.jsx)(I,{size:`sm`,children:(0,X.jsx)(V,{})}),(0,X.jsxs)(B,{children:[(0,X.jsx)(P,{value:Z,children:`Toutes sévérités`}),(0,X.jsx)(P,{value:`info`,children:`info`}),(0,X.jsx)(P,{value:`warn`,children:`warn`}),(0,X.jsx)(P,{value:`critical`,children:`critical`})]})]})]}),(0,X.jsx)(jt,{fields:Kt,onChange:()=>{}}),(0,X.jsxs)(`div`,{className:`oc-show__row`,children:[(0,X.jsx)(`span`,{className:`oc-show__desc`,children:`Sélecteur de plage seul :`}),(0,X.jsx)(kt,{value:u,onChange:d})]})]})}),(0,X.jsx)($,{title:`Dropdown menu`,description:`Row actions / kebab`,children:(0,X.jsxs)(mt,{children:[(0,X.jsx)(ft,{asChild:!0,children:(0,X.jsx)(k,{variant:`outline`,size:`icon`,"aria-label":`Open menu`,children:(0,X.jsx)(N,{})})}),(0,X.jsxs)(ht,{align:`start`,children:[(0,X.jsx)(pt,{children:`Actions`}),(0,X.jsx)(z,{}),(0,X.jsx)(A,{children:`Edit`}),(0,X.jsx)(A,{children:`Duplicate`}),(0,X.jsx)(z,{}),(0,X.jsx)(A,{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)(M,{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};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{AE as r,Ay as i,BE as a,CE as o,Cy as s,D as c,Dy as l,Ey as u,FE as d,Fy as f,GE as p,HE as m,IE as h,Iy as g,JE as _,KE as v,LE as ee,LF as y,Ly as te,ME as b,Mr as x,My as S,NE as C,Nr as w,Ny as ne,OE as T,Oy as re,PE as E,Pr as ie,Py as ae,QE as oe,RE as se,RF as D,Ry as ce,SE as le,Sy as ue,T as O,Ty as de,UE as k,VE as fe,WE as pe,XE as A,YE as j,ZE as M,_E as me,_y as he,ay as ge,bE as _e,by as ve,cy as ye,dE as be,dy as xe,ey as N,fE as P,fy as Se,gE as F,gy as Ce,hE as we,hy as Te,iy as Ee,jE as De,jy as Oe,kE as I,ky as ke,lE as Ae,ly as je,mE as Me,my as Ne,ny as Pe,oy as Fe,pE as Ie,py as Le,qE as Re,ry as ze,sy as Be,ty as Ve,uE as He,uy as Ue,vE as We,vy as Ge,wy as Ke,xE as qe,xy as Je,yE as Ye,yy as Xe,zE as L}from"./dist-Bkkp8jtC.js";import{n as Ze}from"./dist-Bk4bPGS8.js";import{t as Qe}from"./x-BqwVyymF.js";import{i as R,n as z,r as $e,t as et}from"./tabs-0D2gasCk.js";import{t as B}from"./button-Ew8nYfum.js";import{$ as tt,D as nt,H as rt,Jt as it,Q as at,V,Y as H,Z as ot,Zt as st,a as ct,ct as U,gt as lt,i as ut,in as dt,lt as W,nt as ft,o as pt,ot as G,qt as mt,rn as ht,s as gt,st as K,tt as _t,ut as q}from"./index-gP_wjUtq.js";import{n as vt}from"./TimeRangePicker-Bv-U6Bo1.js";import{t as yt}from"./FilterBar-BaqVZ-JQ.js";import{t as bt}from"./AdvancedFilter-D6zd0L5Q.js";import{t as xt}from"./DataTableShell-DMFVXfOQ.js";var St=c(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=c(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),J=t(e(),1),Y=n(),X={kind:`relative`,from:`now-520w`,to:`now`},Z=e=>e===null?`-`:String(Math.round(e));function wt(e){let t=e.indexOf(`:`);if(t<0)return e;let n=e.slice(0,t),r=e.slice(t+1);return n===`admin`?C():n===`agent`?`${b()} - ${r}`:e}function Tt(){let e=D(O.me.getMe,{host:lt})?.role===`admin`,t=D(O.deliveryTiming.getDeliveryStatus,{}),n=y(O.deliveryTiming.startDeliveryRecord),r=y(O.deliveryTiming.stopDeliveryRecord),[i,a]=(0,J.useState)(!1),[o,s]=(0,J.useState)(!1),c=t?.recording??!1,l=async()=>{s(!0);try{c?await r({}):await n({})}finally{s(!1)}};return(0,Y.jsxs)(`section`,{className:`mb-4 flex flex-col gap-3 rounded-lg border border-border p-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h3`,{className:`text-sm font-semibold`,children:oe()}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:M()})]}),e?(0,Y.jsx)(B,{variant:c?`destructive`:`default`,size:`sm`,disabled:o||t===void 0,onClick:()=>void l(),children:c?j():A()}):null]}),c?(0,Y.jsxs)(`p`,{className:`flex items-center gap-2 text-sm`,children:[(0,Y.jsx)(H,{variant:`secondary`,children:_()}),t?.startedAt?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:Re({time:rt(t.startedAt)})}):null]}):null,(0,Y.jsx)(`div`,{children:(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>a(e=>!e),children:i?pe():p()})}),i?(0,Y.jsx)(Et,{isAdmin:e}):null]})}function Et({isAdmin:e}){let t=D(O.deliveryTiming.listDeliverySessions,{}),n=y(O.deliveryTiming.deleteDeliverySessions),[i,o]=(0,J.useState)(``),[s,c]=(0,J.useState)(`all`),[l,u]=(0,J.useState)(X),[f,p]=(0,J.useState)(null),{from:g,to:_}=vt(l),v=l.to===`now`?1/0:_,te=i.trim()!==``||s!==`all`||l!==X,b=()=>{o(``),c(`all`),u(X)},x=(0,J.useMemo)(()=>{if(t===void 0)return;let e=i.trim().toLowerCase();return t.filter(t=>(e===``||t.startedBy.toLowerCase().includes(e))&&(s===`all`||(s===`active`?t.active:!t.active))&&t.startedAt>=g&&t.startedAt<=v).map(e=>({...e,_id:e.sessionId}))},[t,i,s,g,v]),S=e=>{let t=new Set((x??[]).map(e=>e.sessionId)),r=e.filter(e=>t.has(e));r.length!==0&&(n({sessionIds:r}),f!==null&&r.includes(f)&&p(null))};return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsx)(yt,{q:i,onQChange:o,searchPlaceholder:m(),timeRange:l,onTimeRangeChange:u,onReset:b,canReset:te,children:(0,Y.jsxs)(G,{value:s,onValueChange:e=>c(e),children:[(0,Y.jsx)(W,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(q,{})}),(0,Y.jsxs)(K,{children:[(0,Y.jsx)(U,{value:`all`,children:fe()}),(0,Y.jsx)(U,{value:`active`,children:a()}),(0,Y.jsx)(U,{value:`stopped`,children:L()})]})]})}),(0,Y.jsx)(xt,{title:k(),rows:x,emptyHint:He(),columns:[{header:``,className:`w-8`,cell:e=>(0,Y.jsx)(B,{variant:`ghost`,size:`icon`,"aria-label":f===e.sessionId?r():De(),onClick:()=>p(t=>t===e.sessionId?null:e.sessionId),children:f===e.sessionId?(0,Y.jsx)(St,{size:15,"aria-hidden":!0}):(0,Y.jsx)(it,{size:15,"aria-hidden":!0})})},{header:se(),sort:e=>e.startedAt,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:V(e.startedAt)})},{header:ee(),sort:e=>e.stoppedAt,cell:e=>e.stoppedAt===null?(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`-`}):(0,Y.jsx)(`span`,{className:`tabular-nums`,children:V(e.stoppedAt)})},{header:h(),sort:e=>e.count,cell:e=>(0,Y.jsx)(`span`,{className:`tabular-nums`,children:Z(e.count)})},{header:d(),sort:e=>e.startedBy,cell:e=>wt(e.startedBy)},{header:E(),sort:e=>e.active,cell:e=>e.active?(0,Y.jsx)(H,{variant:`secondary`,children:a()}):(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:L()})}],rowActions:e?e=>[{label:I(),variant:`destructive`,onSelect:()=>S([e.sessionId])}]:void 0,bulkActions:e?[{label:I(),variant:`destructive`,onSelect:e=>S(e)}]:void 0,isExpanded:e=>e.sessionId===f,renderExpanded:e=>(0,Y.jsx)(Dt,{sessionId:e.sessionId})})]})}function Dt({sessionId:e}){let t=D(O.deliveryTiming.getDeliveryReport,{sessionId:e}),[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(Ot,{report:t,copied:n,onCopy:()=>{t&&navigator.clipboard?.writeText(nt(t)).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>{})}})}function Ot({report:e,copied:t,onCopy:n}){if(!e)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:T()});if(e.count===0||e.segments===null)return(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:v()});let r=e.segments,i=(e,t)=>(0,Y.jsxs)(`tr`,{className:`border-t border-border`,children:[(0,Y.jsx)(`td`,{className:`py-1`,children:e}),(0,Y.jsx)(`td`,{className:`py-1 text-right tabular-nums`,children:t.count}),(0,Y.jsxs)(`td`,{className:`py-1 text-right tabular-nums`,children:[Z(t.p50),` / `,Z(t.p95),` / `,Z(t.max)]})]});return(0,Y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.count,` `,Ae()]}),(0,Y.jsxs)(B,{variant:`outline`,size:`sm`,onClick:n,children:[t?(0,Y.jsx)(Ze,{size:13,"aria-hidden":!0}):(0,Y.jsx)(st,{size:13,"aria-hidden":!0}),t?be():P()]})]}),(0,Y.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`text-left text-muted-foreground`,children:[(0,Y.jsx)(`th`,{className:`py-1 font-medium`,children:qe()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:_e()}),(0,Y.jsx)(`th`,{className:`py-1 text-right font-medium`,children:Ye()})]})}),(0,Y.jsxs)(`tbody`,{children:[i(We(),r.bridge),i(me(),r.A),i(F(),r.C)]})]}),(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:we()}),e.truncated?(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Ie()}):null,(0,Y.jsx)(`p`,{className:`oc-admin__hint`,children:Me()})]})}var kt=[50,100,200,500],At=`all`,Q=`__all__`,jt=[`2xx`,`4xx`,`5xx`],Mt=[`user`,`service`,`system`],Nt=[`inbound`,`outbound`,`internal`],Pt={kind:`relative`,from:`now-30d`,to:`now`},Ft=[{value:`kind`,label:`kind`},{value:`status`,label:`status`},{value:`latencyMs`,label:ie()},{value:`principalType`,label:w()},{value:`direction`,label:`direction`},{value:`roleKey`,label:x()},{value:`route`,label:`route`},{value:`correlationId`,label:`correlationId`}];function It(){let e=dt({from:`/settings/traces`}),t=ht({from:`/settings/traces`}),n=e.limit,r=e.kind,a=e.statusClass??Q,c=e.principalType??Q,d=e.direction??Q,p=e.roleKey??Q,m=e.q??``,h=ut(e.from,e.to),_=(0,J.useMemo)(()=>gt(e.adv),[e.adv]),{from:v,to:ee}=vt(h),[y,b]=(0,J.useState)(null),[x,C]=(0,J.useState)(null),w=e=>void t({search:t=>({...t,limit:e})}),T=e=>void t({search:t=>({...t,kind:e})}),E=e=>void t({search:t=>({...t,q:e||void 0}),replace:!0}),ie=e=>void t({search:t=>({...t,statusClass:e===Q?void 0:e})}),oe=e=>void t({search:t=>({...t,principalType:e===Q?void 0:e})}),se=e=>void t({search:t=>({...t,direction:e===Q?void 0:e})}),k=e=>void t({search:t=>({...t,roleKey:e===Q?void 0:e})}),fe=e=>void t({search:t=>({...t,...pt(e)})}),pe=e=>void t({search:t=>({...t,adv:ct(e)}),replace:!0}),A=D(O.observability.listEvents,{limit:n}),j=D(O.observability.listEvents,{limit:n,kind:r===At?void 0:r,filter:{q:m||void 0,from:v,to:ee,statusClass:a===Q?void 0:a,principalType:c===Q?void 0:c,direction:d===Q?void 0:d,roleKey:p===Q?void 0:p,advanced:_.length>0?_:void 0}}),M=(0,J.useMemo)(()=>{let e=new Set;for(let t of A??[])e.add(t.kind);return[...e].sort()},[A]),me=(0,J.useMemo)(()=>{let e=new Set;for(let t of A??[])t.roleKey&&e.add(t.roleKey);return[...e].sort()},[A]),_e=m!==``||a!==Q||c!==Q||d!==Q||p!==Q||_.length>0||h.kind!==`relative`||h.from!==Pt.from;function be(){t({search:{limit:100,kind:`all`},replace:!0})}let N=y?A?.filter(e=>e.correlationId===y):j,P=e.section,F=e=>void t({search:t=>({...t,section:e}),replace:!0});return(0,Y.jsxs)(et,{value:P,onValueChange:e=>F(e),children:[(0,Y.jsxs)($e,{className:`w-full`,children:[(0,Y.jsxs)(R,{value:`latency`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(mt,{size:13,"aria-hidden":!0}),o()]}),(0,Y.jsxs)(R,{value:`events`,className:`flex-1 gap-1.5`,children:[(0,Y.jsx)(Ct,{size:13,"aria-hidden":!0}),le()]})]}),(0,Y.jsx)(z,{value:`latency`,children:(0,Y.jsx)(Tt,{})}),(0,Y.jsxs)(z,{value:`events`,className:`flex flex-col gap-3`,children:[(0,Y.jsxs)(`p`,{className:`oc-admin__hint`,children:[ce(),(0,Y.jsx)(`strong`,{children:te()}),g(),` `,(0,Y.jsx)(`span`,{className:`oc-filter__window`,children:f()})]}),(0,Y.jsxs)(yt,{q:m,onQChange:E,searchPlaceholder:ae(),timeRange:h,onTimeRangeChange:fe,onReset:be,canReset:_e,children:[(0,Y.jsxs)(G,{value:a,onValueChange:ie,children:[(0,Y.jsx)(W,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:ne()})}),(0,Y.jsxs)(K,{children:[(0,Y.jsx)(U,{value:Q,children:S()}),jt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:c,onValueChange:oe,children:[(0,Y.jsx)(W,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:Oe()})}),(0,Y.jsxs)(K,{children:[(0,Y.jsx)(U,{value:Q,children:i()}),Mt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:d,onValueChange:se,children:[(0,Y.jsx)(W,{size:`sm`,className:`w-32`,children:(0,Y.jsx)(q,{placeholder:ke()})}),(0,Y.jsxs)(K,{children:[(0,Y.jsx)(U,{value:Q,children:re()}),Nt.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:p,onValueChange:k,children:[(0,Y.jsx)(W,{size:`sm`,className:`w-36`,children:(0,Y.jsx)(q,{placeholder:l()})}),(0,Y.jsxs)(K,{children:[(0,Y.jsx)(U,{value:Q,children:u()}),me.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:r,onValueChange:T,children:[(0,Y.jsx)(W,{size:`sm`,className:`w-44`,children:(0,Y.jsx)(q,{placeholder:de()})}),(0,Y.jsxs)(K,{children:[(0,Y.jsx)(U,{value:At,children:Ke()}),M.map(e=>(0,Y.jsx)(U,{value:e,children:e},e))]})]}),(0,Y.jsxs)(G,{value:String(n),onValueChange:e=>w(Number(e)),children:[(0,Y.jsx)(W,{size:`sm`,className:`w-28`,children:(0,Y.jsx)(q,{})}),(0,Y.jsx)(K,{children:kt.map(e=>(0,Y.jsx)(U,{value:String(e),children:s({count:e})},e))})]})]}),(0,Y.jsx)(bt,{fields:Ft,seed:_,onChange:pe}),y?(0,Y.jsx)(`div`,{className:`oc-traces__followline`,children:(0,Y.jsxs)(`button`,{type:`button`,className:`oc-traces__chip`,onClick:()=>b(null),title:ue(),children:[(0,Y.jsxs)(`span`,{className:`oc-traces__chip-label`,children:[Je(),(0,Y.jsx)(`code`,{children:$(y)})]}),(0,Y.jsx)(Qe,{className:`oc-traces__chip-x`,"aria-hidden":!0}),(0,Y.jsx)(`span`,{className:`sr-only`,children:ve()})]})}):null,(0,Y.jsx)(xt,{title:Xe(),rows:N,emptyHint:y?Ge():he(),columns:[{header:Ce(),sort:e=>e.at,cell:e=>(0,Y.jsx)(`span`,{className:`oc-traces__time`,children:V(e.at)})},{header:Te(),sort:e=>e.kind,cell:e=>(0,Y.jsx)(H,{variant:`secondary`,children:e.kind})},{header:Ne(),sort:e=>Rt(e)??null,cell:e=>{let t=Rt(e);return t?(0,Y.jsxs)(`span`,{className:`oc-traces__fail`,title:t,children:[`✕ `,t]}):(0,Y.jsx)(`span`,{className:`oc-traces__ok`,"aria-label":Le(),children:`✓`})}},{header:Se(),sort:e=>e.direction,cell:e=>e.direction?(0,Y.jsx)(H,{variant:`outline`,children:e.direction}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:xe(),sort:e=>e.principalType,cell:e=>(0,Y.jsxs)(`span`,{className:`oc-traces__principal`,children:[(0,Y.jsx)(H,{variant:`outline`,children:e.principalType}),e.principalId?(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:$(e.principalId)}):null]})},{header:Ue(),sort:e=>e.roleKey,cell:e=>e.roleKey?(0,Y.jsx)(H,{variant:`secondary`,children:e.roleKey}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:je(),sort:e=>e.route,cell:e=>e.route?(0,Y.jsxs)(`span`,{className:`oc-traces__route`,children:[e.method?(0,Y.jsx)(`span`,{className:`oc-traces__method`,children:e.method}):null,(0,Y.jsx)(`code`,{className:`oc-traces__mono`,children:e.route})]}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:ye(),sort:e=>e.status,cell:e=>e.status===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsx)(`span`,{className:`oc-traces__status ${Lt(e.status)}`,children:e.status})},{header:Be(),sort:e=>e.latencyMs,cell:e=>e.latencyMs===null?(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`}):(0,Y.jsxs)(`span`,{className:`oc-traces__mono`,children:[e.latencyMs,` ms`]})},{header:Fe(),sort:e=>e.correlationId,cell:e=>e.correlationId?(0,Y.jsx)(`button`,{type:`button`,className:`oc-traces__corr`,title:ge(),onClick:()=>b(e.correlationId),children:$(e.correlationId)}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})},{header:Ee(),sort:e=>+!!e.meta,cell:e=>e.meta?(0,Y.jsx)(B,{variant:`outline`,size:`sm`,onClick:()=>C(e),children:ze()}):(0,Y.jsx)(`span`,{className:`oc-traces__muted`,children:`—`})}]}),(0,Y.jsx)(zt,{row:x,onClose:()=>C(null)})]})]})}function Lt(e){return e>=500?`oc-traces__status--5xx`:e>=400?`oc-traces__status--4xx`:e>=200&&e<300?`oc-traces__status--2xx`:`oc-traces__status--other`}function $(e){return e.length>8?e.slice(0,8):e}function Rt(e){if(typeof e.status==`number`&&e.status>=400)return String(e.status);if(!e.meta)return null;try{let t=JSON.parse(e.meta);if(e.kind===`openclaw.dispatch`&&t.dispatchStatus===`failed`)return t.errorCode??`failed`;if(e.kind===`assistant.stream`&&t.phase===`finalize`&&(t.streamStatus===`error`||t.streamStatus===`aborted`))return t.streamStatus;if(e.kind===`openclaw.ingest.denied`)return`denied`}catch{}return null}function zt({row:e,onClose:t}){let n=(0,J.useMemo)(()=>{if(!e?.meta)return``;try{return JSON.stringify(JSON.parse(e.meta),null,2)}catch{return e.meta}},[e]);return(0,Y.jsx)(ot,{open:e!==null,onOpenChange:e=>{e||t()},children:e?(0,Y.jsxs)(at,{className:`max-w-lg`,children:[(0,Y.jsxs)(_t,{children:[(0,Y.jsxs)(ft,{className:`oc-traces__meta-title`,children:[Pe(),` `,(0,Y.jsx)(`code`,{children:e.kind}),(0,Y.jsx)(H,{variant:`outline`,children:Ve()})]}),(0,Y.jsx)(tt,{children:N()})]}),(0,Y.jsx)(`pre`,{className:`oc-traces__meta-json`,children:n})]}):null})}export{It as TracesTab};
@@ -1 +0,0 @@
1
- import{a as e,l as t,r as n}from"./bundle-mjs-C73ZY4La.js";import{$n as r,$u as i,AT as a,An as o,At as s,Bn as c,Ct as ee,Dt as l,FF as u,Fn as d,Ft as f,Gn as p,Hn as m,In as h,It as g,Jn as _,Kn as v,LF as y,Ln as b,Lt as x,Mn as S,Nl as te,Nn as ne,Nt as re,Ot as ie,Pn as C,Pt as w,Qn as ae,RF as T,Rn as E,St as D,T as O,Tt as k,Un as oe,Vn as se,Wn as ce,Wt as le,Xn as ue,Yn as de,Zn as fe,jF as pe,jl as A,jn as j,kF as M,kn as N,kt as P,qn as F,ut as I,wt as L,zn as R}from"./dist-Bkkp8jtC.js";import{i as z,n as B,r as me,t as he}from"./tabs-0D2gasCk.js";import{t as V}from"./button-Ew8nYfum.js";import{At as H,Dt as ge,Et as _e,Nt as ve,Ot as ye,Tt as be,Wt as xe,Y as U,ct as W,gt as Se,in as Ce,jt as we,kt as G,lt as K,m as q,nn as Te,ot as J,rn as Ee,st as Y,ut as X}from"./index-gP_wjUtq.js";/* empty css */var Z=t(e(),1),Q=n(),De=[[`auto`,()=>v()],[`fr-FR`,()=>x()],[`en-US`,()=>g()],[`en-GB`,()=>f()],[`de-DE`,()=>w()],[`es-ES`,()=>re()]],Oe=[[`0.75`,()=>ce()],[`1`,()=>oe()],[`1.25`,()=>m()],[`1.5`,()=>se()]],$=0;function ke({instance:e}){let t=y(O.admin.upsertInstanceConfig),n=e.config??{},r={enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0},[a,o]=(0,Z.useState)(r),[s,l]=(0,Z.useState)(`idle`),[d,f]=(0,Z.useState)(!1),[m,g]=(0,Z.useState)(!1),v=u(O.voice.gatewayTtsPreview);(0,Z.useEffect)(()=>{o({enabled:n.voiceEnabled===!0,engine:n.voiceEngine===`gateway`?`gateway`:`browser`,lang:typeof n.voiceLang==`string`?n.voiceLang:`auto`,rate:typeof n.voiceRate==`number`?String(n.voiceRate):`1`,autoRead:n.voiceAutoRead===!0}),l(`idle`)},[e._id]);let x=a.enabled!==r.enabled||a.engine!==r.engine||a.lang!==r.lang||a.rate!==r.rate||a.autoRead!==r.autoRead;async function S(){l(`saving`);try{let n={...e.config??{}};n.voiceEnabled=a.enabled,a.engine===`gateway`?n.voiceEngine=`gateway`:delete n.voiceEngine,a.lang===`auto`?delete n.voiceLang:n.voiceLang=a.lang;let r=Number.parseFloat(a.rate);!Number.isFinite(r)||r===1?delete n.voiceRate:n.voiceRate=r,a.autoRead?n.voiceAutoRead=!0:delete n.voiceAutoRead,await t({instanceId:e._id,config:n}),l(`idle`)}catch{l(`error`)}}return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(U,{variant:`secondary`,children:e.kind===`hermes`?`Hermes`:`OpenClaw`})]}),(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.enabled,onCheckedChange:e=>o({...a,enabled:e===!0}),"aria-label":_()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:_()})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:k()}),(0,Q.jsxs)(J,{value:a.engine,onValueChange:e=>o({...a,engine:e}),disabled:!a.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":k(),children:(0,Q.jsx)(X,{})}),(0,Q.jsxs)(Y,{children:[(0,Q.jsx)(W,{value:`browser`,children:L()}),e.kind===`hermes`?null:(0,Q.jsx)(W,{value:`gateway`,children:ee()})]})]})]}),a.engine===`gateway`?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:D()}):null,a.engine===`gateway`?null:(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:F()}),(0,Q.jsxs)(J,{value:a.lang,onValueChange:e=>o({...a,lang:e}),disabled:!a.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":F(),children:(0,Q.jsx)(X,{})}),(0,Q.jsx)(Y,{children:De.map(([e,t])=>(0,Q.jsx)(W,{value:e,children:t()},e))})]})]}),(0,Q.jsxs)(`div`,{className:`oc-voice__row`,children:[(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:p()}),(0,Q.jsxs)(J,{value:a.rate,onValueChange:e=>o({...a,rate:e}),disabled:!a.enabled,children:[(0,Q.jsx)(K,{size:`sm`,"aria-label":p(),children:(0,Q.jsx)(X,{})}),(0,Q.jsx)(Y,{children:Oe.map(([e,t])=>(0,Q.jsx)(W,{value:e,children:t()},e))})]})]}),a.engine===`gateway`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:a.autoRead,onCheckedChange:e=>o({...a,autoRead:e===!0}),disabled:!a.enabled,"aria-label":c()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:c()})]}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:R()})]}),(0,Q.jsxs)(`div`,{className:`oc-cdefaults__inline`,children:[(0,Q.jsx)(V,{size:`sm`,disabled:!x||s===`saving`,onClick:()=>void S(),children:s===`saving`?i():te()}),(0,Q.jsx)(V,{variant:`outline`,size:`sm`,disabled:!a.enabled||d,onClick:()=>{let t=Number.parseFloat(a.rate)||1,n=++$;if(g(!1),H(),G(),a.engine!==`gateway`){ye(h(),{lang:ge(a.lang,pe()),rate:t});return}f(!0),v({instanceName:e.name,text:h()}).then(({mime:e,audioBase64:r})=>{n===$&&_e(r,e,{rate:t})}).catch(()=>{n===$&&g(!0)}).finally(()=>f(!1))},children:d?i():E()}),(0,Q.jsx)(V,{variant:`ghost`,size:`sm`,onClick:()=>{$++,f(!1),H(),G()},children:b()})]}),s===`error`||m?(0,Q.jsx)(`p`,{className:`oc-cdefaults__error`,role:`alert`,children:m?I():A()}):null]})}function Ae({stt:e}){let t=T(O.me.getMe,{host:Se}),n=y(O.admin.setFeatureEnabled),r=t?.ui?.featuresEnabled?.voiceInput===!0,i=t?.role===`admin`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:C()}),(0,Q.jsx)(U,{variant:e?`secondary`:`outline`,children:e?o():N()}),(0,Q.jsx)(U,{variant:r?`secondary`:`destructive`,children:r?P():ie()})]}),i?(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:r,onCheckedChange:e=>void n({key:`voiceInput`,enabled:e===!0}),"aria-label":s()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:s()})]}):null,(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:ne()})]})}function je(){let e=T(O.admin.listInstances,{}),t=(0,Z.useMemo)(()=>we(),[]),n=(0,Z.useMemo)(()=>be(),[]),{section:i}=Ce({from:`/settings/voice`}),a=Ee({from:`/settings/voice`});return(0,Q.jsxs)(`div`,{className:`oc-admin__tab oc-voice`,children:[(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:r()}),(0,Q.jsxs)(`div`,{className:`oc-voice__support`,children:[(0,Q.jsx)(U,{variant:t?`secondary`:`destructive`,children:t?ae():fe()}),(0,Q.jsx)(U,{variant:n?`secondary`:`destructive`,children:n?ue():de()})]}),(0,Q.jsxs)(he,{value:i,onValueChange:e=>void a({search:{section:e},replace:!0}),children:[(0,Q.jsxs)(me,{className:`w-full`,children:[(0,Q.jsxs)(z,{value:`readaloud`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(ve,{size:13,"aria-hidden":!0}),l()]}),(0,Q.jsxs)(z,{value:`dictation`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(xe,{size:13,"aria-hidden":!0}),C()]}),(0,Q.jsxs)(z,{value:`talk`,className:`flex-1 gap-1.5`,children:[(0,Q.jsx)(Te,{size:13,"aria-hidden":!0}),S()]})]}),(0,Q.jsx)(B,{value:`readaloud`,children:e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:M()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):e.map(e=>(0,Q.jsx)(ke,{instance:e},e._id))}),(0,Q.jsx)(B,{value:`dictation`,children:(0,Q.jsx)(Ae,{stt:n})}),(0,Q.jsxs)(B,{value:`talk`,children:[(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsx)(`header`,{className:`oc-voice__cardhead`,children:(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:S()})}),(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:j()})]}),e===void 0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:M()}):e.length===0?(0,Q.jsx)(`p`,{className:`oc-admin__hint`,children:d()}):e.map(e=>(0,Q.jsx)(Me,{instance:e},e._id))]})]})]})}function Me({instance:e}){let t=y(O.admin.upsertInstanceConfig),n=e.config??{},r=n.talkEnabled===!0,i=e.kind===`hermes`;return(0,Q.jsxs)(`section`,{className:`oc-voice__card`,children:[(0,Q.jsxs)(`header`,{className:`oc-voice__cardhead`,children:[(0,Q.jsx)(`span`,{className:`oc-voice__instance`,children:e.name}),(0,Q.jsx)(U,{variant:`secondary`,children:i?`Hermes`:`OpenClaw`})]}),i?(0,Q.jsx)(`p`,{className:`oc-cdefaults__help`,children:le()}):(0,Q.jsxs)(`label`,{className:`oc-cdefaults__inline`,style:{cursor:`pointer`},children:[(0,Q.jsx)(q,{checked:r,onCheckedChange:r=>{let i={...n};r===!0?i.talkEnabled=!0:delete i.talkEnabled,t({instanceId:e._id,config:i})},"aria-label":a()}),(0,Q.jsx)(`span`,{className:`oc-cdefaults__label`,children:a()})]})]})}export{je as VoiceTab};
@@ -1 +0,0 @@
1
- import{D as e}from"./dist-Bkkp8jtC.js";var t=e(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]);export{t};
@@ -1 +0,0 @@
1
- .oc-afiles{flex-direction:column;gap:.75rem;display:flex}.oc-afiles__picker{flex-wrap:wrap;align-items:center;gap:.5rem;display:flex}.oc-afiles__list{border:1px solid var(--border);border-radius:var(--radius);flex-direction:column;display:flex;overflow:hidden}.oc-afiles__row{border-bottom:1px solid var(--border);align-items:center;gap:.75rem;padding:.5rem .75rem;font-size:.85rem;display:flex}.oc-afiles__row:last-child{border-bottom:none}.oc-afiles__name{text-overflow:ellipsis;white-space:nowrap;flex:0 0 10rem;font-weight:500;overflow:hidden}.oc-afiles__size{text-align:right;color:var(--muted-foreground);font-variant-numeric:tabular-nums;flex:0 0 4.5rem}.oc-afiles__gauge{background:var(--muted);border-radius:999px;flex:6rem;height:.375rem;overflow:hidden}.oc-afiles__gauge-fill{border-radius:inherit;background:var(--primary);height:100%;display:block}.oc-afiles__gauge.is-warn .oc-afiles__gauge-fill{background:var(--destructive)}.oc-afiles__pct{text-align:right;color:var(--muted-foreground);font-variant-numeric:tabular-nums;flex:0 0 3rem}.oc-afiles__warn{color:var(--destructive);flex:none}.oc-afiles__warn-slot{flex:none;width:14px}.oc-afiles__open{margin-left:auto}.oc-afiles__budget{color:var(--muted-foreground);font-size:.8rem}.oc-afiles__error,.oc-cdefaults__error{color:var(--destructive);align-items:center;gap:.5rem;font-size:.85rem;display:flex}[data-slot=dialog-content].oc-afiles__editor{flex-direction:column;width:calc(100vw - 2rem);max-width:72rem;height:calc(100vh - 2rem);max-height:none;display:flex}.oc-afiles__source{resize:none;min-height:0;font-family:var(--font-mono,ui-monospace, monospace);border:1px solid var(--border);border-radius:var(--radius);background:var(--background);color:var(--foreground);flex:auto;padding:.75rem;font-size:.8rem;line-height:1.5}.oc-afiles__source:focus-visible{outline:2px solid var(--ring);outline-offset:-1px}.oc-afiles__hint{color:var(--muted-foreground);font-size:.75rem}.oc-afiles__editor-foot{justify-content:space-between;align-items:center;gap:.75rem;display:flex}.oc-afiles__count{color:var(--muted-foreground);font-variant-numeric:tabular-nums;font-size:.8rem}.oc-afiles__count.is-over{color:var(--destructive);font-weight:600}.oc-afiles__diff{flex-direction:column;gap:.5rem;max-height:14rem;display:flex;overflow-y:auto}.oc-afiles__diff-counts{font-size:.85rem;font-weight:500}.oc-afiles__diff-block{flex-direction:column;gap:.125rem;display:flex}.oc-afiles__diff-label{color:var(--muted-foreground);font-size:.75rem}.oc-afiles__diff-line{border-radius:calc(var(--radius) / 2);white-space:pre-wrap;word-break:break-word;padding:.125rem .375rem;font-size:.75rem}.oc-afiles__diff-line.is-add{background:color-mix(in oklab, var(--primary) 12%, transparent)}.oc-afiles__diff-line.is-del{background:color-mix(in oklab, var(--destructive) 12%, transparent);text-decoration:line-through}.oc-cdefaults{flex-direction:column;gap:.75rem;max-width:36rem;display:flex}.oc-cdefaults__row{border-bottom:1px solid var(--border);flex-direction:column;gap:.375rem;padding:.625rem 0;display:flex}.oc-cdefaults__label{font-size:.85rem;font-weight:500}.oc-cdefaults__help,.oc-cdefaults__note{color:var(--muted-foreground);margin:0;font-size:.75rem}.oc-cdefaults__actions{justify-content:flex-end;display:flex}.oc-voice__support{flex-wrap:wrap;gap:.5rem;margin-bottom:1rem;display:flex}.oc-voice__card{border:1px solid var(--border);border-radius:var(--radius);background:var(--card);flex-direction:column;gap:.6rem;margin-bottom:.9rem;padding:.9rem 1rem;display:flex}.oc-voice__cardhead{align-items:center;gap:.6rem;display:flex}.oc-voice__instance{font-weight:600}.oc-voice__row{align-items:center;gap:.75rem;display:flex}.oc-voice__row .oc-cdefaults__label{min-width:10rem}