openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
1 lines • 553 B
JavaScript
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";function t(e){let t=window,n=n=>{let r=e.connection.gatewayUrl,i=t.__OPENCLAW_NATIVE_GATEWAY_HEALTH__;(i?.gatewayUrl!==r||i.health!==n)&&(t.__OPENCLAW_NATIVE_GATEWAY_HEALTH__={gatewayUrl:r,health:n},window.dispatchEvent(new Event(`openclaw:native-gateway-health-changed`)))},r=()=>{let{phase:t,lastError:r}=e.snapshot;n(t===`connected`?`ok`:r?`error`:`unknown`)},i=e.subscribe(r);return r(),()=>{i(),n(`unknown`)}}function n(){return(n=e((()=>{})))()}n();export{t as startNativeGatewayHealthReporting};