吸收数字员工通知跨端同步

This commit is contained in:
baiyanyun
2026-06-11 20:27:10 +08:00
parent 4c862ef4b7
commit 8278fdc81c
15 changed files with 745 additions and 193 deletions

View File

@@ -203,12 +203,16 @@ function checkDigitalNotificationPreferences() {
const shellPath = path.join(packageRoot, "embedded", "sgrobot-digital", "src", "pages", "digital", "DigitalEmployeeShell.tsx");
const stateServicePath = path.join(packageRoot, "src", "main", "services", "digitalEmployee", "stateService.ts");
const syncServicePath = path.join(packageRoot, "src", "main", "services", "digitalEmployee", "syncService.ts");
const ipcHandlersPath = path.join(packageRoot, "src", "main", "ipc", "digitalEmployeeHandlers.ts");
const preloadPath = path.join(packageRoot, "src", "preload", "webviewPerfBridge.ts");
const adapter = fs.readFileSync(adapterPath, "utf8");
const api = fs.readFileSync(apiPath, "utf8");
const types = fs.readFileSync(typesPath, "utf8");
const shell = fs.readFileSync(shellPath, "utf8");
const stateService = fs.readFileSync(stateServicePath, "utf8");
const syncService = fs.readFileSync(syncServicePath, "utf8");
const ipcHandlers = fs.readFileSync(ipcHandlersPath, "utf8");
const preload = fs.readFileSync(preloadPath, "utf8");
const requiredSnippets = [
[adapter, "/api/notifications/preferences", "adapter notification preference endpoint"],
[adapter, "route-decisions|notifications|audits", "management notification business route"],
@@ -220,20 +224,41 @@ function checkDigitalNotificationPreferences() {
[adapter, "task_input_recorded", "notification reply task input result"],
[adapter, "provide_task_input", "notification reply governance command"],
[adapter, "handleNotificationPreferencesPatch", "adapter notification preference patch handler"],
[adapter, "/api/notifications/updates/pull", "adapter notification updates pull endpoint"],
[adapter, "pullBridgeNotificationUpdates", "adapter notification updates bridge pull helper"],
[adapter, "submitNotificationAction", "adapter notification action bridge declaration"],
[adapter, "submitBridgeNotificationAction", "adapter notification action bridge submit helper"],
[adapter, "notificationMatchesPreferences", "adapter notification preference filter"],
[adapter, "update_notification_preferences", "adapter notification preference save action"],
[api, "getNotificationPreferences", "notification preferences API getter"],
[api, "patchNotificationPreferences", "notification preferences API patcher"],
[api, "pullNotificationUpdates", "embedded notification updates API"],
[types, "NotificationPreferences", "notification preferences type"],
[types, "NotificationUpdatesPullResult", "notification updates pull result type"],
[shell, "de-notification-preferences", "notification preferences UI"],
[shell, "handleNotificationSync", "notification manual sync UI action"],
[shell, "NOTIFICATION_KIND_OPTIONS", "notification kind mute UI options"],
[stateService, "update_notification_preferences", "notification preference runtime event"],
[stateService, "notification_updates_pulled", "notification updates pulled runtime event"],
[stateService, "notification_action_submitted", "notification action submitted runtime event"],
[syncService, "pullDigitalEmployeeNotificationUpdates", "remote notification updates pull service"],
[syncService, "submitDigitalEmployeeNotificationAction", "remote notification action submit service"],
[syncService, "/api/digital-employee/notifications/updates", "remote notification updates default path"],
[syncService, "/api/digital-employee/notifications/actions", "remote notification actions default path"],
[syncService, "notificationUpdatesEndpoint", "notification updates endpoint config"],
[syncService, "notificationActionsEndpoint", "notification actions endpoint config"],
[syncService, "notificationBusinessView", "notification sync business view"],
[syncService, "digital_workday_notification_updates_pulled", "notification updates sync event kind"],
[syncService, "digital_workday_notification_action_submitted", "notification action sync event kind"],
[syncService, "governanceProvideTaskInputBusinessView", "notification reply task input sync view"],
[syncService, "governance_provide_task_input", "task input sync event kind"],
[syncService, "input_length", "task input sync redacted length"],
[syncService, "isNotificationEvent", "notification event classifier"],
[syncService, "return \"notification\"", "notification business category"],
[ipcHandlers, "digitalEmployee:pullNotificationUpdates", "IPC notification updates pull handler"],
[ipcHandlers, "digitalEmployee:submitNotificationAction", "IPC notification action submit handler"],
[preload, "pullNotificationUpdates", "preload notification updates bridge"],
[preload, "submitNotificationAction", "preload notification action bridge"],
];
const missing = requiredSnippets
.filter(([content, snippet]) => !content.includes(snippet))