UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

1 lines • 1.25 kB
import"./openclaw-state-read-sqlite-database-admission-CrkztOzk.mjs";import{t as e}from"./openclaw-state-read-json-coercion-CAL-_nfN.mjs";import{a as t,r as n}from"./openclaw-state-read-kysely-sync-Bcu0Qb7F.mjs";function parseFingerprint(t){let n=e(t??``);return n&&typeof n==`object`?n:void 0}function selectConfigHealthRows(e){let r=t(e).selectFrom(`config_health_entries`).select([`config_path`,`last_known_good_json`,`last_promoted_good_json`,`last_observed_suspicious_signature`,`updated_at_ms`]);return n(e,r.orderBy(`config_path`,`asc`)).rows}function decodeConfigHealthRows(e){return{entries:Object.fromEntries(e.map(e=>[e.config_path,{lastKnownGood:parseFingerprint(e.last_known_good_json),lastPromotedGood:parseFingerprint(e.last_promoted_good_json),lastObservedSuspiciousSignature:e.last_observed_suspicious_signature}]))}}const r={"config.health.read":(e,t)=>{let n=selectConfigHealthRows(t);return{type:`config.health.read`,snapshot:{state:decodeConfigHealthRows(n),basis:Object.fromEntries(n.map(e=>[e.config_path,{lastKnownGoodJson:e.last_known_good_json,lastPromotedGoodJson:e.last_promoted_good_json,suspiciousSignature:e.last_observed_suspicious_signature,updatedAtMs:e.updated_at_ms}]))}}}};export{r as configHealthReadOperations};