1import type { OrchestrationV2UserMessageInputIntent } from "@t3tools/contracts";
2
3export interface UserMessageIntentBadgePresentation {
4 readonly label: string;
5 readonly accessibilityLabel: string;
6}
7
8export function resolveUserMessageIntentBadge(
9 intent: OrchestrationV2UserMessageInputIntent | undefined,
10 unread = false,
11): UserMessageIntentBadgePresentation | null {
12 if (unread && (intent === "steer" || intent === "promoted_queued_to_steer")) {
13 return {
14 label: "Steer · waiting to be read",
15 accessibilityLabel:
16 "Steer waiting for the agent to read it after the running command finishes",
17 };
18 }
19 switch (intent) {
20 case "steer":
21 return {
22 label: "Steer",
23 accessibilityLabel: "Steered the active turn",
24 };
25 case "promoted_queued_to_steer":
26 return {
27 label: "Steer",
28 accessibilityLabel: "Originally queued, then promoted to steer the active turn",
29 };
30 case "queued_turn":
31 case "turn_start":
32 case undefined:
33 return null;
34 }
35}