openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
33 lines (32 loc) • 1.16 kB
JavaScript
import { l as normalizeOptionalString } from "./string-coerce-CCIiB4H7.mjs";
//#region src/transcripts/config.ts
const DEFAULT_TRANSCRIPTS_MAX_UTTERANCES = 2e3;
function resolveAutoStart(e) {
if (!Array.isArray(e)) return [];
return e.map((e) => {
const t = e && typeof e === "object" ? e : {};
const n = normalizeOptionalString(t.providerId);
if (!n) return;
return {
providerId: n,
whenOccupied: t.whenOccupied === true,
sessionId: t.whenOccupied === true ? void 0 : normalizeOptionalString(t.sessionId),
title: normalizeOptionalString(t.title),
accountId: normalizeOptionalString(t.accountId),
guildId: normalizeOptionalString(t.guildId),
channelId: normalizeOptionalString(t.channelId),
meetingUrl: normalizeOptionalString(t.meetingUrl)
};
}).filter((e) => e !== void 0);
}
/** Normalize raw transcripts config into runtime settings. */
function resolveTranscriptsConfig(e) {
const t = e && typeof e === "object" ? e : {};
return {
enabled: t.enabled !== false,
maxUtterances: DEFAULT_TRANSCRIPTS_MAX_UTTERANCES,
autoStart: resolveAutoStart(t.autoStart)
};
}
//#endregion
export { resolveTranscriptsConfig as t };