feat: add user-configurable notification settings (#601)

This commit is contained in:
PRAKHAR PANDEY 2026-06-11 19:43:26 +05:30 committed by GitHub
parent faaefe936f
commit 0d21abcc7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 330 additions and 5 deletions

View file

@ -0,0 +1,36 @@
import { z } from 'zod';
/**
* Notification categories the user can independently toggle.
*
* - chat_completion: an agent finished generating a response
* - new_email: a new email arrived during incremental Gmail sync
* - agent_permission: an agent is requesting permission to run a tool
*/
export const NotificationCategorySchema = z.enum([
'chat_completion',
'new_email',
'agent_permission',
]);
export const NotificationCategoriesSchema = z.object({
chat_completion: z.boolean(),
new_email: z.boolean(),
agent_permission: z.boolean(),
});
export const NotificationSettingsSchema = z.object({
categories: NotificationCategoriesSchema,
});
export const DEFAULT_NOTIFICATION_SETTINGS: NotificationSettings = {
categories: {
chat_completion: true,
new_email: true,
agent_permission: true,
},
};
export type NotificationCategory = z.infer<typeof NotificationCategorySchema>;
export type NotificationCategories = z.infer<typeof NotificationCategoriesSchema>;
export type NotificationSettings = z.infer<typeof NotificationSettingsSchema>;