AI 小说工坊:主编 + 作家多模型协作写作应用
- Nuxt 4 + Nuxt UI 4 + AI SDK 7 + Drizzle/SQLite - 主编规划大纲与章节简报、选派作家;作家流式写入章节文件并实时推送前端 - 逐章确认模式(默认)与自动模式;摘要与故事记忆 - 酒馆角色卡(PNG/JSON,V1-V3)与世界书导入 - 自定义最高优先级系统提示词、审稿/修改/多版本、任务日志与提示词检视 - 模拟 LLM 服务与端到端测试脚本 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
export const modelSchema = z.object({
|
||||
providerId: z.string().min(1),
|
||||
label: z.string().default(''),
|
||||
modelId: z.string().min(1),
|
||||
temperature: z.number().min(0).max(2).nullable().default(null),
|
||||
topP: z.number().min(0).max(1).nullable().default(null),
|
||||
maxOutputTokens: z.number().int().positive().nullable().default(null)
|
||||
})
|
||||
|
||||
export const requirementsSchema = z.object({
|
||||
style: z.string(),
|
||||
language: z.string(),
|
||||
pov: z.string(),
|
||||
narration: z.string(),
|
||||
wordsPerChapter: z.number().int().min(100).max(50000),
|
||||
extra: z.string()
|
||||
})
|
||||
|
||||
export const settingsSchema = z.object({
|
||||
autoMode: z.boolean(),
|
||||
pauseAfterBrief: z.boolean(),
|
||||
allowEditorCreateWriters: z.boolean(),
|
||||
prevTailChars: z.number().int().min(0).max(20000),
|
||||
recentSummaryCount: z.number().int().min(0).max(50),
|
||||
maxContinuations: z.number().int().min(0).max(10),
|
||||
autoChapterLimit: z.number().int().min(1).max(200)
|
||||
})
|
||||
|
||||
export const memorySchema = z.object({
|
||||
characterStates: z.array(z.object({ name: z.string(), state: z.string() })),
|
||||
foreshadowing: z.array(z.object({
|
||||
text: z.string(),
|
||||
status: z.enum(['open', 'resolved']),
|
||||
chapter: z.number(),
|
||||
resolvedChapter: z.number().optional()
|
||||
})),
|
||||
timeline: z.array(z.object({ chapter: z.number(), event: z.string() }))
|
||||
})
|
||||
|
||||
export const characterSchema = z.object({
|
||||
name: z.string().min(1),
|
||||
identity: z.string().default(''),
|
||||
description: z.string().default(''),
|
||||
personality: z.string().default(''),
|
||||
speechExamples: z.string().default(''),
|
||||
notes: z.string().default(''),
|
||||
sortOrder: z.number().int().default(0)
|
||||
})
|
||||
|
||||
export const loreSchema = z.object({
|
||||
title: z.string().default(''),
|
||||
keys: z.array(z.string()).default([]),
|
||||
content: z.string().default(''),
|
||||
constant: z.boolean().default(false),
|
||||
enabled: z.boolean().default(true),
|
||||
sortOrder: z.number().int().default(100)
|
||||
})
|
||||
|
||||
export const agentSchema = z.object({
|
||||
role: z.enum(['editor', 'writer', 'summarizer']),
|
||||
name: z.string().min(1),
|
||||
modelId: z.string().nullable().default(null),
|
||||
systemPrompt: z.string().default(''),
|
||||
styleNotes: z.string().default(''),
|
||||
enabled: z.boolean().default(true)
|
||||
})
|
||||
Reference in New Issue
Block a user