openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
47 lines (46 loc) • 1.68 kB
JavaScript
import { L as asNullableRecord, a as defineChannelAliasMigration, o as stripRetiredChannelKeys } from "./runtime-doctor-migrations-JGL9tD-z.js";
//#region 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
};
}
//#endregion
export { legacyConfigRules, normalizeCompatibilityConfig };