section 3: Phase 3: Auto-accept engine, default stamping and notificati

This commit is contained in:
Chris Scott committed 2026-10-03 09:18:14 -04:00
1 parent 66e6c20f8e
commit f85531f2d3
6 files changed
+391 -27

No files matched your search

+11
View File
@@ -139,9 +139,12 @@ export function buildEventNotificationPayload(
};
}
type EventSuppressor = (event: SSEEvent, sessionId: string | undefined) => Promise<boolean>;
export class NotificationService {
private vapidConfig: VapidConfig | null = null;
private settingsService: SettingsService;
private eventSuppressors: EventSuppressor[] = [];
constructor(private db: Database) {
this.settingsService = new SettingsService(db);
@@ -178,6 +181,10 @@ export class NotificationService {
return this.vapidConfig?.publicKey ?? null;
}
addEventSuppressor(suppressor: EventSuppressor): void {
this.eventSuppressors.push(suppressor);
}
isConfigured(): boolean {
return this.vapidConfig !== null;
}
@@ -321,6 +328,10 @@ export class NotificationService {
if (sessionId && sseAggregator.isSessionBeingViewed(sessionId)) return;
if (sessionId && sseAggregator.isSubagentSession(sessionId)) return;
for (const suppressor of this.eventSuppressors) {
if (await suppressor(event, sessionId)) return;
}
if (!this.isConfigured()) return;
const userIds = this.getAllUserIds();