feat: 完善 help 说明及多项功能优化
This commit is contained in:
22
app/run.go
22
app/run.go
@@ -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{
|
||||
|
||||
@@ -198,7 +198,7 @@ func (rt *Runtime) Start(prompt string) error {
|
||||
}
|
||||
|
||||
promptText := fmt.Sprintf(
|
||||
"请创作一部小说,章节数量由你根据故事需要自行决定。若题材与冲突天然适合长篇连载,请优先规划为分层长篇结构,而不是压缩成短篇式梗概。要求如下:\n\n%s",
|
||||
"请创作一部小说。若需求中有明确章节数,请严格遵守;若无明确章节数且题材适合长篇连载,请优先规划为分层长篇结构。要求如下:\n\n%s",
|
||||
prompt,
|
||||
)
|
||||
if err := rt.coordinator.Prompt(promptText); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user