openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 1.79 kB
JavaScript
import{i as getRuntimeConfigAppliedHash,j as hashRuntimeConfigValue}from"./runtime-snapshot-Bg5K4JNu.mjs";import{d as getActivePluginRegistryVersion}from"./runtime-Cl6PvJHC.mjs";import{s as readConfigFileSnapshot}from"./io.runtime-BvSeVFIY.mjs";import"./config-DkZ8y8Gv.mjs";import{n as redactConfigSnapshot}from"./redact-snapshot-B-h1qJ6D.mjs";
//!src/gateway/config-get-response.ts
let configGetResponseCache;function createConfigGetResponse(e,t,n){const r=redactConfigSnapshot(e,t);const i=getRuntimeConfigAppliedHash();return{...r,hash:r.hash?n.projectRawHash(r.hash):r.hash,configRevisionHash:e.valid?n.projectResolvedHash(hashRuntimeConfigValue(e.sourceConfig)):null,appliedConfigHash:i?n.projectResolvedHash(i):null}}async function readConfigGetResponse(e){const readResponse=async()=>{const{loadGatewayConfigRedactionHints:t}=await import(`./runtime-schema-CYWMVqyi.mjs`);return createConfigGetResponse(await readConfigFileSnapshot(),t(),e.revisionProjector)};const t=e.getHotReloadStatus;if(!t||t()!==`active`)return readResponse();const n=getRuntimeConfigAppliedHash();const r=getActivePluginRegistryVersion();if(configGetResponseCache?.getHotReloadStatus===t&&configGetResponseCache.revisionProjector===e.revisionProjector&&configGetResponseCache.appliedConfigHash===n&&configGetResponseCache.pluginRegistryVersion===r)return await configGetResponseCache.promise;const i=readResponse();configGetResponseCache={getHotReloadStatus:t,revisionProjector:e.revisionProjector,appliedConfigHash:n,pluginRegistryVersion:r,promise:i};try{return await i}catch(e){if(configGetResponseCache?.promise===i)configGetResponseCache=void 0;throw e}}function invalidateConfigGetResponseCache(){configGetResponseCache=void 0}export{readConfigGetResponse as n,invalidateConfigGetResponseCache as t};