I'll build this comprehensive novel analysis tool. Let me start by exploring the project structure.
Now let me check the available packages and start building this novel analysis tool.
Now let me install the icon library and start building all the components. This is a complex app, so let me plan the architecture:
- Types → Data models for events, characters, states, transitions, diagnostics
- Engine → Analysis pipeline (segmentation → extraction → scoring)
- Store → LocalStorage persistence with React context
- Views → Import, Events, Characters, Transitions, Report
- App → Main layout with sidebar navigation
Good. Now let me create the core files. Starting with types and the analysis engine:
Now the core analysis engine:
Let me fix the type errors in the engine:
Good. Now let me create the store with LocalStorage persistence:
The store file needs to be .tsx since it contains JSX. Let me fix that:
Now let me create the Sidebar component:
Let me fix the imports and add the View type:
Good. Now let me create the Import/Creation view:
Now the Events View:
Now the Characters View:
Now the Transitions View (the core of the identity loop analysis):
Now the Report View (the comprehensive diagnostic report):
Now let me create the main App component that ties everything together:
Now let me try building the project:
Build succeeded! Let me enhance the ImportView to include a demo sample text so users can immediately see the tool in action:
Now let me rebuild:
Build successful. Let me enhance the analysis engine with better Chinese text handling:
Now let me expand the emotion keywords for better Chinese text analysis:
Let me rebuild to verify:
Build successful! Let me add a pipeline visualization to the ReportView showing the analysis flow:
Build successful! Let me check the CSS and add some custom styles if needed:
Let me enhance the CSS with some custom styles:
Final build:
The build is successful. Here's a summary of everything I built:
小说诊断师 — 大纲与角色分析工具
架构概述
一个完整的 5 步分析流水线 浏览器应用:
原始文本/大纲 → 事件分段 → 角色抽取 → 状态快照 → 合理性打分 → 诊断报告
核心功能模块
-
导入/创作页 (ImportView)
- 支持 TXT 文件拖拽上传
- 手写大纲/草稿编辑
- 内置示例小说「破晓之城」可一键体验
-
事件列表 (EventsView)
- 自动将文本分段为原子事件
- 每个事件标注功能分类(推动主线/角色塑造/伏笔/冲突等)
- 情绪分数 + 钩子分数可视化
- 可点击编辑事件功能分类
-
角色追踪 (CharactersView)
- 自动检测中文角色名(基于句法模式)
- 每个角色有时间线状态快照
- 追踪性格特征、目标、行为证据、情绪状态
- 身份循环阶段指示器(0-7)
-
转变检测 (TransitionsView) — 核心功能
- 基于身份循环 8 步骤模型的 Checklist 检查
- 8 项检查:目标变化/认知转变/触发证据/行动连接/重复强化/身份认同/旧身份捍卫/循环连续性
- 转变幅度分类(微调→剧烈突变)
- 自动打分 + 警告 + 改进建议
-
诊断报告 (ReportView)
- 5 维评分:角色一致性/剧情连贯/情绪节奏/钩子效率/身份循环健康度
- 问题列表(按严重程度分类)
- 情绪节奏曲线 + 读者钩子曲线
- 事件功能分布 + 情绪分布
- 可视化分析流水线
技术亮点
- 纯前端:所有数据存储于 LocalStorage
- 中文 NLP 启发式:基于句法模式的角色名检测、关键词情绪/目的分类
- 心理学模型:身份循环理论嵌入转变合理性检测
- 实时交互:可编辑分析结果,支持多项目管理
Files built: index.html, src/types.ts, src/engine.ts, src/store.ts, src/store.tsx, src/components/Sidebar.tsx, src/components/ImportView.tsx, src/components/EventsView.tsx, src/components/CharactersView.tsx, src/components/TransitionsView.tsx, src/components/ReportView.tsx, src/App.tsx, src/index.css