feat(tts): resolve channel account config generically

This commit is contained in:
Peter Steinberger
2026-04-26 08:10:25 +01:00
parent 6c60cd2b72
commit d419fb561d
24 changed files with 515 additions and 47 deletions

View File

@@ -220,6 +220,45 @@ describe("FeishuConfigSchema optimization flags", () => {
});
});
describe("FeishuConfigSchema TTS overrides", () => {
it("accepts top-level and account-level TTS overrides", () => {
const result = FeishuConfigSchema.parse({
tts: {
auto: "always",
provider: "openai",
providers: {
openai: {
voice: "alloy",
},
},
},
accounts: {
english: {
tts: {
providers: {
openai: {
voice: "shimmer",
},
},
},
},
},
});
expect(result.tts).toMatchObject({
auto: "always",
provider: "openai",
});
expect(result.accounts?.english?.tts).toMatchObject({
providers: {
openai: {
voice: "shimmer",
},
},
});
});
});
describe("FeishuConfigSchema actions", () => {
it("accepts top-level reactions action gate", () => {
const result = FeishuConfigSchema.parse({

View File

@@ -20,6 +20,23 @@ const FeishuDomainSchema = z.union([
z.string().url().startsWith("https://"),
]);
const FeishuConnectionModeSchema = z.enum(["websocket", "webhook"]);
const TtsOverrideSchema = z
.object({
auto: z.enum(["off", "always", "inbound", "tagged"]).optional(),
enabled: z.boolean().optional(),
mode: z.enum(["final", "all"]).optional(),
provider: z.string().optional(),
persona: z.string().optional(),
personas: z.record(z.string(), z.record(z.string(), z.unknown())).optional(),
summaryModel: z.string().optional(),
modelOverrides: z.record(z.string(), z.unknown()).optional(),
providers: z.record(z.string(), z.record(z.string(), z.unknown())).optional(),
prefsPath: z.string().optional(),
maxTextLength: z.number().int().min(1).optional(),
timeoutMs: z.number().int().min(1000).max(120000).optional(),
})
.strict()
.optional();
const ToolPolicySchema = z
.object({
@@ -183,6 +200,7 @@ const FeishuSharedConfigShape = {
reactionNotifications: ReactionNotificationModeSchema,
typingIndicator: z.boolean().optional(),
resolveSenderNames: z.boolean().optional(),
tts: TtsOverrideSchema,
};
/**