feat(workbench): route actionable notifications

This commit is contained in:
2026-09-24 14:57:47 +08:00
parent db778e0bac
commit 7e969e7e8c
4 changed files with 89 additions and 10 deletions
@@ -0,0 +1,33 @@
import type { OperationalTaskNotification } from "../api/operational-task-client";
export type OperationalNotificationCategory =
| "task_exception"
| "human_approval"
| "human_input"
| "external_coordination";
export type OperationalNotificationRoute = {
category: OperationalNotificationCategory;
severity: "warning" | "critical";
};
const NOTIFICATION_ROUTES: Partial<
Record<OperationalTaskNotification["kind"], OperationalNotificationRoute>
> = {
task_failed: { category: "task_exception", severity: "critical" },
run_delivery_degraded: { category: "task_exception", severity: "critical" },
action_pending: { category: "human_approval", severity: "warning" },
access_approval_pending: { category: "human_approval", severity: "warning" },
action_approval_pending: { category: "human_approval", severity: "warning" },
human_input_required: { category: "human_input", severity: "warning" },
external_coordination_failed: {
category: "external_coordination",
severity: "critical"
}
};
export function getOperationalNotificationRoute(
kind: OperationalTaskNotification["kind"]
): OperationalNotificationRoute | null {
return NOTIFICATION_ROUTES[kind] ?? null;
}