package contract import ( "os" "path/filepath" ) // ReportsDir 是报告渲染产物(.docx)的落盘目录。 // Gateway(下载)与 mcp-go(渲染)跨进程共享同一目录:用环境变量统一, // 缺省取系统临时目录下的 sundynix-reports —— 单机开发零配置即可对齐。 func ReportsDir() string { if d := os.Getenv("SUNDYNIX_REPORTS_DIR"); d != "" { return d } return filepath.Join(os.TempDir(), "sundynix-reports") } // ReportPath 返回某任务渲染出的 Word 文档绝对路径。 func ReportPath(id string) string { return filepath.Join(ReportsDir(), id+".docx") } // ReportSourcePath 返回某报告的源数据(标题 + 章节 JSON)绝对路径。 // 生成阶段只落源数据;导出时再按需渲染 Word/PDF/Markdown("导出时再处理")。 func ReportSourcePath(id string) string { return filepath.Join(ReportsDir(), id+".json") }