openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 1.63 kB
JavaScript
import{C as isRecord}from"./global-singleton-CTnqrmaI.js";import{T as normalizeChannelConfigEntries,s as defineChannelAliasMigration}from"./runtime-doctor-migrations-D8alsOFs.js";import"./string-coerce-runtime-DtNToPzY.js";
//!extensions/imessage/config-doctor-api.ts
function isEnabledCatchup(e){return isRecord(e)&&e.enabled===true}function imessageEntryHasRetiredCatchup(e){if(!isRecord(e))return false;if(Object.hasOwn(e,`catchup`)&&!isEnabledCatchup(e.catchup))return true;const t=e.accounts;if(!isRecord(t))return false;return Object.values(t).some(e=>isRecord(e)&&Object.hasOwn(e,`catchup`)&&!isEnabledCatchup(e.catchup))}const streamingAliasMigration=defineChannelAliasMigration({channelId:`imessage`,streaming:{defaultMode:`partial`,deliveryOnly:true}});const legacyConfigRules=[{path:[`channels`,`imessage`],message:`disabled channels.imessage.catchup config is retired; iMessage now recovers via always-on inbound dedupe and a stale-backlog age fence. Run "openclaw doctor --fix" to remove disabled catchup blocks.`,match:e=>imessageEntryHasRetiredCatchup(e)},...streamingAliasMigration.legacyConfigRules];function normalizeCompatibilityConfig({cfg:e}){const t=normalizeChannelConfigEntries({cfg:e,channelId:`imessage`,normalizeEntry:({entry:e,pathPrefix:t,changes:n})=>{if(!Object.hasOwn(e,`catchup`)||isEnabledCatchup(e.catchup))return{entry:e,changed:false};const r={...e};delete r.catchup;n.push(`Removed disabled retired ${t}.catchup.`);return{entry:r,changed:true}}});return streamingAliasMigration.normalizeChannelConfig({cfg:t.config,changes:t.changes})}export{legacyConfigRules,normalizeCompatibilityConfig};