UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 5.03 kB
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{$p as t,Xp as n,dj as r,jA as i,mj as a,pj as o}from"./control-ui-boot-shared-DFTSUQQ0.js";import{F as s,Rt as c,U as l,d as u,f as d,g as f,j as p,l as m,o as h,u as g,x as _}from"./solid-runtime-C416s-HC.js";import{n as v,t as y}from"./en-debug-B2KGEt5m.js";import{t as b}from"./sparkline-tile-DehiVJS0.js";function x(e,t){let n=[];for(let r of e){let e=t(r.status),i=typeof e==`number`?{value:e}:e;i&&Number.isFinite(i.value)?n.push({...i,at:r.at}):n.length=0}return n}function S(){return(S=e((()=>{})))()}function C(e){return`${Math.round(e*100)}%`}function w(e){return a(`debug.overlay.cpuCores`,{value:e.toFixed(2)})}function T(e){return a(`debug.overlay.memoryMb`,{value:String(Math.round(e/1048576))})}function E(e){return n(e)??a(`common.na`)}function D(e){return typeof e==`number`?C(e):`—`}function O(e){var t=M(),n=t.firstChild,r=n.firstChild,i=n.nextSibling,a=i.firstChild,o=a.nextSibling;return u(n,()=>e.label,null),u(i,()=>e.kind===`other`&&typeof e.value==`number`?`≈`:``,a),u(i,()=>D(e.value),o),m(()=>[`gateway-cpu-key`,`gateway-cpu-key--${e.kind}`],(e,t)=>{h(r,e,t)}),t}function k(e){let t=()=>e.status.eventLoop,n=()=>t()?.cpuBreakdown,r=()=>t()?.reasons?.some(e=>e===`cpu`||e===`event_loop_utilization`),i=s(()=>x(e.history,e=>{let t=e.eventLoop?.cpuCoreRatio;if(t===void 0)return;let n=e.eventLoop?.cpuBreakdown,r=[n?.mainThreadCoreRatio,n?.workerCoreRatio,n?.otherThreadsCoreRatio];return{value:t,secondary:a(`debug.overlay.hostShort`,{value:D(n?.hostUtilization)}),stack:r.every(e=>typeof e==`number`)?r:void 0}}));var o=N(),l=o.firstChild,h=l.firstChild,g=l.nextSibling.firstChild,_=g.nextSibling,v=_.nextSibling,y=v.firstChild,b=y.firstChild,S=b.nextSibling,C=y.nextSibling,T=C.nextSibling,E=T.nextSibling,k=E.firstChild,A=k.nextSibling,j=E.nextSibling.firstChild,M=j.nextSibling;return o.pointerThrough=!0,o._$owner=c(),h.format=w,h.floorMax=1,h.stackColors=[`var(--cpu-main)`,`var(--cpu-workers)`,`var(--cpu-other)`],h._$owner=c(),u(g,()=>a(`debug.overlay.cpuBreakdownCurrent`)),u(_,()=>a(`debug.overlay.cpuScopeDescription`)),u(b,()=>a(`debug.overlay.gatewayCpuProcess`)),u(S,()=>D(t()?.cpuCoreRatio)),u(v,p(O,{get label(){return a(`debug.overlay.mainThreadCpu`)},get value(){return n()?.mainThreadCoreRatio},kind:`main`}),C),u(v,p(O,{get label(){return a(`debug.overlay.workerCpu`)},get value(){return n()?.workerCoreRatio},kind:`workers`}),T),u(v,p(O,{get label(){return a(`debug.overlay.otherThreadCpu`)},get value(){return n()?.otherThreadsCoreRatio},kind:`other`}),E),u(k,(()=>{var e=d(()=>n()?.hostCpuCount==null);return()=>e()?a(`debug.overlay.hostCpu`):a(`debug.overlay.hostCpuCount`,{count:String(n()?.hostCpuCount)})})()),u(A,()=>D(n()?.hostUtilization)),u(j,()=>a(`debug.overlay.loopUtilization`)),u(M,()=>D(t()?.utilization)),m(()=>({e:a(`debug.overlay.cpuBreakdown`),t:r()?``:void 0,a:a(`debug.overlay.gatewayCpu`),o:a(`debug.overlay.gatewayCpuScope`),i:i()}),({e,t,a:n,o:r,i},a)=>{e!==a?.e&&f(l,`aria-label`,e),t!==a?.t&&f(h,`data-degraded`,t),n!==a?.a&&(h.label=n),r!==a?.o&&(h.sub=r),i!==a?.i&&(h.samples=i)}),o}function A(e){let t=s(()=>x(e.history,e=>e.processMemory?.rssBytes));var n=P();return n.format=T,n._$owner=c(),m(()=>({e:a(`debug.overlay.memory`),t:typeof e.status.processMemory?.heapUsedBytes==`number`?a(`debug.overlay.heapShort`,{value:T(e.status.processMemory.heapUsedBytes)}):``,a:t()}),({e,t,a:r},i)=>{e!==i?.e&&(n.label=e),t!==i?.t&&(n.sub=t),r!==i?.a&&(n.samples=r)}),n}function j(e){let t=s(()=>x(e.history,e=>e.eventLoop?.delayP99Ms));var n=F(),r=n.firstChild,i=r.nextSibling;return u(n,p(k,{get status(){return e.status},get history(){return e.history}}),r),u(n,p(A,{get status(){return e.status},get history(){return e.history}}),i),i.format=E,i.floorMax=20,i._$owner=c(),m(()=>({e:e.status.eventLoop?.reasons?.includes(`event_loop_delay`)?``:void 0,t:a(`debug.overlay.delayP99`),a:typeof e.status.eventLoop?.delayMaxMs==`number`?a(`debug.overlay.maxShort`,{value:E(e.status.eventLoop.delayMaxMs)}):``,o:t()}),({e,t,a:n,o:r},a)=>{e!==a?.e&&f(i,`data-degraded`,e),t!==a?.t&&(i.label=t),n!==a?.a&&(i.sub=n),r!==a?.o&&(i.samples=r)}),n}var M,N,P,F;function I(){return(I=e((()=>{g(),l(),y(),t(),r(),i(),b(),M=_(`<div class=gateway-cpu-detail__thread><dt><span aria-hidden=true></span></dt><dd><!><!>`),N=_(`<openclaw-tooltip class=gateway-cpu-tooltip placement=top-start open-on-click auto-size><button type=button class=gateway-cpu-trigger><openclaw-sparkline class="gateway-vital gateway-vital--cpu"></openclaw-sparkline></button><div slot=content class=gateway-cpu-detail><strong></strong><p></p><dl><div class=gateway-cpu-detail__total><dt></dt><dd></dd></div><!><!><div class=gateway-cpu-detail__host><dt></dt><dd></dd></div><div><dt></dt><dd>`,1),P=_(`<openclaw-sparkline class="gateway-vital gateway-vital--memory"autorange>`,1),F=_(`<div class=gateway-vitals><!><openclaw-sparkline class="gateway-vital gateway-vital--delay">`,1),o(v)})))()}export{x as a,I as i,A as n,S as o,j as r,k as t};