@customize-agent/server 4.0.60 → 4.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/build-manifest.json +5 -5
- package/.next/prerender-manifest.json +3 -3
- package/.next/server/chunks/6697.js +39 -40
- package/.next/server/chunks/8204.js +1 -1
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages/api/assets/generated/preview.js +1 -1
- package/.next/server/pages/api/assets/generated.js +1 -1
- package/.next/server/pages/api/documents/export.js +1 -1
- package/.next/server/pages/api/documents/generate.js +2 -2
- package/.next/server/pages/api/documents/generated/[id].js +1 -1
- package/.next/server/pages/api/documents/generated.js +1 -1
- package/.next/server/pages/asset-library.html +1 -1
- package/.next/server/pages/context/long-term.html +1 -1
- package/.next/server/pages/context/short-term.html +1 -1
- package/.next/server/pages/document-roles.html +1 -1
- package/.next/server/pages/documents.html +1 -1
- package/.next/server/pages/guide.html +1 -1
- package/.next/server/pages/index.html +1 -1
- package/.next/server/pages/knowledge/file-detail.html +1 -1
- package/.next/server/pages/knowledge/files.html +1 -1
- package/.next/server/pages/knowledge/manage.html +1 -1
- package/.next/server/pages/knowledge/search.html +1 -1
- package/.next/server/pages/knowledge.html +1 -1
- package/.next/server/pages/models.html +1 -1
- package/.next/server/pages/overview.html +1 -1
- package/.next/server/pages/prompt.html +1 -1
- package/.next/server/pages/settings.html +1 -1
- package/.next/server/pages/system/logs.html +1 -1
- package/.next/server/pages-manifest.json +28 -28
- package/.next/static/chunks/pages/{_app-62cd5d1172d08036.js → _app-d1257da7895866ad.js} +1 -1
- package/.next/static/chunks/pages/asset-library-1dc916735fd12e11.js +1 -0
- package/.next/static/chunks/pages/documents-dd2b54d69a2c1481.js +1 -0
- package/.next/static/{GMk4Lx5iFiGoAK9ZtW0b0 → iTXBlgeaQEvYe6HCidnnu}/_buildManifest.js +1 -1
- package/messages/en-US.json +460 -0
- package/messages/zh-CN.json +460 -0
- package/package.json +5 -4
- package/.next/static/chunks/pages/asset-library-8ba41e8bc4644f41.js +0 -1
- package/.next/static/chunks/pages/documents-73cbf7cdbcc4e6f6.js +0 -1
- /package/.next/static/{GMk4Lx5iFiGoAK9ZtW0b0 → iTXBlgeaQEvYe6HCidnnu}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
{
|
|
2
|
+
"app": {
|
|
3
|
+
"title": "Customize Agent",
|
|
4
|
+
"subtitle": "管理控制台"
|
|
5
|
+
},
|
|
6
|
+
"nav": {
|
|
7
|
+
"overview": "总览",
|
|
8
|
+
"knowledge": "知识库",
|
|
9
|
+
"knowledgeManage": "知识库管理",
|
|
10
|
+
"fileManagement": "文件管理",
|
|
11
|
+
"knowledgeSearch": "知识库搜索",
|
|
12
|
+
"documents": "工作流模版库",
|
|
13
|
+
"assetLibrary": "生成资源",
|
|
14
|
+
"documentRoles": "角色配置",
|
|
15
|
+
"documentSpecs": "文档规范包",
|
|
16
|
+
"guide": "指引",
|
|
17
|
+
"models": "模型配置",
|
|
18
|
+
"settings": "设置",
|
|
19
|
+
"contextEngineering": "上下文工程",
|
|
20
|
+
"longTermContext": "长期上下文",
|
|
21
|
+
"shortTermContext": "短期上下文",
|
|
22
|
+
"promptManagement": "提示词管理",
|
|
23
|
+
"systemLogs": "系统日志"
|
|
24
|
+
},
|
|
25
|
+
"overview": {
|
|
26
|
+
"title": "系统总览",
|
|
27
|
+
"description": "查看 Customize Agent 运行状态与关键指标",
|
|
28
|
+
"status": "服务状态",
|
|
29
|
+
"statusRunning": "运行中",
|
|
30
|
+
"statusError": "异常",
|
|
31
|
+
"knowledgeBase": "知识库",
|
|
32
|
+
"modelConfig": "模型配置",
|
|
33
|
+
"filesCount": "文件总数",
|
|
34
|
+
"chunksCount": "分块总数",
|
|
35
|
+
"storageSize": "存储空间",
|
|
36
|
+
"providersCount": "已配置模型",
|
|
37
|
+
"quickActions": "快捷操作",
|
|
38
|
+
"goToKnowledge": "管理知识库",
|
|
39
|
+
"goToModels": "配置模型",
|
|
40
|
+
"goToSettings": "系统设置",
|
|
41
|
+
"cores": "核",
|
|
42
|
+
"memory": "内存",
|
|
43
|
+
"tokensUsed": "累计 Tokens",
|
|
44
|
+
"tasksTotal": "总任务数",
|
|
45
|
+
"successRate": "成功率",
|
|
46
|
+
"topModel": "调用最多模型",
|
|
47
|
+
"taskTypes": "任务类型",
|
|
48
|
+
"calls": "次调用"
|
|
49
|
+
},
|
|
50
|
+
"knowledge": {
|
|
51
|
+
"title": "知识库管理",
|
|
52
|
+
"description": "管理本地文件和知识库索引",
|
|
53
|
+
"manageTitle": "知识库管理",
|
|
54
|
+
"manageDesc": "查看知识库统计、分类和功能状态",
|
|
55
|
+
"stats": "统计概览",
|
|
56
|
+
"files": "文件管理",
|
|
57
|
+
"settings": "知识库设置",
|
|
58
|
+
"totalFiles": "文件总数",
|
|
59
|
+
"totalChunks": "分块总数",
|
|
60
|
+
"totalSize": "存储大小",
|
|
61
|
+
"lastIndexed": "上次索引",
|
|
62
|
+
"categories": "文件分类",
|
|
63
|
+
"fileCount": "文件数量",
|
|
64
|
+
"search": "搜索文件",
|
|
65
|
+
"searchPlaceholder": "输入文件名或内容关键词...",
|
|
66
|
+
"filterCategory": "筛选分类",
|
|
67
|
+
"allCategories": "全部类型",
|
|
68
|
+
"upload": "上传文件",
|
|
69
|
+
"uploadHint": "点击或拖拽上传 (PDF, Word, Excel, 图片, 代码等)",
|
|
70
|
+
"uploading": "上传中...",
|
|
71
|
+
"reindex": "重新索引",
|
|
72
|
+
"reindexing": "正在重新索引...",
|
|
73
|
+
"delete": "删除",
|
|
74
|
+
"deleteConfirm": "确定要删除该文件吗?此操作不可恢复。",
|
|
75
|
+
"fileList": "文件列表",
|
|
76
|
+
"fileName": "文件名",
|
|
77
|
+
"fileSize": "大小",
|
|
78
|
+
"fileCategory": "分类",
|
|
79
|
+
"fileDate": "修改日期",
|
|
80
|
+
"noFiles": "暂无文件,请上传文件开始使用",
|
|
81
|
+
"loadError": "加载文件列表失败",
|
|
82
|
+
"emptySearch": "未找到匹配的文件",
|
|
83
|
+
"ignoreRules": "忽略规则",
|
|
84
|
+
"ignoreHint": "每行一个 glob 模式,匹配的文件将被跳过",
|
|
85
|
+
"saveIgnore": "保存规则",
|
|
86
|
+
"duplicates": "重复文件",
|
|
87
|
+
"noDuplicates": "未发现重复文件",
|
|
88
|
+
"duplicatesFound": "发现 {count} 组重复文件",
|
|
89
|
+
"features": "功能状态",
|
|
90
|
+
"featureName": "功能",
|
|
91
|
+
"featureDesc": "说明",
|
|
92
|
+
"featureValue": "实现",
|
|
93
|
+
"featureVectorStoreDesc": "向量数据库,存储文档向量索引",
|
|
94
|
+
"featureEmbeddingDesc": "文本嵌入模型,将文本转换为向量",
|
|
95
|
+
"featureDedup": "去重引擎",
|
|
96
|
+
"featureDedupDesc": "检测并移除重复/相似文档",
|
|
97
|
+
"featureChunker": "分块器",
|
|
98
|
+
"featureChunkerDesc": "将文档拆分为可检索的语义块",
|
|
99
|
+
"globalSearch": "全局搜索",
|
|
100
|
+
"projectSearch": "项目搜索",
|
|
101
|
+
"autoIndex": "自动索引",
|
|
102
|
+
"enabled": "已启用",
|
|
103
|
+
"disabled": "已禁用",
|
|
104
|
+
"parentChunks": "父级切片",
|
|
105
|
+
"childChunks": "子级切片",
|
|
106
|
+
"parentChunkId": "父级 ID",
|
|
107
|
+
"chunkIndex": "切片序号",
|
|
108
|
+
"chunkType": "类型",
|
|
109
|
+
"sectionOrRange": "章节/范围",
|
|
110
|
+
"chunkContent": "内容",
|
|
111
|
+
"parentChunkHint": "父级切片是同一 parentId 下子级切片的上下文合集;当一个父级只包含一个子级时,两处内容相同是正常现象。",
|
|
112
|
+
"parentMatches": "父级命中",
|
|
113
|
+
"childMatches": "子级命中",
|
|
114
|
+
"filterTerm": "筛选词",
|
|
115
|
+
"searchTitle": "知识库搜索",
|
|
116
|
+
"searchDesc": "查看混合检索、父级回填、分块来源和评分明细;文档工作台会使用同一套检索链路按章节自动召回证据。",
|
|
117
|
+
"goToDocuments": "进入文档工作台",
|
|
118
|
+
"autoSearchFirst": "自动检索为主,人工确认为辅",
|
|
119
|
+
"autoSearchFirstDesc": "文档工作台会自动按章节检索证据;只有当必须指定官方资料、图纸或表格时,才需要复制文件路径作为高级优先证据。",
|
|
120
|
+
"searchContentPlaceholder": "输入要搜索的知识库内容",
|
|
121
|
+
"searchAction": "搜索",
|
|
122
|
+
"searchFailed": "搜索失败",
|
|
123
|
+
"recallWeightTuning": "召回权重调节",
|
|
124
|
+
"debugPanel": "检索调试面板",
|
|
125
|
+
"originalQuery": "原始查询",
|
|
126
|
+
"reranker": "重排器",
|
|
127
|
+
"rewrittenQueries": "查询改写",
|
|
128
|
+
"recallCounts": "召回数量",
|
|
129
|
+
"recallWeights": "召回权重",
|
|
130
|
+
"searchResults": "搜索结果",
|
|
131
|
+
"noSearchResults": "暂无结果",
|
|
132
|
+
"resultIndex": "序号",
|
|
133
|
+
"rowRange": "行",
|
|
134
|
+
"copyAsPriorityEvidence": "复制为高级优先证据",
|
|
135
|
+
"copyPriorityEvidenceSuccess": "已复制文件路径;仅在需要人工指定证据时粘贴到章节的高级优先证据中",
|
|
136
|
+
"expand": "展开",
|
|
137
|
+
"weights": {
|
|
138
|
+
"keyword": "关键词权重",
|
|
139
|
+
"vector": "向量权重",
|
|
140
|
+
"rewrite": "改写权重",
|
|
141
|
+
"hybridBonus": "混合加成"
|
|
142
|
+
},
|
|
143
|
+
"recallSources": {
|
|
144
|
+
"keyword": "关键词检索",
|
|
145
|
+
"vector": "向量检索",
|
|
146
|
+
"rewrite": "查询改写",
|
|
147
|
+
"hybrid": "混合检索",
|
|
148
|
+
"rerank": "重排"
|
|
149
|
+
},
|
|
150
|
+
"scopes": {
|
|
151
|
+
"project": "当前项目",
|
|
152
|
+
"global": "全局"
|
|
153
|
+
},
|
|
154
|
+
"scoreDetails": {
|
|
155
|
+
"keywordScore": "关键词分",
|
|
156
|
+
"bm25Score": "BM25 分",
|
|
157
|
+
"vectorScore": "向量分",
|
|
158
|
+
"rerankBoost": "重排加成",
|
|
159
|
+
"hybridScore": "混合分"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"models": {
|
|
163
|
+
"title": "模型配置",
|
|
164
|
+
"description": "管理 LLM 模型与层级分配",
|
|
165
|
+
"modelList": "Model 列表",
|
|
166
|
+
"addModel": "添加模型",
|
|
167
|
+
"editModel": "编辑模型",
|
|
168
|
+
"providerName": "Provider 名称",
|
|
169
|
+
"modelName": "模型名称",
|
|
170
|
+
"apiKey": "API Key",
|
|
171
|
+
"baseUrl": "Base URL",
|
|
172
|
+
"protocol": "请求协议",
|
|
173
|
+
"testConnection": "测试连接",
|
|
174
|
+
"testing": "测试中...",
|
|
175
|
+
"connected": "已连接",
|
|
176
|
+
"connectionFailed": "连接失败",
|
|
177
|
+
"noProviders": "暂无模型,请添加一个",
|
|
178
|
+
"modelTiers": "模型层级分配",
|
|
179
|
+
"tierReader": "Reader(只读)",
|
|
180
|
+
"tierReaderDesc": "处理低风险、只读和成本敏感任务,例如读取文件、检索知识库、搜索文本、整理上下文。建议选择速度快、价格低、长上下文能力稳定的模型。",
|
|
181
|
+
"tierReasoning": "Reasoning(推理)",
|
|
182
|
+
"tierReasoningDesc": "处理需要深入分析、规划、代码理解和多步骤推理的任务。建议选择推理能力强、稳定性高的模型,必要时可使用更高阶模型。",
|
|
183
|
+
"tierAction": "Action(操作)",
|
|
184
|
+
"tierActionDesc": "处理会产生副作用的任务,例如写文件、修改代码、执行命令、调用外部工具。建议选择可靠、遵循指令能力强且经过验证的模型。",
|
|
185
|
+
"activeModel": "当前模型",
|
|
186
|
+
"deleteProvider": "删除",
|
|
187
|
+
"deleteProviderConfirm": "确定要删除此模型及其所有配置吗?",
|
|
188
|
+
"modelNamePlaceholder": "例如: gpt-4o / deepseek-chat",
|
|
189
|
+
"selectModelPlaceholder": "暂不配置",
|
|
190
|
+
"apiKeyEditHint": "已配置的 Key 会以掩码回显,聚焦后可输入新 Key;掩码不可复制,留空或保持掩码则不修改。",
|
|
191
|
+
"apiKeyEditPlaceholder": "输入新的 API Key,留空保持不变",
|
|
192
|
+
"embeddingConfig": "Embedding 配置",
|
|
193
|
+
"embeddingProvider": "Embedding Provider",
|
|
194
|
+
"embeddingProviderHash": "本地语义模型",
|
|
195
|
+
"embeddingProviderOpenAI": "OpenAI 兼容 Embedding",
|
|
196
|
+
"embeddingHint": "Embedding 用于知识库向量检索。修改 Embedding 模型或维度后,建议到知识库页面重新索引。",
|
|
197
|
+
"model": "Model",
|
|
198
|
+
"dimensions": "Dimensions",
|
|
199
|
+
"status": "状态",
|
|
200
|
+
"localHash": "本地语义模型",
|
|
201
|
+
"openAICompatible": "OpenAI 兼容",
|
|
202
|
+
"saveEmbedding": "保存 Embedding 配置",
|
|
203
|
+
"testEmbedding": "测试 Embedding",
|
|
204
|
+
"embeddingApiKeyHint": "留空或保持掩码表示不修改密钥",
|
|
205
|
+
"optional": "可选",
|
|
206
|
+
"save": "保存",
|
|
207
|
+
"cancel": "取消"
|
|
208
|
+
},
|
|
209
|
+
"context": {
|
|
210
|
+
"title": "上下文工程管理",
|
|
211
|
+
"longTermDesc": "来自记忆库的持久化上下文(跨会话保留)",
|
|
212
|
+
"shortTermDesc": "来自最近会话日志的短期上下文",
|
|
213
|
+
"longTermSource": "数据来源: ~/.customize-agent/memory.db(记忆库)",
|
|
214
|
+
"shortTermSource": "数据来源: ~/.customize-agent/logs/(会话日志)",
|
|
215
|
+
"importance": "重要性",
|
|
216
|
+
"content": "内容",
|
|
217
|
+
"tags": "标签",
|
|
218
|
+
"source": "来源",
|
|
219
|
+
"sourceHint": "可选,额外的来源/上下文说明",
|
|
220
|
+
"updatedAt": "更新时间"
|
|
221
|
+
},
|
|
222
|
+
"prompt": {
|
|
223
|
+
"title": "提示词管理",
|
|
224
|
+
"description": "管理各项目的 CUSTOMIZE.md 系统提示词文件",
|
|
225
|
+
"filePath": "文件路径",
|
|
226
|
+
"lastModified": "最后修改",
|
|
227
|
+
"hasFile": "已配置",
|
|
228
|
+
"noFile": "未配置",
|
|
229
|
+
"noProjects": "暂无项目,请先初始化 Customize Agent 项目"
|
|
230
|
+
},
|
|
231
|
+
"documents": {
|
|
232
|
+
"title": "工作流模版库",
|
|
233
|
+
"description": "基于模板库和本地知识库生成、编辑、校验业务文档",
|
|
234
|
+
"templateLibrary": "模板库",
|
|
235
|
+
"workflow": "模板工作流",
|
|
236
|
+
"template": "模板",
|
|
237
|
+
"selected": "已选择",
|
|
238
|
+
"boundPrompts": "绑定提示词",
|
|
239
|
+
"boundFiles": "绑定知识库文件",
|
|
240
|
+
"boundPromptsRequired": "请选择提示词",
|
|
241
|
+
"boundFilesRequired": "请选择知识库文件",
|
|
242
|
+
"promptRole": "提示词角色",
|
|
243
|
+
"fileRole": "文件角色",
|
|
244
|
+
"manageRoles": "管理角色",
|
|
245
|
+
"roleEditor": "角色编辑器",
|
|
246
|
+
"roleType": "角色类型",
|
|
247
|
+
"roleName": "角色名称",
|
|
248
|
+
"roleDescription": "角色说明",
|
|
249
|
+
"addPromptBinding": "添加提示词绑定",
|
|
250
|
+
"addFileBinding": "添加文件绑定",
|
|
251
|
+
"structuredFacts": "结构化事实",
|
|
252
|
+
"exportGate": "导出门禁",
|
|
253
|
+
"executionStages": "执行阶段",
|
|
254
|
+
"executionStatus": "执行状态",
|
|
255
|
+
"flowPrepare": "准备配置",
|
|
256
|
+
"flowPrepareDesc": "读取模板、项目角色配置、文件角色和提示词角色",
|
|
257
|
+
"flowPrepareDone": "配置读取完成",
|
|
258
|
+
"flowFactExtraction": "事实抽取",
|
|
259
|
+
"flowFactExtractionDesc": "按文件处理类型抽取 JSON 事实和表格结构",
|
|
260
|
+
"flowChapterGeneration": "章节生成",
|
|
261
|
+
"flowChapterGenerationDesc": "基于证据、事实和提示词生成章节草稿",
|
|
262
|
+
"flowValidation": "严格校验",
|
|
263
|
+
"flowValidationDesc": "检查事实完整性、来源追踪和章节证据",
|
|
264
|
+
"flowFormatting": "正式排版",
|
|
265
|
+
"flowFormattingDesc": "生成封面、目录、分页和正式文档结构",
|
|
266
|
+
"flowDone": "生成完成",
|
|
267
|
+
"flowDoneDesc": "流程完成,可进入编辑和导出",
|
|
268
|
+
"flowGateFailed": "生成完成,但导出门禁未通过,请检查校验结果",
|
|
269
|
+
"projectRoleConfig": "项目角色配置",
|
|
270
|
+
"documentSpec": "文档规范包",
|
|
271
|
+
"documentSpecPlaceholder": "请选择文档规范包",
|
|
272
|
+
"exportDocx": "导出 Word",
|
|
273
|
+
"projectRoleConfigRequired": "请选择项目角色配置",
|
|
274
|
+
"noRoleConfig": "未绑定项目角色配置",
|
|
275
|
+
"evidenceLimit": "每章证据数",
|
|
276
|
+
"requirement": "生成要求",
|
|
277
|
+
"requirementPlaceholder": "例如:根据上传的招标文件、图纸和清单,生成一份施工组织设计草稿。",
|
|
278
|
+
"generate": "开始生成",
|
|
279
|
+
"editor": "生成 / 编辑器",
|
|
280
|
+
"edit": "编辑",
|
|
281
|
+
"chapters": "章节",
|
|
282
|
+
"sources": "资料来源",
|
|
283
|
+
"missingItems": "缺失项",
|
|
284
|
+
"validation": "校验",
|
|
285
|
+
"evidenceCount": "证据数量",
|
|
286
|
+
"missingCount": "缺失事实",
|
|
287
|
+
"downloadMarkdown": "下载 Markdown",
|
|
288
|
+
"exportHtml": "导出 HTML",
|
|
289
|
+
"exportPdf": "导出 PDF",
|
|
290
|
+
"saveDraft": "保存草稿",
|
|
291
|
+
"draftHistory": "草稿历史",
|
|
292
|
+
"regenerateChapter": "重新生成本章",
|
|
293
|
+
"newTemplate": "新建模板",
|
|
294
|
+
"templateEditor": "模板编辑器",
|
|
295
|
+
"templateName": "模板名称",
|
|
296
|
+
"templateCategory": "模板分类",
|
|
297
|
+
"templateDescription": "模板说明",
|
|
298
|
+
"outputTitle": "输出标题",
|
|
299
|
+
"chapter": "章节",
|
|
300
|
+
"chapterTitle": "章节标题",
|
|
301
|
+
"chapterPurpose": "章节用途",
|
|
302
|
+
"chapterQueries": "检索 Query",
|
|
303
|
+
"requiredFacts": "必需事实",
|
|
304
|
+
"addChapter": "添加章节",
|
|
305
|
+
"builtIn": "内置",
|
|
306
|
+
"deleteTemplateConfirm": "确定删除该模板吗?",
|
|
307
|
+
"noDraft": "请选择模板并生成草稿"
|
|
308
|
+
},
|
|
309
|
+
"specs": {
|
|
310
|
+
"title": "文档规范包",
|
|
311
|
+
"description": "配置事实字段、章节要求和可执行门禁规则。系统门禁和自定义门禁都会参与生成校验。",
|
|
312
|
+
"newSpec": "新建规范包",
|
|
313
|
+
"list": "规范包列表",
|
|
314
|
+
"editor": "规范包编辑器",
|
|
315
|
+
"name": "规范包名称",
|
|
316
|
+
"specDescription": "规范包说明",
|
|
317
|
+
"wordTemplatePath": "Word 模板路径",
|
|
318
|
+
"facts": "事实字段",
|
|
319
|
+
"chapters": "章节规则",
|
|
320
|
+
"gates": "门禁规则",
|
|
321
|
+
"factName": "字段名称",
|
|
322
|
+
"factType": "字段类型",
|
|
323
|
+
"required": "必填/必需",
|
|
324
|
+
"sourceRoles": "来源文件角色",
|
|
325
|
+
"extractionHint": "抽取说明",
|
|
326
|
+
"validationHint": "校验说明",
|
|
327
|
+
"addFact": "添加事实字段",
|
|
328
|
+
"chapterTitle": "章节标题",
|
|
329
|
+
"order": "顺序",
|
|
330
|
+
"minWords": "最低字数",
|
|
331
|
+
"requiredFacts": "必需事实",
|
|
332
|
+
"requiredFileRoles": "必需文件角色",
|
|
333
|
+
"requiredPromptRoles": "必需提示词角色",
|
|
334
|
+
"generationHint": "生成说明",
|
|
335
|
+
"addChapter": "添加章节规则",
|
|
336
|
+
"gateName": "门禁名称",
|
|
337
|
+
"addGate": "添加门禁规则",
|
|
338
|
+
"plainGuideTitle": "大白话说明:文档规范包是干什么的?",
|
|
339
|
+
"plainGuideDesc": "文档规范包不是固定模板,而是一组可配置的生产规则:事实字段=这份文档必须知道哪些信息;章节规则=必须有哪些章节、最低写多少、需要哪些事实;门禁规则=生成和导出前必须检查什么。用户可以创建自定义门禁类型,并为它选择校验对象和校验方式;保存后会和系统门禁类型一样执行。不同公司、不同项目可以复制一份规范包再微调。"
|
|
340
|
+
},
|
|
341
|
+
"guide": {
|
|
342
|
+
"title": "学习说明:如何跑通文档生成全流程",
|
|
343
|
+
"description": "本页面用于指导用户从模型配置、上传我的资料、提示词、角色配置、规范包、模板创建、生成校验到导出的完整流程。建议第一次使用时按顺序完成每一步。",
|
|
344
|
+
"fullFlow": "全流程步骤",
|
|
345
|
+
"stepModel": "1. 配置模型",
|
|
346
|
+
"stepModelDesc": "进入模型配置页面,添加可用的大模型供应商和模型,并设置当前启用模型。LLM JSON 事实抽取会优先使用已启用模型;如果模型不可用,系统会回退到本地确定性抽取。",
|
|
347
|
+
"stepKnowledge": "2. 上传知识库文件",
|
|
348
|
+
"stepKnowledgeDesc": "进入知识库页面上传招标文件、工程说明、表格数据、图纸说明、规范文件等资料。上传后等待索引完成,确保文件能在知识库文件列表中看到。",
|
|
349
|
+
"stepPrompt": "3. 创建提示词",
|
|
350
|
+
"stepPromptDesc": "进入提示词页面创建事实抽取、章节生成、校验、格式化等提示词。提示词应明确输出要求、禁止编造、引用来源和格式规范。",
|
|
351
|
+
"stepRole": "4. 配置角色和项目角色配置",
|
|
352
|
+
"stepRoleDesc": "进入角色配置页面,创建文件角色并绑定知识库文件,创建提示词角色并绑定提示词,再创建项目角色配置,对文件角色和提示词角色排序。",
|
|
353
|
+
"stepTemplate": "5. 创建模板",
|
|
354
|
+
"stepTemplateDesc": "进入工作流模版库页面,新建模板,填写名称、分类、输出标题,并绑定一个项目角色配置。模板不直接绑定文件和提示词,只绑定项目角色配置。",
|
|
355
|
+
"stepGenerate": "6. 执行生成",
|
|
356
|
+
"stepGenerateDesc": "点击生成后,执行状态 Card 会展示准备配置、事实抽取、章节生成、严格校验、正式排版和完成状态,方便用户感知当前进度。",
|
|
357
|
+
"stepReview": "7. 审查结果",
|
|
358
|
+
"stepReviewDesc": "生成后检查编辑器、章节、结构化事实、来源、缺失项、严格校验、导出门禁和执行阶段。校验错误需要先处理再导出正式 PDF。",
|
|
359
|
+
"stepExport": "8. 导出文件",
|
|
360
|
+
"stepExportDesc": "可以导出 Markdown、HTML、PDF。PDF 会启用导出门禁,门禁未通过时系统会阻止导出,避免未经校验的文档流出。",
|
|
361
|
+
"roleDesign": "角色设计说明",
|
|
362
|
+
"roleDesignDesc": "角色用于把用户自定义名称和系统可执行能力连接起来。用户可以完全自定义角色名称,但必须选择执行类型或处理类型,让系统知道如何使用它。",
|
|
363
|
+
"fileRole": "文件角色",
|
|
364
|
+
"fileRoleDesc": "文件角色绑定知识库文件,并选择处理类型,例如规则文件、项目事实文件、表格数据、图纸文件、规范文件或参考资料。",
|
|
365
|
+
"promptRole": "提示词角色",
|
|
366
|
+
"promptRoleDesc": "提示词角色绑定提示词,并选择执行类型,例如事实抽取、章节生成、校验、格式化或参考。",
|
|
367
|
+
"projectConfig": "项目角色配置",
|
|
368
|
+
"projectConfigDesc": "项目角色配置把多个文件角色和提示词角色组合起来,并定义执行顺序。模板只需要绑定项目角色配置。",
|
|
369
|
+
"generationEngine": "生成引擎说明",
|
|
370
|
+
"generationEngineDesc": "生成引擎会按角色配置组织资料和提示词,执行事实抽取、表格解析、章节生成、严格校验和正式排版。",
|
|
371
|
+
"prepareTitle": "准备资料时要注意什么?",
|
|
372
|
+
"prepareContent": "建议至少准备项目事实文件、规则文件和生成提示词。表格类资料应尽量使用清晰表头,图纸资料建议配套图纸目录或说明文件。",
|
|
373
|
+
"rolesTitle": "角色应该怎么命名?",
|
|
374
|
+
"rolesContent": "角色名称建议使用业务语义,例如“招标文件事实源”“劳动力计划表”“施工组织设计章节生成提示词”。系统不依赖名称判断能力,而是依赖处理类型和执行类型。",
|
|
375
|
+
"templateTitle": "模板应该怎么创建?",
|
|
376
|
+
"templateContent": "模板用于定义输出文档类型和标题,绑定项目角色配置即可。不同项目可以复用同一模板,但应创建不同的项目角色配置来绑定不同资料。",
|
|
377
|
+
"generateTitle": "生成过程中怎么看进度?",
|
|
378
|
+
"generateContent": "生成页会显示执行状态 Card。当前步骤会高亮,成功后变为完成;如果失败会显示错误。生成完成后,下方执行阶段会展示后端真实阶段结果。",
|
|
379
|
+
"qaTitle": "怎样判断能否正式导出?",
|
|
380
|
+
"qaContent": "重点查看导出门禁。只有无阻断级错误、基础事实齐全、事实具备来源、章节有证据且没有资料未提供章节时,才建议导出 PDF。"
|
|
381
|
+
},
|
|
382
|
+
"roles": {
|
|
383
|
+
"title": "角色配置",
|
|
384
|
+
"description": "创建文件角色、提示词角色,并组合成可排序的项目角色配置供模板绑定使用",
|
|
385
|
+
"newFileRole": "新建文件角色",
|
|
386
|
+
"newPromptRole": "新建提示词角色",
|
|
387
|
+
"newConfig": "新建项目配置",
|
|
388
|
+
"fileRoles": "文件角色",
|
|
389
|
+
"promptRoles": "提示词角色",
|
|
390
|
+
"configs": "项目角色配置",
|
|
391
|
+
"roleEditor": "角色编辑器",
|
|
392
|
+
"configEditor": "项目角色配置编辑器",
|
|
393
|
+
"roleType": "角色类型",
|
|
394
|
+
"fileRole": "文件角色",
|
|
395
|
+
"promptRole": "提示词角色",
|
|
396
|
+
"roleName": "角色名称",
|
|
397
|
+
"roleDescription": "角色说明",
|
|
398
|
+
"bindFile": "绑定知识库文件",
|
|
399
|
+
"bindPrompt": "绑定提示词",
|
|
400
|
+
"executionType": "执行类型",
|
|
401
|
+
"processingType": "处理类型",
|
|
402
|
+
"factExtraction": "事实抽取",
|
|
403
|
+
"chapterGeneration": "章节生成",
|
|
404
|
+
"validation": "校验",
|
|
405
|
+
"formatting": "格式化",
|
|
406
|
+
"llmReview": "LLM审阅",
|
|
407
|
+
"reference": "参考",
|
|
408
|
+
"ruleFile": "规则文件",
|
|
409
|
+
"projectFactFile": "项目事实文件",
|
|
410
|
+
"tableFile": "表格数据",
|
|
411
|
+
"drawingFile": "图纸文件",
|
|
412
|
+
"specificationFile": "规范文件",
|
|
413
|
+
"configName": "配置名称",
|
|
414
|
+
"configDescription": "配置说明",
|
|
415
|
+
"addRole": "添加角色",
|
|
416
|
+
"plainGuideTitle": "大白话说明:文件角色和提示词角色到底是什么?",
|
|
417
|
+
"plainGuideDesc": "文件角色就是给资料贴用途标签:规则文件=告诉系统必须遵守什么;项目事实文件=告诉系统项目真实信息;表格数据=清单、计划、数据表;图纸文件=图纸目录和设计说明;规范文件=国家/行业/企业标准;参考资料=可参考但不是强事实。提示词角色就是给提示词贴执行标签:事实抽取=先把资料变成事实;章节生成=写正文;校验=找问题;格式化=整理成正式文档。一个角色可以绑定多个文件或多个提示词,适合一个用途对应多份资料的情况。",
|
|
418
|
+
"executionTypeHelp": "大白话:这条提示词在哪个阶段用。事实抽取负责找资料里的真信息;章节生成负责写正文;校验负责挑错;格式化负责整理版式;参考只作为辅助说明。",
|
|
419
|
+
"processingTypeHelp": "大白话:这个文件在生成里扮演什么角色。规则文件是要求和评分规则;项目事实文件是真实项目资料;表格数据是 Excel/CSV/清单;图纸文件是图纸目录和设计说明;规范文件是标准规范;参考资料只做辅助参考。",
|
|
420
|
+
"multiBindFileHelp": "可以多选。比如“项目事实文件”可以同时绑定招标文件、合同摘要、项目概况。少量明确资料建议单绑;同一用途多份资料建议多绑。",
|
|
421
|
+
"multiBindPromptHelp": "可以多选。比如“章节生成”可以同时绑定通用写作要求、公司风格要求、甲方特殊要求。系统会按项目角色配置中的角色顺序使用。"
|
|
422
|
+
},
|
|
423
|
+
"settings": {
|
|
424
|
+
"title": "系统设置",
|
|
425
|
+
"description": "管理语言、主题等偏好",
|
|
426
|
+
"language": "语言",
|
|
427
|
+
"languageDesc": "界面显示语言",
|
|
428
|
+
"theme": "主题",
|
|
429
|
+
"themeDesc": "浅色 / 深色模式",
|
|
430
|
+
"light": "浅色",
|
|
431
|
+
"dark": "深色",
|
|
432
|
+
"system": "跟随系统",
|
|
433
|
+
"about": "关于",
|
|
434
|
+
"version": "版本",
|
|
435
|
+
"port": "服务端口"
|
|
436
|
+
},
|
|
437
|
+
"common": {
|
|
438
|
+
"save": "保存",
|
|
439
|
+
"cancel": "取消",
|
|
440
|
+
"confirm": "确认",
|
|
441
|
+
"delete": "删除",
|
|
442
|
+
"edit": "编辑",
|
|
443
|
+
"add": "添加",
|
|
444
|
+
"search": "搜索",
|
|
445
|
+
"loading": "加载中...",
|
|
446
|
+
"error": "出错了",
|
|
447
|
+
"success": "操作成功",
|
|
448
|
+
"retry": "重试",
|
|
449
|
+
"close": "关闭",
|
|
450
|
+
"back": "返回",
|
|
451
|
+
"more": "更多",
|
|
452
|
+
"noData": "暂无数据",
|
|
453
|
+
"bytes": "字节",
|
|
454
|
+
"kb": "KB",
|
|
455
|
+
"mb": "MB",
|
|
456
|
+
"gb": "GB",
|
|
457
|
+
"unknown": "未知",
|
|
458
|
+
"never": "从未"
|
|
459
|
+
}
|
|
460
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@customize-agent/server",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.62",
|
|
4
4
|
"description": "Customize Agent Web 管理控制台",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./package.json": "./package.json"
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
".next/images-manifest.json",
|
|
19
19
|
".next/react-loadable-manifest.json",
|
|
20
20
|
"public",
|
|
21
|
+
"messages",
|
|
21
22
|
"next.config.ts",
|
|
22
23
|
"postcss.config.mjs",
|
|
23
24
|
"scripts",
|
|
@@ -49,9 +50,9 @@
|
|
|
49
50
|
"tesseract.js": "^7.0.0",
|
|
50
51
|
"typescript": "^6.0.3",
|
|
51
52
|
"xlsx": "^0.18.5",
|
|
52
|
-
"@customize-agent/knowledge": "^4.0.
|
|
53
|
-
"@customize-agent/
|
|
54
|
-
"@customize-agent/
|
|
53
|
+
"@customize-agent/knowledge": "^4.0.25",
|
|
54
|
+
"@customize-agent/llm": "^3.0.9",
|
|
55
|
+
"@customize-agent/runtime": "^3.0.9"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"@tailwindcss/postcss": "^4.3.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[958],{63806:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>I});var n=i(65321),l=i(97109),a=i(17807),s=i(25258),r=i(88762),o=i(2256),c=i(38770),d=i(68787),p=i(33442),x=i(85114),h=i(84253),g=i(71102),y=i(384),m=i(11702),f=i(58209),u=i(93051),j=i(81668),w=i(64254),v=i(26619),A=i(85855),b=i(75548),k=i(56768),S=i(79059),z=i(6578);let C={knowledge_base:"知识库",generated:"AI生成",uploaded:"上传",external_url:"外部URL"},_={cover:"magenta",reference:"blue",generated:"purple",attachment:"cyan",map:"orange",operator:"geekblue"};function I(){let e=(0,S.Vr)(),{message:t}=a.A.useApp(),[i,I]=(0,l.useState)([]),[N,T]=(0,l.useState)(new Set),[E,F]=(0,l.useState)(!0),P=async()=>{try{I((await (0,z.f$)()).assets)}catch(e){I([])}};(0,l.useEffect)(()=>{F(!0),P().finally(()=>F(!1))},[]);let B=async e=>{var i;e&&(await (null==(i=navigator.clipboard)?void 0:i.writeText(e)),t.success("已复制路径"))},D=async(e,i)=>{try{"index"===i?(I((await (0,z.uc)(e)).assets),t.success("已加入知识库索引")):"openFile"===i?await (0,z.oS)(e,"file"):"openDirectory"===i?await (0,z.oS)(e,"directory"):"delete"===i&&(I((await (0,z.JU)(e)).assets),T(t=>{let i=new Set(t);return i.delete(e),i}))}catch(e){t.error(e instanceof Error?e.message:"操作失败")}},R=n=>{let l="selected"===n?[...N]:i.map(e=>e.id);0!==l.length&&s.A.confirm({title:"all"===n?"删除全部资源?":"删除已选 ".concat(l.length," 个资源?"),content:"此操作不可撤销。",okText:e("common.confirm"),cancelText:e("common.cancel"),okButtonProps:{danger:!0},onOk:async()=>{F(!0);try{await Promise.all(l.map(e=>(0,z.JU)(e))),await P(),T(new Set),t.success("已删除 ".concat(l.length," 个资源"))}catch(e){t.error("批量删除失败")}finally{F(!1)}}})},W=e=>{T(t=>{let i=new Set(t);return i.has(e)?i.delete(e):i.add(e),i})};return E?(0,n.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,n.jsx)(r.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,n.jsx)(o.A,{gutter:[12,12],children:Array.from({length:6}).map((e,t)=>(0,n.jsx)(c.A,{xs:24,sm:12,md:8,xl:6,children:(0,n.jsx)(d.A,{size:"small",children:(0,n.jsx)(r.A,{active:!0,paragraph:{rows:3}})})},t))})]}):(0,n.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"pageTitle",children:e("nav.assetLibrary")}),(0,n.jsx)("p",{className:"pageDesc",children:"管理文档生成产生的本地资源。生成完成后资源会自动回流知识库,后续文档可继续检索复用。"})]}),(0,n.jsxs)(p.A,{size:8,children:[(0,n.jsxs)("span",{style:{color:"var(--colorTextSecondary)",fontSize:12},children:["共 ",i.length," 个资源"]}),(0,n.jsxs)(x.Ay,{danger:!0,size:"small",disabled:0===N.size,icon:(0,n.jsx)(f.A,{}),onClick:()=>R("selected"),children:["删除已选 ",N.size||""]}),(0,n.jsx)(x.Ay,{danger:!0,size:"small",disabled:0===i.length,onClick:()=>R("all"),children:"删除全部"})]})]}),0===i.length?(0,n.jsx)(h.A,{description:"暂无生成资源"}):(0,n.jsx)(o.A,{gutter:[12,12],children:i.map((t,i)=>{let l="image"===t.type&&t.path?"/api/assets/generated/preview?id=".concat(encodeURIComponent(t.id)):void 0,a=N.has(t.id),s=[...t.path?[{key:"copy",icon:(0,n.jsx)(u.A,{}),label:"复制路径",onClick:()=>{B(t.path)}}]:[],...t.path?[{key:"open",icon:(0,n.jsx)(j.A,{}),label:"打开文件",onClick:()=>{D(t.id,"openFile")}}]:[],...t.path?[{key:"folder",icon:(0,n.jsx)(w.A,{}),label:"打开目录",onClick:()=>{D(t.id,"openDirectory")}}]:[],...!t.indexed&&t.path?[{key:"index",icon:(0,n.jsx)(v.A,{}),label:"加入知识库",onClick:()=>{D(t.id,"index")}}]:[],{type:"divider"},{key:"delete",icon:(0,n.jsx)(f.A,{}),label:e("common.delete"),danger:!0,onClick:()=>{D(t.id,"delete")}}];return(0,n.jsx)(c.A,{xs:24,sm:12,md:8,xl:6,children:(0,n.jsxs)(d.A,{size:"small",hoverable:!0,styles:{body:{padding:12}},style:{border:a?"2px solid #1677ff":void 0,cursor:"pointer",position:"relative"},onClick:()=>W(t.id),children:[(0,n.jsx)("div",{onClick:e=>{e.stopPropagation(),W(t.id)},style:{position:"absolute",top:8,left:8,zIndex:2,width:22,height:22,borderRadius:5,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.15s",background:a?"#1677ff":"rgba(0,0,0,0.6)",color:"#fff",fontSize:12,fontWeight:700},children:a?"✓":""}),(0,n.jsx)(g.A,{menu:{items:s},trigger:["click"],placement:"bottomRight",children:(0,n.jsx)(x.Ay,{type:"text",size:"small",icon:(0,n.jsx)(A.A,{}),style:{position:"absolute",top:6,right:6,zIndex:2,width:24,height:24,padding:0,background:"var(--colorBgContainer)",borderRadius:6,boxShadow:"0 1px 3px rgba(0,0,0,0.08)"},onClick:e=>e.stopPropagation()})}),l&&(0,n.jsx)("div",{style:{margin:"-12px -12px 10px -12px",borderRadius:"10px 10px 0 0",overflow:"hidden",height:140,display:"flex",alignItems:"center",justifyContent:"center",background:"var(--colorFillAlter)"},children:(0,n.jsx)(y.A,{src:l,alt:t.name,style:{width:"100%",height:"100%",objectFit:"cover"},onClick:e=>e.stopPropagation()})}),(0,n.jsx)("div",{style:{display:"flex",alignItems:"flex-start",gap:8,marginBottom:6},children:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,minWidth:0,flex:1},children:[!l&&("image"===t.type?(0,n.jsx)(b.A,{style:{color:"var(--colorWarning)",fontSize:15,flexShrink:0}}):(0,n.jsx)(k.A,{style:{color:"var(--colorAccent)",fontSize:15,flexShrink:0}})),(0,n.jsx)("span",{style:{fontWeight:600,fontSize:13,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.name})]})}),(0,n.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:8},children:[(0,n.jsx)(m.A,{color:t.indexed?"success":"default",style:{margin:0,fontSize:10,lineHeight:"16px"},children:t.indexed?"已入库":"未入库"}),(0,n.jsx)(m.A,{color:_[t.role]||"blue",style:{margin:0,fontSize:10,lineHeight:"16px"},children:t.role}),(0,n.jsx)(m.A,{style:{margin:0,fontSize:10,lineHeight:"16px"},children:t.type})]}),(0,n.jsxs)("div",{style:{fontSize:12,color:"var(--colorTextSecondary)",lineHeight:1.5,marginBottom:6},children:[t.path&&(0,n.jsx)("div",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"monospace",fontSize:11},children:t.path}),(0,n.jsxs)("div",{children:[C[t.source]||t.source," \xb7 ",t.usedByDocumentIds.length," 个文档 \xb7 ",new Date(t.updatedAt).toLocaleDateString()]})]})]})},t.id)})})]})}},85015:(e,t,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/asset-library",function(){return i(63806)}])}},e=>{e.O(0,[433,787,102,317,636,593,792],()=>e(e.s=85015)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[298],{16403:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/documents",function(){return r(19562)}])},19562:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>ec});var l=r(65321),n=r(97109),s=r(7576),i=r(35292),a=r(33442),o=r(11702),c=r(17807),d=r(63455),u=r(88762),p=r(85114),m=r(68787),h=r(84253),x=r(38332),g=r(26171),f=r(85493),j=r(34052),y=r(9730),v=r(42700),w=r(58569),A=r(2256),S=r(38770),k=r(76506),b=r(57271),I=r(49604),C=r(23216),z=r(16285),T=r(26619),B=r(8263),E=r(8579),_=r(75548),D=r(7851),M=r(84742),F=r(29071),P=r(63552),R=r(26631),G=r(29606),L=r(83914),W=r(58209),N=r(54746),O=r(71330),H=r(64068),K=r(93051),q=r(38762),V=r(64629),U=r(67547),X=r(76830),Q=r(1310),J=r(6578),Y=r(79059);let{TextArea:Z}=s.A,{Text:$}=i.A,ee=null;function et(){null==ee||ee.listeners.forEach(e=>e())}let er={role_binding:(0,l.jsx)(C.A,{}),context_recall:(0,l.jsx)(z.A,{}),knowledge_retrieval:(0,l.jsx)(T.A,{}),file_understanding:(0,l.jsx)(B.A,{}),fact_extraction:(0,l.jsx)(z.A,{}),chapter_generation:(0,l.jsx)(E.A,{}),asset_generation:(0,l.jsx)(_.A,{}),validation:(0,l.jsx)(D.A,{}),formatting:(0,l.jsx)(M.A,{}),llm_review:(0,l.jsx)(F.A,{}),export_ready:(0,l.jsx)(P.A,{}),reference:(0,l.jsx)(_.A,{})},el={施工组织设计:(0,l.jsx)(D.A,{}),投标文件:(0,l.jsx)(P.A,{}),技术方案:(0,l.jsx)(z.A,{}),报告:(0,l.jsx)(R.A,{}),自定义:(0,l.jsx)(E.A,{})};function en(e){return[...new Set(e.map(e=>e.trim()).filter(Boolean))]}function es(e){return e?e.split(/[\\/]/u).pop()||e:""}function ei(e){let t=[],r=e=>{for(let l of e)l.isFolder?l.children&&r(l.children):t.push(l.key)};return r(e),t}let ea={role_binding:"角色配置绑定",context_recall:"上下文召回",knowledge_retrieval:"知识库检索",file_understanding:"多模态文件理解",fact_extraction:"LLM 事实抽取",chapter_generation:"LLM 章节生成",asset_generation:"多模态资源生成",validation:"规则校验",formatting:"格式化排版",llm_review:"LLM 审查优化",export_ready:"导出就绪",reference:"参考资源处理"},eo={"knowledge-base":"知识库","document-readiness":"生成准备度检查","quality-repair":"质量补写","export-gate":"导出门禁","context-memory":"项目上下文","final-format":"正式排版","multimodal-files":"多模态文件理解",tender_announcement:"招标公告"};function ec(){let e=(0,Y.Vr)(),{message:t}=c.A.useApp(),[r]=d.A.useForm(),i=(0,n.useRef)(null),[_,ec]=(0,n.useState)([]),[ed,eu]=(0,n.useState)("construction-organization-design"),[ep,em]=(0,n.useState)([]),[eh,ex]=(0,n.useState)([]),[eg,ef]=(0,n.useState)([]),[ej,ey]=(0,n.useState)([]),[ev,ew]=(0,n.useState)(!1),[eA,eS]=(0,n.useState)(""),[ek,eb]=(0,n.useState)([]),[eI,eC]=(0,n.useState)(!0),[ez,eT]=(0,n.useState)(!1),[eB,eE]=(0,n.useState)(null),[e_,eD]=(0,n.useState)(""),[eM,eF]=(0,n.useState)([]),[eP,eR]=(0,n.useState)(null),[eG,eL]=(0,n.useState)(null),[eW,eN]=(0,n.useState)(""),[eO,eH]=(0,n.useState)(!1),[eK,eq]=(0,n.useState)("idle"),[eV,eU]=(0,n.useState)(null),[eX,eQ]=(0,n.useState)(null),[eJ,eY]=(0,n.useState)({start:0,end:0}),[eZ,e$]=(0,n.useState)([]),[e0,e1]=(0,n.useState)(!1),[e2,e6]=(0,n.useState)(!1),[e8,e3]=(0,n.useState)({}),e4=ep.filter(e=>"file"===e.type).map(e=>({label:e.name,value:e.id})),e5=d.A.useWatch("fileBindingGroups",r)||{},e7=(0,n.useMemo)(()=>(function(e){let t={};for(let n of[...e].sort((e,t)=>e.relativePath.localeCompare(t.relativePath,"zh-CN"))){let e=n.relativePath.split("/").filter(Boolean),s="";for(let i=0;i<e.length;i++){let o=e[i],c=s;s=s?"".concat(s,"/").concat(o):o;let d=i===e.length-1;if(!t[s]){var r;t[s]={key:s,rawTitle:o,title:d?(0,l.jsx)("span",{title:n.relativePath,children:o}):(0,l.jsxs)(a.A,{size:4,children:[(0,l.jsx)(G.A,{style:{color:"#faad14"}}),(0,l.jsx)("span",{children:o})]}),isFolder:!d,fileCount:+!!d,...d?{}:{children:[]}},c&&(null==(r=t[c])?void 0:r.children)&&t[c].children.push(t[s])}d&&(t[s].fileCount=1)}}let n=e=>{for(let r of e){var t;(null==(t=r.children)?void 0:t.length)&&(n(r.children),r.fileCount=r.children.reduce((e,t)=>e+t.fileCount,0),r.title=(0,l.jsxs)(a.A,{size:4,children:[(0,l.jsx)(G.A,{style:{color:"#faad14"}}),(0,l.jsx)("span",{children:r.rawTitle}),(0,l.jsx)(o.A,{style:{margin:0},children:r.fileCount})]}))}},s=Object.values(t).filter(e=>!e.key.includes("/"));return n(s),s.filter(e=>!e.isFolder||e.fileCount>0)})(ej),[ej]),e9=(0,n.useMemo)(()=>(function e(t,r){let l=r.trim().toLowerCase();return l?t.flatMap(t=>{let r=t.children?e(t.children,l):void 0;return t.key.toLowerCase().includes(l)||t.rawTitle.toLowerCase().includes(l)||(null==r?void 0:r.length)?[{...t,children:r}]:[]}):t})(e7,eA),[e7,eA]),te=(0,n.useMemo)(()=>ei(e7),[e7]),tt=(0,n.useMemo)(()=>{let e=[],t=r=>{for(let l of r)e.push(l.key),l.children&&t(l.children)};return t(e7),e},[e7]),[tr,tl]=(0,n.useState)([]),[tn,ts]=(0,n.useState)(null),[ti,ta]=(0,n.useState)("templates"),[to,tc]=(0,n.useState)(!1),[td,tu]=(0,n.useState)("workflow"),tp=(0,n.useRef)(null),tm=(0,n.useRef)(0),th=async()=>{try{eF((await (0,J.cQ)()).documents)}catch(e){eF([])}};(0,n.useEffect)(()=>{let e=()=>{ee&&(tl(ee.flowSteps),ts(ee.activeFlowKey),eT(ee.loading),ee.documentId&&eR(ee.documentId),ee.draft&&eE(ee.draft),void 0!==ee.content&&eD(ee.content))},t=ee;return null==t||t.listeners.add(e),e(),()=>{null==t||t.listeners.delete(e)}},[]),(0,n.useEffect)(()=>{eC(!0),Promise.all([(0,J.Dl)().then(e=>{var t,r;ec(e.templates),eu(null!=(r=null==(t=e.templates[0])?void 0:t.id)?r:"construction-organization-design")}),(0,J.lv)().then(e=>{em(e.roles),ex(e.configs)}),(0,J.dx)().then(e=>ef(e)),th()]).catch(()=>t.error(e("common.error"))).finally(()=>eC(!1))},[t,e]),(0,n.useEffect)(()=>{if(0===eM.length)return;let e=localStorage.getItem("activeGenDocId");if(!e)return;if(!eM.find(t=>t.id===e&&"generating"===t.status))return void localStorage.removeItem("activeGenDocId");let t=setInterval(()=>{(async()=>{try{let{document:r}=await (0,J.v7)(e);await th(),"generating"!==r.status&&(localStorage.removeItem("activeGenDocId"),clearInterval(t))}catch(e){clearInterval(t)}})()},3e3);return()=>clearInterval(t)},[eM]);let tx=(0,n.useMemo)(()=>_.find(e=>e.id===ed),[_,ed]),tg=eh.map(e=>({label:e.name,value:e.id})),tf=Math.max(0,tr.findIndex(e=>e.key===tn)),tj=e=>{var t;return e?(null==(t=ep.find(t=>t.id===e))?void 0:t.name)||eo[e]||"未知角色":""},ty=e=>e.subtitle||e.roleName||tj(e.roleId)||ea[e.type]||e.type,tv=e=>{var t,r,l;return e.promptName||((t=e.promptId)?(null==(r=eg.find(e=>e.id===t))?void 0:r.projectName)||(null==(l=ep.find(e=>e.id===t))?void 0:l.name)||eo[t]||"未知提示词":"")},tw=()=>{tm.current+=1,eN(""),eU(null),eQ(null),e$([]),e1(!1),eH(!1),eq("idle")},tA=e=>{eu(e),eR(null),eE(null),eD(""),tw(),tu("workflow"),tc(!0),ta("drafts")},tS=async r=>{eR(r.id),eu(r.templateId);let l=tk(r.status);if(l||"failed"===r.status||"aborted"===r.status){tL.current=!0,tw(),eE(null),eD(""),eT(l),tu("workflow"),tc(!0);try{let{document:e}=await (0,J.v7)(r.id);tC(e),tk(e.status)?tz(e.id):await th()}catch(e){tC(r)}return}tu("editor"),tl([]),ts(null),tw();try{let{document:e}=await (0,J.v7)(r.id);eE(e.draft||null),eD(e.editedMarkdown||e.markdown)}catch(r){t.error(e("common.error"))}tc(!0)},tk=e=>"completed"!==e&&"warning"!==e&&"failed"!==e&&"aborted"!==e,tb=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:ez;(null==ee?void 0:ee.loading)&&(ee.flowSteps=e,ee.activeFlowKey=t,ee.loading=r,et())},tI=e=>{var t,r,n,s,i;let a=e.executionStages||(null==(t=e.draft)?void 0:t.executionStages)||[];if(a.length>0){let t=a.map((t,r)=>{var n;let s,i=("failed"===e.status||"aborted"===e.status)&&"running"===t.status||"failed"===(s=t.status)?"error":"running"===s?"process":"fallback"===s?"warning":"finish";return{key:"".concat(t.type,"-").concat(r),title:t.title||ea[t.type]||t.type,subtitle:ty(t),description:t.message||"",status:i,icon:"role_binding"===(n=t.type)?(0,l.jsx)(C.A,{}):"knowledge_retrieval"===n?(0,l.jsx)(T.A,{}):"context_recall"===n?(0,l.jsx)(z.A,{}):"file_understanding"===n?(0,l.jsx)(B.A,{}):"fact_extraction"===n?(0,l.jsx)(z.A,{}):"chapter_generation"===n?(0,l.jsx)(E.A,{}):"llm_review"===n?(0,l.jsx)(F.A,{}):"validation"===n?(0,l.jsx)(D.A,{}):"formatting"===n?(0,l.jsx)(M.A,{}):"export_ready"===n?(0,l.jsx)(P.A,{}):(0,l.jsx)(R.A,{}),subSteps:[{key:"stage-".concat(r),title:tv(t)?"提示词:".concat(tv(t)):ty(t),status:i}]}});"generating"===e.status&&t.length>0&&(null==(r=t.at(-1))?void 0:r.status)==="finish"&&(t[t.length-1]={...t[t.length-1],status:"process"});let o="generating"===e.status?(null==(n=t.at(-1))?void 0:n.key)||"prepare":"failed"===e.status||"aborted"===e.status?(null==(s=t.find(e=>"error"===e.status))?void 0:s.key)||(null==(i=t.at(-1))?void 0:i.key)||"prepare":"done";return{steps:t,activeKey:o}}return{steps:[],activeKey:null}},tC=e=>{let{steps:t,activeKey:r}=tI(e);tl(t),ts(r),eT(tk(e.status)),tb(t,r,tk(e.status)),("failed"===e.status||"aborted"===e.status)&&tu("workflow"),("completed"===e.status||"warning"===e.status)&&e.draft&&(eE(e.draft),eD(e.editedMarkdown||e.markdown),tu("editor"),tl([]),ts(null))},tz=e=>{tp.current&&clearInterval(tp.current),tp.current=setInterval(()=>{(async()=>{try{let{document:t}=await (0,J.v7)(e,!0);tC(t),await th(),tk(t.status)||(tp.current&&clearInterval(tp.current),tp.current=null,localStorage.removeItem("activeGenDocId"))}catch(e){}})()},2e3)};(0,n.useEffect)(()=>{if(!ez||!tn)return;let e=window.setInterval(()=>tl(e=>{let t=e.map(e=>{if(e.key!==tn||"process"!==e.status)return e;let t=e.subSteps.findIndex(e=>"process"===e.status),r=t<0?0:Math.min(t+1,e.subSteps.length-1);return{...e,subSteps:e.subSteps.map((e,t)=>t<r?{...e,status:"finish"}:t===r?{...e,status:"process"}:{...e,status:"wait"})}});return tb(t,tn),t}),1400);return()=>window.clearInterval(e)},[tn,ez]);let tT=async()=>{ew(!0);try{let e=await (0,J.HT)({limit:5e3});ey(e.files)}catch(e){t.error("知识库文件加载失败")}finally{ew(!1)}},tB=e=>{let t=null!=e?e:{id:"tpl-".concat(Date.now()),name:"",description:"",category:"自定义",outputTitle:"",projectRoleConfigId:void 0,chapters:[],fileBindings:[]};r.resetFields(),r.setFieldsValue({...t,fileBindingGroups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce((e,t)=>(t.roleId&&t.filePath&&(e[t.roleId]=en([...e[t.roleId]||[],t.filePath])),e),{})}(t.fileBindings)}),eS(""),tT(),e6(!0)},tE=(e,t)=>{let l=r.getFieldValue("fileBindingGroups")||{};r.setFieldValue("fileBindingGroups",{...l,[e]:en(t)})},t_=async()=>{try{await r.validateFields();let l=r.getFieldsValue(!0),n=l.fileBindingGroups||{},s=Object.entries(n).flatMap(e=>{let[t,r]=e;return en(r||[]).map(e=>({roleId:t,filePath:e}))}),{fileBindingGroups:i,...a}=l,o={...a,chapters:[],fileBindings:s},c=await (0,J.l2)(o);ec(c.templates),eu(c.template.id),e6(!1),await th(),t.success(e("common.success"))}catch(e){e instanceof Error&&t.error(e.message)}},tD=async r=>{try{let l=await (0,J.bV)(r);ec(l.templates),eu(l.template.id),t.success(e("common.success"))}catch(r){t.error(e("common.error"))}},tM=async r=>{try{var l,n;let s=await (0,J.h0)(r);ec(s.templates),eu(null!=(n=null==(l=s.templates[0])?void 0:l.id)?n:""),t.success(e("common.success"))}catch(r){t.error(e("common.error"))}},tF=async e=>{try{let{validation:r}=await (0,J.SM)(e);e3(t=>({...t,[e]:r}));let l=r.issues.filter(e=>"error"===e.level);if(eu(e),l.length>0)return void t.warning("模板运行前检查未通过,请先处理阻断项");if(r.issues.length>0)return void t.warning("模板存在警告,可在检查面板确认后继续运行");tA(e)}catch(e){t.error(e instanceof Error?e.message:"模板运行前检查失败")}},tP=async r=>{try{await (0,J.QG)(r),eP===r&&(eR(null),eE(null),eD("")),await th(),t.success(e("common.success"))}catch(r){t.error(e("common.error"))}},tR=async e=>{for(;;){let{document:t}=await (0,J.v7)(e,!0);if(tC(t),("completed"===t.status||"warning"===t.status)&&t.draft)return t;if("failed"===t.status||"aborted"===t.status)throw Error(t.error||("aborted"===t.status?"生成已中止":"生成失败"));await new Promise(e=>window.setTimeout(e,1500))}},tG=async()=>{if(!ed)return;if(null==ee?void 0:ee.loading){tl(ee.flowSteps),ts(ee.activeFlowKey),eT(!0);return}eT(!0);let r=(0,J.OX)({templateId:ed});ee={id:Date.now(),templateId:ed,loading:!0,flowSteps:[],activeFlowKey:null,promise:r,listeners:new Set},tl([]),ts(null);let l=[];try{let n=await r;n.documentId&&(localStorage.setItem("activeGenDocId",n.documentId),eR(n.documentId),(null==ee?void 0:ee.promise)===r&&(ee.documentId=n.documentId)),await th();let s=n.documentId?await tR(n.documentId):void 0,a=n.draft||(null==s?void 0:s.draft);if(!a)throw Error("生成结果为空");(n.documentId||(null==s?void 0:s.id))&&eR(n.documentId||s.id),l.forEach(e=>window.clearTimeout(e)),eE(a),eD((null==s?void 0:s.editedMarkdown)||(null==s?void 0:s.markdown)||a.markdown),(null==ee?void 0:ee.promise)===r&&(ee.draft=a,ee.content=(null==s?void 0:s.editedMarkdown)||(null==s?void 0:s.markdown)||a.markdown);let o=s||{id:n.documentId||"draft-".concat(Date.now()),templateId:ed,title:a.title,requirement:a.requirement,markdown:a.markdown,status:a.validationIssues.some(e=>"error"===e.level||"warning"===e.level)||!a.exportGate.passed?"warning":"completed",draft:a,executionStages:a.executionStages,assets:a.assets||[],createdAt:a.generatedAt,updatedAt:Date.now()},{steps:c}=tI(o);tl(c),tb(c,"done",!1),ts("done"),(null==ee?void 0:ee.promise)===r&&(ee.activeFlowKey="done",ee.loading=!1,et()),localStorage.removeItem("activeGenDocId"),await th(),t.success(e("common.success")),window.setTimeout(()=>{var e;return null==(e=i.current)?void 0:e.scrollIntoView({behavior:"smooth",block:"start"})},200)}catch(n){localStorage.removeItem("activeGenDocId");let l=n instanceof Error?n.message:e("common.error");tl(e=>{let t=e.map(e=>"process"===e.status?{...e,status:"error",description:l,subSteps:((e,t)=>{if("wait"===t)return e.subSteps.map(e=>({...e,status:"wait"}));if("finish"===t)return e.subSteps.map(e=>({...e,status:"finish"}));if("error"===t)return e.subSteps.map((e,t)=>({...e,status:0===t?"error":e.status}));let r=e.subSteps.findIndex(e=>"wait"===e.status);return e.subSteps.map((e,t)=>t<r||-1===r?{...e,status:"finish"}:t===r?{...e,status:"process"}:e)})(e,"error")}:e);return tb(t,tn,!1),t}),(null==ee?void 0:ee.promise)===r&&(ee.loading=!1,ee.error=l,et(),ee=null),await th().catch(()=>void 0),t.error(l)}finally{l.forEach(e=>window.clearTimeout(e)),eT(!1),(null==ee?void 0:ee.promise)===r&&(ee.loading=!1,et())}},tL=(0,n.useRef)(!1),tW=async e=>{(null==ee?void 0:ee.loading)&&(ee.loading=!1,ee.error="用户中止",et(),ee=null,eT(!1)),localStorage.removeItem("activeGenDocId"),tp.current&&(clearInterval(tp.current),tp.current=null);try{await (0,J.r)(e.id),t.success("已中止生成任务")}catch(e){t.info("任务已不在运行,已刷新状态")}finally{await th(),eP===e.id&&(eR(null),eE(null),eD(""))}};(0,n.useEffect)(()=>{to&&"workflow"===td&&!tL.current&&!(null==ee?void 0:ee.loading)&&(null==tx?void 0:tx.projectRoleConfigId)&&(tL.current=!0,window.setTimeout(()=>{tG()},300)),to||(tL.current=!1)},[to,td]);let tN=async r=>{if(eB){eL(r);try{eB.exportGate.passed||t.warning("导出门禁存在风险项,已允许导出,请下载后人工复核。");let e={documentId:eP||void 0,title:eB.title,markdown:e_,format:r,enforceGate:!1,exportGate:eB.exportGate,useClientMarkdown:!0},l=await (0,J.UE)(e);((e,t,r)=>{let l=new Blob([e],{type:r}),n=URL.createObjectURL(l),s=document.createElement("a");s.href=n,s.download=t,s.target="_self",s.rel="noopener",s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window})),s.remove(),window.setTimeout(()=>URL.revokeObjectURL(n),1e3)})(l,"".concat(eB.title,".").concat("markdown"===r?"md":r),{markdown:"text/markdown;charset=utf-8",html:"text/html;charset=utf-8",pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"}[r])}catch(r){t.error(r instanceof Error?r.message:e("common.error"))}finally{eL(null)}}},tO=async()=>{if(eB)try{if(eP)await (0,J.a6)(eP,{editedMarkdown:e_,markdown:e_});else{let e=await (0,J.Af)({...eB,markdown:e_});eE(e.draft)}await th(),t.success(e("common.success"))}catch(r){t.error(e("common.error"))}},tH=(e,t)=>{e$(r=>[{id:"".concat(Date.now()),content:e,prompt:t,createdAt:Date.now()},...r].slice(0,12))},tK=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e&&eN(""),eU(null),eQ(null),eY({start:0,end:0})},tq=(e,t)=>{var r,l;return{title:(null==eB?void 0:eB.title)||"未命名文档",markdown:t,instruction:e,facts:null==eB||null==(r=eB.structuredFacts)?void 0:r.map(e=>"".concat(e.key,": ").concat(e.value)),chapters:null==eB||null==(l=eB.chapters)?void 0:l.map(e=>e.title),...(()=>{let e=eJ.start,t=eJ.end;return t>e?{selection:{start:e,end:t,text:e_.slice(e,t)},cursorOffset:e}:{cursorOffset:e}})()}},tV=async()=>{let r=eW.trim();if(!eB||!r||eO)return;let l=tm.current+1;tm.current=l,eH(!0),eq("planning"),eQ(null);try{let e=await (0,J.Gi)({mode:"plan",...tq(r,e_)});if(tm.current!==l||eP!=eP)return;if(!e.plan)throw Error("AI 未返回修改计划");eU(e.plan)}catch(r){tm.current===l&&t.error(r instanceof Error?r.message:e("common.error"))}finally{tm.current===l&&(eH(!1),eq("idle"))}},tU=async r=>{let l=eW.trim();if(!eB||!l||eO)return;let n=tm.current+1;tm.current=n,eH(!0),eq("applying");try{let e=await (0,J.Gi)({mode:"apply",...tq(l,e_),plan:r});if(tm.current!==n||eP!=eP)return;if(!e.markdown)throw Error("AI 未返回修改结果");eQ({plan:e.plan||r,markdown:e.markdown,beforeSnippet:e.beforeSnippet,afterSnippet:e.afterSnippet,summary:e.summary,changedChars:e.changedChars,prompt:l,before:e_})}catch(r){tm.current===n&&t.error(r instanceof Error?r.message:e("common.error"))}finally{tm.current===n&&(eH(!1),eq("idle"))}};if(eI)return(0,l.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,l.jsx)(u.A,{active:!0,title:!0,paragraph:{rows:1}}),(0,l.jsx)(u.A,{active:!0,paragraph:{rows:2}}),(0,l.jsx)(u.A,{active:!0,paragraph:{rows:8}})]});let tX="workflow"===td?"工作流:".concat((null==tx?void 0:tx.name)||"选择模板"):"编辑:".concat((null==eB?void 0:eB.title)||(null==tx?void 0:tx.outputTitle)||"文档");return(0,l.jsxs)("div",{className:"space-y-5 animateFadeIn",children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:12},children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"pageTitle",children:e("documents.title")}),(0,l.jsx)("p",{className:"pageDesc",children:e("documents.description")})]}),(0,l.jsx)(p.Ay,{type:"primary",icon:(0,l.jsx)(N.A,{}),onClick:()=>tB(),children:e("documents.newTemplate")})]}),(0,l.jsx)(m.A,{size:"small",tabList:[{key:"templates",label:"模板库 (".concat(_.length,")")},{key:"drafts",label:"生成记录 (".concat(eM.length,")")}],activeTabKey:ti,onTabChange:ta,children:"templates"===ti?0===_.length?(0,l.jsx)(h.A,{description:e("common.noData")}):(0,l.jsx)(x.A,{dataSource:_,renderItem:t=>(0,l.jsx)(x.A.Item,{style:{cursor:"pointer",padding:"10px 0"},actions:[(0,l.jsx)(p.Ay,{size:"small",icon:(0,l.jsx)(O.A,{}),onClick:e=>{e.stopPropagation(),tB(t)},children:"配置"},"cfg"),(0,l.jsx)(p.Ay,{size:"small",type:"primary",icon:(0,l.jsx)(H.A,{}),onClick:e=>{e.stopPropagation(),tF(t.id)},children:"运行"},"run"),(0,l.jsx)(p.Ay,{size:"small",icon:(0,l.jsx)(K.A,{}),onClick:e=>{e.stopPropagation(),tD(t.id)}},"copy"),(0,l.jsx)(g.A,{title:e("documents.deleteTemplateConfirm"),onConfirm:e=>{null==e||e.stopPropagation(),tM(t.id)},children:(0,l.jsx)(p.Ay,{size:"small",danger:!0,icon:(0,l.jsx)(W.A,{}),onClick:e=>e.stopPropagation()})},"del")],onClick:()=>eu(t.id),children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:10,minWidth:0,flex:1},children:[function(e,t){let r=el[e]||(0,l.jsx)(R.A,{});return(0,l.jsx)("span",{style:{color:t?"var(--colorAccent)":"var(--colorTextSecondary)",fontSize:16,marginTop:2,flexShrink:0},children:r})}(t.category,ed===t.id),(0,l.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:2},children:[(0,l.jsx)("span",{style:{fontWeight:ed===t.id?600:400,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.name}),ed===t.id&&(0,l.jsx)(o.A,{color:"blue",style:{margin:0,fontSize:10,lineHeight:"16px",flexShrink:0},children:"当前"}),(0,l.jsx)(o.A,{style:{margin:0,fontSize:10,lineHeight:"16px",flexShrink:0},children:t.category}),e8[t.id]&&(0,l.jsxs)(o.A,{color:e8[t.id].issues.some(e=>"error"===e.level)?"error":e8[t.id].issues.length?"warning":"success",style:{margin:0,fontSize:10,lineHeight:"16px",flexShrink:0},children:["检查 ",e8[t.id].fileDiagnostics.length," 文件 / ",e8[t.id].promptDiagnostics.length," 提示词"]})]}),t.description&&(0,l.jsx)($,{type:"secondary",style:{fontSize:12,lineHeight:"18px"},children:t.description}),e8[t.id]&&(0,l.jsx)("div",{onClick:e=>e.stopPropagation(),style:{marginTop:8,padding:10,border:"1px solid ".concat(e8[t.id].issues.some(e=>"error"===e.level)?"var(--colorErrorBorder)":e8[t.id].issues.length?"var(--colorWarningBorder)":"var(--colorSuccessBorder)"),borderRadius:10,background:e8[t.id].issues.some(e=>"error"===e.level)?"var(--colorErrorBg)":e8[t.id].issues.length?"var(--colorWarningBg)":"var(--colorSuccessBg)"},children:(0,l.jsxs)(a.A,{direction:"vertical",size:6,style:{width:"100%"},children:[(0,l.jsxs)(a.A,{wrap:!0,children:[(0,l.jsx)($,{strong:!0,children:e8[t.id].issues.some(e=>"error"===e.level)?"运行前检查未通过":e8[t.id].issues.length?"运行前检查存在警告":"运行前检查通过"}),(0,l.jsxs)(o.A,{color:"blue",children:["文件角色 ",e8[t.id].fileDiagnostics.length]}),(0,l.jsxs)(o.A,{color:"purple",children:["提示词角色 ",e8[t.id].promptDiagnostics.length]})]}),e8[t.id].issues.length>0?e8[t.id].issues.map(e=>(0,l.jsx)(f.A,{type:"error"===e.level?"error":"warning",message:e.message,showIcon:!0},e.message)):(0,l.jsx)(f.A,{type:"success",message:"文件角色、提示词角色和后台自动规范检查通过,可以运行。",showIcon:!0}),!e8[t.id].issues.some(e=>"error"===e.level)&&e8[t.id].issues.length>0&&(0,l.jsx)("div",{children:(0,l.jsx)(p.Ay,{size:"small",type:"primary",icon:(0,l.jsx)(H.A,{}),onClick:()=>tA(t.id),children:"忽略警告并继续运行"})})]})})]})]})})}):0===eM.length?(0,l.jsx)(h.A,{description:e("common.noData")}):(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:eM.slice(0,15).map((e,t)=>{var r,n,s;let i,c;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:10,padding:"10px 12px",border:"1px solid var(--colorBorderSecondary)",borderRadius:10,cursor:"pointer",background:eP===e.id?"var(--colorFillAlter)":void 0,minWidth:0},onClick:()=>{tS(e)},children:["completed"===e.status?(0,l.jsx)(M.A,{style:{fontSize:18,color:"var(--colorOk)",flexShrink:0,marginTop:2}}):"failed"===e.status||"aborted"===e.status?(0,l.jsx)(q.A,{style:{fontSize:18,color:"var(--colorDanger)",flexShrink:0,marginTop:2}}):"warning"===e.status?(0,l.jsx)(D.A,{style:{fontSize:18,color:"var(--colorWarning)",flexShrink:0,marginTop:2}}):(0,l.jsx)(V.A,{spin:!0,style:{fontSize:18,color:"#1677ff",flexShrink:0,marginTop:2}}),(0,l.jsxs)("div",{style:{minWidth:0,flex:1},children:[(0,l.jsx)("div",{style:{fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginBottom:3},children:e.title}),(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px 10px",color:"var(--colorTextSecondary)",fontSize:11},children:[(0,l.jsx)("span",{children:new Date(e.updatedAt).toLocaleString()}),(0,l.jsxs)("span",{children:["耗时 ",(e=>{let t=Math.max(0,Math.round(((e.completedAt||e.updatedAt)-e.createdAt)/1e3));if(t<60)return"".concat(t," 秒");let r=Math.floor(t/60),l=t%60;if(r<60)return l?"".concat(r," 分 ").concat(l," 秒"):"".concat(r," 分");let n=Math.floor(r/60),s=r%60;return s?"".concat(n," 小时 ").concat(s," 分"):"".concat(n," 小时")})(e)]})]}),("warning"===e.status||"failed"===e.status||"aborted"===e.status)&&(0,l.jsx)("div",{style:{marginTop:3,color:"failed"===e.status||"aborted"===e.status?"var(--colorError)":"var(--colorWarning)",fontSize:11,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.error||(null==(r=e.warningIssues)?void 0:r[0])||(null==(s=e.draft)||null==(n=s.validationIssues.find(e=>"error"===e.level||"warning"===e.level))?void 0:n.message)||"需复核"})]}),(0,l.jsxs)(a.A,{size:4,align:"center",children:[(0,l.jsx)(o.A,{color:"completed"===(i=e.status)?"success":"warning"===i?"warning":"failed"===i?"error":"aborted"===i?"default":"processing",style:{margin:0,fontSize:10,lineHeight:"18px"},children:"completed"===(c=e.status)?"已完成":"warning"===c?"需复核":"failed"===c?"失败":"aborted"===c?"已中止":"生成中"}),(0,l.jsxs)(o.A,{style:{margin:0,fontSize:10,lineHeight:"18px"},children:["#",t+1]}),(0,l.jsx)(g.A,{title:"确认删除?",onConfirm:t=>{null==t||t.stopPropagation(),tP(e.id)},children:(0,l.jsx)(p.Ay,{size:"small",danger:!0,icon:(0,l.jsx)(W.A,{}),onClick:e=>e.stopPropagation()})}),tk(e.status)&&(0,l.jsx)(g.A,{title:"确定中止此生成任务?",onConfirm:t=>{null==t||t.stopPropagation(),tW(e)},children:(0,l.jsx)(p.Ay,{size:"small",danger:!0,onClick:e=>e.stopPropagation(),children:"中止"})}),(0,l.jsx)(p.Ay,{size:"small",type:"primary",icon:tk(e.status)?(0,l.jsx)(V.A,{spin:!0}):(0,l.jsx)(H.A,{}),onClick:t=>{t.stopPropagation(),tS(e)},children:"打开"})]})]},e.id)})})}),(0,l.jsx)(j.A,{title:tX,open:to,onClose:()=>{tc(!1),tp.current&&(clearInterval(tp.current),tp.current=null)},width:800,maskClosable:!1,style:{borderRadius:"12px 0 0 12px"},styles:{body:{padding:"16px 24px"},header:{borderRadius:"12px 0 0 0",borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:eB?(0,l.jsxs)(a.A,{wrap:!0,children:[(0,l.jsx)(p.Ay,{icon:(0,l.jsx)(U.A,{}),disabled:eO,onClick:()=>{tO()},children:e("documents.saveDraft")}),(0,l.jsx)(p.Ay,{icon:(0,l.jsx)(X.A,{}),disabled:eO,loading:"markdown"===eG,onClick:()=>{tN("markdown")},children:"MD"}),(0,l.jsx)(p.Ay,{disabled:eO,loading:"html"===eG,onClick:()=>{tN("html")},children:"HTML"}),(0,l.jsx)(p.Ay,{disabled:eO,loading:"docx"===eG,onClick:()=>{tN("docx")},children:"DOCX"}),(0,l.jsx)(p.Ay,{type:"primary",disabled:eO,loading:"pdf"===eG,onClick:()=>{tN("pdf")},children:"PDF"})]}):ez&&"workflow"===td?(0,l.jsx)(p.Ay,{danger:!0,onClick:()=>{(async()=>{eP&&await (0,J.r)(eP).catch(()=>void 0),ee&&(ee.loading=!1,ee.error="用户中止",et(),ee=null),localStorage.removeItem("activeGenDocId"),tp.current&&(clearInterval(tp.current),tp.current=null),eT(!1),tl([]),ts(null),tc(!1),await th(),t.info("已中止生成任务")})()},children:"中止任务"}):void 0,children:(0,l.jsxs)(a.A,{direction:"vertical",style:{width:"100%"},size:"middle",children:["workflow"===td&&tr.length>0&&(0,l.jsx)(y.A,{direction:"vertical",size:"small",current:tf,items:tr.map(e=>{let t;return{title:e.title,description:(0,l.jsxs)("div",{children:[e.subtitle&&(0,l.jsx)("div",{style:{marginBottom:4},children:(0,l.jsx)(o.A,{children:e.subtitle})}),(0,l.jsx)("div",{children:e.description}),(0,l.jsx)("div",{style:{marginTop:4},children:e.subSteps.map(e=>{var t;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,fontSize:12,color:"var(--colorTextSecondary)"},children:["process"===(t=e.status)?(0,l.jsx)(L.A,{}):"finish"===t?(0,l.jsx)(M.A,{}):"warning"===t?(0,l.jsx)(D.A,{style:{color:"var(--colorWarning)"}}):"error"===t?(0,l.jsx)(W.A,{}):(0,l.jsx)("span",{style:{display:"inline-block",height:6,width:6,borderRadius:"50%",background:"var(--colorTextTertiary)"}}),(0,l.jsx)("span",{children:e.title})]},e.key)})})]}),status:"warning"===(t=e.status)?"finish":t,icon:"process"===e.status?(0,l.jsx)(L.A,{}):"warning"===e.status?(0,l.jsx)(D.A,{style:{color:"var(--colorWarning)"}}):e.icon}})}),"workflow"===td&&ez&&0===tr.length&&(0,l.jsx)("div",{style:{textAlign:"center",padding:40},children:(0,l.jsx)(v.A,{tip:"正在准备生成…"})}),eB&&(0,l.jsx)("div",{ref:i,children:(0,l.jsx)(w.A,{items:[{key:"edit",label:e("documents.edit"),children:(0,l.jsxs)(a.A,{direction:"vertical",size:"middle",style:{width:"100%"},children:[(0,l.jsx)(Z,{rows:28,value:e_,disabled:eO,onSelect:e=>{var t,r,l;return eY({start:null!=(t=e.currentTarget.selectionStart)?t:0,end:null!=(l=null!=(r=e.currentTarget.selectionEnd)?r:e.currentTarget.selectionStart)?l:0})},onChange:e=>{var t,r,l;eD(e.target.value),eU(null),eQ(null),eY({start:null!=(t=e.target.selectionStart)?t:0,end:null!=(l=null!=(r=e.target.selectionEnd)?r:e.target.selectionStart)?l:0})}}),(0,l.jsx)(m.A,{size:"small",style:{borderRadius:12,background:"linear-gradient(135deg, var(--colorFillAlter), var(--colorBgContainer))"},children:(0,l.jsxs)(a.A,{direction:"vertical",size:"middle",style:{width:"100%"},children:[(0,l.jsxs)(a.A,{align:"start",style:{width:"100%",justifyContent:"space-between"},children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)(a.A,{size:6,children:[(0,l.jsx)(F.A,{style:{color:"var(--colorAccent)"}}),(0,l.jsx)($,{strong:!0,children:"精准修改"}),(0,l.jsx)(o.A,{color:"blue",children:"AI 辅助"})]}),(0,l.jsx)("div",{style:{marginTop:4,color:"var(--colorTextSecondary)",fontSize:12},children:"针对当前编辑内容补充更具体的要求,AI 会保留文档结构并按你的提示细化修改。"})]}),(0,l.jsxs)(p.Ay,{size:"small",icon:(0,l.jsx)(Q.A,{}),onClick:()=>e1(e=>!e),disabled:0===eZ.length,children:["历史版本 ",eZ.length>0?eZ.length:""]})]}),(0,l.jsx)(f.A,{type:"info",showIcon:!0,message:"系统只负责识别修改范围,不改写你的提示词;选中文字后优先只改选区,没有选区时按光标所在小节/章节定位。"}),(0,l.jsx)(Z,{rows:4,value:eW,disabled:eO,onChange:e=>{eN(e.target.value),eU(null),eQ(null)},placeholder:"例如:写细一点;润色这段;第七章补充高处作业和临电安全措施;把安全检查频次改成每周一次。"}),(0,l.jsxs)(a.A,{wrap:!0,style:{width:"100%",justifyContent:"space-between"},children:[(0,l.jsx)(a.A,{wrap:!0,children:["写细一点","更专业","只润色选区","补充可执行措施"].map(e=>(0,l.jsx)(p.Ay,{size:"small",disabled:eO,onClick:()=>eN(t=>t?"".concat(t,";").concat(e):e),children:e},e))}),(0,l.jsx)(p.Ay,{type:"primary",icon:(0,l.jsx)(F.A,{}),loading:eO&&"planning"===eK,disabled:!eW.trim()||eO,onClick:()=>{tV()},children:"识别修改范围"})]}),eV&&!eX&&(0,l.jsx)(m.A,{size:"small",style:{borderRadius:10,borderColor:"var(--colorAccent)"},children:(0,l.jsxs)(a.A,{direction:"vertical",size:"small",style:{width:"100%"},children:[(0,l.jsxs)(a.A,{wrap:!0,children:[(0,l.jsx)(o.A,{color:"purple",children:eV.scope}),(0,l.jsx)(o.A,{color:"blue",children:eV.action}),(0,l.jsxs)(o.A,{color:eV.confidence>=.8?"green":"orange",children:["置信度 ",Math.round(100*eV.confidence),"%"]}),eV.targetTitle&&(0,l.jsx)($,{strong:!0,children:eV.targetTitle})]}),(0,l.jsx)($,{children:eV.summary}),(0,l.jsx)($,{type:"secondary",style:{fontSize:12},children:"将按你的原始提示词执行,不添加额外编辑任务。"}),(0,l.jsxs)(a.A,{children:[(0,l.jsx)(p.Ay,{type:"primary",loading:eO&&"applying"===eK,onClick:()=>{tU(eV)},children:"执行并预览"}),(0,l.jsx)(p.Ay,{disabled:eO,onClick:()=>eU(null),children:"取消"})]})]})}),eX&&(0,l.jsx)(m.A,{size:"small",style:{borderRadius:10,borderColor:"var(--colorSuccess)"},children:(0,l.jsxs)(a.A,{direction:"vertical",size:"small",style:{width:"100%"},children:[(0,l.jsxs)(a.A,{wrap:!0,children:[(0,l.jsx)(o.A,{color:"green",children:"修改预览"}),(0,l.jsx)($,{children:eX.summary||eX.plan.summary}),(0,l.jsxs)(o.A,{children:[eX.changedChars&&eX.changedChars>0?"+".concat(eX.changedChars):eX.changedChars," 字符"]})]}),(0,l.jsxs)(A.A,{gutter:12,children:[(0,l.jsxs)(S.A,{span:12,children:[(0,l.jsx)($,{strong:!0,children:"修改前"}),(0,l.jsx)("div",{style:{marginTop:6,maxHeight:180,overflow:"auto",padding:10,borderRadius:8,background:"var(--colorFillAlter)",whiteSpace:"pre-wrap",fontSize:12},children:eX.beforeSnippet||"无片段预览"})]}),(0,l.jsxs)(S.A,{span:12,children:[(0,l.jsx)($,{strong:!0,children:"修改后"}),(0,l.jsx)("div",{style:{marginTop:6,maxHeight:180,overflow:"auto",padding:10,borderRadius:8,background:"var(--colorFillAlter)",whiteSpace:"pre-wrap",fontSize:12},children:eX.afterSnippet||"无片段预览"})]})]}),(0,l.jsxs)(a.A,{children:[(0,l.jsx)(p.Ay,{type:"primary",onClick:()=>{eX&&(tH(eX.before,eX.prompt),eD(eX.markdown),tK(!0),t.success("已应用精准修改"))},children:"应用到文档"}),(0,l.jsx)(p.Ay,{onClick:()=>eQ(null),children:"返回计划"}),(0,l.jsx)(p.Ay,{danger:!0,onClick:()=>{eU(null),eQ(null)},children:"放弃"})]})]})}),e0&&(0,l.jsx)("div",{style:{borderTop:"1px solid var(--colorBorderSecondary)",paddingTop:12},children:(0,l.jsx)(x.A,{size:"small",dataSource:eZ,locale:{emptyText:"暂无历史版本"},renderItem:e=>(0,l.jsx)(x.A.Item,{actions:[(0,l.jsx)(p.Ay,{size:"small",disabled:eO,onClick:()=>{tH(e_,"恢复前版本"),eD(e.content),tK(!0),t.success("已恢复历史版本")},children:"恢复"},"restore")],children:(0,l.jsx)(x.A.Item.Meta,{title:(0,l.jsxs)(a.A,{children:[(0,l.jsx)($,{children:new Date(e.createdAt).toLocaleString()}),(0,l.jsx)(o.A,{children:e.prompt})]}),description:(0,l.jsx)($,{type:"secondary",ellipsis:!0,children:e.content.replace(/\s+/gu," ").slice(0,120)})})})})})]})})]})},{key:"chapters-facts",label:"章节与事实",children:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[eB.chapters.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsxs)($,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["章节 (",eB.chapters.length,")"]}),(0,l.jsx)(x.A,{size:"small",dataSource:eB.chapters,renderItem:e=>(0,l.jsx)(x.A.Item,{children:(0,l.jsx)(x.A.Item.Meta,{title:e.title,description:"证据: ".concat(e.evidence.length," \xb7 缺失: ").concat(e.missingFacts.length)})})})]}),eB.structuredFacts.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsxs)($,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["结构化事实 (",eB.structuredFacts.length,")"]}),(0,l.jsx)(k.A,{size:"small",column:1,bordered:!0,children:eB.structuredFacts.map((e,t)=>(0,l.jsxs)(k.A.Item,{label:e.key,children:[(0,l.jsx)("span",{children:e.value}),(0,l.jsx)(o.A,{style:{marginLeft:8},children:e.confidence.toFixed(2)}),(0,l.jsx)($,{type:"secondary",style:{fontSize:11,marginLeft:8},children:e.sourceFile})]},t))})]})]})},{key:"sources-missing",label:"来源与缺失",children:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)($,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["引用来源 (",eB.sources.length,")"]}),0===eB.sources.length?(0,l.jsx)(h.A,{description:"暂无"}):(0,l.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:eB.sources.map(e=>(0,l.jsxs)(o.A,{color:"blue",children:[e.filePath," (",e.count,")"]},e.filePath))})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)($,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:["缺失项 (",eB.missingItems.length,")"]}),0===eB.missingItems.length?(0,l.jsx)(h.A,{description:"无缺失"}):(0,l.jsx)(x.A,{size:"small",dataSource:eB.missingItems,renderItem:e=>(0,l.jsx)(x.A.Item,{children:e})})]})]})},{key:"validation",label:"校验 (".concat(eB.validationIssues.length,")"),children:0===eB.validationIssues.length?(0,l.jsx)(h.A,{description:"校验通过"}):(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[eB.validationIssues.map(e=>(0,l.jsxs)("div",{style:{border:"1px solid var(--colorBorderSecondary)",borderRadius:8,padding:12},children:[(0,l.jsx)(o.A,{color:"error"===e.level?"error":"warning"===e.level?"warning":"blue",children:e.level}),(0,l.jsx)("div",{style:{marginTop:6,whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-all",lineHeight:1.6},children:e.message}),e.suggestion&&(0,l.jsx)("div",{style:{marginTop:6,color:"var(--colorTextSecondary)",whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-all"},children:e.suggestion})]},"".concat(e.level,"-").concat(e.message))),eB.exportGate.checklist.length>0&&(0,l.jsxs)("div",{style:{marginTop:8},children:[(0,l.jsx)($,{strong:!0,style:{fontSize:13,marginBottom:8,display:"block"},children:"导出门禁"}),(0,l.jsx)(x.A,{size:"small",dataSource:eB.exportGate.checklist,renderItem:e=>(0,l.jsxs)(x.A.Item,{children:[(0,l.jsx)($,{style:{overflowWrap:"anywhere",wordBreak:"break-word"},children:e.label}),(0,l.jsx)(o.A,{color:e.passed?"success":"error",children:e.passed?"PASS":"FAIL"})]})})]})]})},{key:"stages",label:"执行阶段 (".concat(eB.executionStages.length,")"),children:(0,l.jsx)(x.A,{size:"small",dataSource:eB.executionStages,renderItem:e=>(0,l.jsxs)(x.A.Item,{children:[(0,l.jsx)(x.A.Item.Meta,{avatar:er[e.type]||(0,l.jsx)(R.A,{}),title:(0,l.jsx)($,{title:e.roleId,style:{overflowWrap:"anywhere",wordBreak:"break-word"},children:"".concat(ea[e.type]||e.type," \xb7 ").concat(e.roleName||tj(e.roleId))}),description:(0,l.jsx)($,{type:"secondary",style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere",wordBreak:"break-word"},children:e.message})}),(0,l.jsx)(o.A,{color:"success"===e.status?"success":"failed"===e.status?"error":"skipped"===e.status?"default":"warning",children:e.status})]})})}]})})]})}),(0,l.jsx)(j.A,{title:e("documents.templateEditor"),open:e2,onClose:()=>e6(!1),width:860,maskClosable:!1,styles:{body:{padding:20,overflow:"auto"},header:{borderBottom:"1px solid var(--colorBorderSecondary)"}},extra:(0,l.jsxs)(a.A,{children:[(0,l.jsx)(p.Ay,{onClick:()=>e6(!1),children:e("common.cancel")}),(0,l.jsx)(p.Ay,{type:"primary",onClick:()=>{t_()},children:e("common.save")})]}),children:(0,l.jsxs)(d.A,{form:r,layout:"vertical",requiredMark:"optional",children:[(0,l.jsxs)(A.A,{gutter:12,children:[(0,l.jsx)(d.A.Item,{name:"id",hidden:!0,children:(0,l.jsx)(s.A,{})}),(0,l.jsx)(S.A,{xs:24,md:8,children:(0,l.jsx)(d.A.Item,{name:"name",label:e("documents.templateName"),rules:[{required:!0}],children:(0,l.jsx)(s.A,{})})}),(0,l.jsx)(S.A,{xs:24,md:8,children:(0,l.jsx)(d.A.Item,{name:"category",label:e("documents.templateCategory"),children:(0,l.jsx)(s.A,{})})}),(0,l.jsx)(S.A,{xs:24,md:8,children:(0,l.jsx)(d.A.Item,{name:"outputTitle",label:e("documents.outputTitle"),children:(0,l.jsx)(s.A,{})})}),(0,l.jsx)(S.A,{xs:24,md:12,children:(0,l.jsx)(d.A.Item,{name:"description",label:e("documents.templateDescription"),children:(0,l.jsx)(s.A,{})})})]}),(0,l.jsx)(d.A.Item,{name:"projectRoleConfigId",label:e("documents.projectRoleConfig"),rules:[{required:!0,message:e("documents.projectRoleConfigRequired")}],children:(0,l.jsx)(b.A,{showSearch:!0,placeholder:e("documents.projectRoleConfigRequired"),options:tg})}),(0,l.jsxs)("div",{style:{marginBottom:16},children:[(0,l.jsxs)(a.A,{style:{width:"100%",justifyContent:"space-between",marginBottom:8},children:[(0,l.jsx)($,{strong:!0,children:"项目文件绑定"}),(0,l.jsx)(o.A,{color:"blue",children:"按文件角色多选"})]}),(0,l.jsx)(f.A,{type:"info",showIcon:!0,style:{marginBottom:12},message:"每个文件角色可直接勾选文件或文件夹;勾选文件夹会自动绑定该文件夹下所有文件。保存时仍按具体文件路径绑定,兼容现有模板和生成流程。"}),(0,l.jsx)(s.A.Search,{allowClear:!0,placeholder:"搜索文件或文件夹",value:eA,onChange:e=>eS(e.target.value),style:{marginBottom:12}}),ev?(0,l.jsx)("div",{style:{textAlign:"center",padding:24},children:(0,l.jsx)(v.A,{tip:"正在加载知识库文件…"})}):0===e4.length?(0,l.jsx)(h.A,{image:h.A.PRESENTED_IMAGE_SIMPLE,description:"暂无可用文件角色"}):0===e7.length?(0,l.jsx)(h.A,{image:h.A.PRESENTED_IMAGE_SIMPLE,description:"暂无知识库文件"}):e4.map(e=>{let t=en(e5[e.value]||[]).filter(e=>te.includes(e)),r=new Set(ei(e9));return(0,l.jsxs)(m.A,{size:"small",style:{marginBottom:12},title:(0,l.jsxs)(a.A,{children:[(0,l.jsx)($,{children:e.label}),(0,l.jsxs)(o.A,{color:"blue",children:["已选 ",t.length]})]}),extra:(0,l.jsx)(p.Ay,{size:"small",disabled:0===t.length,onClick:()=>tE(e.value,[]),children:"清空"}),children:[(0,l.jsx)(d.A.Item,{name:["fileBindingGroups",e.value],hidden:!0,children:(0,l.jsx)(s.A,{})}),(0,l.jsx)("div",{style:{marginBottom:8,color:"var(--colorTextSecondary)",fontSize:12},children:t.length>0?t.slice(0,3).map(es).join("、")+(t.length>3?" 等 ".concat(t.length," 个文件"):""):"未选择文件"}),(0,l.jsx)(I.A,{checkable:!0,blockNode:!0,height:320,treeData:e9,checkedKeys:t,expandedKeys:eA.trim()?tt:ek,onExpand:e=>eb(e),onCheck:(l,n)=>{let s=new Set(t.filter(e=>!r.has(e)));for(let e of n.checkedNodes)e.isFolder?ei([e]).forEach(e=>s.add(e)):s.add(e.key);tE(e.value,Array.from(s))}})]},e.value)})]}),(0,l.jsx)(f.A,{type:"info",showIcon:!0,message:"文档规范由后台根据模板、提示词和角色绑定自动生成,无需手动维护规范包。"})]})})]})}}},e=>{e.O(0,[433,787,576,195,375,455,506,940,499,636,593,792],()=>e(e.s=16403)),_N_E=e.O()}]);
|
|
File without changes
|