feat: 完善 help 说明及多项功能优化

This commit is contained in:
shiyue
2026-03-18 00:20:12 +08:00
parent b23ac0fb6b
commit 40a3479e2a
9 changed files with 82 additions and 9 deletions

View File

@@ -93,7 +93,7 @@ func Run(cfg Config, refs tools.References, prompts Prompts, styles map[string]s
}
log.Printf("新建模式:%s", cfg.NovelName)
promptText := fmt.Sprintf(
"请创作一部小说,章节数量由你根据故事需要自行决定。若题材与冲突天然适合长篇连载,请优先规划为分层长篇结构,而不是压缩成短篇式梗概。要求如下:\n\n%s",
"请创作一部小说。若需求中有明确章节数,请严格遵守;若无明确章节数且题材适合长篇连载,请优先规划为分层长篇结构。要求如下:\n\n%s",
cfg.Prompt,
)
if err := coordinator.Prompt(promptText); err != nil {
@@ -302,7 +302,7 @@ type recoveryResult struct {
// determineRecovery 根据 Progress 和 RunMeta 判断恢复类型和 Prompt 文本。
// 章节总数完全来自 Progress.TotalChapters由大纲自动设定不再由外部传入。
func determineRecovery(progress *domain.Progress, runMeta *domain.RunMeta) recoveryResult {
if progress == nil {
if progress == nil || progress.Phase == domain.PhaseInit {
return recoveryResult{IsNew: true}
}
guidance := planningTierGuidance(runMeta)
@@ -313,6 +313,24 @@ func determineRecovery(progress *domain.Progress, runMeta *domain.RunMeta) recov
return prompt + "\n" + guidance
}
// 规划阶段恢复premise 已保存但 outline/characters 尚未完成
if progress.Phase == domain.PhasePremise {
return recoveryResult{
PromptText: withGuidance("前提设定已保存,但大纲/角色设定尚未完成。请调用 novel_context 查看已有设定,然后继续完成 outline、characters、world_rules 的规划,完成后开始逐章写作。"),
Label: "规划恢复:继续生成大纲/角色设定",
}
}
// 规划阶段恢复outline 已保存但写作尚未开始
if progress.Phase == domain.PhaseOutline {
return recoveryResult{
PromptText: withGuidance(fmt.Sprintf(
"大纲规划已完成,尚未开始写作。请从第 1 章开始逐章写作,总共需要写 %d 章。",
progress.TotalChapters)),
Label: fmt.Sprintf("写作恢复大纲就绪从第1章开始共 %d 章)", progress.TotalChapters),
}
}
if progress.InProgressChapter > 0 {
ch := progress.InProgressChapter
return recoveryResult{