Skip to content

A Simple and Universal Swarm Intelligence Engine, Predicting Anything. 简洁通用的群体智能引擎,预测万物

Refactor report logging and enhance report generation features

666ghj9be2c28a5d52
diff --git a/backend/app/services/report_agent.py b/backend/app/services/report_agent.py
index 8dcb522f..4a82266f 100644
--- a/backend/app/services/report_agent.py
+++ b/backend/app/services/report_agent.py
@@ -233,24 +233,52 @@ class ReportLogger:
}
)
- def log_section_complete(
+ def log_section_content(
self,
section_title: str,
section_index: int,
content: str,
- tool_calls_count: int
+ tool_calls_count: int,
+ is_subsection: bool = False
):
- """记录章节生成完成(完整内容,不截断)"""
+ """记录章节/子章节内容生成完成(仅记录内容,不代表整个章节完成)"""
+ action = "subsection_content" if is_subsection else "section_content"
self.log(
- action="section_complete",
+ action=action,
stage="generating",
section_title=section_title,
section_index=section_index,
details={
- "content": content, # 完整章节内容,不截断
+ "content": content, # 完整内容,不截断
"content_length": len(content),
"tool_calls_count": tool_calls_count,
- "message": f"章节 {section_title} 生成完成"
+ "is_subsection": is_subsection,
+ "message": f"{'子章节' if is_subsection else '主章节'} {section_title} 内容生成完成"
+ }
+ )
+
+ def log_section_full_complete(
+ self,
+ section_title: str,
+ section_index: int,
+ full_content: str,
+ subsection_count: int
+ ):
+ """
+ 记录完整章节生成完成(包含所有子章节的合并内容)
+
+ 前端应监听此日志来判断一个章节是否真正完成,并获取完整内容
+ """
+ self.log(
+ action="section_complete",
+ stage="generating",
+ section_title=section_title,
+ section_index=section_index,
+ details={
+ "content": full_content, # 完整章节内容(含子章节),不截断
+ "content_length": len(full_content),
+ "subsection_count": subsection_count,
+ "message": f"章节 {section_title} 完整生成完成(含 {subsection_count} 个子章节)"
}
)
@@ -464,14 +492,14 @@ class ReportAgent:
【重要】Report Agent必须优先调用工具获取模拟数据,而非使用自身知识!
"""
- # 最大工具调用次数(每个章节)- 增加上限以鼓励更多检索
- MAX_TOOL_CALLS_PER_SECTION = 10
+ # 最大工具调用次数(每个章节)
+ MAX_TOOL_CALLS_PER_SECTION = 4
# 最大反思轮数
MAX_REFLECTION_ROUNDS = 2
# 对话中的最大工具调用次数
- MAX_TOOL_CALLS_PER_CHAT = 8
+ MAX_TOOL_CALLS_PER_CHAT = 3
def __init__(
self,
@@ -807,24 +835,34 @@ class ReportAgent:
progress_callback("planning", 30, "正在生成报告大纲...")
# 构建规划prompt
- system_prompt = """你是一个专业的舆情分析报告撰写专家。你需要根据用户的模拟需求和已有的知识图谱信息,规划一份精炼的模拟分析报告大纲。
-
-【重要】报告章节数量限制:
-- 报告最多包含5个主章节
+ system_prompt = """你是一个「未来预测报告」的撰写专家,拥有对模拟世界的「上帝视角」——你可以洞察模拟中每一位Agent的行为、言论和互动。
+
+【核心理念】
+我们构建了一个模拟世界,并向其中注入了特定的「模拟需求」作为变量。模拟世界的演化结果,就是对未来可能发生情况的预测。你正在观察的不是"实验数据",而是"未来的预演"。
+
+【你的任务】
+撰写一份「未来预测报告」,回答:
+1. 在我们设定的条件下,未来发生了什么?
+2. 各类Agent(人群)是如何反应和行动?
+3. 这个模拟揭示了哪些值得关注的未来趋势和风险?
+
+【报告定位】
+- ✅ 这是一份基于模拟的未来预测报告,揭示"如果这样,未来会怎样"
+- ✅ 聚焦于预测结果:事件走向、群体反应、涌现现象、潜在风险
+- ✅ 模拟世界中的Agent言行就是对未来人群行为的预测
+- ❌ 不是对现实世界现状的分析
+- ❌ 不是泛泛而谈的舆情综述
+
+【章节数量限制】
+- 最少2个主章节,最多5个主章节
- 每个章节可以有0-2个子章节
-- 内容要精炼,避免冗余
-
-报告应聚焦以下核心内容(选择最相关的3-5项):
-1. 执行摘要 - 简要总结模拟结果和关键发现
-2. 模拟背景 - 描述模拟的初始条件和场景设定
-3. 关键发现 - 分析模拟中的重要发现和趋势
-4. 舆情分析 - 分析舆论走向、情绪变化、关键意见领袖等
-5. 建议与展望 - 基于分析结果提出建议
+- 内容要精炼,聚焦于核心预测发现
+- 章节结构由你根据预测结果自主设计
请输出JSON格式的报告大纲,格式如下:
{
"title": "报告标题",
- "summary": "报告摘要(一句话概括)",
+ "summary": "报告摘要(一句话概括核心预测发现)",
"sections": [
{
"title": "章节标题",
@@ -836,23 +874,28 @@ class ReportAgent:
]
}
-注意:sections数组最多包含5个元素!"""
+注意:sections数组最少2个,最多5个元素!"""
- user_prompt = f"""模拟需求:
-{self.simulation_requirement}
+ user_prompt = f"""【预测场景设定】
+我们向模拟世界注入的变量(模拟需求):{self.simulation_requirement}
-已有的知识图谱信息:
-- 总节点数: {context.get('graph_statistics', {}).get('total_nodes', 0)}
-- 总边数: {context.get('graph_statistics', {}).get('total_edges', 0)}
-- 实体类型: {list(context.get('graph_statistics', {}).get('entity_types', {}).keys())}
-- 实体数量: {context.get('total_entities', 0)}
+【模拟世界规模】
+- 参与模拟的实体数量: {context.get('graph_statistics', {}).get('total_nodes', 0)}
+- 实体间产生的关系数量: {context.get('graph_statistics', {}).get('total_edges', 0)}
+- 实体类型分布: {list(context.get('graph_statistics', {}).get('entity_types', {}).keys())}
+- 活跃Agent数量: {context.get('total_entities', 0)}
-相关事实:
+【模拟预测到的部分未来事实样本】
{json.dumps(context.get('related_facts', [])[:10], ensure_ascii=False, indent=2)}
-请根据以上信息,生成一份针对此模拟场景的报告大纲。
+请以「上帝视角」审视这个未来预演:
+1. 在我们设定的条件下,未来呈现出了什么样的状态?
+2. 各类人群(Agent)是如何反应和行动的?
+3. 这个模拟揭示了哪些值得关注的未来趋势?
-【再次提醒】报告必须控制在最多5个章节以内,内容要精炼聚焦。"""
+根据预测结果,设计最合适的报告章节结构。
+
+【再次提醒】报告章节数量:最少2个,最多5个,内容要精炼聚焦于核心预测发现。"""
try:
response = self.llm.chat_json(
@@ -896,16 +939,14 @@ class ReportAgent:
except Exception as e:
logger.error(f"大纲规划失败: {str(e)}")
- # 返回默认大纲(5个章节)
+ # 返回默认大纲(3个章节,作为fallback)
return ReportOutline(
- title="模拟分析报告",
- summary="基于模拟结果的分析报告",
+ title="未来预测报告",
+ summary="基于模拟预测的未来趋势与风险分析",
sections=[
- ReportSection(title="执行摘要"),
- ReportSection(title="模拟背景与场景设定"),
- ReportSection(title="关键发现与趋势分析"),
- ReportSection(title="舆情走向与情绪演化"),
- ReportSection(title="总结与建议")
+ ReportSection(title="预测场景与核心发现"),
+ ReportSection(title="人群行为预测分析"),
+ ReportSection(title="趋势展望与风险提示")
]
)
@@ -949,32 +990,47 @@ class ReportAgent:
sub_heading_level = 3 # 子标题使用三级(###)
sub_sub_heading_level = 4 # 更小的子标题使用四级(####)
- system_prompt = f"""你是一个专业的舆情分析报告撰写专家,正在撰写报告的一个章节。
+ system_prompt = f"""你是一个「未来预测报告」的撰写专家,正在撰写报告的一个章节。
报告标题: {outline.title}
报告摘要: {outline.summary}
-模拟需求: {self.simulation_requirement}
+预测场景(模拟需求): {self.simulation_requirement}
当前要撰写的章节: {section.title}
+═══════════════════════════════════════════════════════════════
+【核心理念】
+═══════════════════════════════════════════════════════════════
+
+模拟世界是对未来的预演。我们向模拟世界注入了特定条件(模拟需求),
+模拟中Agent的行为和互动,就是对未来人群行为的预测。
+
+你的任务是:
+- 揭示在设定条件下,未来发生了什么
+- 预测各类人群(Agent)是如何反应和行动的
+- 发现值得关注的未来趋势、风险和机会
+
+❌ 不要写成对现实世界现状的分析
+✅ 要聚焦于"未来会怎样"——模拟结果就是预测的未来
+
═══════════════════════════════════════════════════════════════
【最重要的规则 - 必须遵守】
═══════════════════════════════════════════════════════════════
-1. 【必须调用工具获取数据】
- - 你正在撰写的是基于模拟结果的分析报告
- - 所有内容必须来自模拟图谱中的真实数据
+1. 【必须调用工具观察模拟世界】
+ - 你正在以「上帝视角」观察未来的预演
+ - 所有内容必须来自模拟世界中发生的事件和Agent言行
- 禁止使用你自己的知识来编写报告内容
- - 每个章节至少调用1-3次工具获取相关信息
+ - 每个章节至少调用2次工具(最多4次)来观察模拟的世界,它代表了未来
-2. 【必须引用模拟结果原文】
- - 检索到的事实原文是最有价值的内容
- - 在报告中使用引用格式展示这些原文,例如:
- > "原文内容..."
- - 这些原文证明了模拟的真实效果
+2. 【必须引用Agent的原始言行】
+ - Agent的发言和行为是对未来人群行为的预测
+ - 在报告中使用引用格式展示这些预测,例如:
+ > "某类人群会表示:原文内容..."
+ - 这些引用是模拟预测的核心证据
-3. 【尊重模拟结果】
- - 报告内容必须反映模拟中实际发生的情况
+3. 【忠实呈现预测结果】
+ - 报告内容必须反映模拟世界中的代表未来的模拟结果
- 不要添加模拟中不存在的信息
- 如果某方面信息不足,如实说明
@@ -1017,7 +1073,7 @@ class ReportAgent:
```
═══════════════════════════════════════════════════════════════
-【可用检索工具】(建议每章节调用2-5次)
+【可用检索工具】(每章节调用2-4次)
═══════════════════════════════════════════════════════════════
{self._get_tools_description()}
@@ -1026,6 +1082,7 @@ class ReportAgent:
- insight_forge: 用于深度分析,会自动分解问题并多维度检索
- panorama_search: 用于了解全貌和演变过程
- quick_search: 用于快速验证某个具体信息
+- interview_agents: 用于采访模拟Agent,获取不同角色的真实观点和看法
═══════════════════════════════════════════════════════════════
【ReACT工作流程】
@@ -1037,7 +1094,7 @@ class ReportAgent:
{{"name": "工具名称", "parameters": {{"参数名": "参数值"}}}}
</tool_call>
3. Observation: [分析工具返回的结果]
-4. 重复步骤1-3,直到收集到足够信息(建议2-5轮)
+4. 重复步骤1-3,直到收集到足够信息(最多5轮)
5. Final Answer: [基于检索结果撰写章节内容]
═══════════════════════════════════════════════════════════════
@@ -1111,9 +1168,9 @@ class ReportAgent:
{"role": "user", "content": user_prompt}
]
- # ReACT循环 - 优化后增加工具调用次数
+ # ReACT循环
tool_calls_count = 0
- max_iterations = self.MAX_TOOL_CALLS_PER_SECTION + 3 # 增加迭代次数
+ max_iterations = 5 # 最大迭代轮数
min_tool_calls = 2 # 最少工具调用次数
# 报告上下文,用于InsightForge的子问题生成
@@ -1173,13 +1230,16 @@ class ReportAgent:
final_answer = response.split("Final Answer:")[-1].strip()
logger.info(f"章节 {section.title} 生成完成(工具调用: {tool_calls_count}次)")
- # 记录章节完成日志
+ # 记录章节内容生成完成日志(注意:这只是内容完成,不代表整个章节完成)
+ # 如果是子章节,section_index >= 100
+ is_subsection = section_index >= 100
if self.report_logger:
- self.report_logger.log_section_complete(
+ self.report_logger.log_section_content(
section_title=section.title,
section_index=section_index,
content=final_answer,
- tool_calls_count=tool_calls_count
+ tool_calls_count=tool_calls_count,
+ is_subsection=is_subsection
)
return final_answer
@@ -1284,13 +1344,15 @@ class ReportAgent:
else:
final_answer = response
- # 记录章节完成日志
+ # 记录章节内容生成完成日志(注意:这只是内容完成,不代表整个章节完成)
+ is_subsection = section_index >= 100
if self.report_logger:
- self.report_logger.log_section_complete(
+ self.report_logger.log_section_content(
section_title=section.title,
section_index=section_index,
content=final_answer,
- tool_calls_count=tool_calls_count
+ tool_calls_count=tool_calls_count,
+ is_subsection=is_subsection
)
return final_answer
@@ -1475,6 +1537,20 @@ class ReportAgent:
)
completed_section_titles.append(section.title)
+ # 【重要】记录完整章节完成日志,包含合并后的完整内容
+ # 构建完整章节内容(主章节 + 所有子章节)
+ full_section_content = f"## {section.title}\n\n{section_content}\n\n"
+ for sub_title, sub_content in subsection_contents:
+ full_section_content += f"### {sub_title}\n\n{sub_content}\n\n"
+
+ if self.report_logger:
+ self.report_logger.log_section_full_complete(
+ section_title=section.title,
+ section_index=section_num,
+ full_content=full_section_content.strip(),
+ subsection_count=len(subsection_contents)
+ )
+
logger.info(f"章节已保存(包含{len(subsection_contents)}个子章节): {report_id}/section_{section_num:02d}.md")
# 更新进度
@@ -1580,40 +1656,48 @@ class ReportAgent:
chat_history = chat_history or []
- system_prompt = f"""你是一个专业的舆情分析助手,负责回答关于模拟分析报告的问题。
+ system_prompt = f"""你是一个拥有「上帝视角」的未来预测助手,负责回答关于模拟预测结果的问题。
═══════════════════════════════════════════════════════════════
-【背景信息】
+【预测场景背景】
═══════════════════════════════════════════════════════════════
-模拟需求: {self.simulation_requirement}
-图谱ID: {self.graph_id}
+预测条件(模拟需求): {self.simulation_requirement}
+模拟世界ID: {self.graph_id}
+
+模拟世界是对未来的预演。你的任务是帮助用户理解:在设定条件下,未来会发生什么?各类人群会如何反应?
═══════════════════════════════════════════════════════════════
【最重要的规则 - 必须遵守】
═══════════════════════════════════════════════════════════════
-1. 【必须调用工具获取数据】
- - 你的回答必须基于模拟图谱中的真实数据
+1. 【必须调用工具获取预测数据】
+ - 你的回答必须基于模拟世界中的预测结果
- 禁止使用你自己的知识来回答问题
- - 每次回答前至少调用1次工具获取相关信息
+ - 每次回答前至少调用1次工具获取预测数据
-2. 【必须引用模拟结果原文】
- - 检索到的事实原文是最有价值的内容
- - 在回答中使用引用格式展示这些原文,例如:
- > "原文内容..."
- - 原文引用证明了答案的可靠性
+2. 【必须引用Agent的原始言行】
+ - Agent的发言和行为是对未来人群行为的预测
+ - 在回答中使用引用格式展示这些预测,例如:
+ > "某类人群会表示:原文内容..."
+ - 这些引用是预测的核心证据
-3. 【尊重模拟结果】
- - 回答必须反映模拟中实际发生的情况
+3. 【忠实呈现预测结果】
+ - 回答必须反映模拟世界中的预测结果
- 不要添加模拟中不存在的信息
- 如果某方面信息不足,如实说明
═══════════════════════════════════════════════════════════════
-【可用检索工具】
+【可用检索工具】(最多调用3次)
═══════════════════════════════════════════════════════════════
{self._get_tools_description()}
+【工具使用建议】
+- insight_forge: 用于深度分析,会自动分解问题并多维度检索
+- panorama_search: 用于了解全貌和演变过程
+- quick_search: 用于快速验证某个具体信息
+- interview_agents: 用于采访模拟Agent,获取不同角色的真实观点和看法
+
【工具调用格式】
<tool_call>
{{"name": "工具名称", "parameters": {{"参数名": "参数值"}}}}
@@ -1644,9 +1728,9 @@ class ReportAgent:
【提醒】请先调用工具获取模拟数据,再回答问题。推荐使用 insight_forge 进行深度检索。"""
})
- # ReACT循环 - 增加迭代次数以支持更多工具调用
+ # ReACT循环
tool_calls_made = []
- max_iterations = self.MAX_TOOL_CALLS_PER_CHAT
+ max_iterations = 3 # 最大迭代轮数
min_tool_calls = 1 # 最少工具调用次数
for iteration in range(max_iterations):
diff --git a/backend/app/services/zep_tools.py b/backend/app/services/zep_tools.py
index 321c3a32..e8c33d06 100644
--- a/backend/app/services/zep_tools.py
+++ b/backend/app/services/zep_tools.py
@@ -169,11 +169,11 @@ class InsightForgeResult:
def to_text(self) -> str:
"""转换为详细的文本格式,供LLM理解"""
text_parts = [
- f"## 深度洞察检索结果",
- f"原始问题: {self.query}",
- f"模拟需求: {self.simulation_requirement}",
- f"\n### 检索统计",
- f"- 相关事实: {self.total_facts}条",
+ f"## 未来预测深度分析",
+ f"分析问题: {self.query}",
+ f"预测场景: {self.simulation_requirement}",
+ f"\n### 预测数据统计",
+ f"- 相关预测事实: {self.total_facts}条",
f"- 涉及实体: {self.total_entities}个",
f"- 关系链: {self.total_relationships}条"
]
@@ -248,13 +248,13 @@ class PanoramaResult:
def to_text(self) -> str:
"""转换为文本格式"""
text_parts = [
- f"## 广度搜索结果(全貌视图)",
- f"查询: {self.query}",
- f"\n### 统计信息",
- f"- 总节点数: {self.total_nodes}",
- f"- 总边数: {self.total_edges}",
- f"- 当前有效事实: {self.active_count}条",
- f"- 历史/过期事实: {self.historical_count}条"
+ f"## 未来全景预测",
+ f"预测主题: {self.query}",
+ f"\n### 预测世界概览",
+ f"- 总实体数: {self.total_nodes}",
+ f"- 总关系数: {self.total_edges}",
+ f"- 当前有效预测: {self.active_count}条",
+ f"- 历史演变记录: {self.historical_count}条"
]
# 当前有效的事实
@@ -1091,10 +1091,10 @@ class ZepToolsService:
将复杂问题分解为多个可以独立检索的子问题
"""
- system_prompt = """你是一个专业的问题分析专家。你的任务是将一个复杂问题分解为多个可以独立检索的子问题。
+ system_prompt = """你是一个专业的问题分析专家。你的任务是将一个复杂问题分解为多个可以在模拟世界中独立观察的子问题。
要求:
-1. 每个子问题应该足够具体,可以在知识图谱中检索到相关信息
+1. 每个子问题应该足够具体,可以在模拟世界中找到相关的Agent行为或事件
2. 子问题应该覆盖原问题的不同维度(如:谁、什么、为什么、怎么样、何时、何地)
3. 子问题应该与模拟场景相关
4. 返回JSON格式:{"sub_queries": ["子问题1", "子问题2", ...]}"""
diff --git a/frontend/src/components/Step3Simulation.vue b/frontend/src/components/Step3Simulation.vue
index a692442d..096e1712 100644
--- a/frontend/src/components/Step3Simulation.vue
+++ b/frontend/src/components/Step3Simulation.vue
@@ -655,7 +655,7 @@ const handleNextStep = async () => {
try {
const res = await generateReport({
simulation_id: props.simulationId,
- force_regenerate: false
+ force_regenerate: true
})
if (res.success && res.data) {
diff --git a/frontend/src/components/Step4Report.vue b/frontend/src/components/Step4Report.vue
index 7f488b3e..498a5636 100644
--- a/frontend/src/components/Step4Report.vue
+++ b/frontend/src/components/Step4Report.vue
@@ -4,7 +4,12 @@
<div class="status-bar">
<div class="status-left">
<div class="report-badge">
- <span class="badge-icon">📊</span>
+ <svg class="badge-icon" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
+ <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
+ <polyline points="14 2 14 8 20 8"></polyline>
+ <line x1="16" y1="13" x2="8" y2="13"></line>
+ <line x1="16" y1="17" x2="8" y2="17"></line>
+ </svg>
<span class="badge-text">Report Agent</span>
</div>
<div class="status-indicator" :class="statusClass">
@@ -16,258 +21,295 @@
<div class="status-right">
<div class="stats-group" v-if="reportOutline">
<span class="stat-item">
- <span class="stat-label">章节</span>
+ <span class="stat-label">Sections</span>
<span class="stat-value mono">{{ completedSections }}/{{ totalSections }}</span>
</span>
<span class="stat-item">
- <span class="stat-label">工具调用</span>
+ <span class="stat-label">Tools</span>
<span class="stat-value mono">{{ totalToolCalls }}</span>
</span>
<span class="stat-item">
- <span class="stat-label">耗时</span>
+ <span class="stat-label">Time</span>
<span class="stat-value mono">{{ formatElapsedTime }}</span>
</span>
</div>
</div>
</div>
- <!-- Main Content: Agent Workflow -->
- <div class="main-content-area" ref="mainContent">
- <!-- Report Outline Card (显示在顶部) -->
- <div v-if="reportOutline" class="outline-card">
- <div class="outline-header">
- <div class="outline-title-wrapper">
- <svg class="outline-icon" viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path>
- <polyline points="14 2 14 8 20 8"></polyline>
- <line x1="16" y1="13" x2="8" y2="13"></line>
- <line x1="16" y1="17" x2="8" y2="17"></line>
- <polyline points="10 9 9 9 8 9"></polyline>
- </svg>
- <h2 class="outline-title">{{ reportOutline.title }}</h2>
+ <!-- Main Split Layout -->
+ <div class="main-split-layout">
+ <!-- LEFT PANEL: Progress & Content -->
+ <div class="left-panel" ref="leftPanel">
+ <div class="panel-header">
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
+ <path d="M9 11l3 3L22 4"></path>
+ <path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path>
+ </svg>
+ <span>Report Progress</span>
+ </div>
+
+ <!-- Outline Overview -->
+ <div v-if="reportOutline" class="outline-overview">
+ <h2 class="report-title">{{ reportOutline.title }}</h2>
+ <p class="report-summary">{{ reportOutline.summary }}</p>
+
+ <!-- Progress Bar -->
+ <div class="progress-wrapper">
+ <div class="progress-bar">
+ <div class="progress-fill" :style="{ width: progressPercent + '%' }"></div>
+ </div>
+ <span class="progress-text">{{ progressPercent }}%</span>
</div>
- <span class="outline-badge">大纲已生成</span>
</div>
- <p class="outline-summary">{{ reportOutline.summary }}</p>
- <div class="outline-sections">
+
+ <!-- Sections List with Content -->
+ <div class="sections-container" v-if="reportOutline">
<div
v-for="(section, idx) in reportOutline.sections"
:key="idx"
- class="outline-section-item"
+ class="section-card"
:class="{
'completed': isSectionCompleted(idx + 1),
'current': currentSectionIndex === idx + 1,
- 'expanded': expandedSections.has(idx)
+ 'pending': !isSectionCompleted(idx + 1) && currentSectionIndex !== idx + 1
}"
- @click="toggleSection(idx)"
>
- <div class="section-header">
- <span class="section-num">{{ String(idx + 1).padStart(2, '0') }}</span>
- <span class="section-title">{{ section.title }}</span>
- <span class="section-status">
- <svg v-if="isSectionCompleted(idx + 1)" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="3">
+ <div class="section-card-header" @click="toggleSectionContent(idx)">
+ <div class="section-indicator">
+ <svg v-if="isSectionCompleted(idx + 1)" class="check-icon" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="3">
<polyline points="20 6 9 17 4 12"></polyline>
</svg>
- <span v-else-if="currentSectionIndex === idx + 1" class="generating-dot"></span>
- </span>
- <span class="section-toggle" v-if="generatedSections[idx + 1]">
- {{ expandedSections.has(idx) ? '−' : '+' }}
+ <div v-else-if="currentSectionIndex === idx + 1" class="generating-spinner"></div>
+ <span v-else class="section-number">{{ idx + 1 }}</span>
+ </div>
+ <span class="section-name">{{ section.title }}</span>
+ <span v-if="generatedSections[idx + 1]" class="expand-btn">
+ {{ expandedContent.has(idx) ? '−' : '+' }}
</span>
</div>
- <!-- 已生成的章节内容预览 -->
- <div v-if="expandedSections.has(idx) && generatedSections[idx + 1]" class="section-content-preview">
- <div class="content-markdown" v-html="renderMarkdown(generatedSections[idx + 1])"></div>
- </div>
+
+ <!-- Section Content Preview -->
+ <Transition name="slide-content">
+ <div v-if="expandedContent.has(idx) && generatedSections[idx + 1]" class="section-content">
+ <div class="content-body" v-html="renderMarkdown(generatedSections[idx + 1])"></div>
+ </div>
+ </Transition>
+ </div>
+ </div>
+
+ <!-- Waiting State -->
+ <div v-if="!reportOutline" class="waiting-placeholder">
+ <div class="waiting-animation">
+ <div class="waiting-ring"></div>
+ <div class="waiting-ring"></div>
+ <div class="waiting-ring"></div>
</div>
+ <span class="waiting-text">Waiting for Report Agent...</span>
</div>
</div>
- <!-- Agent Action Feed -->
- <div class="action-feed">
- <div class="feed-header" v-if="agentLogs.length > 0">
- <span class="feed-title">Agent 工作流</span>
- <span class="feed-count">{{ agentLogs.length }} 条记录</span>
+ <!-- RIGHT PANEL: Workflow Timeline -->
+ <div class="right-panel" ref="rightPanel">
+ <div class="panel-header">
+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
+ <circle cx="12" cy="12" r="10"></circle>
+ <polyline points="12 6 12 12 16 14"></polyline>
+ </svg>
+ <span>Agent Workflow</span>
+ <span class="log-count" v-if="agentLogs.length > 0">{{ agentLogs.length }}</span>
</div>
- <div class="feed-timeline">
- <TransitionGroup name="feed-item">
+ <div class="workflow-timeline">
+ <TransitionGroup name="timeline-item">
<div
v-for="(log, idx) in displayLogs"
:key="log.timestamp + '-' + idx"
- class="feed-item"
- :class="getLogClass(log)"
+ class="timeline-item"
+ :class="getTimelineItemClass(log)"
>
- <div class="item-marker">
- <div class="marker-icon" :class="getMarkerClass(log)">
- <component :is="getLogIcon(log)" />
- </div>
+ <!-- Timeline Connector -->
+ <div class="timeline-connector">
+ <div class="connector-dot" :class="getConnectorClass(log)"></div>
+ <div class="connector-line" v-if="idx < displayLogs.length - 1"></div>
</div>
- <div class="item-content">
- <div class="item-header">
- <span class="item-action">{{ getActionLabel(log.action) }}</span>
- <span class="item-stage" :class="log.stage">{{ log.stage }}</span>
- <span class="item-time">{{ formatTime(log.timestamp) }}</span>
+ <!-- Timeline Content -->
+ <div class="timeline-content">
+ <div class="timeline-header">
+ <span class="action-label">{{ getActionLabel(log.action) }}</span>
+ <span class="action-time">{{ formatTime(log.timestamp) }}</span>
</div>
- <!-- 根据不同 action 类型展示不同内容 -->
- <div class="item-body">
- <!-- report_start -->
+ <!-- Action Body - Different for each type -->
+ <div class="timeline-body" :class="{ 'collapsed': isLogCollapsed(log) }" @click="toggleLogExpand(log)">
+
+ <!-- Report Start -->
<template v-if="log.action === 'report_start'">
- <div class="info-block">
- <span class="info-label">Simulation:</span>
- <span class="info-value mono">{{ log.details?.simulation_id }}</span>
+ <div class="info-row">
+ <span class="info-key">Simulation</span>
+ <span class="info-val mono">{{ log.details?.simulation_id }}</span>
</div>
- <div class="info-block" v-if="log.details?.simulation_requirement">
- <span class="info-label">需求:</span>
- <span class="info-value">{{ log.details.simulation_requirement }}</span>
+ <div class="info-row" v-if="log.details?.simulation_requirement">
+ <span class="info-key">Requirement</span>
+ <span class="info-val">{{ log.details.simulation_requirement }}</span>
</div>
</template>
- <!-- planning_start / planning_complete -->
+ <!-- Planning -->
<template v-if="log.action === 'planning_start'">
- <div class="message-text">{{ log.details?.message }}</div>
+ <div class="status-message planning">{{ log.details?.message }}</div>
</template>
<template v-if="log.action === 'planning_complete'">
- <div class="message-text success">{{ log.details?.message }}</div>
- <div class="outline-mini" v-if="log.details?.outline">
- <span class="mini-label">共 {{ log.details.outline.sections?.length || 0 }} 个章节</span>
+ <div class="status-message success">{{ log.details?.message }}</div>
+ <div class="outline-badge" v-if="log.details?.outline">
+ {{ log.details.outline.sections?.length || 0 }} sections planned
</div>
</template>
- <!-- section_start -->
+ <!-- Section Start -->
<template v-if="log.action === 'section_start'">
- <div class="section-info">
- <span class="section-badge">章节 {{ log.section_index }}</span>
- <span class="section-name">{{ log.section_title }}</span>
+ <div class="section-tag">
+ <span class="tag-num">#{{ log.section_index }}</span>
+ <span class="tag-title">{{ log.section_title }}</span>
+ </div>
+ </template>
+
+ <!-- Section/Subsection Content Generated (内容生成完成,但整个章节可能还没完成) -->
+ <template v-if="log.action === 'section_content' || log.action === 'subsection_content'">
+ <div class="section-tag content-ready" :class="{ 'is-subsection': log.action === 'subsection_content' }">
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
+ <path d="M12 20h9"></path>
+ <path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"></path>
+ </svg>
+ <span class="tag-title">{{ log.section_title }}</span>
+ <span v-if="log.action === 'subsection_content'" class="tag-sub">(subsection)</span>
+ </div>
+ </template>
+
+ <!-- Section Complete (完整章节生成完成,含所有子章节) -->
+ <template v-if="log.action === 'section_complete'">
+ <div class="section-tag completed">
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
+ <polyline points="20 6 9 17 4 12"></polyline>
+ </svg>
+ <span class="tag-title">{{ log.section_title }}</span>
+ <span v-if="log.details?.subsection_count > 0" class="tag-sub">(+{{ log.details.subsection_count }} subsections)</span>
</div>
</template>
- <!-- tool_call -->
+ <!-- Tool Call -->
<template v-if="log.action === 'tool_call'">
- <div class="tool-call-block">
- <div class="tool-name">
- <svg class="tool-icon" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path>
- </svg>
- {{ log.details?.tool_name }}
- </div>
- <div class="tool-params" v-if="log.details?.parameters">
- <pre>{{ formatParams(log.details.parameters) }}</pre>
- </div>
+ <div class="tool-badge">
+ <svg class="tool-icon" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
+ <path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"></path>
+ </svg>
+ {{ getToolDisplayName(log.details?.tool_name) }}
+ </div>
+ <div v-if="log.details?.parameters && expandedLogs.has(log.timestamp)" class="tool-params">
+ <pre>{{ formatParams(log.details.parameters) }}</pre>
</div>
+ <button v-if="log.details?.parameters" class="expand-toggle" @click.stop="toggleLogExpand(log)">
+ {{ expandedLogs.has(log.timestamp) ? 'Hide Params' : 'Show Params' }}
+ </button>
</template>
- <!-- tool_result -->
+ <!-- Tool Result -->
<template v-if="log.action === 'tool_result'">
- <div class="tool-result-block" :class="'tool-' + log.details?.tool_name">
- <div class="result-header">
+ <div class="result-wrapper" :class="'result-' + log.details?.tool_name">
+ <div class="result-meta">
<span class="result-tool">{{ getToolDisplayName(log.details?.tool_name) }}</span>
- <span class="result-length">{{ log.details?.result_length }} chars</span>
- <button
- class="toggle-raw-btn"
- @click.stop="toggleRawResult(log.timestamp)"
- >
- {{ showRawResult[log.timestamp] ? '收起原文' : '查看原文' }}
- </button>
+ <span class="result-size">{{ formatResultSize(log.details?.result_length) }}</span>
</div>
- <!-- 结构化展示 -->
- <div class="result-structured" v-if="!showRawResult[log.timestamp] && log.details?.result">
- <!-- insight_forge 深度洞察 -->
- <template v-if="log.details?.tool_name === 'insight_forge'">
- <InsightForgeResult :result="parseInsightForge(log.details.result)" />
+ <!-- Structured Result Display -->
+ <div v-if="!showRawResult[log.timestamp]" class="result-structured">
+ <!-- Interview Agents - Special Display -->
+ <template v-if="log.details?.tool_name === 'interview_agents'">
+ <InterviewDisplay :result="parseInterview(log.details.result)" />
</template>
- <!-- panorama_search 广度搜索 -->
- <template v-else-if="log.details?.tool_name === 'panorama_search'">
- <PanoramaResult :result="parsePanorama(log.details.result)" />
+ <!-- Insight Forge -->
+ <template v-else-if="log.details?.tool_name === 'insight_forge'">
+ <InsightDisplay :result="parseInsightForge(log.details.result)" />
</template>
- <!-- interview_agents 深度采访 -->
- <template v-else-if="log.details?.tool_name === 'interview_agents'">
- <InterviewResult :result="parseInterview(log.details.result)" />
+ <!-- Panorama Search -->
+ <template v-else-if="log.details?.tool_name === 'panorama_search'">
+ <PanoramaDisplay :result="parsePanorama(log.details.result)" />
</template>
- <!-- quick_search 简单搜索 -->
+ <!-- Quick Search -->
<template v-else-if="log.details?.tool_name === 'quick_search'">
- <QuickSearchResult :result="parseQuickSearch(log.details.result)" />
+ <QuickSearchDisplay :result="parseQuickSearch(log.details.result)" />
</template>
- <!-- 其他工具 - 显示原文 -->
+ <!-- Default -->
<template v-else>
- <div class="result-content">
- <pre>{{ log.details.result }}</pre>
- </div>
+ <pre class="raw-preview">{{ truncateText(log.details?.result, 300) }}</pre>
</template>
</div>
- <!-- 原文展示 -->
- <div class="result-raw" v-if="showRawResult[log.timestamp] && log.details?.result">
- <pre>{{ log.details.result }}</pre>
+ <!-- Raw Result -->
+ <div v-else class="result-raw">
+ <pre>{{ log.details?.result }}</pre>
</div>
+
+ <button class="toggle-raw" @click.stop="toggleRawResult(log.timestamp)">
+ {{ showRawResult[log.timestamp] ? 'Structured View' : 'Raw Output' }}
+ </button>
</div>
</template>
- <!-- llm_response -->
+ <!-- LLM Response -->
<template v-if="log.action === 'llm_response'">
- <div class="llm-response-block">
- <div class="response-meta">
- <span class="meta-item" v-if="log.details?.iteration">
- 迭代 #{{ log.details.iteration }}
- </span>
- <span class="meta-item" :class="{ active: log.details?.has_tool_calls }">
- 工具调用: {{ log.details?.has_tool_calls ? '是' : '否' }}
- </span>
- <span class="meta-item" :class="{ active: log.details?.has_final_answer }">
- 最终答案: {{ log.details?.has_final_answer ? '是' : '否' }}
- </span>
- </div>
- <div class="response-content" v-if="log.details?.response">
- <pre>{{ log.details.response }}</pre>
- </div>
+ <div class="llm-meta">
+ <span class="meta-tag">Iteration {{ log.details?.iteration }}</span>
+ <span class="meta-tag" :class="{ active: log.details?.has_tool_calls }">
+ Tools: {{ log.details?.has_tool_calls ? 'Yes' : 'No' }}
+ </span>
+ <span class="meta-tag" :class="{ active: log.details?.has_final_answer, 'final-answer': log.details?.has_final_answer }">
+ Final: {{ log.details?.has_final_answer ? 'Yes' : 'No' }}
+ </span>
</div>
- </template>
-
- <!-- section_complete -->
- <template v-if="log.action === 'section_complete'">
- <div class="complete-info">
- <svg class="complete-icon" viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2">
- <path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
- <polyline points="22 4 12 14.01 9 11.01"></polyline>
+ <!-- 当是最终答案时,显示特殊提示 -->
+ <div v-if="log.details?.has_final_answer" class="final-answer-hint">
+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2">
+ <polyline points="20 6 9 17 4 12"></polyline>
</svg>
- <span>章节「{{ log.section_title }}」生成完成</span>
+ <span>Section "{{ log.section_title }}" content generated</span>
</div>
+ <div v-if="expandedLogs.has(log.timestamp) && log.details?.response" class="llm-content">
+ <pre>{{ log.details.response }}</pre>
+ </div>
+ <button v-if="log.details?.response" class="expand-toggle" @click.stop="toggleLogExpand(log)">
+ {{ expandedLogs.has(log.timestamp) ? 'Hide Response' : 'Show Response' }}
+ </button>
</template>
- <!-- report_complete -->
+ <!-- Report Complete -->
<template v-if="log.action === 'report_complete'">
- <div class="complete-info success">
- <svg class="complete-icon" viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2">
+ <div class="complete-banner">
+ <svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="2">
<path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"></path>
<polyline points="22 4 12 14.01 9 11.01"></polyline>
</svg>
- <span>报告生成完成!</span>
+ <span>Report Generation Complete</span>
</div>
</template>
-
- <!-- 通用消息 -->
- <template v-if="!['report_start', 'planning_start', 'planning_complete', 'section_start', 'tool_call', 'tool_result', 'llm_response', 'section_complete', 'report_complete'].includes(log.action)">
- <div class="message-text">{{ log.details?.message || log.action }}</div>
- </template>
</div>
- <div class="item-footer" v-if="log.elapsed_seconds">
- <span class="elapsed">+{{ log.elapsed_seconds.toFixed(2) }}s</span>
+ <!-- Elapsed Time -->
+ <div class="timeline-footer" v-if="log.elapsed_seconds">
+ <span class="elapsed-badge">+{{ log.elapsed_seconds.toFixed(1) }}s</span>
</div>
</div>
</div>
</TransitionGroup>
- <!-- 等待状态 -->
- <div v-if="agentLogs.length === 0 && !isComplete" class="waiting-state">
- <div class="pulse-ring"></div>
- <span>等待 Report Agent 启动...</span>
+ <!-- Empty State -->
+ <div v-if="agentLogs.length === 0 && !isComplete" class="workflow-empty">
+ <div class="empty-pulse"></div>
+ <span>Waiting for agent activity...</span>
</div>
</div>
</div>
@@ -307,39 +349,66 @@ const agentLogLine = ref(0)
const consoleLogLine = ref(0)
const reportOutline = ref(null)
const currentSectionIndex = ref(null)
-const generatedSections = ref({}) // { sectionIndex: content }
-const expandedSections = ref(new Set())
+const generatedSections = ref({})
+const expandedContent = ref(new Set())
+const expandedLogs = ref(new Set())
const isComplete = ref(false)
const startTime = ref(null)
-const mainContent = ref(null)
+const leftPanel = ref(null)
+const rightPanel = ref(null)
const logContent = ref(null)
-const showRawResult = reactive({}) // 控制显示原文
+const showRawResult = reactive({})
-// 切换显示原文
+// Toggle functions
const toggleRawResult = (timestamp) => {
showRawResult[timestamp] = !showRawResult[timestamp]
}
-// 工具显示名称
+const toggleSectionContent = (idx) => {
+ if (!generatedSections.value[idx + 1]) return
+ const newSet = new Set(expandedContent.value)
+ if (newSet.has(idx)) {
+ newSet.delete(idx)
+ } else {
+ newSet.add(idx)
+ }
+ expandedContent.value = newSet
+}
+
+const toggleLogExpand = (log) => {
+ const newSet = new Set(expandedLogs.value)
+ if (newSet.has(log.timestamp)) {
+ newSet.delete(log.timestamp)
+ } else {
+ newSet.add(log.timestamp)
+ }
+ expandedLogs.value = newSet
+}
+
+const isLogCollapsed = (log) => {
+ if (['tool_call', 'tool_result', 'llm_response'].includes(log.action)) {
+ return !expandedLogs.value.has(log.timestamp)
+ }
+ return false
+}
+
+// Tool display names (without emojis)
const getToolDisplayName = (toolName) => {
const names = {
- 'insight_forge': '🔍 深度洞察检索',
- 'panorama_search': '🌐 广度搜索',
- 'interview_agents': '🎤 深度采访',
- 'quick_search': '⚡ 快速检索',
- 'get_graph_statistics': '📊 图谱统计',
- 'get_entities_by_type': '👥 实体查询'
+ 'insight_forge': 'Deep Insight',
+ 'panorama_search': 'Panorama Search',
+ 'interview_agents': 'Agent Interview',
+ 'quick_search': 'Quick Search',
+ 'get_graph_statistics': 'Graph Stats',
+ 'get_entities_by_type': 'Entity Query'
}
return names[toolName] || toolName
}
-// ========== 工具结果解析器 ==========
-
-// 解析 insight_forge 结果
+// Parse functions
const parseInsightForge = (text) => {
const result = {
query: '',
- requirement: '',
stats: { facts: 0, entities: 0, relationships: 0 },
subQueries: [],
facts: [],
@@ -348,15 +417,9 @@ const parseInsightForge = (text) => {
}
try {
- // 提取原始问题
const queryMatch = text.match(/原始问题:\s*(.+?)(?:\n|$)/)
if (queryMatch) result.query = queryMatch[1].trim()
- // 提取模拟需求
- const reqMatch = text.match(/模拟需求:\s*(.+?)(?:\n|$)/)
- if (reqMatch) result.requirement = reqMatch[1].trim()
-
- // 提取统计
const factMatch = text.match(/相关事实:\s*(\d+)/)
const entityMatch = text.match(/涉及实体:\s*(\d+)/)
const relMatch = text.match(/关系链:\s*(\d+)/)
@@ -364,41 +427,33 @@ const parseInsightForge = (text) => {
if (entityMatch) result.stats.entities = parseInt(entityMatch[1])
if (relMatch) result.stats.relationships = parseInt(relMatch[1])
- // 提取子问题
const subQSection = text.match(/### 分析的子问题\n([\s\S]*?)(?=###|\n\n###|$)/)
if (subQSection) {
const lines = subQSection[1].split('\n').filter(l => l.match(/^\d+\./))
result.subQueries = lines.map(l => l.replace(/^\d+\.\s*/, '').trim())
}
- // 提取关键事实
const factsSection = text.match(/### 【关键事实】[\s\S]*?\n([\s\S]*?)(?=###|$)/)
if (factsSection) {
const lines = factsSection[1].split('\n').filter(l => l.match(/^\d+\./))
result.facts = lines.map(l => {
const match = l.match(/^\d+\.\s*"?(.+?)"?\s*$/)
return match ? match[1].replace(/^"|"$/g, '') : l.replace(/^\d+\.\s*/, '').trim()
- }).slice(0, 15) // 限制显示数量
+ }).slice(0, 10)
}
- // 提取核心实体
const entitySection = text.match(/### 【核心实体】\n([\s\S]*?)(?=###|$)/)
if (entitySection) {
const entityBlocks = entitySection[1].split(/\n- \*\*/).slice(1)
result.entities = entityBlocks.map(block => {
const nameMatch = block.match(/^(.+?)\*\*\s*\((.+?)\)/)
- const summaryMatch = block.match(/摘要:\s*"?(.+?)"?\n/)
- const factsMatch = block.match(/相关事实:\s*(\d+)/)
return {
name: nameMatch ? nameMatch[1].trim() : '',
- type: nameMatch ? nameMatch[2].trim() : '',
- summary: summaryMatch ? summaryMatch[1].trim() : '',
- factCount: factsMatch ? parseInt(factsMatch[1]) : 0
+ type: nameMatch ? nameMatch[2].trim() : ''
}
- }).filter(e => e.name).slice(0, 10)
+ }).filter(e => e.name).slice(0, 8)
}
- // 提取关系链
const relSection = text.match(/### 【关系链】\n([\s\S]*?)(?=###|$)/)
if (relSection) {
const lines = relSection[1].split('\n').filter(l => l.startsWith('-'))
@@ -408,16 +463,15 @@ const parseInsightForge = (text) => {
return { source: match[1].trim(), relation: match[2].trim(), target: match[3].trim() }
}
return null
- }).filter(Boolean).slice(0, 10)
+ }).filter(Boolean).slice(0, 6)
}
} catch (e) {
- console.warn('解析 insight_forge 结果失败:', e)
+ console.warn('Parse insight_forge failed:', e)
}
return result
}
-// 解析 panorama_search 结果
const parsePanorama = (text) => {
const result = {
query: '',
@@ -428,11 +482,9 @@ const parsePanorama = (text) => {
}
try {
- // 提取查询
const queryMatch = text.match(/查询:\s*(.+?)(?:\n|$)/)
if (queryMatch) result.query = queryMatch[1].trim()
- // 提取统计
const nodesMatch = text.match(/总节点数:\s*(\d+)/)
const edgesMatch = text.match(/总边数:\s*(\d+)/)
const activeMatch = text.match(/当前有效事实:\s*(\d+)/)
@@ -442,32 +494,12 @@ const parsePanorama = (text) => {
if (activeMatch) result.stats.activeFacts = parseInt(activeMatch[1])
if (histMatch) result.stats.historicalFacts = parseInt(histMatch[1])
- // 提取当前有效事实
const activeSection = text.match(/### 【当前有效事实】[\s\S]*?\n([\s\S]*?)(?=###|$)/)
if (activeSection) {
const lines = activeSection[1].split('\n').filter(l => l.match(/^\d+\./))
- result.activeFacts = lines.map(l => {
- const match = l.match(/^\d+\.\s*"?(.+?)"?\s*$/)
- return match ? match[1].replace(/^"|"$/g, '') : l.replace(/^\d+\.\s*/, '').trim()
- }).slice(0, 15)
- }
-
- // 提取历史事实
- const histSection = text.match(/### 【历史\/过期事实】[\s\S]*?\n([\s\S]*?)(?=###|$)/)
- if (histSection) {
- const lines = histSection[1].split('\n').filter(l => l.match(/^\d+\./))
- result.historicalFacts = lines.map(l => {
- const content = l.replace(/^\d+\.\s*/, '').trim()
- // 提取时间范围
- const timeMatch = content.match(/^\[(.+?)\s*-\s*(.+?)\]\s*(.+)$/)
- if (timeMatch) {
- return { timeRange: `${timeMatch[1]} - ${timeMatch[2]}`, content: timeMatch[3].replace(/^"|"$/g, '') }
- }
- return { timeRange: '', content: content.replace(/^"|"$/g, '') }
- }).slice(0, 10)
+ result.activeFacts = lines.map(l => l.replace(/^\d+\.\s*/, '').replace(/^"|"$/g, '').trim()).slice(0, 8)
}
- // 提取涉及实体
const entitySection = text.match(/### 【涉及实体】\n([\s\S]*?)(?=###|$)/)
if (entitySection) {
const lines = entitySection[1].split('\n').filter(l => l.startsWith('-'))
@@ -475,41 +507,31 @@ const parsePanorama = (text) => {
const match = l.match(/^-\s*\*\*(.+?)\*\*\s*\((.+?)\)/)
if (match) return { name: match[1].trim(), type: match[2].trim() }
return null
- }).filter(Boolean).slice(0, 15)
+ }).filter(Boolean).slice(0, 10)
}
} catch (e) {
- console.warn('解析 panorama_search 结果失败:', e)
+ console.warn('Parse panorama failed:', e)
}
return result
}
-// 解析 interview_agents 结果
const parseInterview = (text) => {
const result = {
topic: '',
agentCount: '',
- selectionReason: '',
interviews: [],
summary: ''
}
try {
- // 提取采访主题
const topicMatch = text.match(/\*\*采访主题:\*\*\s*(.+?)(?:\n|$)/)
if (topicMatch) result.topic = topicMatch[1].trim()
- // 提取采访人数
const countMatch = text.match(/\*\*采访人数:\*\*\s*(.+?)(?:\n|$)/)
if (countMatch) result.agentCount = countMatch[1].trim()
- // 提取选择理由
- const reasonSection = text.match(/### 采访对象选择理由\n([\s\S]*?)(?=---|###|$)/)
- if (reasonSection) {
- result.selectionReason = reasonSection[1].trim().substring(0, 300) + '...'
- }
-
- // 提取采访实录
+ // Extract interview records
const interviewMatches = text.matchAll(/#### 采访 #(\d+):\s*(.+?)\n\*\*(.+?)\*\*\s*\((.+?)\)\n_简介:\s*(.+?)_\n\n\*\*Q:\*\*\s*([\s\S]*?)\n\n\*\*A:\*\*\s*([\s\S]*?)(?=\*\*关键引言|\n---|\n####|$)/g)
for (const match of interviewMatches) {
@@ -518,13 +540,13 @@ const parseInterview = (text) => {
title: match[2].trim(),
name: match[3].trim(),
role: match[4].trim(),
- bio: match[5].trim().substring(0, 100) + '...',
- question: match[6].trim().split('\n')[0].substring(0, 150) + '...',
- answer: match[7].trim().substring(0, 500) + '...',
+ bio: match[5].trim(),
+ question: match[6].trim(),
+ answer: match[7].trim(),
quotes: []
}
- // 提取关键引言
+ // Extract key quotes
const quoteSection = text.match(new RegExp(`#### 采访 #${match[1]}[\\s\\S]*?\\*\\*关键引言:\\*\\*\\n([\\s\\S]*?)(?=\\n---)`))
if (quoteSection) {
const quotes = quoteSection[1].match(/> "(.+?)"/g)
@@ -536,19 +558,17 @@ const parseInterview = (text) => {
result.interviews.push(interview)
}
- // 提取采访摘要
const summarySection = text.match(/### 采访摘要与核心观点\n([\s\S]*?)$/)
if (summarySection) {
- result.summary = summarySection[1].trim().substring(0, 500) + '...'
+ result.summary = summarySection[1].trim().substring(0, 400)
}
} catch (e) {
- console.warn('解析 interview_agents 结果失败:', e)
+ console.warn('Parse interview failed:', e)
}
return result
}
-// 解析 quick_search 结果
const parseQuickSearch = (text) => {
const result = {
query: '',
@@ -566,245 +586,206 @@ const parseQuickSearch = (text) => {
const factsSection = text.match(/### 相关事实:\n([\s\S]*)$/)
if (factsSection) {
const lines = factsSection[1].split('\n').filter(l => l.match(/^\d+\./))
- result.facts = lines.map(l => l.replace(/^\d+\.\s*/, '').trim()).slice(0, 20)
+ result.facts = lines.map(l => l.replace(/^\d+\.\s*/, '').trim()).slice(0, 10)
}
} catch (e) {
- console.warn('解析 quick_search 结果失败:', e)
+ console.warn('Parse quick_search failed:', e)
}
return result
}
-// ========== 子组件定义 ==========
+// ========== Sub Components ==========
-// InsightForge 结果展示组件
-const InsightForgeResult = {
+// Insight Display Component
+const InsightDisplay = {
props: ['result'],
setup(props) {
- const expanded = ref({ facts: true, entities: false, relations: false, subQueries: false })
- const toggleSection = (section) => { expanded.value[section] = !expanded.value[section] }
- return () => h('div', { class: 'insight-result' }, [
- // 统计卡片
- h('div', { class: 'stats-cards' }, [
- h('div', { class: 'stat-card facts' }, [
+ const expanded = ref(false)
+ return () => h('div', { class: 'insight-display' }, [
+ // Stats
+ h('div', { class: 'stat-row' }, [
+ h('div', { class: 'stat-box' }, [
h('span', { class: 'stat-num' }, props.result.stats.facts),
- h('span', { class: 'stat-name' }, '相关事实')
+ h('span', { class: 'stat-label' }, 'Facts')
]),
- h('div', { class: 'stat-card entities' }, [
+ h('div', { class: 'stat-box' }, [
h('span', { class: 'stat-num' }, props.result.stats.entities),
- h('span', { class: 'stat-name' }, '涉及实体')
+ h('span', { class: 'stat-label' }, 'Entities')
]),
- h('div', { class: 'stat-card relations' }, [
+ h('div', { class: 'stat-box' }, [
h('span', { class: 'stat-num' }, props.result.stats.relationships),
- h('span', { class: 'stat-name' }, '关系链')
+ h('span', { class: 'stat-label' }, 'Relations')
])
]),
-
- // 子问题
- props.result.subQueries.length > 0 && h('div', { class: 'collapsible-section' }, [
- h('div', { class: 'section-title', onClick: () => toggleSection('subQueries') }, [
- h('span', {}, '📋 分析的子问题'),
- h('span', { class: 'toggle-icon' }, expanded.value.subQueries ? '−' : '+')
- ]),
- expanded.value.subQueries && h('div', { class: 'sub-queries' },
- props.result.subQueries.map((q, i) => h('div', { class: 'sub-query', key: i }, [
- h('span', { class: 'query-num' }, i + 1),
- h('span', { class: 'query-text' }, q)
- ]))
- )
- ]),
-
- // 关键事实
- props.result.facts.length > 0 && h('div', { class: 'collapsible-section' }, [
- h('div', { class: 'section-title', onClick: () => toggleSection('facts') }, [
- h('span', {}, `📌 关键事实 (${props.result.facts.length})`),
- h('span', { class: 'toggle-icon' }, expanded.value.facts ? '−' : '+')
- ]),
- expanded.value.facts && h('div', { class: 'facts-list' },
- props.result.facts.map((fact, i) => h('div', { class: 'fact-item', key: i }, [
- h('span', { class: 'fact-num' }, i + 1),
+ // Query
+ props.result.query && h('div', { class: 'query-display' }, props.result.query),
+ // Expandable content
+ h('button', {
+ class: 'expand-details',
+ onClick: () => { expanded.value = !expanded.value }
+ }, expanded.value ? 'Hide Details' : `Show ${props.result.facts.length} Facts`),
+ expanded.value && h('div', { class: 'detail-content' }, [
+ props.result.facts.length > 0 && h('div', { class: 'facts-section' }, [
+ h('div', { class: 'section-label' }, 'Key Facts'),
+ ...props.result.facts.map((fact, i) => h('div', { class: 'fact-row', key: i }, [
+ h('span', { class: 'fact-idx' }, i + 1),
h('span', { class: 'fact-text' }, fact)
]))
- )
- ]),
-
- // 核心实体
- props.result.entities.length > 0 && h('div', { class: 'collapsible-section' }, [
- h('div', { class: 'section-title', onClick: () => toggleSection('entities') }, [
- h('span', {}, `👥 核心实体 (${props.result.entities.length})`),
- h('span', { class: 'toggle-icon' }, expanded.value.entities ? '−' : '+')
]),
- expanded.value.entities && h('div', { class: 'entities-grid' },
- props.result.entities.map((e, i) => h('div', { class: 'entity-card', key: i }, [
- h('div', { class: 'entity-header' }, [
- h('span', { class: 'entity-name' }, e.name),
- h('span', { class: 'entity-type' }, e.type)
- ]),
- e.summary && h('div', { class: 'entity-summary' }, e.summary.substring(0, 100) + '...')
- ]))
- )
- ]),
-
- // 关系链
- props.result.relations.length > 0 && h('div', { class: 'collapsible-section' }, [
- h('div', { class: 'section-title', onClick: () => toggleSection('relations') }, [
- h('span', {}, `🔗 关系链 (${props.result.relations.length})`),
- h('span', { class: 'toggle-icon' }, expanded.value.relations ? '−' : '+')
+ props.result.entities.length > 0 && h('div', { class: 'entities-section' }, [
+ h('div', { class: 'section-label' }, 'Core Entities'),
+ h('div', { class: 'entity-chips' },
+ props.result.entities.map((e, i) => h('span', { class: 'entity-chip', key: i }, [
+ h('span', { class: 'chip-name' }, e.name),
+ h('span', { class: 'chip-type' }, e.type)
+ ]))
+ )
]),
- expanded.value.relations && h('div', { class: 'relations-list' },
- props.result.relations.map((r, i) => h('div', { class: 'relation-item', key: i }, [
- h('span', { class: 'rel-source' }, r.source),
- h('span', { class: 'rel-arrow' }, '→'),
- h('span', { class: 'rel-type' }, r.relation),
- h('span', { class: 'rel-arrow' }, '→'),
- h('span', { class: 'rel-target' }, r.target)
+ props.result.relations.length > 0 && h('div', { class: 'relations-section' }, [
+ h('div', { class: 'section-label' }, 'Relationships'),
+ ...props.result.relations.map((r, i) => h('div', { class: 'relation-row', key: i }, [
+ h('span', { class: 'rel-node' }, r.source),
+ h('span', { class: 'rel-edge' }, r.relation),
+ h('span', { class: 'rel-node' }, r.target)
]))
- )
+ ])
])
])
}
}
-// PanoramaResult 展示组件
-const PanoramaResult = {
+// Panorama Display Component
+const PanoramaDisplay = {
props: ['result'],
setup(props) {
- const expanded = ref({ active: true, history: false, entities: false })
- const toggleSection = (section) => { expanded.value[section] = !expanded.value[section] }
- return () => h('div', { class: 'panorama-result' }, [
- // 统计卡片
- h('div', { class: 'stats-cards' }, [
- h('div', { class: 'stat-card nodes' }, [
+ const expanded = ref(false)
+ return () => h('div', { class: 'panorama-display' }, [
+ h('div', { class: 'stat-row' }, [
+ h('div', { class: 'stat-box' }, [
h('span', { class: 'stat-num' }, props.result.stats.nodes),
- h('span', { class: 'stat-name' }, '总节点')
+ h('span', { class: 'stat-label' }, 'Nodes')
]),
- h('div', { class: 'stat-card edges' }, [
+ h('div', { class: 'stat-box' }, [
h('span', { class: 'stat-num' }, props.result.stats.edges),
- h('span', { class: 'stat-name' }, '总边数')
+ h('span', { class: 'stat-label' }, 'Edges')
]),
- h('div', { class: 'stat-card active' }, [
+ h('div', { class: 'stat-box highlight' }, [
h('span', { class: 'stat-num' }, props.result.stats.activeFacts),
- h('span', { class: 'stat-name' }, '有效事实')
+ h('span', { class: 'stat-label' }, 'Active')
]),
- h('div', { class: 'stat-card history' }, [
+ h('div', { class: 'stat-box muted' }, [
h('span', { class: 'stat-num' }, props.result.stats.historicalFacts),
- h('span', { class: 'stat-name' }, '历史事实')
+ h('span', { class: 'stat-label' }, 'Historical')
])
]),
-
- // 当前有效事实
- props.result.activeFacts.length > 0 && h('div', { class: 'collapsible-section' }, [
- h('div', { class: 'section-title active', onClick: () => toggleSection('active') }, [
- h('span', {}, `✅ 当前有效事实 (${props.result.activeFacts.length})`),
- h('span', { class: 'toggle-icon' }, expanded.value.active ? '−' : '+')
- ]),
- expanded.value.active && h('div', { class: 'facts-list' },
- props.result.activeFacts.map((fact, i) => h('div', { class: 'fact-item active', key: i }, [
- h('span', { class: 'fact-num' }, i + 1),
+ props.result.query && h('div', { class: 'query-display' }, props.result.query),
+ h('button', {
+ class: 'expand-details',
+ onClick: () => { expanded.value = !expanded.value }
+ }, expanded.value ? 'Hide Details' : `Show ${props.result.activeFacts.length} Active Facts`),
+ expanded.value && h('div', { class: 'detail-content' }, [
+ props.result.activeFacts.length > 0 && h('div', { class: 'facts-section' }, [
+ h('div', { class: 'section-label' }, 'Active Facts'),
+ ...props.result.activeFacts.map((fact, i) => h('div', { class: 'fact-row active', key: i }, [
+ h('span', { class: 'fact-idx' }, i + 1),
h('span', { class: 'fact-text' }, fact)
]))
- )
- ]),
-
- // 历史事实
- props.result.historicalFacts.length > 0 && h('div', { class: 'collapsible-section' }, [
- h('div', { class: 'section-title history', onClick: () => toggleSection('history') }, [
- h('span', {}, `📜 历史/过期事实 (${props.result.historicalFacts.length})`),
- h('span', { class: 'toggle-icon' }, expanded.value.history ? '−' : '+')
- ]),
- expanded.value.history && h('div', { class: 'facts-list' },
- props.result.historicalFacts.map((fact, i) => h('div', { class: 'fact-item history', key: i }, [
- h('span', { class: 'fact-num' }, i + 1),
- h('div', { class: 'fact-content' }, [
- fact.timeRange && h('span', { class: 'time-range' }, fact.timeRange),
- h('span', { class: 'fact-text' }, fact.content)
- ])
- ]))
- )
- ]),
-
- // 涉及实体
- props.result.entities.length > 0 && h('div', { class: 'collapsible-section' }, [
- h('div', { class: 'section-title', onClick: () => toggleSection('entities') }, [
- h('span', {}, `👥 涉及实体 (${props.result.entities.length})`),
- h('span', { class: 'toggle-icon' }, expanded.value.entities ? '−' : '+')
]),
- expanded.value.entities && h('div', { class: 'entity-tags' },
- props.result.entities.map((e, i) => h('span', { class: 'entity-tag', key: i }, [
- h('span', { class: 'tag-name' }, e.name),
- h('span', { class: 'tag-type' }, e.type)
- ]))
- )
+ props.result.entities.length > 0 && h('div', { class: 'entities-section' }, [
+ h('div', { class: 'section-label' }, 'Related Entities'),
+ h('div', { class: 'entity-chips' },
+ props.result.entities.map((e, i) => h('span', { class: 'entity-chip', key: i }, [
+ h('span', { class: 'chip-name' }, e.name),
+ h('span', { class: 'chip-type' }, e.type)
+ ]))
+ )
+ ])
])
])
}
}
-// InterviewResult 展示组件
-const InterviewResult = {
+// Interview Display Component - Beautiful Interview Style
+const InterviewDisplay = {
props: ['result'],
setup(props) {
- const expandedInterview = ref(0)
- return () => h('div', { class: 'interview-result' }, [
- // 采访信息
+ const activeIndex = ref(0)
+ return () => h('div', { class: 'interview-display' }, [
+ // Header
h('div', { class: 'interview-header' }, [
- h('div', { class: 'interview-topic' }, props.result.topic),
- h('div', { class: 'interview-count' }, props.result.agentCount)
+ h('div', { class: 'interview-topic' }, props.result.topic || 'Agent Interview'),
+ h('div', { class: 'interview-meta' }, props.result.agentCount)
]),
-
- // 采访列表
- props.result.interviews.length > 0 && h('div', { class: 'interviews-list' },
+ // Interview Cards
+ props.result.interviews.length > 0 && h('div', { class: 'interview-carousel' },
props.result.interviews.map((interview, i) => h('div', {
- class: ['interview-card', { expanded: expandedInterview.value === i }],
+ class: ['interview-card', { active: activeIndex.value === i }],
key: i,
- onClick: () => { expandedInterview.value = expandedInterview.value === i ? -1 : i }
+ onClick: () => { activeIndex.value = i }
}, [
- h('div', { class: 'interview-card-header' }, [
- h('span', { class: 'interview-num' }, `#${interview.num}`),
- h('span', { class: 'interview-name' }, interview.name),
- h('span', { class: 'interview-role' }, interview.role),
- h('span', { class: 'expand-icon' }, expandedInterview.value === i ? '−' : '+')
+ // Interviewee Info
+ h('div', { class: 'interviewee' }, [
+ h('div', { class: 'avatar' }, interview.name.charAt(0)),
+ h('div', { class: 'info' }, [
+ h('span', { class: 'name' }, interview.name),
+ h('span', { class: 'role' }, interview.role)
+ ]),
+ h('span', { class: 'interview-idx' }, `#${interview.num}`)
]),
- expandedInterview.value === i && h('div', { class: 'interview-card-body' }, [
- h('div', { class: 'interview-bio' }, interview.bio),
- h('div', { class: 'interview-qa' }, [
- h('div', { class: 'qa-question' }, [
- h('span', { class: 'qa-label' }, 'Q:'),
- h('span', {}, interview.question)
- ]),
- h('div', { class: 'qa-answer' }, [
- h('span', { class: 'qa-label' }, 'A:'),
- h('span', {}, interview.answer)
- ])
+ // Bio
+ interview.bio && h('div', { class: 'bio' }, interview.bio.length > 80 ? interview.bio.substring(0, 80) + '...' : interview.bio),
+ // Q&A Section
+ activeIndex.value === i && h('div', { class: 'qa-section' }, [
+ h('div', { class: 'question' }, [
+ h('div', { class: 'q-label' }, 'Q'),
+ h('div', { class: 'q-text' }, interview.question.length > 200 ? interview.question.substring(0, 200) + '...' : interview.question)
]),
- interview.quotes.length > 0 && h('div', { class: 'interview-quotes' },
- interview.quotes.map((q, qi) => h('div', { class: 'quote-item', key: qi }, `"${q}"`))
+ h('div', { class: 'answer' }, [
+ h('div', { class: 'a-label' }, 'A'),
+ h('div', { class: 'a-text' }, interview.answer.length > 400 ? interview.answer.substring(0, 400) + '...' : interview.answer)
+ ]),
+ // Key Quotes
+ interview.quotes.length > 0 && h('div', { class: 'quotes' },
+ interview.quotes.map((q, qi) => h('blockquote', { class: 'quote', key: qi }, `"${q.length > 100 ? q.substring(0, 100) + '...' : q}"`))
)
])
]))
),
-
- // 摘要
+ // Navigation dots
+ props.result.interviews.length > 1 && h('div', { class: 'carousel-dots' },
+ props.result.interviews.map((_, i) => h('span', {
+ class: ['dot', { active: activeIndex.value === i }],
+ key: i,
+ onClick: () => { activeIndex.value = i }
+ }))
+ ),
+ // Summary
props.result.summary && h('div', { class: 'interview-summary' }, [
- h('div', { class: 'summary-title' }, '📋 核心观点摘要'),
- h('div', { class: 'summary-content' }, props.result.summary)
+ h('div', { class: 'summary-label' }, 'Summary'),
+ h('div', { class: 'summary-text' }, props.result.summary)
])
])
}
}
-// QuickSearchResult 展示组件
-const QuickSearchResult = {
+// Quick Search Display Component
+const QuickSearchDisplay = {
props: ['result'],
setup(props) {
- return () => h('div', { class: 'quick-search-result' }, [
- h('div', { class: 'search-header' }, [
+ const expanded = ref(false)
+ return () => h('div', { class: 'quick-search-display' }, [
+ h('div', { class: 'search-meta' }, [
h('span', { class: 'search-query' }, props.result.query),
- h('span', { class: 'search-count' }, `${props.result.count} 条结果`)
+ h('span', { class: 'search-count' }, `${props.result.count} results`)
]),
- props.result.facts.length > 0 && h('div', { class: 'search-facts' },
- props.result.facts.map((fact, i) => h('div', { class: 'search-fact-item', key: i }, [
- h('span', { class: 'fact-num' }, i + 1),
+ h('button', {
+ class: 'expand-details',
+ onClick: () => { expanded.value = !expanded.value }
+ }, expanded.value ? 'Hide Results' : 'Show Results'),
+ expanded.value && props.result.facts.length > 0 && h('div', { class: 'search-results' },
+ props.result.facts.map((fact, i) => h('div', { class: 'search-fact', key: i }, [
+ h('span', { class: 'fact-idx' }, i + 1),
h('span', { class: 'fact-text' }, fact)
]))
)
@@ -820,9 +801,9 @@ const statusClass = computed(() => {
})
const statusText = computed(() => {
- if (isComplete.value) return '已完成'
- if (agentLogs.value.length > 0) return '生成中...'
- return '等待中'
+ if (isComplete.value) return 'Completed'
+ if (agentLogs.value.length > 0) return 'Generating...'
+ return 'Waiting'
})
const totalSections = computed(() => {
@@ -833,6 +814,11 @@ const completedSections = computed(() => {
return Object.keys(generatedSections.value).length
})
+const progressPercent = computed(() => {
+ if (totalSections.value === 0) return 0
+ return Math.round((completedSections.value / totalSections.value) * 100)
+})
+
const totalToolCalls = computed(() => {
return agentLogs.value.filter(l => l.action === 'tool_call').length
})
@@ -847,9 +833,7 @@ const formatElapsedTime = computed(() => {
return `${mins}m ${secs}s`
})
-// 只显示最近的重要日志,避免列表过长
const displayLogs = computed(() => {
- // 显示所有日志,但可以根据需要过滤
return agentLogs.value
})
@@ -858,17 +842,6 @@ const addLog = (msg) => {
emit('add-log', msg)
}
-const toggleSection = (idx) => {
- if (!generatedSections.value[idx + 1]) return
- const newSet = new Set(expandedSections.value)
- if (newSet.has(idx)) {
- newSet.delete(idx)
- } else {
- newSet.add(idx)
- }
- expandedSections.value = newSet
-}
-
const isSectionCompleted = (sectionIndex) => {
return !!generatedSections.value[sectionIndex]
}
@@ -896,95 +869,109 @@ const formatParams = (params) => {
}
}
+const formatResultSize = (length) => {
+ if (!length) return ''
+ if (length < 1000) return `${length} chars`
+ return `${(length / 1000).toFixed(1)}k chars`
+}
+
+const truncateText = (text, maxLen) => {
+ if (!text) return ''
+ if (text.length <= maxLen) return text
+ return text.substring(0, maxLen) + '...'
+}
+
const renderMarkdown = (content) => {
if (!content) return ''
- // 简单的 markdown 渲染:转换换行为 <br>,处理标题
- return content
- .replace(/^### (.+)$/gm, '<h4>$1</h4>')
- .replace(/^## (.+)$/gm, '<h3>$1</h3>')
- .replace(/^# (.+)$/gm, '<h2>$1</h2>')
- .replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>')
- .replace(/\*(.+?)\*/g, '<em>$1</em>')
- .replace(/\n/g, '<br>')
+
+ // 处理代码块
+ let html = content.replace(/```(\w*)\n([\s\S]*?)```/g, '<pre class="code-block"><code>$2</code></pre>')
+
+ // 处理行内代码
+ html = html.replace(/`([^`]+)`/g, '<code class="inline-code">$1</code>')
+
+ // 处理标题
+ html = html.replace(/^#### (.+)$/gm, '<h5 class="md-h5">$1</h5>')
+ html = html.replace(/^### (.+)$/gm, '<h4 class="md-h4">$1</h4>')
+ html = html.replace(/^## (.+)$/gm, '<h3 class="md-h3">$1</h3>')
+ html = html.replace(/^# (.+)$/gm, '<h2 class="md-h2">$1</h2>')
+
+ // 处理引用块
+ html = html.replace(/^> (.+)$/gm, '<blockquote class="md-quote">$1</blockquote>')
+
+ // 处理无序列表
+ html = html.replace(/^- (.+)$/gm, '<li class="md-li">$1</li>')
+ html = html.replace(/(<li class="md-li">[\s\S]*?<\/li>)(\s*<li)/g, '$1$2')
+ html = html.replace(/(<li class="md-li">.*<\/li>)+/g, '<ul class="md-ul">$&</ul>')
+
+ // 处理有序列表
+ html = html.replace(/^\d+\. (.+)$/gm, '<li class="md-oli">$1</li>')
+ html = html.replace(/(<li class="md-oli">.*<\/li>)+/g, '<ol class="md-ol">$&</ol>')
+
+ // 处理粗体和斜体
+ html = html.replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>')
+ html = html.replace(/\*(.+?)\*/g, '<em>$1</em>')
+ html = html.replace(/_(.+?)_/g, '<em>$1</em>')
+
+ // 处理分隔线
+ html = html.replace(/^---$/gm, '<hr class="md-hr">')
+
+ // 处理换行 - 空行变成段落分隔,单换行变成 <br>
+ html = html.replace(/\n\n/g, '</p><p class="md-p">')
+ html = html.replace(/\n/g, '<br>')
+
+ // 包装在段落中
+ html = '<p class="md-p">' + html + '</p>'
+
+ // 清理空段落
+ html = html.replace(/<p class="md-p"><\/p>/g, '')
+ html = html.replace(/<p class="md-p">(<h[2-5])/g, '$1')
+ html = html.replace(/(<\/h[2-5]>)<\/p>/g, '$1')
+ html = html.replace(/<p class="md-p">(<ul|<ol|<blockquote|<pre|<hr)/g, '$1')
+ html = html.replace(/(<\/ul>|<\/ol>|<\/blockquote>|<\/pre>)<\/p>/g, '$1')
+
+ return html
}
-const getLogClass = (log) => {
+const getTimelineItemClass = (log) => {
return {
'is-tool': log.action === 'tool_call' || log.action === 'tool_result',
- 'is-section': log.action === 'section_start' || log.action === 'section_complete',
+ 'is-section': log.action === 'section_start' || log.action === 'section_complete' || log.action === 'section_content' || log.action === 'subsection_content',
'is-complete': log.action === 'report_complete',
'is-planning': log.action === 'planning_start' || log.action === 'planning_complete'
}
}
-const getMarkerClass = (log) => {
+const getConnectorClass = (log) => {
const classes = {
- 'report_start': 'marker-start',
- 'planning_start': 'marker-planning',
- 'planning_complete': 'marker-planning',
- 'section_start': 'marker-section',
- 'section_complete': 'marker-section-done',
- 'tool_call': 'marker-tool',
- 'tool_result': 'marker-tool-result',
- 'llm_response': 'marker-llm',
- 'report_complete': 'marker-complete'
+ 'report_start': 'dot-start',
+ 'planning_start': 'dot-planning',
+ 'planning_complete': 'dot-planning',
+ 'section_start': 'dot-section',
+ 'section_content': 'dot-section-content',
+ 'subsection_content': 'dot-subsection-content',
+ 'section_complete': 'dot-section-done',
+ 'tool_call': 'dot-tool',
+ 'tool_result': 'dot-result',
+ 'llm_response': 'dot-llm',
+ 'report_complete': 'dot-complete'
}
- return classes[log.action] || 'marker-default'
-}
-
-const getLogIcon = (log) => {
- const icons = {
- 'report_start': () => h('svg', { viewBox: '0 0 24 24', width: 12, height: 12, fill: 'none', stroke: 'currentColor', 'stroke-width': 2 }, [
- h('circle', { cx: 12, cy: 12, r: 10 }),
- h('polygon', { points: '10 8 16 12 10 16 10 8' })
- ]),
- 'planning_start': () => h('svg', { viewBox: '0 0 24 24', width: 12, height: 12, fill: 'none', stroke: 'currentColor', 'stroke-width': 2 }, [
- h('line', { x1: 8, y1: 6, x2: 21, y2: 6 }),
- h('line', { x1: 8, y1: 12, x2: 21, y2: 12 }),
- h('line', { x1: 8, y1: 18, x2: 21, y2: 18 }),
- h('line', { x1: 3, y1: 6, x2: 3.01, y2: 6 }),
- h('line', { x1: 3, y1: 12, x2: 3.01, y2: 12 }),
- h('line', { x1: 3, y1: 18, x2: 3.01, y2: 18 })
- ]),
- 'planning_complete': () => h('svg', { viewBox: '0 0 24 24', width: 12, height: 12, fill: 'none', stroke: 'currentColor', 'stroke-width': 2 }, [
- h('polyline', { points: '20 6 9 17 4 12' })
- ]),
- 'section_start': () => h('svg', { viewBox: '0 0 24 24', width: 12, height: 12, fill: 'none', stroke: 'currentColor', 'stroke-width': 2 }, [
- h('path', { d: 'M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z' }),
- h('polyline', { points: '14 2 14 8 20 8' })
- ]),
- 'section_complete': () => h('svg', { viewBox: '0 0 24 24', width: 12, height: 12, fill: 'none', stroke: 'currentColor', 'stroke-width': 2 }, [
- h('path', { d: 'M22 11.08V12a10 10 0 1 1-5.93-9.14' }),
- h('polyline', { points: '22 4 12 14.01 9 11.01' })
- ]),
- 'tool_call': () => h('svg', { viewBox: '0 0 24 24', width: 12, height: 12, fill: 'none', stroke: 'currentColor', 'stroke-width': 2 }, [
- h('path', { d: 'M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z' })
- ]),
- 'tool_result': () => h('svg', { viewBox: '0 0 24 24', width: 12, height: 12, fill: 'none', stroke: 'currentColor', 'stroke-width': 2 }, [
- h('polyline', { points: '22 12 18 12 15 21 9 3 6 12 2 12' })
- ]),
- 'llm_response': () => h('svg', { viewBox: '0 0 24 24', width: 12, height: 12, fill: 'none', stroke: 'currentColor', 'stroke-width': 2 }, [
- h('path', { d: 'M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z' })
- ]),
- 'report_complete': () => h('svg', { viewBox: '0 0 24 24', width: 12, height: 12, fill: 'none', stroke: 'currentColor', 'stroke-width': 2 }, [
- h('path', { d: 'M22 11.08V12a10 10 0 1 1-5.93-9.14' }),
- h('polyline', { points: '22 4 12 14.01 9 11.01' })
- ])
- }
- return icons[log.action] || icons['report_start']
+ return classes[log.action] || 'dot-default'
}
const getActionLabel = (action) => {
const labels = {
- 'report_start': '报告启动',
- 'planning_start': '开始规划',
- 'planning_complete': '规划完成',
- 'section_start': '章节开始',
- 'section_complete': '章节完成',
- 'tool_call': '工具调用',
- 'tool_result': '工具返回',
- 'llm_response': 'LLM 响应',
- 'report_complete': '报告完成'
+ 'report_start': 'Report Started',
+ 'planning_start': 'Planning',
+ 'planning_complete': 'Plan Complete',
+ 'section_start': 'Section Start',
+ 'section_content': 'Content Ready',
+ 'subsection_content': 'Subsection Ready',
+ 'section_complete': 'Section Done',
+ 'tool_call': 'Tool Call',
+ 'tool_result': 'Tool Result',
+ 'llm_response': 'LLM Response',
+ 'report_complete': 'Complete'
}
return labels[action] || action
}
@@ -992,7 +979,7 @@ const getActionLabel = (action) => {
const getLogLevelClass = (log) => {
if (log.includes('ERROR') || log.includes('错误')) return 'error'
if (log.includes('WARNING') || log.includes('警告')) return 'warning'
- if (log.includes('✓') || log.includes('完成')) return 'success'
+ // INFO 使用默认颜色,不标记为 success
return ''
}
@@ -1010,37 +997,41 @@ const fetchAgentLog = async () => {
const newLogs = res.data.logs || []
if (newLogs.length > 0) {
- // 处理新日志
newLogs.forEach(log => {
agentLogs.value.push(log)
- // 提取大纲
if (log.action === 'planning_complete' && log.details?.outline) {
reportOutline.value = log.details.outline
}
- // 追踪当前章节
if (log.action === 'section_start') {
currentSectionIndex.value = log.section_index
}
- // 记录已完成章节(简单标记,实际内容需要从其他地方获取)
+ // section_content / subsection_content - 表示内容生成完成(但整个章节可能还没完成)
+ // 这里不更新 generatedSections,只记录进度
+ if (log.action === 'section_content' || log.action === 'subsection_content') {
+ // 可以用于显示进度,但不更新左侧面板的内容
+ // 因为完整内容会在 section_complete 时一次性提供
+ }
+
+ // section_complete - 表示完整章节(含所有子章节)生成完成
+ // details.content 包含合并后的完整内容
if (log.action === 'section_complete') {
- // 这里简单标记为完成,实际内容可能需要另外获取
- if (!generatedSections.value[log.section_index]) {
- generatedSections.value[log.section_index] = `## ${log.section_title}\n\n章节内容已生成。`
+ if (log.details?.content) {
+ generatedSections.value[log.section_index] = log.details.content
+ // 自动展开刚生成的章节
+ expandedContent.value.add(log.section_index - 1)
}
currentSectionIndex.value = null
}
- // 检测报告完成
if (log.action === 'report_complete') {
isComplete.value = true
emit('update-status', 'completed')
stopPolling()
}
- // 记录开始时间
if (log.action === 'report_start') {
startTime.value = new Date(log.timestamp)
}
@@ -1048,17 +1039,61 @@ const fetchAgentLog = async () => {
agentLogLine.value = res.data.from_line + newLogs.length
- // 滚动到底部
nextTick(() => {
- if (mainContent.value) {
- mainContent.value.scrollTop = mainContent.value.scrollHeight
+ if (rightPanel.value) {
+ rightPanel.value.scrollTop = rightPanel.value.scrollHeight
}
})
}
}
} catch (err) {
- console.warn('获取 Agent 日志失败:', err)
+ console.warn('Failed to fetch agent log:', err)
+ }
+}
+
+// 提取最终答案内容 - 从 LLM response 中提取章节内容
+const extractFinalContent = (response) => {
+ if (!response) return null
+
+ // 尝试提取 <final_answer> 标签内的内容
+ const finalAnswerTagMatch = response.match(/<final_answer>([\s\S]*?)<\/final_answer>/)
+ if (finalAnswerTagMatch) {
+ return finalAnswerTagMatch[1].trim()
}
+
+ // 尝试找 Final Answer: 后面的内容(支持多种格式)
+ // 格式1: Final Answer:\n\n内容
+ // 格式2: Final Answer: 内容
+ const finalAnswerMatch = response.match(/Final\s*Answer:\s*\n*([\s\S]*)$/i)
+ if (finalAnswerMatch) {
+ return finalAnswerMatch[1].trim()
+ }
+
+ // 尝试找 最终答案: 后面的内容
+ const chineseFinalMatch = response.match(/最终答案[::]\s*\n*([\s\S]*)$/i)
+ if (chineseFinalMatch) {
+ return chineseFinalMatch[1].trim()
+ }
+
+ // 如果以 ## 或 # 或 > 开头,可能是直接的 markdown 内容
+ const trimmedResponse = response.trim()
+ if (trimmedResponse.match(/^[#>]/)) {
+ return trimmedResponse
+ }
+
+ // 如果内容较长且包含markdown格式,尝试移除思考过程后返回
+ if (response.length > 300 && (response.includes('**') || response.includes('>'))) {
+ // 移除 Thought: 开头的思考过程
+ const thoughtMatch = response.match(/^Thought:[\s\S]*?(?=\n\n[^T]|\n\n$)/i)
+ if (thoughtMatch) {
+ const afterThought = response.substring(thoughtMatch[0].length).trim()
+ if (afterThought.length > 100) {
+ return afterThought
+ }
+ }
+ }
+
+ return null
}
const fetchConsoleLog = async () => {
@@ -1074,7 +1109,6 @@ const fetchConsoleLog = async () => {
consoleLogs.value.push(...newLogs)
consoleLogLine.value = res.data.from_line + newLogs.length
- // 滚动到底部
nextTick(() => {
if (logContent.value) {
logContent.value.scrollTop = logContent.value.scrollHeight
@@ -1083,18 +1117,16 @@ const fetchConsoleLog = async () => {
}
}
} catch (err) {
- console.warn('获取控制台日志失败:', err)
+ console.warn('Failed to fetch console log:', err)
}
}
const startPolling = () => {
if (agentLogTimer || consoleLogTimer) return
- // 立即获取一次
fetchAgentLog()
fetchConsoleLog()
- // 开始轮询
agentLogTimer = setInterval(fetchAgentLog, 2000)
consoleLogTimer = setInterval(fetchConsoleLog, 1500)
}
@@ -1113,7 +1145,7 @@ const stopPolling = () => {
// Lifecycle
onMounted(() => {
if (props.reportId) {
- addLog(`Report Agent 初始化: ${props.reportId}`)
+ addLog(`Report Agent initialized: ${props.reportId}`)
startPolling()
}
})
@@ -1122,10 +1154,8 @@ onUnmounted(() => {
stopPolling()
})
-// Watch for reportId changes
watch(() => props.reportId, (newId) => {
if (newId) {
- // 重置状态
agentLogs.value = []
consoleLogs.value = []
agentLogLine.value = 0
@@ -1133,7 +1163,8 @@ watch(() => props.reportId, (newId) => {
reportOutline.value = null
currentSectionIndex.value = null
generatedSections.value = {}
- expandedSections.value = new Set()
+ expandedContent.value = new Set()
+ expandedLogs.value = new Set()
isComplete.value = false
startTime.value = null
@@ -1147,19 +1178,19 @@ watch(() => props.reportId, (newId) => {
height: 100%;
display: flex;
flex-direction: column;
- background: #FFFFFF;
- font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
+ background: #F8F9FA;
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
overflow: hidden;
}
/* Status Bar */
.status-bar {
- background: #FFF;
- padding: 16px 24px;
+ background: #FFFFFF;
+ padding: 14px 24px;
display: flex;
justify-content: space-between;
align-items: center;
- border-bottom: 1px solid #EAEAEA;
+ border-bottom: 1px solid #E5E7EB;
flex-shrink: 0;
}
@@ -1173,21 +1204,21 @@ watch(() => props.reportId, (newId) => {
display: flex;
align-items: center;
gap: 8px;
- padding: 6px 12px;
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
+ padding: 6px 14px;
+ background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
border-radius: 20px;
color: #FFF;
}
.badge-icon {
- font-size: 14px;
+ flex-shrink: 0;
}
.badge-text {
font-size: 12px;
font-weight: 600;
text-transform: uppercase;
- letter-spacing: 0.05em;
+ letter-spacing: 0.04em;
}
.status-indicator {
@@ -1195,25 +1226,28 @@ watch(() => props.reportId, (newId) => {
align-items: center;
gap: 8px;
font-size: 13px;
- color: #666;
+ color: #6B7280;
}
.status-indicator .dot {
width: 8px;
height: 8px;
border-radius: 50%;
- background: #CCC;
+ background: #D1D5DB;
}
-.status-indicator.pending .dot { background: #999; }
-.status-indicator.processing .dot { background: #FF9800; animation: pulse 1s infinite; }
-.status-indicator.completed .dot { background: #4CAF50; }
+.status-indicator.pending .dot { background: #9CA3AF; }
+.status-indicator.processing .dot { background: #F59E0B; animation: pulse 1.2s infinite; }
+.status-indicator.completed .dot { background: #10B981; }
-@keyframes pulse { 50% { opacity: 0.5; } }
+@keyframes pulse {
+ 0%, 100% { opacity: 1; transform: scale(1); }
+ 50% { opacity: 0.6; transform: scale(1.1); }
+}
.stats-group {
display: flex;
- gap: 20px;
+ gap: 24px;
}
.stat-item {
@@ -1225,7 +1259,7 @@ watch(() => props.reportId, (newId) => {
.stat-label {
font-size: 10px;
- color: #999;
+ color: #9CA3AF;
text-transform: uppercase;
letter-spacing: 0.05em;
}
@@ -1233,1153 +1267,1369 @@ watch(() => props.reportId, (newId) => {
.stat-value {
font-size: 14px;
font-weight: 600;
- color: #333;
+ color: #374151;
}
.mono {
- font-family: 'JetBrains Mono', monospace;
+ font-family: 'JetBrains Mono', 'SF Mono', monospace;
}
-/* Main Content */
-.main-content-area {
+/* Main Split Layout */
+.main-split-layout {
flex: 1;
- overflow-y: auto;
- padding: 24px;
- background: #FAFAFA;
-}
-
-/* Outline Card */
-.outline-card {
- background: #FFF;
- border: 1px solid #E0E0E0;
- border-radius: 12px;
- padding: 20px 24px;
- margin-bottom: 24px;
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
+ display: flex;
+ overflow: hidden;
}
-.outline-header {
+/* Panel Headers */
+.panel-header {
display: flex;
- justify-content: space-between;
align-items: center;
- margin-bottom: 12px;
+ gap: 10px;
+ padding: 14px 20px;
+ background: #FFFFFF;
+ border-bottom: 1px solid #E5E7EB;
+ font-size: 13px;
+ font-weight: 600;
+ color: #374151;
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+ position: sticky;
+ top: 0;
+ z-index: 10;
+}
+
+.panel-header svg {
+ color: #6366F1;
+}
+
+.log-count {
+ margin-left: auto;
+ background: #EEF2FF;
+ color: #4F46E5;
+ padding: 2px 8px;
+ border-radius: 10px;
+ font-size: 11px;
}
-.outline-title-wrapper {
+/* Left Panel */
+.left-panel {
+ width: 45%;
+ min-width: 350px;
+ background: #FFFFFF;
+ border-right: 1px solid #E5E7EB;
+ overflow-y: auto;
display: flex;
- align-items: center;
- gap: 12px;
+ flex-direction: column;
}
-.outline-icon {
- color: #667eea;
+.outline-overview {
+ padding: 20px;
+ border-bottom: 1px solid #F3F4F6;
}
-.outline-title {
+.report-title {
font-size: 18px;
font-weight: 700;
- color: #1a1a1a;
- margin: 0;
-}
-
-.outline-badge {
- font-size: 11px;
- font-weight: 600;
- padding: 4px 10px;
- background: #E8F5E9;
- color: #2E7D32;
- border-radius: 12px;
+ color: #111827;
+ margin: 0 0 8px;
+ line-height: 1.4;
}
-.outline-summary {
- font-size: 14px;
- color: #666;
+.report-summary {
+ font-size: 13px;
+ color: #6B7280;
line-height: 1.6;
margin: 0 0 16px;
- padding-bottom: 16px;
- border-bottom: 1px solid #F0F0F0;
}
-.outline-sections {
+.progress-wrapper {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+}
+
+.progress-bar {
+ flex: 1;
+ height: 6px;
+ background: #E5E7EB;
+ border-radius: 3px;
+ overflow: hidden;
+}
+
+.progress-fill {
+ height: 100%;
+ background: linear-gradient(90deg, #4F46E5 0%, #7C3AED 100%);
+ border-radius: 3px;
+ transition: width 0.5s ease;
+}
+
+.progress-text {
+ font-size: 12px;
+ font-weight: 600;
+ color: #4F46E5;
+ min-width: 36px;
+ text-align: right;
+}
+
+/* Section Cards */
+.sections-container {
+ padding: 16px;
display: flex;
flex-direction: column;
- gap: 8px;
+ gap: 10px;
}
-.outline-section-item {
+.section-card {
background: #FAFAFA;
- border: 1px solid #EAEAEA;
- border-radius: 8px;
- transition: all 0.2s;
- cursor: pointer;
+ border: 1px solid #E5E7EB;
+ border-radius: 10px;
+ overflow: hidden;
+ transition: all 0.2s ease;
}
-.outline-section-item:hover {
- background: #F5F5F5;
- border-color: #DDD;
+.section-card:hover {
+ border-color: #D1D5DB;
}
-.outline-section-item.current {
- border-color: #FF9800;
- background: #FFF8E1;
+.section-card.current {
+ border-color: #F59E0B;
+ background: #FFFBEB;
}
-.outline-section-item.completed {
- border-color: #4CAF50;
- background: #F1F8E9;
+.section-card.completed {
+ border-color: #10B981;
+ background: #ECFDF5;
}
-.section-header {
+.section-card-header {
display: flex;
align-items: center;
gap: 12px;
- padding: 12px 16px;
+ padding: 14px 16px;
+ cursor: pointer;
}
-.section-num {
- font-family: 'JetBrains Mono', monospace;
- font-size: 12px;
- font-weight: 600;
- color: #999;
- min-width: 24px;
+.section-indicator {
+ width: 28px;
+ height: 28px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 50%;
+ background: #E5E7EB;
+ flex-shrink: 0;
}
-.section-title {
- flex: 1;
- font-size: 14px;
- font-weight: 500;
- color: #333;
+.section-card.completed .section-indicator {
+ background: #10B981;
}
-.section-status {
- width: 20px;
- height: 20px;
- display: flex;
- align-items: center;
- justify-content: center;
+.section-card.current .section-indicator {
+ background: #F59E0B;
}
-.section-status svg {
- color: #4CAF50;
+.check-icon {
+ color: #FFFFFF;
}
-.generating-dot {
- width: 8px;
- height: 8px;
- background: #FF9800;
+.generating-spinner {
+ width: 14px;
+ height: 14px;
+ border: 2px solid rgba(255,255,255,0.3);
+ border-top-color: #FFFFFF;
border-radius: 50%;
- animation: pulse 1s infinite;
+ animation: spin 0.8s linear infinite;
+}
+
+@keyframes spin {
+ to { transform: rotate(360deg); }
+}
+
+.section-number {
+ font-size: 12px;
+ font-weight: 600;
+ color: #6B7280;
+}
+
+.section-name {
+ flex: 1;
+ font-size: 14px;
+ font-weight: 500;
+ color: #374151;
}
-.section-toggle {
+.expand-btn {
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
- background: #E0E0E0;
- border-radius: 4px;
+ background: #E5E7EB;
+ border-radius: 6px;
font-size: 14px;
font-weight: 600;
- color: #666;
+ color: #6B7280;
+ transition: all 0.2s;
}
-.section-content-preview {
- padding: 0 16px 16px;
- border-top: 1px solid #EAEAEA;
- margin-top: 8px;
+.section-card.completed .expand-btn {
+ background: #D1FAE5;
+ color: #059669;
}
-.content-markdown {
- font-size: 13px;
- line-height: 1.7;
- color: #444;
+.section-card:hover .expand-btn {
+ background: #D1D5DB;
}
-.content-markdown :deep(h1),
-.content-markdown :deep(h2),
-.content-markdown :deep(h3) {
- margin-top: 16px;
- margin-bottom: 8px;
- color: #1a1a1a;
+.section-card.completed:hover .expand-btn {
+ background: #A7F3D0;
}
-.content-markdown :deep(p) {
- margin-bottom: 12px;
+.section-content {
+ border-top: 1px solid #E5E7EB;
+ padding: 20px;
+ background: #FFFFFF;
+ max-height: 500px;
+ overflow-y: auto;
}
-.content-markdown :deep(ul),
-.content-markdown :deep(ol) {
- padding-left: 20px;
- margin-bottom: 12px;
+.section-content::-webkit-scrollbar {
+ width: 6px;
}
-/* Action Feed */
-.action-feed {
- background: #FFF;
- border: 1px solid #E0E0E0;
- border-radius: 12px;
- overflow: hidden;
+.section-content::-webkit-scrollbar-track {
+ background: #F3F4F6;
+ border-radius: 3px;
}
-.feed-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 14px 20px;
- background: #FAFAFA;
- border-bottom: 1px solid #EAEAEA;
+.section-content::-webkit-scrollbar-thumb {
+ background: #D1D5DB;
+ border-radius: 3px;
+}
+
+.section-content::-webkit-scrollbar-thumb:hover {
+ background: #9CA3AF;
}
-.feed-title {
+.content-body {
font-size: 13px;
+ line-height: 1.7;
+ color: #4B5563;
+}
+
+.content-body :deep(.md-h2) {
+ font-size: 18px;
+ font-weight: 700;
+ color: #111827;
+ margin: 20px 0 12px;
+ padding-bottom: 8px;
+ border-bottom: 1px solid #E5E7EB;
+}
+
+.content-body :deep(.md-h3) {
+ font-size: 16px;
font-weight: 600;
- color: #333;
- text-transform: uppercase;
- letter-spacing: 0.05em;
+ color: #1F2937;
+ margin: 16px 0 10px;
}
-.feed-count {
+.content-body :deep(.md-h4) {
+ font-size: 14px;
+ font-weight: 600;
+ color: #374151;
+ margin: 14px 0 8px;
+}
+
+.content-body :deep(.md-h5) {
+ font-size: 13px;
+ font-weight: 600;
+ color: #4B5563;
+ margin: 12px 0 6px;
+}
+
+.content-body :deep(.md-p) {
+ margin: 10px 0;
+}
+
+.content-body :deep(.md-quote) {
+ margin: 12px 0;
+ padding: 10px 16px;
+ border-left: 3px solid #6366F1;
+ background: #F3F4F6;
+ color: #4B5563;
+ font-style: italic;
+}
+
+.content-body :deep(.md-ul),
+.content-body :deep(.md-ol) {
+ margin: 10px 0;
+ padding-left: 24px;
+}
+
+.content-body :deep(.md-li),
+.content-body :deep(.md-oli) {
+ margin: 6px 0;
+ line-height: 1.6;
+}
+
+.content-body :deep(.md-hr) {
+ border: none;
+ border-top: 1px solid #E5E7EB;
+ margin: 16px 0;
+}
+
+.content-body :deep(.code-block) {
+ background: #1F2937;
+ color: #E5E7EB;
+ padding: 12px 16px;
+ border-radius: 6px;
+ overflow-x: auto;
+ font-family: 'JetBrains Mono', monospace;
font-size: 12px;
- color: #999;
+ margin: 12px 0;
+}
+
+.content-body :deep(.inline-code) {
+ background: #F3F4F6;
+ color: #DC2626;
+ padding: 2px 6px;
+ border-radius: 4px;
font-family: 'JetBrains Mono', monospace;
+ font-size: 12px;
}
-.feed-timeline {
- padding: 16px 20px;
+.content-body :deep(strong) {
+ color: #111827;
+ font-weight: 600;
}
-.feed-item {
- display: flex;
- gap: 16px;
- padding: 12px 0;
- border-bottom: 1px solid #F5F5F5;
- transition: background 0.2s;
+.content-body :deep(em) {
+ color: #4B5563;
}
-.feed-item:last-child {
- border-bottom: none;
+/* Slide Content Transition */
+.slide-content-enter-active {
+ transition: all 0.4s ease-out;
+ overflow: hidden;
}
-.feed-item:hover {
- background: #FAFAFA;
- margin: 0 -20px;
- padding: 12px 20px;
+.slide-content-leave-active {
+ transition: all 0.3s ease-in;
+ overflow: hidden;
}
-.item-marker {
- flex-shrink: 0;
+.slide-content-enter-from {
+ max-height: 0;
+ opacity: 0;
+ padding: 0 20px;
}
-.marker-icon {
- width: 28px;
- height: 28px;
- border-radius: 50%;
+.slide-content-enter-to {
+ max-height: 500px;
+ opacity: 1;
+}
+
+.slide-content-leave-from {
+ max-height: 500px;
+ opacity: 1;
+}
+
+.slide-content-leave-to {
+ max-height: 0;
+ opacity: 0;
+ padding: 0 20px;
+}
+
+/* Waiting Placeholder */
+.waiting-placeholder {
+ flex: 1;
display: flex;
+ flex-direction: column;
align-items: center;
justify-content: center;
- background: #F0F0F0;
- color: #666;
+ gap: 20px;
+ padding: 40px;
+ color: #9CA3AF;
+}
+
+.waiting-animation {
+ position: relative;
+ width: 48px;
+ height: 48px;
+}
+
+.waiting-ring {
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ border: 2px solid #E5E7EB;
+ border-radius: 50%;
+ animation: ripple 2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
+}
+
+.waiting-ring:nth-child(2) {
+ animation-delay: 0.4s;
+}
+
+.waiting-ring:nth-child(3) {
+ animation-delay: 0.8s;
+}
+
+@keyframes ripple {
+ 0% { transform: scale(0.5); opacity: 1; }
+ 100% { transform: scale(2); opacity: 0; }
+}
+
+.waiting-text {
+ font-size: 14px;
}
-.marker-start { background: #E3F2FD; color: #1976D2; }
-.marker-planning { background: #FFF3E0; color: #F57C00; }
-.marker-section { background: #E8F5E9; color: #388E3C; }
-.marker-section-done { background: #C8E6C9; color: #2E7D32; }
-.marker-tool { background: #F3E5F5; color: #7B1FA2; }
-.marker-tool-result { background: #FCE4EC; color: #C2185B; }
-.marker-llm { background: #E0F7FA; color: #00838F; }
-.marker-complete { background: #C8E6C9; color: #1B5E20; }
+/* Right Panel */
+.right-panel {
+ flex: 1;
+ background: #F8F9FA;
+ overflow-y: auto;
+ display: flex;
+ flex-direction: column;
+}
-.item-content {
+/* Workflow Timeline */
+.workflow-timeline {
+ padding: 20px;
flex: 1;
- min-width: 0;
}
-.item-header {
+.timeline-item {
display: flex;
+ gap: 16px;
+ margin-bottom: 4px;
+}
+
+.timeline-connector {
+ display: flex;
+ flex-direction: column;
align-items: center;
- gap: 10px;
- margin-bottom: 8px;
+ width: 24px;
+ flex-shrink: 0;
}
-.item-action {
- font-size: 13px;
- font-weight: 600;
- color: #333;
+.connector-dot {
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background: #D1D5DB;
+ border: 2px solid #F8F9FA;
+ z-index: 1;
}
-.item-stage {
- font-size: 10px;
- font-weight: 500;
- padding: 2px 8px;
+.connector-line {
+ width: 2px;
+ flex: 1;
+ background: #E5E7EB;
+ margin-top: -2px;
+}
+
+/* Dot colors */
+.dot-start { background: #3B82F6; }
+.dot-planning { background: #F59E0B; }
+.dot-section { background: #10B981; }
+.dot-section-content { background: #34D399; }
+.dot-subsection-content { background: #6EE7B7; }
+.dot-section-done { background: #059669; box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2); }
+.dot-tool { background: #8B5CF6; }
+.dot-result { background: #EC4899; }
+.dot-llm { background: #06B6D4; }
+.dot-complete { background: #10B981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
+
+.timeline-content {
+ flex: 1;
+ background: #FFFFFF;
+ border: 1px solid #E5E7EB;
border-radius: 10px;
- background: #F0F0F0;
- color: #666;
- text-transform: uppercase;
+ padding: 14px 16px;
+ margin-bottom: 12px;
+ transition: all 0.2s ease;
+}
+
+.timeline-content:hover {
+ border-color: #D1D5DB;
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
+}
+
+.timeline-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: 10px;
}
-.item-stage.pending { background: #FFF3E0; color: #E65100; }
-.item-stage.planning { background: #E3F2FD; color: #1565C0; }
-.item-stage.generating { background: #F3E5F5; color: #7B1FA2; }
-.item-stage.completed { background: #E8F5E9; color: #2E7D32; }
+.action-label {
+ font-size: 12px;
+ font-weight: 600;
+ color: #374151;
+ text-transform: uppercase;
+ letter-spacing: 0.03em;
+}
-.item-time {
+.action-time {
font-size: 11px;
- color: #999;
+ color: #9CA3AF;
font-family: 'JetBrains Mono', monospace;
- margin-left: auto;
}
-.item-body {
+.timeline-body {
font-size: 13px;
- color: #555;
- line-height: 1.5;
+ color: #4B5563;
}
-.item-footer {
- margin-top: 8px;
+.timeline-footer {
+ margin-top: 10px;
+ padding-top: 10px;
+ border-top: 1px solid #F3F4F6;
}
-.elapsed {
+.elapsed-badge {
font-size: 11px;
- color: #999;
+ color: #6B7280;
+ background: #F3F4F6;
+ padding: 2px 8px;
+ border-radius: 10px;
font-family: 'JetBrains Mono', monospace;
}
-/* Item Body Blocks */
-.info-block {
+/* Timeline Body Elements */
+.info-row {
display: flex;
gap: 8px;
margin-bottom: 6px;
}
-.info-label {
- color: #888;
- font-size: 12px;
+.info-key {
+ font-size: 11px;
+ color: #9CA3AF;
+ min-width: 80px;
}
-.info-value {
- color: #333;
+.info-val {
+ color: #374151;
}
-.message-text {
- color: #555;
+.status-message {
+ padding: 8px 12px;
+ border-radius: 6px;
+ font-size: 13px;
}
-.message-text.success {
- color: #2E7D32;
- font-weight: 500;
+.status-message.planning {
+ background: #FEF3C7;
+ color: #92400E;
}
-.outline-mini {
- margin-top: 8px;
- padding: 8px 12px;
- background: #F5F5F5;
- border-radius: 6px;
+.status-message.success {
+ background: #D1FAE5;
+ color: #065F46;
}
-.mini-label {
- font-size: 12px;
- color: #666;
+.outline-badge {
+ display: inline-block;
+ margin-top: 8px;
+ padding: 4px 10px;
+ background: #EEF2FF;
+ color: #4338CA;
+ border-radius: 12px;
+ font-size: 11px;
+ font-weight: 500;
}
-.section-info {
- display: flex;
+.section-tag {
+ display: inline-flex;
align-items: center;
- gap: 10px;
+ gap: 8px;
+ padding: 6px 12px;
+ background: #EEF2FF;
+ border-radius: 6px;
}
-.section-badge {
- font-size: 11px;
- font-weight: 600;
- padding: 3px 8px;
- background: #667eea;
- color: #FFF;
- border-radius: 4px;
+.section-tag.content-ready {
+ background: #ECFDF5;
+ border: 1px dashed #34D399;
}
-.section-name {
- font-weight: 500;
- color: #333;
+.section-tag.content-ready svg {
+ color: #34D399;
}
-.tool-call-block {
- background: #F8F8F8;
- border: 1px solid #EAEAEA;
- border-radius: 6px;
- overflow: hidden;
+.section-tag.content-ready.is-subsection {
+ background: #F0FDF4;
+ border-color: #6EE7B7;
}
-.tool-name {
- display: flex;
- align-items: center;
- gap: 8px;
- padding: 10px 12px;
- background: #F3E5F5;
- font-weight: 600;
- font-size: 12px;
- color: #7B1FA2;
+.section-tag.completed {
+ background: #D1FAE5;
+ border: 1px solid #059669;
}
-.tool-icon {
- flex-shrink: 0;
+.section-tag.completed svg {
+ color: #059669;
}
-.tool-params {
- padding: 10px 12px;
+.tag-num {
font-size: 11px;
+ font-weight: 700;
+ color: #4F46E5;
}
-.tool-params pre {
- margin: 0;
- font-family: 'JetBrains Mono', monospace;
- white-space: pre-wrap;
- word-break: break-all;
- color: #555;
+.section-tag.completed .tag-num {
+ color: #059669;
}
-.tool-result-block {
- background: #FFF8E1;
- border: 1px solid #FFE082;
- border-radius: 6px;
- padding: 10px 12px;
+.tag-title {
+ font-size: 13px;
+ font-weight: 500;
+ color: #374151;
}
-.result-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 8px;
+.tag-sub {
+ font-size: 11px;
+ color: #6B7280;
+ margin-left: 4px;
}
-.result-tool {
- font-weight: 600;
+.tool-badge {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ padding: 6px 12px;
+ background: #F3E8FF;
+ color: #7C3AED;
+ border-radius: 6px;
font-size: 12px;
- color: #F57C00;
+ font-weight: 600;
}
-.result-length {
- font-size: 10px;
- color: #999;
- font-family: 'JetBrains Mono', monospace;
+.tool-icon {
+ flex-shrink: 0;
}
-.result-content {
- font-size: 12px;
- color: #555;
- line-height: 1.6;
+.tool-params {
+ margin-top: 10px;
+ background: #F9FAFB;
+ border-radius: 6px;
+ padding: 10px;
+ overflow-x: auto;
}
-.result-content pre {
+.tool-params pre {
margin: 0;
font-family: 'JetBrains Mono', monospace;
+ font-size: 11px;
+ color: #4B5563;
white-space: pre-wrap;
- word-break: break-word;
- background: rgba(0, 0, 0, 0.03);
- padding: 12px;
- border-radius: 4px;
-}
-
-.llm-response-block {
- background: #E0F7FA;
- border: 1px solid #B2EBF2;
- border-radius: 6px;
- padding: 10px 12px;
-}
-
-.response-meta {
- display: flex;
- gap: 12px;
- margin-bottom: 8px;
+ word-break: break-all;
}
-.meta-item {
+.expand-toggle {
+ margin-top: 8px;
+ background: transparent;
+ border: none;
+ color: #6366F1;
font-size: 11px;
- color: #666;
+ font-weight: 500;
+ cursor: pointer;
+ padding: 0;
}
-.meta-item.active {
- color: #00838F;
- font-weight: 600;
+.expand-toggle:hover {
+ text-decoration: underline;
}
-.response-content {
- font-size: 12px;
- color: #444;
- line-height: 1.6;
+/* Result Wrapper */
+.result-wrapper {
+ background: #F9FAFB;
+ border-radius: 8px;
+ padding: 12px;
}
-.response-content pre {
- margin: 0;
- font-family: 'JetBrains Mono', monospace;
- white-space: pre-wrap;
- word-break: break-word;
- background: rgba(0, 0, 0, 0.03);
- padding: 12px;
- border-radius: 4px;
+.result-wrapper.result-insight_forge {
+ background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
}
-.complete-info {
- display: flex;
- align-items: center;
- gap: 8px;
- color: #2E7D32;
- font-weight: 500;
+.result-wrapper.result-panorama_search {
+ background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
}
-.complete-info.success {
- font-size: 15px;
+.result-wrapper.result-interview_agents {
+ background: linear-gradient(135deg, #F3E8FF 0%, #E9D5FF 100%);
}
-.complete-icon {
- flex-shrink: 0;
+.result-wrapper.result-quick_search {
+ background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
}
-/* Waiting State */
-.waiting-state {
+.result-meta {
display: flex;
- flex-direction: column;
+ justify-content: space-between;
align-items: center;
- gap: 16px;
- padding: 48px;
- color: #999;
- font-size: 13px;
-}
-
-.pulse-ring {
- width: 32px;
- height: 32px;
- border-radius: 50%;
- border: 1px solid #EAEAEA;
- animation: ripple 2s infinite;
+ margin-bottom: 10px;
}
-@keyframes ripple {
- 0% { transform: scale(0.8); opacity: 1; border-color: #CCC; }
- 100% { transform: scale(2.5); opacity: 0; border-color: #EAEAEA; }
+.result-tool {
+ font-size: 12px;
+ font-weight: 600;
+ color: #374151;
}
-/* Animation */
-.feed-item-enter-active,
-.feed-item-leave-active {
- transition: all 0.3s ease;
+.result-size {
+ font-size: 10px;
+ color: #6B7280;
+ font-family: 'JetBrains Mono', monospace;
}
-.feed-item-enter-from {
- opacity: 0;
- transform: translateY(-10px);
+.result-raw {
+ margin-top: 10px;
+ max-height: 300px;
+ overflow-y: auto;
}
-.feed-item-leave-to {
- opacity: 0;
+.result-raw pre {
+ margin: 0;
+ font-family: 'JetBrains Mono', monospace;
+ font-size: 11px;
+ white-space: pre-wrap;
+ word-break: break-word;
+ color: #374151;
+ background: rgba(255,255,255,0.5);
+ padding: 10px;
+ border-radius: 6px;
}
-/* Console Logs */
-.console-logs {
- background: #1a1a1a;
- color: #DDD;
- padding: 16px;
+.raw-preview {
+ margin: 0;
font-family: 'JetBrains Mono', monospace;
- border-top: 1px solid #333;
- flex-shrink: 0;
+ font-size: 11px;
+ white-space: pre-wrap;
+ word-break: break-word;
+ color: #6B7280;
}
-.log-header {
- display: flex;
- justify-content: space-between;
- border-bottom: 1px solid #333;
- padding-bottom: 8px;
- margin-bottom: 8px;
+.toggle-raw {
+ margin-top: 10px;
+ background: rgba(255,255,255,0.7);
+ border: none;
+ padding: 4px 10px;
+ border-radius: 4px;
font-size: 10px;
- color: #666;
+ font-weight: 500;
+ color: #6B7280;
+ cursor: pointer;
+ transition: all 0.2s;
}
-.log-title {
- text-transform: uppercase;
- letter-spacing: 0.1em;
+.toggle-raw:hover {
+ background: rgba(255,255,255,0.9);
+ color: #374151;
}
-.log-content {
+/* LLM Response */
+.llm-meta {
display: flex;
- flex-direction: column;
- gap: 3px;
- max-height: 100px;
- overflow-y: auto;
- padding-right: 4px;
+ gap: 8px;
+ flex-wrap: wrap;
}
-.log-content::-webkit-scrollbar { width: 4px; }
-.log-content::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
-
-.log-line {
+.meta-tag {
font-size: 11px;
- line-height: 1.5;
+ padding: 3px 8px;
+ background: #F3F4F6;
+ color: #6B7280;
+ border-radius: 4px;
}
-.log-msg {
- color: #AAA;
- word-break: break-all;
+.meta-tag.active {
+ background: #DBEAFE;
+ color: #1E40AF;
}
-.log-msg.error { color: #EF5350; }
-.log-msg.warning { color: #FFA726; }
-.log-msg.success { color: #66BB6A; }
-
-/* ========== 工具结果结构化展示样式 ========== */
+.meta-tag.final-answer {
+ background: #D1FAE5;
+ color: #059669;
+ font-weight: 600;
+}
-/* 切换原文按钮 */
-.toggle-raw-btn {
- background: transparent;
- border: 1px solid #DDD;
- border-radius: 4px;
- padding: 2px 8px;
- font-size: 10px;
- color: #666;
- cursor: pointer;
- transition: all 0.2s;
+.final-answer-hint {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ margin-top: 10px;
+ padding: 10px 14px;
+ background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
+ border-radius: 6px;
+ color: #065F46;
+ font-size: 12px;
+ font-weight: 500;
}
-.toggle-raw-btn:hover {
- background: #F5F5F5;
- border-color: #CCC;
+.final-answer-hint svg {
+ flex-shrink: 0;
}
-/* 原文展示 */
-.result-raw {
+.llm-content {
margin-top: 10px;
+ max-height: 200px;
+ overflow-y: auto;
}
-.result-raw pre {
+.llm-content pre {
margin: 0;
font-family: 'JetBrains Mono', monospace;
font-size: 11px;
white-space: pre-wrap;
word-break: break-word;
- background: rgba(0, 0, 0, 0.03);
- padding: 12px;
- border-radius: 4px;
- max-height: 400px;
- overflow-y: auto;
+ color: #4B5563;
+ background: #F3F4F6;
+ padding: 10px;
+ border-radius: 6px;
+}
+
+/* Complete Banner */
+.complete-banner {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ padding: 12px 16px;
+ background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
+ border-radius: 8px;
+ color: #065F46;
+ font-weight: 600;
+ font-size: 14px;
+}
+
+/* Workflow Empty */
+.workflow-empty {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 60px 20px;
+ color: #9CA3AF;
+ font-size: 13px;
}
-/* 工具类型特定背景 */
-.tool-result-block.tool-insight_forge {
- background: linear-gradient(135deg, #FFF8E1 0%, #FFF3E0 100%);
- border-color: #FFE082;
+.empty-pulse {
+ width: 24px;
+ height: 24px;
+ background: #E5E7EB;
+ border-radius: 50%;
+ margin-bottom: 16px;
+ animation: pulse-ring 1.5s infinite;
}
-.tool-result-block.tool-panorama_search {
- background: linear-gradient(135deg, #E3F2FD 0%, #E1F5FE 100%);
- border-color: #90CAF9;
+@keyframes pulse-ring {
+ 0%, 100% { transform: scale(1); opacity: 1; }
+ 50% { transform: scale(1.2); opacity: 0.5; }
}
-.tool-result-block.tool-interview_agents {
- background: linear-gradient(135deg, #F3E5F5 0%, #FCE4EC 100%);
- border-color: #CE93D8;
+/* Timeline Transitions */
+.timeline-item-enter-active {
+ transition: all 0.4s ease;
}
-.tool-result-block.tool-quick_search {
- background: linear-gradient(135deg, #E8F5E9 0%, #F1F8E9 100%);
- border-color: #A5D6A7;
+.timeline-item-enter-from {
+ opacity: 0;
+ transform: translateX(-20px);
}
-/* 统计卡片 */
-.stats-cards {
+/* ========== Structured Result Display Components ========== */
+
+/* Common Styles */
+.stat-row {
display: flex;
gap: 8px;
margin-bottom: 12px;
- flex-wrap: wrap;
}
-.stat-card {
- display: flex;
- flex-direction: column;
- align-items: center;
- padding: 8px 12px;
- background: #FFF;
- border-radius: 8px;
- box-shadow: 0 1px 3px rgba(0,0,0,0.08);
- min-width: 60px;
+.stat-box {
+ flex: 1;
+ background: rgba(255,255,255,0.8);
+ border-radius: 6px;
+ padding: 8px;
+ text-align: center;
}
-.stat-card .stat-num {
+.stat-box .stat-num {
+ display: block;
font-size: 18px;
font-weight: 700;
- color: #333;
+ color: #374151;
font-family: 'JetBrains Mono', monospace;
}
-.stat-card .stat-name {
+.stat-box .stat-label {
+ display: block;
font-size: 10px;
- color: #888;
+ color: #6B7280;
margin-top: 2px;
}
-.stat-card.facts .stat-num { color: #E65100; }
-.stat-card.entities .stat-num { color: #7B1FA2; }
-.stat-card.relations .stat-num { color: #1565C0; }
-.stat-card.nodes .stat-num { color: #1976D2; }
-.stat-card.edges .stat-num { color: #00838F; }
-.stat-card.active .stat-num { color: #2E7D32; }
-.stat-card.history .stat-num { color: #795548; }
-
-/* 可折叠区块 */
-.collapsible-section {
- margin-top: 10px;
- background: rgba(255,255,255,0.7);
- border-radius: 6px;
- overflow: hidden;
-}
-
-.section-title {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 8px 12px;
- background: rgba(0,0,0,0.03);
- cursor: pointer;
- font-size: 12px;
- font-weight: 600;
- color: #555;
- transition: background 0.2s;
+.stat-box.highlight {
+ background: rgba(16, 185, 129, 0.2);
}
-.section-title:hover {
- background: rgba(0,0,0,0.06);
+.stat-box.highlight .stat-num {
+ color: #059669;
}
-.section-title.active { color: #2E7D32; }
-.section-title.history { color: #795548; }
-
-.toggle-icon {
- width: 18px;
- height: 18px;
- display: flex;
- align-items: center;
- justify-content: center;
- background: rgba(0,0,0,0.08);
- border-radius: 4px;
- font-size: 14px;
+.stat-box.muted {
+ background: rgba(107, 114, 128, 0.1);
}
-/* 子问题列表 */
-.sub-queries {
+.stat-box.muted .stat-num {
+ color: #6B7280;
+}
+
+.query-display {
+ background: rgba(255,255,255,0.6);
padding: 8px 12px;
+ border-radius: 6px;
+ font-size: 12px;
+ color: #4B5563;
+ margin-bottom: 10px;
+ border-left: 3px solid #6366F1;
}
-.sub-query {
- display: flex;
- gap: 8px;
- padding: 6px 0;
- border-bottom: 1px dashed #EEE;
+.expand-details {
+ background: rgba(255,255,255,0.7);
+ border: 1px solid rgba(0,0,0,0.1);
+ padding: 6px 12px;
+ border-radius: 6px;
+ font-size: 11px;
+ font-weight: 500;
+ color: #4B5563;
+ cursor: pointer;
+ transition: all 0.2s;
}
-.sub-query:last-child {
- border-bottom: none;
+.expand-details:hover {
+ background: rgba(255,255,255,0.9);
}
-.query-num {
- width: 20px;
- height: 20px;
- display: flex;
- align-items: center;
- justify-content: center;
- background: #E3F2FD;
- color: #1565C0;
- border-radius: 50%;
- font-size: 11px;
- font-weight: 600;
- flex-shrink: 0;
+.detail-content {
+ margin-top: 12px;
+ background: rgba(255,255,255,0.5);
+ border-radius: 8px;
+ padding: 12px;
}
-.query-text {
- font-size: 12px;
- color: #444;
- line-height: 1.5;
+.section-label {
+ font-size: 11px;
+ font-weight: 600;
+ color: #6B7280;
+ text-transform: uppercase;
+ letter-spacing: 0.04em;
+ margin-bottom: 8px;
}
-/* 事实列表 */
-.facts-list {
- padding: 8px 12px;
- max-height: 300px;
- overflow-y: auto;
+/* Facts Section */
+.facts-section {
+ margin-bottom: 12px;
}
-.fact-item {
+.fact-row {
display: flex;
gap: 8px;
padding: 6px 0;
- border-bottom: 1px solid #F0F0F0;
+ border-bottom: 1px solid rgba(0,0,0,0.05);
}
-.fact-item:last-child {
+.fact-row:last-child {
border-bottom: none;
}
-.fact-item.active {
- background: rgba(46, 125, 50, 0.05);
- margin: 0 -12px;
- padding: 6px 12px;
-}
-
-.fact-item.history {
- background: rgba(121, 85, 72, 0.05);
- margin: 0 -12px;
- padding: 6px 12px;
+.fact-row.active {
+ background: rgba(16, 185, 129, 0.1);
+ margin: 0 -8px;
+ padding: 6px 8px;
+ border-radius: 4px;
}
-.fact-num {
+.fact-idx {
min-width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
- background: #F5F5F5;
- color: #888;
+ background: #E5E7EB;
border-radius: 4px;
font-size: 10px;
font-weight: 600;
+ color: #6B7280;
flex-shrink: 0;
}
.fact-text {
font-size: 12px;
- color: #444;
+ color: #4B5563;
line-height: 1.5;
}
-.fact-content {
- display: flex;
- flex-direction: column;
- gap: 4px;
-}
-
-.time-range {
- font-size: 10px;
- color: #888;
- font-family: 'JetBrains Mono', monospace;
-}
-
-/* 实体网格 */
-.entities-grid {
- display: grid;
- grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
- gap: 8px;
- padding: 8px 12px;
-}
-
-.entity-card {
- background: #FFF;
- border: 1px solid #EEE;
- border-radius: 6px;
- padding: 8px 10px;
-}
-
-.entity-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 4px;
-}
-
-.entity-name {
- font-size: 12px;
- font-weight: 600;
- color: #333;
-}
-
-.entity-type {
- font-size: 10px;
- color: #7B1FA2;
- background: #F3E5F5;
- padding: 2px 6px;
- border-radius: 10px;
-}
-
-.entity-summary {
- font-size: 11px;
- color: #666;
- line-height: 1.4;
+/* Entities Section */
+.entities-section {
+ margin-bottom: 12px;
}
-/* 实体标签 */
-.entity-tags {
+.entity-chips {
display: flex;
flex-wrap: wrap;
gap: 6px;
- padding: 8px 12px;
}
-.entity-tag {
- display: flex;
+.entity-chip {
+ display: inline-flex;
align-items: center;
gap: 4px;
- background: #FFF;
- border: 1px solid #EEE;
- border-radius: 15px;
+ background: rgba(255,255,255,0.8);
+ border: 1px solid rgba(0,0,0,0.1);
+ border-radius: 20px;
padding: 4px 10px;
}
-.tag-name {
+.chip-name {
font-size: 11px;
font-weight: 500;
- color: #333;
+ color: #374151;
}
-.tag-type {
+.chip-type {
font-size: 9px;
- color: #888;
+ color: #9CA3AF;
}
-/* 关系链 */
-.relations-list {
- padding: 8px 12px;
+/* Relations Section */
+.relations-section {
+ margin-bottom: 12px;
}
-.relation-item {
+.relation-row {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 0;
- border-bottom: 1px solid #F0F0F0;
flex-wrap: wrap;
}
-.relation-item:last-child {
- border-bottom: none;
-}
-
-.rel-source, .rel-target {
+.rel-node {
font-size: 11px;
font-weight: 500;
- color: #333;
- background: #E3F2FD;
+ color: #374151;
+ background: #E5E7EB;
padding: 2px 8px;
border-radius: 4px;
}
-.rel-arrow {
- font-size: 12px;
- color: #999;
-}
-
-.rel-type {
+.rel-edge {
font-size: 10px;
- color: #FFF;
- background: #1565C0;
+ color: #FFFFFF;
+ background: #6366F1;
padding: 2px 8px;
- border-radius: 10px;
+ border-radius: 12px;
}
-/* 采访结果 */
-.interview-result {
- padding: 8px 0;
+/* Interview Display */
+.interview-display {
+ padding: 4px 0;
}
.interview-header {
- display: flex;
- flex-direction: column;
- gap: 4px;
- padding: 8px 12px;
- background: rgba(255,255,255,0.7);
- border-radius: 6px;
- margin-bottom: 10px;
+ margin-bottom: 12px;
}
.interview-topic {
font-size: 13px;
font-weight: 600;
- color: #333;
+ color: #374151;
+ margin-bottom: 4px;
}
-.interview-count {
+.interview-meta {
font-size: 11px;
- color: #7B1FA2;
+ color: #6B7280;
}
-.interviews-list {
+.interview-carousel {
display: flex;
flex-direction: column;
- gap: 8px;
+ gap: 10px;
}
.interview-card {
- background: #FFF;
- border: 1px solid #EEE;
- border-radius: 6px;
+ background: rgba(255,255,255,0.9);
+ border: 1px solid rgba(0,0,0,0.08);
+ border-radius: 10px;
+ padding: 12px;
cursor: pointer;
transition: all 0.2s;
}
.interview-card:hover {
- border-color: #DDD;
- box-shadow: 0 2px 8px rgba(0,0,0,0.05);
+ border-color: rgba(139, 92, 246, 0.3);
}
-.interview-card.expanded {
- border-color: #CE93D8;
+.interview-card.active {
+ border-color: #8B5CF6;
+ box-shadow: 0 2px 12px rgba(139, 92, 246, 0.15);
}
-.interview-card-header {
+.interviewee {
display: flex;
align-items: center;
- gap: 8px;
- padding: 10px 12px;
+ gap: 10px;
+ margin-bottom: 8px;
}
-.interview-num {
- font-size: 11px;
- font-weight: 600;
- color: #7B1FA2;
- background: #F3E5F5;
- padding: 2px 6px;
- border-radius: 4px;
+.avatar {
+ width: 36px;
+ height: 36px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: linear-gradient(135deg, #8B5CF6 0%, #A78BFA 100%);
+ color: #FFFFFF;
+ font-size: 14px;
+ font-weight: 700;
+ border-radius: 50%;
}
-.interview-name {
- font-size: 12px;
+.interviewee .info {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+}
+
+.interviewee .name {
+ font-size: 13px;
font-weight: 600;
- color: #333;
+ color: #374151;
}
-.interview-role {
- font-size: 10px;
- color: #888;
- background: #F5F5F5;
+.interviewee .role {
+ font-size: 11px;
+ color: #6B7280;
+}
+
+.interview-idx {
+ font-size: 11px;
+ font-weight: 600;
+ color: #8B5CF6;
+ background: #F3E8FF;
padding: 2px 8px;
border-radius: 10px;
}
-.expand-icon {
- margin-left: auto;
- width: 20px;
- height: 20px;
- display: flex;
- align-items: center;
- justify-content: center;
- background: #F5F5F5;
- border-radius: 4px;
- font-size: 14px;
- color: #666;
+.bio {
+ font-size: 11px;
+ color: #6B7280;
+ font-style: italic;
+ margin-bottom: 10px;
+ padding: 8px;
+ background: rgba(0,0,0,0.03);
+ border-radius: 6px;
}
-.interview-card-body {
- padding: 0 12px 12px;
- border-top: 1px solid #F0F0F0;
+.qa-section {
+ border-top: 1px solid rgba(0,0,0,0.08);
+ padding-top: 12px;
+ margin-top: 4px;
}
-.interview-bio {
- font-size: 11px;
- color: #888;
- font-style: italic;
- padding: 8px 0;
+.question, .answer {
+ display: flex;
+ gap: 10px;
+ margin-bottom: 12px;
}
-.interview-qa {
+.q-label, .a-label {
+ width: 24px;
+ height: 24px;
display: flex;
- flex-direction: column;
- gap: 8px;
+ align-items: center;
+ justify-content: center;
+ border-radius: 50%;
+ font-size: 12px;
+ font-weight: 700;
+ flex-shrink: 0;
}
-.qa-question, .qa-answer {
- font-size: 11px;
- line-height: 1.5;
+.q-label {
+ background: #EEF2FF;
+ color: #4F46E5;
}
-.qa-label {
- font-weight: 600;
- color: #7B1FA2;
- margin-right: 4px;
+.a-label {
+ background: #D1FAE5;
+ color: #059669;
}
-.qa-question {
- color: #555;
- background: #FAFAFA;
- padding: 6px 8px;
- border-radius: 4px;
+.q-text, .a-text {
+ font-size: 12px;
+ color: #4B5563;
+ line-height: 1.6;
}
-.qa-answer {
- color: #333;
+.q-text {
+ font-weight: 500;
}
-.interview-quotes {
+.quotes {
margin-top: 8px;
padding-top: 8px;
- border-top: 1px dashed #EEE;
+ border-top: 1px dashed rgba(0,0,0,0.1);
}
-.quote-item {
+.quote {
font-size: 11px;
- color: #666;
+ color: #6B7280;
font-style: italic;
- padding: 4px 0 4px 12px;
- border-left: 2px solid #CE93D8;
- margin-bottom: 4px;
+ padding: 6px 12px;
+ margin: 4px 0;
+ border-left: 2px solid #A78BFA;
+ background: rgba(167, 139, 250, 0.08);
+}
+
+.carousel-dots {
+ display: flex;
+ justify-content: center;
+ gap: 6px;
+ margin-top: 12px;
+}
+
+.carousel-dots .dot {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ background: rgba(0,0,0,0.15);
+ cursor: pointer;
+ transition: all 0.2s;
+}
+
+.carousel-dots .dot.active {
+ background: #8B5CF6;
+ width: 20px;
+ border-radius: 4px;
}
.interview-summary {
- margin-top: 10px;
- background: rgba(255,255,255,0.7);
- border-radius: 6px;
- padding: 10px 12px;
+ margin-top: 12px;
+ padding: 12px;
+ background: rgba(255,255,255,0.6);
+ border-radius: 8px;
}
-.summary-title {
- font-size: 12px;
+.summary-label {
+ font-size: 11px;
font-weight: 600;
- color: #555;
+ color: #6B7280;
margin-bottom: 6px;
}
-.summary-content {
- font-size: 11px;
- color: #666;
- line-height: 1.5;
+.summary-text {
+ font-size: 12px;
+ color: #4B5563;
+ line-height: 1.6;
}
-/* 快速搜索结果 */
-.quick-search-result {
- padding: 8px 0;
+/* Quick Search Display */
+.quick-search-display {
+ padding: 4px 0;
}
-.search-header {
+.search-meta {
display: flex;
justify-content: space-between;
align-items: center;
- padding: 8px 12px;
- background: rgba(255,255,255,0.7);
- border-radius: 6px;
margin-bottom: 10px;
}
.search-query {
font-size: 12px;
- font-weight: 600;
- color: #333;
+ font-weight: 500;
+ color: #374151;
}
.search-count {
- font-size: 11px;
- color: #2E7D32;
- background: #E8F5E9;
+ font-size: 10px;
+ color: #059669;
+ background: rgba(16, 185, 129, 0.15);
padding: 2px 8px;
border-radius: 10px;
}
-.search-facts {
- padding: 0 12px;
+.search-results {
+ margin-top: 10px;
+ background: rgba(255,255,255,0.5);
+ border-radius: 6px;
+ padding: 8px;
}
-.search-fact-item {
+.search-fact {
display: flex;
gap: 8px;
padding: 6px 0;
- border-bottom: 1px solid #F0F0F0;
+ border-bottom: 1px solid rgba(0,0,0,0.05);
}
-.search-fact-item:last-child {
+.search-fact:last-child {
border-bottom: none;
}
+
+/* Console Logs - 与 Step3Simulation.vue 保持一致 */
+.console-logs {
+ background: #000;
+ color: #DDD;
+ padding: 16px;
+ font-family: 'JetBrains Mono', monospace;
+ border-top: 1px solid #222;
+ flex-shrink: 0;
+}
+
+.log-header {
+ display: flex;
+ justify-content: space-between;
+ border-bottom: 1px solid #333;
+ padding-bottom: 8px;
+ margin-bottom: 8px;
+ font-size: 10px;
+ color: #666;
+}
+
+.log-title {
+ text-transform: uppercase;
+ letter-spacing: 0.1em;
+}
+
+.log-content {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ height: 120px;
+ overflow-y: auto;
+ padding-right: 4px;
+}
+
+.log-content::-webkit-scrollbar { width: 4px; }
+.log-content::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
+
+.log-line {
+ font-size: 11px;
+ line-height: 1.5;
+}
+
+.log-msg {
+ color: #BBB;
+ word-break: break-all;
+}
+
+.log-msg.error { color: #EF5350; }
+.log-msg.warning { color: #FFA726; }
+.log-msg.success { color: #66BB6A; }
</style>