import { z } from 'zod'; import { WRITER_DOCUMENT_SECTION_TYPE } from '../../constants'; export const WriterDocumentOutlineSubsectionSchema = z.object({ title: z .string() .min(3) .max(120) .describe( `Concise title of the subsection. Meant to elaborate on its parent section's title.`, ), }); export type WriterDocumentOutlineSubsection = z.infer; export const WriterDocumentOutlineSectionSchema = z.object({ title: z.string().min(3).max(120).describe(`Concise title of the paper section.`), type: z.nativeEnum(WRITER_DOCUMENT_SECTION_TYPE), subsections: z .array(WriterDocumentOutlineSubsectionSchema) .optional() .describe( `Subsections of the paper section. Each subsection is a single idea that is a part of the parent section.`, ), }); export const WriterDocumentOutlineSchema = z.array(WriterDocumentOutlineSectionSchema); export type WriterDocumentOutline = z.infer;