| 1 | import type { OrchestrationV2UserMessageInputIntent } from "@t3tools/contracts"; |
| 2 | |
| 3 | export interface UserMessageIntentBadgePresentation { |
| 4 | readonly label: string; |
| 5 | readonly accessibilityLabel: string; |
| 6 | readonly tone: "queued" | "steer"; |
| 7 | } |
| 8 | |
| 9 | export function resolveUserMessageIntentBadge( |
| 10 | intent: OrchestrationV2UserMessageInputIntent | undefined, |
| 11 | ): UserMessageIntentBadgePresentation | null { |
| 12 | switch (intent) { |
| 13 | case "queued_turn": |
| 14 | return { |
| 15 | label: "queued", |
| 16 | accessibilityLabel: "Queued behind the active turn", |
| 17 | tone: "queued", |
| 18 | }; |
| 19 | case "steer": |
| 20 | return { |
| 21 | label: "steer", |
| 22 | accessibilityLabel: "Steered the active turn", |
| 23 | tone: "steer", |
| 24 | }; |
| 25 | case "promoted_queued_to_steer": |
| 26 | return { |
| 27 | label: "queued → steer", |
| 28 | accessibilityLabel: "Originally queued, then promoted to steer the active turn", |
| 29 | tone: "steer", |
| 30 | }; |
| 31 | case "turn_start": |
| 32 | case undefined: |
| 33 | return null; |
| 34 | } |
| 35 | } |