import HapiUI import SwiftUI let toolTextPageSize = 20_000 /// Character boundaries preserve Unicode exactly; concatenating pages is the /// original payload, including newlines and trailing whitespace. func toolTextPages(_ text: String) -> [String] { var pages: [String] = [] var start = text.startIndex while start < text.endIndex { let end = text.index(start, offsetBy: toolTextPageSize, limitedBy: text.endIndex) ?? text.endIndex pages.append(String(text[start..