managarten/services/matrix-mana-bot/src/app.module.ts
Till-JS dcf4438804 feat(mana-bot): add daily morning summary feature
Add configurable morning summaries that aggregate data from multiple sources:
- Weather forecast via Open-Meteo API (free, no API key needed)
- Today's calendar events
- Today's tasks + overdue tasks
- Birthdays from contacts
- Plants needing water from Planta

New commands:
- !morning / !morgen - Get summary now
- !morning-on/off - Enable/disable automatic delivery
- !morning-time HH:MM - Set delivery time
- !morning-location [city] - Set weather location
- !morning-timezone [zone] - Set timezone
- !morning-format [kompakt|ausfuehrlich] - Set format
- !morning-settings - Show current settings

New shared services in @manacore/bot-services:
- WeatherService - Open-Meteo integration with geocoding
- ContactsApiService - Birthday fetching
- PlantaApiService - Watering schedule
- MorningSummaryService - Aggregates all sources
- MorningPreferencesService - User preferences storage

Includes scheduler for automatic daily delivery at user-configured time.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-17 11:01:47 +01:00

76 lines
2.1 KiB
TypeScript

import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { HealthController, createHealthProvider } from '@manacore/matrix-bot-common';
import configuration from './config/configuration';
import { BotModule } from './bot/bot.module';
import { HandlersModule } from './handlers/handlers.module';
import { OrchestrationModule } from './orchestration/orchestration.module';
import { SchedulerModule } from './scheduler/scheduler.module';
// Import shared services from bot-services package
import { TodoModule, CalendarModule, AiModule, ClockModule } from '@manacore/bot-services';
@Module({
imports: [
ConfigModule.forRoot({
isGlobal: true,
load: [configuration],
}),
// Business Logic Modules from shared package (global: true makes them available everywhere)
{
...TodoModule.registerAsync({
imports: [ConfigModule],
useFactory: (config: ConfigService) => ({
storagePath: config.get('services.todo.storagePath'),
}),
inject: [ConfigService],
}),
global: true,
},
{
...CalendarModule.registerAsync({
imports: [ConfigModule],
useFactory: (config: ConfigService) => ({
storagePath: config.get('services.calendar.storagePath'),
}),
inject: [ConfigService],
}),
global: true,
},
{
...AiModule.registerAsync({
imports: [ConfigModule],
useFactory: (config: ConfigService) => ({
baseUrl: config.get('services.ai.baseUrl'),
defaultModel: config.get('services.ai.defaultModel'),
timeout: config.get('services.ai.timeout'),
}),
inject: [ConfigService],
}),
global: true,
},
{
...ClockModule.registerAsync({
imports: [ConfigModule],
useFactory: (config: ConfigService) => ({
apiUrl: config.get('services.clock.apiUrl'),
}),
inject: [ConfigService],
}),
global: true,
},
// Gateway-specific modules
BotModule,
HandlersModule,
OrchestrationModule,
SchedulerModule,
],
controllers: [HealthController],
providers: [createHealthProvider('matrix-mana-bot')],
})
export class AppModule {}