fix(runner): align editable draft bounds with Unicode schema lengths

Count initialText Unicode code points consistently in TypeScript, Zod, JSON Schema and Rust. Keep submitted-answer UTF-16 limits unchanged, with mixed BMP and astral boundary tests inside the wire byte cap.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-09-29 12:39:25 -05:00
1 parent c2b0c804cb
commit 4f9506072c
13 files changed
+68 -15

No files matched your search

+1 -1
View File
@@ -1251,7 +1251,7 @@ const paperclipQuestionSchema = z
helpText: z.string().max(4000).optional(),
required: z.boolean(),
answerMode: z.enum(["single_select", "multi_select", "text"]),
initialText: z.string().max(100000).optional(),
initialText: z.string().refine(value => value.length <= 200000 && Array.from(value).length <= 100000, "initial text exceeds 100000 Unicode code points").optional(),
options: z.array(paperclipQuestionOptionSchema).max(128).optional(),
customAnswer: z
.object({