| 64 | |
| 65 | /** Input block, like a TUI's call preview: trimmed lines, capped count. */ |
| 66 | const inputPreview = (input: string | undefined): string[] | undefined => { |
| 67 | if (!input) return undefined; |
| 68 | const lines = input |
| 69 | .split("\n") |
| 70 | .map((line) => line.trimEnd()) |
| 71 | .filter((line) => line.trim().length > 0); |
| 72 | return lines.length > 7 ? [...lines.slice(0, 6), `… +${lines.length - 6} lines`] : lines; |
| 73 | }; |
| 74 | |
| 75 | const makeTheater = (push: (event: TheaterEvent) => Effect.Effect<void>): ChatTheater => ({ |
| 76 | user: (text) => push({ type: "user", text }), |