#!/bin/bash

# 创建~/.evolve目录结构
echo "正在创建 ~/.evolve 目录结构..."

mkdir -p ~/.evolve/{1_settings,2_plot_outlines,3_drafts_for_review,4_final_chapters,_system/llama_index_rag,_system/lmce,_system/mcp}

# 复制项目设定文件到 ~/.evolve/1_settings
echo "正在复制项目设定文件..."
cp -r /Users/fanzhang/Documents/novel/evolve/1_settings/* ~/.evolve/1_settings/ 2>/dev/null || echo "未找到项目设定文件或目录为空"

# 复制项目草稿文件到 ~/.evolve/3_drafts_for_review
echo "正在复制项目草稿文件..."
cp -r /Users/fanzhang/Documents/novel/evolve/3_drafts_for_review/* ~/.evolve/3_drafts_for_review/ 2>/dev/null || echo "未找到项目草稿文件或目录为空"

# 复制项目最终章节到 ~/.evolve/4_final_chapters
echo "正在复制项目最终章节..."
cp -r /Users/fanzhang/Documents/novel/evolve/4_final_chapters/* ~/.evolve/4_final_chapters/ 2>/dev/null || echo "未找到项目最终章节文件或目录为空"

# 创建默认配置文件
echo "正在创建默认配置文件..."
cat > ~/.evolve/.env << EOF
# Evolve Memory System 配置文件
# 这个文件包含系统运行所需的所有配置

# MCP服务器配置
MCP_HOST=localhost
MCP_PORT=3333

# LMCE API配置
LMCE_API_URL=http://localhost:8000

# 系统路径配置
EVOLVE_HOME=~/.evolve
EOF

echo "安装完成！您的Evolve Memory System已准备就绪。"
echo "请查看 ~/.evolve 目录以了解完整的目录结构。"