openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
33 lines (32 loc) • 1.32 kB
JavaScript
import "./session-key-CqAyZeVk.mjs";
import { n as normalizeAccountId } from "./account-id-BqKT3GuY.mjs";
import { t as normalizeAnyChannelId } from "./registry-normalize-guW5_4yo.mjs";
import { n as getLoadedChannelPlugin } from "./registry-ByqVE5S3.mjs";
import "./plugins-BoMiRtiY.mjs";
import { r as resolveChannelAccountEntry } from "./account-lookup-FhQZVFfo.mjs";
//#region src/config/markdown-tables.ts
const isMarkdownTableMode = (e) => e === "off" || e === "bullets" || e === "code" || e === "block";
function resolveMarkdownModeFromSection(e, t, n) {
if (!e) return;
const r = normalizeAccountId(n);
const i = e.accounts;
if (i && typeof i === "object") {
const e = resolveChannelAccountEntry(i, r, t)?.markdown?.tables;
if (isMarkdownTableMode(e)) return e;
}
const a = e.markdown?.tables;
return isMarkdownTableMode(a) ? a : void 0;
}
function resolveMarkdownTableMode(e) {
const t = normalizeAnyChannelId(e.channel);
const n = t ? getLoadedChannelPlugin(t)?.messaging?.defaultMarkdownTableMode ?? "code" : "code";
let r = n;
if (t && e.cfg) {
const i = e.cfg.channels;
const a = e.cfg;
r = resolveMarkdownModeFromSection(i?.[t] ?? a[t], t, e.accountId) ?? n;
}
return r === "block" && !e.supportsBlockTables ? "code" : r;
}
//#endregion
export { resolveMarkdownTableMode as t };