Explorar o código

feat(story-simulation): 添加内容区域路由和占位主视图

Mochocyang hai 3 meses
pai
achega
9281414bc6

+ 12 - 0
src/components/layout/content-area.tsx

@@ -48,6 +48,11 @@ const BookAnalysisView = lazy(async () => {
   return { default: mod.BookAnalysisView }
 })
 
+const StorySimulationView = lazy(async () => {
+  const mod = await import("@/components/novel/story-simulation/story-simulation-view")
+  return { default: mod.StorySimulationView }
+})
+
 function LoadingView() {
   return (
     <div className="flex h-full items-center justify-center text-sm text-muted-foreground">
@@ -118,6 +123,13 @@ export function ContentArea() {
           </Suspense>
         )
         break
+      case "storySimulation":
+        content = (
+          <Suspense fallback={<LoadingView />}>
+            <StorySimulationView />
+          </Suspense>
+        )
+        break
       default:
         content = (
           <Suspense fallback={<LoadingView />}>

+ 15 - 0
src/components/novel/story-simulation/story-simulation-view.tsx

@@ -0,0 +1,15 @@
+import { useWikiStore } from "@/stores/wiki-store"
+import { useTranslation } from "react-i18next"
+
+export function StorySimulationView() {
+  const { t } = useTranslation()
+  const projectPath = useWikiStore((s) => s.project?.path)
+
+  return (
+    <div className="flex h-full flex-col items-center justify-center gap-4 p-8">
+      <h2 className="text-2xl font-bold">{t("storySimulation.title")}</h2>
+      <p className="text-muted-foreground">{t("storySimulation.description")}</p>
+      <p className="text-sm text-muted-foreground">项目路径: {projectPath}</p>
+    </div>
+  )
+}

+ 74 - 0
src/i18n/en.json

@@ -1110,6 +1110,7 @@
       "lint": "Memory Center",
       "soul": "Soul",
       "reviewCenter": "Review Center",
+      "storySimulation": "Story Simulation",
       "dismantling": "Dismantling",
       "settings": "模型与写作设置",
       "switchProject": "Switch Project"
@@ -1713,5 +1714,78 @@
         "conflicts": "Conflicts"
       }
     }
+  },
+  "storySimulation": {
+    "title": "Story Simulation Room",
+    "description": "Simulate character behavior and plot development through multi-agent simulation",
+    "selectMode": "Select Simulation Mode",
+    "modeEventDriven": "Event-Driven",
+    "modeFreeEmergence": "Free Emergence",
+    "modeDecisionTree": "Decision Tree",
+    "modeHybrid": "Hybrid",
+    "modeEventDrivenDesc": "Inject a trigger event, simulate character reactions",
+    "modeFreeEmergenceDesc": "Let characters interact freely, observe emergent plot",
+    "modeDecisionTreeDesc": "Generate decision branches for key characters",
+    "modeHybridDesc": "Combine free emergence with event injection",
+    "yourIdea": "Your Idea (Optional)",
+    "yourIdeaPlaceholder": "Enter your thoughts on plot direction...",
+    "targetWords": "Target Word Count",
+    "words10k": "10,000 words",
+    "words30k": "30,000 words",
+    "words50k": "50,000 words",
+    "wordsCustom": "Custom",
+    "sourceChapters": "Source Chapters",
+    "recentChapters": "Recent",
+    "chapters": "chapters",
+    "startExtract": "Start Extraction & Generate Framework",
+    "extracting": "Extracting content...",
+    "extractProgress": "Extraction Progress",
+    "frameworkTitle": "Story Framework",
+    "frameworkPremise": "Premise",
+    "frameworkNodes": "Story Nodes",
+    "regenerateFramework": "Regenerate Framework",
+    "saveFramework": "Save Framework",
+    "confirmFramework": "Confirm & Start Simulation",
+    "simulating": "Simulating...",
+    "simulationProgress": "Simulation Progress",
+    "reportTitle": "Simulation Report",
+    "characterAnalysis": "Character Analysis",
+    "storyBranches": "Story Branches",
+    "recommendation": "Recommendation",
+    "resimulate": "Re-simulate",
+    "generateDraft": "Select Branch & Generate Draft",
+    "draftTitle": "Story Draft",
+    "exportDraft": "Export",
+    "copyAll": "Copy All",
+    "importToChapters": "Import to Chapters",
+    "discard": "Discard",
+    "frameworkList": "Story Frameworks",
+    "newFramework": "New Framework",
+    "bindToChat": "Bind to AI Chat",
+    "unbindFromChat": "Unbind",
+    "bindingTitle": "Bind Story Framework to AI Chat",
+    "selectFramework": "Select Framework",
+    "targetChapterCount": "Target Chapter Count",
+    "confirmBinding": "Confirm Binding",
+    "bindingHint": "After binding, AI chat will follow this framework to analyze how chapters advance the story",
+    "noFrameworks": "No frameworks yet. Click the button above to create one.",
+    "noResults": "No simulation results yet",
+    "phase": "Phase",
+    "conflict": "Conflict",
+    "characters": "Characters",
+    "goal": "Goal",
+    "cause": "Cause",
+    "expectedOutcome": "Expected Outcome",
+    "consistencyScore": "Consistency Score",
+    "probability": "Probability",
+    "probabilityHigh": "High",
+    "probabilityMedium": "Medium",
+    "probabilityLow": "Low",
+    "pros": "Pros",
+    "cons": "Cons",
+    "actualWords": "Actual Words",
+    "totalWords": "Total Words",
+    "error": "Error",
+    "retry": "Retry"
   }
 }

+ 74 - 0
src/i18n/zh.json

@@ -991,6 +991,7 @@
       "lint": "记忆中心",
       "soul": "灵魂",
       "reviewCenter": "审查中心",
+      "storySimulation": "剧情推演室",
       "dismantling": "拆文库",
       "settings": "模型与写作设置",
       "switchProject": "切换小说"
@@ -1590,5 +1591,78 @@
         "conflicts": "冲突与矛盾"
       }
     }
+  },
+  "storySimulation": {
+    "title": "剧情推演室",
+    "description": "通过多 Agent 仿真推演小说角色在给定情境下的行为选择和剧情走向",
+    "selectMode": "选择仿真模式",
+    "modeEventDriven": "事件驱动",
+    "modeFreeEmergence": "自由涌现",
+    "modeDecisionTree": "决策树",
+    "modeHybrid": "混合模式",
+    "modeEventDrivenDesc": "注入一个触发事件,推演各角色反应和连锁效应",
+    "modeFreeEmergenceDesc": "让角色根据目标自由互动,涌现剧情走向",
+    "modeDecisionTreeDesc": "为关键角色生成多个决策分支,对比连锁反应",
+    "modeHybridDesc": "自由涌现与事件驱动结合,生成多条可能分支",
+    "yourIdea": "你的思路(可选)",
+    "yourIdeaPlaceholder": "输入你对剧情走向的想法或约束...",
+    "targetWords": "目标字数",
+    "words10k": "10000字",
+    "words30k": "30000字",
+    "words50k": "50000字",
+    "wordsCustom": "自定义",
+    "sourceChapters": "提取章节数量",
+    "recentChapters": "最近",
+    "chapters": "章",
+    "startExtract": "开始提取并生成框架",
+    "extracting": "正在提取内容...",
+    "extractProgress": "提取进度",
+    "frameworkTitle": "故事框架",
+    "frameworkPremise": "前提",
+    "frameworkNodes": "故事节点",
+    "regenerateFramework": "重新生成框架",
+    "saveFramework": "保存框架",
+    "confirmFramework": "确认框架,开始推演",
+    "simulating": "正在推演...",
+    "simulationProgress": "推演进度",
+    "reportTitle": "推演报告",
+    "characterAnalysis": "角色行为分析",
+    "storyBranches": "走向分支",
+    "recommendation": "综合推荐",
+    "resimulate": "重新推演",
+    "generateDraft": "选择分支,生成草稿",
+    "draftTitle": "故事草稿",
+    "exportDraft": "导出",
+    "copyAll": "复制全部",
+    "importToChapters": "导入到章节",
+    "discard": "丢弃",
+    "frameworkList": "故事框架",
+    "newFramework": "新建故事框架",
+    "bindToChat": "绑定到 AI 会话",
+    "unbindFromChat": "取消绑定",
+    "bindingTitle": "绑定故事框架到 AI 会话",
+    "selectFramework": "选择框架",
+    "targetChapterCount": "生成章节数",
+    "confirmBinding": "确认绑定",
+    "bindingHint": "绑定后,AI 会话将按此框架分析指定章节数如何推动故事发展",
+    "noFrameworks": "暂无故事框架,点击上方按钮开始创建",
+    "noResults": "暂无推演结果",
+    "phase": "阶段",
+    "conflict": "冲突",
+    "characters": "角色",
+    "goal": "目标",
+    "cause": "起因",
+    "expectedOutcome": "预期走向",
+    "consistencyScore": "人设一致性",
+    "probability": "概率",
+    "probabilityHigh": "高",
+    "probabilityMedium": "中",
+    "probabilityLow": "低",
+    "pros": "优势",
+    "cons": "不足",
+    "actualWords": "实际字数",
+    "totalWords": "总字数",
+    "error": "错误",
+    "retry": "重试"
   }
 }