@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 42 lines 1.38 KB
Raw
1 import type { OrchestrationV2UserMessageInputIntent } from "@t3tools/contracts";
2 import { msg } from "gt-react-native";
3
4 import { m, type MessageResolver } from "../../i18n/messages";
5
6 export interface UserMessageIntentBadgePresentation {
7 readonly label: string;
8 readonly accessibilityLabel: string;
9 }
10
11 export function resolveUserMessageIntentBadge(
12 intent: OrchestrationV2UserMessageInputIntent | undefined,
13 unread = false,
14 resolve: MessageResolver = m,
15 ): UserMessageIntentBadgePresentation | null {
16 if (unread && (intent === "steer" || intent === "promoted_queued_to_steer")) {
17 return {
18 label: resolve(msg("Steer · waiting to be read")),
19 accessibilityLabel: resolve(
20 msg("Steer waiting for the agent to read it after the running command finishes"),
21 ),
22 };
23 }
24 switch (intent) {
25 case "steer":
26 return {
27 label: resolve(msg("Steer", { $context: "badge, message sent into the running turn" })),
28 accessibilityLabel: resolve(msg("Steered the active turn")),
29 };
30 case "promoted_queued_to_steer":
31 return {
32 label: resolve(msg("Steer", { $context: "badge, message sent into the running turn" })),
33 accessibilityLabel: resolve(
34 msg("Originally queued, then promoted to steer the active turn"),
35 ),
36 };
37 case "queued_turn":
38 case "turn_start":
39 case undefined:
40 return null;
41 }
42 }