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

main
ts 14 lines 519 Bytes
Raw
1 export type ThreadTitleRenameResolution =
2 | { readonly action: "rename"; readonly title: string }
3 | { readonly action: "noop" }
4 | { readonly action: "reject-empty" };
5
6 export function resolveThreadTitleRename(input: {
7 readonly title: string;
8 readonly originalTitle: string;
9 }): ThreadTitleRenameResolution {
10 const title = input.title.trim();
11 if (title.length === 0) return { action: "reject-empty" };
12 if (title === input.originalTitle) return { action: "noop" };
13 return { action: "rename", title };
14 }