@customize-agent/server 4.12.23 → 4.12.24

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.
Files changed (43) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +20 -20
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/server/chunks/208.js +1 -1
  5. package/.next/server/chunks/2886.js +5 -5
  6. package/.next/server/middleware-build-manifest.js +1 -1
  7. package/.next/server/pages/404.html +1 -1
  8. package/.next/server/pages/500.html +1 -1
  9. package/.next/server/pages/asset-library.html +1 -1
  10. package/.next/server/pages/document-roles.html +1 -1
  11. package/.next/server/pages/documents.html +1 -1
  12. package/.next/server/pages/guide.html +1 -1
  13. package/.next/server/pages/index.html +1 -1
  14. package/.next/server/pages/knowledge/file-detail.html +1 -1
  15. package/.next/server/pages/knowledge/files.html +1 -1
  16. package/.next/server/pages/knowledge/manage.html +1 -1
  17. package/.next/server/pages/knowledge.html +1 -1
  18. package/.next/server/pages/models.html +1 -1
  19. package/.next/server/pages/overview.html +1 -1
  20. package/.next/server/pages/prompt.html +1 -1
  21. package/.next/server/pages/settings.html +1 -1
  22. package/.next/server/pages/system/logs.html +1 -1
  23. package/.next/server/pages/template-references.html +1 -1
  24. package/.next/server/pages-manifest.json +25 -25
  25. package/.next/static/{gBpbH9haR1-j9Y7DnTV3A → 4bWB9a9su9FcfXYZlsPsU}/_buildManifest.js +1 -1
  26. package/.next/static/chunks/{224-0415408fff1d1c8b.js → 224-790cf01fcf6820ee.js} +1 -1
  27. package/.next/static/chunks/260-244c94eacd903620.js +1 -0
  28. package/.next/static/chunks/{289-fc1b25371e004552.js → 289-42781fb699646699.js} +1 -1
  29. package/.next/static/chunks/788-e98701da4d6ca319.js +1 -0
  30. package/.next/static/chunks/pages/documents-185ab225628d4705.js +1 -0
  31. package/.next/static/chunks/pages/knowledge/files-3ba329d8e6335929.js +1 -0
  32. package/.next/static/chunks/pages/knowledge/manage-558987c599dc4cd5.js +1 -0
  33. package/.next/static/chunks/pages/prompt-839287c514595765.js +1 -0
  34. package/.next/static/chunks/pages/system/logs-2e849bcdf371d791.js +1 -0
  35. package/package.json +1 -1
  36. package/.next/static/chunks/260-580088826d643423.js +0 -1
  37. package/.next/static/chunks/788-dca0d550ad6bd8b2.js +0 -1
  38. package/.next/static/chunks/pages/documents-66057ee3c8ffff6d.js +0 -1
  39. package/.next/static/chunks/pages/knowledge/files-45b40149a6f4a9d5.js +0 -1
  40. package/.next/static/chunks/pages/knowledge/manage-5b1b4d3804752f8b.js +0 -1
  41. package/.next/static/chunks/pages/prompt-edc2dfea09aaedc1.js +0 -1
  42. package/.next/static/chunks/pages/system/logs-ee67e2c93147dfc3.js +0 -1
  43. /package/.next/static/{gBpbH9haR1-j9Y7DnTV3A → 4bWB9a9su9FcfXYZlsPsU}/_ssgManifest.js +0 -0
package/.next/BUILD_ID CHANGED
@@ -1 +1 @@
1
- gBpbH9haR1-j9Y7DnTV3A
1
+ 4bWB9a9su9FcfXYZlsPsU
@@ -5,8 +5,8 @@
5
5
  "devFiles": [],
6
6
  "ampDevFiles": [],
7
7
  "lowPriorityFiles": [
8
- "static/gBpbH9haR1-j9Y7DnTV3A/_buildManifest.js",
9
- "static/gBpbH9haR1-j9Y7DnTV3A/_ssgManifest.js"
8
+ "static/4bWB9a9su9FcfXYZlsPsU/_buildManifest.js",
9
+ "static/4bWB9a9su9FcfXYZlsPsU/_ssgManifest.js"
10
10
  ],
11
11
  "rootMainFiles": [],
12
12
  "rootMainFilesTree": {},
@@ -40,9 +40,9 @@
40
40
  "static/chunks/883-506cbca959974997.js",
41
41
  "static/chunks/69-34d57b77fd2eed20.js",
42
42
  "static/chunks/700-5d29b0475311f590.js",
43
- "static/chunks/224-0415408fff1d1c8b.js",
43
+ "static/chunks/224-790cf01fcf6820ee.js",
44
44
  "static/chunks/102-881dcc464f983c89.js",
45
- "static/chunks/289-fc1b25371e004552.js",
45
+ "static/chunks/289-42781fb699646699.js",
46
46
  "static/chunks/994-241f87efc61005b8.js",
47
47
  "static/chunks/pages/asset-library-f6319fc04559e43d.js"
48
48
  ],
@@ -55,11 +55,11 @@
55
55
  "static/chunks/69-34d57b77fd2eed20.js",
56
56
  "static/chunks/700-5d29b0475311f590.js",
57
57
  "static/chunks/44-d3545eedd5c75ef1.js",
58
- "static/chunks/224-0415408fff1d1c8b.js",
58
+ "static/chunks/224-790cf01fcf6820ee.js",
59
59
  "static/chunks/787-c18af810af3433f6.js",
60
60
  "static/chunks/102-881dcc464f983c89.js",
61
61
  "static/chunks/195-2c0168eacab722d2.js",
62
- "static/chunks/289-fc1b25371e004552.js",
62
+ "static/chunks/289-42781fb699646699.js",
63
63
  "static/chunks/455-e1b41ac4946d2b6f.js",
64
64
  "static/chunks/pages/document-roles-4ccb2db16dc4b63c.js"
65
65
  ],
@@ -72,13 +72,13 @@
72
72
  "static/chunks/69-34d57b77fd2eed20.js",
73
73
  "static/chunks/700-5d29b0475311f590.js",
74
74
  "static/chunks/44-d3545eedd5c75ef1.js",
75
- "static/chunks/224-0415408fff1d1c8b.js",
75
+ "static/chunks/224-790cf01fcf6820ee.js",
76
76
  "static/chunks/787-c18af810af3433f6.js",
77
77
  "static/chunks/195-2c0168eacab722d2.js",
78
78
  "static/chunks/455-e1b41ac4946d2b6f.js",
79
79
  "static/chunks/506-93f730bc149d0dce.js",
80
80
  "static/chunks/930-0436dcaa92fb41f6.js",
81
- "static/chunks/pages/documents-66057ee3c8ffff6d.js"
81
+ "static/chunks/pages/documents-185ab225628d4705.js"
82
82
  ],
83
83
  "/guide": [
84
84
  "static/chunks/webpack-4224e970a97a4a86.js",
@@ -105,10 +105,10 @@
105
105
  "static/chunks/69-34d57b77fd2eed20.js",
106
106
  "static/chunks/700-5d29b0475311f590.js",
107
107
  "static/chunks/44-d3545eedd5c75ef1.js",
108
- "static/chunks/224-0415408fff1d1c8b.js",
108
+ "static/chunks/224-790cf01fcf6820ee.js",
109
109
  "static/chunks/787-c18af810af3433f6.js",
110
110
  "static/chunks/102-881dcc464f983c89.js",
111
- "static/chunks/289-fc1b25371e004552.js",
111
+ "static/chunks/289-42781fb699646699.js",
112
112
  "static/chunks/506-93f730bc149d0dce.js",
113
113
  "static/chunks/850-0f48354694fc6b3e.js",
114
114
  "static/css/ad5a592c79d1448b.css",
@@ -123,11 +123,11 @@
123
123
  "static/chunks/69-34d57b77fd2eed20.js",
124
124
  "static/chunks/700-5d29b0475311f590.js",
125
125
  "static/chunks/44-d3545eedd5c75ef1.js",
126
- "static/chunks/224-0415408fff1d1c8b.js",
126
+ "static/chunks/224-790cf01fcf6820ee.js",
127
127
  "static/chunks/102-881dcc464f983c89.js",
128
- "static/chunks/289-fc1b25371e004552.js",
128
+ "static/chunks/289-42781fb699646699.js",
129
129
  "static/css/ad5a592c79d1448b.css",
130
- "static/chunks/pages/knowledge/files-45b40149a6f4a9d5.js"
130
+ "static/chunks/pages/knowledge/files-3ba329d8e6335929.js"
131
131
  ],
132
132
  "/knowledge/manage": [
133
133
  "static/chunks/webpack-4224e970a97a4a86.js",
@@ -138,8 +138,8 @@
138
138
  "static/chunks/69-34d57b77fd2eed20.js",
139
139
  "static/chunks/787-c18af810af3433f6.js",
140
140
  "static/chunks/506-93f730bc149d0dce.js",
141
- "static/chunks/788-dca0d550ad6bd8b2.js",
142
- "static/chunks/pages/knowledge/manage-5b1b4d3804752f8b.js"
141
+ "static/chunks/788-e98701da4d6ca319.js",
142
+ "static/chunks/pages/knowledge/manage-558987c599dc4cd5.js"
143
143
  ],
144
144
  "/models": [
145
145
  "static/chunks/webpack-4224e970a97a4a86.js",
@@ -170,8 +170,8 @@
170
170
  "static/chunks/700-5d29b0475311f590.js",
171
171
  "static/chunks/44-d3545eedd5c75ef1.js",
172
172
  "static/chunks/195-2c0168eacab722d2.js",
173
- "static/chunks/260-580088826d643423.js",
174
- "static/chunks/pages/prompt-edc2dfea09aaedc1.js"
173
+ "static/chunks/260-244c94eacd903620.js",
174
+ "static/chunks/pages/prompt-839287c514595765.js"
175
175
  ],
176
176
  "/settings": [
177
177
  "static/chunks/webpack-4224e970a97a4a86.js",
@@ -188,11 +188,11 @@
188
188
  "static/chunks/69-34d57b77fd2eed20.js",
189
189
  "static/chunks/700-5d29b0475311f590.js",
190
190
  "static/chunks/44-d3545eedd5c75ef1.js",
191
- "static/chunks/224-0415408fff1d1c8b.js",
191
+ "static/chunks/224-790cf01fcf6820ee.js",
192
192
  "static/chunks/102-881dcc464f983c89.js",
193
193
  "static/chunks/195-2c0168eacab722d2.js",
194
- "static/chunks/289-fc1b25371e004552.js",
195
- "static/chunks/pages/system/logs-ee67e2c93147dfc3.js"
194
+ "static/chunks/289-42781fb699646699.js",
195
+ "static/chunks/pages/system/logs-2e849bcdf371d791.js"
196
196
  ],
197
197
  "/template-references": [
198
198
  "static/chunks/webpack-4224e970a97a4a86.js",
@@ -3,9 +3,9 @@
3
3
  "routes": {},
4
4
  "dynamicRoutes": {},
5
5
  "preview": {
6
- "previewModeId": "190f2dd1d3a074706ce3886886e353d8",
7
- "previewModeSigningKey": "01b5fd26810506735ecdbc03eecbb62afe2926a5a5ff3eda7a9ee031e36372cb",
8
- "previewModeEncryptionKey": "057033650a56302acad8082944489fabd9ae666e37a4aac0113a79d5e66863e8"
6
+ "previewModeId": "d526fb0c4eae6c9f471a4291da357f09",
7
+ "previewModeSigningKey": "84a9b876a116542fb34fefc17c87cc682fa087b2360dfce0aa8d37274f4388a7",
8
+ "previewModeEncryptionKey": "e00a80b125c09715e97b3952c1c87a59e232dc2d2df5e94631b0fab80a33cb31"
9
9
  },
10
10
  "notFoundRoutes": []
11
11
  }
@@ -2,7 +2,7 @@
2
2
  - 写作目标:${a.writingGoal}
3
3
  - 必用资料类型:${a.mustUseMaterialKinds.map(m).join("、")||"按现有资料综合使用"}
4
4
  - 必须覆盖:${a.mustCover.join("、")||"按章节目标展开"}
5
- - 禁止:${a.avoidWriting.join(";")}`).join("\n");return["## 项目资料理解模型",`项目资料包:${b.projectName}`,`资料根目录:${b.materialRoots.join("、")||"当前知识库全部资料"}`,"资料类型清单:",c,b.warnings.length?`资料风险:${b.warnings.join(";")}`:"","全局写作重点:",...a.globalWritingFocus.map(a=>`- ${a}`),"章节资料使用计划:",d,a.graphPrompt||""].filter(Boolean).join("\n")}({profile:b,globalWritingFocus:e,chapterPlans:g,graphPrompt:d});return{profile:b,globalWritingFocus:e,chapterPlans:g,prompt:k}}function x(a){let b=new Map,c=new Map;for(let d of a.files)b.set(d.filePath,d.kind),c.set(d.filePath,"drawing"===d.kind?"drawing":"bill_of_quantities"===d.kind?"table":"technical_specification"===d.kind?"specification":"tender_document"===d.kind||"addendum"===d.kind?"rule":"reference");return{kindByPath:b,processingByPath:c}}function y(a){return a||"other"}function z(a){return"drawing"===a?"drawing":"bill_of_quantities"===a?"table":"technical_specification"===a?"specification":"tender_document"===a||"addendum"===a?"rule":"reference"}async function A(a){let b=[];if(!a.plan)return b;for(let c of a.plan.mustUseMaterialKinds){let d=a.profile.groups[c].map(a=>a.filePath).filter(b=>a.scopedFilePaths.includes(b));if(0!==d.length)for(let e of(0,i.Cr)(a.plan.evidenceQueries[c]||[],a=>(0,i.Ox)(a),{maxItems:6,maxChars:1200},`evidence-queries:${c}`).selected){if(a.signal?.aborted)throw Error("aborted");let f=await a.manager.search(a.projectRoot,e,{scope:"project",filters:{filePaths:d},limit:a.limitPerQuery,weights:{keyword:.68,vector:.25,rewrite:.85,hybridBonus:.3},generationMode:!1});b.push(...f.results.filter(a=>d.includes(a.filePath)).map(b=>({chapterId:a.chapter.id,filePath:b.filePath,score:b.score+l[c]/100+2,content:b.content,roleId:y(c),processingType:z(c),sectionTitle:b.sectionTitle,source:`material-plan:${c}`})))}}return(0,g.QR)(b,{maxItems:48,maxChars:52e3,preservePinned:!0})}function B(a){let b=[],c=new Set(a.plan?.mustUseMaterialKinds||[]),d=a.profile.files.filter(b=>a.scopedFilePaths.includes(b.filePath)&&(0===c.size||c.has(b.kind))).sort((a,b)=>b.priority-a.priority),e=[a.chapter.title,...a.chapter.sections||[],...a.chapter.requiredFacts].filter(Boolean);for(let c of d){let d=a.project.getFileDetail?.(c.filePath);if(d?.chunks?.length)for(let f of d.chunks.map((a,b)=>{let d=(0,g.eE)(a.content),f=`${a.sectionTitle||""}
5
+ - 禁止:${a.avoidWriting.join(";")}`).join("\n");return["## 项目资料理解模型",`项目资料包:${b.projectName}`,`资料根目录:${b.materialRoots.join("、")||"当前知识库全部资料"}`,"资料类型清单:",c,b.warnings.length?`资料风险:${b.warnings.join(";")}`:"","全局写作重点:",...a.globalWritingFocus.map(a=>`- ${a}`),"章节资料使用计划:",d,a.graphPrompt||""].filter(Boolean).join("\n")}({profile:b,globalWritingFocus:e,chapterPlans:g,graphPrompt:d});return{profile:b,globalWritingFocus:e,chapterPlans:g,prompt:k}}function x(a){let b=new Map,c=new Map;for(let d of a.files)b.set(d.filePath,d.kind),c.set(d.filePath,"drawing"===d.kind?"drawing":"bill_of_quantities"===d.kind?"table":"technical_specification"===d.kind?"specification":"tender_document"===d.kind||"addendum"===d.kind?"rule":"reference");return{kindByPath:b,processingByPath:c}}function y(a){return a||"other"}function z(a){return"drawing"===a?"drawing":"bill_of_quantities"===a?"table":"technical_specification"===a?"specification":"tender_document"===a||"addendum"===a?"rule":"reference"}async function A(a){let b=[];if(!a.plan)return b;for(let c of a.plan.mustUseMaterialKinds){let d=a.profile.groups[c].map(a=>a.filePath).filter(b=>a.scopedFilePaths.includes(b));if(0!==d.length)for(let e of(0,i.Cr)(a.plan.evidenceQueries[c]||[],a=>(0,i.Ox)(a),{maxItems:6,maxChars:1200},`evidence-queries:${c}`).selected){if(a.signal?.aborted)throw Error("aborted");let f=await a.manager.search(a.projectRoot,e,{scope:"project",filters:{filePaths:d},limit:a.limitPerQuery,weights:{keyword:.68,vector:.25,rewrite:.85,hybridBonus:.3},generationMode:!0,disableReranker:!0});b.push(...f.results.filter(a=>d.includes(a.filePath)).map(b=>({chapterId:a.chapter.id,filePath:b.filePath,score:b.score+l[c]/100+2,content:b.content,roleId:y(c),processingType:z(c),sectionTitle:b.sectionTitle,source:`material-plan:${c}`})))}}return(0,g.QR)(b,{maxItems:48,maxChars:52e3,preservePinned:!0})}function B(a){let b=[],c=new Set(a.plan?.mustUseMaterialKinds||[]),d=a.profile.files.filter(b=>a.scopedFilePaths.includes(b.filePath)&&(0===c.size||c.has(b.kind))).sort((a,b)=>b.priority-a.priority),e=[a.chapter.title,...a.chapter.sections||[],...a.chapter.requiredFacts].filter(Boolean);for(let c of d){let d=a.project.getFileDetail?.(c.filePath);if(d?.chunks?.length)for(let f of d.chunks.map((a,b)=>{let d=(0,g.eE)(a.content),f=`${a.sectionTitle||""}
6
6
  ${d}`;return{chunk:a,index:b,score:.8*e.filter(a=>f.includes(a)).length+ +!!/\d+(?:\.\d+)?\s*(?:日历天|天|月|年|万元|元|㎡|m²|m³|米|mm|台|套|人|项|%|MPa|kPa)/u.test(d)+.4*(0===b)+c.priority/120}}).filter(a=>a.score>0).sort((a,b)=>b.score-a.score))b.push({chapterId:a.chapter.id,filePath:d.file.relativePath,score:1.8+f.score,content:f.chunk.content,roleId:y(c.kind),processingType:z(c.kind),sectionTitle:f.chunk.sectionTitle,source:"project-material-sample"})}return(0,g.QR)(b,{preservePinned:!0})}},6444:(a,b,c)=>{c.d(b,{N:()=>l,x:()=>k});var d=c(77598),e=c(8753),f=c(92808);function g(a){return a.replace(/[^a-zA-Z0-9\u4e00-\u9fa5_-]/gu,"-").slice(0,60)||`fact-${Date.now()}`}function h(a){let b=RegExp("[“”\"'‘’「」『』《》](.{2,80}?)[“”\"'‘’「」『』《》]","gu");return[...a.matchAll(b)].map(a=>a[1].trim()).filter(Boolean)}function i(a){return a.split(/[\n;;。]/u).map(a=>a.trim()).filter(a=>a.length>=2)}function j(a,b=""){let c=function(a,b=""){return`${b} ${a.name} ${a.category} ${a.outputTitle} ${a.description}`}(a,b);return(0,e.V)().autoSpecGates.filter(a=>a.templateMatchers.some(a=>(function(a,b){try{return RegExp(b,"iu").test(a)}catch{return a.includes(b)}})(c,a)))}function k(a,b=""){let c=function(a,b=""){return d.createHash("sha1").update(JSON.stringify({id:a.id,name:a.name,description:a.description,outputTitle:a.outputTitle,chapters:a.chapters,promptBindings:a.promptBindings,projectBindings:a.projectBindings,projectRoleConfigId:a.projectRoleConfigId,requirement:b})).digest("hex").slice(0,12)}(a,b),e=function(a){let b=`${a.name} ${a.category} ${a.outputTitle} ${a.description}`;return(0,f.rs)(b,f.nt)||a.category||"文档"}(a),l=function(a,b){let c=[a.name,a.category,a.outputTitle,a.description],d=[];for(let b of a.chapters)for(let a of(c.push(b.title,b.purpose,...b.sections||[],...b.requiredFacts||[],...b.queries||[]),b.requiredFacts||[]))d.push(a);let e=c.filter(Boolean).join("\n"),g=new Set(d);for(let a of(0,f.t0)(e,f.NT))g.add(a);for(let c of j(a,b))for(let a of c.requiredFacts)g.add(a);return[...g].filter(Boolean)}(a,e),m=function(a=""){let b=new Set;for(let c of[/(?:必须|需要|要求|增加|包含|包括|补充|设置|新增).{0,12}?(?:章节|章|节|小节)[::为是]?\s*([^。;;\n]{2,80})/giu,/(?:章节|目录).{0,8}?(?:包括|包含|为|是)[::]?\s*([^。;;\n]{2,120})/giu])for(let d of a.matchAll(c))for(let a of d[1].split(/[、,,/]/u).map(a=>a.trim()).filter(Boolean))!/不要|禁止|不得|不能/iu.test(a)&&a.length<=40&&b.add(a.replace(/[。;;::]+$/u,""));return[...b]}(b),n=function(a=""){let b=new Set;for(let c of i(a).filter(a=>/必须|一定要|务必|输出|写明/iu.test(a)&&!/章节|章|节|小节/iu.test(a))){for(let a of h(c))b.add(a);let a=c.match(/(?:输出|写明)\s*([^。;;\n]{2,30})/iu);a&&b.add(a[1].trim())}return[...b].filter(a=>a&&a.length<=30&&!/不要|禁止|不得|不能|生成|要求内容|专业|结构完整|直接用于/u.test(a))}(b),o=function(a=""){let b=new Set;for(let c of i(a).filter(a=>/不要|禁止|不得|不能|不允许|严禁/iu.test(a))){for(let a of h(c))b.add(a);let a=c.match(/(?:不要|禁止|不得|不能|不允许|严禁)(?:出现|输出|写|包含)?\s*([^。;;\n]{2,40})/iu);a&&b.add(a[1].replace(/^(这些|以下|内容|词语|文字)[::]?/u,"").trim())}return[...b].filter(a=>a&&!/章节|页|表格/u.test(a))}(b),p=function(a=""){let b=a.match(/(?:大概|约|左右|不少于|至少|控制在|不超过|最多)?\s*(\d{1,3})\s*(?:页|page)/iu);if(!b)return;let c=Number(b[1]);if(Number.isFinite(c)&&!(c<=0))return/不少于|至少/iu.test(a)?{min:c}:/不超过|最多|以内|控制在/iu.test(a)?{max:c}:{target:c,min:Math.max(1,Math.floor(.85*c)),max:Math.ceil(1.15*c)}}(b),q=j(a,e),r=Math.max(0,...q.map(a=>a.minTables||0)),s=Math.max(function(a=""){let b=a.match(/(?:至少|不少于)?\s*(\d{1,2})\s*(?:个|张)?\s*表格/iu);return b?Number(b[1]):/表格化|用表格|表格形式|表格表达/iu.test(a)?1:void 0}(b)||0,r)||void 0,t=a.chapters.map((a,b)=>{let c=[a.title,a.purpose,...a.sections||[],...a.requiredFacts||[],...a.queries||[]].join("\n"),d=new Set(a.requiredFacts||[]);for(let a of l)(c.includes(a)||RegExp(a.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),"iu").test(c))&&d.add(a);for(let a of(0,f.t0)(c,f.Ny))d.add(a);return{id:a.id,title:a.title,required:!0,order:b,minWords:900,requiredFactIds:[...d].filter(a=>l.includes(a)).map(g),requiredFileRoleIds:[],requiredPromptRoleIds:[],generationHint:[a.purpose,a.sections?.length?`必须包含小节:${a.sections.join("、")}`:"",d.size?`重点覆盖事实:${[...d].join("、")}`:""].filter(Boolean).join("\n")}}),u=m.filter(a=>!t.some(b=>b.title.includes(a)||a.includes(b.title))).map((a,b)=>({id:`user-chapter-${g(a)}`,title:a,required:!0,order:t.length+b,minWords:600,requiredFactIds:[],requiredFileRoleIds:[],requiredPromptRoleIds:[],generationHint:`用户明确要求包含该章节:${a}`})),v=[{id:"auto-source-required",name:"事实必须有来源",type:"source_required",level:"warning",evaluator:{subject:"source",operator:"all_have_source"}},{id:"auto-min-source",name:"至少使用绑定材料来源",type:"source_required",level:"warning",evaluator:{subject:"source",operator:"min_count",min:2}},{id:"auto-no-debug-text",name:"不得输出后台流程话术",type:"forbidden_text",level:"error",value:"知识库证据",evaluator:{subject:"document",operator:"not_contains",value:"知识库证据"}},...q.flatMap(a=>a.requiredTexts.map(a=>({id:`configured-required-${g(a)}`,name:`配置建议包含:${a}`,type:"configured_required_text",level:"warning",value:a,evaluator:{subject:"document",operator:"contains",value:a}}))),...q.flatMap(a=>a.forbiddenTexts.map(a=>({id:`configured-forbidden-${g(a)}`,name:`配置建议避免:${a}`,type:"configured_forbidden_text",level:"warning",value:a,evaluator:{subject:"document",operator:"not_contains",value:a}}))),...r?[{id:"configured-min-table-count",name:`配置建议正式表格不少于 ${r} 个`,type:"configured_table_density",level:"warning",evaluator:{subject:"table",operator:"min_count",min:r}}]:[],...m.map(a=>({id:`user-required-chapter-${g(a)}`,name:`用户提到章节:${a}`,type:"user_required_chapter",level:"warning",target:a,evaluator:{subject:"chapter",operator:"exists",target:a}})),...n.map(a=>({id:`user-required-text-${g(a)}`,name:`用户提到应包含:${a}`,type:"user_required_text",level:"warning",value:a,evaluator:{subject:"document",operator:"contains",value:a}})),...o.map(a=>({id:`user-forbidden-text-${g(a)}`,name:`用户要求不得包含:${a}`,type:"user_forbidden_text",level:"error",value:a,evaluator:{subject:"document",operator:"not_contains",value:a}})),...s?[{id:"user-min-table-count",name:`用户提到表格数量不少于 ${s}`,type:"user_format_table",level:"warning",evaluator:{subject:"table",operator:"min_count",min:s}}]:[],...p?.min?[{id:"user-min-page-count",name:`用户提到页数不少于 ${p.min}`,type:"user_page_target",level:"warning",evaluator:{subject:"page",operator:"min_count",min:p.min}}]:[],...p?.max?[{id:"user-max-page-count",name:`用户要求页数不超过 ${p.max}`,type:"user_page_target",level:"warning",evaluator:{subject:"page",operator:"max_count",min:p.max}}]:[]],w=[...t,...u];return{sourceHash:c,managedBy:"system",spec:{id:`auto-${a.id}-${c}`.replace(/[^a-zA-Z0-9_-]/gu,"-").slice(0,80),name:`后台优化建议 - ${a.name}`,description:`${e}后台优化建议,由模板、提示词、角色绑定和用户临时要求静默生成,仅用于提升内容完整性,不接管章节结构。`,factFields:l.map(a=>({id:g(a),name:a,type:"auto",required:q.some(b=>b.requiredFacts.includes(a))||!/资源|品牌|重点|难点|约束/iu.test(a),extractionHint:`从绑定材料摘要、角色绑定证据和知识库证据中抽取“${a}”。`,validationHint:`生成内容涉及“${a}”时必须与绑定材料一致,不得引入无关事实。`})),chapterMode:"fixed",chapterRules:w,dynamicChapterRule:{source:"ai_plan",minChapters:0,maxChapters:0,titleStrategy:"template",minWordsPerChapter:0,generationHint:`不自动规划或补充章节;仅按${e}正式文件要求提供内容完整性建议。`},gateRules:v,builtIn:!0}}}function l(a,b,c={}){return c.publicSafe?`## 文档事实与质量要求
7
7
  建议关注事实:${a.factFields.map(a=>a.name).join("、")}
8
8
  章节内容要求:${a.chapterRules.map(a=>`${a.title}${a.generationHint?`:${a.generationHint.replace(/\s+/gu," ")}`:""}`).join(";")||"以当前模板章节为准"}