Open History to see the last commit
1import type { OrchestrationV2UserMessageInputIntent } from "@t3tools/contracts";
2
3export interface UserMessageIntentBadgePresentation {
4 readonly label: string;
5 readonly accessibilityLabel: string;
6 readonly explanation: string;
7 readonly tone: "queued" | "steer";
8}
9
10export function resolveUserMessageIntentBadge(
11 intent: OrchestrationV2UserMessageInputIntent | undefined,
12): UserMessageIntentBadgePresentation | null {
13 switch (intent) {
14 case "queued_turn":
15 return {
16 label: "from queue",
17 accessibilityLabel: "Queued while the agent was busy",
18 explanation:
19 "This badge records that the message was queued. It stays visible after the message leaves the queue.",
20 tone: "queued",
21 };
22 case "steer":
23 return {
24 label: "steer",
25 accessibilityLabel: "Steered the active turn",
26 explanation:
27 "This message was intended to steer the agent while its turn was still running.",
28 tone: "steer",
29 };
30 case "promoted_queued_to_steer":
31 return {
32 label: "queued → steer",
33 accessibilityLabel: "Originally queued, then promoted to steer the active turn",
34 explanation:
35 "This message was originally queued, then promoted to steer the agent while its turn was still running.",
36 tone: "steer",
37 };
38 case "turn_start":
39 case undefined:
40 return null;
41 }
42}