Add AI-assisted world and character drafting flows
All checks were successful
CI / validate (push) Successful in 14m3s

This commit is contained in:
2026-08-17 09:25:37 +05:00
parent 830aa5dc1f
commit cdeea8653c
23 changed files with 811 additions and 92 deletions

View File

@@ -45,6 +45,30 @@ export const WorldStarterSchema = z.object({
})
export type WorldStarter = z.infer<typeof WorldStarterSchema>
export const CharacterPersonaSchema = z.object({
voice: z.string().trim().min(1).max(240),
motivation: z.string().trim().min(1).max(300),
flaw: z.string().trim().min(1).max(300),
bond: z.string().trim().min(1).max(300),
})
export type CharacterPersona = z.infer<typeof CharacterPersonaSchema>
export const CharacterDraftSchema = z.object({
name: z.string().trim().min(1).max(80),
concept: z.string().trim().min(3).max(600),
abilities: AbilityScoresSchema,
hp: z.number().int().min(1).max(100),
maxHp: z.number().int().min(1).max(100),
defense: z.number().int().min(1).max(40),
proficiency: z.number().int().min(1).max(10),
inventory: z.array(z.string().trim().min(1).max(120)).max(12),
persona: CharacterPersonaSchema,
}).strict().refine(value => value.hp <= value.maxHp, {
message: 'hp must not exceed maxHp',
path: ['hp'],
})
export type CharacterDraft = z.infer<typeof CharacterDraftSchema>
export const CharacterSchema = z.object({
id: z.string().min(1),
name: z.string().min(1).max(80),