吸收数字员工步骤自动调度
This commit is contained in:
@@ -3241,6 +3241,7 @@ function buildNotifications(snapshot: QimingclawSnapshot | null, state: AdapterS
|
||||
...approvalActionNotifications(snapshot),
|
||||
...syncFailureNotifications(snapshot),
|
||||
...managedServiceNotifications(snapshot),
|
||||
...planStepDispatchNotifications(snapshot),
|
||||
...taskNotifications(snapshot),
|
||||
]);
|
||||
const overlays = state.notificationStateById ?? {};
|
||||
@@ -3353,6 +3354,28 @@ function taskNotifications(snapshot: QimingclawSnapshot | null): UserNotificatio
|
||||
});
|
||||
}
|
||||
|
||||
function planStepDispatchNotifications(snapshot: QimingclawSnapshot | null): UserNotification[] {
|
||||
return runtimeEvents(snapshot)
|
||||
.filter((event) => event.kind === 'plan_step_dispatch_failed')
|
||||
.map((event) => {
|
||||
const payload = asRecord(event.payload) ?? {};
|
||||
const stepId = stringValue(payload.step_id) || event.id;
|
||||
const reason = stringValue(payload.reason);
|
||||
return {
|
||||
notification_id: `plan-step-dispatch:${stepId}:${slugifyIdPart(event.occurredAt)}`,
|
||||
plan_id: event.planId ?? stringValue(payload.plan_id),
|
||||
task_id: event.taskId ?? stringValue(payload.task_id),
|
||||
kind: 'task_failed',
|
||||
title: 'Ready 步骤派发失败',
|
||||
body: reason ? `${stepId}:${reason}` : (event.message || stepId),
|
||||
level: 'error',
|
||||
status: 'unread',
|
||||
correlation_id: stepId,
|
||||
created_at: event.occurredAt,
|
||||
} satisfies UserNotification;
|
||||
});
|
||||
}
|
||||
|
||||
function applyNotificationOverlay(notification: UserNotification, overlay?: NotificationState): UserNotification {
|
||||
if (!overlay) return notification;
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user