feat(#382): Herald Service: broadcast to all active chat providers
Some checks failed
ci/woodpecker/push/api Pipeline failed

- Replace direct DiscordService injection with CHAT_PROVIDERS array
- Herald broadcasts to ALL active chat providers (Discord, Matrix, future)
- Graceful error handling — one provider failure doesn't block others
- Skips disconnected providers automatically
- Tests verify multi-provider broadcasting behavior
- Fix lint: remove unnecessary conditional in matrix.service.ts

Refs #382
This commit is contained in:
2026-02-15 02:25:55 -06:00
parent 4a9ecab4dd
commit ad24720616
8 changed files with 859 additions and 424 deletions

View File

@@ -1,6 +1,8 @@
import { Logger, Module } from "@nestjs/common";
import { DiscordService } from "./discord/discord.service";
import { MatrixService } from "./matrix/matrix.service";
import { MatrixRoomService } from "./matrix/matrix-room.service";
import { CommandParserService } from "./parser/command-parser.service";
import { StitcherModule } from "../stitcher/stitcher.module";
import { CHAT_PROVIDERS } from "./bridge.constants";
import type { IChatProvider } from "./interfaces";
@@ -20,10 +22,15 @@ const logger = new Logger("BridgeModule");
*
* Both bridges can run simultaneously, and no error occurs if neither is configured.
* Consumers should inject CHAT_PROVIDERS for bridge-agnostic access to all active providers.
*
* CommandParserService provides shared, platform-agnostic command parsing.
* MatrixRoomService handles workspace-to-Matrix-room mapping.
*/
@Module({
imports: [StitcherModule],
providers: [
CommandParserService,
MatrixRoomService,
DiscordService,
MatrixService,
{
@@ -50,6 +57,6 @@ const logger = new Logger("BridgeModule");
inject: [DiscordService, MatrixService],
},
],
exports: [DiscordService, MatrixService, CHAT_PROVIDERS],
exports: [DiscordService, MatrixService, MatrixRoomService, CommandParserService, CHAT_PROVIDERS],
})
export class BridgeModule {}