@customize-agent/server 4.0.32 → 4.0.33

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 (37) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +5 -5
  3. package/.next/package.json +1 -0
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/chunks/3298.js +1 -1
  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/api/documents/roles.js +1 -1
  10. package/.next/server/pages/api/prompt.js +1 -1
  11. package/.next/server/pages/asset-library.html +1 -1
  12. package/.next/server/pages/context/long-term.html +1 -1
  13. package/.next/server/pages/context/short-term.html +1 -1
  14. package/.next/server/pages/document-roles.html +1 -1
  15. package/.next/server/pages/documents.html +1 -1
  16. package/.next/server/pages/guide.html +1 -1
  17. package/.next/server/pages/index.html +1 -1
  18. package/.next/server/pages/knowledge/file-detail.html +1 -1
  19. package/.next/server/pages/knowledge/files.html +1 -1
  20. package/.next/server/pages/knowledge/manage.html +1 -1
  21. package/.next/server/pages/knowledge/search.html +1 -1
  22. package/.next/server/pages/knowledge.html +1 -1
  23. package/.next/server/pages/models.html +1 -1
  24. package/.next/server/pages/overview.html +1 -1
  25. package/.next/server/pages/prompt.html +1 -1
  26. package/.next/server/pages/settings.html +1 -1
  27. package/.next/server/pages/system/logs.html +1 -1
  28. package/.next/server/pages-manifest.json +27 -27
  29. package/.next/static/chunks/496-4fb9a063790e65ff.js +1 -0
  30. package/.next/static/chunks/pages/document-roles-cb222be93cfd561d.js +1 -0
  31. package/.next/static/chunks/pages/prompt-9b869fbe3463020d.js +1 -0
  32. package/.next/static/{M3RTsFPBW6tg_7bJE5A2X → trRaWc1ebFq78iuTpvU9H}/_buildManifest.js +1 -1
  33. package/package.json +13 -13
  34. package/.next/static/chunks/909-27ada1f00a52e11d.js +0 -1
  35. package/.next/static/chunks/pages/document-roles-24e4ba16d654959d.js +0 -1
  36. package/.next/static/chunks/pages/prompt-3468fb841f4c5c8c.js +0 -1
  37. /package/.next/static/{M3RTsFPBW6tg_7bJE5A2X → trRaWc1ebFq78iuTpvU9H}/_ssgManifest.js +0 -0
package/.next/BUILD_ID CHANGED
@@ -1 +1 @@
1
- M3RTsFPBW6tg_7bJE5A2X
1
+ trRaWc1ebFq78iuTpvU9H
@@ -5,8 +5,8 @@
5
5
  "devFiles": [],
6
6
  "ampDevFiles": [],
7
7
  "lowPriorityFiles": [
8
- "static/M3RTsFPBW6tg_7bJE5A2X/_buildManifest.js",
9
- "static/M3RTsFPBW6tg_7bJE5A2X/_ssgManifest.js"
8
+ "static/trRaWc1ebFq78iuTpvU9H/_buildManifest.js",
9
+ "static/trRaWc1ebFq78iuTpvU9H/_ssgManifest.js"
10
10
  ],
11
11
  "rootMainFiles": [],
12
12
  "rootMainFilesTree": {},
@@ -83,8 +83,8 @@
83
83
  "static/chunks/576-6699fed6c88502fe.js",
84
84
  "static/chunks/195-2c0168eacab722d2.js",
85
85
  "static/chunks/455-97ad88d6604f54b7.js",
86
- "static/chunks/909-27ada1f00a52e11d.js",
87
- "static/chunks/pages/document-roles-24e4ba16d654959d.js"
86
+ "static/chunks/496-4fb9a063790e65ff.js",
87
+ "static/chunks/pages/document-roles-cb222be93cfd561d.js"
88
88
  ],
89
89
  "/documents": [
90
90
  "static/chunks/webpack-77d10b4726f13aa5.js",
@@ -200,7 +200,7 @@
200
200
  "static/chunks/195-2c0168eacab722d2.js",
201
201
  "static/chunks/985-4b4a3ed36ada16eb.js",
202
202
  "static/chunks/525-5d947137d894f5fe.js",
203
- "static/chunks/pages/prompt-3468fb841f4c5c8c.js"
203
+ "static/chunks/pages/prompt-9b869fbe3463020d.js"
204
204
  ],
205
205
  "/settings": [
206
206
  "static/chunks/webpack-77d10b4726f13aa5.js",
@@ -0,0 +1 @@
1
+ {"type": "commonjs"}
@@ -3,9 +3,9 @@
3
3
  "routes": {},
4
4
  "dynamicRoutes": {},
5
5
  "preview": {
6
- "previewModeId": "23431d82ca68dd00146b5f5bf50818e5",
7
- "previewModeSigningKey": "24b1bd16b9d5e5dfdf073b63c0d86a1eb1c7cf3da6a2f8cbc34292951528d79f",
8
- "previewModeEncryptionKey": "70b3ac4e9380b6985cfdf7d02bf58372a08ff8ffe4d1c270a44088e8e927d144"
6
+ "previewModeId": "ad66a18c3feb9a751e0d79388ed0470f",
7
+ "previewModeSigningKey": "092ae4b5d3940833c25b5ebb84b0c8c6a336f2d79ee688fff3d3d90064f3eb03",
8
+ "previewModeEncryptionKey": "558a50b1d4febde67e2f5cddd2183d4ed58e09de6ec968709096d5616883ed11"
9
9
  },
10
10
  "notFoundRoutes": []
11
11
  }
@@ -74,7 +74,7 @@ ${d.slice(a).trimStart()}`}return`${e}
74
74
 
75
75
  ${d}`}(aT(b_.markdown,bS),am)),b2=[...aZ(bT,am,aN,aM,bS),...bU];for(let a of((bK=function(a,b,c,d,e,f,g){if(!a)return b;let h=[...b],i=[...c.project,...c.schedule,...c.quality,...c.safety,...c.resources,...Object.values(c.schemaFacts).flat()],j=new Set([...i.map(a=>a.key),...i.map(a=>a.fieldName).filter(Boolean),...c.tables.flatMap(a=>[...a.headers,...a.rows.flat()])]),k=new Set(d.map(a=>a.title));for(let b of a.factFields.filter(a=>a.required)){let a=c.schemaFacts[b.id]||[],e=d.some(a=>!a.missingFacts.includes(b.name)&&a.evidence.some(a=>aF(a,b))),f=!b.sourceRoleIds?.length||a.some(a=>b.sourceRoleIds?.includes(a.roleId))||d.some(a=>a.evidence.some(a=>aF(a,b)));0!==a.length||j.has(b.name)||e||h.push({level:"warning",message:`必需事实缺失:${b.name}`,suggestion:b.extractionHint||"请补充资料或调整事实字段配置。"}),f||h.push({level:"warning",message:`必需事实来源角色不匹配:${b.name}`,suggestion:`请确认该事实来自角色:${b.sourceRoleIds?.join("、")}`})}if("fixed"===a.chapterMode)for(let b of a.chapterRules.filter(a=>a.required)){k.has(b.title)||h.push({level:"error",message:`必需章节缺失:${b.title}`,suggestion:"请在模板或规范包章节规则中补齐章节。"});let a=d.find(a=>a.title===b.title);a&&b.minWords&&a.content.length<b.minWords&&h.push({level:"warning",message:`章节内容低于最低字数:${b.title}`,suggestion:`建议不少于 ${b.minWords} 字。`})}else{let b=a.dynamicChapterRule;if(b.minChapters&&d.length<b.minChapters&&h.push({level:"warning",message:`动态章节数量低于最少章节:${d.length}/${b.minChapters}`,suggestion:"请补充资料或降低最少章节数。"}),b.maxChapters&&d.length>b.maxChapters&&h.push({level:"warning",message:`动态章节数量超过最多章节:${d.length}/${b.maxChapters}`,suggestion:"请收紧来源文件角色或降低召回范围。"}),b.minWordsPerChapter)for(let a of d)a.content.length<b.minWordsPerChapter&&h.push({level:"warning",message:`动态章节内容低于最低字数:${a.title}`,suggestion:`建议不少于 ${b.minWordsPerChapter} 字。`})}let l=bg(e),m=[...e.matchAll(/!\[([^\]]*)\]\(([^)]+)\)/gu)].map(a=>({alt:a[1]||"",url:a[2]||"",index:a.index??0})),n=bf(e);for(let b of a.gateRules){let a=b.level,o=b.evaluator?b.evaluator:"required_fact"===b.type?{subject:"fact",operator:"exists",target:b.target}:"required_chapter"===b.type?{subject:"chapter",operator:"exists",target:b.target}:"required_file_role"===b.type?{subject:"file_role",operator:"exists",target:b.target}:"required_prompt_role"===b.type?{subject:"prompt_role",operator:"exists",target:b.target}:"source_required"===b.type?{subject:"source",operator:"all_have_source"}:"forbidden_text"===b.type?{subject:"document",operator:"not_contains",value:b.value}:"min_chapter_length"===b.type?{subject:"chapter",operator:"min_length",target:b.target,min:Number(b.value)||void 0}:"table_required"===b.type?{subject:"table",operator:"min_count",min:1}:{subject:"document",operator:"contains",value:b.value||b.target},p=o.target||b.target||"",q=o.value||b.value||p,r=o.min||Number(b.value)||1,s=d.find(a=>a.title===p),t="chapter"===o.subject&&s?s.content:e,u=q?function(a){try{return RegExp(a,"iu")}catch{return}}(q):void 0;"fact"===o.subject&&"exists"===o.operator&&p&&!j.has(p)&&h.push({level:a,message:bh(b,`缺少事实 ${p}`)}),"chapter"===o.subject&&"exists"===o.operator&&p&&!k.has(p)&&h.push({level:a,message:bh(b,`缺少章节 ${p}`)}),"file_role"===o.subject&&"exists"===o.operator&&p&&!f.some(a=>a.roleId===p)&&h.push({level:a,message:bh(b,`缺少文件角色 ${p}`)}),"prompt_role"===o.subject&&"exists"===o.operator&&p&&!g.some(a=>a.roleId===p)&&h.push({level:a,message:bh(b,`缺少提示词角色 ${p}`)}),"document"===o.subject&&"contains"===o.operator&&q&&!e.includes(q)&&h.push({level:a,message:bh(b,`全文必须包含 ${q}`)}),"document"===o.subject&&"not_contains"===o.operator&&q&&e.includes(q)&&h.push({level:a,message:bh(b,`出现禁用文本 ${q}`)}),"document"!==o.subject&&"chapter"!==o.subject||"regex_match"!==o.operator||!q||u&&u.test(t)||h.push({level:a,message:bh(b,`未匹配正则 ${q}`)}),("document"===o.subject||"chapter"===o.subject)&&"regex_not_match"===o.operator&&u?.test(t)&&h.push({level:a,message:bh(b,`匹配到禁止正则 ${q}`)}),"chapter"===o.subject&&"contains"===o.operator&&p&&q&&(!s||!s.content.includes(q))&&h.push({level:a,message:bh(b,`章节 ${p} 必须包含 ${q}`)}),"chapter"===o.subject&&"not_contains"===o.operator&&s?.content.includes(q)&&h.push({level:a,message:bh(b,`章节 ${p} 出现禁用文本 ${q}`)}),"chapter"===o.subject&&"min_length"===o.operator&&p&&(!s||s.content.length<r)&&h.push({level:a,message:bh(b,`章节 ${p} 低于 ${r} 字`)}),"table"===o.subject&&"min_count"===o.operator&&c.tables.length+l.length<r&&h.push({level:a,message:bh(b,`表格数量少于 ${r}`)}),"table"===o.subject&&"table_explanation_required"===o.operator&&l.some(a=>e.indexOf(a)>=0&&e.slice(e.indexOf(a)+a.length,e.indexOf(a)+a.length+120).trim().length<10)&&h.push({level:a,message:bh(b,"存在缺少说明文字的表格")}),"image"===o.subject&&"min_count"===o.operator&&m.length<r&&h.push({level:a,message:bh(b,`图片数量少于 ${r}`)}),"page"===o.subject&&"min_count"===o.operator&&n<r&&h.push({level:a,message:bh(b,`预计页数 ${n} 少于 ${r}`)}),"page"===o.subject&&"max_count"===o.operator&&n>r&&h.push({level:a,message:bh(b,`预计页数 ${n} 超过 ${r}`)}),"image"===o.subject&&"image_caption_required"===o.operator&&m.some(a=>!a.alt&&e.slice(a.index+a.url.length,a.index+a.url.length+120).trim().length<10)&&h.push({level:a,message:bh(b,"存在缺少说明文字的图片")}),"source"===o.subject&&"all_have_source"===o.operator&&i.some(a=>!a.sourceFile)&&h.push({level:a,message:bh(b,"存在无来源事实")}),"source"===o.subject&&"min_count"===o.operator&&new Set(i.map(a=>a.sourceFile).filter(Boolean)).size<r&&h.push({level:a,message:bh(b,`来源数量少于 ${r}`)})}return h}(x,[...bK,...b2.map(a=>({level:"warning",message:a}))],bH,am,b1,B,u)).push(...function(a){let b=[],c=a.markdown||"";for(let d of a.spec.factFields.filter(a=>a.required))!c.includes(d.name)&&d.name.length>=3&&b.push({level:"warning",message:`后台自动规范提示:正文可能未显式覆盖“${d.name}”`,suggestion:"建议检查对应章节是否已自然表达该事实。"});let d=a.summary.facts.projectName;d&&"当前知识库项目"!==d&&!c.includes(d)&&b.push({level:"warning",message:"正文未明显体现项目名称",suggestion:"建议在工程概况或首页标题中体现当前项目名称。"});let e=a.summary.facts.tenderNo;for(let a of(e&&!c.includes(e)&&b.push({level:"info",message:"正文未体现招标/项目编号",suggestion:"如正式文件需要编号,请在工程概况中补充。"}),["知识库证据","文件角色","提示词角色","文档规范包","规范包","后台自动规范","资料未提供","未检索到"]))c.includes(a)&&b.push({level:"error",message:`正文包含后台流程话术:${a}`,suggestion:"请重新生成或在审查阶段删除后台流程描述。"});return b}({markdown:b1,spec:x,summary:z})),bK.push(...function(a){let b=[];for(let c of[{label:"项目名称",keys:["项目名称","工程名称"]},{label:"招标编号",keys:["招标编号","项目编号"]},{label:"工期要求",keys:["工期","进度节点"]},{label:"质量要求",keys:["质量"]}]){let d=new Map;for(let b of function(a,b){return a.filter(a=>b.some(b=>a.key.includes(b)||a.fieldName?.includes(b))).map(a=>({value:String(a.value),source:a.sourceFile}))}(a.facts,c.keys)){let a=b.value.replace(/\s+/gu,"").replace(/[,。,.;;::]/gu,"").toLowerCase();a&&!(a.length<2)&&d.set(a,[...d.get(a)||[],b])}if(d.size>1){let a=[...d.values()].map(a=>`${a[0].value}(${a.map(a=>a.source).filter(Boolean).join("、")||"未知来源"})`).join(" vs ");b.push({level:"error",message:`事实一致性冲突:${c.label} 存在多个值:${a}`,suggestion:"请确认当前项目资料组,或在模板绑定中只绑定当前项目资料。"})}}let c=a.summary.facts.projectName;return c&&"当前知识库项目"!==c&&!a.markdown.includes(c)&&b.push({level:"error",message:`正文未包含当前项目名称:${c}`,suggestion:"请重新生成,确保标题或工程概况体现当前项目名称。"}),b}({markdown:b1,facts:bA,summary:z})),bK.push(...function(a,b){let c=[],d=new Set([b.projectName,...b.fingerprint.projectNames].filter(Boolean));for(let e of b.contaminationCandidates)e.length>=6&&!d.has(e)&&H(a,e)&&c.push({level:"error",message:`正文疑似混入其他项目名称:${e}`,suggestion:"请检查项目资料组选择、模板绑定文件和知识库证据范围。"});let e=b.fingerprint.tenderNos,f=a.match(/\b\d{4}[A-Z]{2,}\d{4,}\b/gu)?.find(a=>!e.includes(a));return f&&e.length>0&&c.push({level:"error",message:`正文疑似混入其他项目编号:${f}`,suggestion:"请重新生成并检查是否召回了其他项目资料。"}),c}(b1,z)),bK.push(...function(a){let b=[],c=(0,o.V)().technicalDetailGate,d=`${a.template.name} ${a.template.category} ${a.template.outputTitle}`;if(!(c?.templateMatchers?.length?c.templateMatchers:["施工组织设计","施工方案","技术标.*施工","施工.*技术标"]).some(a=>RegExp(a,"iu").test(d)))return b;let e=a.finalMarkdown||a.chapters.map(a=>`${a.title}
76
76
  ${a.content}`).join("\n\n"),f=_(a.chapters.filter(a=>/施工方法|主要.*方法|工艺/u.test(a.title)).map(a=>a.content).join("\n")||e,L).length,g=[M,N,O,P,Q].reduce((a,b)=>a+_(e,b).length,0),h=_(e,R).length,i=S.filter(a=>e.includes(a)).length,j=T.filter(a=>e.includes(a)).length,k=(c?.genericPhrases?.length?c.genericPhrases:Y).reduce((a,b)=>a+(e.match(RegExp(b,"gu"))?.length||0),0),l=a.assignments.flatMap(a=>a.facts),m=$(l.flatMap(a=>{var b;return $([..._(b=`${a.parameter||""} ${a.specification||""} ${a.text}`,L),..._(b,M),..._(b,N),..._(b,O),..._(b,P),..._(b,Q),..._(b,R)].map(a=>a.replace(/\s+/gu,"")))})).slice(0,120),n=m.filter(a=>e.replace(/\s+/gu,"").includes(a)),p=m.length?n.length/m.length:1,q=c?.minAssignedFactCountForBlocking??12;return l.length>=q&&p<(c?.minTechnicalFactUsageRate??.35)&&b.push({level:"error",message:`工程技术事实使用率不足:${Math.round(100*p)}%`,suggestion:"请把清单、图纸、设计说明中的材料规格、尺寸参数、试验验收和规范编号写入对应章节。"}),f<(c?.minMethodParameterCount??18)&&l.length>=q&&b.push({level:"error",message:`施工方法参数密度不足:仅识别 ${f} 个数字/规格参数`,suggestion:"主要施工方法应补充材料强度、厚度、尺寸、管径、试验时间、压力、偏差和数量等可核查参数。"}),g<(c?.minQuantitativeFactCount??20)&&l.length>=q&&b.push({level:"error",message:`工程量化事实密度不足:仅识别 ${g} 个工程量/工期/频次/资源/金额类数据`,suggestion:"请把工程数量、学校数量、工期节点、检查频次、人员驻场、机械设备、检测比例、响应时限和违约承诺写入对应章节。"}),h<(c?.minStandardCount??4)&&b.push({level:"warning",message:`规范标准引用不足:仅识别 ${h} 个规范编号`,suggestion:"请结合图纸、设计说明和招标文件补充 GB/JGJ/CJJ 等规范或验收标准。"}),i<(c?.minProcessActionCount??6)&&b.push({level:"warning",message:`工艺动作覆盖不足:仅识别 ${i} 类施工动作`,suggestion:"请补充基层处理、测量放线、样板、安装连接、隐蔽验收、调试和成品保护等工艺链。"}),j<(c?.minInspectionActionCount??6)&&b.push({level:"warning",message:`试验验收表达不足:仅识别 ${j} 类试验/验收动作`,suggestion:"请补充闭水、打压、通球、绝缘、联动、复试、允许偏差等验收控制。"}),k>Math.max(c?.maxGenericPhraseCountPer1800Chars??10,Math.floor(e.length/1800)*(c?.maxGenericPhraseCountPer1800Chars??10))&&b.push({level:"error",message:`空泛表达过多:识别 ${k} 处泛化表述`,suggestion:"请减少“按规范要求、满足设计要求、加强管理”等空话,并用具体参数、流程和验收动作替代。"}),b}({template:n,chapters:am,assignments:ap,finalMarkdown:b1})),bK.push(...bj(b1)),bK.push(...bi(b1)),bK.push(...bk(b1,bH)),bK.push(...bl(b1)),c={template:n,chapters:am,markdown:b1},(0,o.V)().qualityBenchmarks.filter(a=>(function(a,b){let c=`${a.name} ${a.category} ${a.outputTitle} ${a.description}`;return b.templateMatchers.some(a=>RegExp(a,"iu").test(c))})(c.template,a)).map(a=>{let b=0,d=0,e=[];for(let f of a.rules){let a=Math.max(0,f.weight||0);d+=a,function(a,b,c){let d=c||b.map(a=>`${a.title}
77
- ${a.content}`).join("\n\n"),e=function(a,b=[]){return b.filter(b=>b&&a.includes(b)).length}(d,a.keywords),f=function(a,b=[]){return b.filter(b=>a.some(a=>RegExp(b,"iu").test(a.title))).length}(b,a.titlePatterns),g=[a.keywords?.length?e/a.keywords.length:void 0,a.titlePatterns?.length?f/a.titlePatterns.length:void 0,a.tableRequired?+!!/\n\s*\|[^\n]+\|\s*\n\s*\|\s*[-:| ]+\|/u.test(d):void 0].filter(a=>"number"==typeof a),h=g.length?g.reduce((a,b)=>a+b,0)/g.length:1,i=null==a.minRatio||h>=a.minRatio,j=null==a.minCount||e+f>=a.minCount;return{passed:i&&j,ratio:h,keywordCount:e,titleCount:f}}(f,c.chapters,c.markdown).passed?b+=a:e.push({level:f.level||"warning",message:`质量基准未达标:${f.name}`,suggestion:f.suggestion||"请补充专业细节、表格或对应章节内容。"})}let f=d>0?Math.round(b/d*100):100,g=f<a.blockBelowScore||e.some(a=>"error"===a.level);return{benchmarkId:a.id,benchmarkName:a.name,score:f,pass:f>=a.passScore,blocked:g,issues:g?[{level:"error",message:`文档质量基准评分未达标:${a.name} ${f}分`,suggestion:"请重新生成或补充模板、资料、章节内容后再导出。"},...e]:e}})))bK.push(...a.issues);bK.push(...function(a){let b=[],c=a.markdown;for(let c of a.roles.filter(a=>a.required))c.satisfied?c.weak&&b.push({level:"warning",message:`工程专项资料角色证据较弱:${c.role}`,suggestion:"建议补充更多同类资料以提高正式文件可靠性。"}):b.push({level:"error",message:`工程专项资料角色缺失:${c.role}`,suggestion:"请补充对应项目资料或调整模板角色绑定。"});for(let d of(a.summary.facts.professionalScopes||[]).slice(0,10))d.length>=4&&!H(c,d)&&b.push({level:"warning",message:`正文可能未覆盖资料中的专业/范围:${d}`,suggestion:"建议检查施工范围、施工方法或资源配置章节。"});let d=a.chapters.map(a=>a.title).join("、");if(/施工组织|施工方案|技术标|施工/iu.test(c+d))for(let a of["质量","安全","进度"])c.includes(a)||d.includes(a)||b.push({level:"warning",message:`施工类正式文件缺少“${a}”控制内容`,suggestion:`建议补充${a}管理目标、措施和责任体系。`});return b}({markdown:b1,chapters:am,summary:z,roles:C})),bK.push(...bm(b1,n)),bK.push(...function(a,b){let c=a?.targetPages;if(!c?.min&&!c?.target&&!c?.max)return[];let d=bf(b,a),e=c.min||c.target,f=c.max||c.target,g=[];return e&&d<e&&g.push({level:"error",message:`正文篇幅低于目标页数:预计约 ${d} 页,目标不少于 ${e} 页`,suggestion:"请重新生成或增加章节正文深度后再导出正式文件。"}),f&&d>f+4&&g.push({level:"warning",message:`正文篇幅可能超过目标页数:预计约 ${d} 页,目标不超过 ${f} 页`,suggestion:"建议检查是否存在重复段落或过度展开。"}),g}(n.generationSettings||n.exportSettings,b1)),bK.push(...br(b1,n));let b3=function(a,b,c){let d=[{key:"no_errors",label:"无阻断级校验错误",passed:!a.some(a=>"error"===a.level&&be(a))},{key:"project_facts",label:"项目基础事实齐全",passed:b.project.length>0},{key:"source_traceability",label:"事实具备来源追踪",passed:[...b.project,...b.schedule,...b.quality,...b.safety].every(a=>!!a.sourceFile)},{key:"bill_drawing_precision",label:"清单/图纸精确参数已使用",passed:b.preciseFacts.length<20||a.every(a=>!/清单\/图纸精确参数使用不足|未体现工程量清单|未体现图纸/u.test(a.message))},{key:"chapter_evidence",label:"章节均具备证据",passed:c.every(a=>a.evidence.length>0)},{key:"no_missing_content",label:"无资料未提供章节",passed:c.every(a=>!a.content.includes("资料未提供"))},{key:"no_project_contamination",label:"无项目污染和事实一致性阻断",passed:!a.some(a=>"error"===a.level&&/其他项目|项目编号|项目名称|事实一致性冲突/iu.test(a.message))}],e=a.filter(a=>"error"===a.level&&be(a));return{passed:0===e.length&&d.every(a=>a.passed),blockingIssues:e,checklist:d}}(bK,bH,am),b4=b3.blockingIssues.length,b5=b0.map(a=>"validation"===a.type?{...a,status:b4>0?"failed":"success",message:`阻断 ${b4},问题 ${bK.length}`}:"export_ready"===a.type?{...a,status:b3.passed?"success":"failed",message:b3.passed?"已准备好导出 Markdown/HTML/DOCX/PDF":"导出门禁存在阻断项"}:a);return{...bP,validationIssues:bK,exportGate:b3,executionStages:b5,markdown:b1}}async function bv(a){let b=ai(a.templateId);if(!b)throw Error("Document template not found");let c=b.chapters.find(b=>b.id===a.chapterId);if(!c)throw Error("Document chapter not found");let d=a.projectRoot||(0,j.aY)();if(!d)throw Error("No knowledge base project found");let e=(0,j.Qh)(),f=Math.max(5,Math.min(30,a.maxEvidencePerChapter??12)),g=[];for(let a of c.queries){let b=await e.search(d,a,{scope:"project",limit:f,weights:{keyword:.4,vector:.45,rewrite:.75,hybridBonus:.15}});g.push(...b.results.map(a=>({chapterId:c.id,filePath:a.filePath,score:a.score,content:a.content,sectionTitle:a.sectionTitle,source:a.source})))}let h=ar(g,f),i=a.currentMarkdown?a.currentMarkdown.slice(0,4e3):"",k=new Set(a.existingFacts??[]),l=c.requiredFacts.filter(a=>!k.has(a)&&!h.some(b=>aD(b,a))),m=[`## ${c.title}`,"",a.requirement?`> 生成要求:${a.requirement}`:"",i?`> 当前文档上下文摘要:${i.replace(/\s+/gu," ").slice(0,800)}`:"",h.length>0?`本章根据知识库资料围绕“${c.purpose}”重新整理,并与当前文档上下文保持一致。`:"建议补充更多资料后复核。","",h.length>0?"### 资料依据":"",...h.map(at),"",l.length>0?"### 待确认事项":"",...l.map(a=>`- ${a}:建议人工复核或补充更明确资料。`)].filter(Boolean).join("\n");return{id:c.id,title:c.title,content:m,evidence:h,missingFacts:l}}},79181:(a,b,c)=>{c.d(b,{V:()=>h});var d=c(73024),e=c(48161),f=c(76760);let g={reviewStandardQueries:[],reviewChapterTemplateMatchers:[],reviewChapterSectionDefaults:{firstChapterSections:[],chapterSections:[],firstChapterTableSections:[],firstChapterTableRequirements:[]},templates:[],roles:[],roleConfigs:[],qualityBenchmarks:[],autoSpecGates:[],chapterTitleFilters:[]};function h(){try{var a;let b=function(){let a=f.join(e.homedir(),".customize-agent");return d.mkdirSync(a,{recursive:!0}),f.join(a,"engineering-document-config.json")}();if(!d.existsSync(b))return g;return a=JSON.parse(d.readFileSync(b,"utf-8")),{reviewStandardQueries:Array.isArray(a.reviewStandardQueries)?a.reviewStandardQueries.filter(Boolean):[],reviewChapterTemplateMatchers:Array.isArray(a.reviewChapterTemplateMatchers)?a.reviewChapterTemplateMatchers.filter(Boolean):[],reviewChapterSectionDefaults:{firstChapterSections:Array.isArray(a.reviewChapterSectionDefaults?.firstChapterSections)?a.reviewChapterSectionDefaults.firstChapterSections.filter(Boolean):[],chapterSections:Array.isArray(a.reviewChapterSectionDefaults?.chapterSections)?a.reviewChapterSectionDefaults.chapterSections.filter(Boolean):[],firstChapterTableSections:Array.isArray(a.reviewChapterSectionDefaults?.firstChapterTableSections)?a.reviewChapterSectionDefaults.firstChapterTableSections.filter(Boolean):[],firstChapterTableRequirements:Array.isArray(a.reviewChapterSectionDefaults?.firstChapterTableRequirements)?a.reviewChapterSectionDefaults.firstChapterTableRequirements.filter(Boolean):[]},templates:Array.isArray(a.templates)?a.templates:[],roles:Array.isArray(a.roles)?a.roles:[],roleConfigs:Array.isArray(a.roleConfigs)?a.roleConfigs:[],qualityBenchmarks:Array.isArray(a.qualityBenchmarks)?a.qualityBenchmarks:[],technicalDetailGate:a.technicalDetailGate,autoSpecGates:Array.isArray(a.autoSpecGates)?a.autoSpecGates:[],chapterTitleFilters:Array.isArray(a.chapterTitleFilters)?a.chapterTitleFilters:[]}}catch{return g}}},89952:(a,b,c)=>{c.d(b,{DZ:()=>t,FV:()=>s,Mu:()=>u,NR:()=>v,XB:()=>q,dg:()=>r,dw:()=>w});var d=c(73024),e=c(48161),f=c(76760),g=c(79181);function h(){let a=f.join(e.homedir(),".customize-agent");return d.mkdirSync(a,{recursive:!0}),f.join(a,"document-roles.json")}function i(a){return(a||`item-${Date.now()}`).replace(/[^a-zA-Z0-9_-]/gu,"-").slice(0,80)}function j(a=[]){let b=new Set;return a.filter(a=>!(!a.roleId||b.has(a.roleId))&&(b.add(a.roleId),!0))}function k(a){var b,c;let d="prompt"===a.type?"prompt":"file";return{id:i(a.id),name:a.name||"未命名角色",description:a.description||"",type:d,builtIn:!!a.builtIn,resourceId:a.resourceId||a.resourceIds?.[0]||void 0,resourceIds:function(a=[]){return[...new Set(a.filter(Boolean))]}(Array.isArray(a.resourceIds)&&a.resourceIds.length>0?a.resourceIds:a.resourceId?[a.resourceId]:[]),executionType:"prompt"===d?"fact_extraction"===(b=a.executionType)||"chapter_generation"===b||"llm_review"===b||"validation"===b||"formatting"===b||"reference"===b?b:"reference":void 0,processingType:"file"===d?"rule"===(c=a.processingType)||"project_fact"===c||"table"===c||"drawing"===c||"specification"===c||"reference"===c?c:"reference":void 0}}function l(a){return{id:i(a.id),name:a.name||"未命名配置",description:a.description||"",builtIn:!!a.builtIn,fileRoles:j(Array.isArray(a.fileRoles)?a.fileRoles.filter(a=>a.roleId).map((a,b)=>({roleId:a.roleId,order:Number.isFinite(a.order)?a.order:b})):[]),promptRoles:j(Array.isArray(a.promptRoles)?a.promptRoles.filter(a=>a.roleId).map((a,b)=>({roleId:a.roleId,order:Number.isFinite(a.order)?a.order:b})):[])}}function m(){try{let a=h();if(!d.existsSync(a))return{roles:[],configs:[]};let b=JSON.parse(d.readFileSync(a,"utf-8"));if(Array.isArray(b))return{roles:b.map(k),configs:[]};return{roles:Array.isArray(b.roles)?b.roles.map(k):[],configs:Array.isArray(b.configs)?b.configs.map(l):[]}}catch{return{roles:[],configs:[]}}}function n(a){d.writeFileSync(h(),JSON.stringify({roles:a.roles.map(k),configs:a.configs.map(l)},null,2),"utf-8")}function o(){return(0,g.V)().roles.map(a=>k({...a,builtIn:!0}))}function p(){return(0,g.V)().roleConfigs.map(a=>l({...a,builtIn:!0}))}function q(a){let b=o(),c=m().roles.filter(a=>!b.some(b=>b.id===a.id&&b.type===a.type)),d=[...b,...c];return a?d.filter(b=>b.type===a):d}function r(a){let b=k(a),c=m();return c.roles=c.roles.filter(a=>a.id!==b.id||a.type!==b.type),c.roles.push(b),n(c),b}function s(a,b){if(o().some(c=>c.id===b&&c.type===a))throw Error("Configured role cannot be deleted");let c=m();c.roles=c.roles.filter(c=>c.id!==b||c.type!==a),c.configs=c.configs.map(a=>({...a,fileRoles:a.fileRoles.filter(a=>a.roleId!==b),promptRoles:a.promptRoles.filter(a=>a.roleId!==b)})),n(c)}function t(){let a=p(),b=m().configs.filter(b=>!a.some(a=>a.id===b.id));return[...a,...b]}function u(a){return t().find(b=>b.id===a)}function v(a){let b={...l(a),builtIn:!1},c=m();return c.configs=c.configs.filter(a=>a.id!==b.id),c.configs.push(b),n(c),b}function w(a){if(p().some(b=>b.id===a))throw Error("Configured role config cannot be deleted");let b=m();b.configs=b.configs.filter(b=>b.id!==a),n(b)}},99842:(a,b,c)=>{c.d(b,{E:()=>t,Hh:()=>n,PH:()=>u,dg:()=>l,h0:()=>p,i3:()=>o,jk:()=>q,p:()=>s,pJ:()=>m});var d=c(87550),e=c.n(d),f=c(33873),g=c(21820),h=c(29021);let i={project_fact:"项目知识",user_preference:"用户偏好",feedback:"历史纠偏",pattern:"解决方案"};function j(){let a=f.join(g.homedir(),".customize-agent","memory.db");return h.existsSync(a)?new(e())(a,{readonly:!0}):null}function k(a){let b=Number(a.access_count??0);return{id:String(a.id),title:String(a.content||"").slice(0,80),content:String(a.content||""),type:String(a.type||"project_fact"),importance:b>=5?"high":b>=2?"medium":"low",tags:[i[String(a.type)]||String(a.type)],source:String(a.context||"").slice(0,100),created_at:new Date(String(a.created_at)).getTime(),updated_at:new Date(String(a.updated_at)).getTime()}}function l(a){let b=j();if(!b)return[];try{let c="SELECT * FROM memories WHERE access_count >= 2",d=[];return a&&(c+=" AND (content LIKE ? OR context LIKE ?)",d.push(`%${a}%`,`%${a}%`)),c+=" ORDER BY access_count DESC, updated_at DESC LIMIT 200",b.prepare(c).all(...d).map(k)}finally{b.close()}}function m(a){let b=j();if(!b)return[];try{let c="SELECT * FROM memories WHERE access_count < 2",d=[];return a&&(c+=" AND (content LIKE ? OR context LIKE ?)",d.push(`%${a}%`,`%${a}%`)),c+=" ORDER BY updated_at DESC LIMIT 200",b.prepare(c).all(...d).map(k)}finally{b.close()}}function n(a,b=8,c){let d=j();if(!d)return[];try{let e=a.split(/[\s,,。;;::、/\\|]+/u).map(a=>a.trim()).filter(a=>a.length>=2).slice(0,8),g=c?`%Project: ${f.resolve(c)}%`:void 0;if(0===e.length)return(g?d.prepare("SELECT * FROM memories WHERE context LIKE ? ORDER BY access_count DESC, updated_at DESC LIMIT ?").all(g,b):d.prepare("SELECT * FROM memories ORDER BY access_count DESC, updated_at DESC LIMIT ?").all(b)).map(k);let h=e.map(()=>"(content LIKE ? OR context LIKE ?)").join(" OR "),i=e.flatMap(a=>[`%${a}%`,`%${a}%`]);return(g?d.prepare(`
77
+ ${a.content}`).join("\n\n"),e=function(a,b=[]){return b.filter(b=>b&&a.includes(b)).length}(d,a.keywords),f=function(a,b=[]){return b.filter(b=>a.some(a=>RegExp(b,"iu").test(a.title))).length}(b,a.titlePatterns),g=[a.keywords?.length?e/a.keywords.length:void 0,a.titlePatterns?.length?f/a.titlePatterns.length:void 0,a.tableRequired?+!!/\n\s*\|[^\n]+\|\s*\n\s*\|\s*[-:| ]+\|/u.test(d):void 0].filter(a=>"number"==typeof a),h=g.length?g.reduce((a,b)=>a+b,0)/g.length:1,i=null==a.minRatio||h>=a.minRatio,j=null==a.minCount||e+f>=a.minCount;return{passed:i&&j,ratio:h,keywordCount:e,titleCount:f}}(f,c.chapters,c.markdown).passed?b+=a:e.push({level:f.level||"warning",message:`质量基准未达标:${f.name}`,suggestion:f.suggestion||"请补充专业细节、表格或对应章节内容。"})}let f=d>0?Math.round(b/d*100):100,g=f<a.blockBelowScore||e.some(a=>"error"===a.level);return{benchmarkId:a.id,benchmarkName:a.name,score:f,pass:f>=a.passScore,blocked:g,issues:g?[{level:"error",message:`文档质量基准评分未达标:${a.name} ${f}分`,suggestion:"请重新生成或补充模板、资料、章节内容后再导出。"},...e]:e}})))bK.push(...a.issues);bK.push(...function(a){let b=[],c=a.markdown;for(let c of a.roles.filter(a=>a.required))c.satisfied?c.weak&&b.push({level:"warning",message:`工程专项资料角色证据较弱:${c.role}`,suggestion:"建议补充更多同类资料以提高正式文件可靠性。"}):b.push({level:"error",message:`工程专项资料角色缺失:${c.role}`,suggestion:"请补充对应项目资料或调整模板角色绑定。"});for(let d of(a.summary.facts.professionalScopes||[]).slice(0,10))d.length>=4&&!H(c,d)&&b.push({level:"warning",message:`正文可能未覆盖资料中的专业/范围:${d}`,suggestion:"建议检查施工范围、施工方法或资源配置章节。"});let d=a.chapters.map(a=>a.title).join("、");if(/施工组织|施工方案|技术标|施工/iu.test(c+d))for(let a of["质量","安全","进度"])c.includes(a)||d.includes(a)||b.push({level:"warning",message:`施工类正式文件缺少“${a}”控制内容`,suggestion:`建议补充${a}管理目标、措施和责任体系。`});return b}({markdown:b1,chapters:am,summary:z,roles:C})),bK.push(...bm(b1,n)),bK.push(...function(a,b){let c=a?.targetPages;if(!c?.min&&!c?.target&&!c?.max)return[];let d=bf(b,a),e=c.min||c.target,f=c.max||c.target,g=[];return e&&d<e&&g.push({level:"error",message:`正文篇幅低于目标页数:预计约 ${d} 页,目标不少于 ${e} 页`,suggestion:"请重新生成或增加章节正文深度后再导出正式文件。"}),f&&d>f+4&&g.push({level:"warning",message:`正文篇幅可能超过目标页数:预计约 ${d} 页,目标不超过 ${f} 页`,suggestion:"建议检查是否存在重复段落或过度展开。"}),g}(n.generationSettings||n.exportSettings,b1)),bK.push(...br(b1,n));let b3=function(a,b,c){let d=[{key:"no_errors",label:"无阻断级校验错误",passed:!a.some(a=>"error"===a.level&&be(a))},{key:"project_facts",label:"项目基础事实齐全",passed:b.project.length>0},{key:"source_traceability",label:"事实具备来源追踪",passed:[...b.project,...b.schedule,...b.quality,...b.safety].every(a=>!!a.sourceFile)},{key:"bill_drawing_precision",label:"清单/图纸精确参数已使用",passed:b.preciseFacts.length<20||a.every(a=>!/清单\/图纸精确参数使用不足|未体现工程量清单|未体现图纸/u.test(a.message))},{key:"chapter_evidence",label:"章节均具备证据",passed:c.every(a=>a.evidence.length>0)},{key:"no_missing_content",label:"无资料未提供章节",passed:c.every(a=>!a.content.includes("资料未提供"))},{key:"no_project_contamination",label:"无项目污染和事实一致性阻断",passed:!a.some(a=>"error"===a.level&&/其他项目|项目编号|项目名称|事实一致性冲突/iu.test(a.message))}],e=a.filter(a=>"error"===a.level&&be(a));return{passed:0===e.length&&d.every(a=>a.passed),blockingIssues:e,checklist:d}}(bK,bH,am),b4=b3.blockingIssues.length,b5=b0.map(a=>"validation"===a.type?{...a,status:b4>0?"failed":"success",message:`阻断 ${b4},问题 ${bK.length}`}:"export_ready"===a.type?{...a,status:b3.passed?"success":"failed",message:b3.passed?"已准备好导出 Markdown/HTML/DOCX/PDF":"导出门禁存在阻断项"}:a);return{...bP,validationIssues:bK,exportGate:b3,executionStages:b5,markdown:b1}}async function bv(a){let b=ai(a.templateId);if(!b)throw Error("Document template not found");let c=b.chapters.find(b=>b.id===a.chapterId);if(!c)throw Error("Document chapter not found");let d=a.projectRoot||(0,j.aY)();if(!d)throw Error("No knowledge base project found");let e=(0,j.Qh)(),f=Math.max(5,Math.min(30,a.maxEvidencePerChapter??12)),g=[];for(let a of c.queries){let b=await e.search(d,a,{scope:"project",limit:f,weights:{keyword:.4,vector:.45,rewrite:.75,hybridBonus:.15}});g.push(...b.results.map(a=>({chapterId:c.id,filePath:a.filePath,score:a.score,content:a.content,sectionTitle:a.sectionTitle,source:a.source})))}let h=ar(g,f),i=a.currentMarkdown?a.currentMarkdown.slice(0,4e3):"",k=new Set(a.existingFacts??[]),l=c.requiredFacts.filter(a=>!k.has(a)&&!h.some(b=>aD(b,a))),m=[`## ${c.title}`,"",a.requirement?`> 生成要求:${a.requirement}`:"",i?`> 当前文档上下文摘要:${i.replace(/\s+/gu," ").slice(0,800)}`:"",h.length>0?`本章根据知识库资料围绕“${c.purpose}”重新整理,并与当前文档上下文保持一致。`:"建议补充更多资料后复核。","",h.length>0?"### 资料依据":"",...h.map(at),"",l.length>0?"### 待确认事项":"",...l.map(a=>`- ${a}:建议人工复核或补充更明确资料。`)].filter(Boolean).join("\n");return{id:c.id,title:c.title,content:m,evidence:h,missingFacts:l}}},79181:(a,b,c)=>{c.d(b,{V:()=>h});var d=c(73024),e=c(48161),f=c(76760);let g={reviewStandardQueries:[],reviewChapterTemplateMatchers:[],reviewChapterSectionDefaults:{firstChapterSections:[],chapterSections:[],firstChapterTableSections:[],firstChapterTableRequirements:[]},templates:[],roles:[],roleConfigs:[],qualityBenchmarks:[],autoSpecGates:[],chapterTitleFilters:[]};function h(){try{var a;let b=function(){let a=f.join(e.homedir(),".customize-agent");return d.mkdirSync(a,{recursive:!0}),f.join(a,"engineering-document-config.json")}();if(!d.existsSync(b))return g;return a=JSON.parse(d.readFileSync(b,"utf-8")),{reviewStandardQueries:Array.isArray(a.reviewStandardQueries)?a.reviewStandardQueries.filter(Boolean):[],reviewChapterTemplateMatchers:Array.isArray(a.reviewChapterTemplateMatchers)?a.reviewChapterTemplateMatchers.filter(Boolean):[],reviewChapterSectionDefaults:{firstChapterSections:Array.isArray(a.reviewChapterSectionDefaults?.firstChapterSections)?a.reviewChapterSectionDefaults.firstChapterSections.filter(Boolean):[],chapterSections:Array.isArray(a.reviewChapterSectionDefaults?.chapterSections)?a.reviewChapterSectionDefaults.chapterSections.filter(Boolean):[],firstChapterTableSections:Array.isArray(a.reviewChapterSectionDefaults?.firstChapterTableSections)?a.reviewChapterSectionDefaults.firstChapterTableSections.filter(Boolean):[],firstChapterTableRequirements:Array.isArray(a.reviewChapterSectionDefaults?.firstChapterTableRequirements)?a.reviewChapterSectionDefaults.firstChapterTableRequirements.filter(Boolean):[]},templates:Array.isArray(a.templates)?a.templates:[],roles:Array.isArray(a.roles)?a.roles:[],roleConfigs:Array.isArray(a.roleConfigs)?a.roleConfigs:[],qualityBenchmarks:Array.isArray(a.qualityBenchmarks)?a.qualityBenchmarks:[],technicalDetailGate:a.technicalDetailGate,autoSpecGates:Array.isArray(a.autoSpecGates)?a.autoSpecGates:[],chapterTitleFilters:Array.isArray(a.chapterTitleFilters)?a.chapterTitleFilters:[]}}catch{return g}}},89952:(a,b,c)=>{c.d(b,{DZ:()=>t,FV:()=>s,Mu:()=>u,NR:()=>v,XB:()=>q,dg:()=>r,dw:()=>w,ov:()=>A,tl:()=>z});var d=c(73024),e=c(48161),f=c(76760),g=c(79181);function h(){let a=f.join(e.homedir(),".customize-agent");return d.mkdirSync(a,{recursive:!0}),f.join(a,"document-roles.json")}function i(a){return(a||`item-${Date.now()}`).replace(/[^a-zA-Z0-9_-]/gu,"-").slice(0,80)}function j(a=[]){let b=new Set;return a.filter(a=>!(!a.roleId||b.has(a.roleId))&&(b.add(a.roleId),!0))}function k(a){var b,c;let d="prompt"===a.type?"prompt":"file";return{id:i(a.id),name:a.name||"未命名角色",description:a.description||"",type:d,builtIn:!!a.builtIn,resourceId:a.resourceId||a.resourceIds?.[0]||void 0,resourceIds:function(a=[]){return[...new Set(a.filter(Boolean))]}(Array.isArray(a.resourceIds)&&a.resourceIds.length>0?a.resourceIds:a.resourceId?[a.resourceId]:[]),executionType:"prompt"===d?"fact_extraction"===(b=a.executionType)||"chapter_generation"===b||"llm_review"===b||"validation"===b||"formatting"===b||"reference"===b?b:"reference":void 0,processingType:"file"===d?"rule"===(c=a.processingType)||"project_fact"===c||"table"===c||"drawing"===c||"specification"===c||"reference"===c?c:"reference":void 0}}function l(a){return{id:i(a.id),name:a.name||"未命名配置",description:a.description||"",builtIn:!!a.builtIn,fileRoles:j(Array.isArray(a.fileRoles)?a.fileRoles.filter(a=>a.roleId).map((a,b)=>({roleId:a.roleId,order:Number.isFinite(a.order)?a.order:b})):[]),promptRoles:j(Array.isArray(a.promptRoles)?a.promptRoles.filter(a=>a.roleId).map((a,b)=>({roleId:a.roleId,order:Number.isFinite(a.order)?a.order:b})):[])}}function m(){try{let a=h();if(!d.existsSync(a))return{roles:[],configs:[]};let b=JSON.parse(d.readFileSync(a,"utf-8"));if(Array.isArray(b))return{roles:b.map(k),configs:[]};return{roles:Array.isArray(b.roles)?b.roles.map(k):[],configs:Array.isArray(b.configs)?b.configs.map(l):[]}}catch{return{roles:[],configs:[]}}}function n(a){d.writeFileSync(h(),JSON.stringify({roles:a.roles.map(k),configs:a.configs.map(l)},null,2),"utf-8")}function o(){return(0,g.V)().roles.map(a=>k({...a,builtIn:!0}))}function p(){return(0,g.V)().roleConfigs.map(a=>l({...a,builtIn:!0}))}function q(a){let b=o(),c=m().roles.filter(a=>!b.some(b=>b.id===a.id&&b.type===a.type)),d=[...b,...c];return a?d.filter(b=>b.type===a):d}function r(a){let b=k(a),c=m();return c.roles=c.roles.filter(a=>a.id!==b.id||a.type!==b.type),c.roles.push(b),n(c),b}function s(a,b){if(o().some(c=>c.id===b&&c.type===a))throw Error("Configured role cannot be deleted");let c=m();c.roles=c.roles.filter(c=>c.id!==b||c.type!==a),c.configs=c.configs.map(a=>({...a,fileRoles:a.fileRoles.filter(a=>a.roleId!==b),promptRoles:a.promptRoles.filter(a=>a.roleId!==b)})),n(c)}function t(){let a=p(),b=m().configs.filter(b=>!a.some(a=>a.id===b.id));return[...a,...b]}function u(a){return t().find(b=>b.id===a)}function v(a){let b={...l(a),builtIn:!1},c=m();return c.configs=c.configs.filter(a=>a.id!==b.id),c.configs.push(b),n(c),b}function w(a){if(p().some(b=>b.id===a))throw Error("Configured role config cannot be deleted");let b=m();b.configs=b.configs.filter(b=>b.id!==a),n(b)}function x(a,b){let c=i(a);if(!b.has(c))return b.add(c),c;do c=i(`${a}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`);while(b.has(c));return b.add(c),c}function y(a=[],b){return a.map((a,c)=>({roleId:b.get(a.roleId)||a.roleId,order:Number.isFinite(a.order)?a.order:c}))}function z(a){let b=a?.roleIds?new Set(a.roleIds):null,c=a?.configIds?new Set(a.configIds):null,d=m();return{type:"customize-agent.documentRoles",version:1,exportedAt:new Date().toISOString(),roles:d.roles.filter(a=>!b||b.has(a.id)).map(k),configs:d.configs.filter(a=>!c||c.has(a.id)).map(l)}}function A(a){let b=a&&"object"==typeof a?a:{},c=Array.isArray(b.roles)?b.roles:[],d=Array.isArray(b.configs)?b.configs:[];if(0===c.length&&0===d.length)throw Error("没有可导入的角色配置");let e=m(),f=new Set([...o().map(a=>a.id),...e.roles.map(a=>a.id)]),g=new Set([...p().map(a=>a.id),...e.configs.map(a=>a.id)]),h=new Map,i=[];for(let a of c){let b=k(a),c=x(b.id,f);h.set(b.id,c),i.push({...b,id:c,builtIn:!1})}let j=new Set([...o().map(a=>a.id),...e.roles.map(a=>a.id),...i.map(a=>a.id)]),q=d.map(a=>{let b=l(a),c=x(b.id,g);return l({...b,id:c,builtIn:!1,fileRoles:y(b.fileRoles,h).filter(a=>j.has(a.roleId)),promptRoles:y(b.promptRoles,h).filter(a=>j.has(a.roleId))})});return e.roles.push(...i),e.configs.push(...q),n(e),{importedRoles:i.length,importedConfigs:q.length}}},99842:(a,b,c)=>{c.d(b,{E:()=>t,Hh:()=>n,PH:()=>u,dg:()=>l,h0:()=>p,i3:()=>o,jk:()=>q,p:()=>s,pJ:()=>m});var d=c(87550),e=c.n(d),f=c(33873),g=c(21820),h=c(29021);let i={project_fact:"项目知识",user_preference:"用户偏好",feedback:"历史纠偏",pattern:"解决方案"};function j(){let a=f.join(g.homedir(),".customize-agent","memory.db");return h.existsSync(a)?new(e())(a,{readonly:!0}):null}function k(a){let b=Number(a.access_count??0);return{id:String(a.id),title:String(a.content||"").slice(0,80),content:String(a.content||""),type:String(a.type||"project_fact"),importance:b>=5?"high":b>=2?"medium":"low",tags:[i[String(a.type)]||String(a.type)],source:String(a.context||"").slice(0,100),created_at:new Date(String(a.created_at)).getTime(),updated_at:new Date(String(a.updated_at)).getTime()}}function l(a){let b=j();if(!b)return[];try{let c="SELECT * FROM memories WHERE access_count >= 2",d=[];return a&&(c+=" AND (content LIKE ? OR context LIKE ?)",d.push(`%${a}%`,`%${a}%`)),c+=" ORDER BY access_count DESC, updated_at DESC LIMIT 200",b.prepare(c).all(...d).map(k)}finally{b.close()}}function m(a){let b=j();if(!b)return[];try{let c="SELECT * FROM memories WHERE access_count < 2",d=[];return a&&(c+=" AND (content LIKE ? OR context LIKE ?)",d.push(`%${a}%`,`%${a}%`)),c+=" ORDER BY updated_at DESC LIMIT 200",b.prepare(c).all(...d).map(k)}finally{b.close()}}function n(a,b=8,c){let d=j();if(!d)return[];try{let e=a.split(/[\s,,。;;::、/\\|]+/u).map(a=>a.trim()).filter(a=>a.length>=2).slice(0,8),g=c?`%Project: ${f.resolve(c)}%`:void 0;if(0===e.length)return(g?d.prepare("SELECT * FROM memories WHERE context LIKE ? ORDER BY access_count DESC, updated_at DESC LIMIT ?").all(g,b):d.prepare("SELECT * FROM memories ORDER BY access_count DESC, updated_at DESC LIMIT ?").all(b)).map(k);let h=e.map(()=>"(content LIKE ? OR context LIKE ?)").join(" OR "),i=e.flatMap(a=>[`%${a}%`,`%${a}%`]);return(g?d.prepare(`
78
78
  SELECT * FROM memories
79
79
  WHERE context LIKE ? AND (${h})
80
80
  ORDER BY access_count DESC, updated_at DESC
@@ -1 +1 @@
1
- globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:[],rootMainFiles:[],rootMainFilesTree:{},pages:{"/":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/694-2d545cfbb9779f2c.js","static/chunks/795-d8fb7a0420512701.js","static/chunks/pages/index-a2a24e9602e7ea52.js"],"/_app":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/css/38dba0a7a42a8df3.css","static/chunks/pages/_app-2df1181f6609ae11.js"],"/_error":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/pages/_error-282257fbdcc167b4.js"],"/asset-library":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/150-134099bf526e9292.js","static/chunks/749-83476f9bcd014a5a.js","static/chunks/pages/asset-library-e9ddfe1cbaac42d9.js"],"/context/long-term":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/150-134099bf526e9292.js","static/chunks/289-30e7c55f49a896b7.js","static/chunks/455-97ad88d6604f54b7.js","static/chunks/932-2f195f4200ce9378.js","static/chunks/pages/context/long-term-6b9a9683a4d6ea86.js"],"/context/short-term":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/150-134099bf526e9292.js","static/chunks/289-30e7c55f49a896b7.js","static/chunks/455-97ad88d6604f54b7.js","static/chunks/932-2f195f4200ce9378.js","static/chunks/pages/context/short-term-6078efae6e3a905c.js"],"/document-roles":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/455-97ad88d6604f54b7.js","static/chunks/909-27ada1f00a52e11d.js","static/chunks/pages/document-roles-24e4ba16d654959d.js"],"/documents":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/455-97ad88d6604f54b7.js","static/chunks/506-93f730bc149d0dce.js","static/chunks/412-b9c854c6a76db67d.js","static/chunks/53-d534407b1397d66a.js","static/chunks/pages/documents-fc1a4fdb681f49a2.js"],"/guide":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/412-b9c854c6a76db67d.js","static/chunks/20-00147a779147a5a4.js","static/chunks/pages/guide-7d15d3d3ddb0205e.js"],"/knowledge":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/pages/knowledge-905248d8dcb15453.js"],"/knowledge/file-detail":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/150-134099bf526e9292.js","static/chunks/289-30e7c55f49a896b7.js","static/chunks/506-93f730bc149d0dce.js","static/chunks/861-91cbdd34b8e23151.js","static/css/09be1fdeab8595ab.css","static/chunks/pages/knowledge/file-detail-97c77dfaf472a4b6.js"],"/knowledge/files":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/150-134099bf526e9292.js","static/chunks/289-30e7c55f49a896b7.js","static/css/09be1fdeab8595ab.css","static/chunks/pages/knowledge/files-75a33100a1b3b5b5.js"],"/knowledge/manage":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/506-93f730bc149d0dce.js","static/chunks/788-7f7359a830e3f4fd.js","static/chunks/pages/knowledge/manage-25eb1a993b155450.js"],"/knowledge/search":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/506-93f730bc149d0dce.js","static/chunks/938-45efd516bb130bd5.js","static/css/09be1fdeab8595ab.css","static/chunks/pages/knowledge/search-afb423fc22eb623b.js"],"/models":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/455-97ad88d6604f54b7.js","static/chunks/938-45efd516bb130bd5.js","static/chunks/647-d5e08fda405f7059.js","static/chunks/pages/models-d5e80645dc4a61b1.js"],"/overview":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/694-2d545cfbb9779f2c.js","static/chunks/795-d8fb7a0420512701.js","static/chunks/pages/overview-1260176045ed5f7a.js"],"/prompt":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/525-5d947137d894f5fe.js","static/chunks/pages/prompt-3468fb841f4c5c8c.js"],"/settings":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/pages/settings-fa9d6a56898ba678.js"],"/system/logs":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/150-134099bf526e9292.js","static/chunks/289-30e7c55f49a896b7.js","static/chunks/861-91cbdd34b8e23151.js","static/chunks/pages/system/logs-3826fa44a76b12fc.js"]},ampFirstPages:[]},globalThis.__BUILD_MANIFEST.lowPriorityFiles=["/static/"+process.env.__NEXT_BUILD_ID+"/_buildManifest.js",,"/static/"+process.env.__NEXT_BUILD_ID+"/_ssgManifest.js"];
1
+ globalThis.__BUILD_MANIFEST={polyfillFiles:["static/chunks/polyfills-42372ed130431b0a.js"],devFiles:[],ampDevFiles:[],lowPriorityFiles:[],rootMainFiles:[],rootMainFilesTree:{},pages:{"/":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/694-2d545cfbb9779f2c.js","static/chunks/795-d8fb7a0420512701.js","static/chunks/pages/index-a2a24e9602e7ea52.js"],"/_app":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/css/38dba0a7a42a8df3.css","static/chunks/pages/_app-2df1181f6609ae11.js"],"/_error":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/pages/_error-282257fbdcc167b4.js"],"/asset-library":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/150-134099bf526e9292.js","static/chunks/749-83476f9bcd014a5a.js","static/chunks/pages/asset-library-e9ddfe1cbaac42d9.js"],"/context/long-term":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/150-134099bf526e9292.js","static/chunks/289-30e7c55f49a896b7.js","static/chunks/455-97ad88d6604f54b7.js","static/chunks/932-2f195f4200ce9378.js","static/chunks/pages/context/long-term-6b9a9683a4d6ea86.js"],"/context/short-term":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/150-134099bf526e9292.js","static/chunks/289-30e7c55f49a896b7.js","static/chunks/455-97ad88d6604f54b7.js","static/chunks/932-2f195f4200ce9378.js","static/chunks/pages/context/short-term-6078efae6e3a905c.js"],"/document-roles":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/455-97ad88d6604f54b7.js","static/chunks/496-4fb9a063790e65ff.js","static/chunks/pages/document-roles-cb222be93cfd561d.js"],"/documents":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/455-97ad88d6604f54b7.js","static/chunks/506-93f730bc149d0dce.js","static/chunks/412-b9c854c6a76db67d.js","static/chunks/53-d534407b1397d66a.js","static/chunks/pages/documents-fc1a4fdb681f49a2.js"],"/guide":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/412-b9c854c6a76db67d.js","static/chunks/20-00147a779147a5a4.js","static/chunks/pages/guide-7d15d3d3ddb0205e.js"],"/knowledge":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/pages/knowledge-905248d8dcb15453.js"],"/knowledge/file-detail":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/150-134099bf526e9292.js","static/chunks/289-30e7c55f49a896b7.js","static/chunks/506-93f730bc149d0dce.js","static/chunks/861-91cbdd34b8e23151.js","static/css/09be1fdeab8595ab.css","static/chunks/pages/knowledge/file-detail-97c77dfaf472a4b6.js"],"/knowledge/files":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/150-134099bf526e9292.js","static/chunks/289-30e7c55f49a896b7.js","static/css/09be1fdeab8595ab.css","static/chunks/pages/knowledge/files-75a33100a1b3b5b5.js"],"/knowledge/manage":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/506-93f730bc149d0dce.js","static/chunks/788-7f7359a830e3f4fd.js","static/chunks/pages/knowledge/manage-25eb1a993b155450.js"],"/knowledge/search":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/506-93f730bc149d0dce.js","static/chunks/938-45efd516bb130bd5.js","static/css/09be1fdeab8595ab.css","static/chunks/pages/knowledge/search-afb423fc22eb623b.js"],"/models":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/455-97ad88d6604f54b7.js","static/chunks/938-45efd516bb130bd5.js","static/chunks/647-d5e08fda405f7059.js","static/chunks/pages/models-d5e80645dc4a61b1.js"],"/overview":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/694-2d545cfbb9779f2c.js","static/chunks/795-d8fb7a0420512701.js","static/chunks/pages/overview-1260176045ed5f7a.js"],"/prompt":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/525-5d947137d894f5fe.js","static/chunks/pages/prompt-9b869fbe3463020d.js"],"/settings":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/787-c18af810af3433f6.js","static/chunks/pages/settings-fa9d6a56898ba678.js"],"/system/logs":["static/chunks/webpack-77d10b4726f13aa5.js","static/chunks/framework-161be364fd69a7ce.js","static/chunks/main-91fb767ebd74c9c1.js","static/chunks/433-233659be69169c19.js","static/chunks/576-6699fed6c88502fe.js","static/chunks/195-2c0168eacab722d2.js","static/chunks/985-4b4a3ed36ada16eb.js","static/chunks/150-134099bf526e9292.js","static/chunks/289-30e7c55f49a896b7.js","static/chunks/861-91cbdd34b8e23151.js","static/chunks/pages/system/logs-3826fa44a76b12fc.js"]},ampFirstPages:[]},globalThis.__BUILD_MANIFEST.lowPriorityFiles=["/static/"+process.env.__NEXT_BUILD_ID+"/_buildManifest.js",,"/static/"+process.env.__NEXT_BUILD_ID+"/_ssgManifest.js"];
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" data-next-head=""/><title data-next-head="">404: This page could not be found</title><link rel="preload" href="/_next/static/css/38dba0a7a42a8df3.css" as="style"/><link rel="stylesheet" href="/_next/static/css/38dba0a7a42a8df3.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-77d10b4726f13aa5.js" defer=""></script><script src="/_next/static/chunks/framework-161be364fd69a7ce.js" defer=""></script><script src="/_next/static/chunks/main-91fb767ebd74c9c1.js" defer=""></script><script src="/_next/static/chunks/pages/_app-2df1181f6609ae11.js" defer=""></script><script src="/_next/static/chunks/pages/_error-282257fbdcc167b4.js" defer=""></script><script src="/_next/static/M3RTsFPBW6tg_7bJE5A2X/_buildManifest.js" defer=""></script><script src="/_next/static/M3RTsFPBW6tg_7bJE5A2X/_ssgManifest.js" defer=""></script></head><body><div id="__next"><script>((e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n)}),R(n)}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n)}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y)}catch(n){}})("class","theme","system",null,["light","dark"],null,true,true)</script><div class="css-1pi45l5 ant-app css-var-_R_16_"><aside class="sidebar"><a href="/overview"><div class="sidebarLogo"><div class="sidebarLogoTitle" style="font-size:20px;font-weight:800;letter-spacing:0.5px"><span class="logoGradient">Customize Agent</span></div></div></a><button class="sidebarCollapseBtn" aria-label="收起侧边栏"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-panel-left-close"><rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M9 3v18"></path><path d="m16 15-3-3 3-3"></path></svg></button><nav class="sidebarNav"><a href="/overview"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layout-dashboard"><rect width="7" height="9" x="3" y="3" rx="1"></rect><rect width="7" height="5" x="14" y="3" rx="1"></rect><rect width="7" height="9" x="14" y="12" rx="1"></rect><rect width="7" height="5" x="3" y="16" rx="1"></rect></svg><span>总览</span></div></a><div><div class="sidebarItem sidebarParent"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-database"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M3 5V19A9 3 0 0 0 21 19V5"></path><path d="M3 12A9 3 0 0 0 21 12"></path></svg><span>知识库</span><span class="sidebarChevron"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right"><path d="m9 18 6-6-6-6"></path></svg></span></div></div><a href="/models"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cpu"><rect width="16" height="16" x="4" y="4" rx="2"></rect><rect width="6" height="6" x="9" y="9" rx="1"></rect><path d="M15 2v2"></path><path d="M15 20v2"></path><path d="M2 15h2"></path><path d="M2 9h2"></path><path d="M20 15h2"></path><path d="M20 9h2"></path><path d="M9 2v2"></path><path d="M9 20v2"></path></svg><span>模型配置</span></div></a><a href="/prompt"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg><span>提示词管理</span></div></a><a href="/document-roles"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span>角色配置</span></div></a><a href="/documents"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-files"><path d="M20 7h-3a2 2 0 0 1-2-2V2"></path><path d="M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z"></path><path d="M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8"></path></svg><span>工作流模版库</span></div></a><a href="/asset-library"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-open"><path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"></path></svg><span>生成资源</span></div></a><div><div class="sidebarItem sidebarParent"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-brain"><path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"></path><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"></path><path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"></path><path d="M17.599 6.5a3 3 0 0 0 .399-1.375"></path><path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"></path><path d="M3.477 10.896a4 4 0 0 1 .585-.396"></path><path d="M19.938 10.5a4 4 0 0 1 .585.396"></path><path d="M6 18a4 4 0 0 1-1.967-.516"></path><path d="M19.967 17.484A4 4 0 0 1 18 18"></path></svg><span>上下文工程</span><span class="sidebarChevron"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right"><path d="m9 18 6-6-6-6"></path></svg></span></div></div><a href="/system/logs"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bug"><path d="m8 2 1.88 1.88"></path><path d="M14.12 3.88 16 2"></path><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"></path><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"></path><path d="M12 20v-9"></path><path d="M6.53 9C4.6 8.8 3 7.1 3 5"></path><path d="M6 13H2"></path><path d="M3 21c0-2.1 1.7-3.9 3.8-4"></path><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"></path><path d="M22 13h-4"></path><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"></path></svg><span>系统日志</span></div></a><a href="/guide"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-open"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg><span>指引</span></div></a><a href="/settings"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span>设置</span></div></a></nav></aside><div class="mainContent"><header class="topbar"><div class="flex-1"></div><span class="ant-badge css-1pi45l5 css-var-_R_16_"><button type="button" class="ant-btn css-1pi45l5 css-var-_R_16_ ant-btn-default ant-btn-color-default ant-btn-variant-outlined topbarBtn"><span class="ant-btn-icon"><span role="img" aria-label="clock-circle" class="anticon anticon-clock-circle"><svg viewBox="64 64 896 896" focusable="false" data-icon="clock-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"></path></svg></span></span><span>后台任务</span></button></span><button class="topbarBtn"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg><span>深色</span></button><button class="topbarBtn"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-languages"><path d="m5 8 6 6"></path><path d="m4 14 6-6 2-3"></path><path d="M2 5h12"></path><path d="M7 2h1"></path><path d="m22 22-5-10-5 10"></path><path d="M14 18h6"></path></svg><span>English</span></button></header><main class="mainInner"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></main></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"M3RTsFPBW6tg_7bJE5A2X","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" data-next-head=""/><title data-next-head="">404: This page could not be found</title><link rel="preload" href="/_next/static/css/38dba0a7a42a8df3.css" as="style"/><link rel="stylesheet" href="/_next/static/css/38dba0a7a42a8df3.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-77d10b4726f13aa5.js" defer=""></script><script src="/_next/static/chunks/framework-161be364fd69a7ce.js" defer=""></script><script src="/_next/static/chunks/main-91fb767ebd74c9c1.js" defer=""></script><script src="/_next/static/chunks/pages/_app-2df1181f6609ae11.js" defer=""></script><script src="/_next/static/chunks/pages/_error-282257fbdcc167b4.js" defer=""></script><script src="/_next/static/trRaWc1ebFq78iuTpvU9H/_buildManifest.js" defer=""></script><script src="/_next/static/trRaWc1ebFq78iuTpvU9H/_ssgManifest.js" defer=""></script></head><body><div id="__next"><script>((e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n)}),R(n)}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n)}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y)}catch(n){}})("class","theme","system",null,["light","dark"],null,true,true)</script><div class="css-1pi45l5 ant-app css-var-_R_16_"><aside class="sidebar"><a href="/overview"><div class="sidebarLogo"><div class="sidebarLogoTitle" style="font-size:20px;font-weight:800;letter-spacing:0.5px"><span class="logoGradient">Customize Agent</span></div></div></a><button class="sidebarCollapseBtn" aria-label="收起侧边栏"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-panel-left-close"><rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M9 3v18"></path><path d="m16 15-3-3 3-3"></path></svg></button><nav class="sidebarNav"><a href="/overview"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layout-dashboard"><rect width="7" height="9" x="3" y="3" rx="1"></rect><rect width="7" height="5" x="14" y="3" rx="1"></rect><rect width="7" height="9" x="14" y="12" rx="1"></rect><rect width="7" height="5" x="3" y="16" rx="1"></rect></svg><span>总览</span></div></a><div><div class="sidebarItem sidebarParent"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-database"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M3 5V19A9 3 0 0 0 21 19V5"></path><path d="M3 12A9 3 0 0 0 21 12"></path></svg><span>知识库</span><span class="sidebarChevron"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right"><path d="m9 18 6-6-6-6"></path></svg></span></div></div><a href="/models"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cpu"><rect width="16" height="16" x="4" y="4" rx="2"></rect><rect width="6" height="6" x="9" y="9" rx="1"></rect><path d="M15 2v2"></path><path d="M15 20v2"></path><path d="M2 15h2"></path><path d="M2 9h2"></path><path d="M20 15h2"></path><path d="M20 9h2"></path><path d="M9 2v2"></path><path d="M9 20v2"></path></svg><span>模型配置</span></div></a><a href="/prompt"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg><span>提示词管理</span></div></a><a href="/document-roles"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span>角色配置</span></div></a><a href="/documents"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-files"><path d="M20 7h-3a2 2 0 0 1-2-2V2"></path><path d="M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z"></path><path d="M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8"></path></svg><span>工作流模版库</span></div></a><a href="/asset-library"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-open"><path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"></path></svg><span>生成资源</span></div></a><div><div class="sidebarItem sidebarParent"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-brain"><path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"></path><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"></path><path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"></path><path d="M17.599 6.5a3 3 0 0 0 .399-1.375"></path><path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"></path><path d="M3.477 10.896a4 4 0 0 1 .585-.396"></path><path d="M19.938 10.5a4 4 0 0 1 .585.396"></path><path d="M6 18a4 4 0 0 1-1.967-.516"></path><path d="M19.967 17.484A4 4 0 0 1 18 18"></path></svg><span>上下文工程</span><span class="sidebarChevron"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right"><path d="m9 18 6-6-6-6"></path></svg></span></div></div><a href="/system/logs"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bug"><path d="m8 2 1.88 1.88"></path><path d="M14.12 3.88 16 2"></path><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"></path><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"></path><path d="M12 20v-9"></path><path d="M6.53 9C4.6 8.8 3 7.1 3 5"></path><path d="M6 13H2"></path><path d="M3 21c0-2.1 1.7-3.9 3.8-4"></path><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"></path><path d="M22 13h-4"></path><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"></path></svg><span>系统日志</span></div></a><a href="/guide"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-open"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg><span>指引</span></div></a><a href="/settings"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span>设置</span></div></a></nav></aside><div class="mainContent"><header class="topbar"><div class="flex-1"></div><span class="ant-badge css-1pi45l5 css-var-_R_16_"><button type="button" class="ant-btn css-1pi45l5 css-var-_R_16_ ant-btn-default ant-btn-color-default ant-btn-variant-outlined topbarBtn"><span class="ant-btn-icon"><span role="img" aria-label="clock-circle" class="anticon anticon-clock-circle"><svg viewBox="64 64 896 896" focusable="false" data-icon="clock-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"></path></svg></span></span><span>后台任务</span></button></span><button class="topbarBtn"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg><span>深色</span></button><button class="topbarBtn"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-languages"><path d="m5 8 6 6"></path><path d="m4 14 6-6 2-3"></path><path d="M2 5h12"></path><path d="M7 2h1"></path><path d="m22 22-5-10-5 10"></path><path d="M14 18h6"></path></svg><span>English</span></button></header><main class="mainInner"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">This page could not be found<!-- -->.</h2></div></div></div></main></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":404}},"page":"/_error","query":{},"buildId":"trRaWc1ebFq78iuTpvU9H","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><link rel="preload" href="/_next/static/css/38dba0a7a42a8df3.css" as="style"/><link rel="stylesheet" href="/_next/static/css/38dba0a7a42a8df3.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-77d10b4726f13aa5.js" defer=""></script><script src="/_next/static/chunks/framework-161be364fd69a7ce.js" defer=""></script><script src="/_next/static/chunks/main-91fb767ebd74c9c1.js" defer=""></script><script src="/_next/static/chunks/pages/_app-2df1181f6609ae11.js" defer=""></script><script src="/_next/static/chunks/pages/_error-282257fbdcc167b4.js" defer=""></script><script src="/_next/static/M3RTsFPBW6tg_7bJE5A2X/_buildManifest.js" defer=""></script><script src="/_next/static/M3RTsFPBW6tg_7bJE5A2X/_ssgManifest.js" defer=""></script></head><body><div id="__next"><script>((e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n)}),R(n)}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n)}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y)}catch(n){}})("class","theme","system",null,["light","dark"],null,true,true)</script><div class="css-1pi45l5 ant-app css-var-_R_16_"><aside class="sidebar"><a href="/overview"><div class="sidebarLogo"><div class="sidebarLogoTitle" style="font-size:20px;font-weight:800;letter-spacing:0.5px"><span class="logoGradient">Customize Agent</span></div></div></a><button class="sidebarCollapseBtn" aria-label="收起侧边栏"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-panel-left-close"><rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M9 3v18"></path><path d="m16 15-3-3 3-3"></path></svg></button><nav class="sidebarNav"><a href="/overview"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layout-dashboard"><rect width="7" height="9" x="3" y="3" rx="1"></rect><rect width="7" height="5" x="14" y="3" rx="1"></rect><rect width="7" height="9" x="14" y="12" rx="1"></rect><rect width="7" height="5" x="3" y="16" rx="1"></rect></svg><span>总览</span></div></a><div><div class="sidebarItem sidebarParent"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-database"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M3 5V19A9 3 0 0 0 21 19V5"></path><path d="M3 12A9 3 0 0 0 21 12"></path></svg><span>知识库</span><span class="sidebarChevron"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right"><path d="m9 18 6-6-6-6"></path></svg></span></div></div><a href="/models"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cpu"><rect width="16" height="16" x="4" y="4" rx="2"></rect><rect width="6" height="6" x="9" y="9" rx="1"></rect><path d="M15 2v2"></path><path d="M15 20v2"></path><path d="M2 15h2"></path><path d="M2 9h2"></path><path d="M20 15h2"></path><path d="M20 9h2"></path><path d="M9 2v2"></path><path d="M9 20v2"></path></svg><span>模型配置</span></div></a><a href="/prompt"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg><span>提示词管理</span></div></a><a href="/document-roles"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span>角色配置</span></div></a><a href="/documents"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-files"><path d="M20 7h-3a2 2 0 0 1-2-2V2"></path><path d="M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z"></path><path d="M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8"></path></svg><span>工作流模版库</span></div></a><a href="/asset-library"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-open"><path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"></path></svg><span>生成资源</span></div></a><div><div class="sidebarItem sidebarParent"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-brain"><path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"></path><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"></path><path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"></path><path d="M17.599 6.5a3 3 0 0 0 .399-1.375"></path><path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"></path><path d="M3.477 10.896a4 4 0 0 1 .585-.396"></path><path d="M19.938 10.5a4 4 0 0 1 .585.396"></path><path d="M6 18a4 4 0 0 1-1.967-.516"></path><path d="M19.967 17.484A4 4 0 0 1 18 18"></path></svg><span>上下文工程</span><span class="sidebarChevron"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right"><path d="m9 18 6-6-6-6"></path></svg></span></div></div><a href="/system/logs"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bug"><path d="m8 2 1.88 1.88"></path><path d="M14.12 3.88 16 2"></path><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"></path><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"></path><path d="M12 20v-9"></path><path d="M6.53 9C4.6 8.8 3 7.1 3 5"></path><path d="M6 13H2"></path><path d="M3 21c0-2.1 1.7-3.9 3.8-4"></path><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"></path><path d="M22 13h-4"></path><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"></path></svg><span>系统日志</span></div></a><a href="/guide"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-open"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg><span>指引</span></div></a><a href="/settings"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span>设置</span></div></a></nav></aside><div class="mainContent"><header class="topbar"><div class="flex-1"></div><span class="ant-badge css-1pi45l5 css-var-_R_16_"><button type="button" class="ant-btn css-1pi45l5 css-var-_R_16_ ant-btn-default ant-btn-color-default ant-btn-variant-outlined topbarBtn"><span class="ant-btn-icon"><span role="img" aria-label="clock-circle" class="anticon anticon-clock-circle"><svg viewBox="64 64 896 896" focusable="false" data-icon="clock-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"></path></svg></span></span><span>后台任务</span></button></span><button class="topbarBtn"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg><span>深色</span></button><button class="topbarBtn"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-languages"><path d="m5 8 6 6"></path><path d="m4 14 6-6 2-3"></path><path d="M2 5h12"></path><path d="M7 2h1"></path><path d="m22 22-5-10-5 10"></path><path d="M14 18h6"></path></svg><span>English</span></button></header><main class="mainInner"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></main></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"M3RTsFPBW6tg_7bJE5A2X","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><link rel="preload" href="/_next/static/css/38dba0a7a42a8df3.css" as="style"/><link rel="stylesheet" href="/_next/static/css/38dba0a7a42a8df3.css" data-n-g=""/><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-77d10b4726f13aa5.js" defer=""></script><script src="/_next/static/chunks/framework-161be364fd69a7ce.js" defer=""></script><script src="/_next/static/chunks/main-91fb767ebd74c9c1.js" defer=""></script><script src="/_next/static/chunks/pages/_app-2df1181f6609ae11.js" defer=""></script><script src="/_next/static/chunks/pages/_error-282257fbdcc167b4.js" defer=""></script><script src="/_next/static/trRaWc1ebFq78iuTpvU9H/_buildManifest.js" defer=""></script><script src="/_next/static/trRaWc1ebFq78iuTpvU9H/_ssgManifest.js" defer=""></script></head><body><div id="__next"><script>((e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n)}),R(n)}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n)}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y)}catch(n){}})("class","theme","system",null,["light","dark"],null,true,true)</script><div class="css-1pi45l5 ant-app css-var-_R_16_"><aside class="sidebar"><a href="/overview"><div class="sidebarLogo"><div class="sidebarLogoTitle" style="font-size:20px;font-weight:800;letter-spacing:0.5px"><span class="logoGradient">Customize Agent</span></div></div></a><button class="sidebarCollapseBtn" aria-label="收起侧边栏"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-panel-left-close"><rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M9 3v18"></path><path d="m16 15-3-3 3-3"></path></svg></button><nav class="sidebarNav"><a href="/overview"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layout-dashboard"><rect width="7" height="9" x="3" y="3" rx="1"></rect><rect width="7" height="5" x="14" y="3" rx="1"></rect><rect width="7" height="9" x="14" y="12" rx="1"></rect><rect width="7" height="5" x="3" y="16" rx="1"></rect></svg><span>总览</span></div></a><div><div class="sidebarItem sidebarParent"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-database"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M3 5V19A9 3 0 0 0 21 19V5"></path><path d="M3 12A9 3 0 0 0 21 12"></path></svg><span>知识库</span><span class="sidebarChevron"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right"><path d="m9 18 6-6-6-6"></path></svg></span></div></div><a href="/models"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cpu"><rect width="16" height="16" x="4" y="4" rx="2"></rect><rect width="6" height="6" x="9" y="9" rx="1"></rect><path d="M15 2v2"></path><path d="M15 20v2"></path><path d="M2 15h2"></path><path d="M2 9h2"></path><path d="M20 15h2"></path><path d="M20 9h2"></path><path d="M9 2v2"></path><path d="M9 20v2"></path></svg><span>模型配置</span></div></a><a href="/prompt"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"></path></svg><span>提示词管理</span></div></a><a href="/document-roles"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span>角色配置</span></div></a><a href="/documents"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-files"><path d="M20 7h-3a2 2 0 0 1-2-2V2"></path><path d="M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z"></path><path d="M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8"></path></svg><span>工作流模版库</span></div></a><a href="/asset-library"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-open"><path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"></path></svg><span>生成资源</span></div></a><div><div class="sidebarItem sidebarParent"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-brain"><path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"></path><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"></path><path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"></path><path d="M17.599 6.5a3 3 0 0 0 .399-1.375"></path><path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"></path><path d="M3.477 10.896a4 4 0 0 1 .585-.396"></path><path d="M19.938 10.5a4 4 0 0 1 .585.396"></path><path d="M6 18a4 4 0 0 1-1.967-.516"></path><path d="M19.967 17.484A4 4 0 0 1 18 18"></path></svg><span>上下文工程</span><span class="sidebarChevron"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-right"><path d="m9 18 6-6-6-6"></path></svg></span></div></div><a href="/system/logs"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bug"><path d="m8 2 1.88 1.88"></path><path d="M14.12 3.88 16 2"></path><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"></path><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"></path><path d="M12 20v-9"></path><path d="M6.53 9C4.6 8.8 3 7.1 3 5"></path><path d="M6 13H2"></path><path d="M3 21c0-2.1 1.7-3.9 3.8-4"></path><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"></path><path d="M22 13h-4"></path><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4"></path></svg><span>系统日志</span></div></a><a href="/guide"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-open"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"></path><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"></path></svg><span>指引</span></div></a><a href="/settings"><div class="sidebarItem"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span>设置</span></div></a></nav></aside><div class="mainContent"><header class="topbar"><div class="flex-1"></div><span class="ant-badge css-1pi45l5 css-var-_R_16_"><button type="button" class="ant-btn css-1pi45l5 css-var-_R_16_ ant-btn-default ant-btn-color-default ant-btn-variant-outlined topbarBtn"><span class="ant-btn-icon"><span role="img" aria-label="clock-circle" class="anticon anticon-clock-circle"><svg viewBox="64 64 896 896" focusable="false" data-icon="clock-circle" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"></path><path d="M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"></path></svg></span></span><span>后台任务</span></button></span><button class="topbarBtn"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg><span>深色</span></button><button class="topbarBtn"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-languages"><path d="m5 8 6 6"></path><path d="m4 14 6-6 2-3"></path><path d="M2 5h12"></path><path d="M7 2h1"></path><path d="m22 22-5-10-5 10"></path><path d="M14 18h6"></path></svg><span>English</span></button></header><main class="mainInner"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></main></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"trRaWc1ebFq78iuTpvU9H","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=9029,a.ids=[9029],a.modules={48161:a=>{a.exports=require("node:os")},55258:(a,b,c)=>{c.r(b),c.d(b,{config:()=>o,default:()=>n,handler:()=>q});var d={};c.r(d),c.d(d,{default:()=>k});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(89952);function j(a){return"file"===a||"prompt"===a?a:void 0}function k(a,b){try{if("GET"===a.method)return b.status(200).json({roles:(0,i.XB)(j(a.query.type)),configs:(0,i.DZ)()});if("POST"===a.method||"PUT"===a.method){let c="config"===a.query.mode?"config":"role";if("config"===c){let c=a.body;if(!c?.id||!c.name)return b.status(400).json({error:"config id and name required"});return b.status(200).json({config:(0,i.NR)(c),roles:(0,i.XB)(),configs:(0,i.DZ)()})}let d=a.body;if(!d?.id||!d.name||!j(d.type))return b.status(400).json({error:"role id, name and type required"});return b.status(200).json({role:(0,i.dg)(d),roles:(0,i.XB)(),configs:(0,i.DZ)()})}if("DELETE"===a.method){let c="config"===a.query.mode?"config":"role",d=String(a.query.id||"");if(!d)return b.status(400).json({error:"id required"});if("config"===c)return(0,i.dw)(d),b.status(200).json({success:!0,roles:(0,i.XB)(),configs:(0,i.DZ)()});let e=j(a.query.type);if(!e)return b.status(400).json({error:"type required"});return(0,i.FV)(e,d),b.status(200).json({success:!0,roles:(0,i.XB)(),configs:(0,i.DZ)()})}return b.status(405).json({error:"Method not allowed"})}catch(a){console.error("[api] documents/roles",a),b.status(500).json({error:a instanceof Error?a.message:"Internal server error"})}}var l=c(68970),m=c(50296);let n=(0,h.M)(d,"default"),o=(0,h.M)(d,"config"),p=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/documents/roles",pathname:"/api/documents/roles",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function q(a,b,c){let d=await p.prepare(a,b,{srcPage:"/api/documents/roles"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,l.getTracer)(),e=d.getActiveScopeSpan(),j=p.instrumentationOnRequestError.bind(p),k=async e=>p.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:p.isDev,page:"/api/documents/roles",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(m.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:l.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(p.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},73024:a=>{a.exports=require("node:fs")},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},76760:a=>{a.exports=require("node:path")},79181:(a,b,c)=>{c.d(b,{V:()=>h});var d=c(73024),e=c(48161),f=c(76760);let g={reviewStandardQueries:[],reviewChapterTemplateMatchers:[],reviewChapterSectionDefaults:{firstChapterSections:[],chapterSections:[],firstChapterTableSections:[],firstChapterTableRequirements:[]},templates:[],roles:[],roleConfigs:[],qualityBenchmarks:[],autoSpecGates:[],chapterTitleFilters:[]};function h(){try{var a;let b=function(){let a=f.join(e.homedir(),".customize-agent");return d.mkdirSync(a,{recursive:!0}),f.join(a,"engineering-document-config.json")}();if(!d.existsSync(b))return g;return a=JSON.parse(d.readFileSync(b,"utf-8")),{reviewStandardQueries:Array.isArray(a.reviewStandardQueries)?a.reviewStandardQueries.filter(Boolean):[],reviewChapterTemplateMatchers:Array.isArray(a.reviewChapterTemplateMatchers)?a.reviewChapterTemplateMatchers.filter(Boolean):[],reviewChapterSectionDefaults:{firstChapterSections:Array.isArray(a.reviewChapterSectionDefaults?.firstChapterSections)?a.reviewChapterSectionDefaults.firstChapterSections.filter(Boolean):[],chapterSections:Array.isArray(a.reviewChapterSectionDefaults?.chapterSections)?a.reviewChapterSectionDefaults.chapterSections.filter(Boolean):[],firstChapterTableSections:Array.isArray(a.reviewChapterSectionDefaults?.firstChapterTableSections)?a.reviewChapterSectionDefaults.firstChapterTableSections.filter(Boolean):[],firstChapterTableRequirements:Array.isArray(a.reviewChapterSectionDefaults?.firstChapterTableRequirements)?a.reviewChapterSectionDefaults.firstChapterTableRequirements.filter(Boolean):[]},templates:Array.isArray(a.templates)?a.templates:[],roles:Array.isArray(a.roles)?a.roles:[],roleConfigs:Array.isArray(a.roleConfigs)?a.roleConfigs:[],qualityBenchmarks:Array.isArray(a.qualityBenchmarks)?a.qualityBenchmarks:[],technicalDetailGate:a.technicalDetailGate,autoSpecGates:Array.isArray(a.autoSpecGates)?a.autoSpecGates:[],chapterTitleFilters:Array.isArray(a.chapterTitleFilters)?a.chapterTitleFilters:[]}}catch{return g}}},89952:(a,b,c)=>{c.d(b,{DZ:()=>t,FV:()=>s,Mu:()=>u,NR:()=>v,XB:()=>q,dg:()=>r,dw:()=>w});var d=c(73024),e=c(48161),f=c(76760),g=c(79181);function h(){let a=f.join(e.homedir(),".customize-agent");return d.mkdirSync(a,{recursive:!0}),f.join(a,"document-roles.json")}function i(a){return(a||`item-${Date.now()}`).replace(/[^a-zA-Z0-9_-]/gu,"-").slice(0,80)}function j(a=[]){let b=new Set;return a.filter(a=>!(!a.roleId||b.has(a.roleId))&&(b.add(a.roleId),!0))}function k(a){var b,c;let d="prompt"===a.type?"prompt":"file";return{id:i(a.id),name:a.name||"未命名角色",description:a.description||"",type:d,builtIn:!!a.builtIn,resourceId:a.resourceId||a.resourceIds?.[0]||void 0,resourceIds:function(a=[]){return[...new Set(a.filter(Boolean))]}(Array.isArray(a.resourceIds)&&a.resourceIds.length>0?a.resourceIds:a.resourceId?[a.resourceId]:[]),executionType:"prompt"===d?"fact_extraction"===(b=a.executionType)||"chapter_generation"===b||"llm_review"===b||"validation"===b||"formatting"===b||"reference"===b?b:"reference":void 0,processingType:"file"===d?"rule"===(c=a.processingType)||"project_fact"===c||"table"===c||"drawing"===c||"specification"===c||"reference"===c?c:"reference":void 0}}function l(a){return{id:i(a.id),name:a.name||"未命名配置",description:a.description||"",builtIn:!!a.builtIn,fileRoles:j(Array.isArray(a.fileRoles)?a.fileRoles.filter(a=>a.roleId).map((a,b)=>({roleId:a.roleId,order:Number.isFinite(a.order)?a.order:b})):[]),promptRoles:j(Array.isArray(a.promptRoles)?a.promptRoles.filter(a=>a.roleId).map((a,b)=>({roleId:a.roleId,order:Number.isFinite(a.order)?a.order:b})):[])}}function m(){try{let a=h();if(!d.existsSync(a))return{roles:[],configs:[]};let b=JSON.parse(d.readFileSync(a,"utf-8"));if(Array.isArray(b))return{roles:b.map(k),configs:[]};return{roles:Array.isArray(b.roles)?b.roles.map(k):[],configs:Array.isArray(b.configs)?b.configs.map(l):[]}}catch{return{roles:[],configs:[]}}}function n(a){d.writeFileSync(h(),JSON.stringify({roles:a.roles.map(k),configs:a.configs.map(l)},null,2),"utf-8")}function o(){return(0,g.V)().roles.map(a=>k({...a,builtIn:!0}))}function p(){return(0,g.V)().roleConfigs.map(a=>l({...a,builtIn:!0}))}function q(a){let b=o(),c=m().roles.filter(a=>!b.some(b=>b.id===a.id&&b.type===a.type)),d=[...b,...c];return a?d.filter(b=>b.type===a):d}function r(a){let b=k(a),c=m();return c.roles=c.roles.filter(a=>a.id!==b.id||a.type!==b.type),c.roles.push(b),n(c),b}function s(a,b){if(o().some(c=>c.id===b&&c.type===a))throw Error("Configured role cannot be deleted");let c=m();c.roles=c.roles.filter(c=>c.id!==b||c.type!==a),c.configs=c.configs.map(a=>({...a,fileRoles:a.fileRoles.filter(a=>a.roleId!==b),promptRoles:a.promptRoles.filter(a=>a.roleId!==b)})),n(c)}function t(){let a=p(),b=m().configs.filter(b=>!a.some(a=>a.id===b.id));return[...a,...b]}function u(a){return t().find(b=>b.id===a)}function v(a){let b={...l(a),builtIn:!1},c=m();return c.configs=c.configs.filter(a=>a.id!==b.id),c.configs.push(b),n(c),b}function w(a){if(p().some(b=>b.id===a))throw Error("Configured role config cannot be deleted");let b=m();b.configs=b.configs.filter(b=>b.id!==a),n(b)}}};var b=require("../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=55258));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=9029,a.ids=[9029],a.modules={48161:a=>{a.exports=require("node:os")},55258:(a,b,c)=>{c.r(b),c.d(b,{config:()=>o,default:()=>n,handler:()=>q});var d={};c.r(d),c.d(d,{default:()=>k});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(89952);function j(a){return"file"===a||"prompt"===a?a:void 0}function k(a,b){try{if("GET"===a.method){if("export"===a.query.mode){let c="string"==typeof a.query.roleIds&&a.query.roleIds?a.query.roleIds.split(","):void 0,d="string"==typeof a.query.configIds&&a.query.configIds?a.query.configIds.split(","):void 0;return b.status(200).json((0,i.tl)({roleIds:c,configIds:d}))}return b.status(200).json({roles:(0,i.XB)(j(a.query.type)),configs:(0,i.DZ)()})}if("POST"===a.method||"PUT"===a.method){let c="import"===a.query.mode?"import":"config"===a.query.mode?"config":"role";if("import"===c){let c=(0,i.ov)(a.body);return b.status(200).json({success:!0,...c,roles:(0,i.XB)(),configs:(0,i.DZ)()})}if("config"===c){let c=a.body;if(!c?.id||!c.name)return b.status(400).json({error:"config id and name required"});return b.status(200).json({config:(0,i.NR)(c),roles:(0,i.XB)(),configs:(0,i.DZ)()})}let d=a.body;if(!d?.id||!d.name||!j(d.type))return b.status(400).json({error:"role id, name and type required"});return b.status(200).json({role:(0,i.dg)(d),roles:(0,i.XB)(),configs:(0,i.DZ)()})}if("DELETE"===a.method){let c="config"===a.query.mode?"config":"role",d=String(a.query.id||"");if(!d)return b.status(400).json({error:"id required"});if("config"===c)return(0,i.dw)(d),b.status(200).json({success:!0,roles:(0,i.XB)(),configs:(0,i.DZ)()});let e=j(a.query.type);if(!e)return b.status(400).json({error:"type required"});return(0,i.FV)(e,d),b.status(200).json({success:!0,roles:(0,i.XB)(),configs:(0,i.DZ)()})}return b.status(405).json({error:"Method not allowed"})}catch(a){console.error("[api] documents/roles",a),b.status(500).json({error:a instanceof Error?a.message:"Internal server error"})}}var l=c(68970),m=c(50296);let n=(0,h.M)(d,"default"),o=(0,h.M)(d,"config"),p=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/documents/roles",pathname:"/api/documents/roles",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function q(a,b,c){let d=await p.prepare(a,b,{srcPage:"/api/documents/roles"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,l.getTracer)(),e=d.getActiveScopeSpan(),j=p.instrumentationOnRequestError.bind(p),k=async e=>p.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:p.isDev,page:"/api/documents/roles",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(m.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:l.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(p.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},73024:a=>{a.exports=require("node:fs")},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},76760:a=>{a.exports=require("node:path")},79181:(a,b,c)=>{c.d(b,{V:()=>h});var d=c(73024),e=c(48161),f=c(76760);let g={reviewStandardQueries:[],reviewChapterTemplateMatchers:[],reviewChapterSectionDefaults:{firstChapterSections:[],chapterSections:[],firstChapterTableSections:[],firstChapterTableRequirements:[]},templates:[],roles:[],roleConfigs:[],qualityBenchmarks:[],autoSpecGates:[],chapterTitleFilters:[]};function h(){try{var a;let b=function(){let a=f.join(e.homedir(),".customize-agent");return d.mkdirSync(a,{recursive:!0}),f.join(a,"engineering-document-config.json")}();if(!d.existsSync(b))return g;return a=JSON.parse(d.readFileSync(b,"utf-8")),{reviewStandardQueries:Array.isArray(a.reviewStandardQueries)?a.reviewStandardQueries.filter(Boolean):[],reviewChapterTemplateMatchers:Array.isArray(a.reviewChapterTemplateMatchers)?a.reviewChapterTemplateMatchers.filter(Boolean):[],reviewChapterSectionDefaults:{firstChapterSections:Array.isArray(a.reviewChapterSectionDefaults?.firstChapterSections)?a.reviewChapterSectionDefaults.firstChapterSections.filter(Boolean):[],chapterSections:Array.isArray(a.reviewChapterSectionDefaults?.chapterSections)?a.reviewChapterSectionDefaults.chapterSections.filter(Boolean):[],firstChapterTableSections:Array.isArray(a.reviewChapterSectionDefaults?.firstChapterTableSections)?a.reviewChapterSectionDefaults.firstChapterTableSections.filter(Boolean):[],firstChapterTableRequirements:Array.isArray(a.reviewChapterSectionDefaults?.firstChapterTableRequirements)?a.reviewChapterSectionDefaults.firstChapterTableRequirements.filter(Boolean):[]},templates:Array.isArray(a.templates)?a.templates:[],roles:Array.isArray(a.roles)?a.roles:[],roleConfigs:Array.isArray(a.roleConfigs)?a.roleConfigs:[],qualityBenchmarks:Array.isArray(a.qualityBenchmarks)?a.qualityBenchmarks:[],technicalDetailGate:a.technicalDetailGate,autoSpecGates:Array.isArray(a.autoSpecGates)?a.autoSpecGates:[],chapterTitleFilters:Array.isArray(a.chapterTitleFilters)?a.chapterTitleFilters:[]}}catch{return g}}},89952:(a,b,c)=>{c.d(b,{DZ:()=>t,FV:()=>s,Mu:()=>u,NR:()=>v,XB:()=>q,dg:()=>r,dw:()=>w,ov:()=>A,tl:()=>z});var d=c(73024),e=c(48161),f=c(76760),g=c(79181);function h(){let a=f.join(e.homedir(),".customize-agent");return d.mkdirSync(a,{recursive:!0}),f.join(a,"document-roles.json")}function i(a){return(a||`item-${Date.now()}`).replace(/[^a-zA-Z0-9_-]/gu,"-").slice(0,80)}function j(a=[]){let b=new Set;return a.filter(a=>!(!a.roleId||b.has(a.roleId))&&(b.add(a.roleId),!0))}function k(a){var b,c;let d="prompt"===a.type?"prompt":"file";return{id:i(a.id),name:a.name||"未命名角色",description:a.description||"",type:d,builtIn:!!a.builtIn,resourceId:a.resourceId||a.resourceIds?.[0]||void 0,resourceIds:function(a=[]){return[...new Set(a.filter(Boolean))]}(Array.isArray(a.resourceIds)&&a.resourceIds.length>0?a.resourceIds:a.resourceId?[a.resourceId]:[]),executionType:"prompt"===d?"fact_extraction"===(b=a.executionType)||"chapter_generation"===b||"llm_review"===b||"validation"===b||"formatting"===b||"reference"===b?b:"reference":void 0,processingType:"file"===d?"rule"===(c=a.processingType)||"project_fact"===c||"table"===c||"drawing"===c||"specification"===c||"reference"===c?c:"reference":void 0}}function l(a){return{id:i(a.id),name:a.name||"未命名配置",description:a.description||"",builtIn:!!a.builtIn,fileRoles:j(Array.isArray(a.fileRoles)?a.fileRoles.filter(a=>a.roleId).map((a,b)=>({roleId:a.roleId,order:Number.isFinite(a.order)?a.order:b})):[]),promptRoles:j(Array.isArray(a.promptRoles)?a.promptRoles.filter(a=>a.roleId).map((a,b)=>({roleId:a.roleId,order:Number.isFinite(a.order)?a.order:b})):[])}}function m(){try{let a=h();if(!d.existsSync(a))return{roles:[],configs:[]};let b=JSON.parse(d.readFileSync(a,"utf-8"));if(Array.isArray(b))return{roles:b.map(k),configs:[]};return{roles:Array.isArray(b.roles)?b.roles.map(k):[],configs:Array.isArray(b.configs)?b.configs.map(l):[]}}catch{return{roles:[],configs:[]}}}function n(a){d.writeFileSync(h(),JSON.stringify({roles:a.roles.map(k),configs:a.configs.map(l)},null,2),"utf-8")}function o(){return(0,g.V)().roles.map(a=>k({...a,builtIn:!0}))}function p(){return(0,g.V)().roleConfigs.map(a=>l({...a,builtIn:!0}))}function q(a){let b=o(),c=m().roles.filter(a=>!b.some(b=>b.id===a.id&&b.type===a.type)),d=[...b,...c];return a?d.filter(b=>b.type===a):d}function r(a){let b=k(a),c=m();return c.roles=c.roles.filter(a=>a.id!==b.id||a.type!==b.type),c.roles.push(b),n(c),b}function s(a,b){if(o().some(c=>c.id===b&&c.type===a))throw Error("Configured role cannot be deleted");let c=m();c.roles=c.roles.filter(c=>c.id!==b||c.type!==a),c.configs=c.configs.map(a=>({...a,fileRoles:a.fileRoles.filter(a=>a.roleId!==b),promptRoles:a.promptRoles.filter(a=>a.roleId!==b)})),n(c)}function t(){let a=p(),b=m().configs.filter(b=>!a.some(a=>a.id===b.id));return[...a,...b]}function u(a){return t().find(b=>b.id===a)}function v(a){let b={...l(a),builtIn:!1},c=m();return c.configs=c.configs.filter(a=>a.id!==b.id),c.configs.push(b),n(c),b}function w(a){if(p().some(b=>b.id===a))throw Error("Configured role config cannot be deleted");let b=m();b.configs=b.configs.filter(b=>b.id!==a),n(b)}function x(a,b){let c=i(a);if(!b.has(c))return b.add(c),c;do c=i(`${a}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`);while(b.has(c));return b.add(c),c}function y(a=[],b){return a.map((a,c)=>({roleId:b.get(a.roleId)||a.roleId,order:Number.isFinite(a.order)?a.order:c}))}function z(a){let b=a?.roleIds?new Set(a.roleIds):null,c=a?.configIds?new Set(a.configIds):null,d=m();return{type:"customize-agent.documentRoles",version:1,exportedAt:new Date().toISOString(),roles:d.roles.filter(a=>!b||b.has(a.id)).map(k),configs:d.configs.filter(a=>!c||c.has(a.id)).map(l)}}function A(a){let b=a&&"object"==typeof a?a:{},c=Array.isArray(b.roles)?b.roles:[],d=Array.isArray(b.configs)?b.configs:[];if(0===c.length&&0===d.length)throw Error("没有可导入的角色配置");let e=m(),f=new Set([...o().map(a=>a.id),...e.roles.map(a=>a.id)]),g=new Set([...p().map(a=>a.id),...e.configs.map(a=>a.id)]),h=new Map,i=[];for(let a of c){let b=k(a),c=x(b.id,f);h.set(b.id,c),i.push({...b,id:c,builtIn:!1})}let j=new Set([...o().map(a=>a.id),...e.roles.map(a=>a.id),...i.map(a=>a.id)]),q=d.map(a=>{let b=l(a),c=x(b.id,g);return l({...b,id:c,builtIn:!1,fileRoles:y(b.fileRoles,h).filter(a=>j.has(a.roleId)),promptRoles:y(b.promptRoles,h).filter(a=>j.has(a.roleId))})});return e.roles.push(...i),e.configs.push(...q),n(e),{importedRoles:i.length,importedConfigs:q.length}}}};var b=require("../../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=55258));module.exports=c})();
@@ -1 +1 @@
1
- "use strict";(()=>{var a={};a.id=1289,a.ids=[1289],a.modules={21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},33873:a=>{a.exports=require("path")},52201:(a,b,c)=>{c.r(b),c.d(b,{config:()=>C,default:()=>B,handler:()=>E});var d={};c.r(d),c.d(d,{default:()=>y});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(29021),j=c(33873),k=c(21820),l=c(87550),m=c.n(l);let n=j.join(k.homedir(),".customize-agent"),o=j.join(n,"projects","registry.db"),p=j.join(n,"prompts.json");function q(a){return j.resolve(a)}function r(a){let b=q(a),c=q(j.join(k.homedir(),".customize-agent")),d=b.split(j.sep);return b!==j.resolve(j.join(k.homedir(),".customize-agent","demo-project"))&&(b===c||b.endsWith(`${j.sep}apps${j.sep}server`)||b.endsWith(`${j.sep}apps${j.sep}cli`)||d.includes(".customize-agent"))}function s(a){return i.existsSync(o)?new(m())(o,{readonly:a}):null}function t(a){let b=q(a);return"CUSTOMIZE.md"===j.basename(b)&&(function(){let a=new Set,b=q(process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD??process.cwd());r(b)||a.add(b);let c=s(!0);if(!c)return a;try{for(let b of c.prepare("SELECT project_root FROM project_registry").all()){let c=q(String(b.project_root));r(c)||a.add(c)}}finally{c.close()}return a})().has(q(j.dirname(b)))}function u(a){return`file:${q(a)}`}function v(){try{let a=JSON.parse(i.readFileSync(p,"utf-8"));return{selectedIds:Array.isArray(a.selectedIds)?a.selectedIds.map(String):[],customPrompts:Array.isArray(a.customPrompts)?a.customPrompts:[]}}catch{return{selectedIds:[],customPrompts:[]}}}function w(a){i.mkdirSync(j.dirname(p),{recursive:!0}),i.writeFileSync(p,JSON.stringify(a,null,2),"utf-8")}function x(a){return"string"==typeof a?a:""}function y(a,b){try{if("GET"===a.method){let c=[],d=[],e=q(process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD??process.cwd()),f=v(),g=u(j.join(e,"CUSTOMIZE.md")),h=i.existsSync(p)&&f.selectedIds.length>0?f.selectedIds:[g];if("export"===a.query.mode){let a=new Set(h),c={version:1,exportedAt:new Date().toISOString(),prompts:f.customPrompts.map(b=>({name:b.name,content:b.content,selected:a.has(b.id)}))};return b.setHeader("Content-Type","application/json; charset=utf-8"),b.setHeader("Content-Disposition",`attachment; filename="customize-prompts-${new Date().toISOString().slice(0,10)}.json"`),b.status(200).json(c)}let k=s(!0);if(k)try{for(let a of k.prepare("SELECT project_id, project_root, project_name FROM project_registry ORDER BY last_opened_at DESC").all()){let b=q(String(a.project_root));if(r(b)){d.push(String(a.project_id));continue}let f=j.join(b,"CUSTOMIZE.md"),g=i.existsSync(f),k=u(f);c.push({id:k,projectId:String(a.project_id),projectRoot:b,projectName:String(a.project_name||j.basename(b)||b),customizePath:f,content:g?i.readFileSync(f,"utf-8"):"",mtime:g?i.statSync(f).mtime.toISOString():"",hasFile:g,isCurrent:b===e,selected:h.includes(k),source:b===e?"current":"project"})}}finally{k.close()}let l=j.join(e,"CUSTOMIZE.md");if(!r(e)&&!c.some(a=>a.projectRoot===e)){let a=i.existsSync(l);c.unshift({id:g,projectId:"current",projectRoot:e,projectName:j.basename(e)||e,customizePath:l,content:a?i.readFileSync(l,"utf-8"):"",mtime:a?i.statSync(l).mtime.toISOString():"",hasFile:a,isCurrent:!0,selected:h.includes(g),source:"current"})}for(let a of f.customPrompts)c.push({id:a.id,projectId:a.id,projectName:a.name,customizePath:a.id,content:a.content,mtime:a.updatedAt,hasFile:!0,isCurrent:!1,selected:h.includes(a.id),source:"custom"});return!function(a){if(0===a.length)return;let b=s(!1);if(b)try{let c=b.prepare("DELETE FROM project_registry WHERE project_id = ?");for(let b of a)c.run(b)}catch(a){}finally{b.close()}}(d),b.status(200).json(c)}if("POST"===a.method){var c,d;let{action:e,projectRoot:f,content:g,name:h,selectedIds:k,prompts:l,mode:m}=a.body,n=v();if("import"===e||"import"===m){let e=(c=l??a.body,(Array.isArray(c)?c:c&&"object"==typeof c&&Array.isArray(c.prompts)?c.prompts:[]).filter(a=>!!a&&"object"==typeof a).filter(a=>!!x(a.content).trim()));if(0===e.length)return b.status(400).json({error:"没有可导入的提示词"});let f=new Date().toISOString(),g=[];for(let a of e){let b=`custom:${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;n.customPrompts.push({id:b,name:(d=a.name,("string"==typeof d?d.trim():"").slice(0,120)||"导入提示词"),content:x(a.content),createdAt:f,updatedAt:f}),g.push(b)}let h=e.map((a,b)=>a.selected?g[b]:void 0).filter(Boolean);return h.length>0&&(n.selectedIds=Array.from(new Set([...n.selectedIds,...h]))),w(n),b.status(200).json({success:!0,imported:g.length,ids:g})}if("createCustom"===e){let a=new Date().toISOString(),c=`custom:${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;return n.customPrompts.push({id:c,name:String(h||"自定义提示词").trim()||"自定义提示词",content:"string"==typeof g?g:"",createdAt:a,updatedAt:a}),w(n),b.status(200).json({success:!0,id:c})}if("select"===e){let a=new Set(n.customPrompts.map(a=>a.id));return n.selectedIds=Array.isArray(k)?k.map(String).filter(b=>a.has(b)||b.startsWith("file:")):[],w(n),b.status(200).json({success:!0})}let o=q(String(f||""));if(!o||r(o)||!i.existsSync(o))return b.status(403).json({error:"Invalid project root"});let p=j.join(o,"CUSTOMIZE.md");if("create"===e)return i.existsSync(p)||i.writeFileSync(p,"string"==typeof g?g:"","utf-8"),n.selectedIds=Array.from(new Set([...n.selectedIds,u(p)])),w(n),b.status(200).json({success:!0,customizePath:p,mtime:i.statSync(p).mtime.toISOString()});return b.status(400).json({error:"Invalid action"})}if("PUT"===a.method){let{filePath:c,content:d,name:e}=a.body;if(!c||"string"!=typeof d)return b.status(400).json({error:"filePath and content required"});let f=String(c);if(f.startsWith("custom:")){let a=v(),c=a.customPrompts.find(a=>a.id===f);if(!c)return b.status(404).json({error:"Prompt not found"});return c.content=d,"string"==typeof e&&e.trim()&&(c.name=e.trim()),c.updatedAt=new Date().toISOString(),w(a),b.status(200).json({success:!0,mtime:c.updatedAt})}let g=q(f);if(!t(g))return b.status(403).json({error:"Invalid prompt file"});let h=j.dirname(g);if(!i.existsSync(h))return b.status(404).json({error:"Project directory not found"});return i.writeFileSync(g,d,"utf-8"),b.status(200).json({success:!0,mtime:i.statSync(g).mtime.toISOString()})}if("DELETE"===a.method){let{projectId:c,filePath:d}=a.body;if(!d)return b.status(400).json({error:"filePath required"});let e=String(d),f=v();if(e.startsWith("custom:"))return f.customPrompts=f.customPrompts.filter(a=>a.id!==e),f.selectedIds=f.selectedIds.filter(a=>a!==e),w(f),b.status(200).json({success:!0});let g=q(e);if(!t(g))return b.status(403).json({error:"Invalid prompt file"});if(i.existsSync(g)&&i.unlinkSync(g),f.selectedIds=f.selectedIds.filter(a=>a!==u(g)),w(f),c&&"current"!==c){let a=s(!1);try{a?.prepare("DELETE FROM project_registry WHERE project_id = ?").run(String(c))}finally{a?.close()}}return b.status(200).json({success:!0})}b.status(405).json({error:"Method not allowed"})}catch(a){console.error("[api] prompt",a),b.status(500).json({error:"Internal server error"})}}var z=c(68970),A=c(50296);let B=(0,h.M)(d,"default"),C=(0,h.M)(d,"config"),D=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/prompt",pathname:"/api/prompt",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function E(a,b,c){let d=await D.prepare(a,b,{srcPage:"/api/prompt"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,z.getTracer)(),e=d.getActiveScopeSpan(),j=D.instrumentationOnRequestError.bind(D),k=async e=>D.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:D.isDev,page:"/api/prompt",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==A.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(A.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:z.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(D.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},87550:a=>{a.exports=require("better-sqlite3")}};var b=require("../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=52201));module.exports=c})();
1
+ "use strict";(()=>{var a={};a.id=1289,a.ids=[1289],a.modules={21820:a=>{a.exports=require("os")},29021:a=>{a.exports=require("fs")},33873:a=>{a.exports=require("path")},52201:(a,b,c)=>{c.r(b),c.d(b,{config:()=>C,default:()=>B,handler:()=>E});var d={};c.r(d),c.d(d,{default:()=>y});var e=c(11400),f=c(50029),g=c(71086),h=c(38513),i=c(29021),j=c(33873),k=c(21820),l=c(87550),m=c.n(l);let n=j.join(k.homedir(),".customize-agent"),o=j.join(n,"projects","registry.db"),p=j.join(n,"prompts.json");function q(a){return j.resolve(a)}function r(a){let b=q(a),c=q(j.join(k.homedir(),".customize-agent")),d=b.split(j.sep);return b!==j.resolve(j.join(k.homedir(),".customize-agent","demo-project"))&&(b===c||b.endsWith(`${j.sep}apps${j.sep}server`)||b.endsWith(`${j.sep}apps${j.sep}cli`)||d.includes(".customize-agent"))}function s(a){return i.existsSync(o)?new(m())(o,{readonly:a}):null}function t(a){let b=q(a);return"CUSTOMIZE.md"===j.basename(b)&&(function(){let a=new Set,b=q(process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD??process.cwd());r(b)||a.add(b);let c=s(!0);if(!c)return a;try{for(let b of c.prepare("SELECT project_root FROM project_registry").all()){let c=q(String(b.project_root));r(c)||a.add(c)}}finally{c.close()}return a})().has(q(j.dirname(b)))}function u(a){return`file:${q(a)}`}function v(){try{let a=JSON.parse(i.readFileSync(p,"utf-8"));return{selectedIds:Array.isArray(a.selectedIds)?a.selectedIds.map(String):[],customPrompts:Array.isArray(a.customPrompts)?a.customPrompts:[]}}catch{return{selectedIds:[],customPrompts:[]}}}function w(a){i.mkdirSync(j.dirname(p),{recursive:!0}),i.writeFileSync(p,JSON.stringify(a,null,2),"utf-8")}function x(a){return"string"==typeof a?a:""}function y(a,b){try{if("GET"===a.method){let c=[],d=[],e=q(process.env.CUSTOMIZE_PROJECT_ROOT??process.env.INIT_CWD??process.cwd()),f=v(),g=u(j.join(e,"CUSTOMIZE.md")),h=i.existsSync(p)&&f.selectedIds.length>0?f.selectedIds:[g];if("export"===a.query.mode){let a=new Set(h),c={type:"customize-agent.prompts",version:1,exportedAt:new Date().toISOString(),prompts:f.customPrompts.map(b=>({name:b.name,content:b.content,selected:a.has(b.id),source:"custom"}))};return b.setHeader("Content-Type","application/json; charset=utf-8"),b.setHeader("Content-Disposition",`attachment; filename="customize-prompts-${new Date().toISOString().slice(0,10)}.json"`),b.status(200).json(c)}let k=s(!0);if(k)try{for(let a of k.prepare("SELECT project_id, project_root, project_name FROM project_registry ORDER BY last_opened_at DESC").all()){let b=q(String(a.project_root));if(r(b)){d.push(String(a.project_id));continue}let f=j.join(b,"CUSTOMIZE.md"),g=i.existsSync(f),k=u(f);c.push({id:k,projectId:String(a.project_id),projectRoot:b,projectName:String(a.project_name||j.basename(b)||b),customizePath:f,content:g?i.readFileSync(f,"utf-8"):"",mtime:g?i.statSync(f).mtime.toISOString():"",hasFile:g,isCurrent:b===e,selected:h.includes(k),source:b===e?"current":"project"})}}finally{k.close()}let l=j.join(e,"CUSTOMIZE.md");if(!r(e)&&!c.some(a=>a.projectRoot===e)){let a=i.existsSync(l);c.unshift({id:g,projectId:"current",projectRoot:e,projectName:j.basename(e)||e,customizePath:l,content:a?i.readFileSync(l,"utf-8"):"",mtime:a?i.statSync(l).mtime.toISOString():"",hasFile:a,isCurrent:!0,selected:h.includes(g),source:"current"})}for(let a of f.customPrompts)c.push({id:a.id,projectId:a.id,projectName:a.name,customizePath:a.id,content:a.content,mtime:a.updatedAt,hasFile:!0,isCurrent:!1,selected:h.includes(a.id),source:"custom"});return!function(a){if(0===a.length)return;let b=s(!1);if(b)try{let c=b.prepare("DELETE FROM project_registry WHERE project_id = ?");for(let b of a)c.run(b)}catch(a){}finally{b.close()}}(d),b.status(200).json(c)}if("POST"===a.method){var c,d;let{action:e,projectRoot:f,content:g,name:h,selectedIds:k,prompts:l,mode:m}=a.body,n=v();if("import"===e||"import"===m){let e=(c=l??a.body,(Array.isArray(c)?c:c&&"object"==typeof c&&Array.isArray(c.prompts)?c.prompts:[]).filter(a=>!!a&&"object"==typeof a).filter(a=>!!x(a.content).trim()));if(0===e.length)return b.status(400).json({error:"没有可导入的提示词"});let f=new Date().toISOString(),g=[];for(let a of e){let b=`custom:${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;n.customPrompts.push({id:b,name:(d=a.name,("string"==typeof d?d.trim():"").slice(0,120)||"导入提示词"),content:x(a.content),createdAt:f,updatedAt:f}),g.push(b)}let h=e.map((a,b)=>a.selected?g[b]:void 0).filter(Boolean);return h.length>0&&(n.selectedIds=Array.from(new Set([...n.selectedIds,...h]))),w(n),b.status(200).json({success:!0,imported:g.length,ids:g})}if("createCustom"===e){let a=new Date().toISOString(),c=`custom:${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;return n.customPrompts.push({id:c,name:String(h||"自定义提示词").trim()||"自定义提示词",content:"string"==typeof g?g:"",createdAt:a,updatedAt:a}),w(n),b.status(200).json({success:!0,id:c})}if("select"===e){let a=new Set(n.customPrompts.map(a=>a.id));return n.selectedIds=Array.isArray(k)?k.map(String).filter(b=>a.has(b)||b.startsWith("file:")):[],w(n),b.status(200).json({success:!0})}let o=q(String(f||""));if(!o||r(o)||!i.existsSync(o))return b.status(403).json({error:"Invalid project root"});let p=j.join(o,"CUSTOMIZE.md");if("create"===e)return i.existsSync(p)||i.writeFileSync(p,"string"==typeof g?g:"","utf-8"),n.selectedIds=Array.from(new Set([...n.selectedIds,u(p)])),w(n),b.status(200).json({success:!0,customizePath:p,mtime:i.statSync(p).mtime.toISOString()});return b.status(400).json({error:"Invalid action"})}if("PUT"===a.method){let{filePath:c,content:d,name:e}=a.body;if(!c||"string"!=typeof d)return b.status(400).json({error:"filePath and content required"});let f=String(c);if(f.startsWith("custom:")){let a=v(),c=a.customPrompts.find(a=>a.id===f);if(!c)return b.status(404).json({error:"Prompt not found"});return c.content=d,"string"==typeof e&&e.trim()&&(c.name=e.trim()),c.updatedAt=new Date().toISOString(),w(a),b.status(200).json({success:!0,mtime:c.updatedAt})}let g=q(f);if(!t(g))return b.status(403).json({error:"Invalid prompt file"});let h=j.dirname(g);if(!i.existsSync(h))return b.status(404).json({error:"Project directory not found"});return i.writeFileSync(g,d,"utf-8"),b.status(200).json({success:!0,mtime:i.statSync(g).mtime.toISOString()})}if("DELETE"===a.method){let{projectId:c,filePath:d}=a.body;if(!d)return b.status(400).json({error:"filePath required"});let e=String(d),f=v();if(e.startsWith("custom:"))return f.customPrompts=f.customPrompts.filter(a=>a.id!==e),f.selectedIds=f.selectedIds.filter(a=>a!==e),w(f),b.status(200).json({success:!0});let g=q(e);if(!t(g))return b.status(403).json({error:"Invalid prompt file"});if(i.existsSync(g)&&i.unlinkSync(g),f.selectedIds=f.selectedIds.filter(a=>a!==u(g)),w(f),c&&"current"!==c){let a=s(!1);try{a?.prepare("DELETE FROM project_registry WHERE project_id = ?").run(String(c))}finally{a?.close()}}return b.status(200).json({success:!0})}b.status(405).json({error:"Method not allowed"})}catch(a){console.error("[api] prompt",a),b.status(500).json({error:"Internal server error"})}}var z=c(68970),A=c(50296);let B=(0,h.M)(d,"default"),C=(0,h.M)(d,"config"),D=new g.PagesAPIRouteModule({definition:{kind:f.A.PAGES_API,page:"/api/prompt",pathname:"/api/prompt",bundlePath:"",filename:""},userland:d,distDir:".next",relativeProjectDir:""});async function E(a,b,c){let d=await D.prepare(a,b,{srcPage:"/api/prompt"});if(!d){b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve());return}let{query:f,params:g,prerenderManifest:h,routerServerContext:i}=d;try{let c=a.method||"GET",d=(0,z.getTracer)(),e=d.getActiveScopeSpan(),j=D.instrumentationOnRequestError.bind(D),k=async e=>D.render(a,b,{query:{...f,...g},params:g,allowedRevalidateHeaderKeys:[],multiZoneDraftMode:!1,trustHostHeader:!1,previewProps:h.preview,propagateError:!1,dev:D.isDev,page:"/api/prompt",internalRevalidate:null==i?void 0:i.revalidate,onError:(...b)=>j(a,...b)}).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let f=d.getRootSpanAttributes();if(!f)return;if(f.get("next.span_type")!==A.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${f.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let g=f.get("next.route");if(g){let a=`${c} ${g}`;e.setAttributes({"next.route":g,"http.route":g,"next.span_name":a}),e.updateName(a)}else e.updateName(`${c} ${a.url}`)});e?await k(e):await d.withPropagatedContext(a.headers,()=>d.trace(A.BaseServerSpan.handleRequest,{spanName:`${c} ${a.url}`,kind:z.SpanKind.SERVER,attributes:{"http.method":c,"http.target":a.url}},k))}catch(a){if(D.isDev)throw a;(0,e.sendError)(b,500,"Internal Server Error")}finally{null==c.waitUntil||c.waitUntil.call(c,Promise.resolve())}}},75600:a=>{a.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},87550:a=>{a.exports=require("better-sqlite3")}};var b=require("../../webpack-api-runtime.js");b.C(a);var c=b.X(0,[9705],()=>b(b.s=52201));module.exports=c})();