(prompt: string)
| 378 | } |
| 379 | |
| 380 | function autoTitleFromPrompt(prompt: string): string { |
| 381 | const condensed = prompt.replace(/\s+/g, ' ').trim(); |
| 382 | if (condensed.length === 0) return 'Untitled design'; |
| 383 | return condensed.length > 40 ? `${condensed.slice(0, 40).trimEnd()}…` : condensed; |
| 384 | } |
| 385 | |
| 386 | function emitPreflightSetTitle(onEvent: GenerateViaAgentDeps['onEvent'], title: string): void { |
| 387 | if (!onEvent) return; |