UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.51 kB
import{b as asNullableRecord}from"./global-singleton-CTnqrmaI.js";import{c as stripRetiredChannelKeys,s as defineChannelAliasMigration}from"./runtime-doctor-migrations-D8alsOFs.js"; //!extensions/irc/config-doctor-api.ts const streamingAliasMigration=defineChannelAliasMigration({channelId:`irc`,streaming:{defaultMode:`partial`,deliveryOnly:true},accountStreamingReplacesRoot:true});const RETIRED_IRC_KEYS=/* @__PURE__ */ new Set([`mentionPatterns`]);const legacyConfigRules=[...streamingAliasMigration.legacyConfigRules,{path:[`channels`,`irc`],match:e=>Object.hasOwn(asNullableRecord(e)??{},`mentionPatterns`),message:`channels.irc.mentionPatterns was accepted but never read; configure mention patterns with messages.groupChat.mentionPatterns. Run "openclaw doctor --fix".`},{path:[`channels`,`irc`,`accounts`],match:e=>Object.values(asNullableRecord(e)??{}).some(e=>Object.hasOwn(asNullableRecord(e)??{},`mentionPatterns`)),message:`channels.irc.accounts.<id>.mentionPatterns was accepted but never read; configure mention patterns with messages.groupChat.mentionPatterns. Run "openclaw doctor --fix".`}];function normalizeCompatibilityConfig({cfg:e}){const t=streamingAliasMigration.normalizeChannelConfig({cfg:e});const n=[...t.changes];return{config:stripRetiredChannelKeys({cfg:t.config,channelId:`irc`,keys:RETIRED_IRC_KEYS,scope:`root-and-accounts`,onRemove:e=>{n.push(`Removed ${e.pathPrefix}.${e.key}; it was never read.`)}}).config,changes:n}}export{legacyConfigRules,normalizeCompatibilityConfig};