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
| 1 | import type { PreviewStreamControl } from "@t3tools/client-runtime/preview/server-browser-stream"; |
| 2 | |
| 3 | type Dialog = PreviewStreamControl["dialog"]; |
| 4 | |
| 5 | export function previewPromptText(previous: Dialog, next: Dialog, draft: string) { |
| 6 | if ( |
| 7 | next?.type !== previous?.type || |
| 8 | next?.message !== previous?.message || |
| 9 | next?.defaultValue !== previous?.defaultValue |
| 10 | ) { |
| 11 | return next?.defaultValue ?? ""; |
| 12 | } |
| 13 | return draft; |
| 14 | } |