UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

39 lines (38 loc) • 1.39 kB
import { B as isRecord, a as defineChannelAliasMigration, o as stripRetiredChannelKeys } from "./runtime-doctor-migrations-JGL9tD-z.js"; import "./string-coerce-runtime-DkwxSzQP.js"; //#region extensions/matrix/src/doctor-contract.ts function parseMatrixStreamingMode(e) { if (typeof e !== "string") return null; const t = e.trim().toLowerCase(); return t === "partial" || t === "quiet" || t === "progress" || t === "off" ? t : null; } const streamingAliasMigration = defineChannelAliasMigration({ channelId: "matrix", streaming: { defaultMode: "off", resolveMode: (e) => { const t = isRecord(e.streaming) ? e.streaming : null; const n = parseMatrixStreamingMode(t ? t.mode : e.streaming); if (n) return n; return e.streaming === true ? "partial" : "off"; } }, accountStreamingReplacesRoot: true }); const legacyConfigRules = streamingAliasMigration.legacyConfigRules; function normalizeCompatibilityConfig({ cfg: e }) { const t = []; const n = stripRetiredChannelKeys({ cfg: e, channelId: "matrix", keys: /* @__PURE__ */ new Set(["streamMode"]), scope: "root-and-accounts", onRemove: ({ key: e, pathPrefix: n }) => t.push(`Removed ${n}.${e} (never read by the Matrix runtime).`) }).config; return streamingAliasMigration.normalizeChannelConfig({ cfg: n, changes: t }); } //#endregion export { legacyConfigRules, normalizeCompatibilityConfig };