feat(channels): add microsoft teams bot framework adapter
This commit is contained in:
@@ -350,6 +350,31 @@ describe('configSchema — signal', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('configSchema — teams', () => {
|
||||
const minimalConfig = {
|
||||
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
|
||||
models: { default: { provider: 'anthropic', model: 'claude-3' } },
|
||||
};
|
||||
|
||||
it('accepts teams config and defaults allowlist/mention fields', () => {
|
||||
const result = configSchema.parse({
|
||||
...minimalConfig,
|
||||
teams: {
|
||||
app_id: 'app-id',
|
||||
app_password: 'app-password',
|
||||
},
|
||||
});
|
||||
|
||||
expect(result.teams).toBeDefined();
|
||||
if (!result.teams) {
|
||||
throw new Error('Expected teams config');
|
||||
}
|
||||
expect(result.teams.app_id).toBe('app-id');
|
||||
expect(result.teams.allowed_conversation_ids).toEqual([]);
|
||||
expect(result.teams.require_mention).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('configSchema — whatsapp', () => {
|
||||
const minimalConfig = {
|
||||
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
|
||||
|
||||
@@ -411,6 +411,13 @@ const signalSchema = z.object({
|
||||
send_timeout_ms: z.number().min(1000).max(60000).default(15000),
|
||||
}).optional();
|
||||
|
||||
const teamsSchema = z.object({
|
||||
app_id: z.string().min(1, 'Teams app_id is required'),
|
||||
app_password: z.string().min(1, 'Teams app_password is required'),
|
||||
allowed_conversation_ids: z.array(z.string()).default([]),
|
||||
require_mention: z.boolean().default(true),
|
||||
}).optional();
|
||||
|
||||
const browserSchema = z.object({
|
||||
enabled: z.boolean().default(false),
|
||||
executable_path: z.string().optional(),
|
||||
@@ -578,6 +585,7 @@ export const configSchema = z.object({
|
||||
whatsapp: whatsappSchema,
|
||||
matrix: matrixSchema,
|
||||
signal: signalSchema,
|
||||
teams: teamsSchema,
|
||||
server: serverSchema.default({}),
|
||||
models: modelsSchema,
|
||||
backends: backendsSchema.default({}),
|
||||
@@ -623,6 +631,7 @@ export type SlackConfig = z.infer<typeof slackSchema>;
|
||||
export type WhatsAppConfig = z.infer<typeof whatsappSchema>;
|
||||
export type MatrixConfig = z.infer<typeof matrixSchema>;
|
||||
export type SignalConfig = z.infer<typeof signalSchema>;
|
||||
export type TeamsConfig = z.infer<typeof teamsSchema>;
|
||||
export type RetryPolicyConfig = z.infer<typeof retrySchema>;
|
||||
export type ContextLevel = z.infer<typeof contextLevelSchema>;
|
||||
export type PromptConfig = z.infer<typeof promptSchema>;
|
||||
|
||||
Reference in New Issue
Block a user