| 1 | import type { DictKey } from "./i18n"; |
| 2 | |
| 3 | export type MessageActionScope = "fork" | "fork-worktree" | "summ-from" | "summ-upto" | "conversation" | "code" | "both"; |
| 4 | export type MessageActionState = { turn: number; scope: MessageActionScope }; |
| 5 | |
| 6 | export function messageActionLabelKey(scope: MessageActionScope, confirming: boolean): DictKey { |
| 7 | switch (scope) { |
| 8 | case "fork-worktree": return confirming ? "rewind.confirmForkWorktree" : "rewind.forkWorktree"; |
| 9 | case "fork": return confirming ? "rewind.confirmFork" : "rewind.forkConversation"; |
| 10 | case "summ-from": return confirming ? "rewind.confirmSummFrom" : "rewind.summFrom"; |
| 11 | case "summ-upto": return confirming ? "rewind.confirmSummUpto" : "rewind.summUpto"; |
| 12 | case "conversation": return confirming ? "rewind.confirmConversation" : "rewind.conversation"; |
| 13 | case "code": return confirming ? "rewind.confirmCode" : "rewind.code"; |
| 14 | default: return confirming ? "rewind.confirmBoth" : "rewind.both"; |
| 15 | } |
| 16 | } |
| 17 |